|
@@ -109,7 +109,8 @@ public class KmtExerciseSubmitServiceImpl implements KmtExerciseSubmitService {
|
|
List<String> questionIds = request.getQuestions().stream().map(QuestionUpdateRequest::getQuestionId).collect(Collectors.toList());
|
|
List<String> questionIds = request.getQuestions().stream().map(QuestionUpdateRequest::getQuestionId).collect(Collectors.toList());
|
|
|
|
|
|
//更新练习册
|
|
//更新练习册
|
|
- this.updateKmtExerciseBookFinishStatus(questions.size(), book, request.getType());
|
|
|
|
|
|
+ int questionCount = getQuestionStatusCount(questions, request.getType());
|
|
|
|
+ this.updateKmtExerciseBookFinishStatus(questionCount, book, request.getType());
|
|
kmtExerciseMapper.updateKmtExerciseBookHandleStatus(book);
|
|
kmtExerciseMapper.updateKmtExerciseBookHandleStatus(book);
|
|
|
|
|
|
//更新题目
|
|
//更新题目
|
|
@@ -143,6 +144,42 @@ public class KmtExerciseSubmitServiceImpl implements KmtExerciseSubmitService {
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 获取更新的题目的当前状态下的题数
|
|
|
|
+ * @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
|
|
@Override
|
|
@Transactional(propagation = Propagation.NOT_SUPPORTED)
|
|
@Transactional(propagation = Propagation.NOT_SUPPORTED)
|
|
public void updateEsQuestionAndKnow (List<KmtExerciseQuestion> questions, List<String> questionIds){
|
|
public void updateEsQuestionAndKnow (List<KmtExerciseQuestion> questions, List<String> questionIds){
|