Commit b7a3936a by 周立明

fix: 调整商品同步SCRM逻辑,统一同步门店商品规则

1. 移除硬编码的同步开关配置,统一使用同步执行模式
2. 将门店商品规则创建逻辑合并到同步任务中,不管同步方式都执行
3. 调整注释位置和代码缩进,优化代码可读性
1 parent 045c3477
...@@ -386,11 +386,14 @@ public class PushGoodsManager { ...@@ -386,11 +386,14 @@ public class PushGoodsManager {
log.info("2.0商品信息:{}",dto); log.info("2.0商品信息:{}",dto);
if(isSyncSend) { if(isSyncSend) {
serviceMerchantConfigRemote.addMerchantConfigWithGood(dto); serviceMerchantConfigRemote.addMerchantConfigWithGood(dto);
//同步商品并同步创建门店商品规则
vdRuleService.goodsPushCreateVdRule(dto);
}else{ }else{
taskExecutor.execute(() -> serviceMerchantConfigRemote.addMerchantConfigWithGood(dto)); taskExecutor.execute(() -> {
serviceMerchantConfigRemote.addMerchantConfigWithGood(dto);
vdRuleService.goodsPushCreateVdRule(dto);
});
} }
//同步商品并同步创建门店商品规则
taskExecutor.execute(() -> vdRuleService.goodsPushCreateVdRule(dto));
} catch (Exception e) { } catch (Exception e) {
log.error("sendGoods2Scrm Exception:" + e.getMessage()); log.error("sendGoods2Scrm Exception:" + e.getMessage());
} }
......
...@@ -2099,12 +2099,11 @@ public class MerchantGoodsInfoService { ...@@ -2099,12 +2099,11 @@ public class MerchantGoodsInfoService {
public void sendGoods(List<Integer> merchantGoodsIds) { public void sendGoods(List<Integer> merchantGoodsIds) {
try{ try{
boolean isSync = OrePropertyConfigurer.getProperty("merchant.goods.push.to.scrm.sync", Boolean.class,false);
log.info("开始同步上架商品到SCRM, merchantGoodsIds:{}", merchantGoodsIds); log.info("开始同步上架商品到SCRM, merchantGoodsIds:{}", merchantGoodsIds);
for(Integer id : merchantGoodsIds){ for(Integer id : merchantGoodsIds){
try{ try{
MerchantGoodsInfoDTO goodsInfo = this.getDetailById(id); MerchantGoodsInfoDTO goodsInfo = this.getDetailById(id);
pushGoodsManager.sendGoods(goodsInfo, CommonConstants.DEFAULT_UPDATE_BY,isSync); pushGoodsManager.sendGoods(goodsInfo, CommonConstants.DEFAULT_UPDATE_BY,true);
log.info("同步上架商品到scrm成功:{}", id); log.info("同步上架商品到scrm成功:{}", id);
}catch (Exception e){ }catch (Exception e){
log.error("同步上架商品到scrm失败:" +id, e); log.error("同步上架商品到scrm失败:" +id, e);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!