|
@@ -297,8 +297,6 @@ public class ProjectLibManage { |
|
|
} |
|
|
} |
|
|
UserFullInfoDTO finalUser = user; |
|
|
UserFullInfoDTO finalUser = user; |
|
|
|
|
|
|
|
|
Set<String> projectCodes = page.getRecords().stream() |
|
|
|
|
|
.map(Project::getProjectCode).collect(Collectors.toSet()); |
|
|
|
|
|
Set<String> instCodes = page.getRecords().stream() |
|
|
Set<String> instCodes = page.getRecords().stream() |
|
|
.map(Project::getInstCode).collect(Collectors.toSet()); |
|
|
.map(Project::getInstCode).collect(Collectors.toSet()); |
|
|
List<Task> tasks = taskService.createTaskQuery() |
|
|
List<Task> tasks = taskService.createTaskQuery() |
|
@@ -542,6 +540,65 @@ public class ProjectLibManage { |
|
|
return PageVo.of(records, page.getTotal()); |
|
|
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) { |
|
|
public static BigDecimal computeAmount(BigDecimal cuurentAmount,List<ProjectRenewalFundDeclaration> prfs) { |
|
|
BigDecimal res = Objects.isNull(cuurentAmount) ? BigDecimal.ZERO : cuurentAmount; |
|
|
BigDecimal res = Objects.isNull(cuurentAmount) ? BigDecimal.ZERO : cuurentAmount; |
|
|
for(ProjectRenewalFundDeclaration prf : prfs){ |
|
|
for(ProjectRenewalFundDeclaration prf : prfs){ |
|
|