设备接口更新
This commit is contained in:
parent
14e7f75512
commit
fe0287166d
|
|
@ -134,7 +134,7 @@ namespace Waste.Application
|
||||||
{
|
{
|
||||||
//查找设备
|
//查找设备
|
||||||
var device = await repository.Change<W_Device>().Context.Queryable<W_Device>().FirstAsync(x => myPackage.IMEI == x.Ecode);
|
var device = await repository.Change<W_Device>().Context.Queryable<W_Device>().FirstAsync(x => myPackage.IMEI == x.Ecode);
|
||||||
_loggerService.AddLogger($"接收到的数据,参数:{myPackage.ToJson()}", 2);
|
_loggerService.AddLogger($"接收到的数据,参数:{myPackage.ToJson()}", 3);
|
||||||
if (device == null)
|
if (device == null)
|
||||||
{
|
{
|
||||||
//记录日志
|
//记录日志
|
||||||
|
|
@ -182,7 +182,7 @@ namespace Waste.Application
|
||||||
myPackage.Area = Convert.ToInt32(typeHex, 16).ToString();
|
myPackage.Area = Convert.ToInt32(typeHex, 16).ToString();
|
||||||
}
|
}
|
||||||
//000F000002.16进制
|
//000F000002.16进制
|
||||||
var areaHex = Convert.ToHexString(areaBytes);
|
// var areaHex = Convert.ToHexString(areaBytes);
|
||||||
|
|
||||||
}
|
}
|
||||||
//记录数据
|
//记录数据
|
||||||
|
|
@ -223,7 +223,7 @@ namespace Waste.Application
|
||||||
// ScanningTime = timestamp,
|
// ScanningTime = timestamp,
|
||||||
// DStatus = 0,
|
// DStatus = 0,
|
||||||
// deviceid = devicesecret.DevId,
|
// deviceid = devicesecret.DevId,
|
||||||
// Trash = "202101",
|
// Trash = myPackage.Area,
|
||||||
// Type = TrashType(myPackage.WasteType)
|
// Type = TrashType(myPackage.WasteType)
|
||||||
// });
|
// });
|
||||||
// }
|
// }
|
||||||
|
|
|
||||||
|
|
@ -7,25 +7,81 @@ using System.Threading.Tasks;
|
||||||
namespace Waste.Application.ThirdApiInfo
|
namespace Waste.Application.ThirdApiInfo
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取设备信息请求数据
|
/// 心跳包上报数据
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class GetDevInfoRequestDto
|
public class DevHeartRequestDto
|
||||||
{
|
{
|
||||||
/// <summary>
|
|
||||||
/// 重量
|
|
||||||
/// </summary>
|
|
||||||
public decimal Weight { get; set; } = 0;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 机器码
|
/// 机器码
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string ECode { get; set; }
|
public string ECode { get; set; } = "";
|
||||||
|
/// <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 int GSLQ { get; set; } = 0;
|
||||||
|
/// <summary>
|
||||||
|
/// 纬度
|
||||||
|
/// </summary>
|
||||||
|
public string Latitude { get; set; } = "";
|
||||||
|
/// <summary>
|
||||||
|
/// 经度
|
||||||
|
/// </summary>
|
||||||
|
public string Longitude { get; set; } = "";
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 注册注册信息返回值
|
||||||
|
/// </summary>
|
||||||
|
public class DevRegInfoResponseDto
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 设备状态,0-使用中,1-异常,2-检修,3-检修结束,4-启用,5-未知
|
||||||
|
/// </summary>
|
||||||
|
public int status { get; set; } = 0;
|
||||||
|
/// <summary>
|
||||||
|
/// 波特率
|
||||||
|
/// </summary>
|
||||||
|
public int baudrate { get; set; } = 9600;
|
||||||
|
/// <summary>
|
||||||
|
/// 串口号
|
||||||
|
/// </summary>
|
||||||
|
public string serialno { get; set; } = "/dev/ttyS2";
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取设备信息请求数据,并上报数据
|
||||||
|
/// </summary>
|
||||||
|
public class GetDevInfoRequestDto: DevHeartRequestDto
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 记录ID
|
||||||
|
/// </summary>
|
||||||
|
public Guid? ResultId { get; set; } = null;
|
||||||
|
/// <summary>
|
||||||
|
/// 串口数据
|
||||||
|
/// </summary>
|
||||||
|
public string data { get; set; } = "";
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取设备信息响应数据
|
/// 获取设备信息响应数据
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class GetDevInfoResponseDto
|
public class GetDevInfoResponseDto
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 解析数据是否正常
|
||||||
|
/// </summary>
|
||||||
|
public bool IsSuccessed { get; set; } = false;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 时间戳
|
/// 时间戳
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -47,8 +103,42 @@ namespace Waste.Application.ThirdApiInfo
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string SecretHash { get; set; }
|
public string SecretHash { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 设备上报时才会有
|
/// 设备ID
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string DeviceId { get; set; } = "";
|
public string DeviceId { get; set; } = "";
|
||||||
|
/// <summary>
|
||||||
|
/// 上报地址
|
||||||
|
/// </summary>
|
||||||
|
public string PostUrl { get; set; } = "";
|
||||||
|
/// <summary>
|
||||||
|
/// 垃圾桶编号
|
||||||
|
/// </summary>
|
||||||
|
public string trash { get; set; } = "";
|
||||||
|
/// <summary>
|
||||||
|
/// 垃圾类型
|
||||||
|
/// </summary>
|
||||||
|
public int type { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 体重
|
||||||
|
/// </summary>
|
||||||
|
public double Weight { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 设备状态,0-使用中,1-异常,2-检修,3-检修结束,4-启用,5-未知
|
||||||
|
/// </summary>
|
||||||
|
public int status { get; set; } = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 数据扫描时间,UNIX时间戳
|
||||||
|
/// </summary>
|
||||||
|
public int ScanningTime { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 签名
|
||||||
|
/// </summary>
|
||||||
|
public string sign { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 记录ID
|
||||||
|
/// </summary>
|
||||||
|
public Guid ResultId { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,5 +18,17 @@ namespace Waste.Application.ThirdApiInfo
|
||||||
/// <param name="data"></param>
|
/// <param name="data"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<ResultInfo> GetDevInfoAsync(GetDevInfoRequestDto data);
|
Task<ResultInfo> GetDevInfoAsync(GetDevInfoRequestDto data);
|
||||||
|
/// <summary>
|
||||||
|
/// 心跳数据上报
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="data"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<ResultInfo> PostHeartAsync(DevHeartRequestDto data);
|
||||||
|
/// <summary>
|
||||||
|
/// 获取设备注册信息
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="ecode"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<ResultInfo> RegInfoAsync(string ecode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@ namespace Waste.Application.ThirdApiInfo
|
||||||
/// 开放数据
|
/// 开放数据
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[ApiDescriptionSettings("DevApi")]
|
[ApiDescriptionSettings("DevApi")]
|
||||||
|
[NonUnify]
|
||||||
public class OpenAppService : IDynamicApiController
|
public class OpenAppService : IDynamicApiController
|
||||||
{
|
{
|
||||||
private readonly IOpenService _openService;
|
private readonly IOpenService _openService;
|
||||||
|
|
@ -26,10 +27,31 @@ namespace Waste.Application.ThirdApiInfo
|
||||||
/// <param name="data"></param>
|
/// <param name="data"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
[NonUnify]
|
|
||||||
public async Task<ResultInfo> GetDevInfoAsync(GetDevInfoRequestDto data)
|
public async Task<ResultInfo> GetDevInfoAsync(GetDevInfoRequestDto data)
|
||||||
{
|
{
|
||||||
return await _openService.GetDevInfoAsync(data);
|
return await _openService.GetDevInfoAsync(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 心跳数据上报
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="data"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
|
public async Task<ResultInfo> PostHeartAsync(DevHeartRequestDto data)
|
||||||
|
{
|
||||||
|
return await _openService.PostHeartAsync(data);
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 获取设备注册信息,第一次开机使用
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="ecode"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet]
|
||||||
|
[QueryParameters]
|
||||||
|
public async Task<ResultInfo> RegInfoAsync(string ecode)
|
||||||
|
{
|
||||||
|
return await _openService.RegInfoAsync(ecode);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
using Furion;
|
using Furion;
|
||||||
using Furion.DependencyInjection;
|
using Furion.DependencyInjection;
|
||||||
|
using Furion.DistributedIDGenerator;
|
||||||
using Nirvana.Common;
|
using Nirvana.Common;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
using System;
|
using System;
|
||||||
|
|
@ -50,15 +51,134 @@ namespace Waste.Application.ThirdApiInfo
|
||||||
}
|
}
|
||||||
int timestamp = _suZhouService.GetTimestamp();
|
int timestamp = _suZhouService.GetTimestamp();
|
||||||
int noncestr = _suZhouService.GetNonce();
|
int noncestr = _suZhouService.GetNonce();
|
||||||
var returndata = new GetDevInfoResponseDto {
|
var returndata = new GetDevInfoResponseDto
|
||||||
|
{
|
||||||
DeviceId = devicesecret.DevId,
|
DeviceId = devicesecret.DevId,
|
||||||
noncestr = noncestr,
|
noncestr = noncestr,
|
||||||
timestamp = timestamp,
|
timestamp = timestamp,
|
||||||
Secret = devicesecret.Secret,
|
Secret = devicesecret.Secret,
|
||||||
SecretHash = devicesecret.SecretHash,
|
SecretHash = devicesecret.SecretHash,
|
||||||
UserId = UserId
|
UserId = UserId,
|
||||||
|
PostUrl = ApiUrl,
|
||||||
|
ScanningTime = GetTimestamp(DateTime.Now),
|
||||||
|
ResultId = IDGen.NextID()
|
||||||
};
|
};
|
||||||
|
//解析协议,IC卡数据@垃圾桶编号@厨余垃圾@7.91
|
||||||
|
// 00000000003031 40 000F000002 40 C6E4CBFBC0ACBBF8 40 35312E300D0A
|
||||||
|
if (!string.IsNullOrEmpty(data.data) && data.data.Length> 52)
|
||||||
|
{
|
||||||
|
data.data = data.data.Replace(" ", "");
|
||||||
|
//收到的为16进制,对数据进行解析,0-4预留,5-垃圾种类,6-垃圾桶大小,7-@,8-12垃圾桶编号,13@,14-21垃圾种类汉子,22@,23-结束重量, OD OA 回车换行
|
||||||
|
data.data = data.data.Substring(0,data.data.Length-4);
|
||||||
|
var trashhex = data.data.Substring(16, 10);
|
||||||
|
var typehex = data.data.Substring(28, 16);
|
||||||
|
var weighthex = data.data.Substring(46, data.data.Length - 46);
|
||||||
|
returndata.trash = Convert.ToInt32(trashhex, 16).ToString();
|
||||||
|
var type = GetChsFromHex(typehex);
|
||||||
|
var weight = GetChsFromHex(weighthex);
|
||||||
|
returndata.type = TrashType(type);
|
||||||
|
returndata.Weight = weight.ToDouble();
|
||||||
|
returndata.IsSuccessed = true;
|
||||||
|
string[] paramlist = new string[] {
|
||||||
|
returndata.Weight.ToString(),returndata.trash,returndata.type.ToString(),returndata.ScanningTime.ToString(),returndata.status.ToString()
|
||||||
|
};
|
||||||
|
returndata.sign = _suZhouService.GetUserApiSign(returndata.Secret, paramlist);
|
||||||
|
}
|
||||||
return new ResultInfo(ResultState.SUCCESS, "success", returndata);
|
return new ResultInfo(ResultState.SUCCESS, "success", returndata);
|
||||||
}
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 16进制转汉字
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="hex"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
private string GetChsFromHex(string hex)
|
||||||
|
{
|
||||||
|
if (hex == null)
|
||||||
|
return "";
|
||||||
|
if (hex.Length % 2 != 0)
|
||||||
|
{
|
||||||
|
hex += "20";//空格
|
||||||
|
}
|
||||||
|
// 需要将 hex 转换成 byte 数组。
|
||||||
|
byte[] bytes = new byte[hex.Length / 2];
|
||||||
|
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>
|
||||||
|
/// <param name="data"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<ResultInfo> PostHeartAsync(DevHeartRequestDto data)
|
||||||
|
{
|
||||||
|
var device = await dbClient.Queryable<W_Device>().FirstAsync(x => x.Ecode == data.ECode);
|
||||||
|
if (device == null)
|
||||||
|
{
|
||||||
|
return new ResultInfo(ResultState.FAIL, "设备未找到");
|
||||||
|
}
|
||||||
|
return new ResultInfo(ResultState.SUCCESS, "success");
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 获取设备注册信息,第一次开机使用
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="ecode"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<ResultInfo> RegInfoAsync(string ecode)
|
||||||
|
{
|
||||||
|
var device = await dbClient.Queryable<W_Device>().FirstAsync(x => x.Ecode == ecode);
|
||||||
|
//if (device == null)
|
||||||
|
//{
|
||||||
|
// return new ResultInfo(ResultState.FAIL, "设备未找到");
|
||||||
|
//}
|
||||||
|
var data = new DevRegInfoResponseDto
|
||||||
|
{
|
||||||
|
status = 0
|
||||||
|
};
|
||||||
|
return new ResultInfo(ResultState.SUCCESS, "success", data);
|
||||||
|
}
|
||||||
|
private int TrashType(string type)
|
||||||
|
{
|
||||||
|
if (type == "厨余垃圾") return 1;
|
||||||
|
else if (type == "可回收物") return 2;
|
||||||
|
else if (type == "有害垃圾") return 3;
|
||||||
|
else if (type == "其他垃圾") return 4;
|
||||||
|
else return 0;
|
||||||
|
}
|
||||||
|
private int GetTimestamp(DateTime time)
|
||||||
|
{
|
||||||
|
DateTime dateTimeStart = TimeZoneInfo.ConvertTimeToUtc(new DateTime(1970, 1, 1, 8, 0, 0));
|
||||||
|
int timestamp = Convert.ToInt32((time - dateTimeStart).TotalSeconds);
|
||||||
|
return timestamp;
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 字节数组转16进制
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="bt"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
private string BytesToHexStr( byte[] bt)
|
||||||
|
{
|
||||||
|
string returnStr = "";
|
||||||
|
if (bt != null)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < bt.Length; i++)
|
||||||
|
{
|
||||||
|
returnStr += bt[i].ToString("X2");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return returnStr;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1945,26 +1945,91 @@
|
||||||
<param name="data"></param>
|
<param name="data"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
<member name="T:Waste.Application.ThirdApiInfo.GetDevInfoRequestDto">
|
<member name="T:Waste.Application.ThirdApiInfo.DevHeartRequestDto">
|
||||||
<summary>
|
<summary>
|
||||||
获取设备信息请求数据
|
心跳包上报数据
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="P:Waste.Application.ThirdApiInfo.GetDevInfoRequestDto.Weight">
|
<member name="P:Waste.Application.ThirdApiInfo.DevHeartRequestDto.ECode">
|
||||||
<summary>
|
|
||||||
重量
|
|
||||||
</summary>
|
|
||||||
</member>
|
|
||||||
<member name="P:Waste.Application.ThirdApiInfo.GetDevInfoRequestDto.ECode">
|
|
||||||
<summary>
|
<summary>
|
||||||
机器码
|
机器码
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="P:Waste.Application.ThirdApiInfo.DevHeartRequestDto.IMEI">
|
||||||
|
<summary>
|
||||||
|
IMEI
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Waste.Application.ThirdApiInfo.DevHeartRequestDto.ICCID">
|
||||||
|
<summary>
|
||||||
|
ICCID
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Waste.Application.ThirdApiInfo.DevHeartRequestDto.IMSI">
|
||||||
|
<summary>
|
||||||
|
IMSI
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Waste.Application.ThirdApiInfo.DevHeartRequestDto.GSLQ">
|
||||||
|
<summary>
|
||||||
|
信号强度
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Waste.Application.ThirdApiInfo.DevHeartRequestDto.Latitude">
|
||||||
|
<summary>
|
||||||
|
纬度
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Waste.Application.ThirdApiInfo.DevHeartRequestDto.Longitude">
|
||||||
|
<summary>
|
||||||
|
经度
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="T:Waste.Application.ThirdApiInfo.DevRegInfoResponseDto">
|
||||||
|
<summary>
|
||||||
|
注册注册信息返回值
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Waste.Application.ThirdApiInfo.DevRegInfoResponseDto.status">
|
||||||
|
<summary>
|
||||||
|
设备状态,0-使用中,1-异常,2-检修,3-检修结束,4-启用,5-未知
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Waste.Application.ThirdApiInfo.DevRegInfoResponseDto.baudrate">
|
||||||
|
<summary>
|
||||||
|
波特率
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Waste.Application.ThirdApiInfo.DevRegInfoResponseDto.serialno">
|
||||||
|
<summary>
|
||||||
|
串口号
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="T:Waste.Application.ThirdApiInfo.GetDevInfoRequestDto">
|
||||||
|
<summary>
|
||||||
|
获取设备信息请求数据,并上报数据
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Waste.Application.ThirdApiInfo.GetDevInfoRequestDto.ResultId">
|
||||||
|
<summary>
|
||||||
|
记录ID
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Waste.Application.ThirdApiInfo.GetDevInfoRequestDto.data">
|
||||||
|
<summary>
|
||||||
|
串口数据
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="T:Waste.Application.ThirdApiInfo.GetDevInfoResponseDto">
|
<member name="T:Waste.Application.ThirdApiInfo.GetDevInfoResponseDto">
|
||||||
<summary>
|
<summary>
|
||||||
获取设备信息响应数据
|
获取设备信息响应数据
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="P:Waste.Application.ThirdApiInfo.GetDevInfoResponseDto.IsSuccessed">
|
||||||
|
<summary>
|
||||||
|
解析数据是否正常
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="P:Waste.Application.ThirdApiInfo.GetDevInfoResponseDto.timestamp">
|
<member name="P:Waste.Application.ThirdApiInfo.GetDevInfoResponseDto.timestamp">
|
||||||
<summary>
|
<summary>
|
||||||
时间戳
|
时间戳
|
||||||
|
|
@ -1992,7 +2057,47 @@
|
||||||
</member>
|
</member>
|
||||||
<member name="P:Waste.Application.ThirdApiInfo.GetDevInfoResponseDto.DeviceId">
|
<member name="P:Waste.Application.ThirdApiInfo.GetDevInfoResponseDto.DeviceId">
|
||||||
<summary>
|
<summary>
|
||||||
设备上报时才会有
|
设备ID
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Waste.Application.ThirdApiInfo.GetDevInfoResponseDto.PostUrl">
|
||||||
|
<summary>
|
||||||
|
上报地址
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Waste.Application.ThirdApiInfo.GetDevInfoResponseDto.trash">
|
||||||
|
<summary>
|
||||||
|
垃圾桶编号
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Waste.Application.ThirdApiInfo.GetDevInfoResponseDto.type">
|
||||||
|
<summary>
|
||||||
|
垃圾类型
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Waste.Application.ThirdApiInfo.GetDevInfoResponseDto.Weight">
|
||||||
|
<summary>
|
||||||
|
体重
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Waste.Application.ThirdApiInfo.GetDevInfoResponseDto.status">
|
||||||
|
<summary>
|
||||||
|
设备状态,0-使用中,1-异常,2-检修,3-检修结束,4-启用,5-未知
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Waste.Application.ThirdApiInfo.GetDevInfoResponseDto.ScanningTime">
|
||||||
|
<summary>
|
||||||
|
数据扫描时间,UNIX时间戳
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Waste.Application.ThirdApiInfo.GetDevInfoResponseDto.sign">
|
||||||
|
<summary>
|
||||||
|
签名
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Waste.Application.ThirdApiInfo.GetDevInfoResponseDto.ResultId">
|
||||||
|
<summary>
|
||||||
|
记录ID
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="T:Waste.Application.ThirdApiInfo.IOpenService">
|
<member name="T:Waste.Application.ThirdApiInfo.IOpenService">
|
||||||
|
|
@ -2007,6 +2112,20 @@
|
||||||
<param name="data"></param>
|
<param name="data"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:Waste.Application.ThirdApiInfo.IOpenService.PostHeartAsync(Waste.Application.ThirdApiInfo.DevHeartRequestDto)">
|
||||||
|
<summary>
|
||||||
|
心跳数据上报
|
||||||
|
</summary>
|
||||||
|
<param name="data"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:Waste.Application.ThirdApiInfo.IOpenService.RegInfoAsync(System.String)">
|
||||||
|
<summary>
|
||||||
|
获取设备注册信息
|
||||||
|
</summary>
|
||||||
|
<param name="ecode"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
<member name="T:Waste.Application.ThirdApiInfo.OpenAppService">
|
<member name="T:Waste.Application.ThirdApiInfo.OpenAppService">
|
||||||
<summary>
|
<summary>
|
||||||
开放数据
|
开放数据
|
||||||
|
|
@ -2019,6 +2138,20 @@
|
||||||
<param name="data"></param>
|
<param name="data"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:Waste.Application.ThirdApiInfo.OpenAppService.PostHeartAsync(Waste.Application.ThirdApiInfo.DevHeartRequestDto)">
|
||||||
|
<summary>
|
||||||
|
心跳数据上报
|
||||||
|
</summary>
|
||||||
|
<param name="data"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:Waste.Application.ThirdApiInfo.OpenAppService.RegInfoAsync(System.String)">
|
||||||
|
<summary>
|
||||||
|
获取设备注册信息,第一次开机使用
|
||||||
|
</summary>
|
||||||
|
<param name="ecode"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
<member name="T:Waste.Application.ThirdApiInfo.OpenService">
|
<member name="T:Waste.Application.ThirdApiInfo.OpenService">
|
||||||
<summary>
|
<summary>
|
||||||
设备对接接口
|
设备对接接口
|
||||||
|
|
@ -2031,6 +2164,34 @@
|
||||||
<param name="data"></param>
|
<param name="data"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:Waste.Application.ThirdApiInfo.OpenService.GetChsFromHex(System.String)">
|
||||||
|
<summary>
|
||||||
|
16进制转汉字
|
||||||
|
</summary>
|
||||||
|
<param name="hex"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:Waste.Application.ThirdApiInfo.OpenService.PostHeartAsync(Waste.Application.ThirdApiInfo.DevHeartRequestDto)">
|
||||||
|
<summary>
|
||||||
|
心跳数据上报
|
||||||
|
</summary>
|
||||||
|
<param name="data"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:Waste.Application.ThirdApiInfo.OpenService.RegInfoAsync(System.String)">
|
||||||
|
<summary>
|
||||||
|
获取设备注册信息,第一次开机使用
|
||||||
|
</summary>
|
||||||
|
<param name="ecode"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:Waste.Application.ThirdApiInfo.OpenService.BytesToHexStr(System.Byte[])">
|
||||||
|
<summary>
|
||||||
|
字节数组转16进制
|
||||||
|
</summary>
|
||||||
|
<param name="bt"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
<member name="M:Waste.Application.IWasteService.GetTypeListAsync(Nirvana.Common.QueryParams)">
|
<member name="M:Waste.Application.IWasteService.GetTypeListAsync(Nirvana.Common.QueryParams)">
|
||||||
<summary>
|
<summary>
|
||||||
垃圾分类列表
|
垃圾分类列表
|
||||||
|
|
|
||||||
|
|
@ -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>
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,6 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<_PublishTargetUrl>D:\webpublish\waste.ybhdmob.com</_PublishTargetUrl>
|
<_PublishTargetUrl>D:\webpublish\waste.ybhdmob.com</_PublishTargetUrl>
|
||||||
<History>True|2021-07-30T01:32:38.2676032Z;True|2021-07-30T09:14:42.6170851+08:00;True|2021-07-29T19:06:09.1449349+08:00;True|2021-06-11T08:16:29.9542894+08:00;True|2021-06-04T14:46:02.2707457+08:00;True|2021-06-02T15:08:52.8245632+08:00;True|2021-06-02T15:05:50.3614099+08:00;True|2021-06-02T14:59:32.3690948+08:00;True|2021-06-02T14:10:25.1182836+08:00;True|2021-06-02T14:09:54.9215833+08:00;True|2021-06-01T10:41:54.9488501+08:00;True|2021-06-01T10:38:56.0283198+08:00;True|2021-05-28T13:59:02.2308877+08:00;True|2021-05-28T11:56:26.6796406+08:00;True|2021-05-28T11:28:00.4087907+08:00;True|2021-05-27T16:18:09.5993838+08:00;True|2021-05-27T16:07:31.3484951+08:00;True|2021-05-27T11:30:37.9119310+08:00;True|2021-05-27T11:28:35.5374674+08:00;True|2021-05-27T08:00:09.1625592+08:00;True|2021-05-26T20:42:17.0852150+08:00;True|2021-05-26T20:36:49.7527415+08:00;True|2021-05-25T17:57:31.8791293+08:00;True|2021-05-25T13:49:29.6488978+08:00;True|2021-05-25T13:48:24.6686105+08:00;True|2021-05-25T13:25:41.2512493+08:00;True|2021-05-24T17:55:33.3800078+08:00;True|2021-05-20T14:35:30.6957985+08:00;True|2021-05-20T13:17:22.6192995+08:00;True|2021-05-20T10:51:38.1268169+08:00;True|2021-05-19T19:50:03.7000224+08:00;True|2021-05-19T19:44:27.2518811+08:00;True|2021-05-19T19:43:26.5916681+08:00;True|2021-05-19T19:36:29.3197365+08:00;True|2021-05-19T19:30:00.3802430+08:00;True|2021-05-19T17:55:23.7939835+08:00;True|2021-05-19T11:05:17.9043392+08:00;True|2021-05-19T10:19:38.4839988+08:00;True|2021-05-19T10:17:19.7430612+08:00;True|2021-05-19T10:13:23.0031721+08:00;True|2021-05-19T10:06:03.9881599+08:00;True|2021-05-18T14:39:03.8876574+08:00;True|2021-05-18T14:23:46.9818836+08:00;True|2021-05-18T14:19:56.2382079+08:00;True|2021-05-18T11:29:53.5497590+08:00;True|2021-05-18T11:16:18.0123853+08:00;True|2021-05-17T18:59:52.4159105+08:00;True|2021-05-17T18:53:37.9438984+08:00;True|2021-05-17T18:48:14.9625161+08:00;True|2021-05-17T17:46:03.7723404+08:00;True|2021-05-17T17:14:20.2312990+08:00;True|2021-05-17T16:44:34.5837616+08:00;True|2021-05-17T16:25:20.1087804+08:00;True|2021-05-17T11:35:27.9388562+08:00;</History>
|
<History>True|2021-07-30T09:59:30.2223340Z;True|2021-07-30T17:57:35.9412910+08:00;True|2021-07-30T17:07:58.3305971+08:00;True|2021-07-30T17:04:10.9244859+08:00;True|2021-07-30T17:02:12.1943634+08:00;True|2021-07-30T16:16:22.2838331+08:00;True|2021-07-30T15:05:26.5664155+08:00;True|2021-07-30T14:57:59.1966108+08:00;True|2021-07-30T14:54:25.8172908+08:00;True|2021-07-30T14:52:20.9209995+08:00;True|2021-07-30T14:35:29.5239463+08:00;True|2021-07-30T09:32:38.2676032+08:00;True|2021-07-30T09:14:42.6170851+08:00;True|2021-07-29T19:06:09.1449349+08:00;True|2021-06-11T08:16:29.9542894+08:00;True|2021-06-04T14:46:02.2707457+08:00;True|2021-06-02T15:08:52.8245632+08:00;True|2021-06-02T15:05:50.3614099+08:00;True|2021-06-02T14:59:32.3690948+08:00;True|2021-06-02T14:10:25.1182836+08:00;True|2021-06-02T14:09:54.9215833+08:00;True|2021-06-01T10:41:54.9488501+08:00;True|2021-06-01T10:38:56.0283198+08:00;True|2021-05-28T13:59:02.2308877+08:00;True|2021-05-28T11:56:26.6796406+08:00;True|2021-05-28T11:28:00.4087907+08:00;True|2021-05-27T16:18:09.5993838+08:00;True|2021-05-27T16:07:31.3484951+08:00;True|2021-05-27T11:30:37.9119310+08:00;True|2021-05-27T11:28:35.5374674+08:00;True|2021-05-27T08:00:09.1625592+08:00;True|2021-05-26T20:42:17.0852150+08:00;True|2021-05-26T20:36:49.7527415+08:00;True|2021-05-25T17:57:31.8791293+08:00;True|2021-05-25T13:49:29.6488978+08:00;True|2021-05-25T13:48:24.6686105+08:00;True|2021-05-25T13:25:41.2512493+08:00;True|2021-05-24T17:55:33.3800078+08:00;True|2021-05-20T14:35:30.6957985+08:00;True|2021-05-20T13:17:22.6192995+08:00;True|2021-05-20T10:51:38.1268169+08:00;True|2021-05-19T19:50:03.7000224+08:00;True|2021-05-19T19:44:27.2518811+08:00;True|2021-05-19T19:43:26.5916681+08:00;True|2021-05-19T19:36:29.3197365+08:00;True|2021-05-19T19:30:00.3802430+08:00;True|2021-05-19T17:55:23.7939835+08:00;True|2021-05-19T11:05:17.9043392+08:00;True|2021-05-19T10:19:38.4839988+08:00;True|2021-05-19T10:17:19.7430612+08:00;True|2021-05-19T10:13:23.0031721+08:00;True|2021-05-19T10:06:03.9881599+08:00;True|2021-05-18T14:39:03.8876574+08:00;True|2021-05-18T14:23:46.9818836+08:00;True|2021-05-18T14:19:56.2382079+08:00;True|2021-05-18T11:29:53.5497590+08:00;True|2021-05-18T11:16:18.0123853+08:00;True|2021-05-17T18:59:52.4159105+08:00;True|2021-05-17T18:53:37.9438984+08:00;True|2021-05-17T18:48:14.9625161+08:00;True|2021-05-17T17:46:03.7723404+08:00;True|2021-05-17T17:14:20.2312990+08:00;True|2021-05-17T16:44:34.5837616+08:00;True|2021-05-17T16:25:20.1087804+08:00;True|2021-05-17T11:35:27.9388562+08:00;</History>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
</Project>
|
</Project>
|
||||||
Loading…
Reference in New Issue