认证清单关联平台件--搜索
This commit is contained in:
+20
-17
@@ -2,12 +2,12 @@ package com.jero.modules.project.controller;
|
|||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.jero.common.api.vo.Result;
|
import com.jero.common.api.vo.Result;
|
||||||
import com.jero.common.aspect.annotation.AutoLog;
|
import com.jero.common.aspect.annotation.AutoLog;
|
||||||
import com.jero.common.system.base.controller.JeroController;
|
import com.jero.common.system.base.controller.JeroController;
|
||||||
import com.jero.common.system.query.QueryGenerator;
|
import com.jero.common.system.query.QueryGenerator;
|
||||||
|
import com.jero.common.util.PageUtil;
|
||||||
import com.jero.modules.project.entity.ProjectCertificationInventoryEO;
|
import com.jero.modules.project.entity.ProjectCertificationInventoryEO;
|
||||||
import com.jero.modules.project.service.IProjectCertificationInventoryEOService;
|
import com.jero.modules.project.service.IProjectCertificationInventoryEOService;
|
||||||
import com.jero.modules.system.entity.SysRole;
|
import com.jero.modules.system.entity.SysRole;
|
||||||
@@ -73,24 +73,27 @@ public class ProjectCertificationInventoryEOController extends JeroController<Pr
|
|||||||
projectCertificationInventoryEO.setFlowStatus(null);
|
projectCertificationInventoryEO.setFlowStatus(null);
|
||||||
}
|
}
|
||||||
QueryWrapper<ProjectCertificationInventoryEO> queryWrapper = QueryGenerator.initQueryWrapper(projectCertificationInventoryEO, req.getParameterMap());
|
QueryWrapper<ProjectCertificationInventoryEO> queryWrapper = QueryGenerator.initQueryWrapper(projectCertificationInventoryEO, req.getParameterMap());
|
||||||
if (StringUtils.isNotEmpty(flowStatusStr)) {
|
// if (StringUtils.isNotEmpty(flowStatusStr)) {
|
||||||
String finalflowStatusStr = flowStatusStr.replaceAll("\\*","");
|
// String finalflowStatusStr = flowStatusStr.replaceAll("\\*","");
|
||||||
queryWrapper.and(query -> {
|
// queryWrapper.and(query -> {
|
||||||
query.lambda().like(ProjectCertificationInventoryEO::getFlowStatus, finalflowStatusStr);
|
// query.lambda().like(ProjectCertificationInventoryEO::getFlowStatus, finalflowStatusStr);
|
||||||
if(StringUtils.contains(finalflowStatusStr,",")){
|
// if(StringUtils.contains(finalflowStatusStr,",")){
|
||||||
String[] flowStatusArr = finalflowStatusStr.split(",");
|
// String[] flowStatusArr = finalflowStatusStr.split(",");
|
||||||
for (String fs : flowStatusArr) {
|
// for (String fs : flowStatusArr) {
|
||||||
query.or(q -> {
|
// query.or(q -> {
|
||||||
q.like("flow_status",fs);
|
// q.like("flow_status",fs);
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
queryWrapper.orderByDesc("create_time");
|
queryWrapper.orderByDesc("create_time");
|
||||||
Page<ProjectCertificationInventoryEO> page = new Page<ProjectCertificationInventoryEO>(pageNo, pageSize);
|
Page<ProjectCertificationInventoryEO> page = new Page<ProjectCertificationInventoryEO>(pageNo, pageSize);
|
||||||
IPage<ProjectCertificationInventoryEO> pageList = this.projectCertificationInventoryEOService.queryPage(queryWrapper,page,projectCertificationInventoryEO,cut);
|
List<ProjectCertificationInventoryEO> pageList =
|
||||||
return Result.OK(cut,pageList);
|
this.projectCertificationInventoryEOService.getListInfo(queryWrapper,projectCertificationInventoryEO,cut,flowStatusStr);
|
||||||
|
Page pages = PageUtil.getPages(pageNo, pageSize, pageList);
|
||||||
|
|
||||||
|
return Result.OK(cut,pages);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+5
@@ -128,6 +128,11 @@ public interface IProjectCertificationInventoryEOService extends IService<Projec
|
|||||||
ProjectCertificationInventoryEO projectCertificationInventoryEO,
|
ProjectCertificationInventoryEO projectCertificationInventoryEO,
|
||||||
String cut);
|
String cut);
|
||||||
|
|
||||||
|
List<ProjectCertificationInventoryEO> getListInfo(QueryWrapper<ProjectCertificationInventoryEO> queryWrapper,
|
||||||
|
ProjectCertificationInventoryEO projectCertificationInventoryEO,
|
||||||
|
String cut,
|
||||||
|
String flowStatusStr);
|
||||||
|
|
||||||
void createQueryPermission(QueryWrapper<ProjectCertificationInventoryEO> queryWrapper, String roleCode);
|
void createQueryPermission(QueryWrapper<ProjectCertificationInventoryEO> queryWrapper, String roleCode);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+66
@@ -1960,6 +1960,72 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
|
|||||||
pageList.setRecords(records);
|
pageList.setRecords(records);
|
||||||
return pageList;
|
return pageList;
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
|
public List<ProjectCertificationInventoryEO> getListInfo(QueryWrapper<ProjectCertificationInventoryEO> queryWrapper,
|
||||||
|
ProjectCertificationInventoryEO projectCertificationInventoryEO,
|
||||||
|
String cut,
|
||||||
|
String flowStatusStr) {
|
||||||
|
|
||||||
|
String roleCode = projectCertificationInventoryEO.getRoleCode();
|
||||||
|
// 创建查询权限
|
||||||
|
this.createQueryPermission(queryWrapper,roleCode);
|
||||||
|
// 根据一级责任领域(统计节点),查询该一级责任领域下所有子责任领域的法规清单数据。
|
||||||
|
String dutyTerritoryStr = "";
|
||||||
|
if(StringUtils.isNotEmpty(projectCertificationInventoryEO.getFirstLevelDutyTerritory())){
|
||||||
|
List<SysDictItem> sysDictItems = this.sysDictItemServiceImpl.selectItemsAll();
|
||||||
|
List<SysDictItem> dutyTerritorys = new ArrayList<>();
|
||||||
|
Map<String, List<SysDictItem>> firstLevelDTMap = this.sysDictItemServiceImpl.getFirstLevelSysDictItemByDictCode(DictCodeEnum.DUTY_TERRITORY.getValue(), sysDictItems);
|
||||||
|
String[] firstLevelDTArr = projectCertificationInventoryEO.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(","));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotEmpty(dutyTerritoryStr)) {
|
||||||
|
String finalDutyTerritoryStr = dutyTerritoryStr.replaceAll("\\*","");
|
||||||
|
queryWrapper.and(query -> {
|
||||||
|
query.lambda().like(ProjectCertificationInventoryEO::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(roleCode);
|
||||||
|
if (isProjectRole == Integer.parseInt(com.jero.modules.project.enums.ProjectRoleEnum.VIEWER.getValue())) {
|
||||||
|
//查当前用户Viewer对应责任领域
|
||||||
|
List<String> 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);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
List<ProjectCertificationInventoryEO> pageList = this.list(queryWrapper);
|
||||||
|
//平台件数据处理
|
||||||
|
platformDispose(cut,projectCertificationInventoryEO, pageList);
|
||||||
|
//流程状态搜索
|
||||||
|
if(StringUtils.isNotBlank(flowStatusStr)){
|
||||||
|
pageList = pageList.stream().filter(e->flowStatusStr.contains(e.getFlowStatus())).collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
this.disposeData(pageList,cut);
|
||||||
|
List<ProjectCertificationInventoryEO> list = this.hearSort(projectCertificationInventoryEO, pageList);
|
||||||
|
return list;
|
||||||
|
}
|
||||||
private void platformDispose(String cut,ProjectCertificationInventoryEO projectCertificationInventoryEO, List<ProjectCertificationInventoryEO> result) {
|
private void platformDispose(String cut,ProjectCertificationInventoryEO projectCertificationInventoryEO, List<ProjectCertificationInventoryEO> result) {
|
||||||
List<LawsInventoryPlatformEO> lawsInventoryPlatformEOList = new ArrayList<>();
|
List<LawsInventoryPlatformEO> lawsInventoryPlatformEOList = new ArrayList<>();
|
||||||
List<ProjectCertificationInventoryEO> projectCertificationInventoryEOS = new ArrayList<>();
|
List<ProjectCertificationInventoryEO> projectCertificationInventoryEOS = new ArrayList<>();
|
||||||
|
|||||||
Reference in New Issue
Block a user