去掉类上的事务注解

This commit is contained in:
thinkgem
2022-06-02 18:13:22 +08:00
parent b925cd71a1
commit b4bddb3246
22 changed files with 76 additions and 99 deletions

View File

@@ -278,7 +278,7 @@ a, a:hover, a:active, a:focus, .form-unit, th[aria-selected=true] .ui-jqgrid-sor
.select2-container--default.select2-container--focus .select2-selection--single, .select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--focus .select2-selection--multiple {border-color:#40a9ff!important;box-shadow:0 0 0 2px rgba(24,144,255,.2);} .select2-container--default.select2-container--focus .select2-selection--multiple {border-color:#40a9ff!important;box-shadow:0 0 0 2px rgba(24,144,255,.2);}
.table thead tr, .ui-jqgrid-htable thead tr, .ui-jqgrid-hdiv, .ui-jqgrid-hbox {background-color: #1f1f1f;color:#b3b3b3;} .table thead tr, .ui-jqgrid-htable thead tr, .ui-jqgrid-hdiv, .ui-jqgrid-hbox {background-color: #1f1f1f;color:#b3b3b3;}
.table>thead>tr>th, .table>tbody>tr>th, .table>tfoot>tr>th, .table>thead>tr>td, .table>tbody>tr>td, .table>tfoot>tr>td {border-top-color:#3e3e3e;} .table>thead>tr>th, .table>tbody>tr>th, .table>tfoot>tr>th, .table>thead>tr>td, .table>tbody>tr>td, .table>tfoot>tr>td {border-color:#3e3e3e;}
.table-striped>tbody>tr:nth-of-type(odd) {background-color:#262626;} .table-striped>tbody>tr:nth-of-type(odd) {background-color:#262626;}
.table-hover>tbody>tr:hover>td, .table-hover>tbody>tr:hover>th {background-color:#323232;} .table-hover>tbody>tr:hover>td, .table-hover>tbody>tr:hover>th {background-color:#323232;}
.ui-jqgrid .ui-jqgrid-labels th, .ui-jqgrid tr.ui-row-ltr td, .ui-jqgrid tr.ui-row-rtl td, .ui-jqgrid tr.ui-row-ltr td:last-child, .ui-jqgrid .ui-jqgrid-labels th, .ui-jqgrid tr.ui-row-ltr td, .ui-jqgrid tr.ui-row-rtl td, .ui-jqgrid tr.ui-row-ltr td:last-child,

View File

@@ -40,7 +40,6 @@ import io.netty.util.concurrent.DefaultThreadFactory;
* @version 2020-7-24 * @version 2020-7-24
*/ */
@Service @Service
@Transactional(readOnly = true)
public class ArticleService extends CrudService<ArticleDao, Article> { public class ArticleService extends CrudService<ArticleDao, Article> {
@Autowired @Autowired
@@ -120,7 +119,7 @@ public class ArticleService extends CrudService<ArticleDao, Article> {
* @param article * @param article
* @author ThinkGem * @author ThinkGem
*/ */
@Transactional(readOnly = false) @Transactional
public void updateExpiredWeight(Article article) { public void updateExpiredWeight(Article article) {
// 更新过期的权重间隔为“6”个小时 // 更新过期的权重间隔为“6”个小时
Date updateExpiredWeightDate = CmsUtils.getCache("updateExpiredWeightDateByArticle"); Date updateExpiredWeightDate = CmsUtils.getCache("updateExpiredWeightDateByArticle");
@@ -137,7 +136,7 @@ public class ArticleService extends CrudService<ArticleDao, Article> {
* @param article * @param article
*/ */
@Override @Override
@Transactional(readOnly = false) @Transactional
public void save(Article article) { public void save(Article article) {
Global.assertDemoMode(); Global.assertDemoMode();
// 设置内容状态 // 设置内容状态
@@ -177,7 +176,7 @@ public class ArticleService extends CrudService<ArticleDao, Article> {
* @param article * @param article
*/ */
@Override @Override
@Transactional(readOnly = false) @Transactional
public void updateStatus(Article article) { public void updateStatus(Article article) {
super.updateStatus(article); super.updateStatus(article);
} }
@@ -185,7 +184,7 @@ public class ArticleService extends CrudService<ArticleDao, Article> {
/** /**
* 获取文章获取文章并点击数加一 * 获取文章获取文章并点击数加一
*/ */
@Transactional(readOnly = false) @Transactional
public void updateHitsAddOne(String id) { public void updateHitsAddOne(String id) {
dao.updateHitsAddOne(id); dao.updateHitsAddOne(id);
} }
@@ -195,7 +194,7 @@ public class ArticleService extends CrudService<ArticleDao, Article> {
* @param article * @param article
*/ */
@Override @Override
@Transactional(readOnly = false) @Transactional
public void delete(Article article) { public void delete(Article article) {
super.delete(article); super.delete(article);
} }

View File

@@ -4,18 +4,17 @@
*/ */
package com.jeesite.modules.cms.service; package com.jeesite.modules.cms.service;
import java.util.List;
import org.apache.commons.text.StringEscapeUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.jeesite.common.lang.StringUtils; import com.jeesite.common.lang.StringUtils;
import com.jeesite.common.service.TreeService; import com.jeesite.common.service.TreeService;
import com.jeesite.modules.cms.dao.CategoryDao; import com.jeesite.modules.cms.dao.CategoryDao;
import com.jeesite.modules.cms.entity.Category; import com.jeesite.modules.cms.entity.Category;
import com.jeesite.modules.cms.utils.CmsUtils; import com.jeesite.modules.cms.utils.CmsUtils;
import com.jeesite.modules.file.utils.FileUploadUtils; import com.jeesite.modules.file.utils.FileUploadUtils;
import org.apache.commons.text.StringEscapeUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/** /**
* 栏目表Service * 栏目表Service
@@ -23,7 +22,6 @@ import com.jeesite.modules.file.utils.FileUploadUtils;
* @version 2020-7-24 * @version 2020-7-24
*/ */
@Service @Service
@Transactional(readOnly = true)
public class CategoryService extends TreeService<CategoryDao, Category> { public class CategoryService extends TreeService<CategoryDao, Category> {
/** /**
@@ -59,7 +57,7 @@ public class CategoryService extends TreeService<CategoryDao, Category> {
* @param category * @param category
*/ */
@Override @Override
@Transactional(readOnly = false) @Transactional
public void save(Category category) { public void save(Category category) {
if (StringUtils.isNotBlank(category.getViewConfig())){ if (StringUtils.isNotBlank(category.getViewConfig())){
category.setViewConfig(StringEscapeUtils.unescapeHtml4(category.getViewConfig())); category.setViewConfig(StringEscapeUtils.unescapeHtml4(category.getViewConfig()));
@@ -85,7 +83,7 @@ public class CategoryService extends TreeService<CategoryDao, Category> {
* @param category * @param category
*/ */
@Override @Override
@Transactional(readOnly = false) @Transactional
public void updateStatus(Category category) { public void updateStatus(Category category) {
super.updateStatus(category); super.updateStatus(category);
} }
@@ -95,7 +93,7 @@ public class CategoryService extends TreeService<CategoryDao, Category> {
* @param category * @param category
*/ */
@Override @Override
@Transactional(readOnly = false) @Transactional
public void delete(Category category) { public void delete(Category category) {
super.delete(category); super.delete(category);
} }

View File

@@ -19,7 +19,6 @@ import com.jeesite.modules.file.utils.FileUploadUtils;
* @version 2020-7-24 * @version 2020-7-24
*/ */
@Service @Service
@Transactional(readOnly=true)
public class CommentService extends CrudService<CommentDao, Comment> { public class CommentService extends CrudService<CommentDao, Comment> {
/** /**
@@ -48,7 +47,7 @@ public class CommentService extends CrudService<CommentDao, Comment> {
* @param comment * @param comment
*/ */
@Override @Override
@Transactional(readOnly=false) @Transactional
public void save(Comment comment) { public void save(Comment comment) {
super.save(comment); super.save(comment);
// 保存上传图片 // 保存上传图片
@@ -62,7 +61,7 @@ public class CommentService extends CrudService<CommentDao, Comment> {
* @param comment * @param comment
*/ */
@Override @Override
@Transactional(readOnly=false) @Transactional
public void updateStatus(Comment comment) { public void updateStatus(Comment comment) {
super.updateStatus(comment); super.updateStatus(comment);
} }
@@ -72,7 +71,7 @@ public class CommentService extends CrudService<CommentDao, Comment> {
* @param comment * @param comment
*/ */
@Override @Override
@Transactional(readOnly=false) @Transactional
public void delete(Comment comment) { public void delete(Comment comment) {
super.delete(comment); super.delete(comment);
} }

View File

@@ -4,18 +4,16 @@
*/ */
package com.jeesite.modules.cms.service; package com.jeesite.modules.cms.service;
import java.io.IOException;
import java.util.List;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.beust.jcommander.internal.Lists; import com.beust.jcommander.internal.Lists;
import com.jeesite.modules.cms.entity.FileTemplete; import com.jeesite.modules.cms.entity.FileTemplete;
import com.jeesite.modules.cms.entity.Site; import com.jeesite.modules.cms.entity.Site;
import com.jeesite.modules.cms.utils.CmsUtils; import com.jeesite.modules.cms.utils.CmsUtils;
import com.jeesite.modules.cms.utils.FileTempleteUtils; import com.jeesite.modules.cms.utils.FileTempleteUtils;
import com.jeesite.modules.sys.entity.DictData; import com.jeesite.modules.sys.entity.DictData;
import org.springframework.stereotype.Service;
import java.io.IOException;
import java.util.List;
/** /**
* 模版文件Service * 模版文件Service
@@ -23,7 +21,6 @@ import com.jeesite.modules.sys.entity.DictData;
* @version 2020-7-7 * @version 2020-7-7
*/ */
@Service @Service
@Transactional(readOnly = true)
public class FileTempleteService { public class FileTempleteService {
// public List<String> getTempleteContent(String prefix) throws IOException { // public List<String> getTempleteContent(String prefix) throws IOException {

View File

@@ -19,7 +19,6 @@ import com.jeesite.modules.file.utils.FileUploadUtils;
* @version 2020-7-24 * @version 2020-7-24
*/ */
@Service @Service
@Transactional(readOnly=true)
public class ReportService extends CrudService<ReportDao, Report> { public class ReportService extends CrudService<ReportDao, Report> {
/** /**
@@ -48,7 +47,7 @@ public class ReportService extends CrudService<ReportDao, Report> {
* @param report * @param report
*/ */
@Override @Override
@Transactional(readOnly=false) @Transactional
public void save(Report report) { public void save(Report report) {
super.save(report); super.save(report);
// 保存上传图片 // 保存上传图片
@@ -62,7 +61,7 @@ public class ReportService extends CrudService<ReportDao, Report> {
* @param report * @param report
*/ */
@Override @Override
@Transactional(readOnly=false) @Transactional
public void updateStatus(Report report) { public void updateStatus(Report report) {
super.updateStatus(report); super.updateStatus(report);
} }
@@ -72,7 +71,7 @@ public class ReportService extends CrudService<ReportDao, Report> {
* @param report * @param report
*/ */
@Override @Override
@Transactional(readOnly=false) @Transactional
public void delete(Report report) { public void delete(Report report) {
super.delete(report); super.delete(report);
} }

View File

@@ -20,7 +20,6 @@ import com.jeesite.modules.file.utils.FileUploadUtils;
* @version 2020-7-24 * @version 2020-7-24
*/ */
@Service @Service
@Transactional(readOnly = true)
public class SiteService extends CrudService<SiteDao, Site> { public class SiteService extends CrudService<SiteDao, Site> {
/** /**
@@ -49,7 +48,7 @@ public class SiteService extends CrudService<SiteDao, Site> {
* @param site * @param site
*/ */
@Override @Override
@Transactional(readOnly = false) @Transactional
public void save(Site site) { public void save(Site site) {
super.save(site); super.save(site);
CmsUtils.removeCache("siteList"); CmsUtils.removeCache("siteList");
@@ -62,7 +61,7 @@ public class SiteService extends CrudService<SiteDao, Site> {
* @param site * @param site
*/ */
@Override @Override
@Transactional(readOnly = false) @Transactional
public void updateStatus(Site site) { public void updateStatus(Site site) {
super.updateStatus(site); super.updateStatus(site);
} }
@@ -72,7 +71,7 @@ public class SiteService extends CrudService<SiteDao, Site> {
* @param site * @param site
*/ */
@Override @Override
@Transactional(readOnly = false) @Transactional
public void delete(Site site) { public void delete(Site site) {
super.delete(site); super.delete(site);
} }
@@ -82,7 +81,7 @@ public class SiteService extends CrudService<SiteDao, Site> {
* @param site * @param site
* @param isRe * @param isRe
*/ */
@Transactional(readOnly = false) @Transactional
public void delete(Site site, Boolean isRe) { public void delete(Site site, Boolean isRe) {
site.setStatus(isRe != null && isRe ? Site.STATUS_NORMAL : Site.STATUS_DELETE); site.setStatus(isRe != null && isRe ? Site.STATUS_NORMAL : Site.STATUS_DELETE);
super.delete(site); super.delete(site);

View File

@@ -18,7 +18,6 @@ import com.jeesite.modules.cms.entity.Tag;
* @version 2020-7-24 * @version 2020-7-24
*/ */
@Service @Service
@Transactional(readOnly=true)
public class TagService extends CrudService<TagDao, Tag> { public class TagService extends CrudService<TagDao, Tag> {
/** /**
@@ -47,7 +46,7 @@ public class TagService extends CrudService<TagDao, Tag> {
* @param tag * @param tag
*/ */
@Override @Override
@Transactional(readOnly=false) @Transactional
public void save(Tag tag) { public void save(Tag tag) {
super.save(tag); super.save(tag);
} }
@@ -57,7 +56,7 @@ public class TagService extends CrudService<TagDao, Tag> {
* @param tag * @param tag
*/ */
@Override @Override
@Transactional(readOnly=false) @Transactional
public void updateStatus(Tag tag) { public void updateStatus(Tag tag) {
super.updateStatus(tag); super.updateStatus(tag);
} }
@@ -67,7 +66,7 @@ public class TagService extends CrudService<TagDao, Tag> {
* @param tag * @param tag
*/ */
@Override @Override
@Transactional(readOnly=false) @Transactional
public void delete(Tag tag) { public void delete(Tag tag) {
super.delete(tag); super.delete(tag);
} }

View File

@@ -19,7 +19,6 @@ import com.jeesite.modules.file.utils.FileUploadUtils;
* @version 2020-7-24 * @version 2020-7-24
*/ */
@Service @Service
@Transactional(readOnly=true)
public class VisitLogService extends CrudService<VisitLogDao, VisitLog> { public class VisitLogService extends CrudService<VisitLogDao, VisitLog> {
/** /**
@@ -48,7 +47,7 @@ public class VisitLogService extends CrudService<VisitLogDao, VisitLog> {
* @param visitLog * @param visitLog
*/ */
@Override @Override
@Transactional(readOnly=false) @Transactional
public void save(VisitLog visitLog) { public void save(VisitLog visitLog) {
super.save(visitLog); super.save(visitLog);
// 保存上传图片 // 保存上传图片
@@ -62,7 +61,7 @@ public class VisitLogService extends CrudService<VisitLogDao, VisitLog> {
* @param visitLog * @param visitLog
*/ */
@Override @Override
@Transactional(readOnly=false) @Transactional
public void updateStatus(VisitLog visitLog) { public void updateStatus(VisitLog visitLog) {
super.updateStatus(visitLog); super.updateStatus(visitLog);
} }
@@ -72,7 +71,7 @@ public class VisitLogService extends CrudService<VisitLogDao, VisitLog> {
* @param visitLog * @param visitLog
*/ */
@Override @Override
@Transactional(readOnly=false) @Transactional
public void delete(VisitLog visitLog) { public void delete(VisitLog visitLog) {
super.delete(visitLog); super.delete(visitLog);
} }

View File

@@ -46,7 +46,6 @@ import io.netty.util.concurrent.DefaultThreadFactory;
* @version 2019-03-12 * @version 2019-03-12
*/ */
@Service @Service
@Transactional(readOnly=true)
public class MsgInnerService extends CrudService<MsgInnerDao, MsgInner> { public class MsgInnerService extends CrudService<MsgInnerDao, MsgInner> {
@Autowired @Autowired
@@ -91,7 +90,7 @@ public class MsgInnerService extends CrudService<MsgInnerDao, MsgInner> {
* @param msgInner * @param msgInner
*/ */
@Override @Override
@Transactional(readOnly=false) @Transactional
public void save(MsgInner msgInner) { public void save(MsgInner msgInner) {
if (msgInner.getIsNewRecord()){ if (msgInner.getIsNewRecord()){
User user = msgInner.getCurrentUser(); User user = msgInner.getCurrentUser();
@@ -216,7 +215,7 @@ public class MsgInnerService extends CrudService<MsgInnerDao, MsgInner> {
/** /**
* 根据消息编号和接受者用户名读取内部消息 * 根据消息编号和接受者用户名读取内部消息
*/ */
@Transactional(readOnly=false) @Transactional
public void readMsgInnerRecord(MsgInner msgInner){ public void readMsgInnerRecord(MsgInner msgInner){
MsgInnerRecord msgInnerRecord = new MsgInnerRecord(); MsgInnerRecord msgInnerRecord = new MsgInnerRecord();
msgInnerRecord.setMsgInnerId(msgInner.getId()); msgInnerRecord.setMsgInnerId(msgInner.getId());
@@ -234,7 +233,7 @@ public class MsgInnerService extends CrudService<MsgInnerDao, MsgInner> {
* @param msgInner * @param msgInner
*/ */
@Override @Override
@Transactional(readOnly=false) @Transactional
public void updateStatus(MsgInner msgInner) { public void updateStatus(MsgInner msgInner) {
super.updateStatus(msgInner); super.updateStatus(msgInner);
} }
@@ -244,7 +243,7 @@ public class MsgInnerService extends CrudService<MsgInnerDao, MsgInner> {
* @param msgInner * @param msgInner
*/ */
@Override @Override
@Transactional(readOnly=false) @Transactional
public void delete(MsgInner msgInner) { public void delete(MsgInner msgInner) {
super.delete(msgInner); super.delete(msgInner);
} }

View File

@@ -19,7 +19,6 @@ import com.jeesite.modules.sys.utils.AreaUtils;
* @author ThinkGem * @author ThinkGem
* @version 2014-8-19 * @version 2014-8-19
*/ */
@Transactional(readOnly=true)
public class AreaServiceSupport extends TreeService<AreaDao, Area> public class AreaServiceSupport extends TreeService<AreaDao, Area>
implements AreaService { implements AreaService {
@@ -43,7 +42,7 @@ public class AreaServiceSupport extends TreeService<AreaDao, Area>
* 保存区划 * 保存区划
*/ */
@Override @Override
@Transactional(readOnly=false) @Transactional
public void save(Area area) { public void save(Area area) {
super.save(area); super.save(area);
AreaUtils.clearCache(); AreaUtils.clearCache();
@@ -53,7 +52,7 @@ public class AreaServiceSupport extends TreeService<AreaDao, Area>
* 删除区划 * 删除区划
*/ */
@Override @Override
@Transactional(readOnly=false) @Transactional
public void delete(Area area) { public void delete(Area area) {
super.delete(area); super.delete(area);
AreaUtils.clearCache(); AreaUtils.clearCache();

View File

@@ -25,7 +25,6 @@ import com.jeesite.modules.sys.utils.EmpUtils;
* @author ThinkGem * @author ThinkGem
* @version 2016-4-23 * @version 2016-4-23
*/ */
@Transactional(readOnly=true)
public class CompanyServiceSupport extends TreeService<CompanyDao, Company> public class CompanyServiceSupport extends TreeService<CompanyDao, Company>
implements CompanyService{ implements CompanyService{
@@ -64,7 +63,7 @@ public class CompanyServiceSupport extends TreeService<CompanyDao, Company>
* 保存公司 * 保存公司
*/ */
@Override @Override
@Transactional(readOnly=false) @Transactional
public void save(Company company) { public void save(Company company) {
if (company.getIsNewRecord()){ if (company.getIsNewRecord()){
// 生成主键,并验证改主键是否存在,如存在则抛出验证信息 // 生成主键,并验证改主键是否存在,如存在则抛出验证信息
@@ -95,7 +94,7 @@ public class CompanyServiceSupport extends TreeService<CompanyDao, Company>
* 删除公司 * 删除公司
*/ */
@Override @Override
@Transactional(readOnly=false) @Transactional
public void delete(Company company) { public void delete(Company company) {
super.delete(company); super.delete(company);
// 清理公司相关缓存 // 清理公司相关缓存
@@ -106,7 +105,7 @@ public class CompanyServiceSupport extends TreeService<CompanyDao, Company>
* 停用当前节点 * 停用当前节点
*/ */
@Override @Override
@Transactional(readOnly=false) @Transactional
public void updateStatus(Company company) { public void updateStatus(Company company) {
dao.updateStatus(company); dao.updateStatus(company);
// 清理公司相关缓存 // 清理公司相关缓存

View File

@@ -39,7 +39,6 @@ import com.jeesite.modules.sys.utils.UserUtils;
* @author ThinkGem * @author ThinkGem
* @version 2017-03-25 * @version 2017-03-25
*/ */
@Transactional(readOnly=true)
public class EmpUserServiceSupport extends CrudService<EmpUserDao, EmpUser> public class EmpUserServiceSupport extends CrudService<EmpUserDao, EmpUser>
implements EmpUserService{ implements EmpUserService{
@@ -123,7 +122,7 @@ public class EmpUserServiceSupport extends CrudService<EmpUserDao, EmpUser>
* 保存用户员工 * 保存用户员工
*/ */
@Override @Override
@Transactional(readOnly=false) @Transactional
public void save(EmpUser user) { public void save(EmpUser user) {
// 1、初始化用户信息 // 1、初始化用户信息
if (user.getIsNewRecord()){ if (user.getIsNewRecord()){
@@ -170,7 +169,7 @@ public class EmpUserServiceSupport extends CrudService<EmpUserDao, EmpUser>
* @param file 导入的用户数据文件 * @param file 导入的用户数据文件
* @param isUpdateSupport 是否更新支持,如果已存在,则进行更新数据 * @param isUpdateSupport 是否更新支持,如果已存在,则进行更新数据
*/ */
@Transactional(readOnly=false) @Transactional
public String importData(MultipartFile file, Boolean isUpdateSupport) { public String importData(MultipartFile file, Boolean isUpdateSupport) {
if (file == null){ if (file == null){
throw new ServiceException(text("请选择导入的数据文件!")); throw new ServiceException(text("请选择导入的数据文件!"));
@@ -241,7 +240,7 @@ public class EmpUserServiceSupport extends CrudService<EmpUserDao, EmpUser>
* 更新状态 * 更新状态
*/ */
@Override @Override
@Transactional(readOnly=false) @Transactional
public void updateStatus(EmpUser empUser) { public void updateStatus(EmpUser empUser) {
userService.updateStatus(empUser); userService.updateStatus(empUser);
employeeService.updateStatus(empUser.getEmployee()); employeeService.updateStatus(empUser.getEmployee());
@@ -251,7 +250,7 @@ public class EmpUserServiceSupport extends CrudService<EmpUserDao, EmpUser>
* 删除用户 * 删除用户
*/ */
@Override @Override
@Transactional(readOnly=false) @Transactional
public void delete(EmpUser empUser) { public void delete(EmpUser empUser) {
userService.delete(empUser); userService.delete(empUser);
employeeService.delete(empUser.getEmployee()); employeeService.delete(empUser.getEmployee());

View File

@@ -25,7 +25,6 @@ import com.jeesite.modules.sys.service.EmployeeService;
* @author ThinkGem * @author ThinkGem
* @version 2017-03-25 * @version 2017-03-25
*/ */
@Transactional(readOnly=true)
public class EmployeeServiceSupport extends CrudService<EmployeeDao, Employee> public class EmployeeServiceSupport extends CrudService<EmployeeDao, Employee>
implements EmployeeService{ implements EmployeeService{
@@ -64,7 +63,7 @@ public class EmployeeServiceSupport extends CrudService<EmployeeDao, Employee>
* 保存数据(插入或更新) * 保存数据(插入或更新)
*/ */
@Override @Override
@Transactional(readOnly=false) @Transactional
public void save(Employee employee) { public void save(Employee employee) {
if (employee.getIsNewRecord()){ if (employee.getIsNewRecord()){
if (dao.get(employee) != null){ if (dao.get(employee) != null){
@@ -88,7 +87,7 @@ public class EmployeeServiceSupport extends CrudService<EmployeeDao, Employee>
* 删除数据 * 删除数据
*/ */
@Override @Override
@Transactional(readOnly=false) @Transactional
public void delete(Employee employee) { public void delete(Employee employee) {
super.delete(employee); super.delete(employee);
} }

View File

@@ -18,7 +18,6 @@ import com.jeesite.modules.sys.service.LogService;
* @author ThinkGem * @author ThinkGem
* @version 2014-05-16 * @version 2014-05-16
*/ */
@Transactional(readOnly=true)
public class LogServiceSupport extends CrudService<LogDao, Log> public class LogServiceSupport extends CrudService<LogDao, Log>
implements LogService{ 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) { public void insertLog(Log entity) {
DataSourceHolder.setJdbcTransaction(false); DataSourceHolder.setJdbcTransaction(false);
dao.insert(entity); dao.insert(entity);

View File

@@ -29,7 +29,6 @@ import com.jeesite.modules.sys.utils.EmpUtils;
* @author ThinkGem * @author ThinkGem
* @version 2016-4-23 * @version 2016-4-23
*/ */
@Transactional(readOnly=true)
public class OfficeServiceSupport extends TreeService<OfficeDao, Office> public class OfficeServiceSupport extends TreeService<OfficeDao, Office>
implements OfficeService{ implements OfficeService{
@@ -65,7 +64,7 @@ public class OfficeServiceSupport extends TreeService<OfficeDao, Office>
* 保存数据(插入或更新) * 保存数据(插入或更新)
*/ */
@Override @Override
@Transactional(readOnly=false) @Transactional
public void save(Office office) { public void save(Office office) {
if (office.getIsNewRecord()){ if (office.getIsNewRecord()){
// 生成主键,并验证改主键是否存在,如存在则抛出验证信息 // 生成主键,并验证改主键是否存在,如存在则抛出验证信息
@@ -83,7 +82,7 @@ public class OfficeServiceSupport extends TreeService<OfficeDao, Office>
* @param file 导入的机构数据文件 * @param file 导入的机构数据文件
* @param isUpdateSupport 是否更新支持,如果已存在,则进行更新数据 * @param isUpdateSupport 是否更新支持,如果已存在,则进行更新数据
*/ */
@Transactional(readOnly=false) @Transactional
public String importData(MultipartFile file, Boolean isUpdateSupport) { public String importData(MultipartFile file, Boolean isUpdateSupport) {
if (file == null){ if (file == null){
throw new ServiceException(text("请选择导入的数据文件!")); throw new ServiceException(text("请选择导入的数据文件!"));
@@ -145,7 +144,7 @@ public class OfficeServiceSupport extends TreeService<OfficeDao, Office>
* 更新部门状态 * 更新部门状态
*/ */
@Override @Override
@Transactional(readOnly=false) @Transactional
public void updateStatus(Office office) { public void updateStatus(Office office) {
super.updateStatus(office); super.updateStatus(office);
// 清理部门相关缓存 // 清理部门相关缓存
@@ -156,7 +155,7 @@ public class OfficeServiceSupport extends TreeService<OfficeDao, Office>
* 删除数据 * 删除数据
*/ */
@Override @Override
@Transactional(readOnly=false) @Transactional
public void delete(Office office) { public void delete(Office office) {
super.delete(office); super.delete(office);
// 清理部门相关缓存 // 清理部门相关缓存

View File

@@ -17,7 +17,6 @@ import com.jeesite.modules.sys.service.PostService;
* @author ThinkGem * @author ThinkGem
* @version 2017-03-25 * @version 2017-03-25
*/ */
@Transactional(readOnly=true)
public class PostServiceSupport extends CrudService<PostDao, Post> public class PostServiceSupport extends CrudService<PostDao, Post>
implements PostService{ implements PostService{
@@ -50,7 +49,7 @@ public class PostServiceSupport extends CrudService<PostDao, Post>
* 保存岗位 * 保存岗位
*/ */
@Override @Override
@Transactional(readOnly=false) @Transactional
public void save(Post post) { public void save(Post post) {
super.save(post); super.save(post);
} }
@@ -59,7 +58,7 @@ public class PostServiceSupport extends CrudService<PostDao, Post>
* 更新岗位状态 * 更新岗位状态
*/ */
@Override @Override
@Transactional(readOnly=false) @Transactional
public void updateStatus(Post post) { public void updateStatus(Post post) {
super.updateStatus(post); super.updateStatus(post);
} }
@@ -68,7 +67,7 @@ public class PostServiceSupport extends CrudService<PostDao, Post>
* 删除岗位 * 删除岗位
*/ */
@Override @Override
@Transactional(readOnly=false) @Transactional
public void delete(Post post) { public void delete(Post post) {
super.delete(post); super.delete(post);
} }

View File

@@ -40,7 +40,6 @@ import ${packageName}.${moduleName}.dao${isNotEmpty(subModuleName)?'.'+subModule
* @version ${functionVersion} * @version ${functionVersion}
*/ */
@Service @Service
@Transactional(readOnly=true)
public class ${ClassName}Service extends ${table.isTreeEntity?'Tree':'Crud'}Service<${ClassName}Dao, ${ClassName}> { public class ${ClassName}Service extends ${table.isTreeEntity?'Tree':'Crud'}Service<${ClassName}Dao, ${ClassName}> {
<% for (child in table.childList){ %> <% for (child in table.childList){ %>
@@ -110,7 +109,7 @@ public class ${ClassName}Service extends ${table.isTreeEntity?'Tree':'Crud'}Serv
* @param ${className} * @param ${className}
*/ */
@Override @Override
@Transactional(readOnly=false) @Transactional
public void save(${ClassName} ${className}) { public void save(${ClassName} ${className}) {
<% if(toBoolean(table.optionMap['isBpmForm'])){ %> <% if(toBoolean(table.optionMap['isBpmForm'])){ %>
// 如果未设置状态,则指定状态为审核状态,以提交审核流程 // 如果未设置状态,则指定状态为审核状态,以提交审核流程
@@ -187,7 +186,7 @@ public class ${ClassName}Service extends ${table.isTreeEntity?'Tree':'Crud'}Serv
* @param ${className} * @param ${className}
*/ */
@Override @Override
@Transactional(readOnly=false) @Transactional
public void updateStatus(${ClassName} ${className}) { public void updateStatus(${ClassName} ${className}) {
super.updateStatus(${className}); super.updateStatus(${className});
} }
@@ -197,7 +196,7 @@ public class ${ClassName}Service extends ${table.isTreeEntity?'Tree':'Crud'}Serv
* @param ${className} * @param ${className}
*/ */
@Override @Override
@Transactional(readOnly=false) @Transactional
public void delete(${ClassName} ${className}) { public void delete(${ClassName} ${className}) {
super.delete(${className}); super.delete(${className});
<% for (child in table.childList) { %> <% for (child in table.childList) { %>

View File

@@ -45,7 +45,6 @@ import io.seata.spring.annotation.GlobalTransactional;
*/ */
@Service @Service
@RestController @RestController
@Transactional(readOnly=true)
public class ${ClassName}Service extends ${table.isTreeEntity?'Tree':'Crud'}Service<${ClassName}Dao, ${ClassName}> public class ${ClassName}Service extends ${table.isTreeEntity?'Tree':'Crud'}Service<${ClassName}Dao, ${ClassName}>
implements ${ClassName}ServiceApi { implements ${ClassName}ServiceApi {
<% for (child in table.childList){ %> <% for (child in table.childList){ %>
@@ -117,7 +116,7 @@ public class ${ClassName}Service extends ${table.isTreeEntity?'Tree':'Crud'}Serv
*/ */
@Override @Override
@GlobalTransactional @GlobalTransactional
@Transactional(readOnly=false) @Transactional
public void save(${ClassName} ${className}) { public void save(${ClassName} ${className}) {
<% if(toBoolean(table.optionMap['isBpmForm'])){ %> <% if(toBoolean(table.optionMap['isBpmForm'])){ %>
// 如果未设置状态,则指定状态为审核状态,以提交审核流程 // 如果未设置状态,则指定状态为审核状态,以提交审核流程
@@ -195,7 +194,7 @@ public class ${ClassName}Service extends ${table.isTreeEntity?'Tree':'Crud'}Serv
*/ */
@Override @Override
@GlobalTransactional @GlobalTransactional
@Transactional(readOnly=false) @Transactional
public void updateStatus(${ClassName} ${className}) { public void updateStatus(${ClassName} ${className}) {
super.updateStatus(${className}); super.updateStatus(${className});
} }
@@ -206,7 +205,7 @@ public class ${ClassName}Service extends ${table.isTreeEntity?'Tree':'Crud'}Serv
*/ */
@Override @Override
@GlobalTransactional @GlobalTransactional
@Transactional(readOnly=false) @Transactional
public void delete(${ClassName} ${className}) { public void delete(${ClassName} ${className}) {
super.delete(${className}); super.delete(${className});
<% for (child in table.childList) { %> <% for (child in table.childList) { %>

View File

@@ -187,6 +187,7 @@
<style> <style>
table.table td {width:30%;vertical-align:middle!important;} table.table td {width:30%;vertical-align:middle!important;}
table.table th:first-child, table.table td:first-child {width:10%;} table.table th:first-child, table.table td:first-child {width:10%;}
.skin-dark table.table {background-color:#101010!important;color:#8d8d8d!important;}
</style> </style>
<script> <script>
$("#inputForm").validate({ $("#inputForm").validate({

View File

@@ -4,12 +4,6 @@
*/ */
package com.jeesite.modules.test.service; 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.entity.Page;
import com.jeesite.common.idgen.IdGen; import com.jeesite.common.idgen.IdGen;
import com.jeesite.common.lang.DateUtils; 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.dao.TestDataDao;
import com.jeesite.modules.test.entity.TestData; import com.jeesite.modules.test.entity.TestData;
import com.jeesite.modules.test.entity.TestDataChild; 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 * 测试数据Service
@@ -27,7 +26,6 @@ import com.jeesite.modules.test.entity.TestDataChild;
* @version 2018-04-22 * @version 2018-04-22
*/ */
@Service @Service
@Transactional(readOnly=true)
public class TestDataService extends CrudService<TestDataDao, TestData> { public class TestDataService extends CrudService<TestDataDao, TestData> {
@Autowired @Autowired
@@ -85,7 +83,7 @@ public class TestDataService extends CrudService<TestDataDao, TestData> {
* @param testData * @param testData
*/ */
@Override @Override
@Transactional(readOnly=false) @Transactional
public void save(TestData testData) { public void save(TestData testData) {
super.save(testData); super.save(testData);
// 保存上传图片 // 保存上传图片
@@ -119,7 +117,7 @@ public class TestDataService extends CrudService<TestDataDao, TestData> {
* @param testData * @param testData
*/ */
@Override @Override
@Transactional(readOnly=false) @Transactional
public void updateStatus(TestData testData) { public void updateStatus(TestData testData) {
super.updateStatus(testData); super.updateStatus(testData);
} }
@@ -129,7 +127,7 @@ public class TestDataService extends CrudService<TestDataDao, TestData> {
* @param testData * @param testData
*/ */
@Override @Override
@Transactional(readOnly=false) @Transactional
public void delete(TestData testData) { public void delete(TestData testData) {
super.delete(testData); super.delete(testData);
TestDataChild testDataChild = new TestDataChild(); TestDataChild testDataChild = new TestDataChild();
@@ -148,7 +146,7 @@ public class TestDataService extends CrudService<TestDataDao, TestData> {
/** /**
* 事务测试,若 Child 报错,则回滚 * 事务测试,若 Child 报错,则回滚
*/ */
@Transactional(readOnly=false/*, propagation=Propagation.NOT_SUPPORTED*/) @Transactional//(propagation=Propagation.NOT_SUPPORTED)
public void transTest(TestData testData) { public void transTest(TestData testData) {
testData.setTestInput("transTest"); testData.setTestInput("transTest");
testData.setTestTextarea(IdGen.randomBase62(5)); testData.setTestTextarea(IdGen.randomBase62(5));

View File

@@ -20,7 +20,6 @@ import com.jeesite.modules.test.entity.TestTree;
* @version 2018-04-22 * @version 2018-04-22
*/ */
@Service @Service
@Transactional(readOnly=true)
public class TestTreeService extends TreeService<TestTreeDao, TestTree> { public class TestTreeService extends TreeService<TestTreeDao, TestTree> {
/** /**
@@ -48,7 +47,7 @@ public class TestTreeService extends TreeService<TestTreeDao, TestTree> {
* @param testTree * @param testTree
*/ */
@Override @Override
@Transactional(readOnly=false) @Transactional
public void save(TestTree testTree) { public void save(TestTree testTree) {
super.save(testTree); super.save(testTree);
// 保存上传图片 // 保存上传图片
@@ -62,7 +61,7 @@ public class TestTreeService extends TreeService<TestTreeDao, TestTree> {
* @param testTree * @param testTree
*/ */
@Override @Override
@Transactional(readOnly=false) @Transactional
public void updateStatus(TestTree testTree) { public void updateStatus(TestTree testTree) {
super.updateStatus(testTree); super.updateStatus(testTree);
} }
@@ -72,7 +71,7 @@ public class TestTreeService extends TreeService<TestTreeDao, TestTree> {
* @param testTree * @param testTree
*/ */
@Override @Override
@Transactional(readOnly=false) @Transactional
public void delete(TestTree testTree) { public void delete(TestTree testTree) {
super.delete(testTree); super.delete(testTree);
} }