## 全网产品同步添加开关控制;
This commit is contained in:
parent
a1178b2e22
commit
a1d0f50ed4
|
@ -2461,6 +2461,9 @@ public class SaOrderServiceImpl extends ServiceImpl<SaOrderMapper, SaOrder> impl
|
|||
* @param saOrderExt
|
||||
*/
|
||||
private void allProductSync(SaOrderExt saOrderExt) {
|
||||
if (EYesNo.NO.getIntValue() == BdConfig.getProductSync()) {
|
||||
return;
|
||||
}
|
||||
Map<Integer, BdProduct> productMap = iBdProductService.queryProductMap(saOrderExt.getOrderItemsList().stream().map(SaOrderItems::getPkProduct).collect(Collectors.toSet()), null);
|
||||
// 开启线程调用全网产品库存
|
||||
// 请求参数
|
||||
|
@ -2478,8 +2481,8 @@ public class SaOrderServiceImpl extends ServiceImpl<SaOrderMapper, SaOrder> impl
|
|||
// 请求头
|
||||
String header = Base64Encoder.encode(BdConfig.getSysName() + "!" + saOrderExt.getOrderCode());
|
||||
ThreadUtils.threadPoolExecutor.submit(() -> {
|
||||
log.info("===header: {}", header);
|
||||
log.info("===bodyMap: {}", bodyMap);
|
||||
log.info("同步产品,header: {}", header);
|
||||
log.info("同步产品,bodyMap: {}", bodyMap);
|
||||
HttpRequest httpRequest = HttpUtil.createPost(BdConfig.getProductSyncUrl());
|
||||
httpRequest.header("authorization", header);
|
||||
httpRequest.body(JSONUtil.toJsonStr(bodyMap));
|
||||
|
|
|
@ -37,6 +37,10 @@ public class BdConfig {
|
|||
*/
|
||||
private static String android;
|
||||
|
||||
/**
|
||||
* 商品同步是否开启(0=开启,1=不开启)
|
||||
*/
|
||||
private static Integer productSync;
|
||||
/**
|
||||
* 商品同步地址
|
||||
*/
|
||||
|
@ -90,6 +94,14 @@ public class BdConfig {
|
|||
BdConfig.android = android;
|
||||
}
|
||||
|
||||
public static Integer getProductSync() {
|
||||
return productSync;
|
||||
}
|
||||
|
||||
public void setProductSync(Integer productSync) {
|
||||
BdConfig.productSync = productSync;
|
||||
}
|
||||
|
||||
public static String getProductSyncUrl() {
|
||||
return productSyncUrl;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue