| | |
| | | using Newtonsoft.Json; |
| | | using OfficeOpenXml.FormulaParsing.Excel.Functions.Math; |
| | | using Quartz; |
| | | using SqlSugar; |
| | | using System; |
| | |
| | | ConveyorLineSignal conveyorLineSignalRead = conveyorLineInfoRead.Signal.ByteToBoolObject<ConveyorLineSignal>(); |
| | | |
| | | ConveyorLineSignal conveyorLineSignalWrite = conveyorLineInfoWrite.Signal.ByteToBoolObject<ConveyorLineSignal>(); |
| | | |
| | | if (item.StationType == StationTypeEnum.StationType_PakcPallet.ObjToInt()) |
| | | { |
| | | if (conveyorLineSignalRead.STB && !conveyorLineSignalWrite.ACK) |
| | | { |
| | | device.SetValue(W_ConveyorLineDB.TaskNum, 1, item.StationCode); |
| | | device.SetValue(W_ConveyorLineDB.StartPos, item.StationCode, item.StationCode); |
| | | device.SetValue(W_ConveyorLineDB.EndPos, 1102, item.StationCode); |
| | | device.SetValue(W_ConveyorLineDB.Spare1, ConveyorWorkTypeEnum.Outbound.ObjToInt(), item.StationCode); |
| | | device.SetValue(W_ConveyorLineDB.ACK, true, item.StationCode); |
| | | } |
| | | else if(!conveyorLineSignalRead.STB && conveyorLineSignalWrite.ACK) |
| | | { |
| | | device.SetValue(W_ConveyorLineDB.ACK, false, item.StationCode); |
| | | } |
| | | } |
| | | if (item.StationType == StationTypeEnum.StationType_InboundAndOutbound.ObjToInt()) |
| | | { |
| | | { |
| | |
| | | WebResponseContent responseContent = _taskService.RequestWMSAssignRoadway(stations, task.TaskNum, conveyorLineInfoRead.Spare2); |
| | | if (responseContent.Status) |
| | | { |
| | | _taskService.UpdateTask(task, TaskStatusEnum.Line_Execute, roadwayNo: responseContent.Data.ToString() ?? ""); |
| | | _taskService.UpdateTask(task, TaskStatusEnum.Line_Execute, roadwayNo: responseContent.Data.ToString() ?? "",heightType: conveyorLineInfoRead.Spare2); |
| | | } |
| | | } |
| | | |
| | |
| | | else//ç产éåº //æ¢å··éå
¥åº |
| | | { |
| | | #region ç产éåº,带任å¡å·æ¥è¯¢ä»»å¡ |
| | | Dt_Task task = _taskRepository.QueryFirst(x => x.TaskNum == conveyorLineInfoRead.TaskNum && x.NextAddress == item.StationCode && _taskService.TaskInboundTypes.Contains(x.TaskType) && x.WarehouseId == warehouseDevice.WarehouseId); // 带任å¡å·æ¥è¯¢ä»»å¡ |
| | | Dt_Task task = _taskRepository.QueryFirst(x => x.TaskNum == conveyorLineInfoRead.TaskNum && x.NextAddress == item.StationCode && _taskService.TaskInboundTypes.Contains(x.TaskType) && x.WarehouseId == warehouseDevice.WarehouseId && x.TaskState == TaskStatusEnum.Line_Execute.ObjToInt()); // 带任å¡å·æ¥è¯¢ä»»å¡ |
| | | Dt_Task taskIn = _taskRepository.QueryFirst(x => x.TaskNum == conveyorLineInfoRead.TaskNum && _taskService.TaskInboundTypes.Contains(x.TaskType) && x.DeviceCode == item.StationDeviceCode && x.NextAddress == item.StationCode && x.WarehouseId == warehouseDevice.WarehouseId && x.TaskState == TaskStatusEnum.Line_Executing.ObjToInt()); // 带任å¡å·æ¥è¯¢ä»»å¡ |
| | | if (task != null) |
| | | { |
| | |
| | | deviceCode = item.StackerCraneCode; |
| | | roadwayNo = responseContent.Data.ToString(); |
| | | device.SetValue(W_ConveyorLineDB.EndPos, task.NextAddress, item.StationCode); |
| | | device.SetValue(W_ConveyorLineDB.StartPos, task.CurrentAddress, item.StationCode); |
| | | } |
| | | else |
| | | { |
| | |
| | | else |
| | | { |
| | | //task.NextAddresså¯è½æ¯router.NextPosi |
| | | device.SetValue(W_ConveyorLineDB.EndPos, task.NextAddress, item.StationCode); |
| | | roadwayNo = responseContent.Data.ToString(); |
| | | deviceCode = router.ChildPosiDeviceCode; |
| | | currentAddress = router.StartPosi; |
| | | nextAddress= router.NextPosi; |
| | | device.SetValue(W_ConveyorLineDB.EndPos, router.NextPosi, item.StationCode); |
| | | device.SetValue(W_ConveyorLineDB.StartPos, router.StartPosi, item.StationCode); |
| | | } |
| | | device.SetValue(W_ConveyorLineDB.TaskNum, task.TaskNum, item.StationCode); |
| | | device.SetValue(W_ConveyorLineDB.StartPos, task.CurrentAddress, item.StationCode); |
| | | device.SetValue(W_ConveyorLineDB.Spare1, ConveyorWorkTypeEnum.Outbound.ObjToInt(), item.StationCode); |
| | | device.SetValue(W_ConveyorLineDB.ACK, true, item.StationCode); |
| | | _taskService.UpdateTask(task, taskState, currentAddress: currentAddress, nextAddress: nextAddress, targetAddress: targetAddress, deviceCode: deviceCode, roadwayNo: roadwayNo); |
| | | _taskService.UpdateTask(task, taskState, currentAddress: currentAddress, nextAddress: nextAddress, targetAddress: targetAddress, deviceCode: deviceCode, roadwayNo: roadwayNo,heightType: conveyorLineInfoRead.Spare2); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | if (router.IsEnd) |
| | | { |
| | | string? targetLoca = _taskService.RequestAssignLocationByHeight(taskIn.TaskNum, taskIn.Roadway, conveyorLineInfoRead.Spare2); |
| | | string? targetLoca = _taskService.RequestAssignLocationByHeight(taskIn.TaskNum, taskIn.Roadway, taskIn.HeightType); |
| | | if (!string.IsNullOrEmpty(targetLoca)) |
| | | { |
| | | currentAddress = item.StackerCraneStationCode; |
| | |
| | | device.SetValue(W_ConveyorLineDB.Spare1, ConveyorWorkTypeEnum.Outbound.ObjToInt(), item.StationCode); |
| | | device.SetValue(W_ConveyorLineDB.STB, true, item.StationCode); |
| | | } |
| | | else //è°æ¨ä½¿ç¨ |
| | | { |
| | | device.SetValue(W_ConveyorLineDB.STB, true, item.StationCode); |
| | | } |
| | | //else //è°æ¨ä½¿ç¨ |
| | | //{ |
| | | // device.SetValue(W_ConveyorLineDB.STB, true, item.StationCode); |
| | | //} |
| | | //{ |
| | | // task = _taskRepository.QueryFirst(x => x.CurrentAddress == item.StationCode && _taskService.TaskInboundTypes.Contains(x.TaskType) && string.IsNullOrEmpty(x.DeviceCode) && x.TaskState == TaskStatusEnum.New.ObjToInt() && x.WarehouseId == warehouseDevice.WarehouseId); |
| | | // if (task != null) |