From b2418eff060e38a737f8ea74b7861fff83dd78d1 Mon Sep 17 00:00:00 2001 From: WendyYang Date: Tue, 7 Mar 2023 15:48:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BC=9A=E8=AE=AE=E5=88=97?= =?UTF-8?q?=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../meeting/controller/MeetingController.java | 16 +++--- .../pmapi/meeting/entity/domain/Meeting.java | 4 +- .../pmapi/meeting/entity/req/MeetingListReq.java | 16 +++--- .../meeting/entity/vo/MeetingByManagerVO.java | 60 +++++++++------------- .../pmapi/meeting/helper/MeetingManageHelper.java | 46 +++++++++-------- .../pmapi/meeting/manage/MeetingManage.java | 27 +++------- .../meeting/service/impl/MeetingServiceImpl.java | 2 +- .../pmapi/meeting/task/ExpertInviteTask.java | 2 +- .../meta/helper/basic/AbstractDictionaryCache.java | 2 +- 9 files changed, 79 insertions(+), 96 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/controller/MeetingController.java b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/controller/MeetingController.java index 7a49a53..5ea0587 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/controller/MeetingController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/controller/MeetingController.java @@ -52,16 +52,16 @@ public class MeetingController { return meetingManage.expertCountOnChange(po); } - @ApiOperation("专家抽取员会议列表") - @GetMapping("/meetingListByManager") - @WebLog(value = "专家抽取员事务列表") - public PageVo meetingListByManager(MeetingListReq po) { - return meetingManage.meetingListByManager(po); + @ApiOperation("管理员会议列表") + @GetMapping("/manager/meetingList") + @WebLog(value = "管理员会议列表") + public PageVo meetingListByManager(MeetingListReq req) { + return meetingManage.meetingListByManager(req); } - @ApiOperation("履职记录 | 专家会议列表") - @GetMapping("/meetingListByExpert") - @WebLog(value = "履职记录 | 专家会议列表") + @ApiOperation("专家会议列表") + @GetMapping("/expert/meetingList") + @WebLog(value = "专家会议列表") public PageVo meetingListByExpert(MeetingListReq po) { return meetingManage.meetingListByExpert(po); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/domain/Meeting.java b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/domain/Meeting.java index 0b44fb0..548964d 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/domain/Meeting.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/domain/Meeting.java @@ -62,8 +62,8 @@ public class Meeting implements Serializable { private Integer status; - @ApiModelProperty("是否停止随机邀请") - private Boolean inviteStopped; + @ApiModelProperty("抽取状态") + private Boolean inviteStatus; @ApiModelProperty("是否确认名单") private Boolean confirmedRoster; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/req/MeetingListReq.java b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/req/MeetingListReq.java index b472592..7375f3a 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/req/MeetingListReq.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/req/MeetingListReq.java @@ -22,28 +22,28 @@ import java.time.LocalDateTime; @EqualsAndHashCode(callSuper = true) public class MeetingListReq extends PagePo { - @ApiModelProperty("事务名称") + @ApiModelProperty("会议名称") private String name; - @ApiModelProperty("事务开始时间") + @ApiModelProperty("会议开始时间") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") private LocalDateTime startTime; - @ApiModelProperty("事务结束时间") + @ApiModelProperty("会议结束时间") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") private LocalDateTime endTime; - @ApiModelProperty("地点") - private String address; - @ApiModelProperty("事务状态:1 未完成、2 已完成、3 已取消\n" + "专家参与状态:1 待参加、2 已参加、3 已请假") private Integer status; - @ApiModelProperty("事务类型") - private String type; + @ApiModelProperty("会议类型") + private String meetingType; @ApiModelProperty("专家ID") private Long expertId; + @ApiModelProperty("项目名称") + private String projectName; + } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/vo/MeetingByManagerVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/vo/MeetingByManagerVO.java index 424e503..2997259 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/vo/MeetingByManagerVO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/vo/MeetingByManagerVO.java @@ -26,51 +26,39 @@ public class MeetingByManagerVO { public MeetingByManagerVO() { } - @ApiModelProperty("事务ID") - private Long id; + @ApiModelProperty("会议ID") + private Long meetingId; - @ApiModelProperty("事务状态") - private Integer status; - - @ApiModelProperty("会议参加状态:1 待参加、2 已参加、3 已请假") - private Integer attendStatus; - - @ApiModelProperty("事务名称") - private String name; - - @ApiModelProperty("联系人") - private String connecter; - - @ApiModelProperty("联系方式") - private String contact; - - @ApiModelProperty("会议地址详情") - private String meetingAddress; - - @ApiModelProperty("事务类型编码") - private String dateType; - - @ApiModelProperty("事务类型名称") - private String dateTypeName; - - @ApiModelProperty("事务开始时间") + @ApiModelProperty("会议开始时间") @JSONField(format = "yyyy-MM-dd HH:mm") private LocalDateTime startTime; - @ApiModelProperty("事务结束时间") + @ApiModelProperty("会议结束时间") @JSONField(format = "yyyy-MM-dd HH:mm") private LocalDateTime endTime; - @ApiModelProperty("邀请人数") - private Integer inviteCount; + @ApiModelProperty("会议状态") + private Integer status; + + @ApiModelProperty("抽取类型") + private Integer inviteType; + + @ApiModelProperty("抽取状态") + private Boolean inviteStatus; + + @ApiModelProperty("名单确认状态") + private Boolean confirmedRoster; + + @ApiModelProperty("会议参加状态:1 待参加、2 已参加、3 已请假") + private Integer attendStatus; - @ApiModelProperty("确认人数") - private Integer confirmCount; + @ApiModelProperty("会议名称") + private String meetingName; - @ApiModelProperty("是否进行了专家抽取:true 是、false 否") - private Boolean invited; + @ApiModelProperty("会议类型编码") + private String meetingType; - @ApiModelProperty("抽取单位") - private String holdOrg; + @ApiModelProperty("会议类型名称") + private String meetingTypeName; } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/helper/MeetingManageHelper.java b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/helper/MeetingManageHelper.java index 78f7d33..faf2e92 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/helper/MeetingManageHelper.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/helper/MeetingManageHelper.java @@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.ningdatech.basic.exception.BizException; import com.ningdatech.basic.util.CollUtils; import com.ningdatech.pmapi.common.util.BizUtils; +import com.ningdatech.pmapi.common.util.StrUtils; import com.ningdatech.pmapi.expert.constant.ExpertAccountStatusEnum; import com.ningdatech.pmapi.expert.entity.ExpertUserFullInfo; import com.ningdatech.pmapi.expert.service.ExpertInfoService; @@ -24,14 +25,12 @@ import com.ningdatech.pmapi.meeting.service.IExpertInviteAvoidRuleService; import com.ningdatech.pmapi.meeting.service.IExpertInviteRuleService; import com.ningdatech.pmapi.meeting.service.IMeetingExpertService; import com.ningdatech.pmapi.meta.helper.DictionaryCache; +import com.ningdatech.pmapi.meta.model.dto.DictionaryDTO; import lombok.AllArgsConstructor; import org.apache.commons.collections4.CollectionUtils; import org.springframework.stereotype.Component; -import java.util.Collection; -import java.util.Comparator; -import java.util.List; -import java.util.Map; +import java.util.*; /** *

@@ -73,32 +72,39 @@ public class MeetingManageHelper { } public MeetingByManagerVO buildByMeeting(Meeting meeting) { + DictionaryDTO dict = dictionaryCache.getByCode(meeting.getType()); return MeetingByManagerVO.builder() - .id(meeting.getId()) - .dateTypeName(dictionaryCache.getByCode(meeting.getType()).getName()) - .meetingAddress(meeting.getMeetingAddress()) - .name(meeting.getName()) + .meetingId(meeting.getId()) + .meetingTypeName(dict == null ? "" : dict.getName()) + .meetingName(meeting.getName()) .startTime(meeting.getStartTime()) .endTime(meeting.getEndTime()) - .connecter(meeting.getConnecter()) - .contact(meeting.getContact()) + .inviteType(meeting.getInviteType()) + .confirmedRoster(meeting.getConfirmedRoster()) + .inviteStatus(meeting.getInviteStatus()) .status(meeting.getStatus()) - .holdOrg(meeting.getHoldOrg()) .build(); } - public void buildMeetingQuery(LambdaQueryWrapper query, MeetingListReq po) { - if (StrUtil.isNotBlank(po.getName())) { - query.like(Meeting::getName, po.getName()); + public void buildMeetingQuery(LambdaQueryWrapper query, MeetingListReq req) { + if (StrUtil.isNotBlank(req.getName())) { + query.like(Meeting::getName, req.getName()); } - if (StrUtil.isNotBlank(po.getType())) { - query.eq(Meeting::getType, po.getType()); + if (StrUtil.isNotBlank(req.getMeetingType())) { + query.eq(Meeting::getType, req.getMeetingType()); } - if (po.getStartTime() != null) { - query.ge(Meeting::getStartTime, po.getStartTime()); + if (req.getStartTime() != null) { + query.ge(Meeting::getStartTime, req.getStartTime()); } - if (po.getEndTime() != null) { - query.le(Meeting::getEndTime, po.getEndTime()); + if (req.getEndTime() != null) { + query.le(Meeting::getEndTime, req.getEndTime()); + } + if (StrUtils.isNotBlank(req.getProjectName())) { + String projectName = "%" + req.getProjectName() + "%"; + query.and(q1 -> q1.exists("select 1 from nd_project np inner join meeting_inner_project mip on mip.project_id = np.id" + + " where mip.meeting_id = meeting.id and np.project_name like {0}", projectName) + .or(q2 -> q2.exists("select 1 from meeting_outer_project mop where mop.meeting_id = meeting.id" + + "and mop.project_name like {0}", projectName))); } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/MeetingManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/MeetingManage.java index 0fd10eb..a92d1d4 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/MeetingManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/MeetingManage.java @@ -111,7 +111,7 @@ public class MeetingManage { meeting.setHoldOrgCode(userDetail.getOrganizationCode()); meeting.setRegionCode(userDetail.getRegionCode()); meeting.setCreator(userDetail.getUsername()); - meeting.setInviteStopped(Boolean.FALSE); + meeting.setInviteStatus(Boolean.FALSE); meeting.setConfirmedRoster(Boolean.FALSE); meeting.setInviteType(inviteRule.getInviteType()); meetingService.save(meeting); @@ -166,7 +166,7 @@ public class MeetingManage { expertInviteManage.expertRandomInviteByMeetingCreate(meeting, randomRules, avoidInfo); expertInviteTask.addInviteExpertTaskByMeetingCreate(meeting.getId(), 5); LambdaUpdateWrapper update = Wrappers.lambdaUpdate(Meeting.class); - update.set(Meeting::getInviteStopped, false); + update.set(Meeting::getInviteStatus, false); update.eq(Meeting::getId, meeting.getId()); meetingService.update(update); // 回避规则 @@ -271,37 +271,26 @@ public class MeetingManage { /** * 管理员会议列表 * - * @param po 查询参数 + * @param req 查询参数 * @return 会议列表 * @author WendyYang */ - public PageVo meetingListByManager(MeetingListReq po) { + public PageVo meetingListByManager(MeetingListReq req) { LambdaQueryWrapper query = new LambdaQueryWrapper() .orderByDesc(Meeting::getCreateOn); // 补充逻辑 如果拥有超级管理员权限可以看到所有事务 if (!permissionCheckHelper.isSuperAdmin()) { query.eq(Meeting::getCreateBy, LoginUserUtil.getUserId()); } - query.eq(po.getStatus() != null, Meeting::getStatus, po.getStatus()); - meetingManageHelper.buildMeetingQuery(query, po); - Page page = meetingService.page(po.page(), query); + query.eq(req.getStatus() != null, Meeting::getStatus, req.getStatus()); + meetingManageHelper.buildMeetingQuery(query, req); + Page page = meetingService.page(req.page(), query); if (page.getTotal() == 0) { return PageVo.empty(); } PageVo result = new PageVo<>(new ArrayList<>(), page.getTotal()); - Map countConfirmMap = new HashMap<>(16); - List meetingIds = CollUtils.fieldList(page.getRecords(), Meeting::getId); - countConfirmMap.putAll(meetingExpertService.countConfirmedByMeetingIds(meetingIds)); page.getRecords().forEach(meeting -> { MeetingByManagerVO item = meetingManageHelper.buildByMeeting(meeting); - CountConfirmByMeetingIdDTO confirm = countConfirmMap.get(meeting.getId()); - if (confirm == null) { - item.setInviteCount(0); - item.setConfirmCount(0); - } else { - item.setInviteCount(confirm.getTotal()); - item.setConfirmCount(confirm.getConfirmed()); - } result.getRecords().add(item); }); return result; @@ -354,7 +343,7 @@ public class MeetingManage { throw BizException.wrap("该会议信息不存在"); } ExpertInviteDetailVO result = new ExpertInviteDetailVO(); - result.setInvitedStopped(meeting.getInviteStopped()); + result.setInvitedStopped(meeting.getInviteStatus()); result.setConfirmedRoster(meeting.getConfirmedRoster()); List experts = meetingExpertService.listByMeetingId(meetingId); if (experts.isEmpty()) { diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/service/impl/MeetingServiceImpl.java b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/service/impl/MeetingServiceImpl.java index 6611367..44be405 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/service/impl/MeetingServiceImpl.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/service/impl/MeetingServiceImpl.java @@ -27,7 +27,7 @@ public class MeetingServiceImpl extends ServiceImpl impl public void stopRandomInvite(Long meetingId) { Meeting meeting = new Meeting(); meeting.setId(meetingId); - meeting.setInviteStopped(Boolean.TRUE); + meeting.setInviteStatus(Boolean.TRUE); baseMapper.updateById(meeting); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/task/ExpertInviteTask.java b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/task/ExpertInviteTask.java index 5c984a7..fa67c65 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/task/ExpertInviteTask.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/task/ExpertInviteTask.java @@ -156,7 +156,7 @@ public class ExpertInviteTask { addInviteExpertTask(meetingId, false, properties.getInviteDelay()); log.info("重置会议的随机抽取状态:{}", meetingId); LambdaUpdateWrapper update = Wrappers.lambdaUpdate(Meeting.class); - update.set(Meeting::getInviteStopped, false); + update.set(Meeting::getInviteStatus, false); update.set(Meeting::getUpdateBy, LoginUserUtil.getUserId()); update.set(Meeting::getUpdateOn, LocalDateTime.now()); update.eq(Meeting::getId, meetingId); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/meta/helper/basic/AbstractDictionaryCache.java b/pmapi/src/main/java/com/ningdatech/pmapi/meta/helper/basic/AbstractDictionaryCache.java index 16a8b84..080acb7 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/meta/helper/basic/AbstractDictionaryCache.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/meta/helper/basic/AbstractDictionaryCache.java @@ -24,7 +24,7 @@ public abstract class AbstractDictionaryCache implements InitializingBean, Dicti @Autowired private IMetaDictionaryService iMetaDictionaryService; - protected Map dictionaryMap; + protected Map dictionaryMap = new ConcurrentHashMap<>(); protected LoadingCache> dictionaryCacheHelper; @Override