diff --git a/src/main/java/com/sztzjy/resource_center/controller/CaseController.java b/src/main/java/com/sztzjy/resource_center/controller/CaseController.java index e9f90d2..4a88969 100644 --- a/src/main/java/com/sztzjy/resource_center/controller/CaseController.java +++ b/src/main/java/com/sztzjy/resource_center/controller/CaseController.java @@ -201,13 +201,16 @@ public class CaseController { @PostMapping("deleteCase") public ResultEntity deleteCase(@RequestBody SysCaseQuestion sysCaseQuestion, @ApiParam("哪个用的掉的请求,传管理员/学校ID") @RequestParam String source) { + if (sysCaseQuestion.getOneId()==null&& sysCaseQuestion.getTwoId()==null&&sysCaseQuestion.getThreeId()==null){ + sysCaseQuestion.setUnmountStatus(true); + caseQuestionMapper.updateByPrimaryKeySelective(sysCaseQuestion); + return new ResultEntity<>(HttpStatus.OK, "删除成功!"); + } List sysTopicAndCourses = getSysTopicAndCourses(sysCaseQuestion.getCaseId(), sysCaseQuestion.getOneId()); if (!sysTopicAndCourses.isEmpty()) { return new ResultEntity<>(HttpStatus.BAD_REQUEST, "无法删除!该案例题正在被使用!"); } else { if ("管理员".equals(source) || source.equals(sysCaseQuestion.getSource())) { - topicAndCourseMapper.deleteByPrimaryKey(sysTopicAndCourses.get(0).getId()); - sysCaseQuestion.setUnmountStatus(true); caseQuestionMapper.updateByPrimaryKeySelective(sysCaseQuestion); return new ResultEntity<>(HttpStatus.OK, "删除成功!"); diff --git a/src/main/java/com/sztzjy/resource_center/controller/api/CaseApi.java b/src/main/java/com/sztzjy/resource_center/controller/api/CaseApi.java index 07d670e..804ca90 100644 --- a/src/main/java/com/sztzjy/resource_center/controller/api/CaseApi.java +++ b/src/main/java/com/sztzjy/resource_center/controller/api/CaseApi.java @@ -321,7 +321,12 @@ public class CaseApi { return caseQuestionStepMapper.selectCaseStepListBatchByIdListAndSort(threeId); } - + @PostMapping("selectCaseStepListBatchByIdListAndSortss") + @ApiOperation("查询案例题步骤并排序") + @AnonymousAccess + public List selectCaseStepListBatchByIdListAndSortss(@RequestBody List list) { + return caseQuestionStepMapper.selectCaseStepListBatchByIdListAndSortss(list); + } /** * 根据章节IdList查询案例题 * 方法名:selectCaseByChapterIdList diff --git a/src/main/java/com/sztzjy/resource_center/entity/SysCaseQuestionStepWithBLOBs.java b/src/main/java/com/sztzjy/resource_center/entity/SysCaseQuestionStepWithBLOBs.java index c171843..942959b 100644 --- a/src/main/java/com/sztzjy/resource_center/entity/SysCaseQuestionStepWithBLOBs.java +++ b/src/main/java/com/sztzjy/resource_center/entity/SysCaseQuestionStepWithBLOBs.java @@ -1,8 +1,8 @@ package com.sztzjy.resource_center.entity; import io.swagger.annotations.ApiModelProperty; + /** - * * @author xcj * sys_case_question_steps */ @@ -34,6 +34,16 @@ public class SysCaseQuestionStepWithBLOBs extends SysCaseQuestionStep { @ApiModelProperty("练习答案原始数据") private String practiceAnswerOriginal; + public String threeId; + + public String getThreeId() { + return threeId; + } + + public void setThreeId(String threeId) { + this.threeId = threeId; + } + public String getTitle() { return title; } diff --git a/src/main/java/com/sztzjy/resource_center/mapper/SysCaseQuestionStepMapper.java b/src/main/java/com/sztzjy/resource_center/mapper/SysCaseQuestionStepMapper.java index 69b44c5..98717fd 100644 --- a/src/main/java/com/sztzjy/resource_center/mapper/SysCaseQuestionStepMapper.java +++ b/src/main/java/com/sztzjy/resource_center/mapper/SysCaseQuestionStepMapper.java @@ -4,10 +4,13 @@ import com.sztzjy.resource_center.entity.SysCaseQuestionStep; import com.sztzjy.resource_center.entity.SysCaseQuestionStepExample; import com.sztzjy.resource_center.entity.SysCaseQuestionStepWithBLOBs; import java.util.List; +import java.util.Map; import com.sztzjy.resource_center.entity.dto.TrainingDto; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import org.geolatte.geom.M; + @Mapper public interface SysCaseQuestionStepMapper { long countByExample(SysCaseQuestionStepExample example); @@ -47,4 +50,5 @@ public interface SysCaseQuestionStepMapper { List getCaseStepByIds(@Param("ids") List ids); List selectCaseStepListBatchByIdListAndSort(@Param("threeId") String threeId); + List selectCaseStepListBatchByIdListAndSortss(@Param("list") List list); } \ No newline at end of file diff --git a/src/main/resources/mapper/SysCaseQuestionStepMapper.xml b/src/main/resources/mapper/SysCaseQuestionStepMapper.xml index 71939cc..00f408a 100644 --- a/src/main/resources/mapper/SysCaseQuestionStepMapper.xml +++ b/src/main/resources/mapper/SysCaseQuestionStepMapper.xml @@ -18,6 +18,8 @@ + + @@ -433,6 +435,7 @@ GROUP BY sq.title, s3.three_name,sqs.case_id; + + + + + \ No newline at end of file