Browse Source

代码规范调整-事物回滚问题-120220116

mashengyi 2 năm trước cách đây
mục cha
commit
a636c5987b

+ 2 - 2
src/main/java/com/jkcredit/invoice/service/lowerservice/impl/NoCarServiceImpl.java

@@ -603,7 +603,7 @@ public class NoCarServiceImpl implements NoCarService {
     }
 
     @Override
-    @Transactional(isolation = Isolation.READ_COMMITTED)
+    @Transactional(isolation = Isolation.READ_COMMITTED,rollbackFor=Exception.class)
     public RespR getInvoiceByWayBillNumReal(NoCarWayBill noCarWayBill, boolean isInterface) {
         byte isKf = 1;
         /**
@@ -811,7 +811,7 @@ public class NoCarServiceImpl implements NoCarService {
     }
 
     @Override
-    @Transactional
+    @Transactional(rollbackFor=Exception.class)
     public RespR hcinvoiceupdate(HcInvoiceQueryVo hcInvoiceQueryVo) {
         log.info("取红冲票啦:NoCarServiceImpl.hCInvoiceQuery{}", hcInvoiceQueryVo);
         WaybillInvoiceRedQueryRequest redQueryRequest = new WaybillInvoiceRedQueryRequest();

+ 2 - 2
src/main/java/com/jkcredit/invoice/service/lowerservice/impl/SelfCarCustServiceImpl.java

@@ -70,7 +70,7 @@ public class SelfCarCustServiceImpl implements SelfCarCustService {
     CustomerChangeInfoMapper customerChangeInfoMapper;
 
     @Override
-    @Transactional(isolation = Isolation.READ_COMMITTED)
+    @Transactional(isolation = Isolation.READ_COMMITTED,rollbackFor=Exception.class)
     public RespR<List<CardTradeModel>> getTradeList(TradeRequestVo tradeRequestVo) {
         log.info("获取交易开始SelfCarServiceLImpl.getTradeList{}", tradeRequestVo);
         Customer customer = customerMapper.selectByCustomerName(tradeRequestVo.getCustomerName());
@@ -141,7 +141,7 @@ public class SelfCarCustServiceImpl implements SelfCarCustService {
     }
 
     @Override
-    @Transactional(isolation = Isolation.READ_COMMITTED)
+    @Transactional(isolation = Isolation.READ_COMMITTED,rollbackFor=Exception.class)
     public RespR<String> applInvoice(InvoiceApplVo invoiceApplVo) {
         log.info("申请开票开始SelfCarServiceLImpl.applInvoice{}", invoiceApplVo);
         if (!customerService.checkMoneyEnough(invoiceApplVo.getCustomerName())) {