From 85ae3a94203279bcec7cb90405f4d3eddc3bf968 Mon Sep 17 00:00:00 2001 From: 疯狂的狮子li <15040126243@163.com> Date: 星期五, 18 六月 2021 15:31:38 +0800 Subject: [PATCH] update 对相关代码改动 进行调整 --- ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDeptMapper.java | 2 ruoyi-generator/src/main/resources/vm/java/serviceImpl.java.vm | 4 ruoyi-generator/src/main/java/com/ruoyi/generator/service/GenTableColumnServiceImpl.java | 4 ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/impl/SysJobLogServiceImpl.java | 228 +++++----- ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/impl/SysJobServiceImpl.java | 492 +++++++++++----------- ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDictTypeMapper.java | 2 ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictDataServiceImpl.java | 4 ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java | 2 ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictTypeServiceImpl.java | 4 ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysLogininforMapper.java | 2 ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleMapper.java | 2 ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysConfigServiceImpl.java | 4 ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserPostMapper.java | 12 ruoyi-system/src/main/java/com/ruoyi/system/service/ISysLogininforService.java | 2 ruoyi-generator/src/main/resources/vm/java/service.java.vm | 2 ruoyi-system/src/main/resources/mapper/system/SysUserRoleMapper.xml | 7 ruoyi-quartz/src/main/java/com/ruoyi/quartz/mapper/SysJobLogMapper.java | 26 ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/ISysJobLogService.java | 124 ++-- ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysConfigMapper.java | 2 ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysPostMapper.java | 2 ruoyi-generator/src/main/java/com/ruoyi/generator/service/IGenTableService.java | 2 ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDictDataService.java | 2 ruoyi-system/src/main/java/com/ruoyi/system/service/ISysNoticeService.java | 2 ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysNoticeServiceImpl.java | 4 ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysMenuMapper.java | 2 ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java | 4 ruoyi-quartz/src/main/java/com/ruoyi/quartz/mapper/SysJobMapper.java | 26 ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/ISysJobService.java | 212 ++++---- ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysLogininforServiceImpl.java | 4 ruoyi-generator/src/main/java/com/ruoyi/generator/mapper/GenTableMapper.java | 2 ruoyi-system/src/main/java/com/ruoyi/system/service/ISysOperLogService.java | 2 ruoyi-system/src/main/java/com/ruoyi/system/service/ISysPostService.java | 2 ruoyi-demo/src/main/java/com/ruoyi/demo/service/ITestTreeService.java | 2 ruoyi-generator/src/main/java/com/ruoyi/generator/service/GenTableServiceImpl.java | 4 ruoyi-system/src/main/java/com/ruoyi/system/service/ISysConfigService.java | 2 ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDictTypeService.java | 2 ruoyi-system/src/main/java/com/ruoyi/system/service/ISysUserService.java | 2 ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysPostServiceImpl.java | 4 ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysOperLogServiceImpl.java | 4 ruoyi-system/src/main/resources/mapper/system/SysUserPostMapper.xml | 7 ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java | 4 ruoyi-demo/src/main/java/com/ruoyi/demo/service/ITestDemoService.java | 2 ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysNoticeMapper.java | 2 ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleMenuMapper.java | 12 ruoyi-generator/src/main/java/com/ruoyi/generator/mapper/GenTableColumnMapper.java | 2 ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDeptService.java | 2 ruoyi-generator/src/main/java/com/ruoyi/generator/service/IGenTableColumnService.java | 2 ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDictDataMapper.java | 2 ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserRoleMapper.java | 12 ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleDeptMapper.java | 12 ruoyi-system/src/main/resources/mapper/system/SysRoleDeptMapper.xml | 7 ruoyi-generator/src/main/resources/vm/java/mapper.java.vm | 4 ruoyi-system/src/main/resources/mapper/system/SysRoleMenuMapper.xml | 7 ruoyi-system/src/main/java/com/ruoyi/system/service/ISysRoleService.java | 2 ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java | 8 ruoyi-system/src/main/java/com/ruoyi/system/service/ISysMenuService.java | 2 ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java | 8 ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysOperLogMapper.java | 2 58 files changed, 621 insertions(+), 689 deletions(-) diff --git a/ruoyi-demo/src/main/java/com/ruoyi/demo/service/ITestDemoService.java b/ruoyi-demo/src/main/java/com/ruoyi/demo/service/ITestDemoService.java index 7f08668..3ab87ef 100644 --- a/ruoyi-demo/src/main/java/com/ruoyi/demo/service/ITestDemoService.java +++ b/ruoyi-demo/src/main/java/com/ruoyi/demo/service/ITestDemoService.java @@ -5,7 +5,7 @@ import com.ruoyi.demo.bo.TestDemoQueryBo; import com.ruoyi.demo.bo.TestDemoAddBo; import com.ruoyi.demo.bo.TestDemoEditBo; -import com.ruoyi.common.core.page.IServicePlus; +import com.ruoyi.common.core.mybatisplus.core.IServicePlus; import com.ruoyi.common.core.page.TableDataInfo; import java.util.Collection; diff --git a/ruoyi-demo/src/main/java/com/ruoyi/demo/service/ITestTreeService.java b/ruoyi-demo/src/main/java/com/ruoyi/demo/service/ITestTreeService.java index 605b3df..6f7be37 100644 --- a/ruoyi-demo/src/main/java/com/ruoyi/demo/service/ITestTreeService.java +++ b/ruoyi-demo/src/main/java/com/ruoyi/demo/service/ITestTreeService.java @@ -1,6 +1,6 @@ package com.ruoyi.demo.service; -import com.ruoyi.common.core.page.IServicePlus; +import com.ruoyi.common.core.mybatisplus.core.IServicePlus; import com.ruoyi.demo.bo.TestTreeAddBo; import com.ruoyi.demo.bo.TestTreeEditBo; import com.ruoyi.demo.bo.TestTreeQueryBo; diff --git a/ruoyi-generator/src/main/java/com/ruoyi/generator/mapper/GenTableColumnMapper.java b/ruoyi-generator/src/main/java/com/ruoyi/generator/mapper/GenTableColumnMapper.java index 5a2691a..dc51009 100644 --- a/ruoyi-generator/src/main/java/com/ruoyi/generator/mapper/GenTableColumnMapper.java +++ b/ruoyi-generator/src/main/java/com/ruoyi/generator/mapper/GenTableColumnMapper.java @@ -1,6 +1,6 @@ package com.ruoyi.generator.mapper; -import com.ruoyi.common.core.page.BaseMapperPlus; +import com.ruoyi.common.core.mybatisplus.core.BaseMapperPlus; import com.ruoyi.generator.domain.GenTableColumn; import java.util.List; diff --git a/ruoyi-generator/src/main/java/com/ruoyi/generator/mapper/GenTableMapper.java b/ruoyi-generator/src/main/java/com/ruoyi/generator/mapper/GenTableMapper.java index 85da309..3d3e4b9 100644 --- a/ruoyi-generator/src/main/java/com/ruoyi/generator/mapper/GenTableMapper.java +++ b/ruoyi-generator/src/main/java/com/ruoyi/generator/mapper/GenTableMapper.java @@ -1,7 +1,7 @@ package com.ruoyi.generator.mapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.ruoyi.common.core.page.BaseMapperPlus; +import com.ruoyi.common.core.mybatisplus.core.BaseMapperPlus; import com.ruoyi.generator.domain.GenTable; import org.apache.ibatis.annotations.Param; diff --git a/ruoyi-generator/src/main/java/com/ruoyi/generator/service/GenTableColumnServiceImpl.java b/ruoyi-generator/src/main/java/com/ruoyi/generator/service/GenTableColumnServiceImpl.java index 40f0738..44baf82 100644 --- a/ruoyi-generator/src/main/java/com/ruoyi/generator/service/GenTableColumnServiceImpl.java +++ b/ruoyi-generator/src/main/java/com/ruoyi/generator/service/GenTableColumnServiceImpl.java @@ -1,7 +1,7 @@ package com.ruoyi.generator.service; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl; import com.ruoyi.generator.domain.GenTableColumn; import com.ruoyi.generator.mapper.GenTableColumnMapper; import org.springframework.stereotype.Service; @@ -15,7 +15,7 @@ * @author ruoyi */ @Service -public class GenTableColumnServiceImpl extends ServiceImpl<GenTableColumnMapper, GenTableColumn> implements IGenTableColumnService { +public class GenTableColumnServiceImpl extends ServicePlusImpl<GenTableColumnMapper, GenTableColumn> implements IGenTableColumnService { /** * 鏌ヨ涓氬姟瀛楁鍒楄〃 diff --git a/ruoyi-generator/src/main/java/com/ruoyi/generator/service/GenTableServiceImpl.java b/ruoyi-generator/src/main/java/com/ruoyi/generator/service/GenTableServiceImpl.java index 619bab4..4da27e8 100644 --- a/ruoyi-generator/src/main/java/com/ruoyi/generator/service/GenTableServiceImpl.java +++ b/ruoyi-generator/src/main/java/com/ruoyi/generator/service/GenTableServiceImpl.java @@ -6,9 +6,9 @@ import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.common.constant.Constants; import com.ruoyi.common.constant.GenConstants; +import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl; import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.exception.CustomException; import com.ruoyi.common.utils.JsonUtils; @@ -50,7 +50,7 @@ */ @Slf4j @Service -public class GenTableServiceImpl extends ServiceImpl<GenTableMapper, GenTable> implements IGenTableService { +public class GenTableServiceImpl extends ServicePlusImpl<GenTableMapper, GenTable> implements IGenTableService { @Autowired private GenTableColumnMapper genTableColumnMapper; diff --git a/ruoyi-generator/src/main/java/com/ruoyi/generator/service/IGenTableColumnService.java b/ruoyi-generator/src/main/java/com/ruoyi/generator/service/IGenTableColumnService.java index 22946f2..38d3854 100644 --- a/ruoyi-generator/src/main/java/com/ruoyi/generator/service/IGenTableColumnService.java +++ b/ruoyi-generator/src/main/java/com/ruoyi/generator/service/IGenTableColumnService.java @@ -1,6 +1,6 @@ package com.ruoyi.generator.service; -import com.ruoyi.common.core.page.IServicePlus; +import com.ruoyi.common.core.mybatisplus.core.IServicePlus; import com.ruoyi.generator.domain.GenTableColumn; import java.util.List; diff --git a/ruoyi-generator/src/main/java/com/ruoyi/generator/service/IGenTableService.java b/ruoyi-generator/src/main/java/com/ruoyi/generator/service/IGenTableService.java index cbfeae4..a44dd5e 100644 --- a/ruoyi-generator/src/main/java/com/ruoyi/generator/service/IGenTableService.java +++ b/ruoyi-generator/src/main/java/com/ruoyi/generator/service/IGenTableService.java @@ -1,6 +1,6 @@ package com.ruoyi.generator.service; -import com.ruoyi.common.core.page.IServicePlus; +import com.ruoyi.common.core.mybatisplus.core.IServicePlus; import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.generator.domain.GenTable; diff --git a/ruoyi-generator/src/main/resources/vm/java/mapper.java.vm b/ruoyi-generator/src/main/resources/vm/java/mapper.java.vm index 36a9864..9bf8b28 100644 --- a/ruoyi-generator/src/main/resources/vm/java/mapper.java.vm +++ b/ruoyi-generator/src/main/resources/vm/java/mapper.java.vm @@ -1,8 +1,8 @@ package ${packageName}.mapper; import ${packageName}.domain.${ClassName}; -import com.ruoyi.common.core.page.BaseMapperPlus; -import com.ruoyi.common.core.mybatisplus.MybatisPlusRedisCache; +import com.ruoyi.common.core.mybatisplus.core.BaseMapperPlus; +import com.ruoyi.common.core.mybatisplus.cache.MybatisPlusRedisCache; import org.apache.ibatis.annotations.CacheNamespace; /** diff --git a/ruoyi-generator/src/main/resources/vm/java/service.java.vm b/ruoyi-generator/src/main/resources/vm/java/service.java.vm index 67e6baf..9ae8620 100644 --- a/ruoyi-generator/src/main/resources/vm/java/service.java.vm +++ b/ruoyi-generator/src/main/resources/vm/java/service.java.vm @@ -5,7 +5,7 @@ import ${packageName}.bo.${ClassName}QueryBo; import ${packageName}.bo.${ClassName}AddBo; import ${packageName}.bo.${ClassName}EditBo; -import com.ruoyi.common.core.page.IServicePlus; +import com.ruoyi.common.core.mybatisplus.core.IServicePlus; #if($table.crud || $table.sub) import com.ruoyi.common.core.page.TableDataInfo; #end diff --git a/ruoyi-generator/src/main/resources/vm/java/serviceImpl.java.vm b/ruoyi-generator/src/main/resources/vm/java/serviceImpl.java.vm index 9802b29..2421f31 100644 --- a/ruoyi-generator/src/main/resources/vm/java/serviceImpl.java.vm +++ b/ruoyi-generator/src/main/resources/vm/java/serviceImpl.java.vm @@ -8,7 +8,7 @@ import com.ruoyi.common.core.page.TableDataInfo; #end import org.springframework.stereotype.Service; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import ${packageName}.bo.${ClassName}AddBo; @@ -30,7 +30,7 @@ * @date ${datetime} */ @Service -public class ${ClassName}ServiceImpl extends ServiceImpl<${ClassName}Mapper, ${ClassName}> implements I${ClassName}Service { +public class ${ClassName}ServiceImpl extends ServicePlusImpl<${ClassName}Mapper, ${ClassName}> implements I${ClassName}Service { @Override public ${ClassName}Vo queryById(${pkColumn.javaType} ${pkColumn.javaField}){ diff --git a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/mapper/SysJobLogMapper.java b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/mapper/SysJobLogMapper.java index 03d4501..fe1a059 100644 --- a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/mapper/SysJobLogMapper.java +++ b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/mapper/SysJobLogMapper.java @@ -1,13 +1,13 @@ -package com.ruoyi.quartz.mapper; - -import com.ruoyi.common.core.page.BaseMapperPlus; -import com.ruoyi.quartz.domain.SysJobLog; - -/** - * 璋冨害浠诲姟鏃ュ織淇℃伅 鏁版嵁灞� - * - * @author ruoyi - */ -public interface SysJobLogMapper extends BaseMapperPlus<SysJobLog> { - -} +package com.ruoyi.quartz.mapper; + +import com.ruoyi.common.core.mybatisplus.core.BaseMapperPlus; +import com.ruoyi.quartz.domain.SysJobLog; + +/** + * 璋冨害浠诲姟鏃ュ織淇℃伅 鏁版嵁灞� + * + * @author ruoyi + */ +public interface SysJobLogMapper extends BaseMapperPlus<SysJobLog> { + +} diff --git a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/mapper/SysJobMapper.java b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/mapper/SysJobMapper.java index 8e73f0a..14566b4 100644 --- a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/mapper/SysJobMapper.java +++ b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/mapper/SysJobMapper.java @@ -1,13 +1,13 @@ -package com.ruoyi.quartz.mapper; - -import com.ruoyi.common.core.page.BaseMapperPlus; -import com.ruoyi.quartz.domain.SysJob; - -/** - * 璋冨害浠诲姟淇℃伅 鏁版嵁灞� - * - * @author ruoyi - */ -public interface SysJobMapper extends BaseMapperPlus<SysJob> { - -} +package com.ruoyi.quartz.mapper; + +import com.ruoyi.common.core.mybatisplus.core.BaseMapperPlus; +import com.ruoyi.quartz.domain.SysJob; + +/** + * 璋冨害浠诲姟淇℃伅 鏁版嵁灞� + * + * @author ruoyi + */ +public interface SysJobMapper extends BaseMapperPlus<SysJob> { + +} diff --git a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/ISysJobLogService.java b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/ISysJobLogService.java index 6b51886..cb5b7d5 100644 --- a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/ISysJobLogService.java +++ b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/ISysJobLogService.java @@ -1,62 +1,62 @@ -package com.ruoyi.quartz.service; - -import com.ruoyi.common.core.page.IServicePlus; -import com.ruoyi.common.core.page.TableDataInfo; -import com.ruoyi.quartz.domain.SysJobLog; - -import java.util.List; - -/** - * 瀹氭椂浠诲姟璋冨害鏃ュ織淇℃伅淇℃伅 鏈嶅姟灞� - * - * @author ruoyi - */ -public interface ISysJobLogService extends IServicePlus<SysJobLog> { - - - TableDataInfo<SysJobLog> selectPageJobLogList(SysJobLog jobLog); - - /** - * 鑾峰彇quartz璋冨害鍣ㄦ棩蹇楃殑璁″垝浠诲姟 - * - * @param jobLog 璋冨害鏃ュ織淇℃伅 - * @return 璋冨害浠诲姟鏃ュ織闆嗗悎 - */ - public List<SysJobLog> selectJobLogList(SysJobLog jobLog); - - /** - * 閫氳繃璋冨害浠诲姟鏃ュ織ID鏌ヨ璋冨害淇℃伅 - * - * @param jobLogId 璋冨害浠诲姟鏃ュ織ID - * @return 璋冨害浠诲姟鏃ュ織瀵硅薄淇℃伅 - */ - public SysJobLog selectJobLogById(Long jobLogId); - - /** - * 鏂板浠诲姟鏃ュ織 - * - * @param jobLog 璋冨害鏃ュ織淇℃伅 - */ - public void addJobLog(SysJobLog jobLog); - - /** - * 鎵归噺鍒犻櫎璋冨害鏃ュ織淇℃伅 - * - * @param logIds 闇�瑕佸垹闄ょ殑鏃ュ織ID - * @return 缁撴灉 - */ - public int deleteJobLogByIds(Long[] logIds); - - /** - * 鍒犻櫎浠诲姟鏃ュ織 - * - * @param jobId 璋冨害鏃ュ織ID - * @return 缁撴灉 - */ - public int deleteJobLogById(Long jobId); - - /** - * 娓呯┖浠诲姟鏃ュ織 - */ - public void cleanJobLog(); -} +package com.ruoyi.quartz.service; + +import com.ruoyi.common.core.mybatisplus.core.IServicePlus; +import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.quartz.domain.SysJobLog; + +import java.util.List; + +/** + * 瀹氭椂浠诲姟璋冨害鏃ュ織淇℃伅淇℃伅 鏈嶅姟灞� + * + * @author ruoyi + */ +public interface ISysJobLogService extends IServicePlus<SysJobLog> { + + + TableDataInfo<SysJobLog> selectPageJobLogList(SysJobLog jobLog); + + /** + * 鑾峰彇quartz璋冨害鍣ㄦ棩蹇楃殑璁″垝浠诲姟 + * + * @param jobLog 璋冨害鏃ュ織淇℃伅 + * @return 璋冨害浠诲姟鏃ュ織闆嗗悎 + */ + public List<SysJobLog> selectJobLogList(SysJobLog jobLog); + + /** + * 閫氳繃璋冨害浠诲姟鏃ュ織ID鏌ヨ璋冨害淇℃伅 + * + * @param jobLogId 璋冨害浠诲姟鏃ュ織ID + * @return 璋冨害浠诲姟鏃ュ織瀵硅薄淇℃伅 + */ + public SysJobLog selectJobLogById(Long jobLogId); + + /** + * 鏂板浠诲姟鏃ュ織 + * + * @param jobLog 璋冨害鏃ュ織淇℃伅 + */ + public void addJobLog(SysJobLog jobLog); + + /** + * 鎵归噺鍒犻櫎璋冨害鏃ュ織淇℃伅 + * + * @param logIds 闇�瑕佸垹闄ょ殑鏃ュ織ID + * @return 缁撴灉 + */ + public int deleteJobLogByIds(Long[] logIds); + + /** + * 鍒犻櫎浠诲姟鏃ュ織 + * + * @param jobId 璋冨害鏃ュ織ID + * @return 缁撴灉 + */ + public int deleteJobLogById(Long jobId); + + /** + * 娓呯┖浠诲姟鏃ュ織 + */ + public void cleanJobLog(); +} diff --git a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/ISysJobService.java b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/ISysJobService.java index fbbf4c5..11150c7 100644 --- a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/ISysJobService.java +++ b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/ISysJobService.java @@ -1,106 +1,106 @@ -package com.ruoyi.quartz.service; - -import com.ruoyi.common.core.page.IServicePlus; -import com.ruoyi.common.core.page.TableDataInfo; -import com.ruoyi.common.exception.job.TaskException; -import com.ruoyi.quartz.domain.SysJob; -import org.quartz.SchedulerException; - -import java.util.List; - -/** - * 瀹氭椂浠诲姟璋冨害淇℃伅淇℃伅 鏈嶅姟灞� - * - * @author ruoyi - */ -public interface ISysJobService extends IServicePlus<SysJob> { - /** - * 鑾峰彇quartz璋冨害鍣ㄧ殑璁″垝浠诲姟 - * - * @param job 璋冨害淇℃伅 - * @return 璋冨害浠诲姟闆嗗悎 - */ - public TableDataInfo<SysJob> selectPageJobList(SysJob job); - - public List<SysJob> selectJobList(SysJob job); - - /** - * 閫氳繃璋冨害浠诲姟ID鏌ヨ璋冨害淇℃伅 - * - * @param jobId 璋冨害浠诲姟ID - * @return 璋冨害浠诲姟瀵硅薄淇℃伅 - */ - public SysJob selectJobById(Long jobId); - - /** - * 鏆傚仠浠诲姟 - * - * @param job 璋冨害淇℃伅 - * @return 缁撴灉 - */ - public int pauseJob(SysJob job) throws SchedulerException; - - /** - * 鎭㈠浠诲姟 - * - * @param job 璋冨害淇℃伅 - * @return 缁撴灉 - */ - public int resumeJob(SysJob job) throws SchedulerException; - - /** - * 鍒犻櫎浠诲姟鍚庯紝鎵�瀵瑰簲鐨則rigger涔熷皢琚垹闄� - * - * @param job 璋冨害淇℃伅 - * @return 缁撴灉 - */ - public int deleteJob(SysJob job) throws SchedulerException; - - /** - * 鎵归噺鍒犻櫎璋冨害淇℃伅 - * - * @param jobIds 闇�瑕佸垹闄ょ殑浠诲姟ID - * @return 缁撴灉 - */ - public void deleteJobByIds(Long[] jobIds) throws SchedulerException; - - /** - * 浠诲姟璋冨害鐘舵�佷慨鏀� - * - * @param job 璋冨害淇℃伅 - * @return 缁撴灉 - */ - public int changeStatus(SysJob job) throws SchedulerException; - - /** - * 绔嬪嵆杩愯浠诲姟 - * - * @param job 璋冨害淇℃伅 - * @return 缁撴灉 - */ - public void run(SysJob job) throws SchedulerException; - - /** - * 鏂板浠诲姟 - * - * @param job 璋冨害淇℃伅 - * @return 缁撴灉 - */ - public int insertJob(SysJob job) throws SchedulerException, TaskException; - - /** - * 鏇存柊浠诲姟 - * - * @param job 璋冨害淇℃伅 - * @return 缁撴灉 - */ - public int updateJob(SysJob job) throws SchedulerException, TaskException; - - /** - * 鏍¢獙cron琛ㄨ揪寮忔槸鍚︽湁鏁� - * - * @param cronExpression 琛ㄨ揪寮� - * @return 缁撴灉 - */ - public boolean checkCronExpressionIsValid(String cronExpression); -} +package com.ruoyi.quartz.service; + +import com.ruoyi.common.core.mybatisplus.core.IServicePlus; +import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.common.exception.job.TaskException; +import com.ruoyi.quartz.domain.SysJob; +import org.quartz.SchedulerException; + +import java.util.List; + +/** + * 瀹氭椂浠诲姟璋冨害淇℃伅淇℃伅 鏈嶅姟灞� + * + * @author ruoyi + */ +public interface ISysJobService extends IServicePlus<SysJob> { + /** + * 鑾峰彇quartz璋冨害鍣ㄧ殑璁″垝浠诲姟 + * + * @param job 璋冨害淇℃伅 + * @return 璋冨害浠诲姟闆嗗悎 + */ + public TableDataInfo<SysJob> selectPageJobList(SysJob job); + + public List<SysJob> selectJobList(SysJob job); + + /** + * 閫氳繃璋冨害浠诲姟ID鏌ヨ璋冨害淇℃伅 + * + * @param jobId 璋冨害浠诲姟ID + * @return 璋冨害浠诲姟瀵硅薄淇℃伅 + */ + public SysJob selectJobById(Long jobId); + + /** + * 鏆傚仠浠诲姟 + * + * @param job 璋冨害淇℃伅 + * @return 缁撴灉 + */ + public int pauseJob(SysJob job) throws SchedulerException; + + /** + * 鎭㈠浠诲姟 + * + * @param job 璋冨害淇℃伅 + * @return 缁撴灉 + */ + public int resumeJob(SysJob job) throws SchedulerException; + + /** + * 鍒犻櫎浠诲姟鍚庯紝鎵�瀵瑰簲鐨則rigger涔熷皢琚垹闄� + * + * @param job 璋冨害淇℃伅 + * @return 缁撴灉 + */ + public int deleteJob(SysJob job) throws SchedulerException; + + /** + * 鎵归噺鍒犻櫎璋冨害淇℃伅 + * + * @param jobIds 闇�瑕佸垹闄ょ殑浠诲姟ID + * @return 缁撴灉 + */ + public void deleteJobByIds(Long[] jobIds) throws SchedulerException; + + /** + * 浠诲姟璋冨害鐘舵�佷慨鏀� + * + * @param job 璋冨害淇℃伅 + * @return 缁撴灉 + */ + public int changeStatus(SysJob job) throws SchedulerException; + + /** + * 绔嬪嵆杩愯浠诲姟 + * + * @param job 璋冨害淇℃伅 + * @return 缁撴灉 + */ + public void run(SysJob job) throws SchedulerException; + + /** + * 鏂板浠诲姟 + * + * @param job 璋冨害淇℃伅 + * @return 缁撴灉 + */ + public int insertJob(SysJob job) throws SchedulerException, TaskException; + + /** + * 鏇存柊浠诲姟 + * + * @param job 璋冨害淇℃伅 + * @return 缁撴灉 + */ + public int updateJob(SysJob job) throws SchedulerException, TaskException; + + /** + * 鏍¢獙cron琛ㄨ揪寮忔槸鍚︽湁鏁� + * + * @param cronExpression 琛ㄨ揪寮� + * @return 缁撴灉 + */ + public boolean checkCronExpressionIsValid(String cronExpression); +} diff --git a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/impl/SysJobLogServiceImpl.java b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/impl/SysJobLogServiceImpl.java index 28c9d8a..e10ad14 100644 --- a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/impl/SysJobLogServiceImpl.java +++ b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/impl/SysJobLogServiceImpl.java @@ -1,114 +1,114 @@ -package com.ruoyi.quartz.service.impl; - -import cn.hutool.core.lang.Validator; -import cn.hutool.core.util.StrUtil; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.ruoyi.common.core.page.TableDataInfo; -import com.ruoyi.common.utils.PageUtils; -import com.ruoyi.quartz.domain.SysJobLog; -import com.ruoyi.quartz.mapper.SysJobLogMapper; -import com.ruoyi.quartz.service.ISysJobLogService; -import org.springframework.stereotype.Service; - -import java.util.Arrays; -import java.util.List; -import java.util.Map; - -/** - * 瀹氭椂浠诲姟璋冨害鏃ュ織淇℃伅 鏈嶅姟灞� - * - * @author ruoyi - */ -@Service -public class SysJobLogServiceImpl extends ServiceImpl<SysJobLogMapper, SysJobLog> implements ISysJobLogService { - - @Override - public TableDataInfo<SysJobLog> selectPageJobLogList(SysJobLog jobLog) { - Map<String, Object> params = jobLog.getParams(); - LambdaQueryWrapper<SysJobLog> lqw = new LambdaQueryWrapper<SysJobLog>() - .like(StrUtil.isNotBlank(jobLog.getJobName()), SysJobLog::getJobName, jobLog.getJobName()) - .eq(StrUtil.isNotBlank(jobLog.getJobGroup()), SysJobLog::getJobGroup, jobLog.getJobGroup()) - .eq(StrUtil.isNotBlank(jobLog.getStatus()), SysJobLog::getStatus, jobLog.getStatus()) - .like(StrUtil.isNotBlank(jobLog.getInvokeTarget()), SysJobLog::getInvokeTarget, jobLog.getInvokeTarget()) - .apply(Validator.isNotEmpty(params.get("beginTime")), - "date_format(create_time,'%y%m%d') >= date_format({0},'%y%m%d')", - params.get("beginTime")) - .apply(Validator.isNotEmpty(params.get("endTime")), - "date_format(create_time,'%y%m%d') <= date_format({0},'%y%m%d')", - params.get("endTime")); - return PageUtils.buildDataInfo(page(PageUtils.buildPage(), lqw)); - } - - /** - * 鑾峰彇quartz璋冨害鍣ㄦ棩蹇楃殑璁″垝浠诲姟 - * - * @param jobLog 璋冨害鏃ュ織淇℃伅 - * @return 璋冨害浠诲姟鏃ュ織闆嗗悎 - */ - @Override - public List<SysJobLog> selectJobLogList(SysJobLog jobLog) { - Map<String, Object> params = jobLog.getParams(); - return list(new LambdaQueryWrapper<SysJobLog>() - .like(StrUtil.isNotBlank(jobLog.getJobName()), SysJobLog::getJobName, jobLog.getJobName()) - .eq(StrUtil.isNotBlank(jobLog.getJobGroup()), SysJobLog::getJobGroup, jobLog.getJobGroup()) - .eq(StrUtil.isNotBlank(jobLog.getStatus()), SysJobLog::getStatus, jobLog.getStatus()) - .like(StrUtil.isNotBlank(jobLog.getInvokeTarget()), SysJobLog::getInvokeTarget, jobLog.getInvokeTarget()) - .apply(Validator.isNotEmpty(params.get("beginTime")), - "date_format(create_time,'%y%m%d') >= date_format({0},'%y%m%d')", - params.get("beginTime")) - .apply(Validator.isNotEmpty(params.get("endTime")), - "date_format(create_time,'%y%m%d') <= date_format({0},'%y%m%d')", - params.get("endTime"))); - } - - /** - * 閫氳繃璋冨害浠诲姟鏃ュ織ID鏌ヨ璋冨害淇℃伅 - * - * @param jobLogId 璋冨害浠诲姟鏃ュ織ID - * @return 璋冨害浠诲姟鏃ュ織瀵硅薄淇℃伅 - */ - @Override - public SysJobLog selectJobLogById(Long jobLogId) { - return getById(jobLogId); - } - - /** - * 鏂板浠诲姟鏃ュ織 - * - * @param jobLog 璋冨害鏃ュ織淇℃伅 - */ - @Override - public void addJobLog(SysJobLog jobLog) { - baseMapper.insert(jobLog); - } - - /** - * 鎵归噺鍒犻櫎璋冨害鏃ュ織淇℃伅 - * - * @param logIds 闇�瑕佸垹闄ょ殑鏁版嵁ID - * @return 缁撴灉 - */ - @Override - public int deleteJobLogByIds(Long[] logIds) { - return baseMapper.deleteBatchIds(Arrays.asList(logIds)); - } - - /** - * 鍒犻櫎浠诲姟鏃ュ織 - * - * @param jobId 璋冨害鏃ュ織ID - */ - @Override - public int deleteJobLogById(Long jobId) { - return baseMapper.deleteById(jobId); - } - - /** - * 娓呯┖浠诲姟鏃ュ織 - */ - @Override - public void cleanJobLog() { - remove(new LambdaQueryWrapper<>()); - } -} +package com.ruoyi.quartz.service.impl; + +import cn.hutool.core.lang.Validator; +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl; +import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.common.utils.PageUtils; +import com.ruoyi.quartz.domain.SysJobLog; +import com.ruoyi.quartz.mapper.SysJobLogMapper; +import com.ruoyi.quartz.service.ISysJobLogService; +import org.springframework.stereotype.Service; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 瀹氭椂浠诲姟璋冨害鏃ュ織淇℃伅 鏈嶅姟灞� + * + * @author ruoyi + */ +@Service +public class SysJobLogServiceImpl extends ServicePlusImpl<SysJobLogMapper, SysJobLog> implements ISysJobLogService { + + @Override + public TableDataInfo<SysJobLog> selectPageJobLogList(SysJobLog jobLog) { + Map<String, Object> params = jobLog.getParams(); + LambdaQueryWrapper<SysJobLog> lqw = new LambdaQueryWrapper<SysJobLog>() + .like(StrUtil.isNotBlank(jobLog.getJobName()), SysJobLog::getJobName, jobLog.getJobName()) + .eq(StrUtil.isNotBlank(jobLog.getJobGroup()), SysJobLog::getJobGroup, jobLog.getJobGroup()) + .eq(StrUtil.isNotBlank(jobLog.getStatus()), SysJobLog::getStatus, jobLog.getStatus()) + .like(StrUtil.isNotBlank(jobLog.getInvokeTarget()), SysJobLog::getInvokeTarget, jobLog.getInvokeTarget()) + .apply(Validator.isNotEmpty(params.get("beginTime")), + "date_format(create_time,'%y%m%d') >= date_format({0},'%y%m%d')", + params.get("beginTime")) + .apply(Validator.isNotEmpty(params.get("endTime")), + "date_format(create_time,'%y%m%d') <= date_format({0},'%y%m%d')", + params.get("endTime")); + return PageUtils.buildDataInfo(page(PageUtils.buildPage(), lqw)); + } + + /** + * 鑾峰彇quartz璋冨害鍣ㄦ棩蹇楃殑璁″垝浠诲姟 + * + * @param jobLog 璋冨害鏃ュ織淇℃伅 + * @return 璋冨害浠诲姟鏃ュ織闆嗗悎 + */ + @Override + public List<SysJobLog> selectJobLogList(SysJobLog jobLog) { + Map<String, Object> params = jobLog.getParams(); + return list(new LambdaQueryWrapper<SysJobLog>() + .like(StrUtil.isNotBlank(jobLog.getJobName()), SysJobLog::getJobName, jobLog.getJobName()) + .eq(StrUtil.isNotBlank(jobLog.getJobGroup()), SysJobLog::getJobGroup, jobLog.getJobGroup()) + .eq(StrUtil.isNotBlank(jobLog.getStatus()), SysJobLog::getStatus, jobLog.getStatus()) + .like(StrUtil.isNotBlank(jobLog.getInvokeTarget()), SysJobLog::getInvokeTarget, jobLog.getInvokeTarget()) + .apply(Validator.isNotEmpty(params.get("beginTime")), + "date_format(create_time,'%y%m%d') >= date_format({0},'%y%m%d')", + params.get("beginTime")) + .apply(Validator.isNotEmpty(params.get("endTime")), + "date_format(create_time,'%y%m%d') <= date_format({0},'%y%m%d')", + params.get("endTime"))); + } + + /** + * 閫氳繃璋冨害浠诲姟鏃ュ織ID鏌ヨ璋冨害淇℃伅 + * + * @param jobLogId 璋冨害浠诲姟鏃ュ織ID + * @return 璋冨害浠诲姟鏃ュ織瀵硅薄淇℃伅 + */ + @Override + public SysJobLog selectJobLogById(Long jobLogId) { + return getById(jobLogId); + } + + /** + * 鏂板浠诲姟鏃ュ織 + * + * @param jobLog 璋冨害鏃ュ織淇℃伅 + */ + @Override + public void addJobLog(SysJobLog jobLog) { + baseMapper.insert(jobLog); + } + + /** + * 鎵归噺鍒犻櫎璋冨害鏃ュ織淇℃伅 + * + * @param logIds 闇�瑕佸垹闄ょ殑鏁版嵁ID + * @return 缁撴灉 + */ + @Override + public int deleteJobLogByIds(Long[] logIds) { + return baseMapper.deleteBatchIds(Arrays.asList(logIds)); + } + + /** + * 鍒犻櫎浠诲姟鏃ュ織 + * + * @param jobId 璋冨害鏃ュ織ID + */ + @Override + public int deleteJobLogById(Long jobId) { + return baseMapper.deleteById(jobId); + } + + /** + * 娓呯┖浠诲姟鏃ュ織 + */ + @Override + public void cleanJobLog() { + remove(new LambdaQueryWrapper<>()); + } +} diff --git a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/impl/SysJobServiceImpl.java b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/impl/SysJobServiceImpl.java index 9b97b4f..7d111d7 100644 --- a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/impl/SysJobServiceImpl.java +++ b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/impl/SysJobServiceImpl.java @@ -1,246 +1,246 @@ -package com.ruoyi.quartz.service.impl; - -import cn.hutool.core.util.StrUtil; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.ruoyi.common.constant.ScheduleConstants; -import com.ruoyi.common.core.page.TableDataInfo; -import com.ruoyi.common.exception.job.TaskException; -import com.ruoyi.common.utils.PageUtils; -import com.ruoyi.quartz.domain.SysJob; -import com.ruoyi.quartz.mapper.SysJobMapper; -import com.ruoyi.quartz.service.ISysJobService; -import com.ruoyi.quartz.util.CronUtils; -import com.ruoyi.quartz.util.ScheduleUtils; -import org.quartz.JobDataMap; -import org.quartz.JobKey; -import org.quartz.Scheduler; -import org.quartz.SchedulerException; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import javax.annotation.PostConstruct; -import java.util.List; - -/** - * 瀹氭椂浠诲姟璋冨害淇℃伅 鏈嶅姟灞� - * - * @author ruoyi - */ -@Service -public class SysJobServiceImpl extends ServiceImpl<SysJobMapper, SysJob> implements ISysJobService { - @Autowired - private Scheduler scheduler; - - /** - * 椤圭洰鍚姩鏃讹紝鍒濆鍖栧畾鏃跺櫒 涓昏鏄槻姝㈡墜鍔ㄤ慨鏀规暟鎹簱瀵艰嚧鏈悓姝ュ埌瀹氭椂浠诲姟澶勭悊锛堟敞锛氫笉鑳芥墜鍔ㄤ慨鏀规暟鎹簱ID鍜屼换鍔$粍鍚嶏紝鍚﹀垯浼氬鑷磋剰鏁版嵁锛� - */ - @PostConstruct - public void init() throws SchedulerException, TaskException { - scheduler.clear(); - List<SysJob> jobList = list(); - for (SysJob job : jobList) { - ScheduleUtils.createScheduleJob(scheduler, job); - } - } - - @Override - public TableDataInfo<SysJob> selectPageJobList(SysJob job) { - LambdaQueryWrapper<SysJob> lqw = new LambdaQueryWrapper<SysJob>() - .like(StrUtil.isNotBlank(job.getJobName()), SysJob::getJobName, job.getJobName()) - .eq(StrUtil.isNotBlank(job.getJobGroup()), SysJob::getJobGroup, job.getJobGroup()) - .eq(StrUtil.isNotBlank(job.getStatus()), SysJob::getStatus, job.getStatus()) - .like(StrUtil.isNotBlank(job.getInvokeTarget()), SysJob::getInvokeTarget, job.getInvokeTarget()); - return PageUtils.buildDataInfo(page(PageUtils.buildPage(), lqw)); - } - - /** - * 鑾峰彇quartz璋冨害鍣ㄧ殑璁″垝浠诲姟鍒楄〃 - * - * @param job 璋冨害淇℃伅 - * @return - */ - @Override - public List<SysJob> selectJobList(SysJob job) { - return list(new LambdaQueryWrapper<SysJob>() - .like(StrUtil.isNotBlank(job.getJobName()), SysJob::getJobName, job.getJobName()) - .eq(StrUtil.isNotBlank(job.getJobGroup()), SysJob::getJobGroup, job.getJobGroup()) - .eq(StrUtil.isNotBlank(job.getStatus()), SysJob::getStatus, job.getStatus()) - .like(StrUtil.isNotBlank(job.getInvokeTarget()), SysJob::getInvokeTarget, job.getInvokeTarget())); - } - - /** - * 閫氳繃璋冨害浠诲姟ID鏌ヨ璋冨害淇℃伅 - * - * @param jobId 璋冨害浠诲姟ID - * @return 璋冨害浠诲姟瀵硅薄淇℃伅 - */ - @Override - public SysJob selectJobById(Long jobId) { - return getById(jobId); - } - - /** - * 鏆傚仠浠诲姟 - * - * @param job 璋冨害淇℃伅 - */ - @Override - @Transactional - public int pauseJob(SysJob job) throws SchedulerException { - Long jobId = job.getJobId(); - String jobGroup = job.getJobGroup(); - job.setStatus(ScheduleConstants.Status.PAUSE.getValue()); - int rows = baseMapper.updateById(job); - if (rows > 0) { - scheduler.pauseJob(ScheduleUtils.getJobKey(jobId, jobGroup)); - } - return rows; - } - - /** - * 鎭㈠浠诲姟 - * - * @param job 璋冨害淇℃伅 - */ - @Override - @Transactional - public int resumeJob(SysJob job) throws SchedulerException { - Long jobId = job.getJobId(); - String jobGroup = job.getJobGroup(); - job.setStatus(ScheduleConstants.Status.NORMAL.getValue()); - int rows = baseMapper.updateById(job); - if (rows > 0) { - scheduler.resumeJob(ScheduleUtils.getJobKey(jobId, jobGroup)); - } - return rows; - } - - /** - * 鍒犻櫎浠诲姟鍚庯紝鎵�瀵瑰簲鐨則rigger涔熷皢琚垹闄� - * - * @param job 璋冨害淇℃伅 - */ - @Override - @Transactional - public int deleteJob(SysJob job) throws SchedulerException { - Long jobId = job.getJobId(); - String jobGroup = job.getJobGroup(); - int rows = baseMapper.deleteById(jobId); - if (rows > 0) { - scheduler.deleteJob(ScheduleUtils.getJobKey(jobId, jobGroup)); - } - return rows; - } - - /** - * 鎵归噺鍒犻櫎璋冨害淇℃伅 - * - * @param jobIds 闇�瑕佸垹闄ょ殑浠诲姟ID - * @return 缁撴灉 - */ - @Override - @Transactional - public void deleteJobByIds(Long[] jobIds) throws SchedulerException { - for (Long jobId : jobIds) { - SysJob job = getById(jobId); - deleteJob(job); - } - } - - /** - * 浠诲姟璋冨害鐘舵�佷慨鏀� - * - * @param job 璋冨害淇℃伅 - */ - @Override - @Transactional - public int changeStatus(SysJob job) throws SchedulerException { - int rows = 0; - String status = job.getStatus(); - if (ScheduleConstants.Status.NORMAL.getValue().equals(status)) { - rows = resumeJob(job); - } else if (ScheduleConstants.Status.PAUSE.getValue().equals(status)) { - rows = pauseJob(job); - } - return rows; - } - - /** - * 绔嬪嵆杩愯浠诲姟 - * - * @param job 璋冨害淇℃伅 - */ - @Override - @Transactional - public void run(SysJob job) throws SchedulerException { - Long jobId = job.getJobId(); - String jobGroup = job.getJobGroup(); - SysJob properties = selectJobById(job.getJobId()); - // 鍙傛暟 - JobDataMap dataMap = new JobDataMap(); - dataMap.put(ScheduleConstants.TASK_PROPERTIES, properties); - scheduler.triggerJob(ScheduleUtils.getJobKey(jobId, jobGroup), dataMap); - } - - /** - * 鏂板浠诲姟 - * - * @param job 璋冨害淇℃伅 璋冨害淇℃伅 - */ - @Override - @Transactional - public int insertJob(SysJob job) throws SchedulerException, TaskException { - job.setStatus(ScheduleConstants.Status.PAUSE.getValue()); - int rows = baseMapper.insert(job); - if (rows > 0) { - ScheduleUtils.createScheduleJob(scheduler, job); - } - return rows; - } - - /** - * 鏇存柊浠诲姟鐨勬椂闂磋〃杈惧紡 - * - * @param job 璋冨害淇℃伅 - */ - @Override - @Transactional - public int updateJob(SysJob job) throws SchedulerException, TaskException { - SysJob properties = selectJobById(job.getJobId()); - int rows = baseMapper.updateById(job); - if (rows > 0) { - updateSchedulerJob(job, properties.getJobGroup()); - } - return rows; - } - - /** - * 鏇存柊浠诲姟 - * - * @param job 浠诲姟瀵硅薄 - * @param jobGroup 浠诲姟缁勫悕 - */ - public void updateSchedulerJob(SysJob job, String jobGroup) throws SchedulerException, TaskException { - Long jobId = job.getJobId(); - // 鍒ゆ柇鏄惁瀛樺湪 - JobKey jobKey = ScheduleUtils.getJobKey(jobId, jobGroup); - if (scheduler.checkExists(jobKey)) { - // 闃叉鍒涘缓鏃跺瓨鍦ㄦ暟鎹棶棰� 鍏堢Щ闄わ紝鐒跺悗鍦ㄦ墽琛屽垱寤烘搷浣� - scheduler.deleteJob(jobKey); - } - ScheduleUtils.createScheduleJob(scheduler, job); - } - - /** - * 鏍¢獙cron琛ㄨ揪寮忔槸鍚︽湁鏁� - * - * @param cronExpression 琛ㄨ揪寮� - * @return 缁撴灉 - */ - @Override - public boolean checkCronExpressionIsValid(String cronExpression) { - return CronUtils.isValid(cronExpression); - } -} +package com.ruoyi.quartz.service.impl; + +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.ruoyi.common.constant.ScheduleConstants; +import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl; +import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.common.exception.job.TaskException; +import com.ruoyi.common.utils.PageUtils; +import com.ruoyi.quartz.domain.SysJob; +import com.ruoyi.quartz.mapper.SysJobMapper; +import com.ruoyi.quartz.service.ISysJobService; +import com.ruoyi.quartz.util.CronUtils; +import com.ruoyi.quartz.util.ScheduleUtils; +import org.quartz.JobDataMap; +import org.quartz.JobKey; +import org.quartz.Scheduler; +import org.quartz.SchedulerException; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.PostConstruct; +import java.util.List; + +/** + * 瀹氭椂浠诲姟璋冨害淇℃伅 鏈嶅姟灞� + * + * @author ruoyi + */ +@Service +public class SysJobServiceImpl extends ServicePlusImpl<SysJobMapper, SysJob> implements ISysJobService { + @Autowired + private Scheduler scheduler; + + /** + * 椤圭洰鍚姩鏃讹紝鍒濆鍖栧畾鏃跺櫒 涓昏鏄槻姝㈡墜鍔ㄤ慨鏀规暟鎹簱瀵艰嚧鏈悓姝ュ埌瀹氭椂浠诲姟澶勭悊锛堟敞锛氫笉鑳芥墜鍔ㄤ慨鏀规暟鎹簱ID鍜屼换鍔$粍鍚嶏紝鍚﹀垯浼氬鑷磋剰鏁版嵁锛� + */ + @PostConstruct + public void init() throws SchedulerException, TaskException { + scheduler.clear(); + List<SysJob> jobList = list(); + for (SysJob job : jobList) { + ScheduleUtils.createScheduleJob(scheduler, job); + } + } + + @Override + public TableDataInfo<SysJob> selectPageJobList(SysJob job) { + LambdaQueryWrapper<SysJob> lqw = new LambdaQueryWrapper<SysJob>() + .like(StrUtil.isNotBlank(job.getJobName()), SysJob::getJobName, job.getJobName()) + .eq(StrUtil.isNotBlank(job.getJobGroup()), SysJob::getJobGroup, job.getJobGroup()) + .eq(StrUtil.isNotBlank(job.getStatus()), SysJob::getStatus, job.getStatus()) + .like(StrUtil.isNotBlank(job.getInvokeTarget()), SysJob::getInvokeTarget, job.getInvokeTarget()); + return PageUtils.buildDataInfo(page(PageUtils.buildPage(), lqw)); + } + + /** + * 鑾峰彇quartz璋冨害鍣ㄧ殑璁″垝浠诲姟鍒楄〃 + * + * @param job 璋冨害淇℃伅 + * @return + */ + @Override + public List<SysJob> selectJobList(SysJob job) { + return list(new LambdaQueryWrapper<SysJob>() + .like(StrUtil.isNotBlank(job.getJobName()), SysJob::getJobName, job.getJobName()) + .eq(StrUtil.isNotBlank(job.getJobGroup()), SysJob::getJobGroup, job.getJobGroup()) + .eq(StrUtil.isNotBlank(job.getStatus()), SysJob::getStatus, job.getStatus()) + .like(StrUtil.isNotBlank(job.getInvokeTarget()), SysJob::getInvokeTarget, job.getInvokeTarget())); + } + + /** + * 閫氳繃璋冨害浠诲姟ID鏌ヨ璋冨害淇℃伅 + * + * @param jobId 璋冨害浠诲姟ID + * @return 璋冨害浠诲姟瀵硅薄淇℃伅 + */ + @Override + public SysJob selectJobById(Long jobId) { + return getById(jobId); + } + + /** + * 鏆傚仠浠诲姟 + * + * @param job 璋冨害淇℃伅 + */ + @Override + @Transactional + public int pauseJob(SysJob job) throws SchedulerException { + Long jobId = job.getJobId(); + String jobGroup = job.getJobGroup(); + job.setStatus(ScheduleConstants.Status.PAUSE.getValue()); + int rows = baseMapper.updateById(job); + if (rows > 0) { + scheduler.pauseJob(ScheduleUtils.getJobKey(jobId, jobGroup)); + } + return rows; + } + + /** + * 鎭㈠浠诲姟 + * + * @param job 璋冨害淇℃伅 + */ + @Override + @Transactional + public int resumeJob(SysJob job) throws SchedulerException { + Long jobId = job.getJobId(); + String jobGroup = job.getJobGroup(); + job.setStatus(ScheduleConstants.Status.NORMAL.getValue()); + int rows = baseMapper.updateById(job); + if (rows > 0) { + scheduler.resumeJob(ScheduleUtils.getJobKey(jobId, jobGroup)); + } + return rows; + } + + /** + * 鍒犻櫎浠诲姟鍚庯紝鎵�瀵瑰簲鐨則rigger涔熷皢琚垹闄� + * + * @param job 璋冨害淇℃伅 + */ + @Override + @Transactional + public int deleteJob(SysJob job) throws SchedulerException { + Long jobId = job.getJobId(); + String jobGroup = job.getJobGroup(); + int rows = baseMapper.deleteById(jobId); + if (rows > 0) { + scheduler.deleteJob(ScheduleUtils.getJobKey(jobId, jobGroup)); + } + return rows; + } + + /** + * 鎵归噺鍒犻櫎璋冨害淇℃伅 + * + * @param jobIds 闇�瑕佸垹闄ょ殑浠诲姟ID + * @return 缁撴灉 + */ + @Override + @Transactional + public void deleteJobByIds(Long[] jobIds) throws SchedulerException { + for (Long jobId : jobIds) { + SysJob job = getById(jobId); + deleteJob(job); + } + } + + /** + * 浠诲姟璋冨害鐘舵�佷慨鏀� + * + * @param job 璋冨害淇℃伅 + */ + @Override + @Transactional + public int changeStatus(SysJob job) throws SchedulerException { + int rows = 0; + String status = job.getStatus(); + if (ScheduleConstants.Status.NORMAL.getValue().equals(status)) { + rows = resumeJob(job); + } else if (ScheduleConstants.Status.PAUSE.getValue().equals(status)) { + rows = pauseJob(job); + } + return rows; + } + + /** + * 绔嬪嵆杩愯浠诲姟 + * + * @param job 璋冨害淇℃伅 + */ + @Override + @Transactional + public void run(SysJob job) throws SchedulerException { + Long jobId = job.getJobId(); + String jobGroup = job.getJobGroup(); + SysJob properties = selectJobById(job.getJobId()); + // 鍙傛暟 + JobDataMap dataMap = new JobDataMap(); + dataMap.put(ScheduleConstants.TASK_PROPERTIES, properties); + scheduler.triggerJob(ScheduleUtils.getJobKey(jobId, jobGroup), dataMap); + } + + /** + * 鏂板浠诲姟 + * + * @param job 璋冨害淇℃伅 璋冨害淇℃伅 + */ + @Override + @Transactional + public int insertJob(SysJob job) throws SchedulerException, TaskException { + job.setStatus(ScheduleConstants.Status.PAUSE.getValue()); + int rows = baseMapper.insert(job); + if (rows > 0) { + ScheduleUtils.createScheduleJob(scheduler, job); + } + return rows; + } + + /** + * 鏇存柊浠诲姟鐨勬椂闂磋〃杈惧紡 + * + * @param job 璋冨害淇℃伅 + */ + @Override + @Transactional + public int updateJob(SysJob job) throws SchedulerException, TaskException { + SysJob properties = selectJobById(job.getJobId()); + int rows = baseMapper.updateById(job); + if (rows > 0) { + updateSchedulerJob(job, properties.getJobGroup()); + } + return rows; + } + + /** + * 鏇存柊浠诲姟 + * + * @param job 浠诲姟瀵硅薄 + * @param jobGroup 浠诲姟缁勫悕 + */ + public void updateSchedulerJob(SysJob job, String jobGroup) throws SchedulerException, TaskException { + Long jobId = job.getJobId(); + // 鍒ゆ柇鏄惁瀛樺湪 + JobKey jobKey = ScheduleUtils.getJobKey(jobId, jobGroup); + if (scheduler.checkExists(jobKey)) { + // 闃叉鍒涘缓鏃跺瓨鍦ㄦ暟鎹棶棰� 鍏堢Щ闄わ紝鐒跺悗鍦ㄦ墽琛屽垱寤烘搷浣� + scheduler.deleteJob(jobKey); + } + ScheduleUtils.createScheduleJob(scheduler, job); + } + + /** + * 鏍¢獙cron琛ㄨ揪寮忔槸鍚︽湁鏁� + * + * @param cronExpression 琛ㄨ揪寮� + * @return 缁撴灉 + */ + @Override + public boolean checkCronExpressionIsValid(String cronExpression) { + return CronUtils.isValid(cronExpression); + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysConfigMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysConfigMapper.java index fb3f068..97aaa52 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysConfigMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysConfigMapper.java @@ -1,6 +1,6 @@ package com.ruoyi.system.mapper; -import com.ruoyi.common.core.page.BaseMapperPlus; +import com.ruoyi.common.core.mybatisplus.core.BaseMapperPlus; import com.ruoyi.system.domain.SysConfig; /** diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDeptMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDeptMapper.java index f1df4f3..ecee7ea 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDeptMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDeptMapper.java @@ -1,7 +1,7 @@ package com.ruoyi.system.mapper; import com.ruoyi.common.core.domain.entity.SysDept; -import com.ruoyi.common.core.page.BaseMapperPlus; +import com.ruoyi.common.core.mybatisplus.core.BaseMapperPlus; import org.apache.ibatis.annotations.Param; import java.util.List; diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDictDataMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDictDataMapper.java index 3d8971d..db5c98e 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDictDataMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDictDataMapper.java @@ -2,7 +2,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.ruoyi.common.core.domain.entity.SysDictData; -import com.ruoyi.common.core.page.BaseMapperPlus; +import com.ruoyi.common.core.mybatisplus.core.BaseMapperPlus; import java.util.List; diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDictTypeMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDictTypeMapper.java index 911386d..7ff8c46 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDictTypeMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDictTypeMapper.java @@ -1,7 +1,7 @@ package com.ruoyi.system.mapper; import com.ruoyi.common.core.domain.entity.SysDictType; -import com.ruoyi.common.core.page.BaseMapperPlus; +import com.ruoyi.common.core.mybatisplus.core.BaseMapperPlus; /** * 瀛楀吀琛� 鏁版嵁灞� diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysLogininforMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysLogininforMapper.java index bf37f9b..cc99c10 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysLogininforMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysLogininforMapper.java @@ -1,6 +1,6 @@ package com.ruoyi.system.mapper; -import com.ruoyi.common.core.page.BaseMapperPlus; +import com.ruoyi.common.core.mybatisplus.core.BaseMapperPlus; import com.ruoyi.system.domain.SysLogininfor; /** diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysMenuMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysMenuMapper.java index 6a8e729..f54ceea 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysMenuMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysMenuMapper.java @@ -1,7 +1,7 @@ package com.ruoyi.system.mapper; import com.ruoyi.common.core.domain.entity.SysMenu; -import com.ruoyi.common.core.page.BaseMapperPlus; +import com.ruoyi.common.core.mybatisplus.core.BaseMapperPlus; import org.apache.ibatis.annotations.Param; import java.util.List; diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysNoticeMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysNoticeMapper.java index 0061170..68c2825 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysNoticeMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysNoticeMapper.java @@ -1,6 +1,6 @@ package com.ruoyi.system.mapper; -import com.ruoyi.common.core.page.BaseMapperPlus; +import com.ruoyi.common.core.mybatisplus.core.BaseMapperPlus; import com.ruoyi.system.domain.SysNotice; /** diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysOperLogMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysOperLogMapper.java index 3f38256..93d3262 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysOperLogMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysOperLogMapper.java @@ -1,6 +1,6 @@ package com.ruoyi.system.mapper; -import com.ruoyi.common.core.page.BaseMapperPlus; +import com.ruoyi.common.core.mybatisplus.core.BaseMapperPlus; import com.ruoyi.system.domain.SysOperLog; /** diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysPostMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysPostMapper.java index 1eef04f..8a1b309 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysPostMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysPostMapper.java @@ -1,6 +1,6 @@ package com.ruoyi.system.mapper; -import com.ruoyi.common.core.page.BaseMapperPlus; +import com.ruoyi.common.core.mybatisplus.core.BaseMapperPlus; import com.ruoyi.system.domain.SysPost; import java.util.List; diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleDeptMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleDeptMapper.java index 331ecb9..af248c1 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleDeptMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleDeptMapper.java @@ -1,9 +1,7 @@ package com.ruoyi.system.mapper; -import com.ruoyi.common.core.page.BaseMapperPlus; +import com.ruoyi.common.core.mybatisplus.core.BaseMapperPlus; import com.ruoyi.system.domain.SysRoleDept; - -import java.util.List; /** * 瑙掕壊涓庨儴闂ㄥ叧鑱旇〃 鏁版嵁灞� @@ -11,13 +9,5 @@ * @author ruoyi */ public interface SysRoleDeptMapper extends BaseMapperPlus<SysRoleDept> { - - /** - * 鎵归噺鏂板瑙掕壊閮ㄩ棬淇℃伅 - * - * @param roleDeptList 瑙掕壊閮ㄩ棬鍒楄〃 - * @return 缁撴灉 - */ - public int batchRoleDept(List<SysRoleDept> roleDeptList); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleMapper.java index e0792c7..972f8f6 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleMapper.java @@ -2,7 +2,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.ruoyi.common.core.domain.entity.SysRole; -import com.ruoyi.common.core.page.BaseMapperPlus; +import com.ruoyi.common.core.mybatisplus.core.BaseMapperPlus; import org.apache.ibatis.annotations.Param; import java.util.List; diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleMenuMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleMenuMapper.java index 4f08cea..c7e743e 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleMenuMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleMenuMapper.java @@ -1,9 +1,7 @@ package com.ruoyi.system.mapper; -import com.ruoyi.common.core.page.BaseMapperPlus; +import com.ruoyi.common.core.mybatisplus.core.BaseMapperPlus; import com.ruoyi.system.domain.SysRoleMenu; - -import java.util.List; /** * 瑙掕壊涓庤彍鍗曞叧鑱旇〃 鏁版嵁灞� @@ -11,13 +9,5 @@ * @author ruoyi */ public interface SysRoleMenuMapper extends BaseMapperPlus<SysRoleMenu> { - - /** - * 鎵归噺鏂板瑙掕壊鑿滃崟淇℃伅 - * - * @param roleMenuList 瑙掕壊鑿滃崟鍒楄〃 - * @return 缁撴灉 - */ - public int batchRoleMenu(List<SysRoleMenu> roleMenuList); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java index a3fcfdb..17b17b0 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java @@ -2,7 +2,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.ruoyi.common.core.domain.entity.SysUser; -import com.ruoyi.common.core.page.BaseMapperPlus; +import com.ruoyi.common.core.mybatisplus.core.BaseMapperPlus; import org.apache.ibatis.annotations.Param; import java.util.List; diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserPostMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserPostMapper.java index 7839bbe..e5c63e3 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserPostMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserPostMapper.java @@ -1,9 +1,7 @@ package com.ruoyi.system.mapper; -import com.ruoyi.common.core.page.BaseMapperPlus; +import com.ruoyi.common.core.mybatisplus.core.BaseMapperPlus; import com.ruoyi.system.domain.SysUserPost; - -import java.util.List; /** * 鐢ㄦ埛涓庡矖浣嶅叧鑱旇〃 鏁版嵁灞� @@ -11,13 +9,5 @@ * @author ruoyi */ public interface SysUserPostMapper extends BaseMapperPlus<SysUserPost> { - - /** - * 鎵归噺鏂板鐢ㄦ埛宀椾綅淇℃伅 - * - * @param userPostList 鐢ㄦ埛瑙掕壊鍒楄〃 - * @return 缁撴灉 - */ - public int batchUserPost(List<SysUserPost> userPostList); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserRoleMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserRoleMapper.java index 365bbf4..260ec32 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserRoleMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserRoleMapper.java @@ -1,9 +1,7 @@ package com.ruoyi.system.mapper; -import com.ruoyi.common.core.page.BaseMapperPlus; +import com.ruoyi.common.core.mybatisplus.core.BaseMapperPlus; import com.ruoyi.system.domain.SysUserRole; - -import java.util.List; /** * 鐢ㄦ埛涓庤鑹插叧鑱旇〃 鏁版嵁灞� @@ -11,13 +9,5 @@ * @author ruoyi */ public interface SysUserRoleMapper extends BaseMapperPlus<SysUserRole> { - - /** - * 鎵归噺鏂板鐢ㄦ埛瑙掕壊淇℃伅 - * - * @param userRoleList 鐢ㄦ埛瑙掕壊鍒楄〃 - * @return 缁撴灉 - */ - public int batchUserRole(List<SysUserRole> userRoleList); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysConfigService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysConfigService.java index 569ecf9..429559b 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysConfigService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysConfigService.java @@ -1,6 +1,6 @@ package com.ruoyi.system.service; -import com.ruoyi.common.core.page.IServicePlus; +import com.ruoyi.common.core.mybatisplus.core.IServicePlus; import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.system.domain.SysConfig; diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDeptService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDeptService.java index 59521c0..7afbf4b 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDeptService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDeptService.java @@ -2,7 +2,7 @@ import com.ruoyi.common.core.domain.TreeSelect; import com.ruoyi.common.core.domain.entity.SysDept; -import com.ruoyi.common.core.page.IServicePlus; +import com.ruoyi.common.core.mybatisplus.core.IServicePlus; import java.util.List; diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDictDataService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDictDataService.java index 5a19aa7..570c7d1 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDictDataService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDictDataService.java @@ -1,7 +1,7 @@ package com.ruoyi.system.service; import com.ruoyi.common.core.domain.entity.SysDictData; -import com.ruoyi.common.core.page.IServicePlus; +import com.ruoyi.common.core.mybatisplus.core.IServicePlus; import com.ruoyi.common.core.page.TableDataInfo; import java.util.List; diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDictTypeService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDictTypeService.java index a806cbd..a5d8de5 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDictTypeService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDictTypeService.java @@ -2,7 +2,7 @@ import com.ruoyi.common.core.domain.entity.SysDictData; import com.ruoyi.common.core.domain.entity.SysDictType; -import com.ruoyi.common.core.page.IServicePlus; +import com.ruoyi.common.core.mybatisplus.core.IServicePlus; import com.ruoyi.common.core.page.TableDataInfo; import java.util.List; diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysLogininforService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysLogininforService.java index ccf0e9e..4976d3f 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysLogininforService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysLogininforService.java @@ -1,6 +1,6 @@ package com.ruoyi.system.service; -import com.ruoyi.common.core.page.IServicePlus; +import com.ruoyi.common.core.mybatisplus.core.IServicePlus; import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.system.domain.SysLogininfor; diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysMenuService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysMenuService.java index a9f70b3..d278743 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysMenuService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysMenuService.java @@ -2,7 +2,7 @@ import com.ruoyi.common.core.domain.TreeSelect; import com.ruoyi.common.core.domain.entity.SysMenu; -import com.ruoyi.common.core.page.IServicePlus; +import com.ruoyi.common.core.mybatisplus.core.IServicePlus; import com.ruoyi.system.domain.vo.RouterVo; import java.util.List; diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysNoticeService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysNoticeService.java index 4ede9bc..2db8422 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysNoticeService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysNoticeService.java @@ -1,6 +1,6 @@ package com.ruoyi.system.service; -import com.ruoyi.common.core.page.IServicePlus; +import com.ruoyi.common.core.mybatisplus.core.IServicePlus; import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.system.domain.SysNotice; diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysOperLogService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysOperLogService.java index f2485b7..dcd2c08 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysOperLogService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysOperLogService.java @@ -1,6 +1,6 @@ package com.ruoyi.system.service; -import com.ruoyi.common.core.page.IServicePlus; +import com.ruoyi.common.core.mybatisplus.core.IServicePlus; import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.system.domain.SysOperLog; diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysPostService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysPostService.java index 08058d6..f56c5fd 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysPostService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysPostService.java @@ -1,6 +1,6 @@ package com.ruoyi.system.service; -import com.ruoyi.common.core.page.IServicePlus; +import com.ruoyi.common.core.mybatisplus.core.IServicePlus; import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.system.domain.SysPost; diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysRoleService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysRoleService.java index 00c7d5f..2f46822 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysRoleService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysRoleService.java @@ -1,7 +1,7 @@ package com.ruoyi.system.service; import com.ruoyi.common.core.domain.entity.SysRole; -import com.ruoyi.common.core.page.IServicePlus; +import com.ruoyi.common.core.mybatisplus.core.IServicePlus; import com.ruoyi.common.core.page.TableDataInfo; import java.util.List; diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysUserService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysUserService.java index 3f423a6..4c67091 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysUserService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysUserService.java @@ -1,7 +1,7 @@ package com.ruoyi.system.service; import com.ruoyi.common.core.domain.entity.SysUser; -import com.ruoyi.common.core.page.IServicePlus; +import com.ruoyi.common.core.mybatisplus.core.IServicePlus; import com.ruoyi.common.core.page.TableDataInfo; import java.util.List; diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysConfigServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysConfigServiceImpl.java index d0b37c5..dd7321a 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysConfigServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysConfigServiceImpl.java @@ -4,10 +4,10 @@ import cn.hutool.core.lang.Validator; import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.common.annotation.DataSource; import com.ruoyi.common.constant.Constants; import com.ruoyi.common.constant.UserConstants; +import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl; import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.core.redis.RedisCache; import com.ruoyi.common.enums.DataSourceType; @@ -31,7 +31,7 @@ * @author ruoyi */ @Service -public class SysConfigServiceImpl extends ServiceImpl<SysConfigMapper, SysConfig> implements ISysConfigService { +public class SysConfigServiceImpl extends ServicePlusImpl<SysConfigMapper, SysConfig> implements ISysConfigService { @Autowired private RedisCache redisCache; diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java index 54582a1..745e62f 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java @@ -4,13 +4,13 @@ import cn.hutool.core.lang.Validator; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.common.annotation.DataScope; import com.ruoyi.common.constant.UserConstants; import com.ruoyi.common.core.domain.TreeSelect; import com.ruoyi.common.core.domain.entity.SysDept; import com.ruoyi.common.core.domain.entity.SysRole; import com.ruoyi.common.core.domain.entity.SysUser; +import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl; import com.ruoyi.common.exception.CustomException; import com.ruoyi.system.mapper.SysDeptMapper; import com.ruoyi.system.mapper.SysRoleMapper; @@ -30,7 +30,7 @@ * @author ruoyi */ @Service -public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> implements ISysDeptService { +public class SysDeptServiceImpl extends ServicePlusImpl<SysDeptMapper, SysDept> implements ISysDeptService { @Autowired private SysRoleMapper roleMapper; diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictDataServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictDataServiceImpl.java index 4b08a14..92be9d5 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictDataServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictDataServiceImpl.java @@ -2,8 +2,8 @@ import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.common.core.domain.entity.SysDictData; +import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl; import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.utils.DictUtils; import com.ruoyi.common.utils.PageUtils; @@ -20,7 +20,7 @@ * @author ruoyi */ @Service -public class SysDictDataServiceImpl extends ServiceImpl<SysDictDataMapper, SysDictData> implements ISysDictDataService { +public class SysDictDataServiceImpl extends ServicePlusImpl<SysDictDataMapper, SysDictData> implements ISysDictDataService { @Override public TableDataInfo<SysDictData> selectPageDictDataList(SysDictData dictData) { diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictTypeServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictTypeServiceImpl.java index c4f9d95..82f67c3 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictTypeServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictTypeServiceImpl.java @@ -5,10 +5,10 @@ import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.common.constant.UserConstants; import com.ruoyi.common.core.domain.entity.SysDictData; import com.ruoyi.common.core.domain.entity.SysDictType; +import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl; import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.exception.CustomException; import com.ruoyi.common.utils.DictUtils; @@ -31,7 +31,7 @@ * @author ruoyi */ @Service -public class SysDictTypeServiceImpl extends ServiceImpl<SysDictTypeMapper, SysDictType> implements ISysDictTypeService { +public class SysDictTypeServiceImpl extends ServicePlusImpl<SysDictTypeMapper, SysDictType> implements ISysDictTypeService { @Autowired private SysDictDataMapper dictDataMapper; diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysLogininforServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysLogininforServiceImpl.java index c129525..0284ed7 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysLogininforServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysLogininforServiceImpl.java @@ -3,7 +3,7 @@ import cn.hutool.core.lang.Validator; import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl; import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.utils.PageUtils; import com.ruoyi.system.domain.SysLogininfor; @@ -22,7 +22,7 @@ * @author ruoyi */ @Service -public class SysLogininforServiceImpl extends ServiceImpl<SysLogininforMapper, SysLogininfor> implements ISysLogininforService { +public class SysLogininforServiceImpl extends ServicePlusImpl<SysLogininforMapper, SysLogininfor> implements ISysLogininforService { @Override public TableDataInfo<SysLogininfor> selectPageLogininforList(SysLogininfor logininfor) { diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java index d5e45cd..f8b4706 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java @@ -3,12 +3,12 @@ import cn.hutool.core.lang.Validator; import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.common.constant.UserConstants; import com.ruoyi.common.core.domain.TreeSelect; import com.ruoyi.common.core.domain.entity.SysMenu; import com.ruoyi.common.core.domain.entity.SysRole; import com.ruoyi.common.core.domain.entity.SysUser; +import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl; import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.system.domain.SysRoleMenu; import com.ruoyi.system.domain.vo.MetaVo; @@ -29,7 +29,7 @@ * @author ruoyi */ @Service -public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> implements ISysMenuService { +public class SysMenuServiceImpl extends ServicePlusImpl<SysMenuMapper, SysMenu> implements ISysMenuService { public static final String PREMISSION_STRING = "perms[\"{0}\"]"; @Autowired diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysNoticeServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysNoticeServiceImpl.java index e063470..977e644 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysNoticeServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysNoticeServiceImpl.java @@ -2,7 +2,7 @@ import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl; import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.utils.PageUtils; import com.ruoyi.system.domain.SysNotice; @@ -19,7 +19,7 @@ * @author ruoyi */ @Service -public class SysNoticeServiceImpl extends ServiceImpl<SysNoticeMapper, SysNotice> implements ISysNoticeService { +public class SysNoticeServiceImpl extends ServicePlusImpl<SysNoticeMapper, SysNotice> implements ISysNoticeService { @Override public TableDataInfo<SysNotice> selectPageNoticeList(SysNotice notice) { diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysOperLogServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysOperLogServiceImpl.java index 238c015..5d24356 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysOperLogServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysOperLogServiceImpl.java @@ -4,7 +4,7 @@ import cn.hutool.core.util.ArrayUtil; import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl; import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.utils.PageUtils; import com.ruoyi.system.domain.SysOperLog; @@ -23,7 +23,7 @@ * @author ruoyi */ @Service -public class SysOperLogServiceImpl extends ServiceImpl<SysOperLogMapper, SysOperLog> implements ISysOperLogService { +public class SysOperLogServiceImpl extends ServicePlusImpl<SysOperLogMapper, SysOperLog> implements ISysOperLogService { @Override public TableDataInfo<SysOperLog> selectPageOperLogList(SysOperLog operLog) { diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysPostServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysPostServiceImpl.java index d2aeab0..93f8e98 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysPostServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysPostServiceImpl.java @@ -3,8 +3,8 @@ import cn.hutool.core.lang.Validator; import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.common.constant.UserConstants; +import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl; import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.exception.CustomException; import com.ruoyi.common.utils.PageUtils; @@ -25,7 +25,7 @@ * @author ruoyi */ @Service -public class SysPostServiceImpl extends ServiceImpl<SysPostMapper, SysPost> implements ISysPostService { +public class SysPostServiceImpl extends ServicePlusImpl<SysPostMapper, SysPost> implements ISysPostService { @Autowired private SysUserPostMapper userPostMapper; diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java index c46c45f..1bac225 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java @@ -2,10 +2,10 @@ import cn.hutool.core.lang.Validator; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.common.annotation.DataScope; import com.ruoyi.common.constant.UserConstants; import com.ruoyi.common.core.domain.entity.SysRole; +import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl; import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.exception.CustomException; import com.ruoyi.common.utils.PageUtils; @@ -30,7 +30,7 @@ * @author ruoyi */ @Service -public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> implements ISysRoleService { +public class SysRoleServiceImpl extends ServicePlusImpl<SysRoleMapper, SysRole> implements ISysRoleService { @Autowired private SysRoleMenuMapper roleMenuMapper; @@ -240,7 +240,7 @@ list.add(rm); } if (list.size() > 0) { - rows = roleMenuMapper.batchRoleMenu(list); + rows = roleMenuMapper.insertAll(list); } return rows; } @@ -261,7 +261,7 @@ list.add(rd); } if (list.size() > 0) { - rows = roleDeptMapper.batchRoleDept(list); + rows = roleDeptMapper.insertAll(list); } return rows; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java index dd12f10..7363040 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java @@ -3,11 +3,11 @@ import cn.hutool.core.lang.Validator; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.common.annotation.DataScope; import com.ruoyi.common.constant.UserConstants; import com.ruoyi.common.core.domain.entity.SysRole; import com.ruoyi.common.core.domain.entity.SysUser; +import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl; import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.exception.CustomException; import com.ruoyi.common.utils.PageUtils; @@ -34,7 +34,7 @@ */ @Slf4j @Service -public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> implements ISysUserService { +public class SysUserServiceImpl extends ServicePlusImpl<SysUserMapper, SysUser> implements ISysUserService { @Autowired private SysRoleMapper roleMapper; @@ -311,7 +311,7 @@ list.add(ur); } if (list.size() > 0) { - userRoleMapper.batchUserRole(list); + userRoleMapper.insertAll(list); } } } @@ -333,7 +333,7 @@ list.add(up); } if (list.size() > 0) { - userPostMapper.batchUserPost(list); + userPostMapper.insertAll(list); } } } diff --git a/ruoyi-system/src/main/resources/mapper/system/SysRoleDeptMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysRoleDeptMapper.xml index cace1f5..e64cb45 100644 --- a/ruoyi-system/src/main/resources/mapper/system/SysRoleDeptMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/SysRoleDeptMapper.xml @@ -9,11 +9,4 @@ <result property="deptId" column="dept_id"/> </resultMap> - <insert id="batchRoleDept"> - insert into sys_role_dept(role_id, dept_id) values - <foreach item="item" index="index" collection="list" separator=","> - (#{item.roleId},#{item.deptId}) - </foreach> - </insert> - </mapper> diff --git a/ruoyi-system/src/main/resources/mapper/system/SysRoleMenuMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysRoleMenuMapper.xml index 356b612..efc5a79 100644 --- a/ruoyi-system/src/main/resources/mapper/system/SysRoleMenuMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/SysRoleMenuMapper.xml @@ -9,11 +9,4 @@ <result property="menuId" column="menu_id"/> </resultMap> - <insert id="batchRoleMenu"> - insert into sys_role_menu(role_id, menu_id) values - <foreach item="item" index="index" collection="list" separator=","> - (#{item.roleId},#{item.menuId}) - </foreach> - </insert> - </mapper> diff --git a/ruoyi-system/src/main/resources/mapper/system/SysUserPostMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysUserPostMapper.xml index 8d70825..0ff9265 100644 --- a/ruoyi-system/src/main/resources/mapper/system/SysUserPostMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/SysUserPostMapper.xml @@ -9,11 +9,4 @@ <result property="postId" column="post_id"/> </resultMap> - <insert id="batchUserPost"> - insert into sys_user_post(user_id, post_id) values - <foreach item="item" index="index" collection="list" separator=","> - (#{item.userId},#{item.postId}) - </foreach> - </insert> - </mapper> diff --git a/ruoyi-system/src/main/resources/mapper/system/SysUserRoleMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysUserRoleMapper.xml index 1db2f0f..3066f47 100644 --- a/ruoyi-system/src/main/resources/mapper/system/SysUserRoleMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/SysUserRoleMapper.xml @@ -9,11 +9,4 @@ <result property="roleId" column="role_id"/> </resultMap> - <insert id="batchUserRole"> - insert into sys_user_role(user_id, role_id) values - <foreach item="item" index="index" collection="list" separator=","> - (#{item.userId},#{item.roleId}) - </foreach> - </insert> - </mapper> -- Gitblit v1.9.3