From aa204cf48c64c579eecbebbe17c4bda9d231efc2 Mon Sep 17 00:00:00 2001 From: wangzhijiang <12345678> Date: Tue, 16 Aug 2022 17:29:26 +0800 Subject: [PATCH] =?UTF-8?q?57363=20=E6=B3=95=E8=A7=84=E6=B8=85=E5=8D=95?= =?UTF-8?q?=E3=80=81=E4=BB=BB=E5=8A=A1=E6=B8=85=E5=8D=95=EF=BC=8C=E8=B4=A3?= =?UTF-8?q?=E4=BB=BB=E9=A2=86=E5=9F=9F=E5=A4=9A=E9=80=89=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E5=A4=84=E7=90=86=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ProjectLawsInventoryEOServiceImpl.java | 25 ++++++++++++++++++- .../ProjectTaskInventoryEOServiceImpl.java | 24 +++++++++++++++++- 2 files changed, 47 insertions(+), 2 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 525b4f7e4..fb186335b 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 @@ -629,17 +629,40 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl queryList(ProjectLawsInventoryEO projectLawsInventoryEO, HttpServletRequest req) { + + String dutyTerritoryStr = ""; + if (StringUtils.isNotEmpty(projectLawsInventoryEO.getDutyTerritory())) { + dutyTerritoryStr = projectLawsInventoryEO.getDutyTerritory(); + projectLawsInventoryEO.setDutyTerritory(null); + } + QueryWrapper projectLawsInventoryEOQueryWrapper = QueryGenerator.initQueryWrapper(projectLawsInventoryEO,req.getParameterMap()); projectLawsInventoryEOQueryWrapper.orderByDesc("create_time","serial_number"); String projectLibraryId = projectLawsInventoryEO.getProjectLibraryId(); + if (StringUtils.isNotEmpty(dutyTerritoryStr)) { + String finalDutyTerritoryStr = dutyTerritoryStr.replaceAll("\\*",""); + projectLawsInventoryEOQueryWrapper.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); + }); + } + } + }); + } + + if(StringUtils.isEmpty(projectLibraryId)){ throw new JeroBootException("项目库id不能为空!"); } LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); - projectLawsInventoryEOQueryWrapper.lambda().eq(ProjectLawsInventoryEO::getProjectLibraryId,projectLibraryId); + //projectLawsInventoryEOQueryWrapper.lambda().eq(ProjectLawsInventoryEO::getProjectLibraryId,projectLibraryId); //验证当前用户在该项目中是什么角色 //int isProjectRole = checkUserRole(projectLibraryId, currentUser.getId(), ""); diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectTaskInventoryEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectTaskInventoryEOServiceImpl.java index 4e5f4babf..17c1d4e9c 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectTaskInventoryEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectTaskInventoryEOServiceImpl.java @@ -169,12 +169,34 @@ public class ProjectTaskInventoryEOServiceImpl extends ServiceImpl lawsInventoryEOQueryWrapper = QueryGenerator.initQueryWrapper(projectLawsInventoryEO,req.getParameterMap()); //QueryWrapper lawsInventoryEOQueryWrapper = new QueryWrapper<>(); lawsInventoryEOQueryWrapper.lambda().eq(ProjectLawsInventoryEO::getProjectLibraryId,projectLibraryId); lawsInventoryEOQueryWrapper.lambda().eq(ProjectLawsInventoryEO::getInventoryAffirmStatus, InventoryAffirmStatusEnum.ACCEPTED.getValue()); lawsInventoryEOQueryWrapper.lambda().eq(ProjectLawsInventoryEO::getTaskAffirmStatus, TaskAffirmStatusEnum.ACCEPTED.getValue()); + + String dutyTerritoryStr = ""; + if (StringUtils.isNotEmpty(projectTaskInventoryEO.getDutyTerritory())) { + dutyTerritoryStr = projectTaskInventoryEO.getDutyTerritory(); + projectTaskInventoryEO.setDutyTerritory(null); + } + + if (StringUtils.isNotEmpty(dutyTerritoryStr)) { + String finalDutyTerritoryStr = dutyTerritoryStr.replaceAll("\\*",""); + lawsInventoryEOQueryWrapper.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); + }); + } + } + }); + } + List projectLawsInventoryEOList = projectLawsInventoryEOMapper.selectList(lawsInventoryEOQueryWrapper); if(CollectionUtils.isNotEmpty(projectLawsInventoryEOList)){