@@ -126,7 +126,7 @@ public class MeetingController { | |||
} | |||
@ApiOperation("取消会议") | |||
@PostMapping("/cancelMeeting") | |||
@PostMapping("/cancel") | |||
@WebLog(value = "取消会议") | |||
public void cancelMeeting(@Valid @RequestBody MeetingCancelReq po) { | |||
meetingManage.cancelMeeting(po); | |||
@@ -1,5 +1,6 @@ | |||
package com.ningdatech.pmapi.meeting.entity.enumeration; | |||
import lombok.AllArgsConstructor; | |||
import lombok.Getter; | |||
import java.util.Arrays; | |||
@@ -13,7 +14,8 @@ import java.util.Arrays; | |||
* @since 09:23 2022/8/9 | |||
*/ | |||
@Getter | |||
public enum ExpertAttendStatus { | |||
@AllArgsConstructor | |||
public enum ExpertAttendStatusEnum { | |||
NOTICING("通知中", 0), | |||
NOT_ANSWERED("未应答", 1), | |||
@@ -23,19 +25,14 @@ public enum ExpertAttendStatus { | |||
CANCELED("已移除", 5), | |||
ON_LEAVE("已请假", 6); | |||
private final Integer code; | |||
private final String desc; | |||
ExpertAttendStatus(String desc, Integer code) { | |||
this.code = code; | |||
this.desc = desc; | |||
} | |||
private final Integer code; | |||
public boolean eq(Integer code) { | |||
return this.getCode().equals(code); | |||
} | |||
public static ExpertAttendStatus getByCode(Integer code) { | |||
public static ExpertAttendStatusEnum getByCode(Integer code) { | |||
return Arrays.stream(values()) | |||
.filter(w -> w.eq(code)) | |||
.findFirst() |
@@ -0,0 +1,35 @@ | |||
package com.ningdatech.pmapi.meeting.entity.enumeration; | |||
import lombok.AllArgsConstructor; | |||
import lombok.Getter; | |||
import java.util.Arrays; | |||
/** | |||
* <p> | |||
* 专家参会状态 | |||
* </p> | |||
* | |||
* @author WendyYang | |||
* @since 20:30 2023/3/2 | |||
*/ | |||
@Getter | |||
@AllArgsConstructor | |||
public enum MeetingAttendStatusEnum { | |||
TO_ATTEND("待参加", 1), | |||
ATTENDED("已参加", 2), | |||
ON_LEAVE("已请假", 3), | |||
UN_ATTEND("缺席", 4); | |||
private final String value; | |||
private final Integer code; | |||
public static MeetingAttendStatusEnum getByCode(Integer code) { | |||
return Arrays.stream(values()) | |||
.filter(w -> w.getCode().equals(code)) | |||
.findFirst() | |||
.orElseThrow(() -> new IllegalArgumentException("专家参会状态编码无效")); | |||
} | |||
} |
@@ -1,73 +0,0 @@ | |||
package com.ningdatech.pmapi.meeting.entity.enumeration; | |||
import lombok.Getter; | |||
import java.util.Arrays; | |||
/** | |||
* <p> | |||
* MeetingStatus | |||
* </p> | |||
* | |||
* @author WendyYang | |||
* @since 11:14 2022/8/8 | |||
*/ | |||
public class MeetingStatus { | |||
/** | |||
* 管理员事务列表:事务状态 | |||
*/ | |||
@Getter | |||
public enum Manager { | |||
UNCOMPLETED("未完成", 1), | |||
COMPLETED("已完成", 2), | |||
CANCELED("已取消", 3); | |||
private final String desc; | |||
private final Integer code; | |||
Manager(String desc, Integer code) { | |||
this.desc = desc; | |||
this.code = code; | |||
} | |||
public boolean eq(Integer code) { | |||
return this.getCode().equals(code); | |||
} | |||
public static Manager getByCode(Integer code) { | |||
return Arrays.stream(values()) | |||
.filter(w -> w.getCode().equals(code)) | |||
.findFirst() | |||
.orElseThrow(() -> new IllegalArgumentException("状态编码")); | |||
} | |||
} | |||
@Getter | |||
public enum Expert { | |||
TO_ATTEND("待参加", 1), | |||
ATTENDED("已参加", 2), | |||
ON_LEAVE("已请假", 3), | |||
UN_ATTEND("缺席", 4); | |||
private final String desc; | |||
private final Integer code; | |||
Expert(String desc, Integer code) { | |||
this.desc = desc; | |||
this.code = code; | |||
} | |||
public static Expert getByCode(Integer code) { | |||
return Arrays.stream(values()) | |||
.filter(w -> w.getCode().equals(code)) | |||
.findFirst() | |||
.orElseThrow(() -> new IllegalArgumentException("状态编码")); | |||
} | |||
} | |||
} |
@@ -0,0 +1,40 @@ | |||
package com.ningdatech.pmapi.meeting.entity.enumeration; | |||
import lombok.AllArgsConstructor; | |||
import lombok.Getter; | |||
import java.util.Arrays; | |||
/** | |||
* <p> | |||
* MeetingStatus | |||
* </p> | |||
* | |||
* @author WendyYang | |||
* @since 11:14 2022/8/8 | |||
*/ | |||
@Getter | |||
@AllArgsConstructor | |||
public enum MeetingStatusEnum { | |||
/** | |||
* 会议状态 | |||
*/ | |||
NORMAL("正常", 1), | |||
CANCELED("已取消", 3); | |||
private final String value; | |||
private final Integer code; | |||
public boolean eq(Integer code) { | |||
return this.getCode().equals(code); | |||
} | |||
public static MeetingStatusEnum getByCode(Integer code) { | |||
return Arrays.stream(values()) | |||
.filter(w -> w.getCode().equals(code)) | |||
.findFirst() | |||
.orElseThrow(() -> new IllegalArgumentException("会议状态编码无效")); | |||
} | |||
} |
@@ -4,7 +4,6 @@ import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Data; | |||
import javax.validation.constraints.NotBlank; | |||
import javax.validation.constraints.NotNull; | |||
/** | |||
@@ -23,8 +22,4 @@ public class MeetingCancelReq { | |||
@ApiModelProperty("会议ID") | |||
private Long meetingId; | |||
@NotBlank(message = "取消说明不能为空") | |||
@ApiModelProperty("取消说明") | |||
private String cancelRemark; | |||
} |
@@ -1,6 +1,5 @@ | |||
package com.ningdatech.pmapi.meeting.helper; | |||
import cn.hutool.core.collection.CollUtil; | |||
import com.alibaba.fastjson.JSONObject; | |||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||
@@ -13,15 +12,13 @@ import com.ningdatech.pmapi.meeting.entity.domain.MeetingExpert; | |||
import com.ningdatech.pmapi.meeting.entity.dto.AbstractInviteRule; | |||
import com.ningdatech.pmapi.meeting.entity.dto.AppointInviteRuleDTO; | |||
import com.ningdatech.pmapi.meeting.entity.dto.AvoidInfoDTO; | |||
import com.ningdatech.pmapi.meeting.entity.enumeration.ExpertAttendStatus; | |||
import com.ningdatech.pmapi.meeting.entity.enumeration.MeetingStatus; | |||
import com.ningdatech.pmapi.meeting.entity.enumeration.ExpertAttendStatusEnum; | |||
import com.ningdatech.pmapi.meeting.entity.enumeration.MeetingStatusEnum; | |||
import com.ningdatech.pmapi.meeting.service.IMeetingExpertService; | |||
import com.ningdatech.pmapi.meeting.service.IMeetingService; | |||
import lombok.AllArgsConstructor; | |||
import lombok.extern.slf4j.Slf4j; | |||
import org.apache.commons.collections4.CollectionUtils; | |||
import org.springframework.stereotype.Component; | |||
import org.springframework.util.Assert; | |||
import java.time.LocalDateTime; | |||
import java.util.*; | |||
@@ -54,7 +51,6 @@ public class ExpertInviteHelper { | |||
public List<Long> listInvitedExpertByTime(LocalDateTime start, LocalDateTime end) { | |||
LambdaQueryWrapper<Meeting> meetingQuery = Wrappers.lambdaQuery(Meeting.class) | |||
.select(Meeting::getId) | |||
.eq(Meeting::getStatus, MeetingStatus.Manager.UNCOMPLETED.getCode()) | |||
.and(wrapper -> wrapper.between(Meeting::getStartTime, start, end) | |||
.or(wrapper1 -> wrapper1.between(Meeting::getEndTime, start, end))); | |||
List<Meeting> meetings = meetingService.list(meetingQuery); | |||
@@ -64,16 +60,14 @@ public class ExpertInviteHelper { | |||
List<Long> meetingIds = CollUtils.fieldList(meetings, Meeting::getId); | |||
LambdaQueryWrapper<MeetingExpert> meetingExpertQuery = Wrappers.lambdaQuery(MeetingExpert.class) | |||
.select(MeetingExpert::getExpertId) | |||
.in(MeetingExpert::getStatus, ExpertAttendStatus.AGREED.getCode(), ExpertAttendStatus.NOTICING.getCode()) | |||
.in(MeetingExpert::getStatus, ExpertAttendStatusEnum.AGREED.getCode(), ExpertAttendStatusEnum.NOTICING.getCode()) | |||
.in(MeetingExpert::getMeetingId, meetingIds); | |||
List<MeetingExpert> meetingExperts = meetingExpertService.list(meetingExpertQuery); | |||
return CollUtils.fieldList(meetingExperts, MeetingExpert::getExpertId); | |||
} | |||
public Set<Long> listExpertLeaveOrInvited(LocalDateTime start, LocalDateTime end) { | |||
Set<Long> notInUserIds = new HashSet<>(); | |||
notInUserIds.addAll(listInvitedExpertByTime(start, end)); | |||
return notInUserIds; | |||
return new HashSet<>(listInvitedExpertByTime(start, end)); | |||
} | |||
public Set<Long> getAvoidExpert(List<Long> appoints, AvoidInfoDTO avoid, LocalDateTime start, LocalDateTime end) { | |||
@@ -16,8 +16,8 @@ import com.ningdatech.pmapi.meeting.entity.domain.MeetingExpert; | |||
import com.ningdatech.pmapi.meeting.entity.dto.AvoidInfoDTO; | |||
import com.ningdatech.pmapi.meeting.entity.dto.MeetingAndAttendStatusDTO; | |||
import com.ningdatech.pmapi.meeting.entity.dto.MeetingBasicDTO; | |||
import com.ningdatech.pmapi.meeting.entity.enumeration.ExpertAttendStatus; | |||
import com.ningdatech.pmapi.meeting.entity.enumeration.MeetingStatus; | |||
import com.ningdatech.pmapi.meeting.entity.enumeration.ExpertAttendStatusEnum; | |||
import com.ningdatech.pmapi.meeting.entity.enumeration.MeetingStatusEnum; | |||
import com.ningdatech.pmapi.meeting.entity.req.MeetingListReq; | |||
import com.ningdatech.pmapi.meeting.entity.vo.ExpertBasicInfoVO; | |||
import com.ningdatech.pmapi.meeting.entity.vo.MeetingByManagerVO; | |||
@@ -66,15 +66,8 @@ public class MeetingManageHelper { | |||
* @author WendyYang | |||
**/ | |||
public Integer getExpertAttendStatus(MeetingAndAttendStatusDTO info) { | |||
if (info.getAttended() == null && info.getStatus().equals(ExpertAttendStatus.AGREED.getCode())) { | |||
return MeetingStatus.Expert.TO_ATTEND.getCode(); | |||
} else if (info.getStatus().equals(ExpertAttendStatus.ON_LEAVE.getCode())) { | |||
return MeetingStatus.Expert.ON_LEAVE.getCode(); | |||
} else if (info.getAttended() != null && info.getAttended()) { | |||
return MeetingStatus.Expert.ATTENDED.getCode(); | |||
} else { | |||
return MeetingStatus.Expert.UN_ATTEND.getCode(); | |||
} | |||
// TODO | |||
return null; | |||
} | |||
public MeetingByManagerVO buildByMeeting(Meeting meeting) { | |||
@@ -188,13 +181,13 @@ public class MeetingManageHelper { | |||
ExpertUserFullInfo expertInfo = expertMap.get(w.getExpertId()); | |||
if (expertInfo != null) { | |||
String expertName = expertInfo.getExpertName(); | |||
switch (ExpertAttendStatus.getByCode(w.getStatus())) { | |||
switch (ExpertAttendStatusEnum.getByCode(w.getStatus())) { | |||
case REFUSED: | |||
throw BizException.wrap("专家%s已拒绝参加", expertName); | |||
case CANCELED: | |||
throw BizException.wrap("专家%s已被移除", expertName); | |||
case REPLACED: | |||
switch (ExpertAttendStatus.getByCode(w.getPreStatus())) { | |||
switch (ExpertAttendStatusEnum.getByCode(w.getPreStatus())) { | |||
case REFUSED: | |||
throw BizException.wrap("专家%s已拒绝参加", expertName); | |||
case CANCELED: | |||
@@ -12,9 +12,9 @@ import com.ningdatech.pmapi.meeting.entity.domain.Meeting; | |||
import com.ningdatech.pmapi.meeting.entity.domain.MeetingExpert; | |||
import com.ningdatech.pmapi.meeting.entity.dto.CountConfirmByMeetingIdDTO; | |||
import com.ningdatech.pmapi.meeting.entity.dto.MeetingAndAttendStatusDTO; | |||
import com.ningdatech.pmapi.meeting.entity.enumeration.ExpertAttendStatus; | |||
import com.ningdatech.pmapi.meeting.entity.enumeration.ExpertAttendStatusEnum; | |||
import com.ningdatech.pmapi.meeting.entity.enumeration.ExpertInviteTypeEnum; | |||
import com.ningdatech.pmapi.meeting.entity.enumeration.MeetingStatus; | |||
import com.ningdatech.pmapi.meeting.entity.enumeration.MeetingStatusEnum; | |||
import com.ningdatech.pmapi.meeting.entity.enumeration.MeetingStatusByDashboard; | |||
import com.ningdatech.pmapi.meeting.entity.req.MeetingCalenderReq; | |||
import com.ningdatech.pmapi.meeting.entity.req.MeetingListReq; | |||
@@ -66,14 +66,14 @@ public class DashboardManage { | |||
meetingListPo.setEndTime(po.getEndDate().atTime(LocalTime.MAX)); | |||
PageVo<MeetingByManagerVO> meetingPage = meetingManage.meetingListByExpert(meetingListPo); | |||
Map<LocalDate, List<MeetingByManagerVO>> meetingByDate = meetingPage.getRecords().stream().map(w -> { | |||
List<Pair<LocalDate, MeetingByManagerVO>> pairs = new ArrayList<>(); | |||
LocalDateTime tempTime = w.getStartTime(); | |||
while (tempTime.isBefore(w.getEndTime())) { | |||
pairs.add(Pair.of(tempTime.toLocalDate(), w)); | |||
tempTime = tempTime.plusDays(1); | |||
} | |||
return pairs; | |||
}).flatMap(Collection::stream) | |||
List<Pair<LocalDate, MeetingByManagerVO>> pairs = new ArrayList<>(); | |||
LocalDateTime tempTime = w.getStartTime(); | |||
while (tempTime.isBefore(w.getEndTime())) { | |||
pairs.add(Pair.of(tempTime.toLocalDate(), w)); | |||
tempTime = tempTime.plusDays(1); | |||
} | |||
return pairs; | |||
}).flatMap(Collection::stream) | |||
.collect(Collectors.groupingBy(Pair::getLeft, | |||
Collectors.collectingAndThen(Collectors.mapping(Pair::getRight, Collectors.toList()), | |||
w -> { | |||
@@ -101,7 +101,7 @@ public class DashboardManage { | |||
// 查询所有未完成的项目 | |||
LambdaQueryWrapper<Meeting> query = Wrappers.lambdaQuery(Meeting.class) | |||
.select(Meeting::getId) | |||
.ne(Meeting::getStatus, MeetingStatus.Manager.CANCELED.getCode()) | |||
.ne(Meeting::getStatus, MeetingStatusEnum.CANCELED.getCode()) | |||
.eq(Meeting::getCreateBy, LoginUserUtil.getUserId()); | |||
List<Meeting> meetings = meetingService.list(query); | |||
if (meetings.isEmpty()) { | |||
@@ -110,7 +110,8 @@ public class DashboardManage { | |||
List<Long> meetingIds = CollUtils.fieldList(meetings, Meeting::getId); | |||
Page<MeetingExpert> page = meetingExpertEvaluationService.pageExpertEvaluationTodo(meetingIds, po); | |||
if (page.getTotal() > 0) { | |||
List<Long> expertIds = new ArrayList<>(), meetingIdsByPage = new ArrayList<>(); | |||
List<Long> expertIds = new ArrayList<>(); | |||
List<Long> meetingIdsByPage = new ArrayList<>(); | |||
page.getRecords().forEach(w -> { | |||
meetingIdsByPage.add(w.getMeetingId()); | |||
expertIds.add(w.getExpertId()); | |||
@@ -136,7 +137,6 @@ public class DashboardManage { | |||
public PageVo<MeetingConfirmToDoListItemVO> expertConfirmToDo(PagePo po) { | |||
// 查询所有未完成的项目 | |||
LambdaQueryWrapper<Meeting> query = Wrappers.lambdaQuery(Meeting.class) | |||
.eq(Meeting::getStatus, MeetingStatus.Manager.UNCOMPLETED.getCode()) | |||
.eq(Meeting::getCreateBy, LoginUserUtil.getUserId()) | |||
.orderByDesc(Meeting::getStartTime); | |||
List<Meeting> meetings = meetingService.list(query); | |||
@@ -179,7 +179,6 @@ public class DashboardManage { | |||
public PageVo<ExpertReplaceTodoListItemVO> expertReplaceTodoList(PagePo po) { | |||
// 查询所有未完成的项目 | |||
LambdaQueryWrapper<Meeting> query = Wrappers.lambdaQuery(Meeting.class) | |||
.eq(Meeting::getStatus, MeetingStatus.Manager.UNCOMPLETED.getCode()) | |||
.eq(Meeting::getCreateBy, LoginUserUtil.getUserId()) | |||
.orderByDesc(Meeting::getStartTime); | |||
List<Meeting> meetings = meetingService.list(query); | |||
@@ -188,7 +187,7 @@ public class DashboardManage { | |||
} | |||
List<Long> meetingIds = CollUtils.fieldList(meetings, Meeting::getId); | |||
Page<MeetingExpert> page = meetingExpertService.pageExpertByStatusAndMeetingIds(new Page<>(po.getPageNumber(), po.getPageSize()), | |||
meetingIds, ExpertAttendStatus.ON_LEAVE); | |||
meetingIds, ExpertAttendStatusEnum.ON_LEAVE); | |||
if (page.getTotal() == 0) { | |||
return PageVo.empty(); | |||
} | |||
@@ -225,7 +224,7 @@ public class DashboardManage { | |||
List<MeetingAndAttendStatusDTO> attendStatusList = meetingExpertService.listByExpertIdAndStatus(LoginUserUtil.getUserId(), null, null); | |||
MeetingCountByExpertVO result = MeetingCountByExpertVO.init(); | |||
attendStatusList.forEach(w -> { | |||
if (w.getStatus().equals(ExpertAttendStatus.ON_LEAVE.getCode())) { | |||
if (w.getStatus().equals(ExpertAttendStatusEnum.ON_LEAVE.getCode())) { | |||
result.incrLeaved(); | |||
} else if (w.getAttended() != null && w.getAttended()) { | |||
result.incrAttended(); | |||
@@ -19,7 +19,7 @@ import com.ningdatech.pmapi.meeting.entity.dto.AvoidInfoDTO; | |||
import com.ningdatech.pmapi.meeting.entity.dto.ExpertChooseDTO; | |||
import com.ningdatech.pmapi.meeting.entity.dto.ExpertDictChooseDTO; | |||
import com.ningdatech.pmapi.meeting.entity.dto.RandomInviteRuleDTO; | |||
import com.ningdatech.pmapi.meeting.entity.enumeration.ExpertAttendStatus; | |||
import com.ningdatech.pmapi.meeting.entity.enumeration.ExpertAttendStatusEnum; | |||
import com.ningdatech.pmapi.meeting.helper.ExpertInviteHelper; | |||
import com.ningdatech.pmapi.meeting.helper.YxtCallOrSmsHelper; | |||
import com.ningdatech.pmapi.meeting.service.IExpertInviteRuleService; | |||
@@ -396,28 +396,28 @@ public class ExpertInviteManage { | |||
} | |||
Comparator<MeetingExpert> sort = Comparator.comparing(MeetingExpert::getUpdateOn).reversed(); | |||
Map<Long, MeetingExpert> tempExpertIdsMap = BizUtils.groupFirstMap(meetingExperts, MeetingExpert::getExpertId, sort); | |||
Map<ExpertAttendStatus, List<MeetingExpert>> expertIdGroupByStatus = tempExpertIdsMap.values().stream() | |||
.collect(Collectors.groupingBy(w -> ExpertAttendStatus.getByCode(w.getStatus()))); | |||
Map<ExpertAttendStatusEnum, List<MeetingExpert>> expertIdGroupByStatus = tempExpertIdsMap.values().stream() | |||
.collect(Collectors.groupingBy(w -> ExpertAttendStatusEnum.getByCode(w.getStatus()))); | |||
// 回避同单位其他专家 | |||
List<MeetingExpert> removeExpertByCompany = new ArrayList<>(); | |||
BizUtils.notEmpty(expertIdGroupByStatus.get(ExpertAttendStatus.AGREED), removeExpertByCompany::addAll); | |||
BizUtils.notEmpty(expertIdGroupByStatus.get(ExpertAttendStatus.NOTICING), removeExpertByCompany::addAll); | |||
BizUtils.notEmpty(expertIdGroupByStatus.get(ExpertAttendStatusEnum.AGREED), removeExpertByCompany::addAll); | |||
BizUtils.notEmpty(expertIdGroupByStatus.get(ExpertAttendStatusEnum.NOTICING), removeExpertByCompany::addAll); | |||
List<Long> removeExpertIds = new ArrayList<>(); | |||
// 拒绝参加的不可以被再次抽中 | |||
BizUtils.notEmpty(expertIdGroupByStatus.get(ExpertAttendStatus.REFUSED), w -> { | |||
BizUtils.notEmpty(expertIdGroupByStatus.get(ExpertAttendStatusEnum.REFUSED), w -> { | |||
List<Long> tempRefused = CollUtils.fieldList(w, MeetingExpert::getExpertId); | |||
removeExpertIds.addAll(tempRefused); | |||
}); | |||
// 被取消的也不可以被再次抽中 | |||
BizUtils.notEmpty(expertIdGroupByStatus.get(ExpertAttendStatus.CANCELED), w -> { | |||
BizUtils.notEmpty(expertIdGroupByStatus.get(ExpertAttendStatusEnum.CANCELED), w -> { | |||
List<Long> tempCanceled = CollUtils.fieldList(w, MeetingExpert::getExpertId); | |||
removeExpertIds.addAll(tempCanceled); | |||
}); | |||
// 被替换之前是上述两种状态的不可被再次抽中 | |||
BizUtils.notEmpty(expertIdGroupByStatus.get(ExpertAttendStatus.REPLACED), w -> { | |||
BizUtils.notEmpty(expertIdGroupByStatus.get(ExpertAttendStatusEnum.REPLACED), w -> { | |||
for (MeetingExpert me : w) { | |||
BizUtils.notNull(me.getPreStatus(), preStatus -> { | |||
if (ExpertAttendStatus.REFUSED.eq(preStatus) || ExpertAttendStatus.CANCELED.eq(preStatus)) { | |||
if (ExpertAttendStatusEnum.REFUSED.eq(preStatus) || ExpertAttendStatusEnum.CANCELED.eq(preStatus)) { | |||
removeExpertIds.add(me.getExpertId()); | |||
} | |||
}); | |||
@@ -572,7 +572,7 @@ public class ExpertInviteManage { | |||
Long ruleId = randoms.get(i).getId(); | |||
expertsByRandom.get(i).getExperts().forEach(w -> { | |||
MeetingExpert expert = ExpertInviteBuilder.getExpertByRandom(meeting.getId(), w, ruleId); | |||
expert.setStatus(ExpertAttendStatus.NOTICING.getCode()); | |||
expert.setStatus(ExpertAttendStatusEnum.NOTICING.getCode()); | |||
expertInserts.add(expert); | |||
}); | |||
} | |||
@@ -24,9 +24,9 @@ import com.ningdatech.pmapi.expert.service.IExpertUserFullInfoService; | |||
import com.ningdatech.pmapi.meeting.builder.ExpertInviteBuilder; | |||
import com.ningdatech.pmapi.meeting.entity.domain.*; | |||
import com.ningdatech.pmapi.meeting.entity.dto.*; | |||
import com.ningdatech.pmapi.meeting.entity.enumeration.ExpertAttendStatus; | |||
import com.ningdatech.pmapi.meeting.entity.enumeration.ExpertAttendStatusEnum; | |||
import com.ningdatech.pmapi.meeting.entity.enumeration.ExpertInviteTypeEnum; | |||
import com.ningdatech.pmapi.meeting.entity.enumeration.MeetingStatus.Manager; | |||
import com.ningdatech.pmapi.meeting.entity.enumeration.MeetingStatusEnum; | |||
import com.ningdatech.pmapi.meeting.entity.req.*; | |||
import com.ningdatech.pmapi.meeting.entity.vo.*; | |||
import com.ningdatech.pmapi.meeting.entity.vo.ExpertInviteDetailVO.ExpertAttendListItemVO; | |||
@@ -110,7 +110,7 @@ public class MeetingManage { | |||
try { | |||
// 保存会议基本信息 | |||
Meeting meeting = BeanUtil.copyProperties(meetingBasic, Meeting.class); | |||
meeting.setStatus(Manager.UNCOMPLETED.getCode()); | |||
meeting.setStatus(MeetingStatusEnum.NORMAL.getCode()); | |||
UserInfoDetails userDetail = LoginUserUtil.loginUserDetail(); | |||
meeting.setHoldOrg(userDetail.getOrganizationName()); | |||
meeting.setHoldOrgCode(userDetail.getOrganizationCode()); | |||
@@ -195,7 +195,7 @@ public class MeetingManage { | |||
List<MeetingExpert> experts = appointRule.getExpertIds().stream().map(w -> { | |||
ExpertUserFullInfo info = usersMap.get(w); | |||
MeetingExpert expert = ExpertInviteBuilder.getExpertByAppoint(meeting.getId(), info, ruleId); | |||
expert.setStatus(ExpertAttendStatus.NOTICING.getCode()); | |||
expert.setStatus(ExpertAttendStatusEnum.NOTICING.getCode()); | |||
return expert; | |||
}).collect(Collectors.toList()); | |||
meetingExpertService.saveBatch(experts); | |||
@@ -253,7 +253,7 @@ public class MeetingManage { | |||
LambdaQueryWrapper<Meeting> query = new LambdaQueryWrapper<Meeting>() | |||
.orderByDesc(Meeting::getCreateOn) | |||
.in(Meeting::getId, mapByMeetingId.keySet()) | |||
.ne(Meeting::getStatus, Manager.CANCELED.getCode()); | |||
.ne(Meeting::getStatus, MeetingStatusEnum.CANCELED.getCode()); | |||
if (req.getExpertId() == null) { | |||
meetingManageHelper.buildMeetingQuery(query, req); | |||
} | |||
@@ -373,7 +373,7 @@ public class MeetingManage { | |||
} else { | |||
appointList.add(w); | |||
} | |||
if (w.getStatus().equals(ExpertAttendStatus.AGREED.getCode())) { | |||
if (w.getStatus().equals(ExpertAttendStatusEnum.AGREED.getCode())) { | |||
attendList.add(w); | |||
if (randomInvite) { | |||
result.setRandomAttend(result.getRandomAttend() + 1); | |||
@@ -391,8 +391,8 @@ public class MeetingManage { | |||
item.setStatus(sme.getStatus()); | |||
item.setMeetingId(sme.getMeetingId()); | |||
item.setExpertMeetingId(sme.getId()); | |||
ExpertAttendStatus status = ExpertAttendStatus.getByCode(sme.getStatus()); | |||
if (status.equals(ExpertAttendStatus.NOTICING)) { | |||
ExpertAttendStatusEnum status = ExpertAttendStatusEnum.getByCode(sme.getStatus()); | |||
if (status.equals(ExpertAttendStatusEnum.NOTICING)) { | |||
item.setNoticeStatus(status.getDesc()); | |||
item.setConfirmResult(StrUtil.EMPTY); | |||
} else { | |||
@@ -435,14 +435,12 @@ public class MeetingManage { | |||
BeanUtil.copyProperties(po, meeting); | |||
LocalDateTime now = LocalDateTime.now(); | |||
Meeting old = meetingService.getById(po.getId()); | |||
if (Manager.UNCOMPLETED.eq(old.getStatus()) && meetingInfoChange(old, meeting)) { | |||
List<MeetingExpert> meList = meetingExpertService.listExpertByAgreeAttend(Collections.singletonList(po.getId())); | |||
if (!meList.isEmpty() && old.getStartTime().isAfter(now)) { | |||
// TODO | |||
/*String meetingType = dictionaryCache.getByCode(old.getType()).getName(); | |||
List<SendSmsContext> contexts = YxtSmsContextBuilder.smsToExpertByMeetingChange(old, meeting, meList, meetingType); | |||
yxtCallOrSmsHelper.sendSms(contexts);*/ | |||
} | |||
List<MeetingExpert> meList = meetingExpertService.listAgreedExperts(Collections.singletonList(po.getId())); | |||
if (!meList.isEmpty() && old.getStartTime().isAfter(now)) { | |||
// TODO | |||
/*String meetingType = dictionaryCache.getByCode(old.getType()).getName(); | |||
List<SendSmsContext> contexts = YxtSmsContextBuilder.smsToExpertByMeetingChange(old, meeting, meList, meetingType); | |||
yxtCallOrSmsHelper.sendSms(contexts);*/ | |||
} | |||
meetingService.updateById(meeting); | |||
} | |||
@@ -508,7 +506,7 @@ public class MeetingManage { | |||
public void expertRemove(ExpertRemoveReq po) { | |||
LambdaUpdateWrapper<MeetingExpert> update = Wrappers.lambdaUpdate(MeetingExpert.class) | |||
.eq(MeetingExpert::getId, po.getExpertMeetingId()) | |||
.set(MeetingExpert::getStatus, ExpertAttendStatus.CANCELED.getCode()); | |||
.set(MeetingExpert::getStatus, ExpertAttendStatusEnum.CANCELED.getCode()); | |||
meetingExpertService.update(update); | |||
} | |||
@@ -556,7 +554,7 @@ public class MeetingManage { | |||
.eq(MeetingExpert::getId, po.getExpertMeetingId()) | |||
.set(MeetingExpert::getUpdateOn, LocalDateTime.now()) | |||
.set(MeetingExpert::getPreStatus, meetingExpert.getStatus()) | |||
.set(MeetingExpert::getStatus, ExpertAttendStatus.REPLACED.getCode()); | |||
.set(MeetingExpert::getStatus, ExpertAttendStatusEnum.REPLACED.getCode()); | |||
meetingExpertService.update(update); | |||
MeetingExpert me; | |||
if (po.getExpertId() == null) { | |||
@@ -564,7 +562,7 @@ public class MeetingManage { | |||
} else { | |||
me = ExpertInviteBuilder.getExpertByAppoint(po.getMeetingId(), expertFullInfo, ruleId); | |||
} | |||
me.setStatus(ExpertAttendStatus.NOTICING.getCode()); | |||
me.setStatus(ExpertAttendStatusEnum.NOTICING.getCode()); | |||
me.setPreId(po.getExpertMeetingId()); | |||
yxtCallOrSmsHelper.callByMeetingExperts(meeting, Collections.singletonList(me)); | |||
meetingExpertService.save(me); | |||
@@ -578,7 +576,7 @@ public class MeetingManage { | |||
List<ExpertUserFullInfo> userInfos = meetingManageHelper.appointExpertCheck(po.getMeetingId(), po.getExpertIds()); | |||
List<MeetingExpert> expertList = CollUtils.convert(userInfos, w -> { | |||
MeetingExpert me = ExpertInviteBuilder.getExpertByAppoint(po.getMeetingId(), w, 0L); | |||
me.setStatus(ExpertAttendStatus.NOTICING.getCode()); | |||
me.setStatus(ExpertAttendStatusEnum.NOTICING.getCode()); | |||
return me; | |||
}); | |||
meetingExpertService.saveBatch(expertList); | |||
@@ -591,15 +589,14 @@ public class MeetingManage { | |||
} | |||
try { | |||
Meeting meeting = meetingService.getById(meetingId); | |||
Assert.isTrue(Manager.UNCOMPLETED.eq(meeting.getStatus()), "非未完成会议无法发送会议通知"); | |||
Assert.isTrue(meeting.getInviteStopped(), "随机邀请未结束"); | |||
int noticeCount = meetingExpertService.countExpertByStatusAndMeetingId(ExpertAttendStatus.NOTICING, meetingId, null); | |||
int noticeCount = meetingExpertService.countExpertByStatusAndMeetingId(ExpertAttendStatusEnum.NOTICING, meetingId, null); | |||
Assert.isTrue(noticeCount == 0, "存在未确认完成的专家,暂无法下发会议通知"); | |||
LambdaUpdateWrapper<Meeting> update = Wrappers.lambdaUpdate(Meeting.class) | |||
.eq(Meeting::getId, meetingId); | |||
meetingService.update(update); | |||
// 发送会议通知 | |||
List<MeetingExpert> experts = meetingExpertService.listExpertByAgreeAttend(Collections.singletonList(meetingId)); | |||
List<MeetingExpert> experts = meetingExpertService.listAgreedExperts(Collections.singletonList(meetingId)); | |||
if (!experts.isEmpty()) { | |||
// TODO | |||
// String meetingType = dictionaryCache.getByCode(meeting.getType()).getName(); | |||
@@ -616,26 +613,29 @@ public class MeetingManage { | |||
} | |||
@Transactional(rollbackFor = Exception.class) | |||
public void cancelMeeting(MeetingCancelReq po) { | |||
String key = "CANCEL_MEETING:" + po.getMeetingId(); | |||
public void cancelMeeting(MeetingCancelReq req) { | |||
Long meetingId = req.getMeetingId(); | |||
String key = "CANCEL_MEETING:" + meetingId; | |||
if (!distributedLock.lock(key, RETRY_TIMES)) { | |||
throw BizException.wrap("正在取消会议,请刷新后重试"); | |||
} | |||
try { | |||
Meeting meeting = meetingService.getById(po.getMeetingId()); | |||
Assert.isTrue(!Manager.CANCELED.eq(meeting.getStatus()), "会议已取消"); | |||
Assert.isTrue(meeting.getStartTime().isAfter(LocalDateTime.now()), "会议已开始,暂时无法取消"); | |||
LambdaUpdateWrapper<Meeting> update = Wrappers.lambdaUpdate(Meeting.class) | |||
.set(Meeting::getStatus, Manager.CANCELED.getCode()) | |||
.set(Meeting::getUpdateBy, LoginUserUtil.getUserId()) | |||
.set(Meeting::getUpdateOn, LocalDateTime.now()) | |||
.eq(Meeting::getId, po.getMeetingId()); | |||
meetingService.update(update); | |||
expertInviteTask.cancelByMeetingId(po.getMeetingId()); | |||
Meeting meeting = meetingService.getById(meetingId); | |||
if (MeetingStatusEnum.CANCELED.eq(meeting.getStatus())) { | |||
throw BizException.wrap("会议已取消"); | |||
} | |||
if (meeting.getStartTime().isBefore(LocalDateTime.now())) { | |||
throw BizException.wrap("会议已开始,暂时无法取消"); | |||
} | |||
LambdaUpdateWrapper<Meeting> meetingUpdate = Wrappers.lambdaUpdate(Meeting.class) | |||
.set(Meeting::getStatus, MeetingStatusEnum.CANCELED.getCode()) | |||
.eq(Meeting::getId, meetingId); | |||
meetingService.update(meetingUpdate); | |||
expertInviteTask.cancelByMeetingId(meetingId); | |||
// 发送通知给专家 | |||
List<MeetingExpert> experts = meetingExpertService.listExpertByAgreeAttend(Collections.singletonList(po.getMeetingId())); | |||
List<MeetingExpert> experts = meetingExpertService.listAgreedExperts(meetingId); | |||
if (!experts.isEmpty()) { | |||
// TODO | |||
// TODO 取消会议后发送短信通知 | |||
// meeting.setCancelRemark(po.getCancelRemark()); | |||
// String meetingType = dictionaryCache.getByCode(meeting.getType()).getName(); | |||
// List<SendSmsContext> contexts = YxtSmsContextBuilder.smsToExpertByCancelMeeting(meeting, experts, meetingType); | |||
@@ -650,7 +650,7 @@ public class MeetingManage { | |||
Long userId = expertId == null ? LoginUserUtil.getUserId() : expertId; | |||
MeetingExpert me = meetingExpertService.getByMeetingIdAndExpertId(meetingId, userId); | |||
Assert.notNull(me, "未被邀请参加"); | |||
Assert.isTrue(ExpertAttendStatus.AGREED.eq(me.getStatus()), "未确认参加"); | |||
Assert.isTrue(ExpertAttendStatusEnum.AGREED.eq(me.getStatus()), "未确认参加"); | |||
ExpertUserFullInfo expertInfo = expertUserFullInfoService.getByUserId(userId); | |||
Meeting meeting = meetingService.getById(meetingId); | |||
return ExpertInvitationDetailVO.builder() | |||
@@ -667,15 +667,15 @@ public class MeetingManage { | |||
public void confirmAttendByManager(ExpertRemoveReq po) { | |||
MeetingExpert meetingExpert = meetingExpertService.getById(po.getExpertMeetingId()); | |||
if (meetingExpert.getStatus().equals(ExpertAttendStatus.NOTICING.getCode())) { | |||
if (meetingExpert.getStatus().equals(ExpertAttendStatusEnum.NOTICING.getCode())) { | |||
LambdaUpdateWrapper<MeetingExpert> update = Wrappers.lambdaUpdate(MeetingExpert.class) | |||
.set(MeetingExpert::getStatus, ExpertAttendStatus.AGREED.getCode()) | |||
.set(MeetingExpert::getStatus, ExpertAttendStatusEnum.AGREED.getCode()) | |||
.set(MeetingExpert::getUpdateOn, LocalDateTime.now()) | |||
.set(MeetingExpert::getUpdateBy, LoginUserUtil.getUserId()) | |||
.eq(MeetingExpert::getId, po.getExpertMeetingId()); | |||
meetingExpertService.update(update); | |||
} else { | |||
ExpertAttendStatus status = ExpertAttendStatus.getByCode(meetingExpert.getStatus()); | |||
ExpertAttendStatusEnum status = ExpertAttendStatusEnum.getByCode(meetingExpert.getStatus()); | |||
throw BizException.wrap("该专家" + status.getDesc()); | |||
} | |||
} | |||
@@ -4,7 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |||
import com.ningdatech.pmapi.meeting.entity.domain.MeetingExpert; | |||
import com.ningdatech.pmapi.meeting.entity.dto.MeetingAndAttendStatusDTO; | |||
import com.ningdatech.pmapi.meeting.entity.enumeration.ExpertAttendStatus; | |||
import com.ningdatech.pmapi.meeting.entity.enumeration.ExpertAttendStatusEnum; | |||
import org.apache.ibatis.annotations.Param; | |||
import java.util.Collection; | |||
@@ -37,7 +37,7 @@ public interface MeetingExpertMapper extends BaseMapper<MeetingExpert> { | |||
* 分页查询专家列表 | |||
* | |||
* @param page 分页数据 | |||
* @param status 状态{@link ExpertAttendStatus} | |||
* @param status 状态{@link ExpertAttendStatusEnum} | |||
* @param meetingId 会议ID | |||
* @param inviteType 邀请类型 | |||
* @return Page<MeetingExpert> | |||
@@ -51,7 +51,7 @@ public interface MeetingExpertMapper extends BaseMapper<MeetingExpert> { | |||
* 分页查询专家列表 | |||
* | |||
* @param page 分页数据 | |||
* @param status 状态{@link ExpertAttendStatus} | |||
* @param status 状态{@link ExpertAttendStatusEnum} | |||
* @param meetingIds 会议ID | |||
* @return Page<MeetingExpert> | |||
* @author WendyYang | |||
@@ -5,10 +5,11 @@ import com.baomidou.mybatisplus.extension.service.IService; | |||
import com.ningdatech.pmapi.meeting.entity.domain.MeetingExpert; | |||
import com.ningdatech.pmapi.meeting.entity.dto.CountConfirmByMeetingIdDTO; | |||
import com.ningdatech.pmapi.meeting.entity.dto.MeetingAndAttendStatusDTO; | |||
import com.ningdatech.pmapi.meeting.entity.enumeration.ExpertAttendStatus; | |||
import com.ningdatech.pmapi.meeting.entity.enumeration.ExpertAttendStatusEnum; | |||
import com.ningdatech.pmapi.meeting.entity.enumeration.ExpertInviteTypeEnum; | |||
import java.util.Collection; | |||
import java.util.Collections; | |||
import java.util.List; | |||
import java.util.Map; | |||
@@ -78,7 +79,7 @@ public interface IMeetingExpertService extends IService<MeetingExpert> { | |||
* @return Page<MeetingExpert> | |||
* @author WendyYang | |||
**/ | |||
Page<MeetingExpert> pageExpertByStatusAndMeetingId(Page<MeetingExpert> page, Long meetingId, ExpertAttendStatus status, Integer inviteType); | |||
Page<MeetingExpert> pageExpertByStatusAndMeetingId(Page<MeetingExpert> page, Long meetingId, ExpertAttendStatusEnum status, Integer inviteType); | |||
/** | |||
* 批量查询某个状态的专家邀请记录 | |||
@@ -89,7 +90,7 @@ public interface IMeetingExpertService extends IService<MeetingExpert> { | |||
* @return 专家邀请记录 | |||
* @author WendyYang | |||
**/ | |||
Page<MeetingExpert> pageExpertByStatusAndMeetingIds(Page<MeetingExpert> page, List<Long> meetingIds, ExpertAttendStatus status); | |||
Page<MeetingExpert> pageExpertByStatusAndMeetingIds(Page<MeetingExpert> page, List<Long> meetingIds, ExpertAttendStatusEnum status); | |||
/** | |||
* 根据邀请类型统计会议下某个状态的专家数量 | |||
@@ -100,16 +101,27 @@ public interface IMeetingExpertService extends IService<MeetingExpert> { | |||
* @return int | |||
* @author WendyYang | |||
**/ | |||
int countExpertByStatusAndMeetingId(ExpertAttendStatus status, Long meetingId, ExpertInviteTypeEnum inviteType); | |||
int countExpertByStatusAndMeetingId(ExpertAttendStatusEnum status, Long meetingId, ExpertInviteTypeEnum inviteType); | |||
/** | |||
* 查询所有同意参加的专家记录 | |||
* 查询所有同意参加的专家记录(批量会议) | |||
* | |||
* @param meetingIds 会议ID | |||
* @return List<MeetingExpert> | |||
* @return 同意参加的专家 | |||
* @author WendyYang | |||
**/ | |||
List<MeetingExpert> listExpertByAgreeAttend(Collection<Long> meetingIds); | |||
List<MeetingExpert> listAgreedExperts(Collection<Long> meetingIds); | |||
/** | |||
* 查询所有同意参加的专家记录(单个会议) | |||
* | |||
* @param meetingId 会议ID | |||
* @return 同意参加的专家 | |||
* @author WendyYang | |||
**/ | |||
default List<MeetingExpert> listAgreedExperts(Long meetingId) { | |||
return listAgreedExperts(Collections.singletonList(meetingId)); | |||
} | |||
/** | |||
* 查询会议的所有被抽取人最后一条记录 | |||
@@ -9,7 +9,7 @@ import com.ningdatech.pmapi.meeting.entity.domain.ExpertInviteRule; | |||
import com.ningdatech.pmapi.meeting.entity.domain.MeetingExpert; | |||
import com.ningdatech.pmapi.meeting.entity.dto.CountConfirmByMeetingIdDTO; | |||
import com.ningdatech.pmapi.meeting.entity.dto.MeetingAndAttendStatusDTO; | |||
import com.ningdatech.pmapi.meeting.entity.enumeration.ExpertAttendStatus; | |||
import com.ningdatech.pmapi.meeting.entity.enumeration.ExpertAttendStatusEnum; | |||
import com.ningdatech.pmapi.meeting.entity.enumeration.ExpertInviteTypeEnum; | |||
import com.ningdatech.pmapi.meeting.mapper.ExpertInviteRuleMapper; | |||
import com.ningdatech.pmapi.meeting.mapper.MeetingExpertMapper; | |||
@@ -58,17 +58,17 @@ public class MeetingExpertServiceImpl extends ServiceImpl<MeetingExpertMapper, M | |||
.meetingId(meetingId) | |||
.build(); | |||
w.forEach(item -> { | |||
ExpertAttendStatus attendStatus = ExpertAttendStatus.getByCode(item.getStatus()); | |||
ExpertAttendStatusEnum attendStatus = ExpertAttendStatusEnum.getByCode(item.getStatus()); | |||
if (item.getInviteType().equals(ExpertInviteTypeEnum.APPOINT.getCode())) { | |||
// 被替换和已取消的不计数 | |||
if (attendStatus.equals(ExpertAttendStatus.CANCELED) | |||
|| attendStatus.equals(ExpertAttendStatus.REPLACED)) { | |||
if (attendStatus.equals(ExpertAttendStatusEnum.CANCELED) | |||
|| attendStatus.equals(ExpertAttendStatusEnum.REPLACED)) { | |||
return; | |||
} | |||
confirm.setTotal(confirm.getTotal() + 1); | |||
} | |||
// 除通知中的均为已确认 | |||
if (attendStatus.equals(ExpertAttendStatus.AGREED)) { | |||
if (attendStatus.equals(ExpertAttendStatusEnum.AGREED)) { | |||
confirm.setConfirmed(confirm.getConfirmed() + 1); | |||
} | |||
}); | |||
@@ -103,26 +103,26 @@ public class MeetingExpertServiceImpl extends ServiceImpl<MeetingExpertMapper, M | |||
} | |||
@Override | |||
public Page<MeetingExpert> pageExpertByStatusAndMeetingId(Page<MeetingExpert> page, Long meetingId, ExpertAttendStatus status, Integer inviteType) { | |||
public Page<MeetingExpert> pageExpertByStatusAndMeetingId(Page<MeetingExpert> page, Long meetingId, ExpertAttendStatusEnum status, Integer inviteType) { | |||
return baseMapper.selectExpertByStatusAndMeetingId(page, status.getCode(), meetingId, inviteType); | |||
} | |||
@Override | |||
public Page<MeetingExpert> pageExpertByStatusAndMeetingIds(Page<MeetingExpert> page, List<Long> meetingIds, ExpertAttendStatus status) { | |||
public Page<MeetingExpert> pageExpertByStatusAndMeetingIds(Page<MeetingExpert> page, List<Long> meetingIds, ExpertAttendStatusEnum status) { | |||
return baseMapper.selectExpertByStatusAndMeetingIds(page, status == null ? null : status.getCode(), meetingIds); | |||
} | |||
@Override | |||
public int countExpertByStatusAndMeetingId(ExpertAttendStatus status, Long meetingId, ExpertInviteTypeEnum inviteType) { | |||
public int countExpertByStatusAndMeetingId(ExpertAttendStatusEnum status, Long meetingId, ExpertInviteTypeEnum inviteType) { | |||
Integer tempStatus = status == null ? null : status.getCode(); | |||
Integer tempInviteType = inviteType == null ? null : inviteType.getCode(); | |||
return baseMapper.countExpertByStatusAndMeetingId(tempStatus, meetingId, tempInviteType); | |||
} | |||
@Override | |||
public List<MeetingExpert> listExpertByAgreeAttend(Collection<Long> meetingIds) { | |||
public List<MeetingExpert> listAgreedExperts(Collection<Long> meetingIds) { | |||
LambdaQueryWrapper<MeetingExpert> query = Wrappers.lambdaQuery(MeetingExpert.class) | |||
.eq(MeetingExpert::getStatus, ExpertAttendStatus.AGREED.getCode()) | |||
.eq(MeetingExpert::getStatus, ExpertAttendStatusEnum.AGREED.getCode()) | |||
.in(MeetingExpert::getMeetingId, meetingIds); | |||
return baseMapper.selectList(query); | |||
} | |||
@@ -16,7 +16,7 @@ import com.ningdatech.pmapi.meeting.entity.domain.MeetingExpert; | |||
import com.ningdatech.pmapi.meeting.entity.dto.AvoidInfoDTO; | |||
import com.ningdatech.pmapi.meeting.entity.dto.ExpertChooseDTO; | |||
import com.ningdatech.pmapi.meeting.entity.dto.RandomInviteRuleDTO; | |||
import com.ningdatech.pmapi.meeting.entity.enumeration.ExpertAttendStatus; | |||
import com.ningdatech.pmapi.meeting.entity.enumeration.ExpertAttendStatusEnum; | |||
import com.ningdatech.pmapi.meeting.entity.enumeration.ExpertInviteTypeEnum; | |||
import com.ningdatech.pmapi.meeting.helper.ExpertInviteHelper; | |||
import com.ningdatech.pmapi.meeting.helper.YxtCallOrSmsHelper; | |||
@@ -134,7 +134,7 @@ public class ExpertInviteTask { | |||
Map<Long, ExpertInviteRule> ruleMap = CollUtils.listToMap(randomRules, ExpertInviteRule::getId); | |||
LambdaQueryWrapper<MeetingExpert> query = Wrappers.lambdaQuery(MeetingExpert.class) | |||
.in(MeetingExpert::getRuleId, ruleMap.keySet()) | |||
.in(MeetingExpert::getStatus, ExpertAttendStatus.AGREED.getCode()); | |||
.in(MeetingExpert::getStatus, ExpertAttendStatusEnum.AGREED.getCode()); | |||
List<MeetingExpert> meetingExperts = meetingExpertService.list(query); | |||
int totalCount = CollUtils.sum(randomRules, ExpertInviteRule::getInviteCount); | |||
boolean needed = totalCount > meetingExperts.size(); | |||
@@ -235,8 +235,8 @@ public class ExpertInviteTask { | |||
if (expertChoose.getTotal() > 0) { | |||
List<MeetingExpert> expertMeetings = CollUtils.convert(expertChoose.getExperts(), w -> { | |||
MeetingExpert expert = ExpertInviteBuilder.getExpertByRandom(meetingId, w, ruleId); | |||
expert.setPreStatus(ExpertAttendStatus.NOTICING.getCode()); | |||
expert.setStatus(ExpertAttendStatus.NOTICING.getCode()); | |||
expert.setPreStatus(ExpertAttendStatusEnum.NOTICING.getCode()); | |||
expert.setStatus(ExpertAttendStatusEnum.NOTICING.getCode()); | |||
return expert; | |||
}); | |||
yxtCallOrSmsHelper.callByMeetingExperts(meeting, expertMeetings); | |||
@@ -282,13 +282,13 @@ public class ExpertInviteTask { | |||
Collectors.collectingAndThen(Collectors.mapping(Map.Entry::getValue, Collectors.toList()), w -> { | |||
ExpertCntBO cnt = ExpertCntBO.zeroInit(); | |||
for (MeetingExpert expert : w) { | |||
if (ExpertAttendStatus.AGREED.eq(expert.getStatus())) { | |||
if (ExpertAttendStatusEnum.AGREED.eq(expert.getStatus())) { | |||
cnt.incrAgreeCnt(); | |||
} else if (ExpertAttendStatus.NOTICING.eq(expert.getStatus())) { | |||
} else if (ExpertAttendStatusEnum.NOTICING.eq(expert.getStatus())) { | |||
cnt.incrNoticeCnt(); | |||
} else if (ExpertAttendStatus.REPLACED.eq(expert.getStatus())) { | |||
} else if (ExpertAttendStatusEnum.REPLACED.eq(expert.getStatus())) { | |||
MeetingExpert replacedExpert = replacedMap.get(expert.getId()); | |||
if (replacedExpert != null && ExpertAttendStatus.AGREED.eq(replacedExpert.getStatus())) { | |||
if (replacedExpert != null && ExpertAttendStatusEnum.AGREED.eq(replacedExpert.getStatus())) { | |||
cnt.incrAgreeCnt(); | |||
} | |||
} | |||