| | |
| | | x.Roadway == task.Roadway && |
| | | (x.TaskStatus == SC_IN_EXECUTING || |
| | | x.TaskStatus == SC_OUT_EXECUTING || |
| | | x.TaskStatus == RELOCATION_EXECUTING || x.TaskStatus == RELOCCATION_NEW)); |
| | | x.TaskStatus == RELOCATION_EXECUTING)); |
| | | |
| | | if (hasExecutingTask) |
| | | continue; |
| | |
| | | task.TaskStatus = successStatus; |
| | | if(task.TaskStatus== (int)OutTaskStatusEnum.SC_OutExecuting) |
| | | { |
| | | string Result = MesOutTaskStatusEnum.åºåºå¼å§.GetDescription(); |
| | | string Result = MesOutTaskStatusEnum.Start.GetDescription(); |
| | | //è°å䏿¸¸ç³»ç»åé¦å¼å§ä»»å¡ |
| | | _taskService.OutStoreDocCallback(task.TaskNum,Result, "æä½æå"); |
| | | }else if(task.TaskStatus == (int)InTaskStatusEnum.PLC_InExecuting) |
| | | { |
| | | string Result = MesInTaskStatusEnum.å
¥åºå¼å§.GetDescription(); |
| | | string Result = MesInTaskStatusEnum.Start.GetDescription(); |
| | | //è°å䏿¸¸ç³»ç»åé¦å¼å§ä»»å¡ |
| | | _taskService.InStoreDocCallback(task.TaskNum, Result, "æä½æå",task.PalletCode,""); |
| | | } |
| | |
| | | /// <returns></returns> |
| | | public WebResponseContent JudgmentIsRelocations(Dt_Task dt_Task) |
| | | { |
| | | const int PLC_IN_FINISH = (int)InTaskStatusEnum.PLC_InFinish; |
| | | const int SC_IN_EXECUTING = (int)InTaskStatusEnum.SC_IntExecuting; |
| | | const int SC_OUT_EXECUTING = (int)OutTaskStatusEnum.SC_OutExecuting; |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | |
| | | int locrow = judgmentRow(dt_Location.RoadwayNo, dt_Location.Row); |
| | | Dt_LocationInfo shallowLocation = _locationInfoService.Repository.QueryData(x => x.RoadwayNo == dt_Location.RoadwayNo && x.Row == locrow && x.Layer == dt_Location.Layer && x.Column == dt_Location.Column).FirstOrDefault(); |
| | | if (shallowLocation.LocationStatus == (int)LocationStatusEnum.Free) return content.OK(); |
| | | if (shallowLocation.LocationStatus != (int)(int)LocationStatusEnum.InStock) return content.Error(); |
| | | |
| | | |
| | | //夿æ¯å¦æç§»åºä»»å¡ |
| | | var TransferTask = _taskService.Repository.QueryData(x=>x.TaskStatus== (int)RelocationTaskStatusEnum.RelocationNew && x.CurrentAddress== shallowLocation.LocationCode).FirstOrDefault(); |
| | |
| | | int.Parse(TransferTask.PalletType), |
| | | TransferTask.CurrentAddress, |
| | | TransferTask.NextAddress, |
| | | TransferTask.TargetAddress); |
| | | dt_Task.TargetAddress); |
| | | if (result.IsSuccess) |
| | | { |
| | | TransferTask.TaskStatus = (int)RelocationTaskStatusEnum.RelocationExecuting; |
| | | _taskService.UpdateData(TransferTask); |
| | | return content.OK(); |
| | | } |
| | | else |
| | | { |
| | | UpdateTaskStatus(dt_Task, result, |
| | | successStatus: dt_Task.TaskStatus == PLC_IN_FINISH ? SC_IN_EXECUTING : SC_OUT_EXECUTING, 1); |
| | | |
| | | WriteLog.GetLog("夿巷éå
ç§»åº").Write($"ä¸åå åæºä»»å¡å¤±è´¥ï¼åå ï¼{result.Message}", $"çæç§»åºä»»å¡:GenerateTransferTask"); |
| | | return content.Error(); |
| | | } |
| | | } |
| | | |
| | | var CuttTransferTask = _taskService.Repository.QueryData(x => x.TaskStatus == (int)RelocationTaskStatusEnum.RelocationNew).FirstOrDefault(); |
| | | //夿å½åæ¯å¦æç§»åºä»»å¡ |
| | | if (CuttTransferTask!=null) return content.Error(); |
| | | |
| | | |
| | | if (shallowLocation.LocationStatus != (int)LocationStatusEnum.InStock) return content.Error(); |
| | | |
| | | //çæç§»åºä»»å¡ï¼è¿è¡ä¸å |
| | | return content =GenerateTransferTask(shallowLocation.LocationCode); |
| | |
| | | _stockInfoService.UpdateData(dt_StockInfo); |
| | | _unitOfWorkManage.CommitTran(); |
| | | |
| | | |
| | | return webResponse.Error("å·²çæç§»åºä»»å¡"); |
| | | //è¿è¡ä¸åç»å åæºä»»å¡ |
| | | WCSginseng result = _taskService.SC_IssueTasks( |
| | | /*WCSginseng result = _taskService.SC_IssueTasks( |
| | | task.TaskId, |
| | | int.Parse(task.Roadway), |
| | | task.TaskNum, |
| | |
| | | task.TargetAddress); |
| | | if (result.IsSuccess) |
| | | { |
| | | task.TaskStatus = (int)RelocationTaskStatusEnum.RelocationExecuting; |
| | | _taskService.UpdateData(task); |
| | | return webResponse.OK(); |
| | | } |
| | | else |
| | | { |
| | | WriteLog.GetLog("夿巷éå
ç§»åº").Write($"ä¸åå åæºä»»å¡å¤±è´¥ï¼åå ï¼{result.Message}", $"çæç§»åºä»»å¡:GenerateTransferTask"); |
| | | return webResponse.Error(); |
| | | } |
| | | }*/ |
| | | } |
| | | else |
| | | { |