|
@@ -613,7 +613,7 @@ namespace WingDeviceService.Service
|
|
|
{
|
|
|
deviceInfoDOList = await _deviceInfoDBServiceProxy.FindDeviceInfoListByOrganizationCodeAsync(userInfoDO.RootOrganizationCode);
|
|
|
}
|
|
|
- else
|
|
|
+ else if (!userInfoDO.RoleCodes.Contains("Role_ExpertAssistant"))
|
|
|
{
|
|
|
//查询用户绑定的设备
|
|
|
if (userInfoDO.BindDevices == null || userInfoDO.BindDevices.Count <= 0)
|
|
@@ -623,6 +623,22 @@ namespace WingDeviceService.Service
|
|
|
//根据用户名下的设备id查询所有的设备信息
|
|
|
deviceInfoDOList = await _deviceInfoDBServiceProxy.FindDeviceInfoListByCodeListAsync(userInfoDO.BindDevices);
|
|
|
}
|
|
|
+ else
|
|
|
+ {
|
|
|
+ var experts = await _userServiceProxy.GetBindExpertsAsync(userCode);
|
|
|
+ if (experts.Any())
|
|
|
+ {
|
|
|
+ var bindDeviceCodes = experts.SelectMany(x => x.BindDevices ?? new List<string>()).ToList();
|
|
|
+ if (bindDeviceCodes.Any())
|
|
|
+ {
|
|
|
+ deviceInfoDOList = await _deviceInfoDBServiceProxy.FindDeviceInfoListByCodeListAsync(bindDeviceCodes.Distinct().ToList());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ deviceInfoDOList = await _deviceInfoDBServiceProxy.FindDeviceInfoListByOrganizationCodeAsync(userInfoDO.RootOrganizationCode);
|
|
|
+ }
|
|
|
+ }
|
|
|
if (deviceInfoDOList?.Count > 0)
|
|
|
{
|
|
|
result = deviceInfoDOList.Select(c => new SelectItemDTO()
|