From dc5be7d38446f70e6ff86df311119c32b41fe7f8 Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期六, 28 十一月 2020 16:37:05 +0800 Subject: [PATCH] 大淘客搜索接口升级 --- fanli/src/main/java/com/yeshi/fanli/service/impl/count/DailyCountCouponServiceImpl.java | 16 ++++++++++++++-- 1 files changed, 14 insertions(+), 2 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/count/DailyCountCouponServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/count/DailyCountCouponServiceImpl.java index 3d85b2a..b42b1dc 100644 --- a/fanli/src/main/java/com/yeshi/fanli/service/impl/count/DailyCountCouponServiceImpl.java +++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/count/DailyCountCouponServiceImpl.java @@ -12,11 +12,12 @@ import com.yeshi.fanli.dao.user.count.DailyCountCouponDao; import com.yeshi.fanli.entity.admin.count.DailyCountCoupon; import com.yeshi.fanli.entity.admin.count.DailyCountCoupon.DailyCountCouponEnum; +import com.yeshi.fanli.entity.bus.user.UserSystemCoupon; import com.yeshi.fanli.entity.system.SystemCoupon.CouponTypeEnum; import com.yeshi.fanli.service.inter.count.DailyCountCouponService; import com.yeshi.fanli.service.inter.count.UserSystemCouponCountService; import com.yeshi.fanli.util.StringUtil; -import com.yeshi.fanli.util.TimeUtil; +import org.yeshi.utils.TimeUtil; @Service public class DailyCountCouponServiceImpl implements DailyCountCouponService { @@ -89,7 +90,8 @@ * @param typeEnum * @throws Exception */ - private void initData(DailyCountCouponEnum typeEnum) throws Exception { + @Override + public void initData(DailyCountCouponEnum typeEnum) throws Exception { Date lastDate = null; DailyCountCoupon lastRecord = dailyCountCouponDao.getMaxDate(typeEnum); if (lastRecord != null) { @@ -97,6 +99,12 @@ } else { lastDate = TimeUtil.parse("2019-03-04"); } + + long min = DateUtil.dateDiffMin(lastDate, new Date()); + if (min <= 10) { // 10鍒嗛挓浠ュ唴涓嶇粺璁� + return; + } + Date today = new Date(); int betweenDays = DateUtil.daysBetween2(lastDate, today); @@ -143,6 +151,10 @@ total = userSystemCouponCountService.countCouponNumByDay(CouponTypeEnum.rebatePercentCoupon, preDay); } else if (DailyCountCouponEnum.rebateCouponMoney == typeEnum) { total = userSystemCouponCountService.countRebateMoneyByDay(preDay); + } else if (DailyCountCouponEnum.pullNewCouponNum == typeEnum) { + total = userSystemCouponCountService.countCouponNumByDay(CouponTypeEnum.freeCoupon, preDay, UserSystemCoupon.SOURCE_PULL_NEW); + } else if (DailyCountCouponEnum.pullNewCouponMoney == typeEnum) { + total = userSystemCouponCountService.countFreeMoneyByTypeAndDay(CouponTypeEnum.freeCoupon, preDay, UserSystemCoupon.SOURCE_PULL_NEW); } if (total == null) { -- Gitblit v1.8.0