From 5367a251309d68d0b27fa4ddf0765288b938b1ff Mon Sep 17 00:00:00 2001 From: wsm <2746563060@qq.com> Date: Mon, 17 Aug 2026 16:46:54 +0800 Subject: [PATCH] =?UTF-8?q?chore(supervision):=20=E5=88=A0=E9=99=A4=20src/?= =?UTF-8?q?test=20=E4=B8=8B=E8=AF=AF=E6=94=BE=E7=9A=84=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E7=94=9F=E6=88=90=E5=99=A8=E8=84=9A=E6=89=8B=E6=9E=B6=E6=96=87?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/TestMainTableController.java | 270 ------------------ .../src/test/entity/TestMainTable.java | 65 ----- .../src/test/entity/TestSonTable.java | 62 ---- .../src/test/mapper/TestMainTableMapper.java | 17 -- .../src/test/mapper/TestSonTableMapper.java | 31 -- .../test/mapper/xml/TestMainTableMapper.xml | 5 - .../test/mapper/xml/TestSonTableMapper.xml | 16 -- .../test/service/ITestMainTableService.java | 48 ---- .../test/service/ITestSonTableService.java | 22 -- .../impl/TestMainTableServiceImpl.java | 82 ------ .../service/impl/TestSonTableServiceImpl.java | 27 -- .../src/test/vo/TestMainTablePage.java | 64 ----- .../src/test/vue3/TestMainTable.api.ts | 71 ----- .../src/test/vue3/TestMainTable.data.ts | 81 ------ .../src/test/vue3/TestMainTableList.vue | 207 -------------- .../vue3/components/TestMainTableForm.vue | 115 -------- .../vue3/components/TestMainTableModal.vue | 144 ---------- .../test/vue3/components/TestSonTableForm.vue | 79 ----- 18 files changed, 1406 deletions(-) delete mode 100644 jeecg-module-supervision/src/test/controller/TestMainTableController.java delete mode 100644 jeecg-module-supervision/src/test/entity/TestMainTable.java delete mode 100644 jeecg-module-supervision/src/test/entity/TestSonTable.java delete mode 100644 jeecg-module-supervision/src/test/mapper/TestMainTableMapper.java delete mode 100644 jeecg-module-supervision/src/test/mapper/TestSonTableMapper.java delete mode 100644 jeecg-module-supervision/src/test/mapper/xml/TestMainTableMapper.xml delete mode 100644 jeecg-module-supervision/src/test/mapper/xml/TestSonTableMapper.xml delete mode 100644 jeecg-module-supervision/src/test/service/ITestMainTableService.java delete mode 100644 jeecg-module-supervision/src/test/service/ITestSonTableService.java delete mode 100644 jeecg-module-supervision/src/test/service/impl/TestMainTableServiceImpl.java delete mode 100644 jeecg-module-supervision/src/test/service/impl/TestSonTableServiceImpl.java delete mode 100644 jeecg-module-supervision/src/test/vo/TestMainTablePage.java delete mode 100644 jeecg-module-supervision/src/test/vue3/TestMainTable.api.ts delete mode 100644 jeecg-module-supervision/src/test/vue3/TestMainTable.data.ts delete mode 100644 jeecg-module-supervision/src/test/vue3/TestMainTableList.vue delete mode 100644 jeecg-module-supervision/src/test/vue3/components/TestMainTableForm.vue delete mode 100644 jeecg-module-supervision/src/test/vue3/components/TestMainTableModal.vue delete mode 100644 jeecg-module-supervision/src/test/vue3/components/TestSonTableForm.vue diff --git a/jeecg-module-supervision/src/test/controller/TestMainTableController.java b/jeecg-module-supervision/src/test/controller/TestMainTableController.java deleted file mode 100644 index 5cf41b6..0000000 --- a/jeecg-module-supervision/src/test/controller/TestMainTableController.java +++ /dev/null @@ -1,270 +0,0 @@ -package org.jeecg.modules.test.controller; - -import java.io.UnsupportedEncodingException; -import java.io.IOException; -import java.net.URLDecoder; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; -import java.util.HashMap; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -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.vo.LoginUser; -import org.apache.shiro.SecurityUtils; -import org.jeecg.common.api.vo.Result; -import org.jeecg.common.system.query.QueryGenerator; -import org.jeecg.common.system.query.QueryRuleEnum; -import org.jeecg.common.util.oConvertUtils; -import org.jeecg.modules.test.entity.TestSonTable; -import org.jeecg.modules.test.entity.TestMainTable; -import org.jeecg.modules.test.vo.TestMainTablePage; -import org.jeecg.modules.test.service.ITestMainTableService; -import org.jeecg.modules.test.service.ITestSonTableService; -import org.springframework.beans.BeanUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.servlet.ModelAndView; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.multipart.MultipartHttpServletRequest; -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 com.alibaba.fastjson.JSON; -import io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.Operation; -import org.jeecg.common.aspect.annotation.AutoLog; -import org.apache.shiro.authz.annotation.RequiresPermissions; - - - /** - * @Description: test - * @Author: jeecg-boot - * @Date: 2026-04-03 - * @Version: V1.0 - */ -@Tag(name="test") -@RestController -@RequestMapping("/test/testMainTable") -@Slf4j -public class TestMainTableController { - @Autowired - private ITestMainTableService testMainTableService; - @Autowired - private ITestSonTableService testSonTableService; - - /** - * 分页列表查询 - * - * @param testMainTable - * @param pageNo - * @param pageSize - * @param req - * @return - */ - //@AutoLog(value = "test-分页列表查询") - @Operation(summary="test-分页列表查询") - @GetMapping(value = "/list") - public Result> queryPageList(TestMainTable testMainTable, - @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, - @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, - HttpServletRequest req) { - QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(testMainTable, req.getParameterMap()); - Page page = new Page(pageNo, pageSize); - IPage pageList = testMainTableService.page(page, queryWrapper); - return Result.OK(pageList); - } - - /** - * 添加 - * - * @param testMainTablePage - * @return - */ - @AutoLog(value = "test-添加") - @Operation(summary="test-添加") - @RequiresPermissions("test:test_main_table:add") - @PostMapping(value = "/add") - public Result add(@RequestBody TestMainTablePage testMainTablePage) { - TestMainTable testMainTable = new TestMainTable(); - BeanUtils.copyProperties(testMainTablePage, testMainTable); - testMainTableService.saveMain(testMainTable, testMainTablePage.getTestSonTableList()); - return Result.OK("添加成功!"); - } - - /** - * 编辑 - * - * @param testMainTablePage - * @return - */ - @AutoLog(value = "test-编辑") - @Operation(summary="test-编辑") - @RequiresPermissions("test:test_main_table:edit") - @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) - public Result edit(@RequestBody TestMainTablePage testMainTablePage) { - TestMainTable testMainTable = new TestMainTable(); - BeanUtils.copyProperties(testMainTablePage, testMainTable); - TestMainTable testMainTableEntity = testMainTableService.getById(testMainTable.getId()); - if(testMainTableEntity==null) { - return Result.error("未找到对应数据"); - } - testMainTableService.updateMain(testMainTable, testMainTablePage.getTestSonTableList()); - return Result.OK("编辑成功!"); - } - - /** - * 通过id删除 - * - * @param id - * @return - */ - @AutoLog(value = "test-通过id删除") - @Operation(summary="test-通过id删除") - @RequiresPermissions("test:test_main_table:delete") - @DeleteMapping(value = "/delete") - public Result delete(@RequestParam(name="id",required=true) String id) { - testMainTableService.delMain(id); - return Result.OK("删除成功!"); - } - - /** - * 批量删除 - * - * @param ids - * @return - */ - @AutoLog(value = "test-批量删除") - @Operation(summary="test-批量删除") - @RequiresPermissions("test:test_main_table:deleteBatch") - @DeleteMapping(value = "/deleteBatch") - public Result deleteBatch(@RequestParam(name="ids",required=true) String ids) { - this.testMainTableService.delBatchMain(Arrays.asList(ids.split(","))); - return Result.OK("批量删除成功!"); - } - - /** - * 通过id查询 - * - * @param id - * @return - */ - //@AutoLog(value = "test-通过id查询") - @Operation(summary="test-通过id查询") - @GetMapping(value = "/queryById") - public Result queryById(@RequestParam(name="id",required=true) String id) { - TestMainTable testMainTable = testMainTableService.getById(id); - if(testMainTable==null) { - return Result.error("未找到对应数据"); - } - return Result.OK(testMainTable); - - } - - /** - * 通过id查询 - * - * @param id - * @return - */ - //@AutoLog(value = "test通过主表ID查询") - @Operation(summary="test主表ID查询") - @GetMapping(value = "/queryTestSonTableByMainId") - public Result> queryTestSonTableListByMainId(@RequestParam(name="id",required=true) String id) { - List testSonTableList = testSonTableService.selectByMainId(id); - return Result.OK(testSonTableList); - } - - /** - * 导出excel - * - * @param request - * @param testMainTable - */ - @RequiresPermissions("test:test_main_table:exportXls") - @RequestMapping(value = "/exportXls") - public ModelAndView exportXls(HttpServletRequest request, TestMainTable testMainTable) { - - // Step.1 组装查询条件查询数据 - QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(testMainTable, request.getParameterMap()); - LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); - - //配置选中数据查询条件 - String selections = request.getParameter("selections"); - if(oConvertUtils.isNotEmpty(selections)) { - List selectionList = Arrays.asList(selections.split(",")); - queryWrapper.in("id",selectionList); - } - //Step.2 获取导出数据 - List testMainTableList = testMainTableService.list(queryWrapper); - - // Step.3 组装pageList - List pageList = new ArrayList(); - for (TestMainTable main : testMainTableList) { - TestMainTablePage vo = new TestMainTablePage(); - BeanUtils.copyProperties(main, vo); - List testSonTableList = testSonTableService.selectByMainId(main.getId()); - vo.setTestSonTableList(testSonTableList); - pageList.add(vo); - } - - // Step.4 AutoPoi 导出Excel - ModelAndView mv = new ModelAndView(new JeecgEntityExcelView()); - mv.addObject(NormalExcelConstants.FILE_NAME, "test列表"); - mv.addObject(NormalExcelConstants.CLASS, TestMainTablePage.class); - mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("test数据", "导出人:"+sysUser.getRealname(), "test")); - mv.addObject(NormalExcelConstants.DATA_LIST, pageList); - return mv; - } - - /** - * 通过excel导入数据 - * - * @param request - * @param response - * @return - */ - @RequiresPermissions("test:test_main_table:importExcel") - @RequestMapping(value = "/importExcel", method = RequestMethod.POST) - public Result importExcel(HttpServletRequest request, HttpServletResponse response) { - MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; - Map fileMap = multipartRequest.getFileMap(); - for (Map.Entry entity : fileMap.entrySet()) { - // 获取上传文件对象 - MultipartFile file = entity.getValue(); - ImportParams params = new ImportParams(); - params.setTitleRows(2); - params.setHeadRows(1); - params.setNeedSave(true); - try { - List list = ExcelImportUtil.importExcel(file.getInputStream(), TestMainTablePage.class, params); - for (TestMainTablePage page : list) { - TestMainTable po = new TestMainTable(); - BeanUtils.copyProperties(page, po); - testMainTableService.saveMain(po, page.getTestSonTableList()); - } - return Result.OK("文件导入成功!数据行数:" + list.size()); - } catch (Exception e) { - log.error(e.getMessage(),e); - return Result.error("文件导入失败:"+e.getMessage()); - } finally { - try { - file.getInputStream().close(); - } catch (IOException e) { - e.printStackTrace(); - } - } - } - return Result.OK("文件导入失败!"); - } - -} diff --git a/jeecg-module-supervision/src/test/entity/TestMainTable.java b/jeecg-module-supervision/src/test/entity/TestMainTable.java deleted file mode 100644 index cb498e0..0000000 --- a/jeecg-module-supervision/src/test/entity/TestMainTable.java +++ /dev/null @@ -1,65 +0,0 @@ -package org.jeecg.modules.test.entity; - -import java.io.Serializable; -import java.io.UnsupportedEncodingException; -import java.util.Date; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import com.baomidou.mybatisplus.annotation.TableLogic; -import org.jeecg.common.constant.ProvinceCityArea; -import org.jeecg.common.util.SpringContextUtils; -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.v3.oas.annotations.media.Schema; - -/** - * @Description: test - * @Author: jeecg-boot - * @Date: 2026-04-03 - * @Version: V1.0 - */ -@Schema(description="test") -@Data -@TableName("test_main_table") -public class TestMainTable implements Serializable { - private static final long serialVersionUID = 1L; - - /**主键*/ - @TableId(type = IdType.ASSIGN_ID) - @Schema(description = "主键") - private java.lang.String id; - /**创建人*/ - @Schema(description = "创建人") - private java.lang.String createBy; - /**创建日期*/ - @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") - @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") - @Schema(description = "创建日期") - private java.util.Date createTime; - /**更新人*/ - @Schema(description = "更新人") - private java.lang.String updateBy; - /**更新日期*/ - @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") - @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") - @Schema(description = "更新日期") - private java.util.Date updateTime; - /**所属部门*/ - @Schema(description = "所属部门") - private java.lang.String sysOrgCode; - /**a字段*/ - @Excel(name = "a字段", width = 15) - @Schema(description = "a字段") - private java.lang.String fieldA; - /**b字段*/ - @Excel(name = "b字段", width = 15) - @Schema(description = "b字段") - private java.lang.String fieldB; - @TableLogic(value = "0", delval = "1") - private int delFlag = 0; -} diff --git a/jeecg-module-supervision/src/test/entity/TestSonTable.java b/jeecg-module-supervision/src/test/entity/TestSonTable.java deleted file mode 100644 index 0895b9e..0000000 --- a/jeecg-module-supervision/src/test/entity/TestSonTable.java +++ /dev/null @@ -1,62 +0,0 @@ -package org.jeecg.modules.test.entity; - -import java.io.Serializable; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import com.baomidou.mybatisplus.annotation.TableLogic; -import org.jeecg.common.constant.ProvinceCityArea; -import org.jeecg.common.util.SpringContextUtils; -import lombok.Data; -import com.fasterxml.jackson.annotation.JsonFormat; -import org.springframework.format.annotation.DateTimeFormat; -import org.jeecgframework.poi.excel.annotation.Excel; -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import java.io.UnsupportedEncodingException; - -/** - * @Description: test - * @Author: jeecg-boot - * @Date: 2026-04-03 - * @Version: V1.0 - */ -@Schema(description="test") -@Data -@TableName("test_son_table") -public class TestSonTable implements Serializable { - private static final long serialVersionUID = 1L; - - /**主键*/ - @TableId(type = IdType.ASSIGN_ID) - @Schema(description = "主键") - private java.lang.String id; - /**创建人*/ - @Schema(description = "创建人") - private java.lang.String createBy; - /**创建日期*/ - @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") - @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") - @Schema(description = "创建日期") - private java.util.Date createTime; - /**更新人*/ - @Schema(description = "更新人") - private java.lang.String updateBy; - /**更新日期*/ - @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") - @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") - @Schema(description = "更新日期") - private java.util.Date updateTime; - /**所属部门*/ - @Schema(description = "所属部门") - private java.lang.String sysOrgCode; - /**字段c*/ - @Excel(name = "字段c", width = 15) - @Schema(description = "字段c") - private java.lang.String fieldC; - /**主表id*/ - @Schema(description = "主表id") - private java.lang.String mainTableId; - @TableLogic(value = "0", delval = "1") - private int delFlag = 0; -} diff --git a/jeecg-module-supervision/src/test/mapper/TestMainTableMapper.java b/jeecg-module-supervision/src/test/mapper/TestMainTableMapper.java deleted file mode 100644 index bf1dbc7..0000000 --- a/jeecg-module-supervision/src/test/mapper/TestMainTableMapper.java +++ /dev/null @@ -1,17 +0,0 @@ -package org.jeecg.modules.test.mapper; - -import java.util.List; - -import org.apache.ibatis.annotations.Param; -import org.jeecg.modules.test.entity.TestMainTable; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; - -/** - * @Description: test - * @Author: jeecg-boot - * @Date: 2026-04-03 - * @Version: V1.0 - */ -public interface TestMainTableMapper extends BaseMapper { - -} diff --git a/jeecg-module-supervision/src/test/mapper/TestSonTableMapper.java b/jeecg-module-supervision/src/test/mapper/TestSonTableMapper.java deleted file mode 100644 index ee502e6..0000000 --- a/jeecg-module-supervision/src/test/mapper/TestSonTableMapper.java +++ /dev/null @@ -1,31 +0,0 @@ -package org.jeecg.modules.test.mapper; - -import java.util.List; -import org.jeecg.modules.test.entity.TestSonTable; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.apache.ibatis.annotations.Param; - -/** - * @Description: test - * @Author: jeecg-boot - * @Date: 2026-04-03 - * @Version: V1.0 - */ -public interface TestSonTableMapper extends BaseMapper { - - /** - * 通过主表id删除子表数据 - * - * @param mainId 主表id - * @return boolean - */ - public boolean deleteByMainId(@Param("mainId") String mainId); - - /** - * 通过主表id查询子表数据 - * - * @param mainId 主表id - * @return List - */ - public List selectByMainId(@Param("mainId") String mainId); -} diff --git a/jeecg-module-supervision/src/test/mapper/xml/TestMainTableMapper.xml b/jeecg-module-supervision/src/test/mapper/xml/TestMainTableMapper.xml deleted file mode 100644 index 3954740..0000000 --- a/jeecg-module-supervision/src/test/mapper/xml/TestMainTableMapper.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/jeecg-module-supervision/src/test/mapper/xml/TestSonTableMapper.xml b/jeecg-module-supervision/src/test/mapper/xml/TestSonTableMapper.xml deleted file mode 100644 index 87ca9ba..0000000 --- a/jeecg-module-supervision/src/test/mapper/xml/TestSonTableMapper.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - DELETE - FROM test_son_table - WHERE - main_table_id = #{mainId} - - - diff --git a/jeecg-module-supervision/src/test/service/ITestMainTableService.java b/jeecg-module-supervision/src/test/service/ITestMainTableService.java deleted file mode 100644 index e84b5be..0000000 --- a/jeecg-module-supervision/src/test/service/ITestMainTableService.java +++ /dev/null @@ -1,48 +0,0 @@ -package org.jeecg.modules.test.service; - -import org.jeecg.modules.test.entity.TestSonTable; -import org.jeecg.modules.test.entity.TestMainTable; -import com.baomidou.mybatisplus.extension.service.IService; -import java.io.Serializable; -import java.util.Collection; -import java.util.List; - -/** - * @Description: test - * @Author: jeecg-boot - * @Date: 2026-04-03 - * @Version: V1.0 - */ -public interface ITestMainTableService extends IService { - - /** - * 添加一对多 - * - * @param testMainTable - * @param testSonTableList - */ - public void saveMain(TestMainTable testMainTable,List testSonTableList) ; - - /** - * 修改一对多 - * - * @param testMainTable - * @param testSonTableList - */ - public void updateMain(TestMainTable testMainTable,List testSonTableList); - - /** - * 删除一对多 - * - * @param id - */ - public void delMain (String id); - - /** - * 批量删除一对多 - * - * @param idList - */ - public void delBatchMain (Collection idList); - -} diff --git a/jeecg-module-supervision/src/test/service/ITestSonTableService.java b/jeecg-module-supervision/src/test/service/ITestSonTableService.java deleted file mode 100644 index c171ce5..0000000 --- a/jeecg-module-supervision/src/test/service/ITestSonTableService.java +++ /dev/null @@ -1,22 +0,0 @@ -package org.jeecg.modules.test.service; - -import org.jeecg.modules.test.entity.TestSonTable; -import com.baomidou.mybatisplus.extension.service.IService; -import java.util.List; - -/** - * @Description: test - * @Author: jeecg-boot - * @Date: 2026-04-03 - * @Version: V1.0 - */ -public interface ITestSonTableService extends IService { - - /** - * 通过主表id查询子表数据 - * - * @param mainId 主表id - * @return List - */ - public List selectByMainId(String mainId); -} diff --git a/jeecg-module-supervision/src/test/service/impl/TestMainTableServiceImpl.java b/jeecg-module-supervision/src/test/service/impl/TestMainTableServiceImpl.java deleted file mode 100644 index bc65fbf..0000000 --- a/jeecg-module-supervision/src/test/service/impl/TestMainTableServiceImpl.java +++ /dev/null @@ -1,82 +0,0 @@ -package org.jeecg.modules.test.service.impl; - -import org.jeecg.common.aspect.annotation.CascadeDelete; -import org.jeecg.common.aspect.annotation.SonTable; -import org.jeecg.modules.test.entity.TestMainTable; -import org.jeecg.modules.test.entity.TestSonTable; -import org.jeecg.modules.test.mapper.TestSonTableMapper; -import org.jeecg.modules.test.mapper.TestMainTableMapper; -import org.jeecg.modules.test.service.ITestMainTableService; -import org.springframework.stereotype.Service; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.transaction.annotation.Transactional; -import java.io.Serializable; -import java.util.List; -import java.util.Collection; - -/** - * @Description: test - * @Author: jeecg-boot - * @Date: 2026-04-03 - * @Version: V1.0 - */ -@Service -public class TestMainTableServiceImpl extends ServiceImpl implements ITestMainTableService { - - @Autowired - private TestMainTableMapper testMainTableMapper; - @Autowired - private TestSonTableMapper testSonTableMapper; - - @Override - @Transactional(rollbackFor = Exception.class) - public void saveMain(TestMainTable testMainTable, List testSonTableList) { - testMainTableMapper.insert(testMainTable); - if(testSonTableList!=null && testSonTableList.size()>0) { - for(TestSonTable entity:testSonTableList) { - //外键设置 - entity.setMainTableId(testMainTable.getId()); - testSonTableMapper.insert(entity); - } - } - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void updateMain(TestMainTable testMainTable,List testSonTableList) { - testMainTableMapper.updateById(testMainTable); - - //1.先删除子表数据 - testSonTableMapper.deleteByMainId(testMainTable.getId()); - - //2.子表数据重新插入 - if(testSonTableList!=null && testSonTableList.size()>0) { - for(TestSonTable entity:testSonTableList) { - //外键设置 - entity.setMainTableId(testMainTable.getId()); - testSonTableMapper.insert(entity); - } - } - } - - @Override - @Transactional(rollbackFor = Exception.class) - @CascadeDelete(sons = { - // 配置子表1:Mapper类 + 子表中关联主表的字段名 - @SonTable(mapper = TestSonTableMapper.class, joinColumn = "main_table_id"), - }) - public void delMain(String id) { - testMainTableMapper.deleteById(id); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void delBatchMain(Collection idList) { - for(Serializable id:idList) { - testSonTableMapper.deleteByMainId(id.toString()); - testMainTableMapper.deleteById(id); - } - } - -} diff --git a/jeecg-module-supervision/src/test/service/impl/TestSonTableServiceImpl.java b/jeecg-module-supervision/src/test/service/impl/TestSonTableServiceImpl.java deleted file mode 100644 index 3bfc3c6..0000000 --- a/jeecg-module-supervision/src/test/service/impl/TestSonTableServiceImpl.java +++ /dev/null @@ -1,27 +0,0 @@ -package org.jeecg.modules.test.service.impl; - -import org.jeecg.modules.test.entity.TestSonTable; -import org.jeecg.modules.test.mapper.TestSonTableMapper; -import org.jeecg.modules.test.service.ITestSonTableService; -import org.springframework.stereotype.Service; -import java.util.List; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import org.springframework.beans.factory.annotation.Autowired; - -/** - * @Description: test - * @Author: jeecg-boot - * @Date: 2026-04-03 - * @Version: V1.0 - */ -@Service -public class TestSonTableServiceImpl extends ServiceImpl implements ITestSonTableService { - - @Autowired - private TestSonTableMapper testSonTableMapper; - - @Override - public List selectByMainId(String mainId) { - return testSonTableMapper.selectByMainId(mainId); - } -} diff --git a/jeecg-module-supervision/src/test/vo/TestMainTablePage.java b/jeecg-module-supervision/src/test/vo/TestMainTablePage.java deleted file mode 100644 index ac9359e..0000000 --- a/jeecg-module-supervision/src/test/vo/TestMainTablePage.java +++ /dev/null @@ -1,64 +0,0 @@ -package org.jeecg.modules.test.vo; - -import java.util.List; -import org.jeecg.modules.test.entity.TestMainTable; -import org.jeecg.modules.test.entity.TestSonTable; -import lombok.Data; -import org.jeecgframework.poi.excel.annotation.Excel; -import org.jeecgframework.poi.excel.annotation.ExcelEntity; -import org.jeecgframework.poi.excel.annotation.ExcelCollection; -import com.fasterxml.jackson.annotation.JsonFormat; -import org.springframework.format.annotation.DateTimeFormat; -import java.util.Date; -import org.jeecg.common.aspect.annotation.Dict; -import org.jeecg.common.constant.ProvinceCityArea; -import org.jeecg.common.util.SpringContextUtils; - -import io.swagger.v3.oas.annotations.media.Schema; - -/** - * @Description: test - * @Author: jeecg-boot - * @Date: 2026-04-03 - * @Version: V1.0 - */ -@Data -@Schema(description="test") -public class TestMainTablePage { - - /**主键*/ - @Schema(description = "主键") - private java.lang.String id; - /**创建人*/ - @Schema(description = "创建人") - private java.lang.String createBy; - /**创建日期*/ - @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") - @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") - @Schema(description = "创建日期") - private java.util.Date createTime; - /**更新人*/ - @Schema(description = "更新人") - private java.lang.String updateBy; - /**更新日期*/ - @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") - @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") - @Schema(description = "更新日期") - private java.util.Date updateTime; - /**所属部门*/ - @Schema(description = "所属部门") - private java.lang.String sysOrgCode; - /**a字段*/ - @Excel(name = "a字段", width = 15) - @Schema(description = "a字段") - private java.lang.String fieldA; - /**b字段*/ - @Excel(name = "b字段", width = 15) - @Schema(description = "b字段") - private java.lang.String fieldB; - - @ExcelCollection(name="test") - @Schema(description = "test") - private List testSonTableList; - -} diff --git a/jeecg-module-supervision/src/test/vue3/TestMainTable.api.ts b/jeecg-module-supervision/src/test/vue3/TestMainTable.api.ts deleted file mode 100644 index c985263..0000000 --- a/jeecg-module-supervision/src/test/vue3/TestMainTable.api.ts +++ /dev/null @@ -1,71 +0,0 @@ -import {defHttp} from '/@/utils/http/axios'; -import { useMessage } from "/@/hooks/web/useMessage"; - -const { createConfirm } = useMessage(); - -enum Api { - list = '/test/testMainTable/list', - save='/test/testMainTable/add', - edit='/test/testMainTable/edit', - deleteOne = '/test/testMainTable/delete', - deleteBatch = '/test/testMainTable/deleteBatch', - importExcel = '/test/testMainTable/importExcel', - exportXls = '/test/testMainTable/exportXls', - testSonTableList = '/test/testMainTable/queryTestSonTableByMainId', -} -/** - * 导出api - * @param params - */ -export const getExportUrl = Api.exportXls; - -/** - * 导入api - */ -export const getImportUrl = Api.importExcel; -/** - * 查询子表数据 - * @param params - */ -export const testSonTableList = Api.testSonTableList; -/** - * 列表接口 - * @param params - */ -export const list = (params) => - defHttp.get({url: Api.list, params}); - -/** - * 删除单个 - */ -export const deleteOne = (params,handleSuccess) => { - return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => { - handleSuccess(); - }); -} -/** - * 批量删除 - * @param params - */ -export const batchDelete = (params, handleSuccess) => { - createConfirm({ - iconType: 'warning', - title: '确认删除', - content: '是否删除选中数据', - okText: '确认', - cancelText: '取消', - onOk: () => { - return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => { - handleSuccess(); - }); - } - }); -} -/** - * 保存或者更新 - * @param params - */ -export const saveOrUpdate = (params, isUpdate) => { - let url = isUpdate ? Api.edit : Api.save; - return defHttp.post({url: url, params}); -} diff --git a/jeecg-module-supervision/src/test/vue3/TestMainTable.data.ts b/jeecg-module-supervision/src/test/vue3/TestMainTable.data.ts deleted file mode 100644 index 6306a78..0000000 --- a/jeecg-module-supervision/src/test/vue3/TestMainTable.data.ts +++ /dev/null @@ -1,81 +0,0 @@ -import {BasicColumn} from '/@/components/Table'; -import {FormSchema} from '/@/components/Table'; -import { rules} from '/@/utils/helper/validator'; -import { render } from '/@/utils/common/renderUtils'; -import {JVxeTypes,JVxeColumn} from '/@/components/jeecg/JVxeTable/types' -import { getWeekMonthQuarterYear } from '/@/utils'; -//列表数据 -export const columns: BasicColumn[] = [ - { - title: 'a字段', - align:"center", - dataIndex: 'fieldA' - }, - { - title: 'b字段', - align:"center", - dataIndex: 'fieldB' - }, -]; -//查询数据 -export const searchFormSchema: FormSchema[] = [ -]; -//表单数据 -export const formSchema: FormSchema[] = [ - { - label: 'a字段', - field: 'fieldA', - component: 'Input', - }, - { - label: 'b字段', - field: 'fieldB', - component: 'Input', - }, - // TODO 主键隐藏字段,目前写死为ID - { - label: '', - field: 'id', - component: 'Input', - show: false - }, -]; -//子表单数据 -export const testSonTableFormSchema: FormSchema[] = [ - { - label: '字段c', - field: 'fieldC', - component: 'Input', - }, - { - label: '', - field: 'id', - component: 'Input', - show: false - }, -]; -//子表表格配置 - - -// 高级查询数据 -export const superQuerySchema = { - fieldA: {title: 'a字段',order: 0,view: 'text', type: 'string',}, - fieldB: {title: 'b字段',order: 1,view: 'text', type: 'string',}, - //子表高级查询 - testSonTable: { - title: 'test', - view: 'table', - fields: { - fieldC: {title: '字段c',order: 0,view: 'text', type: 'string',}, - } - }, -}; - -/** -* 流程表单调用这个方法获取formSchema -* @param param -*/ -export function getBpmFormSchema(_formData): FormSchema[]{ -// 默认和原始表单保持一致 如果流程中配置了权限数据,这里需要单独处理formSchema - return formSchema; -} \ No newline at end of file diff --git a/jeecg-module-supervision/src/test/vue3/TestMainTableList.vue b/jeecg-module-supervision/src/test/vue3/TestMainTableList.vue deleted file mode 100644 index 27991f5..0000000 --- a/jeecg-module-supervision/src/test/vue3/TestMainTableList.vue +++ /dev/null @@ -1,207 +0,0 @@ - - - - - \ No newline at end of file diff --git a/jeecg-module-supervision/src/test/vue3/components/TestMainTableForm.vue b/jeecg-module-supervision/src/test/vue3/components/TestMainTableForm.vue deleted file mode 100644 index 0886b2c..0000000 --- a/jeecg-module-supervision/src/test/vue3/components/TestMainTableForm.vue +++ /dev/null @@ -1,115 +0,0 @@ - - - \ No newline at end of file diff --git a/jeecg-module-supervision/src/test/vue3/components/TestMainTableModal.vue b/jeecg-module-supervision/src/test/vue3/components/TestMainTableModal.vue deleted file mode 100644 index 58c3627..0000000 --- a/jeecg-module-supervision/src/test/vue3/components/TestMainTableModal.vue +++ /dev/null @@ -1,144 +0,0 @@ - - - - - \ No newline at end of file diff --git a/jeecg-module-supervision/src/test/vue3/components/TestSonTableForm.vue b/jeecg-module-supervision/src/test/vue3/components/TestSonTableForm.vue deleted file mode 100644 index 15b1fe1..0000000 --- a/jeecg-module-supervision/src/test/vue3/components/TestSonTableForm.vue +++ /dev/null @@ -1,79 +0,0 @@ - - -