| | |
| | |
|
| | | @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);
|
| | |
| | | return banLiShopOrderMapper.selectByPrimaryKeyForUpdate(id);
|
| | | }
|
| | |
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | @Override
|
| | | public void invalidOrderByOrderId(Long id, String desc) {
|
| | | // 判断订单是否存在
|
| | |
| | | if (isS)// 支付成功,重新发送支付成功消息
|
| | | {
|
| | | BanLiShopOrderMQMsg msg = new BanLiShopOrderMQMsg(order.getId(), order.getUid());
|
| | | Message message =MQMsgBodyFactory.create(MQTopicName.TOPIC_ORDER,
|
| | | OrderTopicTagEnum.banLiShopOrderPaid,msg);
|
| | | Message message = MQMsgBodyFactory.create(MQTopicName.TOPIC_ORDER,
|
| | | OrderTopicTagEnum.banLiShopOrderPaid, msg);
|
| | | producer.send(message);
|
| | | return;
|
| | | }
|
| | |
| | | if (order.getState() != BanLiShopOrder.STATE_PAID)
|
| | | throw new BanLiShopOrderException(1, "订单未处于待审核状态");
|
| | |
|
| | | Message message =MQMsgBodyFactory.create(MQTopicName.TOPIC_ORDER, OrderTopicTagEnum.banLiShopOrderRefund,
|
| | | new BanLiShopOrderMQMsg(order.getId(), order.getUid()));
|
| | | Message message = MQMsgBodyFactory.create(MQTopicName.TOPIC_ORDER, OrderTopicTagEnum.banLiShopOrderRefund,
|
| | | new BanLiShopOrderMQMsg(order.getId(), order.getUid()));
|
| | | try {
|
| | | orderTransactionProducer.send(message, new LocalTransactionExecuter() {
|
| | | @Override
|
| | |
| | | throw new BanLiShopOrderException(22, "商品已下线");
|
| | | }
|
| | |
|
| | | if(redPackForbidService.verifyForbid(uid))
|
| | | if (redPackForbidService.verifyForbid(uid))
|
| | | throw new BanLiShopOrderException(25, "红包功能已被封禁");
|
| | | |
| | |
|
| | | if (pay.getHongBaoPrice() != null && pay.getHongBaoPrice().compareTo(new BigDecimal(0)) > 0) {
|
| | | BigDecimal money = redPackBalanceService.getBalance(uid);
|
| | | if (money.compareTo(pay.getHongBaoPrice()) < 0) {
|