admin
2020-01-01 c8f11c229b87d1652b6da0b15576c166cd51eb8b
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserSystemCouponServiceImpl.java
@@ -230,7 +230,7 @@
   }
   @Override
   @Transactional
   @Transactional(rollbackFor=Exception.class)
   public UserSystemCoupon insertUserCoupon(Long uid, String couponType, String source, BigDecimal percent,
         Boolean needNotify) throws UserSystemCouponException, Exception {
@@ -344,7 +344,7 @@
      return userCoupon;
   }
   @Transactional
   @Transactional(rollbackFor=Exception.class)
   @Override
   public List<UserSystemCouponVO> getUserCouponVOList(long start, int count, Long uid, boolean changeJump)
         throws UserSystemCouponException, Exception {
@@ -610,7 +610,7 @@
      return hasCoupon;
   }
   @Transactional
   @Transactional(rollbackFor=Exception.class)
   @Override
   public List<UserSystemCouponVO> getOrderCouponList(Long uid) throws UserSystemCouponException, Exception {
@@ -633,7 +633,7 @@
      return getEnableListByCouponId(uid, 1, couponList);
   }
   @Transactional
   @Transactional(rollbackFor=Exception.class)
   @Override
   public List<UserSystemCouponVO> getGoodsCouponList(Long uid, Long auctionId)
         throws UserSystemCouponException, Exception {
@@ -885,7 +885,7 @@
         throw new UserSystemCouponException(1, "该订单不能使用奖励券");
      
      long downOrderTime = thirdCreateTime.getTime();
      long limitDate = TimeUtil.parse(Constant.COUPON_REWARD_TIME).getTime();
      long limitDate = TimeUtil.convertDateToTemp(Constant.VIP_ONLINE_TIME);
      if (downOrderTime > limitDate) {
         boolean valid = false;
         Date endDay = DateUtil.plusDayDate(Constant.COUPON_REWARD_LIMIT_DAY, accountTime);
@@ -955,7 +955,7 @@
      }
   }
   @Transactional
   @Transactional(rollbackFor=Exception.class)
   public void useRewardCouponCore(UserSystemCoupon userSystemCoupon, BigDecimal money, BigDecimal hongBao, Long uid,
         Order order) throws Exception {
      org.springframework.transaction.TransactionStatus transactionStatus = transactionManager
@@ -1358,7 +1358,7 @@
      }
   }
   @Transactional
   @Transactional(rollbackFor=Exception.class)
   @Override
   public void updateStateByDrawback(String orderNo) throws Exception {
@@ -1380,7 +1380,7 @@
      sendBackCoupon(record.getUserSystemCoupon(), record);
   }
   @Transactional
   @Transactional(rollbackFor=Exception.class)
   @Override
   public void updateStateByArrivalAccount(String orderNo) throws Exception {
@@ -1414,7 +1414,7 @@
      return userSystemCouponMapper.getCounponNowInvalid(count);
   }
   @Transactional
   @Transactional(rollbackFor=Exception.class)
   @Override
   public boolean updateCouponRecordUsed(Long uid, String orderNo, BigDecimal payment, Long auctionId)
         throws Exception {
@@ -1494,7 +1494,7 @@
   }
   @Override
   @Transactional
   @Transactional(rollbackFor=Exception.class)
   public void copyLotteryPrize(Long uid, int platform, String device) throws Exception {
      return;
@@ -1577,7 +1577,7 @@
   }
   @Override
   @Transactional
   @Transactional(rollbackFor=Exception.class)
   public void randomRewardCoupon(int num, Long uid, String source) throws Exception {
      if (num < 1) {
         return;
@@ -1717,7 +1717,7 @@
   }
   @Override
   @Transactional
   @Transactional(rollbackFor=Exception.class)
   public void exchangeCoupon(Long uid, String couponType, String source, BigDecimal percent)
         throws UserSystemCouponException, Exception {
      if (couponType == null || uid == null) {
@@ -1773,7 +1773,7 @@
      insertSelective(userCoupon);
   }
   @Transactional
   @Transactional(rollbackFor=Exception.class)
   @Override
   public List<UserSystemCouponVO> getCouponList(AcceptData acceptData, long start, int count, Long uid)
         throws UserSystemCouponException, Exception {
@@ -2075,12 +2075,13 @@
      }
      Date nowDate = new Date();
      Date endTime = DateUtil.plusDayDate(Constant.GIVE_DAYS, nowDate);
      // 插入赠送记录
      UserSystemCouponGiveRecord giveRecord = new UserSystemCouponGiveRecord();
      giveRecord.setCouponId(id);
      giveRecord.setGiveUid(uid);
      giveRecord.setGiveTime(nowDate);
      giveRecord.setEndTime(DateUtil.plusDayDate(Constant.GIVE_DAYS, nowDate));
      giveRecord.setEndTime(endTime);
      userSystemCouponGiveRecordService.insertSelective(giveRecord);
      // 创建记录
@@ -2089,7 +2090,7 @@
      tokenRecord.setIdentify(giveRecord.getId() + "");
      tokenRecord.setType(tokenTypeEnum);
      tokenRecord.setStartTime(nowDate);
      tokenRecord.setEndTime(DateUtil.plusDayDate(Constant.TOKEN_DAYS, nowDate));
      tokenRecord.setEndTime(endTime);
      tokenRecord.setState(0);
      tokenRecordService.insertSelective(tokenRecord);
@@ -2125,6 +2126,8 @@
      msg.setUserSystemCouponId(id);
      msg.setCouponType(type.name());
      Message message = MQMsgBodyFactory.create(MQTopicName.TOPIC_USER, UserTopicTagEnum.systemCouponDrawback, msg);
      // 延迟一分钟
      message.setStartDeliverTime(endTime.getTime() + 1000 * 60);
      try {
         producer.send(message);
      } catch (Exception e) {
@@ -2317,7 +2320,7 @@
   }
   @Override
   @RequestSerializableByKeyService(key = "#id")
   @RequestSerializableByKeyService(key = "#couponId")
   @Transactional(rollbackFor = Exception.class)
   public void sendBackByGiveId(Long couponId) {
      if (couponId == null)