| | |
| | | try |
| | | { |
| | | Dt_HKLocationInfo? hKLocationInfo = null; |
| | | int containerType = taskDTO.containerCode.Contains("LXM") ? (int)LocationTypeEnum.LargePallet : (int)LocationTypeEnum.SmallPallet; |
| | | if (taskType == (int)TaskTypeEnum.STURR) |
| | | { |
| | | var reslut = _stationInfo.Repository.QueryFirst(x => x.StationCode == taskDTO.fromLocationCode) ?? throw new Exception($"æªæ¾å°èµ·ç¹è´§ä½ã{taskDTO.fromLocationCode}ã"); |
| | | } |
| | | #region ç¹å°ç¹ |
| | | if (!string.IsNullOrEmpty(taskDTO.toLocationCode)) |
| | | { |
| | |
| | | #endregion |
| | | //è·åè´§ä½ä¿¡æ¯ |
| | | else |
| | | hKLocationInfo = _hKLocationInfoService.GetFreeLocationInfo(taskDTO.toAreaCode) ?? throw new Exception($"æªæ¾å°ç»ç¹åºåºã{taskDTO.toAreaCode}ãå¯ç¨ç©ºè´§ä½ï¼"); |
| | | if (taskType==(int)TaskTypeEnum.Q1TSJ4) |
| | | hKLocationInfo = _hKLocationInfoService.GetFreeLocationInfo(taskDTO.toAreaCode, containerType) ?? throw new Exception($"æªæ¾å°ç»ç¹åºåºã{taskDTO.toAreaCode}ãå¯ç¨ç©ºè´§ä½ï¼"); |
| | | if (taskType == (int)TaskTypeEnum.Q1TSJ4) |
| | | { |
| | | var device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == "TSJ") as OtherDevice; |
| | | if (device.IsConnected) |
| | | { |
| | | var reslu = device.GetValue<HoistEnum, string>(HoistEnum.Emptycontainernumber); |
| | | var result = reslu?.TrimEnd('\0')?.Substring(2); |
| | | if (reslu== taskDTO.containerCode&&result!=null) |
| | | if (reslu == taskDTO.containerCode && result != null) |
| | | { |
| | | throw new Exception($"å½åçæç®±å·ä¸º{reslu}ä¸{taskDTO.containerCode}æç®±å·ä¸å¹é
"); |
| | | } |
| | |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | //4楼åºå
å°æåæº |
| | | Dt_HKLocationInfo? hKLocationInfo = _hKLocationInfoService.Repository.QueryFirst(x => x.LocationCode == taskDTO.fromLocationCode) ?? throw new Exception($"æªæ¾å°èµ·ç¹åºä½ã{taskDTO.fromLocationCode}ãï¼"); |
| | | if (hKLocationInfo.LocationStatus != LocationStatusEnum.InStock.ObjToInt()) throw new Exception($"èµ·ç¹åºä½ã{taskDTO.fromLocationCode}ãå½ååºä½ç¶æä¸å¯åºåºï¼"); |
| | | if (hKLocationInfo.PalletCode != taskDTO.containerCode) throw new Exception($"èµ·ç¹åºä½ã{taskDTO.fromLocationCode}ãç»å®æç®±å·ã{hKLocationInfo.PalletCode}ãä¸ä»»å¡æç®±å·ã{taskDTO.containerCode}ãä¸å¹é
ï¼"); |
| | | //åºå
å°åºå¤çç¹å°ç¹ä»»å¡ï¼æ¯å¦éè¦å¤æè´§ä½ç¶æï¼ |
| | | |
| | | //åºå
å°ç°è¾¹çç¹å°ç¹ä»»å¡ï¼æ¯å¦éè¦å¤æè´§ä½ç¶æï¼ |
| | | if (taskType == (int)TaskTypeEnum.STU0003) |
| | | { |
| | | var reslut = _stationInfo.Repository.QueryFirst(x => x.StationCode == taskDTO.toLocationCode) ?? throw new Exception($"æªæ¾å°ç»ç¹è´§ä½ã{taskDTO.toLocationCode}ã"); |
| | | if (reslut.StationStatus != (int)LocationStatusEnum.Free) |
| | | { |
| | | throw new Exception($"ç»ç¹ç«å°ã{taskDTO.toLocationCode}ãç¶æä¸ä¸ºç©ºé²ï¼"); |
| | | } |
| | | } |
| | | Dt_Task dt_Task = new Dt_Task() |
| | | { |
| | | TaskNum = GetTaskNum(nameof(SequenceEnum.SeqTaskNum)), |
| | |
| | | try |
| | | { |
| | | var tasktype = (TaskTypeEnum)Enum.GetValues(typeof(TaskTypeEnum)).GetValue(task.TaskType - 1); |
| | | |
| | | hIKROBOTTaskSubmit.initPriority = task.Grade; |
| | | if (task.PalletCode == "MR-Q3-600LE-D(M)") |
| | | { |
| | | hIKROBOTTaskSubmit.robotType = "19"; //海康 转è¿è½¦ |
| | | } |
| | | else if (task.PalletCode == "MR-Q3-600LE-D(M)(YWGP)") |
| | | { |
| | | hIKROBOTTaskSubmit.robotType = "20"; //海康 空æç车ï¼ä¸æ¥¼å°å
楼ï¼6楼å°ä¸æ¥¼ |
| | | } |
| | | hIKROBOTTaskSubmit.taskType = tasktype.ToString(); |
| | | ExtraDto extraDto = new ExtraDto(); |
| | | hIKROBOTTaskSubmit.robotTaskCode = task.WMSTaskNum; |
| | | hIKROBOTTaskSubmit.taskType = tasktype.ToString(); ExtraDto extraDto = new ExtraDto(); |
| | | if (task.TaskType != (int)TaskTypeEnum.MOVE &&task.TaskType != (int)TaskTypeEnum.Q3RK && task.TaskType != (int)TaskTypeEnum.Q3CK && |
| | | task.TaskType != (int)TaskTypeEnum.F01) |
| | | if (task.TaskType != (int)TaskTypeEnum.MOVE && task.TaskType != (int)TaskTypeEnum.Q3RK && task.TaskType != (int)TaskTypeEnum.Q3CK && task.TaskType != (int)TaskTypeEnum.F01) |
| | | { |
| | | CarrierInfoDto carrierInfoDto = new CarrierInfoDto() |
| | | { |
| | |
| | | hIKROBOTTaskSubmit.targetRoute.Add(targetRoute); |
| | | } |
| | | break; |
| | | case TaskTypeEnum.STUPTBY: |
| | | { |
| | | TargetRouteDto target = new TargetRouteDto() |
| | | { |
| | | code = task.CurrentAddress, |
| | | operation = "DELIVERY",//åè´§ |
| | | seq = 0, |
| | | type = "STORAGE", |
| | | }; |
| | | TargetRouteDto targetRoute = new TargetRouteDto() |
| | | { |
| | | code = task.NextAddress, |
| | | operation = "DELIVERY",//éè´§ |
| | | seq = 1, |
| | | type = "STORAGE", |
| | | }; |
| | | hIKROBOTTaskSubmit.targetRoute.Add(target); |
| | | hIKROBOTTaskSubmit.targetRoute.Add(targetRoute); |
| | | } |
| | | break; |
| | | case TaskTypeEnum.CPMoveInventory: |
| | | break; |
| | | default: |
| | |
| | | return content; |
| | | } |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// æµ·åº·è®¾å¤æ¥è¦ |
| | | /// </summary> |
| | | /// <param name="hKDeviceAalarmDTO"></param> |
| | | /// <returns></returns> |
| | | public WebResponseContent HKDeviceAlarm(HKDeviceAalarmDTO hKDeviceAalarmDTO) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | WMSReturn wMSReturn = null; |
| | | HKDeviceAalarmDTO hIKROBOTDeviceAlarm = null; |
| | | try |
| | | { |
| | | Dt_ApiInfo? apiInfo = _apiInfoService.Repository.QueryFirst(x => x.ApiCode == nameof(HKDeviceAalarmDTO)) ?? throw new Exception("æªæ¾å°ä¸æ¥æµ·åº·AGVè®¾å¤æ¥è¦æ¥å£é
置信æ¯ï¼è¯·æ£æ¥æ¥å£é
ç½®"); |
| | | hIKROBOTDeviceAlarm = new HKDeviceAalarmDTO() |
| | | { |
| | | robotTaskCode = hKDeviceAalarmDTO.robotTaskCode, |
| | | taskWarnCode = hKDeviceAalarmDTO.taskWarnCode, |
| | | startTime = hKDeviceAalarmDTO.startTime, |
| | | singleRobotCode = hKDeviceAalarmDTO.singleRobotCode, |
| | | errorCode = hKDeviceAalarmDTO.errorCode, |
| | | errorMsg = hKDeviceAalarmDTO.errorMsg, |
| | | extra = hKDeviceAalarmDTO.extra, |
| | | }; |
| | | |
| | | string response = HttpHelper.Post(apiInfo.ApiAddress,hIKROBOTDeviceAlarm.Serialize()); |
| | | wMSReturn = response.DeserializeObject<WMSReturn>(); |
| | | if (wMSReturn.success == true && wMSReturn.message == "success") |
| | | { |
| | | content.OK("䏿¥æµ·åº·AGVè®¾å¤æ¥è¦ä¿¡æ¯æå"); |
| | | } |
| | | else |
| | | { |
| | | content.Error(wMSReturn.message); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | content.Error(ex.Message); |
| | | } |
| | | finally |
| | | { |
| | | _trackloginfoService.AddTrackLog(hIKROBOTDeviceAlarm, content, "䏿¥æµ·åº·AGVè®¾å¤æ¥è¦ä¿¡æ¯", "", ""); |
| | | } |
| | | return content; |
| | | } |
| | | |
| | | } |
| | | } |