| | |
| | | private readonly IRepository<Dt_TaskExecuteDetail> _taskExecuteDetailRepository; |
| | | private readonly IApiInfoService _apiInfoService; |
| | | private readonly IStationMangerService _stationMangerService; |
| | | private readonly IStationInfoService _stationInfo; |
| | | private readonly IMapper _mapper; |
| | | |
| | | private Dictionary<string, OrderByType> _taskOrderBy = new() |
| | |
| | | /// </summary> |
| | | public IRepository<Dt_Task> Repository => BaseDal; |
| | | |
| | | public TaskService(IRepository<Dt_Task> BaseDal, IRouterService routerService, ITaskExecuteDetailService taskExecuteDetailService, IRepository<Dt_TaskExecuteDetail> taskExecuteDetailRepository, IMapper mapper, IKLSLocationInfoService kLSLocationInfoService, IRGVLocationInfoService rGVLocationInfoService, IHKLocationInfoService hKLocationInfoService, IApiInfoService apiInfoService, ITrackloginfoService trackloginfoService, IStationMangerService stationMangerService) : base(BaseDal) |
| | | public TaskService(IRepository<Dt_Task> BaseDal, IRouterService routerService, ITaskExecuteDetailService taskExecuteDetailService, IRepository<Dt_TaskExecuteDetail> taskExecuteDetailRepository, IMapper mapper, IKLSLocationInfoService kLSLocationInfoService, IRGVLocationInfoService rGVLocationInfoService, IHKLocationInfoService hKLocationInfoService, IApiInfoService apiInfoService, ITrackloginfoService trackloginfoService, IStationMangerService stationMangerService, IStationInfoService stationInfo) : base(BaseDal) |
| | | { |
| | | _routerService = routerService; |
| | | _taskExecuteDetailService = taskExecuteDetailService; |
| | |
| | | _apiInfoService = apiInfoService; |
| | | _trackloginfoService = trackloginfoService; |
| | | _stationMangerService = stationMangerService; |
| | | _stationInfo = stationInfo; |
| | | } |
| | | public WebResponseContent ReceiveWMSTask([NotNull] List<WMSTasksDTO> taskDTOs) |
| | | { |
| | |
| | | continue; |
| | | //throw new Exception($"æçå·ã{task.containerCode}ãå·²åå¨ä»»å¡"); |
| | | } |
| | | if (BaseDal.QueryFirst(x => x.SourceAddress == task.fromLocationCode && x.TaskType == item.taskType) != null) |
| | | if (BaseDal.QueryFirst(x => x.SourceAddress == task.fromLocationCode && x.TaskType == item.taskType&&x.TaskState<TaskStatusEnum.TakeFinish.ObjToInt())!=null) |
| | | { |
| | | objects.Add(new |
| | | { |
| | |
| | | robotTaskCode = dt_Task.WMSTaskNum, |
| | | cancelType = "CANCEL"//åè½¯åæ¶ï¼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); |
| | | } |
| | | else if (getLocationInfo.WarehouseId == 3) |
| | | { |
| | | |
| | | //è¿éæ¯æåæºç |
| | | 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"); |
| | | list.Add(new |
| | | { |
| | | LoctionCode = value, |
| | | LocationStatus = value!=0? 100 : 0, |
| | | EnableStatus = 0, |
| | | }); |
| | | } |
| | | 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) |
| | | { |