Skip to content

Commit

Permalink
优化监听事务提交发送mq事件,为订单变更发送mq增加事务提交监听
Browse files Browse the repository at this point in the history
  • Loading branch information
LeiGaoRobot committed Jun 22, 2022
1 parent ad1f5a2 commit f01236c
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,8 @@ public void systemComplete(String orderSn) {
* @param order 订单
* @param orderSn 订单编号
*/
private void complete(Order order, String orderSn) {//修改订单状态为完成
@Transactional(rollbackFor = Exception.class)
public void complete(Order order, String orderSn) {//修改订单状态为完成
this.updateStatus(orderSn, OrderStatusEnum.COMPLETED);

//修改订单货物可以进行评价
Expand Down Expand Up @@ -784,9 +785,10 @@ private void fictitiousPintuan(Map.Entry<String, List<Order>> entry, Integer req
/**
* 订单状态变更消息
*
* @param order
* @param order 订单信息
*/
private void orderStatusMessage(Order order) {
@Transactional(rollbackFor = Exception.class)
public void orderStatusMessage(Order order) {
OrderMessage orderMessage = new OrderMessage();
orderMessage.setOrderSn(order.getSn());
orderMessage.setNewStatus(OrderStatusEnum.valueOf(order.getOrderStatus()));
Expand Down Expand Up @@ -913,7 +915,8 @@ private void checkTradeDTO(TradeDTO tradeDTO) {
*
* @param orderSn 订单编号
*/
private void normalOrderConfirm(String orderSn) {
@Transactional(rollbackFor = Exception.class)
public void normalOrderConfirm(String orderSn) {
//修改订单
this.update(new LambdaUpdateWrapper<Order>()
.eq(Order::getSn, orderSn)
Expand All @@ -932,7 +935,8 @@ private void normalOrderConfirm(String orderSn) {
*
* @param orderSn 订单编号
*/
private void virtualOrderConfirm(String orderSn) {
@Transactional(rollbackFor = Exception.class)
public void virtualOrderConfirm(String orderSn) {
//修改订单
this.update(new LambdaUpdateWrapper<Order>()
.eq(Order::getSn, orderSn)
Expand Down

0 comments on commit f01236c

Please sign in to comment.