Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs
@@ -180,7 +180,8 @@ var tokenInfos = _cacheService.Get<List<UserInfo>>("Cache_UserToken"); if (tokenInfos == null || !tokenInfos.Any()) { throw new Exception(conveyorLine.DeviceName + "缓存中未找到Token缓存"); //throw new Exception(conveyorLine.DeviceName + "缓存中未找到Token缓存"); return; } var userTokenIds = tokenInfos?.Select(x => x.Token_ID).ToList(); var userIds = tokenInfos?.Select(x => x.UserId).ToList(); Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_After/CommonConveyorLine_AfterJob.cs
@@ -107,7 +107,8 @@ var tokenInfos = _cacheService.Get<List<UserInfo>>("Cache_UserToken"); if (tokenInfos == null || !tokenInfos.Any()) { throw new Exception(conveyorLine.DeviceName + "缓存中未找到Token缓存"); //throw new Exception(conveyorLine.DeviceName + "缓存中未找到Token缓存"); continue; } var userTokenIds = tokenInfos?.Select(x => x.Token_ID).ToList(); var userIds = tokenInfos?.Select(x => x.UserId).ToList(); Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/CommonConveyorLine_GWJob.cs
@@ -170,7 +170,8 @@ var tokenInfos = _cacheService.Get<List<UserInfo>>("Cache_UserToken"); if (tokenInfos == null || !tokenInfos.Any()) { throw new Exception(conveyorLine.DeviceName + "缓存中未找到Token缓存"); //throw new Exception(conveyorLine.DeviceName + "缓存中未找到Token缓存"); continue; } var userTokenIds = tokenInfos?.Select(x => x.Token_ID).ToList(); var userIds = tokenInfos?.Select(x => x.UserId).ToList(); Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs
@@ -96,7 +96,8 @@ var tokenInfos = _cacheService.Get<List<UserInfo>>("Cache_UserToken"); if (tokenInfos == null || !tokenInfos.Any()) { throw new Exception(commonStackerCrane.DeviceName + "缓存中未找到Token缓存"); //throw new Exception(commonStackerCrane.DeviceName + "缓存中未找到Token缓存"); return Task.CompletedTask; } var userTokenIds = tokenInfos?.Select(x => x.Token_ID).ToList(); var userIds = tokenInfos?.Select(x => x.UserId).ToList(); @@ -151,7 +152,15 @@ if (device != null) { CommonConveyorLine_GW conveyorLine = (CommonConveyorLine_GW)device; conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineBarcode, task.PalletCode, task.TargetAddress); var isResult = conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineBarcode, task.PalletCode, task.TargetAddress); if (!isResult) { var result = conveyorLine.GetValue<ConveyorLineDBName_After, string>(ConveyorLineDBName_After.ConveyorLineBarcode, task.TargetAddress); if(result!= task.PalletCode) { conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineBarcode, task.PalletCode, task.TargetAddress); } } } else return; Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerStationJob/CommonStackerStationCraneJob.cs
@@ -4,7 +4,9 @@ using System.Diagnostics.CodeAnalysis; using WIDESEAWCS_BasicInfoRepository; using WIDESEAWCS_Common.TaskEnum; using WIDESEAWCS_Core.Caches; using WIDESEAWCS_Core.Helper; using WIDESEAWCS_Core.HttpContextUser; using WIDESEAWCS_DTO.MOM; using WIDESEAWCS_IProcessRepository; using WIDESEAWCS_ITaskInfoRepository; @@ -16,6 +18,7 @@ using WIDESEAWCS_QuartzJob.Models; using WIDESEAWCS_QuartzJob.Service; using WIDESEAWCS_QuartzJob.StackerCrane.Enum; using WIDESEAWCS_SignalR; using WIDESEAWCS_Tasks.StackerCraneJob; namespace WIDESEAWCS_Tasks @@ -28,14 +31,18 @@ private readonly ITaskRepository _taskRepository; private readonly IProcessRepository _processRepository; private readonly IDt_StationManagerRepository _stationManagerRepository; private readonly ICacheService _cacheService; private readonly INoticeService _noticeService; public CommonStackerStationCraneJob(ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IRouterService routerService, IProcessRepository processRepository, IDt_StationManagerRepository stationManagerRepository) public CommonStackerStationCraneJob(ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IRouterService routerService, IProcessRepository processRepository, IDt_StationManagerRepository stationManagerRepository, ICacheService cacheService, INoticeService noticeService) { _taskService = taskService; _taskExecuteDetailService = taskExecuteDetailService; _taskRepository = taskRepository; _processRepository = processRepository; _stationManagerRepository = stationManagerRepository; _cacheService = cacheService; _noticeService = noticeService; } public Task Execute(IJobExecutionContext context) @@ -78,6 +85,31 @@ } } } #region 调用事件总线通知前端 var tokenInfos = _cacheService.Get<List<UserInfo>>("Cache_UserToken"); if (tokenInfos == null || !tokenInfos.Any()) { //throw new Exception(commonStackerCrane.DeviceName + "缓存中未找到Token缓存"); return Task.CompletedTask; } var userTokenIds = tokenInfos?.Select(x => x.Token_ID).ToList(); var userIds = tokenInfos?.Select(x => x.UserId).ToList(); object obj = new { commonStackerCrane.StackerCraneStatusDes, commonStackerCrane.StackerCraneAutoStatusDes, commonStackerCrane.StackerCraneWorkStatusDes, commonStackerCrane.DeviceCode, commonStackerCrane.DeviceName, commonStackerCrane.CurrentTaskNum, commonStackerCrane.LastTaskNum, }; _noticeService.StackerData(userIds?.FirstOrDefault(), userTokenIds, new { commonStackerCrane.DeviceName, data = obj }); #endregion 调用事件总线通知前端 } } catch (Exception ex) Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs
@@ -102,6 +102,7 @@ // 更新库存状态和任务状态 (var loc, var tas) = UpdateStockAndTaskStatus(stock, task); var taskHty = task.Adapt<Dt_Task_Hty>(); // 事务处理 await _unitOfWorkManage.UseTranAsync(async () => @@ -114,6 +115,7 @@ await UpdateLocationAsync(loc); //if (task.Roadway.Contains("FR") || task.Roadway.Contains("GW") || task.TaskType == (int)TaskOutboundTypeEnum.OutTray) //如果是分容或高温出库 将任务删除 await DeleteTaskAsync(task.TaskId); await AddTaskHtyAsync(taskHty); }); return content.OK("任务完成成功", task.Remark); @@ -236,6 +238,15 @@ } } private async Task AddTaskHtyAsync(Dt_Task_Hty taskHty) { var isTaskAdd = await _task_HtyRepository.AddDataAsync(taskHty) > 0; if (!isTaskAdd) { throw new Exception("历史任务信息添加失败"); } } #endregion 出库任务完成 #region 移库任务完成