From fbdb09056df5301a13b5c5531fcd0ba8249b550d Mon Sep 17 00:00:00 2001 From: zhn <947514737@qq.com> Date: Wed, 27 Sep 2023 20:54:07 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E4=BB=B6-=E8=AE=A4=E8=AF=81?= =?UTF-8?q?=E6=B8=85=E5=8D=95=E5=AF=BC=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ctCertificationInventoryEOServiceImpl.java | 101 +++++++++++++----- 1 file changed, 72 insertions(+), 29 deletions(-) diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/platform/service/impl/PlatformProjectCertificationInventoryEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/platform/service/impl/PlatformProjectCertificationInventoryEOServiceImpl.java index 70bc3fe14..a568a77b3 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/platform/service/impl/PlatformProjectCertificationInventoryEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/platform/service/impl/PlatformProjectCertificationInventoryEOServiceImpl.java @@ -4553,11 +4553,11 @@ public class PlatformProjectCertificationInventoryEOServiceImpl extends ServiceI public void importData(MultipartFile file, ProjectCertificationInventoryEO projectCertificationInventoryEO) { String title = ""; if(CutEnum.CN.getValue().equals(projectCertificationInventoryEO.getCut())){ - title = "*类别,*检验项目,*配置项,*认证类型,*WVTA ID," + + title = "*类别,*检验项目,*认证类型,*WVTA ID," + "*标准编号,*责任领域,*工程接口人,*责任人," + "交付物模板,*交付物类型,*截止日期,报告编号,产品型号,生产企业名称"; }else { - title = "*Category,*Inspection Items,*Configuration Item,*Certification Type,*WVTA ID," + + title = "*Category,*Inspection Items,*Certification Type,*WVTA ID," + "*Standard No,*Responsible Field,*Eng. Interface,*Assignee," + "Deliverable Template,*Deliverable Type,*Due Date,Report No,Product Model,Name Of Manufacturer"; } @@ -4675,7 +4675,7 @@ public class PlatformProjectCertificationInventoryEOServiceImpl extends ServiceI if (i == 0) { cell.setCellType(HSSFCell.CELL_TYPE_STRING); headerSb.append(cell.getStringCellValue() + ","); - if(j == 15){ + if(j == 14){ break; } } else if(i > 1){ @@ -4719,7 +4719,7 @@ public class PlatformProjectCertificationInventoryEOServiceImpl extends ServiceI ProjectCertificationInventoryEO projectCertificationInventoryEOTemp = JSON.parseObject(JSON.toJSONString(stringStringMap), ProjectCertificationInventoryEO.class); projectCertificationInventoryEOTemp.setCut(projectCertificationInventoryEO.getCut()); projectCertificationInventoryEOTemp.setProjectLibraryId(projectCertificationInventoryEO.getProjectLibraryId()); - projectCertificationInventoryEOTemp.setFlowStatus(CertificationInventoryFlowStatusEnum.LIST_TO_BE_RELEASED.getValue()); + projectCertificationInventoryEOTemp.setFlowStatus(CertificationInventoryFlowStatusEnum.LIST_TO_BE_CHECKED.getValue()); projectCertificationInventoryEOTemp.setCertificationProgress(CertificationProgressEnum.NOT_START.getValue()); datas.add(projectCertificationInventoryEOTemp); } @@ -4746,7 +4746,7 @@ public class PlatformProjectCertificationInventoryEOServiceImpl extends ServiceI for(int k = 0 ; k userIdList = new ArrayList<>(); + if(ObjectUtils.isNotEmpty(datas)){ + //sdtName + List collect1 = datas.stream().filter(e -> StringUtils.isNotBlank(e.getSdtName())) + .map(ProjectCertificationInventoryEO::getSdtName).distinct().collect(Collectors.toList()); + if(ObjectUtils.isNotEmpty(collect1)){ + userIdList.addAll(collect1); + } + } + List userList = new ArrayList<>(); + if(ObjectUtils.isNotEmpty(userIdList)){ + userList = sysUserService.queryUserIdListByNameList(userIdList); + } + for (ProjectCertificationInventoryEO projectCertificationInventoryEO : datas) { i++; String errorMsg = ""; @@ -4992,7 +5007,9 @@ public class PlatformProjectCertificationInventoryEOServiceImpl extends ServiceI nameCn = "工程接口人"; nameEn = "Eng. Interface "; //验证人员是否存在 - personnelVerify(projectCertificationInventoryEO, errorMsg, msgList, sdt, mapPersonList,nameCn,nameEn, com.jero.modules.project.enums.ProjectRoleEnum.ENGINEERING_INTERFACE_PERSON.getValue()); + List sysUsers = userList.stream().filter(e -> sdt.equals(e.getUsername())).collect(Collectors.toList()); + personnelVerify(projectCertificationInventoryEO, errorMsg, msgList, sdt, sysUsers,nameCn,nameEn, com.jero.modules.project.enums.ProjectRoleEnum.ENGINEERING_INTERFACE_PERSON.getValue()); +// personnelVerify(projectCertificationInventoryEO, errorMsg, msgList, sdt, mapPersonList,nameCn,nameEn, com.jero.modules.project.enums.ProjectRoleEnum.ENGINEERING_INTERFACE_PERSON.getValue()); } //责任人 @@ -5294,7 +5311,7 @@ public class PlatformProjectCertificationInventoryEOServiceImpl extends ServiceI } private void personnelVerify(ProjectCertificationInventoryEO projectCertificationInventoryEO, String errorMsg, List msgList, String regulationOwnerId, - List> mapList, String nameCn, String nameEn, String fieldNumber) { + List sysUserList, String nameCn, String nameEn, String fieldNumber) { //单选 if(regulationOwnerId.contains(",")){ if(CutEnum.CN.getValue().equals(projectCertificationInventoryEO.getCut())){ @@ -5305,35 +5322,61 @@ public class PlatformProjectCertificationInventoryEOServiceImpl extends ServiceI msgList.add(errorMsg); } - if(mapList.size() != 0){ - int count = 0; - for (Map stringStringMap : mapList) { - String name = stringStringMap.get("name"); - if(regulationOwnerId.equals(name)){ - count ++; - if(com.jero.modules.project.enums.ProjectRoleEnum.ENGINEERING_INTERFACE_PERSON.getValue().equals(fieldNumber)){ - projectCertificationInventoryEO.setSdt(stringStringMap.get("value")); - } - break; - } - } - if(count == 0){ - if(CutEnum.CN.getValue().equals(projectCertificationInventoryEO.getCut())){ - errorMsg += nameCn+regulationOwnerId+"与相关人员名单中责任领域下的人员不匹配"; - }else{ - errorMsg += nameEn+regulationOwnerId+"does not match a person under the Responsible Field in the relevant person list"; - } - msgList.add(errorMsg); + if(ObjectUtils.isNotEmpty(sysUserList)){ + if(com.jero.modules.project.enums.ProjectRoleEnum.ENGINEERING_INTERFACE_PERSON.getValue().equals(fieldNumber)){ + projectCertificationInventoryEO.setSdt(sysUserList.get(0).getId()); } }else{ if(CutEnum.CN.getValue().equals(projectCertificationInventoryEO.getCut())){ - errorMsg += nameCn+regulationOwnerId+"与相关人员名单中责任领域下的人员不匹配"; + errorMsg += nameCn+regulationOwnerId+"不存在"; }else{ - errorMsg += nameEn+regulationOwnerId+"does not match a person under the Responsible Field in the relevant person list"; + errorMsg += nameEn+regulationOwnerId+"absent"; } msgList.add(errorMsg); } } +// private void personnelVerify(ProjectCertificationInventoryEO projectCertificationInventoryEO, +// String errorMsg, List msgList, String regulationOwnerId, +// List> mapList, String nameCn, String nameEn, String fieldNumber) { +// //单选 +// if(regulationOwnerId.contains(",")){ +// if(CutEnum.CN.getValue().equals(projectCertificationInventoryEO.getCut())){ +// errorMsg += nameCn + "导入只能填写一个用户名"; +// }else{ +// errorMsg += "Only one user name can be entered for"+ nameEn +"import"; +// } +// msgList.add(errorMsg); +// } +// +// if(mapList.size() != 0){ +// int count = 0; +// for (Map stringStringMap : mapList) { +// String name = stringStringMap.get("name"); +// if(regulationOwnerId.equals(name)){ +// count ++; +// if(com.jero.modules.project.enums.ProjectRoleEnum.ENGINEERING_INTERFACE_PERSON.getValue().equals(fieldNumber)){ +// projectCertificationInventoryEO.setSdt(stringStringMap.get("value")); +// } +// break; +// } +// } +// if(count == 0){ +// if(CutEnum.CN.getValue().equals(projectCertificationInventoryEO.getCut())){ +// errorMsg += nameCn+regulationOwnerId+"与相关人员名单中责任领域下的人员不匹配"; +// }else{ +// errorMsg += nameEn+regulationOwnerId+"does not match a person under the Responsible Field in the relevant person list"; +// } +// msgList.add(errorMsg); +// } +// }else{ +// if(CutEnum.CN.getValue().equals(projectCertificationInventoryEO.getCut())){ +// errorMsg += nameCn+regulationOwnerId+"与相关人员名单中责任领域下的人员不匹配"; +// }else{ +// errorMsg += nameEn+regulationOwnerId+"does not match a person under the Responsible Field in the relevant person list"; +// } +// msgList.add(errorMsg); +// } +// } private String pullMore(List dictItemList, ProjectCertificationInventoryEO projectCertificationInventoryEO, String errorMsg, String value, List msgList,