1.查询父线程 header信息
RequestAttributes attributes = RequestContextHolder.getRequestAttributes();
2.调用子线程时写入header
Callable<List> countryListCallable = () -> {
RequestContextHolder.setRequestAttributes(attributes);
return basicCountryService.getUserCountryByAccount(CommonConstants.ALL);
};
FutureTask<List> menuListTask = new FutureTask<>(countryListCallable);
executorService.submit(menuListTask);