From c15e3ea164c0ab785d439aa11ba1d583db80b6fd Mon Sep 17 00:00:00 2001 From: clovejunti Date: Tue, 28 May 2024 23:11:30 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 17 ++ .../Logs/DeviceMaintenanceLogInfo.cs | 51 ++++ DeviceRepair.Models/Logs/RoleAuthLogInfo.cs | 49 ++++ DeviceRepair.Models/Logs/UserLockLogInfo.cs | 49 ++++ DeviceRepair.Models/Logs/UserLogin.cs | 40 ++++ .../Logs/UserPwdErrorLogInfo.cs | 43 ++++ DeviceRepair.Utils/ComputerHelper.cs | 221 ++++++++++++++++++ DeviceRepair.Utils/Config/ConfigProperties.cs | 6 + DeviceRepair.Utils/DeviceRepair.Utils.csproj | 2 + DeviceRepairAndOptimization.sln | 4 +- DeviceRepairAndOptimization/App.config | 2 +- DeviceRepairAndOptimization/Biz/ApiHelper.cs | 3 +- .../Biz/CommonManager.cs | 6 +- .../Biz/DeviceManager.cs | 10 +- .../Biz/FieldsManager.cs | 8 +- .../Biz/FormManager.cs | 18 +- .../Biz/MaintenanceManager.cs | 8 +- .../Biz/PlanManager.cs | 18 +- .../Biz/PreserveManager.cs | 16 +- DeviceRepairAndOptimization/Biz/RoleManger.cs | 18 +- .../Biz/UserManager.cs | 20 +- .../DLLs/HttpHelper.dll | 3 + .../DeviceRepairAndOptimization.csproj | 38 +-- DeviceRepairAndOptimization/GlobalInfo.cs | 1 + .../Models/MaintenanceVer/TemplateIndexV1.cs | 2 + DeviceRepairAndOptimization/Program.cs | 4 +- Test/Test.csproj | 2 +- 27 files changed, 555 insertions(+), 104 deletions(-) create mode 100644 .gitignore create mode 100644 DeviceRepair.Models/Logs/DeviceMaintenanceLogInfo.cs create mode 100644 DeviceRepair.Models/Logs/RoleAuthLogInfo.cs create mode 100644 DeviceRepair.Models/Logs/UserLockLogInfo.cs create mode 100644 DeviceRepair.Models/Logs/UserLogin.cs create mode 100644 DeviceRepair.Models/Logs/UserPwdErrorLogInfo.cs create mode 100644 DeviceRepair.Utils/ComputerHelper.cs create mode 100644 DeviceRepairAndOptimization/DLLs/HttpHelper.dll diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b4a7cf6 --- /dev/null +++ b/.gitignore @@ -0,0 +1,17 @@ + +.vs +DeviceRepair.Utils/bin +DeviceRepair.Utils/obj +DeviceRepair.Api/bin +DeviceRepair.Api/obj +DeviceRepair.Models/bin +DeviceRepair.Models/obj +DeviceRepairAndOptimization/bin +DeviceRepairAndOptimization/obj +Intend/obj +packages +TsSFCDeivceClient/obj +DeviceRepair.DataAccess/bin +DeviceRepair.DataAccess/obj +Test/bin +Test/obj diff --git a/DeviceRepair.Models/Logs/DeviceMaintenanceLogInfo.cs b/DeviceRepair.Models/Logs/DeviceMaintenanceLogInfo.cs new file mode 100644 index 0000000..4440762 --- /dev/null +++ b/DeviceRepair.Models/Logs/DeviceMaintenanceLogInfo.cs @@ -0,0 +1,51 @@ +using SqlSugar; +using System; + +namespace DeviceRepair.Models.Logs +{ + /// + /// DeviceMaintenanceLogInfo + /// + [SugarTable("DeviceMaintenanceLog")] + public class DeviceMaintenanceLogInfo + { + /// + /// 默认构造函数(需要初始化属性的在此处理) + /// + public DeviceMaintenanceLogInfo() + { + + } + + #region Property Members + + [SugarColumn(IsPrimaryKey = true, IsIdentity = true)] + public virtual int AutoID { get; set; } + + public virtual int EquipmentAutoID { get; set; } + + public virtual string EquipmentID { get; set; } + + public virtual string EquipmentName { get; set; } + + public virtual string OperationType { get; set; } + + public virtual int PlanID { get; set; } + + public virtual string PlanType { get; set; } + + public virtual DateTime OperationDate { get; set; } + + public virtual int OperationUser { get; set; } + + public virtual string OperationUserName { get; set; } + + public virtual string OperationIP { get; set; } + + public virtual string OperationComputer { get; set; } + + + #endregion + + } +} diff --git a/DeviceRepair.Models/Logs/RoleAuthLogInfo.cs b/DeviceRepair.Models/Logs/RoleAuthLogInfo.cs new file mode 100644 index 0000000..e09b530 --- /dev/null +++ b/DeviceRepair.Models/Logs/RoleAuthLogInfo.cs @@ -0,0 +1,49 @@ +using SqlSugar; +using System; + +namespace DeviceRepair.Models.History +{ + /// + /// RoleAuthLogInfo + /// + [SugarTable("RoleAuthLog")] + public class RoleAuthLogInfo + { + /// + /// 默认构造函数(需要初始化属性的在此处理) + /// + public RoleAuthLogInfo() + { + + } + + #region Property Members + + [SugarColumn(IsPrimaryKey = true, IsIdentity = true)] + public virtual int AutoID { get; set; } + + public virtual int RoleAutoID { get; set; } + + public virtual int AuthAutoID { get; set; } + + public virtual string OperationContent { get; set; } + + public virtual string OperationType { get; set; } + + public virtual DateTime OperationDate { get; set; } + + public virtual int OperationUser { get; set; } + + public virtual string OperationUserName { get; set; } + + public virtual string OperationIP { get; set; } + + public virtual string OperationComputer { get; set; } + + public virtual string Description { get; set; } + + + #endregion + + } +} diff --git a/DeviceRepair.Models/Logs/UserLockLogInfo.cs b/DeviceRepair.Models/Logs/UserLockLogInfo.cs new file mode 100644 index 0000000..04f6929 --- /dev/null +++ b/DeviceRepair.Models/Logs/UserLockLogInfo.cs @@ -0,0 +1,49 @@ +using SqlSugar; +using System; + +namespace DeviceRepair.Models.History +{ + /// + /// UserLockLogInfo + /// + [SugarTable("UserLockLog")] + public class UserLockLogInfo + { + /// + /// 默认构造函数(需要初始化属性的在此处理) + /// + public UserLockLogInfo() + { + + } + + #region Property Members + + [SugarColumn(IsPrimaryKey = true, IsIdentity = true)] + public virtual int AutoID { get; set; } + + public virtual int UserAutoID { get; set; } + + public virtual string LoginCode { get; set; } + + public virtual string LockType { get; set; } + + public virtual string OperationType { get; set; } + + public virtual DateTime OperationDate { get; set; } + + public virtual int OperationUser { get; set; } + + public virtual string OperationUserName { get; set; } + + public virtual string OperationIP { get; set; } + + public virtual string OperationComputer { get; set; } + + public virtual string Description { get; set; } + + + #endregion + + } +} diff --git a/DeviceRepair.Models/Logs/UserLogin.cs b/DeviceRepair.Models/Logs/UserLogin.cs new file mode 100644 index 0000000..d87ecc3 --- /dev/null +++ b/DeviceRepair.Models/Logs/UserLogin.cs @@ -0,0 +1,40 @@ +using SqlSugar; +using System; + +namespace DeviceRepair.Models.History +{ + /// + /// UserLoginLogInfo + /// + [Serializable] + [SugarTable("UserLoginLog")] + public class UserLogin + { + /// + /// 默认构造函数(需要初始化属性的在此处理) + /// + public UserLogin() + { + + } + + #region Property Members + + [SugarColumn(IsPrimaryKey = true, IsIdentity = true)] + public int AutoID { get; set; } + + public string LoginCode { get; set; } + + public string OperationType { get; set; } + + [SugarColumn(IsOnlyIgnoreInsert = true)] + public DateTime OperationDate { get; set; } + + public string OperationIP { get; set; } + + public string OperationComputer { get; set; } + + #endregion + + } +} diff --git a/DeviceRepair.Models/Logs/UserPwdErrorLogInfo.cs b/DeviceRepair.Models/Logs/UserPwdErrorLogInfo.cs new file mode 100644 index 0000000..4d10c02 --- /dev/null +++ b/DeviceRepair.Models/Logs/UserPwdErrorLogInfo.cs @@ -0,0 +1,43 @@ +using SqlSugar; +using System; + +namespace DeviceRepair.Models.History +{ + /// + /// UserPwdErrorLogInfo + /// + [SugarTable("UserPwdErrorLog")] + public class UserPwdErrorLogInfo + { + /// + /// 默认构造函数(需要初始化属性的在此处理) + /// + public UserPwdErrorLogInfo() + { + + } + + #region Property Members + + [SugarColumn(IsPrimaryKey = true, IsIdentity = true)] + public virtual int AutoID { get; set; } + + public virtual string LoginCode { get; set; } + + public virtual string TryCount { get; set; } + + public virtual DateTime OperationDate { get; set; } + + public virtual int OperationUser { get; set; } + + public virtual string OperationUserName { get; set; } + + public virtual string OperationIP { get; set; } + + public virtual string OperationComputer { get; set; } + + + #endregion + + } +} diff --git a/DeviceRepair.Utils/ComputerHelper.cs b/DeviceRepair.Utils/ComputerHelper.cs new file mode 100644 index 0000000..f6110e8 --- /dev/null +++ b/DeviceRepair.Utils/ComputerHelper.cs @@ -0,0 +1,221 @@ +using System; +using System.Drawing; +using System.Management; +using System.Runtime.InteropServices; + +namespace DeviceRepair.Utils +{ + public static class ComputerHelper + { + #region Win32 API + + [DllImport("user32.dll")] + static extern IntPtr GetDC(IntPtr ptr); + [DllImport("gdi32.dll")] + static extern int GetDeviceCaps( + IntPtr hdc, // handle to DC + int nIndex // index of capability + ); + [DllImport("user32.dll", EntryPoint = "ReleaseDC")] + static extern IntPtr ReleaseDC(IntPtr hWnd, IntPtr hDc); + + #endregion + + #region DeviceCaps - 设备属性 常量 + + const int HORZRES = 8; + const int VERTRES = 10; + const int LOGPIXELSX = 88; + const int LOGPIXELSY = 90; + const int DESKTOPVERTRES = 117; + const int DESKTOPHORZRES = 118; + + #endregion + + #region 属性 + + private static string _MacAddress; + /// + /// 获取网卡硬件地址 + /// + /// + public static string GetMacAddress + { + get + { + try + { + //获取网卡硬件地址 + if (!string.IsNullOrWhiteSpace(_MacAddress)) + return _MacAddress; + + ManagementClass mc = new ManagementClass("Win32_NetworkAdapterConfiguration"); + ManagementObjectCollection moc = mc.GetInstances(); + foreach (ManagementObject mo in moc) + { + if ((bool)mo["IPEnabled"] == true) + { + _MacAddress = mo["MacAddress"].ToString(); + break; + } + } + moc = null; + mc = null; + return _MacAddress; + } + catch + { + return "unknow"; + } + } + } + + private static string _IPAddress; + public static string GetIPAddress + { + get + { + try + { + if (!string.IsNullOrWhiteSpace(_IPAddress)) + return _IPAddress; + + //获取IP地址 + ManagementClass mc = new ManagementClass("Win32_NetworkAdapterConfiguration"); + ManagementObjectCollection moc = mc.GetInstances(); + foreach (ManagementObject mo in moc) + { + if ((bool)mo["IPEnabled"] == true) + { + Array ar; + ar = (Array)(mo.Properties["IpAddress"].Value); + _IPAddress = ar.GetValue(0).ToString(); + break; + } + } + moc = null; + mc = null; + return _IPAddress; + } + catch + { + return "unknow"; + } + } + } + + private static string _ComputerName; + /// + /// 获取计算机名称 + /// + /// + public static string GetComputerName + { + get + { + try + { + if (!string.IsNullOrWhiteSpace(_ComputerName)) + return _ComputerName; + _ComputerName = Environment.GetEnvironmentVariable("ComputerName"); + return _ComputerName; + } + catch + { + return "unknow"; + } + } + } + + /// + /// 当前系统DPI_X 大小 一般为96 + /// + public static int DpiX + { + get + { + IntPtr hdc = GetDC(IntPtr.Zero); + int DpiX = GetDeviceCaps(hdc, LOGPIXELSX); + ReleaseDC(IntPtr.Zero, hdc); + return DpiX; + } + } + + /// + /// 当前系统DPI_Y 大小 一般为96 + /// + public static int DpiY + { + get + { + IntPtr hdc = GetDC(IntPtr.Zero); + int DpiX = GetDeviceCaps(hdc, LOGPIXELSY); + ReleaseDC(IntPtr.Zero, hdc); + return DpiX; + } + } + + /// + /// 获取宽度缩放百分比 + /// + public static float ScaleX + { + get + { + IntPtr hdc = GetDC(IntPtr.Zero); + float ScaleX = (float)GetDeviceCaps(hdc, DESKTOPHORZRES) / (float)GetDeviceCaps(hdc, HORZRES); + ReleaseDC(IntPtr.Zero, hdc); + return ScaleX; + } + } + + /// + /// 获取高度缩放百分比 + /// + public static float ScaleY + { + get + { + IntPtr hdc = GetDC(IntPtr.Zero); + float ScaleY = (float)(float)GetDeviceCaps(hdc, DESKTOPVERTRES) / (float)GetDeviceCaps(hdc, VERTRES); + ReleaseDC(IntPtr.Zero, hdc); + return ScaleY; + } + } + + /// + /// 获取真实设置的桌面分辨率大小 + /// + public static Size DesktopResolution + { + get + { + IntPtr hdc = GetDC(IntPtr.Zero); + Size size = new Size(); + size.Width = GetDeviceCaps(hdc, DESKTOPHORZRES); + size.Height = GetDeviceCaps(hdc, DESKTOPVERTRES); + ReleaseDC(IntPtr.Zero, hdc); + return size; + } + } + + /// + /// 获取屏幕分辨率当前物理大小 + /// + public static Size WorkingArea + { + get + { + IntPtr hdc = GetDC(IntPtr.Zero); + Size size = new Size(); + size.Width = GetDeviceCaps(hdc, HORZRES); + size.Height = GetDeviceCaps(hdc, VERTRES); + ReleaseDC(IntPtr.Zero, hdc); + return size; + } + } + + #endregion + } + +} diff --git a/DeviceRepair.Utils/Config/ConfigProperties.cs b/DeviceRepair.Utils/Config/ConfigProperties.cs index 64c926a..b5fab6e 100644 --- a/DeviceRepair.Utils/Config/ConfigProperties.cs +++ b/DeviceRepair.Utils/Config/ConfigProperties.cs @@ -13,6 +13,12 @@ [Config("LogConnection")] public string logConn { get; set; } + /// + /// 加密Key + /// + [Config("SecureKey")] + public string SecureKey { get; set; } + /// /// 数据通讯类型 /// api diff --git a/DeviceRepair.Utils/DeviceRepair.Utils.csproj b/DeviceRepair.Utils/DeviceRepair.Utils.csproj index 9cb5b6e..09fa454 100644 --- a/DeviceRepair.Utils/DeviceRepair.Utils.csproj +++ b/DeviceRepair.Utils/DeviceRepair.Utils.csproj @@ -37,6 +37,7 @@ + @@ -47,6 +48,7 @@ + diff --git a/DeviceRepairAndOptimization.sln b/DeviceRepairAndOptimization.sln index 532a9b8..bc458eb 100644 --- a/DeviceRepairAndOptimization.sln +++ b/DeviceRepairAndOptimization.sln @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:16e232598dc3ca90040bd045eefd460f75b474339e223e18d432b9210d60fa30 -size 8524 +oid sha256:9881a19fc763e478411309284ac4684d829f3c4af52f59e4843f61632bbbef76 +size 6025 diff --git a/DeviceRepairAndOptimization/App.config b/DeviceRepairAndOptimization/App.config index 4759489..63eda88 100644 --- a/DeviceRepairAndOptimization/App.config +++ b/DeviceRepairAndOptimization/App.config @@ -73,7 +73,7 @@ - + diff --git a/DeviceRepairAndOptimization/Biz/ApiHelper.cs b/DeviceRepairAndOptimization/Biz/ApiHelper.cs index 1223688..89c699b 100644 --- a/DeviceRepairAndOptimization/Biz/ApiHelper.cs +++ b/DeviceRepairAndOptimization/Biz/ApiHelper.cs @@ -1,6 +1,7 @@ using CsharpHttpHelper; using CsharpHttpHelper.Enum; using DeviceRepair.Models; +using DeviceRepair.Utils; using DeviceRepair.Utils.Security; using Newtonsoft.Json; using System; @@ -15,7 +16,7 @@ namespace DeviceRepairAndOptimization.Biz public class ApiHelper { HttpHelper http = null; - public static readonly string ServiceUrl = $"http://{Models.Config.Configurations.Properties.ServiceIP}/{Models.Config.Configurations.Properties.ServiceName}/"; + public static readonly string ServiceUrl = $"http://{DeviceRepair.Utils.Config.Configurations.Properties.ServiceIP}/{DeviceRepair.Utils.Config.Configurations.Properties.ServiceName}/"; private static ApiHelper manager; diff --git a/DeviceRepairAndOptimization/Biz/CommonManager.cs b/DeviceRepairAndOptimization/Biz/CommonManager.cs index 729e196..bf834f0 100644 --- a/DeviceRepairAndOptimization/Biz/CommonManager.cs +++ b/DeviceRepairAndOptimization/Biz/CommonManager.cs @@ -31,7 +31,7 @@ namespace DeviceRepairAndOptimization.Biz try { - switch (Models.Config.Configurations.Properties.ConnType?.ToLower()) + switch (DeviceRepair.Utils.Config.Configurations.Properties.ConnType?.ToLower()) { case "api": #region api @@ -75,7 +75,7 @@ namespace DeviceRepairAndOptimization.Biz try { - switch (Models.Config.Configurations.Properties.ConnType?.ToLower()) + switch (DeviceRepair.Utils.Config.Configurations.Properties.ConnType?.ToLower()) { case "api": #region api @@ -119,7 +119,7 @@ namespace DeviceRepairAndOptimization.Biz try { - switch (Models.Config.Configurations.Properties.ConnType?.ToLower()) + switch (DeviceRepair.Utils.Config.Configurations.Properties.ConnType?.ToLower()) { case "api": apiResponseData = ApiHelper.Instance.SendMessage(new HttpItem diff --git a/DeviceRepairAndOptimization/Biz/DeviceManager.cs b/DeviceRepairAndOptimization/Biz/DeviceManager.cs index bb2aec2..6975c64 100644 --- a/DeviceRepairAndOptimization/Biz/DeviceManager.cs +++ b/DeviceRepairAndOptimization/Biz/DeviceManager.cs @@ -34,7 +34,7 @@ namespace DeviceRepairAndOptimization.Biz APIResponseData apiResponseData = new APIResponseData { Code = -1, Message = "没有查询到数据!" }; try { - switch (Models.Config.Configurations.Properties.ConnType?.ToLower()) + switch (DeviceRepair.Utils.Config.Configurations.Properties.ConnType?.ToLower()) { case "api": @@ -70,7 +70,7 @@ namespace DeviceRepairAndOptimization.Biz APIResponseData apiResponseData = new APIResponseData { Code = -1, Message = "查询失败!" }; try { - switch (Models.Config.Configurations.Properties.ConnType?.ToLower()) + switch (DeviceRepair.Utils.Config.Configurations.Properties.ConnType?.ToLower()) { case "api": apiResponseData = ApiHelper.Instance.SendMessage(new HttpItem @@ -104,7 +104,7 @@ namespace DeviceRepairAndOptimization.Biz APIResponseData apiResponseData = new APIResponseData { Code = -1, Message = "查询失败!" }; try { - switch (Models.Config.Configurations.Properties.ConnType?.ToLower()) + switch (DeviceRepair.Utils.Config.Configurations.Properties.ConnType?.ToLower()) { case "api": apiResponseData = ApiHelper.Instance.SendMessage(new HttpItem @@ -138,7 +138,7 @@ namespace DeviceRepairAndOptimization.Biz APIResponseData apiResponseData = new APIResponseData { Code = -1, Message = "查询失败!" }; try { - switch (Models.Config.Configurations.Properties.ConnType?.ToLower()) + switch (DeviceRepair.Utils.Config.Configurations.Properties.ConnType?.ToLower()) { case "api": apiResponseData = ApiHelper.Instance.SendMessage(new HttpItem @@ -173,7 +173,7 @@ namespace DeviceRepairAndOptimization.Biz APIResponseData apiResponseData = new APIResponseData { Code = -1, Message = "查询失败!" }; try { - switch (Models.Config.Configurations.Properties.ConnType?.ToLower()) + switch (DeviceRepair.Utils.Config.Configurations.Properties.ConnType?.ToLower()) { case "api": #region api diff --git a/DeviceRepairAndOptimization/Biz/FieldsManager.cs b/DeviceRepairAndOptimization/Biz/FieldsManager.cs index ddd5424..486f69b 100644 --- a/DeviceRepairAndOptimization/Biz/FieldsManager.cs +++ b/DeviceRepairAndOptimization/Biz/FieldsManager.cs @@ -30,7 +30,7 @@ namespace DeviceRepairAndOptimization.Biz APIResponseData apiResponseData = new APIResponseData { Code = -1, Message = "没有查询到数据!" }; try { - switch (Models.Config.Configurations.Properties.ConnType?.ToLower()) + switch (DeviceRepair.Utils.Config.Configurations.Properties.ConnType?.ToLower()) { case "api": @@ -66,7 +66,7 @@ namespace DeviceRepairAndOptimization.Biz APIResponseData apiResponseData = new APIResponseData { Code = -1, Message = "没有查询到数据!" }; try { - switch (Models.Config.Configurations.Properties.ConnType?.ToLower()) + switch (DeviceRepair.Utils.Config.Configurations.Properties.ConnType?.ToLower()) { case "api": @@ -102,7 +102,7 @@ namespace DeviceRepairAndOptimization.Biz APIResponseData apiResponseData = new APIResponseData { Code = -1, Message = "没有查询到数据!" }; try { - switch (Models.Config.Configurations.Properties.ConnType?.ToLower()) + switch (DeviceRepair.Utils.Config.Configurations.Properties.ConnType?.ToLower()) { case "api": @@ -140,7 +140,7 @@ namespace DeviceRepairAndOptimization.Biz APIResponseData apiResponseData = new APIResponseData { Code = -1, Message = "没有查询到数据!" }; try { - switch (Models.Config.Configurations.Properties.ConnType?.ToLower()) + switch (DeviceRepair.Utils.Config.Configurations.Properties.ConnType?.ToLower()) { case "api": diff --git a/DeviceRepairAndOptimization/Biz/FormManager.cs b/DeviceRepairAndOptimization/Biz/FormManager.cs index 660db0f..f902061 100644 --- a/DeviceRepairAndOptimization/Biz/FormManager.cs +++ b/DeviceRepairAndOptimization/Biz/FormManager.cs @@ -33,7 +33,7 @@ namespace DeviceRepairAndOptimization.Biz APIResponseData apiResponseData = new APIResponseData { Code = -1, Message = "操作失败!" }; try { - switch (Models.Config.Configurations.Properties.ConnType?.ToLower()) + switch (DeviceRepair.Utils.Config.Configurations.Properties.ConnType?.ToLower()) { case "api": @@ -70,7 +70,7 @@ namespace DeviceRepairAndOptimization.Biz APIResponseData apiResponseData = new APIResponseData { Code = -1, Message = "操作失败!" }; try { - switch (Models.Config.Configurations.Properties.ConnType?.ToLower()) + switch (DeviceRepair.Utils.Config.Configurations.Properties.ConnType?.ToLower()) { case "api": @@ -109,7 +109,7 @@ namespace DeviceRepairAndOptimization.Biz string FileExtension = Path.GetExtension(filePath); string newName = $"{Guid.NewGuid()}{FileExtension}"; - switch (Models.Config.Configurations.Properties.ConnType?.ToLower()) + switch (DeviceRepair.Utils.Config.Configurations.Properties.ConnType?.ToLower()) { case "api": using (var fileStream = new FileStream(filePath, FileMode.Open, FileAccess.Read)) @@ -139,7 +139,7 @@ namespace DeviceRepairAndOptimization.Biz APIResponseData apiResponseData = new APIResponseData { Code = -1, Message = "未能获取到数据!" }; try { - switch (Models.Config.Configurations.Properties.ConnType?.ToLower()) + switch (DeviceRepair.Utils.Config.Configurations.Properties.ConnType?.ToLower()) { case "api": @@ -174,7 +174,7 @@ namespace DeviceRepairAndOptimization.Biz APIResponseData apiResponseData = new APIResponseData { Code = -1, Message = "未能获取到数据!" }; try { - switch (Models.Config.Configurations.Properties.ConnType?.ToLower()) + switch (DeviceRepair.Utils.Config.Configurations.Properties.ConnType?.ToLower()) { case "api": @@ -209,7 +209,7 @@ namespace DeviceRepairAndOptimization.Biz APIResponseData apiResponseData = new APIResponseData { Code = -1, Message = "操作失败!" }; try { - switch (Models.Config.Configurations.Properties.ConnType?.ToLower()) + switch (DeviceRepair.Utils.Config.Configurations.Properties.ConnType?.ToLower()) { case "api": apiResponseData = ApiHelper.Instance.SendMessage(new HttpItem @@ -244,7 +244,7 @@ namespace DeviceRepairAndOptimization.Biz APIResponseData apiResponseData = new APIResponseData { Code = -1, Message = "操作失败!" }; try { - switch (Models.Config.Configurations.Properties.ConnType?.ToLower()) + switch (DeviceRepair.Utils.Config.Configurations.Properties.ConnType?.ToLower()) { case "api": apiResponseData = ApiHelper.Instance.SendMessage(new HttpItem @@ -276,7 +276,7 @@ namespace DeviceRepairAndOptimization.Biz APIResponseData apiResponseData = new APIResponseData { Code = -1 }; try { - switch (Models.Config.Configurations.Properties.ConnType?.ToLower()) + switch (DeviceRepair.Utils.Config.Configurations.Properties.ConnType?.ToLower()) { case "api": @@ -316,7 +316,7 @@ namespace DeviceRepairAndOptimization.Biz try { - switch (Models.Config.Configurations.Properties.ConnType?.ToLower()) + switch (DeviceRepair.Utils.Config.Configurations.Properties.ConnType?.ToLower()) { case "api": apiResponseData = ApiHelper.Instance.SendMessage(new HttpItem diff --git a/DeviceRepairAndOptimization/Biz/MaintenanceManager.cs b/DeviceRepairAndOptimization/Biz/MaintenanceManager.cs index ba51ed3..7cc022b 100644 --- a/DeviceRepairAndOptimization/Biz/MaintenanceManager.cs +++ b/DeviceRepairAndOptimization/Biz/MaintenanceManager.cs @@ -33,7 +33,7 @@ namespace DeviceRepairAndOptimization.Biz APIResponseData apiResponseData = new APIResponseData { Code = -1, Message = "未能获取到数据!" }; try { - switch (Models.Config.Configurations.Properties.ConnType?.ToLower()) + switch (DeviceRepair.Utils.Config.Configurations.Properties.ConnType?.ToLower()) { case "api": @@ -72,7 +72,7 @@ namespace DeviceRepairAndOptimization.Biz APIResponseData apiResponseData = new APIResponseData { Code = -1, Message = "操作未能成功!" }; try { - switch (Models.Config.Configurations.Properties.ConnType?.ToLower()) + switch (DeviceRepair.Utils.Config.Configurations.Properties.ConnType?.ToLower()) { case "api": @@ -112,7 +112,7 @@ namespace DeviceRepairAndOptimization.Biz APIResponseData apiResponseData = new APIResponseData { Code = -1, Message = "操作未能成功!" }; try { - switch (Models.Config.Configurations.Properties.ConnType?.ToLower()) + switch (DeviceRepair.Utils.Config.Configurations.Properties.ConnType?.ToLower()) { case "api": @@ -152,7 +152,7 @@ namespace DeviceRepairAndOptimization.Biz APIResponseData apiResponseData = new APIResponseData { Code = -1, Message = "操作未能成功!" }; try { - switch (Models.Config.Configurations.Properties.ConnType?.ToLower()) + switch (DeviceRepair.Utils.Config.Configurations.Properties.ConnType?.ToLower()) { case "api": diff --git a/DeviceRepairAndOptimization/Biz/PlanManager.cs b/DeviceRepairAndOptimization/Biz/PlanManager.cs index 7169d6e..ea484ad 100644 --- a/DeviceRepairAndOptimization/Biz/PlanManager.cs +++ b/DeviceRepairAndOptimization/Biz/PlanManager.cs @@ -35,7 +35,7 @@ namespace DeviceRepairAndOptimization.Biz APIResponseData apiResponseData = new APIResponseData { Code = -1, Message = "操作失败!" }; try { - switch (Models.Config.Configurations.Properties.ConnType?.ToLower()) + switch (DeviceRepair.Utils.Config.Configurations.Properties.ConnType?.ToLower()) { case "api": apiResponseData = ApiHelper.Instance.SendMessage(new HttpItem @@ -69,7 +69,7 @@ namespace DeviceRepairAndOptimization.Biz APIResponseData apiResponseData = new APIResponseData { Code = -1, Message = "未能获取到数据!" }; try { - switch (Models.Config.Configurations.Properties.ConnType?.ToLower()) + switch (DeviceRepair.Utils.Config.Configurations.Properties.ConnType?.ToLower()) { case "api": apiResponseData = ApiHelper.Instance.SendMessage(new HttpItem @@ -105,7 +105,7 @@ namespace DeviceRepairAndOptimization.Biz APIResponseData apiResponseData = new APIResponseData { Code = -1 }; try { - switch (Models.Config.Configurations.Properties.ConnType?.ToLower()) + switch (DeviceRepair.Utils.Config.Configurations.Properties.ConnType?.ToLower()) { case "api": apiResponseData = ApiHelper.Instance.SendMessage(new HttpItem @@ -141,7 +141,7 @@ namespace DeviceRepairAndOptimization.Biz int Count = -1; try { - switch (Models.Config.Configurations.Properties.ConnType?.ToLower()) + switch (DeviceRepair.Utils.Config.Configurations.Properties.ConnType?.ToLower()) { case "api": ApiHelper.Instance.SendMessageAsync(new HttpItem @@ -176,7 +176,7 @@ namespace DeviceRepairAndOptimization.Biz APIResponseData apiResponseData = null; try { - switch (Models.Config.Configurations.Properties.ConnType?.ToLower()) + switch (DeviceRepair.Utils.Config.Configurations.Properties.ConnType?.ToLower()) { case "api": apiResponseData = ApiHelper.Instance.SendMessage(new HttpItem @@ -212,7 +212,7 @@ namespace DeviceRepairAndOptimization.Biz try { - switch (Models.Config.Configurations.Properties.ConnType?.ToLower()) + switch (DeviceRepair.Utils.Config.Configurations.Properties.ConnType?.ToLower()) { case "api": apiResponseData = ApiHelper.Instance.SendMessage(new HttpItem @@ -249,7 +249,7 @@ namespace DeviceRepairAndOptimization.Biz try { - switch (Models.Config.Configurations.Properties.ConnType?.ToLower()) + switch (DeviceRepair.Utils.Config.Configurations.Properties.ConnType?.ToLower()) { case "api": apiResponseData = ApiHelper.Instance.SendMessage(new HttpItem @@ -286,7 +286,7 @@ namespace DeviceRepairAndOptimization.Biz APIResponseData apiResponseData = null; try { - switch (Models.Config.Configurations.Properties.ConnType?.ToLower()) + switch (DeviceRepair.Utils.Config.Configurations.Properties.ConnType?.ToLower()) { case "api": apiResponseData = ApiHelper.Instance.SendMessage( @@ -322,7 +322,7 @@ namespace DeviceRepairAndOptimization.Biz APIResponseData apiResponseData = null; try { - switch (Models.Config.Configurations.Properties.ConnType?.ToLower()) + switch (DeviceRepair.Utils.Config.Configurations.Properties.ConnType?.ToLower()) { case "api": apiResponseData = ApiHelper.Instance.SendMessage( diff --git a/DeviceRepairAndOptimization/Biz/PreserveManager.cs b/DeviceRepairAndOptimization/Biz/PreserveManager.cs index 715a9e4..604a22e 100644 --- a/DeviceRepairAndOptimization/Biz/PreserveManager.cs +++ b/DeviceRepairAndOptimization/Biz/PreserveManager.cs @@ -37,7 +37,7 @@ namespace DeviceRepairAndOptimization.Biz string filePath = string.Empty; try { - switch (Models.Config.Configurations.Properties.ConnType?.ToLower()) + switch (DeviceRepair.Utils.Config.Configurations.Properties.ConnType?.ToLower()) { case "api": filePath = ApiHelper.Instance.DownLoadFile(new HttpItem() @@ -66,7 +66,7 @@ namespace DeviceRepairAndOptimization.Biz string filePath = string.Empty; try { - switch (Models.Config.Configurations.Properties.ConnType?.ToLower()) + switch (DeviceRepair.Utils.Config.Configurations.Properties.ConnType?.ToLower()) { case "api": filePath = ApiHelper.Instance.DownLoadFile(new HttpItem() @@ -98,7 +98,7 @@ namespace DeviceRepairAndOptimization.Biz APIResponseData apiResponseData = new APIResponseData { Code = -1, Message = "获取数据失败!" }; try { - switch (Models.Config.Configurations.Properties.ConnType?.ToLower()) + switch (DeviceRepair.Utils.Config.Configurations.Properties.ConnType?.ToLower()) { case "api": #region api @@ -140,7 +140,7 @@ namespace DeviceRepairAndOptimization.Biz APIResponseData apiResponseData = new APIResponseData { Code = -1, Message = "未能获取到数据!" }; try { - switch (Models.Config.Configurations.Properties.ConnType?.ToLower()) + switch (DeviceRepair.Utils.Config.Configurations.Properties.ConnType?.ToLower()) { case "api": apiResponseData = ApiHelper.Instance.SendMessage(new HttpItem @@ -176,7 +176,7 @@ namespace DeviceRepairAndOptimization.Biz APIResponseData apiResponseData = new APIResponseData { Code = -1, Message = "未能获取到数据!" }; try { - switch (Models.Config.Configurations.Properties.ConnType?.ToLower()) + switch (DeviceRepair.Utils.Config.Configurations.Properties.ConnType?.ToLower()) { case "api": apiResponseData = ApiHelper.Instance.SendMessage(new HttpItem @@ -210,7 +210,7 @@ namespace DeviceRepairAndOptimization.Biz APIResponseData apiResponseData = new APIResponseData { Code = -1, Data = null, Message = "获取数据失败" }; try { - switch (Models.Config.Configurations.Properties.ConnType?.ToLower()) + switch (DeviceRepair.Utils.Config.Configurations.Properties.ConnType?.ToLower()) { case "api": apiResponseData = ApiHelper.Instance.SendMessage(new HttpItem @@ -245,7 +245,7 @@ namespace DeviceRepairAndOptimization.Biz APIResponseData apiResponseData = new APIResponseData { Code = -1, Data = null, Message = "获取数据失败" }; try { - switch (Models.Config.Configurations.Properties.ConnType?.ToLower()) + switch (DeviceRepair.Utils.Config.Configurations.Properties.ConnType?.ToLower()) { case "api": apiResponseData = ApiHelper.Instance.SendMessage(new HttpItem @@ -282,7 +282,7 @@ namespace DeviceRepairAndOptimization.Biz try { - switch (Models.Config.Configurations.Properties.ConnType?.ToLower()) + switch (DeviceRepair.Utils.Config.Configurations.Properties.ConnType?.ToLower()) { case "api": apiResponseData = ApiHelper.Instance.SendMessage(new HttpItem diff --git a/DeviceRepairAndOptimization/Biz/RoleManger.cs b/DeviceRepairAndOptimization/Biz/RoleManger.cs index 9155258..09e2a83 100644 --- a/DeviceRepairAndOptimization/Biz/RoleManger.cs +++ b/DeviceRepairAndOptimization/Biz/RoleManger.cs @@ -32,7 +32,7 @@ namespace DeviceRepairAndOptimization.Biz APIResponseData apiResponseData = new APIResponseData { Code = -1, Message = "没有查询到数据!" }; try { - switch (Models.Config.Configurations.Properties.ConnType?.ToLower()) + switch (DeviceRepair.Utils.Config.Configurations.Properties.ConnType?.ToLower()) { case "api": #region api @@ -74,7 +74,7 @@ namespace DeviceRepairAndOptimization.Biz APIResponseData apiResponseData = new APIResponseData { Code = -1, Message = "没有查询到数据!" }; try { - switch (Models.Config.Configurations.Properties.ConnType?.ToLower()) + switch (DeviceRepair.Utils.Config.Configurations.Properties.ConnType?.ToLower()) { case "api": #region api @@ -116,7 +116,7 @@ namespace DeviceRepairAndOptimization.Biz APIResponseData apiResponseData = new APIResponseData { Code = -1, Message = "没有查询到数据!" }; try { - switch (Models.Config.Configurations.Properties.ConnType?.ToLower()) + switch (DeviceRepair.Utils.Config.Configurations.Properties.ConnType?.ToLower()) { case "api": #region api @@ -159,7 +159,7 @@ namespace DeviceRepairAndOptimization.Biz APIResponseData apiResponseData = new APIResponseData { Code = -1, Message = "操作失败!" }; try { - switch (Models.Config.Configurations.Properties.ConnType?.ToLower()) + switch (DeviceRepair.Utils.Config.Configurations.Properties.ConnType?.ToLower()) { case "api": #region api @@ -196,7 +196,7 @@ namespace DeviceRepairAndOptimization.Biz APIResponseData apiResponseData = new APIResponseData { Code = -1, Message = "操作失败!" }; try { - switch (Models.Config.Configurations.Properties.ConnType?.ToLower()) + switch (DeviceRepair.Utils.Config.Configurations.Properties.ConnType?.ToLower()) { case "api": #region api @@ -233,7 +233,7 @@ namespace DeviceRepairAndOptimization.Biz APIResponseData apiResponseData = new APIResponseData { Code = -1, Message = "没有查询到数据!" }; try { - switch (Models.Config.Configurations.Properties.ConnType?.ToLower()) + switch (DeviceRepair.Utils.Config.Configurations.Properties.ConnType?.ToLower()) { case "api": #region api @@ -269,7 +269,7 @@ namespace DeviceRepairAndOptimization.Biz APIResponseData apiResponseData = new APIResponseData { Code = -1, Message = "没有查询到数据!" }; try { - switch (Models.Config.Configurations.Properties.ConnType?.ToLower()) + switch (DeviceRepair.Utils.Config.Configurations.Properties.ConnType?.ToLower()) { case "api": #region api @@ -314,7 +314,7 @@ namespace DeviceRepairAndOptimization.Biz { Item.ModifyBy = GlobalInfo.CurrentUser.AutoID; - switch (Models.Config.Configurations.Properties.ConnType?.ToLower()) + switch (DeviceRepair.Utils.Config.Configurations.Properties.ConnType?.ToLower()) { case "api": @@ -360,7 +360,7 @@ namespace DeviceRepairAndOptimization.Biz APIResponseData apiResponseData = new APIResponseData { Code = -1, Message = "操作失败!" }; try { - switch (Models.Config.Configurations.Properties.ConnType?.ToLower()) + switch (DeviceRepair.Utils.Config.Configurations.Properties.ConnType?.ToLower()) { case "api": diff --git a/DeviceRepairAndOptimization/Biz/UserManager.cs b/DeviceRepairAndOptimization/Biz/UserManager.cs index 4667fb2..d5a8c73 100644 --- a/DeviceRepairAndOptimization/Biz/UserManager.cs +++ b/DeviceRepairAndOptimization/Biz/UserManager.cs @@ -32,7 +32,7 @@ namespace DeviceRepairAndOptimization.Biz APIResponseData apiResponseData = new APIResponseData { Code = -1, Message = "登录失败!" }; try { - switch (Models.Config.Configurations.Properties.ConnType?.ToLower()) + switch (DeviceRepair.Utils.Config.Configurations.Properties.ConnType?.ToLower()) { case "api": apiResponseData = ApiHelper.Instance.SendMessage(new HttpItem @@ -65,7 +65,7 @@ namespace DeviceRepairAndOptimization.Biz { try { - switch (Models.Config.Configurations.Properties.ConnType?.ToLower()) + switch (DeviceRepair.Utils.Config.Configurations.Properties.ConnType?.ToLower()) { case "api": ApiHelper.Instance.SendMessage(new HttpItem @@ -98,7 +98,7 @@ namespace DeviceRepairAndOptimization.Biz APIResponseData apiResponseData = new APIResponseData { Code = -1, Message = "账户或密码不正确!" }; try { - switch (Models.Config.Configurations.Properties.ConnType?.ToLower()) + switch (DeviceRepair.Utils.Config.Configurations.Properties.ConnType?.ToLower()) { case "api": @@ -144,7 +144,7 @@ namespace DeviceRepairAndOptimization.Biz APIResponseData apiResponseData = new APIResponseData { Code = -1, Message = "账户或密码不正确!" }; try { - switch (Models.Config.Configurations.Properties.ConnType?.ToLower()) + switch (DeviceRepair.Utils.Config.Configurations.Properties.ConnType?.ToLower()) { case "api": @@ -189,7 +189,7 @@ namespace DeviceRepairAndOptimization.Biz APIResponseData apiResponseData = new APIResponseData { Code = -1, Message = "账户或密码不正确!" }; try { - switch (Models.Config.Configurations.Properties.ConnType?.ToLower()) + switch (DeviceRepair.Utils.Config.Configurations.Properties.ConnType?.ToLower()) { case "api": @@ -233,7 +233,7 @@ namespace DeviceRepairAndOptimization.Biz APIResponseData apiResponseData = new APIResponseData { Code = -1, Message = "没有查询到数据!" }; try { - switch (Models.Config.Configurations.Properties.ConnType?.ToLower()) + switch (DeviceRepair.Utils.Config.Configurations.Properties.ConnType?.ToLower()) { case "api": #region api @@ -275,7 +275,7 @@ namespace DeviceRepairAndOptimization.Biz APIResponseData apiResponseData = new APIResponseData { Code = -1, Message = "没有查询到数据!" }; try { - switch (Models.Config.Configurations.Properties.ConnType?.ToLower()) + switch (DeviceRepair.Utils.Config.Configurations.Properties.ConnType?.ToLower()) { case "api": #region api @@ -321,7 +321,7 @@ namespace DeviceRepairAndOptimization.Biz { Item.ModifyBy = GlobalInfo.CurrentUser.AutoID; - switch (Models.Config.Configurations.Properties.ConnType?.ToLower()) + switch (DeviceRepair.Utils.Config.Configurations.Properties.ConnType?.ToLower()) { case "api": @@ -369,7 +369,7 @@ namespace DeviceRepairAndOptimization.Biz { Item.ModifyBy = GlobalInfo.CurrentUser.AutoID; - switch (Models.Config.Configurations.Properties.ConnType?.ToLower()) + switch (DeviceRepair.Utils.Config.Configurations.Properties.ConnType?.ToLower()) { case "api": @@ -415,7 +415,7 @@ namespace DeviceRepairAndOptimization.Biz APIResponseData apiResponseData = new APIResponseData { Code = -1, Message = "账户或密码不正确!" }; try { - switch (Models.Config.Configurations.Properties.ConnType?.ToLower()) + switch (DeviceRepair.Utils.Config.Configurations.Properties.ConnType?.ToLower()) { case "api": diff --git a/DeviceRepairAndOptimization/DLLs/HttpHelper.dll b/DeviceRepairAndOptimization/DLLs/HttpHelper.dll new file mode 100644 index 0000000..f252990 --- /dev/null +++ b/DeviceRepairAndOptimization/DLLs/HttpHelper.dll @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0e9103085295a8c80d171b752170e02d02cacb45ba61bcaf1ee77077ea8c8dcb +size 37888 diff --git a/DeviceRepairAndOptimization/DeviceRepairAndOptimization.csproj b/DeviceRepairAndOptimization/DeviceRepairAndOptimization.csproj index ec0961e..2b7660d 100644 --- a/DeviceRepairAndOptimization/DeviceRepairAndOptimization.csproj +++ b/DeviceRepairAndOptimization/DeviceRepairAndOptimization.csproj @@ -192,7 +192,7 @@ ..\..\TsSFC.App5\DLLs\FastReport.Editor.dll - ..\..\nuget\HttpHelper\HttpHelper.dll + DLLs\HttpHelper.dll False @@ -393,18 +393,6 @@ DialogWindow.cs - - UserControl - - - xuc_BindDrives.cs - - - UserControl - - - xuc_DriveMaintenance.cs - Form @@ -501,12 +489,6 @@ page_PlanEdit.cs - - Form - - - page_RepairRecordEdit.cs - Form @@ -655,12 +637,6 @@ DialogWindow.cs - - xuc_BindDrives.cs - - - xuc_DriveMaintenance.cs - FormBase.cs @@ -712,9 +688,6 @@ page_PlanEdit.cs - - page_RepairRecordEdit.cs - frmPwdModify.cs @@ -805,14 +778,6 @@ {2ae8089a-c70a-47be-921b-de6a502f8d04} DeviceRepair.Utils - - {ae7a64be-4ef9-468e-b0c1-a6720dd08547} - DeviceRepairAndOptimization.Data - - - {99546ae7-e316-4b0b-befa-dbefc3c82677} - DeviceRepairAndOptimization.Models - @@ -876,6 +841,7 @@ + \ No newline at end of file diff --git a/DeviceRepairAndOptimization/GlobalInfo.cs b/DeviceRepairAndOptimization/GlobalInfo.cs index 8b7401b..218d574 100644 --- a/DeviceRepairAndOptimization/GlobalInfo.cs +++ b/DeviceRepairAndOptimization/GlobalInfo.cs @@ -1,4 +1,5 @@ using DeviceRepair.Models; +using DeviceRepair.Utils; using System; using System.Linq; using System.Windows.Forms; diff --git a/DeviceRepairAndOptimization/Models/MaintenanceVer/TemplateIndexV1.cs b/DeviceRepairAndOptimization/Models/MaintenanceVer/TemplateIndexV1.cs index 1f852da..17f5ada 100644 --- a/DeviceRepairAndOptimization/Models/MaintenanceVer/TemplateIndexV1.cs +++ b/DeviceRepairAndOptimization/Models/MaintenanceVer/TemplateIndexV1.cs @@ -1,4 +1,6 @@ using DevExpress.Spreadsheet; +using DeviceRepair.Models; +using DeviceRepair.Utils; using System; using System.Collections.Generic; using System.Linq; diff --git a/DeviceRepairAndOptimization/Program.cs b/DeviceRepairAndOptimization/Program.cs index bbeded4..d937ae2 100644 --- a/DeviceRepairAndOptimization/Program.cs +++ b/DeviceRepairAndOptimization/Program.cs @@ -41,12 +41,12 @@ namespace DeviceRepairAndOptimization AutoUpdater.Synchronous = true; AutoUpdater.ShowSkipButton = false; AutoUpdater.ShowRemindLaterButton = false; - AutoUpdater.Start($"http://{DeviceRepairAndOptimization.Models.Config.Configurations.Properties.ServiceIP}/{DeviceRepairAndOptimization.Models.Config.Configurations.Properties.ServiceName}/Update/DOAutoUpdater.xml"); + AutoUpdater.Start($"http://{DeviceRepair.Utils.Config.Configurations.Properties.ServiceIP}/{DeviceRepair.Utils.Config.Configurations.Properties.ServiceName}/Update/DOAutoUpdater.xml"); try { string argsValue = string.Join("|", args); - string usValue = JWT.JsonWebToken.Decode(argsValue, DeviceRepairAndOptimization.Models.Config.Configurations.Properties.SecureKey, true); + string usValue = JWT.JsonWebToken.Decode(argsValue, DeviceRepair.Utils.Config.Configurations.Properties.SecureKey, true); UserInfoModel us = JsonConvert.DeserializeObject(usValue); diff --git a/Test/Test.csproj b/Test/Test.csproj index 1d58bba..1352ce5 100644 --- a/Test/Test.csproj +++ b/Test/Test.csproj @@ -62,7 +62,7 @@ - ..\..\nuget\HttpHelper\HttpHelper.dll + ..\DeviceRepairAndOptimization\DLLs\HttpHelper.dll ..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll