Преглед на файлове

工作台项目列表 权限

master
PoffyZhang преди 11 месеца
родител
ревизия
adc341a455
променени са 2 файла, в които са добавени 61 реда и са изтрити 5 реда
  1. +59
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java
  2. +2
    -3
      pmapi/src/main/java/com/ningdatech/pmapi/workbench/manage/WorkbenchManage.java

+ 59
- 2
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java Целия файл

@@ -297,8 +297,6 @@ public class ProjectLibManage {
}
UserFullInfoDTO finalUser = user;

Set<String> projectCodes = page.getRecords().stream()
.map(Project::getProjectCode).collect(Collectors.toSet());
Set<String> instCodes = page.getRecords().stream()
.map(Project::getInstCode).collect(Collectors.toSet());
List<Task> tasks = taskService.createTaskQuery()
@@ -542,6 +540,65 @@ public class ProjectLibManage {
return PageVo.of(records, page.getTotal());
}

public PageVo<ProjectLibListItemVO> listWithPermissionWorkbentch(ProjectListReq req,
UserFullInfoDTO user) {
req = buildProjectLibPermission(req,user);
Page<ProjectPO> page = projectService.pagelibWithPermission(req.page(), req);
long total;
if (CollUtil.isEmpty(page.getRecords())) {
return PageVo.empty();
}
UserFullInfoDTO finalUser = user;

Set<String> instCodes = page.getRecords().stream()
.map(ProjectPO::getInstCode).collect(Collectors.toSet());
List<Task> tasks = taskService.createTaskQuery()
.processInstanceIdIn(instCodes)
.orderByTaskCreateTime()
.asc()
.list();
Map<String, List<Task>> map = Maps.newHashMap();
Map<String,UserFullInfoDTO> userMap = Maps.newHashMap();
if(CollUtil.isNotEmpty(tasks)){
map = tasks.stream()
.collect(Collectors.groupingBy(Task::getProcessInstanceId));
userMap = searchUser(tasks,userInfoHelper);
}

List<ProjectLibListItemVO> records = Lists.newArrayList();
for(ProjectPO w : page.getRecords()){
ProjectLibListItemVO item = new ProjectLibListItemVO();
item.setId(w.getId());
item.setProjectName(w.getProjectName());
item.setProjectCode(w.getProjectCode());
item.setArea(w.getArea());
item.setAreaCode(w.getAreaCode());
item.setCreateOn(w.getCreateOn());
item.setDeclaredAmount(w.getDeclareAmount());
item.setStage(w.getStage());
item.setStatus(w.getStatus());
item.setProjectType(w.getProjectType());
item.setProjectYear(w.getProjectYear());
item.setBuildOrg(w.getBuildOrgName());
item.setBizDomain(w.getBizDomain());
item.setProcessStatus(w.getProcessStatus());
item.setInstCode(w.getInstCode());
item.setIsHigherSuperOrg(w.getIsHigherSuperOrg());
item.setApproveUsers(buildApproveUsers(w.getInstCode(),map,userMap));
if (finalUser.getIsOrgAdmin() &&
ProjectStatusEnum.PENDING_PREQUALIFICATION.getCode().equals(item.getStatus())
&& StringUtils.isNotBlank(w.getSuperOrgCode()) && StringUtils.isNotBlank(finalUser.getEmpPosUnitCode())
&& w.getSuperOrgCode().equals(finalUser.getEmpPosUnitCode())) {
item.setCanPreDeclared(Boolean.TRUE);
}
item.setApprovedAmount(w.getApprovalAmount());
item.setAnnualPlanAmount(w.getAnnualPlanAmount());
item.setPrePlanProjectId(w.getPrePlanProjectId());
records.add(item);
}
return PageVo.of(records, page.getTotal());
}

public static BigDecimal computeAmount(BigDecimal cuurentAmount,List<ProjectRenewalFundDeclaration> prfs) {
BigDecimal res = Objects.isNull(cuurentAmount) ? BigDecimal.ZERO : cuurentAmount;
for(ProjectRenewalFundDeclaration prf : prfs){


+ 2
- 3
pmapi/src/main/java/com/ningdatech/pmapi/workbench/manage/WorkbenchManage.java Целия файл

@@ -115,10 +115,9 @@ public class WorkbenchManage {
//这个不能放入子线程
ProjectListReq projectListReq = new ProjectListReq();
projectListReq.setPageNumber(1);
projectListReq.setPageSize(5);
projectListReq.setPageSize(2000);
projectListReq.setProjectYear(year);
projectListReq.setBuildOrgCode(user.getEmpPosUnitCode());
res.setProjects(new ArrayList<>(projectLibManage.projectLibListApprove(projectListReq, user).getRecords()));
res.setProjects(new ArrayList<>(projectLibManage.listWithPermissionWorkbentch(projectListReq,user).getRecords()));
return res;
}



Loading…
Отказ
Запис