From bde76c5140e5c587538226b6df6cd48c3bdf3028 Mon Sep 17 00:00:00 2001
From: PL <774412461@qq.com>
Date: Thu, 12 Sep 2024 17:11:17 +0800
Subject: [PATCH 1/3] =?UTF-8?q?=E5=A4=84=E7=90=86=E5=85=B6=E4=BB=96?=
=?UTF-8?q?=E8=AE=BF=E9=97=AEai=E5=8A=A9=E6=89=8B=E6=8A=A5=E9=94=99?=
=?UTF-8?q?=EF=BC=8C=E4=BF=AE=E6=94=B9jjwt=E6=8F=92=E4=BB=B6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pom.xml | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/pom.xml b/pom.xml
index f004316..084c376 100644
--- a/pom.xml
+++ b/pom.xml
@@ -118,17 +118,16 @@
-
-
-
+
+
org.springframework.boot
From bdd19d81b709fc5768a83f8c41021ad948fbc299 Mon Sep 17 00:00:00 2001
From: PL <774412461@qq.com>
Date: Thu, 12 Sep 2024 18:48:37 +0800
Subject: [PATCH 2/3] =?UTF-8?q?=E8=89=BA=E6=9C=AF=E8=AF=84=E6=B5=8B?=
=?UTF-8?q?=E7=9A=84=E8=AF=84=E8=AF=AD=E7=BB=93=E6=9E=84?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
...rtCommentsDto.java => ArtLatitudeDto.java} | 7 +-
.../model/dto/ai/comment/ArtSubjectDto.java | 16 +++++
.../dto/ai/comment/artSubjectCommentsDto.java | 22 ------
.../service/impl/ChatMessageServiceImpl.java | 71 ++++++++++++++-----
src/main/resources/Json/ChatModel.json | 12 +++-
5 files changed, 84 insertions(+), 44 deletions(-)
rename src/main/java/cn/teammodel/model/dto/ai/comment/{artCommentsDto.java => ArtLatitudeDto.java} (82%)
create mode 100644 src/main/java/cn/teammodel/model/dto/ai/comment/ArtSubjectDto.java
delete mode 100644 src/main/java/cn/teammodel/model/dto/ai/comment/artSubjectCommentsDto.java
diff --git a/src/main/java/cn/teammodel/model/dto/ai/comment/artCommentsDto.java b/src/main/java/cn/teammodel/model/dto/ai/comment/ArtLatitudeDto.java
similarity index 82%
rename from src/main/java/cn/teammodel/model/dto/ai/comment/artCommentsDto.java
rename to src/main/java/cn/teammodel/model/dto/ai/comment/ArtLatitudeDto.java
index 42433aa..c8c3ee8 100644
--- a/src/main/java/cn/teammodel/model/dto/ai/comment/artCommentsDto.java
+++ b/src/main/java/cn/teammodel/model/dto/ai/comment/ArtLatitudeDto.java
@@ -2,15 +2,18 @@ package cn.teammodel.model.dto.ai.comment;
import lombok.Data;
+/**
+ * 艺术纬度评语
+ */
@Data
-public class artCommentsDto {
+public class ArtLatitudeDto {
+
public String quotaN1;
public String quotaN2;
public String quotaN3;
public int quotaP1;
public int quotaP2;
public int quotaP3;
- public int scoreD;
public String percent;
public String level;
}
diff --git a/src/main/java/cn/teammodel/model/dto/ai/comment/ArtSubjectDto.java b/src/main/java/cn/teammodel/model/dto/ai/comment/ArtSubjectDto.java
new file mode 100644
index 0000000..b2e6143
--- /dev/null
+++ b/src/main/java/cn/teammodel/model/dto/ai/comment/ArtSubjectDto.java
@@ -0,0 +1,16 @@
+package cn.teammodel.model.dto.ai.comment;
+
+import lombok.Data;
+
+/**
+ * 艺术评测 学科评语数据
+ */
+@Data
+public class ArtSubjectDto {
+ public String dimension;
+ public String block;
+ public String point;
+ public int score;
+ public int percent;
+ public int totalScore;
+}
diff --git a/src/main/java/cn/teammodel/model/dto/ai/comment/artSubjectCommentsDto.java b/src/main/java/cn/teammodel/model/dto/ai/comment/artSubjectCommentsDto.java
deleted file mode 100644
index 2679db3..0000000
--- a/src/main/java/cn/teammodel/model/dto/ai/comment/artSubjectCommentsDto.java
+++ /dev/null
@@ -1,22 +0,0 @@
-package cn.teammodel.model.dto.ai.comment;
-
-import lombok.Data;
-
-import java.util.List;
-
-@Data
-public class artSubjectCommentsDto {
-
- public String subjectName;
-
- public List pointPdfs;
-
- public static class PointPdfs{
- public String dimension;
- public String block;
- public String point;
- public String score;
- public String percent;
- public String totalScore;
- }
-}
diff --git a/src/main/java/cn/teammodel/service/impl/ChatMessageServiceImpl.java b/src/main/java/cn/teammodel/service/impl/ChatMessageServiceImpl.java
index bf80ea0..f7b623a 100644
--- a/src/main/java/cn/teammodel/service/impl/ChatMessageServiceImpl.java
+++ b/src/main/java/cn/teammodel/service/impl/ChatMessageServiceImpl.java
@@ -10,10 +10,7 @@ import cn.teammodel.common.ErrorCode;
import cn.teammodel.common.PK;
import cn.teammodel.config.exception.ServiceException;
import cn.teammodel.model.dto.ai.*;
-import cn.teammodel.model.dto.ai.comment.ChatCommentsDto;
-import cn.teammodel.model.dto.ai.comment.WisdomCommentsDto;
-import cn.teammodel.model.dto.ai.comment.WisdomExamCommentsDto;
-import cn.teammodel.model.dto.ai.comment.WisdomSubjectComments;
+import cn.teammodel.model.dto.ai.comment.*;
import cn.teammodel.model.entity.ai.ChatApp;
import cn.teammodel.repository.ChatAppRepository;
import cn.teammodel.repository.ChatSessionRepository;
@@ -21,10 +18,8 @@ import cn.teammodel.model.entity.User;
import cn.teammodel.model.entity.ai.ChatSession;
import cn.teammodel.security.utils.SecurityUtil;
import cn.teammodel.service.ChatMessageService;
-import cn.teammodel.utils.FileUtil;
import cn.teammodel.utils.RepositoryUtil;
import com.alibaba.fastjson2.JSON;
-import com.alibaba.fastjson2.JSONObject;
import com.alibaba.fastjson2.TypeReference;
import com.azure.cosmos.models.CosmosPatchOperations;
import lombok.extern.slf4j.Slf4j;
@@ -34,11 +29,6 @@ import org.springframework.stereotype.Service;
import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;
import javax.annotation.Resource;
-import java.io.*;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.nio.file.Files;
-import java.nio.file.Paths;
import java.time.Instant;
import java.util.*;
@@ -467,20 +457,65 @@ public class ChatMessageServiceImpl implements ChatMessageService {
break;
}
//艺术 考核指标纬度评语
- case "artDimensions":
- builder.append("请按照以下格式回复:\n");
- builder.append("1. 艺术作品:\n");
- builder.append("2. 艺术作品说明:\n");
- builder.append("3. 艺术作品示例:\n");
- builder.append("4. 艺术作品示例说明:\n");
+ case "artLatitude":{
+ List artLatitudes;
+ try {
+ artLatitudes = JSON.parseObject(strData, new TypeReference>() {
+ });
+ } catch (Exception e) {
+ throw new ServiceException(ErrorCode.PARAMS_ERROR.getCode(), "请求参数异常");
+ }
+ if (artLatitudes.size() <= 1) {
+ if (artLatitudes.isEmpty()) {
+ throw new ServiceException(ErrorCode.PARAMS_ERROR.getCode(), "请求参数异常");
+ }
+ }
+ builder.append(finalChatModel.getChat());
+ for (ArtLatitudeDto artLatitude : artLatitudes)
+ {
+ 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());
break;
- case "sport":
+ }
+ //艺术 学科评语模版
+ case "artSubject":{
+ List artSubjects;
+ try {
+ artSubjects = JSON.parseObject(strData, new TypeReference>() {
+ });
+ } catch (Exception e) {
+ throw new ServiceException(ErrorCode.PARAMS_ERROR.getCode(), "请求参数异常");
+ }
+ if (artSubjects.size() <= 1) {
+ if (artSubjects.isEmpty()) {
+ throw new ServiceException(ErrorCode.PARAMS_ERROR.getCode(), "请求参数异常");
+ }
+ }
+ builder.append(finalChatModel.getChat());
+ for (ArtSubjectDto artSubject : artSubjects){
+ 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(),chatCommentsDto.getSubject()));
+ break;
+ }
+ //体育
+ case "sport":{
builder.append("请按照以下格式回复:\n");
builder.append("1. 运动作品:\n");
builder.append("2. 运动作品说明:\n");
builder.append("3. 运动作品示例:\n");
builder.append("4. 运动作品示例说明:\n");
break;
+ }
+ //德育
+ case "moral":{
+ builder.append(finalChatModel.getChat());
+
+ break;
+ }
default:
throw new ServiceException(ErrorCode.PARAMS_ERROR.getCode(), "评语类型异常");
}
diff --git a/src/main/resources/Json/ChatModel.json b/src/main/resources/Json/ChatModel.json
index 6a88d92..4b01936 100644
--- a/src/main/resources/Json/ChatModel.json
+++ b/src/main/resources/Json/ChatModel.json
@@ -25,12 +25,20 @@
"end": "根据我提供的数据,对这%s次学科表现做一个整体的评价。 \n"
},
{
- "type": "artDimensions",
+ "type": "artLatitude",
"name": "艺术 考核指标评语模版",
"role": "请扮演[%s%s]老师角色\n ",
"chat": "考核指标评纬度\n",
- "cycleChats": [" 指标:%s 、得分率:%s %% \n"],
+ "cycleChats": [" 一级指标:%s( %s %%);二级指标:%s( %s %%);三级指标 %s( %s %%) ;得分率:%s %% 等级:%s\n"],
"end": "根据我提供的【考核指标纬度】做一个整体的评价。 \n"
+ },
+ {
+ "type": "artSubject",
+ "name": "艺术 学科评语模版",
+ "role": "请扮演[%s%s]老师角色\n ",
+ "chat": "%s学科\n",
+ "cycleChats": [" 考核纬度:%s;一级知识点:%s;二级知识点 %s;得分:%s/%s 得分率:%s\n"],
+ "end": "根据我提供的【%s学科】的表现做一个整体的评价。 \n"
}
]
}
From 47bd34e7607bc0db9beed557b150e8decf3de77c Mon Sep 17 00:00:00 2001
From: PL <774412461@qq.com>
Date: Fri, 13 Sep 2024 10:55:12 +0800
Subject: [PATCH 3/3] =?UTF-8?q?=E5=A4=84=E7=90=86=E6=99=BA=E8=82=B2?=
=?UTF-8?q?=EF=BC=8C=E5=AD=A6=E7=A7=91=E6=8E=92=E8=A1=8C=E8=AF=84=E8=AF=AD?=
=?UTF-8?q?=E6=A8=A1=E7=89=88?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../model/dto/ai/comment/WisdomSubjectComments.java | 2 ++
.../service/impl/ChatMessageServiceImpl.java | 12 +++++-------
src/main/resources/Json/ChatModel.json | 4 ++--
3 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/src/main/java/cn/teammodel/model/dto/ai/comment/WisdomSubjectComments.java b/src/main/java/cn/teammodel/model/dto/ai/comment/WisdomSubjectComments.java
index 975edc2..ece3006 100644
--- a/src/main/java/cn/teammodel/model/dto/ai/comment/WisdomSubjectComments.java
+++ b/src/main/java/cn/teammodel/model/dto/ai/comment/WisdomSubjectComments.java
@@ -35,10 +35,12 @@ public class WisdomSubjectComments {
* 学生姓名
*/
public String name;
+
/**
* 排名
*/
public int ranking;
+
/**
* 占比
*/
diff --git a/src/main/java/cn/teammodel/service/impl/ChatMessageServiceImpl.java b/src/main/java/cn/teammodel/service/impl/ChatMessageServiceImpl.java
index f7b623a..139c652 100644
--- a/src/main/java/cn/teammodel/service/impl/ChatMessageServiceImpl.java
+++ b/src/main/java/cn/teammodel/service/impl/ChatMessageServiceImpl.java
@@ -441,19 +441,17 @@ public class ChatMessageServiceImpl implements ChatMessageService {
}
}
builder.append(finalChatModel.getChat());
+ String name = "";
//拼接学科数组
for (WisdomSubjectComments comments : subjectComments) {
builder.append(String.format(finalChatModel.getCycleChats().get(0), comments.subjectName));
for (WisdomSubjectComments.StuInfo stuInfo : comments.getRankings()) {
- builder.append(String.format(finalChatModel.getCycleChats().get(1), stuInfo.ranking,
- stuInfo.name, stuInfo.scoreRate));
+ builder.append(String.format(finalChatModel.getCycleChats().get(1), stuInfo.ranking,stuInfo.name, stuInfo.scoreRate*100));
}
-
- builder.append(String.format(finalChatModel.getCycleChats().get(2),
- comments.getClaasRanking().ranking, comments.getClaasRanking().scoreRate,
- comments.getClaasRanking().average));
+ name = comments.getClaasRanking().name;
+ builder.append(String.format(finalChatModel.getCycleChats().get(2),name,comments.getClaasRanking().ranking, comments.getClaasRanking().scoreRate * 100,comments.getClaasRanking().average));
}
- builder.append(String.format(finalChatModel.getEnd(), subjectComments.size()));
+ builder.append(String.format(finalChatModel.getEnd(), subjectComments.size(),name));
break;
}
//艺术 考核指标纬度评语
diff --git a/src/main/resources/Json/ChatModel.json b/src/main/resources/Json/ChatModel.json
index 4b01936..5547b35 100644
--- a/src/main/resources/Json/ChatModel.json
+++ b/src/main/resources/Json/ChatModel.json
@@ -21,8 +21,8 @@
"name": "智育 学科评语模版",
"role": "请扮演[%s%s]老师角色\n ",
"chat": "各科评测表现",
- "cycleChats":["科目:%s 班级top10"," 排名:%s,姓名:%s,得分率:%s %% ,\n " ,"自己在班级排名:%s,得分率:%s %%,排在班级平均:(%s %%)"],
- "end": "根据我提供的数据,对这%s次学科表现做一个整体的评价。 \n"
+ "cycleChats":["科目:%s 班级top10"," 排名:%s,姓名:%s,得分率:%s %% ,\n " ,"%s在班级排名:%s,得分率:%s %%,排在班级平均:(%s %%)"],
+ "end": "根据我提供的数据,对这%s门学科,【%s】在班级中的表现做一个评价。 \n"
},
{
"type": "artLatitude",