|
@@ -136,27 +136,32 @@ public class DianZhongServiceImpl implements IDianZhongService {
|
|
|
String url = task.getString("url");
|
|
String url = task.getString("url");
|
|
|
String type = task.getString("type");
|
|
String type = task.getString("type");
|
|
|
String clientId = task.getString("client_id");
|
|
String clientId = task.getString("client_id");
|
|
|
- log.info("开始下载点众数据 taskId:{}, clientId:{}, type:{}", taskId, clientId, type);
|
|
|
|
|
- downloadFileRestTemplate.execute(url, org.springframework.http.HttpMethod.GET, null,
|
|
|
|
|
- (ResponseExtractor<Void>) response -> {
|
|
|
|
|
- try (BufferedReader reader = new BufferedReader(
|
|
|
|
|
- new InputStreamReader(response.getBody(), StandardCharsets.UTF_8))) {
|
|
|
|
|
- String line;
|
|
|
|
|
- while ((line = reader.readLine()) != null) {
|
|
|
|
|
- if ("user".equals(type)) {
|
|
|
|
|
- getDZUser(line);
|
|
|
|
|
- getDZLogin(line);
|
|
|
|
|
- getDZActivation(line);
|
|
|
|
|
- getDZRegister(line, statDate);
|
|
|
|
|
- } else if ("order".equals(type)) {
|
|
|
|
|
- getDZOrder(line);
|
|
|
|
|
|
|
+ try {
|
|
|
|
|
+ log.info("开始下载点众数据 taskId:{}, clientId:{}, type:{}", taskId, clientId, type);
|
|
|
|
|
+ downloadFileRestTemplate.execute(url, org.springframework.http.HttpMethod.GET, null,
|
|
|
|
|
+ (ResponseExtractor<Void>) response -> {
|
|
|
|
|
+ try (BufferedReader reader = new BufferedReader(
|
|
|
|
|
+ new InputStreamReader(response.getBody(), StandardCharsets.UTF_8))) {
|
|
|
|
|
+ String line;
|
|
|
|
|
+ while ((line = reader.readLine()) != null) {
|
|
|
|
|
+ if ("user".equals(type)) {
|
|
|
|
|
+ getDZUser(line);
|
|
|
|
|
+ getDZLogin(line);
|
|
|
|
|
+ getDZActivation(line);
|
|
|
|
|
+ getDZRegister(line, statDate);
|
|
|
|
|
+ } else if ("order".equals(type)) {
|
|
|
|
|
+ getDZOrder(line);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
- return null;
|
|
|
|
|
- });
|
|
|
|
|
- dianZhongMapper.updateTaskDownloaded(taskId);
|
|
|
|
|
- log.info("下载点众数据成功 taskId:{}, clientId:{}, type:{}", taskId, clientId, type);
|
|
|
|
|
|
|
+ return null;
|
|
|
|
|
+ });
|
|
|
|
|
+ dianZhongMapper.updateTaskDownloaded(taskId);
|
|
|
|
|
+ log.info("下载点众数据成功 taskId:{}, clientId:{}, type:{}", taskId, clientId, type);
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ log.error("下载点众数据失败 taskId:{}, clientId:{}, type:{}", taskId, clientId, type, e);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|