diff --git a/src/main/java/cn/teammodel/dao/EvaluationRepository.java b/src/main/java/cn/teammodel/dao/EvaluationRepository.java index d6c22a1..aa28cd7 100644 --- a/src/main/java/cn/teammodel/dao/EvaluationRepository.java +++ b/src/main/java/cn/teammodel/dao/EvaluationRepository.java @@ -18,7 +18,7 @@ import org.springframework.stereotype.Repository; @Repository public interface EvaluationRepository extends CosmosRepository { Appraise findBySchoolId(String schoolId, PartitionKey partitionKey); - Appraise findBySchoolIdAndPeriodId(String schoolId, String periodId, PartitionKey partitionKey); + Appraise findAppraiseBySchoolIdAndPeriodIdAndCode(String schoolId, String periodId, String code); } diff --git a/src/main/java/cn/teammodel/service/impl/EvaluationServiceImpl.java b/src/main/java/cn/teammodel/service/impl/EvaluationServiceImpl.java index ce13739..9bc96cc 100644 --- a/src/main/java/cn/teammodel/service/impl/EvaluationServiceImpl.java +++ b/src/main/java/cn/teammodel/service/impl/EvaluationServiceImpl.java @@ -47,7 +47,7 @@ public class EvaluationServiceImpl implements EvaluationService { String schoolId = loginUser.getSchoolId(); // 拿到要新增节点的原始数据 - Appraise appraise = evaluationRepository.findBySchoolIdAndPeriodId(schoolId, periodId, PK.of(PK.PK_APPRAISE)); + Appraise appraise = evaluationRepository.findAppraiseBySchoolIdAndPeriodIdAndCode(schoolId, periodId, PK.PK_APPRAISE); if (appraise == null) { throw new ServiceException(ErrorCode.PARAMS_ERROR.getCode(), "学校评价数据不存在"); }