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 555df45..437e070 100644 --- a/src/main/java/com/sztzjy/resource_center/controller/CaseController.java +++ b/src/main/java/com/sztzjy/resource_center/controller/CaseController.java @@ -119,6 +119,24 @@ public class CaseController { @PostMapping("selectCaseByConditionsByID") public ResultEntity selectCaseByConditionsByID(@RequestParam String caseId) { SysCaseQuestion sysCaseQuestion = caseQuestionMapper.selectByPrimaryKey(caseId); + + SysTopicAndCourseExample example = new SysTopicAndCourseExample(); + example.createCriteria().andTopicIdEqualTo(caseId); + List topicAndCourseList = topicAndCourseMapper.selectByExample(example); + if (!topicAndCourseList.isEmpty()) { + SysTopicAndCourse sysTopicAndCourse = topicAndCourseList.get(0); + sysCaseQuestion.setOneId(sysTopicAndCourse.getOneId()); + sysCaseQuestion.setOneName(sysTopicAndCourse.getOneName()); + + if (StringUtils.isNotBlank(sysTopicAndCourse.getTwoId())) { + sysCaseQuestion.setTwoId(sysTopicAndCourse.getTwoId()); + sysCaseQuestion.setTwoName(sysTopicAndCourse.getTwoName()); + } + if (StringUtils.isNotBlank(sysCaseQuestion.getThreeId())) { + sysCaseQuestion.setThreeName(sysTopicAndCourse.getThreeName()); + sysCaseQuestion.setThreeId(sysTopicAndCourse.getThreeId()); + } + } return new ResultEntity(sysCaseQuestion); } @@ -130,25 +148,25 @@ public class CaseController { public ResultEntity updateCase(@RequestBody SysCaseQuestion sysCaseQuestion, @ApiParam("谁调的请求,传管理员/学校ID") @RequestParam String source) { List sysTopicAndCourses = getSysTopicAndCourses(sysCaseQuestion.getCaseId(), sysCaseQuestion.getOneId()); - if (!sysTopicAndCourses.isEmpty()) { - return new ResultEntity<>(HttpStatus.BAD_REQUEST, "该案例题正在被使用!"); - } else { - //todo 管理员任意修改,老师只能改自己的 - if ("管理员".equals(source) || source.equals(sysCaseQuestion.getSource())) { - if (!sysTopicAndCourses.isEmpty()) { - SysTopicAndCourse sysTopicAndCourse = sysTopicAndCourses.get(0); - sysTopicAndCourse.setTwoId(sysCaseQuestion.getTwoId()); - sysTopicAndCourse.setThreeId(sysCaseQuestion.getThreeId()); - sysTopicAndCourse.setTwoName(sysCaseQuestion.getTwoName()); - sysTopicAndCourse.setThreeName(sysCaseQuestion.getThreeName()); - topicAndCourseMapper.updateByPrimaryKeySelective(sysTopicAndCourse); - } - caseQuestionMapper.updateByPrimaryKeySelective(sysCaseQuestion); - return new ResultEntity<>(HttpStatus.OK, "编辑成功!"); - } else { - return new ResultEntity<>(HttpStatus.BAD_REQUEST, "权限不足!"); +// if (!sysTopicAndCourses.isEmpty()) { +// return new ResultEntity<>(HttpStatus.BAD_REQUEST, "该案例题正在被使用!"); +// } else { + //todo 管理员任意修改,老师只能改自己的 + if ("管理员".equals(source) || source.equals(sysCaseQuestion.getSource())) { + if (!sysTopicAndCourses.isEmpty()) { + SysTopicAndCourse sysTopicAndCourse = sysTopicAndCourses.get(0); + sysTopicAndCourse.setTwoId(sysCaseQuestion.getTwoId()); + sysTopicAndCourse.setThreeId(sysCaseQuestion.getThreeId()); + sysTopicAndCourse.setTwoName(sysCaseQuestion.getTwoName()); + sysTopicAndCourse.setThreeName(sysCaseQuestion.getThreeName()); + topicAndCourseMapper.updateByPrimaryKeySelective(sysTopicAndCourse); } + caseQuestionMapper.updateByPrimaryKeySelective(sysCaseQuestion); + return new ResultEntity<>(HttpStatus.OK, "编辑成功!"); + } else { + return new ResultEntity<>(HttpStatus.BAD_REQUEST, "权限不足!"); } +// } } @@ -159,18 +177,18 @@ public class CaseController { public ResultEntity deleteCase(@RequestBody SysCaseQuestion sysCaseQuestion, @ApiParam("哪个用的掉的请求,传管理员/学校ID") @RequestParam String source) { List sysTopicAndCourses = getSysTopicAndCourses(sysCaseQuestion.getCaseId(), sysCaseQuestion.getOneId()); - if (!sysTopicAndCourses.isEmpty()) { - return new ResultEntity<>(HttpStatus.BAD_REQUEST, "无法删除!该案例题正在被使用!"); +// if (!sysTopicAndCourses.isEmpty()) { +// return new ResultEntity<>(HttpStatus.BAD_REQUEST, "无法删除!该案例题正在被使用!"); +// } else { + //todo 管理员任意删除 老师只能删除自己上传的 + if ("管理员".equals(source) || source.equals(sysCaseQuestion.getSource())) { + topicAndCourseMapper.deleteByPrimaryKey(sysTopicAndCourses.get(0).getId()); + caseQuestionMapper.deleteByPrimaryKey(sysCaseQuestion.getCaseId()); + return new ResultEntity<>(HttpStatus.OK, "删除成功!"); } else { - //todo 管理员任意删除 老师只能删除自己上传的 - if ("管理员".equals(source) || source.equals(sysCaseQuestion.getSource())) { - topicAndCourseMapper.deleteByPrimaryKey(sysTopicAndCourses.get(0).getId()); - caseQuestionMapper.deleteByPrimaryKey(sysCaseQuestion.getCaseId()); - return new ResultEntity<>(HttpStatus.OK, "删除成功!"); - } else { - return new ResultEntity<>(HttpStatus.BAD_REQUEST, "权限不足!"); - } + return new ResultEntity<>(HttpStatus.BAD_REQUEST, "权限不足!"); } +// } } private List getSysTopicAndCourses(String caseId, String oneId) { diff --git a/src/main/java/com/sztzjy/resource_center/controller/CaseStepController.java b/src/main/java/com/sztzjy/resource_center/controller/CaseStepController.java index 2636809..f078878 100644 --- a/src/main/java/com/sztzjy/resource_center/controller/CaseStepController.java +++ b/src/main/java/com/sztzjy/resource_center/controller/CaseStepController.java @@ -56,9 +56,10 @@ public class CaseStepController { public ResultEntity updateCase(@RequestBody SysCaseQuestionStepWithBLOBs caseQuestionStepWithBLOBs, @ApiParam("谁调的请求,传管理员/学校ID") @RequestParam String source) { List sysTopicAndCourses = getSysTopicAndCourses(caseQuestionStepWithBLOBs.getCaseId()); - if (!sysTopicAndCourses.isEmpty()) { - return new ResultEntity<>(HttpStatus.BAD_REQUEST, "该案例题正在被使用!"); - } else { +// if (!sysTopicAndCourses.isEmpty()) { +// return new ResultEntity<>(HttpStatus.BAD_REQUEST, "该案例题正在被使用!"); +// } +// else { //todo 管理员任意修改,老师只能改自己的 SysCaseQuestion sysCaseQuestion = sysCaseQuestionMapper.selectByPrimaryKey(caseQuestionStepWithBLOBs.getCaseId()); if ("管理员".equals(source) || source.equals(sysCaseQuestion.getSource())) { @@ -67,7 +68,7 @@ public class CaseStepController { } else { return new ResultEntity<>(HttpStatus.BAD_REQUEST, "权限不足!"); } - } +// } } diff --git a/src/main/java/com/sztzjy/resource_center/controller/CourseConfigController.java b/src/main/java/com/sztzjy/resource_center/controller/CourseConfigController.java index dc52588..974f601 100644 --- a/src/main/java/com/sztzjy/resource_center/controller/CourseConfigController.java +++ b/src/main/java/com/sztzjy/resource_center/controller/CourseConfigController.java @@ -67,7 +67,7 @@ public class CourseConfigController { //判断文件type //todo 格式可能不够全 if (extension.equals(".pdf") || extension.equals(".ppt") || extension.equals(".pptx") || extension.equals(".xlsx") || extension.equals(".xls") - || extension.equals(".doc") || extension.equals(".docx")) { + || extension.equals(".doc") || extension.equals(".docx")){ sysResource.setResourceType("课件"); } else if (extension.equals(".mp4") || extension.equals(".wmv") || extension.equals(".avi")) { sysResource.setResourceType("视频"); diff --git a/src/main/java/com/sztzjy/resource_center/controller/CourseManageController.java b/src/main/java/com/sztzjy/resource_center/controller/CourseManageController.java index 18a3aa3..25291b7 100644 --- a/src/main/java/com/sztzjy/resource_center/controller/CourseManageController.java +++ b/src/main/java/com/sztzjy/resource_center/controller/CourseManageController.java @@ -6,10 +6,7 @@ import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import com.sztzjy.resource_center.annotation.AnonymousAccess; import com.sztzjy.resource_center.entity.*; -import com.sztzjy.resource_center.mapper.SysOneCatalogMapper; -import com.sztzjy.resource_center.mapper.SysResourceAndCourseMapper; -import com.sztzjy.resource_center.mapper.SysThreeCatalogMapper; -import com.sztzjy.resource_center.mapper.SysTwoCatalogMapper; +import com.sztzjy.resource_center.mapper.*; import com.sztzjy.resource_center.util.ResultEntity; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -39,6 +36,9 @@ public class CourseManageController { private SysThreeCatalogMapper sysThreeCatalogMapper; @Autowired private SysResourceAndCourseMapper sysResourceAndCourseMapper; + @Autowired + private SysTopicAndCourseMapper sysTopicAndCourseMapper; + @AnonymousAccess @ApiOperation("新增课程") @@ -67,9 +67,14 @@ public class CourseManageController { @AnonymousAccess @ApiOperation("编辑课程/启用停用") @PostMapping("updateSysOneCatalog") - public ResultEntity updateSysOneCatalog(@ApiParam("课程链接必填,课程简介选填") @RequestBody SysOneCatalog sysOneCatalog) { - sysOneCatalogMapper.updateByPrimaryKey(sysOneCatalog); - return new ResultEntity<>(HttpStatus.OK, "编辑成功"); + public ResultEntity updateSysOneCatalog(@ApiParam("课程链接必填,课程简介选填,停用传0") @RequestBody SysOneCatalog sysOneCatalog) { + try { + sysOneCatalogMapper.updateByPrimaryKey(sysOneCatalog); + return new ResultEntity<>(HttpStatus.OK, "编辑成功"); + } catch (Exception e) { + e.printStackTrace(); + return new ResultEntity<>(HttpStatus.INTERNAL_SERVER_ERROR, "编辑失败,请联系管理员"); + } } @@ -93,6 +98,11 @@ public class CourseManageController { SysResourceAndCourseExample example = new SysResourceAndCourseExample(); example.createCriteria().andOneIdEqualTo(oneId); sysResourceAndCourseMapper.deleteByExample(example); + + //删除课程题目的绑定关系 + SysTopicAndCourseExample example1 = new SysTopicAndCourseExample(); + example1.createCriteria().andOneIdEqualTo(oneId); + sysTopicAndCourseMapper.deleteByExample(example1); return new ResultEntity<>(HttpStatus.OK, "删除成功"); } diff --git a/src/main/java/com/sztzjy/resource_center/controller/CourseTagManageController.java b/src/main/java/com/sztzjy/resource_center/controller/CourseTagManageController.java index 0700e15..49fb103 100644 --- a/src/main/java/com/sztzjy/resource_center/controller/CourseTagManageController.java +++ b/src/main/java/com/sztzjy/resource_center/controller/CourseTagManageController.java @@ -4,12 +4,8 @@ import cn.hutool.core.util.IdUtil; import com.sztzjy.resource_center.annotation.AnonymousAccess; import com.sztzjy.resource_center.config.security.JwtUser; import com.sztzjy.resource_center.config.security.TokenProvider; -import com.sztzjy.resource_center.entity.SysOneCatalog; -import com.sztzjy.resource_center.entity.SysThreeCatalog; -import com.sztzjy.resource_center.entity.SysTwoCatalog; -import com.sztzjy.resource_center.mapper.SysOneCatalogMapper; -import com.sztzjy.resource_center.mapper.SysThreeCatalogMapper; -import com.sztzjy.resource_center.mapper.SysTwoCatalogMapper; +import com.sztzjy.resource_center.entity.*; +import com.sztzjy.resource_center.mapper.*; import com.sztzjy.resource_center.util.ResultEntity; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -25,6 +21,7 @@ import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; /** * @Author xcj @@ -42,6 +39,11 @@ public class CourseTagManageController { private SysThreeCatalogMapper sysThreeCatalogMapper; @Resource private AuthenticationManagerBuilder authenticationManagerBuilder; + @Autowired + private SysTopicAndCourseMapper sysTopicAndCourseMapper; + @Autowired + private SysResourceAndCourseMapper sysResourceAndCourseMapper; + @AnonymousAccess @ApiOperation("添加二级目录") @@ -89,10 +91,35 @@ public class CourseTagManageController { SysTwoCatalog sysTwoCatalog = sysTwoCatalogMapper.selectByPrimaryKey(id); sysTwoCatalog.setTwoName(name); sysTwoCatalogMapper.updateByPrimaryKey(sysTwoCatalog); + + SysResourceAndCourseExample example = new SysResourceAndCourseExample(); + example.createCriteria().andTwoIdEqualTo(id); + List sysResourceAndCourses = sysResourceAndCourseMapper.selectByExample(example); + List ids = sysResourceAndCourses.stream().map(SysResourceAndCourse::getId).collect(Collectors.toList()); + sysResourceAndCourseMapper.batchUpdateTwoName(ids, name); + + SysTopicAndCourseExample example1 =new SysTopicAndCourseExample(); + example1.createCriteria().andTwoIdEqualTo(id); + List sysTopicAndCourses = sysTopicAndCourseMapper.selectByExample(example1); + List collect = sysTopicAndCourses.stream().map(SysTopicAndCourse::getId).collect(Collectors.toList()); + sysTopicAndCourseMapper.batchUpdateTwoName(collect,name); } else { + SysThreeCatalog sysThreeCatalog = sysThreeCatalogMapper.selectByPrimaryKey(id); sysThreeCatalog.setThreeName(name); sysThreeCatalogMapper.updateByPrimaryKey(sysThreeCatalog); + + SysResourceAndCourseExample example = new SysResourceAndCourseExample(); + example.createCriteria().andThreeIdEqualTo(id); + List sysResourceAndCourses = sysResourceAndCourseMapper.selectByExample(example); + List ids = sysResourceAndCourses.stream().map(SysResourceAndCourse::getId).collect(Collectors.toList()); + sysResourceAndCourseMapper.batchUpdateThreeName(ids, name); + + SysTopicAndCourseExample example1 =new SysTopicAndCourseExample(); + example1.createCriteria().andThreeIdEqualTo(id); + List sysTopicAndCourses = sysTopicAndCourseMapper.selectByExample(example1); + List collect = sysTopicAndCourses.stream().map(SysTopicAndCourse::getId).collect(Collectors.toList()); + sysTopicAndCourseMapper.batchUpdateThreeName(collect,name); } return new ResultEntity<>(HttpStatus.OK, "修改成功"); } @@ -103,10 +130,34 @@ public class CourseTagManageController { @PostMapping("deleteTwoAndThreeCatalog") public ResultEntity deleteTwoAndThreeCatalog(@ApiParam("二级目录传2/三级传3") @RequestParam int type, @RequestParam String id) { - if (type == 2) { - sysTwoCatalogMapper.deleteByPrimaryKey(id); - } else { - sysThreeCatalogMapper.deleteByPrimaryKey(id); + try { + if (type == 2) { + sysTwoCatalogMapper.deleteByPrimaryKey(id); + //删除资源 + SysResourceAndCourseExample example1 = new SysResourceAndCourseExample(); + example1.createCriteria().andTwoIdEqualTo(id); + sysResourceAndCourseMapper.deleteByExample(example1); + + //删除题目 + SysTopicAndCourseExample example = new SysTopicAndCourseExample(); + example.createCriteria().andTwoIdEqualTo(id); + sysTopicAndCourseMapper.deleteByExample(example); + } else { + sysThreeCatalogMapper.deleteByPrimaryKey(id); + //删除资源 + SysResourceAndCourseExample example1 = new SysResourceAndCourseExample(); + example1.createCriteria().andThreeIdEqualTo(id); + sysResourceAndCourseMapper.deleteByExample(example1); + + //删除题目 + SysTopicAndCourseExample example = new SysTopicAndCourseExample(); + example.createCriteria().andThreeIdEqualTo(id); + sysTopicAndCourseMapper.deleteByExample(example); + sysThreeCatalogMapper.deleteByPrimaryKey(id); + } + } catch (Exception e) { + e.printStackTrace(); + return new ResultEntity<>(HttpStatus.INTERNAL_SERVER_ERROR,"删除失败,请联系管理员"); } return new ResultEntity<>(HttpStatus.OK, "删除成功"); } @@ -153,7 +204,7 @@ public class CourseTagManageController { @AnonymousAccess @ApiOperation("二级目录重新排序") @PostMapping("setTwoCatalogueRank") - public ResultEntity setTwoCatalogueRank(@ApiParam("一级ID(可为空),二级ID和sort必传")@RequestBody List sysTwoCatalogs) { + public ResultEntity setTwoCatalogueRank(@ApiParam("一级ID(可为空),二级ID和sort必传") @RequestBody List sysTwoCatalogs) { for (SysTwoCatalog sysTwoCatalog : sysTwoCatalogs) { if (StringUtils.isBlank(sysTwoCatalog.getTwoId()) || sysTwoCatalog.getSort() == null) { @@ -168,7 +219,7 @@ public class CourseTagManageController { @AnonymousAccess @ApiOperation("三级目录重新排序") @PostMapping("setThreeCatalogueRank") - public ResultEntity setThreeCatalogueRank(@ApiParam("需要一级(可为空)二级(可为空),三级ID和sort必传")@RequestBody List sysThreeCatalogs) { + public ResultEntity setThreeCatalogueRank(@ApiParam("需要一级(可为空)二级(可为空),三级ID和sort必传") @RequestBody List sysThreeCatalogs) { for (SysThreeCatalog sysThreeCatalog : sysThreeCatalogs) { if (StringUtils.isBlank(sysThreeCatalog.getThreeId()) || sysThreeCatalog.getSort() == null) { return new ResultEntity<>(HttpStatus.BAD_REQUEST, "更新失败,缺少必须的数据!"); diff --git a/src/main/java/com/sztzjy/resource_center/controller/LearningResourceController.java b/src/main/java/com/sztzjy/resource_center/controller/LearningResourceController.java index e125965..a40d6e3 100644 --- a/src/main/java/com/sztzjy/resource_center/controller/LearningResourceController.java +++ b/src/main/java/com/sztzjy/resource_center/controller/LearningResourceController.java @@ -4,7 +4,9 @@ import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import com.sztzjy.resource_center.annotation.AnonymousAccess; import com.sztzjy.resource_center.entity.SysResource; +import com.sztzjy.resource_center.entity.SysResourceAndCourseExample; import com.sztzjy.resource_center.entity.dto.SysResourceDto; +import com.sztzjy.resource_center.mapper.SysResourceAndCourseMapper; import com.sztzjy.resource_center.mapper.SysResourceMapper; import com.sztzjy.resource_center.util.ResultEntity; import com.sztzjy.resource_center.util.file.IFileUtil; @@ -38,7 +40,8 @@ public class LearningResourceController { private String filePath; @Autowired private IFileUtil fileUtil; - + @Autowired + private SysResourceAndCourseMapper sysResourceAndCourseMapper; @AnonymousAccess @ApiOperation("学习资源/资源列表展示/有重复数据") @@ -61,6 +64,9 @@ public class LearningResourceController { @PostMapping("deleteResource") public ResultEntity deleteResource(@ApiParam("来源是学校的不允许传过来") @RequestParam String id) { sysResourceMapper.deleteByPrimaryKey(id); + SysResourceAndCourseExample example = new SysResourceAndCourseExample(); + example.createCriteria().andResourceIdEqualTo(id); + sysResourceAndCourseMapper.deleteByExample(example); return new ResultEntity<>(HttpStatus.OK, "删除成功!"); } diff --git a/src/main/java/com/sztzjy/resource_center/controller/TopicResourceController.java b/src/main/java/com/sztzjy/resource_center/controller/TopicResourceController.java index e8fe7a6..3337522 100644 --- a/src/main/java/com/sztzjy/resource_center/controller/TopicResourceController.java +++ b/src/main/java/com/sztzjy/resource_center/controller/TopicResourceController.java @@ -9,8 +9,7 @@ import com.sztzjy.resource_center.entity.SysObjectiveQuestionsExample; import com.sztzjy.resource_center.entity.SysTopicAndCourse; import com.sztzjy.resource_center.entity.SysTopicAndCourseExample; import com.sztzjy.resource_center.entity.dto.SysObjectiveQuestionsDto; -import com.sztzjy.resource_center.mapper.SysObjectiveQuestionsMapper; -import com.sztzjy.resource_center.mapper.SysTopicAndCourseMapper; +import com.sztzjy.resource_center.mapper.*; import com.sztzjy.resource_center.util.ResultEntity; import com.sztzjy.resource_center.util.file.IFileUtil; import io.swagger.annotations.Api; @@ -39,7 +38,8 @@ import java.util.*; @RestController @RequestMapping("api/sys/topic/resource") public class TopicResourceController { - + @Autowired + SysOneCatalogMapper oneCatalogMapper; @Autowired private SysObjectiveQuestionsMapper sysObjectiveQuestionMapper; @Autowired @@ -48,7 +48,10 @@ public class TopicResourceController { IFileUtil fileUtil; @Value("${file.path}") private String filePath; - + @Autowired + private SysTwoCatalogMapper sysTwoCatalogMapper; + @Autowired + private SysThreeCatalogMapper sysThreeCatalogMapper; @AnonymousAccess @ApiOperation("新增单个试题") //新增 题干不允许重复 @@ -292,9 +295,17 @@ public class TopicResourceController { //如果是老师增加 则只需要提供课程信息 public ResultEntity insertObjectiveByExcel(MultipartFile file, String source) throws IOException, InvalidFormatException { List objectiveQuestionList = new ArrayList<>(); + List topicAndCourseList = new ArrayList<>(); + Workbook workbook = WorkbookFactory.create(file.getInputStream()); Sheet sheet = workbook.getSheetAt(0); + + //创建三级的ID和名称Map + Map oneIdMap = new HashMap<>(); + Map twoIdMap = new HashMap<>(); + Map threeIdMap = new HashMap<>(); + // 迭代每一行 Iterator iterator = sheet.iterator(); iterator.next(); @@ -312,6 +323,10 @@ public class TopicResourceController { Cell cell7 = row.getCell(7); Cell cell8 = row.getCell(8); Cell cell9 = row.getCell(9); + Cell cell10 = row.getCell(10); + Cell cell11 = row.getCell(11); + Cell cell12 = row.getCell(12); + //判断题的BCDE选项和解析可能为空 if (cell0 == null || cell1 == null || cell2 == null || cell6 == null || cell7 == null || cell9 == null) { return new ResultEntity<>(HttpStatus.BAD_REQUEST, "必填项不能为空"); @@ -323,6 +338,9 @@ public class TopicResourceController { String type = this.getCellValue(cell6);//题型 String answer = this.getCellValue(cell7);//答案 String score = this.getCellValue(cell9);//分值 + String oneName = this.getCellValue(cell10);//一级目录名称 + String twoName = this.getCellValue(cell11);//二级目录名称 + String threeName = this.getCellValue(cell12);//三级目录名称 String c = cell3 != null ? this.getCellValue(cell3) : null; String d = cell4 != null ? this.getCellValue(cell4) : null; String e = cell5 != null ? this.getCellValue(cell5) : null; @@ -330,7 +348,8 @@ public class TopicResourceController { SysObjectiveQuestions obj = new SysObjectiveQuestions(); - obj.setObjectiveId(String.valueOf(UUID.randomUUID())); + String topicId = IdUtil.randomUUID(); + obj.setObjectiveId(topicId); obj.setContent(content); obj.setType(type); obj.setSource(source); @@ -345,7 +364,51 @@ public class TopicResourceController { obj.setCreateTime(new Date()); obj.setIsDelete(false); objectiveQuestionList.add(obj); + + + //判断名称是否被查出来过 + String oneId = oneIdMap.get(oneName); + if (oneId == null) { + oneId = oneCatalogMapper.getIdByName(oneName); + if (oneId == null) { + return new ResultEntity(HttpStatus.INTERNAL_SERVER_ERROR, "导入关联的系统不存在,请在添加后重新导入"); + } + oneIdMap.put(oneName, oneId); + } + + String twoId = twoIdMap.get(twoName); + if (twoId == null) { + twoId = sysTwoCatalogMapper.getIdByName(twoName); + if (twoId == null) { + return new ResultEntity(HttpStatus.INTERNAL_SERVER_ERROR, "导入关联的课程不存在,请在添加后重新导入"); + } + twoIdMap.put(twoName, twoId); + } + + String threeId = threeIdMap.get(threeName); + if (threeId == null) { + threeId = sysThreeCatalogMapper.getIdByName(twoName, threeName); + if (threeId==null){ + return new ResultEntity(HttpStatus.INTERNAL_SERVER_ERROR,"导入关联的章节不存在,请在添加后重新导入"); + } + threeIdMap.put(threeName, threeId); + } + + + SysTopicAndCourse sysTopicAndCourse = new SysTopicAndCourse(); + sysTopicAndCourse.setId(IdUtil.randomUUID()); + sysTopicAndCourse.setTopicId(topicId); + sysTopicAndCourse.setTopicType("0"); + sysTopicAndCourse.setOneName(oneName); + sysTopicAndCourse.setOneId(oneId); + sysTopicAndCourse.setTwoName(twoName); + sysTopicAndCourse.setTwoId(twoId); + sysTopicAndCourse.setThreeId(threeId); + sysTopicAndCourse.setThreeName(threeName); + topicAndCourseList.add(sysTopicAndCourse); } + + sysTopicAndCourseMapper.batchInsert(topicAndCourseList); int result = sysObjectiveQuestionMapper.insertBatch(objectiveQuestionList); if (result > 0) { 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 2ede1a0..43571b3 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 @@ -17,9 +17,7 @@ import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; -import java.util.Date; -import java.util.List; -import java.util.UUID; +import java.util.*; import java.util.stream.Collectors; @RestController @@ -42,6 +40,8 @@ public class CaseApi { @PostMapping("insertCase") public Boolean insertCase(@ApiParam("目前二级三级ID可以为空,来源和题型要传,上架状态传true") @RequestBody SysCaseQuestion sysCaseQuestion) { SysOneCatalog sysOneCatalogs1 = getSysOneCatalogs(sysCaseQuestion.getOneName()); + String oneId = sysOneCatalogs1.getOneId(); + if (("3").equals(sysCaseQuestion.getType())) { return false; } @@ -56,7 +56,7 @@ public class CaseApi { } String title = sysCaseQuestion.getTitle(); SysCaseQuestionExample example = new SysCaseQuestionExample(); - example.createCriteria().andTitleEqualTo(title).andUnmountStatusEqualTo(false).andOneIdEqualTo(sysOneCatalogs1.getOneId()); + example.createCriteria().andTitleEqualTo(title).andUnmountStatusEqualTo(false).andOneIdEqualTo(oneId); List sysCaseQuestions = caseQuestionMapper.selectByExample(example); if (!sysCaseQuestions.isEmpty()) { return false; @@ -72,9 +72,8 @@ public class CaseApi { sysTopicAndCourse.setId(IdUtil.randomUUID()); sysTopicAndCourse.setTopicType("1"); sysTopicAndCourse.setTopicId(uuid); - String oneId = sysOneCatalogs1.getOneId(); sysTopicAndCourse.setOneId(oneId); - sysTopicAndCourse.setOneName(sysCaseQuestion.getOneName()); + sysTopicAndCourse.setOneName(sysOneCatalogs1.getOneName()); if (StringUtils.isNotBlank(sysCaseQuestion.getTwoId())) { sysTopicAndCourse.setTwoId(sysCaseQuestion.getTwoId()); sysTopicAndCourse.setTwoName(sysCaseQuestion.getTwoName()); @@ -383,4 +382,43 @@ public class CaseApi { List trainingDtos = caseQuestionStepMapper.selectTrainingByIds(caseStepIdList); return trainingDtos; } + + //* 单独接口 +//* 获取所有内置案例题步骤信息 + @AnonymousAccess + @ApiOperation("获取所有内置案例题步骤信息") + @PostMapping("selectAllStepBySystemOwner") + public List selectAllStepBySystemOwner(@RequestParam String systemOwner) { + SysOneCatalog sysOneCatalogs = getSysOneCatalogs(systemOwner); + List ids = topicAndCourseMapper.getCaseIdsBySourceIsAdmin(sysOneCatalogs.getOneId()); + return caseQuestionStepMapper.getCaseStepByIds(ids); + } + + + //* 单独接口 + @AnonymousAccess + @ApiOperation("获取三级ID和案例题ID") + @PostMapping("getMapChapterIdAndCaseIdsByCourseIdAndChapterId") + public Map> getMapChapterIdAndCaseIdsByCourseIdAndChapterId(@RequestBody List sysThreeCatalogs, + @RequestParam String systemOwner) { + // 批量查询案例题ID + Map> caseIdMap = new HashMap<>(); + List courseIdList = new ArrayList<>(); + List chapterIdList = new ArrayList<>(); + for (SysThreeCatalog chapter : sysThreeCatalogs) { + courseIdList.add(chapter.getTwoId()); + chapterIdList.add(chapter.getThreeId()); + } + + List> results = topicAndCourseMapper.selectCaseIdByCourseAndChapterIds(courseIdList, chapterIdList); + for (Map result : results) { + String chapterId = (String) result.get("three_id"); + String caseId = (String) result.get("case_id"); + if (!caseIdMap.containsKey(chapterId)) { + caseIdMap.put(chapterId, new ArrayList<>()); + } + caseIdMap.get(chapterId).add(caseId); + } + return caseIdMap; + } } diff --git a/src/main/java/com/sztzjy/resource_center/controller/api/ObjectiveApi.java b/src/main/java/com/sztzjy/resource_center/controller/api/ObjectiveApi.java index de89976..ec9bf56 100644 --- a/src/main/java/com/sztzjy/resource_center/controller/api/ObjectiveApi.java +++ b/src/main/java/com/sztzjy/resource_center/controller/api/ObjectiveApi.java @@ -5,9 +5,7 @@ import com.github.pagehelper.PageInfo; import com.sztzjy.resource_center.annotation.AnonymousAccess; import com.sztzjy.resource_center.entity.*; import com.sztzjy.resource_center.entity.dto.SysObjectiveQuestionsDto; -import com.sztzjy.resource_center.mapper.SysObjectiveQuestionsMapper; -import com.sztzjy.resource_center.mapper.SysOneCatalogMapper; -import com.sztzjy.resource_center.mapper.SysTopicAndCourseMapper; +import com.sztzjy.resource_center.mapper.*; import com.sztzjy.resource_center.util.PageUtil; import com.sztzjy.resource_center.util.file.IFileUtil; import io.swagger.annotations.Api; @@ -19,6 +17,7 @@ import org.apache.poi.ss.usermodel.*; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; +import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; @@ -42,7 +41,10 @@ public class ObjectiveApi { IFileUtil fileUtil; @Value("${file.path}") private String filePath; - + @Autowired + private SysTwoCatalogMapper sysTwoCatalogMapper; + @Autowired + private SysThreeCatalogMapper sysThreeCatalogMapper; private SysOneCatalog getSysOneCatalogs(String systemOwner) { SysOneCatalogExample example = new SysOneCatalogExample(); @@ -252,8 +254,9 @@ public class ObjectiveApi { @AnonymousAccess @ApiOperation("本地excel导入试题") @PostMapping("insertObjectiveByExcel") - private Boolean importTopicByLocal(@RequestParam MultipartFile file, - @RequestParam String schoolId) throws IOException, InvalidFormatException { + @Transactional + Boolean importTopicByLocal(@RequestParam MultipartFile file, + @RequestParam String schoolId) throws IOException, InvalidFormatException { if (file == null) { return false; } @@ -264,9 +267,17 @@ public class ObjectiveApi { //如果是老师增加 则只需要提供课程信息 public Boolean insertObjectiveByExcel(MultipartFile file, String schoolId) throws IOException, InvalidFormatException { List objectiveQuestionList = new ArrayList<>(); + List topicAndCourseList = new ArrayList<>(); + + Workbook workbook = WorkbookFactory.create(file.getInputStream()); Sheet sheet = workbook.getSheetAt(0); + //创建三级的ID和名称Map + Map oneIdMap = new HashMap<>(); + Map twoIdMap = new HashMap<>(); + Map threeIdMap = new HashMap<>(); + // 迭代每一行 Iterator iterator = sheet.iterator(); iterator.next(); @@ -284,6 +295,9 @@ public class ObjectiveApi { Cell cell7 = row.getCell(7); Cell cell8 = row.getCell(8); Cell cell9 = row.getCell(9); + Cell cell10 = row.getCell(10); + Cell cell11 = row.getCell(11); + Cell cell12 = row.getCell(12); //判断题的BCDE选项和解析可能为空 if (cell0 == null || cell1 == null || cell2 == null || cell6 == null || cell7 == null || cell9 == null) { return false; @@ -295,6 +309,9 @@ public class ObjectiveApi { String type = this.getCellValue(cell6);//题型 String answer = this.getCellValue(cell7);//答案 String score = this.getCellValue(cell9);//分值 + String oneName = this.getCellValue(cell10);//一级目录名称 + String twoName = this.getCellValue(cell11);//二级目录名称 + String threeName = this.getCellValue(cell12);//三级目录名称 String c = cell3 != null ? this.getCellValue(cell3) : null; String d = cell4 != null ? this.getCellValue(cell4) : null; String e = cell5 != null ? this.getCellValue(cell5) : null; @@ -302,7 +319,8 @@ public class ObjectiveApi { SysObjectiveQuestions obj = new SysObjectiveQuestions(); - obj.setObjectiveId(String.valueOf(UUID.randomUUID())); + String topicId = IdUtil.randomUUID(); + obj.setObjectiveId(topicId); obj.setContent(content); obj.setType(type); obj.setSource(schoolId); @@ -317,7 +335,40 @@ public class ObjectiveApi { obj.setCreateTime(new Date()); obj.setIsDelete(false); objectiveQuestionList.add(obj); + + //判断名称是否被查出来过 + String oneId = oneIdMap.get(oneName); + if (oneId == null) { + oneId = oneCatalogMapper.getIdByName(oneName); + oneIdMap.put(oneName, oneId); + } + + String twoId = twoIdMap.get(twoName); + if (twoId == null) { + twoId = sysTwoCatalogMapper.getIdByName(twoName); + twoIdMap.put(twoName, twoId); + } + + String threeId = threeIdMap.get(threeName); + if (threeId == null) { + threeId = sysThreeCatalogMapper.getIdByName(threeName,twoName); + threeIdMap.put(threeName, threeId); + } + + + SysTopicAndCourse sysTopicAndCourse = new SysTopicAndCourse(); + sysTopicAndCourse.setId(IdUtil.randomUUID()); + sysTopicAndCourse.setTopicId(topicId); + sysTopicAndCourse.setTopicType("0"); + sysTopicAndCourse.setOneName(oneName); + sysTopicAndCourse.setOneId(oneId); + sysTopicAndCourse.setTwoName(twoName); + sysTopicAndCourse.setTwoId(twoId); + sysTopicAndCourse.setThreeId(threeId); + sysTopicAndCourse.setThreeName(threeName); + topicAndCourseList.add(sysTopicAndCourse); } + sysTopicAndCourseMapper.batchInsert(topicAndCourseList); int result = sysObjectiveQuestionMapper.insertBatch(objectiveQuestionList); if (result > 0) { return true; diff --git a/src/main/java/com/sztzjy/resource_center/controller/api/ResourceApi.java b/src/main/java/com/sztzjy/resource_center/controller/api/ResourceApi.java index ecb7c2a..496f118 100644 --- a/src/main/java/com/sztzjy/resource_center/controller/api/ResourceApi.java +++ b/src/main/java/com/sztzjy/resource_center/controller/api/ResourceApi.java @@ -77,7 +77,8 @@ public class ResourceApi { //判断文件type //todo 格式可能不够全 if (extension.equals(".pdf") || extension.equals(".ppt") || extension.equals(".pptx") || extension.equals(".xlsx") || extension.equals(".xls") - || extension.equals(".doc") || extension.equals(".docx")) { + || extension.equals(".doc") || extension.equals(".docx") + || extension.equals(".txt")) { sysResource.setResourceType("课件"); } else if (extension.equals(".mp4") || extension.equals(".wmv") || extension.equals(".avi")) { sysResource.setResourceType("视频"); @@ -287,6 +288,9 @@ public class ResourceApi { if (!sysResource.getSource().equals(source)) { return new ResultEntity<>(HttpStatus.BAD_REQUEST, "删除失败!"); } + SysResourceAndCourseExample example = new SysResourceAndCourseExample(); + example.createCriteria().andResourceIdEqualTo(id); + sysResourceAndCourseMapper.deleteByExample(example); sysResourceMapper.deleteByPrimaryKey(id); return new ResultEntity<>(HttpStatus.OK, "删除成功!"); } diff --git a/src/main/java/com/sztzjy/resource_center/controller/api/SysKnowledgeSummaryApi.java b/src/main/java/com/sztzjy/resource_center/controller/api/SysKnowledgeSummaryApi.java index ecd0138..4c63633 100644 --- a/src/main/java/com/sztzjy/resource_center/controller/api/SysKnowledgeSummaryApi.java +++ b/src/main/java/com/sztzjy/resource_center/controller/api/SysKnowledgeSummaryApi.java @@ -39,8 +39,8 @@ public class SysKnowledgeSummaryApi { @AnonymousAccess - @ApiOperation("getSysKnowledgeSummary") - @PostMapping("uploadResourceData") + @ApiOperation("获取知识概要") + @PostMapping("getSysKnowledgeSummary") private SysKnowledgeSummary getSysKnowledgeSummary(@RequestParam String schoolId, @RequestParam String systemOwner, @RequestParam String courseId, diff --git a/src/main/java/com/sztzjy/resource_center/entity/SysCaseQuestion.java b/src/main/java/com/sztzjy/resource_center/entity/SysCaseQuestion.java index 159de42..e42a872 100644 --- a/src/main/java/com/sztzjy/resource_center/entity/SysCaseQuestion.java +++ b/src/main/java/com/sztzjy/resource_center/entity/SysCaseQuestion.java @@ -28,16 +28,19 @@ public class SysCaseQuestion { @ApiModelProperty("一级目录ID") private String oneId; + @ApiModelProperty("一级名称") private String oneName; @ApiModelProperty("二级目录ID") private String twoId; + @ApiModelProperty("二级名称") private String twoName; @ApiModelProperty("三级目录ID") private String threeId; + @ApiModelProperty("三级名称") private String threeName; @ApiModelProperty("上下架状态") diff --git a/src/main/java/com/sztzjy/resource_center/mapper/SysCaseQuestionMapper.java b/src/main/java/com/sztzjy/resource_center/mapper/SysCaseQuestionMapper.java index 4867070..e6c6046 100644 --- a/src/main/java/com/sztzjy/resource_center/mapper/SysCaseQuestionMapper.java +++ b/src/main/java/com/sztzjy/resource_center/mapper/SysCaseQuestionMapper.java @@ -6,6 +6,7 @@ import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.List; +import java.util.Map; @Mapper public interface SysCaseQuestionMapper { 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 a119cef..007d1ec 100644 --- a/src/main/java/com/sztzjy/resource_center/mapper/SysCaseQuestionStepMapper.java +++ b/src/main/java/com/sztzjy/resource_center/mapper/SysCaseQuestionStepMapper.java @@ -43,4 +43,6 @@ public interface SysCaseQuestionStepMapper { @Param("oneId") String oneId); List selectTrainingByIds(@Param("list") List caseStepIdList); + + List getCaseStepByIds(@Param("ids") List ids); } \ No newline at end of file diff --git a/src/main/java/com/sztzjy/resource_center/mapper/SysOneCatalogMapper.java b/src/main/java/com/sztzjy/resource_center/mapper/SysOneCatalogMapper.java index 7414739..58c3a86 100644 --- a/src/main/java/com/sztzjy/resource_center/mapper/SysOneCatalogMapper.java +++ b/src/main/java/com/sztzjy/resource_center/mapper/SysOneCatalogMapper.java @@ -37,4 +37,7 @@ public interface SysOneCatalogMapper { List> getAllOneCatalogListByDropDown(); void updateByBatch(@Param("sysOneCatalogs") List sysOneCatalogs); + + @Select("select one_id from sys_one_catalog where one_name =#{name}") + String getIdByName(@Param("name") String oneName); } \ No newline at end of file diff --git a/src/main/java/com/sztzjy/resource_center/mapper/SysResourceAndCourseMapper.java b/src/main/java/com/sztzjy/resource_center/mapper/SysResourceAndCourseMapper.java index 8423a8a..136fcd8 100644 --- a/src/main/java/com/sztzjy/resource_center/mapper/SysResourceAndCourseMapper.java +++ b/src/main/java/com/sztzjy/resource_center/mapper/SysResourceAndCourseMapper.java @@ -2,10 +2,11 @@ package com.sztzjy.resource_center.mapper; import com.sztzjy.resource_center.entity.SysResourceAndCourse; import com.sztzjy.resource_center.entity.SysResourceAndCourseExample; -import java.util.List; - import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; + +import java.util.List; + @Mapper public interface SysResourceAndCourseMapper { long countByExample(SysResourceAndCourseExample example); @@ -38,4 +39,7 @@ public interface SysResourceAndCourseMapper { void batchInsert(@Param("resourceAndCourses") List resourceAndCourses); + void batchUpdateTwoName(@Param("idList") List ids, @Param("twoName") String twoName); + + void batchUpdateThreeName(@Param("idList") List ids, @Param("threeName") String threeName); } \ No newline at end of file diff --git a/src/main/java/com/sztzjy/resource_center/mapper/SysResourceMapper.java b/src/main/java/com/sztzjy/resource_center/mapper/SysResourceMapper.java index 72b14a3..ab20183 100644 --- a/src/main/java/com/sztzjy/resource_center/mapper/SysResourceMapper.java +++ b/src/main/java/com/sztzjy/resource_center/mapper/SysResourceMapper.java @@ -47,6 +47,6 @@ public interface SysResourceMapper { List> getCountByType(@Param("list") List ids, @Param("schoolId") String schoolId); - @Select("SELECT resource_name FROM `sys_resource` ORDER BY count desc") + @Select("SELECT resource_name FROM `sys_resource` ORDER BY count desc limit 1") String getMostPopularName(); } \ No newline at end of file diff --git a/src/main/java/com/sztzjy/resource_center/mapper/SysThreeCatalogMapper.java b/src/main/java/com/sztzjy/resource_center/mapper/SysThreeCatalogMapper.java index 3f1358e..b1e358b 100644 --- a/src/main/java/com/sztzjy/resource_center/mapper/SysThreeCatalogMapper.java +++ b/src/main/java/com/sztzjy/resource_center/mapper/SysThreeCatalogMapper.java @@ -48,4 +48,8 @@ public interface SysThreeCatalogMapper { "where s.creator in ('管理员',#{source})") List selectNameByCourseID(@Param("oneId") String oneId, @Param("source") String source); + + @Select("select three_id from sys_three_catalog where three_name =#{threeName} and two_name ={twoName}") + String getIdByName(@Param("threeName") String threeName, + @Param("twoName") String twoName); } \ No newline at end of file diff --git a/src/main/java/com/sztzjy/resource_center/mapper/SysTopicAndCourseMapper.java b/src/main/java/com/sztzjy/resource_center/mapper/SysTopicAndCourseMapper.java index 6174ada..93dbc6d 100644 --- a/src/main/java/com/sztzjy/resource_center/mapper/SysTopicAndCourseMapper.java +++ b/src/main/java/com/sztzjy/resource_center/mapper/SysTopicAndCourseMapper.java @@ -4,8 +4,10 @@ import com.sztzjy.resource_center.entity.SysTopicAndCourse; import com.sztzjy.resource_center.entity.SysTopicAndCourseExample; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; import java.util.List; +import java.util.Map; @Mapper public interface SysTopicAndCourseMapper { @@ -34,4 +36,15 @@ public interface SysTopicAndCourseMapper { void batchInsert(@Param("list") List list); void batchDelete(@Param("list") List sysTopicAndCourses); + + void batchUpdateTwoName(@Param("idList") List ids, + @Param("twoName") String twoName); + + void batchUpdateThreeName(@Param("idList") List ids, + @Param("threeName") String threeName); + + @Select("select sq.case_id from sys_topic_and_course sc LEFT JOIN sys_case_questions sq on sc.topic_id = sq.case_id where sq.source = '管理员' and sc.one_id = #{oneId}") + List getCaseIdsBySourceIsAdmin(@Param("oneId") String oneId); + + List> selectCaseIdByCourseAndChapterIds(@Param("courseIdList") List courseIdList, @Param("chapterIdList") List chapterIdList); } \ No newline at end of file diff --git a/src/main/java/com/sztzjy/resource_center/mapper/SysTwoCatalogMapper.java b/src/main/java/com/sztzjy/resource_center/mapper/SysTwoCatalogMapper.java index 1972e9f..c69fbd4 100644 --- a/src/main/java/com/sztzjy/resource_center/mapper/SysTwoCatalogMapper.java +++ b/src/main/java/com/sztzjy/resource_center/mapper/SysTwoCatalogMapper.java @@ -36,4 +36,7 @@ public interface SysTwoCatalogMapper { List> getAllTwoCatalogList(@Param("oneId")String oneId); void updateByBatch(@Param("sysTwoCatalogs")List sysTwoCatalogs); + + @Select("select two_id from sys_two_catalog where two_name =#{twoName}") + String getIdByName(String twoName); } \ No newline at end of file diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml index 4d9d543..3ab7858 100644 --- a/src/main/resources/application-dev.yml +++ b/src/main/resources/application-dev.yml @@ -11,8 +11,8 @@ spring: # 文件存储 file: type: local - path: /usr/local/tianzeProject/resourceCenter/uploadFile -# path: D:/home +# path: /usr/local/tianzeProject/resourceCenter/uploadFile + path: D:/home timer: enable: false diff --git a/src/main/resources/mapper/SysCaseQuestionMapper.xml b/src/main/resources/mapper/SysCaseQuestionMapper.xml index 9d45f04..8dbd9f7 100644 --- a/src/main/resources/mapper/SysCaseQuestionMapper.xml +++ b/src/main/resources/mapper/SysCaseQuestionMapper.xml @@ -458,7 +458,8 @@ - + \ No newline at end of file diff --git a/src/main/resources/mapper/SysResourceAndCourseMapper.xml b/src/main/resources/mapper/SysResourceAndCourseMapper.xml index 9703e43..e0e93b9 100644 --- a/src/main/resources/mapper/SysResourceAndCourseMapper.xml +++ b/src/main/resources/mapper/SysResourceAndCourseMapper.xml @@ -289,4 +289,23 @@ + + + UPDATE sys_resource_and_course + SET two_name = #{twoName} + WHERE id IN + + #{id} + + + + + + UPDATE sys_resource_and_course + SET three_name = #{threeName} + WHERE id IN + + #{id} + + \ No newline at end of file diff --git a/src/main/resources/mapper/SysTopicAndCourseMapper.xml b/src/main/resources/mapper/SysTopicAndCourseMapper.xml index 46ce5a4..8a07311 100644 --- a/src/main/resources/mapper/SysTopicAndCourseMapper.xml +++ b/src/main/resources/mapper/SysTopicAndCourseMapper.xml @@ -307,4 +307,42 @@ AND three_id = #{item.threeId} + + + + UPDATE sys_topic_and_course + SET two_name = #{twoName} + WHERE id IN + + #{id} + + + + + + + UPDATE sys_topic_and_course + SET three_name = #{threeName} + WHERE id IN + + #{id} + + + + + + + \ No newline at end of file