|
|
@@ -6,18 +6,22 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
import com.ningdatech.basic.exception.BizException; |
|
|
|
import com.ningdatech.basic.util.CollUtils; |
|
|
|
import com.ningdatech.cache.lock.DistributedLock; |
|
|
|
import com.ningdatech.file.entity.vo.result.AttachFileVo; |
|
|
|
import com.ningdatech.file.service.FileService; |
|
|
|
import com.ningdatech.pmapi.expert.model.dto.ReviewTemplateOptionDTO; |
|
|
|
import com.ningdatech.pmapi.expert.model.entity.ExpertReview; |
|
|
|
import com.ningdatech.pmapi.expert.model.req.ExpertReviewDetailReq; |
|
|
|
import com.ningdatech.pmapi.expert.model.vo.ExpertReviewDetailVO; |
|
|
|
import com.ningdatech.pmapi.expert.service.IExpertReviewService; |
|
|
|
import com.ningdatech.pmapi.meeting.entity.enumeration.ExpertAttendStatusEnum; |
|
|
|
import com.ningdatech.pmapi.meeting.service.IMeetingExpertService; |
|
|
|
import com.ningdatech.pmapi.user.util.LoginUserUtil; |
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
import org.springframework.stereotype.Component; |
|
|
|
|
|
|
|
import java.util.Collections; |
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
import static com.ningdatech.pmapi.meeting.entity.enumeration.ExpertAttendStatusEnum.AGREED; |
|
|
|
|
|
|
@@ -36,6 +40,7 @@ public class ExpertReviewManage { |
|
|
|
private final IExpertReviewService expertReviewService; |
|
|
|
private final DistributedLock distributedLock; |
|
|
|
private final IMeetingExpertService meetingExpertService; |
|
|
|
private final FileService fileService; |
|
|
|
|
|
|
|
private static final String EXPERT_REVIEW_KEY = "expert_review:"; |
|
|
|
|
|
|
@@ -120,7 +125,20 @@ public class ExpertReviewManage { |
|
|
|
query.eq(ExpertReview::getIsFinal, Boolean.FALSE); |
|
|
|
query.orderByDesc(ExpertReview::getCreateOn); |
|
|
|
List<ExpertReview> reviews = expertReviewService.list(query); |
|
|
|
return CollUtils.convert(reviews, this::buildExpertReviewDetail); |
|
|
|
if (reviews.isEmpty()) { |
|
|
|
return Collections.emptyList(); |
|
|
|
} |
|
|
|
List<Long> attachFileIds = CollUtils.fieldList(reviews, ExpertReview::getAttachFileId); |
|
|
|
Map<Long, AttachFileVo> fileMap = new HashMap<>(attachFileIds.size()); |
|
|
|
if (attachFileIds.size() > 0) { |
|
|
|
List<AttachFileVo> files = fileService.getByIds(attachFileIds); |
|
|
|
files.forEach(w -> fileMap.put(w.getFileId(), w)); |
|
|
|
} |
|
|
|
return CollUtils.convert(reviews, w -> { |
|
|
|
ExpertReviewDetailVO reviewDetail = buildExpertReviewDetail(w); |
|
|
|
reviewDetail.setAttachFile(fileMap.get(w.getAttachFileId())); |
|
|
|
return reviewDetail; |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
} |