whb 8 months ago
commit cb0adc0ab6

@ -115,9 +115,10 @@ public class CaseApi {
@ApiOperation("案例题详细内容展示") @ApiOperation("案例题详细内容展示")
@PostMapping("selectCaseDetails") @PostMapping("selectCaseDetails")
public SysCaseQuestion selectCaseByConditionsByID(@RequestParam String caseId, public SysCaseQuestion selectCaseByConditionsByID(@RequestParam String caseId,
@RequestParam String oneId) { @RequestParam String systemOwner) {
SysOneCatalog sysOneCatalogs = getSysOneCatalogs(systemOwner);
SysTopicAndCourseExample example = new SysTopicAndCourseExample(); SysTopicAndCourseExample example = new SysTopicAndCourseExample();
example.createCriteria().andOneIdEqualTo(oneId).andTopicIdEqualTo(caseId); example.createCriteria().andOneIdEqualTo(sysOneCatalogs.getOneId()).andTopicIdEqualTo(caseId);
List<SysTopicAndCourse> sysTopicAndCourses = topicAndCourseMapper.selectByExample(example); List<SysTopicAndCourse> sysTopicAndCourses = topicAndCourseMapper.selectByExample(example);
if (sysTopicAndCourses != null && !sysTopicAndCourses.isEmpty()) { if (sysTopicAndCourses != null && !sysTopicAndCourses.isEmpty()) {
SysTopicAndCourse sysTopicAndCourse = sysTopicAndCourses.get(0); SysTopicAndCourse sysTopicAndCourse = sysTopicAndCourses.get(0);

@ -4,9 +4,7 @@ import cn.hutool.core.util.IdUtil;
import com.sztzjy.resource_center.annotation.AnonymousAccess; import com.sztzjy.resource_center.annotation.AnonymousAccess;
import com.sztzjy.resource_center.config.Constant; import com.sztzjy.resource_center.config.Constant;
import com.sztzjy.resource_center.entity.*; import com.sztzjy.resource_center.entity.*;
import com.sztzjy.resource_center.mapper.SysOneCatalogMapper; import com.sztzjy.resource_center.mapper.*;
import com.sztzjy.resource_center.mapper.SysThreeCatalogMapper;
import com.sztzjy.resource_center.mapper.SysTwoCatalogMapper;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -15,7 +13,7 @@ import org.springframework.web.bind.annotation.*;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.stream.Collectors;
@RestController @RestController
@Api(tags = "课程方面API") @Api(tags = "课程方面API")
@ -27,6 +25,16 @@ public class CourseApi {
SysOneCatalogMapper oneCatalogMapper; SysOneCatalogMapper oneCatalogMapper;
@Autowired @Autowired
SysThreeCatalogMapper threeCatalogMapper; SysThreeCatalogMapper threeCatalogMapper;
@Autowired
SysTopicAndCourseMapper sysTopicAndCourseMapper;
@Autowired
SysResourceAndCourseMapper sysResourceAndCourseMapper;
@Autowired
SysResourceMapper sysResourceMapper;
@Autowired
SysObjectiveQuestionsMapper sysObjectiveQuestionsMapper;
@Autowired
SysCaseQuestionMapper sysCaseQuestionMapper;
@AnonymousAccess @AnonymousAccess
@ApiOperation("查看二级目录") @ApiOperation("查看二级目录")
@ -115,6 +123,15 @@ public class CourseApi {
return false; return false;
} }
twoCatalogMapper.deleteByPrimaryKey(twoId); twoCatalogMapper.deleteByPrimaryKey(twoId);
//删除资源
SysResourceAndCourseExample example1 = new SysResourceAndCourseExample();
example1.createCriteria().andTwoIdEqualTo(twoId);
sysResourceAndCourseMapper.deleteByExample(example1);
//删除题目
SysTopicAndCourseExample example = new SysTopicAndCourseExample();
example.createCriteria().andTwoIdEqualTo(twoId);
sysTopicAndCourseMapper.deleteByExample(example);
return true; return true;
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
@ -217,6 +234,6 @@ public class CourseApi {
@RequestParam String systemOwner) { @RequestParam String systemOwner) {
SysOneCatalog sysOneCatalogs = getSysOneCatalogs(systemOwner); SysOneCatalog sysOneCatalogs = getSysOneCatalogs(systemOwner);
String oneId = sysOneCatalogs.getOneId(); String oneId = sysOneCatalogs.getOneId();
return threeCatalogMapper.selectNameByCourseID(schoolId,oneId); return threeCatalogMapper.selectNameByCourseID(schoolId, oneId);
} }
} }

@ -490,8 +490,7 @@
<select id="selectObjByType" parameterType="java.lang.String" resultMap="DtoMap"> <select id="selectObjByType" parameterType="java.lang.String" resultMap="DtoMap">
SELECT s.objective_id, s.content, sc.two_name, three_name SELECT s.objective_id, s.content, sc.two_name, three_name
FROM sys_objective_questions s FROM sys_objective_questions s
LEFT JOIN sys_topic_and_course sc JOIN sys_topic_and_course sc on s.objective_id = sc.topic_id
on s.objective_id = sc.topic_id
WHERE s.source in ('管理员', #{schoolId}) WHERE s.source in ('管理员', #{schoolId})
and s.is_delete = FALSE and s.is_delete = FALSE
and s.type = #{type} and s.type = #{type}

Loading…
Cancel
Save