dev
liuwf 1 year ago
parent 50c15c9346
commit a44845ea19

@ -90,6 +90,8 @@ namespace Admin.Core.Tasks
private string storeCode = Appsettings.app("StoreInfo", "BeforeStoreCode");//泡前库code private string storeCode = Appsettings.app("StoreInfo", "BeforeStoreCode");//泡前库code
private List<BaseSpaceInfo> allSpaces = null; private List<BaseSpaceInfo> allSpaces = null;
private List<SpaceAddress> spaceAddresses = new List<SpaceAddress>(); private List<SpaceAddress> spaceAddresses = new List<SpaceAddress>();
private SemaphoreSlim _lock = new SemaphoreSlim(1);
public Job_BoxFoamInStoreTask_Quartz(ISysTasksQzService SysTasksQzService, ISysJobLogService sysJobLogService, public Job_BoxFoamInStoreTask_Quartz(ISysTasksQzService SysTasksQzService, ISysJobLogService sysJobLogService,
IBaseSpaceInfoServices baseSpaceInfoServices, IRealTaskInfoServices realTaskInfoService, IBaseSpaceInfoServices baseSpaceInfoServices, IRealTaskInfoServices realTaskInfoService,
IProductPlanInfoServices productPlanInfoServices, IRecordInStoreServices recordInstoreServices, IProductPlanInfoServices productPlanInfoServices, IRecordInStoreServices recordInstoreServices,
@ -119,7 +121,7 @@ namespace Admin.Core.Tasks
public async Task Execute(IJobExecutionContext context) public async Task Execute(IJobExecutionContext context)
{ {
// 获取任务下发plc // 获取任务下发plc
// await ExecuteJob(context, async () => await PassDown(context)); await ExecuteJob(context, async () => await PassDown(context));
// 监测入库,出库完成信号 // 监测入库,出库完成信号
// await ExecuteJob(context, async () => await RealInstoreFinish(context)); // await ExecuteJob(context, async () => await RealInstoreFinish(context));
} }
@ -153,6 +155,8 @@ namespace Admin.Core.Tasks
public async Task PassDown(IJobExecutionContext context) public async Task PassDown(IJobExecutionContext context)
{ {
try
{
RealTaskInfo taskInfo = await GetAwaitSendTask(storeCode); RealTaskInfo taskInfo = await GetAwaitSendTask(storeCode);
if (taskInfo != null) if (taskInfo != null)
{ {
@ -164,6 +168,7 @@ namespace Admin.Core.Tasks
logHelper.Info($"箱壳入库任务:{taskInfo.TaskCode};开始执行"); logHelper.Info($"箱壳入库任务:{taskInfo.TaskCode};开始执行");
taskInfo.TaskStatus = 2; taskInfo.TaskStatus = 2;
await _realTaskInfoService.UpdateAsync(taskInfo); await _realTaskInfoService.UpdateAsync(taskInfo);
#region 更新在途数 #region 更新在途数
BaseSpaceInfo spaceInfo = await _baseSpaceInfoServices.GetSpaceInfoBySpaceCode(taskInfo.StoreCode, taskInfo.SpaceCode); BaseSpaceInfo spaceInfo = await _baseSpaceInfoServices.GetSpaceInfoBySpaceCode(taskInfo.StoreCode, taskInfo.SpaceCode);
spaceInfo.OnRouteAmount += 1; spaceInfo.OnRouteAmount += 1;
@ -185,6 +190,14 @@ namespace Admin.Core.Tasks
{ {
logHelper.Info("未获取到需要下发的泡后入库任务"); logHelper.Info("未获取到需要下发的泡后入库任务");
} }
}
catch (Exception ex)
{
logHelper.Info("下发任务异常");
}
} }
/// <summary> /// <summary>
/// 获取待执行的入库任务 /// 获取待执行的入库任务

Loading…
Cancel
Save