diff --git a/Admin.Core.Service/Service_New/BaseSpaceInfoServices.cs b/Admin.Core.Service/Service_New/BaseSpaceInfoServices.cs index be32335f..ceee6925 100644 --- a/Admin.Core.Service/Service_New/BaseSpaceInfoServices.cs +++ b/Admin.Core.Service/Service_New/BaseSpaceInfoServices.cs @@ -285,7 +285,7 @@ namespace Admin.Core.Service { Expression> exp = s1 => true; exp = exp.And(x => x.MaterialType == null && x.StoreCode == store && x.SpaceCapacity != x.SpaceStock); - spaceInfos =await _dal.QueryAsync(exp); + spaceInfos =await _dal.QueryAsync(x => x.MaterialType == null && x.StoreCode == store && x.SpaceCapacity != x.SpaceStock); } catch (Exception ex) { diff --git a/Admin.Core.Service/Service_New/RecordInstoreServices.cs b/Admin.Core.Service/Service_New/RecordInstoreServices.cs index 3d588bb2..2cf7e698 100644 --- a/Admin.Core.Service/Service_New/RecordInstoreServices.cs +++ b/Admin.Core.Service/Service_New/RecordInstoreServices.cs @@ -47,7 +47,8 @@ namespace Admin.Core.Service { try { - List preCordList = await _recordInstoreRepository.QueryAsync(d =>d.StoreCode.Equals(storeCode) && d.CreatedTime >= startTime&& d.CreatedTime <= endTime); + storeCode = "FPJCK-001"; + List preCordList = await _recordInstoreRepository.QueryAsync(d =>d.StoreCode.Equals(storeCode) );//&& d.CreatedTime >= startTime&& d.CreatedTime <= endTime if (preCordList.Count() == 0) return null; var proList = _productPlanInfoRepository.Query(); if (proList.Count() == 0) return null; diff --git a/Admin.Core.Tasks/QuartzNet/Jobs/Job_BoxFoamOutStore_Quartz.cs b/Admin.Core.Tasks/QuartzNet/Jobs/Job_BoxFoamOutStore_Quartz.cs index d5dfc0fb..211b835b 100644 --- a/Admin.Core.Tasks/QuartzNet/Jobs/Job_BoxFoamOutStore_Quartz.cs +++ b/Admin.Core.Tasks/QuartzNet/Jobs/Job_BoxFoamOutStore_Quartz.cs @@ -52,7 +52,7 @@ namespace Admin.Core.Tasks } public async Task Run(IJobExecutionContext context) { - var obj = PlcHelper.melsecList.FirstOrDefault(d => d.EquipName.Equals("泡前库")); + var obj = PlcHelper.melsecList.FirstOrDefault(d => d.EquipName.Equals("泡前库Plc")); if (obj.IsConnect) { var val = obj.plc.ReadBool("M100");//出发出库点位 diff --git a/Aucma.Core.BoxFoam/Startup.cs b/Aucma.Core.BoxFoam/Startup.cs index 7d31283f..7b358d95 100644 --- a/Aucma.Core.BoxFoam/Startup.cs +++ b/Aucma.Core.BoxFoam/Startup.cs @@ -7,6 +7,7 @@ using Admin.Core.Model; using Admin.Core.Repository; using Admin.Core.Service; using Admin.Core.Tasks; +using Aucma.Core.RunPlc; using Autofac; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; @@ -61,8 +62,9 @@ namespace Aucma.Core.BoxFoam AddServices(services); // - //services.AddJobSetup(); - + services.AddJobSetup(); + //PLC + services.AddPlcSetup(); //ֱ֧ȫ :֧ System.Text.Encoding.GetEncoding("GB2312") System.Text.Encoding.GetEncoding("GB18030") Encoding.RegisterProvider(CodePagesEncodingProvider.Instance); } @@ -83,7 +85,7 @@ namespace Aucma.Core.BoxFoam /// /// /// - public void Configure(IApplicationBuilder app)//, ISysTasksQzService tasksQzService, ISchedulerCenter schedulerCenter + public void Configure(IApplicationBuilder app, ISysTasksQzService tasksQzService, ISchedulerCenter schedulerCenter, IRunPlcService runPlcService)// { // ʹþ̬ļ app.UseStaticFiles(); @@ -91,8 +93,9 @@ namespace Aucma.Core.BoxFoam //app.UseAuthorization(); // QuartzNetJobȷ - //app.UseQuartzJobMildd(tasksQzService, schedulerCenter); - + app.UseQuartzJobMildd(tasksQzService, schedulerCenter); + //PLC + app.UsePlcMildd(runPlcService); } #region ע diff --git a/Aucma.Core.BoxFoam/ViewModels/IndexPageViewModel.cs b/Aucma.Core.BoxFoam/ViewModels/IndexPageViewModel.cs index 4fd253b2..35cdc717 100644 --- a/Aucma.Core.BoxFoam/ViewModels/IndexPageViewModel.cs +++ b/Aucma.Core.BoxFoam/ViewModels/IndexPageViewModel.cs @@ -29,6 +29,7 @@ namespace Aucma.Core.BoxFoam.ViewModels // Job_TestTask_Quartz.DataGridDelegateEvent += ExecMethod;//刷新日志 Job_BoxFoamInStoreTask_Quartz.RefreshScanMateriaCodeEvent += RefreshScanInfo;//扫码信息刷新 Job_BoxFoamInStoreTask_Quartz.LogDelegateEvent += PrintMessageToListBox;//入库日志事件 + } public async Task ExecMethod() diff --git a/Aucma.Core.BoxFoam/appsettings.json b/Aucma.Core.BoxFoam/appsettings.json index f31fae20..adb844b2 100644 --- a/Aucma.Core.BoxFoam/appsettings.json +++ b/Aucma.Core.BoxFoam/appsettings.json @@ -105,7 +105,7 @@ "Remark": "执行任务调度系统", "RunTimes": 3881, "BeginTime": "2023-04-23 11:08:50.000", - "EndTime": "2324-08-06 16:45:30.000", + "EndTime": "2224-08-06 16:45:30.000", "TriggerType": 1, "IntervalSecond": 1, "CycleRunTimes": 1, @@ -123,11 +123,11 @@ "JobGroup": "DEFAULT", "Cron": "*/1 * * * * ?", "AssemblyName": "Admin.Core.Tasks", - "ClassName": "Job_TestTask_Quartz", - "Remark": "执行任务调度系统", + "ClassName": "Job_BoxFoamInStoreTask_Quartz", + "Remark": "执行箱体入库任务调度系统,", "RunTimes": 3881, "BeginTime": "2023-04-23 11:08:50.000", - "EndTime": "2324-08-06 16:45:30.000", + "EndTime": "2224-08-06 16:45:30.000", "TriggerType": 1, "IntervalSecond": 1, "CycleRunTimes": 1, @@ -145,11 +145,11 @@ "JobGroup": "DEFAULT", "Cron": "*/15 * * * * ?", "AssemblyName": "Admin.Core.Tasks", - "ClassName": "Job_PQInStoreTask_Quartz", + "ClassName": "Job_BoxFoamOutStore_Quartz", "Remark": "泡前库入库调度任务", "RunTimes": 3881, "BeginTime": "2023-04-23 11:08:50.000", - "EndTime": "2324-08-06 16:45:30.000", + "EndTime": "2224-08-06 16:45:30.000", "TriggerType": 1, "IntervalSecond": 1, "CycleRunTimes": 1, @@ -221,6 +221,14 @@ "Enabled": true } }, + "PLCServer": [ + { + "Id": 1, + "EquipName": "泡前库Plc", + "IP": "127.0.0.1", + "Port": 6000 + } + ], "IpRateLimiting": { "EnableEndpointRateLimiting": false, //False: globally executed, true: executed for each "StackBlockedRequests": false, //False: Number of rejections should be recorded on another counter diff --git a/Aucma.Core.Palletiz/Views/IndexPageView.xaml b/Aucma.Core.Palletiz/Views/IndexPageView.xaml index f7e6e2dd..0df3b904 100644 --- a/Aucma.Core.Palletiz/Views/IndexPageView.xaml +++ b/Aucma.Core.Palletiz/Views/IndexPageView.xaml @@ -161,7 +161,7 @@ - +