admin
2020-06-30 e40d1c22c7202aac843c66f9ee9cc000744f9e10
fanli/src/main/java/com/yeshi/fanli/service/impl/count/DailyCountCouponServiceImpl.java
@@ -12,6 +12,7 @@
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;
@@ -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) {