| | |
| | | { |
| | | string response = HttpHelper.Post(apiInfo.ApiAddress, fOURBOTnewMovePodTask.Serialize()); |
| | | FOURBOTReturn fOURBOTReturn = response.DeserializeObject<FOURBOTReturn>(); |
| | | content.Data = fOURBOTReturn; |
| | | content.OK(data: fOURBOTReturn); |
| | | if (fOURBOTReturn.returnCode != 0) throw new Exception(fOURBOTReturn.returnUserMsg); |
| | | |
| | | string dataJson = fOURBOTReturn.data.ToString(); |
| | |
| | | fOURBOTnewMovePodTask.desNodeID = item.NextAddress; |
| | | string response = HttpHelper.Post(apiInfo.ApiAddress, fOURBOTnewMovePodTask.Serialize()); |
| | | FOURBOTReturn fOURBOTReturn = response.DeserializeObject<FOURBOTReturn>(); |
| | | content.Data = fOURBOTReturn; |
| | | content.OK(data: fOURBOTReturn); |
| | | if (fOURBOTReturn.returnCode == 0) |
| | | { |
| | | string dataJson = fOURBOTReturn.data.ToString(); |
| | |
| | | //content.candidatePodIDs = tasks.Select(x => x.PalletCode).ToList(); |
| | | string response = HttpHelper.Post(apiInfo.ApiAddress, request.Serialize()); |
| | | FOURBOTReturn fOURBOTReturn = response.DeserializeObject<FOURBOTReturn>(); |
| | | content.Data = fOURBOTReturn; |
| | | content.OK(data: fOURBOTReturn); |
| | | if (fOURBOTReturn.returnCode == 0) |
| | | { |
| | | //ReturnBlockPodResultDto getBlockPod = fOURBOTReturn.data as ReturnBlockPodResultDto ?? throw new Exception("鏈幏鍙栧埌闃荤鎵樼洏鍏崇郴鏁版嵁"); |
| | |
| | | |
| | | string response = HttpHelper.Post(apiInfo.ApiAddress, fOURBOTnewMovePodTask.Serialize()); |
| | | var fOURBOTReturn = response.DeserializeObject<FOURBOTReturn>(); |
| | | content.Data = fOURBOTReturn; |
| | | content.OK(data: fOURBOTReturn); |
| | | if (fOURBOTReturn.returnCode == 0) |
| | | { |
| | | var data = fOURBOTReturn.data.ToString(); |
| | |
| | | locationsToUpdate.Add(rGVLocationInfo); |
| | | |
| | | #region 閲婃斁鍏ュ簱绔欏彴 |
| | | var stationManger = _stationMangerService.GetInStationInfo(item.SourceAddress); |
| | | if (stationManger != null) |
| | | { |
| | | stationManger.IsOccupied = LocationStatusEnum.Free.ObjToInt(); |
| | | stationsToUpdate.Add(stationManger); |
| | | } |
| | | //var stationManger = _stationMangerService.GetInStationInfo(item.SourceAddress); |
| | | //if (stationManger != null) |
| | | //{ |
| | | // stationManger.IsOccupied = LocationStatusEnum.Free.ObjToInt(); |
| | | // stationsToUpdate.Add(stationManger); |
| | | //} |
| | | content.OK(); |
| | | #endregion |
| | | } |
| | |
| | | _taskService.UpdateData(tasksToUpdate); |
| | | if (locationsToUpdate.Any()) |
| | | _rGVLocationInfoService.UpdateData(locationsToUpdate); |
| | | if (stationsToUpdate.Any()) |
| | | _stationMangerService.UpdateData(stationsToUpdate); |
| | | //if (stationsToUpdate.Any()) |
| | | // _stationMangerService.UpdateData(stationsToUpdate); |
| | | |
| | | _unitOfWorkManage.CommitTran(); |
| | | } |
| | |
| | | //FOURBOTnewMovePodTaskResponseData fOURBO = fOURBOTReturn.data as FOURBOTnewMovePodTaskResponseData ?? throw new Exception("鏈幏鍙栧埌鍥涘悜杞﹁繑鍥炵殑浠诲姟ID"); |
| | | string dataJson = fOURBOTReturn.data.ToString(); |
| | | FOURBOTnewMovePodTaskResponseData? fOURBO = JsonConvert.DeserializeObject<FOURBOTnewMovePodTaskResponseData>(dataJson); |
| | | content.OK(data: fOURBO); |
| | | if (fOURBO == null || fOURBO.taskID == 0) |
| | | { |
| | | throw new Exception($"鏈幏鍙栧埌鍥涘悜杞﹁繑鍥炵殑浠诲姟ID锛岃繑鍥炴暟鎹細{response}"); |
| | |
| | | } |
| | | string response = HttpHelper.Post(apiInfo.ApiAddress, moveBlock.Serialize()); |
| | | FOURBOTReturn fOURBOTReturn = response.DeserializeObject<FOURBOTReturn>(); |
| | | content.Data = fOURBOTReturn; |
| | | content.OK(data: fOURBOTReturn); |
| | | if (fOURBOTReturn.returnCode == 0) |
| | | { |
| | | string dataJson = fOURBOTReturn.data.ToString(); |
| | |
| | | { |
| | | i++; |
| | | var stationManger = _stationMangerService.GetOutStationInfo(item.TargetAddress); |
| | | //if (stationManger.IsOccupied != LocationStatusEnum.Free.ObjToInt()) |
| | | //{ |
| | | // item.ExceptionMessage = $"鍑哄簱绔欏彴銆恵stationManger.StationCode}銆戣鍗犵敤"; |
| | | // continue; |
| | | //} |
| | | item.NextAddress = stationManger.StationCode; |
| | | if (stationManger.IsOccupied != LocationStatusEnum.Free.ObjToInt()) continue; |
| | | #region 涓嬪彂鍑哄簱浠诲姟 |
| | | fOURBOTnewMovePodTask.priority = item.Grade; |
| | | fOURBOTnewMovePodTask.podID = item.PalletCode; |
| | |
| | | fOURBOTnewMovePodTask.requestID = DateTime.Now.ToString("yyyyMMddHHmmss") + i; |
| | | string response = HttpHelper.Post(apiInfo.ApiAddress, fOURBOTnewMovePodTask.Serialize()); |
| | | FOURBOTReturn fOURBOTReturn = response.DeserializeObject<FOURBOTReturn>(); |
| | | content.Data = fOURBOTReturn; |
| | | content.OK(data: fOURBOTReturn); |
| | | if (fOURBOTReturn.returnCode == 0) |
| | | { |
| | | string dataJson = fOURBOTReturn.data.ToString(); |
| | |
| | | } |
| | | item.RGVTaskId = fOURBO.taskID; |
| | | item.TaskState = (int)TaskStatusEnum.Execut; |
| | | stationManger.IsOccupied = LocationStatusEnum.Lock.ObjToInt(); |
| | | _stationMangerService.UpdateData(stationManger); |
| | | //stationManger.IsOccupied = LocationStatusEnum.Lock.ObjToInt(); |
| | | //_stationMangerService.UpdateData(stationManger); |
| | | } |
| | | #endregion |
| | | } |