Parcourir la source

商品信息表同步

mac il y a 2 ans
Parent
commit
8ffec0c545

+ 6 - 2
kxs-transfer/src/main/java/com/kxs/transfer/api/service/product/impl/KxsShopGoodsServiceImpl.java

@@ -9,6 +9,7 @@ import com.alibaba.fastjson.JSONObject;
 import com.aliyun.dts.subscribe.clients.record.OperationType;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.kxs.common.core.util.RetOps;
 import com.kxs.product.api.model.KxsShopGoods;
 import com.kxs.product.api.model.KxsShopGoodsPic;
 import com.kxs.product.api.model.KxsShopGoodsSku;
@@ -139,8 +140,10 @@ public class KxsShopGoodsServiceImpl extends ServiceImpl<KxsShopGoodsMapper, Kxs
         }
         //获取sku列表
         FieldData fieldData = fieldDataMap.get("NormJson");
-        String value = fieldData.getValue().toString();
-        if(StrUtil.isNotBlank(value) && value.contains("#cut#")){
+        if(fieldData.getValue() != null && StrUtil.isNotBlank(fieldData.getValue().toString()) && fieldData.getValue().toString().contains("#cut#") ){
+
+            String value = fieldData.getValue().toString();
+
             List<KxsShopGoodsSku> specs = new ArrayList<>();
 
             String goodsSku = value.substring(value.indexOf("#cut#") + 5);
@@ -195,6 +198,7 @@ public class KxsShopGoodsServiceImpl extends ServiceImpl<KxsShopGoodsMapper, Kxs
                 kxsShopGoodsSkuService.updateById(kxsShopGoodsSku);
             }
         }
+        //添加商品
         KxsShopGoods kxsShopGoods = baseMapper.selectById(goods.getId());
         if(kxsShopGoods == null){
             baseMapper.insert(goods);