@@ -1,5 +1,6 @@ | |||
package com.ningdatech.pmapi.expert.manage; | |||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||
import com.ningdatech.basic.exception.BizException; | |||
import com.ningdatech.file.entity.vo.result.AttachFileVo; | |||
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.meta.constant.DictExpertInfoTypeEnum; | |||
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.entity.UserInfo; | |||
import com.ningdatech.pmapi.user.entity.enumeration.RoleEnum; | |||
import com.ningdatech.pmapi.user.service.IUserInfoService; | |||
import com.ningdatech.pmapi.user.util.LoginUserUtil; | |||
import lombok.RequiredArgsConstructor; | |||
@@ -55,6 +61,8 @@ public class ExpertManage { | |||
private final ExpertUserInfoAssembler expertUserInfoAssembler; | |||
private final IUserInfoService iUserInfoService; | |||
private final ExpertMetaApplyManage expertMetaApplyManage; | |||
private final IUserRoleService iUserRoleService; | |||
private final IRoleService iRoleService; | |||
/** | |||
@@ -108,6 +116,18 @@ public class ExpertManage { | |||
applyResult.setAuditOpinion("同意"); | |||
applyResult.setApplyResult(true); | |||
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); | |||
} | |||
} | |||
@@ -6,18 +6,22 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||
import com.ningdatech.basic.exception.BizException; | |||
import com.ningdatech.basic.util.CollUtils; | |||
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.entity.ExpertReview; | |||
import com.ningdatech.pmapi.expert.model.req.ExpertReviewDetailReq; | |||
import com.ningdatech.pmapi.expert.model.vo.ExpertReviewDetailVO; | |||
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.user.util.LoginUserUtil; | |||
import lombok.RequiredArgsConstructor; | |||
import org.springframework.stereotype.Component; | |||
import java.util.Collections; | |||
import java.util.HashMap; | |||
import java.util.List; | |||
import java.util.Map; | |||
import static com.ningdatech.pmapi.meeting.entity.enumeration.ExpertAttendStatusEnum.AGREED; | |||
@@ -36,6 +40,7 @@ public class ExpertReviewManage { | |||
private final IExpertReviewService expertReviewService; | |||
private final DistributedLock distributedLock; | |||
private final IMeetingExpertService meetingExpertService; | |||
private final FileService fileService; | |||
private static final String EXPERT_REVIEW_KEY = "expert_review:"; | |||
@@ -120,7 +125,20 @@ public class ExpertReviewManage { | |||
query.eq(ExpertReview::getIsFinal, Boolean.FALSE); | |||
query.orderByDesc(ExpertReview::getCreateOn); | |||
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; | |||
}); | |||
} | |||
} |
@@ -1,5 +1,6 @@ | |||
package com.ningdatech.pmapi.expert.model.vo; | |||
import com.ningdatech.file.entity.vo.result.AttachFileVo; | |||
import com.ningdatech.pmapi.expert.model.dto.ReviewTemplateOptionDTO; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Builder; | |||
@@ -40,6 +41,9 @@ public class ExpertReviewDetailVO { | |||
@ApiModelProperty("附件ID") | |||
private Long attachFileId; | |||
@ApiModelProperty("附件详情") | |||
private AttachFileVo attachFile; | |||
@ApiModelProperty("评审结果:1 通过、2 需复核、3 不通过") | |||
private Integer reviewResult; | |||
@@ -31,4 +31,7 @@ public class MeetingReviewProjectDTO { | |||
@ApiModelProperty("申报单位") | |||
private String buildOrg; | |||
@ApiModelProperty("评审结果") | |||
private String reviewResult; | |||
} |
@@ -415,6 +415,7 @@ public class MeetingManage { | |||
if (meeting.getIsInnerProject()) { | |||
List<MeetingInnerProject> innerProjects = meetingInnerProjectService.listByMeetingId(meetingId); | |||
List<Project> projects = projectService.listByIds(CollUtils.fieldList(innerProjects, MeetingInnerProject::getProjectId)); | |||
Map<Long, ExpertReview> reviewMap = expertReviewService.listFinalReviewMap(meetingId); | |||
List<MeetingReviewProjectDTO> convert = CollUtils.convert(projects, w -> { | |||
MeetingReviewProjectDTO mrp = new MeetingReviewProjectDTO(); | |||
mrp.setBuildOrg(w.getBuildOrgName()); | |||
@@ -422,6 +423,10 @@ public class MeetingManage { | |||
mrp.setProjectType(w.getProjectType().toString()); | |||
mrp.setProjectYear(w.getProjectYear()); | |||
mrp.setDeclareAmount(w.getDeclareAmount()); | |||
ExpertReview review = reviewMap.get(w.getId()); | |||
if (review != null) { | |||
mrp.setReviewResult(ReviewResultEnum.getByCode(review.getReviewResult()).getValue()); | |||
} | |||
return mrp; | |||
}); | |||
detail.setProjects(convert); | |||
@@ -441,8 +441,9 @@ public class TodoCenterManage { | |||
ProcessProgressVo progressInstanceDetail = processInstanceService.getProgressInstanceDetail(nodeId, instanceId); | |||
List<ProgressNode> progressInfo = progressInstanceDetail.getProgressInfo(); | |||
buildUserUtils.buildUserByProcessInfo(progressInfo); | |||
if (CollUtil.isNotEmpty(progressInfo)){ | |||
buildUserUtils.buildUserByProcessInfo(progressInfo); | |||
} | |||
ProcessProgressDetailVo res = new ProcessProgressDetailVo(); | |||
res.setProcessProgressVo(progressInstanceDetail); | |||
res.setStatus(progressInstanceDetail.getStatus()); | |||