From a09d61b020dab2aeb886d83bdb8891923e39dbe9 Mon Sep 17 00:00:00 2001 From: winter <2436197699@qq.com> Date: Fri, 1 Dec 2023 10:48:38 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=A2=9E=E5=8A=A0=E6=9D=A1=E4=BB=B6?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E5=AD=A6=E7=94=9F=E8=AF=84=E4=BB=B7=E6=9D=A1?= =?UTF-8?q?=E4=BB=B6=E9=A1=B9=E4=B8=BA=E7=A9=BA=E7=99=BD=E5=AD=97=E7=AC=A6?= =?UTF-8?q?=E4=B8=B2=E6=97=B6=E4=B8=8D=E8=AE=A1=E5=85=A5=E6=9D=A1=E4=BB=B6?= =?UTF-8?q?=E7=9A=84=E6=8E=A5=E5=8F=A3=E5=81=A5=E5=A3=AE=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cn/teammodel/dao/AppraiseRecordRepository.java | 1 + .../model/dto/Appraise/FindVoteRecordDto.java | 2 +- .../teammodel/service/impl/EvaluationServiceImpl.java | 10 +++++----- .../teammodel/TeamModelExtensionApplicationTests.java | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/main/java/cn/teammodel/dao/AppraiseRecordRepository.java b/src/main/java/cn/teammodel/dao/AppraiseRecordRepository.java index d5a3c97..3819e50 100644 --- a/src/main/java/cn/teammodel/dao/AppraiseRecordRepository.java +++ b/src/main/java/cn/teammodel/dao/AppraiseRecordRepository.java @@ -34,6 +34,7 @@ public interface AppraiseRecordRepository extends CosmosRepository nodes) { List children = nodes.stream().filter(item -> item.getPid() != null).collect(Collectors.toList()); @@ -308,10 +308,10 @@ public class EvaluationServiceImpl implements EvaluationService { @Override public List findVoteRecord(FindVoteRecordDto findVoteRecordDto) { - String periodId = findVoteRecordDto.getTargetId(); - String targetId = findVoteRecordDto.getTargetId(); - String targetType = findVoteRecordDto.getTargetType(); - String classId = findVoteRecordDto.getClassId(); + String periodId = findVoteRecordDto.getPeriodId(); + String targetId = StringUtils.isBlank(findVoteRecordDto.getTargetId()) ? null : findVoteRecordDto.getTargetId(); + String targetType = StringUtils.isBlank(findVoteRecordDto.getTargetType()) ? null : findVoteRecordDto.getTargetType(); + String classId = StringUtils.isBlank(findVoteRecordDto.getClassId()) ? null : findVoteRecordDto.getClassId(); User loginUser = SecurityUtil.getLoginUser(); String teacherId = loginUser.getId(); String schoolId = loginUser.getSchoolId(); diff --git a/src/test/java/cn/teammodel/TeamModelExtensionApplicationTests.java b/src/test/java/cn/teammodel/TeamModelExtensionApplicationTests.java index 55d3466..369ec77 100644 --- a/src/test/java/cn/teammodel/TeamModelExtensionApplicationTests.java +++ b/src/test/java/cn/teammodel/TeamModelExtensionApplicationTests.java @@ -86,7 +86,7 @@ class TeamModelExtensionApplicationTests { //List nodeById = appraiseRepository.findNodeById("habook", "default", "Appraise", "43e23f03-288c-4012-b5f3-4d5c022739a2"); //System.out.println(nodeById); - System.out.println(schoolRepository.findSemestersById("hbcn", "be32942d-97a9-52ba-45d6-2e5b722583f5")); + System.out.println(schoolRepository.findSemestersById("habook", "50fdecdb-6cbd-4c9a-8dc2-a627f4d6b312")); // 评价记录 //List record = appraiseRecordRepository.findScoreAndPraise("fakeStudentId1", // "2023-71fbd0bd-9a46-0490-f6b3-7d16cba4c017",