| | |
| | | #endregion << ç æ¬ 注 é >> |
| | | |
| | | using AutoMapper; |
| | | using Newtonsoft.Json; |
| | | using SixLabors.ImageSharp.ColorSpaces; |
| | | using SqlSugar; |
| | | using System.Collections.Generic; |
| | |
| | | continue; |
| | | //throw new Exception($"æçå·ã{task.containerCode}ãå·²åå¨ä»»å¡"); |
| | | } |
| | | if (BaseDal.QueryFirst(x => x.SourceAddress == task.fromLocationCode && x.TaskType == item.taskType&&x.TaskState<TaskStatusEnum.TakeFinish.ObjToInt())!=null) |
| | | if (BaseDal.QueryFirst(x => x.SourceAddress == task.fromLocationCode && x.TaskType == item.taskType && x.TaskState < TaskStatusEnum.TakeFinish.ObjToInt()) != null) |
| | | { |
| | | objects.Add(new |
| | | { |
| | |
| | | break; |
| | | #endregion |
| | | #region 海康AGV |
| | | case (int)TaskTypeEnum.STURR: |
| | | case (int)TaskTypeEnum.Q1TSJ4: |
| | | content = CreateHKNewInTask(task, item.taskType); |
| | | objects.Add(content.Data); |
| | |
| | | content = CreateHKNewOutTask(task, item.taskType); |
| | | objects.Add(content.Data); |
| | | break; |
| | | case (int)TaskTypeEnum.F01: |
| | | |
| | | case (int)TaskTypeEnum.Q3RK: |
| | | case (int)TaskTypeEnum.Q3CK: |
| | | content = CarryTask(task, item.taskType); |
| | | objects.Add(content.Data); |
| | | break; |
| | | case (int)TaskTypeEnum.F02: |
| | | case (int)TaskTypeEnum.F01: |
| | | content = HKF01Transport(task, item.taskType); |
| | | break; |
| | | case (int)TaskTypeEnum.F04: |
| | | case (int)TaskTypeEnum.RK3F: |
| | | case (int)TaskTypeEnum.F02: |
| | | case (int)TaskTypeEnum.F03: |
| | | case (int)TaskTypeEnum.CK3F: |
| | | content = CJCarryTaske(task, item.taskType); |
| | | objects.Add(content.Data); |
| | |
| | | //åå车 |
| | | bool isAGV = dt_Task.TaskType == (int)TaskTypeEnum.CPInbound || dt_Task.TaskType == (int)TaskTypeEnum.CPOutbound; |
| | | //海康 |
| | | bool isHK = dt_Task.TaskType == (int)TaskTypeEnum.F01 || dt_Task.TaskType == (int)TaskTypeEnum.RK3F || dt_Task.TaskType == (int)TaskTypeEnum.CK3F || dt_Task.TaskType == (int)TaskTypeEnum.Q1TSJ4 || dt_Task.TaskType == (int)TaskTypeEnum.STU0003 || dt_Task.TaskType == (int)TaskTypeEnum.F02 || dt_Task.TaskType == (int)TaskTypeEnum.CHUKU1 || dt_Task.TaskType == (int)TaskTypeEnum.Q3RK || dt_Task.TaskType == (int)TaskTypeEnum.Q3CK; |
| | | bool isHK = dt_Task.TaskType == (int)TaskTypeEnum.F01 || dt_Task.TaskType == (int)TaskTypeEnum.RK3F || dt_Task.TaskType == (int)TaskTypeEnum.CK3F || dt_Task.TaskType == (int)TaskTypeEnum.Q1TSJ4 || dt_Task.TaskType == (int)TaskTypeEnum.STU0003 || dt_Task.TaskType == (int)TaskTypeEnum.F02 || dt_Task.TaskType == (int)TaskTypeEnum.CHUKU1 || dt_Task.TaskType == (int)TaskTypeEnum.Q3RK || dt_Task.TaskType == (int)TaskTypeEnum.Q3CK || dt_Task.TaskType == (int)TaskTypeEnum.STURR; |
| | | //è¿éå°ç¶ææ¹åäº198åæ¶ä»»å¡ |
| | | dt_Task.TaskType = TaskStatusEnum.WMSCancel.ObjToInt(); |
| | | #region å¯ä¹å£« |
| | |
| | | cancelHIKROBOTTask = new CancelHIKROBOTTask |
| | | { |
| | | robotTaskCode = dt_Task.WMSTaskNum, |
| | | cancelType = "CANCEL"//åè½¯åæ¶ï¼DROP人工ä»å
¥ï¼åç¡¬åæ¶ï¼ |
| | | cancelType = "DROP"//åè½¯åæ¶ï¼DROP人工ä»å
¥ï¼åç¡¬åæ¶ï¼ |
| | | }; |
| | | var headers = new Dictionary<string, string> |
| | | { |
| | | { "X-lr-request-id", DateTimeOffset.Now.ToUnixTimeSeconds().ToString() + wMSCancelTask.TaskCode } |
| | | }; |
| | | |
| | | Dt_ApiInfo? apiInfo = _apiInfoService.Repository.QueryFirst(x => x.ApiCode == nameof(CancelHIKROBOTTask)); |
| | | if (apiInfo == null) throw new Exception("æªæ¾å°åå车AGVä»»å¡ä¸åæ¥å£é
置信æ¯ï¼è¯·æ£æ¥æ¥å£é
ç½®"); |
| | | string response = HttpHelper.Post(apiInfo.ApiAddress, cancelHIKROBOTTask.Serialize()); |
| | | string response = HttpHelper.Post(apiInfo.ApiAddress, cancelHIKROBOTTask.Serialize(), headers: headers); |
| | | HIKROBOTReturn hIKROBOTReturn = response.DeserializeObject<HIKROBOTReturn>(); |
| | | content.OK(data: hIKROBOTReturn); |
| | | if (hIKROBOTReturn.code == "SUCCESS" && hIKROBOTReturn.message == "æå") |
| | |
| | | { |
| | | LoctionCode = item.LocationCode, |
| | | LocationStatus = item.LocationStatus, |
| | | EnableStatus = item.EnableStatus |
| | | EnableStatus = item.EnableStatus, |
| | | PalletCode = item.PalletCode |
| | | |
| | | }); |
| | | } |
| | | content.OK(data: list); |
| | |
| | | { |
| | | LoctionCode = item.LocationCode, |
| | | LocationStatus = item.LocationStatus, |
| | | EnableStatus = item.EnableStatus |
| | | EnableStatus = item.EnableStatus, |
| | | PalletCode = item.PalletCode |
| | | }); |
| | | } |
| | | content.OK(data: list); |
| | |
| | | var device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == "TSJ") as OtherDevice; |
| | | if (device == null) throw new Exception("æªæ¾å°æåæºè®¾å¤ä¿¡æ¯"); |
| | | if (!device.IsConnected) throw new Exception("PLC1æåæºè®¾å¤è¿æ¥å¤±è´¥"); |
| | | var value = device.GetValue<HoistEnum, short>(HoistEnum.Outboundmaterialbox, "TSJ"); |
| | | var value = device.GetValue<HoistEnum, short>(HoistEnum.Outboundmaterialbox, "TSJC3F"); |
| | | list.Add(new |
| | | { |
| | | LoctionCode = value, |
| | | LocationStatus = value!=0? 100 : 0, |
| | | LocationStatus = value != 0 ? 100 : 0, |
| | | EnableStatus = 0, |
| | | }); |
| | | content.OK(data: list); |
| | | } |
| | | else if (getLocationInfo.WarehouseId == 4) |
| | | { |
| | | |
| | | List<Dt_HKLocationInfo> rGVLocationInfos = new List<Dt_HKLocationInfo>(); |
| | | if (!string.IsNullOrEmpty(getLocationInfo.AreaCode)) |
| | | rGVLocationInfos = _hKLocationInfoService.Repository.QueryData(x => x.WarehouseId == getLocationInfo.AreaCode.ObjToInt()); |
| | | else |
| | | rGVLocationInfos = _hKLocationInfoService.Repository.QueryData(); |
| | | foreach (var item in rGVLocationInfos) |
| | | { |
| | | list.Add(new |
| | | { |
| | | LoctionCode = item.LocationCode, |
| | | LocationStatus = item.LocationStatus, |
| | | EnableStatus = item.EnableStatus, |
| | | PalletCode = item.PalletCode |
| | | }); |
| | | } |
| | | content.OK(data: list); |
| | | } |
| | | else if (getLocationInfo.WarehouseId == 5) |
| | | { |
| | |
| | | var device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == "F1") as OtherDevice; |
| | | if (device == null) throw new Exception("æªæ¾å°1楼质æ£é¨è®¾å¤ä¿¡æ¯"); |
| | | if (!device.IsConnected) throw new Exception("PLC1楼质æ£é¨è®¾å¤è¿æ¥å¤±è´¥"); |
| | | var sta = _stationMangerService.Repository.QueryData(x => x.Remark == "æååº"); |
| | | var sta = _stationMangerService.Repository.QueryData(x => x.StationName.Contains("æåä»")); |
| | | foreach (var item in sta) |
| | | { |
| | | bool value = device.GetValue<QualityInspectionCommandEnum, bool>(QualityInspectionCommandEnum.R_StockAvailableSymbol, item.StationCode); |
| | |
| | | { |
| | | throw new NotImplementedException(); |
| | | } |
| | | |
| | | public WebResponseContent InboundElevatorExit(string LocationCode, string containerCode) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | inboundElevatorExitDTO inboundElevator=new inboundElevatorExitDTO(); |
| | | try |
| | | { |
| | | Dt_ApiInfo? apiInfo = _apiInfoService.Repository.QueryFirst(x => x.ApiCode == nameof(inboundElevatorExitDTO)) ?? throw new Exception("æªæ¾å°4Fæåæºåºå£æçå·ä¸æ¥WMSæ¥å£é
置信æ¯ï¼è¯·æ£æ¥æ¥å£é
ç½®"); |
| | | inboundElevator.containerCode= containerCode; |
| | | inboundElevator.toLocationCode = LocationCode; |
| | | string response = HttpHelper.Post(apiInfo.ApiAddress, inboundElevator.Serialize()); |
| | | content.OK(data: response); |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | finally |
| | | { |
| | | _trackloginfoService.AddTrackLog(inboundElevator, content, "4Fæåæºåºå£æçå·ä¸æ¥WMS", "", ""); |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// æç®±éªè¯ |
| | | /// </summary> |
| | |
| | | /// <returns></returns> |
| | | public WebResponseContent MaterialBoxInspection(string taskCode, string containerCode) |
| | | { |
| | | throw new NotImplementedException(); |
| | | WebResponseContent content = new WebResponseContent(); |
| | | inboundTransportCheckDTO checkDTO = new inboundTransportCheckDTO(); |
| | | try |
| | | { |
| | | checkDTO.containerCode = containerCode; |
| | | Dt_ApiInfo? apiInfo = _apiInfoService.Repository.QueryFirst(x => x.ApiCode == nameof(inboundTransportCheckDTO)) ?? throw new Exception("æªæ¾å°è£çå
¥åº3Få°4Fè¿è¾ç®±å·æ ¡éªæ¥å£é
置信æ¯ï¼è¯·æ£æ¥æ¥å£é
ç½®"); |
| | | string response = HttpHelper.Post(apiInfo.ApiAddress, checkDTO.Serialize()); |
| | | content.OK(data: response); |
| | | WMSReturn wMSReturn = response.DeserializeObject<WMSReturn>(); |
| | | if (wMSReturn == null) throw new Exception("WMSè¿åç»æè½¬æ¢å¤±è´¥ï¼"); |
| | | if (!wMSReturn.success) throw new Exception(wMSReturn.message); |
| | | string dataJson = wMSReturn.result.ToString(); |
| | | Exists? exists = JsonConvert.DeserializeObject<Exists>(dataJson); |
| | | if (exists == null) throw new Exception($"WMSè¿åç»æçresult转æ¢å¤±è´¥"); |
| | | return WebResponseContent.Instance.OK(exists.errorAreaCode); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | finally |
| | | { |
| | | _trackloginfoService.AddTrackLog(checkDTO, content, "è£çå
¥åº3Få°4Fè¿è¾ç®±å·æ ¡éª", "", ""); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |