liujie
2026-06-09 c96fbe6b0aeb413a17c429133ee6d81d138144b9
xp-robotaxi-vehicle-convoy-boot/src/main/java/com/xiaopeng/vehicleConvoy/task/VehicleDocumentExpiryTask.java
@@ -13,6 +13,7 @@
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.List;
/**
 * 运营车辆年检/保险/运营资质过期检查定时任务
@@ -31,6 +32,12 @@
    public void checkAndStockExpiredVehicles() {
        LocalDate today = LocalDate.now(ZONE_GMT8);
        LocalDateTime todayStart = today.atStartOfDay();
        List<XpVehicle> expiredVehicles = xpVehicleService.lambdaQuery()
                .eq(XpVehicle::getVehicleType, 2)
                .and(w -> w.lt(XpVehicle::getAnnualInspectionDate, todayStart)
                        .or().lt(XpVehicle::getInsuranceEndTime, todayStart)
                        .or().lt(XpVehicle::getQualificationExpireTime, todayStart))
                .list();
        LambdaUpdateWrapper<XpVehicle> updateWrapper = new LambdaUpdateWrapper<>();
        updateWrapper.eq(XpVehicle::getVehicleType, 2)
@@ -41,6 +48,9 @@
                .set(XpVehicle::getStatus, 3);
        boolean updated = xpVehicleService.update(updateWrapper);
        if (updated) {
//            xpVehicleService.reportVehicleOperateLogoutToMinistry(expiredVehicles, "证件过期自动下线");
        }
        log.info("运营车辆证件过期检查任务执行完成,todayStart={}, updated={}", todayStart, updated);
    }
}