feat(WmsMaterialCoil): 添加排除已绑定排产明细钢卷功能
- 在 WmsMaterialCoilBo 中新增 excludeScheduledDetail 字段 - 实现排产明细绑定钢卷的查询过滤逻辑 - 防止钢卷重复绑定到多个排产单 - 通过子查询优化排产明细关联查询性能
This commit is contained in:
@@ -432,5 +432,11 @@ public class WmsMaterialCoilBo extends BaseEntity {
|
|||||||
*/
|
*/
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private Boolean excludeAccepted;
|
private Boolean excludeAccepted;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否排除已绑定排产明细的钢卷(true=列表不返回已绑定排产明细的钢卷)
|
||||||
|
*/
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Boolean excludeScheduledDetail;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1128,6 +1128,10 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
|
|||||||
if (Boolean.TRUE.equals(bo.getExcludeAccepted())) {
|
if (Boolean.TRUE.equals(bo.getExcludeAccepted())) {
|
||||||
qw.apply("NOT EXISTS (SELECT 1 FROM ts_accept_coil_rel acr WHERE acr.del_flag = 0 AND acr.coil_id = mc.coil_id)");
|
qw.apply("NOT EXISTS (SELECT 1 FROM ts_accept_coil_rel acr WHERE acr.del_flag = 0 AND acr.coil_id = mc.coil_id)");
|
||||||
}
|
}
|
||||||
|
// 排除已绑定排产明细的钢卷(防止重复绑定排产单)
|
||||||
|
if (Boolean.TRUE.equals(bo.getExcludeScheduledDetail())) {
|
||||||
|
qw.apply("NOT EXISTS (SELECT 1 FROM sch_prod_schedule_detail_coil sdc WHERE sdc.del_flag = 0 AND sdc.coil_id = mc.coil_id)");
|
||||||
|
}
|
||||||
|
|
||||||
// 组合 item_id 条件:改为使用 EXISTS 子查询,替代预查询 + IN
|
// 组合 item_id 条件:改为使用 EXISTS 子查询,替代预查询 + IN
|
||||||
boolean hasSelectType = StringUtils.isNotBlank(bo.getSelectType());
|
boolean hasSelectType = StringUtils.isNotBlank(bo.getSelectType());
|
||||||
|
|||||||
Reference in New Issue
Block a user