Browse Source

Merge branch 'cpq-dev' of wangfan/adweb3-server into master

chenpeiqing 1 week ago
parent
commit
b44d06ecf0

+ 10 - 6
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/product/service/impl/AdwebProductServiceImpl.java

@@ -65,10 +65,10 @@ public class AdwebProductServiceImpl extends ServiceImpl<AdwebProductMapper, Adw
     }
   }
 
-  private void handleUpdate(ProductDTO productDTO, AdwebSite adwebSites) {
+  private void handleUpdate(ProductDTO productDTO, AdwebSite adwebSite) {
     LambdaQueryWrapper<AdwebProduct> productQuery = new LambdaQueryWrapper<>();
     productQuery.eq(AdwebProduct::getProductId, productDTO.getProductId());
-    productQuery.eq(AdwebProduct::getSiteCode, adwebSites.getCode());
+    productQuery.eq(AdwebProduct::getSiteCode, adwebSite.getCode());
 
     AdwebProduct product = this.getOne(productQuery);
     // 执行更新操作
@@ -78,15 +78,15 @@ public class AdwebProductServiceImpl extends ServiceImpl<AdwebProductMapper, Adw
     } else {
       // 非删除动作并且库里没有产品时,执行新增操作
       if (!"delete".equals(productDTO.getActionType())) {
-        addProduct(productDTO, adwebSites);
+        addProduct(productDTO, adwebSite);
       }
     }
   }
 
-  private void handleAdd(ProductDTO productDTO, AdwebSite adwebSites) {
+  private void handleAdd(ProductDTO productDTO, AdwebSite adwebSite) {
     AdwebProduct product = new AdwebProduct();
     BeanUtil.copyProperties(productDTO, product);
-    product.setSiteCode(adwebSites.getCode());
+    product.setSiteCode(adwebSite.getCode());
     this.saveProduct(product);
   }
 
@@ -133,7 +133,11 @@ public class AdwebProductServiceImpl extends ServiceImpl<AdwebProductMapper, Adw
       params.put("domain", productDTO.getSiteHost());
       params.put("product_id", productDTO.getProductId());
       params.put("name", productDTO.getProductName());
-      params.put("cn_name", productDTO.getProductNameZh());
+      params.put(
+          "cn_name",
+          StringUtils.isBlank(productDTO.getProductNameZh())
+              ? productDTO.getProductName()
+              : productDTO.getProductNameZh());
       params.put("adduser", productDTO.getAuthorName());
       params.put("image", imageBase64);