@@ -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); | |||
} | |||
} |
@@ -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; | |||
} |
@@ -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; | |||
} |
@@ -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; | |||
@@ -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; | |||
} |
@@ -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()); | |||
} | |||
} |
@@ -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); | |||
} |
@@ -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); | |||
} | |||
} |
@@ -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); | |||
} | |||