Quellcode durchsuchen

Merge branch 'develop' of gitadmin/tuoheng_telecomumale into release

tags/v1.3.1
wanjing vor 1 Jahr
Ursprung
Commit
94a61c9685
3 geänderte Dateien mit 18 neuen und 2 gelöschten Zeilen
  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 Datei anzeigen

HttpHeaders headers = new HttpHeaders(); HttpHeaders headers = new HttpHeaders();
headers.add("Authorization", properties); 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; ResponseEntity<JsonResult> response;
try { try {
response = restTemplate.exchange(url, HttpMethod.GET, httpEntity, JsonResult.class); response = restTemplate.exchange(url, HttpMethod.GET, httpEntity, JsonResult.class);
log.info("泰州海陵区城管,接口返回失败, request:{}", request); log.info("泰州海陵区城管,接口返回失败, request:{}", request);
throw new ServiceException(HttpStatus.BAD_REQUEST.value(), "泰州海陵区城管,接口返回失败"); throw new ServiceException(HttpStatus.BAD_REQUEST.value(), "泰州海陵区城管,接口返回失败");
} }

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

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


log.info("泰州海陵区城管,接口返回失败, request:{}", request); log.info("泰州海陵区城管,接口返回失败, request:{}", request);
throw new ServiceException(HttpStatus.BAD_REQUEST.value(), "泰州海陵区城管,接口返回失败"); throw new ServiceException(HttpStatus.BAD_REQUEST.value(), "泰州海陵区城管,接口返回失败");
} }

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

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



+ 1
- 1
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/tzhl/service/fly/log/FlyLogBySuccessService.java Datei anzeigen



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



+ 8
- 0
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/tzhl/service/fly/onlineuav/OnlineUavService.java Datei anzeigen

package com.tuoheng.admin.tzhl.service.fly.onlineuav; package com.tuoheng.admin.tzhl.service.fly.onlineuav;


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



Laden…
Abbrechen
Speichern