refactor(delivery): 移除重复的钢卷查询接口并优化查询逻辑
- 删除 IWmsDeliveryPlanService 中的 getCoilInfoByIds 方法定义 - 删除 WmsDeliveryPlanBo 中冗余的 coilIds 字段 - 移除 WmsDeliveryPlanController 中独立的 /coils 接口实现 - 删除 WmsDeliveryPlanServiceImpl 中 getCoilInfoByIds 的具体实现 - 在 WmsMaterialCoilBo 中重新添加 coilIds 字段用于批量查询 - 优化 WmsMaterialCoilServiceImpl 中对 coilIds 的解析与查询逻辑 - 增强 coilIds 解析健壮性,忽略无效 ID 并防止空值异常
This commit is contained in:
@@ -350,6 +350,23 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
|
||||
// 兼容原来的itemId单值查询
|
||||
qw.eq("mc.item_id", bo.getItemId());
|
||||
}
|
||||
// 添加coilIds查询条件,支持逗号分隔的多个coilId查询
|
||||
if (StringUtils.isNotBlank(bo.getCoilIds())) {
|
||||
String[] coilIdArray = bo.getCoilIds().split(",");
|
||||
List<Long> coilIdList = new ArrayList<>();
|
||||
for (String coilIdStr : coilIdArray) {
|
||||
if (StringUtils.isNotBlank(coilIdStr)) {
|
||||
try {
|
||||
coilIdList.add(Long.parseLong(coilIdStr.trim()));
|
||||
} catch (NumberFormatException e) {
|
||||
// 忽略无效的ID格式
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!coilIdList.isEmpty()) {
|
||||
qw.in("mc.coil_id", coilIdList);
|
||||
}
|
||||
}
|
||||
//逻辑删除
|
||||
qw.eq("mc.del_flag", 0);
|
||||
//把team字段作为筛选条件
|
||||
|
||||
Reference in New Issue
Block a user