From 1dcf43467f34eb70002be3c2f3cd7605ceb5dcdd Mon Sep 17 00:00:00 2001
From: lyh <925863403@qq.com>
Date: 星期一, 17 二月 2025 10:18:18 +0800
Subject: [PATCH] 设备权限与车间权限

---
 lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/controller/DeviceInfoController.java |   31 +++++++++++++++++++++++++++++--
 1 files changed, 29 insertions(+), 2 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..0c5dda9 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,9 +3,14 @@
 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;
@@ -23,6 +28,8 @@
 public class DeviceInfoController extends JeecgController<DeviceInfo, IDeviceInfoService> {
     @Autowired
     private IDeviceInfoService deviceInfoService;
+    @Autowired
+    private IDevicePermissionService devicePermissionService;
 
     @AutoLog(value = "璁惧琛�-鏂板璁惧")
     @ApiOperation(value = "璁惧琛�-鏂板璁惧", notes = "璁惧琛�-鏂板璁惧")
@@ -70,8 +77,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 +163,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