|
@@ -308,6 +308,24 @@ public class KmtExerciseQuestionDealServiceImpl implements KmtExerciseQuestionDe
|
|
|
if(kmtExerciseQuestion.getQuestionClassType() == 0) {
|
|
|
return responseEntity.failure(ResponseConstant.CODE_000, "单题不能移动小题,请使用移动大题功能");
|
|
|
}
|
|
|
+ //如果移动到最开始或最末尾, 提示不能再移动
|
|
|
+ String parentId = null;
|
|
|
+ if (StringUtil.isBlank(kmtExerciseQuestion.getParentId())){
|
|
|
+ parentId = kmtExerciseQuestion.getId();
|
|
|
+ } else {
|
|
|
+ parentId = kmtExerciseQuestion.getParentId();
|
|
|
+ }
|
|
|
+ List<String> tempList = kmtExerciseMapper.findQuestionIdByParentId(parentId);
|
|
|
+ if (tempList != null && tempList.size() > 0){
|
|
|
+ if (kmtExerciseQuestion.getId().equals(tempList.get(0))){
|
|
|
+ return responseEntity.failure(ResponseConstant.CODE_000, "已移动到第一小题");
|
|
|
+ }
|
|
|
+ if (kmtExerciseQuestion.getId().equals(tempList.get(tempList.size() - 1))){
|
|
|
+ return responseEntity.failure(ResponseConstant.CODE_000, "已移动到最后一个小题的位置");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
//移动小题
|
|
|
if (request.getType() == 1){
|
|
|
//上移
|