yujian
2020-01-18 f4a0f2acc63d7785eab108419a4e16f5f688cb95
fanli/src/main/java/com/yeshi/fanli/service/impl/shop/BanLiShopOrderServiceImpl.java
@@ -40,6 +40,7 @@
import com.yeshi.fanli.service.inter.money.msg.UserMoneyMsgNotificationService;
import com.yeshi.fanli.service.inter.mq.MQUnSendInfoService;
import com.yeshi.fanli.service.inter.redpack.RedPackBalanceService;
import com.yeshi.fanli.service.inter.redpack.RedPackForbidService;
import com.yeshi.fanli.service.inter.shop.BanLiShopGoodsClassService;
import com.yeshi.fanli.service.inter.shop.BanLiShopGoodsService;
import com.yeshi.fanli.service.inter.shop.BanLiShopGoodsSetPayService;
@@ -90,8 +91,12 @@
   @Resource
   private UserMoneyMsgNotificationService userMoneyMsgNotificationService;
   @Resource
   private RedPackForbidService redPackForbidService;
   @Transactional
   @Transactional(rollbackFor=Exception.class)
   @Override
   public void addOrder(BanLiShopOrder order) throws BanLiShopOrderException {
      // 查询必要的参数是否添加
@@ -219,7 +224,7 @@
      banLiShopOrderMapper.updateByPrimaryKeySelective(order);
   }
   @Transactional
   @Transactional(rollbackFor=Exception.class)
   @Override
   public void payOrderByHongBao(Long orderId) throws BanLiShopOrderException, RedPackBalanceException {
      BanLiShopOrder order = banLiShopOrderMapper.selectByPrimaryKeyForUpdate(orderId);
@@ -435,13 +440,11 @@
         throw new BanLiShopOrderException(22, "商品已下线");
      }
      if(redPackForbidService.verifyForbid(uid))
         throw new BanLiShopOrderException(25, "红包功能已被封禁");
      if (pay.getHongBaoPrice() != null && pay.getHongBaoPrice().compareTo(new BigDecimal(0)) > 0) {
         BigDecimal money = null;
         try {
            money = redPackBalanceService.getBalance(uid);
         } catch (RedPackBalanceException e) {
            throw new BanLiShopOrderException(25, "红包功能异常");
         }
         BigDecimal money = redPackBalanceService.getBalance(uid);
         if (money.compareTo(pay.getHongBaoPrice()) < 0) {
            throw new BanLiShopOrderException(24, "红包余额不足");
         }