feat(wms): 添加销售ID字段并优化查询逻辑
- 在 WmsMaterialCoil、WmsMaterialCoilBo 和 WmsMaterialCoilVo 中新增 saleId 字段 - 在 WmsMaterialCoilVo 中新增 saleName 字段用于展示销售昵称 - 更新 Mapper XML 文件,关联 sys_user 表以获取销售用户信息 - 扩展查询条件,支持根据 saleId 进行精确查询及空值查询 - 实现 saleId 为 -1 时查询未分配销售的记录逻辑
This commit is contained in:
@@ -128,5 +128,8 @@ public class WmsMaterialCoil extends BaseEntity {
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@ExcelProperty(value = "发货时间")
|
||||
private Date exportTime;
|
||||
|
||||
//销售id
|
||||
private Long saleId;
|
||||
}
|
||||
|
||||
|
||||
@@ -183,5 +183,7 @@ public class WmsMaterialCoilBo extends BaseEntity {
|
||||
|
||||
private Boolean onlyUnshippedAndUnplanned;
|
||||
|
||||
//销售id
|
||||
private Long saleId;
|
||||
}
|
||||
|
||||
|
||||
@@ -310,5 +310,9 @@ public class WmsMaterialCoilVo extends BaseEntity {
|
||||
private String createByName;
|
||||
private String updateByName;
|
||||
|
||||
//销售id
|
||||
private Long saleId;
|
||||
// 销售昵称
|
||||
private String saleName;
|
||||
}
|
||||
|
||||
|
||||
@@ -337,6 +337,16 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
|
||||
qw.eq(bo.getStatus() != null, "mc.status", bo.getStatus());
|
||||
qw.eq(bo.getActualWarehouseId() != null, "mc.actual_warehouse_id", bo.getActualWarehouseId());
|
||||
qw.eq(StringUtils.isNotBlank(bo.getItemType()), "mc.item_type", bo.getItemType());
|
||||
// 新增查询逻辑也就是当saleId未空时候
|
||||
if (bo.getSaleId() != null) {
|
||||
if (bo.getSaleId() == -1) {
|
||||
// 当saleId为-1时查询sale_id为空的记录
|
||||
qw.isNull("mc.sale_id");
|
||||
} else if (bo.getSaleId() > 0) {
|
||||
// 正常传值时依据saleId作为查询条件
|
||||
qw.eq("mc.sale_id", bo.getSaleId());
|
||||
}
|
||||
}
|
||||
|
||||
// 组合 item_id 条件:selectType 细粒度筛选 与 显式 itemIds/itemId 的并行支持
|
||||
List<Long> matchedItemIds = null; // 来自 selectType + 多字段筛选
|
||||
|
||||
@@ -94,7 +94,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
mc.trimming_requirement,
|
||||
mc.packaging_requirement,
|
||||
mc.packing_status,
|
||||
mc.sale_id AS saleId,
|
||||
w.warehouse_name AS warehouseName,
|
||||
su.nick_name AS saleName,
|
||||
aw.actual_warehouse_name AS actualWarehouseName,
|
||||
CASE WHEN mc.item_type = 'raw_material' THEN rm.specification
|
||||
WHEN mc.item_type = 'product' THEN p.specification
|
||||
@@ -127,6 +129,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
FROM wms_material_coil mc
|
||||
LEFT JOIN wms_warehouse w ON mc.warehouse_id = w.warehouse_id
|
||||
LEFT JOIN wms_actual_warehouse aw ON mc.actual_warehouse_id = aw.actual_warehouse_id
|
||||
LEFT JOIN sys_user su ON mc.sale_id = su.user_id
|
||||
LEFT JOIN wms_raw_material rm ON mc.item_type = 'raw_material' AND mc.item_id = rm.raw_material_id
|
||||
LEFT JOIN wms_product p ON mc.item_type = 'product' AND mc.item_id = p.product_id
|
||||
LEFT JOIN (
|
||||
|
||||
Reference in New Issue
Block a user