打印机
This commit is contained in:
@@ -893,6 +893,22 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
|
|||||||
// 发放成长值
|
// 发放成长值
|
||||||
// 会员消费赠送成长值
|
// 会员消费赠送成长值
|
||||||
memberConfigService.deliver(orderInfo.getShopId(), orderInfo.getUserId(), TableValueConstant.MemberExpFlow.Type.RECHARGE, BigDecimal.valueOf(czgCallBackDto.getAmount()).divide(BigDecimal.valueOf(100)), null, orderInfo.getId());
|
memberConfigService.deliver(orderInfo.getShopId(), orderInfo.getUserId(), TableValueConstant.MemberExpFlow.Type.RECHARGE, BigDecimal.valueOf(czgCallBackDto.getAmount()).divide(BigDecimal.valueOf(100)), null, orderInfo.getId());
|
||||||
|
if (TransactionSynchronizationManager.isSynchronizationActive()) {
|
||||||
|
TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronization() {
|
||||||
|
@Override
|
||||||
|
public void afterCommit() {
|
||||||
|
// 事务成功提交后执行消息发送
|
||||||
|
String printParam = orderInfo.getId() + "_" + (!"after-pay".equals(orderInfo.getPayMode()) ? 1 : 0) + "_1";
|
||||||
|
rabbitPublisher.sendOrderPrintMsg(printParam, orderInfo.getIsPrint() == 1);
|
||||||
|
// log.info("订单{}事务提交后,发送打印消息", orderId);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
// 非事务环境下直接发送(兼容无事务场景)
|
||||||
|
String printParam = orderInfo.getId() + "_" + (!"after-pay".equals(orderInfo.getPayMode()) ? 1 : 0) + "_1";
|
||||||
|
rabbitPublisher.sendOrderPrintMsg(printParam, orderInfo.getIsPrint() == 1);
|
||||||
|
// log.info("非事务环境下,直接发送订单{}打印消息", orderId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user