@@ -134,16 +134,21 @@ namespace BPA.SAAS.Manage.Application.AExternalPlatform.Service.Material.Service
if (inputDto.StoreIdList != null && inputDto.StoreIdList.Count > 0)
{
input = await SqlSugarDb.Db.Queryable<BPA_DeviceInfo, BPA_Product>((a, b) => new JoinQueryInfos(
JoinType.Left, a.ProductId == b.Id))
.Where(x => inputDto.StoreIdList.Contains(x.StopId))
.Select((a, b) => new PushDeviceDto
input = await SqlSugarDb.Db.Queryable<BPA_DeviceInfo, BPA_Product,BPA_ProductVesion>((a, b,c) => new JoinQueryInfos(
JoinType.Left, a.ProductId == b.Id,
JoinType.Left,a.ProductVersionId==c.Id
))
.Where((a, b, c) => inputDto.StoreIdList.Contains(a.StopId))
.Select((a, b,c) => new PushDeviceDto
{
deviceAutoKey = a.AutoKey,
deviceId = a.Id,
deviceName = a.DeviceName,
messageId = "",
productName = ""
messageId = CurrentUser.MessageId,
productKey = b.Key,
productName = b.Name,
productVersion = c.Vesion,
type = 2
})
.ToListAsync();
@@ -152,19 +157,20 @@ namespace BPA.SAAS.Manage.Application.AExternalPlatform.Service.Material.Service
if (inputDto.DeviceIdList != null && inputDto.DeviceIdList.Count > 0)
{
input = await SqlSugarDb.Db.Queryable<BPA_DeviceInfo, BPA_Product>((a, b) => new JoinQueryInfos(
JoinType.Left, a.ProductId == b.Id))
.Where(x => inputDto.StoreIdList.Contains(x.StopId))
.Select((a, b) => new PushDeviceDto
input = await SqlSugarDb.Db.Queryable<BPA_DeviceInfo, BPA_Product, BPA_ProductVesion>((a, b,c) => new JoinQueryInfos(
JoinType.Left, a.ProductId == b.Id,
JoinType.Left,a.ProductVersionId==c.Id))
.Where((a, b,c) => inputDto.DeviceIdList.Contains(a.Id))
.Select((a, b,c) => new PushDeviceDto
{
deviceAutoKey = a.AutoKey,
deviceId = a.Id,
deviceName = a.DeviceName,
messageId = "" ,
productKey = "" ,
messageId = CurrentUser.MessageId ,
productKey = b.Key ,
productName = b.Name,
productVersion = a.ProductVersionId ,
type = 2
productVersion =c.Vesion ,
type = 2,
})
.ToListAsync();
}
@@ -180,15 +186,35 @@ namespace BPA.SAAS.Manage.Application.AExternalPlatform.Service.Material.Service
IsPush = false,
MessageId = CurrentUser.MessageId,
PushDevice =item.deviceId,
PushData = JsonConvert.SerializeObject(item),
PushData = materialData.Id,
Status=1,
Type = 2,
});
item.data = JsonConvert.SerializeObject(new List<PushDataBatchingDto>()
{
new()
{
Aittribute= materialData.Aittribute,
AutoKey= materialData.AutoKey,
Code=materialData.Code,
ForeignKeyRe= materialData.ForeignKeyRe,
Id=materialData.Id,
Name= materialData.Batching_Name,
netrecovery= materialData.netrecovery,
outstockUint= materialData.outstockUint,
Price= materialData.Price,
proportion= materialData.proportion,
Specs= materialData.Specs,
StockUint= materialData.StockUint,
StockUintName= materialData.StockUint,
TypeID= materialData.TypeID,
}
});
}
SqlSugarDb.Db.Ado.CommitTran();
//5.发送mq
await _thirdpartyPushService.PushDevice(input);
SqlSugarDb.Db.Ado.CommitTran();
return true;
}
catch (Exception e)