|
|
|
@ -166,15 +166,18 @@ public class GroupCommodityCodeController { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
int index = 0; |
|
|
|
|
List<CompletableFuture<String>> completableFutureList = Lists.newArrayList(); |
|
|
|
|
for (MdmGmfxxtbReqBO reqBO : reqBOList) { |
|
|
|
|
CompletableFuture<String> voidCompletableFuture = CompletableFuture.supplyAsync(()->{ |
|
|
|
|
String str = buyerMessageService(reqBO); |
|
|
|
|
return str; |
|
|
|
|
}, voucherTaskExecutor); |
|
|
|
|
completableFutureList.add(voidCompletableFuture); |
|
|
|
|
List<List<MdmGmfxxtbReqBO>> partition = Lists.partition(reqBOList, 200); |
|
|
|
|
for (List<MdmGmfxxtbReqBO> mdmGmfxxtbReqBOS : partition) { |
|
|
|
|
List<CompletableFuture<String>> completableFutureList = Lists.newArrayList(); |
|
|
|
|
for (MdmGmfxxtbReqBO reqBO : mdmGmfxxtbReqBOS) { |
|
|
|
|
CompletableFuture<String> voidCompletableFuture = CompletableFuture.supplyAsync(()->{ |
|
|
|
|
String str = buyerMessageService(reqBO); |
|
|
|
|
return str; |
|
|
|
|
}, voucherTaskExecutor); |
|
|
|
|
completableFutureList.add(voidCompletableFuture); |
|
|
|
|
} |
|
|
|
|
CompletableFuture.allOf(completableFutureList.toArray(new CompletableFuture[0])).join(); |
|
|
|
|
} |
|
|
|
|
CompletableFuture.allOf(completableFutureList.toArray(new CompletableFuture[0])).join(); |
|
|
|
|
return R.ok().put("data",""); |
|
|
|
|
} catch (IOException e) { |
|
|
|
|
throw new RuntimeException(e); |
|
|
|
|