|
|
@@ -33,6 +33,9 @@ import com.ningdatech.pmapi.projectlib.service.IProjectService; |
|
|
|
import com.ningdatech.pmapi.user.security.auth.model.UserFullInfoDTO; |
|
|
|
import com.ningdatech.pmapi.user.security.auth.model.UserInfoDetails; |
|
|
|
import com.ningdatech.pmapi.user.util.LoginUserUtil; |
|
|
|
import com.wflow.bean.dto.FormsReviewChecklistDto; |
|
|
|
import com.wflow.bean.dto.ReviewChecklistModuleDto; |
|
|
|
import com.wflow.bean.dto.WflowFormsDto; |
|
|
|
import com.wflow.enums.ReviewChecklistResultEnum; |
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
@@ -238,7 +241,7 @@ public class ReviewChecklistManage { |
|
|
|
* @param projectCode |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
public List<ReviewChecklistApproveVO> summaryList(String projectCode) { |
|
|
|
public List<FormsReviewChecklistDto> summaryList(String projectCode) { |
|
|
|
List<ReviewChecklistApprove> approves = reviewChecklistApproveService.list(Wrappers.lambdaQuery(ReviewChecklistApprove.class) |
|
|
|
.eq(ReviewChecklistApprove::getProjectCode, projectCode) |
|
|
|
.orderByAsc(ReviewChecklistApprove::getCreateOn)); |
|
|
@@ -247,22 +250,20 @@ public class ReviewChecklistManage { |
|
|
|
} |
|
|
|
|
|
|
|
//做成map |
|
|
|
Map<String, List<ReviewChecklistApprove>> groupSubMap = approves.stream() |
|
|
|
.collect(Collectors.groupingBy(ReviewChecklistApprove::getSubTitle)); |
|
|
|
//去重子标题 |
|
|
|
Map<String, List<ReviewChecklistApprove>> groupTitleMap = approves.stream() |
|
|
|
.collect(Collectors.groupingBy(ReviewChecklistApprove::getTitle)); |
|
|
|
//去重标题 |
|
|
|
Set<String> subTitleSet = Sets.newHashSet(); |
|
|
|
List<ReviewChecklistApprove> dupSubTitle = approves.stream().filter(r -> subTitleSet.add(r.getSubTitle())).collect(Collectors.toList()); |
|
|
|
List<ReviewChecklistApprove> dupTitle = approves.stream().filter(r -> subTitleSet.add(r.getTitle())) |
|
|
|
.collect(Collectors.toList()); |
|
|
|
|
|
|
|
List<ReviewChecklistApproveVO> res = dupSubTitle.stream() |
|
|
|
List<FormsReviewChecklistDto> res = dupTitle.stream() |
|
|
|
.map(r -> { |
|
|
|
ReviewChecklistApproveVO vo = BeanUtil.copyProperties(r, ReviewChecklistApproveVO.class); |
|
|
|
if(groupSubMap.containsKey(vo.getSubTitle())){ |
|
|
|
List<ReviewChecklistApprove> reviewChecklistApproves = groupSubMap.get(vo.getSubTitle()); |
|
|
|
StringBuffer reviewCommentsSb = new StringBuffer(); |
|
|
|
for(ReviewChecklistApprove approve : reviewChecklistApproves){ |
|
|
|
reviewCommentsSb.append(approve.getCreateBy() + StrPool.COLON + approve.getReviewComments() + "\n"); |
|
|
|
} |
|
|
|
vo.setReviewComments(reviewCommentsSb.toString()); |
|
|
|
FormsReviewChecklistDto vo = new FormsReviewChecklistDto(); |
|
|
|
vo.setTitle(r.getTitle()); |
|
|
|
if(groupTitleMap.containsKey(r.getTitle())){ |
|
|
|
List<ReviewChecklistApprove> reviewChecklistApproves = groupTitleMap.get(r.getTitle()); |
|
|
|
vo.setModules(convertModules(reviewChecklistApproves)); |
|
|
|
} |
|
|
|
return vo; |
|
|
|
}) |
|
|
@@ -302,29 +303,22 @@ public class ReviewChecklistManage { |
|
|
|
} |
|
|
|
|
|
|
|
//做成map 并且还要 未通过的 |
|
|
|
Map<String, List<ReviewChecklistApprove>> groupSubMap = approves.stream() |
|
|
|
Map<String, List<ReviewChecklistApprove>> groupTitleMap = approves.stream() |
|
|
|
.filter(r -> Objects.nonNull(r.getReviewResult()) && Lists.newArrayList( |
|
|
|
ReviewChecklistResultEnum.NOT_PASS.getCode(),ReviewChecklistResultEnum.ONE_VOTE_VETO.getCode()) |
|
|
|
.contains(r.getReviewResult())) |
|
|
|
.collect(Collectors.groupingBy(ReviewChecklistApprove::getSubTitle)); |
|
|
|
.collect(Collectors.groupingBy(ReviewChecklistApprove::getTitle)); |
|
|
|
//去重子标题 |
|
|
|
Set<String> subTitleSet = Sets.newHashSet(); |
|
|
|
List<ReviewChecklistApprove> dupSubTitle = approves.stream().filter(r -> subTitleSet.add(r.getSubTitle())).collect(Collectors.toList()); |
|
|
|
Set<String> titleSet = Sets.newHashSet(); |
|
|
|
List<ReviewChecklistApprove> dupTitle = approves.stream().filter(r -> titleSet.add(r.getTitle())).collect(Collectors.toList()); |
|
|
|
|
|
|
|
List<ReviewChecklistApproveVO> res = dupSubTitle.stream() |
|
|
|
List<FormsReviewChecklistDto> res = dupTitle.stream() |
|
|
|
.map(r -> { |
|
|
|
ReviewChecklistApproveVO vo = BeanUtil.copyProperties(r, ReviewChecklistApproveVO.class); |
|
|
|
if(groupSubMap.containsKey(vo.getSubTitle())){ |
|
|
|
List<ReviewChecklistApprove> reviewChecklistApproves = groupSubMap.get(vo.getSubTitle()); |
|
|
|
StringBuffer reviewCommentsSb = new StringBuffer(); |
|
|
|
if(CollUtil.isEmpty(reviewChecklistApproves)){ |
|
|
|
vo.setReviewComments("通过"); |
|
|
|
}else{ |
|
|
|
for(ReviewChecklistApprove approve : reviewChecklistApproves){ |
|
|
|
reviewCommentsSb.append(approve.getCreateBy() + StrPool.COLON + approve.getReviewComments() + "\n"); |
|
|
|
} |
|
|
|
vo.setReviewComments(reviewCommentsSb.toString()); |
|
|
|
} |
|
|
|
FormsReviewChecklistDto vo = new FormsReviewChecklistDto(); |
|
|
|
vo.setTitle(r.getTitle()); |
|
|
|
if(groupTitleMap.containsKey(r.getTitle())){ |
|
|
|
List<ReviewChecklistApprove> reviewChecklistApproves = groupTitleMap.get(r.getTitle()); |
|
|
|
vo.setModules(convertModulesFinal(reviewChecklistApproves)); |
|
|
|
} |
|
|
|
return vo; |
|
|
|
}) |
|
|
@@ -337,8 +331,83 @@ public class ReviewChecklistManage { |
|
|
|
return BizConst.OP_SUCCESS; |
|
|
|
} |
|
|
|
|
|
|
|
public List<ReviewCheckInfoVO> approveList(String projectCode) { |
|
|
|
/** |
|
|
|
* 查询 未审批人员 |
|
|
|
* @param projectCode |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
public List<String> approveList(String projectCode) { |
|
|
|
List<String> reviewHumans = Lists.newArrayList();; |
|
|
|
if(BizConst.DEV.equals(active)){ |
|
|
|
reviewHumans = DeclaredProjectContant.ReviewChecklist.REVIEW_HUMANS_ZYD; |
|
|
|
}else{ |
|
|
|
reviewHumans = DeclaredProjectContant.ReviewChecklist.REVIEW_HUMANS_ZZD; |
|
|
|
} |
|
|
|
Set<String> computeHumanSet = reviewHumans.stream().collect(Collectors.toSet()); |
|
|
|
List<ReviewChecklistApprove> approves = reviewChecklistApproveService.list(Wrappers.lambdaQuery(ReviewChecklistApprove.class) |
|
|
|
.eq(ReviewChecklistApprove::getProjectCode, projectCode) |
|
|
|
.orderByAsc(ReviewChecklistApprove::getCreateOn)); |
|
|
|
if(CollUtil.isEmpty(approves)){ |
|
|
|
return Collections.emptyList(); |
|
|
|
} |
|
|
|
for(ReviewChecklistApprove approve : approves){ |
|
|
|
computeHumanSet.remove(approve.getCreateByCode()); |
|
|
|
} |
|
|
|
return computeHumanSet.stream().collect(Collectors.toList()); |
|
|
|
} |
|
|
|
|
|
|
|
private List<ReviewChecklistModuleDto> convertModules(List<ReviewChecklistApprove> reviewChecklistApproves) { |
|
|
|
//做成map |
|
|
|
Map<String, List<ReviewChecklistApprove>> groupSubTitleMap = reviewChecklistApproves.stream() |
|
|
|
.collect(Collectors.groupingBy(ReviewChecklistApprove::getSubTitle)); |
|
|
|
//去重子标题 |
|
|
|
Set<String> subSubTitleSet = Sets.newHashSet(); |
|
|
|
List<ReviewChecklistApprove> dupSubTitle = reviewChecklistApproves.stream().filter(r -> subSubTitleSet.add(r.getSubTitle())) |
|
|
|
.collect(Collectors.toList()); |
|
|
|
return dupSubTitle.stream() |
|
|
|
.map(r -> { |
|
|
|
ReviewChecklistModuleDto vo = BeanUtil.copyProperties(r,ReviewChecklistModuleDto.class); |
|
|
|
vo.setSubTitle(r.getSubTitle()); |
|
|
|
if(groupSubTitleMap.containsKey(r.getSubTitle())){ |
|
|
|
List<ReviewChecklistApprove> approves = groupSubTitleMap.get(r.getSubTitle()); |
|
|
|
StringBuffer reviewCommentsSb = new StringBuffer(); |
|
|
|
|
|
|
|
for(ReviewChecklistApprove approve : reviewChecklistApproves){ |
|
|
|
reviewCommentsSb.append(approve.getCreateBy() + StrPool.COLON + approve.getReviewComments() + "\n"); |
|
|
|
} |
|
|
|
vo.setReviewComments(reviewCommentsSb.toString()); |
|
|
|
} |
|
|
|
return vo; |
|
|
|
}) |
|
|
|
.collect(Collectors.toList()); |
|
|
|
} |
|
|
|
|
|
|
|
return Collections.emptyList(); |
|
|
|
private List<ReviewChecklistModuleDto> convertModulesFinal(List<ReviewChecklistApprove> reviewChecklistApproves) { |
|
|
|
//做成map |
|
|
|
Map<String, List<ReviewChecklistApprove>> groupSubTitleMap = reviewChecklistApproves.stream() |
|
|
|
.collect(Collectors.groupingBy(ReviewChecklistApprove::getSubTitle)); |
|
|
|
//去重子标题 |
|
|
|
Set<String> subSubTitleSet = Sets.newHashSet(); |
|
|
|
List<ReviewChecklistApprove> dupSubTitle = reviewChecklistApproves.stream().filter(r -> subSubTitleSet.add(r.getSubTitle())) |
|
|
|
.collect(Collectors.toList()); |
|
|
|
return dupSubTitle.stream() |
|
|
|
.map(r -> { |
|
|
|
ReviewChecklistModuleDto vo = BeanUtil.copyProperties(r,ReviewChecklistModuleDto.class); |
|
|
|
vo.setSubTitle(r.getSubTitle()); |
|
|
|
if(groupSubTitleMap.containsKey(r.getSubTitle())){ |
|
|
|
List<ReviewChecklistApprove> approves = groupSubTitleMap.get(r.getSubTitle()); |
|
|
|
StringBuffer reviewCommentsSb = new StringBuffer(); |
|
|
|
if(CollUtil.isEmpty(approves)){ |
|
|
|
vo.setReviewComments("通过"); |
|
|
|
}else{ |
|
|
|
for(ReviewChecklistApprove approve : reviewChecklistApproves){ |
|
|
|
reviewCommentsSb.append(approve.getCreateBy() + StrPool.COLON + approve.getReviewComments() + "\n"); |
|
|
|
} |
|
|
|
vo.setReviewComments(reviewCommentsSb.toString()); |
|
|
|
} |
|
|
|
} |
|
|
|
return vo; |
|
|
|
}) |
|
|
|
.collect(Collectors.toList()); |
|
|
|
} |
|
|
|
} |