feat(material): 添加钢卷物料完整字段导出功能
- 新增 WmsMaterialCoilAllExportVo 完整字段导出 VO 类 - 在 IWmsMaterialCoilService 中添加 queryExportListAll 方法 - 实现 queryExportListAll 方法支持完整字段导出 - 添加 /exportAll 接口支持完整字段导出 - 更新数据库查询映射添加班组和发货人字段 - 修改 WmsMaterialCoilExportVo 添加班组、业务用途等字段 - 调整导出接口注释从完整字段改为精简字段描述
This commit is contained in:
@@ -1,13 +1,15 @@
|
||||
package com.klp.controller;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Arrays;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.klp.domain.vo.WmsMaterialCoilExportVo;
|
||||
import com.klp.domain.vo.WmsMaterialCoilDeliveryExportVo;
|
||||
import com.klp.domain.vo.WmsMaterialCoilLocationGridVo;
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
import com.alibaba.excel.ExcelWriter;
|
||||
import com.alibaba.excel.write.metadata.WriteSheet;
|
||||
import com.klp.domain.vo.*;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.constraints.*;
|
||||
@@ -22,7 +24,6 @@ import com.klp.common.core.validate.AddGroup;
|
||||
import com.klp.common.core.validate.EditGroup;
|
||||
import com.klp.common.enums.BusinessType;
|
||||
import com.klp.common.utils.poi.ExcelUtil;
|
||||
import com.klp.domain.vo.WmsMaterialCoilVo;
|
||||
import com.klp.domain.bo.WmsMaterialCoilBo;
|
||||
import com.klp.domain.vo.dashboard.CoilTrimStatisticsVo;
|
||||
import com.klp.domain.vo.dashboard.CategoryWidthStatisticsVo;
|
||||
@@ -66,7 +67,7 @@ public class WmsMaterialCoilController extends BaseController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出钢卷物料表列表(完整字段版本)
|
||||
* 导出钢卷物料表列表(精简字段版本)
|
||||
*/
|
||||
@Log(title = "钢卷物料表", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
@@ -74,6 +75,16 @@ public class WmsMaterialCoilController extends BaseController {
|
||||
List<WmsMaterialCoilExportVo> list = iWmsMaterialCoilService.queryExportList(bo);
|
||||
ExcelUtil.exportExcel(list, "钢卷物料表", WmsMaterialCoilExportVo.class, response);
|
||||
}
|
||||
/**
|
||||
* 导出钢卷物料表列表(完整字段版本)
|
||||
* 导出全部字段
|
||||
*/
|
||||
@Log(title = "钢卷物料表", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/exportAll")
|
||||
public void exportSimple(WmsMaterialCoilBo bo, HttpServletResponse response) {
|
||||
List<WmsMaterialCoilAllExportVo> list = iWmsMaterialCoilService.queryExportListAll(bo);
|
||||
ExcelUtil.exportExcel(list, "钢卷物料表", WmsMaterialCoilAllExportVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出发货报表(按 coilIds,联查发货单明细/主表/发货计划)
|
||||
|
||||
@@ -0,0 +1,193 @@
|
||||
package com.klp.domain.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.klp.common.annotation.Excel;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 钢卷物料导出VO
|
||||
*
|
||||
* @author klp
|
||||
* @date 2025-11-27
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class WmsMaterialCoilAllExportVo {
|
||||
|
||||
/**
|
||||
* 类型(成品/原料)
|
||||
*/
|
||||
@ExcelProperty(value = "类型")
|
||||
private String itemTypeDesc;
|
||||
|
||||
/**
|
||||
* 逻辑库区
|
||||
*/
|
||||
@ExcelProperty(value = "逻辑库区")
|
||||
private String warehouseName;
|
||||
|
||||
/**
|
||||
* 实际库区
|
||||
*/
|
||||
@ExcelProperty(value = "实际库区")
|
||||
private String actualWarehouseName;
|
||||
|
||||
/**
|
||||
* 入场卷号
|
||||
*/
|
||||
@ExcelProperty(value = "入场卷号")
|
||||
private String enterCoilNo;
|
||||
|
||||
/**
|
||||
* 厂家卷号
|
||||
*/
|
||||
@ExcelProperty(value = "厂家卷号")
|
||||
private String supplierCoilNo;
|
||||
|
||||
/**
|
||||
* 成品卷号
|
||||
*/
|
||||
@ExcelProperty(value = "成品卷号")
|
||||
private String currentCoilNo;
|
||||
|
||||
/**
|
||||
* 日期
|
||||
*/
|
||||
@ExcelProperty(value = "日期")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 发货时间(仅临时存储,不导出)
|
||||
*/
|
||||
@ExcelProperty(value = "发货时间")
|
||||
private Date exportTime;
|
||||
|
||||
// 发货人
|
||||
@ExcelProperty(value = "发货人")
|
||||
private String exportBy;
|
||||
|
||||
/**
|
||||
* 重量(kg)
|
||||
*/
|
||||
@ExcelProperty(value = "重量")
|
||||
private BigDecimal netWeight;
|
||||
|
||||
// 班组
|
||||
private String team;
|
||||
|
||||
/**
|
||||
* 用途
|
||||
*/
|
||||
@ExcelProperty(value = "用途")
|
||||
private String purpose;
|
||||
|
||||
/**
|
||||
* 切边要求
|
||||
*/
|
||||
@ExcelProperty(value = "切边要求")
|
||||
private String trimmingRequirement;
|
||||
|
||||
/**
|
||||
* 包装种类
|
||||
*/
|
||||
@ExcelProperty(value = "包装种类")
|
||||
private String packagingRequirement;
|
||||
|
||||
/**
|
||||
* 产品状态
|
||||
*/
|
||||
@ExcelProperty(value = "产品质量")
|
||||
private String qualityStatus;
|
||||
|
||||
/**
|
||||
* 打包状态
|
||||
*/
|
||||
@ExcelProperty(value = "打包状态")
|
||||
private String packingStatus;
|
||||
|
||||
/**
|
||||
* 库存状态
|
||||
*/
|
||||
@ExcelProperty(value = "库存状态")
|
||||
private String statusDesc;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@ExcelProperty(value = "名称")
|
||||
private String itemName;
|
||||
|
||||
|
||||
@ExcelProperty(value = "长度")
|
||||
private BigDecimal length;
|
||||
|
||||
/**
|
||||
* 规格
|
||||
*/
|
||||
@ExcelProperty(value = "规格")
|
||||
private String specification;
|
||||
/**
|
||||
* 材质
|
||||
*/
|
||||
@ExcelProperty(value = "材质")
|
||||
private String material;
|
||||
|
||||
/**
|
||||
* 厂家
|
||||
*/
|
||||
@ExcelProperty(value = "厂家")
|
||||
private String manufacturer;
|
||||
|
||||
/**
|
||||
* 表面处理
|
||||
*/
|
||||
@ExcelProperty(value = "表面处理")
|
||||
private String surfaceTreatmentDesc;
|
||||
|
||||
/**
|
||||
* 锌层
|
||||
*/
|
||||
@ExcelProperty(value = "锌层")
|
||||
private String zincLayer;
|
||||
|
||||
/**
|
||||
* 物品ID
|
||||
*/
|
||||
@ExcelProperty(value = "物品ID")
|
||||
private Long itemId;
|
||||
|
||||
|
||||
/**
|
||||
* 更新时间(仅临时存储,不导出,用于发货时间为空时兜底)
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
// 数据类型
|
||||
@Excel(name = "数据类型", readConverterExp = "0=历史,1=当前")
|
||||
private Integer dataType;
|
||||
|
||||
// 调制度
|
||||
@ExcelProperty(value = "调制度")
|
||||
private String temperGrade;
|
||||
// 镀层种类
|
||||
@ExcelProperty(value = "镀层种类")
|
||||
private String coatingType;
|
||||
|
||||
// 业务用途
|
||||
@ExcelProperty(value = "业务用途")
|
||||
private String businessPurpose;
|
||||
|
||||
// 是否与订单相关 readConverterExp
|
||||
@Excel(name = "是否与订单相关", readConverterExp = "0=否,1=是")
|
||||
private Integer isRelatedToOrder;
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package com.klp.domain.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.klp.common.annotation.Excel;
|
||||
import com.klp.common.annotation.ExcelDictFormat;
|
||||
import com.klp.common.convert.ExcelDictConvert;
|
||||
import lombok.Data;
|
||||
@@ -174,4 +175,13 @@ public class WmsMaterialCoilExportVo {
|
||||
private String temperGrade;
|
||||
// 镀层种类
|
||||
private String coatingType;
|
||||
|
||||
// 班组
|
||||
private String team;
|
||||
|
||||
// 业务用途
|
||||
private String businessPurpose;
|
||||
|
||||
// 是否与订单相关 readConverterExp
|
||||
private Integer isRelatedToOrder;
|
||||
}
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
package com.klp.service;
|
||||
|
||||
import com.klp.domain.vo.WmsMaterialCoilDeliveryExportVo;
|
||||
import com.klp.domain.vo.WmsMaterialCoilLocationGridVo;
|
||||
import com.klp.domain.vo.WmsMaterialCoilVo;
|
||||
import com.klp.domain.vo.*;
|
||||
import com.klp.domain.bo.WmsMaterialCoilBo;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
@@ -231,5 +229,7 @@ public interface IWmsMaterialCoilService {
|
||||
String enterCoilNo,
|
||||
String currentCoilNo,
|
||||
String manufacturer);
|
||||
|
||||
List<WmsMaterialCoilAllExportVo> queryExportListAll(WmsMaterialCoilBo bo);
|
||||
}
|
||||
|
||||
|
||||
@@ -2379,7 +2379,25 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
|
||||
});
|
||||
return wmsMaterialCoilExportVos;
|
||||
}
|
||||
/**
|
||||
* 查询钢卷导出数据列表(完整版)
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly = true)
|
||||
public List<WmsMaterialCoilAllExportVo> queryExportListAll(WmsMaterialCoilBo bo) {
|
||||
QueryWrapper<WmsMaterialCoil> lqw = buildQueryWrapper(bo);
|
||||
List<WmsMaterialCoilExportVo> wmsMaterialCoilVos = baseMapper.selectExportList(lqw);
|
||||
List<WmsMaterialCoilAllExportVo> exportVoList = BeanUtil.copyToList(wmsMaterialCoilVos, WmsMaterialCoilAllExportVo.class);
|
||||
if (CollectionUtils.isNotEmpty(exportVoList)) {
|
||||
for (WmsMaterialCoilAllExportVo vo : exportVoList) {
|
||||
if (Objects.equals(vo.getDataType(), 0)) {
|
||||
vo.setActualWarehouseName(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return exportVoList;
|
||||
}
|
||||
/**
|
||||
* 发货报表导出:按 coilIds 查询钢卷 + 发货单明细/主表/计划联查数据
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user