Browse Source

增加专家评价查询接口

master
WendyYang 10 months ago
parent
commit
d32e9a0620
9 changed files with 123 additions and 57 deletions
  1. +7
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/meeting/controller/MeetingController.java
  2. +23
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/req/MeetingExpertEvalReq.java
  3. +0
    -34
      hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/req/MeetingResultReq.java
  4. +0
    -7
      hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/vo/ExpertBasicInfoVO.java
  5. +20
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/vo/ExpertEvalListItemVO.java
  6. +40
    -14
      hz-pm-api/src/main/java/com/hz/pm/api/meeting/manage/MeetingManage.java
  7. +6
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/meeting/service/IMeetingExpertEvaluationService.java
  8. +25
    -1
      hz-pm-api/src/main/java/com/hz/pm/api/meeting/service/impl/MeetingExpertEvaluationServiceImpl.java
  9. +2
    -1
      hz-pm-api/src/main/java/com/hz/pm/api/meeting/service/impl/MeetingExpertServiceImpl.java

+ 7
- 0
hz-pm-api/src/main/java/com/hz/pm/api/meeting/controller/MeetingController.java View File

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

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

}

+ 23
- 0
hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/req/MeetingExpertEvalReq.java View File

@@ -0,0 +1,23 @@
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;

}

+ 0
- 34
hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/req/MeetingResultReq.java View File

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

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

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
* <p>
* MeetingResultPo
* </p>
*
* @author WendyYang
* @since 21:20 2022/8/8
*/
@Data
@ApiModel("会议结果上传实体")
public class MeetingResultReq {

@NotNull(message = "事务ID不能为空")
@ApiModelProperty("事务ID")
private Long meetingId;

@NotBlank(message = "会议结果说明不能为空")
@ApiModelProperty("会议结果说明")
private String resultDescription;

@ApiModelProperty("附件ID")
private List<Long> attachments;

}

+ 0
- 7
hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/vo/ExpertBasicInfoVO.java View File

@@ -2,9 +2,7 @@ package com.hz.pm.api.meeting.entity.vo;

import com.hz.pm.api.sys.model.dto.RegionDTO;
import io.swagger.annotations.ApiModelProperty;
import lombok.Builder;
import lombok.Data;
import lombok.experimental.Tolerate;

import java.util.List;

@@ -17,13 +15,8 @@ import java.util.List;
* @since 15:58 2022/8/8
*/
@Data
@Builder
public class ExpertBasicInfoVO {

@Tolerate
public ExpertBasicInfoVO() {
}

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



+ 20
- 0
hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/vo/ExpertEvalListItemVO.java View File

@@ -0,0 +1,20 @@
package com.hz.pm.api.meeting.entity.vo;

import lombok.Data;
import lombok.EqualsAndHashCode;

/**
* <p>
* ExpertEvaluationListItemVO
* </p>
*
* @author WendyYang
* @since 16:24 2023/12/18
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class ExpertEvalListItemVO extends ExpertBasicInfoVO{

private Long evaluationId;

}

+ 40
- 14
hz-pm-api/src/main/java/com/hz/pm/api/meeting/manage/MeetingManage.java View File

@@ -98,6 +98,7 @@ public class MeetingManage {
private final MeetingCallOrMsgHelper meetingCallOrMsgHelper;
private final MeetingDataScopeHelper meetingDataScopeHelper;
private final IMeetingExpertJudgeService expertJudgeService;
private final IMeetingExpertEvaluationService expertEvaluationService;
private static final String INVITED_RULE_CREATE = "INVITED_RULE_CREATE:";

private static final String MEETING_CREATE_KEY = "MEETING_CREATE:";
@@ -945,21 +946,46 @@ public class MeetingManage {
}

public void uploadMeetingResult(MeetingResultUploadReq req) {
Meeting meeting = meetingService.getById(req.getMeetingId());
if (meeting == null || MeetingStatusEnum.CANCELED.eq(meeting.getStatus())) {
throw BizException.wrap("会议不存在或已取消");
String key = "meeting_result_upload:" + req.getMeetingId();
if (!distributedLock.lock(key, RETRY_TIMES)) {
throw BizException.wrap("正在上传会议结果,请勿重复操作");
}
LocalDateTime now = LocalDateTime.now();
if (meeting.getEndTime().isAfter(now)) {
throw BizException.wrap("会议未结束");
}
LambdaUpdateWrapper<Meeting> mUpdate = Wrappers.lambdaUpdate(Meeting.class)
.set(Meeting::getUpdateOn, now)
.set(Meeting::getResultDescription, req.getResultDescription())
.set(Meeting::getResultAttachFiles, req.getResultAttachFiles())
.set(Meeting::getUpdateBy, LoginUserUtil.getUserId())
.eq(Meeting::getId, req.getMeetingId());
meetingService.update(mUpdate);
try {
Meeting meeting = meetingService.getById(req.getMeetingId());
if (meeting == null || MeetingStatusEnum.CANCELED.eq(meeting.getStatus())) {
throw BizException.wrap("会议不存在或已取消");
}
LocalDateTime now = LocalDateTime.now();
if (meeting.getEndTime().isAfter(now)) {
throw BizException.wrap("会议未结束");
}
LambdaUpdateWrapper<Meeting> mUpdate = Wrappers.lambdaUpdate(Meeting.class)
.set(Meeting::getUpdateOn, now)
.set(Meeting::getResultDescription, req.getResultDescription())
.set(Meeting::getResultAttachFiles, req.getResultAttachFiles())
.set(Meeting::getUpdateBy, LoginUserUtil.getUserId())
.eq(Meeting::getId, req.getMeetingId());
meetingService.update(mUpdate);
} finally {
distributedLock.releaseLock(key);
}
}

public List<ExpertEvalListItemVO> listExpertEval(Long meetingId) {
List<MeetingExpert> experts = meetingExpertService.listAgreedExperts(meetingId);
if (experts.isEmpty()) {
return Collections.emptyList();
}
Map<Long, Long> evaluationIdMap = expertEvaluationService.getExpertEvaluationIdMap(meetingId);
List<Long> expertIds = CollUtils.fieldList(experts, MeetingExpert::getExpertId);
Map<Long, ExpertBasicInfoVO> expertMap = meetingManageHelper.getExpertBasicInfo(expertIds);
return experts.stream().map(w -> {
Long expertId = w.getExpertId();
ExpertEvalListItemVO item = new ExpertEvalListItemVO();
BeanUtil.copyProperties(expertMap.get(expertId), item);
item.setEvaluationId(evaluationIdMap.get(expertId));
return item;
}).collect(Collectors.toList());
}

}

+ 6
- 0
hz-pm-api/src/main/java/com/hz/pm/api/meeting/service/IMeetingExpertEvaluationService.java View File

@@ -8,6 +8,8 @@ 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>
@@ -23,4 +25,8 @@ public interface IMeetingExpertEvaluationService extends IService<MeetingExpertE

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

List<MeetingExpertEvaluation> listMeetingExpertEvaluations(Long meetingId);

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

}

+ 25
- 1
hz-pm-api/src/main/java/com/hz/pm/api/meeting/service/impl/MeetingExpertEvaluationServiceImpl.java View File

@@ -1,16 +1,21 @@
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.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 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>
@@ -23,6 +28,12 @@ import java.util.Collection;
@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);
@@ -33,4 +44,17 @@ public class MeetingExpertEvaluationServiceImpl extends ServiceImpl<MeetingExper
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);
}

}

+ 2
- 1
hz-pm-api/src/main/java/com/hz/pm/api/meeting/service/impl/MeetingExpertServiceImpl.java View File

@@ -123,7 +123,8 @@ public class MeetingExpertServiceImpl extends ServiceImpl<MeetingExpertMapper, M
public List<MeetingExpert> listAgreedExperts(Collection<Long> meetingIds) {
LambdaQueryWrapper<MeetingExpert> query = Wrappers.lambdaQuery(MeetingExpert.class)
.eq(MeetingExpert::getStatus, ExpertAttendStatusEnum.AGREED.getCode())
.in(MeetingExpert::getMeetingId, meetingIds);
.in(MeetingExpert::getMeetingId, meetingIds)
.orderByAsc(MeetingExpert::getCreateOn);
return baseMapper.selectList(query);
}



Loading…
Cancel
Save