Browse Source

修复指定专家

master
WendyYang 1 year ago
parent
commit
ac5a57744c
3 changed files with 26 additions and 14 deletions
  1. +18
    -9
      pmapi/src/main/java/com/ningdatech/pmapi/meeting/helper/MeetingManageHelper.java
  2. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/MeetingManage.java
  3. +7
    -4
      pmapi/src/main/java/com/ningdatech/pmapi/organization/service/impl/DingOrganizationServiceImpl.java

+ 18
- 9
pmapi/src/main/java/com/ningdatech/pmapi/meeting/helper/MeetingManageHelper.java View File

@@ -23,6 +23,7 @@ import com.ningdatech.pmapi.meeting.entity.dto.MeetingAndAttendStatusDTO;
import com.ningdatech.pmapi.meeting.entity.dto.MeetingBasicDTO;
import com.ningdatech.pmapi.meeting.entity.dto.RandomInviteRuleDTO;
import com.ningdatech.pmapi.meeting.entity.enumeration.ExpertAttendStatusEnum;
import com.ningdatech.pmapi.meeting.entity.enumeration.ExpertInviteTypeEnum;
import com.ningdatech.pmapi.meeting.entity.req.MeetingListReq;
import com.ningdatech.pmapi.meeting.entity.vo.ExpertBasicInfoVO;
import com.ningdatech.pmapi.meeting.entity.vo.MeetingByManagerVO;
@@ -194,20 +195,28 @@ public class MeetingManageHelper {
/**
* 校验是否能够进行指定邀请
*
* @param meetingId 会议ID
* @param expertIds 专家ID
* @param meetingId 会议ID
* @param expertIds 专家ID
* @param inviteType 邀请类型
* @return 符合邀请规则的专家
* @author WendyYang
**/
public List<ExpertUserFullInfo> appointExpertCheck(Long meetingId, List<Long> expertIds) {
public List<ExpertUserFullInfo> appointExpertCheck(Long meetingId, Integer inviteType, List<Long> expertIds) {
List<ExpertUserFullInfo> experts = expertUserFullInfoService.listByUserId(expertIds);
AvoidRuleDTO avoidRule = getAvoidInfoDto(meetingId);
AvoidRuleDTO avoidRule;
if (ExpertInviteTypeEnum.RANDOM.eq(inviteType)) {
avoidRule = getAvoidInfoDto(meetingId);
} else {
avoidRule = null;
}
experts.forEach(expert -> {
if (avoidRule.getAvoidUnitIdList().contains(expert.getCompany())) {
throw BizException.wrap("请移除已回避单位的专家");
}
if (CollectionUtils.isNotEmpty(avoidRule.getExpertIds()) && avoidRule.getExpertIds().contains(expert.getUserId())) {
throw BizException.wrap("请移除已回避的专家");
if (avoidRule != null) {
if (avoidRule.getAvoidUnitIdList().contains(expert.getCompany())) {
throw BizException.wrap("请移除已回避单位的专家");
}
if (CollectionUtils.isNotEmpty(avoidRule.getExpertIds()) && avoidRule.getExpertIds().contains(expert.getUserId())) {
throw BizException.wrap("请移除已回避的专家");
}
}
// 校验专家状态
ExpertAccountStatusEnum accountStatus = ExpertAccountStatusEnum.of(expert.getExpertAccountStatus());


+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/MeetingManage.java View File

@@ -559,7 +559,7 @@ public class MeetingManage {
throw BizException.wrap("补充专家失败");
}
AppointInviteRuleDTO rule = inviteRuleService.appointRuleByMeetingId(meetingId);
List<ExpertUserFullInfo> userInfos = meetingManageHelper.appointExpertCheck(meetingId, req.getExpertIdList());
List<ExpertUserFullInfo> userInfos = meetingManageHelper.appointExpertCheck(meetingId, meeting.getInviteType(), req.getExpertIdList());
List<MeetingExpert> expertList = CollUtils.convert(userInfos, w -> {
MeetingExpert me = ExpertInviteBuilder.getExpertByAppoint(meetingId, w, rule.getId());
me.setStatus(ExpertAttendStatusEnum.NOTICING.getCode());


+ 7
- 4
pmapi/src/main/java/com/ningdatech/pmapi/organization/service/impl/DingOrganizationServiceImpl.java View File

@@ -11,7 +11,10 @@ import com.ningdatech.pmapi.organization.model.entity.DingOrganization;
import com.ningdatech.pmapi.organization.service.IDingOrganizationService;
import org.springframework.stereotype.Service;

import java.util.*;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

/**
@@ -58,7 +61,7 @@ public class DingOrganizationServiceImpl extends ServiceImpl<DingOrganizationMap
public List<String> listNameByCodes(Collection<String> codes) {
LambdaQueryWrapper<DingOrganization> query = Wrappers.lambdaQuery(DingOrganization.class)
.select(DingOrganization::getOrganizationName)
.eq(DingOrganization::getOrganizationCode, codes);
.in(DingOrganization::getOrganizationCode, codes);
return CollUtils.fieldList(list(query), DingOrganization::getOrganizationName);
}

@@ -76,7 +79,7 @@ public class DingOrganizationServiceImpl extends ServiceImpl<DingOrganizationMap
orgCodeList = orgCodeList.stream().distinct().collect(Collectors.toList());
List<DingOrganization> dingOrganizationList = listByCodes(orgCodeList);
return dingOrganizationList.stream()
.filter(r -> StringUtils.isNotBlank(r.getOrganizationCode()) && Objects.nonNull(r))
.collect(Collectors.toMap(DingOrganization::getOrganizationCode, r->r));
.filter(r -> StringUtils.isNotBlank(r.getOrganizationCode()))
.collect(Collectors.toMap(DingOrganization::getOrganizationCode, r -> r));
}
}

Loading…
Cancel
Save