Merge branch '0.8.X' of https://gitee.com/hdka/klp-oa into 0.8.X
This commit is contained in:
@@ -91,13 +91,13 @@ public class WmsMaterialCoilExportVo {
|
|||||||
* 产品状态
|
* 产品状态
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "产品状态")
|
@ExcelProperty(value = "产品状态")
|
||||||
private String qualityStatusDesc;
|
private String qualityStatus;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 打包状态
|
* 打包状态
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "打包状态")
|
@ExcelProperty(value = "打包状态")
|
||||||
private String packingStatusDesc;
|
private String packingStatus;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 库存状态
|
* 库存状态
|
||||||
@@ -123,6 +123,10 @@ public class WmsMaterialCoilExportVo {
|
|||||||
@ExcelProperty(value = "规格")
|
@ExcelProperty(value = "规格")
|
||||||
private String specification;
|
private String specification;
|
||||||
|
|
||||||
|
|
||||||
|
@ExcelProperty(value = "长度")
|
||||||
|
private BigDecimal length;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 材质
|
* 材质
|
||||||
*/
|
*/
|
||||||
@@ -152,4 +156,14 @@ public class WmsMaterialCoilExportVo {
|
|||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "物品ID")
|
@ExcelProperty(value = "物品ID")
|
||||||
private Long itemId;
|
private Long itemId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发货时间(仅临时存储,不导出)
|
||||||
|
*/
|
||||||
|
private Date exportTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新时间(仅临时存储,不导出,用于发货时间为空时兜底)
|
||||||
|
*/
|
||||||
|
private Date updateTime;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -472,9 +472,34 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
|
|||||||
qw.ge(bo.getByCreateTimeStart() != null, "mc.create_time", bo.getByCreateTimeStart());
|
qw.ge(bo.getByCreateTimeStart() != null, "mc.create_time", bo.getByCreateTimeStart());
|
||||||
qw.le(bo.getByCreateTimeEnd() != null, "mc.create_time", bo.getByCreateTimeEnd());
|
qw.le(bo.getByCreateTimeEnd() != null, "mc.create_time", bo.getByCreateTimeEnd());
|
||||||
|
|
||||||
// 根据发货开始和结束筛选发货时间
|
// 处理发货时间筛选逻辑(核心修改部分)
|
||||||
qw.ge(bo.getByExportTimeStart() != null, "mc.export_time", bo.getByExportTimeStart());
|
if (bo.getByExportTimeStart() != null || bo.getByExportTimeEnd() != null) {
|
||||||
qw.le(bo.getByExportTimeEnd() != null, "mc.export_time", bo.getByExportTimeEnd());
|
// 开启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) {
|
if (bo.getMinAbnormalCount() != null) {
|
||||||
@@ -1836,7 +1861,30 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
|
|||||||
@Override
|
@Override
|
||||||
public List<WmsMaterialCoilExportVo> queryExportList(WmsMaterialCoilBo bo) {
|
public List<WmsMaterialCoilExportVo> queryExportList(WmsMaterialCoilBo bo) {
|
||||||
QueryWrapper<WmsMaterialCoil> lqw = buildQueryWrapper(bo);
|
QueryWrapper<WmsMaterialCoil> lqw = buildQueryWrapper(bo);
|
||||||
return baseMapper.selectExportList(lqw);
|
List<WmsMaterialCoilExportVo> wmsMaterialCoilExportVos = baseMapper.selectExportList(lqw);
|
||||||
|
// 遍历数据,根据状态替换日期字段,并处理空值兜底
|
||||||
|
wmsMaterialCoilExportVos.stream().forEach(vo -> {
|
||||||
|
// 判断查询条件中的status是否为1(已发货)
|
||||||
|
if (bo.getStatus() != null && bo.getStatus() == 1) {
|
||||||
|
Date finalDate = null;
|
||||||
|
// 1. 优先使用发货时间
|
||||||
|
if (vo.getExportTime() != null) {
|
||||||
|
finalDate = vo.getExportTime();
|
||||||
|
}
|
||||||
|
// 2. 发货时间为空时,使用更新时间兜底
|
||||||
|
else if (vo.getUpdateTime() != null) {
|
||||||
|
finalDate = vo.getUpdateTime();
|
||||||
|
}
|
||||||
|
// 3. 若更新时间也为空,保留原有createTime(避免日期字段为空)
|
||||||
|
else {
|
||||||
|
finalDate = vo.getCreateTime();
|
||||||
|
}
|
||||||
|
// 赋值最终的日期
|
||||||
|
vo.setCreateTime(finalDate);
|
||||||
|
}
|
||||||
|
// 非1的情况,保持原有create_time不变
|
||||||
|
});
|
||||||
|
return wmsMaterialCoilExportVos;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -361,6 +361,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
mc.current_coil_no AS currentCoilNo,
|
mc.current_coil_no AS currentCoilNo,
|
||||||
-- 日期
|
-- 日期
|
||||||
mc.create_time AS createTime,
|
mc.create_time AS createTime,
|
||||||
|
-- 发货时间
|
||||||
|
mc.export_time AS exportTime,
|
||||||
|
-- 新增:更新时间(用于发货时间为空时兜底)
|
||||||
|
mc.update_time AS updateTime,
|
||||||
-- 重量
|
-- 重量
|
||||||
mc.net_weight AS netWeight,
|
mc.net_weight AS netWeight,
|
||||||
-- 长度
|
-- 长度
|
||||||
@@ -378,7 +382,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
-- 库存状态(中文显示)
|
-- 库存状态(中文显示)
|
||||||
CASE
|
CASE
|
||||||
WHEN mc.status = 0 THEN '在库'
|
WHEN mc.status = 0 THEN '在库'
|
||||||
WHEN mc.status = 1 THEN '在途'
|
WHEN mc.status = 1 THEN '已发货'
|
||||||
ELSE CAST(mc.status AS CHAR)
|
ELSE CAST(mc.status AS CHAR)
|
||||||
END AS statusDesc,
|
END AS statusDesc,
|
||||||
-- 备注
|
-- 备注
|
||||||
|
|||||||
Reference in New Issue
Block a user