feat(WmsMaterialCoil): 修改原料材质的匹配功能
- 新增 onlyEmptyPackingStatus 字段用于查询打包状态为空的钢卷 - 修改数据库查询逻辑增加打包状态非空条件 - 更新查询条件实现打包状态匹配优化 - 添加服务层业务逻辑支持打包状态筛选功能
This commit is contained in:
@@ -372,5 +372,11 @@ public class WmsMaterialCoilBo extends BaseEntity {
|
|||||||
*/
|
*/
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private Boolean exportTimeBy;
|
private Boolean exportTimeBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否只查询打包状态为空的钢卷(true=只查询packing_status为NULL或空字符串的钢卷)
|
||||||
|
*/
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Boolean onlyEmptyPackingStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -858,6 +858,10 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
|
|||||||
qw.in("mc.create_by", createByList);
|
qw.in("mc.create_by", createByList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// 只查询打包状态为空的钢卷
|
||||||
|
if (Boolean.TRUE.equals(bo.getOnlyEmptyPackingStatus())) {
|
||||||
|
qw.and(w -> w.isNull("mc.packing_status").or().eq("mc.packing_status", ""));
|
||||||
|
}
|
||||||
//根据异常数量筛选(大于等于指定值)
|
//根据异常数量筛选(大于等于指定值)
|
||||||
if (bo.getMinAbnormalCount() != null) {
|
if (bo.getMinAbnormalCount() != null) {
|
||||||
qw.apply("COALESCE(ca.abnormal_count, 0) >= {0}", bo.getMinAbnormalCount());
|
qw.apply("COALESCE(ca.abnormal_count, 0) >= {0}", bo.getMinAbnormalCount());
|
||||||
|
|||||||
@@ -1041,6 +1041,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
FROM wms_material_coil mc
|
FROM wms_material_coil mc
|
||||||
WHERE mc.del_flag = 0
|
WHERE mc.del_flag = 0
|
||||||
AND mc.enter_coil_no IS NOT NULL
|
AND mc.enter_coil_no IS NOT NULL
|
||||||
|
AND mc.packing_status IS NOT NULL
|
||||||
AND mc.enter_coil_no IN (
|
AND mc.enter_coil_no IN (
|
||||||
SELECT DISTINCT mci.enter_coil_no
|
SELECT DISTINCT mci.enter_coil_no
|
||||||
FROM wms_material_coil mci
|
FROM wms_material_coil mci
|
||||||
@@ -1049,18 +1050,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
AND mci.item_id IS NOT NULL
|
AND mci.item_id IS NOT NULL
|
||||||
AND (mci.item_type = 'raw_material' AND rm.raw_material_name LIKE '%热轧卷板%')
|
AND (mci.item_type = 'raw_material' AND rm.raw_material_name LIKE '%热轧卷板%')
|
||||||
)
|
)
|
||||||
AND (
|
AND EXISTS (
|
||||||
mc.packing_status IS NULL
|
|
||||||
OR
|
|
||||||
EXISTS (
|
|
||||||
SELECT 1
|
SELECT 1
|
||||||
FROM wms_material_coil mci2
|
FROM wms_material_coil mci2
|
||||||
LEFT JOIN wms_raw_material rm2 ON mci2.item_type = 'raw_material' AND mci2.item_id = rm2.raw_material_id AND rm2.del_flag = 0
|
LEFT JOIN wms_raw_material rm2 ON mci2.item_type = 'raw_material' AND mci2.item_id = rm2.raw_material_id AND rm2.del_flag = 0
|
||||||
WHERE mci2.del_flag = 0
|
WHERE mci2.del_flag = 0
|
||||||
AND mci2.enter_coil_no = mc.enter_coil_no
|
AND mci2.enter_coil_no = mc.enter_coil_no
|
||||||
AND (mci2.item_type = 'raw_material' AND rm2.raw_material_name LIKE '%热轧卷板%' AND (mc.packing_status != rm2.material OR rm2.material IS NULL))
|
AND mci2.item_type = 'raw_material'
|
||||||
|
AND rm2.raw_material_name LIKE '%热轧卷板%'
|
||||||
|
AND (
|
||||||
|
rm2.material IS NULL
|
||||||
|
OR (
|
||||||
|
mc.packing_status NOT LIKE CONCAT(rm2.material, '%')
|
||||||
|
AND rm2.material NOT LIKE CONCAT(mc.packing_status, '%')
|
||||||
|
)
|
||||||
|
)
|
||||||
)
|
)
|
||||||
)
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
Reference in New Issue
Block a user