From 87874019eefbe03dd429b5b7eed49d963ef03c88 Mon Sep 17 00:00:00 2001 From: Lius <Lius2225@163.com> Date: 星期五, 21 三月 2025 13:18:54 +0800 Subject: [PATCH] 提交MDC-COMMON模块 --- lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/controller/ProductInfoController.java | 37 +++++++++++++++++++++++++++---------- 1 files changed, 27 insertions(+), 10 deletions(-) diff --git a/lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/controller/ProductInfoController.java b/lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/controller/ProductInfoController.java index beec47a..46c981d 100644 --- a/lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/controller/ProductInfoController.java +++ b/lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/controller/ProductInfoController.java @@ -1,10 +1,10 @@ package org.jeecg.modules.dnc.controller; -import cn.hutool.core.util.StrUtil; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; import org.apache.shiro.SecurityUtils; +import org.jeecg.common.api.vo.Result; import org.jeecg.common.aspect.annotation.AutoLog; import org.jeecg.common.system.base.controller.JeecgController; import org.jeecg.common.system.vo.LoginUser; @@ -14,9 +14,9 @@ import org.jeecg.modules.dnc.response.QueryListResponseResult; import org.jeecg.modules.dnc.response.ResponseResult; import org.jeecg.modules.dnc.service.IProductInfoService; -import org.jeecg.modules.dnc.ucenter.Department; import org.jeecg.modules.dnc.ucenter.UserDepartExt; import org.jeecg.modules.dnc.utils.ValidateUtil; +import org.jeecg.modules.system.entity.MdcProduction; import org.jeecg.modules.system.entity.SysUser; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -142,8 +142,8 @@ @AutoLog(value = "浜у搧琛�-鑾峰彇宸插垎閰嶇殑閮ㄩ棬") @ApiOperation(value = "浜у搧琛�-鑾峰彇宸插垎閰嶇殑閮ㄩ棬", notes = "浜у搧琛�-鑾峰彇宸插垎閰嶇殑閮ㄩ棬") @GetMapping("/get/perm/depart/{nodeType}/{paramId}") - public QueryListResponseResult<Department> getDepartPermsList(@PathVariable("nodeType") Integer nodeType, @PathVariable("paramId") String paramId) { - List<Department> list = productInfoService.getDepartPermsList(nodeType, paramId); + public QueryListResponseResult<MdcProduction> getDepartPermsList(@PathVariable("nodeType") Integer nodeType, @PathVariable("paramId") String paramId) { + List<MdcProduction> list = productInfoService.getDepartPermsList(nodeType, paramId); if(list == null) list = Collections.emptyList(); return new QueryListResponseResult(CommonCode.SUCCESS, list); @@ -152,8 +152,8 @@ @AutoLog(value = "浜у搧琛�-鑾峰彇鏈垎閰嶇殑閮ㄩ棬") @ApiOperation(value = "浜у搧琛�-鑾峰彇鏈垎閰嶇殑閮ㄩ棬", notes = "浜у搧琛�-鑾峰彇鏈垎閰嶇殑閮ㄩ棬") @GetMapping("/get/non/perm/depart/{nodeType}/{paramId}") - public QueryListResponseResult<Department> getDepartNonPermsList(@PathVariable("nodeType") Integer nodeType, @PathVariable("paramId") String paramId) { - List<Department> list = productInfoService.getDepartNonPermsList(nodeType, paramId); + public QueryListResponseResult<MdcProduction> getDepartNonPermsList(@PathVariable("nodeType") Integer nodeType, @PathVariable("paramId") String paramId) { + List<MdcProduction> list = productInfoService.getDepartNonPermsList(nodeType, paramId); if(list == null) list = Collections.emptyList(); return new QueryListResponseResult(CommonCode.SUCCESS, list); @@ -171,7 +171,7 @@ @ApiOperation(value = "浜у搧琛�-鎸囨淳浜у搧鏍戣妭鐐圭殑鐢ㄦ埛鏉冮檺", notes = "浜у搧琛�-鎸囨淳浜у搧鏍戣妭鐐圭殑鐢ㄦ埛鏉冮檺") @PostMapping("/assign/add/user/{nodeType}/{paramId}/{relativeFlag}") public ResponseResult assignAddUser(@PathVariable("nodeType") Integer nodeType, @PathVariable("paramId") String paramId, @PathVariable("relativeFlag") Integer relativeFlag, @RequestBody String[] userIds) { - boolean b = productInfoService.assignAddUser(nodeType, paramId, relativeFlag, userIds); + boolean b = productInfoService.assignAddUserAll(nodeType, paramId, relativeFlag, userIds); if(b) { return new ResponseResult(CommonCode.SUCCESS); } @@ -190,7 +190,7 @@ @ApiOperation(value = "浜у搧琛�-绉婚櫎浜у搧鏍戣妭鐐圭殑鐢ㄦ埛鏉冮檺", notes = "浜у搧琛�-绉婚櫎浜у搧鏍戣妭鐐圭殑鐢ㄦ埛鏉冮檺") @PostMapping("/assign/remove/user/{nodeType}/{paramId}/{relativeFlag}") public ResponseResult assignRemoveUser(@PathVariable("nodeType") Integer nodeType, @PathVariable("paramId") String paramId, @PathVariable("relativeFlag") Integer relativeFlag, @RequestBody String[] userIds) { - boolean b = productInfoService.assignRemoveUser(nodeType, paramId, relativeFlag, userIds); + boolean b = productInfoService.assignRemoveUserAll(nodeType, paramId, relativeFlag, userIds); if(b) { return new ResponseResult(CommonCode.SUCCESS); } @@ -209,7 +209,7 @@ @ApiOperation(value = "浜у搧琛�-鎸囨淳浜у搧鏍戣妭鐐圭殑閮ㄩ棬鏉冮檺", notes = "浜у搧琛�-鎸囨淳浜у搧鏍戣妭鐐圭殑閮ㄩ棬鏉冮檺") @PostMapping("/assign/add/department/{nodeType}/{paramId}/{relativeFlag}") public ResponseResult assignAddDepartment(@PathVariable("nodeType") Integer nodeType, @PathVariable("paramId") String paramId, @PathVariable("relativeFlag") Integer relativeFlag, @RequestBody String[] departmentIds) { - boolean b = productInfoService.assignAddDepartment(nodeType, paramId, relativeFlag, departmentIds); + boolean b = productInfoService.assignAddDepartmentAll(nodeType, paramId, relativeFlag, departmentIds); if(b) { return new ResponseResult(CommonCode.SUCCESS); } @@ -228,7 +228,7 @@ @ApiOperation(value = "浜у搧琛�-绉婚櫎浜у搧鏍戣妭鐐圭殑閮ㄩ棬鏉冮檺", notes = "浜у搧琛�-绉婚櫎浜у搧鏍戣妭鐐圭殑閮ㄩ棬鏉冮檺") @PostMapping("/assign/remove/department/{nodeType}/{paramId}/{relativeFlag}") public ResponseResult assignRemoveDepartment(@PathVariable("nodeType") Integer nodeType, @PathVariable("paramId") String paramId, @PathVariable("relativeFlag") Integer relativeFlag, @RequestBody String[] departmentIds) { - boolean b = productInfoService.assignRemoveDepartment(nodeType, paramId, relativeFlag, departmentIds); + boolean b = productInfoService.assignRemoveDepartmentAll(nodeType, paramId, relativeFlag, departmentIds); if(b) { return new ResponseResult(CommonCode.SUCCESS); } @@ -253,4 +253,21 @@ list = Collections.emptyList(); return new QueryListResponseResult<>(CommonCode.SUCCESS, list); } + + /** + * 浜у搧缁撴瀯鏍�-閫氳繃绫诲瀷灏辫鍒犻櫎 + * @param id + * @param type + * @return + */ + @AutoLog(value = "浜у搧缁撴瀯鏍�-閫氳繃绫诲瀷灏辫鍒犻櫎") + @ApiOperation(value = "浜у搧缁撴瀯鏍�-閫氳繃绫诲瀷灏辫鍒犻櫎", notes = "浜у搧缁撴瀯鏍�-閫氳繃绫诲瀷灏辫鍒犻櫎") + @DeleteMapping("/delete/{id}/{type}") + public Result<?> deleteProductTreeByType(@PathVariable("id") String id, @PathVariable("type") Integer type) { + boolean b =productInfoService.deleteProductTree(id, type); + if (b){ + return Result.ok("鍒犻櫎鎴愬姛锛�"); + } + return Result.error("鍒犻櫎澶辫触锛�"); + } } -- Gitblit v1.9.3