yujian
2019-09-10 01597125df02b65ddef6489adde6642da8d85b47
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserSystemCouponServiceImpl.java
@@ -647,7 +647,44 @@
      return list;
   }
   @Override
   public long countUsableFreeCouponForBuy (Long uid) {
      if (uid == null)
         return 0;
      List<SystemCoupon> couponList = systemCouponService.getGoodsCouponList();
      if (couponList == null || couponList.size() == 0)
         return 0;
      List<Long> listCouponId = new ArrayList<Long>();
      for (SystemCoupon systemCoupon : couponList) {
         listCouponId.add(systemCoupon.getId());
      }
      return userSystemCouponMapper.countUsableByUid(uid, listCouponId);
   }
   @Override
   public long countUsableRewardCoupon (Long uid) {
      if (uid == null)
         return 0;
      List<SystemCoupon> couponList = systemCouponService.getOrderCouponList();
      if (couponList == null || couponList.size() == 0)
         return 0;
      List<Long> listCouponId = new ArrayList<Long>();
      for (SystemCoupon systemCoupon : couponList) {
         listCouponId.add(systemCoupon.getId());
      }
      return userSystemCouponMapper.countUsableByUid(uid, listCouponId);
   }
   @Transactional
   @Override
   public void useGoodsCoupon(Long uid, Long id, Long goodId, Integer sourceType) throws UserSystemCouponException, Exception {