|
@@ -92,8 +92,8 @@ public class KmtExerciseSubmitServiceImpl implements KmtExerciseSubmitService {
|
|
|
boolean isManagerSubmit = isManagerSubmit(userId, request.getType()); //是否是管理员提交
|
|
|
request.setType(isManagerSubmit ? 3 : request.getType()); //管理员提交修改为3, 管理员修改不改变题目的状态
|
|
|
|
|
|
- if (isExistQuestonsPulish(questions, request.getType())){
|
|
|
- return responseEntity.failure(ResponseConstant.CODE_000, "题目已发布,不能提交审核");
|
|
|
+ if (isExistQuestionCantDeal(questions, request.getType())){
|
|
|
+ return responseEntity.failure(ResponseConstant.CODE_000, "非可加工状态, 请刷新题目列表");
|
|
|
} else if (!isQuestionHandlerSubmitKnowledge(request)) {
|
|
|
return responseEntity.failure(ResponseConstant.CODE_000, "请添加知识点");
|
|
|
} else {
|
|
@@ -252,6 +252,26 @@ public class KmtExerciseSubmitServiceImpl implements KmtExerciseSubmitService {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * 是否存在不可操作题目
|
|
|
+ * @param questions
|
|
|
+ * @param type
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ private boolean isExistQuestionCantDeal (List<KmtExerciseQuestion> questions, int type){
|
|
|
+ boolean exist = false;
|
|
|
+ if (type == 0 && questions.stream().anyMatch(q -> q.getDealStatus() != 0 && q.getDealStatus() != 1)){
|
|
|
+ exist = true;
|
|
|
+ } else if (type == 1 && questions.stream().anyMatch(q -> q.getDealStatus() != 3 && q.getDealStatus() != 7)){
|
|
|
+ exist = true;
|
|
|
+ } else if (type == 4 && questions.stream().anyMatch(q -> q.getDealStatus() != 5 && q.getDealStatus() != 8)){
|
|
|
+ exist = true;
|
|
|
+ } else if (type == 5 && questions.stream().anyMatch(q -> q.getDealStatus() != 9 && q.getDealStatus() != 10)){
|
|
|
+ exist = true;
|
|
|
+ }
|
|
|
+ return exist;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* 练习册加工审核是否提交了知识点
|
|
|
* @param request
|
|
|
* @return
|