| | |
| | | using Mapster; |
| | | using Masuit.Tools; |
| | | using Newtonsoft.Json; |
| | | using Quartz; |
| | | using System.Diagnostics.CodeAnalysis; |
| | | using System.Text; |
| | | using WIDESEAWCS_BasicInfoRepository; |
| | | using WIDESEAWCS_Common; |
| | | using WIDESEAWCS_Common.TaskEnum; |
| | |
| | | bool sendFlag = commonStackerCrane.SendCommand(stackerCraneTaskCommand); |
| | | if (sendFlag) |
| | | { |
| | | StringBuilder builder = new StringBuilder(); |
| | | builder.AppendLine(); |
| | | builder.AppendLine($"【{commonStackerCrane.DeviceName}】堆垛机状态:【{commonStackerCrane.StackerCraneStatusDes}】,时间:【{DateTime.Now}】"); |
| | | builder.AppendLine($"【{commonStackerCrane.DeviceName}】手自动状态:【{commonStackerCrane.StackerCraneAutoStatusDes}】,时间:【{DateTime.Now}】"); |
| | | builder.AppendLine($"【{commonStackerCrane.DeviceName}】作业状态:【{commonStackerCrane.StackerCraneWorkStatusDes}】,时间:【{DateTime.Now}】"); |
| | | builder.AppendLine($"【{commonStackerCrane.DeviceName}】下发任务成功,【{JsonConvert.SerializeObject(stackerCraneTaskCommand, Formatting.Indented)}】"); |
| | | builder.AppendLine($"时间:【{DateTime.Now}】"); |
| | | builder.AppendLine(); |
| | | ConsoleHelper.WriteColorLine(builder, ConsoleColor.Blue); |
| | | //StringBuilder builder = new StringBuilder(); |
| | | //builder.AppendLine(); |
| | | //builder.AppendLine($"【{commonStackerCrane.DeviceName}】堆垛机状态:【{commonStackerCrane.StackerCraneStatusDes}】,时间:【{DateTime.Now}】"); |
| | | //builder.AppendLine($"【{commonStackerCrane.DeviceName}】手自动状态:【{commonStackerCrane.StackerCraneAutoStatusDes}】,时间:【{DateTime.Now}】"); |
| | | //builder.AppendLine($"【{commonStackerCrane.DeviceName}】作业状态:【{commonStackerCrane.StackerCraneWorkStatusDes}】,时间:【{DateTime.Now}】"); |
| | | //builder.AppendLine($"【{commonStackerCrane.DeviceName}】下发任务成功,【{JsonConvert.SerializeObject(stackerCraneTaskCommand, Formatting.Indented)}】"); |
| | | //builder.AppendLine($"时间:【{DateTime.Now}】"); |
| | | //builder.AppendLine(); |
| | | //ConsoleHelper.WriteColorLine(builder, ConsoleColor.Blue); |
| | | commonStackerCrane.LastTaskType = task.TaskType; |
| | | _taskService.UpdateTaskStatusToNext(task.TaskNum); |
| | | } |
| | |
| | | } |
| | | |
| | | var content = _taskService.StackCraneTaskCompleted(e.TaskNum); |
| | | if (commonStackerCrane.DeviceCode.Contains("CH") && task.TaskType == (int)TaskOutboundTypeEnum.Outbound) |
| | | if ((commonStackerCrane.DeviceCode.Contains("CH") || commonStackerCrane.DeviceCode.Contains("JZ")) && task.TaskType == (int)TaskOutboundTypeEnum.Outbound) |
| | | { |
| | | task = _taskRepository.QueryFirst(x => x.TaskNum == e.TaskNum); |
| | | Dt_Task? newTask = _taskService.UpdatePosition(task.TaskNum, task.CurrentAddress); |
| | |
| | | { |
| | | var value = _sys_ConfigService.GetByConfigKey(CateGoryConst.CONFIG_SYS_InStation, SysConfigKeyConst.JZNGInBoundStation).ConfigValue; |
| | | var valueList = value.Split(',').ToList(); |
| | | if ((valueList.Contains(task.SourceAddress)) && task.Roadway.Contains("CH") || task.Roadway.Contains("JZ")) |
| | | if ((valueList.Contains(task.SourceAddress)) && (task.Roadway.Contains("CH") || task.Roadway.Contains("JZ"))) |
| | | { |
| | | string[] souredCodes = task.CurrentAddress.Split("-"); |
| | | if (souredCodes.Length == 3) |