refactor(anneal): 优化炉火实绩明细数据结构和查询逻辑
- 将WmsAnnealPerformanceDetailVo中的coils列表改为单个coil对象 - 新增parentCoilIds字段支持按父卷ID批量查询加工后钢卷 - 实现通过parentCoilId查找split后子卷的映射逻辑 - 添加直接查询未split原卷的备用查询机制 - 重构详情数据扁平化处理,每个计划钢卷创建独立详情记录 - 优化统计信息重新计算逻辑,准确统计过滤后的计划数量 - 移除WmsMaterialCoilVo中不再使用的furnaceLevel字段
This commit is contained in:
@@ -1253,6 +1253,31 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
|
||||
qw.in("mc.coil_id", coilIdList);
|
||||
}
|
||||
}
|
||||
// 根据parentCoilId筛选(查询某个原始钢卷的加工后子卷,支持逗号分隔多ID)
|
||||
// 注意此处合卷不能用
|
||||
if (StringUtils.isNotBlank(bo.getParentCoilIds())) {
|
||||
String[] parentIdArray = bo.getParentCoilIds().split("-");
|
||||
List<String> findInSetConditions = new ArrayList<>();
|
||||
for (String pid : parentIdArray) {
|
||||
String trimmed = pid.trim();
|
||||
if (StringUtils.isNotBlank(trimmed)) {
|
||||
try {
|
||||
Long.parseLong(trimmed);
|
||||
findInSetConditions.add("FIND_IN_SET('" + trimmed + "', mc.parent_coil_id)");
|
||||
} catch (NumberFormatException e) {
|
||||
// 忽略无效ID
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!findInSetConditions.isEmpty()) {
|
||||
qw.and(w -> {
|
||||
for (int i = 0; i < findInSetConditions.size(); i++) {
|
||||
if (i > 0) w.or();
|
||||
w.apply(findInSetConditions.get(i));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
// // 仅查询未发货且未绑定在发货计划里的钢卷
|
||||
// if (Boolean.TRUE.equals(bo.getOnlyUnshippedAndUnplanned())) {
|
||||
// // 未发货:排除状态=1(已出库/已发货)
|
||||
|
||||
Reference in New Issue
Block a user