Browse Source

添加批量操作事务

liguosong 3 years ago
parent
commit
659c162c0a

+ 3 - 0
abi-cloud-qr-platform-server/src/main/java/com/abi/qms/platform/service/impl/MaterialServiceImpl.java

@@ -23,6 +23,7 @@ import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 
 import java.util.*;
 
@@ -140,6 +141,7 @@ public class MaterialServiceImpl implements MaterialService {
      * 物料启用
      */
     @Override
+    @Transactional(rollbackFor = Exception.class)
     public void enableMaterial(EnableMaterialReq req){
         List<Long> ids = req.getIds();
 
@@ -163,6 +165,7 @@ public class MaterialServiceImpl implements MaterialService {
      * 物料禁用
      */
     @Override
+    @Transactional(rollbackFor = Exception.class)
     public void disableMaterial(DisableMaterialReq req){
         List<Long> ids = req.getIds();
 

+ 2 - 0
abi-cloud-qr-platform-server/src/main/java/com/abi/qms/platform/service/impl/QrBoxCodeFormatImpl.java

@@ -150,6 +150,7 @@ public class QrBoxCodeFormatImpl implements QrBoxCodeFormatService {
     }
 
     @Override
+    @Transactional(rollbackFor = Exception.class)
     public void enableBoxCodeFormat(EnableBoxCodeFormatReq req) {
 
         List<Long> ids = req.getIds();
@@ -170,6 +171,7 @@ public class QrBoxCodeFormatImpl implements QrBoxCodeFormatService {
     }
 
     @Override
+    @Transactional(rollbackFor = Exception.class)
     public void disableBoxCodeFormat(DisableBoxCodeFormatReq req) {
 
         List<Long> ids = req.getIds();