|
|
@ -95,9 +95,11 @@ public class CaseController {
|
|
|
|
public ResultEntity<PageInfo<SysCaseQuestion>> selectCaseByConditions(@RequestParam Integer index,
|
|
|
|
public ResultEntity<PageInfo<SysCaseQuestion>> selectCaseByConditions(@RequestParam Integer index,
|
|
|
|
@RequestParam Integer size,
|
|
|
|
@RequestParam Integer size,
|
|
|
|
@RequestParam(required = false) String title,
|
|
|
|
@RequestParam(required = false) String title,
|
|
|
|
@RequestParam(required = false) String oneId) {
|
|
|
|
@RequestParam(required = false) String oneId,
|
|
|
|
|
|
|
|
@RequestParam(required = false) String twoId,
|
|
|
|
|
|
|
|
@RequestParam(required = false) String threeId) {
|
|
|
|
PageHelper.startPage(index, size);
|
|
|
|
PageHelper.startPage(index, size);
|
|
|
|
List<SysCaseQuestion> list = caseQuestionMapper.selectCaseByConditions(title, oneId, null);
|
|
|
|
List<SysCaseQuestion> list = caseQuestionMapper.selectCaseByConditions(title, oneId, null, twoId, threeId);
|
|
|
|
PageInfo pageInfo = new PageInfo<SysCaseQuestion>(list);
|
|
|
|
PageInfo pageInfo = new PageInfo<SysCaseQuestion>(list);
|
|
|
|
return new ResultEntity<PageInfo<SysCaseQuestion>>(pageInfo);
|
|
|
|
return new ResultEntity<PageInfo<SysCaseQuestion>>(pageInfo);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -105,11 +107,14 @@ public class CaseController {
|
|
|
|
@AnonymousAccess
|
|
|
|
@AnonymousAccess
|
|
|
|
@ApiOperation("案例题页面查询/有重复")
|
|
|
|
@ApiOperation("案例题页面查询/有重复")
|
|
|
|
@PostMapping("selectCaseByConditionsByBind")
|
|
|
|
@PostMapping("selectCaseByConditionsByBind")
|
|
|
|
public ResultEntity<PageInfo<SysCaseQuestion>> selectCaseByConditions(@RequestParam Integer index,
|
|
|
|
public ResultEntity<PageInfo<SysCaseQuestion>> selectCaseByConditionsByBind(@RequestParam Integer index,
|
|
|
|
@RequestParam Integer size,
|
|
|
|
@RequestParam Integer size,
|
|
|
|
@RequestParam(required = false) String title) {
|
|
|
|
@RequestParam(required = false) String title,
|
|
|
|
|
|
|
|
@RequestParam(required = false) String oneId,
|
|
|
|
|
|
|
|
@RequestParam(required = false) String twoId,
|
|
|
|
|
|
|
|
@RequestParam(required = false) String threeId) {
|
|
|
|
PageHelper.startPage(index, size);
|
|
|
|
PageHelper.startPage(index, size);
|
|
|
|
List<SysCaseQuestion> list = caseQuestionMapper.selectCaseByConditionsByBind(title);
|
|
|
|
List<SysCaseQuestion> list = caseQuestionMapper.selectCaseByConditionsByBind(title, oneId, twoId, threeId);
|
|
|
|
PageInfo pageInfo = new PageInfo<SysCaseQuestion>(list);
|
|
|
|
PageInfo pageInfo = new PageInfo<SysCaseQuestion>(list);
|
|
|
|
return new ResultEntity<PageInfo<SysCaseQuestion>>(pageInfo);
|
|
|
|
return new ResultEntity<PageInfo<SysCaseQuestion>>(pageInfo);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -132,7 +137,7 @@ public class CaseController {
|
|
|
|
sysCaseQuestion.setTwoId(sysTopicAndCourse.getTwoId());
|
|
|
|
sysCaseQuestion.setTwoId(sysTopicAndCourse.getTwoId());
|
|
|
|
sysCaseQuestion.setTwoName(sysTopicAndCourse.getTwoName());
|
|
|
|
sysCaseQuestion.setTwoName(sysTopicAndCourse.getTwoName());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (StringUtils.isNotBlank(sysCaseQuestion.getThreeId())) {
|
|
|
|
if (StringUtils.isNotBlank(sysTopicAndCourse.getThreeId())) {
|
|
|
|
sysCaseQuestion.setThreeName(sysTopicAndCourse.getThreeName());
|
|
|
|
sysCaseQuestion.setThreeName(sysTopicAndCourse.getThreeName());
|
|
|
|
sysCaseQuestion.setThreeId(sysTopicAndCourse.getThreeId());
|
|
|
|
sysCaseQuestion.setThreeId(sysTopicAndCourse.getThreeId());
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -231,13 +236,13 @@ public class CaseController {
|
|
|
|
@AnonymousAccess
|
|
|
|
@AnonymousAccess
|
|
|
|
@ApiOperation("批量绑定案例题")
|
|
|
|
@ApiOperation("批量绑定案例题")
|
|
|
|
@PostMapping("batchBindCase")
|
|
|
|
@PostMapping("batchBindCase")
|
|
|
|
public ResultEntity<String> batchBindCase(@ApiParam("传全部参数")@RequestBody List<SysTopicAndCourse> sysTopicAndCourse) {
|
|
|
|
public ResultEntity<String> batchBindCase(@ApiParam("传全部参数") @RequestBody List<SysTopicAndCourse> sysTopicAndCourse) {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
topicAndCourseMapper.batchInsert(sysTopicAndCourse);
|
|
|
|
topicAndCourseMapper.batchInsert(sysTopicAndCourse);
|
|
|
|
} catch (Exception e) {
|
|
|
|
} catch (Exception e) {
|
|
|
|
e.printStackTrace();
|
|
|
|
e.printStackTrace();
|
|
|
|
return new ResultEntity<>(HttpStatus.INTERNAL_SERVER_ERROR,"绑定失败,请联系管理员");
|
|
|
|
return new ResultEntity<>(HttpStatus.INTERNAL_SERVER_ERROR, "绑定失败,请联系管理员");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return new ResultEntity<>(HttpStatus.OK,"绑定成功!");
|
|
|
|
return new ResultEntity<>(HttpStatus.OK, "绑定成功!");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|