diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/service/IExpertReviewService.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/service/IExpertReviewService.java index 05bbbc0..3a77c52 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/expert/service/IExpertReviewService.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/service/IExpertReviewService.java @@ -55,4 +55,10 @@ public interface IExpertReviewService extends IService { **/ List listFinalReview(Long meetingId); + /** + * 查某个项目 某一个 阶段的 最终会议 + * @param meetingType + * @return + */ + ExpertReview getFinalReview(String projectCode,Integer meetingType); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/service/impl/ExpertReviewServiceImpl.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/service/impl/ExpertReviewServiceImpl.java index 7b4810a..ea6e9ec 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/expert/service/impl/ExpertReviewServiceImpl.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/service/impl/ExpertReviewServiceImpl.java @@ -1,5 +1,6 @@ package com.ningdatech.pmapi.expert.service.impl; +import cn.hutool.core.collection.CollUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; @@ -7,11 +8,16 @@ import com.ningdatech.basic.util.CollUtils; import com.ningdatech.pmapi.common.constant.BizConst; import com.ningdatech.pmapi.expert.mapper.ExpertReviewMapper; import com.ningdatech.pmapi.expert.model.entity.ExpertReview; +import com.ningdatech.pmapi.expert.model.enumeration.ReviewTemplateTypeEnum; import com.ningdatech.pmapi.expert.service.IExpertReviewService; +import com.ningdatech.pmapi.meeting.entity.domain.Meeting; +import com.ningdatech.pmapi.meeting.mapper.MeetingMapper; +import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; /** *

@@ -22,8 +28,11 @@ import java.util.Map; * @since 2023-02-15 */ @Service +@RequiredArgsConstructor public class ExpertReviewServiceImpl extends ServiceImpl implements IExpertReviewService { + private final MeetingMapper meetingMapper; + @Override public List listByProjectIdAndExpertId(Long projectId, Long expertId, Long meetingId) { LambdaQueryWrapper query = Wrappers.lambdaQuery(ExpertReview.class); @@ -57,4 +66,22 @@ public class ExpertReviewServiceImpl extends ServiceImpl constructMeetings = meetingMapper.selectList(Wrappers.lambdaQuery(Meeting.class) + .select(Meeting::getId) + .eq(Meeting::getType, meetingType)); + List meetingIds = constructMeetings.stream() + .map(Meeting::getId).collect(Collectors.toList()); + ExpertReview expertReview = null; + if(CollUtil.isNotEmpty(meetingIds)){ + expertReview = this.getOne(Wrappers.lambdaQuery(ExpertReview.class) + .eq(ExpertReview::getProjectCode, projectCode) + .eq(ExpertReview::getIsFinal, Boolean.TRUE) + .in(ExpertReview::getMeetingId,meetingIds) + .last(BizConst.LIMIT_1)); + } + return expertReview; + } + } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/gov/utils/ProjectConvertUtil.java b/pmapi/src/main/java/com/ningdatech/pmapi/gov/utils/ProjectConvertUtil.java index 954e9c2..2447b3a 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/gov/utils/ProjectConvertUtil.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/gov/utils/ProjectConvertUtil.java @@ -4,25 +4,19 @@ import cn.hutool.core.collection.CollUtil; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; -import com.github.xiaoymin.knife4j.core.util.CommonUtils; import com.google.common.collect.Lists; import com.ningdatech.basic.util.StrPool; import com.ningdatech.pmapi.common.constant.RegionConst; import com.ningdatech.pmapi.common.util.BizUtils; import com.ningdatech.pmapi.gov.enumeration.GovProjectClassifiedEnum; -import com.ningdatech.pmapi.gov.manage.GovProjectCollectionManage; import com.ningdatech.pmapi.gov.model.vo.*; import com.ningdatech.pmapi.projectdeclared.model.vo.PurchaseVO; -import com.ningdatech.pmapi.projectlib.model.entity.Project; +import com.ningdatech.pmapi.projectlib.enumeration.ProjectTypeNewEnum; import com.ningdatech.pmapi.projectlib.model.vo.ProjectApplicationVO; import com.ningdatech.pmapi.projectlib.model.vo.ProjectDetailVO; -import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; -import org.springframework.stereotype.Component; - import java.math.BigDecimal; -import java.time.LocalDateTime; import java.util.List; import java.util.Objects; import java.util.stream.Collectors; @@ -34,18 +28,14 @@ import java.util.stream.Collectors; * @Author PoffyZhang */ @Slf4j -@Component -@RequiredArgsConstructor public class ProjectConvertUtil { - private final GovProjectCollectionManage collectionManage; - /** * 申报项目 转为 项目归集 * @param project * @return */ - public GovBizProjectDetailVO declaredToCollection(ProjectDetailVO project){ + public static GovBizProjectDetailVO declaredToCollection(ProjectDetailVO project){ GovBizProjectDetailVO projectCollection = new GovBizProjectDetailVO(); if(Objects.isNull(project)){ return projectCollection; @@ -57,14 +47,29 @@ public class ProjectConvertUtil { projectCollection.setBaseinfo(buildBaseinfo(project)); projectCollection.setApply(buildApply(project)); projectCollection.setApprove(buildApprove(project)); - projectCollection.setCimplement(buildCim(project)); - projectCollection.setMimplement(buildMim(project)); + String projectType = project.getProjectType(); + ProjectTypeNewEnum match = ProjectTypeNewEnum.match(projectType); + if(Objects.nonNull(match)){ + switch (match){ + case SJ_BUILD: + case FIRST_BUILD: + case SZ_BUILD: + projectCollection.setCimplement(buildCim(project)); + break; + case NEW_OPERA: + case XU_OPERA: + projectCollection.setMimplement(buildMim(project)); + break; + default: + break; + } + } projectCollection.setProcures(buildProcure(project)); return projectCollection; } //转化基本信息 - private GovBizProjectBaseinfoVO buildBaseinfo(ProjectDetailVO project) { + private static GovBizProjectBaseinfoVO buildBaseinfo(ProjectDetailVO project) { GovBizProjectBaseinfoVO baseinfo = new GovBizProjectBaseinfoVO(); baseinfo.setBaseProjId(project.getProjectCode()); baseinfo.setBaseProjName(project.getProjectName()); @@ -94,7 +99,7 @@ public class ProjectConvertUtil { } //转化申报信息 - private GovBizProjectApplyVO buildApply(ProjectDetailVO project) { + private static GovBizProjectApplyVO buildApply(ProjectDetailVO project) { GovBizProjectApplyVO apply = new GovBizProjectApplyVO(); apply.setBaseProjId(project.getProjectCode()); apply.setBaseProjName(project.getProjectName()); @@ -115,7 +120,9 @@ public class ProjectConvertUtil { } return app.getAppCode(); }).collect(Collectors.joining(StrPool.SEMICOLON_CHINA)); - String accountName = projectApplications.stream().map(app -> app.getAccountAppName()) + String accountName = projectApplications.stream() + .map(app -> StringUtils.isNotBlank(app.getAccountAppName()) ? app.getAccountAppName() : null) + .filter(Objects::nonNull) .collect(Collectors.joining(StrPool.SEMICOLON_CHINA)); apply.setBaseAccountAppName(accountName); apply.setBaseProjSys(appName); @@ -174,7 +181,7 @@ public class ProjectConvertUtil { } //转化审批信息 - private GovBizProjectApproveVO buildApprove(ProjectDetailVO project) { + private static GovBizProjectApproveVO buildApprove(ProjectDetailVO project) { GovBizProjectApproveVO approve = new GovBizProjectApproveVO(); approve.setBaseProjId(project.getProjectCode()); approve.setBaseProjName(project.getProjectName()); @@ -212,28 +219,28 @@ public class ProjectConvertUtil { .ifPresent(j -> approve.setReleaseYearMoney(j)); } - return approve; } //转化建设 实施 - private GovBizProjectCimplementVO buildCim(ProjectDetailVO project) { + private static GovBizProjectCimplementVO buildCim(ProjectDetailVO project) { + GovBizProjectCimplementVO cim = new GovBizProjectCimplementVO(); return cim; } //转化运维实施 - private GovBizProjectMimplementVO buildMim(ProjectDetailVO project) { + private static GovBizProjectMimplementVO buildMim(ProjectDetailVO project) { GovBizProjectMimplementVO mim = new GovBizProjectMimplementVO(); return mim; } //转化采购信息 - private List buildProcure(ProjectDetailVO project) { + private static List buildProcure(ProjectDetailVO project) { List procures = Lists.newArrayList(); - + return procures; } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/ProjectLibController.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/ProjectLibController.java index 72ea43c..5132402 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/ProjectLibController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/ProjectLibController.java @@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject; import com.ningdatech.basic.model.PageVo; import com.ningdatech.log.annotation.WebLog; import com.ningdatech.pmapi.common.helper.UserInfoHelper; +import com.ningdatech.pmapi.gov.model.vo.GovBizProjectDetailVO; import com.ningdatech.pmapi.projectlib.manage.ProjectLibManage; import com.ningdatech.pmapi.projectlib.model.req.ProjectApplicationListReq; import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq; @@ -91,6 +92,12 @@ public class ProjectLibController { return projectLibManage.getProjectDetail(id); } + @GetMapping("/convert-to-collection/{projectCode}") + @ApiOperation("申报项目转化为项目归集") + public GovBizProjectDetailVO convertToCollection(@PathVariable String projectCode){ + return projectLibManage.convertToCollection(projectCode); + } + @GetMapping("/detail/{projectCode}") @ApiOperation("获取项目详情(编号)") public ProjectDetailVO detailProjectCode (@PathVariable String projectCode){ diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/enumeration/ProjectTypeNewEnum.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/enumeration/ProjectTypeNewEnum.java index 6da6349..57f653b 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/enumeration/ProjectTypeNewEnum.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/enumeration/ProjectTypeNewEnum.java @@ -42,4 +42,16 @@ public enum ProjectTypeNewEnum { } return StringUtils.EMPTY; } + + public static ProjectTypeNewEnum match(String code) { + if (StringUtils.isBlank(code)) { + return null; + } + for (ProjectTypeNewEnum t : ProjectTypeNewEnum.values()) { + if (code.equals(t.getCode())) { + return t; + } + } + return null; + } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java index 4153453..1355f64 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java @@ -33,9 +33,14 @@ import com.ningdatech.pmapi.dashboard.handle.ProjectStatusHandler; import com.ningdatech.pmapi.datascope.model.DataScopeDTO; import com.ningdatech.pmapi.datascope.utils.DataScopeUtil; import com.ningdatech.pmapi.expert.model.entity.ExpertReview; +import com.ningdatech.pmapi.expert.model.enumeration.ReviewTemplateTypeEnum; import com.ningdatech.pmapi.expert.service.IExpertReviewService; import com.ningdatech.pmapi.filemanage.model.entity.ProjectApplyBorrow; import com.ningdatech.pmapi.filemanage.service.INdProjectApplyBorrowService; +import com.ningdatech.pmapi.gov.model.vo.GovBizProjectDetailVO; +import com.ningdatech.pmapi.gov.utils.ProjectConvertUtil; +import com.ningdatech.pmapi.meeting.entity.domain.Meeting; +import com.ningdatech.pmapi.meeting.service.IMeetingService; import com.ningdatech.pmapi.organization.model.entity.DingOrganization; import com.ningdatech.pmapi.organization.service.IDingOrganizationService; import com.ningdatech.pmapi.performance.model.dto.ProjectCoreBusinessDTO; @@ -146,6 +151,8 @@ public class ProjectLibManage { private final IExpertReviewService expertReviewService; + private final IMeetingService meetingService; + public PageVo projectLibList(ProjectListReq req) { LambdaQueryWrapper query = ProjectHelper.projectQuery(req); query.eq(Project::getNewest, Boolean.TRUE); @@ -826,14 +833,13 @@ public class ProjectLibManage { vo.setApprovedFileName(fileMap.get(vo.getApprovedFile())); vo.setApprovedConstructionPlanFileName(fileMap.get(vo.getApprovedConstructionPlanFile())); } - //专家评审 其它建议 - ExpertReview expertReview = expertReviewService.getOne(Wrappers.lambdaQuery(ExpertReview.class) - .eq(ExpertReview::getProjectCode, projectInfo.getProjectCode()) - .eq(ExpertReview::getIsFinal, Boolean.TRUE) - .last(BizConst.LIMIT_1)); - if(Objects.nonNull(expertReview)){ - vo.setProposeAttach(expertReview.getOtherAdvice()); - vo.setBaseReviewResults(expertReview.getReviewResult()); + //专家评审 其它建议 -> 建设方案的会议 + ExpertReview finalReview = expertReviewService.getFinalReview(projectInfo.getProjectCode(), + ReviewTemplateTypeEnum.CONSTRUCTION_SCHEME_REVIEW.getCode()); + + if(Objects.nonNull(finalReview)){ + vo.setProposeAttach(finalReview.getOtherAdvice()); + vo.setBaseReviewResults(finalReview.getReviewResult()); } return vo; } @@ -1695,5 +1701,13 @@ public class ProjectLibManage { } } - + /** + * 申报项目转化为 项目归集 + * @param projectCode + * @return + */ + public GovBizProjectDetailVO convertToCollection(String projectCode) { + ProjectDetailVO projectDetailVO = this.detailProjectCode(projectCode); + return ProjectConvertUtil.declaredToCollection(projectDetailVO); + } }