去掉类上的事务注解
This commit is contained in:
@@ -37,7 +37,6 @@ import java.util.concurrent.TimeUnit;
|
||||
* @author ThinkGem
|
||||
* @version 2019-03-12
|
||||
*/
|
||||
@Transactional(readOnly=true)
|
||||
public class MsgInnerService extends CrudService<MsgInnerDao, MsgInner> {
|
||||
|
||||
@Autowired
|
||||
@@ -81,7 +80,7 @@ public class MsgInnerService extends CrudService<MsgInnerDao, MsgInner> {
|
||||
* @param msgInner
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly=false)
|
||||
@Transactional
|
||||
public void save(MsgInner msgInner) {
|
||||
if (msgInner.getIsNewRecord()){
|
||||
User user = msgInner.getCurrentUser();
|
||||
@@ -201,7 +200,7 @@ public class MsgInnerService extends CrudService<MsgInnerDao, MsgInner> {
|
||||
/**
|
||||
* 根据消息编号和接受者用户名读取内部消息
|
||||
*/
|
||||
@Transactional(readOnly=false)
|
||||
@Transactional
|
||||
public void readMsgInnerRecord(MsgInner msgInner){
|
||||
MsgInnerRecord msgInnerRecord = new MsgInnerRecord();
|
||||
msgInnerRecord.setMsgInnerId(msgInner.getId());
|
||||
@@ -219,7 +218,7 @@ public class MsgInnerService extends CrudService<MsgInnerDao, MsgInner> {
|
||||
* @param msgInner
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly=false)
|
||||
@Transactional
|
||||
public void updateStatus(MsgInner msgInner) {
|
||||
super.updateStatus(msgInner);
|
||||
}
|
||||
@@ -229,7 +228,7 @@ public class MsgInnerService extends CrudService<MsgInnerDao, MsgInner> {
|
||||
* @param msgInner
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly=false)
|
||||
@Transactional
|
||||
public void delete(MsgInner msgInner) {
|
||||
super.delete(msgInner);
|
||||
}
|
||||
|
||||
@@ -4,22 +4,20 @@
|
||||
*/
|
||||
package com.jeesite.modules.sys.service.support;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.jeesite.common.service.TreeService;
|
||||
import com.jeesite.modules.sys.dao.AreaDao;
|
||||
import com.jeesite.modules.sys.entity.Area;
|
||||
import com.jeesite.modules.sys.service.AreaService;
|
||||
import com.jeesite.modules.sys.utils.AreaUtils;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 行政区划Service
|
||||
* @author ThinkGem
|
||||
* @version 2014-8-19
|
||||
*/
|
||||
@Transactional(readOnly=true)
|
||||
public class AreaServiceSupport extends TreeService<AreaDao, Area>
|
||||
implements AreaService {
|
||||
|
||||
@@ -43,7 +41,7 @@ public class AreaServiceSupport extends TreeService<AreaDao, Area>
|
||||
* 保存区划
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly=false)
|
||||
@Transactional
|
||||
public void save(Area area) {
|
||||
super.save(area);
|
||||
AreaUtils.clearCache();
|
||||
@@ -53,7 +51,7 @@ public class AreaServiceSupport extends TreeService<AreaDao, Area>
|
||||
* 删除区划
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly=false)
|
||||
@Transactional
|
||||
public void delete(Area area) {
|
||||
super.delete(area);
|
||||
AreaUtils.clearCache();
|
||||
|
||||
@@ -24,7 +24,6 @@ import java.util.List;
|
||||
* @author ThinkGem
|
||||
* @version 2016-4-23
|
||||
*/
|
||||
@Transactional(readOnly=true)
|
||||
public class CompanyServiceSupport extends TreeService<CompanyDao, Company>
|
||||
implements CompanyService{
|
||||
|
||||
@@ -63,7 +62,7 @@ public class CompanyServiceSupport extends TreeService<CompanyDao, Company>
|
||||
* 保存公司
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly=false)
|
||||
@Transactional
|
||||
public void save(Company company) {
|
||||
if (company.getIsNewRecord()){
|
||||
// 生成主键,并验证改主键是否存在,如存在则抛出验证信息
|
||||
@@ -94,7 +93,7 @@ public class CompanyServiceSupport extends TreeService<CompanyDao, Company>
|
||||
* 删除公司
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly=false)
|
||||
@Transactional
|
||||
public void delete(Company company) {
|
||||
super.delete(company);
|
||||
// 清理公司相关缓存
|
||||
@@ -105,7 +104,7 @@ public class CompanyServiceSupport extends TreeService<CompanyDao, Company>
|
||||
* 停用当前节点
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly=false)
|
||||
@Transactional
|
||||
public void updateStatus(Company company) {
|
||||
dao.updateStatus(company);
|
||||
// 清理公司相关缓存
|
||||
|
||||
@@ -37,7 +37,6 @@ import java.util.List;
|
||||
* @author ThinkGem
|
||||
* @version 2017-03-25
|
||||
*/
|
||||
@Transactional(readOnly=true)
|
||||
public class EmpUserServiceSupport extends CrudService<EmpUserDao, EmpUser>
|
||||
implements EmpUserService{
|
||||
|
||||
@@ -121,7 +120,7 @@ public class EmpUserServiceSupport extends CrudService<EmpUserDao, EmpUser>
|
||||
* 保存用户员工
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly=false)
|
||||
@Transactional
|
||||
public void save(EmpUser user) {
|
||||
// 1、初始化用户信息
|
||||
if (user.getIsNewRecord()){
|
||||
@@ -171,7 +170,7 @@ public class EmpUserServiceSupport extends CrudService<EmpUserDao, EmpUser>
|
||||
* @param file 导入的用户数据文件
|
||||
* @param isUpdateSupport 是否更新支持,如果已存在,则进行更新数据
|
||||
*/
|
||||
@Transactional(readOnly=false)
|
||||
@Transactional
|
||||
public String importData(MultipartFile file, Boolean isUpdateSupport) {
|
||||
if (file == null){
|
||||
throw new ServiceException(text("请选择导入的数据文件!"));
|
||||
@@ -242,7 +241,7 @@ public class EmpUserServiceSupport extends CrudService<EmpUserDao, EmpUser>
|
||||
* 更新状态
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly=false)
|
||||
@Transactional
|
||||
public void updateStatus(EmpUser empUser) {
|
||||
userService.updateStatus(empUser);
|
||||
employeeService.updateStatus(empUser.getEmployee());
|
||||
@@ -252,7 +251,7 @@ public class EmpUserServiceSupport extends CrudService<EmpUserDao, EmpUser>
|
||||
* 删除用户
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly=false)
|
||||
@Transactional
|
||||
public void delete(EmpUser empUser) {
|
||||
userService.delete(empUser);
|
||||
employeeService.delete(empUser.getEmployee());
|
||||
|
||||
@@ -24,7 +24,6 @@ import java.util.List;
|
||||
* @author ThinkGem
|
||||
* @version 2017-03-25
|
||||
*/
|
||||
@Transactional(readOnly=true)
|
||||
public class EmployeeServiceSupport extends CrudService<EmployeeDao, Employee>
|
||||
implements EmployeeService{
|
||||
|
||||
@@ -63,7 +62,7 @@ public class EmployeeServiceSupport extends CrudService<EmployeeDao, Employee>
|
||||
* 保存数据(插入或更新)
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly=false)
|
||||
@Transactional
|
||||
public void save(Employee employee) {
|
||||
if (employee.getIsNewRecord()){
|
||||
if (dao.get(employee) != null){
|
||||
@@ -87,7 +86,7 @@ public class EmployeeServiceSupport extends CrudService<EmployeeDao, Employee>
|
||||
* 删除数据
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly=false)
|
||||
@Transactional
|
||||
public void delete(Employee employee) {
|
||||
super.delete(employee);
|
||||
}
|
||||
|
||||
@@ -18,7 +18,6 @@ import com.jeesite.modules.sys.service.LogService;
|
||||
* @author ThinkGem
|
||||
* @version 2014-05-16
|
||||
*/
|
||||
@Transactional(readOnly=true)
|
||||
public class LogServiceSupport extends CrudService<LogDao, Log>
|
||||
implements LogService{
|
||||
|
||||
@@ -44,7 +43,7 @@ public class LogServiceSupport extends CrudService<LogDao, Log>
|
||||
/**
|
||||
* 不使用数据库事务,执行插入日志
|
||||
*/
|
||||
@Transactional(readOnly=false)//, propagation=Propagation.NOT_SUPPORTED)
|
||||
@Transactional//(propagation = Propagation.NOT_SUPPORTED)
|
||||
public void insertLog(Log entity) {
|
||||
DataSourceHolder.setJdbcTransaction(false);
|
||||
dao.insert(entity);
|
||||
|
||||
@@ -29,7 +29,6 @@ import com.jeesite.modules.sys.utils.EmpUtils;
|
||||
* @author ThinkGem
|
||||
* @version 2016-4-23
|
||||
*/
|
||||
@Transactional(readOnly=true)
|
||||
public class OfficeServiceSupport extends TreeService<OfficeDao, Office>
|
||||
implements OfficeService{
|
||||
|
||||
@@ -65,7 +64,7 @@ public class OfficeServiceSupport extends TreeService<OfficeDao, Office>
|
||||
* 保存数据(插入或更新)
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly=false)
|
||||
@Transactional
|
||||
public void save(Office office) {
|
||||
if (office.getIsNewRecord()){
|
||||
// 生成主键,并验证改主键是否存在,如存在则抛出验证信息
|
||||
@@ -83,7 +82,7 @@ public class OfficeServiceSupport extends TreeService<OfficeDao, Office>
|
||||
* @param file 导入的机构数据文件
|
||||
* @param isUpdateSupport 是否更新支持,如果已存在,则进行更新数据
|
||||
*/
|
||||
@Transactional(readOnly=false)
|
||||
@Transactional
|
||||
public String importData(MultipartFile file, Boolean isUpdateSupport) {
|
||||
if (file == null){
|
||||
throw new ServiceException(text("请选择导入的数据文件!"));
|
||||
@@ -145,7 +144,7 @@ public class OfficeServiceSupport extends TreeService<OfficeDao, Office>
|
||||
* 更新部门状态
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly=false)
|
||||
@Transactional
|
||||
public void updateStatus(Office office) {
|
||||
super.updateStatus(office);
|
||||
// 清理部门相关缓存
|
||||
@@ -156,7 +155,7 @@ public class OfficeServiceSupport extends TreeService<OfficeDao, Office>
|
||||
* 删除数据
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly=false)
|
||||
@Transactional
|
||||
public void delete(Office office) {
|
||||
super.delete(office);
|
||||
// 清理部门相关缓存
|
||||
|
||||
@@ -21,7 +21,6 @@ import com.jeesite.modules.sys.utils.CorpUtils;
|
||||
* @author ThinkGem
|
||||
* @version 2017-03-25
|
||||
*/
|
||||
@Transactional(readOnly=true)
|
||||
public class PostServiceSupport extends CrudService<PostDao, Post>
|
||||
implements PostService{
|
||||
|
||||
@@ -54,7 +53,7 @@ public class PostServiceSupport extends CrudService<PostDao, Post>
|
||||
* 保存岗位
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly=false)
|
||||
@Transactional
|
||||
public void save(Post post) {
|
||||
if (post.getIsNewRecord()){
|
||||
// 生成主键,并验证改主键是否存在,如存在则抛出验证信息
|
||||
@@ -81,7 +80,7 @@ public class PostServiceSupport extends CrudService<PostDao, Post>
|
||||
* 更新岗位状态
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly=false)
|
||||
@Transactional
|
||||
public void updateStatus(Post post) {
|
||||
super.updateStatus(post);
|
||||
}
|
||||
@@ -90,7 +89,7 @@ public class PostServiceSupport extends CrudService<PostDao, Post>
|
||||
* 删除岗位
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly=false)
|
||||
@Transactional
|
||||
public void delete(Post post) {
|
||||
super.delete(post);
|
||||
}
|
||||
|
||||
@@ -40,7 +40,6 @@ import ${packageName}.${moduleName}.dao${isNotEmpty(subModuleName)?'.'+subModule
|
||||
* @version ${functionVersion}
|
||||
*/
|
||||
@Service
|
||||
@Transactional(readOnly=true)
|
||||
public class ${ClassName}Service extends ${table.isTreeEntity?'Tree':'Crud'}Service<${ClassName}Dao, ${ClassName}> {
|
||||
<% for (child in table.childList){ %>
|
||||
|
||||
@@ -110,7 +109,7 @@ public class ${ClassName}Service extends ${table.isTreeEntity?'Tree':'Crud'}Serv
|
||||
* @param ${className}
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly=false)
|
||||
@Transactional
|
||||
public void save(${ClassName} ${className}) {
|
||||
<% if(toBoolean(table.optionMap['isBpmForm'])){ %>
|
||||
// 如果未设置状态,则指定状态为审核状态,以提交审核流程
|
||||
@@ -187,7 +186,7 @@ public class ${ClassName}Service extends ${table.isTreeEntity?'Tree':'Crud'}Serv
|
||||
* @param ${className}
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly=false)
|
||||
@Transactional
|
||||
public void updateStatus(${ClassName} ${className}) {
|
||||
super.updateStatus(${className});
|
||||
}
|
||||
@@ -197,7 +196,7 @@ public class ${ClassName}Service extends ${table.isTreeEntity?'Tree':'Crud'}Serv
|
||||
* @param ${className}
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly=false)
|
||||
@Transactional
|
||||
public void delete(${ClassName} ${className}) {
|
||||
super.delete(${className});
|
||||
<% for (child in table.childList) { %>
|
||||
|
||||
@@ -45,7 +45,6 @@ import io.seata.spring.annotation.GlobalTransactional;
|
||||
*/
|
||||
@Service
|
||||
@RestController
|
||||
@Transactional(readOnly=true)
|
||||
public class ${ClassName}Service extends ${table.isTreeEntity?'Tree':'Crud'}Service<${ClassName}Dao, ${ClassName}>
|
||||
implements ${ClassName}ServiceApi {
|
||||
<% for (child in table.childList){ %>
|
||||
@@ -117,7 +116,7 @@ public class ${ClassName}Service extends ${table.isTreeEntity?'Tree':'Crud'}Serv
|
||||
*/
|
||||
@Override
|
||||
@GlobalTransactional
|
||||
@Transactional(readOnly=false)
|
||||
@Transactional
|
||||
public void save(${ClassName} ${className}) {
|
||||
<% if(toBoolean(table.optionMap['isBpmForm'])){ %>
|
||||
// 如果未设置状态,则指定状态为审核状态,以提交审核流程
|
||||
@@ -195,7 +194,7 @@ public class ${ClassName}Service extends ${table.isTreeEntity?'Tree':'Crud'}Serv
|
||||
*/
|
||||
@Override
|
||||
@GlobalTransactional
|
||||
@Transactional(readOnly=false)
|
||||
@Transactional
|
||||
public void updateStatus(${ClassName} ${className}) {
|
||||
super.updateStatus(${className});
|
||||
}
|
||||
@@ -206,7 +205,7 @@ public class ${ClassName}Service extends ${table.isTreeEntity?'Tree':'Crud'}Serv
|
||||
*/
|
||||
@Override
|
||||
@GlobalTransactional
|
||||
@Transactional(readOnly=false)
|
||||
@Transactional
|
||||
public void delete(${ClassName} ${className}) {
|
||||
super.delete(${className});
|
||||
<% for (child in table.childList) { %>
|
||||
|
||||
Reference in New Issue
Block a user