57363 法规清单、任务清单,责任领域多选查询处理。
This commit is contained in:
+24
-1
@@ -629,17 +629,40 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
||||
*/
|
||||
@Override
|
||||
public List<ProjectLawsInventoryEO> queryList(ProjectLawsInventoryEO projectLawsInventoryEO, HttpServletRequest req) {
|
||||
|
||||
String dutyTerritoryStr = "";
|
||||
if (StringUtils.isNotEmpty(projectLawsInventoryEO.getDutyTerritory())) {
|
||||
dutyTerritoryStr = projectLawsInventoryEO.getDutyTerritory();
|
||||
projectLawsInventoryEO.setDutyTerritory(null);
|
||||
}
|
||||
|
||||
QueryWrapper<ProjectLawsInventoryEO> 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(), "");
|
||||
|
||||
+23
-1
@@ -169,12 +169,34 @@ public class ProjectTaskInventoryEOServiceImpl extends ServiceImpl<ProjectTaskIn
|
||||
LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
ProjectLawsInventoryEO projectLawsInventoryEO = new ProjectLawsInventoryEO();
|
||||
projectLawsInventoryEO.setSerialNumber(projectTaskInventoryEO.getSerialNumber());
|
||||
projectLawsInventoryEO.setDutyTerritory(projectTaskInventoryEO.getDutyTerritory());
|
||||
//projectLawsInventoryEO.setDutyTerritory(projectTaskInventoryEO.getDutyTerritory());
|
||||
QueryWrapper<ProjectLawsInventoryEO> lawsInventoryEOQueryWrapper = QueryGenerator.initQueryWrapper(projectLawsInventoryEO,req.getParameterMap());
|
||||
//QueryWrapper<ProjectLawsInventoryEO> 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<ProjectLawsInventoryEO> projectLawsInventoryEOList = projectLawsInventoryEOMapper.selectList(lawsInventoryEOQueryWrapper);
|
||||
|
||||
if(CollectionUtils.isNotEmpty(projectLawsInventoryEOList)){
|
||||
|
||||
Reference in New Issue
Block a user