1
0
Эх сурвалжийг харах

修复问题卷提交未清除给分明细问题;客观题统分精度丢失问题;

ting.yin 3 жил өмнө
parent
commit
8a32bec0d9

+ 3 - 3
stmms-biz/src/main/java/cn/com/qmth/stmms/biz/mark/dao/MarkLibraryDao.java

@@ -143,10 +143,10 @@ public interface MarkLibraryDao extends JpaRepository<MarkLibrary, Integer>, Jpa
     MarkLibrary findByStudentIdAndGroupNumberAndTaskNumber(Integer studentId, Integer groupNumber, Integer taskNumber);
 
     @Modifying(clearAutomatically = true)
-    @Query("update MarkLibrary l set l.status=?2, l.markerId=?3, l.markerTime=?4,l.markerScore=0, "
-            + "l.markerSpent=?5 where l.id=?1 and l.status in (?6) and (l.markerId=null or l.markerId=?3)")
+    @Query("update MarkLibrary l set l.status=?2, l.markerId=?3, l.markerTime=?4,l.markerScore=?6,l.markerScoreList=?7, "
+            + "l.markerSpent=?5 where l.id=?1 and l.status in (?8) and (l.markerId=null or l.markerId=?3)")
     int updateProblemResult(Integer id, LibraryStatus newStatus, Integer markerId, Date markerTime, Integer spent,
-            LibraryStatus... previousStatus);
+            Double markerScore, String markerScoreList, LibraryStatus... previousStatus);
 
     @Query("select distinct m.subjectCode from MarkLibrary m where m.examId=?1 and m.status not in (?2) ")
     Set<String> findSubjectUnFinishByExamId(int examId, LibraryStatus... status);

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

@@ -549,8 +549,8 @@ public class MarkServiceImpl implements MarkService {
                 if (result.isProblem()) {
                     // 状态更新
                     if (libraryDao.updateProblemResult(library.getId(), LibraryStatus.PROBLEM, marker.getId(), now,
-                            result.getSpent(), LibraryStatus.WAITING, LibraryStatus.MARKED, LibraryStatus.INSPECTED,
-                            LibraryStatus.REJECTED) != 0) {
+                            result.getSpent(), 0d, null, LibraryStatus.WAITING, LibraryStatus.MARKED,
+                            LibraryStatus.INSPECTED, LibraryStatus.REJECTED) != 0) {
                         saveProblemHistory(result, library, marker);
                         updateMarkedCount(group);
                         // 未评完

+ 5 - 3
stmms-biz/src/main/java/cn/com/qmth/stmms/biz/utils/ScoreInfo.java

@@ -3,6 +3,8 @@ package cn.com.qmth.stmms.biz.utils;
 import java.util.ArrayList;
 import java.util.List;
 
+import cn.com.qmth.stmms.common.utils.BigDecimalUtils;
+
 public class ScoreInfo {
 
     private int mainNumber;
@@ -45,11 +47,11 @@ public class ScoreInfo {
         item.setScore(score);
 
         scoreList.add(item);
-        totalScore += item.getScore();
+        totalScore = BigDecimalUtils.add(totalScore, item.getScore());
         if (item.isObjective()) {
-            objectiveScore += item.getScore();
+            objectiveScore = BigDecimalUtils.add(objectiveScore, item.getScore());
         } else {
-            subjectiveScore += item.getScore();
+            subjectiveScore = BigDecimalUtils.add(subjectiveScore, item.getScore());
         }
     }