From 24cb805b068b40049c68e7ca5945a1dcb8fe12a0 Mon Sep 17 00:00:00 2001 From: WendyYang Date: Thu, 21 Dec 2023 19:48:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BC=9A=E8=AE=AE=E7=BB=93?= =?UTF-8?q?=E6=9E=9C=E4=B8=8A=E4=BC=A0=E7=9B=B8=E5=85=B3=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../builder/MeetingReviewProjectBuilder.java | 72 +++++++++++++++++++ .../builder/ProjectReviewResultBuilder.java | 44 ++++++++++++ .../meeting/entity/domain/MeetingInnerProject.java | 24 +++++-- .../meeting/entity/domain/MeetingOuterProject.java | 23 ++++-- .../entity/dto/MeetingReviewProjectDTO.java | 9 ++- .../meeting/entity/dto/ProjectReviewResultDTO.java | 40 +++++++++++ .../meeting/entity/req/MeetingResultUploadReq.java | 22 ++++++ .../meeting/entity/vo/MeetingDetailBasicVO.java | 6 -- .../meeting/entity/vo/MeetingReviewProjectVO.java | 11 +-- .../hz/pm/api/meeting/manage/MeetingManage.java | 83 ++++++++-------------- 10 files changed, 256 insertions(+), 78 deletions(-) create mode 100644 hz-pm-api/src/main/java/com/hz/pm/api/meeting/builder/MeetingReviewProjectBuilder.java create mode 100644 hz-pm-api/src/main/java/com/hz/pm/api/meeting/builder/ProjectReviewResultBuilder.java create mode 100644 hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/dto/ProjectReviewResultDTO.java diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/builder/MeetingReviewProjectBuilder.java b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/builder/MeetingReviewProjectBuilder.java new file mode 100644 index 0000000..eb309a9 --- /dev/null +++ b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/builder/MeetingReviewProjectBuilder.java @@ -0,0 +1,72 @@ +package com.hz.pm.api.meeting.builder; + +import com.hz.pm.api.meeting.entity.domain.MeetingOuterProject; +import com.hz.pm.api.meeting.entity.dto.MeetingReviewProjectDTO; +import com.hz.pm.api.meeting.entity.vo.MeetingReviewProjectVO; +import com.hz.pm.api.projectlib.model.entity.Project; + +/** + *

+ * MeetingReviewResultBuilder + *

+ * + * @author WendyYang + * @since 19:29 2023/12/21 + */ +public class MeetingReviewProjectBuilder { + + private MeetingReviewProjectBuilder() { + } + + public static MeetingReviewProjectDTO convert(Project project){ + MeetingReviewProjectDTO mrp = new MeetingReviewProjectDTO(); + mrp.setProjectId(project.getId()); + mrp.setBuildOrg(project.getBuildOrgName()); + mrp.setProjectName(project.getProjectName()); + mrp.setProjectType(project.getProjectType()); + mrp.setProjectYear(project.getProjectYear()); + mrp.setDeclareAmount(project.getDeclareAmount()); + mrp.setProjectCode(project.getProjectCode()); + return mrp; + } + + public static MeetingReviewProjectDTO convert(MeetingOuterProject mop) { + MeetingReviewProjectDTO mrp = new MeetingReviewProjectDTO(); + mrp.setBuildOrg(mop.getBuildOrg()); + mrp.setProjectName(mop.getProjectName()); + mrp.setProjectType(mop.getProjectType()); + mrp.setProjectYear(mop.getProjectYear()); + mrp.setDeclareAmount(mop.getDeclareAmount()); + mrp.setMeetingProjectId(mop.getId()); + return mrp; + } + + public static MeetingReviewProjectVO to(Project project) { + return MeetingReviewProjectVO + .builder() + .id(project.getId()) + .projectCode(project.getProjectCode()) + .projectName(project.getProjectName()) + .declaredAmount(project.getDeclareAmount()) + .projectType(project.getProjectType()) + .projectYear(project.getProjectYear()) + .buildOrg(project.getBuildOrgName()) + .createOn(project.getCreateOn()) + .build(); + } + + public static MeetingReviewProjectVO to(MeetingOuterProject mop) { + return MeetingReviewProjectVO + .builder() + .meetingProjectId(mop.getId()) + .projectName(mop.getProjectName()) + .declaredAmount(mop.getDeclareAmount()) + .projectType(mop.getProjectType()) + .projectYear(mop.getProjectYear()) + .buildOrg(mop.getBuildOrg()) + .createOn(mop.getCreateOn()) + .build(); + } + + +} diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/builder/ProjectReviewResultBuilder.java b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/builder/ProjectReviewResultBuilder.java new file mode 100644 index 0000000..9a1ec43 --- /dev/null +++ b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/builder/ProjectReviewResultBuilder.java @@ -0,0 +1,44 @@ +package com.hz.pm.api.meeting.builder; + +import com.hz.pm.api.meeting.entity.domain.MeetingInnerProject; +import com.hz.pm.api.meeting.entity.domain.MeetingOuterProject; +import com.hz.pm.api.meeting.entity.dto.ProjectReviewResultDTO; + +/** + *

+ * ProjectReviewResultBuilder + *

+ * + * @author WendyYang + * @since 19:21 2023/12/21 + */ +public class ProjectReviewResultBuilder { + + private ProjectReviewResultBuilder() { + } + + public static ProjectReviewResultDTO convert(MeetingInnerProject mip) { + ProjectReviewResultDTO prr = new ProjectReviewResultDTO(); + prr.setReviewResult(mip.getReviewResult()); + prr.setBuildNecessity(mip.getBuildNecessity()); + prr.setInvestRationality(mip.getInvestRationality()); + prr.setSuggestedFunding(mip.getSuggestedFunding()); + prr.setOtherAdvices(mip.getOtherAdvices()); + prr.setTechFeasibility(mip.getTechFeasibility()); + prr.setNeedRationality(mip.getNeedRationality()); + return prr; + } + + public static ProjectReviewResultDTO convert(MeetingOuterProject mop) { + ProjectReviewResultDTO prr = new ProjectReviewResultDTO(); + prr.setReviewResult(mop.getReviewResult()); + prr.setBuildNecessity(mop.getBuildNecessity()); + prr.setInvestRationality(mop.getInvestRationality()); + prr.setSuggestedFunding(mop.getSuggestedFunding()); + prr.setOtherAdvices(mop.getOtherAdvices()); + prr.setTechFeasibility(mop.getTechFeasibility()); + prr.setNeedRationality(mop.getNeedRationality()); + return prr; + } + +} diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/domain/MeetingInnerProject.java b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/domain/MeetingInnerProject.java index afe2b3c..1c88f29 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/domain/MeetingInnerProject.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/domain/MeetingInnerProject.java @@ -6,6 +6,7 @@ import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.io.Serializable; +import java.math.BigDecimal; import java.time.LocalDateTime; /** @@ -36,11 +37,26 @@ public class MeetingInnerProject implements Serializable { @ApiModelProperty("项目编号") private String projectCode; - @ApiModelProperty("会议结果说明") - private String resultDescription; + @ApiModelProperty("建设必要性") + private String buildNecessity; - @ApiModelProperty("会议结果附件") - private String resultAttachFiles; + @ApiModelProperty("需求合理性") + private String needRationality; + + @ApiModelProperty("技术方案可行性") + private String techFeasibility; + + @ApiModelProperty("审核结果") + private Integer reviewResult; + + @ApiModelProperty("其他意见") + private String otherAdvices; + + @ApiModelProperty("投资测算合理性") + private String investRationality; + + @ApiModelProperty("建议资金(单位:万元)") + private BigDecimal suggestedFunding; @TableField(fill = FieldFill.INSERT_UPDATE) private LocalDateTime updateOn; diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/domain/MeetingOuterProject.java b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/domain/MeetingOuterProject.java index bedb882..b704cad 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/domain/MeetingOuterProject.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/domain/MeetingOuterProject.java @@ -43,11 +43,26 @@ public class MeetingOuterProject implements Serializable { @ApiModelProperty("申报金额") private BigDecimal declareAmount; - @ApiModelProperty("会议结果说明") - private String resultDescription; + @ApiModelProperty("建设必要性") + private String buildNecessity; - @ApiModelProperty("会议结果附件") - private String resultAttachFiles; + @ApiModelProperty("需求合理性") + private String needRationality; + + @ApiModelProperty("技术方案可行性") + private String techFeasibility; + + @ApiModelProperty("审核结果") + private Integer reviewResult; + + @ApiModelProperty("其他意见") + private String otherAdvices; + + @ApiModelProperty("投资测算合理性") + private String investRationality; + + @ApiModelProperty("建议资金(单位:万元)") + private BigDecimal suggestedFunding; @ApiModelProperty("会议ID") private Long meetingId; diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/dto/MeetingReviewProjectDTO.java b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/dto/MeetingReviewProjectDTO.java index cf64e5f..592c051 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/dto/MeetingReviewProjectDTO.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/dto/MeetingReviewProjectDTO.java @@ -16,6 +16,8 @@ import java.math.BigDecimal; @Data public class MeetingReviewProjectDTO { + private Long meetingProjectId; + @ApiModelProperty("项目ID") private Long projectId; @@ -37,10 +39,7 @@ public class MeetingReviewProjectDTO { @ApiModelProperty("申报单位") private String buildOrg; - @ApiModelProperty("会议结果说明") - private String resultDescription; - - @ApiModelProperty("会议结果附件") - private String resultAttachFiles; + @ApiModelProperty("评审结果") + private ProjectReviewResultDTO reviewResultDetail; } diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/dto/ProjectReviewResultDTO.java b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/dto/ProjectReviewResultDTO.java new file mode 100644 index 0000000..3975a6f --- /dev/null +++ b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/dto/ProjectReviewResultDTO.java @@ -0,0 +1,40 @@ +package com.hz.pm.api.meeting.entity.dto; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.math.BigDecimal; + +/** + *

+ * ProjectReviewResultDTO + *

+ * + * @author WendyYang + * @since 17:17 2023/12/21 + */ +@Data +public class ProjectReviewResultDTO { + + @ApiModelProperty("建设必要性") + private String buildNecessity; + + @ApiModelProperty("需求合理性") + private String needRationality; + + @ApiModelProperty("技术方案可行性") + private String techFeasibility; + + @ApiModelProperty("审核结果") + private Integer reviewResult; + + @ApiModelProperty("其他意见") + private String otherAdvices; + + @ApiModelProperty("投资测算合理性") + private String investRationality; + + @ApiModelProperty("建议资金(单位:万元)") + private BigDecimal suggestedFunding; + +} diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/req/MeetingResultUploadReq.java b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/req/MeetingResultUploadReq.java index c286596..8eb2f77 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/req/MeetingResultUploadReq.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/req/MeetingResultUploadReq.java @@ -5,6 +5,7 @@ import lombok.Data; import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotNull; +import java.math.BigDecimal; /** *

@@ -32,4 +33,25 @@ public class MeetingResultUploadReq { @ApiModelProperty("会议结果附件") private String resultAttachFiles; + @ApiModelProperty("建设必要性") + private String buildNecessity; + + @ApiModelProperty("需求合理性") + private String needRationality; + + @ApiModelProperty("技术方案可行性") + private String techFeasibility; + + @ApiModelProperty("审核结果:1 通过、0 不通过") + private Integer reviewResult; + + @ApiModelProperty("其他意见") + private String otherAdvices; + + @ApiModelProperty("投资测算合理性") + private String investRationality; + + @ApiModelProperty("建议资金(单位:万元)") + private BigDecimal suggestedFunding; + } diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/vo/MeetingDetailBasicVO.java b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/vo/MeetingDetailBasicVO.java index a244b7b..caadc87 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/vo/MeetingDetailBasicVO.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/vo/MeetingDetailBasicVO.java @@ -111,10 +111,4 @@ public class MeetingDetailBasicVO { @ApiModelProperty("相关材料") private String attachFiles; - @ApiModelProperty("会议结果说明") - private String resultDescription; - - @ApiModelProperty("会议结果附件") - private String resultAttachFiles; - } diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/vo/MeetingReviewProjectVO.java b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/vo/MeetingReviewProjectVO.java index 59b2ceb..0dee8e6 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/vo/MeetingReviewProjectVO.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/vo/MeetingReviewProjectVO.java @@ -1,6 +1,7 @@ package com.hz.pm.api.meeting.entity.vo; import com.fasterxml.jackson.annotation.JsonFormat; +import com.hz.pm.api.meeting.entity.dto.ProjectReviewResultDTO; import io.swagger.annotations.ApiModelProperty; import lombok.Builder; import lombok.Data; @@ -25,6 +26,9 @@ public class MeetingReviewProjectVO { public MeetingReviewProjectVO() { } + @ApiModelProperty("会议项目关联ID") + private Long meetingProjectId; + @ApiModelProperty("项目ID") private Long id; @@ -46,11 +50,8 @@ public class MeetingReviewProjectVO { @ApiModelProperty("申报单位") private String buildOrg; - @ApiModelProperty("会议结果说明") - private String resultDescription; - - @ApiModelProperty("会议结果附件") - private String resultAttachFiles; + @ApiModelProperty("评审结果") + private ProjectReviewResultDTO reviewResultDetail; @ApiModelProperty("创建时间") @JsonFormat(pattern = "yyyy-MM-dd HH:mm") diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/manage/MeetingManage.java b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/manage/MeetingManage.java index 3a8978f..d4af536 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/manage/MeetingManage.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/manage/MeetingManage.java @@ -13,13 +13,13 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.hz.pm.api.common.helper.RegionCacheHelper; import com.hz.pm.api.common.model.entity.ViewRegionDTO; -import com.hz.pm.api.expert.constant.ReviewResultEnum; import com.hz.pm.api.expert.entity.ExpertUserFullInfo; -import com.hz.pm.api.expert.model.entity.ExpertReview; import com.hz.pm.api.expert.service.IExpertReviewService; import com.hz.pm.api.expert.service.IExpertUserFullInfoService; import com.hz.pm.api.gov.service.IBelongOrgService; import com.hz.pm.api.meeting.builder.ExpertInviteBuilder; +import com.hz.pm.api.meeting.builder.MeetingReviewProjectBuilder; +import com.hz.pm.api.meeting.builder.ProjectReviewResultBuilder; import com.hz.pm.api.meeting.entity.domain.*; import com.hz.pm.api.meeting.entity.dto.*; import com.hz.pm.api.meeting.entity.enumeration.ExpertAttendStatusEnum; @@ -451,6 +451,7 @@ public class MeetingManage { .invitedStopped(meeting.getInviteStatus()) .attachFiles(meeting.getAttachFiles()) .description(meeting.getDescription()) + .smsNotifySign(meeting.getSmsNotifySign()) .remark(meeting.getRemark()) .build(); if (meeting.getIsInnerProject() != null) { @@ -459,25 +460,21 @@ public class MeetingManage { Map innerProjectMap = CollUtils.listToMap(innerProjects, MeetingInnerProject::getProjectId); List projects = projectService.listByIds(innerProjectMap.keySet()); List convert = CollUtils.convert(projects, w -> { - MeetingReviewProjectDTO mrp = new MeetingReviewProjectDTO(); - mrp.setProjectId(w.getId()); - mrp.setBuildOrg(w.getBuildOrgName()); - mrp.setProjectName(w.getProjectName()); - mrp.setProjectType(w.getProjectType()); - mrp.setProjectYear(w.getProjectYear()); - mrp.setDeclareAmount(w.getDeclareAmount()); - mrp.setProjectCode(w.getProjectCode()); - MeetingInnerProject innerProject = innerProjectMap.get(w.getId()); - if (innerProject != null) { - mrp.setResultAttachFiles(innerProject.getResultAttachFiles()); - mrp.setResultDescription(innerProject.getResultDescription()); - } + MeetingReviewProjectDTO mrp = MeetingReviewProjectBuilder.convert(w); + MeetingInnerProject mip = innerProjectMap.get(mrp.getProjectId()); + mrp.setMeetingProjectId(mip.getId()); + mrp.setReviewResultDetail(ProjectReviewResultBuilder.convert(mip)); return mrp; }); detail.setProjects(convert); } else { List outerProjects = meetingOuterProjectService.listByMeetingId(meetingId); - detail.setProjects(BeanUtil.copyToList(outerProjects, MeetingReviewProjectDTO.class)); + detail.setProjects(CollUtils.convert(outerProjects, mop -> { + MeetingReviewProjectDTO mrp = MeetingReviewProjectBuilder.convert(mop); + ProjectReviewResultDTO result = ProjectReviewResultBuilder.convert(mop); + mrp.setReviewResultDetail(result); + return mrp; + })); } } detail.setInviteRule(inviteRuleDetail(meetingId)); @@ -891,7 +888,7 @@ public class MeetingManage { Page page = projectService.page(req.page(), query); PageVo result = PageVo.of(null, page.getTotal()); if (result.getTotal() > 0) { - result.setRecords(CollUtils.convert(page.getRecords(), this::buildProjectList)); + result.setRecords(CollUtils.convert(page.getRecords(), MeetingReviewProjectBuilder::to)); } return result; } @@ -903,34 +900,22 @@ public class MeetingManage { Map projectMap = CollUtils.listToMap(projects, MeetingInnerProject::getProjectId); List projectList = projectService.listByIds(projectMap.keySet()); return CollUtils.convert(projectList, w -> { - MeetingReviewProjectVO vo = buildProjectList(w); - MeetingInnerProject innerProject = projectMap.get(w.getId()); - if (innerProject != null) { - vo.setResultAttachFiles(innerProject.getResultAttachFiles()); - vo.setResultDescription(innerProject.getResultDescription()); - } + MeetingReviewProjectVO vo = MeetingReviewProjectBuilder.to(w); + MeetingInnerProject mip = projectMap.get(w.getId()); + vo.setMeetingProjectId(mip.getId()); + vo.setReviewResultDetail(ProjectReviewResultBuilder.convert(mip)); return vo; }); } else { List projects = meetingOuterProjectService.listByMeetingId(meetingId); - return BeanUtil.copyToList(projects, MeetingReviewProjectVO.class); + return CollUtils.convert(projects, w -> { + MeetingReviewProjectVO mrr = MeetingReviewProjectBuilder.to(w); + mrr.setReviewResultDetail(ProjectReviewResultBuilder.convert(w)); + return mrr; + }); } } - private MeetingReviewProjectVO buildProjectList(Project project) { - return MeetingReviewProjectVO - .builder() - .id(project.getId()) - .projectCode(project.getProjectCode()) - .projectName(project.getProjectName()) - .declaredAmount(project.getDeclareAmount()) - .projectType(project.getProjectType()) - .projectYear(project.getProjectYear()) - .buildOrg(project.getBuildOrgName()) - .createOn(project.getCreateOn()) - .build(); - } - private void buildOptionProjectQuery(LambdaQueryWrapper query, String meetingType, ProjectStatusEnum status) { query.eq(Project::getStatus, status.getCode()); String sql = String.format("select 1 from meeting m inner join meeting_inner_project mip on" + @@ -962,23 +947,13 @@ public class MeetingManage { throw BizException.wrap("此会议未关联项目"); } if (Boolean.TRUE.equals(meeting.getIsInnerProject())) { - LambdaUpdateWrapper mUpdate = Wrappers - .lambdaUpdate(MeetingInnerProject.class) - .set(MeetingInnerProject::getUpdateOn, now) - .set(MeetingInnerProject::getResultDescription, req.getResultDescription()) - .set(MeetingInnerProject::getResultAttachFiles, req.getResultAttachFiles()) - .set(MeetingInnerProject::getUpdateBy, LoginUserUtil.getUserId()) - .eq(MeetingInnerProject::getId, req.getMeetingProjectId()); - meetingInnerProjectService.update(mUpdate); + MeetingInnerProject mip = BeanUtil.copyProperties(req, MeetingInnerProject.class); + mip.setId(req.getMeetingProjectId()); + meetingInnerProjectService.updateById(mip); } else { - LambdaUpdateWrapper mUpdate = Wrappers - .lambdaUpdate(MeetingOuterProject.class) - .set(MeetingOuterProject::getUpdateOn, now) - .set(MeetingOuterProject::getResultDescription, req.getResultDescription()) - .set(MeetingOuterProject::getResultAttachFiles, req.getResultAttachFiles()) - .set(MeetingOuterProject::getUpdateBy, LoginUserUtil.getUserId()) - .eq(MeetingOuterProject::getId, req.getMeetingProjectId()); - meetingOuterProjectService.update(mUpdate); + MeetingOuterProject mop = BeanUtil.copyProperties(req, MeetingOuterProject.class); + mop.setId(req.getMeetingProjectId()); + meetingOuterProjectService.updateById(mop); } } finally { distributedLock.releaseLock(key);