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)){