From 972d3bc71115ec977dccf835fbcd148da3bcc86c Mon Sep 17 00:00:00 2001
From: yujian <yujian@123.com>
Date: 星期二, 03 九月 2019 16:41:49 +0800
Subject: [PATCH] 统计可用的免单券数量-countUsableFreeCouponForBuy

---
 fanli/src/main/java/com/yeshi/fanli/controller/client/v2/RecommendControllerV2.java |   17 +++++++----------
 1 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/RecommendControllerV2.java b/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/RecommendControllerV2.java
index 9b23458..9af3056 100644
--- a/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/RecommendControllerV2.java
+++ b/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/RecommendControllerV2.java
@@ -139,11 +139,6 @@
 			List<SwiperPicture> topPicList = new ArrayList<>();
 			if (oldtopPicList != null && oldtopPicList.size() > 0)
 				topPicList.addAll(oldtopPicList);
-			if ("ios".equalsIgnoreCase(acceptData.getPlatform())) {
-				SwiperPicture notifyReName = swiperPictureService.selectByPrimaryKey(162L);
-				if (notifyReName != null)
-					topPicList.add(0, notifyReName);
-			}
 
 			root.put("topPicList", JsonUtil.getApiCommonGson().toJson(topPicList));
 
@@ -195,23 +190,25 @@
 	}
 
 	private JSONObject getSpikeGoodsContent(AcceptData acceptData) {
-		List<String> dtoList =  DaTaoKeUtil.getDingDongQiangTime();
+		List<String> dtoList = DaTaoKeUtil.getDingDongQiangTime();
 		long nowTime = System.currentTimeMillis();
 		int dateNum = Integer.parseInt(TimeUtil.getGernalTime(nowTime, "ddHH"));
 		String timeStr = null;
 		int nextPos = 0;
-		for (int i = 0; i < dtoList.size(); i++) {
-			if (dateNum <= Integer.parseInt(dtoList.get(i))) {
+		for (int i = 0; i < dtoList.size() - 1; i++) {
+			if (dateNum >= Integer.parseInt(dtoList.get(i)) && dateNum < Integer.parseInt(dtoList.get(i + 1))) {
 				timeStr = dtoList.get(i);
 				nextPos = i + 1;
 				break;
 			}
 		}
+		if (timeStr == null)
+			timeStr = dtoList.get(dtoList.size() - 1);
 
 		long nextTime = nowTime + 1000 * 60 * 60L;// 榛樿涓�1灏忔椂
 		if (nextPos < dtoList.size()) {
-			nextTime = TimeUtil.convertToTimeTemp(TimeUtil.getGernalTime(nowTime, "MM") + dtoList.get(nextPos),
-					"MMddHH");
+			nextTime = TimeUtil.convertToTimeTemp(TimeUtil.getGernalTime(nowTime, "yyyyMM") + dtoList.get(nextPos),
+					"yyyyMMddHH");
 		}
 
 		JSONArray array = null;

--
Gitblit v1.8.0