liulb@mesnac.com 1 year ago
parent af79883b44
commit 32f2e8ca55

@ -285,7 +285,7 @@ namespace Admin.Core.Service
{ {
Expression<Func<BaseSpaceInfo, bool>> exp = s1 => true; Expression<Func<BaseSpaceInfo, bool>> exp = s1 => true;
exp = exp.And(x => x.MaterialType == null && x.StoreCode == store && x.SpaceCapacity != x.SpaceStock); 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) catch (Exception ex)
{ {

@ -47,7 +47,8 @@ namespace Admin.Core.Service
{ {
try try
{ {
List<RecordInstore> preCordList = await _recordInstoreRepository.QueryAsync(d =>d.StoreCode.Equals(storeCode) && d.CreatedTime >= startTime&& d.CreatedTime <= endTime); storeCode = "FPJCK-001";
List<RecordInstore> preCordList = await _recordInstoreRepository.QueryAsync(d =>d.StoreCode.Equals(storeCode) );//&& d.CreatedTime >= startTime&& d.CreatedTime <= endTime
if (preCordList.Count() == 0) return null; if (preCordList.Count() == 0) return null;
var proList = _productPlanInfoRepository.Query(); var proList = _productPlanInfoRepository.Query();
if (proList.Count() == 0) return null; if (proList.Count() == 0) return null;

@ -52,7 +52,7 @@ namespace Admin.Core.Tasks
} }
public async Task Run(IJobExecutionContext context) 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) if (obj.IsConnect)
{ {
var val = obj.plc.ReadBool("M100");//出发出库点位 var val = obj.plc.ReadBool("M100");//出发出库点位

@ -7,6 +7,7 @@ using Admin.Core.Model;
using Admin.Core.Repository; using Admin.Core.Repository;
using Admin.Core.Service; using Admin.Core.Service;
using Admin.Core.Tasks; using Admin.Core.Tasks;
using Aucma.Core.RunPlc;
using Autofac; using Autofac;
using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Hosting;
@ -61,8 +62,9 @@ namespace Aucma.Core.BoxFoam
AddServices(services); AddServices(services);
//任务调度 //任务调度
//services.AddJobSetup(); services.AddJobSetup();
//PLC
services.AddPlcSetup();
//支持编码大全 例如:支持 System.Text.Encoding.GetEncoding("GB2312") System.Text.Encoding.GetEncoding("GB18030") //支持编码大全 例如:支持 System.Text.Encoding.GetEncoding("GB2312") System.Text.Encoding.GetEncoding("GB18030")
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance); Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
} }
@ -83,7 +85,7 @@ namespace Aucma.Core.BoxFoam
/// </summary> /// </summary>
/// <param name="app"></param> /// <param name="app"></param>
/// <param name="env"></param> /// <param name="env"></param>
public void Configure(IApplicationBuilder app)//, ISysTasksQzService tasksQzService, ISchedulerCenter schedulerCenter public void Configure(IApplicationBuilder app, ISysTasksQzService tasksQzService, ISchedulerCenter schedulerCenter, IRunPlcService runPlcService)//
{ {
// 使用静态文件 // 使用静态文件
app.UseStaticFiles(); app.UseStaticFiles();
@ -91,8 +93,9 @@ namespace Aucma.Core.BoxFoam
//app.UseAuthorization(); //app.UseAuthorization();
// 开启QuartzNetJob调度服务 // 开启QuartzNetJob调度服务
//app.UseQuartzJobMildd(tasksQzService, schedulerCenter); app.UseQuartzJobMildd(tasksQzService, schedulerCenter);
//PLC
app.UsePlcMildd(runPlcService);
} }
#region 注册服务 #region 注册服务

@ -29,6 +29,7 @@ namespace Aucma.Core.BoxFoam.ViewModels
// Job_TestTask_Quartz.DataGridDelegateEvent += ExecMethod;//刷新日志 // Job_TestTask_Quartz.DataGridDelegateEvent += ExecMethod;//刷新日志
Job_BoxFoamInStoreTask_Quartz.RefreshScanMateriaCodeEvent += RefreshScanInfo;//扫码信息刷新 Job_BoxFoamInStoreTask_Quartz.RefreshScanMateriaCodeEvent += RefreshScanInfo;//扫码信息刷新
Job_BoxFoamInStoreTask_Quartz.LogDelegateEvent += PrintMessageToListBox;//入库日志事件 Job_BoxFoamInStoreTask_Quartz.LogDelegateEvent += PrintMessageToListBox;//入库日志事件
} }
public async Task ExecMethod() public async Task ExecMethod()

@ -105,7 +105,7 @@
"Remark": "执行任务调度系统", "Remark": "执行任务调度系统",
"RunTimes": 3881, "RunTimes": 3881,
"BeginTime": "2023-04-23 11:08:50.000", "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, "TriggerType": 1,
"IntervalSecond": 1, "IntervalSecond": 1,
"CycleRunTimes": 1, "CycleRunTimes": 1,
@ -123,11 +123,11 @@
"JobGroup": "DEFAULT", "JobGroup": "DEFAULT",
"Cron": "*/1 * * * * ?", "Cron": "*/1 * * * * ?",
"AssemblyName": "Admin.Core.Tasks", "AssemblyName": "Admin.Core.Tasks",
"ClassName": "Job_TestTask_Quartz", "ClassName": "Job_BoxFoamInStoreTask_Quartz",
"Remark": "执行任务调度系统", "Remark": "执行箱体入库任务调度系统,",
"RunTimes": 3881, "RunTimes": 3881,
"BeginTime": "2023-04-23 11:08:50.000", "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, "TriggerType": 1,
"IntervalSecond": 1, "IntervalSecond": 1,
"CycleRunTimes": 1, "CycleRunTimes": 1,
@ -145,11 +145,11 @@
"JobGroup": "DEFAULT", "JobGroup": "DEFAULT",
"Cron": "*/15 * * * * ?", "Cron": "*/15 * * * * ?",
"AssemblyName": "Admin.Core.Tasks", "AssemblyName": "Admin.Core.Tasks",
"ClassName": "Job_PQInStoreTask_Quartz", "ClassName": "Job_BoxFoamOutStore_Quartz",
"Remark": "泡前库入库调度任务", "Remark": "泡前库入库调度任务",
"RunTimes": 3881, "RunTimes": 3881,
"BeginTime": "2023-04-23 11:08:50.000", "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, "TriggerType": 1,
"IntervalSecond": 1, "IntervalSecond": 1,
"CycleRunTimes": 1, "CycleRunTimes": 1,
@ -221,6 +221,14 @@
"Enabled": true "Enabled": true
} }
}, },
"PLCServer": [
{
"Id": 1,
"EquipName": "泡前库Plc",
"IP": "127.0.0.1",
"Port": 6000
}
],
"IpRateLimiting": { "IpRateLimiting": {
"EnableEndpointRateLimiting": false, //False: globally executed, true: executed for each "EnableEndpointRateLimiting": false, //False: globally executed, true: executed for each
"StackBlockedRequests": false, //False: Number of rejections should be recorded on another counter "StackBlockedRequests": false, //False: Number of rejections should be recorded on another counter

@ -161,7 +161,7 @@
<TextBlock Text="当前工位" Foreground="White"/> <TextBlock Text="当前工位" Foreground="White"/>
</Border> </Border>
<Border Grid.Row="1" Grid.RowSpan="3" Grid.Column="0" Background="#1157b9"> <Border Grid.Row="1" Grid.RowSpan="3" Grid.Column="0" Background="#1157b9">
<TextBlock Text="产品下线扫描" Foreground="White" FontWeight="Bold" FontSize="25"/> <TextBlock Text="产品分垛" Foreground="White" FontWeight="Bold" FontSize="25"/>
</Border> </Border>
<Border Grid.Row="0" Grid.Column="1" Background="#1157b9"> <Border Grid.Row="0" Grid.Column="1" Background="#1157b9">
<TextBlock Text="产品条码" Foreground="White" /> <TextBlock Text="产品条码" Foreground="White" />

Loading…
Cancel
Save