|
@@ -104,7 +104,7 @@ public class PaperController extends ControllerSupport {
|
|
if ("success".equals(msgMap.get("msg"))) {
|
|
if ("success".equals(msgMap.get("msg"))) {
|
|
return new ResponseEntity<>(msgMap, HttpStatus.OK);
|
|
return new ResponseEntity<>(msgMap, HttpStatus.OK);
|
|
} else {
|
|
} else {
|
|
- return new ResponseEntity<>(msgMap, HttpStatus.INTERNAL_SERVER_ERROR);
|
|
|
|
|
|
+ throw new StatusException("1000",msgMap.get("msg").toString());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -210,7 +210,7 @@ public class PaperController extends ControllerSupport {
|
|
if (msgMap.get("msg").equals("success")) {
|
|
if (msgMap.get("msg").equals("success")) {
|
|
return new ResponseEntity<>(msgMap, HttpStatus.OK);
|
|
return new ResponseEntity<>(msgMap, HttpStatus.OK);
|
|
} else {
|
|
} else {
|
|
- return new ResponseEntity<>(msgMap, HttpStatus.INTERNAL_SERVER_ERROR);
|
|
|
|
|
|
+ throw new StatusException("1001","试卷["+msgMap.get("paperName")+"]中有试题被组卷使用,不能删除!");
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
@@ -553,13 +553,13 @@ public class PaperController extends ControllerSupport {
|
|
Paper oldpaper = cn.com.qmth.examcloud.core.questions.base.Model.of(paperRepo.findById(paperIdArray[i]));
|
|
Paper oldpaper = cn.com.qmth.examcloud.core.questions.base.Model.of(paperRepo.findById(paperIdArray[i]));
|
|
boolean result = paperService.checkPaperName(oldpaper.getName(), PaperType.GENERATE, user.getRootOrgId() + "");
|
|
boolean result = paperService.checkPaperName(oldpaper.getName(), PaperType.GENERATE, user.getRootOrgId() + "");
|
|
if (!result) {
|
|
if (!result) {
|
|
- throw new StatusException("Q-160565", "考试试卷:" + oldpaper.getName() + "已经存在");
|
|
|
|
|
|
+ throw new StatusException("160565", "考试试卷:" + oldpaper.getName() + "已经存在");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
paperService.useBasePaper(paperIds, user.getDisplayName());
|
|
paperService.useBasePaper(paperIds, user.getDisplayName());
|
|
return new ResponseEntity<>(HttpStatus.OK);
|
|
return new ResponseEntity<>(HttpStatus.OK);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
- throw new StatusException("Q-160537", e.getMessage());
|
|
|
|
|
|
+ throw new StatusException("160537", e.getMessage());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|