2024年5月16日 新增教学单元内容维护
This commit is contained in:
parent
0c077de068
commit
6bbb57b940
|
@ -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<KcTeachingUnitContentOne, IKcTeachingUnitContentOneService> {
|
||||
@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<IPage<KcTeachingUnitContentOne>> queryPageList(KcTeachingUnitContentOne kcTeachingUnitContentOne,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<KcTeachingUnitContentOne> queryWrapper = QueryGenerator.initQueryWrapper(kcTeachingUnitContentOne, req.getParameterMap());
|
||||
Page<KcTeachingUnitContentOne> page = new Page<>(pageNo, pageSize);
|
||||
IPage<KcTeachingUnitContentOne> pageList = kcTeachingUnitContentOneService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param kcTeachingUnitContentOne
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "教学单元内容-第一层-分页列表查询")
|
||||
@ApiOperation(value="教学单元内容-第一层-分页列表查询", notes="教学单元内容-第一层-分页列表查询")
|
||||
@GetMapping(value = "/allList")
|
||||
public Result<List<KcTeachingUnitContentOne>> allList(KcTeachingUnitContentOne kcTeachingUnitContentOne, HttpServletRequest req) {
|
||||
QueryWrapper<KcTeachingUnitContentOne> queryWrapper = QueryGenerator.initQueryWrapper(kcTeachingUnitContentOne, req.getParameterMap());
|
||||
List<KcTeachingUnitContentOne> list = kcTeachingUnitContentOneService.list(queryWrapper);
|
||||
|
||||
//转成map
|
||||
Map<String, KcTeachingUnitContentOne> oneMap = Maps.newHashMap();
|
||||
list.forEach(x -> oneMap.put(x.getId(), x));
|
||||
|
||||
//查询子列表
|
||||
QueryWrapper<KcTeachingUnitContentTwo> twoQW = new QueryWrapper<>();
|
||||
twoQW.lambda().eq(KcTeachingUnitContentTwo::getXqxn, kcTeachingUnitContentOne.getXqxn());
|
||||
twoQW.lambda().eq(KcTeachingUnitContentTwo::getRwbh, kcTeachingUnitContentOne.getRwbh());
|
||||
twoQW.lambda().orderByAsc(KcTeachingUnitContentTwo::getSort);
|
||||
List<KcTeachingUnitContentTwo> twoList = kcTeachingUnitContentTwoService.list(twoQW);
|
||||
Map<String, KcTeachingUnitContentTwo> 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<KcTeachingUnitContentThree> threeQW = new QueryWrapper<>();
|
||||
threeQW.lambda().eq(KcTeachingUnitContentThree::getXqxn, kcTeachingUnitContentOne.getXqxn());
|
||||
threeQW.lambda().eq(KcTeachingUnitContentThree::getRwbh, kcTeachingUnitContentOne.getRwbh());
|
||||
threeQW.lambda().orderByAsc(KcTeachingUnitContentThree::getSort);
|
||||
List<KcTeachingUnitContentThree> 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<String> 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<String> 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<String> 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<String> 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<KcTeachingUnitContentOne> 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);
|
||||
// }
|
||||
|
||||
}
|
|
@ -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<KcTeachingUnitContentThree, IKcTeachingUnitContentThreeService> {
|
||||
@Autowired
|
||||
private IKcTeachingUnitContentThreeService kcTeachingUnitContentThreeService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param kcTeachingUnitContentThree
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "教学单元内容-第三层-分页列表查询")
|
||||
@ApiOperation(value="教学单元内容-第三层-分页列表查询", notes="教学单元内容-第三层-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<KcTeachingUnitContentThree>> queryPageList(KcTeachingUnitContentThree kcTeachingUnitContentThree,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<KcTeachingUnitContentThree> queryWrapper = QueryGenerator.initQueryWrapper(kcTeachingUnitContentThree, req.getParameterMap());
|
||||
Page<KcTeachingUnitContentThree> page = new Page<KcTeachingUnitContentThree>(pageNo, pageSize);
|
||||
IPage<KcTeachingUnitContentThree> 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<String> 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<String> 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<String> 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<String> 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<KcTeachingUnitContentThree> 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);
|
||||
// }
|
||||
|
||||
}
|
|
@ -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<KcTeachingUnitContentTwo, IKcTeachingUnitContentTwoService> {
|
||||
@Autowired
|
||||
private IKcTeachingUnitContentTwoService kcTeachingUnitContentTwoService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param kcTeachingUnitContentTwo
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "教学单元内容-第二层-分页列表查询")
|
||||
@ApiOperation(value="教学单元内容-第二层-分页列表查询", notes="教学单元内容-第二层-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<KcTeachingUnitContentTwo>> queryPageList(KcTeachingUnitContentTwo kcTeachingUnitContentTwo,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<KcTeachingUnitContentTwo> queryWrapper = QueryGenerator.initQueryWrapper(kcTeachingUnitContentTwo, req.getParameterMap());
|
||||
Page<KcTeachingUnitContentTwo> page = new Page<KcTeachingUnitContentTwo>(pageNo, pageSize);
|
||||
IPage<KcTeachingUnitContentTwo> 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<String> 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<String> 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<String> 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<String> 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<KcTeachingUnitContentTwo> 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);
|
||||
// }
|
||||
|
||||
}
|
|
@ -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<KcTeachingUnitContentTwo> childrenList;
|
||||
}
|
|
@ -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;
|
||||
}
|
|
@ -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<KcTeachingUnitContentThree> childrenList;
|
||||
|
||||
}
|
|
@ -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<KcTeachingUnitContentOne> {
|
||||
|
||||
}
|
|
@ -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<KcTeachingUnitContentThree> {
|
||||
|
||||
}
|
|
@ -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<KcTeachingUnitContentTwo> {
|
||||
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.jeecg.modules.kc.teachingunitcontent.mapper.KcTeachingUnitContentOneMapper">
|
||||
|
||||
</mapper>
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.jeecg.modules.kc.teachingunitcontent.mapper.KcTeachingUnitContentThreeMapper">
|
||||
|
||||
</mapper>
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.jeecg.modules.kc.teachingunitcontent.mapper.KcTeachingUnitContentTwoMapper">
|
||||
|
||||
</mapper>
|
|
@ -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<KcTeachingUnitContentOne> {
|
||||
|
||||
void saveAll(KcTeachingUnitContentSave teachingUnitContentSave);
|
||||
|
||||
void updateAllById(KcTeachingUnitContentSave teachingUnitContentSave);
|
||||
}
|
|
@ -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<KcTeachingUnitContentThree> {
|
||||
|
||||
}
|
|
@ -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<KcTeachingUnitContentTwo> {
|
||||
|
||||
}
|
|
@ -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<KcTeachingUnitContentOneMapper, KcTeachingUnitContentOne> 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<KcTeachingUnitContentOne> oneQw = new QueryWrapper<>();
|
||||
oneQw.lambda().eq(KcTeachingUnitContentOne::getXqxn, xqxn);
|
||||
oneQw.lambda().eq(KcTeachingUnitContentOne::getRwbh, rwbh);
|
||||
QueryWrapper<KcTeachingUnitContentTwo> twoQw = new QueryWrapper<>();
|
||||
twoQw.lambda().eq(KcTeachingUnitContentTwo::getXqxn, xqxn);
|
||||
twoQw.lambda().eq(KcTeachingUnitContentTwo::getRwbh, rwbh);
|
||||
QueryWrapper<KcTeachingUnitContentThree> 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);
|
||||
}
|
||||
}
|
|
@ -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<KcTeachingUnitContentThreeMapper, KcTeachingUnitContentThree> implements IKcTeachingUnitContentThreeService {
|
||||
|
||||
}
|
|
@ -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<KcTeachingUnitContentTwoMapper, KcTeachingUnitContentTwo> implements IKcTeachingUnitContentTwoService {
|
||||
|
||||
}
|
|
@ -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<KcTeachingUnitContentOne> teachingUnitContentOneList;
|
||||
}
|
Loading…
Reference in New Issue