update 资料中心-文件夹
This commit is contained in:
+1
-1
@@ -118,7 +118,7 @@ public class LawsAsmsOpenApiServiceImpl extends ServiceImpl<LawsAsmsOpenApiMappe
|
||||
public IPage<LawsAsmsOpenApi> queryPage(LawsAsmsOpenApi lawsAsmsOpenApi, Integer pageNo, Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<LawsAsmsOpenApi> queryWrapper = QueryGenerator.initQueryWrapper(lawsAsmsOpenApi, req.getParameterMap());
|
||||
queryWrapper.orderByDesc("id");
|
||||
queryWrapper.orderByAsc("api_name");
|
||||
Page<LawsAsmsOpenApi> page = new Page<>(pageNo, pageSize);
|
||||
return page(page, queryWrapper);
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
+111
-108
@@ -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<LawsDataCenterFile, ILawsDataCenterFileService> {
|
||||
@Autowired
|
||||
private ILawsDataCenterFileService lawsDataCenterFileService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param lawsDataCenterFile
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "资料中心-文件数据-分页列表查询")
|
||||
@ApiOperation(value="资料中心-文件数据-分页列表查询", notes="资料中心-文件数据-分页列表查询")
|
||||
@GetMapping(value = "/page")
|
||||
public Result<IPage<LawsDataCenterFile>> queryPageList(LawsDataCenterFile lawsDataCenterFile,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
IPage<LawsDataCenterFile> 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<List<LawsDataCenterFile>> queryList(LawsDataCenterFile lawsDataCenterFile, HttpServletRequest req) {
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param lawsDataCenterFile
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "资料中心-文件数据-分页列表查询")
|
||||
@ApiOperation(value = "资料中心-文件数据-分页列表查询", notes = "资料中心-文件数据-分页列表查询")
|
||||
@GetMapping(value = "/page")
|
||||
public Result<IPage<LawsDataCenterFile>> queryPageList(LawsDataCenterFile lawsDataCenterFile,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
IPage<LawsDataCenterFile> 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<List<LawsDataCenterFile>> queryList(LawsDataCenterFile lawsDataCenterFile, HttpServletRequest req) {
|
||||
List<LawsDataCenterFile> list = lawsDataCenterFileService.queryList(lawsDataCenterFile, req);
|
||||
return Result.OK(list);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param lawsDataCenterFile
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "资料中心-文件数据-添加")
|
||||
@ApiOperation(value="资料中心-文件数据-添加", notes="资料中心-文件数据-添加")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<T> add(@Validated @RequestBody LawsDataCenterFile lawsDataCenterFile) {
|
||||
lawsDataCenterFileService.add(lawsDataCenterFile);
|
||||
return Result.OK("操作成功!");
|
||||
}
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param lawsDataCenterFile
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "资料中心-文件数据-添加")
|
||||
@ApiOperation(value = "资料中心-文件数据-添加", notes = "资料中心-文件数据-添加")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<T> 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<T> edit(@Validated @RequestBody LawsDataCenterFile lawsDataCenterFile) {
|
||||
lawsDataCenterFileService.editById(lawsDataCenterFile);
|
||||
return Result.OK("操作成功!");
|
||||
}
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param lawsDataCenterFile
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "资料中心-文件数据-编辑")
|
||||
@ApiOperation(value = "资料中心-文件数据-编辑", notes = "资料中心-文件数据-编辑")
|
||||
@PostMapping(value = "/edit")
|
||||
public Result<T> 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<T> delete(@RequestBody Map<String, String> 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<T> delete(@RequestBody Map<String, String> 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<T> deleteBatch(@RequestBody Map<String, String> 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<T> deleteBatch(@RequestBody Map<String, String> 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<LawsDataCenterFile> 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<LawsDataCenterFile> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||
LawsDataCenterFile lawsDataCenterFile = lawsDataCenterFileService.queryById(id);
|
||||
if (lawsDataCenterFile == null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(lawsDataCenterFile);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+65
-116
@@ -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<LawsDataCenterFolder, ILawsDataCenterFolderService> {
|
||||
@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<IPage<LawsDataCenterFolder>> queryPageList(LawsDataCenterFolder lawsDataCenterFolder,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
IPage<LawsDataCenterFolder> pageList = lawsDataCenterFolderService.queryPage(lawsDataCenterFolder, pageNo, pageSize, req);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
@AutoLog(value = "资料中心-文件夹-获取树型列表")
|
||||
@ApiOperation(value = "资料中心-文件夹-获取树型列表", notes = "资料中心-文件夹-获取树型列表")
|
||||
@GetMapping(value = "/getTreeList")
|
||||
public Result<List<LawsDataCenterFolder>> getTreeList() {
|
||||
List<LawsDataCenterFolder> treeList = lawsDataCenterFolderService.getTreeList();
|
||||
return Result.OK(treeList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @param lawsDataCenterFolder
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "资料中心-文件夹-列表查询")
|
||||
@ApiOperation(value="资料中心-文件夹-列表查询", notes="资料中心-文件夹-列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<List<LawsDataCenterFolder>> queryList(LawsDataCenterFolder lawsDataCenterFolder, HttpServletRequest req) {
|
||||
List<LawsDataCenterFolder> list = lawsDataCenterFolderService.queryList(lawsDataCenterFolder, req);
|
||||
return Result.OK(list);
|
||||
}
|
||||
* 新增同级
|
||||
*
|
||||
* @param lawsDataCenterFolder
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "资料中心-文件夹-新增同级")
|
||||
@ApiOperation(value = "资料中心-文件夹-新增同级", notes = "资料中心-文件夹-新增同级")
|
||||
@PostMapping(value = "/addBrother")
|
||||
public Result<T> 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<T> add(@Validated @RequestBody LawsDataCenterFolder lawsDataCenterFolder) {
|
||||
lawsDataCenterFolderService.add(lawsDataCenterFolder);
|
||||
return Result.OK("操作成功!");
|
||||
}
|
||||
@AutoLog(value = "资料中心-文件夹-新增子级")
|
||||
@ApiOperation(value = "资料中心-文件夹-新增子级", notes = "资料中心-文件夹-新增子级")
|
||||
@PostMapping(value = "/addChild")
|
||||
public Result<T> 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<T> edit(@Validated @RequestBody LawsDataCenterFolder lawsDataCenterFolder) {
|
||||
lawsDataCenterFolderService.editById(lawsDataCenterFolder);
|
||||
return Result.OK("操作成功!");
|
||||
}
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param lawsDataCenterFolder
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "资料中心-文件夹-编辑")
|
||||
@ApiOperation(value = "资料中心-文件夹-编辑", notes = "资料中心-文件夹-编辑")
|
||||
@PostMapping(value = "/edit")
|
||||
public Result<T> 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<T> delete(@RequestBody Map<String, String> 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<T> delete(@RequestBody Map<String, String> 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<T> deleteBatch(@RequestBody Map<String, String> 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<LawsDataCenterFolder> 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));
|
||||
}
|
||||
}
|
||||
|
||||
+67
-30
@@ -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<LawsDataCenterFolder> children;
|
||||
}
|
||||
|
||||
+10
@@ -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<LawsDataCenterFolder> {
|
||||
|
||||
/**
|
||||
* @Author: liao
|
||||
* @Date: 2023/10/26 17:33
|
||||
* @Description: 获取全部文件夹集合
|
||||
**/
|
||||
List<LawsDataCenterFolder> getAllFolderList(@Param("userId") String userId);
|
||||
|
||||
|
||||
}
|
||||
|
||||
+10
@@ -16,4 +16,14 @@
|
||||
<result column="parent_id" property="parentId" />
|
||||
<result column="owner_id" property="ownerId" />
|
||||
</resultMap>
|
||||
<select id="getAllFolderList" resultType="com.jero.modules.laws.dataCenter.entity.LawsDataCenterFolder">
|
||||
SELECT
|
||||
ldcf.id,
|
||||
ldcf.folder_name,
|
||||
ldcf.auth_manage_ids,
|
||||
ldcf.auth_view_ids,
|
||||
ldcf.parent_id
|
||||
FROM
|
||||
laws_data_center_folder ldcf
|
||||
</select>
|
||||
</mapper>
|
||||
+6
-37
@@ -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<LawsDataCenterFolder> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param lawsDataCenterFolder
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
IPage<LawsDataCenterFolder> queryPage(LawsDataCenterFolder lawsDataCenterFolder, Integer pageNo, Integer pageSize, HttpServletRequest req);
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @param lawsDataCenterFolder
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
List<LawsDataCenterFolder> queryList(LawsDataCenterFolder lawsDataCenterFolder, HttpServletRequest req);
|
||||
/**
|
||||
* @Author: liao
|
||||
* @Date: 2023/10/26 17:16
|
||||
* @Description: 获取树型列表
|
||||
**/
|
||||
List<LawsDataCenterFolder> getTreeList();
|
||||
|
||||
/**
|
||||
* 保存
|
||||
@@ -57,20 +42,4 @@ public interface ILawsDataCenterFolderService extends IService<LawsDataCenterFol
|
||||
* @return
|
||||
*/
|
||||
void deleteById(String id);
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
void deleteByIds(List<String> ids);
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
LawsDataCenterFolder queryById(String id);
|
||||
}
|
||||
|
||||
+2
-5
@@ -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<LawsDataCenterFil
|
||||
*/
|
||||
@Override
|
||||
public void add(LawsDataCenterFile lawsDataCenterFile) {
|
||||
Date now = new Date();
|
||||
lawsDataCenterFile.setCreateTime(now);
|
||||
lawsDataCenterFile.setUpdateTime(now);
|
||||
lawsDataCenterFile.setOwnerId(CurrentUserUtil.getId());
|
||||
save(lawsDataCenterFile);
|
||||
}
|
||||
|
||||
@@ -78,8 +77,6 @@ public class LawsDataCenterFileServiceImpl extends ServiceImpl<LawsDataCenterFil
|
||||
*/
|
||||
@Override
|
||||
public void editById(LawsDataCenterFile lawsDataCenterFile) {
|
||||
Date now = new Date();
|
||||
lawsDataCenterFile.setUpdateTime(now);
|
||||
saveOrUpdate(lawsDataCenterFile);
|
||||
}
|
||||
|
||||
|
||||
+17
-55
@@ -1,9 +1,12 @@
|
||||
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.LawsDataCenterFolder;
|
||||
import com.jero.modules.laws.dataCenter.mapper.LawsDataCenterFolderMapper;
|
||||
import com.jero.modules.laws.dataCenter.service.ILawsDataCenterFolderService;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
@@ -26,35 +29,20 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
@Transactional(rollbackFor = JeroBootException.class)
|
||||
public class LawsDataCenterFolderServiceImpl extends ServiceImpl<LawsDataCenterFolderMapper, LawsDataCenterFolder> implements ILawsDataCenterFolderService {
|
||||
|
||||
@Autowired
|
||||
private LawsDataCenterFolderMapper lawsDataCenterFolderMapper;
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param lawsDataCenterFolder
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public IPage<LawsDataCenterFolder> queryPage(LawsDataCenterFolder lawsDataCenterFolder, Integer pageNo, Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<LawsDataCenterFolder> queryWrapper = QueryGenerator.initQueryWrapper(lawsDataCenterFolder, req.getParameterMap());
|
||||
Page<LawsDataCenterFolder> page = new Page<>(pageNo, pageSize);
|
||||
return page(page, queryWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @param lawsDataCenterFolder
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<LawsDataCenterFolder> queryList(LawsDataCenterFolder lawsDataCenterFolder, HttpServletRequest req) {
|
||||
return list(QueryGenerator.initQueryWrapper(lawsDataCenterFolder, req.getParameterMap()));
|
||||
}
|
||||
/**
|
||||
* @Author: liao
|
||||
* @Date: 2023/10/26 17:17
|
||||
* @Description: 获取树型列表
|
||||
**/
|
||||
@Override
|
||||
public List<LawsDataCenterFolder> getTreeList() {
|
||||
// 获取全部文件夹集合
|
||||
List<LawsDataCenterFolder> allFolderList = lawsDataCenterFolderMapper.getAllFolderList(CurrentUserUtil.getId());
|
||||
return allFolderList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存
|
||||
@@ -64,9 +52,7 @@ public class LawsDataCenterFolderServiceImpl extends ServiceImpl<LawsDataCenterF
|
||||
*/
|
||||
@Override
|
||||
public void add(LawsDataCenterFolder lawsDataCenterFolder) {
|
||||
Date now = new Date();
|
||||
lawsDataCenterFolder.setCreateTime(now);
|
||||
lawsDataCenterFolder.setUpdateTime(now);
|
||||
lawsDataCenterFolder.setOwnerId(CurrentUserUtil.getId());
|
||||
save(lawsDataCenterFolder);
|
||||
}
|
||||
|
||||
@@ -78,8 +64,6 @@ public class LawsDataCenterFolderServiceImpl extends ServiceImpl<LawsDataCenterF
|
||||
*/
|
||||
@Override
|
||||
public void editById(LawsDataCenterFolder lawsDataCenterFolder) {
|
||||
Date now = new Date();
|
||||
lawsDataCenterFolder.setUpdateTime(now);
|
||||
saveOrUpdate(lawsDataCenterFolder);
|
||||
}
|
||||
|
||||
@@ -93,26 +77,4 @@ public class LawsDataCenterFolderServiceImpl extends ServiceImpl<LawsDataCenterF
|
||||
public void deleteById(String id) {
|
||||
removeById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void deleteByIds(List<String> ids) {
|
||||
removeByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public LawsDataCenterFolder queryById(String id) {
|
||||
return getById(id);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user