Browse Source

修复unit更新逻辑中的分数设置bug

luoshi@qmth.com.cn 8 years ago
parent
commit
f32e20e98f

+ 7 - 4
cqb-paper/src/main/java/com/qmth/cqb/paper/service/PaperDetailUnitService.java

@@ -57,7 +57,8 @@ public class PaperDetailUnitService {
         if (oldPdu.getQuestionType() == QuesStructType.NESTED_ANSWER_QUESTION) {
             if (pduExp.getQuestion().getId().equals(oldPdu.getQuestion().getId())) {
                 //更新对象为套题本身
-                oldPdu.setQuestion(quesService.saveQues(pduExp.getQuestion()));
+                //oldPdu.setQuestion(quesService.saveQues(pduExp.getQuestion()));
+                quesService.saveQues(pduExp.getQuestion());
             } else {
                 List<Double> subScoreList = oldPdu.getSubScoreList();
                 int size = oldPdu.getQuestion().getSubQuestions().size();
@@ -77,13 +78,15 @@ public class PaperDetailUnitService {
                     }
                 }
                 //更新套题unit当前总分
-                oldPdu.updateSubScore(subScoreList);
+                oldPdu.setSubScoreList(subScoreList);
                 if (match) {
-                    oldPdu.setQuestion(quesService.saveQues(oldPdu.getQuestion()));
+                    //oldPdu.setQuestion(quesService.saveQues(oldPdu.getQuestion()));
+                    quesService.saveQues(oldPdu.getQuestion());
                 }
             }
         } else {
-            oldPdu.setQuestion(quesService.saveQues(pduExp.getQuestion()));
+            //oldPdu.setQuestion(quesService.saveQues(pduExp.getQuestion()));
+            quesService.saveQues(pduExp.getQuestion());
             oldPdu.setScore(pduExp.getScore());
         }
         // 同时要跟新小题里面的Qustion对象