|
@@ -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()
|