From f4a0f2acc63d7785eab108419a4e16f5f688cb95 Mon Sep 17 00:00:00 2001 From: yujian <yujian@163.com> Date: 星期六, 18 一月 2020 12:06:27 +0800 Subject: [PATCH] 用户注册信息 --- fanli/src/main/java/com/yeshi/fanli/service/impl/shop/BanLiShopOrderServiceImpl.java | 19 +++++++++++-------- 1 files changed, 11 insertions(+), 8 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/shop/BanLiShopOrderServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/shop/BanLiShopOrderServiceImpl.java index 614fb40..162e62b 100644 --- a/fanli/src/main/java/com/yeshi/fanli/service/impl/shop/BanLiShopOrderServiceImpl.java +++ b/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, "绾㈠寘浣欓涓嶈冻"); } -- Gitblit v1.8.0