Bläddra i källkod

增加专家画像接口

master
WendyYang 11 månader sedan
förälder
incheckning
5cb5943734
19 ändrade filer med 257 tillägg och 89 borttagningar
  1. +2
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/common/constant/BizConst.java
  2. +12
    -13
      hz-pm-api/src/main/java/com/hz/pm/api/common/util/BizUtils.java
  3. +18
    -18
      hz-pm-api/src/main/java/com/hz/pm/api/expert/assembler/ExpertAdminExpertManageAssembler.java
  4. +9
    -8
      hz-pm-api/src/main/java/com/hz/pm/api/expert/controller/ExpertController.java
  5. +3
    -3
      hz-pm-api/src/main/java/com/hz/pm/api/expert/manage/ExpertAdminManage.java
  6. +65
    -2
      hz-pm-api/src/main/java/com/hz/pm/api/expert/manage/ExpertManage.java
  7. +1
    -1
      hz-pm-api/src/main/java/com/hz/pm/api/expert/model/vo/ExpertLibraryListItemVO.java
  8. +64
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/expert/model/vo/ExpertPortraitVO.java
  9. +2
    -2
      hz-pm-api/src/main/java/com/hz/pm/api/meeting/controller/MeetingController.java
  10. +6
    -2
      hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/dto/ExpertInvitedRecordDTO.java
  11. +0
    -5
      hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/vo/MeetingByManagerVO.java
  12. +15
    -15
      hz-pm-api/src/main/java/com/hz/pm/api/meeting/helper/MeetingManageHelper.java
  13. +2
    -2
      hz-pm-api/src/main/java/com/hz/pm/api/meeting/manage/DashboardManage.java
  14. +3
    -3
      hz-pm-api/src/main/java/com/hz/pm/api/meeting/manage/MeetingManage.java
  15. +17
    -4
      hz-pm-api/src/main/java/com/hz/pm/api/meeting/mapper/MeetingExpertMapper.java
  16. +15
    -1
      hz-pm-api/src/main/java/com/hz/pm/api/meeting/mapper/MeetingExpertMapper.xml
  17. +11
    -5
      hz-pm-api/src/main/java/com/hz/pm/api/meeting/service/IMeetingExpertJudgeService.java
  18. +4
    -2
      hz-pm-api/src/main/java/com/hz/pm/api/meeting/service/IMeetingExpertService.java
  19. +8
    -3
      hz-pm-api/src/main/java/com/hz/pm/api/meeting/service/impl/MeetingExpertServiceImpl.java

+ 2
- 0
hz-pm-api/src/main/java/com/hz/pm/api/common/constant/BizConst.java Visa fil

@@ -39,6 +39,8 @@ public class BizConst {
*/
public static final long ROOT_REGION_CODE = 100000L;

public static final double D100 = 100.0;

/**
* 一级行政区划数量
*/


+ 12
- 13
hz-pm-api/src/main/java/com/hz/pm/api/common/util/BizUtils.java Visa fil

@@ -3,11 +3,9 @@ package com.hz.pm.api.common.util;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.hz.pm.api.projectlib.enumeration.ProjectTypeNewEnum;
import com.ningdatech.basic.util.StrPool;
import com.ningdatech.file.entity.vo.result.FileResultVO;
import com.hz.pm.api.projectlib.enumeration.ProjectTypeEnum;
import com.hz.pm.api.projectlib.enumeration.ProjectTypeNewEnum;
import org.apache.commons.lang3.StringUtils;
import org.springframework.util.NumberUtils;

@@ -121,7 +119,7 @@ public class BizUtils {

public static String getProjectTypeName(String projectType) {
if (Objects.nonNull(projectType)) {
return ProjectTypeNewEnum.getDesc(projectType);
return ProjectTypeNewEnum.getDesc(projectType);
}
return StringUtils.EMPTY;
}
@@ -134,17 +132,17 @@ public class BizUtils {
}

public static String computeRise(Integer numa, Integer numb) {
if((Objects.isNull(numb)|| numb.equals(0)) &&
(Objects.isNull(numa)|| numa.equals(0))){
if ((Objects.isNull(numb) || numb.equals(0)) &&
(Objects.isNull(numa) || numa.equals(0))) {
return "0";
}
if(Objects.isNull(numa) || numa.equals(0)){
if (Objects.isNull(numa) || numa.equals(0)) {
return "-100";
}
if(Objects.isNull(numb)|| numb.equals(0)){
if (Objects.isNull(numb) || numb.equals(0)) {
return "100";
}
return BigDecimal.valueOf((numa - numb) * 100.0).divide(BigDecimal.valueOf(numb),2, RoundingMode.CEILING)
return BigDecimal.valueOf((numa - numb) * 100.0).divide(BigDecimal.valueOf(numb), 2, RoundingMode.CEILING)
.stripTrailingZeros().toPlainString();
}

@@ -155,22 +153,23 @@ public class BizUtils {
}

public static LocalDateTime convertLocalDateTime(String time) {
if(StringUtils.isBlank(time)){
if (StringUtils.isBlank(time)) {
return null;
}
String[] timeSplit = time.split(StrPool.DASH);
String year = timeSplit[0];
String month = "01";
String dayOfMonth = "01";
if(timeSplit.length > 1){
if (timeSplit.length > 1) {
month = timeSplit[1];
}
if(timeSplit.length > 2){
if (timeSplit.length > 2) {
dayOfMonth = timeSplit[2];
}
return LocalDateTime.of(Integer.parseInt(year),
Integer.parseInt(month),
Integer.parseInt(dayOfMonth)
,0,0,0);
, 0, 0, 0);
}

}

+ 18
- 18
hz-pm-api/src/main/java/com/hz/pm/api/expert/assembler/ExpertAdminExpertManageAssembler.java Visa fil

@@ -7,7 +7,7 @@ import com.hz.pm.api.expert.constant.QueryExpertAccountStatusEnum;
import com.hz.pm.api.expert.model.DictionaryFieldInfo;
import com.hz.pm.api.expert.model.TagFieldInfo;
import com.hz.pm.api.expert.model.dto.ExpertAdminExpertManageListDTO;
import com.hz.pm.api.expert.model.vo.ExpertAdminExpertManageListVO;
import com.hz.pm.api.expert.model.vo.ExpertLibraryListItemVO;
import com.hz.pm.api.meta.helper.DictionaryCache;
import com.hz.pm.api.meta.helper.impl.TagsCacheImpl;
import com.hz.pm.api.meta.model.ExpertRegionInfo;
@@ -36,28 +36,28 @@ public class ExpertAdminExpertManageAssembler {
private final TagsCacheImpl tagCache;
private final RegionCacheHelper regionCache;

public List<ExpertAdminExpertManageListVO> toExpertAdminExpertManageListVOList(
public List<ExpertLibraryListItemVO> toExpertAdminExpertManageListVOList(
List<ExpertAdminExpertManageListDTO> expertManageListDTOList) {
if (CollectionUtil.isEmpty(expertManageListDTOList)) {
return new ArrayList<>();
}
return expertManageListDTOList.stream().map(r -> {
ExpertAdminExpertManageListVO expertAdminExpertManageListVO = new ExpertAdminExpertManageListVO();
expertAdminExpertManageListVO.setUserId(r.getUserId());
expertAdminExpertManageListVO.setExpertName(r.getExpertName());
expertAdminExpertManageListVO.setPhoneNo(r.getPhoneNo());
expertAdminExpertManageListVO.setIsDingUser(r.getIsDingUser());
expertAdminExpertManageListVO.setCompany(r.getCompany());
expertAdminExpertManageListVO.setLegalEntityCode(r.getLegalEntityCode());
ExpertLibraryListItemVO expertLibraryListItemVO = new ExpertLibraryListItemVO();
expertLibraryListItemVO.setUserId(r.getUserId());
expertLibraryListItemVO.setExpertName(r.getExpertName());
expertLibraryListItemVO.setPhoneNo(r.getPhoneNo());
expertLibraryListItemVO.setIsDingUser(r.getIsDingUser());
expertLibraryListItemVO.setCompany(r.getCompany());
expertLibraryListItemVO.setLegalEntityCode(r.getLegalEntityCode());

if (StringUtils.isNotBlank(r.getExpertAccountStatus())) {
ExpertAccountStatusEnum statusEnum = ExpertAccountStatusEnum.of(r.getExpertAccountStatus());
switch (statusEnum) {
case FREEZE:
expertAdminExpertManageListVO.setExpertAccountStatus(QueryExpertAccountStatusEnum.FREEZING.getKey());
expertLibraryListItemVO.setExpertAccountStatus(QueryExpertAccountStatusEnum.FREEZING.getKey());
break;
case AVAILABLE:
expertAdminExpertManageListVO.setExpertAccountStatus(QueryExpertAccountStatusEnum.NORMAL.getKey());
expertLibraryListItemVO.setExpertAccountStatus(QueryExpertAccountStatusEnum.NORMAL.getKey());
break;
default:
break;
@@ -72,32 +72,32 @@ public class ExpertAdminExpertManageAssembler {
expertRegionInfo.setRegionCode(regionDTO.getRegionCode());
expertRegionInfo.setRegionLevel(regionDTO.getRegionLevel());
expertRegionInfo.setRegionName(regionDTO.getRegionName());
expertAdminExpertManageListVO.setExpertRegionInfo(expertRegionInfo);
expertLibraryListItemVO.setExpertRegionInfo(expertRegionInfo);
}
}
List<DictionaryFieldInfo> expertType = r.getExpertType();
if (CollectionUtils.isNotEmpty(expertType)) {
expertType = assembleDictionaryName(expertType);
expertAdminExpertManageListVO.setExpertType(expertType);
expertLibraryListItemVO.setExpertType(expertType);
}
List<DictionaryFieldInfo> companyAttribute = r.getCompanyAttribute();
if (CollectionUtils.isNotEmpty(companyAttribute)) {
companyAttribute = assembleDictionaryName(companyAttribute);
expertAdminExpertManageListVO.setCompanyAttribute(companyAttribute);
expertLibraryListItemVO.setCompanyAttribute(companyAttribute);
}
List<DictionaryFieldInfo> titleLevel = r.getTitleLevel();
if (CollectionUtils.isNotEmpty(titleLevel)) {
titleLevel = assembleDictionaryName(titleLevel);
expertAdminExpertManageListVO.setTitleLevel(titleLevel);
expertLibraryListItemVO.setTitleLevel(titleLevel);
}

List<TagFieldInfo> expertSource = r.getExpertSource();
if (CollectionUtils.isNotEmpty(expertSource)) {
expertSource = assembleTagName(expertSource);
expertAdminExpertManageListVO.setExpertSource(expertSource);
expertLibraryListItemVO.setExpertSource(expertSource);
}
expertAdminExpertManageListVO.setCreateTime(r.getCreateTime());
return expertAdminExpertManageListVO;
expertLibraryListItemVO.setCreateTime(r.getCreateTime());
return expertLibraryListItemVO;
}).collect(Collectors.toList());

}


+ 9
- 8
hz-pm-api/src/main/java/com/hz/pm/api/expert/controller/ExpertController.java Visa fil

@@ -1,8 +1,6 @@
package com.hz.pm.api.expert.controller;


import com.ningdatech.basic.model.PageVo;
import com.ningdatech.log.annotation.WebLog;
import com.hz.pm.api.expert.manage.ExpertAdminManage;
import com.hz.pm.api.expert.manage.ExpertManage;
import com.hz.pm.api.expert.model.ExpertAdminExpertManageQuery;
@@ -10,10 +8,9 @@ import com.hz.pm.api.expert.model.req.AdminExpertBasicInfoModifyRequest;
import com.hz.pm.api.expert.model.req.ExpertRegistrationRequest;
import com.hz.pm.api.expert.model.req.ExpertUserBasicInfoSubmitRequest;
import com.hz.pm.api.expert.model.req.GetZzdInfoRequest;
import com.hz.pm.api.expert.model.vo.ExpertAdminExpertManageListVO;
import com.hz.pm.api.expert.model.vo.ExpertBasicInfoModifyResultVO;
import com.hz.pm.api.expert.model.vo.ExpertFullInfoVO;
import com.hz.pm.api.expert.model.vo.ZzdInfoByMobileVO;
import com.hz.pm.api.expert.model.vo.*;
import com.ningdatech.basic.model.PageVo;
import com.ningdatech.log.annotation.WebLog;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
@@ -80,13 +77,17 @@ public class ExpertController {
expertManage.expertBasicInfoSubmit(request);
}

@GetMapping("/portrait/{expertId}/{year}")
public ExpertPortraitVO expertPortrait(@PathVariable Long expertId, @PathVariable Integer year) {
return expertManage.expertPortrait(expertId, year);
}

@GetMapping("/detail")
@ApiOperation("专家获取专家详细信息")
public ExpertFullInfoVO getExpertFullInfoDetail() {
return expertManage.getExpertFullInfoDetail(null);
}


@GetMapping("/admin/detail")
@ApiOperation("专家管理员获取专家详细信息")
public ExpertFullInfoVO getExpertFullInfoDetail(@RequestParam(value = "expertUserId") @NotNull Long expertUserId) {
@@ -95,7 +96,7 @@ public class ExpertController {

@PostMapping("/expert-library/list")
@ApiOperation("专家库列表查询接口")
public PageVo<ExpertAdminExpertManageListVO> getExpertLibraryList(@RequestBody @Valid ExpertAdminExpertManageQuery query) {
public PageVo<ExpertLibraryListItemVO> getExpertLibraryList(@RequestBody @Valid ExpertAdminExpertManageQuery query) {
return expertAdminManage.getExpertLibraryList(query);
}



+ 3
- 3
hz-pm-api/src/main/java/com/hz/pm/api/expert/manage/ExpertAdminManage.java Visa fil

@@ -29,7 +29,7 @@ import com.hz.pm.api.expert.model.query.ExpertTagQuery;
import com.hz.pm.api.expert.model.req.AdminExpertBasicInfoModifyRequest;
import com.hz.pm.api.expert.model.req.GetZzdInfoRequest;
import com.hz.pm.api.expert.model.req.MetaApplyResultRequest;
import com.hz.pm.api.expert.model.vo.ExpertAdminExpertManageListVO;
import com.hz.pm.api.expert.model.vo.ExpertLibraryListItemVO;
import com.hz.pm.api.expert.model.vo.ExpertBasicInfoModifyResultVO;
import com.hz.pm.api.expert.model.vo.ZzdInfoByMobileVO;
import com.hz.pm.api.expert.service.ExpertAdminManageService;
@@ -77,7 +77,7 @@ public class ExpertAdminManage {
* @param query
* @return
*/
public PageVo<ExpertAdminExpertManageListVO> getExpertLibraryList(ExpertAdminExpertManageQuery query) {
public PageVo<ExpertLibraryListItemVO> getExpertLibraryList(ExpertAdminExpertManageQuery query) {
Long userId = LoginUserUtil.getUserId();
ExpertAdminExpertManageQueryCmd queryCmd = buildExpertAdminExpertManageQueryCmd(query, userId);
if (queryCmd.isHasNonData()) {
@@ -85,7 +85,7 @@ public class ExpertAdminManage {
}
CommonPage<ExpertAdminExpertManageListDTO> pageResult = expertAdminManageService.getExpertLibraryList(queryCmd);

PageVo<ExpertAdminExpertManageListVO> pageVo = new PageVo<>();
PageVo<ExpertLibraryListItemVO> pageVo = new PageVo<>();
pageVo.setTotal(pageResult.getItemsTotal());
pageVo.setRecords(expertAdminExpertManageAssembler.toExpertAdminExpertManageListVOList(pageResult.getItems()));
return pageVo;


+ 65
- 2
hz-pm-api/src/main/java/com/hz/pm/api/expert/manage/ExpertManage.java Visa fil

@@ -3,7 +3,9 @@ package com.hz.pm.api.expert.manage;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.hz.pm.api.common.constant.BizConst;
import com.hz.pm.api.common.model.FileBasicInfo;
import com.hz.pm.api.common.model.entity.KeyValDTO;
import com.hz.pm.api.common.util.BizUtils;
import com.hz.pm.api.expert.assembler.ExpertInfoCmdAssembler;
import com.hz.pm.api.expert.assembler.ExpertUserInfoAssembler;
@@ -20,9 +22,17 @@ import com.hz.pm.api.expert.model.dto.ExpertFullInfoAllDTO;
import com.hz.pm.api.expert.model.req.ExpertRegistrationRequest;
import com.hz.pm.api.expert.model.req.ExpertUserBasicInfoSubmitRequest;
import com.hz.pm.api.expert.model.vo.ExpertFullInfoVO;
import com.hz.pm.api.expert.model.vo.ExpertPortraitVO;
import com.hz.pm.api.expert.service.ExpertInfoService;
import com.hz.pm.api.expert.service.IExpertUserFullInfoService;
import com.hz.pm.api.meeting.entity.config.WebProperties;
import com.hz.pm.api.meeting.entity.domain.MeetingExpertJudge;
import com.hz.pm.api.meeting.entity.dto.ExpertInvitedRecordDTO;
import com.hz.pm.api.meeting.entity.enumeration.ExpertAttendStatusEnum;
import com.hz.pm.api.meeting.entity.enumeration.ExpertJudgeEnum.AttendStatus;
import com.hz.pm.api.meeting.entity.enumeration.ExpertJudgeEnum.Performance;
import com.hz.pm.api.meeting.service.IMeetingExpertJudgeService;
import com.hz.pm.api.meeting.service.IMeetingExpertService;
import com.hz.pm.api.meta.constant.DictExpertInfoTypeEnum;
import com.hz.pm.api.meta.model.ExpertRegionInfo;
import com.hz.pm.api.sms.constant.VerificationCodeType;
@@ -38,6 +48,7 @@ import com.hz.pm.api.user.service.IUserInfoService;
import com.hz.pm.api.user.util.LoginUserUtil;
import com.ningdatech.basic.exception.BizException;
import com.ningdatech.basic.model.GenericResult;
import com.ningdatech.basic.util.CollUtils;
import com.ningdatech.cache.model.cache.CacheKey;
import com.ningdatech.cache.repository.CachePlusOps;
import com.ningdatech.file.entity.vo.result.AttachFileVo;
@@ -55,11 +66,13 @@ import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.time.Duration;
import java.time.LocalDateTime;
import java.time.*;
import java.time.temporal.TemporalAdjusters;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;

/**
@@ -84,6 +97,8 @@ public class ExpertManage {
private final VerifyCodeCheckHelper verifyCodeCheckHelper;
private final CachePlusOps cachePlusOps;
private final ZwddClient zwddClient;
private final IMeetingExpertService meetingExpertService;
private final IMeetingExpertJudgeService expertJudgeService;

@Value("${expert-registration.verify-code.check:true}")
private Boolean expertRegistrationVerifyCodeCheck;
@@ -291,4 +306,52 @@ public class ExpertManage {
return userId;
}

public ExpertPortraitVO expertPortrait(Long expertId, Integer year) {
ExpertPortraitVO portrait = ExpertPortraitVO.init();
LocalDate firstDate = LocalDate.of(year, 1, 1);
LocalDateTime sTime = firstDate.atStartOfDay();
LocalDateTime eTime = firstDate.with(TemporalAdjusters.lastDayOfYear()).atTime(LocalTime.MAX);
List<ExpertInvitedRecordDTO> meetings = meetingExpertService.listByExpertIdAndTime(expertId, sTime, eTime);
portrait.setReceivedCount(meetings.size());
if (!meetings.isEmpty()) {
AtomicInteger agreedCount = new AtomicInteger(0);
Map<Integer, Long> countByPerMonth = meetings.stream()
.filter(w -> {
boolean agreed = ExpertAttendStatusEnum.AGREED.eq(w.getStatus());
if (agreed) {
agreedCount.incrementAndGet();
}
return agreed;
}).collect(Collectors.groupingBy(w -> w.getCreateOn().getMonthValue(), Collectors.counting()));
portrait.setAttendCountPerMonth(new ArrayList<>());
for (int i = 1; i <= Month.DECEMBER.getValue(); i++) {
KeyValDTO<Integer, Long> currMonth = KeyValDTO.of(i, countByPerMonth.getOrDefault(i, 0L));
portrait.getAttendCountPerMonth().add(currMonth);
}
portrait.setConfirmedCount(agreedCount.get());
List<Long> meetingExpertIds = CollUtils.fieldList(meetings, ExpertInvitedRecordDTO::getMeetingExpertId);
List<MeetingExpertJudge> expertJudges = expertJudgeService.listByMeetingExpertIds(meetingExpertIds);
if (!expertJudges.isEmpty()) {
int positivity = 0;
for (MeetingExpertJudge expertJudge : expertJudges) {
if (AttendStatus.BE_LATE.eq(expertJudge.getAttended())) {
portrait.incrBeLateCount();
}
if (Boolean.TRUE.equals(expertJudge.getLeaveEarly())) {
portrait.incrLeaveEarlyCount();
}
if (Boolean.TRUE.equals(expertJudge.getBrokeRule())) {
portrait.incrViolationCount();
}
if (Performance.POSITIVE.eq(expertJudge.getPerformance())) {
positivity++;
}
}
portrait.setPositivity((int) Math.round(positivity * BizConst.D100 / expertJudges.size()));
}

}
return portrait;
}

}

hz-pm-api/src/main/java/com/hz/pm/api/expert/model/vo/ExpertAdminExpertManageListVO.java → hz-pm-api/src/main/java/com/hz/pm/api/expert/model/vo/ExpertLibraryListItemVO.java Visa fil

@@ -17,7 +17,7 @@ import java.util.List;
*/
@Data
@ApiModel("专家库列表查询返回model")
public class ExpertAdminExpertManageListVO {
public class ExpertLibraryListItemVO {

@ApiModelProperty(value = "用户id")
private Long userId;

+ 64
- 0
hz-pm-api/src/main/java/com/hz/pm/api/expert/model/vo/ExpertPortraitVO.java Visa fil

@@ -0,0 +1,64 @@
package com.hz.pm.api.expert.model.vo;

import com.hz.pm.api.common.model.entity.KeyValDTO;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.List;

/**
* <p>
* ExpertPortraitVO
* </p>
*
* @author WendyYang
* @since 10:46 2023/12/19
*/
@Data
public class ExpertPortraitVO {

@ApiModelProperty("收到邀请次数")
private Integer receivedCount;

@ApiModelProperty("确认参加次数")
private Integer confirmedCount;

@ApiModelProperty("迟到次数")
private Integer beLateCount;

@ApiModelProperty("早退次数")
private Integer leaveEarlyCount;

@ApiModelProperty("参与积极度")
private Integer positivity;

@ApiModelProperty("违规次数")
private Integer violationCount;

@ApiModelProperty("每月参会次数")
private List<KeyValDTO<Integer, Long>> attendCountPerMonth;

public static ExpertPortraitVO init() {
ExpertPortraitVO portrait = new ExpertPortraitVO();
portrait.setReceivedCount(0);
portrait.setPositivity(0);
portrait.setConfirmedCount(0);
portrait.setBeLateCount(0);
portrait.setViolationCount(0);
portrait.setLeaveEarlyCount(0);
return portrait;
}

public void incrBeLateCount() {
this.beLateCount += 1;
}

public void incrLeaveEarlyCount() {
this.leaveEarlyCount +=1;
}

public void incrViolationCount() {
this.violationCount += 1;
}

}

+ 2
- 2
hz-pm-api/src/main/java/com/hz/pm/api/meeting/controller/MeetingController.java Visa fil

@@ -203,10 +203,10 @@ public class MeetingController {
meetingManage.uploadMeetingResult(req);
}

@GetMapping("/{meetingId}/listExpertEval")
@GetMapping("/{meetingId}/listExpertJudge")
@ApiOperation("查询会议专家评价信息")
@WebLog("查询会议专家评价信息")
public List<ExpertEvalListItemVO> listExpertEval(@PathVariable Long meetingId) {
public List<ExpertEvalListItemVO> listExpertJudge(@PathVariable Long meetingId) {
return meetingManage.listExpertJudge(meetingId);
}



hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/dto/MeetingAndAttendStatusDTO.java → hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/dto/ExpertInvitedRecordDTO.java Visa fil

@@ -2,16 +2,18 @@ package com.hz.pm.api.meeting.entity.dto;

import lombok.Data;

import java.time.LocalDateTime;

/**
* <p>
* MeetingAndAttendStatusDto
* ExpertInvitedRecordDTO
* </p>
*
* @author WendyYang
* @since 22:48 2022/8/22
*/
@Data
public class MeetingAndAttendStatusDTO {
public class ExpertInvitedRecordDTO {

private Long meetingId;

@@ -23,4 +25,6 @@ public class MeetingAndAttendStatusDTO {

private Boolean attended;

private LocalDateTime createOn;

}

+ 0
- 5
hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/vo/MeetingByManagerVO.java Visa fil

@@ -18,14 +18,9 @@ import java.time.LocalDateTime;
* @since 11:43 2022/8/8
*/
@Data
@Builder
@ApiModel("会议实体(管理员列表)")
public class MeetingByManagerVO {

@Tolerate
public MeetingByManagerVO() {
}

@ApiModelProperty("会议ID")
private Long meetingId;



+ 15
- 15
hz-pm-api/src/main/java/com/hz/pm/api/meeting/helper/MeetingManageHelper.java Visa fil

@@ -102,21 +102,21 @@ public class MeetingManageHelper {
}

public MeetingByManagerVO buildByMeeting(Meeting meeting) {
return MeetingByManagerVO.builder()
.meetingId(meeting.getId())
.meetingType(meeting.getType())
.meetingTypeName(MeetingReviewTypeEnum.getValue(meeting.getType()))
.meetingName(meeting.getName())
.startTime(meeting.getStartTime())
.endTime(meeting.getEndTime())
.inviteType(meeting.getInviteType())
.confirmedRoster(meeting.getConfirmedRoster())
.inviteStatus(meeting.getInviteStatus())
.status(meeting.getStatus())
.createOn(meeting.getCreateOn())
.connecter(meeting.getConnecter())
.contact(meeting.getContact())
.build();
MeetingByManagerVO result = new MeetingByManagerVO();
result.setMeetingId(meeting.getId());
result.setMeetingType(meeting.getType());
result.setMeetingTypeName(MeetingReviewTypeEnum.getValue(meeting.getType()));
result.setMeetingName(meeting.getName());
result.setStartTime(meeting.getStartTime());
result.setEndTime(meeting.getEndTime());
result.setInviteType(meeting.getInviteType());
result.setConfirmedRoster(meeting.getConfirmedRoster());
result.setInviteStatus(meeting.getInviteStatus());
result.setStatus(meeting.getStatus());
result.setCreateOn(meeting.getCreateOn());
result.setConnecter(meeting.getConnecter());
result.setContact(meeting.getContact());
return result;
}

public void buildMeetingQuery(LambdaQueryWrapper<Meeting> query, MeetingListReq req) {


+ 2
- 2
hz-pm-api/src/main/java/com/hz/pm/api/meeting/manage/DashboardManage.java Visa fil

@@ -7,7 +7,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hz.pm.api.meeting.entity.domain.Meeting;
import com.hz.pm.api.meeting.entity.domain.MeetingExpert;
import com.hz.pm.api.meeting.entity.dto.CountConfirmByMeetingIdDTO;
import com.hz.pm.api.meeting.entity.dto.MeetingAndAttendStatusDTO;
import com.hz.pm.api.meeting.entity.dto.ExpertInvitedRecordDTO;
import com.hz.pm.api.meeting.entity.enumeration.ExpertInviteTypeEnum;
import com.hz.pm.api.meeting.entity.enumeration.MeetingStatusByDashboard;
import com.hz.pm.api.meeting.entity.req.MeetingCalenderReq;
@@ -178,7 +178,7 @@ public class DashboardManage {
}

public MeetingCountByExpertVO meetingCountByExpert() {
List<MeetingAndAttendStatusDTO> attendStatusList = meetingExpertService.listByExpertIdAndStatus(LoginUserUtil.getUserId(), null, null);
List<ExpertInvitedRecordDTO> attendStatusList = meetingExpertService.listByExpertIdAndStatus(LoginUserUtil.getUserId(), null, null);
MeetingCountByExpertVO result = MeetingCountByExpertVO.init();
attendStatusList.forEach(w -> {
if (w.getAttended() != null && w.getAttended()) {


+ 3
- 3
hz-pm-api/src/main/java/com/hz/pm/api/meeting/manage/MeetingManage.java Visa fil

@@ -326,11 +326,11 @@ public class MeetingManage {
**/
public PageVo<MeetingByManagerVO> meetingListForExpert(MeetingListReq req) {
Long expertId = req.getExpertId() != null ? req.getExpertId() : LoginUserUtil.getUserId();
List<MeetingAndAttendStatusDTO> meetings = meetingExpertService.listByExpertIdAndStatus(expertId, null, null);
List<ExpertInvitedRecordDTO> meetings = meetingExpertService.listByExpertIdAndStatus(expertId, null, null);
if (meetings.isEmpty()) {
return PageVo.empty();
}
Map<Long, MeetingAndAttendStatusDTO> mapByMeetingId = new HashMap<>(16);
Map<Long, ExpertInvitedRecordDTO> mapByMeetingId = new HashMap<>(16);
List<Long> meetingExpertIds = new ArrayList<>();
meetings.forEach(w -> {
mapByMeetingId.put(w.getMeetingId(), w);
@@ -352,7 +352,7 @@ public class MeetingManage {
PageVo<MeetingByManagerVO> result = new PageVo<>(new ArrayList<>(), page.getTotal());
page.getRecords().forEach(meeting -> {
MeetingByManagerVO item = meetingManageHelper.buildByMeeting(meeting);
MeetingAndAttendStatusDTO info = mapByMeetingId.get(meeting.getId());
ExpertInvitedRecordDTO info = mapByMeetingId.get(meeting.getId());
item.setMeetingExpertId(info.getMeetingExpertId());
item.setExpertStatus(info.getStatus());
item.setHasJudge(existsMeIds.contains(info.getMeetingExpertId()));


+ 17
- 4
hz-pm-api/src/main/java/com/hz/pm/api/meeting/mapper/MeetingExpertMapper.java Visa fil

@@ -3,7 +3,7 @@ package com.hz.pm.api.meeting.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hz.pm.api.meeting.entity.domain.MeetingExpert;
import com.hz.pm.api.meeting.entity.dto.MeetingAndAttendStatusDTO;
import com.hz.pm.api.meeting.entity.dto.ExpertInvitedRecordDTO;
import com.hz.pm.api.meeting.entity.dto.ReviewProjectDTO;
import com.hz.pm.api.meeting.entity.enumeration.ExpertAttendStatusEnum;
import com.hz.pm.api.meeting.entity.req.ReviewProjectListReq;
@@ -32,9 +32,22 @@ public interface MeetingExpertMapper extends BaseMapper<MeetingExpert> {
* @return 专家参会状态列表
* @author WendyYang
**/
List<MeetingAndAttendStatusDTO> selectByExpertIdAndStatus(@Param("expertId") Long expertId,
@Param("status") Integer status,
@Param("meetingIds") List<Long> meetingIds);
List<ExpertInvitedRecordDTO> selectByExpertIdAndStatus(@Param("expertId") Long expertId,
@Param("status") Integer status,
@Param("meetingIds") List<Long> meetingIds);

/**
* 查询专家在某个时间段的邀请记录
*
* @param expertId 专家ID
* @param sTime 开始时间
* @param eTime 结束时间
* @return 专家邀请记录
* @author WendyYang
**/
List<ExpertInvitedRecordDTO> selectByExpertIdAndTime(@Param("expertId") Long expertId,
@Param("sTime") LocalDateTime sTime,
@Param("eTime") LocalDateTime eTime);

/**
* 分页查询专家列表


+ 15
- 1
hz-pm-api/src/main/java/com/hz/pm/api/meeting/mapper/MeetingExpertMapper.xml Visa fil

@@ -3,7 +3,7 @@
<mapper namespace="com.hz.pm.api.meeting.mapper.MeetingExpertMapper">

<select id="selectByExpertIdAndStatus"
resultType="com.hz.pm.api.meeting.entity.dto.MeetingAndAttendStatusDTO">
resultType="com.hz.pm.api.meeting.entity.dto.ExpertInvitedRecordDTO">
SELECT em.meeting_id meetingId, em.status, em.ID meetingExpertId
FROM (SELECT ROW_NUMBER() OVER ( PARTITION BY meeting_id ORDER BY update_on DESC ) rowNumber, ID, expert_id,
status, meeting_id
@@ -23,6 +23,20 @@
</if>
</select>

<select id="selectByExpertIdAndTime"
resultType="com.hz.pm.api.meeting.entity.dto.ExpertInvitedRecordDTO">
SELECT em.meeting_id meetingId, em.status, em.ID meetingExpertId, em.create_on createOn
FROM (SELECT ROW_NUMBER() OVER ( PARTITION BY me.meeting_id ORDER BY me.update_on DESC ) rowNumber, me.ID, me.expert_id,
me.status, me.meeting_id, m.create_on
FROM meeting_expert me inner join meeting m on m.id = me.meeting_id
where expert_id = #{expertId}
<if test="sTime != null and eTime != null">
and m.start_time between #{sTime} and #{eTime}
</if>
) em
WHERE rowNumber = 1
</select>

<select id="selectExpertByStatusAndMeetingId"
resultType="com.hz.pm.api.meeting.entity.domain.MeetingExpert">
SELECT * FROM (SELECT ROW_NUMBER() OVER ( PARTITION BY expert_id ORDER BY update_on DESC ) rowNumber,


+ 11
- 5
hz-pm-api/src/main/java/com/hz/pm/api/meeting/service/IMeetingExpertJudgeService.java Visa fil

@@ -3,9 +3,9 @@ package com.hz.pm.api.meeting.service;
import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ningdatech.basic.util.CollUtils;
import com.hz.pm.api.meeting.entity.domain.MeetingExpertJudge;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hz.pm.api.meeting.entity.domain.MeetingExpertJudge;
import com.ningdatech.basic.util.CollUtils;

import java.util.Collection;
import java.util.Collections;
@@ -32,11 +32,17 @@ public interface IMeetingExpertJudgeService extends IService<MeetingExpertJudge>
return CollUtils.fieldList(list(query), MeetingExpertJudge::getMeetingExpertId);
}

default Map<Long,Long> getExpertJudgeIdMap(Long meetingId){
default Map<Long, Long> getExpertJudgeIdMap(Long meetingId) {
LambdaQueryWrapper<MeetingExpertJudge> query = Wrappers.lambdaQuery(MeetingExpertJudge.class)
.select(MeetingExpertJudge::getExpertId,MeetingExpertJudge::getId)
.select(MeetingExpertJudge::getExpertId, MeetingExpertJudge::getId)
.eq(MeetingExpertJudge::getMeetingId, meetingId);
return CollUtils.listToMap(list(query), MeetingExpertJudge::getExpertId,MeetingExpertJudge::getExpertId);
return CollUtils.listToMap(list(query), MeetingExpertJudge::getExpertId, MeetingExpertJudge::getExpertId);
}

default List<MeetingExpertJudge> listByMeetingExpertIds(Collection<Long> meetingExpertIds) {
LambdaQueryWrapper<MeetingExpertJudge> query = Wrappers.lambdaQuery(MeetingExpertJudge.class)
.in(MeetingExpertJudge::getMeetingId, meetingExpertIds);
return list(query);
}

}

+ 4
- 2
hz-pm-api/src/main/java/com/hz/pm/api/meeting/service/IMeetingExpertService.java Visa fil

@@ -4,7 +4,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hz.pm.api.meeting.entity.domain.MeetingExpert;
import com.hz.pm.api.meeting.entity.dto.CountConfirmByMeetingIdDTO;
import com.hz.pm.api.meeting.entity.dto.MeetingAndAttendStatusDTO;
import com.hz.pm.api.meeting.entity.dto.ExpertInvitedRecordDTO;
import com.hz.pm.api.meeting.entity.dto.ReviewProjectDTO;
import com.hz.pm.api.meeting.entity.enumeration.ExpertAttendStatusEnum;
import com.hz.pm.api.meeting.entity.enumeration.ExpertInviteTypeEnum;
@@ -35,7 +35,9 @@ public interface IMeetingExpertService extends IService<MeetingExpert> {
* @return 会议参加状态统计
* @author WendyYang
**/
List<MeetingAndAttendStatusDTO> listByExpertIdAndStatus(Long expertId, Integer status, List<Long> meetingIds);
List<ExpertInvitedRecordDTO> listByExpertIdAndStatus(Long expertId, Integer status, List<Long> meetingIds);

List<ExpertInvitedRecordDTO> listByExpertIdAndTime(Long expertId, LocalDateTime sTime, LocalDateTime eTime);

/**
* 查询每个会议的确认进度


+ 8
- 3
hz-pm-api/src/main/java/com/hz/pm/api/meeting/service/impl/MeetingExpertServiceImpl.java Visa fil

@@ -4,11 +4,10 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ningdatech.basic.util.CollUtils;
import com.hz.pm.api.meeting.entity.domain.ExpertInviteRule;
import com.hz.pm.api.meeting.entity.domain.MeetingExpert;
import com.hz.pm.api.meeting.entity.dto.CountConfirmByMeetingIdDTO;
import com.hz.pm.api.meeting.entity.dto.MeetingAndAttendStatusDTO;
import com.hz.pm.api.meeting.entity.dto.ExpertInvitedRecordDTO;
import com.hz.pm.api.meeting.entity.dto.ReviewProjectDTO;
import com.hz.pm.api.meeting.entity.enumeration.ExpertAttendStatusEnum;
import com.hz.pm.api.meeting.entity.enumeration.ExpertInviteTypeEnum;
@@ -16,6 +15,7 @@ import com.hz.pm.api.meeting.entity.req.ReviewProjectListReq;
import com.hz.pm.api.meeting.mapper.ExpertInviteRuleMapper;
import com.hz.pm.api.meeting.mapper.MeetingExpertMapper;
import com.hz.pm.api.meeting.service.IMeetingExpertService;
import com.ningdatech.basic.util.CollUtils;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

@@ -41,11 +41,16 @@ public class MeetingExpertServiceImpl extends ServiceImpl<MeetingExpertMapper, M
private final ExpertInviteRuleMapper inviteRuleMapper;

@Override
public List<MeetingAndAttendStatusDTO> listByExpertIdAndStatus(Long expertId, Integer status, List<Long> meetingIds) {
public List<ExpertInvitedRecordDTO> listByExpertIdAndStatus(Long expertId, Integer status, List<Long> meetingIds) {
return baseMapper.selectByExpertIdAndStatus(expertId, status, meetingIds);
}

@Override
public List<ExpertInvitedRecordDTO> listByExpertIdAndTime(Long expertId, LocalDateTime sTime, LocalDateTime eTime) {
return baseMapper.selectByExpertIdAndTime(expertId, sTime, eTime);
}

@Override
public Map<Long, CountConfirmByMeetingIdDTO> countConfirmedByMeetingIds(List<Long> meetingIds) {
List<ExpertInviteRule> inviteRules = inviteRuleMapper.selectList(Wrappers.lambdaQuery(ExpertInviteRule.class)
.eq(ExpertInviteRule::getInviteType, ExpertInviteTypeEnum.RANDOM.getCode())


Laddar…
Avbryt
Spara