From 09425abb94ddbc502762491aeee6d081b0fd9246 Mon Sep 17 00:00:00 2001 From: "liulb@mesnac.com" Date: Wed, 6 Mar 2024 22:11:17 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=89=93=E5=8D=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Admin.Core.Api/Admin.Core.Model.xml | 10 ++ .../Admin.Core.Extensions.AssemblyInfo.cs | 2 +- ...n.Core.Extensions.AssemblyInfoInputs.cache | 2 +- .../Admin.Core.IRepository.AssemblyInfo.cs | 2 +- ....Core.IRepository.AssemblyInfoInputs.cache | 2 +- .../Admin.Core.IService.AssemblyInfo.cs | 2 +- ...min.Core.IService.AssemblyInfoInputs.cache | 2 +- .../net6.0/Admin.Core.Model.AssemblyInfo.cs | 2 +- .../Admin.Core.Model.AssemblyInfoInputs.cache | 2 +- Admin.Core.Repository/BASE/BaseRepository.cs | 4 +- .../Admin.Core.Repository.AssemblyInfo.cs | 2 +- ...n.Core.Repository.AssemblyInfoInputs.cache | 2 +- .../net6.0/Admin.Core.Service.AssemblyInfo.cs | 2 +- ...dmin.Core.Service.AssemblyInfoInputs.cache | 2 +- .../net6.0/Admin.Core.Tasks.AssemblyInfo.cs | 2 +- .../Admin.Core.Tasks.AssemblyInfoInputs.cache | 2 +- Aucam.Core.PerfusionService/Startup.cs | 6 +- Aucam.Core.PerfusionService/appsettings.json | 6 +- .../appsettings.json | 2 +- Aucma.Core.DoorFoam/Business/MvCodeHelper.cs | 3 +- .../Business/InstoreBusiness.cs | 106 +++++++++++++----- Aucma.Core.Palletiz/appsettings.json | 12 +- .../ViewModels/IndexPageViewModel.cs | 6 +- .../ViewModels/PrintToDevViewModel.cs | 1 + 24 files changed, 118 insertions(+), 66 deletions(-) diff --git a/Admin.Core.Api/Admin.Core.Model.xml b/Admin.Core.Api/Admin.Core.Model.xml index 60b2ca09..f5e268ca 100644 --- a/Admin.Core.Api/Admin.Core.Model.xml +++ b/Admin.Core.Api/Admin.Core.Model.xml @@ -2481,6 +2481,16 @@ 所属产线 + + + 上传条码系统保存接口返回信息 + + + + + 当前登录班组(一线白班,一线夜班,二线白班,二线夜班) + + 灌注告警 diff --git a/Admin.Core.Extensions/obj/Debug/net6.0/Admin.Core.Extensions.AssemblyInfo.cs b/Admin.Core.Extensions/obj/Debug/net6.0/Admin.Core.Extensions.AssemblyInfo.cs index 80f08c91..ed140ca2 100644 --- a/Admin.Core.Extensions/obj/Debug/net6.0/Admin.Core.Extensions.AssemblyInfo.cs +++ b/Admin.Core.Extensions/obj/Debug/net6.0/Admin.Core.Extensions.AssemblyInfo.cs @@ -14,7 +14,7 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("Admin.Core.Extensions")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+1fc9493a7ff9eb3e5bc2b6109e38a8c263e3b897")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+8538964ef3a1a79e9a9bc655bb6d2f3d8a56c86a")] [assembly: System.Reflection.AssemblyProductAttribute("Admin.Core.Extensions")] [assembly: System.Reflection.AssemblyTitleAttribute("Admin.Core.Extensions")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] diff --git a/Admin.Core.Extensions/obj/Debug/net6.0/Admin.Core.Extensions.AssemblyInfoInputs.cache b/Admin.Core.Extensions/obj/Debug/net6.0/Admin.Core.Extensions.AssemblyInfoInputs.cache index 58ca4cd9..b80e2516 100644 --- a/Admin.Core.Extensions/obj/Debug/net6.0/Admin.Core.Extensions.AssemblyInfoInputs.cache +++ b/Admin.Core.Extensions/obj/Debug/net6.0/Admin.Core.Extensions.AssemblyInfoInputs.cache @@ -1 +1 @@ -d780f4c71d7f81730d6e88e43ff8d26d1f8e15b705f157a4bf086caa5e7da499 +ccbbc17784cbf7858c929b248f106ffa29ff2844237989ec117203b05eeae991 diff --git a/Admin.Core.IRepository/obj/Debug/net6.0/Admin.Core.IRepository.AssemblyInfo.cs b/Admin.Core.IRepository/obj/Debug/net6.0/Admin.Core.IRepository.AssemblyInfo.cs index fc4b8314..44457a4e 100644 --- a/Admin.Core.IRepository/obj/Debug/net6.0/Admin.Core.IRepository.AssemblyInfo.cs +++ b/Admin.Core.IRepository/obj/Debug/net6.0/Admin.Core.IRepository.AssemblyInfo.cs @@ -14,7 +14,7 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("Admin.Core.IRepository")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+1fc9493a7ff9eb3e5bc2b6109e38a8c263e3b897")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+8538964ef3a1a79e9a9bc655bb6d2f3d8a56c86a")] [assembly: System.Reflection.AssemblyProductAttribute("Admin.Core.IRepository")] [assembly: System.Reflection.AssemblyTitleAttribute("Admin.Core.IRepository")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] diff --git a/Admin.Core.IRepository/obj/Debug/net6.0/Admin.Core.IRepository.AssemblyInfoInputs.cache b/Admin.Core.IRepository/obj/Debug/net6.0/Admin.Core.IRepository.AssemblyInfoInputs.cache index cdfea74e..de8c0257 100644 --- a/Admin.Core.IRepository/obj/Debug/net6.0/Admin.Core.IRepository.AssemblyInfoInputs.cache +++ b/Admin.Core.IRepository/obj/Debug/net6.0/Admin.Core.IRepository.AssemblyInfoInputs.cache @@ -1 +1 @@ -72f20f6cf98a472ebf4c20b336a615ec584766bd52e85cd9501f3b4e781988db +301a2f01eba9435b62a6ed87a5d4e047767724541eb68c6eb91a1acdd4792fa5 diff --git a/Admin.Core.IService/obj/Debug/net6.0/Admin.Core.IService.AssemblyInfo.cs b/Admin.Core.IService/obj/Debug/net6.0/Admin.Core.IService.AssemblyInfo.cs index 268689ba..2c59724f 100644 --- a/Admin.Core.IService/obj/Debug/net6.0/Admin.Core.IService.AssemblyInfo.cs +++ b/Admin.Core.IService/obj/Debug/net6.0/Admin.Core.IService.AssemblyInfo.cs @@ -14,7 +14,7 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("Admin.Core.IService")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+1fc9493a7ff9eb3e5bc2b6109e38a8c263e3b897")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+8538964ef3a1a79e9a9bc655bb6d2f3d8a56c86a")] [assembly: System.Reflection.AssemblyProductAttribute("Admin.Core.IService")] [assembly: System.Reflection.AssemblyTitleAttribute("Admin.Core.IService")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] diff --git a/Admin.Core.IService/obj/Debug/net6.0/Admin.Core.IService.AssemblyInfoInputs.cache b/Admin.Core.IService/obj/Debug/net6.0/Admin.Core.IService.AssemblyInfoInputs.cache index 86b58924..d6b785b3 100644 --- a/Admin.Core.IService/obj/Debug/net6.0/Admin.Core.IService.AssemblyInfoInputs.cache +++ b/Admin.Core.IService/obj/Debug/net6.0/Admin.Core.IService.AssemblyInfoInputs.cache @@ -1 +1 @@ -58e5bcaec14d01e659427d2a8c0b1fbc2e0da050bb91443cceff81b9cb2a3e6c +65b4c6f711245279c3727e3a1c075776410fbd5f735a7f0e582ddf21a60e9c4e diff --git a/Admin.Core.Model/obj/Debug/net6.0/Admin.Core.Model.AssemblyInfo.cs b/Admin.Core.Model/obj/Debug/net6.0/Admin.Core.Model.AssemblyInfo.cs index 1ba50fcd..567caf25 100644 --- a/Admin.Core.Model/obj/Debug/net6.0/Admin.Core.Model.AssemblyInfo.cs +++ b/Admin.Core.Model/obj/Debug/net6.0/Admin.Core.Model.AssemblyInfo.cs @@ -14,7 +14,7 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("Admin.Core.Model")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+1fc9493a7ff9eb3e5bc2b6109e38a8c263e3b897")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+8538964ef3a1a79e9a9bc655bb6d2f3d8a56c86a")] [assembly: System.Reflection.AssemblyProductAttribute("Admin.Core.Model")] [assembly: System.Reflection.AssemblyTitleAttribute("Admin.Core.Model")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] diff --git a/Admin.Core.Model/obj/Debug/net6.0/Admin.Core.Model.AssemblyInfoInputs.cache b/Admin.Core.Model/obj/Debug/net6.0/Admin.Core.Model.AssemblyInfoInputs.cache index 005e2754..419049ae 100644 --- a/Admin.Core.Model/obj/Debug/net6.0/Admin.Core.Model.AssemblyInfoInputs.cache +++ b/Admin.Core.Model/obj/Debug/net6.0/Admin.Core.Model.AssemblyInfoInputs.cache @@ -1 +1 @@ -1ec56689cad54c12209e5fbd483faa339ac415e2614a8fd6b45ec357a392a616 +a2595f6072e1077c968fa28c018b419ef63a5870e11dfa76af33a0fcc6553b79 diff --git a/Admin.Core.Repository/BASE/BaseRepository.cs b/Admin.Core.Repository/BASE/BaseRepository.cs index 56917d10..8d937399 100644 --- a/Admin.Core.Repository/BASE/BaseRepository.cs +++ b/Admin.Core.Repository/BASE/BaseRepository.cs @@ -61,6 +61,7 @@ namespace Admin.Core.Repository { try { + var dd = _db.CopyNew().Ado.IsValidConnection(); if (_db.CopyNew().Ado.IsValidConnection()) { @@ -75,7 +76,8 @@ namespace Admin.Core.Repository } catch (Exception ex) { - + var dd = _db.CopyNew().Ado.IsValidConnection(); + var ddd= _db.CopyNew().Ado.IsValidConnectionNoClose(); Console.WriteLine(ex.ToString()); return false; } diff --git a/Admin.Core.Repository/obj/Debug/net6.0/Admin.Core.Repository.AssemblyInfo.cs b/Admin.Core.Repository/obj/Debug/net6.0/Admin.Core.Repository.AssemblyInfo.cs index eb59bd79..ac44e179 100644 --- a/Admin.Core.Repository/obj/Debug/net6.0/Admin.Core.Repository.AssemblyInfo.cs +++ b/Admin.Core.Repository/obj/Debug/net6.0/Admin.Core.Repository.AssemblyInfo.cs @@ -14,7 +14,7 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("Admin.Core.Repository")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+1fc9493a7ff9eb3e5bc2b6109e38a8c263e3b897")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+8538964ef3a1a79e9a9bc655bb6d2f3d8a56c86a")] [assembly: System.Reflection.AssemblyProductAttribute("Admin.Core.Repository")] [assembly: System.Reflection.AssemblyTitleAttribute("Admin.Core.Repository")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] diff --git a/Admin.Core.Repository/obj/Debug/net6.0/Admin.Core.Repository.AssemblyInfoInputs.cache b/Admin.Core.Repository/obj/Debug/net6.0/Admin.Core.Repository.AssemblyInfoInputs.cache index 4f0d0840..5bddbe3c 100644 --- a/Admin.Core.Repository/obj/Debug/net6.0/Admin.Core.Repository.AssemblyInfoInputs.cache +++ b/Admin.Core.Repository/obj/Debug/net6.0/Admin.Core.Repository.AssemblyInfoInputs.cache @@ -1 +1 @@ -4639e0ce1dff133705f35aae6cc343d3a434fc547d556f93e46bcf77a8fe9d80 +f18bd845b76dc9a757f5750b92d530121079126688148320def4fbb662ad68d1 diff --git a/Admin.Core.Service/obj/Debug/net6.0/Admin.Core.Service.AssemblyInfo.cs b/Admin.Core.Service/obj/Debug/net6.0/Admin.Core.Service.AssemblyInfo.cs index 8f9ec7e2..1cb0d113 100644 --- a/Admin.Core.Service/obj/Debug/net6.0/Admin.Core.Service.AssemblyInfo.cs +++ b/Admin.Core.Service/obj/Debug/net6.0/Admin.Core.Service.AssemblyInfo.cs @@ -14,7 +14,7 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("Admin.Core.Service")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+1fc9493a7ff9eb3e5bc2b6109e38a8c263e3b897")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+8538964ef3a1a79e9a9bc655bb6d2f3d8a56c86a")] [assembly: System.Reflection.AssemblyProductAttribute("Admin.Core.Service")] [assembly: System.Reflection.AssemblyTitleAttribute("Admin.Core.Service")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] diff --git a/Admin.Core.Service/obj/Debug/net6.0/Admin.Core.Service.AssemblyInfoInputs.cache b/Admin.Core.Service/obj/Debug/net6.0/Admin.Core.Service.AssemblyInfoInputs.cache index 9a2fb840..fb0ddf03 100644 --- a/Admin.Core.Service/obj/Debug/net6.0/Admin.Core.Service.AssemblyInfoInputs.cache +++ b/Admin.Core.Service/obj/Debug/net6.0/Admin.Core.Service.AssemblyInfoInputs.cache @@ -1 +1 @@ -f7af35947834bb2b8700b1aa87f9fe428cf89bd259aefe95cb2c632699945ffb +f7901cea78b4fbd0cdbeedc32dc88893aba7e0db582da2fd10c194604f8fe159 diff --git a/Admin.Core.Tasks/obj/Debug/net6.0/Admin.Core.Tasks.AssemblyInfo.cs b/Admin.Core.Tasks/obj/Debug/net6.0/Admin.Core.Tasks.AssemblyInfo.cs index 0ad8feb9..86867abb 100644 --- a/Admin.Core.Tasks/obj/Debug/net6.0/Admin.Core.Tasks.AssemblyInfo.cs +++ b/Admin.Core.Tasks/obj/Debug/net6.0/Admin.Core.Tasks.AssemblyInfo.cs @@ -14,7 +14,7 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("Admin.Core.Tasks")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+1fc9493a7ff9eb3e5bc2b6109e38a8c263e3b897")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+8538964ef3a1a79e9a9bc655bb6d2f3d8a56c86a")] [assembly: System.Reflection.AssemblyProductAttribute("Admin.Core.Tasks")] [assembly: System.Reflection.AssemblyTitleAttribute("Admin.Core.Tasks")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] diff --git a/Admin.Core.Tasks/obj/Debug/net6.0/Admin.Core.Tasks.AssemblyInfoInputs.cache b/Admin.Core.Tasks/obj/Debug/net6.0/Admin.Core.Tasks.AssemblyInfoInputs.cache index 679f537b..47fb452b 100644 --- a/Admin.Core.Tasks/obj/Debug/net6.0/Admin.Core.Tasks.AssemblyInfoInputs.cache +++ b/Admin.Core.Tasks/obj/Debug/net6.0/Admin.Core.Tasks.AssemblyInfoInputs.cache @@ -1 +1 @@ -357d4cf1da9d0baaf00ea24891148cc7f0ef3028d39279eea9f552730b5fa818 +ccee45fea5738afedac594e057e6913d00207ed71ccfc8815ac25e5f1785be4d diff --git a/Aucam.Core.PerfusionService/Startup.cs b/Aucam.Core.PerfusionService/Startup.cs index 764e5744..e1427155 100644 --- a/Aucam.Core.PerfusionService/Startup.cs +++ b/Aucam.Core.PerfusionService/Startup.cs @@ -62,7 +62,6 @@ namespace Aucam.Core.PerfusionService //PLC services.AddPlcSetup(); - services.AddAucmaTaskSetup(); //ֱ֧ȫ :֧ System.Text.Encoding.GetEncoding("GB2312") System.Text.Encoding.GetEncoding("GB18030") Encoding.RegisterProvider(CodePagesEncodingProvider.Instance); } @@ -84,8 +83,7 @@ namespace Aucam.Core.PerfusionService /// /// public void Configure(IApplicationBuilder app, ISysTasksQzService tasksQzService, - ISchedulerCenter schedulerCenter, IRunPlcService runPlcService, - IAucamTaskService aucamTaskService) + ISchedulerCenter schedulerCenter, IRunPlcService runPlcService) { // ʹþ̬ļ app.UseStaticFiles(); @@ -95,8 +93,6 @@ namespace Aucam.Core.PerfusionService app.UseQuartzJobMildd(tasksQzService, schedulerCenter); //PLC app.UsePlcMildd(runPlcService); - - app.AucmaTaskMildds(aucamTaskService); } #region ע diff --git a/Aucam.Core.PerfusionService/appsettings.json b/Aucam.Core.PerfusionService/appsettings.json index 6ac3b8b7..8faeb4d6 100644 --- a/Aucam.Core.PerfusionService/appsettings.json +++ b/Aucam.Core.PerfusionService/appsettings.json @@ -109,7 +109,7 @@ "TriggerType": 1, "IntervalSecond": 1, "CycleRunTimes": 1, - "IsStart": false, + "IsStart": true, "JobParams": null, "DelFlag": false, "CreateBy": "admin", @@ -165,11 +165,11 @@ "Enabled": true }, "QuartzNetJob": { - "Enabled": false + "Enabled": true }, "AucamTask": { - "Enabled": true + "Enabled": false } }, "PLCServer": [ diff --git a/Aucam.Core.TemperatureService/appsettings.json b/Aucam.Core.TemperatureService/appsettings.json index a52d1a73..308a51bc 100644 --- a/Aucam.Core.TemperatureService/appsettings.json +++ b/Aucam.Core.TemperatureService/appsettings.json @@ -89,7 +89,7 @@ "DBType": 1, "Enabled": true, "HitRate": 40, - "Connection": "Data Source=localhost;Initial Catalog=Hsdb;User ID=sa;Password=sa;", + "Connection": "Data Source=10.10.92.147;Initial Catalog=TOPLINE_T10_E_P2_32_AUCMA;User ID=mes;Password=mes;", "ProviderName": "System.Data.SqlClient" } ], diff --git a/Aucma.Core.DoorFoam/Business/MvCodeHelper.cs b/Aucma.Core.DoorFoam/Business/MvCodeHelper.cs index a45c91d6..301da472 100644 --- a/Aucma.Core.DoorFoam/Business/MvCodeHelper.cs +++ b/Aucma.Core.DoorFoam/Business/MvCodeHelper.cs @@ -110,6 +110,7 @@ namespace Aucma.Core.DoorFoam.Business // ch:打印设备信息 | en:Print device info for (Int32 i = 0; i < stDevList.nDeviceNum; i++) { + stDevInfo = (MvCodeReader.MV_CODEREADER_DEVICE_INFO)Marshal.PtrToStructure(stDevList.pDeviceInfo[i], typeof(MvCodeReader.MV_CODEREADER_DEVICE_INFO)); if (MvCodeReader.MV_CODEREADER_GIGE_DEVICE == stDevInfo.nTLayerType) @@ -141,7 +142,7 @@ namespace Aucma.Core.DoorFoam.Business } // ch:打开设备 | en:Open device - nRet = device.MV_CODEREADER_OpenDevice_NET(); + nRet = device.MV_CODEREADER_OpenDevice_NET(); if (MvCodeReader.MV_CODEREADER_OK != nRet) { Console.WriteLine("Open device failed:{0:x8}", nRet); diff --git a/Aucma.Core.Palletiz/Business/InstoreBusiness.cs b/Aucma.Core.Palletiz/Business/InstoreBusiness.cs index 67f77afe..d2ad66e0 100644 --- a/Aucma.Core.Palletiz/Business/InstoreBusiness.cs +++ b/Aucma.Core.Palletiz/Business/InstoreBusiness.cs @@ -32,9 +32,9 @@ namespace Aucma.Core.Palletiz.Business #region 初始化对象 private static readonly log4net.ILog logHelper = LogManager.GetLogger(typeof(InstoreBusiness)); - private readonly IBaseSpaceInfoServices? _baseSpaceInfoServices; - private readonly ICodeBindingRecordServices? _codeBindingServices; - private readonly IRecordInStoreServices? _recordInstoreServices; + private readonly IBaseSpaceInfoServices _baseSpaceInfoServices; + private readonly ICodeBindingRecordServices _codeBindingServices; + private readonly IRecordInStoreServices _recordInstoreServices; #endregion #region 构造函数 @@ -130,7 +130,7 @@ namespace Aucma.Core.Palletiz.Business Console.WriteLine($"上位机获取配置的扫码器【IP:{model.ToJson()}》名称:{model.Name}】"); LogInStoreInfoDelegateEvent?.Invoke($"上位机获取配置的扫码器【IP:{model.ToJson()}》名称:{model.Name}】","White"); //1.根据成品码找货道 - List? spaceList = GetSpaceBySNCode(SNCode, recordInstore); + List spaceList = GetSpaceBySNCode(SNCode, recordInstore); Console.WriteLine($"上位机获取配置的货道数量【{spaceList.Count}】"); // 根据货道信息判断下发plc信号 @@ -153,7 +153,7 @@ namespace Aucma.Core.Palletiz.Business { spaceNumList.Add(int.Parse(finalSpace.SpaceCode.Substring(5, 3))); spaceNumList.Add(int.Parse(GetOtherSpace(finalSpace, spaceList).SpaceCode.Substring(5, 3))); - plcResult = SendAndAnswerPlc(scannerIp, spaceList[0].RotationRange, spaceNumList); + plcResult = SendAndAnswerPlc(scannerIp, spaceList[0].RotationRange, 1); recordInstore.SpaceCode = finalSpace.SpaceCode; recordInstore.StoreCode = finalSpace.StoreCode; // 更新货道信息,大产品last存objId大的,储存上一个货道的主键 如货道7,8存8 @@ -173,7 +173,7 @@ namespace Aucma.Core.Palletiz.Business { spaceNumList.Add(int.Parse(finalSpace.SpaceCode.Substring(5, 3))); spaceNumList.Add(0); - plcResult = SendAndAnswerPlc(scannerIp, finalSpace.RotationRange, spaceNumList); + plcResult = SendAndAnswerPlc(scannerIp, finalSpace.RotationRange, 1); UpdateSapceList(finalSpace.ObjId, spaceList); Console.WriteLine("更新货道信息成功!"); LogInStoreInfoDelegateEvent?.Invoke("更新货道信息成功!", "White"); @@ -182,7 +182,7 @@ namespace Aucma.Core.Palletiz.Business { spaceNumList.Add(0); spaceNumList.Add(int.Parse(finalSpace.SpaceCode.Substring(5, 3))); - plcResult = SendAndAnswerPlc(scannerIp, finalSpace.RotationRange, spaceNumList);//给PLC下传入库信号 + plcResult = SendAndAnswerPlc(scannerIp, finalSpace.RotationRange, 1);//给PLC下传入库信号 UpdateSapceList(finalSpace.ObjId, spaceList); Console.WriteLine("更新货道信息成功!"); LogInStoreInfoDelegateEvent?.Invoke("更新货道信息成功!", "White"); @@ -224,7 +224,7 @@ namespace Aucma.Core.Palletiz.Business /// /// /// - private List? GetSpaceBySNCode(string SNCode, RecordInStore recordInstore) + private List GetSpaceBySNCode(string SNCode, RecordInStore recordInstore) { try { @@ -356,7 +356,7 @@ namespace Aucma.Core.Palletiz.Business /// 转向角度 /// 货道号int集合 /// - private bool SendAndAnswerPlc(string scannerIp, int range, List spaceNum) + private bool SendAndAnswerPlc(string scannerIp, int range,int spaceNum) { bool result = false; try @@ -391,10 +391,10 @@ namespace Aucma.Core.Palletiz.Business /// 下发plc信号 /// /// - /// - /// + /// 转向 + /// 库数量 /// - private bool SendPlc(PlcModel obj, int range, List spaceNum) + private bool SendPlc(PlcModel obj, int range,int spaceNum) { try { @@ -403,24 +403,22 @@ namespace Aucma.Core.Palletiz.Business DateTime targetTime = DateTime.Now.AddSeconds(8); while (true) { - if (DateTime.Now > targetTime) // plc超最大时限无反馈 + Console.WriteLine($"是否可以下发:【{obj.plc.ReadBool("D1000")}】"); + if (obj.plc.ReadBool("D1000"))//如果为true 则可以下发 任务 { - logHelper.Error("等待plc放行反馈信号超时"); - Console.WriteLine("等待plc放行反馈信号超时"); - return false; - } - // 应答字允许下发 - Console.WriteLine($"读取应答字是否下传成功!【{obj.plc.ReadInt32("D102")}】"); - if (obj.plc.ReadInt32("D102") == 1) - { - //obj.plc.WriteInt32("D110", range);//旋转角度暂时不赋值由PLC转向 - - obj.plc.WriteInt32("D112", spaceNum[0]); //货道号 - obj.plc.WriteInt32("D114", spaceNum[1]); //货道号 - Console.WriteLine($"plc信号货道信号下发成功!【D112:{spaceNum[0]}】D114:{spaceNum[1]}"); - result = true; - break; + // 应答字允许下发 + int storeNum = GetStoreNum(obj, spaceNum); + Console.WriteLine($"读取当前货道数量:【{storeNum}】"); + if (storeNum == 1) + { + obj.plc.WriteInt32("D7010", range);//旋转角度1=》90 2=>反转90 D2 1正转 2反转 + obj.plc.WriteInt32("D29", spaceNum); //货道号 + Console.WriteLine($"plc信号货道信号下发成功!【货道号:{spaceNum}"); + result = true; + break; + } } + Thread.Sleep(500); } return result; @@ -432,6 +430,58 @@ namespace Aucma.Core.Palletiz.Business } } + public int GetStoreNum(PlcModel obj, int spaceNum) + { + int storeNum = 0; + switch (spaceNum) + { + case 1: + storeNum = obj.plc.ReadInt16("D1001"); + break; + case 2: + storeNum = obj.plc.ReadInt16("D1002"); + break; + case 3: + storeNum = obj.plc.ReadInt16("D1003"); + break; + case 4: + storeNum = obj.plc.ReadInt16("D1004"); + break; + case 5: + storeNum = obj.plc.ReadInt16("D1005"); + break; + case 6: + storeNum = obj.plc.ReadInt16("D1006"); + break; + case 7: + storeNum = obj.plc.ReadInt16("D1007"); + break; + case 8: + storeNum = obj.plc.ReadInt16("D1008"); + break; + case 9: + storeNum = obj.plc.ReadInt16("D1009"); + break; + case 10: + storeNum = obj.plc.ReadInt16("D1010"); + break; + case 11: + storeNum = obj.plc.ReadInt16("D1011"); + break; + case 12: + storeNum = obj.plc.ReadInt16("D1012"); + break; + case 13: + storeNum = obj.plc.ReadInt16("D1013"); + break; + case 14: + storeNum = obj.plc.ReadInt16("D1014"); + break; + default: + break; + } + return storeNum; + } #endregion #region 等待plc信号反馈 diff --git a/Aucma.Core.Palletiz/appsettings.json b/Aucma.Core.Palletiz/appsettings.json index 2fb9b9ce..bd4929ed 100644 --- a/Aucma.Core.Palletiz/appsettings.json +++ b/Aucma.Core.Palletiz/appsettings.json @@ -207,16 +207,8 @@ "EquipName": "InStoreAPlc", "PlcType": "Melsec", "Enabled": true, - "IP": "127.0.0.1", - "Port": 6000 - }, - { - "Id": 2, - "EquipName": "InStoreBPlc", - "PlcType": "Melsec", - "Enabled": true, - "IP": "127.0.0.1", - "Port": 6001 + "IP": "127.0.0.1", //10.10.92.80 + "Port": 2015 } ], "StoreInfo": { diff --git a/Aucma.Core.PrintTo/ViewModels/IndexPageViewModel.cs b/Aucma.Core.PrintTo/ViewModels/IndexPageViewModel.cs index 759aea7d..07c10e97 100644 --- a/Aucma.Core.PrintTo/ViewModels/IndexPageViewModel.cs +++ b/Aucma.Core.PrintTo/ViewModels/IndexPageViewModel.cs @@ -163,7 +163,7 @@ namespace Aucma.Core.PrintTo.ViewModels /// 打印 /// [RelayCommand] - private async void Print(string obj) + private void Print(string obj) { if (string.IsNullOrEmpty(obj)) { @@ -205,8 +205,8 @@ namespace Aucma.Core.PrintTo.ViewModels PrintIsEnabled = "False"; //更新打印名称 - var baseOrder=await _baseOrderInfoServices.FirstAsync(d=>d.OrderCode== order_code); - await _baseOrderInfoServices.UpdatePrintName(baseOrder); + var baseOrder= _baseOrderInfoServices.FirstAsync(d=>d.OrderCode== order_code).Result; + _ = _baseOrderInfoServices.UpdatePrintName(baseOrder).Result; PrintToDevView printToDev = new PrintToDevView(order_code,product_code, product_name, standard_amount, printName,printType); printToDev.ShowDialog(); } diff --git a/Aucma.Core.PrintTo/ViewModels/PrintToDevViewModel.cs b/Aucma.Core.PrintTo/ViewModels/PrintToDevViewModel.cs index fc798eb9..b21e20ee 100644 --- a/Aucma.Core.PrintTo/ViewModels/PrintToDevViewModel.cs +++ b/Aucma.Core.PrintTo/ViewModels/PrintToDevViewModel.cs @@ -368,6 +368,7 @@ namespace Aucma.Core.PrintTo.ViewModels var num= _printBarCodeServices.AddAsync(printBarCode).Result; if (num<=0) { + Console.WriteLine($"数据已保存【订单:{printBarCode.OrderCode}》条码:{printBarCode.MaterialBarcode}】"); BarcodesPrinted.Enqueue(BarcodesUnprinted.Dequeue()); Thread.Sleep(1000); } From a01142ecc97f9abd56962dba16de0353ee3ebccd Mon Sep 17 00:00:00 2001 From: "liulb@mesnac.com" Date: Sun, 10 Mar 2024 23:55:50 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E5=88=86=E5=9E=9B=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=89=8B=E5=8A=A8=E5=85=A5=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Admin.Core.Api/Admin.Core.Model.xml | 341 ++++++++- .../net6.0/Admin.Core.Api.AssemblyInfo.cs | 2 +- .../Admin.Core.Api.AssemblyInfoInputs.cache | 2 +- .../Admin.Core.EventBus.AssemblyInfo.cs | 2 +- ...min.Core.EventBus.AssemblyInfoInputs.cache | 2 +- .../AutoMapper/AutoMapperConfig.cs | 71 +- .../Admin.Core.Extensions.AssemblyInfo.cs | 2 +- ...n.Core.Extensions.AssemblyInfoInputs.cache | 2 +- .../Admin.Core.FrameWork.AssemblyInfo.cs | 2 +- ...in.Core.FrameWork.AssemblyInfoInputs.cache | 2 +- .../ITemperatureHistoryRepository.cs | 14 +- .../ITestedCodeMESRepository.cs | 21 + .../Admin.Core.IRepository.AssemblyInfo.cs | 2 +- ....Core.IRepository.AssemblyInfoInputs.cache | 2 +- .../ITemperatureHistoryServices.cs | 12 - .../IService_New/ITestedCodeMESServices.cs | 19 + .../Admin.Core.IService.AssemblyInfo.cs | 2 +- ...min.Core.IService.AssemblyInfoInputs.cache | 2 +- .../BoxTemperatureMeasurementHistory.cs | 4 +- .../Model_New/TemperatureHistory.cs | 58 +- Admin.Core.Model/Model_New/TestedCode_MES.cs | 183 +++++ Admin.Core.Model/ViewModels/Data_ForMES.cs | 174 +++++ .../net6.0/Admin.Core.Model.AssemblyInfo.cs | 2 +- .../Admin.Core.Model.AssemblyInfoInputs.cache | 2 +- ...Admin.Core.RealTimeService.AssemblyInfo.cs | 2 +- ...e.RealTimeService.AssemblyInfoInputs.cache | 2 +- Admin.Core.Repository/BASE/BaseRepository.cs | 1 - .../TemperatureHistoryRepository.cs | 29 +- .../Repository_New/TestedCodeMESRepository.cs | 34 + .../Admin.Core.Repository.AssemblyInfo.cs | 2 +- ...n.Core.Repository.AssemblyInfoInputs.cache | 2 +- .../Service_New/TemperatureHistoryServices.cs | 19 +- .../Service_New/TestedCodeMESServices.cs | 33 + .../net6.0/Admin.Core.Service.AssemblyInfo.cs | 2 +- ...dmin.Core.Service.AssemblyInfoInputs.cache | 2 +- .../Jobs/Job_TemperatureMeasurement_Quartz.cs | 140 ---- .../net6.0/Admin.Core.Tasks.AssemblyInfo.cs | 2 +- .../Admin.Core.Tasks.AssemblyInfoInputs.cache | 2 +- .../appsettings.json | 117 +-- .../Aucma.Core.Palletiz.csproj | 6 + .../Business/InstoreBusiness.cs | 154 +++- Aucma.Core.Palletiz/Business/MvCodeHelper.cs | 704 ++++++++++++++++++ Aucma.Core.Palletiz/Startup.cs | 11 +- .../ViewModels/HandPalletizViewModel.cs | 55 +- .../ViewModels/MainWindowViewModel.cs | 8 +- .../Views/HandPalletizView.xaml | 76 +- .../Views/HandPalletizView.xaml.cs | 321 +++++++- Aucma.Core.Palletiz/appsettings.json | 21 +- .../ViewModels/PrintToDevViewModel.cs | 5 +- Aucma.Core.Scanner/Helper/MvCodeHelper.cs | 4 +- .../AucamTemperatureMeasurementService.cs | 152 ++-- .../HwControlLib.AssemblyInfo.cs | 2 +- .../HwControlLib.AssemblyInfoInputs.cache | 2 +- 53 files changed, 2239 insertions(+), 596 deletions(-) create mode 100644 Admin.Core.IRepository/IRepository_New/ITestedCodeMESRepository.cs create mode 100644 Admin.Core.IService/IService_New/ITestedCodeMESServices.cs create mode 100644 Admin.Core.Model/Model_New/TestedCode_MES.cs create mode 100644 Admin.Core.Model/ViewModels/Data_ForMES.cs create mode 100644 Admin.Core.Repository/Repository_New/TestedCodeMESRepository.cs create mode 100644 Admin.Core.Service/Service_New/TestedCodeMESServices.cs delete mode 100644 Admin.Core.Tasks/QuartzNet/Jobs/Job_TemperatureMeasurement_Quartz.cs create mode 100644 Aucma.Core.Palletiz/Business/MvCodeHelper.cs diff --git a/Admin.Core.Api/Admin.Core.Model.xml b/Admin.Core.Api/Admin.Core.Model.xml index f5e268ca..54da5266 100644 --- a/Admin.Core.Api/Admin.Core.Model.xml +++ b/Admin.Core.Api/Admin.Core.Model.xml @@ -3531,7 +3531,7 @@ 工位号 - + 产品条码 @@ -3681,9 +3681,179 @@ 低压启动测试电压 - + - 同步标识 + 同步时间 + + + + + 测温历史记录 + + + + + 主键 + + + + + 线号 + + + + + 工位号 + + + + + 产品条码 + + + + + 产品型号 + + + + + 基准型号 + + + + + 工作电压 + + + + + 测试通道 + + + + + 计划测试时间 + + + + + 实际测试时间 + + + + + 环温 + + + + + 开始测试时间 + + + + + 测试结果 + + + + + 测试结束时间 + + + + + 系统用户 + + + + + 备注 + + + + + 第几次测试 + + + + + 温度数据 + + + + + 功率数据 + + + + + 部件测试数据 + + + + + 故障代码 + + + + + 内部传感器 1 名称 + + + + + 内部传感器 2 名称 + + + + + 内部传感器 3 名称 + + + + + 内部传感器 4 名称 + + + + + 内部传感器 5 名称 + + + + + 内部传感器 6 名称 + + + + + 是否测试部件(”Y”测试) + + + + + 低压启动测试时间 + + + + + 低压启动标准下限 + + + + + 低压启动标准上限 + + + + + 低压启动实际采集值 + + + + + 低压启动测试电压 @@ -5186,6 +5356,171 @@ 班组 + + + 测温信息 + + + + + 线号 + + + + + 工位号 + + + + + 产品条码 + + + + + 产品型号 + + + + + 基准型号 + + + + + 工作电压 + + + + + 测试通道 + + + + + 计划测试时间 + + + + + 实际测试时间 + + + + + 环温 + + + + + 开始测试时间 + + + + + 测试结果 + + + + + 测试结束时间 + + + + + 系统用户 + + + + + 备注 + + + + + 第几次测试 + + + + + 温度数据 + + + + + 功率数据 + + + + + 部件测试数据 + + + + + 故障代码 + + + + + 内部传感器 1 名称 + + + + + 内部传感器 2 名称 + + + + + 内部传感器 3 名称 + + + + + 内部传感器 4 名称 + + + + + 内部传感器 5 名称 + + + + + 内部传感器 6 名称 + + + + + 是否测试部件(”Y”测试) + + + + + 低压启动测试时间 + + + + + 低压启动标准下限 + + + + + 低压启动标准上限 + + + + + 低压启动实际采集值 + + + + + 低压启动测试电压 + + 泡前库入库相信展示 diff --git a/Admin.Core.Api/obj/Debug/net6.0/Admin.Core.Api.AssemblyInfo.cs b/Admin.Core.Api/obj/Debug/net6.0/Admin.Core.Api.AssemblyInfo.cs index 416113a3..630df4c1 100644 --- a/Admin.Core.Api/obj/Debug/net6.0/Admin.Core.Api.AssemblyInfo.cs +++ b/Admin.Core.Api/obj/Debug/net6.0/Admin.Core.Api.AssemblyInfo.cs @@ -15,7 +15,7 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("Admin.Core.Api")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+60c5f54c3d8d93d68f008d6dfcabe9fc57d1a982")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+09425abb94ddbc502762491aeee6d081b0fd9246")] [assembly: System.Reflection.AssemblyProductAttribute("Admin.Core.Api")] [assembly: System.Reflection.AssemblyTitleAttribute("Admin.Core.Api")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] diff --git a/Admin.Core.Api/obj/Debug/net6.0/Admin.Core.Api.AssemblyInfoInputs.cache b/Admin.Core.Api/obj/Debug/net6.0/Admin.Core.Api.AssemblyInfoInputs.cache index ffa83db7..c257996e 100644 --- a/Admin.Core.Api/obj/Debug/net6.0/Admin.Core.Api.AssemblyInfoInputs.cache +++ b/Admin.Core.Api/obj/Debug/net6.0/Admin.Core.Api.AssemblyInfoInputs.cache @@ -1 +1 @@ -a93bec2e5ffdf4970a870b00ef63076582f8814a81b11aac5793b179560f6a09 +e1f876a649ccda7d1785e30c430634bea009c84082f9a5ab99ebbee5f0735adc diff --git a/Admin.Core.EventBus/obj/Debug/net6.0/Admin.Core.EventBus.AssemblyInfo.cs b/Admin.Core.EventBus/obj/Debug/net6.0/Admin.Core.EventBus.AssemblyInfo.cs index e235b754..59493985 100644 --- a/Admin.Core.EventBus/obj/Debug/net6.0/Admin.Core.EventBus.AssemblyInfo.cs +++ b/Admin.Core.EventBus/obj/Debug/net6.0/Admin.Core.EventBus.AssemblyInfo.cs @@ -14,7 +14,7 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("Admin.Core.EventBus")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+60c5f54c3d8d93d68f008d6dfcabe9fc57d1a982")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+09425abb94ddbc502762491aeee6d081b0fd9246")] [assembly: System.Reflection.AssemblyProductAttribute("Admin.Core.EventBus")] [assembly: System.Reflection.AssemblyTitleAttribute("Admin.Core.EventBus")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] diff --git a/Admin.Core.EventBus/obj/Debug/net6.0/Admin.Core.EventBus.AssemblyInfoInputs.cache b/Admin.Core.EventBus/obj/Debug/net6.0/Admin.Core.EventBus.AssemblyInfoInputs.cache index 42d93272..14217bcd 100644 --- a/Admin.Core.EventBus/obj/Debug/net6.0/Admin.Core.EventBus.AssemblyInfoInputs.cache +++ b/Admin.Core.EventBus/obj/Debug/net6.0/Admin.Core.EventBus.AssemblyInfoInputs.cache @@ -1 +1 @@ -2fc7d476902952a95d287f6f5b416b2d2e0c4d9b481a5e49690d0af6f465138c +e6bd5ef41d750a1b458d923485c88094a2e705071d9ff39da15e6841bef1e4c4 diff --git a/Admin.Core.Extensions/AutoMapper/AutoMapperConfig.cs b/Admin.Core.Extensions/AutoMapper/AutoMapperConfig.cs index b9d06010..ab14351c 100644 --- a/Admin.Core.Extensions/AutoMapper/AutoMapperConfig.cs +++ b/Admin.Core.Extensions/AutoMapper/AutoMapperConfig.cs @@ -18,42 +18,43 @@ namespace Admin.Core.Extensions cfg.AddProfile(new CustomProfile()); - cfg.CreateMap() - .ForMember(dest => dest.LineNo, src => src.MapFrom(d => d.Line_No)). - ForMember(dest => dest.Gongwno, src => src.MapFrom(d => d.Gongwno)). - ForMember(dest => dest.Cpno, src => src.MapFrom(d => d.Cpno)). - ForMember(dest => dest.Cpmodel, src => src.MapFrom(d => d.CpModel)). - ForMember(dest => dest.Factorymodel, src => src.MapFrom(d => d.FactoryModel)). - ForMember(dest => dest.Voltage, src => src.MapFrom(d => d.Voltage)). - ForMember(dest => dest.Point2, src => src.MapFrom(d => d.Point2)). - ForMember(dest => dest.TestTime, src => src.MapFrom(d => d.TestTime)). - ForMember(dest => dest.TestedTime, src => src.MapFrom(d => d.TestedTime)). - ForMember(dest => dest.Etemp, src => src.MapFrom(d => d.Etemp)). - ForMember(dest => dest.BeginDatetime, src => src.MapFrom(d => d.BeginDateTime)). - ForMember(dest => dest.CpResult, src => src.MapFrom(d => d.CpResult)). - ForMember(dest => dest.EndDateTime, src => src.MapFrom(d => d.EndDateTime)). - ForMember(dest => dest.UserName, src => src.MapFrom(d => d.UserName)). - ForMember(dest => dest.Remark, src => src.MapFrom(d => d.Remark)). - ForMember(dest => dest.TestNo, src => src.MapFrom(d => d.TestNo)). - ForMember(dest => dest.Temp_Mes, src => src.MapFrom(d => d.Temp_Mes)). - ForMember(dest => dest.Power_Mes, src => src.MapFrom(d => d.Power_Mes)). - ForMember(dest => dest.Part_Mes, src => src.MapFrom(d => d.Part_Mes)). - ForMember(dest => dest.ErrorCode_Mes, src => src.MapFrom(d => d.ErrorCode_Mes)). - ForMember(dest => dest.T1Name, src => src.MapFrom(d => d.T1Name)). - ForMember(dest => dest.T2Name, src => src.MapFrom(d => d.T2Name)). - ForMember(dest => dest.T3Name, src => src.MapFrom(d => d.T3Name)). - ForMember(dest => dest.T4Name, src => src.MapFrom(d => d.T4Name)). - ForMember(dest => dest.T5Name, src => src.MapFrom(d => d.T5Name)). - ForMember(dest => dest.T6Name, src => src.MapFrom(d => d.T6Name)). - ForMember(dest => dest.IsOrder, src => src.MapFrom(d => d.IsOrder)). - ForMember(dest => dest.LowV_Time, src => src.MapFrom(d => d.LowV_Time)). - ForMember(dest => dest.LowV_PowerMin, src => src.MapFrom(d => d.LowV_PowerMin)). - ForMember(dest => dest.LowV_PowerMax, src => src.MapFrom(d => d.LowV_PowerMax)). - ForMember(dest => dest.LowV_PowerFact, src => src.MapFrom(d => d.LowV_PowerFact)). - ForMember(dest => dest.LowVoltage, src => src.MapFrom(d => d.LowVoltage)); - //ForMember(dest => dest.CreateTime, src => src.MapFrom(d => d.Create_Time)). + // cfg.CreateMap() + // .ForMember(dest => dest.LineNo, src => src.MapFrom(d => d.Line_No)). + // ForMember(dest => dest.Gongwno, src => src.MapFrom(d => d.Gongwno)). + // ForMember(dest => dest.Cpno, src => src.MapFrom(d => d.CpNo)). + // ForMember(dest => dest.Cpmodel, src => src.MapFrom(d => d.CpModel)). + // ForMember(dest => dest.Factorymodel, src => src.MapFrom(d => d.FactoryModel)). + // ForMember(dest => dest.Voltage, src => src.MapFrom(d => d.Voltage)). + // ForMember(dest => dest.Point2, src => src.MapFrom(d => d.Point2)). + // ForMember(dest => dest.TestTime, src => src.MapFrom(d => d.TestTime)). + // ForMember(dest => dest.TestedTime, src => src.MapFrom(d => d.TestedTime)). + // ForMember(dest => dest.Etemp, src => src.MapFrom(d => d.Etemp)). + // ForMember(dest => dest.BeginDatetime, src => src.MapFrom(d => d.BeginDateTime)). + // ForMember(dest => dest.CpResult, src => src.MapFrom(d => d.CpResult)). + // ForMember(dest => dest.EndDateTime, src => src.MapFrom(d => d.EndDateTime)). + // ForMember(dest => dest.UserName, src => src.MapFrom(d => d.UserName)). + // ForMember(dest => dest.Remark, src => src.MapFrom(d => d.Remark)). + // ForMember(dest => dest.TestNo, src => src.MapFrom(d => d.TestNo)). + // ForMember(dest => dest.Temp_Mes, src => src.MapFrom(d => d.Temp_Mes)). + // ForMember(dest => dest.Power_Mes, src => src.MapFrom(d => d.Power_Mes)). + // ForMember(dest => dest.Part_Mes, src => src.MapFrom(d => d.Part_Mes)). + // ForMember(dest => dest.ErrorCode_Mes, src => src.MapFrom(d => d.ErrorCode_Mes)). + // ForMember(dest => dest.T1Name, src => src.MapFrom(d => d.T1Name)). + // ForMember(dest => dest.T2Name, src => src.MapFrom(d => d.T2Name)). + // ForMember(dest => dest.T3Name, src => src.MapFrom(d => d.T3Name)). + // ForMember(dest => dest.T4Name, src => src.MapFrom(d => d.T4Name)). + // ForMember(dest => dest.T5Name, src => src.MapFrom(d => d.T5Name)). + // ForMember(dest => dest.T6Name, src => src.MapFrom(d => d.T6Name)). + // ForMember(dest => dest.IsOrder, src => src.MapFrom(d => d.IsOrder)). + // ForMember(dest => dest.LowV_Time, src => src.MapFrom(d => d.LowV_Time)). + // ForMember(dest => dest.LowV_PowerMin, src => src.MapFrom(d => d.LowV_PowerMin)). + // ForMember(dest => dest.LowV_PowerMax, src => src.MapFrom(d => d.LowV_PowerMax)). + // ForMember(dest => dest.LowV_PowerFact, src => src.MapFrom(d => d.LowV_PowerFact)). + // ForMember(dest => dest.LowVoltage, src => src.MapFrom(d => d.LowVoltage)); + // //ForMember(dest => dest.CreateTime, src => src.MapFrom(d => d.Create_Time)). - }); + } + ); } } } diff --git a/Admin.Core.Extensions/obj/Debug/net6.0/Admin.Core.Extensions.AssemblyInfo.cs b/Admin.Core.Extensions/obj/Debug/net6.0/Admin.Core.Extensions.AssemblyInfo.cs index ed140ca2..8acfaf45 100644 --- a/Admin.Core.Extensions/obj/Debug/net6.0/Admin.Core.Extensions.AssemblyInfo.cs +++ b/Admin.Core.Extensions/obj/Debug/net6.0/Admin.Core.Extensions.AssemblyInfo.cs @@ -14,7 +14,7 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("Admin.Core.Extensions")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+8538964ef3a1a79e9a9bc655bb6d2f3d8a56c86a")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+09425abb94ddbc502762491aeee6d081b0fd9246")] [assembly: System.Reflection.AssemblyProductAttribute("Admin.Core.Extensions")] [assembly: System.Reflection.AssemblyTitleAttribute("Admin.Core.Extensions")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] diff --git a/Admin.Core.Extensions/obj/Debug/net6.0/Admin.Core.Extensions.AssemblyInfoInputs.cache b/Admin.Core.Extensions/obj/Debug/net6.0/Admin.Core.Extensions.AssemblyInfoInputs.cache index b80e2516..926d1daf 100644 --- a/Admin.Core.Extensions/obj/Debug/net6.0/Admin.Core.Extensions.AssemblyInfoInputs.cache +++ b/Admin.Core.Extensions/obj/Debug/net6.0/Admin.Core.Extensions.AssemblyInfoInputs.cache @@ -1 +1 @@ -ccbbc17784cbf7858c929b248f106ffa29ff2844237989ec117203b05eeae991 +54542485d9d5d909ec00362a7774afbbbd0d9de06e474e6dea86088f8b616ed9 diff --git a/Admin.Core.FrameWork/obj/Debug/netcoreapp3.1/Admin.Core.FrameWork.AssemblyInfo.cs b/Admin.Core.FrameWork/obj/Debug/netcoreapp3.1/Admin.Core.FrameWork.AssemblyInfo.cs index 0cd9d347..11394b9a 100644 --- a/Admin.Core.FrameWork/obj/Debug/netcoreapp3.1/Admin.Core.FrameWork.AssemblyInfo.cs +++ b/Admin.Core.FrameWork/obj/Debug/netcoreapp3.1/Admin.Core.FrameWork.AssemblyInfo.cs @@ -14,7 +14,7 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("Admin.Core.FrameWork")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+60c5f54c3d8d93d68f008d6dfcabe9fc57d1a982")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+09425abb94ddbc502762491aeee6d081b0fd9246")] [assembly: System.Reflection.AssemblyProductAttribute("Admin.Core.FrameWork")] [assembly: System.Reflection.AssemblyTitleAttribute("Admin.Core.FrameWork")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] diff --git a/Admin.Core.FrameWork/obj/Debug/netcoreapp3.1/Admin.Core.FrameWork.AssemblyInfoInputs.cache b/Admin.Core.FrameWork/obj/Debug/netcoreapp3.1/Admin.Core.FrameWork.AssemblyInfoInputs.cache index e3975406..96482b8d 100644 --- a/Admin.Core.FrameWork/obj/Debug/netcoreapp3.1/Admin.Core.FrameWork.AssemblyInfoInputs.cache +++ b/Admin.Core.FrameWork/obj/Debug/netcoreapp3.1/Admin.Core.FrameWork.AssemblyInfoInputs.cache @@ -1 +1 @@ -8726b4a34e466084643a48e8c0039a17689dbbba68bb056ab0191f984716dde6 +95b9afb20f612087230db37b666e22f3502b9cda1b891f7e39f9c1fa82a9e378 diff --git a/Admin.Core.IRepository/IRepository_New/ITemperatureHistoryRepository.cs b/Admin.Core.IRepository/IRepository_New/ITemperatureHistoryRepository.cs index a5c2d599..c17ca95e 100644 --- a/Admin.Core.IRepository/IRepository_New/ITemperatureHistoryRepository.cs +++ b/Admin.Core.IRepository/IRepository_New/ITemperatureHistoryRepository.cs @@ -1,5 +1,6 @@ using Admin.Core.Model; using Admin.Core.Model.Model_New; +using Admin.Core.Model.ViewModels; using System; using System.Collections.Generic; using System.Threading.Tasks; @@ -11,17 +12,6 @@ namespace Admin.Core.IRepository /// public interface ITemperatureHistoryRepository : IBaseRepository { - /// - /// 传递时间时间 调用存储过程 获取测温历史记录 - /// - /// 起始时间 - /// - List QueryTemperatureHistory(DateTime startTime); - /// - /// 传递条码 调用存储过程 获取测温历史记录 - /// - /// 条码 - /// - List QueryTemperatureHistory(string barCode); + } } \ No newline at end of file diff --git a/Admin.Core.IRepository/IRepository_New/ITestedCodeMESRepository.cs b/Admin.Core.IRepository/IRepository_New/ITestedCodeMESRepository.cs new file mode 100644 index 00000000..ec9dbb9b --- /dev/null +++ b/Admin.Core.IRepository/IRepository_New/ITestedCodeMESRepository.cs @@ -0,0 +1,21 @@ +using Admin.Core.Model; +using Admin.Core.Model.ViewModels; +using System; +using System.Collections.Generic; +using System.Threading.Tasks; + +namespace Admin.Core.IRepository +{ + /// + /// ITestedCodeMESRepository + /// + public interface ITestedCodeMESRepository : IBaseRepository + { + /// + /// 传递时间时间 调用存储过程 获取测温历史记录 + /// + /// 结束时间 + /// + List QueryTemperatureHistory(DateTime time); + } +} \ No newline at end of file diff --git a/Admin.Core.IRepository/obj/Debug/net6.0/Admin.Core.IRepository.AssemblyInfo.cs b/Admin.Core.IRepository/obj/Debug/net6.0/Admin.Core.IRepository.AssemblyInfo.cs index 44457a4e..5de55a99 100644 --- a/Admin.Core.IRepository/obj/Debug/net6.0/Admin.Core.IRepository.AssemblyInfo.cs +++ b/Admin.Core.IRepository/obj/Debug/net6.0/Admin.Core.IRepository.AssemblyInfo.cs @@ -14,7 +14,7 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("Admin.Core.IRepository")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+8538964ef3a1a79e9a9bc655bb6d2f3d8a56c86a")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+09425abb94ddbc502762491aeee6d081b0fd9246")] [assembly: System.Reflection.AssemblyProductAttribute("Admin.Core.IRepository")] [assembly: System.Reflection.AssemblyTitleAttribute("Admin.Core.IRepository")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] diff --git a/Admin.Core.IRepository/obj/Debug/net6.0/Admin.Core.IRepository.AssemblyInfoInputs.cache b/Admin.Core.IRepository/obj/Debug/net6.0/Admin.Core.IRepository.AssemblyInfoInputs.cache index de8c0257..55e2f625 100644 --- a/Admin.Core.IRepository/obj/Debug/net6.0/Admin.Core.IRepository.AssemblyInfoInputs.cache +++ b/Admin.Core.IRepository/obj/Debug/net6.0/Admin.Core.IRepository.AssemblyInfoInputs.cache @@ -1 +1 @@ -301a2f01eba9435b62a6ed87a5d4e047767724541eb68c6eb91a1acdd4792fa5 +fd52366f275725209e14e400209662676163c8d9a60c70a1d4cd6ad04fb19bde diff --git a/Admin.Core.IService/IService_New/ITemperatureHistoryServices.cs b/Admin.Core.IService/IService_New/ITemperatureHistoryServices.cs index 8151412a..ceeeebd2 100644 --- a/Admin.Core.IService/IService_New/ITemperatureHistoryServices.cs +++ b/Admin.Core.IService/IService_New/ITemperatureHistoryServices.cs @@ -12,18 +12,6 @@ namespace Admin.Core.IService /// public interface ITemperatureHistoryServices : IBaseServices { - /// - /// 根据起始时间查询 测温历史记录 - /// - /// - /// - List QueryTemperatureHistory(DateTime startTime); - /// - ///根据条码查询历史记录 - /// - /// - /// - List QueryTemperatureHistory(string barCode); } } \ No newline at end of file diff --git a/Admin.Core.IService/IService_New/ITestedCodeMESServices.cs b/Admin.Core.IService/IService_New/ITestedCodeMESServices.cs new file mode 100644 index 00000000..63246d5b --- /dev/null +++ b/Admin.Core.IService/IService_New/ITestedCodeMESServices.cs @@ -0,0 +1,19 @@ +using Admin.Core.Model; +using System; +using System.Collections.Generic; + +namespace Admin.Core.IService +{ + /// + /// IBaseBomInfoServices + /// + public interface ITestedCodeMESServices : IBaseServices + { + + /// + /// 获取系统班组时间 + /// + public List QueryTemperatureHistory(DateTime startTime); + + } +} \ No newline at end of file diff --git a/Admin.Core.IService/obj/Debug/net6.0/Admin.Core.IService.AssemblyInfo.cs b/Admin.Core.IService/obj/Debug/net6.0/Admin.Core.IService.AssemblyInfo.cs index 2c59724f..02bc90de 100644 --- a/Admin.Core.IService/obj/Debug/net6.0/Admin.Core.IService.AssemblyInfo.cs +++ b/Admin.Core.IService/obj/Debug/net6.0/Admin.Core.IService.AssemblyInfo.cs @@ -14,7 +14,7 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("Admin.Core.IService")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+8538964ef3a1a79e9a9bc655bb6d2f3d8a56c86a")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+09425abb94ddbc502762491aeee6d081b0fd9246")] [assembly: System.Reflection.AssemblyProductAttribute("Admin.Core.IService")] [assembly: System.Reflection.AssemblyTitleAttribute("Admin.Core.IService")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] diff --git a/Admin.Core.IService/obj/Debug/net6.0/Admin.Core.IService.AssemblyInfoInputs.cache b/Admin.Core.IService/obj/Debug/net6.0/Admin.Core.IService.AssemblyInfoInputs.cache index d6b785b3..f523fa89 100644 --- a/Admin.Core.IService/obj/Debug/net6.0/Admin.Core.IService.AssemblyInfoInputs.cache +++ b/Admin.Core.IService/obj/Debug/net6.0/Admin.Core.IService.AssemblyInfoInputs.cache @@ -1 +1 @@ -65b4c6f711245279c3727e3a1c075776410fbd5f735a7f0e582ddf21a60e9c4e +9c136a564947bfbcd18be55b58dbacb9a164681203348e61bfb7023084d2177e diff --git a/Admin.Core.Model/Model_New/BoxTemperatureMeasurementHistory.cs b/Admin.Core.Model/Model_New/BoxTemperatureMeasurementHistory.cs index 971507a0..a1a755c4 100644 --- a/Admin.Core.Model/Model_New/BoxTemperatureMeasurementHistory.cs +++ b/Admin.Core.Model/Model_New/BoxTemperatureMeasurementHistory.cs @@ -85,7 +85,7 @@ namespace Admin.Core.Model /// 开始测试时间 /// [SugarColumn(ColumnName = "BEGINDATETIME")] - public DateTime BeginDatetime { get; set; } + public string BeginDatetime { get; set; } /// /// 测试结果 @@ -97,7 +97,7 @@ namespace Admin.Core.Model /// 测试结束时间 /// [SugarColumn(ColumnName = "ENDDATETIME")] - public DateTime EndDateTime { get; set; } + public string EndDateTime { get; set; } /// /// 系统用户 diff --git a/Admin.Core.Model/Model_New/TemperatureHistory.cs b/Admin.Core.Model/Model_New/TemperatureHistory.cs index 87b85ba6..219e62ba 100644 --- a/Admin.Core.Model/Model_New/TemperatureHistory.cs +++ b/Admin.Core.Model/Model_New/TemperatureHistory.cs @@ -1,191 +1,217 @@ -using NPOI.Util; -using SqlSugar; +using SqlSugar; using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace Admin.Core.Model { /// /// 测温历史记录 /// - [Table("TemperatureHistory")] - [SugarTable("TemperatureHistory", "Hsdb")] + [Table("BOX_TEMPERATUREHISTORY")] + [SugarTable("BOX_TEMPERATUREHISTORY", "AUCMA_SCADA")] public class TemperatureHistory { /// /// 主键 /// - [SugarColumn(IsPrimaryKey = true, IsIdentity = true)] + [SugarColumn(ColumnName = "OBJ_ID", IsIdentity = true, IsPrimaryKey = true, OracleSequenceName = "SEQ_CODE_BINDING")] public int ObjId { get; set; } /// /// 线号 /// + [SugarColumn(ColumnName = "LINE_NO")] public int Line_No { get; set; } /// /// 工位号 /// + [SugarColumn(ColumnName = "GONGWNO")] public int Gongwno { get; set; } /// /// 产品条码 /// - public string Cpno { get; set; } + [SugarColumn(ColumnName = "CPNO")] + public string CpNo { get; set; } /// /// 产品型号 /// + [SugarColumn(ColumnName = "CPMODEL")] public string CpModel { get; set; } /// /// 基准型号 /// + [SugarColumn(ColumnName = "FACTORYMODEL")] public string FactoryModel { get; set; } /// /// 工作电压 /// + [SugarColumn(ColumnName = "FACTORYMODEL")] public int Voltage { get; set; } /// /// 测试通道 /// + [SugarColumn(ColumnName = "POINT2")] public string Point2 { get; set; } /// /// 计划测试时间 /// + [SugarColumn(ColumnName = "TESTTIME")] public int TestTime { get; set; } /// /// 实际测试时间 /// + [SugarColumn(ColumnName = "TESTEDTIME")] public decimal TestedTime { get; set; } /// /// 环温 /// + [SugarColumn(ColumnName = "ETEMP")] public decimal Etemp { get; set; } /// /// 开始测试时间 /// - public DateTime BeginDateTime { get; set; } + [SugarColumn(ColumnName = "BEGINDATETIME")] + public string BeginDateTime { get; set; } /// /// 测试结果 /// + [SugarColumn(ColumnName = "CPRESULT")] public string CpResult { get; set; } /// /// 测试结束时间 /// - public DateTime EndDateTime { get; set; } + [SugarColumn(ColumnName = "ENDDATETIME")] + public string EndDateTime { get; set; } /// /// 系统用户 /// + [SugarColumn(ColumnName = "USERNAME")] public string UserName { get; set; } /// /// 备注 /// + [SugarColumn(ColumnName = "REMARK")] public string Remark { get; set; } /// /// 第几次测试 /// + [SugarColumn(ColumnName = "TESTNO")] public int TestNo { get; set; } /// /// 温度数据 /// + [SugarColumn(ColumnName = "TEMP_MES")] public string Temp_Mes { get; set; } /// /// 功率数据 /// + [SugarColumn(ColumnName = "POWER_MES")] public string Power_Mes { get; set; } /// /// 部件测试数据 /// + [SugarColumn(ColumnName = "PART_MES")] public string Part_Mes { get; set; } /// /// 故障代码 /// + [SugarColumn(ColumnName = "ERRORCODE_MES")] public string ErrorCode_Mes { get; set; } /// /// 内部传感器 1 名称 /// + [SugarColumn(ColumnName = "T1NAME")] public string T1Name { get; set; } /// /// 内部传感器 2 名称 /// + [SugarColumn(ColumnName = "T2NAME")] public string T2Name { get; set; } /// /// 内部传感器 3 名称 /// + [SugarColumn(ColumnName = "T3NAME")] public string T3Name { get; set; } /// /// 内部传感器 4 名称 /// + [SugarColumn(ColumnName = "T4NAME")] public string T4Name { get; set; } /// /// 内部传感器 5 名称 /// + [SugarColumn(ColumnName = "T5NAME")] public string T5Name { get; set; } /// /// 内部传感器 6 名称 /// + [SugarColumn(ColumnName = "T6NAME")] public string T6Name { get; set; } /// /// 是否测试部件(”Y”测试) /// + [SugarColumn(ColumnName = "ISORDER")] public string IsOrder { get; set; } /// /// 低压启动测试时间 /// + [SugarColumn(ColumnName = "LOWV_TIME")] public int LowV_Time { get; set; } /// /// 低压启动标准下限 /// + [SugarColumn(ColumnName = "LOWV_POWERMIN")] public decimal LowV_PowerMin { get; set; } /// /// 低压启动标准上限 /// + [SugarColumn(ColumnName = "LOWV_POWERMAX")] public decimal LowV_PowerMax { get; set; } /// /// 低压启动实际采集值 /// + [SugarColumn(ColumnName = "LOWV_POWERFACT")] public decimal LowV_PowerFact { get; set; } /// /// 低压启动测试电压 /// + [SugarColumn(ColumnName = "LOWVOLTAGE")] public decimal LowVoltage { get; set; } - /// - /// 同步标识 + /// 同步时间 /// - public int flag { get; set; } + [SugarColumn(ColumnName = "SYNC_DATETIME")] + public DateTime SyncDate { get; set; } } } diff --git a/Admin.Core.Model/Model_New/TestedCode_MES.cs b/Admin.Core.Model/Model_New/TestedCode_MES.cs new file mode 100644 index 00000000..795fe0ef --- /dev/null +++ b/Admin.Core.Model/Model_New/TestedCode_MES.cs @@ -0,0 +1,183 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Admin.Core.Model +{ + /// + /// 测温历史记录 + /// + [Table("TestedCode_MES")] + [SugarTable("TestedCode_MES", "TOPLINE_T10_E_P2_32_AUCMA_HeNan_D_261")] + public class TestedCode_MES + { + /// + /// 主键 + /// + [SugarColumn(IsPrimaryKey = true, IsIdentity = true)] + public int ID { get; set; } + /// + /// 线号 + /// + public int Line_No { get; set; } + + /// + /// 工位号 + /// + public int Gongwno { get; set; } + + /// + /// 产品条码 + /// + public string CpNo { get; set; } + + /// + /// 产品型号 + /// + public string CpModel { get; set; } + + /// + /// 基准型号 + /// + public string FactoryModel { get; set; } + + /// + /// 工作电压 + /// + public int Voltage { get; set; } + + /// + /// 测试通道 + /// + public string Point2 { get; set; } + + /// + /// 计划测试时间 + /// + public int TestTime { get; set; } + + /// + /// 实际测试时间 + /// + public decimal TestedTime { get; set; } + + /// + /// 环温 + /// + public decimal Etemp { get; set; } + + /// + /// 开始测试时间 + /// + public string BeginDateTime { get; set; } + + /// + /// 测试结果 + /// + public string CpResult { get; set; } + + /// + /// 测试结束时间 + /// + public string EndDateTime { get; set; } + + /// + /// 系统用户 + /// + public string UserName { get; set; } + + /// + /// 备注 + /// + public string Remark { get; set; } + + /// + /// 第几次测试 + /// + public int TestNo { get; set; } + + /// + /// 温度数据 + /// + public string Temp_Mes { get; set; } + + /// + /// 功率数据 + /// + public string Power_Mes { get; set; } + + /// + /// 部件测试数据 + /// + public string Part_Mes { get; set; } + + /// + /// 故障代码 + /// + public string ErrorCode_Mes { get; set; } + + /// + /// 内部传感器 1 名称 + /// + public string T1Name { get; set; } + + /// + /// 内部传感器 2 名称 + /// + public string T2Name { get; set; } + + /// + /// 内部传感器 3 名称 + /// + public string T3Name { get; set; } + + /// + /// 内部传感器 4 名称 + /// + public string T4Name { get; set; } + + /// + /// 内部传感器 5 名称 + /// + public string T5Name { get; set; } + + /// + /// 内部传感器 6 名称 + /// + public string T6Name { get; set; } + + /// + /// 是否测试部件(”Y”测试) + /// + public string IsOrder { get; set; } + + /// + /// 低压启动测试时间 + /// + public int LowV_Time { get; set; } + + /// + /// 低压启动标准下限 + /// + public decimal LowV_PowerMin { get; set; } + + /// + /// 低压启动标准上限 + /// + public decimal LowV_PowerMax { get; set; } + + /// + /// 低压启动实际采集值 + /// + public decimal LowV_PowerFact { get; set; } + + /// + /// 低压启动测试电压 + /// + public decimal LowVoltage { get; set; } + } +} diff --git a/Admin.Core.Model/ViewModels/Data_ForMES.cs b/Admin.Core.Model/ViewModels/Data_ForMES.cs new file mode 100644 index 00000000..8c9804ed --- /dev/null +++ b/Admin.Core.Model/ViewModels/Data_ForMES.cs @@ -0,0 +1,174 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Admin.Core.Model.ViewModels +{ + /// + /// 测温信息 + /// + public class Data_ForMES + { + /// + /// 线号 + /// + public int Line_No { get; set; } + + /// + /// 工位号 + /// + public int Gongwno { get; set; } + + /// + /// 产品条码 + /// + public string Cpno { get; set; } + + /// + /// 产品型号 + /// + public string CpModel { get; set; } + + /// + /// 基准型号 + /// + public string FactoryModel { get; set; } + + /// + /// 工作电压 + /// + public int Voltage { get; set; } + + /// + /// 测试通道 + /// + public string Point2 { get; set; } + + /// + /// 计划测试时间 + /// + public int TestTime { get; set; } + + /// + /// 实际测试时间 + /// + public decimal TestedTime { get; set; } + + /// + /// 环温 + /// + public decimal Etemp { get; set; } + + /// + /// 开始测试时间 + /// + public string BeginDateTime { get; set; } + + /// + /// 测试结果 + /// + public string CpResult { get; set; } + + /// + /// 测试结束时间 + /// + public string EndDateTime { get; set; } + + /// + /// 系统用户 + /// + public string UserName { get; set; } + + /// + /// 备注 + /// + public string Remark { get; set; } + + /// + /// 第几次测试 + /// + public int TestNo { get; set; } + + /// + /// 温度数据 + /// + public string Temp_Mes { get; set; } + + /// + /// 功率数据 + /// + public string Power_Mes { get; set; } + + /// + /// 部件测试数据 + /// + public string Part_Mes { get; set; } + + /// + /// 故障代码 + /// + public string ErrorCode_Mes { get; set; } + + /// + /// 内部传感器 1 名称 + /// + public string T1Name { get; set; } + + /// + /// 内部传感器 2 名称 + /// + public string T2Name { get; set; } + + /// + /// 内部传感器 3 名称 + /// + public string T3Name { get; set; } + + /// + /// 内部传感器 4 名称 + /// + public string T4Name { get; set; } + + /// + /// 内部传感器 5 名称 + /// + public string T5Name { get; set; } + + /// + /// 内部传感器 6 名称 + /// + public string T6Name { get; set; } + + /// + /// 是否测试部件(”Y”测试) + /// + public string IsOrder { get; set; } + + /// + /// 低压启动测试时间 + /// + public int LowV_Time { get; set; } + + /// + /// 低压启动标准下限 + /// + public decimal LowV_PowerMin { get; set; } + + /// + /// 低压启动标准上限 + /// + public decimal LowV_PowerMax { get; set; } + + /// + /// 低压启动实际采集值 + /// + public decimal LowV_PowerFact { get; set; } + + /// + /// 低压启动测试电压 + /// + public decimal LowVoltage { get; set; } + } +} diff --git a/Admin.Core.Model/obj/Debug/net6.0/Admin.Core.Model.AssemblyInfo.cs b/Admin.Core.Model/obj/Debug/net6.0/Admin.Core.Model.AssemblyInfo.cs index 567caf25..ad7ed4c2 100644 --- a/Admin.Core.Model/obj/Debug/net6.0/Admin.Core.Model.AssemblyInfo.cs +++ b/Admin.Core.Model/obj/Debug/net6.0/Admin.Core.Model.AssemblyInfo.cs @@ -14,7 +14,7 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("Admin.Core.Model")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+8538964ef3a1a79e9a9bc655bb6d2f3d8a56c86a")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+09425abb94ddbc502762491aeee6d081b0fd9246")] [assembly: System.Reflection.AssemblyProductAttribute("Admin.Core.Model")] [assembly: System.Reflection.AssemblyTitleAttribute("Admin.Core.Model")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] diff --git a/Admin.Core.Model/obj/Debug/net6.0/Admin.Core.Model.AssemblyInfoInputs.cache b/Admin.Core.Model/obj/Debug/net6.0/Admin.Core.Model.AssemblyInfoInputs.cache index 419049ae..d9b9cd6e 100644 --- a/Admin.Core.Model/obj/Debug/net6.0/Admin.Core.Model.AssemblyInfoInputs.cache +++ b/Admin.Core.Model/obj/Debug/net6.0/Admin.Core.Model.AssemblyInfoInputs.cache @@ -1 +1 @@ -a2595f6072e1077c968fa28c018b419ef63a5870e11dfa76af33a0fcc6553b79 +eba9e3343c61168ef128d2c8322667cf66e43df1698baf6652391252557a9ca5 diff --git a/Admin.Core.RealTimeService/obj/Debug/net6.0/Admin.Core.RealTimeService.AssemblyInfo.cs b/Admin.Core.RealTimeService/obj/Debug/net6.0/Admin.Core.RealTimeService.AssemblyInfo.cs index c8a894b3..13c74458 100644 --- a/Admin.Core.RealTimeService/obj/Debug/net6.0/Admin.Core.RealTimeService.AssemblyInfo.cs +++ b/Admin.Core.RealTimeService/obj/Debug/net6.0/Admin.Core.RealTimeService.AssemblyInfo.cs @@ -14,7 +14,7 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("Admin.Core.RealTimeService")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+60c5f54c3d8d93d68f008d6dfcabe9fc57d1a982")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+09425abb94ddbc502762491aeee6d081b0fd9246")] [assembly: System.Reflection.AssemblyProductAttribute("Admin.Core.RealTimeService")] [assembly: System.Reflection.AssemblyTitleAttribute("Admin.Core.RealTimeService")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] diff --git a/Admin.Core.RealTimeService/obj/Debug/net6.0/Admin.Core.RealTimeService.AssemblyInfoInputs.cache b/Admin.Core.RealTimeService/obj/Debug/net6.0/Admin.Core.RealTimeService.AssemblyInfoInputs.cache index 311d4f37..a84f1753 100644 --- a/Admin.Core.RealTimeService/obj/Debug/net6.0/Admin.Core.RealTimeService.AssemblyInfoInputs.cache +++ b/Admin.Core.RealTimeService/obj/Debug/net6.0/Admin.Core.RealTimeService.AssemblyInfoInputs.cache @@ -1 +1 @@ -0233e45d9021e3993970f80743611620290253700f9f88fdb16a4673a7d9f624 +12fb8d3ee5930df1a82e635fa7cece644aa9734f37684319b98a4033dc66a185 diff --git a/Admin.Core.Repository/BASE/BaseRepository.cs b/Admin.Core.Repository/BASE/BaseRepository.cs index 8d937399..30a2e604 100644 --- a/Admin.Core.Repository/BASE/BaseRepository.cs +++ b/Admin.Core.Repository/BASE/BaseRepository.cs @@ -77,7 +77,6 @@ namespace Admin.Core.Repository catch (Exception ex) { var dd = _db.CopyNew().Ado.IsValidConnection(); - var ddd= _db.CopyNew().Ado.IsValidConnectionNoClose(); Console.WriteLine(ex.ToString()); return false; } diff --git a/Admin.Core.Repository/Repository_New/TemperatureHistoryRepository.cs b/Admin.Core.Repository/Repository_New/TemperatureHistoryRepository.cs index 350b5dc8..540e53b5 100644 --- a/Admin.Core.Repository/Repository_New/TemperatureHistoryRepository.cs +++ b/Admin.Core.Repository/Repository_New/TemperatureHistoryRepository.cs @@ -1,5 +1,6 @@ using Admin.Core.IRepository; using Admin.Core.Model; +using Admin.Core.Model.ViewModels; using SqlSugar; using System; using System.Collections.Generic; @@ -16,35 +17,7 @@ namespace Admin.Core.Repository { } - #region 传递时间时间 调用存储过程 获取测温历史记录 - /// - /// 传递的参数为信息起始时间,该存储过程会提取从起始时间开始按时间排序的 2000 条数据 - /// - /// - public List QueryTemperatureHistory(DateTime startTime) - { - var s = new SugarParameter("@p", startTime); - var res = new SugarParameter("@History", null, true);//设置为output - var list = Db.CopyNew().Ado.UseStoredProcedure().SqlQuery("Data_ForMES2", s); - return list; - } - #endregion - #region 传递条码 调用存储过程 获取测温历史记录 - /// - /// 调用存储过程 获取测温历史记录 - /// - /// - public List QueryTemperatureHistory(string barCode) - { - string startTime = string.Empty; - string endTime = string.Empty; - var s = new SugarParameter("@p", barCode); - var res = new SugarParameter("@History", null, true);//设置为output - var list = Db.CopyNew().Ado.UseStoredProcedure().SqlQuery("Data_ForMES", s); - return list; - } - #endregion } } \ No newline at end of file diff --git a/Admin.Core.Repository/Repository_New/TestedCodeMESRepository.cs b/Admin.Core.Repository/Repository_New/TestedCodeMESRepository.cs new file mode 100644 index 00000000..edc29879 --- /dev/null +++ b/Admin.Core.Repository/Repository_New/TestedCodeMESRepository.cs @@ -0,0 +1,34 @@ +using Admin.Core.IRepository; +using Admin.Core.Model; +using Admin.Core.Model.Model_New; +using Admin.Core.Model.ViewModels; +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Threading.Tasks; + +namespace Admin.Core.Repository +{ + /// + /// BaseBomInfoRepository + /// + public class TestedCodeMESRepository : BaseRepository, ITestedCodeMESRepository + { + public TestedCodeMESRepository(IUnitOfWork unitOfWork) : base(unitOfWork) + { + } + + #region 传递时间时间 调用存储过程 获取测温历史记录 + /// + /// 传递的参数为信息起始时间,该存储过程会提取从起始时间开始按时间排序的 2000 条数据 + /// + /// + public List QueryTemperatureHistory(DateTime time) + { + var endDatetime = new SugarParameter("@EndDatetime", time.AddDays(-1)); + var list = Db.CopyNew().Ado.UseStoredProcedure().SqlQuery("Data_ForMES2", endDatetime); + return list; + } + #endregion + } +} \ No newline at end of file diff --git a/Admin.Core.Repository/obj/Debug/net6.0/Admin.Core.Repository.AssemblyInfo.cs b/Admin.Core.Repository/obj/Debug/net6.0/Admin.Core.Repository.AssemblyInfo.cs index ac44e179..b72098cf 100644 --- a/Admin.Core.Repository/obj/Debug/net6.0/Admin.Core.Repository.AssemblyInfo.cs +++ b/Admin.Core.Repository/obj/Debug/net6.0/Admin.Core.Repository.AssemblyInfo.cs @@ -14,7 +14,7 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("Admin.Core.Repository")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+8538964ef3a1a79e9a9bc655bb6d2f3d8a56c86a")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+09425abb94ddbc502762491aeee6d081b0fd9246")] [assembly: System.Reflection.AssemblyProductAttribute("Admin.Core.Repository")] [assembly: System.Reflection.AssemblyTitleAttribute("Admin.Core.Repository")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] diff --git a/Admin.Core.Repository/obj/Debug/net6.0/Admin.Core.Repository.AssemblyInfoInputs.cache b/Admin.Core.Repository/obj/Debug/net6.0/Admin.Core.Repository.AssemblyInfoInputs.cache index 5bddbe3c..3765a4b9 100644 --- a/Admin.Core.Repository/obj/Debug/net6.0/Admin.Core.Repository.AssemblyInfoInputs.cache +++ b/Admin.Core.Repository/obj/Debug/net6.0/Admin.Core.Repository.AssemblyInfoInputs.cache @@ -1 +1 @@ -f18bd845b76dc9a757f5750b92d530121079126688148320def4fbb662ad68d1 +5d56e18776d5bae504efa18d45359a37fe8fefb5590910fecaa96c52a9becb52 diff --git a/Admin.Core.Service/Service_New/TemperatureHistoryServices.cs b/Admin.Core.Service/Service_New/TemperatureHistoryServices.cs index 0431a1b1..2bb63055 100644 --- a/Admin.Core.Service/Service_New/TemperatureHistoryServices.cs +++ b/Admin.Core.Service/Service_New/TemperatureHistoryServices.cs @@ -26,23 +26,6 @@ namespace Admin.Core.Service base.BaseDal = dal; _temperatureHistoryRepository = temperatureHistoryRepository; } - /// - /// 传递时间时间 调用存储过程 获取测温历史记录 - /// - /// 开始时间 - /// - public List QueryTemperatureHistory(DateTime startTime) - { - return _temperatureHistoryRepository.QueryTemperatureHistory(startTime); - } - /// - /// 传递条码 调用存储过程 获取测温历史记录 - /// - /// 条码 - /// - public List QueryTemperatureHistory(string barCode) - { - return _temperatureHistoryRepository.QueryTemperatureHistory(barCode); - } + } } \ No newline at end of file diff --git a/Admin.Core.Service/Service_New/TestedCodeMESServices.cs b/Admin.Core.Service/Service_New/TestedCodeMESServices.cs new file mode 100644 index 00000000..545005f2 --- /dev/null +++ b/Admin.Core.Service/Service_New/TestedCodeMESServices.cs @@ -0,0 +1,33 @@ +using Admin.Core.IRepository; +using Admin.Core.IService; +using Admin.Core.Model; +using Admin.Core.Model.Model_New; +using Admin.Core.Model.ViewModels; +using log4net; +using Microsoft.AspNetCore.Razor.TagHelpers; +using Microsoft.IdentityModel.Logging; +using NPOI.XSSF.UserModel; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace Admin.Core.Service +{ + public class TestedCodeMESServices : BaseServices, ITestedCodeMESServices + { + private static readonly log4net.ILog logHelper = LogManager.GetLogger(typeof(TestedCodeMESServices)); + private readonly IBaseRepository _dal; + private readonly ITestedCodeMESRepository _testedCodeMESRepository; + public TestedCodeMESServices(IBaseRepository dal, ITestedCodeMESRepository testedCodeMESRepository) + { + this._dal = dal; + _testedCodeMESRepository = testedCodeMESRepository; + } + + public List QueryTemperatureHistory(DateTime time) + { + return _testedCodeMESRepository.QueryTemperatureHistory(time); + } + } +} \ No newline at end of file diff --git a/Admin.Core.Service/obj/Debug/net6.0/Admin.Core.Service.AssemblyInfo.cs b/Admin.Core.Service/obj/Debug/net6.0/Admin.Core.Service.AssemblyInfo.cs index 1cb0d113..8b9a19cb 100644 --- a/Admin.Core.Service/obj/Debug/net6.0/Admin.Core.Service.AssemblyInfo.cs +++ b/Admin.Core.Service/obj/Debug/net6.0/Admin.Core.Service.AssemblyInfo.cs @@ -14,7 +14,7 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("Admin.Core.Service")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+8538964ef3a1a79e9a9bc655bb6d2f3d8a56c86a")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+09425abb94ddbc502762491aeee6d081b0fd9246")] [assembly: System.Reflection.AssemblyProductAttribute("Admin.Core.Service")] [assembly: System.Reflection.AssemblyTitleAttribute("Admin.Core.Service")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] diff --git a/Admin.Core.Service/obj/Debug/net6.0/Admin.Core.Service.AssemblyInfoInputs.cache b/Admin.Core.Service/obj/Debug/net6.0/Admin.Core.Service.AssemblyInfoInputs.cache index fb0ddf03..099daa68 100644 --- a/Admin.Core.Service/obj/Debug/net6.0/Admin.Core.Service.AssemblyInfoInputs.cache +++ b/Admin.Core.Service/obj/Debug/net6.0/Admin.Core.Service.AssemblyInfoInputs.cache @@ -1 +1 @@ -f7901cea78b4fbd0cdbeedc32dc88893aba7e0db582da2fd10c194604f8fe159 +cc6e776b70361f82bb4f23c93461cea3b66f5feefb4930db3d10015e4df9706e diff --git a/Admin.Core.Tasks/QuartzNet/Jobs/Job_TemperatureMeasurement_Quartz.cs b/Admin.Core.Tasks/QuartzNet/Jobs/Job_TemperatureMeasurement_Quartz.cs deleted file mode 100644 index 2b7c93d2..00000000 --- a/Admin.Core.Tasks/QuartzNet/Jobs/Job_TemperatureMeasurement_Quartz.cs +++ /dev/null @@ -1,140 +0,0 @@ -using Admin.Core.IService.ISys; -using Admin.Core.IService; -using Quartz; -using System; -using System.Threading.Tasks; -using log4net; -using Admin.Core.Model; -using System.Linq; -using Admin.Core.Model.Model_New; -using Aucma.Core.HwPLc; -using HwCommunication.Core; -using Admin.Core.Common.Helper; -using System.Collections; -using System.Text; -using NetTaste; -using Admin.Core.Service; -using AutoMapper; -using System.Collections.Generic; - -/// -/// 测温数据采集 -/// -namespace Admin.Core.Tasks -{ - public class Job_TemperatureMeasurement_Quartz : JobBase, IJob - { - public delegate Task RefreshBoxFoamDataDelegate(); - public static event RefreshBoxFoamDataDelegate RefreshBoxFoamDataDelegateEvent; - - private static readonly log4net.ILog logHelper = LogManager.GetLogger(typeof(Job_TemperatureMeasurement_Quartz)); - private readonly IBoxTemperatureMeasurementHistoryServices _boxTMHistoryServices; - private readonly ITemperatureHistoryServices _temperatureHistoryServices; - IMapper _mapper; - - public Job_TemperatureMeasurement_Quartz(ISysTasksQzService SysTasksQzService, ISysJobLogService sysJobLogService, - ITemperatureHistoryServices temperatureHistoryServices, IBoxTemperatureMeasurementHistoryServices boxTMHistoryServices, - IMapper mapper) - { - _SysTasksQzService = SysTasksQzService; - _boxTMHistoryServices = boxTMHistoryServices; - _temperatureHistoryServices = temperatureHistoryServices; - _mapper = mapper; - } - - public async Task Execute(IJobExecutionContext context) - { - await ExecuteJob(context, async () => await Run(context)); - } - - #region PLC 任务处理表 - /// - /// PLC 任务处理表 - /// - /// - /// - public async Task Run(IJobExecutionContext context) - { - try - { - - var list = await _temperatureHistoryServices.QueryAsync(d => d.flag == 0); - Console.WriteLine(list.Count()); - if (list.Count == 0) return; - - List< BoxTemperatureMeasurementHistory > historyList = new List(); - foreach (var item in list) - { - BoxTemperatureMeasurementHistory dest = new BoxTemperatureMeasurementHistory(); - dest.LineNo = item.Line_No; - dest.Gongwno = item.Gongwno; - dest.Cpno = item.Cpno; - dest.Cpmodel = item.CpModel; - dest.Factorymodel = item.FactoryModel; - dest.Voltage = item.Voltage; - dest.Point2 = item.Point2; - dest.TestTime = item.TestTime; - dest.TestedTime = item.TestedTime; - dest.Etemp = item.Etemp; - dest.BeginDatetime = item.BeginDateTime; - dest.CpResult = item.CpResult; - dest.EndDateTime = item.EndDateTime; - dest.UserName = item.UserName; - dest.Remark = item.Remark; - dest.TestNo = item.TestNo; - dest.Temp_Mes = item.Temp_Mes; - dest.Power_Mes = item.Power_Mes; - dest.Part_Mes = item.Part_Mes; - dest.ErrorCode_Mes = item.ErrorCode_Mes; - dest.T1Name = item.T1Name; - dest.T2Name = item.T2Name; - dest.T3Name = item.T3Name; - dest.T4Name = item.T4Name; - dest.T5Name = item.T5Name; - dest.T6Name = item.T6Name; - dest.IsOrder = item.IsOrder; - dest.LowV_Time = item.LowV_Time; - dest.LowV_PowerMin = item.LowV_PowerMin; - dest.LowV_PowerMax = item.LowV_PowerMax; - dest.LowV_PowerFact = item.LowV_PowerFact; - dest.LowVoltage = item.LowVoltage; - historyList.Add(dest); - } - //List history =new _mapper.Map>(list); - Console.WriteLine(historyList.Count()); - var result = await _boxTMHistoryServices.AddAsync(historyList); - if (result > 0) - { - if (list == null) return; - list.ForEach(x => x.flag = 1); - await _temperatureHistoryServices.UpdateAsync(list); - - Console.WriteLine("保存测温系统成功"); - } - } - catch (Exception ex) - { - logHelper.Error($"测温数据处理异常:{ex.Message}"); - - } - } - - private async Task UpdateRealData(BoxFoamData item) - { - - try - { - - } - catch (Exception ex) - { - logHelper.Error($"更新测温数据失败"); - } - - return await Task.FromResult(item); - } - #endregion - - - } -} diff --git a/Admin.Core.Tasks/obj/Debug/net6.0/Admin.Core.Tasks.AssemblyInfo.cs b/Admin.Core.Tasks/obj/Debug/net6.0/Admin.Core.Tasks.AssemblyInfo.cs index 86867abb..32321f56 100644 --- a/Admin.Core.Tasks/obj/Debug/net6.0/Admin.Core.Tasks.AssemblyInfo.cs +++ b/Admin.Core.Tasks/obj/Debug/net6.0/Admin.Core.Tasks.AssemblyInfo.cs @@ -14,7 +14,7 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("Admin.Core.Tasks")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+8538964ef3a1a79e9a9bc655bb6d2f3d8a56c86a")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+09425abb94ddbc502762491aeee6d081b0fd9246")] [assembly: System.Reflection.AssemblyProductAttribute("Admin.Core.Tasks")] [assembly: System.Reflection.AssemblyTitleAttribute("Admin.Core.Tasks")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] diff --git a/Admin.Core.Tasks/obj/Debug/net6.0/Admin.Core.Tasks.AssemblyInfoInputs.cache b/Admin.Core.Tasks/obj/Debug/net6.0/Admin.Core.Tasks.AssemblyInfoInputs.cache index 47fb452b..767d04da 100644 --- a/Admin.Core.Tasks/obj/Debug/net6.0/Admin.Core.Tasks.AssemblyInfoInputs.cache +++ b/Admin.Core.Tasks/obj/Debug/net6.0/Admin.Core.Tasks.AssemblyInfoInputs.cache @@ -1 +1 @@ -ccee45fea5738afedac594e057e6913d00207ed71ccfc8815ac25e5f1785be4d +cba01358e88713b6c82e795ec8ed4581e0bf4028aebdd8d98db3de520d20bde0 diff --git a/Aucam.Core.TemperatureService/appsettings.json b/Aucam.Core.TemperatureService/appsettings.json index 308a51bc..a97bd584 100644 --- a/Aucam.Core.TemperatureService/appsettings.json +++ b/Aucam.Core.TemperatureService/appsettings.json @@ -62,7 +62,7 @@ // *** 单库操作,把 MutiDBEnabled 设为false ***; // *** 多库操作,把 MutiDBEnabled 设为true,其他的从库Enabled也为true **; // 具体配置看视频:https://www.bilibili.com/video/BV1BJ411B7mn?p=6 - "MainDB": "AUCMA_SCADA", //当前项目的主库,所对应的连接字符串的Enabled必须为true + "MainDB": "TOPLINE_T10_E_P2_32_AUCMA_HeNan_D_261", //当前项目的主库,所对应的连接字符串的Enabled必须为true "MutiDBEnabled": true, //是否开启多库模式 "CQRSEnabled": false, //是否开启读写分离模式,必须是单库模式,且数据库类型一致,比如都是SqlServer "DBS": [ @@ -85,37 +85,21 @@ "ProviderName": "System.Data.SqlClient" }, { - "ConnId": "Hsdb", + "ConnId": "TOPLINE_T10_E_P2_32_AUCMA_HeNan_D_261", "DBType": 1, "Enabled": true, "HitRate": 40, - "Connection": "Data Source=10.10.92.147;Initial Catalog=TOPLINE_T10_E_P2_32_AUCMA;User ID=mes;Password=mes;", + "Connection": "Data Source=localhost;Initial Catalog=TOPLINE_T10_E_P2_32_AUCMA_HeNan_D_261;User ID=sa;Password=sa;", "ProviderName": "System.Data.SqlClient" } - ], - "QuartzNetJob": [ - { - "ID": 1, - "Name": "TemperatureMeasurement", - "JobGroup": "DEFAULT", - "Cron": "*/10 * * * * ?", - "AssemblyName": "Admin.Core.Tasks", - "ClassName": "Job_TemperatureMeasurement_Quartz", - "Remark": "执行测温设备数据采集程序", - "RunTimes": 3881, - "BeginTime": "2023-04-23 11:08:50.000", - "EndTime": "2100-08-06 16:45:30.000", - "TriggerType": 1, - "IntervalSecond": 1, - "CycleRunTimes": 1, - "IsStart": true, - "JobParams": null, - "DelFlag": false, - "CreateBy": "admin", - "CreateTime": "2023-04-23 11:09:22.0000000", - "UpdateBy": "admin", - "UpdateTime": "2023-11-15 16:45:45.0530000" - } + //{ + // "ConnId": "Hsdb", + // "DBType": 1, + // "Enabled": true, + // "HitRate": 10, + // "Connection": "Data Source=localhost;Initial Catalog=Hsdb;User ID=sa;Password=sa;", + // "ProviderName": "System.Data.SqlClient" + //} ], "Startup": { "Cors": { @@ -144,88 +128,9 @@ "Enabled": false //Nacos注册中心 } }, - "Redis": { - //"ConnectionString": "127.0.0.1:6379" - "ConnectionString": "127.0.0.1:6379" - }, - "RabbitMQ": { - "Enabled": true, - "Connection": "http://localhost:15672/", - "UserName": "robin", - "Password": "123456", - "RetryCount": 3 - }, - "EventBus": { - "Enabled": true, - "SubscriptionClientName": "Admin.Core" - }, "Middleware": { - "Plc": { - "Enabled": true - }, - "QuartzNetJob": { - "Enabled": true - - }, "AucamTask": { "Enabled": true } - }, - "PLCServer": [ - { - "Id": 1, - "EquipName": "PerfusionPlc", - "PlcType": "Siemens", - "Enabled": true, - "IP": "127.0.0.1", - "Port": 102 - } - ], - "IpRateLimiting": { - "EnableEndpointRateLimiting": false, //False: globally executed, true: executed for each - "StackBlockedRequests": false, //False: Number of rejections should be recorded on another counter - "RealIpHeader": "X-Real-IP", - "ClientIdHeader": "X-ClientId", - "IpWhitelist": [], //白名单 - "EndpointWhitelist": [ "get:/api/xxx", "*:/api/yyy" ], - "ClientWhitelist": [ "dev-client-1", "dev-client-2" ], - "QuotaExceededResponse": { - "Content": "{{\"status\":429,\"msg\":\"访问过于频繁,请稍后重试\",\"success\":false}}", - "ContentType": "application/json", - "StatusCode": 429 - }, - "HttpStatusCode": 429, //返回状态码 - "GeneralRules": [ //api规则,结尾一定要带* - { - "Endpoint": "*:/api/Admin*", - "Period": "1m", - "Limit": 20 - }, - { - "Endpoint": "*/api/*", - "Period": "1s", - "Limit": 3 - }, - { - "Endpoint": "*/api/*", - "Period": "1m", - "Limit": 30 - }, - { - "Endpoint": "*/api/*", - "Period": "12h", - "Limit": 500 - } - ] - }, - "LogFiedOutPutConfigs": { - "tcpAddressHost": "", // 输出elk的tcp连接地址 - "tcpAddressPort": 0, // 输出elk的tcp端口号 - "ConfigsInfo": [ // 配置的输出elk节点内容 常用语动态标识 - { - "FiedName": "applicationName", - "FiedValue": "Admin.Core.Api" - } - ] } } diff --git a/Aucma.Core.Palletiz/Aucma.Core.Palletiz.csproj b/Aucma.Core.Palletiz/Aucma.Core.Palletiz.csproj index 25cd8cbe..7cd61b2a 100644 --- a/Aucma.Core.Palletiz/Aucma.Core.Palletiz.csproj +++ b/Aucma.Core.Palletiz/Aucma.Core.Palletiz.csproj @@ -77,6 +77,12 @@ + + + ..\dll\MvCodeReaderSDK.Net.dll + + + Code diff --git a/Aucma.Core.Palletiz/Business/InstoreBusiness.cs b/Aucma.Core.Palletiz/Business/InstoreBusiness.cs index d2ad66e0..d9c7f1a6 100644 --- a/Aucma.Core.Palletiz/Business/InstoreBusiness.cs +++ b/Aucma.Core.Palletiz/Business/InstoreBusiness.cs @@ -43,7 +43,7 @@ namespace Aucma.Core.Palletiz.Business _baseSpaceInfoServices = App.ServiceProvider.GetService(); _codeBindingServices = App.ServiceProvider.GetService(); _recordInstoreServices = App.ServiceProvider.GetService(); - MvCodeHelper.HandlePalletizDelegateEvent += ScannerInStore;//注册扫码器扫码后业务处理事件 + //MvCodeHelper.HandlePalletizDelegateEvent += ScannerInStore;//注册扫码器扫码后业务处理事件 } #endregion @@ -85,7 +85,7 @@ namespace Aucma.Core.Palletiz.Business Task.Run(async () => { Thread.Sleep(3000); - await InStore("16160030000000910999", "192.168.1.19"); + await InStore("15100P000009E360795", "10.10.92.230"); }); } #endregion @@ -131,8 +131,7 @@ namespace Aucma.Core.Palletiz.Business LogInStoreInfoDelegateEvent?.Invoke($"上位机获取配置的扫码器【IP:{model.ToJson()}》名称:{model.Name}】","White"); //1.根据成品码找货道 List spaceList = GetSpaceBySNCode(SNCode, recordInstore); - Console.WriteLine($"上位机获取配置的货道数量【{spaceList.Count}】"); - + // 根据货道信息判断下发plc信号 if (spaceList == null || spaceList.Count == 0) { @@ -140,8 +139,15 @@ namespace Aucma.Core.Palletiz.Business // 刷新页面提示信息 Console.WriteLine("未找到匹配货道,请手动入库!"); LogInStoreInfoDelegateEvent?.Invoke("未找到匹配货道,请手动入库!", "White"); + //临时代码自动配分指定货道 + Console.WriteLine("请输入货道号:"); + int storeNo =Convert.ToInt32(Console.ReadKey()) ; + Console.WriteLine("请输入货道号:"); + int range = Convert.ToInt32(Console.ReadKey()); + return; } + Console.WriteLine($"上位机获取配置的货道数量【{spaceList.Count}】"); // 过滤货道,找到最终需要下发的货道 BaseSpaceInfo finalSpace = FilterSpace(spaceList); Console.WriteLine($"上位机获取需要下发的货道【货道名称:{finalSpace.SpaceName}》货道库存:{finalSpace.SpaceStock}》货道状态:{finalSpace.SpaceStatus}》货道类型:{finalSpace.SpaceType}》所属仓库:{finalSpace.StoreCode}】"); @@ -230,7 +236,12 @@ namespace Aucma.Core.Palletiz.Business { CodeBindingRecord bindingRecord = _codeBindingServices.FirstAsync(c => c.ProductCode.Equals(SNCode)).Result; - if (bindingRecord == null) return null; + if (bindingRecord == null) + { + Console.WriteLine("成品下线库未有此成品下线记录!"); + LogInStoreInfoDelegateEvent?.Invoke("成品下线库未有此成品下线记录!qin", "Red"); + return null; + } recordInstore.BarCodeCode = bindingRecord.BoxCode; recordInstore.MaterialCode = bindingRecord.BoxCode; @@ -246,6 +257,8 @@ namespace Aucma.Core.Palletiz.Business } catch (Exception ex) { + Console.WriteLine("成品下线库未有此成品下线记录!"); + LogInStoreInfoDelegateEvent?.Invoke("成品下线库未有此成品下线记录!qin", "Red"); logHelper.Error(ex.Message.ToString()); Console.WriteLine(ex.Message.ToString()); @@ -403,21 +416,28 @@ namespace Aucma.Core.Palletiz.Business DateTime targetTime = DateTime.Now.AddSeconds(8); while (true) { - Console.WriteLine($"是否可以下发:【{obj.plc.ReadBool("D1000")}】"); - if (obj.plc.ReadBool("D1000"))//如果为true 则可以下发 任务 + if (obj.IsConnect) { - // 应答字允许下发 - int storeNum = GetStoreNum(obj, spaceNum); - Console.WriteLine($"读取当前货道数量:【{storeNum}】"); - if (storeNum == 1) + Console.WriteLine($"是否可以下发:【{obj.plc.ReadBool("D1000")}】"); + if (obj.plc.ReadBool("D1000"))//如果为true 则可以下发 任务 { - obj.plc.WriteInt32("D7010", range);//旋转角度1=》90 2=>反转90 D2 1正转 2反转 - obj.plc.WriteInt32("D29", spaceNum); //货道号 - Console.WriteLine($"plc信号货道信号下发成功!【货道号:{spaceNum}"); - result = true; - break; + // 应答字允许下发 + int storeNum = GetStoreNum(obj, spaceNum); + Console.WriteLine($"读取当前货道数量:【{storeNum}】"); + if (storeNum == 1) + { + obj.plc.WriteInt32("D7010", range);//旋转角度1=》90 2=>反转90 D2 1正转 2反转 + obj.plc.WriteInt32("D29", spaceNum); //货道号 + Console.WriteLine($"plc信号货道信号下发成功!【货道号:{spaceNum}"); + result = true; + break; + } } } + else + { + Console.WriteLine($"plc未连接"); + } Thread.Sleep(500); } @@ -563,7 +583,6 @@ namespace Aucma.Core.Palletiz.Business if (tempStackInfo.IsLargeProducts) { obj.plc.WriteInt16("D7000", tempStackInfo.BinNo.ToString());//写入货道 - obj.plc.WriteInt16("D7100", tempStackInfo.BinNo.ToString());//写入货道 } else { @@ -595,32 +614,103 @@ namespace Aucma.Core.Palletiz.Business } #endregion } while (flagA); + return true; + } + else + { + LogInStoreInfoDelegateEvent?.Invoke("PLC未连接!", "Red"); + return false; } //更新货道 - return false; } - private static void GetResposeB() + + #endregion + + #region 临时写入入库 + /// + /// 临时写入入库 + /// + /// 货道号 + /// 转向: 1正转 2反转,3不转 + /// + public static bool TempWritePlc(int freightLaneNumber, int range) { - var obj = PlcHelper.melsecList.FirstOrDefault(d => d.EquipName.Equals("InStorePlc")); - //写入PLC - if (obj.plc.IsConnected) + try { + var obj = PlcHelper.melsecList.FirstOrDefault(d => d.EquipName.Equals("InStoreAPlc")); + //写入PLC + bool flag = true; do { - - #region 2号区域码垛——B - int responseWord2 = obj.plc.ReadInt16("D7120");//读取1号区域码垛 等待应答字回去 - Console.WriteLine("手动写入PLC成功!"); - if (responseWord2 == 2) + if (obj == null) { - obj.plc.WriteInt16("D7000", "0");//清空 + return false; } - #endregion - - } while (flagA); + if (obj.plc.IsConnected) + { + bool isDown = false; + int i = 0; + do + { + isDown = obj.plc.ReadBool("B1000"); + if (isDown) + { + Console.WriteLine($"[{DateTime.Now}] 当前下发信号为:{isDown}"); + LogInStoreInfoDelegateEvent?.Invoke($"[{DateTime.Now}] 当前下发信号为:{isDown}", "White"); + break; + } + else + { + Console.WriteLine($"[{DateTime.Now}] 当前下发信号为:{isDown},不可以下发"); + LogInStoreInfoDelegateEvent?.Invoke($"[{DateTime.Now}] 当前下发信号为:{isDown}", "Red"); + } + Console.WriteLine($"[{DateTime.Now}] 当前下发信号为:{isDown}"); + Thread.Sleep(1000); + i++; + } while (i < 3); + if (isDown == false) + { + Console.WriteLine($"[{DateTime.Now}] 下发失败,当前下发信号为:{isDown},请稍等后重试!"); + LogInStoreInfoDelegateEvent?.Invoke($"[{DateTime.Now}] 下发失败,当前下发信号为:{isDown},请稍等后重试!", "Red"); + return false; + } + LogInStoreInfoDelegateEvent?.Invoke($"[{DateTime.Now}] 开始下发PLC》货道号:{freightLaneNumber}》角度(1正转 2反转 3不转):{range}", "Red"); + Console.WriteLine($"[{DateTime.Now}] 开始下发PLC》货道号:{freightLaneNumber}》角度(1正转 2反转 3不转):{range}"); + if (isDown) + { + obj.plc.WriteInt16("D29", freightLaneNumber.ToString());//货道号 + obj.plc.WriteInt16("D2", range.ToString());//角度 1正转 2反转 3不转 + Console.WriteLine($"[{DateTime.Now}] 下发PLC成功"); + LogInStoreInfoDelegateEvent?.Invoke($"[{DateTime.Now}] 下发PLC成功", "Red"); + Thread.Sleep(1000); + isDown = obj.plc.ReadBool("B1000"); + if (isDown) + { + Console.WriteLine($"[{DateTime.Now}] 当前下发信号为:{isDown}"); + } + else + { + Console.WriteLine($"[{DateTime.Now}] 当前下发信号为:{isDown}"); + } + return true; + } + flag = false; + } + else + { + flag = true; + } + } while (flag); + return true; } - } + catch (Exception ex) + { + Console.WriteLine($"[{DateTime.Now}] 手动下发任务异常:{ex.Message}"); + LogInStoreInfoDelegateEvent?.Invoke($"[{DateTime.Now}] 手动下发任务异常:{ex.Message}", "Red"); + return false; + } + } #endregion } } \ No newline at end of file diff --git a/Aucma.Core.Palletiz/Business/MvCodeHelper.cs b/Aucma.Core.Palletiz/Business/MvCodeHelper.cs new file mode 100644 index 00000000..4a3d4627 --- /dev/null +++ b/Aucma.Core.Palletiz/Business/MvCodeHelper.cs @@ -0,0 +1,704 @@ +using Admin.Core.Common; +using Aucma.Core.Scanner; +using log4net; +using MvCodeReaderSDKNet; +using NPOI.SS.Formula.Functions; +using StackExchange.Profiling; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using UAParser; + +namespace Aucma.Core.Palletiz.Business +{ + public class MvCodeHelper + { + + //private static AppConfig appConfig = AppConfig.Instance; + public static bool m_bGrabbing = true; + private static string lastCode; + private static List allScanners = Appsettings.app("ScannerServer").ToList(); + // 内胆扫码器ip + private static string LinerScannerIp = allScanners.First(x => x.Name == "内侧扫码器1").Ip; + // 箱壳扫码器ip + private static string ShellScannerIp = allScanners.First(x => x.Name == "外侧扫码器2").Ip; + + private static readonly log4net.ILog log = LogManager.GetLogger(typeof(MvCodeHelper)); + + + #region 全局变量定义 + public static MvCodeReader ShellDevice = null; + public static MvCodeReader LinerDevice = null; + public static DateTime ShellLiveTime = DateTime.Now; + public static DateTime LinerLiveTime = DateTime.Now; + #endregion + + #region 委托事件 + + /// + /// 成品下线委托 + /// + /// + /// + public delegate void RefreshMaterialCodeStr(string materialCodeStr, string ip); + public static event RefreshMaterialCodeStr RefreshMaterialCodeStrEvent; + + /// + /// 刷新扫码器状态 + /// + /// + /// + public delegate void RefreshState(string ip,bool flag); + public static event RefreshState RefreshStateEvent; + + + /// + /// 日志信息刷新 + /// + /// + public delegate void RefreshLogMessage(string message); + public static event RefreshLogMessage RefreshLogMessageEvent; + #endregion + + public static void ShellImageCallbackFunc(IntPtr pData, IntPtr pstFrameInfoEx2, IntPtr pUser) + { + var stFrameInfo = (MvCodeReader.MV_CODEREADER_IMAGE_OUT_INFO_EX2)Marshal.PtrToStructure(pstFrameInfoEx2, typeof(MvCodeReader.MV_CODEREADER_IMAGE_OUT_INFO_EX2)); + + MvCodeReader.MV_CODEREADER_RESULT_BCR_EX2 stBcrResult = (MvCodeReader.MV_CODEREADER_RESULT_BCR_EX2)Marshal.PtrToStructure(stFrameInfo.UnparsedBcrList.pstCodeListEx2, typeof(MvCodeReader.MV_CODEREADER_RESULT_BCR_EX2)); + + // Console.WriteLine("CodeNum[" + Convert.ToString(stBcrResult.nCodeNum) + "]"); + if (stBcrResult.nCodeNum == 0) + { + Console.WriteLine(DateTime.Now + ":外侧--->No Read 处理"); + log.Info(DateTime.Now + ":外侧--->No Read 处理"); + //更新扫码器存活时间 + ShellLiveTime = DateTime.Now; + } + for (Int32 i = 0; i < stBcrResult.nCodeNum; i++) + { + bool bIsValidUTF8 = IsTextUTF8(stBcrResult.stBcrInfoEx2[i].chCode); + if (bIsValidUTF8) + { + string strCode = Encoding.UTF8.GetString(stBcrResult.stBcrInfoEx2[i].chCode); + Console.WriteLine(DateTime.Now + ":Get CodeNum: " + "CodeNum[" + i.ToString() + "], CodeString[" + strCode.Trim().TrimEnd('\0') + "]"); + + } + else + { + string strCode = Encoding.GetEncoding("GB2312").GetString(stBcrResult.stBcrInfoEx2[i].chCode); + Console.WriteLine(DateTime.Now + ":外侧扫码器==>Get CodeNum: " + "CodeNum[" + i.ToString() + "], CodeString[" + strCode.Trim().TrimEnd('\0') + "]"); + log.Info(DateTime.Now + ":外侧扫码器==>Get CodeNum: " + "CodeNum[" + i.ToString() + "], CodeString[" + strCode.Trim().TrimEnd('\0') + "]"); + // RefreshMaterialCodeStrEvent?.Invoke(strCode.Trim().TrimEnd('\0'), ShellScannerIp); + if (strCode.Trim().TrimEnd('\0').Length == 20) + { + //更新扫码器存活时间 + ShellLiveTime = DateTime.Now; + RefreshMaterialCodeStrEvent?.Invoke(strCode.Trim().TrimEnd('\0'), ShellScannerIp); + // 业务处理 + } + else + { + // 更新存活时间 + LinerLiveTime = DateTime.Now; + Console.WriteLine(DateTime.Now + ":外侧扫码器==>条码:" + strCode.Trim().TrimEnd('\0') + "长度不为20,当做No Read 处理"); + log.Info(DateTime.Now + ":外侧扫码器==>条码:" + strCode.Trim().TrimEnd('\0') + "长度不为20,当做No Read 处理"); + } + + } + } + + MvCodeReader.MV_CODEREADER_OCR_INFO_LIST stOcrInfo = (MvCodeReader.MV_CODEREADER_OCR_INFO_LIST)Marshal.PtrToStructure(stFrameInfo.UnparsedOcrList.pstOcrList, typeof(MvCodeReader.MV_CODEREADER_OCR_INFO_LIST)); + + for (int i = 0; i < stOcrInfo.nOCRAllNum; i++) + { + string strOcrCharCode = Encoding.UTF8.GetString(stOcrInfo.stOcrRowInfo[i].chOcr); + // Console.WriteLine("Get OcrInfo:" + "ocrNum[" + i.ToString() + "], ocrLen[" + Convert.ToString(stOcrInfo.stOcrRowInfo[i].nOcrLen) + "], ocrChar[" + strOcrCharCode.Trim().TrimEnd('\0') + "]"); + } + } + + + public static void LinerImageCallbackFunc(IntPtr pData, IntPtr pstFrameInfoEx2, IntPtr pUser) + { + var stFrameInfo = (MvCodeReader.MV_CODEREADER_IMAGE_OUT_INFO_EX2)Marshal.PtrToStructure(pstFrameInfoEx2, typeof(MvCodeReader.MV_CODEREADER_IMAGE_OUT_INFO_EX2)); + + MvCodeReader.MV_CODEREADER_RESULT_BCR_EX2 stBcrResult = (MvCodeReader.MV_CODEREADER_RESULT_BCR_EX2)Marshal.PtrToStructure(stFrameInfo.UnparsedBcrList.pstCodeListEx2, typeof(MvCodeReader.MV_CODEREADER_RESULT_BCR_EX2)); + + // Console.WriteLine("CodeNum[" + Convert.ToString(stBcrResult.nCodeNum) + "]"); + if (stBcrResult.nCodeNum == 0) + { + Console.WriteLine(DateTime.Now+":内侧--->No Read 处理"); + log.Info(DateTime.Now + ":内侧--->No Read 处理"); + // 更新存活时间 + LinerLiveTime = DateTime.Now; + } + for (Int32 i = 0; i < stBcrResult.nCodeNum; i++) + { + bool bIsValidUTF8 = IsTextUTF8(stBcrResult.stBcrInfoEx2[i].chCode); + if (bIsValidUTF8) + { + string strCode = Encoding.UTF8.GetString(stBcrResult.stBcrInfoEx2[i].chCode); + Console.WriteLine(DateTime.Now + ":Get CodeNum: " + "CodeNum[" + i.ToString() + "], CodeString[" + strCode.Trim().TrimEnd('\0') + "]"); + } + else + { + string strCode = Encoding.GetEncoding("GB2312").GetString(stBcrResult.stBcrInfoEx2[i].chCode); + Console.WriteLine(DateTime.Now + ":内侧扫码器==>Get CodeNum: " + "CodeNum[" + i.ToString() + "], CodeString[" + strCode.Trim().TrimEnd('\0') + "]"); + log.Info(DateTime.Now + ":内侧扫码器==>Get CodeNum: " + "CodeNum[" + i.ToString() + "], CodeString[" + strCode.Trim().TrimEnd('\0') + "]"); + // RefreshMaterialCodeStrEvent?.Invoke(strCode.Trim().TrimEnd('\0'), LinerScannerIp); + if (strCode.Trim().TrimEnd('\0').Length == 20) + { + // 更新存活时间 + LinerLiveTime = DateTime.Now; + // 业务处理 + RefreshMaterialCodeStrEvent?.Invoke(strCode.Trim().TrimEnd('\0'), LinerScannerIp); + } + else + { + // 更新存活时间 + LinerLiveTime = DateTime.Now; + Console.WriteLine(DateTime.Now + "内侧扫码器==>条码:" + strCode.Trim().TrimEnd('\0') + "长度不为20,当做No Read 处理"); + log.Info(DateTime.Now + "内侧扫码器==>条码:" + strCode.Trim().TrimEnd('\0') + "长度不为20,当做No Read 处理"); + } + + } + } + + MvCodeReader.MV_CODEREADER_OCR_INFO_LIST stOcrInfo = (MvCodeReader.MV_CODEREADER_OCR_INFO_LIST)Marshal.PtrToStructure(stFrameInfo.UnparsedOcrList.pstOcrList, typeof(MvCodeReader.MV_CODEREADER_OCR_INFO_LIST)); + + Console.WriteLine("ocrAllNum[" + Convert.ToString(stOcrInfo.nOCRAllNum) + "]"); + for (int i = 0; i < stOcrInfo.nOCRAllNum; i++) + { + string strOcrCharCode = Encoding.UTF8.GetString(stOcrInfo.stOcrRowInfo[i].chOcr); + Console.WriteLine("Get OcrInfo:" + "ocrNum[" + i.ToString() + "], ocrLen[" + Convert.ToString(stOcrInfo.stOcrRowInfo[i].nOcrLen) + "], ocrChar[" + strOcrCharCode.Trim().TrimEnd('\0') + "]"); + } + } + + + public static void Shell() + { + ShellLiveTime = DateTime.Now; + MvCodeReader.cbOutputEx2delegate ImageCallback; + + MvCodeReader.MV_CODEREADER_IMAGE_OUT_INFO_EX2 stFrameInfo = new MvCodeReader.MV_CODEREADER_IMAGE_OUT_INFO_EX2(); + MvCodeReader device = new MvCodeReader(); + int nRet = MvCodeReader.MV_CODEREADER_OK; + + do + { + // ch:枚举设备 | en:Enum device + MvCodeReader.MV_CODEREADER_DEVICE_INFO_LIST stDevList = new MvCodeReader.MV_CODEREADER_DEVICE_INFO_LIST(); + nRet = MvCodeReader.MV_CODEREADER_EnumDevices_NET(ref stDevList, MvCodeReader.MV_CODEREADER_GIGE_DEVICE); + if (MvCodeReader.MV_CODEREADER_OK != nRet) + { + // 刷新扫码器状态 + RefreshStateEvent?.Invoke("外侧", false); + + RefreshStateEvent?.Invoke("内侧", false); + Thread.Sleep(1000 * 10); + Console.WriteLine("Enum device failed:{0:x8}", nRet); + break; + } + Console.WriteLine("Enum device count : " + Convert.ToString(stDevList.nDeviceNum)); + if (0 == stDevList.nDeviceNum) + { + // 刷新扫码器状态 + RefreshStateEvent?.Invoke("外侧", false); + + RefreshStateEvent?.Invoke("内侧", false); + Thread.Sleep(1000 * 10); + + break; + } + + MvCodeReader.MV_CODEREADER_DEVICE_INFO stDevInfo; // 通用设备信息 + int nDevIndex = -1; + // ch:打印设备信息 | en:Print device info + for (Int32 i = 0; i < stDevList.nDeviceNum; i++) + { + stDevInfo = (MvCodeReader.MV_CODEREADER_DEVICE_INFO)Marshal.PtrToStructure(stDevList.pDeviceInfo[i], typeof(MvCodeReader.MV_CODEREADER_DEVICE_INFO)); + + if (MvCodeReader.MV_CODEREADER_GIGE_DEVICE == stDevInfo.nTLayerType) + { + MvCodeReader.MV_CODEREADER_GIGE_DEVICE_INFO stGigEDeviceInfo = (MvCodeReader.MV_CODEREADER_GIGE_DEVICE_INFO)MvCodeReader.ByteToStruct(stDevInfo.SpecialInfo.stGigEInfo, typeof(MvCodeReader.MV_CODEREADER_GIGE_DEVICE_INFO)); + uint nIp1 = ((stGigEDeviceInfo.nCurrentIp & 0xff000000) >> 24); + uint nIp2 = ((stGigEDeviceInfo.nCurrentIp & 0x00ff0000) >> 16); + uint nIp3 = ((stGigEDeviceInfo.nCurrentIp & 0x0000ff00) >> 8); + uint nIp4 = (stGigEDeviceInfo.nCurrentIp & 0x000000ff); + // Console.WriteLine("\n" + i.ToString() + ": [GigE] User Define Name : " + stGigEDeviceInfo.chUserDefinedName); + // Console.WriteLine("device IP :" + nIp1 + "." + nIp2 + "." + nIp3 + "." + nIp4); + string ipStr = nIp1 + "." + nIp2 + "." + nIp3 + "." + nIp4; + if (ipStr == ShellScannerIp) + { + nDevIndex = i; + Console.WriteLine("device IP :" + ipStr); + + } + } + } + if (nDevIndex < 0) { + Console.WriteLine("未找到外侧扫码器"); + // 刷新扫码器状态 + RefreshStateEvent?.Invoke("外侧", false); + Thread.Sleep(1000 * 30); + break; + } + stDevInfo = (MvCodeReader.MV_CODEREADER_DEVICE_INFO)Marshal.PtrToStructure(stDevList.pDeviceInfo[nDevIndex], typeof(MvCodeReader.MV_CODEREADER_DEVICE_INFO)); + + // ch:创建设备 | en:Create device + nRet = device.MV_CODEREADER_CreateHandle_NET(ref stDevInfo); + if (MvCodeReader.MV_CODEREADER_OK != nRet) + { + Console.WriteLine("Create device failed:{0:x8}", nRet); + // 刷新扫码器状态 + RefreshStateEvent?.Invoke("外侧", false); + break; + } + + // ch:打开设备 | en:Open device + nRet = device.MV_CODEREADER_OpenDevice_NET(); + + if (MvCodeReader.MV_CODEREADER_OK != nRet) + { + Console.WriteLine("Open device failed:{0:x8}", nRet); + // 刷新扫码器状态 + RefreshStateEvent?.Invoke("外侧", false); + break; + } + + // 刷新扫码器状态 + RefreshStateEvent?.Invoke("外侧",true); + // ch:注册回调函数 | en:Register image callback + ImageCallback = new MvCodeReader.cbOutputEx2delegate(ShellImageCallbackFunc); + nRet = device.MV_CODEREADER_RegisterImageCallBackEx2_NET(ImageCallback, IntPtr.Zero); + if (MvCodeReader.MV_CODEREADER_OK != nRet) + { + Console.WriteLine("Register image callback failed!"); + // 刷新扫码器状态 + RefreshStateEvent?.Invoke("外侧", false); + break; + } + + // ch:开启抓图 || en: start grab image + nRet = device.MV_CODEREADER_StartGrabbing_NET(); + if (MvCodeReader.MV_CODEREADER_OK != nRet) + { + Console.WriteLine("Start grabbing failed:{0:x8}", nRet); + // 刷新扫码器状态 + RefreshStateEvent?.Invoke("外侧", false); + break; + } + + // 关闭使用 + ShellDevice = device; + Console.WriteLine("Press enter to exit"); + Console.WriteLine(DateTime.Now.ToString()); + while (true) + { + Thread.Sleep(1000*60); + DateTime dateTime = DateTime.Now; + TimeSpan timeSpan = dateTime.Subtract(ShellLiveTime); + if (timeSpan.TotalMinutes >= 10) + { + Console.WriteLine("外侧扫码器超时"); + //CloseShell(); + //Shell(); + break; + } + + } + // Console.ReadLine(); + // 刷新扫码器状态 + RefreshStateEvent?.Invoke("外侧", false); + // ch:停止抓图 | en:Stop grabbing + nRet = device.MV_CODEREADER_StopGrabbing_NET(); + if (MvCodeReader.MV_CODEREADER_OK != nRet) + { + Console.WriteLine("Stop grabbing failed{0:x8}", nRet); + break; + } + + // ch:关闭设备 | en:Close device + nRet = device.MV_CODEREADER_CloseDevice_NET(); + if (MvCodeReader.MV_CODEREADER_OK != nRet) + { + Console.WriteLine("Close device failed{0:x8}", nRet); + break; + } + + // ch:销毁设备 | en:Destroy device + nRet = device.MV_CODEREADER_DestroyHandle_NET(); + if (MvCodeReader.MV_CODEREADER_OK != nRet) + { + Console.WriteLine("Destroy device failed:{0:x8}", nRet); + break; + } + } while (false); + Shell(); + //if (MvCodeReader.MV_CODEREADER_OK != nRet) + //{ + // // ch:销毁设备 | en:Destroy device + // nRet = device.MV_CODEREADER_DestroyHandle_NET(); + // if (MvCodeReader.MV_CODEREADER_OK != nRet) + // { + // Console.WriteLine("Destroy device failed:{0:x8}", nRet); + // } + //} + + } + + + + public static void Liner() + { + LinerLiveTime = DateTime.Now; + MvCodeReader.cbOutputEx2delegate ImageCallback; + + MvCodeReader.MV_CODEREADER_IMAGE_OUT_INFO_EX2 stFrameInfo = new MvCodeReader.MV_CODEREADER_IMAGE_OUT_INFO_EX2(); + MvCodeReader device = new MvCodeReader(); + int nRet = MvCodeReader.MV_CODEREADER_OK; + + do + { + // ch:枚举设备 | en:Enum device + MvCodeReader.MV_CODEREADER_DEVICE_INFO_LIST stDevList = new MvCodeReader.MV_CODEREADER_DEVICE_INFO_LIST(); + nRet = MvCodeReader.MV_CODEREADER_EnumDevices_NET(ref stDevList, MvCodeReader.MV_CODEREADER_GIGE_DEVICE); + if (MvCodeReader.MV_CODEREADER_OK != nRet) + { + // 刷新扫码器状态 + RefreshStateEvent?.Invoke("外侧", false); + + RefreshStateEvent?.Invoke("内侧", false); + Thread.Sleep(1000 * 10); + Console.WriteLine("Enum device failed:{0:x8}", nRet); + break; + } + Console.WriteLine("Enum device count : " + Convert.ToString(stDevList.nDeviceNum)); + if (0 == stDevList.nDeviceNum) + { + // 刷新扫码器状态 + RefreshStateEvent?.Invoke("外侧", false); + + RefreshStateEvent?.Invoke("内侧", false); + Thread.Sleep(1000 * 10); + break; + } + + MvCodeReader.MV_CODEREADER_DEVICE_INFO stDevInfo; // 通用设备信息 + Int32 nDevIndex = -1; + // ch:打印设备信息 | en:Print device info + for (Int32 i = 0; i < stDevList.nDeviceNum; i++) + { + stDevInfo = (MvCodeReader.MV_CODEREADER_DEVICE_INFO)Marshal.PtrToStructure(stDevList.pDeviceInfo[i], typeof(MvCodeReader.MV_CODEREADER_DEVICE_INFO)); + + if (MvCodeReader.MV_CODEREADER_GIGE_DEVICE == stDevInfo.nTLayerType) + { + MvCodeReader.MV_CODEREADER_GIGE_DEVICE_INFO stGigEDeviceInfo = (MvCodeReader.MV_CODEREADER_GIGE_DEVICE_INFO)MvCodeReader.ByteToStruct(stDevInfo.SpecialInfo.stGigEInfo, typeof(MvCodeReader.MV_CODEREADER_GIGE_DEVICE_INFO)); + uint nIp1 = ((stGigEDeviceInfo.nCurrentIp & 0xff000000) >> 24); + uint nIp2 = ((stGigEDeviceInfo.nCurrentIp & 0x00ff0000) >> 16); + uint nIp3 = ((stGigEDeviceInfo.nCurrentIp & 0x0000ff00) >> 8); + uint nIp4 = (stGigEDeviceInfo.nCurrentIp & 0x000000ff); + // Console.WriteLine("\n" + i.ToString() + ": [GigE] User Define Name : " + stGigEDeviceInfo.chUserDefinedName); + string ip = ((stGigEDeviceInfo.nCurrentIp & 0xff000000) >> 24) + "." + ((stGigEDeviceInfo.nCurrentIp & 0x00ff0000) >> 16) + "." + ((stGigEDeviceInfo.nCurrentIp & 0x0000ff00) >> 8) + "." + (stGigEDeviceInfo.nCurrentIp & 0x000000ff); + string ipStr = nIp1 + "." + nIp2 + "." + nIp3 + "." + nIp4; + if (ipStr == LinerScannerIp) + { + Console.WriteLine("device IP :" + ipStr); + nDevIndex = i; + } + } + } + if (nDevIndex < 0) + { + Console.WriteLine("未找到内侧扫码器"); + // 刷新扫码器状态 + RefreshStateEvent?.Invoke("内侧", false); + Thread.Sleep(1000 * 30); + break; + } + + stDevInfo = (MvCodeReader.MV_CODEREADER_DEVICE_INFO)Marshal.PtrToStructure(stDevList.pDeviceInfo[nDevIndex], typeof(MvCodeReader.MV_CODEREADER_DEVICE_INFO)); + + // ch:创建设备 | en:Create device + nRet = device.MV_CODEREADER_CreateHandle_NET(ref stDevInfo); + if (MvCodeReader.MV_CODEREADER_OK != nRet) + { + Console.WriteLine("Create device failed:{0:x8}", nRet); + break; + } + + // ch:打开设备 | en:Open device + nRet = device.MV_CODEREADER_OpenDevice_NET(); + if (MvCodeReader.MV_CODEREADER_OK != nRet) + { + Console.WriteLine("Open device failed:{0:x8}", nRet); + // 刷新扫码器状态 + RefreshStateEvent?.Invoke("外侧", false); + break; + } + // 刷新扫码器状态 + RefreshStateEvent?.Invoke("内侧", true); + + // ch:注册回调函数 | en:Register image callback + ImageCallback = new MvCodeReader.cbOutputEx2delegate(LinerImageCallbackFunc); + nRet = device.MV_CODEREADER_RegisterImageCallBackEx2_NET(ImageCallback, IntPtr.Zero); + if (MvCodeReader.MV_CODEREADER_OK != nRet) + { + Console.WriteLine("Register image callback failed!"); + break; + } + + // ch:开启抓图 || en: start grab image + nRet = device.MV_CODEREADER_StartGrabbing_NET(); + if (MvCodeReader.MV_CODEREADER_OK != nRet) + { + Console.WriteLine("Start grabbing failed:{0:x8}", nRet); + break; + } + // 关闭使用 + ShellDevice = device; + + Console.WriteLine("Press enter to exit"); + Console.WriteLine(DateTime.Now.ToString()); + while (true) + { + Thread.Sleep(1000*60); + DateTime dateTime = DateTime.Now; + TimeSpan timeSpan = dateTime.Subtract(LinerLiveTime); + if (timeSpan.TotalMinutes >= 10) + { + Console.WriteLine("内侧扫码器超时"); + //CloseShell(); + //Shell(); + break; + } + + } + //Console.ReadLine(); + + // ch:停止抓图 | en:Stop grabbing + nRet = device.MV_CODEREADER_StopGrabbing_NET(); + if (MvCodeReader.MV_CODEREADER_OK != nRet) + { + Console.WriteLine("Stop grabbing failed{0:x8}", nRet); + break; + } + + // ch:关闭设备 | en:Close device + nRet = device.MV_CODEREADER_CloseDevice_NET(); + if (MvCodeReader.MV_CODEREADER_OK != nRet) + { + Console.WriteLine("Close device failed{0:x8}", nRet); + break; + } + + // ch:销毁设备 | en:Destroy device + nRet = device.MV_CODEREADER_DestroyHandle_NET(); + if (MvCodeReader.MV_CODEREADER_OK != nRet) + { + Console.WriteLine("Destroy device failed:{0:x8}", nRet); + break; + } + + } while (false); + + if (MvCodeReader.MV_CODEREADER_OK != nRet) + { + // ch:销毁设备 | en:Destroy device + nRet = device.MV_CODEREADER_DestroyHandle_NET(); + if (MvCodeReader.MV_CODEREADER_OK != nRet) + { + Console.WriteLine("Destroy device failed:{0:x8}", nRet); + } + } + Liner(); + + } + + /// + /// 关闭内胆扫码器 + /// + public static void CloseLiner() + { + int nRet = MvCodeReader.MV_CODEREADER_OK; + MvCodeReader device = LinerDevice; + // ch:停止抓图 | en:Stop grabbing + nRet = device.MV_CODEREADER_StopGrabbing_NET(); + if (MvCodeReader.MV_CODEREADER_OK != nRet) + { + Console.WriteLine("Stop grabbing failed{0:x8}", nRet); + return; + } + + // ch:关闭设备 | en:Close device + nRet = device.MV_CODEREADER_CloseDevice_NET(); + if (MvCodeReader.MV_CODEREADER_OK != nRet) + { + Console.WriteLine("Close device failed{0:x8}", nRet); + return; + } + + // ch:销毁设备 | en:Destroy device + nRet = device.MV_CODEREADER_DestroyHandle_NET(); + if (MvCodeReader.MV_CODEREADER_OK != nRet) + { + Console.WriteLine("Destroy device failed:{0:x8}", nRet); + return; + } + Console.WriteLine("关闭内胆扫码器成功"); + return; + } + + /// + /// 关闭箱壳扫码器 + /// + public static void CloseShell() + { + int nRet = MvCodeReader.MV_CODEREADER_OK; + MvCodeReader device = ShellDevice; + // ch:停止抓图 | en:Stop grabbing + nRet = device.MV_CODEREADER_StopGrabbing_NET(); + if (MvCodeReader.MV_CODEREADER_OK != nRet) + { + Console.WriteLine("Stop grabbing failed{0:x8}", nRet); + return; + } + + // ch:关闭设备 | en:Close device + nRet = device.MV_CODEREADER_CloseDevice_NET(); + if (MvCodeReader.MV_CODEREADER_OK != nRet) + { + Console.WriteLine("Close device failed{0:x8}", nRet); + return; + } + + // ch:销毁设备 | en:Destroy device + nRet = device.MV_CODEREADER_DestroyHandle_NET(); + if (MvCodeReader.MV_CODEREADER_OK != nRet) + { + Console.WriteLine("Destroy device failed:{0:x8}", nRet); + return; + } + Console.WriteLine("关闭箱壳扫码器成功"); + return; + } + + /// + /// 监测扫码器15分钟以内是否有触发操作,如果超时未触发,关闭再重连扫码器 + /// + public static void JudgeShellIsConnectedAndReConnect() + { + try + { + DateTime dateTime = DateTime.Now; + TimeSpan timeSpan = dateTime.Subtract(ShellLiveTime); + Task.Run(() => + { + if (timeSpan.TotalMinutes >= 1) + { + Console.WriteLine("箱壳扫码器超时,重连"); + ShellLiveTime = dateTime; + CloseShell(); + Shell(); + } + }); + Task.Run(() => + { + TimeSpan timeSpan2 = dateTime.Subtract(LinerLiveTime); + if (timeSpan2.TotalMinutes >= 1) + { + Console.WriteLine("内胆扫码器超时,重连"); + LinerLiveTime = dateTime; + CloseLiner(); + Liner(); + } + }); + + } + catch (Exception ex) + { + log.Error("JudgeShellIsConnectedAndReConnect判断扫码器重连方法异常:"+ex.Message.ToString()); + } + + } + + + #region 判断字符编码 + /// + /// 判断字符编码 + /// + /// + /// + public static bool IsTextUTF8(byte[] inputStream) + { + int encodingBytesCount = 0; + bool allTextsAreASCIIChars = true; + + for (int i = 0; i < inputStream.Length; i++) + { + byte current = inputStream[i]; + + if ((current & 0x80) == 0x80) + { + allTextsAreASCIIChars = false; + } + // First byte + if (encodingBytesCount == 0) + { + if ((current & 0x80) == 0) + { + // ASCII chars, from 0x00-0x7F + continue; + } + + if ((current & 0xC0) == 0xC0) + { + encodingBytesCount = 1; + current <<= 2; + + // More than two bytes used to encoding a unicode char. + // Calculate the real length. + while ((current & 0x80) == 0x80) + { + current <<= 1; + encodingBytesCount++; + } + } + else + { + // Invalid bits structure for UTF8 encoding rule. + return false; + } + } + else + { + // Following bytes, must start with 10. + if ((current & 0xC0) == 0x80) + { + encodingBytesCount--; + } + else + { + // Invalid bits structure for UTF8 encoding rule. + return false; + } + } + } + if (encodingBytesCount != 0) + { + // Invalid bits structure for UTF8 encoding rule. + // Wrong following bytes count. + return false; + } + // Although UTF8 supports encoding for ASCII chars, we regard as a input stream, whose contents are all ASCII as default encoding. + return !allTextsAreASCIIChars; + } + + #endregion + + + } +} diff --git a/Aucma.Core.Palletiz/Startup.cs b/Aucma.Core.Palletiz/Startup.cs index 757e6666..b2bf21a1 100644 --- a/Aucma.Core.Palletiz/Startup.cs +++ b/Aucma.Core.Palletiz/Startup.cs @@ -63,9 +63,9 @@ namespace Aucma.Core.Palletiz AddServices(services); // - services.AddJobSetup(); + //services.AddJobSetup(); //ɨ - services.AddScannerSetup(); + // services.AddScannerSetup(); //PLC services.AddPlcSetup(); //ֱ֧ȫ :֧ System.Text.Encoding.GetEncoding("GB2312") System.Text.Encoding.GetEncoding("GB18030") @@ -88,8 +88,7 @@ namespace Aucma.Core.Palletiz /// /// /// - public void Configure(IApplicationBuilder app, ISysTasksQzService tasksQzService, - ISchedulerCenter schedulerCenter, IScannerService scannerService, IRunPlcService runPlcService) + public void Configure(IApplicationBuilder app, IRunPlcService runPlcService) { // ʹþ̬ļ app.UseStaticFiles(); @@ -97,9 +96,9 @@ namespace Aucma.Core.Palletiz //app.UseAuthorization(); // QuartzNetJobȷ - app.UseQuartzJobMildd(tasksQzService, schedulerCenter); + //app.UseQuartzJobMildd(tasksQzService, schedulerCenter); //ɨ - app.UseScannerMildd(scannerService); + //app.UseScannerMildd(scannerService); //PLC app.UsePlcMildd(runPlcService); } diff --git a/Aucma.Core.Palletiz/ViewModels/HandPalletizViewModel.cs b/Aucma.Core.Palletiz/ViewModels/HandPalletizViewModel.cs index 463f248a..c68b7a3b 100644 --- a/Aucma.Core.Palletiz/ViewModels/HandPalletizViewModel.cs +++ b/Aucma.Core.Palletiz/ViewModels/HandPalletizViewModel.cs @@ -20,10 +20,14 @@ namespace Aucma.Core.Palletiz.ViewModels #endregion public static StackInfoModel tempStackInfo = new StackInfoModel(); - - public HandPalletizViewModel() { - - PromptInfo("请选择信息下传......", "White"); + + public HandPalletizViewModel() + { + + Range = 1; + SpaceNo =1; + InstoreBusiness.LogInStoreInfoDelegateEvent += PromptInfo; + PromptInfo("请选择信息下传......", "White"); } #region 分垛信息下传 @@ -35,18 +39,25 @@ namespace Aucma.Core.Palletiz.ViewModels { try { - PromptInfo("分垛信息下传中......", "White"); DialogResult cr = MessageBox.Show("是否确认下传分垛信息?", "系统提醒", MessageBoxButtons.OKCancel); if (cr != DialogResult.OK) { return; } - tempStackInfo.LevelNo = LevelNo; - tempStackInfo.BinNo = (BinNo - 1) * 2 + PortNo + ((LevelNo - 1) * 10); - tempStackInfo.PortNo = PortNo; - tempStackInfo.RangeNo = RangeNo; + PromptInfo("分垛信息下传中......", "White"); + + //tempStackInfo.BinNo = SpaceNo;//目的货道 + //tempStackInfo.RangeNo = RangeNo;//转向 + + int range = Range; + int spaceNo = SpaceNo; + if (spaceNo==0) + { + MessageBox.Show("请选择目的货道!","系统提醒"); + return; + } - bool backResult = InstoreBusiness.WritePlc(tempStackInfo); + bool backResult = InstoreBusiness.TempWritePlc(SpaceNo, range); if (backResult) { PromptInfo("分垛信息下传成功!", "White"); @@ -100,5 +111,29 @@ namespace Aucma.Core.Palletiz.ViewModels })); } #endregion + + + #region 目的货道 + + private int spaceNo; + + public int SpaceNo + { + get => spaceNo; + set => SetProperty(ref spaceNo, value); + } + #endregion + + + #region 方向 + + private int range; + + public int Range + { + get => range; + set => SetProperty(ref range, value); + } + #endregion } } diff --git a/Aucma.Core.Palletiz/ViewModels/MainWindowViewModel.cs b/Aucma.Core.Palletiz/ViewModels/MainWindowViewModel.cs index fb555eb6..d399ade8 100644 --- a/Aucma.Core.Palletiz/ViewModels/MainWindowViewModel.cs +++ b/Aucma.Core.Palletiz/ViewModels/MainWindowViewModel.cs @@ -15,6 +15,7 @@ using System.Windows.Threading; using System.Threading.Tasks; using Admin.Core.IService; using Microsoft.Extensions.DependencyInjection; +using Aucma.Core.Palletiz.Business; namespace Aucma.Core.Palletiz.ViewModels { @@ -35,8 +36,9 @@ namespace Aucma.Core.Palletiz.ViewModels { await RefreshTeamTime();//班组时间 }); - - + //测试开启 + //InstoreBusiness instore=new InstoreBusiness(); + //instore.test(); } public void init() @@ -110,7 +112,7 @@ namespace Aucma.Core.Palletiz.ViewModels public void RefreshScanner() { string ip1 = Appsettings.app("Middleware", "Scanner1", "Ip"); - bool flag1 = MvCodeHelper.ConnectionStatus(ip1); + bool flag1 = true;// MvCodeHelper.ConnectionStatus(ip1); Scanner1State(flag1); } #endregion diff --git a/Aucma.Core.Palletiz/Views/HandPalletizView.xaml b/Aucma.Core.Palletiz/Views/HandPalletizView.xaml index 01337351..991e6c7a 100644 --- a/Aucma.Core.Palletiz/Views/HandPalletizView.xaml +++ b/Aucma.Core.Palletiz/Views/HandPalletizView.xaml @@ -5,7 +5,7 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" WindowStartupLocation="CenterScreen" FontFamily="Microsoft YaHei" - Title="手动分垛" Height="600" Width="800" Name="window" Background="White" + Title="手动分垛" Height="800" Width="800" Name="window" Background="White" ResizeMode="NoResize" Topmost="True"> @@ -26,9 +26,7 @@ - - - + @@ -36,50 +34,60 @@ - + - +