导入问题(添加XX类型)

1.xxxDTO
@Excel(name = "XXX类型")
private String xxxTypeName;
2.ExcelImportService
// xxxType 0 xxxType1 1 xxxType2
String xxxType = DictUtil.getKey(DictUtil.xxxTypeMap,target.getxxxTypeName(),1);
if(xxxType != null) {
target.setxxxType(Integer.valueOf(xxxType));
}
3.DictUtil
public static final Map<String,String> xxxTypeMap = new HashMap<String, String>(){{
put("0","type1(对应名称)");
put("1","type2(对应名称)");
}};

posted @ 2020-04-28 17:42  baoshang  阅读(187)  评论(0)    收藏  举报