Merge remote-tracking branch 'origin/master'
# Conflicts:
# xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/utils/XpPricingUtil.java
| | |
| | | ALTER TABLE `xp_vehicle_detection_0` MODIFY COLUMN `network_detection` int NULL DEFAULT NULL COMMENT '网络检测' AFTER `vehicle_id`; |
| | | |
| | | ALTER TABLE `xp_vehicle_detection_0` MODIFY COLUMN `version_verification` int NULL DEFAULT NULL COMMENT '版本核对' AFTER `network_detection`; |
| | | |
| | | ALTER TABLE `xp_vehicle_detection_0` MODIFY COLUMN `communication_self_check` int NULL DEFAULT NULL COMMENT '通讯自检' AFTER `version_verification`; |
| | | |
| | | ALTER TABLE `xp_vehicle_detection_0` MODIFY COLUMN `remote_self_check` int NULL DEFAULT NULL COMMENT '远程自检' AFTER `communication_self_check`; |
| | | |
| | | ALTER TABLE `xp_vehicle_detection_0` MODIFY COLUMN `collision_prevention` int NULL DEFAULT NULL COMMENT '防撞激活' AFTER `remote_self_check`; |
| | | |
| | | ALTER TABLE `xp_vehicle_detection_0` MODIFY COLUMN `sensor_self_check` int NULL DEFAULT NULL COMMENT '传感器自检' AFTER `collision_prevention`; |
| | | |
| | | ALTER TABLE `xp_vehicle_detection_1` MODIFY COLUMN `network_detection` int NULL DEFAULT NULL COMMENT '网络检测' AFTER `vehicle_id`; |
| | | |
| | | ALTER TABLE `xp_vehicle_detection_1` MODIFY COLUMN `version_verification` int NULL DEFAULT NULL COMMENT '版本核对' AFTER `network_detection`; |
| | | |
| | | ALTER TABLE `xp_vehicle_detection_1` MODIFY COLUMN `communication_self_check` int NULL DEFAULT NULL COMMENT '通讯自检' AFTER `version_verification`; |
| | | |
| | | ALTER TABLE `xp_vehicle_detection_1` MODIFY COLUMN `remote_self_check` int NULL DEFAULT NULL COMMENT '远程自检' AFTER `communication_self_check`; |
| | | |
| | | ALTER TABLE `xp_vehicle_detection_1` MODIFY COLUMN `collision_prevention` int NULL DEFAULT NULL COMMENT '防撞激活' AFTER `remote_self_check`; |
| | | |
| | | ALTER TABLE `xp_vehicle_detection_1` MODIFY COLUMN `sensor_self_check` int NULL DEFAULT NULL COMMENT '传感器自检' AFTER `collision_prevention`; |
| | | |
| | | ALTER TABLE `xp_vehicle_detection_2` MODIFY COLUMN `network_detection` int NULL DEFAULT NULL COMMENT '网络检测' AFTER `vehicle_id`; |
| | | |
| | | ALTER TABLE `xp_vehicle_detection_2` MODIFY COLUMN `version_verification` int NULL DEFAULT NULL COMMENT '版本核对' AFTER `network_detection`; |
| | | |
| | | ALTER TABLE `xp_vehicle_detection_2` MODIFY COLUMN `communication_self_check` int NULL DEFAULT NULL COMMENT '通讯自检' AFTER `version_verification`; |
| | | |
| | | ALTER TABLE `xp_vehicle_detection_2` MODIFY COLUMN `remote_self_check` int NULL DEFAULT NULL COMMENT '远程自检' AFTER `communication_self_check`; |
| | | |
| | | ALTER TABLE `xp_vehicle_detection_2` MODIFY COLUMN `collision_prevention` int NULL DEFAULT NULL COMMENT '防撞激活' AFTER `remote_self_check`; |
| | | |
| | | ALTER TABLE `xp_vehicle_detection_2` MODIFY COLUMN `sensor_self_check` int NULL DEFAULT NULL COMMENT '传感器自检' AFTER `collision_prevention`; |
| | | |
| | | ALTER TABLE `xp_vehicle_detection_3` MODIFY COLUMN `network_detection` int NULL DEFAULT NULL COMMENT '网络检测' AFTER `vehicle_id`; |
| | | |
| | | ALTER TABLE `xp_vehicle_detection_3` MODIFY COLUMN `version_verification` int NULL DEFAULT NULL COMMENT '版本核对' AFTER `network_detection`; |
| | | |
| | | ALTER TABLE `xp_vehicle_detection_3` MODIFY COLUMN `communication_self_check` int NULL DEFAULT NULL COMMENT '通讯自检' AFTER `version_verification`; |
| | | |
| | | ALTER TABLE `xp_vehicle_detection_3` MODIFY COLUMN `remote_self_check` int NULL DEFAULT NULL COMMENT '远程自检' AFTER `communication_self_check`; |
| | | |
| | | ALTER TABLE `xp_vehicle_detection_3` MODIFY COLUMN `collision_prevention` int NULL DEFAULT NULL COMMENT '防撞激活' AFTER `remote_self_check`; |
| | | |
| | | ALTER TABLE `xp_vehicle_detection_3` MODIFY COLUMN `sensor_self_check` int NULL DEFAULT NULL COMMENT '传感器自检' AFTER `collision_prevention`; |
| | | |
| | | ALTER TABLE `xp_vehicle_detection_4` MODIFY COLUMN `network_detection` int NULL DEFAULT NULL COMMENT '网络检测' AFTER `vehicle_id`; |
| | | |
| | | ALTER TABLE `xp_vehicle_detection_4` MODIFY COLUMN `version_verification` int NULL DEFAULT NULL COMMENT '版本核对' AFTER `network_detection`; |
| | | |
| | | ALTER TABLE `xp_vehicle_detection_4` MODIFY COLUMN `communication_self_check` int NULL DEFAULT NULL COMMENT '通讯自检' AFTER `version_verification`; |
| | | |
| | | ALTER TABLE `xp_vehicle_detection_4` MODIFY COLUMN `remote_self_check` int NULL DEFAULT NULL COMMENT '远程自检' AFTER `communication_self_check`; |
| | | |
| | | ALTER TABLE `xp_vehicle_detection_4` MODIFY COLUMN `collision_prevention` int NULL DEFAULT NULL COMMENT '防撞激活' AFTER `remote_self_check`; |
| | | |
| | | ALTER TABLE `xp_vehicle_detection_4` MODIFY COLUMN `sensor_self_check` int NULL DEFAULT NULL COMMENT '传感器自检' AFTER `collision_prevention`; |
| | | |
| | | ALTER TABLE `xp_vehicle_detection_5` MODIFY COLUMN `network_detection` int NULL DEFAULT NULL COMMENT '网络检测' AFTER `vehicle_id`; |
| | | |
| | | ALTER TABLE `xp_vehicle_detection_5` MODIFY COLUMN `version_verification` int NULL DEFAULT NULL COMMENT '版本核对' AFTER `network_detection`; |
| | | |
| | | ALTER TABLE `xp_vehicle_detection_5` MODIFY COLUMN `communication_self_check` int NULL DEFAULT NULL COMMENT '通讯自检' AFTER `version_verification`; |
| | | |
| | | ALTER TABLE `xp_vehicle_detection_5` MODIFY COLUMN `remote_self_check` int NULL DEFAULT NULL COMMENT '远程自检' AFTER `communication_self_check`; |
| | | |
| | | ALTER TABLE `xp_vehicle_detection_5` MODIFY COLUMN `collision_prevention` int NULL DEFAULT NULL COMMENT '防撞激活' AFTER `remote_self_check`; |
| | | |
| | | ALTER TABLE `xp_vehicle_detection_5` MODIFY COLUMN `sensor_self_check` int NULL DEFAULT NULL COMMENT '传感器自检' AFTER `collision_prevention`; |
| | | |
| | | ALTER TABLE `xp_vehicle_detection_6` MODIFY COLUMN `network_detection` int NULL DEFAULT NULL COMMENT '网络检测' AFTER `vehicle_id`; |
| | | |
| | | ALTER TABLE `xp_vehicle_detection_6` MODIFY COLUMN `version_verification` int NULL DEFAULT NULL COMMENT '版本核对' AFTER `network_detection`; |
| | | |
| | | ALTER TABLE `xp_vehicle_detection_6` MODIFY COLUMN `communication_self_check` int NULL DEFAULT NULL COMMENT '通讯自检' AFTER `version_verification`; |
| | | |
| | | ALTER TABLE `xp_vehicle_detection_6` MODIFY COLUMN `remote_self_check` int NULL DEFAULT NULL COMMENT '远程自检' AFTER `communication_self_check`; |
| | | |
| | | ALTER TABLE `xp_vehicle_detection_6` MODIFY COLUMN `collision_prevention` int NULL DEFAULT NULL COMMENT '防撞激活' AFTER `remote_self_check`; |
| | | |
| | | ALTER TABLE `xp_vehicle_detection_6` MODIFY COLUMN `sensor_self_check` int NULL DEFAULT NULL COMMENT '传感器自检' AFTER `collision_prevention`; |
| | | |
| | | ALTER TABLE `xp_vehicle_detection_7` MODIFY COLUMN `network_detection` int NULL DEFAULT NULL COMMENT '网络检测' AFTER `vehicle_id`; |
| | | |
| | | ALTER TABLE `xp_vehicle_detection_7` MODIFY COLUMN `version_verification` int NULL DEFAULT NULL COMMENT '版本核对' AFTER `network_detection`; |
| | | |
| | | ALTER TABLE `xp_vehicle_detection_7` MODIFY COLUMN `communication_self_check` int NULL DEFAULT NULL COMMENT '通讯自检' AFTER `version_verification`; |
| | | |
| | | ALTER TABLE `xp_vehicle_detection_7` MODIFY COLUMN `remote_self_check` int NULL DEFAULT NULL COMMENT '远程自检' AFTER `communication_self_check`; |
| | | |
| | | ALTER TABLE `xp_vehicle_detection_7` MODIFY COLUMN `collision_prevention` int NULL DEFAULT NULL COMMENT '防撞激活' AFTER `remote_self_check`; |
| | | |
| | | ALTER TABLE `xp_vehicle_detection_7` MODIFY COLUMN `sensor_self_check` int NULL DEFAULT NULL COMMENT '传感器自检' AFTER `collision_prevention`; |
| | | |
| | | ALTER TABLE `xp_vehicle_detection_8` MODIFY COLUMN `network_detection` int NULL DEFAULT NULL COMMENT '网络检测' AFTER `vehicle_id`; |
| | | |
| | | 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_point_0` MODIFY COLUMN `point_pictures` json NULL COMMENT '点位照片' AFTER `remarks`; |
| | | |
| | | ALTER TABLE `xp_point_1` MODIFY COLUMN `point_pictures` json NULL COMMENT '点位照片' AFTER `remarks`; |
| | | |
| | | ALTER TABLE `xp_point_2` MODIFY COLUMN `point_pictures` json NULL COMMENT '点位照片' AFTER `remarks`; |
| | | |
| | | ALTER TABLE `xp_point_3` MODIFY COLUMN `point_pictures` json NULL COMMENT '点位照片' AFTER `remarks`; |
| | | |
| | | ALTER TABLE `xp_point_4` MODIFY COLUMN `point_pictures` json NULL COMMENT '点位照片' AFTER `remarks`; |
| | | |
| | | ALTER TABLE `xp_point_5` MODIFY COLUMN `point_pictures` json NULL COMMENT '点位照片' AFTER `remarks`; |
| | | |
| | | ALTER TABLE `xp_point_6` MODIFY COLUMN `point_pictures` json NULL COMMENT '点位照片' AFTER `remarks`; |
| | | |
| | | ALTER TABLE `xp_point_7` MODIFY COLUMN `point_pictures` json NULL COMMENT '点位照片' AFTER `remarks`; |
| | | |
| | | ALTER TABLE `xp_point_8` MODIFY COLUMN `point_pictures` json NULL COMMENT '点位照片' AFTER `remarks`; |
| | | |
| | | ALTER TABLE `xp_point_9` MODIFY COLUMN `point_pictures` json NULL COMMENT '点位照片' AFTER `remarks`; |
| | |
| | | log.error("保存订单轨迹数据失败,原因: {}", cause.getMessage()); |
| | | return R.fail("保存订单轨迹数据失败"); |
| | | } |
| | | |
| | | @Override |
| | | public R<?> endTrip(Long orderId) { |
| | | log.error("内部调用-结束订单失败,原因: {}", cause.getMessage()); |
| | | return R.fail("内部调用-结束订单失败:" + cause.getMessage()); |
| | | } |
| | | }; |
| | | } |
| | | } |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 内部调用-结束订单 |
| | | * @param orderId |
| | | * @return |
| | | */ |
| | | @PostMapping("/inner/order/endTrip") |
| | | R<?> endTrip(@RequestParam Long orderId); |
| | | |
| | | } |
| | |
| | | private Integer type; |
| | | @ApiModelProperty(value = "时段 例:18:00-19:00") |
| | | private String time; |
| | | @ApiModelProperty(value = "里程 单位公里") |
| | | @ApiModelProperty(value = "里程 单位m") |
| | | private BigDecimal mileage; |
| | | @ApiModelProperty(value = "时间 分钟") |
| | | @ApiModelProperty(value = "时间 秒") |
| | | private Double duration; |
| | | @ApiModelProperty(value = "金额") |
| | | private BigDecimal money; |
| | |
| | | } |
| | | break; |
| | | case ORDER_DROPOFF_COMPLETED: |
| | | //下车完成 |
| | | if(!orderId.contains("XU")){ |
| | | buildPushOrderStatus(orderId, OrderStatusEnum.APPROVAL_REJECTION, sequence); |
| | | xpOrderClient.updateOrderStatus(Long.parseLong(orderId), OrderStatusEnum.APPROVAL_REJECTION.getCode()); |
| | | } |
| | | //下车完成,不需要处理状态,由后续的乘客主动触发或者定时任务触发 |
| | | log.info("乘客已下车,不做任何处理:{}", orderId); |
| | | // if(!orderId.contains("XU")){ |
| | | // buildPushOrderStatus(orderId, OrderStatusEnum.APPROVAL_REJECTION, sequence); |
| | | // xpOrderClient.updateOrderStatus(Long.parseLong(orderId), OrderStatusEnum.APPROVAL_REJECTION.getCode()); |
| | | // } |
| | | break; |
| | | case ORDER_COMPLETED: |
| | | //已完成 |
| | |
| | | package com.xiaopeng.itinerary.utils; |
| | | |
| | | |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.alibaba.fastjson2.JSONArray; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.xiaopeng.api.dto.order.GetOrderNumDto; |
| | |
| | | */ |
| | | public static Integer getStartMileage(String startingFareJsonStr) { |
| | | Date date = new Date(); |
| | | JSONArray startingFareJson = JSONObject.parseArray(startingFareJsonStr); |
| | | JSONArray startingFareJson = JSON.parseArray(startingFareJsonStr); |
| | | for (Object o : startingFareJson) { |
| | | JSONObject startingFare = (JSONObject) o; |
| | | Calendar calendarStart = Calendar.getInstance(); |
| | |
| | | // 时间段 |
| | | xpPricingCardVo.setTime(rule.getString("startTime") + " - " + rule.getString("endTime")); |
| | | |
| | | xpPricingCardVo.setDistancePriceNormal(rule.getDouble("num2")); |
| | | xpPricingCardVo.setDistancePriceNormal(rule.getDouble("num2")*1000); |
| | | |
| | | xpPricingCardVo.setDurationPriceNormal(rule.getDouble("num3")); |
| | | xpPricingCardVo.setDurationPriceNormal(rule.getDouble("num3")*60); |
| | | |
| | | |
| | | // 里程 |
| | |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | String taskImage = xpTask.getTaskImage(); |
| | | if (StringUtils.isNotBlank(taskImage)) { |
| | | JSONArray jsonArray = JSONArray.parseArray(taskImage); |
| | | for (Object o : jsonArray) { |
| | | JSONObject jsonObject = (JSONObject)o; |
| | | String downloadUrl = null; |
| | | for (int i = 0; i < jsonArray.size(); i++) { |
| | | JSONObject jsonObject = jsonArray.getJSONObject(i); |
| | | if (Objects.isNull(jsonObject)) { |
| | | continue; |
| | | } |
| | | String downloadUrl = jsonObject.getString("url");; |
| | | try { |
| | | // 1 |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | throw new RuntimeException(e); |
| | | log.error("获取图片下载地址失败", e); |
| | | } |
| | | jsonObject.put("url", downloadUrl); |
| | | } |
| | |
| | | if (org.apache.commons.lang3.StringUtils.isNotBlank(vehiclePictures)) { |
| | | JSONObject jsonObject = JSONObject.parseObject(vehiclePictures); |
| | | //1 |
| | | String downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | String downloadUrl = jsonObject.getString("url");; |
| | | try { |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | log.error("获取图片下载地址失败", e); |
| | | } |
| | | jsonObject.put("url", downloadUrl); |
| | | vehicle.setVehiclePictures(jsonObject.toJSONString()); |
| | | } |
| | |
| | | import com.xiaopeng.maintenance.service.XpTaskService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | 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 java.io.UnsupportedEncodingException; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | * @author xiaochen |
| | | * @since 2026-02-06 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags = "车辆清洁") |
| | | @RestController |
| | | @RequestMapping("") |
| | |
| | | if (vehiclePictures != null && !vehiclePictures.isEmpty()) { |
| | | JSONObject jsonObject = JSONObject.parseObject(vehiclePictures); |
| | | // 1 |
| | | String downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | String downloadUrl = jsonObject.getString("url");; |
| | | try { |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | log.error("获取图片下载地址失败", e); |
| | | } |
| | | jsonObject.put("url", downloadUrl); |
| | | xpVehicleCleanVO.setVehiclePictures(jsonObject.toJSONString()); |
| | | } |
| | |
| | | String taskImage = xpVehicleCleanVO.getTaskImage(); |
| | | if (StringUtils.isNotBlank(taskImage)) { |
| | | JSONArray jsonArray = JSONArray.parseArray(taskImage); |
| | | for (Object o : jsonArray) { |
| | | JSONObject jsonObject = (JSONObject)o; |
| | | String downloadUrl = null; |
| | | for (int i = 0; i < jsonArray.size(); i++) { |
| | | JSONObject jsonObject = jsonArray.getJSONObject(i); |
| | | if (Objects.isNull(jsonObject)) { |
| | | continue; |
| | | } |
| | | String downloadUrl = jsonObject.getString("url");; |
| | | try { |
| | | //1 |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | throw new RuntimeException(e); |
| | | log.error("获取图片下载地址失败", e); |
| | | } |
| | | jsonObject.put("url", downloadUrl); |
| | | } |
| | |
| | | String taskImage = record.getTaskImage(); |
| | | if (StringUtils.isNotBlank(taskImage)) { |
| | | JSONArray jsonArray = JSONArray.parseArray(taskImage); |
| | | for (Object o : jsonArray) { |
| | | JSONObject jsonObject = (JSONObject)o; |
| | | String downloadUrl = null; |
| | | for (int i = 0; i < jsonArray.size(); i++) { |
| | | JSONObject jsonObject = jsonArray.getJSONObject(i); |
| | | if (Objects.isNull(jsonObject)) { |
| | | continue; |
| | | } |
| | | String downloadUrl = jsonObject.getString("url");; |
| | | try { |
| | | //1 |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | throw new RuntimeException(e); |
| | | log.error("获取图片下载地址失败", e); |
| | | } |
| | | jsonObject.put("url", downloadUrl); |
| | | } |
| | |
| | | import com.xiaopeng.maintenance.service.XpTaskService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | 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 java.time.LocalDateTime; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @author xiaochen |
| | | * @since 2026-02-06 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags = "车辆检测") |
| | | @RestController |
| | | @RequestMapping("") |
| | |
| | | String vehiclePictures = xpVehicleDetectionVO.getVehiclePictures(); |
| | | if (vehiclePictures != null && !vehiclePictures.isEmpty()) { |
| | | JSONObject jsonObject = JSONObject.parseObject(vehiclePictures); |
| | | // 1 |
| | | String downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | // 2 |
| | | String downloadUrl = jsonObject.getString("url");; |
| | | try { |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | log.error("获取图片下载地址失败", e); |
| | | } |
| | | jsonObject.put("url", downloadUrl); |
| | | xpVehicleDetectionVO.setVehiclePictures(jsonObject.toJSONString()); |
| | | } |
| | |
| | | String sensorCleaningPicture = xpVehicleDetectionVO.getSensorCleaningPicture(); |
| | | if (StringUtils.isNotBlank(sensorCleaningPicture)) { |
| | | JSONArray jsonArray = JSONArray.parseArray(sensorCleaningPicture); |
| | | for (Object o : jsonArray) { |
| | | JSONObject jsonObject = (JSONObject)o; |
| | | String downloadUrl = null; |
| | | for (int i = 0; i < jsonArray.size(); i++) { |
| | | JSONObject jsonObject = jsonArray.getJSONObject(i); |
| | | // 1 |
| | | String downloadUrl = jsonObject.getString("url");; |
| | | try { |
| | | //1 |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | throw new RuntimeException(e); |
| | | log.error("获取图片下载地址失败", e); |
| | | } |
| | | jsonObject.put("url", downloadUrl); |
| | | } |
| | |
| | | String interactiveScreenPicture = xpVehicleDetectionVO.getInteractiveScreenPicture(); |
| | | if (StringUtils.isNotBlank(interactiveScreenPicture)) { |
| | | JSONArray jsonArray = JSONArray.parseArray(interactiveScreenPicture); |
| | | for (Object o : jsonArray) { |
| | | JSONObject jsonObject = (JSONObject)o; |
| | | String downloadUrl = null; |
| | | for (int i = 0; i < jsonArray.size(); i++) { |
| | | JSONObject jsonObject = jsonArray.getJSONObject(i); |
| | | // 1 |
| | | String downloadUrl = jsonObject.getString("url");; |
| | | try { |
| | | //1 |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | throw new RuntimeException(e); |
| | | log.error("获取图片下载地址失败", e); |
| | | } |
| | | jsonObject.put("url", downloadUrl); |
| | | } |
| | |
| | | String helpButtonPicture = xpVehicleDetectionVO.getHelpButtonPicture(); |
| | | if (StringUtils.isNotBlank(helpButtonPicture)) { |
| | | JSONArray jsonArray = JSONArray.parseArray(helpButtonPicture); |
| | | for (Object o : jsonArray) { |
| | | JSONObject jsonObject = (JSONObject)o; |
| | | String downloadUrl = null; |
| | | for (int i = 0; i < jsonArray.size(); i++) { |
| | | JSONObject jsonObject = jsonArray.getJSONObject(i); |
| | | // 1 |
| | | String downloadUrl = jsonObject.getString("url");; |
| | | try { |
| | | //1 |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | throw new RuntimeException(e); |
| | | log.error("获取图片下载地址失败", e); |
| | | } |
| | | jsonObject.put("url", downloadUrl); |
| | | } |
| | |
| | | String paymentFunctionPicture = xpVehicleDetectionVO.getPaymentFunctionPicture(); |
| | | if (StringUtils.isNotBlank(paymentFunctionPicture)) { |
| | | JSONArray jsonArray = JSONArray.parseArray(paymentFunctionPicture); |
| | | for (Object o : jsonArray) { |
| | | JSONObject jsonObject = (JSONObject)o; |
| | | String downloadUrl = null; |
| | | for (int i = 0; i < jsonArray.size(); i++) { |
| | | JSONObject jsonObject = jsonArray.getJSONObject(i); |
| | | // 1 |
| | | String downloadUrl = jsonObject.getString("url");; |
| | | try { |
| | | //1 |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | throw new RuntimeException(e); |
| | | log.error("获取图片下载地址失败", e); |
| | | } |
| | | jsonObject.put("url", downloadUrl); |
| | | } |
| | |
| | | String systemCheckPicture = xpVehicleDetectionVO.getSystemCheckPicture(); |
| | | if (StringUtils.isNotBlank(systemCheckPicture)) { |
| | | JSONArray jsonArray = JSONArray.parseArray(systemCheckPicture); |
| | | for (Object o : jsonArray) { |
| | | JSONObject jsonObject = (JSONObject)o; |
| | | String downloadUrl = null; |
| | | for (int i = 0; i < jsonArray.size(); i++) { |
| | | JSONObject jsonObject = jsonArray.getJSONObject(i); |
| | | // 1 |
| | | String downloadUrl = jsonObject.getString("url");; |
| | | try { |
| | | //1 |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | throw new RuntimeException(e); |
| | | log.error("获取图片下载地址失败", e); |
| | | } |
| | | jsonObject.put("url", downloadUrl); |
| | | } |
| | |
| | | if (vehiclePictures != null && !vehiclePictures.isEmpty()) { |
| | | JSONObject jsonObject = JSONObject.parseObject(vehiclePictures); |
| | | // 1 |
| | | String downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | String downloadUrl = jsonObject.getString("url");; |
| | | try { |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | log.error("获取图片下载地址失败", e); |
| | | } |
| | | jsonObject.put("url", downloadUrl); |
| | | xpVehicleDetectionVO.setVehiclePictures(jsonObject.toJSONString()); |
| | | } |
| | |
| | | String sensorCleaningPicture = xpVehicleDetectionVO.getSensorCleaningPicture(); |
| | | if (StringUtils.isNotBlank(sensorCleaningPicture)) { |
| | | JSONArray jsonArray = JSONArray.parseArray(sensorCleaningPicture); |
| | | for (Object o : jsonArray) { |
| | | JSONObject jsonObject = (JSONObject)o; |
| | | String downloadUrl = null; |
| | | for (int i = 0; i < jsonArray.size(); i++) { |
| | | JSONObject jsonObject = jsonArray.getJSONObject(i); |
| | | // 1 |
| | | String downloadUrl = jsonObject.getString("url");; |
| | | try { |
| | | // 1 |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | throw new RuntimeException(e); |
| | | log.error("获取图片下载地址失败", e); |
| | | } |
| | | jsonObject.put("url", downloadUrl); |
| | | } |
| | |
| | | String interactiveScreenPicture = xpVehicleDetectionVO.getInteractiveScreenPicture(); |
| | | if (StringUtils.isNotBlank(interactiveScreenPicture)) { |
| | | JSONArray jsonArray = JSONArray.parseArray(interactiveScreenPicture); |
| | | for (Object o : jsonArray) { |
| | | JSONObject jsonObject = (JSONObject)o; |
| | | String downloadUrl = null; |
| | | for (int i = 0; i < jsonArray.size(); i++) { |
| | | JSONObject jsonObject = jsonArray.getJSONObject(i); |
| | | if (Objects.isNull(jsonObject)) { |
| | | continue; |
| | | } |
| | | // 1 |
| | | String downloadUrl = jsonObject.getString("url");; |
| | | try { |
| | | //1 |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | throw new RuntimeException(e); |
| | | log.error("获取图片下载地址失败", e); |
| | | } |
| | | jsonObject.put("url", downloadUrl); |
| | | } |
| | |
| | | String helpButtonPicture = xpVehicleDetectionVO.getHelpButtonPicture(); |
| | | if (StringUtils.isNotBlank(helpButtonPicture)) { |
| | | JSONArray jsonArray = JSONArray.parseArray(helpButtonPicture); |
| | | for (Object o : jsonArray) { |
| | | JSONObject jsonObject = (JSONObject)o; |
| | | String downloadUrl = null; |
| | | for (int i = 0; i < jsonArray.size(); i++) { |
| | | JSONObject jsonObject = jsonArray.getJSONObject(i); |
| | | if (Objects.isNull(jsonObject)) { |
| | | continue; |
| | | } |
| | | // 1 |
| | | String downloadUrl = jsonObject.getString("url");; |
| | | try { |
| | | //1 |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | throw new RuntimeException(e); |
| | | log.error("获取图片下载地址失败", e); |
| | | } |
| | | jsonObject.put("url", downloadUrl); |
| | | } |
| | |
| | | String paymentFunctionPicture = xpVehicleDetectionVO.getPaymentFunctionPicture(); |
| | | if (StringUtils.isNotBlank(paymentFunctionPicture)) { |
| | | JSONArray jsonArray = JSONArray.parseArray(paymentFunctionPicture); |
| | | for (Object o : jsonArray) { |
| | | JSONObject jsonObject = (JSONObject)o; |
| | | String downloadUrl = null; |
| | | for (int i = 0; i < jsonArray.size(); i++) { |
| | | JSONObject jsonObject = jsonArray.getJSONObject(i); |
| | | if (Objects.isNull(jsonObject)) { |
| | | continue; |
| | | } |
| | | // 1 |
| | | String downloadUrl = jsonObject.getString("url");; |
| | | try { |
| | | //1 |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | throw new RuntimeException(e); |
| | | log.error("获取图片下载地址失败", e); |
| | | } |
| | | jsonObject.put("url", downloadUrl); |
| | | } |
| | |
| | | String systemCheckPicture = xpVehicleDetectionVO.getSystemCheckPicture(); |
| | | if (StringUtils.isNotBlank(systemCheckPicture)) { |
| | | JSONArray jsonArray = JSONArray.parseArray(systemCheckPicture); |
| | | for (Object o : jsonArray) { |
| | | JSONObject jsonObject = (JSONObject)o; |
| | | String downloadUrl = null; |
| | | for (int i = 0; i < jsonArray.size(); i++) { |
| | | JSONObject jsonObject = jsonArray.getJSONObject(i); |
| | | if (Objects.isNull(jsonObject)) { |
| | | continue; |
| | | } |
| | | // 1 |
| | | String downloadUrl = jsonObject.getString("url");; |
| | | try { |
| | | //1 |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | throw new RuntimeException(e); |
| | | log.error("获取图片下载地址失败", e); |
| | | } |
| | | jsonObject.put("url", downloadUrl); |
| | | } |
| | |
| | | if (StringUtils.isNotBlank(vehiclePictures)) { |
| | | JSONObject jsonObject = JSONObject.parseObject(vehiclePictures); |
| | | // 1 |
| | | String downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | String downloadUrl = jsonObject.getString("url");; |
| | | try { |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | log.error("获取图片下载地址失败", e); |
| | | } |
| | | jsonObject.put("url", downloadUrl); |
| | | record.setVehiclePictures(jsonObject.toJSONString()); |
| | | } |
| | |
| | | import com.xiaopeng.maintenance.service.XpTaskService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | 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; |
| | |
| | | * @author xiaochen |
| | | * @since 2026-02-06 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags = "车辆整备") |
| | | @RestController |
| | | @RequestMapping("") |
| | |
| | | if (StringUtils.isNotBlank(vehiclePictures)) { |
| | | JSONObject jsonObject = JSONObject.parseObject(vehiclePictures); |
| | | // 1 |
| | | String downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | String downloadUrl = jsonObject.getString("url");; |
| | | try { |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | log.error("获取图片下载地址失败", e); |
| | | } |
| | | jsonObject.put("url", downloadUrl); |
| | | xpVehiclePreparationVO.setVehiclePictures(jsonObject.toJSONString()); |
| | | } |
| | |
| | | import com.xiaopeng.maintenance.vo.RepairStatusVO; |
| | | 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.validation.annotation.Validated; |
| | |
| | | * @author xiaochen |
| | | * @since 2026-02-06 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags = "车辆维修") |
| | | @RestController |
| | | public class XpVehicleRepairController { |
| | |
| | | if (StringUtils.isNotBlank(vehiclePictures)) { |
| | | JSONObject jsonObject = JSONObject.parseObject(vehiclePictures); |
| | | // 1 |
| | | String downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | String downloadUrl = jsonObject.getString("url");; |
| | | try { |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | log.error("获取图片下载地址失败", e); |
| | | } |
| | | jsonObject.put("url", downloadUrl); |
| | | xpVehicleRepairVO.setVehiclePictures(jsonObject.toJSONString()); |
| | | } |
| | |
| | | String startRepairPicture = xpVehicleRepairVO.getStartRepairPicture(); |
| | | if (StringUtils.isNotBlank(startRepairPicture)) { |
| | | JSONArray jsonArray = JSONArray.parseArray(startRepairPicture); |
| | | for (Object o : jsonArray) { |
| | | JSONObject jsonObject = (JSONObject)o; |
| | | String downloadUrl = null; |
| | | for (int i = 0; i < jsonArray.size(); i++) { |
| | | JSONObject jsonObject = jsonArray.getJSONObject(i); |
| | | if (Objects.isNull(jsonObject)) { |
| | | continue; |
| | | } |
| | | // 1 |
| | | String downloadUrl = jsonObject.getString("url");; |
| | | try { |
| | | // 1 |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | throw new RuntimeException(e); |
| | | log.error("获取图片下载地址失败", e); |
| | | } |
| | | jsonObject.put("url", downloadUrl); |
| | | } |
| | |
| | | if (StringUtils.isNotBlank(vehiclePictures)) { |
| | | JSONObject jsonObject = JSONObject.parseObject(vehiclePictures); |
| | | //1 |
| | | String downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | String downloadUrl = jsonObject.getString("url");; |
| | | try { |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | log.error("获取图片下载地址失败", e); |
| | | } |
| | | jsonObject.put("url", downloadUrl); |
| | | record.setVehiclePictures(jsonObject.toJSONString()); |
| | | } |
| | |
| | | String startRepairPicture = record.getStartRepairPicture(); |
| | | if (StringUtils.isNotBlank(startRepairPicture)) { |
| | | JSONArray jsonArray = JSONArray.parseArray(startRepairPicture); |
| | | for (Object o : jsonArray) { |
| | | JSONObject jsonObject = (JSONObject)o; |
| | | String downloadUrl = null; |
| | | for (int i = 0; i < jsonArray.size(); i++) { |
| | | JSONObject jsonObject = jsonArray.getJSONObject(i); |
| | | if (Objects.isNull(jsonObject)) { |
| | | continue; |
| | | } |
| | | String downloadUrl = jsonObject.getString("url");; |
| | | try { |
| | | //1 |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | throw new RuntimeException(e); |
| | | log.error("获取图片下载地址失败", e); |
| | | } |
| | | jsonObject.put("url", downloadUrl); |
| | | } |
| | |
| | | String problemImage = detail.getProblemImage(); |
| | | if (StringUtils.isNotBlank(problemImage)) { |
| | | JSONArray jsonArray = JSONArray.parseArray(problemImage); |
| | | for (Object o : jsonArray) { |
| | | JSONObject jsonObject = (JSONObject)o; |
| | | String downloadUrl = null; |
| | | for (int i = 0; i < jsonArray.size(); i++) { |
| | | JSONObject jsonObject = jsonArray.getJSONObject(i); |
| | | // 1 |
| | | String downloadUrl = jsonObject.getString("url");; |
| | | try { |
| | | // 1 |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | throw new RuntimeException(e); |
| | | log.error("获取图片下载地址失败", e); |
| | | } |
| | | jsonObject.put("url", downloadUrl); |
| | | } |
| | |
| | | if (StringUtils.isNotBlank(vehiclePictures)) { |
| | | JSONObject jsonObject = JSONObject.parseObject(vehiclePictures); |
| | | // 1 |
| | | String downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | String downloadUrl = jsonObject.getString("url");; |
| | | try { |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | log.error("获取图片下载地址失败", e); |
| | | } |
| | | jsonObject.put("url", downloadUrl); |
| | | xpChargingRecordVO.setVehiclePictures(jsonObject.toJSONString()); |
| | | } |
| | |
| | | String vehiclePictures = vo.getVehiclePictures(); |
| | | if (StringUtils.isNotBlank(vehiclePictures)) { |
| | | JSONArray jsonArray = JSONArray.parseArray(vehiclePictures); |
| | | for (Object o : jsonArray) { |
| | | JSONObject jsonObject = (JSONObject)o; |
| | | String downloadUrl = null; |
| | | for (int i = 0; i < jsonArray.size(); i++) { |
| | | JSONObject jsonObject = jsonArray.getJSONObject(i); |
| | | if (Objects.isNull(jsonObject)) { |
| | | continue; |
| | | } |
| | | String downloadUrl = jsonObject.getString("url");; |
| | | try { |
| | | //1 |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | throw new RuntimeException(e); |
| | | log.error("获取图片下载地址失败", e); |
| | | } |
| | | jsonObject.put("url", downloadUrl); |
| | | } |
| | |
| | | String startChargingPicture = vo.getStartChargingPicture(); |
| | | if (StringUtils.isNotBlank(startChargingPicture)) { |
| | | JSONArray jsonArray = JSONArray.parseArray(startChargingPicture); |
| | | for (Object o : jsonArray) { |
| | | JSONObject jsonObject = (JSONObject)o; |
| | | String downloadUrl = null; |
| | | for (int i = 0; i < jsonArray.size(); i++) { |
| | | JSONObject jsonObject = jsonArray.getJSONObject(i); |
| | | if (Objects.isNull(jsonObject)) { |
| | | continue; |
| | | } |
| | | String downloadUrl = jsonObject.getString("url");; |
| | | try { |
| | | // 1 |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | throw new RuntimeException(e); |
| | | log.error("获取图片下载地址失败", e); |
| | | } |
| | | jsonObject.put("url", downloadUrl); |
| | | } |
| | |
| | | String endChargingPicture = vo.getEndChargingPicture(); |
| | | if (StringUtils.isNotBlank(endChargingPicture)) { |
| | | JSONArray jsonArray = JSONArray.parseArray(endChargingPicture); |
| | | for (Object o : jsonArray) { |
| | | JSONObject jsonObject = (JSONObject)o; |
| | | String downloadUrl = null; |
| | | for (int i = 0; i < jsonArray.size(); i++) { |
| | | JSONObject jsonObject = jsonArray.getJSONObject(i); |
| | | if (Objects.isNull(jsonObject)) { |
| | | continue; |
| | | } |
| | | String downloadUrl = jsonObject.getString("url");; |
| | | try { |
| | | // 1 |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | throw new RuntimeException(e); |
| | | log.error("获取图片下载地址失败", e); |
| | | } |
| | | jsonObject.put("url", downloadUrl); |
| | | } |
| | |
| | | if (StringUtils.isNotBlank(vehiclePictures)) { |
| | | JSONObject jsonObject = JSONObject.parseObject(vehiclePictures); |
| | | //1 |
| | | String downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | String downloadUrl = jsonObject.getString("url");; |
| | | try { |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | log.error("获取图片下载地址失败", e); |
| | | } |
| | | jsonObject.put("url", downloadUrl); |
| | | workBenchVO.setVehiclePictures(jsonObject.toJSONString()); |
| | | } |
| | |
| | | String taskImage = res.getTaskImage(); |
| | | if (StringUtils.isNotBlank(taskImage)) { |
| | | JSONArray jsonArray = JSONArray.parseArray(taskImage); |
| | | for (Object o : jsonArray) { |
| | | JSONObject jsonObject = (JSONObject)o; |
| | | // 1 |
| | | String downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | for (int i = 0; i < jsonArray.size(); i++) { |
| | | JSONObject jsonObject = jsonArray.getJSONObject(i); |
| | | if (Objects.isNull(jsonObject)) { |
| | | continue; |
| | | } |
| | | String downloadUrl = jsonObject.getString("url");; |
| | | try { |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | log.error("获取图片下载地址失败", e); |
| | | } |
| | | jsonObject.put("url", downloadUrl); |
| | | } |
| | | res.setTaskImage(JSONArray.toJSONString(jsonArray)); |
| | |
| | | String taskImage = res.getTaskImage(); |
| | | if (StringUtils.isNotBlank(taskImage)) { |
| | | JSONArray jsonArray = JSONArray.parseArray(taskImage); |
| | | for (Object o : jsonArray) { |
| | | JSONObject jsonObject = (JSONObject)o; |
| | | for (int i = 0; i < jsonArray.size(); i++) { |
| | | JSONObject jsonObject = jsonArray.getJSONObject(i); |
| | | // 1 |
| | | String downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | String downloadUrl = jsonObject.getString("url");; |
| | | try { |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | log.error("获取图片下载地址失败", e); |
| | | } |
| | | jsonObject.put("url", downloadUrl); |
| | | } |
| | | res.setTaskImage(JSONArray.toJSONString(jsonArray)); |
| | |
| | | String startChargingPicture = res.getStartChargingPicture(); |
| | | if (StringUtils.isNotBlank(startChargingPicture)) { |
| | | JSONArray jsonArray = JSONArray.parseArray(startChargingPicture); |
| | | for (Object o : jsonArray) { |
| | | JSONObject jsonObject = (JSONObject)o; |
| | | String downloadUrl = null; |
| | | for (int i = 0; i < jsonArray.size(); i++) { |
| | | JSONObject jsonObject = jsonArray.getJSONObject(i); |
| | | if (Objects.isNull(jsonObject)) { |
| | | continue; |
| | | } |
| | | String downloadUrl = jsonObject.getString("url");; |
| | | try { |
| | | //1 |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | throw new RuntimeException(e); |
| | | log.error("获取图片下载地址失败", e); |
| | | } |
| | | jsonObject.put("url", downloadUrl); |
| | | } |
| | |
| | | String endChargingPicture = chargingRecord.getEndChargingPicture(); |
| | | if (StringUtils.isNotBlank(endChargingPicture)) { |
| | | JSONArray jsonArray = JSONArray.parseArray(endChargingPicture); |
| | | for (Object o : jsonArray) { |
| | | JSONObject jsonObject = (JSONObject)o; |
| | | String downloadUrl = null; |
| | | for (int i = 0; i < jsonArray.size(); i++) { |
| | | JSONObject jsonObject = jsonArray.getJSONObject(i); |
| | | if (Objects.isNull(jsonObject)) { |
| | | continue; |
| | | } |
| | | String downloadUrl = jsonObject.getString("url");; |
| | | try { |
| | | //1 |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | throw new RuntimeException(e); |
| | | log.error("获取图片下载地址失败", e); |
| | | } |
| | | jsonObject.put("url", downloadUrl); |
| | | } |
| | |
| | | String startRepairPicture = vehicleRepair.getStartRepairPicture(); |
| | | if (StringUtils.isNotBlank(startRepairPicture)) { |
| | | JSONArray jsonArray = JSONArray.parseArray(startRepairPicture); |
| | | for (Object o : jsonArray) { |
| | | JSONObject jsonObject = (JSONObject)o; |
| | | String downloadUrl = null; |
| | | for (int i = 0; i < jsonArray.size(); i++) { |
| | | JSONObject jsonObject = jsonArray.getJSONObject(i); |
| | | if (Objects.isNull(jsonObject)) { |
| | | continue; |
| | | } |
| | | String downloadUrl = jsonObject.getString("url");; |
| | | try { |
| | | // 1 |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | throw new RuntimeException(e); |
| | | log.error("获取图片下载地址失败", e); |
| | | } |
| | | jsonObject.put("url", downloadUrl); |
| | | } |
| | |
| | | String SensorCleaningPicture = vehicleDetection.getSensorCleaningPicture(); |
| | | if (StringUtils.isNotBlank(SensorCleaningPicture)) { |
| | | JSONArray jsonArray = JSONArray.parseArray(SensorCleaningPicture); |
| | | for (Object o : jsonArray) { |
| | | JSONObject jsonObject =(JSONObject)o; |
| | | String downloadUrl = null; |
| | | for (int i = 0; i < jsonArray.size(); i++) { |
| | | JSONObject jsonObject = jsonArray.getJSONObject(i); |
| | | if (Objects.isNull(jsonObject)) { |
| | | continue; |
| | | } |
| | | String downloadUrl = jsonObject.getString("url"); |
| | | try { |
| | | // 1 |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | throw new RuntimeException(e); |
| | | log.error("获取图片下载地址失败", e); |
| | | } |
| | | jsonObject.put("url", downloadUrl); |
| | | } |
| | |
| | | String InteractiveScreenPicture =vehicleDetection.getInteractiveScreenPicture(); |
| | | if (StringUtils.isNotBlank(InteractiveScreenPicture)) { |
| | | JSONArray jsonArray = JSONArray.parseArray(InteractiveScreenPicture); |
| | | for (Object o : jsonArray) { |
| | | JSONObject jsonObject = (JSONObject)o; |
| | | String downloadUrl = null; |
| | | for (int i = 0; i < jsonArray.size(); i++) { |
| | | JSONObject jsonObject = jsonArray.getJSONObject(i); |
| | | if (Objects.isNull(jsonObject)) { |
| | | continue; |
| | | } |
| | | String downloadUrl = jsonObject.getString("url");; |
| | | try { |
| | | // 1 |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | throw new RuntimeException(e); |
| | | log.error("获取图片下载地址失败", e); |
| | | } |
| | | jsonObject.put("url", downloadUrl); |
| | | } |
| | |
| | | String HelpButtonPicture =vehicleDetection.getHelpButtonPicture(); |
| | | if (StringUtils.isNotBlank(HelpButtonPicture)) { |
| | | JSONArray jsonArray = JSONArray.parseArray(HelpButtonPicture); |
| | | for (Object o : jsonArray) { |
| | | JSONObject jsonObject =(JSONObject)o; |
| | | String downloadUrl = null; |
| | | for (int i = 0; i < jsonArray.size(); i++) { |
| | | JSONObject jsonObject = jsonArray.getJSONObject(i); |
| | | if (Objects.isNull(jsonObject)) { |
| | | continue; |
| | | } |
| | | String downloadUrl = jsonObject.getString("url");; |
| | | try { |
| | | // 1 |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | throw new RuntimeException(e); |
| | | log.error("获取图片下载地址失败", e); |
| | | } |
| | | jsonObject.put("url", downloadUrl); |
| | | } |
| | |
| | | String PaymentFunctionPicture =vehicleDetection.getPaymentFunctionPicture(); |
| | | if (StringUtils.isNotBlank(PaymentFunctionPicture)) { |
| | | JSONArray jsonArray = JSONArray.parseArray(PaymentFunctionPicture); |
| | | for (Object o : jsonArray) { |
| | | JSONObject jsonObject = (JSONObject)o; |
| | | String downloadUrl = null; |
| | | for (int i = 0; i < jsonArray.size(); i++) { |
| | | JSONObject jsonObject = jsonArray.getJSONObject(i); |
| | | if (Objects.isNull(jsonObject)) { |
| | | continue; |
| | | } |
| | | String downloadUrl = jsonObject.getString("url");; |
| | | try { |
| | | // 1 |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | throw new RuntimeException(e); |
| | | log.error("获取图片下载地址失败", e); |
| | | } |
| | | jsonObject.put("url", downloadUrl); |
| | | } |
| | |
| | | String SystemCheckPicture =vehicleDetection.getSystemCheckPicture(); |
| | | if (StringUtils.isNotBlank(SystemCheckPicture)) { |
| | | JSONArray jsonArray = JSONArray.parseArray(SystemCheckPicture); |
| | | for (Object o : jsonArray) { |
| | | JSONObject jsonObject =(JSONObject)o; |
| | | String downloadUrl = null; |
| | | for (int i = 0; i < jsonArray.size(); i++) { |
| | | JSONObject jsonObject = jsonArray.getJSONObject(i); |
| | | if (Objects.isNull(jsonObject)) { |
| | | continue; |
| | | } |
| | | String downloadUrl = jsonObject.getString("url");; |
| | | try { |
| | | // 1 |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | throw new RuntimeException(e); |
| | | log.error("获取图片下载地址失败", e); |
| | | } |
| | | jsonObject.put("url", downloadUrl); |
| | | } |
| | |
| | | String taskImage = res.getTaskImage(); |
| | | if (StringUtils.isNotBlank(taskImage)) { |
| | | JSONArray jsonArray = JSONArray.parseArray(taskImage); |
| | | for (Object o : jsonArray) { |
| | | JSONObject jsonObject = (JSONObject)o; |
| | | // 1 |
| | | String downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | for (int i = 0; i < jsonArray.size(); i++) { |
| | | JSONObject jsonObject = jsonArray.getJSONObject(i); |
| | | if (Objects.isNull(jsonObject)) { |
| | | continue; |
| | | } |
| | | String downloadUrl = jsonObject.getString("url");; |
| | | try { |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | log.error("获取图片下载地址失败", e); |
| | | } |
| | | jsonObject.put("url", downloadUrl); |
| | | } |
| | | res.setTaskImage(JSONArray.toJSONString(jsonArray)); |
| | |
| | | .account(operationsUser.getPhoneNumber()) |
| | | .title("任务状态变更") |
| | | .body(bodyJson) |
| | | .pushType(AliPushTypeConstant.NOTICE) |
| | | .pushType(AliPushTypeConstant.MESSAGE) |
| | | .build()); |
| | | } |
| | | } catch (Exception e) { |
| | |
| | | if (Objects.isNull(jsonObject)) { |
| | | continue; |
| | | } |
| | | String downloadUrl = null; |
| | | String downloadUrl = jsonObject.getString("url");; |
| | | try { |
| | | // 1 |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | |
| | | if(vehicle.getVehiclePictures()!=null){ |
| | | JSONObject jsonObject = JSONObject.parseObject(vehicle.getVehiclePictures()); |
| | | // 1 |
| | | String downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | String downloadUrl = jsonObject.getString("url");; |
| | | try { |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | log.error("获取图片下载地址失败", e); |
| | | } |
| | | jsonObject.put("url", downloadUrl); |
| | | taskManagementDetectionDetailVO.setVehiclePictures(jsonObject.toJSONString()); |
| | | } |
| | |
| | | String SensorCleaningPicture = vehicleDetection.getSensorCleaningPicture(); |
| | | if (StringUtils.isNotBlank(SensorCleaningPicture)) { |
| | | JSONArray jsonArray = JSONArray.parseArray(SensorCleaningPicture); |
| | | for (Object o : jsonArray) { |
| | | JSONObject jsonObject = (JSONObject)o; |
| | | String downloadUrl = null; |
| | | for (int i = 0; i < jsonArray.size(); i++) { |
| | | JSONObject jsonObject = jsonArray.getJSONObject(i); |
| | | if (Objects.isNull(jsonObject)) { |
| | | continue; |
| | | } |
| | | String downloadUrl = jsonObject.getString("url");; |
| | | try { |
| | | // 1 |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | throw new RuntimeException(e); |
| | | log.error("获取图片下载地址失败", e); |
| | | } |
| | | jsonObject.put("url", downloadUrl); |
| | | } |
| | |
| | | String InteractiveScreenPicture =vehicleDetection.getInteractiveScreenPicture(); |
| | | if (StringUtils.isNotBlank(InteractiveScreenPicture)) { |
| | | JSONArray jsonArray = JSONArray.parseArray(InteractiveScreenPicture); |
| | | for (Object o : jsonArray) { |
| | | JSONObject jsonObject = (JSONObject)o; |
| | | String downloadUrl = null; |
| | | for (int i = 0; i < jsonArray.size(); i++) { |
| | | JSONObject jsonObject = jsonArray.getJSONObject(i); |
| | | if (Objects.isNull(jsonObject)) { |
| | | continue; |
| | | } |
| | | String downloadUrl = jsonObject.getString("url");; |
| | | try { |
| | | // 1 |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | throw new RuntimeException(e); |
| | | log.error("获取图片下载地址失败", e); |
| | | } |
| | | jsonObject.put("url", downloadUrl); |
| | | } |
| | |
| | | String HelpButtonPicture =vehicleDetection.getHelpButtonPicture(); |
| | | if (StringUtils.isNotBlank(HelpButtonPicture)) { |
| | | JSONArray jsonArray = JSONArray.parseArray(HelpButtonPicture); |
| | | for (Object o : jsonArray) { |
| | | JSONObject jsonObject = (JSONObject)o; |
| | | String downloadUrl = null; |
| | | for (int i = 0; i < jsonArray.size(); i++) { |
| | | JSONObject jsonObject = jsonArray.getJSONObject(i); |
| | | if (Objects.isNull(jsonObject)) { |
| | | continue; |
| | | } |
| | | String downloadUrl = jsonObject.getString("url");; |
| | | try { |
| | | // 1 |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | throw new RuntimeException(e); |
| | | log.error("获取图片下载地址失败", e); |
| | | } |
| | | jsonObject.put("url", downloadUrl); |
| | | } |
| | |
| | | String PaymentFunctionPicture =vehicleDetection.getPaymentFunctionPicture(); |
| | | if (StringUtils.isNotBlank(PaymentFunctionPicture)) { |
| | | JSONArray jsonArray = JSONArray.parseArray(PaymentFunctionPicture); |
| | | for (Object o : jsonArray) { |
| | | JSONObject jsonObject = (JSONObject)o; |
| | | String downloadUrl = null; |
| | | for (int i = 0; i < jsonArray.size(); i++) { |
| | | JSONObject jsonObject = jsonArray.getJSONObject(i); |
| | | if (Objects.isNull(jsonObject)) { |
| | | continue; |
| | | } |
| | | String downloadUrl = jsonObject.getString("url");; |
| | | try { |
| | | // 1 |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | throw new RuntimeException(e); |
| | | log.error("获取图片下载地址失败", e); |
| | | } |
| | | jsonObject.put("url", downloadUrl); |
| | | } |
| | |
| | | String SystemCheckPicture =vehicleDetection.getSystemCheckPicture(); |
| | | if (StringUtils.isNotBlank(SystemCheckPicture)) { |
| | | JSONArray jsonArray = JSONArray.parseArray(SystemCheckPicture); |
| | | for (Object o : jsonArray) { |
| | | JSONObject jsonObject = (JSONObject)o; |
| | | String downloadUrl = null; |
| | | for (int i = 0; i < jsonArray.size(); i++) { |
| | | JSONObject jsonObject = jsonArray.getJSONObject(i); |
| | | if (Objects.isNull(jsonObject)) { |
| | | continue; |
| | | } |
| | | String downloadUrl = jsonObject.getString("url");; |
| | | try { |
| | | // 1 |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | throw new RuntimeException(e); |
| | | log.error("获取图片下载地址失败", e); |
| | | } |
| | | jsonObject.put("url", downloadUrl); |
| | | } |
| | |
| | | String RepairMoneyDetail = vo.getRepairMoneyDetail(); |
| | | if (StringUtils.isNotBlank(RepairMoneyDetail)) { |
| | | JSONArray jsonArray = JSONArray.parseArray(RepairMoneyDetail); |
| | | for (Object o : jsonArray) { |
| | | JSONObject jsonObject = (JSONObject)o; |
| | | String downloadUrl = null; |
| | | for (int i = 0; i < jsonArray.size(); i++) { |
| | | JSONObject jsonObject = jsonArray.getJSONObject(i); |
| | | if (Objects.isNull(jsonObject)) { |
| | | continue; |
| | | } |
| | | String downloadUrl = jsonObject.getString("url");; |
| | | try { |
| | | // 1 |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | throw new RuntimeException(e); |
| | | log.error("获取图片下载地址失败", e); |
| | | } |
| | | jsonObject.put("url", downloadUrl); |
| | | } |
| | |
| | | String StartRepairPicture = vo.getStartRepairPicture(); |
| | | if (StringUtils.isNotBlank(StartRepairPicture)) { |
| | | JSONArray jsonArray = JSONArray.parseArray(StartRepairPicture); |
| | | for (Object o : jsonArray) { |
| | | JSONObject jsonObject =(JSONObject)o; |
| | | String downloadUrl = null; |
| | | for (int i = 0; i < jsonArray.size(); i++) { |
| | | JSONObject jsonObject = jsonArray.getJSONObject(i); |
| | | if (Objects.isNull(jsonObject)) { |
| | | continue; |
| | | } |
| | | String downloadUrl = jsonObject.getString("url");; |
| | | try { |
| | | // 1 |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | throw new RuntimeException(e); |
| | | log.error("获取图片下载地址失败", e); |
| | | } |
| | | jsonObject.put("url", downloadUrl); |
| | | } |
| | |
| | | @ShardingSphereTransactionType(TransactionType.BASE) |
| | | public R edit(@Validated @RequestBody PointUpdateDto pointAddDto) { |
| | | XpPoint xpPoint = xpPointService.getById(pointAddDto.getId()); |
| | | BeanUtils.copyProperties(pointAddDto, xpPoint); |
| | | if (xpPoint == null) { |
| | | throw new ServiceException("系统异常", I18nKeyConstant.SYSTEM_EXCEPTION); |
| | | } |
| | | BeanUtils.copyProperties(pointAddDto, xpPoint); |
| | | if (Integer.valueOf(2).equals(pointAddDto.getOperationStatus()) && Integer.valueOf(5).equals(pointAddDto.getVerificationStatus())) { |
| | | Long electronicAreaId = xpPoint.getElectronicAreaId(); |
| | | if (electronicAreaId == null) { |
| | |
| | | } |
| | | } |
| | | xpPoint.setFpElectronicAreaId(null); |
| | | xpPointService.updateById(xpPoint); |
| | | // 使用 lambdaUpdate 确保 pointPictures 为 null 时也能将数据库字段清空 |
| | | // (updateById 默认策略 NOT_NULL 会跳过 null 值,导致删除图片后数据库仍保留旧图片) |
| | | xpPointService.lambdaUpdate() |
| | | .eq(XpPoint::getId, xpPoint.getId()) |
| | | .set(XpPoint::getPointName, xpPoint.getPointName()) |
| | | .set(XpPoint::getPointPoi, xpPoint.getPointPoi()) |
| | | .set(XpPoint::getPointNumber, xpPoint.getPointNumber()) |
| | | .set(XpPoint::getOperationStatus, xpPoint.getOperationStatus()) |
| | | .set(XpPoint::getPointType, xpPoint.getPointType()) |
| | | .set(XpPoint::getVerificationStatus, xpPoint.getVerificationStatus()) |
| | | .set(XpPoint::getParkingTimeLimit, xpPoint.getParkingTimeLimit()) |
| | | .set(XpPoint::getOperationType, xpPoint.getOperationType()) |
| | | .set(XpPoint::getEffectivePeriod, xpPoint.getEffectivePeriod()) |
| | | .set(XpPoint::getEffectiveTimePeriod, xpPoint.getEffectiveTimePeriod()) |
| | | .set(XpPoint::getPointAddress, xpPoint.getPointAddress()) |
| | | .set(XpPoint::getRemarks, xpPoint.getRemarks()) |
| | | .set(XpPoint::getPointPictures, xpPoint.getPointPictures()) |
| | | .set(XpPoint::getPointLon, xpPoint.getPointLon()) |
| | | .set(XpPoint::getPointLat, xpPoint.getPointLat()) |
| | | .set(XpPoint::getElectronicAreaId, xpPoint.getElectronicAreaId()) |
| | | .set(XpPoint::getChargePoint, xpPoint.getChargePoint()) |
| | | .set(XpPoint::getParkingPoint, xpPoint.getParkingPoint()) |
| | | .update(); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | vo.setJumpType(item.getJumpType()); |
| | | vo.setJumpUrl(item.getJumpUrl()); |
| | | JSONArray jsonArray = JSONArray.parseArray(item.getBannerPictures()); |
| | | for (Object o : jsonArray) { |
| | | JSONObject jsonObject = (JSONObject) o; |
| | | for (int i = 0; i < jsonArray.size(); i++) { |
| | | JSONObject jsonObject = jsonArray.getJSONObject(i); |
| | | if (Objects.isNull(jsonObject)) { |
| | | continue; |
| | | } |
| | | String downloadUrl = null; |
| | | try { |
| | | // 1 |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | throw new RuntimeException(e); |
| | | log.error("获取图片下载地址失败", e); |
| | | } |
| | | jsonObject.put("url", downloadUrl); |
| | | } |
| | |
| | | for (XpBanner xpBanner : list) { |
| | | |
| | | JSONArray jsonArray = JSONArray.parse(xpBanner.getBannerPictures()); |
| | | for (Object o : jsonArray) { |
| | | JSONObject jsonObject = (JSONObject) o; |
| | | for (int i = 0; i < jsonArray.size(); i++) { |
| | | JSONObject jsonObject = jsonArray.getJSONObject(i); |
| | | if (Objects.isNull(jsonObject)) { |
| | | continue; |
| | | } |
| | | String downloadUrl = null; |
| | | try { |
| | | // 1 |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | throw new RuntimeException(e); |
| | | log.error("获取图片下载地址失败", e); |
| | | } |
| | | jsonObject.put("url", downloadUrl); |
| | | } |
| | |
| | | String feedbackPictures = xpUserFeedbackVO.getFeedbackPictures(); |
| | | if (StringUtils.isNotBlank(feedbackPictures)) { |
| | | JSONArray jsonArray = JSONArray.parseArray(feedbackPictures); |
| | | for (Object o : jsonArray) { |
| | | JSONObject jsonObject = (JSONObject)o; |
| | | for (int i = 0; i < jsonArray.size(); i++) { |
| | | JSONObject jsonObject = jsonArray.getJSONObject(i); |
| | | if (Objects.isNull(jsonObject)) { |
| | | continue; |
| | | } |
| | | String downloadUrl = null; |
| | | try { |
| | | // 1 |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | throw new RuntimeException(e); |
| | | log.error("获取图片下载地址失败", e); |
| | | } |
| | | jsonObject.put("url", downloadUrl); |
| | | } |
| | |
| | | package com.xiaopeng.operation.utils; |
| | | |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.alibaba.fastjson2.JSONArray; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.xiaopeng.api.dto.order.GetOrderNumDto; |
| | |
| | | * @param startingFareJsonStr |
| | | * @return |
| | | */ |
| | | // public static Integer getStartMileage(String startingFareJsonStr) { |
| | | // Date date = new Date(); |
| | | // JSONArray startingFareJson = JSONObject.parseArray(startingFareJsonStr); |
| | | // for (Object o : startingFareJson) { |
| | | // JSONObject startingFare = (JSONObject) o; |
| | | // Calendar calendarStart = Calendar.getInstance(); |
| | | // calendarStart.setTime(date); |
| | | // calendarStart.set(Calendar.HOUR_OF_DAY, Integer.valueOf(startingFare.getString("num1").split(":")[0])); |
| | | // calendarStart.set(Calendar.MINUTE, Integer.valueOf(startingFare.getString("num1").split(":")[1])); |
| | | // |
| | | // Calendar calendarEnd = Calendar.getInstance(); |
| | | // calendarEnd.setTime(date); |
| | | // calendarEnd.set(Calendar.HOUR_OF_DAY, Integer.valueOf(startingFare.getString("num2").split(":")[0])); |
| | | // calendarEnd.set(Calendar.MINUTE, Integer.valueOf(startingFare.getString("num2").split(":")[1])); |
| | | // // 找到符合条件的直接跳出循环 |
| | | // if (date.getTime() > calendarStart.getTimeInMillis() && date.getTime() < calendarEnd.getTimeInMillis()) { |
| | | // Integer mileage = startingFare.getInteger("num4"); |
| | | // return mileage; |
| | | // } |
| | | // } |
| | | // return null; |
| | | // } |
| | | public static Integer getStartMileage(String startingFareJsonStr) { |
| | | Date date = new Date(); |
| | | JSONArray startingFareJson = JSON.parseArray(startingFareJsonStr); |
| | | for (Object o : startingFareJson) { |
| | | JSONObject startingFare = (JSONObject) o; |
| | | Calendar calendarStart = Calendar.getInstance(); |
| | | calendarStart.setTime(date); |
| | | calendarStart.set(Calendar.HOUR_OF_DAY, Integer.valueOf(startingFare.getString("num1").split(":")[0])); |
| | | calendarStart.set(Calendar.MINUTE, Integer.valueOf(startingFare.getString("num1").split(":")[1])); |
| | | |
| | | Calendar calendarEnd = Calendar.getInstance(); |
| | | calendarEnd.setTime(date); |
| | | calendarEnd.set(Calendar.HOUR_OF_DAY, Integer.valueOf(startingFare.getString("num2").split(":")[0])); |
| | | calendarEnd.set(Calendar.MINUTE, Integer.valueOf(startingFare.getString("num2").split(":")[1])); |
| | | // 找到符合条件的直接跳出循环 |
| | | if (date.getTime() > calendarStart.getTimeInMillis() && date.getTime() < calendarEnd.getTimeInMillis()) { |
| | | Integer mileage = startingFare.getInteger("num4"); |
| | | return mileage; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | /** |
| | |
| | | import cn.afterturn.easypoi.excel.entity.ExportParams; |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.xiaopeng.api.dto.QueryOrderRouteDTO; |
| | | import com.xiaopeng.api.dto.operation.LonLatDto; |
| | | import com.xiaopeng.api.dto.order.AddCruiseMissionDto; |
| | | import com.xiaopeng.api.dto.order.GetOrderNumDto; |
| | | import com.xiaopeng.api.dto.order.PopOrderDto; |
| | | import com.xiaopeng.api.dto.pushMessage.SendMessageDTO; |
| | | import com.xiaopeng.api.dto.statistics.OrderStatisticsDTO; |
| | | import com.xiaopeng.api.dto.statistics.StatisticsQueryDTO; |
| | | import com.xiaopeng.api.feignClient.vehicleConvoy.XpVehicleClient; |
| | |
| | | import com.xiaopeng.api.vo.order.*; |
| | | import com.xiaopeng.common.core.constant.CacheConstants; |
| | | import com.xiaopeng.common.core.domain.R; |
| | | import com.xiaopeng.common.core.enums.OrderStatusEnum; |
| | | import com.xiaopeng.common.core.enums.PushMessageTypeEnum; |
| | | import com.xiaopeng.common.core.utils.WebUtils; |
| | | import com.xiaopeng.common.core.web.page.PageInfo; |
| | | import com.xiaopeng.common.redis.service.RedisService; |
| | |
| | | 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 java.util.*; |
| | | |
| | | import static org.bouncycastle.asn1.x500.style.RFC4519Style.uid; |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 内部调用-结束订单 |
| | | * @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); |
| | | } |
| | | |
| | | |
| | | /** |
| | |
| | | package com.xiaopeng.order.job.jobs; |
| | | |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.xiaopeng.api.dto.pushMessage.SendMessageDTO; |
| | | import com.xiaopeng.api.model.order.XpOrder; |
| | | import com.xiaopeng.api.model.order.XpOrderTimeoutLog; |
| | | import com.xiaopeng.api.model.vehicleConvoy.XpVehicle; |
| | | import com.xiaopeng.api.vo.vehicleConvoy.CancelTaxiPassengerVo; |
| | | import com.xiaopeng.common.core.domain.R; |
| | | import com.xiaopeng.common.core.enums.OrderStatusEnum; |
| | | import com.xiaopeng.common.core.enums.PushMessageTypeEnum; |
| | | import com.xiaopeng.order.job.base.AbstractJob; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.quartz.JobDataMap; |
| | | import org.quartz.JobExecutionContext; |
| | | import org.quartz.JobExecutionException; |
| | | |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 推送定时任务 |
| | |
| | | XpOrder xpOrder = xpOrderService.getById(orderId); |
| | | if(xpOrder.getStatus() == 7){ |
| | | xpOrderService.endTrip(xpOrder.getId(), String.valueOf(xpOrder.getAppUserId())); |
| | | // 消息推送 |
| | | Map<String, Object> params = new HashMap<>(); |
| | | Map<String, Object> content = new HashMap<>(); |
| | | content.put("orderId", xpOrder.getId().toString()); |
| | | content.put("status", OrderStatusEnum.APPROVAL_REJECTION.getCode()); |
| | | params.put("type", PushMessageTypeEnum.ORDER_STATUS.getDesc()); |
| | | params.put("content", com.alibaba.fastjson2.JSONObject.toJSONString(content)); |
| | | params.put("timestamp", new Date().getTime() + ""); |
| | | String message = JSONObject.toJSONString(params); |
| | | SendMessageDTO sendMessageDTO = new SendMessageDTO(); |
| | | sendMessageDTO.setMessage(message); |
| | | sendMessageDTO.setAppUserId(String.valueOf(xpOrder.getAppUserId())); |
| | | xpPushMessageClient.sendStatus(sendMessageDTO); |
| | | } |
| | | log.info("结束执行自动结束行程任务"); |
| | | // 添加超时记录 |
| | |
| | | this.lambdaUpdate().set(XpOrder::getStatus, 7) |
| | | .eq(XpOrder::getId, order.getId()).update(); |
| | | |
| | | |
| | | //结束行程 |
| | | endTrip(order.getId(), order.getAppUserId().toString()); |
| | | // 消息推送 |
| | | Map<String, Object> params = new HashMap<>(); |
| | | Map<String, Object> content = new HashMap<>(); |
| | |
| | | sendMessageDTO.setMessage(message); |
| | | sendMessageDTO.setAppUserId(String.valueOf(order.getAppUserId())); |
| | | xpPushMessageClient.sendStatus(sendMessageDTO); |
| | | //结束行程 |
| | | endTrip(order.getId(), order.getAppUserId().toString()); |
| | | log.info("运营人员取消订单成功,推送乘客消息完成"); |
| | | log.info("订单关闭成功,订单ID: {}, 操作人: {}", order.getId(), SecurityUtils.getUsername()); |
| | | } |
| | |
| | | xpOrderHistoryDateVO.setOrders(value); |
| | | return xpOrderHistoryDateVO; |
| | | }).collect(Collectors.toList()); |
| | | |
| | | dateVOS = dateVOS.stream().sorted(Comparator.comparing(XpOrderHistoryDateVO::getDateLabel).reversed()).collect(Collectors.toList()); |
| | | xpOrderHistoryVO.setList(dateVOS); |
| | | |
| | | return xpOrderHistoryVO; |
| | |
| | | // 远途费价格明细 |
| | | List<FareBreakdownDetailVo> longDistance = new ArrayList<>(); |
| | | XpOrder order = this.getById(orderId); |
| | | |
| | | if (order == null) { |
| | | throw new RuntimeException("订单不存在"); |
| | | } |
| | |
| | | xpOrderDetail.setOrderId(orderId); |
| | | xpOrderDetail.setType(1); |
| | | xpOrderDetail.setMoney(new BigDecimal(xpPricingCardVo.getDurationPrice()).setScale(2, RoundingMode.HALF_UP)); |
| | | xpOrderDetail.setDuration(duration1); |
| | | xpOrderDetails.add(xpOrderDetail); |
| | | |
| | | BigDecimal totalPrice =BigDecimal.ZERO; |
| | |
| | | detail.setType(xpOrderDetail.getType()); |
| | | detail.setTime(xpOrderDetail.getTime()); |
| | | detail.setMileage(xpOrderDetail.getMileage()); |
| | | detail.setDuration(xpOrderDetail.getDuration()); |
| | | detail.setDuration((xpOrderDetail.getDuration() == null ? 0 : xpOrderDetail.getDuration())*60); |
| | | detail.setMoney(xpOrderDetail.getMoney()); |
| | | if (xpOrderDetail.getDetailType() == 1) { |
| | | start.add(detail); |
| | |
| | | */ |
| | | public static Integer getStartMileage(String startingFareJsonStr) { |
| | | Date date = new Date(); |
| | | JSONArray startingFareJson = JSONObject.parseArray(startingFareJsonStr); |
| | | JSONArray startingFareJson = JSONArray.parseArray(startingFareJsonStr); |
| | | for (Object o : startingFareJson) { |
| | | JSONObject startingFare = (JSONObject) o; |
| | | Calendar calendarStart = Calendar.getInstance(); |
| | |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-websocket</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- 计算两坐标间的直线距离 --> |
| | | <dependency> |
| | | <groupId>org.gavaghan</groupId> |
| | | <artifactId>geodesy</artifactId> |
| | | <version>1.1.3</version> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | <build> |
| | |
| | | if(Objects.nonNull(routeVo)){ |
| | | |
| | | // 计算实时点位到线段的最优截取 |
| | | List<LonLatDto> lonLatDtos = MapMatchingUtil.clipBySegmentDistance(routeVo.getPolyline(), new LonLatDto(dto.getLongitude(), dto.getLatitude())); |
| | | List<LonLatDto> lonLatDtos = MapMatchingUtil.getRemainingNavigation(routeVo.getPolyline(), dto.getLongitude(), dto.getLatitude()); |
| | | |
| | | routeVo.setDistance(dto.getDistance()); |
| | | routeVo.setDuration(dto.getDuration()); |
| | |
| | | package com.xiaopeng.pushMessage.utils; |
| | | |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.alibaba.fastjson2.JSONArray; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.xiaopeng.api.dto.operation.LonLatDto; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.gavaghan.geodesy.Ellipsoid; |
| | | import org.gavaghan.geodesy.GeodeticCalculator; |
| | | import org.gavaghan.geodesy.GeodeticCurve; |
| | | import org.gavaghan.geodesy.GlobalCoordinates; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | import java.util.concurrent.*; |
| | | |
| | | |
| | | @Slf4j |
| | | public class MapMatchingUtil { |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取剩余导航数据 |
| | | * @param polyline |
| | | * @param longitude |
| | | * @param latitude |
| | | * @return |
| | | */ |
| | | public static List<LonLatDto> getRemainingNavigation(List<LonLatDto> polyline, Double longitude, Double latitude){ |
| | | //导航数据只有一个点的情况 |
| | | if(polyline.size() == 1){ |
| | | LonLatDto lonLatDto = polyline.get(0); |
| | | GlobalCoordinates source1 = new GlobalCoordinates(lonLatDto.getLatitude(), lonLatDto.getLongitude()); |
| | | GlobalCoordinates target1 = new GlobalCoordinates(latitude, longitude); |
| | | GeodeticCurve geoCurve1 = new GeodeticCalculator().calculateGeodeticCurve(Ellipsoid.WGS84, source1, target1); |
| | | double distance =geoCurve1.getEllipsoidalDistance(); |
| | | //判断距离小于5米,则可以返回空数据 |
| | | if(5 >= distance){ |
| | | return Collections.emptyList(); |
| | | } |
| | | //大于5米的情况,将车子当前位置添加进结果中 |
| | | lonLatDto = new LonLatDto(longitude, latitude); |
| | | polyline.add(0, lonLatDto); |
| | | return polyline; |
| | | } |
| | | //多个点位的情况,需要找出当前点位处于那两个点位之间,然后截取掉超出的部分轨迹 |
| | | return getRecentlyPoint(polyline, longitude, latitude); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 判断点位在轨迹线路中的点位之间 |
| | | * 返回截取后的剩余轨迹 |
| | | * @param polyline |
| | | * @param longitude |
| | | * @param latitude |
| | | * @return |
| | | */ |
| | | public static List<LonLatDto> getRecentlyPoint(List<LonLatDto> polyline, Double longitude, Double latitude){ |
| | | for (int i = 0; i < polyline.size(); i++) { |
| | | LonLatDto lonLatDto1 = polyline.get(i); |
| | | |
| | | GlobalCoordinates source1 = new GlobalCoordinates(lonLatDto1.getLatitude(), lonLatDto1.getLongitude()); |
| | | GlobalCoordinates target1 = new GlobalCoordinates(latitude, longitude); |
| | | GeodeticCurve geoCurve1 = new GeodeticCalculator().calculateGeodeticCurve(Ellipsoid.WGS84, source1, target1); |
| | | double distance1 =geoCurve1.getEllipsoidalDistance(); |
| | | |
| | | LonLatDto lonLatDto2 = polyline.get(i + 1); |
| | | GlobalCoordinates source2 = new GlobalCoordinates(lonLatDto2.getLatitude(), lonLatDto2.getLongitude()); |
| | | GlobalCoordinates target2 = new GlobalCoordinates(latitude, longitude); |
| | | GeodeticCurve geoCurve2 = new GeodeticCalculator().calculateGeodeticCurve(Ellipsoid.WGS84, source2, target2); |
| | | double distance2 =geoCurve2.getEllipsoidalDistance(); |
| | | |
| | | |
| | | GlobalCoordinates source3 = new GlobalCoordinates(lonLatDto1.getLatitude(), lonLatDto1.getLongitude()); |
| | | GlobalCoordinates target3 = new GlobalCoordinates(lonLatDto2.getLatitude(), lonLatDto2.getLongitude()); |
| | | GeodeticCurve geoCurve3 = new GeodeticCalculator().calculateGeodeticCurve(Ellipsoid.WGS84, source3, target3); |
| | | double distance3 =geoCurve3.getEllipsoidalDistance(); |
| | | |
| | | //判断当前位置是否处于两个点位之间 |
| | | if((distance1 + distance2) == distance3 || (distance1 + distance2) <= distance3 + 5){ |
| | | //取距离最近的点位数据 |
| | | if(distance1 < distance2){ |
| | | return polyline.subList(i, polyline.size()); |
| | | } |
| | | return polyline.subList(i + 1, polyline.size()); |
| | | } |
| | | } |
| | | polyline.add(0, new LonLatDto(longitude, latitude)); |
| | | return polyline; |
| | | } |
| | | |
| | | |
| | | public static void main(String[] args) { |
| | | JSONArray objects = JSON.parseArray("[{\n" + |
| | | "\t\t\"latitude\": 30.58549,\n" + |
| | | "\t\t\"longitude\": 104.054501\n" + |
| | | "\t}, {\n" + |
| | | "\t\t\"latitude\": 30.585938,\n" + |
| | | "\t\t\"longitude\": 104.054501\n" + |
| | | "\t}, {\n" + |
| | | "\t\t\"latitude\": 30.586522,\n" + |
| | | "\t\t\"longitude\": 104.054501\n" + |
| | | "\t}, {\n" + |
| | | "\t\t\"latitude\": 30.587026,\n" + |
| | | "\t\t\"longitude\": 104.054507\n" + |
| | | "\t}, {\n" + |
| | | "\t\t\"latitude\": 30.587922,\n" + |
| | | "\t\t\"longitude\": 104.054518\n" + |
| | | "\t}, {\n" + |
| | | "\t\t\"latitude\": 30.588062,\n" + |
| | | "\t\t\"longitude\": 104.054518\n" + |
| | | "\t}, {\n" + |
| | | "\t\t\"latitude\": 30.588292,\n" + |
| | | "\t\t\"longitude\": 104.054528\n" + |
| | | "\t}, {\n" + |
| | | "\t\t\"latitude\": 30.588292,\n" + |
| | | "\t\t\"longitude\": 104.0544\n" + |
| | | "\t}, {\n" + |
| | | "\t\t\"latitude\": 30.588292,\n" + |
| | | "\t\t\"longitude\": 104.0544\n" + |
| | | "\t}, {\n" + |
| | | "\t\t\"latitude\": 30.587949,\n" + |
| | | "\t\t\"longitude\": 104.054384\n" + |
| | | "\t}, {\n" + |
| | | "\t\t\"latitude\": 30.587311,\n" + |
| | | "\t\t\"longitude\": 104.054389\n" + |
| | | "\t}, {\n" + |
| | | "\t\t\"latitude\": 30.587118,\n" + |
| | | "\t\t\"longitude\": 104.054394\n" + |
| | | "\t}, {\n" + |
| | | "\t\t\"latitude\": 30.586704,\n" + |
| | | "\t\t\"longitude\": 104.054394\n" + |
| | | "\t}, {\n" + |
| | | "\t\t\"latitude\": 30.586125,\n" + |
| | | "\t\t\"longitude\": 104.0544\n" + |
| | | "\t}, {\n" + |
| | | "\t\t\"latitude\": 30.585938,\n" + |
| | | "\t\t\"longitude\": 104.054405\n" + |
| | | "\t}, {\n" + |
| | | "\t\t\"latitude\": 30.585476,\n" + |
| | | "\t\t\"longitude\": 104.054405\n" + |
| | | "\t}, {\n" + |
| | | "\t\t\"latitude\": 30.584693,\n" + |
| | | "\t\t\"longitude\": 104.054405\n" + |
| | | "\t}, {\n" + |
| | | "\t\t\"latitude\": 30.584403,\n" + |
| | | "\t\t\"longitude\": 104.054416\n" + |
| | | "\t}, {\n" + |
| | | "\t\t\"latitude\": 30.584312,\n" + |
| | | "\t\t\"longitude\": 104.054416\n" + |
| | | "\t}, {\n" + |
| | | "\t\t\"latitude\": 30.583593,\n" + |
| | | "\t\t\"longitude\": 104.054416\n" + |
| | | "\t}, {\n" + |
| | | "\t\t\"latitude\": 30.583486,\n" + |
| | | "\t\t\"longitude\": 104.054416\n" + |
| | | "\t}, {\n" + |
| | | "\t\t\"latitude\": 30.583116,\n" + |
| | | "\t\t\"longitude\": 104.054421\n" + |
| | | "\t}, {\n" + |
| | | "\t\t\"latitude\": 30.582391,\n" + |
| | | "\t\t\"longitude\": 104.054426\n" + |
| | | "\t}, {\n" + |
| | | "\t\t\"latitude\": 30.582397,\n" + |
| | | "\t\t\"longitude\": 104.054577\n" + |
| | | "\t}, {\n" + |
| | | "\t\t\"latitude\": 30.582397,\n" + |
| | | "\t\t\"longitude\": 104.054577\n" + |
| | | "\t}, {\n" + |
| | | "\t\t\"latitude\": 30.582815,\n" + |
| | | "\t\t\"longitude\": 104.054561\n" + |
| | | "\t}, {\n" + |
| | | "\t\t\"latitude\": 30.58311,\n" + |
| | | "\t\t\"longitude\": 104.05455\n" + |
| | | "\t}, {\n" + |
| | | "\t\t\"latitude\": 30.58311,\n" + |
| | | "\t\t\"longitude\": 104.05455\n" + |
| | | "\t}, {\n" + |
| | | "\t\t\"latitude\": 30.58311,\n" + |
| | | "\t\t\"longitude\": 104.054899\n" + |
| | | "\t}, {\n" + |
| | | "\t\t\"latitude\": 30.583143,\n" + |
| | | "\t\t\"longitude\": 104.054931\n" + |
| | | "\t}, {\n" + |
| | | "\t\t\"latitude\": 30.583148,\n" + |
| | | "\t\t\"longitude\": 104.054973\n" + |
| | | "\t}]"); |
| | | List<LonLatDto> lonLatDtoList = new ArrayList<>(); |
| | | for (int i = 0; i < objects.size(); i++) { |
| | | JSONObject object = objects.getJSONObject(i); |
| | | LonLatDto lonLatDto = new LonLatDto(object.getDouble("longitude"), object.getDouble("latitude")); |
| | | lonLatDtoList.add(lonLatDto); |
| | | } |
| | | for (int i = 0; i < 20; i++) { |
| | | List<LonLatDto> remainingNavigation = getRemainingNavigation(lonLatDtoList, 104.054503, 30.58549); |
| | | lonLatDtoList = remainingNavigation; |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 轨迹裁剪(线段版本) |
| | | * @param polyline |
| | |
| | | String operationQualification = record.getOperationQualification(); |
| | | if (StringUtils.isNotBlank(operationQualification)) { |
| | | JSONArray jsonArray = JSONArray.parseArray(operationQualification); |
| | | for (Object o : jsonArray) { |
| | | JSONObject jsonObject = (JSONObject)o; |
| | | // 1 |
| | | String downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | for (int i = 0; i < jsonArray.size(); i++) { |
| | | JSONObject jsonObject = jsonArray.getJSONObject(i); |
| | | if (Objects.isNull(jsonObject)) { |
| | | continue; |
| | | } |
| | | String downloadUrl = null; |
| | | try { |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | log.error("获取图片下载地址失败", e); |
| | | } |
| | | jsonObject.put("url", downloadUrl); |
| | | } |
| | | record.setOperationQualification(JSONArray.toJSONString(jsonArray)); |
| | |
| | | String policyInformation = record.getPolicyInformation(); |
| | | if (StringUtils.isNotBlank(policyInformation)) { |
| | | JSONArray jsonArray = JSONArray.parseArray(policyInformation); |
| | | for (Object o : jsonArray) { |
| | | JSONObject jsonObject = (JSONObject)o; |
| | | // 1 |
| | | String downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | for (int i = 0; i < jsonArray.size(); i++) { |
| | | JSONObject jsonObject = jsonArray.getJSONObject(i); |
| | | if (Objects.isNull(jsonObject)) { |
| | | continue; |
| | | } |
| | | String downloadUrl = null; |
| | | try { |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | log.error("获取图片下载地址失败", e); |
| | | } |
| | | jsonObject.put("url", downloadUrl); |
| | | } |
| | | record.setPolicyInformation(JSONArray.toJSONString(jsonArray)); |