feature 1.刪除多线程条件

release
zhenghaiyang@ele-cloud.com 2 years ago
parent 1f364b9afe
commit 031cb1fdfe
  1. 29
      order-management-consumer/src/main/java/com/dxhy/order/consumer/modules/commodity/controller/GroupCommodityCodeController.java
  2. 21
      order-management-consumer/src/main/java/com/dxhy/order/consumer/openapi/service/impl/SDEnregyServiceImpl.java

@ -31,7 +31,6 @@ import javax.annotation.Resource;
import java.io.IOException; import java.io.IOException;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.Executor; import java.util.concurrent.Executor;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -164,20 +163,20 @@ public class GroupCommodityCodeController {
reqBO.setUUID(baseService.getGenerateShotKey()); reqBO.setUUID(baseService.getGenerateShotKey());
reqBOList.add(reqBO); reqBOList.add(reqBO);
} }
String service = sdEnregyService.syncBuyerMessageService(reqBOList);
int index = 0; // int index = 0;
List<List<MdmGmfxxtbReqBO>> partition = Lists.partition(reqBOList, 200); // List<List<MdmGmfxxtbReqBO>> partition = Lists.partition(reqBOList, 200);
for (List<MdmGmfxxtbReqBO> mdmGmfxxtbReqBOS : partition) { // for (List<MdmGmfxxtbReqBO> mdmGmfxxtbReqBOS : partition) {
List<CompletableFuture<String>> completableFutureList = Lists.newArrayList(); // List<CompletableFuture<String>> completableFutureList = Lists.newArrayList();
for (MdmGmfxxtbReqBO reqBO : mdmGmfxxtbReqBOS) { // for (MdmGmfxxtbReqBO reqBO : mdmGmfxxtbReqBOS) {
CompletableFuture<String> voidCompletableFuture = CompletableFuture.supplyAsync(()->{ // CompletableFuture<String> voidCompletableFuture = CompletableFuture.supplyAsync(()->{
String str = buyerMessageService(reqBO); // String str = buyerMessageService(reqBO);
return str; // return str;
}, voucherTaskExecutor); // }, voucherTaskExecutor);
completableFutureList.add(voidCompletableFuture); // completableFutureList.add(voidCompletableFuture);
} // }
CompletableFuture.allOf(completableFutureList.toArray(new CompletableFuture[0])).join(); // CompletableFuture.allOf(completableFutureList.toArray(new CompletableFuture[0])).join();
} // }
return R.ok().put("data",""); return R.ok().put("data","");
} catch (IOException e) { } catch (IOException e) {
throw new RuntimeException(e); throw new RuntimeException(e);

@ -559,7 +559,12 @@ public class SDEnregyServiceImpl extends SDEnregyServiceAbstract {
@Override @Override
public String syncMdmGroupTaxService(List<MdmSyncGroupTaxCodeReqBO> taxxtbReqBOS){ public String syncMdmGroupTaxService(List<MdmSyncGroupTaxCodeReqBO> taxxtbReqBOS){
AjaxResult syncResult = this.syncMdmGroupTax(taxxtbReqBOS,null); AjaxResult syncResult = null;
try {
syncResult = this.syncMdmGroupTax(taxxtbReqBOS,null);
} catch (Exception e) {
throw new RuntimeException(e);
}
if (syncResult.isSuccess()) { if (syncResult.isSuccess()) {
return ""; return "";
} else { } else {
@ -570,7 +575,12 @@ public class SDEnregyServiceImpl extends SDEnregyServiceAbstract {
@Override @Override
public String syncBuyerMessageService(List<MdmGmfxxtbReqBO> mdmGmfxxtbReqBOS){ public String syncBuyerMessageService(List<MdmGmfxxtbReqBO> mdmGmfxxtbReqBOS){
AjaxResult syncResult = this.syncBuyerMessage(mdmGmfxxtbReqBOS,null); AjaxResult syncResult = null;
try {
syncResult = this.syncBuyerMessage(mdmGmfxxtbReqBOS,null);
} catch (Exception e) {
throw new RuntimeException(e);
}
if (syncResult.isSuccess()) { if (syncResult.isSuccess()) {
return ""; return "";
} else { } else {
@ -715,7 +725,12 @@ public class SDEnregyServiceImpl extends SDEnregyServiceAbstract {
@Override @Override
public String syncMdmUserService(List<MdmSyncUserReqBO> mdmSyncUserReqBO){ public String syncMdmUserService(List<MdmSyncUserReqBO> mdmSyncUserReqBO){
AjaxResult syncResult = this.syncMdmUser(mdmSyncUserReqBO,null); AjaxResult syncResult = null;
try {
syncResult = this.syncMdmUser(mdmSyncUserReqBO,null);
} catch (Exception e) {
throw new RuntimeException(e);
}
if (syncResult.isSuccess()) { if (syncResult.isSuccess()) {
return ""; return "";
} else { } else {

Loading…
Cancel
Save