Merge branch '0.8.X' of https://gitee.com/hdka/klp-oa into 0.8.X

This commit is contained in:
砂糖
2026-01-12 10:05:44 +08:00
3 changed files with 73 additions and 7 deletions

View File

@@ -91,13 +91,13 @@ public class WmsMaterialCoilExportVo {
* 产品状态
*/
@ExcelProperty(value = "产品状态")
private String qualityStatusDesc;
private String qualityStatus;
/**
* 打包状态
*/
@ExcelProperty(value = "打包状态")
private String packingStatusDesc;
private String packingStatus;
/**
* 库存状态
@@ -123,6 +123,10 @@ public class WmsMaterialCoilExportVo {
@ExcelProperty(value = "规格")
private String specification;
@ExcelProperty(value = "长度")
private BigDecimal length;
/**
* 材质
*/
@@ -152,4 +156,14 @@ public class WmsMaterialCoilExportVo {
*/
@ExcelProperty(value = "物品ID")
private Long itemId;
/**
* 发货时间(仅临时存储,不导出)
*/
private Date exportTime;
/**
* 更新时间(仅临时存储,不导出,用于发货时间为空时兜底)
*/
private Date updateTime;
}

View File

@@ -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) {
@@ -1836,7 +1861,30 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
@Override
public List<WmsMaterialCoilExportVo> queryExportList(WmsMaterialCoilBo 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;
}
/**

View File

@@ -361,6 +361,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
mc.current_coil_no AS currentCoilNo,
-- 日期
mc.create_time AS createTime,
-- 发货时间
mc.export_time AS exportTime,
-- 新增:更新时间(用于发货时间为空时兜底)
mc.update_time AS updateTime,
-- 重量
mc.net_weight AS netWeight,
-- 长度
@@ -378,7 +382,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
-- 库存状态(中文显示)
CASE
WHEN mc.status = 0 THEN '在库'
WHEN mc.status = 1 THEN '在途'
WHEN mc.status = 1 THEN '已发货'
ELSE CAST(mc.status AS CHAR)
END AS statusDesc,
-- 备注