Compare commits
2 Commits
3f503eab0c
...
25e4ce9b76
| Author | SHA1 | Date | |
|---|---|---|---|
| 25e4ce9b76 | |||
| 0da1386a5d |
@@ -3,6 +3,7 @@ package com.klp.domain.vo;
|
|||||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
import com.alibaba.excel.annotation.ExcelProperty;
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
import com.klp.common.annotation.Excel;
|
import com.klp.common.annotation.Excel;
|
||||||
|
import com.klp.common.annotation.ExcelDictFormat;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
@@ -173,7 +174,8 @@ public class WmsMaterialCoilAllExportVo {
|
|||||||
private Date updateTime;
|
private Date updateTime;
|
||||||
|
|
||||||
// 数据类型
|
// 数据类型
|
||||||
@Excel(name = "数据类型", readConverterExp = "0=历史,1=当前")
|
@ExcelProperty(value = "数据类型")
|
||||||
|
@ExcelDictFormat(readConverterExp = "0=历史,1=现存")
|
||||||
private Integer dataType;
|
private Integer dataType;
|
||||||
|
|
||||||
// 调制度
|
// 调制度
|
||||||
@@ -188,6 +190,7 @@ public class WmsMaterialCoilAllExportVo {
|
|||||||
private String businessPurpose;
|
private String businessPurpose;
|
||||||
|
|
||||||
// 是否与订单相关 readConverterExp
|
// 是否与订单相关 readConverterExp
|
||||||
@Excel(name = "是否与订单相关", readConverterExp = "0=否,1=是")
|
@ExcelProperty(value = "是否与订单相关")
|
||||||
|
@ExcelDictFormat(readConverterExp = "0=否,1=是")
|
||||||
private Integer isRelatedToOrder;
|
private Integer isRelatedToOrder;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -184,4 +184,15 @@ public class WmsMaterialCoilExportVo {
|
|||||||
|
|
||||||
// 是否与订单相关 readConverterExp
|
// 是否与订单相关 readConverterExp
|
||||||
private Integer isRelatedToOrder;
|
private Integer isRelatedToOrder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 钢卷ID 此处不展示在报表只是方便set值
|
||||||
|
*/
|
||||||
|
private Long coilId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作完成时间(根据actionIds查询wms_coil_pending_action表获取)
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "操作完成时间")
|
||||||
|
private Date actionCompleteTime;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2421,10 +2421,42 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<WmsMaterialCoilExportVo> queryExportList(WmsMaterialCoilBo bo) {
|
public List<WmsMaterialCoilExportVo> queryExportList(WmsMaterialCoilBo bo) {
|
||||||
|
Map<Long, Date> coilIdCompleteTimeMap = new HashMap<>();
|
||||||
|
|
||||||
|
if ((bo.getCoilIds() == null || bo.getCoilIds().isEmpty())
|
||||||
|
&& bo.getActionIds() != null && !bo.getActionIds().isEmpty()) {
|
||||||
|
String[] actionIdArr = bo.getActionIds().split(",");
|
||||||
|
List<Long> actionIdList = Arrays.stream(actionIdArr)
|
||||||
|
.map(String::trim)
|
||||||
|
.filter(s -> !s.isEmpty())
|
||||||
|
.map(Long::parseLong)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
|
LambdaQueryWrapper<WmsCoilPendingAction> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.in(WmsCoilPendingAction::getActionId, actionIdList);
|
||||||
|
|
||||||
|
List<WmsCoilPendingAction> actions = coilPendingActionMapper.selectList(queryWrapper);
|
||||||
|
|
||||||
|
if (actions != null && !actions.isEmpty()) {
|
||||||
|
for (WmsCoilPendingAction action : actions) {
|
||||||
|
coilIdCompleteTimeMap.put(action.getCoilId(), action.getCompleteTime());
|
||||||
|
}
|
||||||
|
|
||||||
|
bo.setCoilIds(actions.stream()
|
||||||
|
.map(a -> String.valueOf(a.getCoilId()))
|
||||||
|
.collect(Collectors.joining(",")));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
QueryWrapper<WmsMaterialCoil> lqw = buildQueryWrapperPlus(bo);
|
QueryWrapper<WmsMaterialCoil> lqw = buildQueryWrapperPlus(bo);
|
||||||
List<WmsMaterialCoilExportVo> wmsMaterialCoilExportVos = baseMapper.selectExportList(lqw);
|
List<WmsMaterialCoilExportVo> wmsMaterialCoilExportVos = baseMapper.selectExportList(lqw);
|
||||||
// 遍历数据,根据状态替换日期字段,并处理空值兜底
|
// 遍历数据,根据状态替换日期字段,并处理空值兜底
|
||||||
wmsMaterialCoilExportVos.stream().forEach(vo -> {
|
wmsMaterialCoilExportVos.stream().forEach(vo -> {
|
||||||
|
// 设置action完成时间
|
||||||
|
if (coilIdCompleteTimeMap.containsKey(vo.getCoilId())) {
|
||||||
|
vo.setActionCompleteTime(coilIdCompleteTimeMap.get(vo.getCoilId()));
|
||||||
|
}
|
||||||
|
|
||||||
// 判断查询条件中的status是否为1(已发货)
|
// 判断查询条件中的status是否为1(已发货)
|
||||||
if (bo.getStatus() != null && bo.getStatus() == 1) {
|
if (bo.getStatus() != null && bo.getStatus() == 1) {
|
||||||
Date finalDate = null;
|
Date finalDate = null;
|
||||||
|
|||||||
@@ -474,6 +474,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
END AS itemTypeDesc,
|
END AS itemTypeDesc,
|
||||||
-- 物品ID
|
-- 物品ID
|
||||||
mc.item_id AS itemId,
|
mc.item_id AS itemId,
|
||||||
|
-- 钢卷ID
|
||||||
|
mc.coil_id AS coilId,
|
||||||
-- 数据类型
|
-- 数据类型
|
||||||
mc.data_type AS dataType,
|
mc.data_type AS dataType,
|
||||||
-- 逻辑库区
|
-- 逻辑库区
|
||||||
|
|||||||
Reference in New Issue
Block a user