|
@@ -86,12 +86,22 @@ public class AttendanceAssessmentSdk {
|
|
|
config.setIgnoreNullValue(false);
|
|
|
String jsonStr = JSONUtil.toJsonStr(paramVo.getData(), config);
|
|
|
logger.info("入参:{}", jsonStr);
|
|
|
- String apiResult = HttpRequest.post(url).headerMap(setHeadMap(), true).body(jsonStr).execute().body();
|
|
|
- logger.info("接口返回报文:{}", apiResult);
|
|
|
- ApiReturnDto apiReturnDto = JSONUtil.toBean(apiResult, ApiReturnDto.class);
|
|
|
- // 接口调用结束后续逻辑处理
|
|
|
- Thread td = new Thread(() -> afterAll(paramVo, jsonStr, apiResult));
|
|
|
- td.start();
|
|
|
+ ApiReturnDto apiReturnDto = null;
|
|
|
+ String apiResult=null;
|
|
|
+ try {
|
|
|
+ apiResult = HttpRequest.post(url).headerMap(setHeadMap(), true).body(jsonStr).execute().body();
|
|
|
+ logger.info("接口返回报文:{}", apiResult);
|
|
|
+ apiReturnDto= JSONUtil.toBean(apiResult, ApiReturnDto.class);
|
|
|
+ }catch (Exception e){
|
|
|
+ e.printStackTrace();
|
|
|
+ logger.error("接口调用异常",e.getMessage());
|
|
|
+ apiResult="接口调用异常:"+e.getMessage();
|
|
|
+ }finally {
|
|
|
+ // 接口调用结束后续逻辑处理
|
|
|
+ String finalApiResult = apiResult;
|
|
|
+ Thread td = new Thread(() -> afterAll(paramVo, jsonStr, finalApiResult));
|
|
|
+ td.start();
|
|
|
+ }
|
|
|
return apiReturnDto;
|
|
|
}
|
|
|
|