Compare commits
No commits in common. "master" and "feature_net6" have entirely different histories.
master
...
feature_net6
|
|
@ -1,363 +1,33 @@
|
|||
## Ignore Visual Studio temporary files, build results, and
|
||||
## files generated by popular Visual Studio add-ons.
|
||||
##
|
||||
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
|
||||
|
||||
# User-specific files
|
||||
*.rsuser
|
||||
*.suo
|
||||
*.user
|
||||
*.userosscache
|
||||
*.sln.docstates
|
||||
|
||||
# User-specific files (MonoDevelop/Xamarin Studio)
|
||||
*.userprefs
|
||||
|
||||
# Mono auto generated files
|
||||
mono_crash.*
|
||||
|
||||
# Build results
|
||||
[Dd]ebug/
|
||||
[Dd]ebugPublic/
|
||||
[Rr]elease/
|
||||
[Rr]eleases/
|
||||
x64/
|
||||
x86/
|
||||
[Ww][Ii][Nn]32/
|
||||
[Aa][Rr][Mm]/
|
||||
[Aa][Rr][Mm]64/
|
||||
bld/
|
||||
[Bb]in/
|
||||
[Oo]bj/
|
||||
[Oo]ut/
|
||||
[Ll]og/
|
||||
[Ll]ogs/
|
||||
|
||||
# Visual Studio 2015/2017 cache/options directory
|
||||
.vs/
|
||||
# Uncomment if you have tasks that create the project's static files in wwwroot
|
||||
#wwwroot/
|
||||
|
||||
# Visual Studio 2017 auto generated files
|
||||
Generated\ Files/
|
||||
|
||||
# MSTest test Results
|
||||
[Tt]est[Rr]esult*/
|
||||
[Bb]uild[Ll]og.*
|
||||
|
||||
# NUnit
|
||||
*.VisualState.xml
|
||||
TestResult.xml
|
||||
nunit-*.xml
|
||||
|
||||
# Build Results of an ATL Project
|
||||
[Dd]ebugPS/
|
||||
[Rr]eleasePS/
|
||||
dlldata.c
|
||||
|
||||
# Benchmark Results
|
||||
BenchmarkDotNet.Artifacts/
|
||||
|
||||
# .NET Core
|
||||
project.lock.json
|
||||
project.fragment.lock.json
|
||||
artifacts/
|
||||
|
||||
# ASP.NET Scaffolding
|
||||
ScaffoldingReadMe.txt
|
||||
|
||||
# StyleCop
|
||||
StyleCopReport.xml
|
||||
|
||||
# Files built by Visual Studio
|
||||
*_i.c
|
||||
*_p.c
|
||||
*_h.h
|
||||
*.ilk
|
||||
*.meta
|
||||
*.obj
|
||||
*.iobj
|
||||
*.pch
|
||||
*.pdb
|
||||
*.ipdb
|
||||
*.pgc
|
||||
*.pgd
|
||||
*.rsp
|
||||
*.sbr
|
||||
*.tlb
|
||||
*.tli
|
||||
*.tlh
|
||||
*.tmp
|
||||
*.tmp_proj
|
||||
*_wpftmp.csproj
|
||||
*.log
|
||||
*.vspscc
|
||||
*.vssscc
|
||||
.builds
|
||||
*.pidb
|
||||
*.svclog
|
||||
*.scc
|
||||
|
||||
# Chutzpah Test files
|
||||
_Chutzpah*
|
||||
|
||||
# Visual C++ cache files
|
||||
ipch/
|
||||
*.aps
|
||||
*.ncb
|
||||
*.opendb
|
||||
*.opensdf
|
||||
*.sdf
|
||||
*.cachefile
|
||||
*.VC.db
|
||||
*.VC.VC.opendb
|
||||
|
||||
# Visual Studio profiler
|
||||
*.psess
|
||||
*.vsp
|
||||
*.vspx
|
||||
*.sap
|
||||
|
||||
# Visual Studio Trace Files
|
||||
*.e2e
|
||||
|
||||
# TFS 2012 Local Workspace
|
||||
$tf/
|
||||
|
||||
# Guidance Automation Toolkit
|
||||
*.gpState
|
||||
|
||||
# ReSharper is a .NET coding add-in
|
||||
_ReSharper*/
|
||||
*.[Rr]e[Ss]harper
|
||||
*.DotSettings.user
|
||||
|
||||
# TeamCity is a build add-in
|
||||
_TeamCity*
|
||||
|
||||
# DotCover is a Code Coverage Tool
|
||||
*.dotCover
|
||||
|
||||
# AxoCover is a Code Coverage Tool
|
||||
.axoCover/*
|
||||
!.axoCover/settings.json
|
||||
|
||||
# Coverlet is a free, cross platform Code Coverage Tool
|
||||
coverage*.json
|
||||
coverage*.xml
|
||||
coverage*.info
|
||||
|
||||
# Visual Studio code coverage results
|
||||
*.coverage
|
||||
*.coveragexml
|
||||
|
||||
# NCrunch
|
||||
_NCrunch_*
|
||||
.*crunch*.local.xml
|
||||
nCrunchTemp_*
|
||||
|
||||
# MightyMoose
|
||||
*.mm.*
|
||||
AutoTest.Net/
|
||||
|
||||
# Web workbench (sass)
|
||||
.sass-cache/
|
||||
|
||||
# Installshield output folder
|
||||
[Ee]xpress/
|
||||
|
||||
# DocProject is a documentation generator add-in
|
||||
DocProject/buildhelp/
|
||||
DocProject/Help/*.HxT
|
||||
DocProject/Help/*.HxC
|
||||
DocProject/Help/*.hhc
|
||||
DocProject/Help/*.hhk
|
||||
DocProject/Help/*.hhp
|
||||
DocProject/Help/Html2
|
||||
DocProject/Help/html
|
||||
|
||||
# Click-Once directory
|
||||
publish/
|
||||
|
||||
# Publish Web Output
|
||||
*.[Pp]ublish.xml
|
||||
*.azurePubxml
|
||||
# Note: Comment the next line if you want to checkin your web deploy settings,
|
||||
# but database connection strings (with potential passwords) will be unencrypted
|
||||
*.pubxml
|
||||
*.publishproj
|
||||
|
||||
# Microsoft Azure Web App publish settings. Comment the next line if you want to
|
||||
# checkin your Azure Web App publish settings, but sensitive information contained
|
||||
# in these scripts will be unencrypted
|
||||
PublishScripts/
|
||||
|
||||
# NuGet Packages
|
||||
*.nupkg
|
||||
# NuGet Symbol Packages
|
||||
*.snupkg
|
||||
# The packages folder can be ignored because of Package Restore
|
||||
**/[Pp]ackages/*
|
||||
# except build/, which is used as an MSBuild target.
|
||||
!**/[Pp]ackages/build/
|
||||
# Uncomment if necessary however generally it will be regenerated when needed
|
||||
#!**/[Pp]ackages/repositories.config
|
||||
# NuGet v3's project.json files produces more ignorable files
|
||||
*.nuget.props
|
||||
*.nuget.targets
|
||||
|
||||
# Microsoft Azure Build Output
|
||||
csx/
|
||||
*.build.csdef
|
||||
|
||||
# Microsoft Azure Emulator
|
||||
ecf/
|
||||
rcf/
|
||||
|
||||
# Windows Store app package directories and files
|
||||
AppPackages/
|
||||
BundleArtifacts/
|
||||
Package.StoreAssociation.xml
|
||||
_pkginfo.txt
|
||||
*.appx
|
||||
*.appxbundle
|
||||
*.appxupload
|
||||
|
||||
# Visual Studio cache files
|
||||
# files ending in .cache can be ignored
|
||||
*.[Cc]ache
|
||||
# but keep track of directories ending in .cache
|
||||
!?*.[Cc]ache/
|
||||
|
||||
# Others
|
||||
ClientBin/
|
||||
~$*
|
||||
*~
|
||||
*.dbmdl
|
||||
*.dbproj.schemaview
|
||||
*.jfm
|
||||
*.pfx
|
||||
*.publishsettings
|
||||
orleans.codegen.cs
|
||||
|
||||
# Including strong name files can present a security risk
|
||||
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
|
||||
#*.snk
|
||||
|
||||
# Since there are multiple workflows, uncomment next line to ignore bower_components
|
||||
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
|
||||
#bower_components/
|
||||
|
||||
# RIA/Silverlight projects
|
||||
Generated_Code/
|
||||
|
||||
# Backup & report files from converting an old project file
|
||||
# to a newer Visual Studio version. Backup files are not needed,
|
||||
# because we have git ;-)
|
||||
_UpgradeReport_Files/
|
||||
Backup*/
|
||||
UpgradeLog*.XML
|
||||
UpgradeLog*.htm
|
||||
ServiceFabricBackup/
|
||||
*.rptproj.bak
|
||||
|
||||
# SQL Server files
|
||||
*.mdf
|
||||
*.ldf
|
||||
*.ndf
|
||||
|
||||
# Business Intelligence projects
|
||||
*.rdl.data
|
||||
*.bim.layout
|
||||
*.bim_*.settings
|
||||
*.rptproj.rsuser
|
||||
*- [Bb]ackup.rdl
|
||||
*- [Bb]ackup ([0-9]).rdl
|
||||
*- [Bb]ackup ([0-9][0-9]).rdl
|
||||
|
||||
# Microsoft Fakes
|
||||
FakesAssemblies/
|
||||
|
||||
# GhostDoc plugin setting file
|
||||
*.GhostDoc.xml
|
||||
|
||||
# Node.js Tools for Visual Studio
|
||||
.ntvs_analysis.dat
|
||||
node_modules/
|
||||
|
||||
# Visual Studio 6 build log
|
||||
*.plg
|
||||
|
||||
# Visual Studio 6 workspace options file
|
||||
*.opt
|
||||
|
||||
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
|
||||
*.vbw
|
||||
|
||||
# Visual Studio LightSwitch build output
|
||||
**/*.HTMLClient/GeneratedArtifacts
|
||||
**/*.DesktopClient/GeneratedArtifacts
|
||||
**/*.DesktopClient/ModelManifest.xml
|
||||
**/*.Server/GeneratedArtifacts
|
||||
**/*.Server/ModelManifest.xml
|
||||
_Pvt_Extensions
|
||||
|
||||
# Paket dependency manager
|
||||
.paket/paket.exe
|
||||
paket-files/
|
||||
|
||||
# FAKE - F# Make
|
||||
.fake/
|
||||
|
||||
# CodeRush personal settings
|
||||
.cr/personal
|
||||
|
||||
# Python Tools for Visual Studio (PTVS)
|
||||
__pycache__/
|
||||
*.pyc
|
||||
|
||||
# Cake - Uncomment if you are using it
|
||||
# tools/**
|
||||
# !tools/packages.config
|
||||
|
||||
# Tabs Studio
|
||||
*.tss
|
||||
|
||||
# Telerik's JustMock configuration file
|
||||
*.jmconfig
|
||||
|
||||
# BizTalk build output
|
||||
*.btp.cs
|
||||
*.btm.cs
|
||||
*.odx.cs
|
||||
*.xsd.cs
|
||||
|
||||
# OpenCover UI analysis results
|
||||
OpenCover/
|
||||
|
||||
# Azure Stream Analytics local run output
|
||||
ASALocalRun/
|
||||
|
||||
# MSBuild Binary and Structured Log
|
||||
*.binlog
|
||||
|
||||
# NVidia Nsight GPU debugger configuration file
|
||||
*.nvuser
|
||||
|
||||
# MFractors (Xamarin productivity tool) working folder
|
||||
.mfractor/
|
||||
|
||||
# Local History for Visual Studio
|
||||
.localhistory/
|
||||
|
||||
# BeatPulse healthcheck temp database
|
||||
healthchecksdb
|
||||
|
||||
# Backup folder for Package Reference Convert tool in Visual Studio 2017
|
||||
MigrationBackup/
|
||||
|
||||
# Ionide (cross platform F# VS Code tools) working folder
|
||||
.ionide/
|
||||
|
||||
# Fody - auto-generated XML schema
|
||||
FodyWeavers.xsd
|
||||
/Waste.Application/bin
|
||||
/Waste.Application/obj
|
||||
/Waste.Core/obj
|
||||
/Waste.Core/bin
|
||||
/Waste.Doc/obj
|
||||
/Waste.Doc/bin
|
||||
/Waste.Domain/bin
|
||||
/Waste.Domain/obj
|
||||
/Waste.Web/bin
|
||||
/Waste.Web/obj
|
||||
/Waste.Web.Core/bin
|
||||
/Waste.Web.Core/obj
|
||||
/Nirvana.Common/bin
|
||||
/Nirvana.Common/obj
|
||||
/Waste.Doc/苏州垃圾分类计量设备计入标准/4G_2G_NB DTU Products Functions _V2.0_20200219.zip
|
||||
/Waste.Doc/苏州垃圾分类计量设备计入标准/4G_2G_NB Products Operation Guide_20200424.zip
|
||||
/Waste.Doc/苏州垃圾分类计量设备计入标准/HF2411 User Manual-V1.2_20200706.zip
|
||||
/Waste.Doc/苏州垃圾分类计量设备计入标准/4G_2G_NB DTU Products Functions _V2.0_20200219/4G_2G_NB DTU Products Functions_V2.0_20200219.pdf
|
||||
/Waste.Doc/苏州垃圾分类计量设备计入标准/4G_2G_NB Products Operation Guide_20200424/4G_2G_NB Products Operation Guide_20200424.pdf
|
||||
/Waste.Doc/苏州垃圾分类计量设备计入标准/HF2411 User Manual-V1.2_20200706/HF2411 User Manual V1.2(20200706).pdf
|
||||
/Waste.MessageHandler/bin
|
||||
/Waste.MessageHandler/obj
|
||||
/Waste.Socket/bin
|
||||
/Waste.Socket/obj
|
||||
/Waste.Web.Entry/bin
|
||||
/Waste.Web.Entry/obj
|
||||
/.vs
|
||||
/WasteConsoleTest/WasteConsoleTest/obj
|
||||
/WasteConsoleTest/WasteConsoleTest/bin
|
||||
/Waste.CreateDB/bin/Debug/net5.0
|
||||
/Waste.CreateDB/obj
|
||||
/Waste.SocketService.cs/bin
|
||||
/Waste.SocketService.cs/obj
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ namespace Nirvana.Common
|
|||
/// <summary>
|
||||
/// 常用公共类
|
||||
/// </summary>
|
||||
public static class Common
|
||||
public class Common
|
||||
{
|
||||
#region Stopwatch计时器
|
||||
/// <summary>
|
||||
|
|
@ -293,13 +293,5 @@ namespace Nirvana.Common
|
|||
return BitConverter.ToInt64(buffer, 0);
|
||||
}
|
||||
|
||||
public static T GetListValue<T>(this IList<T> list, int index, T def = default)
|
||||
{
|
||||
if (list.Count > index)
|
||||
{
|
||||
return list[index];
|
||||
}
|
||||
return def;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,12 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Nirvana.Common
|
||||
{
|
||||
public static partial class Ext
|
||||
{
|
||||
#region 数值转换
|
||||
|
||||
/// <summary>
|
||||
/// 转换为整型
|
||||
/// </summary>
|
||||
|
|
@ -67,7 +68,6 @@ namespace Nirvana.Common
|
|||
double result;
|
||||
return double.TryParse(data.ToString(), out result) ? result : 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 转换为float
|
||||
/// </summary>
|
||||
|
|
@ -176,10 +176,9 @@ namespace Nirvana.Common
|
|||
return Math.Round(result.Value, digits);
|
||||
}
|
||||
|
||||
#endregion 数值转换
|
||||
#endregion
|
||||
|
||||
#region 日期转换
|
||||
|
||||
/// <summary>
|
||||
/// 转换为日期
|
||||
/// </summary>
|
||||
|
|
@ -206,7 +205,6 @@ namespace Nirvana.Common
|
|||
return result;
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 时间格式化,带时分,如果同一年则不显示年,否则显示年份
|
||||
/// </summary>
|
||||
|
|
@ -242,11 +240,9 @@ namespace Nirvana.Common
|
|||
return result.ToString("M-d");
|
||||
return result.ToString("yyyy-M-d");
|
||||
}
|
||||
|
||||
#endregion 日期转换
|
||||
#endregion
|
||||
|
||||
#region 布尔转换
|
||||
|
||||
/// <summary>
|
||||
/// 转换为布尔值
|
||||
/// </summary>
|
||||
|
|
@ -271,22 +267,16 @@ namespace Nirvana.Common
|
|||
{
|
||||
case "0":
|
||||
return false;
|
||||
|
||||
case "1":
|
||||
return true;
|
||||
|
||||
case "是":
|
||||
return true;
|
||||
|
||||
case "否":
|
||||
return false;
|
||||
|
||||
case "yes":
|
||||
return true;
|
||||
|
||||
case "no":
|
||||
return false;
|
||||
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
|
|
@ -310,46 +300,9 @@ namespace Nirvana.Common
|
|||
return null;
|
||||
}
|
||||
|
||||
#endregion 布尔转换
|
||||
|
||||
#region Guid转换
|
||||
|
||||
/// <summary>
|
||||
/// 转换为Guid
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <returns></returns>
|
||||
public static Guid ToGuid(this object data)
|
||||
{
|
||||
if (data == null)
|
||||
{
|
||||
return Guid.Empty;
|
||||
}
|
||||
Guid result;
|
||||
bool isValid = Guid.TryParse(data.ToString(), out result);
|
||||
if (isValid)
|
||||
return result;
|
||||
return Guid.Empty;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 转换为Guid
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <returns></returns>
|
||||
public static Guid ToGuid(this Guid? data)
|
||||
{
|
||||
if (data == null)
|
||||
{
|
||||
return Guid.Empty;
|
||||
}
|
||||
return data.Value;
|
||||
}
|
||||
|
||||
#endregion Guid转换
|
||||
#endregion
|
||||
|
||||
#region 字符串转换
|
||||
|
||||
/// <summary>
|
||||
/// 转换为字符串
|
||||
/// </summary>
|
||||
|
|
@ -358,7 +311,6 @@ namespace Nirvana.Common
|
|||
{
|
||||
return data == null ? string.Empty : data.ToString().Trim();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 针对可能为空的字符串处理
|
||||
/// </summary>
|
||||
|
|
@ -366,7 +318,7 @@ namespace Nirvana.Common
|
|||
/// <returns></returns>
|
||||
public static string ToStr(this string data)
|
||||
{
|
||||
return string.IsNullOrEmpty(data) ? string.Empty : data.Replace(" ", "");
|
||||
return string.IsNullOrEmpty(data) ? string.Empty : data.Replace(" ","");
|
||||
}
|
||||
|
||||
public static string ToStrEmpty(this string data)
|
||||
|
|
@ -374,7 +326,7 @@ namespace Nirvana.Common
|
|||
return string.IsNullOrEmpty(data) ? string.Empty : data.Trim();
|
||||
}
|
||||
|
||||
#endregion 字符串转换
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// 安全返回值
|
||||
|
|
@ -384,7 +336,6 @@ namespace Nirvana.Common
|
|||
{
|
||||
return value ?? default(T);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 是否为空
|
||||
/// </summary>
|
||||
|
|
@ -393,7 +344,6 @@ namespace Nirvana.Common
|
|||
{
|
||||
return string.IsNullOrWhiteSpace(value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 是否为空
|
||||
/// </summary>
|
||||
|
|
@ -404,7 +354,6 @@ namespace Nirvana.Common
|
|||
return true;
|
||||
return IsEmpty(value.Value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 是否为空
|
||||
/// </summary>
|
||||
|
|
@ -415,7 +364,6 @@ namespace Nirvana.Common
|
|||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 是否为空
|
||||
/// </summary>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
using Furion.DependencyInjection;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Nirvana.Common;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
|
|
@ -46,7 +45,6 @@ namespace Waste.Application
|
|||
return new ResultInfo { code = ResultState.FAIL, message = "账户已禁用" };
|
||||
}
|
||||
var password = Md5.md5(DESEncrypt.Encrypt(Md5.md5(model.pwd, 32).ToLower(), userdata.Secret).ToLower(), 32).ToLower();
|
||||
|
||||
if (password != userdata.Password)
|
||||
{
|
||||
return new ResultInfo { code = ResultState.FAIL, message = "密码不正确" };
|
||||
|
|
|
|||
|
|
@ -3,7 +3,9 @@ using Microsoft.AspNetCore.Mvc;
|
|||
using Microsoft.AspNetCore.Mvc.Filters;
|
||||
using Nirvana.Common;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Waste.Application
|
||||
|
|
@ -39,7 +41,7 @@ namespace Waste.Application
|
|||
}
|
||||
string ip = request.HttpContext.Connection.RemoteIpAddress.ToString();
|
||||
var res = await _businessApiService.IsWhiteIP(appid, ip);
|
||||
if (res.code != ApiResultState.SUCCESS)
|
||||
if(res.code != ApiResultState.SUCCESS)
|
||||
{
|
||||
var jsonresult = new JsonResult(res);
|
||||
context.Result = jsonresult;
|
||||
|
|
@ -57,34 +59,4 @@ namespace Waste.Application
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class WasteAuthorizeAttribute : Attribute, IAsyncActionFilter, IAsyncPageFilter
|
||||
{
|
||||
public async Task OnActionExecutionAsync(ActionExecutingContext context, ActionExecutionDelegate next)
|
||||
{
|
||||
if (OperatorProvider.Provider.GetCurrent() != null && (OperatorProvider.Provider.GetCurrent().UserId != Guid.Empty || OperatorProvider.Provider.GetCurrent().IsSuper))
|
||||
{
|
||||
_ = await next.Invoke();
|
||||
return;
|
||||
}
|
||||
|
||||
context.Result = new StatusCodeResult(401);
|
||||
}
|
||||
|
||||
public Task OnPageHandlerSelectionAsync(PageHandlerSelectedContext context)
|
||||
{
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public async Task OnPageHandlerExecutionAsync(PageHandlerExecutingContext context, PageHandlerExecutionDelegate next)
|
||||
{
|
||||
if (OperatorProvider.Provider.GetCurrent() != null && (OperatorProvider.Provider.GetCurrent().UserId != Guid.Empty || OperatorProvider.Provider.GetCurrent().IsSuper))
|
||||
{
|
||||
_ = await next.Invoke();
|
||||
return;
|
||||
}
|
||||
|
||||
context.Result = new StatusCodeResult(401);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -128,7 +128,7 @@ namespace Waste.Application
|
|||
//针对非平台类型,则可以查看下面所有的子账户设备
|
||||
if (currentUser.AccountType != (int)AccountType.platform)
|
||||
{
|
||||
var sql = $" code !='{currentUser.BusinessCode}' and code like '{currentUser.BusinessCode}%' and id = x.id";
|
||||
var sql = $" code !={currentUser.BusinessCode} and code like '{currentUser.BusinessCode}'+'%' and id = x.id";
|
||||
temquery = temquery.Where(x => SqlFunc.Subqueryable<W_Business>().Where(sql).Any());
|
||||
}
|
||||
string sorts = string.Format("{0} {1}", param.sort, param.order);
|
||||
|
|
@ -541,19 +541,12 @@ namespace Waste.Application
|
|||
DateTime yestodaytime = DateTime.Now.AddDays(-1);
|
||||
if (currentUser.AccountType != (int)AccountType.platform)
|
||||
{
|
||||
//string basesql = $"code like '{currentUser.BusinessCode} %' and id = x.id";
|
||||
//string sql = $" code !={currentUser.BusinessCode} and {basesql}";
|
||||
//string devicesql = $"code like '{currentUser.BusinessCode} %' and id = x.businessid";
|
||||
int businesscnt = await dbClient.Queryable<W_Business>().Where(x => SqlFunc.Subqueryable<W_Business>()
|
||||
.Where(e=>SqlFunc.StartsWith(e.Code,currentUser.BusinessCode))
|
||||
.Where(e=>x.Code != currentUser.BusinessCode)
|
||||
.Where(e=>e.Id == x.Id)
|
||||
.Any())
|
||||
.CountAsync();
|
||||
int devcnt = await repository.Change<W_Device>().Context.Queryable<W_Device>()
|
||||
.Where(x=>SqlFunc.Subqueryable<W_Business>().Where(e=>SqlFunc.StartsWith(e.Code,currentUser.BusinessCode) && e.Id == x.Businessid).Any())
|
||||
.CountAsync();
|
||||
var tempquery = repository.Change<W_DeviceStatistics>().Context.Queryable<W_DeviceStatistics>().Where(x => SqlFunc.DateIsSame(x.CreateTime, yestodaytime) && SqlFunc.Subqueryable<W_Business>().Where(e => SqlFunc.StartsWith(e.Code, currentUser.BusinessCode) && e.Id == x.Businessid).Any());
|
||||
string basesql = $"code like '{currentUser.BusinessCode}'+'%' and id = x.id";
|
||||
string sql = $" code !={currentUser.BusinessCode} and {basesql}";
|
||||
string devicesql = $"code like '{currentUser.BusinessCode}'+'%' and id = x.businessid";
|
||||
int businesscnt = await dbClient.Queryable<W_Business>().Where(x => SqlFunc.Subqueryable<W_Business>().Where(sql).Any()).CountAsync();
|
||||
int devcnt = await repository.Change<W_Device>().Context.Queryable<W_Device>().Where(x => SqlFunc.Subqueryable<W_Business>().Where(devicesql).Any()).CountAsync();
|
||||
var tempquery = repository.Change<W_DeviceStatistics>().Context.Queryable<W_DeviceStatistics>().Where(x => SqlFunc.DateIsSame(x.CreateTime, yestodaytime) && SqlFunc.Subqueryable<W_Business>().Where(devicesql).Any());
|
||||
int count = await tempquery.Clone().SumAsync(x => x.DayCount);
|
||||
decimal weight = await tempquery.Clone().SumAsync(x => x.DayWeight);
|
||||
decimal pureweight = await tempquery.Clone().SumAsync(x => x.DayPureWeight);
|
||||
|
|
|
|||
|
|
@ -1,9 +1,13 @@
|
|||
using Furion.DynamicApiController;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Nirvana.Common;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Waste.Domain;
|
||||
|
||||
namespace Waste.Application
|
||||
{
|
||||
|
|
@ -13,12 +17,10 @@ namespace Waste.Application
|
|||
public class DeviceAppService : IDynamicApiController
|
||||
{
|
||||
private readonly IDeviceService _deviceService;
|
||||
|
||||
public DeviceAppService(IDeviceService deviceService)
|
||||
{
|
||||
_deviceService = deviceService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设备列表
|
||||
/// </summary>
|
||||
|
|
@ -29,7 +31,6 @@ namespace Waste.Application
|
|||
{
|
||||
return await _deviceService.GetListAsync(param);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 信息提交
|
||||
/// </summary>
|
||||
|
|
@ -39,7 +40,6 @@ namespace Waste.Application
|
|||
{
|
||||
return await _deviceService.SubmitFormAsync(role);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 批量操作
|
||||
/// </summary>
|
||||
|
|
@ -49,7 +49,6 @@ namespace Waste.Application
|
|||
{
|
||||
return await _deviceService.BatchSetAsync(deviceBatchModel);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设备状态修改
|
||||
/// </summary>
|
||||
|
|
@ -62,7 +61,6 @@ namespace Waste.Application
|
|||
{
|
||||
return await _deviceService.SetStatusAsync(id, status);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 配置设备推送信息
|
||||
/// </summary>
|
||||
|
|
@ -72,15 +70,5 @@ namespace Waste.Application
|
|||
{
|
||||
return await _deviceService.SetConfigAsync(input);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 批量配置千灯镇商户推送
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[AllowAnonymous]
|
||||
public async Task SetQDConfig()
|
||||
{
|
||||
await _deviceService.SetQDConfig();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,11 +1,15 @@
|
|||
using Furion.DependencyInjection;
|
||||
using Furion.DistributedIDGenerator;
|
||||
using Furion.DynamicApiController;
|
||||
using Mapster;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Nirvana.Common;
|
||||
using Nirvana.Common.ApiBase;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Waste.Domain;
|
||||
|
||||
|
|
@ -26,7 +30,6 @@ namespace Waste.Application.Device
|
|||
dbClient = repository.Context;
|
||||
_businessService = businessService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设备批量操作
|
||||
/// </summary>
|
||||
|
|
@ -43,6 +46,7 @@ namespace Waste.Application.Device
|
|||
//如果是管理员分配
|
||||
if (currentUser.AccountType == (int)AccountType.platform)
|
||||
{
|
||||
|
||||
await dbClient.Updateable<W_Device>().SetColumns(x => new W_Device
|
||||
{
|
||||
Businessid = deviceBatchModel.BusinessId,
|
||||
|
|
@ -117,7 +121,6 @@ namespace Waste.Application.Device
|
|||
Id = devicedata.Id
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设备详情数据
|
||||
/// </summary>
|
||||
|
|
@ -146,7 +149,6 @@ namespace Waste.Application.Device
|
|||
FacEcode = device.FacEcode
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取设备配置详情
|
||||
/// </summary>
|
||||
|
|
@ -154,10 +156,10 @@ namespace Waste.Application.Device
|
|||
/// <returns></returns>
|
||||
public async Task<W_DeviceConfig> GetConfigAsync(Guid id)
|
||||
{
|
||||
var data = await dbClient.Queryable<W_DeviceConfig>().FirstAsync(x => x.DeviceId == id);
|
||||
if (data == null)
|
||||
var data= await dbClient.Queryable<W_DeviceConfig>().FirstAsync(x => x.DeviceId == id);
|
||||
if(data == null)
|
||||
{
|
||||
data = new W_DeviceConfig();
|
||||
data= new W_DeviceConfig();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
|
@ -274,7 +276,6 @@ namespace Waste.Application.Device
|
|||
limit = param.limit
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 配置设备推送信息
|
||||
/// </summary>
|
||||
|
|
@ -306,44 +307,6 @@ namespace Waste.Application.Device
|
|||
return new ResultInfo(ResultState.SUCCESS, "配置成功");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 批量配置千灯镇商户推送
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task SetQDConfig()
|
||||
{
|
||||
string Body = string.Empty;
|
||||
string Url = "http://36.154.126.138:8817/api/third/postdata";
|
||||
var bid = Guid.Parse("08D99B4B-B02D-4E65-8D56-2FD16EC1716F");
|
||||
var alldevice = await dbClient.Queryable<W_Device>().Where(x => x.Businessid == bid).Select(x => new W_Device
|
||||
{
|
||||
Id = x.Id,
|
||||
FacEcode=x.FacEcode
|
||||
}).ToListAsync();
|
||||
foreach (var item in alldevice)
|
||||
{
|
||||
if (await dbClient.Queryable<W_DeviceConfig>().AnyAsync(x => x.DeviceId == item.Id))
|
||||
{
|
||||
await dbClient.Updateable<W_DeviceConfig>().SetColumns(x => new W_DeviceConfig
|
||||
{
|
||||
Url = Url,
|
||||
Body = Body
|
||||
}).Where(x => x.DeviceId == item.Id).ExecuteCommandAsync();
|
||||
}
|
||||
else
|
||||
{
|
||||
var insertdata = new W_DeviceConfig
|
||||
{
|
||||
DeviceId = item.Id,
|
||||
Body = Body,
|
||||
CreateTime = DateTime.Now,
|
||||
Url = Url
|
||||
};
|
||||
await dbClient.Insertable(insertdata).ExecuteCommandAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设备状态修改
|
||||
/// </summary>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,9 @@
|
|||
using Nirvana.Common;
|
||||
using Nirvana.Common.ApiBase;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Waste.Domain;
|
||||
|
||||
|
|
@ -16,56 +20,43 @@ namespace Waste.Application
|
|||
/// <param name="param"></param>
|
||||
/// <returns></returns>
|
||||
Task<PageParms<DeviceList>> GetListAsync(QueryParams param);
|
||||
|
||||
/// <summary>
|
||||
/// 设备信息提交
|
||||
/// </summary>
|
||||
/// <param name="role"></param>
|
||||
/// <returns></returns>
|
||||
Task<ResultInfo> SubmitFormAsync(DeviceSubmit role);
|
||||
|
||||
/// <summary>
|
||||
/// 详情
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
Task<DeviceSubmit> DetailAsync(Guid id);
|
||||
|
||||
/// <summary>
|
||||
/// 设备批量操作
|
||||
/// </summary>
|
||||
/// <param name="deviceBatchModel"></param>
|
||||
/// <returns></returns>
|
||||
Task<ResultInfo> BatchSetAsync(DeviceBatchModel deviceBatchModel);
|
||||
|
||||
/// <summary>
|
||||
/// 设备详情数据
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
Task<DeviceDetailS2Dto> DeviceDetailAsync(Guid id);
|
||||
|
||||
/// <summary>
|
||||
/// 设备状态修改
|
||||
/// </summary>
|
||||
/// <param name="id">设备ID</param>
|
||||
/// <param name="status">设备状态,0-停用,1-正常,2-激活</param>
|
||||
/// <returns></returns>
|
||||
Task<ResultInfo> SetStatusAsync(Guid id, int status);
|
||||
|
||||
Task<ResultInfo> SetStatusAsync(Guid id,int status);
|
||||
/// <summary>
|
||||
/// 配置设备推送信息
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
Task<ResultInfo> SetConfigAsync(DeviceConfigC2SDto input);
|
||||
|
||||
/// <summary>
|
||||
/// 批量配置千灯镇商户推送
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task SetQDConfig();
|
||||
|
||||
/// <summary>
|
||||
/// 获取设备配置详情
|
||||
/// </summary>
|
||||
|
|
|
|||
|
|
@ -17,19 +17,12 @@ namespace Waste.Application
|
|||
config.ForType<ApiReportBaseDataItem, ApiReportBaseData>()
|
||||
.Map(dest => dest.weight, src => src.DayWeight.ToString("f2"))
|
||||
.Map(dest => dest.pweight, src => src.DayPureWeight.ToString("f2"))
|
||||
.Map(dest => dest.time, src => src.CreateTime.ToString("yyyy-MM-dd"))
|
||||
.Map(dest => dest.type, src => src.WasteType)
|
||||
.Map(dest=>dest.time,src=>src.CreateTime.ToString("yyyy-MM-dd"))
|
||||
.Map(dest=>dest.type,src=>src.WasteType)
|
||||
;
|
||||
config.ForType<SendThirdMessageSubscribeS2SDto, SendThirdMessageSubscriDto>()
|
||||
.Map(dest => dest.Time, src => src.Time.GetTimeStamp())
|
||||
;
|
||||
config.ForType<SendThirdMessageSubscribeS2SDto, SendThirdMessageSubscriDto>()
|
||||
.Map(dest => dest.Time, src => src.Time.GetTimeStamp())
|
||||
;
|
||||
config.ForType<ResultListByEquS2SDto, ResultListByEquS2CDto>()
|
||||
.Map(dest => dest.Time, src => src.CreateTime.GetTimeStamp())
|
||||
.Map(dest => dest.Weight, src => src.GrossWeight.ToDecimal())
|
||||
;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,8 +1,11 @@
|
|||
using Furion;
|
||||
using Furion;
|
||||
using Furion.DependencyInjection;
|
||||
using Furion.RemoteRequest.Extensions;
|
||||
using MessagePack;
|
||||
using Nirvana.Common;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net.Http;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
|
@ -20,13 +23,11 @@ namespace Waste.Application
|
|||
private static string ApiSecretHash = App.Configuration["SZDevPlatSetting:ApiSecretHash"];
|
||||
private readonly IHttpClientFactory _clientFactory;
|
||||
private readonly ILoggerService _loggerService;
|
||||
|
||||
public SuZhouService(IHttpClientFactory clientFactory, ILoggerService loggerService)
|
||||
{
|
||||
_clientFactory = clientFactory;
|
||||
_loggerService = loggerService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 分页查询当前账号下存在的地产区域数据
|
||||
/// </summary>
|
||||
|
|
@ -36,6 +37,7 @@ namespace Waste.Application
|
|||
/// <returns></returns>
|
||||
public async Task<ResultInfo> GetEstatesAsync(int page = 1, int size = 10, string search = "")
|
||||
{
|
||||
|
||||
var url = $"{ApiUrl}/api/estates?page={page}&size={size}&search={search}";
|
||||
var response = await GetDataAsync(url, 1, "");
|
||||
var resdata = await response.Content.ReadAsByteArrayAsync();
|
||||
|
|
@ -50,7 +52,6 @@ namespace Waste.Application
|
|||
return new ResultInfo(ResultState.FAIL, msg);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询地产区域信息
|
||||
/// </summary>
|
||||
|
|
@ -72,7 +73,6 @@ namespace Waste.Application
|
|||
return new ResultInfo(ResultState.FAIL, msg);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Hello接口GET测试
|
||||
/// </summary>
|
||||
|
|
@ -94,7 +94,6 @@ namespace Waste.Application
|
|||
}
|
||||
return new ResultInfo(ResultState.SUCCESS, "success", returndata);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加地产区域信息
|
||||
/// </summary>
|
||||
|
|
@ -119,7 +118,6 @@ namespace Waste.Application
|
|||
return new ResultInfo(ResultState.FAIL, msg);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 向服务端推送测试用垃圾采集数据
|
||||
/// </summary>
|
||||
|
|
@ -161,7 +159,6 @@ namespace Waste.Application
|
|||
return new ResultInfo(ResultState.FAIL, msg);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Hello接口Post测试
|
||||
/// </summary>
|
||||
|
|
@ -188,7 +185,6 @@ namespace Waste.Application
|
|||
}
|
||||
return new ResultInfo(ResultState.SUCCESS, "success", returndata);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取时间戳
|
||||
/// </summary>
|
||||
|
|
@ -211,7 +207,6 @@ namespace Waste.Application
|
|||
int timestamp = Convert.ToInt32((utcTime - utcStartTime).TotalSeconds);
|
||||
return timestamp;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取随机数
|
||||
/// </summary>
|
||||
|
|
@ -222,7 +217,6 @@ namespace Waste.Application
|
|||
int nonce = random.Next(1, Int32.MaxValue);
|
||||
return nonce;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取签名
|
||||
/// </summary>
|
||||
|
|
@ -251,7 +245,6 @@ namespace Waste.Application
|
|||
string sign = Md5.md5(str, 16).ToLower();
|
||||
return sign;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// POST封装接口
|
||||
/// </summary>
|
||||
|
|
@ -292,7 +285,6 @@ namespace Waste.Application
|
|||
var testdata = await response.Content.ReadAsStringAsync();
|
||||
return response;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// GET接口封装
|
||||
/// </summary>
|
||||
|
|
@ -324,7 +316,6 @@ namespace Waste.Application
|
|||
var testdata = await response.Content.ReadAsStringAsync();
|
||||
return response;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Delete接口封装
|
||||
/// </summary>
|
||||
|
|
@ -356,7 +347,6 @@ namespace Waste.Application
|
|||
var testdata = await response.Content.ReadAsStringAsync();
|
||||
return response;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除地产区域
|
||||
/// </summary>
|
||||
|
|
@ -377,7 +367,6 @@ namespace Waste.Application
|
|||
return new ResultInfo(ResultState.FAIL, msg);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除采集点
|
||||
/// </summary>
|
||||
|
|
@ -397,7 +386,6 @@ namespace Waste.Application
|
|||
return new ResultInfo(ResultState.FAIL, resdata);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加采集点
|
||||
/// </summary>
|
||||
|
|
@ -422,7 +410,6 @@ namespace Waste.Application
|
|||
return new ResultInfo(ResultState.FAIL, msg);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 上传数据
|
||||
/// </summary>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
|
@ -8,177 +7,33 @@ using Waste.Domain;
|
|||
|
||||
namespace Waste.Application
|
||||
{
|
||||
/// <summary>
|
||||
/// 投放记录列表
|
||||
/// </summary>
|
||||
public class ResultListByEquS2CDto
|
||||
{
|
||||
/// <summary>
|
||||
/// 垃圾类别
|
||||
/// </summary>
|
||||
public string WasteType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 物品小类别
|
||||
/// </summary>
|
||||
public string WasteSType { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 重量,单位KG
|
||||
/// </summary>
|
||||
public string Weight { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 垃圾桶编号
|
||||
/// </summary>
|
||||
public string TrashCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 上报时间
|
||||
/// </summary>
|
||||
public long Time { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 投放记录列表
|
||||
/// </summary>
|
||||
public class ResultListByEquS2SDto : ResultListByEquS2CDto
|
||||
{
|
||||
/// <summary>
|
||||
/// 上报时间
|
||||
/// </summary>
|
||||
public DateTime CreateTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 测量记录ID
|
||||
/// </summary>
|
||||
public Guid Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 毛重
|
||||
/// </summary>
|
||||
public decimal GrossWeight { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询投放记录
|
||||
/// </summary>
|
||||
public class ResultListByEquC2SDto : IValidatableObject
|
||||
{
|
||||
/// <summary>
|
||||
/// 当前页
|
||||
/// </summary>
|
||||
public int offset { get; set; } = 1;
|
||||
|
||||
/// <summary>
|
||||
/// 每页显示的数量
|
||||
/// </summary>
|
||||
public int limit { get; set; } = 10;
|
||||
|
||||
/// <summary>
|
||||
/// 开始时间
|
||||
/// </summary>
|
||||
public DateTime? StartTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 结束时间
|
||||
/// </summary>
|
||||
public DateTime? EndTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 设备ID
|
||||
/// </summary>
|
||||
public Guid DeviceId { get; set; }
|
||||
|
||||
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
|
||||
{
|
||||
if (DeviceId == Guid.Empty)
|
||||
{
|
||||
yield return new ValidationResult("设备ID不可为空", new[] { nameof(DeviceId) });
|
||||
}
|
||||
if (limit > 100)
|
||||
{
|
||||
yield return new ValidationResult("一次最多100条记录", new[] { nameof(limit) });
|
||||
}
|
||||
if (offset <= 0)
|
||||
{
|
||||
yield return new ValidationResult("页码需从1开始", new[] { nameof(offset) });
|
||||
}
|
||||
if (StartTime.HasValue && StartTime.Value.Date > DateTime.Now.Date)
|
||||
{
|
||||
yield return new ValidationResult("开始时间不可超过当天", new[] { nameof(StartTime) });
|
||||
}
|
||||
if (EndTime.HasValue && EndTime.Value.Date > DateTime.Now.Date)
|
||||
{
|
||||
yield return new ValidationResult("结束时间不可超过当天", new[] { nameof(StartTime) });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class ResultList : W_Result
|
||||
{
|
||||
/// <summary>
|
||||
/// 商户名称
|
||||
/// </summary>
|
||||
public string BusinessName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 设备名称
|
||||
/// </summary>
|
||||
public string DeviceName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 设备地址
|
||||
/// </summary>
|
||||
public string DeviceAddress { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 设备出厂序列号
|
||||
/// </summary>
|
||||
public string DeviceFacEcode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 设备编号
|
||||
/// </summary>
|
||||
public string DeviceEcode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 上报是否成功,1-成功,0-失败
|
||||
/// </summary>
|
||||
public int PostStatus { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 物品小类
|
||||
/// </summary>
|
||||
public string Measure_WasteSType { get; set; }
|
||||
/// <summary>
|
||||
/// 价格
|
||||
/// </summary>
|
||||
public decimal? Measure_Price { get; set; }
|
||||
/// <summary>
|
||||
/// 金额
|
||||
/// </summary>
|
||||
public decimal? Measure_Amount { get; set; }
|
||||
/// <summary>
|
||||
/// 操作员
|
||||
/// </summary>
|
||||
public string Measure_OpUser { get; set; }
|
||||
/// <summary>
|
||||
/// 唯一消息ID
|
||||
/// </summary>
|
||||
public string Measure_UUID { get; set; }
|
||||
|
||||
|
||||
public string ID1 { get; set; }
|
||||
public string ID2 { get; set; }
|
||||
public string ID3 { get; set; }
|
||||
public string ID4 { get; set; }
|
||||
public string ID5 { get; set; }
|
||||
public string ID6 { get; set; }
|
||||
public string ID7 { get; set; }
|
||||
public string ID8 { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 上传的数据包体
|
||||
/// </summary>
|
||||
|
|
@ -187,88 +42,71 @@ namespace Waste.Application
|
|||
/// <summary>
|
||||
/// 固定头
|
||||
/// </summary>
|
||||
public string Key { get; set; } = string.Empty;
|
||||
|
||||
public string Key { get; set; } = "";
|
||||
/// <summary>
|
||||
/// 数据体长度
|
||||
/// </summary>
|
||||
public int Len { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// IMEI/设备编号
|
||||
/// IMEI
|
||||
/// </summary>
|
||||
public string IMEI { get; set; } = string.Empty;
|
||||
|
||||
public string IMEI { get; set; } = "";
|
||||
/// <summary>
|
||||
/// ICCID
|
||||
/// </summary>
|
||||
public string ICCID { get; set; } = string.Empty;
|
||||
|
||||
public string ICCID { get; set; } = "";
|
||||
/// <summary>
|
||||
/// IMSI
|
||||
/// </summary>
|
||||
public string IMSI { get; set; } = string.Empty;
|
||||
|
||||
public string IMSI { get; set; } = "";
|
||||
/// <summary>
|
||||
/// 信号强度
|
||||
/// </summary>
|
||||
public string GSLQ { get; set; } = string.Empty;
|
||||
|
||||
public string GSLQ { get; set; } = "";
|
||||
/// <summary>
|
||||
/// 时间
|
||||
/// </summary>
|
||||
public string Time { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 经度
|
||||
/// </summary>
|
||||
public string Longitude { get; set; } = string.Empty;
|
||||
|
||||
public string Longitude { get; set; } = "";
|
||||
/// <summary>
|
||||
/// 纬度
|
||||
/// </summary>
|
||||
public string Latitude { get; set; } = string.Empty;
|
||||
|
||||
public string Latitude { get; set; } = "";
|
||||
/// <summary>
|
||||
/// 设备地区
|
||||
/// </summary>
|
||||
public string City { get; set; } = string.Empty;
|
||||
|
||||
public string City { get; set; } = "";
|
||||
/// <summary>
|
||||
/// 设备详细地点
|
||||
/// </summary>
|
||||
public string Area { get; set; } = string.Empty;
|
||||
|
||||
public string Area { get; set; } = "";
|
||||
/// <summary>
|
||||
/// 垃圾类别
|
||||
/// </summary>
|
||||
public string WasteType { get; set; } = string.Empty;
|
||||
|
||||
public string WasteType { get; set; } = "";
|
||||
/// <summary>
|
||||
/// 重量,KG
|
||||
/// </summary>
|
||||
public string Weight { get; set; } = "0";
|
||||
|
||||
/// <summary>
|
||||
/// 内容
|
||||
/// </summary>
|
||||
public string Body { get; set; } = string.Empty;
|
||||
|
||||
public string Body { get; set; } = "";
|
||||
/// <summary>
|
||||
/// 字符串结果
|
||||
/// </summary>
|
||||
public string Str { get; set; } = string.Empty;
|
||||
|
||||
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>
|
||||
|
|
@ -283,153 +121,102 @@ namespace Waste.Application
|
|||
/// <summary>
|
||||
/// 垃圾类别小类
|
||||
/// </summary>
|
||||
public string WasteSType { get; set; } = string.Empty;
|
||||
|
||||
public string WasteSType { get; set; } = "";
|
||||
/// <summary>
|
||||
/// 消息ID
|
||||
/// </summary>
|
||||
public string UUID { get; set; } = string.Empty;
|
||||
|
||||
public string UUID { get; set; } = "";
|
||||
/// <summary>
|
||||
/// 上报时间
|
||||
/// </summary>
|
||||
public string UploadTime { get; set; } = string.Empty;
|
||||
|
||||
public string UploadTime { get; set; } = "";
|
||||
/// <summary>
|
||||
/// 价格
|
||||
/// </summary>
|
||||
public string Price { get; set; } = string.Empty;
|
||||
|
||||
public string Price { get; set; } = "";
|
||||
/// <summary>
|
||||
/// 金额
|
||||
/// </summary>
|
||||
public string Amount { get; set; } = string.Empty;
|
||||
|
||||
public string Amount { get; set; } = "";
|
||||
/// <summary>
|
||||
/// 操作员
|
||||
/// </summary>
|
||||
public string OpUser { get; set; } = string.Empty;
|
||||
/// <summary>
|
||||
/// 设备出厂序列号/设备出厂编号
|
||||
/// </summary>
|
||||
public string DeviceFacEcode { get; set; } = string.Empty;
|
||||
/// <summary>
|
||||
/// 车牌号/物品编码/垃圾桶编号
|
||||
/// </summary>
|
||||
public string Registration { get; set; } = string.Empty;
|
||||
/// <summary>
|
||||
/// 毛重,KG
|
||||
/// </summary>
|
||||
public string GrossWeight { get; set; } = string.Empty;
|
||||
/// <summary>
|
||||
/// 皮重,KG
|
||||
/// </summary>
|
||||
public string Tare { get; set; } = string.Empty;
|
||||
/// <summary>
|
||||
/// 净重,KG
|
||||
/// </summary>
|
||||
public string NetWeight { get; set; } = string.Empty;
|
||||
public string ID1 { get; set; } = string.Empty;
|
||||
public string ID2 { get; set; } = string.Empty;
|
||||
public string ID3 { get; set; } = string.Empty;
|
||||
public string ID4 { get; set; } = string.Empty;
|
||||
public string ID5 { get; set; } = string.Empty;
|
||||
public string ID6 { get; set; } = string.Empty;
|
||||
public string ID7 { get; set; } = string.Empty;
|
||||
public string ID8 { get; set; } = string.Empty;
|
||||
public string DataHash { get; set; } = "";
|
||||
public string OpUser { get; set; } = "";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A8协议模块上传的数据包体
|
||||
/// </summary>
|
||||
public class A8MyPackage : A8Package
|
||||
public class A8MyPackage:A8Package
|
||||
{
|
||||
/// <summary>
|
||||
/// 固定头
|
||||
/// </summary>
|
||||
public string Key { get; set; } = string.Empty;
|
||||
|
||||
public string Key { get; set; } = "";
|
||||
/// <summary>
|
||||
/// 数据体长度
|
||||
/// </summary>
|
||||
public int Len { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// IMEI
|
||||
/// </summary>
|
||||
public string IMEI { get; set; } = string.Empty;
|
||||
|
||||
public string IMEI { get; set; } = "";
|
||||
/// <summary>
|
||||
/// ICCID
|
||||
/// </summary>
|
||||
public string ICCID { get; set; } = string.Empty;
|
||||
|
||||
public string ICCID { get; set; } = "";
|
||||
/// <summary>
|
||||
/// IMSI
|
||||
/// </summary>
|
||||
public string IMSI { get; set; } = string.Empty;
|
||||
|
||||
public string IMSI { get; set; } = "";
|
||||
/// <summary>
|
||||
/// 信号强度
|
||||
/// </summary>
|
||||
public string GSLQ { get; set; } = string.Empty;
|
||||
|
||||
public string GSLQ { get; set; } = "";
|
||||
/// <summary>
|
||||
/// 时间
|
||||
/// </summary>
|
||||
public string Time { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 经度
|
||||
/// </summary>
|
||||
public string Longitude { get; set; } = string.Empty;
|
||||
|
||||
public string Longitude { get; set; } = "";
|
||||
/// <summary>
|
||||
/// 纬度
|
||||
/// </summary>
|
||||
public string Latitude { get; set; } = string.Empty;
|
||||
|
||||
public string Latitude { get; set; } = "";
|
||||
/// <summary>
|
||||
/// 桶大小
|
||||
/// </summary>
|
||||
public string size { get; set; } = string.Empty;
|
||||
|
||||
public string size { get; set; } = "";
|
||||
/// <summary>
|
||||
/// 垃圾桶编号
|
||||
/// </summary>
|
||||
public string trashcode { get; set; } = string.Empty;
|
||||
|
||||
public string trashcode { get; set; } = "";
|
||||
/// <summary>
|
||||
/// 垃圾类别
|
||||
/// </summary>
|
||||
public string WasteType { get; set; } = string.Empty;
|
||||
|
||||
public string WasteType { get; set; } = "";
|
||||
/// <summary>
|
||||
/// 重量,KG
|
||||
/// </summary>
|
||||
public string Weight { get; set; } = "0";
|
||||
|
||||
/// <summary>
|
||||
/// 内容
|
||||
/// </summary>
|
||||
public string Body { get; set; } = string.Empty;
|
||||
|
||||
public string Body { get; set; } = "";
|
||||
/// <summary>
|
||||
/// 字符串结果
|
||||
/// </summary>
|
||||
public string Str { get; set; } = string.Empty;
|
||||
|
||||
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>
|
||||
|
|
@ -444,94 +231,76 @@ namespace Waste.Application
|
|||
/// <summary>
|
||||
/// 固定头
|
||||
/// </summary>
|
||||
public string Key { get; set; } = string.Empty;
|
||||
|
||||
public string Key { get; set; } = "";
|
||||
/// <summary>
|
||||
/// 数据体长度
|
||||
/// </summary>
|
||||
public int Len { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// IMEI
|
||||
/// </summary>
|
||||
public string IMEI { get; set; } = string.Empty;
|
||||
|
||||
public string IMEI { get; set; } = "";
|
||||
/// <summary>
|
||||
/// ICCID
|
||||
/// </summary>
|
||||
public string ICCID { get; set; } = string.Empty;
|
||||
|
||||
public string ICCID { get; set; } = "";
|
||||
/// <summary>
|
||||
/// IMSI
|
||||
/// </summary>
|
||||
public string IMSI { get; set; } = string.Empty;
|
||||
|
||||
public string IMSI { get; set; } = "";
|
||||
/// <summary>
|
||||
/// 信号强度
|
||||
/// </summary>
|
||||
public string GSLQ { get; set; } = string.Empty;
|
||||
|
||||
public string GSLQ { get; set; } = "";
|
||||
/// <summary>
|
||||
/// 时间
|
||||
/// </summary>
|
||||
public string Time { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 经度
|
||||
/// </summary>
|
||||
public string Longitude { get; set; } = string.Empty;
|
||||
|
||||
public string Longitude { get; set; } = "";
|
||||
/// <summary>
|
||||
/// 纬度
|
||||
/// </summary>
|
||||
public string Latitude { get; set; } = string.Empty;
|
||||
|
||||
public string Latitude { get; set; } = "";
|
||||
/// <summary>
|
||||
/// 桶大小
|
||||
/// </summary>
|
||||
public string size { get; set; } = string.Empty;
|
||||
|
||||
public string size { get; set; } = "";
|
||||
/// <summary>
|
||||
/// 垃圾桶编号
|
||||
/// </summary>
|
||||
public string trashcode { get; set; } = string.Empty;
|
||||
|
||||
public string trashcode { get; set; } = "";
|
||||
/// <summary>
|
||||
/// 垃圾类别
|
||||
/// </summary>
|
||||
public string WasteType { get; set; } = string.Empty;
|
||||
|
||||
public string WasteType { get; set; } = "";
|
||||
/// <summary>
|
||||
/// 重量,KG
|
||||
/// </summary>
|
||||
public string Weight { get; set; } = "0";
|
||||
|
||||
/// <summary>
|
||||
/// 内容
|
||||
/// </summary>
|
||||
public string Body { get; set; } = string.Empty;
|
||||
|
||||
public string Body { get; set; } = "";
|
||||
/// <summary>
|
||||
/// 字符串结果
|
||||
/// </summary>
|
||||
public string Str { get; set; } = string.Empty;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// wifi模块上传的数据包体
|
||||
/// </summary>
|
||||
|
|
@ -541,27 +310,22 @@ namespace Waste.Application
|
|||
/// 设备机器码
|
||||
/// </summary>
|
||||
public string sn { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 桶大小
|
||||
/// </summary>
|
||||
public string size { get; set; } = string.Empty;
|
||||
|
||||
public string size { get; set; } = "";
|
||||
/// <summary>
|
||||
/// 垃圾桶编号
|
||||
/// </summary>
|
||||
public string trashcode { get; set; } = string.Empty;
|
||||
|
||||
public string trashcode { get; set; } = "";
|
||||
/// <summary>
|
||||
/// 垃圾类别
|
||||
/// </summary>
|
||||
public string WasteType { get; set; } = string.Empty;
|
||||
|
||||
public string WasteType { get; set; } = "";
|
||||
/// <summary>
|
||||
/// 重量,KG
|
||||
/// </summary>
|
||||
public string Weight { get; set; } = "0";
|
||||
|
||||
/// <summary>
|
||||
/// 是否为心跳包
|
||||
/// </summary>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
using Nirvana.Common;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Waste.Application.SubscribeInfo;
|
||||
|
||||
namespace Waste.Application
|
||||
{
|
||||
|
|
@ -15,14 +18,12 @@ namespace Waste.Application
|
|||
/// <param name="param"></param>
|
||||
/// <returns></returns>
|
||||
Task<PageParms<ResultList>> GetListAsync(QueryParams param);
|
||||
|
||||
/// <summary>
|
||||
/// 添加记录
|
||||
/// </summary>
|
||||
/// <param name="myPackage"></param>
|
||||
/// <returns></returns>
|
||||
Task<ResultInfo> InsertResultAsync(MyPackage myPackage);
|
||||
|
||||
/// <summary>
|
||||
/// 新的4G模块测量结果增加
|
||||
/// </summary>
|
||||
|
|
@ -36,26 +37,11 @@ namespace Waste.Application
|
|||
/// <param name="myPackage"></param>
|
||||
/// <returns></returns>
|
||||
Task InsertResultByA84GAsync(A8MyPackage myPackage);
|
||||
|
||||
/// <summary>
|
||||
/// wifi模块测量结果增加
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <returns></returns>
|
||||
Task InsertResultByWifiAsync(WifiPackage data);
|
||||
|
||||
/// <summary>
|
||||
/// 查询历史投放记录
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
Task<PageParms<ResultListByEquS2CDto>> GetListByEquAsync(ResultListByEquC2SDto input);
|
||||
|
||||
/// <summary>
|
||||
/// 给第三方推送消息
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
Task SendMessageToThird(SendThirdMessageSubscribeS2SDto input);
|
||||
}
|
||||
}
|
||||
|
|
@ -12,12 +12,10 @@ namespace Waste.Application.ResultInfos
|
|||
public class ResultAppService : IDynamicApiController
|
||||
{
|
||||
private readonly IResultService _resultService;
|
||||
|
||||
public ResultAppService(IResultService resultService)
|
||||
{
|
||||
_resultService = resultService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 投放记录列表
|
||||
/// </summary>
|
||||
|
|
@ -28,7 +26,6 @@ namespace Waste.Application.ResultInfos
|
|||
{
|
||||
return await _resultService.GetListAsync(param);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加记录
|
||||
/// </summary>
|
||||
|
|
@ -49,17 +46,10 @@ namespace Waste.Application.ResultInfos
|
|||
await _resultService.InsertResultByWifiAsync(data);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询历史投放记录
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Route("api/open/getresultlist")]
|
||||
[ApiDescriptionSettings("DevApi")]
|
||||
public async Task<PageParms<ResultListByEquS2CDto>> GetListByEquAsync(ResultListByEquC2SDto input)
|
||||
public async Task<string> RecvResult(SendMessageToThirdS2CDto data)
|
||||
{
|
||||
return await _resultService.GetListByEquAsync(input);
|
||||
var getdata = data;
|
||||
return await Task.FromResult("success");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,13 +1,15 @@
|
|||
using DotNetCore.CAP;
|
||||
using Furion;
|
||||
using Furion.DependencyInjection;
|
||||
using Furion.DistributedIDGenerator;
|
||||
using Furion.RemoteRequest.Extensions;
|
||||
using Furion.TaskScheduler;
|
||||
using Mapster;
|
||||
using Nirvana.Common;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Linq.Expressions;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Waste.Application.SubscribeInfo;
|
||||
|
|
@ -32,13 +34,11 @@ namespace Waste.Application
|
|||
_loggerService = loggerService;
|
||||
_capBus = capPublisher;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取投放记录
|
||||
/// </summary>
|
||||
/// <param name="param"></param>
|
||||
/// <returns></returns>
|
||||
[WasteAuthorize]
|
||||
public async Task<PageParms<ResultList>> GetListAsync(QueryParams param)
|
||||
{
|
||||
RefAsync<int> totalnum = 0;
|
||||
|
|
@ -59,18 +59,6 @@ namespace Waste.Application
|
|||
{
|
||||
temquery = temquery.Where(t => SqlFunc.Subqueryable<W_Device>().Where(e => e.Name.Contains(val) && t.DeviceId == e.Id).Any());
|
||||
}
|
||||
else if (x.Name.Equals("poststatus", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
var status = val.ToInt();
|
||||
if (status >= 0)
|
||||
{
|
||||
temquery = temquery.Where(t => SqlFunc.Subqueryable<W_ResultExt>().Where(e => e.Status == status && t.Id == e.ResultId).Any());
|
||||
}
|
||||
else
|
||||
{
|
||||
temquery = temquery.Where(t => SqlFunc.Subqueryable<W_ResultExt>().Where(e => t.Id == e.ResultId).NotAny());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
conModels.Add(new ConditionalModel()
|
||||
|
|
@ -139,30 +127,12 @@ namespace Waste.Application
|
|||
{
|
||||
it.PostStatus = res.Status;
|
||||
}
|
||||
var allext = cache.Get(list =>
|
||||
{
|
||||
var allext = cache.Get(list => {
|
||||
var ids = list.Select(e => e.Id).ToList();
|
||||
return dbClient.Queryable<W_MeasureResult>().Where(e => ids.Contains(e.ResultId)).ToList();
|
||||
});
|
||||
var ext = allext.FirstOrDefault(e => e.ResultId == it.Id);
|
||||
it.WasteType = /*ext != null && !ext.WasteSType.IsEmpty() ? $"{ext.WasteSType}【{it.WasteType}】" :*/ it.WasteType;
|
||||
it.Measure_WasteSType = ext?.WasteSType;
|
||||
it.Measure_Price = ext?.Price;
|
||||
it.Measure_Amount = ext?.Amount;
|
||||
it.Measure_OpUser = ext?.OpUser;
|
||||
it.Measure_UUID = ext?.UUID;
|
||||
if (string.IsNullOrWhiteSpace(it.Registration))
|
||||
{
|
||||
it.Registration = ext?.Registration;
|
||||
}
|
||||
it.ID1 = ext?.ID1;
|
||||
it.ID2 = ext?.ID2;
|
||||
it.ID3 = ext?.ID3;
|
||||
it.ID4 = ext?.ID4;
|
||||
it.ID5 = ext?.ID5;
|
||||
it.ID6 = ext?.ID6;
|
||||
it.ID7 = ext?.ID7;
|
||||
it.ID8 = ext?.ID8;
|
||||
it.WasteType = ext != null && !ext.WasteSType.IsEmpty() ? $"{ext.WasteSType}【{it.WasteType}】" : it.WasteType;
|
||||
})
|
||||
.ToPageListAsync(param.offset, param.limit, totalnum);
|
||||
return new PageParms<ResultList>
|
||||
|
|
@ -173,51 +143,6 @@ namespace Waste.Application
|
|||
limit = param.limit
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询历史投放记录
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<PageParms<ResultListByEquS2CDto>> GetListByEquAsync(ResultListByEquC2SDto input)
|
||||
{
|
||||
RefAsync<int> totalnum = 0;
|
||||
Expression<Func<W_Result, bool>> exp = Expressionable.Create<W_Result>().AndIF(input.StartTime.HasValue, x => x.CreateTime >= input.StartTime).AndIF(input.EndTime.HasValue, x => x.CreateTime <= input.EndTime).And(x => x.DeviceId == input.DeviceId).ToExpression();
|
||||
var query = await dbClient.Queryable<W_Result>()
|
||||
.Where(exp)
|
||||
.OrderBy(x => x.CreateTime, OrderByType.Desc)
|
||||
.Select(x => new ResultListByEquS2SDto
|
||||
{
|
||||
CreateTime = x.CreateTime,
|
||||
Id = x.Id,
|
||||
TrashCode = x.Registration,
|
||||
WasteType = x.WasteType,
|
||||
GrossWeight = x.GrossWeight
|
||||
})
|
||||
.Mapper((it, cache) =>
|
||||
{
|
||||
var allext = cache.Get(list =>
|
||||
{
|
||||
var ids = list.Select(x => x.Id).ToList();
|
||||
return dbClient.Queryable<W_MeasureResult>().Where(e => ids.Contains(e.ResultId)).ToList();
|
||||
});
|
||||
var ext = allext.FirstOrDefault(x => x.ResultId == it.Id);
|
||||
if (ext != null)
|
||||
{
|
||||
it.WasteSType = ext.WasteSType;
|
||||
}
|
||||
})
|
||||
.ToPageListAsync(input.offset, input.limit, totalnum);
|
||||
var list = query.Adapt<List<ResultListByEquS2CDto>>();
|
||||
return new PageParms<ResultListByEquS2CDto>
|
||||
{
|
||||
page = input.offset,
|
||||
Items = list,
|
||||
totalnum = totalnum,
|
||||
limit = input.limit
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// wifi模块测量结果增加
|
||||
/// </summary>
|
||||
|
|
@ -281,13 +206,7 @@ namespace Waste.Application
|
|||
Time = time,
|
||||
TrashCode = data.trashcode,
|
||||
WasteType = data.WasteType,
|
||||
Weight = currentweight,
|
||||
faccode = device.FacEcode,
|
||||
ecode = device.Ecode,
|
||||
province = device.Province,
|
||||
city = device.City,
|
||||
area = device.Area,
|
||||
address = device.Address
|
||||
Weight = currentweight
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -362,17 +281,10 @@ namespace Waste.Application
|
|||
Time = time,
|
||||
TrashCode = myPackage.trashcode,
|
||||
WasteType = myPackage.WasteType,
|
||||
Weight = Weight,
|
||||
faccode = device.FacEcode,
|
||||
ecode = device.Ecode,
|
||||
province = device.Province,
|
||||
city = device.City,
|
||||
area = device.Area,
|
||||
address = device.Address
|
||||
Weight = Weight
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 新的A8 4G模块测量结果增加
|
||||
/// </summary>
|
||||
|
|
@ -381,11 +293,11 @@ namespace Waste.Application
|
|||
public async Task InsertResultByA84GAsync(A8MyPackage myPackage)
|
||||
{
|
||||
//如果uuid不为空,并且以存在记录,则忽略
|
||||
//if (!myPackage.IsHeart && !myPackage.UUID.IsEmpty() && await dbClient.Queryable<W_MeasureResult>().AnyAsync(x => x.UUID == myPackage.UUID))
|
||||
//{
|
||||
// _loggerService.AddLogger($"A8记录重复,内容:{myPackage.ToJson()}", 1);
|
||||
// return;
|
||||
//}
|
||||
if (!myPackage.IsHeart && !myPackage.UUID.IsEmpty() && await dbClient.Queryable<W_MeasureResult>().AnyAsync(x => x.UUID == myPackage.UUID))
|
||||
{
|
||||
_loggerService.AddLogger($"A8记录重复,内容:{myPackage.ToJson()}", 1);
|
||||
return;
|
||||
}
|
||||
//查找设备
|
||||
var device = await dbClient.Queryable<W_Device>().FirstAsync(x => myPackage.IMEI == x.Ecode);
|
||||
// _loggerService.AddLogger($"接收到的数据,参数:{myPackage.ToJson()}", 3);
|
||||
|
|
@ -456,25 +368,7 @@ namespace Waste.Application
|
|||
Amount = amount,
|
||||
OpUser = myPackage.OpUser.ToStr(),
|
||||
Price = price,
|
||||
UUID = myPackage.UUID,
|
||||
|
||||
DeviceFacEcode = myPackage.DeviceFacEcode,
|
||||
Registration = myPackage.Registration,
|
||||
GrossWeight = myPackage.GrossWeight,
|
||||
Tare = myPackage.Tare,
|
||||
NetWeight = myPackage.NetWeight,
|
||||
|
||||
ID1 = myPackage.ID1,
|
||||
ID2 = myPackage.ID2,
|
||||
ID3 = myPackage.ID3,
|
||||
ID4 = myPackage.ID4,
|
||||
ID5 = myPackage.ID5,
|
||||
ID6 = myPackage.ID6,
|
||||
ID7 = myPackage.ID7,
|
||||
ID8 = myPackage.ID8,
|
||||
|
||||
CreatedTime = DateTime.Now,
|
||||
DataHash = myPackage.DataHash
|
||||
UUID = myPackage.UUID
|
||||
}).ExecuteCommandAsync();
|
||||
}
|
||||
await SendMessageToThird(new SendThirdMessageSubscribeS2SDto
|
||||
|
|
@ -484,23 +378,16 @@ namespace Waste.Application
|
|||
TrashCode = myPackage.trashcode,
|
||||
WasteType = myPackage.WasteType,
|
||||
Weight = Weight,
|
||||
WasteSType = wastestype,
|
||||
faccode = device.FacEcode,
|
||||
ecode = device.Ecode,
|
||||
province = device.Province,
|
||||
city = device.City,
|
||||
area = device.Area,
|
||||
address = device.Address
|
||||
WasteSType = wastestype
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 给第三方推送消息
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
public async Task SendMessageToThird(SendThirdMessageSubscribeS2SDto input)
|
||||
private async Task SendMessageToThird(SendThirdMessageSubscribeS2SDto input)
|
||||
{
|
||||
if (input.Weight <= 0)
|
||||
{
|
||||
|
|
@ -519,7 +406,6 @@ namespace Waste.Application
|
|||
await _capBus.PublishAsync("third.service.sendmessage", senddata);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 增加测量记录
|
||||
/// </summary>
|
||||
|
|
@ -578,6 +464,7 @@ namespace Waste.Application
|
|||
}
|
||||
//000F000002.16进制
|
||||
// var areaHex = Convert.ToHexString(areaBytes);
|
||||
|
||||
}
|
||||
decimal weight = myPackage.Weight.IsEmpty() ? 0 : myPackage.Weight.ToDecimal();
|
||||
//记录数据
|
||||
|
|
@ -631,13 +518,7 @@ namespace Waste.Application
|
|||
Time = time,
|
||||
TrashCode = myPackage.Area,
|
||||
WasteType = myPackage.WasteType,
|
||||
Weight = weight,
|
||||
faccode = device.FacEcode,
|
||||
ecode = device.Ecode,
|
||||
province = device.Province,
|
||||
city = device.City,
|
||||
area = device.Area,
|
||||
address = device.Address
|
||||
Weight = weight
|
||||
});
|
||||
}
|
||||
return new ResultInfo(ResultState.SUCCESS, "success");
|
||||
|
|
@ -652,7 +533,6 @@ namespace Waste.Application
|
|||
{
|
||||
return Convert.ToInt32(((int)bt).ToString("X2"), 16);
|
||||
}
|
||||
|
||||
private static int GetTimestamp(DateTime time)
|
||||
{
|
||||
DateTime dateTimeStart = TimeZoneInfo.ConvertTimeToUtc(new DateTime(1970, 1, 1, 8, 0, 0));
|
||||
|
|
|
|||
|
|
@ -1,4 +1,8 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Waste.Application.SubscribeInfo
|
||||
{
|
||||
|
|
@ -11,73 +15,59 @@ namespace Waste.Application.SubscribeInfo
|
|||
/// 设备ID
|
||||
/// </summary>
|
||||
public Guid DeviceId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 最近使用时间
|
||||
/// </summary>
|
||||
public DateTime? LastHeartTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 记录ID
|
||||
/// </summary>
|
||||
public Guid ResultId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 设备服务商ID
|
||||
/// </summary>
|
||||
public Guid BusinessId { 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 decimal latitude { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 经度
|
||||
/// </summary>
|
||||
public decimal longtitude { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 信号强度
|
||||
/// </summary>
|
||||
public int gslq { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 垃圾类型
|
||||
/// </summary>
|
||||
public string wastetype { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 垃圾桶编号
|
||||
/// </summary>
|
||||
public string trash { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 毛重
|
||||
/// </summary>
|
||||
public string weight { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 皮重
|
||||
/// </summary>
|
||||
public decimal Tare { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设备版本信息
|
||||
/// </summary>
|
||||
|
|
@ -87,13 +77,11 @@ namespace Waste.Application.SubscribeInfo
|
|||
/// 设备机器码
|
||||
/// </summary>
|
||||
public string ecode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 版本号
|
||||
/// </summary>
|
||||
public string ver { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 发送第三方消息
|
||||
/// </summary>
|
||||
|
|
@ -108,56 +96,22 @@ namespace Waste.Application.SubscribeInfo
|
|||
/// 垃圾类别
|
||||
/// </summary>
|
||||
public string WasteType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 物品小类别
|
||||
/// </summary>
|
||||
public string WasteSType { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// 重量,单位KG
|
||||
/// </summary>
|
||||
public decimal Weight { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 垃圾桶编号
|
||||
/// </summary>s
|
||||
public string TrashCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 上报时间
|
||||
/// </summary>
|
||||
public DateTime Time { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 设备机器码
|
||||
/// </summary>
|
||||
public string ecode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 设备编号
|
||||
/// </summary>
|
||||
public string faccode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 设备所属省份
|
||||
/// </summary>
|
||||
public string province { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 设备所属城市
|
||||
/// </summary>
|
||||
public string city { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 设备所属区/县
|
||||
/// </summary>
|
||||
public string area { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 设备详细地址
|
||||
/// </summary>
|
||||
public string address { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -170,7 +124,6 @@ namespace Waste.Application.SubscribeInfo
|
|||
/// </summary>
|
||||
public string Url { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 推送给第三方的信息
|
||||
/// </summary>
|
||||
|
|
@ -190,17 +143,14 @@ namespace Waste.Application.SubscribeInfo
|
|||
/// 重量,单位KG
|
||||
/// </summary>
|
||||
public string Weight { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 垃圾桶编号
|
||||
/// </summary>
|
||||
public string TrashCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 上报时间
|
||||
/// </summary>
|
||||
public long Time { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 额外信息
|
||||
/// </summary>
|
||||
|
|
@ -210,40 +160,5 @@ namespace Waste.Application.SubscribeInfo
|
|||
/// 设备ID
|
||||
/// </summary>
|
||||
public Guid DeviceId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 设备机器码
|
||||
/// </summary>
|
||||
public string ecode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 设备编号
|
||||
/// </summary>
|
||||
public string faccode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 设备所属省份
|
||||
/// </summary>
|
||||
public string province { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 设备所属城市
|
||||
/// </summary>
|
||||
public string city { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 设备所属区/县
|
||||
/// </summary>
|
||||
public string area { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 设备详细地址
|
||||
/// </summary>
|
||||
public string address { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 最近心跳时间
|
||||
/// </summary>
|
||||
public long BeatTime { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -1,13 +1,15 @@
|
|||
using DotNetCore.CAP;
|
||||
using Furion.DependencyInjection;
|
||||
using Furion.DistributedIDGenerator;
|
||||
using Furion.Logging.Extensions;
|
||||
using Furion.RemoteRequest.Extensions;
|
||||
using Mapster;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Newtonsoft.Json;
|
||||
using Nirvana.Common;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Waste.Application.ThirdApiInfo;
|
||||
|
|
@ -24,7 +26,6 @@ namespace Waste.Application.SubscribeInfo
|
|||
private readonly SqlSugarClient dbClient;
|
||||
private readonly IResultService _resultService;
|
||||
private readonly ILoggerService _loggerService;
|
||||
|
||||
public SubscribeService(ISqlSugarRepository<W_Device> sqlSugarRepository, IResultService resultService, ILoggerService loggerService)
|
||||
{
|
||||
repository = sqlSugarRepository;
|
||||
|
|
@ -32,7 +33,6 @@ namespace Waste.Application.SubscribeInfo
|
|||
_resultService = resultService;
|
||||
_loggerService = loggerService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加记录
|
||||
/// </summary>
|
||||
|
|
@ -68,6 +68,7 @@ namespace Waste.Application.SubscribeInfo
|
|||
});
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 更新记录上报结果
|
||||
/// </summary>
|
||||
|
|
@ -154,6 +155,7 @@ namespace Waste.Application.SubscribeInfo
|
|||
};
|
||||
await dbClient.Insertable(insertdata).ExecuteCommandAsync();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -243,6 +245,7 @@ namespace Waste.Application.SubscribeInfo
|
|||
await _resultService.InsertResultBy4GAsync(myPackage);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 测试,4G模块传输的数据增加测量记录
|
||||
/// </summary>
|
||||
|
|
@ -254,7 +257,6 @@ namespace Waste.Application.SubscribeInfo
|
|||
var msg = JsonConvert.SerializeObject(myPackage);
|
||||
_loggerService.AddLogger(msg, 1);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 第三方推送设备消息
|
||||
/// </summary>
|
||||
|
|
@ -265,11 +267,6 @@ namespace Waste.Application.SubscribeInfo
|
|||
{
|
||||
string errmsg = string.Empty;
|
||||
var senddata = data.Adapt<SendMessageToThirdS2CDto>();
|
||||
var devicedata = await dbClient.Queryable<W_DeviceData>().Where(x => x.DeviceId == data.DeviceId).Select(x => new W_DeviceData
|
||||
{
|
||||
LastBeatTime = x.LastBeatTime
|
||||
}).FirstAsync();
|
||||
senddata.BeatTime = devicedata == null ? 0 : devicedata.LastBeatTime.GetTimeStamp();
|
||||
var response = await data.Url
|
||||
.SetBody(senddata, "application/json", Encoding.UTF8)
|
||||
.OnException((res, errors) =>
|
||||
|
|
@ -291,7 +288,6 @@ namespace Waste.Application.SubscribeInfo
|
|||
}
|
||||
_loggerService.AddLogger($"第三方设备消息发送成功,内容:{data.ToJson()},返回:{returnstr}", 3);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A8 4G模块传输的数据增加测量记录
|
||||
/// </summary>
|
||||
|
|
@ -301,22 +297,7 @@ namespace Waste.Application.SubscribeInfo
|
|||
public async void InsertA84GResultAsync(A8MyPackage myPackage)
|
||||
{
|
||||
//_loggerService.AddLogger($"A8记录,内容:{myPackage.ToJson()}", 1);
|
||||
//await _resultService.InsertResultByA84GAsync(myPackage);
|
||||
|
||||
await Scoped.Create(async (_, scope) =>
|
||||
{
|
||||
var services = scope.ServiceProvider;
|
||||
var mresultrep = services.GetService<ISqlSugarRepository<W_MeasureResult>>();
|
||||
//如果uuid不为空,并且以存在记录,则忽略
|
||||
if (!myPackage.IsHeart && !myPackage.UUID.IsEmpty() && await mresultrep
|
||||
.Where(x => x.CreatedTime > DateTime.Now.AddMinutes(-1) && x.DataHash == myPackage.DataHash)//1分钟内不能重复
|
||||
.AnyAsync())
|
||||
{
|
||||
return;
|
||||
}
|
||||
var _resultService = services.GetService<IResultService>();
|
||||
await _resultService.InsertResultByA84GAsync(myPackage);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -25,14 +25,12 @@ namespace Waste.Application
|
|||
private readonly IHttpClientFactory _clientFactory;
|
||||
private readonly ILoggerService _loggerService;
|
||||
private readonly ISubscribeService _subscribeService;
|
||||
|
||||
public TestAppService(ILoggerService loggerService, IHttpClientFactory clientFactory, ISubscribeService subscribeService)
|
||||
{
|
||||
_loggerService = loggerService;
|
||||
_clientFactory = clientFactory;
|
||||
_subscribeService = subscribeService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 接收测试
|
||||
/// </summary>
|
||||
|
|
@ -50,8 +48,8 @@ namespace Waste.Application
|
|||
[HttpGet]
|
||||
public void ConnectServer()
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
|
|
@ -59,15 +57,14 @@ namespace Waste.Application
|
|||
[HttpGet]
|
||||
public async Task TestThirdSendAsync()
|
||||
{
|
||||
await _subscribeService.SeedThirdMessageAsync(new SendThirdMessageSubscriDto
|
||||
{
|
||||
Url = "https://localhost:44335/api/test/recv",
|
||||
WasteType = "\u0000\u0000\u0000\u0000纸壳",
|
||||
Weight = "20.9",
|
||||
TrashCode = "0",
|
||||
Time = 1653033312,
|
||||
Body = "",
|
||||
DeviceId = Guid.Parse("39fcdce8-9e54-b87f-fc8e-616a9072c224")
|
||||
await _subscribeService.SeedThirdMessageAsync(new SendThirdMessageSubscriDto {
|
||||
Url= "https://localhost:44335/api/test/recv",
|
||||
WasteType= "\u0000\u0000\u0000\u0000纸壳",
|
||||
Weight="20.9",
|
||||
TrashCode="0",
|
||||
Time= 1653033312,
|
||||
Body="",
|
||||
DeviceId= Guid.Parse("39fcdce8-9e54-b87f-fc8e-616a9072c224")
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -80,18 +77,17 @@ namespace Waste.Application
|
|||
[HttpGet]
|
||||
public async Task TestSendAsync()
|
||||
{
|
||||
GarbagePltC2SDto garbageC2SDto = new GarbagePltC2SDto
|
||||
{
|
||||
Weight = 10.1,
|
||||
GarbagePltC2SDto garbageC2SDto = new GarbagePltC2SDto {
|
||||
Weight=10.1,
|
||||
secret = "6Vxkfkg3kxqkkzgT",
|
||||
secrethash = "51fb893bccc1395e",
|
||||
ScanningTime = 1627917492,
|
||||
DStatus = 0,
|
||||
ScanningTime= 1627917492,
|
||||
DStatus=0,
|
||||
deviceid = "08d954b6-df45-4de1-8fde-f5109798b855",
|
||||
Trash = "000F000002",
|
||||
Type = 4
|
||||
};
|
||||
if (garbageC2SDto.Weight == ((int)garbageC2SDto.Weight).ToDouble())
|
||||
if(garbageC2SDto.Weight == ((int)garbageC2SDto.Weight).ToDouble())
|
||||
{
|
||||
garbageC2SDto.Weight = garbageC2SDto.Weight.ToDouble(0);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,120 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Waste.Application.ThirdApiInfo
|
||||
{
|
||||
public class ProductInfoDto
|
||||
{
|
||||
public decimal amount { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string date { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string dateTime { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public long id { get; set; }
|
||||
/// <summary>
|
||||
/// 规格,参数名称,
|
||||
/// </summary>
|
||||
public string idNames { get; set; }
|
||||
/// <summary>
|
||||
/// 545677,参数值,
|
||||
/// </summary>
|
||||
public string idValues { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public bool isUpload { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public int level { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public decimal lowerLimit { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public decimal netWeight { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public long productId { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string productName { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string productNo { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public long recordNo { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public long startDate { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public int status { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public decimal tareWeight { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string time { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public long timeStamp { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string unit { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public decimal upperLimit { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public long userId { get; set; }
|
||||
/// <summary>
|
||||
/// 技术员
|
||||
/// </summary>
|
||||
public string userName { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string uuid { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public decimal weight { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string image { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 新增:操作权限控制(必须传 true/false,其他值或未传会报错)
|
||||
/// </summary>
|
||||
public bool uploadPermission { get; set; } // 直接 bool,不可空
|
||||
|
||||
public string Video { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -15,38 +15,31 @@ namespace Waste.Application.ThirdApiInfo
|
|||
/// 机器码
|
||||
/// </summary>
|
||||
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 decimal Latitude { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// 经度
|
||||
/// </summary>
|
||||
public decimal Longitude { get; set; } = 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 注册注册信息返回值
|
||||
/// </summary>
|
||||
|
|
@ -56,17 +49,14 @@ namespace Waste.Application.ThirdApiInfo
|
|||
/// 设备状态,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/ttyS3";
|
||||
|
||||
/// <summary>
|
||||
/// websocket地址
|
||||
/// </summary>
|
||||
|
|
@ -76,33 +66,27 @@ namespace Waste.Application.ThirdApiInfo
|
|||
/// 时间戳
|
||||
/// </summary>
|
||||
public int timestamp { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 随机数
|
||||
/// </summary>
|
||||
public int noncestr { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 用户ID
|
||||
/// </summary>
|
||||
public string UserId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// secret
|
||||
/// </summary>
|
||||
public string Secret { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// secrethash
|
||||
/// </summary>
|
||||
public string SecretHash { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 设备ID
|
||||
/// </summary>
|
||||
public string DeviceId { get; set; } = "";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新上报结果
|
||||
/// </summary>
|
||||
|
|
@ -117,7 +101,6 @@ namespace Waste.Application.ThirdApiInfo
|
|||
/// 机器码
|
||||
/// </summary>
|
||||
public string ECode { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// 上报状态,1-成功,0-失败
|
||||
/// </summary>
|
||||
|
|
@ -127,19 +110,17 @@ namespace Waste.Application.ThirdApiInfo
|
|||
/// <summary>
|
||||
/// 获取设备信息请求数据,并上报数据
|
||||
/// </summary>
|
||||
public class GetDevInfoRequestDto : DevHeartRequestDto
|
||||
public class GetDevInfoRequestDto: DevHeartRequestDto
|
||||
{
|
||||
/// <summary>
|
||||
/// 记录ID
|
||||
/// </summary>
|
||||
public string ResultId { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// 串口数据
|
||||
/// </summary>
|
||||
public string data { get; set; } = "";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取设备信息响应数据
|
||||
/// </summary>
|
||||
|
|
@ -149,52 +130,42 @@ namespace Waste.Application.ThirdApiInfo
|
|||
/// 解析数据是否正常
|
||||
/// </summary>
|
||||
public bool IsSuccessed { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// 时间戳
|
||||
/// </summary>
|
||||
public int timestamp { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 随机数
|
||||
/// </summary>
|
||||
public int noncestr { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 用户ID
|
||||
/// </summary>
|
||||
public string UserId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// secret
|
||||
/// </summary>
|
||||
public string Secret { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// secrethash
|
||||
/// </summary>
|
||||
public string SecretHash { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 设备ID
|
||||
/// </summary>
|
||||
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>
|
||||
|
|
@ -209,18 +180,15 @@ namespace Waste.Application.ThirdApiInfo
|
|||
/// 数据扫描时间,UNIX时间戳
|
||||
/// </summary>
|
||||
public int ScanningTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 签名
|
||||
/// </summary>
|
||||
public string sign { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 记录ID
|
||||
/// </summary>
|
||||
public Guid ResultId { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 日志上报
|
||||
/// </summary>
|
||||
|
|
@ -230,18 +198,15 @@ namespace Waste.Application.ThirdApiInfo
|
|||
/// 机器码
|
||||
/// </summary>
|
||||
public string ecode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 位置
|
||||
/// </summary>
|
||||
public string ExceptionPos { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 错误信息
|
||||
/// </summary>
|
||||
public string ExceptionInfo { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// wifi模块发送的数据
|
||||
/// </summary>
|
||||
|
|
@ -252,7 +217,6 @@ namespace Waste.Application.ThirdApiInfo
|
|||
/// </summary>
|
||||
public string @params { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// wifi模块发送的数据解析
|
||||
/// </summary>
|
||||
|
|
@ -272,7 +236,6 @@ namespace Waste.Application.ThirdApiInfo
|
|||
/// 分隔符,固定为00
|
||||
/// </summary>
|
||||
public string splitstr { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// 解密出的16进制数据
|
||||
/// </summary>
|
||||
|
|
@ -282,18 +245,15 @@ namespace Waste.Application.ThirdApiInfo
|
|||
/// 数据是否验证通过
|
||||
/// </summary>
|
||||
public bool ischecked { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// 是否为心跳包
|
||||
/// </summary>
|
||||
public bool IsHeart { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// 结果集
|
||||
/// </summary>
|
||||
public byte[] databyte { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 消息发送
|
||||
/// </summary>
|
||||
|
|
@ -303,78 +263,21 @@ namespace Waste.Application.ThirdApiInfo
|
|||
/// 设备ID
|
||||
/// </summary>
|
||||
public Guid DeviceId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 垃圾类别
|
||||
/// </summary>
|
||||
public string WasteType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 重量,单位KG
|
||||
/// </summary>
|
||||
public string Weight { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 垃圾桶编号
|
||||
/// </summary>
|
||||
public string TrashCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 上报时间
|
||||
/// </summary>
|
||||
public DateTime Time { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// app端返回的信息
|
||||
/// </summary>
|
||||
public class AppS2CDto<T>
|
||||
{
|
||||
/// <summary>
|
||||
/// 信息
|
||||
/// </summary>
|
||||
public T status { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// app端返回的通用信息
|
||||
/// </summary>
|
||||
public class AppCommonS2CDto
|
||||
{
|
||||
/// <summary>
|
||||
/// 错误代码
|
||||
/// </summary>
|
||||
public int code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 名称
|
||||
/// </summary>
|
||||
public string name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 错误信息
|
||||
/// </summary>
|
||||
public string message { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// app端版本信息返回值
|
||||
/// </summary>
|
||||
public class AppVerS2CDto
|
||||
{
|
||||
/// <summary>
|
||||
/// 版本号
|
||||
/// </summary>
|
||||
public int code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 版本说明
|
||||
/// </summary>
|
||||
public string name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 下载地址
|
||||
/// </summary>
|
||||
public string update_url { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -5,8 +5,6 @@ using System.Linq;
|
|||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Waste.Application.SubscribeInfo;
|
||||
using Waste.Domain;
|
||||
using Waste.Domain.DataModel;
|
||||
|
||||
namespace Waste.Application.ThirdApiInfo
|
||||
{
|
||||
|
|
@ -52,14 +50,5 @@ namespace Waste.Application.ThirdApiInfo
|
|||
/// <param name="data"></param>
|
||||
/// <returns></returns>
|
||||
Task<object> WifiPostAsync(WifiRequestC2SDto data);
|
||||
/// <summary>
|
||||
/// 新增电子秤
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <returns></returns>
|
||||
Task<ResultInfo> AddProductAsync(ProductInfoDto data);
|
||||
Task<PageParms<W_Product>> GetProductAsync(QueryParams param);
|
||||
|
||||
Task<ResultInfo> DeleteProductAsync(string id);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,21 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Waste.Application.ThirdApiInfo.Message
|
||||
{
|
||||
/// <summary>
|
||||
/// 设备消息推送给第三方处理
|
||||
/// </summary>
|
||||
public interface IMessageService
|
||||
{
|
||||
/// <summary>
|
||||
/// 消息发送
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
Task SeedMessageAsync(SendMessageS2SDto input);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
using DotNetCore.CAP;
|
||||
using Furion.DependencyInjection;
|
||||
using Nirvana.Common;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Waste.Application.SubscribeInfo;
|
||||
using Waste.Domain;
|
||||
|
||||
namespace Waste.Application.ThirdApiInfo.Message
|
||||
{
|
||||
/// <summary>
|
||||
/// 设备消息推送给第三方处理
|
||||
/// </summary>
|
||||
public class MessageService : IMessageService, ITransient
|
||||
{
|
||||
private readonly ISqlSugarRepository<W_DeviceConfig> repository;
|
||||
private readonly ICapPublisher _capBus;
|
||||
private readonly SqlSugarClient dbClient;
|
||||
public MessageService(ISqlSugarRepository<W_DeviceConfig> sqlSugarRepository, ICapPublisher capBus)
|
||||
{
|
||||
repository = sqlSugarRepository;
|
||||
dbClient = repository.Context;
|
||||
_capBus = capBus;
|
||||
}
|
||||
/// <summary>
|
||||
/// 消息发送
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
public async Task SeedMessageAsync(SendMessageS2SDto input)
|
||||
{
|
||||
if (!await dbClient.Queryable<W_DeviceConfig>().AnyAsync(x => x.DeviceId == input.DeviceId))
|
||||
{
|
||||
return;
|
||||
}
|
||||
var config = await dbClient.Queryable<W_DeviceConfig>().Where(x => x.DeviceId == input.DeviceId).Select(x => new W_DeviceConfig
|
||||
{
|
||||
Body = x.Body,
|
||||
Url = x.Url
|
||||
}).FirstAsync();
|
||||
|
||||
var time = input.Time.GetTimeStamp();
|
||||
await _capBus.PublishAsync("third.service.sendmessage", new SendThirdMessageSubscriDto
|
||||
{
|
||||
WasteType = input.WasteType,
|
||||
Body = config.Body,
|
||||
Time = time,
|
||||
TrashCode = input.TrashCode,
|
||||
Url = config.Url,
|
||||
Weight = input.Weight
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -9,12 +9,10 @@ using Microsoft.Net.Http.Headers;
|
|||
using Nirvana.Common;
|
||||
using Nirvana.Common.File;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Waste.Application.SubscribeInfo;
|
||||
using Waste.Domain.DataModel;
|
||||
|
||||
namespace Waste.Application.ThirdApiInfo
|
||||
{
|
||||
|
|
@ -29,14 +27,12 @@ namespace Waste.Application.ThirdApiInfo
|
|||
private static IWebHostEnvironment _hostingEnvironment;
|
||||
private readonly IHttpContextAccessor _httpContextAccessor;
|
||||
private static readonly FormOptions _defaultFormOptions = new FormOptions();
|
||||
|
||||
public OpenAppService(IOpenService openService, IWebHostEnvironment webHostEnvironment, IHttpContextAccessor httpContextAccessor)
|
||||
{
|
||||
_openService = openService;
|
||||
_hostingEnvironment = webHostEnvironment;
|
||||
_httpContextAccessor = httpContextAccessor;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取设备上报相关信息
|
||||
/// </summary>
|
||||
|
|
@ -58,7 +54,6 @@ namespace Waste.Application.ThirdApiInfo
|
|||
{
|
||||
return await _openService.PostHeartAsync(data);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取设备注册信息,第一次开机使用
|
||||
/// </summary>
|
||||
|
|
@ -70,7 +65,6 @@ namespace Waste.Application.ThirdApiInfo
|
|||
{
|
||||
return await _openService.RegInfoAsync(ecode);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新上报状态
|
||||
/// </summary>
|
||||
|
|
@ -107,7 +101,7 @@ namespace Waste.Application.ThirdApiInfo
|
|||
var boundary = MultipartRequestHelper.GetBoundary(MediaTypeHeaderValue.Parse(Request.ContentType), _defaultFormOptions.MultipartBoundaryLengthLimit);
|
||||
var reader = new MultipartReader(boundary, Request.Body);
|
||||
var section = await reader.ReadNextSectionAsync();
|
||||
while (section != null)
|
||||
while (section != null && section.Body.Position != section.Body.Length)
|
||||
{
|
||||
var hasContentDispositionHeader =
|
||||
ContentDispositionHeaderValue.TryParse(
|
||||
|
|
@ -116,6 +110,7 @@ namespace Waste.Application.ThirdApiInfo
|
|||
{
|
||||
if (!MultipartRequestHelper.HasFileContentDisposition(contentDisposition))
|
||||
{
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -212,7 +207,6 @@ namespace Waste.Application.ThirdApiInfo
|
|||
}
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 正式升级
|
||||
/// </summary>
|
||||
|
|
@ -233,11 +227,6 @@ namespace Waste.Application.ThirdApiInfo
|
|||
string rootpath = _hostingEnvironment.WebRootPath;
|
||||
//读取文件,返回升级信息
|
||||
var path = $"{rootpath}/apks/upgrade/{type}.txt";
|
||||
var ulist = new List<string> { "419b553e92986112", "8f259824aef42c36", "fa324b8fa8da1fc0", "be6d6ef03519d42e", "352050657b2b2608", "d3fc9a38d7f67604" };
|
||||
if (ulist.Contains(ecode))
|
||||
{
|
||||
path = $"{rootpath}/apks/upgrade/OTHER.txt";
|
||||
}
|
||||
if (!File.Exists(path))
|
||||
{
|
||||
return new
|
||||
|
|
@ -318,45 +307,5 @@ namespace Waste.Application.ThirdApiInfo
|
|||
{
|
||||
return await _openService.WifiPostAsync(data);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 新增电子秤
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<ResultInfo> AddProductAsync(ProductInfoDto data)
|
||||
{
|
||||
// 1. 检查权限(false 直接返回无权限)
|
||||
if (!data.uploadPermission) // 等效于 data.uploadPermission == false
|
||||
{
|
||||
return new ResultInfo(ResultState.FAIL, "没有操作权限");
|
||||
}
|
||||
|
||||
return await _openService.AddProductAsync(data);
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public async Task<PageParms<W_Product>> GetProductAsync(QueryParams param)
|
||||
{
|
||||
return await _openService.GetProductAsync(param);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除产品数据(管理后台专用,无需权限校验)
|
||||
/// </summary>
|
||||
[HttpPost]
|
||||
[Route("api/open/deleteproduct")]
|
||||
public async Task<ResultInfo> DeleteProduct(string id)
|
||||
{
|
||||
// 1. 检查ID是否为空
|
||||
if (string.IsNullOrEmpty(id))
|
||||
{
|
||||
return new ResultInfo(ResultState.FAIL, "ID不能为空");
|
||||
}
|
||||
|
||||
// 2. 调用删除服务
|
||||
return await _openService.DeleteProductAsync(id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -10,12 +10,8 @@ using System.Collections.Generic;
|
|||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Furion.LinqBuilder;
|
||||
using Waste.Application.SubscribeInfo;
|
||||
using Waste.Domain;
|
||||
using Waste.Domain.DataModel;
|
||||
using System.Net.Http;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
namespace Waste.Application.ThirdApiInfo
|
||||
{
|
||||
|
|
@ -37,9 +33,8 @@ namespace Waste.Application.ThirdApiInfo
|
|||
private readonly ICapPublisher _capBus;
|
||||
private readonly IDistributedCache _cahce;
|
||||
private readonly IResultService _resultService;
|
||||
private readonly IDistributedIDGenerator _idgen;
|
||||
|
||||
public OpenService(ISqlSugarRepository<W_Device> sqlSugarRepository, ISuZhouService suZhouService, ILoggerService loggerService, ICapPublisher capPublisher, IDistributedCache distributedCache, IResultService resultService, IDistributedIDGenerator distributedIDGenerator)
|
||||
public OpenService(ISqlSugarRepository<W_Device> sqlSugarRepository, ISuZhouService suZhouService, ILoggerService loggerService, ICapPublisher capPublisher, IDistributedCache distributedCache, IResultService resultService)
|
||||
{
|
||||
repository = sqlSugarRepository;
|
||||
dbClient = repository.Context;
|
||||
|
|
@ -48,9 +43,7 @@ namespace Waste.Application.ThirdApiInfo
|
|||
_capBus = capPublisher;
|
||||
_cahce = distributedCache;
|
||||
_resultService = resultService;
|
||||
_idgen = distributedIDGenerator;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新上报状态
|
||||
/// </summary>
|
||||
|
|
@ -58,34 +51,9 @@ namespace Waste.Application.ThirdApiInfo
|
|||
/// <returns></returns>
|
||||
public async Task<ResultInfo> UpdateStatusAsync(UpdateStatusDto data)
|
||||
{
|
||||
//await _capBus.PublishAsync("result.service.update", data);
|
||||
//return new ResultInfo(ResultState.SUCCESS, "success");
|
||||
Guid resultid = Guid.Empty;
|
||||
if (!string.IsNullOrEmpty(data.ResultId) && Guid.TryParse(data.ResultId, out resultid))
|
||||
{
|
||||
if (await dbClient.Queryable<W_ResultExt>().AnyAsync(x => x.ResultId == resultid))
|
||||
{
|
||||
await dbClient.Updateable<W_ResultExt>().SetColumns(x => new W_ResultExt
|
||||
{
|
||||
Status = data.status
|
||||
}).Where(x => x.ResultId == resultid).ExecuteCommandAsync();
|
||||
}
|
||||
else
|
||||
{
|
||||
var insertdata = new W_ResultExt
|
||||
{
|
||||
Id = _idgen.Create().ToGuid(),
|
||||
Status = data.status,
|
||||
CreateTime = DateTime.Now,
|
||||
ResultId = resultid
|
||||
};
|
||||
await dbClient.Insertable(insertdata).ExecuteCommandAsync();
|
||||
}
|
||||
await _capBus.PublishAsync("result.service.update", data);
|
||||
return new ResultInfo(ResultState.SUCCESS, "success");
|
||||
}
|
||||
return new ResultInfo(ResultState.SUCCESS, "记录id未找到");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取设备上报相关信息
|
||||
/// </summary>
|
||||
|
|
@ -93,6 +61,7 @@ namespace Waste.Application.ThirdApiInfo
|
|||
/// <returns></returns>
|
||||
public async Task<ResultInfo> GetDevInfoAsync(GetDevInfoRequestDto data)
|
||||
{
|
||||
|
||||
//更新上报记录结果
|
||||
Guid resultid = Guid.Empty;
|
||||
//这里进行去重处理
|
||||
|
|
@ -152,7 +121,7 @@ namespace Waste.Application.ThirdApiInfo
|
|||
}
|
||||
var returndata = new GetDevInfoResponseDto
|
||||
{
|
||||
ResultId = _idgen.Create().ToGuid(),
|
||||
ResultId = IDGen.NextID(),
|
||||
UserId = UserId,
|
||||
PostUrl = ApiUrl
|
||||
};
|
||||
|
|
@ -163,46 +132,10 @@ namespace Waste.Application.ThirdApiInfo
|
|||
{
|
||||
return new ResultInfo(ResultState.FAIL, "设备还未获取验证信息");
|
||||
}
|
||||
|
||||
|
||||
// trash@1@62942200205496@4.964 trash@垃圾种类@垃圾桶编号@垃圾重量
|
||||
//20250327 添加名称和操作员 trash@5@干垃圾@30654605660104@技术员@0.22 (@干垃圾) 是名称 (@技术员) 是操作员
|
||||
if (!string.IsNullOrEmpty(data.data) && data.data.StartsWith("trash@"))
|
||||
{
|
||||
var arr = data.data.Split('@');
|
||||
|
||||
if (arr.Length == 4)
|
||||
{
|
||||
var type = arr.GetListValue(1);
|
||||
returndata.trash = arr.GetListValue(2);
|
||||
var weight = arr.GetListValue(3);
|
||||
var result = await UpdateDevInfo(data, returndata, device, type, weight);
|
||||
if (result != null) return result;
|
||||
}
|
||||
else if (arr.Length == 6)
|
||||
{
|
||||
var type = arr.GetListValue(1);
|
||||
|
||||
var typename = arr.GetListValue(2);
|
||||
|
||||
returndata.trash = arr.GetListValue(3);
|
||||
|
||||
var name = arr.GetListValue(4);
|
||||
|
||||
var weight = arr.GetListValue(5);
|
||||
|
||||
var result = await UpdateDevInfo(data, returndata, device, type, weight, typename, name);
|
||||
if (result != null) return result;
|
||||
}
|
||||
else
|
||||
{
|
||||
return new ResultInfo(ResultState.FAIL, $"协议格式不正确:{data.ToJson()}");
|
||||
}
|
||||
}
|
||||
//解析协议,IC卡数据@垃圾桶编号@厨余垃圾@7.91
|
||||
// 00000000003031 40 0F00010009 40 C6E4CBFBC0ACBBF8 40 31352E39
|
||||
// 00000000003031 40 000F000002 40 C6E4CBFBC0ACBBF8 40 35312E30 0D0A
|
||||
else if (!string.IsNullOrEmpty(data.data) && data.data.Length > 52)
|
||||
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 回车换行
|
||||
|
|
@ -214,9 +147,48 @@ namespace Waste.Application.ThirdApiInfo
|
|||
returndata.trash = HextToDec(trashhex).ToString(); //垃圾桶编号使用10进制
|
||||
var type = GetChsFromHex(typehex);
|
||||
var weight = GetChsFromHex(weighthex);
|
||||
|
||||
var result = await UpdateDevInfo(data, returndata, device, type, weight);
|
||||
if (result != null) return result;
|
||||
returndata.type = TrashType(type);
|
||||
returndata.Weight = weight.ToDouble();
|
||||
//计算净重,毛重-皮重=净重,如果净重小于等于0则不上报保存
|
||||
returndata.Weight = (returndata.Weight - device.Tare.ToDouble()).ToDouble(2);
|
||||
if (returndata.Weight <= 0)
|
||||
{
|
||||
_loggerService.AddLogger($"{data.ECode},{device.Name},重量小于等于0:{returndata.ToJson()}", 1);
|
||||
return new ResultInfo(ResultState.FAIL, "无效的重量");
|
||||
}
|
||||
//检查是否为15分钟内第一次上报
|
||||
//如果是巴城的设备则不使用这个限制
|
||||
if (device.Businessid != Guid.Parse("39FCB9DE-404E-68F5-384B-EE2462EAB87C"))
|
||||
{
|
||||
var time15 = DateTime.Now.AddMinutes(-15);
|
||||
if (await dbClient.Queryable<W_DeviceResult>().AnyAsync(x => x.DeviceId == device.Id && x.LastTrash == returndata.trash && x.LastHeartTime > time15))
|
||||
{
|
||||
_loggerService.AddLogger($"{data.ECode},{device.Name},重复垃圾桶编号的数据:{returndata.ToJson()}", 1);
|
||||
return new ResultInfo(ResultState.FAIL, "15分钟内同一垃圾桶编号上报");
|
||||
}
|
||||
}
|
||||
returndata.IsSuccessed = true;
|
||||
//记录数据
|
||||
data.IMEI = data.IMEI.ToStr();
|
||||
data.ICCID = data.ICCID.ToStr();
|
||||
data.IMSI = data.IMSI.ToStr();
|
||||
await _capBus.PublishAsync("result.service.insert", new ResultS2SDto
|
||||
{
|
||||
BusinessId = device.Businessid,
|
||||
DeviceId = device.Id,
|
||||
gslq = data.GSLQ,
|
||||
iccid = data.ICCID,
|
||||
imei = data.IMEI,
|
||||
imsi = data.IMSI,
|
||||
LastHeartTime = device.LastHeartTime,
|
||||
latitude = data.Latitude,
|
||||
longtitude = data.Longitude,
|
||||
ResultId = returndata.ResultId,
|
||||
Tare = device.Tare,
|
||||
trash = returndata.trash,
|
||||
wastetype = type,
|
||||
weight = weight
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -239,7 +211,37 @@ namespace Waste.Application.ThirdApiInfo
|
|||
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>
|
||||
/// 16进制转10进制
|
||||
/// </summary>
|
||||
|
|
@ -259,33 +261,28 @@ namespace Waste.Application.ThirdApiInfo
|
|||
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)
|
||||
{
|
||||
|
|
@ -293,9 +290,9 @@ namespace Waste.Application.ThirdApiInfo
|
|||
return 0;
|
||||
}
|
||||
|
||||
|
||||
return total;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 心跳数据上报
|
||||
/// </summary>
|
||||
|
|
@ -310,7 +307,6 @@ namespace Waste.Application.ThirdApiInfo
|
|||
await _capBus.PublishAsync("device.service.postheart", data);
|
||||
return new ResultInfo(ResultState.SUCCESS, "success");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取设备注册信息,第一次开机使用
|
||||
/// </summary>
|
||||
|
|
@ -346,7 +342,37 @@ namespace Waste.Application.ThirdApiInfo
|
|||
}
|
||||
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;
|
||||
}
|
||||
/// <summary>
|
||||
/// 更新设备版本信息
|
||||
/// </summary>
|
||||
|
|
@ -356,7 +382,6 @@ namespace Waste.Application.ThirdApiInfo
|
|||
{
|
||||
await _capBus.PublishAsync("device.service.updatever", data);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 通过ailink wifi模式发送的数据
|
||||
/// </summary>
|
||||
|
|
@ -432,97 +457,6 @@ namespace Waste.Application.ThirdApiInfo
|
|||
}
|
||||
return 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);
|
||||
}
|
||||
|
||||
//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 string TrashTypeTitle(string type)
|
||||
//{
|
||||
// if (!int.TryParse(type, out var num)) return type;
|
||||
// if (num == 1) return "厨余垃圾";
|
||||
// else if (num == 2) return "可回收物";
|
||||
// else if (num == 3) return "有害垃圾";
|
||||
// else if (num == 4) return "其他垃圾";
|
||||
// else return "0";
|
||||
//}
|
||||
|
||||
private int TrashType(string type)
|
||||
{
|
||||
var result = dbClient.Queryable<W_WasteType>().First(s => s.Name == type);
|
||||
if (result == null) return 0;
|
||||
return int.Parse(result.Code);
|
||||
}
|
||||
|
||||
private string TrashTypeTitle(string type)
|
||||
{
|
||||
if (!int.TryParse(type, out var num)) return type;
|
||||
var result = dbClient.Queryable<W_WasteType>().First(s => s.Code == type || s.Code == "0000" + type);
|
||||
if (result == null) return "0";
|
||||
return result.Name;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// wifi数据解析
|
||||
/// </summary>
|
||||
|
|
@ -593,254 +527,5 @@ namespace Waste.Application.ThirdApiInfo
|
|||
{
|
||||
return ((int)bt).ToString("X2");
|
||||
}
|
||||
|
||||
private async Task<ResultInfo> UpdateDevInfo(GetDevInfoRequestDto data, GetDevInfoResponseDto returndata, W_Device device, string type, string weight, string typename = "", string name = "")
|
||||
{
|
||||
//returndata.type = TrashType(type);
|
||||
int result = 0;
|
||||
bool isSuccess = int.TryParse(type, out result);
|
||||
if (isSuccess)
|
||||
{
|
||||
returndata.type = int.Parse(type);
|
||||
}
|
||||
else
|
||||
{
|
||||
returndata.type = TrashType(type);
|
||||
}
|
||||
|
||||
returndata.Weight = weight.ToDouble();
|
||||
//计算净重,毛重-皮重=净重,如果净重小于等于0则不上报保存
|
||||
returndata.Weight = (returndata.Weight - device.Tare.ToDouble()).ToDouble(2);
|
||||
if (returndata.Weight <= 0)
|
||||
{
|
||||
_loggerService.AddLogger($"{data.ECode},{device.Name},重量小于等于0:{returndata.ToJson()}", 1);
|
||||
return new ResultInfo(ResultState.FAIL, "无效的重量");
|
||||
}
|
||||
//检查是否为15分钟内第一次上报
|
||||
//如果是巴城的设备则不使用这个限制
|
||||
if (device.Businessid != Guid.Parse("39FCB9DE-404E-68F5-384B-EE2462EAB87C"))
|
||||
{
|
||||
var time15 = DateTime.Now.AddMinutes(-15);
|
||||
if (await dbClient.Queryable<W_DeviceResult>().AnyAsync(x => x.DeviceId == device.Id && x.LastTrash == returndata.trash && x.LastHeartTime > time15))
|
||||
{
|
||||
_loggerService.AddLogger($"{data.ECode},{device.Name},重复垃圾桶编号的数据:{returndata.ToJson()}", 1);
|
||||
return new ResultInfo(ResultState.FAIL, "15分钟内同一垃圾桶编号上报");
|
||||
}
|
||||
}
|
||||
returndata.IsSuccessed = true;
|
||||
//记录数据
|
||||
data.IMEI = data.IMEI.ToStr();
|
||||
data.ICCID = data.ICCID.ToStr();
|
||||
data.IMSI = data.IMSI.ToStr();
|
||||
await _capBus.PublishAsync("result.service.insert", new ResultS2SDto
|
||||
{
|
||||
BusinessId = device.Businessid,
|
||||
DeviceId = device.Id,
|
||||
gslq = data.GSLQ,
|
||||
iccid = data.ICCID,
|
||||
imei = data.IMEI,
|
||||
imsi = data.IMSI,
|
||||
LastHeartTime = device.LastHeartTime,
|
||||
latitude = data.Latitude,
|
||||
longtitude = data.Longitude,
|
||||
ResultId = returndata.ResultId,
|
||||
Tare = device.Tare,
|
||||
trash = returndata.trash,
|
||||
wastetype = typename.IsNullOrEmpty() == false ? typename : type,
|
||||
weight = weight
|
||||
});
|
||||
|
||||
|
||||
if (name.IsNullOrEmpty() == false && typename.IsNullOrEmpty() == false)
|
||||
{
|
||||
await dbClient.Insertable(new W_MeasureResult
|
||||
{
|
||||
ResultId = returndata.ResultId,
|
||||
WasteSType = "",
|
||||
Price = 0.00m,
|
||||
Amount = 0.00m,
|
||||
OpUser = name,
|
||||
UUID = "",
|
||||
CreatedTime = DateTime.Now,
|
||||
}).ExecuteCommandAsync();
|
||||
}
|
||||
|
||||
//推送数据给第三方
|
||||
await _resultService.SendMessageToThird(new SendThirdMessageSubscribeS2SDto
|
||||
{
|
||||
DeviceId = device.Id,
|
||||
WasteSType = "",
|
||||
Time = DateTime.Now,
|
||||
TrashCode = returndata.trash,
|
||||
WasteType = typename.IsNullOrEmpty() == false ? typename : type,
|
||||
Weight = weight.ToDecimal(),
|
||||
faccode = device.FacEcode,
|
||||
ecode = device.Ecode,
|
||||
province = device.Province,
|
||||
city = device.City,
|
||||
area = device.Area,
|
||||
address = device.Address
|
||||
});
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 新增电子秤
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<ResultInfo> AddProductAsync(ProductInfoDto data)
|
||||
{
|
||||
//return new ResultInfo(ResultState.SUCCESS, "测试信息:直接返回");
|
||||
try
|
||||
{
|
||||
if (await dbClient.Queryable<W_Product>().AnyAsync(x => x.Uuid == data.uuid))
|
||||
{
|
||||
return new ResultInfo(ResultState.FAIL, "数据已存在");
|
||||
}
|
||||
var imageUrl = "";
|
||||
if (data.image.IsNullOrEmpty() == false)
|
||||
{
|
||||
//将图片上传服务器
|
||||
// 移除Base64字符串中的前缀(如 "data:image/png;base64,")
|
||||
string base64Data = data.image;
|
||||
// 将Base64字符串解码为字节数组
|
||||
var arr = Convert.FromBase64String(base64Data);
|
||||
//把上传完的路径存到数据库
|
||||
using (var client = new HttpClient())
|
||||
{
|
||||
// 创建MultipartFormDataContent对象
|
||||
var content = new MultipartFormDataContent();
|
||||
|
||||
// 添加文件内容到MultipartFormDataContent
|
||||
content.Add(new ByteArrayContent(arr), "file", "image.png");
|
||||
|
||||
// 发送POST请求
|
||||
HttpResponseMessage response = await client.PostAsync("https://izzt.jt-sky.com/api/common/uploadimg", content);
|
||||
|
||||
// 检查响应
|
||||
if (response.IsSuccessStatusCode)
|
||||
{
|
||||
// 假设服务器返回的是JSON格式,包含图片URL
|
||||
var responseContent = await response.Content.ReadAsStringAsync();
|
||||
|
||||
if (responseContent.Contains("success"))
|
||||
{
|
||||
// 解析JSON
|
||||
JObject jsonResponseObject = JObject.Parse(responseContent);
|
||||
// 提取URL
|
||||
imageUrl = jsonResponseObject["data"]["url"].ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//return new ResultInfo(ResultState.SUCCESS, imageUrl);
|
||||
W_Product insertdata = new W_Product
|
||||
{
|
||||
Id = Guid.NewGuid().ToString(),
|
||||
UserName = data.userName,
|
||||
Weight = data.weight.ToString(),
|
||||
Image = imageUrl,
|
||||
UpperLimit = data.upperLimit.ToString(),
|
||||
Unit = data.unit,
|
||||
TimeStamp = data.timeStamp.ToString(),
|
||||
TareWeight = data.tareWeight.ToString(),
|
||||
RecordNo = data.recordNo.ToString(),
|
||||
ProductNo = data.productNo,
|
||||
ProductName = data.productName,
|
||||
ProductId = data.productId.ToString(),
|
||||
NetWeight = data.netWeight.ToString(),
|
||||
LowerLimit = data.lowerLimit.ToString(),
|
||||
IdNames = data.idNames,
|
||||
IdValues = data.idValues,
|
||||
Date = data.date,
|
||||
DateTime = data.dateTime,
|
||||
Amount = data.amount.ToString(),
|
||||
Uuid = data.uuid,
|
||||
UserId = data.userId.ToString(),
|
||||
CreateTime = DateTime.Now,
|
||||
Video = data.Video
|
||||
};
|
||||
await dbClient.Insertable(insertdata).ExecuteCommandAsync();
|
||||
return new ResultInfo(ResultState.SUCCESS, "success");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ResultInfo(ResultState.FAIL, ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<PageParms<W_Product>> GetProductAsync(QueryParams param)
|
||||
{
|
||||
try
|
||||
{
|
||||
RefAsync<int> totalnum = 0;
|
||||
var temquery = dbClient.Queryable<W_Product>();
|
||||
if (param.queryParam != null && param.queryParam.Count > 0)
|
||||
{
|
||||
List<IConditionalModel> conModels = new List<IConditionalModel>();
|
||||
param.queryParam.ForEach(x =>
|
||||
{
|
||||
if (!string.IsNullOrEmpty(x.Value))
|
||||
{
|
||||
conModels.Add(new ConditionalModel()
|
||||
{
|
||||
FieldName = x.Name,
|
||||
ConditionalType = (ConditionalType)x.Type,
|
||||
FieldValue = x.Value.Trim()
|
||||
});
|
||||
}
|
||||
});
|
||||
if (conModels.Count > 0)
|
||||
{
|
||||
temquery = temquery.Where(conModels);
|
||||
}
|
||||
}
|
||||
string sorts = string.Format("{0} {1}", param.sort, param.order);
|
||||
var query = await temquery.OrderBy(sorts)
|
||||
.ToPageListAsync(param.offset, param.limit, totalnum);
|
||||
return new PageParms<W_Product>
|
||||
{
|
||||
page = param.offset,
|
||||
Items = query,
|
||||
totalnum = totalnum,
|
||||
limit = param.limit
|
||||
};
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new PageParms<W_Product>();
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<ResultInfo> DeleteProductAsync(string id)
|
||||
{
|
||||
try
|
||||
{
|
||||
// 1. 检查数据是否存在
|
||||
var exists = await dbClient.Queryable<W_Product>()
|
||||
.Where(x => x.Id == id)
|
||||
.AnyAsync();
|
||||
|
||||
if (!exists)
|
||||
{
|
||||
return new ResultInfo(ResultState.FAIL, "数据不存在");
|
||||
}
|
||||
|
||||
// 2. 执行删除
|
||||
var result = await dbClient.Deleteable<W_Product>()
|
||||
.Where(x => x.Id == id)
|
||||
.ExecuteCommandAsync();
|
||||
|
||||
return result > 0
|
||||
? new ResultInfo(ResultState.SUCCESS, "删除成功")
|
||||
: new ResultInfo(ResultState.FAIL, "删除失败");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
// 3. 错误处理
|
||||
return new ResultInfo(ResultState.FAIL, $"系统错误: {ex.Message}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -589,12 +589,6 @@
|
|||
<param name="input"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Waste.Application.DeviceAppService.SetQDConfig">
|
||||
<summary>
|
||||
批量配置千灯镇商户推送
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:Waste.Application.Device.DeviceService">
|
||||
<summary>
|
||||
设备管理
|
||||
|
|
@ -642,12 +636,6 @@
|
|||
<param name="input"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Waste.Application.Device.DeviceService.SetQDConfig">
|
||||
<summary>
|
||||
批量配置千灯镇商户推送
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Waste.Application.Device.DeviceService.SetStatusAsync(System.Guid,System.Int32)">
|
||||
<summary>
|
||||
设备状态修改
|
||||
|
|
@ -880,12 +868,6 @@
|
|||
<param name="input"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Waste.Application.IDeviceService.SetQDConfig">
|
||||
<summary>
|
||||
批量配置千灯镇商户推送
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Waste.Application.IDeviceService.GetConfigAsync(System.Guid)">
|
||||
<summary>
|
||||
获取设备配置详情
|
||||
|
|
@ -1612,86 +1594,6 @@
|
|||
<param name="param"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:Waste.Application.ResultListByEquS2CDto">
|
||||
<summary>
|
||||
投放记录列表
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Waste.Application.ResultListByEquS2CDto.WasteType">
|
||||
<summary>
|
||||
垃圾类别
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Waste.Application.ResultListByEquS2CDto.WasteSType">
|
||||
<summary>
|
||||
物品小类别
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Waste.Application.ResultListByEquS2CDto.Weight">
|
||||
<summary>
|
||||
重量,单位KG
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Waste.Application.ResultListByEquS2CDto.TrashCode">
|
||||
<summary>
|
||||
垃圾桶编号
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Waste.Application.ResultListByEquS2CDto.Time">
|
||||
<summary>
|
||||
上报时间
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:Waste.Application.ResultListByEquS2SDto">
|
||||
<summary>
|
||||
投放记录列表
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Waste.Application.ResultListByEquS2SDto.CreateTime">
|
||||
<summary>
|
||||
上报时间
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Waste.Application.ResultListByEquS2SDto.Id">
|
||||
<summary>
|
||||
测量记录ID
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Waste.Application.ResultListByEquS2SDto.GrossWeight">
|
||||
<summary>
|
||||
毛重
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:Waste.Application.ResultListByEquC2SDto">
|
||||
<summary>
|
||||
查询投放记录
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Waste.Application.ResultListByEquC2SDto.offset">
|
||||
<summary>
|
||||
当前页
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Waste.Application.ResultListByEquC2SDto.limit">
|
||||
<summary>
|
||||
每页显示的数量
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Waste.Application.ResultListByEquC2SDto.StartTime">
|
||||
<summary>
|
||||
开始时间
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Waste.Application.ResultListByEquC2SDto.EndTime">
|
||||
<summary>
|
||||
结束时间
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Waste.Application.ResultListByEquC2SDto.DeviceId">
|
||||
<summary>
|
||||
设备ID
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Waste.Application.ResultList.BusinessName">
|
||||
<summary>
|
||||
商户名称
|
||||
|
|
@ -1722,31 +1624,6 @@
|
|||
上报是否成功,1-成功,0-失败
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Waste.Application.ResultList.Measure_WasteSType">
|
||||
<summary>
|
||||
物品小类
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Waste.Application.ResultList.Measure_Price">
|
||||
<summary>
|
||||
价格
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Waste.Application.ResultList.Measure_Amount">
|
||||
<summary>
|
||||
金额
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Waste.Application.ResultList.Measure_OpUser">
|
||||
<summary>
|
||||
操作员
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Waste.Application.ResultList.Measure_UUID">
|
||||
<summary>
|
||||
唯一消息ID
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:Waste.Application.MyPackage">
|
||||
<summary>
|
||||
上传的数据包体
|
||||
|
|
@ -1764,7 +1641,7 @@
|
|||
</member>
|
||||
<member name="P:Waste.Application.MyPackage.IMEI">
|
||||
<summary>
|
||||
IMEI/设备编号
|
||||
IMEI
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Waste.Application.MyPackage.ICCID">
|
||||
|
|
@ -1877,31 +1754,6 @@
|
|||
操作员
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Waste.Application.A8Package.DeviceFacEcode">
|
||||
<summary>
|
||||
设备出厂序列号/设备出厂编号
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Waste.Application.A8Package.Registration">
|
||||
<summary>
|
||||
车牌号/物品编码/垃圾桶编号
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Waste.Application.A8Package.GrossWeight">
|
||||
<summary>
|
||||
毛重,KG
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Waste.Application.A8Package.Tare">
|
||||
<summary>
|
||||
皮重,KG
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Waste.Application.A8Package.NetWeight">
|
||||
<summary>
|
||||
净重,KG
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:Waste.Application.A8MyPackage">
|
||||
<summary>
|
||||
A8协议模块上传的数据包体
|
||||
|
|
@ -2167,20 +2019,6 @@
|
|||
<param name="data"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Waste.Application.IResultService.GetListByEquAsync(Waste.Application.ResultListByEquC2SDto)">
|
||||
<summary>
|
||||
查询历史投放记录
|
||||
</summary>
|
||||
<param name="input"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Waste.Application.IResultService.SendMessageToThird(Waste.Application.SubscribeInfo.SendThirdMessageSubscribeS2SDto)">
|
||||
<summary>
|
||||
给第三方推送消息
|
||||
</summary>
|
||||
<param name="input"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:Waste.Application.ResultInfos.ResultAppService">
|
||||
<summary>
|
||||
投放记录
|
||||
|
|
@ -2207,13 +2045,6 @@
|
|||
<param name="data"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Waste.Application.ResultInfos.ResultAppService.GetListByEquAsync(Waste.Application.ResultListByEquC2SDto)">
|
||||
<summary>
|
||||
查询历史投放记录
|
||||
</summary>
|
||||
<param name="input"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:Waste.Application.ResultService">
|
||||
<summary>
|
||||
投放记录管理
|
||||
|
|
@ -2226,13 +2057,6 @@
|
|||
<param name="param"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Waste.Application.ResultService.GetListByEquAsync(Waste.Application.ResultListByEquC2SDto)">
|
||||
<summary>
|
||||
查询历史投放记录
|
||||
</summary>
|
||||
<param name="input"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Waste.Application.ResultService.InsertResultByWifiAsync(Waste.Application.WifiPackage)">
|
||||
<summary>
|
||||
wifi模块测量结果增加
|
||||
|
|
@ -2448,36 +2272,6 @@
|
|||
上报时间
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Waste.Application.SubscribeInfo.SendThirdMessageSubscribeS2SDto.ecode">
|
||||
<summary>
|
||||
设备机器码
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Waste.Application.SubscribeInfo.SendThirdMessageSubscribeS2SDto.faccode">
|
||||
<summary>
|
||||
设备编号
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Waste.Application.SubscribeInfo.SendThirdMessageSubscribeS2SDto.province">
|
||||
<summary>
|
||||
设备所属省份
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Waste.Application.SubscribeInfo.SendThirdMessageSubscribeS2SDto.city">
|
||||
<summary>
|
||||
设备所属城市
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Waste.Application.SubscribeInfo.SendThirdMessageSubscribeS2SDto.area">
|
||||
<summary>
|
||||
设备所属区/县
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Waste.Application.SubscribeInfo.SendThirdMessageSubscribeS2SDto.address">
|
||||
<summary>
|
||||
设备详细地址
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:Waste.Application.SubscribeInfo.SendThirdMessageSubscriDto">
|
||||
<summary>
|
||||
发送第三方消息
|
||||
|
|
@ -2528,41 +2322,6 @@
|
|||
设备ID
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Waste.Application.SubscribeInfo.SendMessageToThirdS2CDto.ecode">
|
||||
<summary>
|
||||
设备机器码
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Waste.Application.SubscribeInfo.SendMessageToThirdS2CDto.faccode">
|
||||
<summary>
|
||||
设备编号
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Waste.Application.SubscribeInfo.SendMessageToThirdS2CDto.province">
|
||||
<summary>
|
||||
设备所属省份
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Waste.Application.SubscribeInfo.SendMessageToThirdS2CDto.city">
|
||||
<summary>
|
||||
设备所属城市
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Waste.Application.SubscribeInfo.SendMessageToThirdS2CDto.area">
|
||||
<summary>
|
||||
设备所属区/县
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Waste.Application.SubscribeInfo.SendMessageToThirdS2CDto.address">
|
||||
<summary>
|
||||
设备详细地址
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Waste.Application.SubscribeInfo.SendMessageToThirdS2CDto.BeatTime">
|
||||
<summary>
|
||||
最近心跳时间
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:Waste.Application.SubscribeInfo.ISubscribeService">
|
||||
<summary>
|
||||
CAP订阅相关接口
|
||||
|
|
@ -2976,136 +2735,6 @@
|
|||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="P:Waste.Application.ThirdApiInfo.ProductInfoDto.date">
|
||||
<summary>
|
||||
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Waste.Application.ThirdApiInfo.ProductInfoDto.dateTime">
|
||||
<summary>
|
||||
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Waste.Application.ThirdApiInfo.ProductInfoDto.id">
|
||||
<summary>
|
||||
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Waste.Application.ThirdApiInfo.ProductInfoDto.idNames">
|
||||
<summary>
|
||||
规格,参数名称,
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Waste.Application.ThirdApiInfo.ProductInfoDto.idValues">
|
||||
<summary>
|
||||
545677,参数值,
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Waste.Application.ThirdApiInfo.ProductInfoDto.isUpload">
|
||||
<summary>
|
||||
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Waste.Application.ThirdApiInfo.ProductInfoDto.level">
|
||||
<summary>
|
||||
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Waste.Application.ThirdApiInfo.ProductInfoDto.lowerLimit">
|
||||
<summary>
|
||||
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Waste.Application.ThirdApiInfo.ProductInfoDto.netWeight">
|
||||
<summary>
|
||||
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Waste.Application.ThirdApiInfo.ProductInfoDto.productId">
|
||||
<summary>
|
||||
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Waste.Application.ThirdApiInfo.ProductInfoDto.productName">
|
||||
<summary>
|
||||
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Waste.Application.ThirdApiInfo.ProductInfoDto.productNo">
|
||||
<summary>
|
||||
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Waste.Application.ThirdApiInfo.ProductInfoDto.recordNo">
|
||||
<summary>
|
||||
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Waste.Application.ThirdApiInfo.ProductInfoDto.startDate">
|
||||
<summary>
|
||||
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Waste.Application.ThirdApiInfo.ProductInfoDto.status">
|
||||
<summary>
|
||||
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Waste.Application.ThirdApiInfo.ProductInfoDto.tareWeight">
|
||||
<summary>
|
||||
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Waste.Application.ThirdApiInfo.ProductInfoDto.time">
|
||||
<summary>
|
||||
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Waste.Application.ThirdApiInfo.ProductInfoDto.timeStamp">
|
||||
<summary>
|
||||
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Waste.Application.ThirdApiInfo.ProductInfoDto.unit">
|
||||
<summary>
|
||||
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Waste.Application.ThirdApiInfo.ProductInfoDto.upperLimit">
|
||||
<summary>
|
||||
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Waste.Application.ThirdApiInfo.ProductInfoDto.userId">
|
||||
<summary>
|
||||
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Waste.Application.ThirdApiInfo.ProductInfoDto.userName">
|
||||
<summary>
|
||||
技术员
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Waste.Application.ThirdApiInfo.ProductInfoDto.uuid">
|
||||
<summary>
|
||||
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Waste.Application.ThirdApiInfo.ProductInfoDto.weight">
|
||||
<summary>
|
||||
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Waste.Application.ThirdApiInfo.ProductInfoDto.image">
|
||||
<summary>
|
||||
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Waste.Application.ThirdApiInfo.ProductInfoDto.uploadPermission">
|
||||
<summary>
|
||||
新增:操作权限控制(必须传 true/false,其他值或未传会报错)
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:Waste.Application.ThirdApiInfo.DevHeartRequestDto">
|
||||
<summary>
|
||||
心跳包上报数据
|
||||
|
|
@ -3416,56 +3045,6 @@
|
|||
上报时间
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:Waste.Application.ThirdApiInfo.AppS2CDto`1">
|
||||
<summary>
|
||||
app端返回的信息
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Waste.Application.ThirdApiInfo.AppS2CDto`1.status">
|
||||
<summary>
|
||||
信息
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:Waste.Application.ThirdApiInfo.AppCommonS2CDto">
|
||||
<summary>
|
||||
app端返回的通用信息
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Waste.Application.ThirdApiInfo.AppCommonS2CDto.code">
|
||||
<summary>
|
||||
错误代码
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Waste.Application.ThirdApiInfo.AppCommonS2CDto.name">
|
||||
<summary>
|
||||
名称
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Waste.Application.ThirdApiInfo.AppCommonS2CDto.message">
|
||||
<summary>
|
||||
错误信息
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:Waste.Application.ThirdApiInfo.AppVerS2CDto">
|
||||
<summary>
|
||||
app端版本信息返回值
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Waste.Application.ThirdApiInfo.AppVerS2CDto.code">
|
||||
<summary>
|
||||
版本号
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Waste.Application.ThirdApiInfo.AppVerS2CDto.name">
|
||||
<summary>
|
||||
版本说明
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Waste.Application.ThirdApiInfo.AppVerS2CDto.update_url">
|
||||
<summary>
|
||||
下载地址
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:Waste.Application.ThirdApiInfo.IOpenService">
|
||||
<summary>
|
||||
设备对接接口
|
||||
|
|
@ -3513,11 +3092,28 @@
|
|||
<param name="data"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Waste.Application.ThirdApiInfo.IOpenService.AddProductAsync(Waste.Application.ThirdApiInfo.ProductInfoDto)">
|
||||
<member name="T:Waste.Application.ThirdApiInfo.Message.IMessageService">
|
||||
<summary>
|
||||
新增电子秤
|
||||
设备消息推送给第三方处理
|
||||
</summary>
|
||||
<param name="data"></param>
|
||||
</member>
|
||||
<member name="M:Waste.Application.ThirdApiInfo.Message.IMessageService.SeedMessageAsync(Waste.Application.ThirdApiInfo.SendMessageS2SDto)">
|
||||
<summary>
|
||||
消息发送
|
||||
</summary>
|
||||
<param name="input"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:Waste.Application.ThirdApiInfo.Message.MessageService">
|
||||
<summary>
|
||||
设备消息推送给第三方处理
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Waste.Application.ThirdApiInfo.Message.MessageService.SeedMessageAsync(Waste.Application.ThirdApiInfo.SendMessageS2SDto)">
|
||||
<summary>
|
||||
消息发送
|
||||
</summary>
|
||||
<param name="input"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:Waste.Application.ThirdApiInfo.OpenAppService">
|
||||
|
|
@ -3588,18 +3184,6 @@
|
|||
<param name="data"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Waste.Application.ThirdApiInfo.OpenAppService.AddProductAsync(Waste.Application.ThirdApiInfo.ProductInfoDto)">
|
||||
<summary>
|
||||
新增电子秤
|
||||
</summary>
|
||||
<param name="data"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Waste.Application.ThirdApiInfo.OpenAppService.DeleteProduct(System.String)">
|
||||
<summary>
|
||||
删除产品数据(管理后台专用,无需权限校验)
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:Waste.Application.ThirdApiInfo.OpenService">
|
||||
<summary>
|
||||
设备对接接口
|
||||
|
|
@ -3619,6 +3203,13 @@
|
|||
<param name="data"></param>
|
||||
<returns></returns>
|
||||
</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.HextToDec(System.String)">
|
||||
<summary>
|
||||
16进制转10进制
|
||||
|
|
@ -3640,6 +3231,13 @@
|
|||
<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.ThirdApiInfo.OpenService.UpdateVersionAsync(Waste.Application.SubscribeInfo.DeviceVerS2SDto)">
|
||||
<summary>
|
||||
更新设备版本信息
|
||||
|
|
@ -3654,20 +3252,6 @@
|
|||
<param name="data"></param>
|
||||
<returns></returns>
|
||||
</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.BytesToHexStr(System.Byte[])">
|
||||
<summary>
|
||||
字节数组转16进制
|
||||
</summary>
|
||||
<param name="bt"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Waste.Application.ThirdApiInfo.OpenService.AnalyProto(Waste.Application.ThirdApiInfo.WifiRequestC2SDto)">
|
||||
<summary>
|
||||
wifi数据解析
|
||||
|
|
@ -3682,13 +3266,6 @@
|
|||
<param name="bt"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Waste.Application.ThirdApiInfo.OpenService.AddProductAsync(Waste.Application.ThirdApiInfo.ProductInfoDto)">
|
||||
<summary>
|
||||
新增电子秤
|
||||
</summary>
|
||||
<param name="data"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Waste.Application.IWasteService.GetTypeListAsync(Nirvana.Common.QueryParams)">
|
||||
<summary>
|
||||
垃圾分类列表
|
||||
|
|
|
|||
|
|
@ -19,9 +19,7 @@ namespace Waste.Core
|
|||
DbType = DbType.SqlServer,
|
||||
IsAutoCloseConnection = true,
|
||||
InitKeyType = InitKeyType.Attribute //从特性读取主键自增信息
|
||||
}
|
||||
#if DEBUG
|
||||
,
|
||||
},
|
||||
db =>
|
||||
{
|
||||
//处理日志事务
|
||||
|
|
@ -34,7 +32,6 @@ namespace Waste.Core
|
|||
Console.WriteLine();
|
||||
};
|
||||
}
|
||||
#endif
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
<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="DotNetCore.CAP.Dashboard" Version="5.2.0" />
|
||||
<PackageReference Include="Furion" Version="2.20.6" />
|
||||
<PackageReference Include="Furion.Extras.Authentication.JwtBearer" Version="2.20.6" />
|
||||
<PackageReference Include="Furion.Extras.DatabaseAccessor.SqlSugar" Version="2.20.6" />
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -1 +0,0 @@
|
|||
https://iot.ljflytjl.cn/Developer/Devices
|
||||
|
|
@ -1,311 +0,0 @@
|
|||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Furion.DependencyInjection;
|
||||
using SqlSugar;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
using Microsoft.EntityFrameworkCore.Query.Internal;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Options;
|
||||
|
||||
namespace Waste.Domain
|
||||
{
|
||||
public class JT_Setting
|
||||
{
|
||||
public JT_Setting() { }
|
||||
public JT_Setting(Guid id, string name, string value, string providerName, string providerKey)
|
||||
{
|
||||
this.Id = id;
|
||||
this.Name = name;
|
||||
this.Value = value;
|
||||
this.ProviderName = providerName;
|
||||
this.ProviderKey = providerKey;
|
||||
}
|
||||
[SugarColumn(IsPrimaryKey = true)]
|
||||
public Guid Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Value { get; set; }
|
||||
|
||||
public string ProviderName { get; set; }
|
||||
public string ProviderKey { get; set; }
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return $"{base.ToString()}, Name = {Name}, Value = {Value}, ProviderName = {ProviderName}, ProviderKey = {ProviderKey}";
|
||||
}
|
||||
}
|
||||
public class SettingProvider : ITransient
|
||||
{
|
||||
private readonly IServiceProvider _serviceProvider;
|
||||
|
||||
private readonly SettingDefinitionManager SettingDefinitionManager;
|
||||
private readonly SettingValueProviderManager SettingValueProviderManager;
|
||||
|
||||
|
||||
public SettingProvider(IServiceProvider serviceProvider, SettingDefinitionManager settingDefinitionManager, SettingValueProviderManager settingValueProviderManager)
|
||||
{
|
||||
_serviceProvider = serviceProvider;
|
||||
SettingDefinitionManager = settingDefinitionManager;
|
||||
SettingValueProviderManager = settingValueProviderManager;
|
||||
}
|
||||
|
||||
public virtual async Task<string?> GetOrNullAsync(string name)
|
||||
{
|
||||
var setting = await SettingDefinitionManager.GetAsync(name);
|
||||
var providers = Enumerable
|
||||
.Reverse(SettingValueProviderManager.Providers);
|
||||
|
||||
if (setting.Providers.Any())
|
||||
{
|
||||
providers = providers.Where(p => setting.Providers.Contains(p.Name));
|
||||
}
|
||||
|
||||
//TODO: How to implement setting.IsInherited?
|
||||
|
||||
var value = await GetOrNullValueFromProvidersAsync(providers, setting);
|
||||
/* if (value != null && setting.IsEncrypted)
|
||||
{
|
||||
value = SettingEncryptionService.Decrypt(setting, value);
|
||||
}*/
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
|
||||
protected virtual async Task<string?> GetOrNullValueFromProvidersAsync(
|
||||
IEnumerable<SettingValueProvider> providers,
|
||||
SettingDefinition setting)
|
||||
{
|
||||
foreach (var provider in providers)
|
||||
{
|
||||
var value = await provider.GetOrNullAsync(setting);
|
||||
if (value != null)
|
||||
{
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public class SettingDefinitionManager : ISingleton
|
||||
{
|
||||
protected IDictionary<string, SettingDefinition> SettingDefinitions { get; } =
|
||||
new Dictionary<string, SettingDefinition>();
|
||||
|
||||
public SettingDefinitionManager AddSettingDefinition(SettingDefinition settingDefinition)
|
||||
{
|
||||
SettingDefinitions[settingDefinition.Name] = settingDefinition;
|
||||
return this;
|
||||
}
|
||||
public virtual async Task<SettingDefinition> GetAsync(string name)
|
||||
{
|
||||
|
||||
var setting = await GetOrNullAsync(name);
|
||||
|
||||
if (setting == null)
|
||||
{
|
||||
throw new Exception("Undefined setting: " + name);
|
||||
}
|
||||
|
||||
return setting;
|
||||
}
|
||||
public virtual Task<SettingDefinition?> GetOrNullAsync(string name)
|
||||
{
|
||||
return Task.FromResult(GetOrDefault(SettingDefinitions, name));
|
||||
}
|
||||
public static TValue? GetOrDefault<TKey, TValue>(IDictionary<TKey, TValue> dictionary, TKey key)
|
||||
{
|
||||
return dictionary.TryGetValue(key, out var obj) ? obj : default;
|
||||
}
|
||||
}
|
||||
|
||||
public class SettingValueProviderManager : ISingleton
|
||||
{
|
||||
public List<SettingValueProvider> Providers => _lazyProviders.Value;
|
||||
private readonly Lazy<List<SettingValueProvider>> _lazyProviders;
|
||||
protected IServiceProvider ServiceProvider { get; }
|
||||
public SettingValueProviderManager(IServiceProvider serviceProvider)
|
||||
{
|
||||
ServiceProvider = serviceProvider;
|
||||
_lazyProviders = new Lazy<List<SettingValueProvider>>(GetProviders, true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
protected virtual List<SettingValueProvider> GetProviders()
|
||||
{
|
||||
|
||||
using (var scope = ServiceProvider.CreateScope())
|
||||
|
||||
return new List<SettingValueProvider>()
|
||||
{
|
||||
scope.ServiceProvider.GetRequiredService<DefaultValueSettingValueProvider>(),
|
||||
scope.ServiceProvider.GetRequiredService<GlobalSettingValueProvider>(),
|
||||
scope.ServiceProvider.GetRequiredService<UserSettingValueProvider>(),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class SettingManagementStore : ITransient
|
||||
{
|
||||
private readonly ISqlSugarRepository<JT_Setting> repository;
|
||||
|
||||
public SettingManagementStore(ISqlSugarRepository<JT_Setting> repository)
|
||||
{
|
||||
this.repository = repository;
|
||||
}
|
||||
|
||||
public virtual async Task<string> GetOrNullAsync(string name, string providerName, string providerKey)
|
||||
{
|
||||
return (await FindAsync(name, providerName, providerKey))?.Value;
|
||||
}
|
||||
public virtual async Task SetAsync(string name, string value, string providerName, string providerKey)
|
||||
{
|
||||
var setting = await FindAsync(name, providerName, providerKey);
|
||||
if (setting == null)
|
||||
{
|
||||
setting = new JT_Setting(Guid.NewGuid(), name, value, providerName, providerKey);
|
||||
await repository.InsertAsync(setting);
|
||||
}
|
||||
else
|
||||
{
|
||||
setting.Value = value;
|
||||
await repository.UpdateAsync(setting);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private async Task<JT_Setting> FindAsync(string name, string providerName, string providerKey)
|
||||
{
|
||||
return await repository.Where(x =>
|
||||
x.Name == name && x.ProviderName == providerName)
|
||||
.WhereIF(!string.IsNullOrWhiteSpace(providerKey), x => x.ProviderKey == providerKey).FirstAsync();
|
||||
}
|
||||
}
|
||||
|
||||
public abstract class SettingValueProvider : ITransient
|
||||
{
|
||||
public abstract string Name { get; }
|
||||
|
||||
protected SettingManagementStore SettingStore { get; }
|
||||
|
||||
protected SettingValueProvider(SettingManagementStore settingStore)
|
||||
{
|
||||
SettingStore = settingStore;
|
||||
}
|
||||
public abstract Task<string?> GetOrNullAsync(SettingDefinition setting);
|
||||
|
||||
protected virtual async Task SetAsync(string name, string value, string providerKey)
|
||||
{
|
||||
await SettingStore.SetAsync(name, value, Name, providerKey);
|
||||
|
||||
}
|
||||
|
||||
protected virtual async Task SetAsync(SettingDefinition setting, string value, string providerKey)
|
||||
{
|
||||
await SettingStore.SetAsync(setting.Name, value, Name, providerKey);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public class GlobalSettingValueProvider : SettingValueProvider
|
||||
{
|
||||
public GlobalSettingValueProvider(SettingManagementStore settingStore) : base(settingStore)
|
||||
{
|
||||
}
|
||||
|
||||
public const string ProviderName = "G";
|
||||
|
||||
public override string Name => ProviderName;
|
||||
|
||||
public override Task<string> GetOrNullAsync(SettingDefinition setting)
|
||||
{
|
||||
return SettingStore.GetOrNullAsync(setting.Name, Name, null);
|
||||
}
|
||||
public Task SetAsync(string name, string value)
|
||||
{
|
||||
return base.SetAsync(name, value, null);
|
||||
}
|
||||
}
|
||||
public class UserSettingValueProvider : SettingValueProvider
|
||||
{
|
||||
public const string ProviderName = "U";
|
||||
|
||||
public override string Name => ProviderName;
|
||||
|
||||
protected ICurrentUser CurrentUser { get; }
|
||||
|
||||
public UserSettingValueProvider(SettingManagementStore settingStore, ICurrentUser currentUser)
|
||||
: base(settingStore)
|
||||
{
|
||||
CurrentUser = currentUser;
|
||||
}
|
||||
|
||||
public override async Task<string?> GetOrNullAsync(SettingDefinition setting)
|
||||
{
|
||||
if (CurrentUser.Id == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return await SettingStore.GetOrNullAsync(setting.Name, Name, CurrentUser.Id.ToString());
|
||||
}
|
||||
|
||||
public Task SetAsync(string name, string value)
|
||||
{
|
||||
return base.SetAsync(name, value, CurrentUser.Id.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
public interface ICurrentUser
|
||||
{
|
||||
Guid? Id { get; }
|
||||
}
|
||||
public class DefaultValueSettingValueProvider : SettingValueProvider
|
||||
{
|
||||
public const string ProviderName = "D";
|
||||
|
||||
public override string Name => ProviderName;
|
||||
|
||||
public DefaultValueSettingValueProvider(SettingManagementStore settingStore)
|
||||
: base(settingStore)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override Task<string?> GetOrNullAsync(SettingDefinition setting)
|
||||
{
|
||||
return Task.FromResult(setting.DefaultValue);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
// public Guid UserId { get; set; }
|
||||
|
||||
public class SettingDefinition
|
||||
{
|
||||
/// <summary>
|
||||
/// Unique name of the setting.
|
||||
/// </summary>
|
||||
[NotNull]
|
||||
public string Name { get; set; }
|
||||
|
||||
public string DisplayName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Default value of the setting.
|
||||
/// </summary>
|
||||
public string? DefaultValue { get; set; }
|
||||
/// <summary>
|
||||
/// A list of allowed providers to get/set value of this setting.
|
||||
/// An empty list indicates that all providers are allowed.
|
||||
/// </summary>
|
||||
public List<string> Providers { get; } = new List<string>();
|
||||
}
|
||||
}
|
||||
|
|
@ -39,40 +39,9 @@ namespace Waste.Domain
|
|||
[SugarColumn(ColumnDescription = "操作员", ColumnDataType = "nvarchar(100)")]
|
||||
public string OpUser { get; set; }
|
||||
/// <summary>
|
||||
/// 消息ID
|
||||
/// 唯一消息ID
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "消息ID", ColumnDataType = "varchar(50)",IndexGroupNameList =new string[] { "index_uuid"})]
|
||||
[SugarColumn(ColumnDescription = "唯一消息ID", ColumnDataType = "varchar(50)",IndexGroupNameList =new string[] { "index_uuid"})]
|
||||
public string UUID { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 设备出厂序列号/设备出厂编号
|
||||
/// </summary>
|
||||
public string DeviceFacEcode { get; set; }
|
||||
/// <summary>
|
||||
/// 车牌号/物品编码/垃圾桶编号
|
||||
/// </summary>
|
||||
public string Registration { get; set; }
|
||||
/// <summary>
|
||||
/// 毛重,KG
|
||||
/// </summary>
|
||||
public string GrossWeight { get; set; }
|
||||
/// <summary>
|
||||
/// 皮重,KG
|
||||
/// </summary>
|
||||
public string Tare { get; set; }
|
||||
/// <summary>
|
||||
/// 净重,KG
|
||||
/// </summary>
|
||||
public string NetWeight { get; set; }
|
||||
public string ID1 { get; set; }
|
||||
public string ID2 { get; set; }
|
||||
public string ID3 { get; set; }
|
||||
public string ID4 { get; set; }
|
||||
public string ID5 { get; set; }
|
||||
public string ID6 { get; set; }
|
||||
public string ID7 { get; set; }
|
||||
public string ID8 { get; set; }
|
||||
public DateTime? CreatedTime { get; set; }
|
||||
public string DataHash { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,170 +0,0 @@
|
|||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Waste.Domain.DataModel
|
||||
{
|
||||
[SugarTable("W_Product")]
|
||||
public partial class W_Product
|
||||
{
|
||||
public W_Product()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// Desc:
|
||||
/// Default:
|
||||
/// Nullable:False
|
||||
/// </summary>
|
||||
[SugarColumn(IsPrimaryKey = true)]
|
||||
public string Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Desc:
|
||||
/// Default:
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
public string UserName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Desc:
|
||||
/// Default:
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
public string Weight { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Desc:
|
||||
/// Default:
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
public string Image { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Desc:
|
||||
/// Default:
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
public string UpperLimit { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Desc:
|
||||
/// Default:
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
public string Unit { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Desc:
|
||||
/// Default:NULL
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
public string TimeStamp { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Desc:
|
||||
/// Default:
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
public string TareWeight { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Desc:
|
||||
/// Default:
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
public string RecordNo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Desc:
|
||||
/// Default:
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
public string ProductNo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Desc:
|
||||
/// Default:
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
public string ProductName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Desc:
|
||||
/// Default:
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
public string ProductId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Desc:
|
||||
/// Default:
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
public string NetWeight { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Desc:
|
||||
/// Default:
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
public string LowerLimit { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Desc:
|
||||
/// Default:
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
public string IdNames { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Desc:
|
||||
/// Default:
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
public string IdValues { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Desc:
|
||||
/// Default:
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
public string Date { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Desc:
|
||||
/// Default:
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
public string DateTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Desc:
|
||||
/// Default:
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
public string Amount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Desc:
|
||||
/// Default:
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
public string Uuid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Desc:
|
||||
/// Default:
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
public string UserId { get; set; }
|
||||
|
||||
public System.DateTime CreateTime { get; set; }
|
||||
|
||||
public string Video { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Waste.OpenApi.Host.Controllers
|
||||
{
|
||||
[ApiController]
|
||||
[Route("open-api/[controller]")]
|
||||
public class ResultController : ControllerBase
|
||||
{
|
||||
}
|
||||
}
|
||||
|
|
@ -1,94 +0,0 @@
|
|||
using Furion;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Serilog;
|
||||
using Serilog.Events;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Waste.OpenApi.Host
|
||||
{
|
||||
public class Program
|
||||
{
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
CreateHostBuilder(args).Build().Run();
|
||||
}
|
||||
|
||||
public static IHostBuilder CreateHostBuilder(string[] args) =>
|
||||
Microsoft.Extensions.Hosting.Host.CreateDefaultBuilder(args)
|
||||
.ConfigureWebHostDefaults(webBuilder =>
|
||||
{
|
||||
webBuilder.Inject()
|
||||
.UseStartup<Startup>()
|
||||
.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
|
||||
.Enrich.WithProperty("Application", typeof(Program).Assembly.GetName().Name)
|
||||
.Enrich.WithProcessId()
|
||||
.Enrich.WithProcessName()
|
||||
.Enrich.WithMachineName()
|
||||
.Enrich.WithEnvironmentUserName()
|
||||
.WriteTo.Seq("http://localhost:5341/")
|
||||
//.MinimumLevel.Debug() // 所有Sink的最小记录级别
|
||||
//.MinimumLevel.Override("Microsoft", LogEventLevel.Fatal)
|
||||
//.Enrich.FromLogContext()
|
||||
.WriteTo.Console(outputTemplate: outputTemplate)
|
||||
|
||||
//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 // 文件字符编码
|
||||
)
|
||||
)
|
||||
;
|
||||
})
|
||||
;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
{
|
||||
"$schema": "http://json.schemastore.org/launchsettings.json",
|
||||
"iisSettings": {
|
||||
"windowsAuthentication": false,
|
||||
"anonymousAuthentication": true,
|
||||
"iisExpress": {
|
||||
"applicationUrl": "http://localhost:54579",
|
||||
"sslPort": 0
|
||||
}
|
||||
},
|
||||
"profiles": {
|
||||
"http": {
|
||||
"commandName": "Project",
|
||||
"dotnetRunMessages": true,
|
||||
"launchBrowser": true,
|
||||
"applicationUrl": "http://localhost:5070",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
},
|
||||
"IIS Express": {
|
||||
"commandName": "IISExpress",
|
||||
"launchBrowser": true,
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,84 +0,0 @@
|
|||
using Furion;
|
||||
using Microsoft.AspNetCore.DataProtection;
|
||||
using Microsoft.AspNetCore.Mvc.ViewFeatures;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Nirvana.Common;
|
||||
using Serilog;
|
||||
using System.Text;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using Furion.DependencyInjection;
|
||||
using System;
|
||||
using Waste.Domain;
|
||||
|
||||
namespace Waste.OpenApi.Host
|
||||
{
|
||||
public class Startup// : AppStartup
|
||||
{
|
||||
public void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
var configuration = App.Configuration;
|
||||
|
||||
|
||||
|
||||
|
||||
services.AddControllers(options =>
|
||||
{
|
||||
options.EnableEndpointRouting = true;
|
||||
}).AddInject();
|
||||
|
||||
|
||||
#region 注入获取IP
|
||||
services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>();
|
||||
MyHttpContext.serviceCollection = services;
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
||||
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
|
||||
{
|
||||
//启用 GB2312(按需)
|
||||
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
|
||||
if (env.IsDevelopment())
|
||||
{
|
||||
app.UseDeveloperExceptionPage();
|
||||
}
|
||||
|
||||
|
||||
// 或者更多配置
|
||||
// app.UseUnifyResultStatusCodes(options => { options.Return200StatusCodes = new [] { 401, 403 }; });
|
||||
//允许body重用
|
||||
app.Use(next => context =>
|
||||
{
|
||||
context.Request.EnableBuffering();
|
||||
return next(context);
|
||||
});
|
||||
|
||||
app.UseStaticFiles();
|
||||
// 必须在 UseStaticFiles 和 UseRouting 之间,记录请求日志
|
||||
app.UseRouting();
|
||||
|
||||
|
||||
// app.UseAuthentication();
|
||||
app.UseAuthorization();
|
||||
|
||||
app.UseInject();
|
||||
|
||||
|
||||
app.UseEndpoints(endpoints =>
|
||||
{
|
||||
endpoints.MapControllerRoute(
|
||||
name: "default",
|
||||
pattern: "{controller=Home}/{action=Index}/{id?}");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public class CurrentUser : ICurrentUser, ITransient
|
||||
{
|
||||
public Guid? Id => null;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Serilog.Enrichers.Process" Version="2.0.2" />
|
||||
<PackageReference Include="Serilog.Sinks.Seq" Version="5.0.1" />
|
||||
<PackageReference Include="Serilog.Enrichers.Environment" Version="2.3.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Waste.Domain\Waste.Domain.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft.AspNetCore": "Warning"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft.AspNetCore": "Warning"
|
||||
}
|
||||
},
|
||||
"AllowedHosts": "*",
|
||||
"Serilog": {
|
||||
"MinimumLevel": {
|
||||
"Default": "Information",
|
||||
"Override": {
|
||||
"System": "Warning",
|
||||
"Microsoft": "Warning",
|
||||
"Microsoft.Hosting.Lifetime": "Warning",
|
||||
"Microsoft.EntityFrameworkCore": "Warning"
|
||||
}
|
||||
}
|
||||
},
|
||||
"logfile": "d:/errlog/waste.ybhdmob.com", //日志文件路径
|
||||
"NirvanaConnection": "Server=localhost,4331;Database=waste;uid=jutian_user;pwd=jutian1qaz@WSX;"
|
||||
}
|
||||
|
|
@ -11,7 +11,6 @@ namespace Waste.SocketService
|
|||
/// </summary>
|
||||
public class MyPackage: A8Package
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 固定头
|
||||
/// </summary>
|
||||
|
|
@ -21,7 +20,7 @@ namespace Waste.SocketService
|
|||
/// </summary>
|
||||
public int Len { get; set; } = 0;
|
||||
/// <summary>
|
||||
/// IMEI/设备编号
|
||||
/// IMEI
|
||||
/// </summary>
|
||||
public string IMEI { get; set; } = "";
|
||||
/// <summary>
|
||||
|
|
@ -84,8 +83,6 @@ namespace Waste.SocketService
|
|||
/// 是否为有效测量
|
||||
/// </summary>
|
||||
public bool IsWeight { get; set; } = false;
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -117,35 +114,5 @@ namespace Waste.SocketService
|
|||
/// 操作员
|
||||
/// </summary>
|
||||
public string OpUser { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// 设备出厂序列号/设备出厂编号
|
||||
/// </summary>
|
||||
public string DeviceFacEcode { get; set; }
|
||||
/// <summary>
|
||||
/// 车牌号/物品编码/垃圾桶编号
|
||||
/// </summary>
|
||||
public string Registration { get; set; }
|
||||
/// <summary>
|
||||
/// 毛重,KG
|
||||
/// </summary>
|
||||
public string GrossWeight { get; set; }
|
||||
/// <summary>
|
||||
/// 皮重,KG
|
||||
/// </summary>
|
||||
public string Tare { get; set; }
|
||||
/// <summary>
|
||||
/// 净重,KG
|
||||
/// </summary>
|
||||
public string NetWeight { get; set; }
|
||||
public string ID1 { get; set; }
|
||||
public string ID2 { get; set; }
|
||||
public string ID3 { get; set; }
|
||||
public string ID4 { get; set; }
|
||||
public string ID5 { get; set; }
|
||||
public string ID6 { get; set; }
|
||||
public string ID7 { get; set; }
|
||||
public string ID8 { get; set; }
|
||||
public string DataHash { get; set; } = "";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -77,16 +77,15 @@ namespace Waste.SocketService
|
|||
/// </summary>
|
||||
/// <param name="bt"></param>
|
||||
/// <returns></returns>
|
||||
public static string BytesToString(this byte[] bytes, Encoding enocde)
|
||||
public static string BytesToString(this byte[] bytes)
|
||||
{
|
||||
string returnStr = "";
|
||||
if (bytes != null)
|
||||
{
|
||||
returnStr = enocde.GetString(bytes);
|
||||
returnStr = Encoding.GetEncoding("GB2312").GetString(bytes);
|
||||
}
|
||||
return returnStr;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 字节数据转中文
|
||||
/// </summary>
|
||||
|
|
@ -187,14 +186,10 @@ namespace Waste.SocketService
|
|||
var package = new MyPackage();
|
||||
var _reader = reader;
|
||||
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
|
||||
var GB2312 = Encoding.GetEncoding("GB2312");
|
||||
var UTF8 = Encoding.UTF8;
|
||||
package.Str = _reader.ReadString(Encoding.GetEncoding("GB2312"));
|
||||
string key = "";
|
||||
int keylen = 1;
|
||||
|
||||
package.Str = _reader.ReadString(GB2312);
|
||||
|
||||
#region 解析头部
|
||||
#region 解析头部,头部固定为A9
|
||||
if (reader.Length >= 2)
|
||||
{
|
||||
keylen = 2;
|
||||
|
|
@ -203,21 +198,28 @@ namespace Waste.SocketService
|
|||
keys[0] = key1Byte;
|
||||
reader.TryRead(out byte key2Byte);
|
||||
keys[1] = key2Byte;
|
||||
key = keys.BytesToString(GB2312);
|
||||
key = keys.BytesToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
byte[] keys = new byte[1];
|
||||
reader.TryRead(out byte key1Byte);
|
||||
keys[0] = key1Byte;
|
||||
key = keys.BytesToString(GB2312);
|
||||
key = keys.BytesToString();
|
||||
}
|
||||
#endregion
|
||||
|
||||
if (key == "A7")
|
||||
if (key != "A9" && key !="A8")
|
||||
{
|
||||
key = "A8";//全部GB2312的A8
|
||||
return ReadA7(reader, package, key, GB2312);
|
||||
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 if (key == "A8")
|
||||
{
|
||||
|
|
@ -234,7 +236,7 @@ namespace Waste.SocketService
|
|||
{
|
||||
return null;
|
||||
}
|
||||
body = bytes.BytesToString(UTF8).Replace("\r", "").Replace("\n", "");
|
||||
body = bytes.BytesToString().Replace("\r", "").Replace("\n", "");
|
||||
package.Body = bytes.BytesToHexStr();
|
||||
var arr = body.Split('|');
|
||||
#region 心跳包的处理,IMEI|GPS
|
||||
|
|
@ -255,7 +257,7 @@ namespace Waste.SocketService
|
|||
package.ICCID = arr[0];
|
||||
package.IMEI = arr[1];
|
||||
package.IMSI = arr[2];
|
||||
var gslq = GB2312.GetBytes(arr[3]);
|
||||
var gslq = Encoding.GetEncoding("GB2312").GetBytes(arr[3]);
|
||||
if (gslq.Length == 2)
|
||||
{
|
||||
package.GSLQ = Convert.ToInt32(gslq[1]).ToString();
|
||||
|
|
@ -271,7 +273,7 @@ namespace Waste.SocketService
|
|||
package.ICCID = arr[0];
|
||||
package.IMEI = arr[1];
|
||||
package.IMSI = arr[2];
|
||||
var gslq = GB2312.GetBytes(arr[3]);
|
||||
var gslq = Encoding.GetEncoding("GB2312").GetBytes(arr[3]);
|
||||
if (gslq.Length == 2)
|
||||
{
|
||||
package.GSLQ = Convert.ToInt32(gslq[1]).ToString();
|
||||
|
|
@ -282,11 +284,17 @@ namespace Waste.SocketService
|
|||
}
|
||||
package.Time = $"{arr[4]}{arr[5]}".Replace("-", "").Replace(":", "");
|
||||
//uuid@datetime@垃圾类型@子类@重量@价格@金额@操作员
|
||||
//package.Str = _reader.ReadString(Encoding.UTF8);
|
||||
var measurearr = arr[6].Split('@');
|
||||
var measurearr =Encoding.UTF8.GetString(Encoding.GetEncoding("GB2312").GetBytes(arr[6])).Split('@');
|
||||
if (measurearr.Length == 8)
|
||||
{
|
||||
Read(package, measurearr);
|
||||
package.UUID = measurearr[0];
|
||||
package.UploadTime = measurearr[1];
|
||||
package.WasteType = measurearr[2];
|
||||
package.WasteSType = measurearr[3];
|
||||
package.Weight = measurearr[4];
|
||||
package.Price = measurearr[5];
|
||||
package.Amount = measurearr[6];
|
||||
package.OpUser = measurearr[7];
|
||||
package.IsWeight = true;
|
||||
}
|
||||
else
|
||||
|
|
@ -296,12 +304,9 @@ namespace Waste.SocketService
|
|||
|
||||
}
|
||||
#endregion
|
||||
return package;
|
||||
}
|
||||
|
||||
else if (key == "A9")
|
||||
else
|
||||
{
|
||||
//package.Str = _reader.ReadString(GB2312);
|
||||
package.Key = key;
|
||||
package.Len = (int)reader.Length - 2;
|
||||
string body = "";
|
||||
|
|
@ -315,7 +320,7 @@ namespace Waste.SocketService
|
|||
{
|
||||
return null;
|
||||
}
|
||||
body = bytes.BytesToString(GB2312).Replace("\r", "").Replace("\n", "");
|
||||
body = bytes.BytesToString().Replace("\r", "").Replace("\n", "");
|
||||
package.Body = bytes.BytesToHexStr();
|
||||
var arr = body.Split('|');
|
||||
#region 心跳包的处理,IMEI|GPS
|
||||
|
|
@ -336,7 +341,7 @@ namespace Waste.SocketService
|
|||
package.ICCID = arr[0];
|
||||
package.IMEI = arr[1];
|
||||
package.IMSI = arr[2];
|
||||
var gslq = GB2312.GetBytes(arr[3]);
|
||||
var gslq = Encoding.GetEncoding("GB2312").GetBytes(arr[3]);
|
||||
if (gslq.Length == 2)
|
||||
{
|
||||
package.GSLQ = Convert.ToInt32(gslq[1]).ToString();
|
||||
|
|
@ -352,7 +357,7 @@ namespace Waste.SocketService
|
|||
package.ICCID = arr[0];
|
||||
package.IMEI = arr[1];
|
||||
package.IMSI = arr[2];
|
||||
var gslq = GB2312.GetBytes(arr[3]);
|
||||
var gslq = Encoding.GetEncoding("GB2312").GetBytes(arr[3]);
|
||||
if (gslq.Length == 2)
|
||||
{
|
||||
package.GSLQ = Convert.ToInt32(gslq[1]).ToString();
|
||||
|
|
@ -363,7 +368,7 @@ namespace Waste.SocketService
|
|||
}
|
||||
package.Time = $"{arr[4]}{arr[5]}".Replace("-", "").Replace(":", "");
|
||||
//厨余垃圾/大桶@垃圾桶编号@厨余垃圾@7.91
|
||||
var b = GB2312.GetBytes(arr[6]);
|
||||
var b = Encoding.GetEncoding("GB2312").GetBytes(arr[6]);
|
||||
if (b.Length > 23)
|
||||
{
|
||||
byte[] tbyte = new byte[1]; //桶类型
|
||||
|
|
@ -393,9 +398,9 @@ namespace Waste.SocketService
|
|||
var thex = tbyte.BytesToHexStr();
|
||||
var codehex = codebyte.BytesToHexStr();
|
||||
var typehex = typebyte.BytesToHexStr();
|
||||
var typestr = typebyte.BytesToString(GB2312);
|
||||
var typestr = typebyte.BytesToString();
|
||||
var whex = wbyte.BytesToHexStr();
|
||||
var wstr = wbyte.BytesToString(GB2312);
|
||||
var wstr = wbyte.BytesToString();
|
||||
package.size = thex.Replace(" ", "");
|
||||
package.trashcode = codehex.Replace(" ", "").HextToDec().ToString();
|
||||
package.WasteType = typestr;
|
||||
|
|
@ -409,143 +414,14 @@ namespace Waste.SocketService
|
|||
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
return package;
|
||||
}
|
||||
else
|
||||
{
|
||||
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;
|
||||
return package;
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"数据处理发生异常:{ex.Message}");
|
||||
return new MyPackage();
|
||||
}
|
||||
}
|
||||
|
||||
private static MyPackage ReadA7(SequenceReader<byte> reader, MyPackage package, string key, Encoding encoding)
|
||||
{
|
||||
//package.Str = reader.ReadString(encoding);
|
||||
|
||||
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(encoding).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 && string.IsNullOrEmpty(arr[6]))
|
||||
{
|
||||
package.IsHeart = true;
|
||||
package.ICCID = arr[0];
|
||||
package.IMEI = arr[1];
|
||||
package.IMSI = arr[2];
|
||||
var gslq = encoding.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];
|
||||
package.IMEI = arr[1];
|
||||
package.IMSI = arr[2];
|
||||
var gslq = encoding.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(":", "");
|
||||
//uuid@datetime@垃圾类型@子类@重量@价格@金额@操作员
|
||||
var measurearr = arr[6].Split('@');
|
||||
|
||||
//uuid@垃圾类型@子类@重量@单价@金额@操作员@物品编码@毛重@皮重@ID1@ID2@ID3@ID4@ID5@ID6@ID7@ID8\r\n
|
||||
if (measurearr.Length == 18)
|
||||
{
|
||||
|
||||
package.UUID = measurearr[0];
|
||||
package.WasteType = measurearr[1];
|
||||
package.WasteSType = measurearr[2];
|
||||
package.Weight = measurearr[3];
|
||||
package.Price = measurearr[4];
|
||||
package.Amount = measurearr[5];
|
||||
package.OpUser = measurearr[6];
|
||||
package.Registration = measurearr[7];
|
||||
package.GrossWeight = measurearr[8];
|
||||
package.Tare = measurearr[9];
|
||||
package.ID1 = measurearr[10];
|
||||
package.ID2 = measurearr[11];
|
||||
package.ID3 = measurearr[12];
|
||||
package.ID4 = measurearr[13];
|
||||
package.ID5 = measurearr[14];
|
||||
package.ID6 = measurearr[15];
|
||||
package.ID7 = measurearr[16];
|
||||
package.ID8 = measurearr[17];
|
||||
|
||||
package.IsWeight = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
package.size = arr[6];
|
||||
}
|
||||
|
||||
}
|
||||
#endregion
|
||||
return package;
|
||||
}
|
||||
|
||||
private static void Read(MyPackage package, string[] measurearr)
|
||||
{
|
||||
package.UUID = measurearr[0];
|
||||
package.UploadTime = measurearr[1];
|
||||
package.WasteType = measurearr[2];
|
||||
package.WasteSType = measurearr[3];
|
||||
package.Weight = measurearr[4];
|
||||
package.Price = measurearr[5];
|
||||
package.Amount = measurearr[6];
|
||||
package.OpUser = measurearr[7];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@ using System.Collections.Generic;
|
|||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Furion.DataEncryption.Extensions;
|
||||
|
||||
namespace Waste.SocketService
|
||||
{
|
||||
|
|
@ -39,10 +38,6 @@ namespace Waste.SocketService
|
|||
new string('-', 50);//输出模板
|
||||
//1.输出所有restrictedToMinimumLevel:LogEventLevel类型
|
||||
config
|
||||
.Enrich.WithProperty("Application", typeof(Program).Assembly.GetName().Name)
|
||||
.Enrich.WithProcessId()
|
||||
.Enrich.WithProcessName()
|
||||
.WriteTo.Console()
|
||||
.WriteTo.Seq("http://localhost:5341/")
|
||||
|
||||
//2.1仅输出 LogEventLevel.Debug 类型
|
||||
|
|
@ -103,11 +98,7 @@ namespace Waste.SocketService
|
|||
opt.Password = configuration["RabbitmqSetting:Password"];//配置Miami
|
||||
});
|
||||
//配置sqlserver支持
|
||||
x.UseSqlServer(x =>
|
||||
{
|
||||
x.ConnectionString = configuration["RabbitmqSetting:DBConnection"];
|
||||
x.Schema = "cap_s";
|
||||
});
|
||||
x.UseSqlServer(configuration["RabbitmqSetting:DBConnection"]);
|
||||
x.SucceedMessageExpiredAfter = 3600;
|
||||
});
|
||||
})
|
||||
|
|
@ -122,7 +113,7 @@ namespace Waste.SocketService
|
|||
var _logger = services.GetService<ILogger>();
|
||||
if (package.IsChecked)
|
||||
{
|
||||
string msg = $"通过校检,Key:{package.Key}十六进制:{package.Body},字符串:{package.Str}";
|
||||
string msg = $"通过校检,十六进制:{package.Body},字符串:{package.Str}";
|
||||
if (package.IsHeart)
|
||||
{
|
||||
msg = $"{msg},心跳包数据,{(package == null ? "" : JsonConvert.SerializeObject(package))}";
|
||||
|
|
@ -149,22 +140,13 @@ namespace Waste.SocketService
|
|||
_logger.Information(msg);
|
||||
if (package.Key == "A8")
|
||||
{
|
||||
package.DataHash = $"{package.Str}".ToMD5Encrypt();
|
||||
await _capBus.PublishAsync("result.service.inserta84g", package);
|
||||
if (!session.Channel.IsClosed)
|
||||
{
|
||||
if (package.IsHeart)
|
||||
{
|
||||
string returndata = $"HEART,SIGNAL,{package.GSLQ}";
|
||||
await session.SendAsync(Encoding.GetEncoding("GB2312").GetBytes(returndata + "\r\n"));
|
||||
}
|
||||
else if (package.IsWeight)
|
||||
{
|
||||
string returndata = $"STATUS,OK,{package.UUID}";
|
||||
await session.SendAsync(Encoding.GetEncoding("GB2312").GetBytes(returndata + "\r\n"));
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
await _capBus.PublishAsync("result.service.insert4g", package);
|
||||
|
|
@ -172,7 +154,7 @@ namespace Waste.SocketService
|
|||
}
|
||||
else
|
||||
{
|
||||
_logger.Information($"未通过校检,Key:{package.Key},十六进制:{package.Body},字符串:{package.Str}");
|
||||
_logger.Information($"未通过校检,十六进制:{package.Body},字符串:{package.Str}");
|
||||
}
|
||||
});
|
||||
})
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
|
|||
-->
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<History>True|2024-12-26T01:10:06.2433590Z||;True|2024-12-25T18:25:15.3622768+08:00||;True|2024-12-25T18:21:11.3533614+08:00||;False|2024-12-25T18:21:00.0512342+08:00||;True|2024-12-25T18:02:00.9343947+08:00||;True|2024-12-25T18:01:38.8672132+08:00||;True|2024-12-25T17:53:52.8116954+08:00||;True|2024-12-25T17:26:12.9040139+08:00||;True|2024-12-25T16:29:14.2739005+08:00||;True|2024-12-24T17:39:06.2503701+08:00||;True|2024-12-20T16:45:57.1905101+08:00||;True|2024-12-20T16:42:08.5174447+08:00||;True|2024-12-20T14:34:40.0312353+08:00||;True|2024-12-20T14:34:29.9878081+08:00||;True|2024-12-20T14:30:12.8940480+08:00||;False|2024-12-20T14:29:53.4324255+08:00||;True|2024-12-20T14:01:11.5986756+08:00||;True|2024-12-20T14:01:08.2479019+08:00||;True|2024-12-20T13:54:01.8966259+08:00||;True|2024-12-20T13:51:45.5298413+08:00||;True|2024-12-20T13:51:05.5206640+08:00||;True|2024-12-20T13:50:15.0489021+08:00||;True|2024-12-20T11:57:56.6476092+08:00||;True|2024-12-20T11:45:26.1507642+08:00||;True|2024-12-20T11:24:57.9651646+08:00||;True|2024-12-18T09:55:33.7744752+08:00||;True|2022-06-24T11:02:53.2509336+08:00||;True|2022-06-21T16:12:12.0351728+08:00||;True|2022-06-21T16:02:10.4631892+08:00||;True|2022-06-21T15:53:41.4845069+08:00||;True|2022-06-21T14:07:12.5956345+08:00||;True|2022-06-18T11:30:52.8509064+08:00||;True|2022-06-18T11:12:53.8211499+08:00||;True|2022-06-18T11:11:56.6483268+08:00||;True|2022-06-18T10:40:35.8822373+08:00||;True|2022-05-17T17:19:03.8993888+08:00||;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>
|
||||
<LastFailureDetails />
|
||||
<History>True|2022-06-21T06:07:12.5956345Z;True|2022-06-18T11:30:52.8509064+08:00;True|2022-06-18T11:12:53.8211499+08:00;True|2022-06-18T11:11:56.6483268+08:00;True|2022-06-18T10:40:35.8822373+08:00;True|2022-05-17T17:19:03.8993888+08:00;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>
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk.Worker">
|
||||
<Project Sdk="Microsoft.NET.Sdk.Worker">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
|
|
@ -17,7 +17,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.Enrichers.Process" Version="2.0.2" />
|
||||
<PackageReference Include="Serilog.Sinks.Seq" Version="5.1.0" />
|
||||
<PackageReference Include="SuperSocket" Version="2.0.0-beta.10" />
|
||||
</ItemGroup>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<_LastSelectedProfileId>E:\liuzl_ybhdmob\巨天垃圾分类\Waste\Waste.SocketService.cs\Properties\PublishProfiles\FolderProfile.pubxml</_LastSelectedProfileId>
|
||||
<_LastSelectedProfileId>H:\liuzl_ybhdmob\Waste\Waste.SocketService.cs\Properties\PublishProfiles\FolderProfile.pubxml</_LastSelectedProfileId>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
|
|
@ -50,7 +50,6 @@ namespace Waste.Web.Core
|
|||
//配置sqlserver支持
|
||||
x.UseSqlServer(configuration["RabbitmqSetting:DBConnection"]);
|
||||
x.SucceedMessageExpiredAfter = 3600;
|
||||
x.UseDashboard();
|
||||
});
|
||||
|
||||
}
|
||||
|
|
@ -90,10 +89,10 @@ namespace Waste.Web.Core
|
|||
//启用 GB2312(按需)
|
||||
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
|
||||
app.UseSession();
|
||||
//if (env.IsDevelopment())
|
||||
//{
|
||||
// app.UseDeveloperExceptionPage();
|
||||
//}
|
||||
if (env.IsDevelopment())
|
||||
{
|
||||
app.UseDeveloperExceptionPage();
|
||||
}
|
||||
|
||||
// 添加规范化结果状态码,需要在这里注册
|
||||
app.UseUnifyResultStatusCodes();
|
||||
|
|
|
|||
|
|
@ -1,16 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<key id="80becbe4-b8da-478f-8e04-2ee72229ce40" version="1">
|
||||
<creationDate>2023-06-26T04:03:32.1101352Z</creationDate>
|
||||
<activationDate>2023-06-26T04:03:32.0644029Z</activationDate>
|
||||
<expirationDate>2023-09-24T04:03:32.0644029Z</expirationDate>
|
||||
<descriptor deserializerType="Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Version=5.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60">
|
||||
<descriptor>
|
||||
<encryption algorithm="AES_256_CBC" />
|
||||
<validation algorithm="HMACSHA256" />
|
||||
<masterKey p4:requiresEncryption="true" xmlns:p4="http://schemas.asp.net/2015/03/dataProtection">
|
||||
<!-- Warning: the key below is in an unencrypted form. -->
|
||||
<value>ANfcQR1Xd4K1vIjHAszafBN+8YUKKjIPVRAtivcWhALy3lpclGIiHHZo0Ya4u2hcIV+3+1yfaeqrBBnIxtzQ6A==</value>
|
||||
</masterKey>
|
||||
</descriptor>
|
||||
</descriptor>
|
||||
</key>
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<key id="869b1552-1a5b-4a99-97b5-a70c2eac85e2" version="1">
|
||||
<creationDate>2022-07-07T06:28:07.0933768Z</creationDate>
|
||||
<activationDate>2022-07-07T06:28:06.9620155Z</activationDate>
|
||||
<expirationDate>2022-10-05T06:28:06.9620155Z</expirationDate>
|
||||
<descriptor deserializerType="Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Version=5.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60">
|
||||
<descriptor>
|
||||
<encryption algorithm="AES_256_CBC" />
|
||||
<validation algorithm="HMACSHA256" />
|
||||
<masterKey p4:requiresEncryption="true" xmlns:p4="http://schemas.asp.net/2015/03/dataProtection">
|
||||
<!-- Warning: the key below is in an unencrypted form. -->
|
||||
<value>kU9UPKcrCVSuWhJsfD12pzasGI+AmK5pcwg4WCtL4Ruk6hakqYjHsB3cg+AwfecKQXHboEZ3gaNrVJuO66M1Jw==</value>
|
||||
</masterKey>
|
||||
</descriptor>
|
||||
</descriptor>
|
||||
</key>
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<key id="8bb4cac3-1d12-401d-83b9-3fd48e11a10f" version="1">
|
||||
<creationDate>2025-03-20T05:35:34.3500923Z</creationDate>
|
||||
<activationDate>2025-03-20T05:35:34.2930103Z</activationDate>
|
||||
<expirationDate>2025-06-18T05:35:34.2930103Z</expirationDate>
|
||||
<descriptor deserializerType="Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Version=5.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60">
|
||||
<descriptor>
|
||||
<encryption algorithm="AES_256_CBC" />
|
||||
<validation algorithm="HMACSHA256" />
|
||||
<masterKey p4:requiresEncryption="true" xmlns:p4="http://schemas.asp.net/2015/03/dataProtection">
|
||||
<!-- Warning: the key below is in an unencrypted form. -->
|
||||
<value>TvqtBOO7y3sR/Iok1jz9b14w6ZihrCPOvEUrHyqFKQ6QXDja6MpYBfScz80fpGToEkvdnxDUOtxH1g8pxWTrGw==</value>
|
||||
</masterKey>
|
||||
</descriptor>
|
||||
</descriptor>
|
||||
</key>
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<key id="990d58c2-bb18-4ec6-901c-0391a76bfa2f" version="1">
|
||||
<creationDate>2024-12-13T07:11:41.6846536Z</creationDate>
|
||||
<activationDate>2024-12-13T07:11:41.630637Z</activationDate>
|
||||
<expirationDate>2025-03-13T07:11:41.630637Z</expirationDate>
|
||||
<descriptor deserializerType="Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Version=5.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60">
|
||||
<descriptor>
|
||||
<encryption algorithm="AES_256_CBC" />
|
||||
<validation algorithm="HMACSHA256" />
|
||||
<masterKey p4:requiresEncryption="true" xmlns:p4="http://schemas.asp.net/2015/03/dataProtection">
|
||||
<!-- Warning: the key below is in an unencrypted form. -->
|
||||
<value>tAYzBIDvWqs5fqO3vv3lFKJKUGxc/smu8Rp7Vs4BRG+fKqHEVyBqnj9Q5nkj+qczAJOgmsn1MuET3TcG5zluOQ==</value>
|
||||
</masterKey>
|
||||
</descriptor>
|
||||
</descriptor>
|
||||
</key>
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<key id="c2bee2c8-4c80-40e0-802c-5f5a51ff95d1" version="1">
|
||||
<creationDate>2023-11-06T09:29:17.0142323Z</creationDate>
|
||||
<activationDate>2023-11-06T09:29:16.9516438Z</activationDate>
|
||||
<expirationDate>2024-02-04T09:29:16.9516438Z</expirationDate>
|
||||
<descriptor deserializerType="Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Version=5.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60">
|
||||
<descriptor>
|
||||
<encryption algorithm="AES_256_CBC" />
|
||||
<validation algorithm="HMACSHA256" />
|
||||
<masterKey p4:requiresEncryption="true" xmlns:p4="http://schemas.asp.net/2015/03/dataProtection">
|
||||
<!-- Warning: the key below is in an unencrypted form. -->
|
||||
<value>ObJzvr6B6Rz5ZFItThMbbfbTiGATKLJiwa31wlJkcgXomsyU+LEYb2Z5oFipInn7ufXzRnjJbUCj71yk+9PYUA==</value>
|
||||
</masterKey>
|
||||
</descriptor>
|
||||
</descriptor>
|
||||
</key>
|
||||
|
|
@ -6,8 +6,6 @@ using System;
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Furion.DependencyInjection;
|
||||
using Waste.Domain;
|
||||
|
||||
namespace Waste.Web.Entry
|
||||
{
|
||||
|
|
@ -67,9 +65,4 @@ namespace Waste.Web.Entry
|
|||
});
|
||||
}
|
||||
}
|
||||
|
||||
public class CurrentUser : ICurrentUser, ITransient
|
||||
{
|
||||
public Guid? Id => OperatorProvider.Provider.GetCurrent()?.UserId;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,128 +0,0 @@
|
|||
@page
|
||||
@model Waste.Web.Entry.Pages.Device.ProductModel
|
||||
@{
|
||||
ViewData["Title"] = "标准秤列表";
|
||||
}
|
||||
<div class="layui-card">
|
||||
<div class="layui-form layui-card-header layuiadmin-card-header-auto">
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-inline">
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" class="layui-input" name="Name" id="Name" placeholder="请输入产品名称" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<button class="btn btn-primary btn-lg js-search" type="button">查询</button>
|
||||
@*<button class="btn btn-primary btn-lg js-add" type="button">添加</button> *@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-card-body">
|
||||
<table class="layui-table" id="list" lay-filter="list">
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
@section Scripts {
|
||||
<script type="text/javascript">
|
||||
layui.use(['common'], function () {
|
||||
var common = layui.common;
|
||||
common.initTable({
|
||||
url: '/api/open/getproduct', method: 'post',
|
||||
cols: [[
|
||||
{
|
||||
field: 'image', title: '图片',templet: function(d) { // 自定义渲染逻辑
|
||||
return '<img src="' + d.image + '" style="width: 50px; height: 50px;">';
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'video', title: '视频'
|
||||
},
|
||||
{
|
||||
field: 'productname', title: '产品名称'
|
||||
},
|
||||
{
|
||||
field: 'netweight', title: '净重'
|
||||
},
|
||||
{
|
||||
field: 'weight', title: '毛重'
|
||||
},
|
||||
{
|
||||
field: 'amount', title: '数量'
|
||||
},
|
||||
{
|
||||
field: 'unit', title: '重量单位'
|
||||
},
|
||||
{
|
||||
field: 'idvalues', title: '单价@总价'
|
||||
},
|
||||
{
|
||||
field: 'upperlimit', title: '上限'
|
||||
},
|
||||
{
|
||||
field: 'username', title: '用户名称'
|
||||
},
|
||||
{
|
||||
field: 'createtime', title: '创建时间'
|
||||
},
|
||||
{
|
||||
field: 'id', // 改为绑定id字段
|
||||
title: '操作',
|
||||
templet: function(d) {
|
||||
return `<a class="layui-btn layui-btn-danger layui-btn-xs"
|
||||
onclick="deleteProduct('${d.id}')">删除</a>`;
|
||||
}
|
||||
}
|
||||
]],
|
||||
parseData: function(n) {
|
||||
console.log("接口返回的原始数据:", n);
|
||||
return {
|
||||
data: n.items, // 数据列表在 n.Items 中
|
||||
totalnum: n.totalnum, // 数据总数在 n.totalnum 中
|
||||
statuscode: 200
|
||||
};
|
||||
},
|
||||
});
|
||||
$(".js-search").on("click", function () {
|
||||
common.reloadtable("list", {
|
||||
where: {
|
||||
queryParam: [{
|
||||
"Name": 'ProductName',
|
||||
"Type": QueryCond.Like,
|
||||
"Value": $("#Name").val()
|
||||
}]
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
// 删除函数
|
||||
function deleteProduct(id) {
|
||||
layer.confirm('确认删除这条记录?', { icon: 3 }, function() {
|
||||
$.post('/api/open/deleteproduct', { id: id }, function(res) {
|
||||
if (res.status.code === 1) {
|
||||
layer.msg('删除成功', { icon: 1 });
|
||||
layui.common.reloadtable("list"); // 刷新表格
|
||||
} else {
|
||||
layer.msg(res.status.message, { icon: 2 });
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
function deleteProduct(id) {
|
||||
layer.confirm('确认删除这条记录?', { icon: 3 }, function() {
|
||||
$.post('/api/open/deleteproduct', { id: id }, function(res) {
|
||||
// 修改点:直接使用 res.code 和 res.message
|
||||
if (res.code === 0) { // 注意这里判断的是 0(成功)
|
||||
layer.msg('删除成功', { icon: 1 });
|
||||
layui.common.reloadtable("list");
|
||||
} else {
|
||||
layer.msg(res.message || '删除失败', { icon: 2 });
|
||||
}
|
||||
}).fail(function() {
|
||||
layer.msg('请求失败,请检查网络', { icon: 2 });
|
||||
});
|
||||
});
|
||||
}
|
||||
</script>
|
||||
}
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using System;
|
||||
using Waste.Application;
|
||||
using Waste.Application.ThirdApiInfo;
|
||||
using Waste.Domain;
|
||||
using Waste.Domain.DataModel;
|
||||
using Nirvana.Common;
|
||||
|
||||
namespace Waste.Web.Entry.Pages.Device
|
||||
{
|
||||
public class ProductModel : BaseModel
|
||||
{
|
||||
public void OnGet()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,97 +0,0 @@
|
|||
@page
|
||||
@model Waste.Web.Entry.Pages.Result.GlobalConfigModel
|
||||
@{
|
||||
ViewData["Title"] = "字段配置";
|
||||
}
|
||||
<div class="layui-card">
|
||||
|
||||
<div class="layui-card-body">
|
||||
<form class="layui-form" action="" style="text-align:center">
|
||||
@foreach (var item in Model.Column)
|
||||
{
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">@item.SystemTitle</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="@item.Name" lay-verify="required" value="@item.Title" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<input type="checkbox" name="show-@item.Name" title="" checked="@item.IsShow">
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-input-block">
|
||||
<button type="submit" class="layui-btn" lay-submit lay-filter="demo1">更新</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@section Scripts
|
||||
{
|
||||
<script type="text/javascript">
|
||||
layui.use(['form', 'util'], function () {
|
||||
var form = layui.form;
|
||||
var layer = layui.layer;
|
||||
var util = layui.util;
|
||||
|
||||
|
||||
|
||||
|
||||
// 提交事件
|
||||
form.on('submit(demo1)', function (data) {
|
||||
var field = data.field; // 获取表单字段值
|
||||
// 显示填写结果,仅作演示用
|
||||
// layer.alert(JSON.stringify(field), {
|
||||
// title: '当前填写的字段值'
|
||||
// });
|
||||
|
||||
const arr = [];
|
||||
for (const property in field) {
|
||||
if (!property.startsWith('show-')) {
|
||||
arr.push({ Name: property, Title: field[property], IsShow: field['show-' + property] == 'on' })
|
||||
}
|
||||
}
|
||||
$.ajax({
|
||||
url: "?handler=UpdateConfig",
|
||||
type: "post",
|
||||
dataType: "json",
|
||||
data: JSON.stringify(arr),
|
||||
contentType: "application/json;charset=utf-8",
|
||||
success: function (res) {
|
||||
|
||||
|
||||
},
|
||||
complete: function () {
|
||||
layer.msg('更新成功');
|
||||
},
|
||||
fail: function (res) {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
return false; // 阻止默认 form 跳转
|
||||
});
|
||||
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
<style>
|
||||
.layui-form-label {
|
||||
width: 100px !important;
|
||||
}
|
||||
|
||||
.layui-form-checkbox i {
|
||||
border-left: 1px solid #d2d2d2;
|
||||
}
|
||||
|
||||
.layui-form-item{
|
||||
margin-bottom: 0px !important;
|
||||
}
|
||||
</style>
|
||||
}
|
||||
|
|
@ -1,43 +0,0 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
|
||||
namespace Waste.Web.Entry.Pages.Result
|
||||
{
|
||||
public class GlobalConfigModel : PageModel
|
||||
{
|
||||
private readonly ResultColumnConfigService columnConfigService;
|
||||
|
||||
public GlobalConfigModel(ResultColumnConfigService columnConfigService)
|
||||
{
|
||||
this.columnConfigService = columnConfigService;
|
||||
}
|
||||
|
||||
public async Task OnGetAsync()
|
||||
{
|
||||
Column = (await columnConfigService.GetGlobalColumn()).Select(x => new GlobalColumnConfigOutput
|
||||
{
|
||||
SystemTitle = ResultColumnConfigService.SystemColumn[x.Name],
|
||||
Name = x.Name,
|
||||
Title = x.Title,
|
||||
IsShow = x.IsShow
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public async Task<IActionResult> OnPostUpdateConfigAsync([FromBody] List<GlobalColumnConfig> input)
|
||||
{
|
||||
await columnConfigService.WriteGlobalConfig(input);
|
||||
//await service.UpdateAccountConfig(Baseuser.UserId, config);
|
||||
return Content("ok");
|
||||
}
|
||||
|
||||
public IEnumerable<GlobalColumnConfigOutput> Column { get; set; }
|
||||
public class GlobalColumnConfigOutput : GlobalColumnConfig
|
||||
{
|
||||
public string SystemTitle { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -21,16 +21,6 @@
|
|||
<input type="text" class="layui-input" name="Name" id="Name" placeholder="请输入设备名称" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<div class="layui-input-inline">
|
||||
<select id="poststatus">
|
||||
<option value="">请选择状态</option>
|
||||
<option value="-1">未上报</option>
|
||||
<option value="0">上报失败</option>
|
||||
<option value="1">上报成功</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<button class="btn btn-primary btn-lg js-search" type="button">查询</button>
|
||||
<button class="btn btn-primary btn-lg js-add" type="button">添加</button>
|
||||
|
|
@ -58,22 +48,6 @@
|
|||
@section Scripts
|
||||
{
|
||||
<script type="text/javascript">
|
||||
let defColumn = @Json.Serialize(Model.DefaultColumn);
|
||||
let oColumn = @Json.Serialize(Model.Column);
|
||||
console.log(defColumn)
|
||||
console.log(oColumn)
|
||||
const column = [];
|
||||
for (const property in defColumn) {
|
||||
console.log(`${property}: ${defColumn[property]}`);
|
||||
const col = {
|
||||
field: property, title: defColumn[property], hide: true
|
||||
};
|
||||
oColumn[property] && (col.hide=false)
|
||||
property == 'poststatus' && (col.templet= '#netstatustpl');
|
||||
column.push(col);
|
||||
}
|
||||
console.log(column)
|
||||
|
||||
layui.use(['common'], function () {
|
||||
var common = layui.common;
|
||||
var queryparam = [];
|
||||
|
|
@ -97,36 +71,63 @@
|
|||
where: {
|
||||
queryParam: queryparam
|
||||
}
|
||||
, cols: [column]
|
||||
, done: function () {
|
||||
// 记录筛选状态
|
||||
const that = this;
|
||||
that.elem.next().on('mousedown', 'input[lay-filter="LAY_TABLE_TOOL_COLS"]+', function () {
|
||||
const input = $(this).prev()[0];
|
||||
console.log('LAY_TABLE_TOOL_COLS', {
|
||||
key: input.name
|
||||
, value: input.checked
|
||||
});
|
||||
|
||||
!input.checked ? (oColumn[input.name] = input.title): (oColumn[input.name]=null)
|
||||
$.ajax({
|
||||
url: "?handler=UpdateAccountConfig",
|
||||
type: "post",
|
||||
dataType: "json",
|
||||
data: JSON.stringify(Object.keys(oColumn).filter(x=>oColumn[x]).map(x=>({name:x,title:oColumn[x]}))),
|
||||
contentType: "application/json;charset=utf-8",
|
||||
success: function (res) {
|
||||
|
||||
, cols: [[
|
||||
{
|
||||
field: 'devicefacecode', title: '设备编号'
|
||||
},
|
||||
complete: function () {
|
||||
|
||||
{
|
||||
field: 'deviceecode', title: '机器码', hide: true
|
||||
},
|
||||
fail: function (res) {
|
||||
|
||||
{
|
||||
field: 'devicename', title: '设备名称'
|
||||
}
|
||||
});
|
||||
});
|
||||
,
|
||||
{
|
||||
field: 'businessname', title: '所属商户'
|
||||
}
|
||||
//,
|
||||
//{
|
||||
// field: 'nettype', title: '联网方式', templet: function (d) {
|
||||
// return DeviceNetType[d.nettype];
|
||||
// }
|
||||
//}
|
||||
,
|
||||
{
|
||||
field: 'wastetype', title: '物品编码'
|
||||
}
|
||||
,
|
||||
{
|
||||
field: 'grossweight', title: '毛重(KG)'
|
||||
}
|
||||
,
|
||||
{
|
||||
field: 'registration', title: '垃圾桶'
|
||||
}
|
||||
,
|
||||
{
|
||||
field: 'tare', title: '皮重(KG)', hide: true
|
||||
}
|
||||
,
|
||||
{
|
||||
field: 'netweight', title: '净重(KG)', hide: true
|
||||
}
|
||||
,
|
||||
{
|
||||
field: 'deviceaddress', title: '地址'
|
||||
}
|
||||
,
|
||||
{
|
||||
field: 'poststatus', title: '状态', templet:'#netstatustpl'
|
||||
}
|
||||
,
|
||||
{
|
||||
field: 'createtime', title: '回收时间'
|
||||
}
|
||||
//,
|
||||
//{
|
||||
// title: '操作', templet: "#optpl"
|
||||
//}
|
||||
]]
|
||||
});
|
||||
$(".js-search").on("click", function () {
|
||||
var queryparam = [{
|
||||
|
|
@ -137,10 +138,6 @@
|
|||
"Name": 'Name',
|
||||
"Type": QueryCond.Like,
|
||||
"Value": $("#Name").val()
|
||||
},{
|
||||
"Name": 'poststatus',
|
||||
"Type": QueryCond.Equal,
|
||||
"Value": $("#poststatus").val()
|
||||
}];
|
||||
var starttime = $("#time").val();
|
||||
if (starttime != "") {
|
||||
|
|
|
|||
|
|
@ -1,17 +1,9 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Furion;
|
||||
using Furion.DatabaseAccessor;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Waste.Application;
|
||||
using Waste.Domain;
|
||||
|
||||
|
||||
namespace Waste.Web.Entry.Pages.Result
|
||||
{
|
||||
|
|
@ -21,44 +13,9 @@ namespace Waste.Web.Entry.Pages.Result
|
|||
public class IndexModel : BaseModel
|
||||
{
|
||||
public string defaulttime = "";
|
||||
|
||||
private readonly ResultColumnConfigService columnConfigService;
|
||||
|
||||
public IndexModel(ResultColumnConfigService columnConfigService)
|
||||
{
|
||||
|
||||
this.columnConfigService = columnConfigService;
|
||||
}
|
||||
|
||||
public async Task OnGetAsync()
|
||||
public void OnGet()
|
||||
{
|
||||
defaulttime = $"{DateTime.Now.Date} ~ {DateTime.Now.Date.AddDays(1).AddSeconds(-1)}";
|
||||
|
||||
|
||||
//var value = await service.GetAccountConfig(Baseuser.UserId);
|
||||
Column = await columnConfigService.GetAccountColumn();
|
||||
|
||||
DefaultColumn = await columnConfigService.GetAccountDefaultColumn();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public async Task<IActionResult> OnPostUpdateAccountConfigAsync([FromBody] List<ColumnConfig> input)
|
||||
{
|
||||
await columnConfigService.WriteAccountConfig(input);
|
||||
//await service.UpdateAccountConfig(Baseuser.UserId, config);
|
||||
return Content("ok");
|
||||
}
|
||||
|
||||
public Dictionary<string, string> Column { get; set; }
|
||||
//private static Dictionary<string, string> EmptyColumn = new Dictionary<string, string>();
|
||||
|
||||
public Dictionary<string, string> DefaultColumn = new Dictionary<string, string>();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,239 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Formats.Asn1;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Furion;
|
||||
using Furion.DependencyInjection;
|
||||
using Furion.JsonSerialization;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Waste.Application;
|
||||
using Waste.Domain;
|
||||
using static Google.Protobuf.WellKnownTypes.Field.Types;
|
||||
|
||||
namespace Waste.Web.Entry.Pages.Result
|
||||
{
|
||||
public class ResultColumnConfigService : ITransient
|
||||
{
|
||||
public const string AccountSettingDefinitionName = "AccountResultColumnConfig";
|
||||
public const string GlobalSettingDefinitionName = "GlobalResultColumnConfig";
|
||||
private readonly ILogger<ResultColumnConfigService> logger;
|
||||
private readonly SettingProvider settingProvider;
|
||||
private readonly UserSettingValueProvider userSettingValueProvider;
|
||||
private readonly GlobalSettingValueProvider globalSettingValueProvider;
|
||||
|
||||
public static readonly Dictionary<string, string> SystemColumn = new Dictionary<string, string>()
|
||||
{
|
||||
{nameof(ResultList.DeviceFacEcode).ToLower(),"设备编号"},
|
||||
{nameof(ResultList.DeviceEcode).ToLower(),"机器码"},
|
||||
{nameof(ResultList.DeviceName).ToLower(),"设备名称"},
|
||||
{nameof(ResultList.BusinessName).ToLower(),"所属商户"},
|
||||
{nameof(ResultList.PostStatus).ToLower(),"状态"},
|
||||
{nameof(ResultList.CreateTime).ToLower(),"回收时间"},
|
||||
{nameof(ResultList.WasteType).ToLower(),"物品编码"},
|
||||
{nameof(ResultList.Registration).ToLower(),"垃圾桶"},
|
||||
{nameof(ResultList.GrossWeight).ToLower(),"毛重(KG)"},
|
||||
{nameof(ResultList.Tare).ToLower(),"皮重(KG)"},
|
||||
{nameof(ResultList.NetWeight).ToLower(),"净重(KG)"},
|
||||
{nameof(ResultList.DeviceAddress).ToLower(),"地址"},
|
||||
{nameof(ResultList.Measure_Price).ToLower(),"单价"},
|
||||
{nameof(ResultList.Measure_Amount).ToLower(),"金额"},
|
||||
{nameof(ResultList.Measure_OpUser).ToLower(),"操作员"},
|
||||
{nameof(ResultList.Measure_UUID).ToLower(),"消息ID"},
|
||||
{nameof(ResultList.Measure_WasteSType).ToLower(),"物品小类"},
|
||||
|
||||
{nameof(ResultList.ID1).ToLower(),"ID1"},
|
||||
{nameof(ResultList.ID2).ToLower(),"ID2"},
|
||||
{nameof(ResultList.ID3).ToLower(),"ID3"},
|
||||
{nameof(ResultList.ID4).ToLower(),"ID4"},
|
||||
{nameof(ResultList.ID5).ToLower(),"ID5"},
|
||||
{nameof(ResultList.ID6).ToLower(),"ID6"},
|
||||
{nameof(ResultList.ID7).ToLower(),"ID7"},
|
||||
{nameof(ResultList.ID8).ToLower(),"ID8"},
|
||||
|
||||
};
|
||||
|
||||
public ResultColumnConfigService(ILogger<ResultColumnConfigService> logger, SettingProvider settingProvider, UserSettingValueProvider userSettingValueProvider, GlobalSettingValueProvider globalSettingValueProvider)
|
||||
{
|
||||
this.logger = logger;
|
||||
this.settingProvider = settingProvider;
|
||||
this.userSettingValueProvider = userSettingValueProvider;
|
||||
this.globalSettingValueProvider = globalSettingValueProvider;
|
||||
}
|
||||
|
||||
private Task<Dictionary<string, string>> GetDefaultColumn()
|
||||
{
|
||||
return Task.FromResult(SystemColumn);
|
||||
}
|
||||
public async Task<Dictionary<string, string>> GetAccountDefaultColumn()
|
||||
{
|
||||
return (await GetGlobalColumn()).Where(x => x.IsShow).ToDictionary(x => x.Name, x => x.Title);
|
||||
}
|
||||
public async Task<List<GlobalColumnConfig>> GetGlobalColumn()
|
||||
{
|
||||
var def = await GetDefaultColumn();
|
||||
var value = await settingProvider.GetOrNullAsync(GlobalSettingDefinitionName);
|
||||
if (string.IsNullOrWhiteSpace(value)) return DefaultList();
|
||||
|
||||
try
|
||||
{
|
||||
var config = JSON.Deserialize<GlobalConfig>(value);
|
||||
if (config.ResultColumn != null && config.ResultColumn.Any())
|
||||
{
|
||||
#region 以系统顺序为准
|
||||
var dic = config.ResultColumn.GroupBy(x => x.Name).ToDictionary(x => x.Key, x => x.First());
|
||||
return def
|
||||
.Select(x =>
|
||||
{
|
||||
if (dic.TryGetValue(x.Key, out var find))
|
||||
{
|
||||
return new GlobalColumnConfig
|
||||
{ Name = x.Key, Title = find.Title, IsShow = find.IsShow };
|
||||
}
|
||||
return new GlobalColumnConfig { Name = x.Key, Title = string.Empty, IsShow = false };
|
||||
}).ToList();
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region 自定义顺序
|
||||
|
||||
/* return config.ResultColumn.GroupBy(x => x.Name)
|
||||
.Where(x => def.ContainsKey(x.Key))
|
||||
.Select(x =>
|
||||
new GlobalColumnConfig { Name = x.Key, Title = x.First().Title, IsShow = x.First().IsShow }).ToList();
|
||||
*/
|
||||
#endregion
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
logger.LogError(e, "反序列化失败:{value}", value);
|
||||
|
||||
}
|
||||
return DefaultList();
|
||||
|
||||
List<GlobalColumnConfig> DefaultList()
|
||||
{
|
||||
return def.Select(x =>
|
||||
new GlobalColumnConfig { Name = x.Key, Title = x.Value, IsShow = true }).ToList();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public async Task<Dictionary<string, string>> GetAccountColumn()
|
||||
{
|
||||
var _GlobalColumn = (await GetGlobalColumn()).Where(x => SystemColumn.ContainsKey(x.Name) && x.IsShow).ToDictionary(x => x.Name, x => string.IsNullOrWhiteSpace(x.Title) ? SystemColumn[x.Name] : x.Title);
|
||||
var value = await settingProvider.GetOrNullAsync(AccountSettingDefinitionName);
|
||||
if (string.IsNullOrWhiteSpace(value)) return _GlobalColumn;
|
||||
|
||||
try
|
||||
{
|
||||
var config = JSON.Deserialize<AccountConfig>(value);
|
||||
if (config.ResultColumn != null && config.ResultColumn.Any())
|
||||
{
|
||||
return config.ResultColumn.GroupBy(x => x.Name)
|
||||
.Where(x => _GlobalColumn.ContainsKey(x.Key))
|
||||
.ToDictionary(x => x.Key,
|
||||
//x => x.First().Title
|
||||
x => _GlobalColumn[x.Key]
|
||||
);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
logger.LogError(e, "反序列化失败:{value}", value);
|
||||
}
|
||||
|
||||
return _GlobalColumn;
|
||||
|
||||
|
||||
}
|
||||
|
||||
public async Task WriteAccountConfig(List<ColumnConfig> ResultColumn)
|
||||
{
|
||||
var value = SerializeConfig(ResultColumn, SystemColumn);
|
||||
await userSettingValueProvider.SetAsync(AccountSettingDefinitionName, value);
|
||||
}
|
||||
|
||||
public static string SerializeConfig(List<ColumnConfig> ResultColumn, Dictionary<string, string> DefaultColumn)
|
||||
{
|
||||
if (ResultColumn != null && ResultColumn.Any())
|
||||
{
|
||||
return JSON.Serialize(new AccountConfig
|
||||
{ ResultColumn = ResultColumn.GroupBy(x => x.Name).Where(x => DefaultColumn.ContainsKey(x.Key) && x.Any()).Select(x => new ColumnConfig { Name = x.Key/*, Title = x.First().Title*/ }).ToList() });
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public async Task WriteGlobalConfig(List<GlobalColumnConfig> ResultColumn)
|
||||
{
|
||||
var value = SerializeConfig(ResultColumn, SystemColumn);
|
||||
await globalSettingValueProvider.SetAsync(GlobalSettingDefinitionName, value);
|
||||
}
|
||||
|
||||
public static string SerializeConfig(List<GlobalColumnConfig> ResultColumn, Dictionary<string, string> DefaultColumn)
|
||||
{
|
||||
if (ResultColumn != null && ResultColumn.Any())
|
||||
{
|
||||
return JSON.Serialize(new GlobalConfig
|
||||
{ ResultColumn = ResultColumn.Where(x => DefaultColumn.ContainsKey(x.Name)).ToList() });
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class ResultColumnConfigStartup : AppStartup
|
||||
{
|
||||
public void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
|
||||
{
|
||||
app.ApplicationServices.GetRequiredService<SettingDefinitionManager>()
|
||||
.AddSettingDefinition(new SettingDefinition()
|
||||
{
|
||||
Name = ResultColumnConfigService.GlobalSettingDefinitionName,
|
||||
Providers = { GlobalSettingValueProvider.ProviderName }
|
||||
})
|
||||
.AddSettingDefinition(new SettingDefinition()
|
||||
{
|
||||
Name = ResultColumnConfigService.AccountSettingDefinitionName,
|
||||
Providers = { UserSettingValueProvider.ProviderName }
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public class AccountConfig
|
||||
{
|
||||
public List<ColumnConfig> ResultColumn { get; set; }
|
||||
}
|
||||
public class GlobalConfig
|
||||
{
|
||||
public List<GlobalColumnConfig> ResultColumn { get; set; }
|
||||
}
|
||||
|
||||
public class ColumnConfig
|
||||
{
|
||||
public string Name { get; set; }
|
||||
}
|
||||
|
||||
public class GlobalColumnConfig : ColumnConfig
|
||||
{
|
||||
//public string SystemTitle { get; set; }
|
||||
public string Title { get; set; }
|
||||
public bool IsShow { get; set; }
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -37,11 +37,6 @@ namespace Waste.Web.Entry
|
|||
new string('-', 50);//输出模板
|
||||
///1.输出所有restrictedToMinimumLevel:LogEventLevel类型
|
||||
config
|
||||
.Enrich.WithProperty("Application", typeof(Program).Assembly.GetName().Name)
|
||||
.Enrich.WithProcessId()
|
||||
.Enrich.WithProcessName()
|
||||
.Enrich.WithMachineName()
|
||||
.Enrich.WithEnvironmentUserName()
|
||||
.WriteTo.Seq("http://localhost:5341/")
|
||||
//.MinimumLevel.Debug() // 所有Sink的最小记录级别
|
||||
//.MinimumLevel.Override("Microsoft", LogEventLevel.Fatal)
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -11,13 +11,6 @@
|
|||
<DebugSymbols>false</DebugSymbols>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Remove="Pages\Product\**" />
|
||||
<Content Remove="Pages\Product\**" />
|
||||
<EmbeddedResource Remove="Pages\Product\**" />
|
||||
<None Remove="Pages\Product\**" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Include="Pages\Shared\_Layout.cshtml" />
|
||||
<None Include="Pages\Shared\_ValidationScriptsPartial.cshtml" />
|
||||
|
|
@ -25,13 +18,10 @@
|
|||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="BuildBundlerMinifier" Version="3.2.449" />
|
||||
<PackageReference Include="Serilog.Enrichers.Environment" Version="2.3.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Waste.Web.Core\Waste.Web.Core.csproj" />
|
||||
<PackageReference Include="Serilog.Enrichers.Process" Version="2.0.2" />
|
||||
|
||||
</ItemGroup>
|
||||
|
||||
<ProjectExtensions><VisualStudio><UserProperties appsettings_1json__JsonSchema="" /></VisualStudio></ProjectExtensions>
|
||||
|
|
|
|||
|
|
@ -3,10 +3,6 @@
|
|||
<PropertyGroup>
|
||||
<RazorPage_SelectedScaffolderID>RazorPageScaffolder</RazorPage_SelectedScaffolderID>
|
||||
<RazorPage_SelectedScaffolderCategoryPath>root/Common/RazorPage</RazorPage_SelectedScaffolderCategoryPath>
|
||||
<NameOfLastUsedPublishProfile>E:\liuzl_ybhdmob\巨天垃圾分类\Waste\Waste.Web.Entry\Properties\PublishProfiles\waste.ybhdmob.com.pubxml</NameOfLastUsedPublishProfile>
|
||||
<ActiveDebugProfile>IIS Express</ActiveDebugProfile>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
<DebuggerFlavor>ProjectDebugger</DebuggerFlavor>
|
||||
<NameOfLastUsedPublishProfile>H:\liuzl_ybhdmob\Waste\Waste.Web.Entry\Properties\PublishProfiles\waste.ybhdmob.com.pubxml</NameOfLastUsedPublishProfile>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
[
|
||||
{
|
||||
// Ҫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ơ<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>е<EFBFBD><EFBFBD><EFBFBD><EFBFBD>·<EFBFBD><EFBFBD>bundleconfig.json<EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// 要输出的捆绑文件名称。 可以包含中的相对路径bundleconfig.json文件。 必填
|
||||
"outputFileName": "wwwroot/css/login.min.css",
|
||||
// Ҫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>顣 <EFBFBD><EFBFBD>Щ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>·<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD>* <EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD>ڿյ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>֧<EFBFBD><EFBFBD>ģʽ<EFBFBD><EFBFBD>
|
||||
// 要将捆绑在一起的文件的数组。 这些是配置文件的相对路径。 可选,* 空值会在空的输出文件。 组合支持模式。
|
||||
"inputFiles": [
|
||||
"wwwroot/js/css/layui.css",
|
||||
"wwwroot/css/admin.css",
|
||||
|
|
@ -17,23 +17,23 @@
|
|||
"wwwroot/js/layui.js",
|
||||
"wwwroot/js/lay/modules/common.js"
|
||||
],
|
||||
// "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD>
|
||||
// "<EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD>Ĭ<EFBFBD><EFBFBD>ֵ-minify": { "enabled": true },
|
||||
// "输出类型缩减选项。
|
||||
// "可选,默认值-minify": { "enabled": true },
|
||||
"minify": {
|
||||
"enabled": false,
|
||||
"renameLocals": true
|
||||
},
|
||||
// ָʾ<EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD>Դӳ<EFBFBD><EFBFBD>ı<EFBFBD>־<EFBFBD><EFBFBD> <EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD>Ĭ<EFBFBD><EFBFBD>-false
|
||||
// 指示是否生成捆绑的文件的源映射的标志。 可选,默认-false
|
||||
"sourceMap": false,
|
||||
// "ָʾ<EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɵ<EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD>ӵ<EFBFBD><EFBFBD><EFBFBD>Ŀ<EFBFBD>ļ<EFBFBD><EFBFBD>ı<EFBFBD>־<EFBFBD><EFBFBD>" "<22><>ѡ<EFBFBD><D1A1>Ĭ<EFBFBD><C4AC>-false",
|
||||
// "指示是否将生成的文件添加到项目文件的标志。" "可选,默认-false",
|
||||
"includeInProject": true
|
||||
// <EFBFBD><EFBFBD><EFBFBD>ڴ洢<EFBFBD><EFBFBD><EFBFBD>ɵ<EFBFBD>Դ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӳ<EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD>ĸ<EFBFBD>·<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// 用于存储生成的源代码映射文件的根路径。
|
||||
//"sourceMapRootPath": ""
|
||||
},
|
||||
{
|
||||
// Ҫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ơ<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>е<EFBFBD><EFBFBD><EFBFBD><EFBFBD>·<EFBFBD><EFBFBD>bundleconfig.json<EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// 要输出的捆绑文件名称。 可以包含中的相对路径bundleconfig.json文件。 必填
|
||||
"outputFileName": "wwwroot/css/index.min.css",
|
||||
// Ҫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>顣 <EFBFBD><EFBFBD>Щ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>·<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD>* <EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD>ڿյ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>֧<EFBFBD><EFBFBD>ģʽ<EFBFBD><EFBFBD>
|
||||
// 要将捆绑在一起的文件的数组。 这些是配置文件的相对路径。 可选,* 空值会在空的输出文件。 组合支持模式。
|
||||
"inputFiles": [
|
||||
"wwwroot/js/css/layui.css",
|
||||
"wwwroot/css/admin.css",
|
||||
|
|
@ -46,23 +46,23 @@
|
|||
"wwwroot/js/layui.js",
|
||||
"wwwroot/js/lay/modules/common.js"
|
||||
],
|
||||
// "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD>
|
||||
// "<EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD>Ĭ<EFBFBD><EFBFBD>ֵ-minify": { "enabled": true },
|
||||
// "输出类型缩减选项。
|
||||
// "可选,默认值-minify": { "enabled": true },
|
||||
"minify": {
|
||||
"enabled": true,
|
||||
"renameLocals": true
|
||||
},
|
||||
// ָʾ<EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD>Դӳ<EFBFBD><EFBFBD>ı<EFBFBD>־<EFBFBD><EFBFBD> <EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD>Ĭ<EFBFBD><EFBFBD>-false
|
||||
// 指示是否生成捆绑的文件的源映射的标志。 可选,默认-false
|
||||
"sourceMap": false,
|
||||
// "ָʾ<EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɵ<EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD>ӵ<EFBFBD><EFBFBD><EFBFBD>Ŀ<EFBFBD>ļ<EFBFBD><EFBFBD>ı<EFBFBD>־<EFBFBD><EFBFBD>" "<22><>ѡ<EFBFBD><D1A1>Ĭ<EFBFBD><C4AC>-false",
|
||||
// "指示是否将生成的文件添加到项目文件的标志。" "可选,默认-false",
|
||||
"includeInProject": true
|
||||
// <EFBFBD><EFBFBD><EFBFBD>ڴ洢<EFBFBD><EFBFBD><EFBFBD>ɵ<EFBFBD>Դ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӳ<EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD>ĸ<EFBFBD>·<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// 用于存储生成的源代码映射文件的根路径。
|
||||
//"sourceMapRootPath": ""
|
||||
},
|
||||
{
|
||||
// Ҫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ơ<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>е<EFBFBD><EFBFBD><EFBFBD><EFBFBD>·<EFBFBD><EFBFBD>bundleconfig.json<EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// 要输出的捆绑文件名称。 可以包含中的相对路径bundleconfig.json文件。 必填
|
||||
"outputFileName": "wwwroot/css/page.min.css",
|
||||
// Ҫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>顣 <EFBFBD><EFBFBD>Щ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>·<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD>* <EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD>ڿյ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>֧<EFBFBD><EFBFBD>ģʽ<EFBFBD><EFBFBD>
|
||||
// 要将捆绑在一起的文件的数组。 这些是配置文件的相对路径。 可选,* 空值会在空的输出文件。 组合支持模式。
|
||||
"inputFiles": [
|
||||
"wwwroot/js/css/layui.css",
|
||||
"wwwroot/css/admin.css",
|
||||
|
|
@ -85,17 +85,17 @@
|
|||
"wwwroot/js/main.js",
|
||||
"wwwroot/js/global.js"
|
||||
],
|
||||
// "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD>
|
||||
// "<EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD>Ĭ<EFBFBD><EFBFBD>ֵ-minify": { "enabled": true },
|
||||
// "输出类型缩减选项。
|
||||
// "可选,默认值-minify": { "enabled": true },
|
||||
"minify": {
|
||||
"enabled": true,
|
||||
"renameLocals": true
|
||||
},
|
||||
// ָʾ<EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD>Դӳ<EFBFBD><EFBFBD>ı<EFBFBD>־<EFBFBD><EFBFBD> <EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD>Ĭ<EFBFBD><EFBFBD>-false
|
||||
// 指示是否生成捆绑的文件的源映射的标志。 可选,默认-false
|
||||
"sourceMap": false,
|
||||
// "ָʾ<EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɵ<EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD>ӵ<EFBFBD><EFBFBD><EFBFBD>Ŀ<EFBFBD>ļ<EFBFBD><EFBFBD>ı<EFBFBD>־<EFBFBD><EFBFBD>" "<22><>ѡ<EFBFBD><D1A1>Ĭ<EFBFBD><C4AC>-false",
|
||||
// "指示是否将生成的文件添加到项目文件的标志。" "可选,默认-false",
|
||||
"includeInProject": true
|
||||
// <EFBFBD><EFBFBD><EFBFBD>ڴ洢<EFBFBD><EFBFBD><EFBFBD>ɵ<EFBFBD>Դ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӳ<EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD>ĸ<EFBFBD>·<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// 用于存储生成的源代码映射文件的根路径。
|
||||
//"sourceMapRootPath": ""
|
||||
}
|
||||
]
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 21 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 21 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 21 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 21 KiB |
File diff suppressed because one or more lines are too long
|
|
@ -597,7 +597,6 @@
|
|||
icon: 'layui-icon-refresh'
|
||||
}, "filter", "print", "exports"],
|
||||
limit: 10,
|
||||
limits: [10, 20, 50, 100, 500, 1500], // 添加这行:定义每页条数可选列表
|
||||
loading: true,
|
||||
autoSort: false,
|
||||
contentType: 'application/json',
|
||||
|
|
|
|||
|
|
@ -10392,7 +10392,6 @@ layui.define(['jquery', 'layer', 'table', 'tableSelect','flow'], function (expor
|
|||
icon: 'layui-icon-refresh'
|
||||
}, "filter", "print", "exports"],
|
||||
limit: 10,
|
||||
limits: [10, 20, 50, 100, 500, 1500], // 添加这行:定义每页条数可选列表
|
||||
loading: true,
|
||||
autoSort: false,
|
||||
contentType: 'application/json',
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -37,8 +37,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WasteHexTest", "WasteHexTes
|
|||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Waste.SocketService", "Waste.SocketService.cs\Waste.SocketService.csproj", "{52B214DE-0AE6-4554-ABA6-1222175A6DEE}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Waste.OpenApi.Host", "Waste.OpenApi.Host\Waste.OpenApi.Host.csproj", "{F5F25517-BC6C-4DF6-8C4E-13074F995589}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
|
|
@ -97,10 +95,6 @@ Global
|
|||
{52B214DE-0AE6-4554-ABA6-1222175A6DEE}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{52B214DE-0AE6-4554-ABA6-1222175A6DEE}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{52B214DE-0AE6-4554-ABA6-1222175A6DEE}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{F5F25517-BC6C-4DF6-8C4E-13074F995589}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{F5F25517-BC6C-4DF6-8C4E-13074F995589}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{F5F25517-BC6C-4DF6-8C4E-13074F995589}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{F5F25517-BC6C-4DF6-8C4E-13074F995589}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
|
@ -119,7 +113,6 @@ Global
|
|||
{D722D30A-DB79-41C7-A377-0864E42E7AF1} = {114F03F7-2D58-4BBE-B91A-CBB9F3DC12A0}
|
||||
{13679A86-CE78-49A2-BD09-83A33642D9BF} = {0E68A675-AD88-4D8F-A0A2-B37094327D88}
|
||||
{52B214DE-0AE6-4554-ABA6-1222175A6DEE} = {A10953C4-FF58-42A1-AAEF-7B68018F5EDB}
|
||||
{F5F25517-BC6C-4DF6-8C4E-13074F995589} = {A10953C4-FF58-42A1-AAEF-7B68018F5EDB}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {086B267B-9152-4816-8D48-30032ACB8A2C}
|
||||
|
|
|
|||
|
|
@ -14,49 +14,11 @@ using System.Threading.Tasks;
|
|||
|
||||
namespace WasteConsoleTest
|
||||
{
|
||||
/// <summary>
|
||||
/// 向服务端推送测试用垃圾采集数据
|
||||
/// </summary>
|
||||
[MessagePackObject]
|
||||
public class MessageGarbageC2SDto //客户端向服务端请求的DTO
|
||||
{
|
||||
/// <summary>
|
||||
/// 垃圾称重数据,64位浮点进度,单位为千克
|
||||
/// </summary>
|
||||
[Key("weight")]
|
||||
public double Weight { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 垃圾桶编码
|
||||
/// </summary>
|
||||
[Key("trash")]
|
||||
public string Trash { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 垃圾类型,缺省类型 : 0,厨余垃圾 : 1,可回收物 : 2,有害垃圾 : 3,其他垃圾 : 4
|
||||
/// </summary>
|
||||
[Key("type")]
|
||||
public int Type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 数据扫描时间,UNIX时间戳
|
||||
/// </summary>
|
||||
[Key("scanningTime")]
|
||||
public long ScanningTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 设备状态,使用中 : 0:使用中,异常 : 1,检修 : 2,检修结束 : 3,启用 : 4,未知 : 5
|
||||
/// </summary>
|
||||
[Key("d_status")]
|
||||
public int DStatus { get; set; }
|
||||
}
|
||||
|
||||
internal class Program
|
||||
class Program
|
||||
{
|
||||
private static WSocketClientHelp wSocketClient = null;
|
||||
public static string SocketURL = "wss://api.device.suzhou.ljflytjl.cn/device_rpc";
|
||||
|
||||
private static async Task Main(string[] args)
|
||||
static async Task Main(string[] args)
|
||||
{
|
||||
var builder = new HostBuilder().ConfigureServices((hostContext, services) =>
|
||||
{
|
||||
|
|
@ -124,14 +86,8 @@ namespace WasteConsoleTest
|
|||
{
|
||||
await myService.Garbages();
|
||||
}
|
||||
//messagepack测试上报
|
||||
else if (cmd.Equals("postmessagepack", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
await myService.MessageGarbages();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void WSocketClient_OnError(object sender, Exception ex)
|
||||
{
|
||||
Console.WriteLine($"发生异常:{ex.Message}");
|
||||
|
|
@ -170,7 +126,7 @@ namespace WasteConsoleTest
|
|||
}
|
||||
}
|
||||
//如果收到的消息为type=6心跳包,需要响应Pong
|
||||
if (jsondata != null && jsondata.type == 6)
|
||||
if(jsondata !=null && jsondata.type == 6)
|
||||
{
|
||||
var senddata = @"{
|
||||
""type"": 6
|
||||
|
|
@ -181,7 +137,9 @@ namespace WasteConsoleTest
|
|||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public interface IMyService
|
||||
|
|
@ -190,18 +148,11 @@ namespace WasteConsoleTest
|
|||
/// 测试token有效期
|
||||
/// </summary>
|
||||
Task TestTokenAsync();
|
||||
|
||||
/// <summary>
|
||||
/// 传送垃圾数据
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task Garbages();
|
||||
|
||||
/// <summary>
|
||||
/// Messagepack传送垃圾数据
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task MessageGarbages();
|
||||
}
|
||||
|
||||
public class MyService : IMyService
|
||||
|
|
@ -212,7 +163,6 @@ namespace WasteConsoleTest
|
|||
{
|
||||
_clientFactory = clientFactory;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 传送垃圾数据
|
||||
/// </summary>
|
||||
|
|
@ -224,14 +174,19 @@ namespace WasteConsoleTest
|
|||
string token = gettoken();
|
||||
if (!string.IsNullOrEmpty(token))
|
||||
{
|
||||
var scantime = GetTimestamp();
|
||||
int timestamp = GetTimestamp();
|
||||
DateTime testtime = DateTime.Parse("2021-08-22 20:00:00");
|
||||
DateTime utcTime = TimeZoneInfo.ConvertTimeToUtc(testtime);
|
||||
DateTime utcStartTime = new DateTime(1970, 1, 1, 0, 0, 0, 0);
|
||||
int scantime= timestamp = Convert.ToInt32((utcTime - utcStartTime).TotalSeconds);
|
||||
|
||||
var garbageC2SDto = new GarbageC2SDto
|
||||
{
|
||||
weight = 42.3,
|
||||
trash = "64424512085",
|
||||
weight = 50.25,
|
||||
trash = "251658245",
|
||||
scanningTime = scantime,
|
||||
d_status = 0,
|
||||
type = 4
|
||||
type = 1
|
||||
};
|
||||
int nonce = GetNonce();
|
||||
string[] paramlist = new string[] {
|
||||
|
|
@ -239,73 +194,14 @@ namespace WasteConsoleTest
|
|||
};
|
||||
string sign = GetUserApiSign(WSocketClientHelp.Secret, paramlist);
|
||||
var request = new HttpRequestMessage(HttpMethod.Post,
|
||||
"https://api.data.suzhou.ljflytjl.cn/api/Garbages?api-version=1.0");
|
||||
request.Headers.Add("Authorization", $"Bearer {token}");
|
||||
request.Headers.Add("secret", WSocketClientHelp.Secret);
|
||||
request.Headers.Add("nonce", nonce.ToString());
|
||||
request.Headers.Add("time", scantime.ToString());
|
||||
request.Headers.Add("sign", sign);
|
||||
var message = JsonConvert.SerializeObject(garbageC2SDto);
|
||||
request.Content = new StringContent(message, Encoding.Default, "application/json");
|
||||
var client = _clientFactory.CreateClient();
|
||||
var response = await client.SendAsync(request);
|
||||
var result = await response.Content.ReadAsStringAsync();
|
||||
if (response.IsSuccessStatusCode)
|
||||
{
|
||||
Console.WriteLine($"上报成功:{result}");
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine($"上报失败:{response.StatusCode},{result}");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.Write("token未找到");
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// MessagePack传送垃圾数据
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task MessageGarbages()
|
||||
{
|
||||
try
|
||||
{
|
||||
string token = gettoken();
|
||||
if (!string.IsNullOrEmpty(token))
|
||||
{
|
||||
var timestamp = GetTimestamp();
|
||||
var garbageC2SDto = new MessageGarbageC2SDto
|
||||
{
|
||||
Weight = 50.2,
|
||||
Trash = "64424509988",
|
||||
ScanningTime = timestamp,
|
||||
DStatus = 0,
|
||||
Type = 4
|
||||
};
|
||||
int nonce = GetNonce();
|
||||
string[] paramlist = new string[] {
|
||||
garbageC2SDto.Weight.ToString(),garbageC2SDto.Trash,garbageC2SDto.Type.ToString(),garbageC2SDto.ScanningTime.ToString(),garbageC2SDto.DStatus.ToString()
|
||||
};
|
||||
string sign = GetUserApiSign(WSocketClientHelp.Secret, paramlist);
|
||||
var request = new HttpRequestMessage(HttpMethod.Post,
|
||||
"https://api.data.suzhou.ljflytjl.cn/api/Garbages");
|
||||
request.Headers.Add("Authorization", $"Bearer {token}");
|
||||
request.Headers.Add("secret", WSocketClientHelp.Secret);
|
||||
request.Headers.Add("nonce", nonce.ToString());
|
||||
request.Headers.Add("time", timestamp.ToString());
|
||||
request.Headers.Add("sign", sign);
|
||||
|
||||
var bytes = MessagePackSerializer.Serialize(garbageC2SDto);
|
||||
request.Content = new ByteArrayContent(bytes);
|
||||
request.Headers.Add("Accept", "application/x-msgpack");
|
||||
request.Content.Headers.Add("Content-Type", "application/x-msgpack");
|
||||
var message = JsonConvert.SerializeObject(garbageC2SDto);
|
||||
request.Content = new StringContent(message, Encoding.UTF8, "application/json");
|
||||
var client = _clientFactory.CreateClient();
|
||||
var response = await client.SendAsync(request);
|
||||
var result = await response.Content.ReadAsStringAsync();
|
||||
|
|
@ -325,6 +221,8 @@ namespace WasteConsoleTest
|
|||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -356,30 +254,17 @@ namespace WasteConsoleTest
|
|||
Console.Write("token未找到");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取时间戳
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private long GetTimestamp()
|
||||
private int GetTimestamp()
|
||||
{
|
||||
DateTime utcTime = TimeZoneInfo.ConvertTimeToUtc(DateTime.Now);
|
||||
DateTime utcStartTime = new DateTime(1970, 1, 1, 0, 0, 0, 0);
|
||||
var timestamp = Convert.ToInt32((utcTime - utcStartTime).TotalSeconds);
|
||||
int timestamp = Convert.ToInt32((utcTime-utcStartTime).TotalSeconds);
|
||||
return timestamp;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取UTC时间戳
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int CurrentUTCTimeStamp()
|
||||
{
|
||||
var ts = DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0, 0);
|
||||
var times = Convert.ToInt32(ts.TotalSeconds);
|
||||
return times;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取随机数
|
||||
/// </summary>
|
||||
|
|
@ -390,7 +275,6 @@ namespace WasteConsoleTest
|
|||
int nonce = random.Next(1, Int32.MaxValue);
|
||||
return nonce;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取签名
|
||||
/// </summary>
|
||||
|
|
@ -422,7 +306,6 @@ namespace WasteConsoleTest
|
|||
sign = sign.ToLower();
|
||||
return sign;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取token
|
||||
/// </summary>
|
||||
|
|
@ -438,7 +321,6 @@ namespace WasteConsoleTest
|
|||
return token;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 向服务端推送测试用垃圾采集数据
|
||||
/// </summary>
|
||||
|
|
@ -448,29 +330,24 @@ namespace WasteConsoleTest
|
|||
/// 垃圾称重数据,64位浮点进度,单位为千克
|
||||
/// </summary>
|
||||
public double weight { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 垃圾桶编码
|
||||
/// </summary>
|
||||
public string trash { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 垃圾类型,缺省类型 : 0,厨余垃圾 : 1,可回收物 : 2,有害垃圾 : 3,其他垃圾 : 4
|
||||
/// </summary>
|
||||
|
||||
public int type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 数据扫描时间,UNIX时间戳
|
||||
/// </summary>
|
||||
public long scanningTime { get; set; }
|
||||
|
||||
public int scanningTime { get; set; }
|
||||
/// <summary>
|
||||
/// 设备状态,使用中 : 0:使用中,异常 : 1,检修 : 2,检修结束 : 3,启用 : 4,未知 : 5
|
||||
/// </summary>
|
||||
public int d_status { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 响应的数据
|
||||
/// </summary>
|
||||
|
|
@ -480,22 +357,18 @@ namespace WasteConsoleTest
|
|||
/// 类型,6-心跳包,1-token,3-其他
|
||||
/// </summary>
|
||||
public int type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 请求id
|
||||
/// </summary>
|
||||
public string invocationId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 结果
|
||||
/// </summary>
|
||||
public string result { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 目标
|
||||
/// </summary>
|
||||
public string target { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 参数
|
||||
/// </summary>
|
||||
|
|
@ -506,7 +379,6 @@ namespace WasteConsoleTest
|
|||
{
|
||||
Console.WriteLine($"已连接");
|
||||
}
|
||||
|
||||
public static void SetTimeOut()
|
||||
{
|
||||
Task.Run(() =>
|
||||
|
|
@ -514,7 +386,7 @@ namespace WasteConsoleTest
|
|||
DateTime startime = DateTime.Now;
|
||||
while (true)
|
||||
{
|
||||
if (wSocketClient.State == WebSocketState.Open)
|
||||
if(wSocketClient.State == WebSocketState.Open)
|
||||
{
|
||||
if ((DateTime.Now - startime).TotalSeconds >= 15)
|
||||
{
|
||||
|
|
@ -529,7 +401,6 @@ namespace WasteConsoleTest
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
private static byte[] RemoveSeparator(byte[] data)
|
||||
{
|
||||
List<byte> t = new List<byte>(data);
|
||||
|
|
|
|||
|
|
@ -10,12 +10,12 @@ namespace WasteConsoleTest
|
|||
{
|
||||
public class WSocketClientHelp
|
||||
{
|
||||
private ClientWebSocket ws = null;
|
||||
private Uri uri = null;
|
||||
private bool isUserClose = false;//是否最后由用户手动关闭
|
||||
public static string Secret = "VOVGXa8Rw7hwp4p5";
|
||||
public static string SecretHash = "wSQnkR1Eec4U5FPRA5aGDwpmH3+P6YtEK3yHYQ79r8w=";
|
||||
public static string deviceid = "08da3552-46ee-41b5-88ee-ea3f0047b57f";
|
||||
ClientWebSocket ws = null;
|
||||
Uri uri = null;
|
||||
bool isUserClose = false;//是否最后由用户手动关闭
|
||||
public static string Secret = "T2hZmT3LhIvl0a0E";
|
||||
public static string SecretHash = "bvfEFN9CegW1SLEOlOGA5d+ht3RlXrmAOAr099AG7K8=";
|
||||
public static string deviceid = "08d97f54-c0f6-4f57-81aa-296f93be7eb2";
|
||||
|
||||
// <summary>
|
||||
/// WebSocket状态
|
||||
|
|
@ -26,24 +26,20 @@ namespace WasteConsoleTest
|
|||
/// 包含一个数据的事件
|
||||
/// </summary>
|
||||
public delegate void MessageEventHandler(object sender, string data);
|
||||
|
||||
public delegate void ErrorEventHandler(object sender, Exception ex);
|
||||
|
||||
/// <summary>
|
||||
/// 连接建立时触发
|
||||
/// </summary>
|
||||
public event EventHandler OnOpen;
|
||||
|
||||
/// <summary>
|
||||
/// 客户端接收服务端数据时触发
|
||||
/// </summary>
|
||||
public event MessageEventHandler OnMessage;
|
||||
|
||||
/// <summary>
|
||||
/// 通信发生错误时触发
|
||||
/// </summary>
|
||||
public event ErrorEventHandler OnError;
|
||||
|
||||
/// <summary>
|
||||
/// 连接关闭时触发
|
||||
/// </summary>
|
||||
|
|
@ -138,8 +134,8 @@ namespace WasteConsoleTest
|
|||
Close(ws.CloseStatus.Value, ws.CloseStatusDescription + netErr);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 增加记录分隔符
|
||||
/// </summary>
|
||||
|
|
@ -150,7 +146,6 @@ namespace WasteConsoleTest
|
|||
List<byte> t = new List<byte>(data) { 0x1e };//0x1e record separator
|
||||
return t.ToArray();
|
||||
}
|
||||
|
||||
//删除记录分隔符
|
||||
private static byte[] RemoveSeparator(byte[] data)
|
||||
{
|
||||
|
|
@ -158,7 +153,6 @@ namespace WasteConsoleTest
|
|||
t.Remove(0x1e);
|
||||
return t.ToArray();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取时间戳
|
||||
/// </summary>
|
||||
|
|
@ -169,7 +163,6 @@ namespace WasteConsoleTest
|
|||
int timestamp = Convert.ToInt32((DateTime.Now - dateTimeStart).TotalSeconds);
|
||||
return timestamp;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 使用连接发送文本消息
|
||||
/// </summary>
|
||||
|
|
@ -232,6 +225,7 @@ namespace WasteConsoleTest
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
ws.Abort();
|
||||
|
|
|
|||
|
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
"runtimeTarget": {
|
||||
"name": ".NETCoreApp,Version=v6.0",
|
||||
"signature": ""
|
||||
},
|
||||
"compilationOptions": {},
|
||||
"targets": {
|
||||
".NETCoreApp,Version=v6.0": {
|
||||
"WasteHexTest/1.0.0": {
|
||||
"runtime": {
|
||||
"WasteHexTest.dll": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"libraries": {
|
||||
"WasteHexTest/1.0.0": {
|
||||
"type": "project",
|
||||
"serviceable": false,
|
||||
"sha512": ""
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"runtimeOptions": {
|
||||
"tfm": "net6.0",
|
||||
"framework": {
|
||||
"name": "Microsoft.NETCore.App",
|
||||
"version": "6.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
|
@ -0,0 +1,4 @@
|
|||
// <autogenerated />
|
||||
using System;
|
||||
using System.Reflection;
|
||||
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v6.0", FrameworkDisplayName = "")]
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// 此代码由工具生成。
|
||||
// 运行时版本:4.0.30319.42000
|
||||
//
|
||||
// 对此文件的更改可能会导致不正确的行为,并且如果
|
||||
// 重新生成代码,这些更改将会丢失。
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
|
||||
[assembly: System.Reflection.AssemblyCompanyAttribute("WasteHexTest")]
|
||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")]
|
||||
[assembly: System.Reflection.AssemblyProductAttribute("WasteHexTest")]
|
||||
[assembly: System.Reflection.AssemblyTitleAttribute("WasteHexTest")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||
|
||||
// 由 MSBuild WriteCodeFragment 类生成。
|
||||
|
||||
|
|
@ -0,0 +1 @@
|
|||
ae05f715cee180db309569d4ffdebdc1698a6c29
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
is_global = true
|
||||
build_property.TargetFramework = net6.0
|
||||
build_property.TargetPlatformMinVersion =
|
||||
build_property.UsingMicrosoftNETSdkWeb =
|
||||
build_property.ProjectTypeGuids =
|
||||
build_property.InvariantGlobalization =
|
||||
build_property.PlatformNeutralAssembly =
|
||||
build_property._SupportedPlatformList = Linux,macOS,Windows
|
||||
build_property.RootNamespace = WasteHexTest
|
||||
build_property.ProjectDir = H:\liuzl_ybhdmob\Waste\WasteHexTest\
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
// <auto-generated/>
|
||||
global using global::System;
|
||||
global using global::System.Collections.Generic;
|
||||
global using global::System.IO;
|
||||
global using global::System.Linq;
|
||||
global using global::System.Net.Http;
|
||||
global using global::System.Threading;
|
||||
global using global::System.Threading.Tasks;
|
||||
Binary file not shown.
Binary file not shown.
|
|
@ -0,0 +1 @@
|
|||
7933e30392c2f15c027d739f8018b9306b36aab9
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
H:\liuzl_ybhdmob\Waste\WasteHexTest\bin\Debug\net6.0\WasteHexTest.exe
|
||||
H:\liuzl_ybhdmob\Waste\WasteHexTest\bin\Debug\net6.0\WasteHexTest.deps.json
|
||||
H:\liuzl_ybhdmob\Waste\WasteHexTest\bin\Debug\net6.0\WasteHexTest.runtimeconfig.json
|
||||
H:\liuzl_ybhdmob\Waste\WasteHexTest\bin\Debug\net6.0\WasteHexTest.dll
|
||||
H:\liuzl_ybhdmob\Waste\WasteHexTest\bin\Debug\net6.0\ref\WasteHexTest.dll
|
||||
H:\liuzl_ybhdmob\Waste\WasteHexTest\bin\Debug\net6.0\WasteHexTest.pdb
|
||||
H:\liuzl_ybhdmob\Waste\WasteHexTest\obj\Debug\net6.0\WasteHexTest.csproj.AssemblyReference.cache
|
||||
H:\liuzl_ybhdmob\Waste\WasteHexTest\obj\Debug\net6.0\WasteHexTest.GeneratedMSBuildEditorConfig.editorconfig
|
||||
H:\liuzl_ybhdmob\Waste\WasteHexTest\obj\Debug\net6.0\WasteHexTest.AssemblyInfoInputs.cache
|
||||
H:\liuzl_ybhdmob\Waste\WasteHexTest\obj\Debug\net6.0\WasteHexTest.AssemblyInfo.cs
|
||||
H:\liuzl_ybhdmob\Waste\WasteHexTest\obj\Debug\net6.0\WasteHexTest.csproj.CoreCompileInputs.cache
|
||||
H:\liuzl_ybhdmob\Waste\WasteHexTest\obj\Debug\net6.0\WasteHexTest.dll
|
||||
H:\liuzl_ybhdmob\Waste\WasteHexTest\obj\Debug\net6.0\ref\WasteHexTest.dll
|
||||
H:\liuzl_ybhdmob\Waste\WasteHexTest\obj\Debug\net6.0\WasteHexTest.pdb
|
||||
H:\liuzl_ybhdmob\Waste\WasteHexTest\obj\Debug\net6.0\WasteHexTest.genruntimeconfig.cache
|
||||
Binary file not shown.
|
|
@ -0,0 +1 @@
|
|||
55914c4242af075382a4fc0361a48b2625906912
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -0,0 +1,4 @@
|
|||
// <autogenerated />
|
||||
using System;
|
||||
using System.Reflection;
|
||||
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v6.0", FrameworkDisplayName = "")]
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// 此代码由工具生成。
|
||||
// 运行时版本:4.0.30319.42000
|
||||
//
|
||||
// 对此文件的更改可能会导致不正确的行为,并且如果
|
||||
// 重新生成代码,这些更改将会丢失。
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
|
||||
[assembly: System.Reflection.AssemblyCompanyAttribute("WasteHexTest")]
|
||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Release")]
|
||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")]
|
||||
[assembly: System.Reflection.AssemblyProductAttribute("WasteHexTest")]
|
||||
[assembly: System.Reflection.AssemblyTitleAttribute("WasteHexTest")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||
|
||||
// 由 MSBuild WriteCodeFragment 类生成。
|
||||
|
||||
|
|
@ -0,0 +1 @@
|
|||
2a7c376712074f8be969a5d5b73b50e5ccf9e039
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
is_global = true
|
||||
build_property.TargetFramework = net6.0
|
||||
build_property.TargetPlatformMinVersion =
|
||||
build_property.UsingMicrosoftNETSdkWeb =
|
||||
build_property.ProjectTypeGuids =
|
||||
build_property.InvariantGlobalization =
|
||||
build_property.PlatformNeutralAssembly =
|
||||
build_property._SupportedPlatformList = Linux,macOS,Windows
|
||||
build_property.RootNamespace = WasteHexTest
|
||||
build_property.ProjectDir = H:\liuzl_ybhdmob\Waste\WasteHexTest\
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue