|
@@ -109,10 +109,16 @@ public class ProductMaterialServiceImpl extends ServiceImpl<ProductMaterialMappe
|
|
String uploaderId = trade.getString("uploaderId");
|
|
String uploaderId = trade.getString("uploaderId");
|
|
int count = 0;
|
|
int count = 0;
|
|
if (Check.isNull(videoUrl)) {
|
|
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)) {
|
|
if (Check.isNull(signature) && Check.isNull(uploaderId)) {
|
|
List<String> urls = Arrays.asList(videoUrl.split(","));
|
|
List<String> urls = Arrays.asList(videoUrl.split(","));
|
|
for (String url : urls) {
|
|
for (String url : urls) {
|