代码合并
This commit is contained in:
@@ -305,7 +305,7 @@ public class GeneralDeviceService {
|
|||||||
//获取包括当前部门的后代所有部门信息
|
//获取包括当前部门的后代所有部门信息
|
||||||
List<DeptDTO> deptInfos = deptFeignClient.getDeptDescendantIndexes(deviceInfoParam.getDeptIndex(), deptType).getData();
|
List<DeptDTO> deptInfos = deptFeignClient.getDeptDescendantIndexes(deviceInfoParam.getDeptIndex(), deptType).getData();
|
||||||
List<DeptDTO> directDeptInfos = deptInfos.stream()
|
List<DeptDTO> directDeptInfos = deptInfos.stream()
|
||||||
.filter(deptDTO -> deptDTO.getPid().equals(deviceInfoParam.getDeptIndex()))
|
.filter(deptDTO -> deptDTO.getPid().equals(deviceInfoParam.getDeptIndex())).sorted(Comparator.comparing(DeptDTO::getSort))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
if (CollectionUtil.isEmpty(directDeptInfos)) {
|
if (CollectionUtil.isEmpty(directDeptInfos)) {
|
||||||
//没有直接子部门,获取当前部门所有信息
|
//没有直接子部门,获取当前部门所有信息
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
//package com.njcn.harmonic.controller;
|
package com.njcn.harmonic.controller;//package com.njcn.harmonic.controller;
|
||||||
//
|
//
|
||||||
//import com.njcn.common.pojo.annotation.OperateInfo;
|
//import com.njcn.common.pojo.annotation.OperateInfo;
|
||||||
//import com.njcn.common.pojo.enums.common.LogEnum;
|
//import com.njcn.common.pojo.enums.common.LogEnum;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
//package com.njcn.harmonic.controller;
|
package com.njcn.harmonic.controller;//package com.njcn.harmonic.controller;
|
||||||
//
|
//
|
||||||
//import com.njcn.common.pojo.annotation.OperateInfo;
|
//import com.njcn.common.pojo.annotation.OperateInfo;
|
||||||
//import com.njcn.common.pojo.enums.common.LogEnum;
|
//import com.njcn.common.pojo.enums.common.LogEnum;
|
||||||
|
|||||||
@@ -469,19 +469,21 @@ public class CustomReportServiceImpl implements CustomReportService {
|
|||||||
*/
|
*/
|
||||||
private void assSql(ReportTemplateDTO data, StringBuilder sql, List<ReportTemplateDTO> endList, String method, ReportSearchParam reportSearchParam) {
|
private void assSql(ReportTemplateDTO data, StringBuilder sql, List<ReportTemplateDTO> endList, String method, ReportSearchParam reportSearchParam) {
|
||||||
//sql拼接示例:select MAX(IHA2) as IHA2 from power_quality_data where Phase = 'A' and LineId='1324564568' and Stat_Method='max' tz('Asia/Shanghai')
|
//sql拼接示例:select MAX(IHA2) as IHA2 from power_quality_data where Phase = 'A' and LineId='1324564568' and Stat_Method='max' tz('Asia/Shanghai')
|
||||||
|
|
||||||
|
//cp95函数特殊处理 PERCENTILE(field_key, N)
|
||||||
|
if (InfluxDBSqlConstant.CP95.equals(method)){
|
||||||
|
sql.append(method).append(InfluxDBSqlConstant.LBK).append(data.getTemplateName()).append(InfluxDBSqlConstant.NUM_95).append(InfluxDBSqlConstant.RBK).append(InfluxDBSqlConstant.AS_VALUE);
|
||||||
|
}else{
|
||||||
|
sql.append(method).append(InfluxDBSqlConstant.LBK).append(data.getTemplateName()).append(InfluxDBSqlConstant.RBK).append(InfluxDBSqlConstant.AS_VALUE);
|
||||||
|
}
|
||||||
|
|
||||||
|
//相别特殊处理
|
||||||
if (InfluxDBTableConstant.NO_PHASE.equals(data.getPhase())) {
|
if (InfluxDBTableConstant.NO_PHASE.equals(data.getPhase())) {
|
||||||
sql.append(method).append(InfluxDBSqlConstant.LBK).append(data.getTemplateName()).append(InfluxDBSqlConstant.RBK).append(InfluxDBSqlConstant.AS_VALUE)
|
sql.append(InfluxDBSqlConstant.FROM).append(data.getClassId())
|
||||||
.append(InfluxDBSqlConstant.FROM).append(data.getClassId())
|
.append(InfluxDBSqlConstant.WHERE).append(InfluxDBTableConstant.LINE_ID).append(InfluxDBSqlConstant.EQ).append(InfluxDBSqlConstant.QM).append(reportSearchParam.getLineId()).append(InfluxDBSqlConstant.QM)
|
||||||
.append(InfluxDBSqlConstant.WHERE).append(InfluxDBTableConstant.LINE_ID).append(InfluxDBSqlConstant.EQ).append(InfluxDBSqlConstant.QM).append(reportSearchParam.getLineId()).append(InfluxDBSqlConstant.QM)
|
.append(InfluxDBSqlConstant.AND).append(InfluxDBTableConstant.VALUE_TYPE).append(InfluxDBSqlConstant.EQ).append(InfluxDBSqlConstant.QM).append(data.getStatMethod()).append(InfluxDBSqlConstant.QM)
|
||||||
.append(InfluxDBSqlConstant.AND).append(InfluxDBTableConstant.VALUE_TYPE).append(InfluxDBSqlConstant.EQ).append(InfluxDBSqlConstant.QM).append(data.getStatMethod()).append(InfluxDBSqlConstant.QM)
|
.append(InfluxDBSqlConstant.TZ);
|
||||||
.append(InfluxDBSqlConstant.TZ);
|
|
||||||
} else {
|
} else {
|
||||||
//cp95函数特殊处理 PERCENTILE(field_key, N)
|
|
||||||
if (InfluxDBSqlConstant.CP95.equals(method)){
|
|
||||||
sql.append(method).append(InfluxDBSqlConstant.LBK).append(data.getTemplateName()).append(InfluxDBSqlConstant.NUM_95).append(InfluxDBSqlConstant.RBK).append(InfluxDBSqlConstant.AS_VALUE);
|
|
||||||
}else{
|
|
||||||
sql.append(method).append(InfluxDBSqlConstant.LBK).append(data.getTemplateName()).append(InfluxDBSqlConstant.RBK).append(InfluxDBSqlConstant.AS_VALUE);
|
|
||||||
}
|
|
||||||
sql.append(InfluxDBSqlConstant.FROM).append(data.getClassId())
|
sql.append(InfluxDBSqlConstant.FROM).append(data.getClassId())
|
||||||
.append(InfluxDBSqlConstant.WHERE).append(InfluxDBTableConstant.LINE_ID).append(InfluxDBSqlConstant.EQ).append(InfluxDBSqlConstant.QM).append(reportSearchParam.getLineId()).append(InfluxDBSqlConstant.QM)
|
.append(InfluxDBSqlConstant.WHERE).append(InfluxDBTableConstant.LINE_ID).append(InfluxDBSqlConstant.EQ).append(InfluxDBSqlConstant.QM).append(reportSearchParam.getLineId()).append(InfluxDBSqlConstant.QM)
|
||||||
.append(InfluxDBSqlConstant.AND).append(InfluxDBTableConstant.VALUE_TYPE).append(InfluxDBSqlConstant.EQ).append(InfluxDBSqlConstant.QM).append(data.getStatMethod()).append(InfluxDBSqlConstant.QM)
|
.append(InfluxDBSqlConstant.AND).append(InfluxDBTableConstant.VALUE_TYPE).append(InfluxDBSqlConstant.EQ).append(InfluxDBSqlConstant.QM).append(data.getStatMethod()).append(InfluxDBSqlConstant.QM)
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.njcn.harmonic.service.impl;
|
package com.njcn.harmonic.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import cn.hutool.core.collection.ListUtil;
|
||||||
import cn.hutool.core.io.FileUtil;
|
import cn.hutool.core.io.FileUtil;
|
||||||
import cn.hutool.core.util.CharUtil;
|
import cn.hutool.core.util.CharUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
@@ -31,9 +32,8 @@ import org.springframework.util.CollectionUtils;
|
|||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.math.RoundingMode;
|
import java.math.RoundingMode;
|
||||||
import java.util.ArrayList;
|
import java.text.Collator;
|
||||||
import java.util.List;
|
import java.util.*;
|
||||||
import java.util.Map;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -189,6 +189,13 @@ public class IntegrityServiceImpl implements IntegrityService {
|
|||||||
out.add(outParam);
|
out.add(outParam);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
out.sort(new Comparator<IntegrityIconVO>() {
|
||||||
|
@Override
|
||||||
|
public int compare(IntegrityIconVO o1, IntegrityIconVO o2) {
|
||||||
|
Comparator<Object> com = Collator.getInstance(Locale.CHINA);
|
||||||
|
return com.compare(o1.getType(), o2.getType());
|
||||||
|
}
|
||||||
|
});
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -65,7 +65,6 @@
|
|||||||
<groupId>com.njcn</groupId>
|
<groupId>com.njcn</groupId>
|
||||||
<artifactId>prepare-api</artifactId>
|
<artifactId>prepare-api</artifactId>
|
||||||
<version>${project.version}</version>
|
<version>${project.version}</version>
|
||||||
<scope>compile</scope>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ public class HarmCustomReportJob {
|
|||||||
|
|
||||||
private final CoustmReportFeignClient coustmReportFeignClient;
|
private final CoustmReportFeignClient coustmReportFeignClient;
|
||||||
|
|
||||||
|
|
||||||
@XxlJob("harmCustomReportHandler")
|
@XxlJob("harmCustomReportHandler")
|
||||||
public void harmCustomReportHandler(){
|
public void harmCustomReportHandler(){
|
||||||
long a = System.currentTimeMillis();
|
long a = System.currentTimeMillis();
|
||||||
|
|||||||
@@ -0,0 +1,31 @@
|
|||||||
|
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 com.njcn.prepare.harmonic.pojo.param.LineParam;
|
||||||
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 自定义报表
|
||||||
|
* @author qijian
|
||||||
|
* @date 2022/10/20
|
||||||
|
*/
|
||||||
|
@FeignClient(
|
||||||
|
value = ServerInfo.HARMONIC_PREPARE,//对应模块名
|
||||||
|
path = "/report",//对应controller请求类
|
||||||
|
fallbackFactory = CoustomReportFeignClientFallbackFactory.class//服务降级处理类
|
||||||
|
)
|
||||||
|
public interface CoustmReportFeignClient {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量处理报表
|
||||||
|
* @author qijian
|
||||||
|
* @date 2022/10/19
|
||||||
|
*/
|
||||||
|
@PostMapping("/batchReport")
|
||||||
|
HttpResult<Boolean> batchReport(@RequestBody LineParam reportParam);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
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.DayDataFeignClientFallbackFactory;
|
||||||
|
import com.njcn.prepare.harmonic.pojo.param.LineParam;
|
||||||
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 自定义报表
|
||||||
|
* @author qijian
|
||||||
|
* @date 2022/10/20
|
||||||
|
*/
|
||||||
|
@FeignClient(
|
||||||
|
value = ServerInfo.HARMONIC_PREPARE,//对应模块名
|
||||||
|
path = "/daydata",//对应controller请求类
|
||||||
|
fallbackFactory = DayDataFeignClientFallbackFactory.class//服务降级处理类
|
||||||
|
)
|
||||||
|
public interface DayDataFeignClient {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量处理报表
|
||||||
|
* @author qijian
|
||||||
|
* @date 2022/10/19
|
||||||
|
*/
|
||||||
|
@PostMapping("/dayDataHanlder")
|
||||||
|
HttpResult<Boolean> dayDataHanlder(@RequestBody LineParam jobParam);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
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.DistortionRateFeignClientFallbackFactory;
|
||||||
|
import com.njcn.prepare.harmonic.pojo.param.LineParam;
|
||||||
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 谐波畸变率
|
||||||
|
* @author xiaoyao
|
||||||
|
* @version 1.0.0
|
||||||
|
* @createTime 2022/11/4 15:58
|
||||||
|
*/
|
||||||
|
@FeignClient(
|
||||||
|
value = ServerInfo.HARMONIC_PREPARE,
|
||||||
|
path = "/distortion",
|
||||||
|
fallbackFactory = DistortionRateFeignClientFallbackFactory.class
|
||||||
|
)
|
||||||
|
public interface DistortionRateFeignClient {
|
||||||
|
|
||||||
|
@PostMapping("/distortionRate")
|
||||||
|
HttpResult<String> distortionRate(@RequestBody @Validated LineParam lineParam);
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
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.DistortionRateFeignClientFallbackFactory;
|
||||||
|
import com.njcn.prepare.harmonic.pojo.param.LineParam;
|
||||||
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 稳态综合评估
|
||||||
|
* @author xiaoyao
|
||||||
|
* @version 1.0.0
|
||||||
|
* @createTime 2022/11/7 15:11
|
||||||
|
*/
|
||||||
|
|
||||||
|
@FeignClient(
|
||||||
|
value = ServerInfo.HARMONIC_PREPARE,
|
||||||
|
path = "/general",
|
||||||
|
fallbackFactory = DistortionRateFeignClientFallbackFactory.class
|
||||||
|
)
|
||||||
|
public interface HarmonicGeneralFeignClient {
|
||||||
|
|
||||||
|
@PostMapping("/generalData")
|
||||||
|
HttpResult<String> generalData(@RequestBody @Validated LineParam lineParam);
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
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.HarmonicMetricFeignClientFallbackFactory;
|
||||||
|
import com.njcn.prepare.harmonic.pojo.param.LineParam;
|
||||||
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author xiaoyao
|
||||||
|
* @version 1.0.0
|
||||||
|
* @createTime 2022/11/7 15:12
|
||||||
|
*/
|
||||||
|
|
||||||
|
@FeignClient(
|
||||||
|
value = ServerInfo.HARMONIC_PREPARE,
|
||||||
|
path = "/metric",
|
||||||
|
fallbackFactory = HarmonicMetricFeignClientFallbackFactory.class
|
||||||
|
)
|
||||||
|
public interface HarmonicMetricFeignClient {
|
||||||
|
|
||||||
|
@PostMapping("/metricData")
|
||||||
|
HttpResult<String> metricData(@RequestBody @Validated LineParam lineParam);
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
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.IntegrityFeignClientFallbackFactory;
|
||||||
|
import com.njcn.prepare.harmonic.pojo.param.LineParam;
|
||||||
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 自定义报表
|
||||||
|
* @author qijian
|
||||||
|
* @date 2022/10/20
|
||||||
|
*/
|
||||||
|
@FeignClient(
|
||||||
|
value = ServerInfo.HARMONIC_PREPARE,//对应模块名
|
||||||
|
path = "/integrity",//对应controller请求类
|
||||||
|
fallbackFactory = IntegrityFeignClientFallbackFactory.class//服务降级处理类
|
||||||
|
)
|
||||||
|
public interface IntegrityFeignClient {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量处理报表
|
||||||
|
* @author qijian
|
||||||
|
* @date 2022/10/19
|
||||||
|
*/
|
||||||
|
@PostMapping("/computeDataIntegrity")
|
||||||
|
HttpResult<String> computeDataIntegrity(@RequestBody @Validated LineParam lineParam);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
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.LimitTargetFeignClientFallbackFactory;
|
||||||
|
import com.njcn.prepare.harmonic.pojo.param.LineParam;
|
||||||
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 自定义报表
|
||||||
|
* @author qijian
|
||||||
|
* @date 2022/10/20
|
||||||
|
*/
|
||||||
|
@FeignClient(
|
||||||
|
value = ServerInfo.HARMONIC_PREPARE,//对应模块名
|
||||||
|
path = "/limitTarget",//对应controller请求类
|
||||||
|
fallbackFactory = LimitTargetFeignClientFallbackFactory.class//服务降级处理类
|
||||||
|
)
|
||||||
|
public interface LimitTargetFeignClient {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量处理报表
|
||||||
|
* @author qijian
|
||||||
|
* @date 2022/10/19
|
||||||
|
*/
|
||||||
|
@PostMapping("/getLimitTargetData")
|
||||||
|
HttpResult<String> getLimitTargetData(@RequestBody @Validated LineParam lineParam);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
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.LimitrateFeignClientFallbackFactory;
|
||||||
|
import com.njcn.prepare.harmonic.pojo.param.LineParam;
|
||||||
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 自定义报表
|
||||||
|
* @author qijian
|
||||||
|
* @date 2022/10/20
|
||||||
|
*/
|
||||||
|
@FeignClient(
|
||||||
|
value = ServerInfo.HARMONIC_PREPARE,//对应模块名
|
||||||
|
path = "/limitrate",//对应controller请求类
|
||||||
|
fallbackFactory = LimitrateFeignClientFallbackFactory.class//服务降级处理类
|
||||||
|
)
|
||||||
|
public interface LimitrateFeignClient {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 越限
|
||||||
|
*/
|
||||||
|
@PostMapping("/LimitRateHanlder")
|
||||||
|
HttpResult<Boolean> limitRateHanlder(@RequestBody LineParam limitRateHanlderParam );
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
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.NormalFeignClientFallbackFactory;
|
||||||
|
import com.njcn.prepare.harmonic.pojo.param.LineParam;
|
||||||
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author denghaujun
|
||||||
|
* @date 2022/10/20
|
||||||
|
*/
|
||||||
|
@FeignClient(
|
||||||
|
value = ServerInfo.HARMONIC_PREPARE,//对应模块名
|
||||||
|
path = "/normalLimit",//对应controller请求类
|
||||||
|
fallbackFactory = NormalFeignClientFallbackFactory.class//服务降级处理类
|
||||||
|
)
|
||||||
|
public interface NormalLimitFeignClient {
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author denghaujun
|
||||||
|
* @date 2022/10/19
|
||||||
|
*/
|
||||||
|
@PostMapping("/getNormLimitData")
|
||||||
|
HttpResult<String> getNormLimitData(@RequestBody @Validated LineParam lineParam) ;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
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.OnlineRateFeignClientFallbackFactory;
|
||||||
|
import com.njcn.prepare.harmonic.pojo.param.LineParam;
|
||||||
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 自定义报表
|
||||||
|
* @author qijian
|
||||||
|
* @date 2022/10/20
|
||||||
|
*/
|
||||||
|
@FeignClient(
|
||||||
|
value = ServerInfo.HARMONIC_PREPARE,//对应模块名
|
||||||
|
path = "/onlineRate",//对应controller请求类
|
||||||
|
fallbackFactory = OnlineRateFeignClientFallbackFactory.class//服务降级处理类
|
||||||
|
)
|
||||||
|
public interface OnlineRateFeignClient {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 在线率
|
||||||
|
*/
|
||||||
|
@PostMapping("/getOnlineRateData")
|
||||||
|
HttpResult<String> getOnlineRateData(@RequestBody @Validated LineParam lineParam);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
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.PollutionFeignClientFallbackFactory;
|
||||||
|
import com.njcn.prepare.harmonic.pojo.param.LineParam;
|
||||||
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 自定义报表
|
||||||
|
* @author qijian
|
||||||
|
* @date 2022/10/20
|
||||||
|
*/
|
||||||
|
@FeignClient(
|
||||||
|
value = ServerInfo.HARMONIC_PREPARE,//对应模块名
|
||||||
|
path = "/pollution",//对应controller请求类
|
||||||
|
fallbackFactory = PollutionFeignClientFallbackFactory.class//服务降级处理类
|
||||||
|
)
|
||||||
|
public interface PollutionFeignClient {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 污区
|
||||||
|
*/
|
||||||
|
@PostMapping("/processPollutionData")
|
||||||
|
HttpResult<String> processPollutionData(@RequestBody @Validated LineParam lineParam);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
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.CoustmReportFeignClient;
|
||||||
|
import com.njcn.prepare.harmonic.api.line.DayDataFeignClient;
|
||||||
|
import com.njcn.prepare.harmonic.pojo.param.LimitRateHanlderParam;
|
||||||
|
import com.njcn.prepare.harmonic.pojo.param.LineParam;
|
||||||
|
import feign.hystrix.FallbackFactory;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ReportFeignClientFallbackFactory
|
||||||
|
*
|
||||||
|
* @author qijian
|
||||||
|
* @version 1.0.0
|
||||||
|
* @createTime 2022/10/24 - 9:52
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Component
|
||||||
|
public class CoustomReportFeignClientFallbackFactory implements FallbackFactory<CoustmReportFeignClient> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CoustmReportFeignClient 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 CoustmReportFeignClient() {
|
||||||
|
@Override
|
||||||
|
public HttpResult<Boolean> batchReport(@RequestBody LineParam reportParam){
|
||||||
|
log.error("{}异常,降级处理,异常为:{}", "生成自定义报表: ", throwable.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
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.DayDataFeignClient;
|
||||||
|
import com.njcn.prepare.harmonic.pojo.param.LineParam;
|
||||||
|
import feign.hystrix.FallbackFactory;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ReportFeignClientFallbackFactory
|
||||||
|
*
|
||||||
|
* @author qijian
|
||||||
|
* @version 1.0.0
|
||||||
|
* @createTime 2022/10/24 - 9:52
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Component
|
||||||
|
public class DayDataFeignClientFallbackFactory implements FallbackFactory<DayDataFeignClient> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public DayDataFeignClient 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 DayDataFeignClient() {
|
||||||
|
@Override
|
||||||
|
public HttpResult<Boolean> dayDataHanlder(@RequestBody LineParam jobParam){
|
||||||
|
log.error("{}异常,降级处理,异常为:{}", "Date数据转Day数据: ", throwable.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
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.DistortionRateFeignClient;
|
||||||
|
import com.njcn.prepare.harmonic.pojo.param.LineParam;
|
||||||
|
import feign.hystrix.FallbackFactory;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author xiaoyao
|
||||||
|
* @version 1.0.0
|
||||||
|
* @createTime 2022/11/7 14:37
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Component
|
||||||
|
public class DistortionRateFeignClientFallbackFactory implements FallbackFactory<DistortionRateFeignClient> {
|
||||||
|
@Override
|
||||||
|
public DistortionRateFeignClient 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 DistortionRateFeignClient() {
|
||||||
|
@Override
|
||||||
|
public HttpResult<String> distortionRate(@RequestBody @Validated LineParam lineParam){
|
||||||
|
log.error("{}异常,降级处理,异常为:{}", "谐波畸变率: ", throwable.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
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.HarmonicGeneralFeignClient;
|
||||||
|
import com.njcn.prepare.harmonic.pojo.param.LineParam;
|
||||||
|
import feign.hystrix.FallbackFactory;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author xiaoyao
|
||||||
|
* @version 1.0.0
|
||||||
|
* @createTime 2022/11/7 15:17
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Component
|
||||||
|
public class HarmonicGeneralFeignClientFallbackFactory implements FallbackFactory<HarmonicGeneralFeignClient> {
|
||||||
|
@Override
|
||||||
|
public HarmonicGeneralFeignClient 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 HarmonicGeneralFeignClient() {
|
||||||
|
@Override
|
||||||
|
public HttpResult<String> generalData(@RequestBody @Validated LineParam lineParam){
|
||||||
|
log.error("{}异常,降级处理,异常为:{}", "稳态综合评估: ", throwable.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
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.HarmonicMetricFeignClient;
|
||||||
|
import com.njcn.prepare.harmonic.pojo.param.LineParam;
|
||||||
|
import feign.hystrix.FallbackFactory;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author xiaoyao
|
||||||
|
* @version 1.0.0
|
||||||
|
* @createTime 2022/11/7 15:14
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Component
|
||||||
|
public class HarmonicMetricFeignClientFallbackFactory implements FallbackFactory<HarmonicMetricFeignClient> {
|
||||||
|
@Override
|
||||||
|
public HarmonicMetricFeignClient 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 HarmonicMetricFeignClient() {
|
||||||
|
@Override
|
||||||
|
public HttpResult<String> metricData(@RequestBody @Validated LineParam lineParam){
|
||||||
|
log.error("{}异常,降级处理,异常为:{}", "稳态指标评估: ", throwable.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
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.IntegrityFeignClient;
|
||||||
|
import com.njcn.prepare.harmonic.pojo.param.LineParam;
|
||||||
|
import feign.hystrix.FallbackFactory;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* IntegrityFeignClientFallbackFactory
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Component
|
||||||
|
public class IntegrityFeignClientFallbackFactory implements FallbackFactory<IntegrityFeignClient> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IntegrityFeignClient 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 IntegrityFeignClient() {
|
||||||
|
@Override
|
||||||
|
public HttpResult<String> computeDataIntegrity(@RequestBody @Validated LineParam lineParam) {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}", "数据完整性处理: ", throwable.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
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.LimitTargetFeignClient;
|
||||||
|
import com.njcn.prepare.harmonic.pojo.param.LineParam;
|
||||||
|
import feign.hystrix.FallbackFactory;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ReportFeignClientFallbackFactory
|
||||||
|
*
|
||||||
|
* @author qijian
|
||||||
|
* @version 1.0.0
|
||||||
|
* @createTime 2022/10/24 - 9:52
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Component
|
||||||
|
public class LimitTargetFeignClientFallbackFactory implements FallbackFactory<LimitTargetFeignClient> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public LimitTargetFeignClient 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 LimitTargetFeignClient() {
|
||||||
|
@Override
|
||||||
|
public HttpResult<String> getLimitTargetData(@RequestBody @Validated LineParam lineParam) {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}", "越限数据: ", throwable.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
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.LimitrateFeignClient;
|
||||||
|
import com.njcn.prepare.harmonic.pojo.param.LineParam;
|
||||||
|
import feign.hystrix.FallbackFactory;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ReportFeignClientFallbackFactory
|
||||||
|
*
|
||||||
|
* @author qijian
|
||||||
|
* @version 1.0.0
|
||||||
|
* @createTime 2022/10/24 - 9:52
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Component
|
||||||
|
public class LimitrateFeignClientFallbackFactory implements FallbackFactory<LimitrateFeignClient> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public LimitrateFeignClient 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 LimitrateFeignClient() {
|
||||||
|
@Override
|
||||||
|
public HttpResult<Boolean> limitRateHanlder(@RequestBody LineParam limitRateHanlderParam ){
|
||||||
|
log.error("{}异常,降级处理,异常为:{}", "越限数据处理: ", throwable.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
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.NormalLimitFeignClient;
|
||||||
|
import com.njcn.prepare.harmonic.pojo.param.LineParam;
|
||||||
|
import feign.hystrix.FallbackFactory;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* NormalFeignClientFallbackFactory
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Component
|
||||||
|
public class NormalFeignClientFallbackFactory implements FallbackFactory<NormalLimitFeignClient> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NormalLimitFeignClient 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 NormalLimitFeignClient() {
|
||||||
|
@Override
|
||||||
|
public HttpResult<String> getNormLimitData(LineParam lineParam) {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}", "告警数据: ", throwable.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
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.OnlineRateFeignClient;
|
||||||
|
import com.njcn.prepare.harmonic.pojo.param.LineParam;
|
||||||
|
import feign.hystrix.FallbackFactory;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* OnlineRateFeignClientFallbackFactory
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Component
|
||||||
|
public class OnlineRateFeignClientFallbackFactory implements FallbackFactory<OnlineRateFeignClient> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public OnlineRateFeignClient 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 OnlineRateFeignClient() {
|
||||||
|
@Override
|
||||||
|
public HttpResult<String> getOnlineRateData(@RequestBody @Validated LineParam lineParam){
|
||||||
|
log.error("{}异常,降级处理,异常为:{}", "在线率: ", throwable.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
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.PollutionFeignClient;
|
||||||
|
import com.njcn.prepare.harmonic.pojo.param.LineParam;
|
||||||
|
import feign.hystrix.FallbackFactory;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PollutionFeignClientFallbackFactory
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Component
|
||||||
|
public class PollutionFeignClientFallbackFactory implements FallbackFactory<PollutionFeignClient> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PollutionFeignClient 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 PollutionFeignClient() {
|
||||||
|
@Override
|
||||||
|
public HttpResult<String> processPollutionData(@RequestBody @Validated LineParam lineParam){
|
||||||
|
log.error("{}异常,降级处理,异常为:{}", "污区数据: ", throwable.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
package com.njcn.prepare.harmonic.api.voltage;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author qijian
|
||||||
|
* @version 1.0.0
|
||||||
|
* @date 2022年10月24日 20:13
|
||||||
|
*/
|
||||||
|
public interface VoltageFeignClient {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -5,13 +5,16 @@ import com.njcn.common.pojo.enums.common.LogEnum;
|
|||||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||||
import com.njcn.common.pojo.response.HttpResult;
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
import com.njcn.common.utils.HttpResultUtil;
|
import com.njcn.common.utils.HttpResultUtil;
|
||||||
|
import com.njcn.prepare.harmonic.pojo.param.LineParam;
|
||||||
import com.njcn.prepare.harmonic.service.line.NormalLimitService;
|
import com.njcn.prepare.harmonic.service.line.NormalLimitService;
|
||||||
import com.njcn.web.controller.BaseController;
|
import com.njcn.web.controller.BaseController;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
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.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
@@ -32,9 +35,14 @@ public class NormalLimitController extends BaseController {
|
|||||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
@PostMapping("/getNormLimitData")
|
@PostMapping("/getNormLimitData")
|
||||||
@ApiOperation("告警数据预处理")
|
@ApiOperation("告警数据预处理")
|
||||||
public HttpResult<String> getNormLimitData() {
|
public HttpResult<String> getNormLimitData(@RequestBody LineParam lineParam) {
|
||||||
String methodDescribe = getMethodDescribe("getNormLimitData");
|
String methodDescribe = getMethodDescribe("getNormLimitData");
|
||||||
String list = normLimitService.getNormLimitData();
|
try {
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
normLimitService.AbnormalLineData(lineParam);
|
||||||
|
}catch (Exception e){
|
||||||
|
e.printStackTrace();
|
||||||
|
log.error("告警数据预处理异常:"+e.getMessage());
|
||||||
|
}
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,11 +2,12 @@ package com.njcn.prepare.harmonic.mapper.line;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.njcn.prepare.harmonic.pojo.po.AbnormalPO;
|
import com.njcn.prepare.harmonic.pojo.po.AbnormalPO;
|
||||||
|
import com.njcn.prepare.harmonic.pojo.po.MpSurplusAbnormalD;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author denghuajun
|
* @author denghuajun
|
||||||
* @version 1.0.0
|
* @version 1.0.0
|
||||||
* @date 2022年10月18日 11:12
|
* @date 2022年10月18日 11:12
|
||||||
*/
|
*/
|
||||||
public interface AbnormalMapper extends BaseMapper<AbnormalPO> {
|
public interface AbnormalMapper extends BaseMapper<MpSurplusAbnormalD> {
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,465 @@
|
|||||||
|
package com.njcn.prepare.harmonic.pojo.po;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.njcn.db.bo.BaseEntity;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
*
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author hongawen
|
||||||
|
* @since 2022-11-08
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("r_mp_surplus_abnormal_d")
|
||||||
|
public class MpSurplusAbnormalD{
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 统计数据时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime timeId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 越限监测点
|
||||||
|
*/
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据类型,’A’表示A相,’B’表示B相,’C’表示C相,’T’表示总
|
||||||
|
*/
|
||||||
|
private String phasicType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 指标类型,’AVG’代表平均值平均值,‘MAX’代表最大值,‘MIN’代表最小值,‘CP95’代表CP95值
|
||||||
|
*/
|
||||||
|
private String valueType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电压上偏差数值
|
||||||
|
*/
|
||||||
|
private Float voltageDev = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电压下偏差数值
|
||||||
|
*/
|
||||||
|
private Float uvoltageDev = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 三相电压不平衡度数值
|
||||||
|
*/
|
||||||
|
private Float ubalance = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 闪变数值
|
||||||
|
*/
|
||||||
|
private Float flicker = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电压总畸变率数值
|
||||||
|
*/
|
||||||
|
private Float uaberrance = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 负序电流
|
||||||
|
*/
|
||||||
|
private Float iNeg = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 频率
|
||||||
|
*/
|
||||||
|
private Float freq = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 2次谐波电压数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "uharm_2")
|
||||||
|
private Float uharm2 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 3次谐波电压数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "uharm_3")
|
||||||
|
private Float uharm3 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 4次谐波电压数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "uharm_4")
|
||||||
|
private Float uharm4 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 5次谐波电压数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "uharm_5")
|
||||||
|
private Float uharm5 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 6次谐波电压数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "uharm_6")
|
||||||
|
private Float uharm6 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 7次谐波电压数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "uharm_7")
|
||||||
|
private Float uharm7 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 8次谐波电压数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "uharm_8")
|
||||||
|
private Float uharm8 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 9次谐波电压数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "uharm_9")
|
||||||
|
private Float uharm9 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 10次谐波电压数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "uharm_10")
|
||||||
|
private Float uharm10 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 11次谐波电压数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "uharm_11")
|
||||||
|
private Float uharm11 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 12次谐波电压数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "uharm_12")
|
||||||
|
private Float uharm12 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 13次谐波电压数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "uharm_13")
|
||||||
|
private Float uharm13 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 14次谐波电压数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "uharm_14")
|
||||||
|
private Float uharm14 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 15次谐波电压数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "uharm_15")
|
||||||
|
private Float uharm15 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 16次谐波电压数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "uharm_16")
|
||||||
|
private Float uharm16 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 17次谐波电压数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "uharm_17")
|
||||||
|
private Float uharm17 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 18次谐波电压数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "uharm_18")
|
||||||
|
private Float uharm18 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 19次谐波电压数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "uharm_19")
|
||||||
|
private Float uharm19 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 20次谐波电压数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "uharm_20")
|
||||||
|
private Float uharm20 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 21次谐波电压数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "uharm_21")
|
||||||
|
private Float uharm21 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 22次谐波电压数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "uharm_22")
|
||||||
|
private Float uharm22 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 23次谐波电压数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "uharm_23")
|
||||||
|
private Float uharm23 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 24次谐波电压数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "uharm_24")
|
||||||
|
private Float uharm24 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 25次谐波电压数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "uharm_25")
|
||||||
|
private Float uharm25 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 2次谐波电流数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "iharm_2")
|
||||||
|
private Float iharm2 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 3次谐波电流数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "iharm_3")
|
||||||
|
private Float iharm3 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 4次谐波电流数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "iharm_4")
|
||||||
|
private Float iharm4 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 5次谐波电流数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "iharm_5")
|
||||||
|
private Float iharm5 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 6次谐波电流数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "iharm_6")
|
||||||
|
private Float iharm6 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 7次谐波电流数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "iharm_7")
|
||||||
|
private Float iharm7 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 8次谐波电流数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "iharm_8")
|
||||||
|
private Float iharm8 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 9次谐波电流数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "iharm_9")
|
||||||
|
private Float iharm9 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 10次谐波电流数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "iharm_10")
|
||||||
|
private Float iharm10 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 11次谐波电流数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "iharm_11")
|
||||||
|
private Float iharm11 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 12次谐波电流数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "iharm_12")
|
||||||
|
private Float iharm12 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 13次谐波电流数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "iharm_13")
|
||||||
|
private Float iharm13 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 14次谐波电流数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "iharm_14")
|
||||||
|
private Float iharm14 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 15次谐波电流数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "iharm_15")
|
||||||
|
private Float iharm15 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 16次谐波电流数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "iharm_16")
|
||||||
|
private Float iharm16 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 17次谐波电流数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "iharm_17")
|
||||||
|
private Float iharm17 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 18次谐波电流数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "iharm_18")
|
||||||
|
private Float iharm18 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 19次谐波电流数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "iharm_19")
|
||||||
|
private Float iharm19 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 20次谐波电流数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "iharm_20")
|
||||||
|
private Float iharm20 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 21次谐波电流数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "iharm_21")
|
||||||
|
private Float iharm21 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 22次谐波电流数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "iharm_22")
|
||||||
|
private Float iharm22 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 23次谐波电流数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "iharm_23")
|
||||||
|
private Float iharm23 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 24次谐波电流数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "iharm_24")
|
||||||
|
private Float iharm24 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 25次谐波电流数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "iharm_25")
|
||||||
|
private Float iharm25 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 0.5次间谐波电压数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "inuharm_1")
|
||||||
|
private Float inuharm1 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 1.5次间谐波电压数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "inuharm_2")
|
||||||
|
private Float inuharm2 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 2.5次间谐波电压数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "inuharm_3")
|
||||||
|
private Float inuharm3 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 3.5次间谐波电压数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "inuharm_4")
|
||||||
|
private Float inuharm4 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 4.5次间谐波电压数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "inuharm_5")
|
||||||
|
private Float inuharm5 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 5.5次间谐波电压数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "inuharm_6")
|
||||||
|
private Float inuharm6 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 6.5次间谐波电压数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "inuharm_7")
|
||||||
|
private Float inuharm7 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 7.5次间谐波电压数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "inuharm_8")
|
||||||
|
private Float inuharm8 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 8.5次间谐波电压数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "inuharm_9")
|
||||||
|
private Float inuharm9 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 9.5次间谐波电压数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "inuharm_10")
|
||||||
|
private Float inuharm10 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 10.5次间谐波电压数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "inuharm_11")
|
||||||
|
private Float inuharm11 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 11.5次间谐波电压数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "inuharm_12")
|
||||||
|
private Float inuharm12 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 12.5次间谐波电压数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "inuharm_13")
|
||||||
|
private Float inuharm13 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 13.5次间谐波电压数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "inuharm_14")
|
||||||
|
private Float inuharm14 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 14.5次间谐波电压数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "inuharm_15")
|
||||||
|
private Float inuharm15 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 15.5次间谐波电压数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "inuharm_16")
|
||||||
|
private Float inuharm16 = -3.14159f;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -91,6 +91,12 @@ public class OnlineRateServiceImpl implements OnlineRateService {
|
|||||||
return resultMapper.toPOJO(sqlResult, PqsCommunicatePO.class);
|
return resultMapper.toPOJO(sqlResult, PqsCommunicatePO.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private List<PqsCommunicatePO> getCommunicateDataOld(String lineId, String date){
|
||||||
|
QueryResult sqlResult = influxDbUtils.query("SELECT * FROM pqs_communicate where time <= '" + date + " 23:59:59' and dev_id = '" + lineId +"' order by time desc limit 1 tz('Asia/Shanghai')");
|
||||||
|
InfluxDBResultMapper resultMapper = new InfluxDBResultMapper();
|
||||||
|
return resultMapper.toPOJO(sqlResult, PqsCommunicatePO.class);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* new的时间和当前统计时间 不是/是 同一天
|
* new的时间和当前统计时间 不是/是 同一天
|
||||||
*/
|
*/
|
||||||
@@ -105,7 +111,7 @@ public class OnlineRateServiceImpl implements OnlineRateService {
|
|||||||
Date nowDate = new Date();
|
Date nowDate = new Date();
|
||||||
/*数据补招的情况下*/
|
/*数据补招的情况下*/
|
||||||
if (DateUtil.between(date,nowDate,DateUnit.DAY) > DateUtil.between(newDate,nowDate,DateUnit.DAY)){
|
if (DateUtil.between(date,nowDate,DateUnit.DAY) > DateUtil.between(newDate,nowDate,DateUnit.DAY)){
|
||||||
minute = processData(newDate, date, type, lineId, dateStr);
|
minute = processData(newDate, date, null, lineId, dateStr);
|
||||||
}else {
|
}else {
|
||||||
if (ModelState.online.equals(type)){
|
if (ModelState.online.equals(type)){
|
||||||
minute = DAY_MINUTE;
|
minute = DAY_MINUTE;
|
||||||
@@ -151,10 +157,19 @@ public class OnlineRateServiceImpl implements OnlineRateService {
|
|||||||
minute = (int)onlineTime;
|
minute = (int)onlineTime;
|
||||||
}
|
}
|
||||||
}else {
|
}else {
|
||||||
/*当前统计时间内仅有一条数据*/
|
if(type != null){
|
||||||
long differ = DateUtil.between(date,newDate,DateUnit.MINUTE);
|
/*当前统计时间内仅有一条数据*/
|
||||||
if (ModelState.online.equals(type)){
|
long differ = DateUtil.between(date,newDate,DateUnit.MINUTE);
|
||||||
minute = DAY_MINUTE - (int)differ;
|
if (ModelState.online.equals(type)){
|
||||||
|
minute = DAY_MINUTE - (int)differ;
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
List<PqsCommunicatePO> communicateDataOld = getCommunicateDataOld(lineId,dateStr);
|
||||||
|
if (communicateDataOld.size() > 0){
|
||||||
|
if (ModelState.online.equals(communicateDataOld.get(0).getType())){
|
||||||
|
minute = DAY_MINUTE;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return minute;
|
return minute;
|
||||||
|
|||||||
@@ -281,24 +281,25 @@ public class ReportServiceImpl implements ReportService {
|
|||||||
*/
|
*/
|
||||||
private void assSql(ReportTemplateDTO data, StringBuilder sql, List<ReportTemplateDTO> endList, String method, String lineId) {
|
private void assSql(ReportTemplateDTO data, StringBuilder sql, List<ReportTemplateDTO> endList, String method, String lineId) {
|
||||||
//sql拼接示例:select MAX(IHA2) as IHA2 from power_quality_data where Phase = 'A' and LineId='1324564568' and Stat_Method='max' tz('Asia/Shanghai')
|
//sql拼接示例:select MAX(IHA2) as IHA2 from power_quality_data where Phase = 'A' and LineId='1324564568' and Stat_Method='max' tz('Asia/Shanghai')
|
||||||
|
//cp95函数特殊处理 PERCENTILE(field_key, N)
|
||||||
|
if (InfluxDBSqlConstant.CP95.equals(method)){
|
||||||
|
sql.append(method).append(InfluxDBSqlConstant.LBK).append(data.getTemplateName()).append(InfluxDBSqlConstant.NUM_95).append(InfluxDBSqlConstant.RBK).append(InfluxDBSqlConstant.AS_VALUE);
|
||||||
|
}else{
|
||||||
|
sql.append(method).append(InfluxDBSqlConstant.LBK).append(data.getTemplateName()).append(InfluxDBSqlConstant.RBK).append(InfluxDBSqlConstant.AS_VALUE);
|
||||||
|
}
|
||||||
|
|
||||||
|
//相别特殊处理
|
||||||
if (InfluxDBTableConstant.NO_PHASE.equals(data.getPhase())) {
|
if (InfluxDBTableConstant.NO_PHASE.equals(data.getPhase())) {
|
||||||
sql.append(method).append(InfluxDBSqlConstant.LBK).append(data.getTemplateName()).append(InfluxDBSqlConstant.RBK).append(InfluxDBSqlConstant.AS_VALUE)
|
sql.append(InfluxDBSqlConstant.FROM).append(data.getClassId())
|
||||||
.append(InfluxDBSqlConstant.FROM).append(data.getClassId())
|
|
||||||
.append(InfluxDBSqlConstant.WHERE).append(InfluxDBTableConstant.LINE_ID).append(InfluxDBSqlConstant.EQ).append(InfluxDBSqlConstant.QM).append(lineId).append(InfluxDBSqlConstant.QM)
|
.append(InfluxDBSqlConstant.WHERE).append(InfluxDBTableConstant.LINE_ID).append(InfluxDBSqlConstant.EQ).append(InfluxDBSqlConstant.QM).append(lineId).append(InfluxDBSqlConstant.QM)
|
||||||
.append(InfluxDBSqlConstant.AND).append(InfluxDBTableConstant.VALUE_TYPE).append(InfluxDBSqlConstant.EQ).append(InfluxDBSqlConstant.QM).append(data.getStatMethod()).append(InfluxDBSqlConstant.QM)
|
.append(InfluxDBSqlConstant.AND).append(InfluxDBTableConstant.VALUE_TYPE).append(InfluxDBSqlConstant.EQ).append(InfluxDBSqlConstant.QM).append(data.getStatMethod()).append(InfluxDBSqlConstant.QM)
|
||||||
.append(InfluxDBSqlConstant.TZ);
|
.append(InfluxDBSqlConstant.TZ);
|
||||||
} else {
|
} else {
|
||||||
//cp95函数特殊处理 PERCENTILE(field_key, N)
|
|
||||||
if (InfluxDBSqlConstant.CP95.equals(method)){
|
|
||||||
sql.append(method).append(InfluxDBSqlConstant.LBK).append(data.getTemplateName()).append(InfluxDBSqlConstant.NUM_95).append(InfluxDBSqlConstant.RBK).append(InfluxDBSqlConstant.AS_VALUE);
|
|
||||||
}else{
|
|
||||||
sql.append(method).append(InfluxDBSqlConstant.LBK).append(data.getTemplateName()).append(InfluxDBSqlConstant.RBK).append(InfluxDBSqlConstant.AS_VALUE);
|
|
||||||
}
|
|
||||||
sql.append(InfluxDBSqlConstant.FROM).append(data.getClassId())
|
sql.append(InfluxDBSqlConstant.FROM).append(data.getClassId())
|
||||||
.append(InfluxDBSqlConstant.WHERE).append(InfluxDBTableConstant.LINE_ID).append(InfluxDBSqlConstant.EQ).append(InfluxDBSqlConstant.QM).append(lineId).append(InfluxDBSqlConstant.QM)
|
.append(InfluxDBSqlConstant.WHERE).append(InfluxDBTableConstant.LINE_ID).append(InfluxDBSqlConstant.EQ).append(InfluxDBSqlConstant.QM).append(lineId).append(InfluxDBSqlConstant.QM)
|
||||||
.append(InfluxDBSqlConstant.AND).append(InfluxDBTableConstant.VALUE_TYPE).append(InfluxDBSqlConstant.EQ).append(InfluxDBSqlConstant.QM).append(data.getStatMethod()).append(InfluxDBSqlConstant.QM)
|
.append(InfluxDBSqlConstant.AND).append(InfluxDBTableConstant.VALUE_TYPE).append(InfluxDBSqlConstant.EQ).append(InfluxDBSqlConstant.QM).append(data.getStatMethod()).append(InfluxDBSqlConstant.QM)
|
||||||
.append(InfluxDBSqlConstant.AND).append(InfluxDBTableConstant.PHASIC_TYPE).append(InfluxDBSqlConstant.EQ).append(InfluxDBSqlConstant.QM).append(data.getPhase()).append(InfluxDBSqlConstant.QM)
|
.append(InfluxDBSqlConstant.AND).append(InfluxDBTableConstant.PHASIC_TYPE).append(InfluxDBSqlConstant.EQ).append(InfluxDBSqlConstant.QM).append(data.getPhase()).append(InfluxDBSqlConstant.QM)
|
||||||
.append(InfluxDBSqlConstant.TZ);
|
.append(InfluxDBSqlConstant.TZ);
|
||||||
}
|
}
|
||||||
|
|
||||||
//根据不同的库表赋值
|
//根据不同的库表赋值
|
||||||
|
|||||||
@@ -1,11 +1,21 @@
|
|||||||
package com.njcn.prepare.harmonic.service.line;
|
package com.njcn.prepare.harmonic.service.line;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.njcn.device.pq.pojo.po.Node;
|
||||||
|
import com.njcn.prepare.harmonic.pojo.param.LineParam;
|
||||||
|
import com.njcn.prepare.harmonic.pojo.po.MpSurplusAbnormalD;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author denghuajun
|
* @author denghuajun
|
||||||
* @version 1.0.0
|
* @version 1.0.0
|
||||||
* @date 2022年10月17日 19:58
|
* @date 2022年10月17日 19:58
|
||||||
*/
|
*/
|
||||||
public interface NormalLimitService {
|
public interface NormalLimitService extends IService<MpSurplusAbnormalD> {
|
||||||
|
|
||||||
|
Boolean getNormLimitData(LineParam lineParam);
|
||||||
|
|
||||||
|
|
||||||
|
Boolean AbnormalLineData(LineParam lineParam);
|
||||||
|
|
||||||
|
|
||||||
String getNormLimitData();
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,28 @@
|
|||||||
|
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.DistortionRateFeignClientFallbackFactory;
|
||||||
|
import com.njcn.prepare.harmonic.pojo.param.LineParam;
|
||||||
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 稳态综合评估
|
||||||
|
* @author xiaoyao
|
||||||
|
* @version 1.0.0
|
||||||
|
* @createTime 2022/11/7 15:11
|
||||||
|
*/
|
||||||
|
|
||||||
|
@FeignClient(
|
||||||
|
value = ServerInfo.HARMONIC_PREPARE,
|
||||||
|
path = "/general",
|
||||||
|
fallbackFactory = DistortionRateFeignClientFallbackFactory.class
|
||||||
|
)
|
||||||
|
public interface HarmonicGeneralFeignClient {
|
||||||
|
|
||||||
|
@PostMapping("/generalData")
|
||||||
|
HttpResult<String> generalData(@RequestBody @Validated LineParam lineParam);
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
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.HarmonicMetricFeignClientFallbackFactory;
|
||||||
|
import com.njcn.prepare.harmonic.pojo.param.LineParam;
|
||||||
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author xiaoyao
|
||||||
|
* @version 1.0.0
|
||||||
|
* @createTime 2022/11/7 15:12
|
||||||
|
*/
|
||||||
|
|
||||||
|
@FeignClient(
|
||||||
|
value = ServerInfo.HARMONIC_PREPARE,
|
||||||
|
path = "/metric",
|
||||||
|
fallbackFactory = HarmonicMetricFeignClientFallbackFactory.class
|
||||||
|
)
|
||||||
|
public interface HarmonicMetricFeignClient {
|
||||||
|
|
||||||
|
@PostMapping("/metricData")
|
||||||
|
HttpResult<String> metricData(@RequestBody @Validated LineParam lineParam);
|
||||||
|
}
|
||||||
@@ -10,8 +10,8 @@ import org.springframework.web.bind.annotation.PostMapping;
|
|||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 自定义报表
|
*
|
||||||
* @author qijian
|
* @author denghaujun
|
||||||
* @date 2022/10/20
|
* @date 2022/10/20
|
||||||
*/
|
*/
|
||||||
@FeignClient(
|
@FeignClient(
|
||||||
@@ -22,8 +22,8 @@ import org.springframework.web.bind.annotation.RequestBody;
|
|||||||
public interface NormalLimitFeignClient {
|
public interface NormalLimitFeignClient {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量处理报表
|
*
|
||||||
* @author qijian
|
* @author denghaujun
|
||||||
* @date 2022/10/19
|
* @date 2022/10/19
|
||||||
*/
|
*/
|
||||||
@PostMapping("/getNormLimitData")
|
@PostMapping("/getNormLimitData")
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import com.njcn.prepare.harmonic.pojo.param.LineParam;
|
|||||||
import feign.hystrix.FallbackFactory;
|
import feign.hystrix.FallbackFactory;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ReportFeignClientFallbackFactory
|
* ReportFeignClientFallbackFactory
|
||||||
@@ -32,8 +33,8 @@ public class CoustomReportFeignClientFallbackFactory implements FallbackFactory<
|
|||||||
Enum<?> finalExceptionEnum = exceptionEnum;
|
Enum<?> finalExceptionEnum = exceptionEnum;
|
||||||
return new CoustmReportFeignClient() {
|
return new CoustmReportFeignClient() {
|
||||||
@Override
|
@Override
|
||||||
public HttpResult<Boolean> batchReport(LineParam reportParam){
|
public HttpResult<Boolean> batchReport(@RequestBody LineParam reportParam){
|
||||||
log.error("{}异常,降级处理,异常为:{}", "自定义报表预处理任务: ", throwable.toString());
|
log.error("{}异常,降级处理,异常为:{}", "生成自定义报表: ", throwable.toString());
|
||||||
throw new BusinessException(finalExceptionEnum);
|
throw new BusinessException(finalExceptionEnum);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import com.njcn.prepare.harmonic.pojo.param.LineParam;
|
|||||||
import feign.hystrix.FallbackFactory;
|
import feign.hystrix.FallbackFactory;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ReportFeignClientFallbackFactory
|
* ReportFeignClientFallbackFactory
|
||||||
@@ -32,7 +33,7 @@ public class DayDataFeignClientFallbackFactory implements FallbackFactory<DayDat
|
|||||||
Enum<?> finalExceptionEnum = exceptionEnum;
|
Enum<?> finalExceptionEnum = exceptionEnum;
|
||||||
return new DayDataFeignClient() {
|
return new DayDataFeignClient() {
|
||||||
@Override
|
@Override
|
||||||
public HttpResult<Boolean> dayDataHanlder(LineParam jobParam){
|
public HttpResult<Boolean> dayDataHanlder(@RequestBody LineParam jobParam){
|
||||||
log.error("{}异常,降级处理,异常为:{}", "Date数据转Day数据: ", throwable.toString());
|
log.error("{}异常,降级处理,异常为:{}", "Date数据转Day数据: ", throwable.toString());
|
||||||
throw new BusinessException(finalExceptionEnum);
|
throw new BusinessException(finalExceptionEnum);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,40 @@
|
|||||||
|
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.HarmonicGeneralFeignClient;
|
||||||
|
import com.njcn.prepare.harmonic.pojo.param.LineParam;
|
||||||
|
import feign.hystrix.FallbackFactory;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author xiaoyao
|
||||||
|
* @version 1.0.0
|
||||||
|
* @createTime 2022/11/7 15:17
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Component
|
||||||
|
public class HarmonicGeneralFeignClientFallbackFactory implements FallbackFactory<HarmonicGeneralFeignClient> {
|
||||||
|
@Override
|
||||||
|
public HarmonicGeneralFeignClient 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 HarmonicGeneralFeignClient() {
|
||||||
|
@Override
|
||||||
|
public HttpResult<String> generalData(@RequestBody @Validated LineParam lineParam){
|
||||||
|
log.error("{}异常,降级处理,异常为:{}", "稳态综合评估: ", throwable.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
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.HarmonicMetricFeignClient;
|
||||||
|
import com.njcn.prepare.harmonic.pojo.param.LineParam;
|
||||||
|
import feign.hystrix.FallbackFactory;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author xiaoyao
|
||||||
|
* @version 1.0.0
|
||||||
|
* @createTime 2022/11/7 15:14
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Component
|
||||||
|
public class HarmonicMetricFeignClientFallbackFactory implements FallbackFactory<HarmonicMetricFeignClient> {
|
||||||
|
@Override
|
||||||
|
public HarmonicMetricFeignClient 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 HarmonicMetricFeignClient() {
|
||||||
|
@Override
|
||||||
|
public HttpResult<String> metricData(@RequestBody @Validated LineParam lineParam){
|
||||||
|
log.error("{}异常,降级处理,异常为:{}", "稳态指标评估: ", throwable.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -9,6 +9,8 @@ import com.njcn.prepare.harmonic.pojo.param.LineParam;
|
|||||||
import feign.hystrix.FallbackFactory;
|
import feign.hystrix.FallbackFactory;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* IntegrityFeignClientFallbackFactory
|
* IntegrityFeignClientFallbackFactory
|
||||||
@@ -28,8 +30,8 @@ public class IntegrityFeignClientFallbackFactory implements FallbackFactory<Inte
|
|||||||
Enum<?> finalExceptionEnum = exceptionEnum;
|
Enum<?> finalExceptionEnum = exceptionEnum;
|
||||||
return new IntegrityFeignClient() {
|
return new IntegrityFeignClient() {
|
||||||
@Override
|
@Override
|
||||||
public HttpResult<String> computeDataIntegrity(LineParam lineParam) {
|
public HttpResult<String> computeDataIntegrity(@RequestBody @Validated LineParam lineParam) {
|
||||||
log.error("{}异常,降级处理,异常为:{}", "数据完整性预处理: ", throwable.toString());
|
log.error("{}异常,降级处理,异常为:{}", "数据完整性处理: ", throwable.toString());
|
||||||
throw new BusinessException(finalExceptionEnum);
|
throw new BusinessException(finalExceptionEnum);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -9,6 +9,8 @@ import com.njcn.prepare.harmonic.pojo.param.LineParam;
|
|||||||
import feign.hystrix.FallbackFactory;
|
import feign.hystrix.FallbackFactory;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ReportFeignClientFallbackFactory
|
* ReportFeignClientFallbackFactory
|
||||||
@@ -32,8 +34,8 @@ public class LimitTargetFeignClientFallbackFactory implements FallbackFactory<Li
|
|||||||
Enum<?> finalExceptionEnum = exceptionEnum;
|
Enum<?> finalExceptionEnum = exceptionEnum;
|
||||||
return new LimitTargetFeignClient() {
|
return new LimitTargetFeignClient() {
|
||||||
@Override
|
@Override
|
||||||
public HttpResult<String> getLimitTargetData(LineParam lineParam) {
|
public HttpResult<String> getLimitTargetData(@RequestBody @Validated LineParam lineParam) {
|
||||||
log.error("{}异常,降级处理,异常为:{}", "越限次数数据预处理: ", throwable.toString());
|
log.error("{}异常,降级处理,异常为:{}", "越限数据: ", throwable.toString());
|
||||||
throw new BusinessException(finalExceptionEnum);
|
throw new BusinessException(finalExceptionEnum);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import com.njcn.prepare.harmonic.pojo.param.LineParam;
|
|||||||
import feign.hystrix.FallbackFactory;
|
import feign.hystrix.FallbackFactory;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ReportFeignClientFallbackFactory
|
* ReportFeignClientFallbackFactory
|
||||||
@@ -32,8 +33,8 @@ public class LimitrateFeignClientFallbackFactory implements FallbackFactory<Limi
|
|||||||
Enum<?> finalExceptionEnum = exceptionEnum;
|
Enum<?> finalExceptionEnum = exceptionEnum;
|
||||||
return new LimitrateFeignClient() {
|
return new LimitrateFeignClient() {
|
||||||
@Override
|
@Override
|
||||||
public HttpResult<Boolean> limitRateHanlder(LineParam limitRateHanlderParam ){
|
public HttpResult<Boolean> limitRateHanlder(@RequestBody LineParam limitRateHanlderParam ){
|
||||||
log.error("{}异常,降级处理,异常为:{}", "越限是否数据预处理: ", throwable.toString());
|
log.error("{}异常,降级处理,异常为:{}", "越限数据处理: ", throwable.toString());
|
||||||
throw new BusinessException(finalExceptionEnum);
|
throw new BusinessException(finalExceptionEnum);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ public class NormalFeignClientFallbackFactory implements FallbackFactory<NormalL
|
|||||||
return new NormalLimitFeignClient() {
|
return new NormalLimitFeignClient() {
|
||||||
@Override
|
@Override
|
||||||
public HttpResult<String> getNormLimitData(LineParam lineParam) {
|
public HttpResult<String> getNormLimitData(LineParam lineParam) {
|
||||||
log.error("{}异常,降级处理,异常为:{}", "告警数据预处理: ", throwable.toString());
|
log.error("{}异常,降级处理,异常为:{}", "告警数据: ", throwable.toString());
|
||||||
throw new BusinessException(finalExceptionEnum);
|
throw new BusinessException(finalExceptionEnum);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -9,6 +9,8 @@ import com.njcn.prepare.harmonic.pojo.param.LineParam;
|
|||||||
import feign.hystrix.FallbackFactory;
|
import feign.hystrix.FallbackFactory;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* OnlineRateFeignClientFallbackFactory
|
* OnlineRateFeignClientFallbackFactory
|
||||||
@@ -28,8 +30,8 @@ public class OnlineRateFeignClientFallbackFactory implements FallbackFactory<Onl
|
|||||||
Enum<?> finalExceptionEnum = exceptionEnum;
|
Enum<?> finalExceptionEnum = exceptionEnum;
|
||||||
return new OnlineRateFeignClient() {
|
return new OnlineRateFeignClient() {
|
||||||
@Override
|
@Override
|
||||||
public HttpResult<String> getOnlineRateData(LineParam lineParam){
|
public HttpResult<String> getOnlineRateData(@RequestBody @Validated LineParam lineParam){
|
||||||
log.error("{}异常,降级处理,异常为:{}", "在线率数据预处理: ", throwable.toString());
|
log.error("{}异常,降级处理,异常为:{}", "在线率: ", throwable.toString());
|
||||||
throw new BusinessException(finalExceptionEnum);
|
throw new BusinessException(finalExceptionEnum);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -9,6 +9,8 @@ import com.njcn.prepare.harmonic.pojo.param.LineParam;
|
|||||||
import feign.hystrix.FallbackFactory;
|
import feign.hystrix.FallbackFactory;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PollutionFeignClientFallbackFactory
|
* PollutionFeignClientFallbackFactory
|
||||||
@@ -29,8 +31,8 @@ public class PollutionFeignClientFallbackFactory implements FallbackFactory<Poll
|
|||||||
Enum<?> finalExceptionEnum = exceptionEnum;
|
Enum<?> finalExceptionEnum = exceptionEnum;
|
||||||
return new PollutionFeignClient() {
|
return new PollutionFeignClient() {
|
||||||
@Override
|
@Override
|
||||||
public HttpResult<String> processPollutionData(LineParam lineParam){
|
public HttpResult<String> processPollutionData(@RequestBody @Validated LineParam lineParam){
|
||||||
log.error("{}异常,降级处理,异常为:{}", "污区数据预处理: ", throwable.toString());
|
log.error("{}异常,降级处理,异常为:{}", "污区数据: ", throwable.toString());
|
||||||
throw new BusinessException(finalExceptionEnum);
|
throw new BusinessException(finalExceptionEnum);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -40,4 +40,8 @@ public class DataFlickerPO {
|
|||||||
|
|
||||||
@Column(name = "pst")
|
@Column(name = "pst")
|
||||||
private Double pst;
|
private Double pst;
|
||||||
|
|
||||||
|
//自定义字段
|
||||||
|
@Column(name = "count")
|
||||||
|
private Integer count;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,4 +32,7 @@ public class DataPltPO {
|
|||||||
@Column(name = "flicker_all_time")
|
@Column(name = "flicker_all_time")
|
||||||
private Integer flickerAllTime;
|
private Integer flickerAllTime;
|
||||||
|
|
||||||
|
//自定义字段
|
||||||
|
@Column(name = "mean")
|
||||||
|
private Double mean;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import java.time.Instant;
|
|||||||
* @createTime 2022/10/21 13:45
|
* @createTime 2022/10/21 13:45
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Measurement(name = "data_polluction")
|
@Measurement(name = "harmonic_pollution")
|
||||||
public class DataPolluctionPO {
|
public class DataPolluctionPO {
|
||||||
|
|
||||||
@Column(name = "line_id")
|
@Column(name = "line_id")
|
||||||
|
|||||||
@@ -211,4 +211,12 @@ public class DataVPO {
|
|||||||
//自定义字段-总计算次数
|
//自定义字段-总计算次数
|
||||||
@Column(name = "all_time")
|
@Column(name = "all_time")
|
||||||
private Integer allTime;
|
private Integer allTime;
|
||||||
|
|
||||||
|
//自定义字段
|
||||||
|
@Column(name = "mean")
|
||||||
|
private Double mean;
|
||||||
|
|
||||||
|
//自定义字段
|
||||||
|
@Column(name = "count")
|
||||||
|
private Integer count;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,464 @@
|
|||||||
|
package com.njcn.prepare.harmonic.pojo.po;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
*
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author hongawen
|
||||||
|
* @since 2022-11-08
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("r_mp_surplus_abnormal_d")
|
||||||
|
public class MpSurplusAbnormalD{
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 统计数据时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime timeId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 越限监测点
|
||||||
|
*/
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据类型,’A’表示A相,’B’表示B相,’C’表示C相,’T’表示总
|
||||||
|
*/
|
||||||
|
private String phasicType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 指标类型,’AVG’代表平均值平均值,‘MAX’代表最大值,‘MIN’代表最小值,‘CP95’代表CP95值
|
||||||
|
*/
|
||||||
|
private String valueType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电压上偏差数值
|
||||||
|
*/
|
||||||
|
private Float voltageDev = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电压下偏差数值
|
||||||
|
*/
|
||||||
|
private Float uvoltageDev = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 三相电压不平衡度数值
|
||||||
|
*/
|
||||||
|
private Float ubalance = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 闪变数值
|
||||||
|
*/
|
||||||
|
private Float flicker = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电压总畸变率数值
|
||||||
|
*/
|
||||||
|
private Float uaberrance = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 负序电流
|
||||||
|
*/
|
||||||
|
private Float iNeg = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 频率
|
||||||
|
*/
|
||||||
|
private Float freq = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 2次谐波电压数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "uharm_2")
|
||||||
|
private Float uharm2 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 3次谐波电压数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "uharm_3")
|
||||||
|
private Float uharm3 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 4次谐波电压数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "uharm_4")
|
||||||
|
private Float uharm4 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 5次谐波电压数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "uharm_5")
|
||||||
|
private Float uharm5 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 6次谐波电压数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "uharm_6")
|
||||||
|
private Float uharm6 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 7次谐波电压数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "uharm_7")
|
||||||
|
private Float uharm7 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 8次谐波电压数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "uharm_8")
|
||||||
|
private Float uharm8 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 9次谐波电压数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "uharm_9")
|
||||||
|
private Float uharm9 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 10次谐波电压数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "uharm_10")
|
||||||
|
private Float uharm10 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 11次谐波电压数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "uharm_11")
|
||||||
|
private Float uharm11 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 12次谐波电压数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "uharm_12")
|
||||||
|
private Float uharm12 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 13次谐波电压数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "uharm_13")
|
||||||
|
private Float uharm13 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 14次谐波电压数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "uharm_14")
|
||||||
|
private Float uharm14 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 15次谐波电压数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "uharm_15")
|
||||||
|
private Float uharm15 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 16次谐波电压数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "uharm_16")
|
||||||
|
private Float uharm16 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 17次谐波电压数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "uharm_17")
|
||||||
|
private Float uharm17 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 18次谐波电压数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "uharm_18")
|
||||||
|
private Float uharm18 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 19次谐波电压数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "uharm_19")
|
||||||
|
private Float uharm19 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 20次谐波电压数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "uharm_20")
|
||||||
|
private Float uharm20 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 21次谐波电压数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "uharm_21")
|
||||||
|
private Float uharm21 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 22次谐波电压数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "uharm_22")
|
||||||
|
private Float uharm22 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 23次谐波电压数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "uharm_23")
|
||||||
|
private Float uharm23 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 24次谐波电压数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "uharm_24")
|
||||||
|
private Float uharm24 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 25次谐波电压数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "uharm_25")
|
||||||
|
private Float uharm25 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 2次谐波电流数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "iharm_2")
|
||||||
|
private Float iharm2 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 3次谐波电流数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "iharm_3")
|
||||||
|
private Float iharm3 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 4次谐波电流数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "iharm_4")
|
||||||
|
private Float iharm4 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 5次谐波电流数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "iharm_5")
|
||||||
|
private Float iharm5 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 6次谐波电流数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "iharm_6")
|
||||||
|
private Float iharm6 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 7次谐波电流数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "iharm_7")
|
||||||
|
private Float iharm7 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 8次谐波电流数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "iharm_8")
|
||||||
|
private Float iharm8 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 9次谐波电流数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "iharm_9")
|
||||||
|
private Float iharm9 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 10次谐波电流数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "iharm_10")
|
||||||
|
private Float iharm10 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 11次谐波电流数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "iharm_11")
|
||||||
|
private Float iharm11 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 12次谐波电流数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "iharm_12")
|
||||||
|
private Float iharm12 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 13次谐波电流数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "iharm_13")
|
||||||
|
private Float iharm13 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 14次谐波电流数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "iharm_14")
|
||||||
|
private Float iharm14 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 15次谐波电流数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "iharm_15")
|
||||||
|
private Float iharm15 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 16次谐波电流数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "iharm_16")
|
||||||
|
private Float iharm16 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 17次谐波电流数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "iharm_17")
|
||||||
|
private Float iharm17 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 18次谐波电流数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "iharm_18")
|
||||||
|
private Float iharm18 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 19次谐波电流数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "iharm_19")
|
||||||
|
private Float iharm19 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 20次谐波电流数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "iharm_20")
|
||||||
|
private Float iharm20 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 21次谐波电流数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "iharm_21")
|
||||||
|
private Float iharm21 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 22次谐波电流数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "iharm_22")
|
||||||
|
private Float iharm22 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 23次谐波电流数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "iharm_23")
|
||||||
|
private Float iharm23 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 24次谐波电流数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "iharm_24")
|
||||||
|
private Float iharm24 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 25次谐波电流数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "iharm_25")
|
||||||
|
private Float iharm25 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 0.5次间谐波电压数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "inuharm_1")
|
||||||
|
private Float inuharm1 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 1.5次间谐波电压数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "inuharm_2")
|
||||||
|
private Float inuharm2 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 2.5次间谐波电压数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "inuharm_3")
|
||||||
|
private Float inuharm3 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 3.5次间谐波电压数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "inuharm_4")
|
||||||
|
private Float inuharm4 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 4.5次间谐波电压数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "inuharm_5")
|
||||||
|
private Float inuharm5 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 5.5次间谐波电压数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "inuharm_6")
|
||||||
|
private Float inuharm6 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 6.5次间谐波电压数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "inuharm_7")
|
||||||
|
private Float inuharm7 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 7.5次间谐波电压数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "inuharm_8")
|
||||||
|
private Float inuharm8 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 8.5次间谐波电压数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "inuharm_9")
|
||||||
|
private Float inuharm9 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 9.5次间谐波电压数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "inuharm_10")
|
||||||
|
private Float inuharm10 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 10.5次间谐波电压数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "inuharm_11")
|
||||||
|
private Float inuharm11 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 11.5次间谐波电压数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "inuharm_12")
|
||||||
|
private Float inuharm12 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 12.5次间谐波电压数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "inuharm_13")
|
||||||
|
private Float inuharm13 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 13.5次间谐波电压数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "inuharm_14")
|
||||||
|
private Float inuharm14 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 14.5次间谐波电压数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "inuharm_15")
|
||||||
|
private Float inuharm15 = -3.14159f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 15.5次间谐波电压数值
|
||||||
|
*/
|
||||||
|
@TableField(value = "inuharm_16")
|
||||||
|
private Float inuharm16 = -3.14159f;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -22,6 +22,9 @@ public class PqsCommunicatePO {
|
|||||||
@Column(name = "line_id")
|
@Column(name = "line_id")
|
||||||
private String lineId;
|
private String lineId;
|
||||||
|
|
||||||
|
@Column(name = "dev_id")
|
||||||
|
private String devId;
|
||||||
|
|
||||||
@Column(name = "type")
|
@Column(name = "type")
|
||||||
private Integer type;
|
private Integer type;
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ public class RMpPollutionD implements Serializable {
|
|||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 监测点id
|
* 单位id
|
||||||
*/
|
*/
|
||||||
@TableId(value = "line_id", type = IdType.AUTO)
|
@TableId(value = "line_id", type = IdType.AUTO)
|
||||||
private String lineId;
|
private String lineId;
|
||||||
@@ -32,44 +32,14 @@ public class RMpPollutionD implements Serializable {
|
|||||||
private LocalDateTime dataDate;
|
private LocalDateTime dataDate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 频率偏差
|
* 污区图统计类型
|
||||||
*/
|
*/
|
||||||
private Float freqDev;
|
private String pollutionType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 电压偏差
|
* 统计值
|
||||||
*/
|
*/
|
||||||
private Float vDev;
|
private Float value;
|
||||||
|
|
||||||
/**
|
|
||||||
* 三相电压不平衡度
|
|
||||||
*/
|
|
||||||
private Float vUnbalance;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 谐波电压(电压总谐波畸变率、各次谐波电压含有率)
|
|
||||||
*/
|
|
||||||
private Float vAll;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 长时闪变
|
|
||||||
*/
|
|
||||||
private Float plt;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 谐波电流
|
|
||||||
*/
|
|
||||||
private Float iAll;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 负序电流
|
|
||||||
*/
|
|
||||||
private Float iNeg;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 间谐波电压含有率
|
|
||||||
*/
|
|
||||||
private Float vInharm;
|
|
||||||
|
|
||||||
public String getLineId() {
|
public String getLineId() {
|
||||||
return lineId;
|
return lineId;
|
||||||
@@ -85,76 +55,28 @@ public class RMpPollutionD implements Serializable {
|
|||||||
public void setDataDate(LocalDateTime dataDate) {
|
public void setDataDate(LocalDateTime dataDate) {
|
||||||
this.dataDate = dataDate;
|
this.dataDate = dataDate;
|
||||||
}
|
}
|
||||||
public Float getFreqDev() {
|
public String getPollutionType() {
|
||||||
return freqDev;
|
return pollutionType;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setFreqDev(Float freqDev) {
|
public void setPollutionType(String pollutionType) {
|
||||||
this.freqDev = freqDev;
|
this.pollutionType = pollutionType;
|
||||||
}
|
}
|
||||||
public Float getvDev() {
|
public Float getValue() {
|
||||||
return vDev;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setvDev(Float vDev) {
|
public void setValue(Float value) {
|
||||||
this.vDev = vDev;
|
this.value = value;
|
||||||
}
|
|
||||||
public Float getvUnbalance() {
|
|
||||||
return vUnbalance;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setvUnbalance(Float vUnbalance) {
|
|
||||||
this.vUnbalance = vUnbalance;
|
|
||||||
}
|
|
||||||
public Float getvAll() {
|
|
||||||
return vAll;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setvAll(Float vAll) {
|
|
||||||
this.vAll = vAll;
|
|
||||||
}
|
|
||||||
public Float getPlt() {
|
|
||||||
return plt;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPlt(Float plt) {
|
|
||||||
this.plt = plt;
|
|
||||||
}
|
|
||||||
public Float getiAll() {
|
|
||||||
return iAll;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setiAll(Float iAll) {
|
|
||||||
this.iAll = iAll;
|
|
||||||
}
|
|
||||||
public Float getiNeg() {
|
|
||||||
return iNeg;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setiNeg(Float iNeg) {
|
|
||||||
this.iNeg = iNeg;
|
|
||||||
}
|
|
||||||
public Float getvInharm() {
|
|
||||||
return vInharm;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setvInharm(Float vInharm) {
|
|
||||||
this.vInharm = vInharm;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "RMpPollutionD{" +
|
return "RStatPollutionOrgD{" +
|
||||||
"lineId=" + lineId +
|
"lineId=" + lineId +
|
||||||
", dataDate=" + dataDate +
|
", dataDate=" + dataDate +
|
||||||
", freqDev=" + freqDev +
|
", pollutionType=" + pollutionType +
|
||||||
", vDev=" + vDev +
|
", value=" + value +
|
||||||
", vUnbalance=" + vUnbalance +
|
"}";
|
||||||
", vAll=" + vAll +
|
|
||||||
", plt=" + plt +
|
|
||||||
", iAll=" + iAll +
|
|
||||||
", iNeg=" + iNeg +
|
|
||||||
", vInharm=" + vInharm +
|
|
||||||
"}";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,82 @@
|
|||||||
|
package com.njcn.prepare.harmonic.pojo.po;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 谐波畸变率排名
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author xiaoyao
|
||||||
|
* @since 2022-11-07
|
||||||
|
*/
|
||||||
|
@TableName("r_mp_v_thd")
|
||||||
|
public class RMpVThd implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 监测点ID
|
||||||
|
*/
|
||||||
|
@TableId(value = "measurement_point_id", type = IdType.AUTO)
|
||||||
|
private String measurementPointId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 排名类型,字典表(0日,1月,2季,3年)
|
||||||
|
*/
|
||||||
|
private String dataType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime dataDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 谐波畸变率
|
||||||
|
*/
|
||||||
|
private Float vThd;
|
||||||
|
|
||||||
|
public String getMeasurementPointId() {
|
||||||
|
return measurementPointId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMeasurementPointId(String measurementPointId) {
|
||||||
|
this.measurementPointId = measurementPointId;
|
||||||
|
}
|
||||||
|
public String getDataType() {
|
||||||
|
return dataType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDataType(String dataType) {
|
||||||
|
this.dataType = dataType;
|
||||||
|
}
|
||||||
|
public LocalDateTime getDataDate() {
|
||||||
|
return dataDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDataDate(LocalDateTime dataDate) {
|
||||||
|
this.dataDate = dataDate;
|
||||||
|
}
|
||||||
|
public Float getvThd() {
|
||||||
|
return vThd;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setvThd(Float vThd) {
|
||||||
|
this.vThd = vThd;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "RMpVThd{" +
|
||||||
|
"measurementPointId=" + measurementPointId +
|
||||||
|
", dataType=" + dataType +
|
||||||
|
", dataDate=" + dataDate +
|
||||||
|
", vThd=" + vThd +
|
||||||
|
"}";
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user