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