| | |
| | | if (taskTypeGroup == TaskTypeGroup.InboundGroup) |
| | | { |
| | | stationManger = _stationMangerRepository.QueryFirst(x => x.StationCode == item.SourceAddress || x.StationDeviceCode == item.SourceAddress); |
| | | if (stationManger==null && task.TaskType==TaskTypeEnum.InProduct.ObjToInt()) |
| | | { |
| | | stationManger = _stationMangerRepository.QueryFirst(x => x.StackerCraneCode==task.SourceAddress); |
| | | //è½¬æ¢æåä»èµ·ç¹ç«å° |
| | | item.SourceAddress = stationManger.StationCode; |
| | | task.CurrentAddress = stationManger.StationCode; |
| | | task.SourceAddress = stationManger.StationCode; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | stationManger = _stationMangerRepository.QueryFirst(x => x.StackerCraneCode == item.RoadWay); |
| | | stationManger = _stationMangerRepository.QueryFirst(x => x.StackerCraneCode == item.RoadWay || x.Remark==item.RoadWay); |
| | | } |
| | | if (stationManger == null) |
| | | { |
| | |
| | | task.DeviceCode = stationManger.StackerCraneCode; |
| | | task.TaskState = TaskStatusEnum.SC_Execute.ObjToInt(); |
| | | } |
| | | else if (item.TaskType == TaskTypeEnum.MesOutbound.ObjToInt() && item.RoadWay.Contains("ZH")) |
| | | { |
| | | task.NextAddress = stationManger.StackerCraneStationCode; |
| | | task.DeviceCode = stationManger.StackerCraneCode; |
| | | task.TaskState = TaskStatusEnum.SC_Execute.ObjToInt(); |
| | | } |
| | | else |
| | | { |
| | | task.NextAddress = taskTypeGroup == TaskTypeGroup.InboundGroup ? task.TargetAddress : router.NextPosi; |
| | | if (item.RoadWay.Contains("AGV")) |
| | | if (item.RoadWay.Contains("AGV_FL")|| (item.RoadWay.Contains("AGV_CP") && taskTypeGroup == TaskTypeGroup.OutbondGroup)) |
| | | { |
| | | task.DeviceCode = item.RoadWay; |
| | | task.AgvTaskNum = item.RoadWay + DateTime.Now.ToString("yyyyMMdd") + item.TaskNum; |
| | | } |
| | | else if(item.RoadWay.Contains("AGV_CP") && taskTypeGroup == TaskTypeGroup.InboundGroup) |
| | | { |
| | | task.DeviceCode = stationManger.StationDeviceCode; |
| | | task.AgvTaskNum = task.DeviceCode + DateTime.Now.ToString("yyyyMMdd") + item.TaskNum; |
| | | } |
| | | else |
| | |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°è·¯ç±é
置信æ¯"); |
| | | } |
| | | router = routers.FirstOrDefault(); |
| | | |
| | | task.NextAddress = router?.StartPosi ?? ""; |
| | | task.DeviceCode = item.RoadWay; |
| | | task.TaskState = TaskStatusEnum.SC_Execute.ObjToInt(); |
| | |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°è·¯ç±é
置信æ¯"); |
| | | } |
| | | router = routers.FirstOrDefault(); |
| | | string stationCode = router?.NextPosi ?? ""; |
| | | Dt_StationManger? stationManger = _stationMangerRepository.QueryFirst(x => x.StationCode == stationCode); |
| | | Dt_StationManger? stationManger = _stationMangerRepository.QueryData(x => true).FirstOrDefault(x=>x.StationCode== router?.NextPosi); |
| | | if (stationManger == null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°ç«å°é
置信æ¯"); |
| | |
| | | /// </summary> |
| | | public Dt_Task QueryStackerExistTask(string PalletCode, string locationCode) |
| | | { |
| | | return BaseDal.QueryFirst(x => x.PalletCode == PalletCode && x.SourceAddress == locationCode && x.TaskState == (int)TaskStatusEnum.SC_Execute); |
| | | return BaseDal.QueryFirst(x => x.PalletCode == PalletCode && x.SourceAddress == locationCode && (x.TaskState == (int)TaskStatusEnum.SC_Execute || x.TaskState == (int)TaskStatusEnum.SC_Executing)); |
| | | } |
| | | } |
| | | } |