From f4e107e273e66c36e5f5c7b4a8a2f1b07b3c15ed Mon Sep 17 00:00:00 2001
From: admin <2780501319@qq.com>
Date: 星期三, 04 三月 2020 16:03:20 +0800
Subject: [PATCH] 拼多多转链修改
---
fanli/src/main/java/com/yeshi/fanli/service/impl/brand/BrandShopCaheServiceImpl.java | 24 +++++++++++++++++-------
1 files changed, 17 insertions(+), 7 deletions(-)
diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/brand/BrandShopCaheServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/brand/BrandShopCaheServiceImpl.java
index f8c3247..12a0345 100644
--- a/fanli/src/main/java/com/yeshi/fanli/service/impl/brand/BrandShopCaheServiceImpl.java
+++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/brand/BrandShopCaheServiceImpl.java
@@ -38,14 +38,17 @@
* @return
*/
@Override
- public boolean addBrandShopTB(Long brandId, Long auctionId, Long sellerId) {
+ public boolean addBrandShopTB(BrandInfo brandInfo, Long auctionId, Long sellerId) {
TaoBaoShop taoBaoShop = taoBaoShopService.getTaoBaoShop(auctionId, sellerId);
if (taoBaoShop == null)
return true;
+ ShopInfoVO shopInfoVO = ShopInfoVOFactory.convertTaoBaoShop(taoBaoShop);
+ shopInfoVO.setShopIcon(brandInfo.getIcon());
+
BrandShopCahe brandShop = new BrandShopCahe();
- brandShop.setBrandId(brandId);
- brandShop.setShop(ShopInfoVOFactory.convertTaoBaoShop(taoBaoShop));
+ brandShop.setBrandId(brandInfo.getId());
+ brandShop.setShop(shopInfoVO);
brandShop.setCreateTime(new Date());
brandShopCaheDao.insert(brandShop);
return false;
@@ -62,11 +65,12 @@
public void addBrandShopJD(BrandInfo brandInfo, JDShopInfo shopInfo) {
ShopInfoVO shopInfoVO = ShopInfoVOFactory.convertJDShop(shopInfo);
shopInfoVO.setShopIcon(brandInfo.getIcon());
+
BrandShopCahe brandShop = new BrandShopCahe();
brandShop.setBrandId(brandInfo.getId());
brandShop.setShop(shopInfoVO);
brandShop.setCreateTime(new Date());
- brandShopCaheDao.save(brandShop);
+ brandShopCaheDao.insert(brandShop);
}
@@ -76,8 +80,12 @@
* @return
*/
@Override
- public void addBrandShopPDD(BrandInfo brandInfo) {
- String searchKey = brandInfo.getSearchKey();
+ public int addBrandShopPDD(BrandInfo brandInfo) {
+ String shopKey = brandInfo.getShopKeyPDD();
+ if (StringUtil.isNullOrEmpty(shopKey))
+ return 0;
+
+ String searchKey = brandInfo.getSearchKeyPDD();
if (StringUtil.isNullOrEmpty(searchKey))
searchKey = brandInfo.getName();
@@ -96,7 +104,7 @@
for (PDDGoodsDetail goods : goodsList) {
// 鍖呭惈搴楅摵id 銆佸寘鍚搧鐗屽悕绉�
String mallName = goods.getMallName();
- if(addShop && !StringUtil.isNullOrEmpty(mallName) && mallName.contains(brandInfo.getName())
+ if(addShop && !StringUtil.isNullOrEmpty(mallName) && mallName.toLowerCase().contains(shopKey.toLowerCase())
&& goods.getMallId() != null){
shopInfoVO = new ShopInfoVO();
shopInfoVO.setId(goods.getMallId().toString());
@@ -116,7 +124,9 @@
brandShop.setShop(shopInfoVO);
brandShop.setCreateTime(new Date());
brandShopCaheDao.insert(brandShop);
+ return 1;
}
+ return 0;
}
--
Gitblit v1.8.0