zhaoxian 3 vuotta sitten
vanhempi
commit
34e5ee0f4a

+ 10 - 4
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/material/service/impl/ProductMaterialServiceImpl.java

@@ -109,10 +109,16 @@ public class ProductMaterialServiceImpl extends ServiceImpl<ProductMaterialMappe
             String uploaderId = trade.getString("uploaderId");
             int count = 0;
             if (Check.isNull(videoUrl)) {
-                ProductMaterial material = new ProductMaterial();
-                material.setTradeName(tradeName);
-                lists.add(material);
-            } else {
+                QueryWrapper<ProductMaterial> queryWrapper = new QueryWrapper<>();
+                queryWrapper.eq("product_id", entity.getProductId());
+                queryWrapper.eq("trade_name", tradeName);
+                queryWrapper.isNull("video_url").last("limit 1");
+                ProductMaterial one = this.getOne(queryWrapper);
+                if (Check.isNull(one)) {
+                    entity.setTradeName(tradeName);
+                    lists.add(entity);
+                }
+            }  else {
                 if (Check.isNull(signature) && Check.isNull(uploaderId)) {
                     List<String> urls = Arrays.asList(videoUrl.split(","));
                     for (String url : urls) {