@@ -24,6 +24,7 @@ import org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice; | |||||
"com.ningdatech.pmapi.sys.controller", | "com.ningdatech.pmapi.sys.controller", | ||||
"com.ningdatech.pmapi.todocenter.controller", | "com.ningdatech.pmapi.todocenter.controller", | ||||
"com.ningdatech.pmapi.user.controller", | "com.ningdatech.pmapi.user.controller", | ||||
"com.ningdatech.pmapi.meeting.controller", | |||||
"com.ningdatech.pmapi.expert.controller" | "com.ningdatech.pmapi.expert.controller" | ||||
}) | }) | ||||
public class GlobalResponseHandler implements ResponseBodyAdvice<Object> { | public class GlobalResponseHandler implements ResponseBodyAdvice<Object> { | ||||
@@ -79,6 +79,7 @@ public class ExpertReviewManage { | |||||
review.setContent(JSONUtil.toJsonStr(req.getReviewTemplateOptions())); | review.setContent(JSONUtil.toJsonStr(req.getReviewTemplateOptions())); | ||||
review.setProjectId(req.getProjectId()); | review.setProjectId(req.getProjectId()); | ||||
review.setTemplateId(req.getTemplateId()); | review.setTemplateId(req.getTemplateId()); | ||||
review.setMeetingId(req.getMeetingId()); | |||||
review.setOtherAdvice(req.getOtherAdvice()); | review.setOtherAdvice(req.getOtherAdvice()); | ||||
review.setAttachFileId(req.getAttachFileId()); | review.setAttachFileId(req.getAttachFileId()); | ||||
review.setIsFinal(req.getIsFinal()); | review.setIsFinal(req.getIsFinal()); | ||||
@@ -30,6 +30,9 @@ public class ExpertReview implements Serializable { | |||||
@ApiModelProperty("项目ID") | @ApiModelProperty("项目ID") | ||||
private Long projectId; | private Long projectId; | ||||
@ApiModelProperty("会议ID") | |||||
private Long meetingId; | |||||
@ApiModelProperty("评审模版配置ID") | @ApiModelProperty("评审模版配置ID") | ||||
private Long templateId; | private Long templateId; | ||||
@@ -28,6 +28,10 @@ public class ExpertReviewDetailReq { | |||||
@NotNull(message = "项目ID不能为空") | @NotNull(message = "项目ID不能为空") | ||||
private Long projectId; | private Long projectId; | ||||
@ApiModelProperty("会议ID") | |||||
@NotNull(message = "会议ID不能为空") | |||||
private Long meetingId; | |||||
@Valid | @Valid | ||||
@ApiModelProperty("配置模版") | @ApiModelProperty("配置模版") | ||||
@NotEmpty(message = "配置不能为空") | @NotEmpty(message = "配置不能为空") | ||||
@@ -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.req.*; | ||||
import com.ningdatech.pmapi.meeting.entity.vo.*; | import com.ningdatech.pmapi.meeting.entity.vo.*; | ||||
import com.ningdatech.pmapi.meeting.manage.MeetingManage; | import com.ningdatech.pmapi.meeting.manage.MeetingManage; | ||||
import com.ningdatech.pmapi.projectlib.model.vo.ProjectLibListItemVO; | |||||
import io.swagger.annotations.Api; | import io.swagger.annotations.Api; | ||||
import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
import lombok.AllArgsConstructor; | import lombok.AllArgsConstructor; | ||||
@@ -15,6 +16,7 @@ import org.springframework.validation.annotation.Validated; | |||||
import org.springframework.web.bind.annotation.*; | import org.springframework.web.bind.annotation.*; | ||||
import javax.validation.Valid; | import javax.validation.Valid; | ||||
import java.util.List; | |||||
/** | /** | ||||
* <p> | * <p> | ||||
@@ -168,8 +170,14 @@ public class MeetingController { | |||||
@GetMapping("/listReviewProject") | @GetMapping("/listReviewProject") | ||||
@ApiOperation("评审会议列表") | @ApiOperation("评审会议列表") | ||||
public PageVo<ReviewProjectDTO> listReviewProject(ReviewProjectListReq req){ | |||||
public PageVo<ReviewProjectDTO> listReviewProject(ReviewProjectListReq req) { | |||||
return meetingManage.pageReviewProject(req); | return meetingManage.pageReviewProject(req); | ||||
} | } | ||||
@GetMapping("/option/project") | |||||
@ApiOperation("项目列表") | |||||
public List<ProjectLibListItemVO> projectList(@RequestParam String meetingType) { | |||||
return meetingManage.optionProject(meetingType); | |||||
} | |||||
} | } |
@@ -25,6 +25,7 @@ import com.ningdatech.pmapi.meeting.entity.domain.*; | |||||
import com.ningdatech.pmapi.meeting.entity.dto.*; | import com.ningdatech.pmapi.meeting.entity.dto.*; | ||||
import com.ningdatech.pmapi.meeting.entity.enumeration.ExpertAttendStatusEnum; | import com.ningdatech.pmapi.meeting.entity.enumeration.ExpertAttendStatusEnum; | ||||
import com.ningdatech.pmapi.meeting.entity.enumeration.ExpertInviteTypeEnum; | 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.enumeration.MeetingStatusEnum; | ||||
import com.ningdatech.pmapi.meeting.entity.req.*; | import com.ningdatech.pmapi.meeting.entity.req.*; | ||||
import com.ningdatech.pmapi.meeting.entity.vo.*; | 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.meeting.task.ExpertInviteTask; | ||||
import com.ningdatech.pmapi.meta.helper.DictionaryCache; | import com.ningdatech.pmapi.meta.helper.DictionaryCache; | ||||
import com.ningdatech.pmapi.meta.helper.TagCache; | 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.entity.Project; | ||||
import com.ningdatech.pmapi.projectlib.model.vo.ProjectLibListItemVO; | |||||
import com.ningdatech.pmapi.projectlib.service.IProjectService; | import com.ningdatech.pmapi.projectlib.service.IProjectService; | ||||
import com.ningdatech.pmapi.sys.model.dto.RegionDTO; | import com.ningdatech.pmapi.sys.model.dto.RegionDTO; | ||||
import com.ningdatech.pmapi.user.security.auth.model.UserInfoDetails; | import com.ningdatech.pmapi.user.security.auth.model.UserInfoDetails; | ||||
@@ -702,4 +705,42 @@ public class MeetingManage { | |||||
return PageVo.of(page.getRecords(), page.getTotal()); | return PageVo.of(page.getRecords(), page.getTotal()); | ||||
} | } | ||||
public List<ProjectLibListItemVO> optionProject(String meetingType) { | |||||
LambdaQueryWrapper<Project> 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<Project> 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<Project> 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)")); | |||||
} | |||||
} | } |
@@ -4,7 +4,9 @@ import com.fasterxml.jackson.annotation.JsonFormat; | |||||
import com.ningdatech.pmapi.projectlib.enumeration.ProjectTypeEnum; | import com.ningdatech.pmapi.projectlib.enumeration.ProjectTypeEnum; | ||||
import io.swagger.annotations.ApiModel; | import io.swagger.annotations.ApiModel; | ||||
import io.swagger.annotations.ApiModelProperty; | import io.swagger.annotations.ApiModelProperty; | ||||
import lombok.Builder; | |||||
import lombok.Data; | import lombok.Data; | ||||
import lombok.experimental.Tolerate; | |||||
import java.math.BigDecimal; | import java.math.BigDecimal; | ||||
import java.time.LocalDateTime; | import java.time.LocalDateTime; | ||||
@@ -20,9 +22,14 @@ import java.util.Optional; | |||||
* @since 15:13 2023/2/1 | * @since 15:13 2023/2/1 | ||||
*/ | */ | ||||
@Data | @Data | ||||
@Builder | |||||
@ApiModel("项目库列表视图") | @ApiModel("项目库列表视图") | ||||
public class ProjectLibListItemVO { | public class ProjectLibListItemVO { | ||||
@Tolerate | |||||
public ProjectLibListItemVO() { | |||||
} | |||||
@ApiModelProperty("项目ID") | @ApiModelProperty("项目ID") | ||||
private Long id; | private Long id; | ||||
@@ -67,8 +74,8 @@ public class ProjectLibListItemVO { | |||||
private String projectTypeName; | 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)) | Optional.ofNullable(ProjectTypeEnum.getDesc(this.projectType)) | ||||
.ifPresent(desc -> this.projectTypeName = desc); | .ifPresent(desc -> this.projectTypeName = desc); | ||||
} | } | ||||