From 71403ae64ef53b2295308b722f1b4a0f9142c8de Mon Sep 17 00:00:00 2001
From: Hinse <756681202@qq.com>
Date: Tue, 17 May 2022 18:07:00 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=9D=E5=AD=98=E8=AE=B0=E5=BD=95bug?=
=?UTF-8?q?=E8=A7=A3=E5=86=B3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../ResultInfos/ResultService.cs | 3 +-
Waste.SocketService.cs/MyPackageFilter.cs | 17 ++++++++++
Waste.SocketService.cs/Program.cs | 4 +--
.../PublishProfiles/FolderProfile.pubxml.user | 2 +-
Waste.Web.Core/Startup.cs | 31 ++++++++++---------
Waste.Web.Entry/Pages/Login/Index.cshtml | 8 ++---
Waste.Web.Entry/Pages/Login/Index.cshtml.cs | 19 ++++++++++++
.../waste.ybhdmob.com.pubxml.user | 2 +-
Waste.Web.Entry/Startup.cs | 7 -----
9 files changed, 63 insertions(+), 30 deletions(-)
diff --git a/Waste.Application/ResultInfos/ResultService.cs b/Waste.Application/ResultInfos/ResultService.cs
index 7269b11..e02edd7 100644
--- a/Waste.Application/ResultInfos/ResultService.cs
+++ b/Waste.Application/ResultInfos/ResultService.cs
@@ -232,6 +232,7 @@ namespace Waste.Application
{
isfrist = true;
}
+ var Weight = myPackage.Weight.IsEmpty() ? 0 : myPackage.Weight.ToDecimal();
//记录数据
await dbClient.Ado.UseStoredProcedure().ExecuteCommandAsync("Proc_InsertResult", new
{
@@ -248,7 +249,7 @@ namespace Waste.Application
city = "",
area = myPackage.trashcode,
wastetype = myPackage.WasteType,
- weigth = myPackage.Weight,
+ weigth = Weight,
isheart = myPackage.IsHeart,
tare = device.Tare,
isfrist = isfrist
diff --git a/Waste.SocketService.cs/MyPackageFilter.cs b/Waste.SocketService.cs/MyPackageFilter.cs
index 212b3d1..14ec14c 100644
--- a/Waste.SocketService.cs/MyPackageFilter.cs
+++ b/Waste.SocketService.cs/MyPackageFilter.cs
@@ -251,6 +251,23 @@ namespace Waste.SocketService
package.Latitude = gpsarr[1];
}
}
+ else if(arr.Length == 7 && string.IsNullOrEmpty(arr[6]))
+ {
+ package.IsHeart = true;
+ 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(":", "");
+ }
else if (arr.Length == 7)
{
package.ICCID = arr[0];
diff --git a/Waste.SocketService.cs/Program.cs b/Waste.SocketService.cs/Program.cs
index eed9bec..ed37b17 100644
--- a/Waste.SocketService.cs/Program.cs
+++ b/Waste.SocketService.cs/Program.cs
@@ -115,11 +115,11 @@ namespace Waste.SocketService
string msg = $"ͨУ,ʮ:{package.Body},ַ:{package.Str}";
if (package.IsHeart)
{
- msg = $"{msg},,IMEI:{package.IMEI},:{package.Longitude},γ:{package.Latitude}";
+ msg = $"{msg},,{(package == null?"":JsonConvert.SerializeObject(package))}";
}
else
{
- msg = $"{msg},,ICCID:{package.ICCID},IMEI:{package.IMEI},IMSI:{package.IMSI},ź:{package.GSLQ}";
+ msg = $"{msg},,{(package == null ? "" : JsonConvert.SerializeObject(package))}";
if (package.IsWeight)
{
msg = $"{msg},ͰС:{package.size},Ͱ:{package.trashcode},:{package.WasteType},:{package.Weight}KG";
diff --git a/Waste.SocketService.cs/Properties/PublishProfiles/FolderProfile.pubxml.user b/Waste.SocketService.cs/Properties/PublishProfiles/FolderProfile.pubxml.user
index cf83514..e8b8e97 100644
--- a/Waste.SocketService.cs/Properties/PublishProfiles/FolderProfile.pubxml.user
+++ b/Waste.SocketService.cs/Properties/PublishProfiles/FolderProfile.pubxml.user
@@ -4,6 +4,6 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
-->
@Furion.App.Configuration["CustomSetting:SoftDesc"]
+@Model.SoftDesc