|
|
@ -63,12 +63,8 @@ public class CaseController {
|
|
|
|
if (!sysCaseQuestions.isEmpty()) {
|
|
|
|
if (!sysCaseQuestions.isEmpty()) {
|
|
|
|
return new ResultEntity<>(HttpStatus.BAD_REQUEST, "案例名称不能重复!");
|
|
|
|
return new ResultEntity<>(HttpStatus.BAD_REQUEST, "案例名称不能重复!");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
String uuid = IdUtil.randomUUID();
|
|
|
|
String uuid = IdUtil.randomUUID();
|
|
|
|
sysCaseQuestion.setCaseId(uuid);
|
|
|
|
|
|
|
|
sysCaseQuestion.setCreateTime(new Date());
|
|
|
|
|
|
|
|
sysCaseQuestion.setUnmountStatus(false);
|
|
|
|
|
|
|
|
caseQuestionMapper.insert(sysCaseQuestion);
|
|
|
|
|
|
|
|
//新增绑定关系
|
|
|
|
//新增绑定关系
|
|
|
|
SysTopicAndCourse sysTopicAndCourse = new SysTopicAndCourse();
|
|
|
|
SysTopicAndCourse sysTopicAndCourse = new SysTopicAndCourse();
|
|
|
|
sysTopicAndCourse.setId(IdUtil.randomUUID());
|
|
|
|
sysTopicAndCourse.setId(IdUtil.randomUUID());
|
|
|
@ -85,6 +81,10 @@ public class CaseController {
|
|
|
|
sysTopicAndCourse.setThreeName(sysCaseQuestion.getThreeName());
|
|
|
|
sysTopicAndCourse.setThreeName(sysCaseQuestion.getThreeName());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
topicAndCourseMapper.insert(sysTopicAndCourse);
|
|
|
|
topicAndCourseMapper.insert(sysTopicAndCourse);
|
|
|
|
|
|
|
|
sysCaseQuestion.setCaseId(uuid);
|
|
|
|
|
|
|
|
sysCaseQuestion.setCreateTime(new Date());
|
|
|
|
|
|
|
|
sysCaseQuestion.setUnmountStatus(false);
|
|
|
|
|
|
|
|
caseQuestionMapper.insert(sysCaseQuestion);
|
|
|
|
return new ResultEntity<>(HttpStatus.OK, "新增成功!");
|
|
|
|
return new ResultEntity<>(HttpStatus.OK, "新增成功!");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -122,11 +122,16 @@ public class CaseController {
|
|
|
|
@AnonymousAccess
|
|
|
|
@AnonymousAccess
|
|
|
|
@ApiOperation("案例题详细内容展示")
|
|
|
|
@ApiOperation("案例题详细内容展示")
|
|
|
|
@PostMapping("selectCaseByConditionsByID")
|
|
|
|
@PostMapping("selectCaseByConditionsByID")
|
|
|
|
public ResultEntity<SysCaseQuestion> selectCaseByConditionsByID(@RequestParam String caseId) {
|
|
|
|
public ResultEntity<SysCaseQuestion> selectCaseByConditionsByID(@RequestParam String caseId,
|
|
|
|
|
|
|
|
@RequestParam(required = false) String oneId) {
|
|
|
|
SysCaseQuestion sysCaseQuestion = caseQuestionMapper.selectByPrimaryKey(caseId);
|
|
|
|
SysCaseQuestion sysCaseQuestion = caseQuestionMapper.selectByPrimaryKey(caseId);
|
|
|
|
|
|
|
|
|
|
|
|
SysTopicAndCourseExample example = new SysTopicAndCourseExample();
|
|
|
|
SysTopicAndCourseExample example = new SysTopicAndCourseExample();
|
|
|
|
example.createCriteria().andTopicIdEqualTo(caseId);
|
|
|
|
SysTopicAndCourseExample.Criteria criteria = example.createCriteria();
|
|
|
|
|
|
|
|
criteria.andTopicIdEqualTo(caseId);
|
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(oneId)) {
|
|
|
|
|
|
|
|
criteria.andOneIdEqualTo(oneId);
|
|
|
|
|
|
|
|
}
|
|
|
|
List<SysTopicAndCourse> topicAndCourseList = topicAndCourseMapper.selectByExample(example);
|
|
|
|
List<SysTopicAndCourse> topicAndCourseList = topicAndCourseMapper.selectByExample(example);
|
|
|
|
if (!topicAndCourseList.isEmpty()) {
|
|
|
|
if (!topicAndCourseList.isEmpty()) {
|
|
|
|
SysTopicAndCourse sysTopicAndCourse = topicAndCourseList.get(0);
|
|
|
|
SysTopicAndCourse sysTopicAndCourse = topicAndCourseList.get(0);
|
|
|
@ -168,6 +173,18 @@ public class CaseController {
|
|
|
|
sysTopicAndCourse.setTwoName(sysCaseQuestion.getTwoName());
|
|
|
|
sysTopicAndCourse.setTwoName(sysCaseQuestion.getTwoName());
|
|
|
|
sysTopicAndCourse.setThreeName(sysCaseQuestion.getThreeName());
|
|
|
|
sysTopicAndCourse.setThreeName(sysCaseQuestion.getThreeName());
|
|
|
|
topicAndCourseMapper.updateByPrimaryKeySelective(sysTopicAndCourse);
|
|
|
|
topicAndCourseMapper.updateByPrimaryKeySelective(sysTopicAndCourse);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
SysTopicAndCourse sysTopicAndCourse = new SysTopicAndCourse();
|
|
|
|
|
|
|
|
sysTopicAndCourse.setId(IdUtil.randomUUID());
|
|
|
|
|
|
|
|
sysTopicAndCourse.setTopicId(sysCaseQuestion.getCaseId());
|
|
|
|
|
|
|
|
sysTopicAndCourse.setOneId(sysCaseQuestion.getOneId());
|
|
|
|
|
|
|
|
sysTopicAndCourse.setOneName(sysCaseQuestion.getOneName());
|
|
|
|
|
|
|
|
sysTopicAndCourse.setTwoId(sysCaseQuestion.getTwoId());
|
|
|
|
|
|
|
|
sysTopicAndCourse.setThreeId(sysCaseQuestion.getThreeId());
|
|
|
|
|
|
|
|
sysTopicAndCourse.setTwoName(sysCaseQuestion.getTwoName());
|
|
|
|
|
|
|
|
sysTopicAndCourse.setThreeName(sysCaseQuestion.getThreeName());
|
|
|
|
|
|
|
|
sysTopicAndCourse.setTopicType("1");
|
|
|
|
|
|
|
|
topicAndCourseMapper.insert(sysTopicAndCourse);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
caseQuestionMapper.updateByPrimaryKeySelective(sysCaseQuestion);
|
|
|
|
caseQuestionMapper.updateByPrimaryKeySelective(sysCaseQuestion);
|
|
|
|
return new ResultEntity<>(HttpStatus.OK, "编辑成功!");
|
|
|
|
return new ResultEntity<>(HttpStatus.OK, "编辑成功!");
|
|
|
|