refactor(wms): 将钢卷异常报表导出功能从POI迁移到EasyExcel取消合并功能追求导出速度
- 移除 POI相关依赖和导入包 - 添加com.alibaba.excel.EasyExcel依赖 - 创建WmsCoilAbnormalExportVo导出DTO类,使用EasyExcel注解 - 重构导出方法,将原有的XSSFWorkbook方式替换为EasyExcel方式 - 优化导出性能,降低复杂度到O(n) - 简化Excel样式设置和数据填充逻辑 - 保持原有导出数据结构和字段映射关系不变
This commit is contained in:
@@ -0,0 +1,203 @@
|
||||
package com.klp.domain.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnore;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.alibaba.excel.annotation.write.style.ColumnWidth;
|
||||
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
|
||||
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 钢卷异常报表导出DTO - EasyExcel版本
|
||||
* 使用EasyExcel注解实现O(n)复杂度的单元格合并
|
||||
*
|
||||
* @author Joshi
|
||||
* @date 2026-05-07
|
||||
*/
|
||||
@Data
|
||||
@ContentRowHeight(20)
|
||||
@HeadRowHeight(24)
|
||||
@ColumnWidth(15)
|
||||
public class WmsCoilAbnormalExportVo {
|
||||
|
||||
// 钢卷基本信息(前25列)
|
||||
@ExcelProperty("类型")
|
||||
@ColumnWidth(12)
|
||||
private String itemType;
|
||||
|
||||
@ExcelProperty("逻辑库区")
|
||||
@ColumnWidth(12)
|
||||
private String warehouseName;
|
||||
|
||||
@ExcelProperty("实际库区")
|
||||
@ColumnWidth(12)
|
||||
private String actualWarehouseName;
|
||||
|
||||
@ExcelProperty("入场卷号")
|
||||
@ColumnWidth(15)
|
||||
private String enterCoilNo;
|
||||
|
||||
@ExcelProperty("厂家卷号")
|
||||
@ColumnWidth(15)
|
||||
private String supplierCoilNo;
|
||||
|
||||
@ExcelProperty("成品卷号")
|
||||
@ColumnWidth(15)
|
||||
private String currentCoilNo;
|
||||
|
||||
@ExcelProperty("日期")
|
||||
@ColumnWidth(20)
|
||||
private String createTime;
|
||||
|
||||
@ExcelProperty("重量")
|
||||
@ColumnWidth(12)
|
||||
private String netWeight;
|
||||
|
||||
@ExcelProperty("用途")
|
||||
@ColumnWidth(12)
|
||||
private String businessPurpose;
|
||||
|
||||
@ExcelProperty("切边要求")
|
||||
@ColumnWidth(12)
|
||||
private String trimmingRequirement;
|
||||
|
||||
@ExcelProperty("包装种类")
|
||||
@ColumnWidth(12)
|
||||
private String packagingRequirement;
|
||||
|
||||
@ExcelProperty("产品质量")
|
||||
@ColumnWidth(12)
|
||||
private String qualityStatus;
|
||||
|
||||
@ExcelProperty("原料材质")
|
||||
@ColumnWidth(12)
|
||||
private String packingStatus;
|
||||
|
||||
@ExcelProperty("库存状态")
|
||||
@ColumnWidth(12)
|
||||
private String status;
|
||||
|
||||
@ExcelProperty("备注")
|
||||
@ColumnWidth(20)
|
||||
private String remark;
|
||||
|
||||
@ExcelProperty("名称")
|
||||
@ColumnWidth(15)
|
||||
private String itemName;
|
||||
|
||||
@ExcelProperty("规格")
|
||||
@ColumnWidth(20)
|
||||
private String specification;
|
||||
|
||||
@ExcelProperty("长度")
|
||||
@ColumnWidth(12)
|
||||
private String length;
|
||||
|
||||
@ExcelProperty("材质")
|
||||
@ColumnWidth(12)
|
||||
private String material;
|
||||
|
||||
@ExcelProperty("厂家")
|
||||
@ColumnWidth(15)
|
||||
private String manufacturer;
|
||||
|
||||
@ExcelProperty("表面处理")
|
||||
@ColumnWidth(12)
|
||||
private String surfaceTreatmentDesc;
|
||||
|
||||
@ExcelProperty("锌层")
|
||||
@ColumnWidth(12)
|
||||
private String zincLayer;
|
||||
|
||||
@ExcelProperty("物品ID")
|
||||
@ColumnWidth(12)
|
||||
private String itemId;
|
||||
|
||||
@ExcelProperty("操作完成时间")
|
||||
@ColumnWidth(20)
|
||||
private String actionCompleteTime;
|
||||
|
||||
@ExcelProperty("调拨类型")
|
||||
@ColumnWidth(12)
|
||||
private String transferType;
|
||||
|
||||
// 改判原因(第26列)
|
||||
@ExcelProperty("改判原因")
|
||||
@ColumnWidth(25)
|
||||
private String rejudgeReason;
|
||||
|
||||
// 异常信息(后17列)
|
||||
@ExcelProperty("产线")
|
||||
@ColumnWidth(12)
|
||||
private String productionLine;
|
||||
|
||||
@ExcelProperty("位置")
|
||||
@ColumnWidth(12)
|
||||
private String position;
|
||||
|
||||
@ExcelProperty("长度坐标")
|
||||
@ColumnWidth(12)
|
||||
private String abnormalLength;
|
||||
|
||||
@ExcelProperty("缺陷开始位置")
|
||||
@ColumnWidth(15)
|
||||
private String startPosition;
|
||||
|
||||
@ExcelProperty("缺陷结束位置")
|
||||
@ColumnWidth(15)
|
||||
private String endPosition;
|
||||
|
||||
@ExcelProperty("缺陷代码")
|
||||
@ColumnWidth(12)
|
||||
private String defectCode;
|
||||
|
||||
@ExcelProperty("缺陷类型")
|
||||
@ColumnWidth(12)
|
||||
private String defectType;
|
||||
|
||||
@ExcelProperty("缺陷率")
|
||||
@ColumnWidth(12)
|
||||
private String defectRate;
|
||||
|
||||
@ExcelProperty("缺陷重量")
|
||||
@ColumnWidth(12)
|
||||
private String defectWeight;
|
||||
|
||||
@ExcelProperty("程度")
|
||||
@ColumnWidth(10)
|
||||
private String degree;
|
||||
|
||||
@ExcelProperty("判级")
|
||||
@ColumnWidth(10)
|
||||
private String judgeLevel;
|
||||
|
||||
@ExcelProperty("判级人")
|
||||
@ColumnWidth(12)
|
||||
private String judgeBy;
|
||||
|
||||
@ExcelProperty("判级时间")
|
||||
@ColumnWidth(20)
|
||||
private String judgeTime;
|
||||
|
||||
@ExcelProperty("主标记")
|
||||
@ColumnWidth(12)
|
||||
private String mainMark;
|
||||
|
||||
@ExcelProperty("整卷标记")
|
||||
@ColumnWidth(12)
|
||||
private String wholeCoilMark;
|
||||
|
||||
@ExcelProperty("异常备注")
|
||||
@ColumnWidth(20)
|
||||
private String abnormalRemark;
|
||||
|
||||
@ExcelProperty("板面")
|
||||
@ColumnWidth(10)
|
||||
private String plateSurface;
|
||||
|
||||
/**
|
||||
* 钢卷ID,用于合并单元格的标识(隐藏列)
|
||||
*/
|
||||
@ExcelIgnore
|
||||
private Long coilId;
|
||||
}
|
||||
Reference in New Issue
Block a user