Browse Source

Merge branch 'develop' into release

tags/v1.1.0^2
wanghaoran 1 year ago
parent
commit
28e1d378a7
2 changed files with 8 additions and 2 deletions
  1. +7
    -1
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/ThInspectionServiceImpl.java
  2. +1
    -1
      tuoheng-common/src/main/java/com/tuoheng/common/utils/HttpUtils.java

+ 7
- 1
tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/ThInspectionServiceImpl.java View File

jsonObject.put("taskId", thMission.getInspectionLine()); jsonObject.put("taskId", thMission.getInspectionLine());
jsonObject.put("requestId", missionId); jsonObject.put("requestId", missionId);
log.info("***** executeTask url:{};param:{}", url, jsonObject.toJSONString()); log.info("***** executeTask url:{};param:{}", url, jsonObject.toJSONString());
String airPortStr = HttpUtils.doSend(url, jsonObject, null, "POST");
String airPortStr = null;
try {
airPortStr = HttpUtils.doSend(url, jsonObject, null, "POST");
} catch (Exception e) {
log.error("调用机场executeTask接口异常:",e);
return JsonResult.error("调用机场executeTask接口异常");
}
if(StringUtils.isEmpty(airPortStr)){ if(StringUtils.isEmpty(airPortStr)){
return JsonResult.error("机场接口返回数据为空"); return JsonResult.error("机场接口返回数据为空");
} }

+ 1
- 1
tuoheng-common/src/main/java/com/tuoheng/common/utils/HttpUtils.java View File

connection.setDoOutput(true); // 设置该连接是可以输出的 connection.setDoOutput(true); // 设置该连接是可以输出的
//设置连接超时时间和读取超时时间 //设置连接超时时间和读取超时时间
connection.setConnectTimeout(15000); connection.setConnectTimeout(15000);
connection.setReadTimeout(60000 * 2);
connection.setReadTimeout(60000 * 5);
//设置请求方式 //设置请求方式
connection.setRequestMethod(method); connection.setRequestMethod(method);
connection.setRequestProperty("Content-Type", "application/json;charset=UTF-8"); connection.setRequestProperty("Content-Type", "application/json;charset=UTF-8");

Loading…
Cancel
Save