|
|
@@ -2,6 +2,7 @@ package com.tuoheng.admin.service.impl; |
|
|
|
|
|
|
|
import cn.hutool.core.lang.Assert; |
|
|
|
import cn.hutool.core.util.ObjectUtil; |
|
|
|
import com.alibaba.fastjson.JSONArray; |
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.tuoheng.admin.entity.domain.ThInspection; |
|
|
@@ -108,7 +109,7 @@ public class ThInspectionServiceImpl extends BaseServiceImpl<ThInspectionMapper, |
|
|
|
String param="page=1&limit=100&droneId="+droneId; |
|
|
|
String airPortStr = HttpUtils.sendGet(url, param); |
|
|
|
JsonResult<AirLineVO> jsonResult = JacksonUtil.json2pojo(airPortStr, JsonResult.class); |
|
|
|
if(ObjectUtil.isEmpty(jsonResult) || (!ObjectUtil.isEmpty(jsonResult.getData()) && jsonResult.getCode() != 0)) { |
|
|
|
if(ObjectUtil.isEmpty(jsonResult) || (!ObjectUtil.isEmpty(Objects.requireNonNull(jsonResult).getData()) && jsonResult.getCode() != 0)) { |
|
|
|
throw new ServiceException(HttpStatus.BAD_REQUEST.value(), "获取航线信息失败,请重试"); |
|
|
|
} |
|
|
|
return JSONObject.parseArray(JSONObject.parseObject(JSONObject.toJSONString(jsonResult.getData())).get("records").toString(), AirLineVO.class); |
|
|
@@ -169,6 +170,14 @@ public class ThInspectionServiceImpl extends BaseServiceImpl<ThInspectionMapper, |
|
|
|
throw new ServiceException(HttpStatus.BAD_REQUEST.value(), "获取标准航线信息失败,请重试"); |
|
|
|
} |
|
|
|
|
|
|
|
JSONArray resultData = JSONArray.parseArray(JSONObject.toJSONString( jsonResult.getData())); |
|
|
|
for (Object o : resultData) { |
|
|
|
JSONObject jsonObject=(JSONObject)o; |
|
|
|
jsonObject.put("lng",jsonObject.getString("lon")); |
|
|
|
jsonObject.remove("lon"); |
|
|
|
} |
|
|
|
jsonResult.setData(resultData); |
|
|
|
|
|
|
|
System.out.println(jsonResult.getData().toString()); |
|
|
|
return jsonResult; |
|
|
|
} |