From 207dc8655711cddac2653e18b51e58a88dba2084 Mon Sep 17 00:00:00 2001
From: yj <Administrator@192>
Date: 星期五, 06 三月 2020 18:14:36 +0800
Subject: [PATCH] 发圈处理

---
 fanli/src/main/java/com/yeshi/fanli/job/QualityFactoryJob.java |  318 ++++++++++++++++++++--------------------------------
 1 files changed, 121 insertions(+), 197 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/job/QualityFactoryJob.java b/fanli/src/main/java/com/yeshi/fanli/job/QualityFactoryJob.java
index 33171dc..295010b 100644
--- a/fanli/src/main/java/com/yeshi/fanli/job/QualityFactoryJob.java
+++ b/fanli/src/main/java/com/yeshi/fanli/job/QualityFactoryJob.java
@@ -30,8 +30,6 @@
 import com.yeshi.fanli.util.taobao.TaoBaoUtil;
 import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
 
-import net.sf.json.JSONObject;
-
 /**
  * 绮鹃�夊晢鍝佽嚜鍔ㄥ叆搴�
  * 
@@ -69,63 +67,22 @@
 
 	public void searchGoods(JobExecutionContext context) {
 		try {
-
 			JobDataMap jobDataMap = context.getJobDetail().getJobDataMap();
-
-			BoutiqueAutoRule autoRule = new BoutiqueAutoRule();
-
-			/* 瑙勫垯id */
-			if (jobDataMap.get("ruleId") != null && !StringUtil.isNullOrEmpty(jobDataMap.get("ruleId").toString())) {
-				Long ruleId = Long.parseLong(jobDataMap.get("ruleId").toString());
-				autoRule.setId(ruleId);
+			Object object = jobDataMap.get("key");
+			if (object == null) {
+				return;
 			}
-
-			/* 绛涢�夋潯浠� */
-			JSONObject jsonData = null;
-			if (jobDataMap.get("searchContent") != null) {
-				String jsonContent = jobDataMap.get("searchContent").toString();
-				jsonData = JSONObject.fromObject(jsonContent);
-			}
-
-			if (jsonData == null) {
-				jsonData = new JSONObject();
-			}
-
-			/* 鏉ユ簮鍚嶇О */
-			if (jsonData.get("sourceCalss") != null
-					&& !StringUtil.isNullOrEmpty(jsonData.get("sourceCalss").toString())) {
-				String sourceCalss = jsonData.get("sourceCalss").toString();
-				autoRule.setSourceCalss(sourceCalss);
-			}
-
-			/* 瑙勫垯鍚嶇О */
-			String title = "";
-			if (jsonData.get("title") != null && !StringUtil.isNullOrEmpty(jsonData.get("title").toString())) {
-				title = jsonData.get("title").toString();
-			}
-			autoRule.setTitle(title);
-
-			/* 绯荤粺绫荤洰id */
-			String systemCid = "";
-			if (jsonData.get("systemCid") != null && !StringUtil.isNullOrEmpty(jsonData.get("systemCid").toString())) {
-				systemCid = jsonData.get("systemCid").toString();
-			}
-			autoRule.setSystemCid(systemCid);
-
+			
+			BoutiqueAutoRule autoRule = (BoutiqueAutoRule) object;
 			/* 鎿嶄綔浜猴細 寮�鍙戣处鍙� */
 			AdminUser admin = new AdminUser(2L);
 			autoRule.setAdminUser(admin);
-
+			
 			/* 鏍囩鍒楄〃 */
 			List<Label> listLabs = new ArrayList<Label>();
-
-			if (jsonData.get("lableNames") != null
-					&& !StringUtil.isNullOrEmpty(jsonData.get("lableNames").toString())) {
-
-				// 绌烘牸闅斿紑
-				String[] arrtitles = jsonData.get("lableNames").toString().split("\\s+");
-
-				// 鑾峰彇鏍囩灞炴��
+			String lableNames = autoRule.getLableNames();
+			if (!StringUtil.isNullOrEmpty(lableNames)) {
+				String[] arrtitles = lableNames.split("\\s+"); // 绌烘牸闅斿紑
 				for (String name : arrtitles) {
 					Label label = labelService.getByTitleCache("labKey", name.trim());
 					if (label == null) {
@@ -134,20 +91,13 @@
 					listLabs.add(label);
 				}
 			}
-
-			int source = Integer.parseInt(jobDataMap.get("source").toString());
-
-			autoRule.setSource(QualityFactory.SOURCE_TAOBAO);
-			// 1銆佹潵婧愭窐瀹濇櫘閫氭帴鍙�
-			if (BoutiqueAutoRule.TB_OPTIONAL == source) {
+			
+			if (BoutiqueAutoRule.TB_OPTIONAL == autoRule.getSource()) { // 1銆佹潵婧愭窐瀹濇櫘閫氭帴鍙�
 				autoRule.setGoodsSource(QualityFactory.SOURCE_TAOBAO);
-				searchTaoBao(jsonData, listLabs, autoRule);
-			}
-
-			// 2銆佹窐瀹濇帹鑽�
-			if (BoutiqueAutoRule.TB_MATERIAL == source) {
+				searchTaoBao(listLabs, autoRule);
+			} else if (BoutiqueAutoRule.TB_MATERIAL == autoRule.getSource()) { // 2銆佹窐瀹濇帹鑽�
 				autoRule.setGoodsSource(QualityFactory.SOURCE_TAOBAO_MATERIAL);
-				searchMaterial(jsonData, listLabs, autoRule);
+				searchMaterial(listLabs, autoRule);
 			}
 
 		} catch (Exception e) {
@@ -166,13 +116,9 @@
 	 * 
 	 * @param jobDataMap
 	 */
-	private void searchTaoBao(JSONObject jsonData, List<Label> listLabs, BoutiqueAutoRule autoRule) {
+	private void searchTaoBao(List<Label> listLabs, BoutiqueAutoRule autoRule) {
 		try {
 			String formatDate = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss").format(new Date());
-
-			// 椤靛ぇ灏忥紝榛樿100鏉�
-			int pageSize = 100;
-
 			boolean isCrawl = true;
 			// 鏉冮噸璧峰
 			int startWeight = 0;
@@ -189,14 +135,13 @@
 
 			// 鏈�澶氱埇鍙栭〉鐮�
 			int pageMax = 200;
-			if (jsonData.get("maxPage") != null) {
-				pageMax = Integer.parseInt(jsonData.get("maxPage").toString());
+			if (autoRule.getMaxPage() != null) {
+				pageMax = autoRule.getMaxPage();
 			}
 
 			/* 鍙傛暟澶勭悊 */
-			SearchFilter filter = getSearchFilter(jsonData);
-			// 灞曠ず鏉$洰
-			filter.setPageSize(pageSize);
+			SearchFilter filter = getSearchFilter(autoRule);
+			filter.setPageSize(100);
 
 			for (int page = 1; page <= pageMax; page++) {
 				filter.setPage(page);
@@ -228,25 +173,22 @@
 				autoRule.setEndWeight(endWeight);
 
 				// 绛涢�夊叆搴�
-				screen(listGoods, jsonData, filter, listLabs, autoRule);
-
-				
+				screen(listGoods, filter, listLabs, autoRule);
 				
 				/* 閿�鍞噺灏忓�� */
 				int minSales = 0;
-				if (jsonData.get("startSales") != null) {
-					minSales = (int) jsonData.get("startSales");
+				if (autoRule.getStartSales() != null) {
+					minSales = autoRule.getStartSales();
 				}
 
 				/* 閿�鍞噺澶у�� */
 				int maxSales = 0;
-				if (jsonData.get("endSales") != null) {
-					maxSales = (int) jsonData.get("endSales");
+				if (autoRule.getEndSales() != null) {
+					maxSales = autoRule.getEndSales();
 				}
 
 				// 閿�閲忔帶鍒�
 				for (TaoBaoGoodsBrief goodsBrief : listGoods) {
-
 					int biz30day = goodsBrief.getBiz30day();
 					/* 楠岃瘉閿�鍞噺 -- 缁撴潫鐖彇鏁版嵁 */
 					if (maxSales > 0 && minSales > 0 && (biz30day < minSales || biz30day > maxSales)) {
@@ -279,8 +221,8 @@
 			}
 
 			/* 鏇存柊瀹屾垚鍚庢竻鐞嗕箣鍓嶅垱寤虹殑鏁版嵁 */
-			if (jsonData.get("systemCid") != null && !StringUtil.isNullOrEmpty(jsonData.get("systemCid").toString())) {
-				Long systemCid = Long.parseLong(jsonData.get("systemCid").toString());
+			if (!StringUtil.isNullOrEmpty(autoRule.getSystemCid())) {
+				Long systemCid = Long.parseLong(autoRule.getSystemCid());
 				qualityFactoryService.deleteNotUpdateGoods(systemCid, formatDate, autoRule.getGoodsSource());
 			}
 
@@ -299,7 +241,7 @@
 	 * 
 	 * @param jobDataMap
 	 */
-	private void searchMaterial(JSONObject jsonData, List<Label> listLabs, BoutiqueAutoRule autoRule) {
+	private void searchMaterial(List<Label> listLabs, BoutiqueAutoRule autoRule) {
 
 		try {
 			String formatDate = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss").format(new Date());
@@ -324,12 +266,11 @@
 
 			// 鏈�澶氱埇鍙栭〉鐮�
 			int pageMax = 200;
-			if (jsonData.get("maxPage") != null) {
-				pageMax = Integer.parseInt(jsonData.get("maxPage").toString());
-			}
+			if (autoRule.getMaxPage() != null)
+				pageMax = autoRule.getMaxPage();
 
 			/* 鍙傛暟澶勭悊 */
-			SearchFilter filter = getSearchFilter(jsonData);
+			SearchFilter filter = getSearchFilter(autoRule);
 
 			for (int page = 1; page <= pageMax; page++) {
 
@@ -356,7 +297,7 @@
 				}
 
 				// 绛涢�夊叆搴�
-				screen(listGoods, jsonData, filter, listLabs, autoRule);
+				screen(listGoods, filter, listLabs, autoRule);
 				
 
 				// 鎬婚〉鏁扮埇鍙栧畬鎴�
@@ -380,8 +321,8 @@
 			}
 
 			/* 鏇存柊瀹屾垚鍚庢竻鐞嗕箣鍓嶅垱寤虹殑鏁版嵁 */
-			if (jsonData.get("systemCid") != null && !StringUtil.isNullOrEmpty(jsonData.get("systemCid").toString())) {
-				Long systemCid = Long.parseLong(jsonData.get("systemCid").toString());
+			if (!StringUtil.isNullOrEmpty(autoRule.getSystemCid())) {
+				Long systemCid = Long.parseLong(autoRule.getSystemCid());
 				qualityFactoryService.deleteNotUpdateGoods(systemCid, formatDate, autoRule.getGoodsSource());
 			}
 
@@ -401,93 +342,79 @@
 	 * @param jobDataMap
 	 * @return
 	 */
-	public SearchFilter getSearchFilter(JSONObject jsonData) {
+	public SearchFilter getSearchFilter(BoutiqueAutoRule autoRule) {
 		SearchFilter filter = new SearchFilter();
-
 		// 鎺掑簭瀛楁 閿�閲忛珮鍒颁綆(榛樿)
 		filter.setSort(TaoBaoUtil.SORT_SALE_HIGH_TO_LOW);
+		// 鎼滅储鍏抽敭璇�
+		filter.setKey(autoRule.getKey());
+		// 瀹樻柟鎺ㄨ崘鍟嗗搧搴撴姇鏀綢D;娣樺疂绫荤洰id闆嗗悎
+		filter.setCateIds(autoRule.getCateIds());
 
-		if (jsonData.get("key") != null) {
-			String key = jsonData.get("key").toString();
-			if (!StringUtil.isNullOrEmpty(key)) {
-				// 鎼滅储鍏抽敭璇�
-				filter.setKey(key);
-			}
+		// 鍦ㄥ敭浠疯寖鍥村皬鍊�
+		if (autoRule.getStartZkPrice() != null) {
+			filter.setStartPrice(new BigDecimal(autoRule.getStartPrice()));
 		}
 
-		if (jsonData.get("cateIds") != null) {
-			// 瀹樻柟鎺ㄨ崘鍟嗗搧搴撴姇鏀綢D;娣樺疂绫荤洰id闆嗗悎
-			filter.setCateIds(jsonData.get("cateIds").toString());
+		// 鍦ㄥ敭浠疯寖鍥村ぇ鍊�
+		if (autoRule.getEndZkPrice() != null) {
+			filter.setEndPrice(new BigDecimal(autoRule.getEndZkPrice()));
 		}
 
-		if (jsonData.get("startZkPrice") != null) {
-			// 鍦ㄥ敭浠疯寖鍥村皬鍊�
-			Double startZkPrice = Double.valueOf(jsonData.get("startZkPrice").toString());
-			filter.setStartPrice(new BigDecimal(startZkPrice));
-		}
-
-		if (jsonData.get("endZkPrice") != null) {
-			// 鍦ㄥ敭浠疯寖鍥村ぇ鍊�
-			Double endZxPrice = Double.valueOf(jsonData.get("endZkPrice").toString());
-			filter.setEndPrice(new BigDecimal(endZxPrice));
-		}
-
-		if (jsonData.get("startTkRate") != null) {
-			// 浣i噾鑼冨洿灏忓��
-			BigDecimal b = new BigDecimal(jsonData.get("startTkRate").toString());
+		// 浣i噾鑼冨洿灏忓��
+		if (autoRule.getStartTkRate() != null) {
+			BigDecimal b = new BigDecimal(autoRule.getStartTkRate());
 			double df = b.setScale(2, BigDecimal.ROUND_FLOOR).doubleValue();
 			int tkRate = (int) (df * 100);
 			filter.setStartTkRate(tkRate);
 		}
 
-		if (jsonData.get("endTkRate") != null) {
-			// 浣i噾鑼冨洿澶у��
-			BigDecimal b = new BigDecimal(jsonData.get("endTkRate").toString());
+		// 浣i噾鑼冨洿澶у��
+		if (autoRule.getEndTkRate() != null) {
+			BigDecimal b = new BigDecimal(autoRule.getEndTkRate());
 			double df = b.setScale(2, BigDecimal.ROUND_FLOOR).doubleValue();
 			int tkRate = (int) (df * 100);
 			filter.setEndTkRate(tkRate);
 		}
 
-		if (jsonData.get("isTmall") != null && jsonData.get("isTmall").toString().equals("1")) {
-			// 鏄惁澶╃尗if ("1".equals(isTmall)) {
+		// 鏄惁澶╃尗
+		if (autoRule.getIsTmall() != null  && autoRule.getIsTmall() == 1) {
 			filter.setTmall(true);
 		}
-
-		if (jsonData.get("hasCoupon") != null && jsonData.get("hasCoupon").toString().equals("1")) {
-			// 鏄惁鏈夊埜锛�1 鏈� 0 鏃�
+		
+		// 鏄惁鏈夊埜锛�1 鏈� 0 鏃�
+		if (autoRule.getHasCoupon() != null  && autoRule.getHasCoupon() == 1) {
 			filter.setQuan(1);
 		}
-
-		if (jsonData.get("freeShipment") != null && jsonData.get("freeShipment").toString().equals("1")) {
-			// 鏄惁鍖呴偖锛�1 鏈� 0 鏃�
+		
+		// 鏄惁鍖呴偖锛�1 鏈� 0 鏃�
+		if (autoRule.getFreeShipment() != null  && autoRule.getFreeShipment() == 1) {
 			filter.setBaoYou(true);
-			// ip鍦板潃
-			// filter.setIp("113.251.22.10");// 閲嶅簡
 			filter.setIp("218.72.111.105");// 鏉窞
 		}
-
-		if (jsonData.get("needPrepay") != null && jsonData.get("needPrepay").toString().equals("1")) {
-			// 鏄惁娑堣垂淇濋殰锛�1鏈� 0 鏃�
+		
+		// 鏄惁娑堣垂淇濋殰锛�1鏈� 0 鏃�
+		if (autoRule.getNeedPrepay() != null  && autoRule.getNeedPrepay() == 1) {
 			filter.setNeedPrepay(true);
 		}
 
-		if (jsonData.get("npxLevel") != null) {
-			// 鐗涚毊鐧g▼搴︼紝鍙栧�硷細1:涓嶉檺锛�2:鏃狅紝3:杞诲井
-			filter.setNpxLevel((int) jsonData.get("npxLevel"));
+		// 鐗涚毊鐧g▼搴︼紝鍙栧�硷細1:涓嶉檺锛�2:鏃狅紝3:杞诲井
+		if (autoRule.getNpxLevel() != null  && autoRule.getNpxLevel() == 1) {
+			filter.setNpxLevel(autoRule.getNpxLevel());
 		}
-
-		if (jsonData.get("includePayRate30") != null && jsonData.get("includePayRate30").toString().equals("1")) {
-			// 鎴愪氦杞寲鏄惁楂樹簬琛屼笟鍧囧��
+		
+		// 鎴愪氦杞寲鏄惁楂樹簬琛屼笟鍧囧��
+		if (autoRule.getIncludePayRate30() != null  && autoRule.getIncludePayRate30() == 1) {
 			filter.setIncludePayRate30(true);
 		}
 
-		if (jsonData.get("includeGoodRate") != null && jsonData.get("includeGoodRate").toString().equals("1")) {
-			// 濂借瘎鐜囨槸鍚﹂珮浜庤涓氬潎鍊� 1 鏈� 0 鏃�
+		// 濂借瘎鐜囨槸鍚﹂珮浜庤涓氬潎鍊� 1 鏈� 0 鏃�
+		if (autoRule.getIncludeGoodRate() != null  && autoRule.getIncludeGoodRate() == 1) {
 			filter.setIncludeGoodRate(true);
 		}
 
-		if (jsonData.get("includeRfdRate") != null && jsonData.get("includeRfdRate").toString().equals("1")) {
-			// 閫�娆剧巼鏄惁浣庝簬琛屼笟鍧囧�� 1 鏈� 0 鏃�
+		// 閫�娆剧巼鏄惁浣庝簬琛屼笟鍧囧�� 1 鏈� 0 鏃�
+		if (autoRule.getIncludeRfdRate() != null  && autoRule.getIncludeRfdRate() == 1) {
 			filter.setIncludeRfdRate(true);
 		}
 		return filter;
@@ -505,16 +432,21 @@
 	 * @param autoRule
 	 * @throws Exception
 	 */
-	public void screen(List<TaoBaoGoodsBrief> taoBaoGoodsBriefs, JSONObject jsonData, SearchFilter filter,
-			List<Label> listLabs, BoutiqueAutoRule autoRule) throws Exception {
-		List<TaoBaoGoodsBrief> listGoods = new ArrayList<TaoBaoGoodsBrief>();
-		for (TaoBaoGoodsBrief goodsBrief : taoBaoGoodsBriefs) {
-			// 楠岃瘉鏄惁绗﹀悎瑕佹眰
-			if (validate(filter, jsonData, goodsBrief, 1)) {
-				listGoods.add(goodsBrief);
+	public void screen(List<TaoBaoGoodsBrief> taoBaoGoodsBriefs, SearchFilter filter,
+			List<Label> listLabs, BoutiqueAutoRule autoRule)  {
+		try {
+			List<TaoBaoGoodsBrief> listGoods = new ArrayList<TaoBaoGoodsBrief>();
+			for (TaoBaoGoodsBrief goodsBrief : taoBaoGoodsBriefs) {
+				// 楠岃瘉鏄惁绗﹀悎瑕佹眰
+				if (validate(filter, autoRule, goodsBrief, 1)) {
+					listGoods.add(goodsBrief);
+				}
 			}
+			qualityFactoryService.autoInsertOrUpadateStorage(autoRule, listGoods, listLabs);
+		} catch (Exception e) {
+			LogHelper.errorDetailInfo(e);
 		}
-		qualityFactoryService.autoInsertOrUpadateStorage(autoRule, listGoods, listLabs);
+		
 	}
 
 	/**
@@ -522,38 +454,34 @@
 	 * 
 	 * @return
 	 */
-	public boolean validate(SearchFilter filter, JSONObject jsonData, TaoBaoGoodsBrief goodsBrief, int source) {
-		/* 閿�鍞噺灏忓�� */
+	public boolean validate(SearchFilter filter, BoutiqueAutoRule autoRule, TaoBaoGoodsBrief goodsBrief, int source) {
 		int minSales = 0;
-		if (jsonData.get("startSales") != null) {
-			minSales = (int) jsonData.get("startSales");
-		}
+		if (autoRule.getStartSales() != null)
+			minSales = autoRule.getStartSales();
 
-		/* 閿�鍞噺澶у�� */
 		int maxSales = 0;
-		if (jsonData.get("endSales") != null) {
-			maxSales = (int) jsonData.get("endSales");
-		}
-
-		int biz30day = goodsBrief.getBiz30day();
+		if (autoRule.getEndSales() != null)
+			maxSales = autoRule.getEndSales();
 
 		/* 楠岃瘉閿�鍞噺 */
-		if (maxSales > 0 && minSales > 0 && (biz30day < minSales || biz30day > maxSales)) {
-			return false;
-		} else if (maxSales > 0 && biz30day > maxSales) {
-			return false;
-		} else if (minSales > 0 && biz30day < minSales) {
-			return false;
+		if (maxSales == 0 && minSales ==0) {
+			
+		} else {
+			int biz30day = goodsBrief.getBiz30day();
+			if (maxSales > 0 && minSales > 0 && (biz30day < minSales || biz30day > maxSales)) {
+				return false;
+			} else if (maxSales > 0 && biz30day > maxSales) {
+				return false;
+			} else if (minSales > 0 && biz30day < minSales) {
+				return false;
+			}
 		}
 
 		/* 楠岃瘉姣斾緥 */
 		if (BoutiqueAutoRule.TB_MATERIAL == source) {
-
 			int startTkRate = filter.getStartTkRate();
 			int endTkRate = filter.getEndTkRate();
-
 			BigDecimal tkRate = goodsBrief.getTkRate();
-
 			if (startTkRate > 0 && endTkRate > 0 && (tkRate.compareTo(new BigDecimal(startTkRate / 100)) < 0
 					|| tkRate.compareTo(new BigDecimal(endTkRate / 100)) > 0)) {
 				return false;
@@ -566,37 +494,33 @@
 
 		/* 鍒稿悗浠疯寖鍥翠笅闄� */
 		BigDecimal startPrice = null;
-		if (jsonData.get("startPrice") != null) {
-			startPrice = new BigDecimal(jsonData.get("startPrice").toString());
-		}
-
+		if (autoRule.getStartPrice() != null)
+			startPrice = new BigDecimal(autoRule.getStartPrice().toString());
 		/* 鍒稿悗浠疯寖鍥翠笂闄� */
 		BigDecimal endPrice = null;
-		if (jsonData.get("endPrice") != null) {
-			endPrice = new BigDecimal(jsonData.get("endPrice").toString());
-		}
+		if (autoRule.getEndPrice() != null)
+			endPrice = new BigDecimal(autoRule.getEndPrice().toString());
 
-		/* 鍒稿悗浠�--璁$畻 */
-		BigDecimal couponPrice = TaoBaoUtil.getAfterUseCouplePrice(goodsBrief);
-
-		/* 楠岃瘉鍦ㄥ埜鍚庝环 */
-		if (startPrice != null && endPrice != null
-				&& (couponPrice.compareTo(startPrice) < 0 || couponPrice.compareTo(endPrice) > 0)) {
-			return false;
-		} else if (endPrice != null && couponPrice.compareTo(endPrice) > 0) {
-			return false;
-		} else if (startPrice != null && couponPrice.compareTo(startPrice) < 0) {
-			return false;
-		}
-
-		/* 楠岃瘉鍦ㄦ槸鍚︽湁鍒� */
-		if (filter.getQuan() > 0) {
-			String couponInfo = goodsBrief.getCouponInfo();
-			if (StringUtil.isNullOrEmpty(couponInfo)) {
+		if (startPrice == null && endPrice == null) {
+			
+		} else {
+			BigDecimal couponPrice = TaoBaoUtil.getAfterUseCouplePrice(goodsBrief);
+			if (startPrice != null && endPrice != null
+					&& (couponPrice.compareTo(startPrice) < 0 || couponPrice.compareTo(endPrice) > 0)) {
+				return false;
+			} else if (endPrice != null && couponPrice.compareTo(endPrice) > 0) {
+				return false;
+			} else if (startPrice != null && couponPrice.compareTo(startPrice) < 0) {
 				return false;
 			}
 		}
-
+		
+		/* 楠岃瘉鍦ㄦ槸鍚︽湁鍒� */
+		if (filter.getQuan() > 0) {
+			String couponInfo = goodsBrief.getCouponInfo();
+			if (StringUtil.isNullOrEmpty(couponInfo))
+				return false;
+		}
 		return true;
 	}
 

--
Gitblit v1.8.0