diff --git a/jeecg-module-main/src/main/java/org/jeecg/modules/kc/teachingunitcontent/controller/KcTeachingUnitContentOneController.java b/jeecg-module-main/src/main/java/org/jeecg/modules/kc/teachingunitcontent/controller/KcTeachingUnitContentOneController.java new file mode 100644 index 00000000..725b2cf7 --- /dev/null +++ b/jeecg-module-main/src/main/java/org/jeecg/modules/kc/teachingunitcontent/controller/KcTeachingUnitContentOneController.java @@ -0,0 +1,248 @@ +package org.jeecg.modules.kc.teachingunitcontent.controller; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLDecoder; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import com.google.common.collect.Maps; +import org.apache.commons.compress.utils.Lists; +import org.jeecg.common.api.vo.Result; +import org.jeecg.common.system.query.QueryGenerator; +import org.jeecg.common.util.oConvertUtils; +import org.jeecg.modules.kc.teachingunitcontent.entity.KcTeachingUnitContentOne; +import org.jeecg.modules.kc.teachingunitcontent.entity.KcTeachingUnitContentThree; +import org.jeecg.modules.kc.teachingunitcontent.entity.KcTeachingUnitContentTwo; +import org.jeecg.modules.kc.teachingunitcontent.service.IKcTeachingUnitContentOneService; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import lombok.extern.slf4j.Slf4j; + +import org.jeecg.modules.kc.teachingunitcontent.service.IKcTeachingUnitContentThreeService; +import org.jeecg.modules.kc.teachingunitcontent.service.IKcTeachingUnitContentTwoService; +import org.jeecg.modules.kc.teachingunitcontent.vo.KcTeachingUnitContentSave; +import org.jeecgframework.poi.excel.ExcelImportUtil; +import org.jeecgframework.poi.excel.def.NormalExcelConstants; +import org.jeecgframework.poi.excel.entity.ExportParams; +import org.jeecgframework.poi.excel.entity.ImportParams; +import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; +import org.jeecg.common.system.base.controller.JeecgController; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.multipart.MultipartHttpServletRequest; +import org.springframework.web.servlet.ModelAndView; +import com.alibaba.fastjson.JSON; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.jeecg.common.aspect.annotation.AutoLog; +import org.apache.shiro.authz.annotation.RequiresPermissions; + + /** + * @Description: 教学单元内容-第一层 + * @Author: jeecg-boot + * @Date: 2024-05-15 + * @Version: V1.0 + */ +@Api(tags="教学单元内容-第一层") +@RestController +@RequestMapping("/teachingunitcontent/kcTeachingUnitContentOne") +@Slf4j +public class KcTeachingUnitContentOneController extends JeecgController { + @Autowired + private IKcTeachingUnitContentOneService kcTeachingUnitContentOneService; + + @Autowired + private IKcTeachingUnitContentTwoService kcTeachingUnitContentTwoService; + + @Autowired + private IKcTeachingUnitContentThreeService kcTeachingUnitContentThreeService; + + + /** + * 分页列表查询 + * + * @param kcTeachingUnitContentOne + * @param pageNo + * @param pageSize + * @param req + * @return + */ + //@AutoLog(value = "教学单元内容-第一层-分页列表查询") + @ApiOperation(value="教学单元内容-第一层-分页列表查询", notes="教学单元内容-第一层-分页列表查询") + @GetMapping(value = "/list") + public Result> queryPageList(KcTeachingUnitContentOne kcTeachingUnitContentOne, + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, + HttpServletRequest req) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(kcTeachingUnitContentOne, req.getParameterMap()); + Page page = new Page<>(pageNo, pageSize); + IPage pageList = kcTeachingUnitContentOneService.page(page, queryWrapper); + return Result.OK(pageList); + } + + + /** + * + * @param kcTeachingUnitContentOne + * @param req + * @return + */ + //@AutoLog(value = "教学单元内容-第一层-分页列表查询") + @ApiOperation(value="教学单元内容-第一层-分页列表查询", notes="教学单元内容-第一层-分页列表查询") + @GetMapping(value = "/allList") + public Result> allList(KcTeachingUnitContentOne kcTeachingUnitContentOne, HttpServletRequest req) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(kcTeachingUnitContentOne, req.getParameterMap()); + List list = kcTeachingUnitContentOneService.list(queryWrapper); + + //转成map + Map oneMap = Maps.newHashMap(); + list.forEach(x -> oneMap.put(x.getId(), x)); + + //查询子列表 + QueryWrapper twoQW = new QueryWrapper<>(); + twoQW.lambda().eq(KcTeachingUnitContentTwo::getXqxn, kcTeachingUnitContentOne.getXqxn()); + twoQW.lambda().eq(KcTeachingUnitContentTwo::getRwbh, kcTeachingUnitContentOne.getRwbh()); + twoQW.lambda().orderByAsc(KcTeachingUnitContentTwo::getSort); + List twoList = kcTeachingUnitContentTwoService.list(twoQW); + Map twoMap = Maps.newHashMap(); + twoList.forEach(x -> { + twoMap.put(x.getId(), x); + if(oneMap.containsKey(x.getPid())){ + KcTeachingUnitContentOne one = oneMap.get(x.getPid()); + if(one.getChildrenList() == null){ + one.setChildrenList(Lists.newArrayList()); + } + one.getChildrenList().add(x); + } + }); + + QueryWrapper threeQW = new QueryWrapper<>(); + threeQW.lambda().eq(KcTeachingUnitContentThree::getXqxn, kcTeachingUnitContentOne.getXqxn()); + threeQW.lambda().eq(KcTeachingUnitContentThree::getRwbh, kcTeachingUnitContentOne.getRwbh()); + threeQW.lambda().orderByAsc(KcTeachingUnitContentThree::getSort); + List threeList = kcTeachingUnitContentThreeService.list(threeQW); + + threeList.forEach(x -> { + if(twoMap.containsKey(x.getPid())){ + KcTeachingUnitContentTwo two = twoMap.get(x.getPid()); + if(two.getChildrenList() == null){ + two.setChildrenList(Lists.newArrayList()); + } + two.getChildrenList().add(x); + } + }); + + return Result.OK(list); + } + +// /** +// * 添加 +// * +// * @param teachingUnitContentSave +// * @return +// */ +// @AutoLog(value = "教学单元内容-第一层-添加") +// @ApiOperation(value="教学单元内容-第一层-添加", notes="教学单元内容-第一层-添加") +//// @RequiresPermissions("teachingunitcontent:kc_teaching_unit_content_one:add") +// @PostMapping(value = "/add") +// public Result add(@RequestBody KcTeachingUnitContentSave teachingUnitContentSave) { +// kcTeachingUnitContentOneService.saveAll(teachingUnitContentSave); +// return Result.OK("添加成功!"); +// } + + /** + * 编辑 + * + * @param teachingUnitContentSave + * @return + */ + @AutoLog(value = "教学单元内容-第一层-编辑") + @ApiOperation(value="教学单元内容-第一层-编辑", notes="教学单元内容-第一层-编辑") +// @RequiresPermissions("teachingunitcontent:kc_teaching_unit_content_one:edit") + @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) + public Result edit(@RequestBody KcTeachingUnitContentSave teachingUnitContentSave) { + kcTeachingUnitContentOneService.updateAllById(teachingUnitContentSave); + return Result.OK("编辑成功!"); + } + +// /** +// * 通过id删除 +// * +// * @param id +// * @return +// */ +// @AutoLog(value = "教学单元内容-第一层-通过id删除") +// @ApiOperation(value="教学单元内容-第一层-通过id删除", notes="教学单元内容-第一层-通过id删除") +// @RequiresPermissions("teachingunitcontent:kc_teaching_unit_content_one:delete") +// @DeleteMapping(value = "/delete") +// public Result delete(@RequestParam(name="id",required=true) String id) { +// kcTeachingUnitContentOneService.removeById(id); +// return Result.OK("删除成功!"); +// } +// +// /** +// * 批量删除 +// * +// * @param ids +// * @return +// */ +// @AutoLog(value = "教学单元内容-第一层-批量删除") +// @ApiOperation(value="教学单元内容-第一层-批量删除", notes="教学单元内容-第一层-批量删除") +// @RequiresPermissions("teachingunitcontent:kc_teaching_unit_content_one:deleteBatch") +// @DeleteMapping(value = "/deleteBatch") +// public Result deleteBatch(@RequestParam(name="ids",required=true) String ids) { +// this.kcTeachingUnitContentOneService.removeByIds(Arrays.asList(ids.split(","))); +// return Result.OK("批量删除成功!"); +// } +// +// /** +// * 通过id查询 +// * +// * @param id +// * @return +// */ +// //@AutoLog(value = "教学单元内容-第一层-通过id查询") +// @ApiOperation(value="教学单元内容-第一层-通过id查询", notes="教学单元内容-第一层-通过id查询") +// @GetMapping(value = "/queryById") +// public Result queryById(@RequestParam(name="id",required=true) String id) { +// KcTeachingUnitContentOne kcTeachingUnitContentOne = kcTeachingUnitContentOneService.getById(id); +// if(kcTeachingUnitContentOne==null) { +// return Result.error("未找到对应数据"); +// } +// return Result.OK(kcTeachingUnitContentOne); +// } +// +// /** +// * 导出excel +// * +// * @param request +// * @param kcTeachingUnitContentOne +// */ +// @RequiresPermissions("teachingunitcontent:kc_teaching_unit_content_one:exportXls") +// @RequestMapping(value = "/exportXls") +// public ModelAndView exportXls(HttpServletRequest request, KcTeachingUnitContentOne kcTeachingUnitContentOne) { +// return super.exportXls(request, kcTeachingUnitContentOne, KcTeachingUnitContentOne.class, "教学单元内容-第一层"); +// } +// +// /** +// * 通过excel导入数据 +// * +// * @param request +// * @param response +// * @return +// */ +// @RequiresPermissions("teachingunitcontent:kc_teaching_unit_content_one:importExcel") +// @RequestMapping(value = "/importExcel", method = RequestMethod.POST) +// public Result importExcel(HttpServletRequest request, HttpServletResponse response) { +// return super.importExcel(request, response, KcTeachingUnitContentOne.class); +// } + +} diff --git a/jeecg-module-main/src/main/java/org/jeecg/modules/kc/teachingunitcontent/controller/KcTeachingUnitContentThreeController.java b/jeecg-module-main/src/main/java/org/jeecg/modules/kc/teachingunitcontent/controller/KcTeachingUnitContentThreeController.java new file mode 100644 index 00000000..13d8ab3b --- /dev/null +++ b/jeecg-module-main/src/main/java/org/jeecg/modules/kc/teachingunitcontent/controller/KcTeachingUnitContentThreeController.java @@ -0,0 +1,178 @@ +package org.jeecg.modules.kc.teachingunitcontent.controller; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLDecoder; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import org.jeecg.common.api.vo.Result; +import org.jeecg.common.system.query.QueryGenerator; +import org.jeecg.common.util.oConvertUtils; +import org.jeecg.modules.kc.teachingunitcontent.entity.KcTeachingUnitContentThree; +import org.jeecg.modules.kc.teachingunitcontent.service.IKcTeachingUnitContentThreeService; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import lombok.extern.slf4j.Slf4j; + +import org.jeecgframework.poi.excel.ExcelImportUtil; +import org.jeecgframework.poi.excel.def.NormalExcelConstants; +import org.jeecgframework.poi.excel.entity.ExportParams; +import org.jeecgframework.poi.excel.entity.ImportParams; +import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; +import org.jeecg.common.system.base.controller.JeecgController; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.multipart.MultipartHttpServletRequest; +import org.springframework.web.servlet.ModelAndView; +import com.alibaba.fastjson.JSON; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.jeecg.common.aspect.annotation.AutoLog; +import org.apache.shiro.authz.annotation.RequiresPermissions; + + /** + * @Description: 教学单元内容-第三层 + * @Author: jeecg-boot + * @Date: 2024-05-15 + * @Version: V1.0 + */ +@Api(tags="教学单元内容-第三层") +@RestController +@RequestMapping("/teachingunitcontent/kcTeachingUnitContentThree") +@Slf4j +public class KcTeachingUnitContentThreeController extends JeecgController { + @Autowired + private IKcTeachingUnitContentThreeService kcTeachingUnitContentThreeService; + + /** + * 分页列表查询 + * + * @param kcTeachingUnitContentThree + * @param pageNo + * @param pageSize + * @param req + * @return + */ + //@AutoLog(value = "教学单元内容-第三层-分页列表查询") + @ApiOperation(value="教学单元内容-第三层-分页列表查询", notes="教学单元内容-第三层-分页列表查询") + @GetMapping(value = "/list") + public Result> queryPageList(KcTeachingUnitContentThree kcTeachingUnitContentThree, + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, + HttpServletRequest req) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(kcTeachingUnitContentThree, req.getParameterMap()); + Page page = new Page(pageNo, pageSize); + IPage pageList = kcTeachingUnitContentThreeService.page(page, queryWrapper); + return Result.OK(pageList); + } + +// /** +// * 添加 +// * +// * @param kcTeachingUnitContentThree +// * @return +// */ +// @AutoLog(value = "教学单元内容-第三层-添加") +// @ApiOperation(value="教学单元内容-第三层-添加", notes="教学单元内容-第三层-添加") +// @RequiresPermissions("teachingunitcontent:kc_teaching_unit_content_three:add") +// @PostMapping(value = "/add") +// public Result add(@RequestBody KcTeachingUnitContentThree kcTeachingUnitContentThree) { +// kcTeachingUnitContentThreeService.save(kcTeachingUnitContentThree); +// return Result.OK("添加成功!"); +// } +// +// /** +// * 编辑 +// * +// * @param kcTeachingUnitContentThree +// * @return +// */ +// @AutoLog(value = "教学单元内容-第三层-编辑") +// @ApiOperation(value="教学单元内容-第三层-编辑", notes="教学单元内容-第三层-编辑") +// @RequiresPermissions("teachingunitcontent:kc_teaching_unit_content_three:edit") +// @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) +// public Result edit(@RequestBody KcTeachingUnitContentThree kcTeachingUnitContentThree) { +// kcTeachingUnitContentThreeService.updateById(kcTeachingUnitContentThree); +// return Result.OK("编辑成功!"); +// } +// +// /** +// * 通过id删除 +// * +// * @param id +// * @return +// */ +// @AutoLog(value = "教学单元内容-第三层-通过id删除") +// @ApiOperation(value="教学单元内容-第三层-通过id删除", notes="教学单元内容-第三层-通过id删除") +// @RequiresPermissions("teachingunitcontent:kc_teaching_unit_content_three:delete") +// @DeleteMapping(value = "/delete") +// public Result delete(@RequestParam(name="id",required=true) String id) { +// kcTeachingUnitContentThreeService.removeById(id); +// return Result.OK("删除成功!"); +// } +// +// /** +// * 批量删除 +// * +// * @param ids +// * @return +// */ +// @AutoLog(value = "教学单元内容-第三层-批量删除") +// @ApiOperation(value="教学单元内容-第三层-批量删除", notes="教学单元内容-第三层-批量删除") +// @RequiresPermissions("teachingunitcontent:kc_teaching_unit_content_three:deleteBatch") +// @DeleteMapping(value = "/deleteBatch") +// public Result deleteBatch(@RequestParam(name="ids",required=true) String ids) { +// this.kcTeachingUnitContentThreeService.removeByIds(Arrays.asList(ids.split(","))); +// return Result.OK("批量删除成功!"); +// } +// +// /** +// * 通过id查询 +// * +// * @param id +// * @return +// */ +// //@AutoLog(value = "教学单元内容-第三层-通过id查询") +// @ApiOperation(value="教学单元内容-第三层-通过id查询", notes="教学单元内容-第三层-通过id查询") +// @GetMapping(value = "/queryById") +// public Result queryById(@RequestParam(name="id",required=true) String id) { +// KcTeachingUnitContentThree kcTeachingUnitContentThree = kcTeachingUnitContentThreeService.getById(id); +// if(kcTeachingUnitContentThree==null) { +// return Result.error("未找到对应数据"); +// } +// return Result.OK(kcTeachingUnitContentThree); +// } +// +// /** +// * 导出excel +// * +// * @param request +// * @param kcTeachingUnitContentThree +// */ +// @RequiresPermissions("teachingunitcontent:kc_teaching_unit_content_three:exportXls") +// @RequestMapping(value = "/exportXls") +// public ModelAndView exportXls(HttpServletRequest request, KcTeachingUnitContentThree kcTeachingUnitContentThree) { +// return super.exportXls(request, kcTeachingUnitContentThree, KcTeachingUnitContentThree.class, "教学单元内容-第三层"); +// } +// +// /** +// * 通过excel导入数据 +// * +// * @param request +// * @param response +// * @return +// */ +// @RequiresPermissions("teachingunitcontent:kc_teaching_unit_content_three:importExcel") +// @RequestMapping(value = "/importExcel", method = RequestMethod.POST) +// public Result importExcel(HttpServletRequest request, HttpServletResponse response) { +// return super.importExcel(request, response, KcTeachingUnitContentThree.class); +// } + +} diff --git a/jeecg-module-main/src/main/java/org/jeecg/modules/kc/teachingunitcontent/controller/KcTeachingUnitContentTwoController.java b/jeecg-module-main/src/main/java/org/jeecg/modules/kc/teachingunitcontent/controller/KcTeachingUnitContentTwoController.java new file mode 100644 index 00000000..ed53d93d --- /dev/null +++ b/jeecg-module-main/src/main/java/org/jeecg/modules/kc/teachingunitcontent/controller/KcTeachingUnitContentTwoController.java @@ -0,0 +1,178 @@ +package org.jeecg.modules.kc.teachingunitcontent.controller; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLDecoder; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import org.jeecg.common.api.vo.Result; +import org.jeecg.common.system.query.QueryGenerator; +import org.jeecg.common.util.oConvertUtils; +import org.jeecg.modules.kc.teachingunitcontent.entity.KcTeachingUnitContentTwo; +import org.jeecg.modules.kc.teachingunitcontent.service.IKcTeachingUnitContentTwoService; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import lombok.extern.slf4j.Slf4j; + +import org.jeecgframework.poi.excel.ExcelImportUtil; +import org.jeecgframework.poi.excel.def.NormalExcelConstants; +import org.jeecgframework.poi.excel.entity.ExportParams; +import org.jeecgframework.poi.excel.entity.ImportParams; +import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; +import org.jeecg.common.system.base.controller.JeecgController; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.multipart.MultipartHttpServletRequest; +import org.springframework.web.servlet.ModelAndView; +import com.alibaba.fastjson.JSON; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.jeecg.common.aspect.annotation.AutoLog; +import org.apache.shiro.authz.annotation.RequiresPermissions; + + /** + * @Description: 教学单元内容-第二层 + * @Author: jeecg-boot + * @Date: 2024-05-15 + * @Version: V1.0 + */ +@Api(tags="教学单元内容-第二层") +@RestController +@RequestMapping("/teachingunitcontent/kcTeachingUnitContentTwo") +@Slf4j +public class KcTeachingUnitContentTwoController extends JeecgController { + @Autowired + private IKcTeachingUnitContentTwoService kcTeachingUnitContentTwoService; + + /** + * 分页列表查询 + * + * @param kcTeachingUnitContentTwo + * @param pageNo + * @param pageSize + * @param req + * @return + */ + //@AutoLog(value = "教学单元内容-第二层-分页列表查询") + @ApiOperation(value="教学单元内容-第二层-分页列表查询", notes="教学单元内容-第二层-分页列表查询") + @GetMapping(value = "/list") + public Result> queryPageList(KcTeachingUnitContentTwo kcTeachingUnitContentTwo, + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, + HttpServletRequest req) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(kcTeachingUnitContentTwo, req.getParameterMap()); + Page page = new Page(pageNo, pageSize); + IPage pageList = kcTeachingUnitContentTwoService.page(page, queryWrapper); + return Result.OK(pageList); + } + +// /** +// * 添加 +// * +// * @param kcTeachingUnitContentTwo +// * @return +// */ +// @AutoLog(value = "教学单元内容-第二层-添加") +// @ApiOperation(value="教学单元内容-第二层-添加", notes="教学单元内容-第二层-添加") +// @RequiresPermissions("teachingunitcontent:kc_teaching_unit_content_two:add") +// @PostMapping(value = "/add") +// public Result add(@RequestBody KcTeachingUnitContentTwo kcTeachingUnitContentTwo) { +// kcTeachingUnitContentTwoService.save(kcTeachingUnitContentTwo); +// return Result.OK("添加成功!"); +// } +// +// /** +// * 编辑 +// * +// * @param kcTeachingUnitContentTwo +// * @return +// */ +// @AutoLog(value = "教学单元内容-第二层-编辑") +// @ApiOperation(value="教学单元内容-第二层-编辑", notes="教学单元内容-第二层-编辑") +// @RequiresPermissions("teachingunitcontent:kc_teaching_unit_content_two:edit") +// @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) +// public Result edit(@RequestBody KcTeachingUnitContentTwo kcTeachingUnitContentTwo) { +// kcTeachingUnitContentTwoService.updateById(kcTeachingUnitContentTwo); +// return Result.OK("编辑成功!"); +// } +// +// /** +// * 通过id删除 +// * +// * @param id +// * @return +// */ +// @AutoLog(value = "教学单元内容-第二层-通过id删除") +// @ApiOperation(value="教学单元内容-第二层-通过id删除", notes="教学单元内容-第二层-通过id删除") +// @RequiresPermissions("teachingunitcontent:kc_teaching_unit_content_two:delete") +// @DeleteMapping(value = "/delete") +// public Result delete(@RequestParam(name="id",required=true) String id) { +// kcTeachingUnitContentTwoService.removeById(id); +// return Result.OK("删除成功!"); +// } +// +// /** +// * 批量删除 +// * +// * @param ids +// * @return +// */ +// @AutoLog(value = "教学单元内容-第二层-批量删除") +// @ApiOperation(value="教学单元内容-第二层-批量删除", notes="教学单元内容-第二层-批量删除") +// @RequiresPermissions("teachingunitcontent:kc_teaching_unit_content_two:deleteBatch") +// @DeleteMapping(value = "/deleteBatch") +// public Result deleteBatch(@RequestParam(name="ids",required=true) String ids) { +// this.kcTeachingUnitContentTwoService.removeByIds(Arrays.asList(ids.split(","))); +// return Result.OK("批量删除成功!"); +// } +// +// /** +// * 通过id查询 +// * +// * @param id +// * @return +// */ +// //@AutoLog(value = "教学单元内容-第二层-通过id查询") +// @ApiOperation(value="教学单元内容-第二层-通过id查询", notes="教学单元内容-第二层-通过id查询") +// @GetMapping(value = "/queryById") +// public Result queryById(@RequestParam(name="id",required=true) String id) { +// KcTeachingUnitContentTwo kcTeachingUnitContentTwo = kcTeachingUnitContentTwoService.getById(id); +// if(kcTeachingUnitContentTwo==null) { +// return Result.error("未找到对应数据"); +// } +// return Result.OK(kcTeachingUnitContentTwo); +// } +// +// /** +// * 导出excel +// * +// * @param request +// * @param kcTeachingUnitContentTwo +// */ +// @RequiresPermissions("teachingunitcontent:kc_teaching_unit_content_two:exportXls") +// @RequestMapping(value = "/exportXls") +// public ModelAndView exportXls(HttpServletRequest request, KcTeachingUnitContentTwo kcTeachingUnitContentTwo) { +// return super.exportXls(request, kcTeachingUnitContentTwo, KcTeachingUnitContentTwo.class, "教学单元内容-第二层"); +// } +// +// /** +// * 通过excel导入数据 +// * +// * @param request +// * @param response +// * @return +// */ +// @RequiresPermissions("teachingunitcontent:kc_teaching_unit_content_two:importExcel") +// @RequestMapping(value = "/importExcel", method = RequestMethod.POST) +// public Result importExcel(HttpServletRequest request, HttpServletResponse response) { +// return super.importExcel(request, response, KcTeachingUnitContentTwo.class); +// } + +} diff --git a/jeecg-module-main/src/main/java/org/jeecg/modules/kc/teachingunitcontent/entity/KcTeachingUnitContentOne.java b/jeecg-module-main/src/main/java/org/jeecg/modules/kc/teachingunitcontent/entity/KcTeachingUnitContentOne.java new file mode 100644 index 00000000..03c07866 --- /dev/null +++ b/jeecg-module-main/src/main/java/org/jeecg/modules/kc/teachingunitcontent/entity/KcTeachingUnitContentOne.java @@ -0,0 +1,72 @@ +package org.jeecg.modules.kc.teachingunitcontent.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; +import org.jeecgframework.poi.excel.annotation.Excel; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description: 教学单元内容-第一层 + * @Author: jeecg-boot + * @Date: 2024-05-15 + * @Version: V1.0 + */ +@Data +@TableName("kc_teaching_unit_content_one") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +@ApiModel(value="kc_teaching_unit_content_one对象", description="教学单元内容-第一层") +public class KcTeachingUnitContentOne implements Serializable { + private static final long serialVersionUID = 1L; + + /**主键*/ + @TableId(type = IdType.ASSIGN_ID) + @ApiModelProperty(value = "主键") + private java.lang.String id; + /**创建人登录名称*/ + @ApiModelProperty(value = "创建人登录名称") + private java.lang.String createBy; + /**创建日期*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") + @DateTimeFormat(pattern="yyyy-MM-dd") + @ApiModelProperty(value = "创建日期") + private java.util.Date createTime; + /**更新人登录名称*/ + @ApiModelProperty(value = "更新人登录名称") + private java.lang.String updateBy; + /**更新日期*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") + @DateTimeFormat(pattern="yyyy-MM-dd") + @ApiModelProperty(value = "更新日期") + private java.util.Date updateTime; + /**学期学年*/ + @Excel(name = "学期学年", width = 15) + @ApiModelProperty(value = "学期学年") + private java.lang.String xqxn; + /**任务编号*/ + @Excel(name = "任务编号", width = 15) + @ApiModelProperty(value = "任务编号") + private java.lang.String rwbh; + /**标题*/ + @Excel(name = "标题", width = 15) + @ApiModelProperty(value = "标题") + private java.lang.String title; + /**排序*/ + @Excel(name = "排序", width = 15) + @ApiModelProperty(value = "排序") + private java.lang.Integer sort; + + @TableField(exist = false) + private List childrenList; +} diff --git a/jeecg-module-main/src/main/java/org/jeecg/modules/kc/teachingunitcontent/entity/KcTeachingUnitContentThree.java b/jeecg-module-main/src/main/java/org/jeecg/modules/kc/teachingunitcontent/entity/KcTeachingUnitContentThree.java new file mode 100644 index 00000000..3887b885 --- /dev/null +++ b/jeecg-module-main/src/main/java/org/jeecg/modules/kc/teachingunitcontent/entity/KcTeachingUnitContentThree.java @@ -0,0 +1,81 @@ +package org.jeecg.modules.kc.teachingunitcontent.entity; + +import java.io.Serializable; +import java.io.UnsupportedEncodingException; +import java.util.Date; +import java.math.BigDecimal; + +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.springframework.format.annotation.DateTimeFormat; +import org.jeecgframework.poi.excel.annotation.Excel; +import org.jeecg.common.aspect.annotation.Dict; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + * @Description: 教学单元内容-第三层 + * @Author: jeecg-boot + * @Date: 2024-05-15 + * @Version: V1.0 + */ +@Data +@TableName("kc_teaching_unit_content_three") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +@ApiModel(value="kc_teaching_unit_content_three对象", description="教学单元内容-第三层") +public class KcTeachingUnitContentThree implements Serializable { + private static final long serialVersionUID = 1L; + + /**主键*/ + @TableId(type = IdType.ASSIGN_ID) + @ApiModelProperty(value = "主键") + private java.lang.String id; + /**创建人登录名称*/ + @ApiModelProperty(value = "创建人登录名称") + private java.lang.String createBy; + /**创建日期*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") + @DateTimeFormat(pattern="yyyy-MM-dd") + @ApiModelProperty(value = "创建日期") + private java.util.Date createTime; + /**更新人登录名称*/ + @ApiModelProperty(value = "更新人登录名称") + private java.lang.String updateBy; + /**更新日期*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") + @DateTimeFormat(pattern="yyyy-MM-dd") + @ApiModelProperty(value = "更新日期") + private java.util.Date updateTime; + /**学期学年*/ + @Excel(name = "学期学年", width = 15) + @ApiModelProperty(value = "学期学年") + private java.lang.String xqxn; + /**任务编号*/ + @Excel(name = "任务编号", width = 15) + @ApiModelProperty(value = "任务编号") + private java.lang.String rwbh; + /**上一级ID*/ + @Excel(name = "上一级ID", width = 15) + @ApiModelProperty(value = "上一级ID") + private java.lang.String pid; + /**排序*/ + @Excel(name = "排序", width = 15) + @ApiModelProperty(value = "排序") + private java.lang.Integer sort; + /**内容类型【video:视频,document:文档,richText:富文本】*/ + @Excel(name = "内容类型【video:视频,document:文档,richText:富文本】", width = 15) + @ApiModelProperty(value = "内容类型【video:视频,document:文档,richText:富文本】") + private java.lang.String type; + /**url类型地址*/ + @Excel(name = "url类型地址", width = 15) + @ApiModelProperty(value = "url类型地址") + private java.lang.String filePath; + /**富文本*/ + @Excel(name = "富文本", width = 15) + @ApiModelProperty(value = "富文本") + private java.lang.String richText; +} diff --git a/jeecg-module-main/src/main/java/org/jeecg/modules/kc/teachingunitcontent/entity/KcTeachingUnitContentTwo.java b/jeecg-module-main/src/main/java/org/jeecg/modules/kc/teachingunitcontent/entity/KcTeachingUnitContentTwo.java new file mode 100644 index 00000000..9f9cdb4d --- /dev/null +++ b/jeecg-module-main/src/main/java/org/jeecg/modules/kc/teachingunitcontent/entity/KcTeachingUnitContentTwo.java @@ -0,0 +1,77 @@ +package org.jeecg.modules.kc.teachingunitcontent.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; +import org.jeecgframework.poi.excel.annotation.Excel; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description: 教学单元内容-第二层 + * @Author: jeecg-boot + * @Date: 2024-05-15 + * @Version: V1.0 + */ +@Data +@TableName("kc_teaching_unit_content_two") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +@ApiModel(value="kc_teaching_unit_content_two对象", description="教学单元内容-第二层") +public class KcTeachingUnitContentTwo implements Serializable { + private static final long serialVersionUID = 1L; + + /**主键*/ + @TableId(type = IdType.ASSIGN_ID) + @ApiModelProperty(value = "主键") + private java.lang.String id; + /**创建人登录名称*/ + @ApiModelProperty(value = "创建人登录名称") + private java.lang.String createBy; + /**创建日期*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") + @DateTimeFormat(pattern="yyyy-MM-dd") + @ApiModelProperty(value = "创建日期") + private java.util.Date createTime; + /**更新人登录名称*/ + @ApiModelProperty(value = "更新人登录名称") + private java.lang.String updateBy; + /**更新日期*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") + @DateTimeFormat(pattern="yyyy-MM-dd") + @ApiModelProperty(value = "更新日期") + private java.util.Date updateTime; + /**学期学年*/ + @Excel(name = "学期学年", width = 15) + @ApiModelProperty(value = "学期学年") + private java.lang.String xqxn; + /**任务编号*/ + @Excel(name = "任务编号", width = 15) + @ApiModelProperty(value = "任务编号") + private java.lang.String rwbh; + /**上一级ID*/ + @Excel(name = "上一级ID", width = 15) + @ApiModelProperty(value = "上一级ID") + private java.lang.String pid; + /**标题*/ + @Excel(name = "标题", width = 15) + @ApiModelProperty(value = "标题") + private java.lang.String title; + /**排序*/ + @Excel(name = "排序", width = 15) + @ApiModelProperty(value = "排序") + private java.lang.Integer sort; + + @TableField(exist = false) + private List childrenList; + +} diff --git a/jeecg-module-main/src/main/java/org/jeecg/modules/kc/teachingunitcontent/mapper/KcTeachingUnitContentOneMapper.java b/jeecg-module-main/src/main/java/org/jeecg/modules/kc/teachingunitcontent/mapper/KcTeachingUnitContentOneMapper.java new file mode 100644 index 00000000..206f6fdd --- /dev/null +++ b/jeecg-module-main/src/main/java/org/jeecg/modules/kc/teachingunitcontent/mapper/KcTeachingUnitContentOneMapper.java @@ -0,0 +1,17 @@ +package org.jeecg.modules.kc.teachingunitcontent.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; +import org.jeecg.modules.kc.teachingunitcontent.entity.KcTeachingUnitContentOne; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * @Description: 教学单元内容-第一层 + * @Author: jeecg-boot + * @Date: 2024-05-15 + * @Version: V1.0 + */ +public interface KcTeachingUnitContentOneMapper extends BaseMapper { + +} diff --git a/jeecg-module-main/src/main/java/org/jeecg/modules/kc/teachingunitcontent/mapper/KcTeachingUnitContentThreeMapper.java b/jeecg-module-main/src/main/java/org/jeecg/modules/kc/teachingunitcontent/mapper/KcTeachingUnitContentThreeMapper.java new file mode 100644 index 00000000..8f032521 --- /dev/null +++ b/jeecg-module-main/src/main/java/org/jeecg/modules/kc/teachingunitcontent/mapper/KcTeachingUnitContentThreeMapper.java @@ -0,0 +1,17 @@ +package org.jeecg.modules.kc.teachingunitcontent.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; +import org.jeecg.modules.kc.teachingunitcontent.entity.KcTeachingUnitContentThree; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * @Description: 教学单元内容-第三层 + * @Author: jeecg-boot + * @Date: 2024-05-15 + * @Version: V1.0 + */ +public interface KcTeachingUnitContentThreeMapper extends BaseMapper { + +} diff --git a/jeecg-module-main/src/main/java/org/jeecg/modules/kc/teachingunitcontent/mapper/KcTeachingUnitContentTwoMapper.java b/jeecg-module-main/src/main/java/org/jeecg/modules/kc/teachingunitcontent/mapper/KcTeachingUnitContentTwoMapper.java new file mode 100644 index 00000000..95356e81 --- /dev/null +++ b/jeecg-module-main/src/main/java/org/jeecg/modules/kc/teachingunitcontent/mapper/KcTeachingUnitContentTwoMapper.java @@ -0,0 +1,17 @@ +package org.jeecg.modules.kc.teachingunitcontent.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; +import org.jeecg.modules.kc.teachingunitcontent.entity.KcTeachingUnitContentTwo; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * @Description: 教学单元内容-第二层 + * @Author: jeecg-boot + * @Date: 2024-05-15 + * @Version: V1.0 + */ +public interface KcTeachingUnitContentTwoMapper extends BaseMapper { + +} diff --git a/jeecg-module-main/src/main/java/org/jeecg/modules/kc/teachingunitcontent/mapper/xml/KcTeachingUnitContentOneMapper.xml b/jeecg-module-main/src/main/java/org/jeecg/modules/kc/teachingunitcontent/mapper/xml/KcTeachingUnitContentOneMapper.xml new file mode 100644 index 00000000..c44da787 --- /dev/null +++ b/jeecg-module-main/src/main/java/org/jeecg/modules/kc/teachingunitcontent/mapper/xml/KcTeachingUnitContentOneMapper.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/jeecg-module-main/src/main/java/org/jeecg/modules/kc/teachingunitcontent/mapper/xml/KcTeachingUnitContentThreeMapper.xml b/jeecg-module-main/src/main/java/org/jeecg/modules/kc/teachingunitcontent/mapper/xml/KcTeachingUnitContentThreeMapper.xml new file mode 100644 index 00000000..50fc0e23 --- /dev/null +++ b/jeecg-module-main/src/main/java/org/jeecg/modules/kc/teachingunitcontent/mapper/xml/KcTeachingUnitContentThreeMapper.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/jeecg-module-main/src/main/java/org/jeecg/modules/kc/teachingunitcontent/mapper/xml/KcTeachingUnitContentTwoMapper.xml b/jeecg-module-main/src/main/java/org/jeecg/modules/kc/teachingunitcontent/mapper/xml/KcTeachingUnitContentTwoMapper.xml new file mode 100644 index 00000000..a44d21bb --- /dev/null +++ b/jeecg-module-main/src/main/java/org/jeecg/modules/kc/teachingunitcontent/mapper/xml/KcTeachingUnitContentTwoMapper.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/jeecg-module-main/src/main/java/org/jeecg/modules/kc/teachingunitcontent/service/IKcTeachingUnitContentOneService.java b/jeecg-module-main/src/main/java/org/jeecg/modules/kc/teachingunitcontent/service/IKcTeachingUnitContentOneService.java new file mode 100644 index 00000000..cf16abb6 --- /dev/null +++ b/jeecg-module-main/src/main/java/org/jeecg/modules/kc/teachingunitcontent/service/IKcTeachingUnitContentOneService.java @@ -0,0 +1,20 @@ +package org.jeecg.modules.kc.teachingunitcontent.service; + +import org.jeecg.modules.kc.teachingunitcontent.entity.KcTeachingUnitContentOne; +import com.baomidou.mybatisplus.extension.service.IService; +import org.jeecg.modules.kc.teachingunitcontent.vo.KcTeachingUnitContentSave; + +import java.util.List; + +/** + * @Description: 教学单元内容-第一层 + * @Author: jeecg-boot + * @Date: 2024-05-15 + * @Version: V1.0 + */ +public interface IKcTeachingUnitContentOneService extends IService { + + void saveAll(KcTeachingUnitContentSave teachingUnitContentSave); + + void updateAllById(KcTeachingUnitContentSave teachingUnitContentSave); +} diff --git a/jeecg-module-main/src/main/java/org/jeecg/modules/kc/teachingunitcontent/service/IKcTeachingUnitContentThreeService.java b/jeecg-module-main/src/main/java/org/jeecg/modules/kc/teachingunitcontent/service/IKcTeachingUnitContentThreeService.java new file mode 100644 index 00000000..ea201765 --- /dev/null +++ b/jeecg-module-main/src/main/java/org/jeecg/modules/kc/teachingunitcontent/service/IKcTeachingUnitContentThreeService.java @@ -0,0 +1,14 @@ +package org.jeecg.modules.kc.teachingunitcontent.service; + +import org.jeecg.modules.kc.teachingunitcontent.entity.KcTeachingUnitContentThree; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * @Description: 教学单元内容-第三层 + * @Author: jeecg-boot + * @Date: 2024-05-15 + * @Version: V1.0 + */ +public interface IKcTeachingUnitContentThreeService extends IService { + +} diff --git a/jeecg-module-main/src/main/java/org/jeecg/modules/kc/teachingunitcontent/service/IKcTeachingUnitContentTwoService.java b/jeecg-module-main/src/main/java/org/jeecg/modules/kc/teachingunitcontent/service/IKcTeachingUnitContentTwoService.java new file mode 100644 index 00000000..a311c7b5 --- /dev/null +++ b/jeecg-module-main/src/main/java/org/jeecg/modules/kc/teachingunitcontent/service/IKcTeachingUnitContentTwoService.java @@ -0,0 +1,14 @@ +package org.jeecg.modules.kc.teachingunitcontent.service; + +import org.jeecg.modules.kc.teachingunitcontent.entity.KcTeachingUnitContentTwo; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * @Description: 教学单元内容-第二层 + * @Author: jeecg-boot + * @Date: 2024-05-15 + * @Version: V1.0 + */ +public interface IKcTeachingUnitContentTwoService extends IService { + +} diff --git a/jeecg-module-main/src/main/java/org/jeecg/modules/kc/teachingunitcontent/service/impl/KcTeachingUnitContentOneServiceImpl.java b/jeecg-module-main/src/main/java/org/jeecg/modules/kc/teachingunitcontent/service/impl/KcTeachingUnitContentOneServiceImpl.java new file mode 100644 index 00000000..cf98de8d --- /dev/null +++ b/jeecg-module-main/src/main/java/org/jeecg/modules/kc/teachingunitcontent/service/impl/KcTeachingUnitContentOneServiceImpl.java @@ -0,0 +1,99 @@ +package org.jeecg.modules.kc.teachingunitcontent.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import org.jeecg.modules.kc.teachingunitcontent.entity.KcTeachingUnitContentOne; +import org.jeecg.modules.kc.teachingunitcontent.entity.KcTeachingUnitContentThree; +import org.jeecg.modules.kc.teachingunitcontent.entity.KcTeachingUnitContentTwo; +import org.jeecg.modules.kc.teachingunitcontent.mapper.KcTeachingUnitContentOneMapper; +import org.jeecg.modules.kc.teachingunitcontent.service.IKcTeachingUnitContentOneService; +import org.jeecg.modules.kc.teachingunitcontent.service.IKcTeachingUnitContentThreeService; +import org.jeecg.modules.kc.teachingunitcontent.service.IKcTeachingUnitContentTwoService; +import org.jeecg.modules.kc.teachingunitcontent.vo.KcTeachingUnitContentSave; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; + +/** + * @Description: 教学单元内容-第一层 + * @Author: jeecg-boot + * @Date: 2024-05-15 + * @Version: V1.0 + */ +@Service +public class KcTeachingUnitContentOneServiceImpl extends ServiceImpl implements IKcTeachingUnitContentOneService { + + @Autowired + private IKcTeachingUnitContentTwoService kcTeachingUnitContentTwoService; + + @Autowired + private IKcTeachingUnitContentThreeService kcTeachingUnitContentThreeService; + + @Transactional(rollbackFor = {java.lang.Exception.class}) + @Override + public void saveAll(KcTeachingUnitContentSave teachingUnitContentSave) { + String xqxn = teachingUnitContentSave.getXqxn(); + String rwbh = teachingUnitContentSave.getRwbh(); + teachingUnitContentSave.getTeachingUnitContentOneList().forEach(x -> { + x.setXqxn(xqxn); + x.setRwbh(rwbh); + }); + //保存主表 + saveBatch(teachingUnitContentSave.getTeachingUnitContentOneList()); + + //保存第二层 + teachingUnitContentSave.getTeachingUnitContentOneList().forEach(x1 -> { + if(x1.getChildrenList() != null && !x1.getChildrenList().isEmpty()){ + x1.getChildrenList().forEach(x2 -> { + x2.setPid(x1.getId()); + x2.setXqxn(xqxn); + x2.setRwbh(rwbh); + }); + kcTeachingUnitContentTwoService.saveBatch(x1.getChildrenList()); + } + }); + + + //保存三层 + teachingUnitContentSave.getTeachingUnitContentOneList().forEach(x1 -> { + if(x1.getChildrenList() != null && !x1.getChildrenList().isEmpty()){ + x1.getChildrenList().forEach(x2 -> { + if(x2.getChildrenList() != null && !x2.getChildrenList().isEmpty()){ + x2.getChildrenList().forEach(x3 -> { + x3.setPid(x2.getId()); + x3.setXqxn(xqxn); + x3.setRwbh(rwbh); + }); + kcTeachingUnitContentThreeService.saveBatch(x2.getChildrenList()); + } + }); + } + }); + } + + @Transactional(rollbackFor = {java.lang.Exception.class}) + @Override + public void updateAllById(KcTeachingUnitContentSave teachingUnitContentSave) { + String xqxn = teachingUnitContentSave.getXqxn(); + String rwbh = teachingUnitContentSave.getRwbh(); + + QueryWrapper oneQw = new QueryWrapper<>(); + oneQw.lambda().eq(KcTeachingUnitContentOne::getXqxn, xqxn); + oneQw.lambda().eq(KcTeachingUnitContentOne::getRwbh, rwbh); + QueryWrapper twoQw = new QueryWrapper<>(); + twoQw.lambda().eq(KcTeachingUnitContentTwo::getXqxn, xqxn); + twoQw.lambda().eq(KcTeachingUnitContentTwo::getRwbh, rwbh); + QueryWrapper threeQw = new QueryWrapper<>(); + threeQw.lambda().eq(KcTeachingUnitContentThree::getXqxn, xqxn); + threeQw.lambda().eq(KcTeachingUnitContentThree::getRwbh, rwbh); + + remove(oneQw); + kcTeachingUnitContentTwoService.remove(twoQw); + kcTeachingUnitContentThreeService.remove(threeQw); + + saveAll(teachingUnitContentSave); + } +} diff --git a/jeecg-module-main/src/main/java/org/jeecg/modules/kc/teachingunitcontent/service/impl/KcTeachingUnitContentThreeServiceImpl.java b/jeecg-module-main/src/main/java/org/jeecg/modules/kc/teachingunitcontent/service/impl/KcTeachingUnitContentThreeServiceImpl.java new file mode 100644 index 00000000..cf8cbbe0 --- /dev/null +++ b/jeecg-module-main/src/main/java/org/jeecg/modules/kc/teachingunitcontent/service/impl/KcTeachingUnitContentThreeServiceImpl.java @@ -0,0 +1,19 @@ +package org.jeecg.modules.kc.teachingunitcontent.service.impl; + +import org.jeecg.modules.kc.teachingunitcontent.entity.KcTeachingUnitContentThree; +import org.jeecg.modules.kc.teachingunitcontent.mapper.KcTeachingUnitContentThreeMapper; +import org.jeecg.modules.kc.teachingunitcontent.service.IKcTeachingUnitContentThreeService; +import org.springframework.stereotype.Service; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + +/** + * @Description: 教学单元内容-第三层 + * @Author: jeecg-boot + * @Date: 2024-05-15 + * @Version: V1.0 + */ +@Service +public class KcTeachingUnitContentThreeServiceImpl extends ServiceImpl implements IKcTeachingUnitContentThreeService { + +} diff --git a/jeecg-module-main/src/main/java/org/jeecg/modules/kc/teachingunitcontent/service/impl/KcTeachingUnitContentTwoServiceImpl.java b/jeecg-module-main/src/main/java/org/jeecg/modules/kc/teachingunitcontent/service/impl/KcTeachingUnitContentTwoServiceImpl.java new file mode 100644 index 00000000..522d6846 --- /dev/null +++ b/jeecg-module-main/src/main/java/org/jeecg/modules/kc/teachingunitcontent/service/impl/KcTeachingUnitContentTwoServiceImpl.java @@ -0,0 +1,19 @@ +package org.jeecg.modules.kc.teachingunitcontent.service.impl; + +import org.jeecg.modules.kc.teachingunitcontent.entity.KcTeachingUnitContentTwo; +import org.jeecg.modules.kc.teachingunitcontent.mapper.KcTeachingUnitContentTwoMapper; +import org.jeecg.modules.kc.teachingunitcontent.service.IKcTeachingUnitContentTwoService; +import org.springframework.stereotype.Service; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + +/** + * @Description: 教学单元内容-第二层 + * @Author: jeecg-boot + * @Date: 2024-05-15 + * @Version: V1.0 + */ +@Service +public class KcTeachingUnitContentTwoServiceImpl extends ServiceImpl implements IKcTeachingUnitContentTwoService { + +} diff --git a/jeecg-module-main/src/main/java/org/jeecg/modules/kc/teachingunitcontent/vo/KcTeachingUnitContentSave.java b/jeecg-module-main/src/main/java/org/jeecg/modules/kc/teachingunitcontent/vo/KcTeachingUnitContentSave.java new file mode 100644 index 00000000..f219423d --- /dev/null +++ b/jeecg-module-main/src/main/java/org/jeecg/modules/kc/teachingunitcontent/vo/KcTeachingUnitContentSave.java @@ -0,0 +1,21 @@ +package org.jeecg.modules.kc.teachingunitcontent.vo; + +import lombok.Data; +import org.jeecg.modules.kc.teachingunitcontent.entity.KcTeachingUnitContentOne; + +import java.util.List; + +/** + * @ClassName KcTeachingUnitContentSave + * @Description TODO + * @Author bai + * @Date 2024/5/15 20:55 + * @Version 1.0 + **/ +@Data +public class KcTeachingUnitContentSave { + + private String xqxn; + private String rwbh; + private List teachingUnitContentOneList; +}