Преглед изворни кода

feat:

1. 创建会议下拉选择项目接口修改;
tags/24121201
WendyYang пре 1 месец
родитељ
комит
61c3eb4720
4 измењених фајлова са 31 додато и 81 уклоњено
  1. +12
    -22
      hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/enumeration/MeetingReviewTypeEnum.java
  2. +0
    -4
      hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/req/MeetingOptionProjectReq.java
  3. +16
    -55
      hz-pm-api/src/main/java/com/hz/pm/api/meeting/manage/MeetingManage.java
  4. +3
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/enumeration/status/ProjectStatus.java

+ 12
- 22
hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/enumeration/MeetingReviewTypeEnum.java Прегледај датотеку

@@ -1,13 +1,15 @@
package com.hz.pm.api.meeting.entity.enumeration;

import cn.hutool.core.util.StrUtil;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.Optional;

/**
* <p>
* MeetingReviewTypeEnum
* 会议评审类型
* </p>
*
* @author WendyYang
@@ -17,19 +19,6 @@ import java.util.Arrays;
@AllArgsConstructor
public enum MeetingReviewTypeEnum {

/**
* 会议评审类型
*/
PRELIMINARY_SCHEME_REVIEW("初步方案评审", "1"),

CONSTRUCTION_SCHEME_REVIEW("建设方案评审", "2"),

ACCEPTANCE_SCHEME_REVIEW("验收方案评审", "3"),

DEPT_JOIN_REVIEW("部门联审", "4"),

FAIRNESS_REVIEW("公平性审查", "5"),

PROJECT_REVIEW("项目评审", "6"),

EXPERT_REVIEW("专家论证", "7");
@@ -41,19 +30,20 @@ public enum MeetingReviewTypeEnum {
return this.getCode().equals(code);
}

public static MeetingReviewTypeEnum getByCode(String code) {
public static MeetingReviewTypeEnum getNoNull(String code) {
return get(code).orElseThrow(() -> new IllegalArgumentException("无效的会议评审类型编码"));
}

public static Optional<MeetingReviewTypeEnum> get(String code) {
return Arrays.stream(values())
.filter(w -> w.getCode().equals(code))
.findFirst()
.orElseThrow(() -> new IllegalArgumentException("无效的会议评审类型编码"));
.findFirst();
}

public static String getValue(String code) {
return Arrays.stream(values())
.filter(w -> w.getCode().equals(code))
.map(MeetingReviewTypeEnum::getValue)
.findFirst()
.orElse("未知");
return get(code)
.flatMap(w -> Optional.of(w.getValue()))
.orElse(StrUtil.EMPTY);
}

}

+ 0
- 4
hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/req/MeetingOptionProjectReq.java Прегледај датотеку

@@ -1,7 +1,6 @@
package com.hz.pm.api.meeting.entity.req;

import com.ningdatech.basic.model.PagePo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

@@ -19,7 +18,4 @@ public class MeetingOptionProjectReq extends PagePo {

private String meetingType;

@ApiModelProperty("会议ID")
private Long meetingId;

}

+ 16
- 55
hz-pm-api/src/main/java/com/hz/pm/api/meeting/manage/MeetingManage.java Прегледај датотеку

@@ -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.model.entity.Project;
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.scheduler.listener.event.MhTodoSendEvent;
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.service.IMsgCallRecordService;
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.enumeration.RoleEnum;
import com.hz.pm.api.user.security.model.UserInfoDetails;
@@ -119,7 +120,7 @@ public class MeetingManage {
private final MhUnitCache mhUnitCache;
private final ProjectStateMachineUtil projectStateMachineUtil;
private final IMsgCallRecordService msgCallRecordService;
private final IProjectInstService projectInstService;
private final MhUnitQueryAuthHelper mhUnitQueryAuthHelper;

private static final String INVITED_RULE_CREATE = "INVITED_RULE_CREATE:";

@@ -1078,51 +1079,27 @@ public class MeetingManage {
}

public PageVo<MeetingReviewProjectVO> optionProject(MeetingOptionProjectReq req) {
UnitQueryState unitQueryState = mhUnitQueryAuthHelper.listCanViewUnitIds(null);
if (!unitQueryState.isState()) {
return PageVo.empty();
}
String meetingType = req.getMeetingType();
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 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;
default:
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);
Page<Project> page = projectService.page(req.page(), query);
PageVo<MeetingReviewProjectVO> result = PageVo.of(null, page.getTotal());
@@ -1165,22 +1142,6 @@ public class MeetingManage {
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) {
String key = "meeting_result_upload:" + req.getMeetingId();
if (!distributedLock.lock(key, RETRY_TIMES)) {


+ 3
- 0
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/enumeration/status/ProjectStatus.java Прегледај датотеку

@@ -6,6 +6,7 @@ import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.List;
import java.util.Optional;

/**
@@ -115,4 +116,6 @@ public enum ProjectStatus implements IStatus<Integer, String> {
return get(code).orElseThrow(() -> BizException.wrap("项目状态无效:%s", code));
}

public static final List<Integer> STOP_CHANGE_STAGE_CODES = Arrays.asList(CHANGE.getCode(), STOPPED.getCode());

}

Loading…
Откажи
Сачувај