|
|
@@ -82,14 +82,14 @@ public class IcCardService {
|
|
|
if (null != card && dynamicDataSourceRegister.contains(card) && null != school) {
|
|
|
DynamicDataSourceContextHolder.set(card);
|
|
|
try {
|
|
|
- doTask(school.getName());
|
|
|
+ doTask(school);
|
|
|
} finally {
|
|
|
DynamicDataSourceContextHolder.clear();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private void doTask(String schoolName){
|
|
|
+ private void doTask(School school){
|
|
|
//1.准备本次需要传输的数据->转移至中间表
|
|
|
jdbcTemplate.execute(insertSql);
|
|
|
//2.获取本次传输的数据
|
|
|
@@ -100,7 +100,7 @@ public class IcCardService {
|
|
|
headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
|
|
|
MultiValueMap<String, String> requestEntity = new LinkedMultiValueMap<>();
|
|
|
requestEntity.add("data", JSON.toJSONString(resultList));
|
|
|
- requestEntity.add("school", schoolName);
|
|
|
+ requestEntity.add("school", school.getId());
|
|
|
HttpEntity<MultiValueMap<String, String>> httpEntity = new HttpEntity<>(requestEntity, headers);
|
|
|
ResponseEntity<Result> response = restTemplate.postForEntity(targetURL, httpEntity, Result.class);
|
|
|
if (response.getStatusCode() == HttpStatus.OK) {
|