Browse Source

设备类型名

fly 2 years ago
parent
commit
b651d159cd
1 changed files with 8 additions and 1 deletions
  1. 8 1
      Service/DeviceService.cs

+ 8 - 1
Service/DeviceService.cs

@@ -555,8 +555,14 @@ namespace WingDeviceService.Service
                 var organizations = await _organizationDBService.GetOrganizationPageAsync((new PageFilterRequest { CurrentPage = 1, PageSize = 999999, Filter = organizationFilter, IsFuzzy = false }));
                 var deviceCodes = deviceInfoDOList.Select(x => x.DeviceCode).ToList();
                 var deviceTokens = await _authenticationService.GetTokenWithClientIdsAsync(new GetTokenWithClientIdsRequest { ClientIds = deviceCodes });
+                var deviceTypeList = await _deviceInfoDBServiceProxy.FindDictionaryItemsAsync(new FindDictionaryItemsDBRequest { DictionaryType = (int)DictionaryTypeEnum.DeviceType });
                 foreach (var c in deviceInfoDOList)
                 {
+                    var deviceTypeName = deviceTypeList.FirstOrDefault(t => t.DictionaryCode == c.DeviceType)?.Value;
+                    if (string.IsNullOrWhiteSpace(deviceTypeName))
+                    {
+                        deviceTypeName = c.DeviceType;
+                    }
                     result.Add(new DeviceExtendInfoDTO
                     {
                         DepartmentName = organizations.PageData.FirstOrDefault(o => o.OrganizationCode == c.DepartmentCode)?.OrganizationName,
@@ -573,7 +579,8 @@ namespace WingDeviceService.Service
                         SDKSoftwareVersion = c.SDKSoftwareVersion,
                         OrganizationCode = c.OrganizationCode,
                         DepartmentCode = c.DepartmentCode,
-                        ShortCode = c.ShortCode
+                        ShortCode = c.ShortCode,
+                        DeviceTypeName = deviceTypeName
                     });
                 }
             }