Commit d50ab311 authored by wangqiang's avatar wangqiang

修改IED 审核、校核、批准等校验

parent 0980a767
...@@ -296,10 +296,18 @@ public class IEDPlanExcelListenner extends AnalysisEventListener<ExtIEDPlanExcel ...@@ -296,10 +296,18 @@ public class IEDPlanExcelListenner extends AnalysisEventListener<ExtIEDPlanExcel
extIEDPlanVO.setRatifier(extIEDPlanExcelVO.getRatifier()); extIEDPlanVO.setRatifier(extIEDPlanExcelVO.getRatifier());
Map<String, Object> dynamicAttrs = new HashMap<>(); Map<String, Object> dynamicAttrs = new HashMap<>();
dynamicAttrs.put("editorName", userUtils.getUserById(Long.valueOf(extIEDPlanExcelVO.getEditor())).getName()); dynamicAttrs.put("editorName", userUtils.getUserById(Long.valueOf(extIEDPlanExcelVO.getEditor())).getName());
dynamicAttrs.put("checkerName", userUtils.getUserById(Long.valueOf(extIEDPlanExcelVO.getChecker())).getName()); if(!StringUtils.isEmpty(extIEDPlanExcelVO.getAuditor())){
dynamicAttrs.put("auditorName", userUtils.getUserById(Long.valueOf(extIEDPlanExcelVO.getAuditor())).getName()); dynamicAttrs.put("auditorName", userUtils.getUserById(Long.valueOf(extIEDPlanExcelVO.getAuditor())).getName());
dynamicAttrs.put("investigatorName", userUtils.getUserById(Long.valueOf(extIEDPlanExcelVO.getInvestigator())).getName()); }
dynamicAttrs.put("ratifierName", userUtils.getUserById(Long.valueOf(extIEDPlanExcelVO.getRatifier())).getName()); if(!StringUtils.isEmpty(extIEDPlanExcelVO.getChecker())){
dynamicAttrs.put("checkerName", userUtils.getUserById(Long.valueOf(extIEDPlanExcelVO.getChecker())).getName());
}
if(!StringUtils.isEmpty(extIEDPlanExcelVO.getInvestigator())){
dynamicAttrs.put("investigatorName", userUtils.getUserById(Long.valueOf(extIEDPlanExcelVO.getInvestigator())).getName());
}
if(!StringUtils.isEmpty(extIEDPlanExcelVO.getRatifier())){
dynamicAttrs.put("ratifierName", userUtils.getUserById(Long.valueOf(extIEDPlanExcelVO.getRatifier())).getName());
}
extIEDPlanVO.setDynamicAttrs(dynamicAttrs); extIEDPlanVO.setDynamicAttrs(dynamicAttrs);
extIEDPlanVO.setChecker(extIEDPlanExcelVO.getChecker()); extIEDPlanVO.setChecker(extIEDPlanExcelVO.getChecker());
extIEDPlanVO.setAuditor(extIEDPlanExcelVO.getAuditor()); extIEDPlanVO.setAuditor(extIEDPlanExcelVO.getAuditor());
...@@ -490,11 +498,7 @@ public class IEDPlanExcelListenner extends AnalysisEventListener<ExtIEDPlanExcel ...@@ -490,11 +498,7 @@ public class IEDPlanExcelListenner extends AnalysisEventListener<ExtIEDPlanExcel
} }
} }
//校核不能为空,判断该用户是否存在,存在的话,将用户id保存 //校核不能为空,判断该用户是否存在,存在的话,将用户id保存
if (StringUtils.isEmpty(extIEDPlanExcelVO.getChecker())) { if (!StringUtils.isEmpty(extIEDPlanExcelVO.getChecker())) {
errorString.append("解析到数据第" + excelDataRow + "行文件编号为:" + extIEDPlanExcelVO.getFileNumber() + "的编写者不能为空!!");
errorList.add(errorString);
return;
} else {
DxUserInfoVO dxUserInfoVO = userUtils.getUserByName(extIEDPlanExcelVO.getChecker()); DxUserInfoVO dxUserInfoVO = userUtils.getUserByName(extIEDPlanExcelVO.getChecker());
if (ObjectUtils.isEmpty(dxUserInfoVO)) { if (ObjectUtils.isEmpty(dxUserInfoVO)) {
errorString.append("解析到数据第" + excelDataRow + "行文件编号为:" + extIEDPlanExcelVO.getFileNumber() + "的校核在系统中未查到!!"); errorString.append("解析到数据第" + excelDataRow + "行文件编号为:" + extIEDPlanExcelVO.getFileNumber() + "的校核在系统中未查到!!");
...@@ -531,7 +535,7 @@ public class IEDPlanExcelListenner extends AnalysisEventListener<ExtIEDPlanExcel ...@@ -531,7 +535,7 @@ public class IEDPlanExcelListenner extends AnalysisEventListener<ExtIEDPlanExcel
if (!StringUtils.isEmpty(extIEDPlanExcelVO.getRatifier())) { if (!StringUtils.isEmpty(extIEDPlanExcelVO.getRatifier())) {
DxUserInfoVO dxUserInfoVO = userUtils.getUserByName(extIEDPlanExcelVO.getRatifier()); DxUserInfoVO dxUserInfoVO = userUtils.getUserByName(extIEDPlanExcelVO.getRatifier());
if (ObjectUtils.isEmpty(dxUserInfoVO)) { if (ObjectUtils.isEmpty(dxUserInfoVO)) {
errorString.append("解析到数据第" + excelDataRow + "行文件编号为:" + extIEDPlanExcelVO.getFileNumber() + "的审定者在系统中未查到!!"); errorString.append("解析到数据第" + excelDataRow + "行文件编号为:" + extIEDPlanExcelVO.getFileNumber() + "的批准者在系统中未查到!!");
errorList.add(errorString); errorList.add(errorString);
return; return;
} else { } else {
...@@ -540,7 +544,7 @@ public class IEDPlanExcelListenner extends AnalysisEventListener<ExtIEDPlanExcel ...@@ -540,7 +544,7 @@ public class IEDPlanExcelListenner extends AnalysisEventListener<ExtIEDPlanExcel
} }
//校验密级,计划密级不能大于项目密级 //校验密级,计划密级不能大于项目密级
if (!StringUtils.isEmpty(extIEDPlanExcelVO.getSecretCode())) { if (!StringUtils.isEmpty(extIEDPlanExcelVO.getSecretCode())) {
if(!CommonUtils.verifySecretLevel(projectSecret,extIEDPlanExcelVO.getSecretCode())){ if(!CommonUtils.verifySecretLevel(CommonUtils.searchDictDataValueByDictCode(Constants.SECRET_CODE,projectSecret),extIEDPlanExcelVO.getSecretCode())){
errorString.append("解析到数据第" + excelDataRow + "行文件编号为:" + extIEDPlanExcelVO.getFileNumber() + "的密级不能大于项目密级!!"); errorString.append("解析到数据第" + excelDataRow + "行文件编号为:" + extIEDPlanExcelVO.getFileNumber() + "的密级不能大于项目密级!!");
errorList.add(errorString); errorList.add(errorString);
return; return;
......
...@@ -98,7 +98,7 @@ public class PurchasePlanExcelDataVerifyListenner extends AnalysisEventListener< ...@@ -98,7 +98,7 @@ public class PurchasePlanExcelDataVerifyListenner extends AnalysisEventListener<
//校验表格中的数据是否合法 //校验表格中的数据是否合法
List<StringBuffer> errList = checkPurchasePlanExcelData(); List<StringBuffer> errList = checkPurchasePlanExcelData();
if (errList.size() > 0) { if (errList.size() > 0) {
throw new DxBusinessException("0", "导入采购计划数据有误!!" + errList.toString()); throw new DxBusinessException("-1", "导入采购计划数据有误!!" + errList.toString());
} }
//清理list ,方便内存回收 //清理list ,方便内存回收
......
...@@ -207,7 +207,7 @@ public class ExtPuchasePlanAttributeServiceImpl<V extends ExtPuchasePlanAttribut ...@@ -207,7 +207,7 @@ public class ExtPuchasePlanAttributeServiceImpl<V extends ExtPuchasePlanAttribut
multipartFile = fileManagerFeignService.feignDownloadIO(fileId); multipartFile = fileManagerFeignService.feignDownloadIO(fileId);
inputStream = new ByteArrayInputStream(multipartFile.getBytes()); inputStream = new ByteArrayInputStream(multipartFile.getBytes());
} catch (IOException e) { } catch (IOException e) {
throw new DxBusinessException("0","文件id:"+fileId+"在系统中未找到!"); throw new DxBusinessException("-1","文件id:"+fileId+"在系统中未找到!");
} }
EasyExcel.read(inputStream, ExtPuchasePlanExcelVO.class, EasyExcel.read(inputStream, ExtPuchasePlanExcelVO.class,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment