| | |
| | | |
| | | public List<int> TaskOutboundTypes => typeof(TaskOutboundTypeEnum).GetEnumIndexList(); |
| | | |
| | | public List<int> TaskRelocationTypes => typeof(TaskRelocationTypeEnum).GetEnumIndexList(); |
| | | |
| | | public TaskService(ITaskRepository BaseDal, IRouterService routerService, ITaskExecuteDetailService taskExecuteDetailService, ITaskExecuteDetailRepository taskExecuteDetailRepository, ITaskHtyService taskHtyService, IMapper mapper) : base(BaseDal) |
| | | { |
| | | _routerService = routerService; |
| | |
| | | /// <param name="taskNum">ä»»å¡å·</param> |
| | | /// <param name="currentAddress">å½åå°å</param> |
| | | /// <returns></returns> |
| | | public Dt_Task QueryCompletedConveyorLineTask(int taskNum, string currentAddress) |
| | | public Dt_Task QueryCompletedConveyorLineTask(string Barcode, string currentAddress) |
| | | { |
| | | return BaseDal.QueryFirst(x => x.TaskNum == taskNum && x.CurrentAddress == currentAddress && (x.TaskState == (int)TaskInStatusEnum.Line_InFinish || x.TaskState == (int)TaskOutStatusEnum.Line_OutFinish), TaskOrderBy); |
| | | return BaseDal.QueryFirst(x => x.PalletCode == Barcode && x.CurrentAddress == currentAddress && (x.TaskState == (int)TaskInStatusEnum.Line_InFinish || x.TaskState == (int)TaskOutStatusEnum.Line_OutFinish), TaskOrderBy); |
| | | } |
| | | |
| | | public Dt_Task QuertOutProductionLineTask(bool NextAddIsNull) |
| | |
| | | return BaseDal.QueryFirst(x => x.Roadway == deviceNo && TaskOutboundTypes.Contains(x.TaskType) && x.TaskState == (int)TaskOutStatusEnum.OutNew, TaskOrderBy); |
| | | return null; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ¥è¯¢åºå
ç§»åºä»»å¡ |
| | | /// </summary> |
| | | /// <param name="deviceNo"></param> |
| | | /// <param name="currentAddress"></param> |
| | | /// <returns></returns> |
| | | public Dt_Task QueryStackerCraneRelocationTask(string deviceNo, string currentAddress = "") |
| | | { |
| | | Dt_Task task = null; |
| | | if (string.IsNullOrEmpty(currentAddress)) |
| | | task = BaseDal.QueryFirst(x => x.Roadway == deviceNo && TaskRelocationTypes.Contains(x.TaskType), TaskOrderBy); |
| | | else |
| | | task = BaseDal.QueryFirst(x => x.Roadway == deviceNo && x.CurrentAddress == currentAddress && TaskRelocationTypes.Contains(x.TaskType), TaskOrderBy); |
| | | if (task != null) |
| | | { |
| | | if (task.SourceIsPickPlace && task.TaskState == (int)TaskRelocationStatusEnum.RelocationNew || !task.SourceIsPickPlace && task.TaskState == (int)TaskRelocationStatusEnum.CarSource_Finish) |
| | | return task; |
| | | else |
| | | return null; |
| | | } |
| | | return task; |
| | | } |
| | | /// <summary> |
| | | /// æ ¹æ®è®¾å¤ç¼å·ãå½åå°åæç
§ä¼å
级以åå建æ¶é´æåºæ¥è¯¢ä»»å¡æ± æ°å¢çä»»å¡ |
| | | /// </summary> |
| | |
| | | TaskNum = Convert.ToInt32(DateTime.Now.ToString("HHmmss")), |
| | | Grade = 2, |
| | | Roadway = "SC01", |
| | | TaskType = (int)TaskOtherTypeEnum.RelocationCar, |
| | | TaskType = string.IsNullOrEmpty(remark) ? (int)TaskOtherTypeEnum.RelocationCar : (int)TaskOtherTypeEnum.RelocationCarCharging, |
| | | SourceAddress = SourceAddress, |
| | | TargetAddress = TargetAddress, |
| | | CurrentAddress = SourceAddress, |