From 283804d643a8bc4bdcf41cbf2580318dfcae9a12 Mon Sep 17 00:00:00 2001 From: CMM <2198256324@qq.com> Date: Mon, 13 May 2024 17:17:58 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A8=E9=80=81=E4=BC=9A=E8=AE=AE=E4=B8=93?= =?UTF-8?q?=E5=AE=B6=E4=BF=A1=E6=81=AF=E6=8E=A5=E5=8F=A3=E8=B0=83=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/hz/pm/api/external/MhApiClient.java | 16 ++++++ .../meeting/entity/dto/ExpertInvitedRecordDTO.java | 13 +++++ .../meeting/entity/vo/InviteExpertListItemVO.java | 14 +++++ .../api/meeting/entity/vo/MeetingByManagerVO.java | 12 +++++ .../hz/pm/api/meeting/manage/MeetingManage.java | 63 +++++++++++++++++++++- .../pm/api/meeting/mapper/MeetingExpertMapper.xml | 5 +- .../OpenApiMeetingExpertInfoController.java | 8 ++- .../manage/OpenApiMeetingExpertInfoManage.java | 54 +++++++++++++++++-- .../api/open/model/po/ReqMeetingExpertSignPO.java | 45 ++++++++++++++++ .../com/hz/pm/api/open/model/vo/ExpertInfoVO.java | 6 +++ 10 files changed, 229 insertions(+), 7 deletions(-) create mode 100644 hz-pm-api/src/main/java/com/hz/pm/api/open/model/po/ReqMeetingExpertSignPO.java diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/external/MhApiClient.java b/hz-pm-api/src/main/java/com/hz/pm/api/external/MhApiClient.java index a3d97a7..26be49a 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/external/MhApiClient.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/external/MhApiClient.java @@ -9,6 +9,7 @@ import cn.hutool.json.JSONUtil; import com.hz.pm.api.common.util.EnvironmentUtil; import com.hz.pm.api.external.model.dto.*; import com.hz.pm.api.external.model.enumeration.MhDictType; +import com.hz.pm.api.open.model.vo.MeetingExpertInfoVO; import com.ningdatech.basic.exception.BizException; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -56,6 +57,7 @@ public class MhApiClient { private static final String PURCHASE_NOTICE = "/buy_notice/saveBuyNoticeList"; private static final String PURCHASE_NOTICE_GET = "/buy_notice/getBuyIdeaList"; + private static final String PUSH_MEETING_EXPERTS_DATA = "/meeting/saveData"; /** * 信创符合性测评报告相关接口 @@ -189,4 +191,18 @@ public class MhApiClient { throw BizException.wrap("获取测评报告失败"); } + public void pushMeetingAndExpertsDataToMh(MeetingExpertInfoVO data) { + if (environmentUtil.isDevEnv()) { + return; + } + String requestUrl = mhApiHost + PUSH_MEETING_EXPERTS_DATA; + String retBody = HttpUtil.post(requestUrl, JSONUtil.toJsonStr(data)); + MhRetDTO retObj = JSONUtil.toBean(retBody, + new TypeReference>() { + }, false); + if (!retObj.isOk()) { + log.error("会议专家信息推送失败:{}", retBody); + throw BizException.wrap("会议专家信息推送失败"); + } + } } diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/dto/ExpertInvitedRecordDTO.java b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/dto/ExpertInvitedRecordDTO.java index 4d60266..e21fd01 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/dto/ExpertInvitedRecordDTO.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/dto/ExpertInvitedRecordDTO.java @@ -1,5 +1,6 @@ package com.hz.pm.api.meeting.entity.dto; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.time.LocalDateTime; @@ -27,4 +28,16 @@ public class ExpertInvitedRecordDTO { private LocalDateTime createOn; + /** + * 20240513 新增字段 + */ + @ApiModelProperty("专家签到状态") + private Boolean signStatus; + + @ApiModelProperty("专家签到时间") + private LocalDateTime signTime; + + @ApiModelProperty("专家签到地点") + private String signAddress; + } diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/vo/InviteExpertListItemVO.java b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/vo/InviteExpertListItemVO.java index 1784b4f..3458121 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/vo/InviteExpertListItemVO.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/vo/InviteExpertListItemVO.java @@ -50,4 +50,18 @@ public class InviteExpertListItemVO extends ExpertBasicInfoVO { @ApiModelProperty("通知时间") private LocalDateTime noticeTime; + /** + * 20240511 新增字段 + */ + @ApiModelProperty("专家签到状态") + private Boolean signStatus; + + @ApiModelProperty("专家签到时间") + private LocalDateTime signTime; + + @ApiModelProperty("专家签到地点") + private String signAddress; + + + } \ No newline at end of file diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/vo/MeetingByManagerVO.java b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/vo/MeetingByManagerVO.java index 5b70ac0..ee1792c 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/vo/MeetingByManagerVO.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/vo/MeetingByManagerVO.java @@ -87,4 +87,16 @@ public class MeetingByManagerVO { @ApiModelProperty("所有项目是否已上传评审结果") private Boolean allProjectReviewed; + /** + * 20240513 新增字段 + */ + @ApiModelProperty("专家签到状态") + private Boolean signStatus; + + @ApiModelProperty("专家签到时间") + private LocalDateTime signTime; + + @ApiModelProperty("专家签到地点") + private String signAddress; + } 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 bff0f4e..33e766b 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 @@ -2,6 +2,8 @@ package com.hz.pm.api.meeting.manage; import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.map.MapUtil; +import cn.hutool.core.util.ObjUtil; import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; import cn.hutool.crypto.SecureUtil; @@ -12,10 +14,12 @@ 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.google.common.collect.Sets; import com.hz.pm.api.common.helper.RegionCacheHelper; import com.hz.pm.api.common.model.constant.BizConst; import com.hz.pm.api.expert.entity.ExpertUserFullInfo; import com.hz.pm.api.expert.service.IExpertUserFullInfoService; +import com.hz.pm.api.external.MhApiClient; import com.hz.pm.api.gov.service.IBelongOrgService; import com.hz.pm.api.meeting.builder.ExpertInviteBuilder; import com.hz.pm.api.meeting.builder.MeetingReviewProjectBuilder; @@ -35,12 +39,17 @@ import com.hz.pm.api.meeting.service.*; import com.hz.pm.api.meeting.task.ExpertRandomInviteTask; import com.hz.pm.api.meta.helper.DictionaryCache; import com.hz.pm.api.meta.helper.TagCache; +import com.hz.pm.api.open.model.vo.ExpertInfoVO; +import com.hz.pm.api.open.model.vo.MeetingExpertInfoVO; import com.hz.pm.api.organization.service.IDingOrganizationService; 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.IProjectService; import com.hz.pm.api.sys.model.dto.RegionDTO; +import com.hz.pm.api.user.model.entity.UserInfo; +import com.hz.pm.api.user.security.model.UserFullInfoDTO; import com.hz.pm.api.user.security.model.UserInfoDetails; +import com.hz.pm.api.user.service.IUserInfoService; import com.hz.pm.api.user.util.LoginUserUtil; import com.ningdatech.basic.exception.BizException; import com.ningdatech.basic.model.IdVo; @@ -94,6 +103,8 @@ public class MeetingManage { private final MeetingNotifyHelper meetingNotifyHelper; private final IMeetingExpertJudgeService expertJudgeService; private final IMeetingExpertJudgeService meetingExpertJudgeService; + private final MhApiClient mhApiClient; + private final IUserInfoService userInfoService; private static final String INVITED_RULE_CREATE = "INVITED_RULE_CREATE:"; @@ -347,6 +358,9 @@ public class MeetingManage { if (judge != null) { item.setJudgeScore(judge.getScore()); } + item.setSignStatus(info.getSignStatus()); + item.setSignTime(info.getSignTime()); + item.setSignAddress(info.getSignAddress()); result.getRecords().add(item); }); return result; @@ -509,6 +523,9 @@ public class MeetingManage { ExpertInviteRule rule = ruleMap.get(me.getRuleId()); item.setInviteType(rule == null ? APPOINT.getCode() : rule.getInviteType()); item.setNoticeStatus(NOTICING.eq(me.getStatus()) ? "通知中" : "已通知"); + item.setSignStatus(me.getSignStatus()); + item.setSignTime(me.getSignTime()); + item.setSignAddress(me.getSignAddress()); return item; }; List inviteRules = inviteRuleService.listByMeetingId(meetingId); @@ -827,14 +844,17 @@ public class MeetingManage { if (!MeetingStatusEnum.NORMAL.eq(meeting.getStatus())) { throw BizException.wrap("请刷新后重试!"); } + List experts = meetingExpertService.listAgreedExperts(meetingId); if (!meeting.getConfirmedRoster()) { // 首次确认的 LambdaUpdateWrapper update = Wrappers.lambdaUpdate(Meeting.class); update.set(Meeting::getConfirmedRoster, Boolean.TRUE); update.eq(Meeting::getId, meetingId); meetingService.update(update); + // 将已确认专家名单的当前会议信息和专家数据同步到信创 + MeetingExpertInfoVO data = getMeetingExpertInfoVO(meeting, experts); + mhApiClient.pushMeetingAndExpertsDataToMh(data); } - List experts = meetingExpertService.listAgreedExperts(meetingId); List expertNoticing = experts.stream() .filter(w -> meeting.getConfirmedRoster() || !w.getConfirmedRoster()) .collect(Collectors.toList()); @@ -850,6 +870,47 @@ public class MeetingManage { } finally { distributedLock.releaseLock(key); } + + } + + private MeetingExpertInfoVO getMeetingExpertInfoVO(Meeting meeting, List experts) { + MeetingExpertInfoVO data = new MeetingExpertInfoVO(); + data.setMeetingId(meeting.getId()); + data.setStartTime(meeting.getStartTime()); + data.setEndTime(meeting.getEndTime()); + data.setMeetingName(meeting.getName()); + data.setMeetingAddress(meeting.getMeetingAddress()); + data.setConnecter(meeting.getConnecter()); + data.setContact(meeting.getContact()); + // 获取未签到的专家信息 + List expertList = experts.stream().filter(m -> Boolean.FALSE.equals(m.getSignStatus())).collect(Collectors.toList()); + Set userIds = expertList.stream().map(MeetingExpert::getExpertId).collect(Collectors.toSet()); + List userInfoList = userInfoService.list(Wrappers.lambdaQuery(UserInfo.class).in(UserInfo::getId, userIds)); + Map userInfoMap = userInfoList.stream().collect(Collectors.toMap(UserInfo::getId, v -> v)); + List userIdList = new ArrayList<>(userIds); + List expertUserFullInfos = expertUserFullInfoService.listByUserIds(userIdList); + Map userFullInfoMap = MapUtil.newHashMap(); + if(CollUtil.isNotEmpty(expertUserFullInfos)){ + userFullInfoMap = expertUserFullInfos.stream().collect(Collectors.toMap(ExpertUserFullInfo::getUserId, v -> v)); + } + Map finalUserFullInfoMap = userFullInfoMap; + data.setExpertInfoList(CollUtils.fieldList(experts, w -> { + ExpertInfoVO expertInfoVO = new ExpertInfoVO(); + expertInfoVO.setUserId(w.getExpertId()); + expertInfoVO.setName(w.getExpertName()); + expertInfoVO.setPhoneNo(w.getMobile()); + ExpertUserFullInfo expertUserFullInfo = finalUserFullInfoMap.get(w.getExpertId()); + if (Objects.nonNull(expertUserFullInfo)) { + expertInfoVO.setMhExpertId(expertUserFullInfo.getMhExpertId()); + } + UserInfo userInfo = userInfoMap.get(w.getExpertId()); + if (Objects.nonNull(userInfo)) { + expertInfoVO.setMhUnitId(userInfo.getMhUnitId()); + expertInfoVO.setMhUnitName(userInfo.getMhUnitName()); + } + return expertInfoVO; + })); + return data; } public PageVo pageReviewProject(ReviewProjectListReq req) { diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/mapper/MeetingExpertMapper.xml b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/mapper/MeetingExpertMapper.xml index 2df10ea..1306cee 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/mapper/MeetingExpertMapper.xml +++ b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/mapper/MeetingExpertMapper.xml @@ -4,9 +4,10 @@