From 0cf8c0bf5649b0b7269f78f6eae7c09cffea75cd Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期二, 12 十一月 2019 16:01:22 +0800
Subject: [PATCH] 券退回消息处理

---
 fanli/src/main/java/com/yeshi/fanli/service/impl/brand/BrandGoodsCaheServiceImpl.java |   19 ++++++++++++++-----
 1 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/brand/BrandGoodsCaheServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/brand/BrandGoodsCaheServiceImpl.java
index 6153184..d6be2b0 100644
--- a/fanli/src/main/java/com/yeshi/fanli/service/impl/brand/BrandGoodsCaheServiceImpl.java
+++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/brand/BrandGoodsCaheServiceImpl.java
@@ -68,6 +68,10 @@
 	 * @return
 	 */
 	private int addBrandGoodsTB(BrandInfo brandInfo) {
+		String shopKey = brandInfo.getShopKey();
+		if (StringUtil.isNullOrEmpty(shopKey))
+			shopKey = brandInfo.getName();
+		
 		String searchKey = brandInfo.getSearchKey();
 		if (StringUtil.isNullOrEmpty(searchKey))
 			searchKey = brandInfo.getName();
@@ -94,8 +98,8 @@
 				// 娣诲姞搴楅摵
 				String shopTitle = goods.getShopTitle();
 				if (addShop && !StringUtil.isNullOrEmpty(shopTitle) && shopTitle.contains("鏃楄埌搴�") 
-						&& shopTitle.contains(brandInfo.getName())) {
-					addShop = brandShopCaheService.addBrandShopTB(brandInfo.getId(), goods.getAuctionId(),
+						&& shopTitle.toLowerCase().contains(shopKey.toLowerCase())) {
+					addShop = brandShopCaheService.addBrandShopTB(brandInfo, goods.getAuctionId(),
 							goods.getSellerId());
 				}
 				
@@ -129,6 +133,10 @@
 	 * @return
 	 */
 	private int addBrandGoodsJD(BrandInfo brandInfo) {
+		String shopKey = brandInfo.getShopKey();
+		if (StringUtil.isNullOrEmpty(shopKey))
+			shopKey = brandInfo.getName();
+		
 		String searchKey = brandInfo.getSearchKey();
 		if (StringUtil.isNullOrEmpty(searchKey))
 			searchKey = brandInfo.getName();
@@ -140,6 +148,8 @@
 		
 		// 鍒犻櫎搴楅摵
 	    brandShopCaheService.removeByDateAndType(brandInfo.getId(), 20, date);
+	    
+	    boolean addShop = true;
 	    
 		for (int i=0; i < 2;i ++) {
 			if ("1".equals(way)) {
@@ -162,7 +172,6 @@
 			}
 			
 			if (result != null && result.getGoodsList() != null && result.getGoodsList().size() > 0) {
-				boolean addShop = true;
 				List<JDGoods> goodsList = result.getGoodsList();
 				for (JDGoods goods : goodsList) {
 					BrandGoodsCahe brandGoods = new BrandGoodsCahe();
@@ -177,9 +186,9 @@
 					if (addShop && shopInfo != null) {
 						// 鍖呭惈璇ュ搧鐗屽悕绉�
 						String shopName = shopInfo.getShopName();
-						if (!StringUtil.isNullOrEmpty(shopName) && shopName.contains(brandInfo.getName())) {
-							brandShopCaheService.addBrandShopJD(brandInfo, shopInfo);
+						if (!StringUtil.isNullOrEmpty(shopName) && shopName.toLowerCase().contains(shopKey.toLowerCase())) {
 							addShop = false;
+							brandShopCaheService.addBrandShopJD(brandInfo, shopInfo);
 						}
 					}
 					

--
Gitblit v1.8.0