WendyYang 8 місяці тому
джерело
коміт
71c6932ad8
3 змінених файлів з 44 додано та 43 видалено
  1. +1
    -1
      hz-pm-api/src/main/java/com/hz/pm/api/expert/service/IExpertUserFullInfoService.java
  2. +2
    -1
      hz-pm-api/src/main/java/com/hz/pm/api/expert/service/impl/ExpertUserFullInfoServiceImpl.java
  3. +41
    -41
      hz-pm-api/src/main/java/com/hz/pm/api/meeting/manage/MeetingManage.java

+ 1
- 1
hz-pm-api/src/main/java/com/hz/pm/api/expert/service/IExpertUserFullInfoService.java Переглянути файл

@@ -34,7 +34,7 @@ public interface IExpertUserFullInfoService extends IService<ExpertUserFullInfo>
* @param userIds 用户ID
* @return /
*/
List<ExpertUserFullInfo> listByUserIds(List<Long> userIds);
List<ExpertUserFullInfo> listByUserIds(Collection<Long> userIds);

default List<String> listCompanyUniqCodeByUserIds(Collection<Long> userIds) {
LambdaQueryWrapper<ExpertUserFullInfo> query = Wrappers


+ 2
- 1
hz-pm-api/src/main/java/com/hz/pm/api/expert/service/impl/ExpertUserFullInfoServiceImpl.java Переглянути файл

@@ -7,6 +7,7 @@ import com.hz.pm.api.expert.mapper.ExpertUserFullInfoMapper;
import com.hz.pm.api.expert.service.IExpertUserFullInfoService;
import org.springframework.stereotype.Service;

import java.util.Collection;
import java.util.List;

/**
@@ -26,7 +27,7 @@ public class ExpertUserFullInfoServiceImpl extends ServiceImpl<ExpertUserFullInf
}

@Override
public List<ExpertUserFullInfo> listByUserIds(List<Long> userIds) {
public List<ExpertUserFullInfo> listByUserIds(Collection<Long> userIds) {
return list(Wrappers.<ExpertUserFullInfo>lambdaQuery().in(ExpertUserFullInfo::getUserId, userIds));
}



+ 41
- 41
hz-pm-api/src/main/java/com/hz/pm/api/meeting/manage/MeetingManage.java Переглянути файл

@@ -15,6 +15,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hz.pm.api.common.helper.RegionCacheHelper;
import com.hz.pm.api.common.model.constant.BizConst;
import com.hz.pm.api.common.util.BizUtils;
import com.hz.pm.api.expert.entity.ExpertUserFullInfo;
import com.hz.pm.api.expert.service.IExpertUserFullInfoService;
import com.hz.pm.api.external.MhApiClient;
@@ -654,11 +655,11 @@ public class MeetingManage {
if (!APPOINT.eq(meeting.getInviteType())) {
throw BizException.wrap("该会议不能指定邀请专家");
}
if (meeting.getConfirmedRoster()) {
throw BizException.wrap("补充专家失败,已确认过专家名单");
if (Boolean.TRUE.equals(meeting.getConfirmedRoster())) {
throw BizException.wrap("已确认过专家名单");
}
if (!MeetingStatusEnum.NORMAL.eq(meeting.getStatus())) {
throw BizException.wrap("补充专家失败");
throw BizException.wrap("请刷新后重试");
}
AppointInviteRuleDTO rule = inviteRuleService.appointRuleByMeetingId(meetingId);
List<ExpertUserFullInfo> userInfos = meetingManageHelper.appointExpertCheck(meetingId, meeting.getInviteType(), req.getExpertIdList());
@@ -692,21 +693,22 @@ public class MeetingManage {
if (meeting.getStartTime().isBefore(LocalDateTime.now())) {
throw BizException.wrap("会议已开始,暂时无法取消");
}
LambdaUpdateWrapper<Meeting> meetingUpdate = Wrappers.lambdaUpdate(Meeting.class)
Wrapper<Meeting> meetingUpdate = Wrappers.lambdaUpdate(Meeting.class)
.set(Meeting::getStatus, MeetingStatusEnum.CANCELED.getCode())
.eq(Meeting::getId, meetingId);
meetingService.update(meetingUpdate);
// 取消抽取任务
expertRandomInviteTask.cancelByMeetingIdAndKillTask(meetingId);
// 发送通知给专家
List<MeetingExpert> experts = meetingExpertService.listAgreedExperts(meetingId);
if (!experts.isEmpty()) {
meetingNotifyHelper.sendCancelMeetingMsg(experts, meeting);
}
// 将取消的会议推送给MH
mhApiClient.cancelMeetingToMh(meetingId);
} finally {
distributedLock.releaseLock(key);
}
// 将取消的会议推送给MH
mhApiClient.cancelMeetingToMh(meetingId);
}

public ExpertInvitationDetailVO expertInvitationDetail(Long meetingId, Long expertId) {
@@ -734,17 +736,17 @@ public class MeetingManage {

public void confirmAttendByManager(ExpertConfirmReq req) {
String key = "CONFIRM_ATTEND:" + req.getExpertMeetingId();
String msgPrefix = req.getAgreed() ? "确认参加" : "拒绝参加";
if (!distributedLock.lock(key, RETRY_TIMES)) {
throw BizException.wrap("%s失败,请重试!", msgPrefix);
throw BizException.wrap("操作失败,请重试!");
}
try {
MeetingExpert me = meetingExpertService.getById(req.getExpertMeetingId());
if (!NOTICING.eq(me.getStatus())) {
throw BizException.wrap("%s失败,请重试!", msgPrefix);
throw BizException.wrap("操作失败,请重试!");
}
LambdaUpdateWrapper<MeetingExpert> update = Wrappers.lambdaUpdate(MeetingExpert.class)
.set(MeetingExpert::getStatus, (req.getAgreed() ? AGREED : REFUSED).getCode())
Integer status = (Boolean.TRUE.equals(req.getAgreed()) ? AGREED : REFUSED).getCode();
Wrapper<MeetingExpert> update = Wrappers.lambdaUpdate(MeetingExpert.class)
.set(MeetingExpert::getStatus, status)
.eq(MeetingExpert::getId, req.getExpertMeetingId());
meetingExpertService.update(update);
} finally {
@@ -773,7 +775,7 @@ public class MeetingManage {
if (!NOTICING.eq(expert.getStatus())) {
throw BizException.wrap("已确认过的专家不允许移除!");
}
LambdaUpdateWrapper<Meeting> mUpdate = Wrappers.lambdaUpdate(Meeting.class)
Wrapper<Meeting> mUpdate = Wrappers.lambdaUpdate(Meeting.class)
.set(Meeting::getConfirmedRoster, false)
.eq(Meeting::getId, req.getMeetingId());
meetingService.update(mUpdate);
@@ -793,7 +795,7 @@ public class MeetingManage {
if (MeetingStatusEnum.CANCELED.eq(meeting.getStatus())) {
throw BizException.wrap("会议已取消");
}
LambdaUpdateWrapper<MeetingExpert> update = Wrappers.lambdaUpdate(MeetingExpert.class)
Wrapper<MeetingExpert> update = Wrappers.lambdaUpdate(MeetingExpert.class)
.set(MeetingExpert::getStatus, RELEASED.getCode())
.eq(MeetingExpert::getMeetingId, req.getMeetingId());
meetingExpertService.update(update);
@@ -813,7 +815,7 @@ public class MeetingManage {
if (MeetingStatusEnum.CANCELED.eq(meeting.getStatus())) {
throw BizException.wrap("会议已取消");
}
LambdaUpdateWrapper<MeetingExpert> cancel = Wrappers.lambdaUpdate(MeetingExpert.class)
Wrapper<MeetingExpert> cancel = Wrappers.lambdaUpdate(MeetingExpert.class)
.set(MeetingExpert::getIsHeadman, Boolean.FALSE)
.eq(MeetingExpert::getIsHeadman, Boolean.TRUE)
.eq(MeetingExpert::getMeetingId, req.getMeetingId());
@@ -823,7 +825,7 @@ public class MeetingManage {
ExpertAttendStatusEnum status = getByCode(headman.getStatus());
throw BizException.wrap("该专家处于:%s状态,不能被设置为专家组长!", status.getValue());
}
LambdaUpdateWrapper<MeetingExpert> setup = Wrappers.lambdaUpdate(MeetingExpert.class)
Wrapper<MeetingExpert> setup = Wrappers.lambdaUpdate(MeetingExpert.class)
.set(MeetingExpert::getIsHeadman, Boolean.TRUE)
.eq(MeetingExpert::getId, req.getExpertMeetingId());
meetingExpertService.update(setup);
@@ -883,33 +885,31 @@ public class MeetingManage {
data.setConnecter(meeting.getConnecter());
data.setContact(meeting.getContact());
// 获取未签到的专家信息
List<MeetingExpert> expertList = experts.stream().filter(m -> Boolean.FALSE.equals(m.getSignStatus())).collect(Collectors.toList());
Set<Long> userIds = expertList.stream().map(MeetingExpert::getExpertId).collect(Collectors.toSet());
List<UserInfo> userInfoList = userInfoService.list(Wrappers.lambdaQuery(UserInfo.class).in(UserInfo::getId, userIds));
Map<Long, UserInfo> userInfoMap = userInfoList.stream().collect(Collectors.toMap(UserInfo::getId, v -> v));
List<Long> userIdList = new ArrayList<>(userIds);
List<ExpertUserFullInfo> expertUserFullInfos = expertUserFullInfoService.listByUserIds(userIdList);
Map<Long, ExpertUserFullInfo> userFullInfoMap = MapUtil.newHashMap();
if (CollUtil.isNotEmpty(expertUserFullInfos)) {
userFullInfoMap = expertUserFullInfos.stream().collect(Collectors.toMap(ExpertUserFullInfo::getUserId, v -> v));
}
Map<Long, ExpertUserFullInfo> finalUserFullInfoMap = userFullInfoMap;
Set<Long> expertIds = experts.stream()
.filter(m -> Boolean.FALSE.equals(m.getSignStatus()))
.map(MeetingExpert::getExpertId)
.collect(Collectors.toSet());
// 用户基本信息
List<UserInfo> userInfoList = userInfoService.listByIds(expertIds);
Map<Long, UserInfo> userInfoMap = CollUtils.listToMap(userInfoList, UserInfo::getId);
List<ExpertUserFullInfo> expertUsers = expertUserFullInfoService.listByUserIds(expertIds);
Map<Long, ExpertUserFullInfo> expertUserMap = CollUtils.listToMap(expertUsers, ExpertUserFullInfo::getUserId);
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.setExpertId(expertUserFullInfo.getId());
expertInfoVO.setMhExpertId(expertUserFullInfo.getMhExpertId());
}
UserInfo userInfo = userInfoMap.get(w.getExpertId());
if (Objects.nonNull(userInfo)) {
expertInfoVO.setMhUnitId(userInfo.getMhUnitId());
expertInfoVO.setMhUnitName(userInfo.getMhUnitName());
}
return expertInfoVO;
ExpertInfoVO item = new ExpertInfoVO();
item.setUserId(w.getExpertId());
item.setName(w.getExpertName());
item.setPhoneNo(w.getMobile());
BizUtils.notNull(expertUserMap.get(w.getExpertId()), expertUser -> {
item.setExpertId(expertUser.getId());
item.setMhExpertId(expertUser.getMhExpertId());
});
BizUtils.notNull(userInfoMap.get(w.getExpertId()), user -> {
item.setMhUnitId(user.getMhUnitId());
item.setMhUnitName(user.getMhUnitName());
});
return item;
}));
return data;
}


Завантаження…
Відмінити
Зберегти