From 05d429037b5e9d703bcc823b1ae8a050fb9f885c Mon Sep 17 00:00:00 2001 From: WendyYang Date: Mon, 18 Dec 2023 15:56:19 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BC=9A=E8=AE=AE=E7=BB=93?= =?UTF-8?q?=E6=9E=9C=E4=B8=8A=E4=BC=A0=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/meeting/controller/MeetingController.java | 15 ++- .../hz/pm/api/meeting/entity/domain/Meeting.java | 15 +++ .../api/meeting/entity/dto/AbstractInviteRule.java | 2 + .../api/meeting/entity/dto/ExpertIdFilterDTO.java | 25 ++++ .../pm/api/meeting/entity/dto/MeetingBasicDTO.java | 25 ++-- .../api/meeting/entity/dto/MergeExpertIdDTO.java | 2 +- .../meeting/entity/req/MeetingResultUploadReq.java | 31 +++++ .../meeting/entity/vo/MeetingDetailBasicVO.java | 20 +++- .../pm/api/meeting/helper/MeetingManageHelper.java | 14 ++- .../pm/api/meeting/manage/ExpertInviteManage.java | 26 ++--- .../hz/pm/api/meeting/manage/MeetingManage.java | 126 +++++++++++++-------- .../api/meta/constant/DictExpertInfoTypeEnum.java | 40 +++++-- 12 files changed, 249 insertions(+), 92 deletions(-) create mode 100644 hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/dto/ExpertIdFilterDTO.java create mode 100644 hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/req/MeetingResultUploadReq.java diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/controller/MeetingController.java b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/controller/MeetingController.java index e21bffa..e6cc86a 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/controller/MeetingController.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/controller/MeetingController.java @@ -1,13 +1,13 @@ package com.hz.pm.api.meeting.controller; -import com.ningdatech.basic.model.IdVo; -import com.ningdatech.basic.model.PageVo; -import com.ningdatech.log.annotation.WebLog; import com.hz.pm.api.meeting.entity.dto.ReviewProjectDTO; import com.hz.pm.api.meeting.entity.req.*; import com.hz.pm.api.meeting.entity.vo.*; import com.hz.pm.api.meeting.manage.MeetingManage; +import com.ningdatech.basic.model.IdVo; +import com.ningdatech.basic.model.PageVo; +import com.ningdatech.log.annotation.WebLog; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.AllArgsConstructor; @@ -88,7 +88,7 @@ public class MeetingController { @ApiOperation("项目详情-基本信息") @GetMapping("/basicInfo/{meetingId}") - @WebLog(value = "项目详情-基本信息",response = true,project = true) + @WebLog(value = "项目详情-基本信息", response = true, project = true) public MeetingDetailBasicVO meetingBasic(@PathVariable Long meetingId) { return meetingManage.getMeetingDetail(meetingId); } @@ -196,4 +196,11 @@ public class MeetingController { return meetingManage.projectsByMeetingId(meetingId); } + @PostMapping("/result/upload") + @ApiOperation("上传会议结果") + @WebLog("上传会议结果") + public void uploadMeetingResult(@RequestBody @Valid MeetingResultUploadReq req) { + meetingManage.uploadMeetingResult(req); + } + } diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/domain/Meeting.java b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/domain/Meeting.java index 672a346..339c4cc 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/domain/Meeting.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/domain/Meeting.java @@ -83,6 +83,21 @@ public class Meeting implements Serializable { @ApiModelProperty("抽取类型") private Integer inviteType; + @ApiModelProperty("相关材料") + private String attachFiles; + + @ApiModelProperty("会议说明") + private String description; + + @ApiModelProperty("备注") + private String remark; + + @ApiModelProperty("会议结果说明") + private String resultDescription; + + @ApiModelProperty("会议结果附件") + private String resultAttachFiles; + @ApiModelProperty("创建人ID") @TableField(fill = FieldFill.INSERT) private Long createBy; diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/dto/AbstractInviteRule.java b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/dto/AbstractInviteRule.java index f09631b..29edd64 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/dto/AbstractInviteRule.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/dto/AbstractInviteRule.java @@ -3,6 +3,7 @@ package com.hz.pm.api.meeting.entity.dto; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; +import org.hibernate.validator.constraints.Range; import javax.validation.constraints.NotNull; @@ -23,6 +24,7 @@ public abstract class AbstractInviteRule { @ApiModelProperty("专家抽取数量") @NotNull(message = "专家抽取数量不能为空", groups = {RuleSave.class}) + @Range(min = 1, max = 50, message = "专家抽取数量应在1~50人") private Integer count; @ApiModelProperty("抽取类型:1 随机抽取、2 指定抽取") diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/dto/ExpertIdFilterDTO.java b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/dto/ExpertIdFilterDTO.java new file mode 100644 index 0000000..9ea369a --- /dev/null +++ b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/dto/ExpertIdFilterDTO.java @@ -0,0 +1,25 @@ +package com.hz.pm.api.meeting.entity.dto; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.RequiredArgsConstructor; + +import java.util.List; + +/** + *

+ * ExpertIdFilterDTO + *

+ * + * @author WendyYang + * @since 14:33 2023/12/18 + */ +@Data +@AllArgsConstructor +public class ExpertIdFilterDTO { + + private boolean ignored; + + private List expertIds; + +} diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/dto/MeetingBasicDTO.java b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/dto/MeetingBasicDTO.java index c485ac7..c2b2e83 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/dto/MeetingBasicDTO.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/dto/MeetingBasicDTO.java @@ -22,16 +22,12 @@ import java.util.List; @ApiModel("会议基本信息") public class MeetingBasicDTO { - @NotNull(message = "是否是系统内部项目不能为空") - @ApiModelProperty("是否是系统内部项目") - private Boolean isInnerProject; - - @NotEmpty(message = "事务名称不能为空") - @ApiModelProperty("事务名称") + @NotEmpty(message = "会议名称不能为空") + @ApiModelProperty("会议名称") private String name; - @NotEmpty(message = "事务类型不能为空") - @ApiModelProperty("事务类型") + @NotEmpty(message = "会议类型不能为空") + @ApiModelProperty("会议类型") private String type; @NotNull(message = "开始时间不能为空") @@ -65,10 +61,23 @@ public class MeetingBasicDTO { @ApiModelProperty("联系方式") private String contact; + @NotNull(message = "是否是系统内部项目不能为空") + @ApiModelProperty("是否是系统内部项目") + private Boolean isInnerProject; + @ApiModelProperty("内部项目ID") private List innerProjects; @ApiModelProperty("外部项目") private List projects; + @ApiModelProperty("会议说明") + private String description; + + @ApiModelProperty("备注") + private String remark; + + @ApiModelProperty("相关材料") + private String attachFiles; + } diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/dto/MergeExpertIdDTO.java b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/dto/MergeExpertIdDTO.java index bef8f80..80bc1f0 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/dto/MergeExpertIdDTO.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/dto/MergeExpertIdDTO.java @@ -19,7 +19,7 @@ public class MergeExpertIdDTO { private List expertIdsNotIn; - private Boolean skip; + private boolean skip; public static MergeExpertIdDTO noExpert() { MergeExpertIdDTO condition = new MergeExpertIdDTO(); diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/req/MeetingResultUploadReq.java b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/req/MeetingResultUploadReq.java new file mode 100644 index 0000000..cc0d197 --- /dev/null +++ b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/req/MeetingResultUploadReq.java @@ -0,0 +1,31 @@ +package com.hz.pm.api.meeting.entity.req; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; + +/** + *

+ * MeetingResultUploadReq + *

+ * + * @author WendyYang + * @since 15:35 2023/12/18 + */ +@Data +public class MeetingResultUploadReq { + + @ApiModelProperty("会议ID") + @NotNull(message = "会议ID不能为空") + private Long meetingId; + + @ApiModelProperty("会议结果说明") + @NotBlank(message = "会议结果说明不能为空") + private String resultDescription; + + @ApiModelProperty("会议结果附件") + private String resultAttachFiles; + +} diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/vo/MeetingDetailBasicVO.java b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/vo/MeetingDetailBasicVO.java index a6c7578..f084599 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/vo/MeetingDetailBasicVO.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/vo/MeetingDetailBasicVO.java @@ -28,6 +28,7 @@ public class MeetingDetailBasicVO { public MeetingDetailBasicVO() { } + @ApiModelProperty("会议ID") private Long meetingId; @ApiModelProperty("会议名称") @@ -36,11 +37,11 @@ public class MeetingDetailBasicVO { @ApiModelProperty("会议类型名称") private String typeName; - private String regionCode; - @ApiModelProperty("会议类型代码") private String meetingType; + private String regionCode; + @ApiModelProperty("开始时间") @JSONField(format = "yyyy-MM-dd HH:mm") private LocalDateTime startTime; @@ -98,4 +99,19 @@ public class MeetingDetailBasicVO { @ApiModelProperty("邀请类型") private Integer inviteType; + @ApiModelProperty("会议说明") + private String description; + + @ApiModelProperty("备注") + private String remark; + + @ApiModelProperty("相关材料") + private String attachFiles; + + @ApiModelProperty("会议结果说明") + private String resultDescription; + + @ApiModelProperty("会议结果附件") + private String resultAttachFiles; + } diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/helper/MeetingManageHelper.java b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/helper/MeetingManageHelper.java index 6037bac..6f3e93f 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/helper/MeetingManageHelper.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/helper/MeetingManageHelper.java @@ -4,8 +4,6 @@ import cn.hutool.core.collection.CollUtil; import cn.hutool.core.lang.Assert; import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.ningdatech.basic.exception.BizException; -import com.ningdatech.basic.util.CollUtils; import com.hz.pm.api.common.helper.RegionCacheHelper; import com.hz.pm.api.common.util.BizUtils; import com.hz.pm.api.common.util.StrUtils; @@ -35,6 +33,8 @@ import com.hz.pm.api.meta.constant.DictExpertInfoTypeEnum; import com.hz.pm.api.meta.helper.DictionaryCache; import com.hz.pm.api.meta.model.dto.DictionaryDTO; import com.hz.pm.api.sys.model.dto.RegionDTO; +import com.ningdatech.basic.exception.BizException; +import com.ningdatech.basic.util.CollUtils; import lombok.AllArgsConstructor; import org.apache.commons.collections4.CollectionUtils; import org.springframework.stereotype.Component; @@ -62,10 +62,12 @@ public class MeetingManageHelper { private final RegionCacheHelper regionCacheHelper; public void checkReviewProject(MeetingBasicDTO meetingBasic) { - if (meetingBasic.getIsInnerProject()) { - Assert.notEmpty(meetingBasic.getInnerProjects(), "评审项目不能为空"); - } else { - Assert.notEmpty(meetingBasic.getProjects(), "评审项目不能为空"); + if (meetingBasic.getIsInnerProject() != null) { + if (meetingBasic.getIsInnerProject()) { + Assert.notEmpty(meetingBasic.getInnerProjects(), "评审项目不能为空"); + } else { + Assert.notEmpty(meetingBasic.getProjects(), "评审项目不能为空"); + } } } diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/manage/ExpertInviteManage.java b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/manage/ExpertInviteManage.java index 9fbbcc5..900c5c5 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/manage/ExpertInviteManage.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/manage/ExpertInviteManage.java @@ -3,8 +3,6 @@ package com.hz.pm.api.meeting.manage; import cn.hutool.core.collection.CollUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; -import com.ningdatech.basic.exception.BizException; -import com.ningdatech.basic.util.CollUtils; import com.hz.pm.api.common.util.BizUtils; import com.hz.pm.api.expert.constant.ExpertAccountStatusEnum; import com.hz.pm.api.expert.entity.ExpertAvoidCompany; @@ -32,6 +30,8 @@ import com.hz.pm.api.meta.model.entity.ExpertDictionary; import com.hz.pm.api.meta.model.entity.ExpertTag; import com.hz.pm.api.meta.service.IExpertDictionaryService; import com.hz.pm.api.meta.service.IExpertTagService; +import com.ningdatech.basic.exception.BizException; +import com.ningdatech.basic.util.CollUtils; import lombok.RequiredArgsConstructor; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.Predicate; @@ -138,17 +138,19 @@ public class ExpertInviteManage { /** * 获取满足履职意向地的专家ID - * null -> 表示无需过滤 * * @param rule 抽取规则 - * @return java.util.List + * @return 专家ID * @author WendyYang **/ private List expertIdsByRegion(RandomInviteRuleDTO rule) { - if (rule.getIntentionRegionCode() == null || rule.getIntentionRegionLevel() == null) { + String regionCode; + Integer regionLevel; + if ((regionCode = rule.getIntentionRegionCode()) == null + || (regionLevel = rule.getIntentionRegionLevel()) == null) { return null; } - return workRegionService.userIdsMatchIntentionRegion(rule.getIntentionRegionCode(), rule.getIntentionRegionLevel()); + return workRegionService.userIdsMatchIntentionRegion(regionCode, regionLevel); } @@ -230,7 +232,7 @@ public class ExpertInviteManage { * 根据专家标签获取满足的专家ID * * @param rule 抽取规则 - * @return java.util.List + * @return {@link ExpertIdFilterDTO} * @author WendyYang **/ private List expertIdsByTag(RandomInviteRuleDTO rule) { @@ -257,15 +259,13 @@ public class ExpertInviteManage { /** * 根据专家字典获取满足的专家ID - * null -> 表示无需过虑 - * 空集合 -> 未查到 * * @param rule 抽取规则 - * @return java.util.List + * @return 专家ID * @author WendyYang **/ private List expertIdsByDict(RandomInviteRuleDTO rule) { - if (CollectionUtils.isEmpty(rule.getExpertDicts())) { + if (CollUtil.isEmpty(rule.getExpertDicts())) { return null; } LambdaQueryWrapper query = Wrappers.lambdaQuery(ExpertDictionary.class) @@ -302,7 +302,7 @@ public class ExpertInviteManage { LocalDateTime meetingCreateOn) { ExpertChooseDTO result = new ExpertChooseDTO(new ArrayList<>(), 0); MergeExpertIdDTO merge = mergeExpertIdsByCondition(randomRule, avoidRule); - if (merge.getSkip()) { + if (merge.isSkip()) { return result; } boolean avoidExpert = CollUtil.isNotEmpty(avoidRule.getExpertIds()); @@ -421,7 +421,7 @@ public class ExpertInviteManage { ExpertChooseDTO result = new ExpertChooseDTO(new ArrayList<>(), 0); // 合并标签、字典 MergeExpertIdDTO merge = mergeExpertIdsByCondition(randomRule, avoidRule); - if (merge.getSkip()) { + if (merge.isSkip()) { return result; } Set expertIdsIn = new HashSet<>(); diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/manage/MeetingManage.java b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/manage/MeetingManage.java index fce95b3..506fa63 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/manage/MeetingManage.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/manage/MeetingManage.java @@ -11,13 +11,6 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.ningdatech.basic.exception.BizException; -import com.ningdatech.basic.model.IdVo; -import com.ningdatech.basic.model.PageVo; -import com.ningdatech.basic.util.CollUtils; -import com.ningdatech.basic.util.StrPool; -import com.ningdatech.basic.util.ValidUtil; -import com.ningdatech.cache.lock.DistributedLock; import com.hz.pm.api.common.helper.RegionCacheHelper; import com.hz.pm.api.common.model.entity.ViewRegionDTO; import com.hz.pm.api.expert.constant.ReviewResultEnum; @@ -50,6 +43,13 @@ import com.hz.pm.api.projectlib.service.IProjectService; import com.hz.pm.api.sys.model.dto.RegionDTO; import com.hz.pm.api.user.security.auth.model.UserInfoDetails; import com.hz.pm.api.user.util.LoginUserUtil; +import com.ningdatech.basic.exception.BizException; +import com.ningdatech.basic.model.IdVo; +import com.ningdatech.basic.model.PageVo; +import com.ningdatech.basic.util.CollUtils; +import com.ningdatech.basic.util.StrPool; +import com.ningdatech.basic.util.ValidUtil; +import com.ningdatech.cache.lock.DistributedLock; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Transactional; @@ -116,18 +116,19 @@ public class MeetingManage { @Transactional(rollbackFor = Exception.class) public IdVo meetingCreateAndInviteExpert(MeetingCreateReq req) { MeetingBasicDTO meetingBasic = req.getMeetingBasicInfo(); + // 校验关联项目信息 meetingManageHelper.checkReviewProject(meetingBasic); - String md5ByParam = SecureUtil.md5(meetingBasic.toString()); - String key = MEETING_CREATE_KEY + md5ByParam; + String meetingMd5 = SecureUtil.md5(JSONUtil.toJsonStr(req)); + String key = MEETING_CREATE_KEY + meetingMd5; if (!distributedLock.lock(key, RETRY_TIMES)) { throw BizException.wrap("会议正在创建中"); } try { + UserInfoDetails userDetail = LoginUserUtil.loginUserDetail(); ExpertInviteReq inviteRule = req.getExpertInviteRule(); // 保存会议基本信息 Meeting meeting = BeanUtil.copyProperties(meetingBasic, Meeting.class); meeting.setStatus(MeetingStatusEnum.NORMAL.getCode()); - UserInfoDetails userDetail = LoginUserUtil.loginUserDetail(); meeting.setHoldOrg(userDetail.getOrganizationName()); meeting.setHoldOrgCode(userDetail.getOrganizationCode()); meeting.setRegionCode(userDetail.getRegionCode()); @@ -137,23 +138,25 @@ public class MeetingManage { meeting.setConfirmedRoster(Boolean.FALSE); meeting.setInviteType(inviteRule.getInviteType()); meetingService.save(meeting); - if (meetingBasic.getIsInnerProject()) { - List projects = meetingBasic.getInnerProjects().stream().map(w -> { - MeetingInnerProject project = BeanUtil.copyProperties(w, MeetingInnerProject.class); - project.setMeetingId(meeting.getId()); - return project; - }).collect(Collectors.toList()); - meetingInnerProjectService.saveBatch(projects); - } else { - List projects = meetingBasic.getProjects().stream().map(w -> { - MeetingOuterProject project = BeanUtil.copyProperties(w, MeetingOuterProject.class); - project.setMeetingId(meeting.getId()); - return project; - }).collect(Collectors.toList()); - meetingOuterProjectService.saveBatch(projects); + if (meeting.getIsInnerProject() != null) { + if (meetingBasic.getIsInnerProject()) { + List projects = meetingBasic.getInnerProjects().stream().map(w -> { + MeetingInnerProject project = BeanUtil.copyProperties(w, MeetingInnerProject.class); + project.setMeetingId(meeting.getId()); + return project; + }).collect(Collectors.toList()); + meetingInnerProjectService.saveBatch(projects); + } else { + List projects = meetingBasic.getProjects().stream().map(w -> { + MeetingOuterProject project = BeanUtil.copyProperties(w, MeetingOuterProject.class); + project.setMeetingId(meeting.getId()); + return project; + }).collect(Collectors.toList()); + meetingOuterProjectService.saveBatch(projects); + } } // 抽取专家 - req.getExpertInviteRule().setMeetingId(meeting.getId()); + inviteRule.setMeetingId(meeting.getId()); expertInviteByCreate(inviteRule); return IdVo.of(meeting.getId()); } finally { @@ -445,30 +448,37 @@ public class MeetingManage { .inviteType(meeting.getInviteType()) .confirmedRoster(meeting.getConfirmedRoster()) .invitedStopped(meeting.getInviteStatus()) + .attachFiles(meeting.getAttachFiles()) + .description(meeting.getDescription()) + .resultDescription(meeting.getResultDescription()) + .resultAttachFiles(meeting.getResultAttachFiles()) + .remark(meeting.getRemark()) .build(); - if (meeting.getIsInnerProject()) { - List innerProjects = meetingInnerProjectService.listByMeetingId(meetingId); - List projects = projectService.listByIds(CollUtils.fieldList(innerProjects, MeetingInnerProject::getProjectId)); - Map reviewMap = expertReviewService.listFinalReviewMap(meetingId); - List convert = CollUtils.convert(projects, w -> { - MeetingReviewProjectDTO mrp = new MeetingReviewProjectDTO(); - mrp.setProjectId(w.getId()); - mrp.setBuildOrg(w.getBuildOrgName()); - mrp.setProjectName(w.getProjectName()); - mrp.setProjectType(w.getProjectType().toString()); - mrp.setProjectYear(w.getProjectYear()); - mrp.setDeclareAmount(w.getDeclareAmount()); - mrp.setProjectCode(w.getProjectCode()); - ExpertReview review = reviewMap.get(w.getId()); - if (review != null) { - mrp.setReviewResult(ReviewResultEnum.getByCode(review.getReviewResult()).getValue()); - } - return mrp; - }); - detail.setProjects(convert); - } else { - List outerProjects = meetingOuterProjectService.listByMeetingId(meetingId); - detail.setProjects(BeanUtil.copyToList(outerProjects, MeetingReviewProjectDTO.class)); + if (meeting.getIsInnerProject() != null) { + if (Boolean.TRUE.equals(meeting.getIsInnerProject())) { + List innerProjects = meetingInnerProjectService.listByMeetingId(meetingId); + List projects = projectService.listByIds(CollUtils.fieldList(innerProjects, MeetingInnerProject::getProjectId)); + Map reviewMap = expertReviewService.listFinalReviewMap(meetingId); + List convert = CollUtils.convert(projects, w -> { + MeetingReviewProjectDTO mrp = new MeetingReviewProjectDTO(); + mrp.setProjectId(w.getId()); + mrp.setBuildOrg(w.getBuildOrgName()); + mrp.setProjectName(w.getProjectName()); + mrp.setProjectType(w.getProjectType()); + mrp.setProjectYear(w.getProjectYear()); + mrp.setDeclareAmount(w.getDeclareAmount()); + mrp.setProjectCode(w.getProjectCode()); + ExpertReview review = reviewMap.get(w.getId()); + if (review != null) { + mrp.setReviewResult(ReviewResultEnum.getByCode(review.getReviewResult()).getValue()); + } + return mrp; + }); + detail.setProjects(convert); + } else { + List outerProjects = meetingOuterProjectService.listByMeetingId(meetingId); + detail.setProjects(BeanUtil.copyToList(outerProjects, MeetingReviewProjectDTO.class)); + } } detail.setInviteRule(inviteRuleDetail(meetingId)); return detail; @@ -518,7 +528,7 @@ public class MeetingManage { statistics.setInviteCnt(v.getInviteCount()); List expertList = groupByRule.get(k); if (expertList != null) { - expertList.forEach((expert) -> { + expertList.forEach(expert -> { if (AGREED.eq(expert.getStatus())) { statistics.incrAgreeCnt(); } @@ -934,4 +944,22 @@ public class MeetingManage { query.and(q1 -> q1.notExists(sql).or(q2 -> q2.apply(sql2))); } + public void uploadMeetingResult(MeetingResultUploadReq req) { + Meeting meeting = meetingService.getById(req.getMeetingId()); + if (meeting == null || MeetingStatusEnum.CANCELED.eq(meeting.getStatus())) { + throw BizException.wrap("会议不存在或已取消"); + } + LocalDateTime now = LocalDateTime.now(); + if (meeting.getEndTime().isAfter(now)) { + throw BizException.wrap("会议未结束"); + } + LambdaUpdateWrapper mUpdate = Wrappers.lambdaUpdate(Meeting.class) + .set(Meeting::getUpdateOn, now) + .set(Meeting::getResultDescription, req.getResultDescription()) + .set(Meeting::getResultAttachFiles, req.getResultAttachFiles()) + .set(Meeting::getUpdateBy, LoginUserUtil.getUserId()) + .eq(Meeting::getId, req.getMeetingId()); + meetingService.update(mUpdate); + } + } diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/meta/constant/DictExpertInfoTypeEnum.java b/hz-pm-api/src/main/java/com/hz/pm/api/meta/constant/DictExpertInfoTypeEnum.java index 90248f9..137b831 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/meta/constant/DictExpertInfoTypeEnum.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/meta/constant/DictExpertInfoTypeEnum.java @@ -15,23 +15,45 @@ import java.util.List; @Getter public enum DictExpertInfoTypeEnum { - // 政治面貌 + /** + * 政治面貌 + */ POLITICAL("political"), - // 学历 + /** + * 学历 + */ EDU("edu"), - // 学位 + /** + * 学位 + */ DEGREE("degree"), - // 在职状态 + /** + * 在职状态 + */ JOB_STATUS("job_status"), - // 行政职级 + /** + * 行政职级 + */ ADMINISTRATIVE_RANK("administrative_rank"), - // 内外围(专家类型) + /** + * 内外围(专家类型) + */ EXPERT_TYPE("expert_type"), - // 单位类型 + /** + * 所属专家库 + */ + EXPERT_LIBRARY("expert_library"), + /** + * 单位类型 + */ COMPANY_ATTRIBUTE("company_attribute"), - // 职称级别 + /** + * 职称级别 + */ TITLE_LEVEL("title_level"), - // 推荐方式 + /** + * 推荐方式 + */ RECOMMENDED_WAY("recommended_way");