Forráskód Böngészése

海博正式环境配置

fubojin 13 órája
szülő
commit
841ff1e46a

+ 2 - 2
yami-shop-api/src/main/resources/application-dev.yml

@@ -2,9 +2,9 @@ server:
   port: 8112
 spring:
   datasource:
-    url: jdbc:mysql://192.168.1.242:3306/yami_bbc?allowMultiQueries=true&useSSL=false&useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true
+    url: jdbc:mysql://rm-bp15g68z8j527q9n9xo.mysql.rds.aliyuncs.com:3306/yami_bbc?allowMultiQueries=true&useSSL=false&useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true
     username: root
-    password: FaajjVy8rl(k
+    password: BXyzm3RKR2nA9vn5ZkeP!
     driver-class-name: com.mysql.cj.jdbc.Driver
     type: com.zaxxer.hikari.HikariDataSource
     hikari:

+ 5 - 0
yami-shop-bean/src/main/java/com/yami/shop/bean/model/Product.java

@@ -41,6 +41,11 @@ public class Product implements Serializable {
      */
     private Long hbSpuId;
 
+    /**
+     * 海博渠道编码
+     */
+    private String channelCode;
+
     /**
      * 店铺id
      */

+ 0 - 5
yami-shop-platform/src/main/java/com/yami/shop/platform/controller/IndexImgController.java

@@ -42,14 +42,9 @@ public class IndexImgController {
 
     @Autowired
     private IndexImgService indexImgService;
-
     @Autowired
     private ProductService productService;
 
-    @Autowired
-    private AttachFileService attachFileService;
-
-
     /**
      * 分页获取
      */

+ 2 - 2
yami-shop-platform/src/main/resources/application-dev.yml

@@ -2,9 +2,9 @@ server:
   port: 8114
 spring:
   datasource:
-    url: jdbc:mysql://192.168.1.242:3306/yami_bbc?allowMultiQueries=true&useSSL=false&useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true
+    url: jdbc:mysql://rm-bp15g68z8j527q9n9xo.mysql.rds.aliyuncs.com:3306/yami_bbc?allowMultiQueries=true&useSSL=false&useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true
     username: root
-    password: FaajjVy8rl(k
+    password: BXyzm3RKR2nA9vn5ZkeP!
     driver-class-name: com.mysql.cj.jdbc.Driver
     type: com.zaxxer.hikari.HikariDataSource
     hikari:

+ 2 - 2
yami-shop-platform/src/main/resources/application.yml

@@ -1,8 +1,8 @@
 spring:
   # 环境 dev|prod|docker quartz定时任务
   profiles:
-#    active: dev
-    active: prod
+    active: dev
+#    active: prod
   #文件上传设置
   servlet:
 

+ 10 - 3
yami-shop-service/src/main/java/com/yami/shop/service/hb/impl/HBGoodsService.java

@@ -41,7 +41,6 @@ public class HBGoodsService implements IHBGoodsService {
     private final SkuMapper skuMapper;
     private final ShopSkuMapper shopSkuMapper;
     private final ShopDetailMapper shopDetailMapper;
-    private final FrontCategoryMapper frontCategoryMapper;
     private final CategoryProdMapper categoryProdMapper;
 
     @Override
@@ -313,7 +312,14 @@ public class HBGoodsService implements IHBGoodsService {
         JSONObject bodyJson = JSON.parseObject(bodyStr);
 
         String spuId = bodyJson.getString("spuId");
-        Product product = productMapper.selectByHbSpuId(spuId);
+        Product product;
+        if (ObjectUtil.isEmpty(spuId)) {
+            product = productMapper.selectOne(new LambdaQueryWrapper<Product>()
+                    .eq(Product::getChannelCode, bodyJson.getString("channelCode"))
+                    .eq(Product::getIsDelete, 0));
+        } else {
+            product = productMapper.selectByHbSpuId(spuId);
+        }
         if (!ObjectUtil.isEmpty(product)) {
             product.setIsDelete(1);
             productMapper.updateById(product);
@@ -421,6 +427,7 @@ public class HBGoodsService implements IHBGoodsService {
         log.info("productInfo:{}", productInfo);
         // 直接映射字段
         product.setHbSpuId(productInfo.getLong("spuId"));
+        product.setChannelCode(productInfo.getString("channelCode"));
         product.setProdName(productInfo.getString("spuName"));
         product.setBrief(productInfo.getString("sellPoint"));//简要描述,卖点等
         product.setVideo(productInfo.getString(""));//商品视频
@@ -530,7 +537,7 @@ public class HBGoodsService implements IHBGoodsService {
             String ztFrontCategoryCodeLevel = jsonObject.getString("ztFrontCategoryCodeLevel2");
             if (StringUtils.isEmpty(ztFrontCategoryCodeLevel)) {
                 ztFrontCategoryCodeLevel = jsonObject.getString("ztFrontCategoryCode");
-            }else {
+            } else {
                 //如果是二级,一级对应商品不存在也需要添加
                 addCategoryProd(spuId, ztFrontCategoryCodeLevel);
                 ztFrontCategoryCodeLevel = jsonObject.getString("ztFrontCategoryCode");