puzhibing
2026-04-21 40c1c6d5aa4f8d1d71a2bdb957e5a7a25429f22d
合并代码
4个文件已修改
49 ■■■■■ 已修改文件
xp-robotaxi-automatic-pilot-boot/src/main/java/com/xiaopeng/automaticPilot/service/KafkaConsumerService.java 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-maintenance-boot/src/main/java/com/xiaopeng/maintenance/controller/XpClockInController.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-maintenance-boot/src/main/java/com/xiaopeng/maintenance/service/impl/XpClockInServiceImpl.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-vehicle-convoy-boot/src/main/java/com/xiaopeng/vehicleConvoy/service/impl/XpVehicleServiceImpl.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-automatic-pilot-boot/src/main/java/com/xiaopeng/automaticPilot/service/KafkaConsumerService.java
@@ -73,7 +73,6 @@
@Service
public class KafkaConsumerService {
    private static final String REASSIGN_CANCEL_CONTEXT_PREFIX = "REASSIGN_CANCEL_CONTEXT:";
    private static final String REASSIGN_CANCEL_CONTEXT_PREFIX = "REASSIGN_CANCEL_CONTEXT:";
    private static final String CANCEL_ORDER_CONTEXT_PREFIX = "CANCEL_ORDER_CONTEXT:";
@@ -1291,7 +1290,7 @@
                            log.info("改派旧车取消回调,跳过订单取消处理,orderId: {}, taskId: {}, cancelScene: {}, context: {}",
                                    orderId, taskId, reassignCancelContext.getString("cancelScene"), reassignCancelContext);
                            //响应消息
                            String responseVin = resolveReassignCancelResponseVin(reassignCancelContext);
                            String responseVin = resolveReassignCancelResponseVin(orderId, reassignCancelContext);
                            if (StringUtils.isNotEmpty(responseVin)) {
                                responseMessage(cmd, sequence, responseVin);
                            } else {
@@ -1530,21 +1529,6 @@
    }
    /**
     * 兼容按订单维度缓存的改派取消上下文。
     * 该键在历史实现中使用,保留读取能力避免线上旧数据失效。
     */
    private JSONObject getReassignCancelContext(String orderId) {
        if (StringUtils.isEmpty(orderId)) {
            return null;
        }
        Object cacheObject = redisService.getCacheObject(REASSIGN_CANCEL_CONTEXT_PREFIX + orderId);
        if (cacheObject == null) {
            return null;
        }
        return JSON.parseObject(cacheObject.toString());
    }
    /**
     * 当前 cancelOrder 指令是按 taskId 记录取消上下文。
     * 改派旧车取消回调优先读取该上下文,避免依赖订单当前车/状态造成竞态误判。
     */
@@ -1589,14 +1573,13 @@
        return cancelContext;
    }
    private String resolveReassignCancelResponseVin(JSONObject cancelContext) {
    private String resolveReassignCancelResponseVin(String orderId, JSONObject cancelContext) {
        if (cancelContext == null) {
            return null;
        }
        String vin = cancelContext.getString("vin");
        if (StringUtils.isNotEmpty(vin)) {
            return vin;
            return null;
        }
        if (CancelOrderSceneEnum.REASSIGN_OLD_VEHICLE != CancelOrderSceneEnum.fromCode(
                cancelContext.getString("cancelScene"))) {
@@ -1613,7 +1596,7 @@
        boolean vehicleMatched = Objects.nonNull(newVehicleId) && Objects.equals(newVehicleId, xpOrder.getVehicleId());
        boolean statusMatched = Objects.nonNull(currentStatus) && currentStatus > 0 && currentStatus < 8;
        if (vehicleMatched && statusMatched) {
            return cancelContext;
            return newVehicleId.toString();
        }
        String oldVehicleVin = cancelContext.getString("oldVehicleVin");
        if (StringUtils.isNotEmpty(oldVehicleVin)) {
@@ -1625,26 +1608,8 @@
        }
        R<XpVehicle> vehicleResult = xpVehicleClient.queryById(oldVehicleId);
        XpVehicle xpVehicle = vehicleResult == null ? null : vehicleResult.getData();
        return xpVehicle == null ? null : xpVehicle.getVehicleVin();
        log.info("改派取消回调未命中专用上下文,orderId: {}, currentVehicleId: {}, newVehicleId: {}, currentStatus: {}",
                orderId, xpOrder.getVehicleId(), newVehicleId, currentStatus);
        return null;
    }
    private String resolveReassignCancelResponseVin(JSONObject cancelContext) {
        if (cancelContext == null) {
            return null;
        }
        String oldVehicleVin = cancelContext.getString("oldVehicleVin");
        if (StringUtils.isNotEmpty(oldVehicleVin)) {
            return oldVehicleVin;
        }
        Long oldVehicleId = cancelContext.getLong("oldVehicleId");
        if (Objects.isNull(oldVehicleId)) {
            return null;
        }
        R<XpVehicle> vehicleResult = xpVehicleClient.queryById(oldVehicleId);
        XpVehicle xpVehicle = vehicleResult == null ? null : vehicleResult.getData();
        return xpVehicle == null ? null : xpVehicle.getVehicleVin();
    }
xp-robotaxi-maintenance-boot/src/main/java/com/xiaopeng/maintenance/controller/XpClockInController.java
@@ -66,7 +66,7 @@
    @ApiOperation(value = "下班打卡", tags = "运维APP-排班与考勤")
    @PostMapping("/maintenance-app/api/v1/clock/clockOut")
    public R<Integer> clockOut(@RequestBody ClockDTO dto) {
    public R<String> clockOut(@RequestBody ClockDTO dto) {
        Long id = tokenService.getLoginOperationUser().getId();
        dto.setOperationsUserId(id);
        return xpClockInService.clockOut(dto);
xp-robotaxi-maintenance-boot/src/main/java/com/xiaopeng/maintenance/service/impl/XpClockInServiceImpl.java
@@ -177,7 +177,7 @@
    }
    @Override
    public R<Integer> clockOut(ClockDTO dto) {
    public R<String> clockOut(ClockDTO dto) {
        XpCheckLocation xpCheckLocation = xpCheckLocationMapper.selectById(dto.getLocationId());
        if (null == xpCheckLocation) {
@@ -321,7 +321,6 @@
        xpClockIn.setAppUserId(null);
        this.updateById(xpClockIn);
        sendAgreementUpdateNotification(now);
        return R.ok(xpClockIn.getClockOutResult());
    }
    private String buildAttendanceLockKey(Long appUserId, LocalDate attendanceDate) {
xp-robotaxi-vehicle-convoy-boot/src/main/java/com/xiaopeng/vehicleConvoy/service/impl/XpVehicleServiceImpl.java
@@ -528,8 +528,9 @@
        //绑定XPUID
        String vin = xpVehicle.getVehicleVin();
        R<String> xpuIdByVin = xpuVinClient.getXpuIdByVin(vin);
        if(200 != xpuIdByVin.getCode()){
        if(200 != xpuIdByVin.getCode()) {
            throw new ServiceException(xpuIdByVin.getMsg());
        }
        if (200 != xpuIdByVin.getCode()) {
            throw new RuntimeException(xpuIdByVin.getMsg());
        }