|
|
@@ -58,6 +58,7 @@ import java.util.*; |
|
|
|
import java.util.function.Function; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
import static com.ningdatech.pmapi.meeting.entity.enumeration.ExpertAttendStatusEnum.*; |
|
|
|
import static com.ningdatech.pmapi.meeting.helper.ExpertInviteHelper.getExpertInviteRule; |
|
|
|
|
|
|
|
/** |
|
|
@@ -252,7 +253,7 @@ public class MeetingManage { |
|
|
|
List<MeetingExpert> experts = appointRule.getExpertIdList().stream().map(w -> { |
|
|
|
ExpertUserFullInfo info = usersMap.get(w); |
|
|
|
MeetingExpert expert = ExpertInviteBuilder.getExpertByAppoint(meeting.getId(), info, ruleId); |
|
|
|
expert.setStatus(ExpertAttendStatusEnum.NOTICING.getCode()); |
|
|
|
expert.setStatus(NOTICING.getCode()); |
|
|
|
return expert; |
|
|
|
}).collect(Collectors.toList()); |
|
|
|
meetingExpertService.saveBatch(experts); |
|
|
@@ -299,7 +300,7 @@ public class MeetingManage { |
|
|
|
* @return 会议列表 |
|
|
|
* @author WendyYang |
|
|
|
**/ |
|
|
|
public PageVo<MeetingByManagerVO> meetingListByExpert(MeetingListReq req) { |
|
|
|
public PageVo<MeetingByManagerVO> meetingListForExpert(MeetingListReq req) { |
|
|
|
Long expertId = req.getExpertId() != null ? req.getExpertId() : LoginUserUtil.getUserId(); |
|
|
|
List<MeetingAndAttendStatusDTO> meetings = meetingExpertService.listByExpertIdAndStatus(expertId, null, null); |
|
|
|
if (meetings.isEmpty()) { |
|
|
@@ -329,6 +330,37 @@ public class MeetingManage { |
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|
public PageVo<MeetingByManagerVO> meetingListForLeave(MeetingLeaveListReq req) { |
|
|
|
Long expertId = ObjectUtil.defaultIfNull(req.getExpertId(), LoginUserUtil.getUserId()); |
|
|
|
LambdaQueryWrapper<MeetingExpert> meQuery = Wrappers.lambdaQuery(MeetingExpert.class) |
|
|
|
.eq(MeetingExpert::getExpertId, expertId) |
|
|
|
.in(MeetingExpert::getStatus, AGREED.getCode(), ON_LEAVE.getCode()); |
|
|
|
List<MeetingExpert> meetings = meetingExpertService.list(meQuery); |
|
|
|
if (meetings.isEmpty()) { |
|
|
|
return PageVo.empty(); |
|
|
|
} |
|
|
|
Map<Long, MeetingExpert> meetingMap = new HashMap<>(16); |
|
|
|
meetings.forEach(w -> meetingMap.put(w.getMeetingId(), w)); |
|
|
|
LambdaQueryWrapper<Meeting> query = new LambdaQueryWrapper<Meeting>() |
|
|
|
.orderByAsc(Meeting::getStartTime) |
|
|
|
.in(Meeting::getId, meetingMap.keySet()) |
|
|
|
.eq(Meeting::getConfirmedRoster, Boolean.TRUE) |
|
|
|
.ne(Meeting::getStatus, MeetingStatusEnum.CANCELED.getCode()); |
|
|
|
Page<Meeting> page = meetingService.page(req.page(), query); |
|
|
|
if (page.getTotal() == 0) { |
|
|
|
return PageVo.empty(); |
|
|
|
} |
|
|
|
PageVo<MeetingByManagerVO> result = new PageVo<>(new ArrayList<>(), page.getTotal()); |
|
|
|
page.getRecords().forEach(meeting -> { |
|
|
|
MeetingByManagerVO item = meetingManageHelper.buildByMeeting(meeting); |
|
|
|
MeetingExpert info = meetingMap.get(meeting.getId()); |
|
|
|
item.setExpertStatus(info.getStatus()); |
|
|
|
result.getRecords().add(item); |
|
|
|
}); |
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* 管理员会议列表 |
|
|
|
* |
|
|
@@ -336,7 +368,7 @@ public class MeetingManage { |
|
|
|
* @return 会议列表 |
|
|
|
* @author WendyYang |
|
|
|
*/ |
|
|
|
public PageVo<MeetingByManagerVO> meetingListByManager(MeetingListReq req) { |
|
|
|
public PageVo<MeetingByManagerVO> meetingListForManager(MeetingListReq req) { |
|
|
|
LambdaQueryWrapper<Meeting> query = new LambdaQueryWrapper<Meeting>() |
|
|
|
.orderByDesc(Meeting::getCreateOn); |
|
|
|
// 补充逻辑 如果拥有超级管理员权限可以看到所有事务 |
|
|
@@ -424,7 +456,7 @@ public class MeetingManage { |
|
|
|
item.setMobile(me.getMobile()); |
|
|
|
item.setNoticeTime(me.getCreateOn()); |
|
|
|
item.setRuleId(me.getRuleId()); |
|
|
|
if (ExpertAttendStatusEnum.NOTICING.eq(me.getStatus())) { |
|
|
|
if (NOTICING.eq(me.getStatus())) { |
|
|
|
item.setNoticeStatus("通知中"); |
|
|
|
} else { |
|
|
|
item.setNoticeStatus("已通知"); |
|
|
@@ -441,7 +473,7 @@ public class MeetingManage { |
|
|
|
InviteStatisticsByRuleVO statistics = InviteStatisticsByRuleVO.init(ruleId); |
|
|
|
expertList.forEach((expert) -> { |
|
|
|
Integer status = expert.getStatus(); |
|
|
|
if (ExpertAttendStatusEnum.AGREED.eq(status)) { |
|
|
|
if (AGREED.eq(status)) { |
|
|
|
statistics.incrAgreeCnt(); |
|
|
|
} |
|
|
|
statistics.setInviteCnt(ruleMap.get(ruleId).getInviteCount()); |
|
|
@@ -563,7 +595,7 @@ public class MeetingManage { |
|
|
|
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()); |
|
|
|
me.setStatus(NOTICING.getCode()); |
|
|
|
return me; |
|
|
|
}); |
|
|
|
meetingExpertService.saveBatch(expertList); |
|
|
@@ -616,7 +648,7 @@ public class MeetingManage { |
|
|
|
if (me == null) { |
|
|
|
throw BizException.wrap("未被邀请参加此会议"); |
|
|
|
} |
|
|
|
if (ExpertAttendStatusEnum.AGREED.eq(me.getStatus())) { |
|
|
|
if (AGREED.eq(me.getStatus())) { |
|
|
|
throw BizException.wrap("未确认参加此会议"); |
|
|
|
} |
|
|
|
ExpertUserFullInfo userInfo = expertUserFullInfoService.getByUserId(userId); |
|
|
@@ -641,11 +673,11 @@ public class MeetingManage { |
|
|
|
} |
|
|
|
try { |
|
|
|
MeetingExpert me = meetingExpertService.getById(req.getExpertMeetingId()); |
|
|
|
if (!ExpertAttendStatusEnum.NOTICING.eq(me.getStatus())) { |
|
|
|
if (!NOTICING.eq(me.getStatus())) { |
|
|
|
throw BizException.wrap("%s失败,请重试!", msgPrefix); |
|
|
|
} |
|
|
|
LambdaUpdateWrapper<MeetingExpert> update = Wrappers.lambdaUpdate(MeetingExpert.class) |
|
|
|
.set(MeetingExpert::getStatus, (req.getAgreed() ? ExpertAttendStatusEnum.AGREED : ExpertAttendStatusEnum.REFUSED).getCode()) |
|
|
|
.set(MeetingExpert::getStatus, (req.getAgreed() ? AGREED : REFUSED).getCode()) |
|
|
|
.eq(MeetingExpert::getId, req.getExpertMeetingId()); |
|
|
|
meetingExpertService.update(update); |
|
|
|
} finally { |
|
|
@@ -664,7 +696,7 @@ public class MeetingManage { |
|
|
|
throw BizException.wrap("会议已取消"); |
|
|
|
} |
|
|
|
LambdaUpdateWrapper<MeetingExpert> update = Wrappers.lambdaUpdate(MeetingExpert.class) |
|
|
|
.set(MeetingExpert::getStatus, ExpertAttendStatusEnum.RELEASED.getCode()) |
|
|
|
.set(MeetingExpert::getStatus, RELEASED.getCode()) |
|
|
|
.eq(MeetingExpert::getMeetingId, req.getMeetingId()); |
|
|
|
meetingExpertService.update(update); |
|
|
|
} finally { |
|
|
@@ -689,8 +721,8 @@ public class MeetingManage { |
|
|
|
.eq(MeetingExpert::getMeetingId, req.getMeetingId()); |
|
|
|
meetingExpertService.update(cancel); |
|
|
|
MeetingExpert headman = meetingExpertService.getById(req.getExpertMeetingId()); |
|
|
|
if (!ExpertAttendStatusEnum.AGREED.eq(headman.getStatus())) { |
|
|
|
ExpertAttendStatusEnum status = ExpertAttendStatusEnum.getByCode(headman.getStatus()); |
|
|
|
if (!AGREED.eq(headman.getStatus())) { |
|
|
|
ExpertAttendStatusEnum status = getByCode(headman.getStatus()); |
|
|
|
throw BizException.wrap("该专家处于:%s状态,不能被设置为专家组长!", status.getValue()); |
|
|
|
} |
|
|
|
LambdaUpdateWrapper<MeetingExpert> setup = Wrappers.lambdaUpdate(MeetingExpert.class) |
|
|
|