From e031959940a80792a60e2d8b83499cd168fa83d6 Mon Sep 17 00:00:00 2001
From: puzhibing <393733352@qq.com>
Date: 星期四, 12 三月 2026 17:18:18 +0800
Subject: [PATCH] 修改事务注解
---
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/service/impl/XpCruisePlanServiceImpl.java | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/service/impl/XpCruisePlanServiceImpl.java b/xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/service/impl/XpCruisePlanServiceImpl.java
index cf628db..e7e5d2d 100644
--- a/xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/service/impl/XpCruisePlanServiceImpl.java
+++ b/xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/service/impl/XpCruisePlanServiceImpl.java
@@ -28,6 +28,8 @@
import com.xiaopeng.operation.vo.XpCruisePlanVehicleVO;
import lombok.RequiredArgsConstructor;
import org.apache.commons.lang3.StringUtils;
+import org.apache.shardingsphere.transaction.annotation.ShardingSphereTransactionType;
+import org.apache.shardingsphere.transaction.core.TransactionType;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -77,7 +79,8 @@
}
@Override
- @Transactional(rollbackFor = Exception.class)
+ @Transactional
+ @ShardingSphereTransactionType(TransactionType.BASE)
public void add(XpCruisePlanAddDTO dto) {
//1.校验巡游计划名称
validatePlanName(dto.getPlanName(), null);
@@ -105,7 +108,8 @@
}
@Override
- @Transactional(rollbackFor = Exception.class)
+ @Transactional
+ @ShardingSphereTransactionType(TransactionType.BASE)
public void edit(XpCruisePlanEditDTO dto) {
if (dto.getId() == null) {
throw new ServiceException("巡游计划ID不能为空", I18nKeyConstant.CRUISE_PLAN_ID_EMPTY);
@@ -142,7 +146,8 @@
}
@Override
- @Transactional(rollbackFor = Exception.class)
+ @Transactional
+ @ShardingSphereTransactionType(TransactionType.BASE)
public void deleteById(Long id) {
xpCruisePlanPointService.lambdaUpdate()
.eq(XpCruisePlanPoint::getCruisePlanId, id)
--
Gitblit v1.7.1