update:syscofig优化
parent
6dc33d9fbc
commit
4a3da101e3
|
@ -94,17 +94,13 @@ public class SysConfigDataImpl implements ISysConfigData, IJPACommData<SysConfig
|
|||
@Override
|
||||
public Paging<SysConfig> findAll(PageRequest<SysConfig> pageRequest) {
|
||||
SysConfig query = pageRequest.getData();
|
||||
Predicate predicate = PredicateBuilder.instance(tbSysConfig.configId.isNotNull())
|
||||
.and(StringUtils.isNotEmpty(query.getConfigKey()), () -> tbSysConfig.configKey.eq(query.getConfigKey()))
|
||||
|
||||
Predicate predicate = PredicateBuilder.instance()
|
||||
.and(StringUtils.isNotEmpty(query.getConfigName()), () -> tbSysConfig.configName.like(query.getConfigName()))
|
||||
.and(StringUtils.isNotEmpty(query.getConfigType()), () -> tbSysConfig.configType.eq(query.getConfigType()))
|
||||
.and(StringUtils.isNotEmpty(query.getConfigKey()), () -> tbSysConfig.configKey.like(query.getConfigKey()))
|
||||
.build();
|
||||
|
||||
// TODO: 2023/5/26 抽成通用工具类方法
|
||||
|
||||
Page<TbSysConfig> all = baseRepository.findAll(predicate, PageBuilder.toPageable(pageRequest));
|
||||
return PageBuilder.toPaging(all, SysConfig.class);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -9,11 +9,10 @@
|
|||
*/
|
||||
package cc.iotkit.temporal.ts.service;
|
||||
|
||||
import cc.iotkit.model.Paging;
|
||||
import cc.iotkit.common.api.Paging;
|
||||
import cc.iotkit.model.rule.RuleLog;
|
||||
import cc.iotkit.temporal.IRuleLogData;
|
||||
import cc.iotkit.temporal.ts.dao.TsTemplate;
|
||||
//import cc.iotkit.temporal.ts.dm.TableManager;
|
||||
import cc.iotkit.temporal.ts.dm.TableManager;
|
||||
import cc.iotkit.temporal.ts.model.TsRuleLog;
|
||||
import org.jooq.*;
|
||||
|
@ -26,7 +25,10 @@ import java.util.Date;
|
|||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static org.jooq.impl.DSL.*;
|
||||
import static org.jooq.impl.DSL.field;
|
||||
import static org.jooq.impl.DSL.table;
|
||||
|
||||
//import cc.iotkit.temporal.ts.dm.TableManager;
|
||||
|
||||
@Service
|
||||
public class RuleLogDataImpl implements IRuleLogData {
|
||||
|
|
|
@ -3,21 +3,24 @@ package cc.iotkit.system.controller;
|
|||
import cc.iotkit.common.api.PageRequest;
|
||||
import cc.iotkit.common.api.Paging;
|
||||
import cc.iotkit.common.api.Request;
|
||||
import cc.iotkit.common.excel.utils.ExcelUtil;
|
||||
import cc.iotkit.common.log.annotation.Log;
|
||||
import cc.iotkit.common.log.enums.BusinessType;
|
||||
import cc.iotkit.common.excel.utils.ExcelUtil;
|
||||
import cc.iotkit.common.validate.EditGroup;
|
||||
import cc.iotkit.common.validate.QueryGroup;
|
||||
import cc.iotkit.common.web.core.BaseController;
|
||||
import cc.iotkit.system.dto.bo.SysConfigBo;
|
||||
import cc.iotkit.system.dto.vo.SysConfigVo;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cc.iotkit.system.service.ISysConfigService;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
@ -48,9 +51,9 @@ public class SysConfigController extends BaseController {
|
|||
@Log(title = "参数管理", businessType = BusinessType.EXPORT)
|
||||
@SaCheckPermission("system:config:export")
|
||||
@PostMapping("/export")
|
||||
public void export(@RequestBody @Validated(QueryGroup.class) Request<SysConfigBo> request,
|
||||
public void export(@RequestBody @Validated(QueryGroup.class) Request<SysConfigBo> config,
|
||||
HttpServletResponse response) {
|
||||
List<SysConfigVo> list = configService.selectConfigList(request.getData());
|
||||
List<SysConfigVo> list = configService.selectConfigList(config.getData());
|
||||
ExcelUtil.exportExcel(list, "参数数据", SysConfigVo.class, response);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue