zhaoy 8 months ago
parent
commit
aa09dd91a9
2 changed files with 39 additions and 1 deletions
  1. +3
    -1
      BPA.SAAS.Manage.Application/Device/Services/DeviceService.cs
  2. +36
    -0
      BPA.SAAS.Manage.Application/StoreServers.cs

+ 3
- 1
BPA.SAAS.Manage.Application/Device/Services/DeviceService.cs View File

@@ -27,6 +27,7 @@ namespace BPA.SAAS.Manage.Application.Device.Services
public class DeviceService: IDeviceService, ITransient
{
ISqlSugarClient _db;
StoreServers _storeServers;
public DeviceService(ISqlSugarClient db)
{
_db=db;
@@ -39,6 +40,7 @@ namespace BPA.SAAS.Manage.Application.Device.Services
public async Task<PageUtil> GetDeviceInfoPage(DeviceQueryInputDto inputDto)
{
RefAsync<int> total =0;
var dataStore=await _storeServers.GetStop();
var data = await _db.Queryable<BPA_DeviceInfo, BPA_Product>((a, b) => new JoinQueryInfos(JoinType.Left, a.ProductId == b.Id))

.WhereIF(!string.IsNullOrWhiteSpace(inputDto.StoreId), (a, b) => a.StopId == inputDto.StoreId)
@@ -57,7 +59,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).First()?.Name;
})
.ToPageListAsync(inputDto.Current, inputDto.PageSize, total);
return new PageUtil()


+ 36
- 0
BPA.SAAS.Manage.Application/StoreServers.cs View File

@@ -0,0 +1,36 @@
using BPA.SAAS.Manage.Application.Device.Dtos.Device;
using BPA.SAAS.Manage.Comm.Const;
using BPA.SAAS.Manage.Core.Base;
using Furion.RemoteRequest.Extensions;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BPA.SAAS.Manage.Application
{
[ApiDescriptionSettings("Stop", Tag = "获取场景")]
public class StoreServers: IDynamicApiController
{
public StoreServers()
{

}
private string BaseServerUrl = App.GetConfig<string>("baseurl");
[HttpGet("/api/stop/getstop")]
public async Task<List<StoreDto>> GetStop()
{
var getStoreurl = BaseServerUrl + "api/store/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());
return dataStore;
}
}
}

Loading…
Cancel
Save