From 06a72178d00b61887a580966c95bc88b1f1e2098 Mon Sep 17 00:00:00 2001 From: xiaoCJ <406612557@qq.com> Date: Wed, 25 Dec 2024 19:17:58 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=9F=A5=E8=AF=A2API?= =?UTF-8?q?=EF=BC=8C=E4=BF=AE=E6=94=B9=E6=A1=88=E4=BE=8B=E9=A2=98=E5=88=A0?= =?UTF-8?q?=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/CaseController.java | 7 +++++-- .../controller/api/CaseApi.java | 7 ++++++- .../entity/SysCaseQuestionStepWithBLOBs.java | 12 +++++++++++- .../mapper/SysCaseQuestionStepMapper.java | 4 ++++ .../mapper/SysCaseQuestionStepMapper.xml | 19 +++++++++++++++++++ 5 files changed, 45 insertions(+), 4 deletions(-) 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