Commit 261128ef authored by 陈立彬's avatar 陈立彬

dify agent返回字段

parent b7ab069d
......@@ -65,6 +65,13 @@ public class ExamineRecordMobileDto implements Serializable {
@JsonProperty("overall_score")
private Float overallScore;
/**
* 平均分
*/
@Schema(description = "平均分")
@JsonProperty("avg_score")
private Float avgScore;
/**
* 综合评价
*/
......
......@@ -543,6 +543,8 @@ public class AppExamineService {
req.setRecordId(id);
List<ExamineDetailRecordResponseModel> detailRecordList = examineService.examineDetailRecordList(req);
if(CollectionUtil.isNotEmpty(detailRecordList)) {
double totalScore = detailRecordList.stream().filter(v -> Objects.nonNull(v.getScore())).mapToDouble(ExamineDetailRecordResponseModel::getScore).sum();
Double avgScore = totalScore / detailRecordList.size();
// 题目信息
List<Integer> qaIdList = detailRecordList.stream().map(ExamineDetailRecordResponseModel::getQaId).collect(Collectors.toList());
List<ExamineQaResponseModel> examineQaList = examineService.examineQaList(qaIdList);
......@@ -559,6 +561,7 @@ public class AppExamineService {
}
return detail;
}).collect(Collectors.toList());
result.setAvgScore(avgScore.floatValue());
result.setDetails(details);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment