zhaoy 8 月之前
父節點
當前提交
086d8fddda
共有 4 個文件被更改,包括 45 次插入10 次删除
  1. +5
    -0
      BPA.SAAS.Manage.Application/Device/DeviceServices.cs
  2. +3
    -10
      BPA.SAAS.Manage.Application/Device/Services/DeviceService.cs
  3. +36
    -0
      BPA.SAAS.Manage.Application/StoreServers.cs
  4. +1
    -0
      BPA.SAAS.Manage.Web.Core/Startup.cs

+ 5
- 0
BPA.SAAS.Manage.Application/Device/DeviceServices.cs 查看文件

@@ -39,6 +39,11 @@ namespace BPA.SAAS.Manage.Application.Device
{
return await _deviceService.GetDeviceList();
}
[HttpGet("/api/device/getdevicebystoplist")]
public async Task<List<ListSelectDeviceQuery>> GetDeviceByStopList(string stopId)
{
return await _deviceService.GetDeviceByStopList(stopId);
}
/// <summary>
/// 添加
/// </summary>


+ 3
- 10
BPA.SAAS.Manage.Application/Device/Services/DeviceService.cs 查看文件

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


+ 36
- 0
BPA.SAAS.Manage.Application/StoreServers.cs 查看文件

@@ -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;
}
}
}

+ 1
- 0
BPA.SAAS.Manage.Web.Core/Startup.cs 查看文件

@@ -65,6 +65,7 @@ namespace BPA.SAAS.Manage.Web.Core
});
});
services.AddCorsAccessor();
services.AddRemoteRequest();
services.AddSqlsugarSetup(App.Configuration);
services.AddControllers()
.AddInjectWithUnifyResult();


Loading…
取消
儲存