From d408ca88af65121ba9f0797fd3f1b279a29e6618 Mon Sep 17 00:00:00 2001 From: liguoqing <1576331433@qq.com> Date: Mon, 1 Feb 2021 20:55:41 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E3=80=90config-business=E3=80=91=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E6=96=B9=E6=B3=95=E5=90=8D=E7=A7=B0=EF=BC=8C=E4=BF=AE?= =?UTF-8?q?=E6=94=B9createWrapper=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/SysConfigController.java | 2 +- .../modular/service/SysConfigService.java | 2 +- .../service/impl/SysConfigServiceImpl.java | 20 +++++++++---------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/kernel-d-config/config-business/src/main/java/cn/stylefeng/roses/kernel/config/modular/controller/SysConfigController.java b/kernel-d-config/config-business/src/main/java/cn/stylefeng/roses/kernel/config/modular/controller/SysConfigController.java index 61fc00eff..ff671c002 100644 --- a/kernel-d-config/config-business/src/main/java/cn/stylefeng/roses/kernel/config/modular/controller/SysConfigController.java +++ b/kernel-d-config/config-business/src/main/java/cn/stylefeng/roses/kernel/config/modular/controller/SysConfigController.java @@ -59,7 +59,7 @@ public class SysConfigController { */ @PostResource(name = "删除系统参数配置", path = "/sysConfig/delete") public ResponseData delete(@RequestBody @Validated(SysConfigParam.delete.class) SysConfigParam sysConfigParam) { - sysConfigService.delete(sysConfigParam); + sysConfigService.del(sysConfigParam); return new SuccessResponseData(); } diff --git a/kernel-d-config/config-business/src/main/java/cn/stylefeng/roses/kernel/config/modular/service/SysConfigService.java b/kernel-d-config/config-business/src/main/java/cn/stylefeng/roses/kernel/config/modular/service/SysConfigService.java index d567b875b..40afa29e7 100644 --- a/kernel-d-config/config-business/src/main/java/cn/stylefeng/roses/kernel/config/modular/service/SysConfigService.java +++ b/kernel-d-config/config-business/src/main/java/cn/stylefeng/roses/kernel/config/modular/service/SysConfigService.java @@ -64,7 +64,7 @@ public interface SysConfigService extends IService { * @author fengshuonan * @date 2020/4/14 11:15 */ - void delete(SysConfigParam sysConfigParam); + void del(SysConfigParam sysConfigParam); /** * 查看系统参数配置 diff --git a/kernel-d-config/config-business/src/main/java/cn/stylefeng/roses/kernel/config/modular/service/impl/SysConfigServiceImpl.java b/kernel-d-config/config-business/src/main/java/cn/stylefeng/roses/kernel/config/modular/service/impl/SysConfigServiceImpl.java index 094aef325..e2c8f44bb 100644 --- a/kernel-d-config/config-business/src/main/java/cn/stylefeng/roses/kernel/config/modular/service/impl/SysConfigServiceImpl.java +++ b/kernel-d-config/config-business/src/main/java/cn/stylefeng/roses/kernel/config/modular/service/impl/SysConfigServiceImpl.java @@ -69,7 +69,7 @@ public class SysConfigServiceImpl extends ServiceImpl queryWrapper = new LambdaQueryWrapper<>(); if (ObjectUtil.isNotNull(sysConfigParam)) { + + String configName = sysConfigParam.getConfigName(); + String configCode = sysConfigParam.getConfigCode(); + String groupCode = sysConfigParam.getGroupCode(); + // 如果名称不为空,则带上名称搜素搜条件 - if (ObjectUtil.isNotEmpty(sysConfigParam.getConfigName())) { - queryWrapper.like(SysConfig::getConfigName, sysConfigParam.getConfigName()); - } + queryWrapper.like(ObjectUtil.isNotEmpty(configName), SysConfig::getConfigName, configName); // 如果常量编码不为空,则带上常量编码搜素搜条件 - if (ObjectUtil.isNotEmpty(sysConfigParam.getConfigCode())) { - queryWrapper.like(SysConfig::getConfigCode, sysConfigParam.getConfigCode()); - } + queryWrapper.like(ObjectUtil.isNotEmpty(configCode), SysConfig::getConfigCode, configCode); // 如果分类编码不为空,则带上分类编码 - if (ObjectUtil.isNotEmpty(sysConfigParam.getGroupCode())) { - queryWrapper.eq(SysConfig::getGroupCode, sysConfigParam.getGroupCode()); - } + queryWrapper.eq(ObjectUtil.isNotEmpty(groupCode), SysConfig::getGroupCode, groupCode); + } // 查询未删除的 From 891e7fe46009b773d6380d114e26ef550cedca48 Mon Sep 17 00:00:00 2001 From: liguoqing <1576331433@qq.com> Date: Mon, 1 Feb 2021 21:43:51 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E3=80=90config-business=E3=80=91=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E6=96=B9=E6=B3=95=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kernel/config/modular/controller/SysConfigController.java | 4 ++-- .../roses/kernel/config/modular/service/SysConfigService.java | 4 ++-- .../config/modular/service/impl/SysConfigServiceImpl.java | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/kernel-d-config/config-business/src/main/java/cn/stylefeng/roses/kernel/config/modular/controller/SysConfigController.java b/kernel-d-config/config-business/src/main/java/cn/stylefeng/roses/kernel/config/modular/controller/SysConfigController.java index ff671c002..dd62b6832 100644 --- a/kernel-d-config/config-business/src/main/java/cn/stylefeng/roses/kernel/config/modular/controller/SysConfigController.java +++ b/kernel-d-config/config-business/src/main/java/cn/stylefeng/roses/kernel/config/modular/controller/SysConfigController.java @@ -83,7 +83,7 @@ public class SysConfigController { */ @GetResource(name = "分页查询配置列表", path = "/sysConfig/page") public ResponseData page(SysConfigParam sysConfigParam) { - return new SuccessResponseData(sysConfigService.page(sysConfigParam)); + return new SuccessResponseData(sysConfigService.findPage(sysConfigParam)); } /** @@ -94,7 +94,7 @@ public class SysConfigController { */ @GetResource(name = "系统参数配置列表", path = "/sysConfig/list") public ResponseData list(SysConfigParam sysConfigParam) { - return new SuccessResponseData(sysConfigService.list(sysConfigParam)); + return new SuccessResponseData(sysConfigService.findList(sysConfigParam)); } } diff --git a/kernel-d-config/config-business/src/main/java/cn/stylefeng/roses/kernel/config/modular/service/SysConfigService.java b/kernel-d-config/config-business/src/main/java/cn/stylefeng/roses/kernel/config/modular/service/SysConfigService.java index 40afa29e7..c72a7df69 100644 --- a/kernel-d-config/config-business/src/main/java/cn/stylefeng/roses/kernel/config/modular/service/SysConfigService.java +++ b/kernel-d-config/config-business/src/main/java/cn/stylefeng/roses/kernel/config/modular/service/SysConfigService.java @@ -84,7 +84,7 @@ public interface SysConfigService extends IService { * @author fengshuonan * @date 2020/4/14 11:14 */ - PageResult page(SysConfigParam sysConfigParam); + PageResult findPage(SysConfigParam sysConfigParam); /** * 查询系统参数配置 @@ -94,6 +94,6 @@ public interface SysConfigService extends IService { * @author fengshuonan * @date 2020/4/14 11:14 */ - List list(SysConfigParam sysConfigParam); + List findList(SysConfigParam sysConfigParam); } diff --git a/kernel-d-config/config-business/src/main/java/cn/stylefeng/roses/kernel/config/modular/service/impl/SysConfigServiceImpl.java b/kernel-d-config/config-business/src/main/java/cn/stylefeng/roses/kernel/config/modular/service/impl/SysConfigServiceImpl.java index e2c8f44bb..62e64d367 100644 --- a/kernel-d-config/config-business/src/main/java/cn/stylefeng/roses/kernel/config/modular/service/impl/SysConfigServiceImpl.java +++ b/kernel-d-config/config-business/src/main/java/cn/stylefeng/roses/kernel/config/modular/service/impl/SysConfigServiceImpl.java @@ -98,14 +98,14 @@ public class SysConfigServiceImpl extends ServiceImpl page(SysConfigParam sysConfigParam) { + public PageResult findPage(SysConfigParam sysConfigParam) { LambdaQueryWrapper wrapper = createWrapper(sysConfigParam); Page page = this.page(PageFactory.defaultPage(), wrapper); return PageResultFactory.createPageResult(page); } @Override - public List list(SysConfigParam sysConfigParam) { + public List findList(SysConfigParam sysConfigParam) { LambdaQueryWrapper wrapper = createWrapper(sysConfigParam); return this.list(wrapper); } From af732f03623c037b3749ddc227038e7eb17fec9c Mon Sep 17 00:00:00 2001 From: liguoqing <1576331433@qq.com> Date: Mon, 1 Feb 2021 21:44:24 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E3=80=90timer-business=E3=80=91=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E6=96=B9=E6=B3=95=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/SysTimersController.java | 10 ++++---- .../modular/service/SysTimersService.java | 6 ++--- .../service/impl/SysTimersServiceImpl.java | 24 ++++++++++++------- 3 files changed, 23 insertions(+), 17 deletions(-) diff --git a/kernel-d-timer/timer-business/src/main/java/cn/stylefeng/roses/kernel/timer/modular/controller/SysTimersController.java b/kernel-d-timer/timer-business/src/main/java/cn/stylefeng/roses/kernel/timer/modular/controller/SysTimersController.java index dc3516caf..b9a5da9ff 100644 --- a/kernel-d-timer/timer-business/src/main/java/cn/stylefeng/roses/kernel/timer/modular/controller/SysTimersController.java +++ b/kernel-d-timer/timer-business/src/main/java/cn/stylefeng/roses/kernel/timer/modular/controller/SysTimersController.java @@ -58,8 +58,8 @@ public class SysTimersController { * @date 2020/6/30 18:26 */ @PostResource(name = "删除定时任务", path = "/sysTimers/delete") - public ResponseData delete(@RequestBody @Validated(SysTimersParam.delete.class) SysTimersParam sysTimersParam) { - sysTimersService.delete(sysTimersParam); + public ResponseData del(@RequestBody @Validated(SysTimersParam.delete.class) SysTimersParam sysTimersParam) { + sysTimersService.del(sysTimersParam); return new SuccessResponseData(); } @@ -106,7 +106,7 @@ public class SysTimersController { */ @GetResource(name = "分页查询定时任务", path = "/sysTimers/page") public ResponseData page(SysTimersParam sysTimersParam) { - return new SuccessResponseData(sysTimersService.page(sysTimersParam)); + return new SuccessResponseData(sysTimersService.findPage(sysTimersParam)); } /** @@ -117,7 +117,7 @@ public class SysTimersController { */ @GetResource(name = "获取全部定时任务", path = "/sysTimers/list") public ResponseData list(SysTimersParam sysTimersParam) { - return new SuccessResponseData(sysTimersService.list(sysTimersParam)); + return new SuccessResponseData(sysTimersService.findList(sysTimersParam)); } /** @@ -132,4 +132,4 @@ public class SysTimersController { return new SuccessResponseData(actionClasses); } -} \ No newline at end of file +} diff --git a/kernel-d-timer/timer-business/src/main/java/cn/stylefeng/roses/kernel/timer/modular/service/SysTimersService.java b/kernel-d-timer/timer-business/src/main/java/cn/stylefeng/roses/kernel/timer/modular/service/SysTimersService.java index baafcd1e2..885351e67 100644 --- a/kernel-d-timer/timer-business/src/main/java/cn/stylefeng/roses/kernel/timer/modular/service/SysTimersService.java +++ b/kernel-d-timer/timer-business/src/main/java/cn/stylefeng/roses/kernel/timer/modular/service/SysTimersService.java @@ -40,7 +40,7 @@ public interface SysTimersService extends IService { * @author stylefeng * @date 2020/6/30 18:26 */ - void delete(SysTimersParam sysTimersParam); + void del(SysTimersParam sysTimersParam); /** * 启动任务 @@ -78,7 +78,7 @@ public interface SysTimersService extends IService { * @author stylefeng * @date 2020/6/30 18:26 */ - PageResult page(SysTimersParam sysTimersParam); + PageResult findPage(SysTimersParam sysTimersParam); /** * 查询所有定时任务 @@ -88,7 +88,7 @@ public interface SysTimersService extends IService { * @author stylefeng * @date 2020/6/30 18:26 */ - List list(SysTimersParam sysTimersParam); + List findList(SysTimersParam sysTimersParam); /** * 获取所有可执行的任务列表 diff --git a/kernel-d-timer/timer-business/src/main/java/cn/stylefeng/roses/kernel/timer/modular/service/impl/SysTimersServiceImpl.java b/kernel-d-timer/timer-business/src/main/java/cn/stylefeng/roses/kernel/timer/modular/service/impl/SysTimersServiceImpl.java index e2f17f66d..3af4d419c 100644 --- a/kernel-d-timer/timer-business/src/main/java/cn/stylefeng/roses/kernel/timer/modular/service/impl/SysTimersServiceImpl.java +++ b/kernel-d-timer/timer-business/src/main/java/cn/stylefeng/roses/kernel/timer/modular/service/impl/SysTimersServiceImpl.java @@ -28,6 +28,8 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; import java.util.Collection; import java.util.List; import java.util.Map; @@ -81,7 +83,7 @@ public class SysTimersServiceImpl extends ServiceImpl page(SysTimersParam sysTimersParam) { + public PageResult findPage(SysTimersParam sysTimersParam) { // 构造条件 LambdaQueryWrapper queryWrapper = createWrapper(sysTimersParam); @@ -140,7 +142,7 @@ public class SysTimersServiceImpl extends ServiceImpl list(SysTimersParam sysTimersParam) { + public List findList(SysTimersParam sysTimersParam) { LambdaQueryWrapper queryWrapper = createWrapper(sysTimersParam); return this.list(queryWrapper); } @@ -184,14 +186,18 @@ public class SysTimersServiceImpl extends ServiceImpl queryWrapper = new LambdaQueryWrapper<>(); if (ObjectUtil.isNotNull(sysTimersParam)) { + String timerName = sysTimersParam.getTimerName(); + Integer jobStatus = sysTimersParam.getJobStatus(); + String actionClass = sysTimersParam.getActionClass(); + // 拼接查询条件-任务名称 - if (ObjectUtil.isNotEmpty(sysTimersParam.getTimerName())) { - queryWrapper.like(SysTimers::getTimerName, sysTimersParam.getTimerName()); - } + queryWrapper.like(ObjectUtil.isNotEmpty(timerName), SysTimers::getTimerName, timerName); + // 拼接查询条件-状态(字典 1运行 2停止) - if (ObjectUtil.isNotEmpty(sysTimersParam.getJobStatus())) { - queryWrapper.like(SysTimers::getJobStatus, sysTimersParam.getJobStatus()); - } + queryWrapper.like(ObjectUtil.isNotNull(jobStatus), SysTimers::getJobStatus, jobStatus); + + // 拼接查询条件-类名 + queryWrapper.like(ObjectUtil.isNotEmpty(actionClass), SysTimers::getActionClass, actionClass); } // 查询未删除的