feat(wms): 优化应收款和应付款管理查询功能
- 新增 selectVoPagePlus 方法以支持自定义 SQL 查询 -重构 queryPageList 方法,使用新的查询方式 - 添加供应商名称和客户名称字段到相应的 VO 类- 更新 XML 文件以包含新的查询 SQL
This commit is contained in:
@@ -80,5 +80,9 @@ public class WmsPayableVo {
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
/**
|
||||
* 供应商名称
|
||||
*/
|
||||
@ExcelProperty(value = "供应商名称")
|
||||
private String supplierName;
|
||||
}
|
||||
|
||||
@@ -80,5 +80,9 @@ public class WmsReceivableVo {
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
/**
|
||||
* 客户名称
|
||||
*/
|
||||
@ExcelProperty(value = "客户名称")
|
||||
private String customerName;
|
||||
}
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
package com.klp.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.klp.domain.WmsPayable;
|
||||
import com.klp.domain.vo.WmsPayableVo;
|
||||
import com.klp.common.core.mapper.BaseMapperPlus;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 应付款管理(宽松版)Mapper接口
|
||||
@@ -12,4 +15,5 @@ import com.klp.common.core.mapper.BaseMapperPlus;
|
||||
*/
|
||||
public interface WmsPayableMapper extends BaseMapperPlus<WmsPayableMapper, WmsPayable, WmsPayableVo> {
|
||||
|
||||
Page<WmsPayableVo> selectVoPagePlus(Page<Object> build, @Param("ew") QueryWrapper<WmsPayable> lqw);
|
||||
}
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
package com.klp.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.klp.domain.WmsReceivable;
|
||||
import com.klp.domain.vo.WmsReceivableVo;
|
||||
import com.klp.common.core.mapper.BaseMapperPlus;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 应收款管理(宽松版)Mapper接口
|
||||
@@ -12,4 +15,5 @@ import com.klp.common.core.mapper.BaseMapperPlus;
|
||||
*/
|
||||
public interface WmsReceivableMapper extends BaseMapperPlus<WmsReceivableMapper, WmsReceivable, WmsReceivableVo> {
|
||||
|
||||
Page<WmsReceivableVo> selectVoPagePlus(Page<Object> build, @Param("ew") QueryWrapper<WmsReceivable> lqw);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.klp.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
@@ -16,7 +17,6 @@ import com.klp.mapper.WmsPayableMapper;
|
||||
import com.klp.service.IWmsPayableService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
@@ -44,11 +44,24 @@ public class WmsPayableServiceImpl implements IWmsPayableService {
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<WmsPayableVo> queryPageList(WmsPayableBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<WmsPayable> lqw = buildQueryWrapper(bo);
|
||||
Page<WmsPayableVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
QueryWrapper<WmsPayable> lqw = buildQueryWrapperPlus(bo);
|
||||
Page<WmsPayableVo> result = baseMapper.selectVoPagePlus(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
private QueryWrapper<WmsPayable> buildQueryWrapperPlus(WmsPayableBo bo) {
|
||||
QueryWrapper<WmsPayable> lqw = Wrappers.query();
|
||||
lqw.eq("p.del_flag", 0);
|
||||
lqw.eq(bo.getSupplierId() != null, "p.supplier_id", bo.getSupplierId());
|
||||
lqw.eq(bo.getOrderId() != null, "p.order_id", bo.getOrderId());
|
||||
lqw.eq(bo.getDueDate() != null, "p.due_date", bo.getDueDate());
|
||||
lqw.eq(bo.getAmount() != null, "p.amount", bo.getAmount());
|
||||
lqw.eq(bo.getPaidAmount() != null, "p.paid_amount", bo.getPaidAmount());
|
||||
lqw.eq(bo.getBalanceAmount() != null, "p.balance_amount", bo.getBalanceAmount());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getStatus()), "p.status", bo.getStatus());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询应付款管理(宽松版)列表
|
||||
*/
|
||||
@@ -59,14 +72,13 @@ public class WmsPayableServiceImpl implements IWmsPayableService {
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<WmsPayable> buildQueryWrapper(WmsPayableBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<WmsPayable> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(bo.getSupplierId() != null, WmsPayable::getSupplierId, bo.getSupplierId());
|
||||
lqw.eq(bo.getOrderId() != null, WmsPayable::getOrderId, bo.getOrderId());
|
||||
lqw.eq(bo.getDueDate() != null, WmsPayable::getDueDate, bo.getDueDate());
|
||||
lqw.eq(bo.getSupplierId() != null, WmsPayable::getSupplierId, bo.getSupplierId());
|
||||
lqw.eq(bo.getAmount() != null, WmsPayable::getAmount, bo.getAmount());
|
||||
lqw.eq(bo.getPaidAmount() != null, WmsPayable::getPaidAmount, bo.getPaidAmount());
|
||||
lqw.eq(bo.getBalanceAmount() != null, WmsPayable::getBalanceAmount, bo.getBalanceAmount());
|
||||
lqw.eq(bo.getPaidAmount() != null, WmsPayable::getPaidAmount, bo.getPaidAmount());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getStatus()), WmsPayable::getStatus, bo.getStatus());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.klp.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
@@ -44,11 +45,24 @@ public class WmsReceivableServiceImpl implements IWmsReceivableService {
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<WmsReceivableVo> queryPageList(WmsReceivableBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<WmsReceivable> lqw = buildQueryWrapper(bo);
|
||||
Page<WmsReceivableVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
QueryWrapper<WmsReceivable> lqw = buildQueryWrapperPlus(bo);
|
||||
Page<WmsReceivableVo> result = baseMapper.selectVoPagePlus(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
private QueryWrapper<WmsReceivable> buildQueryWrapperPlus(WmsReceivableBo bo) {
|
||||
QueryWrapper<WmsReceivable> lqw = Wrappers.query();
|
||||
lqw.eq("r.del_flag", 0);
|
||||
lqw.eq(bo.getCustomerId() != null, "r.customer_id", bo.getCustomerId());
|
||||
lqw.eq(bo.getOrderId() != null, "r.order_id", bo.getOrderId());
|
||||
lqw.eq(bo.getDueDate() != null, "r.due_date", bo.getDueDate());
|
||||
lqw.eq(bo.getAmount() != null, "r.amount", bo.getAmount());
|
||||
lqw.eq(bo.getPaidAmount() != null, "r.paid_amount", bo.getPaidAmount());
|
||||
lqw.eq(bo.getBalanceAmount() != null, "r.balance_amount", bo.getBalanceAmount());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getStatus()), "r.status", bo.getStatus());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询应收款管理(宽松版)列表
|
||||
*/
|
||||
|
||||
@@ -20,6 +20,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
</resultMap>
|
||||
<select id="selectVoPagePlus" resultType="com.klp.domain.vo.WmsPayableVo">
|
||||
select p.payable_id,
|
||||
p.supplier_id,
|
||||
s.name as supplierName,
|
||||
p.order_id,
|
||||
p.due_date,
|
||||
p.amount,
|
||||
p.paid_amount,
|
||||
p.balance_amount,
|
||||
p.status,
|
||||
p.del_flag,
|
||||
p.remark,
|
||||
p.create_time,
|
||||
p.create_by,
|
||||
p.update_time,
|
||||
p.update_by
|
||||
from wms_payable p
|
||||
left join wms_supplier s on p.supplier_id = s.supplier_id
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -21,5 +21,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="updateBy" column="update_by"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="selectVoPagePlus" resultType="com.klp.domain.vo.WmsReceivableVo">
|
||||
select r.receivable_id,
|
||||
r.customer_id,
|
||||
r.order_id,
|
||||
r.due_date,
|
||||
r.amount,
|
||||
r.paid_amount,
|
||||
r.balance_amount,
|
||||
r.status,
|
||||
r.del_flag,
|
||||
r.remark,
|
||||
r.create_time,
|
||||
r.create_by,
|
||||
r.update_time,
|
||||
r.update_by,
|
||||
c.name as customerName
|
||||
from wms_receivable r
|
||||
left join wms_customer c on r.customer_id = c.customer_id
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user