refactor(WmsAnnealPerformance): 优化退火性能查询的过滤逻辑
- 移除 mapper 中废弃的钢卷号过滤条件和库区筛选参数 - 简化 SQL 查询中的条件判断逻辑 - 统一服务层中的空值检查方法 - 优化查询性能并减少不必要的 JOIN 操作
This commit is contained in:
@@ -144,17 +144,17 @@ public class WmsAnnealPerformanceServiceImpl implements IWmsAnnealPerformanceSer
|
||||
continue; // 没找到加工后的卷,跳过
|
||||
}
|
||||
|
||||
// 如果传入了筛选条件,只保留匹配的钢卷
|
||||
if (bo.getEnterCoilNo() != null && !bo.getEnterCoilNo().isEmpty()) {
|
||||
// 筛选加工后的钢卷
|
||||
if (StringUtils.isNotBlank(bo.getEnterCoilNo())) {
|
||||
if (coilVo.getEnterCoilNo() == null ||
|
||||
!coilVo.getEnterCoilNo().contains(bo.getEnterCoilNo())) {
|
||||
continue; // 跳过不匹配的钢卷
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (bo.getCurrentCoilNo() != null && !bo.getCurrentCoilNo().isEmpty()) {
|
||||
if (StringUtils.isNotBlank(bo.getCurrentCoilNo())) {
|
||||
if (coilVo.getCurrentCoilNo() == null ||
|
||||
!coilVo.getCurrentCoilNo().contains(bo.getCurrentCoilNo())) {
|
||||
continue; // 跳过不匹配的钢卷
|
||||
continue;
|
||||
}
|
||||
}
|
||||
// 钢卷本身的逻辑库区筛选(coilVo.warehouseId保持不变)
|
||||
@@ -164,7 +164,6 @@ public class WmsAnnealPerformanceServiceImpl implements IWmsAnnealPerformanceSer
|
||||
continue; // 跳过不匹配的钢卷
|
||||
}
|
||||
}
|
||||
|
||||
// 为每个planCoil创建独立的detail,携带自身的logicWarehouseId/furnaceLevel
|
||||
WmsAnnealPerformanceDetailVo coilDetail = new WmsAnnealPerformanceDetailVo();
|
||||
coilDetail.setPlanId(detail.getPlanId());
|
||||
|
||||
@@ -17,21 +17,10 @@
|
||||
<if test="planNo != null and planNo != ''">
|
||||
AND p.plan_no LIKE CONCAT('%', #{planNo}, '%')
|
||||
</if>
|
||||
<if test="enterCoilNo != null and enterCoilNo != ''">
|
||||
AND mc.enter_coil_no LIKE CONCAT('%', #{enterCoilNo}, '%')
|
||||
</if>
|
||||
<!-- 当前钢卷号匹配 -->
|
||||
<if test="currentCoilNo != null and currentCoilNo != ''">
|
||||
AND mc.current_coil_no LIKE CONCAT('%', #{currentCoilNo}, '%')
|
||||
</if>
|
||||
<!-- 出炉时的逻辑库区筛选(wms_furnace_plan_coil.logic_warehouse_id) -->
|
||||
<if test="warehouseId != null">
|
||||
AND pc.logic_warehouse_id = #{warehouseId}
|
||||
</if>
|
||||
<!-- 钢卷本身的逻辑库区筛选(wms_material_coil.warehouse_id) -->
|
||||
<if test="coilWarehouseId != null">
|
||||
AND mc.warehouse_id = #{coilWarehouseId}
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
@@ -54,7 +43,7 @@
|
||||
p.end_time AS endTime
|
||||
FROM wms_furnace_plan p
|
||||
LEFT JOIN wms_furnace f ON f.furnace_id = p.target_furnace_id
|
||||
<if test="enterCoilNo != null and enterCoilNo != '' or currentCoilNo != null and currentCoilNo != '' or warehouseId != null or coilWarehouseId != null">
|
||||
<if test="warehouseId != null">
|
||||
INNER JOIN wms_furnace_plan_coil pc ON pc.plan_id = p.plan_id AND pc.del_flag = 0
|
||||
INNER JOIN wms_material_coil mc ON mc.coil_id = pc.coil_id AND mc.del_flag = 0
|
||||
</if>
|
||||
|
||||
Reference in New Issue
Block a user