From 2a79eb27326c6d3d3151bf4c826ac6c249402f2e Mon Sep 17 00:00:00 2001 From: WendyYang Date: Thu, 26 Sep 2024 14:18:39 +0800 Subject: [PATCH] =?UTF-8?q?modify:=201.=20=E4=BC=9A=E8=AE=AE=E5=85=B3?= =?UTF-8?q?=E8=81=94=E9=A1=B9=E7=9B=AE=E8=AF=84=E5=AE=A1=E7=BB=93=E6=9E=9C?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hz/pm/api/meeting/entity/req/ProjectReviewInfoReq.java | 5 +++++ .../java/com/hz/pm/api/meeting/manage/MeetingManage.java | 14 +++++++++----- .../pm/api/projectdeclared/manage/ProjectReviewManage.java | 6 ++++++ 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/req/ProjectReviewInfoReq.java b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/req/ProjectReviewInfoReq.java index 541dd49..7a9b9ba 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/req/ProjectReviewInfoReq.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/req/ProjectReviewInfoReq.java @@ -2,7 +2,9 @@ package com.hz.pm.api.meeting.entity.req; import io.swagger.annotations.ApiModelProperty; import lombok.Data; +import org.hibernate.validator.constraints.Length; +import javax.validation.constraints.NotNull; import java.math.BigDecimal; /** @@ -26,15 +28,18 @@ public class ProjectReviewInfoReq { private String techFeasibility; @ApiModelProperty("审核结果:1 通过、0 不通过") + @NotNull(message = "评审结果不能为空") private Integer reviewResult; @ApiModelProperty("其他意见") + @Length(max = 2000, message = "专家意见长度不能超过2000") private String otherAdvices; @ApiModelProperty("投资测算合理性") private String investRationality; @ApiModelProperty("建议资金(单位:万元)") + @NotNull(message = "评审项目总投资不能为空") private BigDecimal suggestedFunding; @ApiModelProperty("相关材料") 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 693eff8..ec6c2d7 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 @@ -44,6 +44,7 @@ import com.hz.pm.api.meta.helper.TagCache; import com.hz.pm.api.open.model.vo.ExpertInfoVO; import com.hz.pm.api.open.model.vo.MeetingExpertToMhDTO; import com.hz.pm.api.organization.service.IDingOrganizationService; +import com.hz.pm.api.projectlib.helper.ProjectManageUtil; import com.hz.pm.api.projectlib.model.entity.Project; import com.hz.pm.api.projectlib.model.enumeration.status.ProjectStatus; import com.hz.pm.api.projectlib.service.IProjectService; @@ -1004,11 +1005,12 @@ public class MeetingManage { case PROJECT_REVIEW: case EXPERT_REVIEW: query.isNotNull(Project::getConstructionPlanSealFile); - buildOptionProjectQuery(query, meetingType, ProjectStatus.WITHOUT_PROJECT_REVIEW); + buildOptionProjectQuery(query, meetingType, ProjectStatus.WITHOUT_EXPERT_REVIEW, ProjectStatus.EXPERT_REVIEW_FAILED); break; default: return PageVo.empty(); } + ProjectManageUtil.projectBaseQuery(query); Page page = projectService.page(req.page(), query); PageVo result = PageVo.of(null, page.getTotal()); if (result.getTotal() > 0) { @@ -1047,14 +1049,15 @@ public class MeetingManage { return ProjectReviewResultBuilder.convert(projectReview); } - private void buildOptionProjectQuery(LambdaQueryWrapper query, String meetingType, ProjectStatus status) { - if (status != null) { - query.eq(Project::getStatus, status.getCode()); + private void buildOptionProjectQuery(LambdaQueryWrapper query, String meetingType, ProjectStatus... statusList) { + if (statusList != null && statusList.length > 0) { + List statusCodeList = CollUtils.fieldList(Arrays.asList(statusList), ProjectStatus::getCode); + query.in(Project::getStatus, statusCodeList); } String sql = String.format("select 1 from meeting m inner join meeting_inner_project mip on" + " m.is_inner_project = 1 and m.id = mip.meeting_id and nd_project.id = mip.project_id" + " and m.type = %s and m.status != 3", meetingType); - String sql2 = String.format("1 = (select case when review_result in (2,3) then 1 else 0 end from " + + String sql2 = String.format("1 = (select case when review_result in (0) then 1 else 0 end from " + " (select ner.review_result from meeting m inner join meeting_inner_project mip on" + " m.is_inner_project = 1 and m.id = mip.meeting_id and nd_project.id = mip.project_id" + " and m.type = %s and m.status != 3 left join nd_expert_review ner on ner.meeting_id = m.id " + @@ -1099,6 +1102,7 @@ public class MeetingManage { return result; } + @Transactional(rollbackFor = Exception.class) public void uploadProjectReviewResult(ProjectReviewResultUploadReq req) { String key = "meeting_project_result_upload:" + req.getMeetingProjectId(); if (!distributedLock.lock(key, RETRY_TIMES)) { diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/ProjectReviewManage.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/ProjectReviewManage.java index 99411cd..eb231ba 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/ProjectReviewManage.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/ProjectReviewManage.java @@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.hz.pm.api.common.enumeration.ProjectProcessType; +import com.hz.pm.api.common.exception.ReturnException; import com.hz.pm.api.common.helper.UserInfoHelper; import com.hz.pm.api.common.model.constant.BizConst; import com.hz.pm.api.common.model.constant.ExistsSqlConst; @@ -355,6 +356,11 @@ public class ProjectReviewManage { } public void uploadConstructionPlanSealFile(UploadConstructionPlanSealFileReq req) { + Project project = projectService.getNewProject(req.getProjectId()); + if (project == null || (ProjectStatus.WITHOUT_EXPERT_REVIEW.eq(project.getStatus()) + && !ProjectStatus.EXPERT_REVIEW_FAILED.eq(project.getStatus()))) { + throw ReturnException.wrap("项目不存在或项目状态异常"); + } Wrapper wrapper = Wrappers.lambdaUpdate(Project.class) .set(Project::getConstructionPlanSealFile, req.getConstructionPlanSealFile()) .set(Project::getUpdateOn, LocalDateTime.now())