admin
2020-05-19 744594ef1a2f530fc3e86ea9dc48b62247f79420
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserSystemCouponServiceImpl.java
@@ -952,6 +952,7 @@
      }
      BigDecimal hongBao = orderVO.getHongBao();
      // 红包状态
      Integer hongBaoState = orderVO.getHongBaoState();
      // 红包类型
@@ -964,6 +965,11 @@
         if (order == null)
            throw new UserSystemCouponException(1, "该订单不存在");
         // 使用奖励券 金额额限制
         if (hongBao.compareTo(Constant.REWARD_COUPON_LIMIT_MONEY) > 0){
            throw new UserSystemCouponException(1, "该订单不能使用奖励券");
         }
         /* 奖金计算 以及相关红包信息处理 */
         // 转换成小数点
@@ -1060,7 +1066,22 @@
         couponRecord.setUpdateTime(date);
         userSystemCouponRecordService.insertSelective(couponRecord);
         // 消息推送
         int goodsCount = 0;
         String orderId = order.getOrderId();
         Integer orderType = order.getOrderType();
         List<CommonOrder> orderList = commonOrderService.listBySourceTypeAndOrderId(orderType, orderId);
         if (orderList != null && orderList.size() > 0) {
            for (CommonOrder co : orderList) {
               goodsCount += co.getCount();
            }
         }
         // 资金消息
         UserInfo userInfo = userInfoService.selectByPKey(uid);
         userMoneyMsgNotificationService.rewardCounponReceived(uid, orderId, orderType, goodsCount,
               money, userInfo.getMyHongBao(), order.getThirdCreateTime());
         // 券使用成功消息
         try {
            userOtherMsgNotificationService.rewardCouponEndMsg(uid, userSystemCoupon.getSource(), 1, "使用成功");
         } catch (Exception e) {
@@ -1549,7 +1570,7 @@
      if (couponType == CouponTypeEnum.freeCoupon.name()) {
         stateActivated = 0; //
      } else if (couponType == CouponTypeEnum.welfareFreeCoupon.name()
            && threeSaleSerivce.countSuccessFirstTeam(uid) <= 0) {
            && threeSaleSerivce.countFirstTeam(uid) <= 0) {
         stateActivated = 0; // 无下级队员 --待激活
      }