查看评分详情返回评分细则信息

master
wany 2024-09-12 14:38:02 +08:00
parent 42b4552a29
commit d2306e47c0
3 changed files with 23 additions and 6 deletions

View File

@ -2,11 +2,13 @@ package com.gunshi.project.xyt.entity.vo;
import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.gunshi.project.xyt.model.AssessIndicatorRating;
import com.gunshi.project.xyt.model.AssessTeamRating; import com.gunshi.project.xyt.model.AssessTeamRating;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.List;
@Data @Data
public class AssessRatingVo extends AssessTeamRating { public class AssessRatingVo extends AssessTeamRating {
@ -34,4 +36,7 @@ public class AssessRatingVo extends AssessTeamRating {
@Schema(description="考核成员") @Schema(description="考核成员")
private String teamUserName; private String teamUserName;
@Schema(description = "评分细则")
private List<AssessIndicatorRating> indicatorRatings;
} }

View File

@ -53,6 +53,9 @@ public class AssessTeamRatingService extends ServiceImpl<AssessTeamRatingMapper,
@Autowired @Autowired
private AssessObjectRatingService assessObjectRatingService; private AssessObjectRatingService assessObjectRatingService;
@Autowired
private AssessIndicatorRatingService indicatorRatingService;
public Boolean score(AssessScoreVo vo) { public Boolean score(AssessScoreVo vo) {
List<AssessTeamRating> ratings = vo.getRatings(); List<AssessTeamRating> ratings = vo.getRatings();
@ -169,11 +172,7 @@ public class AssessTeamRatingService extends ServiceImpl<AssessTeamRatingMapper,
public List<AssessRatingVo> doDetail(Long teamId) { public List<AssessRatingVo> doDetail(Long teamId) {
List<AssessRatingVo> list = this.baseMapper.scoreDetail(teamId); List<AssessRatingVo> list = this.baseMapper.scoreDetail(teamId);
for (AssessRatingVo vo : list){ fillRating(list);
if(vo.getIsNeedRectify() == 1){
vo.setFiles(fileService.queryFileList(vo.getId().toString(),getGroupId(),getScoreType()));
}
}
return list; return list;
} }
@ -195,9 +194,21 @@ public class AssessTeamRatingService extends ServiceImpl<AssessTeamRatingMapper,
public Map<Long,List<AssessRatingVo>> scoreDetail(Long objectId) { public Map<Long,List<AssessRatingVo>> scoreDetail(Long objectId) {
List<AssessRatingVo> list = this.baseMapper.scoreByObjectId(objectId); List<AssessRatingVo> list = this.baseMapper.scoreByObjectId(objectId);
fillRating(list);
return list.stream().collect(Collectors.groupingBy(AssessTeamRating::getIndicatorId)); return list.stream().collect(Collectors.groupingBy(AssessTeamRating::getIndicatorId));
} }
private void fillRating(List<AssessRatingVo> list){
List<AssessIndicatorRating> relList = indicatorRatingService.queryRatingList(list.stream().map(AssessRatingVo::getIndicatorId).distinct().collect(Collectors.toList()));
Map<Long, List<AssessIndicatorRating>> map = relList.stream().collect(Collectors.groupingBy(AssessIndicatorRating::getIndicatorId));
for (AssessRatingVo vo : list){
vo.setIndicatorRatings(map.get(vo.getIndicatorId()));
if(vo.getIsNeedRectify() == 1){
vo.setFiles(fileService.queryFileList(vo.getId().toString(),getGroupId(),getScoreType()));
}
}
}
public Page<AssessRectifyVo> listPage(AssessTaskPageSo page) { public Page<AssessRectifyVo> listPage(AssessTaskPageSo page) {
Page<AssessRectifyVo> res = this.baseMapper.listPage(page.getPageSo().toPage(), page); Page<AssessRectifyVo> res = this.baseMapper.listPage(page.getPageSo().toPage(), page);
if (res.getRecords() != null && res.getRecords().size() > 0) { if (res.getRecords() != null && res.getRecords().size() > 0) {

View File

@ -35,7 +35,8 @@ public class AssessTemplateService extends ServiceImpl<AssessTemplateMapper, Ass
@Autowired @Autowired
private AssessTemplateIndicatorRelService relService; private AssessTemplateIndicatorRelService relService;
@Autowired AssessIndicatorService indicatorService; @Autowired
private AssessIndicatorService indicatorService;
public AssessTemplate saveData(AssessTemplate dto) { public AssessTemplate saveData(AssessTemplate dto) {
dto.setId(IdWorker.getId()); dto.setId(IdWorker.getId());