发放券问题 事务嵌套
This commit is contained in:
@@ -1220,6 +1220,7 @@ public class OrderInfoCustomServiceImpl implements OrderInfoCustomService {
|
||||
* 其它支付为 tb_order_payment.id
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public void upOrderInfo(OrderInfo orderInfo, BigDecimal payAmount, LocalDateTime payTime, Long payOrderId, PayEnums payType) {
|
||||
OrderInfo upOrderInfo = new OrderInfo()
|
||||
.setId(orderInfo.getId())
|
||||
@@ -1247,10 +1248,10 @@ public class OrderInfoCustomServiceImpl implements OrderInfoCustomService {
|
||||
orderDetailService.updateOrderDetailStatus(orderInfo.getId(), OrderStatusEnums.DONE.getCode());
|
||||
|
||||
if (orderInfo.getUserId() != null) {
|
||||
exShopUserInfo(orderInfo);
|
||||
ThreadUtil.execAsync(() -> exShopUserInfo(orderInfo));
|
||||
}
|
||||
if (StrUtil.isNotBlank(orderInfo.getTableCode())) {
|
||||
exTable(orderInfo);
|
||||
ThreadUtil.execAsync(() -> exTable(orderInfo));
|
||||
}
|
||||
// 保存消息参数(避免闭包中引用的变量被修改)
|
||||
final Long orderId = orderInfo.getId();
|
||||
@@ -1279,7 +1280,7 @@ public class OrderInfoCustomServiceImpl implements OrderInfoCustomService {
|
||||
}
|
||||
|
||||
//订单回调后 跟用户相关的部分
|
||||
@Async
|
||||
// @Async
|
||||
public void exShopUserInfo(OrderInfo orderInfo) {
|
||||
ShopUser shopUser = shopUserService.getShopUserInfo(orderInfo.getShopId(), orderInfo.getUserId());
|
||||
if (shopUser == null) {
|
||||
@@ -1332,7 +1333,6 @@ public class OrderInfoCustomServiceImpl implements OrderInfoCustomService {
|
||||
}
|
||||
}
|
||||
|
||||
@Async
|
||||
public void exTable(OrderInfo orderInfo) {
|
||||
ShopTable table = shopTableService.getOneByTableCode(orderInfo.getShopId(), orderInfo.getTableCode());
|
||||
if (table != null) {
|
||||
|
||||
Reference in New Issue
Block a user