| | |
| | | /// </summary> |
| | | public void GetSC_CarFinish() |
| | | { |
| | | Dt_Task dt_Task = GetTask((int)TaskCarStatusEnum.SC_CarFinish, (int)TaskOtherTypeEnum.RelocationCar); |
| | | Dt_Task dt_Task = GetTask((int)TaskCarStatusEnum.SC_CarFinish, (int)TaskOtherTypeEnum.RelocationCar);//ç§»è½¦ä»»å¡ |
| | | if (dt_Task != null) |
| | | { |
| | | var ShuttleCar = QueryCode(dt_Task.ShuttleCarCode); |
| | | ShuttleCar.ShuttleCarPosition = dt_Task.CurrentAddress; |
| | | string[] targetCodes = ShuttleCar.ShuttleCarPosition.Split("-"); |
| | | |
| | | _shuttleCarService.UpdateData(ShuttleCar); |
| | | if (string.IsNullOrEmpty(dt_Task.Remark))//å®æç§»åºä»»å¡ |
| | | _taskService.AddTask_Hty(dt_Task, TaskOperateTypeEnum.AutoComplete); |
| | | else//ä¸åå
çµä»»å¡ |
| | | SendTask(dt_Task); |
| | | UpdateShuttleCar(dt_Task.ShuttleCarCode, dt_Task.CurrentAddress); |
| | | _taskService.AddTask_Hty(dt_Task, TaskOperateTypeEnum.AutoComplete); |
| | | } |
| | | dt_Task = GetTask((int)CarChargingTask.SC_CarFinish, (int)TaskOtherTypeEnum.RelocationCarCharging);//移车å
çµä»»å¡ |
| | | if (dt_Task != null) |
| | | { |
| | | UpdateShuttleCar(dt_Task.ShuttleCarCode, dt_Task.CurrentAddress); |
| | | SendTask(dt_Task);//ä¸åå
çµä»»å¡ |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | /// <summary> |
| | | /// ä¿®æ¹ç©¿æ¢è½¦ä½ç½®ä¿¡å· |
| | | /// </summary> |
| | | /// <param name="ShuttleCarCode">ç©¿æ¢è½¦å·</param> |
| | | /// <param name="Address">ä½ç½®</param> |
| | | public void UpdateShuttleCar(string ShuttleCarCode, string Address) |
| | | { |
| | | var ShuttleCar = QueryCode(ShuttleCarCode); |
| | | string[] targetCodes = Address.Split("-"); |
| | | var Row = Convert.ToInt16(targetCodes[0]); |
| | | if (Row == 3) |
| | | { |
| | | ShuttleCar.ShuttleCarPosition = Address; |
| | | ShuttleCar.ShuttleCarPosition1 = Address; |
| | | } |
| | | else |
| | | { |
| | | var a = Row == 1 ? 2.ToString("000") : 1.ToString("000"); |
| | | ShuttleCar.ShuttleCarPosition = Address; |
| | | ShuttleCar.ShuttleCarPosition1 = a + "-" + targetCodes[1] + "-" + targetCodes[2]; |
| | | } |
| | | _shuttleCarService.UpdateData(ShuttleCar); |
| | | } |
| | | #region è·åç§»è½¦ä»»å¡ |
| | | /// <summary> |
| | | /// è·å移车任å¡/åºå
¥åºä»»å¡ |
| | |
| | | UpdateSource(ref dt_Task, shuttleCar); |
| | | } |
| | | else |
| | | { |
| | | {//éä¼å |
| | | #region 夿æ¯å¦åå¨ç©ºé²ç©¿æ¢è½¦,å¦é½å¨å
çµ(éæ©çµéé«çå¹¶è¶
è¿50%çµéçç©¿æ¢è½¦éåºå
çµ) |
| | | QuitCharging(dt_Task, shuttleCar, command); |
| | | #endregion |
| | |
| | | } |
| | | #endregion |
| | | } |
| | | //ç©¿æ¢è½¦ç§»åºä»»å¡ä¸å |
| | | //ç©¿æ¢è½¦ç§»è½¦ä»»å¡ä¸å |
| | | if (!string.IsNullOrEmpty(dt_Task.SourceAddress) && !string.IsNullOrEmpty(dt_Task.TargetAddress) && !string.IsNullOrEmpty(dt_Task.ShuttleCarCode)) |
| | | { |
| | | SendTask(dt_Task); |
| | |
| | | #region ç©¿æ¢è½¦åºå
¥åºä»»å¡ |
| | | else |
| | | { |
| | | var task1 = _taskService.ShuttleCarRelocationTask(shuttleCar.DeviceCode);//è·åç©¿æ¢è½¦ç§»åºä»»å¡ |
| | | var task = _taskService.QueryShuttleCarTask(shuttleCar.DeviceCode); |
| | | if (task != null) |
| | | { |
| | | if (task.TaskType == (int)TaskOutboundTypeEnum.Outbound && !task.IsPickPlace) |
| | | if (task.TaskType == (int)TaskRelocationTypeEnum.Relocation && task.TaskState == (int)TaskRelocationStatusEnum.RelocationNew && !task.SourceIsPickPlace)//ç§»åºä»»å¡å¤æèµ·ç¹æ¯å¦æç©¿æ¢è½¦ |
| | | { |
| | | var ShuttleCar = _shuttleCarService.QueryShuttleCar(task.SourceAddress);//åºåºä»»å¡å¤ææ¯å¦åå¨ç©¿æ¢è½¦ |
| | | var ShuttleCar = _shuttleCarService.QueryShuttleCar(task.SourceAddress); |
| | | if (ShuttleCar != null) SendTask(task); |
| | | else _taskService.AddRelocationCarTask("", task.SourceAddress); |
| | | } |
| | | else if (task.TaskType == (int)TaskOutboundTypeEnum.Outbound && !task.SourceIsPickPlace) |
| | | { |
| | | var ShuttleCar = _shuttleCarService.QueryShuttleCar(task.SourceAddress);//åºåºä»»å¡å¤æèµ·ç¹æ¯å¦æç©¿æ¢è½¦ |
| | | if (ShuttleCar != null) SendTask(task); |
| | | else _taskService.AddRelocationCarTask("", task.SourceAddress); |
| | | } |
| | | else |
| | | SendTask(task); |
| | | } |
| | | } |
| | | #endregion |
| | |
| | | if (command != null && command.Status == (short)ShuttleCarStatus.Standby && command.TaskTypeComplete == (short)ShuttleCarTaskComplete.Standby && command.Err_Status == (short)ShuttleCarErr.Normal) |
| | | { |
| | | #region 夿å°è½¦ä½ç½®æ ABé¢ä¸ä¸åä»»å¡ |
| | | if (command.Position != 1 && command.Position != 2) |
| | | short Position = 0; |
| | | if (shuttleCar.GetValue<ShuttleCarDBName, bool>(ShuttleCarDBName.DirectionA)) Position = 1; |
| | | if (shuttleCar.GetValue<ShuttleCarDBName, bool>(ShuttleCarDBName.DirectionB)) Position = 2; |
| | | if (Position != 1 && Position != 2) |
| | | { |
| | | task.ExceptionMessage = $"{shuttleCar.DeviceName}å°è½¦ä½ç½®å¼å¸¸"; |
| | | _taskService.UpdateData(task); |
| | | var Message = $"{shuttleCar.DeviceName}æ ABé¢"; |
| | | if (task.ExceptionMessage != Message) |
| | | _taskService.UpdateData(task); |
| | | return; |
| | | } |
| | | #endregion |
| | | //ä»»å¡è½¬æ¢ |
| | | shuttleCar.SetValue(ShuttleCarDBName.Direction, Position);//åå
¥è½¦ä½æ¹å |
| | | ShuttleCarTaskCommandW shuttleCarTaskCommand = new ShuttleCarTaskCommandW(); |
| | | shuttleCarTaskCommand.Direction = command.Position; |
| | | shuttleCarTaskCommand.Direction = Position; |
| | | shuttleCarTaskCommand.TaskNum = task.TaskNum; |
| | | if (task.TaskType == (int)TaskOtherTypeEnum.RelocationCar)//移车 |
| | | { |
| | |
| | | taskType = ShuttleCarTaskType.Out; |
| | | break; |
| | | case (int)TaskOtherTypeEnum.RelocationCar: |
| | | case (int)TaskOtherTypeEnum.RelocationCarCharging: |
| | | taskType = Direction == 1 ? ShuttleCarTaskType.ZeroA : ShuttleCarTaskType.ZeroB; |
| | | break; |
| | | default: |