From fbaafff217f377ce325623b2e4e017428dda9278 Mon Sep 17 00:00:00 2001 From: songguoqiang <765017469@qq.com> Date: Thu, 16 May 2024 10:30:58 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=87=E4=BB=B6=E5=AF=BC=E5=85=A5=20?= =?UTF-8?q?=E5=BA=93=E5=8C=BA=E5=AF=BC=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/win/module/eam/controller/item/ItemController.java | 2 ++ .../com/win/module/eam/controller/item/vo/ItemImportVO.java | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/win-module-eam/win-module-eam-biz/src/main/java/com/win/module/eam/controller/item/ItemController.java b/win-module-eam/win-module-eam-biz/src/main/java/com/win/module/eam/controller/item/ItemController.java index d314597..52709ca 100644 --- a/win-module-eam/win-module-eam-biz/src/main/java/com/win/module/eam/controller/item/ItemController.java +++ b/win-module-eam/win-module-eam-biz/src/main/java/com/win/module/eam/controller/item/ItemController.java @@ -188,6 +188,8 @@ public class ItemController { // 手动创建导出 demo List list = new ArrayList<>(); Map mapDropDown = new HashMap<>(); + String[] type = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.CLASSIFICATION); + mapDropDown.put(9, type); // // 输出 ExcelUtils.write(response, "备件导入模板.xlsx", "备件表", ItemImportVO.class, list, mapDropDown); } diff --git a/win-module-eam/win-module-eam-biz/src/main/java/com/win/module/eam/controller/item/vo/ItemImportVO.java b/win-module-eam/win-module-eam-biz/src/main/java/com/win/module/eam/controller/item/vo/ItemImportVO.java index 929caf2..ab52b02 100644 --- a/win-module-eam/win-module-eam-biz/src/main/java/com/win/module/eam/controller/item/vo/ItemImportVO.java +++ b/win-module-eam/win-module-eam-biz/src/main/java/com/win/module/eam/controller/item/vo/ItemImportVO.java @@ -1,7 +1,9 @@ package com.win.module.eam.controller.item.vo; import com.alibaba.excel.annotation.ExcelProperty; +import com.win.framework.excel.core.annotations.DictFormat; import com.win.framework.excel.core.annotations.ExcelValid; +import com.win.framework.excel.core.convert.DictConvert; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; @@ -49,7 +51,8 @@ public class ItemImportVO { @ExcelProperty("采购周期(周)") private Integer procurementCycle; - @ExcelProperty("ABC分类") + @DictFormat("classification") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中 + @ExcelProperty(value = "ABC分类", converter = DictConvert.class) @ExcelValid(message = "ABC分类必填") private String classification;