feat(wms): 添加发货人字段并优化钢卷导出逻辑

- 在WmsMaterialCoilDeliveryExportVo中新增exportBy发货人字段
- 在数据库查询映射中添加export_by字段映射
- 优化导出逻辑,根据状态判断替换日期字段
- 添加发货时间、更新时间、创建时间的优先级处理
- 对历史数据的库区名称进行空值处理
- 完善钢卷导出列表的数据处理流程
This commit is contained in:
2026-01-29 16:58:40 +08:00
parent 5868b63d81
commit 5ab74fbcf1
3 changed files with 36 additions and 2 deletions

View File

@@ -23,6 +23,10 @@ public class WmsMaterialCoilDeliveryExportVo extends WmsMaterialCoilExportVo {
*/
private Long coilId;
// 发货人
@ExcelProperty(value = "发货人")
private String exportBy;
// -------------------- 发货计划plan --------------------
private Long planId;

View File

@@ -338,7 +338,7 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
vo.setBindPlanId(bind.getPlanId());
vo.setBindPlanName(bind.getPlanName());
vo.setBindPlanDate(bind.getPlanDate());
// 补充设置更多的绑定信息字段
vo.setBindLicensePlate(bind.getLicensePlate());
vo.setBindConsigneeUnit(bind.getConsigneeUnit());
@@ -2389,7 +2389,35 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
if (coilIds.isEmpty()) {
return Collections.emptyList();
}
return baseMapper.selectDeliveryExportListByCoilIds(coilIds);
List<WmsMaterialCoilDeliveryExportVo> wmsMaterialCoilDeliveryExportVos = baseMapper.selectDeliveryExportListByCoilIds(coilIds);
// 遍历数据,根据状态替换日期字段,并处理空值兜底
wmsMaterialCoilDeliveryExportVos.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不变
// 如果是dataType=0的历史数据将实际库区设置为null
if (vo.getDataType() != null && vo.getDataType() == 0) {
vo.setActualWarehouseName(null);
}
});
return wmsMaterialCoilDeliveryExportVos;
}
private List<Long> parseCsvLongs(String csv) {

View File

@@ -448,6 +448,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
SELECT
-- 钢卷ID
mc.coil_id AS coilId,
-- 发货人
mc.export_by AS exportBy,
-- 类型(中文显示)
CASE
WHEN mc.item_type = 'product' THEN '成品'