Browse Source

Merge branch 'develop' of gitadmin/tuoheng_freeway into release

tags/v1.2.0^2
chengwang 1 year ago
parent
commit
d615824e9d
2 changed files with 12 additions and 11 deletions
  1. +1
    -1
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/constant/SystemConstant.java
  2. +11
    -10
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/third/airport/PointFlightService.java

+ 1
- 1
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/constant/SystemConstant.java View File

@@ -12,7 +12,7 @@ public interface SystemConstant {
/**
* 平台code
*/
String PLATFORM_CODE = "treefarm";
String PLATFORM_CODE = "gs";

/**
* 高德url地址

+ 11
- 10
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/third/airport/PointFlightService.java View File

@@ -14,10 +14,7 @@ import com.tuoheng.admin.mapper.TenantMapper;
import com.tuoheng.admin.request.accident.AccidentFlightRequest;
import com.tuoheng.admin.utils.CurrentUserUtil;
import com.tuoheng.common.core.config.common.CommonConfig;
import com.tuoheng.common.core.utils.DateUtils;
import com.tuoheng.common.core.utils.HttpUtils;
import com.tuoheng.common.core.utils.JsonResult;
import com.tuoheng.common.core.utils.StringUtils;
import com.tuoheng.common.core.utils.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -73,8 +70,8 @@ public class PointFlightService {

//调用机场平台进行飞行
//因任务为原来新的应急任务不用关心其他正在巡检飞行的任务
boolean flag = this.callNewAirport(tenant, request, inspection.getId());
log.info("调用机场进行飞行,flag={}",flag);
this.callNewAirport(tenant, request, inspection.getId());
//log.info("调用机场进行飞行,flag={}",flag);

log.info("调用机场平台方法:执行定点飞行结束");

@@ -87,16 +84,16 @@ public class PointFlightService {
* @param request
* @param inspectionId
*/
private boolean callNewAirport(Tenant tenant,AccidentFlightRequest request,String inspectionId){
private void callNewAirport(Tenant tenant,AccidentFlightRequest request,String inspectionId){
String url = CommonConfig.airportURL + SystemConstant.API_AIRPORT_POINT_FLIGH;
//高度设置为60
request.setAlt("60");
request.setAlt("100");
JSONObject jsonObject = new JSONObject();
jsonObject.put("airportId",request.getAirportId());
jsonObject.put("requestId",inspectionId);
jsonObject.put("code",SystemConstant.PLATFORM_CODE);
jsonObject.put("tenantCode",tenant.getCode());
jsonObject.put("alt",request.getLatitude());
jsonObject.put("alt",request.getAlt());
jsonObject.put("lon", request.getLongitude());
jsonObject.put("lat", request.getLatitude());

@@ -108,8 +105,12 @@ public class PointFlightService {
log.info("新无人机执行定点飞行:机场接口返回数据为空,飞行失败,jsonObject:{}", jsonObject);
throw new ServiceException("机场接口返回数据为空,飞行失败");
}
JsonResult jsonResult = JacksonUtil.json2pojo(airPortStr, JsonResult.class);
if (0 != jsonResult.getCode()) {
log.info("调用机场平台,无人机执行定点飞行:飞行失败,jsonResult:{}", jsonResult.getMsg());
throw new com.tuoheng.common.core.exception.ServiceException("机场平台返回,飞行失败");
}

return true;

}


Loading…
Cancel
Save