From ffeb7a3de8d94a7977a21107adba7ea59abf63e3 Mon Sep 17 00:00:00 2001 From: hayu <1604366271@qq.com> Date: Mon, 1 Dec 2025 18:37:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gzgqj/business/bases/service/PartApplyServiceImpl.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/com/bonus/gzgqj/business/bases/service/PartApplyServiceImpl.java b/src/main/java/com/bonus/gzgqj/business/bases/service/PartApplyServiceImpl.java index b48ab47..1568d57 100644 --- a/src/main/java/com/bonus/gzgqj/business/bases/service/PartApplyServiceImpl.java +++ b/src/main/java/com/bonus/gzgqj/business/bases/service/PartApplyServiceImpl.java @@ -15,6 +15,8 @@ import com.bonus.gzgqj.manager.webResult.ServerResponse; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.transaction.interceptor.TransactionAspectSupport; import org.springframework.web.multipart.MultipartFile; import javax.servlet.http.HttpServletRequest; @@ -123,6 +125,7 @@ public class PartApplyServiceImpl implements PartApplyService { } @Override + @Transactional(rollbackFor = Exception.class) public ServerResponse partOutInByIds(PartApplyAppVo data) { try { String id = data.getId(); @@ -168,6 +171,7 @@ public class PartApplyServiceImpl implements PartApplyService { } catch (Exception e) { log.error(e.toString(), e); + TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); } return ServerResponse.createErroe("出库失败"); }