|
|
@@ -23,7 +23,7 @@ namespace BPA.SAAS.Manage.Application.Device.Services |
|
|
|
{ |
|
|
|
public class DeviceService: IDeviceService, ITransient |
|
|
|
{ |
|
|
|
private string BaseServerUrl=App.GetConfig<string>("baseurl"); |
|
|
|
StoreServers storeServer = new(); |
|
|
|
ISqlSugarClient _db; |
|
|
|
public DeviceService(ISqlSugarClient db) |
|
|
|
{ |
|
|
@@ -36,14 +36,7 @@ namespace BPA.SAAS.Manage.Application.Device.Services |
|
|
|
/// <returns></returns> |
|
|
|
public async Task<PageUtil> GetDeviceInfoPage(DeviceQueryInputDto inputDto) |
|
|
|
{ |
|
|
|
var getStoreurl = BaseServerUrl + "api/goodsattribute/getstorelist_alm";//获取商品属性 |
|
|
|
var responseGoodsAttribute = await getStoreurl.SetHeaders(new |
|
|
|
{ |
|
|
|
groupId = App.User?.FindFirst(ClaimConst.GroupId)?.Value |
|
|
|
}).SetHttpMethod(HttpMethod.Get).GetAsStringAsync(); |
|
|
|
var resStore = JsonConvert.DeserializeObject<ResponDataBase>(responseGoodsAttribute); |
|
|
|
if (resStore.statusCode != "200") throw Oops.Oh("获取场景数据失败"); |
|
|
|
var dataStore = JsonConvert.DeserializeObject<List<StoreDto>>(resStore.data.ToString()); |
|
|
|
var dataStore =await storeServer.GetStop(); |
|
|
|
RefAsync<int> total =0; |
|
|
|
var data = await _db.Queryable<BPA_DeviceInfo, BPA_Product>((a, b) => new JoinQueryInfos(JoinType.Left, a.ProductId == b.Id)) |
|
|
|
|
|
|
@@ -63,7 +56,7 @@ namespace BPA.SAAS.Manage.Application.Device.Services |
|
|
|
{ |
|
|
|
var Vesion = _db.Queryable<BPA_ProductVesion>().Where(c => c.Id == x.ProductVersionId).First(); |
|
|
|
x.ProductVersionName = Vesion?.Vesion; |
|
|
|
x.StopName= dataStore?.Where(f=>f.Id==x.StopId).First()?.Name; |
|
|
|
x.StopName= dataStore?.Where(f=>f.Id==x.StopId).FirstOrDefault()?.Name; |
|
|
|
}) |
|
|
|
.ToPageListAsync(inputDto.Current, inputDto.PageSize, total); |
|
|
|
return new PageUtil() |
|
|
|