admin
2019-12-10 d3db196ed2fe8b6c3905ff111d665d9fc2c951a3
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserSystemCouponServiceImpl.java
@@ -183,8 +183,6 @@
   @Resource
   private UserVIPInfoService userVIPInfoService;
   @Override
   public int insertSelective(UserSystemCoupon record) {
      return userSystemCouponMapper.insertSelective(record);
@@ -837,6 +835,22 @@
      if (orderNo == null || orderNo.trim().length() == 0)
         throw new UserSystemCouponException(1, "订单号不存在");
      // 检查订单号是否维权
      List<CommonOrder> commonOrderList = commonOrderService.listBySourceTypeAndOrderId(sourceType, orderNo);
      boolean weiquan = false;
      if (commonOrderList != null) {
         for (CommonOrder commonOrder : commonOrderList) {
            if (commonOrder.getState() == CommonOrder.STATE_WQ) {
               weiquan = true;
               break;
            }
         }
      }
      if (weiquan) {
         throw new UserSystemCouponException(1, "亲,很遗憾,售后维权订单不能使用返利奖励券~");
      }
      // 订单
      CommonOrderVO orderVO = commonOrderService.getCommonOrderByOrderNo(uid, orderNo, CommonOrder.STATE_JS,
            sourceType);
@@ -900,8 +914,7 @@
         UserSystemCouponUseMQMsg mqMsg = new UserSystemCouponUseMQMsg(userSystemCoupon.getId(), order.getOrderId(),
               sourceType, systemCoupon.getType().name());
         // 事务消息
         Message msg =MQMsgBodyFactory.create(MQTopicName.TOPIC_USER, UserTopicTagEnum.useSystemCoupon,
               mqMsg);
         Message msg = MQMsgBodyFactory.create(MQTopicName.TOPIC_USER, UserTopicTagEnum.useSystemCoupon, mqMsg);
         try {
            SendResult result = orderTransactionProducer.send(msg, new LocalTransactionExecuter() {
               @Override
@@ -2088,8 +2101,7 @@
      UserSystemCouponUseMQMsg msg = new UserSystemCouponUseMQMsg();
      msg.setUserSystemCouponId(id);
      msg.setCouponType(type.name());
      Message message = MQMsgBodyFactory.create(MQTopicName.TOPIC_USER, UserTopicTagEnum.systemCouponDrawback,
            msg);
      Message message = MQMsgBodyFactory.create(MQTopicName.TOPIC_USER, UserTopicTagEnum.systemCouponDrawback, msg);
      try {
         producer.send(message);
      } catch (Exception e) {
@@ -2281,7 +2293,6 @@
      sendBackGiveCoupon(list);
   }
   @Override
   @RequestSerializableByKeyService(key = "#id")
   @Transactional(rollbackFor = Exception.class)
@@ -2312,7 +2323,6 @@
      
      // 口令失效
      tokenRecordService.invalidByCoupon(giveRecord.getId());
      Date now = new Date();
      Date endTime = userCoupon.getEndTime();
@@ -2367,7 +2377,6 @@
      msgOther.setReturnTime(sd.format(new Date()));
      userOtherMsgNotificationService.tokenGiveMsg(giveRecord.getGiveUid(), beiZhu, msgOther);
   }
   
   @Override
   public void sendBackGiveCoupon(List<UserSystemCouponGiveRecord> overdueList) {