|
@ -58,6 +58,28 @@ public class RestBusinessTemplate { |
|
|
return result; |
|
|
return result; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static CommonResult<Void> execute1(VoidCallback callback) { |
|
|
|
|
|
CommonResult<Void> result = new CommonResult<>(); |
|
|
|
|
|
try { |
|
|
|
|
|
callback.execute(); |
|
|
|
|
|
result.setCode(ResultCode.SUCCESS.getCode()); |
|
|
|
|
|
result.setDesc("推送中,如未审核成功,请查看单据审核结果信息。"); |
|
|
|
|
|
} catch (BadRequestException e) { |
|
|
|
|
|
log.error("", e); |
|
|
|
|
|
ResultCode code = e.getCode() == null ? ResultCode.FAILED : e.getCode(); |
|
|
|
|
|
result.setCode(code.getCode()); |
|
|
|
|
|
result.setDesc(StringUtils.isBlank(e.getMessage()) ? code.getMsg() : e.getMessage()); |
|
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
log.error("execute error", e); |
|
|
|
|
|
result.setCode(ResultCode.FAILED.getCode()); |
|
|
|
|
|
result.setDesc(ResultCode.FAILED.getMsg()); |
|
|
|
|
|
} |
|
|
|
|
|
return result; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 执行回调 |
|
|
* 执行回调 |
|
|
* |
|
|
* |
|
|