/**
  * 统计今日积分来源次数.
  *
  * @param userId
  * @param source
  * @return
  */
 public int countTodayInegralSource(Long userId, DcIntegralSourceEnums source) {
   DcIntegralCondition condition = new DcIntegralCondition();
   Date todayStart = DateUtils.trimDate(new Date(), Calendar.HOUR_OF_DAY);
   condition.setUserId(userId);
   condition.setSource(source.getValue());
   condition.setGmtCreateStart(todayStart);
   return dcUserIntegralDetailService.countIntegralDetails(condition);
 }
 /**
  * 是否有足够的积分
  *
  * @param userId
  * @param integralCount
  * @return
  */
 public boolean hasEnoughIntegral(long userId, DcIntegralSourceEnums source) {
   int integralCount = source.getAwardIntegral();
   if (integralCount >= 0) {
     return true;
   }
   DcUserDTO user = dcUserService.getUser(userId);
   int userIntegral = IntegerUtils.parseInt(user.getIntegralCount());
   if (userIntegral >= Math.abs(integralCount)) {
     return true;
   }
   return false;
 }