| | |
| | | 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;
|
| | |
| | |
|
| | | @Resource
|
| | | private UserMoneyMsgNotificationService userMoneyMsgNotificationService;
|
| | | |
| | | @Resource
|
| | | private RedPackForbidService redPackForbidService;
|
| | | |
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | | public void addOrder(BanLiShopOrder order) throws BanLiShopOrderException {
|
| | | // 查询必要的参数是否添加
|
| | |
| | | banLiShopOrderMapper.updateByPrimaryKeySelective(order);
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | | public void payOrderByHongBao(Long orderId) throws BanLiShopOrderException, RedPackBalanceException {
|
| | | BanLiShopOrder order = banLiShopOrderMapper.selectByPrimaryKeyForUpdate(orderId);
|
| | |
| | | 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, "红包余额不足");
|
| | | }
|