去掉类上的事务注解
This commit is contained in:
@@ -4,19 +4,6 @@
|
||||
*/
|
||||
package com.jeesite.modules.cms.service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.LinkedBlockingQueue;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.jeesite.common.collect.ListUtils;
|
||||
import com.jeesite.common.config.Global;
|
||||
import com.jeesite.common.entity.Page;
|
||||
@@ -31,8 +18,19 @@ import com.jeesite.modules.cms.entity.Category;
|
||||
import com.jeesite.modules.cms.utils.CmsUtils;
|
||||
import com.jeesite.modules.file.utils.FileUploadUtils;
|
||||
import com.jeesite.modules.sys.utils.UserUtils;
|
||||
|
||||
import io.netty.util.concurrent.DefaultThreadFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.LinkedBlockingQueue;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* 文章表Service
|
||||
@@ -40,7 +38,6 @@ import io.netty.util.concurrent.DefaultThreadFactory;
|
||||
* @version 2020-7-24
|
||||
*/
|
||||
@Service
|
||||
@Transactional(readOnly = true)
|
||||
public class ArticleService extends CrudService<ArticleDao, Article> {
|
||||
|
||||
@Autowired
|
||||
@@ -120,7 +117,7 @@ public class ArticleService extends CrudService<ArticleDao, Article> {
|
||||
* @param article
|
||||
* @author ThinkGem
|
||||
*/
|
||||
@Transactional(readOnly = false)
|
||||
@Transactional
|
||||
public void updateExpiredWeight(Article article) {
|
||||
// 更新过期的权重,间隔为“6”个小时
|
||||
Date updateExpiredWeightDate = CmsUtils.getCache("updateExpiredWeightDateByArticle");
|
||||
@@ -137,7 +134,7 @@ public class ArticleService extends CrudService<ArticleDao, Article> {
|
||||
* @param article
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly = false)
|
||||
@Transactional
|
||||
public void save(Article article) {
|
||||
Global.assertDemoMode();
|
||||
// 设置内容状态
|
||||
@@ -177,7 +174,7 @@ public class ArticleService extends CrudService<ArticleDao, Article> {
|
||||
* @param article
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly = false)
|
||||
@Transactional
|
||||
public void updateStatus(Article article) {
|
||||
super.updateStatus(article);
|
||||
}
|
||||
@@ -185,7 +182,7 @@ public class ArticleService extends CrudService<ArticleDao, Article> {
|
||||
/**
|
||||
* 获取文章获取文章并点击数加一
|
||||
*/
|
||||
@Transactional(readOnly = false)
|
||||
@Transactional
|
||||
public void updateHitsAddOne(String id) {
|
||||
dao.updateHitsAddOne(id);
|
||||
}
|
||||
@@ -195,7 +192,7 @@ public class ArticleService extends CrudService<ArticleDao, Article> {
|
||||
* @param article
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly = false)
|
||||
@Transactional
|
||||
public void delete(Article article) {
|
||||
super.delete(article);
|
||||
}
|
||||
|
||||
@@ -23,7 +23,6 @@ import com.jeesite.modules.file.utils.FileUploadUtils;
|
||||
* @version 2020-7-24
|
||||
*/
|
||||
@Service
|
||||
@Transactional(readOnly = true)
|
||||
public class CategoryService extends TreeService<CategoryDao, Category> {
|
||||
|
||||
/**
|
||||
@@ -59,7 +58,7 @@ public class CategoryService extends TreeService<CategoryDao, Category> {
|
||||
* @param category
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly = false)
|
||||
@Transactional
|
||||
public void save(Category category) {
|
||||
if (StringUtils.isNotBlank(category.getViewConfig())){
|
||||
category.setViewConfig(StringEscapeUtils.unescapeHtml4(category.getViewConfig()));
|
||||
@@ -85,7 +84,7 @@ public class CategoryService extends TreeService<CategoryDao, Category> {
|
||||
* @param category
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly = false)
|
||||
@Transactional
|
||||
public void updateStatus(Category category) {
|
||||
super.updateStatus(category);
|
||||
}
|
||||
@@ -95,7 +94,7 @@ public class CategoryService extends TreeService<CategoryDao, Category> {
|
||||
* @param category
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly = false)
|
||||
@Transactional
|
||||
public void delete(Category category) {
|
||||
super.delete(category);
|
||||
}
|
||||
|
||||
@@ -19,7 +19,6 @@ import com.jeesite.modules.file.utils.FileUploadUtils;
|
||||
* @version 2020-7-24
|
||||
*/
|
||||
@Service
|
||||
@Transactional(readOnly=true)
|
||||
public class CommentService extends CrudService<CommentDao, Comment> {
|
||||
|
||||
/**
|
||||
@@ -48,7 +47,7 @@ public class CommentService extends CrudService<CommentDao, Comment> {
|
||||
* @param comment
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly=false)
|
||||
@Transactional
|
||||
public void save(Comment comment) {
|
||||
super.save(comment);
|
||||
// 保存上传图片
|
||||
@@ -62,7 +61,7 @@ public class CommentService extends CrudService<CommentDao, Comment> {
|
||||
* @param comment
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly=false)
|
||||
@Transactional
|
||||
public void updateStatus(Comment comment) {
|
||||
super.updateStatus(comment);
|
||||
}
|
||||
@@ -72,7 +71,7 @@ public class CommentService extends CrudService<CommentDao, Comment> {
|
||||
* @param comment
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly=false)
|
||||
@Transactional
|
||||
public void delete(Comment comment) {
|
||||
super.delete(comment);
|
||||
}
|
||||
|
||||
@@ -23,7 +23,6 @@ import com.jeesite.modules.sys.entity.DictData;
|
||||
* @version 2020-7-7
|
||||
*/
|
||||
@Service
|
||||
@Transactional(readOnly = true)
|
||||
public class FileTempleteService {
|
||||
|
||||
// public List<String> getTempleteContent(String prefix) throws IOException {
|
||||
|
||||
@@ -19,7 +19,6 @@ import com.jeesite.modules.file.utils.FileUploadUtils;
|
||||
* @version 2020-7-24
|
||||
*/
|
||||
@Service
|
||||
@Transactional(readOnly=true)
|
||||
public class ReportService extends CrudService<ReportDao, Report> {
|
||||
|
||||
/**
|
||||
@@ -48,7 +47,7 @@ public class ReportService extends CrudService<ReportDao, Report> {
|
||||
* @param report
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly=false)
|
||||
@Transactional
|
||||
public void save(Report report) {
|
||||
super.save(report);
|
||||
// 保存上传图片
|
||||
@@ -62,7 +61,7 @@ public class ReportService extends CrudService<ReportDao, Report> {
|
||||
* @param report
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly=false)
|
||||
@Transactional
|
||||
public void updateStatus(Report report) {
|
||||
super.updateStatus(report);
|
||||
}
|
||||
@@ -72,7 +71,7 @@ public class ReportService extends CrudService<ReportDao, Report> {
|
||||
* @param report
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly=false)
|
||||
@Transactional
|
||||
public void delete(Report report) {
|
||||
super.delete(report);
|
||||
}
|
||||
|
||||
@@ -20,7 +20,6 @@ import com.jeesite.modules.file.utils.FileUploadUtils;
|
||||
* @version 2020-7-24
|
||||
*/
|
||||
@Service
|
||||
@Transactional(readOnly = true)
|
||||
public class SiteService extends CrudService<SiteDao, Site> {
|
||||
|
||||
/**
|
||||
@@ -49,7 +48,7 @@ public class SiteService extends CrudService<SiteDao, Site> {
|
||||
* @param site
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly = false)
|
||||
@Transactional
|
||||
public void save(Site site) {
|
||||
super.save(site);
|
||||
CmsUtils.removeCache("siteList");
|
||||
@@ -62,7 +61,7 @@ public class SiteService extends CrudService<SiteDao, Site> {
|
||||
* @param site
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly = false)
|
||||
@Transactional
|
||||
public void updateStatus(Site site) {
|
||||
super.updateStatus(site);
|
||||
}
|
||||
@@ -72,7 +71,7 @@ public class SiteService extends CrudService<SiteDao, Site> {
|
||||
* @param site
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly = false)
|
||||
@Transactional
|
||||
public void delete(Site site) {
|
||||
super.delete(site);
|
||||
}
|
||||
@@ -82,7 +81,7 @@ public class SiteService extends CrudService<SiteDao, Site> {
|
||||
* @param site
|
||||
* @param isRe
|
||||
*/
|
||||
@Transactional(readOnly = false)
|
||||
@Transactional
|
||||
public void delete(Site site, Boolean isRe) {
|
||||
site.setStatus(isRe != null && isRe ? Site.STATUS_NORMAL : Site.STATUS_DELETE);
|
||||
super.delete(site);
|
||||
|
||||
@@ -18,7 +18,6 @@ import com.jeesite.modules.cms.entity.Tag;
|
||||
* @version 2020-7-24
|
||||
*/
|
||||
@Service
|
||||
@Transactional(readOnly=true)
|
||||
public class TagService extends CrudService<TagDao, Tag> {
|
||||
|
||||
/**
|
||||
@@ -47,7 +46,7 @@ public class TagService extends CrudService<TagDao, Tag> {
|
||||
* @param tag
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly=false)
|
||||
@Transactional
|
||||
public void save(Tag tag) {
|
||||
super.save(tag);
|
||||
}
|
||||
@@ -57,7 +56,7 @@ public class TagService extends CrudService<TagDao, Tag> {
|
||||
* @param tag
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly=false)
|
||||
@Transactional
|
||||
public void updateStatus(Tag tag) {
|
||||
super.updateStatus(tag);
|
||||
}
|
||||
@@ -67,7 +66,7 @@ public class TagService extends CrudService<TagDao, Tag> {
|
||||
* @param tag
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly=false)
|
||||
@Transactional
|
||||
public void delete(Tag tag) {
|
||||
super.delete(tag);
|
||||
}
|
||||
|
||||
@@ -19,7 +19,6 @@ import com.jeesite.modules.file.utils.FileUploadUtils;
|
||||
* @version 2020-7-24
|
||||
*/
|
||||
@Service
|
||||
@Transactional(readOnly=true)
|
||||
public class VisitLogService extends CrudService<VisitLogDao, VisitLog> {
|
||||
|
||||
/**
|
||||
@@ -48,7 +47,7 @@ public class VisitLogService extends CrudService<VisitLogDao, VisitLog> {
|
||||
* @param visitLog
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly=false)
|
||||
@Transactional
|
||||
public void save(VisitLog visitLog) {
|
||||
super.save(visitLog);
|
||||
// 保存上传图片
|
||||
@@ -62,7 +61,7 @@ public class VisitLogService extends CrudService<VisitLogDao, VisitLog> {
|
||||
* @param visitLog
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly=false)
|
||||
@Transactional
|
||||
public void updateStatus(VisitLog visitLog) {
|
||||
super.updateStatus(visitLog);
|
||||
}
|
||||
@@ -72,7 +71,7 @@ public class VisitLogService extends CrudService<VisitLogDao, VisitLog> {
|
||||
* @param visitLog
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly=false)
|
||||
@Transactional
|
||||
public void delete(VisitLog visitLog) {
|
||||
super.delete(visitLog);
|
||||
}
|
||||
|
||||
@@ -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) { %>
|
||||
|
||||
@@ -4,12 +4,6 @@
|
||||
*/
|
||||
package com.jeesite.modules.test.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.jeesite.common.entity.Page;
|
||||
import com.jeesite.common.idgen.IdGen;
|
||||
import com.jeesite.common.lang.DateUtils;
|
||||
@@ -20,6 +14,11 @@ import com.jeesite.modules.test.dao.TestDataChildDao;
|
||||
import com.jeesite.modules.test.dao.TestDataDao;
|
||||
import com.jeesite.modules.test.entity.TestData;
|
||||
import com.jeesite.modules.test.entity.TestDataChild;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 测试数据Service
|
||||
@@ -27,7 +26,6 @@ import com.jeesite.modules.test.entity.TestDataChild;
|
||||
* @version 2018-04-22
|
||||
*/
|
||||
@Service
|
||||
@Transactional(readOnly=true)
|
||||
public class TestDataService extends CrudService<TestDataDao, TestData> {
|
||||
|
||||
@Autowired
|
||||
@@ -85,7 +83,7 @@ public class TestDataService extends CrudService<TestDataDao, TestData> {
|
||||
* @param testData
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly=false)
|
||||
@Transactional
|
||||
public void save(TestData testData) {
|
||||
super.save(testData);
|
||||
// 保存上传图片
|
||||
@@ -119,7 +117,7 @@ public class TestDataService extends CrudService<TestDataDao, TestData> {
|
||||
* @param testData
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly=false)
|
||||
@Transactional
|
||||
public void updateStatus(TestData testData) {
|
||||
super.updateStatus(testData);
|
||||
}
|
||||
@@ -129,7 +127,7 @@ public class TestDataService extends CrudService<TestDataDao, TestData> {
|
||||
* @param testData
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly=false)
|
||||
@Transactional
|
||||
public void delete(TestData testData) {
|
||||
super.delete(testData);
|
||||
TestDataChild testDataChild = new TestDataChild();
|
||||
@@ -148,7 +146,7 @@ public class TestDataService extends CrudService<TestDataDao, TestData> {
|
||||
/**
|
||||
* 事务测试,若 Child 报错,则回滚
|
||||
*/
|
||||
@Transactional(readOnly=false/*, propagation=Propagation.NOT_SUPPORTED*/)
|
||||
@Transactional//(propagation = Propagation.NOT_SUPPORTED)
|
||||
public void transTest(TestData testData) {
|
||||
testData.setTestInput("transTest");
|
||||
testData.setTestTextarea(IdGen.randomBase62(5));
|
||||
|
||||
@@ -20,7 +20,6 @@ import com.jeesite.modules.test.entity.TestTree;
|
||||
* @version 2018-04-22
|
||||
*/
|
||||
@Service
|
||||
@Transactional(readOnly=true)
|
||||
public class TestTreeService extends TreeService<TestTreeDao, TestTree> {
|
||||
|
||||
/**
|
||||
@@ -48,7 +47,7 @@ public class TestTreeService extends TreeService<TestTreeDao, TestTree> {
|
||||
* @param testTree
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly=false)
|
||||
@Transactional
|
||||
public void save(TestTree testTree) {
|
||||
super.save(testTree);
|
||||
// 保存上传图片
|
||||
@@ -62,7 +61,7 @@ public class TestTreeService extends TreeService<TestTreeDao, TestTree> {
|
||||
* @param testTree
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly=false)
|
||||
@Transactional
|
||||
public void updateStatus(TestTree testTree) {
|
||||
super.updateStatus(testTree);
|
||||
}
|
||||
@@ -72,7 +71,7 @@ public class TestTreeService extends TreeService<TestTreeDao, TestTree> {
|
||||
* @param testTree
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly=false)
|
||||
@Transactional
|
||||
public void delete(TestTree testTree) {
|
||||
super.delete(testTree);
|
||||
}
|
||||
|
||||
@@ -4,12 +4,6 @@
|
||||
*/
|
||||
package com.jeesite.modules.test.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.jeesite.common.entity.Page;
|
||||
import com.jeesite.common.idgen.IdGen;
|
||||
import com.jeesite.common.lang.DateUtils;
|
||||
@@ -20,6 +14,11 @@ import com.jeesite.modules.test.dao.TestDataChildDao;
|
||||
import com.jeesite.modules.test.dao.TestDataDao;
|
||||
import com.jeesite.modules.test.entity.TestData;
|
||||
import com.jeesite.modules.test.entity.TestDataChild;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 测试数据Service
|
||||
@@ -27,7 +26,6 @@ import com.jeesite.modules.test.entity.TestDataChild;
|
||||
* @version 2018-04-22
|
||||
*/
|
||||
@Service
|
||||
@Transactional(readOnly=true)
|
||||
public class TestDataService extends CrudService<TestDataDao, TestData> {
|
||||
|
||||
@Autowired
|
||||
@@ -85,7 +83,7 @@ public class TestDataService extends CrudService<TestDataDao, TestData> {
|
||||
* @param testData
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly=false)
|
||||
@Transactional
|
||||
public void save(TestData testData) {
|
||||
super.save(testData);
|
||||
// 保存上传图片
|
||||
@@ -119,7 +117,7 @@ public class TestDataService extends CrudService<TestDataDao, TestData> {
|
||||
* @param testData
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly=false)
|
||||
@Transactional
|
||||
public void updateStatus(TestData testData) {
|
||||
super.updateStatus(testData);
|
||||
}
|
||||
@@ -129,7 +127,7 @@ public class TestDataService extends CrudService<TestDataDao, TestData> {
|
||||
* @param testData
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly=false)
|
||||
@Transactional
|
||||
public void delete(TestData testData) {
|
||||
super.delete(testData);
|
||||
TestDataChild testDataChild = new TestDataChild();
|
||||
@@ -148,7 +146,7 @@ public class TestDataService extends CrudService<TestDataDao, TestData> {
|
||||
/**
|
||||
* 事务测试,若 Child 报错,则回滚
|
||||
*/
|
||||
@Transactional(readOnly=false/*, propagation=Propagation.NOT_SUPPORTED*/)
|
||||
@Transactional//(propagation = Propagation.NOT_SUPPORTED)
|
||||
public void transTest(TestData testData) {
|
||||
testData.setTestInput("transTest");
|
||||
testData.setTestTextarea(IdGen.randomBase62(5));
|
||||
|
||||
@@ -20,7 +20,6 @@ import com.jeesite.modules.test.entity.TestTree;
|
||||
* @version 2018-04-22
|
||||
*/
|
||||
@Service
|
||||
@Transactional(readOnly=true)
|
||||
public class TestTreeService extends TreeService<TestTreeDao, TestTree> {
|
||||
|
||||
/**
|
||||
@@ -48,7 +47,7 @@ public class TestTreeService extends TreeService<TestTreeDao, TestTree> {
|
||||
* @param testTree
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly=false)
|
||||
@Transactional
|
||||
public void save(TestTree testTree) {
|
||||
super.save(testTree);
|
||||
// 保存上传图片
|
||||
@@ -62,7 +61,7 @@ public class TestTreeService extends TreeService<TestTreeDao, TestTree> {
|
||||
* @param testTree
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly=false)
|
||||
@Transactional
|
||||
public void updateStatus(TestTree testTree) {
|
||||
super.updateStatus(testTree);
|
||||
}
|
||||
@@ -72,7 +71,7 @@ public class TestTreeService extends TreeService<TestTreeDao, TestTree> {
|
||||
* @param testTree
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly=false)
|
||||
@Transactional
|
||||
public void delete(TestTree testTree) {
|
||||
super.delete(testTree);
|
||||
}
|
||||
|
||||
@@ -4,12 +4,6 @@
|
||||
*/
|
||||
package com.jeesite.modules.test.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.jeesite.common.entity.Page;
|
||||
import com.jeesite.common.idgen.IdGen;
|
||||
import com.jeesite.common.lang.DateUtils;
|
||||
@@ -20,6 +14,11 @@ import com.jeesite.modules.test.dao.TestDataChildDao;
|
||||
import com.jeesite.modules.test.dao.TestDataDao;
|
||||
import com.jeesite.modules.test.entity.TestData;
|
||||
import com.jeesite.modules.test.entity.TestDataChild;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 测试数据Service
|
||||
@@ -27,7 +26,6 @@ import com.jeesite.modules.test.entity.TestDataChild;
|
||||
* @version 2018-04-22
|
||||
*/
|
||||
@Service
|
||||
@Transactional(readOnly=true)
|
||||
public class TestDataService extends CrudService<TestDataDao, TestData> {
|
||||
|
||||
@Autowired
|
||||
@@ -85,7 +83,7 @@ public class TestDataService extends CrudService<TestDataDao, TestData> {
|
||||
* @param testData
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly=false)
|
||||
@Transactional
|
||||
public void save(TestData testData) {
|
||||
super.save(testData);
|
||||
// 保存上传图片
|
||||
@@ -119,7 +117,7 @@ public class TestDataService extends CrudService<TestDataDao, TestData> {
|
||||
* @param testData
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly=false)
|
||||
@Transactional
|
||||
public void updateStatus(TestData testData) {
|
||||
super.updateStatus(testData);
|
||||
}
|
||||
@@ -129,7 +127,7 @@ public class TestDataService extends CrudService<TestDataDao, TestData> {
|
||||
* @param testData
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly=false)
|
||||
@Transactional
|
||||
public void delete(TestData testData) {
|
||||
super.delete(testData);
|
||||
TestDataChild testDataChild = new TestDataChild();
|
||||
@@ -148,7 +146,7 @@ public class TestDataService extends CrudService<TestDataDao, TestData> {
|
||||
/**
|
||||
* 事务测试,若 Child 报错,则回滚
|
||||
*/
|
||||
@Transactional(readOnly=false/*, propagation=Propagation.NOT_SUPPORTED*/)
|
||||
@Transactional//(propagation = Propagation.NOT_SUPPORTED)
|
||||
public void transTest(TestData testData) {
|
||||
testData.setTestInput("transTest");
|
||||
testData.setTestTextarea(IdGen.randomBase62(5));
|
||||
|
||||
@@ -20,7 +20,6 @@ import com.jeesite.modules.test.entity.TestTree;
|
||||
* @version 2018-04-22
|
||||
*/
|
||||
@Service
|
||||
@Transactional(readOnly=true)
|
||||
public class TestTreeService extends TreeService<TestTreeDao, TestTree> {
|
||||
|
||||
/**
|
||||
@@ -48,7 +47,7 @@ public class TestTreeService extends TreeService<TestTreeDao, TestTree> {
|
||||
* @param testTree
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly=false)
|
||||
@Transactional
|
||||
public void save(TestTree testTree) {
|
||||
super.save(testTree);
|
||||
// 保存上传图片
|
||||
@@ -62,7 +61,7 @@ public class TestTreeService extends TreeService<TestTreeDao, TestTree> {
|
||||
* @param testTree
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly=false)
|
||||
@Transactional
|
||||
public void updateStatus(TestTree testTree) {
|
||||
super.updateStatus(testTree);
|
||||
}
|
||||
@@ -72,7 +71,7 @@ public class TestTreeService extends TreeService<TestTreeDao, TestTree> {
|
||||
* @param testTree
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly=false)
|
||||
@Transactional
|
||||
public void delete(TestTree testTree) {
|
||||
super.delete(testTree);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user