From 5cb594373420f29d1380d8fd7359c07ebcecbe03 Mon Sep 17 00:00:00 2001 From: WendyYang Date: Tue, 19 Dec 2023 15:09:53 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=B8=93=E5=AE=B6=E7=94=BB?= =?UTF-8?q?=E5=83=8F=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/hz/pm/api/common/constant/BizConst.java | 2 + .../java/com/hz/pm/api/common/util/BizUtils.java | 25 ++++---- .../ExpertAdminExpertManageAssembler.java | 36 ++++++------ .../pm/api/expert/controller/ExpertController.java | 17 +++--- .../hz/pm/api/expert/manage/ExpertAdminManage.java | 6 +- .../com/hz/pm/api/expert/manage/ExpertManage.java | 67 +++++++++++++++++++++- .../model/vo/ExpertAdminExpertManageListVO.java | 60 ------------------- .../expert/model/vo/ExpertLibraryListItemVO.java | 60 +++++++++++++++++++ .../pm/api/expert/model/vo/ExpertPortraitVO.java | 64 +++++++++++++++++++++ .../api/meeting/controller/MeetingController.java | 4 +- .../meeting/entity/dto/ExpertInvitedRecordDTO.java | 30 ++++++++++ .../entity/dto/MeetingAndAttendStatusDTO.java | 26 --------- .../api/meeting/entity/vo/MeetingByManagerVO.java | 5 -- .../pm/api/meeting/helper/MeetingManageHelper.java | 30 +++++----- .../hz/pm/api/meeting/manage/DashboardManage.java | 4 +- .../hz/pm/api/meeting/manage/MeetingManage.java | 6 +- .../pm/api/meeting/mapper/MeetingExpertMapper.java | 21 +++++-- .../pm/api/meeting/mapper/MeetingExpertMapper.xml | 16 +++++- .../service/IMeetingExpertJudgeService.java | 16 ++++-- .../api/meeting/service/IMeetingExpertService.java | 6 +- .../service/impl/MeetingExpertServiceImpl.java | 11 +++- 21 files changed, 340 insertions(+), 172 deletions(-) delete mode 100644 hz-pm-api/src/main/java/com/hz/pm/api/expert/model/vo/ExpertAdminExpertManageListVO.java create mode 100644 hz-pm-api/src/main/java/com/hz/pm/api/expert/model/vo/ExpertLibraryListItemVO.java create mode 100644 hz-pm-api/src/main/java/com/hz/pm/api/expert/model/vo/ExpertPortraitVO.java create mode 100644 hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/dto/ExpertInvitedRecordDTO.java delete mode 100644 hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/dto/MeetingAndAttendStatusDTO.java diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/common/constant/BizConst.java b/hz-pm-api/src/main/java/com/hz/pm/api/common/constant/BizConst.java index d27c5f2..e7e5fa6 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/common/constant/BizConst.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/common/constant/BizConst.java @@ -39,6 +39,8 @@ public class BizConst { */ public static final long ROOT_REGION_CODE = 100000L; + public static final double D100 = 100.0; + /** * 一级行政区划数量 */ diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/common/util/BizUtils.java b/hz-pm-api/src/main/java/com/hz/pm/api/common/util/BizUtils.java index 78e014c..04e9759 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/common/util/BizUtils.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/common/util/BizUtils.java @@ -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); } + } diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/expert/assembler/ExpertAdminExpertManageAssembler.java b/hz-pm-api/src/main/java/com/hz/pm/api/expert/assembler/ExpertAdminExpertManageAssembler.java index d2f8c98..0974b83 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/expert/assembler/ExpertAdminExpertManageAssembler.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/expert/assembler/ExpertAdminExpertManageAssembler.java @@ -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 toExpertAdminExpertManageListVOList( + public List toExpertAdminExpertManageListVOList( List 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 expertType = r.getExpertType(); if (CollectionUtils.isNotEmpty(expertType)) { expertType = assembleDictionaryName(expertType); - expertAdminExpertManageListVO.setExpertType(expertType); + expertLibraryListItemVO.setExpertType(expertType); } List companyAttribute = r.getCompanyAttribute(); if (CollectionUtils.isNotEmpty(companyAttribute)) { companyAttribute = assembleDictionaryName(companyAttribute); - expertAdminExpertManageListVO.setCompanyAttribute(companyAttribute); + expertLibraryListItemVO.setCompanyAttribute(companyAttribute); } List titleLevel = r.getTitleLevel(); if (CollectionUtils.isNotEmpty(titleLevel)) { titleLevel = assembleDictionaryName(titleLevel); - expertAdminExpertManageListVO.setTitleLevel(titleLevel); + expertLibraryListItemVO.setTitleLevel(titleLevel); } List 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()); } diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/expert/controller/ExpertController.java b/hz-pm-api/src/main/java/com/hz/pm/api/expert/controller/ExpertController.java index 48adce3..b29c1d9 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/expert/controller/ExpertController.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/expert/controller/ExpertController.java @@ -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 getExpertLibraryList(@RequestBody @Valid ExpertAdminExpertManageQuery query) { + public PageVo getExpertLibraryList(@RequestBody @Valid ExpertAdminExpertManageQuery query) { return expertAdminManage.getExpertLibraryList(query); } diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/expert/manage/ExpertAdminManage.java b/hz-pm-api/src/main/java/com/hz/pm/api/expert/manage/ExpertAdminManage.java index 81e9533..3f5f403 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/expert/manage/ExpertAdminManage.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/expert/manage/ExpertAdminManage.java @@ -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 getExpertLibraryList(ExpertAdminExpertManageQuery query) { + public PageVo getExpertLibraryList(ExpertAdminExpertManageQuery query) { Long userId = LoginUserUtil.getUserId(); ExpertAdminExpertManageQueryCmd queryCmd = buildExpertAdminExpertManageQueryCmd(query, userId); if (queryCmd.isHasNonData()) { @@ -85,7 +85,7 @@ public class ExpertAdminManage { } CommonPage pageResult = expertAdminManageService.getExpertLibraryList(queryCmd); - PageVo pageVo = new PageVo<>(); + PageVo pageVo = new PageVo<>(); pageVo.setTotal(pageResult.getItemsTotal()); pageVo.setRecords(expertAdminExpertManageAssembler.toExpertAdminExpertManageListVOList(pageResult.getItems())); return pageVo; diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/expert/manage/ExpertManage.java b/hz-pm-api/src/main/java/com/hz/pm/api/expert/manage/ExpertManage.java index 35528dc..3afaacf 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/expert/manage/ExpertManage.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/expert/manage/ExpertManage.java @@ -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 meetings = meetingExpertService.listByExpertIdAndTime(expertId, sTime, eTime); + portrait.setReceivedCount(meetings.size()); + if (!meetings.isEmpty()) { + AtomicInteger agreedCount = new AtomicInteger(0); + Map 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 currMonth = KeyValDTO.of(i, countByPerMonth.getOrDefault(i, 0L)); + portrait.getAttendCountPerMonth().add(currMonth); + } + portrait.setConfirmedCount(agreedCount.get()); + List meetingExpertIds = CollUtils.fieldList(meetings, ExpertInvitedRecordDTO::getMeetingExpertId); + List 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; + } + } diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/expert/model/vo/ExpertAdminExpertManageListVO.java b/hz-pm-api/src/main/java/com/hz/pm/api/expert/model/vo/ExpertAdminExpertManageListVO.java deleted file mode 100644 index 50a1792..0000000 --- a/hz-pm-api/src/main/java/com/hz/pm/api/expert/model/vo/ExpertAdminExpertManageListVO.java +++ /dev/null @@ -1,60 +0,0 @@ -package com.hz.pm.api.expert.model.vo; - - -import com.hz.pm.api.expert.model.DictionaryFieldInfo; -import com.hz.pm.api.expert.model.TagFieldInfo; -import com.hz.pm.api.meta.model.ExpertRegionInfo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import java.time.LocalDateTime; -import java.util.List; - -/** - * @author liuxinxin - * @date 2022/8/4 上午11:04 - */ -@Data -@ApiModel("专家库列表查询返回model") -public class ExpertAdminExpertManageListVO { - - @ApiModelProperty(value = "用户id") - private Long userId; - - @ApiModelProperty(value = "专家姓名") - private String expertName; - - @ApiModelProperty(value = "职称级别") - private List titleLevel; - - @ApiModelProperty("工作单位") - private String company; - - @ApiModelProperty(" 单位法人编号") - private String legalEntityCode; - - @ApiModelProperty("单位类型(字典code)") - private List companyAttribute; - - @ApiModelProperty(value = "手机号") - private String phoneNo; - - @ApiModelProperty(value = "专家类型(内外围)") - private List expertType; - - @ApiModelProperty(value = "专家层级") - private ExpertRegionInfo expertRegionInfo; - - @ApiModelProperty(value = "是否浙政钉用户") - private Boolean isDingUser; - - @ApiModelProperty(value = "专家账号状态", allowableValues = "冻结:freezing,正常:normal") - private String expertAccountStatus; - - @ApiModelProperty(value = "专家来源") - private List expertSource; - - @ApiModelProperty(value = "创建时间") - private LocalDateTime createTime; -} diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/expert/model/vo/ExpertLibraryListItemVO.java b/hz-pm-api/src/main/java/com/hz/pm/api/expert/model/vo/ExpertLibraryListItemVO.java new file mode 100644 index 0000000..e141dd7 --- /dev/null +++ b/hz-pm-api/src/main/java/com/hz/pm/api/expert/model/vo/ExpertLibraryListItemVO.java @@ -0,0 +1,60 @@ +package com.hz.pm.api.expert.model.vo; + + +import com.hz.pm.api.expert.model.DictionaryFieldInfo; +import com.hz.pm.api.expert.model.TagFieldInfo; +import com.hz.pm.api.meta.model.ExpertRegionInfo; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.time.LocalDateTime; +import java.util.List; + +/** + * @author liuxinxin + * @date 2022/8/4 上午11:04 + */ +@Data +@ApiModel("专家库列表查询返回model") +public class ExpertLibraryListItemVO { + + @ApiModelProperty(value = "用户id") + private Long userId; + + @ApiModelProperty(value = "专家姓名") + private String expertName; + + @ApiModelProperty(value = "职称级别") + private List titleLevel; + + @ApiModelProperty("工作单位") + private String company; + + @ApiModelProperty(" 单位法人编号") + private String legalEntityCode; + + @ApiModelProperty("单位类型(字典code)") + private List companyAttribute; + + @ApiModelProperty(value = "手机号") + private String phoneNo; + + @ApiModelProperty(value = "专家类型(内外围)") + private List expertType; + + @ApiModelProperty(value = "专家层级") + private ExpertRegionInfo expertRegionInfo; + + @ApiModelProperty(value = "是否浙政钉用户") + private Boolean isDingUser; + + @ApiModelProperty(value = "专家账号状态", allowableValues = "冻结:freezing,正常:normal") + private String expertAccountStatus; + + @ApiModelProperty(value = "专家来源") + private List expertSource; + + @ApiModelProperty(value = "创建时间") + private LocalDateTime createTime; +} diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/expert/model/vo/ExpertPortraitVO.java b/hz-pm-api/src/main/java/com/hz/pm/api/expert/model/vo/ExpertPortraitVO.java new file mode 100644 index 0000000..b634f7c --- /dev/null +++ b/hz-pm-api/src/main/java/com/hz/pm/api/expert/model/vo/ExpertPortraitVO.java @@ -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; + +/** + *

+ * ExpertPortraitVO + *

+ * + * @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> 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; + } + +} diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/controller/MeetingController.java b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/controller/MeetingController.java index da01d16..8e12f01 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/controller/MeetingController.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/controller/MeetingController.java @@ -203,10 +203,10 @@ public class MeetingController { meetingManage.uploadMeetingResult(req); } - @GetMapping("/{meetingId}/listExpertEval") + @GetMapping("/{meetingId}/listExpertJudge") @ApiOperation("查询会议专家评价信息") @WebLog("查询会议专家评价信息") - public List listExpertEval(@PathVariable Long meetingId) { + public List listExpertJudge(@PathVariable Long meetingId) { return meetingManage.listExpertJudge(meetingId); } diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/dto/ExpertInvitedRecordDTO.java b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/dto/ExpertInvitedRecordDTO.java new file mode 100644 index 0000000..4d60266 --- /dev/null +++ b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/dto/ExpertInvitedRecordDTO.java @@ -0,0 +1,30 @@ +package com.hz.pm.api.meeting.entity.dto; + +import lombok.Data; + +import java.time.LocalDateTime; + +/** + *

+ * ExpertInvitedRecordDTO + *

+ * + * @author WendyYang + * @since 22:48 2022/8/22 + */ +@Data +public class ExpertInvitedRecordDTO { + + private Long meetingId; + + private Long meetingExpertId; + + private Long expertId; + + private Integer status; + + private Boolean attended; + + private LocalDateTime createOn; + +} diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/dto/MeetingAndAttendStatusDTO.java b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/dto/MeetingAndAttendStatusDTO.java deleted file mode 100644 index 019d47f..0000000 --- a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/dto/MeetingAndAttendStatusDTO.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.hz.pm.api.meeting.entity.dto; - -import lombok.Data; - -/** - *

- * MeetingAndAttendStatusDto - *

- * - * @author WendyYang - * @since 22:48 2022/8/22 - */ -@Data -public class MeetingAndAttendStatusDTO { - - private Long meetingId; - - private Long meetingExpertId; - - private Long expertId; - - private Integer status; - - private Boolean attended; - -} diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/vo/MeetingByManagerVO.java b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/vo/MeetingByManagerVO.java index 62752e5..06b25a4 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/vo/MeetingByManagerVO.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/vo/MeetingByManagerVO.java @@ -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; diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/helper/MeetingManageHelper.java b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/helper/MeetingManageHelper.java index 6f3e93f..62d4c03 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/helper/MeetingManageHelper.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/helper/MeetingManageHelper.java @@ -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 query, MeetingListReq req) { diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/manage/DashboardManage.java b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/manage/DashboardManage.java index 25f2bdd..f4d3dde 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/manage/DashboardManage.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/manage/DashboardManage.java @@ -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 attendStatusList = meetingExpertService.listByExpertIdAndStatus(LoginUserUtil.getUserId(), null, null); + List attendStatusList = meetingExpertService.listByExpertIdAndStatus(LoginUserUtil.getUserId(), null, null); MeetingCountByExpertVO result = MeetingCountByExpertVO.init(); attendStatusList.forEach(w -> { if (w.getAttended() != null && w.getAttended()) { diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/manage/MeetingManage.java b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/manage/MeetingManage.java index 2803f4a..4666377 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/manage/MeetingManage.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/manage/MeetingManage.java @@ -326,11 +326,11 @@ public class MeetingManage { **/ public PageVo meetingListForExpert(MeetingListReq req) { Long expertId = req.getExpertId() != null ? req.getExpertId() : LoginUserUtil.getUserId(); - List meetings = meetingExpertService.listByExpertIdAndStatus(expertId, null, null); + List meetings = meetingExpertService.listByExpertIdAndStatus(expertId, null, null); if (meetings.isEmpty()) { return PageVo.empty(); } - Map mapByMeetingId = new HashMap<>(16); + Map mapByMeetingId = new HashMap<>(16); List meetingExpertIds = new ArrayList<>(); meetings.forEach(w -> { mapByMeetingId.put(w.getMeetingId(), w); @@ -352,7 +352,7 @@ public class MeetingManage { PageVo 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())); diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/mapper/MeetingExpertMapper.java b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/mapper/MeetingExpertMapper.java index 1029c8e..3bdca5f 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/mapper/MeetingExpertMapper.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/mapper/MeetingExpertMapper.java @@ -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 { * @return 专家参会状态列表 * @author WendyYang **/ - List selectByExpertIdAndStatus(@Param("expertId") Long expertId, - @Param("status") Integer status, - @Param("meetingIds") List meetingIds); + List selectByExpertIdAndStatus(@Param("expertId") Long expertId, + @Param("status") Integer status, + @Param("meetingIds") List meetingIds); + + /** + * 查询专家在某个时间段的邀请记录 + * + * @param expertId 专家ID + * @param sTime 开始时间 + * @param eTime 结束时间 + * @return 专家邀请记录 + * @author WendyYang + **/ + List selectByExpertIdAndTime(@Param("expertId") Long expertId, + @Param("sTime") LocalDateTime sTime, + @Param("eTime") LocalDateTime eTime); /** * 分页查询专家列表 diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/mapper/MeetingExpertMapper.xml b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/mapper/MeetingExpertMapper.xml index dd15ac2..2df10ea 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/mapper/MeetingExpertMapper.xml +++ b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/mapper/MeetingExpertMapper.xml @@ -3,7 +3,7 @@ + +