sql/增量sql/xprt_maintenance.sql
@@ -1,39 +1,95 @@ ALTER TABLE `xp_task_0` MODIFY COLUMN `vehicle_location` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '车辆位置' AFTER `task_image`; ALTER TABLE `xp_task_0` ADD COLUMN `task_source` tinyint(1) NULL DEFAULT 1 COMMENT '任务来源 1-运维APP 2-管理后台' AFTER `will_timeout_notice_sent`; ALTER TABLE `xp_task_1` MODIFY COLUMN `vehicle_location` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '车辆位置' AFTER `task_image`; ALTER TABLE `xp_task_1` ADD COLUMN `task_source` tinyint(1) NULL DEFAULT 1 COMMENT '任务来源 1-运维APP 2-管理后台' AFTER `will_timeout_notice_sent`; ALTER TABLE `xp_task_2` MODIFY COLUMN `vehicle_location` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '车辆位置' AFTER `task_image`; ALTER TABLE `xp_task_2` ADD COLUMN `task_source` tinyint(1) NULL DEFAULT 1 COMMENT '任务来源 1-运维APP 2-管理后台' AFTER `will_timeout_notice_sent`; ALTER TABLE `xp_task_3` MODIFY COLUMN `vehicle_location` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '车辆位置' AFTER `task_image`; ALTER TABLE `xp_task_3` ADD COLUMN `task_source` tinyint(1) NULL DEFAULT 1 COMMENT '任务来源 1-运维APP 2-管理后台' AFTER `will_timeout_notice_sent`; ALTER TABLE `xp_task_4` MODIFY COLUMN `vehicle_location` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '车辆位置' AFTER `task_image`; ALTER TABLE `xp_task_4` ADD COLUMN `task_source` tinyint(1) NULL DEFAULT 1 COMMENT '任务来源 1-运维APP 2-管理后台' AFTER `will_timeout_notice_sent`; ALTER TABLE `xp_task_5` MODIFY COLUMN `vehicle_location` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '车辆位置' AFTER `task_image`; ALTER TABLE `xp_task_5` ADD COLUMN `task_source` tinyint(1) NULL DEFAULT 1 COMMENT '任务来源 1-运维APP 2-管理后台' AFTER `will_timeout_notice_sent`; ALTER TABLE `xp_task_6` MODIFY COLUMN `vehicle_location` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '车辆位置' AFTER `task_image`; ALTER TABLE `xp_task_6` ADD COLUMN `task_source` tinyint(1) NULL DEFAULT 1 COMMENT '任务来源 1-运维APP 2-管理后台' AFTER `will_timeout_notice_sent`; ALTER TABLE `xp_task_7` MODIFY COLUMN `vehicle_location` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '车辆位置' AFTER `task_image`; ALTER TABLE `xp_task_7` ADD COLUMN `task_source` tinyint(1) NULL DEFAULT 1 COMMENT '任务来源 1-运维APP 2-管理后台' AFTER `will_timeout_notice_sent`; ALTER TABLE `xp_task_8` MODIFY COLUMN `vehicle_location` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '车辆位置' AFTER `task_image`; ALTER TABLE `xp_task_8` ADD COLUMN `task_source` tinyint(1) NULL DEFAULT 1 COMMENT '任务来源 1-运维APP 2-管理后台' AFTER `will_timeout_notice_sent`; ALTER TABLE `xp_task_9` MODIFY COLUMN `vehicle_location` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '车辆位置' AFTER `task_image`; ALTER TABLE `xp_task_9` ADD COLUMN `task_source` tinyint(1) NULL DEFAULT 1 COMMENT '任务来源 1-运维APP 2-管理后台' AFTER `will_timeout_notice_sent`; ALTER TABLE `xp_task_10` MODIFY COLUMN `vehicle_location` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '车辆位置' AFTER `task_image`; ALTER TABLE `xp_task_10` ADD COLUMN `task_source` tinyint(1) NULL DEFAULT 1 COMMENT '任务来源 1-运维APP 2-管理后台' AFTER `will_timeout_notice_sent`; ALTER TABLE `xp_task_11` MODIFY COLUMN `vehicle_location` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '车辆位置' AFTER `task_image`; ALTER TABLE `xp_task_11` ADD COLUMN `task_source` tinyint(1) NULL DEFAULT 1 COMMENT '任务来源 1-运维APP 2-管理后台' AFTER `will_timeout_notice_sent`; ALTER TABLE `xp_task_12` MODIFY COLUMN `vehicle_location` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '车辆位置' AFTER `task_image`; ALTER TABLE `xp_task_12` ADD COLUMN `task_source` tinyint(1) NULL DEFAULT 1 COMMENT '任务来源 1-运维APP 2-管理后台' AFTER `will_timeout_notice_sent`; ALTER TABLE `xp_task_13` MODIFY COLUMN `vehicle_location` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '车辆位置' AFTER `task_image`; ALTER TABLE `xp_task_13` ADD COLUMN `task_source` tinyint(1) NULL DEFAULT 1 COMMENT '任务来源 1-运维APP 2-管理后台' AFTER `will_timeout_notice_sent`; ALTER TABLE `xp_task_14` MODIFY COLUMN `vehicle_location` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '车辆位置' AFTER `task_image`; ALTER TABLE `xp_task_14` ADD COLUMN `task_source` tinyint(1) NULL DEFAULT 1 COMMENT '任务来源 1-运维APP 2-管理后台' AFTER `will_timeout_notice_sent`; ALTER TABLE `xp_task_15` MODIFY COLUMN `vehicle_location` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '车辆位置' AFTER `task_image`; ALTER TABLE `xp_task_15` ADD COLUMN `task_source` tinyint(1) NULL DEFAULT 1 COMMENT '任务来源 1-运维APP 2-管理后台' AFTER `will_timeout_notice_sent`; ALTER TABLE `xp_task_16` MODIFY COLUMN `vehicle_location` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '车辆位置' AFTER `task_image`; ALTER TABLE `xp_task_16` ADD COLUMN `task_source` tinyint(1) NULL DEFAULT 1 COMMENT '任务来源 1-运维APP 2-管理后台' AFTER `will_timeout_notice_sent`; ALTER TABLE `xp_task_17` MODIFY COLUMN `vehicle_location` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '车辆位置' AFTER `task_image`; ALTER TABLE `xp_task_17` ADD COLUMN `task_source` tinyint(1) NULL DEFAULT 1 COMMENT '任务来源 1-运维APP 2-管理后台' AFTER `will_timeout_notice_sent`; ALTER TABLE `xp_task_18` MODIFY COLUMN `vehicle_location` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '车辆位置' AFTER `task_image`; ALTER TABLE `xp_task_18` ADD COLUMN `task_source` tinyint(1) NULL DEFAULT 1 COMMENT '任务来源 1-运维APP 2-管理后台' AFTER `will_timeout_notice_sent`; ALTER TABLE `xp_task_19` MODIFY COLUMN `vehicle_location` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '车辆位置' AFTER `task_image`; ALTER TABLE `xp_task_19` ADD COLUMN `task_source` tinyint(1) NULL DEFAULT 1 COMMENT '任务来源 1-运维APP 2-管理后台' AFTER `will_timeout_notice_sent`; ALTER TABLE `xp_task_rule` MODIFY COLUMN `vehicle_inspection` tinyint(1) NULL DEFAULT 1 COMMENT '车辆日常检测是否启用 0否1是' AFTER `id`; ALTER TABLE `xp_task_rule` MODIFY COLUMN `vehicle_inspection_frequency` int NULL DEFAULT NULL COMMENT '车辆日常监测 频次' AFTER `vehicle_inspection`; ALTER TABLE `xp_task_rule` MODIFY COLUMN `vehicle_inspection_time` time NULL DEFAULT NULL COMMENT '车辆日常检测 任务下放时间' AFTER `vehicle_inspection_frequency`; ALTER TABLE `xp_task_rule` MODIFY COLUMN `vehicle_inspection_level` int NULL DEFAULT 0 COMMENT '车辆日常监测 紧急程度 0=P0 1=P1 2=P2 3=P3' AFTER `vehicle_inspection_time`; ALTER TABLE `xp_task_rule` MODIFY COLUMN `vehicle_collection` tinyint(1) NULL DEFAULT 1 COMMENT '车辆收车是否启用 0否1是' AFTER `vehicle_inspection_level`; ALTER TABLE `xp_task_rule` MODIFY COLUMN `vehicle_collection_time` time NULL DEFAULT NULL COMMENT '车辆收车每日时间' AFTER `vehicle_collection`; ALTER TABLE `xp_task_rule` MODIFY COLUMN `maintenance_cycle` tinyint(1) NULL DEFAULT 1 COMMENT '车辆保养周期是否启用' AFTER `vehicle_collection_time`; ALTER TABLE `xp_task_rule` MODIFY COLUMN `maintenance_cycle_time` int NULL DEFAULT NULL COMMENT '车辆保养周期 保养周期X' AFTER `maintenance_cycle`; ALTER TABLE `xp_task_rule` MODIFY COLUMN `maintenance_cycle_time_type` int NULL DEFAULT 1 COMMENT '车辆保养周期 保养周期X 1=天 2=月' AFTER `maintenance_cycle_time`; ALTER TABLE `xp_task_rule` MODIFY COLUMN `maintenance_cycle_task_time` time NULL DEFAULT NULL COMMENT '车辆保养周期 任务下放时间' AFTER `maintenance_cycle_time_type`; ALTER TABLE `xp_task_rule` MODIFY COLUMN `maintenance_cycle_level` int NULL DEFAULT NULL COMMENT '车辆保养周期 紧急程度 0=P0 1=P1 2=P2 3=P3' AFTER `maintenance_cycle_task_time`; ALTER TABLE `xp_task_rule` MODIFY COLUMN `charging_strategy` tinyint NULL DEFAULT NULL COMMENT '充电策略是否启用 0否1是' AFTER `maintenance_cycle_level`; ALTER TABLE `xp_task_rule` MODIFY COLUMN `charging_strategy_batteryl` decimal(10, 2) NULL DEFAULT NULL COMMENT '充电策略 电量低于XX 不可接新单并发起充电任务' AFTER `charging_strategy`; ALTER TABLE `xp_task_rule` MODIFY COLUMN `charging_strategy_level` int NULL DEFAULT NULL COMMENT '充电策略 紧急程度 0=P0 1=P1 2=P2 3=P3' AFTER `charging_strategy_batteryl`; ALTER TABLE `xp_task_rule` MODIFY COLUMN `vehicle_clean_time` time NULL DEFAULT NULL COMMENT '车身清洁保养任务下放时间' AFTER `charging_strategy_level`; ALTER TABLE `xp_task_rule` MODIFY COLUMN `vehicle_clean_cycle` int NULL DEFAULT NULL COMMENT '车身清洁保养周期X' AFTER `vehicle_clean_time`; ALTER TABLE `xp_task_rule` MODIFY COLUMN `vehicle_clean_time_type` int NULL DEFAULT NULL COMMENT '车身清洁保养周期X 1=天 2=月' AFTER `vehicle_clean_cycle`; ALTER TABLE `xp_task_rule` MODIFY COLUMN `vehicle_clean_level` int NULL DEFAULT NULL COMMENT '车身清洁任务紧急程度0=P0 1=P1 2=P2 3=P3' AFTER `vehicle_clean_time_type`; ALTER TABLE `xp_task_rule` MODIFY COLUMN `routine_maintenance_cycle` int NULL DEFAULT NULL COMMENT '日常整备保养周期X' AFTER `vehicle_clean_level`; ALTER TABLE `xp_task_rule` MODIFY COLUMN `routine_maintenance_time` time NULL DEFAULT NULL COMMENT '日常整备保养任务下放时间' AFTER `routine_maintenance_cycle`; ALTER TABLE `xp_task_rule` MODIFY COLUMN `routine_maintenance_time_type` int NULL DEFAULT NULL COMMENT '日常整备保养周期X 1=天 2=月' AFTER `routine_maintenance_time`; ALTER TABLE `xp_task_rule` MODIFY COLUMN `routine_maintenance_level` int NULL DEFAULT NULL COMMENT '日常整备 紧急程度0=P0 1=P1 2=P2 3=P3' AFTER `routine_maintenance_time_type`; ALTER TABLE `xp_task_rule` MODIFY COLUMN `insurance` tinyint(1) NULL DEFAULT NULL COMMENT '年检/保险策略 是否启用 0否1是' AFTER `routine_maintenance_level`; ALTER TABLE `xp_task_rule` MODIFY COLUMN `insurance_expires` int NULL DEFAULT NULL COMMENT '年检/保险策略 保险到期X天 下发任务' AFTER `insurance`; ALTER TABLE `xp_task_rule` MODIFY COLUMN `insurance_inspection_expires` int NULL DEFAULT NULL COMMENT '年检/保险策略 年检到期X天 下发任务' AFTER `insurance_expires`; ALTER TABLE `xp_task_rule` MODIFY COLUMN `operation_qualification_expires` int NULL DEFAULT NULL COMMENT '网约车运营资质到期X天 下发任务' AFTER `insurance_inspection_expires`; ALTER TABLE `xp_task_rule` MODIFY COLUMN `insurance_level` int NULL DEFAULT NULL COMMENT '年检/保险策略 紧急程度 0=P0 1=P1 2=P2 3=P3' AFTER `operation_qualification_expires`; ALTER TABLE `xp_task_rule` MODIFY COLUMN `processing_time_limit` int NULL DEFAULT NULL COMMENT '任务处理时限(分钟)' AFTER `insurance_level`; sql/增量sql/xprt_operation.sql
@@ -1,119 +1,401 @@ ALTER TABLE `xp_point_0` ADD COLUMN `province_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '省份名称' AFTER `parking_point`; CREATE TABLE `xp_test_point_0` ( `id` bigint NOT NULL, `electronic_area_id` bigint NULL DEFAULT NULL COMMENT '电子围栏区域id', `fp_electronic_area_id` bigint NULL DEFAULT NULL COMMENT '分片建', `point_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '点位名称', `point_poi` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '点位poi', `point_number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '点位编号唯一', `operation_status` int NULL DEFAULT 1 COMMENT '运营状态 1=待启用 2=启用中 3=已停用 4=已失效', `point_type` int NULL DEFAULT 1 COMMENT '点位类型 1=运营点位 2=测试点位', `verification_status` int NULL DEFAULT 1 COMMENT '验证状态 1=待验证、2=验证中、3=已验证 4验证失败', `parking_time_limit` int NULL DEFAULT NULL COMMENT '限停时长', `operation_type` int NULL DEFAULT 1 COMMENT '运营类型 1=与运营区同步 2=自定义时间段', `effective_period` int NULL DEFAULT NULL COMMENT '生效周期 1=“每日生效”、2=“仅工作日生效”、3=“仅非工作日生效”、4=“仅节假日生效”', `effective_time_period` json NULL COMMENT '生效时间段', `point_address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '详情地址', `remarks` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', `point_pictures` json NULL COMMENT '点位照片', `point_lon` double(20, 10) NOT NULL COMMENT '经度', `point_lat` double(20, 10) NOT NULL COMMENT '纬度', `is_deleted` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否删除 0=未删除 1=已删除', `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间', `create_by` varchar(127) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '创建人', `update_by` varchar(127) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '修改人', `charge_point` int NULL DEFAULT 0 COMMENT '0否 1是充电点位', `parking_point` int NULL DEFAULT NULL COMMENT '0否 1是 收车点位', `province_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '省份名称', `province_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '省份code', `city_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '城市名称', `city_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '城市code', `district_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '区县名称', `district_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '区县code', PRIMARY KEY (`id`) USING BTREE, INDEX `idx_type`(`point_type` ASC) USING BTREE COMMENT '类型', INDEX `idx_status`(`operation_status` ASC) USING BTREE COMMENT '状态', INDEX `idx_name`(`point_name` ASC) USING BTREE COMMENT '名称', INDEX `idx_poi`(`point_poi` ASC) USING BTREE COMMENT 'poi', INDEX `idx_number`(`point_number` ASC) USING BTREE COMMENT '唯一ID' ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '点位管理' ROW_FORMAT = Dynamic; ALTER TABLE `xp_point_0` ADD COLUMN `province_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '省份code' AFTER `province_name`; CREATE TABLE `xp_test_point_1` ( `id` bigint NOT NULL, `electronic_area_id` bigint NULL DEFAULT NULL COMMENT '电子围栏区域id', `fp_electronic_area_id` bigint NULL DEFAULT NULL COMMENT '分片建', `point_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '点位名称', `point_poi` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '点位poi', `point_number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '点位编号唯一', `operation_status` int NULL DEFAULT 1 COMMENT '运营状态 1=待启用 2=启用中 3=已停用 4=已失效', `point_type` int NULL DEFAULT 1 COMMENT '点位类型 1=运营点位 2=测试点位', `verification_status` int NULL DEFAULT 1 COMMENT '验证状态 1=待验证、2=验证中、3=已验证 4验证失败', `parking_time_limit` int NULL DEFAULT NULL COMMENT '限停时长', `operation_type` int NULL DEFAULT 1 COMMENT '运营类型 1=与运营区同步 2=自定义时间段', `effective_period` int NULL DEFAULT NULL COMMENT '生效周期 1=“每日生效”、2=“仅工作日生效”、3=“仅非工作日生效”、4=“仅节假日生效”', `effective_time_period` json NULL COMMENT '生效时间段', `point_address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '详情地址', `remarks` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', `point_pictures` json NULL COMMENT '点位照片', `point_lon` double(20, 10) NOT NULL COMMENT '经度', `point_lat` double(20, 10) NOT NULL COMMENT '纬度', `is_deleted` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否删除 0=未删除 1=已删除', `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间', `create_by` varchar(127) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '创建人', `update_by` varchar(127) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '修改人', `charge_point` int NULL DEFAULT 0 COMMENT '0否 1是充电点位', `parking_point` int NULL DEFAULT NULL COMMENT '0否 1是 收车点位', `province_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '省份名称', `province_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '省份code', `city_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '城市名称', `city_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '城市code', `district_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '区县名称', `district_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '区县code', PRIMARY KEY (`id`) USING BTREE, INDEX `idx_type`(`point_type` ASC) USING BTREE COMMENT '类型', INDEX `idx_status`(`operation_status` ASC) USING BTREE COMMENT '状态', INDEX `idx_name`(`point_name` ASC) USING BTREE COMMENT '名称', INDEX `idx_poi`(`point_poi` ASC) USING BTREE COMMENT 'poi', INDEX `idx_number`(`point_number` ASC) USING BTREE COMMENT '唯一ID' ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '点位管理' ROW_FORMAT = Dynamic; ALTER TABLE `xp_point_0` ADD COLUMN `city_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '城市名称' AFTER `province_code`; CREATE TABLE `xp_test_point_2` ( `id` bigint NOT NULL, `electronic_area_id` bigint NULL DEFAULT NULL COMMENT '电子围栏区域id', `fp_electronic_area_id` bigint NULL DEFAULT NULL COMMENT '分片建', `point_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '点位名称', `point_poi` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '点位poi', `point_number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '点位编号唯一', `operation_status` int NULL DEFAULT 1 COMMENT '运营状态 1=待启用 2=启用中 3=已停用 4=已失效', `point_type` int NULL DEFAULT 1 COMMENT '点位类型 1=运营点位 2=测试点位', `verification_status` int NULL DEFAULT 1 COMMENT '验证状态 1=待验证、2=验证中、3=已验证 4验证失败', `parking_time_limit` int NULL DEFAULT NULL COMMENT '限停时长', `operation_type` int NULL DEFAULT 1 COMMENT '运营类型 1=与运营区同步 2=自定义时间段', `effective_period` int NULL DEFAULT NULL COMMENT '生效周期 1=“每日生效”、2=“仅工作日生效”、3=“仅非工作日生效”、4=“仅节假日生效”', `effective_time_period` json NULL COMMENT '生效时间段', `point_address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '详情地址', `remarks` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', `point_pictures` json NULL COMMENT '点位照片', `point_lon` double(20, 10) NOT NULL COMMENT '经度', `point_lat` double(20, 10) NOT NULL COMMENT '纬度', `is_deleted` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否删除 0=未删除 1=已删除', `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间', `create_by` varchar(127) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '创建人', `update_by` varchar(127) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '修改人', `charge_point` int NULL DEFAULT 0 COMMENT '0否 1是充电点位', `parking_point` int NULL DEFAULT NULL COMMENT '0否 1是 收车点位', `province_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '省份名称', `province_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '省份code', `city_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '城市名称', `city_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '城市code', `district_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '区县名称', `district_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '区县code', PRIMARY KEY (`id`) USING BTREE, INDEX `idx_type`(`point_type` ASC) USING BTREE COMMENT '类型', INDEX `idx_status`(`operation_status` ASC) USING BTREE COMMENT '状态', INDEX `idx_name`(`point_name` ASC) USING BTREE COMMENT '名称', INDEX `idx_poi`(`point_poi` ASC) USING BTREE COMMENT 'poi', INDEX `idx_number`(`point_number` ASC) USING BTREE COMMENT '唯一ID' ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '点位管理' ROW_FORMAT = Dynamic; ALTER TABLE `xp_point_0` ADD COLUMN `city_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '城市code' AFTER `city_name`; CREATE TABLE `xp_test_point_3` ( `id` bigint NOT NULL, `electronic_area_id` bigint NULL DEFAULT NULL COMMENT '电子围栏区域id', `fp_electronic_area_id` bigint NULL DEFAULT NULL COMMENT '分片建', `point_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '点位名称', `point_poi` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '点位poi', `point_number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '点位编号唯一', `operation_status` int NULL DEFAULT 1 COMMENT '运营状态 1=待启用 2=启用中 3=已停用 4=已失效', `point_type` int NULL DEFAULT 1 COMMENT '点位类型 1=运营点位 2=测试点位', `verification_status` int NULL DEFAULT 1 COMMENT '验证状态 1=待验证、2=验证中、3=已验证 4验证失败', `parking_time_limit` int NULL DEFAULT NULL COMMENT '限停时长', `operation_type` int NULL DEFAULT 1 COMMENT '运营类型 1=与运营区同步 2=自定义时间段', `effective_period` int NULL DEFAULT NULL COMMENT '生效周期 1=“每日生效”、2=“仅工作日生效”、3=“仅非工作日生效”、4=“仅节假日生效”', `effective_time_period` json NULL COMMENT '生效时间段', `point_address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '详情地址', `remarks` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', `point_pictures` json NULL COMMENT '点位照片', `point_lon` double(20, 10) NOT NULL COMMENT '经度', `point_lat` double(20, 10) NOT NULL COMMENT '纬度', `is_deleted` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否删除 0=未删除 1=已删除', `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间', `create_by` varchar(127) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '创建人', `update_by` varchar(127) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '修改人', `charge_point` int NULL DEFAULT 0 COMMENT '0否 1是充电点位', `parking_point` int NULL DEFAULT NULL COMMENT '0否 1是 收车点位', `province_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '省份名称', `province_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '省份code', `city_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '城市名称', `city_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '城市code', `district_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '区县名称', `district_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '区县code', PRIMARY KEY (`id`) USING BTREE, INDEX `idx_type`(`point_type` ASC) USING BTREE COMMENT '类型', INDEX `idx_status`(`operation_status` ASC) USING BTREE COMMENT '状态', INDEX `idx_name`(`point_name` ASC) USING BTREE COMMENT '名称', INDEX `idx_poi`(`point_poi` ASC) USING BTREE COMMENT 'poi', INDEX `idx_number`(`point_number` ASC) USING BTREE COMMENT '唯一ID' ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '点位管理' ROW_FORMAT = Dynamic; ALTER TABLE `xp_point_0` ADD COLUMN `district_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '区县名称' AFTER `city_code`; CREATE TABLE `xp_test_point_4` ( `id` bigint NOT NULL, `electronic_area_id` bigint NULL DEFAULT NULL COMMENT '电子围栏区域id', `fp_electronic_area_id` bigint NULL DEFAULT NULL COMMENT '分片建', `point_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '点位名称', `point_poi` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '点位poi', `point_number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '点位编号唯一', `operation_status` int NULL DEFAULT 1 COMMENT '运营状态 1=待启用 2=启用中 3=已停用 4=已失效', `point_type` int NULL DEFAULT 1 COMMENT '点位类型 1=运营点位 2=测试点位', `verification_status` int NULL DEFAULT 1 COMMENT '验证状态 1=待验证、2=验证中、3=已验证 4验证失败', `parking_time_limit` int NULL DEFAULT NULL COMMENT '限停时长', `operation_type` int NULL DEFAULT 1 COMMENT '运营类型 1=与运营区同步 2=自定义时间段', `effective_period` int NULL DEFAULT NULL COMMENT '生效周期 1=“每日生效”、2=“仅工作日生效”、3=“仅非工作日生效”、4=“仅节假日生效”', `effective_time_period` json NULL COMMENT '生效时间段', `point_address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '详情地址', `remarks` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', `point_pictures` json NULL COMMENT '点位照片', `point_lon` double(20, 10) NOT NULL COMMENT '经度', `point_lat` double(20, 10) NOT NULL COMMENT '纬度', `is_deleted` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否删除 0=未删除 1=已删除', `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间', `create_by` varchar(127) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '创建人', `update_by` varchar(127) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '修改人', `charge_point` int NULL DEFAULT 0 COMMENT '0否 1是充电点位', `parking_point` int NULL DEFAULT NULL COMMENT '0否 1是 收车点位', `province_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '省份名称', `province_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '省份code', `city_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '城市名称', `city_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '城市code', `district_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '区县名称', `district_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '区县code', PRIMARY KEY (`id`) USING BTREE, INDEX `idx_type`(`point_type` ASC) USING BTREE COMMENT '类型', INDEX `idx_status`(`operation_status` ASC) USING BTREE COMMENT '状态', INDEX `idx_name`(`point_name` ASC) USING BTREE COMMENT '名称', INDEX `idx_poi`(`point_poi` ASC) USING BTREE COMMENT 'poi', INDEX `idx_number`(`point_number` ASC) USING BTREE COMMENT '唯一ID' ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '点位管理' ROW_FORMAT = Dynamic; ALTER TABLE `xp_point_0` ADD COLUMN `district_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '区县code' AFTER `district_name`; CREATE TABLE `xp_test_point_5` ( `id` bigint NOT NULL, `electronic_area_id` bigint NULL DEFAULT NULL COMMENT '电子围栏区域id', `fp_electronic_area_id` bigint NULL DEFAULT NULL COMMENT '分片建', `point_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '点位名称', `point_poi` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '点位poi', `point_number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '点位编号唯一', `operation_status` int NULL DEFAULT 1 COMMENT '运营状态 1=待启用 2=启用中 3=已停用 4=已失效', `point_type` int NULL DEFAULT 1 COMMENT '点位类型 1=运营点位 2=测试点位', `verification_status` int NULL DEFAULT 1 COMMENT '验证状态 1=待验证、2=验证中、3=已验证 4验证失败', `parking_time_limit` int NULL DEFAULT NULL COMMENT '限停时长', `operation_type` int NULL DEFAULT 1 COMMENT '运营类型 1=与运营区同步 2=自定义时间段', `effective_period` int NULL DEFAULT NULL COMMENT '生效周期 1=“每日生效”、2=“仅工作日生效”、3=“仅非工作日生效”、4=“仅节假日生效”', `effective_time_period` json NULL COMMENT '生效时间段', `point_address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '详情地址', `remarks` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', `point_pictures` json NULL COMMENT '点位照片', `point_lon` double(20, 10) NOT NULL COMMENT '经度', `point_lat` double(20, 10) NOT NULL COMMENT '纬度', `is_deleted` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否删除 0=未删除 1=已删除', `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间', `create_by` varchar(127) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '创建人', `update_by` varchar(127) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '修改人', `charge_point` int NULL DEFAULT 0 COMMENT '0否 1是充电点位', `parking_point` int NULL DEFAULT NULL COMMENT '0否 1是 收车点位', `province_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '省份名称', `province_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '省份code', `city_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '城市名称', `city_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '城市code', `district_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '区县名称', `district_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '区县code', PRIMARY KEY (`id`) USING BTREE, INDEX `idx_type`(`point_type` ASC) USING BTREE COMMENT '类型', INDEX `idx_status`(`operation_status` ASC) USING BTREE COMMENT '状态', INDEX `idx_name`(`point_name` ASC) USING BTREE COMMENT '名称', INDEX `idx_poi`(`point_poi` ASC) USING BTREE COMMENT 'poi', INDEX `idx_number`(`point_number` ASC) USING BTREE COMMENT '唯一ID' ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '点位管理' ROW_FORMAT = Dynamic; ALTER TABLE `xp_point_1` ADD COLUMN `province_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '省份名称' AFTER `parking_point`; CREATE TABLE `xp_test_point_6` ( `id` bigint NOT NULL, `electronic_area_id` bigint NULL DEFAULT NULL COMMENT '电子围栏区域id', `fp_electronic_area_id` bigint NULL DEFAULT NULL COMMENT '分片建', `point_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '点位名称', `point_poi` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '点位poi', `point_number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '点位编号唯一', `operation_status` int NULL DEFAULT 1 COMMENT '运营状态 1=待启用 2=启用中 3=已停用 4=已失效', `point_type` int NULL DEFAULT 1 COMMENT '点位类型 1=运营点位 2=测试点位', `verification_status` int NULL DEFAULT 1 COMMENT '验证状态 1=待验证、2=验证中、3=已验证 4验证失败', `parking_time_limit` int NULL DEFAULT NULL COMMENT '限停时长', `operation_type` int NULL DEFAULT 1 COMMENT '运营类型 1=与运营区同步 2=自定义时间段', `effective_period` int NULL DEFAULT NULL COMMENT '生效周期 1=“每日生效”、2=“仅工作日生效”、3=“仅非工作日生效”、4=“仅节假日生效”', `effective_time_period` json NULL COMMENT '生效时间段', `point_address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '详情地址', `remarks` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', `point_pictures` json NULL COMMENT '点位照片', `point_lon` double(20, 10) NOT NULL COMMENT '经度', `point_lat` double(20, 10) NOT NULL COMMENT '纬度', `is_deleted` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否删除 0=未删除 1=已删除', `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间', `create_by` varchar(127) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '创建人', `update_by` varchar(127) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '修改人', `charge_point` int NULL DEFAULT 0 COMMENT '0否 1是充电点位', `parking_point` int NULL DEFAULT NULL COMMENT '0否 1是 收车点位', `province_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '省份名称', `province_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '省份code', `city_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '城市名称', `city_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '城市code', `district_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '区县名称', `district_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '区县code', PRIMARY KEY (`id`) USING BTREE, INDEX `idx_type`(`point_type` ASC) USING BTREE COMMENT '类型', INDEX `idx_status`(`operation_status` ASC) USING BTREE COMMENT '状态', INDEX `idx_name`(`point_name` ASC) USING BTREE COMMENT '名称', INDEX `idx_poi`(`point_poi` ASC) USING BTREE COMMENT 'poi', INDEX `idx_number`(`point_number` ASC) USING BTREE COMMENT '唯一ID' ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '点位管理' ROW_FORMAT = Dynamic; ALTER TABLE `xp_point_1` ADD COLUMN `province_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '省份code' AFTER `province_name`; CREATE TABLE `xp_test_point_7` ( `id` bigint NOT NULL, `electronic_area_id` bigint NULL DEFAULT NULL COMMENT '电子围栏区域id', `fp_electronic_area_id` bigint NULL DEFAULT NULL COMMENT '分片建', `point_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '点位名称', `point_poi` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '点位poi', `point_number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '点位编号唯一', `operation_status` int NULL DEFAULT 1 COMMENT '运营状态 1=待启用 2=启用中 3=已停用 4=已失效', `point_type` int NULL DEFAULT 1 COMMENT '点位类型 1=运营点位 2=测试点位', `verification_status` int NULL DEFAULT 1 COMMENT '验证状态 1=待验证、2=验证中、3=已验证 4验证失败', `parking_time_limit` int NULL DEFAULT NULL COMMENT '限停时长', `operation_type` int NULL DEFAULT 1 COMMENT '运营类型 1=与运营区同步 2=自定义时间段', `effective_period` int NULL DEFAULT NULL COMMENT '生效周期 1=“每日生效”、2=“仅工作日生效”、3=“仅非工作日生效”、4=“仅节假日生效”', `effective_time_period` json NULL COMMENT '生效时间段', `point_address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '详情地址', `remarks` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', `point_pictures` json NULL COMMENT '点位照片', `point_lon` double(20, 10) NOT NULL COMMENT '经度', `point_lat` double(20, 10) NOT NULL COMMENT '纬度', `is_deleted` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否删除 0=未删除 1=已删除', `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间', `create_by` varchar(127) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '创建人', `update_by` varchar(127) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '修改人', `charge_point` int NULL DEFAULT 0 COMMENT '0否 1是充电点位', `parking_point` int NULL DEFAULT NULL COMMENT '0否 1是 收车点位', `province_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '省份名称', `province_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '省份code', `city_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '城市名称', `city_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '城市code', `district_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '区县名称', `district_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '区县code', PRIMARY KEY (`id`) USING BTREE, INDEX `idx_type`(`point_type` ASC) USING BTREE COMMENT '类型', INDEX `idx_status`(`operation_status` ASC) USING BTREE COMMENT '状态', INDEX `idx_name`(`point_name` ASC) USING BTREE COMMENT '名称', INDEX `idx_poi`(`point_poi` ASC) USING BTREE COMMENT 'poi', INDEX `idx_number`(`point_number` ASC) USING BTREE COMMENT '唯一ID' ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '点位管理' ROW_FORMAT = Dynamic; ALTER TABLE `xp_point_1` ADD COLUMN `city_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '城市名称' AFTER `province_code`; CREATE TABLE `xp_test_point_8` ( `id` bigint NOT NULL, `electronic_area_id` bigint NULL DEFAULT NULL COMMENT '电子围栏区域id', `fp_electronic_area_id` bigint NULL DEFAULT NULL COMMENT '分片建', `point_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '点位名称', `point_poi` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '点位poi', `point_number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '点位编号唯一', `operation_status` int NULL DEFAULT 1 COMMENT '运营状态 1=待启用 2=启用中 3=已停用 4=已失效', `point_type` int NULL DEFAULT 1 COMMENT '点位类型 1=运营点位 2=测试点位', `verification_status` int NULL DEFAULT 1 COMMENT '验证状态 1=待验证、2=验证中、3=已验证 4验证失败', `parking_time_limit` int NULL DEFAULT NULL COMMENT '限停时长', `operation_type` int NULL DEFAULT 1 COMMENT '运营类型 1=与运营区同步 2=自定义时间段', `effective_period` int NULL DEFAULT NULL COMMENT '生效周期 1=“每日生效”、2=“仅工作日生效”、3=“仅非工作日生效”、4=“仅节假日生效”', `effective_time_period` json NULL COMMENT '生效时间段', `point_address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '详情地址', `remarks` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', `point_pictures` json NULL COMMENT '点位照片', `point_lon` double(20, 10) NOT NULL COMMENT '经度', `point_lat` double(20, 10) NOT NULL COMMENT '纬度', `is_deleted` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否删除 0=未删除 1=已删除', `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间', `create_by` varchar(127) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '创建人', `update_by` varchar(127) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '修改人', `charge_point` int NULL DEFAULT 0 COMMENT '0否 1是充电点位', `parking_point` int NULL DEFAULT NULL COMMENT '0否 1是 收车点位', `province_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '省份名称', `province_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '省份code', `city_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '城市名称', `city_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '城市code', `district_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '区县名称', `district_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '区县code', PRIMARY KEY (`id`) USING BTREE, INDEX `idx_type`(`point_type` ASC) USING BTREE COMMENT '类型', INDEX `idx_status`(`operation_status` ASC) USING BTREE COMMENT '状态', INDEX `idx_name`(`point_name` ASC) USING BTREE COMMENT '名称', INDEX `idx_poi`(`point_poi` ASC) USING BTREE COMMENT 'poi', INDEX `idx_number`(`point_number` ASC) USING BTREE COMMENT '唯一ID' ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '点位管理' ROW_FORMAT = Dynamic; ALTER TABLE `xp_point_1` ADD COLUMN `city_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '城市code' AFTER `city_name`; CREATE TABLE `xp_test_point_9` ( `id` bigint NOT NULL, `electronic_area_id` bigint NULL DEFAULT NULL COMMENT '电子围栏区域id', `fp_electronic_area_id` bigint NULL DEFAULT NULL COMMENT '分片建', `point_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '点位名称', `point_poi` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '点位poi', `point_number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '点位编号唯一', `operation_status` int NULL DEFAULT 1 COMMENT '运营状态 1=待启用 2=启用中 3=已停用 4=已失效', `point_type` int NULL DEFAULT 1 COMMENT '点位类型 1=运营点位 2=测试点位', `verification_status` int NULL DEFAULT 1 COMMENT '验证状态 1=待验证、2=验证中、3=已验证 4验证失败', `parking_time_limit` int NULL DEFAULT NULL COMMENT '限停时长', `operation_type` int NULL DEFAULT 1 COMMENT '运营类型 1=与运营区同步 2=自定义时间段', `effective_period` int NULL DEFAULT NULL COMMENT '生效周期 1=“每日生效”、2=“仅工作日生效”、3=“仅非工作日生效”、4=“仅节假日生效”', `effective_time_period` json NULL COMMENT '生效时间段', `point_address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '详情地址', `remarks` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', `point_pictures` json NULL COMMENT '点位照片', `point_lon` double(20, 10) NOT NULL COMMENT '经度', `point_lat` double(20, 10) NOT NULL COMMENT '纬度', `is_deleted` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否删除 0=未删除 1=已删除', `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间', `create_by` varchar(127) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '创建人', `update_by` varchar(127) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '修改人', `charge_point` int NULL DEFAULT 0 COMMENT '0否 1是充电点位', `parking_point` int NULL DEFAULT NULL COMMENT '0否 1是 收车点位', `province_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '省份名称', `province_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '省份code', `city_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '城市名称', `city_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '城市code', `district_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '区县名称', `district_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '区县code', PRIMARY KEY (`id`) USING BTREE, INDEX `idx_type`(`point_type` ASC) USING BTREE COMMENT '类型', INDEX `idx_status`(`operation_status` ASC) USING BTREE COMMENT '状态', INDEX `idx_name`(`point_name` ASC) USING BTREE COMMENT '名称', INDEX `idx_poi`(`point_poi` ASC) USING BTREE COMMENT 'poi', INDEX `idx_number`(`point_number` ASC) USING BTREE COMMENT '唯一ID' ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '点位管理' ROW_FORMAT = Dynamic; ALTER TABLE `xp_point_1` ADD COLUMN `district_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '区县名称' AFTER `city_code`; ALTER TABLE `xp_point_1` ADD COLUMN `district_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '区县code' AFTER `district_name`; ALTER TABLE `xp_point_2` ADD COLUMN `province_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '省份名称' AFTER `parking_point`; ALTER TABLE `xp_point_2` ADD COLUMN `province_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '省份code' AFTER `province_name`; ALTER TABLE `xp_point_2` ADD COLUMN `city_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '城市名称' AFTER `province_code`; ALTER TABLE `xp_point_2` ADD COLUMN `city_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '城市code' AFTER `city_name`; ALTER TABLE `xp_point_2` ADD COLUMN `district_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '区县名称' AFTER `city_code`; ALTER TABLE `xp_point_2` ADD COLUMN `district_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '区县code' AFTER `district_name`; ALTER TABLE `xp_point_3` ADD COLUMN `province_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '省份名称' AFTER `parking_point`; ALTER TABLE `xp_point_3` ADD COLUMN `province_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '省份code' AFTER `province_name`; ALTER TABLE `xp_point_3` ADD COLUMN `city_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '城市名称' AFTER `province_code`; ALTER TABLE `xp_point_3` ADD COLUMN `city_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '城市code' AFTER `city_name`; ALTER TABLE `xp_point_3` ADD COLUMN `district_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '区县名称' AFTER `city_code`; ALTER TABLE `xp_point_3` ADD COLUMN `district_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '区县code' AFTER `district_name`; ALTER TABLE `xp_point_4` ADD COLUMN `province_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '省份名称' AFTER `parking_point`; ALTER TABLE `xp_point_4` ADD COLUMN `province_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '省份code' AFTER `province_name`; ALTER TABLE `xp_point_4` ADD COLUMN `city_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '城市名称' AFTER `province_code`; ALTER TABLE `xp_point_4` ADD COLUMN `city_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '城市code' AFTER `city_name`; ALTER TABLE `xp_point_4` ADD COLUMN `district_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '区县名称' AFTER `city_code`; ALTER TABLE `xp_point_4` ADD COLUMN `district_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '区县code' AFTER `district_name`; ALTER TABLE `xp_point_5` ADD COLUMN `province_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '省份名称' AFTER `parking_point`; ALTER TABLE `xp_point_5` ADD COLUMN `province_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '省份code' AFTER `province_name`; ALTER TABLE `xp_point_5` ADD COLUMN `city_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '城市名称' AFTER `province_code`; ALTER TABLE `xp_point_5` ADD COLUMN `city_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '城市code' AFTER `city_name`; ALTER TABLE `xp_point_5` ADD COLUMN `district_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '区县名称' AFTER `city_code`; ALTER TABLE `xp_point_5` ADD COLUMN `district_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '区县code' AFTER `district_name`; ALTER TABLE `xp_point_6` ADD COLUMN `province_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '省份名称' AFTER `parking_point`; ALTER TABLE `xp_point_6` ADD COLUMN `province_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '省份code' AFTER `province_name`; ALTER TABLE `xp_point_6` ADD COLUMN `city_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '城市名称' AFTER `province_code`; ALTER TABLE `xp_point_6` ADD COLUMN `city_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '城市code' AFTER `city_name`; ALTER TABLE `xp_point_6` ADD COLUMN `district_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '区县名称' AFTER `city_code`; ALTER TABLE `xp_point_6` ADD COLUMN `district_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '区县code' AFTER `district_name`; ALTER TABLE `xp_point_7` ADD COLUMN `province_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '省份名称' AFTER `parking_point`; ALTER TABLE `xp_point_7` ADD COLUMN `province_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '省份code' AFTER `province_name`; ALTER TABLE `xp_point_7` ADD COLUMN `city_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '城市名称' AFTER `province_code`; ALTER TABLE `xp_point_7` ADD COLUMN `city_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '城市code' AFTER `city_name`; ALTER TABLE `xp_point_7` ADD COLUMN `district_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '区县名称' AFTER `city_code`; ALTER TABLE `xp_point_7` ADD COLUMN `district_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '区县code' AFTER `district_name`; ALTER TABLE `xp_point_8` ADD COLUMN `province_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '省份名称' AFTER `parking_point`; ALTER TABLE `xp_point_8` ADD COLUMN `province_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '省份code' AFTER `province_name`; ALTER TABLE `xp_point_8` ADD COLUMN `city_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '城市名称' AFTER `province_code`; ALTER TABLE `xp_point_8` ADD COLUMN `city_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '城市code' AFTER `city_name`; ALTER TABLE `xp_point_8` ADD COLUMN `district_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '区县名称' AFTER `city_code`; ALTER TABLE `xp_point_8` ADD COLUMN `district_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '区县code' AFTER `district_name`; ALTER TABLE `xp_point_9` ADD COLUMN `province_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '省份名称' AFTER `parking_point`; ALTER TABLE `xp_point_9` ADD COLUMN `province_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '省份code' AFTER `province_name`; ALTER TABLE `xp_point_9` ADD COLUMN `city_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '城市名称' AFTER `province_code`; ALTER TABLE `xp_point_9` ADD COLUMN `city_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '城市code' AFTER `city_name`; ALTER TABLE `xp_point_9` ADD COLUMN `district_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '区县名称' AFTER `city_code`; ALTER TABLE `xp_point_9` ADD COLUMN `district_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '区县code' AFTER `district_name`; SET FOREIGN_KEY_CHECKS=1; xp-robotaxi-api/src/main/java/com/xiaopeng/api/factory/vehicleConvoy/XpVehicleClientFallbackFactory.java
@@ -93,6 +93,12 @@ log.error("查询车辆所属车队id失败,原因: {}", cause.getMessage()); return R.fail("查询车辆所属车队id失败"); } }; @Override public R<Boolean> getVehicleTrunkOpenStatus(Long uid, Long id) { log.error("获取车辆后备箱开关状态失败,原因: {}", cause.getMessage()); return R.fail("获取车辆后备箱开关状态失败:" + cause.getMessage()); }}; } } xp-robotaxi-api/src/main/java/com/xiaopeng/api/feignClient/vehicleConvoy/VehicleControlClient.java
@@ -20,7 +20,7 @@ /** * 车内温度查询 * *{"code":0,"data":{"stateMap":{"hvacInnerTemp":{"timestamp":1774085106431,"value":"23"}}}} * @return */ @GetMapping("/logan/api/v1/vehicles/state") xp-robotaxi-api/src/main/java/com/xiaopeng/api/feignClient/vehicleConvoy/XpVehicleClient.java
@@ -118,4 +118,14 @@ @GetMapping("/inner/vehicle/findFleetIdByVehicleId") R<Long> findFleetIdByVehicleId(@RequestParam Long vehicleId); /** * 获取车辆后备箱开关状态 * @param uid * @param id * @return */ @PostMapping("/inner/vi/vehicle/getVehicleTrunkOpenStatus") R<Boolean> getVehicleTrunkOpenStatus(@RequestParam("uid") Long uid, @RequestParam("id") Long id); } xp-robotaxi-api/src/main/java/com/xiaopeng/api/model/maintenance/XpTask.java
@@ -94,5 +94,6 @@ @ApiModelProperty(value = "状态 0=待到达 1=待处理 2=已完成 3=已取消") private Integer status; @ApiModelProperty(value = "任务来源 1-运维APP 2-管理后台") private Integer taskSource; } xp-robotaxi-api/src/main/java/com/xiaopeng/api/model/maintenance/XpVehicleRepair.java
@@ -43,11 +43,11 @@ private Long vehicleId; @ApiModelProperty(value = "开始时间") @JsonFormat(pattern = "yyyy年MM月dd日", timezone = "GMT+8") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private LocalDate startTime; @ApiModelProperty(value = "结束时间") @JsonFormat(pattern = "yyyy年MM月dd日", timezone = "GMT+8") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private LocalDate endTime; @ApiModelProperty(value = "维修原因") xp-robotaxi-api/src/main/java/com/xiaopeng/api/model/operation/XpTestPlan.java
New file @@ -0,0 +1,47 @@ package com.xiaopeng.api.model.operation; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.xiaopeng.common.core.web.domain.BaseModel; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; /** * <p> * 测试计划 * </p> * * @author mitao * @since 2026-02-26 */ @Data @EqualsAndHashCode(callSuper = false) @Accessors(chain = true) @TableName("xp_test_plan") @ApiModel(value="XpTestPlan对象", description="测试计划") public class XpTestPlan extends BaseModel { private static final long serialVersionUID = 1L; @ApiModelProperty(value = "自增id") @TableId(value = "id", type = IdType.AUTO) private Long id; @ApiModelProperty(value = "计划名称") private String planName; @ApiModelProperty(value = "关联点位数") @TableField(exist = false) private Integer pointNum; @ApiModelProperty(value = "关联车辆数") @TableField(exist = false) private Integer vehicleNum; } xp-robotaxi-api/src/main/java/com/xiaopeng/api/model/operation/XpTestPoint.java
New file @@ -0,0 +1,120 @@ package com.xiaopeng.api.model.operation; import com.baomidou.mybatisplus.annotation.*; import com.xiaopeng.common.core.web.domain.BaseModel; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; import java.math.BigDecimal; /** * <p> * 测试demo-点位管理 * </p> * * @author mitao * @since 2026-02-03 */ @Data @EqualsAndHashCode(callSuper = false) @Accessors(chain = true) @TableName("xp_test_point") @ApiModel(value="XpTestPoint对象", description="点位管理") public class XpTestPoint extends BaseModel { private static final long serialVersionUID = 1L; @TableId(value = "id", type = IdType.NONE) private Long id; @ApiModelProperty(value = "电子围栏区域id") private Long electronicAreaId; @TableField(value = "fp_electronic_area_id", updateStrategy = FieldStrategy.NEVER) private Long fpElectronicAreaId; @ApiModelProperty(value = "点位名称") private String pointName; @ApiModelProperty(value = "点位poi") private String pointPoi; @ApiModelProperty(value = "点位编号唯一") private String pointNumber; @ApiModelProperty(value = "运营状态 1=待启用 2=启用中 3=已停用 4=已失效") private Integer operationStatus; @ApiModelProperty(value = "点位类型 1=运营点位 2=测试点位") private Integer pointType; @ApiModelProperty(value = "验证状态 1=待验证、2=验证中、3=已验证 4验证失败 5待生效") private Integer verificationStatus; @ApiModelProperty(value = "限停时长") private Integer parkingTimeLimit; @ApiModelProperty(value = "运营类型 1=与运营区同步 2=自定义时间段") private Integer operationType; @ApiModelProperty(value = "生效周期 1=“每日生效”、2=“仅工作日生效”、3=“仅非工作日生效”、4=“仅节假日生效”") private Integer effectivePeriod; @ApiModelProperty(value = "生效时间段") private String effectiveTimePeriod; @ApiModelProperty(value = "点位地址") @TableField("point_address") private String pointAddress; @ApiModelProperty(value = "备注") private String remarks; @ApiModelProperty(value = "点位照片") private String pointPictures; @ApiModelProperty(value = "经度") private Double pointLon; @ApiModelProperty(value = "纬度") private Double pointLat; @ApiModelProperty(value = "距离 单位米") @TableField(exist = false) private BigDecimal distance; @ApiModelProperty(value = "0否 1是充电点位") @TableField("charge_point") private Integer chargePoint; @ApiModelProperty(value = "0否 1是收车点位") @TableField("parking_point") private Integer parkingPoint; @ApiModelProperty(value = "省份名称") @TableField("province_name") private String provinceName; @ApiModelProperty(value = "省份code") @TableField("province_code") private String provinceCode; @ApiModelProperty(value = "城市名称") @TableField("city_name") private String cityName; @ApiModelProperty(value = "城市code") @TableField("city_code") private String cityCode; @ApiModelProperty(value = "区县名称") @TableField("district_name") private String districtName; @ApiModelProperty(value = "区县code") @TableField("district_code") private String districtCode; } xp-robotaxi-api/src/main/java/com/xiaopeng/api/vo/vehicleConvoy/VehicleStateVo.java
@@ -14,5 +14,5 @@ /** * 状态值 */ private Object value; private String value; } xp-robotaxi-maintenance-boot/src/main/java/com/xiaopeng/maintenance/service/impl/XpSchedulingDetailServiceImpl.java
@@ -53,6 +53,7 @@ import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; /** * <p> @@ -489,8 +490,14 @@ } } //批量保存排班明细数据 if (!schedulingDetails.isEmpty()) { this.saveOrUpdateBatch(schedulingDetails); //找出需要删除的数据 Set<Long> collect = schedulingDetails.stream().filter(s -> s.getId() != null).collect(Collectors.toList()).stream().map(XpSchedulingDetail::getId).collect(Collectors.toSet()); List<XpSchedulingDetail> collect1 = list.stream().filter(s -> !collect.contains(s.getId())).collect(Collectors.toList()); collect1.forEach(s -> s.setDeleted(true)); collect1.addAll(schedulingDetails); if (!collect1.isEmpty()) { this.saveOrUpdateBatch(collect1); } //异步处理消息通知数据 pushMessage(pushMessage, notifications); xp-robotaxi-maintenance-boot/src/main/java/com/xiaopeng/maintenance/service/impl/XpTaskServiceImpl.java
@@ -6,6 +6,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.google.common.collect.Lists; import com.xiaopeng.api.dto.pushMessage.AliPushMessageDTO; import com.xiaopeng.api.feignClient.account.SysUserClient; import com.xiaopeng.api.feignClient.account.XpOperationUserClient; @@ -14,6 +15,7 @@ import com.xiaopeng.api.feignClient.vehicleConvoy.XpFleetOperationsClient; import com.xiaopeng.api.feignClient.vehicleConvoy.XpFleetVehicleClient; import com.xiaopeng.api.feignClient.vehicleConvoy.XpVehicleClient; import com.xiaopeng.api.model.account.SysUser; import com.xiaopeng.api.model.account.XpOperationsRole; import com.xiaopeng.api.model.account.XpOperationsUser; import com.xiaopeng.api.model.account.XpOperationsUserNotification; @@ -1576,6 +1578,7 @@ task.setReportTime(LocalDateTime.now()); task.setExpiredNoticeSent(0); task.setWillTimeoutNoticeSent(0); task.setTaskSource(2); saveTask.add(task); } this.saveBatch(saveTask); @@ -1989,12 +1992,22 @@ res.setReportUserPhone("111111"); res.setReportUserAvatar("[]"); }else{ XpOperationsUser data = xpOperationUserClient.queryById(task.getReportUserId()).getData(); if (data != null ) { res.setReportUserId(data.getId()); res.setReportUserName(data.getNickName()); res.setReportUserPhone(data.getPhoneNumber()); res.setReportUserAvatar(data.getAvatar()); if (Objects.nonNull(task.getTaskSource()) && task.getTaskSource().equals(2)) { List<SysUser> list = sysUserClient.listByIds(Lists.newArrayList(task.getReportUserId())).getData(); if (CollUtil.isNotEmpty(list)) { SysUser sysUser = list.get(0); res.setReportUserId(sysUser.getId()); res.setReportUserName(sysUser.getNickName()); res.setReportUserPhone(sysUser.getPhoneNumber()); } }else{ XpOperationsUser data = xpOperationUserClient.queryById(task.getReportUserId()).getData(); if (data != null ) { res.setReportUserId(data.getId()); res.setReportUserName(data.getNickName()); res.setReportUserPhone(data.getPhoneNumber()); res.setReportUserAvatar(data.getAvatar()); } } } xp-robotaxi-maintenance-boot/src/main/java/com/xiaopeng/maintenance/service/impl/XpWorkOrderServiceImpl.java
@@ -1,5 +1,7 @@ package com.xiaopeng.maintenance.service.impl; import com.alibaba.fastjson2.JSONArray; import com.alibaba.fastjson2.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.xiaopeng.api.feignClient.account.SysUserClient; @@ -9,18 +11,19 @@ import com.xiaopeng.api.model.maintenance.XpWorkOrderLog; import com.xiaopeng.api.model.operation.XpFeedbackType; import com.xiaopeng.common.core.web.page.PageInfo; import com.xiaopeng.evi.oss.service.AliOssService; import com.xiaopeng.maintenance.mapper.XpWorkOrderLogMapper; import com.xiaopeng.maintenance.mapper.XpWorkOrderMapper; import com.xiaopeng.maintenance.model.query.WorkOrderPageListQuery; import com.xiaopeng.maintenance.model.vo.TaskManagementPageListVO; import com.xiaopeng.maintenance.service.IXpWorkOrderService; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.annotation.Resource; import java.io.UnsupportedEncodingException; import java.util.*; import java.util.stream.Collectors; /** @@ -42,6 +45,9 @@ @Autowired private XpWorkOrderLogMapper workOrderLogMapper; @Resource private AliOssService aliOssService; @Override public PageInfo<XpWorkOrder> pageList(WorkOrderPageListQuery query) { @@ -70,6 +76,25 @@ if (feedbackType != null) { xpWorkOrder.setFeedbackTypeName(feedbackType.getFeedbackType()); } //图片回显 String problemImage = xpWorkOrder.getProblemImage(); if (StringUtils.isNotBlank(problemImage)) { JSONArray jsonArray = JSONArray.parseArray(problemImage); for (int i = 0; i < jsonArray.size(); i++) { JSONObject jsonObject = jsonArray.getJSONObject(i); if (Objects.isNull(jsonObject)) { continue; } String downloadUrl = jsonObject.getString("url");; try { downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); } catch (UnsupportedEncodingException e) { log.error("获取图片下载地址失败", e); } jsonObject.put("url", downloadUrl); } xpWorkOrder.setProblemImage(JSONArray.toJSONString(jsonArray)); } } pageInfo.setRecords(list); return pageInfo; @@ -78,6 +103,26 @@ @Override public XpWorkOrder workOrderDetail(Long id) { XpWorkOrder workOrder = this.getById(id); // 图片回显 String problemImage = workOrder.getProblemImage(); if (StringUtils.isNotBlank(problemImage)) { JSONArray jsonArray = JSONArray.parseArray(problemImage); for (int i = 0; i < jsonArray.size(); i++) { JSONObject jsonObject = jsonArray.getJSONObject(i); if (Objects.isNull(jsonObject)) { continue; } String downloadUrl = jsonObject.getString("url"); ; try { downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); } catch (UnsupportedEncodingException e) { log.error("获取图片下载地址失败", e); } jsonObject.put("url", downloadUrl); } workOrder.setProblemImage(JSONArray.toJSONString(jsonArray)); } List<XpWorkOrderLog> workOrderLogs = workOrderLogMapper.selectList(new LambdaQueryWrapper<XpWorkOrderLog>() .eq(XpWorkOrderLog::getWorkOrderId, id)); XpFeedbackType feedbackType = systemSettingClient.getFeedbackTypeById(workOrder.getFeedbackTypeId()).getData(); xp-robotaxi-map-boot/src/main/java/com/xiaopeng/map/controller/XpElectronicFenceManagementController.java
@@ -334,19 +334,23 @@ private void validateFenceTime(@NotNull Integer status, Integer effectType, LocalDateTime effectTime, Integer failureType, LocalDateTime failureTime) { LocalDateTime now = LocalDateTime.now(); // 定时生效时,生效时间不能早于当前时间 if (null != status && status == 2 && effectType != null && effectType != 1) { // 发布/启用时,定时生效的生效时间不能早于当前时间 if (requiresScheduleValidation(status) && effectType != null && effectType != 1) { if (effectTime == null || effectTime.isBefore(now)) { throw new ServiceException("围栏生效时间不合法,定时生效时生效时间不能早于当前时间", I18nKeyConstant.FENCE_EFFECT_TIME_INVALID); } } // 定时失效时,失效时间不能早于当前时间 if (null != status && status == 2 && failureType != null && failureType != 1) { // 发布/启用时,定时失效的失效时间不能早于当前时间 if (requiresScheduleValidation(status) && failureType != null && failureType != 1) { if (failureTime == null || failureTime.isBefore(now)) { throw new ServiceException("围栏失效时间不合法,定时失效时失效时间不能早于当前时间", I18nKeyConstant.FENCE_FAILURE_TIME_INVALID); } } } private boolean requiresScheduleValidation(Integer status) { return status != null && (status == 1 || status == 2); } } xp-robotaxi-map-boot/src/main/java/com/xiaopeng/map/service/serviceimpl/XpElectronicFenceServiceImpl.java
@@ -245,23 +245,11 @@ // 保存主表数据 XpElectronicFence xpElectronicFence = new XpElectronicFence(); BeanUtils.copyProperties(dto, xpElectronicFence); xpElectronicFence.setStatus(0); if (dto.getStatus() == 0) { xpElectronicFence.setStatus(0); } else if (dto.getStatus() == 1) { if (dto.getEffectType() == 1) { // 设置为启用中 xpElectronicFence.setStatus(2); xpElectronicFence.setEffectTime(LocalDateTime.now()); } else { if (dto.getEffectTime().isBefore(LocalDateTime.now())) { // 设置为启用中 xpElectronicFence.setStatus(2); } else { xpElectronicFence.setStatus(1); } } LocalDateTime now = LocalDateTime.now(); int targetStatus = resolveFenceStatus(dto.getStatus(), dto.getEffectType(), dto.getEffectTime(), now); xpElectronicFence.setStatus(targetStatus); if (targetStatus == 2 && dto.getEffectType() != null && dto.getEffectType() == 1) { xpElectronicFence.setEffectTime(now); } //根据经纬度获取当前城市code @@ -291,55 +279,9 @@ // 获取拼音首字母并大写 String result = getPinyinInitials(prefix).toUpperCase(); xpElectronicFence.setElectronicNumber(result + "-OP-" + String.format("%04d", xpElectronicFence.getId())); if (dto.getStatus() == 0) { xpElectronicFence.setStatus(0); } else if (dto.getStatus() == 1) { if (dto.getEffectType() == 1) { // 设置为启用中 xpElectronicFence.setStatus(2); xpElectronicFence.setEffectTime(LocalDateTime.now()); } else { if (dto.getEffectTime().isBefore(LocalDateTime.now())) { // 设置为启用中 xpElectronicFence.setStatus(2); } else { // 添加定时任务job type=1电子围栏生效 type=2电子围栏失效 Map<String, ? extends Object> maps = new ImmutableMap.Builder<String, Long>(). put("type", 1L) .put("id", xpElectronicFence.getId()) .build(); QuartzManager.addJob( ElectronicEffectJob.class, (ElectronicEffectJob.effect + xpElectronicFence.getId()).toUpperCase(), TimeJobType.ELECTRONIC_EFFECT, DateUtils.localDateTimeToDate(dto.getEffectTime()), maps ); xpElectronicFence.setStatus(1); } } if (dto.getFailureType() != null && dto.getFailureType() == 2) { if (dto.getFailureTime().isBefore(LocalDateTime.now())) { // 设置待启用 xpElectronicFence.setStatus(1); } else { // 添加定时任务job type=1电子围栏生效 type=2电子围栏失效 Map<String, ? extends Object> maps = new ImmutableMap.Builder<String, Long>(). put("type", 2L) .put("id", xpElectronicFence.getId()) .build(); QuartzManager.addJob( ElectronicEffectJob.class, (ElectronicEffectJob.failure + xpElectronicFence.getId()).toUpperCase(), TimeJobType.ELECTRONIC_FAILURE, DateUtils.localDateTimeToDate(dto.getFailureTime()), maps ); } } if (dto.getStatus() == 1) { registerEffectJobIfNeeded(xpElectronicFence.getId(), targetStatus, dto.getEffectType(), dto.getEffectTime(), now); registerFailureJobIfNeeded(xpElectronicFence.getId(), dto.getFailureType(), dto.getFailureTime(), now); } this.updateById(xpElectronicFence); if (xpElectronicFence.getStatus() == 2) { @@ -444,56 +386,17 @@ // 更新主表数据 XpElectronicFence xpElectronicFence = new XpElectronicFence(); BeanUtils.copyProperties(dto, xpElectronicFence); if (dto.getStatus() == 0) { xpElectronicFence.setStatus(0); } else if (dto.getStatus() == 1) { if (dto.getEffectType() == 1) { // 立即生效:设置为启用中 xpElectronicFence.setStatus(2); xpElectronicFence.setEffectTime(LocalDateTime.now()); } else { if (dto.getEffectTime().isBefore(LocalDateTime.now())) { // 定时生效时间已过:直接设置为启用中 xpElectronicFence.setStatus(2); } else { // 定时生效:注册生效定时任务 QuartzManager.removeJob((ElectronicEffectJob.effect + xpElectronicFence.getId()).toUpperCase(), TimeJobType.ELECTRONIC_EFFECT); Map<String, ? extends Object> effectMaps = new ImmutableMap.Builder<String, Long>() .put("type", 1L) .put("id", xpElectronicFence.getId()) .build(); QuartzManager.addJob( ElectronicEffectJob.class, (ElectronicEffectJob.effect + xpElectronicFence.getId()).toUpperCase(), TimeJobType.ELECTRONIC_EFFECT, DateUtils.localDateTimeToDate(dto.getEffectTime()), effectMaps ); xpElectronicFence.setStatus(1); } } LocalDateTime now = LocalDateTime.now(); int targetStatus = resolveFenceStatus(dto.getStatus(), dto.getEffectType(), dto.getEffectTime(), now); xpElectronicFence.setStatus(targetStatus); if (targetStatus == 2 && dto.getEffectType() != null && dto.getEffectType() == 1) { xpElectronicFence.setEffectTime(now); } // 失效时间处理:独立于 status 判断,只要 failureType=2 就注册失效定时任务 if (dto.getFailureType() != null && dto.getFailureType() == 2) { if (dto.getFailureTime() != null && !dto.getFailureTime().isBefore(LocalDateTime.now())) { // 先删除以前的定时任务,再注册新的失效定时任务 QuartzManager.removeJob((ElectronicEffectJob.failure + xpElectronicFence.getId()).toUpperCase(), TimeJobType.ELECTRONIC_FAILURE); Map<String, ? extends Object> failureMaps = new ImmutableMap.Builder<String, Long>() .put("type", 2L) .put("id", xpElectronicFence.getId()) .build(); QuartzManager.addJob( ElectronicEffectJob.class, (ElectronicEffectJob.failure + xpElectronicFence.getId()).toUpperCase(), TimeJobType.ELECTRONIC_FAILURE, DateUtils.localDateTimeToDate(dto.getFailureTime()), failureMaps ); } if (dto.getStatus() == 1 || dto.getStatus() == 2) { registerEffectJobIfNeeded(xpElectronicFence.getId(), targetStatus, dto.getEffectType(), dto.getEffectTime(), now); registerFailureJobIfNeeded(xpElectronicFence.getId(), dto.getFailureType(), dto.getFailureTime(), now); } else { // failureType 不是定时失效,清除可能存在的旧失效定时任务 QuartzManager.removeJob((ElectronicEffectJob.effect + xpElectronicFence.getId()).toUpperCase(), TimeJobType.ELECTRONIC_EFFECT); QuartzManager.removeJob((ElectronicEffectJob.failure + xpElectronicFence.getId()).toUpperCase(), TimeJobType.ELECTRONIC_FAILURE); } //根据经纬度获取当前城市code @@ -852,6 +755,64 @@ return ids.stream().filter(Objects::nonNull).distinct().collect(Collectors.toList()); } private int resolveFenceStatus(Integer requestedStatus, Integer effectType, LocalDateTime effectTime, LocalDateTime now) { if (requestedStatus == null) { return 0; } if (requestedStatus == 0) { return 0; } if (requestedStatus == 3) { return 3; } if (effectType != null && effectType == 1) { return 2; } if (effectTime != null && !effectTime.isAfter(now)) { return 2; } return 1; } private void registerEffectJobIfNeeded(Long electronicId, Integer targetStatus, Integer effectType, LocalDateTime effectTime, LocalDateTime now) { QuartzManager.removeJob((ElectronicEffectJob.effect + electronicId).toUpperCase(), TimeJobType.ELECTRONIC_EFFECT); if (targetStatus != 1 || effectType == null || effectType == 1 || effectTime == null || !effectTime.isAfter(now)) { return; } Map<String, ? extends Object> effectMaps = new ImmutableMap.Builder<String, Long>() .put("type", 1L) .put("id", electronicId) .build(); QuartzManager.addJob( ElectronicEffectJob.class, (ElectronicEffectJob.effect + electronicId).toUpperCase(), TimeJobType.ELECTRONIC_EFFECT, DateUtils.localDateTimeToDate(effectTime), effectMaps ); } private void registerFailureJobIfNeeded(Long electronicId, Integer failureType, LocalDateTime failureTime, LocalDateTime now) { QuartzManager.removeJob((ElectronicEffectJob.failure + electronicId).toUpperCase(), TimeJobType.ELECTRONIC_FAILURE); if (failureType == null || failureType != 2 || failureTime == null || failureTime.isBefore(now)) { return; } Map<String, ? extends Object> failureMaps = new ImmutableMap.Builder<String, Long>() .put("type", 2L) .put("id", electronicId) .build(); QuartzManager.addJob( ElectronicEffectJob.class, (ElectronicEffectJob.failure + electronicId).toUpperCase(), TimeJobType.ELECTRONIC_FAILURE, DateUtils.localDateTimeToDate(failureTime), failureMaps ); } /** * 判断点是否在多边形内 * xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/controller/XpTestPointManagementController.java
New file @@ -0,0 +1,205 @@ package com.xiaopeng.operation.controller; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.xiaopeng.api.dto.map.XpPointExportExcelQuery; import com.xiaopeng.api.dto.operation.PointAddDto; import com.xiaopeng.api.dto.operation.PointUpdateDto; import com.xiaopeng.api.dto.operation.XpPointEnableDisableDto; import com.xiaopeng.api.model.operation.XpElectronicFence; import com.xiaopeng.api.model.operation.XpElectronicFenceArea; import com.xiaopeng.api.model.operation.XpTestPoint; import com.xiaopeng.api.query.operation.PointListQuery; import com.xiaopeng.api.query.operation.PointPageListListQuery; import com.xiaopeng.common.core.domain.R; import com.xiaopeng.common.core.web.controller.BaseController; import com.xiaopeng.common.core.web.page.PageInfo; import com.xiaopeng.operation.dto.XpPointSpecialDto; import com.xiaopeng.operation.service.IXpElectronicFenceAreaService; import com.xiaopeng.operation.service.IXpElectronicFenceService; import com.xiaopeng.operation.service.XpPointService; import com.xiaopeng.operation.service.XpTestPointService; import com.xiaopeng.operation.vo.SpecialPointListVo; import com.xiaopeng.operation.vo.SpecialPointVo; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.BeanUtils; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.stream.Collectors; @Slf4j @RestController @RequestMapping("/api/v1/testPoint") @Api(tags = "测试demo-点位管理") public class XpTestPointManagementController extends BaseController { @Resource private XpTestPointService xpTestPointService; @Resource private IXpElectronicFenceAreaService xpElectronicFenceAreaService; @Resource private IXpElectronicFenceService xpElectronicFenceService; @ApiOperation(value = "获取所有运营中的区域", response = XpElectronicFenceArea.class) @PostMapping("/listElectronicFenceArea") public R<List<XpElectronicFenceArea>> listElectronicFenceArea() { // 获取所有启用的电子围栏 List<XpElectronicFence> electronicFences = xpElectronicFenceService.lambdaQuery().eq(XpElectronicFence::getStatus, 2).list(); List<Long> electronicFenceIds = electronicFences.stream().map(XpElectronicFence::getId).collect(Collectors.toList()); if (electronicFenceIds.isEmpty()) { return R.ok(new ArrayList<XpElectronicFenceArea>()); } // 获取电子围栏下启用的运营区域 List<XpElectronicFenceArea> electronicFenceAreaList = xpElectronicFenceAreaService.lambdaQuery().in(XpElectronicFenceArea::getElectronicId, electronicFenceIds) .eq(XpElectronicFenceArea::getAreaStatus, 1).list(); return R.ok(electronicFenceAreaList); } @ApiOperation(value = "点位管理列表", response = XpTestPoint.class) @PostMapping("/listPoint") public R<List<XpTestPoint>> list(@RequestBody PointListQuery query) { List<XpTestPoint> pageList = xpTestPointService.listAll(query); return R.ok(pageList); } @ApiOperation(value = "点位管理分页列表", response = XpTestPoint.class) @PostMapping("/pageList") public R<PageInfo<XpTestPoint>> pageList(@RequestBody PointPageListListQuery query) { PageInfo<XpTestPoint> pageList = xpTestPointService.pageList(query); return R.ok(pageList); } @PostMapping("/getByIds") public R<List<XpTestPoint>> getByIds(@RequestBody XpPointExportExcelQuery query) { List<XpTestPoint> list = xpTestPointService.lambdaQuery().in(XpTestPoint::getId, query.getPointIds()).list(); return R.ok(list); } /** * 新增点位 */ @PostMapping("/addPoint") @ResponseBody @ApiOperation(value = "新增点位") public R add(@Validated @RequestBody PointAddDto pointAddDto) { XpTestPoint xpPoint = new XpTestPoint(); BeanUtils.copyProperties(pointAddDto, xpPoint); xpPoint.setFpElectronicAreaId(xpPoint.getElectronicAreaId()); xpTestPointService.save(xpPoint); return R.ok(); } /** * 批量删除点位 */ @GetMapping("/deletePoint") @ResponseBody @ApiOperation(value = "删除点位") public R deletePoint(@RequestParam("ids") String ids) { xpTestPointService.removeBatchByIds(Arrays.stream(ids.split(",")) .map(Long::parseLong).collect(Collectors.toList())); return R.ok(); } /** * 编辑点位 */ @PostMapping("/editPoint") @ApiOperation(value = "编辑点位") public R edit(@Validated @RequestBody PointUpdateDto pointAddDto) { XpTestPoint xpPoint = new XpTestPoint(); BeanUtils.copyProperties(pointAddDto, xpPoint); xpPoint.setFpElectronicAreaId(null); xpTestPointService.updateById(xpPoint); return R.ok(); } /** * 点位详情 */ @GetMapping("/queryPointById") @ApiOperation(value = "点位详情") public R<XpTestPoint> queryById(@RequestParam Long id) { return R.ok(xpTestPointService.getById(id)); } /** * 启用/禁用 */ @PostMapping("/enableDisablePoint") @ApiOperation(value = "启用/禁用") public R enableDisable(@RequestBody XpPointEnableDisableDto dto) { XpTestPoint xpPoint = xpTestPointService.getById(dto.getId()); xpPoint.setOperationStatus(dto.getOperationStatus()); xpPoint.setFpElectronicAreaId(null); xpTestPointService.updateById(xpPoint); return R.ok(); } /** * 设置特殊点位 */ @PostMapping("/setSpecialPoint") @ApiOperation(value = "设置特殊点位", tags = "后台管理-特殊点位") public R setSpecialPoint(@RequestBody XpPointSpecialDto dto) { xpTestPointService.update(new LambdaUpdateWrapper<XpTestPoint>().set(XpTestPoint::getChargePoint, 0) .set(XpTestPoint::getParkingPoint, 0)); List<XpTestPoint> list = xpTestPointService.list(new LambdaQueryWrapper<XpTestPoint>() .in(XpTestPoint::getId, dto.getChargePoints())); list.forEach(e -> { e.setChargePoint(1); e.setFpElectronicAreaId(null); }); xpTestPointService.updateBatchById(list); List<XpTestPoint> list1 = xpTestPointService.list(new LambdaQueryWrapper<XpTestPoint>() .in(XpTestPoint::getId, dto.getParkingPoints())); list1.forEach(e -> { e.setParkingPoint(1); e.setFpElectronicAreaId(null); }); xpTestPointService.updateBatchById(list1); return R.ok(); } @GetMapping("/listSpecialPoint") @ApiOperation(value = "获取特殊点位", tags = "后台管理-特殊点位") public R<SpecialPointVo> getSpecialPoint() { List<XpTestPoint> chargePoints = xpTestPointService.list(new LambdaQueryWrapper<XpTestPoint>().eq(XpTestPoint::getChargePoint, 1)); List<XpTestPoint> parkingPoints = xpTestPointService.list(new LambdaQueryWrapper<XpTestPoint>().eq(XpTestPoint::getParkingPoint, 1)); SpecialPointVo specialPointVo = new SpecialPointVo(); ArrayList<SpecialPointListVo> chargePointsList = new ArrayList<>(); for (XpTestPoint chargePoint : chargePoints) { SpecialPointListVo specialPointListVo = new SpecialPointListVo(); specialPointListVo.setPointName(chargePoint.getPointName()); specialPointListVo.setPointAddress(chargePoint.getPointAddress()); specialPointListVo.setPointId(chargePoint.getId()); chargePointsList.add(specialPointListVo); } specialPointVo.setChargePoints(chargePointsList); ArrayList<SpecialPointListVo> parkingPointsList = new ArrayList<>(); for (XpTestPoint parkingPoint : parkingPoints) { SpecialPointListVo specialPointListVo = new SpecialPointListVo(); specialPointListVo.setPointName(parkingPoint.getPointName()); specialPointListVo.setPointAddress(parkingPoint.getPointAddress()); specialPointListVo.setPointId(parkingPoint.getId()); parkingPointsList.add(specialPointListVo); } specialPointVo.setParkingPoints(parkingPointsList); return R.ok(specialPointVo); } } xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/job/jobs/DynamicPricingCheckJob.java
@@ -1,7 +1,5 @@ package com.xiaopeng.operation.job.jobs; import cn.hutool.core.date.DatePattern; import cn.hutool.core.date.DateUtil; import com.alibaba.fastjson2.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.xiaopeng.api.feignClient.order.XpOrderClient; @@ -11,10 +9,8 @@ import com.xiaopeng.api.model.operation.XpPricing; import com.xiaopeng.api.model.vehicleConvoy.XpVehicle; import com.xiaopeng.common.core.domain.R; import com.xiaopeng.common.core.utils.DateUtils; import com.xiaopeng.common.core.utils.StringUtils; import com.xiaopeng.common.redis.service.RedisService; import com.xiaopeng.operation.job.base.AbstractJob; import com.xiaopeng.operation.job.base.TimeJobType; import com.xiaopeng.operation.job.base.QuartzManager; import com.xiaopeng.operation.job.utils.SpringContextsUtil; @@ -22,12 +18,12 @@ import com.xiaopeng.operation.mapper.XpOpenCityMapper; import com.xiaopeng.operation.service.XpPricingService; import lombok.extern.slf4j.Slf4j; import org.quartz.Job; import org.quartz.JobDataMap; import org.quartz.JobExecutionContext; import org.quartz.JobExecutionException; import java.time.LocalDateTime; import java.util.Collections; import java.util.Date; import java.util.HashMap; import java.util.List; @@ -45,7 +41,7 @@ * @author mitao */ @Slf4j public class DynamicPricingCheckJob extends AbstractJob { public class DynamicPricingCheckJob implements Job { /** * 任务名称前缀 @@ -60,7 +56,6 @@ private RedisService redisService; public DynamicPricingCheckJob() { super(); this.xpPricingService = SpringContextsUtil.getBean(XpPricingService.class); this.xpOrderClient = SpringContextsUtil.getBean(XpOrderClient.class); this.xpVehicleClient = SpringContextsUtil.getBean(XpVehicleClient.class); @@ -166,7 +161,7 @@ if (activeOrderCount > orderThreshold && idleVehicleCount < vehicleThreshold) { String redisKey = "DYNAMIC_PRICE_" + cityId; // 写入当前时间字符串,与现有 XpPricingUtil 消费侧兼容 redisService.setCacheObject(redisKey, DateUtil.format(new Date(), DatePattern.NORM_DATETIME_FORMAT)); redisService.setCacheObject(redisKey, LocalDateTime.now().toString()); log.info("动态调价触发:已写入 Redis key={} pricingId={}", redisKey, pricingId); } else { log.info("动态调价未触发:供需条件不满足 pricingId={}", pricingId); xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/mapper/XpTestPointMapper.java
New file @@ -0,0 +1,35 @@ package com.xiaopeng.operation.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.xiaopeng.api.dto.operation.PointMapQuery; import com.xiaopeng.api.model.operation.XpPoint; import com.xiaopeng.api.model.operation.XpTestPoint; import com.xiaopeng.api.query.operation.PointListQuery; import com.xiaopeng.api.query.operation.PointPageListListQuery; import com.xiaopeng.api.vo.order.XpPointsListVo; import com.xiaopeng.common.core.web.page.PageInfo; import com.xiaopeng.operation.query.PointByNameQuery; import org.apache.ibatis.annotations.Param; import java.util.List; /** * <p> * 测试demo-点位管理 Mapper 接口 * </p> * * @author liu * @author WuGuanFengYue * @since 2026-02-03 */ public interface XpTestPointMapper extends BaseMapper<XpTestPoint> { List<XpTestPoint> pointMap(@Param("query") PointMapQuery query); List<XpTestPoint> listAll(@Param("query") PointListQuery query); List<XpPointsListVo> queryPointByName(@Param("query") PointByNameQuery query); List<XpTestPoint> pageList(@Param("pageInfo") PageInfo<XpPoint> pageInfo, @Param("query") PointPageListListQuery query); } xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/service/XpTestPointService.java
New file @@ -0,0 +1,93 @@ package com.xiaopeng.operation.service; import com.baomidou.mybatisplus.extension.service.IService; import com.xiaopeng.api.dto.operation.PointMapQuery; import com.xiaopeng.api.dto.order.HistoryEndPointsDto; import com.xiaopeng.api.dto.order.HistoryStartPointsDto; import com.xiaopeng.api.model.operation.XpTestPoint; import com.xiaopeng.api.query.operation.PointListQuery; import com.xiaopeng.api.query.operation.PointPageListListQuery; import com.xiaopeng.api.vo.order.XpHistoryEndPointsVo; import com.xiaopeng.api.vo.order.XpHistoryStartPointsVo; import com.xiaopeng.api.vo.order.XpPointsSearchVo; import com.xiaopeng.common.core.web.page.PageInfo; import com.xiaopeng.operation.dto.NearestDto; import com.xiaopeng.operation.query.PointByNameQuery; import com.xiaopeng.operation.vo.NearestVo; import com.xiaopeng.operation.vo.OrderDistanceVo; import javax.validation.Valid; import java.time.LocalTime; import java.util.List; /** * <p> * 测试demo-点位管理 服务类 * </p> * * @author liu * @author WuGuanFengYue * @since 2026-02-03 */ public interface XpTestPointService extends IService<XpTestPoint> { /** * 获取附近上车站点 */ NearestVo nearest(@Valid NearestDto dto); /** * 判断点位是否时间段内 * @param now * @return */ boolean getInTime(LocalTime now, Integer effectivePeriod, String effectiveTimePeriod); List<XpTestPoint> pointMap(PointMapQuery query); List<XpTestPoint> listAll(PointListQuery query); /** * 获取历史上车站点 * @param historyStartPointsDto * @return */ List<XpHistoryStartPointsVo> getHistoryStartPoints(HistoryStartPointsDto historyStartPointsDto); /** * 获取历史上车站点 * @param historyEndPointsDto * @return */ List<XpHistoryEndPointsVo> getHistoryEndPoints(HistoryEndPointsDto historyEndPointsDto); /** * 根据名称获取点位列表 * @param query * @return */ XpPointsSearchVo queryPointByName(@Valid PointByNameQuery query); /** * 获取可下单距离 * @return */ OrderDistanceVo getOrderDistance(); PageInfo<XpTestPoint> pageList(PointPageListListQuery query); /** * 判断点位是否在当前时间范围内有效 * @param pointId * @return */ Boolean nowInTimePoint(Long pointId); } xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/service/impl/XpTestPointServiceImpl.java
New file @@ -0,0 +1,502 @@ package com.xiaopeng.operation.service.impl; import cn.hutool.core.collection.CollUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.xiaopeng.api.dto.operation.PointMapQuery; import com.xiaopeng.api.dto.order.HistoryEndPointsDto; import com.xiaopeng.api.dto.order.HistoryStartPointsDto; import com.xiaopeng.api.model.operation.*; import com.xiaopeng.api.query.operation.PointListQuery; import com.xiaopeng.api.query.operation.PointPageListListQuery; import com.xiaopeng.api.vo.order.XpHistoryEndPointsVo; import com.xiaopeng.api.vo.order.XpHistoryStartPointsVo; import com.xiaopeng.api.vo.order.XpPointsListVo; import com.xiaopeng.api.vo.order.XpPointsSearchVo; import com.xiaopeng.common.core.constant.CacheConstants; import com.xiaopeng.common.core.web.page.PageInfo; import com.xiaopeng.common.redis.service.RedisService; import com.xiaopeng.operation.dto.NearestDto; import com.xiaopeng.operation.mapper.XpSystemSettingMapper; import com.xiaopeng.operation.mapper.XpTestPointMapper; import com.xiaopeng.operation.query.PointByNameQuery; import com.xiaopeng.operation.service.IXpElectronicFenceAreaService; import com.xiaopeng.operation.service.IXpElectronicFenceService; import com.xiaopeng.operation.service.XpTestPointService; import com.xiaopeng.operation.utils.TimeRangeChecker; import com.xiaopeng.operation.utils.holiday.HolidayUtil; import com.xiaopeng.operation.utils.map.FastDistanceCalculator; import com.xiaopeng.operation.vo.NearestNextVo; import com.xiaopeng.operation.vo.NearestVo; import com.xiaopeng.operation.vo.OrderDistanceVo; import org.springframework.stereotype.Service; import org.springframework.util.StringUtils; import javax.annotation.Resource; import java.math.BigDecimal; import java.math.RoundingMode; import java.time.LocalDateTime; import java.time.LocalTime; import java.util.ArrayList; import java.util.Comparator; import java.util.List; import java.util.stream.Collectors; /** * <p> * 点位管理 服务实现类 * </p> * * @author liu * @author WuGuanFengYue * @since 2026-02-03 */ @Service public class XpTestPointServiceImpl extends ServiceImpl<XpTestPointMapper, XpTestPoint> implements XpTestPointService { @Resource private XpSystemSettingMapper xpSystemSettingMapper; @Resource private RedisService redisService; @Resource private HolidayUtil holidayUtil; @Resource private IXpElectronicFenceAreaService xpElectronicFenceAreaService; @Resource private IXpElectronicFenceService xpElectronicFenceService; @Override public NearestVo nearest(NearestDto dto) { // 走缓存 Object orderDistanceObj = redisService.getCacheObject(CacheConstants.NEAR_POINT_DISTANCE); Integer orderDistance; if (orderDistanceObj != null) { orderDistance = Integer.valueOf(orderDistanceObj.toString()); } else { XpSystemSetting xpSystemSetting = xpSystemSettingMapper.selectOne(null); orderDistance = xpSystemSetting.getNearPointDistance(); } List<XpTestPoint> list1 = list(new LambdaQueryWrapper<XpTestPoint>().eq(XpTestPoint::getOperationStatus, 2).eq(XpTestPoint::getPointType,1).isNotNull(XpTestPoint::getElectronicAreaId)); if(list1.size()<2){ return new NearestVo(); } // 获取所有的站点信息 List<XpTestPoint> list = list(new LambdaQueryWrapper<XpTestPoint>().eq(XpTestPoint::getOperationStatus, 2).eq(XpTestPoint::getPointType,1).isNotNull(XpTestPoint::getElectronicAreaId) // 添加距离计算字段 .apply("ST_Distance_Sphere(point({0}, {1}), point(point_lon, point_lat)) <= {2}", dto.getLongitude(), dto.getLatitude(), orderDistance)); list = list.stream().filter(e->e.getElectronicAreaId().equals(dto.getElectronicAreaId())).collect(Collectors.toList()); NearestVo nearestVo = new NearestVo(); if(list.isEmpty()){ nearestVo.setPoints(new ArrayList<>()); nearestVo.setTotal(0); return nearestVo; } List<NearestNextVo> nearestNextVos = new ArrayList<>(); LocalTime now = LocalTime.now(); List<Long> areaIds = list.stream().map(XpTestPoint::getElectronicAreaId).collect(Collectors.toList()); List<XpElectronicFenceArea> xpElectronicFenceAreas = xpElectronicFenceAreaService.listByIds(areaIds); List<Long> fenceIds = xpElectronicFenceAreas.stream().map(XpElectronicFenceArea::getElectronicId).collect(Collectors.toList()); List<XpElectronicFence> xpElectronicFences = new ArrayList<>(); if (CollUtil.isNotEmpty(fenceIds)) { xpElectronicFences = xpElectronicFenceService.listByIds(fenceIds); } //判断当前点位是否在运营时间范围内 for (XpTestPoint xpPoint : list) { Integer operationType = xpPoint.getOperationType(); if(1 == operationType){ //与运营区同步 XpElectronicFenceArea xpElectronicFenceArea = xpElectronicFenceAreas.stream().filter(s -> s.getId().equals(xpPoint.getElectronicAreaId())).findFirst().orElse(null); if(null == xpElectronicFenceArea){ continue; } XpElectronicFence xpElectronicFence = xpElectronicFences.stream().filter(s -> s.getId().equals(xpElectronicFenceArea.getElectronicId())).findFirst().orElse(null); if(null == xpElectronicFence){ continue; } //失效类型 1=永不失效 2=定时失效 Integer failureType = xpElectronicFence.getFailureType(); //永不失效,但是还未到开始时间 if(1 == failureType && LocalDateTime.now().isBefore(xpElectronicFence.getEffectTime())){ continue; }else if(2 == failureType && (LocalDateTime.now().isBefore(xpElectronicFence.getEffectTime()) || LocalDateTime.now().isAfter(xpElectronicFence.getFailureTime()))){ //定时失效,但是当前时间不在时间范围内 continue; } }else{ //自定义时间段 // 判断是否在时间段内 boolean intime = getInTime(now, xpPoint.getEffectivePeriod(), xpPoint.getEffectiveTimePeriod()); if (!intime) { continue; } } // 计算距离 小于的站点 double v = FastDistanceCalculator.distanceFast(dto.getLatitude(), dto.getLongitude(), xpPoint.getPointLat(), xpPoint.getPointLon()); // m做判断 if ((v) < orderDistance) { NearestNextVo nearestNextVo = new NearestNextVo(); nearestNextVo.setId(xpPoint.getId()); nearestNextVo.setName(xpPoint.getPointName()); nearestNextVo.setLatitude(xpPoint.getPointLat()); nearestNextVo.setLongitude(xpPoint.getPointLon()); nearestNextVo.setDistance(new BigDecimal(v).setScale(2, RoundingMode.HALF_UP).doubleValue()); nearestNextVo.setAddress(xpPoint.getPointAddress()); nearestNextVo.setTime(xpPoint.getParkingTimeLimit()); nearestNextVo.setElectronicAreaId(xpPoint.getElectronicAreaId()); nearestNextVos.add(nearestNextVo); } } if (!nearestNextVos.isEmpty()) { nearestNextVos = nearestNextVos.stream().sorted(Comparator.comparing(NearestNextVo::getDistance)).collect(Collectors.toList()); } nearestVo.setPoints(nearestNextVos); nearestVo.setTotal(nearestNextVos.size()); return nearestVo; } public boolean getInTime(LocalTime now, Integer effectivePeriod, String effectiveTimePeriod){ // 2非工作日 0工作日 1节假日 3调休日 Integer holidayToday = holidayUtil.isHolidayToday(); if(effectivePeriod==1){ boolean inTime = TimeRangeChecker.isCurrentTimeInRanges(now,effectiveTimePeriod); if (!inTime) { return false; } }else if(effectivePeriod==2){ if(holidayToday!=0){ return false; } boolean inTime = TimeRangeChecker.isCurrentTimeInRanges(now,effectiveTimePeriod); if (!inTime) { return false; } }else if(effectivePeriod==3){ if(holidayToday!=2){ return false; } boolean inTime = TimeRangeChecker.isCurrentTimeInRanges(now,effectiveTimePeriod); if (!inTime) { return false; } }else if(effectivePeriod==4){ if(holidayToday!=1){ return false; } boolean inTime = TimeRangeChecker.isCurrentTimeInRanges(now,effectiveTimePeriod); if (!inTime) { return false; } } return true; } @Override public List<XpTestPoint> pointMap(PointMapQuery query) { List<XpTestPoint> list = this.baseMapper.pointMap(query); return list; } @Override public List<XpTestPoint> listAll(PointListQuery query) { if(StringUtils.hasLength(query.getOperationStatus())){ String[] split = query.getOperationStatus().split(","); List<Integer> statusIds = new ArrayList<>(); for (String s : split) { statusIds.add(Integer.valueOf(s)); } query.setOperationStatusIds(statusIds); } List<XpTestPoint> list = this.baseMapper.listAll(query); return list; } @Override public List<XpHistoryStartPointsVo> getHistoryStartPoints(HistoryStartPointsDto historyStartPointsDto) { List<XpTestPoint> xpPoints = this.baseMapper.selectBatchIds(historyStartPointsDto.getPointIds()); ArrayList<XpHistoryStartPointsVo> resultList = new ArrayList<>(10); LocalTime now = LocalTime.now(); List<Long> areaIds = xpPoints.stream().map(XpTestPoint::getElectronicAreaId).collect(Collectors.toList()); List<XpElectronicFenceArea> xpElectronicFenceAreas = xpElectronicFenceAreaService.listByIds(areaIds); List<Long> fenceIds = xpElectronicFenceAreas.stream().map(XpElectronicFenceArea::getElectronicId).collect(Collectors.toList()); List<XpElectronicFence> xpElectronicFences = new ArrayList<>(); if (CollUtil.isNotEmpty(fenceIds)) { xpElectronicFences = xpElectronicFenceService.listByIds(fenceIds); } for (XpTestPoint xpPoint : xpPoints) { if(xpPoint.getOperationStatus()!=2){ continue; } Integer operationType = xpPoint.getOperationType(); if(1 == operationType){ //与运营区同步 XpElectronicFenceArea xpElectronicFenceArea = xpElectronicFenceAreas.stream().filter(s -> s.getId().equals(xpPoint.getElectronicAreaId())).findFirst().orElse(null); if(null == xpElectronicFenceArea){ // 不在运营段 continue; } XpElectronicFence xpElectronicFence = xpElectronicFences.stream().filter(s -> s.getId().equals(xpElectronicFenceArea.getElectronicId())).findFirst().orElse(null); if(null == xpElectronicFence){ // 不在运营段 continue; } //失效类型 1=永不失效 2=定时失效 Integer failureType = xpElectronicFence.getFailureType(); //永不失效,但是还未到开始时间 if(1 == failureType && LocalDateTime.now().isBefore(xpElectronicFence.getEffectTime())){ continue; }else if(2 == failureType && (LocalDateTime.now().isBefore(xpElectronicFence.getEffectTime()) || LocalDateTime.now().isAfter(xpElectronicFence.getFailureTime()))){ //定时失效,但是当前时间不在时间范围内 continue; } }else{ //自定义时间段 // 判断是否在时间段内 boolean intime = getInTime(now, xpPoint.getEffectivePeriod(), xpPoint.getEffectiveTimePeriod()); if (!intime) { // 不在运营段 continue; } } XpHistoryStartPointsVo xpHistoryStartPointsVo = new XpHistoryStartPointsVo(); xpHistoryStartPointsVo.setOperationStatus(1); xpHistoryStartPointsVo.setName(xpPoint.getPointName()); xpHistoryStartPointsVo.setAddress(xpPoint.getPointAddress()); xpHistoryStartPointsVo.setLatitude(xpPoint.getPointLat()); xpHistoryStartPointsVo.setLongitude(xpPoint.getPointLon()); xpHistoryStartPointsVo.setId(xpPoint.getId()); double distanced = FastDistanceCalculator.distanceFast(historyStartPointsDto.getLat(), historyStartPointsDto.getLon(), xpPoint.getPointLat(), xpPoint.getPointLon()); xpHistoryStartPointsVo.setDistance(distanced); xpHistoryStartPointsVo.setTime(xpPoint.getParkingTimeLimit()); xpHistoryStartPointsVo.setElectronicAreaId(xpPoint.getElectronicAreaId()); resultList.add(xpHistoryStartPointsVo); } return resultList; } @Override public List<XpHistoryEndPointsVo> getHistoryEndPoints(HistoryEndPointsDto historyEndPointsDto) { List<XpTestPoint> xpPoints = this.baseMapper.selectBatchIds(historyEndPointsDto.getPointIds()); ArrayList<XpHistoryEndPointsVo> resultList = new ArrayList<>(10); LocalTime now = LocalTime.now(); List<Long> areaIds = xpPoints.stream().map(XpTestPoint::getElectronicAreaId).collect(Collectors.toList()); List<XpElectronicFenceArea> xpElectronicFenceAreas = xpElectronicFenceAreaService.listByIds(areaIds); List<Long> fenceIds = xpElectronicFenceAreas.stream().map(XpElectronicFenceArea::getElectronicId).collect(Collectors.toList()); List<XpElectronicFence> xpElectronicFences = new ArrayList<>(); if (CollUtil.isNotEmpty(fenceIds)) { xpElectronicFences = xpElectronicFenceService.listByIds(fenceIds); } for (XpTestPoint xpPoint : xpPoints) { if(xpPoint.getOperationStatus()!=2){ continue; } Integer operationType = xpPoint.getOperationType(); if(1 == operationType){ //与运营区同步 XpElectronicFenceArea xpElectronicFenceArea = xpElectronicFenceAreas.stream().filter(s -> s.getId().equals(xpPoint.getElectronicAreaId())).findFirst().orElse(null); if(null == xpElectronicFenceArea){ // 不在运营段 continue; } XpElectronicFence xpElectronicFence = xpElectronicFences.stream().filter(s -> s.getId().equals(xpElectronicFenceArea.getElectronicId())).findFirst().orElse(null); if(null == xpElectronicFence){ // 不在运营段 continue; } //失效类型 1=永不失效 2=定时失效 Integer failureType = xpElectronicFence.getFailureType(); //永不失效,但是还未到开始时间 if(1 == failureType && LocalDateTime.now().isBefore(xpElectronicFence.getEffectTime())){ continue; }else if(2 == failureType && (LocalDateTime.now().isBefore(xpElectronicFence.getEffectTime()) || LocalDateTime.now().isAfter(xpElectronicFence.getFailureTime()))){ //定时失效,但是当前时间不在时间范围内 continue; } }else{ //自定义时间段 // 判断是否在时间段内 boolean intime = getInTime(now, xpPoint.getEffectivePeriod(), xpPoint.getEffectiveTimePeriod()); if (!intime) { // 不在运营段 continue; } } XpHistoryEndPointsVo xpHistoryEndPointsVo = new XpHistoryEndPointsVo(); xpHistoryEndPointsVo.setOperationStatus(1); xpHistoryEndPointsVo.setName(xpPoint.getPointName()); xpHistoryEndPointsVo.setAddress(xpPoint.getPointAddress()); xpHistoryEndPointsVo.setLatitude(xpPoint.getPointLat()); xpHistoryEndPointsVo.setLongitude(xpPoint.getPointLon()); xpHistoryEndPointsVo.setId(xpPoint.getId()); double distanced = FastDistanceCalculator.distanceFast(historyEndPointsDto.getLat(), historyEndPointsDto.getLon(), xpPoint.getPointLat(), xpPoint.getPointLon()); xpHistoryEndPointsVo.setDistance(distanced); xpHistoryEndPointsVo.setTime(xpPoint.getParkingTimeLimit()); xpHistoryEndPointsVo.setElectronicAreaId(xpPoint.getElectronicAreaId()); resultList.add(xpHistoryEndPointsVo); } return resultList; } @Override public XpPointsSearchVo queryPointByName(PointByNameQuery query) { XpPointsSearchVo searchVo = new XpTestPointsSearchVo(); List<XpPointsListVo> list = this.baseMapper.queryPointByName(query); if (list.isEmpty()) { return searchVo; } LocalTime now = LocalTime.now(); List<Long> areaIds = list.stream().map(XpPointsListVo::getElectronicAreaId).collect(Collectors.toList()); List<XpElectronicFenceArea> xpElectronicFenceAreas = xpElectronicFenceAreaService.listByIds(areaIds); List<Long> fenceIds = xpElectronicFenceAreas.stream().map(XpElectronicFenceArea::getElectronicId).collect(Collectors.toList()); List<XpElectronicFence> xpElectronicFences = new ArrayList<>(); if (CollUtil.isNotEmpty(fenceIds)) { xpElectronicFences = xpElectronicFenceService.listByIds(fenceIds); } for (XpPointsListVo xpPointsListVo : list) { Integer operationType = xpPointsListVo.getOperationType(); if(1 == operationType){ //与运营区同步 XpElectronicFenceArea xpElectronicFenceArea = xpElectronicFenceAreas.stream().filter(s -> s.getId().equals(xpPointsListVo.getElectronicAreaId())).findFirst().orElse(null); if(null == xpElectronicFenceArea){ // 不在运营段 xpPointsListVo.setState(0); } XpElectronicFence xpElectronicFence = xpElectronicFences.stream().filter(s -> s.getId().equals(xpElectronicFenceArea.getElectronicId())).findFirst().orElse(null); if(null == xpElectronicFence){ // 不在运营段 xpPointsListVo.setState(0); } //失效类型 1=永不失效 2=定时失效 Integer failureType = xpElectronicFence.getFailureType(); //永不失效,但是还未到开始时间 if(1 == failureType && LocalDateTime.now().isBefore(xpElectronicFence.getEffectTime())){ xpPointsListVo.setState(0); }else if(2 == failureType && (LocalDateTime.now().isBefore(xpElectronicFence.getEffectTime()) || LocalDateTime.now().isAfter(xpElectronicFence.getFailureTime()))){ //定时失效,但是当前时间不在时间范围内 xpPointsListVo.setState(0); } }else{ //自定义时间段 // 判断是否在时间段内 boolean intime = getInTime(now, xpPointsListVo.getEffectivePeriod(), xpPointsListVo.getEffectiveTimePeriod()); if (!intime) { // 不在运营段 xpPointsListVo.setState(0); } } } // 组装数据 并排序 剔除不在运营段的 数据 List<XpPointsListVo> resultList = list.stream() .peek(vo -> vo.setDistance(BigDecimal.valueOf(FastDistanceCalculator.distanceFast(query.getLat(), query.getLon(), vo.getLatitude(), vo.getLongitude())).setScale(2, RoundingMode.HALF_UP).doubleValue())) .filter(vo -> vo.getState() == 1).collect(Collectors.toList()); // 可用点位 List<XpPointsListVo> availablePoints = resultList.stream().filter(e -> query.getElectronicAreaId() != null && e.getElectronicAreaId().equals(query.getElectronicAreaId())).sorted(Comparator.comparing(XpPointsListVo::getDistance)).collect(Collectors.toList());// // 不可用点位 List<XpPointsListVo> unavailablePoints = resultList.stream().filter(e -> query.getElectronicAreaId() == null || !e.getElectronicAreaId().equals(query.getElectronicAreaId())).sorted(Comparator.comparing(XpPointsListVo::getDistance)).collect(Collectors.toList()); searchVo.setAvailablePoints(availablePoints); searchVo.setUnavailablePoints(unavailablePoints); return searchVo; } @Override public OrderDistanceVo getOrderDistance() { OrderDistanceVo orderDistanceVo = new OrderDistanceVo(); XpSystemSetting xpSystemSetting = xpSystemSettingMapper.selectOne(null); if (xpSystemSetting != null) { orderDistanceVo.setMaxDistance(xpSystemSetting.getOrderDistance()); orderDistanceVo.setMinDistance(xpSystemSetting.getMinOrderDistance()); orderDistanceVo.setAdsorptionDistance(xpSystemSetting.getAdsorptionDistance()); orderDistanceVo.setNearPointDistance(xpSystemSetting.getNearPointDistance()); return orderDistanceVo; } return orderDistanceVo; } @Override public PageInfo<XpTestPoint> pageList(PointPageListListQuery query) { PageInfo<XpTestPoint> pageInfo = new PageInfo<>(query.getPageNum(),query.getPageSize()); List<XpTestPoint> list = this.baseMapper.pageList(pageInfo,query); pageInfo.setRecords(list); return pageInfo; } @Override public Boolean nowInTimePoint(Long pointId) { XpTestPoint xpPoint = this.getById(pointId); if(null == xpPoint){ return false; } Integer operationType = xpPoint.getOperationType(); if(1 == operationType){ //与运营区同步 XpElectronicFenceArea xpElectronicFenceArea = xpElectronicFenceAreaService.getById(xpPoint.getElectronicAreaId()); if(null == xpElectronicFenceArea){ return false; } XpElectronicFence xpElectronicFence = xpElectronicFenceService.getById(xpElectronicFenceArea.getElectronicId()); if(null == xpElectronicFence){ return false; } //失效类型 1=永不失效 2=定时失效 Integer failureType = xpElectronicFence.getFailureType(); //永不失效,但是还未到开始时间 if(1 == failureType && LocalDateTime.now().isBefore(xpElectronicFence.getEffectTime())){ return false; }else if(2 == failureType && (LocalDateTime.now().isBefore(xpElectronicFence.getEffectTime()) || LocalDateTime.now().isAfter(xpElectronicFence.getFailureTime()))){ //定时失效,但是当前时间不在时间范围内 return false; } }else{ //自定义时间段 // 判断是否在时间段内 boolean intime = getInTime(LocalTime.now(), xpPoint.getEffectivePeriod(), xpPoint.getEffectiveTimePeriod()); if (!intime) { return false; } } return true; } } xp-robotaxi-operation-boot/src/main/resources/mapper/operation/XpTestPointMapper.xml
New file @@ -0,0 +1,158 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.xiaopeng.operation.mapper.XpTestPointMapper"> <!-- 通用查询映射结果 --> <resultMap id="BaseResultMap" type="com.xiaopeng.api.model.operation.XpTestPoint"> <id column="id" property="id" /> <result column="point_name" property="pointName" /> <result column="point_poi" property="pointPoi" /> <result column="point_number" property="pointNumber" /> <result column="operation_status" property="operationStatus" /> <result column="point_type" property="pointType" /> <result column="verification_status" property="verificationStatus" /> <result column="parking_time_limit" property="parkingTimeLimit" /> <result column="operation_type" property="operationType" /> <result column="effective_period" property="effectivePeriod" /> <result column="effective_time_period" property="effectiveTimePeriod" /> <result column="remarks" property="remarks" /> <result column="point_pictures" property="pointPictures" /> <result column="point_lon" property="pointLon" /> <result column="point_lat" property="pointLat" /> <result column="is_deleted" property="deleted" /> <result column="create_time" property="createTime" /> <result column="update_time" property="updateTime" /> <result column="create_by" property="createBy" /> <result column="update_by" property="updateBy" /> </resultMap> <!-- 通用查询结果列 --> <sql id="Base_Column_List"> id,electronic_area_id, point_name, point_poi, point_number, operation_status, point_type, verification_status, parking_time_limit, operation_type, effective_period, effective_time_period, remarks, point_pictures, point_lon, point_lat, is_deleted, create_time, update_time, create_by, update_by </sql> <select id="pointMap" resultType="com.xiaopeng.api.model.operation.XpTestPoint"> select t1.*, ROUND( 6378.138 * 2 * ASIN( SQRT( POW( SIN( ( #{query.lat} * PI() / 180 - t1.point_lat * PI() / 180 ) / 2 ), 2 ) + COS(#{query.lat} * PI() / 180) * COS(t1.point_lat * PI() / 180) * POW( SIN( ( #{query.lon} * PI() / 180 - t1.point_lon * PI() / 180 ) / 2 ), 2 ) ) ) * 1000 ) AS distance from xp_test_point t1 where t1.is_deleted = 0 <if test="query.pointName != null and query.pointName != ''"> and t1.point_name like concat('%',#{query.pointName},'%') </if> <if test="query.pointType != null"> and t1.point_type = #{query.pointType} </if> <if test="query.operationStatus != null"> and t1.operation_status = #{query.operationStatus} </if> order by distance asc </select> <select id="listAll" resultType="com.xiaopeng.api.model.operation.XpTestPoint"> select t1.* from xp_test_point t1 where t1.is_deleted = 0 <if test="query.queryParams != null and query.queryParams != ''"> and ( t1.point_name like concat('%',#{query.queryParams},'%') or t1.point_poi like concat('%',#{query.queryParams},'%') or t1.point_number like concat('%',#{query.queryParams},'%') ) </if> <if test="query.pointType != null"> and t1.point_type = #{query.pointType} </if> <if test="query.cityCode != null and query.cityCode != ''"> and t1.city_code = #{query.cityCode} </if> <if test="query.operationStatusIds != null and query.operationStatusIds.size()>0"> AND t1.operation_status IN <foreach collection="query.operationStatusIds" separator="," item="id" open="(" close=")"> #{id} </foreach> </if> order by t1.create_time desc </select> <select id="queryPointByName" resultType="com.xiaopeng.api.vo.order.XpPointsListVo"> select p.id,p.operation_type as operationType ,p.electronic_area_id as electronicAreaId,p.point_name as name,p.point_address as address,p.point_lon as longitude,p.point_lat as latitude,p.effective_period,p.effective_time_period from xp_electronic_fence_area xefa left join xp_test_point p on p.electronic_area_id = xefa.id where p.is_deleted = 0 and p.operation_status =2 and xefa.is_deleted = 0 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},'%') or p.point_name like concat('%',#{query.pointPoi},'%') ) </if> <if test="query.electronicAreaId != null"> and p.electronic_area_id = #{query.electronicAreaId} </if> </select> <select id="pageList" resultType="com.xiaopeng.api.model.operation.XpTestPoint"> select xp.id,xp.point_number as pointNumber,xp.point_name as pointName,xp.point_poi as pointPoi, xp.point_address as pointAddress, xp.point_lon as pointLon,xp.point_lat as pointLat,xp.create_time as createTime,xp.create_by as createBy ,xp.parking_time_limit as parkingTimeLimit,xp.verification_status as verificationStatus,xp.operation_status as operationStatus from xp_test_point xp where xp.is_deleted = 0 <if test="query.pointName != null and query.pointName != ''"> and xp.point_name like concat('%',#{query.pointName},'%') </if> <if test="query.pointNumber != null and query.pointNumber != ''"> and xp.point_number like concat('%',#{query.pointNumber},'%') </if> <if test="query.createBy != null and query.createBy != ''"> and xp.create_by like concat('%',#{query.createBy},'%') </if> <if test="query.parkingTimeLimit != null"> and xp.parking_time_limit = #{query.parkingTimeLimit} </if> <if test="query.pointLonAndLat != null and query.pointLonAndLat != ''"> and #{query.pointLonAndLat} like concat('%',xp.point_lon,'%') and #{query.pointLonAndLat} like concat('%',xp.point_lat,'%') </if> <if test="query.startTime != null and query.startTime != '' and query.endTime != null and query.endTime != ''"> and xp.create_time between #{query.startTime} and #{query.endTime} </if> <if test="query.operationStatusList != null and query.operationStatusList.size() > 0"> <trim prefix="and (" suffix=")" prefixOverrides="OR"> <foreach collection="query.operationStatusList" item="st"> <choose> <when test="st == 1">OR xp.verification_status = 1</when> <when test="st == 2">OR xp.verification_status = 2</when> <when test="st == 3">OR xp.verification_status = 4</when> <when test="st == 4">OR (xp.verification_status = 3 and xp.operation_status = 1)</when> <when test="st == 5">OR (xp.verification_status = 5 and xp.operation_status = 1)</when> <when test="st == 6">OR xp.operation_status = 2</when> <when test="st == 7">OR xp.operation_status = 3</when> <when test="st == 8">OR xp.operation_status = 4</when> <otherwise>OR 1 = 0</otherwise> </choose> </foreach> </trim> </if> order by xp.create_time desc </select> </mapper> xp-robotaxi-operation-boot/src/main/resources/mapper/operation/XpWhitelistMapper.xml
@@ -11,7 +11,6 @@ ,create_time as createTime,update_time as updateTime,create_by as createBy,update_by as updateBy from xp_whitelist where is_deleted = 0 group by account <if test="query.account != null and query.account != ''"> and account like concat('%',#{query.account},'%') </if> @@ -21,6 +20,7 @@ <if test="query.whitelistSource != null"> and whitelist_source = #{query.whitelistSource} </if> group by account order by create_time desc </select> <select id="exportList" resultType="com.xiaopeng.api.model.operation.XpWhitelist"> xp-robotaxi-order-boot/src/main/java/com/xiaopeng/order/model/vo/XpOrderDetailVO.java
@@ -196,4 +196,6 @@ @ApiModelProperty(value = "纬度") private Double latitude; } @ApiModelProperty(value = "后备箱状态(1=打开,2=关闭)") private Integer openTrunk; } xp-robotaxi-order-boot/src/main/java/com/xiaopeng/order/service/impl/XpOrderServiceImpl.java
@@ -27,6 +27,7 @@ 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.dto.vehicleConvoy.VehicleTemperatureDto; import com.xiaopeng.api.feignClient.account.UserResourcesClient; import com.xiaopeng.api.feignClient.account.XpAppUserCouponClient; import com.xiaopeng.api.feignClient.automaticPilot.OrderMissionClient; @@ -36,10 +37,7 @@ import com.xiaopeng.api.feignClient.operation.XpPricingClient; import com.xiaopeng.api.feignClient.operation.XpSystemSettingClient; import com.xiaopeng.api.feignClient.pushMessage.XpPushMessageClient; import com.xiaopeng.api.feignClient.vehicleConvoy.UserVehicleClient; import com.xiaopeng.api.feignClient.vehicleConvoy.XpFleetClient; import com.xiaopeng.api.feignClient.vehicleConvoy.XpFleetVehicleClient; import com.xiaopeng.api.feignClient.vehicleConvoy.XpVehicleClient; import com.xiaopeng.api.feignClient.vehicleConvoy.*; import com.xiaopeng.api.model.maintenance.XpTaskRule; import com.xiaopeng.api.model.operation.*; import com.xiaopeng.api.model.order.*; @@ -757,32 +755,50 @@ * 关闭订单 */ private void closeOrder(XpOrder order) { // 更新订单状态为已完成(8) this.lambdaUpdate().set(XpOrder::getStatus, 7) .eq(XpOrder::getId, order.getId()).update(); XpVehicle xpVehicle = xpVehicleClient.queryById(order.getVehicleId()).getData(); order.setStatus(7); order.setGetoffTime(LocalDateTime.now()); // 解析下车地点 VehiclePosition vehiclePosition = mongoTemplate.findOne(new Query(Criteria.where("vin").is(xpVehicle.getVehicleVin())), VehiclePosition.class); if(Objects.nonNull(vehiclePosition)){ GeoJsonPoint point = vehiclePosition.getPoint(); if(Objects.nonNull(point)){ double x = point.getX(); double y = point.getY(); Map<String, String> geocode = gdMapGeocodingUtil.geocode(String.valueOf(x), String.valueOf(y)); order.setGetoffAddress(geocode.get("address")); } } //计算行驶总距离和时长 List<OrderTrajectory> orderTrajectoryList = mongoTemplate.find(new Query().addCriteria(Criteria.where("orderId").is(order.getId())), OrderTrajectory.class); Double reduce = orderTrajectoryList.stream().map(OrderTrajectory::getDistance).reduce(0.0, Double::sum); order.setMileageKilometers(new BigDecimal(reduce).divide(new BigDecimal(1000)).setScale(4, RoundingMode.HALF_EVEN).doubleValue()); long duration = LocalDateTime.now().toEpochSecond(ZoneOffset.of("+8")) - order.getTripBegin().toEpochSecond(ZoneOffset.of("+8")); order.setDuration(new BigDecimal(duration).divide(new BigDecimal(60), 2, RoundingMode.HALF_EVEN).doubleValue()); Long appUserId = order.getAppUserId(); order.setAppUserId(null); this.updateById(order); //结束行程 endTrip(order.getId(), order.getAppUserId().toString()); // 消息推送 Map<String, Object> params = new HashMap<>(); Map<String, Object> content = new HashMap<>(); content.put("orderId", order.getId().toString()); content.put("status", OrderStatusEnum.APPROVAL_REJECTION.getCode()); params.put("type", PushMessageTypeEnum.ORDER_STATUS.getDesc()); params.put("content", com.alibaba.fastjson2.JSONObject.toJSONString(content)); params.put("timestamp", new Date().getTime() + ""); String message = JSONObject.toJSONString(params); SendMessageDTO sendMessageDTO = new SendMessageDTO(); sendMessageDTO.setMessage(message); sendMessageDTO.setAppUserId(String.valueOf(order.getAppUserId())); R<String> stringR = xpPushMessageClient.sendStatus(sendMessageDTO); Map<String, Object> params1 = new HashMap<>(); Map<String, Object> content1 = new HashMap<>(); content1.put("orderId", order.getId().toString()); content1.put("status", OrderStatusEnum.SEE_OFF_GUESTS.getCode()); params1.put("type", PushMessageTypeEnum.ORDER_STATUS.getDesc()); params1.put("content", JSON.toJSONString(content1)); params1.put("timestamp", new Date().getTime() + ""); String message1 = JSON.toJSONString(params1); SendMessageDTO sendMessageDTO1 = new SendMessageDTO(); sendMessageDTO1.setMessage(message1); sendMessageDTO1.setAppUserId(appUserId.toString()); R<String> stringR1 = xpPushMessageClient.sendStatus(sendMessageDTO1); //推送失败,重试3次 if(stringR.getCode() != Constants.SUCCESS){ if(stringR1.getCode() != Constants.SUCCESS){ ThreadPoolExecutor executor = new ThreadPoolExecutor(1, 1, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>()); executor.execute(() -> { for (int i = 0; i < 3; i++) { R<String> stringR1 = xpPushMessageClient.sendStatus(sendMessageDTO); if(stringR1.getCode() == Constants.SUCCESS){ R<String> stringR2 = xpPushMessageClient.sendStatus(sendMessageDTO1); if(stringR2.getCode() == Constants.SUCCESS){ break; } try { @@ -790,11 +806,99 @@ } catch (InterruptedException e) { throw new RuntimeException(e); } log.info("运维人员关闭订单推送订单状态消息失败:{} {} {}", stringR1.getMsg(), JSON.toJSONString(sendMessageDTO), order.getOrderNumber()); log.info("运维人员关闭订单推送订单状态消息失败:{} {} {}", stringR2.getMsg(), JSON.toJSONString(sendMessageDTO1), order.getOrderNumber()); } }); } log.info("订单关闭成功,订单ID: {}, 操作人: {}", order.getId(), SecurityUtils.getUsername()); // 推送倒计时消息 Map<String, Object> params = new HashMap<>(); Map<String, Object> content = new HashMap<>(); content.put("orderId", order.getId().toString()); content.put("isOpen", 1); params.put("type", PushMessageTypeEnum.OPEN_TRUNK.getDesc()); params.put("content", JSON.toJSONString(content)); params.put("timestamp", new Date().getTime() + ""); String message = JSON.toJSONString(params); SendMessageDTO sendMessageDTO = new SendMessageDTO(); sendMessageDTO.setMessage(message); sendMessageDTO.setAppUserId(appUserId.toString()); R<String> stringR = xpPushMessageClient.sendStatus(sendMessageDTO); //推送失败,重试3次 if(stringR.getCode() != Constants.SUCCESS){ ThreadPoolExecutor executor = new ThreadPoolExecutor(1, 1, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>()); executor.execute(() -> { for (int i = 0; i < 3; i++) { R<String> stringR2 = xpPushMessageClient.sendStatus(sendMessageDTO); if(stringR2.getCode() == Constants.SUCCESS){ break; } try { Thread.sleep(1000); } catch (InterruptedException e) { throw new RuntimeException(e); } log.info("推送倒计时消息失败:{} {} {}", stringR2.getMsg(), JSON.toJSONString(sendMessageDTO), order.getOrderNumber()); } }); } //给XPU推送订单取消的报文 PushOrderDto pushOrderDto = new PushOrderDto(); pushOrderDto.setOrderId(order.getId().toString()); pushOrderDto.setVin(xpVehicle.getVehicleVin()); pushOrderDto.setOperation_type(OrderOperationType.CLOUD_CANCEL_ORDER); orderMissionClient.cancelOrder(pushOrderDto); //结束行程,修改状态和计算费用 endTrip(order.getId(), appUserId.toString()); // 消息推送 Map<String, Object> params2 = new HashMap<>(); Map<String, Object> content2 = new HashMap<>(); content2.put("orderId", order.getId().toString()); content2.put("status", OrderStatusEnum.APPROVAL_REJECTION.getCode()); params2.put("type", PushMessageTypeEnum.ORDER_STATUS.getDesc()); params2.put("content", JSON.toJSONString(content2)); params2.put("timestamp", new Date().getTime() + ""); String message2 = JSON.toJSONString(params2); SendMessageDTO sendMessageDTO2 = new SendMessageDTO(); sendMessageDTO2.setMessage(message2); sendMessageDTO2.setAppUserId(appUserId.toString()); R<String> stringR2 = xpPushMessageClient.sendStatus(sendMessageDTO2); //推送失败,重试3次 if(stringR2.getCode() != Constants.SUCCESS){ ThreadPoolExecutor executor = new ThreadPoolExecutor(1, 1, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>()); executor.execute(() -> { for (int i = 0; i < 3; i++) { R<String> stringR3 = xpPushMessageClient.sendStatus(sendMessageDTO2); if(stringR3.getCode() == Constants.SUCCESS){ break; } try { Thread.sleep(1000); } catch (InterruptedException e) { throw new RuntimeException(e); } log.info("运维人员关闭订单推送订单状态消息失败:{} {} {}", stringR3.getMsg(), JSON.toJSONString(sendMessageDTO1), order.getOrderNumber()); } }); } //创建定时任务执行延迟驶离终点和下发巡游单 XpPoint point = xpPointClient.queryById(order.getEndPointId()).getData(); Map<String, ? extends Object> jobMaps = new ImmutableMap.Builder<String, String>() .put("id", order.getId().toString()) .put("appid", appid) .build(); QuartzManager.addJob( AddCruiseMissionJob.class, (AddCruiseMissionJob.name + order.getId()).toUpperCase(), TimeJobType.ADD_CRUISE_MISSION, DateUtils.localDateTimeToDate(LocalDateTime.now().plusMinutes(point.getParkingTimeLimit())), jobMaps ); } /** @@ -1260,12 +1364,13 @@ try { redisService.removeByPattern(order.getQueueName(), order.getOrderNumber()); } catch (Exception e) { e.printStackTrace(); } //判断还原车辆状态 if (null == order.getVehicleId()) { Object cacheObject1 = redisService.getCacheObject("CREATE_ORDER:" + order.getId().toString()); if (null != cacheObject1) { com.alibaba.fastjson2.JSONObject jsonObject = com.alibaba.fastjson2.JSON.parseObject(cacheObject1.toString()); JSONObject jsonObject = JSON.parseObject(cacheObject1.toString()); String vin = jsonObject.getString("vin"); XpVehicle vehicle = xpVehicleClient.findByVehicleVin(vin).getData(); if (null != vehicle && 0 != vehicle.getState()) { @@ -2531,7 +2636,7 @@ public void saveVehicleLocation(OrderTrajectory orderTrajectory) { // 查询订单信息 Integer status = redisService.getCacheObject("ORDER_STATUS:" + orderTrajectory.getOrderId()); if(status != 6){ if(status < 6){ return; } @@ -2543,7 +2648,7 @@ // 存储mongo数据 mongoTemplate.save(orderTrajectory); // 存储首次定位 redisService.setCacheObject(CacheConstants.ORDER_OLD_LOCATION + orderTrajectory.getOrderId(), orderTrajectory.getLocation()); redisService.setCacheObject(CacheConstants.ORDER_OLD_LOCATION + orderTrajectory.getOrderId(), orderTrajectory.getLocation(), 1L, TimeUnit.HOURS); } else { Map<String, Double> distance = GeodesyUtil.getDistance(orderTrajectory.getLocation(), oldLocation); if (null != distance) { @@ -2553,7 +2658,7 @@ // 存储mongo数据 mongoTemplate.save(orderTrajectory); // 更新定位 redisService.setCacheObject(CacheConstants.ORDER_OLD_LOCATION + orderTrajectory.getOrderId(), orderTrajectory.getLocation()); redisService.setCacheObject(CacheConstants.ORDER_OLD_LOCATION + orderTrajectory.getOrderId(), orderTrajectory.getLocation(), 1L, TimeUnit.HOURS); } else { log.error("调用高德计算距离出错"); } @@ -2903,7 +3008,14 @@ xpOrderDetailVO.setPlateNumber(vehicle.getPlateNumber()); xpOrderDetailVO.setVehiclePictures(vehicle.getVehiclePictures()); } Integer status = xpOrder.getStatus(); if(status == 4 || status == 7 || status == 8){ Boolean data = xpVehicleClient.getVehicleTrunkOpenStatus(xpOrder.getAppUserId(), xpOrder.getVehicleId()).getData(); xpOrder.setOpenTrunk(data ? 1 : 2); xpOrderDetailVO.setOpenTrunk(data ? 1 : 2); xpOrder.setAppUserId(null); this.updateById(xpOrder); } return xpOrderDetailVO; } xp-robotaxi-vehicle-convoy-boot/src/main/java/com/xiaopeng/vehicleConvoy/controller/XpVehicleController.java
@@ -24,6 +24,7 @@ import com.xiaopeng.api.model.vehicleConvoy.XpVehicle; import com.xiaopeng.api.model.vehicleConvoy.XpVehicleAnnualRecord; import com.xiaopeng.api.vo.automaticPilot.VehiclePosition; import com.xiaopeng.api.vo.vehicleConvoy.VehicleStateVo; import com.xiaopeng.api.vo.vehicleConvoy.VehiclesCommandCallbackVo; import com.xiaopeng.common.core.domain.R; import com.xiaopeng.common.core.exception.ServiceException; @@ -954,7 +955,7 @@ /** * 业务流程-车门解锁/后备箱解锁 */ @ApiOperation(value = "打开车门解锁/后备箱解锁", tags = {"小程序-业务流程"}) @ApiOperation(value = "打开车门解锁/后备箱开关车门", tags = {"小程序-业务流程"}) @PostMapping("/api/v1/mini-program/order/vehicle/unlock") public R<Integer> unlock(@RequestBody UnlockAppletDTO dto) { return R.ok(xpVehicleService.unlock(dto)); @@ -974,10 +975,11 @@ */ @ApiOperation(value = "通过订单id查询当前车辆温度", tags = {"小程序-业务流程"}) @GetMapping("/api/v1/mini-program/order/queryTemperatureByOrderId") public R<VehicleTemperatureDto> queryTemperatureByOrderId(@RequestParam Long orderId, HttpServletRequest request) { public R<String> queryTemperatureByOrderId(@RequestParam Long orderId, HttpServletRequest request) { String uid = request.getHeader("XP-Uid"); VehicleTemperatureDto vehicleTemperatureDto = xpVehicleService.queryTemperatureByOrderId(orderId,uid); return R.ok(vehicleTemperatureDto); VehicleStateVo hvacInnerTemp = vehicleTemperatureDto.getStateMap().get("hvacInnerTemp"); return R.ok(hvacInnerTemp.getValue()); } /** @@ -1016,4 +1018,17 @@ collection.drop(); return R.ok(); } /** * 获取车辆后备箱开关状态 * @param uid * @param id * @return */ @PostMapping("/inner/vi/vehicle/getVehicleTrunkOpenStatus") public R<Boolean> getVehicleTrunkOpenStatus(@RequestParam("uid") Long uid, @RequestParam("id") Long id){ Boolean vehicleTrunkOpenStatus = xpVehicleService.getVehicleTrunkOpenStatus(uid, id); return R.ok(vehicleTrunkOpenStatus); } } xp-robotaxi-vehicle-convoy-boot/src/main/java/com/xiaopeng/vehicleConvoy/service/IXpVehicleService.java
@@ -8,6 +8,7 @@ import com.xiaopeng.vehicleConvoy.model.importExcel.XpVehicleImportExcel; import com.xiaopeng.vehicleConvoy.model.query.*; import com.xiaopeng.vehicleConvoy.model.vo.XpVehicleVO; import org.springframework.web.bind.annotation.RequestParam; import java.util.List; @@ -173,4 +174,12 @@ * @param query@return */ PageInfo<XpVehicleVO> getVehiclePageList(VehicleSelectPageQuery query); /** * 获取车辆后备箱是否打开状态 * @param id * @return */ Boolean getVehicleTrunkOpenStatus(Long uid, Long id); } xp-robotaxi-vehicle-convoy-boot/src/main/java/com/xiaopeng/vehicleConvoy/service/impl/XpVehicleServiceImpl.java
@@ -23,7 +23,7 @@ import com.xiaopeng.api.model.vehicleConvoy.*; import com.xiaopeng.api.vo.automaticPilot.VehiclePosition; import com.xiaopeng.api.vo.operation.ElectronicFenceDetailVo; import com.xiaopeng.api.vo.vehicleConvoy.VehiclesCommandEnum; import com.xiaopeng.api.vo.vehicleConvoy.VehicleStateVo;import com.xiaopeng.api.vo.vehicleConvoy.VehiclesCommandEnum; import com.xiaopeng.api.vo.vehicleConvoy.VehiclesCommandParamVo; import com.xiaopeng.api.vo.vehicleConvoy.VehiclesCommandVo; import com.xiaopeng.common.core.constant.CacheConstants; @@ -248,30 +248,30 @@ if (Objects.isNull(xpVehicle)) { throw new ServiceException("未查询到有效车辆信息", I18nKeyConstant.VEHICLE_NOT_EXISTS); } // 判断距离是否在范围之内 4米 // VehiclePosition vehiclePosition = mongoTemplate.findOne(new Query(Criteria.where("vin").is(xpVehicle.getVehicleVin())), VehiclePosition.class); // if (Objects.nonNull(vehiclePosition)) { // GeoJsonPoint point = vehiclePosition.getPoint(); // if(Objects.nonNull(point)){ // Map<String, Double> distance = GeodesyUtil.getDistance(dto.getLongitude()+ "," + dto.getLatitude(), point.getX()+","+point.getY()); // if (null != distance) { // Double distance1 = distance.get("WGS84"); // if (distance1 > 4) { // throw new ServiceException("距离过远,无法打开", I18nKeyConstant.VEHICLE_DISTANCE_TOO_LONG); // } // }else { // throw new ServiceException("距离过远,无法打开", I18nKeyConstant.VEHICLE_DISTANCE_TOO_LONG); // } // }else { // throw new ServiceException("距离过远,无法打开", I18nKeyConstant.VEHICLE_DISTANCE_TOO_LONG); // } // } // 判断距离是否在范围之内 15米 VehiclePosition vehiclePosition = mongoTemplate.findOne(new Query(Criteria.where("vin").is(xpVehicle.getVehicleVin())), VehiclePosition.class); if (Objects.nonNull(vehiclePosition)) { GeoJsonPoint point = vehiclePosition.getPoint(); if(Objects.nonNull(point)){ Map<String, Double> distance = GeodesyUtil.getDistance(dto.getLongitude()+ "," + dto.getLatitude(), point.getX()+","+point.getY()); if (null != distance) { Double distance1 = distance.get("WGS84"); if (distance1 > 10) { throw new ServiceException("距离过远,无法打开", I18nKeyConstant.VEHICLE_DISTANCE_TOO_LONG); } }else { throw new ServiceException("距离过远,无法打开", I18nKeyConstant.VEHICLE_DISTANCE_TOO_LONG); } }else { throw new ServiceException("距离过远,无法打开", I18nKeyConstant.VEHICLE_DISTANCE_TOO_LONG); } } // 车门解锁、后备箱解锁 VehiclesCommandVo vehiclesCommandVo = new VehiclesCommandVo(); vehiclesCommandVo.setVin(xpVehicle.getVehicleVin()); if ("door".equals(dto.getDoorType())) { // 开启车门 判断是否为P档 Integer gearLevel = redisService.getCacheObject(CacheConstants.GEAR_LEVEL + xpVehicle.getVehicleVin()); Integer gearLevel = redisService.getCacheObject(CacheConstants.GEAR_LEVEL + xpVehicle.getXpuId()); if (gearLevel == null || gearLevel != 4) { throw new ServiceException("车辆非P档,无法开启车门", I18nKeyConstant.VEHICLE_NOT_P_GEAR); } @@ -280,29 +280,15 @@ // 开启后备箱 判断是否为P档 Integer gearLevel = redisService.getCacheObject(CacheConstants.GEAR_LEVEL + xpVehicle.getXpuId()); if (gearLevel == null || gearLevel != 4) { throw new ServiceException("车辆非P档,无法开启后备箱", I18nKeyConstant.VEHICLE_NOT_P_GEAR); throw new ServiceException("车辆非P档,无法操作后备箱", I18nKeyConstant.VEHICLE_NOT_P_GEAR); } vehiclesCommandVo.setCommandCode(VehiclesCommandEnum.DOOR_TRUNK_OPEN.getCommand()); if(xpOrder.getOpenTrunk()==0){ xpOrder.setOpenTrunk(1); vehiclesCommandVo.setCommandCode(VehiclesCommandEnum.DOOR_TRUNK_OPEN.getCommand()); } if(xpOrder.getOpenTrunk()==1){ if(xpOrder.getOpenTrunk()==1) { xpOrder.setOpenTrunk(2); // 添加定时任务 // xpOrderClient.updateOrderStatus(xpOrder.getId(),7); // // 推送倒计时消息 消息推送 // Map<String, Object> params = new HashMap<>(); // Map<String, Object> content = new HashMap<>(); // content.put("orderId", xpOrder.getId().toString()); // content.put("isOpen", 1); // params.put("type", PushMessageTypeEnum.OPEN_TRUNK.getDesc()); // params.put("content", JSONObject.toJSONString(content)); // params.put("timestamp", new Date().getTime() + ""); // String message = JSONObject.toJSONString(params); // SendMessageDTO sendMessageDTO = new SendMessageDTO(); // sendMessageDTO.setMessage(message); // sendMessageDTO.setAppUserId(String.valueOf(xpOrder.getAppUserId())); // xpPushMessageClient.sendStatus(sendMessageDTO); vehiclesCommandVo.setCommandCode(VehiclesCommandEnum.DOOR_TRUNK_CLOSE.getCommand()); } } try { @@ -1001,7 +987,7 @@ throw new ServiceException("未查询到有效订单信息", I18nKeyConstant.ORDER_NOT_EXISTS); } XpVehicle xpVehicle = this.getById(xpOrder.getVehicleId()); if (Objects.isNull(xpVehicle)) { if (Objects.isNull(xpVehicle) || Objects.isNull(xpVehicle.getVehicleVin())) { throw new ServiceException("未查询到有效车辆信息", I18nKeyConstant.VEHICLE_NOT_EXISTS); } try { @@ -1023,4 +1009,22 @@ pageInfo.setRecords(page.getRecords()); return pageInfo; } @Override public Boolean getVehicleTrunkOpenStatus(Long uid, Long id) { XpVehicle xpVehicle = this.getById(id); try { VehicleTemperatureDto vehicleTemperatureDto = vehicleControlUtil.queryVehicleTemperature(uid, xpVehicle.getVehicleVin()); log.info("查询车辆温度成功:{}", vehicleTemperatureDto); VehicleStateVo trunkAjarCloseSt = vehicleTemperatureDto.getStateMap().get("trunkAjarCloseSt"); if(null == trunkAjarCloseSt){ return false; } return trunkAjarCloseSt.getValue().equals("1"); } catch (Exception e) { log.error("查询车辆温度失败", e); return false; } } } xp-robotaxi-vehicle-convoy-boot/src/main/java/com/xiaopeng/vehicleConvoy/util/VehicleControlUtil.java
@@ -42,6 +42,7 @@ public VehicleTemperatureDto queryVehicleTemperature(String uid, String vin) { String nonce = System.currentTimeMillis() + ""; Set<String> stateList = Collections.singleton("hvacInnerTemp"); stateList.add("trunkAjarCloseSt"); Map<String, String> map = new HashMap<>(); map.put("nonce", nonce); map.put("openId", OPEN_ID_ROBOT_TAXI);