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/DeviceInfoController.java | 32 +++++++++++++++++++++++++++++--- 1 files changed, 29 insertions(+), 3 deletions(-) diff --git a/lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/controller/DeviceInfoController.java b/lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/controller/DeviceInfoController.java index 1722137..a65a386 100644 --- a/lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/controller/DeviceInfoController.java +++ b/lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/controller/DeviceInfoController.java @@ -3,13 +3,17 @@ 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; import org.jeecg.modules.dnc.response.*; +import org.jeecg.modules.dnc.service.IDevicePermissionService; +import org.jeecg.modules.mdc.model.MdcEquipmentTree; import org.jeecg.modules.system.entity.SysUser; import org.jeecg.modules.dnc.entity.DeviceInfo; import org.jeecg.modules.dnc.service.IDeviceInfoService; -import org.jeecg.modules.dnc.ucenter.UserDepartExt; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -23,6 +27,8 @@ public class DeviceInfoController extends JeecgController<DeviceInfo, IDeviceInfoService> { @Autowired private IDeviceInfoService deviceInfoService; + @Autowired + private IDevicePermissionService devicePermissionService; @AutoLog(value = "璁惧琛�-鏂板璁惧") @ApiOperation(value = "璁惧琛�-鏂板璁惧", notes = "璁惧琛�-鏂板璁惧") @@ -70,8 +76,8 @@ @AutoLog(value = "璁惧琛�-鑾峰彇鑺傜偣宸插垎閰嶇殑鐢ㄦ埛") @ApiOperation(value = "璁惧琛�-鑾峰彇鑺傜偣宸插垎閰嶇殑鐢ㄦ埛", notes = "璁惧琛�-鑾峰彇鑺傜偣宸插垎閰嶇殑鐢ㄦ埛") @GetMapping("/get/perm/user/{nodeType}/{paramId}") - public QueryListResponseResult<UserDepartExt> getUserPermsList(@PathVariable("nodeType") Integer nodeType, @PathVariable("paramId") String paramId) { - List<UserDepartExt> list = deviceInfoService.getUserPermsList(nodeType, paramId); + public QueryListResponseResult<SysUser> getUserPermsList(@PathVariable("nodeType") Integer nodeType, @PathVariable("paramId") String paramId) { + List<SysUser> list = deviceInfoService.getUserPermsList(nodeType, paramId); if(list == null) list = Collections.emptyList(); return new QueryListResponseResult(CommonCode.SUCCESS, list); @@ -156,4 +162,24 @@ } return new ResponseResult(CommonCode.SUCCESS); } + + /** + * 鍔犺浇浜х嚎璁惧鏍� + */ + @AutoLog(value = "璁惧琛�-鍔犺浇浜х嚎璁惧鏍�") + @ApiOperation(value = "璁惧琛�-鍔犺浇浜х嚎璁惧鏍�", notes = "璁惧琛�-鍔犺浇浜х嚎璁惧鏍�") + @GetMapping(value = "/queryTreeListByProduction") + public Result<List<MdcEquipmentTree>> queryTreeListByProduction() { + Result<List<MdcEquipmentTree>> result = new Result<>(); + LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + String userId = user.getId(); + try { + List<MdcEquipmentTree> mdcEquipmentTreeList = devicePermissionService.DncLoadTreeListByProduction(userId); + result.setSuccess(true); + result.setResult(mdcEquipmentTreeList); + } catch (Exception e) { + return Result.error("鍔犺浇浜х嚎璁惧鏍戝け璐ワ紒" + e.getMessage()); + } + return result; + } } -- Gitblit v1.9.3