Ver código fonte

大题更新得分改为saveAndFlush

ting.yin 4 anos atrás
pai
commit
bcb83bf70f

+ 3 - 2
stmms-biz/src/main/java/cn/com/qmth/stmms/biz/exam/dao/SubjectiveScoreDao.java

@@ -2,6 +2,7 @@ package cn.com.qmth.stmms.biz.exam.dao;
 
 import java.util.List;
 
+import org.springframework.data.jpa.repository.JpaRepository;
 import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
 import org.springframework.data.jpa.repository.Modifying;
 import org.springframework.data.jpa.repository.Query;
@@ -11,8 +12,8 @@ import cn.com.qmth.stmms.biz.exam.model.SubjectiveScore;
 import cn.com.qmth.stmms.biz.exam.model.SubjectiveScorePK;
 import cn.com.qmth.stmms.common.enums.SubjectiveStatus;
 
-public interface SubjectiveScoreDao extends PagingAndSortingRepository<SubjectiveScore, SubjectiveScorePK>,
-        JpaSpecificationExecutor<SubjectiveScore> {
+public interface SubjectiveScoreDao extends JpaRepository<SubjectiveScore, SubjectiveScorePK>,
+        PagingAndSortingRepository<SubjectiveScore, SubjectiveScorePK>, JpaSpecificationExecutor<SubjectiveScore> {
 
     @Query("select s from SubjectiveScore s where s.pk.studentId=?1 order by s.pk.mainNumber, s.pk.subNumber")
     List<SubjectiveScore> findByStudentId(Integer studentId);

+ 1 - 1
stmms-biz/src/main/java/cn/com/qmth/stmms/biz/mark/service/Impl/MarkServiceImpl.java

@@ -814,8 +814,8 @@ public class MarkServiceImpl implements MarkService {
             }
             for (SubjectiveScore subjectiveScore : mainScoreList) {
                 subjectiveScore.setMainScore(mainScore);
+                scoreDao.saveAndFlush(subjectiveScore);
             }
-            scoreDao.save(mainScoreList);
         }
         // 全部评完,更新考生主观题得分
         studentService.updateSubjectiveStatusAndScore(studentId, SubjectiveStatus.MARKED, totalScore,