| | |
| | | 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.taskCode}ãå·²åå¨ä»»å¡"); |
| | | } |
| | | if (BaseDal.QueryFirst(x => x.PalletCode == task.containerCode && x.TaskType == item.taskType) != null) |
| | | if (BaseDal.QueryFirst(x => x.PalletCode == task.containerCode /*&& x.TaskType == item.taskType*/) != null) |
| | | { |
| | | objects.Add(new |
| | | { |
| | |
| | | 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 |
| | | { |
| | |
| | | break; |
| | | case (int)TaskTypeEnum.CPOutbound: |
| | | content = CreateRGVNewOutTask(task, item.taskType); |
| | | objects.Add(content.Data); |
| | | break; |
| | | case (int)TaskTypeEnum.CPMoveInventory: |
| | | content = CreateRGVNewMoveTask(task, item.taskType); |
| | | objects.Add(content.Data); |
| | | break; |
| | | #endregion |
| | |
| | | //åå车 |
| | | bool isAGV = dt_Task.TaskType == (int)TaskTypeEnum.CPInbound || dt_Task.TaskType == (int)TaskTypeEnum.CPOutbound; |
| | | //海康 |
| | | bool isHK = dt_Task.TaskType == (int)TaskTypeEnum.Carry || 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; |
| | | //è¿éå°ç¶ææ¹åäº198åæ¶ä»»å¡ |
| | | dt_Task.TaskType = TaskStatusEnum.WMSCancel.ObjToInt(); |
| | | #region å¯ä¹å£« |
| | |
| | | deviceName = "åå车"; |
| | | if (dt_Task.RGVTaskId == 0) |
| | | { |
| | | if (dt_Task.TaskType == TaskTypeEnum.CPOutbound.ObjToInt() && dt_Task.TaskState == TaskStatusEnum.RGV_WaitSend.ObjToInt()) |
| | | { |
| | | //ä¿®æ¹åºä½ç¶æ |
| | | var rgvlocaiion = _rGVLocationInfoService.Repository.QueryFirst(x => x.LocationCode == dt_Task.SourceAddress); |
| | | rgvlocaiion.LocationStatus = LocationStatusEnum.InStock.ObjToInt(); //å°åºä½ç¶ææ¹ä¸ºæè´§ |
| | | } |
| | | BaseDal.DeleteAndMoveIntoHty(dt_Task, OperateTypeEnum.èªå¨å é¤); |
| | | content.OK($"åæ¶{dt_Task.WMSTaskNum}任塿å", dt_Task); |
| | | } |
| | |
| | | bool isAGV = dt_Task.TaskType == (int)TaskTypeEnum.CPInbound || dt_Task.TaskType == (int)TaskTypeEnum.CPOutbound; |
| | | |
| | | //海康 |
| | | bool isHK = dt_Task.TaskType == (int)TaskTypeEnum.Carry || dt_Task.TaskType == (int)TaskTypeEnum.CJInbound || dt_Task.TaskType == (int)TaskTypeEnum.CJInbound || dt_Task.TaskType == (int)TaskTypeEnum.CJOutbound; |
| | | 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.Grade = updateTaskPriority.taskPriority; |
| | | #region å¯ä¹å£« |
| | |
| | | } |
| | | 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) |
| | | { |