From 11e2020a7ebac516a9c103c5cced76c397acfd1b Mon Sep 17 00:00:00 2001 From: liao Date: Thu, 26 Oct 2023 18:16:13 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E8=B5=84=E6=96=99=E4=B8=AD=E5=BF=83-?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E5=A4=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/LawsAsmsOpenApiServiceImpl.java | 2 +- .../laws/common/util/CurrentUserUtil.java | 33 +++ .../LawsDataCenterFileController.java | 219 +++++++++--------- .../LawsDataCenterFolderController.java | 181 ++++++--------- .../entity/LawsDataCenterFolder.java | 97 +++++--- .../mapper/LawsDataCenterFolderMapper.java | 10 + .../mapper/xml/LawsDataCenterFolderMapper.xml | 10 + .../service/ILawsDataCenterFolderService.java | 43 +--- .../impl/LawsDataCenterFileServiceImpl.java | 7 +- .../impl/LawsDataCenterFolderServiceImpl.java | 72 ++---- 10 files changed, 322 insertions(+), 352 deletions(-) create mode 100644 laws-modules/src/main/java/com/jero/modules/laws/common/util/CurrentUserUtil.java diff --git a/laws-modules-docking/src/main/java/com/jero/modules/docking/asms/service/impl/LawsAsmsOpenApiServiceImpl.java b/laws-modules-docking/src/main/java/com/jero/modules/docking/asms/service/impl/LawsAsmsOpenApiServiceImpl.java index ee95df5e..3508c79b 100644 --- a/laws-modules-docking/src/main/java/com/jero/modules/docking/asms/service/impl/LawsAsmsOpenApiServiceImpl.java +++ b/laws-modules-docking/src/main/java/com/jero/modules/docking/asms/service/impl/LawsAsmsOpenApiServiceImpl.java @@ -118,7 +118,7 @@ public class LawsAsmsOpenApiServiceImpl extends ServiceImpl queryPage(LawsAsmsOpenApi lawsAsmsOpenApi, Integer pageNo, Integer pageSize, HttpServletRequest req) { QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(lawsAsmsOpenApi, req.getParameterMap()); - queryWrapper.orderByDesc("id"); + queryWrapper.orderByAsc("api_name"); Page page = new Page<>(pageNo, pageSize); return page(page, queryWrapper); } diff --git a/laws-modules/src/main/java/com/jero/modules/laws/common/util/CurrentUserUtil.java b/laws-modules/src/main/java/com/jero/modules/laws/common/util/CurrentUserUtil.java new file mode 100644 index 00000000..3b99d087 --- /dev/null +++ b/laws-modules/src/main/java/com/jero/modules/laws/common/util/CurrentUserUtil.java @@ -0,0 +1,33 @@ +package com.jero.modules.laws.common.util; + +import com.jero.common.system.vo.LoginUser; +import org.apache.shiro.SecurityUtils; + +/** + * @Author: liao + * @Date: 2023/10/26 16:55 + * @Description: 当前用户工具类 + */ +public class CurrentUserUtil { + + /** + * @Author: liao + * @Date: 2023/10/26 16:58 + * @Description: 获取当前用户id + **/ + public static String getId() { + LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + return loginUser.getId(); + } + + /** + * @Author: liao + * @Date: 2023/10/26 16:58 + * @Description: 获取当前用户名 + **/ + public static String getUsername() { + LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + return loginUser.getUsername(); + } + +} diff --git a/laws-modules/src/main/java/com/jero/modules/laws/dataCenter/controller/LawsDataCenterFileController.java b/laws-modules/src/main/java/com/jero/modules/laws/dataCenter/controller/LawsDataCenterFileController.java index 41cb1582..3d2e8aa9 100644 --- a/laws-modules/src/main/java/com/jero/modules/laws/dataCenter/controller/LawsDataCenterFileController.java +++ b/laws-modules/src/main/java/com/jero/modules/laws/dataCenter/controller/LawsDataCenterFileController.java @@ -5,7 +5,10 @@ import java.util.List; import java.util.Map; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; + import com.jero.common.api.vo.Result; +import com.jero.common.util.MessageUtils; +import com.jero.modules.laws.common.constant.ResultCommon; import com.jero.modules.laws.dataCenter.entity.LawsDataCenterFile; import com.jero.modules.laws.dataCenter.service.ILawsDataCenterFileService; import com.baomidou.mybatisplus.core.metadata.IPage; @@ -22,132 +25,132 @@ import org.apache.commons.lang3.StringUtils; import org.apache.poi.ss.formula.functions.T; - /** +/** * @Description: 资料中心-文件数据 * @Author: jero-boot - * @Date: 2023-10-26 + * @Date: 2023-10-26 * @Version: V1.0 */ -@Api(tags="资料中心-文件数据") +@Api(tags = "资料中心-文件数据") @RestController @RequestMapping("/laws/dataCenter/lawsDataCenterFile") @Slf4j public class LawsDataCenterFileController extends JeroController { - @Autowired - private ILawsDataCenterFileService lawsDataCenterFileService; - - /** - * 分页列表查询 - * - * @param lawsDataCenterFile - * @param pageNo - * @param pageSize - * @param req - * @return - */ - @AutoLog(value = "资料中心-文件数据-分页列表查询") - @ApiOperation(value="资料中心-文件数据-分页列表查询", notes="资料中心-文件数据-分页列表查询") - @GetMapping(value = "/page") - public Result> queryPageList(LawsDataCenterFile lawsDataCenterFile, - @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, - @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, - HttpServletRequest req) { - IPage pageList = lawsDataCenterFileService.queryPage(lawsDataCenterFile, pageNo, pageSize, req); - return Result.OK(pageList); - } + @Autowired + private ILawsDataCenterFileService lawsDataCenterFileService; /** - * 列表查询 - * - * @param lawsDataCenterFile - * @param req - * @return - */ - @AutoLog(value = "资料中心-文件数据-列表查询") - @ApiOperation(value="资料中心-文件数据-列表查询", notes="资料中心-文件数据-列表查询") - @GetMapping(value = "/list") - public Result> queryList(LawsDataCenterFile lawsDataCenterFile, HttpServletRequest req) { + * 分页列表查询 + * + * @param lawsDataCenterFile + * @param pageNo + * @param pageSize + * @param req + * @return + */ + @AutoLog(value = "资料中心-文件数据-分页列表查询") + @ApiOperation(value = "资料中心-文件数据-分页列表查询", notes = "资料中心-文件数据-分页列表查询") + @GetMapping(value = "/page") + public Result> queryPageList(LawsDataCenterFile lawsDataCenterFile, + @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, + HttpServletRequest req) { + IPage pageList = lawsDataCenterFileService.queryPage(lawsDataCenterFile, pageNo, pageSize, req); + return Result.OK(pageList); + } + + /** + * 列表查询 + * + * @param lawsDataCenterFile + * @param req + * @return + */ + @AutoLog(value = "资料中心-文件数据-列表查询") + @ApiOperation(value = "资料中心-文件数据-列表查询", notes = "资料中心-文件数据-列表查询") + @GetMapping(value = "/list") + public Result> queryList(LawsDataCenterFile lawsDataCenterFile, HttpServletRequest req) { List list = lawsDataCenterFileService.queryList(lawsDataCenterFile, req); return Result.OK(list); - } + } - /** - * 添加 - * - * @param lawsDataCenterFile - * @return - */ - @AutoLog(value = "资料中心-文件数据-添加") - @ApiOperation(value="资料中心-文件数据-添加", notes="资料中心-文件数据-添加") - @PostMapping(value = "/add") - public Result add(@Validated @RequestBody LawsDataCenterFile lawsDataCenterFile) { - lawsDataCenterFileService.add(lawsDataCenterFile); - return Result.OK("操作成功!"); - } + /** + * 添加 + * + * @param lawsDataCenterFile + * @return + */ + @AutoLog(value = "资料中心-文件数据-添加") + @ApiOperation(value = "资料中心-文件数据-添加", notes = "资料中心-文件数据-添加") + @PostMapping(value = "/add") + public Result add(@Validated @RequestBody LawsDataCenterFile lawsDataCenterFile) { + lawsDataCenterFileService.add(lawsDataCenterFile); + return Result.OK(MessageUtils.getMessage(ResultCommon.OK)); + } - /** - * 编辑 - * - * @param lawsDataCenterFile - * @return - */ - @AutoLog(value = "资料中心-文件数据-编辑") - @ApiOperation(value="资料中心-文件数据-编辑", notes="资料中心-文件数据-编辑") - @PostMapping(value = "/edit") - public Result edit(@Validated @RequestBody LawsDataCenterFile lawsDataCenterFile) { - lawsDataCenterFileService.editById(lawsDataCenterFile); - return Result.OK("操作成功!"); - } + /** + * 编辑 + * + * @param lawsDataCenterFile + * @return + */ + @AutoLog(value = "资料中心-文件数据-编辑") + @ApiOperation(value = "资料中心-文件数据-编辑", notes = "资料中心-文件数据-编辑") + @PostMapping(value = "/edit") + public Result edit(@Validated @RequestBody LawsDataCenterFile lawsDataCenterFile) { + lawsDataCenterFileService.editById(lawsDataCenterFile); + return Result.OK(MessageUtils.getMessage(ResultCommon.OK)); + } - /** - * 通过id删除 - * - * @param map - * @return - */ - @AutoLog(value = "资料中心-文件数据-通过id删除") - @ApiOperation(value="资料中心-文件数据-通过id删除", notes="资料中心-文件数据-通过id删除") - @PostMapping(value = "/delete") - public Result delete(@RequestBody Map map) { - if(!map.containsKey("id") || StringUtils.isEmpty(map.get("id"))){ + /** + * 通过id删除 + * + * @param map + * @return + */ + @AutoLog(value = "资料中心-文件数据-通过id删除") + @ApiOperation(value = "资料中心-文件数据-通过id删除", notes = "资料中心-文件数据-通过id删除") + @PostMapping(value = "/delete") + public Result delete(@RequestBody Map map) { + if (!map.containsKey("id") || StringUtils.isEmpty(map.get("id"))) { return Result.error("请选择数据!"); } - lawsDataCenterFileService.deleteById(map.get("id")); - return Result.OK("删除成功!"); - } + lawsDataCenterFileService.deleteById(map.get("id")); + return Result.OK(MessageUtils.getMessage(ResultCommon.OK)); + } - /** - * 批量删除 - * - * @param map - * @return - */ - @AutoLog(value = "资料中心-文件数据-批量删除") - @ApiOperation(value="资料中心-文件数据-批量删除", notes="资料中心-文件数据-批量删除") - @PostMapping(value = "/deleteBatch") - public Result deleteBatch(@RequestBody Map map) { - if(!map.containsKey("ids") || StringUtils.isEmpty(map.get("ids"))){ - return Result.error("请选择数据!"); - } - this.lawsDataCenterFileService.deleteByIds(Arrays.asList(map.get("ids").split(","))); - return Result.OK("批量删除成功!"); - } + /** + * 批量删除 + * + * @param map + * @return + */ + @AutoLog(value = "资料中心-文件数据-批量删除") + @ApiOperation(value = "资料中心-文件数据-批量删除", notes = "资料中心-文件数据-批量删除") + @PostMapping(value = "/deleteBatch") + public Result deleteBatch(@RequestBody Map map) { + if (!map.containsKey("ids") || StringUtils.isEmpty(map.get("ids"))) { + return Result.error("请选择数据!"); + } + this.lawsDataCenterFileService.deleteByIds(Arrays.asList(map.get("ids").split(","))); + return Result.OK(MessageUtils.getMessage(ResultCommon.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) { - LawsDataCenterFile lawsDataCenterFile = lawsDataCenterFileService.queryById(id); - if(lawsDataCenterFile==null) { - return Result.error("未找到对应数据"); - } - return Result.OK(lawsDataCenterFile); - } + /** + * 通过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) { + LawsDataCenterFile lawsDataCenterFile = lawsDataCenterFileService.queryById(id); + if (lawsDataCenterFile == null) { + return Result.error("未找到对应数据"); + } + return Result.OK(lawsDataCenterFile); + } } diff --git a/laws-modules/src/main/java/com/jero/modules/laws/dataCenter/controller/LawsDataCenterFolderController.java b/laws-modules/src/main/java/com/jero/modules/laws/dataCenter/controller/LawsDataCenterFolderController.java index c6f60327..ed1545ad 100644 --- a/laws-modules/src/main/java/com/jero/modules/laws/dataCenter/controller/LawsDataCenterFolderController.java +++ b/laws-modules/src/main/java/com/jero/modules/laws/dataCenter/controller/LawsDataCenterFolderController.java @@ -3,18 +3,18 @@ package com.jero.modules.laws.dataCenter.controller; import java.util.Arrays; import java.util.List; import java.util.Map; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; + import com.jero.common.api.vo.Result; +import com.jero.common.exception.JeroBootException; +import com.jero.common.util.MessageUtils; +import com.jero.modules.laws.common.constant.ResultCommon; import com.jero.modules.laws.dataCenter.entity.LawsDataCenterFolder; import com.jero.modules.laws.dataCenter.service.ILawsDataCenterFolderService; -import com.baomidou.mybatisplus.core.metadata.IPage; import lombok.extern.slf4j.Slf4j; import com.jero.common.system.base.controller.JeroController; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; -import org.springframework.web.servlet.ModelAndView; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import com.jero.common.aspect.annotation.AutoLog; @@ -22,132 +22,81 @@ import org.apache.commons.lang3.StringUtils; import org.apache.poi.ss.formula.functions.T; - /** +/** * @Description: 资料中心-文件夹 * @Author: jero-boot - * @Date: 2023-10-26 + * @Date: 2023-10-26 * @Version: V1.0 */ -@Api(tags="资料中心-文件夹") +@Api(tags = "资料中心-文件夹") @RestController @RequestMapping("/laws/dataCenter/lawsDataCenterFolder") @Slf4j public class LawsDataCenterFolderController extends JeroController { - @Autowired - private ILawsDataCenterFolderService lawsDataCenterFolderService; + @Autowired + private ILawsDataCenterFolderService lawsDataCenterFolderService; - /** - * 分页列表查询 - * - * @param lawsDataCenterFolder - * @param pageNo - * @param pageSize - * @param req - * @return - */ - @AutoLog(value = "资料中心-文件夹-分页列表查询") - @ApiOperation(value="资料中心-文件夹-分页列表查询", notes="资料中心-文件夹-分页列表查询") - @GetMapping(value = "/page") - public Result> queryPageList(LawsDataCenterFolder lawsDataCenterFolder, - @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, - @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, - HttpServletRequest req) { - IPage pageList = lawsDataCenterFolderService.queryPage(lawsDataCenterFolder, pageNo, pageSize, req); - return Result.OK(pageList); - } + @AutoLog(value = "资料中心-文件夹-获取树型列表") + @ApiOperation(value = "资料中心-文件夹-获取树型列表", notes = "资料中心-文件夹-获取树型列表") + @GetMapping(value = "/getTreeList") + public Result> getTreeList() { + List treeList = lawsDataCenterFolderService.getTreeList(); + return Result.OK(treeList); + } /** - * 列表查询 - * - * @param lawsDataCenterFolder - * @param req - * @return - */ - @AutoLog(value = "资料中心-文件夹-列表查询") - @ApiOperation(value="资料中心-文件夹-列表查询", notes="资料中心-文件夹-列表查询") - @GetMapping(value = "/list") - public Result> queryList(LawsDataCenterFolder lawsDataCenterFolder, HttpServletRequest req) { - List list = lawsDataCenterFolderService.queryList(lawsDataCenterFolder, req); - return Result.OK(list); - } + * 新增同级 + * + * @param lawsDataCenterFolder + * @return + */ + @AutoLog(value = "资料中心-文件夹-新增同级") + @ApiOperation(value = "资料中心-文件夹-新增同级", notes = "资料中心-文件夹-新增同级") + @PostMapping(value = "/addBrother") + public Result addBrother(@Validated @RequestBody LawsDataCenterFolder lawsDataCenterFolder) { + lawsDataCenterFolderService.add(lawsDataCenterFolder); + return Result.OK(MessageUtils.getMessage(ResultCommon.OK)); + } - /** - * 添加 - * - * @param lawsDataCenterFolder - * @return - */ - @AutoLog(value = "资料中心-文件夹-添加") - @ApiOperation(value="资料中心-文件夹-添加", notes="资料中心-文件夹-添加") - @PostMapping(value = "/add") - public Result add(@Validated @RequestBody LawsDataCenterFolder lawsDataCenterFolder) { - lawsDataCenterFolderService.add(lawsDataCenterFolder); - return Result.OK("操作成功!"); - } + @AutoLog(value = "资料中心-文件夹-新增子级") + @ApiOperation(value = "资料中心-文件夹-新增子级", notes = "资料中心-文件夹-新增子级") + @PostMapping(value = "/addChild") + public Result addChild(@Validated @RequestBody LawsDataCenterFolder lawsDataCenterFolder) { + if (StringUtils.isBlank(lawsDataCenterFolder.getParentId())) { + throw new JeroBootException(ResultCommon.EMPTY_COMMON, "parentId"); + } + lawsDataCenterFolderService.add(lawsDataCenterFolder); + return Result.OK(MessageUtils.getMessage(ResultCommon.OK)); + } - /** - * 编辑 - * - * @param lawsDataCenterFolder - * @return - */ - @AutoLog(value = "资料中心-文件夹-编辑") - @ApiOperation(value="资料中心-文件夹-编辑", notes="资料中心-文件夹-编辑") - @PostMapping(value = "/edit") - public Result edit(@Validated @RequestBody LawsDataCenterFolder lawsDataCenterFolder) { - lawsDataCenterFolderService.editById(lawsDataCenterFolder); - return Result.OK("操作成功!"); - } + /** + * 编辑 + * + * @param lawsDataCenterFolder + * @return + */ + @AutoLog(value = "资料中心-文件夹-编辑") + @ApiOperation(value = "资料中心-文件夹-编辑", notes = "资料中心-文件夹-编辑") + @PostMapping(value = "/edit") + public Result edit(@Validated @RequestBody LawsDataCenterFolder lawsDataCenterFolder) { + lawsDataCenterFolderService.editById(lawsDataCenterFolder); + return Result.OK(MessageUtils.getMessage(ResultCommon.OK)); + } - /** - * 通过id删除 - * - * @param map - * @return - */ - @AutoLog(value = "资料中心-文件夹-通过id删除") - @ApiOperation(value="资料中心-文件夹-通过id删除", notes="资料中心-文件夹-通过id删除") - @PostMapping(value = "/delete") - public Result delete(@RequestBody Map map) { - if(!map.containsKey("id") || StringUtils.isEmpty(map.get("id"))){ + /** + * 通过id删除 + * + * @param map + * @return + */ + @AutoLog(value = "资料中心-文件夹-通过id删除") + @ApiOperation(value = "资料中心-文件夹-通过id删除", notes = "资料中心-文件夹-通过id删除") + @PostMapping(value = "/delete") + public Result delete(@RequestBody Map map) { + if (!map.containsKey("id") || StringUtils.isEmpty(map.get("id"))) { return Result.error("请选择数据!"); } - lawsDataCenterFolderService.deleteById(map.get("id")); - return Result.OK("删除成功!"); - } - - /** - * 批量删除 - * - * @param map - * @return - */ - @AutoLog(value = "资料中心-文件夹-批量删除") - @ApiOperation(value="资料中心-文件夹-批量删除", notes="资料中心-文件夹-批量删除") - @PostMapping(value = "/deleteBatch") - public Result deleteBatch(@RequestBody Map map) { - if(!map.containsKey("ids") || StringUtils.isEmpty(map.get("ids"))){ - return Result.error("请选择数据!"); - } - this.lawsDataCenterFolderService.deleteByIds(Arrays.asList(map.get("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) { - LawsDataCenterFolder lawsDataCenterFolder = lawsDataCenterFolderService.queryById(id); - if(lawsDataCenterFolder==null) { - return Result.error("未找到对应数据"); - } - return Result.OK(lawsDataCenterFolder); - } - + lawsDataCenterFolderService.deleteById(map.get("id")); + return Result.OK(MessageUtils.getMessage(ResultCommon.OK)); + } } diff --git a/laws-modules/src/main/java/com/jero/modules/laws/dataCenter/entity/LawsDataCenterFolder.java b/laws-modules/src/main/java/com/jero/modules/laws/dataCenter/entity/LawsDataCenterFolder.java index 90e6e9a6..5647a484 100644 --- a/laws-modules/src/main/java/com/jero/modules/laws/dataCenter/entity/LawsDataCenterFolder.java +++ b/laws-modules/src/main/java/com/jero/modules/laws/dataCenter/entity/LawsDataCenterFolder.java @@ -4,7 +4,10 @@ import java.io.Serializable; import java.io.UnsupportedEncodingException; import java.util.Date; import java.math.BigDecimal; +import java.util.List; + 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 lombok.Data; @@ -18,80 +21,114 @@ import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; import com.fasterxml.jackson.databind.annotation.JsonSerialize; -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; +import javax.validation.constraints.*; /** * @Description: 资料中心-文件夹 * @Author: jero-boot - * @Date: 2023-10-26 + * @Date: 2023-10-26 * @Version: V1.0 */ @Data @TableName("laws_data_center_folder") @Accessors(chain = true) @EqualsAndHashCode(callSuper = false) -@ApiModel(value="laws_data_center_folder对象", description="资料中心-文件夹") +@ApiModel(value = "laws_data_center_folder对象", description = "资料中心-文件夹") public class LawsDataCenterFolder implements Serializable { private static final long serialVersionUID = 1L; - /**主键ID*/ - @TableId(type = IdType.ASSIGN_ID) + /** + * 主键ID + */ + @TableId(type = IdType.ASSIGN_ID) @ApiModelProperty(value = "主键ID") 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") + /** + * 创建时间 + */ + @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") + /** + * 更新时间 + */ + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") + @DateTimeFormat(pattern = "yyyy-MM-dd") @ApiModelProperty(value = "更新时间") private java.util.Date updateTime; - /**所属部门*/ - @Excel(name = "所属部门", width = 15) + /** + * 所属部门 + */ + @Excel(name = "所属部门", width = 15) @ApiModelProperty(value = "所属部门") private java.lang.String orgCode; - /**0表示未删除,1表示删除*/ - @Excel(name = "0表示未删除,1表示删除", width = 15) + /** + * 0表示未删除,1表示删除 + */ + @Excel(name = "0表示未删除,1表示删除", width = 15) @ApiModelProperty(value = "0表示未删除,1表示删除") private java.lang.Integer delFlag; - /**文件夹名称*/ - @Excel(name = "文件夹名称", width = 15) + /** + * 文件夹名称 + */ + @Excel(name = "文件夹名称", width = 15) @ApiModelProperty(value = "文件夹名称") @NotBlank(message = "文件夹名称不能为空") @Size(max = 50, message = "文件夹名称超出最大限度") private java.lang.String folderName; - /**管理权限(用户id逗号拼接)*/ - @Excel(name = "管理权限(用户id逗号拼接)", width = 15) + /** + * 管理权限(用户id逗号拼接) + */ + @Excel(name = "管理权限(用户id逗号拼接)", width = 15) @ApiModelProperty(value = "管理权限(用户id逗号拼接)") @Size(max = 2000, message = "管理权限超出最大限度") private java.lang.String authManageIds; - /**查看权限(用户id逗号拼接)*/ - @Excel(name = "查看权限(用户id逗号拼接)", width = 15) + /** + * 查看权限(用户id逗号拼接) + */ + @Excel(name = "查看权限(用户id逗号拼接)", width = 15) @ApiModelProperty(value = "查看权限(用户id逗号拼接)") @Size(max = 2000, message = "查看权限超出最大限度") private java.lang.String authViewIds; - /**文件夹顺序*/ - @Excel(name = "文件夹顺序", width = 15) + /** + * 文件夹顺序 + */ + @Excel(name = "文件夹顺序", width = 15) @ApiModelProperty(value = "文件夹顺序") @NotNull(message = "文件夹顺序不能为空") + @Max(value = 999999999, message = "文件夹顺序超出最大限度") + @Min(value = 0, message = "文件夹顺序不能小于0") private java.lang.Integer sort; - /**父id*/ - @Excel(name = "父id", width = 15) + /** + * 父id + */ + @Excel(name = "父id", width = 15) @ApiModelProperty(value = "父id") private java.lang.String parentId; - /**拥有者id*/ + /** + * 拥有者id + */ @Excel(name = "拥有者id", width = 15) @ApiModelProperty(value = "拥有者id") private java.lang.String ownerId; + + /** + * 子集 + */ + @Excel(name = "子集", width = 15) + @ApiModelProperty(value = "子集") + @TableField(exist = false) + private List children; } diff --git a/laws-modules/src/main/java/com/jero/modules/laws/dataCenter/mapper/LawsDataCenterFolderMapper.java b/laws-modules/src/main/java/com/jero/modules/laws/dataCenter/mapper/LawsDataCenterFolderMapper.java index 21262065..1260a0d3 100644 --- a/laws-modules/src/main/java/com/jero/modules/laws/dataCenter/mapper/LawsDataCenterFolderMapper.java +++ b/laws-modules/src/main/java/com/jero/modules/laws/dataCenter/mapper/LawsDataCenterFolderMapper.java @@ -2,6 +2,7 @@ package com.jero.modules.laws.dataCenter.mapper; import java.util.List; +import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import com.jero.modules.laws.dataCenter.entity.LawsDataCenterFolder; import com.baomidou.mybatisplus.core.mapper.BaseMapper; @@ -12,6 +13,15 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; * @Date: 2023-10-26 * @Version: V1.0 */ +@Mapper public interface LawsDataCenterFolderMapper extends BaseMapper { + /** + * @Author: liao + * @Date: 2023/10/26 17:33 + * @Description: 获取全部文件夹集合 + **/ + List getAllFolderList(@Param("userId") String userId); + + } diff --git a/laws-modules/src/main/java/com/jero/modules/laws/dataCenter/mapper/xml/LawsDataCenterFolderMapper.xml b/laws-modules/src/main/java/com/jero/modules/laws/dataCenter/mapper/xml/LawsDataCenterFolderMapper.xml index 8bc9f2f7..aeb88049 100644 --- a/laws-modules/src/main/java/com/jero/modules/laws/dataCenter/mapper/xml/LawsDataCenterFolderMapper.xml +++ b/laws-modules/src/main/java/com/jero/modules/laws/dataCenter/mapper/xml/LawsDataCenterFolderMapper.xml @@ -16,4 +16,14 @@ + \ No newline at end of file diff --git a/laws-modules/src/main/java/com/jero/modules/laws/dataCenter/service/ILawsDataCenterFolderService.java b/laws-modules/src/main/java/com/jero/modules/laws/dataCenter/service/ILawsDataCenterFolderService.java index 059ad913..7c3568a3 100644 --- a/laws-modules/src/main/java/com/jero/modules/laws/dataCenter/service/ILawsDataCenterFolderService.java +++ b/laws-modules/src/main/java/com/jero/modules/laws/dataCenter/service/ILawsDataCenterFolderService.java @@ -2,8 +2,6 @@ package com.jero.modules.laws.dataCenter.service; import com.jero.modules.laws.dataCenter.entity.LawsDataCenterFolder; import com.baomidou.mybatisplus.extension.service.IService; -import javax.servlet.http.HttpServletRequest; -import com.baomidou.mybatisplus.core.metadata.IPage; import java.util.List; /** @@ -14,25 +12,12 @@ import java.util.List; */ public interface ILawsDataCenterFolderService extends IService { - /** - * 分页查询 - * - * @param lawsDataCenterFolder - * @param pageNo - * @param pageSize - * @param req - * @return - */ - IPage queryPage(LawsDataCenterFolder lawsDataCenterFolder, Integer pageNo, Integer pageSize, HttpServletRequest req); - - /** - * 列表查询 - * - * @param lawsDataCenterFolder - * @param req - * @return - */ - List queryList(LawsDataCenterFolder lawsDataCenterFolder, HttpServletRequest req); + /** + * @Author: liao + * @Date: 2023/10/26 17:16 + * @Description: 获取树型列表 + **/ + List getTreeList(); /** * 保存 @@ -57,20 +42,4 @@ public interface ILawsDataCenterFolderService extends IService ids); - - /** - * 通过id查询 - * - * @param id - * @return - */ - LawsDataCenterFolder queryById(String id); } diff --git a/laws-modules/src/main/java/com/jero/modules/laws/dataCenter/service/impl/LawsDataCenterFileServiceImpl.java b/laws-modules/src/main/java/com/jero/modules/laws/dataCenter/service/impl/LawsDataCenterFileServiceImpl.java index 67eb7362..a8cb9fee 100644 --- a/laws-modules/src/main/java/com/jero/modules/laws/dataCenter/service/impl/LawsDataCenterFileServiceImpl.java +++ b/laws-modules/src/main/java/com/jero/modules/laws/dataCenter/service/impl/LawsDataCenterFileServiceImpl.java @@ -1,6 +1,7 @@ package com.jero.modules.laws.dataCenter.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.jero.modules.laws.common.util.CurrentUserUtil; import com.jero.modules.laws.dataCenter.entity.LawsDataCenterFile; import com.jero.modules.laws.dataCenter.mapper.LawsDataCenterFileMapper; import com.jero.modules.laws.dataCenter.service.ILawsDataCenterFileService; @@ -64,9 +65,7 @@ public class LawsDataCenterFileServiceImpl extends ServiceImpl implements ILawsDataCenterFolderService { + @Autowired + private LawsDataCenterFolderMapper lawsDataCenterFolderMapper; - /** - * 分页查询 - * - * @param lawsDataCenterFolder - * @param pageNo - * @param pageSize - * @param req - * @return - */ - @Override - public IPage queryPage(LawsDataCenterFolder lawsDataCenterFolder, Integer pageNo, Integer pageSize, - HttpServletRequest req) { - QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(lawsDataCenterFolder, req.getParameterMap()); - Page page = new Page<>(pageNo, pageSize); - return page(page, queryWrapper); - } - - /** - * 列表查询 - * - * @param lawsDataCenterFolder - * @param req - * @return - */ - @Override - public List queryList(LawsDataCenterFolder lawsDataCenterFolder, HttpServletRequest req) { - return list(QueryGenerator.initQueryWrapper(lawsDataCenterFolder, req.getParameterMap())); - } + /** + * @Author: liao + * @Date: 2023/10/26 17:17 + * @Description: 获取树型列表 + **/ + @Override + public List getTreeList() { + // 获取全部文件夹集合 + List allFolderList = lawsDataCenterFolderMapper.getAllFolderList(CurrentUserUtil.getId()); + return allFolderList; + } /** * 保存 @@ -64,9 +52,7 @@ public class LawsDataCenterFolderServiceImpl extends ServiceImpl ids) { - removeByIds(ids); - } - - /** - * 通过id查询 - * - * @param id - * @return - */ - @Override - public LawsDataCenterFolder queryById(String id) { - return getById(id); - } }