| | |
| | | using WIDESEAWCS_Common.TaskEnum; |
| | | using WIDESEAWCS_Core; |
| | | using WIDESEAWCS_Core.Helper; |
| | | using WIDESEAWCS_Core.LogHelper; |
| | | using WIDESEAWCS_DTO.TaskInfo; |
| | | using WIDESEAWCS_Model.Models; |
| | | using WIDESEAWCS_QuartzJob; |
| | | |
| | | namespace WIDESEAWCS_TaskInfoService |
| | | { |
| | |
| | | // 检查是否已存在直接出库任务 |
| | | private async Task<bool> HasDirectOutboundTask(Dt_StationManager stationManager) |
| | | { |
| | | var station = await _stationManagerRepository.QueryFirstAsync(x => x.stationType == 6 && x.productLine == stationManager.productLine && x.stationArea == stationManager.stationArea); |
| | | var station = await _stationManagerRepository.QueryFirstAsync(x => x.stationType == 6 && x.productLine == stationManager.productLine && x.stationArea == stationManager.stationArea && x.Roadway == stationManager.Roadway); |
| | | var tasks = await BaseDal.QueryFirstAsync(x => x.TaskType == (int)TaskOutboundTypeEnum.InToOut && x.TargetAddress == stationManager.stationLocation && x.CurrentAddress == station.stationChildCode); |
| | | return tasks != null; |
| | | } |
| | |
| | | // 处理 stationType 为 7 的情况 |
| | | private async Task<WebResponseContent> HandleStationType7(string palletCode, Dt_StationManager stationManager) |
| | | { |
| | | var station = await _stationManagerRepository.QueryFirstAsync(x => x.stationType == 6 && x.productLine == stationManager.productLine && x.stationArea == stationManager.stationArea); |
| | | var station = await _stationManagerRepository.QueryFirstAsync(x => x.stationType == 6 && x.productLine == stationManager.productLine && x.stationArea == stationManager.stationArea && x.Roadway == stationManager.Roadway); |
| | | var runTask = await BaseDal.QueryFirstAsync(x => x.CurrentAddress == station.stationChildCode && x.TaskState == (int)TaskInStatusEnum.Line_InFinish && x.TaskType == (int)TaskInboundTypeEnum.InTray); |
| | | |
| | | if (runTask != null) |
| | |
| | | // 处理 stationType 为 6 的情况 |
| | | private async Task<WebResponseContent> HandleStationType6(string palletCode, Dt_StationManager stationManager) |
| | | { |
| | | var emptyStation = await _stationManagerRepository.QueryFirstAsync(x => x.stationType == 7 && x.productLine == stationManager.productLine && x.stationArea == stationManager.stationArea); |
| | | var emptyStation = await _stationManagerRepository.QueryFirstAsync(x => x.stationType == 7 && x.productLine == stationManager.productLine && x.stationArea == stationManager.stationArea && x.Roadway==stationManager.Roadway); |
| | | var runTask = await BaseDal.QueryFirstAsync(x => x.NextAddress == emptyStation.stationChildCode && x.TaskState == (int)TaskInStatusEnum.Line_InFinish && x.TaskType == (int)TaskInboundTypeEnum.InTray); |
| | | |
| | | if (runTask != null) |
| | |
| | | var task = BaseDal.QueryFirst(x => x.TaskNum == taskNum); |
| | | if (task == null) return WebResponseContent.Instance.Error($"未找到该任务信息,任务号:【{taskNum}】"); |
| | | |
| | | //if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup && task.TaskState == (int)TaskOutStatusEnum.SC_OutExecuting) |
| | | //{ |
| | | // //todo |
| | | |
| | | //} |
| | | //else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup && task.TaskState == (int)TaskInStatusEnum.SC_InExecuting) |
| | | //{ |
| | | // //todo 同步到WMS |
| | | |
| | | // BaseDal.DeleteData(task); |
| | | |
| | | //} |
| | | //else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.RelocationGroup) |
| | | //{ |
| | | // //todo 调用WMS移库完成 |
| | | //} |
| | | //else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OtherGroup) |
| | | //{ |
| | | //} |
| | | //else |
| | | //{ |
| | | // throw new Exception($"任务类型错误,未找到该任务类型,任务号:【{taskNum}】,任务类型:【{task.TaskType}】"); |
| | | //} |
| | | |
| | | #region WMS同步任务完成 |
| | | |
| | | var keys = new Dictionary<string, object>() |
| | |
| | | catch (Exception ex) |
| | | { |
| | | content = WebResponseContent.Instance.Error($"任务完成异常,任务号:【{taskNum}】"); |
| | | QuartzLogger.WriteLogToFile($"Info_分容任务完成", $"任务完成异常,任务号:【{taskNum}】异常信息【{ex.StackTrace}】{Environment.NewLine}{Environment.NewLine}"); |
| | | } |
| | | QuartzLogger.WriteLogToFile($"Info_分容任务完成", $"任务完成,任务号:【{taskNum}】返回参数【{JsonConvert.SerializeObject(content)}】{Environment.NewLine}{Environment.NewLine}"); |
| | | return content; |
| | | } |
| | | } |