feat(gear-oa): 调整订单查询逻辑并优化相关VO字段导出配置
移除了 gear_product 表关联时的 del_flag 条件限制,新增了 selectVoPagePlus方法以支持更灵活的订单分页查询。同时在多个 VO 类中移除了不必要的 @ExcelProperty 注解,避免冗余数据导出。
This commit is contained in:
@@ -86,7 +86,6 @@ public class GearRequirementsVo {
|
||||
private String ownerNickName;
|
||||
private String projectName;
|
||||
//订单编号
|
||||
@ExcelProperty(value = "订单编号")
|
||||
private String orderCode;
|
||||
|
||||
// 图片展示
|
||||
|
||||
@@ -148,6 +148,5 @@ public class GearReturnExchangeVo {
|
||||
@ExcelProperty(value = "无税单价")
|
||||
private BigDecimal noTaxPrice;
|
||||
//客户名称
|
||||
@ExcelProperty(value = "客户名称")
|
||||
private String customerName;
|
||||
}
|
||||
|
||||
@@ -112,7 +112,6 @@ public class GearSalaryRecordsVo {
|
||||
private String payStatus;
|
||||
|
||||
//联查昵称
|
||||
@ExcelProperty(value = "员工姓名")
|
||||
private String employeeName;
|
||||
|
||||
|
||||
|
||||
@@ -17,4 +17,6 @@ import org.apache.ibatis.annotations.Param;
|
||||
public interface GearOrderMapper extends BaseMapperPlus<GearOrderMapper, GearOrder, GearOrderVo> {
|
||||
|
||||
Page<GearOrderVo> selectVoPlusPage(Page<?> page, @Param("ew") Wrapper<GearOrder> wrapper);
|
||||
|
||||
Page<GearOrderVo> selectVoPagePlus(Page<Object> build, QueryWrapper<GearOrder> lqw);
|
||||
}
|
||||
|
||||
@@ -45,11 +45,25 @@ public class GearOrderServiceImpl implements IGearOrderService {
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<GearOrderVo> queryPageList(GearOrderBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<GearOrder> lqw = buildQueryWrapper(bo);
|
||||
Page<GearOrderVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
QueryWrapper<GearOrder> lqw = buildQueryWrapperPlus(bo);
|
||||
Page<GearOrderVo> result = baseMapper.selectVoPagePlus(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
private QueryWrapper<GearOrder> buildQueryWrapperPlus(GearOrderBo bo) {
|
||||
QueryWrapper<GearOrder> lqw = Wrappers.query();
|
||||
//表别名的方式进行联查
|
||||
lqw.like(StringUtils.isNotBlank(bo.getOrderCode()), "o.order_code", bo.getOrderCode());
|
||||
lqw.eq(bo.getCustomerId() != null, "o.customer_id", bo.getCustomerId());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getSalesManager()), "o.sales_manager", bo.getSalesManager());
|
||||
lqw.eq(bo.getOrderStatus() != null, "o.order_status", bo.getOrderStatus());
|
||||
lqw.eq(bo.getTradeType() != null, "o.trade_type", bo.getTradeType());
|
||||
lqw.eq(bo.getTaxAmount() != null, "o.tax_amount", bo.getTaxAmount());
|
||||
lqw.eq(bo.getNoTaxAmount() != null, "o.no_tax_amount", bo.getNoTaxAmount());
|
||||
lqw.eq("o.del_flag", 0);
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询订单主列表
|
||||
*/
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
p.product_name AS productName,
|
||||
p.product_code AS productCode
|
||||
FROM gear_order_detail d
|
||||
LEFT JOIN gear_product p ON d.product_id = p.product_id AND p.del_flag = 0
|
||||
LEFT JOIN gear_product p ON d.product_id = p.product_id
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
|
||||
|
||||
@@ -39,6 +39,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
left join gear_customer c on o.customer_id = c.customer_id and c.del_flag = 0
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
<select id="selectVoPagePlus" resultType="com.gear.oa.domain.vo.GearOrderVo">
|
||||
select o.order_id,
|
||||
o.order_code,
|
||||
o.customer_id,
|
||||
o.sales_manager,
|
||||
o.order_status,
|
||||
o.remark,
|
||||
o.del_flag,
|
||||
o.create_time,
|
||||
o.create_by,
|
||||
o.update_time,
|
||||
o.update_by,
|
||||
o.tax_amount,
|
||||
o.no_tax_amount,
|
||||
c.name as customerName
|
||||
from gear_order o
|
||||
left join gear_customer c on o.customer_id = c.customer_id and c.del_flag = 0
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user