| | |
| | | BanLiShopOrder order = banLiShopOrderService.selectByPrimaryKeyForUpdate(orderId);
|
| | | if (order == null)
|
| | | throw new BanLiShopOrderException(1, "订单不存在");
|
| | | if (order.getState() != BanLiShopOrder.STATE_REJECT)
|
| | | if (order.getState() == BanLiShopOrder.STATE_REJECT_REFUND_FAIL
|
| | | || order.getState() == BanLiShopOrder.STATE_REJECT_REFUND_SUCCESS)
|
| | | throw new BanLiShopOrderException(2, "订单未被拒绝/订单已退款");
|
| | |
|
| | | BanLiShopOrder update = new BanLiShopOrder();
|
| | |
| | | BanLiShopOrderMQMsg msg = new BanLiShopOrderMQMsg(order.getId(), order.getUid());
|
| | | Message message = new Message(MQTopicName.TOPIC_ORDER.name(),
|
| | | OrderTopicTagEnum.banLiShopOrderRefund.name(), new Gson().toJson(msg).getBytes());
|
| | | message.setStartDeliverTime(System.currentTimeMillis() + 1000 * 60 * 60 * 24L);// 延时24小时通知检测微信退款状态
|
| | | message.setStartDeliverTime(System.currentTimeMillis() + 1000 * 60 *5L);// 延时24小时通知检测微信退款状态
|
| | | SendResult result = producer.send(message);
|
| | | if (result == null) {
|
| | | throw new BanLiShopOrderException(8, "消息发送失败");
|