|
@@ -3,8 +3,12 @@ package com.sw.service.impl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.sw.dao.SysTestDao;
|
|
import com.sw.dao.SysTestDao;
|
|
import com.sw.domain.SysTest;
|
|
import com.sw.domain.SysTest;
|
|
|
|
+import com.sw.domain.SysTest2;
|
|
|
|
+import com.sw.service.SysTest2Service;
|
|
import com.sw.service.SysTestService;
|
|
import com.sw.service.SysTestService;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
+import org.springframework.transaction.annotation.Propagation;
|
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
|
|
|
|
@@ -18,6 +22,46 @@ import javax.annotation.Resource;
|
|
public class SysTestServiceImpl extends ServiceImpl<SysTestDao, SysTest> implements SysTestService {
|
|
public class SysTestServiceImpl extends ServiceImpl<SysTestDao, SysTest> implements SysTestService {
|
|
@Resource
|
|
@Resource
|
|
private SysTestDao sysTestDao;
|
|
private SysTestDao sysTestDao;
|
|
|
|
+ @Resource
|
|
|
|
+ private SysTest2Service sysTest2Service;
|
|
|
|
|
|
-
|
|
|
|
|
|
+ @Override
|
|
|
|
+ @Transactional(rollbackFor = Exception.class,propagation = Propagation.REQUIRED)
|
|
|
|
+ public void addTest10(SysTest sysTest,SysTest2 sysTest2) throws Exception {
|
|
|
|
+ sysTestDao.insert(sysTest);
|
|
|
|
+ sysTest2Service.addTest21(sysTest2);
|
|
|
|
+ }
|
|
|
|
+ @Override
|
|
|
|
+ @Transactional(rollbackFor = Exception.class,propagation = Propagation.REQUIRED)
|
|
|
|
+ public void addTest11(SysTest sysTest,SysTest2 sysTest2) throws Exception {
|
|
|
|
+ sysTestDao.insert(sysTest);
|
|
|
|
+ sysTest2Service.addTest20(sysTest2);
|
|
|
|
+ throw new Exception();
|
|
|
|
+ }
|
|
|
|
+ @Override
|
|
|
|
+ @Transactional(rollbackFor = Exception.class,propagation = Propagation.REQUIRED)
|
|
|
|
+ public void addTest12(SysTest sysTest,SysTest2 sysTest2) throws Exception {
|
|
|
|
+ sysTestDao.insert(sysTest);
|
|
|
|
+ sysTest2Service.addTest22(sysTest2);
|
|
|
|
+ throw new Exception();
|
|
|
|
+ }
|
|
|
|
+ @Override
|
|
|
|
+ @Transactional(rollbackFor = Exception.class,propagation = Propagation.REQUIRED)
|
|
|
|
+ public void addTest13(SysTest sysTest,SysTest2 sysTest2) throws Exception {
|
|
|
|
+ sysTestDao.insert(sysTest);
|
|
|
|
+ sysTest2Service.addTest23(sysTest2);
|
|
|
|
+ }
|
|
|
|
+ @Override
|
|
|
|
+ @Transactional(rollbackFor = Exception.class,propagation = Propagation.REQUIRED)
|
|
|
|
+ public void addTest14(SysTest sysTest,SysTest2 sysTest2) throws Exception {
|
|
|
|
+ sysTestDao.insert(sysTest);
|
|
|
|
+ sysTest2Service.addTest24(sysTest2);
|
|
|
|
+ throw new Exception();
|
|
|
|
+ }
|
|
|
|
+ @Override
|
|
|
|
+ @Transactional(rollbackFor = Exception.class,propagation = Propagation.REQUIRED)
|
|
|
|
+ public void addTest15(SysTest sysTest,SysTest2 sysTest2) throws Exception {
|
|
|
|
+ sysTestDao.insert(sysTest);
|
|
|
|
+ sysTest2Service.addTest25(sysTest2);
|
|
|
|
+ }
|
|
}
|
|
}
|