Browse Source

增加会议请假列表

tags/24080901
WendyYang 1 year ago
parent
commit
7e5554423d
6 changed files with 81 additions and 15 deletions
  1. +9
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/meeting/controller/MeetingController.java
  2. +21
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/req/MeetingLeaveListReq.java
  3. +3
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/req/MeetingListReq.java
  4. +3
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/meeting/helper/MeetingManageHelper.java
  5. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/DashboardManage.java
  6. +44
    -12
      pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/MeetingManage.java

+ 9
- 2
pmapi/src/main/java/com/ningdatech/pmapi/meeting/controller/MeetingController.java View File

@@ -72,14 +72,21 @@ public class MeetingController {
@GetMapping("/manager/meetingList")
@WebLog(value = "管理员会议列表")
public PageVo<MeetingByManagerVO> meetingListByManager(MeetingListReq req) {
return meetingManage.meetingListByManager(req);
return meetingManage.meetingListForManager(req);
}

@ApiOperation("专家会议列表")
@GetMapping("/expert/meetingList")
@WebLog(value = "专家会议列表")
public PageVo<MeetingByManagerVO> meetingListByExpert(MeetingListReq po) {
return meetingManage.meetingListByExpert(po);
return meetingManage.meetingListForExpert(po);
}

@ApiOperation("专家请假会议列表")
@GetMapping("/expert/meetingListForLeave")
@WebLog(value = "专家请假会议列表")
public PageVo<MeetingByManagerVO> meetingListForLeave(MeetingLeaveListReq req) {
return meetingManage.meetingListForLeave(req);
}

@ApiOperation("会议详情-基本信息")


+ 21
- 0
pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/req/MeetingLeaveListReq.java View File

@@ -0,0 +1,21 @@
package com.ningdatech.pmapi.meeting.entity.req;

import com.ningdatech.basic.model.PagePo;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
* <p>
* MeetingListForLeaveReq
* </p>
*
* @author WendyYang
* @since 17:03 2023/4/3
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class MeetingLeaveListReq extends PagePo {

private Long expertId;

}

+ 3
- 0
pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/req/MeetingListReq.java View File

@@ -51,4 +51,7 @@ public class MeetingListReq extends PagePo {
@ApiModelProperty("区域层级")
private Integer regionLevel;

@ApiModelProperty("参会名单是否确认")
private Boolean confirmedRoster;

}

+ 3
- 0
pmapi/src/main/java/com/ningdatech/pmapi/meeting/helper/MeetingManageHelper.java View File

@@ -145,6 +145,9 @@ public class MeetingManageHelper {
if (req.getEndTime() != null) {
query.le(Meeting::getEndTime, req.getEndTime());
}
if (req.getConfirmedRoster() != null) {
query.eq(Meeting::getConfirmedRoster, req.getConfirmedRoster());
}
if (StrUtils.isNotBlank(req.getProjectName())) {
String projectName = "%" + req.getProjectName() + "%";
query.and(q1 -> q1.exists("select 1 from nd_project np inner join meeting_inner_project mip on mip.project_id = np.id" +


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

@@ -63,7 +63,7 @@ public class DashboardManage {
meetingListPo.setPageSize(500);
meetingListPo.setStartTime(po.getStartDate().atStartOfDay());
meetingListPo.setEndTime(po.getEndDate().atTime(LocalTime.MAX));
PageVo<MeetingByManagerVO> meetingPage = meetingManage.meetingListByExpert(meetingListPo);
PageVo<MeetingByManagerVO> meetingPage = meetingManage.meetingListForExpert(meetingListPo);
Map<LocalDate, List<MeetingByManagerVO>> meetingByDate = meetingPage.getRecords().stream().map(w -> {
List<Pair<LocalDate, MeetingByManagerVO>> pairs = new ArrayList<>();
LocalDateTime tempTime = w.getStartTime();


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

@@ -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)


Loading…
Cancel
Save