Merge remote-tracking branch 'origin/group7-config-business'

pull/3/head
fengshuonan 2021-02-06 19:40:42 +08:00
commit 36dd0e1226
6 changed files with 41 additions and 35 deletions

View File

@ -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();
}
@ -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));
}
}

View File

@ -64,7 +64,7 @@ public interface SysConfigService extends IService<SysConfig> {
* @author fengshuonan
* @date 2020/4/14 11:15
*/
void delete(SysConfigParam sysConfigParam);
void del(SysConfigParam sysConfigParam);
/**
*
@ -84,7 +84,7 @@ public interface SysConfigService extends IService<SysConfig> {
* @author fengshuonan
* @date 2020/4/14 11:14
*/
PageResult<SysConfig> page(SysConfigParam sysConfigParam);
PageResult<SysConfig> findPage(SysConfigParam sysConfigParam);
/**
*
@ -94,6 +94,6 @@ public interface SysConfigService extends IService<SysConfig> {
* @author fengshuonan
* @date 2020/4/14 11:14
*/
List<SysConfig> list(SysConfigParam sysConfigParam);
List<SysConfig> findList(SysConfigParam sysConfigParam);
}

View File

@ -69,7 +69,7 @@ public class SysConfigServiceImpl extends ServiceImpl<SysConfigMapper, SysConfig
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(SysConfigParam sysConfigParam) {
public void del(SysConfigParam sysConfigParam) {
// 1.根据id获取常量
SysConfig sysConfig = this.querySysConfig(sysConfigParam);
@ -98,14 +98,14 @@ public class SysConfigServiceImpl extends ServiceImpl<SysConfigMapper, SysConfig
}
@Override
public PageResult<SysConfig> page(SysConfigParam sysConfigParam) {
public PageResult<SysConfig> findPage(SysConfigParam sysConfigParam) {
LambdaQueryWrapper<SysConfig> wrapper = createWrapper(sysConfigParam);
Page<SysConfig> page = this.page(PageFactory.defaultPage(), wrapper);
return PageResultFactory.createPageResult(page);
}
@Override
public List<SysConfig> list(SysConfigParam sysConfigParam) {
public List<SysConfig> findList(SysConfigParam sysConfigParam) {
LambdaQueryWrapper<SysConfig> wrapper = createWrapper(sysConfigParam);
return this.list(wrapper);
}
@ -135,20 +135,20 @@ public class SysConfigServiceImpl extends ServiceImpl<SysConfigMapper, SysConfig
LambdaQueryWrapper<SysConfig> 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);
}
// 查询未删除的

View File

@ -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);
}
}
}

View File

@ -40,7 +40,7 @@ public interface SysTimersService extends IService<SysTimers> {
* @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<SysTimers> {
* @author stylefeng
* @date 2020/6/30 18:26
*/
PageResult<SysTimers> page(SysTimersParam sysTimersParam);
PageResult<SysTimers> findPage(SysTimersParam sysTimersParam);
/**
*
@ -88,7 +88,7 @@ public interface SysTimersService extends IService<SysTimers> {
* @author stylefeng
* @date 2020/6/30 18:26
*/
List<SysTimers> list(SysTimersParam sysTimersParam);
List<SysTimers> findList(SysTimersParam sysTimersParam);
/**
*

View File

@ -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<SysTimersMapper, SysTimers
}
@Override
public void delete(SysTimersParam sysTimersParam) {
public void del(SysTimersParam sysTimersParam) {
// 先停止id为参数id的定时器
CronUtil.remove(String.valueOf(sysTimersParam.getTimerId()));
@ -129,7 +131,7 @@ public class SysTimersServiceImpl extends ServiceImpl<SysTimersMapper, SysTimers
}
@Override
public PageResult<SysTimers> page(SysTimersParam sysTimersParam) {
public PageResult<SysTimers> findPage(SysTimersParam sysTimersParam) {
// 构造条件
LambdaQueryWrapper<SysTimers> queryWrapper = createWrapper(sysTimersParam);
@ -140,7 +142,7 @@ public class SysTimersServiceImpl extends ServiceImpl<SysTimersMapper, SysTimers
}
@Override
public List<SysTimers> list(SysTimersParam sysTimersParam) {
public List<SysTimers> findList(SysTimersParam sysTimersParam) {
LambdaQueryWrapper<SysTimers> queryWrapper = createWrapper(sysTimersParam);
return this.list(queryWrapper);
}
@ -184,14 +186,18 @@ public class SysTimersServiceImpl extends ServiceImpl<SysTimersMapper, SysTimers
LambdaQueryWrapper<SysTimers> 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);
}
// 查询未删除的