From 146adb9ae66dbac939cb946ae4884d5c993807d6 Mon Sep 17 00:00:00 2001 From: PL <774412461@qq.com> Date: Fri, 18 Oct 2024 19:37:00 +0800 Subject: [PATCH] =?UTF-8?q?update:=E8=B0=83=E8=AF=95=E4=BC=98=E5=8C=96AI?= =?UTF-8?q?=E8=AF=84=E8=AF=AD=E6=A8=A1=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/ai/comment/WisdomExamCommentsDto.java | 13 ++++++- .../service/impl/ChatMessageServiceImpl.java | 36 +++++++++++++++---- src/main/resources/Json/ChatModel.json | 2 +- 3 files changed, 42 insertions(+), 9 deletions(-) diff --git a/src/main/java/cn/teammodel/model/dto/ai/comment/WisdomExamCommentsDto.java b/src/main/java/cn/teammodel/model/dto/ai/comment/WisdomExamCommentsDto.java index 8e065a4..dbe13fd 100644 --- a/src/main/java/cn/teammodel/model/dto/ai/comment/WisdomExamCommentsDto.java +++ b/src/main/java/cn/teammodel/model/dto/ai/comment/WisdomExamCommentsDto.java @@ -6,6 +6,7 @@ import lombok.Data; */ @Data public class WisdomExamCommentsDto { + /** * 试卷名称 */ @@ -21,9 +22,19 @@ public class WisdomExamCommentsDto { /** * 得分率 */ - public int scoreRate; + public double scoreRate; /** * 排名 */ public int ranking; + + /** + * 班级得分率 + */ + public double classRate; + + /** + * 年级得分率 + */ + public double gradeRate; } diff --git a/src/main/java/cn/teammodel/service/impl/ChatMessageServiceImpl.java b/src/main/java/cn/teammodel/service/impl/ChatMessageServiceImpl.java index ece5764..f1fff1e 100644 --- a/src/main/java/cn/teammodel/service/impl/ChatMessageServiceImpl.java +++ b/src/main/java/cn/teammodel/service/impl/ChatMessageServiceImpl.java @@ -416,15 +416,37 @@ public class ChatMessageServiceImpl implements ChatMessageService { //昵称 builder.append(String.format(finalChatModel.getChat().get(0), chatCommentsDto.getName())); } - for (WisdomExamCommentsDto examComment : examComments) { - builder.append(String.format(finalChatModel.getCycleChats().get(0), count, examComment.getName(), - examComment.getTime(), examComment.getScore(), examComment.getScoreRate(), - examComment.getRanking())); - if (count < examComments.size()) { - count++; + switch(phase){ + case 1:{ + for (WisdomExamCommentsDto examComment : examComments) { + builder.append(String.format(finalChatModel.getCycleChats().get(1), count, examComment.getName(),examComment.getTime(), examComment.getClassRate(),examComment.getGradeRate())); + if (count < examComments.size()) { + count++; + } + } + break; + } + case 2:{ + for (WisdomExamCommentsDto examComment : examComments) { + builder.append(String.format(finalChatModel.getCycleChats().get(2), count, examComment.getName(),examComment.getTime(), examComment.getGradeRate())); + if (count < examComments.size()) { + count++; + } + } + break; + } + default:{ + for (WisdomExamCommentsDto examComment : examComments) { + builder.append(String.format(finalChatModel.getCycleChats().get(0), count, examComment.getName(), + examComment.getTime(), examComment.getScore(), examComment.getScoreRate(), + examComment.getRanking())); + if (count < examComments.size()) { + count++; + } + } + break; } } - //builder.append(String.format(finalChatModel.getEnd().get(0),chatName)); break; } // 智育 学科评语模版 diff --git a/src/main/resources/Json/ChatModel.json b/src/main/resources/Json/ChatModel.json index 3b071d5..30b7920 100644 --- a/src/main/resources/Json/ChatModel.json +++ b/src/main/resources/Json/ChatModel.json @@ -16,7 +16,7 @@ "name": "智育 成绩表现模版", "role": ["请扮演[%s%s]老师角色,依据我提供的数据,对%s的学习成效表现做一个评价。数据如下:\n"], "chat": ["%s\n,"], - "cycleChats": ["参加第%s次,考试结果:名称:%s,时间:%s,得分:%s,考试得分率:%s %% 排名:%s ;\n"], + "cycleChats": ["参加第%s次,考试结果:名称:%s,时间:%s,得分:%s,考试得分率:%s %% 排名:%s ;\n","参加第%s次,考试结果:名称:%s,时间:%s,班级平均得分率:%s %%吗,年级平均得分率:%s %%;\n","参加第%s次,考试结果:名称:%s,时间:%s,年级平均得分率:%s %%;\n"], "end": ["请根据我提供的数据,对%s的考试成绩表现做一个评价。\n"], "limit": "。限制条件如下:1、%s字左右;2、直接返回评语的内容;3、评语的开篇不允许出现提示语;4、评语的开篇不允许出现特殊字符。" },