|
@@ -48,7 +48,6 @@ import com.hz.pm.api.projectdeclared.utils.ProjectIdCodeCacheUtil; |
|
|
import com.hz.pm.api.projectlib.helper.ProjectManageUtil; |
|
|
import com.hz.pm.api.projectlib.helper.ProjectManageUtil; |
|
|
import com.hz.pm.api.projectlib.model.entity.Project; |
|
|
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.model.enumeration.status.ProjectStatus; |
|
|
import com.hz.pm.api.projectlib.service.IProjectInstService; |
|
|
|
|
|
import com.hz.pm.api.projectlib.service.IProjectService; |
|
|
import com.hz.pm.api.projectlib.service.IProjectService; |
|
|
import com.hz.pm.api.scheduler.listener.event.MhTodoSendEvent; |
|
|
import com.hz.pm.api.scheduler.listener.event.MhTodoSendEvent; |
|
|
import com.hz.pm.api.sys.model.dto.RegionDTO; |
|
|
import com.hz.pm.api.sys.model.dto.RegionDTO; |
|
@@ -56,6 +55,8 @@ import com.hz.pm.api.sys.model.entity.MsgCallRecord; |
|
|
import com.hz.pm.api.sys.model.enumeration.SubmitTypeEnum; |
|
|
import com.hz.pm.api.sys.model.enumeration.SubmitTypeEnum; |
|
|
import com.hz.pm.api.sys.service.IMsgCallRecordService; |
|
|
import com.hz.pm.api.sys.service.IMsgCallRecordService; |
|
|
import com.hz.pm.api.user.helper.MhUnitCache; |
|
|
import com.hz.pm.api.user.helper.MhUnitCache; |
|
|
|
|
|
import com.hz.pm.api.user.helper.MhUnitQueryAuthHelper; |
|
|
|
|
|
import com.hz.pm.api.user.helper.MhUnitQueryAuthHelper.UnitQueryState; |
|
|
import com.hz.pm.api.user.model.entity.UserInfo; |
|
|
import com.hz.pm.api.user.model.entity.UserInfo; |
|
|
import com.hz.pm.api.user.model.enumeration.RoleEnum; |
|
|
import com.hz.pm.api.user.model.enumeration.RoleEnum; |
|
|
import com.hz.pm.api.user.security.model.UserInfoDetails; |
|
|
import com.hz.pm.api.user.security.model.UserInfoDetails; |
|
@@ -119,7 +120,7 @@ public class MeetingManage { |
|
|
private final MhUnitCache mhUnitCache; |
|
|
private final MhUnitCache mhUnitCache; |
|
|
private final ProjectStateMachineUtil projectStateMachineUtil; |
|
|
private final ProjectStateMachineUtil projectStateMachineUtil; |
|
|
private final IMsgCallRecordService msgCallRecordService; |
|
|
private final IMsgCallRecordService msgCallRecordService; |
|
|
private final IProjectInstService projectInstService; |
|
|
|
|
|
|
|
|
private final MhUnitQueryAuthHelper mhUnitQueryAuthHelper; |
|
|
|
|
|
|
|
|
private static final String INVITED_RULE_CREATE = "INVITED_RULE_CREATE:"; |
|
|
private static final String INVITED_RULE_CREATE = "INVITED_RULE_CREATE:"; |
|
|
|
|
|
|
|
@@ -1078,51 +1079,27 @@ public class MeetingManage { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public PageVo<MeetingReviewProjectVO> optionProject(MeetingOptionProjectReq req) { |
|
|
public PageVo<MeetingReviewProjectVO> optionProject(MeetingOptionProjectReq req) { |
|
|
|
|
|
UnitQueryState unitQueryState = mhUnitQueryAuthHelper.listCanViewUnitIds(null); |
|
|
|
|
|
if (!unitQueryState.isState()) { |
|
|
|
|
|
return PageVo.empty(); |
|
|
|
|
|
} |
|
|
String meetingType = req.getMeetingType(); |
|
|
String meetingType = req.getMeetingType(); |
|
|
LambdaQueryWrapper<Project> query = Wrappers.lambdaQuery(Project.class) |
|
|
LambdaQueryWrapper<Project> query = Wrappers.lambdaQuery(Project.class) |
|
|
.eq(Project::getNewest, Boolean.TRUE) |
|
|
|
|
|
.notIn(Project::getStage, ProjectStatus.STOPPED.getCode(), ProjectStatus.CHANGE.getCode()); |
|
|
|
|
|
UserInfoDetails userDetail = LoginUserUtil.userDetailNotNull(); |
|
|
|
|
|
switch (userDetail.maxAuthRole()) { |
|
|
|
|
|
case SUPER_ADMIN: |
|
|
|
|
|
break; |
|
|
|
|
|
case COMPANY_MANAGER: |
|
|
|
|
|
if (MhUnitConst.ROOT_UNIT_ID != userDetail.getMhUnitId()) { |
|
|
|
|
|
List<Long> viewUnitIds = mhUnitCache.getViewChildIdsRecursion(userDetail.getMhUnitId()); |
|
|
|
|
|
if (CollUtil.isEmpty(viewUnitIds)) { |
|
|
|
|
|
return PageVo.empty(); |
|
|
|
|
|
} |
|
|
|
|
|
query.in(Project::getBuildOrgCode, viewUnitIds); |
|
|
|
|
|
} |
|
|
|
|
|
break; |
|
|
|
|
|
default: |
|
|
|
|
|
query.eq(Project::getBuildOrgCode, userDetail.getMhUnitIdStr()); |
|
|
|
|
|
break; |
|
|
|
|
|
} |
|
|
|
|
|
switch (MeetingReviewTypeEnum.getByCode(meetingType)) { |
|
|
|
|
|
case PRELIMINARY_SCHEME_REVIEW: |
|
|
|
|
|
case CONSTRUCTION_SCHEME_REVIEW: |
|
|
|
|
|
case DEPT_JOIN_REVIEW: |
|
|
|
|
|
buildOptionProjectQuery(query, meetingType); |
|
|
|
|
|
buildOptionProjectQuery(query, meetingType); |
|
|
|
|
|
break; |
|
|
|
|
|
case ACCEPTANCE_SCHEME_REVIEW: |
|
|
|
|
|
buildOptionProjectQuery(query, meetingType, ProjectStatus.ON_FINALLY_INSPECTED); |
|
|
|
|
|
break; |
|
|
|
|
|
case FAIRNESS_REVIEW: |
|
|
|
|
|
break; |
|
|
|
|
|
|
|
|
.notIn(Project::getStage, ProjectStatus.STOP_CHANGE_STAGE_CODES) |
|
|
|
|
|
.eq(Project::getNewest, Boolean.TRUE); |
|
|
|
|
|
BizUtils.notEmpty(unitQueryState.getUnitIds(), w -> { |
|
|
|
|
|
List<String> unitIdStrList = CollUtils.convert(w, String::valueOf); |
|
|
|
|
|
query.in(Project::getBuildOrgCode, unitIdStrList); |
|
|
|
|
|
}); |
|
|
|
|
|
switch (MeetingReviewTypeEnum.getNoNull(meetingType)) { |
|
|
case PROJECT_REVIEW: |
|
|
case PROJECT_REVIEW: |
|
|
case EXPERT_REVIEW: |
|
|
case EXPERT_REVIEW: |
|
|
query.isNotNull(Project::getConstructionPlanSealFile); |
|
|
|
|
|
buildOptionProjectQuery(query, meetingType, ProjectStatus.WITHOUT_EXPERT_REVIEW); |
|
|
|
|
|
|
|
|
query.eq(Project::getStatus, ProjectStatus.WITHOUT_EXPERT_REVIEW.getCode()) |
|
|
|
|
|
.isNotNull(Project::getConstructionPlanSealFile); |
|
|
break; |
|
|
break; |
|
|
default: |
|
|
default: |
|
|
return PageVo.empty(); |
|
|
return PageVo.empty(); |
|
|
} |
|
|
} |
|
|
if (req.getMeetingId() != null) { |
|
|
|
|
|
query.notExists("select 1 from meeting_inner_project mip on mip.project_code = nd_project.project_code" + |
|
|
|
|
|
" and nd_project.newest = 1 and mip.meeting_id = {0}", req.getMeetingId()); |
|
|
|
|
|
} |
|
|
|
|
|
ProjectManageUtil.projectBaseQuery(query); |
|
|
ProjectManageUtil.projectBaseQuery(query); |
|
|
Page<Project> page = projectService.page(req.page(), query); |
|
|
Page<Project> page = projectService.page(req.page(), query); |
|
|
PageVo<MeetingReviewProjectVO> result = PageVo.of(null, page.getTotal()); |
|
|
PageVo<MeetingReviewProjectVO> result = PageVo.of(null, page.getTotal()); |
|
@@ -1165,22 +1142,6 @@ public class MeetingManage { |
|
|
return ProjectReviewResultBuilder.convert(projectReview); |
|
|
return ProjectReviewResultBuilder.convert(projectReview); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private void buildOptionProjectQuery(LambdaQueryWrapper<Project> query, String meetingType, ProjectStatus... statusList) { |
|
|
|
|
|
if (statusList != null && statusList.length > 0) { |
|
|
|
|
|
List<Integer> 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.project_code = mip.project_code" + |
|
|
|
|
|
" and m.type = %s and m.status != 3", meetingType); |
|
|
|
|
|
String sql2 = String.format("1 = (select case when review_result in (2) 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 " + |
|
|
|
|
|
" and ner.project_id = mip.project_id and ner.is_final = 1 order by m.create_on desc limit 1) t)", meetingType); |
|
|
|
|
|
query.and(q1 -> q1.notExists(sql).or(q2 -> q2.apply(sql2))); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void uploadMeetingResult(MeetingResultUploadReq req) { |
|
|
public void uploadMeetingResult(MeetingResultUploadReq req) { |
|
|
String key = "meeting_result_upload:" + req.getMeetingId(); |
|
|
String key = "meeting_result_upload:" + req.getMeetingId(); |
|
|
if (!distributedLock.lock(key, RETRY_TIMES)) { |
|
|
if (!distributedLock.lock(key, RETRY_TIMES)) { |
|
|