refactor(anneal): 优化炉火实绩明细数据结构和查询逻辑

- 将WmsAnnealPerformanceDetailVo中的coils列表改为单个coil对象
- 新增parentCoilIds字段支持按父卷ID批量查询加工后钢卷
- 实现通过parentCoilId查找split后子卷的映射逻辑
- 添加直接查询未split原卷的备用查询机制
- 重构详情数据扁平化处理,每个计划钢卷创建独立详情记录
- 优化统计信息重新计算逻辑,准确统计过滤后的计划数量
- 移除WmsMaterialCoilVo中不再使用的furnaceLevel字段
This commit is contained in:
2026-07-11 11:05:06 +08:00
parent 2a611bad19
commit 8fcb852d3d
5 changed files with 102 additions and 52 deletions

View File

@@ -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已出库/已发货)