“mitao”
2026-03-10 eb290fd6e70b6523ea0889936dba4d9f2d5c4b53
Merge remote-tracking branch 'origin/master'

# Conflicts:
# xp-robotaxi-order-boot/src/main/java/com/xiaopeng/order/service/impl/XpOrderServiceImpl.java
1个文件已添加
21个文件已修改
1612 ■■■■■ 已修改文件
sql/增量sql/xprt_account.sql 1 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
sql/增量sql/xprt_maintenance.sql 121 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
sql/增量sql/xprt_operation.sql 222 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
sql/增量sql/xprt_order.sql 104 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-api/src/main/java/com/xiaopeng/api/dto/operation/VehiclePositionByVinDto.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-api/src/main/java/com/xiaopeng/api/dto/pushMessage/PushOrderRouteDTO.java 4 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-api/src/main/java/com/xiaopeng/api/vo/operation/VehiclePositionVo.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-automatic-pilot-boot/src/main/java/com/xiaopeng/automaticPilot/controller/OrderMissionController.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-automatic-pilot-boot/src/main/java/com/xiaopeng/automaticPilot/service/KafkaConsumerService.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-common/xp-common-redis/src/main/java/com/xiaopeng/common/redis/service/RedisService.java 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-itinerary-boot/src/main/java/com/xiaopeng/itinerary/controller/XpPricingController.java 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-itinerary-boot/src/main/java/com/xiaopeng/itinerary/service/impl/XpPricingServiceImpl.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-itinerary-boot/src/main/java/com/xiaopeng/itinerary/vo/HotFixInfoVo.java 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-maintenance-boot/src/main/java/com/xiaopeng/maintenance/service/impl/XpSchedulingDetailServiceImpl.java 170 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-maintenance-boot/src/main/java/com/xiaopeng/maintenance/service/impl/XpVehicleRepairServiceImpl.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/controller/OssController.java 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/utils/TaskOrderUtil.java 709 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-operation-boot/src/main/resources/mapper/operation/XpPointMapper.xml 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-order-boot/src/main/java/com/xiaopeng/order/model/vo/XpOrderHistoryListVO.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-order-boot/src/main/java/com/xiaopeng/order/service/impl/XpCruiseOrderServiceImpl.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-order-boot/src/main/java/com/xiaopeng/order/service/impl/XpOrderServiceImpl.java 101 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-order-boot/src/main/resources/mapper/order/XpOrderMapper.xml 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
sql/增量sql/xprt_account.sql
@@ -1 +0,0 @@
ALTER TABLE `xp_operations_user` MODIFY COLUMN `remarks` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '备注' AFTER `phone_number`;
sql/增量sql/xprt_maintenance.sql
@@ -1,121 +0,0 @@
ALTER TABLE `xp_task_0` ADD COLUMN `expired_notice_sent` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否已发送过期通知 0=未发送 1=已发送' AFTER `end_time`;
ALTER TABLE `xp_task_1` ADD COLUMN `expired_notice_sent` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否已发送过期通知 0=未发送 1=已发送' AFTER `end_time`;
ALTER TABLE `xp_task_2` ADD COLUMN `expired_notice_sent` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否已发送过期通知 0=未发送 1=已发送' AFTER `end_time`;
ALTER TABLE `xp_task_3` ADD COLUMN `expired_notice_sent` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否已发送过期通知 0=未发送 1=已发送' AFTER `end_time`;
ALTER TABLE `xp_task_4` ADD COLUMN `expired_notice_sent` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否已发送过期通知 0=未发送 1=已发送' AFTER `end_time`;
ALTER TABLE `xp_task_5` ADD COLUMN `expired_notice_sent` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否已发送过期通知 0=未发送 1=已发送' AFTER `end_time`;
ALTER TABLE `xp_task_6` ADD COLUMN `expired_notice_sent` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否已发送过期通知 0=未发送 1=已发送' AFTER `end_time`;
ALTER TABLE `xp_task_7` ADD COLUMN `expired_notice_sent` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否已发送过期通知 0=未发送 1=已发送' AFTER `end_time`;
ALTER TABLE `xp_task_8` ADD COLUMN `expired_notice_sent` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否已发送过期通知 0=未发送 1=已发送' AFTER `end_time`;
ALTER TABLE `xp_task_9` ADD COLUMN `expired_notice_sent` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否已发送过期通知 0=未发送 1=已发送' AFTER `end_time`;
ALTER TABLE `xp_task_10` ADD COLUMN `expired_notice_sent` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否已发送过期通知 0=未发送 1=已发送' AFTER `end_time`;
ALTER TABLE `xp_task_11` ADD COLUMN `expired_notice_sent` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否已发送过期通知 0=未发送 1=已发送' AFTER `end_time`;
ALTER TABLE `xp_task_12` ADD COLUMN `expired_notice_sent` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否已发送过期通知 0=未发送 1=已发送' AFTER `end_time`;
ALTER TABLE `xp_task_13` ADD COLUMN `expired_notice_sent` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否已发送过期通知 0=未发送 1=已发送' AFTER `end_time`;
ALTER TABLE `xp_task_14` ADD COLUMN `expired_notice_sent` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否已发送过期通知 0=未发送 1=已发送' AFTER `end_time`;
ALTER TABLE `xp_task_15` ADD COLUMN `expired_notice_sent` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否已发送过期通知 0=未发送 1=已发送' AFTER `end_time`;
ALTER TABLE `xp_task_16` ADD COLUMN `expired_notice_sent` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否已发送过期通知 0=未发送 1=已发送' AFTER `end_time`;
ALTER TABLE `xp_task_17` ADD COLUMN `expired_notice_sent` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否已发送过期通知 0=未发送 1=已发送' AFTER `end_time`;
ALTER TABLE `xp_task_18` ADD COLUMN `expired_notice_sent` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否已发送过期通知 0=未发送 1=已发送' AFTER `end_time`;
ALTER TABLE `xp_task_19` ADD COLUMN `expired_notice_sent` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否已发送过期通知 0=未发送 1=已发送' AFTER `end_time`;
ALTER TABLE `xp_task_handle_detail_0` MODIFY COLUMN `responsible_description` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '交警判责现场情况' AFTER `responsibility_judgment`;
ALTER TABLE `xp_task_handle_detail_0` MODIFY COLUMN `disposal_description` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '处置情况描述' AFTER `responsible_image`;
ALTER TABLE `xp_task_handle_detail_1` MODIFY COLUMN `responsible_description` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '交警判责现场情况' AFTER `responsibility_judgment`;
ALTER TABLE `xp_task_handle_detail_1` MODIFY COLUMN `disposal_description` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '处置情况描述' AFTER `responsible_image`;
ALTER TABLE `xp_task_handle_detail_2` MODIFY COLUMN `responsible_description` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '交警判责现场情况' AFTER `responsibility_judgment`;
ALTER TABLE `xp_task_handle_detail_2` MODIFY COLUMN `disposal_description` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '处置情况描述' AFTER `responsible_image`;
ALTER TABLE `xp_task_handle_detail_3` MODIFY COLUMN `responsible_description` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '交警判责现场情况' AFTER `responsibility_judgment`;
ALTER TABLE `xp_task_handle_detail_3` MODIFY COLUMN `disposal_description` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '处置情况描述' AFTER `responsible_image`;
ALTER TABLE `xp_task_handle_detail_4` MODIFY COLUMN `responsible_description` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '交警判责现场情况' AFTER `responsibility_judgment`;
ALTER TABLE `xp_task_handle_detail_4` MODIFY COLUMN `disposal_description` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '处置情况描述' AFTER `responsible_image`;
ALTER TABLE `xp_task_handle_detail_5` MODIFY COLUMN `responsible_description` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '交警判责现场情况' AFTER `responsibility_judgment`;
ALTER TABLE `xp_task_handle_detail_5` MODIFY COLUMN `disposal_description` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '处置情况描述' AFTER `responsible_image`;
ALTER TABLE `xp_task_handle_detail_6` MODIFY COLUMN `responsible_description` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '交警判责现场情况' AFTER `responsibility_judgment`;
ALTER TABLE `xp_task_handle_detail_6` MODIFY COLUMN `disposal_description` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '处置情况描述' AFTER `responsible_image`;
ALTER TABLE `xp_task_handle_detail_7` MODIFY COLUMN `responsible_description` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '交警判责现场情况' AFTER `responsibility_judgment`;
ALTER TABLE `xp_task_handle_detail_7` MODIFY COLUMN `disposal_description` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '处置情况描述' AFTER `responsible_image`;
ALTER TABLE `xp_task_handle_detail_8` MODIFY COLUMN `responsible_description` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '交警判责现场情况' AFTER `responsibility_judgment`;
ALTER TABLE `xp_task_handle_detail_8` MODIFY COLUMN `disposal_description` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '处置情况描述' AFTER `responsible_image`;
ALTER TABLE `xp_task_handle_detail_9` MODIFY COLUMN `responsible_description` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '交警判责现场情况' AFTER `responsibility_judgment`;
ALTER TABLE `xp_task_handle_detail_9` MODIFY COLUMN `disposal_description` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '处置情况描述' AFTER `responsible_image`;
ALTER TABLE `xp_task_handle_detail_10` MODIFY COLUMN `responsible_description` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '交警判责现场情况' AFTER `responsibility_judgment`;
ALTER TABLE `xp_task_handle_detail_10` MODIFY COLUMN `disposal_description` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '处置情况描述' AFTER `responsible_image`;
ALTER TABLE `xp_task_handle_detail_11` MODIFY COLUMN `responsible_description` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '交警判责现场情况' AFTER `responsibility_judgment`;
ALTER TABLE `xp_task_handle_detail_11` MODIFY COLUMN `disposal_description` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '处置情况描述' AFTER `responsible_image`;
ALTER TABLE `xp_task_handle_detail_12` MODIFY COLUMN `responsible_description` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '交警判责现场情况' AFTER `responsibility_judgment`;
ALTER TABLE `xp_task_handle_detail_12` MODIFY COLUMN `disposal_description` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '处置情况描述' AFTER `responsible_image`;
ALTER TABLE `xp_task_handle_detail_13` MODIFY COLUMN `responsible_description` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '交警判责现场情况' AFTER `responsibility_judgment`;
ALTER TABLE `xp_task_handle_detail_13` MODIFY COLUMN `disposal_description` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '处置情况描述' AFTER `responsible_image`;
ALTER TABLE `xp_task_handle_detail_14` MODIFY COLUMN `responsible_description` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '交警判责现场情况' AFTER `responsibility_judgment`;
ALTER TABLE `xp_task_handle_detail_14` MODIFY COLUMN `disposal_description` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '处置情况描述' AFTER `responsible_image`;
ALTER TABLE `xp_task_handle_detail_15` MODIFY COLUMN `responsible_description` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '交警判责现场情况' AFTER `responsibility_judgment`;
ALTER TABLE `xp_task_handle_detail_15` MODIFY COLUMN `disposal_description` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '处置情况描述' AFTER `responsible_image`;
ALTER TABLE `xp_task_handle_detail_16` MODIFY COLUMN `responsible_description` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '交警判责现场情况' AFTER `responsibility_judgment`;
ALTER TABLE `xp_task_handle_detail_16` MODIFY COLUMN `disposal_description` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '处置情况描述' AFTER `responsible_image`;
ALTER TABLE `xp_task_handle_detail_17` MODIFY COLUMN `responsible_description` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '交警判责现场情况' AFTER `responsibility_judgment`;
ALTER TABLE `xp_task_handle_detail_17` MODIFY COLUMN `disposal_description` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '处置情况描述' AFTER `responsible_image`;
ALTER TABLE `xp_task_handle_detail_18` MODIFY COLUMN `responsible_description` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '交警判责现场情况' AFTER `responsibility_judgment`;
ALTER TABLE `xp_task_handle_detail_18` MODIFY COLUMN `disposal_description` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '处置情况描述' AFTER `responsible_image`;
ALTER TABLE `xp_task_handle_detail_19` MODIFY COLUMN `responsible_description` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '交警判责现场情况' AFTER `responsibility_judgment`;
ALTER TABLE `xp_task_handle_detail_19` MODIFY COLUMN `disposal_description` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '处置情况描述' AFTER `responsible_image`;
ALTER TABLE `xp_vehicle` MODIFY COLUMN `electronic_id` bigint NULL DEFAULT NULL COMMENT '围栏id' AFTER `policy_information`;
sql/增量sql/xprt_operation.sql
@@ -1,221 +1 @@
SET FOREIGN_KEY_CHECKS=0;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point` ADD COLUMN `stop_flag` tinyint NULL DEFAULT NULL COMMENT '是否停车 0-否 1-是' AFTER `sort_order`;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point` MODIFY COLUMN `point_id` bigint NULL DEFAULT NULL COMMENT '点位ID' AFTER `cruise_plan_id`;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point` DROP COLUMN `is_deleted`;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point` DROP COLUMN `create_time`;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point` DROP COLUMN `update_time`;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point` DROP COLUMN `create_by`;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point` DROP COLUMN `update_by`;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point_0` ADD COLUMN `id` bigint NOT NULL COMMENT '自增id' FIRST;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point_0` ADD COLUMN `stop_flag` tinyint NULL DEFAULT NULL COMMENT '是否停车 0-否 1-是' AFTER `sort_order`;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point_0` MODIFY COLUMN `point_id` bigint NULL DEFAULT NULL COMMENT '点位ID' AFTER `cruise_plan_id`;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point_0` ADD PRIMARY KEY (`id`) USING BTREE;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point_0` DROP COLUMN `is_deleted`;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point_0` DROP COLUMN `create_time`;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point_0` DROP COLUMN `update_time`;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point_0` DROP COLUMN `create_by`;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point_0` DROP COLUMN `update_by`;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point_1` ADD COLUMN `id` bigint NOT NULL COMMENT '自增id' FIRST;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point_1` ADD COLUMN `stop_flag` tinyint NULL DEFAULT NULL COMMENT '是否停车 0-否 1-是' AFTER `sort_order`;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point_1` MODIFY COLUMN `point_id` bigint NULL DEFAULT NULL COMMENT '点位ID' AFTER `cruise_plan_id`;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point_1` ADD PRIMARY KEY (`id`) USING BTREE;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point_1` DROP COLUMN `is_deleted`;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point_1` DROP COLUMN `create_time`;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point_1` DROP COLUMN `update_time`;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point_1` DROP COLUMN `create_by`;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point_1` DROP COLUMN `update_by`;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point_2` ADD COLUMN `id` bigint NOT NULL COMMENT '自增id' FIRST;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point_2` ADD COLUMN `stop_flag` tinyint NULL DEFAULT NULL COMMENT '是否停车 0-否 1-是' AFTER `sort_order`;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point_2` MODIFY COLUMN `point_id` bigint NULL DEFAULT NULL COMMENT '点位ID' AFTER `cruise_plan_id`;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point_2` ADD PRIMARY KEY (`id`) USING BTREE;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point_2` DROP COLUMN `is_deleted`;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point_2` DROP COLUMN `create_time`;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point_2` DROP COLUMN `update_time`;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point_2` DROP COLUMN `create_by`;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point_2` DROP COLUMN `update_by`;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point_3` ADD COLUMN `id` bigint NOT NULL COMMENT '自增id' FIRST;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point_3` ADD COLUMN `stop_flag` tinyint NULL DEFAULT NULL COMMENT '是否停车 0-否 1-是' AFTER `sort_order`;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point_3` MODIFY COLUMN `point_id` bigint NULL DEFAULT NULL COMMENT '点位ID' AFTER `cruise_plan_id`;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point_3` ADD PRIMARY KEY (`id`) USING BTREE;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point_3` DROP COLUMN `is_deleted`;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point_3` DROP COLUMN `create_time`;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point_3` DROP COLUMN `update_time`;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point_3` DROP COLUMN `create_by`;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point_3` DROP COLUMN `update_by`;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point_4` ADD COLUMN `id` bigint NOT NULL COMMENT '自增id' FIRST;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point_4` ADD COLUMN `stop_flag` tinyint NULL DEFAULT NULL COMMENT '是否停车 0-否 1-是' AFTER `sort_order`;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point_4` MODIFY COLUMN `point_id` bigint NULL DEFAULT NULL COMMENT '点位ID' AFTER `cruise_plan_id`;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point_4` ADD PRIMARY KEY (`id`) USING BTREE;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point_4` DROP COLUMN `is_deleted`;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point_4` DROP COLUMN `create_time`;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point_4` DROP COLUMN `update_time`;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point_4` DROP COLUMN `create_by`;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point_4` DROP COLUMN `update_by`;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point_5` ADD COLUMN `id` bigint NOT NULL COMMENT '自增id' FIRST;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point_5` ADD COLUMN `stop_flag` tinyint NULL DEFAULT NULL COMMENT '是否停车 0-否 1-是' AFTER `sort_order`;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point_5` MODIFY COLUMN `point_id` bigint NULL DEFAULT NULL COMMENT '点位ID' AFTER `cruise_plan_id`;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point_5` ADD PRIMARY KEY (`id`) USING BTREE;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point_5` DROP COLUMN `is_deleted`;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point_5` DROP COLUMN `create_time`;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point_5` DROP COLUMN `update_time`;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point_5` DROP COLUMN `create_by`;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point_5` DROP COLUMN `update_by`;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point_6` ADD COLUMN `id` bigint NOT NULL COMMENT '自增id' FIRST;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point_6` ADD COLUMN `stop_flag` tinyint NULL DEFAULT NULL COMMENT '是否停车 0-否 1-是' AFTER `sort_order`;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point_6` MODIFY COLUMN `point_id` bigint NULL DEFAULT NULL COMMENT '点位ID' AFTER `cruise_plan_id`;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point_6` ADD PRIMARY KEY (`id`) USING BTREE;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point_6` DROP COLUMN `is_deleted`;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point_6` DROP COLUMN `create_time`;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point_6` DROP COLUMN `update_time`;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point_6` DROP COLUMN `create_by`;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point_6` DROP COLUMN `update_by`;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point_7` ADD COLUMN `id` bigint NOT NULL COMMENT '自增id' FIRST;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point_7` ADD COLUMN `stop_flag` tinyint NULL DEFAULT NULL COMMENT '是否停车 0-否 1-是' AFTER `sort_order`;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point_7` MODIFY COLUMN `point_id` bigint NULL DEFAULT NULL COMMENT '点位ID' AFTER `cruise_plan_id`;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point_7` ADD PRIMARY KEY (`id`) USING BTREE;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point_7` DROP COLUMN `is_deleted`;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point_7` DROP COLUMN `create_time`;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point_7` DROP COLUMN `update_time`;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point_7` DROP COLUMN `create_by`;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point_7` DROP COLUMN `update_by`;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point_8` ADD COLUMN `id` bigint NOT NULL COMMENT '自增id' FIRST;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point_8` ADD COLUMN `stop_flag` tinyint NULL DEFAULT NULL COMMENT '是否停车 0-否 1-是' AFTER `sort_order`;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point_8` MODIFY COLUMN `point_id` bigint NULL DEFAULT NULL COMMENT '点位ID' AFTER `cruise_plan_id`;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point_8` ADD PRIMARY KEY (`id`) USING BTREE;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point_8` DROP COLUMN `is_deleted`;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point_8` DROP COLUMN `create_time`;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point_8` DROP COLUMN `update_time`;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point_8` DROP COLUMN `create_by`;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point_8` DROP COLUMN `update_by`;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point_9` ADD COLUMN `id` bigint NOT NULL COMMENT '自增id' FIRST;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point_9` ADD COLUMN `stop_flag` tinyint NULL DEFAULT NULL COMMENT '是否停车 0-否 1-是' AFTER `sort_order`;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point_9` MODIFY COLUMN `point_id` bigint NULL DEFAULT NULL COMMENT '点位ID' AFTER `cruise_plan_id`;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point_9` ADD PRIMARY KEY (`id`) USING BTREE;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point_9` DROP COLUMN `is_deleted`;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point_9` DROP COLUMN `create_time`;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point_9` DROP COLUMN `update_time`;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point_9` DROP COLUMN `create_by`;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_point_9` DROP COLUMN `update_by`;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_vehicle` DROP PRIMARY KEY;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_vehicle` DROP COLUMN `id`;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_vehicle` DROP COLUMN `is_deleted`;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_vehicle` DROP COLUMN `create_time`;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_vehicle` DROP COLUMN `update_time`;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_vehicle` DROP COLUMN `create_by`;
ALTER TABLE `xpeng_operation`.`xp_cruise_plan_vehicle` DROP COLUMN `update_by`;
ALTER TABLE `xpeng_operation`.`xp_notification` MODIFY COLUMN `notification_type` int NOT NULL DEFAULT 1 COMMENT '通知类型 1=新增事故,2=事故即将超时提示,3=事故超时提示,4=排班信息变动,5=事故状态变更,6=新增任务,7=任务过期提示,8=版本更新提示,9=变更协议政策内容,10=变更协议内容并需用户授权,11=打卡成功通知' AFTER `id`;
ALTER TABLE `xpeng_operation`.`xp_point` MODIFY COLUMN `parking_point` int NULL DEFAULT 0 COMMENT '0否  1是 收车点位' AFTER `charge_point`;
ALTER TABLE `xpeng_operation`.`xp_region` ADD COLUMN `china` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL AFTER `lon`;
ALTER TABLE `xpeng_operation`.`xp_trading_strategy_city` MODIFY COLUMN `id` bigint NOT NULL FIRST;
ALTER TABLE `xpeng_operation`.`xp_trading_strategy_city` MODIFY COLUMN `id` bigint NOT NULL AUTO_INCREMENT;
SET FOREIGN_KEY_CHECKS=1;
ALTER TABLE `xp_electronic_fence_area` ADD COLUMN `operation_strategy` json NULL COMMENT '运营策略' AFTER `city_code`;
sql/增量sql/xprt_order.sql
@@ -1,101 +1,103 @@
ALTER TABLE `xp_cruise_order` MODIFY COLUMN `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL FIRST;
ALTER TABLE `xp_cruise_order` MODIFY COLUMN `start_point_id` bigint NULL DEFAULT NULL COMMENT '起点站点id' AFTER `end_lat`;
ALTER TABLE `xp_cruise_order_0` MODIFY COLUMN `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL FIRST;
ALTER TABLE `xp_cruise_order` MODIFY COLUMN `start_point_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '起点站点名称' AFTER `end_point_id`;
ALTER TABLE `xp_cruise_order_1` MODIFY COLUMN `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL FIRST;
ALTER TABLE `xp_cruise_order_0` MODIFY COLUMN `start_point_id` bigint NULL DEFAULT NULL COMMENT '起点站点id' AFTER `end_lat`;
ALTER TABLE `xp_cruise_order_2` MODIFY COLUMN `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL FIRST;
ALTER TABLE `xp_cruise_order_1` MODIFY COLUMN `start_point_id` bigint NULL DEFAULT NULL COMMENT '起点站点id' AFTER `end_lat`;
ALTER TABLE `xp_cruise_order_3` MODIFY COLUMN `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL FIRST;
ALTER TABLE `xp_cruise_order_2` MODIFY COLUMN `start_point_id` bigint NULL DEFAULT NULL COMMENT '起点站点id' AFTER `end_lat`;
ALTER TABLE `xp_cruise_order_4` MODIFY COLUMN `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL FIRST;
ALTER TABLE `xp_cruise_order_3` MODIFY COLUMN `start_point_id` bigint NULL DEFAULT NULL COMMENT '起点站点id' AFTER `end_lat`;
ALTER TABLE `xp_cruise_order_5` MODIFY COLUMN `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL FIRST;
ALTER TABLE `xp_cruise_order_4` MODIFY COLUMN `start_point_id` bigint NULL DEFAULT NULL COMMENT '起点站点id' AFTER `end_lat`;
ALTER TABLE `xp_cruise_order_6` MODIFY COLUMN `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL FIRST;
ALTER TABLE `xp_cruise_order_5` MODIFY COLUMN `start_point_id` bigint NULL DEFAULT NULL COMMENT '起点站点id' AFTER `end_lat`;
ALTER TABLE `xp_cruise_order_7` MODIFY COLUMN `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL FIRST;
ALTER TABLE `xp_cruise_order_6` MODIFY COLUMN `start_point_id` bigint NULL DEFAULT NULL COMMENT '起点站点id' AFTER `end_lat`;
ALTER TABLE `xp_cruise_order_8` MODIFY COLUMN `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL FIRST;
ALTER TABLE `xp_cruise_order_7` MODIFY COLUMN `start_point_id` bigint NULL DEFAULT NULL COMMENT '起点站点id' AFTER `end_lat`;
ALTER TABLE `xp_cruise_order_9` MODIFY COLUMN `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL FIRST;
ALTER TABLE `xp_cruise_order_8` MODIFY COLUMN `start_point_id` bigint NULL DEFAULT NULL COMMENT '起点站点id' AFTER `end_lat`;
ALTER TABLE `xp_cruise_order_10` MODIFY COLUMN `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL FIRST;
ALTER TABLE `xp_cruise_order_9` MODIFY COLUMN `start_point_id` bigint NULL DEFAULT NULL COMMENT '起点站点id' AFTER `end_lat`;
ALTER TABLE `xp_cruise_order_11` MODIFY COLUMN `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL FIRST;
ALTER TABLE `xp_cruise_order_10` MODIFY COLUMN `start_point_id` bigint NULL DEFAULT NULL COMMENT '起点站点id' AFTER `end_lat`;
ALTER TABLE `xp_cruise_order_12` MODIFY COLUMN `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL FIRST;
ALTER TABLE `xp_cruise_order_11` MODIFY COLUMN `start_point_id` bigint NULL DEFAULT NULL COMMENT '起点站点id' AFTER `end_lat`;
ALTER TABLE `xp_cruise_order_13` MODIFY COLUMN `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL FIRST;
ALTER TABLE `xp_cruise_order_12` MODIFY COLUMN `start_point_id` bigint NULL DEFAULT NULL COMMENT '起点站点id' AFTER `end_lat`;
ALTER TABLE `xp_cruise_order_14` MODIFY COLUMN `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL FIRST;
ALTER TABLE `xp_cruise_order_13` MODIFY COLUMN `start_point_id` bigint NULL DEFAULT NULL COMMENT '起点站点id' AFTER `end_lat`;
ALTER TABLE `xp_cruise_order_15` MODIFY COLUMN `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL FIRST;
ALTER TABLE `xp_cruise_order_14` MODIFY COLUMN `start_point_id` bigint NULL DEFAULT NULL COMMENT '起点站点id' AFTER `end_lat`;
ALTER TABLE `xp_cruise_order_16` MODIFY COLUMN `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL FIRST;
ALTER TABLE `xp_cruise_order_15` MODIFY COLUMN `start_point_id` bigint NULL DEFAULT NULL COMMENT '起点站点id' AFTER `end_lat`;
ALTER TABLE `xp_cruise_order_17` MODIFY COLUMN `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL FIRST;
ALTER TABLE `xp_cruise_order_16` MODIFY COLUMN `start_point_id` bigint NULL DEFAULT NULL COMMENT '起点站点id' AFTER `end_lat`;
ALTER TABLE `xp_cruise_order_18` MODIFY COLUMN `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL FIRST;
ALTER TABLE `xp_cruise_order_17` MODIFY COLUMN `start_point_id` bigint NULL DEFAULT NULL COMMENT '起点站点id' AFTER `end_lat`;
ALTER TABLE `xp_cruise_order_19` MODIFY COLUMN `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL FIRST;
ALTER TABLE `xp_cruise_order_18` MODIFY COLUMN `start_point_id` bigint NULL DEFAULT NULL COMMENT '起点站点id' AFTER `end_lat`;
ALTER TABLE `xp_cruise_order_20` MODIFY COLUMN `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL FIRST;
ALTER TABLE `xp_cruise_order_19` MODIFY COLUMN `start_point_id` bigint NULL DEFAULT NULL COMMENT '起点站点id' AFTER `end_lat`;
ALTER TABLE `xp_cruise_order_21` MODIFY COLUMN `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL FIRST;
ALTER TABLE `xp_cruise_order_20` MODIFY COLUMN `start_point_id` bigint NULL DEFAULT NULL COMMENT '起点站点id' AFTER `end_lat`;
ALTER TABLE `xp_cruise_order_22` MODIFY COLUMN `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL FIRST;
ALTER TABLE `xp_cruise_order_21` MODIFY COLUMN `start_point_id` bigint NULL DEFAULT NULL COMMENT '起点站点id' AFTER `end_lat`;
ALTER TABLE `xp_cruise_order_23` MODIFY COLUMN `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL FIRST;
ALTER TABLE `xp_cruise_order_22` MODIFY COLUMN `start_point_id` bigint NULL DEFAULT NULL COMMENT '起点站点id' AFTER `end_lat`;
ALTER TABLE `xp_cruise_order_24` MODIFY COLUMN `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL FIRST;
ALTER TABLE `xp_cruise_order_23` MODIFY COLUMN `start_point_id` bigint NULL DEFAULT NULL COMMENT '起点站点id' AFTER `end_lat`;
ALTER TABLE `xp_cruise_order_25` MODIFY COLUMN `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL FIRST;
ALTER TABLE `xp_cruise_order_24` MODIFY COLUMN `start_point_id` bigint NULL DEFAULT NULL COMMENT '起点站点id' AFTER `end_lat`;
ALTER TABLE `xp_cruise_order_26` MODIFY COLUMN `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL FIRST;
ALTER TABLE `xp_cruise_order_25` MODIFY COLUMN `start_point_id` bigint NULL DEFAULT NULL COMMENT '起点站点id' AFTER `end_lat`;
ALTER TABLE `xp_cruise_order_27` MODIFY COLUMN `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL FIRST;
ALTER TABLE `xp_cruise_order_26` MODIFY COLUMN `start_point_id` bigint NULL DEFAULT NULL COMMENT '起点站点id' AFTER `end_lat`;
ALTER TABLE `xp_cruise_order_28` MODIFY COLUMN `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL FIRST;
ALTER TABLE `xp_cruise_order_27` MODIFY COLUMN `start_point_id` bigint NULL DEFAULT NULL COMMENT '起点站点id' AFTER `end_lat`;
ALTER TABLE `xp_cruise_order_29` MODIFY COLUMN `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL FIRST;
ALTER TABLE `xp_cruise_order_28` MODIFY COLUMN `start_point_id` bigint NULL DEFAULT NULL COMMENT '起点站点id' AFTER `end_lat`;
ALTER TABLE `xp_cruise_order_30` MODIFY COLUMN `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL FIRST;
ALTER TABLE `xp_cruise_order_29` MODIFY COLUMN `start_point_id` bigint NULL DEFAULT NULL COMMENT '起点站点id' AFTER `end_lat`;
ALTER TABLE `xp_cruise_order_31` MODIFY COLUMN `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL FIRST;
ALTER TABLE `xp_cruise_order_30` MODIFY COLUMN `start_point_id` bigint NULL DEFAULT NULL COMMENT '起点站点id' AFTER `end_lat`;
ALTER TABLE `xp_cruise_order_32` MODIFY COLUMN `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL FIRST;
ALTER TABLE `xp_cruise_order_31` MODIFY COLUMN `start_point_id` bigint NULL DEFAULT NULL COMMENT '起点站点id' AFTER `end_lat`;
ALTER TABLE `xp_cruise_order_33` MODIFY COLUMN `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL FIRST;
ALTER TABLE `xp_cruise_order_32` MODIFY COLUMN `start_point_id` bigint NULL DEFAULT NULL COMMENT '起点站点id' AFTER `end_lat`;
ALTER TABLE `xp_cruise_order_34` MODIFY COLUMN `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL FIRST;
ALTER TABLE `xp_cruise_order_33` MODIFY COLUMN `start_point_id` bigint NULL DEFAULT NULL COMMENT '起点站点id' AFTER `end_lat`;
ALTER TABLE `xp_cruise_order_35` MODIFY COLUMN `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL FIRST;
ALTER TABLE `xp_cruise_order_34` MODIFY COLUMN `start_point_id` bigint NULL DEFAULT NULL COMMENT '起点站点id' AFTER `end_lat`;
ALTER TABLE `xp_cruise_order_36` MODIFY COLUMN `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL FIRST;
ALTER TABLE `xp_cruise_order_35` MODIFY COLUMN `start_point_id` bigint NULL DEFAULT NULL COMMENT '起点站点id' AFTER `end_lat`;
ALTER TABLE `xp_cruise_order_37` MODIFY COLUMN `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL FIRST;
ALTER TABLE `xp_cruise_order_36` MODIFY COLUMN `start_point_id` bigint NULL DEFAULT NULL COMMENT '起点站点id' AFTER `end_lat`;
ALTER TABLE `xp_cruise_order_38` MODIFY COLUMN `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL FIRST;
ALTER TABLE `xp_cruise_order_37` MODIFY COLUMN `start_point_id` bigint NULL DEFAULT NULL COMMENT '起点站点id' AFTER `end_lat`;
ALTER TABLE `xp_cruise_order_39` MODIFY COLUMN `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL FIRST;
ALTER TABLE `xp_cruise_order_38` MODIFY COLUMN `start_point_id` bigint NULL DEFAULT NULL COMMENT '起点站点id' AFTER `end_lat`;
ALTER TABLE `xp_cruise_order_40` MODIFY COLUMN `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL FIRST;
ALTER TABLE `xp_cruise_order_39` MODIFY COLUMN `start_point_id` bigint NULL DEFAULT NULL COMMENT '起点站点id' AFTER `end_lat`;
ALTER TABLE `xp_cruise_order_41` MODIFY COLUMN `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL FIRST;
ALTER TABLE `xp_cruise_order_40` MODIFY COLUMN `start_point_id` bigint NULL DEFAULT NULL COMMENT '起点站点id' AFTER `end_lat`;
ALTER TABLE `xp_cruise_order_42` MODIFY COLUMN `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL FIRST;
ALTER TABLE `xp_cruise_order_41` MODIFY COLUMN `start_point_id` bigint NULL DEFAULT NULL COMMENT '起点站点id' AFTER `end_lat`;
ALTER TABLE `xp_cruise_order_43` MODIFY COLUMN `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL FIRST;
ALTER TABLE `xp_cruise_order_42` MODIFY COLUMN `start_point_id` bigint NULL DEFAULT NULL COMMENT '起点站点id' AFTER `end_lat`;
ALTER TABLE `xp_cruise_order_44` MODIFY COLUMN `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL FIRST;
ALTER TABLE `xp_cruise_order_43` MODIFY COLUMN `start_point_id` bigint NULL DEFAULT NULL COMMENT '起点站点id' AFTER `end_lat`;
ALTER TABLE `xp_cruise_order_45` MODIFY COLUMN `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL FIRST;
ALTER TABLE `xp_cruise_order_44` MODIFY COLUMN `start_point_id` bigint NULL DEFAULT NULL COMMENT '起点站点id' AFTER `end_lat`;
ALTER TABLE `xp_cruise_order_46` MODIFY COLUMN `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL FIRST;
ALTER TABLE `xp_cruise_order_45` MODIFY COLUMN `start_point_id` bigint NULL DEFAULT NULL COMMENT '起点站点id' AFTER `end_lat`;
ALTER TABLE `xp_cruise_order_47` MODIFY COLUMN `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL FIRST;
ALTER TABLE `xp_cruise_order_46` MODIFY COLUMN `start_point_id` bigint NULL DEFAULT NULL COMMENT '起点站点id' AFTER `end_lat`;
ALTER TABLE `xp_cruise_order_48` MODIFY COLUMN `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL FIRST;
ALTER TABLE `xp_cruise_order_47` MODIFY COLUMN `start_point_id` bigint NULL DEFAULT NULL COMMENT '起点站点id' AFTER `end_lat`;
ALTER TABLE `xp_cruise_order_49` MODIFY COLUMN `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL FIRST;
ALTER TABLE `xp_cruise_order_48` MODIFY COLUMN `start_point_id` bigint NULL DEFAULT NULL COMMENT '起点站点id' AFTER `end_lat`;
ALTER TABLE `xp_cruise_order_49` MODIFY COLUMN `start_point_id` bigint NULL DEFAULT NULL COMMENT '起点站点id' AFTER `end_lat`;
xp-robotaxi-api/src/main/java/com/xiaopeng/api/dto/operation/VehiclePositionByVinDto.java
@@ -6,6 +6,7 @@
import lombok.NoArgsConstructor;
import java.util.List;
import java.util.Set;
@Data
@ApiModel(value = "筛选车辆信息Dto")
@@ -17,7 +18,7 @@
    private Long fenceId;
    // 车辆vin
    private List<String> vinList;
    private Set<String> vinList;
    // 数量
xp-robotaxi-api/src/main/java/com/xiaopeng/api/dto/pushMessage/PushOrderRouteDTO.java
@@ -23,11 +23,11 @@
    @ApiModelProperty(value = "纬度")
    private Double latitude;
    @NotNull(message = "剩余距离不能为空")
//    @NotNull(message = "剩余距离不能为空")
    @ApiModelProperty(value = "剩余距离")
    private Integer distance;
    @NotNull(message = "剩余时间不能为空")
//    @NotNull(message = "剩余时间不能为空")
    @ApiModelProperty(value = "剩余时间")
    private Integer duration;
xp-robotaxi-api/src/main/java/com/xiaopeng/api/vo/operation/VehiclePositionVo.java
@@ -80,12 +80,12 @@
    /**
     * 距离
     */
    private Double distance;
    private Double distance=0.0;
    /**
     * 时间 秒
     */
    private Integer second;
    private Integer second=0;
    private Integer total;
@@ -93,12 +93,12 @@
    /**
     * 时间差
     */
    private Integer timeDifference;
    private Integer timeDifference=0;
    /**
     * 距离差
     */
    private Integer distanceDifference;
    private Integer distanceDifference=0;
    /**
     * 订单价值总和
xp-robotaxi-automatic-pilot-boot/src/main/java/com/xiaopeng/automaticPilot/controller/OrderMissionController.java
@@ -159,19 +159,19 @@
        snowFlake.withStartTimestamp(1420041600000L);
        long sequence = snowFlake.nextId();
        MqttPublishDto mqttPublishDto = xpuUtil.cloudCreateOrder(taskListBuilder.build(), dto.getVin(),sequence);
        //先将车辆修改状态,防止在异步通知之前被其他订单选中
        if (!dto.getOrderId().contains("XU") && mqttPublishDto.getCode()== 200) {
            // 修改车子为接单状态
            xpVehicleClient.updateVehicleStatus(new UpdateVehicleStateDto(dto.getVin(), 1));
        }
        if(null != mqttPublishDto && mqttPublishDto.getCode() == 200){
            JSONObject jsonObject = new JSONObject();
            jsonObject.put("event", SystemEventType.CREATE_ORDER);
            jsonObject.put("orderType", dto.getOrderId().contains("XU") ? com.xiaopeng.api.vo.OrderType.CRUISE_ORDER : com.xiaopeng.api.vo.OrderType.USER_ORDER);
            jsonObject.put("orderId", dto.getOrderId());
            jsonObject.put("vin", dto.getVin());
            redisTemplate.opsForValue().set("CREATE_ORDER:" + dto.getOrderId().toString(), jsonObject.toJSONString(),30, TimeUnit.MINUTES);
            redisService.setCacheObject("CREATE_ORDER:" + dto.getOrderId().toString(), jsonObject.toJSONString(),30L, TimeUnit.MINUTES);
            return R.ok(true);
        }
        //先将车辆修改状态,防止在异步通知之前被其他订单选中
        if (!dto.getOrderId().contains("XU") && mqttPublishDto.getCode()== 200) {
            // 修改车子为接单状态
            xpVehicleClient.updateVehicleStatus(new UpdateVehicleStateDto(dto.getVin(), 1));
        }
        return R.ok(false);
    }
xp-robotaxi-automatic-pilot-boot/src/main/java/com/xiaopeng/automaticPilot/service/KafkaConsumerService.java
@@ -248,7 +248,7 @@
                RtTaskListResponse response = msgContent.getRtTaskListResponse();
                try {
                    log.info("云端下发订单操作的响应消息 (XPU→云端):{}", jsonPrinter.print(response));
                    Object sequence = redisTemplate.opsForValue().get("CREATE_ORDER:" + response.getResults().getOrderId());
                    Object sequence = redisService.getCacheObject("CREATE_ORDER:" + response.getResults().getOrderId());
                    if(sequence!=null){
                        JSONObject jsonObject = JSON.parseObject(sequence.toString());
                        String orderId = jsonObject.getString("orderId");
@@ -369,7 +369,7 @@
        // 存储车辆挡位
        GearLevel gearLevel = systemRuntimeStatus.getVehicleStatus().getDynamicStatus().getGearLevel();
        int value = gearLevel.getNumber();
        redisTemplate.opsForValue().set(CacheConstants.GEAR_LEVEL + systemRuntimeStatus.getVehicleStatus().getStaticInfo().getXpuId(), value);
        redisService.setCacheObject(CacheConstants.GEAR_LEVEL + systemRuntimeStatus.getVehicleStatus().getStaticInfo().getXpuId(), value);
        // 判断是否为故障状态
        if (abnormalReason == AbnormalReason.FAULT) {
            log.info("车辆故障,开始处理故障");
@@ -736,7 +736,7 @@
        snowFlake.withStartTimestamp(1420041600000L);
        long sequence = snowFlake.nextId();
        // 处理数据
        redisTemplate.opsForValue().set(sequence,"pushOrder_"+orderId+"_"+vin,30, TimeUnit.MINUTES);
        redisService.setCacheObject(sequence + "","pushOrder_"+orderId+"_"+vin,30L, TimeUnit.MINUTES);
        //开发发送请求到XPU
        xpuUtil.cloudOrderOperation(orderOperationBuilder.build(), vin,sequence);
    }
xp-robotaxi-common/xp-common-redis/src/main/java/com/xiaopeng/common/redis/service/RedisService.java
@@ -6,10 +6,7 @@
import java.util.*;
import java.util.concurrent.TimeUnit;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.BoundSetOperations;
import org.springframework.data.redis.core.HashOperations;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.ValueOperations;
import org.springframework.data.redis.core.*;
import org.springframework.data.redis.core.script.DefaultRedisScript;
import org.springframework.data.redis.core.script.RedisScript;
import org.springframework.stereotype.Component;
@@ -214,6 +211,43 @@
        RedisScript<Long> script = new DefaultRedisScript<>(luaScript, Long.class);
        return redisTemplate.execute(script, Collections.singletonList(key), value);
    }
    /**
     * 从 List 中移除所有 value 包含指定关键字的元素
     * @param key Redis key
     * @param pattern 要匹配的关键字(如 "abc" 会匹配包含 "abc" 的所有元素)
     * @return 移除的数量
     */
    public Long removeByPattern(String key, String pattern) {
        ListOperations<String, String> listOps = redisTemplate.opsForList();
        // 1. 获取 List 长度
        Long size = listOps.size(key);
        if (size == null || size == 0) {
            return 0L;
        }
        // 2. 获取整个 List(小数据量可用,大数据量要优化)
        List<String> allValues = listOps.range(key, 0, -1);
        if (allValues == null || allValues.isEmpty()) {
            return 0L;
        }
        // 3. 找到匹配的元素并记录位置(从后往前删除,避免索引变化)
        long removedCount = 0;
        for (int i = allValues.size() - 1; i >= 0; i--) {
            String value = allValues.get(i);
            if (value != null && value.contains(pattern)) {
                // 使用 LREM 命令删除(从头部开始删除,count=1 表示只删一个)
                Long result = listOps.remove(key, 1, value);
                if (result != null && result > 0) {
                    removedCount++;
                }
            }
        }
        return removedCount;
    }
    /**
     * 缓存Set
     *
xp-robotaxi-itinerary-boot/src/main/java/com/xiaopeng/itinerary/controller/XpPricingController.java
@@ -8,9 +8,11 @@
import com.xiaopeng.api.vo.operation.RouteAndFareVo;
import com.xiaopeng.common.core.domain.R;
import com.xiaopeng.common.core.web.controller.BaseController;
import com.xiaopeng.common.redis.service.RedisService;
import com.xiaopeng.itinerary.dto.XpOrderDto;
import com.xiaopeng.itinerary.service.IXpGeoQueryEntityService;
import com.xiaopeng.itinerary.service.XpPricingService;
import com.xiaopeng.itinerary.vo.HotFixInfoVo;
import com.xiaopeng.itinerary.vo.SaveOrderVo;
import com.xiaopeng.unifiedverification.interceptor.XpClientCheck;
import io.swagger.annotations.Api;
@@ -39,11 +41,14 @@
    private final XpPricingService xpPricingService;
    private final IXpGeoQueryEntityService xpGeoQueryEntityService;
    private final RedisService redisService;
    public XpPricingController(XpPricingService xpPricingService, IXpGeoQueryEntityService xpGeoQueryEntityService) {
    public XpPricingController(XpPricingService xpPricingService, IXpGeoQueryEntityService xpGeoQueryEntityService, RedisService redisService) {
        this.xpPricingService = xpPricingService;
        this.xpGeoQueryEntityService = xpGeoQueryEntityService;
        this.redisService = redisService;
    }
@@ -96,6 +101,25 @@
        return R.ok(saveOrderVo);
    }
    /**
     * 获取热修复信息
     * @param
     * @param
     * @return
     */
    @GetMapping("/base/v1/mini-program/order/getHotFixInfo")
    @ApiOperation(value = "获取热修复信息", tags = {"小程序-获取热修复信息"}, response = HotFixInfoVo.class)
    public R<HotFixInfoVo> getHotFixInfo() {
        Object cacheObject = redisService.getCacheObject("HOT_FIX_INFO");
        if(cacheObject!=null){
            HotFixInfoVo hotFixInfoVo = (HotFixInfoVo) cacheObject;
            return R.ok(hotFixInfoVo);
        }
        HotFixInfoVo hotFixInfoVo = new HotFixInfoVo();
        hotFixInfoVo.setHotfixStatus(0);
        return R.ok(hotFixInfoVo);
    }
    @GetMapping("/base/v1/mini-program/order/testOrder")
xp-robotaxi-itinerary-boot/src/main/java/com/xiaopeng/itinerary/service/impl/XpPricingServiceImpl.java
@@ -363,11 +363,11 @@
        }
        // 10. 检查等待时间
//        Integer waitTime = getWaitTime(routeAndFareDto.getOrigin().getLongitude(), routeAndFareDto.getOrigin().getLatitude());
//        if (waitTime > 3) {
//            throw new ServiceException("当前区域正在等待中,请耐心等待", I18nKeyConstant.WAITING_TIME);
//        }
//        fareVo.setWaitingTime(waitTime);
        Integer waitTime = getWaitTime(routeAndFareDto.getOrigin().getLongitude(), routeAndFareDto.getOrigin().getLatitude());
        if (waitTime > 3) {
            throw new ServiceException("当前区域正在等待中,请耐心等待", I18nKeyConstant.WAITING_TIME);
        }
        fareVo.setWaitingTime(waitTime);
        // 11. 生成订单ID并缓存
xp-robotaxi-itinerary-boot/src/main/java/com/xiaopeng/itinerary/vo/HotFixInfoVo.java
New file
@@ -0,0 +1,26 @@
package com.xiaopeng.itinerary.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.time.LocalDateTime;
import java.util.Date;
@Data
@ApiModel("HotFixInfoVo")
public class HotFixInfoVo {
    @ApiModelProperty("HotFix状态0-关闭 1-开启" )
    private Integer hotfixStatus;
    @ApiModelProperty("热修复开始时间" )
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date hotfixStartTime;
    @ApiModelProperty("热修复结束时间" )
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date hotfixEndTime;
}
xp-robotaxi-maintenance-boot/src/main/java/com/xiaopeng/maintenance/service/impl/XpSchedulingDetailServiceImpl.java
@@ -32,6 +32,10 @@
import com.xiaopeng.maintenance.service.IXpSchedulingService;
import com.xiaopeng.maintenance.service.IXpShiftService;
import com.xiaopeng.maintenance.vo.*;
import org.apache.poi.hssf.usermodel.*;
import org.apache.poi.ss.usermodel.CellType;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.apache.poi.ss.util.CellRangeAddress;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -182,6 +186,7 @@
    /**
     * 给每天的字段赋值
     *
     * @param day
     * @param dto
     * @param map
@@ -286,6 +291,7 @@
    /**
     * 给每天的字段赋值
     *
     * @param day
     * @param dto
     * @param shiftName
@@ -401,7 +407,7 @@
        List<XpSchedulingDetail> list = this.list(new QueryWrapper<XpSchedulingDetail>().eq("is_deleted", 0).last(" and DATE_FORMAT(plan_time,'%Y-%m') = '" + month + "'"));
        //保存排班数据
        XpScheduling xpScheduling = xpSchedulingService.getOne(new QueryWrapper<XpScheduling>().eq("is_deleted", 0).last(" and DATE_FORMAT(scheduling_date,'%Y-%m') = '" + month + "'"));
        if(null == xpScheduling){
        if (null == xpScheduling) {
            xpScheduling = new XpScheduling();
            xpScheduling.setDeleted(false);
            xpScheduling.setCreateTime(LocalDateTime.now());
@@ -434,23 +440,23 @@
                        && s.getPlanTime().equals(parse)
                ).findAny().orElse(null);
                //构建存储对象
                if(null == schedulingDetail){
                if (null == schedulingDetail) {
                    schedulingDetail = new XpSchedulingDetail();
                    schedulingDetail.setCreateBy(userId.toString());
                    schedulingDetail.setCreateTime(LocalDateTime.now());
                    schedulingDetail.setUpdateBy(userId.toString());
                    schedulingDetail.setUpdateTime(LocalDateTime.now());
                    schedulingDetail.setDeleted(false);
                }else{
                } else {
                    //构建通知消息
                    Long old_shiftId = schedulingDetail.getShiftId();
                    if(!old_shiftId.equals(shiftId)){
                    if (!old_shiftId.equals(shiftId)) {
                        //获取车队的所有人员
                        XpShift xpShift1 = xpShifts.stream().filter(s -> s.getId().equals(old_shiftId)).findAny().orElse(null);
                        XpShift xpShift2 = xpShifts.stream().filter(s -> s.getId().equals(shiftId)).findAny().orElse(null);
                        List<Long> operationsIds = xpFleetOperationsClient.getOperationsIdsByFleetId(fleetId).getData();
                        if(null != operationsIds && !operationsIds.isEmpty()){
                        if (null != operationsIds && !operationsIds.isEmpty()) {
                            List<XpOperationsUser> data1 = xpOperationUserClient.listByIds(operationsIds).getData();
                            for (XpOperationsUser xpOperationsUser : data1) {
                                String nickName = xpOperationsUser.getNickName();
@@ -471,7 +477,7 @@
                schedulingDetail.setShiftId(shiftId);
                XpShift xpShift = xpShifts.stream().filter(s -> s.getId().equals(shiftId)).findAny().orElse(null);
                if(null != xpShift){
                if (null != xpShift) {
                    schedulingDetail.setIsAllDay(xpShift.getShiftName().contains("全天"));
                    schedulingDetail.setPlanTime(parse);
                    schedulingDetails.add(schedulingDetail);
@@ -479,7 +485,7 @@
            }
        }
        //批量保存排班明细数据
        if(!schedulingDetails.isEmpty()){
        if (!schedulingDetails.isEmpty()) {
            this.saveOrUpdateBatch(schedulingDetails);
        }
        //异步处理消息通知数据
@@ -490,11 +496,12 @@
    /**
     * 构建推送消息对象
     *
     * @param message
     * @param xpOperationsUser
     * @return
     */
    private AliPushMessageDTO buildPushMessage(String message, XpOperationsUser xpOperationsUser){
    private AliPushMessageDTO buildPushMessage(String message, XpOperationsUser xpOperationsUser) {
        JSONObject body = new JSONObject();
        body.put("content", message);
        body.put("strategy", 4);
@@ -513,11 +520,12 @@
    /**
     * 构建消息存储
     *
     * @param body
     * @param xpOperationsUser
     * @return
     */
    private XpOperationsUserNotification buildXpOperationsUserNotification(String message, String body, XpOperationsUser xpOperationsUser){
    private XpOperationsUserNotification buildXpOperationsUserNotification(String message, String body, XpOperationsUser xpOperationsUser) {
        XpOperationsUserNotification operationsUserNotification = new XpOperationsUserNotification();
        operationsUserNotification.setNotificationType(NotificationTypeEnum.SCHEDULE_CHANGED.getCode());
        operationsUserNotification.setNotificationContent(message);
@@ -530,11 +538,12 @@
    /**
     * 异步处理消息推送
     *
     * @param pushMessage
     * @param notifications
     */
    private void pushMessage(List<AliPushMessageDTO> pushMessage, List<XpOperationsUserNotification> notifications) {
        if(pushMessage.isEmpty()){
        if (pushMessage.isEmpty()) {
            return;
        }
        ThreadPoolExecutor executor = new ThreadPoolExecutor(1, 1, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>());
@@ -547,10 +556,9 @@
    }
    /**
     * 导出排班数据
     *
     * @param month
     * @param response
     */
@@ -558,51 +566,80 @@
    public void exportExcel(String month, HttpServletResponse response) {
        PageInfo<SchedulingDetailDto> pageInfo = new PageInfo<>(0, 10000);
        List<SchedulingDetailDto> schedulingDetailDtos = this.baseMapper.pageList(pageInfo, month);
        List<ExportSchedulingDetailDto> exportSchedulingDetailDtos = new ArrayList<>();
        //获取月份的最大天数
        int m = Integer.parseInt(month.split("-")[1]);
        LocalDate parse1 = LocalDate.parse(month + "-01", DateTimeFormatter.ofPattern("yyyy-MM-dd"));
        int dayOfMonth = parse1.with(TemporalAdjusters.lastDayOfMonth()).getDayOfMonth();
        //构建表头第二行数据
        ExportSchedulingDetailDto exportSchedulingDetailDto = new ExportSchedulingDetailDto();
        exportSchedulingDetailDto.setFleetName("");
        for (int i = 1; i <= dayOfMonth; i++) {
            LocalDate parse = LocalDate.parse(month + "-" + String.format("%02d", i), DateTimeFormatter.ofPattern("yyyy-MM-dd"));
            String week = "";
            switch (parse.getDayOfWeek()){
                case MONDAY:
                    week = "一";
                    break;
                case TUESDAY:
                    week = "二";
                    break;
                case WEDNESDAY:
                    week = "三";
                    break;
                case THURSDAY:
                    week = "四";
                    break;
                case FRIDAY:
                    week = "五";
                    break;
                case SATURDAY:
                    week = "六";
                    break;
                case SUNDAY:
                    week = "日";
                    break;
            }
            setEnglishDay(i, exportSchedulingDetailDto, week);
        }
        exportSchedulingDetailDto.setAllDay("全天");
        exportSchedulingDetailDto.setMorning("早");
        exportSchedulingDetailDto.setMidDay("中");
        exportSchedulingDetailDto.setEvening("晚");
        exportSchedulingDetailDtos.add(exportSchedulingDetailDto);
        HSSFWorkbook hssfWorkbook = new HSSFWorkbook();
        HSSFSheet hssfSheet = hssfWorkbook.createSheet();
        hssfSheet.setColumnWidth(0, 6 * 256);
        hssfSheet.setDefaultRowHeightInPoints(20f);
        //添加第一行标题
        HSSFRow hssfRow = hssfSheet.createRow(0);
        List<XpShift> xpShifts = xpShiftService.list(new QueryWrapper<XpShift>().eq("is_deleted", 0));
        //设置单元格数量
        int totalCell = dayOfMonth + 1 + xpShifts.size();
        //设置表头样式,合并单元格
        CellRangeAddress region = new CellRangeAddress(0, 1, 0, 0);
        hssfSheet.addMergedRegion(region);
        region = new CellRangeAddress(0, 1, dayOfMonth + 1, totalCell);
        hssfSheet.addMergedRegion(region);
        //设置单元格数据
        for (int i = 0; i < totalCell; i++) {
            HSSFCell cell = hssfRow.createCell(i);
            if(0 == i){
                cell.setCellValue("车队");
            }else if(i <= dayOfMonth){
                cell.setCellValue(m + "/" + i);
            }else{
                cell.setCellValue("排班小计");
            }
        }
        //添加第二行标题
        HSSFRow hssfRow1 = hssfSheet.createRow(1);
        //设置单元格数量
        //设置单元格数据
        for (int i = 0; i < totalCell; i++) {
            HSSFCell cell = hssfRow1.createCell(i);
            if(i > 0 && i <= dayOfMonth){
                LocalDate parse = LocalDate.parse(month + "-" + String.format("%02d", i), DateTimeFormatter.ofPattern("yyyy-MM-dd"));
                String week = "";
                switch (parse.getDayOfWeek()) {
                    case MONDAY:
                        week = "一";
                        break;
                    case TUESDAY:
                        week = "二";
                        break;
                    case WEDNESDAY:
                        week = "三";
                        break;
                    case THURSDAY:
                        week = "四";
                        break;
                    case FRIDAY:
                        week = "五";
                        break;
                    case SATURDAY:
                        week = "六";
                        break;
                    case SUNDAY:
                        week = "日";
                        break;
                }
                cell.setCellValue(week);
            }
        }
        //构建数据部分的内容
        int rowNum = 2;
        for (SchedulingDetailDto schedulingDetailDto : schedulingDetailDtos) {
            exportSchedulingDetailDto = new ExportSchedulingDetailDto();
            exportSchedulingDetailDto.setFleetName(schedulingDetailDto.getFleetName());
            HSSFRow row = hssfSheet.createRow(rowNum);
            row.createCell(0).setCellValue(schedulingDetailDto.getFleetName());
            String days = schedulingDetailDto.getDays();
            if (StringUtils.isNotBlank(days)) {
                String[] split = days.split(",");
@@ -616,32 +653,19 @@
                            break;
                        }
                    }
                    setEnglishDay(i, exportSchedulingDetailDto, shiftName);
                    row.createCell(i).setCellValue(shiftName);
                }
                long allDay = list.stream().filter(s -> s.contains("全天")).count();
                long morning = list.stream().filter(s -> s.contains("早")).count();
                long midDay = list.stream().filter(s -> s.contains("中")).count();
                long evening = list.stream().filter(s -> s.contains("晚")).count();
                exportSchedulingDetailDto.setAllDay(allDay + "");
                exportSchedulingDetailDto.setMorning(morning + "");
                exportSchedulingDetailDto.setMidDay(midDay + "");
                exportSchedulingDetailDto.setEvening(evening + "");
            }else{
                for (int i = 1; i <= 31; i++) {
                    String shiftName = "休";
                    setEnglishDay(i, exportSchedulingDetailDto, shiftName);
                for (int i = 0; i < xpShifts.size(); i++) {
                    String shiftName = xpShifts.get(i).getShiftName();
                    long allDay = list.stream().filter(s -> s.contains(shiftName)).count();
                    row.createCell(dayOfMonth + 1 + i).setCellValue(allDay + allDay);
                }
                exportSchedulingDetailDto.setAllDay("0");
                exportSchedulingDetailDto.setMorning("0");
                exportSchedulingDetailDto.setMidDay("0");
                exportSchedulingDetailDto.setEvening("0");
            }
            exportSchedulingDetailDtos.add(exportSchedulingDetailDto);
        }
        String[] split = month.split("-");
        ExcelUtil<ExportSchedulingDetailDto> excelUtil = new ExcelUtil<>(ExportSchedulingDetailDto.class);
        excelUtil.exportExcel(response, exportSchedulingDetailDtos, "排班计划[日期:" + split[0] + "年" + split[1] + "月]");
    }
}
xp-robotaxi-maintenance-boot/src/main/java/com/xiaopeng/maintenance/service/impl/XpVehicleRepairServiceImpl.java
@@ -3,6 +3,7 @@
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xiaopeng.api.dto.vehicleConvoy.UpdateVehicleStateDto;
import com.xiaopeng.api.feignClient.account.XpOperationUserClient;
import com.xiaopeng.api.feignClient.vehicleConvoy.XpVehicleClient;
import com.xiaopeng.api.model.account.XpOperationsUser;
@@ -213,5 +214,12 @@
        xpVehicleRepair.setSendUserId(id);
        xpVehicleRepair.setSendTime(LocalDateTime.now());
        this.save(xpVehicleRepair);
        // 查询车辆信息
        XpVehicle xpVehicle = xpVehicleClient.queryById(dto.getVehicleId()).getData();
        if(Objects.nonNull(xpVehicle)){
            // 修改车辆状态
            xpVehicle.setOperatingStatus(2);
            xpVehicleClient.updateVehicleById(xpVehicle);
        }
    }
}
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/controller/OssController.java
@@ -35,22 +35,22 @@
    public R<FileUploadVO> uploadOSS(@RequestParam(value = "file") MultipartFile file) {
        try {
            // 上传并返回访问地址
//            String fileName = file.getOriginalFilename();
//            String prefix = fileName.substring(fileName.lastIndexOf("."));
//            long fileSize = file.getSize();
//            String fileId = UUID.randomUUID().toString();
//            //上传文件
//            aliOssService.uploadFile(file.getBytes(), fileId);
//            String downloadUrl = aliOssService.getDownloadUrl(fileId, fileName,true);
//            FileUploadVO fileUploadVO = new FileUploadVO();
//            fileUploadVO.setId(fileId);
//            fileUploadVO.setName(fileName);
//            fileUploadVO.setUrl(downloadUrl);
            String fileName = file.getOriginalFilename();
            String prefix = fileName.substring(fileName.lastIndexOf("."));
            long fileSize = file.getSize();
            String fileId = UUID.randomUUID().toString();
            //上传文件
            aliOssService.uploadFile(file.getBytes(), fileId);
            String downloadUrl = aliOssService.getDownloadUrl(fileId, fileName,true);
            FileUploadVO fileUploadVO = new FileUploadVO();
            fileUploadVO.setId(UUID.randomUUID().toString());
            fileUploadVO.setName("测试.jpg");
            fileUploadVO.setUrl("https://huishou-1323682843.cos.ap-nanjing.myqcloud.com/images/552a3a31-e4dd-4a28-8748-fd8b87dd3055.png");
            fileUploadVO.setId(fileId);
            fileUploadVO.setName(fileName);
            fileUploadVO.setUrl(downloadUrl);
//            FileUploadVO fileUploadVO = new FileUploadVO();
//            fileUploadVO.setId(UUID.randomUUID().toString());
//            fileUploadVO.setName("测试.jpg");
//            fileUploadVO.setUrl("https://huishou-1323682843.cos.ap-nanjing.myqcloud.com/images/552a3a31-e4dd-4a28-8748-fd8b87dd3055.png");
            return R.ok(fileUploadVO);
        } catch (Exception e) {
            System.err.println("上传文件失败"+e);
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/utils/TaskOrderUtil.java
@@ -253,6 +253,9 @@
            return true;
        }
        XpOrder xpOrder = xpOrderR.getData();
        if (xpOrder.getStatus() == 0) {
            redisService.removeByPattern(quoteName, xpOrder.getOrderNumber());
        }
        // 找出围栏id
        Long xpElectronicFenceAreaId = xpOrder.getXpElectronicFenceAreaId();
@@ -262,7 +265,6 @@
        for (int i = 0; i < count; i++) {
            //等到sleepTime秒钟
            Thread.sleep(sleepTime * 1000);
//            log.info("进入找车环节 单号 {} 第{}轮", orderNo, count++);
            // 根据距离找车
            // 车多则根据配置找具体车数量 根据距离最近
            // 更改 暂不限制数量
@@ -272,7 +274,7 @@
            if (positionList.isEmpty()) {
                continue;
            }
            List<String> vinList = positionList.stream().map(VehiclePosition::getVin).collect(Collectors.toList());
            Set<String> vinList = positionList.stream().map(VehiclePosition::getVin).collect(Collectors.toSet());
            // 获取车辆的信息 筛选出可用车辆
            R<List<String>> vehiclePositionVos = xpVehicleClient.queryVehiclePositionByVin(new VehiclePositionByVinDto(xpElectronicFence.getId(), vinList, xpTradingStrategy.getSimultaneouslyOrderCount()));
@@ -302,253 +304,77 @@
                    // 时间价值
                    Integer tendencyTime = xpTradingStrategy.getTendencyTime();
                    try {
                    // 电量价值
                    Integer tendencyElectricity = xpTradingStrategy.getTendencyElectricity();
                    // 找出最大的值是那个
                    Integer max = Math.max(tendencyOrderValue, Math.max(tendencyDistance, Math.max(tendencyTime, tendencyElectricity)));
                    if (max.equals(tendencyOrderValue)) {
                        // 订单价值
                        // 时间差权重
                        Integer weightTimeDifference = xpTradingStrategy.getWeightTimeDifference();
                        // 距离差权重
                        Integer weightDistanceDifference = xpTradingStrategy.getWeightDistanceDifference();
                        // 距离权重
                        Integer weightDistance = xpTradingStrategy.getWeightDistance();
                        // 时间权重
                        Integer weightTime = xpTradingStrategy.getWeightTime();
                        // 电量权重
                        Integer weightElectricity = xpTradingStrategy.getWeightElectricity();
                        // 电量价值
                        Integer tendencyElectricity = xpTradingStrategy.getTendencyElectricity();
                        // 找出最大的值是那个
                        Integer max1 = Math.max(weightTimeDifference, Math.max(weightDistanceDifference, Math.max(weightDistance, Math.max(weightTime, weightElectricity))));
                        Integer max = Math.max(tendencyOrderValue, Math.max(tendencyDistance, Math.max(tendencyTime, tendencyElectricity)));
                        if (max.equals(tendencyOrderValue)) {
                            // 订单价值
                            // 时间差权重
                            Integer weightTimeDifference = xpTradingStrategy.getWeightTimeDifference();
                            // 距离差权重
                            Integer weightDistanceDifference = xpTradingStrategy.getWeightDistanceDifference();
                            // 距离权重
                            Integer weightDistance = xpTradingStrategy.getWeightDistance();
                            // 时间权重
                            Integer weightTime = xpTradingStrategy.getWeightTime();
                            // 电量权重
                            Integer weightElectricity = xpTradingStrategy.getWeightElectricity();
                        //  时间差
                        if (max1.equals(weightTimeDifference)) {
                            for (VehiclePositionVo vehiclePosition : availableVehiclesNearby) {
                                RouteAndFareDto routeAndFareDto = new RouteAndFareDto();
                                LonLatDto lonLatDto = new LonLatDto();
                                lonLatDto.setLongitude(vehiclePosition.getPoint().getX());
                                lonLatDto.setLatitude(vehiclePosition.getPoint().getY());
                                routeAndFareDto.setOrigin(lonLatDto);
                                LonLatDto lonLatDto1 = new LonLatDto();
                                lonLatDto1.setLongitude(Double.valueOf(split[0]));
                                lonLatDto1.setLatitude(Double.valueOf(split[1]));
                                routeAndFareDto.setDestination(lonLatDto1);
                                routeAndFareDto.setRoutePlanRule(Integer.valueOf(planRule));
                                R<RouteVo> distanceAndDuration = xpMapClient.getDistanceAndDuration(routeAndFareDto);
                                if (distanceAndDuration.getCode() == 200) {
                                    // 送驾- 接驾
                                    Integer durationDifference = Integer.parseInt(duration) - distanceAndDuration.getData().getDuration();
                                    vehiclePosition.setTimeDifference(durationDifference);
                                }
                            }
                        }
                            // 找出最大的值是那个
                            Integer max1 = Math.max(weightTimeDifference, Math.max(weightDistanceDifference, Math.max(weightDistance, Math.max(weightTime, weightElectricity))));
                        if (max1.equals(weightDistanceDifference)) {
                            for (VehiclePositionVo vehiclePosition : availableVehiclesNearby) {
                                RouteAndFareDto routeAndFareDto = new RouteAndFareDto();
                                LonLatDto lonLatDto = new LonLatDto();
                                lonLatDto.setLongitude(vehiclePosition.getPoint().getX());
                                lonLatDto.setLatitude(vehiclePosition.getPoint().getY());
                                routeAndFareDto.setOrigin(lonLatDto);
                                LonLatDto lonLatDto1 = new LonLatDto();
                                lonLatDto1.setLongitude(Double.valueOf(split[0]));
                                lonLatDto1.setLatitude(Double.valueOf(split[1]));
                                routeAndFareDto.setDestination(lonLatDto1);
                                routeAndFareDto.setRoutePlanRule(Integer.valueOf(planRule));
                                R<RouteVo> distanceAndDuration = xpMapClient.getDistanceAndDuration(routeAndFareDto);
                                if (distanceAndDuration.getCode() == 200) {
                                    // 送驾- 接驾
                                    Integer distanceDifference = Integer.parseInt(distance) - distanceAndDuration.getData().getDistance();
                                    vehiclePosition.setDistanceDifference(distanceDifference);
                            //  时间差
                            if (max1.equals(weightTimeDifference)) {
                                for (VehiclePositionVo vehiclePosition : availableVehiclesNearby) {
                                    RouteAndFareDto routeAndFareDto = new RouteAndFareDto();
                                    LonLatDto lonLatDto = new LonLatDto();
                                    lonLatDto.setLongitude(vehiclePosition.getPoint().getX());
                                    lonLatDto.setLatitude(vehiclePosition.getPoint().getY());
                                    routeAndFareDto.setOrigin(lonLatDto);
                                    LonLatDto lonLatDto1 = new LonLatDto();
                                    lonLatDto1.setLongitude(Double.valueOf(split[0]));
                                    lonLatDto1.setLatitude(Double.valueOf(split[1]));
                                    routeAndFareDto.setDestination(lonLatDto1);
                                    if(planRule!=null&& !"null".equals(planRule)){
                                        routeAndFareDto.setRoutePlanRule(Integer.valueOf(planRule));
                                    }
                                    R<RouteVo> distanceAndDuration = xpMapClient.getDistanceAndDuration(routeAndFareDto);
                                    if (distanceAndDuration.getCode() == 200) {
                                        // 送驾- 接驾
                                        Integer durationDifference = Integer.parseInt(duration) - distanceAndDuration.getData().getDuration();
                                        vehiclePosition.setTimeDifference(durationDifference);
                                    }
                                }
                            }
                        }
                        if (max1.equals(weightDistance)) {
                            for (VehiclePositionVo vehiclePosition : availableVehiclesNearby) {
                                RouteAndFareDto routeAndFareDto = new RouteAndFareDto();
                                LonLatDto lonLatDto = new LonLatDto();
                                lonLatDto.setLongitude(vehiclePosition.getPoint().getX());
                                lonLatDto.setLatitude(vehiclePosition.getPoint().getY());
                                routeAndFareDto.setOrigin(lonLatDto);
                                LonLatDto lonLatDto1 = new LonLatDto();
                                lonLatDto1.setLongitude(Double.parseDouble(split[0]));
                                lonLatDto1.setLatitude(Double.parseDouble(split[1]));
                                routeAndFareDto.setRoutePlanRule(Integer.valueOf(planRule));
                                routeAndFareDto.setDestination(lonLatDto1);
                                //  调用地图 获取时间
                                R<RouteVo> r = xpMapClient.getDistanceAndDuration(routeAndFareDto);
                                if (r.getCode() == 200) {
                                    vehiclePosition.setDistance(Double.valueOf(r.getData().getDistance()));
                                } else {
                                    vehiclePosition.setDistance(0.0);
                            if (max1.equals(weightDistanceDifference)) {
                                for (VehiclePositionVo vehiclePosition : availableVehiclesNearby) {
                                    RouteAndFareDto routeAndFareDto = new RouteAndFareDto();
                                    LonLatDto lonLatDto = new LonLatDto();
                                    lonLatDto.setLongitude(vehiclePosition.getPoint().getX());
                                    lonLatDto.setLatitude(vehiclePosition.getPoint().getY());
                                    routeAndFareDto.setOrigin(lonLatDto);
                                    LonLatDto lonLatDto1 = new LonLatDto();
                                    lonLatDto1.setLongitude(Double.valueOf(split[0]));
                                    lonLatDto1.setLatitude(Double.valueOf(split[1]));
                                    routeAndFareDto.setDestination(lonLatDto1);
                                    if(planRule!=null&& !"null".equals(planRule)){
                                        routeAndFareDto.setRoutePlanRule(Integer.valueOf(planRule));
                                    }
                                    R<RouteVo> distanceAndDuration = xpMapClient.getDistanceAndDuration(routeAndFareDto);
                                    if (distanceAndDuration.getCode() == 200) {
                                        // 送驾- 接驾
                                        Integer distanceDifference = Integer.parseInt(distance) - distanceAndDuration.getData().getDistance();
                                        vehiclePosition.setDistanceDifference(distanceDifference);
                                    }
                                }
                            }
                        }
                        if (max1.equals(weightTime)) {
                            for (VehiclePositionVo vehiclePosition : availableVehiclesNearby) {
                                RouteAndFareDto routeAndFareDto = new RouteAndFareDto();
                                LonLatDto lonLatDto = new LonLatDto();
                                lonLatDto.setLongitude(vehiclePosition.getPoint().getX());
                                lonLatDto.setLatitude(vehiclePosition.getPoint().getY());
                                routeAndFareDto.setOrigin(lonLatDto);
                                LonLatDto lonLatDto1 = new LonLatDto();
                                lonLatDto1.setLongitude(Double.parseDouble(split[0]));
                                lonLatDto1.setLatitude(Double.parseDouble(split[1]));
                                routeAndFareDto.setRoutePlanRule(Integer.valueOf(planRule));
                                routeAndFareDto.setDestination(lonLatDto1);
                                //  调用地图 获取时间
                                R<RouteVo> r = xpMapClient.getDistanceAndDuration(routeAndFareDto);
                                if (r.getCode() == 200) {
                                    vehiclePosition.setSecond(r.getData().getDuration());
                                } else {
                                    vehiclePosition.setSecond(0);
                                }
                            }
                        }
                        if (max1.equals(weightElectricity)) {
                            // 计算车的分数  分数最大是车的size
                            availableVehiclesNearby = availableVehiclesNearby.stream().sorted(Comparator.comparing(VehiclePositionVo::getCurrentElectricity).reversed()).collect(Collectors.toList());
                            int size = tendencyElectricity;
                            // 做比对的分数
                            int temp = availableVehiclesNearby.get(0).getCurrentElectricity();
                            for (VehiclePositionVo vehiclePosition : availableVehiclesNearby) {
                                vehiclePosition.setCurrentElectricityScore(vehiclePosition.getCurrentElectricityScore() + size);
                                if (temp != vehiclePosition.getCurrentElectricity()) {
                                    size--;
                                }
                            }
                        }
                        // 算出总分 再来排序计算
                        for (VehiclePositionVo vehiclePositionVo : availableVehiclesNearby) {
                            vehiclePositionVo.setOrderValueTotal(vehiclePositionVo.getCurrentElectricityScore() + vehiclePositionVo.getDistanceScore() + vehiclePositionVo.getTimeScore() + vehiclePositionVo.getDistanceDifference() + vehiclePositionVo.getTimeDifference());
                        }
                        availableVehiclesNearby = availableVehiclesNearby.stream().sorted(Comparator.comparing(VehiclePositionVo::getOrderValueTotal).reversed()).collect(Collectors.toList());
                        int size = tendencyOrderValue;
                        // 做比对的分数
                        double temp = availableVehiclesNearby.get(0).getOrderValueTotal();
                        for (VehiclePositionVo vehiclePosition : availableVehiclesNearby) {
                            vehiclePosition.setValueScore(vehiclePosition.getValueScore() + size);
                            if (temp != vehiclePosition.getOrderValueTotal()) {
                                size--;
                            }
                        }
                    }
                    // 距离分数
                    if (max.equals(tendencyDistance)) {
                        for (VehiclePositionVo vehiclePosition : availableVehiclesNearby) {
                            RouteAndFareDto routeAndFareDto = new RouteAndFareDto();
                            LonLatDto lonLatDto = new LonLatDto();
                            lonLatDto.setLongitude(vehiclePosition.getPoint().getX());
                            lonLatDto.setLatitude(vehiclePosition.getPoint().getY());
                            routeAndFareDto.setOrigin(lonLatDto);
                            LonLatDto lonLatDto1 = new LonLatDto();
                            lonLatDto1.setLongitude(Double.parseDouble(split[0]));
                            lonLatDto1.setLatitude(Double.parseDouble(split[1]));
                            routeAndFareDto.setRoutePlanRule(Integer.valueOf(planRule));
                            routeAndFareDto.setDestination(lonLatDto1);
                            //  调用地图 获取时间
                            R<RouteVo> r = xpMapClient.getDistanceAndDuration(routeAndFareDto);
                            if (r.getCode() == 200) {
                                vehiclePosition.setDistance(Double.valueOf(r.getData().getDistance()));
                            } else {
                                vehiclePosition.setDistance(0.0);
                            }
                        }
                        availableVehiclesNearby = availableVehiclesNearby.stream().sorted(Comparator.comparing(VehiclePositionVo::getDistance)).collect(Collectors.toList());
                        int size = tendencyDistance;
                        // 做比对的分数
                        double temp = availableVehiclesNearby.get(0).getDistance();
                        for (VehiclePositionVo vehiclePosition : availableVehiclesNearby) {
                            vehiclePosition.setDistanceScore(vehiclePosition.getDistanceScore() + size);
                            if (temp != vehiclePosition.getDistance()) {
                                size--;
                            }
                        }
                    }
                    // 时间分数
                    if (max.equals(tendencyTime)) {
                        for (VehiclePositionVo vehiclePosition : availableVehiclesNearby) {
                            RouteAndFareDto routeAndFareDto = new RouteAndFareDto();
                            LonLatDto lonLatDto = new LonLatDto();
                            lonLatDto.setLongitude(vehiclePosition.getPoint().getX());
                            lonLatDto.setLatitude(vehiclePosition.getPoint().getY());
                            routeAndFareDto.setOrigin(lonLatDto);
                            LonLatDto lonLatDto1 = new LonLatDto();
                            lonLatDto1.setLongitude(Double.parseDouble(split[0]));
                            lonLatDto1.setLatitude(Double.parseDouble(split[1]));
                            routeAndFareDto.setRoutePlanRule(Integer.valueOf(planRule));
                            routeAndFareDto.setDestination(lonLatDto1);
                            //  调用地图 获取时间
                            R<RouteVo> r = xpMapClient.getDistanceAndDuration(routeAndFareDto);
                            if (r.getCode() == 200) {
                                vehiclePosition.setSecond(r.getData().getDuration());
                            } else {
                                vehiclePosition.setSecond(0);
                            }
                        }
                        availableVehiclesNearby = availableVehiclesNearby.stream().sorted(Comparator.comparing(VehiclePositionVo::getSecond)).collect(Collectors.toList());
                        int size = tendencyTime;
                        // 做比对的分数
                        double temp = availableVehiclesNearby.get(0).getSecond();
                        for (VehiclePositionVo vehiclePosition : availableVehiclesNearby) {
                            vehiclePosition.setTimeScore(vehiclePosition.getTimeScore() + size);
                            if (temp != vehiclePosition.getSecond()) {
                                size--;
                            }
                        }
                    }
                    // 电量分数
                    if (max.equals(tendencyElectricity)) {
                        // 计算车的分数  分数最大是车的size
                        availableVehiclesNearby = availableVehiclesNearby.stream().sorted(Comparator.comparing(VehiclePositionVo::getCurrentElectricity).reversed()).collect(Collectors.toList());
                        int size = tendencyElectricity;
                        // 做比对的分数
                        int temp = availableVehiclesNearby.get(0).getCurrentElectricity();
                        int maxTemp = 0;
                        for (VehiclePositionVo vehiclePosition : availableVehiclesNearby) {
                            vehiclePosition.setCurrentElectricityScore(vehiclePosition.getCurrentElectricityScore() + size);
                            if (temp != vehiclePosition.getCurrentElectricity()) {
                                size--;
                            } else {
                                maxTemp++;
                            }
                        }
                        if (maxTemp > 1) {
                            // 证明有最高相同电量的  找下一个
                            // 找出最第二大的值是那个
                            // 将四个值放入列表
                            List<Integer> values = Arrays.asList(tendencyOrderValue, tendencyDistance, tendencyTime);
                            // 降序排序
                            values.sort(Collections.reverseOrder());
                            // 获取第二大值
                            Integer secondMax = values.get(1);
                            // 判断第二大的是哪个
                            if (Objects.equals(secondMax, tendencyDistance)) {
                            if (max1.equals(weightDistance)) {
                                for (VehiclePositionVo vehiclePosition : availableVehiclesNearby) {
                                    RouteAndFareDto routeAndFareDto = new RouteAndFareDto();
                                    LonLatDto lonLatDto = new LonLatDto();
@@ -558,8 +384,9 @@
                                    LonLatDto lonLatDto1 = new LonLatDto();
                                    lonLatDto1.setLongitude(Double.parseDouble(split[0]));
                                    lonLatDto1.setLatitude(Double.parseDouble(split[1]));
                                    routeAndFareDto.setRoutePlanRule(Integer.valueOf(planRule));
                                    if(planRule!=null&& !"null".equals(planRule)){
                                        routeAndFareDto.setRoutePlanRule(Integer.valueOf(planRule));
                                    }
                                    routeAndFareDto.setDestination(lonLatDto1);
                                    //  调用地图 获取时间
                                    R<RouteVo> r = xpMapClient.getDistanceAndDuration(routeAndFareDto);
@@ -569,20 +396,9 @@
                                        vehiclePosition.setDistance(0.0);
                                    }
                                }
                                availableVehiclesNearby = availableVehiclesNearby.stream().sorted(Comparator.comparing(VehiclePositionVo::getDistance)).collect(Collectors.toList());
                                int size1 = tendencyDistance;
                                // 做比对的分数
                                double temp1 = availableVehiclesNearby.get(0).getDistance();
                                for (VehiclePositionVo vehiclePosition : availableVehiclesNearby) {
                                    vehiclePosition.setDistanceScore(vehiclePosition.getDistanceScore() + size1);
                                    if (temp1 != vehiclePosition.getDistance()) {
                                        size1--;
                                    }
                                }
                            }
                            if (Objects.equals(secondMax, tendencyTime)) {
                            if (max1.equals(weightTime)) {
                                for (VehiclePositionVo vehiclePosition : availableVehiclesNearby) {
                                    RouteAndFareDto routeAndFareDto = new RouteAndFareDto();
                                    LonLatDto lonLatDto = new LonLatDto();
@@ -592,8 +408,9 @@
                                    LonLatDto lonLatDto1 = new LonLatDto();
                                    lonLatDto1.setLongitude(Double.parseDouble(split[0]));
                                    lonLatDto1.setLatitude(Double.parseDouble(split[1]));
                                    routeAndFareDto.setRoutePlanRule(Integer.valueOf(planRule));
                                    if(planRule!=null&& !"null".equals(planRule)){
                                        routeAndFareDto.setRoutePlanRule(Integer.valueOf(planRule));
                                    }
                                    routeAndFareDto.setDestination(lonLatDto1);
                                    //  调用地图 获取时间
                                    R<RouteVo> r = xpMapClient.getDistanceAndDuration(routeAndFareDto);
@@ -603,81 +420,148 @@
                                        vehiclePosition.setSecond(0);
                                    }
                                }
                                availableVehiclesNearby = availableVehiclesNearby.stream().sorted(Comparator.comparing(VehiclePositionVo::getSecond)).collect(Collectors.toList());
                                int size1 = tendencyTime;
                            }
                            if (max1.equals(weightElectricity)) {
                                // 计算车的分数  分数最大是车的size
                                availableVehiclesNearby = availableVehiclesNearby.stream().sorted(Comparator.comparing(VehiclePositionVo::getCurrentElectricity).reversed()).collect(Collectors.toList());
                                int size = tendencyElectricity;
                                // 做比对的分数
                                double temp1 = availableVehiclesNearby.get(0).getSecond();
                                int temp = availableVehiclesNearby.get(0).getCurrentElectricity();
                                for (VehiclePositionVo vehiclePosition : availableVehiclesNearby) {
                                    vehiclePosition.setTimeScore(vehiclePosition.getTimeScore() + size1);
                                    if (temp1 != vehiclePosition.getSecond()) {
                                        size1--;
                                    vehiclePosition.setCurrentElectricityScore(vehiclePosition.getCurrentElectricityScore() + size);
                                    if (temp != vehiclePosition.getCurrentElectricity()) {
                                        size--;
                                    }
                                }
                            }
                            // 订单价值
                            if (Objects.equals(secondMax, tendencyOrderValue)) {
                                // 订单价值
                                // 时间差权重
                                Integer weightTimeDifference = xpTradingStrategy.getWeightTimeDifference();
                                // 距离差权重
                                Integer weightDistanceDifference = xpTradingStrategy.getWeightDistanceDifference();
                                // 距离权重
                                Integer weightDistance = xpTradingStrategy.getWeightDistance();
                                // 时间权重
                                Integer weightTime = xpTradingStrategy.getWeightTime();
                                // 电量权重
                                Integer weightElectricity = xpTradingStrategy.getWeightElectricity();
                            // 算出总分 再来排序计算
                            for (VehiclePositionVo vehiclePositionVo : availableVehiclesNearby) {
                                vehiclePositionVo.setOrderValueTotal(vehiclePositionVo.getCurrentElectricityScore() + vehiclePositionVo.getDistanceScore() + vehiclePositionVo.getTimeScore() + vehiclePositionVo.getDistanceDifference() + vehiclePositionVo.getTimeDifference()+vehiclePositionVo.getSecond()+vehiclePositionVo.getDistance().intValue());
                            }
                            availableVehiclesNearby = availableVehiclesNearby.stream().sorted(Comparator.comparing(VehiclePositionVo::getOrderValueTotal).reversed()).collect(Collectors.toList());
                                // 找出最大的值是那个
                                Integer max1 = Math.max(weightTimeDifference, Math.max(weightDistanceDifference, Math.max(weightDistance, Math.max(weightTime, weightElectricity))));
                                //  时间差
                                if (max1.equals(weightTimeDifference)) {
                                    for (VehiclePositionVo vehiclePosition : availableVehiclesNearby) {
                                        RouteAndFareDto routeAndFareDto = new RouteAndFareDto();
                                        LonLatDto lonLatDto = new LonLatDto();
                                        lonLatDto.setLongitude(vehiclePosition.getPoint().getX());
                                        lonLatDto.setLatitude(vehiclePosition.getPoint().getY());
                                        routeAndFareDto.setOrigin(lonLatDto);
                                        LonLatDto lonLatDto1 = new LonLatDto();
                                        lonLatDto1.setLongitude(Double.valueOf(split[0]));
                                        lonLatDto1.setLatitude(Double.valueOf(split[1]));
                                        routeAndFareDto.setDestination(lonLatDto1);
                                        routeAndFareDto.setRoutePlanRule(Integer.valueOf(planRule));
                                        R<RouteVo> distanceAndDuration = xpMapClient.getDistanceAndDuration(routeAndFareDto);
                                        if (distanceAndDuration.getCode() == 200) {
                                            // 送驾- 接驾
                                            Integer durationDifference = Integer.parseInt(duration) - distanceAndDuration.getData().getDuration();
                                            vehiclePosition.setTimeDifference(durationDifference);
                                        }
                                    }
                            int size = tendencyOrderValue;
                            // 做比对的分数
                            double temp = availableVehiclesNearby.get(0).getOrderValueTotal();
                            for (VehiclePositionVo vehiclePosition : availableVehiclesNearby) {
                                vehiclePosition.setValueScore(vehiclePosition.getValueScore() + size);
                                if (temp != vehiclePosition.getOrderValueTotal()) {
                                    size--;
                                }
                            }
                                if (max1.equals(weightDistanceDifference)) {
                                    for (VehiclePositionVo vehiclePosition : availableVehiclesNearby) {
                                        RouteAndFareDto routeAndFareDto = new RouteAndFareDto();
                                        LonLatDto lonLatDto = new LonLatDto();
                                        lonLatDto.setLongitude(vehiclePosition.getPoint().getX());
                                        lonLatDto.setLatitude(vehiclePosition.getPoint().getY());
                                        routeAndFareDto.setOrigin(lonLatDto);
                                        LonLatDto lonLatDto1 = new LonLatDto();
                                        lonLatDto1.setLongitude(Double.valueOf(split[0]));
                                        lonLatDto1.setLatitude(Double.valueOf(split[1]));
                                        routeAndFareDto.setDestination(lonLatDto1);
                                        routeAndFareDto.setRoutePlanRule(Integer.valueOf(planRule));
                                        R<RouteVo> distanceAndDuration = xpMapClient.getDistanceAndDuration(routeAndFareDto);
                                        if (distanceAndDuration.getCode() == 200) {
                                            // 送驾- 接驾
                                            Integer distanceDifference = Integer.parseInt(distance) - distanceAndDuration.getData().getDistance();
                                            vehiclePosition.setDistanceDifference(distanceDifference);
                                        }
                                    }
                        }
                        // 距离分数
                        if (max.equals(tendencyDistance)) {
                            for (VehiclePositionVo vehiclePosition : availableVehiclesNearby) {
                                RouteAndFareDto routeAndFareDto = new RouteAndFareDto();
                                LonLatDto lonLatDto = new LonLatDto();
                                lonLatDto.setLongitude(vehiclePosition.getPoint().getX());
                                lonLatDto.setLatitude(vehiclePosition.getPoint().getY());
                                routeAndFareDto.setOrigin(lonLatDto);
                                LonLatDto lonLatDto1 = new LonLatDto();
                                lonLatDto1.setLongitude(Double.parseDouble(split[0]));
                                lonLatDto1.setLatitude(Double.parseDouble(split[1]));
                                if(planRule!=null&& !"null".equals(planRule)){
                                    routeAndFareDto.setRoutePlanRule(Integer.valueOf(planRule));
                                }
                                routeAndFareDto.setDestination(lonLatDto1);
                                //  调用地图 获取时间
                                R<RouteVo> r = xpMapClient.getDistanceAndDuration(routeAndFareDto);
                                if (r.getCode() == 200) {
                                    vehiclePosition.setDistance(Double.valueOf(r.getData().getDistance()));
                                } else {
                                    vehiclePosition.setDistance(0.0);
                                }
                            }
                            availableVehiclesNearby = availableVehiclesNearby.stream().sorted(Comparator.comparing(VehiclePositionVo::getDistance)).collect(Collectors.toList());
                            int size = tendencyDistance;
                            // 做比对的分数
                            double temp = availableVehiclesNearby.get(0).getDistance();
                            for (VehiclePositionVo vehiclePosition : availableVehiclesNearby) {
                                vehiclePosition.setDistanceScore(vehiclePosition.getDistanceScore() + size);
                                if (temp != vehiclePosition.getDistance()) {
                                    size--;
                                }
                            }
                        }
                                if (max1.equals(weightDistance)) {
                        // 时间分数
                        if (max.equals(tendencyTime)) {
                            for (VehiclePositionVo vehiclePosition : availableVehiclesNearby) {
                                RouteAndFareDto routeAndFareDto = new RouteAndFareDto();
                                LonLatDto lonLatDto = new LonLatDto();
                                lonLatDto.setLongitude(vehiclePosition.getPoint().getX());
                                lonLatDto.setLatitude(vehiclePosition.getPoint().getY());
                                routeAndFareDto.setOrigin(lonLatDto);
                                LonLatDto lonLatDto1 = new LonLatDto();
                                lonLatDto1.setLongitude(Double.parseDouble(split[0]));
                                lonLatDto1.setLatitude(Double.parseDouble(split[1]));
                                if(planRule!=null&& !"null".equals(planRule)){
                                    routeAndFareDto.setRoutePlanRule(Integer.valueOf(planRule));
                                }
                                routeAndFareDto.setDestination(lonLatDto1);
                                //  调用地图 获取时间
                                R<RouteVo> r = xpMapClient.getDistanceAndDuration(routeAndFareDto);
                                if (r.getCode() == 200) {
                                    vehiclePosition.setSecond(r.getData().getDuration());
                                } else {
                                    vehiclePosition.setSecond(0);
                                }
                            }
                            availableVehiclesNearby = availableVehiclesNearby.stream().sorted(Comparator.comparing(VehiclePositionVo::getSecond)).collect(Collectors.toList());
                            int size = tendencyTime;
                            // 做比对的分数
                            double temp = availableVehiclesNearby.get(0).getSecond();
                            for (VehiclePositionVo vehiclePosition : availableVehiclesNearby) {
                                vehiclePosition.setTimeScore(vehiclePosition.getTimeScore() + size);
                                if (temp != vehiclePosition.getSecond()) {
                                    size--;
                                }
                            }
                        }
                        // 电量分数
                        if (max.equals(tendencyElectricity)) {
                            // 计算车的分数  分数最大是车的size
                            availableVehiclesNearby = availableVehiclesNearby.stream().sorted(Comparator.comparing(VehiclePositionVo::getCurrentElectricity).reversed()).collect(Collectors.toList());
                            int size = tendencyElectricity;
                            // 做比对的分数
                            int temp = availableVehiclesNearby.get(0).getCurrentElectricity();
                            int maxTemp = 0;
                            for (VehiclePositionVo vehiclePosition : availableVehiclesNearby) {
                                vehiclePosition.setCurrentElectricityScore(vehiclePosition.getCurrentElectricityScore() + size);
                                if (temp != vehiclePosition.getCurrentElectricity()) {
                                    size--;
                                } else {
                                    maxTemp++;
                                }
                            }
                            if (maxTemp > 1) {
                                // 证明有最高相同电量的  找下一个
                                // 找出最第二大的值是那个
                                // 将四个值放入列表
                                List<Integer> values = Arrays.asList(tendencyOrderValue, tendencyDistance, tendencyTime);
                                // 降序排序
                                values.sort(Collections.reverseOrder());
                                // 获取第二大值
                                Integer secondMax = values.get(1);
                                // 判断第二大的是哪个
                                if (Objects.equals(secondMax, tendencyDistance)) {
                                    for (VehiclePositionVo vehiclePosition : availableVehiclesNearby) {
                                        RouteAndFareDto routeAndFareDto = new RouteAndFareDto();
                                        LonLatDto lonLatDto = new LonLatDto();
@@ -687,8 +571,9 @@
                                        LonLatDto lonLatDto1 = new LonLatDto();
                                        lonLatDto1.setLongitude(Double.parseDouble(split[0]));
                                        lonLatDto1.setLatitude(Double.parseDouble(split[1]));
                                        routeAndFareDto.setRoutePlanRule(Integer.valueOf(planRule));
                                        if(planRule!=null&& !"null".equals(planRule)){
                                            routeAndFareDto.setRoutePlanRule(Integer.valueOf(planRule));
                                        }
                                        routeAndFareDto.setDestination(lonLatDto1);
                                        //  调用地图 获取时间
                                        R<RouteVo> r = xpMapClient.getDistanceAndDuration(routeAndFareDto);
@@ -698,9 +583,20 @@
                                            vehiclePosition.setDistance(0.0);
                                        }
                                    }
                                    availableVehiclesNearby = availableVehiclesNearby.stream().sorted(Comparator.comparing(VehiclePositionVo::getDistance)).collect(Collectors.toList());
                                    int size1 = tendencyDistance;
                                    // 做比对的分数
                                    double temp1 = availableVehiclesNearby.get(0).getDistance();
                                    for (VehiclePositionVo vehiclePosition : availableVehiclesNearby) {
                                        vehiclePosition.setDistanceScore(vehiclePosition.getDistanceScore() + size1);
                                        if (temp1 != vehiclePosition.getDistance()) {
                                            size1--;
                                        }
                                    }
                                }
                                if (max1.equals(weightTime)) {
                                if (Objects.equals(secondMax, tendencyTime)) {
                                    for (VehiclePositionVo vehiclePosition : availableVehiclesNearby) {
                                        RouteAndFareDto routeAndFareDto = new RouteAndFareDto();
                                        LonLatDto lonLatDto = new LonLatDto();
@@ -711,7 +607,9 @@
                                        lonLatDto1.setLongitude(Double.parseDouble(split[0]));
                                        lonLatDto1.setLatitude(Double.parseDouble(split[1]));
                                        routeAndFareDto.setRoutePlanRule(Integer.valueOf(planRule));
                                        if(planRule!=null&& !"null".equals(planRule)){
                                            routeAndFareDto.setRoutePlanRule(Integer.valueOf(planRule));
                                        }
                                        routeAndFareDto.setDestination(lonLatDto1);
                                        //  调用地图 获取时间
                                        R<RouteVo> r = xpMapClient.getDistanceAndDuration(routeAndFareDto);
@@ -721,26 +619,150 @@
                                            vehiclePosition.setSecond(0);
                                        }
                                    }
                                }
                                if (max1.equals(weightElectricity)) {
                                    // 计算车的分数  分数最大是车的size
                                    availableVehiclesNearby = availableVehiclesNearby.stream().sorted(Comparator.comparing(VehiclePositionVo::getCurrentElectricity).reversed()).collect(Collectors.toList());
                                    int size1 = tendencyElectricity;
                                    availableVehiclesNearby = availableVehiclesNearby.stream().sorted(Comparator.comparing(VehiclePositionVo::getSecond)).collect(Collectors.toList());
                                    int size1 = tendencyTime;
                                    // 做比对的分数
                                    int temp1 = availableVehiclesNearby.get(0).getCurrentElectricity();
                                    double temp1 = availableVehiclesNearby.get(0).getSecond();
                                    for (VehiclePositionVo vehiclePosition : availableVehiclesNearby) {
                                        vehiclePosition.setCurrentElectricityScore(vehiclePosition.getCurrentElectricityScore() + size1);
                                        if (temp1 != vehiclePosition.getCurrentElectricity()) {
                                        vehiclePosition.setTimeScore(vehiclePosition.getTimeScore() + size1);
                                        if (temp1 != vehiclePosition.getSecond()) {
                                            size1--;
                                        }
                                    }
                                }
                                // 订单价值
                                if (Objects.equals(secondMax, tendencyOrderValue)) {
                                    // 订单价值
                                    // 时间差权重
                                    Integer weightTimeDifference = xpTradingStrategy.getWeightTimeDifference();
                                    // 距离差权重
                                    Integer weightDistanceDifference = xpTradingStrategy.getWeightDistanceDifference();
                                    // 距离权重
                                    Integer weightDistance = xpTradingStrategy.getWeightDistance();
                                    // 时间权重
                                    Integer weightTime = xpTradingStrategy.getWeightTime();
                                    // 电量权重
                                    Integer weightElectricity = xpTradingStrategy.getWeightElectricity();
                                    // 找出最大的值是那个
                                    Integer max1 = Math.max(weightTimeDifference, Math.max(weightDistanceDifference, Math.max(weightDistance, Math.max(weightTime, weightElectricity))));
                                    //  时间差
                                    if (max1.equals(weightTimeDifference)) {
                                        for (VehiclePositionVo vehiclePosition : availableVehiclesNearby) {
                                            RouteAndFareDto routeAndFareDto = new RouteAndFareDto();
                                            LonLatDto lonLatDto = new LonLatDto();
                                            lonLatDto.setLongitude(vehiclePosition.getPoint().getX());
                                            lonLatDto.setLatitude(vehiclePosition.getPoint().getY());
                                            routeAndFareDto.setOrigin(lonLatDto);
                                            LonLatDto lonLatDto1 = new LonLatDto();
                                            lonLatDto1.setLongitude(Double.valueOf(split[0]));
                                            lonLatDto1.setLatitude(Double.valueOf(split[1]));
                                            routeAndFareDto.setDestination(lonLatDto1);
                                            if(planRule!=null&& !"null".equals(planRule)){
                                                routeAndFareDto.setRoutePlanRule(Integer.valueOf(planRule));
                                            }
                                            R<RouteVo> distanceAndDuration = xpMapClient.getDistanceAndDuration(routeAndFareDto);
                                            if (distanceAndDuration.getCode() == 200) {
                                                // 送驾- 接驾
                                                Integer durationDifference = Integer.parseInt(duration) - distanceAndDuration.getData().getDuration();
                                                vehiclePosition.setTimeDifference(durationDifference);
                                            }
                                        }
                                    }
                                    if (max1.equals(weightDistanceDifference)) {
                                        for (VehiclePositionVo vehiclePosition : availableVehiclesNearby) {
                                            RouteAndFareDto routeAndFareDto = new RouteAndFareDto();
                                            LonLatDto lonLatDto = new LonLatDto();
                                            lonLatDto.setLongitude(vehiclePosition.getPoint().getX());
                                            lonLatDto.setLatitude(vehiclePosition.getPoint().getY());
                                            routeAndFareDto.setOrigin(lonLatDto);
                                            LonLatDto lonLatDto1 = new LonLatDto();
                                            lonLatDto1.setLongitude(Double.valueOf(split[0]));
                                            lonLatDto1.setLatitude(Double.valueOf(split[1]));
                                            routeAndFareDto.setDestination(lonLatDto1);
                                            if(planRule!=null&& !"null".equals(planRule)){
                                                routeAndFareDto.setRoutePlanRule(Integer.valueOf(planRule));
                                            }
                                            R<RouteVo> distanceAndDuration = xpMapClient.getDistanceAndDuration(routeAndFareDto);
                                            if (distanceAndDuration.getCode() == 200) {
                                                // 送驾- 接驾
                                                Integer distanceDifference = Integer.parseInt(distance) - distanceAndDuration.getData().getDistance();
                                                vehiclePosition.setDistanceDifference(distanceDifference);
                                            }
                                        }
                                    }
                                    if (max1.equals(weightDistance)) {
                                        for (VehiclePositionVo vehiclePosition : availableVehiclesNearby) {
                                            RouteAndFareDto routeAndFareDto = new RouteAndFareDto();
                                            LonLatDto lonLatDto = new LonLatDto();
                                            lonLatDto.setLongitude(vehiclePosition.getPoint().getX());
                                            lonLatDto.setLatitude(vehiclePosition.getPoint().getY());
                                            routeAndFareDto.setOrigin(lonLatDto);
                                            LonLatDto lonLatDto1 = new LonLatDto();
                                            lonLatDto1.setLongitude(Double.parseDouble(split[0]));
                                            lonLatDto1.setLatitude(Double.parseDouble(split[1]));
                                            if(planRule!=null&& !"null".equals(planRule)){
                                                routeAndFareDto.setRoutePlanRule(Integer.valueOf(planRule));
                                            }
                                            routeAndFareDto.setDestination(lonLatDto1);
                                            //  调用地图 获取时间
                                            R<RouteVo> r = xpMapClient.getDistanceAndDuration(routeAndFareDto);
                                            if (r.getCode() == 200) {
                                                vehiclePosition.setDistance(Double.valueOf(r.getData().getDistance()));
                                            } else {
                                                vehiclePosition.setDistance(0.0);
                                            }
                                        }
                                    }
                                    if (max1.equals(weightTime)) {
                                        for (VehiclePositionVo vehiclePosition : availableVehiclesNearby) {
                                            RouteAndFareDto routeAndFareDto = new RouteAndFareDto();
                                            LonLatDto lonLatDto = new LonLatDto();
                                            lonLatDto.setLongitude(vehiclePosition.getPoint().getX());
                                            lonLatDto.setLatitude(vehiclePosition.getPoint().getY());
                                            routeAndFareDto.setOrigin(lonLatDto);
                                            LonLatDto lonLatDto1 = new LonLatDto();
                                            lonLatDto1.setLongitude(Double.parseDouble(split[0]));
                                            lonLatDto1.setLatitude(Double.parseDouble(split[1]));
                                            if(planRule!=null&& !"null".equals(planRule)){
                                                routeAndFareDto.setRoutePlanRule(Integer.valueOf(planRule));
                                            }
                                            routeAndFareDto.setDestination(lonLatDto1);
                                            //  调用地图 获取时间
                                            R<RouteVo> r = xpMapClient.getDistanceAndDuration(routeAndFareDto);
                                            if (r.getCode() == 200) {
                                                vehiclePosition.setSecond(r.getData().getDuration());
                                            } else {
                                                vehiclePosition.setSecond(0);
                                            }
                                        }
                                    }
                                    if (max1.equals(weightElectricity)) {
                                        // 计算车的分数  分数最大是车的size
                                        availableVehiclesNearby = availableVehiclesNearby.stream().sorted(Comparator.comparing(VehiclePositionVo::getCurrentElectricity).reversed()).collect(Collectors.toList());
                                        int size1 = tendencyElectricity;
                                        // 做比对的分数
                                        int temp1 = availableVehiclesNearby.get(0).getCurrentElectricity();
                                        for (VehiclePositionVo vehiclePosition : availableVehiclesNearby) {
                                            vehiclePosition.setCurrentElectricityScore(vehiclePosition.getCurrentElectricityScore() + size1);
                                            if (temp1 != vehiclePosition.getCurrentElectricity()) {
                                                size1--;
                                            }
                                        }
                                    }
                                }
                                // 算出总分 再来排序计算
                                for (VehiclePositionVo vehiclePositionVo : availableVehiclesNearby) {
                                    vehiclePositionVo.setOrderValueTotal(vehiclePositionVo.getCurrentElectricityScore() + vehiclePositionVo.getDistanceScore() + vehiclePositionVo.getTimeScore() + vehiclePositionVo.getDistanceDifference() + vehiclePositionVo.getTimeDifference());
                                    vehiclePositionVo.setOrderValueTotal(vehiclePositionVo.getCurrentElectricityScore() + vehiclePositionVo.getDistanceScore() + vehiclePositionVo.getTimeScore() + vehiclePositionVo.getDistanceDifference() + vehiclePositionVo.getTimeDifference()+vehiclePositionVo.getSecond()+vehiclePositionVo.getDistance().intValue());
                                }
                                availableVehiclesNearby = availableVehiclesNearby.stream().sorted(Comparator.comparing(VehiclePositionVo::getOrderValueTotal).reversed()).collect(Collectors.toList());
@@ -759,6 +781,8 @@
                        }
                    } catch (Exception e) {
                        log.error("异常", e);
                    }
                    // 判断总分来计算
@@ -783,12 +807,12 @@
                        XpVehicle vehiclePosition = vehiclePositionR.getData();
                        log.info("符合条件的车辆 {} ,直接推单XPU。单号 {}", vehiclePosition.getPlateNumber(), orderNo);
                        log.info("当前车辆状态 {} 单号 {}", vehiclePosition.getStatus(), orderNo);
                        if (vehiclePosition.getStatus() != 1 || vehiclePosition.getState() != 0 || vehiclePosition.getVehicleType()==1) {
                        if (vehiclePosition.getOperatingStatus() != 1 || vehiclePosition.getState() != 0 || vehiclePosition.getVehicleType() == 1) {
                            continue;
                        }
                        //  关闭巡游单子
                        R<String> stringR = xpCruiseOrderClient.updateCruiseOrder(vehiclePosition.getVehicleVin());
                        if(stringR ==null || stringR.getCode() != 200){
                        if (stringR == null || stringR.getCode() != 200) {
                            log.info("关闭巡游单子失败 车牌号 {}", vehiclePosition.getPlateNumber());
                            continue;
                        }
@@ -807,7 +831,7 @@
                        orderMissionClient.pushOrder(pushOrderDto);
                        log.info("开始推送 {} 订单到XPU。单号 {}", xpOrder.getOrderNumber(), orderNo);
                        redisService.popFirstElement(quoteName);
                        redisService.removeByPattern(quoteName,xpOrder.getOrderNumber());
                        log.info("将订单 {} 从队列 {} 弹出去", orderNo, quoteName);
                        return true;
                    } catch (Exception e) {
@@ -818,7 +842,7 @@
                } else {
                    // 直接派单  定义一个锁来锁定车辆
                    VehiclePosition vehiclePosition = positionList.get(0);
                    VehiclePositionVo vehiclePosition = availableVehiclesNearby.get(0);
                    String vehicleVin = vehiclePosition.getVin();
                    RLock lock = redissonClient.getLock("FIND_CAR_" + vehiclePosition.getVin());
@@ -832,12 +856,12 @@
                        XpVehicle vehicleId1 = vehicleR.getData();
                        log.info("附近只有一个车辆 {} ,直接推单XPU。单号 {}", vehicleId1.getPlateNumber(), orderNo);
                        log.info("当前车辆状态 {} 运营状态 {} 单号 {}", vehicleId1.getOperatingStatus(), vehicleId1.getState(), orderNo);
                        if (vehicleId1.getOperatingStatus() != 1 || vehicleId1.getState() != 0 || vehicleId1.getVehicleType()==1) {
                        if (vehicleId1.getOperatingStatus() != 1 || vehicleId1.getState() != 0 || vehicleId1.getVehicleType() == 1) {
                            continue;
                        }
                        //  关闭巡游单子
                        R<String> stringR = xpCruiseOrderClient.updateCruiseOrder(vehicleId1.getVehicleVin());
                        if(stringR ==null || stringR.getCode() != 200){
                        if (stringR == null || stringR.getCode() != 200) {
                            log.info("关闭巡游单子失败 车牌号 {}", vehicleId1.getPlateNumber());
                            continue;
                        }
@@ -856,17 +880,6 @@
                        log.info("开始推送 {} 订单到XPU", xpOrder.getOrderNumber());
                        redisService.popFirstElement(quoteName);
                        log.info("将订单 {} 从队列 {} 弹出去", orderNo, quoteName);
                        //判断还原车辆状态
                        Object cacheObject = redisService.getCacheObject("CREATE_ORDER:" + xpOrder.getId().toString());
                        if(null != cacheObject){
                            JSONObject jsonObject = JSON.parseObject(cacheObject.toString());
                            String vin = jsonObject.getString("vin");
                            XpVehicle vehicle = xpVehicleClient.findByVehicleVin(vin).getData();
                            if(null != vehicle && 0 != vehicle.getState()){
                                vehicle.setState(0);
                                xpVehicleClient.updateVehicleById(vehicle);
                            }
                        }
                        return true;
                    } catch (Exception e) {
                        e.printStackTrace();
@@ -932,7 +945,7 @@
                }
                //  关闭巡游单子
                R<String> stringR = xpCruiseOrderClient.updateCruiseOrder(vehicleId1.getVehicleVin());
                if(stringR ==null || stringR.getData()==null){
                if (stringR == null || stringR.getData() == null) {
                    log.info("关闭巡游单子失败");
                    continue;
                }
xp-robotaxi-operation-boot/src/main/resources/mapper/operation/XpPointMapper.xml
@@ -98,7 +98,7 @@
        and xefa.area_status = 1 and p.electronic_area_id is not null
        and xefa.city_code = #{query.cityCode}
        <if test="query.pointPoi != null and query.pointPoi != ''">
            and p.point_address like concat('%',#{query.pointPoi},'%')
            and ( p.point_address like concat('%',#{query.pointPoi},'%') or p.point_name like concat('%',#{query.pointPoi},'%') )
        </if>
        <if test="query.electronicAreaId != null">
            and p.electronic_area_id = #{query.electronicAreaId}
xp-robotaxi-order-boot/src/main/java/com/xiaopeng/order/model/vo/XpOrderHistoryListVO.java
@@ -63,6 +63,9 @@
    private Integer endParkingTimeLimit;
    private Integer status;
}
xp-robotaxi-order-boot/src/main/java/com/xiaopeng/order/service/impl/XpCruiseOrderServiceImpl.java
@@ -11,7 +11,7 @@
import com.xiaopeng.api.model.order.XpCruiseOrder;
import com.xiaopeng.api.model.vehicleConvoy.XpFleet;
import com.xiaopeng.api.model.vehicleConvoy.XpVehicle;
import com.xiaopeng.api.vo.automaticPilot.proto.down.cloudOrderOperation.OrderOperationType;
import com.xiaopeng.api.vo.automaticPilot.protobuf.OrderOperationType;
import com.xiaopeng.common.core.domain.R;
import com.xiaopeng.common.core.utils.StringUtils;
import com.xiaopeng.common.core.web.domain.BaseModel;
xp-robotaxi-order-boot/src/main/java/com/xiaopeng/order/service/impl/XpOrderServiceImpl.java
@@ -25,6 +25,7 @@
import com.xiaopeng.api.dto.statistics.OrderStatisticsDTO;
import com.xiaopeng.api.dto.statistics.StatisticsQueryDTO;
import com.xiaopeng.api.dto.vehicleConvoy.BaseVehicleUserDto;
import com.xiaopeng.api.dto.vehicleConvoy.UpdateVehicleStateDto;
import com.xiaopeng.api.feignClient.account.UserResourcesClient;
import com.xiaopeng.api.feignClient.account.XpAppUserCouponClient;
import com.xiaopeng.api.feignClient.automaticPilot.OrderMissionClient;
@@ -46,8 +47,7 @@
import com.xiaopeng.api.vo.OrderType;
import com.xiaopeng.api.vo.account.UserCouponVo;
import com.xiaopeng.api.vo.automaticPilot.VehiclePosition;
// import com.xiaopeng.api.vo.automaticPilot.protobuf.OrderOperationType;
import com.xiaopeng.api.vo.automaticPilot.proto.down.cloudOrderOperation.OrderOperationType;
import com.xiaopeng.api.vo.automaticPilot.protobuf.OrderOperationType;
import com.xiaopeng.api.vo.operation.RouteVo;
import com.xiaopeng.api.vo.order.*;
import com.xiaopeng.api.vo.vehicleConvoy.AddTaxiPassengerVo;
@@ -95,6 +95,7 @@
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Lazy;
import org.springframework.data.domain.Sort;
import org.springframework.data.mongodb.core.MongoTemplate;
@@ -152,8 +153,10 @@
    private MongoTemplate mongoTemplate;
    @Autowired
    private HolidayUtil holidayUtil;
//    @Autowired
//    private XpPricingUtil xpPricingUtil;
    @Value("${robotaxi.appId:xp_robotaxi_api}")
    private String appid;
    @Override
    public OrderStatisticsDTO getOrderStatistics(StatisticsQueryDTO query) {
@@ -571,6 +574,27 @@
     * 取消订单
     */
    private void cancelOrder(XpOrder order) {
        redisService.removeByPattern(order.getQueueName(),order.getOrderNumber());
        //判断还原车辆状态
        if(null == order.getVehicleId()){
            Object cacheObject1 = redisService.getCacheObject("CREATE_ORDER:" + order.getId().toString());
            if(null != cacheObject1){
                com.alibaba.fastjson.JSONObject jsonObject = com.alibaba.fastjson.JSON.parseObject(cacheObject1.toString());
                String vin = jsonObject.getString("vin");
                XpVehicle vehicle = xpVehicleClient.findByVehicleVin(vin).getData();
                if(null != vehicle && 0 != vehicle.getState()){
                    vehicle.setState(0);
                    xpVehicleClient.updateVehicleById(vehicle);
                }
            }
        }
        if (order.getStatus() == 1) {
            order.setStatus(0);
            order.setAppUserId(null);
            baseMapper.updateById(order);
            return;
        }
        // 1. 更新订单状态为已取消(0)
        lambdaUpdate().set(XpOrder::getStatus, 0)
                .eq(XpOrder::getId, order.getId()).update();
@@ -585,12 +609,32 @@
        //查询车辆信息
        R<XpVehicle> xpVehicleR = xpVehicleClient.queryById(order.getId());
        if (xpVehicleR.getCode() == HttpStatus.SUCCESS && Objects.nonNull(xpVehicleR.getData())) {
            XpVehicle xpVehicle = xpVehicleR.getData();
            // 组装调用车机参数
            CancelTaxiPassengerVo cancelTaxiPassengerVo = new CancelTaxiPassengerVo();
            cancelTaxiPassengerVo.setVin(xpVehicle.getVehicleVin());
            cancelTaxiPassengerVo.setUid(order.getAppUserId().toString());
            cancelTaxiPassengerVo.setOrderNo(order.getOrderNumber());
            // TODO 加配置文件取
            cancelTaxiPassengerVo.setAppId(appid);
            BaseVehicleUserDto baseVehicleUserDto = userVehicleClient.cancelTaxiPassenger(cancelTaxiPassengerVo);
            if (baseVehicleUserDto == null) {
                // TODO 本地无法调通
//            throw new RuntimeException("取消订单失败");
            }
            //还原车辆状态
            if(1 == xpVehicle.getState()){
                xpVehicleClient.updateVehicleStatus(new UpdateVehicleStateDto(xpVehicle.getVehicleVin(), 0));
            }
            // 下发命令
            if (order.getStatus() > 1) {
                PushOrderDto pushOrderDto = new PushOrderDto();
                pushOrderDto.setOrderId(order.getId().toString());
                pushOrderDto.setVin(xpVehicleR.getData().getVehicleVin());
                // pushOrderDto.setOperation_type(com.xiaopeng.api.vo.automaticPilot.protobuf.OrderOperationType.CLOUD_CANCEL_ORDER);
                pushOrderDto.setVin(xpVehicle.getVehicleVin());
                pushOrderDto.setOperation_type(com.xiaopeng.api.vo.automaticPilot.protobuf.OrderOperationType.CLOUD_CANCEL_ORDER);
                orderMissionClient.cancelOrder(pushOrderDto);
            }
        } else {
@@ -676,7 +720,7 @@
                    PushOrderDto cancelDto = new PushOrderDto();
                    cancelDto.setOrderId(order.getId().toString());
                    cancelDto.setVin(oldVehicle.getVehicleVin());
                    // cancelDto.setOperation_type(com.xiaopeng.api.vo.automaticPilot.protobuf.OrderOperationType.CLOUD_CANCEL_ORDER);
                    cancelDto.setOperation_type(com.xiaopeng.api.vo.automaticPilot.protobuf.OrderOperationType.CLOUD_CANCEL_ORDER);
                    orderMissionClient.cancelOrder(cancelDto);
                    log.info("已取消原车辆订单指令,订单ID: {}, VIN: {}", orderId, oldVehicle.getVehicleVin());
@@ -686,7 +730,7 @@
                        cancelVo.setVin(oldVehicle.getVehicleVin());
                        cancelVo.setUid(order.getAppUserId().toString());
                        cancelVo.setOrderNo(order.getOrderNumber());
                        cancelVo.setAppId("");
                        cancelVo.setAppId(appid);
                        userVehicleClient.cancelTaxiPassenger(cancelVo);
                        log.info("已解绑乘客与原车辆关系,用户ID: {}, VIN: {}", order.getAppUserId(), oldVehicle.getVehicleVin());
                    }
@@ -768,7 +812,7 @@
                addVo.setVin(newVehicle.getVehicleVin());
                addVo.setUid(order.getAppUserId().toString());
                addVo.setOrderNo(order.getOrderNumber());
                addVo.setAppId(""); // TODO 获取appId
                addVo.setAppId(appid); // TODO 获取appId
                userVehicleClient.addTaxiPassenger(addVo);
                log.info("已绑定乘客与新车辆关系,用户ID: {}, VIN: {}", order.getAppUserId(), newVehicle.getVehicleVin());
            }
@@ -1056,6 +1100,22 @@
        if (order.getStatus() > 5 || order.getStatus() < 1) {
            throw new ServiceException("订单状态错误", I18nKeyConstant.ORDER_STATUS_ERROR);
        }
        redisService.removeByPattern(order.getQueueName(),order.getOrderNumber());
        //判断还原车辆状态
        if(null == order.getVehicleId()){
            Object cacheObject1 = redisService.getCacheObject("CREATE_ORDER:" + order.getId().toString());
            if(null != cacheObject1){
                com.alibaba.fastjson.JSONObject jsonObject = com.alibaba.fastjson.JSON.parseObject(cacheObject1.toString());
                String vin = jsonObject.getString("vin");
                XpVehicle vehicle = xpVehicleClient.findByVehicleVin(vin).getData();
                if(null != vehicle && 0 != vehicle.getState()){
                    vehicle.setState(0);
                    xpVehicleClient.updateVehicleById(vehicle);
                }
            }
        }
        if (order.getStatus() == 1) {
            order.setStatus(0);
            order.setAppUserId(null);
@@ -1081,7 +1141,7 @@
        cancelTaxiPassengerVo.setUid(order.getAppUserId().toString());
        cancelTaxiPassengerVo.setOrderNo(order.getOrderNumber());
        // TODO 加配置文件取
        cancelTaxiPassengerVo.setAppId("");
        cancelTaxiPassengerVo.setAppId(appid);
        BaseVehicleUserDto baseVehicleUserDto = userVehicleClient.cancelTaxiPassenger(cancelTaxiPassengerVo);
        if (baseVehicleUserDto == null) {
@@ -1096,16 +1156,9 @@
        xpOrderCancel.setCancelSource(1);
        xpOrderCancel.setCancelReason("用户取消订单");
        xpOrderCancelService.save(xpOrderCancel);
        //判断还原车辆状态
        Object cacheObject1 = redisService.getCacheObject("CREATE_ORDER:" + order.getId().toString());
        if(null != cacheObject1){
            com.alibaba.fastjson.JSONObject jsonObject = com.alibaba.fastjson.JSON.parseObject(cacheObject1.toString());
            String vin = jsonObject.getString("vin");
            XpVehicle vehicle = xpVehicleClient.findByVehicleVin(vin).getData();
            if(null != vehicle && 0 != vehicle.getState()){
                vehicle.setState(0);
                xpVehicleClient.updateVehicleById(vehicle);
            }
        //还原车辆状态
        if(1 == xpVehicle.getState()){
            xpVehicleClient.updateVehicleStatus(new UpdateVehicleStateDto(xpVehicle.getVehicleVin(), 0));
        }
        // 设置当天的取消次数缓存
@@ -1140,7 +1193,7 @@
            PushOrderDto pushOrderDto = new PushOrderDto();
            pushOrderDto.setOrderId(order.getId().toString());
            pushOrderDto.setVin(xpVehicle.getVehicleVin());
            // pushOrderDto.setOperation_type(com.xiaopeng.api.vo.automaticPilot.protobuf.OrderOperationType.VEHICLE_CANCEL_ORDER);
            pushOrderDto.setOperation_type(com.xiaopeng.api.vo.automaticPilot.protobuf.OrderOperationType.VEHICLE_CANCEL_ORDER);
            orderMissionClient.cancelOrder(pushOrderDto);
        }
@@ -1163,6 +1216,8 @@
        xpOrderCancel.setCancelReason("系统取消订单");
        xpOrderCancel.setCreateTime(LocalDateTime.now());
        xpOrderCancelService.save(xpOrderCancel);
        redisService.removeByPattern(order.getQueueName(),order.getOrderNumber());
        R<XpVehicle> xpVehicleR = xpVehicleClient.queryById(order.getVehicleId());
@@ -1327,7 +1382,7 @@
            cancelTaxiPassengerVo.setUid(uid);
            cancelTaxiPassengerVo.setOrderNo(order.getOrderNumber());
            // TODO 加配置文件取
            cancelTaxiPassengerVo.setAppId("");
            cancelTaxiPassengerVo.setAppId(appid);
            userVehicleClient.cancelTaxiPassenger(cancelTaxiPassengerVo);
            // 修改车辆接单状态
@@ -2234,7 +2289,7 @@
                this.updateById(order);
                addTaxiPassengerVo.setOrderNo(order.getOrderNumber());
                // TODO appid
                addTaxiPassengerVo.setAppId("");
                addTaxiPassengerVo.setAppId(appid);
                userVehicleClient.addTaxiPassenger(addTaxiPassengerVo);
                //推送乘客车辆到达预约点的导航数据
                sendRoute(addTaxiPassengerVo.getUid(), orderId, "ORDER_NAVIGATION_START_DATA", dto.getXpVehicleVin());
xp-robotaxi-order-boot/src/main/resources/mapper/order/XpOrderMapper.xml
@@ -47,7 +47,7 @@
    <select id="getHistoryOrderList" resultType="com.xiaopeng.order.model.vo.XpOrderHistoryListVO">
        select start_point_name as originAddress, end_point_name as destinationAddress,start_point_id as startPointId,end_point_id as endPointId,
        DATE_FORMAT(create_time, '%H:%i') AS orderTime, pay_money as amount,create_time as time,DATE_FORMAT(create_time,'%Y-%m-%d') AS timeStr,
        id as orderId from xp_order where app_user_id = #{uid} and is_deleted = 0 and status in (9,10)
        id as orderId,status from xp_order where app_user_id = #{uid} and is_deleted = 0
        <if test="query.status != null">
            and status = #{query.status}
        </if>