@@ -1,13 +1,13 @@ | |||||
package com.hz.pm.api.meeting.controller; | 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.dto.ReviewProjectDTO; | ||||
import com.hz.pm.api.meeting.entity.req.*; | import com.hz.pm.api.meeting.entity.req.*; | ||||
import com.hz.pm.api.meeting.entity.vo.*; | import com.hz.pm.api.meeting.entity.vo.*; | ||||
import com.hz.pm.api.meeting.manage.MeetingManage; | 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.Api; | ||||
import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
import lombok.AllArgsConstructor; | import lombok.AllArgsConstructor; | ||||
@@ -88,7 +88,7 @@ public class MeetingController { | |||||
@ApiOperation("项目详情-基本信息") | @ApiOperation("项目详情-基本信息") | ||||
@GetMapping("/basicInfo/{meetingId}") | @GetMapping("/basicInfo/{meetingId}") | ||||
@WebLog(value = "项目详情-基本信息",response = true,project = true) | |||||
@WebLog(value = "项目详情-基本信息", response = true, project = true) | |||||
public MeetingDetailBasicVO meetingBasic(@PathVariable Long meetingId) { | public MeetingDetailBasicVO meetingBasic(@PathVariable Long meetingId) { | ||||
return meetingManage.getMeetingDetail(meetingId); | return meetingManage.getMeetingDetail(meetingId); | ||||
} | } | ||||
@@ -196,4 +196,11 @@ public class MeetingController { | |||||
return meetingManage.projectsByMeetingId(meetingId); | return meetingManage.projectsByMeetingId(meetingId); | ||||
} | } | ||||
@PostMapping("/result/upload") | |||||
@ApiOperation("上传会议结果") | |||||
@WebLog("上传会议结果") | |||||
public void uploadMeetingResult(@RequestBody @Valid MeetingResultUploadReq req) { | |||||
meetingManage.uploadMeetingResult(req); | |||||
} | |||||
} | } |
@@ -83,6 +83,21 @@ public class Meeting implements Serializable { | |||||
@ApiModelProperty("抽取类型") | @ApiModelProperty("抽取类型") | ||||
private Integer inviteType; | 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") | @ApiModelProperty("创建人ID") | ||||
@TableField(fill = FieldFill.INSERT) | @TableField(fill = FieldFill.INSERT) | ||||
private Long createBy; | private Long createBy; | ||||
@@ -3,6 +3,7 @@ package com.hz.pm.api.meeting.entity.dto; | |||||
import io.swagger.annotations.ApiModel; | import io.swagger.annotations.ApiModel; | ||||
import io.swagger.annotations.ApiModelProperty; | import io.swagger.annotations.ApiModelProperty; | ||||
import lombok.Data; | import lombok.Data; | ||||
import org.hibernate.validator.constraints.Range; | |||||
import javax.validation.constraints.NotNull; | import javax.validation.constraints.NotNull; | ||||
@@ -23,6 +24,7 @@ public abstract class AbstractInviteRule { | |||||
@ApiModelProperty("专家抽取数量") | @ApiModelProperty("专家抽取数量") | ||||
@NotNull(message = "专家抽取数量不能为空", groups = {RuleSave.class}) | @NotNull(message = "专家抽取数量不能为空", groups = {RuleSave.class}) | ||||
@Range(min = 1, max = 50, message = "专家抽取数量应在1~50人") | |||||
private Integer count; | private Integer count; | ||||
@ApiModelProperty("抽取类型:1 随机抽取、2 指定抽取") | @ApiModelProperty("抽取类型:1 随机抽取、2 指定抽取") | ||||
@@ -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; | |||||
/** | |||||
* <p> | |||||
* ExpertIdFilterDTO | |||||
* </p> | |||||
* | |||||
* @author WendyYang | |||||
* @since 14:33 2023/12/18 | |||||
*/ | |||||
@Data | |||||
@AllArgsConstructor | |||||
public class ExpertIdFilterDTO { | |||||
private boolean ignored; | |||||
private List<Long> expertIds; | |||||
} |
@@ -22,16 +22,12 @@ import java.util.List; | |||||
@ApiModel("会议基本信息") | @ApiModel("会议基本信息") | ||||
public class MeetingBasicDTO { | public class MeetingBasicDTO { | ||||
@NotNull(message = "是否是系统内部项目不能为空") | |||||
@ApiModelProperty("是否是系统内部项目") | |||||
private Boolean isInnerProject; | |||||
@NotEmpty(message = "事务名称不能为空") | |||||
@ApiModelProperty("事务名称") | |||||
@NotEmpty(message = "会议名称不能为空") | |||||
@ApiModelProperty("会议名称") | |||||
private String name; | private String name; | ||||
@NotEmpty(message = "事务类型不能为空") | |||||
@ApiModelProperty("事务类型") | |||||
@NotEmpty(message = "会议类型不能为空") | |||||
@ApiModelProperty("会议类型") | |||||
private String type; | private String type; | ||||
@NotNull(message = "开始时间不能为空") | @NotNull(message = "开始时间不能为空") | ||||
@@ -65,10 +61,23 @@ public class MeetingBasicDTO { | |||||
@ApiModelProperty("联系方式") | @ApiModelProperty("联系方式") | ||||
private String contact; | private String contact; | ||||
@NotNull(message = "是否是系统内部项目不能为空") | |||||
@ApiModelProperty("是否是系统内部项目") | |||||
private Boolean isInnerProject; | |||||
@ApiModelProperty("内部项目ID") | @ApiModelProperty("内部项目ID") | ||||
private List<ProjectIdCodeDTO> innerProjects; | private List<ProjectIdCodeDTO> innerProjects; | ||||
@ApiModelProperty("外部项目") | @ApiModelProperty("外部项目") | ||||
private List<MeetingReviewProjectDTO> projects; | private List<MeetingReviewProjectDTO> projects; | ||||
@ApiModelProperty("会议说明") | |||||
private String description; | |||||
@ApiModelProperty("备注") | |||||
private String remark; | |||||
@ApiModelProperty("相关材料") | |||||
private String attachFiles; | |||||
} | } |
@@ -19,7 +19,7 @@ public class MergeExpertIdDTO { | |||||
private List<Long> expertIdsNotIn; | private List<Long> expertIdsNotIn; | ||||
private Boolean skip; | |||||
private boolean skip; | |||||
public static MergeExpertIdDTO noExpert() { | public static MergeExpertIdDTO noExpert() { | ||||
MergeExpertIdDTO condition = new MergeExpertIdDTO(); | MergeExpertIdDTO condition = new MergeExpertIdDTO(); | ||||
@@ -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; | |||||
/** | |||||
* <p> | |||||
* MeetingResultUploadReq | |||||
* </p> | |||||
* | |||||
* @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; | |||||
} |
@@ -28,6 +28,7 @@ public class MeetingDetailBasicVO { | |||||
public MeetingDetailBasicVO() { | public MeetingDetailBasicVO() { | ||||
} | } | ||||
@ApiModelProperty("会议ID") | |||||
private Long meetingId; | private Long meetingId; | ||||
@ApiModelProperty("会议名称") | @ApiModelProperty("会议名称") | ||||
@@ -36,11 +37,11 @@ public class MeetingDetailBasicVO { | |||||
@ApiModelProperty("会议类型名称") | @ApiModelProperty("会议类型名称") | ||||
private String typeName; | private String typeName; | ||||
private String regionCode; | |||||
@ApiModelProperty("会议类型代码") | @ApiModelProperty("会议类型代码") | ||||
private String meetingType; | private String meetingType; | ||||
private String regionCode; | |||||
@ApiModelProperty("开始时间") | @ApiModelProperty("开始时间") | ||||
@JSONField(format = "yyyy-MM-dd HH:mm") | @JSONField(format = "yyyy-MM-dd HH:mm") | ||||
private LocalDateTime startTime; | private LocalDateTime startTime; | ||||
@@ -98,4 +99,19 @@ public class MeetingDetailBasicVO { | |||||
@ApiModelProperty("邀请类型") | @ApiModelProperty("邀请类型") | ||||
private Integer inviteType; | private Integer inviteType; | ||||
@ApiModelProperty("会议说明") | |||||
private String description; | |||||
@ApiModelProperty("备注") | |||||
private String remark; | |||||
@ApiModelProperty("相关材料") | |||||
private String attachFiles; | |||||
@ApiModelProperty("会议结果说明") | |||||
private String resultDescription; | |||||
@ApiModelProperty("会议结果附件") | |||||
private String resultAttachFiles; | |||||
} | } |
@@ -4,8 +4,6 @@ import cn.hutool.core.collection.CollUtil; | |||||
import cn.hutool.core.lang.Assert; | import cn.hutool.core.lang.Assert; | ||||
import cn.hutool.core.util.StrUtil; | import cn.hutool.core.util.StrUtil; | ||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | 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.helper.RegionCacheHelper; | ||||
import com.hz.pm.api.common.util.BizUtils; | import com.hz.pm.api.common.util.BizUtils; | ||||
import com.hz.pm.api.common.util.StrUtils; | 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.helper.DictionaryCache; | ||||
import com.hz.pm.api.meta.model.dto.DictionaryDTO; | import com.hz.pm.api.meta.model.dto.DictionaryDTO; | ||||
import com.hz.pm.api.sys.model.dto.RegionDTO; | 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 lombok.AllArgsConstructor; | ||||
import org.apache.commons.collections4.CollectionUtils; | import org.apache.commons.collections4.CollectionUtils; | ||||
import org.springframework.stereotype.Component; | import org.springframework.stereotype.Component; | ||||
@@ -62,10 +62,12 @@ public class MeetingManageHelper { | |||||
private final RegionCacheHelper regionCacheHelper; | private final RegionCacheHelper regionCacheHelper; | ||||
public void checkReviewProject(MeetingBasicDTO meetingBasic) { | 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(), "评审项目不能为空"); | |||||
} | |||||
} | } | ||||
} | } | ||||
@@ -3,8 +3,6 @@ package com.hz.pm.api.meeting.manage; | |||||
import cn.hutool.core.collection.CollUtil; | import cn.hutool.core.collection.CollUtil; | ||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | 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.common.util.BizUtils; | ||||
import com.hz.pm.api.expert.constant.ExpertAccountStatusEnum; | import com.hz.pm.api.expert.constant.ExpertAccountStatusEnum; | ||||
import com.hz.pm.api.expert.entity.ExpertAvoidCompany; | 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.model.entity.ExpertTag; | ||||
import com.hz.pm.api.meta.service.IExpertDictionaryService; | import com.hz.pm.api.meta.service.IExpertDictionaryService; | ||||
import com.hz.pm.api.meta.service.IExpertTagService; | import com.hz.pm.api.meta.service.IExpertTagService; | ||||
import com.ningdatech.basic.exception.BizException; | |||||
import com.ningdatech.basic.util.CollUtils; | |||||
import lombok.RequiredArgsConstructor; | import lombok.RequiredArgsConstructor; | ||||
import org.apache.commons.collections4.CollectionUtils; | import org.apache.commons.collections4.CollectionUtils; | ||||
import org.apache.commons.collections4.Predicate; | import org.apache.commons.collections4.Predicate; | ||||
@@ -138,17 +138,19 @@ public class ExpertInviteManage { | |||||
/** | /** | ||||
* 获取满足履职意向地的专家ID | * 获取满足履职意向地的专家ID | ||||
* null -> 表示无需过滤 | |||||
* | * | ||||
* @param rule 抽取规则 | * @param rule 抽取规则 | ||||
* @return java.util.List<java.lang.Long> | |||||
* @return 专家ID | |||||
* @author WendyYang | * @author WendyYang | ||||
**/ | **/ | ||||
private List<Long> expertIdsByRegion(RandomInviteRuleDTO rule) { | private List<Long> 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 null; | ||||
} | } | ||||
return workRegionService.userIdsMatchIntentionRegion(rule.getIntentionRegionCode(), rule.getIntentionRegionLevel()); | |||||
return workRegionService.userIdsMatchIntentionRegion(regionCode, regionLevel); | |||||
} | } | ||||
@@ -230,7 +232,7 @@ public class ExpertInviteManage { | |||||
* 根据专家标签获取满足的专家ID | * 根据专家标签获取满足的专家ID | ||||
* | * | ||||
* @param rule 抽取规则 | * @param rule 抽取规则 | ||||
* @return java.util.List<java.lang.Long> | |||||
* @return {@link ExpertIdFilterDTO} | |||||
* @author WendyYang | * @author WendyYang | ||||
**/ | **/ | ||||
private List<Long> expertIdsByTag(RandomInviteRuleDTO rule) { | private List<Long> expertIdsByTag(RandomInviteRuleDTO rule) { | ||||
@@ -257,15 +259,13 @@ public class ExpertInviteManage { | |||||
/** | /** | ||||
* 根据专家字典获取满足的专家ID | * 根据专家字典获取满足的专家ID | ||||
* null -> 表示无需过虑 | |||||
* 空集合 -> 未查到 | |||||
* | * | ||||
* @param rule 抽取规则 | * @param rule 抽取规则 | ||||
* @return java.util.List<java.lang.Long> | |||||
* @return 专家ID | |||||
* @author WendyYang | * @author WendyYang | ||||
**/ | **/ | ||||
private List<Long> expertIdsByDict(RandomInviteRuleDTO rule) { | private List<Long> expertIdsByDict(RandomInviteRuleDTO rule) { | ||||
if (CollectionUtils.isEmpty(rule.getExpertDicts())) { | |||||
if (CollUtil.isEmpty(rule.getExpertDicts())) { | |||||
return null; | return null; | ||||
} | } | ||||
LambdaQueryWrapper<ExpertDictionary> query = Wrappers.lambdaQuery(ExpertDictionary.class) | LambdaQueryWrapper<ExpertDictionary> query = Wrappers.lambdaQuery(ExpertDictionary.class) | ||||
@@ -302,7 +302,7 @@ public class ExpertInviteManage { | |||||
LocalDateTime meetingCreateOn) { | LocalDateTime meetingCreateOn) { | ||||
ExpertChooseDTO result = new ExpertChooseDTO(new ArrayList<>(), 0); | ExpertChooseDTO result = new ExpertChooseDTO(new ArrayList<>(), 0); | ||||
MergeExpertIdDTO merge = mergeExpertIdsByCondition(randomRule, avoidRule); | MergeExpertIdDTO merge = mergeExpertIdsByCondition(randomRule, avoidRule); | ||||
if (merge.getSkip()) { | |||||
if (merge.isSkip()) { | |||||
return result; | return result; | ||||
} | } | ||||
boolean avoidExpert = CollUtil.isNotEmpty(avoidRule.getExpertIds()); | boolean avoidExpert = CollUtil.isNotEmpty(avoidRule.getExpertIds()); | ||||
@@ -421,7 +421,7 @@ public class ExpertInviteManage { | |||||
ExpertChooseDTO result = new ExpertChooseDTO(new ArrayList<>(), 0); | ExpertChooseDTO result = new ExpertChooseDTO(new ArrayList<>(), 0); | ||||
// 合并标签、字典 | // 合并标签、字典 | ||||
MergeExpertIdDTO merge = mergeExpertIdsByCondition(randomRule, avoidRule); | MergeExpertIdDTO merge = mergeExpertIdsByCondition(randomRule, avoidRule); | ||||
if (merge.getSkip()) { | |||||
if (merge.isSkip()) { | |||||
return result; | return result; | ||||
} | } | ||||
Set<Long> expertIdsIn = new HashSet<>(); | Set<Long> expertIdsIn = new HashSet<>(); | ||||
@@ -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.conditions.update.LambdaUpdateWrapper; | ||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | import com.baomidou.mybatisplus.core.toolkit.Wrappers; | ||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | 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.helper.RegionCacheHelper; | ||||
import com.hz.pm.api.common.model.entity.ViewRegionDTO; | import com.hz.pm.api.common.model.entity.ViewRegionDTO; | ||||
import com.hz.pm.api.expert.constant.ReviewResultEnum; | 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.sys.model.dto.RegionDTO; | ||||
import com.hz.pm.api.user.security.auth.model.UserInfoDetails; | import com.hz.pm.api.user.security.auth.model.UserInfoDetails; | ||||
import com.hz.pm.api.user.util.LoginUserUtil; | 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 lombok.RequiredArgsConstructor; | ||||
import org.springframework.stereotype.Component; | import org.springframework.stereotype.Component; | ||||
import org.springframework.transaction.annotation.Transactional; | import org.springframework.transaction.annotation.Transactional; | ||||
@@ -116,18 +116,19 @@ public class MeetingManage { | |||||
@Transactional(rollbackFor = Exception.class) | @Transactional(rollbackFor = Exception.class) | ||||
public IdVo<Long> meetingCreateAndInviteExpert(MeetingCreateReq req) { | public IdVo<Long> meetingCreateAndInviteExpert(MeetingCreateReq req) { | ||||
MeetingBasicDTO meetingBasic = req.getMeetingBasicInfo(); | MeetingBasicDTO meetingBasic = req.getMeetingBasicInfo(); | ||||
// 校验关联项目信息 | |||||
meetingManageHelper.checkReviewProject(meetingBasic); | 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)) { | if (!distributedLock.lock(key, RETRY_TIMES)) { | ||||
throw BizException.wrap("会议正在创建中"); | throw BizException.wrap("会议正在创建中"); | ||||
} | } | ||||
try { | try { | ||||
UserInfoDetails userDetail = LoginUserUtil.loginUserDetail(); | |||||
ExpertInviteReq inviteRule = req.getExpertInviteRule(); | ExpertInviteReq inviteRule = req.getExpertInviteRule(); | ||||
// 保存会议基本信息 | // 保存会议基本信息 | ||||
Meeting meeting = BeanUtil.copyProperties(meetingBasic, Meeting.class); | Meeting meeting = BeanUtil.copyProperties(meetingBasic, Meeting.class); | ||||
meeting.setStatus(MeetingStatusEnum.NORMAL.getCode()); | meeting.setStatus(MeetingStatusEnum.NORMAL.getCode()); | ||||
UserInfoDetails userDetail = LoginUserUtil.loginUserDetail(); | |||||
meeting.setHoldOrg(userDetail.getOrganizationName()); | meeting.setHoldOrg(userDetail.getOrganizationName()); | ||||
meeting.setHoldOrgCode(userDetail.getOrganizationCode()); | meeting.setHoldOrgCode(userDetail.getOrganizationCode()); | ||||
meeting.setRegionCode(userDetail.getRegionCode()); | meeting.setRegionCode(userDetail.getRegionCode()); | ||||
@@ -137,23 +138,25 @@ public class MeetingManage { | |||||
meeting.setConfirmedRoster(Boolean.FALSE); | meeting.setConfirmedRoster(Boolean.FALSE); | ||||
meeting.setInviteType(inviteRule.getInviteType()); | meeting.setInviteType(inviteRule.getInviteType()); | ||||
meetingService.save(meeting); | meetingService.save(meeting); | ||||
if (meetingBasic.getIsInnerProject()) { | |||||
List<MeetingInnerProject> 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<MeetingOuterProject> 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<MeetingInnerProject> 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<MeetingOuterProject> 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); | expertInviteByCreate(inviteRule); | ||||
return IdVo.of(meeting.getId()); | return IdVo.of(meeting.getId()); | ||||
} finally { | } finally { | ||||
@@ -445,30 +448,37 @@ public class MeetingManage { | |||||
.inviteType(meeting.getInviteType()) | .inviteType(meeting.getInviteType()) | ||||
.confirmedRoster(meeting.getConfirmedRoster()) | .confirmedRoster(meeting.getConfirmedRoster()) | ||||
.invitedStopped(meeting.getInviteStatus()) | .invitedStopped(meeting.getInviteStatus()) | ||||
.attachFiles(meeting.getAttachFiles()) | |||||
.description(meeting.getDescription()) | |||||
.resultDescription(meeting.getResultDescription()) | |||||
.resultAttachFiles(meeting.getResultAttachFiles()) | |||||
.remark(meeting.getRemark()) | |||||
.build(); | .build(); | ||||
if (meeting.getIsInnerProject()) { | |||||
List<MeetingInnerProject> innerProjects = meetingInnerProjectService.listByMeetingId(meetingId); | |||||
List<Project> projects = projectService.listByIds(CollUtils.fieldList(innerProjects, MeetingInnerProject::getProjectId)); | |||||
Map<Long, ExpertReview> reviewMap = expertReviewService.listFinalReviewMap(meetingId); | |||||
List<MeetingReviewProjectDTO> 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<MeetingOuterProject> outerProjects = meetingOuterProjectService.listByMeetingId(meetingId); | |||||
detail.setProjects(BeanUtil.copyToList(outerProjects, MeetingReviewProjectDTO.class)); | |||||
if (meeting.getIsInnerProject() != null) { | |||||
if (Boolean.TRUE.equals(meeting.getIsInnerProject())) { | |||||
List<MeetingInnerProject> innerProjects = meetingInnerProjectService.listByMeetingId(meetingId); | |||||
List<Project> projects = projectService.listByIds(CollUtils.fieldList(innerProjects, MeetingInnerProject::getProjectId)); | |||||
Map<Long, ExpertReview> reviewMap = expertReviewService.listFinalReviewMap(meetingId); | |||||
List<MeetingReviewProjectDTO> 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<MeetingOuterProject> outerProjects = meetingOuterProjectService.listByMeetingId(meetingId); | |||||
detail.setProjects(BeanUtil.copyToList(outerProjects, MeetingReviewProjectDTO.class)); | |||||
} | |||||
} | } | ||||
detail.setInviteRule(inviteRuleDetail(meetingId)); | detail.setInviteRule(inviteRuleDetail(meetingId)); | ||||
return detail; | return detail; | ||||
@@ -518,7 +528,7 @@ public class MeetingManage { | |||||
statistics.setInviteCnt(v.getInviteCount()); | statistics.setInviteCnt(v.getInviteCount()); | ||||
List<MeetingExpert> expertList = groupByRule.get(k); | List<MeetingExpert> expertList = groupByRule.get(k); | ||||
if (expertList != null) { | if (expertList != null) { | ||||
expertList.forEach((expert) -> { | |||||
expertList.forEach(expert -> { | |||||
if (AGREED.eq(expert.getStatus())) { | if (AGREED.eq(expert.getStatus())) { | ||||
statistics.incrAgreeCnt(); | statistics.incrAgreeCnt(); | ||||
} | } | ||||
@@ -934,4 +944,22 @@ public class MeetingManage { | |||||
query.and(q1 -> q1.notExists(sql).or(q2 -> q2.apply(sql2))); | 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<Meeting> 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); | |||||
} | |||||
} | } |
@@ -15,23 +15,45 @@ import java.util.List; | |||||
@Getter | @Getter | ||||
public enum DictExpertInfoTypeEnum { | public enum DictExpertInfoTypeEnum { | ||||
// 政治面貌 | |||||
/** | |||||
* 政治面貌 | |||||
*/ | |||||
POLITICAL("political"), | POLITICAL("political"), | ||||
// 学历 | |||||
/** | |||||
* 学历 | |||||
*/ | |||||
EDU("edu"), | EDU("edu"), | ||||
// 学位 | |||||
/** | |||||
* 学位 | |||||
*/ | |||||
DEGREE("degree"), | DEGREE("degree"), | ||||
// 在职状态 | |||||
/** | |||||
* 在职状态 | |||||
*/ | |||||
JOB_STATUS("job_status"), | JOB_STATUS("job_status"), | ||||
// 行政职级 | |||||
/** | |||||
* 行政职级 | |||||
*/ | |||||
ADMINISTRATIVE_RANK("administrative_rank"), | ADMINISTRATIVE_RANK("administrative_rank"), | ||||
// 内外围(专家类型) | |||||
/** | |||||
* 内外围(专家类型) | |||||
*/ | |||||
EXPERT_TYPE("expert_type"), | EXPERT_TYPE("expert_type"), | ||||
// 单位类型 | |||||
/** | |||||
* 所属专家库 | |||||
*/ | |||||
EXPERT_LIBRARY("expert_library"), | |||||
/** | |||||
* 单位类型 | |||||
*/ | |||||
COMPANY_ATTRIBUTE("company_attribute"), | COMPANY_ATTRIBUTE("company_attribute"), | ||||
// 职称级别 | |||||
/** | |||||
* 职称级别 | |||||
*/ | |||||
TITLE_LEVEL("title_level"), | TITLE_LEVEL("title_level"), | ||||
// 推荐方式 | |||||
/** | |||||
* 推荐方式 | |||||
*/ | |||||
RECOMMENDED_WAY("recommended_way"); | RECOMMENDED_WAY("recommended_way"); | ||||