新增预警/告警技术监督数据
This commit is contained in:
@@ -26,6 +26,7 @@ public interface ServerInfo {
|
||||
String HARMONIC_PREPARE = "harmonic-prepare";
|
||||
String EVENT_PREPARE = "event-prepare";
|
||||
String PROCESS = "process-boot";
|
||||
String PREPARE_BOOT = "prepare-boot";
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -118,6 +118,13 @@ spring:
|
||||
- SwaggerHeaderFilter
|
||||
- StripPrefix=1
|
||||
|
||||
- id: prepare-boot
|
||||
uri: lb://prepare-boot
|
||||
predicates:
|
||||
- Path=/prepare-boot/**
|
||||
filters:
|
||||
- SwaggerHeaderFilter
|
||||
- StripPrefix=1
|
||||
#项目日志的配置
|
||||
logging:
|
||||
config: http://@nacos.url@/nacos/v1/cs/configs?tenant=@nacos.namespace@&group=DEFAULT_GROUP&dataId=logback.xml
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.njcn.harmonic.pojo.vo;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@ToString
|
||||
@Builder
|
||||
public class SourceSteadyIndicator {
|
||||
|
||||
private String id;
|
||||
private String interferenceSource;
|
||||
|
||||
private Integer operation;
|
||||
|
||||
private List<String> steadyIndicator;
|
||||
|
||||
/**
|
||||
* 部门Id
|
||||
*/
|
||||
private String deptId;
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String createBy;
|
||||
/**
|
||||
* 类型(0:预警;1:告警)
|
||||
*/
|
||||
private Integer type;
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package com.njcn.harmonic.pojo.vo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@ToString
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class ThsStrategyVo {
|
||||
@ApiModelProperty(value = "预警单id")
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty(value = "预警单名称")
|
||||
@TableField("Name")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "等级(0:一级;1:二级;2:三级)")
|
||||
|
||||
private Integer grade;
|
||||
|
||||
@ApiModelProperty(value = "关系(0:与;1:或)只存在于指标类型中")
|
||||
|
||||
private Integer operation;
|
||||
|
||||
@ApiModelProperty(value = "区分预警单还是告警单(0:预警单;1:告警单)")
|
||||
private Integer type;
|
||||
|
||||
@ApiModelProperty(value = "0.删除 1.正常")
|
||||
|
||||
private Integer state;
|
||||
|
||||
@TableField("Create_By")
|
||||
private String createBy;
|
||||
|
||||
@TableField("Update_By")
|
||||
private String updateBy;
|
||||
/**
|
||||
* 部门Id
|
||||
*/
|
||||
private String deptId;
|
||||
/**
|
||||
* 稳态指标id
|
||||
*/
|
||||
private List<String> steadyIndicator;
|
||||
/**
|
||||
* 干扰源类型id
|
||||
*/
|
||||
private List<String> interferenceSource;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.njcn.prepare.harmonic.api.line;
|
||||
|
||||
import com.njcn.common.pojo.constant.ServerInfo;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.prepare.harmonic.api.line.fallback.CoustomReportFeignClientFallbackFactory;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
@FeignClient(
|
||||
value = ServerInfo.PREPARE_BOOT,//对应模块名
|
||||
path = "/thsSupervise",//对应controller请求类
|
||||
fallbackFactory = CoustomReportFeignClientFallbackFactory.class//服务降级处理类
|
||||
)
|
||||
public interface ThsSuperviseClient {
|
||||
/**
|
||||
* 预警/告警事务的生成
|
||||
*
|
||||
* @param initType 生成方式 0 自动;1 手动
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/initSupervise")
|
||||
HttpResult<Boolean> initSupervise(@RequestParam("initType") Integer initType);
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.njcn.prepare.harmonic.api.line.fallback;
|
||||
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.device.pq.utils.DeviceEnumUtil;
|
||||
import com.njcn.prepare.harmonic.api.line.ThsSuperviseClient;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
public class ThsSuperviseClientFallbackFactory implements FallbackFactory<ThsSuperviseClient> {
|
||||
@Override
|
||||
public ThsSuperviseClient create(Throwable throwable) {
|
||||
Enum<?> exceptionEnum = CommonResponseEnum.SERVICE_FALLBACK;
|
||||
if (throwable.getCause() instanceof BusinessException) {
|
||||
BusinessException businessException = (BusinessException) throwable.getCause();
|
||||
exceptionEnum = DeviceEnumUtil.getExceptionEnum(businessException.getResult());
|
||||
}
|
||||
Enum<?> finalExceptionEnum = exceptionEnum;
|
||||
return new ThsSuperviseClient() {
|
||||
@Override
|
||||
public HttpResult<Boolean> initSupervise(@RequestParam("initType") Integer initType) {
|
||||
log.error("{}异常,降级处理,异常为:{}", "预警/告警事务的生成: ", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -154,6 +154,11 @@
|
||||
<artifactId>orai18n</artifactId>
|
||||
<version>21.1.0.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.njcn</groupId>
|
||||
<artifactId>process-api</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.njcn.prepare.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
public enum GradeEnum {
|
||||
ONE_LEVEL(0, "一级"),
|
||||
TWO_LEVEL(1, "二级"),
|
||||
THREE_LEVEL(2, "三级");
|
||||
|
||||
private final Integer code;
|
||||
|
||||
private final String message;
|
||||
|
||||
GradeEnum(Integer code, String message) {
|
||||
this.code = code;
|
||||
this.message = message;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.njcn.prepare.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
public enum InitTypeEnum {
|
||||
AUTO(0, "自动"),
|
||||
MANUAL(1, "手动");
|
||||
private final Integer code;
|
||||
|
||||
private final String message;
|
||||
|
||||
InitTypeEnum(Integer code, String message) {
|
||||
this.code = code;
|
||||
this.message = message;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.njcn.prepare.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 干扰源类型枚举
|
||||
*/
|
||||
@Getter
|
||||
public enum InterferenceTypeEnum {
|
||||
Electric_Load("Electric_Load", "电加热负荷"),
|
||||
Electrolytic_Load("Electrolytic_Load", "电解负荷"),
|
||||
Transportation_Hubs("Transportation_Hubs", "交通枢纽"),
|
||||
Nonlinear_Loads("Nonlinear_Loads", "非线性负荷"),
|
||||
Electrified_Railways("Electrified_Railways", "电气化铁路"),
|
||||
Fre_Equipment("Fre_Equipment", "变频调速设备"),
|
||||
Mill("Mill", "轧机"),
|
||||
Medium_Furnace("Medium_Furnace", "中频炉"),
|
||||
Precision_Mach("Precision_Mach", "精密加工"),
|
||||
Com_Muni("Com_Muni", "商业/市政"),
|
||||
AC_DC_Inverter("AC_DC_Inverter", "交直流逆变器"),
|
||||
Shock_Loads("Shock_Loads", "冲击性负荷"),
|
||||
Electric_Weld_Load("Electric_Weld_Load", "电焊负荷"),
|
||||
dycs("dycs", "电压测试"),
|
||||
dlcs("dlcs", "电流测试"),
|
||||
Zlzz("Zlzz", "整流装置"),
|
||||
Hospital("Hospital", "医院"),
|
||||
Manufacturing("Manufacturing", "半导体制造");
|
||||
|
||||
private final String code;
|
||||
|
||||
private final String message;
|
||||
|
||||
InterferenceTypeEnum(String code, String message) {
|
||||
this.code = code;
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.njcn.prepare.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
public enum OperationEnum {
|
||||
|
||||
AND(0, "与"),
|
||||
OR(1, "或");
|
||||
private final Integer code;
|
||||
|
||||
private final String message;
|
||||
|
||||
OperationEnum(Integer code, String message) {
|
||||
this.code = code;
|
||||
this.message = message;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.njcn.prepare.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
public enum ProgressEnum {
|
||||
|
||||
START(0, "开始");
|
||||
|
||||
private final Integer code;
|
||||
|
||||
private final String message;
|
||||
|
||||
ProgressEnum(Integer code, String message) {
|
||||
this.code = code;
|
||||
this.message = message;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.njcn.prepare.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
/**
|
||||
* 指标参数类型枚举
|
||||
*/
|
||||
@Getter
|
||||
public enum SteadyIndicatorEnum {
|
||||
|
||||
Negative_Voltage("Negative_Voltage", "与负序电压不平衡度"),
|
||||
Interhar_Voltage("Interhar_Voltage", "间谐波电压"),
|
||||
Neg_Current("Neg_Current", "负序电流"),
|
||||
Fre_Deviation("Fre_Deviation", "频率偏差"),
|
||||
Voltage_Dev("Voltage_Dev", "电压偏差"),
|
||||
Har_Current("Har_Current", "谐波电流"),
|
||||
Voltage_Fluc("Voltage_Fluc", "电压波动与闪变"),
|
||||
Har_Voltage("Har_Voltage", "谐波电压");
|
||||
|
||||
private final String code;
|
||||
|
||||
private final String message;
|
||||
|
||||
SteadyIndicatorEnum(String code, String message) {
|
||||
this.code = code;
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public static SteadyIndicatorEnum getSteadyIndicatorEnumByCode(String code) {
|
||||
for (SteadyIndicatorEnum steadyIndicatorEnum : SteadyIndicatorEnum.values()) {
|
||||
if (StringUtils.equals(code, steadyIndicatorEnum.getCode())) {
|
||||
return steadyIndicatorEnum;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.njcn.prepare.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
public enum TypeEnum {
|
||||
MONITOR_TYPE(0, "指标类型"),
|
||||
INTERFERENCE_TYPE(1, "指标类型"),
|
||||
SOURCE_TYPE(2, "干扰源类型");
|
||||
|
||||
|
||||
private final Integer code;
|
||||
|
||||
private final String message;
|
||||
|
||||
TypeEnum(Integer code, String message) {
|
||||
this.code = code;
|
||||
this.message = message;
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,15 @@
|
||||
package com.njcn.prepare.harmonic.controller.line;
|
||||
|
||||
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.prepare.harmonic.service.mysql.line.ThsSuperviseService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
@@ -16,6 +23,14 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
@RestController
|
||||
@RequestMapping("/thsSupervise")
|
||||
public class ThsSuperviseController extends BaseController {
|
||||
@Autowired
|
||||
private ThsSuperviseService thsSuperviseService;
|
||||
|
||||
@ApiOperation("预警/告警事务生成")
|
||||
@ApiImplicitParam(name = "initType", value = "生成策略 0 自动;1 手动", required = true)
|
||||
@PostMapping("/initSupervise")
|
||||
public HttpResult<Boolean> initSupervise(@RequestParam("initType") Integer initType) {
|
||||
return thsSuperviseService.initSupervise(initType);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.njcn.prepare.harmonic.mapper.mysql.line;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.process.pojo.po.LimitRate;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -11,6 +12,7 @@ import com.njcn.process.pojo.po.LimitRate;
|
||||
* @author lxp
|
||||
* @since 2023-03-16
|
||||
*/
|
||||
@Mapper
|
||||
public interface LimitRateMapper extends BaseMapper<LimitRate> {
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.njcn.prepare.harmonic.mapper.mysql.line;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.device.pms.pojo.po.Monitor;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @author yzh
|
||||
* @date 2022/10/17
|
||||
*/
|
||||
|
||||
@Mapper
|
||||
public interface PmsMonitorMapper extends BaseMapper<Monitor> {
|
||||
|
||||
}
|
||||
@@ -1,7 +1,9 @@
|
||||
package com.njcn.prepare.harmonic.mapper.mysql.line;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.process.pojo.po.ThsOverRunLog;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -11,6 +13,8 @@ import com.njcn.process.pojo.po.ThsOverRunLog;
|
||||
* @author lxp
|
||||
* @since 2023-03-16
|
||||
*/
|
||||
@DS("process")
|
||||
@Mapper
|
||||
public interface ThsOverRunLogMapper extends BaseMapper<ThsOverRunLog> {
|
||||
|
||||
}
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
package com.njcn.prepare.harmonic.mapper.mysql.line;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.process.pojo.po.ThsSupervise;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -11,6 +13,8 @@ import com.njcn.process.pojo.po.ThsSupervise;
|
||||
* @author lxp
|
||||
* @since 2023-03-16
|
||||
*/
|
||||
@DS("process")
|
||||
@Mapper
|
||||
public interface ThsSuperviseMapper extends BaseMapper<ThsSupervise> {
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.njcn.prepare.harmonic.mapper.mysql.line;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.process.pojo.po.ThsWarnStrategyAss;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author wr
|
||||
* @since 2023-03-10
|
||||
*/
|
||||
@DS("process")
|
||||
@Mapper
|
||||
public interface ThsWarnStrategyAssMapper extends BaseMapper<ThsWarnStrategyAss> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.njcn.prepare.harmonic.mapper.mysql.line;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.harmonic.pojo.vo.ThsStrategyVo;
|
||||
import com.njcn.process.pojo.po.ThsWarnStrategy;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author wr
|
||||
* @since 2023-03-10
|
||||
*/
|
||||
@DS("process")
|
||||
@Mapper
|
||||
public interface ThsWarnStrategyMapper extends BaseMapper<ThsWarnStrategy> {
|
||||
/**
|
||||
* 查询策略的集合
|
||||
*/
|
||||
List<ThsStrategyVo> selectStrategyList(@Param("initType") Integer initType);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.prepare.harmonic.mapper.mysql.line.ThsWarnStrategyAssMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.njcn.process.pojo.po.ThsWarnStrategyAss">
|
||||
<id column="Warn_Id" property="warnId" />
|
||||
<result column="Ass_Id" property="assId" />
|
||||
<result column="Type" property="type" />
|
||||
</resultMap>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,29 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.prepare.harmonic.mapper.mysql.line.ThsWarnStrategyMapper">
|
||||
|
||||
<!--查询策略的集合-->
|
||||
<select id="selectStrategyList" resultType="com.njcn.harmonic.pojo.vo.ThsStrategyVo">
|
||||
select
|
||||
tws.id,
|
||||
tws.name,
|
||||
tws.grade,
|
||||
tws.operation,
|
||||
tws.type,
|
||||
tda.dept_Id as deptId
|
||||
from
|
||||
ths_warn_strategy tws
|
||||
left join ths_dept_alarm tda on
|
||||
tws.Id = tda.Alarm_Id
|
||||
<where>
|
||||
<choose>
|
||||
<when test="initType==0">
|
||||
tws.State = 1 and tws.Grade in(0,2)
|
||||
</when>
|
||||
<when test="initType==1">
|
||||
tws.State = 1 and tws.Grade in(1,2)
|
||||
</when>
|
||||
</choose>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -1,11 +1,38 @@
|
||||
package com.njcn.prepare.harmonic.service.mysql.Impl.line;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.prepare.harmonic.mapper.mysql.line.ThsSuperviseMapper;
|
||||
import com.njcn.common.pojo.dto.SimpleDTO;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.device.pms.api.PmsGeneralDeviceInfoClient;
|
||||
import com.njcn.device.pms.pojo.dto.PmsGeneralDeviceDTO;
|
||||
import com.njcn.device.pms.pojo.param.PmsDeviceInfoParam;
|
||||
import com.njcn.device.pms.pojo.po.Monitor;
|
||||
import com.njcn.harmonic.pojo.vo.SourceSteadyIndicator;
|
||||
import com.njcn.harmonic.pojo.vo.ThsStrategyVo;
|
||||
import com.njcn.prepare.enums.*;
|
||||
import com.njcn.prepare.harmonic.mapper.mysql.line.*;
|
||||
import com.njcn.prepare.harmonic.service.mysql.line.ThsSuperviseService;
|
||||
import com.njcn.process.pojo.po.LimitRate;
|
||||
import com.njcn.process.pojo.po.ThsOverRunLog;
|
||||
import com.njcn.process.pojo.po.ThsSupervise;
|
||||
import com.njcn.process.pojo.po.ThsWarnStrategyAss;
|
||||
import com.njcn.system.api.DicDataFeignClient;
|
||||
import com.njcn.system.pojo.po.DictData;
|
||||
import org.apache.commons.collections.map.HashedMap;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
@@ -17,4 +44,363 @@ import org.springframework.stereotype.Service;
|
||||
@Service
|
||||
public class ThsSuperviseServiceImpl extends ServiceImpl<ThsSuperviseMapper, ThsSupervise> implements ThsSuperviseService {
|
||||
|
||||
@Autowired
|
||||
private PmsGeneralDeviceInfoClient pmsGeneralDeviceInfoClient;
|
||||
|
||||
@Autowired
|
||||
private ThsWarnStrategyMapper thsWarnStrategyMapper;
|
||||
@Autowired
|
||||
private ThsWarnStrategyAssMapper thsWarnStrategyAssMapper;
|
||||
@Autowired
|
||||
private PmsMonitorMapper pmsMonitorMapper;
|
||||
@Autowired
|
||||
private LimitRateMapper limitRateMapper;
|
||||
@Autowired
|
||||
private DicDataFeignClient dicDataFeignClient;
|
||||
@Autowired
|
||||
private ThsSuperviseMapper thsSuperviseMapper;
|
||||
@Autowired
|
||||
private ThsOverRunLogMapper thsOverRunLogMapper;
|
||||
|
||||
@Override
|
||||
public HttpResult<Boolean> initSupervise(Integer initType) {
|
||||
if (initType == null) {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.INVALID_PARAMETER, false, "");
|
||||
}
|
||||
List<ThsStrategyVo> thsStrategyList = this.selectStrategyList(initType);
|
||||
//按部门进行分组
|
||||
if (CollectionUtil.isNotEmpty(thsStrategyList)) {
|
||||
Map<String, List<ThsStrategyVo>> deptMap = thsStrategyList.stream().collect(Collectors.groupingBy(ThsStrategyVo::getDeptId));
|
||||
for (Map.Entry<String, List<ThsStrategyVo>> entry : deptMap.entrySet()) {
|
||||
String deptId = entry.getKey();
|
||||
List<ThsStrategyVo> deptList = entry.getValue();
|
||||
List<ThsStrategyVo> oneLevel = deptList.stream().filter(r -> r.getGrade().equals(GradeEnum.ONE_LEVEL.getCode())).collect(Collectors.toList());//一级策略集合
|
||||
List<SourceSteadyIndicator> oneSourceSteadyIndicatorList = new ArrayList<>();
|
||||
if (CollectionUtil.isNotEmpty(oneLevel)) {
|
||||
for (ThsStrategyVo oneStrategyVo : oneLevel) {
|
||||
List<ThsWarnStrategyAss> oneInterferenceSourceAsses = this.queryWarnStrategyAss(oneStrategyVo, TypeEnum.SOURCE_TYPE);//干扰源列表
|
||||
List<ThsWarnStrategyAss> oneSteadyIndicatorAsses = this.queryWarnStrategyAss(oneStrategyVo, TypeEnum.INTERFERENCE_TYPE);//干扰源列表
|
||||
List<String> oneSteadyIndicatorAssesIds = oneSteadyIndicatorAsses.stream().map(r -> r.getAssId()).collect(Collectors.toList());
|
||||
//封装每一种干扰源和对应的指标
|
||||
for (ThsWarnStrategyAss oneWarnStrategyAss : oneInterferenceSourceAsses) {
|
||||
SourceSteadyIndicator build = SourceSteadyIndicator.builder().id(oneStrategyVo.getId()).operation(oneStrategyVo.getOperation())
|
||||
.interferenceSource(oneWarnStrategyAss.getAssId())
|
||||
.steadyIndicator(oneSteadyIndicatorAssesIds)
|
||||
.deptId(oneStrategyVo.getDeptId())
|
||||
.type(oneStrategyVo.getType())
|
||||
.build();
|
||||
oneSourceSteadyIndicatorList.add(build);
|
||||
}
|
||||
}
|
||||
}
|
||||
List<ThsStrategyVo> threeLevel = deptList.stream().filter(r -> r.getGrade().equals(GradeEnum.THREE_LEVEL.getCode())).collect(Collectors.toList());//三级策略集合
|
||||
if (CollectionUtil.isNotEmpty(threeLevel)) {
|
||||
for (ThsStrategyVo threeStrategyVo : threeLevel) {
|
||||
List<ThsWarnStrategyAss> interferenceSourceAsses = this.queryWarnStrategyAss(threeStrategyVo, TypeEnum.SOURCE_TYPE);
|
||||
//干扰源类型id
|
||||
List<String> threeInterferenceSourceIds = interferenceSourceAsses.stream().map(p -> p.getAssId()).collect(Collectors.toList());
|
||||
List<ThsWarnStrategyAss> threeSteadyIndicatorAsses = this.queryWarnStrategyAss(threeStrategyVo, TypeEnum.INTERFERENCE_TYPE);
|
||||
//指标类型id
|
||||
List<String> steadyIndicatorIds = threeSteadyIndicatorAsses.stream().map(p -> p.getAssId()).collect(Collectors.toList());
|
||||
for (String threeInterferenceSourceId : threeInterferenceSourceIds) {
|
||||
if (OperationEnum.AND.getCode().equals(threeStrategyVo.getOperation())) {//处理三级策略的与
|
||||
Iterator<SourceSteadyIndicator> iterator = oneSourceSteadyIndicatorList.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
SourceSteadyIndicator sourceSteady = iterator.next();
|
||||
if (OperationEnum.AND.getCode().equals(sourceSteady.getOperation())) {
|
||||
if (StringUtils.equals(threeInterferenceSourceId, sourceSteady.getInterferenceSource()) &&
|
||||
steadyIndicatorIds.containsAll(sourceSteady.getSteadyIndicator())) {
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {//处理三级策略的或
|
||||
Iterator<SourceSteadyIndicator> iterator = oneSourceSteadyIndicatorList.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
SourceSteadyIndicator sourceSteady = iterator.next();
|
||||
if (StringUtils.equals(threeInterferenceSourceId, sourceSteady.getInterferenceSource())) {
|
||||
if (steadyIndicatorIds.containsAll(sourceSteady.getSteadyIndicator())) {
|
||||
iterator.remove();
|
||||
} else {
|
||||
List<String> steadyIndicator = sourceSteady.getSteadyIndicator();
|
||||
steadyIndicator.removeAll(steadyIndicatorIds);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//查询部门下所有监测点基本信息
|
||||
PmsDeviceInfoParam pmsDeviceInfoParam = new PmsDeviceInfoParam();
|
||||
pmsDeviceInfoParam.setDeptIndex(deptId);
|
||||
pmsDeviceInfoParam.setStatisticalType(new SimpleDTO());
|
||||
HttpResult<List<PmsGeneralDeviceDTO>> listHttpResult = pmsGeneralDeviceInfoClient.getPmsDeviceInfoWithInOrg(pmsDeviceInfoParam);
|
||||
List<PmsGeneralDeviceDTO> dataList = listHttpResult.getData();
|
||||
if (CollectionUtil.isNotEmpty(dataList) && CollectionUtil.isNotEmpty(oneSourceSteadyIndicatorList)) {
|
||||
dataList.forEach(r -> {
|
||||
List<String> monitorIdList = r.getMonitorIdList();
|
||||
//查询所有监测点详细信息集合
|
||||
List<Monitor> monitors = pmsMonitorMapper.selectList(new LambdaQueryWrapper<Monitor>().in(Monitor::getId, monitorIdList));
|
||||
monitors.forEach(monitor -> {
|
||||
oneSourceSteadyIndicatorList.forEach(steady -> {
|
||||
if (StringUtils.equals(monitor.getMonitorTag(), steady.getInterferenceSource())) {//匹配该监测点属于的干扰源类型
|
||||
//查询该监测点的检测数据
|
||||
LimitRate limitRate = this.queryLimitTargetData(monitor.getId());
|
||||
//判断指标是否超标
|
||||
Map<String, Boolean> limitBoolMap = this.verifyLimit(limitRate, steady);
|
||||
//生成监督数据
|
||||
this.creatSuperviseData(steady, limitBoolMap, monitor, limitRate);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, "");
|
||||
}
|
||||
|
||||
|
||||
@DS("process")
|
||||
@Override
|
||||
public List<ThsStrategyVo> selectStrategyList(Integer initType) {
|
||||
List<ThsStrategyVo> thsStrategyList = thsWarnStrategyMapper.selectStrategyList(initType);
|
||||
return thsStrategyList;
|
||||
}
|
||||
|
||||
|
||||
@DS("process")
|
||||
@Override
|
||||
public List<ThsWarnStrategyAss> queryWarnStrategyAss(ThsStrategyVo strategyVo, TypeEnum typeEnum) {
|
||||
List<ThsWarnStrategyAss> thsWarnStrategyAss = thsWarnStrategyAssMapper.selectList(new LambdaQueryWrapper<ThsWarnStrategyAss>()
|
||||
.eq(ThsWarnStrategyAss::getWarnId, strategyVo.getId())
|
||||
.eq(ThsWarnStrategyAss::getType, typeEnum.getCode()));
|
||||
return thsWarnStrategyAss;
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成监督数据
|
||||
*
|
||||
* @param limitBoolMap
|
||||
*/
|
||||
@Override
|
||||
public void creatSuperviseData(SourceSteadyIndicator steady, Map<String, Boolean> limitBoolMap, Monitor monitor, LimitRate limitRate) {
|
||||
if (CollectionUtil.isNotEmpty(limitBoolMap)) {
|
||||
if (OperationEnum.AND.getCode().equals(steady.getOperation())) {
|
||||
for (Map.Entry<String, Boolean> entry : limitBoolMap.entrySet()) {
|
||||
if (!entry.getValue()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
//判断今日是否已经生成了监督数据
|
||||
LambdaQueryWrapper<ThsSupervise> superviseQueryWrapper = new LambdaQueryWrapper<>();
|
||||
superviseQueryWrapper.between(ThsSupervise::getCreateTime,
|
||||
DateUtil.beginOfDay(DateUtil.offsetDay(new Date(), -1)),
|
||||
DateUtil.endOfDay(DateUtil.offsetDay(new Date(), -1)))
|
||||
.eq(ThsSupervise::getDeptId, steady.getDeptId())
|
||||
.eq(ThsSupervise::getType, steady.getType())
|
||||
.last("limit 1");
|
||||
ThsSupervise thsSupervise = thsSuperviseMapper.selectOne(superviseQueryWrapper);
|
||||
if (thsSupervise == null) {
|
||||
//生成监督数据
|
||||
thsSupervise = this.insertSuperviseData(steady, monitor, limitRate);
|
||||
}
|
||||
//生成告警/预警监测点列表数据
|
||||
this.insertOverRunLog(steady, thsSupervise, monitor, limitRate);
|
||||
}
|
||||
if (OperationEnum.OR.getCode().equals(steady.getOperation())) {
|
||||
for (Map.Entry<String, Boolean> entry : limitBoolMap.entrySet()) {
|
||||
if (entry.getValue()) {
|
||||
//生成监督数据
|
||||
ThsSupervise thsSupervise = this.insertSuperviseData(steady, monitor, limitRate);
|
||||
//生成告警/预警监测点列表数据
|
||||
this.insertOverRunLog(steady, thsSupervise, monitor, limitRate);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@DS("process")
|
||||
@Override
|
||||
public ThsSupervise insertSuperviseData(SourceSteadyIndicator steady, Monitor monitor, LimitRate limitRate) {
|
||||
ThsSupervise thsSupervise = new ThsSupervise();
|
||||
thsSupervise.setSupIndex(IdUtil.simpleUUID());
|
||||
thsSupervise.setName(monitor.getPowerrName() + "_" + monitor.getName() + "_" + DateUtil.today() + "_" + monitor.getId());
|
||||
thsSupervise.setDeptId(steady.getDeptId());
|
||||
thsSupervise.setCreateUser(steady.getCreateBy());
|
||||
thsSupervise.setCreateTime(new Date());
|
||||
thsSupervise.setType(steady.getType());
|
||||
thsSupervise.setCreateUser(steady.getCreateBy());
|
||||
thsSupervise.setProgress(ProgressEnum.START.getCode());
|
||||
thsSuperviseMapper.insert(thsSupervise);
|
||||
return thsSupervise;
|
||||
}
|
||||
|
||||
|
||||
@DS("process")
|
||||
@Override
|
||||
public void insertOverRunLog(SourceSteadyIndicator steady, ThsSupervise thsSupervise, Monitor monitor, LimitRate limitRate) {
|
||||
ThsOverRunLog thsOverRunLog = new ThsOverRunLog();
|
||||
thsOverRunLog.setId(IdUtil.simpleUUID());
|
||||
thsOverRunLog.setSupIndex(thsSupervise.getSupIndex());
|
||||
thsOverRunLog.setLineIndex(monitor.getId());
|
||||
thsOverRunLog.setName(monitor.getPowerrName() + "_" + monitor.getName() + "_" + DateUtil.today() + "_" + monitor.getId());
|
||||
thsOverRunLog.setUpdateTime(limitRate.getCreatTime());
|
||||
thsOverRunLogMapper.insert(thsOverRunLog);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@DS("pms")
|
||||
public LimitRate queryLimitTargetData(String monitorId) {
|
||||
LimitRate limitRate = limitRateMapper.selectOne(new LambdaQueryWrapper<LimitRate>().eq(LimitRate::getMyindex, monitorId)
|
||||
.between(LimitRate::getCreatTime,
|
||||
DateUtil.beginOfDay(DateUtil.offsetDay(new Date(), -1)),
|
||||
DateUtil.endOfDay(DateUtil.offsetDay(new Date(), -1))).last("limit 1"));
|
||||
return limitRate;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断监测数据是否超标
|
||||
*
|
||||
* @param limitRate
|
||||
* @param steady
|
||||
*/
|
||||
private Map<String, Boolean> verifyLimit(LimitRate limitRate, SourceSteadyIndicator steady) {
|
||||
if (limitRate != null) {
|
||||
List<String> steadyIndicator = steady.getSteadyIndicator();
|
||||
Map<String, Boolean> limitBoolMap = new HashedMap();
|
||||
steadyIndicator.forEach(id -> {
|
||||
HttpResult<DictData> dicDataById = dicDataFeignClient.getDicDataById(id);
|
||||
if (CommonResponseEnum.SUCCESS.getCode().equals(dicDataById.getCode()) && dicDataById.getData() != null) {
|
||||
SteadyIndicatorEnum steadyIndicatorEnum = SteadyIndicatorEnum.getSteadyIndicatorEnumByCode(dicDataById.getData().getCode());
|
||||
switch (steadyIndicatorEnum) {
|
||||
case Negative_Voltage://负序电压不平衡度
|
||||
if (limitRate.getUbalanceOvertime() > 0) {
|
||||
limitBoolMap.put(SteadyIndicatorEnum.Negative_Voltage.getCode(), true);
|
||||
} else {
|
||||
limitBoolMap.put(SteadyIndicatorEnum.Negative_Voltage.getCode(), false);
|
||||
}
|
||||
break;
|
||||
case Interhar_Voltage://间谐波电压
|
||||
if (limitRate.getInuharm1Overtime() > 0 ||
|
||||
limitRate.getInuharm2Overtime() > 0 ||
|
||||
limitRate.getInuharm3Overtime() > 0 ||
|
||||
limitRate.getInuharm4Overtime() > 0 ||
|
||||
limitRate.getInuharm5Overtime() > 0 ||
|
||||
limitRate.getInuharm6Overtime() > 0 ||
|
||||
limitRate.getInuharm7Overtime() > 0 ||
|
||||
limitRate.getInuharm8Overtime() > 0 ||
|
||||
limitRate.getInuharm9Overtime() > 0 ||
|
||||
limitRate.getInuharm10Overtime() > 0 ||
|
||||
limitRate.getInuharm11Overtime() > 0 ||
|
||||
limitRate.getInuharm12Overtime() > 0 ||
|
||||
limitRate.getInuharm13Overtime() > 0 ||
|
||||
limitRate.getInuharm14Overtime() > 0 ||
|
||||
limitRate.getInuharm15Overtime() > 0 ||
|
||||
limitRate.getInuharm16Overtime() > 0) {
|
||||
limitBoolMap.put(SteadyIndicatorEnum.Interhar_Voltage.getCode(), true);
|
||||
} else {
|
||||
limitBoolMap.put(SteadyIndicatorEnum.Interhar_Voltage.getCode(), false);
|
||||
}
|
||||
break;
|
||||
case Neg_Current://负序电流
|
||||
if (limitRate.getINegOvertime() > 0) {
|
||||
limitBoolMap.put(SteadyIndicatorEnum.Neg_Current.getCode(), true);
|
||||
} else {
|
||||
limitBoolMap.put(SteadyIndicatorEnum.Neg_Current.getCode(), false);
|
||||
}
|
||||
break;
|
||||
case Fre_Deviation://频率偏差
|
||||
if (limitRate.getFreqDevOvertime() > 0) {
|
||||
limitBoolMap.put(SteadyIndicatorEnum.Fre_Deviation.getCode(), true);
|
||||
} else {
|
||||
limitBoolMap.put(SteadyIndicatorEnum.Fre_Deviation.getCode(), false);
|
||||
}
|
||||
break;
|
||||
case Voltage_Dev://电压偏差
|
||||
if (limitRate.getVoltageDevOvertime() > 0) {
|
||||
limitBoolMap.put(SteadyIndicatorEnum.Voltage_Dev.getCode(), true);
|
||||
} else {
|
||||
limitBoolMap.put(SteadyIndicatorEnum.Voltage_Dev.getCode(), false);
|
||||
}
|
||||
break;
|
||||
case Har_Current://谐波电流
|
||||
if (limitRate.getIharm2Overtime() > 0 ||
|
||||
limitRate.getIharm3Overtime() > 0 ||
|
||||
limitRate.getIharm4Overtime() > 0 ||
|
||||
limitRate.getIharm5Overtime() > 0 ||
|
||||
limitRate.getIharm6Overtime() > 0 ||
|
||||
limitRate.getIharm7Overtime() > 0 ||
|
||||
limitRate.getIharm8Overtime() > 0 ||
|
||||
limitRate.getIharm9Overtime() > 0 ||
|
||||
limitRate.getIharm10Overtime() > 0 ||
|
||||
limitRate.getIharm11Overtime() > 0 ||
|
||||
limitRate.getIharm12Overtime() > 0 ||
|
||||
limitRate.getIharm13Overtime() > 0 ||
|
||||
limitRate.getIharm14Overtime() > 0 ||
|
||||
limitRate.getIharm15Overtime() > 0 ||
|
||||
limitRate.getIharm16Overtime() > 0 ||
|
||||
limitRate.getIharm17Overtime() > 0 ||
|
||||
limitRate.getIharm18Overtime() > 0 ||
|
||||
limitRate.getIharm19Overtime() > 0 ||
|
||||
limitRate.getIharm20Overtime() > 0 ||
|
||||
limitRate.getIharm21Overtime() > 0 ||
|
||||
limitRate.getIharm22Overtime() > 0 ||
|
||||
limitRate.getIharm23Overtime() > 0 ||
|
||||
limitRate.getIharm24Overtime() > 0 ||
|
||||
limitRate.getIharm25Overtime() > 0) {
|
||||
limitBoolMap.put(SteadyIndicatorEnum.Har_Current.getCode(), true);
|
||||
} else {
|
||||
limitBoolMap.put(SteadyIndicatorEnum.Har_Current.getCode(), false);
|
||||
}
|
||||
break;
|
||||
case Voltage_Fluc://电压波动与闪变
|
||||
if (limitRate.getFlickerOvertime() > 0) {
|
||||
limitBoolMap.put(SteadyIndicatorEnum.Voltage_Fluc.getCode(), true);
|
||||
} else {
|
||||
limitBoolMap.put(SteadyIndicatorEnum.Voltage_Fluc.getCode(), false);
|
||||
}
|
||||
break;
|
||||
case Har_Voltage://谐波电压
|
||||
if (limitRate.getUharm2Overtime() > 0 ||
|
||||
limitRate.getUharm3Overtime() > 0 ||
|
||||
limitRate.getUharm4Overtime() > 0 ||
|
||||
limitRate.getUharm5Overtime() > 0 ||
|
||||
limitRate.getUharm6Overtime() > 0 ||
|
||||
limitRate.getUharm7Overtime() > 0 ||
|
||||
limitRate.getUharm8Overtime() > 0 ||
|
||||
limitRate.getUharm9Overtime() > 0 ||
|
||||
limitRate.getUharm10Overtime() > 0 ||
|
||||
limitRate.getUharm11Overtime() > 0 ||
|
||||
limitRate.getUharm12Overtime() > 0 ||
|
||||
limitRate.getUharm13Overtime() > 0 ||
|
||||
limitRate.getUharm14Overtime() > 0 ||
|
||||
limitRate.getUharm15Overtime() > 0 ||
|
||||
limitRate.getUharm16Overtime() > 0 ||
|
||||
limitRate.getUharm17Overtime() > 0 ||
|
||||
limitRate.getUharm18Overtime() > 0 ||
|
||||
limitRate.getUharm19Overtime() > 0 ||
|
||||
limitRate.getUharm20Overtime() > 0 ||
|
||||
limitRate.getUharm21Overtime() > 0 ||
|
||||
limitRate.getUharm22Overtime() > 0 ||
|
||||
limitRate.getUharm23Overtime() > 0 ||
|
||||
limitRate.getUharm24Overtime() > 0 ||
|
||||
limitRate.getUharm25Overtime() > 0) {
|
||||
limitBoolMap.put(SteadyIndicatorEnum.Har_Voltage.getCode(), true);
|
||||
} else {
|
||||
limitBoolMap.put(SteadyIndicatorEnum.Har_Voltage.getCode(), false);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
return limitBoolMap;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,7 +1,17 @@
|
||||
package com.njcn.prepare.harmonic.service.mysql.line;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.device.pms.pojo.po.Monitor;
|
||||
import com.njcn.harmonic.pojo.vo.SourceSteadyIndicator;
|
||||
import com.njcn.harmonic.pojo.vo.ThsStrategyVo;
|
||||
import com.njcn.prepare.enums.TypeEnum;
|
||||
import com.njcn.process.pojo.po.LimitRate;
|
||||
import com.njcn.process.pojo.po.ThsSupervise;
|
||||
import com.njcn.process.pojo.po.ThsWarnStrategyAss;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -12,5 +22,43 @@ import com.njcn.process.pojo.po.ThsSupervise;
|
||||
* @since 2023-03-16
|
||||
*/
|
||||
public interface ThsSuperviseService extends IService<ThsSupervise> {
|
||||
/**
|
||||
* 初始化技术监督
|
||||
*/
|
||||
HttpResult<Boolean> initSupervise(Integer initType);
|
||||
|
||||
List<ThsStrategyVo> selectStrategyList(Integer initType);
|
||||
|
||||
/**
|
||||
* 查询LimitTarget数据
|
||||
*
|
||||
* @param monitorId
|
||||
*/
|
||||
LimitRate queryLimitTargetData(String monitorId);
|
||||
|
||||
/**
|
||||
* 生成监督数据
|
||||
*
|
||||
* @param limitBoolMap
|
||||
*/
|
||||
void creatSuperviseData(SourceSteadyIndicator steady, Map<String, Boolean> limitBoolMap, Monitor monitor, LimitRate limitRate);
|
||||
|
||||
List<ThsWarnStrategyAss> queryWarnStrategyAss(ThsStrategyVo strategyVo, TypeEnum typeEnum);
|
||||
/**
|
||||
* 生成监督数据
|
||||
*
|
||||
* @param steady
|
||||
* @param monitor
|
||||
* @return
|
||||
*/
|
||||
ThsSupervise insertSuperviseData(SourceSteadyIndicator steady, Monitor monitor, LimitRate limitRate);
|
||||
|
||||
/**
|
||||
* 生成 告警/预警监测点列表 数据
|
||||
*
|
||||
* @param steady
|
||||
* @param thsSupervise
|
||||
* @param monitor
|
||||
*/
|
||||
void insertOverRunLog(SourceSteadyIndicator steady, ThsSupervise thsSupervise, Monitor monitor, LimitRate limitRate);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.njcn.process.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
@@ -22,26 +23,31 @@ public class LimitRate {
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(value = "creat_time")
|
||||
private Date creatTime;
|
||||
|
||||
/**
|
||||
* 数据类型,’A’表示A相,’B’表示B相,’C’表示C相,’’M’表示A
|
||||
*/
|
||||
@TableField(value = "phasic_type")
|
||||
private String phasicType;
|
||||
|
||||
/**
|
||||
* 监测点ID合格率的变电站/装置/母线/线路序号
|
||||
*/
|
||||
@TableField(value = "myindex")
|
||||
private Integer myindex;
|
||||
|
||||
/**
|
||||
* 总计算次数
|
||||
*/
|
||||
@TableField(value = "alltime")
|
||||
private Integer alltime;
|
||||
|
||||
/**
|
||||
* 闪变总计算次数
|
||||
*/
|
||||
@TableField(value = "flicket_alltime")
|
||||
private Integer flicketAlltime;
|
||||
|
||||
/**
|
||||
@@ -68,161 +74,268 @@ public class LimitRate {
|
||||
* 电压谐波畸变率越限次数
|
||||
*/
|
||||
private Integer uaberranceOvertime;
|
||||
/**
|
||||
* 负序电流限值次数
|
||||
*/
|
||||
private Integer iNegOvertime;
|
||||
|
||||
/**
|
||||
* 2次电压谐波含有率越限次数
|
||||
*/
|
||||
@TableField(value = "uharm_2_overtime")
|
||||
private Integer uharm2Overtime;
|
||||
|
||||
/**
|
||||
* 3次电压谐波含有率越限次数
|
||||
*/
|
||||
@TableField(value = "uharm_3_overtime")
|
||||
private Integer uharm3Overtime;
|
||||
|
||||
/**
|
||||
* 4次电压谐波含有率越限次数
|
||||
*/
|
||||
@TableField(value = "uharm_4_overtime")
|
||||
private Integer uharm4Overtime;
|
||||
|
||||
/**
|
||||
* 5次电压谐波含有率越限次数
|
||||
*/
|
||||
@TableField(value = "uharm_5_overtime")
|
||||
private Integer uharm5Overtime;
|
||||
|
||||
/**
|
||||
* 6次电压谐波含有率越限次数
|
||||
*/
|
||||
@TableField(value = "uharm_6_overtime")
|
||||
private Integer uharm6Overtime;
|
||||
|
||||
/**
|
||||
* 7次电压谐波含有率越限次数
|
||||
*/
|
||||
@TableField(value = "uharm_7_overtime")
|
||||
private Integer uharm7Overtime;
|
||||
|
||||
/**
|
||||
* 8次电压谐波含有率越限次数
|
||||
*/
|
||||
@TableField(value = "uharm_8_overtime")
|
||||
private Integer uharm8Overtime;
|
||||
|
||||
/**
|
||||
* 9次电压谐波含有率越限次数
|
||||
*/
|
||||
@TableField(value = "uharm_9_overtime")
|
||||
private Integer uharm9Overtime;
|
||||
|
||||
/**
|
||||
* 10次电压谐波含有率越限次数
|
||||
*/
|
||||
@TableField(value = "uharm_10_overtime")
|
||||
private Integer uharm10Overtime;
|
||||
|
||||
/**
|
||||
* 11次电压谐波含有率越限次数
|
||||
*/
|
||||
@TableField(value = "uharm_11_overtime")
|
||||
private Integer uharm11Overtime;
|
||||
|
||||
/**
|
||||
* 12次电压谐波含有率越限次数
|
||||
*/
|
||||
@TableField(value = "uharm_12_overtime")
|
||||
private Integer uharm12Overtime;
|
||||
|
||||
/**
|
||||
* 13次电压谐波含有率越限次数
|
||||
*/
|
||||
@TableField(value = "uharm_13_overtime")
|
||||
private Integer uharm13Overtime;
|
||||
|
||||
/**
|
||||
* 14次电压谐波含有率越限次数
|
||||
*/
|
||||
@TableField(value = "uharm_14_overtime")
|
||||
private Integer uharm14Overtime;
|
||||
|
||||
/**
|
||||
* 15次电压谐波含有率越限次数
|
||||
*/
|
||||
@TableField(value = "uharm_15_overtime")
|
||||
private Integer uharm15Overtime;
|
||||
|
||||
/**
|
||||
* 16次电压谐波含有率越限次数
|
||||
*/
|
||||
@TableField(value = "uharm_16_overtime")
|
||||
private Integer uharm16Overtime;
|
||||
|
||||
/**
|
||||
* 17次电压谐波含有率越限次数
|
||||
*/
|
||||
@TableField(value = "uharm_17_overtime")
|
||||
private Integer uharm17Overtime;
|
||||
|
||||
/**
|
||||
* 18次电压谐波含有率越限次数
|
||||
*/
|
||||
@TableField(value = "uharm_18_overtime")
|
||||
private Integer uharm18Overtime;
|
||||
|
||||
/**
|
||||
* 19次电压谐波含有率越限次数
|
||||
*/
|
||||
@TableField(value = "uharm_19_overtime")
|
||||
private Integer uharm19Overtime;
|
||||
|
||||
/**
|
||||
* 20次电压谐波含有率越限次数
|
||||
*/
|
||||
@TableField(value = "uharm_20_overtime")
|
||||
private Integer uharm20Overtime;
|
||||
|
||||
/**
|
||||
* 21次电压谐波含有率越限次数
|
||||
*/
|
||||
@TableField(value = "uharm_21_overtime")
|
||||
private Integer uharm21Overtime;
|
||||
|
||||
/**
|
||||
* 22次电压谐波含有率越限次数
|
||||
*/
|
||||
@TableField(value = "uharm_22_overtime")
|
||||
private Integer uharm22Overtime;
|
||||
|
||||
/**
|
||||
* 23次电压谐波含有率越限次数
|
||||
*/
|
||||
@TableField(value = "uharm_23_overtime")
|
||||
private Integer uharm23Overtime;
|
||||
|
||||
/**
|
||||
* 24次电压谐波含有率越限次数
|
||||
*/
|
||||
@TableField(value = "uharm_24_overtime")
|
||||
private Integer uharm24Overtime;
|
||||
|
||||
/**
|
||||
* 25次电压谐波含有率越限次数
|
||||
*/
|
||||
@TableField(value = "uharm_25_overtime")
|
||||
private Integer uharm25Overtime;
|
||||
|
||||
/**
|
||||
* 2次电流谐波幅值越限次数
|
||||
*/
|
||||
@TableField(value = "iharm_2_overtime")
|
||||
private Integer iharm2Overtime;
|
||||
|
||||
/**
|
||||
* 3次电流谐波幅值越限次数
|
||||
*/
|
||||
@TableField(value = "iharm_3_overtime")
|
||||
private Integer iharm3Overtime;
|
||||
|
||||
/**
|
||||
* 4次电流谐波幅值越限次数
|
||||
*/
|
||||
@TableField(value = "iharm_4_overtime")
|
||||
private Integer iharm4Overtime;
|
||||
|
||||
/**
|
||||
* 5次电流谐波幅值越限次数
|
||||
*/
|
||||
@TableField(value = "iharm_5_overtime")
|
||||
private Integer iharm5Overtime;
|
||||
|
||||
/**
|
||||
* 6次电流谐波幅值越限次数
|
||||
*/
|
||||
@TableField(value = "iharm_6_overtime")
|
||||
private Integer iharm6Overtime;
|
||||
|
||||
/**
|
||||
* 7次电流谐波幅值越限次数
|
||||
*/
|
||||
@TableField(value = "iharm_7_overtime")
|
||||
private Integer iharm7Overtime;
|
||||
|
||||
/**
|
||||
* 8次电流谐波幅值越限次数
|
||||
*/
|
||||
@TableField(value = "iharm_8_overtime")
|
||||
private Integer iharm8Overtime;
|
||||
@TableField(value = "iharm_9_overtime")
|
||||
private Integer iharm9Overtime;
|
||||
@TableField(value = "iharm_10_overtime")
|
||||
private Integer iharm10Overtime;
|
||||
@TableField(value = "iharm_11_overtime")
|
||||
private Integer iharm11Overtime;
|
||||
@TableField(value = "iharm_12_overtime")
|
||||
private Integer iharm12Overtime;
|
||||
@TableField(value = "iharm_13_overtime")
|
||||
private Integer iharm13Overtime;
|
||||
@TableField(value = "iharm_14_overtime")
|
||||
private Integer iharm14Overtime;
|
||||
@TableField(value = "iharm_15_overtime")
|
||||
private Integer iharm15Overtime;
|
||||
@TableField(value = "iharm_16_overtime")
|
||||
private Integer iharm16Overtime;
|
||||
@TableField(value = "iharm_17_overtime")
|
||||
private Integer iharm17Overtime;
|
||||
@TableField(value = "iharm_18_overtime")
|
||||
private Integer iharm18Overtime;
|
||||
@TableField(value = "iharm_19_overtime")
|
||||
private Integer iharm19Overtime;
|
||||
@TableField(value = "iharm_20_overtime")
|
||||
private Integer iharm20Overtime;
|
||||
@TableField(value = "iharm_21_overtime")
|
||||
private Integer iharm21Overtime;
|
||||
@TableField(value = "iharm_22_overtime")
|
||||
private Integer iharm22Overtime;
|
||||
@TableField(value = "iharm_23_overtime")
|
||||
private Integer iharm23Overtime;
|
||||
@TableField(value = "iharm_24_overtime")
|
||||
private Integer iharm24Overtime;
|
||||
@TableField(value = "iharm_25_overtime")
|
||||
private Integer iharm25Overtime;
|
||||
/**
|
||||
* 0.5次间谐波电压限值次数
|
||||
*/
|
||||
@TableField(value = "inuharm_1_overtime")
|
||||
private Integer inuharm1Overtime;
|
||||
@TableField(value = "inuharm_2_overtime")
|
||||
private Integer inuharm2Overtime;
|
||||
@TableField(value = "inuharm_3_overtime")
|
||||
private Integer inuharm3Overtime;
|
||||
@TableField(value = "inuharm_4_overtime")
|
||||
private Integer inuharm4Overtime;
|
||||
@TableField(value = "inuharm_5_overtime")
|
||||
private Integer inuharm5Overtime;
|
||||
@TableField(value = "inuharm_6_overtime")
|
||||
private Integer inuharm6Overtime;
|
||||
@TableField(value = "inuharm_7_overtime")
|
||||
private Integer inuharm7Overtime;
|
||||
@TableField(value = "inuharm_8_overtime")
|
||||
private Integer inuharm8Overtime;
|
||||
@TableField(value = "inuharm_9_overtime")
|
||||
private Integer inuharm9Overtime;
|
||||
@TableField(value = "inuharm_10_overtime")
|
||||
private Integer inuharm10Overtime;
|
||||
@TableField(value = "inuharm_11_overtime")
|
||||
private Integer inuharm11Overtime;
|
||||
@TableField(value = "inuharm_12_overtime")
|
||||
private Integer inuharm12Overtime;
|
||||
@TableField(value = "inuharm_13_overtime")
|
||||
private Integer inuharm13Overtime;
|
||||
@TableField(value = "inuharm_14_overtime")
|
||||
private Integer inuharm14Overtime;
|
||||
@TableField(value = "inuharm_15_overtime")
|
||||
private Integer inuharm15Overtime;
|
||||
/**
|
||||
* 15.5次间谐波电压限值次数
|
||||
*/
|
||||
@TableField(value = "inuharm_16_overtime")
|
||||
private Integer inuharm16Overtime;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
package com.njcn.process.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 告警/预警监测点列表
|
||||
@@ -14,7 +15,7 @@ import lombok.Data;
|
||||
*/
|
||||
@Data
|
||||
@TableName("ths_over_run_log")
|
||||
public class ThsOverRunLog extends BaseEntity {
|
||||
public class ThsOverRunLog {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@@ -67,6 +68,10 @@ public class ThsOverRunLog extends BaseEntity {
|
||||
* 整改通知反馈单
|
||||
*/
|
||||
private String reviseFeedback;
|
||||
/**
|
||||
* 越限时间(yyyy-MM-dd)
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.njcn.process.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
@@ -16,7 +15,7 @@ import java.util.Date;
|
||||
*/
|
||||
@Data
|
||||
@TableName("ths_supervise")
|
||||
public class ThsSupervise extends BaseEntity {
|
||||
public class ThsSupervise {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@@ -73,7 +72,11 @@ public class ThsSupervise extends BaseEntity {
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private String describe;
|
||||
private String description;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ public class ThsWarnStrategyAss implements Serializable {
|
||||
@TableField("Ass_Id")
|
||||
private String assId;
|
||||
|
||||
@ApiModelProperty(value = "等级(0:监测点标签类型;1:指标类型;)")
|
||||
@ApiModelProperty(value = "等级(0:监测点标签类型;1:指标类型;2:干扰源类型)")
|
||||
@TableField("Type")
|
||||
private Integer type;
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.njcn.process.mapper;
|
||||
|
||||
import com.njcn.harmonic.pojo.vo.ThsStrategyVo;
|
||||
import com.njcn.process.pojo.param.StrategyParam;
|
||||
import com.njcn.process.pojo.po.ThsWarnStrategy;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
@@ -35,4 +36,12 @@ public interface ThsWarnStrategyMapper extends BaseMapper<ThsWarnStrategy> {
|
||||
* @return List<String>
|
||||
*/
|
||||
List<String> getStrategyDetail(@Param("id") String id);
|
||||
|
||||
/**
|
||||
* 查询所有部门的策略列表
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<ThsStrategyVo> selectStrategyList();
|
||||
|
||||
}
|
||||
|
||||
@@ -50,6 +50,22 @@
|
||||
WHERE
|
||||
Warn_Id = #{id} and ts.Type=1
|
||||
</select>
|
||||
<!--查询所有部门的策略列表-->
|
||||
<select id="selectStrategyList" resultType="com.njcn.harmonic.pojo.vo.ThsStrategyVo">
|
||||
select
|
||||
tws.id,
|
||||
tws.name,
|
||||
tws.grade,
|
||||
tws.operation,
|
||||
tws.type,
|
||||
tda.dept_Id as deptId
|
||||
from
|
||||
ths_warn_strategy tws
|
||||
left join ths_dept_alarm tda on
|
||||
tws.Id = tda.Alarm_Id
|
||||
where
|
||||
tws.State = 1 and tws.Grade in(0,2)
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user