From eec61b51d7b64695d177c7cedd2da49f03f8c26e Mon Sep 17 00:00:00 2001 From: Lius <Lius2225@163.com> Date: 星期四, 13 三月 2025 16:59:17 +0800 Subject: [PATCH] update --- 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