5b869242 sonin

维保标准库模板 修改

1 个父辈 76ef4da1
...@@ -192,16 +192,16 @@ public class EquipmentMaintainStandardController { ...@@ -192,16 +192,16 @@ public class EquipmentMaintainStandardController {
192 MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; 192 MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
193 Map<String, MultipartFile> fileMap = multipartRequest.getFileMap(); 193 Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
194 //构造机构字典 194 //构造机构字典
195 List<Map<String,Object>> departList = iEquipmentMaintainStandardService.getDepartList("group"); 195 List<Map<String, Object>> departList = iEquipmentMaintainStandardService.getDepartList("group");
196 Map<String,String> departDictMap = new HashMap<String,String>(); 196 Map<String, String> departDictMap = new HashMap<String, String>();
197 departList.forEach(depart ->{ 197 departList.forEach(depart -> {
198 departDictMap.put(ConvertUtils.getString(depart.get("depart_name")), ConvertUtils.getString(depart.get("id"))); 198 departDictMap.put(ConvertUtils.getString(depart.get("depart_name")), ConvertUtils.getString(depart.get("id")));
199 }); 199 });
200 200
201 //构造设备类别字典 201 //构造设备类别字典
202 List<EquipmentCategory> equipmentCategoryList = equipmentCategoryService.list(); 202 List<EquipmentCategory> equipmentCategoryList = equipmentCategoryService.list();
203 Map<String,String> equipmentCategoryDictMap = new HashMap<String,String>(); 203 Map<String, String> equipmentCategoryDictMap = new HashMap<String, String>();
204 equipmentCategoryList.forEach(equipmentCategory ->{ 204 equipmentCategoryList.forEach(equipmentCategory -> {
205 equipmentCategoryDictMap.put(equipmentCategory.getTreePathName(), equipmentCategory.getId()); 205 equipmentCategoryDictMap.put(equipmentCategory.getTreePathName(), equipmentCategory.getId());
206 }); 206 });
207 for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) { 207 for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
...@@ -215,28 +215,11 @@ public class EquipmentMaintainStandardController { ...@@ -215,28 +215,11 @@ public class EquipmentMaintainStandardController {
215 List<EquipmentMaintainStandard> listsdEquipFailureRepairs = ExcelImportUtil.importExcel(multipartFile.getInputStream(), EquipmentMaintainStandard.class, params); 215 List<EquipmentMaintainStandard> listsdEquipFailureRepairs = ExcelImportUtil.importExcel(multipartFile.getInputStream(), EquipmentMaintainStandard.class, params);
216 //根据设备类型查出对应id 216 //根据设备类型查出对应id
217 listsdEquipFailureRepairs.forEach(e -> { 217 listsdEquipFailureRepairs.forEach(e -> {
218 //获取一级类型
219 String top = e.getEquipmentTopType();
220 //获取二级类型
221 String second = e.getEquipmentSecondType();
222 //获取三级类型
223 String third = e.getEquipmentType(); 218 String third = e.getEquipmentType();
224
225 StringBuffer sb = new StringBuffer();
226 if(StringUtils.isNotBlank(top)) {
227 sb.append("/"+top);
228 }
229 if(StringUtils.isNotBlank(second)) {
230 sb.append("/"+second);
231 }
232 if(StringUtils.isNotBlank(third)) {
233 sb.append("/"+third);
234 }
235 String key = sb.substring(1);
236 //机构字典翻译,并设置到保养库对象 219 //机构字典翻译,并设置到保养库对象
237 e.setDepartId(departDictMap.get(e.getDepartId())); 220 e.setDepartId(departDictMap.get(e.getDepartId()));
238 //设备类型字典翻译,并设置到保养库对象 221 //设备类型字典翻译,并设置到保养库对象
239 e.setEquipmentType(equipmentCategoryDictMap.get(key)); 222 e.setEquipmentType(equipmentCategoryDictMap.get(third));
240 }); 223 });
241 iEquipmentMaintainStandardService.addList(listsdEquipFailureRepairs); 224 iEquipmentMaintainStandardService.addList(listsdEquipFailureRepairs);
242 return Result.ok("文件导入成功!数据行数:" + listsdEquipFailureRepairs.size()); 225 return Result.ok("文件导入成功!数据行数:" + listsdEquipFailureRepairs.size());
......
...@@ -33,7 +33,7 @@ public class EquipmentMaintainStandard { ...@@ -33,7 +33,7 @@ public class EquipmentMaintainStandard {
33 @Excel(name = "保养项", width = 15) 33 @Excel(name = "保养项", width = 15)
34 @ApiModelProperty(value = "保养项") 34 @ApiModelProperty(value = "保养项")
35 private String maintenanceType; 35 private String maintenanceType;
36 @Excel(name = "设备三级类型", width = 15) 36 @Excel(name = "设备类型", width = 15)
37 @ApiModelProperty(value = "设备类型") 37 @ApiModelProperty(value = "设备类型")
38 private String equipmentType; 38 private String equipmentType;
39 39
...@@ -42,7 +42,6 @@ public class EquipmentMaintainStandard { ...@@ -42,7 +42,6 @@ public class EquipmentMaintainStandard {
42 @TableField(exist = false) 42 @TableField(exist = false)
43 private String equipmentSecondType; 43 private String equipmentSecondType;
44 44
45 @Excel(name = "设备类型", width = 15)
46 @ApiModelProperty(value = "设备一级类型") 45 @ApiModelProperty(value = "设备一级类型")
47 @TableField(exist = false) 46 @TableField(exist = false)
48 private String equipmentTopType; 47 private String equipmentTopType;
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!