動作
Bug #1342
進行中[Branch] 華城充電樁(Fortune TYPE_B/D) PREPARING+currentTxId=null 狀態下無法停止,連接器卡住 ~2-3 分鐘
狀態:
New
優先權:
Normal
被分派者:
-
開始日期:
2026-06-18
完成日期:
預估工時:
概述
問題描述¶
寶台 A17 場域 (ems_branch_a17) 的華城充電樁 (FORTUNE, TYPE_B/D) 在特定時序下,用戶點 stop 完全沒作用,充電樁卡在 PREPARING 狀態約 2~3 分鐘,直到華城自己 vendor timeout (vendorErrorCode 1002 插槍超時 120 秒) 才回到 AVAILABLE。
復現時序 (2026-06-18 14:00~14:04, A17 log)¶
| 時間 | 事件 | 說明 |
|---|---|---|
| 14:00:45.745 | start API → TypeD → remoteStart | 第一次啟動 |
| 14:00:46.799 | RemoteStartTransaction 成功 (transactionId=null) | 華城特性:插槍前 txId 為 null |
| 14:00:50.680 | StatusNotification: Preparing | 車主插槍 |
| 14:00:50.776 | onStatusNotification 觸發第二次 remoteStart | ChargingOrchestrator:341 補發機制 |
| 14:00:51.091 | 華城拒絕第二次 remoteStart (Rejected) | txId 還沒給,華城視為重複 start |
| 14:01:25.713 | 查詢 → 顯示 ENQUEUED | ConnectorStatusMapper:121 映射 |
| 14:01:33.805 | stop API 進入 | connectorStatus=PREPARING, currentTxId=null |
| 14:01:33.806 之後 | 完全沒有 log | TypeD 直接 return error 給前端 |
| 14:04:14.476 | 華城自己 timeout → AVAILABLE | 等待 2 分 41 秒 |
根本原因¶
src/main/java/com/sylksoft/ems/branch/service/charging/strategy/TypeDChargingStrategy.java:38-45
@Override
public RespStopChargingDto remoteStop(Connector connector, StopChargeDto dto) ... {
// Fortune 無交易停充:策略為等待 timeout(Phase 1 仍維持既有行為)
if (connector.getCurrentTransactionId() == null) {
RespStopChargingDto resp = new RespStopChargingDto();
resp.setConnectorId(connector.getId());
return support.failWithError(resp, ErrorCode.TX_FORTUNE_NO_TRANSACTION, null);
// ❌ 完全沒對充電樁發 RemoteStopTransaction 指令
}
return support.remoteStopWithTransaction(connector, dto.getUserId());
}
TypeBChargingStrategy.java:44 有相同 bug。
影響範圍¶
- Type B / Type D (Fortune 華城充電樁)
- 場景:currentTransactionId == null 且 connectorStatus == PREPARING 的短時間窗口
- 車主點 start → 插槍 → 立即點 stop
- 或 start 後車主取消意願
- 錯誤代碼:TX_FORTUNE_NO_TRANSACTION(1013, HTTP 409)
- 使用者體驗:點 stop 完全沒反應,充電樁卡住 2~3 分鐘,影響 connector slot 排程
對比:TypeA/TypeC (CloudLink) 已有正確處理¶
TypeAChargingStrategy.java:42 與 TypeCChargingStrategy.java:42 對無交易停充的處理:
// CloudLink:無交易停充 → ChangeAvailability 重置等待模式
會主動對樁發指令讓它離開等待狀態,Fortune 卻直接 return error。
修法方向(待 Ken 確認)¶
方案 A(推薦):仿 TypeA/TypeC 對華城發 ChangeAvailability 或 CancelReservation¶
- 讓樁離開 PREPARING 狀態
- 用戶體驗最佳
方案 B:放棄 null early return,直接呼叫 support.remoteStopWithTransaction()¶
- 底層會對華城發 RemoteStopTransaction (華城會以 Rejected 回應,但會離開 Preparing 狀態)
- 改動最小
方案 C:維持現狀,等 Phase 2 重新設計¶
- 不改程式碼,但用戶體驗差問題持續
參考資訊¶
- 受影響 connector:CBDAX50A-25L-A6-A072-001 (FORTUNE 華城,B1 群組,private)
- 場域:寶台 A17
- Branch:private (已包含此 bug 程式碼)
- 相關 commit:ac276f9 feat: 實作離峰充電和輪充功能
沒有任何資料可供顯示
動作