保存记录bug解决
This commit is contained in:
parent
581e5aa852
commit
71403ae64e
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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];
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
|
|
|||
|
|
@ -4,6 +4,6 @@ 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:56:50.1140092Z;True|2021-11-23T17:47:15.3723334+08:00;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>
|
||||
<History>True|2022-05-17T09:19:03.8993888Z;True|2021-11-23T17:56:50.1140092+08:00;True|2021-11-23T17:47:15.3723334+08:00;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>
|
||||
|
|
@ -32,23 +32,26 @@ namespace Waste.Web.Core
|
|||
services.AddHttpClient();
|
||||
|
||||
//添加CAP
|
||||
services.AddCap(x =>
|
||||
string port = configuration["RabbitmqSetting:Port"];
|
||||
int p = Convert.ToInt32(port);
|
||||
if (p > 0)
|
||||
{
|
||||
x.DefaultGroupName = "jtsky.queue.waste"; //rabbitmq的队列名称
|
||||
//配置rabbitmq支持
|
||||
string port = configuration["RabbitmqSetting:Port"];
|
||||
int p = Convert.ToInt32(port);
|
||||
x.UseRabbitMQ(opt =>
|
||||
services.AddCap(x =>
|
||||
{
|
||||
opt.HostName = configuration["RabbitmqSetting:HostName"]; //配置ip地址
|
||||
opt.Port = p;//配置端口
|
||||
opt.UserName = configuration["RabbitmqSetting:UserName"];//配置用户名
|
||||
opt.Password = configuration["RabbitmqSetting:Password"];//配置Miami
|
||||
x.DefaultGroupName = "jtsky.queue.waste"; //rabbitmq的队列名称
|
||||
//配置rabbitmq支持
|
||||
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"]);
|
||||
});
|
||||
//配置sqlserver支持
|
||||
x.UseSqlServer(configuration["RabbitmqSetting:DBConnection"]);
|
||||
});
|
||||
|
||||
}
|
||||
services.AddControllers(options =>
|
||||
{
|
||||
options.EnableEndpointRouting = true;
|
||||
|
|
@ -100,7 +103,7 @@ namespace Waste.Web.Core
|
|||
context.Request.EnableBuffering();
|
||||
return next(context);
|
||||
});
|
||||
// app.UseHttpsRedirection();
|
||||
// app.UseHttpsRedirection();
|
||||
|
||||
app.UseStaticFiles();
|
||||
app.UseSerilogRequestLogging(opts =>
|
||||
|
|
|
|||
|
|
@ -28,10 +28,10 @@
|
|||
<div class="layadmin-user-login-main">
|
||||
<div class="layadmin-user-login-box layadmin-user-login-header">
|
||||
<div>
|
||||
<img src="@Furion.App.Configuration["CustomSetting:Logo"]" style="height:50px;max-width:136px;"/>
|
||||
<img src="@Model.Logo" style="height:50px;max-width:136px;"/>
|
||||
</div>
|
||||
<h2>@Furion.App.Configuration["CustomSetting:SoftName"]</h2>
|
||||
<p>@Furion.App.Configuration["CustomSetting:SoftDesc"]</p>
|
||||
<h2>@Model.SoftName</h2>
|
||||
<p>@Model.SoftDesc</p>
|
||||
</div>
|
||||
<div class="layadmin-user-login-box layadmin-user-login-body layui-form">
|
||||
<div class="layui-form-item">
|
||||
|
|
@ -63,7 +63,7 @@
|
|||
|
||||
<div class="layui-trans layadmin-user-login-footer">
|
||||
|
||||
<p>© 2021 <a href="javascript:void(0)">@Furion.App.Configuration["CustomSetting:copyright"]</a><span>版本号:@Furion.App.Configuration["CustomSetting:Version"]</span></p>
|
||||
<p>© 2021 <a href="javascript:void(0)">@Model.copyright</a><span>版本号:@Furion.App.Configuration["CustomSetting:Version"]</span></p>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
|
|
|
|||
|
|
@ -2,15 +2,34 @@ using System;
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using Nirvana.Common;
|
||||
|
||||
namespace Waste.Web.Entry.Pages.Login
|
||||
{
|
||||
public class IndexModel : PageModel
|
||||
{
|
||||
private readonly IHttpContextAccessor _httpContextAccessor;
|
||||
public string Logo = Furion.App.Configuration["CustomSetting:Logo"];
|
||||
public string SoftName = Furion.App.Configuration["CustomSetting:SoftName"];
|
||||
public string SoftDesc = Furion.App.Configuration["CustomSetting:SoftDesc"];
|
||||
public string copyright = Furion.App.Configuration["CustomSetting:copyright"];
|
||||
public IndexModel(IHttpContextAccessor httpContextAccessor)
|
||||
{
|
||||
_httpContextAccessor = httpContextAccessor;
|
||||
}
|
||||
public void OnGet()
|
||||
{
|
||||
var host = _httpContextAccessor.HttpContext.Request.Host.Host;
|
||||
if(!host.IsEmpty() && host.ToLower() == "w.jt-sky.com")
|
||||
{
|
||||
Logo = "";
|
||||
SoftName = "物联网数字平台";
|
||||
SoftDesc = "";
|
||||
copyright = "物联网数字平台";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -1,13 +1,6 @@
|
|||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.HttpsPolicy;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Waste.Web.Entry
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue