Merge remote-tracking branch 'origin/master'
| | |
| | | ALTER TABLE `xp_clock_in_0` MODIFY COLUMN `clock_in_result` int NULL DEFAULT NULL COMMENT '上班打卡结果 1=正常 2=迟到 3=缺卡' AFTER `shift_id`; |
| | | ALTER TABLE `xp_vehicle_detection_0` MODIFY COLUMN `network_detection` int NULL DEFAULT NULL COMMENT '网络检测' AFTER `vehicle_id`; |
| | | |
| | | ALTER TABLE `xp_clock_in_0` MODIFY COLUMN `clock_in_lon` double(20, 10) NULL DEFAULT NULL COMMENT '上班打卡经度' AFTER `clock_in_result`; |
| | | ALTER TABLE `xp_vehicle_detection_0` MODIFY COLUMN `version_verification` int NULL DEFAULT NULL COMMENT '版本核对' AFTER `network_detection`; |
| | | |
| | | ALTER TABLE `xp_clock_in_0` MODIFY COLUMN `clock_in_lat` double(20, 10) NULL DEFAULT NULL COMMENT '上班打卡纬度' AFTER `clock_in_lon`; |
| | | ALTER TABLE `xp_vehicle_detection_0` MODIFY COLUMN `communication_self_check` int NULL DEFAULT NULL COMMENT '通讯自检' AFTER `version_verification`; |
| | | |
| | | ALTER TABLE `xp_clock_in_0` MODIFY COLUMN `clock_out_result` int NULL DEFAULT NULL COMMENT '下班打卡结果 1=正常 2=迟到 3=缺卡' AFTER `update_by`; |
| | | ALTER TABLE `xp_vehicle_detection_0` MODIFY COLUMN `remote_self_check` int NULL DEFAULT NULL COMMENT '远程自检' AFTER `communication_self_check`; |
| | | |
| | | ALTER TABLE `xp_clock_in_0` MODIFY COLUMN `clock_in_address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '上班打卡地址' AFTER `clock_out_lat`; |
| | | ALTER TABLE `xp_vehicle_detection_0` MODIFY COLUMN `collision_prevention` int NULL DEFAULT NULL COMMENT '防撞激活' AFTER `remote_self_check`; |
| | | |
| | | ALTER TABLE `xp_clock_in_1` MODIFY COLUMN `clock_in_result` int NULL DEFAULT NULL COMMENT '上班打卡结果 1=正常 2=迟到 3=缺卡' AFTER `shift_id`; |
| | | ALTER TABLE `xp_vehicle_detection_0` MODIFY COLUMN `sensor_self_check` int NULL DEFAULT NULL COMMENT '传感器自检' AFTER `collision_prevention`; |
| | | |
| | | ALTER TABLE `xp_clock_in_1` MODIFY COLUMN `clock_in_lon` double(20, 10) NULL DEFAULT NULL COMMENT '上班打卡经度' AFTER `clock_in_result`; |
| | | ALTER TABLE `xp_vehicle_detection_1` MODIFY COLUMN `network_detection` int NULL DEFAULT NULL COMMENT '网络检测' AFTER `vehicle_id`; |
| | | |
| | | ALTER TABLE `xp_clock_in_1` MODIFY COLUMN `clock_in_lat` double(20, 10) NULL DEFAULT NULL COMMENT '上班打卡纬度' AFTER `clock_in_lon`; |
| | | ALTER TABLE `xp_vehicle_detection_1` MODIFY COLUMN `version_verification` int NULL DEFAULT NULL COMMENT '版本核对' AFTER `network_detection`; |
| | | |
| | | ALTER TABLE `xp_clock_in_1` MODIFY COLUMN `clock_out_result` int NULL DEFAULT NULL COMMENT '下班打卡结果 1=正常 2=迟到 3=缺卡' AFTER `update_by`; |
| | | ALTER TABLE `xp_vehicle_detection_1` MODIFY COLUMN `communication_self_check` int NULL DEFAULT NULL COMMENT '通讯自检' AFTER `version_verification`; |
| | | |
| | | ALTER TABLE `xp_clock_in_1` MODIFY COLUMN `clock_in_address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '上班打卡地址' AFTER `clock_out_lat`; |
| | | ALTER TABLE `xp_vehicle_detection_1` MODIFY COLUMN `remote_self_check` int NULL DEFAULT NULL COMMENT '远程自检' AFTER `communication_self_check`; |
| | | |
| | | ALTER TABLE `xp_clock_in_2` MODIFY COLUMN `clock_in_result` int NULL DEFAULT NULL COMMENT '上班打卡结果 1=正常 2=迟到 3=缺卡' AFTER `shift_id`; |
| | | ALTER TABLE `xp_vehicle_detection_1` MODIFY COLUMN `collision_prevention` int NULL DEFAULT NULL COMMENT '防撞激活' AFTER `remote_self_check`; |
| | | |
| | | ALTER TABLE `xp_clock_in_2` MODIFY COLUMN `clock_in_lon` double(20, 10) NULL DEFAULT NULL COMMENT '上班打卡经度' AFTER `clock_in_result`; |
| | | ALTER TABLE `xp_vehicle_detection_1` MODIFY COLUMN `sensor_self_check` int NULL DEFAULT NULL COMMENT '传感器自检' AFTER `collision_prevention`; |
| | | |
| | | ALTER TABLE `xp_clock_in_2` MODIFY COLUMN `clock_in_lat` double(20, 10) NULL DEFAULT NULL COMMENT '上班打卡纬度' AFTER `clock_in_lon`; |
| | | ALTER TABLE `xp_vehicle_detection_2` MODIFY COLUMN `network_detection` int NULL DEFAULT NULL COMMENT '网络检测' AFTER `vehicle_id`; |
| | | |
| | | ALTER TABLE `xp_clock_in_2` MODIFY COLUMN `clock_out_result` int NULL DEFAULT NULL COMMENT '下班打卡结果 1=正常 2=迟到 3=缺卡' AFTER `update_by`; |
| | | ALTER TABLE `xp_vehicle_detection_2` MODIFY COLUMN `version_verification` int NULL DEFAULT NULL COMMENT '版本核对' AFTER `network_detection`; |
| | | |
| | | ALTER TABLE `xp_clock_in_2` MODIFY COLUMN `clock_in_address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '上班打卡地址' AFTER `clock_out_lat`; |
| | | ALTER TABLE `xp_vehicle_detection_2` MODIFY COLUMN `communication_self_check` int NULL DEFAULT NULL COMMENT '通讯自检' AFTER `version_verification`; |
| | | |
| | | ALTER TABLE `xp_clock_in_3` MODIFY COLUMN `clock_in_result` int NULL DEFAULT NULL COMMENT '上班打卡结果 1=正常 2=迟到 3=缺卡' AFTER `shift_id`; |
| | | ALTER TABLE `xp_vehicle_detection_2` MODIFY COLUMN `remote_self_check` int NULL DEFAULT NULL COMMENT '远程自检' AFTER `communication_self_check`; |
| | | |
| | | ALTER TABLE `xp_clock_in_3` MODIFY COLUMN `clock_in_lon` double(20, 10) NULL DEFAULT NULL COMMENT '上班打卡经度' AFTER `clock_in_result`; |
| | | ALTER TABLE `xp_vehicle_detection_2` MODIFY COLUMN `collision_prevention` int NULL DEFAULT NULL COMMENT '防撞激活' AFTER `remote_self_check`; |
| | | |
| | | ALTER TABLE `xp_clock_in_3` MODIFY COLUMN `clock_in_lat` double(20, 10) NULL DEFAULT NULL COMMENT '上班打卡纬度' AFTER `clock_in_lon`; |
| | | ALTER TABLE `xp_vehicle_detection_2` MODIFY COLUMN `sensor_self_check` int NULL DEFAULT NULL COMMENT '传感器自检' AFTER `collision_prevention`; |
| | | |
| | | ALTER TABLE `xp_clock_in_3` MODIFY COLUMN `clock_out_result` int NULL DEFAULT NULL COMMENT '下班打卡结果 1=正常 2=迟到 3=缺卡' AFTER `update_by`; |
| | | ALTER TABLE `xp_vehicle_detection_3` MODIFY COLUMN `network_detection` int NULL DEFAULT NULL COMMENT '网络检测' AFTER `vehicle_id`; |
| | | |
| | | ALTER TABLE `xp_clock_in_3` MODIFY COLUMN `clock_in_address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '上班打卡地址' AFTER `clock_out_lat`; |
| | | ALTER TABLE `xp_vehicle_detection_3` MODIFY COLUMN `version_verification` int NULL DEFAULT NULL COMMENT '版本核对' AFTER `network_detection`; |
| | | |
| | | ALTER TABLE `xp_clock_in_4` MODIFY COLUMN `clock_in_result` int NULL DEFAULT NULL COMMENT '上班打卡结果 1=正常 2=迟到 3=缺卡' AFTER `shift_id`; |
| | | ALTER TABLE `xp_vehicle_detection_3` MODIFY COLUMN `communication_self_check` int NULL DEFAULT NULL COMMENT '通讯自检' AFTER `version_verification`; |
| | | |
| | | ALTER TABLE `xp_clock_in_4` MODIFY COLUMN `clock_in_lon` double(20, 10) NULL DEFAULT NULL COMMENT '上班打卡经度' AFTER `clock_in_result`; |
| | | ALTER TABLE `xp_vehicle_detection_3` MODIFY COLUMN `remote_self_check` int NULL DEFAULT NULL COMMENT '远程自检' AFTER `communication_self_check`; |
| | | |
| | | ALTER TABLE `xp_clock_in_4` MODIFY COLUMN `clock_in_lat` double(20, 10) NULL DEFAULT NULL COMMENT '上班打卡纬度' AFTER `clock_in_lon`; |
| | | ALTER TABLE `xp_vehicle_detection_3` MODIFY COLUMN `collision_prevention` int NULL DEFAULT NULL COMMENT '防撞激活' AFTER `remote_self_check`; |
| | | |
| | | ALTER TABLE `xp_clock_in_4` MODIFY COLUMN `clock_out_result` int NULL DEFAULT NULL COMMENT '下班打卡结果 1=正常 2=迟到 3=缺卡' AFTER `update_by`; |
| | | ALTER TABLE `xp_vehicle_detection_3` MODIFY COLUMN `sensor_self_check` int NULL DEFAULT NULL COMMENT '传感器自检' AFTER `collision_prevention`; |
| | | |
| | | ALTER TABLE `xp_clock_in_4` MODIFY COLUMN `clock_in_address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '上班打卡地址' AFTER `clock_out_lat`; |
| | | ALTER TABLE `xp_vehicle_detection_4` MODIFY COLUMN `network_detection` int NULL DEFAULT NULL COMMENT '网络检测' AFTER `vehicle_id`; |
| | | |
| | | ALTER TABLE `xp_clock_in_5` MODIFY COLUMN `clock_in_result` int NULL DEFAULT NULL COMMENT '上班打卡结果 1=正常 2=迟到 3=缺卡' AFTER `shift_id`; |
| | | ALTER TABLE `xp_vehicle_detection_4` MODIFY COLUMN `version_verification` int NULL DEFAULT NULL COMMENT '版本核对' AFTER `network_detection`; |
| | | |
| | | ALTER TABLE `xp_clock_in_5` MODIFY COLUMN `clock_in_lon` double(20, 10) NULL DEFAULT NULL COMMENT '上班打卡经度' AFTER `clock_in_result`; |
| | | ALTER TABLE `xp_vehicle_detection_4` MODIFY COLUMN `communication_self_check` int NULL DEFAULT NULL COMMENT '通讯自检' AFTER `version_verification`; |
| | | |
| | | ALTER TABLE `xp_clock_in_5` MODIFY COLUMN `clock_in_lat` double(20, 10) NULL DEFAULT NULL COMMENT '上班打卡纬度' AFTER `clock_in_lon`; |
| | | ALTER TABLE `xp_vehicle_detection_4` MODIFY COLUMN `remote_self_check` int NULL DEFAULT NULL COMMENT '远程自检' AFTER `communication_self_check`; |
| | | |
| | | ALTER TABLE `xp_clock_in_5` MODIFY COLUMN `clock_out_result` int NULL DEFAULT NULL COMMENT '下班打卡结果 1=正常 2=迟到 3=缺卡' AFTER `update_by`; |
| | | ALTER TABLE `xp_vehicle_detection_4` MODIFY COLUMN `collision_prevention` int NULL DEFAULT NULL COMMENT '防撞激活' AFTER `remote_self_check`; |
| | | |
| | | ALTER TABLE `xp_clock_in_5` MODIFY COLUMN `clock_in_address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '上班打卡地址' AFTER `clock_out_lat`; |
| | | ALTER TABLE `xp_vehicle_detection_4` MODIFY COLUMN `sensor_self_check` int NULL DEFAULT NULL COMMENT '传感器自检' AFTER `collision_prevention`; |
| | | |
| | | ALTER TABLE `xp_clock_in_6` MODIFY COLUMN `clock_in_result` int NULL DEFAULT NULL COMMENT '上班打卡结果 1=正常 2=迟到 3=缺卡' AFTER `shift_id`; |
| | | ALTER TABLE `xp_vehicle_detection_5` MODIFY COLUMN `network_detection` int NULL DEFAULT NULL COMMENT '网络检测' AFTER `vehicle_id`; |
| | | |
| | | ALTER TABLE `xp_clock_in_6` MODIFY COLUMN `clock_in_lon` double(20, 10) NULL DEFAULT NULL COMMENT '上班打卡经度' AFTER `clock_in_result`; |
| | | ALTER TABLE `xp_vehicle_detection_5` MODIFY COLUMN `version_verification` int NULL DEFAULT NULL COMMENT '版本核对' AFTER `network_detection`; |
| | | |
| | | ALTER TABLE `xp_clock_in_6` MODIFY COLUMN `clock_in_lat` double(20, 10) NULL DEFAULT NULL COMMENT '上班打卡纬度' AFTER `clock_in_lon`; |
| | | ALTER TABLE `xp_vehicle_detection_5` MODIFY COLUMN `communication_self_check` int NULL DEFAULT NULL COMMENT '通讯自检' AFTER `version_verification`; |
| | | |
| | | ALTER TABLE `xp_clock_in_6` MODIFY COLUMN `clock_out_result` int NULL DEFAULT NULL COMMENT '下班打卡结果 1=正常 2=迟到 3=缺卡' AFTER `update_by`; |
| | | ALTER TABLE `xp_vehicle_detection_5` MODIFY COLUMN `remote_self_check` int NULL DEFAULT NULL COMMENT '远程自检' AFTER `communication_self_check`; |
| | | |
| | | ALTER TABLE `xp_clock_in_6` MODIFY COLUMN `clock_in_address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '上班打卡地址' AFTER `clock_out_lat`; |
| | | ALTER TABLE `xp_vehicle_detection_5` MODIFY COLUMN `collision_prevention` int NULL DEFAULT NULL COMMENT '防撞激活' AFTER `remote_self_check`; |
| | | |
| | | ALTER TABLE `xp_clock_in_7` MODIFY COLUMN `clock_in_result` int NULL DEFAULT NULL COMMENT '上班打卡结果 1=正常 2=迟到 3=缺卡' AFTER `shift_id`; |
| | | ALTER TABLE `xp_vehicle_detection_5` MODIFY COLUMN `sensor_self_check` int NULL DEFAULT NULL COMMENT '传感器自检' AFTER `collision_prevention`; |
| | | |
| | | ALTER TABLE `xp_clock_in_7` MODIFY COLUMN `clock_in_lon` double(20, 10) NULL DEFAULT NULL COMMENT '上班打卡经度' AFTER `clock_in_result`; |
| | | ALTER TABLE `xp_vehicle_detection_6` MODIFY COLUMN `network_detection` int NULL DEFAULT NULL COMMENT '网络检测' AFTER `vehicle_id`; |
| | | |
| | | ALTER TABLE `xp_clock_in_7` MODIFY COLUMN `clock_in_lat` double(20, 10) NULL DEFAULT NULL COMMENT '上班打卡纬度' AFTER `clock_in_lon`; |
| | | ALTER TABLE `xp_vehicle_detection_6` MODIFY COLUMN `version_verification` int NULL DEFAULT NULL COMMENT '版本核对' AFTER `network_detection`; |
| | | |
| | | ALTER TABLE `xp_clock_in_7` MODIFY COLUMN `clock_out_result` int NULL DEFAULT NULL COMMENT '下班打卡结果 1=正常 2=迟到 3=缺卡' AFTER `update_by`; |
| | | ALTER TABLE `xp_vehicle_detection_6` MODIFY COLUMN `communication_self_check` int NULL DEFAULT NULL COMMENT '通讯自检' AFTER `version_verification`; |
| | | |
| | | ALTER TABLE `xp_clock_in_7` MODIFY COLUMN `clock_in_address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '上班打卡地址' AFTER `clock_out_lat`; |
| | | ALTER TABLE `xp_vehicle_detection_6` MODIFY COLUMN `remote_self_check` int NULL DEFAULT NULL COMMENT '远程自检' AFTER `communication_self_check`; |
| | | |
| | | ALTER TABLE `xp_clock_in_8` MODIFY COLUMN `clock_in_result` int NULL DEFAULT NULL COMMENT '上班打卡结果 1=正常 2=迟到 3=缺卡' AFTER `shift_id`; |
| | | ALTER TABLE `xp_vehicle_detection_6` MODIFY COLUMN `collision_prevention` int NULL DEFAULT NULL COMMENT '防撞激活' AFTER `remote_self_check`; |
| | | |
| | | ALTER TABLE `xp_clock_in_8` MODIFY COLUMN `clock_in_lon` double(20, 10) NULL DEFAULT NULL COMMENT '上班打卡经度' AFTER `clock_in_result`; |
| | | ALTER TABLE `xp_vehicle_detection_6` MODIFY COLUMN `sensor_self_check` int NULL DEFAULT NULL COMMENT '传感器自检' AFTER `collision_prevention`; |
| | | |
| | | ALTER TABLE `xp_clock_in_8` MODIFY COLUMN `clock_in_lat` double(20, 10) NULL DEFAULT NULL COMMENT '上班打卡纬度' AFTER `clock_in_lon`; |
| | | ALTER TABLE `xp_vehicle_detection_7` MODIFY COLUMN `network_detection` int NULL DEFAULT NULL COMMENT '网络检测' AFTER `vehicle_id`; |
| | | |
| | | ALTER TABLE `xp_clock_in_8` MODIFY COLUMN `clock_out_result` int NULL DEFAULT NULL COMMENT '下班打卡结果 1=正常 2=迟到 3=缺卡' AFTER `update_by`; |
| | | ALTER TABLE `xp_vehicle_detection_7` MODIFY COLUMN `version_verification` int NULL DEFAULT NULL COMMENT '版本核对' AFTER `network_detection`; |
| | | |
| | | ALTER TABLE `xp_clock_in_8` MODIFY COLUMN `clock_in_address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '上班打卡地址' AFTER `clock_out_lat`; |
| | | ALTER TABLE `xp_vehicle_detection_7` MODIFY COLUMN `communication_self_check` int NULL DEFAULT NULL COMMENT '通讯自检' AFTER `version_verification`; |
| | | |
| | | ALTER TABLE `xp_clock_in_9` MODIFY COLUMN `clock_in_result` int NULL DEFAULT NULL COMMENT '上班打卡结果 1=正常 2=迟到 3=缺卡' AFTER `shift_id`; |
| | | ALTER TABLE `xp_vehicle_detection_7` MODIFY COLUMN `remote_self_check` int NULL DEFAULT NULL COMMENT '远程自检' AFTER `communication_self_check`; |
| | | |
| | | ALTER TABLE `xp_clock_in_9` MODIFY COLUMN `clock_in_lon` double(20, 10) NULL DEFAULT NULL COMMENT '上班打卡经度' AFTER `clock_in_result`; |
| | | ALTER TABLE `xp_vehicle_detection_7` MODIFY COLUMN `collision_prevention` int NULL DEFAULT NULL COMMENT '防撞激活' AFTER `remote_self_check`; |
| | | |
| | | ALTER TABLE `xp_clock_in_9` MODIFY COLUMN `clock_in_lat` double(20, 10) NULL DEFAULT NULL COMMENT '上班打卡纬度' AFTER `clock_in_lon`; |
| | | ALTER TABLE `xp_vehicle_detection_7` MODIFY COLUMN `sensor_self_check` int NULL DEFAULT NULL COMMENT '传感器自检' AFTER `collision_prevention`; |
| | | |
| | | ALTER TABLE `xp_clock_in_9` MODIFY COLUMN `clock_out_result` int NULL DEFAULT NULL COMMENT '下班打卡结果 1=正常 2=迟到 3=缺卡' AFTER `update_by`; |
| | | ALTER TABLE `xp_vehicle_detection_8` MODIFY COLUMN `network_detection` int NULL DEFAULT NULL COMMENT '网络检测' AFTER `vehicle_id`; |
| | | |
| | | ALTER TABLE `xp_clock_in_9` MODIFY COLUMN `clock_in_address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '上班打卡地址' AFTER `clock_out_lat`; |
| | | ALTER TABLE `xp_vehicle_detection_8` MODIFY COLUMN `version_verification` int NULL DEFAULT NULL COMMENT '版本核对' AFTER `network_detection`; |
| | | |
| | | ALTER TABLE `xp_vehicle_detection_8` MODIFY COLUMN `communication_self_check` int NULL DEFAULT NULL COMMENT '通讯自检' AFTER `version_verification`; |
| | | |
| | | ALTER TABLE `xp_vehicle_detection_8` MODIFY COLUMN `remote_self_check` int NULL DEFAULT NULL COMMENT '远程自检' AFTER `communication_self_check`; |
| | | |
| | | ALTER TABLE `xp_vehicle_detection_8` MODIFY COLUMN `collision_prevention` int NULL DEFAULT NULL COMMENT '防撞激活' AFTER `remote_self_check`; |
| | | |
| | | ALTER TABLE `xp_vehicle_detection_8` MODIFY COLUMN `sensor_self_check` int NULL DEFAULT NULL COMMENT '传感器自检' AFTER `collision_prevention`; |
| | | |
| | | ALTER TABLE `xp_vehicle_detection_9` MODIFY COLUMN `network_detection` int NULL DEFAULT NULL COMMENT '网络检测' AFTER `vehicle_id`; |
| | | |
| | | ALTER TABLE `xp_vehicle_detection_9` MODIFY COLUMN `version_verification` int NULL DEFAULT NULL COMMENT '版本核对' AFTER `network_detection`; |
| | | |
| | | ALTER TABLE `xp_vehicle_detection_9` MODIFY COLUMN `communication_self_check` int NULL DEFAULT NULL COMMENT '通讯自检' AFTER `version_verification`; |
| | | |
| | | ALTER TABLE `xp_vehicle_detection_9` MODIFY COLUMN `remote_self_check` int NULL DEFAULT NULL COMMENT '远程自检' AFTER `communication_self_check`; |
| | | |
| | | ALTER TABLE `xp_vehicle_detection_9` MODIFY COLUMN `collision_prevention` int NULL DEFAULT NULL COMMENT '防撞激活' AFTER `remote_self_check`; |
| | | |
| | | ALTER TABLE `xp_vehicle_detection_9` MODIFY COLUMN `sensor_self_check` int NULL DEFAULT NULL COMMENT '传感器自检' AFTER `collision_prevention`; |
| | |
| | | ALTER TABLE `xp_order_0` ADD COLUMN `change_money_flag` tinyint(1) NULL DEFAULT 0 COMMENT '是否改价标识 0-否 1-是' AFTER `city_code`; |
| | | |
| | | ALTER TABLE `xp_order_1` ADD COLUMN `change_money_flag` tinyint(1) NULL DEFAULT 0 COMMENT '是否改价标识 0-否 1-是' AFTER `city_code`; |
| | | |
| | | ALTER TABLE `xp_order_2` ADD COLUMN `change_money_flag` tinyint(1) NULL DEFAULT 0 COMMENT '是否改价标识 0-否 1-是' AFTER `city_code`; |
| | | |
| | | ALTER TABLE `xp_order_3` ADD COLUMN `change_money_flag` tinyint(1) NULL DEFAULT 0 COMMENT '是否改价标识 0-否 1-是' AFTER `city_code`; |
| | | |
| | | ALTER TABLE `xp_order_4` ADD COLUMN `change_money_flag` tinyint(1) NULL DEFAULT 0 COMMENT '是否改价标识 0-否 1-是' AFTER `city_code`; |
| | | |
| | | ALTER TABLE `xp_order_5` ADD COLUMN `change_money_flag` tinyint(1) NULL DEFAULT 0 COMMENT '是否改价标识 0-否 1-是' AFTER `city_code`; |
| | | |
| | | ALTER TABLE `xp_order_6` ADD COLUMN `change_money_flag` tinyint(1) NULL DEFAULT 0 COMMENT '是否改价标识 0-否 1-是' AFTER `city_code`; |
| | | |
| | | ALTER TABLE `xp_order_7` ADD COLUMN `change_money_flag` tinyint(1) NULL DEFAULT 0 COMMENT '是否改价标识 0-否 1-是' AFTER `city_code`; |
| | | |
| | | ALTER TABLE `xp_order_8` ADD COLUMN `change_money_flag` tinyint(1) NULL DEFAULT 0 COMMENT '是否改价标识 0-否 1-是' AFTER `city_code`; |
| | | |
| | | ALTER TABLE `xp_order_9` ADD COLUMN `change_money_flag` tinyint(1) NULL DEFAULT 0 COMMENT '是否改价标识 0-否 1-是' AFTER `city_code`; |
| | | |
| | | ALTER TABLE `xp_order_10` ADD COLUMN `change_money_flag` tinyint(1) NULL DEFAULT 0 COMMENT '是否改价标识 0-否 1-是' AFTER `city_code`; |
| | | |
| | | ALTER TABLE `xp_order_11` ADD COLUMN `change_money_flag` tinyint(1) NULL DEFAULT 0 COMMENT '是否改价标识 0-否 1-是' AFTER `city_code`; |
| | | |
| | | ALTER TABLE `xp_order_12` ADD COLUMN `change_money_flag` tinyint(1) NULL DEFAULT 0 COMMENT '是否改价标识 0-否 1-是' AFTER `city_code`; |
| | | |
| | | ALTER TABLE `xp_order_13` ADD COLUMN `change_money_flag` tinyint(1) NULL DEFAULT 0 COMMENT '是否改价标识 0-否 1-是' AFTER `city_code`; |
| | | |
| | | ALTER TABLE `xp_order_14` ADD COLUMN `change_money_flag` tinyint(1) NULL DEFAULT 0 COMMENT '是否改价标识 0-否 1-是' AFTER `city_code`; |
| | | |
| | | ALTER TABLE `xp_order_15` ADD COLUMN `change_money_flag` tinyint(1) NULL DEFAULT 0 COMMENT '是否改价标识 0-否 1-是' AFTER `city_code`; |
| | | |
| | | ALTER TABLE `xp_order_16` ADD COLUMN `change_money_flag` tinyint(1) NULL DEFAULT 0 COMMENT '是否改价标识 0-否 1-是' AFTER `city_code`; |
| | | |
| | | ALTER TABLE `xp_order_17` ADD COLUMN `change_money_flag` tinyint(1) NULL DEFAULT 0 COMMENT '是否改价标识 0-否 1-是' AFTER `city_code`; |
| | | |
| | | ALTER TABLE `xp_order_18` ADD COLUMN `change_money_flag` tinyint(1) NULL DEFAULT 0 COMMENT '是否改价标识 0-否 1-是' AFTER `city_code`; |
| | | |
| | | ALTER TABLE `xp_order_19` ADD COLUMN `change_money_flag` tinyint(1) NULL DEFAULT 0 COMMENT '是否改价标识 0-否 1-是' AFTER `city_code`; |
| | |
| | | <artifactId>snakeyaml</artifactId> |
| | | <version>1.33</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.xiaopeng.logan</groupId> |
| | | <artifactId>xp-evi-oss-sdk</artifactId> |
| | | <version>1.0.1-SNAPSHOT</version> |
| | | <scope>compile</scope> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | <build> |
| | |
| | | package com.xiaopeng.account.controller; |
| | | |
| | | |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.xiaopeng.account.mapper.XpOperationsRoleMapper; |
| | | import com.xiaopeng.account.model.dto.EnableDisableDTO; |
| | | import com.xiaopeng.account.model.dto.RePasswordDTO; |
| | |
| | | import com.xiaopeng.common.core.web.page.PageInfo; |
| | | import com.xiaopeng.common.security.service.TokenService; |
| | | import com.xiaopeng.account.constant.I18nKeyConstant; |
| | | import com.xiaopeng.evi.oss.service.AliOssService; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.CollectionUtils; |
| | |
| | | |
| | | private final XpFleetClient xpFleetClient; |
| | | |
| | | private final AliOssService aliOssService; |
| | | |
| | | @Autowired |
| | | public XpOperationsUserController(IXpOperationsUserService xpOperationsUserService, |
| | | XpOperationsRoleMapper xpOperationsRoleMapper, |
| | | TokenService tokenService, |
| | | XpFleetClient xpFleetClient) { |
| | | XpFleetClient xpFleetClient, AliOssService aliOssService) { |
| | | this.xpOperationsUserService = xpOperationsUserService; |
| | | this.xpOperationsRoleMapper = xpOperationsRoleMapper; |
| | | this.tokenService = tokenService; |
| | | this.xpFleetClient = xpFleetClient; |
| | | this.aliOssService = aliOssService; |
| | | } |
| | | |
| | | /** |
| | |
| | | PageInfo<XpOperationsUserVO> pageList = xpOperationsUserService.pageList(query); |
| | | return R.ok(pageList); |
| | | } |
| | | |
| | | @ApiOperation(value = "运维人员管理不分页列表", tags = {"管理后台-运维执行"}) |
| | | @PostMapping("/api/v1/operationsUser/listAll") |
| | | public R<List<XpOperationsUser>> listAll() { |
| | |
| | | @GetMapping("/api/v1/operationsUser/detailById") |
| | | public R<XpOperationsUserVO> detailById(@RequestParam Long id) { |
| | | XpOperationsUserVO xpOperationsUserVO = xpOperationsUserService.detailById(id); |
| | | if (xpOperationsUserVO.getAvatar() != null) { |
| | | JSONObject jsonObject = JSONObject.parseObject(xpOperationsUserVO.getAvatar()); |
| | | String downloadUrl = null; |
| | | try { |
| | | String downloadUrl1 = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | downloadUrl = downloadUrl1; |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | xpOperationsUserVO.setAvatar(downloadUrl); |
| | | } |
| | | |
| | | return R.ok(xpOperationsUserVO); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "运维人员管理导出列表", tags = {"管理后台-运维执行"}) |
| | | @PostMapping("/api/v1/operationsUser/exportOperationsUser") |
| | | public void exportOperationsUser(@RequestBody XpOperationsUserQuery query, HttpServletResponse response){ |
| | | public void exportOperationsUser(@RequestBody XpOperationsUserQuery query, HttpServletResponse response) { |
| | | xpOperationsUserService.exportOperationsUser(query, response); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "运维人员管理导出模板", tags = {"管理后台-运维执行"}) |
| | | @GetMapping("/api/v1/operationsUser/exportTemplate") |
| | | public void exportTemplate(HttpServletResponse response){ |
| | | public void exportTemplate(HttpServletResponse response) { |
| | | xpOperationsUserService.exportTemplate(response); |
| | | } |
| | | |
| | | |
| | | |
| | | @ApiOperation(value = "运维人员管理导入数据", tags = {"管理后台-运维执行"}) |
| | | @PostMapping("/api/v1/operationsUser/importOperationsUser") |
| | | public R<String> importOperationsUser(@RequestParam("file") MultipartFile file){ |
| | | public R<String> importOperationsUser(@RequestParam("file") MultipartFile file) { |
| | | xpOperationsUserService.importOperationsUser(file); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 根据手机号模糊查询用户(内部接口) |
| | | * |
| | |
| | | |
| | | import org.springframework.stereotype.Controller; |
| | | |
| | | import java.io.UnsupportedEncodingException; |
| | | |
| | | /** |
| | | * <p> |
| | | * 运维人员资质证书审核记录 前端控制器 |
| | |
| | | */ |
| | | @ApiOperation(value = "管理后台-综合审核-人员资质审核分页列表", tags = {"管理后台-服务中心"}) |
| | | @PostMapping("/api/v1/qualificationAudit/pageList") |
| | | public R<PageInfo<XpQualificationAuditVO>> pageList(@RequestBody XpQualificationAuditQuery query) { |
| | | public R<PageInfo<XpQualificationAuditVO>> pageList(@RequestBody XpQualificationAuditQuery query) throws UnsupportedEncodingException { |
| | | PageInfo<XpQualificationAuditVO> pageList = xpQualificationAuditService.pageList(query); |
| | | return R.ok(pageList); |
| | | } |
| | |
| | | import com.xiaopeng.api.vo.account.XpQualificationAuditVO; |
| | | import com.xiaopeng.common.core.web.page.PageInfo; |
| | | |
| | | import java.io.UnsupportedEncodingException; |
| | | |
| | | /** |
| | | * <p> |
| | | * 运维人员资质证书审核记录 服务类 |
| | |
| | | * @param query 查询参数 |
| | | * @return 列表 |
| | | */ |
| | | PageInfo<XpQualificationAuditVO> pageList(XpQualificationAuditQuery query); |
| | | PageInfo<XpQualificationAuditVO> pageList(XpQualificationAuditQuery query) throws UnsupportedEncodingException; |
| | | |
| | | /** |
| | | * 管理后台-综合审核-人员资质审核 |
| | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.hutool.core.util.PhoneUtil; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | |
| | | import com.xiaopeng.common.core.utils.poi.ExcelUtil; |
| | | import com.xiaopeng.common.core.web.page.PageInfo; |
| | | import com.xiaopeng.common.security.utils.SecurityUtils; |
| | | import com.xiaopeng.evi.oss.service.AliOssService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.shardingsphere.transaction.annotation.ShardingSphereTransactionType; |
| | |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.time.LocalDateTime; |
| | | import java.util.*; |
| | | import java.util.function.Function; |
| | |
| | | private SysRoleMapper sysRoleMapper; |
| | | @Autowired |
| | | private ISysRoleService iSysRoleService; |
| | | @Autowired |
| | | private AliOssService aliOssService; |
| | | |
| | | @Override |
| | | public List<XpOperationsUser> listByName(String nickName) { |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | for (XpOperationsUserVO xpOperationsUserVO : list) { |
| | | String avatar = xpOperationsUserVO.getAvatar(); |
| | | JSONObject jsonObject = JSONObject.parseObject(avatar); |
| | | String downloadUrl = null; |
| | | try { |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | xpOperationsUserVO.setAvatar(downloadUrl); |
| | | } |
| | | |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | |
| | | package com.xiaopeng.account.service.impl; |
| | | |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.xiaopeng.account.mapper.SysRoleMapper; |
| | |
| | | import com.xiaopeng.api.model.account.XpQualificationAudit; |
| | | import com.xiaopeng.api.vo.account.XpQualificationAuditVO; |
| | | import com.xiaopeng.common.core.web.page.PageInfo; |
| | | import com.xiaopeng.evi.oss.service.AliOssService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.time.LocalDateTime; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | |
| | | private XpOperationsRoleMapper xpOperationsRoleMapper; |
| | | @Autowired |
| | | private SysRoleMapper sysRoleMapper; |
| | | @Autowired |
| | | private AliOssService aliOssService; |
| | | |
| | | @Override |
| | | public PageInfo<XpQualificationAuditVO> pageList(XpQualificationAuditQuery query) { |
| | | public PageInfo<XpQualificationAuditVO> pageList(XpQualificationAuditQuery query) throws UnsupportedEncodingException { |
| | | PageInfo<XpQualificationAuditVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | List<XpQualificationAuditVO> list = this.baseMapper.pageList(pageInfo, query); |
| | | if(CollectionUtils.isEmpty(list)){ |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | for (XpQualificationAuditVO xpQualificationAuditVO : list) { |
| | | String certificateOfNoCriminalRecord = xpQualificationAuditVO.getCertificateOfNoCriminalRecord(); |
| | | if(certificateOfNoCriminalRecord!=null){ |
| | | JSONObject jsonObject = JSONObject.parseObject(certificateOfNoCriminalRecord); |
| | | String downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | xpQualificationAuditVO.setCertificateOfNoCriminalRecord(downloadUrl); |
| | | } |
| | | |
| | | String driverLicense = xpQualificationAuditVO.getDriverLicense(); |
| | | if(driverLicense!=null){ |
| | | JSONObject jsonObject = JSONObject.parseObject(driverLicense); |
| | | String downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | xpQualificationAuditVO.setDriverLicense(downloadUrl); |
| | | } |
| | | |
| | | |
| | | String trainingGraduationCertificate = xpQualificationAuditVO.getTrainingGraduationCertificate(); |
| | | if(trainingGraduationCertificate!=null){ |
| | | JSONObject jsonObject = JSONObject.parseObject(trainingGraduationCertificate); |
| | | String downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | xpQualificationAuditVO.setTrainingGraduationCertificate(downloadUrl); |
| | | } |
| | | |
| | | String idCardFront = xpQualificationAuditVO.getIdCardFront(); |
| | | if(idCardFront!=null){ |
| | | JSONObject jsonObject = JSONObject.parseObject(idCardFront); |
| | | String downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | xpQualificationAuditVO.setIdCardFront(downloadUrl); |
| | | } |
| | | |
| | | String idCardBack = xpQualificationAuditVO.getIdCardBack(); |
| | | if(idCardBack!=null){ |
| | | JSONObject jsonObject = JSONObject.parseObject(idCardBack); |
| | | String downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | xpQualificationAuditVO.setIdCardBack(downloadUrl); |
| | | } |
| | | |
| | | } |
| | | |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| New file |
| | |
| | | package com.xiaopeng.api.factory.automaticPilot; |
| | | |
| | | import com.xiaopeng.api.dto.automaticPilot.VehicleBaseRespDto; |
| | | import com.xiaopeng.api.feignClient.automaticPilot.OrderMissionClient; |
| | | import com.xiaopeng.api.feignClient.automaticPilot.VmpOpenServiceClient; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.cloud.openfeign.FallbackFactory; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Slf4j |
| | | @Component |
| | | public class VmpOpenServiceClientFallbackFactory implements FallbackFactory<VmpOpenServiceClient> { |
| | | @Override |
| | | public VmpOpenServiceClient create(Throwable cause) { |
| | | return new VmpOpenServiceClient(){ |
| | | |
| | | @Override |
| | | public VehicleBaseRespDto getVehicleInfoByVin(String vin, List<String> respList) { |
| | | log.info("通过vin获取车辆基本信息失败:" + cause.getMessage()); |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, String> getVehicleBindInfoByVin(String vin, List<String> typeList) { |
| | | log.info("查询车辆绑定信息失败:" + cause.getMessage()); |
| | | return Collections.emptyMap(); |
| | | } |
| | | |
| | | @Override |
| | | public String getVinByXpuId(String xpuId, Integer type) { |
| | | log.info("通过车辆绑定信息获取车架号失败:" + cause.getMessage()); |
| | | return ""; |
| | | } |
| | | }; |
| | | } |
| | | } |
| | |
| | | log.error("保存订单轨迹数据失败,原因: {}", cause.getMessage()); |
| | | return R.fail("保存订单轨迹数据失败"); |
| | | } |
| | | |
| | | @Override |
| | | public R<?> endTrip(Long orderId) { |
| | | log.error("内部调用-结束订单失败,原因: {}", cause.getMessage()); |
| | | return R.fail("内部调用-结束订单失败:" + cause.getMessage()); |
| | | } |
| | | }; |
| | | } |
| | | } |
| | |
| | | package com.xiaopeng.api.feignClient.automaticPilot; |
| | | |
| | | import com.xiaopeng.api.dto.automaticPilot.VehicleBaseRespDto; |
| | | import com.xiaopeng.api.factory.automaticPilot.OrderMissionClientFallbackFactory; |
| | | import com.xiaopeng.api.factory.automaticPilot.VmpOpenServiceClientFallbackFactory; |
| | | import com.xiaopeng.common.core.dto.ServiceNameConstantsEnum; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @FeignClient(name = "xp-vmp-open-boot") |
| | | |
| | | @FeignClient(contextId = "VmpOpenServiceClient", |
| | | value = "xp-vmp-open-boot", |
| | | fallbackFactory = VmpOpenServiceClientFallbackFactory.class) |
| | | public interface VmpOpenServiceClient { |
| | | |
| | | /** |
| | |
| | | @PostMapping("/inner/v1/order/saveVehicleLocation") |
| | | R<String> saveVehicleLocation(@RequestBody OrderTrajectoryVo orderTrajectory); |
| | | |
| | | |
| | | |
| | | /** |
| | | * 内部调用-结束订单 |
| | | * @param orderId |
| | | * @return |
| | | */ |
| | | @PostMapping("/inner/order/endTrip") |
| | | R<?> endTrip(@RequestParam Long orderId); |
| | | |
| | | } |
| | |
| | | @ApiModelProperty("系统优惠金额Str") |
| | | private String systemDiscountStr; |
| | | |
| | | |
| | | @ApiModelProperty(value = "最终价格-字符串") |
| | | private String finalFareStr; |
| | | |
| | | } |
| | |
| | | Long appUserId = xpOrder.getAppUserId(); |
| | | Object cacheObject = redisService.getCacheObject("ORDER_NAVIGATION_END_DATA:" + xpOrder.getAppUserId()); |
| | | RouteVo routeVo = JSON.parseObject(cacheObject.toString(), RouteVo.class); |
| | | log.info("开始实施推送车辆位置和剩余导航线路 {} {}", xpOrder.getOrderNumber(), JSON.toJSONString(routeVo)); |
| | | |
| | | ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(1, 1, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>(1000)); |
| | | Long finalOrderId = orderId; |
| | |
| | | |
| | | //5秒钟循环一次 |
| | | try { |
| | | Thread.sleep(500); |
| | | Thread.sleep(1000); |
| | | } catch (InterruptedException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | |
| | | RouteVo routeVo = routeVoR.getData(); |
| | | routeID = routeVo.getRouteID(); |
| | | //缓存导航数据,用于后面的逻辑中给乘客端推送导航数据 |
| | | redisService.setCacheObject("ORDER_NAVIGATION_END_DATA:" + xpOrder.getAppUserId(), com.alibaba.fastjson.JSON.toJSONString(routeVo), 24L, TimeUnit.HOURS); |
| | | redisService.setCacheObject("ORDER_NAVIGATION_END_DATA:" + xpOrder.getAppUserId(), JSON.toJSONString(routeVo), 24L, TimeUnit.HOURS); |
| | | } |
| | | vehicleId = xpOrder.getVehicleId(); |
| | | } |
| | |
| | | RouteVo routeVo = routeVoR.getData(); |
| | | routeID = routeVo.getRouteID(); |
| | | //缓存导航数据,用于后面的逻辑中给乘客端推送导航数据 |
| | | redisService.setCacheObject("ORDER_NAVIGATION_END_DATA:" + xpOrder.getAppUserId(), com.alibaba.fastjson.JSON.toJSONString(routeVo), 24L, TimeUnit.HOURS); |
| | | redisService.setCacheObject("ORDER_NAVIGATION_END_DATA:" + xpOrder.getAppUserId(), JSON.toJSONString(routeVo), 24L, TimeUnit.HOURS); |
| | | }else{ |
| | | RouteVo routeVo = JSON.parseObject(cacheObject.toString(), RouteVo.class); |
| | | routeID = routeVo.getRouteID(); |
| | |
| | | case ORDER_CANCELLED: |
| | | //已取消 |
| | | if(!orderId.contains("XU")){ |
| | | buildPushOrderStatus(orderId, OrderStatusEnum.CANCELED, sequence); |
| | | xpOrderClient.updateOrderStatus(Long.parseLong(orderId), OrderStatusEnum.CANCELED.getCode()); |
| | | //行程中取消订单,按照行程结束处理 |
| | | buildPushOrderStatus(orderId, OrderStatusEnum.SEE_OFF_GUESTS, sequence); |
| | | xpOrderClient.updateOrderStatus(Long.parseLong(orderId), OrderStatusEnum.SEE_OFF_GUESTS.getCode()); |
| | | } |
| | | break; |
| | | case ORDER_ARRIVED_AT_CRUISE_DESTINATION: |
| | |
| | | if (R.isError(stringR)) { |
| | | log.error("推送消息失败:{}", stringR.getMsg()); |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | @Override |
| | | public RouteAndFareVo getRouteAndFare(RouteAndFareDto routeAndFareDto, String userId) { |
| | | // 判断是否5分钟内进行了查询 相同站点的起始点 并且是同时段 |
| | | String key = "xp-map-query-" + routeAndFareDto.getOpenCityId() |
| | | + "-" + routeAndFareDto.getOrigin().getLongitude() + "-" + routeAndFareDto.getOrigin().getLatitude() |
| | | + "-" + routeAndFareDto.getDestination().getLongitude() + "-" + routeAndFareDto.getDestination().getLatitude() + "-" + getCurrentTimeSlot() + "-" + userId+routeAndFareDto.getUserCouponId(); |
| | | |
| | | if (redisService.hasKey(key)) { |
| | | String jsonStr = Objects.requireNonNull(redisService.getCacheObject(key)).toString(); |
| | | RouteAndFareVo RouteAndFareVo = JSONObject.parseObject(jsonStr, RouteAndFareVo.class); |
| | | return (RouteAndFareVo); |
| | | } |
| | | // // 判断是否5分钟内进行了查询 相同站点的起始点 并且是同时段 |
| | | // String key = "xp-map-query-" + routeAndFareDto.getOpenCityId() |
| | | // + "-" + routeAndFareDto.getOrigin().getLongitude() + "-" + routeAndFareDto.getOrigin().getLatitude() |
| | | // + "-" + routeAndFareDto.getDestination().getLongitude() + "-" + routeAndFareDto.getDestination().getLatitude() + "-" + getCurrentTimeSlot() + "-" + userId+routeAndFareDto.getUserCouponId(); |
| | | // |
| | | // if (redisService.hasKey(key)) { |
| | | // String jsonStr = Objects.requireNonNull(redisService.getCacheObject(key)).toString(); |
| | | // RouteAndFareVo RouteAndFareVo = JSONObject.parseObject(jsonStr, RouteAndFareVo.class); |
| | | // return (RouteAndFareVo); |
| | | // } |
| | | |
| | | // 1. 基础数据查询 |
| | | Map<String, String> geocode = gdMapGeocodingUtil.geocode(routeAndFareDto.getOrigin().getLongitude().toString(), routeAndFareDto.getOrigin().getLatitude().toString()); |
| | |
| | | |
| | | // 10. 检查等待时间 |
| | | Integer waitTime = getWaitTime(routeAndFareDto.getOrigin().getLongitude(), routeAndFareDto.getOrigin().getLatitude()); |
| | | if (waitTime > 3) { |
| | | throw new ServiceException("当前区域正在等待中,请耐心等待", I18nKeyConstant.WAITING_TIME); |
| | | } |
| | | // if (waitTime > 3) { |
| | | // throw new ServiceException("当前区域正在等待中,请耐心等待", I18nKeyConstant.WAITING_TIME); |
| | | // } |
| | | fareVo.setWaitingTime(waitTime); |
| | | |
| | | |
| | |
| | | fareVo.setSystemDiscount(new BigDecimal(fareVo.getSystemDiscount() == null ? 0 : fareVo.getSystemDiscount()).setScale(2,RoundingMode.HALF_UP).doubleValue()); |
| | | routeAndFareVo.setFareEstimate(fareVo); |
| | | |
| | | routeAndFareVo.getXpPricingCard().setFinalFareStr(fareVo.getFinalFareStr()); |
| | | |
| | | String voJsonStr = JSONObject.toJSONString(routeAndFareVo); |
| | | // 进行缓存 |
| | | redisService.setCacheObject(key, voJsonStr, 5l, TimeUnit.MINUTES); |
| | | |
| | | // String voJsonStr = JSONObject.toJSONString(routeAndFareVo); |
| | | // 进行缓存 |
| | | // redisService.setCacheObject(key, voJsonStr, 5l, TimeUnit.MINUTES); |
| | | //缓存导航数据,用于下单后推送导航给车端和乘客端 |
| | | redisService.setCacheObject("ORDER_NAVIGATION_END_DATA:" + userId, JSON.toJSONString(routeVo), 24L, TimeUnit.HOURS); |
| | | return routeAndFareVo; |
| | |
| | | // 生成订单数据 |
| | | XpOrder xpOrder = new XpOrder(); |
| | | |
| | | xpOrder.setMileageKilometers(0.0); |
| | | |
| | | // xpOrder.setVehicleId(1l); |
| | | |
| | | // xpOrder.setStartMileage(Double.valueOf(startMileage)); |
| | |
| | | <artifactId>snakeyaml</artifactId> |
| | | <version>1.33</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.xiaopeng.logan</groupId> |
| | | <artifactId>xp-evi-oss-sdk</artifactId> |
| | | <version>1.0.1-SNAPSHOT</version> |
| | | <scope>compile</scope> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | <build> |
| | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.UnsupportedEncodingException; |
| | | |
| | | /** |
| | | * token 控制 |
| | |
| | | |
| | | @ApiOperation(value = "工作台") |
| | | @PostMapping("/api/v1/workbench") |
| | | public R<PageInfo<WorkBenchVO>> workbench(@RequestBody WorkBenchQuery query) { |
| | | public R<PageInfo<WorkBenchVO>> workbench(@RequestBody WorkBenchQuery query) throws UnsupportedEncodingException { |
| | | LoginOperationUser loginOperationUser = tokenService.getLoginOperationUser(); |
| | | query.setOperationId(loginOperationUser.getId()); |
| | | // 获取任务记录 |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | | import java.io.UnsupportedEncodingException; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | @ApiOperation(value = "车辆运维-运维记录-充电记录详情", tags = {"运维APP-车辆管理"}) |
| | | @GetMapping("/api/v1/chargingRecord/chargingDetail") |
| | | public R<XpChargingRecordVO> chargingDetail(@RequestParam Long id) { |
| | | public R<XpChargingRecordVO> chargingDetail(@RequestParam Long id) throws UnsupportedEncodingException { |
| | | XpChargingRecordVO xpChargingRecordVO = xpChargingRecordService.chargingDetail(id); |
| | | return R.ok(xpChargingRecordVO); |
| | | } |
| | |
| | | package com.xiaopeng.maintenance.controller; |
| | | |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.xiaopeng.api.feignClient.vehicleConvoy.XpFleetOperationsClient; |
| | | import com.xiaopeng.api.feignClient.vehicleConvoy.XpVehicleClient; |
| | | import com.xiaopeng.api.model.account.XpOperationsUser; |
| | |
| | | import com.xiaopeng.common.core.domain.R; |
| | | import com.xiaopeng.common.core.web.page.PageInfo; |
| | | import com.xiaopeng.common.security.service.TokenService; |
| | | import com.xiaopeng.evi.oss.service.AliOssService; |
| | | import com.xiaopeng.maintenance.dto.HandleVehicleAccidentDto; |
| | | import com.xiaopeng.maintenance.dto.SaveRoutineDetailDto; |
| | | import com.xiaopeng.maintenance.dto.SaveVehicleAccidentDto; |
| | |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.shardingsphere.transaction.annotation.ShardingSphereTransactionType; |
| | | import org.apache.shardingsphere.transaction.core.TransactionType; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.validation.Valid; |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | |
| | | private XpVehicleClient xpVehicleClient; |
| | | @Autowired |
| | | private InsuranceInspectionScheduleTask insuranceInspectionScheduleTask; |
| | | @Autowired |
| | | private AliOssService aliOssService; |
| | | |
| | | @Resource |
| | | private XpTaskRuleMapper xpTaskRuleMapper; |
| | |
| | | |
| | | @ApiOperation(value = "车辆事故任务详情", tags = "运维APP-任务中心") |
| | | @GetMapping("/api/v1/task/vehicleAccidentDetail") |
| | | public R<TaskAccidentDetailVO> vehicleAccidentDetail(Long id) { |
| | | public R<TaskAccidentDetailVO> vehicleAccidentDetail(Long id) throws UnsupportedEncodingException { |
| | | return xpTaskService.vehicleAccidentDetail(id); |
| | | } |
| | | |
| | | @ApiOperation(value = "车辆其他常规任务详情", tags = "运维APP-任务中心") |
| | | @GetMapping("/api/v1/task/vehicleRoutineDetail") |
| | | public R<TaskRoutineDetailVO> vehicleRoutineDetail(Long id) { |
| | | public R<TaskRoutineDetailVO> vehicleRoutineDetail(Long id) throws UnsupportedEncodingException { |
| | | return xpTaskService.vehicleRoutineDetail(id); |
| | | } |
| | | |
| | |
| | | |
| | | @ApiOperation(value = "车辆常规洗车任务详情", tags = "运维APP-任务中心") |
| | | @GetMapping("/api/v1/task/cleanDetail") |
| | | public R<TaskCleanDetailVO> cleanDetail(Long id) { |
| | | public R<TaskCleanDetailVO> cleanDetail(Long id) throws UnsupportedEncodingException { |
| | | return xpTaskService.cleanDetail(id); |
| | | } |
| | | |
| | |
| | | @GetMapping("/inner/xpTask/queryInfoByVehicleId") |
| | | public R<XpTask> queryInfoByVehicleId(@RequestParam("vehicleId") Long vehicleId) { |
| | | XpTask xpTask = xpTaskService.queryInfoByVehicleId(vehicleId); |
| | | |
| | | String taskImage = xpTask.getTaskImage(); |
| | | if (StringUtils.isNotBlank(taskImage)) { |
| | | JSONArray jsonArray = JSONArray.parseArray(taskImage); |
| | | ArrayList<String> list = new ArrayList<>(jsonArray.size()); |
| | | for (Object o : jsonArray) { |
| | | JSONObject jsonObject = JSONObject.parseObject(o.toString()); |
| | | String downloadUrl = null; |
| | | try { |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | list.add(downloadUrl); |
| | | } |
| | | xpTask.setTaskImage(String.join(",", list)); |
| | | } |
| | | return R.ok(xpTask); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "执行保险年检检测定时任务", tags = {"定时任务"}) |
| | | @GetMapping("/base/task/insurance/execute") |
| | | public R<?> executeInsuranceTask() { |
| | |
| | | |
| | | import cn.afterturn.easypoi.excel.ExcelExportUtil; |
| | | import cn.afterturn.easypoi.excel.entity.ExportParams; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.xiaopeng.api.feignClient.account.XpOperationUserClient; |
| | | import com.xiaopeng.api.feignClient.vehicleConvoy.XpFleetOperationsClient; |
| | | import com.xiaopeng.api.feignClient.vehicleConvoy.XpVehicleClient; |
| | |
| | | import com.xiaopeng.common.core.utils.ip.IpUtils; |
| | | import com.xiaopeng.common.core.web.page.PageInfo; |
| | | import com.xiaopeng.common.security.service.TokenService; |
| | | import com.xiaopeng.evi.oss.service.AliOssService; |
| | | import com.xiaopeng.maintenance.dto.HandleVehicleAccidentDto; |
| | | import com.xiaopeng.maintenance.dto.SaveErrorTaskDto; |
| | | import com.xiaopeng.maintenance.dto.SaveRoutineDetailDto; |
| | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import javax.validation.Valid; |
| | | import java.io.IOException; |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.net.URLEncoder; |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | |
| | | @Resource |
| | | private XpOperationUserClient operationUserClient; |
| | | @Resource |
| | | private XpFleetOperationsClient xpFleetOperationsClient; |
| | | private AliOssService aliOssService; |
| | | @Resource |
| | | private XpVehicleClient xpVehicleClient; |
| | | |
| | |
| | | |
| | | @ApiOperation(value = "任务详情") |
| | | @GetMapping("/taskDetail") |
| | | public R<TaskManagementDetailVO> taskDetail(Long id) { |
| | | public R<TaskManagementDetailVO> taskDetail(Long id) throws UnsupportedEncodingException { |
| | | return xpTaskService.taskDetail(id); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询车辆不分页列表") |
| | | @PostMapping("/listVehicle") |
| | | public R<List<XpVehicle>> listVehicle() { |
| | | public R<List<XpVehicle>> listVehicle() throws UnsupportedEncodingException { |
| | | List<XpVehicle> vehicles = xpVehicleClient.listVehicle().getData(); |
| | | if (vehicles == null) { |
| | | return R.ok(new ArrayList<>()); |
| | | } |
| | | for (XpVehicle vehicle : vehicles) { |
| | | String vehiclePictures = vehicle.getVehiclePictures(); |
| | | if (org.apache.commons.lang3.StringUtils.isNotBlank(vehiclePictures)) { |
| | | JSONObject jsonObject = JSONObject.parseObject(vehiclePictures); |
| | | String downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | vehicle.setVehiclePictures(downloadUrl); |
| | | } |
| | | } |
| | | return R.ok(vehicles); |
| | | } |
| | | |
| | |
| | | package com.xiaopeng.maintenance.controller; |
| | | |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.xiaopeng.api.feignClient.account.XpOperationUserClient; |
| | | import com.xiaopeng.api.feignClient.vehicleConvoy.XpVehicleClient; |
| | |
| | | import com.xiaopeng.common.core.web.domain.BaseModel; |
| | | import com.xiaopeng.common.core.web.page.PageInfo; |
| | | import com.xiaopeng.common.security.service.TokenService; |
| | | import com.xiaopeng.evi.oss.service.AliOssService; |
| | | import com.xiaopeng.maintenance.dto.XpVehicleCleanDTO; |
| | | import com.xiaopeng.maintenance.model.vo.XpVehicleCleanVO; |
| | | import com.xiaopeng.maintenance.service.IXpVehicleCleanService; |
| | | import com.xiaopeng.maintenance.service.XpTaskService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.shardingsphere.transaction.annotation.ShardingSphereTransactionType; |
| | | import org.apache.shardingsphere.transaction.core.TransactionType; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | private TokenService tokenService; |
| | | @Autowired |
| | | private ThreadPoolTaskScheduler taskScheduler; |
| | | @Autowired |
| | | private AliOssService aliOssService; |
| | | |
| | | /** |
| | | * 车辆运维-车辆运维-车身清洁 |
| | |
| | | */ |
| | | @ApiOperation(value = "车辆运维-运维记录-清洁记录详情", tags = {"运维APP-车辆管理"}) |
| | | @GetMapping("/api/v1/vehicleClean/cleanDetail") |
| | | public R<XpVehicleCleanVO> cleanDetail(@RequestParam Long id) { |
| | | public R<XpVehicleCleanVO> cleanDetail(@RequestParam Long id) throws UnsupportedEncodingException { |
| | | XpVehicleCleanVO xpVehicleCleanVO = xpVehicleCleanService.cleanDetail(id); |
| | | String vehiclePictures = xpVehicleCleanVO.getVehiclePictures(); |
| | | if (vehiclePictures != null && !vehiclePictures.isEmpty()) { |
| | | JSONObject jsonObject = JSONObject.parseObject(vehiclePictures); |
| | | String downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | xpVehicleCleanVO.setVehiclePictures(downloadUrl); |
| | | } |
| | | |
| | | |
| | | |
| | | String taskImage = xpVehicleCleanVO.getTaskImage(); |
| | | if (StringUtils.isNotBlank(taskImage)) { |
| | | JSONArray jsonArray = JSONArray.parseArray(taskImage); |
| | | ArrayList<String> list = new ArrayList<>(jsonArray.size()); |
| | | for (Object o : jsonArray) { |
| | | JSONObject jsonObject = JSONObject.parseObject(o.toString()); |
| | | String downloadUrl = null; |
| | | try { |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | list.add(downloadUrl); |
| | | } |
| | | xpVehicleCleanVO.setTaskImage(String.join(",", list)); |
| | | } |
| | | |
| | | |
| | | return R.ok(xpVehicleCleanVO); |
| | | } |
| | | |
| | |
| | | */ |
| | | @ApiOperation(value = "车辆管理-清洁列表", tags = {"管理后台-车辆管理"}) |
| | | @PostMapping("/api/v1/vehicleClean/list") |
| | | public R<PageInfo<XpVehicleClean>> list(@RequestBody VehicleCleanQuery query) { |
| | | public R<PageInfo<XpVehicleClean>> list(@RequestBody VehicleCleanQuery query) throws UnsupportedEncodingException { |
| | | PageInfo<XpVehicleClean> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | LambdaQueryWrapper<XpVehicleClean> wrapper = new LambdaQueryWrapper<XpVehicleClean>().eq(XpVehicleClean::getVehicleId, query.getVehicleId()); |
| | | List<XpOperationsUser> data=null; |
| | |
| | | |
| | | |
| | | for (XpVehicleClean record : records) { |
| | | String taskImage = record.getTaskImage(); |
| | | if (StringUtils.isNotBlank(taskImage)) { |
| | | JSONArray jsonArray = JSONArray.parseArray(taskImage); |
| | | ArrayList<String> list = new ArrayList<>(jsonArray.size()); |
| | | for (Object o : jsonArray) { |
| | | JSONObject jsonObject = JSONObject.parseObject(o.toString()); |
| | | String downloadUrl = null; |
| | | try { |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | list.add(downloadUrl); |
| | | } |
| | | record.setTaskImage(String.join(",", list)); |
| | | } |
| | | data.stream().filter(xpOperationsUser -> xpOperationsUser.getId().equals(record.getOperationsUserId())).findFirst().ifPresent(xpOperationsUser -> record.setCreateBy(xpOperationsUser.getNickName())); |
| | | } |
| | | return R.ok(page); |
| | |
| | | package com.xiaopeng.maintenance.controller; |
| | | |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.xiaopeng.api.feignClient.account.XpOperationUserClient; |
| | | import com.xiaopeng.api.feignClient.vehicleConvoy.XpVehicleClient; |
| | | import com.xiaopeng.common.core.domain.R; |
| | | import com.xiaopeng.common.core.web.page.PageInfo; |
| | | import com.xiaopeng.common.security.service.TokenService; |
| | | import com.xiaopeng.evi.oss.service.AliOssService; |
| | | import com.xiaopeng.maintenance.dto.XpVehicleDetectionDTO; |
| | | import com.xiaopeng.maintenance.model.query.XpVehicleDetectionPageQuery; |
| | | import com.xiaopeng.maintenance.model.vo.XpVehicleDetectionVO; |
| | |
| | | import com.xiaopeng.maintenance.service.XpTaskService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.shardingsphere.transaction.annotation.ShardingSphereTransactionType; |
| | | import org.apache.shardingsphere.transaction.core.TransactionType; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.time.LocalDateTime; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | |
| | | @Autowired |
| | | private TokenService tokenService; |
| | | @Autowired |
| | | private XpVehicleClient xpVehicleClient; |
| | | private AliOssService aliOssService; |
| | | @Autowired |
| | | private XpOperationUserClient xpOperationUserClient; |
| | | @Autowired |
| | |
| | | */ |
| | | @ApiOperation(value = "车辆运维-车辆运维-开始自检", tags = {"运维APP-车辆管理"}) |
| | | @GetMapping("/api/v1/vehicleDetection/startDetection") |
| | | public R<Map<String,Integer>> startDetection(@RequestParam Long vehicleId) { |
| | | public R<Map<String, Integer>> startDetection(@RequestParam Long vehicleId) { |
| | | |
| | | // TODO 开始自检 |
| | | |
| | | Map<String,Integer> result = new HashMap<>(6); |
| | | Map<String, Integer> result = new HashMap<>(6); |
| | | result.put("networkDetection", 1); // 网络检测 |
| | | result.put("remoteSelfCheck", 1); // 远程自检 |
| | | result.put("versionVerification", 1); // 版本验证 |
| | |
| | | */ |
| | | @ApiOperation(value = "车辆运维-运维记录-检测记录详情", tags = {"运维APP-车辆管理"}) |
| | | @GetMapping("/api/v1/vehicleDetection/detectionDetail") |
| | | public R<XpVehicleDetectionVO> detectionDetail(@RequestParam Long id) { |
| | | public R<XpVehicleDetectionVO> detectionDetail(@RequestParam Long id) throws UnsupportedEncodingException { |
| | | XpVehicleDetectionVO xpVehicleDetectionVO = xpVehicleDetectionService.detectionDetail(id); |
| | | |
| | | String vehiclePictures = xpVehicleDetectionVO.getVehiclePictures(); |
| | | if (vehiclePictures != null && !vehiclePictures.isEmpty()) { |
| | | JSONObject jsonObject = JSONObject.parseObject(vehiclePictures); |
| | | String downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | xpVehicleDetectionVO.setVehiclePictures(downloadUrl); |
| | | } |
| | | |
| | | |
| | | String sensorCleaningPicture = xpVehicleDetectionVO.getSensorCleaningPicture(); |
| | | if (StringUtils.isNotBlank(sensorCleaningPicture)) { |
| | | JSONArray jsonArray = JSONArray.parseArray(sensorCleaningPicture); |
| | | ArrayList<String> list = new ArrayList<>(jsonArray.size()); |
| | | for (Object o : jsonArray) { |
| | | JSONObject jsonObject = JSONObject.parseObject(o.toString()); |
| | | String downloadUrl = null; |
| | | try { |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | list.add(downloadUrl); |
| | | } |
| | | xpVehicleDetectionVO.setSensorCleaningPicture(String.join(",", list)); |
| | | } |
| | | |
| | | |
| | | String interactiveScreenPicture = xpVehicleDetectionVO.getInteractiveScreenPicture(); |
| | | if (StringUtils.isNotBlank(interactiveScreenPicture)) { |
| | | JSONArray jsonArray = JSONArray.parseArray(interactiveScreenPicture); |
| | | ArrayList<String> list = new ArrayList<>(jsonArray.size()); |
| | | for (Object o : jsonArray) { |
| | | JSONObject jsonObject = JSONObject.parseObject(o.toString()); |
| | | String downloadUrl = null; |
| | | try { |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | list.add(downloadUrl); |
| | | } |
| | | xpVehicleDetectionVO.setInteractiveScreenPicture(String.join(",", list)); |
| | | } |
| | | |
| | | |
| | | String helpButtonPicture = xpVehicleDetectionVO.getHelpButtonPicture(); |
| | | if (StringUtils.isNotBlank(helpButtonPicture)) { |
| | | JSONArray jsonArray = JSONArray.parseArray(helpButtonPicture); |
| | | ArrayList<String> list = new ArrayList<>(jsonArray.size()); |
| | | for (Object o : jsonArray) { |
| | | JSONObject jsonObject = JSONObject.parseObject(o.toString()); |
| | | String downloadUrl = null; |
| | | try { |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | list.add(downloadUrl); |
| | | } |
| | | xpVehicleDetectionVO.setHelpButtonPicture(String.join(",", list)); |
| | | } |
| | | |
| | | |
| | | String paymentFunctionPicture = xpVehicleDetectionVO.getPaymentFunctionPicture(); |
| | | if (StringUtils.isNotBlank(paymentFunctionPicture)) { |
| | | JSONArray jsonArray = JSONArray.parseArray(paymentFunctionPicture); |
| | | ArrayList<String> list = new ArrayList<>(jsonArray.size()); |
| | | for (Object o : jsonArray) { |
| | | JSONObject jsonObject = JSONObject.parseObject(o.toString()); |
| | | String downloadUrl = null; |
| | | try { |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | list.add(downloadUrl); |
| | | } |
| | | xpVehicleDetectionVO.setPaymentFunctionPicture(String.join(",", list)); |
| | | } |
| | | |
| | | |
| | | String systemCheckPicture = xpVehicleDetectionVO.getSystemCheckPicture(); |
| | | if (StringUtils.isNotBlank(systemCheckPicture)) { |
| | | JSONArray jsonArray = JSONArray.parseArray(systemCheckPicture); |
| | | ArrayList<String> list = new ArrayList<>(jsonArray.size()); |
| | | for (Object o : jsonArray) { |
| | | JSONObject jsonObject = JSONObject.parseObject(o.toString()); |
| | | String downloadUrl = null; |
| | | try { |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | list.add(downloadUrl); |
| | | } |
| | | xpVehicleDetectionVO.setSystemCheckPicture(String.join(",", list)); |
| | | } |
| | | |
| | | |
| | | return R.ok(xpVehicleDetectionVO); |
| | | } |
| | | |
| | |
| | | */ |
| | | @ApiOperation(value = "通过车辆id查询检测分页列表", tags = {"管理后台-车辆管理-运营车辆管理"}) |
| | | @PostMapping("/api/v1/vehicle/queryDetectionByVehicleId") |
| | | public R<PageInfo<XpVehicleDetectionVO>> queryDetectionByVehicleId(@Valid @RequestBody XpVehicleDetectionPageQuery query) { |
| | | public R<PageInfo<XpVehicleDetectionVO>> queryDetectionByVehicleId(@Valid @RequestBody XpVehicleDetectionPageQuery query) throws UnsupportedEncodingException { |
| | | PageInfo<XpVehicleDetectionVO> pageInfo = xpVehicleDetectionService.queryDetectionByVehicleId(query); |
| | | for (XpVehicleDetectionVO xpVehicleDetectionVO : pageInfo.getRecords()) { |
| | | String vehiclePictures = xpVehicleDetectionVO.getVehiclePictures(); |
| | | if (vehiclePictures != null && !vehiclePictures.isEmpty()) { |
| | | JSONObject jsonObject = JSONObject.parseObject(vehiclePictures); |
| | | String downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | xpVehicleDetectionVO.setVehiclePictures(downloadUrl); |
| | | } |
| | | |
| | | |
| | | String sensorCleaningPicture = xpVehicleDetectionVO.getSensorCleaningPicture(); |
| | | if (StringUtils.isNotBlank(sensorCleaningPicture)) { |
| | | JSONArray jsonArray = JSONArray.parseArray(sensorCleaningPicture); |
| | | ArrayList<String> list = new ArrayList<>(jsonArray.size()); |
| | | for (Object o : jsonArray) { |
| | | JSONObject jsonObject = JSONObject.parseObject(o.toString()); |
| | | String downloadUrl = null; |
| | | try { |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | list.add(downloadUrl); |
| | | } |
| | | xpVehicleDetectionVO.setSensorCleaningPicture(String.join(",", list)); |
| | | } |
| | | |
| | | |
| | | String interactiveScreenPicture = xpVehicleDetectionVO.getInteractiveScreenPicture(); |
| | | if (StringUtils.isNotBlank(interactiveScreenPicture)) { |
| | | JSONArray jsonArray = JSONArray.parseArray(interactiveScreenPicture); |
| | | ArrayList<String> list = new ArrayList<>(jsonArray.size()); |
| | | for (Object o : jsonArray) { |
| | | JSONObject jsonObject = JSONObject.parseObject(o.toString()); |
| | | String downloadUrl = null; |
| | | try { |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | list.add(downloadUrl); |
| | | } |
| | | xpVehicleDetectionVO.setInteractiveScreenPicture(String.join(",", list)); |
| | | } |
| | | |
| | | |
| | | String helpButtonPicture = xpVehicleDetectionVO.getHelpButtonPicture(); |
| | | if (StringUtils.isNotBlank(helpButtonPicture)) { |
| | | JSONArray jsonArray = JSONArray.parseArray(helpButtonPicture); |
| | | ArrayList<String> list = new ArrayList<>(jsonArray.size()); |
| | | for (Object o : jsonArray) { |
| | | JSONObject jsonObject = JSONObject.parseObject(o.toString()); |
| | | String downloadUrl = null; |
| | | try { |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | list.add(downloadUrl); |
| | | } |
| | | xpVehicleDetectionVO.setHelpButtonPicture(String.join(",", list)); |
| | | } |
| | | |
| | | |
| | | String paymentFunctionPicture = xpVehicleDetectionVO.getPaymentFunctionPicture(); |
| | | if (StringUtils.isNotBlank(paymentFunctionPicture)) { |
| | | JSONArray jsonArray = JSONArray.parseArray(paymentFunctionPicture); |
| | | ArrayList<String> list = new ArrayList<>(jsonArray.size()); |
| | | for (Object o : jsonArray) { |
| | | JSONObject jsonObject = JSONObject.parseObject(o.toString()); |
| | | String downloadUrl = null; |
| | | try { |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | list.add(downloadUrl); |
| | | } |
| | | xpVehicleDetectionVO.setPaymentFunctionPicture(String.join(",", list)); |
| | | } |
| | | |
| | | |
| | | String systemCheckPicture = xpVehicleDetectionVO.getSystemCheckPicture(); |
| | | if (StringUtils.isNotBlank(systemCheckPicture)) { |
| | | JSONArray jsonArray = JSONArray.parseArray(systemCheckPicture); |
| | | ArrayList<String> list = new ArrayList<>(jsonArray.size()); |
| | | for (Object o : jsonArray) { |
| | | JSONObject jsonObject = JSONObject.parseObject(o.toString()); |
| | | String downloadUrl = null; |
| | | try { |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | list.add(downloadUrl); |
| | | } |
| | | xpVehicleDetectionVO.setSystemCheckPicture(String.join(",", list)); |
| | | } |
| | | |
| | | } |
| | | return R.ok(pageInfo); |
| | | } |
| | | } |
| | |
| | | package com.xiaopeng.maintenance.controller; |
| | | |
| | | import cn.hutool.core.util.IdUtil; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.xiaopeng.api.dto.automaticPilot.PushOrderDto; |
| | | import com.xiaopeng.api.dto.operation.NewCruiseOrderDto; |
| | | import com.xiaopeng.api.feignClient.automaticPilot.OrderMissionClient; |
| | |
| | | import com.xiaopeng.api.vo.automaticPilot.VehiclePosition; |
| | | import com.xiaopeng.common.core.domain.R; |
| | | import com.xiaopeng.common.core.web.page.PageInfo; |
| | | import com.xiaopeng.evi.oss.service.AliOssService; |
| | | import com.xiaopeng.maintenance.dto.VehicleDispatchAcceptDTO; |
| | | import com.xiaopeng.maintenance.dto.VehicleDispatchDepartureDTO; |
| | | import com.xiaopeng.maintenance.model.query.OperationRecordsQuery; |
| | | import com.xiaopeng.maintenance.model.vo.OperationRecordsVO; |
| | | import com.xiaopeng.maintenance.model.vo.XpVehicleRepairVO; |
| | | import com.xiaopeng.maintenance.service.IXpVehiclePreparationService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.util.ArrayList; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Resource |
| | | private MongoTemplate mongoTemplate; |
| | | @Resource |
| | | private OrderMissionClient orderMissionClient; |
| | | private AliOssService aliOssService; |
| | | @Autowired |
| | | private XpCruisePlanClient xpCruisePlanClient; |
| | | |
| | |
| | | */ |
| | | @ApiOperation(value = "车辆运维-车辆调度-运维记录", tags = {"运维APP-车辆管理"}) |
| | | @PostMapping("/api/v1/vehicle/operationRecords") |
| | | public R<PageInfo<OperationRecordsVO>> operationRecords(@Validated @RequestBody OperationRecordsQuery query) { |
| | | public R<PageInfo<OperationRecordsVO>> operationRecords(@Validated @RequestBody OperationRecordsQuery query) throws UnsupportedEncodingException { |
| | | PageInfo<OperationRecordsVO> operationRecords = xpVehiclePreparationService.operationRecords(query); |
| | | for (OperationRecordsVO record : operationRecords.getRecords()) { |
| | | String vehiclePictures = record.getVehiclePictures(); |
| | | if (StringUtils.isNotBlank(vehiclePictures)) { |
| | | JSONObject jsonObject = JSONObject.parseObject(vehiclePictures); |
| | | String downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | record.setVehiclePictures(downloadUrl); |
| | | } |
| | | |
| | | } |
| | | return R.ok(operationRecords); |
| | | } |
| | | |
| | |
| | | package com.xiaopeng.maintenance.controller; |
| | | |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.xiaopeng.api.feignClient.account.XpOperationUserClient; |
| | | import com.xiaopeng.api.feignClient.vehicleConvoy.XpVehicleClient; |
| | | import com.xiaopeng.evi.oss.service.AliOssService; |
| | | import com.xiaopeng.maintenance.model.query.XpVehiclePreparationPageQuery; |
| | | import com.xiaopeng.api.vo.maintenance.XpVehiclePreparationDetailVO; |
| | | import com.xiaopeng.common.core.domain.R; |
| | |
| | | import com.xiaopeng.maintenance.service.XpTaskService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.shardingsphere.transaction.annotation.ShardingSphereTransactionType; |
| | | import org.apache.shardingsphere.transaction.core.TransactionType; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.util.ArrayList; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Autowired |
| | | private XpVehicleClient xpVehicleClient; |
| | | @Autowired |
| | | private XpOperationUserClient xpOperationUserClient; |
| | | private AliOssService aliOssService; |
| | | @Autowired |
| | | private XpTaskService xpTaskService; |
| | | /** |
| | |
| | | */ |
| | | @ApiOperation(value = "车辆运维-运维记录-整备记录详情", tags = {"运维APP-车辆管理"}) |
| | | @GetMapping("/api/v1/vehiclePreparation/preparationDetail") |
| | | public R<XpVehiclePreparationVO> preparationDetail(@RequestParam Long id) { |
| | | public R<XpVehiclePreparationVO> preparationDetail(@RequestParam Long id) throws UnsupportedEncodingException { |
| | | XpVehiclePreparationVO xpVehiclePreparationVO = xpVehiclePreparationService.preparationDetail(id); |
| | | |
| | | String vehiclePictures = xpVehiclePreparationVO.getVehiclePictures(); |
| | | if (StringUtils.isNotBlank(vehiclePictures)) { |
| | | JSONObject jsonObject = JSONObject.parseObject(vehiclePictures); |
| | | String downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | xpVehiclePreparationVO.setVehiclePictures(downloadUrl); |
| | | } |
| | | |
| | | |
| | | |
| | | return R.ok(xpVehiclePreparationVO); |
| | | } |
| | | |
| | |
| | | package com.xiaopeng.maintenance.controller; |
| | | |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.xiaopeng.api.model.maintenance.XpVehicleRepair; |
| | | import com.xiaopeng.common.core.domain.R; |
| | | import com.xiaopeng.common.core.exception.ServiceException; |
| | | import com.xiaopeng.common.core.web.page.PageInfo; |
| | | import com.xiaopeng.common.security.service.TokenService; |
| | | import com.xiaopeng.evi.oss.service.AliOssService; |
| | | import com.xiaopeng.maintenance.constant.I18nKeyConstant; |
| | | import com.xiaopeng.maintenance.dto.XpVehicleRepairReturnDTO; |
| | | import com.xiaopeng.maintenance.dto.XpVehicleRepairStartDTO; |
| | |
| | | import com.xiaopeng.maintenance.vo.RepairStatusVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.time.LocalDateTime; |
| | | import java.util.ArrayList; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | |
| | | private IXpVehicleRepairService xpVehicleRepairService; |
| | | @Autowired |
| | | private TokenService tokenService; |
| | | @Autowired |
| | | private AliOssService aliOssService; |
| | | |
| | | /** |
| | | * 车辆详情-车辆运维-车辆送修 |
| | |
| | | */ |
| | | @ApiOperation(value = "车辆运维-运维记录-维修记录详情", tags = {"运维APP-车辆管理"}) |
| | | @GetMapping("/api/v1/vehicleRepair/repairDetail") |
| | | public R<XpVehicleRepairVO> repairDetail(@RequestParam Long id) { |
| | | public R<XpVehicleRepairVO> repairDetail(@RequestParam Long id) throws UnsupportedEncodingException { |
| | | XpVehicleRepairVO xpVehicleRepairVO = xpVehicleRepairService.repairDetail(id); |
| | | |
| | | String vehiclePictures = xpVehicleRepairVO.getVehiclePictures(); |
| | | if (StringUtils.isNotBlank(vehiclePictures)) { |
| | | JSONObject jsonObject = JSONObject.parseObject(vehiclePictures); |
| | | String downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | xpVehicleRepairVO.setVehiclePictures(downloadUrl); |
| | | } |
| | | |
| | | String startRepairPicture = xpVehicleRepairVO.getStartRepairPicture(); |
| | | if (StringUtils.isNotBlank(startRepairPicture)) { |
| | | JSONArray jsonArray = JSONArray.parseArray(startRepairPicture); |
| | | ArrayList<String> list = new ArrayList<>(jsonArray.size()); |
| | | for (Object o : jsonArray) { |
| | | JSONObject jsonObject = JSONObject.parseObject(o.toString()); |
| | | String downloadUrl = null; |
| | | try { |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | list.add(downloadUrl); |
| | | } |
| | | xpVehicleRepairVO.setStartRepairPicture(String.join(",", list)); |
| | | } |
| | | |
| | | |
| | | return R.ok(xpVehicleRepairVO); |
| | | } |
| | | |
| | |
| | | */ |
| | | @ApiOperation(value = "通过车辆id查询维修分页列表", tags = {"管理后台-车辆管理-运营车辆管理"}) |
| | | @PostMapping("/api/v1/vehicle/queryRepairByVehicleId") |
| | | public R<PageInfo<XpVehicleRepairVO>> queryRepairByVehicleId(@Valid @RequestBody XpVehicleRepairPageQuery query) { |
| | | public R<PageInfo<XpVehicleRepairVO>> queryRepairByVehicleId(@Valid @RequestBody XpVehicleRepairPageQuery query) throws UnsupportedEncodingException { |
| | | PageInfo<XpVehicleRepairVO> pageInfo = xpVehicleRepairService.queryDetectionByVehicleId(query); |
| | | |
| | | for (XpVehicleRepairVO record : pageInfo.getRecords()) { |
| | | String vehiclePictures = record.getVehiclePictures(); |
| | | if (StringUtils.isNotBlank(vehiclePictures)) { |
| | | JSONObject jsonObject = JSONObject.parseObject(vehiclePictures); |
| | | String downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | record.setVehiclePictures(downloadUrl); |
| | | } |
| | | |
| | | String startRepairPicture = record.getStartRepairPicture(); |
| | | if (StringUtils.isNotBlank(startRepairPicture)) { |
| | | JSONArray jsonArray = JSONArray.parseArray(startRepairPicture); |
| | | ArrayList<String> list = new ArrayList<>(jsonArray.size()); |
| | | for (Object o : jsonArray) { |
| | | JSONObject jsonObject = JSONObject.parseObject(o.toString()); |
| | | String downloadUrl = null; |
| | | try { |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | list.add(downloadUrl); |
| | | } |
| | | record.setStartRepairPicture(String.join(",", list)); |
| | | } |
| | | |
| | | } |
| | | return R.ok(pageInfo); |
| | | } |
| | | |
| | |
| | | package com.xiaopeng.maintenance.controller; |
| | | |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.xiaopeng.api.model.maintenance.XpWorkOrder; |
| | | import com.xiaopeng.api.model.maintenance.XpWorkOrderLog; |
| | | import com.xiaopeng.common.core.domain.R; |
| | | import com.xiaopeng.common.core.web.page.PageInfo; |
| | | import com.xiaopeng.common.security.service.TokenService; |
| | | import com.xiaopeng.evi.oss.service.AliOssService; |
| | | import com.xiaopeng.maintenance.model.query.WorkOrderPageListQuery; |
| | | import com.xiaopeng.maintenance.service.IXpWorkOrderLogService; |
| | | import com.xiaopeng.maintenance.service.IXpWorkOrderService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.util.ArrayList; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | private IXpWorkOrderLogService workOrderLogService; |
| | | @Resource |
| | | private TokenService tokenService; |
| | | @Resource |
| | | private AliOssService aliOssService; |
| | | |
| | | @ApiOperation(value = "工单管理分页列表") |
| | | @PostMapping("/pageList") |
| | |
| | | @GetMapping("/workOrderDetail") |
| | | public R<XpWorkOrder> workOrderDetail(Long id) { |
| | | XpWorkOrder detail =workOrderService.workOrderDetail(id); |
| | | if(detail.getProblemImage()!=null){ |
| | | String problemImage = detail.getProblemImage(); |
| | | if (StringUtils.isNotBlank(problemImage)) { |
| | | JSONArray jsonArray = JSONArray.parseArray(problemImage); |
| | | ArrayList<String> list = new ArrayList<>(jsonArray.size()); |
| | | for (Object o : jsonArray) { |
| | | JSONObject jsonObject = JSONObject.parseObject(o.toString()); |
| | | String downloadUrl = null; |
| | | try { |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | list.add(downloadUrl); |
| | | } |
| | | detail.setProblemImage(String.join(",", list)); |
| | | } |
| | | } |
| | | return R.ok(detail); |
| | | } |
| | | |
| | |
| | | import com.xiaopeng.maintenance.model.vo.XpChargingRecordVO; |
| | | import com.xiaopeng.maintenance.vo.ChargingStatusVO; |
| | | |
| | | import java.io.UnsupportedEncodingException; |
| | | |
| | | /** |
| | | * <p> |
| | | * 车辆充电记录 服务类 |
| | |
| | | * @param id |
| | | * @return |
| | | */ |
| | | XpChargingRecordVO chargingDetail(Long id); |
| | | XpChargingRecordVO chargingDetail(Long id) throws UnsupportedEncodingException; |
| | | |
| | | /** |
| | | * 通过车辆ID查询充电记录分页列表(内部接口) |
| | |
| | | import com.xiaopeng.maintenance.vo.TaskDetectionDetailVO; |
| | | |
| | | import javax.validation.Valid; |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | */ |
| | | public interface XpTaskService extends IService<XpTask> { |
| | | |
| | | PageInfo<WorkBenchVO> workbench(WorkBenchQuery query); |
| | | PageInfo<WorkBenchVO> workbench(WorkBenchQuery query) throws UnsupportedEncodingException; |
| | | |
| | | PageInfo<TaskPageListVO> pageList(TaskPageListQuery query); |
| | | |
| | | XpTask saveVehicleAccident(SaveVehicleAccidentDto dto, XpOperationsUser xpOperationsUser); |
| | | |
| | | R<TaskAccidentDetailVO> vehicleAccidentDetail(Long id); |
| | | R<TaskAccidentDetailVO> vehicleAccidentDetail(Long id) throws UnsupportedEncodingException; |
| | | |
| | | R handleVehicleAccident(HandleVehicleAccidentDto dto, XpOperationsUser xpOperationsUser); |
| | | |
| | | R<TaskRoutineDetailVO> vehicleRoutineDetail(Long id); |
| | | R<TaskRoutineDetailVO> vehicleRoutineDetail(Long id) throws UnsupportedEncodingException; |
| | | |
| | | R<TaskChargingDetailVO> chargingDetail(Long id); |
| | | |
| | |
| | | |
| | | R saveRoutineDetail(SaveRoutineDetailDto dto, Long id); |
| | | |
| | | R<com.xiaopeng.maintenance.vo.TaskCleanDetailVO> cleanDetail(Long id); |
| | | R<com.xiaopeng.maintenance.vo.TaskCleanDetailVO> cleanDetail(Long id) throws UnsupportedEncodingException; |
| | | |
| | | R confirmArrive(Long id,Long userId); |
| | | |
| | |
| | | |
| | | void saveTask(SaveErrorTaskDto dto, Long reportUserId); |
| | | |
| | | R<TaskManagementDetailVO> taskDetail(Long id); |
| | | R<TaskManagementDetailVO> taskDetail(Long id) throws UnsupportedEncodingException; |
| | | |
| | | List<TaskManagementPageListVO> exportList(TaskManagementPageListQuery query); |
| | | |
| | |
| | | package com.xiaopeng.maintenance.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.xiaopeng.api.feignClient.account.XpOperationUserClient; |
| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.xiaopeng.api.model.vehicleConvoy.XpVehicle; |
| | | import com.xiaopeng.api.vo.automaticPilot.VehiclePosition; |
| | | import com.xiaopeng.evi.oss.service.AliOssService; |
| | | import com.xiaopeng.maintenance.model.query.XpChargingRecordPageQuery; |
| | | import com.xiaopeng.common.core.domain.R; |
| | | import com.xiaopeng.common.core.web.page.PageInfo; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.time.LocalDateTime; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | |
| | | private XpOperationUserClient xpOperationUserClient; |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | |
| | | @Autowired |
| | | private AliOssService aliOssService; |
| | | @Override |
| | | public void startCharging(XpChargingRecordStartDTO dto, Long id) { |
| | | // 创建车辆充电记录 |
| | |
| | | } |
| | | |
| | | @Override |
| | | public XpChargingRecordVO chargingDetail(Long id) { |
| | | public XpChargingRecordVO chargingDetail(Long id) throws UnsupportedEncodingException { |
| | | // 查询车辆充电记录 |
| | | XpChargingRecord xpChargingRecord = this.getById(id); |
| | | XpChargingRecordVO xpChargingRecordVO = new XpChargingRecordVO(); |
| | |
| | | XpVehicle xpVehicle = xpVehicleClient.queryById(xpChargingRecord.getVehicleId()).getData(); |
| | | if (Objects.nonNull(xpVehicle)) { |
| | | xpChargingRecordVO.setPlateNumber(xpVehicle.getPlateNumber()); |
| | | xpChargingRecordVO.setVehiclePictures(xpVehicle.getVehiclePictures()); |
| | | |
| | | |
| | | |
| | | String vehiclePictures =xpVehicle.getVehiclePictures(); |
| | | if (StringUtils.isNotBlank(vehiclePictures)) { |
| | | JSONObject jsonObject = JSONObject.parseObject(vehiclePictures); |
| | | String downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | xpChargingRecordVO.setVehiclePictures(downloadUrl); |
| | | } |
| | | |
| | | |
| | | xpChargingRecordVO.setAcceptOrTest(xpVehicle.getAcceptOrTest()); |
| | | xpChargingRecordVO.setVehicleColor(xpVehicle.getVehicleColor()); |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public PageInfo<XpChargingRecordVO> queryChargingByVehicleId(XpChargingRecordPageQuery query) { |
| | | public PageInfo<XpChargingRecordVO> queryChargingByVehicleId(XpChargingRecordPageQuery query){ |
| | | // 1. 如果有操作人姓名过滤条件,先查询符合条件的用户ID列表 |
| | | List<Long> userIds = null; |
| | | if (StringUtils.isNotBlank(query.getOperationsUserName())) { |
| | |
| | | String userName = userNameMap.get(chargingRecord.getEndOperationsUserId()); |
| | | vo.setOperatorEndName(userName); |
| | | } |
| | | |
| | | |
| | | String vehiclePictures = vo.getVehiclePictures(); |
| | | if (StringUtils.isNotBlank(vehiclePictures)) { |
| | | JSONArray jsonArray = JSONArray.parseArray(vehiclePictures); |
| | | ArrayList<String> list = new ArrayList<>(jsonArray.size()); |
| | | for (Object o : jsonArray) { |
| | | JSONObject jsonObject = JSONObject.parseObject(o.toString()); |
| | | String downloadUrl = null; |
| | | try { |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | list.add(downloadUrl); |
| | | } |
| | | vo.setVehiclePictures(String.join(",", list)); |
| | | } |
| | | |
| | | |
| | | |
| | | String startChargingPicture = vo.getStartChargingPicture(); |
| | | if (StringUtils.isNotBlank(startChargingPicture)) { |
| | | JSONArray jsonArray = JSONArray.parseArray(startChargingPicture); |
| | | ArrayList<String> list = new ArrayList<>(jsonArray.size()); |
| | | for (Object o : jsonArray) { |
| | | JSONObject jsonObject = JSONObject.parseObject(o.toString()); |
| | | String downloadUrl = null; |
| | | try { |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | list.add(downloadUrl); |
| | | } |
| | | vo.setStartChargingPicture(String.join(",", list)); |
| | | } |
| | | |
| | | |
| | | |
| | | String endChargingPicture = vo.getEndChargingPicture(); |
| | | if (StringUtils.isNotBlank(endChargingPicture)) { |
| | | JSONArray jsonArray = JSONArray.parseArray(endChargingPicture); |
| | | ArrayList<String> list = new ArrayList<>(jsonArray.size()); |
| | | for (Object o : jsonArray) { |
| | | JSONObject jsonObject = JSONObject.parseObject(o.toString()); |
| | | String downloadUrl = null; |
| | | try { |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | list.add(downloadUrl); |
| | | } |
| | | vo.setEndChargingPicture(String.join(",", list)); |
| | | } |
| | | |
| | | |
| | | |
| | | records.add(vo); |
| | | } |
| | | } |
| | |
| | | package com.xiaopeng.maintenance.service.impl; |
| | | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | |
| | | import com.xiaopeng.common.core.enums.TaskTypeNotificationEnum; |
| | | import com.xiaopeng.common.core.exception.ServiceException; |
| | | import com.xiaopeng.common.core.web.page.PageInfo; |
| | | import com.xiaopeng.evi.oss.service.AliOssService; |
| | | import com.xiaopeng.maintenance.constant.I18nKeyConstant; |
| | | import com.xiaopeng.maintenance.dto.HandleVehicleAccidentDto; |
| | | import com.xiaopeng.maintenance.dto.SaveErrorTaskDto; |
| | |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.math.BigDecimal; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDateTime; |
| | |
| | | @Resource |
| | | private XpFleetOperationsClient xpFleetOperationsClient; |
| | | |
| | | @Resource |
| | | private AliOssService aliOssService; |
| | | |
| | | @Override |
| | | public PageInfo<WorkBenchVO> workbench(WorkBenchQuery query) { |
| | | public PageInfo<WorkBenchVO> workbench(WorkBenchQuery query) throws UnsupportedEncodingException { |
| | | PageInfo<WorkBenchVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | List<WorkBenchVO> list = this.baseMapper.workbench(pageInfo, query); |
| | | |
| | | for (WorkBenchVO workBenchVO : list) { |
| | | String vehiclePictures = workBenchVO.getVehiclePictures(); |
| | | if (StringUtils.isNotBlank(vehiclePictures)) { |
| | | JSONObject jsonObject = JSONObject.parseObject(vehiclePictures); |
| | | String downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | workBenchVO.setVehiclePictures(downloadUrl); |
| | | } |
| | | } |
| | | |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public R<TaskAccidentDetailVO> vehicleAccidentDetail(Long id) { |
| | | public R<TaskAccidentDetailVO> vehicleAccidentDetail(Long id) throws UnsupportedEncodingException { |
| | | TaskAccidentDetailVO res = new TaskAccidentDetailVO(); |
| | | XpTask task = this.getById(id); |
| | | if (task == null) { |
| | |
| | | if (Objects.nonNull(xpTaskRule)) { |
| | | res.setCanArriveRange(xpTaskRule.getCanArriveRange()); |
| | | } |
| | | |
| | | String taskImage = res.getTaskImage(); |
| | | if (StringUtils.isNotBlank(taskImage)) { |
| | | JSONArray jsonArray = JSONArray.parseArray(taskImage); |
| | | ArrayList<String> list = new ArrayList<>(jsonArray.size()); |
| | | for (Object o : jsonArray) { |
| | | JSONObject jsonObject = JSONObject.parseObject(o.toString()); |
| | | String downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | list.add(downloadUrl); |
| | | } |
| | | res.setTaskImage(String.join(",", list)); |
| | | } |
| | | |
| | | return R.ok(res); |
| | | } |
| | | @ShardingSphereTransactionType(TransactionType.BASE) |
| | |
| | | } |
| | | |
| | | @Override |
| | | public R<TaskRoutineDetailVO> vehicleRoutineDetail(Long id) { |
| | | public R<TaskRoutineDetailVO> vehicleRoutineDetail(Long id) throws UnsupportedEncodingException { |
| | | TaskRoutineDetailVO res = new TaskRoutineDetailVO(); |
| | | XpTask task = this.getById(id); |
| | | if (task == null) { |
| | |
| | | res.setHandleUserName(data.getNickName()); |
| | | } |
| | | } |
| | | |
| | | String taskImage = res.getTaskImage(); |
| | | if (StringUtils.isNotBlank(taskImage)) { |
| | | JSONArray jsonArray = JSONArray.parseArray(taskImage); |
| | | ArrayList<String> list = new ArrayList<>(jsonArray.size()); |
| | | for (Object o : jsonArray) { |
| | | JSONObject jsonObject = JSONObject.parseObject(o.toString()); |
| | | String downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | list.add(downloadUrl); |
| | | } |
| | | res.setTaskImage(String.join(",", list)); |
| | | } |
| | | |
| | | |
| | | return R.ok(res); |
| | | } |
| | | |
| | |
| | | .eq(XpChargingRecord::getTaskId, id).last("limit 1")); |
| | | if (chargingRecord != null) { |
| | | res.setStartRemainingBattery(chargingRecord.getStartRemainingBattery()); |
| | | res.setStartChargingPicture(chargingRecord.getStartChargingPicture()); |
| | | |
| | | |
| | | String startChargingPicture = res.getStartChargingPicture(); |
| | | if (StringUtils.isNotBlank(startChargingPicture)) { |
| | | JSONArray jsonArray = JSONArray.parseArray(startChargingPicture); |
| | | ArrayList<String> list = new ArrayList<>(jsonArray.size()); |
| | | for (Object o : jsonArray) { |
| | | JSONObject jsonObject = JSONObject.parseObject(o.toString()); |
| | | String downloadUrl = null; |
| | | try { |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | list.add(downloadUrl); |
| | | } |
| | | res.setStartChargingPicture(String.join(",", list)); |
| | | } |
| | | |
| | | res.setStartTime(chargingRecord.getStartTime()); |
| | | res.setEndRemainingBattery(chargingRecord.getEndRemainingBattery()); |
| | | res.setEndChargingPicture(chargingRecord.getEndChargingPicture()); |
| | | |
| | | |
| | | |
| | | |
| | | String endChargingPicture = chargingRecord.getEndChargingPicture(); |
| | | if (StringUtils.isNotBlank(endChargingPicture)) { |
| | | JSONArray jsonArray = JSONArray.parseArray(endChargingPicture); |
| | | ArrayList<String> list = new ArrayList<>(jsonArray.size()); |
| | | for (Object o : jsonArray) { |
| | | JSONObject jsonObject = JSONObject.parseObject(o.toString()); |
| | | String downloadUrl = null; |
| | | try { |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | list.add(downloadUrl); |
| | | } |
| | | res.setEndChargingPicture(String.join(",", list)); |
| | | } |
| | | |
| | | res.setEndTime(chargingRecord.getEndTime()); |
| | | res.setStartOperationsUserId(chargingRecord.getStartOperationsUserId()); |
| | | res.setEndOperationsUserId(chargingRecord.getEndOperationsUserId()); |
| | |
| | | res.setStartTime(vehicleRepair.getStartTime()); |
| | | res.setEndTime(vehicleRepair.getEndTime()); |
| | | res.setRepairReason(vehicleRepair.getRepairReason()); |
| | | res.setStartRepairPicture(vehicleRepair.getStartRepairPicture()); |
| | | |
| | | |
| | | |
| | | String startRepairPicture = vehicleRepair.getStartRepairPicture(); |
| | | if (StringUtils.isNotBlank(startRepairPicture)) { |
| | | JSONArray jsonArray = JSONArray.parseArray(startRepairPicture); |
| | | ArrayList<String> list = new ArrayList<>(jsonArray.size()); |
| | | for (Object o : jsonArray) { |
| | | JSONObject jsonObject = JSONObject.parseObject(o.toString()); |
| | | String downloadUrl = null; |
| | | try { |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | list.add(downloadUrl); |
| | | } |
| | | res.setStartRepairPicture(String.join(",", list)); |
| | | } |
| | | |
| | | res.setRepairMoney(vehicleRepair.getRepairMoney()); |
| | | res.setRepairMoneyDetail(vehicleRepair.getRepairMoneyDetail()); |
| | | res.setSendUserId(vehicleRepair.getSendUserId()); |
| | |
| | | res.setReturnUserName(operationsUser.getNickName()); |
| | | } |
| | | } |
| | | |
| | | if (vehicleRepair.getSendUserId() != null) { |
| | | XpOperationsUser operationsUser = xpOperationUserClient.queryById(vehicleRepair.getSendUserId()).getData(); |
| | | if (operationsUser != null) { |
| | |
| | | res.setCollisionPrevention(vehicleDetection.getCollisionPrevention()); |
| | | res.setSensorSelfCheck(vehicleDetection.getSensorSelfCheck()); |
| | | res.setSensorCleaning(vehicleDetection.getSensorCleaning()); |
| | | res.setSensorCleaningPicture(vehicleDetection.getSensorCleaningPicture()); |
| | | |
| | | |
| | | |
| | | String SensorCleaningPicture = vehicleDetection.getSensorCleaningPicture(); |
| | | if (StringUtils.isNotBlank(SensorCleaningPicture)) { |
| | | JSONArray jsonArray = JSONArray.parseArray(SensorCleaningPicture); |
| | | ArrayList<String> list = new ArrayList<>(jsonArray.size()); |
| | | for (Object o : jsonArray) { |
| | | JSONObject jsonObject = JSONObject.parseObject(o.toString()); |
| | | String downloadUrl = null; |
| | | try { |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | list.add(downloadUrl); |
| | | } |
| | | res.setSensorCleaningPicture(String.join(",", list)); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | res.setInteractiveScreen(vehicleDetection.getInteractiveScreen()); |
| | | res.setInteractiveScreenPicture(vehicleDetection.getInteractiveScreenPicture()); |
| | | String InteractiveScreenPicture =vehicleDetection.getInteractiveScreenPicture(); |
| | | if (StringUtils.isNotBlank(InteractiveScreenPicture)) { |
| | | JSONArray jsonArray = JSONArray.parseArray(InteractiveScreenPicture); |
| | | ArrayList<String> list = new ArrayList<>(jsonArray.size()); |
| | | for (Object o : jsonArray) { |
| | | JSONObject jsonObject = JSONObject.parseObject(o.toString()); |
| | | String downloadUrl = null; |
| | | try { |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | list.add(downloadUrl); |
| | | } |
| | | res.setInteractiveScreenPicture(String.join(",", list)); |
| | | } |
| | | |
| | | |
| | | |
| | | res.setHelpButton(vehicleDetection.getHelpButton()); |
| | | res.setHelpButtonPicture(vehicleDetection.getHelpButtonPicture()); |
| | | |
| | | |
| | | |
| | | |
| | | String HelpButtonPicture =vehicleDetection.getHelpButtonPicture(); |
| | | if (StringUtils.isNotBlank(HelpButtonPicture)) { |
| | | JSONArray jsonArray = JSONArray.parseArray(HelpButtonPicture); |
| | | ArrayList<String> list = new ArrayList<>(jsonArray.size()); |
| | | for (Object o : jsonArray) { |
| | | JSONObject jsonObject = JSONObject.parseObject(o.toString()); |
| | | String downloadUrl = null; |
| | | try { |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | list.add(downloadUrl); |
| | | } |
| | | res.setHelpButtonPicture(String.join(",", list)); |
| | | } |
| | | |
| | | res.setPaymentFunction(vehicleDetection.getPaymentFunction()); |
| | | res.setPaymentFunctionPicture(vehicleDetection.getPaymentFunctionPicture()); |
| | | |
| | | |
| | | |
| | | String PaymentFunctionPicture =vehicleDetection.getPaymentFunctionPicture(); |
| | | if (StringUtils.isNotBlank(PaymentFunctionPicture)) { |
| | | JSONArray jsonArray = JSONArray.parseArray(PaymentFunctionPicture); |
| | | ArrayList<String> list = new ArrayList<>(jsonArray.size()); |
| | | for (Object o : jsonArray) { |
| | | JSONObject jsonObject = JSONObject.parseObject(o.toString()); |
| | | String downloadUrl = null; |
| | | try { |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | list.add(downloadUrl); |
| | | } |
| | | res.setPaymentFunctionPicture(String.join(",", list)); |
| | | } |
| | | |
| | | res.setSystemCheck(vehicleDetection.getSystemCheck()); |
| | | res.setSystemCheckPicture(vehicleDetection.getSystemCheckPicture()); |
| | | |
| | | |
| | | String SystemCheckPicture =vehicleDetection.getSystemCheckPicture(); |
| | | if (StringUtils.isNotBlank(SystemCheckPicture)) { |
| | | JSONArray jsonArray = JSONArray.parseArray(SystemCheckPicture); |
| | | ArrayList<String> list = new ArrayList<>(jsonArray.size()); |
| | | for (Object o : jsonArray) { |
| | | JSONObject jsonObject = JSONObject.parseObject(o.toString()); |
| | | String downloadUrl = null; |
| | | try { |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | list.add(downloadUrl); |
| | | } |
| | | res.setSystemCheckPicture(String.join(",", list)); |
| | | } |
| | | res.setCheckTime(vehicleDetection.getCheckTime()); |
| | | res.setOperationsUserId(vehicleDetection.getOperationsUserId()); |
| | | if (vehicleDetection.getOperationsUserId() != null) { |
| | |
| | | } |
| | | |
| | | @Override |
| | | public R<TaskCleanDetailVO> cleanDetail(Long id) { |
| | | public R<TaskCleanDetailVO> cleanDetail(Long id) throws UnsupportedEncodingException { |
| | | TaskCleanDetailVO res = new TaskCleanDetailVO(); |
| | | XpTask task = this.getById(id); |
| | | if (task == null) { |
| | |
| | | .eq(XpVehicleClean::getTaskId, id).last("limit 1")); |
| | | if (vehicleDetection != null) { |
| | | res.setHandleTime(vehicleDetection.getCreateTime()); |
| | | |
| | | |
| | | |
| | | res.setTaskImage(vehicleDetection.getTaskImage()); |
| | | |
| | | String taskImage = res.getTaskImage(); |
| | | if (StringUtils.isNotBlank(taskImage)) { |
| | | JSONArray jsonArray = JSONArray.parseArray(taskImage); |
| | | ArrayList<String> list = new ArrayList<>(jsonArray.size()); |
| | | for (Object o : jsonArray) { |
| | | JSONObject jsonObject = JSONObject.parseObject(o.toString()); |
| | | String downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | list.add(downloadUrl); |
| | | } |
| | | res.setTaskImage(String.join(",", list)); |
| | | } |
| | | |
| | | res.setOperationUserId(vehicleDetection.getOperationsUserId()); |
| | | if (vehicleDetection.getOperationsUserId() != null) { |
| | | XpOperationsUser operationsUser = xpOperationUserClient.queryById(vehicleDetection.getOperationsUserId()).getData(); |
| | |
| | | |
| | | // 4. 构建分页结果 |
| | | PageInfo<XpTaskRecordVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | |
| | | for (XpTaskRecordVO record : records) { |
| | | |
| | | String taskImage =record.getTaskImage(); |
| | | if (StringUtils.isNotBlank(taskImage)) { |
| | | JSONArray jsonArray = JSONArray.parseArray(taskImage); |
| | | ArrayList<String> list = new ArrayList<>(jsonArray.size()); |
| | | for (Object o : jsonArray) { |
| | | JSONObject jsonObject = JSONObject.parseObject(o.toString()); |
| | | String downloadUrl = null; |
| | | try { |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | list.add(downloadUrl); |
| | | } |
| | | record.setTaskImage(String.join(",", list)); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | pageInfo.setRecords(records); |
| | | pageInfo.setTotal(resultPage.getTotal()); |
| | | return pageInfo; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public R<TaskManagementDetailVO> taskDetail(Long id) { |
| | | public R<TaskManagementDetailVO> taskDetail(Long id) throws UnsupportedEncodingException { |
| | | TaskManagementDetailVO managementDetailVO = new TaskManagementDetailVO(); |
| | | XpTask task = this.getById(id); |
| | | if (task == null) { |
| | |
| | | taskManagementDetectionDetailVO.setVehicleCode(vehicle.getVehicleCode()); |
| | | taskManagementDetectionDetailVO.setVehicleVin(vehicle.getVehicleVin()); |
| | | taskManagementDetectionDetailVO.setVehicleLocation(task.getVehicleLocation()); |
| | | taskManagementDetectionDetailVO.setVehiclePictures(vehicle.getVehiclePictures()); |
| | | |
| | | if(vehicle.getVehiclePictures()!=null){ |
| | | JSONObject jsonObject = JSONObject.parseObject(vehicle.getVehiclePictures()); |
| | | String downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | taskManagementDetectionDetailVO.setVehiclePictures(downloadUrl); |
| | | } |
| | | |
| | | taskManagementDetectionDetailVO.setTaskCode(task.getTaskCode()); |
| | | XpVehicleDetection vehicleDetection = vehicleDetectionMapper.selectOne(new LambdaQueryWrapper<XpVehicleDetection>() |
| | | .eq(XpVehicleDetection::getTaskId, id).last("limit 1")); |
| | |
| | | taskManagementDetectionDetailVO.setCollisionPrevention(vehicleDetection.getCollisionPrevention()); |
| | | taskManagementDetectionDetailVO.setSensorSelfCheck(vehicleDetection.getSensorSelfCheck()); |
| | | taskManagementDetectionDetailVO.setSensorCleaning(vehicleDetection.getSensorCleaning()); |
| | | taskManagementDetectionDetailVO.setSensorCleaningPicture(vehicleDetection.getSensorCleaningPicture()); |
| | | |
| | | |
| | | String SensorCleaningPicture = vehicleDetection.getSensorCleaningPicture(); |
| | | if (StringUtils.isNotBlank(SensorCleaningPicture)) { |
| | | JSONArray jsonArray = JSONArray.parseArray(SensorCleaningPicture); |
| | | ArrayList<String> list = new ArrayList<>(jsonArray.size()); |
| | | for (Object o : jsonArray) { |
| | | JSONObject jsonObject = JSONObject.parseObject(o.toString()); |
| | | String downloadUrl = null; |
| | | try { |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | list.add(downloadUrl); |
| | | } |
| | | taskManagementDetectionDetailVO.setSensorCleaningPicture(String.join(",", list)); |
| | | } |
| | | |
| | | |
| | | |
| | | taskManagementDetectionDetailVO.setInteractiveScreen(vehicleDetection.getInteractiveScreen()); |
| | | taskManagementDetectionDetailVO.setInteractiveScreenPicture(vehicleDetection.getInteractiveScreenPicture()); |
| | | |
| | | |
| | | String InteractiveScreenPicture =vehicleDetection.getInteractiveScreenPicture(); |
| | | if (StringUtils.isNotBlank(InteractiveScreenPicture)) { |
| | | JSONArray jsonArray = JSONArray.parseArray(InteractiveScreenPicture); |
| | | ArrayList<String> list = new ArrayList<>(jsonArray.size()); |
| | | for (Object o : jsonArray) { |
| | | JSONObject jsonObject = JSONObject.parseObject(o.toString()); |
| | | String downloadUrl = null; |
| | | try { |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | list.add(downloadUrl); |
| | | } |
| | | taskManagementDetectionDetailVO.setInteractiveScreenPicture(String.join(",", list)); |
| | | } |
| | | |
| | | taskManagementDetectionDetailVO.setHelpButton(vehicleDetection.getHelpButton()); |
| | | taskManagementDetectionDetailVO.setHelpButtonPicture(vehicleDetection.getHelpButtonPicture()); |
| | | |
| | | |
| | | String HelpButtonPicture =vehicleDetection.getHelpButtonPicture(); |
| | | if (StringUtils.isNotBlank(HelpButtonPicture)) { |
| | | JSONArray jsonArray = JSONArray.parseArray(HelpButtonPicture); |
| | | ArrayList<String> list = new ArrayList<>(jsonArray.size()); |
| | | for (Object o : jsonArray) { |
| | | JSONObject jsonObject = JSONObject.parseObject(o.toString()); |
| | | String downloadUrl = null; |
| | | try { |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | list.add(downloadUrl); |
| | | } |
| | | taskManagementDetectionDetailVO.setHelpButtonPicture(String.join(",", list)); |
| | | } |
| | | |
| | | taskManagementDetectionDetailVO.setPaymentFunction(vehicleDetection.getPaymentFunction()); |
| | | taskManagementDetectionDetailVO.setPaymentFunctionPicture(vehicleDetection.getPaymentFunctionPicture()); |
| | | |
| | | |
| | | String PaymentFunctionPicture =vehicleDetection.getPaymentFunctionPicture(); |
| | | if (StringUtils.isNotBlank(PaymentFunctionPicture)) { |
| | | JSONArray jsonArray = JSONArray.parseArray(PaymentFunctionPicture); |
| | | ArrayList<String> list = new ArrayList<>(jsonArray.size()); |
| | | for (Object o : jsonArray) { |
| | | JSONObject jsonObject = JSONObject.parseObject(o.toString()); |
| | | String downloadUrl = null; |
| | | try { |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | list.add(downloadUrl); |
| | | } |
| | | taskManagementDetectionDetailVO.setPaymentFunctionPicture(String.join(",", list)); |
| | | } |
| | | |
| | | |
| | | taskManagementDetectionDetailVO.setSystemCheck(vehicleDetection.getSystemCheck()); |
| | | taskManagementDetectionDetailVO.setSystemCheckPicture(vehicleDetection.getSystemCheckPicture()); |
| | | |
| | | |
| | | String SystemCheckPicture =vehicleDetection.getSystemCheckPicture(); |
| | | if (StringUtils.isNotBlank(SystemCheckPicture)) { |
| | | JSONArray jsonArray = JSONArray.parseArray(SystemCheckPicture); |
| | | ArrayList<String> list = new ArrayList<>(jsonArray.size()); |
| | | for (Object o : jsonArray) { |
| | | JSONObject jsonObject = JSONObject.parseObject(o.toString()); |
| | | String downloadUrl = null; |
| | | try { |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | list.add(downloadUrl); |
| | | } |
| | | taskManagementDetectionDetailVO.setSystemCheckPicture(String.join(",", list)); |
| | | } |
| | | |
| | | taskManagementDetectionDetailVO.setCheckTime(vehicleDetection.getCheckTime()); |
| | | taskManagementDetectionDetailVO.setOperationsUserId(vehicleDetection.getOperationsUserId()); |
| | | if (vehicleDetection.getOperationsUserId() != null) { |
| | |
| | | |
| | | managementDetailVO.setAccidentDetailVO(res); |
| | | } |
| | | |
| | | |
| | | |
| | | return R.ok(managementDetailVO); |
| | | } |
| | | |
| | |
| | | package com.xiaopeng.maintenance.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | |
| | | import com.xiaopeng.api.model.vehicleConvoy.XpVehicle; |
| | | import com.xiaopeng.common.core.domain.R; |
| | | import com.xiaopeng.common.core.web.page.PageInfo; |
| | | import com.xiaopeng.evi.oss.service.AliOssService; |
| | | import com.xiaopeng.maintenance.dto.XpVehicleRepairReturnDTO; |
| | | import com.xiaopeng.maintenance.dto.XpVehicleRepairStartDTO; |
| | | import com.xiaopeng.maintenance.mapper.XpVehicleRepairMapper; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.time.LocalDateTime; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | |
| | | private XpVehicleClient xpVehicleClient; |
| | | @Autowired |
| | | private XpOperationUserClient xpOperationUserClient; |
| | | |
| | | @Autowired |
| | | private AliOssService aliOssService; |
| | | |
| | | @Override |
| | | public XpVehicleRepairVO repairDetail(Long id) { |
| | |
| | | String userName = userNameMap.get(chargingRecord.getReturnUserId()); |
| | | vo.setOperatorEndName(userName); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | String RepairMoneyDetail = vo.getRepairMoneyDetail(); |
| | | if (StringUtils.isNotBlank(RepairMoneyDetail)) { |
| | | JSONArray jsonArray = JSONArray.parseArray(RepairMoneyDetail); |
| | | ArrayList<String> list = new ArrayList<>(jsonArray.size()); |
| | | for (Object o : jsonArray) { |
| | | JSONObject jsonObject = JSONObject.parseObject(o.toString()); |
| | | String downloadUrl = null; |
| | | try { |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | list.add(downloadUrl); |
| | | } |
| | | vo.setRepairMoneyDetail(String.join(",", list)); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | String StartRepairPicture = vo.getStartRepairPicture(); |
| | | if (StringUtils.isNotBlank(StartRepairPicture)) { |
| | | JSONArray jsonArray = JSONArray.parseArray(StartRepairPicture); |
| | | ArrayList<String> list = new ArrayList<>(jsonArray.size()); |
| | | for (Object o : jsonArray) { |
| | | JSONObject jsonObject = JSONObject.parseObject(o.toString()); |
| | | String downloadUrl = null; |
| | | try { |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | list.add(downloadUrl); |
| | | } |
| | | vo.setStartRepairPicture(String.join(",", list)); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | records.add(vo); |
| | | } |
| | | } |
| | |
| | | throw new ServiceException("当前点位在禁行区内,不能启用。", I18nKeyConstant.POINT_ENABLE_IN_PROHIBITED_AREA); |
| | | } |
| | | } |
| | | xpPoint.setFpElectronicAreaId(null); |
| | | xpPointService.updateById(xpPoint); |
| | | return R.ok(); |
| | | } |
| | |
| | | * @param latitude 纬度 |
| | | * @param fenceId 围栏ID |
| | | * @param collectionName 集合名称 |
| | | * @return 是否在围栏中 |
| | | * @return 是否在围栏中 true在 false不在 |
| | | */ |
| | | public boolean isInFence(double longitude, double latitude, String fenceId, String collectionName) { |
| | | if (fenceId == null || fenceId.trim().isEmpty()) { |
| | |
| | | || CollUtil.isNotEmpty(delPointIds) |
| | | || CollUtil.isNotEmpty(disablePointIds); |
| | | boolean needFenceAreaIds = needPointHandling || needAutoDisableByUnion; |
| | | XpElectronicFenceArea operationArea = needFenceAreaIds |
| | | ? xpElectronicFenceAreaService.lambdaQuery() |
| | | XpElectronicFenceArea operationArea = xpElectronicFenceAreaService.lambdaQuery() |
| | | .eq(XpElectronicFenceArea::getElectronicId, dto.getId()) |
| | | .eq(XpElectronicFenceArea::getAreaType, 1) |
| | | .orderByDesc(XpElectronicFenceArea::getId) |
| | | .last("limit 1") |
| | | .one() |
| | | : null; |
| | | .one(); |
| | | Long operationAreaId = operationArea == null ? null : operationArea.getId(); |
| | | if (needPointHandling && operationAreaId == null) { |
| | | throw new ServiceException("运营区域不存在", I18nKeyConstant.POINT_ELECTRONIC_AREA_NOT_EXIST); |
| | |
| | | } |
| | | |
| | | // 围栏运营时间缩短校验:若缩短后点位时间段不在新范围内,则更新为已停用(operation_status=3) |
| | | if (needAutoDisableByUnion && operationAreaId != null) { |
| | | if (true) { |
| | | LambdaQueryWrapper<XpPoint> pointQuery = new LambdaQueryWrapper<>(); |
| | | pointQuery.eq(XpPoint::getElectronicAreaId, operationAreaId) |
| | | .eq(XpPoint::getPointType, 1) |
| | |
| | | } |
| | | } |
| | | if (!disablePointIdList.isEmpty()) { |
| | | XpPoint updatePoint = new XpPoint(); |
| | | updatePoint.setOperationStatus(3); |
| | | UpdateWrapper<XpPoint> updateWrapper = new UpdateWrapper<>(); |
| | | updateWrapper.in("id", disablePointIdList); |
| | | updateWrapper.and(w -> w.isNull("operation_status").or().ne("operation_status", 4)); |
| | | xpPointMapper.update(updatePoint, updateWrapper); |
| | | log.info("围栏运营时间缩短停用点位完成 fenceId={}, disableCount={}", dto.getId(), disablePointIdList.size()); |
| | | for (Long l : disablePointIdList) { |
| | | XpPoint xpPoint = xpPointMapper.selectById(l); |
| | | if(xpPoint.getOperationStatus()!=4){ |
| | | xpPoint.setOperationStatus(3); |
| | | xpPoint.setVerificationStatus(5); |
| | | xpPointMapper.updateById(xpPoint); |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | public static void main(String[] args) { |
| | | String url = "https://tsapi.amap.com/v1/route/price?key=" + "66ae577f63898dae3016d599fda57221" + "&extensions=all&start=" +"113.384932" + "," + "23.155455"; |
| | | HashMap<String, Object> params = new HashMap<>(); |
| | | params.put("extensions", "all"); |
| | | params.put("start", "113.384932" + "," + "23.155455"); |
| | | params.put("end", "113.388209" + "," + "23.163455"); |
| | | params.put("routeUserType",2); |
| | | log.info("高德地图接口:{}", url); |
| | | log.info("高德地图参数:{}", params); |
| | | String post = HttpUtils.post(url, JSON.toJSONString(params)); |
| | | log.info("高德地图返回结果:"+ post); |
| | | JSONObject jsonObject = JSON.parseObject(post); |
| | | System.out.println(jsonObject); |
| | | } |
| | | |
| | | |
| | | |
| | | class ArrayPointsTask extends RecursiveTask<Long>{ |
| | | //最大定位集合阈值 |
| | |
| | | * main 自测:使用固定样例打印 old/new Union、是否修改/缩短,以及点位在旧/新范围内判断结果。 |
| | | */ |
| | | public static void main(String[] args) { |
| | | String pointJson = "[\"05:00-12:00\", \"13:00-23:59\"]"; |
| | | String strategyJson = "[{\"name\": \"策略组1\", \"time\": [\"06:00-12:00\", \"13:00-23:59\"], \"type\": 0, \"typeStr\": []}, {\"name\": \"策略组2\", \"time\": [\"05:00-12:00\", \"12:00-23:00\"], \"type\": 2, \"typeStr\": \"\"}, {\"name\": \"策略组3\", \"time\": [\"09:00-23:59\"], \"type\": 1, \"typeStr\": \"\"}]"; |
| | | String pointJson = "[\"05:00-12:00\", \"13:00-21:59\"]"; |
| | | String strategyJson = "[{\"name\": \"策略组1\", \"time\": [\"06:00-22:00\", \"22:00-23:59\"], \"type\": 0, \"typeStr\": []}, {\"name\": \"策略组2\", \"time\": [\"06:00-12:00\", \"12:00-23:00\"], \"type\": 2, \"typeStr\": \"\"}, {\"name\": \"策略组3\", \"time\": [\"09:00-23:59\"], \"type\": 1, \"typeStr\": \"\"}]"; |
| | | |
| | | OperationStrategyIndex index = OperationStrategyIndex.parse(strategyJson); |
| | | List<TimeInterval> pointIntervals = OperationStrategyIndex.parsePointEffectiveTimePeriod(pointJson); |
| | |
| | | package com.xiaopeng.operation.controller; |
| | | |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.xiaopeng.api.model.operation.XpBanner; |
| | | import com.xiaopeng.api.model.operation.XpWhitelist; |
| | | 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.evi.oss.service.AliOssService; |
| | | import com.xiaopeng.operation.query.BannerPageListQuery; |
| | | import com.xiaopeng.operation.query.WhitelistPageListQuery; |
| | | import com.xiaopeng.operation.service.XpBannerService; |
| | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.util.List; |
| | | |
| | | @Slf4j |
| | |
| | | |
| | | // banner实现类 |
| | | private final XpBannerService xpBannerService; |
| | | private final AliOssService aliOssService; |
| | | |
| | | public XpBannerManagementController(XpBannerService xpBannerService) { |
| | | public XpBannerManagementController(XpBannerService xpBannerService, AliOssService aliOssService) { |
| | | this.xpBannerService = xpBannerService; |
| | | this.aliOssService = aliOssService; |
| | | } |
| | | |
| | | |
| | |
| | | @ApiOperation(value = "详情banner") |
| | | @GetMapping("/detailBanner") |
| | | public R<XpBanner> detailBanner(Long id) { |
| | | return R.ok(xpBannerService.getById(id)); |
| | | XpBanner xpBanner = xpBannerService.getById(id); |
| | | |
| | | JSONObject jsonObject = JSON.parseArray(xpBanner.getBannerPictures()).getJSONObject(0); |
| | | String downloadUrl = null; |
| | | try { |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | xpBanner.setBannerPictures(downloadUrl); |
| | | |
| | | |
| | | return R.ok(xpBanner); |
| | | } |
| | | @ApiOperation(value = "删除banner") |
| | | @DeleteMapping("/deleteBanner") |
| | |
| | | public PageInfo<XpBanner> pageList(BannerPageListQuery query) { |
| | | PageInfo<XpBanner> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | List<XpBanner> list = this.baseMapper.pageList(pageInfo, query); |
| | | for (XpBanner xpBanner : list) { |
| | | JSONObject jsonObject = JSON.parseArray(xpBanner.getBannerPictures()).getJSONObject(0); |
| | | String downloadUrl = null; |
| | | try { |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | xpBanner.setBannerPictures(downloadUrl); |
| | | } |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | |
| | | |
| | | |
| | | @Override |
| | | @Deprecated |
| | | public RouteAndFareVo getRouteAndFare(RouteAndFareDto routeAndFareDto, String userId) { |
| | | |
| | | |
| | |
| | | |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.xiaopeng.evi.oss.service.AliOssService; |
| | | import com.xiaopeng.operation.dto.XpRideGuideDTO; |
| | | import com.xiaopeng.operation.mapper.XpRideGuideMapper; |
| | | import com.xiaopeng.api.model.operation.XpRideGuide; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | |
| | |
| | | */ |
| | | @Service |
| | | public class XpRideGuideServiceImpl extends ServiceImpl<XpRideGuideMapper, XpRideGuide> implements XpRideGuideService { |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @Resource |
| | | private AliOssService aliOssService; |
| | | |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public List<XpRideGuide> getGideList() { |
| | | return list(); |
| | | List<XpRideGuide> list = list(); |
| | | for (XpRideGuide xpRideGuide : list) { |
| | | |
| | | JSONObject jsonObject = JSON.parseObject(xpRideGuide.getGuideImage()); |
| | | String downloadUrl = null; |
| | | try { |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | xpRideGuide.setGuideImage(downloadUrl); |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.xiaopeng.api.dto.account.UcUserInfo; |
| | |
| | | import com.xiaopeng.api.model.operation.XpFeedbackType; |
| | | import com.xiaopeng.api.model.operation.XpUserFeedback; |
| | | import com.xiaopeng.common.core.web.page.PageInfo; |
| | | import com.xiaopeng.evi.oss.service.AliOssService; |
| | | import com.xiaopeng.operation.mapper.XpUserFeedbackMapper; |
| | | import com.xiaopeng.operation.query.UserFeedBackQuery; |
| | | import com.xiaopeng.operation.service.IXpFeedbackTypeService; |
| | |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | public class XpUserFeedbackServiceImpl extends ServiceImpl<XpUserFeedbackMapper, XpUserFeedback> implements IXpUserFeedbackService { |
| | | private final UserResourcesClient userResourcesClient; |
| | | private final IXpFeedbackTypeService xpFeedbackTypeService; |
| | | private final AliOssService aliOssService; |
| | | |
| | | @Override |
| | | public PageInfo<XpUserFeedbackVO> getPageList(UserFeedBackQuery query) { |
| | |
| | | pageInfo.setTotal(page.getTotal()); |
| | | pageInfo.setSize(page.getSize()); |
| | | pageInfo.setPages(page.getPages()); |
| | | |
| | | for (XpUserFeedbackVO xpUserFeedbackVO : xpUserFeedbackVOS) { |
| | | |
| | | |
| | | String feedbackPictures = xpUserFeedbackVO.getFeedbackPictures(); |
| | | if (StringUtils.isNotBlank(feedbackPictures)) { |
| | | JSONArray jsonArray = JSONArray.parseArray(feedbackPictures); |
| | | ArrayList<String> list = new ArrayList<>(jsonArray.size()); |
| | | for (Object o : jsonArray) { |
| | | JSONObject jsonObject = JSONObject.parseObject(o.toString()); |
| | | String downloadUrl = null; |
| | | try { |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | list.add(downloadUrl); |
| | | } |
| | | xpUserFeedbackVO.setFeedbackPictures(String.join(",", list)); |
| | | } |
| | | |
| | | } |
| | | |
| | | pageInfo.setRecords(xpUserFeedbackVOS); |
| | | return pageInfo; |
| | | } |
| | |
| | | lock.lock(10, TimeUnit.SECONDS); |
| | | log.info("队列 {} 车辆 {} 单号 {}", quoteName, vehiclePositionVo.getVin(), orderNo); |
| | | try { |
| | | |
| | | |
| | | |
| | | |
| | | // VehiclePosition vehiclePosition = vehiclePositionService.findByVehicleId(vehiclePositionVo.getVehicle_id()); |
| | | R<XpVehicle> vehiclePositionR = xpVehicleClient.findByVehicleVin(vehiclePositionVo.getVin()); |
| | | if (vehiclePositionR.getCode() != 200) { |
| | |
| | | if (vehiclePosition.getOperatingStatus() != 1 || vehiclePosition.getState() != 0 || vehiclePosition.getVehicleType() == 1) { |
| | | continue; |
| | | } |
| | | |
| | | // 再次查询一下订单 看是否取消 |
| | | xpOrderR = xpOrderClient.queryOrderByOrderNo(orderNo); |
| | | if (xpOrderR.getCode() != 200) { |
| | | continue; |
| | | } |
| | | xpOrder = xpOrderR.getData(); |
| | | if (xpOrder.getStatus() != 1) { |
| | | continue; |
| | | } |
| | | |
| | | |
| | | // 关闭巡游单子 |
| | | R stringR = xpCruiseOrderClient.cancelCruiseOrderByVin(vehiclePosition.getVehicleVin()); |
| | | if (stringR == null || stringR.getCode() != 200) { |
| | |
| | | if (vehicleId1.getOperatingStatus() != 1 || vehicleId1.getState() != 0 || vehicleId1.getVehicleType() == 1) { |
| | | continue; |
| | | } |
| | | |
| | | |
| | | // 再次查询一下订单 看是否取消 |
| | | xpOrderR = xpOrderClient.queryOrderByOrderNo(orderNo); |
| | | if (xpOrderR.getCode() != 200) { |
| | | continue; |
| | | } |
| | | xpOrder = xpOrderR.getData(); |
| | | if (xpOrder.getStatus() != 1) { |
| | | continue; |
| | | } |
| | | |
| | | // 关闭巡游单子 |
| | | R<?> stringR = xpCruiseOrderClient.cancelCruiseOrderByVin(vehicleId1.getVehicleVin()); |
| | | if (stringR == null || stringR.getCode() != 200) { |
| | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.net.URLEncoder; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | import static org.bouncycastle.asn1.x500.style.RFC4519Style.uid; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | public R<OrderDetailVo> orderDetail(@PathVariable("orderId") Long orderId, HttpServletRequest request) { |
| | | // uid已通过拦截器otp校验,可以直接使用 |
| | | String uid = request.getHeader("XP-Uid"); |
| | | return R.ok(xpOrderService.orderDetail(orderId, uid)); |
| | | OrderDetailVo orderDetailVo = xpOrderService.orderDetail(orderId, uid); |
| | | BigDecimal orderMoney = orderDetailVo.getOrderMoney(); |
| | | orderDetailVo.setOrderMoneyStr(orderMoney.setScale(2, RoundingMode.HALF_UP).toString()); |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | |
| | | /** |
| | | * 内部调用-结束订单 |
| | | * @param orderId |
| | | * @return |
| | | */ |
| | | @PostMapping("/inner/order/endTrip") |
| | | public R<?> endTrip(@RequestParam Long orderId){ |
| | | XpOrder xpOrder = xpOrderService.getById(orderId); |
| | | Boolean b = xpOrderService.endTrip(orderId, xpOrder.getAppUserId().toString()); |
| | | return R.ok(b); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * + |
| | | * 获取行程费用明细 |
| | | */ |
| | |
| | | List<FareBreakdownDetailVo> longDistance = new ArrayList<>(); |
| | | XpOrder order = this.getById(orderId); |
| | | |
| | | Long orderAppUserId = order.getAppUserId(); |
| | | if (order == null) { |
| | | throw new RuntimeException("订单不存在"); |
| | | } |
| | |
| | | |
| | | com.alibaba.fastjson.JSONObject basicPricingJson = com.alibaba.fastjson.JSONObject.parseObject(pricing.getBasicPricingJson()); |
| | | |
| | | XpPricingCardVo xpPricingCardVo = xpPricingUtil.calculationFixedPrice(orderAppUserId.toString(), basicPricingJson, null, mileageKilometers, duration1, 0, 0.0, pricing.getIsDynamicPrice(), order.getCityId(), pricing.getDynamicPricingJson()); |
| | | XpPricingCardVo xpPricingCardVo = xpPricingUtil.calculationFixedPrice(uid, basicPricingJson, null, mileageKilometers, duration1, 0, 0.0, pricing.getIsDynamicPrice(), order.getCityId(), pricing.getDynamicPricingJson()); |
| | | XpOrderDetail xpOrderDetail = new XpOrderDetail(); |
| | | xpOrderDetail.setDetailType(1); |
| | | xpOrderDetail.setOrderId(orderId); |
| | |
| | | order.setTripEnd(tripEnd); |
| | | this.updateById(order); |
| | | } |
| | | // 计算行程时间 单位分钟 |
| | | // 计算时间差 |
| | | Duration durationBetween = Duration.between(createTime, tripEnd); |
| | | |
| | | // 转换为秒并保留一位小数 |
| | | BigDecimal minutes = BigDecimal.valueOf(durationBetween.getSeconds()); |
| | | res.setTime(minutes); |
| | | double exactMinutes = Duration.between(order.getBoardingTime(), order.getTripEnd()).toMillis() / (1000.0 * 60); |
| | | res.setTime(new BigDecimal(exactMinutes).setScale(2, RoundingMode.HALF_UP)); |
| | | return R.ok(res); |
| | | } |
| | | |
| | |
| | | } else { |
| | | orderDetailVo.setOrderTime(0.0); |
| | | } |
| | | orderDetailVo.setTotalMileage(order.getMileageKilometers() != null ? new BigDecimal(order.getMileageKilometers()).setScale(2, RoundingMode.HALF_UP).doubleValue() : 0D); |
| | | |
| | | orderDetailVo.setTotalMileage(order.getMileageKilometers() != null ? new BigDecimal(order.getMileageKilometers() * 1000).setScale(2, RoundingMode.HALF_UP).doubleValue() : 0D); |
| | | orderDetailVo.setOrderTime(new BigDecimal(null == order.getDuration() ? 0 : order.getDuration()).multiply(new BigDecimal(60)).setScale(0, RoundingMode.HALF_EVEN).doubleValue()); |
| | | return orderDetailVo; |
| | | } |
| | | |
| | |
| | | private Double totalMileage; |
| | | @ApiModelProperty(value = "轨迹") |
| | | private List<OrderTrajectory> trajectories; |
| | | |
| | | |
| | | @ApiModelProperty(value = "订单金额Str") |
| | | private String orderMoneyStr; |
| | | } |
| | |
| | | import com.xiaopeng.common.redis.service.RedisService; |
| | | import com.xiaopeng.pushMessage.utils.MapMatchingUtil; |
| | | import io.swagger.annotations.Api; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.powermock.core.ListMap; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.annotation.Validated; |
| | |
| | | import java.util.*; |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | | @Slf4j |
| | | @Api(tags = "订单推送轨迹接口") |
| | | @RestController |
| | | @RequestMapping("") |
| | |
| | | routeVo.setPolyline(lonLatDtos); |
| | | |
| | | // 存储最新路线偏离缓存,后续进行轨迹截取 |
| | | // redisService.setCacheObject(CacheConstants.ORDER_ROUTE_CAPTURE + "_" + dto.getOrderId() + "_" +routeType, routeVo); |
| | | |
| | | redisService.setCacheObject(key, JSON.toJSONString(routeVo), 24L, TimeUnit.HOURS); |
| | | |
| | | // 封装轨迹点位集合 |
| | |
| | | sendMessageDTO.setAppUserId(String.valueOf(xpOrder.getAppUserId())); |
| | | sendMessageDTO.setMessage(JSONObject.toJSONString(params)); |
| | | xpPushMessageClient.sendRoute(sendMessageDTO); |
| | | log.info("推送剩余导航数据成功 {} {}", xpOrder.getOrderNumber(), JSON.toJSONString(routeVo)); |
| | | } |
| | | return R.ok(); |
| | | } |
| | |
| | | import com.xiaopeng.common.core.utils.WebUtils; |
| | | import com.xiaopeng.common.core.web.page.PageInfo; |
| | | import com.xiaopeng.common.security.service.TokenService; |
| | | import com.xiaopeng.evi.oss.service.AliOssService; |
| | | import com.xiaopeng.vehicleConvoy.constant.I18nKeyConstant; |
| | | import com.xiaopeng.vehicleConvoy.model.dto.*; |
| | | import com.xiaopeng.vehicleConvoy.model.exportExcel.XpVehicleExportExcel; |
| | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import javax.validation.Valid; |
| | | import java.io.File; |
| | | import java.io.FileInputStream; |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.io.*; |
| | | import java.net.URLEncoder; |
| | | import java.time.LocalDateTime; |
| | | import java.util.ArrayList; |
| | |
| | | private final MessageSource messageSource; |
| | | private final TokenService tokenService; |
| | | private final XpVehicleRepairClient xpVehicleRepairClient; |
| | | private final AliOssService aliOssService; |
| | | /** |
| | | * 根据ID列表批量查询车辆信息(内部接口) |
| | | * |
| | |
| | | * @return 车辆列表 |
| | | */ |
| | | @GetMapping("/inner/vehicle/queryById") |
| | | public R<XpVehicle> queryById(@RequestParam Long id) { |
| | | public R<XpVehicle> queryById(@RequestParam Long id) throws UnsupportedEncodingException { |
| | | XpVehicle xpVehicle = xpVehicleService.getById(id); |
| | | if (Objects.nonNull(xpVehicle)) { |
| | | |
| | | String vehiclePictures = xpVehicle.getVehiclePictures(); |
| | | if(vehiclePictures!=null){ |
| | | JSONObject jsonObject = JSON.parseObject(vehiclePictures); |
| | | String downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | xpVehicle.setVehiclePictures(downloadUrl); |
| | | } |
| | | |
| | | // 获取车队 |
| | | XpFleetVehicle xpFleetVehicle = vehicleService.getOne(new LambdaQueryWrapper<XpFleetVehicle>().eq(XpFleetVehicle::getVehicleId, xpVehicle.getId())); |
| | | if (Objects.nonNull(xpFleetVehicle)) { |
| | |
| | | @ApiOperation(value = "通过车辆id查询年检分页列表", tags = {"管理后台-车辆管理-运营车辆管理"}) |
| | | @PostMapping("/api/v1/vehicle/queryTaskRoutineByVehicleId") |
| | | public R<PageInfo<XpVehicleAnnualRecord>> queryTaskRoutineByVehicleId( |
| | | @Valid @RequestBody XpVehicleAnnualRecordPageQuery query){ |
| | | @Valid @RequestBody XpVehicleAnnualRecordPageQuery query) throws UnsupportedEncodingException { |
| | | return R.ok(xpVehicleAnnualRecordService.queryTaskRoutineByVehicleId(query)); |
| | | } |
| | | |
| | |
| | | import com.xiaopeng.common.core.web.page.PageInfo; |
| | | import com.xiaopeng.vehicleConvoy.model.query.XpVehicleAnnualRecordPageQuery; |
| | | |
| | | import java.io.UnsupportedEncodingException; |
| | | |
| | | /** |
| | | * <p> |
| | | * 车辆年检信息修改记录 服务类 |
| | |
| | | * @param query |
| | | * @return |
| | | */ |
| | | PageInfo<XpVehicleAnnualRecord> queryTaskRoutineByVehicleId(XpVehicleAnnualRecordPageQuery query); |
| | | PageInfo<XpVehicleAnnualRecord> queryTaskRoutineByVehicleId(XpVehicleAnnualRecordPageQuery query) throws UnsupportedEncodingException; |
| | | } |
| | |
| | | package com.xiaopeng.vehicleConvoy.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.xiaopeng.api.model.order.XpOrder; |
| | | import com.xiaopeng.api.model.vehicleConvoy.XpVehicleAnnualRecord; |
| | | import com.xiaopeng.common.core.web.page.PageInfo; |
| | | import com.xiaopeng.evi.oss.service.AliOssService; |
| | | import com.xiaopeng.vehicleConvoy.mapper.XpVehicleAnnualRecordMapper; |
| | | import com.xiaopeng.vehicleConvoy.model.query.XpVehicleAnnualRecordPageQuery; |
| | | import com.xiaopeng.vehicleConvoy.service.IXpVehicleAnnualRecordService; |
| | |
| | | import org.bouncycastle.jcajce.provider.symmetric.AES; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.time.LocalDateTime; |
| | | import java.time.LocalTime; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Service |
| | | public class XpVehicleAnnualRecordServiceImpl extends ServiceImpl<XpVehicleAnnualRecordMapper, XpVehicleAnnualRecord> implements IXpVehicleAnnualRecordService { |
| | | |
| | | @Resource |
| | | private AliOssService aliOssService; |
| | | |
| | | @Override |
| | | public PageInfo<XpVehicleAnnualRecord> queryTaskRoutineByVehicleId(XpVehicleAnnualRecordPageQuery query) { |
| | | public PageInfo<XpVehicleAnnualRecord> queryTaskRoutineByVehicleId(XpVehicleAnnualRecordPageQuery query) throws UnsupportedEncodingException { |
| | | // 构建分页参数 |
| | | PageInfo<XpVehicleAnnualRecord> page = new PageInfo<>(); |
| | | LambdaQueryWrapper<XpVehicleAnnualRecord> wrapper = new LambdaQueryWrapper<>(); |
| | |
| | | wrapper.like(StringUtils.isNotBlank(query.getOperationsUserName()), XpVehicleAnnualRecord::getCreateBy, query.getOperationsUserName()); |
| | | wrapper.eq(XpVehicleAnnualRecord::getVehicleId, query.getVehicleId()); |
| | | wrapper.orderByDesc(XpVehicleAnnualRecord::getCreateTime); |
| | | return this.page(page, wrapper); |
| | | |
| | | PageInfo<XpVehicleAnnualRecord> pageInfo = this.page(page, wrapper); |
| | | List<XpVehicleAnnualRecord> records = pageInfo.getRecords(); |
| | | for (XpVehicleAnnualRecord record : records) { |
| | | |
| | | String inspectionAttachments = record.getInspectionAttachments(); |
| | | if (StringUtils.isNotBlank(inspectionAttachments)) { |
| | | JSONArray jsonArray = JSONArray.parseArray(inspectionAttachments); |
| | | ArrayList<String> list = new ArrayList<>(jsonArray.size()); |
| | | for (Object o : jsonArray) { |
| | | JSONObject jsonObject = JSONObject.parseObject(o.toString()); |
| | | String downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | list.add(downloadUrl); |
| | | } |
| | | record.setInspectionAttachments(String.join(",", list)); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | String operationQualification = record.getOperationQualification(); |
| | | if (StringUtils.isNotBlank(operationQualification)) { |
| | | JSONArray jsonArray = JSONArray.parseArray(operationQualification); |
| | | ArrayList<String> list = new ArrayList<>(jsonArray.size()); |
| | | for (Object o : jsonArray) { |
| | | JSONObject jsonObject = JSONObject.parseObject(o.toString()); |
| | | String downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | list.add(downloadUrl); |
| | | } |
| | | record.setOperationQualification(String.join(",", list)); |
| | | } |
| | | |
| | | |
| | | String policyInformation = record.getPolicyInformation(); |
| | | if (StringUtils.isNotBlank(policyInformation)) { |
| | | JSONArray jsonArray = JSONArray.parseArray(policyInformation); |
| | | ArrayList<String> list = new ArrayList<>(jsonArray.size()); |
| | | for (Object o : jsonArray) { |
| | | JSONObject jsonObject = JSONObject.parseObject(o.toString()); |
| | | String downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | list.add(downloadUrl); |
| | | } |
| | | record.setPolicyInformation(String.join(",", list)); |
| | | } |
| | | |
| | | |
| | | } |
| | | pageInfo.setRecords( records); |
| | | return pageInfo; |
| | | } |
| | | } |
| | |
| | | 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); |
| | | // 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); |
| | | } |
| | | } |
| | | try { |
| | |
| | | xpVehicle.setWarehousingTime(LocalDateTime.now()); |
| | | //绑定XPUID |
| | | String vin = xpVehicle.getVehicleVin(); |
| | | String xpuid = xpuVinClient.getXpuIdByVin(vin).getData(); |
| | | R<String> xpuIdByVin = xpuVinClient.getXpuIdByVin(vin); |
| | | if(200 != xpuIdByVin.getCode()){ |
| | | throw new RuntimeException(xpuIdByVin.getMsg()); |
| | | } |
| | | String xpuid = xpuIdByVin.getData(); |
| | | xpVehicle.setXpuId(xpuid); |
| | | this.save(xpVehicle); |
| | | if (isInfoComplete(xpVehicle)) { |
| | |
| | | if (vinChanged || existingVehicle == null || StringUtils.isBlank(existingVehicle.getXpuId())) { |
| | | // 仅在 VIN 变更或原 XPUID 为空时才重新绑定 XPUID,避免不必要的远程调用 |
| | | String vin = xpVehicle.getVehicleVin(); |
| | | String xpuid = xpuVinClient.getXpuIdByVin(vin).getData(); |
| | | R<String> xpuIdByVin = xpuVinClient.getXpuIdByVin(vin); |
| | | if(200 != xpuIdByVin.getCode()){ |
| | | throw new RuntimeException(xpuIdByVin.getMsg()); |
| | | } |
| | | String xpuid = xpuIdByVin.getData(); |
| | | xpVehicle.setXpuId(xpuid); |
| | | } else { |
| | | xpVehicle.setXpuId(existingVehicle.getXpuId()); |