From 4be1122a631549b7a6e19e853cc917f5745f8a15 Mon Sep 17 00:00:00 2001 From: zhn <947514737@qq.com> Date: Tue, 2 Jan 2024 18:35:47 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B3=95=E8=A7=84=E6=B8=85=E5=8D=95--=E6=B5=81?= =?UTF-8?q?=E7=A8=8B=E7=8A=B6=E6=80=81=E6=90=9C=E7=B4=A2=EF=BC=88=E5=B9=B3?= =?UTF-8?q?=E5=8F=B0=E4=BB=B6=E6=95=B0=E6=8D=AE=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ProjectLawsInventoryEOServiceImpl.java | 209 +++++++++++++++--- .../impl/ProjectLibraryBaseServiceImpl.java | 27 +-- 2 files changed, 178 insertions(+), 58 deletions(-) diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLawsInventoryEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLawsInventoryEOServiceImpl.java index 635dbae2c..c91f87505 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLawsInventoryEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLawsInventoryEOServiceImpl.java @@ -37,6 +37,7 @@ import com.jero.common.system.query.QueryGenerator; import com.jero.common.system.vo.DictModel; import com.jero.common.system.vo.LoginUser; import com.jero.common.util.DateUtils; +import com.jero.common.util.PageUtil; import com.jero.common.util.oss.CosBootUtil; import com.jero.modules.document.entity.BussDocumentLibraryEO; import com.jero.modules.document.service.IBussDocumentLibraryEOService; @@ -12247,34 +12248,34 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl { - query.lambda().like(ProjectLawsInventoryEO::getDesignFlowStatus, finalDesignFlowStatusStr); - if(StringUtils.contains(finalDesignFlowStatusStr,",")){ - String[] designFlowStatusArr = finalDesignFlowStatusStr.split(","); - for (String dsf : designFlowStatusArr) { - query.or(q -> { - q.like("design_flow_status",dsf); - }); - } - } - }); - } - if (StringUtils.isNotEmpty(verifyFlowStatusStr)) { - String finalVerifyFlowStatusStr = verifyFlowStatusStr.replaceAll("\\*",""); - queryWrapper.and(query -> { - query.lambda().like(ProjectLawsInventoryEO::getVerifyFlowStatus, finalVerifyFlowStatusStr); - if(StringUtils.contains(finalVerifyFlowStatusStr,",")){ - String[] verifyFlowStatusArr = finalVerifyFlowStatusStr.split(","); - for (String vsf : verifyFlowStatusArr) { - query.or(q -> { - q.like("verify_flow_status",vsf); - }); - } - } - }); - } +// if (StringUtils.isNotEmpty(designFlowStatusStr)) { +// String finalDesignFlowStatusStr = designFlowStatusStr.replaceAll("\\*",""); +// queryWrapper.and(query -> { +// query.lambda().like(ProjectLawsInventoryEO::getDesignFlowStatus, finalDesignFlowStatusStr); +// if(StringUtils.contains(finalDesignFlowStatusStr,",")){ +// String[] designFlowStatusArr = finalDesignFlowStatusStr.split(","); +// for (String dsf : designFlowStatusArr) { +// query.or(q -> { +// q.like("design_flow_status",dsf); +// }); +// } +// } +// }); +// } +// if (StringUtils.isNotEmpty(verifyFlowStatusStr)) { +// String finalVerifyFlowStatusStr = verifyFlowStatusStr.replaceAll("\\*",""); +// queryWrapper.and(query -> { +// query.lambda().like(ProjectLawsInventoryEO::getVerifyFlowStatus, finalVerifyFlowStatusStr); +// if(StringUtils.contains(finalVerifyFlowStatusStr,",")){ +// String[] verifyFlowStatusArr = finalVerifyFlowStatusStr.split(","); +// for (String vsf : verifyFlowStatusArr) { +// query.or(q -> { +// q.like("verify_flow_status",vsf); +// }); +// } +// } +// }); +// } if(isProjectRole != Integer.parseInt(ProjectRoleEnum.STUDIO_ENGINEER.getValue()) && isProjectRole != Integer.parseInt(ProjectRoleEnum.MANAGER.getValue()) @@ -12284,19 +12285,155 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl page = new Page(pageNo, pageSize); - IPage pageList = this.page(page, queryWrapper); - List result = pageList.getRecords(); - + List list = this.list(queryWrapper); //关联平台件数据 - platformDispose(projectLawsInventoryEO, result); + platformDispose(projectLawsInventoryEO, list); - this.dataDispose(result,currentUser,isProjectRole,projectLawsInventoryEO.getCut()); - this.dataDictDispose(result,projectLawsInventoryEO.getCut()); + List lawsInventoryEOList = new ArrayList<>(); + if(StringUtils.isNotBlank(designFlowStatusStr)){ + for (ProjectLawsInventoryEO lawsInventoryEO : list) { + if(designFlowStatusStr.contains(lawsInventoryEO.getDesignFlowStatus())){ + lawsInventoryEOList.add(lawsInventoryEO); + } + } + } + if(StringUtils.isNotBlank(verifyFlowStatusStr)){ + for (ProjectLawsInventoryEO lawsInventoryEO : list) { + if(verifyFlowStatusStr.contains(lawsInventoryEO.getVerifyFlowStatus())){ + lawsInventoryEOList.add(lawsInventoryEO); + } + } + } + if(StringUtils.isBlank(designFlowStatusStr) && StringUtils.isBlank(verifyFlowStatusStr)){ + lawsInventoryEOList = list; + } + + this.dataDispose(lawsInventoryEOList,currentUser,isProjectRole,projectLawsInventoryEO.getCut()); + this.dataDictDispose(lawsInventoryEOList,projectLawsInventoryEO.getCut()); //表头排序 - result = this.hearSort(projectLawsInventoryEO, result); + lawsInventoryEOList = this.hearSort(projectLawsInventoryEO, lawsInventoryEOList); + + Page pageList = PageUtil.getPages(pageNo, pageSize, lawsInventoryEOList); + return pageList; } +// @Override +// public IPage queryPage(ProjectLawsInventoryEO projectLawsInventoryEO, Integer pageNo, Integer pageSize, HttpServletRequest req) { +// String dutyTerritoryStr = ""; +// if (StringUtils.isNotEmpty(projectLawsInventoryEO.getDutyTerritory())) { +// dutyTerritoryStr = projectLawsInventoryEO.getDutyTerritory(); +// projectLawsInventoryEO.setDutyTerritory(null); +// } +// String designFlowStatusStr = ""; +// if (StringUtils.isNotEmpty(projectLawsInventoryEO.getDesignFlowStatus())) { +// designFlowStatusStr = projectLawsInventoryEO.getDesignFlowStatus(); +// projectLawsInventoryEO.setDesignFlowStatus(null); +// } +// String verifyFlowStatusStr = ""; +// if (StringUtils.isNotEmpty(projectLawsInventoryEO.getVerifyFlowStatus())) { +// verifyFlowStatusStr = projectLawsInventoryEO.getVerifyFlowStatus(); +// projectLawsInventoryEO.setVerifyFlowStatus(null); +// } +// +// // 根据一级责任领域(统计节点),查询该一级责任领域下所有子责任领域的法规清单数据。 +// if(StringUtils.isNotEmpty(projectLawsInventoryEO.getFirstLevelDutyTerritory())){ +// List sysDictItems = this.sysDictItemServiceImpl.selectItemsAll(); +// List dutyTerritorys = new ArrayList<>(); +// Map> firstLevelDTMap = this.sysDictItemServiceImpl.getFirstLevelSysDictItemByDictCode(DictCodeEnum.DUTY_TERRITORY.getValue(), sysDictItems); +// String[] firstLevelDTArr = projectLawsInventoryEO.getFirstLevelDutyTerritory().split(","); +// for (String firstLevelDT : firstLevelDTArr){ +// if(CollectionUtils.isNotEmpty(firstLevelDTMap.get(firstLevelDT))){ +// dutyTerritorys.addAll(firstLevelDTMap.get(firstLevelDT)); +// } +// } +// if(CollectionUtils.isNotEmpty(dutyTerritorys)){ +// dutyTerritoryStr = dutyTerritorys.stream().map(SysDictItem::getItemValue).distinct().collect(Collectors.joining(",")); +// } +// } +// +// QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(projectLawsInventoryEO, req.getParameterMap()); +// queryWrapper.orderByDesc("create_time","serial_number"); +// +// if (StringUtils.isNotEmpty(dutyTerritoryStr)) { +// String finalDutyTerritoryStr = dutyTerritoryStr.replaceAll("\\*",""); +// queryWrapper.and(query -> { +// query.lambda().like(ProjectLawsInventoryEO::getDutyTerritory, finalDutyTerritoryStr); +// if(StringUtils.contains(finalDutyTerritoryStr,",")){ +// String[] dutyTerritoryArr = finalDutyTerritoryStr.split(","); +// for (String duty : dutyTerritoryArr) { +// query.or(q -> { +// q.like("duty_territory",duty); +// }); +// } +// } +// }); +// } +// +// LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); +// int isProjectRole = Integer.parseInt(projectLawsInventoryEO.getRoleCode()); +// if (isProjectRole == Integer.parseInt(ProjectRoleEnum.VIEWER.getValue())) { +// //查当前用户Viewer对应责任领域 +// List dutyTerritoryList = this.projectUserDutyTerritoryService.queryDutyTerritoryByUserId(currentUser.getId()); +// if (ObjectUtils.isNotEmpty(dutyTerritoryList)) { +// queryWrapper.and(query -> { +// for (String duty : dutyTerritoryList) { +// query.or(q -> { +// q.like("duty_territory", duty); +// }); +// } +// }); +// } +// } +// if (StringUtils.isNotEmpty(designFlowStatusStr)) { +// String finalDesignFlowStatusStr = designFlowStatusStr.replaceAll("\\*",""); +// queryWrapper.and(query -> { +// query.lambda().like(ProjectLawsInventoryEO::getDesignFlowStatus, finalDesignFlowStatusStr); +// if(StringUtils.contains(finalDesignFlowStatusStr,",")){ +// String[] designFlowStatusArr = finalDesignFlowStatusStr.split(","); +// for (String dsf : designFlowStatusArr) { +// query.or(q -> { +// q.like("design_flow_status",dsf); +// }); +// } +// } +// }); +// } +// if (StringUtils.isNotEmpty(verifyFlowStatusStr)) { +// String finalVerifyFlowStatusStr = verifyFlowStatusStr.replaceAll("\\*",""); +// queryWrapper.and(query -> { +// query.lambda().like(ProjectLawsInventoryEO::getVerifyFlowStatus, finalVerifyFlowStatusStr); +// if(StringUtils.contains(finalVerifyFlowStatusStr,",")){ +// String[] verifyFlowStatusArr = finalVerifyFlowStatusStr.split(","); +// for (String vsf : verifyFlowStatusArr) { +// query.or(q -> { +// q.like("verify_flow_status",vsf); +// }); +// } +// } +// }); +// } +// +// if(isProjectRole != Integer.parseInt(ProjectRoleEnum.STUDIO_ENGINEER.getValue()) +// && isProjectRole != Integer.parseInt(ProjectRoleEnum.MANAGER.getValue()) +// && isProjectRole != Integer.parseInt(ProjectRoleEnum.ADMIN.getValue()) +// && isProjectRole != Integer.parseInt(ProjectRoleEnum.VIEWER.getValue())){ +// // 创建查询权限 +// this.createQueryPermission(isProjectRole,currentUser,queryWrapper); +// } +// +// Page page = new Page(pageNo, pageSize); +// IPage pageList = this.page(page, queryWrapper); +// List result = pageList.getRecords(); +// +// //关联平台件数据 +// platformDispose(projectLawsInventoryEO, result); +// +// this.dataDispose(result,currentUser,isProjectRole,projectLawsInventoryEO.getCut()); +// this.dataDictDispose(result,projectLawsInventoryEO.getCut()); +// //表头排序 +// result = this.hearSort(projectLawsInventoryEO, result); +// return pageList; +// } public void platformDispose(ProjectLawsInventoryEO projectLawsInventoryEO, List result) { List valueList = FlowStateDesignEnum.getValueInfo();//修改为按高嵩提供的流程顺序 diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLibraryBaseServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLibraryBaseServiceImpl.java index 3954a57f7..f9e3386bf 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLibraryBaseServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLibraryBaseServiceImpl.java @@ -2794,42 +2794,25 @@ public class ProjectLibraryBaseServiceImpl extends ServiceImpl platformList = projectLawsInventoryPlatFormList.stream() .filter(e -> platformLawsInventoryIdList.contains(e.getId())).collect(Collectors.toList()); - for (ProjectLawsInventoryEO lawsInventoryEO : platformList) { + if(ObjectUtils.isNotEmpty(platformList)){ for (String value : valueInfo) { - if(value.equals(lawsInventoryEO.getDesignFlowStatus())){ + List collect1 = platformList.stream().filter(e -> value.equals(e.getDesignFlowStatus())).collect(Collectors.toList()); + if(ObjectUtils.isNotEmpty(collect1)){ projectLawsInventoryEO.setDesignFlowStatus(value); break; } } for (String value : valueInfo) { - if(value.equals(lawsInventoryEO.getVerifyFlowStatus())){ + List collect1 = platformList.stream().filter(e -> value.equals(e.getVerifyFlowStatus())).collect(Collectors.toList()); + if(ObjectUtils.isNotEmpty(collect1)){ projectLawsInventoryEO.setVerifyFlowStatus(value); break; } } } } - -// if(ObjectUtils.isNotEmpty(collect)){ -// yesList.add(projectLawsInventoryEO); -// }else{ -// noList.add(projectLawsInventoryEO); -// } } } -// if(ObjectUtils.isNotEmpty(projectLawsInventoryEOList) -// && ObjectUtils.isNotEmpty(yesList) -// && yesList.size() != projectLawsInventoryEOList.size() -// ){ -// //法规清单有数据且部分关联平台件数据 -// projectLawsInventoryEOList = noList; -// projectLawsInventoryEOList.addAll(projectLawsInventoryPlatFormList); -// }else if(ObjectUtils.isNotEmpty(projectLawsInventoryEOList) -// && ObjectUtils.isNotEmpty(yesList) -// && yesList.size() == projectLawsInventoryEOList.size()){ -// //法规清单有数据且全部关联了平台件 -// projectLawsInventoryEOList = projectLawsInventoryPlatFormList; -// } return projectLawsInventoryEOList; }