From ffb8af9546eb72b49c5c84c14d9e54a70c01fc36 Mon Sep 17 00:00:00 2001 From: PL <774412461@qq.com> Date: Fri, 18 Oct 2024 17:58:42 +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 --- .../service/impl/ChatMessageServiceImpl.java | 24 +++++++++++++++---- src/main/resources/Json/ChatModel.json | 8 +++---- 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/src/main/java/cn/teammodel/service/impl/ChatMessageServiceImpl.java b/src/main/java/cn/teammodel/service/impl/ChatMessageServiceImpl.java index 48dd300..7ec5b44 100644 --- a/src/main/java/cn/teammodel/service/impl/ChatMessageServiceImpl.java +++ b/src/main/java/cn/teammodel/service/impl/ChatMessageServiceImpl.java @@ -323,6 +323,20 @@ public class ChatMessageServiceImpl implements ChatMessageService { //角色条件 builder.append(String.format(chatModel.getRole().get(0), chatCommentsDto.getPeriod(), chatCommentsDto.getSubject())); } + String chatName = ""; + + + switch(phase){ + case 1: + chatName = chatCommentsDto.getName()+"班级"; + break; + case 2: + chatName = chatCommentsDto.getName()+"年级"; + break; + default: + chatName = chatCommentsDto.getName()+"同学"; + break; + } ChatModelDto finalChatModel = chatModel; //模版 @@ -371,7 +385,7 @@ public class ChatMessageServiceImpl implements ChatMessageService { )); } }); - builder.append(String.format(finalChatModel.getEnd().get(0), wisdomComments.getDims().size())); + builder.append(String.format(finalChatModel.getEnd().get(0),chatName, wisdomComments.getDims().size())); break; } //智育 表现模版 @@ -404,7 +418,7 @@ public class ChatMessageServiceImpl implements ChatMessageService { count++; } } - builder.append(String.format(finalChatModel.getEnd().get(0), count)); + builder.append(String.format(finalChatModel.getEnd().get(0),chatName)); break; } // 智育 学科评语模版 @@ -438,7 +452,7 @@ public class ChatMessageServiceImpl implements ChatMessageService { builder.append(String.format(finalChatModel.getCycleChats().get(2), name, comments.getClaasRanking().ranking, comments.getClaasRanking().scoreRate * 100, comments.getClaasRanking().average * 100)); } } - builder.append(String.format(finalChatModel.getEnd().get(0), subjectComments.size(),name)); + builder.append(String.format(finalChatModel.getEnd().get(0), subjectComments.size(),chatName)); break; } //艺术 考核指标纬度评语 @@ -467,7 +481,7 @@ public class ChatMessageServiceImpl implements ChatMessageService { builder.append(String.format(finalChatModel.getCycleChats().get(0), artLatitude.getQuotaN1(),artLatitude.getQuotaP1(), artLatitude.getQuotaN2(),artLatitude.getQuotaP2(), artLatitude.getQuotaN3(),artLatitude.getQuotaP3(), artLatitude.getPercent(),artLatitude.getLevel())); } - builder.append(finalChatModel.getEnd()); + builder.append(String.format(finalChatModel.getEnd().get(0),chatName)); break; } //艺术 学科评语模版 @@ -488,7 +502,7 @@ public class ChatMessageServiceImpl implements ChatMessageService { builder.append(String.format(finalChatModel.getCycleChats().get(0), artSubject.getDimension(),artSubject.getBlock(), artSubject.getPoint(),artSubject.getScore(), artSubject.getTotalScore(),artSubject.getPercent())); } - builder.append(String.format(finalChatModel.getEnd().get(0),chatCommentsDto.getSubject())); + 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 2c61520..f5886e4 100644 --- a/src/main/resources/Json/ChatModel.json +++ b/src/main/resources/Json/ChatModel.json @@ -8,7 +8,7 @@ "%s,在%s学年度,第%s学期,共计参加了%s次评测,其中课中评测%s次、线上评测%s次、阅卷评测%s次,总体表现如下:" ], "cycleChats": ["在%s中:学习态度为:%s、学习成效:%s、合作能力:%s、评价能力:%s、评价能力:%s ;\n"], - "end": ["请根据我提供的数据,对这 %s 次考试成绩表现做一个评价。\n"] + "end": ["请根据我提供的数据,对该%s的考试成绩表现做一个评价。\n"] }, { "type": "wisdomExam", @@ -16,7 +16,7 @@ "role": ["请扮演[%s%s]老师角色;数据如下:\n"], "chat": ["%s\n,"], "cycleChats": ["参加第%s次,考试结果:名称:%s,时间:%s,得分:%s,考试得分率:%s %% 排名:%s ;\n"], - "end": ["请根据我提供的数据,对这 %s 次考试成绩表现做一个评价。\n"] + "end": ["请根据我提供的数据,对该%s的考试成绩表现做一个评价。\n"] }, { "type": "wisdomSubject", @@ -32,7 +32,7 @@ "role": ["请扮演[%s%s]老师角色;数据如下:\n"], "chat": ["考核指标评纬度\n","%s的考核指标评纬度\n"], "cycleChats": [" 一级指标:%s( %s %%);二级指标:%s( %s %%);三级指标 %s( %s %%) ;得分率:%s %% 等级:%s\n"], - "end": ["请根据我提供的【考核指标纬度】做一个整体的评价。 \n"] + "end": ["请根据我提供的数据,对该%s做一个整体的评价。 \n"] }, { "type": "artSubject", @@ -40,7 +40,7 @@ "role": ["请扮演[%s%s]老师角色;数据如下:\n "], "chat": ["%s的学科\n"], "cycleChats": [" 考核纬度:%s;一级知识点:%s;二级知识点 %s;得分:%s/%s 得分率:%s\n"], - "end": ["请根据我提供的【%s学科】的表现做一个整体的评价。 \n"] + "end": ["请根据我提供的数据,对该%s的表现做一个整体的评价。 \n"] } ] }