diff --git a/order-management-consumer/src/main/java/com/dxhy/order/consumer/modules/commodity/controller/GroupCommodityCodeController.java b/order-management-consumer/src/main/java/com/dxhy/order/consumer/modules/commodity/controller/GroupCommodityCodeController.java index cc8ac59a..a486a7f4 100644 --- a/order-management-consumer/src/main/java/com/dxhy/order/consumer/modules/commodity/controller/GroupCommodityCodeController.java +++ b/order-management-consumer/src/main/java/com/dxhy/order/consumer/modules/commodity/controller/GroupCommodityCodeController.java @@ -166,15 +166,18 @@ public class GroupCommodityCodeController { } int index = 0; - List> completableFutureList = Lists.newArrayList(); - for (MdmGmfxxtbReqBO reqBO : reqBOList) { - CompletableFuture voidCompletableFuture = CompletableFuture.supplyAsync(()->{ - String str = buyerMessageService(reqBO); - return str; - }, voucherTaskExecutor); - completableFutureList.add(voidCompletableFuture); + List> partition = Lists.partition(reqBOList, 200); + for (List mdmGmfxxtbReqBOS : partition) { + List> completableFutureList = Lists.newArrayList(); + for (MdmGmfxxtbReqBO reqBO : mdmGmfxxtbReqBOS) { + CompletableFuture 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);