feat(material): 添加材料卷材下一库区多选功能支持
- 在 WmsMaterialCoilBo 中新增 nextWarehouseIds 字段用于存储多个库区ID - 在查询逻辑中统一处理 nextWarehouseId 与 nextWarehouseIds 的过滤条件 - 实现对逗号分隔的库区ID字符串解析和数字转换功能 - 修复逻辑删除条件重复设置的问题 - 优化库区ID列表的去重和过滤处理逻辑
This commit is contained in:
@@ -66,6 +66,11 @@ public class WmsMaterialCoilBo extends BaseEntity {
|
||||
*/
|
||||
private Long nextWarehouseId;
|
||||
|
||||
/**
|
||||
* 下一库区IDs(逗号分隔)
|
||||
*/
|
||||
private String nextWarehouseIds;
|
||||
|
||||
/**
|
||||
* 关联二维码ID(wms_generate_record.record_id)
|
||||
*/
|
||||
|
||||
@@ -416,6 +416,8 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
|
||||
qw.eq(StringUtils.isNotBlank(bo.getTemperGrade()), "mc.temper_grade", bo.getTemperGrade());
|
||||
// 独占状态
|
||||
qw.eq(bo.getExclusiveStatus() != null, "mc.exclusive_status", bo.getExclusiveStatus());
|
||||
//逻辑删除
|
||||
qw.eq("mc.del_flag", 0);
|
||||
// 统一处理 warehouseId 与 warehouseIds:
|
||||
List<Long> warehouseIdList = new ArrayList<>();
|
||||
if (bo.getWarehouseId() != null) {
|
||||
@@ -436,6 +438,25 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
|
||||
qw.in("mc.warehouse_id", warehouseIdList.stream().distinct().collect(Collectors.toList()));
|
||||
}
|
||||
|
||||
// 统一处理 nextWarehouseId 与 nextWarehouseIds:
|
||||
List<Long> nextWarehouseIdList = new ArrayList<>();
|
||||
if (bo.getNextWarehouseId() != null) {
|
||||
nextWarehouseIdList.add(bo.getNextWarehouseId());
|
||||
}
|
||||
if (StringUtils.isNotBlank(bo.getNextWarehouseIds())) {
|
||||
String[] nextWarehouseIdArray = bo.getNextWarehouseIds().split(",");
|
||||
for (String nextWarehouseIdStr : nextWarehouseIdArray) {
|
||||
if (StringUtils.isNotBlank(nextWarehouseIdStr)) {
|
||||
try {
|
||||
nextWarehouseIdList.add(Long.parseLong(nextWarehouseIdStr.trim()));
|
||||
} catch (NumberFormatException ignore) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!nextWarehouseIdList.isEmpty()) {
|
||||
qw.in("mc.next_warehouse_id", nextWarehouseIdList.stream().distinct().collect(Collectors.toList()));
|
||||
}
|
||||
// 新增长度
|
||||
qw.eq(bo.getLength() != null, "mc.length", bo.getLength());
|
||||
// 如果actualWarehouseId不为空,则根据实际库区ID进行查询 如果为-1,则查询无库区的数据
|
||||
@@ -584,8 +605,6 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
|
||||
// "WHERE dp.del_flag = 0 AND dp.coil IS NOT NULL AND dp.coil <> '' " +
|
||||
// "AND FIND_IN_SET(CAST(mc.coil_id AS CHAR), dp.coil))");
|
||||
// }
|
||||
//逻辑删除
|
||||
qw.eq("mc.del_flag", 0);
|
||||
//把team字段作为筛选条件
|
||||
qw.eq(StringUtils.isNotBlank(bo.getTeam()), "mc.team", bo.getTeam());
|
||||
//根据开始时间和结束时间筛选修改时间
|
||||
|
||||
Reference in New Issue
Block a user