调整部分prepare项目关于influx查询的代码

This commit is contained in:
2023-09-25 10:48:35 +08:00
parent cb979a153b
commit 5f6605a91f
105 changed files with 3250 additions and 5197 deletions

View File

@@ -5,6 +5,7 @@ import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.DependsOn;
/**
* @author hongawen
@@ -13,6 +14,7 @@ import org.springframework.cloud.openfeign.EnableFeignClients;
*/
@Slf4j
@MapperScan("com.njcn.**.mapper")
@DependsOn("proxyMapperRegister")
@EnableFeignClients(basePackages = "com.njcn")
@SpringBootApplication(scanBasePackages = "com.njcn")
public class PrepareApplication {

View File

@@ -0,0 +1,79 @@
package com.njcn.prepare.harmonic.bo;
import com.njcn.db.bo.BaseEntity;
import com.njcn.influx.pojo.po.PqsCommunicate;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
import java.util.List;
@Data
@EqualsAndHashCode(callSuper = true)
public class TopMsgPO extends BaseEntity {
/**
* 日期
*/
private Date time;
/**
* 装置id
*/
private String devId;
/**
* 装置等级 : 0-极重要 1-重要 2-普通 3-不重要
*/
private Integer deviceLevel;
private Integer offtimeFlag;
/**
* 通信中断次数
*/
private Integer comOutCount;
/**
* 通信中断时间段描述
*/
private String comOutDescription;
/**
* 数据完整性标识 0.不达标 1.达标
*/
private Integer integrityFlag;
/**
* 数据完成性百分比
*/
private Float integrityValue;
private Integer alarmCountFlag;
/**
* 告警次数
*/
private Integer alarmCount;
/**
* 告警描述
*/
private String alarmDesc;
/**
* 流量超标标识 0.不达标 1.达标
*/
private Integer flowFlag;
/**
* 流量使用百分比
*/
private float flowValue;
private Integer onlineRateFlag;
private float onlineRateValue;
private List<PqsCommunicate> communicates;
/**
* 状态 0.删除 1.正常
*/
private String state;
}

View File

@@ -1,7 +1,7 @@
package com.njcn.prepare.harmonic.constant;
import com.njcn.harmonic.pojo.po.*;
import com.njcn.prepare.harmonic.pojo.influxdb.po.*;
import com.njcn.influx.pojo.po.*;
import com.njcn.prepare.harmonic.pojo.mysql.po.line.RMpFlickerReportDPO;
import com.njcn.prepare.harmonic.pojo.mysql.po.line.RMpInharmonicIMagReportDPO;
import org.mapstruct.Mapper;
@@ -23,7 +23,7 @@ public interface InfluxdbPOConverter {
InfluxdbPOConverter INFLUXDB_PO_CONVERTER = Mappers.getMapper (InfluxdbPOConverter.class);
/*DataHarmRateVPO*/
/*DataHarmRateV*/
@Mapping(source = "v1", target = "fundamentalVoltageMax" ,numberFormat = "#.000")
@Mapping(source = "v2", target = "harmonicVoltageContent2Max" ,numberFormat = "#.000")
@Mapping(source = "v3", target = "harmonicVoltageContent3Max" ,numberFormat = "#.000")
@@ -75,7 +75,7 @@ public interface InfluxdbPOConverter {
@Mapping(source = "v49", target = "harmonicVoltageContent49Max" ,numberFormat = "#.000")
@Mapping(source = "v50", target = "harmonicVoltageContent50Max" ,numberFormat = "#.000")
public RMpHarmonicVRateReportD dataVPOTORMpHarmonicPReportDPOMax(DataHarmRateVPO dataVPO);
public RMpHarmonicVRateReportD dataVPOTORMpHarmonicPReportDPOMax(DataHarmRateV dataVPO);
@Mapping(source = "v1", target = "fundamentalVoltageMin",numberFormat = "#.000")
@Mapping(source = "v2", target = "harmonicVoltageContent2Min",numberFormat = "#.000")
@@ -127,7 +127,7 @@ public interface InfluxdbPOConverter {
@Mapping(source = "v48", target = "harmonicVoltageContent48Min",numberFormat = "#.000")
@Mapping(source = "v49", target = "harmonicVoltageContent49Min",numberFormat = "#.000")
@Mapping(source = "v50", target = "harmonicVoltageContent50Min",numberFormat = "#.000")
public RMpHarmonicVRateReportD dataVPOTORMpHarmonicPReportDPOMin(DataHarmRateVPO dataVPO);
public RMpHarmonicVRateReportD dataVPOTORMpHarmonicPReportDPOMin(DataHarmRateV dataVPO);
@Mapping(source = "v1", target = "fundamentalVoltageAvg",numberFormat = "#.000")
@@ -180,7 +180,7 @@ public interface InfluxdbPOConverter {
@Mapping(source = "v48", target = "harmonicVoltageContent48Avg",numberFormat = "#.000")
@Mapping(source = "v49", target = "harmonicVoltageContent49Avg",numberFormat = "#.000")
@Mapping(source = "v50", target = "harmonicVoltageContent50Avg",numberFormat = "#.000")
public RMpHarmonicVRateReportD dataVPOTORMpHarmonicPReportDPOAvg(DataHarmRateVPO dataVPO);
public RMpHarmonicVRateReportD dataVPOTORMpHarmonicPReportDPOAvg(DataHarmRateV dataVPO);
@Mapping(source = "v1", target = "fundamentalVoltage95",numberFormat = "#.000")
@@ -233,10 +233,10 @@ public interface InfluxdbPOConverter {
@Mapping(source = "v48", target = "harmonicVoltageContent4895",numberFormat = "#.000")
@Mapping(source = "v49", target = "harmonicVoltageContent4995",numberFormat = "#.000")
@Mapping(source = "v50", target = "harmonicVoltageContent5095",numberFormat = "#.000")
public RMpHarmonicVRateReportD dataVPOTORMpHarmonicPReportDPO95(DataHarmRateVPO dataVPO);
public RMpHarmonicVRateReportD dataVPOTORMpHarmonicPReportDPO95(DataHarmRateV dataVPO);
/*DataIPO*/
/*DataI*/
@Mapping(source = "IThd", target = "harmonicCurrentThdMax")
@Mapping(source = "i1", target = "fundamentalCurrentMax")
@Mapping(source = "i2", target = "harmonicCurrentEffective2Max")
@@ -288,7 +288,7 @@ public interface InfluxdbPOConverter {
@Mapping(source = "i48", target = "harmonicCurrentEffective48Max")
@Mapping(source = "i49", target = "harmonicCurrentEffective49Max")
@Mapping(source = "i50", target = "harmonicCurrentEffective50Max")
public RMpHarmonicIMagReportD dataIPOTORMpHarmonicIMagReportDPOMax(DataIPO dataIPO);
public RMpHarmonicIMagReportD dataIPOTORMpHarmonicIMagReportDPOMax(DataI dataIPO);
@Mapping(source = "IThd", target = "harmonicCurrentThdMin")
@Mapping(source = "i1", target = "fundamentalCurrentMin")
@@ -341,7 +341,7 @@ public interface InfluxdbPOConverter {
@Mapping(source = "i48", target = "harmonicCurrentEffective48Min")
@Mapping(source = "i49", target = "harmonicCurrentEffective49Min")
@Mapping(source = "i50", target = "harmonicCurrentEffective50Min")
public RMpHarmonicIMagReportD dataIPOTORMpHarmonicIMagReportDPOMin(DataIPO dataIPO);
public RMpHarmonicIMagReportD dataIPOTORMpHarmonicIMagReportDPOMin(DataI dataIPO);
@Mapping(source = "IThd", target = "harmonicCurrentThdAvg")
@@ -395,7 +395,7 @@ public interface InfluxdbPOConverter {
@Mapping(source = "i48", target = "harmonicCurrentEffective48Avg")
@Mapping(source = "i49", target = "harmonicCurrentEffective49Avg")
@Mapping(source = "i50", target = "harmonicCurrentEffective50Avg")
public RMpHarmonicIMagReportD dataIPOTORMpHarmonicIMagReportDPOAvg(DataIPO dataIPO);
public RMpHarmonicIMagReportD dataIPOTORMpHarmonicIMagReportDPOAvg(DataI dataIPO);
@Mapping(source = "IThd", target = "harmonicCurrentThd95")
@@ -449,25 +449,25 @@ public interface InfluxdbPOConverter {
@Mapping(source = "i48", target = "harmonicCurrentEffective4895")
@Mapping(source = "i49", target = "harmonicCurrentEffective4995")
@Mapping(source = "i50", target = "harmonicCurrentEffective5095")
public RMpHarmonicIMagReportD dataIPOTORMpHarmonicIMagReportDPO95(DataIPO dataIPO);
public RMpHarmonicIMagReportD dataIPOTORMpHarmonicIMagReportDPO95(DataI dataIPO);
/*RMpFlickerReportDPO*/
@Mapping(source = "fluc", target = "voltageFluctuationMax")
@Mapping(source = "plt", target = "shortTermSeverityMax")
public RMpFlickerReportDPO rMpFlickerReportDPOConverterMax(DataFlickerPO dataFlickerPO);
public RMpFlickerReportDPO rMpFlickerReportDPOConverterMax(DataFlicker dataFlickerPO);
@Mapping(source = "fluc", target = "voltageFluctuationMin")
@Mapping(source = "plt", target = "shortTermSeverityMin")
public RMpFlickerReportDPO rMpFlickerReportDPOConverterMin(DataFlickerPO dataFlickerPO);
public RMpFlickerReportDPO rMpFlickerReportDPOConverterMin(DataFlicker dataFlickerPO);
@Mapping(source = "fluc", target = "voltageFluctuationAvg")
@Mapping(source = "plt", target = "shortTermSeverityAvg")
public RMpFlickerReportDPO rMpFlickerReportDPOConverterAvg(DataFlickerPO dataFlickerPO);
public RMpFlickerReportDPO rMpFlickerReportDPOConverterAvg(DataFlicker dataFlickerPO);
@Mapping(source = "fluc", target = "voltageFluctuation95")
@Mapping(source = "plt", target = "shortTermSeverity95")
public RMpFlickerReportDPO rMpFlickerReportDPOConverter95(DataFlickerPO dataFlickerPO);
public RMpFlickerReportDPO rMpFlickerReportDPOConverter95(DataFlicker dataFlickerPO);
/*RMpHarmonicIRateReportDPO*/
@Mapping(source = "i2", target = "i2Min")
@@ -519,7 +519,7 @@ public interface InfluxdbPOConverter {
@Mapping(source = "i48", target = "i48Min")
@Mapping(source = "i49", target = "i49Min")
@Mapping(source = "i50", target = "i50Min")
public RMpHarmonicIRateReportD RMpHarmonicIRateReportDPOConverterMin(DataHarmRateIPO dataHarmRateIPO);
public RMpHarmonicIRateReportD RMpHarmonicIRateReportDPOConverterMin(DataHarmRateI dataHarmRateIPO);
@Mapping(source = "i2", target = "i2Max")
@Mapping(source = "i3", target = "i3Max")
@@ -570,7 +570,7 @@ public interface InfluxdbPOConverter {
@Mapping(source = "i48", target = "i48Max")
@Mapping(source = "i49", target = "i49Max")
@Mapping(source = "i50", target = "i50Max")
public RMpHarmonicIRateReportD RMpHarmonicIRateReportDPOConverterMax(DataHarmRateIPO dataHarmRateIPO);
public RMpHarmonicIRateReportD RMpHarmonicIRateReportDPOConverterMax(DataHarmRateI dataHarmRateIPO);
@Mapping(source = "i2", target = "i2Avg")
@@ -622,7 +622,7 @@ public interface InfluxdbPOConverter {
@Mapping(source = "i48", target = "i48Avg")
@Mapping(source = "i49", target = "i49Avg")
@Mapping(source = "i50", target = "i50Avg")
public RMpHarmonicIRateReportD RMpHarmonicIRateReportDPOConverterAvg(DataHarmRateIPO dataHarmRateIPO);
public RMpHarmonicIRateReportD RMpHarmonicIRateReportDPOConverterAvg(DataHarmRateI dataHarmRateIPO);
@Mapping(source = "i2", target = "i2Cp95")
@Mapping(source = "i3", target = "i3Cp95")
@@ -673,7 +673,7 @@ public interface InfluxdbPOConverter {
@Mapping(source = "i48", target = "i48Cp95")
@Mapping(source = "i49", target = "i49Cp95")
@Mapping(source = "i50", target = "i50Cp95")
public RMpHarmonicIRateReportD RMpHarmonicIRateReportDPOConverter95(DataHarmRateIPO dataHarmRateIPO);
public RMpHarmonicIRateReportD RMpHarmonicIRateReportDPOConverter95(DataHarmRateI dataHarmRateIPO);
/*RMpInharmonicIRateReportDPO*/
@Mapping(source = "i2", target = "inharmI2Min")
@Mapping(source = "i3", target = "inharmI3Min")
@@ -724,7 +724,7 @@ public interface InfluxdbPOConverter {
@Mapping(source = "i48", target = "inharmI48Min")
@Mapping(source = "i49", target = "inharmI49Min")
@Mapping(source = "i50", target = "inharmI50Min")
public RMpInharmonicIRateReportD RMpInharmonicIRateReportDPOConverterMin(DataInHarmRateIPO temp);
public RMpInharmonicIRateReportD RMpInharmonicIRateReportDPOConverterMin(DataInHarmRateI temp);
@Mapping(source = "i2", target = "inharmI2Max")
@Mapping(source = "i3", target = "inharmI3Max")
@@ -775,7 +775,7 @@ public interface InfluxdbPOConverter {
@Mapping(source = "i48", target = "inharmI48Max")
@Mapping(source = "i49", target = "inharmI49Max")
@Mapping(source = "i50", target = "inharmI50Max")
public RMpInharmonicIRateReportD RMpInharmonicIRateReportDPOConverterMax(DataInHarmRateIPO temp);
public RMpInharmonicIRateReportD RMpInharmonicIRateReportDPOConverterMax(DataInHarmRateI temp);
@Mapping(source = "i2", target = "inharmI2Avg")
@@ -827,7 +827,7 @@ public interface InfluxdbPOConverter {
@Mapping(source = "i48", target = "inharmI48Avg")
@Mapping(source = "i49", target = "inharmI49Avg")
@Mapping(source = "i50", target = "inharmI50Avg")
public RMpInharmonicIRateReportD RMpInharmonicIRateReportDPOConverterAvg(DataInHarmRateIPO temp);
public RMpInharmonicIRateReportD RMpInharmonicIRateReportDPOConverterAvg(DataInHarmRateI temp);
@Mapping(source = "i2", target = "inharmI2Cp95")
@Mapping(source = "i3", target = "inharmI3Cp95")
@@ -878,7 +878,7 @@ public interface InfluxdbPOConverter {
@Mapping(source = "i48", target = "inharmI48Cp95")
@Mapping(source = "i49", target = "inharmI49Cp95")
@Mapping(source = "i50", target = "inharmI50Cp95")
public RMpInharmonicIRateReportD RMpInharmonicIRateReportDPOConverter95(DataInHarmRateIPO temp);
public RMpInharmonicIRateReportD RMpInharmonicIRateReportDPOConverter95(DataInHarmRateI temp);
/*RMpInharmonicIMagReportDPO*/
@Mapping(source = "i1", target = "simpleHarmonicCurrentEffective1Min")
@@ -931,7 +931,7 @@ public interface InfluxdbPOConverter {
@Mapping(source = "i48", target = "simpleHarmonicCurrentEffective48Min")
@Mapping(source = "i49", target = "simpleHarmonicCurrentEffective49Min")
@Mapping(source = "i50", target = "simpleHarmonicCurrentEffective50Min")
public RMpInharmonicIMagReportDPO RMpInharmonicIMagReportDPOConverterMin(DataInHarmIPO temp);
public RMpInharmonicIMagReportDPO RMpInharmonicIMagReportDPOConverterMin(DataInHarmI temp);
@Mapping(source = "i1", target = "simpleHarmonicCurrentEffective1Max")
@Mapping(source = "i2", target = "simpleHarmonicCurrentEffective2Max")
@@ -983,7 +983,7 @@ public interface InfluxdbPOConverter {
@Mapping(source = "i48", target = "simpleHarmonicCurrentEffective48Max")
@Mapping(source = "i49", target = "simpleHarmonicCurrentEffective49Max")
@Mapping(source = "i50", target = "simpleHarmonicCurrentEffective50Max")
public RMpInharmonicIMagReportDPO RMpInharmonicIMagReportDPOConverterMax(DataInHarmIPO temp);
public RMpInharmonicIMagReportDPO RMpInharmonicIMagReportDPOConverterMax(DataInHarmI temp);
@Mapping(source = "i1", target = "simpleHarmonicCurrentEffective1Avg")
@Mapping(source = "i2", target = "simpleHarmonicCurrentEffective2Avg")
@@ -1035,7 +1035,7 @@ public interface InfluxdbPOConverter {
@Mapping(source = "i48", target = "simpleHarmonicCurrentEffective48Avg")
@Mapping(source = "i49", target = "simpleHarmonicCurrentEffective49Avg")
@Mapping(source = "i50", target = "simpleHarmonicCurrentEffective50Avg")
public RMpInharmonicIMagReportDPO RMpInharmonicIMagReportDPOConverterAvg(DataInHarmIPO temp);
public RMpInharmonicIMagReportDPO RMpInharmonicIMagReportDPOConverterAvg(DataInHarmI temp);
@Mapping(source = "i1", target = "simpleHarmonicCurrentEffective1Cp95")
@Mapping(source = "i2", target = "simpleHarmonicCurrentEffective2Cp95")
@@ -1087,7 +1087,7 @@ public interface InfluxdbPOConverter {
@Mapping(source = "i48", target = "simpleHarmonicCurrentEffective48Cp95")
@Mapping(source = "i49", target = "simpleHarmonicCurrentEffective49Cp95")
@Mapping(source = "i50", target = "simpleHarmonicCurrentEffective50Cp95")
public RMpInharmonicIMagReportDPO RMpInharmonicIMagReportDPOConverter95(DataInHarmIPO temp);
public RMpInharmonicIMagReportDPO RMpInharmonicIMagReportDPOConverter95(DataInHarmI temp);
/*RMpInharmonicVRateReportDPO*/
@Mapping(source = "v1", target = "centreHarmonicVoltageContent1Min")
@Mapping(source = "v2", target = "centreHarmonicVoltageContent2Min")
@@ -1139,7 +1139,7 @@ public interface InfluxdbPOConverter {
@Mapping(source = "v48", target = "centreHarmonicVoltageContent48Min")
@Mapping(source = "v49", target = "centreHarmonicVoltageContent49Min")
@Mapping(source = "v50", target = "centreHarmonicVoltageContent50Min")
public RMpInharmonicVRateReportD RMpInharmonicVRateReportDPOConverterMin(DataInHarmRateVPO temp);
public RMpInharmonicVRateReportD RMpInharmonicVRateReportDPOConverterMin(DataInHarmRateV temp);
@Mapping(source = "v1", target = "centreHarmonicVoltageContent1Max")
@Mapping(source = "v2", target = "centreHarmonicVoltageContent2Max")
@@ -1191,7 +1191,7 @@ public interface InfluxdbPOConverter {
@Mapping(source = "v48", target = "centreHarmonicVoltageContent48Max")
@Mapping(source = "v49", target = "centreHarmonicVoltageContent49Max")
@Mapping(source = "v50", target = "centreHarmonicVoltageContent50Max")
public RMpInharmonicVRateReportD RMpInharmonicVRateReportDPOConverterMax(DataInHarmRateVPO temp);
public RMpInharmonicVRateReportD RMpInharmonicVRateReportDPOConverterMax(DataInHarmRateV temp);
@Mapping(source = "v1", target = "centreHarmonicVoltageContent1Avg")
@Mapping(source = "v2", target = "centreHarmonicVoltageContent2Avg")
@@ -1243,7 +1243,7 @@ public interface InfluxdbPOConverter {
@Mapping(source = "v48", target = "centreHarmonicVoltageContent48Avg")
@Mapping(source = "v49", target = "centreHarmonicVoltageContent49Avg")
@Mapping(source = "v50", target = "centreHarmonicVoltageContent50Avg")
public RMpInharmonicVRateReportD RMpInharmonicVRateReportDPOConverterAvg(DataInHarmRateVPO temp);
public RMpInharmonicVRateReportD RMpInharmonicVRateReportDPOConverterAvg(DataInHarmRateV temp);
@Mapping(source = "v1", target = "centreHarmonicVoltageContent1Cp95")
@Mapping(source = "v2", target = "centreHarmonicVoltageContent2Cp95")
@@ -1295,7 +1295,7 @@ public interface InfluxdbPOConverter {
@Mapping(source = "v48", target = "centreHarmonicVoltageContent48Cp95")
@Mapping(source = "v49", target = "centreHarmonicVoltageContent49Cp95")
@Mapping(source = "v50", target = "centreHarmonicVoltageContent50Cp95")
public RMpInharmonicVRateReportD RMpInharmonicVRateReportDPOConverter95(DataInHarmRateVPO temp);
public RMpInharmonicVRateReportD RMpInharmonicVRateReportDPOConverter95(DataInHarmRateV temp);
/*RMpInharmonicVRateReportDPO*/
@Mapping(source = "p1", target = "centreHarmonicVoltageContent1Min")
@@ -1348,7 +1348,7 @@ public interface InfluxdbPOConverter {
@Mapping(source = "p48", target = "centreHarmonicVoltageContent48Min")
@Mapping(source = "p49", target = "centreHarmonicVoltageContent49Min")
@Mapping(source = "p50", target = "centreHarmonicVoltageContent50Min")
public RMpInharmonicVRateReportD RMpHarmonicPReportDPOConverterMin(DataHarmPowerPPO temp);
public RMpInharmonicVRateReportD RMpHarmonicPReportDPOConverterMin(DataHarmPowerP temp);
@Mapping(source = "p1", target = "centreHarmonicVoltageContent1Max")
@Mapping(source = "p2", target = "centreHarmonicVoltageContent2Max")
@@ -1400,7 +1400,7 @@ public interface InfluxdbPOConverter {
@Mapping(source = "p48", target = "centreHarmonicVoltageContent48Max")
@Mapping(source = "p49", target = "centreHarmonicVoltageContent49Max")
@Mapping(source = "p50", target = "centreHarmonicVoltageContent50Max")
public RMpInharmonicVRateReportD RMpHarmonicPReportDPOConverterMax(DataHarmPowerPPO temp);
public RMpInharmonicVRateReportD RMpHarmonicPReportDPOConverterMax(DataHarmPowerP temp);
@Mapping(source = "p1", target = "centreHarmonicVoltageContent1Avg")
@Mapping(source = "p2", target = "centreHarmonicVoltageContent2Avg")
@@ -1452,7 +1452,7 @@ public interface InfluxdbPOConverter {
@Mapping(source = "p48", target = "centreHarmonicVoltageContent48Avg")
@Mapping(source = "p49", target = "centreHarmonicVoltageContent49Avg")
@Mapping(source = "p50", target = "centreHarmonicVoltageContent50Avg")
public RMpInharmonicVRateReportD RMpHarmonicPReportDPOConverterAvg(DataHarmPowerPPO temp);
public RMpInharmonicVRateReportD RMpHarmonicPReportDPOConverterAvg(DataHarmPowerP temp);
@Mapping(source = "p1", target = "centreHarmonicVoltageContent1Cp95")
@@ -1505,7 +1505,7 @@ public interface InfluxdbPOConverter {
@Mapping(source = "p48", target = "centreHarmonicVoltageContent48Cp95")
@Mapping(source = "p49", target = "centreHarmonicVoltageContent49Cp95")
@Mapping(source = "p50", target = "centreHarmonicVoltageContent50Cp95")
public RMpInharmonicVRateReportD RMpHarmonicPReportDPOConverter95(DataHarmPowerPPO temp);
public RMpInharmonicVRateReportD RMpHarmonicPReportDPOConverter95(DataHarmPowerP temp);
/*RMpMeasurePhaseReportDPO*/
@Mapping(source = "max.rms", target = "phaseVoltageEffectiveMax")
@@ -1518,7 +1518,7 @@ public interface InfluxdbPOConverter {
@Mapping(source = "max3.s", target = "spApparentPowerMax")
@Mapping(source = "max2.pf", target = "spPowerFactorMax")
@Mapping(source = "max2.df", target = "spFundamentalPowerFactorMax")
public RMpMeasurePhaseReportD RMpMeasurePhaseReportDPOConverterMax(DataVPO max, DataIPO max1, DataHarmPowerPPO max2, DataHarmPowerSPO max3, DataHarmPowerQPO max4);
public RMpMeasurePhaseReportD RMpMeasurePhaseReportDPOConverterMax(DataV max, DataI max1, DataHarmPowerP max2, DataHarmPowerS max3, DataHarmPowerQ max4);
@Mapping(source = "min.rms", target = "phaseVoltageEffectiveMin")
@Mapping(source = "min.rmsLvr", target = "lineVoltageEffectiveMin")
@@ -1530,7 +1530,7 @@ public interface InfluxdbPOConverter {
@Mapping(source = "min3.s", target = "spApparentPowerMin")
@Mapping(source = "min2.pf", target = "spPowerFactorMin")
@Mapping(source = "min2.df", target = "spFundamentalPowerFactorMin")
public RMpMeasurePhaseReportD RMpMeasurePhaseReportDPOConverterMin(DataVPO min, DataIPO min1, DataHarmPowerPPO min2, DataHarmPowerSPO min3, DataHarmPowerQPO min4);
public RMpMeasurePhaseReportD RMpMeasurePhaseReportDPOConverterMin(DataV min, DataI min1, DataHarmPowerP min2, DataHarmPowerS min3, DataHarmPowerQ min4);
@Mapping(source = "avg.rms", target = "phaseVoltageEffectiveAvg")
@@ -1543,7 +1543,7 @@ public interface InfluxdbPOConverter {
@Mapping(source = "avg3.s", target = "spApparentPowerAvg")
@Mapping(source = "avg2.pf", target = "spPowerFactorAvg")
@Mapping(source = "avg2.df", target = "spFundamentalPowerFactorAvg")
public RMpMeasurePhaseReportD RMpMeasurePhaseReportDPOConverterAVg(DataVPO avg, DataIPO avg1, DataHarmPowerPPO avg2, DataHarmPowerSPO avg3, DataHarmPowerQPO avg4);
public RMpMeasurePhaseReportD RMpMeasurePhaseReportDPOConverterAVg(DataV avg, DataI avg1, DataHarmPowerP avg2, DataHarmPowerS avg3, DataHarmPowerQ avg4);
@Mapping(source = "cp95.rms", target = "phaseVoltageEffective95")
@@ -1556,7 +1556,7 @@ public interface InfluxdbPOConverter {
@Mapping(source = "cp953.s", target = "spApparentPower95")
@Mapping(source = "cp952.pf", target = "spPowerFactor95")
@Mapping(source = "cp952.df", target = "spFundamentalPowerFactor95")
public RMpMeasurePhaseReportD RMpMeasurePhaseReportDPOConverterCp95(DataVPO cp95, DataIPO cp951, DataHarmPowerPPO cp952, DataHarmPowerSPO cp953, DataHarmPowerQPO cp954);
public RMpMeasurePhaseReportD RMpMeasurePhaseReportDPOConverterCp95(DataV cp95, DataI cp951, DataHarmPowerP cp952, DataHarmPowerS cp953, DataHarmPowerQ cp954);
/*RMpMeasureReportDPO*/
@@ -1575,7 +1575,7 @@ public interface InfluxdbPOConverter {
@Mapping(source = "max2.df", target = "fundamentalPowerFactorMax")
@Mapping(source = "max4.q", target = "totalReactivePowerMax")
@Mapping(source = "max3.s", target = "totalApparentPowerMax")
public RMpMeasureReportD RMpMeasureReportDPOConverterMax(DataVPO max, DataIPO max1, DataHarmPowerPPO max2, DataHarmPowerSPO max3, DataHarmPowerQPO max4);
public RMpMeasureReportD RMpMeasureReportDPOConverterMax(DataV max, DataI max1, DataHarmPowerP max2, DataHarmPowerS max3, DataHarmPowerQ max4);
@Mapping(source = "min.freq", target = "frequencyMin")
@Mapping(source = "min.freqDev", target = "frequencyDeviationMin")
@@ -1592,7 +1592,7 @@ public interface InfluxdbPOConverter {
@Mapping(source = "min2.df", target = "fundamentalPowerFactorMin")
@Mapping(source = "min4.q", target = "totalReactivePowerMin")
@Mapping(source = "min3.s", target = "totalApparentPowerMin")
public RMpMeasureReportD RMpMeasureReportDPOConverterMin(DataVPO min, DataIPO min1, DataHarmPowerPPO min2, DataHarmPowerSPO min3, DataHarmPowerQPO min4);
public RMpMeasureReportD RMpMeasureReportDPOConverterMin(DataV min, DataI min1, DataHarmPowerP min2, DataHarmPowerS min3, DataHarmPowerQ min4);
@Mapping(source = "avg.freq", target = "frequencyAvg")
@Mapping(source = "avg.freqDev", target = "frequencyDeviationAvg")
@@ -1609,7 +1609,7 @@ public interface InfluxdbPOConverter {
@Mapping(source = "avg2.df", target = "fundamentalPowerFactorAvg")
@Mapping(source = "avg4.q", target = "totalReactivePowerAvg")
@Mapping(source = "avg3.s", target = "totalApparentPowerAvg")
public RMpMeasureReportD RMpMeasureReportDPOConverterAVg(DataVPO avg, DataIPO avg1, DataHarmPowerPPO avg2, DataHarmPowerSPO avg3, DataHarmPowerQPO avg4);
public RMpMeasureReportD RMpMeasureReportDPOConverterAVg(DataV avg, DataI avg1, DataHarmPowerP avg2, DataHarmPowerS avg3, DataHarmPowerQ avg4);
@Mapping(source = "cp95.freq", target = "frequency95")
@Mapping(source = "cp95.freqDev", target = "frequencyDeviation95")
@@ -1626,5 +1626,5 @@ public interface InfluxdbPOConverter {
@Mapping(source = "cp952.df", target = "fundamentalPowerFactor95")
@Mapping(source = "cp954.q", target = "totalReactivePower95")
@Mapping(source = "cp953.s", target = "totalApparentPower95")
public RMpMeasureReportD RMpMeasureReportDPOConverterCp95(DataVPO cp95, DataIPO cp951, DataHarmPowerPPO cp952, DataHarmPowerSPO cp953, DataHarmPowerQPO cp954);
public RMpMeasureReportD RMpMeasureReportDPOConverterCp95(DataV cp95, DataI cp951, DataHarmPowerP cp952, DataHarmPowerS cp953, DataHarmPowerQ cp954);
}

View File

@@ -3,7 +3,7 @@ package com.njcn.prepare.harmonic.mapper.mysql.device;
import cn.hutool.core.date.DateTime;
import com.njcn.prepare.harmonic.pojo.mysql.po.line.AlarmPO;
import com.njcn.prepare.harmonic.pojo.mysql.po.line.AlarmStrategyVO;
import com.njcn.prepare.harmonic.pojo.mysql.po.line.TopMsgPO;
import com.njcn.prepare.harmonic.bo.TopMsgPO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

View File

@@ -1,6 +1,6 @@
package com.njcn.prepare.harmonic.service.influxdb;
import com.njcn.device.pq.pojo.po.DataV;
import com.njcn.prepare.harmonic.pojo.po.DataFlicker;
import com.njcn.influx.pojo.po.DataFlicker;
import java.util.Date;

View File

@@ -2,10 +2,10 @@ package com.njcn.prepare.harmonic.service.influxdb.impl;
import cn.hutool.core.date.DateTime;
import com.njcn.device.pq.pojo.po.DataV;
import com.njcn.influxdb.param.InfluxDBPublicParam;
import com.njcn.influxdb.param.InfluxDBSqlConstant;
import com.njcn.influxdb.param.InfluxDBTableConstant;
import com.njcn.influxdb.utils.InfluxDbUtils;
import com.njcn.influx.deprecated.InfluxDBPublicParam;
import com.njcn.influx.deprecated.InfluxDBSqlConstant;
import com.njcn.influx.deprecated.InfluxDbUtils;
import com.njcn.influx.pojo.constant.InfluxDBTableConstant;
import com.njcn.prepare.harmonic.service.influxdb.DataExceptionInfluxService;
import com.njcn.prepare.harmonic.utils.PublicUtil;
import lombok.RequiredArgsConstructor;

View File

@@ -2,11 +2,11 @@ package com.njcn.prepare.harmonic.service.influxdb.impl;
import cn.hutool.core.date.DateTime;
import com.njcn.device.pq.pojo.po.DataV;
import com.njcn.influxdb.param.InfluxDBPublicParam;
import com.njcn.influxdb.param.InfluxDBSqlConstant;
import com.njcn.influxdb.param.InfluxDBTableConstant;
import com.njcn.influxdb.utils.InfluxDbUtils;
import com.njcn.prepare.harmonic.pojo.po.DataFlicker;
import com.njcn.influx.deprecated.InfluxDBPublicParam;
import com.njcn.influx.deprecated.InfluxDBSqlConstant;
import com.njcn.influx.deprecated.InfluxDbUtils;
import com.njcn.influx.pojo.constant.InfluxDBTableConstant;
import com.njcn.influx.pojo.po.DataFlicker;
import com.njcn.prepare.harmonic.service.influxdb.DataIntegrityRateInfluxService;
import com.njcn.prepare.harmonic.utils.PublicUtil;
import lombok.RequiredArgsConstructor;

View File

@@ -4,8 +4,8 @@ import cn.hutool.core.collection.CollUtil;
import com.google.common.base.Objects;
import com.njcn.common.utils.NjcnBeanUtil;
import com.njcn.device.pq.pojo.po.DataV;
import com.njcn.influxdb.param.InfluxDBPublicParam;
import com.njcn.influxdb.utils.InfluxDbUtils;
import com.njcn.influx.deprecated.InfluxDBPublicParam;
import com.njcn.influx.deprecated.InfluxDbUtils;
import com.njcn.prepare.harmonic.pojo.dto.DataVFiveItemDTO;
import com.njcn.prepare.harmonic.service.influxdb.DataVInfluxdbService;
import lombok.RequiredArgsConstructor;

View File

@@ -2,11 +2,11 @@ package com.njcn.prepare.harmonic.service.influxdb.impl;
import com.njcn.device.pms.api.MonitorClient;
import com.njcn.device.biz.pojo.po.Overlimit;
import com.njcn.influxdb.param.InfluxDBPublicParam;
import com.njcn.influxdb.utils.InfluxDbUtils;
import com.njcn.influx.deprecated.InfluxDBPublicParam;
import com.njcn.influx.deprecated.InfluxDbUtils;
import com.njcn.influx.pojo.po.DataI;
import com.njcn.influx.pojo.po.DataV;
import com.njcn.prepare.harmonic.pojo.dto.OverLimitFlagDTO;
import com.njcn.prepare.harmonic.pojo.influxdb.po.DataIPO;
import com.njcn.prepare.harmonic.pojo.influxdb.po.DataVPO;
import com.njcn.prepare.harmonic.pojo.param.LineParam;
import com.njcn.prepare.harmonic.service.influxdb.RStatWorkOrderCreateService;
import com.njcn.process.api.RStatWorkOrderFeignClient;
@@ -50,7 +50,7 @@ public class RStatWorkOrderCreateServiceImpl implements RStatWorkOrderCreateServ
lineIds.stream ().forEach (lineId->{
Overlimit overlimit = monitorClient.getOverLimitData(lineId).getData ();
List<DataVPO> dataV = getDataV(lineId,startTime,endTime);
List<DataV> dataV = getDataV(lineId,startTime,endTime);
List<OverLimitFlagDTO> checkResultV = checkOverLimitV(dataV,overlimit);
/*Datav3分钟一条数据连续4个小时越限说明OverLimitFlagDTO.overLimtFlag要连续80个是1才生成工单*/
List<OverLimitFlagDTO> workOrderV = checkOverLimitFlag (checkResultV);
@@ -61,7 +61,7 @@ public class RStatWorkOrderCreateServiceImpl implements RStatWorkOrderCreateServ
result.setOverLimtType (DicDataEnum.VOLTAGE_LIMIT.getCode ());
overLimitFlagDTOList.add (result);
}
List<DataIPO> dataI = getDataI(lineId,startTime,endTime);
List<DataI> dataI = getDataI(lineId,startTime,endTime);
List<OverLimitFlagDTO> checkResultI = checkOverLimitI(dataI,overlimit);
List<OverLimitFlagDTO> workOrderI= checkOverLimitFlag (checkResultI);
for (OverLimitFlagDTO overLimitFlagDTO : workOrderI) {
@@ -82,7 +82,7 @@ public class RStatWorkOrderCreateServiceImpl implements RStatWorkOrderCreateServ
* @Author: clam
* @Date: 2023/2/13
*/
private List<OverLimitFlagDTO> checkOverLimitI(List<DataIPO> dataI, Overlimit overlimit) {
private List<OverLimitFlagDTO> checkOverLimitI(List<DataI> dataI, Overlimit overlimit) {
List<OverLimitFlagDTO> result = new ArrayList<> ();
dataI.stream ().forEach (datai ->{
Integer temp = 0;
@@ -145,7 +145,7 @@ public class RStatWorkOrderCreateServiceImpl implements RStatWorkOrderCreateServ
* @Author: clam
* @Date: 2023/2/13
*/
private List<OverLimitFlagDTO> checkOverLimitV(List<DataVPO> dataV, Overlimit overlimit) {
private List<OverLimitFlagDTO> checkOverLimitV(List<DataV> dataV, Overlimit overlimit) {
List<OverLimitFlagDTO> result = new ArrayList<> ();
dataV.stream ().forEach (datav ->{
Integer temp = 0;
@@ -182,8 +182,8 @@ public class RStatWorkOrderCreateServiceImpl implements RStatWorkOrderCreateServ
* @date 2022/5/10 14:56
* @return List<DataV>
*/
public List<DataVPO> getDataV(String lineIndex, String startTime, String endTime){
List<DataVPO> result = new ArrayList<> ();
public List<DataV> getDataV(String lineIndex, String startTime, String endTime){
List<DataV> result = new ArrayList<> ();
//CP95值
StringBuilder stringBuilder7 = new StringBuilder();
@@ -200,7 +200,7 @@ public class RStatWorkOrderCreateServiceImpl implements RStatWorkOrderCreateServ
String sql4 = "select "+stringBuilder7+" from "+ InfluxDBPublicParam.DATA_V+" where "+stringBuilder8;
QueryResult sqlResult4 = influxDbUtils.query(sql4);
InfluxDBResultMapper resultMapper4 = new InfluxDBResultMapper();
List<DataVPO> list4 = resultMapper4.toPOJO(sqlResult4, DataVPO.class);
List<DataV> list4 = resultMapper4.toPOJO(sqlResult4, DataV.class);
list4.forEach(item->{
item.setValueType("CP95");
});
@@ -215,10 +215,10 @@ public class RStatWorkOrderCreateServiceImpl implements RStatWorkOrderCreateServ
* @param startTime 起始时间
* @param endTime 结束时间
* @date 2022/5/10 14:56
* @return List<DataIPO>
* @return List<DataI>
*/
public List<DataIPO> getDataI(String lineIndex, String startTime, String endTime){
List<DataIPO> result = new ArrayList<>();
public List<DataI> getDataI(String lineIndex, String startTime, String endTime){
List<DataI> result = new ArrayList<>();
//CP95值
StringBuilder stringBuilder7 = new StringBuilder();
@@ -234,7 +234,7 @@ public class RStatWorkOrderCreateServiceImpl implements RStatWorkOrderCreateServ
String sql4 = "select "+stringBuilder7+" from "+ InfluxDBPublicParam.DATA_I+" where "+stringBuilder8;
QueryResult sqlResult4 = influxDbUtils.query(sql4);
InfluxDBResultMapper resultMapper4 = new InfluxDBResultMapper();
List<DataIPO> list4 = resultMapper4.toPOJO(sqlResult4, DataIPO.class);
List<DataI> list4 = resultMapper4.toPOJO(sqlResult4, DataI.class);
list4.forEach(item->{
item.setValueType("CP95");
});

View File

@@ -1,15 +1,14 @@
package com.njcn.prepare.harmonic.service.mysql.Impl.device;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import com.njcn.influxdb.param.InfluxDBPublicParam;
import com.njcn.influxdb.utils.InfluxDbUtils;
import com.njcn.influx.deprecated.InfluxDBPublicParam;
import com.njcn.influx.deprecated.InfluxDbUtils;
import com.njcn.influx.pojo.po.PqsCommunicate;
import com.njcn.prepare.harmonic.mapper.mysql.device.DeviceAbnormaStatisticsMapper;
import com.njcn.prepare.harmonic.pojo.influxdb.po.Communicate;
import com.njcn.prepare.harmonic.pojo.mysql.po.line.AlarmPO;
import com.njcn.prepare.harmonic.pojo.mysql.po.line.AlarmStrategyVO;
import com.njcn.prepare.harmonic.pojo.mysql.po.line.TopMsgPO;
import com.njcn.prepare.harmonic.bo.TopMsgPO;
import com.njcn.prepare.harmonic.pojo.param.DeviceAbnormaStatisticsParam;
import com.njcn.prepare.harmonic.service.mysql.device.DeviceAbnormalStatisticsService;
import lombok.RequiredArgsConstructor;
@@ -18,12 +17,7 @@ import org.influxdb.dto.QueryResult;
import org.influxdb.impl.InfluxDBResultMapper;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.*;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.stream.Collectors;
@@ -81,7 +75,7 @@ public class DeviceAbnormaStatisticsServiceImpl implements DeviceAbnormalStatist
deviceFlowMap = deviceFlow.stream().collect(Collectors.groupingBy(AlarmPO::getDeviceId));
}
// 获取通信中断信息
List<TopMsgPO> comMsgs = getCommunicate(devIds, param.getTime());
List<TopMsgPO> comMsgs = getPqsCommunicate(devIds, param.getTime());
if (CollectionUtil.isNotEmpty(comMsgs)) {
comMap = comMsgs.stream().collect(Collectors.groupingBy(TopMsgPO::getDevId));
}
@@ -133,10 +127,10 @@ public class DeviceAbnormaStatisticsServiceImpl implements DeviceAbnormalStatist
if (comMap.containsKey(devEntry.getKey())) {
TopMsgPO comOutPO = comMap.get(devEntry.getKey()).get(0);
List<Communicate> abnormals = comOutPO.getCommunicates().stream().filter(t -> t.getDuration() > alarmStrategyVO.getOffTimeValue()).collect(Collectors.toList());
List<PqsCommunicate> abnormals = comOutPO.getCommunicates().stream().filter(t -> t.getDuration() > alarmStrategyVO.getOffTimeValue()).collect(Collectors.toList());
topMsg.setOfftimeFlag(abnormals.size() > 0 ? 0 :1);
topMsg.setComOutCount(abnormals.size());
List<String> abnormalDesc = abnormals.stream().map(Communicate::getDesc).collect(Collectors.toList());
List<String> abnormalDesc = abnormals.stream().map(PqsCommunicate::getDesc).collect(Collectors.toList());
topMsg.setComOutDescription(String.join(",",abnormalDesc));
} else {
topMsg.setOfftimeFlag(1);
@@ -151,7 +145,7 @@ public class DeviceAbnormaStatisticsServiceImpl implements DeviceAbnormalStatist
return topMsgPOS.size()>0 ? deviceAbnormaStatisticsMapper.insertTopMsg(topMsgPOS) : true;
}
public List<TopMsgPO> getCommunicate(List<String> devs, String time) {
public List<TopMsgPO> getPqsCommunicate(List<String> devs, String time) {
// 组装sql语句
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append("time >= '").append(DateUtil.beginOfDay(DateUtil.parse(time))).append("' and ").append("time <= '").append(DateUtil.endOfDay(DateUtil.parse(time))).append("' and ");
@@ -166,40 +160,40 @@ public class DeviceAbnormaStatisticsServiceImpl implements DeviceAbnormalStatist
// 获取暂降事件
QueryResult result = influxDbUtils.query(sql);
InfluxDBResultMapper influxDBResultMapper = new InfluxDBResultMapper();
List<Communicate> communicates = influxDBResultMapper.toPOJO(result, Communicate.class);
List<PqsCommunicate> communicates = influxDBResultMapper.toPOJO(result, PqsCommunicate.class);
// 通讯状态统计结果集
List<TopMsgPO> comMsgs = new ArrayList<>();
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
Map<String, List<Communicate>> comMap = communicates.stream().collect(Collectors.groupingBy(Communicate::getDevId));
Map<String, List<PqsCommunicate>> comMap = communicates.stream().collect(Collectors.groupingBy(PqsCommunicate::getDevId));
if (CollectionUtil.isNotEmpty(comMap)) {
for (Map.Entry<String, List<Communicate>> entry : comMap.entrySet()) {
for (Map.Entry<String, List<PqsCommunicate>> entry : comMap.entrySet()) {
String key = entry.getKey();
List<Communicate> value = entry.getValue();
List<PqsCommunicate> value = entry.getValue();
TopMsgPO topMsgPO = new TopMsgPO();
List<Communicate> comOuts = new ArrayList<>();
List<PqsCommunicate> comOuts = new ArrayList<>();
topMsgPO.setDevId(key);
// 根据日期排序
List<Communicate> sortedList = value.stream().sorted(Comparator.comparing(Communicate::getUpdateTime)).collect(Collectors.toList());
List<PqsCommunicate> sortedList = value.stream().sorted(Comparator.comparing(PqsCommunicate::getTime)).collect(Collectors.toList());
if (sortedList.get(0).getType() == 1) {
Communicate communicate = new Communicate();
int durationTime = (int) (Date.from(sortedList.get(0).getUpdateTime()).getTime() - DateUtil.beginOfDay(DateUtil.parse(time)).getTime())/1000/60;
PqsCommunicate communicate = new PqsCommunicate();
int durationTime = (int) (Date.from(sortedList.get(0).getTime()).getTime() - DateUtil.beginOfDay(DateUtil.parse(time)).getTime())/1000/60;
communicate.setDuration(durationTime);
communicate.setDesc((DateUtil.beginOfDay(DateUtil.parse(time))) + "" + formatter.format(Date.from(sortedList.get(0).getUpdateTime())));
communicate.setDesc((DateUtil.beginOfDay(DateUtil.parse(time))) + "" + formatter.format(Date.from(sortedList.get(0).getTime())));
comOuts.add(communicate);
}
for (int i = 0; i < sortedList.size(); i++) {
if (sortedList.get(i).getType() == 0 && i < sortedList.size() - 1) {
Communicate communicate = new Communicate();
int durationTime = (int) (Date.from(sortedList.get(i + 1).getUpdateTime()).getTime() - Date.from(sortedList.get(i).getUpdateTime()).getTime())/1000/60;
PqsCommunicate communicate = new PqsCommunicate();
int durationTime = (int) (Date.from(sortedList.get(i + 1).getTime()).getTime() - Date.from(sortedList.get(i).getTime()).getTime())/1000/60;
communicate.setDuration(durationTime);
String comOut = formatter.format(Date.from(sortedList.get(i).getUpdateTime())) + "" + formatter.format(Date.from(sortedList.get(i + 1).getUpdateTime()));
String comOut = formatter.format(Date.from(sortedList.get(i).getTime())) + "" + formatter.format(Date.from(sortedList.get(i + 1).getTime()));
communicate.setDesc(comOut);
comOuts.add(communicate);
} else if (sortedList.get(i).getType() == 0 && i == sortedList.size() - 1) {
Communicate communicate = new Communicate();
int durationTime = (int) (DateUtil.endOfDay(DateUtil.parse(time)).getTime() - Date.from(sortedList.get(i).getUpdateTime()).getTime()) / 1000 / 60;
PqsCommunicate communicate = new PqsCommunicate();
int durationTime = (int) (DateUtil.endOfDay(DateUtil.parse(time)).getTime() - Date.from(sortedList.get(i).getTime()).getTime()) / 1000 / 60;
communicate.setDuration(durationTime);
String comOut = formatter.format(Date.from(sortedList.get(i).getUpdateTime())) + "" + DateUtil.endOfDay(DateUtil.parse(time));
String comOut = formatter.format(Date.from(sortedList.get(i).getTime())) + "" + DateUtil.endOfDay(DateUtil.parse(time));
communicate.setDesc(comOut);
comOuts.add(communicate);
}
@@ -215,7 +209,7 @@ public class DeviceAbnormaStatisticsServiceImpl implements DeviceAbnormalStatist
if (CollectionUtil.isNotEmpty(extraComs)) {
for (String devId : extraComs) {
TopMsgPO topMsgPO = new TopMsgPO();
List<Communicate> comOuts = new ArrayList<>();
List<PqsCommunicate> comOuts = new ArrayList<>();
topMsgPO.setDevId(devId);
// 组装sql语句
StringBuilder builder = new StringBuilder();
@@ -225,16 +219,16 @@ public class DeviceAbnormaStatisticsServiceImpl implements DeviceAbnormalStatist
// 获取暂降事件
QueryResult result1 = influxDbUtils.query(sql1);
InfluxDBResultMapper influxDBResultMapper1 = new InfluxDBResultMapper();
List<Communicate> earlyData = influxDBResultMapper1.toPOJO(result1, Communicate.class);
List<PqsCommunicate> earlyData = influxDBResultMapper1.toPOJO(result1, PqsCommunicate.class);
if (earlyData.size()==0){
continue;
}
Communicate early = earlyData.get(0);
Communicate communicate = new Communicate();
PqsCommunicate early = earlyData.get(0);
PqsCommunicate communicate = new PqsCommunicate();
if (early.getType() == 0) {
int durationTime = (int) (DateUtil.endOfDay(DateUtil.parse(time)).getTime() - Date.from(early.getUpdateTime()).getTime()) / 1000 / 60;
int durationTime = (int) (DateUtil.endOfDay(DateUtil.parse(time)).getTime() - Date.from(early.getTime()).getTime()) / 1000 / 60;
communicate.setDuration(durationTime);
communicate.setDesc(formatter.format(Date.from(early.getUpdateTime())) + "" + DateUtil.endOfDay(DateUtil.parse(time)));
communicate.setDesc(formatter.format(Date.from(early.getTime())) + "" + DateUtil.endOfDay(DateUtil.parse(time)));
comOuts.add(communicate);
}
topMsgPO.setCommunicates(comOuts);

View File

@@ -9,12 +9,11 @@ import com.njcn.device.pms.pojo.po.DistributionMonitor;
import com.njcn.device.pms.pojo.po.Monitor;
import com.njcn.device.pq.pojo.po.DataV;
import com.njcn.device.pq.pojo.po.RMpIntegrityD;
import com.njcn.influxdb.utils.InfluxDbUtils;
import com.njcn.influx.pojo.po.DataFlicker;
import com.njcn.prepare.harmonic.constant.AlgorithmParam;
import com.njcn.prepare.harmonic.mapper.mysql.line.RMpIntegrityDMapper;
import com.njcn.prepare.harmonic.pojo.oracle.PqLinedetailPO;
import com.njcn.prepare.harmonic.pojo.param.LineParam;
import com.njcn.prepare.harmonic.pojo.po.DataFlicker;
import com.njcn.prepare.harmonic.pojo.vo.DataFlickerOracleVO;
import com.njcn.prepare.harmonic.pojo.vo.DataVOracleVO;
import com.njcn.prepare.harmonic.service.influxdb.DataIntegrityRateInfluxService;

View File

@@ -5,10 +5,10 @@ import cn.hutool.core.date.LocalDateTimeUtil;
import com.njcn.device.pq.api.LineFeignClient;
import com.njcn.device.biz.pojo.po.Overlimit;
import com.njcn.harmonic.pojo.po.RMpVThd;
import com.njcn.influxdb.utils.InfluxDbUtils;
import com.njcn.influx.deprecated.InfluxDbUtils;
import com.njcn.influx.pojo.po.DataV;
import com.njcn.prepare.harmonic.constant.AlgorithmParam;
import com.njcn.prepare.harmonic.mapper.mysql.line.RMpVThdMapper;
import com.njcn.prepare.harmonic.pojo.influxdb.po.DataVPO;
import com.njcn.prepare.harmonic.pojo.oracle.PqLinedetailPO;
import com.njcn.prepare.harmonic.pojo.param.LineParam;
import com.njcn.prepare.harmonic.service.mysql.line.DistortionRateService;
@@ -59,7 +59,7 @@ public class DistortionRateServiceImpl implements DistortionRateService {
}
LocalDateTime local = LocalDateTimeUtil.parse (lineParam.getDataDate () + "T00:00:00");
for (String lineId : lineIdOutList) {
List<DataVPO> rateOut = getDistortionRateInfluxDb (lineId, lineParam.getDataDate());
List<DataV> rateOut = getDistortionRateInfluxDb (lineId, lineParam.getDataDate());
if (rateOut.size ( ) > 0) {
Map<String, Object> inMap = new HashMap<> ( );
inMap.put ("lineId", lineId);
@@ -72,11 +72,11 @@ public class DistortionRateServiceImpl implements DistortionRateService {
}
private List<DataVPO> getDistortionRateInfluxDb(String lineId, String date) {
private List<DataV> getDistortionRateInfluxDb(String lineId, String date) {
String processParam = " and line_id = '" + lineId + "' and time >= '" + date + " 00:00:00' and time <= '" + date + " 23:59:59' tz('Asia/Shanghai')";
QueryResult result = influxDbUtils.query ("SELECT line_id, max(v_thd) as v_thd FROM data_v WHERE phasic_type != 'T' and value_type = 'CP95'" + processParam);
InfluxDBResultMapper resultMapper = new InfluxDBResultMapper ( );
return resultMapper.toPOJO (result, DataVPO.class);
return resultMapper.toPOJO (result, DataV.class);
}
private List<Overlimit> getAllLineOutData() {

View File

@@ -6,10 +6,10 @@ import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
import com.njcn.device.pq.api.LineFeignClient;
import com.njcn.device.biz.pojo.po.Overlimit;
import com.njcn.harmonic.pojo.po.day.RStatComassesDPO;
import com.njcn.influxdb.utils.InfluxDbUtils;
import com.njcn.influx.deprecated.InfluxDbUtils;
import com.njcn.influx.pojo.po.DataFlicker;
import com.njcn.influx.pojo.po.DataV;
import com.njcn.prepare.harmonic.mapper.mysql.day.RStatComassesDMapper;
import com.njcn.prepare.harmonic.pojo.influxdb.po.DataFlickerPO;
import com.njcn.prepare.harmonic.pojo.influxdb.po.DataVPO;
import com.njcn.prepare.harmonic.pojo.param.LineParam;
import com.njcn.prepare.harmonic.service.mysql.line.HarmonicGeneralService;
import lombok.AllArgsConstructor;
@@ -145,11 +145,11 @@ public class HarmonicGeneralServiceImpl extends MppServiceImpl<RStatComassesDMap
QueryResult vuDevResult3 = influxDbUtils.query(vuDevSql + "vu_dev <7 and vu_dev >=4" + processParam);
QueryResult vuDevResult4 = influxDbUtils.query(vuDevSql + "vu_dev <4 and vu_dev >=2" + processParam);
QueryResult vuDevResult5 = influxDbUtils.query(vuDevSql + "vu_dev <2 and vu_dev >=0" + processParam);
BigDecimal vuDev1 = BigDecimal.valueOf(mapper.toPOJO(vuDevResult1, DataVPO.class).size());
BigDecimal vuDev2 = BigDecimal.valueOf(mapper.toPOJO(vuDevResult2, DataVPO.class).size());
BigDecimal vuDev3 = BigDecimal.valueOf(mapper.toPOJO(vuDevResult3, DataVPO.class).size());
BigDecimal vuDev4 = BigDecimal.valueOf(mapper.toPOJO(vuDevResult4, DataVPO.class).size());
BigDecimal vuDev5 = BigDecimal.valueOf(mapper.toPOJO(vuDevResult5, DataVPO.class).size());
BigDecimal vuDev1 = BigDecimal.valueOf(mapper.toPOJO(vuDevResult1, DataV.class).size());
BigDecimal vuDev2 = BigDecimal.valueOf(mapper.toPOJO(vuDevResult2, DataV.class).size());
BigDecimal vuDev3 = BigDecimal.valueOf(mapper.toPOJO(vuDevResult3, DataV.class).size());
BigDecimal vuDev4 = BigDecimal.valueOf(mapper.toPOJO(vuDevResult4, DataV.class).size());
BigDecimal vuDev5 = BigDecimal.valueOf(mapper.toPOJO(vuDevResult5, DataV.class).size());
BigDecimal vuDevAll = vuDev1.add(vuDev2).add(vuDev3).add(vuDev4).add(vuDev5);
if (vuDevAll.compareTo(BigDecimal.ZERO)!=0){
outMap.put("vu_dev1",vuDev1.multiply(hundred).divide(vuDevAll,3, RoundingMode.HALF_UP));
@@ -165,11 +165,11 @@ public class HarmonicGeneralServiceImpl extends MppServiceImpl<RStatComassesDMap
QueryResult freqDevResult3 = influxDbUtils.query(freqDevSql + "freq_dev <0.2 and freq_dev >=0.1" + processParam);
QueryResult freqDevResult4 = influxDbUtils.query(freqDevSql + "freq_dev <0.1 and freq_dev >=0.05" + processParam);
QueryResult freqDevResult5 = influxDbUtils.query(freqDevSql + "freq_dev <0.05 and freq_dev >=0" + processParam);
BigDecimal freqDev1 = BigDecimal.valueOf(mapper.toPOJO(freqDevResult1, DataVPO.class).size());
BigDecimal freqDev2 = BigDecimal.valueOf(mapper.toPOJO(freqDevResult2, DataVPO.class).size());
BigDecimal freqDev3 = BigDecimal.valueOf(mapper.toPOJO(freqDevResult3, DataVPO.class).size());
BigDecimal freqDev4 = BigDecimal.valueOf(mapper.toPOJO(freqDevResult4, DataVPO.class).size());
BigDecimal freqDev5 = BigDecimal.valueOf(mapper.toPOJO(freqDevResult5, DataVPO.class).size());
BigDecimal freqDev1 = BigDecimal.valueOf(mapper.toPOJO(freqDevResult1, DataV.class).size());
BigDecimal freqDev2 = BigDecimal.valueOf(mapper.toPOJO(freqDevResult2, DataV.class).size());
BigDecimal freqDev3 = BigDecimal.valueOf(mapper.toPOJO(freqDevResult3, DataV.class).size());
BigDecimal freqDev4 = BigDecimal.valueOf(mapper.toPOJO(freqDevResult4, DataV.class).size());
BigDecimal freqDev5 = BigDecimal.valueOf(mapper.toPOJO(freqDevResult5, DataV.class).size());
BigDecimal freqDevAll = freqDev1.add(freqDev2).add(freqDev3).add(freqDev4).add(freqDev5);
if (freqDevAll.compareTo(BigDecimal.ZERO)!=0){
outMap.put("freq_dev1",freqDev1.multiply(hundred).divide(freqDevAll,3, RoundingMode.HALF_UP));
@@ -185,11 +185,11 @@ public class HarmonicGeneralServiceImpl extends MppServiceImpl<RStatComassesDMap
QueryResult vThdResult3 = influxDbUtils.query(vThdSql + "v_thd <4 and v_thd >=2" + processParam);
QueryResult vThdResult4 = influxDbUtils.query(vThdSql + "v_thd <2 and v_thd >=1" + processParam);
QueryResult vThdResult5 = influxDbUtils.query(vThdSql + "v_thd <1 and v_thd >=0" + processParam);
BigDecimal vThd1 = BigDecimal.valueOf(mapper.toPOJO(vThdResult1, DataVPO.class).size());
BigDecimal vThd2 = BigDecimal.valueOf(mapper.toPOJO(vThdResult2, DataVPO.class).size());
BigDecimal vThd3 = BigDecimal.valueOf(mapper.toPOJO(vThdResult3, DataVPO.class).size());
BigDecimal vThd4 = BigDecimal.valueOf(mapper.toPOJO(vThdResult4, DataVPO.class).size());
BigDecimal vThd5 = BigDecimal.valueOf(mapper.toPOJO(vThdResult5, DataVPO.class).size());
BigDecimal vThd1 = BigDecimal.valueOf(mapper.toPOJO(vThdResult1, DataV.class).size());
BigDecimal vThd2 = BigDecimal.valueOf(mapper.toPOJO(vThdResult2, DataV.class).size());
BigDecimal vThd3 = BigDecimal.valueOf(mapper.toPOJO(vThdResult3, DataV.class).size());
BigDecimal vThd4 = BigDecimal.valueOf(mapper.toPOJO(vThdResult4, DataV.class).size());
BigDecimal vThd5 = BigDecimal.valueOf(mapper.toPOJO(vThdResult5, DataV.class).size());
BigDecimal vThdAll = vThd1.add(vThd2).add(vThd3).add(vThd4).add(vThd5);
if (vThdAll.compareTo(BigDecimal.ZERO)!=0){
outMap.put("v_thd1",vThd1.multiply(hundred).divide(vThdAll,3, RoundingMode.HALF_UP));
@@ -205,11 +205,11 @@ public class HarmonicGeneralServiceImpl extends MppServiceImpl<RStatComassesDMap
QueryResult vUnbalanceResult3 = influxDbUtils.query(vUnbalanceSql + "v_unbalance <2 and v_unbalance >=1" + processParam);
QueryResult vUnbalanceResult4 = influxDbUtils.query(vUnbalanceSql + "v_unbalance <1 and v_unbalance >=0.5" + processParam);
QueryResult vUnbalanceResult5 = influxDbUtils.query(vUnbalanceSql + "v_unbalance <0.5 and v_unbalance >=0" + processParam);
BigDecimal vUnbalance1 = BigDecimal.valueOf(mapper.toPOJO(vUnbalanceResult1, DataVPO.class).size());
BigDecimal vUnbalance2 = BigDecimal.valueOf(mapper.toPOJO(vUnbalanceResult2, DataVPO.class).size());
BigDecimal vUnbalance3 = BigDecimal.valueOf(mapper.toPOJO(vUnbalanceResult3, DataVPO.class).size());
BigDecimal vUnbalance4 = BigDecimal.valueOf(mapper.toPOJO(vUnbalanceResult4, DataVPO.class).size());
BigDecimal vUnbalance5 = BigDecimal.valueOf(mapper.toPOJO(vUnbalanceResult5, DataVPO.class).size());
BigDecimal vUnbalance1 = BigDecimal.valueOf(mapper.toPOJO(vUnbalanceResult1, DataV.class).size());
BigDecimal vUnbalance2 = BigDecimal.valueOf(mapper.toPOJO(vUnbalanceResult2, DataV.class).size());
BigDecimal vUnbalance3 = BigDecimal.valueOf(mapper.toPOJO(vUnbalanceResult3, DataV.class).size());
BigDecimal vUnbalance4 = BigDecimal.valueOf(mapper.toPOJO(vUnbalanceResult4, DataV.class).size());
BigDecimal vUnbalance5 = BigDecimal.valueOf(mapper.toPOJO(vUnbalanceResult5, DataV.class).size());
BigDecimal vUnbalanceAll = vUnbalance1.add(vUnbalance2).add(vUnbalance3).add(vUnbalance4).add(vUnbalance5);
if (vUnbalanceAll.compareTo(BigDecimal.ZERO)!=0){
outMap.put("v_unbalance1",vUnbalance1.multiply(hundred).divide(vUnbalanceAll,3, RoundingMode.HALF_UP));
@@ -225,11 +225,11 @@ public class HarmonicGeneralServiceImpl extends MppServiceImpl<RStatComassesDMap
QueryResult pstResult3 = influxDbUtils.query(pstSql + "pst <0.6 and pst >=0.4" + processParam);
QueryResult pstResult4 = influxDbUtils.query(pstSql + "pst <0.4 and pst >=0.2" + processParam);
QueryResult pstResult5 = influxDbUtils.query(pstSql + "pst <0.2 and pst >=0" + processParam);
BigDecimal pst1 = BigDecimal.valueOf(mapper.toPOJO(pstResult1, DataFlickerPO.class).size());
BigDecimal pst2 = BigDecimal.valueOf(mapper.toPOJO(pstResult2, DataFlickerPO.class).size());
BigDecimal pst3 = BigDecimal.valueOf(mapper.toPOJO(pstResult3, DataFlickerPO.class).size());
BigDecimal pst4 = BigDecimal.valueOf(mapper.toPOJO(pstResult4, DataFlickerPO.class).size());
BigDecimal pst5 = BigDecimal.valueOf(mapper.toPOJO(pstResult5, DataFlickerPO.class).size());
BigDecimal pst1 = BigDecimal.valueOf(mapper.toPOJO(pstResult1, DataFlicker.class).size());
BigDecimal pst2 = BigDecimal.valueOf(mapper.toPOJO(pstResult2, DataFlicker.class).size());
BigDecimal pst3 = BigDecimal.valueOf(mapper.toPOJO(pstResult3, DataFlicker.class).size());
BigDecimal pst4 = BigDecimal.valueOf(mapper.toPOJO(pstResult4, DataFlicker.class).size());
BigDecimal pst5 = BigDecimal.valueOf(mapper.toPOJO(pstResult5, DataFlicker.class).size());
BigDecimal pstAll = pst1.add(pst2).add(pst3).add(pst4).add(pst5);
if (pstAll.compareTo(BigDecimal.ZERO)!=0){
outMap.put("data_plt1",pst1.multiply(hundred).divide(pstAll,3, RoundingMode.HALF_UP));

View File

@@ -2,16 +2,15 @@ package com.njcn.prepare.harmonic.service.mysql.Impl.line;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
import com.njcn.device.pq.api.LineFeignClient;
import com.njcn.device.biz.pojo.po.Overlimit;
import com.njcn.harmonic.pojo.po.day.RStatAssesDPO;
import com.njcn.influxdb.utils.InfluxDbUtils;
import com.njcn.influx.deprecated.InfluxDbUtils;
import com.njcn.influx.pojo.po.DataPlt;
import com.njcn.influx.pojo.po.DataV;
import com.njcn.prepare.harmonic.mapper.mysql.day.RStatAssesDMapper;
import com.njcn.prepare.harmonic.pojo.param.LineParam;
import com.njcn.prepare.harmonic.pojo.influxdb.po.DataPltPO;
import com.njcn.prepare.harmonic.pojo.influxdb.po.DataVPO;
import com.njcn.prepare.harmonic.service.mysql.line.HarmonicMetricService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@@ -105,16 +104,16 @@ public class HarmonicMetricServiceImpl extends MppServiceImpl<RStatAssesDMapper,
QueryResult vUnResult = influxDbUtils.query("select mean(v_unbalance) from data_v where phasic_type = 'T' and value_type = 'CP95'"+processParam);
QueryResult pltResult = influxDbUtils.query("select mean(plt) from data_plt where phasic_type != 'T'"+processParam);
InfluxDBResultMapper resultMapper = new InfluxDBResultMapper();
List<DataVPO> vuDev = resultMapper.toPOJO(vuDevResult, DataVPO.class);
List<DataVPO> vThd = resultMapper.toPOJO(vThdResult, DataVPO.class);
List<DataVPO> freqDev = resultMapper.toPOJO(freqDevResult, DataVPO.class);
List<DataVPO> vUn = resultMapper.toPOJO(vUnResult, DataVPO.class);
List<DataPltPO> plt = resultMapper.toPOJO(pltResult, DataPltPO.class);
List<DataV> vuDev = resultMapper.toPOJO(vuDevResult, DataV.class);
List<DataV> vThd = resultMapper.toPOJO(vThdResult, DataV.class);
List<DataV> freqDev = resultMapper.toPOJO(freqDevResult, DataV.class);
List<DataV> vUn = resultMapper.toPOJO(vUnResult, DataV.class);
List<DataPlt> plt = resultMapper.toPOJO(pltResult, DataPlt.class);
Map<String, Object> outMap = new HashMap<>();
if(CollUtil.isNotEmpty(vuDev) || CollUtil.isNotEmpty(vThd) || CollUtil.isNotEmpty(freqDev) || CollUtil.isNotEmpty(vUn) || CollUtil.isNotEmpty(plt)){
outMap.put("vu_dev",(vuDev.size()>0)?vuDev.stream().collect(Collectors.averagingDouble(DataVPO::getVuDev)):0.0);
outMap.put("vu_dev",(vuDev.size()>0)?vuDev.stream().collect(Collectors.averagingDouble(DataV::getVuDev)):0.0);
outMap.put("v_thd_cp95",(vThd.size()>0)?vThd.get(0).getMean():0.0);
outMap.put("freq_dev",(freqDev.size()>0)?freqDev.stream().collect(Collectors.averagingDouble(DataVPO::getFreqDev)):0.0);
outMap.put("freq_dev",(freqDev.size()>0)?freqDev.stream().collect(Collectors.averagingDouble(DataV::getFreqDev)):0.0);
outMap.put("v_unbalance_cp95",(vUn.size()>0)?vUn.get(0).getMean():0.0);
outMap.put("data_plt",(plt.size()>0)?plt.get(0).getMean():0.0);
}

View File

@@ -1,29 +1,23 @@
package com.njcn.prepare.harmonic.service.mysql.Impl.line;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.DateUtil;
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
import com.njcn.common.pojo.enums.common.ServerEnum;
import com.njcn.device.biz.commApi.CommTerminalGeneralClient;
import com.njcn.device.biz.pojo.dto.DeptGetChildrenMoreDTO;
import com.njcn.device.biz.pojo.dto.LineDevGetDTO;
import com.njcn.device.biz.pojo.param.DeptGetLineParam;
import com.njcn.device.pq.api.LineFeignClient;
import com.njcn.device.pq.pojo.po.LineDetail;
import com.njcn.device.biz.pojo.po.Overlimit;
import com.njcn.device.pq.pojo.po.RStatIntegrityD;
import com.njcn.influxdb.utils.InfluxDbUtils;
import com.njcn.influx.deprecated.InfluxDBPublicParam;
import com.njcn.influx.deprecated.InfluxDbUtils;
import com.njcn.influx.pojo.po.DataV;
import com.njcn.prepare.harmonic.mapper.mysql.day.RStatIntegrityDMapper;
import com.njcn.prepare.harmonic.pojo.influxdb.po.DataVPO;
import com.njcn.prepare.harmonic.pojo.param.LineParam;
import com.njcn.prepare.harmonic.service.mysql.line.IntegrityService;
import com.njcn.user.api.DeptFeignClient;
import com.njcn.user.pojo.po.Dept;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.influxdb.InfluxDB;
import org.influxdb.dto.BatchPoints;
import org.influxdb.dto.Point;
import org.influxdb.dto.QueryResult;
import org.influxdb.impl.InfluxDBResultMapper;
import org.springframework.scheduling.annotation.Async;
@@ -33,10 +27,7 @@ import org.springframework.util.CollectionUtils;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
import static com.njcn.influxdb.param.InfluxDBPublicParam.DAY_MINUTE;
/**
* 数据完整性统计
@@ -116,7 +107,7 @@ public class IntegrityServiceImpl extends MppServiceImpl<RStatIntegrityDMapper,
RStatIntegrityD integrityDpo = new RStatIntegrityD();
integrityDpo.setTimeId(dateTime);
integrityDpo.setLineIndex(lineDetail.getPointId());
integrityDpo.setDueTime(DAY_MINUTE/lineDetail.getInterval());
integrityDpo.setDueTime(InfluxDBPublicParam.DAY_MINUTE/lineDetail.getInterval());
integrityDpo.setRealTime(dataCount);
list.add(integrityDpo);
}
@@ -126,7 +117,7 @@ public class IntegrityServiceImpl extends MppServiceImpl<RStatIntegrityDMapper,
private int getDataCount(String lineId,String startTime,String endTime){
QueryResult sqlResult = influxDbUtils.query("SELECT * FROM data_v WHERE time >= '" + startTime + "' and time <= '" + endTime + "' and line_id = '" + lineId + "' and phasic_type = 'T' and value_type = 'MAX' tz('Asia/Shanghai')");
InfluxDBResultMapper resultMapper = new InfluxDBResultMapper();
List<DataVPO> list = resultMapper.toPOJO(sqlResult, DataVPO.class);
List<DataV> list = resultMapper.toPOJO(sqlResult, DataV.class);
if (CollectionUtils.isEmpty(list)){
return 0;
} else {

View File

@@ -8,10 +8,10 @@ import com.njcn.device.biz.pojo.po.Overlimit;
import com.njcn.harmonic.pojo.po.LimitRate;
import com.njcn.harmonic.pojo.po.LimitRatePO;
import com.njcn.harmonic.pojo.po.day.RStatLimitRateDPO;
import com.njcn.influxdb.param.InfluxDBPublicParam;
import com.njcn.influxdb.utils.InfluxDbUtils;
import com.njcn.influx.deprecated.InfluxDBPublicParam;
import com.njcn.influx.deprecated.InfluxDbUtils;
import com.njcn.influx.pojo.po.*;
import com.njcn.prepare.harmonic.mapper.mysql.line.LimitRatePOMapper;
import com.njcn.prepare.harmonic.pojo.influxdb.po.*;
import com.njcn.prepare.harmonic.service.mysql.day.IRStatLimitRateDService;
import lombok.AllArgsConstructor;
import lombok.SneakyThrows;
@@ -79,17 +79,17 @@ public class LimitRateService extends MppServiceImpl<LimitRatePOMapper, LimitRa
continue;
}
// influxDbUtils.setDbName ("pqsbase");
List<DataVPO> map1 = getAllTime(lineIndex,startTime,endTime);
List<DataPltPO> map2 = getFlickerAllTime(lineIndex,startTime,endTime);
List<DataHarmRateVPO> map3 = getDataHarmRateV(lineIndex,startTime,endTime);
List<DataIPO> map4 = getDataI(lineIndex,startTime,endTime);
List<DataInHarmVPO> map5 = getDataInHarmV(lineIndex,startTime,endTime);
List<DataVPO> map6 = getDataV(lineIndex,startTime,endTime);
List<DataVPO> map7 = getDataVUnbalance(lineIndex,startTime,endTime);
List<DataIPO> map8 = getDataINeg(lineIndex,startTime,endTime);
List<DataVPO> map9 = getDataVFreq(lineIndex,startTime,endTime);
List<DataVPO> map10 = getDataVDev(lineIndex,startTime,endTime);
List<DataPltPO> map11 = getDataPlt(lineIndex,startTime,endTime);
List<DataV> map1 = getAllTime(lineIndex,startTime,endTime);
List<DataPlt> map2 = getFlickerAllTime(lineIndex,startTime,endTime);
List<DataHarmRateV> map3 = getDataHarmRateV(lineIndex,startTime,endTime);
List<DataI> map4 = getDataI(lineIndex,startTime,endTime);
List<DataInHarmV> map5 = getDataInHarmV(lineIndex,startTime,endTime);
List<DataV> map6 = getDataV(lineIndex,startTime,endTime);
List<DataV> map7 = getDataVUnbalance(lineIndex,startTime,endTime);
List<DataI> map8 = getDataINeg(lineIndex,startTime,endTime);
List<DataV> map9 = getDataVFreq(lineIndex,startTime,endTime);
List<DataV> map10 = getDataVDev(lineIndex,startTime,endTime);
List<DataPlt> map11 = getDataPlt(lineIndex,startTime,endTime);
List<LimitRate> result = getData(overlimit,map1,map2,map3,map4,map5,map6,map7,map8,map9,map10,map11);
limitRateList.addAll (result);
@@ -129,17 +129,17 @@ public class LimitRateService extends MppServiceImpl<LimitRatePOMapper, LimitRa
if(!Optional.ofNullable (overlimit).isPresent ()){
continue;
}
List<DataVPO> map1 = getAllTime(lineIndex,startTime,endTime);
List<DataPltPO> map2 = getFlickerAllTime(lineIndex,startTime,endTime);
List<DataHarmRateVPO> map3 = getDataHarmRateV(lineIndex,startTime,endTime);
List<DataIPO> map4 = getDataI(lineIndex,startTime,endTime);
List<DataInHarmVPO> map5 = getDataInHarmV(lineIndex,startTime,endTime);
List<DataVPO> map6 = getDataV(lineIndex,startTime,endTime);
List<DataVPO> map7 = getDataVUnbalance(lineIndex,startTime,endTime);
List<DataIPO> map8 = getDataINeg(lineIndex,startTime,endTime);
List<DataVPO> map9 = getDataVFreq(lineIndex,startTime,endTime);
List<DataVPO> map10 = getDataVDev(lineIndex,startTime,endTime);
List<DataPltPO> map11 = getDataPlt(lineIndex,startTime,endTime);
List<DataV> map1 = getAllTime(lineIndex,startTime,endTime);
List<DataPlt> map2 = getFlickerAllTime(lineIndex,startTime,endTime);
List<DataHarmRateV> map3 = getDataHarmRateV(lineIndex,startTime,endTime);
List<DataI> map4 = getDataI(lineIndex,startTime,endTime);
List<DataInHarmV> map5 = getDataInHarmV(lineIndex,startTime,endTime);
List<DataV> map6 = getDataV(lineIndex,startTime,endTime);
List<DataV> map7 = getDataVUnbalance(lineIndex,startTime,endTime);
List<DataI> map8 = getDataINeg(lineIndex,startTime,endTime);
List<DataV> map9 = getDataVFreq(lineIndex,startTime,endTime);
List<DataV> map10 = getDataVDev(lineIndex,startTime,endTime);
List<DataPlt> map11 = getDataPlt(lineIndex,startTime,endTime);
List<LimitRate> result = getData(overlimit,map1,map2,map3,map4,map5,map6,map7,map8,map9,map10,map11);
limitRateList.addAll (result);
@@ -171,7 +171,7 @@ public class LimitRateService extends MppServiceImpl<LimitRatePOMapper, LimitRa
* @return
* @date 2022/5/23 10:51
*/
public List<DataVPO> getAllTime(String lineIndex, String startTime, String endTime) {
public List<DataV> getAllTime(String lineIndex, String startTime, String endTime) {
StringBuilder stringBuilder = new StringBuilder ( );
stringBuilder.append ("line_id='").append (lineIndex).append ("' and ").append (InfluxDBPublicParam.TIME + " >= '").append (startTime).
append ("' and ").append (InfluxDBPublicParam.TIME).
@@ -181,7 +181,7 @@ public class LimitRateService extends MppServiceImpl<LimitRatePOMapper, LimitRa
String sql = "SELECT count(freq) AS all_time FROM " + InfluxDBPublicParam.DATA_V + " where " + stringBuilder;
QueryResult sqlResult = influxDbUtils.query (sql);
InfluxDBResultMapper resultMapper = new InfluxDBResultMapper ( );
List<DataVPO> list = resultMapper.toPOJO (sqlResult, DataVPO.class);
List<DataV> list = resultMapper.toPOJO (sqlResult, DataV.class);
return list;
}
@@ -190,11 +190,11 @@ public class LimitRateService extends MppServiceImpl<LimitRatePOMapper, LimitRa
/**
* @Description: getFlickerAllTime
* @Param: [lineIndex, startTime, endTime]
* @return: java.util.Map<java.lang.String, java.util.List < com.njcn.prepare.harmonic.preprocessing.pojo.vo.DataPltPO>>
* @return: java.util.Map<java.lang.String, java.util.List < com.njcn.prepare.harmonic.preprocessing.pojo.vo.DataPlt>>
* @Author: clam
* @Date: 2022/10/18
*/
public List<DataPltPO> getFlickerAllTime(String lineIndex, String startTime, String endTime) {
public List<DataPlt> getFlickerAllTime(String lineIndex, String startTime, String endTime) {
StringBuilder stringBuilder = new StringBuilder ( );
stringBuilder.append ("line_id='").append (lineIndex).append ("' and ").append (InfluxDBPublicParam.TIME + " >= '").
@@ -205,7 +205,7 @@ public class LimitRateService extends MppServiceImpl<LimitRatePOMapper, LimitRa
String sql = "SELECT count(plt) AS flicker_all_time FROM " + InfluxDBPublicParam.DATA_PLT + " where " + stringBuilder;
QueryResult sqlResult = influxDbUtils.query (sql);
InfluxDBResultMapper resultMapper = new InfluxDBResultMapper ( );
List<DataPltPO> list = resultMapper.toPOJO (sqlResult, DataPltPO.class);
List<DataPlt> list = resultMapper.toPOJO (sqlResult, DataPlt.class);
return list;
}
@@ -219,7 +219,7 @@ public class LimitRateService extends MppServiceImpl<LimitRatePOMapper, LimitRa
* @return
* @date 2022/5/23 10:51
*/
public List<DataHarmRateVPO> getDataHarmRateV(String lineIndex, String startTime, String endTime) {
public List<DataHarmRateV> getDataHarmRateV(String lineIndex, String startTime, String endTime) {
StringBuilder stringBuilder = new StringBuilder ( );
stringBuilder.append ("line_id='").append (lineIndex).append ("' and ").append (InfluxDBPublicParam.TIME + " >= '").append (startTime).append ("' and ").
append (InfluxDBPublicParam.TIME).append (" <= '").
@@ -229,7 +229,7 @@ public class LimitRateService extends MppServiceImpl<LimitRatePOMapper, LimitRa
String sql = "SELECT * FROM " + InfluxDBPublicParam.DATA_HARM_RATE_V + " WHERE " + stringBuilder;
QueryResult sqlResult = influxDbUtils.query (sql);
InfluxDBResultMapper resultMapper = new InfluxDBResultMapper ( );
List<DataHarmRateVPO> list = resultMapper.toPOJO (sqlResult, DataHarmRateVPO.class);
List<DataHarmRateV> list = resultMapper.toPOJO (sqlResult, DataHarmRateV.class);
return list;
}
@@ -242,7 +242,7 @@ public class LimitRateService extends MppServiceImpl<LimitRatePOMapper, LimitRa
* @param endTime 结束时间
* @Date: 2022/10/18
*/
public List<DataIPO> getDataI(String lineIndex, String startTime, String endTime) {
public List<DataI> getDataI(String lineIndex, String startTime, String endTime) {
StringBuilder stringBuilder = new StringBuilder ( );
stringBuilder.append ("line_id='").append (lineIndex).append ("' and ").append (InfluxDBPublicParam.TIME + " >= '").append (startTime).
append ("' and ").append (InfluxDBPublicParam.TIME).append (" <= '").
@@ -252,7 +252,7 @@ public class LimitRateService extends MppServiceImpl<LimitRatePOMapper, LimitRa
String sql = "SELECT * FROM " + InfluxDBPublicParam.DATA_I + " WHERE " + stringBuilder;
QueryResult sqlResult = influxDbUtils.query (sql);
InfluxDBResultMapper resultMapper = new InfluxDBResultMapper ( );
List<DataIPO> list = resultMapper.toPOJO (sqlResult, DataIPO.class);
List<DataI> list = resultMapper.toPOJO (sqlResult, DataI.class);
return list;
}
@@ -266,7 +266,7 @@ public class LimitRateService extends MppServiceImpl<LimitRatePOMapper, LimitRa
* @return
* @date 2022/5/23 10:51
*/
public List<DataInHarmVPO> getDataInHarmV(String lineIndex, String startTime, String endTime) {
public List<DataInHarmV> getDataInHarmV(String lineIndex, String startTime, String endTime) {
StringBuilder stringBuilder = new StringBuilder ( );
stringBuilder.append ("line_id='").append (lineIndex).append ("' and ").append (InfluxDBPublicParam.TIME + " >= '").append (startTime).
append ("' and ").append (InfluxDBPublicParam.TIME).append (" <= '").append (endTime).
@@ -275,7 +275,7 @@ public class LimitRateService extends MppServiceImpl<LimitRatePOMapper, LimitRa
String sql = "SELECT * FROM " + InfluxDBPublicParam.DATA_IN_HARM_V + " WHERE " + stringBuilder;
QueryResult sqlResult = influxDbUtils.query (sql);
InfluxDBResultMapper resultMapper = new InfluxDBResultMapper ( );
List<DataInHarmVPO> list = resultMapper.toPOJO (sqlResult, DataInHarmVPO.class);
List<DataInHarmV> list = resultMapper.toPOJO (sqlResult, DataInHarmV.class);
return list;
}
@@ -289,7 +289,7 @@ public class LimitRateService extends MppServiceImpl<LimitRatePOMapper, LimitRa
* @return
* @date 2022/5/23 10:51
*/
public List<DataVPO> getDataV(String lineIndex, String startTime, String endTime) {
public List<DataV> getDataV(String lineIndex, String startTime, String endTime) {
StringBuilder stringBuilder = new StringBuilder ( );
stringBuilder.append ("line_id='").append (lineIndex).append ("' and ").append (InfluxDBPublicParam.TIME + " >= '").append (startTime).
append ("' and ").append (InfluxDBPublicParam.TIME).append (" <= '").append (endTime).
@@ -298,7 +298,7 @@ public class LimitRateService extends MppServiceImpl<LimitRatePOMapper, LimitRa
String sql = "SELECT * FROM " + InfluxDBPublicParam.DATA_V + " WHERE " + stringBuilder;
QueryResult sqlResult = influxDbUtils.query (sql);
InfluxDBResultMapper resultMapper = new InfluxDBResultMapper ( );
List<DataVPO> list = resultMapper.toPOJO (sqlResult, DataVPO.class);
List<DataV> list = resultMapper.toPOJO (sqlResult, DataV.class);
return list;
}
@@ -312,7 +312,7 @@ public class LimitRateService extends MppServiceImpl<LimitRatePOMapper, LimitRa
* @return
* @date 2022/5/23 10:51
*/
public List<DataVPO> getDataVUnbalance(String lineIndex, String startTime, String endTime) {
public List<DataV> getDataVUnbalance(String lineIndex, String startTime, String endTime) {
StringBuilder stringBuilder = new StringBuilder ( );
stringBuilder.append ("line_id='").append (lineIndex).append ("' and ").append (InfluxDBPublicParam.TIME + " >= '").append (startTime).
@@ -322,7 +322,7 @@ public class LimitRateService extends MppServiceImpl<LimitRatePOMapper, LimitRa
String sql = "SELECT * FROM " + InfluxDBPublicParam.DATA_V + " WHERE " + stringBuilder;
QueryResult sqlResult = influxDbUtils.query (sql);
InfluxDBResultMapper resultMapper = new InfluxDBResultMapper ( );
List<DataVPO> list = resultMapper.toPOJO (sqlResult, DataVPO.class);
List<DataV> list = resultMapper.toPOJO (sqlResult, DataV.class);
return list;
}
@@ -336,8 +336,8 @@ public class LimitRateService extends MppServiceImpl<LimitRatePOMapper, LimitRa
* @return
* @date 2022/5/23 10:51
*/
public List<DataIPO> getDataINeg(String lineIndex, String startTime, String endTime) {
Map<String, List<DataIPO>> map = new HashMap<> ( );
public List<DataI> getDataINeg(String lineIndex, String startTime, String endTime) {
Map<String, List<DataI>> map = new HashMap<> ( );
StringBuilder stringBuilder = new StringBuilder ( );
stringBuilder.append ("line_id='").append (lineIndex).append ("' and ").append (InfluxDBPublicParam.TIME + " >= '").
append (startTime).append ("' and ").append (InfluxDBPublicParam.TIME).append (" <= '").append (endTime).
@@ -346,7 +346,7 @@ public class LimitRateService extends MppServiceImpl<LimitRatePOMapper, LimitRa
String sql = "SELECT * FROM " + InfluxDBPublicParam.DATA_I + " WHERE " + stringBuilder;
QueryResult sqlResult = influxDbUtils.query (sql);
InfluxDBResultMapper resultMapper = new InfluxDBResultMapper ( );
List<DataIPO> list = resultMapper.toPOJO (sqlResult, DataIPO.class);
List<DataI> list = resultMapper.toPOJO (sqlResult, DataI.class);
return list;
}
@@ -360,7 +360,7 @@ public class LimitRateService extends MppServiceImpl<LimitRatePOMapper, LimitRa
* @return
* @date 2022/5/23 10:51
*/
public List<DataVPO> getDataVFreq(String lineIndex, String startTime, String endTime) {
public List<DataV> getDataVFreq(String lineIndex, String startTime, String endTime) {
StringBuilder stringBuilder = new StringBuilder ( );
stringBuilder.append ("line_id='").append (lineIndex).append ("' and ").append (InfluxDBPublicParam.TIME + " >= '").append (startTime).append ("' and ").
append (InfluxDBPublicParam.TIME).append (" <= '").
@@ -370,7 +370,7 @@ public class LimitRateService extends MppServiceImpl<LimitRatePOMapper, LimitRa
String sql = "SELECT * FROM " + InfluxDBPublicParam.DATA_V + " WHERE " + stringBuilder;
QueryResult sqlResult = influxDbUtils.query (sql);
InfluxDBResultMapper resultMapper = new InfluxDBResultMapper ( );
List<DataVPO> list = resultMapper.toPOJO (sqlResult, DataVPO.class);
List<DataV> list = resultMapper.toPOJO (sqlResult, DataV.class);
return list;
}
@@ -384,7 +384,7 @@ public class LimitRateService extends MppServiceImpl<LimitRatePOMapper, LimitRa
* @return
* @date 2022/5/23 10:51
*/
public List<DataVPO> getDataVDev(String lineIndex, String startTime, String endTime) {
public List<DataV> getDataVDev(String lineIndex, String startTime, String endTime) {
StringBuilder stringBuilder = new StringBuilder ( );
stringBuilder.append ("line_id='").append (lineIndex).append ("' and ").append (InfluxDBPublicParam.TIME + " >= '").
append (startTime).append ("' and ").append (InfluxDBPublicParam.TIME).append (" <= '").append (endTime).
@@ -393,7 +393,7 @@ public class LimitRateService extends MppServiceImpl<LimitRatePOMapper, LimitRa
String sql = "SELECT * FROM " + InfluxDBPublicParam.DATA_V + " WHERE " + stringBuilder;
QueryResult sqlResult = influxDbUtils.query (sql);
InfluxDBResultMapper resultMapper = new InfluxDBResultMapper ( );
List<DataVPO> list = resultMapper.toPOJO (sqlResult, DataVPO.class);
List<DataV> list = resultMapper.toPOJO (sqlResult, DataV.class);
return list;
}
@@ -407,7 +407,7 @@ public class LimitRateService extends MppServiceImpl<LimitRatePOMapper, LimitRa
* @return
* @date 2022/5/23 10:51
*/
public List<DataPltPO> getDataPlt(String lineIndex, String startTime, String endTime) {
public List<DataPlt> getDataPlt(String lineIndex, String startTime, String endTime) {
StringBuilder stringBuilder = new StringBuilder ( );
stringBuilder.append ("line_id='").append (lineIndex).append ("' and ").append (InfluxDBPublicParam.TIME + " >= '").append (startTime).
append ("' and ").append (InfluxDBPublicParam.TIME).append (" <= '").append (endTime).
@@ -416,7 +416,7 @@ public class LimitRateService extends MppServiceImpl<LimitRatePOMapper, LimitRa
String sql = "SELECT * FROM " + InfluxDBPublicParam.DATA_PLT + " WHERE " + stringBuilder;
QueryResult sqlResult = influxDbUtils.query (sql);
InfluxDBResultMapper resultMapper = new InfluxDBResultMapper ( );
List<DataPltPO> list = resultMapper.toPOJO (sqlResult, DataPltPO.class);
List<DataPlt> list = resultMapper.toPOJO (sqlResult, DataPlt.class);
return list;
}
@@ -428,28 +428,28 @@ public class LimitRateService extends MppServiceImpl<LimitRatePOMapper, LimitRa
* @Author: clam
* @Date: 2022/10/18
*/
private List<LimitRate> getData(Overlimit overlimit, List<DataVPO> allTimeList,
List<DataPltPO> flickerAllTimeList, List<DataHarmRateVPO> dataHarmRateVPOList,
List<DataIPO> dataIPOList, List<DataInHarmVPO> dataInHarmVPOList,
List<DataVPO> dataVPOList, List<DataVPO> dataVPOUnbalanceList, List<DataIPO> dataIPONegList,
List<DataVPO> dataVPOFreqList, List<DataVPO> dataVPODevList, List<DataPltPO> dataPltPOList) {
private List<LimitRate> getData(Overlimit overlimit, List<DataV> allTimeList,
List<DataPlt> flickerAllTimeList, List<DataHarmRateV> dataHarmRateVPOList,
List<DataI> dataIPOList, List<DataInHarmV> dataInHarmVPOList,
List<DataV> dataVPOList, List<DataV> dataVPOUnbalanceList, List<DataI> dataIPONegList,
List<DataV> dataVPOFreqList, List<DataV> dataVPODevList, List<DataPlt> dataPltPOList) {
List<LimitRate> result = new ArrayList<> ( );
Map<String, List<DataHarmRateVPO>> harmRateVByPhaseType = new HashMap<> ( );
Map<String, List<DataIPO>> dataIByPhaseType = new HashMap<> ( );
Map<String, List<DataInHarmVPO>> dataInHarmVPhaseType = new HashMap<> ( );
Map<String, List<DataVPO>> dataVPhaseType = new HashMap<> ( );
Map<String, List<DataVPO>> dataVDevPhaseType = new HashMap<> ( );
Map<String, List<DataPltPO>> dataPltPhaseType = new HashMap<> ( );
Map<Instant, List<DataHarmRateVPO>> harmRateVByTime = new HashMap<> ( );
Map<Instant, List<DataIPO>> dataIByTime = new HashMap<> ( );
Map<Instant, List<DataInHarmVPO>> dataInHarmVByTime = new HashMap<> ( );
Map<Instant, List<DataVPO>> dataVByTime = new HashMap<> ( );
Map<Instant, List<DataVPO>> dataVUnbalanceByTime = new HashMap<> ( );
Map<Instant, List<DataIPO>> dataINegByTime = new HashMap<> ( );
Map<Instant, List<DataVPO>> dataVFreqByTime = new HashMap<> ( );
Map<Instant, List<DataVPO>> dataVDevByTime = new HashMap<> ( );
Map<Instant, List<DataPltPO>> dataPltByTime = new HashMap<> ( );
Map<String, List<DataHarmRateV>> harmRateVByPhaseType = new HashMap<> ( );
Map<String, List<DataI>> dataIByPhaseType = new HashMap<> ( );
Map<String, List<DataInHarmV>> dataInHarmVPhaseType = new HashMap<> ( );
Map<String, List<DataV>> dataVPhaseType = new HashMap<> ( );
Map<String, List<DataV>> dataVDevPhaseType = new HashMap<> ( );
Map<String, List<DataPlt>> dataPltPhaseType = new HashMap<> ( );
Map<Instant, List<DataHarmRateV>> harmRateVByTime = new HashMap<> ( );
Map<Instant, List<DataI>> dataIByTime = new HashMap<> ( );
Map<Instant, List<DataInHarmV>> dataInHarmVByTime = new HashMap<> ( );
Map<Instant, List<DataV>> dataVByTime = new HashMap<> ( );
Map<Instant, List<DataV>> dataVUnbalanceByTime = new HashMap<> ( );
Map<Instant, List<DataI>> dataINegByTime = new HashMap<> ( );
Map<Instant, List<DataV>> dataVFreqByTime = new HashMap<> ( );
Map<Instant, List<DataV>> dataVDevByTime = new HashMap<> ( );
Map<Instant, List<DataPlt>> dataPltByTime = new HashMap<> ( );
Integer allTime = 0;
Integer flickerAllTime = 0;
if (!CollectionUtils.isEmpty (allTimeList)) {
@@ -461,37 +461,37 @@ public class LimitRateService extends MppServiceImpl<LimitRatePOMapper, LimitRa
if (!CollectionUtils.isEmpty (dataHarmRateVPOList)) {
harmRateVByPhaseType = dataHarmRateVPOList.stream ( ).collect (Collectors.groupingBy (DataHarmRateVPO::getPhaseType));
harmRateVByTime = dataHarmRateVPOList.stream ( ).collect (Collectors.groupingBy (DataHarmRateVPO::getTime));
harmRateVByPhaseType = dataHarmRateVPOList.stream ( ).collect (Collectors.groupingBy (DataHarmRateV::getPhaseType));
harmRateVByTime = dataHarmRateVPOList.stream ( ).collect (Collectors.groupingBy (DataHarmRateV::getTime));
}
if (!CollectionUtils.isEmpty (dataIPOList)) {
dataIByPhaseType = dataIPOList.stream ( ).collect (Collectors.groupingBy (DataIPO::getPhaseType));
dataIByTime = dataIPOList.stream ( ).collect (Collectors.groupingBy (DataIPO::getTime));
dataIByPhaseType = dataIPOList.stream ( ).collect (Collectors.groupingBy (DataI::getPhaseType));
dataIByTime = dataIPOList.stream ( ).collect (Collectors.groupingBy (DataI::getTime));
}
if (!CollectionUtils.isEmpty (dataInHarmVPOList)) {
dataInHarmVPhaseType = dataInHarmVPOList.stream ( ).collect (Collectors.groupingBy (DataInHarmVPO::getPhaseType));
dataInHarmVByTime = dataInHarmVPOList.stream ( ).collect (Collectors.groupingBy (DataInHarmVPO::getTime));
dataInHarmVPhaseType = dataInHarmVPOList.stream ( ).collect (Collectors.groupingBy (DataInHarmV::getPhaseType));
dataInHarmVByTime = dataInHarmVPOList.stream ( ).collect (Collectors.groupingBy (DataInHarmV::getTime));
}
if (!CollectionUtils.isEmpty (dataVPOList)) {
dataVPhaseType = dataVPOList.stream ( ).collect (Collectors.groupingBy (DataVPO::getPhaseType));
dataVByTime = dataVPOList.stream ( ).collect (Collectors.groupingBy (DataVPO::getTime));
dataVPhaseType = dataVPOList.stream ( ).collect (Collectors.groupingBy (DataV::getPhasicType));
dataVByTime = dataVPOList.stream ( ).collect (Collectors.groupingBy (DataV::getTime));
}
if (!CollectionUtils.isEmpty (dataVPOUnbalanceList)) {
dataVUnbalanceByTime = dataVPOUnbalanceList.stream ( ).collect (Collectors.groupingBy (DataVPO::getTime));
dataVUnbalanceByTime = dataVPOUnbalanceList.stream ( ).collect (Collectors.groupingBy (DataV::getTime));
}
if (!CollectionUtils.isEmpty (dataIPONegList)) {
dataINegByTime = dataIPONegList.stream ( ).collect (Collectors.groupingBy (DataIPO::getTime));
dataINegByTime = dataIPONegList.stream ( ).collect (Collectors.groupingBy (DataI::getTime));
}
if (!CollectionUtils.isEmpty (dataVPOFreqList)) {
dataVFreqByTime = dataVPOFreqList.stream ( ).collect (Collectors.groupingBy (DataVPO::getTime));
dataVFreqByTime = dataVPOFreqList.stream ( ).collect (Collectors.groupingBy (DataV::getTime));
}
if (!CollectionUtils.isEmpty (dataVPODevList)) {
dataVDevPhaseType = dataVPODevList.stream ( ).collect (Collectors.groupingBy (DataVPO::getPhaseType));
dataVDevByTime = dataVPODevList.stream ( ).collect (Collectors.groupingBy (DataVPO::getTime));
dataVDevPhaseType = dataVPODevList.stream ( ).collect (Collectors.groupingBy (DataV::getPhasicType));
dataVDevByTime = dataVPODevList.stream ( ).collect (Collectors.groupingBy (DataV::getTime));
}
if (!CollectionUtils.isEmpty (dataPltPOList)) {
dataPltPhaseType = dataPltPOList.stream ( ).collect (Collectors.groupingBy (DataPltPO::getPhaseType));
dataPltByTime = dataPltPOList.stream ( ).collect (Collectors.groupingBy (DataPltPO::getTime));
dataPltPhaseType = dataPltPOList.stream ( ).collect (Collectors.groupingBy (DataPlt::getPhaseType));
dataPltByTime = dataPltPOList.stream ( ).collect (Collectors.groupingBy (DataPlt::getTime));
}
LimitRate a = limitRateData (overlimit, allTime, flickerAllTime, "A", overlimit.getId (), harmRateVByPhaseType.get ("A"), dataIByPhaseType.get ("A"), dataInHarmVPhaseType.get ("A"), dataVPhaseType.get ("A"), dataVDevPhaseType.get ("A"), dataPltPhaseType.get ("A"));
LimitRate b = limitRateData (overlimit, allTime, flickerAllTime, "B", overlimit.getId (), harmRateVByPhaseType.get ("B"), dataIByPhaseType.get ("B"), dataInHarmVPhaseType.get ("B"), dataVPhaseType.get ("B"), dataVDevPhaseType.get ("B"), dataPltPhaseType.get ("B"));
@@ -515,9 +515,9 @@ public class LimitRateService extends MppServiceImpl<LimitRatePOMapper, LimitRa
*/
public LimitRate limitRateData(Overlimit overlimit, Integer allTime, Integer
flickerAllTime, String phasicType, String lineId,
List<DataHarmRateVPO> dataHarmRateVPOList,
List<DataIPO> dataIPOList, List<DataInHarmVPO> dataInHarmVPOList,
List<DataVPO> dataVPOList, List<DataVPO> dataVPODevList, List<DataPltPO> dataPltPOList) {
List<DataHarmRateV> dataHarmRateVPOList,
List<DataI> dataIPOList, List<DataInHarmV> dataInHarmVPOList,
List<DataV> dataVPOList, List<DataV> dataVPODevList, List<DataPlt> dataPltPOList) {
LimitRate limitRate = new LimitRate ( );
int v2 = 0, v3 = 0, v4 = 0, v5 = 0, v6 = 0, v7 = 0, v8 = 0, v9 = 0, v10 = 0, v11 = 0, v12 = 0, v13 = 0, v14 = 0, v15 = 0, v16 = 0, v17 = 0, v18 = 0, v19 = 0, v20 = 0, v21 = 0, v22 = 0, v23 = 0, v24 = 0, v25 = 0;
int i2 = 0, i3 = 0, i4 = 0, i5 = 0, i6 = 0, i7 = 0, i8 = 0, i9 = 0, i10 = 0, i11 = 0, i12 = 0, i13 = 0, i14 = 0, i15 = 0, i16 = 0, i17 = 0, i18 = 0, i19 = 0, i20 = 0, i21 = 0, i22 = 0, i23 = 0, i24 = 0, i25 = 0;
@@ -526,7 +526,7 @@ public class LimitRateService extends MppServiceImpl<LimitRatePOMapper, LimitRa
//2-25次谐波电压含有率
if (!CollectionUtils.isEmpty (dataHarmRateVPOList)) {
for (DataHarmRateVPO item : dataHarmRateVPOList) {
for (DataHarmRateV item : dataHarmRateVPOList) {
if (item.getV2 ( ) > overlimit.getUharm2 ( )) {
v2++;
}
@@ -603,7 +603,7 @@ public class LimitRateService extends MppServiceImpl<LimitRatePOMapper, LimitRa
}
//2-25次谐波电流
if (!CollectionUtils.isEmpty (dataIPOList)) {
for (DataIPO item : dataIPOList) {
for (DataI item : dataIPOList) {
if (item.getI2 ( ) > overlimit.getIharm2 ( )) {
i2++;
}
@@ -680,7 +680,7 @@ public class LimitRateService extends MppServiceImpl<LimitRatePOMapper, LimitRa
}
//0.5-15.5次间谐波电压含有率
if (!CollectionUtils.isEmpty (dataInHarmVPOList)) {
for (DataInHarmVPO item : dataInHarmVPOList) {
for (DataInHarmV item : dataInHarmVPOList) {
if (item.getV1 ( ) > overlimit.getInuharm1 ( )) {
uHarm1++;
}
@@ -733,7 +733,7 @@ public class LimitRateService extends MppServiceImpl<LimitRatePOMapper, LimitRa
}
//电压总谐波畸变率
if (!CollectionUtils.isEmpty (dataVPOList)) {
for (DataVPO item : dataVPOList) {
for (DataV item : dataVPOList) {
if (item.getVThd ( ) > overlimit.getUaberrance ( )) {
thd++;
}
@@ -741,7 +741,7 @@ public class LimitRateService extends MppServiceImpl<LimitRatePOMapper, LimitRa
}
//电压上偏差、电压下偏差(根据vl_dev的正负判断是用哪个值判断越限)
if (!CollectionUtils.isEmpty (dataVPODevList)) {
for (DataVPO item : dataVPODevList) {
for (DataV item : dataVPODevList) {
if (item.getVlDev() >= 0){
if (item.getVlDev() > overlimit.getVoltageDev()){
uDev++;
@@ -755,7 +755,7 @@ public class LimitRateService extends MppServiceImpl<LimitRatePOMapper, LimitRa
}
//长时间闪变
if (!CollectionUtils.isEmpty (dataPltPOList)) {
for (DataPltPO item : dataPltPOList) {
for (DataPlt item : dataPltPOList) {
if (item.getPlt ( ) > overlimit.getFlicker ( )) {
flicker++;
}
@@ -839,7 +839,7 @@ public class LimitRateService extends MppServiceImpl<LimitRatePOMapper, LimitRa
}
public LimitRate limitRateDataT(Overlimit overlimit, Integer allTime, Integer flickerAllTime, String lineId, Map<Instant,List<DataHarmRateVPO>> map1, Map<Instant,List<DataIPO>> map2, Map<Instant,List<DataInHarmVPO>> map3, Map<Instant,List<DataVPO>> map4, Map<Instant,List<DataVPO>> map5, Map<Instant,List<DataIPO>> map6, Map<Instant,List<DataVPO>> map7, Map<Instant,List<DataVPO>> map8, Map<Instant,List<DataPltPO>> map9){
public LimitRate limitRateDataT(Overlimit overlimit, Integer allTime, Integer flickerAllTime, String lineId, Map<Instant,List<DataHarmRateV>> map1, Map<Instant,List<DataI>> map2, Map<Instant,List<DataInHarmV>> map3, Map<Instant,List<DataV>> map4, Map<Instant,List<DataV>> map5, Map<Instant,List<DataI>> map6, Map<Instant,List<DataV>> map7, Map<Instant,List<DataV>> map8, Map<Instant,List<DataPlt>> map9){
LimitRate limitRate = new LimitRate();
int v2 = 0,v3 = 0,v4 = 0,v5 = 0,v6 = 0,v7 = 0,v8 = 0,v9 = 0,v10 = 0,v11 = 0,v12 = 0,v13 = 0,v14 = 0,v15 = 0,v16 = 0,v17 = 0,v18 = 0,v19 = 0,v20 = 0,v21 = 0,v22 = 0,v23 = 0,v24 = 0,v25 = 0;
int i2 = 0,i3 = 0,i4 = 0,i5 = 0,i6 = 0,i7 = 0,i8 = 0,i9 = 0,i10 = 0,i11 = 0,i12 = 0,i13 = 0,i14 = 0,i15 = 0,i16 = 0,i17 = 0,i18 = 0,i19 = 0,i20 = 0,i21 = 0,i22 = 0,i23 = 0,i24 = 0,i25 = 0;
@@ -847,317 +847,317 @@ public class LimitRateService extends MppServiceImpl<LimitRatePOMapper, LimitRa
int thd = 0,uDev = 0,flicker = 0,freqDev = 0,uAberrance = 0,iNeg = 0;
//2-25次谐波电压含有率
for (Instant time:map1.keySet()) {
List<DataHarmRateVPO> list = map1.get(time);
List<DataHarmRateVPO> l2 = list.stream().filter(s->s.getV2()>overlimit.getUharm2()).collect(Collectors.toList());
List<DataHarmRateV> list = map1.get(time);
List<DataHarmRateV> l2 = list.stream().filter(s->s.getV2()>overlimit.getUharm2()).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(l2)){
v2++;
}
List<DataHarmRateVPO> l3 = list.stream().filter(s->s.getV3()>overlimit.getUharm3()).collect(Collectors.toList());
List<DataHarmRateV> l3 = list.stream().filter(s->s.getV3()>overlimit.getUharm3()).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(l3)){
v3++;
}
List<DataHarmRateVPO> l4 = list.stream().filter(s->s.getV4()>overlimit.getUharm4()).collect(Collectors.toList());
List<DataHarmRateV> l4 = list.stream().filter(s->s.getV4()>overlimit.getUharm4()).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(l4)){
v4++;
}
List<DataHarmRateVPO> l5 = list.stream().filter(s->s.getV5()>overlimit.getUharm5()).collect(Collectors.toList());
List<DataHarmRateV> l5 = list.stream().filter(s->s.getV5()>overlimit.getUharm5()).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(l5)){
v5++;
}
List<DataHarmRateVPO> l6 = list.stream().filter(s->s.getV6()>overlimit.getUharm6()).collect(Collectors.toList());
List<DataHarmRateV> l6 = list.stream().filter(s->s.getV6()>overlimit.getUharm6()).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(l6)){
v6++;
}
List<DataHarmRateVPO> l7 = list.stream().filter(s->s.getV7()>overlimit.getUharm7()).collect(Collectors.toList());
List<DataHarmRateV> l7 = list.stream().filter(s->s.getV7()>overlimit.getUharm7()).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(l7)){
v7++;
}
List<DataHarmRateVPO> l8 = list.stream().filter(s->s.getV8()>overlimit.getUharm8()).collect(Collectors.toList());
List<DataHarmRateV> l8 = list.stream().filter(s->s.getV8()>overlimit.getUharm8()).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(l8)){
v8++;
}
List<DataHarmRateVPO> l9 = list.stream().filter(s->s.getV9()>overlimit.getUharm9()).collect(Collectors.toList());
List<DataHarmRateV> l9 = list.stream().filter(s->s.getV9()>overlimit.getUharm9()).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(l9)){
v9++;
}
List<DataHarmRateVPO> l10 = list.stream().filter(s->s.getV10()>overlimit.getUharm10()).collect(Collectors.toList());
List<DataHarmRateV> l10 = list.stream().filter(s->s.getV10()>overlimit.getUharm10()).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(l10)){
v10++;
}
List<DataHarmRateVPO> l11 = list.stream().filter(s->s.getV11()>overlimit.getUharm11()).collect(Collectors.toList());
List<DataHarmRateV> l11 = list.stream().filter(s->s.getV11()>overlimit.getUharm11()).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(l11)){
v11++;
}
List<DataHarmRateVPO> l12 = list.stream().filter(s->s.getV12()>overlimit.getUharm12()).collect(Collectors.toList());
List<DataHarmRateV> l12 = list.stream().filter(s->s.getV12()>overlimit.getUharm12()).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(l12)){
v12++;
}
List<DataHarmRateVPO> l13 = list.stream().filter(s->s.getV13()>overlimit.getUharm13()).collect(Collectors.toList());
List<DataHarmRateV> l13 = list.stream().filter(s->s.getV13()>overlimit.getUharm13()).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(l13)){
v13++;
}
List<DataHarmRateVPO> l14 = list.stream().filter(s->s.getV14()>overlimit.getUharm14()).collect(Collectors.toList());
List<DataHarmRateV> l14 = list.stream().filter(s->s.getV14()>overlimit.getUharm14()).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(l14)){
v14++;
}
List<DataHarmRateVPO> l15 = list.stream().filter(s->s.getV15()>overlimit.getUharm15()).collect(Collectors.toList());
List<DataHarmRateV> l15 = list.stream().filter(s->s.getV15()>overlimit.getUharm15()).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(l15)){
v15++;
}
List<DataHarmRateVPO> l16 = list.stream().filter(s->s.getV16()>overlimit.getUharm16()).collect(Collectors.toList());
List<DataHarmRateV> l16 = list.stream().filter(s->s.getV16()>overlimit.getUharm16()).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(l16)){
v16++;
}
List<DataHarmRateVPO> l17 = list.stream().filter(s->s.getV17()>overlimit.getUharm17()).collect(Collectors.toList());
List<DataHarmRateV> l17 = list.stream().filter(s->s.getV17()>overlimit.getUharm17()).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(l17)){
v17++;
}
List<DataHarmRateVPO> l18 = list.stream().filter(s->s.getV18()>overlimit.getUharm18()).collect(Collectors.toList());
List<DataHarmRateV> l18 = list.stream().filter(s->s.getV18()>overlimit.getUharm18()).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(l18)){
v18++;
}
List<DataHarmRateVPO> l19 = list.stream().filter(s->s.getV19()>overlimit.getUharm19()).collect(Collectors.toList());
List<DataHarmRateV> l19 = list.stream().filter(s->s.getV19()>overlimit.getUharm19()).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(l19)){
v19++;
}
List<DataHarmRateVPO> l20 = list.stream().filter(s->s.getV20()>overlimit.getUharm20()).collect(Collectors.toList());
List<DataHarmRateV> l20 = list.stream().filter(s->s.getV20()>overlimit.getUharm20()).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(l20)){
v20++;
}
List<DataHarmRateVPO> l21 = list.stream().filter(s->s.getV21()>overlimit.getUharm21()).collect(Collectors.toList());
List<DataHarmRateV> l21 = list.stream().filter(s->s.getV21()>overlimit.getUharm21()).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(l21)){
v21++;
}
List<DataHarmRateVPO> l22 = list.stream().filter(s->s.getV22()>overlimit.getUharm22()).collect(Collectors.toList());
List<DataHarmRateV> l22 = list.stream().filter(s->s.getV22()>overlimit.getUharm22()).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(l22)){
v22++;
}
List<DataHarmRateVPO> l23 = list.stream().filter(s->s.getV23()>overlimit.getUharm23()).collect(Collectors.toList());
List<DataHarmRateV> l23 = list.stream().filter(s->s.getV23()>overlimit.getUharm23()).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(l23)){
v23++;
}
List<DataHarmRateVPO> l24 = list.stream().filter(s->s.getV24()>overlimit.getUharm24()).collect(Collectors.toList());
List<DataHarmRateV> l24 = list.stream().filter(s->s.getV24()>overlimit.getUharm24()).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(l24)){
v24++;
}
List<DataHarmRateVPO> l25 = list.stream().filter(s->s.getV25()>overlimit.getUharm25()).collect(Collectors.toList());
List<DataHarmRateV> l25 = list.stream().filter(s->s.getV25()>overlimit.getUharm25()).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(l25)){
v25++;
}
}
//2-25次谐波电流
for (Instant time:map2.keySet()) {
List<DataIPO> list = map2.get(time);
List<DataIPO> l2 = list.stream().filter(s->s.getI2()>overlimit.getIharm2()).collect(Collectors.toList());
List<DataI> list = map2.get(time);
List<DataI> l2 = list.stream().filter(s->s.getI2()>overlimit.getIharm2()).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(l2)){
i2++;
}
List<DataIPO> l3 = list.stream().filter(s->s.getI3()>overlimit.getIharm3()).collect(Collectors.toList());
List<DataI> l3 = list.stream().filter(s->s.getI3()>overlimit.getIharm3()).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(l3)){
i3++;
}
List<DataIPO> l4 = list.stream().filter(s->s.getI4()>overlimit.getIharm4()).collect(Collectors.toList());
List<DataI> l4 = list.stream().filter(s->s.getI4()>overlimit.getIharm4()).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(l4)){
i4++;
}
List<DataIPO> l5 = list.stream().filter(s->s.getI5()>overlimit.getIharm5()).collect(Collectors.toList());
List<DataI> l5 = list.stream().filter(s->s.getI5()>overlimit.getIharm5()).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(l5)){
i5++;
}
List<DataIPO> l6 = list.stream().filter(s->s.getI6()>overlimit.getIharm6()).collect(Collectors.toList());
List<DataI> l6 = list.stream().filter(s->s.getI6()>overlimit.getIharm6()).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(l6)){
i6++;
}
List<DataIPO> l7 = list.stream().filter(s->s.getI7()>overlimit.getIharm7()).collect(Collectors.toList());
List<DataI> l7 = list.stream().filter(s->s.getI7()>overlimit.getIharm7()).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(l7)){
i7++;
}
List<DataIPO> l8 = list.stream().filter(s->s.getI8()>overlimit.getIharm8()).collect(Collectors.toList());
List<DataI> l8 = list.stream().filter(s->s.getI8()>overlimit.getIharm8()).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(l8)){
i8++;
}
List<DataIPO> l9 = list.stream().filter(s->s.getI9()>overlimit.getIharm9()).collect(Collectors.toList());
List<DataI> l9 = list.stream().filter(s->s.getI9()>overlimit.getIharm9()).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(l9)){
i9++;
}
List<DataIPO> l10 = list.stream().filter(s->s.getI10()>overlimit.getIharm10()).collect(Collectors.toList());
List<DataI> l10 = list.stream().filter(s->s.getI10()>overlimit.getIharm10()).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(l10)){
i10++;
}
List<DataIPO> l11 = list.stream().filter(s->s.getI11()>overlimit.getIharm11()).collect(Collectors.toList());
List<DataI> l11 = list.stream().filter(s->s.getI11()>overlimit.getIharm11()).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(l11)){
i11++;
}
List<DataIPO> l12 = list.stream().filter(s->s.getI12()>overlimit.getIharm12()).collect(Collectors.toList());
List<DataI> l12 = list.stream().filter(s->s.getI12()>overlimit.getIharm12()).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(l12)){
i12++;
}
List<DataIPO> l13 = list.stream().filter(s->s.getI13()>overlimit.getIharm13()).collect(Collectors.toList());
List<DataI> l13 = list.stream().filter(s->s.getI13()>overlimit.getIharm13()).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(l13)){
i13++;
}
List<DataIPO> l14 = list.stream().filter(s->s.getI14()>overlimit.getIharm14()).collect(Collectors.toList());
List<DataI> l14 = list.stream().filter(s->s.getI14()>overlimit.getIharm14()).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(l14)){
i14++;
}
List<DataIPO> l15 = list.stream().filter(s->s.getI15()>overlimit.getIharm15()).collect(Collectors.toList());
List<DataI> l15 = list.stream().filter(s->s.getI15()>overlimit.getIharm15()).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(l15)){
i15++;
}
List<DataIPO> l16 = list.stream().filter(s->s.getI16()>overlimit.getIharm16()).collect(Collectors.toList());
List<DataI> l16 = list.stream().filter(s->s.getI16()>overlimit.getIharm16()).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(l16)){
i16++;
}
List<DataIPO> l17 = list.stream().filter(s->s.getI17()>overlimit.getIharm17()).collect(Collectors.toList());
List<DataI> l17 = list.stream().filter(s->s.getI17()>overlimit.getIharm17()).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(l17)){
i17++;
}
List<DataIPO> l18 = list.stream().filter(s->s.getI18()>overlimit.getIharm18()).collect(Collectors.toList());
List<DataI> l18 = list.stream().filter(s->s.getI18()>overlimit.getIharm18()).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(l18)){
i18++;
}
List<DataIPO> l19 = list.stream().filter(s->s.getI19()>overlimit.getIharm19()).collect(Collectors.toList());
List<DataI> l19 = list.stream().filter(s->s.getI19()>overlimit.getIharm19()).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(l19)){
i19++;
}
List<DataIPO> l20 = list.stream().filter(s->s.getI20()>overlimit.getIharm20()).collect(Collectors.toList());
List<DataI> l20 = list.stream().filter(s->s.getI20()>overlimit.getIharm20()).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(l20)){
i20++;
}
List<DataIPO> l21 = list.stream().filter(s->s.getI21()>overlimit.getIharm21()).collect(Collectors.toList());
List<DataI> l21 = list.stream().filter(s->s.getI21()>overlimit.getIharm21()).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(l21)){
i21++;
}
List<DataIPO> l22 = list.stream().filter(s->s.getI22()>overlimit.getIharm22()).collect(Collectors.toList());
List<DataI> l22 = list.stream().filter(s->s.getI22()>overlimit.getIharm22()).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(l22)){
i22++;
}
List<DataIPO> l23 = list.stream().filter(s->s.getI23()>overlimit.getIharm23()).collect(Collectors.toList());
List<DataI> l23 = list.stream().filter(s->s.getI23()>overlimit.getIharm23()).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(l23)){
i23++;
}
List<DataIPO> l24 = list.stream().filter(s->s.getI24()>overlimit.getIharm24()).collect(Collectors.toList());
List<DataI> l24 = list.stream().filter(s->s.getI24()>overlimit.getIharm24()).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(l24)){
i24++;
}
List<DataIPO> l25 = list.stream().filter(s->s.getI25()>overlimit.getIharm25()).collect(Collectors.toList());
List<DataI> l25 = list.stream().filter(s->s.getI25()>overlimit.getIharm25()).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(l25)){
i25++;
}
}
//0.5-15.5次间谐波电压含有率
for (Instant time:map3.keySet()) {
List<DataInHarmVPO> list3 = map3.get(time);
List<DataInHarmVPO> l2 = list3.stream().filter(s->s.getV1()>overlimit.getInuharm1()).collect(Collectors.toList());
List<DataInHarmV> list3 = map3.get(time);
List<DataInHarmV> l2 = list3.stream().filter(s->s.getV1()>overlimit.getInuharm1()).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(l2)){
uHarm1++;
}
List<DataInHarmVPO> l3 = list3.stream().filter(s->s.getV2()>overlimit.getInuharm2()).collect(Collectors.toList());
List<DataInHarmV> l3 = list3.stream().filter(s->s.getV2()>overlimit.getInuharm2()).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(l3)){
uHarm2++;
}
List<DataInHarmVPO> l4 = list3.stream().filter(s->s.getV3()>overlimit.getInuharm3()).collect(Collectors.toList());
List<DataInHarmV> l4 = list3.stream().filter(s->s.getV3()>overlimit.getInuharm3()).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(l4)){
uHarm3++;
}
List<DataInHarmVPO> l5 = list3.stream().filter(s->s.getV4()>overlimit.getInuharm4()).collect(Collectors.toList());
List<DataInHarmV> l5 = list3.stream().filter(s->s.getV4()>overlimit.getInuharm4()).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(l5)){
uHarm4++;
}
List<DataInHarmVPO> l6 = list3.stream().filter(s->s.getV5()>overlimit.getInuharm5()).collect(Collectors.toList());
List<DataInHarmV> l6 = list3.stream().filter(s->s.getV5()>overlimit.getInuharm5()).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(l6)){
uHarm5++;
}
List<DataInHarmVPO> l7 = list3.stream().filter(s->s.getV6()>overlimit.getInuharm6()).collect(Collectors.toList());
List<DataInHarmV> l7 = list3.stream().filter(s->s.getV6()>overlimit.getInuharm6()).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(l7)){
uHarm6++;
}
List<DataInHarmVPO> l8 = list3.stream().filter(s->s.getV7()>overlimit.getInuharm7()).collect(Collectors.toList());
List<DataInHarmV> l8 = list3.stream().filter(s->s.getV7()>overlimit.getInuharm7()).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(l8)){
uHarm7++;
}
List<DataInHarmVPO> l9 = list3.stream().filter(s->s.getV8()>overlimit.getInuharm8()).collect(Collectors.toList());
List<DataInHarmV> l9 = list3.stream().filter(s->s.getV8()>overlimit.getInuharm8()).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(l9)){
uHarm8++;
}
List<DataInHarmVPO> l10 = list3.stream().filter(s->s.getV9()>overlimit.getInuharm9()).collect(Collectors.toList());
List<DataInHarmV> l10 = list3.stream().filter(s->s.getV9()>overlimit.getInuharm9()).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(l10)){
uHarm9++;
}
List<DataInHarmVPO> l11 = list3.stream().filter(s->s.getV10()>overlimit.getInuharm10()).collect(Collectors.toList());
List<DataInHarmV> l11 = list3.stream().filter(s->s.getV10()>overlimit.getInuharm10()).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(l11)){
uHarm10++;
}
List<DataInHarmVPO> l12 = list3.stream().filter(s->s.getV11()>overlimit.getInuharm11()).collect(Collectors.toList());
List<DataInHarmV> l12 = list3.stream().filter(s->s.getV11()>overlimit.getInuharm11()).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(l12)){
uHarm11++;
}
List<DataInHarmVPO> l13 = list3.stream().filter(s->s.getV12()>overlimit.getInuharm12()).collect(Collectors.toList());
List<DataInHarmV> l13 = list3.stream().filter(s->s.getV12()>overlimit.getInuharm12()).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(l13)){
uHarm12++;
}
List<DataInHarmVPO> l14 = list3.stream().filter(s->s.getV13()>overlimit.getInuharm13()).collect(Collectors.toList());
List<DataInHarmV> l14 = list3.stream().filter(s->s.getV13()>overlimit.getInuharm13()).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(l14)){
uHarm13++;
}
List<DataInHarmVPO> l15 = list3.stream().filter(s->s.getV14()>overlimit.getInuharm14()).collect(Collectors.toList());
List<DataInHarmV> l15 = list3.stream().filter(s->s.getV14()>overlimit.getInuharm14()).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(l15)){
uHarm14++;
}
List<DataInHarmVPO> l16 = list3.stream().filter(s->s.getV15()>overlimit.getInuharm15()).collect(Collectors.toList());
List<DataInHarmV> l16 = list3.stream().filter(s->s.getV15()>overlimit.getInuharm15()).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(l16)){
uHarm15++;
}
List<DataInHarmVPO> l17 = list3.stream().filter(s->s.getV16()>overlimit.getInuharm16()).collect(Collectors.toList());
List<DataInHarmV> l17 = list3.stream().filter(s->s.getV16()>overlimit.getInuharm16()).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(l17)){
uHarm16++;
}
}
//电压总谐波畸变率
for (Instant time:map4.keySet()) {
List<DataVPO> list = map4.get(time);
List<DataVPO> l = list.stream().filter(s->s.getVThd()>overlimit.getUaberrance()).collect(Collectors.toList());
List<DataV> list = map4.get(time);
List<DataV> l = list.stream().filter(s->s.getVThd()>overlimit.getUaberrance()).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(l)){
thd++;
}
}
//三相电压不平衡度
for (Instant time:map5.keySet()) {
List<DataVPO> list = map5.get(time);
List<DataVPO> l = list.stream().filter(s->s.getVUnbalance()>overlimit.getUbalance()).collect(Collectors.toList());
List<DataV> list = map5.get(time);
List<DataV> l = list.stream().filter(s->s.getVUnbalance()>overlimit.getUbalance()).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(l)){
uAberrance++;
}
}
//负序电流
for (Instant time:map6.keySet()) {
List<DataIPO> list = map6.get(time);
List<DataIPO> l = list.stream().filter(s->s.getINeg()>overlimit.getINeg()).collect(Collectors.toList());
List<DataI> list = map6.get(time);
List<DataI> l = list.stream().filter(s->s.getINeg()>overlimit.getINeg()).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(l)){
iNeg++;
}
}
//频率偏差
for (Instant time:map7.keySet()) {
List<DataVPO> list = map7.get(time);
List<DataVPO> l = list.stream().filter(s->s.getFreqDev()>overlimit.getFreqDev()).collect(Collectors.toList());
List<DataV> list = map7.get(time);
List<DataV> l = list.stream().filter(s->s.getFreqDev()>overlimit.getFreqDev()).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(l)){
freqDev++;
}
}
//电压上偏差、电压下偏差
for (Instant time:map8.keySet()) {
List<DataVPO> list = map8.get(time);
List<DataVPO> l1 = list.stream().filter(s->s.getVlDev()>=0&&s.getVlDev()>overlimit.getVoltageDev()).collect(Collectors.toList());
List<DataVPO> l2 = list.stream().filter(s->s.getVlDev()<0&&Math.abs(s.getVlDev())>Math.abs(overlimit.getUvoltageDev())).collect(Collectors.toList());
List<DataV> list = map8.get(time);
List<DataV> l1 = list.stream().filter(s->s.getVlDev()>=0&&s.getVlDev()>overlimit.getVoltageDev()).collect(Collectors.toList());
List<DataV> l2 = list.stream().filter(s->s.getVlDev()<0&&Math.abs(s.getVlDev())>Math.abs(overlimit.getUvoltageDev())).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(l1) || !CollectionUtils.isEmpty(l2)){
uDev++;
}
}
//长时间闪变
for (Instant time:map9.keySet()) {
List<DataPltPO> list = map9.get(time);
List<DataPltPO> l = list.stream().filter(s->s.getPlt()>overlimit.getFlicker()).collect(Collectors.toList());
List<DataPlt> list = map9.get(time);
List<DataPlt> l = list.stream().filter(s->s.getPlt()>overlimit.getFlicker()).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(l)){
flicker++;
}

View File

@@ -7,7 +7,7 @@ import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
import com.njcn.harmonic.pojo.po.LimitRate;
import com.njcn.harmonic.pojo.po.day.RStatLimitRateDPO;
import com.njcn.harmonic.pojo.po.day.RStatLimitTargetDPO;
import com.njcn.influxdb.utils.InfluxDbUtils;
import com.njcn.influx.deprecated.InfluxDbUtils;
import com.njcn.prepare.harmonic.mapper.mysql.day.RStatLimitTargetDMapper;
import com.njcn.prepare.harmonic.pojo.param.LineParam;
import com.njcn.prepare.harmonic.service.mysql.day.IRStatLimitRateDService;

View File

@@ -4,18 +4,12 @@ import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.TimeInterval;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.njcn.common.pojo.dto.SimpleDTO;
import com.njcn.common.pojo.enums.common.ServerEnum;
import com.njcn.device.pq.api.GeneralDeviceInfoClient;
import com.njcn.device.pq.api.LineFeignClient;
import com.njcn.device.pq.api.OverLimitClient;
import com.njcn.device.pq.pojo.dto.GeneralDeviceDTO;
import com.njcn.device.pq.pojo.param.DeviceInfoParam;
import com.njcn.device.biz.pojo.po.Overlimit;
import com.njcn.harmonic.pojo.po.RStatDataVD;
import com.njcn.harmonic.pojo.po.day.*;
import com.njcn.influxdb.param.InfluxDBPublicParam;
import com.njcn.influxdb.utils.InfluxDbUtils;
import com.njcn.influx.deprecated.InfluxDBPublicParam;
import com.njcn.influx.deprecated.InfluxDbUtils;
import com.njcn.prepare.harmonic.mapper.mysql.day.*;
import com.njcn.prepare.harmonic.mapper.mysql.line.AbnormalMapper;
import com.njcn.prepare.harmonic.pojo.mysql.po.line.MpSurplusAbnormalD;
@@ -25,7 +19,6 @@ import com.njcn.user.api.DeptFeignClient;
import com.njcn.user.pojo.po.Dept;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;

View File

@@ -7,12 +7,13 @@ import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
import com.njcn.device.pq.api.LineFeignClient;
import com.njcn.device.pq.pojo.po.RStatOnlinerateD;
import com.njcn.energy.pojo.constant.ModelState;
import com.njcn.influxdb.utils.InfluxDbUtils;
import com.njcn.influx.deprecated.InfluxDBPublicParam;
import com.njcn.influx.deprecated.InfluxDbUtils;
import com.njcn.influx.pojo.po.PqsCommunicate;
import com.njcn.prepare.harmonic.mapper.mysql.day.RStatOnlineRateDMapper;
import com.njcn.prepare.harmonic.pojo.dto.OnLineRateDTO;
import com.njcn.prepare.harmonic.pojo.param.LineParam;
import com.njcn.prepare.harmonic.pojo.influxdb.po.PqsCommunicatePO;
import com.njcn.prepare.harmonic.service.mysql.line.OnlineRateService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@@ -31,7 +32,6 @@ import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.concurrent.TimeUnit;
import static com.njcn.influxdb.param.InfluxDBPublicParam.DAY_MINUTE;
/**
* 生成在线率数据
@@ -56,14 +56,14 @@ public class OnlineRateServiceImpl extends MppServiceImpl<RStatOnlineRateDMapper
if (CollUtil.isEmpty(lineParam.getLineIds())){
lineIdList = lineFeignClient.getDeviceList().getData();
}
List<PqsCommunicatePO> outCommunicateData = new ArrayList<>();
List<PqsCommunicate> outCommunicateData = new ArrayList<>();
for (String lineId : lineIdList){
List<PqsCommunicatePO> communicateData = getCommunicateData(lineId);
List<PqsCommunicate> communicateData = getCommunicateData(lineId);
outCommunicateData.addAll(communicateData);
}
List<String> records = new ArrayList<>();
Date dateOut = DateUtil.parse(lineParam.getDataDate());
for (PqsCommunicatePO pqsCommunicate : outCommunicateData){
for (PqsCommunicate pqsCommunicate : outCommunicateData){
Map<String, String> tags = new HashMap<>();
Map<String, Object> fields = new HashMap<>();
Date newDate = Date.from(pqsCommunicate.getTime());
@@ -90,14 +90,14 @@ public class OnlineRateServiceImpl extends MppServiceImpl<RStatOnlineRateDMapper
if (CollUtil.isEmpty(lineParam.getLineIds())){
lineIdList = lineFeignClient.getDeviceList().getData();
}
List<PqsCommunicatePO> outCommunicateData = new ArrayList<>();
List<PqsCommunicate> outCommunicateData = new ArrayList<>();
for (String lineId : lineIdList){
List<PqsCommunicatePO> communicateData = getCommunicateData(lineId);
List<PqsCommunicate> communicateData = getCommunicateData(lineId);
outCommunicateData.addAll(communicateData);
}
List<RStatOnlinerateD> list = new ArrayList<>();
Date dateOut = DateUtil.parse(time);
for (PqsCommunicatePO pqsCommunicate : outCommunicateData){
for (PqsCommunicate pqsCommunicate : outCommunicateData){
RStatOnlinerateD onlineRateDpo = new RStatOnlinerateD();
Date newDate = Date.from(pqsCommunicate.getTime());
OnLineRateDTO onLineRate = onLineMinute(newDate,dateOut,pqsCommunicate.getType(),pqsCommunicate.getDevId(),time);
@@ -113,25 +113,25 @@ public class OnlineRateServiceImpl extends MppServiceImpl<RStatOnlineRateDMapper
/**
* 获取pqs_communicate数据
*/
private List<PqsCommunicatePO> getCommunicateData(String lineId){
private List<PqsCommunicate> getCommunicateData(String lineId){
QueryResult sqlResult = influxDbUtils.query("SELECT * FROM pqs_communicate where dev_id = '" + lineId +"' order by time desc limit 1 tz('Asia/Shanghai')");
InfluxDBResultMapper resultMapper = new InfluxDBResultMapper();
return resultMapper.toPOJO(sqlResult, PqsCommunicatePO.class);
return resultMapper.toPOJO(sqlResult, PqsCommunicate.class);
}
/**
* 获取范围时间内的pqs_communicate数据
*/
private List<PqsCommunicatePO> getCommunicateData(String lineId, String date){
private List<PqsCommunicate> getCommunicateData(String lineId, String date){
QueryResult sqlResult = influxDbUtils.query("SELECT * FROM pqs_communicate where time >= '" + date + " 00:00:00' and time <= '" + date + " 23:59:59' and dev_id = '" + lineId +"' order by time asc tz('Asia/Shanghai')");
InfluxDBResultMapper resultMapper = new InfluxDBResultMapper();
return resultMapper.toPOJO(sqlResult, PqsCommunicatePO.class);
return resultMapper.toPOJO(sqlResult, PqsCommunicate.class);
}
private List<PqsCommunicatePO> getCommunicateDataOld(String lineId, String date){
private List<PqsCommunicate> 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);
return resultMapper.toPOJO(sqlResult, PqsCommunicate.class);
}
/**
@@ -151,12 +151,12 @@ public class OnlineRateServiceImpl extends MppServiceImpl<RStatOnlineRateDMapper
minute = processData(newDate, date, null, lineId, dateStr);
}else {
if (ModelState.online.equals(type)){
minute = DAY_MINUTE;
minute = InfluxDBPublicParam.DAY_MINUTE;
}
}
}
onLineRate.setOnLineMinute(minute);
onLineRate.setOffLineMinute(DAY_MINUTE - minute);
onLineRate.setOffLineMinute(InfluxDBPublicParam.DAY_MINUTE - minute);
BigDecimal onLine = BigDecimal.valueOf(onLineRate.getOnLineMinute());
BigDecimal offLine = BigDecimal.valueOf(onLineRate.getOffLineMinute());
double rate = onLine.divide(onLine.add(offLine),4, RoundingMode.HALF_UP).doubleValue();
@@ -166,7 +166,7 @@ public class OnlineRateServiceImpl extends MppServiceImpl<RStatOnlineRateDMapper
private Integer processData(Date newDate, Date date, Integer type,String lineId,String dateStr){
int minute = 0;
List<PqsCommunicatePO> communicateData = getCommunicateData(lineId,dateStr);
List<PqsCommunicate> communicateData = getCommunicateData(lineId,dateStr);
/*当前统计时间内存在多条数据*/
if (communicateData.size() > 1){
Date lastTime = null;
@@ -189,7 +189,7 @@ public class OnlineRateServiceImpl extends MppServiceImpl<RStatOnlineRateDMapper
lastTime = Date.from(communicateData.get(i).getTime());
}
if (ModelState.online.equals(communicateData.get(communicateData.size()-1).getType())){
minute = DAY_MINUTE - (int)offlineTime;
minute = InfluxDBPublicParam.DAY_MINUTE - (int)offlineTime;
}else {
minute = (int)onlineTime;
}
@@ -198,13 +198,13 @@ public class OnlineRateServiceImpl extends MppServiceImpl<RStatOnlineRateDMapper
/*当前统计时间内仅有一条数据*/
long differ = DateUtil.between(date,newDate,DateUnit.MINUTE);
if (ModelState.online.equals(type)){
minute = DAY_MINUTE - (int)differ;
minute = InfluxDBPublicParam.DAY_MINUTE - (int)differ;
}
}else {
List<PqsCommunicatePO> communicateDataOld = getCommunicateDataOld(lineId,dateStr);
List<PqsCommunicate> communicateDataOld = getCommunicateDataOld(lineId,dateStr);
if (communicateDataOld.size() > 0){
if (ModelState.online.equals(communicateDataOld.get(0).getType())){
minute = DAY_MINUTE;
minute = InfluxDBPublicParam.DAY_MINUTE;
}
}
}

View File

@@ -8,11 +8,12 @@ import com.njcn.device.biz.commApi.CommLineClient;
import com.njcn.device.biz.pojo.dto.LineDTO;
import com.njcn.device.pq.constant.Param;
import com.njcn.device.pq.pojo.po.PmsAbnormalRules;
import com.njcn.device.pq.pojo.vo.LineDetailDataVO;
import com.njcn.influx.pojo.po.DataFlicker;
import com.njcn.prepare.harmonic.mapper.mysql.line.PmsAbnormalRulesMapper;
import com.njcn.prepare.harmonic.mapper.mysql.line.RMpMonitorEvaluateDMapper;
import com.njcn.prepare.harmonic.pojo.dto.DataVFiveItemDTO;
import com.njcn.prepare.harmonic.pojo.mysql.RMpMonitorEvaluateDPO;
import com.njcn.prepare.harmonic.pojo.po.DataFlicker;
import com.njcn.prepare.harmonic.service.influxdb.DataIntegrityRateInfluxService;
import com.njcn.prepare.harmonic.service.influxdb.DataVInfluxdbService;
import com.njcn.prepare.harmonic.service.mysql.line.RMpMonitorEvaluateDService;

View File

@@ -21,9 +21,9 @@ import com.njcn.harmonic.pojo.dto.ReportTemplateDTO;
import com.njcn.harmonic.pojo.po.ExcelRpt;
import com.njcn.harmonic.pojo.po.ExcelRptTemp;
import com.njcn.harmonic.pojo.po.SysDeptTemp;
import com.njcn.influxdb.param.InfluxDBSqlConstant;
import com.njcn.influxdb.param.InfluxDBTableConstant;
import com.njcn.influxdb.utils.InfluxDbUtils;
import com.njcn.influx.deprecated.InfluxDBSqlConstant;
import com.njcn.influx.deprecated.InfluxDbUtils;
import com.njcn.influx.pojo.constant.InfluxDBTableConstant;
import com.njcn.oss.constant.OssPath;
import com.njcn.oss.utils.FileStorageUtil;
import com.njcn.prepare.harmonic.constant.AlgorithmParam;