feat(WmsAnnealPerformance): 添加当前钢卷号和逻辑库区ID筛选功能
- 在WmsAnnealPerformanceBo中新增currentCoilNo和warehouseId字段 - 在Mapper XML中添加currentCoilNo和warehouseId的查询条件 - 修改JOIN条件以支持多字段筛选 - 在服务实现中添加对新字段的筛选逻辑 - 更新注释内容以反映新的筛选条件
This commit is contained in:
@@ -23,9 +23,18 @@ public class WmsAnnealPerformanceBo {
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date endTime;
|
||||
|
||||
// 目标库区id
|
||||
private Long targetFurnaceId;
|
||||
|
||||
// 计划号
|
||||
private String planNo;
|
||||
|
||||
// 入场钢卷号
|
||||
private String enterCoilNo;
|
||||
|
||||
// 当前钢卷号
|
||||
private String currentCoilNo;
|
||||
|
||||
// 逻辑库区id
|
||||
private Long warehouseId;
|
||||
}
|
||||
|
||||
@@ -140,13 +140,25 @@ public class WmsAnnealPerformanceServiceImpl implements IWmsAnnealPerformanceSer
|
||||
// 设置炉火层级
|
||||
coilVo.setFurnaceLevel(planCoil.getFurnaceLevel());
|
||||
|
||||
// 如果传入了enterCoilNo筛选条件,只保留匹配的钢卷
|
||||
// 如果传入了筛选条件,只保留匹配的钢卷
|
||||
if (bo.getEnterCoilNo() != null && !bo.getEnterCoilNo().isEmpty()) {
|
||||
if (coilVo.getEnterCoilNo() == null ||
|
||||
!coilVo.getEnterCoilNo().contains(bo.getEnterCoilNo())) {
|
||||
continue; // 跳过不匹配的钢卷
|
||||
}
|
||||
}
|
||||
if (bo.getCurrentCoilNo() != null && !bo.getCurrentCoilNo().isEmpty()) {
|
||||
if (coilVo.getCurrentCoilNo() == null ||
|
||||
!coilVo.getCurrentCoilNo().contains(bo.getCurrentCoilNo())) {
|
||||
continue; // 跳过不匹配的钢卷
|
||||
}
|
||||
}
|
||||
if (bo.getWarehouseId() != null) {
|
||||
if (coilVo.getWarehouseId() == null ||
|
||||
!coilVo.getWarehouseId().equals(bo.getWarehouseId())) {
|
||||
continue; // 跳过不匹配的钢卷
|
||||
}
|
||||
}
|
||||
|
||||
coilVos.add(coilVo);
|
||||
}
|
||||
|
||||
@@ -20,6 +20,13 @@
|
||||
<if test="enterCoilNo != null and enterCoilNo != ''">
|
||||
AND mc.enter_coil_no LIKE CONCAT('%', #{enterCoilNo}, '%')
|
||||
</if>
|
||||
<!-- 当前钢卷号和逻辑库区id匹配 -->
|
||||
<if test="currentCoilNo != null and currentCoilNo != ''">
|
||||
AND mc.current_coil_no LIKE CONCAT('%', #{currentCoilNo}, '%')
|
||||
</if>
|
||||
<if test="warehouseId != null">
|
||||
AND mc.warehouse_id = #{warehouseId}
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
@@ -42,7 +49,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 != ''">
|
||||
<if test="enterCoilNo != null and enterCoilNo != '' or currentCoilNo != null and currentCoilNo != '' or 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