feat(wms): 更新物料卷查询中的发货时间筛选逻辑
- 移除原有的简单发货时间范围筛选条件 - 添加复杂的OR条件分组处理发货时间筛选 - 实现两种情况的发货时间匹配:发货时间不为空的时间范围筛选 - 实现状态为1且发货时间为null时使用更新时间匹配发货时间范围
This commit is contained in:
@@ -472,9 +472,34 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
|
||||
qw.ge(bo.getByCreateTimeStart() != null, "mc.create_time", bo.getByCreateTimeStart());
|
||||
qw.le(bo.getByCreateTimeEnd() != null, "mc.create_time", bo.getByCreateTimeEnd());
|
||||
|
||||
// 根据发货开始和结束筛选发货时间
|
||||
qw.ge(bo.getByExportTimeStart() != null, "mc.export_time", bo.getByExportTimeStart());
|
||||
qw.le(bo.getByExportTimeEnd() != null, "mc.export_time", bo.getByExportTimeEnd());
|
||||
// 处理发货时间筛选逻辑(核心修改部分)
|
||||
if (bo.getByExportTimeStart() != null || bo.getByExportTimeEnd() != null) {
|
||||
// 开启OR条件分组:满足情况1 或 情况2
|
||||
qw.and(w -> {
|
||||
// 情况1:发货时间不为null且满足时间范围
|
||||
w.nested(n -> {
|
||||
n.isNotNull("mc.export_time");
|
||||
if (bo.getByExportTimeStart() != null) {
|
||||
n.ge("mc.export_time", bo.getByExportTimeStart());
|
||||
}
|
||||
if (bo.getByExportTimeEnd() != null) {
|
||||
n.le("mc.export_time", bo.getByExportTimeEnd());
|
||||
}
|
||||
});
|
||||
// 情况2:状态为1且发货时间为null,用更新时间匹配发货时间范围
|
||||
w.or();
|
||||
w.nested(n -> {
|
||||
n.eq("mc.status", 1);
|
||||
n.isNull("mc.export_time");
|
||||
if (bo.getByExportTimeStart() != null) {
|
||||
n.ge("mc.update_time", bo.getByExportTimeStart());
|
||||
}
|
||||
if (bo.getByExportTimeEnd() != null) {
|
||||
n.le("mc.update_time", bo.getByExportTimeEnd());
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
//根据异常数量筛选(大于等于指定值)
|
||||
if (bo.getMinAbnormalCount() != null) {
|
||||
|
||||
Reference in New Issue
Block a user