新的socket协议更新
This commit is contained in:
parent
7cb0918326
commit
31a88f7895
|
|
@ -112,4 +112,83 @@ namespace Waste.Application
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsWeight { get; set; } = false;
|
public bool IsWeight { get; set; } = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 新的4G模块上传的数据包体
|
||||||
|
/// </summary>
|
||||||
|
public class nMyPackage
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 固定头
|
||||||
|
/// </summary>
|
||||||
|
public string Key { get; set; } = "";
|
||||||
|
/// <summary>
|
||||||
|
/// 数据体长度
|
||||||
|
/// </summary>
|
||||||
|
public int Len { get; set; } = 0;
|
||||||
|
/// <summary>
|
||||||
|
/// IMEI
|
||||||
|
/// </summary>
|
||||||
|
public string IMEI { get; set; } = "";
|
||||||
|
/// <summary>
|
||||||
|
/// ICCID
|
||||||
|
/// </summary>
|
||||||
|
public string ICCID { get; set; } = "";
|
||||||
|
/// <summary>
|
||||||
|
/// IMSI
|
||||||
|
/// </summary>
|
||||||
|
public string IMSI { get; set; } = "";
|
||||||
|
/// <summary>
|
||||||
|
/// 信号强度
|
||||||
|
/// </summary>
|
||||||
|
public string GSLQ { get; set; } = "";
|
||||||
|
/// <summary>
|
||||||
|
/// 时间
|
||||||
|
/// </summary>
|
||||||
|
public string Time { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 经度
|
||||||
|
/// </summary>
|
||||||
|
public string Longitude { get; set; } = "";
|
||||||
|
/// <summary>
|
||||||
|
/// 纬度
|
||||||
|
/// </summary>
|
||||||
|
public string Latitude { get; set; } = "";
|
||||||
|
/// <summary>
|
||||||
|
/// 桶大小
|
||||||
|
/// </summary>
|
||||||
|
public string size { get; set; } = "";
|
||||||
|
/// <summary>
|
||||||
|
/// 垃圾桶编号
|
||||||
|
/// </summary>
|
||||||
|
public string trashcode { get; set; } = "";
|
||||||
|
/// <summary>
|
||||||
|
/// 垃圾类别
|
||||||
|
/// </summary>
|
||||||
|
public string WasteType { get; set; } = "";
|
||||||
|
/// <summary>
|
||||||
|
/// 重量,KG
|
||||||
|
/// </summary>
|
||||||
|
public string Weight { get; set; } = "0";
|
||||||
|
/// <summary>
|
||||||
|
/// 内容
|
||||||
|
/// </summary>
|
||||||
|
public string Body { get; set; } = "";
|
||||||
|
/// <summary>
|
||||||
|
/// 字符串结果
|
||||||
|
/// </summary>
|
||||||
|
public string Str { get; set; } = "";
|
||||||
|
/// <summary>
|
||||||
|
/// 是否是否通过校检,true-是,false-否
|
||||||
|
/// </summary>
|
||||||
|
public bool IsChecked { get; set; } = true;
|
||||||
|
/// <summary>
|
||||||
|
/// 是否为心跳包数据
|
||||||
|
/// </summary>
|
||||||
|
public bool IsHeart { get; set; } = false;
|
||||||
|
/// <summary>
|
||||||
|
/// 是否为有效测量
|
||||||
|
/// </summary>
|
||||||
|
public bool IsWeight { get; set; } = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -24,5 +24,11 @@ namespace Waste.Application
|
||||||
/// <param name="myPackage"></param>
|
/// <param name="myPackage"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<ResultInfo> InsertResultAsync(MyPackage myPackage);
|
Task<ResultInfo> InsertResultAsync(MyPackage myPackage);
|
||||||
|
/// <summary>
|
||||||
|
/// 新的4G模块测量结果增加
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="myPackage"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task InsertResultBy4GAsync(nMyPackage myPackage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -136,6 +136,68 @@ namespace Waste.Application
|
||||||
limit = param.limit
|
limit = param.limit
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 新的4G模块测量结果增加
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="myPackage"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task InsertResultBy4GAsync(nMyPackage myPackage)
|
||||||
|
{
|
||||||
|
//查找设备
|
||||||
|
var device = await dbClient.Queryable<W_Device>().FirstAsync(x => myPackage.IMEI == x.Ecode);
|
||||||
|
// _loggerService.AddLogger($"接收到的数据,参数:{myPackage.ToJson()}", 3);
|
||||||
|
if (device == null)
|
||||||
|
{
|
||||||
|
//记录日志
|
||||||
|
_loggerService.AddLogger($"设备未找到,参数:{myPackage.ToJson()}", 3);
|
||||||
|
}
|
||||||
|
var devicedata = await dbClient.Queryable<W_DeviceData>().FirstAsync(x => x.DeviceId == device.Id);
|
||||||
|
var resultid = IDGen.NextID();
|
||||||
|
DateTime time = DateTime.Now;
|
||||||
|
if (myPackage.IsHeart)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(myPackage.Longitude) || myPackage.Longitude.ToDecimal() == 0) myPackage.Longitude = devicedata != null ? devicedata.Longitude : "0";
|
||||||
|
if (string.IsNullOrEmpty(myPackage.Latitude) || myPackage.Latitude.ToDecimal() == 0) myPackage.Latitude = devicedata != null ? devicedata.Latitude : "0";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(myPackage.IMSI)) myPackage.IMSI = devicedata != null ? devicedata.IMSI : "";
|
||||||
|
if (string.IsNullOrEmpty(myPackage.IMEI)) myPackage.IMEI = devicedata != null ? devicedata.IMEI : "";
|
||||||
|
if (string.IsNullOrEmpty(myPackage.ICCID)) myPackage.ICCID = devicedata != null ? devicedata.ICCID : "";
|
||||||
|
if (!string.IsNullOrEmpty(myPackage.Time) && myPackage.Time.Length == 14)
|
||||||
|
{
|
||||||
|
time = $"{myPackage.Time.Substring(0, 4)}-{myPackage.Time.Substring(4, 2)}-{myPackage.Time.Substring(6, 2)} {myPackage.Time.Substring(8, 2)}:{myPackage.Time.Substring(10, 2)}:{myPackage.Time.Substring(12, 2)}".ToDate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//检查设备是否为今天第一次上报
|
||||||
|
bool isfrist = false;
|
||||||
|
if (device.LastHeartTime.HasValue && device.LastHeartTime.Value.Date != DateTime.Now.Date)
|
||||||
|
{
|
||||||
|
isfrist = true;
|
||||||
|
}
|
||||||
|
//记录数据
|
||||||
|
await dbClient.Ado.UseStoredProcedure().ExecuteCommandAsync("Proc_InsertResult", new
|
||||||
|
{
|
||||||
|
deviceid = device.Id,
|
||||||
|
businessid = device.Businessid,
|
||||||
|
resultid = resultid,
|
||||||
|
imei = myPackage.IMEI,
|
||||||
|
iccid = myPackage.ICCID,
|
||||||
|
imsi = myPackage.IMSI,
|
||||||
|
time = time,
|
||||||
|
latitude = myPackage.Latitude,
|
||||||
|
longitude = myPackage.Longitude,
|
||||||
|
sign = myPackage.GSLQ,
|
||||||
|
city = "",
|
||||||
|
area = myPackage.trashcode,
|
||||||
|
wastetype = myPackage.WasteType,
|
||||||
|
weigth = myPackage.Weight,
|
||||||
|
isheart = myPackage.IsHeart,
|
||||||
|
tare = device.Tare,
|
||||||
|
isfrist = isfrist
|
||||||
|
});
|
||||||
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 增加测量记录
|
/// 增加测量记录
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -144,7 +206,7 @@ namespace Waste.Application
|
||||||
public async Task<ResultInfo> InsertResultAsync(MyPackage myPackage)
|
public async Task<ResultInfo> InsertResultAsync(MyPackage myPackage)
|
||||||
{
|
{
|
||||||
//查找设备
|
//查找设备
|
||||||
var device = await repository.Change<W_Device>().Context.Queryable<W_Device>().FirstAsync(x => myPackage.IMEI == x.Ecode);
|
var device = await dbClient.Queryable<W_Device>().FirstAsync(x => myPackage.IMEI == x.Ecode);
|
||||||
// _loggerService.AddLogger($"接收到的数据,参数:{myPackage.ToJson()}", 3);
|
// _loggerService.AddLogger($"接收到的数据,参数:{myPackage.ToJson()}", 3);
|
||||||
if (device == null)
|
if (device == null)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -43,5 +43,17 @@ namespace Waste.Application.SubscribeInfo
|
||||||
/// <param name="data"></param>
|
/// <param name="data"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task UpdateVersionAsync(DeviceVerS2SDto data);
|
Task UpdateVersionAsync(DeviceVerS2SDto data);
|
||||||
|
/// <summary>
|
||||||
|
/// 4G模块传输的数据增加测量记录
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="myPackage"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task Insert4GResultAsync(nMyPackage myPackage);
|
||||||
|
/// <summary>
|
||||||
|
/// 测试,4G模块传输的数据增加测量记录
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="myPackage"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
void Test(nMyPackage myPackage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
using DotNetCore.CAP;
|
using DotNetCore.CAP;
|
||||||
using Furion.DependencyInjection;
|
using Furion.DependencyInjection;
|
||||||
using Furion.DistributedIDGenerator;
|
using Furion.DistributedIDGenerator;
|
||||||
|
using Furion.Logging.Extensions;
|
||||||
|
using Newtonsoft.Json;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
@ -19,10 +21,14 @@ namespace Waste.Application.SubscribeInfo
|
||||||
{
|
{
|
||||||
private readonly ISqlSugarRepository<W_Device> repository;
|
private readonly ISqlSugarRepository<W_Device> repository;
|
||||||
private readonly SqlSugarClient dbClient;
|
private readonly SqlSugarClient dbClient;
|
||||||
public SubscribeService(ISqlSugarRepository<W_Device> sqlSugarRepository)
|
private readonly IResultService _resultService;
|
||||||
|
private readonly ILoggerService _loggerService;
|
||||||
|
public SubscribeService(ISqlSugarRepository<W_Device> sqlSugarRepository, IResultService resultService, ILoggerService loggerService)
|
||||||
{
|
{
|
||||||
repository = sqlSugarRepository;
|
repository = sqlSugarRepository;
|
||||||
dbClient = repository.Context;
|
dbClient = repository.Context;
|
||||||
|
_resultService = resultService;
|
||||||
|
_loggerService = loggerService;
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 添加记录
|
/// 添加记录
|
||||||
|
|
@ -192,8 +198,8 @@ namespace Waste.Application.SubscribeInfo
|
||||||
[CapSubscribe("device.service.updatever")]
|
[CapSubscribe("device.service.updatever")]
|
||||||
public async Task UpdateVersionAsync(DeviceVerS2SDto data)
|
public async Task UpdateVersionAsync(DeviceVerS2SDto data)
|
||||||
{
|
{
|
||||||
var deivce = await dbClient.Queryable<W_Device>().Select(x=>new W_Device { Id=x.Id}).FirstAsync(x => x.Ecode == data.ecode);
|
var deivce = await dbClient.Queryable<W_Device>().Select(x => new W_Device { Id = x.Id }).FirstAsync(x => x.Ecode == data.ecode);
|
||||||
if(deivce == null)
|
if (deivce == null)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -224,5 +230,27 @@ namespace Waste.Application.SubscribeInfo
|
||||||
await dbClient.Insertable(insertdata).ExecuteCommandAsync();
|
await dbClient.Insertable(insertdata).ExecuteCommandAsync();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 4G模块传输的数据增加测量记录
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="myPackage"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[CapSubscribe("result.service.insert4g")]
|
||||||
|
public async Task Insert4GResultAsync(nMyPackage myPackage)
|
||||||
|
{
|
||||||
|
await _resultService.InsertResultBy4GAsync(myPackage);
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 测试,4G模块传输的数据增加测量记录
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="myPackage"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[CapSubscribe("result.service.testinsert4g")]
|
||||||
|
public void Test(nMyPackage myPackage)
|
||||||
|
{
|
||||||
|
var msg = JsonConvert.SerializeObject(myPackage);
|
||||||
|
_loggerService.AddLogger(msg,1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1657,6 +1657,101 @@
|
||||||
是否为有效测量
|
是否为有效测量
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="T:Waste.Application.nMyPackage">
|
||||||
|
<summary>
|
||||||
|
新的4G模块上传的数据包体
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Waste.Application.nMyPackage.Key">
|
||||||
|
<summary>
|
||||||
|
固定头
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Waste.Application.nMyPackage.Len">
|
||||||
|
<summary>
|
||||||
|
数据体长度
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Waste.Application.nMyPackage.IMEI">
|
||||||
|
<summary>
|
||||||
|
IMEI
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Waste.Application.nMyPackage.ICCID">
|
||||||
|
<summary>
|
||||||
|
ICCID
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Waste.Application.nMyPackage.IMSI">
|
||||||
|
<summary>
|
||||||
|
IMSI
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Waste.Application.nMyPackage.GSLQ">
|
||||||
|
<summary>
|
||||||
|
信号强度
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Waste.Application.nMyPackage.Time">
|
||||||
|
<summary>
|
||||||
|
时间
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Waste.Application.nMyPackage.Longitude">
|
||||||
|
<summary>
|
||||||
|
经度
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Waste.Application.nMyPackage.Latitude">
|
||||||
|
<summary>
|
||||||
|
纬度
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Waste.Application.nMyPackage.size">
|
||||||
|
<summary>
|
||||||
|
桶大小
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Waste.Application.nMyPackage.trashcode">
|
||||||
|
<summary>
|
||||||
|
垃圾桶编号
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Waste.Application.nMyPackage.WasteType">
|
||||||
|
<summary>
|
||||||
|
垃圾类别
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Waste.Application.nMyPackage.Weight">
|
||||||
|
<summary>
|
||||||
|
重量,KG
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Waste.Application.nMyPackage.Body">
|
||||||
|
<summary>
|
||||||
|
内容
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Waste.Application.nMyPackage.Str">
|
||||||
|
<summary>
|
||||||
|
字符串结果
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Waste.Application.nMyPackage.IsChecked">
|
||||||
|
<summary>
|
||||||
|
是否是否通过校检,true-是,false-否
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Waste.Application.nMyPackage.IsHeart">
|
||||||
|
<summary>
|
||||||
|
是否为心跳包数据
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Waste.Application.nMyPackage.IsWeight">
|
||||||
|
<summary>
|
||||||
|
是否为有效测量
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="T:Waste.Application.IResultService">
|
<member name="T:Waste.Application.IResultService">
|
||||||
<summary>
|
<summary>
|
||||||
投放记录
|
投放记录
|
||||||
|
|
@ -1676,6 +1771,13 @@
|
||||||
<param name="myPackage"></param>
|
<param name="myPackage"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:Waste.Application.IResultService.InsertResultBy4GAsync(Waste.Application.nMyPackage)">
|
||||||
|
<summary>
|
||||||
|
新的4G模块测量结果增加
|
||||||
|
</summary>
|
||||||
|
<param name="myPackage"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
<member name="T:Waste.Application.ResultInfos.ResultAppService">
|
<member name="T:Waste.Application.ResultInfos.ResultAppService">
|
||||||
<summary>
|
<summary>
|
||||||
投放记录
|
投放记录
|
||||||
|
|
@ -1707,6 +1809,13 @@
|
||||||
<param name="param"></param>
|
<param name="param"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:Waste.Application.ResultService.InsertResultBy4GAsync(Waste.Application.nMyPackage)">
|
||||||
|
<summary>
|
||||||
|
新的4G模块测量结果增加
|
||||||
|
</summary>
|
||||||
|
<param name="myPackage"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
<member name="M:Waste.Application.ResultService.InsertResultAsync(Waste.Application.MyPackage)">
|
<member name="M:Waste.Application.ResultService.InsertResultAsync(Waste.Application.MyPackage)">
|
||||||
<summary>
|
<summary>
|
||||||
增加测量记录
|
增加测量记录
|
||||||
|
|
@ -1899,6 +2008,20 @@
|
||||||
<param name="data"></param>
|
<param name="data"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:Waste.Application.SubscribeInfo.ISubscribeService.Insert4GResultAsync(Waste.Application.nMyPackage)">
|
||||||
|
<summary>
|
||||||
|
4G模块传输的数据增加测量记录
|
||||||
|
</summary>
|
||||||
|
<param name="myPackage"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:Waste.Application.SubscribeInfo.ISubscribeService.Test(Waste.Application.nMyPackage)">
|
||||||
|
<summary>
|
||||||
|
测试,4G模块传输的数据增加测量记录
|
||||||
|
</summary>
|
||||||
|
<param name="myPackage"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
<member name="T:Waste.Application.SubscribeInfo.SubscribeService">
|
<member name="T:Waste.Application.SubscribeInfo.SubscribeService">
|
||||||
<summary>
|
<summary>
|
||||||
CAP订阅相关接口
|
CAP订阅相关接口
|
||||||
|
|
@ -1939,6 +2062,20 @@
|
||||||
<param name="data"></param>
|
<param name="data"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:Waste.Application.SubscribeInfo.SubscribeService.Insert4GResultAsync(Waste.Application.nMyPackage)">
|
||||||
|
<summary>
|
||||||
|
4G模块传输的数据增加测量记录
|
||||||
|
</summary>
|
||||||
|
<param name="myPackage"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:Waste.Application.SubscribeInfo.SubscribeService.Test(Waste.Application.nMyPackage)">
|
||||||
|
<summary>
|
||||||
|
测试,4G模块传输的数据增加测量记录
|
||||||
|
</summary>
|
||||||
|
<param name="myPackage"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
<member name="T:Waste.Application.CityListModel">
|
<member name="T:Waste.Application.CityListModel">
|
||||||
<summary>
|
<summary>
|
||||||
地址列表
|
地址列表
|
||||||
|
|
|
||||||
|
|
@ -15,14 +15,14 @@
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="DotNetCore.CAP" Version="5.1.4" />
|
<PackageReference Include="DotNetCore.CAP" Version="5.2.0" />
|
||||||
<PackageReference Include="DotNetCore.CAP.RabbitMQ" Version="5.1.4" />
|
<PackageReference Include="DotNetCore.CAP.RabbitMQ" Version="5.2.0" />
|
||||||
<PackageReference Include="DotNetCore.CAP.SqlServer" Version="5.1.4" />
|
<PackageReference Include="DotNetCore.CAP.SqlServer" Version="5.2.0" />
|
||||||
<PackageReference Include="Furion" Version="2.19.1" />
|
<PackageReference Include="Furion" Version="2.20.6" />
|
||||||
<PackageReference Include="Furion.Extras.Authentication.JwtBearer" Version="2.19.1" />
|
<PackageReference Include="Furion.Extras.Authentication.JwtBearer" Version="2.20.6" />
|
||||||
<PackageReference Include="Furion.Extras.DatabaseAccessor.SqlSugar" Version="2.19.1" />
|
<PackageReference Include="Furion.Extras.DatabaseAccessor.SqlSugar" Version="2.20.6" />
|
||||||
<PackageReference Include="Furion.Extras.Logging.Serilog" Version="2.19.1" />
|
<PackageReference Include="Furion.Extras.Logging.Serilog" Version="2.20.6" />
|
||||||
<PackageReference Include="Furion.Extras.ObjectMapper.Mapster" Version="2.19.1" />
|
<PackageReference Include="Furion.Extras.ObjectMapper.Mapster" Version="2.20.6" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
||||||
|
|
@ -5,10 +5,6 @@
|
||||||
<TargetFramework>net5.0</TargetFramework>
|
<TargetFramework>net5.0</TargetFramework>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<PackageReference Include="SqlSugarCore" Version="5.0.4" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\Waste.Domain\Waste.Domain.csproj" />
|
<ProjectReference Include="..\Waste.Domain\Waste.Domain.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
AT+UART=1,9600,8,1,NONE,NFC
|
||||||
|
AT+NETP=A,1,TCP,waste.jt-sky.com,40432,long
|
||||||
|
AT+HEART=A,300,A9%IMEI|%GPS
|
||||||
|
AT+NETPENC=A,Disable
|
||||||
|
AT+NREGEN=A,on
|
||||||
|
AT+NREGSND=A,both
|
||||||
|
AT+NREGDT=A,A9%ICCID|%IMEI|%IMSI|%GSLQ|%DATE|%TIME|
|
||||||
|
AT+TCPTO=A,300
|
||||||
|
AT+NETPIDEN=A,off
|
||||||
|
AT+CFGTF
|
||||||
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 63 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 72 KiB |
|
|
@ -1,99 +0,0 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
巨天平台软件设计方案
|
|
||||||
文件编号:jt-sky-20210401FA
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
编制:________刘照良________________
|
|
||||||
审核:________吴成发________________
|
|
||||||
批准:_______ 孙海清________________
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
巨鼎天衡
|
|
||||||
2021年04月
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
修订记录
|
|
||||||
日期
|
|
||||||
版本
|
|
||||||
描述
|
|
||||||
修改人
|
|
||||||
2021-04-01
|
|
||||||
V1.0.0
|
|
||||||
创建文档
|
|
||||||
刘照良
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
一、引言
|
|
||||||
1. 概述
|
|
||||||
传统形式的垃圾分类基本上是用手工来记录投放数据,过磅数据,出车数据。手工记录效率比较低,出错比较多,统计查询等都不方便。为了解决目前存在的问题,为此开发本软件系统。全部采用电子化来自动管理目前的各个环节。所有数据一库刊,实现了数据安全管理,出错减少,统计查询方便快捷。可以随手随地在浏览器中实时查询各个环节的具体数据,提高了管理效率
|
|
||||||
软件总体架构
|
|
||||||
软件开发环境
|
|
||||||
操作系统:windows
|
|
||||||
开发语言:C#
|
|
||||||
开发平台:VSCODE
|
|
||||||
软件基本结构
|
|
||||||
该系统以设备为核心,连接上巨天云平台和政府对接平台,巨天云平台包括数据处理平台、数据展示平台、数据存储平台
|
|
||||||
数据处理平台主要对设备数据进行收发,数据协议格式解析处理,然后传输到数据存储平台进行记录
|
|
||||||
数据展示平台主要是对设备数据进行汇总展示,记录查询等
|
|
||||||
数据存数平台主要是对所有相关数据进行存储的平台
|
|
||||||
各个平台的具体关系如图所示:
|
|
||||||
|
|
||||||
三、界面设计
|
|
||||||
首页
|
|
||||||
|
|
||||||
设备列表
|
|
||||||
|
|
||||||
商户管理
|
|
||||||
|
|
||||||
物品编码
|
|
||||||
|
|
||||||
回收记录
|
|
||||||
|
|
||||||
统计报表
|
|
||||||
|
|
||||||
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 44 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 66 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 76 KiB |
|
|
@ -50,7 +50,7 @@ namespace Waste.Socket
|
||||||
var reader = new SequenceReader<byte>(buffer);
|
var reader = new SequenceReader<byte>(buffer);
|
||||||
var _reader = reader;
|
var _reader = reader;
|
||||||
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
|
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
|
||||||
package.Str = _reader.ReadString(Encoding.GetEncoding("GB2312"));
|
package.Str = Tools.GetString(buffer);
|
||||||
reader.TryRead(out byte keyByte);
|
reader.TryRead(out byte keyByte);
|
||||||
string key = keyByte.ByteToHexStr();
|
string key = keyByte.ByteToHexStr();
|
||||||
if (key != "A9")
|
if (key != "A9")
|
||||||
|
|
@ -123,6 +123,30 @@ namespace Waste.Socket
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static class Tools
|
public static class Tools
|
||||||
{
|
{
|
||||||
|
public static string GetString(in this ReadOnlySequence<byte> payload,
|
||||||
|
Encoding encoding = null)
|
||||||
|
{
|
||||||
|
encoding ??= Encoding.UTF8;
|
||||||
|
return payload.IsSingleSegment ? encoding.GetString(payload.FirstSpan)
|
||||||
|
: GetStringSlow(payload, encoding);
|
||||||
|
|
||||||
|
static string GetStringSlow(in ReadOnlySequence<byte> payload, Encoding encoding)
|
||||||
|
{
|
||||||
|
// linearize
|
||||||
|
int length = checked((int)payload.Length);
|
||||||
|
var oversized = ArrayPool<byte>.Shared.Rent(length);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
payload.CopyTo(oversized);
|
||||||
|
return encoding.GetString(oversized, 0, length);
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
ArrayPool<byte>.Shared.Return(oversized);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -163,15 +187,45 @@ namespace Waste.Socket
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="bt"></param>
|
/// <param name="bt"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static string BytesToString(this byte[] bt)
|
public static string BytesToString(this byte[] bytes)
|
||||||
{
|
{
|
||||||
string returnStr = "";
|
string returnStr = "";
|
||||||
if (bt != null)
|
if (bytes != null)
|
||||||
{
|
{
|
||||||
returnStr = Encoding.GetEncoding("GB2312").GetString(bt);
|
returnStr = Encoding.GetEncoding("GB2312").GetString(bytes);
|
||||||
}
|
}
|
||||||
return returnStr;
|
return returnStr;
|
||||||
}
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 字节数据转中文
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="bytes"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static string BytesToChsString(this byte[] bytes)
|
||||||
|
{
|
||||||
|
string hex = BytesToHexStr(bytes);
|
||||||
|
if (hex == null)
|
||||||
|
return "";
|
||||||
|
if (hex.Length % 2 != 0)
|
||||||
|
{
|
||||||
|
hex += "20";//空格
|
||||||
|
}
|
||||||
|
for (int i = 0; i < bytes.Length; i++)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// 每两个字符是一个 byte。
|
||||||
|
bytes[i] = byte.Parse(hex.Substring(i * 2, 2),
|
||||||
|
System.Globalization.NumberStyles.HexNumber);
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 获得 GB2312,Chinese Simplified。
|
||||||
|
Encoding chs = Encoding.GetEncoding("gb2312");
|
||||||
|
return chs.GetString(bytes);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ namespace Waste.Socket
|
||||||
public static RabbitMqService rabbitMqProxy;
|
public static RabbitMqService rabbitMqProxy;
|
||||||
static async Task Main(string[] args)
|
static async Task Main(string[] args)
|
||||||
{
|
{
|
||||||
var filepath = "e:/errlog/wastersocket";
|
var filepath = "d:/errlog/wastersocket";
|
||||||
string date = DateTime.Now.ToString("yyyy-MM-dd");//按时间创建文件夹
|
string date = DateTime.Now.ToString("yyyy-MM-dd");//按时间创建文件夹
|
||||||
string outputTemplate = "{NewLine}【{Level:u3}】{Timestamp:yyyy-MM-dd HH:mm:ss.fff}" +
|
string outputTemplate = "{NewLine}【{Level:u3}】{Timestamp:yyyy-MM-dd HH:mm:ss.fff}" +
|
||||||
"{NewLine}#Msg#{Message:lj}" +
|
"{NewLine}#Msg#{Message:lj}" +
|
||||||
|
|
@ -36,14 +36,14 @@ namespace Waste.Socket
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
||||||
//rabbitMqProxy = new RabbitMqService(new MqConfig
|
rabbitMqProxy = new RabbitMqService(new MqConfig
|
||||||
//{
|
{
|
||||||
// AutomaticRecoveryEnabled = true,
|
AutomaticRecoveryEnabled = true,
|
||||||
// Host = "localhost",
|
Host = "localhost",
|
||||||
// HeartBeat = new TimeSpan(60),
|
HeartBeat = new TimeSpan(60),
|
||||||
// UserName = "liuzl",
|
UserName = "liuzl",
|
||||||
// Password = "liuzl"
|
Password = "liuzl"
|
||||||
//});
|
});
|
||||||
//创建宿主
|
//创建宿主
|
||||||
var host = SuperSocketHostBuilder
|
var host = SuperSocketHostBuilder
|
||||||
.Create<MyPackage, WastePackageFilter>()
|
.Create<MyPackage, WastePackageFilter>()
|
||||||
|
|
@ -85,7 +85,7 @@ namespace Waste.Socket
|
||||||
//}
|
//}
|
||||||
//向rabbitmq队列发布消息
|
//向rabbitmq队列发布消息
|
||||||
var data = JsonConvert.SerializeObject(package);
|
var data = JsonConvert.SerializeObject(package);
|
||||||
// rabbitMqProxy.Publish("wasteexchang", "wastequeue", "waste", data, true);
|
rabbitMqProxy.Publish("wasteexchang", "wastequeue", "waste", data, true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -122,7 +122,7 @@ namespace Waste.Socket
|
||||||
}
|
}
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
{
|
{
|
||||||
// rabbitMqProxy.Dispose();
|
rabbitMqProxy.Dispose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,87 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Waste.SocketService
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// socket包内容
|
||||||
|
/// </summary>
|
||||||
|
public class MyPackage
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 固定头
|
||||||
|
/// </summary>
|
||||||
|
public string Key { get; set; } = "";
|
||||||
|
/// <summary>
|
||||||
|
/// 数据体长度
|
||||||
|
/// </summary>
|
||||||
|
public int Len { get; set; } = 0;
|
||||||
|
/// <summary>
|
||||||
|
/// IMEI
|
||||||
|
/// </summary>
|
||||||
|
public string IMEI { get; set; } = "";
|
||||||
|
/// <summary>
|
||||||
|
/// ICCID
|
||||||
|
/// </summary>
|
||||||
|
public string ICCID { get; set; } = "";
|
||||||
|
/// <summary>
|
||||||
|
/// IMSI
|
||||||
|
/// </summary>
|
||||||
|
public string IMSI { get; set; } = "";
|
||||||
|
/// <summary>
|
||||||
|
/// 信号强度
|
||||||
|
/// </summary>
|
||||||
|
public string GSLQ { get; set; } = "";
|
||||||
|
/// <summary>
|
||||||
|
/// 时间
|
||||||
|
/// </summary>
|
||||||
|
public string Time { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 经度
|
||||||
|
/// </summary>
|
||||||
|
public string Longitude { get; set; } = "";
|
||||||
|
/// <summary>
|
||||||
|
/// 纬度
|
||||||
|
/// </summary>
|
||||||
|
public string Latitude { get; set; } = "";
|
||||||
|
/// <summary>
|
||||||
|
/// 桶大小
|
||||||
|
/// </summary>
|
||||||
|
public string size { get; set; } = "";
|
||||||
|
/// <summary>
|
||||||
|
/// 垃圾桶编号
|
||||||
|
/// </summary>
|
||||||
|
public string trashcode { get; set; } = "";
|
||||||
|
/// <summary>
|
||||||
|
/// 垃圾类别
|
||||||
|
/// </summary>
|
||||||
|
public string WasteType { get; set; } = "";
|
||||||
|
/// <summary>
|
||||||
|
/// 重量,KG
|
||||||
|
/// </summary>
|
||||||
|
public string Weight { get; set; } = "0";
|
||||||
|
/// <summary>
|
||||||
|
/// 内容
|
||||||
|
/// </summary>
|
||||||
|
public string Body { get; set; } = "";
|
||||||
|
/// <summary>
|
||||||
|
/// 字符串结果
|
||||||
|
/// </summary>
|
||||||
|
public string Str { get; set; } = "";
|
||||||
|
/// <summary>
|
||||||
|
/// 是否是否通过校检,true-是,false-否
|
||||||
|
/// </summary>
|
||||||
|
public bool IsChecked { get; set; } = true;
|
||||||
|
/// <summary>
|
||||||
|
/// 是否为心跳包数据
|
||||||
|
/// </summary>
|
||||||
|
public bool IsHeart { get; set; } = false;
|
||||||
|
/// <summary>
|
||||||
|
/// 是否为有效测量
|
||||||
|
/// </summary>
|
||||||
|
public bool IsWeight { get; set; } = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,326 @@
|
||||||
|
using SuperSocket.ProtoBase;
|
||||||
|
using System;
|
||||||
|
using System.Buffers;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Waste.SocketService
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 转换工具
|
||||||
|
/// </summary>
|
||||||
|
public static class Tools
|
||||||
|
{
|
||||||
|
public static string GetString(in this ReadOnlySequence<byte> payload,
|
||||||
|
Encoding encoding = null)
|
||||||
|
{
|
||||||
|
encoding ??= Encoding.UTF8;
|
||||||
|
return payload.IsSingleSegment ? encoding.GetString(payload.FirstSpan)
|
||||||
|
: GetStringSlow(payload, encoding);
|
||||||
|
|
||||||
|
static string GetStringSlow(in ReadOnlySequence<byte> payload, Encoding encoding)
|
||||||
|
{
|
||||||
|
// linearize
|
||||||
|
int length = checked((int)payload.Length);
|
||||||
|
var oversized = ArrayPool<byte>.Shared.Rent(length);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
payload.CopyTo(oversized);
|
||||||
|
return encoding.GetString(oversized, 0, length);
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
ArrayPool<byte>.Shared.Return(oversized);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="bt"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static string ByteToHexStr(this byte bt)
|
||||||
|
{
|
||||||
|
return bt.ToString("X2");
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// byte转int
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="bt"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static int ByteToInt(this byte bt)
|
||||||
|
{
|
||||||
|
return Convert.ToInt32(((int)bt).ToString("X2"), 16);
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 字节数组转16进制
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="bt"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static string BytesToHexStr(this byte[] bt)
|
||||||
|
{
|
||||||
|
string returnStr = "";
|
||||||
|
if (bt != null)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < bt.Length; i++)
|
||||||
|
{
|
||||||
|
returnStr += bt[i].ToString("X2") + " ";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return returnStr;
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 字节数组转字符串
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="bt"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static string BytesToString(this byte[] bytes)
|
||||||
|
{
|
||||||
|
string returnStr = "";
|
||||||
|
if (bytes != null)
|
||||||
|
{
|
||||||
|
returnStr = Encoding.GetEncoding("GB2312").GetString(bytes);
|
||||||
|
}
|
||||||
|
return returnStr;
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 字节数据转中文
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="bytes"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static string BytesToChsString(this byte[] bytes)
|
||||||
|
{
|
||||||
|
string hex = BytesToHexStr(bytes);
|
||||||
|
if (hex == null)
|
||||||
|
return "";
|
||||||
|
if (hex.Length % 2 != 0)
|
||||||
|
{
|
||||||
|
hex += "20";//空格
|
||||||
|
}
|
||||||
|
for (int i = 0; i < bytes.Length; i++)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// 每两个字符是一个 byte。
|
||||||
|
bytes[i] = byte.Parse(hex.Substring(i * 2, 2),
|
||||||
|
System.Globalization.NumberStyles.HexNumber);
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 获得 GB2312,Chinese Simplified。
|
||||||
|
Encoding chs = Encoding.GetEncoding("gb2312");
|
||||||
|
return chs.GetString(bytes);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 16进制转10进制
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="hex"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static long HextToDec(this string hex)
|
||||||
|
{
|
||||||
|
char[] nums = hex.ToCharArray();
|
||||||
|
long total = 0;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
for (int i = 0; i < nums.Length; i++)
|
||||||
|
{
|
||||||
|
String strNum = nums[i].ToString().ToUpper();
|
||||||
|
switch (strNum)
|
||||||
|
{
|
||||||
|
case "A":
|
||||||
|
strNum = "10";
|
||||||
|
break;
|
||||||
|
case "B":
|
||||||
|
strNum = "11";
|
||||||
|
break;
|
||||||
|
case "C":
|
||||||
|
strNum = "12";
|
||||||
|
break;
|
||||||
|
case "D":
|
||||||
|
strNum = "13";
|
||||||
|
break;
|
||||||
|
case "E":
|
||||||
|
strNum = "14";
|
||||||
|
break;
|
||||||
|
case "F":
|
||||||
|
strNum = "15";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
double power = Math.Pow(16, Convert.ToDouble(nums.Length - i - 1));
|
||||||
|
total += Convert.ToInt64(strNum) * Convert.ToInt64(power);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (System.Exception ex)
|
||||||
|
{
|
||||||
|
string strErorr = ex.ToString();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return total;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 垃圾分类格式解析,传输过来的数据格式类似于:九方城@前门@厨余垃圾@7.91
|
||||||
|
/// </summary>
|
||||||
|
public class WastePackageFilter : PipelineFilterBase<MyPackage>
|
||||||
|
{
|
||||||
|
public override MyPackage Filter(ref SequenceReader<byte> reader)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (reader.Length <= 0)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
var package = new MyPackage();
|
||||||
|
var _reader = reader;
|
||||||
|
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
|
||||||
|
package.Str = _reader.ReadString(Encoding.GetEncoding("GB2312"));
|
||||||
|
string key = "";
|
||||||
|
int keylen = 1;
|
||||||
|
#region 解析头部,头部固定为A9
|
||||||
|
if (reader.Length >= 2)
|
||||||
|
{
|
||||||
|
keylen = 2;
|
||||||
|
byte[] keys = new byte[2];
|
||||||
|
reader.TryRead(out byte key1Byte);
|
||||||
|
keys[0] = key1Byte;
|
||||||
|
reader.TryRead(out byte key2Byte);
|
||||||
|
keys[1] = key2Byte;
|
||||||
|
key = keys.BytesToString();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
byte[] keys = new byte[1];
|
||||||
|
reader.TryRead(out byte key1Byte);
|
||||||
|
keys[0] = key1Byte;
|
||||||
|
key = keys.BytesToString();
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
if (key != "A9")
|
||||||
|
{
|
||||||
|
var len = reader.Length;
|
||||||
|
string msg = "";
|
||||||
|
reader.Rewind(keylen);
|
||||||
|
for (var i = 0; i < len; i++)
|
||||||
|
{
|
||||||
|
reader.TryRead(out byte msgByte);
|
||||||
|
msg += msgByte.ByteToHexStr();
|
||||||
|
}
|
||||||
|
package.IsChecked = false;
|
||||||
|
package.Body = msg;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
package.Key = key;
|
||||||
|
package.Len = (int)reader.Length - 2;
|
||||||
|
string body = "";
|
||||||
|
byte[] bytes = new byte[package.Len];
|
||||||
|
for (var i = 0; i < package.Len; i++)
|
||||||
|
{
|
||||||
|
reader.TryRead(out byte val);
|
||||||
|
bytes[i] = val;
|
||||||
|
}
|
||||||
|
if (bytes.Length == 1 && bytes[0] == 0)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
body = bytes.BytesToString().Replace("\r", "").Replace("\n", "");
|
||||||
|
package.Body = bytes.BytesToHexStr();
|
||||||
|
var arr = body.Split('|');
|
||||||
|
#region 心跳包的处理,IMEI|GPS
|
||||||
|
if (arr.Length == 2)
|
||||||
|
{
|
||||||
|
package.IsHeart = true;
|
||||||
|
package.IMEI = arr[0];
|
||||||
|
var gpsarr = arr[1].Split(',');
|
||||||
|
if (gpsarr.Length == 2)
|
||||||
|
{
|
||||||
|
package.Longitude = gpsarr[0];
|
||||||
|
package.Latitude = gpsarr[1];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (arr.Length == 7)
|
||||||
|
{
|
||||||
|
package.ICCID = arr[0];
|
||||||
|
package.IMEI = arr[1];
|
||||||
|
package.IMSI = arr[2];
|
||||||
|
var gslq = Encoding.GetEncoding("GB2312").GetBytes(arr[3]);
|
||||||
|
if (gslq.Length == 2)
|
||||||
|
{
|
||||||
|
package.GSLQ = Convert.ToInt32(gslq[1]).ToString();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
package.GSLQ = gslq.BytesToHexStr();
|
||||||
|
}
|
||||||
|
package.Time = $"{arr[4]}{arr[5]}".Replace("-", "").Replace(":", "");
|
||||||
|
//厨余垃圾/大桶@垃圾桶编号@厨余垃圾@7.91
|
||||||
|
var b = Encoding.GetEncoding("GB2312").GetBytes(arr[6]);
|
||||||
|
if (b.Length > 23)
|
||||||
|
{
|
||||||
|
byte[] tbyte = new byte[1]; //桶类型
|
||||||
|
byte[] codebyte = new byte[5];//垃圾桶编号
|
||||||
|
byte[] typebyte = new byte[8];//垃圾类型
|
||||||
|
byte[] wbyte = new byte[b.Length - 23];
|
||||||
|
byte[] db = new byte[b.Length - 8];
|
||||||
|
for (var j = 0; j < b.Length; j++)
|
||||||
|
{
|
||||||
|
if (j == 6)
|
||||||
|
{
|
||||||
|
tbyte[j - 6] = b[j];
|
||||||
|
}
|
||||||
|
else if (j > 7 && j < 13)
|
||||||
|
{
|
||||||
|
codebyte[j - 8] = b[j];
|
||||||
|
}
|
||||||
|
else if (j > 13 && j < 22)
|
||||||
|
{
|
||||||
|
typebyte[j - 14] = b[j];
|
||||||
|
}
|
||||||
|
else if (j > 22)
|
||||||
|
{
|
||||||
|
wbyte[j - 23] = b[j];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var thex = tbyte.BytesToHexStr();
|
||||||
|
var codehex = codebyte.BytesToHexStr();
|
||||||
|
var typehex = typebyte.BytesToHexStr();
|
||||||
|
var typestr = typebyte.BytesToString();
|
||||||
|
var whex = wbyte.BytesToHexStr();
|
||||||
|
var wstr = wbyte.BytesToString();
|
||||||
|
package.size = thex.Replace(" ", "");
|
||||||
|
package.trashcode = codehex.Replace(" ", "").HextToDec().ToString();
|
||||||
|
package.WasteType = typestr;
|
||||||
|
package.Weight = wstr;
|
||||||
|
package.IsWeight = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
package.size = arr[6];
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
return package;
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Console.WriteLine($"数据处理发生异常:{ex.Message}");
|
||||||
|
return new MyPackage();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,144 @@
|
||||||
|
using DotNetCore.CAP;
|
||||||
|
using Furion;
|
||||||
|
using Furion.DependencyInjection;
|
||||||
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
|
using Microsoft.Extensions.Hosting;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Serilog;
|
||||||
|
using Serilog.Events;
|
||||||
|
using SuperSocket;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Waste.SocketService
|
||||||
|
{
|
||||||
|
public class Program
|
||||||
|
{
|
||||||
|
public static void Main(string[] args)
|
||||||
|
{
|
||||||
|
CreateHostBuilder(args).Build().Run();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static IHostBuilder CreateHostBuilder(string[] args) =>
|
||||||
|
Host.CreateDefaultBuilder(args)
|
||||||
|
.UseWindowsService()
|
||||||
|
.Inject()
|
||||||
|
//日志注入,将serilog设置为日志记录提供程序
|
||||||
|
.UseSerilogDefault(config =>
|
||||||
|
{
|
||||||
|
var filepath = App.Configuration["logfile"];
|
||||||
|
string date = DateTime.Now.ToString("yyyy-MM-dd");//按时间创建文件夹
|
||||||
|
string outputTemplate = "{NewLine}【{Level:u3}】{Timestamp:yyyy-MM-dd HH:mm:ss.fff}" +
|
||||||
|
"{NewLine}#Msg#{Message:lj}" +
|
||||||
|
"{NewLine}#Pro #{Properties:j}" +
|
||||||
|
"{NewLine}#Exc#{Exception}" +
|
||||||
|
new string('-', 50);//输出模板
|
||||||
|
//1.输出所有restrictedToMinimumLevel:LogEventLevel类型
|
||||||
|
config
|
||||||
|
.WriteTo.Seq("http://localhost:5341/")
|
||||||
|
|
||||||
|
//2.1仅输出 LogEventLevel.Debug 类型
|
||||||
|
.WriteTo.Logger(lg => lg.Filter.ByIncludingOnly(evt => evt.Level == LogEventLevel.Debug)//筛选过滤
|
||||||
|
.WriteTo.File($"{filepath}/{date}/{LogEventLevel.Debug}.log",
|
||||||
|
outputTemplate: outputTemplate,
|
||||||
|
rollingInterval: RollingInterval.Day,//日志按日保存,这样会在文件名称后自动加上日期后缀
|
||||||
|
encoding: Encoding.UTF8 // 文件字符编码
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
//2.2仅输出 LogEventLevel.Error 类型
|
||||||
|
.WriteTo.Logger(lg => lg.Filter.ByIncludingOnly(evt => evt.Level == LogEventLevel.Error)//筛选过滤
|
||||||
|
.WriteTo.File($"{filepath}/{date}/{LogEventLevel.Error}.log",
|
||||||
|
outputTemplate: outputTemplate,
|
||||||
|
rollingInterval: RollingInterval.Day,//日志按日保存,这样会在文件名称后自动加上日期后缀
|
||||||
|
encoding: Encoding.UTF8 // 文件字符编码
|
||||||
|
)
|
||||||
|
)
|
||||||
|
.WriteTo.Logger(lg => lg.Filter.ByIncludingOnly(evt => evt.Level == LogEventLevel.Information)//筛选过滤
|
||||||
|
.WriteTo.File($"{filepath}/{date}/{LogEventLevel.Information}.log",
|
||||||
|
outputTemplate: outputTemplate,
|
||||||
|
rollingInterval: RollingInterval.Day,//日志按日保存,这样会在文件名称后自动加上日期后缀
|
||||||
|
encoding: Encoding.UTF8 // 文件字符编码
|
||||||
|
)
|
||||||
|
)
|
||||||
|
.WriteTo.Logger(lg => lg.Filter.ByIncludingOnly(evt => evt.Level == LogEventLevel.Fatal)//筛选过滤
|
||||||
|
.WriteTo.File($"{filepath}/{date}/{LogEventLevel.Fatal}.log",
|
||||||
|
outputTemplate: outputTemplate,
|
||||||
|
rollingInterval: RollingInterval.Day,//日志按日保存,这样会在文件名称后自动加上日期后缀
|
||||||
|
encoding: Encoding.UTF8 // 文件字符编码
|
||||||
|
)
|
||||||
|
)
|
||||||
|
.WriteTo.Logger(lg => lg.Filter.ByIncludingOnly(evt => evt.Level == LogEventLevel.Warning)//筛选过滤
|
||||||
|
.WriteTo.File($"{filepath}/{date}/{LogEventLevel.Warning}.log",
|
||||||
|
outputTemplate: outputTemplate,
|
||||||
|
rollingInterval: RollingInterval.Day,//日志按日保存,这样会在文件名称后自动加上日期后缀
|
||||||
|
encoding: Encoding.UTF8 // 文件字符编码
|
||||||
|
)
|
||||||
|
)
|
||||||
|
;
|
||||||
|
})
|
||||||
|
.ConfigureServices((hostContext, services) =>
|
||||||
|
{
|
||||||
|
var configuration = hostContext.Configuration;
|
||||||
|
//添加CAP支持
|
||||||
|
services.AddCap(x =>
|
||||||
|
{
|
||||||
|
x.DefaultGroupName = "jtsky.queue.waste";
|
||||||
|
//配置rabbitmq支持
|
||||||
|
string port = configuration["RabbitmqSetting:Port"];
|
||||||
|
int p = Convert.ToInt32(port);
|
||||||
|
x.UseRabbitMQ(opt =>
|
||||||
|
{
|
||||||
|
opt.HostName = configuration["RabbitmqSetting:HostName"]; //配置ip地址
|
||||||
|
opt.Port = p;//配置端口
|
||||||
|
opt.UserName = configuration["RabbitmqSetting:UserName"];//配置用户名
|
||||||
|
opt.Password = configuration["RabbitmqSetting:Password"];//配置Miami
|
||||||
|
});
|
||||||
|
//配置sqlserver支持
|
||||||
|
x.UseSqlServer(configuration["RabbitmqSetting:DBConnection"]);
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.AsSuperSocketHostBuilder<MyPackage, WastePackageFilter>()
|
||||||
|
.UsePackageHandler(async (session, package) =>
|
||||||
|
{
|
||||||
|
//向rabbitmq队列发布消息
|
||||||
|
await Scoped.Create(async (_, scope) =>
|
||||||
|
{
|
||||||
|
var services = scope.ServiceProvider;
|
||||||
|
var _capBus = services.GetService<ICapPublisher>();
|
||||||
|
var _logger = services.GetService<ILogger>();
|
||||||
|
if (package.IsChecked)
|
||||||
|
{
|
||||||
|
string msg = $"通过校检,十六进制:{package.Body},字符串:{package.Str}";
|
||||||
|
if (package.IsHeart)
|
||||||
|
{
|
||||||
|
msg = $"{msg},心跳包数据,IMEI:{package.IMEI},经度:{package.Longitude},纬度:{package.Latitude}";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
msg = $"{msg},测量数据,ICCID:{package.ICCID},IMEI:{package.IMEI},IMSI:{package.IMSI},信号:{package.GSLQ}";
|
||||||
|
if (package.IsWeight)
|
||||||
|
{
|
||||||
|
msg = $"{msg},桶大小:{package.size},垃圾桶编号:{package.trashcode},垃圾类别:{package.WasteType},重量:{package.Weight}KG";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
msg = $"{msg},数据:{package.size}";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//向rabbitmq队列发布消息
|
||||||
|
//await _capBus.PublishAsync("result.service.insert4g", package);
|
||||||
|
_logger.Information(msg);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_logger.Information($"未通过校检,十六进制:{package.Body},字符串:{package.Str}");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})
|
||||||
|
;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,17 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||||
|
-->
|
||||||
|
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<PropertyGroup>
|
||||||
|
<Configuration>Release</Configuration>
|
||||||
|
<Platform>Any CPU</Platform>
|
||||||
|
<PublishDir>D:\webpublish\socket.jt-sky.com</PublishDir>
|
||||||
|
<PublishProtocol>FileSystem</PublishProtocol>
|
||||||
|
<TargetFramework>net5.0</TargetFramework>
|
||||||
|
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
|
||||||
|
<SelfContained>false</SelfContained>
|
||||||
|
<PublishSingleFile>False</PublishSingleFile>
|
||||||
|
<PublishReadyToRun>False</PublishReadyToRun>
|
||||||
|
</PropertyGroup>
|
||||||
|
</Project>
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||||
|
-->
|
||||||
|
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<PropertyGroup>
|
||||||
|
<History>True|2021-11-23T09:47:15.3723334Z;True|2021-11-23T17:46:56.0953346+08:00;True|2021-11-23T15:39:30.7279293+08:00;True|2021-11-23T15:26:11.9749528+08:00;True|2021-11-23T15:19:15.3506970+08:00;True|2021-11-23T14:58:10.0460847+08:00;</History>
|
||||||
|
</PropertyGroup>
|
||||||
|
</Project>
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
{
|
||||||
|
"profiles": {
|
||||||
|
"Waste.SocketService.cs": {
|
||||||
|
"commandName": "Project",
|
||||||
|
"dotnetRunMessages": "true",
|
||||||
|
"environmentVariables": {
|
||||||
|
"DOTNET_ENVIRONMENT": "Development"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,19 @@
|
||||||
|
<Project Sdk="Microsoft.NET.Sdk.Worker">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>net5.0</TargetFramework>
|
||||||
|
<UserSecretsId>dotnet-Waste.SocketService.cs-86821858-9791-49AC-BFFC-2E77F65D5A61</UserSecretsId>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="DotNetCore.CAP" Version="5.2.0" />
|
||||||
|
<PackageReference Include="DotNetCore.CAP.RabbitMQ" Version="5.2.0" />
|
||||||
|
<PackageReference Include="DotNetCore.CAP.SqlServer" Version="5.2.0" />
|
||||||
|
<PackageReference Include="Furion" Version="2.20.6" />
|
||||||
|
<PackageReference Include="Furion.Extras.Logging.Serilog" Version="2.20.6" />
|
||||||
|
<PackageReference Include="Microsoft.Extensions.Hosting" Version="5.0.0" />
|
||||||
|
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="5.0.1" />
|
||||||
|
<PackageReference Include="Serilog.Sinks.Seq" Version="5.1.0" />
|
||||||
|
<PackageReference Include="SuperSocket" Version="2.0.0-beta.10" />
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<PropertyGroup>
|
||||||
|
<_LastSelectedProfileId>H:\liuzl_ybhdmob\Waste\Waste.SocketService.cs\Properties\PublishProfiles\FolderProfile.pubxml</_LastSelectedProfileId>
|
||||||
|
</PropertyGroup>
|
||||||
|
</Project>
|
||||||
|
|
@ -0,0 +1,30 @@
|
||||||
|
using Microsoft.Extensions.Hosting;
|
||||||
|
using Microsoft.Extensions.Logging;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Threading;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Waste.SocketService
|
||||||
|
{
|
||||||
|
public class Worker : BackgroundService
|
||||||
|
{
|
||||||
|
private readonly ILogger<Worker> _logger;
|
||||||
|
|
||||||
|
public Worker(ILogger<Worker> logger)
|
||||||
|
{
|
||||||
|
_logger = logger;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override Task ExecuteAsync(CancellationToken stoppingToken)
|
||||||
|
{
|
||||||
|
//while (!stoppingToken.IsCancellationRequested)
|
||||||
|
//{
|
||||||
|
// _logger.LogInformation("Worker running at: {time}", DateTimeOffset.Now);
|
||||||
|
// await Task.Delay(1000, stoppingToken);
|
||||||
|
//}
|
||||||
|
return Task.CompletedTask;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,30 @@
|
||||||
|
{
|
||||||
|
"logfile": "e:/errlog/wastesocket.jt-sky.com", //日志文件路径
|
||||||
|
"Serilog": {
|
||||||
|
"MinimumLevel": {
|
||||||
|
"Default": "Information",
|
||||||
|
"Override": {
|
||||||
|
"Microsoft": "Warning",
|
||||||
|
"Microsoft.EntityFrameworkCore": "Information",
|
||||||
|
"Microsoft.Hosting.Lifetime": "Information",
|
||||||
|
"System": "Warning"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"serverOptions": { //supersocker配置
|
||||||
|
"name": "WasteService",
|
||||||
|
"listeners": [
|
||||||
|
{
|
||||||
|
"ip": "Any",
|
||||||
|
"port": 40433
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"RabbitmqSetting": { //rabbitmq配置
|
||||||
|
"HostName": "localhost",
|
||||||
|
"Port": 5672,
|
||||||
|
"UserName": "liuzl",
|
||||||
|
"Password": "liuzl",
|
||||||
|
"DBConnection": "Server=123.60.2.99,4331;Database=waste;uid=jutian_user;pwd=jutian1qaz@WSX;" //数据保存库
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,30 @@
|
||||||
|
{
|
||||||
|
"logfile": "d:/errlog/wastesocket.jt-sky.com", //日志文件路径
|
||||||
|
"Serilog": {
|
||||||
|
"MinimumLevel": {
|
||||||
|
"Default": "Information",
|
||||||
|
"Override": {
|
||||||
|
"Microsoft": "Warning",
|
||||||
|
"Microsoft.EntityFrameworkCore": "Information",
|
||||||
|
"Microsoft.Hosting.Lifetime": "Information",
|
||||||
|
"System": "Warning"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"serverOptions": { //supersocker配置
|
||||||
|
"name": "WasteService",
|
||||||
|
"listeners": [
|
||||||
|
{
|
||||||
|
"ip": "Any",
|
||||||
|
"port": 40433
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"RabbitmqSetting": { //rabbitmq配置
|
||||||
|
"HostName": "localhost",
|
||||||
|
"Port": 5672,
|
||||||
|
"UserName": "liuzl",
|
||||||
|
"Password": "liuzl",
|
||||||
|
"DBConnection": "Server=localhost,4331;Database=waste;uid=jutian_user;pwd=jutian1qaz@WSX;" //数据保存库
|
||||||
|
}
|
||||||
|
}
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -0,0 +1,8 @@
|
||||||
|
{
|
||||||
|
"runtimeOptions": {
|
||||||
|
"additionalProbingPaths": [
|
||||||
|
"C:\\Users\\Administrator\\.dotnet\\store\\|arch|\\|tfm|",
|
||||||
|
"C:\\Users\\Administrator\\.nuget\\packages"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
{
|
||||||
|
"runtimeOptions": {
|
||||||
|
"tfm": "net5.0",
|
||||||
|
"framework": {
|
||||||
|
"name": "Microsoft.AspNetCore.App",
|
||||||
|
"version": "5.0.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,30 @@
|
||||||
|
{
|
||||||
|
"logfile": "e:/errlog/wastesocket.jt-sky.com", //日志文件路径
|
||||||
|
"Serilog": {
|
||||||
|
"MinimumLevel": {
|
||||||
|
"Default": "Information",
|
||||||
|
"Override": {
|
||||||
|
"Microsoft": "Warning",
|
||||||
|
"Microsoft.EntityFrameworkCore": "Information",
|
||||||
|
"Microsoft.Hosting.Lifetime": "Information",
|
||||||
|
"System": "Warning"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"serverOptions": { //supersocker配置
|
||||||
|
"name": "WasteService",
|
||||||
|
"listeners": [
|
||||||
|
{
|
||||||
|
"ip": "Any",
|
||||||
|
"port": 40433
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"RabbitmqSetting": { //rabbitmq配置
|
||||||
|
"HostName": "localhost",
|
||||||
|
"Port": 5672,
|
||||||
|
"UserName": "liuzl",
|
||||||
|
"Password": "liuzl",
|
||||||
|
"DBConnection": "Server=123.60.2.99,4331;Database=waste;uid=jutian_user;pwd=jutian1qaz@WSX;" //数据保存库
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,30 @@
|
||||||
|
{
|
||||||
|
"logfile": "d:/errlog/wastesocket.jt-sky.com", //日志文件路径
|
||||||
|
"Serilog": {
|
||||||
|
"MinimumLevel": {
|
||||||
|
"Default": "Information",
|
||||||
|
"Override": {
|
||||||
|
"Microsoft": "Warning",
|
||||||
|
"Microsoft.EntityFrameworkCore": "Information",
|
||||||
|
"Microsoft.Hosting.Lifetime": "Information",
|
||||||
|
"System": "Warning"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"serverOptions": { //supersocker配置
|
||||||
|
"name": "WasteService",
|
||||||
|
"listeners": [
|
||||||
|
{
|
||||||
|
"ip": "Any",
|
||||||
|
"port": 40433
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"RabbitmqSetting": { //rabbitmq配置
|
||||||
|
"HostName": "localhost",
|
||||||
|
"Port": 5672,
|
||||||
|
"UserName": "liuzl",
|
||||||
|
"Password": "liuzl",
|
||||||
|
"DBConnection": "Server=localhost,4331;Database=waste;uid=jutian_user;pwd=jutian1qaz@WSX;" //数据保存库
|
||||||
|
}
|
||||||
|
}
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue