|
@@ -315,10 +315,10 @@ public class YyskAddressStandardizationServiceImpl {
|
|
|
// 提交任务到线程池
|
|
|
for (int i = 0; i < totalTasks; i++) {
|
|
|
long startTime = System.currentTimeMillis();
|
|
|
- final int taskId = sort * (i + 1) + startFileIndex;
|
|
|
+ int taskId = sort * i + startFileIndex;
|
|
|
// 任务执行
|
|
|
- startMutilExecutor(taskId, fileRootPath + "datas\\yysk_dmdz_address_standardization_200000_" + taskId + ".xlsx",
|
|
|
- fileRootPath + "output\\yysk_dmdz_address_standardization_200000_result_" + taskId + ".xlsx");
|
|
|
+ startMutilExecutor(taskId, fileRootPath + "ziranren\\yysk_dmdz_address_standardization_10000_" + taskId + ".xlsx",
|
|
|
+ fileRootPath + "ziranrenOutput\\yysk_dmdz_address_standardization_10000_" + taskId + ".xlsx");
|
|
|
long endTime = System.currentTimeMillis();
|
|
|
ScheduledTasks.taskRunStatus = false;
|
|
|
System.out.println("单个文件处理完成!用时" + (endTime - startTime) / 1000 + "秒!");
|
|
@@ -357,13 +357,8 @@ public class YyskAddressStandardizationServiceImpl {
|
|
|
// 创建线程池
|
|
|
ExecutorService executorService = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors());
|
|
|
List<Future<?>> futures = new ArrayList<>();
|
|
|
-// int index = 1;
|
|
|
-// int total = listData.size();
|
|
|
for (YyskAddressStandardization item : listData) {
|
|
|
-// index++;
|
|
|
-// int finalIndex = index;
|
|
|
futures.add(executorService.submit(() -> {
|
|
|
-// System.out.println("<<<---- 开始查询第: " + finalIndex + " 条数据。。。共:" + total + "条数据--->>>>>>>");
|
|
|
List<String> addrList = new ArrayList<>();
|
|
|
String[] addr = AddressMatcher.matchProvinceAndCity(item.getAddress());
|
|
|
if (addr != null && !addr[0].contains("上海")) {
|
|
@@ -385,7 +380,6 @@ public class YyskAddressStandardizationServiceImpl {
|
|
|
if (addrList.size() > 0) {
|
|
|
// TODO 开始查询
|
|
|
AddressResult addressResult = AddressQueryEngine.getInstance().commonSearchByName(addrList);
|
|
|
-// System.out.println("<<<---- 第: " + finalIndex + " 条数据返回数据,数据为:!!!" + addressResult.getMessage() + " ----->>>>>");
|
|
|
if (addressResult.getData() == null || addressResult.getData().size() < 1) {
|
|
|
item.setMatchLevel("异常");
|
|
|
item.setReturnAddress("未匹配到符合规则的结果");
|
|
@@ -464,8 +458,8 @@ public class YyskAddressStandardizationServiceImpl {
|
|
|
try {
|
|
|
future.get();
|
|
|
} catch (InterruptedException | ExecutionException e) {
|
|
|
- e.printStackTrace();
|
|
|
- System.err.println("线程异常:" + e);
|
|
|
+// e.printStackTrace();
|
|
|
+// System.err.println("线程异常:" + e);
|
|
|
}
|
|
|
}
|
|
|
// 关闭线程池
|