diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/handler/GlobalResponseHandler.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/handler/GlobalResponseHandler.java index 57f4565..18cbc5c 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/handler/GlobalResponseHandler.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/handler/GlobalResponseHandler.java @@ -24,6 +24,7 @@ import org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice; "com.ningdatech.pmapi.sys.controller", "com.ningdatech.pmapi.todocenter.controller", "com.ningdatech.pmapi.user.controller", + "com.ningdatech.pmapi.meeting.controller", "com.ningdatech.pmapi.expert.controller" }) public class GlobalResponseHandler implements ResponseBodyAdvice { diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertReviewManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertReviewManage.java index ebeed24..b070dec 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertReviewManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertReviewManage.java @@ -79,6 +79,7 @@ public class ExpertReviewManage { review.setContent(JSONUtil.toJsonStr(req.getReviewTemplateOptions())); review.setProjectId(req.getProjectId()); review.setTemplateId(req.getTemplateId()); + review.setMeetingId(req.getMeetingId()); review.setOtherAdvice(req.getOtherAdvice()); review.setAttachFileId(req.getAttachFileId()); review.setIsFinal(req.getIsFinal()); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/entity/ExpertReview.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/entity/ExpertReview.java index c5d79bd..5a73039 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/entity/ExpertReview.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/entity/ExpertReview.java @@ -30,6 +30,9 @@ public class ExpertReview implements Serializable { @ApiModelProperty("项目ID") private Long projectId; + @ApiModelProperty("会议ID") + private Long meetingId; + @ApiModelProperty("评审模版配置ID") private Long templateId; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/req/ExpertReviewDetailReq.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/req/ExpertReviewDetailReq.java index a879e38..0423e54 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/req/ExpertReviewDetailReq.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/req/ExpertReviewDetailReq.java @@ -28,6 +28,10 @@ public class ExpertReviewDetailReq { @NotNull(message = "项目ID不能为空") private Long projectId; + @ApiModelProperty("会议ID") + @NotNull(message = "会议ID不能为空") + private Long meetingId; + @Valid @ApiModelProperty("配置模版") @NotEmpty(message = "配置不能为空") diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/controller/MeetingController.java b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/controller/MeetingController.java index 979468f..6dd463b 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/controller/MeetingController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/controller/MeetingController.java @@ -8,6 +8,7 @@ import com.ningdatech.pmapi.meeting.entity.dto.ReviewProjectDTO; import com.ningdatech.pmapi.meeting.entity.req.*; import com.ningdatech.pmapi.meeting.entity.vo.*; import com.ningdatech.pmapi.meeting.manage.MeetingManage; +import com.ningdatech.pmapi.projectlib.model.vo.ProjectLibListItemVO; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.AllArgsConstructor; @@ -15,6 +16,7 @@ import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import javax.validation.Valid; +import java.util.List; /** *

@@ -168,8 +170,14 @@ public class MeetingController { @GetMapping("/listReviewProject") @ApiOperation("评审会议列表") - public PageVo listReviewProject(ReviewProjectListReq req){ + public PageVo listReviewProject(ReviewProjectListReq req) { return meetingManage.pageReviewProject(req); } + @GetMapping("/option/project") + @ApiOperation("项目列表") + public List projectList(@RequestParam String meetingType) { + return meetingManage.optionProject(meetingType); + } + } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/MeetingManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/MeetingManage.java index 47fa752..911687f 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/MeetingManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/MeetingManage.java @@ -25,6 +25,7 @@ import com.ningdatech.pmapi.meeting.entity.domain.*; import com.ningdatech.pmapi.meeting.entity.dto.*; import com.ningdatech.pmapi.meeting.entity.enumeration.ExpertAttendStatusEnum; import com.ningdatech.pmapi.meeting.entity.enumeration.ExpertInviteTypeEnum; +import com.ningdatech.pmapi.meeting.entity.enumeration.MeetingReviewTypeEnum; import com.ningdatech.pmapi.meeting.entity.enumeration.MeetingStatusEnum; import com.ningdatech.pmapi.meeting.entity.req.*; import com.ningdatech.pmapi.meeting.entity.vo.*; @@ -35,7 +36,9 @@ import com.ningdatech.pmapi.meeting.service.*; import com.ningdatech.pmapi.meeting.task.ExpertInviteTask; import com.ningdatech.pmapi.meta.helper.DictionaryCache; import com.ningdatech.pmapi.meta.helper.TagCache; +import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; import com.ningdatech.pmapi.projectlib.model.entity.Project; +import com.ningdatech.pmapi.projectlib.model.vo.ProjectLibListItemVO; import com.ningdatech.pmapi.projectlib.service.IProjectService; import com.ningdatech.pmapi.sys.model.dto.RegionDTO; import com.ningdatech.pmapi.user.security.auth.model.UserInfoDetails; @@ -702,4 +705,42 @@ public class MeetingManage { return PageVo.of(page.getRecords(), page.getTotal()); } + public List optionProject(String meetingType) { + LambdaQueryWrapper query = Wrappers.lambdaQuery(Project.class); + switch (MeetingReviewTypeEnum.getByCode(meetingType)) { + case PRELIMINARY_SCHEME_REVIEW: + buildOptionProjectQuery(query, meetingType, ProjectStatusEnum.PRE_APPLYING); + break; + case CONSTRUCTION_SCHEME_REVIEW: + buildOptionProjectQuery(query, meetingType, ProjectStatusEnum.SCHEME_UNDER_REVIEW); + break; + case ACCEPTANCE_SCHEME_REVIEW: + query.eq(Project::getStatus, ProjectStatusEnum.FINAL_ACCEPTANCE_IS_UNDER_REVIEW); + break; + case DEPT_JOIN_REVIEW: + query.eq(Project::getStatus, ProjectStatusEnum.DEPARTMENT_JOINT_REVIEW); + break; + default: + return Collections.emptyList(); + } + List projects = projectService.list(query); + return CollUtils.convert(projects, w -> ProjectLibListItemVO + .builder() + .id(w.getId()) + .projectName(w.getProjectName()) + .declaredAmount(w.getDeclareAmount()) + .projectType(w.getProjectType()) + .projectYear(w.getProjectYear()) + .buildOrg(w.getBuildOrgName()) + .build()); + } + + private void buildOptionProjectQuery(LambdaQueryWrapper query, String meetingType, ProjectStatusEnum status) { + String sql = String.format("select 1 from meeting m inner join meeting_inner_project mip on" + + " m.is_inner_project = true and m.id = mip.meeting_id and m.type = %s and m.status != 3", meetingType); + query.eq(Project::getStatus, status.getCode()); + query.and(q1 -> q1.notExists(sql)).or(q2 -> q2.exists(sql + " inner join nd_expert_review ner " + + "on ner.meeting_id = m.id and ner.is_final = true and review_result in (2, 3)")); + } + } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectLibListItemVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectLibListItemVO.java index 00ea079..13d762c 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectLibListItemVO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectLibListItemVO.java @@ -4,7 +4,9 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.ningdatech.pmapi.projectlib.enumeration.ProjectTypeEnum; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import lombok.Builder; import lombok.Data; +import lombok.experimental.Tolerate; import java.math.BigDecimal; import java.time.LocalDateTime; @@ -20,9 +22,14 @@ import java.util.Optional; * @since 15:13 2023/2/1 */ @Data +@Builder @ApiModel("项目库列表视图") public class ProjectLibListItemVO { + @Tolerate + public ProjectLibListItemVO() { + } + @ApiModelProperty("项目ID") private Long id; @@ -67,8 +74,8 @@ public class ProjectLibListItemVO { private String projectTypeName; - public String getProjectTypeName(){ - if(Objects.nonNull(this.projectType)){ + public String getProjectTypeName() { + if (Objects.nonNull(this.projectType)) { Optional.ofNullable(ProjectTypeEnum.getDesc(this.projectType)) .ifPresent(desc -> this.projectTypeName = desc); }