| | |
| | | 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;
|
| | |
| | | * @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) {
|
| | |
| | | } 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);
|
| | |
| | | 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) {
|