Selaa lähdekoodia

Merge branch 'develop' of gitadmin/tuoheng_telecomumale into release

tags/v1.3.1
wanjing 1 vuosi sitten
vanhempi
commit
94a61c9685
3 muutettua tiedostoa jossa 18 lisäystä ja 2 poistoa
  1. +9
    -1
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/tzhl/service/CallTianYiPlatformService.java
  2. +1
    -1
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/tzhl/service/fly/log/FlyLogBySuccessService.java
  3. +8
    -0
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/tzhl/service/fly/onlineuav/OnlineUavService.java

+ 9
- 1
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/tzhl/service/CallTianYiPlatformService.java Näytä tiedosto

@@ -41,8 +41,10 @@ public class CallTianYiPlatformService {
HttpHeaders headers = new HttpHeaders();
headers.add("Authorization", properties);

HttpEntity<Object> httpEntity = new HttpEntity<>(request, headers);
log.info("泰州海陵区城管,url:{}", url);
log.info("泰州海陵区城管,request:{}", request);

HttpEntity<Object> httpEntity = new HttpEntity<>(request, headers);
ResponseEntity<JsonResult> response;
try {
response = restTemplate.exchange(url, HttpMethod.GET, httpEntity, JsonResult.class);
@@ -64,6 +66,9 @@ public class CallTianYiPlatformService {
log.info("泰州海陵区城管,接口返回失败, request:{}", request);
throw new ServiceException(HttpStatus.BAD_REQUEST.value(), "泰州海陵区城管,接口返回失败");
}

log.info("泰州海陵区城管,接口返回, response={}", response);

return JSONObject.toJSONString(response.getBody().getData());
}

@@ -104,6 +109,9 @@ public class CallTianYiPlatformService {
log.info("泰州海陵区城管,接口返回失败, request:{}", request);
throw new ServiceException(HttpStatus.BAD_REQUEST.value(), "泰州海陵区城管,接口返回失败");
}

log.info("泰州海陵区城管,接口返回, response={}", response);

return JSONObject.toJSONString(response.getBody().getData());
}


+ 1
- 1
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/tzhl/service/fly/log/FlyLogBySuccessService.java Näytä tiedosto

@@ -43,7 +43,7 @@ public class FlyLogBySuccessService {

TZHLOnlineUavResponse tzhlOnlineUavResponse = onlineUavService.getOnlineUav();
if (ObjectUtil.isEmpty(tzhlOnlineUavResponse)) {
log.info("泰州海陵区城管,执行任务,获取推流地址失败");
log.info("泰州海陵区城管,执行任务,获取推流地址失败,inspectionId={}", inspection.getId());
return;
}


+ 8
- 0
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/tzhl/service/fly/onlineuav/OnlineUavService.java Näytä tiedosto

@@ -1,5 +1,6 @@
package com.tuoheng.admin.tzhl.service.fly.onlineuav;

import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSON;
import com.tuoheng.admin.entity.Inspection;
import com.tuoheng.admin.tzhl.constant.TZHLConstant;
@@ -8,6 +9,7 @@ import com.tuoheng.admin.tzhl.response.TZHLFlyDataResponse;
import com.tuoheng.admin.tzhl.response.TZHLOnlineUavResponse;
import com.tuoheng.admin.tzhl.service.CallTianYiPlatformService;
import com.tuoheng.common.core.utils.RedisUtils;
import com.tuoheng.common.core.utils.StringUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
@@ -34,7 +36,13 @@ public class OnlineUavService {
public TZHLOnlineUavResponse getOnlineUav() {
String apiPath = TZHLConstant.TIAN_YI_API_FLIGHT_SCREEN;
String dataJson = callTianYiPlatformService.callGet(apiPath, null);
if (StringUtils.isEmpty(dataJson)) {
return null;
}
TZHLOnlineUavResponse onlineUavResponse = JSON.parseObject(dataJson, TZHLOnlineUavResponse.class);
if (ObjectUtil.isEmpty(onlineUavResponse)) {
return null;
}
return onlineUavResponse;
}


Loading…
Peruuta
Tallenna