소스 검색

增加通知情况与邀请情况

master
WendyYang 1 년 전
부모
커밋
ca3f832fd5
6개의 변경된 파일98개의 추가작업 그리고 36개의 파일을 삭제
  1. +0
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/meeting/controller/MeetingController.java
  2. +3
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/domain/Meeting.java
  3. +4
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/vo/ExpertInviteDetailVO.java
  4. +9
    -4
      pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/vo/InviteExpertListItemVO.java
  5. +50
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/vo/InviteStatisticsByRuleVO.java
  6. +32
    -30
      pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/MeetingManage.java

+ 0
- 1
pmapi/src/main/java/com/ningdatech/pmapi/meeting/controller/MeetingController.java 파일 보기

@@ -166,5 +166,4 @@ public class MeetingController {
}



}

+ 3
- 0
pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/domain/Meeting.java 파일 보기

@@ -77,6 +77,9 @@ public class Meeting implements Serializable {
@ApiModelProperty("是否为内部项目")
private Boolean isInnerProject;

@ApiModelProperty("抽取类型")
private Integer inviteType;

@ApiModelProperty("创建人ID")
@TableField(fill = FieldFill.INSERT)
private Long createBy;


+ 4
- 1
pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/vo/ExpertInviteDetailVO.java 파일 보기

@@ -25,6 +25,9 @@ public class ExpertInviteDetailVO {
private Boolean confirmedRoster;

@ApiModelProperty("邀请名单")
private List<RandomInviteListItemVO> inviteExpertList;
private List<InviteExpertListItemVO> inviteExpertList;

@ApiModelProperty("抽取情况")
private List<InviteStatisticsByRuleVO> inviteStatistics;

}

pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/vo/RandomInviteListItemVO.java → pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/vo/InviteExpertListItemVO.java 파일 보기

@@ -5,6 +5,8 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDateTime;

/**
* <p>
* RandomInviteListItemVO
@@ -16,7 +18,10 @@ import lombok.EqualsAndHashCode;
@Data
@ApiModel("邀请名单实体")
@EqualsAndHashCode(callSuper = true)
public class RandomInviteListItemVO extends ExpertBasicInfoVO {
public class InviteExpertListItemVO extends ExpertBasicInfoVO {

@ApiModelProperty("邀请规则ID")
private Long ruleId;

@ApiModelProperty("会议ID")
private Long meetingId;
@@ -27,10 +32,10 @@ public class RandomInviteListItemVO extends ExpertBasicInfoVO {
@ApiModelProperty("电话通知状态")
private String noticeStatus;

@ApiModelProperty("邀请结果")
private String confirmResult;

@ApiModelProperty("邀请状态")
private Integer status;

@ApiModelProperty("通知时间")
private LocalDateTime noticeTime;

}

+ 50
- 0
pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/vo/InviteStatisticsByRuleVO.java 파일 보기

@@ -0,0 +1,50 @@
package com.ningdatech.pmapi.meeting.entity.vo;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
* <p>
* InviteStatisticsVO
* </p>
*
* @author WendyYang
* @since 18:07 2023/3/4
*/
@Data
public class InviteStatisticsByRuleVO {

@ApiModelProperty("抽取规则ID")
private Long ruleId;

@ApiModelProperty("抽取人数")
private Integer inviteCnt;

@ApiModelProperty("同意人数")
private Integer agreeCnt;

@ApiModelProperty("实抽人数")
private Integer noticedCnt;

public static InviteStatisticsByRuleVO init(Long ruleId) {
InviteStatisticsByRuleVO statistics = new InviteStatisticsByRuleVO();
statistics.setRuleId(ruleId);
statistics.setNoticedCnt(0);
statistics.setInviteCnt(0);
statistics.setAgreeCnt(0);
return statistics;
}

public void incrInviteCnt() {
this.inviteCnt++;
}

public void incrAgreeCnt() {
this.agreeCnt++;
}

public void incrNoticedCnt() {
this.noticedCnt++;
}

}

+ 32
- 30
pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/MeetingManage.java 파일 보기

@@ -358,42 +358,44 @@ public class MeetingManage {
if (experts.isEmpty()) {
return result;
}
List<MeetingExpert> randomList = new ArrayList<>();
List<MeetingExpert> appointList = new ArrayList<>();
List<MeetingExpert> attendList = new ArrayList<>();
List<Long> expertIds = new ArrayList<>();
experts.forEach(w -> {
boolean randomInvite = w.getInviteType().equals(ExpertInviteTypeEnum.RANDOM.getCode());
if (randomInvite) {
randomList.add(w);
} else {
appointList.add(w);
}
if (w.getStatus().equals(ExpertAttendStatusEnum.AGREED.getCode())) {
attendList.add(w);
if (randomInvite) {
} else {
}
}
expertIds.add(w.getExpertId());
});
Map<Long, ExpertBasicInfoVO> expertBasicInfoVoMap = meetingManageHelper.getExpertBasicInfo(expertIds);
Function<MeetingExpert, RandomInviteListItemVO> mapping = sme -> {
ExpertBasicInfoVO basicInfoVo = expertBasicInfoVoMap.get(sme.getExpertId());
RandomInviteListItemVO item = BeanUtil.copyProperties(basicInfoVo, RandomInviteListItemVO.class);
item.setStatus(sme.getStatus());
item.setMeetingId(sme.getMeetingId());
List<Long> expertIds = CollUtils.fieldList(experts, MeetingExpert::getExpertId);
Map<Long, ExpertBasicInfoVO> expertMap = meetingManageHelper.getExpertBasicInfo(expertIds);
Function<MeetingExpert, InviteExpertListItemVO> mapping = sme -> {
ExpertBasicInfoVO expert = expertMap.get(sme.getExpertId());
InviteExpertListItemVO item = BeanUtil.copyProperties(expert, InviteExpertListItemVO.class);
item.setExpertMeetingId(sme.getId());
ExpertAttendStatusEnum status = ExpertAttendStatusEnum.getByCode(sme.getStatus());
if (status.equals(ExpertAttendStatusEnum.NOTICING)) {
item.setNoticeStatus(status.getValue());
item.setConfirmResult(StrUtil.EMPTY);
item.setMeetingId(sme.getMeetingId());
item.setStatus(sme.getStatus());
item.setNoticeTime(sme.getCreateOn());
item.setRuleId(sme.getRuleId());
if (ExpertAttendStatusEnum.NOTICING.eq(sme.getStatus())) {
item.setNoticeStatus("通知中");
} else {
item.setNoticeStatus("已通知");
item.setConfirmResult(status.getValue());
}
return item;
};
boolean isRandom = ExpertInviteTypeEnum.RANDOM.eq(meeting.getInviteType());
if (!isRandom) {
result.setInviteStatistics(new ArrayList<>());
Map<Long, List<MeetingExpert>> groupByRule = CollUtils.group(experts, MeetingExpert::getRuleId);
List<ExpertInviteRule> inviteRules = inviteRuleService.listByIds(groupByRule.keySet());
Map<Long, ExpertInviteRule> ruleMap = CollUtils.listToMap(inviteRules, ExpertInviteRule::getId);
groupByRule.forEach((ruleId, expertList) -> {
InviteStatisticsByRuleVO statistics = InviteStatisticsByRuleVO.init(ruleId);
expertList.forEach((expert) -> {
Integer status = expert.getStatus();
if (ExpertAttendStatusEnum.AGREED.eq(status)) {
statistics.incrAgreeCnt();
}
statistics.setInviteCnt(ruleMap.get(ruleId).getInviteCount());
statistics.incrNoticedCnt();
});
result.getInviteStatistics().add(statistics);
});
}
List<InviteExpertListItemVO> converts = CollUtils.convert(experts, mapping);
result.setInviteExpertList(converts);
// 确定参加列表
return result;
}


불러오는 중...
취소
저장