浏览代码

修复unit修改接口逻辑bug

luoshi@qmth.com.cn 8 年之前
父节点
当前提交
76d35b22bf
共有 1 个文件被更改,包括 5 次插入8 次删除
  1. 5 8
      cqb-paper/src/main/java/com/qmth/cqb/paper/service/PaperDetailUnitService.java

+ 5 - 8
cqb-paper/src/main/java/com/qmth/cqb/paper/service/PaperDetailUnitService.java

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