diff --git a/SlnMesnac.Extensions/PlcFactorySetup.cs b/SlnMesnac.Extensions/PlcFactorySetup.cs
deleted file mode 100644
index a27911b..0000000
--- a/SlnMesnac.Extensions/PlcFactorySetup.cs
+++ /dev/null
@@ -1,131 +0,0 @@
-using Microsoft.AspNetCore.Builder;
-using Microsoft.Extensions.DependencyInjection;
-using Serilog;
-using SlnMesnac.Config;
-using SlnMesnac.Plc;
-using SlnMesnac.Plc.Factory;
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-#region << 版 本 注 释 >>
-/*--------------------------------------------------------------------
-* 版权所有 (c) 2024 WenJY 保留所有权利。
-* CLR版本:4.0.30319.42000
-* 机器名称:LAPTOP-E0N2L34V
-* 命名空间:SlnMesnac.Extensions
-* 唯一标识:9bf604b4-3937-476a-adb0-27adc6fbea28
-*
-* 创建者:WenJY
-* 电子邮箱:wenjy@mesnac.com
-* 创建时间:2024-04-12 15:25:47
-* 版本:V1.0.0
-* 描述:
-*
-*--------------------------------------------------------------------
-* 修改人:
-* 时间:
-* 修改说明:
-*
-* 版本:V1.0.0
-*--------------------------------------------------------------------*/
-#endregion << 版 本 注 释 >>
-namespace SlnMesnac.Extensions
-{
- ///
- /// PLC工厂
- ///
- public static class PlcFactorySetup
- {
-
- public static void AddPlcFactorySetup(this IServiceCollection services)
- {
- services.AddSingleton>(x =>
- {
- AppConfig appConfig = x.GetService();
-
- List absractFactories = new List();
-
- try
- {
- do
- {
- if (!HslCommunication.Authorization.SetAuthorizationCode("1839541f-8fb4-42c4-a13f-733b027fe5af"))
- {
- Log.Information("HslCommunication激活失败,可用时长为24小时");
- break;
- }
- else
- {
- //Log.Information("HslCommunication激活成功");
- }
-
- if (appConfig.plcConfig != null)
- {
- foreach (var item in appConfig.plcConfig)
- {
- if (item.isFlage)
- {
- PlcAbsractFactory _plc = InitPlc(x, item.plcType);
-
- var connectResult = _plc.Connect(item.plcIp, item.plcPort);
- if (connectResult)
- {
- Log.Information($"PLC:{item.plcIp}:{item.plcPort};连接成功,时间:{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");
- _plc.ConfigKey = item.plcKey;
-
- if (absractFactories.Contains(_plc))
- {
- absractFactories.Remove(_plc);
- }
-
- absractFactories.Add(_plc);
- }
- else
- {
- Log.Information($"PLC:{item.plcIp}:{item.plcPort};连接失败,时间:{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");
- }
- }
- }
- }
- }while(false);
- }
- catch (Exception e)
- {
- Log.Error($"PLC初始化连接异常:{e.Message}");
- }
-
- return absractFactories;
- });
- }
-
- private static PlcAbsractFactory InitPlc(IServiceProvider serviceProvider,string plcType)
- {
- PlcAbsractFactory _plc = null;
- var _inovance = serviceProvider.GetRequiredService();
- var _melsecBinary = serviceProvider.GetRequiredService();
- var _omronNj = serviceProvider.GetRequiredService();
- var _siemens = serviceProvider.GetRequiredService();
-
- switch (plcType)
- {
- case "InovancePlc":
- _plc = _inovance;
- break;
- case "MelsecBinaryPlc":
- _plc = _melsecBinary;
- break;
- case "OmronNJPlc":
- _plc = _omronNj;
- break;
- case "SiemensPlc":
- _plc = _siemens;
- break;
- default:
- break;
- }
-
- return _plc;
- }
- }
-}
diff --git a/SlnMesnac.Extensions/RfidFactorySetup.cs b/SlnMesnac.Extensions/RfidFactorySetup.cs
index 30cef5c..6260492 100644
--- a/SlnMesnac.Extensions/RfidFactorySetup.cs
+++ b/SlnMesnac.Extensions/RfidFactorySetup.cs
@@ -1,6 +1,4 @@
-using HslCommunication.Enthernet;
-using Microsoft.Extensions.DependencyInjection;
-using Models;
+using Microsoft.Extensions.DependencyInjection;
using Serilog;
using SlnMesnac.Common;
using SlnMesnac.Config;
@@ -9,7 +7,6 @@ using SlnMesnac.Model.Enum;
using SlnMesnac.Rfid;
using SlnMesnac.Rfid.Enum;
using SlnMesnac.Rfid.Factory;
-using SlnMesnac.TouchSocket;
using SqlSugar;
using System;
using System.Collections.Generic;
@@ -48,7 +45,6 @@ namespace SlnMesnac.Extensions
// 可扩展更多工厂类型
};
- public static TcpServer _TcpServer;
private static StringChange _StringChange;
@@ -57,10 +53,8 @@ namespace SlnMesnac.Extensions
{
services.AddSingleton>(x =>
{
- ISqlSugarClient sqlSugarClient = x.GetRequiredService();
AppConfig appConfig = x.GetService();
_StringChange = x.GetService();
- _TcpServer = x.GetService();
List baseRfidInfos = appConfig.deviceInfoConfig.Where(x => x.Collectid == appConfig.StationCode).ToList();
//sensor_Infos = sqlSugarClient.Queryable().Where(x => x.Deleteflag == 0).ToList();
@@ -131,45 +125,6 @@ namespace SlnMesnac.Extensions
return absractFactories;
});
}
- public static void RecvIdentifyData_Instance(string iCombineId, List tagInfos)
- {
- try
- {
- SoftMessagePack pSendMessagePackInfo = new SoftMessagePack();
- //iCombineId = "3114";
- byte[] dataInfo; string info = "";
- byte[] array2 = new byte[0];
- if (tagInfos != null && tagInfos.Count > 0)
- {
- dataInfo = tagInfos[0].EPC;
- info = tagInfos[0].EPCstring;
- pSendMessagePackInfo.iLen = (ushort)(dataInfo.Length + 4 + 1); //+4为合并编号的长度, +1为长度占的一个字节
- pSendMessagePackInfo.pMessage = new byte[pSendMessagePackInfo.iLen];
- Array.Copy(dataInfo, 0, pSendMessagePackInfo.pMessage, 5, dataInfo.Length);
- pSendMessagePackInfo.pMessage[4] = (byte)dataInfo.Length;
- }
- else
- {
- dataInfo = new byte[0];
- info = "NoData";
- pSendMessagePackInfo.iLen = 0 + 4;
- pSendMessagePackInfo.pMessage = new byte[pSendMessagePackInfo.iLen];
- }
- byte[] u32byte = new byte[4];
- pSendMessagePackInfo.iStationId = GetMESCallback(int.Parse(iCombineId));
- pSendMessagePackInfo.iMsta = 0XF0 + 1;
- pSendMessagePackInfo.iMessageType = (byte)MessageType.AutoReport_Type;
-
- u32byte = BitConverter.GetBytes(uint.Parse(iCombineId));
- Array.Copy(u32byte, 0, pSendMessagePackInfo.pMessage, 0, 4); //合并编号
- _TcpServer.SendMessage(pSendMessagePackInfo);
- }
- catch (Exception e)
- {
- Log.Error($"RecvIdentifyData_Instance异常:{e.Message}");
-
- }
- }
private static ushort GetMESCallback(int id)
{
diff --git a/SlnMesnac.Extensions/SlnMesnac.Extensions.csproj b/SlnMesnac.Extensions/SlnMesnac.Extensions.csproj
index 9c5b0b1..fa92dd7 100644
--- a/SlnMesnac.Extensions/SlnMesnac.Extensions.csproj
+++ b/SlnMesnac.Extensions/SlnMesnac.Extensions.csproj
@@ -12,7 +12,6 @@
-
diff --git a/SlnMesnac.Extensions/SqlsugarSetup.cs b/SlnMesnac.Extensions/SqlsugarSetup.cs
deleted file mode 100644
index d5f0b18..0000000
--- a/SlnMesnac.Extensions/SqlsugarSetup.cs
+++ /dev/null
@@ -1,76 +0,0 @@
-using Microsoft.Extensions.DependencyInjection;
-using SlnMesnac.Config;
-using SqlSugar;
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-#region << 版 本 注 释 >>
-/*--------------------------------------------------------------------
-* 版权所有 (c) 2024 WenJY 保留所有权利。
-* CLR版本:4.0.30319.42000
-* 机器名称:LAPTOP-E0N2L34V
-* 命名空间:SlnMesnac.Extensions
-* 唯一标识:bbb46406-e99d-4205-8046-ad954cf88315
-*
-* 创建者:WenJY
-* 电子邮箱:wenjy@mesnac.com
-* 创建时间:2024-04-12 17:31:43
-* 版本:V1.0.0
-* 描述:
-*
-*--------------------------------------------------------------------
-* 修改人:
-* 时间:
-* 修改说明:
-*
-* 版本:V1.0.0
-*--------------------------------------------------------------------*/
-#endregion << 版 本 注 释 >>
-namespace SlnMesnac.Extensions
-{
- public static class SqlsugarSetup
- {
-
- ///
- /// 注册SqlSugar
- ///
- ///
- public static void AddSqlSugarSetup(this IServiceCollection services)
- {
- services.AddSingleton(x =>
- {
- var appConfig = x.GetService();
-
- var connectConfigList = new List();
- if (appConfig.sqlConfig != null)
- {
- foreach (var item in appConfig.sqlConfig)
- {
- #region 加载sqlite数据库地址
- //if (item.configId == "Local")
- //{
- // item.connStr = $"Data Source={System.Environment.CurrentDirectory}\\data\\" + item.connStr;
- //}
- #endregion
- var config = new ConnectionConfig()
- {
- ConfigId = item.configId,
- DbType = (DbType)item.dbType,
- ConnectionString = item.connStr,
- InitKeyType = InitKeyType.Attribute,
- IsAutoCloseConnection = true,
- };
- connectConfigList.Add(config);
- }
- }
- SqlSugarScope Db = new SqlSugarScope(connectConfigList, db =>
- {
- db.Aop.OnLogExecuting = (sql, pars) => { };
- });
-
- return Db;
- });
- }
- }
-}
diff --git a/SlnMesnac.Ioc/DependencyConfigurator.cs b/SlnMesnac.Ioc/DependencyConfigurator.cs
index 6234bb9..32c1372 100644
--- a/SlnMesnac.Ioc/DependencyConfigurator.cs
+++ b/SlnMesnac.Ioc/DependencyConfigurator.cs
@@ -38,12 +38,6 @@ namespace SlnMesnac.Ioc
/// The Autofac container builder.
public static void Configure(ContainerBuilder builder)
{
- //注入Repository
- builder.RegisterGeneric(typeof(Repository<>)).As(typeof(Repository<>));
- RegisterImplementations(builder, Assembly.LoadFrom("SlnMesnac.Repository.dll"));
-
- //注入Plc
- RegisterTypeTransient(builder, Assembly.LoadFrom("SlnMesnac.Plc.dll"));
//注入Rfid
RegisterTypeTransient(builder, Assembly.LoadFrom("SlnMesnac.Rfid.dll"));
@@ -51,18 +45,11 @@ namespace SlnMesnac.Ioc
//注入通用类
RegisterType(builder, Assembly.LoadFrom("SlnMesnac.Common.dll"));
- //注入MQTT
- RegisterType(builder, Assembly.LoadFrom("SlnMesnac.Mqtt.dll"));
-
//注入TouchSocket
builder.RegisterType(typeof(TcpService));
RegisterType(builder, Assembly.LoadFrom("SlnMesnac.TouchSocket.dll"));
- //注入业务类
- RegisterType(builder, Assembly.LoadFrom("SlnMesnac.Business.dll"));
- //注入代码生成
- RegisterType(builder, Assembly.LoadFrom("SlnMesnac.Generate.dll"));
}
diff --git a/SlnMesnac.Ioc/SlnMesnac.Ioc.csproj b/SlnMesnac.Ioc/SlnMesnac.Ioc.csproj
index 639165e..39615e8 100644
--- a/SlnMesnac.Ioc/SlnMesnac.Ioc.csproj
+++ b/SlnMesnac.Ioc/SlnMesnac.Ioc.csproj
@@ -14,7 +14,6 @@
-
diff --git a/SlnMesnac.Model/AirportApiEntity/AGVActiveMapEntity.cs b/SlnMesnac.Model/AirportApiEntity/AGVActiveMapEntity.cs
deleted file mode 100644
index 76444f6..0000000
--- a/SlnMesnac.Model/AirportApiEntity/AGVActiveMapEntity.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace SlnMesnac.Model.AirportApiEntity
-{
- ///
- /// 获取当前激活地图信息响应实体类
- ///
- public class ResponseActiveMapDataEntity
- {
- ///
- /// 地图ID
- ///
- public string guid { get; set; }
-
- ///
- /// 地图名称
- ///
- public string name { get; set; }
- }
-}
diff --git a/SlnMesnac.Model/AirportApiEntity/AGVAddTaskEntity.cs b/SlnMesnac.Model/AirportApiEntity/AGVAddTaskEntity.cs
deleted file mode 100644
index 42d4d99..0000000
--- a/SlnMesnac.Model/AirportApiEntity/AGVAddTaskEntity.cs
+++ /dev/null
@@ -1,125 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace SlnMesnac.Model.AirportApiEntity
-{
- ///
- /// 下发任务请求实体类
- ///
- public class AGVRequestAddTaskEntity
- {
- ///
- /// 任务单ID-AGVC的任务ID
- ///
- public string businessOrderId { get; set; }
-
- ///
- /// 设备类型
- ///
- public string RobotType { get; set; }
-
- ///
- /// 优先级 默认值0
- ///
- public int priority { get; set; } = 0;
-
- ///
- /// 机器人ID
- ///
- public string roborId { get; set; }
-
- ///
- /// 分组ID 默认空
- ///
- public string group { get; set; } = string.Empty;
-
- ///
- /// 任务来源,调度系统名称 默认值Mesnac
- ///
- public string taskSource { get; set; } = "Mesnac";
-
- ///
- /// 任务类型 0)none 默认值3
- ///
- public int taskType { get; set; } = 3;
-
- ///
- /// 验证任务 0:不验证 1:需要验证 传0
- ///
- public int verifyStatus { get; set; }
-
- ///
- /// 是否允许分⻋执⾏(默认FALSE)
- ///
- public int? enableSplitCar { get; set; }
-
- ///
- /// 任务描述
- ///
- public string? desc { get; set; }
-
- ///
- /// 装货点
- ///
- public List load { get; set; }
-
- ///
- /// 卸货点
- ///
- public List unload { get; set; }
- }
-
- ///
- /// 装载/卸载点位
- ///
- public class LoadsEntity
- {
- ///
- /// 任务模板 默认空字符串
- ///
- public string jobid { get; set; } = string.Empty;
-
- ///
- /// 地图中的点位 默认空字符串
- ///
- public string loaction { get; set; } = string.Empty;
-
- ///
- /// 参数 数据跟location一样
- ///
- public List param { get; set; }
-
- ///
- /// 默认空字符串
- ///
- public string robotPort { get; set; } = string.Empty;
- }
-
- ///
- /// 不知道是啥 paramvalue点位跟load一样
- ///
- public class ParamEntity
- {
- ///
- /// 参数名称 默认空字符串
- ///
- public string paramname { get; set; } = string.Empty;
-
- ///
- /// 参数值 默认空字符串
- ///
- public string paramvalue { get; set; } = string.Empty;
- }
-
- ///
- /// 下发任务成功响应数据
- ///
- public class ResponseAddTaskDataEntity
- {
- ///
- /// AGV任务ID
- ///
- public string guid { get; set; }
- }
-}
diff --git a/SlnMesnac.Model/AirportApiEntity/AGVMapPositionEntity.cs b/SlnMesnac.Model/AirportApiEntity/AGVMapPositionEntity.cs
deleted file mode 100644
index 4b4ad49..0000000
--- a/SlnMesnac.Model/AirportApiEntity/AGVMapPositionEntity.cs
+++ /dev/null
@@ -1,45 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace SlnMesnac.Model.AirportApiEntity
-{
- ///
- /// 获取当前地图所有位置点请求实体类(get方法)
- ///
- [Obsolete]
- public class AGVRequestMapPositionEntity
- {
- ///
- /// 地图ID
- ///
- public string mapId { get; set; }
- }
-
- ///
- /// 当前地图所有位置点响应数据实体类
- ///
- public class ResponseMapPositionDataEntity
- {
-
- ///
- /// 点位名称
- ///
- public string name { get; set; }
-
- ///
- /// 所属地图ID
- ///
- public string mapId { get; set; }
-
- ///
- /// 位置点类型 0:普通 1:⾼精度 2:充电桩 3:闲置点
- ///
- public int type { get; set; }
-
- ///
- /// 点位ID
- ///
- public string guid { get; set; }
- }
-}
diff --git a/SlnMesnac.Model/AirportApiEntity/AGVOperationalTaskEntity.cs b/SlnMesnac.Model/AirportApiEntity/AGVOperationalTaskEntity.cs
deleted file mode 100644
index bdf044c..0000000
--- a/SlnMesnac.Model/AirportApiEntity/AGVOperationalTaskEntity.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace SlnMesnac.Model.AirportApiEntity
-{
- ///
- /// 取消/终止任务请求实体类
- ///
- public class AGVRequestOperationalTaskEntity
- {
- ///
- /// 任务ID
- ///
- public string taskid { get; set; }
-
- ///
- /// 状态:0:终止 4:取消
- ///
- public int state { get; set; }
-
- ///
- /// 操作源
- ///
- public string operatingSource { get; set; }
-
- ///
- /// 操作用户
- ///
- public string operatingUser { get; set; }
-
- ///
- /// 操作说明
- ///
- public string remark { get; set; }
- }
-}
diff --git a/SlnMesnac.Model/AirportApiEntity/AGVResponseEntity.cs b/SlnMesnac.Model/AirportApiEntity/AGVResponseEntity.cs
deleted file mode 100644
index f01fec5..0000000
--- a/SlnMesnac.Model/AirportApiEntity/AGVResponseEntity.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace SlnMesnac.Model.AirportApiEntity
-{
- ///
- /// AGV返回值 根类型 实体类
- ///
- ///
- public class AGVResponseEntity where T : class
- {
- ///
- /// 代码
- ///
- public int code { get; set; }
-
- ///
- /// 数据体
- ///
- public T? Data { get; set; }
-
- ///
- /// 信息
- ///
- public string message { get; set; }
-
- ///
- /// 计数
- ///
- public int? count { get; set; }
- }
-
-}
diff --git a/SlnMesnac.Model/AirportApiEntity/AGVRobotAtrributeEntity.cs b/SlnMesnac.Model/AirportApiEntity/AGVRobotAtrributeEntity.cs
deleted file mode 100644
index 53e02d4..0000000
--- a/SlnMesnac.Model/AirportApiEntity/AGVRobotAtrributeEntity.cs
+++ /dev/null
@@ -1,127 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace SlnMesnac.Model.AirportApiEntity
-{
- ///
- /// 获取车辆所有信息响应实体类
- ///
- public class ResponseRobotAtrributeDataEntity
- {
-
- ///
- /// 机器人ID
- ///
- public string Guid { get; set; }
-
- ///
- /// 机器人名称
- ///
- public string Name { get; set; }
-
- ///
- /// 运动状态
- /// 0:暂⽆信息 1:待机 2:执⾏任务 3:充电中 4:暂停 5:急停 6:异常 7:建图中 8:等待 9:调度控制
- /// ?(文档空缺)任务暂停 51:同步 52:脱机
- ///
- public int AgvMoveStatus { get; set; }
-
- ///
- /// 任务模板ID
- ///
- public string jobId { get; set; }
-
- ///
- /// 子任务ID
- ///
- public string orderId { get; set; }
-
- ///
- /// 任务ID
- ///
- public string TaskID { get; set; }
-
- ///
- /// 当前执行动作
- ///
- public CurrentActionEntity currentAction { get; set; }
-
- ///
- /// 错误
- ///
- public List error { get; set; }
-
- }
-
- ///
- /// 车辆当前执行动作实体类
- ///
- public class CurrentActionEntity
- {
- ///
- /// 动作ID
- ///
- public string guid { get; set; }
-
- ///
- /// 任务类型
- /// 1:移动 2:播放声⾳ 3:亮灯带 4:停留 5:检查位置状态 6:占地⾯积 7:切换地图 8:移动⾄预备位置 9:停靠
- /// 10:相对移动 11:等待 12:if else 13:设置plc 14:等待plc 15:停⽌⾳效 16:停⽌灯带 17:暂停 18:loop
- /// 23:while 29:任务模板
- ///
- public string actionType { get; set; }
-
- ///
- /// 参数列表
- ///
- public List Parames { get; set; }
- }
-
- ///
- /// 车辆动作参数实体类
- ///
- public class AGVCurrentActionParamesEntity
- {
- ///
- /// 动作参数guid
- ///
- public string guid { get; set; }
-
- ///
- /// 参数名称
- ///
- public string paramName { get; set; }
-
- ///
- /// 动作类型
- ///
- public int type { get; set; }
-
- ///
- /// 参数值
- ///
- public string value { get; set; }
- }
-
- ///
- /// 车辆错误信息实体类
- ///
- public class AGVErrorEntity
- {
- ///
- /// 错误码
- ///
- public int errorCode { get; set; }
-
- ///
- /// 错误模块
- ///
- public int errorModule { get; set; }
-
- ///
- /// 错误消息
- ///
- public string errorMsg { get; set; }
- }
-}
diff --git a/SlnMesnac.Model/AirportApiEntity/AGVSingalEntity.cs b/SlnMesnac.Model/AirportApiEntity/AGVSingalEntity.cs
deleted file mode 100644
index ba69db3..0000000
--- a/SlnMesnac.Model/AirportApiEntity/AGVSingalEntity.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace SlnMesnac.Model.AirportApiEntity
-{
- public class AGVSingalEntity
- {
- ///
- /// AGV编号
- ///
- public string AGVNo { get; set; }
-
- ///
- /// AGV类型
- ///
- public string AGVType { get; set; }
-
- ///
- /// 目的地编号
- ///
- public string DestinationNo { get; set; }
-
- ///
- /// 任务编号
- ///
- public string TaskNo { get; set; }
-
- ///
- /// 信号发送时间
- ///
- public string SignalSendTime { get; set; }
-
- }
-}
diff --git a/SlnMesnac.Model/AirportApiEntity/AGVTaskStateDetailEntity.cs b/SlnMesnac.Model/AirportApiEntity/AGVTaskStateDetailEntity.cs
deleted file mode 100644
index 94cb4ff..0000000
--- a/SlnMesnac.Model/AirportApiEntity/AGVTaskStateDetailEntity.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace SlnMesnac.Model.AirportApiEntity
-{
- ///
- /// 查询任务状态请求实体类
- ///
- public class AGVRequestTaskStateDetailEntity
- {
- ///
- /// 任务ID
- ///
- public string taskId { get; set; }
- }
-
- ///
- /// 任务状态响应数据
- ///
- public class ResponseTaskStateDetailDataEntity
- {
- ///
- /// 任务ID
- ///
- public string taskId { get; set; }
-
- ///
- /// 状态 0:已终⽌ 1:待执⾏ 2:正在执⾏ 3:已完成 4:已取消 5:已暂停 6:匹配中 7: 核验中
- ///
- public int state { get; set; }
-
- ///
- /// 车辆ID
- ///
- public string robotId { get; set; }
-
- ///
- /// 车辆名称
- ///
- public string robotName { get; set; }
- }
-}
diff --git a/SlnMesnac.Model/SlnMesnac.Model.csproj b/SlnMesnac.Model/SlnMesnac.Model.csproj
index ff1f693..a15476f 100644
--- a/SlnMesnac.Model/SlnMesnac.Model.csproj
+++ b/SlnMesnac.Model/SlnMesnac.Model.csproj
@@ -6,6 +6,7 @@
+
diff --git a/SlnMesnac.Model/domain/Base_device_info.cs b/SlnMesnac.Model/domain/Base_device_info.cs
deleted file mode 100644
index 9156b66..0000000
--- a/SlnMesnac.Model/domain/Base_device_info.cs
+++ /dev/null
@@ -1,102 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using SqlSugar;
-namespace Models
-{
- ///
- ///
- ///
- [SugarTable("base_device_info")]
- public class Base_device_info
- {
-
-
- ///
- /// 备 注:
- /// 默认值:
- ///
- [SugarColumn(ColumnName="deviceid" ,IsPrimaryKey = true) ]
- public string Deviceid { get; set; } = null!;
-
- ///
- /// 备 注:
- /// 默认值:
- ///
- [SugarColumn(ColumnName="name" ) ]
- public string? Name { get; set; }
-
- ///
- /// 备 注:
- /// 默认值:
- ///
- [SugarColumn(ColumnName="connectstr" ) ]
- public string? Connectstr { get; set; }
-
- ///
- /// 备 注:
- /// 默认值:
- ///
- [SugarColumn(ColumnName="connectmode" ) ]
- public decimal? Connectmode { get; set; }
-
- ///
- /// 备 注:
- /// 默认值:
- ///
- [SugarColumn(ColumnName="devicetype" ) ]
- public string? Devicetype { get; set; }
-
- ///
- /// 备 注:所属汇集软件ID
- /// 默认值:
- ///
- [SugarColumn(ColumnName="collectid" ) ]
- public string? Collectid { get; set; }
-
- ///
- /// 备 注:
- /// 默认值:
- ///
- [SugarColumn(ColumnName="addr" ) ]
- public string? Addr { get; set; }
-
- ///
- /// 备 注:
- /// 默认值:
- ///
- [SugarColumn(ColumnName="mapid" ) ]
- public string? Mapid { get; set; }
-
- ///
- /// 备 注:
- /// 默认值:
- ///
- [SugarColumn(ColumnName="recordtime" ) ]
- public DateTime? Recordtime { get; set; }
-
- ///
- /// 备 注:
- /// 默认值:
- ///
- [SugarColumn(ColumnName="deleteflag" ) ]
- public int? Deleteflag { get; set; }
-
- ///
- /// 备 注:
- /// 默认值:
- ///
- [SugarColumn(ColumnName="recordperson" ) ]
- public int? Recordperson { get; set; }
-
- ///
- /// 备 注:
- /// 默认值:
- ///
- [SugarColumn(ColumnName="objid" ,IsIdentity = true) ]
- public int Objid { get; set; }
-
-
- }
-
-}
\ No newline at end of file
diff --git a/SlnMesnac.Model/domain/Base_device_state.cs b/SlnMesnac.Model/domain/Base_device_state.cs
deleted file mode 100644
index ee8a245..0000000
--- a/SlnMesnac.Model/domain/Base_device_state.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using SqlSugar;
-namespace Models
-{
- ///
- ///
- ///
- [SugarTable("base_device_state")]
- public class Base_device_state
- {
-
-
- ///
- /// 备 注:
- /// 默认值:
- ///
- [SugarColumn(ColumnName="Id" ,IsPrimaryKey = true,IsIdentity = true) ]
- public int Id { get; set; }
-
- ///
- /// 备 注:
- /// 默认值:
- ///
- [SugarColumn(ColumnName="deviceId" ) ]
- public int DeviceId { get; set; }
-
- ///
- /// 备 注:设备连接状态 0为未连接 1为连接
- /// 默认值:
- ///
- [SugarColumn(ColumnName="deviceState" ) ]
- public int? DeviceState { get; set; }
-
- ///
- /// 备 注:
- /// 默认值:
- ///
- [SugarColumn(ColumnName="deviceTime" ) ]
- public DateTime? DeviceTime { get; set; }
-
-
- }
-
-}
\ No newline at end of file
diff --git a/SlnMesnac.Model/domain/RFIDDeviceInfo.cs b/SlnMesnac.Model/domain/RFIDDeviceInfo.cs
deleted file mode 100644
index 12a1c97..0000000
--- a/SlnMesnac.Model/domain/RFIDDeviceInfo.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-namespace SlnMesnac.Model.domain
-{
- public class RFIDDeviceInfo
- {
- public string IPAddress { get; set; }
- public string EQUID { get; set; }
- public string position { get; set; }
- public string ApiPort { get; set; }
- }
-}
\ No newline at end of file
diff --git a/SlnMesnac.Model/domain/real_readdata.cs b/SlnMesnac.Model/domain/real_readdata.cs
index 78c6307..bae6aa5 100644
--- a/SlnMesnac.Model/domain/real_readdata.cs
+++ b/SlnMesnac.Model/domain/real_readdata.cs
@@ -1,6 +1,7 @@
using System;
using System.Linq;
using System.Text;
+using SQLite;
using SqlSugar;
namespace SlnMesnac.Repository
@@ -8,91 +9,82 @@ namespace SlnMesnac.Repository
///
///
///
- [SugarTable("real_readdata")]
public partial class real_readdata
{
- public real_readdata(){
+ public real_readdata()
+ {
- }
- ///
- /// Desc:
- /// Default:
- /// Nullable:False
- ///
- [SugarColumn(IsPrimaryKey=true,IsIdentity=true,ColumnName="objid")]
- public int objid {get;set;}
-
- ///
- /// Desc:
- /// Default:
- /// Nullable:True
- ///
- [SugarColumn(ColumnName="orderno")]
- public string orderno {get;set;}
-
- ///
- /// Desc:
- /// Default:
- /// Nullable:True
- ///
- [SugarColumn(ColumnName="lineno")]
- public string lineno {get;set;}
-
- ///
- /// Desc:
- /// Default:
- /// Nullable:True
- ///
- [SugarColumn(ColumnName="producttype")]
- public string producttype {get;set;}
-
- ///
- /// Desc:
- /// Default:
- /// Nullable:True
- ///
- [SugarColumn(ColumnName="rfidepc")]
- public string rfidepc {get;set;}
-
- ///
- /// Desc:
- /// Default:
- /// Nullable:True
- ///
- [SugarColumn(ColumnName="rfidascii")]
- public string rfidascii {get;set;}
-
- ///
- /// Desc:
- /// Default:
- /// Nullable:True
- ///
- [SugarColumn(ColumnName="readtime")]
- public DateTime? readtime {get;set;}
-
- ///
- /// Desc:
- /// Default:
- /// Nullable:True
- ///
- [SugarColumn(ColumnName="writetime")]
- public DateTime? writetime {get;set;}
-
- ///
- /// Desc:
- /// Default:
- /// Nullable:True
- ///
- [SugarColumn(ColumnName="writestatus")]
- public string writestatus {get;set;}
+ }
+ ///
+ /// Desc:
+ /// Default:
+ /// Nullable:False
+ ///
+ [PrimaryKey]
+ public int objid { get; set; }
+
+ ///
+ /// Desc:
+ /// Default:
+ /// Nullable:True
+ ///
+ public string orderno { get; set; }
+
+ ///
+ /// Desc:
+ /// Default:
+ /// Nullable:True
+ ///
+ public string lineno { get; set; }
+
+ ///
+ /// Desc:
+ /// Default:
+ /// Nullable:True
+ ///
+ public string producttype { get; set; }
+
+ ///
+ /// Desc:
+ /// Default:
+ /// Nullable:True
+ ///
+ public string rfidepc { get; set; }
+
+ ///
+ /// Desc:
+ /// Default:
+ /// Nullable:True
+ ///
+ public string rfidascii { get; set; }
+
+ ///
+ /// Desc:
+ /// Default:
+ /// Nullable:True
+ ///
+ public DateTime? readtime { get; set; }
+
+ ///
+ /// Desc:
+ /// Default:
+ /// Nullable:True
+ ///
+ public DateTime? writetime { get; set; }
+
+ ///
+ /// Desc:
+ /// Default:
+ /// Nullable:True
+ ///
+ public string writestatus { get; set; }
///
/// Desc:
/// Default:
/// Nullable:True
///
- [SugarColumn(ColumnName = "serialno")]
public string serialno { get; set; }
}
}
diff --git a/SlnMesnac.Repository/Repository.cs b/SlnMesnac.Repository/Repository.cs
deleted file mode 100644
index 7216a1c..0000000
--- a/SlnMesnac.Repository/Repository.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-using SqlSugar;
-using System;
-
-#region << 版 本 注 释 >>
-/*--------------------------------------------------------------------
-* 版权所有 (c) 2024 WenJY 保留所有权利。
-* CLR版本:4.0.30319.42000
-* 机器名称:LAPTOP-E0N2L34V
-* 命名空间:SlnMesnac.Repository
-* 唯一标识:496f8d2b-70e3-4a05-ae18-a9b0fcd06b82
-*
-* 创建者:WenJY
-* 电子邮箱:wenjy@mesnac.com
-* 创建时间:2024-03-27 21:58:35
-* 版本:V1.0.0
-* 描述:
-*
-*--------------------------------------------------------------------
-* 修改人:
-* 时间:
-* 修改说明:
-*
-* 版本:V1.0.0
-*--------------------------------------------------------------------*/
-#endregion << 版 本 注 释 >>
-namespace SlnMesnac.Repository
-{
- public class Repository : SimpleClient where T : class, new()
- {
- public ITenant itenant = null;//多租户事务、GetConnection、IsAnyConnection等功能
-
- public Repository(ISqlSugarClient db)
- {
- itenant = db.AsTenant();//用来处理事务
- base.Context = db.AsTenant().GetConnectionScopeWithAttr();//获取子Db
-
- //如果不想通过注入多个仓储
- //用到ChangeRepository或者Db.GetMyRepository需要看标题4写法
- }
-
- }
-}
\ No newline at end of file
diff --git a/SlnMesnac.Repository/SQLiteHelper.cs b/SlnMesnac.Repository/SQLiteHelper.cs
index 3b31727..c05bcfd 100644
--- a/SlnMesnac.Repository/SQLiteHelper.cs
+++ b/SlnMesnac.Repository/SQLiteHelper.cs
@@ -26,7 +26,7 @@ namespace Sln.Iot.Repository
// }
//}
- private readonly string _databasePath = Path.Combine(Environment.CurrentDirectory, "rfid_db.sqlite");
+ private readonly string _databasePath = Path.Combine(Environment.CurrentDirectory, "rfiddb.db");
private readonly SQLiteConnection _connection; // SQLite连接对象
///
@@ -69,16 +69,6 @@ namespace Sln.Iot.Repository
return _connection.Delete(id);
}
- ///
- /// 根据托盘码批量删除记录
- ///
- ///
- ///
- public int DeleteTrayRange(string trayCode)
- {
- return _connection.Execute($"DELETE FROM {typeof(T).Name} WHERE TrayCode = '{trayCode}'");
- }
-
///
/// sql直接执行
///
diff --git a/SlnMesnac.Repository/SlnMesnac.Repository.csproj b/SlnMesnac.Repository/SlnMesnac.Repository.csproj
index aea7147..c9b83b6 100644
--- a/SlnMesnac.Repository/SlnMesnac.Repository.csproj
+++ b/SlnMesnac.Repository/SlnMesnac.Repository.csproj
@@ -5,6 +5,12 @@
enable
+
+
+
+
+
+
@@ -18,8 +24,4 @@
-
-
-
-
diff --git a/SlnMesnac.Repository/service/RealReadDataService.cs b/SlnMesnac.Repository/service/RealReadDataService.cs
new file mode 100644
index 0000000..730b58c
--- /dev/null
+++ b/SlnMesnac.Repository/service/RealReadDataService.cs
@@ -0,0 +1,22 @@
+using Sln.Iot.Repository;
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SlnMesnac.Repository.service
+{
+ public class RealReadDataService
+ {
+ private static readonly Lazy lazy = new Lazy(() => new RealReadDataService());
+
+ public static RealReadDataService Instance
+ {
+ get
+ {
+ return lazy.Value;
+ }
+ }
+
+ public SQLiteHelper Helper = new SQLiteHelper();
+ }
+}
diff --git a/SlnMesnac.Repository/service/base/BaseServiceImpl.cs b/SlnMesnac.Repository/service/base/BaseServiceImpl.cs
deleted file mode 100644
index a8d6a54..0000000
--- a/SlnMesnac.Repository/service/base/BaseServiceImpl.cs
+++ /dev/null
@@ -1,359 +0,0 @@
-using Microsoft.Extensions.Logging;
-using SlnMesnac.Repository.service.@base;
-using SqlSugar;
-using System;
-using System.Collections.Generic;
-using System.Linq.Expressions;
-using System.Text;
-using System.Threading.Tasks;
-
-#region << 版 本 注 释 >>
-/*--------------------------------------------------------------------
-* 版权所有 (c) 2024 WenJY 保留所有权利。
-* CLR版本:4.0.30319.42000
-* 机器名称:LAPTOP-E0N2L34V
-* 命名空间:SlnMesnac.Repository.service.Impl
-* 唯一标识:70cc8c3a-2c3b-4034-894b-f1a4f04aa21e
-*
-* 创建者:WenJY
-* 电子邮箱:wenjy@mesnac.com
-* 创建时间:2024-04-08 09:49:07
-* 版本:V1.0.0
-* 描述:
-*
-*--------------------------------------------------------------------
-* 修改人:
-* 时间:
-* 修改说明:
-*
-* 版本:V1.0.0
-*--------------------------------------------------------------------*/
-#endregion << 版 本 注 释 >>
-namespace SlnMesnac.Repository.service.@base
-{
- public class BaseServiceImpl : IBaseService where T : class, new()
- {
- public readonly Repository _rep;
-
- public BaseServiceImpl(Repository rep)
- {
- _rep = rep;
- }
-
- ///
- /// 添加实体信息
- ///
- ///
- ///
- ///
- ///
- public bool Insert(T model)
- {
- if (model == null)
- {
- throw new ArgumentNullException($"添加实体信息异常:实体参数为空");
- }
-
- try
- {
- return _rep.Insert(model);
- }
- catch (Exception ex)
- {
- throw new InvalidOperationException($"添加实体信息异常:{ex.Message}");
- }
-
- }
-
- ///
- /// 批量添加实体集合
- ///
- ///
- ///
- ///
- ///
- public bool Insert(List lisT)
- {
- if (lisT == null)
- {
- throw new ArgumentNullException($"批量添加实体集合异常:实体集合参数为空");
- }
- try
- {
- _rep.AsTenant().BeginTran();
- var info = _rep.InsertRange(lisT);
- _rep.AsTenant().CommitTran();
- return true;
- }
- catch (Exception ex)
- {
- _rep.AsTenant().RollbackTran();
- throw new InvalidOperationException($"批量添加实体集合异常:{ex.Message}");
- }
- }
-
- ///
- /// 根据id 删除信息
- ///
- ///
- ///
- ///
- public bool DeleteById(object id)
- {
- if (id == null)
- {
- throw new ArgumentNullException($"根据id删除信息异常:Id参数为空");
- }
- try
- {
- return _rep.DeleteById(id);
- }
- catch (Exception ex)
- {
- throw new InvalidOperationException($"根据id删除信息异常:{ex.Message}");
- }
- }
-
- ///
- /// 根据实体删除信息
- ///
- ///
- ///
- ///
- ///
- public bool Delete(T model)
- {
- if (model == null)
- {
- throw new ArgumentNullException($"根据实体删除信息异常:实体参数为空");
- }
- try
- {
- return _rep.DeleteById(model);
- }
- catch (Exception ex)
- {
- throw new InvalidOperationException($"根据实体删除信息异常:{ex.Message}");
- }
- }
-
- ///
- /// 根据实体集合批量删除信息
- ///
- ///
- ///
- ///
- public bool Deletes(List entitys)
- {
- if (entitys == null)
- {
- throw new ArgumentNullException($"根据实体集合批量删除信息异常:实体集合参数为空");
- }
- try
- {
- return _rep.Delete(entitys);
- }
- catch (Exception ex)
- {
- throw new InvalidOperationException($"根据实体集合批量删除信息异常:{ex.Message}");
- }
- }
-
- ///
- /// 根据实体更新信息
- ///
- ///
- ///
- ///
- public bool Update(T model)
- {
- if (model == null)
- {
- throw new ArgumentNullException($"根据实体更新信息异常:实体参数为空");
- }
- try
- {
- return _rep.Update(model);
- }
- catch (Exception ex)
- {
- throw new InvalidOperationException($"根据实体更新信息异常:{ex.Message}");
- }
- }
-
- ///
- /// 批量更新实体集合信息
- ///
- ///
- ///
- ///
- public bool Update(List entitys)
- {
- if (entitys == null)
- {
- throw new ArgumentNullException($"批量更新实体集合信息异常:实体集合参数为空");
- }
-
- try
- {
- return _rep.UpdateRange(entitys);
- }
- catch (Exception ex)
- {
- throw new InvalidOperationException($"批量更新实体集合信息异常:{ex.Message}");
- }
- }
-
- ///
- /// 根据Where条件更新实体信息
- ///
- ///
- ///
- ///
- public bool Update(T entity, string strWhere)
- {
- if (entity == null)
- {
- throw new ArgumentNullException($"根据Where条件更新实体信息异常:实体参数为空");
- }
-
- if (string.IsNullOrEmpty(strWhere))
- {
- throw new ArgumentNullException($"根据Where条件更新实体信息异常:Where参数为空");
- }
-
- try
- {
- return _rep.AsUpdateable(entity).Where(strWhere).ExecuteCommandHasChange();
- }
- catch (Exception ex)
- {
- throw new InvalidOperationException($"根据Where条件更新实体信息异常:{ex.Message}");
- }
- }
-
- ///
- /// 根据实体更新指定列
- ///
- ///
- ///
- ///
- ///
- ///
- public bool Update(T entity, List lstColumns = null, List lstIgnoreColumns = null, string strWhere = "")
- {
- try
- {
- IUpdateable up = _rep.AsUpdateable(entity);
- if (lstIgnoreColumns != null && lstIgnoreColumns.Count > 0)
- {
- up = up.IgnoreColumns(lstIgnoreColumns.ToArray());
- }
- if (lstColumns != null && lstColumns.Count > 0)
- {
- up = up.UpdateColumns(lstColumns.ToArray());
- }
- if (!string.IsNullOrEmpty(strWhere))
- {
- up = up.Where(strWhere);
- }
- return up.ExecuteCommandHasChange();
- }
- catch (Exception ex)
- {
- throw new InvalidOperationException($"根据实体更新指定列异常:{ex.Message}");
- }
- }
-
- ///
- /// 查询所有信息
- ///
- ///
- ///
- public List Query()
- {
- try
- {
- return _rep.GetList();
- }
- catch (Exception ex)
- {
- throw new InvalidOperationException($"查询所有信息异常:{ex.Message}");
- }
- }
-
- ///
- /// 根据Id查询实体
- ///
- ///
- ///
- ///
- public T Query(object objId)
- {
- if (objId == null)
- {
- throw new ArgumentNullException($"根据Id查询实体信息异常:Id参数为空");
- }
- try
- {
- return _rep.GetById(objId);
- }
- catch (Exception ex)
- {
- throw new InvalidOperationException($"根据Id查询实体信息异常:{ex.Message}");
- }
- }
-
- ///
- /// 根据表达式查询
- ///
- ///
- ///
- ///
- public List Query(Expression> whereExpression)
- {
- if (whereExpression == null)
- {
- throw new ArgumentNullException($"根据表达式查询实体信息异常:表达式参数为空");
- }
- try
- {
- return _rep.GetList(whereExpression);
- }
- catch (Exception ex)
- {
- throw new InvalidOperationException($"根据表达式查询实体信息异常:{ex.Message}");
- }
- }
-
- ///
- /// 根据表达式排序查询
- ///
- ///
- ///
- ///
- ///
- ///
- public List Query(Expression> whereExpression, Expression> orderByExpression, bool isAsc = true)
- {
- if (whereExpression == null)
- {
- throw new ArgumentNullException($"根据表达式排序查询信息异常:条件表达式参数为空");
- }
-
- if (orderByExpression == null)
- {
- throw new ArgumentNullException($"根据表达式排序查询信息异常:排序表达式参数为空");
- }
-
- try
- {
- return _rep.AsQueryable().OrderByIF(orderByExpression != null, orderByExpression, isAsc ? OrderByType.Asc : OrderByType.Desc).WhereIF(whereExpression != null, whereExpression).ToList();
- }
- catch (Exception ex)
- {
- throw new InvalidOperationException($"根据表达式排序查询信息异常:{ex.Message}");
- }
- }
- }
-}
diff --git a/SlnMesnac.Repository/service/base/IBaseService.cs b/SlnMesnac.Repository/service/base/IBaseService.cs
deleted file mode 100644
index 029ac99..0000000
--- a/SlnMesnac.Repository/service/base/IBaseService.cs
+++ /dev/null
@@ -1,106 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq.Expressions;
-using System.Text;
-
-namespace SlnMesnac.Repository.service.@base
-{
- public interface IBaseService where T : class
- {
- ///
- /// 添加实体信息
- ///
- ///
- ///
- bool Insert(T model);
-
- ///
- /// 批量添加实体集合
- ///
- ///
- ///
- bool Insert(List lisT);
-
- ///
- /// 根据id 删除信息
- ///
- ///
- ///
- bool DeleteById(object id);
-
- ///
- /// 根据实体删除信息
- ///
- ///
- ///
- bool Delete(T model);
-
- ///
- /// 根据实体集合批量删除信息
- ///
- ///
- ///
- bool Deletes(List entitys);
-
- ///
- /// 根据实体更新信息
- ///
- ///
- ///
- bool Update(T model);
-
- ///
- /// 批量更新实体集合信息
- ///
- ///
- ///
- bool Update(List entitys);
-
- ///
- /// 根据Where条件更新实体信息
- ///
- ///
- ///
- ///
- bool Update(T entity, string strWhere);
-
- ///
- /// 根据实体更新指定列
- ///
- ///
- ///
- ///
- ///
- ///
- bool Update(T entity, List lstColumns = null, List lstIgnoreColumns = null, string strWhere = "");
-
- ///
- /// 查询所有信息
- ///
- ///
- List Query();
-
- ///
- /// 根据Id查询实体
- ///
- ///
- ///
- T Query(object objId);
-
- ///
- /// 根据表达式查询
- ///
- ///
- ///
- List Query(Expression> whereExpression);
-
- ///
- /// 根据表达式排序查询
- ///
- /// 查询条件
- /// 排序条件
- /// 是否正序
- ///
- List Query(Expression> whereExpression, Expression> orderByExpression, bool isAsc = true);
- }
-}
diff --git a/SlnMesnac.Rfid/Factory/FuchsFactory.cs b/SlnMesnac.Rfid/Factory/FuchsFactory.cs
index 2c9532c..6703a07 100644
--- a/SlnMesnac.Rfid/Factory/FuchsFactory.cs
+++ b/SlnMesnac.Rfid/Factory/FuchsFactory.cs
@@ -6,7 +6,6 @@ using SlnMesnac.Rfid.Enum;
using SlnMesnac.Rfid.NewRFIDConnect;
using SlnMesnac.Rfid.NewRFIDConnect.entity;
using SlnMesnac.Serilog;
-using SlnMesnac.TouchSocket;
using System;
using System.Collections;
using System.Collections.Generic;
diff --git a/SlnMesnac.Rfid/Factory/RflyFactory.cs b/SlnMesnac.Rfid/Factory/RflyFactory.cs
index 58c1de2..3298e8b 100644
--- a/SlnMesnac.Rfid/Factory/RflyFactory.cs
+++ b/SlnMesnac.Rfid/Factory/RflyFactory.cs
@@ -1,17 +1,14 @@
using Dm.filter.log;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Logging;
-using Models;
using Serilog;
using SlnMesnac.Common;
using SlnMesnac.Model.dto;
-using SlnMesnac.Repository.service;
using SlnMesnac.Rfid.Dto;
using SlnMesnac.Rfid.Enum;
using SlnMesnac.Rfid.NewRFIDConnect;
using SlnMesnac.Rfid.NewRFIDConnect.entity;
using SlnMesnac.Serilog;
-using SlnMesnac.TouchSocket;
using SqlSugar;
using System;
using System.Collections;
diff --git a/SlnMesnac.Rfid/SlnMesnac.Rfid.csproj b/SlnMesnac.Rfid/SlnMesnac.Rfid.csproj
index 220177f..ed1da59 100644
--- a/SlnMesnac.Rfid/SlnMesnac.Rfid.csproj
+++ b/SlnMesnac.Rfid/SlnMesnac.Rfid.csproj
@@ -16,7 +16,7 @@
-
+
diff --git a/SlnMesnac.Rfid/TouchSocketSetup.cs b/SlnMesnac.Rfid/TouchSocketSetup.cs
deleted file mode 100644
index 4fad0e3..0000000
--- a/SlnMesnac.Rfid/TouchSocketSetup.cs
+++ /dev/null
@@ -1,52 +0,0 @@
-using Microsoft.Extensions.DependencyInjection;
-using System;
-using System.Collections.Generic;
-using System.Text;
-using Microsoft.AspNetCore.Builder;
-using TouchSocket.Sockets;
-using TouchSocket.WebApi;
-using SlnMesnac.Config;
-using System.Threading.Tasks;
-
-#region << 版 本 注 释 >>
-/*--------------------------------------------------------------------
-* 版权所有 (c) 2024 WenJY 保留所有权利。
-* CLR版本:4.0.30319.42000
-* 机器名称:LAPTOP-E0N2L34V
-* 命名空间:SlnMesnac.TouchSocket
-* 唯一标识:496f8d2b-70e3-4a05-ae18-a9b0fcd06b82
-*
-* 创建者:WenJY
-* 电子邮箱:wenjy@mesnac.com
-* 创建时间:2024-03-27 21:58:35
-* 版本:V1.0.0
-* 描述:
-*
-*--------------------------------------------------------------------
-* 修改人:
-* 时间:
-* 修改说明:
-*
-* 版本:V1.0.0
-*--------------------------------------------------------------------*/
-#endregion << 版 本 注 释 >>
-namespace SlnMesnac.TouchSocket
-{
- ///
- /// 注册服务
- ///
- public static class TouchSocketSetup
- {
-
- public static async Task UseTouchSocketExtensions(this IServiceProvider service)
- {
- var _server = service.GetService();
- _server.Init(5656);
- var _appSetting = service.GetService();
- //_server.Init(6001);
- //await _httpclient.CreateWebApiClientAsync("127.0.0.1:9881");
-
- //_httpclient.CreateWebApiClient("127.0.0.1:9880");
- }
- }
-}
\ No newline at end of file
diff --git a/SlnMesnac.WPF/App.xaml.cs b/SlnMesnac.WPF/App.xaml.cs
index 7f3f0a7..465e3e0 100644
--- a/SlnMesnac.WPF/App.xaml.cs
+++ b/SlnMesnac.WPF/App.xaml.cs
@@ -7,7 +7,6 @@ using SlnMesnac.Config;
using SlnMesnac.Extensions;
using SlnMesnac.Rfid;
using SlnMesnac.Serilog;
-using SlnMesnac.TouchSocket;
using SlnMesnac.WPF.Attribute;
using SlnMesnac.WPF.Model;
using System;
@@ -88,7 +87,6 @@ namespace SlnMesnac.WPF
// 创建ServiceProvider
ServiceProvider = services.BuildServiceProvider();
- ServiceProvider.UseTouchSocketExtensions();
@@ -367,12 +365,8 @@ namespace SlnMesnac.WPF
// 加载程序集
Assembly[] assemblies = {
Assembly.LoadFrom("SlnMesnac.Repository.dll"),
- Assembly.LoadFrom("SlnMesnac.Plc.dll"),
Assembly.LoadFrom("SlnMesnac.Rfid.dll"),
Assembly.LoadFrom("SlnMesnac.Common.dll"),
- Assembly.LoadFrom("SlnMesnac.TouchSocket.dll"),
- Assembly.LoadFrom("SlnMesnac.Business.dll"),
- Assembly.LoadFrom("SlnMesnac.Generate.dll")
};
// 扫描并注册程序集中的服务
@@ -407,8 +401,7 @@ namespace SlnMesnac.WPF
// .AsSelf()
// .WithTransientLifetime());
- // 注册ORM
- services.AddSqlSugarSetup();
+
services.AddRfidFactorySetup();
}
diff --git a/SlnMesnac.WPF/MainWindow.xaml b/SlnMesnac.WPF/MainWindow.xaml
index 9bc7186..baa3696 100644
--- a/SlnMesnac.WPF/MainWindow.xaml
+++ b/SlnMesnac.WPF/MainWindow.xaml
@@ -5,64 +5,16 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:SlnMesnac.WPF"
mc:Ignorable="d"
- Title="汇集软件" WindowStartupLocation="CenterScreen" WindowState="Maximized" Height="1020" Width="1420" Topmost="False" Loaded="Window_Loaded" Closing="Window_Closing" Icon="/Highway.ico">
-
+ Title="汇集软件" WindowStartupLocation="CenterScreen" WindowState="Normal" Height="768" Width="1024" Topmost="False" Loaded="Window_Loaded" Closing="Window_Closing" Icon="/Highway.ico">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
diff --git a/SlnMesnac.WPF/MainWindow.xaml.cs b/SlnMesnac.WPF/MainWindow.xaml.cs
index 38c5a40..61a2f74 100644
--- a/SlnMesnac.WPF/MainWindow.xaml.cs
+++ b/SlnMesnac.WPF/MainWindow.xaml.cs
@@ -1,8 +1,6 @@
using Microsoft.Extensions.DependencyInjection;
using Serilog;
-using SlnMesnac.Model.AirportApiEntity;
using SlnMesnac.Serilog;
-using SlnMesnac.TouchSocket;
using SlnMesnac.WPF.Attribute;
using SlnMesnac.WPF.ViewModel;
using System;
diff --git a/SlnMesnac.WPF/Page/Generate/GenerateControl.xaml b/SlnMesnac.WPF/Page/Generate/GenerateControl.xaml
deleted file mode 100644
index a0cb758..0000000
--- a/SlnMesnac.WPF/Page/Generate/GenerateControl.xaml
+++ /dev/null
@@ -1,56 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/SlnMesnac.WPF/Page/Generate/GenerateControl.xaml.cs b/SlnMesnac.WPF/Page/Generate/GenerateControl.xaml.cs
deleted file mode 100644
index fd5a96e..0000000
--- a/SlnMesnac.WPF/Page/Generate/GenerateControl.xaml.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-using SlnMesnac.WPF.ViewModel.Generate;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Data;
-using System.Windows.Documents;
-using System.Windows.Input;
-using System.Windows.Media;
-using System.Windows.Media.Imaging;
-using System.Windows.Navigation;
-using System.Windows.Shapes;
-
-namespace SlnMesnac.WPF.Page.Generate
-{
- ///
- /// GenerateControl.xaml 的交互逻辑
- ///
- public partial class GenerateControl : UserControl
- {
- public GenerateControl()
- {
- InitializeComponent();
- this.DataContext = new GenerateControlViewModel();
- }
- }
-}
diff --git a/SlnMesnac.WPF/Page/IndexPage/ChangeType.xaml b/SlnMesnac.WPF/Page/IndexPage/ChangeType.xaml
deleted file mode 100644
index 430dd7f..0000000
--- a/SlnMesnac.WPF/Page/IndexPage/ChangeType.xaml
+++ /dev/null
@@ -1,175 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/SlnMesnac.WPF/Page/IndexPage/ChangeType.xaml.cs b/SlnMesnac.WPF/Page/IndexPage/ChangeType.xaml.cs
deleted file mode 100644
index 8397e57..0000000
--- a/SlnMesnac.WPF/Page/IndexPage/ChangeType.xaml.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-using SlnMesnac.Repository;
-using SlnMesnac.WPF.Attribute;
-using SlnMesnac.WPF.ViewModel.IndexPage;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Data;
-using System.Windows.Documents;
-using System.Windows.Input;
-using System.Windows.Media;
-using System.Windows.Media.Imaging;
-using System.Windows.Navigation;
-using System.Windows.Shapes;
-
-namespace SlnMesnac.WPF.Page.IndexPage
-{
- ///
- /// ChangeType.xaml 的交互逻辑
- ///
- [RegisterAsSingletonAttribute]
- public partial class ChangeType : UserControl
- {
- ChangeTypeViewModel ChangeTypeView;
- public ChangeType()
- {
- InitializeComponent();
- ChangeTypeView = new ChangeTypeViewModel();
- this.DataContext = ChangeTypeView;
- }
- }
-}
diff --git a/SlnMesnac.WPF/Page/IndexPage/ProductionLineUserControl.xaml b/SlnMesnac.WPF/Page/IndexPage/ProductionLineUserControl.xaml
index 7f0a163..a541f94 100644
--- a/SlnMesnac.WPF/Page/IndexPage/ProductionLineUserControl.xaml
+++ b/SlnMesnac.WPF/Page/IndexPage/ProductionLineUserControl.xaml
@@ -6,7 +6,7 @@
xmlns:local="clr-namespace:SlnMesnac.WPF.ViewModel.IndexPage" xmlns:local1="clr-namespace:SlnMesnac.WPF.Converter.Generate"
mc:Ignorable="d"
- d:DesignHeight="500" d:DesignWidth="900">
+ d:DesignHeight="768" d:DesignWidth="1024">
@@ -92,7 +92,7 @@
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
-
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/SlnMesnac.WPF/SlnMesnac.WPF.csproj b/SlnMesnac.WPF/SlnMesnac.WPF.csproj
index 245bb5f..bd214d2 100644
--- a/SlnMesnac.WPF/SlnMesnac.WPF.csproj
+++ b/SlnMesnac.WPF/SlnMesnac.WPF.csproj
@@ -35,15 +35,11 @@
-
-
-
-
@@ -63,10 +59,4 @@
-
-
- Always
-
-
-
diff --git a/SlnMesnac.WPF/Startup.cs b/SlnMesnac.WPF/Startup.cs
index 06fb155..b50e0d8 100644
--- a/SlnMesnac.WPF/Startup.cs
+++ b/SlnMesnac.WPF/Startup.cs
@@ -10,9 +10,7 @@ using Autofac;
using Microsoft.Extensions.Configuration;
using SlnMesnac.Rfid;
using SlnMesnac.Ioc;
-using SlnMesnac.Plc;
using SlnMesnac.Extensions;
-using SlnMesnac.TouchSocket;
namespace SlnMesnac.WPF
{
diff --git a/SlnMesnac.WPF/Templates/style/resourceStyle.xaml b/SlnMesnac.WPF/Templates/style/resourceStyle.xaml
index e7155f2..d8c90fd 100644
--- a/SlnMesnac.WPF/Templates/style/resourceStyle.xaml
+++ b/SlnMesnac.WPF/Templates/style/resourceStyle.xaml
@@ -134,7 +134,7 @@
-
+
diff --git a/SlnMesnac.WPF/ViewModel/Generate/GenerateControlViewModel.cs b/SlnMesnac.WPF/ViewModel/Generate/GenerateControlViewModel.cs
deleted file mode 100644
index 98f408f..0000000
--- a/SlnMesnac.WPF/ViewModel/Generate/GenerateControlViewModel.cs
+++ /dev/null
@@ -1,172 +0,0 @@
-using GalaSoft.MvvmLight;
-using GalaSoft.MvvmLight.Command;
-using HslCommunication.LogNet;
-using Microsoft.Extensions.DependencyInjection;
-using Microsoft.WindowsAPICodePack.Dialogs;
-using SlnMesnac.Config;
-using SlnMesnac.Generate;
-using SlnMesnac.WPF.Attribute;
-using SqlSugar;
-using System;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.Data;
-using System.IO;
-using System.Linq;
-using System.Windows;
-
-#region << 版 本 注 释 >>
-/*--------------------------------------------------------------------
-* 版权所有 (c) 2024 WenJY 保留所有权利。
-* CLR版本:4.0.30319.42000
-* 机器名称:LAPTOP-E0N2L34V
-* 命名空间:SlnMesnac.WPF.ViewModel.Generate
-* 唯一标识:7f1ddac5-3ff3-4974-ac90-d6eb684167c8
-*
-* 创建者:WenJY
-* 电子邮箱:wenjy@mesnac.com
-* 创建时间:2024-04-11 09:31:46
-* 版本:V1.0.0
-* 描述:
-*
-*--------------------------------------------------------------------
-* 修改人:
-* 时间:
-* 修改说明:
-*
-* 版本:V1.0.0
-*--------------------------------------------------------------------*/
-#endregion << 版 本 注 释 >>
-namespace SlnMesnac.WPF.ViewModel.Generate
-{
- [RegisterAsSingletonAttribute]
- internal class GenerateControlViewModel : ViewModelBase
- {
- private readonly AppConfig _appConfig;
-
- private readonly GenerateCode _generateCode;
-
- public GenerateControlViewModel()
- {
- _appConfig = App.ServiceProvider.GetService();
-
- _generateCode = App.ServiceProvider.GetService();
-
- var configIds = _appConfig.sqlConfig.Select(x=>x.configId).ToList();
-
- // 初始化选项列表
- Options = new ObservableCollection();
-
- foreach(var configId in configIds)
- {
- Options.Add(configId);
- }
-
- QuerySearchCommand = new RelayCommand(Query);
-
- CreateCodeCommand = new RelayCommand(CreateCode);
- }
-
- #region 参数定义
- private ObservableCollection _options;
- public ObservableCollection Options
- {
- get { return _options; }
- set
- {
- _options = value;
- RaisePropertyChanged(nameof(Options));
- }
- }
-
- private string _selectedOption;
- public string SelectedOption
- {
- get { return _selectedOption; }
- set
- {
- _selectedOption = value;
- RaisePropertyChanged(nameof(SelectedOption));
- }
- }
-
- private ObservableCollection tablesDataGrid;
-
- public ObservableCollection TablesDataGrid
- {
- get { return tablesDataGrid; }
- set { tablesDataGrid = value; RaisePropertyChanged(() => TablesDataGrid); }
-
- }
- #endregion
-
- #region 事件定义
- public RelayCommand QuerySearchCommand { get; set; }
-
- public RelayCommand CreateCodeCommand { get;set; }
- #endregion
-
- ///
- /// 查询事件
- ///
- ///
- private void Query(string search)
- {
- var configId = _selectedOption;
-
- if (!string.IsNullOrEmpty(configId))
- {
- var db = App.ServiceProvider.GetService();
- var scope = db.AsTenant().GetConnectionScope(configId);
-
- List tables;
- if (!string.IsNullOrEmpty(search))
- {
- tables = scope.DbMaintenance.GetTableInfoList(false).FindAll(x=>x.Name == search);
- }
- else
- {
- tables = scope.DbMaintenance.GetTableInfoList(false);
- }
- if (tables != null)
- {
- TablesDataGrid = new ObservableCollection();
- tables.ForEach(t => { TablesDataGrid.Add(t); });
- }
- }
-
-
- }
-
- private void CreateCode(string tableName)
- {
- var info = tableName;
- var configId = _selectedOption;
-
- string nameSpace = "SlnMesnac.Repository";
-
- try
- {
- using (CommonOpenFileDialog dialog = new CommonOpenFileDialog())
- {
- dialog.IsFolderPicker = true; // 设置为选择文件夹
- if (dialog.ShowDialog() == CommonFileDialogResult.Ok)
- {
- string selectedPath = dialog.FileName;
-
- var res = _generateCode.CreateCode(configId, tableName, selectedPath, nameSpace);
-
- if (res)
- {
- MessageBox.Show($"{tableName}代码生成成功");
- }
- }
- }
- }catch(Exception ex)
- {
- MessageBox.Show($"{tableName}代码生成失败:{ex.Message}");
- }
- }
-
- }
-}
diff --git a/SlnMesnac.WPF/ViewModel/IndexPage/HistorySearchViewModel.cs b/SlnMesnac.WPF/ViewModel/IndexPage/HistorySearchViewModel.cs
index 96aa415..49bb80c 100644
--- a/SlnMesnac.WPF/ViewModel/IndexPage/HistorySearchViewModel.cs
+++ b/SlnMesnac.WPF/ViewModel/IndexPage/HistorySearchViewModel.cs
@@ -3,7 +3,6 @@ using CommunityToolkit.Mvvm.Input;
using CommunityToolkit.Mvvm.Messaging;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
-using Models;
using OfficeOpenXml;
using SlnMesnac.Common;
using SlnMesnac.Config;
@@ -34,12 +33,12 @@ namespace SlnMesnac.WPF.ViewModel.IndexPage
private AppsettingsConfig _appSettings = new AppsettingsConfig();
public Action Action;
public delegate void RefreshDataInfo(Real_DataInfo real_Data);
- private ISqlSugarClient? sqlSugarClient;
+ private RealReadDataService dataService = RealReadDataService.Instance;
+
public event RefreshDataInfo? RefreshDataInfoEvent;
public HistorySearchViewModel()
{
- sqlSugarClient = App.ServiceProvider.GetService();
GetOrderInfoCommand = new RelayCommand