parent
dcc81ba6fc
commit
343d28f3b4
|
|
@ -21,12 +21,8 @@ namespace Waste.Application
|
|||
.Map(dest => dest.type, src => src.WasteType)
|
||||
;
|
||||
config.ForType<SendThirdMessageSubscribeS2SDto, SendThirdMessageSubscriDto>()
|
||||
.Map(dest => dest.time, src => src.Time.GetTimeStamp())
|
||||
.Map(dest => dest.Time, src => src.Time.GetTimeStamp())
|
||||
;
|
||||
config.ForType<SendThirdMessageSubscriDto, SendMessageToThirdS2CDto>()
|
||||
.Map(dest => dest.trashcode, src => src.trashcode.ToStr())
|
||||
.Map(dest => dest.wastestype, src => src.wastestype.ToStr())
|
||||
;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -297,11 +297,11 @@ namespace Waste.Application
|
|||
public async Task InsertResultByA84GAsync(A8MyPackage myPackage)
|
||||
{
|
||||
//如果uuid不为空,并且以存在记录,则忽略
|
||||
if (!myPackage.IsHeart && !myPackage.UUID.IsEmpty() && await dbClient.Queryable<W_MeasureResult>().AnyAsync(x => x.UUID == myPackage.UUID))
|
||||
{
|
||||
_loggerService.AddLogger($"A8记录重复,内容:{myPackage.ToJson()}", 1);
|
||||
return;
|
||||
}
|
||||
//if (!myPackage.IsHeart && !myPackage.UUID.IsEmpty() && await dbClient.Queryable<W_MeasureResult>().AnyAsync(x => x.UUID == myPackage.UUID))
|
||||
//{
|
||||
// _loggerService.AddLogger($"A8记录重复,内容:{myPackage.ToJson()}", 1);
|
||||
// return;
|
||||
//}
|
||||
//查找设备
|
||||
var device = await dbClient.Queryable<W_Device>().FirstAsync(x => myPackage.IMEI == x.Ecode);
|
||||
// _loggerService.AddLogger($"接收到的数据,参数:{myPackage.ToJson()}", 3);
|
||||
|
|
@ -406,7 +406,7 @@ namespace Waste.Application
|
|||
if (configdata != null && !configdata.Url.IsEmpty())
|
||||
{
|
||||
var senddata = input.Adapt<SendThirdMessageSubscriDto>();
|
||||
senddata.body = configdata.Body.ToStr();
|
||||
senddata.Body = configdata.Body.ToStr();
|
||||
senddata.Url = configdata.Url.ToStr();
|
||||
await _capBus.PublishAsync("third.service.sendmessage", senddata);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -153,36 +153,36 @@ namespace Waste.Application.SubscribeInfo
|
|||
/// <summary>
|
||||
/// 垃圾类别
|
||||
/// </summary>
|
||||
public string wastetype { get; set; }
|
||||
public string WasteType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 物品小类别
|
||||
/// </summary>
|
||||
public string wastestype { get; set; } = "";
|
||||
public string WasteSType { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// 重量,单位KG
|
||||
/// </summary>
|
||||
public string weight { get; set; }
|
||||
public string Weight { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 垃圾桶编号
|
||||
/// </summary>
|
||||
public string trashcode { get; set; }
|
||||
public string TrashCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 上报时间
|
||||
/// </summary>
|
||||
public long time { get; set; }
|
||||
public long Time { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 额外信息
|
||||
/// </summary>
|
||||
public string body { get; set; }
|
||||
public string Body { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 设备ID
|
||||
/// </summary>
|
||||
public Guid deviceid { get; set; }
|
||||
public Guid DeviceId { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -28,6 +28,7 @@ namespace Waste.Application.SubscribeInfo
|
|||
private readonly SqlSugarClient dbClient;
|
||||
private readonly IResultService _resultService;
|
||||
private readonly ILoggerService _loggerService;
|
||||
|
||||
public SubscribeService(ISqlSugarRepository<W_Device> sqlSugarRepository, IResultService resultService, ILoggerService loggerService)
|
||||
{
|
||||
repository = sqlSugarRepository;
|
||||
|
|
@ -35,6 +36,7 @@ namespace Waste.Application.SubscribeInfo
|
|||
_resultService = resultService;
|
||||
_loggerService = loggerService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加记录
|
||||
/// </summary>
|
||||
|
|
@ -70,7 +72,6 @@ namespace Waste.Application.SubscribeInfo
|
|||
});
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 更新记录上报结果
|
||||
/// </summary>
|
||||
|
|
@ -157,7 +158,6 @@ namespace Waste.Application.SubscribeInfo
|
|||
};
|
||||
await dbClient.Insertable(insertdata).ExecuteCommandAsync();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -247,7 +247,6 @@ namespace Waste.Application.SubscribeInfo
|
|||
await _resultService.InsertResultBy4GAsync(myPackage);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 测试,4G模块传输的数据增加测量记录
|
||||
/// </summary>
|
||||
|
|
@ -259,6 +258,7 @@ namespace Waste.Application.SubscribeInfo
|
|||
var msg = JsonConvert.SerializeObject(myPackage);
|
||||
_loggerService.AddLogger(msg, 1);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 第三方推送设备消息
|
||||
/// </summary>
|
||||
|
|
@ -290,6 +290,7 @@ namespace Waste.Application.SubscribeInfo
|
|||
}
|
||||
_loggerService.AddLogger($"第三方设备消息发送成功,内容:{data.ToJson()},返回:{returnstr}", 3);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A8 4G模块传输的数据增加测量记录
|
||||
/// </summary>
|
||||
|
|
@ -304,9 +305,15 @@ namespace Waste.Application.SubscribeInfo
|
|||
await Scoped.Create(async (_, scope) =>
|
||||
{
|
||||
var services = scope.ServiceProvider;
|
||||
var mresultrep = services.GetService<ISqlSugarRepository<W_MeasureResult>>();
|
||||
//如果uuid不为空,并且以存在记录,则忽略
|
||||
if (!myPackage.IsHeart && !myPackage.UUID.IsEmpty() && await mresultrep.AnyAsync(x => x.UUID == myPackage.UUID))
|
||||
{
|
||||
return;
|
||||
}
|
||||
var _resultService = services.GetService<IResultService>();
|
||||
await _resultService.InsertResultByA84GAsync(myPackage);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -62,12 +62,12 @@ namespace Waste.Application
|
|||
await _subscribeService.SeedThirdMessageAsync(new SendThirdMessageSubscriDto
|
||||
{
|
||||
Url = "https://localhost:44335/api/test/recv",
|
||||
wastetype = "\u0000\u0000\u0000\u0000纸壳",
|
||||
weight = "20.9",
|
||||
trashcode = "0",
|
||||
time = 1653033312,
|
||||
body = "",
|
||||
deviceid = Guid.Parse("39fcdce8-9e54-b87f-fc8e-616a9072c224")
|
||||
WasteType = "\u0000\u0000\u0000\u0000纸壳",
|
||||
Weight = "20.9",
|
||||
TrashCode = "0",
|
||||
Time = 1653033312,
|
||||
Body = "",
|
||||
DeviceId = Guid.Parse("39fcdce8-9e54-b87f-fc8e-616a9072c224")
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2287,37 +2287,37 @@
|
|||
推送给第三方的信息
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Waste.Application.SubscribeInfo.SendMessageToThirdS2CDto.wastetype">
|
||||
<member name="P:Waste.Application.SubscribeInfo.SendMessageToThirdS2CDto.WasteType">
|
||||
<summary>
|
||||
垃圾类别
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Waste.Application.SubscribeInfo.SendMessageToThirdS2CDto.wastestype">
|
||||
<member name="P:Waste.Application.SubscribeInfo.SendMessageToThirdS2CDto.WasteSType">
|
||||
<summary>
|
||||
物品小类别
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Waste.Application.SubscribeInfo.SendMessageToThirdS2CDto.weight">
|
||||
<member name="P:Waste.Application.SubscribeInfo.SendMessageToThirdS2CDto.Weight">
|
||||
<summary>
|
||||
重量,单位KG
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Waste.Application.SubscribeInfo.SendMessageToThirdS2CDto.trashcode">
|
||||
<member name="P:Waste.Application.SubscribeInfo.SendMessageToThirdS2CDto.TrashCode">
|
||||
<summary>
|
||||
垃圾桶编号
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Waste.Application.SubscribeInfo.SendMessageToThirdS2CDto.time">
|
||||
<member name="P:Waste.Application.SubscribeInfo.SendMessageToThirdS2CDto.Time">
|
||||
<summary>
|
||||
上报时间
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Waste.Application.SubscribeInfo.SendMessageToThirdS2CDto.body">
|
||||
<member name="P:Waste.Application.SubscribeInfo.SendMessageToThirdS2CDto.Body">
|
||||
<summary>
|
||||
额外信息
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Waste.Application.SubscribeInfo.SendMessageToThirdS2CDto.deviceid">
|
||||
<member name="P:Waste.Application.SubscribeInfo.SendMessageToThirdS2CDto.DeviceId">
|
||||
<summary>
|
||||
设备ID
|
||||
</summary>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,16 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<key id="869b1552-1a5b-4a99-97b5-a70c2eac85e2" version="1">
|
||||
<creationDate>2022-07-07T06:28:07.0933768Z</creationDate>
|
||||
<activationDate>2022-07-07T06:28:06.9620155Z</activationDate>
|
||||
<expirationDate>2022-10-05T06:28:06.9620155Z</expirationDate>
|
||||
<descriptor deserializerType="Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Version=5.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60">
|
||||
<descriptor>
|
||||
<encryption algorithm="AES_256_CBC" />
|
||||
<validation algorithm="HMACSHA256" />
|
||||
<masterKey p4:requiresEncryption="true" xmlns:p4="http://schemas.asp.net/2015/03/dataProtection">
|
||||
<!-- Warning: the key below is in an unencrypted form. -->
|
||||
<value>kU9UPKcrCVSuWhJsfD12pzasGI+AmK5pcwg4WCtL4Ruk6hakqYjHsB3cg+AwfecKQXHboEZ3gaNrVJuO66M1Jw==</value>
|
||||
</masterKey>
|
||||
</descriptor>
|
||||
</descriptor>
|
||||
</key>
|
||||
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue