添加接线方式

This commit is contained in:
xy
2024-12-02 19:04:54 +08:00
parent 98e880b68d
commit 8e4adc58d4
4 changed files with 42 additions and 32 deletions

View File

@@ -108,9 +108,7 @@ public class DataServiceImpl implements IDataService {
vo.setId(item2.getId());
vo.setName(item2.getName());
StatisticalDataDTO statisticalDataDTO = commonService.getLineRtData(lineId,influxDbParamUtil.getTableNameByClassId(item2.getClassId()),item2.getName(),item2.getPhase(),"avg",influxDbParamUtil.getClDidByLineId(lineId));
if (Objects.isNull(statisticalDataDTO)) {
vo.setAvgValue(3.14159);
} else {
if (Objects.nonNull(statisticalDataDTO)) {
vo.setTime(statisticalDataDTO.getTime());
vo.setAvgValue(statisticalDataDTO.getValue());
}
@@ -119,28 +117,36 @@ public class DataServiceImpl implements IDataService {
vo.setSort(item2.getSort());
if (Objects.equals("Primary",dataLevel)) {
if (Objects.equals("Primary",csDataSetLevel)) {
vo.setAvgValue(Double.valueOf(df.format(statisticalDataDTO.getValue())));
vo.setAvgValue(Objects.isNull(statisticalDataDTO) ? 3.14159 : Double.parseDouble(df.format(statisticalDataDTO.getValue())));
unit = item2.getUnit();
} else {
if (HarmonicConstant.POWER_LIST.contains(item2.getShowName())) {
re = DataChangeUtil.secondaryToPrimary(item2.getPrimaryFormula(), statisticalDataDTO.getValue(), pt, ct) / 1000;
vo.setAvgValue(Double.valueOf(df.format(re)));
if (Objects.isNull(statisticalDataDTO)) {
vo.setAvgValue(3.14159);
} else {
re = DataChangeUtil.secondaryToPrimary(item2.getPrimaryFormula(), statisticalDataDTO.getValue(), pt, ct) / 1000;
vo.setAvgValue(Double.valueOf(df.format(re)));
}
unit = "k" + item2.getUnit();
} else {
vo.setAvgValue(Double.valueOf(df.format(statisticalDataDTO.getValue())));
vo.setAvgValue(Objects.isNull(statisticalDataDTO) ? 3.14159 : Double.parseDouble(df.format(statisticalDataDTO.getValue())));
unit = item2.getUnit();
}
}
} else {
if (Objects.equals("Primary",csDataSetLevel)) {
if (HarmonicConstant.POWER_LIST.contains(item2.getShowName())) {
re = DataChangeUtil.primaryToSecondary(item2.getPrimaryFormula(), statisticalDataDTO.getValue(), pt, ct);
vo.setAvgValue(Double.valueOf(df.format(re)));
if (Objects.isNull(statisticalDataDTO)) {
vo.setAvgValue(3.14159);
} else {
re = DataChangeUtil.primaryToSecondary(item2.getPrimaryFormula(), statisticalDataDTO.getValue(), pt, ct);
vo.setAvgValue(Double.valueOf(df.format(re)));
}
} else {
vo.setAvgValue(Double.valueOf(df.format(statisticalDataDTO.getValue())));
vo.setAvgValue(Objects.isNull(statisticalDataDTO) ? 3.14159 : Double.parseDouble(df.format(statisticalDataDTO.getValue())));
}
} else {
vo.setAvgValue(Double.valueOf(df.format(statisticalDataDTO.getValue())));
vo.setAvgValue(Objects.isNull(statisticalDataDTO) ? 3.14159 : Double.parseDouble(df.format(statisticalDataDTO.getValue())));
}
unit = item2.getUnit();
}
@@ -159,8 +165,12 @@ public class DataServiceImpl implements IDataService {
vo.setId(item2.getId());
vo.setName(item2.getName().concat("_").concat(Integer.toString(i)));
StatisticalDataDTO statisticalDataDTO = commonService.getLineRtData(lineId,influxDbParamUtil.getTableNameByClassId(item2.getClassId()),item2.getName().concat("_").concat(Integer.toString(i)),item2.getPhase(),"avg",influxDbParamUtil.getClDidByLineId(lineId));
vo.setTime(statisticalDataDTO.getTime());
vo.setAvgValue(Double.valueOf(df.format(statisticalDataDTO.getValue())));
if (Objects.isNull(statisticalDataDTO)) {
vo.setAvgValue(3.14159);
} else {
vo.setTime(statisticalDataDTO.getTime());
vo.setAvgValue(Double.valueOf(df.format(statisticalDataDTO.getValue())));
}
vo.setPhase(item2.getPhase());
vo.setOtherName(i + "" + "(" + item2.getUnit() + ")");
vo.setSort(item2.getSort());
@@ -178,8 +188,12 @@ public class DataServiceImpl implements IDataService {
vo.setId(item2.getId());
vo.setName(item2.getName().concat("_").concat(Integer.toString(i)));
StatisticalDataDTO statisticalDataDTO = commonService.getLineRtData(lineId,influxDbParamUtil.getTableNameByClassId(item2.getClassId()),item2.getName().concat("_").concat(Integer.toString(i)),item2.getPhase(),"avg",influxDbParamUtil.getClDidByLineId(lineId));
vo.setTime(statisticalDataDTO.getTime());
vo.setAvgValue(Double.valueOf(df.format(statisticalDataDTO.getValue())));
if (Objects.isNull(statisticalDataDTO)) {
vo.setAvgValue(3.14159);
} else {
vo.setTime(statisticalDataDTO.getTime());
vo.setAvgValue(Double.valueOf(df.format(statisticalDataDTO.getValue())));
}
vo.setPhase(item2.getPhase());
vo.setOtherName((i-0.5) + "" + "(" + item2.getUnit() + ")");
vo.setSort(item2.getSort());