|
|
@@ -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<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)")); |
|
|
|
} |
|
|
|
|
|
|
|
} |