| | |
| | | using Microsoft.AspNetCore.Components.Routing; |
| | | using Newtonsoft.Json; |
| | | using Quartz; |
| | | using SqlSugar.Extensions; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | |
| | | using WIDESEAWCS_Common.TaskEnum; |
| | | using WIDESEAWCS_Communicator; |
| | | using WIDESEAWCS_Core; |
| | | using WIDESEAWCS_Core.Helper; |
| | | using WIDESEAWCS_DTO.TaskInfo; |
| | | using WIDESEAWCS_IBasicInfoRepository; |
| | | using WIDESEAWCS_ITaskInfoRepository; |
| | |
| | | WriteError(item.StationName, $"è·¯ç±ä¿¡æ¯é
ç½®é误,设å¤ç¼å·:{item.StationCode},ä»»å¡å·:{task.TaskNum}"); |
| | | continue; |
| | | } |
| | | device.SetValue(W_ConveyorLineCPDB.W_TargetAddress, router.NextPosi, item.StationCode); |
| | | device.SetValue(W_ConveyorLineCPDB.W_TaskNo, task.TaskNum, item.StationCode); |
| | | device.SetValue(W_ConveyorLineCPDB.W_Command, 1, item.StationCode); |
| | | task.CurrentAddress = item.StationCode; |
| | | task.NextAddress = router.NextPosi; |
| | | task.PalletCode = conveyorLineInfoRead.PalletCode; |
| | | task.Roadway = roadWay; |
| | | task.DeviceCode = router.ChildPosiDeviceCode; |
| | | _taskService.UpdateTask(task, TaskStatusEnum.Line_Executing); |
| | | WriteInfo(item.StationName, $"ä»»å¡å·{conveyorLineInfoRead.TaskNo}ä¸ä¸æ¥"); |
| | | WebResponseContent responseContent = _taskService.RequestInBoundPalletCode(task.TaskNum, conveyorLineInfoRead.PalletCode.Trim()); |
| | | if (responseContent.Status) |
| | | { |
| | | device.SetValue(W_ConveyorLineCPDB.W_TargetAddress, router.NextPosi, item.StationCode); |
| | | device.SetValue(W_ConveyorLineCPDB.W_TaskNo, task.TaskNum, item.StationCode); |
| | | device.SetValue(W_ConveyorLineCPDB.W_Command, 1, item.StationCode); |
| | | task.CurrentAddress = item.StationCode; |
| | | task.NextAddress = router.NextPosi; |
| | | task.PalletCode = conveyorLineInfoRead.PalletCode.Trim(); |
| | | task.Roadway = roadWay; |
| | | task.DeviceCode = router.ChildPosiDeviceCode; |
| | | _taskService.UpdateTask(task, TaskStatusEnum.Line_Executing); |
| | | WriteInfo(item.StationName, $"ä»»å¡å·{task.TaskNum}ä¸ä¸æ¥å°è¾¾{router.NextPosi}å
¥åºç«å°"); |
| | | } |
| | | else |
| | | { |
| | | WriteError(item.StationName, $"ä»»å¡å·{task.TaskNum}æ«ç 请æ±é误{responseContent.Message}"); |
| | | } |
| | | } |
| | | else |
| | | { |
| | |
| | | else if (item.StationType == StationTypeEnum.StationType_InboundAndOutbound.ObjToInt() && deviceProRead != null) |
| | | {//å
¥åºRGVæ¥é©³ä½äº¤äº |
| | | R_ConveyorLineCPInfo conveyorLineInfoRead = device.Communicator.ReadCustomer<R_ConveyorLineCPInfo>(deviceProRead.DeviceProAddress); |
| | | if (conveyorLineInfoRead != null) |
| | | { |
| | | WriteInfo(item.StationName, $"ç¶æ{conveyorLineInfoRead.Serialize()}"); |
| | | } |
| | | if (conveyorLineInfoRead != null && conveyorLineInfoRead.Command == 4 && conveyorLineInfoRead.TaskNo > 0) |
| | | { |
| | | Dt_Task task = _taskRepository.QueryFirst(x => x.TaskNum == conveyorLineInfoRead.TaskNo && x.CurrentAddress == item.StationCode && _taskService.TaskInboundTypes.Contains(x.TaskType) && x.TaskState == TaskStatusEnum.Line_Execute.ObjToInt() && x.DeviceCode == device.DeviceCode); |
| | |
| | | } |
| | | } |
| | | } |
| | | else if (item.StationType == StationTypeEnum.StationType_StackingPlates.ObjToInt() && deviceProRead != null && deviceProWrite != null) |
| | | {//å çæºå·¥ä½å«æ |
| | | else if (item.StationType == StationTypeEnum.StationType_StackingPlates.ObjToInt() && item.IsOccupied==StationOccupiedEnum.None.ObjToInt() && deviceProRead != null && deviceProWrite != null) |
| | | { |
| | | //å çæºå·¥ä½å«æ |
| | | R_ConveyorLineCPInfo conveyorLineInfoRead = device.Communicator.ReadCustomer<R_ConveyorLineCPInfo>(deviceProRead.DeviceProAddress); |
| | | |
| | | if (conveyorLineInfoRead != null && conveyorLineInfoRead.Command == 7 && conveyorLineInfoRead.TaskNo <= 0) |
| | |
| | | { |
| | | //请æ±ä»»å¡ |
| | | WebResponseContent content = _taskService.RequestPlateOutTask(item.StationCode); |
| | | WriteInfo(item.StationName, $"äºæ¥¼ç©ºæå çåºåºä»»å¡çæ"); |
| | | if (content.Status) |
| | | { |
| | | WriteInfo(item.StationName, $"äºæ¥¼ç©ºæå çåºåºä»»å¡çæ"); |
| | | } |
| | | else |
| | | { |
| | | WriteInfo(item.StationName, $"{content.Message}"); |
| | | } |
| | | } |
| | | } |
| | | //å çä»»å¡å®æäº¤äº |