@@ -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.MeetingBasicDTO; | ||||
import com.ningdatech.pmapi.meeting.entity.dto.RandomInviteRuleDTO; | import com.ningdatech.pmapi.meeting.entity.dto.RandomInviteRuleDTO; | ||||
import com.ningdatech.pmapi.meeting.entity.enumeration.ExpertAttendStatusEnum; | 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.req.MeetingListReq; | ||||
import com.ningdatech.pmapi.meeting.entity.vo.ExpertBasicInfoVO; | import com.ningdatech.pmapi.meeting.entity.vo.ExpertBasicInfoVO; | ||||
import com.ningdatech.pmapi.meeting.entity.vo.MeetingByManagerVO; | 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 符合邀请规则的专家 | * @return 符合邀请规则的专家 | ||||
* @author WendyYang | * @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); | 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 -> { | 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()); | ExpertAccountStatusEnum accountStatus = ExpertAccountStatusEnum.of(expert.getExpertAccountStatus()); | ||||
@@ -559,7 +559,7 @@ public class MeetingManage { | |||||
throw BizException.wrap("补充专家失败"); | throw BizException.wrap("补充专家失败"); | ||||
} | } | ||||
AppointInviteRuleDTO rule = inviteRuleService.appointRuleByMeetingId(meetingId); | 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 -> { | List<MeetingExpert> expertList = CollUtils.convert(userInfos, w -> { | ||||
MeetingExpert me = ExpertInviteBuilder.getExpertByAppoint(meetingId, w, rule.getId()); | MeetingExpert me = ExpertInviteBuilder.getExpertByAppoint(meetingId, w, rule.getId()); | ||||
me.setStatus(ExpertAttendStatusEnum.NOTICING.getCode()); | me.setStatus(ExpertAttendStatusEnum.NOTICING.getCode()); | ||||
@@ -11,7 +11,10 @@ import com.ningdatech.pmapi.organization.model.entity.DingOrganization; | |||||
import com.ningdatech.pmapi.organization.service.IDingOrganizationService; | import com.ningdatech.pmapi.organization.service.IDingOrganizationService; | ||||
import org.springframework.stereotype.Service; | 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; | import java.util.stream.Collectors; | ||||
/** | /** | ||||
@@ -58,7 +61,7 @@ public class DingOrganizationServiceImpl extends ServiceImpl<DingOrganizationMap | |||||
public List<String> listNameByCodes(Collection<String> codes) { | public List<String> listNameByCodes(Collection<String> codes) { | ||||
LambdaQueryWrapper<DingOrganization> query = Wrappers.lambdaQuery(DingOrganization.class) | LambdaQueryWrapper<DingOrganization> query = Wrappers.lambdaQuery(DingOrganization.class) | ||||
.select(DingOrganization::getOrganizationName) | .select(DingOrganization::getOrganizationName) | ||||
.eq(DingOrganization::getOrganizationCode, codes); | |||||
.in(DingOrganization::getOrganizationCode, codes); | |||||
return CollUtils.fieldList(list(query), DingOrganization::getOrganizationName); | return CollUtils.fieldList(list(query), DingOrganization::getOrganizationName); | ||||
} | } | ||||
@@ -76,7 +79,7 @@ public class DingOrganizationServiceImpl extends ServiceImpl<DingOrganizationMap | |||||
orgCodeList = orgCodeList.stream().distinct().collect(Collectors.toList()); | orgCodeList = orgCodeList.stream().distinct().collect(Collectors.toList()); | ||||
List<DingOrganization> dingOrganizationList = listByCodes(orgCodeList); | List<DingOrganization> dingOrganizationList = listByCodes(orgCodeList); | ||||
return dingOrganizationList.stream() | 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)); | |||||
} | } | ||||
} | } |