From fe879975a3e8a0a1aa280fb839e02d159bfbcff8 Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期二, 27 八月 2019 18:04:38 +0800
Subject: [PATCH] 金币任务多次获取bug修改

---
 fanli/src/main/java/com/yeshi/fanli/service/impl/integral/IntegralTaskRecordServiceImpl.java |   20 +++++++++++++++-----
 1 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/integral/IntegralTaskRecordServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/integral/IntegralTaskRecordServiceImpl.java
index 2fcb36b..9b4a6ab 100644
--- a/fanli/src/main/java/com/yeshi/fanli/service/impl/integral/IntegralTaskRecordServiceImpl.java
+++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/integral/IntegralTaskRecordServiceImpl.java
@@ -304,11 +304,16 @@
 
 	@Override
 	public int countGetCountByTaskIdAndDay(Long taskId, Long uid, Date day) {
-		if (day == null)
-			return 0;
-		Date minTime = new Date(
-				TimeUtil.convertToTimeTemp(TimeUtil.getGernalTime(day.getTime(), "yyyy-MM-dd"), "yyyy-MM-dd"));
-		Date maxTime = new Date(minTime.getTime() + 1000 * 60 * 60 * 24L);
+		Date minTime = null;
+		Date maxTime = null;
+		if (day == null) {
+			minTime = new Date(TimeUtil.convertToTimeTemp("1970-01-01", "yyyy-MM-dd"));
+			maxTime = new Date(TimeUtil.convertToTimeTemp("2100-01-01", "yyyy-MM-dd"));
+		} else {
+			minTime = new Date(
+					TimeUtil.convertToTimeTemp(TimeUtil.getGernalTime(day.getTime(), "yyyy-MM-dd"), "yyyy-MM-dd"));
+			maxTime = new Date(minTime.getTime() + 1000 * 60 * 60 * 24L);
+		}
 		return integralTaskRecordMapper.countGetCountByTaskIdAndDay(taskId, uid, minTime, maxTime);
 	}
 
@@ -341,4 +346,9 @@
 	public long countByCidAndUidAndCreateTime(Long cid, Long uid, Date minTime, Date maxTime) {
 		return integralTaskRecordMapper.countByCidAndUidAndCreateTime(cid, uid, minTime, maxTime);
 	}
+
+	@Override
+	public List<IntegralTaskRecord> listByUidAndTaskId(Long uid, Long taskId, int page, int count) {
+		return integralTaskRecordMapper.listByUidAndTaskId(uid, taskId, (page - 1) * count, count);
+	}
 }

--
Gitblit v1.8.0