From a09c445b403d580bde2c6db6c7df929be811d448 Mon Sep 17 00:00:00 2001 From: WendyYang Date: Fri, 18 Aug 2023 14:37:11 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BC=9A=E8=AE=AE?= =?UTF-8?q?=E8=AF=A6=E6=83=85=E4=B8=93=E5=AE=B6=E5=B1=82=E7=BA=A7=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/ningdatech/pmapi/meeting/manage/MeetingManage.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 c844a71..b43e8b8 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 @@ -588,7 +588,7 @@ public class MeetingManage { randomRule.setIntentionRegions(intentionRegions); } if (CollUtil.isNotEmpty(randomRule.getExpertRegionList())) { - List regions = CollUtils.convert(randomRule.getExpertRegions(), + List regions = CollUtils.convert(randomRule.getExpertRegionList(), w -> regionCache.getByCodeAndLevel(w.getRegionCode(), w.getRegionLevel())); randomRule.setExpertRegions(regions); } From eb97271e1c9b9e0c20d7879a325a32dccb1acead Mon Sep 17 00:00:00 2001 From: WendyYang Date: Fri, 18 Aug 2023 15:16:57 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BC=9A=E8=AE=AE?= =?UTF-8?q?=E8=AF=A6=E6=83=85=E4=B8=93=E5=AE=B6=E5=B1=82=E7=BA=A7=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../meeting/service/impl/MeetingServiceImpl.java | 10 +++++---- .../pmapi/meeting/task/ExpertRandomInviteTask.java | 24 ++++++++++++++-------- 2 files changed, 22 insertions(+), 12 deletions(-) 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 3f11b37..116e429 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 @@ -1,5 +1,7 @@ package com.ningdatech.pmapi.meeting.service.impl; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ningdatech.basic.util.CollUtils; import com.ningdatech.pmapi.common.model.entity.CountGroupByDTO; @@ -25,10 +27,10 @@ public class MeetingServiceImpl extends ServiceImpl impl @Override public void stopRandomInvite(Long meetingId) { - Meeting meeting = new Meeting(); - meeting.setId(meetingId); - meeting.setInviteStatus(Boolean.TRUE); - baseMapper.updateById(meeting); + LambdaUpdateWrapper update = Wrappers.lambdaUpdate(Meeting.class) + .eq(Meeting::getId, meetingId) + .set(Meeting::getInviteStatus, Boolean.TRUE); + update(update); } @Override diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/task/ExpertRandomInviteTask.java b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/task/ExpertRandomInviteTask.java index 3d04d7a..dde344d 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/task/ExpertRandomInviteTask.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/task/ExpertRandomInviteTask.java @@ -228,9 +228,9 @@ public class ExpertRandomInviteTask { public void invite(Long meetingId, Boolean reInvite, LocalDateTime tsTime) { log.info("开始进行专家后台抽取:{}", meetingId); Meeting meeting = meetingService.getById(meetingId); - if (meeting.getStartTime().isBefore(LocalDateTime.now())) { + if (meeting.getInviteStatus() || meeting.getStartTime().isBefore(LocalDateTime.now())) { log.info("会议已开始停止抽取:{}", meeting); - cancelByMeetingId(meetingId); + killTaskAndDelCacheMeetingId(meetingId); return; } // 随机邀请规则 @@ -275,9 +275,13 @@ public class ExpertRandomInviteTask { }); if (notIgnoreCnt.get() == 0 || notIgnoreCnt.get() == notSupportCnt.get()) { log.info("停止会议随机邀请:{} 未完成抽取规则数量 {} 无可抽取专家规则数量 {}", meetingId, notIgnoreCnt, notSupportCnt); - currProxy().cancelByMeetingId(meetingId); - meetingCallOrMsgHelper.sendInviteStopMsg(meeting.getCreateBy(), meetingId, meeting.getName()); + meetingService.stopRandomInvite(meetingId); + if (notIgnoreCnt.get() == notSupportCnt.get() && notIgnoreCnt.get() > 0) { + // 当未完成抽取且无专家可抽取时 + meetingCallOrMsgHelper.sendInviteStopMsg(meeting.getCreateBy(), meetingId, meeting.getName()); + } } + // 所有抽取规则抽取人数满足 自动召开会议 if (notIgnoreCnt.get() == 0 && notSupportCnt.get() == 0) { MeetingManage meetingManage = SpringUtils.getBean(MeetingManage.class); ConfirmedRosterReq req = new ConfirmedRosterReq(); @@ -287,10 +291,7 @@ public class ExpertRandomInviteTask { } } - @Transactional(rollbackFor = Exception.class) - public void cancelByMeetingId(Long meetingId) { - log.info("终止专家抽取:{}", meetingId); - meetingService.stopRandomInvite(meetingId); + private void killTaskAndDelCacheMeetingId(Long meetingId) { cachePlusOps.hDel(getCacheKey(meetingId)); ScheduledFuture future = INVITE_TASK_MAP.get(meetingId); if (future != null) { @@ -301,6 +302,13 @@ public class ExpertRandomInviteTask { } } + @Transactional(rollbackFor = Exception.class) + public void cancelByMeetingIdAndKillTask(Long meetingId) { + log.info("终止专家抽取:{}", meetingId); + meetingService.stopRandomInvite(meetingId); + killTaskAndDelCacheMeetingId(meetingId); + } + //================================================================================================================== private Map countByAttendStatus(Map expertMap) { From a26d1ada43518d7fc423da44bbeefa2603e21571 Mon Sep 17 00:00:00 2001 From: WendyYang Date: Fri, 18 Aug 2023 15:17:57 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BC=9A=E8=AE=AE?= =?UTF-8?q?=E8=AF=A6=E6=83=85=E4=B8=93=E5=AE=B6=E5=B1=82=E7=BA=A7=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ningdatech/pmapi/meeting/manage/MeetingManage.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 b43e8b8..2d3785e 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 @@ -199,7 +199,7 @@ public class MeetingManage { if (!MeetingStatusEnum.NORMAL.eq(meeting.getStatus())) { throw BizException.wrap("转换失败,请刷新后重试"); } - expertRandomInviteTask.cancelByMeetingId(meetingId); + expertRandomInviteTask.cancelByMeetingIdAndKillTask(meetingId); LambdaUpdateWrapper meetingUpdate = Wrappers.lambdaUpdate(Meeting.class) .set(Meeting::getInviteType, APPOINT.getCode()) .eq(Meeting::getId, meetingId); @@ -654,7 +654,7 @@ public class MeetingManage { } public void stopRandomInvite(Long meetingId) { - expertRandomInviteTask.cancelByMeetingId(meetingId); + expertRandomInviteTask.cancelByMeetingIdAndKillTask(meetingId); } @Transactional(rollbackFor = Exception.class) @@ -676,7 +676,7 @@ public class MeetingManage { .set(Meeting::getStatus, MeetingStatusEnum.CANCELED.getCode()) .eq(Meeting::getId, meetingId); meetingService.update(meetingUpdate); - expertRandomInviteTask.cancelByMeetingId(meetingId); + expertRandomInviteTask.cancelByMeetingIdAndKillTask(meetingId); // 发送通知给专家 List experts = meetingExpertService.listAgreedExperts(meetingId); if (!experts.isEmpty()) { From d982751874d6b41cf5f6c9f5d07453b6d4b2b59e Mon Sep 17 00:00:00 2001 From: WendyYang Date: Thu, 24 Aug 2023 16:18:38 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E6=9D=A1=E7=BA=BF=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E4=B8=8D=E9=89=B4=E6=9D=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pmapi/src/main/resources/security/auth-dev.yml | 2 ++ pmapi/src/main/resources/security/auth-pre.yml | 2 ++ pmapi/src/main/resources/security/auth-prod.yml | 2 ++ 3 files changed, 6 insertions(+) diff --git a/pmapi/src/main/resources/security/auth-dev.yml b/pmapi/src/main/resources/security/auth-dev.yml index 5c76021..4672696 100644 --- a/pmapi/src/main/resources/security/auth-dev.yml +++ b/pmapi/src/main/resources/security/auth-dev.yml @@ -37,6 +37,7 @@ security: - /api/v1/zwdd/pull/** - /api/v1/irs/** - /api/v1/wps-convert/** + - /api/v1/belong-org/business-strip/list ignore-csrf-urls: - /api/v1/user/auth/** - /v2/api-docs @@ -66,6 +67,7 @@ security: - /api/v1/zwdd/pull/** - /api/v1/irs/** - /api/v1/wps-convert/** + - /api/v1/belong-org/business-strip/list role-map: "engineer": "project_manager": diff --git a/pmapi/src/main/resources/security/auth-pre.yml b/pmapi/src/main/resources/security/auth-pre.yml index 5c76021..4672696 100644 --- a/pmapi/src/main/resources/security/auth-pre.yml +++ b/pmapi/src/main/resources/security/auth-pre.yml @@ -37,6 +37,7 @@ security: - /api/v1/zwdd/pull/** - /api/v1/irs/** - /api/v1/wps-convert/** + - /api/v1/belong-org/business-strip/list ignore-csrf-urls: - /api/v1/user/auth/** - /v2/api-docs @@ -66,6 +67,7 @@ security: - /api/v1/zwdd/pull/** - /api/v1/irs/** - /api/v1/wps-convert/** + - /api/v1/belong-org/business-strip/list role-map: "engineer": "project_manager": diff --git a/pmapi/src/main/resources/security/auth-prod.yml b/pmapi/src/main/resources/security/auth-prod.yml index 5c76021..4672696 100644 --- a/pmapi/src/main/resources/security/auth-prod.yml +++ b/pmapi/src/main/resources/security/auth-prod.yml @@ -37,6 +37,7 @@ security: - /api/v1/zwdd/pull/** - /api/v1/irs/** - /api/v1/wps-convert/** + - /api/v1/belong-org/business-strip/list ignore-csrf-urls: - /api/v1/user/auth/** - /v2/api-docs @@ -66,6 +67,7 @@ security: - /api/v1/zwdd/pull/** - /api/v1/irs/** - /api/v1/wps-convert/** + - /api/v1/belong-org/business-strip/list role-map: "engineer": "project_manager":