|
@@ -853,6 +853,13 @@ public class ServerController extends BaseController {
|
|
|
@GetMapping("scaleInfo/{flag}")
|
|
|
@ApiOperation("根据flag查询题目检测列表")
|
|
|
public Result getScaleListByFlag(@PathVariable String flag) {
|
|
|
+ ScaleDetailsEntity scaleDetailsEntity = scaleDetailsService.getSubjectDetailsByFlag(flag);
|
|
|
+ if (scaleDetailsEntity == null){
|
|
|
+ return fail("量表不存在,请联系管理员");
|
|
|
+ }
|
|
|
+ if (Constant.DEFAULT_VALUE_ONE.equals(scaleDetailsEntity.getIsValid())){
|
|
|
+ return fail("无效量表,请联系管理员");
|
|
|
+ }
|
|
|
log.info("题目查询开始===================="+DateUtil.current());
|
|
|
List<ScaleEntity> scaleEntityList = this.scaleService.getScaleByFlag(flag);
|
|
|
log.info("题目查询结束===================="+DateUtil.current());
|
|
@@ -913,10 +920,16 @@ public class ServerController extends BaseController {
|
|
|
if (CollectionUtils.isEmpty(subjectEntityList)){
|
|
|
return fail("量表信息不存在,请联系管理员!");
|
|
|
}
|
|
|
+ if (Constant.DEFAULT_VALUE_ONE.equals(scaleDetailsEntity.getIsValid())){
|
|
|
+ return fail("无效量表,请联系管理员!");
|
|
|
+ }
|
|
|
scaleDetailsEntity.setTestNum(subjectEntityList.get(0).getTestNum());
|
|
|
+ //获取到题目
|
|
|
+ List<ScaleEntity> scaleEntityList = scaleService.getScaleByFlag(flag);
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
jsonObject.put("subjectEntityDto2List", subjectEntityDto2List);
|
|
|
jsonObject.put("ScaleDetailsEntity", scaleDetailsEntity);
|
|
|
+ jsonObject.put("questionNum",scaleEntityList== null?0:scaleEntityList.size());
|
|
|
return success(jsonObject);
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|