feat: 新增预警规则查询接口
This commit is contained in:
parent
c8eb64379c
commit
0dfd6d04cd
@ -24,6 +24,10 @@ public class MsWarnRuleB implements Serializable {
|
|||||||
@TableField("RULE_TYPE")
|
@TableField("RULE_TYPE")
|
||||||
private String ruleType;
|
private String ruleType;
|
||||||
|
|
||||||
|
/** 预警规则类型名称(字典转换) */
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String ruleTypeName;
|
||||||
|
|
||||||
/** 预警规则名称 */
|
/** 预警规则名称 */
|
||||||
@TableField("RULE_NAME")
|
@TableField("RULE_NAME")
|
||||||
private String ruleName;
|
private String ruleName;
|
||||||
|
|||||||
@ -9,11 +9,14 @@ import com.yfd.platform.qgc_base.mapper.MsWarnRuleBMapper;
|
|||||||
import com.yfd.platform.qgc_base.service.IMsOperationLogService;
|
import com.yfd.platform.qgc_base.service.IMsOperationLogService;
|
||||||
import com.yfd.platform.qgc_base.service.IMsWarnRuleBService;
|
import com.yfd.platform.qgc_base.service.IMsWarnRuleBService;
|
||||||
import com.yfd.platform.utils.DataSourceRequestUtil;
|
import com.yfd.platform.utils.DataSourceRequestUtil;
|
||||||
|
import com.yfd.platform.utils.DictCodeToNameConverter;
|
||||||
|
import com.yfd.platform.utils.CodeToNameMetadataBo;
|
||||||
import com.yfd.platform.utils.SecurityUtils;
|
import com.yfd.platform.utils.SecurityUtils;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -25,12 +28,28 @@ public class MsWarnRuleBServiceImpl extends ServiceImpl<MsWarnRuleBMapper, MsWar
|
|||||||
|
|
||||||
private static final String TABLE_NAME = "MS_WARN_RULE_B";
|
private static final String TABLE_NAME = "MS_WARN_RULE_B";
|
||||||
|
|
||||||
|
private static final List<CodeToNameMetadataBo> CODE_TO_NAME_META_LIST = new ArrayList<>();
|
||||||
|
|
||||||
|
static {
|
||||||
|
CODE_TO_NAME_META_LIST.add(CodeToNameMetadataBo.builder()
|
||||||
|
.codeProperty("ruleType")
|
||||||
|
.modifyProperty("ruleTypeName")
|
||||||
|
.dictType("STATIC")
|
||||||
|
.dictSource("WARN_RULE_TYPE")
|
||||||
|
.build());
|
||||||
|
}
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private IMsOperationLogService msOperationLogService;
|
private IMsOperationLogService msOperationLogService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private DictCodeToNameConverter dictCodeToNameConverter;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Page<MsWarnRuleB> queryPageList(DataSourceRequest request) {
|
public Page<MsWarnRuleB> queryPageList(DataSourceRequest request) {
|
||||||
return DataSourceRequestUtil.executeQuery(request, MsWarnRuleB.class, this);
|
Page<MsWarnRuleB> page = DataSourceRequestUtil.executeQuery(request, MsWarnRuleB.class, this);
|
||||||
|
dictCodeToNameConverter.convertCodeToName(page, CODE_TO_NAME_META_LIST);
|
||||||
|
return page;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@ -0,0 +1,33 @@
|
|||||||
|
package com.yfd.platform.qgc_sys.warnRule.controller;
|
||||||
|
|
||||||
|
import com.yfd.platform.common.DataSourceRequest;
|
||||||
|
import com.yfd.platform.config.ResponseResult;
|
||||||
|
import com.yfd.platform.qgc_base.domain.MsWarnRuleB;
|
||||||
|
import com.yfd.platform.qgc_base.service.IMsWarnRuleBService;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 告警规则控制器
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/sys/warnRule")
|
||||||
|
@Tag(name = "告警规则配置管理")
|
||||||
|
public class MsWarnRuleBController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IMsWarnRuleBService msWarnRuleBService;
|
||||||
|
|
||||||
|
@PostMapping("/GetKendoListCust")
|
||||||
|
@Operation(summary = "条件过滤数据列表")
|
||||||
|
public ResponseResult getKendoList(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||||
|
return ResponseResult.successData(msWarnRuleBService.queryPageList(dataSourceRequest));
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user