| | |
| | | using Microsoft.AspNetCore.Components.Routing; |
| | | using Newtonsoft.Json; |
| | | using OfficeOpenXml.FormulaParsing.Excel.Functions.DateTime; |
| | | using Quartz; |
| | | using SqlSugar.Extensions; |
| | | using System; |
| | |
| | | //ç åç¯çº¿è¯·æ±ä»»å¡ |
| | | if (conveyorLineInfoRead != null && (conveyorLineInfoRead.R_State == 2 || conveyorLineInfoRead.R_State == 3) && conveyorLineInfoRead.R_TaskNo <= 0 && !string.IsNullOrEmpty(conveyorLineInfoRead.R_BoxCode) && conveyorLineInfoRead.R_Request==1) |
| | | { |
| | | WebResponseContent content = _taskService.RequestWMSTaskSimple(conveyorLineInfoRead.R_BoxCode, item.StationCode); |
| | | //åWMS请æ±ä»»å¡ |
| | | if (true) |
| | | { |
| | | //WebResponseContent content = _taskService.RequestWMSTaskSimple(conveyorLineInfoRead.R_BoxCode, item.StationCode); |
| | | ////åWMS请æ±ä»»å¡ |
| | | //if (true) |
| | | //{ |
| | | |
| | | //} |
| | | if (conveyorLineInfoRead.R_BoxCode=="1") |
| | | { |
| | | int taskNum = Convert.ToInt32(DateTime.Now.ToString("ddHHmmss")); |
| | | WebResponseContent content = _taskService.RequestWMSTaskSimple(taskNum.ToString(), item.StationCode,taskType:TaskTypeEnum.ProductMD.ObjToInt(),taskNum: taskNum, targetAddress:"2554"); |
| | | //请æ±ä»»å¡ |
| | | if (content.Status) |
| | | { |
| | | //åå
¥åºåºçº¿ä½å°å |
| | | device.SetValue(W_CLineCPHDB.W_TaskNo, 5, item.StationCode); |
| | | device.SetValue(W_CLineCPHDB.W_TaskNo, taskNum, item.StationCode); |
| | | device.SetValue(W_ConveyorLineCPDB.W_Command, 1, item.StationCode); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | //è·åç åå£ä»»å¡æ´æ°ä»»å¡ç¶æ |
| | | if (conveyorLineInfoRead != null && (conveyorLineInfoRead.R_State == 2 || conveyorLineInfoRead.R_State == 3) && conveyorLineInfoRead.R_TaskNo > 0) |
| | | { |
| | | |
| | | } |
| | | } |
| | | else if (item.StationType == StationTypeEnum.StationType_InboundAndOutbound.ObjToInt() && deviceProRead != null) |
| | | { |
| | | R_CLineCPHInfo conveyorLineInfoRead = device.Communicator.ReadCustomer<R_CLineCPHInfo>(deviceProRead.DeviceProAddress); |
| | | //ç åç¯çº¿æåºå£è¯·æ±åæ¶ä»»å¡ |
| | | if (conveyorLineInfoRead != null && (conveyorLineInfoRead.R_State == 2 || conveyorLineInfoRead.R_State == 3) && conveyorLineInfoRead.R_TaskNo > 0 && conveyorLineInfoRead.R_Request == 2) |
| | | { |
| | | |
| | | Dt_Task task = _taskRepository.QueryFirst(x => x.TaskNum == conveyorLineInfoRead.R_TaskNo && x.NextAddress==item.StationCode && x.TaskState == TaskStatusEnum.Line_Executing.ObjToInt()); |
| | | if (task != null) |
| | | { |
| | | task.CurrentAddress = item.StationCode; |
| | | task.NextAddress = task.TargetAddress; |
| | | task.DeviceCode = item.StackerCraneCode; |
| | | _taskService.UpdateTask(task, TaskStatusEnum.MD_Executing); |
| | | } |
| | | } |
| | | } |
| | | else |