| | |
| | | try |
| | | { |
| | | Dt_HKLocationInfo? hKLocationInfo = null; |
| | | if (taskType==(int)TaskTypeEnum.STURR) |
| | | 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}ã"); |
| | | 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}ãå¯ç¨ç©ºè´§ä½ï¼"); |
| | | 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; |
| | |
| | | throw new Exception($"ç»ç¹ç«å°ã{taskDTO.toLocationCode}ãç¶æä¸ä¸ºç©ºé²ï¼"); |
| | | } |
| | | } |
| | | Dt_Task dt_Task = new Dt_Task() |
| | | Dt_Task dt_Task = new Dt_Task() |
| | | { |
| | | TaskNum = GetTaskNum(nameof(SequenceEnum.SeqTaskNum)), |
| | | WMSTaskNum = taskDTO.taskCode, |
| | |
| | | { |
| | | var tasktype = (TaskTypeEnum)Enum.GetValues(typeof(TaskTypeEnum)).GetValue(task.TaskType - 1); |
| | | hIKROBOTTaskSubmit.initPriority = task.Grade; |
| | | if (task.PalletCode== "MR-Q3-600LE-D(M)") |
| | | if (task.PalletCode == "MR-Q3-600LE-D(M)") |
| | | { |
| | | hIKROBOTTaskSubmit.robotType = "19"; //海康 转è¿è½¦ |
| | | } |
| | |
| | | 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; |
| | | } |
| | | |
| | | } |
| | | } |