添加电压含有率
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
package com.njcn.dataProcess.api;
|
||||
|
||||
import com.njcn.common.pojo.constant.ServerInfo;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.dataProcess.api.fallback.DataVCvtFeignClientFallbackFactory;
|
||||
import com.njcn.dataProcess.api.fallback.DataVFeignClientFallbackFactory;
|
||||
import com.njcn.dataProcess.dto.DataVDTO;
|
||||
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
||||
import com.njcn.dataProcess.po.influx.DataVCvt;
|
||||
import com.njcn.dataProcess.pojo.dto.CommonMinuteDto;
|
||||
import com.njcn.dataProcess.pojo.dto.DataVDto;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@FeignClient(value = ServerInfo.PLATFORM_DATA_PROCESSING_BOOT, path = "/dataVCvt", fallbackFactory = DataVCvtFeignClientFallbackFactory.class, contextId = "dataVCvt")
|
||||
public interface DataVCvtFeignClient {
|
||||
|
||||
|
||||
//获取原始数据
|
||||
@PostMapping("/getRawData")
|
||||
HttpResult<List<DataVCvt>> getRawData(@RequestBody LineCountEvaluateParam lineParam);
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -5,9 +5,10 @@ import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.dataProcess.api.fallback.DataVFeignClientFallbackFactory;
|
||||
import com.njcn.dataProcess.dto.DataVDTO;
|
||||
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
||||
import com.njcn.dataProcess.po.influx.DataV;
|
||||
import com.njcn.dataProcess.pojo.dto.CommonMinuteDto;
|
||||
import com.njcn.dataProcess.pojo.dto.DataVCvtDTO;
|
||||
import com.njcn.dataProcess.pojo.dto.DataVDto;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
@@ -46,4 +47,7 @@ public interface DataVFeignClient {
|
||||
@PostMapping("/addInfluxDbList")
|
||||
HttpResult<String> addInfluxDbList(@RequestBody List<DataVDto> list);
|
||||
|
||||
@PostMapping("/batchInsertionCvtDTO")
|
||||
HttpResult<String> batchInsertionCvtDTO(@RequestBody List<DataVCvtDTO> cvtDTOList);
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
package com.njcn.dataProcess.api.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.dataProcess.api.DataVCvtFeignClient;
|
||||
import com.njcn.dataProcess.api.DataVFeignClient;
|
||||
import com.njcn.dataProcess.dto.DataVDTO;
|
||||
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
||||
import com.njcn.dataProcess.po.influx.DataVCvt;
|
||||
import com.njcn.dataProcess.pojo.dto.CommonMinuteDto;
|
||||
import com.njcn.dataProcess.pojo.dto.DataVDto;
|
||||
import com.njcn.dataProcess.util.DataProcessingEnumUtil;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author denghuajun
|
||||
* @version 1.0.0
|
||||
* @date 2022年01月05日 15:08
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class DataVCvtFeignClientFallbackFactory implements FallbackFactory<DataVCvtFeignClient> {
|
||||
|
||||
|
||||
/**
|
||||
* 输出远程请求接口异常日志
|
||||
* @param cause RPC请求异常
|
||||
*/
|
||||
@Override
|
||||
public DataVCvtFeignClient create(Throwable cause) {
|
||||
//判断抛出异常是否为解码器抛出的业务异常
|
||||
Enum<?> exceptionEnum = CommonResponseEnum.SERVICE_FALLBACK;
|
||||
if(cause.getCause() instanceof BusinessException){
|
||||
BusinessException businessException = (BusinessException) cause.getCause();
|
||||
exceptionEnum = DataProcessingEnumUtil.getExceptionEnum(businessException.getResult());
|
||||
}
|
||||
Enum<?> finalExceptionEnum = exceptionEnum;
|
||||
return new DataVCvtFeignClient() {
|
||||
|
||||
|
||||
@Override
|
||||
public HttpResult<List<DataVCvt>> getRawData(LineCountEvaluateParam lineParam) {
|
||||
log.error("{}异常,降级处理,异常为:{}","获取原始数据",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,7 @@ import com.njcn.dataProcess.dto.DataVDTO;
|
||||
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
||||
import com.njcn.dataProcess.po.influx.DataV;
|
||||
import com.njcn.dataProcess.pojo.dto.CommonMinuteDto;
|
||||
import com.njcn.dataProcess.pojo.dto.DataVCvtDTO;
|
||||
import com.njcn.dataProcess.pojo.dto.DataVDto;
|
||||
import com.njcn.dataProcess.util.DataProcessingEnumUtil;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
@@ -77,6 +78,12 @@ public class DataVFeignClientFallbackFactory implements FallbackFactory<DataVFei
|
||||
log.error("{}异常,降级处理,异常为:{}","时序数据库插入数据",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<String> batchInsertionCvtDTO(List<DataVCvtDTO> cvtDTOList) {
|
||||
log.error("{}异常,降级处理,异常为:{}","cvt数据插入DataV",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ public class DataFlicker {
|
||||
private Double pst=0.00;
|
||||
|
||||
@Column(name = "quality_flag",tag = true)
|
||||
private String qualityFlag;
|
||||
private String qualityFlag ="0";
|
||||
|
||||
|
||||
public static DataFlicker relationToInfluxDB(DataFlickerDTO dataFlicker) {
|
||||
|
||||
@@ -41,7 +41,7 @@ public class DataFluc {
|
||||
|
||||
|
||||
@Column(name = "quality_flag",tag = true)
|
||||
private String qualityFlag;
|
||||
private String qualityFlag="0";
|
||||
|
||||
public static DataFluc relationToInfluxDB(DataFlucDTO dataFluc) {
|
||||
if (dataFluc == null) {
|
||||
|
||||
@@ -38,7 +38,7 @@ public class DataHarmphasicI {
|
||||
private String phasicType;
|
||||
|
||||
@Column(name = "quality_flag",tag = true)
|
||||
private String qualityFlag;
|
||||
private String qualityFlag="0";
|
||||
|
||||
@Column(name = "value_type",tag = true)
|
||||
private String valueType;
|
||||
|
||||
@@ -39,7 +39,7 @@ public class DataHarmphasicV {
|
||||
private String phasicType;
|
||||
|
||||
@Column(name = "quality_flag",tag = true)
|
||||
private String qualityFlag;
|
||||
private String qualityFlag="0";
|
||||
|
||||
@Column(name = "value_type",tag = true)
|
||||
private String valueType;
|
||||
|
||||
@@ -39,7 +39,7 @@ public class DataHarmpowerP {
|
||||
private String phasicType;
|
||||
|
||||
@Column(name = "quality_flag",tag = true)
|
||||
private String qualityFlag;
|
||||
private String qualityFlag="0";
|
||||
|
||||
@Column(name = "value_type",tag = true)
|
||||
private String valueType;
|
||||
|
||||
@@ -39,7 +39,7 @@ public class DataHarmpowerQ {
|
||||
private String phasicType;
|
||||
|
||||
@Column(name = "quality_flag",tag = true)
|
||||
private String qualityFlag;
|
||||
private String qualityFlag="0";
|
||||
|
||||
@Column(name = "value_type",tag = true)
|
||||
private String valueType;
|
||||
|
||||
@@ -39,7 +39,7 @@ public class DataHarmpowerS {
|
||||
private String phasicType;
|
||||
|
||||
@Column(name = "quality_flag",tag = true)
|
||||
private String qualityFlag;
|
||||
private String qualityFlag="0";
|
||||
|
||||
@Column(name = "value_type",tag = true)
|
||||
private String valueType;
|
||||
|
||||
@@ -38,7 +38,7 @@ public class DataHarmrateI {
|
||||
private String phasicType;
|
||||
|
||||
@Column(name = "quality_flag",tag = true)
|
||||
private String qualityFlag;
|
||||
private String qualityFlag="0";
|
||||
|
||||
@Column(name = "value_type",tag = true)
|
||||
private String valueType;
|
||||
|
||||
@@ -38,7 +38,7 @@ public class DataHarmrateV {
|
||||
private String phasicType;
|
||||
|
||||
@Column(name = "quality_flag",tag = true)
|
||||
private String qualityFlag;
|
||||
private String qualityFlag="0";
|
||||
|
||||
@Column(name = "value_type",tag = true)
|
||||
private String valueType;
|
||||
|
||||
@@ -39,7 +39,7 @@ public class DataI {
|
||||
private String phasicType;
|
||||
|
||||
@Column(name = "quality_flag",tag = true)
|
||||
private String qualityFlag;
|
||||
private String qualityFlag="0";
|
||||
|
||||
@Column(name = "value_type",tag = true)
|
||||
private String valueType;
|
||||
|
||||
@@ -39,7 +39,7 @@ public class DataInharmI {
|
||||
private String phasicType;
|
||||
|
||||
@Column(name = "quality_flag",tag = true)
|
||||
private String qualityFlag;
|
||||
private String qualityFlag="0";
|
||||
|
||||
@Column(name = "value_type",tag = true)
|
||||
private String valueType;
|
||||
|
||||
@@ -39,7 +39,7 @@ public class DataInharmV {
|
||||
private String phasicType;
|
||||
|
||||
@Column(name = "quality_flag",tag = true)
|
||||
private String qualityFlag;
|
||||
private String qualityFlag="0";
|
||||
|
||||
@Column(name = "value_type",tag = true)
|
||||
private String valueType;
|
||||
|
||||
@@ -35,7 +35,7 @@ public class DataPlt {
|
||||
private String phasicType;
|
||||
|
||||
@Column(name = "quality_flag",tag = true)
|
||||
private String qualityFlag;
|
||||
private String qualityFlag="0";
|
||||
|
||||
@Column(name = "plt")
|
||||
private Double plt;
|
||||
|
||||
@@ -43,7 +43,7 @@ public class DataV {
|
||||
private String valueType;
|
||||
|
||||
@Column(name = "quality_flag", tag = true)
|
||||
private String qualityFlag;
|
||||
private String qualityFlag="0";
|
||||
|
||||
//是否是异常指标数据,0否1是
|
||||
@Column(name = "abnormal_flag")
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.njcn.dataProcess.po.influx;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.njcn.dataProcess.dto.DataVDTO;
|
||||
import com.njcn.influx.utils.InstantDateSerializer;
|
||||
import lombok.Data;
|
||||
import org.influxdb.annotation.Column;
|
||||
import org.influxdb.annotation.Measurement;
|
||||
import org.influxdb.annotation.TimeColumn;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.time.ZoneId;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
* 类的介绍:
|
||||
*
|
||||
* @author xuyang
|
||||
* @version 1.0.0
|
||||
* @createTime 2022/4/7 10:00
|
||||
*/
|
||||
@Data
|
||||
@Measurement(name = "data_v_cvt")
|
||||
public class DataVCvt extends DataV{
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,159 @@
|
||||
package com.njcn.dataProcess.pojo.dto;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.njcn.influx.utils.InstantDateSerializer;
|
||||
import lombok.Data;
|
||||
import org.influxdb.annotation.Column;
|
||||
import org.influxdb.annotation.TimeColumn;
|
||||
|
||||
import java.time.Instant;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Date: 2025/02/27 上午 8:53【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Data
|
||||
public class DataVCvtDTO {
|
||||
|
||||
private Instant time;
|
||||
|
||||
|
||||
private String lineId;
|
||||
|
||||
|
||||
private String phasicType;
|
||||
|
||||
|
||||
private String valueType;
|
||||
|
||||
|
||||
private String qualityFlag="0";
|
||||
|
||||
//是否是异常指标数据,0否1是
|
||||
private Integer abnormalFlag;
|
||||
|
||||
private Double freq;
|
||||
|
||||
private Double freqDev;
|
||||
|
||||
private Double rms;
|
||||
|
||||
private Double rmsLvr;
|
||||
|
||||
private Double vlDev;
|
||||
|
||||
private Double vuDev;
|
||||
|
||||
private Double vNeg;
|
||||
|
||||
private Double vPos;
|
||||
|
||||
private Double vThd;
|
||||
|
||||
private Double vUnbalance;
|
||||
|
||||
private Double vZero;
|
||||
|
||||
private Double v1;
|
||||
|
||||
private Double v2;
|
||||
|
||||
private Double v3;
|
||||
|
||||
private Double v4;
|
||||
|
||||
private Double v5;
|
||||
|
||||
private Double v6;
|
||||
|
||||
private Double v7;
|
||||
|
||||
private Double v8;
|
||||
|
||||
private Double v9;
|
||||
|
||||
private Double v10;
|
||||
|
||||
private Double v11;
|
||||
|
||||
private Double v12;
|
||||
|
||||
private Double v13;
|
||||
|
||||
private Double v14;
|
||||
|
||||
private Double v15;
|
||||
|
||||
private Double v16;
|
||||
|
||||
private Double v17;
|
||||
|
||||
private Double v18;
|
||||
|
||||
private Double v19;
|
||||
|
||||
private Double v20;
|
||||
|
||||
private Double v21;
|
||||
|
||||
private Double v22;
|
||||
|
||||
private Double v23;
|
||||
|
||||
private Double v24;
|
||||
|
||||
private Double v25;
|
||||
|
||||
private Double v26;
|
||||
|
||||
private Double v27;
|
||||
|
||||
private Double v28;
|
||||
|
||||
private Double v29;
|
||||
|
||||
private Double v30;
|
||||
|
||||
private Double v31;
|
||||
|
||||
private Double v32;
|
||||
|
||||
private Double v33;
|
||||
|
||||
private Double v34;
|
||||
|
||||
private Double v35;
|
||||
|
||||
private Double v36;
|
||||
|
||||
private Double v37;
|
||||
|
||||
private Double v38;
|
||||
|
||||
private Double v39;
|
||||
|
||||
private Double v40;
|
||||
|
||||
private Double v41;
|
||||
|
||||
private Double v42;
|
||||
|
||||
private Double v43;
|
||||
|
||||
private Double v44;
|
||||
|
||||
private Double v45;
|
||||
|
||||
private Double v46;
|
||||
|
||||
private Double v47;
|
||||
|
||||
private Double v48;
|
||||
|
||||
private Double v49;
|
||||
|
||||
private Double v50;
|
||||
}
|
||||
Reference in New Issue
Block a user