Explorar el Código

Merge remote-tracking branch 'origin/develop' into feature_v1.0

tags/v1.3.1
chengwang hace 1 año
padre
commit
7e67b5ff1e
Se han modificado 2 ficheros con 15 adiciones y 5 borrados
  1. +15
    -2
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/tzhl/service/CallTianYiPlatformService.java
  2. +0
    -3
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/tzhl/service/token/TZHLGetTokenService.java

+ 15
- 2
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/tzhl/service/CallTianYiPlatformService.java Ver fichero

@@ -109,8 +109,21 @@ public class CallTianYiPlatformService {
headers.setContentType(MediaType.APPLICATION_JSON);
HttpEntity httpEntity = new HttpEntity(request, headers);
String url = TZHLConfig.tzhlURL + TZHLConstant.TIAN_YI_API_TICKET_LOGIN;
String dataJson = this.callGet(url, httpEntity);
tokenResponse = JSONObject.parseObject(dataJson, TZHLTokenResponse.class);
ResponseEntity<TZHLTokenResponse> response;
try {
response = restTemplate.exchange(url, HttpMethod.POST, httpEntity, TZHLTokenResponse.class);
} catch (Exception e) {
log.info("泰州海陵区城管,获取token接口异常, url:{}", url);
log.info("泰州海陵区城管,获取token接口异常, httpEntity:{}", httpEntity);
throw new ServiceException("南京海事局,获取token接口异常");
}
if (null == response || !response.hasBody()) {
log.info("泰州海陵区城管,获取token接口失败,response为空");
log.info("泰州海陵区城管,获取token接口失败, url:{}", url);
log.info("泰州海陵区城管,获取token接口失败, httpEntity:{}", httpEntity);
throw new ServiceException("泰州海陵区城管,获取token接口失败");
}
tokenResponse = JSONObject.parseObject(JSONObject.toJSONString(response.getBody()), TZHLTokenResponse.class);
if (!TZHLConstant.RESPONSE_SUCCESS_CODE.equals(tokenResponse.getCode())) {
log.error("泰州海陵区城管,获取token接口失败,{}", tokenResponse);
throw new ServiceException("泰州海陵区城管,获取token接口失败");

+ 0
- 3
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/tzhl/service/token/TZHLGetTokenService.java Ver fichero

@@ -61,9 +61,6 @@ public class TZHLGetTokenService {
throw new ServiceException("泰州海陵区城管,获取token接口失败");
}
TZHLTokenResponse tokenResponse = JSONObject.parseObject(JSONObject.toJSONString(response.getBody()), TZHLTokenResponse.class);
log.info("TZHLConstant.RESPONSE_SUCCESS_CODE:{}", TZHLConstant.RESPONSE_SUCCESS_CODE);
log.info("tokenResponse.getCode:{}", tokenResponse.getCode());

if (!TZHLConstant.RESPONSE_SUCCESS_CODE.equals(tokenResponse.getCode())) {
log.error("泰州海陵区城管,获取token接口失败,{}", response.getBody());
throw new ServiceException("泰州海陵区城管,获取token接口失败");

Cargando…
Cancelar
Guardar