Browse Source

备件导入 库区导入

master
songguoqiang 6 months ago
parent
commit
fbaafff217
  1. 2
      win-module-eam/win-module-eam-biz/src/main/java/com/win/module/eam/controller/item/ItemController.java
  2. 5
      win-module-eam/win-module-eam-biz/src/main/java/com/win/module/eam/controller/item/vo/ItemImportVO.java

2
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 // 手动创建导出 demo
List<ItemImportVO> list = new ArrayList<>(); List<ItemImportVO> list = new ArrayList<>();
Map<Integer, String[]> mapDropDown = new HashMap<>(); Map<Integer, String[]> mapDropDown = new HashMap<>();
String[] type = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.CLASSIFICATION);
mapDropDown.put(9, type);
// // 输出 // // 输出
ExcelUtils.write(response, "备件导入模板.xlsx", "备件表", ItemImportVO.class, list, mapDropDown); ExcelUtils.write(response, "备件导入模板.xlsx", "备件表", ItemImportVO.class, list, mapDropDown);
} }

5
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; package com.win.module.eam.controller.item.vo;
import com.alibaba.excel.annotation.ExcelProperty; 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.annotations.ExcelValid;
import com.win.framework.excel.core.convert.DictConvert;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
@ -49,7 +51,8 @@ public class ItemImportVO {
@ExcelProperty("采购周期(周)") @ExcelProperty("采购周期(周)")
private Integer procurementCycle; private Integer procurementCycle;
@ExcelProperty("ABC分类") @DictFormat("classification") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中
@ExcelProperty(value = "ABC分类", converter = DictConvert.class)
@ExcelValid(message = "ABC分类必填") @ExcelValid(message = "ABC分类必填")
private String classification; private String classification;

Loading…
Cancel
Save