Browse Source

机构负责人查询个人设备下拉列表

fly 2 years ago
parent
commit
dc6845ebaf
1 changed files with 13 additions and 5 deletions
  1. 13 5
      Service/DeviceService.cs

+ 13 - 5
Service/DeviceService.cs

@@ -599,13 +599,21 @@ namespace WingDeviceService.Service
             {
                 ThrowCustomerException(CustomerRpcCode.OrganizationNotExist, "Org does not exist");
             }
-            //查询用户绑定的设备
-            if (userInfoDO.BindDevices == null || userInfoDO.BindDevices.Count <= 0)
+            var deviceInfoDOList = new List<DeviceInfoDTO>();
+            if (userInfoDO.IsDirector)
             {
-                return result;
+                deviceInfoDOList = await _deviceInfoDBServiceProxy.FindDeviceInfoListByOrganizationCodeAsync(userInfoDO.RootOrganizationCode);
+            }
+            else
+            {
+                //查询用户绑定的设备
+                if (userInfoDO.BindDevices == null || userInfoDO.BindDevices.Count <= 0)
+                {
+                    return result;
+                }
+                //根据用户名下的设备id查询所有的设备信息
+                deviceInfoDOList = await _deviceInfoDBServiceProxy.FindDeviceInfoListByCodeListAsync(userInfoDO.BindDevices);
             }
-            //根据用户名下的设备id查询所有的设备信息
-            var deviceInfoDOList = await _deviceInfoDBServiceProxy.FindDeviceInfoListByCodeListAsync(userInfoDO.BindDevices);
             if (deviceInfoDOList?.Count > 0)
             {
                 result = deviceInfoDOList.Select(c => new SelectItemDTO()