打印机

This commit is contained in:
wangw 2025-09-30 18:47:56 +08:00
parent 1e5b4b3d5b
commit 612a2e6128
1 changed files with 16 additions and 0 deletions

View File

@ -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());
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);
}
}
}
}