Browse Source

评审清单

tags/24080901
PoffyZhang 1 year ago
parent
commit
13a43b6d0a
2 changed files with 25 additions and 2 deletions
  1. +22
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ReviewChecklistManage.java
  2. +3
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectReviewCheckListItemVO.java

+ 22
- 2
pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ReviewChecklistManage.java View File

@@ -89,6 +89,15 @@ public class ReviewChecklistManage {
Map<String, List<ReviewChecklistApprove>> approveMap =
approves.stream().collect(Collectors.groupingBy(ReviewChecklistApprove::getProjectCode));

List<String> reviewHumans = Lists.newArrayList();;
if(BizConst.DEV.equals(active)){
reviewHumans = DeclaredProjectContant.ReviewChecklist.REVIEW_HUMANS_ZYD;
}else{
reviewHumans = DeclaredProjectContant.ReviewChecklist.REVIEW_HUMANS_ZZD;
}
List<UserFullInfoDTO> users = userInfoHelper.getUserFullInfoByEmployeeCodes(reviewHumans);
Map<String, String> userMap = users.stream().collect(Collectors.toMap(u -> u.getEmployeeCode()
, u -> u.getUsername()));
List<ProjectReviewCheckListItemVO> records = CollUtils.convert(page.getRecords(), w -> {
ProjectReviewCheckListItemVO item = new ProjectReviewCheckListItemVO();
item.setId(w.getId());
@@ -109,13 +118,14 @@ public class ReviewChecklistManage {
item.setApprovedAmount(w.getApprovalAmount());
item.setAnnualPlanAmount(w.getAnnualPlanAmount());
// 审查人员情况
item.setVerifiedHumans(computeVerify(approveMap.get(w.getProjectCode())));
item.setVerifiedHumans(computeVerify(item,approveMap.get(w.getProjectCode()),userMap));
return item;
});
return PageVo.of(records, page.getTotal());
}

private String computeVerify(List<ReviewChecklistApprove> reviewChecklistApproves) {
private String computeVerify(ProjectReviewCheckListItemVO item,List<ReviewChecklistApprove> reviewChecklistApproves,
Map<String, String> userMap) {
List<String> reviewHumans = Lists.newArrayList();;
if(BizConst.DEV.equals(active)){
reviewHumans = DeclaredProjectContant.ReviewChecklist.REVIEW_HUMANS_ZYD;
@@ -138,9 +148,19 @@ public class ReviewChecklistManage {
}
});

item.setReviewCheckNotApprove(convertUser(userMap,computeHumanSet));

return finishNums[0] + StrPool.SLASH + maxNums;
}

private String convertUser(Map<String, String> userMap, Set<String> computeHumanSet) {
if(CollUtil.isEmpty(userMap) || CollUtil.isEmpty(computeHumanSet)){
return StringUtils.EMPTY;
}
return computeHumanSet.stream().filter(s -> StringUtils.isNotBlank(s) && userMap.containsKey(s))
.map(s -> userMap.get(s)).collect(Collectors.joining(StrPool.COMMA));
}

public UserFullInfoDTO buildProjectLibPermission(LambdaQueryWrapper<Project> query, UserInfoDetails user) {
UserFullInfoDTO userDto = BeanUtil.copyProperties(user,UserFullInfoDTO.class);
Optional<DataScopeDTO> currentUserDataScope = DataScopeUtil.getCurrentUserDataScope(userDto);


+ 3
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectReviewCheckListItemVO.java View File

@@ -119,6 +119,9 @@ public class ProjectReviewCheckListItemVO {
@ApiModelProperty("是否开启评审清单")
private Boolean reviewCheckFinish;

@ApiModelProperty("未审批人员")
private String reviewCheckNotApprove;

public String getProjectTypeName() {
if (Objects.nonNull(this.projectType)) {
Optional.ofNullable(ProjectTypeNewEnum.getDesc(this.projectType))


Loading…
Cancel
Save