change - 提交

master
wenjy 2 months ago
parent 0de73a0f02
commit 828fb654a1

@ -1,8 +1,7 @@
using NLog;
using SlnMesnac.RfidUpload.Common; using SlnMesnac.RfidUpload.Common;
using SlnMesnac.RfidUpload.Model; using SlnMesnac.RfidUpload.Model;
using SlnMesnac.RfidUpload.NLog;
using System; using System;
using System.Collections.Generic;
using System.Text; using System.Text;
namespace SlnMesnac.RfidUpload.Analysis namespace SlnMesnac.RfidUpload.Analysis
@ -13,7 +12,7 @@ namespace SlnMesnac.RfidUpload.Analysis
public class InstructionAdapter public class InstructionAdapter
{ {
private MsgUtil _msgUtil = MsgUtil.Instance; private MsgUtil _msgUtil = MsgUtil.Instance;
private static Logger logger = LogManager.GetCurrentClassLogger(); private readonly LogHelper logger = LogHelper.Instance;
#region 单例实现 #region 单例实现
private static readonly Lazy<InstructionAdapter> _lazy = new Lazy<InstructionAdapter>(() => new InstructionAdapter()); private static readonly Lazy<InstructionAdapter> _lazy = new Lazy<InstructionAdapter>(() => new InstructionAdapter());

@ -124,10 +124,11 @@ namespace SlnMesnac.RfidUpload.Business
return packets; return packets;
} }
public void apiTest(string url) public void upload(int code,string paramStr,string msg)
{ {
//WebApiClientApp api = new WebApiClientApp(); //WebApiClientApp api = new WebApiClientApp();
_webApiClientApp.Upload(url); string result = _webApiClientApp.UploadAsync(code,paramStr);
RefreshLogMessageEvent?.Invoke($"CSB{msg}接口调用结果:{result}");
} }
/// <summary> /// <summary>

@ -1,7 +1,9 @@
using System; using System;
using System.Collections.Generic;
using System.IO.Ports; using System.IO.Ports;
using System.Linq; using System.Linq;
using System.Threading; using System.Threading;
using TouchSocket.Sockets;
namespace SlnMesnac.RfidUpload.Business namespace SlnMesnac.RfidUpload.Business
{ {
@ -49,15 +51,36 @@ namespace SlnMesnac.RfidUpload.Business
/// <summary> /// <summary>
/// 打开串口 /// 打开串口
/// </summary> /// </summary>
public void Open() //public void Open()
//{
// string port = System.IO.Ports.SerialPort.GetPortNames().FirstOrDefault();
// _serialPort = new SerialPort(port, 115200, Parity.None, 8, StopBits.One);
// _serialPort.DataReceived += SerialPortDataReceived;
// _serialPort.Open();
//}
/// <summary>
/// 打开串口
/// </summary>
/// <param name="serialPort">串口号</param>
/// <param name="baudRate">波特率</param>
/// <param name="parity">校验位None = 0,Odd = 1, Even = 2,Mark = 3,Space = 4,</param>
/// <param name="dataBits">数据位</param>
/// <param name="stopBits">停止位</param>
public void OpenSerialPort(string serialPort, int baudRate, int parity, int dataBits, int stopBits)
{ {
string port = System.IO.Ports.SerialPort.GetPortNames().FirstOrDefault(); if (string.IsNullOrEmpty(serialPort))
_serialPort = new SerialPort(port, 115200, Parity.None, 8, StopBits.One); {
_serialPort.DataReceived += SerialPortDataReceived; throw new ArgumentException("串口号不能为空");
}
_serialPort = new SerialPort(serialPort, baudRate, (System.IO.Ports.Parity)parity, dataBits, (StopBits)stopBits);
_serialPort.DataReceived += SerialPortDataReceived;
_serialPort.Open(); _serialPort.Open();
} }
/// <summary> /// <summary>
/// 关闭串口 /// 关闭串口
/// </summary> /// </summary>
@ -96,7 +119,10 @@ namespace SlnMesnac.RfidUpload.Business
} }
else else
{ {
RefreshLogMessageEvent?.Invoke("心跳指令不进行逻辑处理"); //RefreshLogMessageEvent?.Invoke("心跳指令不进行逻辑处理");
//.Send(item.Id, "heartbeat");
_serialPort.WriteLine("heartbeat");
} }
} }
catch (Exception ex) catch (Exception ex)
@ -120,5 +146,15 @@ namespace SlnMesnac.RfidUpload.Business
return false; return false;
} }
/// <summary>
/// 获取系统内的串口
/// </summary>
/// <param name="serialPorts"></param>
public void GetSerialPorts(out List<string> serialPorts)
{
serialPorts = SerialPort.GetPortNames().ToList();
}
} }
} }

@ -13,6 +13,10 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="System.IO.Ports" Version="8.0.0" /> <PackageReference Include="System.IO.Ports" Version="8.0.0" />
<PackageReference Include="System.ServiceModel.Duplex" Version="4.6.*" />
<PackageReference Include="System.ServiceModel.Http" Version="4.6.*" />
<PackageReference Include="System.ServiceModel.NetTcp" Version="4.6.*" />
<PackageReference Include="System.ServiceModel.Security" Version="4.6.*" />
</ItemGroup> </ItemGroup>
</Project> </Project>

@ -5,39 +5,53 @@ namespace SlnMesnac.RfidUpload.Model
/// </summary> /// </summary>
public class ContainerInbound public class ContainerInbound
{ {
/// <summary> ///// <summary>
/// 入参1请求报文到消息头 ///// 入参1请求报文到消息头
/// </summary> ///// </summary>
public string messageHeader { get; set; } //public string messageHeader { get; set; }
/// <summary> ///// <summary>
/// 入参2将下列参数封装到batchOpenQuery ///// 入参2将下列参数封装到batchOpenQuery
/// </summary> ///// </summary>
public string batchOpenQuery { get; set; } //public string batchOpenQuery { get; set; }
/// <summary> ///// <summary>
/// 机构代码 ///// 机构代码
/// </summary> ///// </summary>
public string opOrgCode { get; set; } //public string opOrgCode { get; set; }
/// <summary> ///// <summary>
/// 登录人代码 ///// 登录人代码
/// </summary> ///// </summary>
public string userCode { get; set; } //public string userCode { get; set; }
/// <summary> ///// <summary>
/// 登录人名称 ///// 登录人名称
/// </summary> ///// </summary>
public string userName { get; set; } //public string userName { get; set; }
/// <summary> ///// <summary>
/// 省份代码 ///// 省份代码
/// </summary> ///// </summary>
public string province { get; set; } //public string province { get; set; }
/// <summary> ///// <summary>
/// 容器条码 ///// 容器条码
/// </summary> ///// </summary>
public string rqtm { get; set; } //public string rqtm { get; set; }
public int code { get; set; }
public string requestURL { get; set; }
public string containerRegisterQuery { get; set; }
public string sysCode { get; set; }
public string password { get; set; }
public string ak { get; set; }
public string sk { get; set; }
} }
} }

@ -0,0 +1,55 @@
using System;
using System.Collections.Generic;
using System.Text;
#region << 版 本 注 释 >>
/*--------------------------------------------------------------------
* (c) 2024 WenJY
* CLR4.0.30319.42000
* T14-GEN3-7895
* SlnMesnac.RfidUpload.Model.apiParam
* fbf869f5-fcea-44c6-b350-7b243fa26d45
*
* WenJY
*
* 2024-07-02 16:00:16
* V1.0.0
*
*
*--------------------------------------------------------------------
*
*
*
*
* V1.0.0
*--------------------------------------------------------------------*/
#endregion << 版 本 注 释 >>
namespace SlnMesnac.RfidUpload.Model.apiParam
{
public class ApiResult
{
public string status { get; set; }
public string msg { get; set; }
public static ApiResult Success()
{
return new ApiResult { status = "200",msg = "向客户端发送消息成功!" };
}
public static ApiResult Fail()
{
return new ApiResult { status = "101", msg = "向客户端发送消息失败!" };
}
public static ApiResult TimeOut()
{
return new ApiResult { status = "201", msg = "向客户端发送消息成功,接收客户端消息超时!" };
}
public static ApiResult Error()
{
return new ApiResult { status = "100", msg = "向客户端发送消息失败!" };
}
}
}

@ -0,0 +1,106 @@
using SlnMesnac.RfidUpload.Common;
using System;
using System.Collections.Generic;
using System.Text;
#region << 版 本 注 释 >>
/*--------------------------------------------------------------------
* (c) 2024 WenJY
* CLR4.0.30319.42000
* T14-GEN3-7895
* SlnMesnac.RfidUpload.Model.apiParam
* 923d436a-eb53-433b-87f6-f00771f525da
*
* WenJY
*
* 2024-10-29 14:57:58
* V1.0.0
*
*
*--------------------------------------------------------------------
*
*
*
*
* V1.0.0
*--------------------------------------------------------------------*/
#endregion << 版 本 注 释 >>
namespace SlnMesnac.RfidUpload.Model.apiParam
{
/// <summary>
/// 容器入库接口参数
/// </summary>
public class BatchOpenQuery
{
private static readonly Lazy<BatchOpenQuery> lazy = new Lazy<BatchOpenQuery>(() => new BatchOpenQuery());
public static BatchOpenQuery Instance
{
get
{
return lazy.Value;
}
}
private BatchOpenQuery()
{
}
private static INIFile iNIFile = new INIFile(System.Environment.CurrentDirectory + "/App.InI");
/// <summary>
/// 机构代码
/// </summary>
public string opOrgCode
{
get { return iNIFile.IniReadValue("BatchOpenQuery", "opOrgCode"); }
set { iNIFile.IniWriteValue("BatchOpenQuery", "opOrgCode", value.ToString()); }
}
/// <summary>
/// 登录人代码
/// </summary>
public string userCode
{
get { return iNIFile.IniReadValue("BatchOpenQuery", "userCode"); }
set { iNIFile.IniWriteValue("BatchOpenQuery", "userCode", value.ToString()); }
}
/// <summary>
/// 登录人名称
/// </summary>
public string userName
{
get { return iNIFile.IniReadValue("BatchOpenQuery", "userName"); }
set { iNIFile.IniWriteValue("BatchOpenQuery", "userName", value.ToString()); }
}
/// <summary>
/// 省份代码
/// </summary>
public string provice
{
get { return iNIFile.IniReadValue("BatchOpenQuery", "provice"); }
set { iNIFile.IniWriteValue("BatchOpenQuery", "provice", value.ToString()); }
}
/// <summary>
/// 容器条码
/// </summary>
public string rqtm
{
get { return iNIFile.IniReadValue("BatchOpenQuery", "rqtm"); }
set { iNIFile.IniWriteValue("BatchOpenQuery", "rqtm", value.ToString()); }
}
/// <summary>
/// 设备编码
/// </summary>
public string devicedId
{
get { return iNIFile.IniReadValue("BatchOpenQuery", "devicedId"); }
set { iNIFile.IniWriteValue("BatchOpenQuery", "devicedId", value.ToString()); }
}
}
}

@ -0,0 +1,170 @@
using SlnMesnac.RfidUpload.Common;
using SlnMesnac.RfidUpload.Model.config;
using System;
using System.Collections.Generic;
using System.Text;
#region << 版 本 注 释 >>
/*--------------------------------------------------------------------
* (c) 2024 WenJY
* CLR4.0.30319.42000
* T14-GEN3-7895
* SlnMesnac.RfidUpload.Model.apiParam
* 82cc9323-4b7f-4490-8b0a-6cd7d56f5f84
*
* WenJY
*
* 2024-10-29 14:53:32
* V1.0.0
*
*
*--------------------------------------------------------------------
*
*
*
*
* V1.0.0
*--------------------------------------------------------------------*/
#endregion << 版 本 注 释 >>
namespace SlnMesnac.RfidUpload.Model.apiParam
{
/// <summary>
/// 容器指定封发扫描接口参数
/// </summary>
public class ContainerRegisterQuery
{
private static readonly Lazy<ContainerRegisterQuery> lazy = new Lazy<ContainerRegisterQuery>(() => new ContainerRegisterQuery());
public static ContainerRegisterQuery Instance
{
get
{
return lazy.Value;
}
}
private ContainerRegisterQuery()
{
}
private static INIFile iNIFile = new INIFile(System.Environment.CurrentDirectory + "/App.InI");
/// <summary>
/// 机构代码
/// </summary>
public string opOrgCode
{
get { return iNIFile.IniReadValue("ContainerRegisterQuery", "opOrgCode"); }
set { iNIFile.IniWriteValue("ContainerRegisterQuery", "opOrgCode", value.ToString()); }
}
/// <summary>
/// 省份代码
/// </summary>
public string opOrgName
{
get { return iNIFile.IniReadValue("ContainerRegisterQuery", "opOrgName"); }
set { iNIFile.IniWriteValue("ContainerRegisterQuery", "opOrgName", value.ToString()); }
}
/// <summary>
/// 登录人代码
/// </summary>
public string userCode
{
get { return iNIFile.IniReadValue("ContainerRegisterQuery", "userCode"); }
set { iNIFile.IniWriteValue("ContainerRegisterQuery", "userCode", value.ToString()); }
}
/// <summary>
/// 登录人名称
/// </summary>
public string userName
{
get { return iNIFile.IniReadValue("ContainerRegisterQuery", "userName"); }
set { iNIFile.IniWriteValue("ContainerRegisterQuery", "userName", value.ToString()); }
}
/// <summary>
/// 省份代码
/// </summary>
public string provice
{
get { return iNIFile.IniReadValue("ContainerRegisterQuery", "provice"); }
set { iNIFile.IniWriteValue("ContainerRegisterQuery", "provice", value.ToString()); }
}
/// <summary>
/// 容器种类名称
/// </summary>
public string rqzlmc
{
get { return iNIFile.IniReadValue("ContainerRegisterQuery", "rqzlmc"); }
set { iNIFile.IniWriteValue("ContainerRegisterQuery", "rqzlmc", value.ToString()); }
}
/// <summary>
/// 总包id
/// </summary>
public string zbid
{
get { return iNIFile.IniReadValue("ContainerRegisterQuery", "zbid"); }
set { iNIFile.IniWriteValue("ContainerRegisterQuery", "zbid", value.ToString()); }
}
/// <summary>
/// 寄达局名称
/// </summary>
public string destinationOrgName
{
get { return iNIFile.IniReadValue("ContainerRegisterQuery", "destinationOrgName"); }
set { iNIFile.IniWriteValue("ContainerRegisterQuery", "destinationOrgName", value.ToString()); }
}
/// <summary>
/// 寄达局编号
/// </summary>
public string destinationOrgCode
{
get { return iNIFile.IniReadValue("ContainerRegisterQuery", "destinationOrgCode"); }
set { iNIFile.IniWriteValue("ContainerRegisterQuery", "destinationOrgCode", value.ToString()); }
}
/// <summary>
/// 容器种类
/// </summary>
public string rqzl
{
get { return iNIFile.IniReadValue("ContainerRegisterQuery", "rqzl"); }
set { iNIFile.IniWriteValue("ContainerRegisterQuery", "rqzl", value.ToString()); }
}
/// <summary>
/// 容器型号
/// </summary>
public string rqxh
{
get { return iNIFile.IniReadValue("ContainerRegisterQuery", "rqxh"); }
set { iNIFile.IniWriteValue("ContainerRegisterQuery", "rqxh", value.ToString()); }
}
/// <summary>
/// 容器型号名称
/// </summary>
public string rqxhmc
{
get { return iNIFile.IniReadValue("ContainerRegisterQuery", "rqxhmc"); }
set { iNIFile.IniWriteValue("ContainerRegisterQuery", "rqxhmc", value.ToString()); }
}
/// <summary>
/// 容器条码
/// </summary>
public string rqtm
{
get { return iNIFile.IniReadValue("ContainerRegisterQuery", "rqtm"); }
set { iNIFile.IniWriteValue("ContainerRegisterQuery", "rqtm", value.ToString()); }
}
}
}

@ -0,0 +1,51 @@
using System;
using System.Collections.Generic;
using System.Text;
#region << 版 本 注 释 >>
/*--------------------------------------------------------------------
* (c) 2024 WenJY
* CLR4.0.30319.42000
* T14-GEN3-7895
* SlnMesnac.RfidUpload.Model.apiParam
* cd1c0cdd-b51d-425a-91e3-1dd20eddb4e9
*
* WenJY
*
* 2024-07-02 15:59:39
* V1.0.0
*
*
*--------------------------------------------------------------------
*
*
*
*
* V1.0.0
*--------------------------------------------------------------------*/
#endregion << 版 本 注 释 >>
namespace SlnMesnac.RfidUpload.Model.apiParam
{
public class InStoreParam
{
/// <summary>
/// 机构代码
/// </summary>
public string opOrgCode { get; set; }
/// <summary>
/// 登录人代码
/// </summary>
public string userCode { get; set; }
/// <summary>
/// 登录人名称
/// </summary>
public string userName { get; set; }
/// <summary>
/// 省份代码
/// </summary>
public string province { get; set; }
}
}

@ -1,30 +1,38 @@
namespace SlnMesnac.RfidUpload.Model using System;
using System.Collections.Generic;
using System.Text;
#region << 版 本 注 释 >>
/*--------------------------------------------------------------------
* (c) 2024 WenJY
* CLR4.0.30319.42000
* T14-GEN3-7895
* SlnMesnac.RfidUpload.Model.apiParam
* 43029bd1-d802-45dd-b3a8-c348c9a6f104
*
* WenJY
*
* 2024-07-02 15:59:48
* V1.0.0
*
*
*--------------------------------------------------------------------
*
*
*
*
* V1.0.0
*--------------------------------------------------------------------*/
#endregion << 版 本 注 释 >>
namespace SlnMesnac.RfidUpload.Model.apiParam
{ {
/// <summary> public class OutStoreParam
/// 容器封发扫描
/// </summary>
public class ContainerSealed
{ {
/// <summary>
/// 入参1请求报文到消息头
/// </summary>
public string messageHeader { get; set; }
/// <summary>
/// 入参2将下列参数封装到containerRegisterQuery
/// </summary>
public string containerRegisterQuery { get; set; }
/// <summary> /// <summary>
/// 机构代码 /// 机构代码
/// </summary> /// </summary>
public string opOrgCode { get; set; } public string opOrgCode { get; set; }
/// <summary>
/// 机构名称
/// </summary>
public string opOrgName { get; set; }
/// <summary> /// <summary>
/// 登录人代码 /// 登录人代码
/// </summary> /// </summary>
@ -46,7 +54,7 @@ namespace SlnMesnac.RfidUpload.Model
public string rqzlmc { get; set; } public string rqzlmc { get; set; }
/// <summary> /// <summary>
/// 总包Id /// 总包id
/// </summary> /// </summary>
public string zbid { get; set; } public string zbid { get; set; }
@ -74,10 +82,5 @@ namespace SlnMesnac.RfidUpload.Model
/// 容器型号名称 /// 容器型号名称
/// </summary> /// </summary>
public string rqxhmc { get; set; } public string rqxhmc { get; set; }
/// <summary>
/// 容器条码
/// </summary>
public string rqtm { get; set; }
} }
} }

@ -1,4 +1,5 @@
using SlnMesnac.RfidUpload.Common; using SlnMesnac.RfidUpload.Common;
using SlnMesnac.RfidUpload.Model.apiParam;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Text; using System.Text;
@ -58,5 +59,47 @@ namespace SlnMesnac.RfidUpload.Model.config
get { return iNIFile.IniReadValue("SystemConfig", "FilterInterval"); } get { return iNIFile.IniReadValue("SystemConfig", "FilterInterval"); }
set { iNIFile.IniWriteValue("SystemConfig", "FilterInterval", value.ToString()); } set { iNIFile.IniWriteValue("SystemConfig", "FilterInterval", value.ToString()); }
} }
/// <summary>
/// 工作模式
/// </summary>
public string workModel
{
get { return iNIFile.IniReadValue("SystemConfig", "WorkModel"); }
set { iNIFile.IniWriteValue("SystemConfig", "WorkModel", value.ToString()); }
}
/// <summary>
/// 设备编码
/// </summary>
public string requestURL
{
get { return iNIFile.IniReadValue("SystemConfig", "RequestURL"); }
set { iNIFile.IniWriteValue("SystemConfig", "RequestURL", value.ToString()); }
}
public string sysCode
{
get { return iNIFile.IniReadValue("SystemConfig", "sysCode"); }
set { iNIFile.IniWriteValue("SystemConfig", "sysCode", value.ToString()); }
}
public string password
{
get { return iNIFile.IniReadValue("SystemConfig", "password"); }
set { iNIFile.IniWriteValue("SystemConfig", "password", value.ToString()); }
}
public string ak
{
get { return iNIFile.IniReadValue("SystemConfig", "ak"); }
set { iNIFile.IniWriteValue("SystemConfig", "ak", value.ToString()); }
}
public string sk
{
get { return iNIFile.IniReadValue("SystemConfig", "sk"); }
set { iNIFile.IniWriteValue("SystemConfig", "sk", value.ToString()); }
}
} }
} }

@ -0,0 +1,158 @@
using log4net.Config;
using log4net;
using System;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using System.Text;
#region << 版 本 注 释 >>
/*--------------------------------------------------------------------
* (c) 2024 WenJY
* CLR4.0.30319.42000
* T14-GEN3-7895
* SlnMesnac.RfidUpload.NLog
* 63646c4f-5bfd-4936-a480-7c23460ba2c0
*
* WenJY
*
* 2024-11-05 10:34:55
* V1.0.0
*
*
*--------------------------------------------------------------------
*
*
*
*
* V1.0.0
*--------------------------------------------------------------------*/
#endregion << 版 本 注 释 >>
namespace SlnMesnac.RfidUpload.NLog
{
public class LogHelper
{
private static readonly Lazy<LogHelper> _lazy = new Lazy<LogHelper>(() => new LogHelper());
public static LogHelper Instance
{
get
{
return _lazy.Value;
}
}
private LogHelper()
{
var logRepository = LogManager.GetRepository(Assembly.GetEntryAssembly());
XmlConfigurator.Configure(logRepository, new FileInfo("log4net.config"));
}
public readonly log4net.ILog loginfo = log4net.LogManager.GetLogger("loginfo");
public readonly log4net.ILog logerror = log4net.LogManager.GetLogger("logerror");
public readonly log4net.ILog logPlc = log4net.LogManager.GetLogger("plclog");
public readonly log4net.ILog logRfid = log4net.LogManager.GetLogger("rfidlog");
public readonly log4net.ILog logView = log4net.LogManager.GetLogger("viewlog");
public readonly log4net.ILog sqllog = log4net.LogManager.GetLogger("sqllog");
public readonly log4net.ILog semaphorelog = log4net.LogManager.GetLogger("semaphorelog");
/// <summary>
/// 记录Info日志
/// </summary>
/// <param name="msg"></param>
/// <param name="ex"></param>
public void Info(string msg)
{
if (loginfo.IsInfoEnabled)
{
loginfo.Info(msg);
}
}
/// <summary>
/// 记录PLC日志
/// </summary>
/// <param name="msg"></param>
public void PlcLog(string msg)
{
if (logPlc.IsInfoEnabled)
{
logPlc.Info(msg);
}
}
/// <summary>
/// 记录Rfid日志
/// </summary>
/// <param name="msg"></param>
public void RfidLog(string msg)
{
if (logRfid.IsInfoEnabled)
{
logRfid.Info(msg);
}
}
/// <summary>
/// 界面日志
/// </summary>
/// <param name="msg"></param>
public void ViewLog(string msg)
{
if (logView.IsInfoEnabled)
{
logView.Info(msg);
}
}
public void SqlLog(string msg)
{
if (sqllog.IsInfoEnabled)
{
sqllog.Info(msg);
}
}
public void SemaphoreLog(string msg)
{
if (semaphorelog.IsInfoEnabled)
{
semaphorelog.Info(msg);
}
}
/// <summary>
/// 记录Error日志
/// </summary>
/// <param name="errorMsg"></param>
/// <param name="ex"></param>
public void Error(string info, Exception ex = null)
{
if (!string.IsNullOrEmpty(info) && ex == null)
{
logerror.ErrorFormat("【附加信息】 : {0}<br>", new object[] { info });
}
else if (!string.IsNullOrEmpty(info) && ex != null)
{
string errorMsg = BeautyErrorMsg(ex);
logerror.ErrorFormat("【附加信息】 : {0}<br>{1}", new object[] { info, errorMsg });
}
else if (string.IsNullOrEmpty(info) && ex != null)
{
string errorMsg = BeautyErrorMsg(ex);
logerror.Error(errorMsg);
}
}
/// <summary>
/// 美化错误信息
/// </summary>
/// <param name="ex">异常</param>
/// <returns>错误信息</returns>
private string BeautyErrorMsg(Exception ex)
{
string errorMsg = string.Format("【异常类型】:{0} <br>【异常信息】:{1} <br>【堆栈调用】:{2}", new object[] { ex.GetType().Name, ex.Message, ex.StackTrace });
errorMsg = errorMsg.Replace("\r\n", "<br>");
errorMsg = errorMsg.Replace("位置", "<strong style=\"color:red\">位置</strong>");
return errorMsg;
}
}
}

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework> <TargetFramework>netstandard2.1</TargetFramework>
@ -10,16 +10,15 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ApplicationDefinition Include="C:\Users\Administrator\.nuget\packages\nlog.config\4.7.15\contentFiles\any\any\NLog.config" /> <Reference Include="log4net">
<HintPath>..\packages\log4net.dll</HintPath>
</Reference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="C:\Users\Administrator\.nuget\packages\nlog.config\4.7.15\contentFiles\any\any\NLog.config" /> <None Update="log4net.config">
</ItemGroup> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<ItemGroup>
<PackageReference Include="NLog.Config" Version="4.7.15" />
<PackageReference Include="NLog.Web.AspNetCore" Version="5.3.7" />
</ItemGroup> </ItemGroup>
</Project> </Project>

@ -0,0 +1,153 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="log4net" type="System.Configuration.IgnoreSectionHandler"/>
</configSections>
<appSettings>
</appSettings>
<log4net>
<!--错误日志类-->
<logger name="logerror">
<level value="ALL" />
<appender-ref ref="ErrorAppender" />
</logger>
<!--信息日志类-->
<logger name="loginfo">
<level value="ALL" />
<appender-ref ref="InfoAppender" />
</logger>
<!--PLC日志类-->
<logger name="plclog">
<level value="ALL" />
<appender-ref ref="PlcAppender" />
</logger>
<!--RFID日志类-->
<logger name="rfidlog">
<level value="ALL" />
<appender-ref ref="RfidAppender" />
</logger>
<!--RFID日志类-->
<logger name="viewlog">
<level value="ALL" />
<appender-ref ref="ViewAppender" />
</logger>
<!--Sql日志类-->
<logger name="sqllog">
<level value="ALL" />
<appender-ref ref="SqlAppender" />
</logger>
<!--信号量日志类-->
<logger name="semaphorelog">
<level value="ALL" />
<appender-ref ref="SemaphoreAppender" />
</logger>
<!--错误日志附加介质-->
<appender name="ErrorAppender" type="log4net.Appender.RollingFileAppender">
<param name="File" value="Log\" />
<param name="AppendToFile" value="true" />
<param name="MaxSizeRollBackups" value="100" />
<param name="MaxFileSize" value="10240" />
<param name="StaticLogFileName" value="false" />
<param name="DatePattern" value='yyyy-MM-dd/"LogError.html"'/>
<param name="RollingStyle" value="Date" />
<layout type="log4net.Layout.PatternLayout">
<param name="ConversionPattern" value="&lt;HR COLOR=red&gt;%n异常时间%d [%t] &lt;BR&gt;%n异常级别%-5p &lt;BR&gt;%n异 常 类:%c [%x] &lt;BR&gt;%n%m &lt;BR&gt;%n &lt;HR Size=1&gt;" />
</layout>
</appender>
<!--信息日志附加介质-->
<appender name="InfoAppender" type="log4net.Appender.RollingFileAppender">
<param name="File" value="Log\" />
<param name="AppendToFile" value="true" />
<param name="MaxFileSize" value="10240" />
<param name="MaxSizeRollBackups" value="100" />
<param name="StaticLogFileName" value="false" />
<param name="DatePattern" value='yyyy-MM-dd/"LogInfo.txt"' />
<param name="RollingStyle" value="Date" />
<!--信息日志布局-->
<layout type="log4net.Layout.PatternLayout">
<param name="ConversionPattern" value="&lt;--------------&gt;%n日志时间%d [%t] %n日志级别%-5p %n日志内容%m %n " />
</layout>
</appender>
<!--PLC日志附加介质-->
<appender name="PlcAppender" type="log4net.Appender.RollingFileAppender">
<param name="File" value="Log\" />
<param name="AppendToFile" value="true" />
<param name="MaxFileSize" value="10240" />
<param name="MaxSizeRollBackups" value="100" />
<param name="StaticLogFileName" value="false" />
<param name="DatePattern" value='yyyy-MM-dd/"PlcLog.txt"' />
<param name="RollingStyle" value="Date" />
<!--信息日志布局-->
<layout type="log4net.Layout.PatternLayout">
<param name="ConversionPattern" value="&lt;--------------&gt;%n日志时间%d [%t] %n日志级别%-5p %n日志内容%m %n " />
</layout>
</appender>
<!--Rfid日志附加介质-->
<appender name="RfidAppender" type="log4net.Appender.RollingFileAppender">
<param name="File" value="Log\" />
<param name="AppendToFile" value="true" />
<param name="MaxFileSize" value="10240" />
<param name="MaxSizeRollBackups" value="100" />
<param name="StaticLogFileName" value="false" />
<param name="DatePattern" value='yyyy-MM-dd/"RfidLog.txt"' />
<param name="RollingStyle" value="Date" />
<!--信息日志布局-->
<layout type="log4net.Layout.PatternLayout">
<param name="ConversionPattern" value="&lt;--------------&gt;%n日志时间%d [%t] %n日志级别%-5p %n日志内容%m %n " />
</layout>
</appender>
<appender name="ViewAppender" type="log4net.Appender.RollingFileAppender">
<param name="File" value="Log\" />
<param name="AppendToFile" value="true" />
<param name="MaxFileSize" value="10240" />
<param name="MaxSizeRollBackups" value="100" />
<param name="StaticLogFileName" value="false" />
<param name="DatePattern" value='yyyy-MM-dd/"ViewLog.txt"' />
<param name="RollingStyle" value="Date" />
<!--信息日志布局-->
<layout type="log4net.Layout.PatternLayout">
<param name="ConversionPattern" value="&lt;--------------&gt;%n日志时间%d [%t] %n日志级别%-5p %n日志内容%m %n " />
</layout>
</appender>
<appender name="SqlAppender" type="log4net.Appender.RollingFileAppender">
<param name="File" value="Log\" />
<param name="AppendToFile" value="true" />
<param name="MaxFileSize" value="10240" />
<param name="MaxSizeRollBackups" value="100" />
<param name="StaticLogFileName" value="false" />
<param name="DatePattern" value='yyyy-MM-dd/"SqlLog.txt"' />
<param name="RollingStyle" value="Date" />
<!--信息日志布局-->
<layout type="log4net.Layout.PatternLayout">
<param name="ConversionPattern" value="&lt;--------------&gt;%n日志时间%d [%t] %n日志级别%-5p %n日志内容%m %n " />
</layout>
</appender>
<appender name="SemaphoreAppender" type="log4net.Appender.RollingFileAppender">
<param name="File" value="Log\" />
<param name="AppendToFile" value="true" />
<param name="MaxFileSize" value="10240" />
<param name="MaxSizeRollBackups" value="100" />
<param name="StaticLogFileName" value="false" />
<param name="DatePattern" value='yyyy-MM-dd/"SemaphoreLog.txt"' />
<param name="RollingStyle" value="Date" />
<!--信息日志布局-->
<layout type="log4net.Layout.PatternLayout">
<param name="ConversionPattern" value="&lt;--------------&gt;%n日志时间%d [%t] %n日志级别%-5p %n日志内容%m %n " />
</layout>
</appender>
</log4net>
</configuration>

@ -0,0 +1,133 @@
using SlnMesnac.RfidUpload.Model;
using SlnMesnac.RfidUpload.Model.apiParam;
using System;
using System.Collections.Generic;
using System.Text;
using TouchSocket.Rpc;
using TouchSocket.WebApi;
#region << 版 本 注 释 >>
/*--------------------------------------------------------------------
* (c) 2024 WenJY
* CLR4.0.30319.42000
* T14-GEN3-7895
* SlnMesnac.RfidUpload.TouchSocket
* f4ca948d-1fdb-4241-8251-2858f027de04
*
* WenJY
*
* 2024-07-02 15:42:57
* V1.0.0
*
*
*--------------------------------------------------------------------
*
*
*
*
* V1.0.0
*--------------------------------------------------------------------*/
#endregion << 版 本 注 释 >>
namespace SlnMesnac.RfidUpload.TouchSocket
{
public partial class ApiServer : RpcServer
{
private static ApiServer instance;
private ApiServer() { }
public static ApiServer GetInstance()
{
if (instance == null)
{
lock (typeof(ApiServer))
{
if (instance == null)
{
instance = new ApiServer();
}
}
}
return instance;
}
public delegate void RefreshScanInfoInCenterStart();
/// <summary>
/// 入库开始事件刷新
/// </summary>
public event RefreshScanInfoInCenterStart RefreshScanInfoInCenterStartEvent;
public delegate void RefreshScanInfoInCenterStop();
/// <summary>
/// 入库结束事件刷新
/// </summary>
public event RefreshScanInfoInCenterStop RefreshScanInfoInCenterStopEvent;
public delegate void RefreshScanInfoOutCenterStart();
/// <summary>
/// 出库开始事件刷新
/// </summary>
public event RefreshScanInfoOutCenterStart RefreshScanInfoOutCenterStartEvent;
public delegate void RefreshScanInfoOutCenterStop();
/// <summary>
/// 出库结束事件刷新
/// </summary>
public event RefreshScanInfoOutCenterStop RefreshScanInfoOutCenterStopEvent;
/// <summary>
/// 入库开始
/// </summary>
/// <param name="messageHeader"></param>
/// <param name="containerRegisterQuery"></param>
/// <returns></returns>
[EnableCors("cors")]
[WebApi(HttpMethodType.POST)]
public ApiResult getScanInfoInCenterStart(string messageHeader,InStoreParam containerRegisterQuery)
{
RefreshScanInfoInCenterStartEvent?.Invoke();
return ApiResult.Success();
}
/// <summary>
/// 入库结束
/// </summary>
/// <param name="messageHeader"></param>
/// <param name="containerRegisterQuery"></param>
/// <returns></returns>
[EnableCors("cors")]
[WebApi(HttpMethodType.POST)]
public ApiResult getScanInfoInCenterStop(string messageHeader, InStoreParam containerRegisterQuery)
{
RefreshScanInfoInCenterStopEvent?.Invoke();
return ApiResult.Success();
}
/// <summary>
/// 出库开始
/// </summary>
/// <param name="messageHeader"></param>
/// <param name="containerRegisterQuery"></param>
/// <returns></returns>
[WebApi(HttpMethodType.POST)]
public ApiResult getScanInfoOutCenterStart(string messageHeader, OutStoreParam containerRegisterQuery)
{
RefreshScanInfoOutCenterStartEvent?.Invoke();
return ApiResult.Success();
}
/// <summary>
/// 出库结束
/// </summary>
/// <param name="messageHeader"></param>
/// <param name="containerRegisterQuery"></param>
/// <returns></returns>
[WebApi(HttpMethodType.POST)]
public ApiResult getScanInfoOutCenterStop(string messageHeader, OutStoreParam containerRegisterQuery)
{
RefreshScanInfoOutCenterStopEvent?.Invoke();
return ApiResult.Success();
}
}
}

@ -6,11 +6,13 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="TouchSocket" Version="1.3.9" /> <PackageReference Include="TouchSocket.WebApi" Version="2.0.10" />
<PackageReference Include="TouchSocket.WebApi.Swagger" Version="2.0.10" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\SlnMesnac.RfidUpload.Model\SlnMesnac.RfidUpload.Model.csproj" /> <ProjectReference Include="..\SlnMesnac.RfidUpload.Model\SlnMesnac.RfidUpload.Model.csproj" />
<ProjectReference Include="..\SlnMesnac.RfidUpload.NLog\SlnMesnac.RfidUpload.NLog.csproj" />
</ItemGroup> </ItemGroup>
</Project> </Project>

@ -1,6 +1,17 @@
using SlnMesnac.RfidUpload.Model; using Newtonsoft.Json;
using SlnMesnac.RfidUpload.Common;
using SlnMesnac.RfidUpload.Model;
using SlnMesnac.RfidUpload.Model.config;
using SlnMesnac.RfidUpload.NLog;
using System; using System;
using TouchSocket.Rpc.WebApi; using System.IO;
using System.Net;
using System.Text;
using System.Threading.Tasks;
using TouchSocket.Core;
using TouchSocket.Rpc;
using TouchSocket.Sockets;
using TouchSocket.WebApi;
namespace SlnMesnac.RfidUpload.TouchSocket namespace SlnMesnac.RfidUpload.TouchSocket
{ {
@ -18,40 +29,68 @@ namespace SlnMesnac.RfidUpload.TouchSocket
} }
} }
#endregion #endregion
private LogHelper logger = LogHelper.Instance;
private JsonChange jsonChange = JsonChange.Instance;
private AppConfig appConfig = AppConfig.Instance;
private WebApiClientApp() { } private WebApiClientApp() { }
private WebApiClient CreateWebApiClient(string url) private WebApiClientSlim CreateWebApiClient(string url)
{ {
WebApiClient client = new WebApiClient(); var client = new WebApiClientSlim(new System.Net.Http.HttpClient());
client.Setup(url); client.Setup(new TouchSocketConfig()
client.Connect(); .SetRemoteIPHost("http://127.0.0.1:9090")
Console.WriteLine("连接成功"); .ConfigurePlugins(a =>
{
}));
return client; return client;
} }
public void Upload(string url) public string UploadAsync(int code,string paramStr)
{ {
string result = string.Empty;
try try
{ {
var client = CreateWebApiClient(url);
var param = new ContainerInbound() var param = new ContainerInbound()
{ {
messageHeader = Guid.NewGuid().ToString(), code = code,
batchOpenQuery = "OK", requestURL = appConfig.requestURL,
opOrgCode = Guid.NewGuid().ToString() sysCode = appConfig.sysCode,
password = appConfig.password,
ak = appConfig.ak,
sk = appConfig.sk,
containerRegisterQuery = paramStr
}; };
var str = jsonChange.ModeToJson(param);
var sum2 = client.Invoke<ActionResult>("POST:/Server/ContainerInboundApi", null, param); logger.Info($"请求CSB接口调用服务,参数:{str}");
Console.WriteLine($"Post调用成功结果{sum2.Message}"); result = Post("http://127.0.0.1:9090/api/uploadCsb", param);
logger.Info($"CSB接口返回信息:{result}");
} }
catch (Exception e) catch (Exception e)
{ {
Console.WriteLine(e.Message); Console.WriteLine(e.Message);
result = e.Message;
logger.Info($"请求CSB接口调用服务异常:{e.Message}");
} }
return result;
}
public static string Post(string url, object postData)
{
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url);
req.Method = "POST";
req.ContentType = "application/json";
req.Timeout = 5000;
if (req == null) return string.Empty;
byte[] data = Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(postData));
using (Stream reqStream = req.GetRequestStream())
reqStream.Write(data, 0, data.Length);
using (HttpWebResponse resp = (HttpWebResponse)req.GetResponse())
using (Stream stream = resp.GetResponseStream())
using (StreamReader reader = new StreamReader(stream, Encoding.UTF8))
return reader.ReadToEnd();
} }
} }
} }

@ -0,0 +1,118 @@
using System;
using System.IO;
using System.Threading.Tasks;
using TouchSocket.Core;
using TouchSocket.Http;
using TouchSocket.Rpc;
using TouchSocket.Sockets;
using TouchSocket.WebApi;
using TouchSocket.WebApi.Swagger;
#region << 版 本 注 释 >>
/*--------------------------------------------------------------------
* (c) 2024 WenJY
* CLR4.0.30319.42000
* T14-GEN3-7895
* SlnMesnac.RfidUpload.TouchSocket
* 2f39e963-acb9-44d1-9980-27aaa910de29
*
* WenJY
*
* 2024-07-02 15:35:25
* V1.0.0
*
*
*--------------------------------------------------------------------
*
*
*
*
* V1.0.0
*--------------------------------------------------------------------*/
#endregion << 版 本 注 释 >>
namespace SlnMesnac.RfidUpload.TouchSocket
{
public sealed class WebApiServerApp
{
private static readonly Lazy<WebApiServerApp> _lazy = new Lazy<WebApiServerApp>(() => new WebApiServerApp());
public static WebApiServerApp Instance
{
get
{
return _lazy.Value;
}
}
private WebApiServerApp() { }
private ApiServer apiServer = ApiServer.GetInstance();
public void Init()
{
try
{
var service = new HttpService();
service.Setup(new TouchSocketConfig()
.SetListenIPHosts(7789)
.ConfigureContainer(a =>
{
a.AddRpcStore(store =>
{
store.RegisterServer<ApiServer>(apiServer);//注册服务
});
a.AddCors(corsOption =>
{
corsOption.Add("cors", corsBuilder =>
{
corsBuilder.AllowAnyMethod()
.AllowAnyOrigin();
});
});
a.AddLogger(logger =>
{
logger.AddConsoleLogger();
logger.AddFileLogger();
});
})
.ConfigurePlugins(a =>
{
a.UseCheckClear();
a.Add<AuthenticationPlugin>();
a.UseWebApi()
.ConfigureConverter(converter =>
{
converter.AddJsonSerializerFormatter(new Newtonsoft.Json.JsonSerializerSettings() { Formatting = Newtonsoft.Json.Formatting.None });
});
a.UseSwagger();//使用Swagger页面
//.UseLaunchBrowser();
a.UseDefaultHttpServicePlugin();
}));
service.Start();
Console.WriteLine("以下连接用于测试webApi");
Console.WriteLine($"使用http://127.0.0.1:7789/swagger/index.html");
}catch(Exception ex)
{
Console.WriteLine(ex.ToString());
}
//Console.ReadLine();
}
}
internal class AuthenticationPlugin : PluginBase, IHttpPlugin
{
public async Task OnHttpRequest(IHttpSocketClient client, HttpContextEventArgs e)
{
await e.InvokeNext();
}
}
}

@ -4,11 +4,16 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:SlnMesnac.RfidUpload.UI" xmlns:local="clr-namespace:SlnMesnac.RfidUpload.UI"
xmlns:local1="clr-namespace:SlnMesnac.RfidUpload.UI.converter"
mc:Ignorable="d" mc:Ignorable="d"
Title="海威物联RFID移动盘点系统" Height="766" Width="1268" ResizeMode="NoResize" Topmost="False"> Title="海威物联RFID移动盘点系统" Height="766" Width="1268"
<!--<Window.Background> WindowState="Maximized" WindowStyle="SingleBorderWindow" >
<ImageBrush ImageSource="/templates/image/background.jpg" /> <!--ResizeMode="NoResize" Topmost="False"-->
</Window.Background>-->
<Window.Resources>
<local1:WorkModelParamConverter x:Key="WorkModelParamConverter" />
</Window.Resources>
<Border Margin="5" Background="White" CornerRadius="10"> <Border Margin="5" Background="White" CornerRadius="10">
<Grid> <Grid>
@ -23,53 +28,78 @@
</Border.Effect> </Border.Effect>
<Grid> <Grid>
<Grid.ColumnDefinitions> <Grid.RowDefinitions>
<ColumnDefinition Width="3*"/> <RowDefinition/>
<ColumnDefinition Width="2*"/> <RowDefinition/>
</Grid.ColumnDefinitions> </Grid.RowDefinitions>
<StackPanel Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Left" Orientation="Horizontal">
<Button Content="打开串口" Command="{Binding OpenSerialPortCommand}" Style="{StaticResource BUTTON_AGREE}" Width="100" Height="30" Background="#009900" BorderBrush="#009900" Margin="10,0,10,0"/> <Border Grid.Row="0">
<Button Content="关闭串口" Command="{Binding CloseSerialPortCommand}" Style="{StaticResource BUTTON_AGREE}" Width="100" Height="30" Background="#FF0033" BorderBrush="#FF0033" Margin="0,0,10,0"/> <StackPanel Grid.Row="0" Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Center">
<Button Content="导出文件" Command="{Binding ExportFilesCommand}" Style="{StaticResource BUTTON_AGREE}" Width="100" Height="30" Background="#007DFA" BorderBrush="#007DFA" Margin="0,0,10,0"/> <TextBlock Text="串口:" FontSize="16" FontWeight="Black" Foreground="#006699" Margin="10,5,10,0"/>
<Button Content="清空列表" Command="{Binding EmptyFilesCommand}" Style="{StaticResource BUTTON_AGREE}" Width="100" Height="30" Background="Orange" BorderBrush="Orange" Margin="0,0,10,0"/> <ComboBox FontSize="16" ItemsSource="{Binding SerialPortItems}" SelectedItem="{Binding SelectedSerialPortItems}" Width="120" Height="30"/>
<TextBlock Text="波特率:" FontSize="16" FontWeight="Black" Foreground="#006699" Margin="10,5,10,0"/>
<Label Content="数 量 :" FontSize="20" FontWeight="Black" Foreground="#00CC33" Margin="20,0,0,0"/> <ComboBox FontSize="16" ItemsSource="{Binding BaudRateItems}" SelectedItem="{Binding SelectedBaudRateItems}" Width="120" Height="30"/>
<Label Content="{Binding LabelCountParam}" FontSize="20" FontWeight="Black" Foreground="#00CC33" Margin="5,0,10,0"/> <TextBlock Text="数据位:" FontSize="16" FontWeight="Black" Foreground="#006699" Margin="10,5,10,0"/>
</StackPanel> <ComboBox FontSize="16" ItemsSource="{Binding DataBitsItems}" SelectedItem="{Binding SelectedDataBitsItems}" Width="120" Height="30"/>
<TextBlock Text="停止位:" FontSize="16" FontWeight="Black" Foreground="#006699" Margin="10,5,10,0"/>
<StackPanel Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Right" Orientation="Horizontal"> <ComboBox FontSize="16" ItemsSource="{Binding StopBitsItems}" SelectedItem="{Binding SelectedStopBitsItems}" Width="120" Height="30"/>
<TextBlock Text="校验位:" FontSize="16" FontWeight="Black" Foreground="#006699" Margin="10,5,10,0"/>
<ComboBox FontSize="16" ItemsSource="{Binding ParityItems}" SelectedItem="{Binding SelectedParityItems}" Width="120" Height="30"/>
</StackPanel>
</Border>
<Border Grid.Row="1">
<Grid> <Grid>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/> <ColumnDefinition Width="3*"/>
<ColumnDefinition Width="*"/> <ColumnDefinition Width="2*"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<StackPanel Grid.Column="0" VerticalAlignment="Center"> <StackPanel Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Left" Orientation="Horizontal">
<TextBlock Text="串口连接状态" FontSize="20" FontWeight="Black" Foreground="#006699" Margin="2,0,10,0"/> <Button Content="打开串口" Command="{Binding OpenSerialPortCommand}" Style="{StaticResource BUTTON_AGREE}" Width="100" Height="30" Background="#009900" BorderBrush="#009900" Margin="10,0,10,0"/>
<Button Content="关闭串口" Command="{Binding CloseSerialPortCommand}" Style="{StaticResource BUTTON_AGREE}" Width="100" Height="30" Background="#FF0033" BorderBrush="#FF0033" Margin="0,0,10,0"/>
<Button Content="导出文件" Command="{Binding ExportFilesCommand}" Style="{StaticResource BUTTON_AGREE}" Width="100" Height="30" Background="#007DFA" BorderBrush="#007DFA" Margin="0,0,10,0"/>
<Button Content="清空列表" Command="{Binding EmptyFilesCommand}" Style="{StaticResource BUTTON_AGREE}" Width="100" Height="30" Background="Orange" BorderBrush="Orange" Margin="0,0,10,0"/>
<Label Content="数 量 :" FontSize="20" FontWeight="Black" Foreground="#00CC33" Margin="20,0,0,0"/>
<Label Content="{Binding LabelCountParam}" FontSize="20" FontWeight="Black" Foreground="#00CC33" Margin="5,0,10,0"/>
</StackPanel> </StackPanel>
<StackPanel Grid.Column="1" Margin="0,0,20,0">
<Ellipse Width="30" Height="30"> <StackPanel Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Right" Orientation="Horizontal">
<Ellipse.Style> <Grid>
<Style TargetType="Ellipse"> <Grid.ColumnDefinitions>
<Style.Triggers> <ColumnDefinition Width="*"/>
<DataTrigger Binding="{Binding RfidDeviceStatus}" Value="0"> <ColumnDefinition Width="*"/>
<Setter Property="Shape.Fill" Value="Orange"/> </Grid.ColumnDefinitions>
</DataTrigger> <StackPanel Grid.Column="0" VerticalAlignment="Center">
<DataTrigger Binding="{Binding RfidDeviceStatus}" Value="1"> <TextBlock Text="串口连接状态" FontSize="20" FontWeight="Black" Foreground="#006699" Margin="2,0,10,0"/>
<Setter Property="Shape.Fill" Value="Green"/> </StackPanel>
</DataTrigger> <StackPanel Grid.Column="1" Margin="0,0,20,0">
<DataTrigger Binding="{Binding RfidDeviceStatus}" Value="2"> <Ellipse Width="30" Height="30">
<Setter Property="Shape.Fill" Value="Red"/> <Ellipse.Style>
</DataTrigger> <Style TargetType="Ellipse">
</Style.Triggers> <Style.Triggers>
</Style> <DataTrigger Binding="{Binding RfidDeviceStatus}" Value="0">
</Ellipse.Style> <Setter Property="Shape.Fill" Value="Orange"/>
</Ellipse> </DataTrigger>
<DataTrigger Binding="{Binding RfidDeviceStatus}" Value="1">
<Setter Property="Shape.Fill" Value="Green"/>
</DataTrigger>
<DataTrigger Binding="{Binding RfidDeviceStatus}" Value="2">
<Setter Property="Shape.Fill" Value="Red"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Ellipse.Style>
</Ellipse>
</StackPanel>
</Grid>
</StackPanel> </StackPanel>
</Grid> </Grid>
</Border>
</StackPanel>
</Grid> </Grid>
</Border> </Border>
<Border Grid.Row="1" BorderThickness="2" CornerRadius="5" Background="White" Margin="5"> <Border Grid.Row="1" BorderThickness="2" CornerRadius="5" Background="White" Margin="5">
<Border.Effect> <Border.Effect>
@ -94,7 +124,7 @@
Foreground="#0288d1" > Foreground="#0288d1" >
<!--resourceStyle 399行修改选中字体颜色--> <!--resourceStyle 399行修改选中字体颜色-->
<DataGrid.Columns> <DataGrid.Columns>
<DataGridTextColumn Binding="{Binding no}" Header="stx" Width="80" IsReadOnly="True"/> <DataGridTextColumn Binding="{Binding no}" Header="no" Width="80" IsReadOnly="True"/>
<DataGridTextColumn Binding="{Binding stx}" Header="stx" Width="80" IsReadOnly="True"/> <DataGridTextColumn Binding="{Binding stx}" Header="stx" Width="80" IsReadOnly="True"/>
<DataGridTextColumn Binding="{Binding len}" Header="len" Width="150" IsReadOnly="True"/> <DataGridTextColumn Binding="{Binding len}" Header="len" Width="150" IsReadOnly="True"/>
<DataGridTextColumn Binding="{Binding cmd}" Header="cmd" Width="150" IsReadOnly="True"/> <DataGridTextColumn Binding="{Binding cmd}" Header="cmd" Width="150" IsReadOnly="True"/>
@ -125,7 +155,29 @@
<!--日志信息--> <!--日志信息-->
<Border Grid.Row="1" BorderBrush="Green" BorderThickness="0" CornerRadius="5" Background="Transparent" Margin="1"> <Border Grid.Row="1" BorderBrush="Green" BorderThickness="0" CornerRadius="5" Background="Transparent" Margin="1">
<ListBox x:Name="listBox" ItemsSource="{Binding LogInfoListBox}" FontSize="14" Foreground="Gray" Background="Transparent" BorderBrush="Transparent" ScrollViewer.HorizontalScrollBarVisibility="Hidden" ScrollViewer.VerticalScrollBarVisibility="Hidden"/>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="6*"/>
<RowDefinition Height="3*"/>
</Grid.RowDefinitions>
<Border Grid.Row="0" BorderBrush="Green" BorderThickness="0" CornerRadius="5" Background="Transparent" Margin="1">
<ListBox Grid.Row="0" x:Name="listBox" ItemsSource="{Binding LogInfoListBox}" FontSize="14" Foreground="Gray" Background="Transparent" BorderBrush="Transparent" ScrollViewer.HorizontalScrollBarVisibility="Hidden" ScrollViewer.VerticalScrollBarVisibility="Hidden"/>
</Border>
<StackPanel Grid.Row="1" Orientation="Horizontal" VerticalAlignment="Center">
<Button Content="新容器入库" Command="{Binding SetWorkModelCommand}" CommandParameter="101" Style="{StaticResource BUTTON_AGREE}" Width="120" Height="30" Background="Orange" BorderBrush="Orange" Margin="10,0,10,0"/>
<Button Content="容器封发-按调拨单" Command="{Binding SetWorkModelCommand}" CommandParameter="103" Style="{StaticResource BUTTON_AGREE}" Width="120" Height="30" Background="#8771DC" BorderBrush="#8771DC" Margin="0,0,10,0"/>
<Button Content="库存容器封发配发" Command="{Binding SetWorkModelCommand}" CommandParameter="3" Style="{StaticResource BUTTON_AGREE}" Width="120" Height="30" Background="#52ACBD" BorderBrush="#52ACBD" Margin="0,0,10,0"/>
<Button Content="卸车容器封发配发" Command="{Binding SetWorkModelCommand}" CommandParameter="4" Style="{StaticResource BUTTON_AGREE}" Width="120" Height="30" Background="#007DFA" BorderBrush="#007DFA" Margin="0,0,10,0"/>
<Button Content="关 闭" Command="{Binding SetWorkModelCommand}" CommandParameter="5" Style="{StaticResource BUTTON_AGREE}" Width="100" Height="30" Background="#FF0033" BorderBrush="#FF0033" Margin="0,0,10,0"/>
<Label Content="工作模式 :" FontSize="20" FontWeight="Black" Foreground="#00CC33" Margin="20,0,0,0"/>
<Label Content="{Binding WorkModelParam, Converter={StaticResource WorkModelParamConverter}}" FontSize="20" FontWeight="Black" Foreground="#00CC33" Margin="5,0,10,0"/>
</StackPanel>
</Grid>
</Border> </Border>
</Grid> </Grid>
</Border> </Border>

@ -0,0 +1,289 @@
/*
Rpc
*/
#pragma warning disable
using System;
using TouchSocket.Core;
using TouchSocket.Sockets;
using TouchSocket.Rpc;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
using System.Threading.Tasks;
namespace WebApiProxy
{
public interface IApiServer:TouchSocket.Rpc.IRemoteServer
{
///<summary>
///无注释信息
///</summary>
/// <exception cref="System.TimeoutException">调用超时</exception>
/// <exception cref="TouchSocket.Rpc.RpcInvokeException">Rpc调用异常</exception>
/// <exception cref="System.Exception">其他异常</exception>
SlnMesnac.RfidUpload.Model.apiParam.ApiResult getScanInfoInCenterStart(System.String messageHeader,SlnMesnac.RfidUpload.Model.apiParam.InStoreParam containerRegisterQuery,IInvokeOption invokeOption = default);
///<summary>
///无注释信息
///</summary>
/// <exception cref="System.TimeoutException">调用超时</exception>
/// <exception cref="TouchSocket.Rpc.RpcInvokeException">Rpc调用异常</exception>
/// <exception cref="System.Exception">其他异常</exception>
Task<SlnMesnac.RfidUpload.Model.apiParam.ApiResult> getScanInfoInCenterStartAsync(System.String messageHeader,SlnMesnac.RfidUpload.Model.apiParam.InStoreParam containerRegisterQuery,IInvokeOption invokeOption = default);
///<summary>
///无注释信息
///</summary>
/// <exception cref="System.TimeoutException">调用超时</exception>
/// <exception cref="TouchSocket.Rpc.RpcInvokeException">Rpc调用异常</exception>
/// <exception cref="System.Exception">其他异常</exception>
SlnMesnac.RfidUpload.Model.apiParam.ApiResult getScanInfoInCenterStop(System.String messageHeader,SlnMesnac.RfidUpload.Model.apiParam.InStoreParam containerRegisterQuery,IInvokeOption invokeOption = default);
///<summary>
///无注释信息
///</summary>
/// <exception cref="System.TimeoutException">调用超时</exception>
/// <exception cref="TouchSocket.Rpc.RpcInvokeException">Rpc调用异常</exception>
/// <exception cref="System.Exception">其他异常</exception>
Task<SlnMesnac.RfidUpload.Model.apiParam.ApiResult> getScanInfoInCenterStopAsync(System.String messageHeader,SlnMesnac.RfidUpload.Model.apiParam.InStoreParam containerRegisterQuery,IInvokeOption invokeOption = default);
///<summary>
///无注释信息
///</summary>
/// <exception cref="System.TimeoutException">调用超时</exception>
/// <exception cref="TouchSocket.Rpc.RpcInvokeException">Rpc调用异常</exception>
/// <exception cref="System.Exception">其他异常</exception>
SlnMesnac.RfidUpload.Model.apiParam.ApiResult getScanInfoOutCenterStart(System.String messageHeader,SlnMesnac.RfidUpload.Model.apiParam.OutStoreParam containerRegisterQuery,IInvokeOption invokeOption = default);
///<summary>
///无注释信息
///</summary>
/// <exception cref="System.TimeoutException">调用超时</exception>
/// <exception cref="TouchSocket.Rpc.RpcInvokeException">Rpc调用异常</exception>
/// <exception cref="System.Exception">其他异常</exception>
Task<SlnMesnac.RfidUpload.Model.apiParam.ApiResult> getScanInfoOutCenterStartAsync(System.String messageHeader,SlnMesnac.RfidUpload.Model.apiParam.OutStoreParam containerRegisterQuery,IInvokeOption invokeOption = default);
///<summary>
///无注释信息
///</summary>
/// <exception cref="System.TimeoutException">调用超时</exception>
/// <exception cref="TouchSocket.Rpc.RpcInvokeException">Rpc调用异常</exception>
/// <exception cref="System.Exception">其他异常</exception>
SlnMesnac.RfidUpload.Model.apiParam.ApiResult getScanInfoOutCenterStop(System.String messageHeader,SlnMesnac.RfidUpload.Model.apiParam.OutStoreParam containerRegisterQuery,IInvokeOption invokeOption = default);
///<summary>
///无注释信息
///</summary>
/// <exception cref="System.TimeoutException">调用超时</exception>
/// <exception cref="TouchSocket.Rpc.RpcInvokeException">Rpc调用异常</exception>
/// <exception cref="System.Exception">其他异常</exception>
Task<SlnMesnac.RfidUpload.Model.apiParam.ApiResult> getScanInfoOutCenterStopAsync(System.String messageHeader,SlnMesnac.RfidUpload.Model.apiParam.OutStoreParam containerRegisterQuery,IInvokeOption invokeOption = default);
}
public class ApiServer :IApiServer
{
public ApiServer(IRpcClient client)
{
this.Client=client;
}
public IRpcClient Client{get;private set; }
///<summary>
///无注释信息
///</summary>
/// <exception cref="System.TimeoutException">调用超时</exception>
/// <exception cref="TouchSocket.Rpc.RpcInvokeException">Rpc调用异常</exception>
/// <exception cref="System.Exception">其他异常</exception>
public SlnMesnac.RfidUpload.Model.apiParam.ApiResult getScanInfoInCenterStart(System.String messageHeader,SlnMesnac.RfidUpload.Model.apiParam.InStoreParam containerRegisterQuery,IInvokeOption invokeOption = default)
{
if(Client==null)
{
throw new RpcException("IRpcClient为空请先初始化或者进行赋值");
}
object[] parameters = new object[]{messageHeader,containerRegisterQuery};
SlnMesnac.RfidUpload.Model.apiParam.ApiResult returnData=(SlnMesnac.RfidUpload.Model.apiParam.ApiResult)Client.Invoke(typeof(SlnMesnac.RfidUpload.Model.apiParam.ApiResult),"POST:/apiserver/getscaninfoincenterstart?messageHeader={0}",invokeOption, parameters);
return returnData;
}
///<summary>
///无注释信息
///</summary>
public async Task<SlnMesnac.RfidUpload.Model.apiParam.ApiResult> getScanInfoInCenterStartAsync(System.String messageHeader,SlnMesnac.RfidUpload.Model.apiParam.InStoreParam containerRegisterQuery,IInvokeOption invokeOption = default)
{
if(Client==null)
{
throw new RpcException("IRpcClient为空请先初始化或者进行赋值");
}
object[] parameters = new object[]{messageHeader,containerRegisterQuery};
return (SlnMesnac.RfidUpload.Model.apiParam.ApiResult) await Client.InvokeAsync(typeof(SlnMesnac.RfidUpload.Model.apiParam.ApiResult),"POST:/apiserver/getscaninfoincenterstart?messageHeader={0}",invokeOption, parameters);
}
///<summary>
///无注释信息
///</summary>
/// <exception cref="System.TimeoutException">调用超时</exception>
/// <exception cref="TouchSocket.Rpc.RpcInvokeException">Rpc调用异常</exception>
/// <exception cref="System.Exception">其他异常</exception>
public SlnMesnac.RfidUpload.Model.apiParam.ApiResult getScanInfoInCenterStop(System.String messageHeader,SlnMesnac.RfidUpload.Model.apiParam.InStoreParam containerRegisterQuery,IInvokeOption invokeOption = default)
{
if(Client==null)
{
throw new RpcException("IRpcClient为空请先初始化或者进行赋值");
}
object[] parameters = new object[]{messageHeader,containerRegisterQuery};
SlnMesnac.RfidUpload.Model.apiParam.ApiResult returnData=(SlnMesnac.RfidUpload.Model.apiParam.ApiResult)Client.Invoke(typeof(SlnMesnac.RfidUpload.Model.apiParam.ApiResult),"POST:/apiserver/getscaninfoincenterstop?messageHeader={0}",invokeOption, parameters);
return returnData;
}
///<summary>
///无注释信息
///</summary>
public async Task<SlnMesnac.RfidUpload.Model.apiParam.ApiResult> getScanInfoInCenterStopAsync(System.String messageHeader,SlnMesnac.RfidUpload.Model.apiParam.InStoreParam containerRegisterQuery,IInvokeOption invokeOption = default)
{
if(Client==null)
{
throw new RpcException("IRpcClient为空请先初始化或者进行赋值");
}
object[] parameters = new object[]{messageHeader,containerRegisterQuery};
return (SlnMesnac.RfidUpload.Model.apiParam.ApiResult) await Client.InvokeAsync(typeof(SlnMesnac.RfidUpload.Model.apiParam.ApiResult),"POST:/apiserver/getscaninfoincenterstop?messageHeader={0}",invokeOption, parameters);
}
///<summary>
///无注释信息
///</summary>
/// <exception cref="System.TimeoutException">调用超时</exception>
/// <exception cref="TouchSocket.Rpc.RpcInvokeException">Rpc调用异常</exception>
/// <exception cref="System.Exception">其他异常</exception>
public SlnMesnac.RfidUpload.Model.apiParam.ApiResult getScanInfoOutCenterStart(System.String messageHeader,SlnMesnac.RfidUpload.Model.apiParam.OutStoreParam containerRegisterQuery,IInvokeOption invokeOption = default)
{
if(Client==null)
{
throw new RpcException("IRpcClient为空请先初始化或者进行赋值");
}
object[] parameters = new object[]{messageHeader,containerRegisterQuery};
SlnMesnac.RfidUpload.Model.apiParam.ApiResult returnData=(SlnMesnac.RfidUpload.Model.apiParam.ApiResult)Client.Invoke(typeof(SlnMesnac.RfidUpload.Model.apiParam.ApiResult),"POST:/apiserver/getscaninfooutcenterstart?messageHeader={0}",invokeOption, parameters);
return returnData;
}
///<summary>
///无注释信息
///</summary>
public async Task<SlnMesnac.RfidUpload.Model.apiParam.ApiResult> getScanInfoOutCenterStartAsync(System.String messageHeader,SlnMesnac.RfidUpload.Model.apiParam.OutStoreParam containerRegisterQuery,IInvokeOption invokeOption = default)
{
if(Client==null)
{
throw new RpcException("IRpcClient为空请先初始化或者进行赋值");
}
object[] parameters = new object[]{messageHeader,containerRegisterQuery};
return (SlnMesnac.RfidUpload.Model.apiParam.ApiResult) await Client.InvokeAsync(typeof(SlnMesnac.RfidUpload.Model.apiParam.ApiResult),"POST:/apiserver/getscaninfooutcenterstart?messageHeader={0}",invokeOption, parameters);
}
///<summary>
///无注释信息
///</summary>
/// <exception cref="System.TimeoutException">调用超时</exception>
/// <exception cref="TouchSocket.Rpc.RpcInvokeException">Rpc调用异常</exception>
/// <exception cref="System.Exception">其他异常</exception>
public SlnMesnac.RfidUpload.Model.apiParam.ApiResult getScanInfoOutCenterStop(System.String messageHeader,SlnMesnac.RfidUpload.Model.apiParam.OutStoreParam containerRegisterQuery,IInvokeOption invokeOption = default)
{
if(Client==null)
{
throw new RpcException("IRpcClient为空请先初始化或者进行赋值");
}
object[] parameters = new object[]{messageHeader,containerRegisterQuery};
SlnMesnac.RfidUpload.Model.apiParam.ApiResult returnData=(SlnMesnac.RfidUpload.Model.apiParam.ApiResult)Client.Invoke(typeof(SlnMesnac.RfidUpload.Model.apiParam.ApiResult),"POST:/apiserver/getscaninfooutcenterstop?messageHeader={0}",invokeOption, parameters);
return returnData;
}
///<summary>
///无注释信息
///</summary>
public async Task<SlnMesnac.RfidUpload.Model.apiParam.ApiResult> getScanInfoOutCenterStopAsync(System.String messageHeader,SlnMesnac.RfidUpload.Model.apiParam.OutStoreParam containerRegisterQuery,IInvokeOption invokeOption = default)
{
if(Client==null)
{
throw new RpcException("IRpcClient为空请先初始化或者进行赋值");
}
object[] parameters = new object[]{messageHeader,containerRegisterQuery};
return (SlnMesnac.RfidUpload.Model.apiParam.ApiResult) await Client.InvokeAsync(typeof(SlnMesnac.RfidUpload.Model.apiParam.ApiResult),"POST:/apiserver/getscaninfooutcenterstop?messageHeader={0}",invokeOption, parameters);
}
}
public static class ApiServerExtensions
{
///<summary>
///无注释信息
///</summary>
/// <exception cref="System.TimeoutException">调用超时</exception>
/// <exception cref="TouchSocket.Rpc.RpcInvokeException">Rpc调用异常</exception>
/// <exception cref="System.Exception">其他异常</exception>
public static SlnMesnac.RfidUpload.Model.apiParam.ApiResult getScanInfoInCenterStart<TClient>(this TClient client,System.String messageHeader,SlnMesnac.RfidUpload.Model.apiParam.InStoreParam containerRegisterQuery,IInvokeOption invokeOption = default) where TClient:
TouchSocket.WebApi.IWebApiClientBase{
object[] parameters = new object[]{messageHeader,containerRegisterQuery};
SlnMesnac.RfidUpload.Model.apiParam.ApiResult returnData=(SlnMesnac.RfidUpload.Model.apiParam.ApiResult)client.Invoke(typeof(SlnMesnac.RfidUpload.Model.apiParam.ApiResult),"POST:/apiserver/getscaninfoincenterstart?messageHeader={0}",invokeOption, parameters);
return returnData;
}
///<summary>
///无注释信息
///</summary>
public static async Task<SlnMesnac.RfidUpload.Model.apiParam.ApiResult> getScanInfoInCenterStartAsync<TClient>(this TClient client,System.String messageHeader,SlnMesnac.RfidUpload.Model.apiParam.InStoreParam containerRegisterQuery,IInvokeOption invokeOption = default) where TClient:
TouchSocket.WebApi.IWebApiClientBase{
object[] parameters = new object[]{messageHeader,containerRegisterQuery};
return (SlnMesnac.RfidUpload.Model.apiParam.ApiResult) await client.InvokeAsync(typeof(SlnMesnac.RfidUpload.Model.apiParam.ApiResult),"POST:/apiserver/getscaninfoincenterstart?messageHeader={0}",invokeOption, parameters);
}
///<summary>
///无注释信息
///</summary>
/// <exception cref="System.TimeoutException">调用超时</exception>
/// <exception cref="TouchSocket.Rpc.RpcInvokeException">Rpc调用异常</exception>
/// <exception cref="System.Exception">其他异常</exception>
public static SlnMesnac.RfidUpload.Model.apiParam.ApiResult getScanInfoInCenterStop<TClient>(this TClient client,System.String messageHeader,SlnMesnac.RfidUpload.Model.apiParam.InStoreParam containerRegisterQuery,IInvokeOption invokeOption = default) where TClient:
TouchSocket.WebApi.IWebApiClientBase{
object[] parameters = new object[]{messageHeader,containerRegisterQuery};
SlnMesnac.RfidUpload.Model.apiParam.ApiResult returnData=(SlnMesnac.RfidUpload.Model.apiParam.ApiResult)client.Invoke(typeof(SlnMesnac.RfidUpload.Model.apiParam.ApiResult),"POST:/apiserver/getscaninfoincenterstop?messageHeader={0}",invokeOption, parameters);
return returnData;
}
///<summary>
///无注释信息
///</summary>
public static async Task<SlnMesnac.RfidUpload.Model.apiParam.ApiResult> getScanInfoInCenterStopAsync<TClient>(this TClient client,System.String messageHeader,SlnMesnac.RfidUpload.Model.apiParam.InStoreParam containerRegisterQuery,IInvokeOption invokeOption = default) where TClient:
TouchSocket.WebApi.IWebApiClientBase{
object[] parameters = new object[]{messageHeader,containerRegisterQuery};
return (SlnMesnac.RfidUpload.Model.apiParam.ApiResult) await client.InvokeAsync(typeof(SlnMesnac.RfidUpload.Model.apiParam.ApiResult),"POST:/apiserver/getscaninfoincenterstop?messageHeader={0}",invokeOption, parameters);
}
///<summary>
///无注释信息
///</summary>
/// <exception cref="System.TimeoutException">调用超时</exception>
/// <exception cref="TouchSocket.Rpc.RpcInvokeException">Rpc调用异常</exception>
/// <exception cref="System.Exception">其他异常</exception>
public static SlnMesnac.RfidUpload.Model.apiParam.ApiResult getScanInfoOutCenterStart<TClient>(this TClient client,System.String messageHeader,SlnMesnac.RfidUpload.Model.apiParam.OutStoreParam containerRegisterQuery,IInvokeOption invokeOption = default) where TClient:
TouchSocket.WebApi.IWebApiClientBase{
object[] parameters = new object[]{messageHeader,containerRegisterQuery};
SlnMesnac.RfidUpload.Model.apiParam.ApiResult returnData=(SlnMesnac.RfidUpload.Model.apiParam.ApiResult)client.Invoke(typeof(SlnMesnac.RfidUpload.Model.apiParam.ApiResult),"POST:/apiserver/getscaninfooutcenterstart?messageHeader={0}",invokeOption, parameters);
return returnData;
}
///<summary>
///无注释信息
///</summary>
public static async Task<SlnMesnac.RfidUpload.Model.apiParam.ApiResult> getScanInfoOutCenterStartAsync<TClient>(this TClient client,System.String messageHeader,SlnMesnac.RfidUpload.Model.apiParam.OutStoreParam containerRegisterQuery,IInvokeOption invokeOption = default) where TClient:
TouchSocket.WebApi.IWebApiClientBase{
object[] parameters = new object[]{messageHeader,containerRegisterQuery};
return (SlnMesnac.RfidUpload.Model.apiParam.ApiResult) await client.InvokeAsync(typeof(SlnMesnac.RfidUpload.Model.apiParam.ApiResult),"POST:/apiserver/getscaninfooutcenterstart?messageHeader={0}",invokeOption, parameters);
}
///<summary>
///无注释信息
///</summary>
/// <exception cref="System.TimeoutException">调用超时</exception>
/// <exception cref="TouchSocket.Rpc.RpcInvokeException">Rpc调用异常</exception>
/// <exception cref="System.Exception">其他异常</exception>
public static SlnMesnac.RfidUpload.Model.apiParam.ApiResult getScanInfoOutCenterStop<TClient>(this TClient client,System.String messageHeader,SlnMesnac.RfidUpload.Model.apiParam.OutStoreParam containerRegisterQuery,IInvokeOption invokeOption = default) where TClient:
TouchSocket.WebApi.IWebApiClientBase{
object[] parameters = new object[]{messageHeader,containerRegisterQuery};
SlnMesnac.RfidUpload.Model.apiParam.ApiResult returnData=(SlnMesnac.RfidUpload.Model.apiParam.ApiResult)client.Invoke(typeof(SlnMesnac.RfidUpload.Model.apiParam.ApiResult),"POST:/apiserver/getscaninfooutcenterstop?messageHeader={0}",invokeOption, parameters);
return returnData;
}
///<summary>
///无注释信息
///</summary>
public static async Task<SlnMesnac.RfidUpload.Model.apiParam.ApiResult> getScanInfoOutCenterStopAsync<TClient>(this TClient client,System.String messageHeader,SlnMesnac.RfidUpload.Model.apiParam.OutStoreParam containerRegisterQuery,IInvokeOption invokeOption = default) where TClient:
TouchSocket.WebApi.IWebApiClientBase{
object[] parameters = new object[]{messageHeader,containerRegisterQuery};
return (SlnMesnac.RfidUpload.Model.apiParam.ApiResult) await client.InvokeAsync(typeof(SlnMesnac.RfidUpload.Model.apiParam.ApiResult),"POST:/apiserver/getscaninfooutcenterstop?messageHeader={0}",invokeOption, parameters);
}
}
}

@ -0,0 +1,56 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;
#region << 版 本 注 释 >>
/*--------------------------------------------------------------------
* (c) 2024 WenJY
* CLR4.0.30319.42000
* T14-GEN3-7895
* SlnMesnac.RfidUpload.UI.converter
* 3fd2eb4e-171c-4cdf-bf6b-32b193bf36aa
*
* WenJY
*
* 2024-10-29 15:35:53
* V1.0.0
*
*
*--------------------------------------------------------------------
*
*
*
*
* V1.0.0
*--------------------------------------------------------------------*/
#endregion << 版 本 注 释 >>
namespace SlnMesnac.RfidUpload.UI.converter
{
public class WorkModelParamConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value is int param)
{
return param switch
{
101 => "新容器入库",
103 => "容器封发-按调拨单",
3 => "库存容器封发配发" ,
4 => "卸车容器封发配发",
_ => "未知工作模式"
};
}
return "未知";
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}

@ -1,34 +1,119 @@
using GalaSoft.MvvmLight; using GalaSoft.MvvmLight;
using GalaSoft.MvvmLight.Command; using GalaSoft.MvvmLight.Command;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using Microsoft.Win32; using Microsoft.Win32;
using MiniExcelLibs; using MiniExcelLibs;
using NLog; using SlnMesnac.RfidUpload.NLog;
using SlnMesnac.RfidUpload.Business; using SlnMesnac.RfidUpload.Business;
using SlnMesnac.RfidUpload.Common;
using SlnMesnac.RfidUpload.Model; using SlnMesnac.RfidUpload.Model;
using SlnMesnac.RfidUpload.Model.apiParam;
using SlnMesnac.RfidUpload.Model.config; using SlnMesnac.RfidUpload.Model.config;
using SlnMesnac.RfidUpload.TouchSocket;
using System; using System;
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
using System.IO;
using System.Linq; using System.Linq;
using System.Runtime.CompilerServices; using System.Threading.Tasks;
using ApiServer = SlnMesnac.RfidUpload.TouchSocket.ApiServer;
namespace SlnMesnac.RfidUpload.UI.viewModel namespace SlnMesnac.RfidUpload.UI.viewModel
{ {
public class MainWindowViewModel : ViewModelBase public class MainWindowViewModel : ViewModelBase
{ {
private readonly Logger logger = LogManager.GetCurrentClassLogger(); private readonly LogHelper logger = LogHelper.Instance;
private readonly HandleBusiness _business = HandleBusiness.Instance; private readonly HandleBusiness _business = HandleBusiness.Instance;
private readonly SerialPortBusiness _serialPortBusiness = SerialPortBusiness.Instance; private readonly SerialPortBusiness _serialPortBusiness = SerialPortBusiness.Instance;
private ObservableCollection<dynamic> listItems = new ObservableCollection<dynamic>(); private ObservableCollection<dynamic> listItems = new ObservableCollection<dynamic>();
private ObservableCollection<InstructionInfo> labelItems = new ObservableCollection<InstructionInfo>(); private ObservableCollection<InstructionInfo> labelItems = new ObservableCollection<InstructionInfo>();
private WebApiServerApp webApiServerApp = WebApiServerApp.Instance;
private ApiServer apiServer = ApiServer.GetInstance();
private AppConfig appConfig = AppConfig.Instance;
private JsonChange jsonChange = JsonChange.Instance;
private int No = 1; private int No = 1;
#region 参数定义 #region 参数定义
/// <summary>
/// 串口
/// </summary>
private ObservableCollection<string> _serialPortItems = new ObservableCollection<string>();
public ObservableCollection<string> SerialPortItems
{
get { return _serialPortItems; }
set { _serialPortItems = value; RaisePropertyChanged(() => SerialPortItems); }
}
private string _selectedSerialPortItems = string.Empty;
public string SelectedSerialPortItems
{
get { return _selectedSerialPortItems; }
set { _selectedSerialPortItems = value; RaisePropertyChanged(() => SelectedSerialPortItems); }
}
/// <summary>
/// 波特率
/// </summary>
private ObservableCollection<int> _baudRateItems = new ObservableCollection<int>() { 9600, 115200 };
public ObservableCollection<int> BaudRateItems
{
get { return _baudRateItems; }
set { _baudRateItems = value; RaisePropertyChanged(() => BaudRateItems); }
}
private int _selectedBaudRateItems = 9600;
public int SelectedBaudRateItems
{
get { return _selectedBaudRateItems; }
set { _selectedBaudRateItems = value; RaisePropertyChanged(() => SelectedBaudRateItems); }
}
/// <summary>
/// 数据位
/// </summary>
private ObservableCollection<int> _dataBitsItems = new ObservableCollection<int>() { 2, 4, 6, 8 };
public ObservableCollection<int> DataBitsItems
{
get { return _dataBitsItems; }
set { _dataBitsItems = value; RaisePropertyChanged(() => DataBitsItems); }
}
private int _selectedDataBitsItems = 8;
public int SelectedDataBitsItems
{
get { return _selectedDataBitsItems; }
set { _selectedDataBitsItems = value; RaisePropertyChanged(() => SelectedDataBitsItems); }
}
/// <summary>
///停止位
/// </summary>
private ObservableCollection<int> _stopBitsItems = new ObservableCollection<int>() { 0, 1, 2, 3, 4 };
public ObservableCollection<int> StopBitsItems
{
get { return _stopBitsItems; }
set { _stopBitsItems = value; RaisePropertyChanged(() => StopBitsItems); }
}
private int _selectedStopBitsItems = 1;
public int SelectedStopBitsItems
{
get { return _selectedStopBitsItems; }
set { _selectedStopBitsItems = value; RaisePropertyChanged(() => SelectedStopBitsItems); }
}
/// <summary>
///校验位
/// </summary>
private ObservableCollection<string> _parityItems = new ObservableCollection<string>() { "None", "Odd", "Even", "Mark", "Space" };
public ObservableCollection<string> ParityItems
{
get { return _parityItems; }
set { _parityItems = value; RaisePropertyChanged(() => ParityItems); }
}
private string _selectedParityItems = "None";
public string SelectedParityItems
{
get { return _selectedParityItems; }
set { _selectedParityItems = value; RaisePropertyChanged(() => SelectedParityItems); }
}
/// <summary> /// <summary>
/// 标签数量 /// 标签数量
/// </summary> /// </summary>
@ -39,6 +124,17 @@ namespace SlnMesnac.RfidUpload.UI.viewModel
set { labelCountParam = value;RaisePropertyChanged(() => LabelCountParam); } set { labelCountParam = value;RaisePropertyChanged(() => LabelCountParam); }
} }
/// <summary>
/// 工作模式
/// </summary>
private int workModelParam = 0;
public int WorkModelParam
{
get { return workModelParam; }
set { workModelParam = value; RaisePropertyChanged(() => WorkModelParam); }
}
private int rfidDeviceStatus = 0; private int rfidDeviceStatus = 0;
public int RfidDeviceStatus public int RfidDeviceStatus
{ {
@ -91,6 +187,11 @@ namespace SlnMesnac.RfidUpload.UI.viewModel
/// </summary> /// </summary>
public RelayCommand EmptyFilesCommand { get; set; } public RelayCommand EmptyFilesCommand { get; set; }
/// <summary>
/// 设置工作模式
/// </summary>
public RelayCommand<object> SetWorkModelCommand { get; set; }
public MainWindowViewModel() public MainWindowViewModel()
{ {
@ -99,6 +200,7 @@ namespace SlnMesnac.RfidUpload.UI.viewModel
ExportFilesCommand = new RelayCommand(ExportFiles); ExportFilesCommand = new RelayCommand(ExportFiles);
OpenSerialPortCommand = new RelayCommand(OpenSerialPort); OpenSerialPortCommand = new RelayCommand(OpenSerialPort);
CloseSerialPortCommand = new RelayCommand(CloseSerialPort); CloseSerialPortCommand = new RelayCommand(CloseSerialPort);
SetWorkModelCommand = new RelayCommand<object>(SetWorkModel);
this.Init(); this.Init();
@ -106,6 +208,30 @@ namespace SlnMesnac.RfidUpload.UI.viewModel
private void Init() private void Init()
{ {
WorkModelParam = Convert.ToInt32(appConfig.workModel);
//webApiServerApp.Init();
//apiServer.RefreshScanInfoInCenterStartEvent += () =>
//{
// OpenSerialPort();
//};
//apiServer.RefreshScanInfoInCenterStopEvent += () =>
//{
// CloseSerialPort();
//};
//apiServer.RefreshScanInfoOutCenterStartEvent += () =>
//{
// OpenSerialPort();
//};
//apiServer.RefreshScanInfoOutCenterStopEvent += () =>
//{
// CloseSerialPort();
//};
//加载标签信息 //加载标签信息
_business.InstructionInfoDataGridEvent += info => _business.InstructionInfoDataGridEvent += info =>
{ {
@ -138,6 +264,9 @@ namespace SlnMesnac.RfidUpload.UI.viewModel
logger.Info(message); logger.Info(message);
PrintMessageToListBox(message); PrintMessageToListBox(message);
}; };
_serialPortBusiness.GetSerialPorts(out List<string> serialPorts);
SerialPortItems = new ObservableCollection<string>(serialPorts);
} }
@ -149,7 +278,12 @@ namespace SlnMesnac.RfidUpload.UI.viewModel
try try
{ {
//LabelTest(); //LabelTest();
_serialPortBusiness.Open(); //_serialPortBusiness.OpenSerialPort();
this.GetParity(out int parity);
_serialPortBusiness.OpenSerialPort(_selectedSerialPortItems, _selectedBaudRateItems, parity, _selectedDataBitsItems, _selectedStopBitsItems);
if (rfidDeviceStatus != 1) if (rfidDeviceStatus != 1)
{ {
RfidDeviceStatus = 1; RfidDeviceStatus = 1;
@ -218,6 +352,14 @@ namespace SlnMesnac.RfidUpload.UI.viewModel
No = 0; No = 0;
labelItems.Clear(); labelItems.Clear();
LabelCountParam = 0; LabelCountParam = 0;
}
private void SetWorkModel(object modelFlag)
{
WorkModelParam = Convert.ToInt32(modelFlag);
appConfig.workModel = this.workModelParam.ToString();
} }
/// <summary> /// <summary>
@ -236,6 +378,24 @@ namespace SlnMesnac.RfidUpload.UI.viewModel
LabelCountParam += 1; LabelCountParam += 1;
})); }));
Task.Run(() =>
{
if (workModelParam == 101)
{
var info = BatchOpenQuery.Instance;
info.rqtm = instructionInfo.data;
_business.upload(101, jsonChange.ModeToJson(info), "新容器入库");
}
else if(workModelParam == 103)
{
var info = ContainerRegisterQuery.Instance;
info.rqtm = instructionInfo.data;
_business.upload(103, jsonChange.ModeToJson(info), "容器封发");
}
});
} }
/// <summary> /// <summary>
@ -285,5 +445,34 @@ namespace SlnMesnac.RfidUpload.UI.viewModel
//LabelCountParam += 1; //LabelCountParam += 1;
} }
} }
/// <summary>
/// 转换校验位
/// </summary>
/// <param name="parity"></param>
private void GetParity(out int parity)
{
switch (_selectedParityItems)
{
case "None":
parity = 0;
break;
case "Odd":
parity = 1;
break;
case "Even":
parity = 2;
break;
case "Mark":
parity = 3;
break;
case "Space":
parity = 4;
break;
default:
parity = 0;
break;
}
}
} }
} }

@ -1,7 +1,7 @@
 
Microsoft Visual Studio Solution File, Format Version 12.00 Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16 # Visual Studio Version 17
VisualStudioVersion = 16.0.34031.81 VisualStudioVersion = 17.10.35122.118
MinimumVisualStudioVersion = 10.0.40219.1 MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SlnMesnac.RfidUpload.Analysis", "SlnMesnac.RfidUpload.Analysis\SlnMesnac.RfidUpload.Analysis.csproj", "{774D0204-DA0E-4C3B-BD2B-E40657C8E895}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SlnMesnac.RfidUpload.Analysis", "SlnMesnac.RfidUpload.Analysis\SlnMesnac.RfidUpload.Analysis.csproj", "{774D0204-DA0E-4C3B-BD2B-E40657C8E895}"
EndProject EndProject
@ -15,7 +15,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SlnMesnac.RfidUpload.TouchS
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SlnMesnac.RfidUpload.NLog", "SlnMesnac.RfidUpload.NLog\SlnMesnac.RfidUpload.NLog.csproj", "{6128090B-8F42-4F22-A27E-6F5FF6072D27}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SlnMesnac.RfidUpload.NLog", "SlnMesnac.RfidUpload.NLog\SlnMesnac.RfidUpload.NLog.csproj", "{6128090B-8F42-4F22-A27E-6F5FF6072D27}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SlnMesnac.RfidUpload.UI", "SlnMesnac.RfidUpload.UI\SlnMesnac.RfidUpload.UI.csproj", "{600503B8-7174-4A34-A38F-F4CFFAA6764F}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SlnMesnac.RfidUpload.UI", "SlnMesnac.RfidUpload.UI\SlnMesnac.RfidUpload.UI.csproj", "{600503B8-7174-4A34-A38F-F4CFFAA6764F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "slnmesnac.rfidupload.WebApplication", "slnmesnac.rfidupload.WebApplication\slnmesnac.rfidupload.WebApplication.csproj", "{76E1E241-C83D-4F79-8079-67CDD95E3D9E}"
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -51,6 +53,10 @@ Global
{600503B8-7174-4A34-A38F-F4CFFAA6764F}.Debug|Any CPU.Build.0 = Debug|Any CPU {600503B8-7174-4A34-A38F-F4CFFAA6764F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{600503B8-7174-4A34-A38F-F4CFFAA6764F}.Release|Any CPU.ActiveCfg = Release|Any CPU {600503B8-7174-4A34-A38F-F4CFFAA6764F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{600503B8-7174-4A34-A38F-F4CFFAA6764F}.Release|Any CPU.Build.0 = Release|Any CPU {600503B8-7174-4A34-A38F-F4CFFAA6764F}.Release|Any CPU.Build.0 = Release|Any CPU
{76E1E241-C83D-4F79-8079-67CDD95E3D9E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{76E1E241-C83D-4F79-8079-67CDD95E3D9E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{76E1E241-C83D-4F79-8079-67CDD95E3D9E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{76E1E241-C83D-4F79-8079-67CDD95E3D9E}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE

@ -0,0 +1,35 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的常规信息通过下列特性集
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("slnmesnac.rfidupload.WebApplication")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("slnmesnac.rfidupload.WebApplication")]
[assembly: AssemblyCopyright("Copyright © 2024")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
// 对 COM 组件不可见。如果需要
// 从 COM 访问此程序集中的某个类型,请针对该类型将 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于 typelib 的 ID
[assembly: Guid("76e1e241-c83d-4f79-8079-67cdd95e3d9e")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 内部版本号
// 修订版本
//
// 可以指定所有值,也可以使用“修订号”和“内部版本号”的默认值,
// 方法是按如下所示使用 "*":
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- 有关使用 web.config 转换的详细信息,请访问 https://go.microsoft.com/fwlink/?LinkId=125889 -->
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<!--
在下例中“SetAttributes”转换将更改
“connectionString”的值以仅在“Match”定位器
找到值为“MyDB”的特性“name”时使用“ReleaseSQLServer”。
<connectionStrings>
<add name="MyDB"
connectionString="Data Source=ReleaseSQLServer;Initial Catalog=MyReleaseDB;Integrated Security=True"
xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
</connectionStrings>
-->
<system.web>
<!--
在下例中“Replace”转换将替换
web.config 文件的整个 <customErrors> 节。
请注意,由于
在 <system.web> 节点下仅有一个 customErrors 节因此不需要使用“xdt:Locator”特性。
<customErrors defaultRedirect="GenericError.htm"
mode="RemoteOnly" xdt:Transform="Replace">
<error statusCode="500" redirect="InternalError.htm"/>
</customErrors>
-->
</system.web>
</configuration>

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- 有关使用 web.config 转换的详细信息,请访问 https://go.microsoft.com/fwlink/?LinkId=125889 -->
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<!--
在下例中“SetAttributes”转换将更改
“connectionString”的值以仅在“Match”定位器
找到值为“MyDB”的特性“name”时使用“ReleaseSQLServer”。
<connectionStrings>
<add name="MyDB"
connectionString="Data Source=ReleaseSQLServer;Initial Catalog=MyReleaseDB;Integrated Security=True"
xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
</connectionStrings>
-->
<system.web>
<compilation xdt:Transform="RemoveAttributes(debug)" />
<!--
在下例中“Replace”转换将替换
web.config 文件的整个 <customErrors> 节。
请注意,由于
在 <system.web> 节点下仅有一个 customErrors 节因此不需要使用“xdt:Locator”特性。
<customErrors defaultRedirect="GenericError.htm"
mode="RemoteOnly" xdt:Transform="Replace">
<error statusCode="500" redirect="InternalError.htm"/>
</customErrors>
-->
</system.web>
</configuration>

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
有关如何配置 ASP.NET 应用程序的详细信息,请访问
https://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.5.2" />
<httpRuntime targetFramework="4.5.2" />
</system.web>
<system.codedom>
<compilers>
<compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:6 /nowarn:1659;1699;1701" />
<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:14 /nowarn:41008 /define:_MYTYPE=\&quot;Web\&quot; /optionInfer+" />
</compilers>
</system.codedom>
</configuration>

@ -0,0 +1 @@
<%@ WebService Language="C#" CodeBehind="WebService.asmx.cs" Class="slnmesnac.rfidupload.WebApplication.WebService" %>

@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
namespace slnmesnac.rfidupload.WebApplication
{
/// <summary>
/// WebService 的摘要说明
/// </summary>
[WebService(Namespace = "http://localhost/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
// 若要允许使用 ASP.NET AJAX 从脚本中调用此 Web 服务,请取消注释以下行。
// [System.Web.Script.Services.ScriptService]
public class WebService : System.Web.Services.WebService
{
[WebMethod]
public string HelloWorld()
{
return "Hello World";
}
}
}

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.CodeDom.Providers.DotNetCompilerPlatform" version="2.0.1" targetFramework="net452" />
</packages>

@ -0,0 +1,127 @@
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\build\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props" Condition="Exists('..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\build\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>
</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{76E1E241-C83D-4F79-8079-67CDD95E3D9E}</ProjectGuid>
<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>slnmesnac.rfidupload.WebApplication</RootNamespace>
<AssemblyName>slnmesnac.rfidupload.WebApplication</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<UseIISExpress>true</UseIISExpress>
<Use64BitIISExpress />
<IISExpressSSLPort>44348</IISExpressSSLPort>
<IISExpressAnonymousAuthentication />
<IISExpressWindowsAuthentication />
<IISExpressUseClassicPipelineMode />
<UseGlobalApplicationHostFile />
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Web.DynamicData" />
<Reference Include="System.Web.Entity" />
<Reference Include="System.Web.ApplicationServices" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Core" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Web.Extensions" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Drawing" />
<Reference Include="System.Web" />
<Reference Include="System.Xml" />
<Reference Include="System.Configuration" />
<Reference Include="System.Web.Services" />
<Reference Include="System.EnterpriseServices" />
</ItemGroup>
<ItemGroup>
<Reference Include="Microsoft.CodeDom.Providers.DotNetCompilerPlatform">
<HintPath>..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Content Include="Web.config" />
<Content Include="WebService.asmx" />
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="WebService.asmx.cs">
<DependentUpon>WebService.asmx</DependentUpon>
<SubType>Component</SubType>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
<None Include="Web.Debug.config">
<DependentUpon>Web.config</DependentUpon>
</None>
<None Include="Web.Release.config">
<DependentUpon>Web.config</DependentUpon>
</None>
</ItemGroup>
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />
<ProjectExtensions>
<VisualStudio>
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
<WebProjectProperties>
<UseIIS>True</UseIIS>
<AutoAssignPort>True</AutoAssignPort>
<DevelopmentServerPort>49922</DevelopmentServerPort>
<DevelopmentServerVPath>/</DevelopmentServerVPath>
<IISUrl>https://localhost:44348/</IISUrl>
<NTLMAuthentication>False</NTLMAuthentication>
<UseCustomServer>False</UseCustomServer>
<CustomServerUrl>
</CustomServerUrl>
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
</WebProjectProperties>
</FlavorProperties>
</VisualStudio>
</ProjectExtensions>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>这台计算机上缺少此项目引用的 NuGet 程序包。使用“NuGet 程序包还原”可下载这些程序包。有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\build\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\build\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props'))" />
</Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
Loading…
Cancel
Save