Pārlūkot izejas kodu

增加专家评价查询接口

tags/24080901
WendyYang pirms 1 gada
vecāks
revīzija
55ce5ec368
14 mainītis faili ar 22 papildinājumiem un 317 dzēšanām
  1. +0
    -6
      hz-pm-api/src/main/java/com/hz/pm/api/meeting/controller/ExpertDashboardController.java
  2. +1
    -1
      hz-pm-api/src/main/java/com/hz/pm/api/meeting/controller/MeetingController.java
  3. +3
    -3
      hz-pm-api/src/main/java/com/hz/pm/api/meeting/controller/MeetingExpertJudgeController.java
  4. +0
    -66
      hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/domain/MeetingExpertEvaluation.java
  5. +0
    -23
      hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/req/MeetingExpertEvalReq.java
  6. +4
    -45
      hz-pm-api/src/main/java/com/hz/pm/api/meeting/manage/DashboardManage.java
  7. +2
    -2
      hz-pm-api/src/main/java/com/hz/pm/api/meeting/manage/MeetingExpertJudgeManage.java
  8. +0
    -25
      hz-pm-api/src/main/java/com/hz/pm/api/meeting/manage/MeetingExpertManage.java
  9. +4
    -3
      hz-pm-api/src/main/java/com/hz/pm/api/meeting/manage/MeetingManage.java
  10. +0
    -26
      hz-pm-api/src/main/java/com/hz/pm/api/meeting/mapper/MeetingExpertEvaluationMapper.java
  11. +0
    -25
      hz-pm-api/src/main/java/com/hz/pm/api/meeting/mapper/MeetingExpertEvaluationMapper.xml
  12. +0
    -32
      hz-pm-api/src/main/java/com/hz/pm/api/meeting/service/IMeetingExpertEvaluationService.java
  13. +8
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/meeting/service/IMeetingExpertJudgeService.java
  14. +0
    -60
      hz-pm-api/src/main/java/com/hz/pm/api/meeting/service/impl/MeetingExpertEvaluationServiceImpl.java

+ 0
- 6
hz-pm-api/src/main/java/com/hz/pm/api/meeting/controller/ExpertDashboardController.java Parādīt failu

@@ -39,12 +39,6 @@ public class ExpertDashboardController {
return dashboardManage.meetingCalender(po);
}

@ApiOperation("待办:专家评价列表")
@GetMapping("/todo/expertEvaluation")
public PageVo<ExpertEvaluationToDoListItemVO> expertEvaluationToDo(PagePo po) {
return dashboardManage.expertEvaluationToDo(po);
}

@ApiOperation("待办:专家待替换列表")
@GetMapping("/todo/expertReplace")
public PageVo<ExpertReplaceTodoListItemVO> expertReplaceToDo(PagePo po) {


+ 1
- 1
hz-pm-api/src/main/java/com/hz/pm/api/meeting/controller/MeetingController.java Parādīt failu

@@ -207,7 +207,7 @@ public class MeetingController {
@ApiOperation("查询会议专家评价信息")
@WebLog("查询会议专家评价信息")
public List<ExpertEvalListItemVO> listExpertEval(@PathVariable Long meetingId) {
return meetingManage.listExpertEval(meetingId);
return meetingManage.listExpertJudge(meetingId);
}

}

+ 3
- 3
hz-pm-api/src/main/java/com/hz/pm/api/meeting/controller/MeetingExpertJudgeController.java Parādīt failu

@@ -35,9 +35,9 @@ public class MeetingExpertJudgeController {
}

@ApiOperation("查看履职评价")
@GetMapping("/detail/{meetingExpertId}")
public MeetingExpertJudgeReq expertJudgeDetail(@PathVariable Long meetingExpertId) {
return expertJudgeManage.expertJudgeDetail(meetingExpertId);
@GetMapping("/detail/{expertJudgeId}")
public MeetingExpertJudgeReq expertJudgeDetail(@PathVariable Long expertJudgeId) {
return expertJudgeManage.expertJudgeDetail(expertJudgeId);
}

}

+ 0
- 66
hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/domain/MeetingExpertEvaluation.java Parādīt failu

@@ -1,66 +0,0 @@
package com.hz.pm.api.meeting.entity.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.hz.pm.api.sys.model.entity.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
* <p>
* 专家评价表
* </p>
*
* @author WendyYang
* @since 2022-07-25
*/
@Data
@TableName("meeting_expert_evaluation")
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "MeetingExpertEvaluation对象", description = "专家评价表")
public class MeetingExpertEvaluation extends BaseEntity {

private static final long serialVersionUID = 1L;

@ApiModelProperty("主键")
@TableId(type = IdType.AUTO)
private Long id;

@ApiModelProperty("专家事务关联ID")
private Long expertMeetingId;

@ApiModelProperty("事务ID")
private Long meetingId;

@ApiModelProperty("专家ID")
private Long expertId;

@TableField(value = "is_attended")
@ApiModelProperty("是否参加")
private Boolean attended;

@TableField(value = "is_in_time")
@ApiModelProperty("是否准时参加")
private Boolean inTime;

@TableField(value = "is_violated")
@ApiModelProperty("是否违规")
private Boolean violated;

@ApiModelProperty("参与程度")
private Integer initiative;

@ApiModelProperty("建设性建议")
private String advice;

@ApiModelProperty("评审结果情况")
private String evaluateResult;

@ApiModelProperty("违规情况")
private String violation;

}

+ 0
- 23
hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/req/MeetingExpertEvalReq.java Parādīt failu

@@ -1,23 +0,0 @@
package com.hz.pm.api.meeting.entity.req;

import com.ningdatech.basic.model.PagePo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
* <p>
* MeetingExpertEvaluationReq
* </p>
*
* @author WendyYang
* @since 16:44 2023/12/18
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class MeetingExpertEvalReq extends PagePo {

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

}

+ 4
- 45
hz-pm-api/src/main/java/com/hz/pm/api/meeting/manage/DashboardManage.java Parādīt failu

@@ -4,26 +4,24 @@ import cn.hutool.core.bean.BeanUtil;
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.ningdatech.basic.exception.BizException;
import com.ningdatech.basic.model.PagePo;
import com.ningdatech.basic.model.PageVo;
import com.ningdatech.basic.util.CollUtils;
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.enumeration.ExpertInviteTypeEnum;
import com.hz.pm.api.meeting.entity.enumeration.MeetingStatusByDashboard;
import com.hz.pm.api.meeting.entity.enumeration.MeetingStatusEnum;
import com.hz.pm.api.meeting.entity.req.MeetingCalenderReq;
import com.hz.pm.api.meeting.entity.req.MeetingListReq;
import com.hz.pm.api.meeting.entity.vo.*;
import com.hz.pm.api.meeting.helper.MeetingManageHelper;
import com.hz.pm.api.meeting.service.IMeetingExpertEvaluationService;
import com.hz.pm.api.meeting.service.IMeetingExpertService;
import com.hz.pm.api.meeting.service.IMeetingService;
import com.hz.pm.api.meta.helper.DictionaryCache;
import com.hz.pm.api.user.util.LoginUserUtil;
import com.ningdatech.basic.exception.BizException;
import com.ningdatech.basic.model.PagePo;
import com.ningdatech.basic.model.PageVo;
import com.ningdatech.basic.util.CollUtils;
import lombok.AllArgsConstructor;
import org.apache.commons.lang3.tuple.Pair;
import org.springframework.stereotype.Component;
@@ -50,7 +48,6 @@ public class DashboardManage {
private final IMeetingService meetingService;
private final IMeetingExpertService meetingExpertService;
private final MeetingManageHelper meetingManageHelper;
private final IMeetingExpertEvaluationService meetingExpertEvaluationService;
private final DictionaryCache dictionaryCache;

public static final int MEETING_CALENDER_MONTHS = 2;
@@ -95,44 +92,6 @@ public class DashboardManage {
return result;
}

public PageVo<ExpertEvaluationToDoListItemVO> expertEvaluationToDo(PagePo po) {
PageVo<ExpertEvaluationToDoListItemVO> result = PageVo.of(new ArrayList<>(), 0L);
// 查询所有未完成的项目
LambdaQueryWrapper<Meeting> query = Wrappers.lambdaQuery(Meeting.class)
.select(Meeting::getId)
.ne(Meeting::getStatus, MeetingStatusEnum.CANCELED.getCode())
.eq(Meeting::getCreateBy, LoginUserUtil.getUserId());
List<Meeting> meetings = meetingService.list(query);
if (meetings.isEmpty()) {
return PageVo.empty();
}
List<Long> meetingIds = CollUtils.fieldList(meetings, Meeting::getId);
Page<MeetingExpert> page = meetingExpertEvaluationService.pageExpertEvaluationTodo(meetingIds, po);
if (page.getTotal() > 0) {
List<Long> expertIds = new ArrayList<>();
List<Long> meetingIdsByPage = new ArrayList<>();
page.getRecords().forEach(w -> {
meetingIdsByPage.add(w.getMeetingId());
expertIds.add(w.getExpertId());
});
Map<Long, Meeting> meetingMap = CollUtils.listToMap(meetingService.listByIds(meetingIdsByPage), Meeting::getId);
Map<Long, ExpertBasicInfoVO> basicInfoVoMap = meetingManageHelper.getExpertBasicInfo(expertIds);
page.getRecords().forEach(w -> {
ExpertBasicInfoVO expertInfo = basicInfoVoMap.get(w.getExpertId());
Meeting meeting = meetingMap.get(w.getMeetingId());
ExpertEvaluationToDoListItemVO item = BeanUtil.copyProperties(expertInfo, ExpertEvaluationToDoListItemVO.class);
item.setMeetingName(meeting.getName());
item.setMeetingId(w.getMeetingId());
item.setExpertMeetingId(w.getId());
item.setStartTime(meeting.getStartTime());
item.setEndTime(meeting.getEndTime());
result.getRecords().add(item);
});
result.setTotal(page.getTotal());
}
return result;
}

public PageVo<MeetingConfirmToDoListItemVO> expertConfirmToDo(PagePo po) {
// 查询所有未完成的项目
LambdaQueryWrapper<Meeting> query = Wrappers.lambdaQuery(Meeting.class)


+ 2
- 2
hz-pm-api/src/main/java/com/hz/pm/api/meeting/manage/MeetingExpertJudgeManage.java Parādīt failu

@@ -83,8 +83,8 @@ public class MeetingExpertJudgeManage {
}
}

public MeetingExpertJudgeReq expertJudgeDetail(Long meetingExpertId) {
MeetingExpertJudge judge = getMeetingExpertJudge(meetingExpertId);
public MeetingExpertJudgeReq expertJudgeDetail(Long expertJudgeId) {
MeetingExpertJudge judge = expertJudgeService.getById(expertJudgeId);
if (judge == null) {
throw BizException.wrap("履职评价未提交");
}


+ 0
- 25
hz-pm-api/src/main/java/com/hz/pm/api/meeting/manage/MeetingExpertManage.java Parādīt failu

@@ -1,25 +0,0 @@
package com.hz.pm.api.meeting.manage;

import com.hz.pm.api.meeting.helper.MeetingManageHelper;
import com.hz.pm.api.meeting.service.IMeetingExpertEvaluationService;
import com.hz.pm.api.meeting.service.IMeetingExpertService;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Component;

/**
* <p>
* MeetingExpertManage
* </p>
*
* @author WendyYang
* @since 10:04 2022/8/24
*/
@Component
@AllArgsConstructor
public class MeetingExpertManage {

private final IMeetingExpertService meetingExpertService;
private final IMeetingExpertEvaluationService meetingExpertEvaluationService;
private final MeetingManageHelper meetingManageHelper;

}

+ 4
- 3
hz-pm-api/src/main/java/com/hz/pm/api/meeting/manage/MeetingManage.java Parādīt failu

@@ -98,7 +98,8 @@ public class MeetingManage {
private final MeetingCallOrMsgHelper meetingCallOrMsgHelper;
private final MeetingDataScopeHelper meetingDataScopeHelper;
private final IMeetingExpertJudgeService expertJudgeService;
private final IMeetingExpertEvaluationService expertEvaluationService;
private final IMeetingExpertJudgeService meetingExpertJudgeService;

private static final String INVITED_RULE_CREATE = "INVITED_RULE_CREATE:";

private static final String MEETING_CREATE_KEY = "MEETING_CREATE:";
@@ -971,12 +972,12 @@ public class MeetingManage {
}
}

public List<ExpertEvalListItemVO> listExpertEval(Long meetingId) {
public List<ExpertEvalListItemVO> listExpertJudge(Long meetingId) {
List<MeetingExpert> experts = meetingExpertService.listAgreedExperts(meetingId);
if (experts.isEmpty()) {
return Collections.emptyList();
}
Map<Long, Long> evaluationIdMap = expertEvaluationService.getExpertEvaluationIdMap(meetingId);
Map<Long, Long> evaluationIdMap = meetingExpertJudgeService.getExpertJudgeIdMap(meetingId);
List<Long> expertIds = CollUtils.fieldList(experts, MeetingExpert::getExpertId);
Map<Long, ExpertBasicInfoVO> expertMap = meetingManageHelper.getExpertBasicInfo(expertIds);
return experts.stream().map(w -> {


+ 0
- 26
hz-pm-api/src/main/java/com/hz/pm/api/meeting/mapper/MeetingExpertEvaluationMapper.java Parādīt failu

@@ -1,26 +0,0 @@
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.common.model.entity.CountGroupByDTO;
import com.hz.pm.api.meeting.entity.domain.MeetingExpert;
import com.hz.pm.api.meeting.entity.domain.MeetingExpertEvaluation;
import org.apache.ibatis.annotations.Param;

import java.util.Collection;

/**
* <p>
* 专家评价表 Mapper 接口
* </p>
*
* @author WendyYang
* @since 2022-07-25
*/
public interface MeetingExpertEvaluationMapper extends BaseMapper<MeetingExpertEvaluation> {

Page<CountGroupByDTO<Long>> countExpertAttend(@Param("expertIds") Collection<Long> expertIds, @Param("isAttended") Boolean isAttended, Page<CountGroupByDTO<Long>> page);

Page<MeetingExpert> pageExpertEvaluationToDo(@Param("meetingIds") Collection<Long> meetingIds, Page<MeetingExpert> po);

}

+ 0
- 25
hz-pm-api/src/main/java/com/hz/pm/api/meeting/mapper/MeetingExpertEvaluationMapper.xml Parādīt failu

@@ -1,25 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hz.pm.api.meeting.mapper.MeetingExpertEvaluationMapper">

<select id="countExpertAttend" resultType="com.hz.pm.api.common.model.entity.CountGroupByDTO">
select count(1) total, expert_id groupKey from meeting_expert_evaluation
where expert_id
<foreach collection="expertIds" separator="," close=")" open=" in (" item="expertId">#{expertId}</foreach>
<if test="isAttended != null">
and is_attended = #{isAttended}
</if>
group by expert_id order by total desc
</select>

<select id="pageExpertEvaluationToDo"
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, ID, expert_id, status, meeting_id FROM meeting_expert
where meeting_id <foreach collection="meetingIds" item="item" open=" in (" close=")" separator=",">
#{item}</foreach>) em
WHERE rowNumber = 1 and status = 3 and not exists (select 1 from meeting_expert_evaluation where
expert_meeting_id = em.id)
</select>

</mapper>

+ 0
- 32
hz-pm-api/src/main/java/com/hz/pm/api/meeting/service/IMeetingExpertEvaluationService.java Parādīt failu

@@ -1,32 +0,0 @@
package com.hz.pm.api.meeting.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ningdatech.basic.model.PagePo;
import com.hz.pm.api.common.model.entity.CountGroupByDTO;
import com.hz.pm.api.meeting.entity.domain.MeetingExpert;
import com.hz.pm.api.meeting.entity.domain.MeetingExpertEvaluation;

import java.util.Collection;
import java.util.List;
import java.util.Map;

/**
* <p>
* 专家评价表 服务类
* </p>
*
* @author WendyYang
* @since 2022-07-25
*/
public interface IMeetingExpertEvaluationService extends IService<MeetingExpertEvaluation> {

Page<CountGroupByDTO<Long>> listExpertAttendSummary(Collection<Long> expertIds, Boolean isAttended, Page<CountGroupByDTO<Long>> page);

Page<MeetingExpert> pageExpertEvaluationTodo(Collection<Long> meetingIds, PagePo po);

List<MeetingExpertEvaluation> listMeetingExpertEvaluations(Long meetingId);

Map<Long,Long> getExpertEvaluationIdMap(Long meetingId);

}

+ 8
- 0
hz-pm-api/src/main/java/com/hz/pm/api/meeting/service/IMeetingExpertJudgeService.java Parādīt failu

@@ -10,6 +10,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;

/**
* <p>
@@ -31,4 +32,11 @@ public interface IMeetingExpertJudgeService extends IService<MeetingExpertJudge>
return CollUtils.fieldList(list(query), MeetingExpertJudge::getMeetingExpertId);
}

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

}

+ 0
- 60
hz-pm-api/src/main/java/com/hz/pm/api/meeting/service/impl/MeetingExpertEvaluationServiceImpl.java Parādīt failu

@@ -1,60 +0,0 @@
package com.hz.pm.api.meeting.service.impl;

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.hz.pm.api.common.model.entity.CountGroupByDTO;
import com.hz.pm.api.meeting.entity.domain.MeetingExpert;
import com.hz.pm.api.meeting.entity.domain.MeetingExpertEvaluation;
import com.hz.pm.api.meeting.mapper.MeetingExpertEvaluationMapper;
import com.hz.pm.api.meeting.service.IMeetingExpertEvaluationService;
import com.ningdatech.basic.model.PagePo;
import com.ningdatech.basic.util.CollUtils;
import org.springframework.stereotype.Service;

import java.util.Collection;
import java.util.List;
import java.util.Map;

/**
* <p>
* 专家评价表 服务实现类
* </p>
*
* @author WendyYang
* @since 2022-07-25
*/
@Service
public class MeetingExpertEvaluationServiceImpl extends ServiceImpl<MeetingExpertEvaluationMapper, MeetingExpertEvaluation> implements IMeetingExpertEvaluationService {

private LambdaQueryWrapper<MeetingExpertEvaluation> queryByMetingId(Long meetingId) {
return Wrappers.lambdaQuery(MeetingExpertEvaluation.class)
.eq(MeetingExpertEvaluation::getMeetingId, meetingId)
.orderByDesc(MeetingExpertEvaluation::getCreateOn);
}

@Override
public Page<CountGroupByDTO<Long>> listExpertAttendSummary(Collection<Long> expertIds, Boolean isAttended, Page<CountGroupByDTO<Long>> page) {
return baseMapper.countExpertAttend(expertIds, isAttended, page);
}

@Override
public Page<MeetingExpert> pageExpertEvaluationTodo(Collection<Long> meetingIds, PagePo po) {
return baseMapper.pageExpertEvaluationToDo(meetingIds, new Page<>(po.getPageNumber(), po.getPageSize()));
}

@Override
public List<MeetingExpertEvaluation> listMeetingExpertEvaluations(Long meetingId) {
return list(queryByMetingId(meetingId));
}

@Override
public Map<Long, Long> getExpertEvaluationIdMap(Long meetingId) {
LambdaQueryWrapper<MeetingExpertEvaluation> query = queryByMetingId(meetingId)
.select(MeetingExpertEvaluation::getId, MeetingExpertEvaluation::getExpertId);
return CollUtils.listToMap(list(query), MeetingExpertEvaluation::getExpertId,
MeetingExpertEvaluation::getId);
}

}

Notiek ielāde…
Atcelt
Saglabāt