|
|
|
@ -31,7 +31,6 @@ import javax.annotation.Resource; |
|
|
|
|
import java.io.IOException; |
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.Map; |
|
|
|
|
import java.util.concurrent.CompletableFuture; |
|
|
|
|
import java.util.concurrent.Executor; |
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
@ -164,20 +163,20 @@ public class GroupCommodityCodeController { |
|
|
|
|
reqBO.setUUID(baseService.getGenerateShotKey()); |
|
|
|
|
reqBOList.add(reqBO); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
int index = 0; |
|
|
|
|
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(); |
|
|
|
|
} |
|
|
|
|
String service = sdEnregyService.syncBuyerMessageService(reqBOList); |
|
|
|
|
// int index = 0;
|
|
|
|
|
// 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();
|
|
|
|
|
// }
|
|
|
|
|
return R.ok().put("data",""); |
|
|
|
|
} catch (IOException e) { |
|
|
|
|
throw new RuntimeException(e); |
|
|
|
|