Prechádzať zdrojové kódy

Merge branch 'bug-branch' into aijia-branch

# Conflicts:
#	ssj-mybatis-service-impl/src/main/resources/mybatis/mapper/KmtExerciseMapper.xml
chen 5 rokov pred
rodič
commit
f731567b03

+ 36 - 0
ssj-kmt-exercise-service-impl/src/main/java/com/ssj/service/kmt/kmt/service/impl/KmtExerciseSubmitServiceImpl.java

@@ -180,6 +180,42 @@ public class KmtExerciseSubmitServiceImpl implements KmtExerciseSubmitService {
         return result;
     }
 
+    /**
+     * 获取更新的题目的当前状态下的题数
+     * @param questions
+     * @param type
+     * @return
+     */
+    private int getQuestionStatusCount (List<KmtExerciseQuestion> questions, int type){
+        int result = 0;
+        if (type == 0){
+            for (KmtExerciseQuestion q :questions){
+                if (q.getDealStatus() == 0 || q.getDealStatus() == 1) {
+                    result += 1;
+                }
+            }
+        } else if (type == 1){
+            for (KmtExerciseQuestion q :questions){
+                if (q.getDealStatus() == 3 || q.getDealStatus() == 7) {
+                    result += 1;
+                }
+            }
+        } else if (type == 4){
+            for (KmtExerciseQuestion q :questions){
+                if (q.getDealStatus() == 5 || q.getDealStatus() == 8) {
+                    result += 1;
+                }
+            }
+        } else if (type == 5){
+            for (KmtExerciseQuestion q :questions){
+                if (q.getDealStatus() == 9 || q.getDealStatus() == 10) {
+                    result += 1;
+                }
+            }
+        }
+        return result;
+    }
+
     @Override
     @Transactional(propagation = Propagation.NOT_SUPPORTED)
     public void updateEsQuestionAndKnow (List<KmtExerciseQuestion> questions, List<String> questionIds){

+ 4 - 4
ssj-mybatis-service-impl/src/main/resources/mybatis/mapper/KmtExerciseMapper.xml

@@ -112,16 +112,16 @@
         from kmt_exercise_questions eq  left join kmt_exercise_book eb on eq.exercise_book_id=eb.id
         where eq.book_course_id = #{bookCourseId} and (eq.exercise_book_id=#{exerciseBookId} or eq.is_common_flag = 0)
         <if test = "dealType == 2">
-            and eq.deal_status in (3, 7) and auditing_user_id=#{userId}
+            and eq.deal_status in (3, 7) and eb.auditing_user_id=#{userId}
         </if>
         <if test = "dealType == 1">
-            and eq.deal_status &lt; 2 and handle_user_id=#{userId}
+            and eq.deal_status &lt; 2 and eb.handle_user_id=#{userId}
         </if>
         <if test = "dealType == 4">
-            and eq.deal_status in (5, 8) and analysis_user_id=#{userId}
+            and eq.deal_status in (5, 8) and eb.analysis_user_id=#{userId}
         </if>
         <if test = "dealType == 5">
-            and eq.deal_status in (9, 10) and analysis_auditer_id = #{userId}
+            and eq.deal_status in (9, 10) and eb.analysis_auditer_id = #{userId}
         </if>
         <if test = "dealType == 6">
             and eq.deal_status >= 4 and eq.deal_status != 7 and eb.answer_correcter_id=#{userId} and eq.proofread_status = 0