Browse Source

Merge remote-tracking branch 'origin/master'

tags/24080901
PoffyZhang 1 year ago
parent
commit
7d7c8bf48c
6 changed files with 55 additions and 4 deletions
  1. +20
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertManage.java
  2. +20
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertReviewManage.java
  3. +4
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/expert/model/vo/ExpertReviewDetailVO.java
  4. +3
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/dto/MeetingReviewProjectDTO.java
  5. +5
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/MeetingManage.java
  6. +3
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java

+ 20
- 0
pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertManage.java View File

@@ -1,5 +1,6 @@
package com.ningdatech.pmapi.expert.manage; package com.ningdatech.pmapi.expert.manage;


import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ningdatech.basic.exception.BizException; import com.ningdatech.basic.exception.BizException;
import com.ningdatech.file.entity.vo.result.AttachFileVo; import com.ningdatech.file.entity.vo.result.AttachFileVo;
import com.ningdatech.file.service.FileService; import com.ningdatech.file.service.FileService;
@@ -23,8 +24,13 @@ import com.ningdatech.pmapi.expert.service.ExpertInfoService;
import com.ningdatech.pmapi.expert.service.IExpertUserFullInfoService; import com.ningdatech.pmapi.expert.service.IExpertUserFullInfoService;
import com.ningdatech.pmapi.meta.constant.DictExpertInfoTypeEnum; import com.ningdatech.pmapi.meta.constant.DictExpertInfoTypeEnum;
import com.ningdatech.pmapi.meta.model.ExpertRegionInfo; import com.ningdatech.pmapi.meta.model.ExpertRegionInfo;
import com.ningdatech.pmapi.sys.model.entity.Role;
import com.ningdatech.pmapi.sys.model.entity.UserRole;
import com.ningdatech.pmapi.sys.service.IRoleService;
import com.ningdatech.pmapi.sys.service.IUserRoleService;
import com.ningdatech.pmapi.user.constant.UserAvailableEnum; import com.ningdatech.pmapi.user.constant.UserAvailableEnum;
import com.ningdatech.pmapi.user.entity.UserInfo; import com.ningdatech.pmapi.user.entity.UserInfo;
import com.ningdatech.pmapi.user.entity.enumeration.RoleEnum;
import com.ningdatech.pmapi.user.service.IUserInfoService; import com.ningdatech.pmapi.user.service.IUserInfoService;
import com.ningdatech.pmapi.user.util.LoginUserUtil; import com.ningdatech.pmapi.user.util.LoginUserUtil;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
@@ -55,6 +61,8 @@ public class ExpertManage {
private final ExpertUserInfoAssembler expertUserInfoAssembler; private final ExpertUserInfoAssembler expertUserInfoAssembler;
private final IUserInfoService iUserInfoService; private final IUserInfoService iUserInfoService;
private final ExpertMetaApplyManage expertMetaApplyManage; private final ExpertMetaApplyManage expertMetaApplyManage;
private final IUserRoleService iUserRoleService;
private final IRoleService iRoleService;




/** /**
@@ -108,6 +116,18 @@ public class ExpertManage {
applyResult.setAuditOpinion("同意"); applyResult.setAuditOpinion("同意");
applyResult.setApplyResult(true); applyResult.setApplyResult(true);
expertMetaApplyManage.metaApplyResult(applyResult); expertMetaApplyManage.metaApplyResult(applyResult);

// 增加用户专家角色
Role expertRole = iRoleService.getOne(Wrappers.lambdaQuery(Role.class).eq(Role::getCode, RoleEnum.EXPERT.name()));
UserRole expertUserRole = iUserRoleService.getOne(Wrappers.lambdaQuery(UserRole.class).eq(UserRole::getRoleId, expertRole.getId()));
if (Objects.isNull(expertUserRole)) {
expertUserRole = new UserRole();
expertUserRole.setUserId(userId);
expertUserRole.setRoleId(expertRole.getId());
expertUserRole.setCreateBy(-1L);
expertUserRole.setCreateOn(LocalDateTime.now());
iUserRoleService.save(expertUserRole);
}
} }






+ 20
- 2
pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertReviewManage.java View File

@@ -6,18 +6,22 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ningdatech.basic.exception.BizException; import com.ningdatech.basic.exception.BizException;
import com.ningdatech.basic.util.CollUtils; import com.ningdatech.basic.util.CollUtils;
import com.ningdatech.cache.lock.DistributedLock; import com.ningdatech.cache.lock.DistributedLock;
import com.ningdatech.file.entity.vo.result.AttachFileVo;
import com.ningdatech.file.service.FileService;
import com.ningdatech.pmapi.expert.model.dto.ReviewTemplateOptionDTO; import com.ningdatech.pmapi.expert.model.dto.ReviewTemplateOptionDTO;
import com.ningdatech.pmapi.expert.model.entity.ExpertReview; import com.ningdatech.pmapi.expert.model.entity.ExpertReview;
import com.ningdatech.pmapi.expert.model.req.ExpertReviewDetailReq; import com.ningdatech.pmapi.expert.model.req.ExpertReviewDetailReq;
import com.ningdatech.pmapi.expert.model.vo.ExpertReviewDetailVO; import com.ningdatech.pmapi.expert.model.vo.ExpertReviewDetailVO;
import com.ningdatech.pmapi.expert.service.IExpertReviewService; import com.ningdatech.pmapi.expert.service.IExpertReviewService;
import com.ningdatech.pmapi.meeting.entity.enumeration.ExpertAttendStatusEnum;
import com.ningdatech.pmapi.meeting.service.IMeetingExpertService; import com.ningdatech.pmapi.meeting.service.IMeetingExpertService;
import com.ningdatech.pmapi.user.util.LoginUserUtil; import com.ningdatech.pmapi.user.util.LoginUserUtil;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;


import java.util.Collections;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;


import static com.ningdatech.pmapi.meeting.entity.enumeration.ExpertAttendStatusEnum.AGREED; import static com.ningdatech.pmapi.meeting.entity.enumeration.ExpertAttendStatusEnum.AGREED;


@@ -36,6 +40,7 @@ public class ExpertReviewManage {
private final IExpertReviewService expertReviewService; private final IExpertReviewService expertReviewService;
private final DistributedLock distributedLock; private final DistributedLock distributedLock;
private final IMeetingExpertService meetingExpertService; private final IMeetingExpertService meetingExpertService;
private final FileService fileService;


private static final String EXPERT_REVIEW_KEY = "expert_review:"; private static final String EXPERT_REVIEW_KEY = "expert_review:";


@@ -120,7 +125,20 @@ public class ExpertReviewManage {
query.eq(ExpertReview::getIsFinal, Boolean.FALSE); query.eq(ExpertReview::getIsFinal, Boolean.FALSE);
query.orderByDesc(ExpertReview::getCreateOn); query.orderByDesc(ExpertReview::getCreateOn);
List<ExpertReview> reviews = expertReviewService.list(query); List<ExpertReview> reviews = expertReviewService.list(query);
return CollUtils.convert(reviews, this::buildExpertReviewDetail);
if (reviews.isEmpty()) {
return Collections.emptyList();
}
List<Long> attachFileIds = CollUtils.fieldList(reviews, ExpertReview::getAttachFileId);
Map<Long, AttachFileVo> fileMap = new HashMap<>(attachFileIds.size());
if (attachFileIds.size() > 0) {
List<AttachFileVo> files = fileService.getByIds(attachFileIds);
files.forEach(w -> fileMap.put(w.getFileId(), w));
}
return CollUtils.convert(reviews, w -> {
ExpertReviewDetailVO reviewDetail = buildExpertReviewDetail(w);
reviewDetail.setAttachFile(fileMap.get(w.getAttachFileId()));
return reviewDetail;
});
} }


} }

+ 4
- 0
pmapi/src/main/java/com/ningdatech/pmapi/expert/model/vo/ExpertReviewDetailVO.java View File

@@ -1,5 +1,6 @@
package com.ningdatech.pmapi.expert.model.vo; package com.ningdatech.pmapi.expert.model.vo;


import com.ningdatech.file.entity.vo.result.AttachFileVo;
import com.ningdatech.pmapi.expert.model.dto.ReviewTemplateOptionDTO; import com.ningdatech.pmapi.expert.model.dto.ReviewTemplateOptionDTO;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Builder; import lombok.Builder;
@@ -40,6 +41,9 @@ public class ExpertReviewDetailVO {
@ApiModelProperty("附件ID") @ApiModelProperty("附件ID")
private Long attachFileId; private Long attachFileId;


@ApiModelProperty("附件详情")
private AttachFileVo attachFile;

@ApiModelProperty("评审结果:1 通过、2 需复核、3 不通过") @ApiModelProperty("评审结果:1 通过、2 需复核、3 不通过")
private Integer reviewResult; private Integer reviewResult;




+ 3
- 0
pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/dto/MeetingReviewProjectDTO.java View File

@@ -31,4 +31,7 @@ public class MeetingReviewProjectDTO {
@ApiModelProperty("申报单位") @ApiModelProperty("申报单位")
private String buildOrg; private String buildOrg;


@ApiModelProperty("评审结果")
private String reviewResult;

} }

+ 5
- 0
pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/MeetingManage.java View File

@@ -415,6 +415,7 @@ public class MeetingManage {
if (meeting.getIsInnerProject()) { if (meeting.getIsInnerProject()) {
List<MeetingInnerProject> innerProjects = meetingInnerProjectService.listByMeetingId(meetingId); List<MeetingInnerProject> innerProjects = meetingInnerProjectService.listByMeetingId(meetingId);
List<Project> projects = projectService.listByIds(CollUtils.fieldList(innerProjects, MeetingInnerProject::getProjectId)); List<Project> projects = projectService.listByIds(CollUtils.fieldList(innerProjects, MeetingInnerProject::getProjectId));
Map<Long, ExpertReview> reviewMap = expertReviewService.listFinalReviewMap(meetingId);
List<MeetingReviewProjectDTO> convert = CollUtils.convert(projects, w -> { List<MeetingReviewProjectDTO> convert = CollUtils.convert(projects, w -> {
MeetingReviewProjectDTO mrp = new MeetingReviewProjectDTO(); MeetingReviewProjectDTO mrp = new MeetingReviewProjectDTO();
mrp.setBuildOrg(w.getBuildOrgName()); mrp.setBuildOrg(w.getBuildOrgName());
@@ -422,6 +423,10 @@ public class MeetingManage {
mrp.setProjectType(w.getProjectType().toString()); mrp.setProjectType(w.getProjectType().toString());
mrp.setProjectYear(w.getProjectYear()); mrp.setProjectYear(w.getProjectYear());
mrp.setDeclareAmount(w.getDeclareAmount()); mrp.setDeclareAmount(w.getDeclareAmount());
ExpertReview review = reviewMap.get(w.getId());
if (review != null) {
mrp.setReviewResult(ReviewResultEnum.getByCode(review.getReviewResult()).getValue());
}
return mrp; return mrp;
}); });
detail.setProjects(convert); detail.setProjects(convert);


+ 3
- 2
pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java View File

@@ -441,8 +441,9 @@ public class TodoCenterManage {
ProcessProgressVo progressInstanceDetail = processInstanceService.getProgressInstanceDetail(nodeId, instanceId); ProcessProgressVo progressInstanceDetail = processInstanceService.getProgressInstanceDetail(nodeId, instanceId);


List<ProgressNode> progressInfo = progressInstanceDetail.getProgressInfo(); List<ProgressNode> progressInfo = progressInstanceDetail.getProgressInfo();
buildUserUtils.buildUserByProcessInfo(progressInfo);

if (CollUtil.isNotEmpty(progressInfo)){
buildUserUtils.buildUserByProcessInfo(progressInfo);
}
ProcessProgressDetailVo res = new ProcessProgressDetailVo(); ProcessProgressDetailVo res = new ProcessProgressDetailVo();
res.setProcessProgressVo(progressInstanceDetail); res.setProcessProgressVo(progressInstanceDetail);
res.setStatus(progressInstanceDetail.getStatus()); res.setStatus(progressInstanceDetail.getStatus());


Loading…
Cancel
Save