代码提交

This commit is contained in:
huangzj
2023-09-26 15:22:12 +08:00
parent a220f48cc9
commit 2f8149e709
5 changed files with 65 additions and 14 deletions

View File

@@ -94,4 +94,18 @@ public class EventDetailVO {
private Integer status; private Integer status;
private List<EventDataSetDTO> dataSet; private List<EventDataSetDTO> dataSet;
/*暂态深度*/
private String evtParamVVaDepth;
/*持续时间深度*/
private String evtParamTm;
/*相别*/
private String evtParamPhase;
/*位置*/
private String evtParamPosition;
} }

View File

@@ -43,7 +43,7 @@
<dependency> <dependency>
<groupId>com.njcn</groupId> <groupId>com.njcn</groupId>
<artifactId>pqs-influx</artifactId> <artifactId>pqs-influx</artifactId>
<version>0.0.1-SNAPSHOT</version> <version>${project.version}</version>
</dependency> </dependency>
<dependency> <dependency>
@@ -98,12 +98,6 @@
<version>1.0.0</version> <version>1.0.0</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency>
<groupId>com.njcn</groupId>
<artifactId>common-influxDB</artifactId>
<version>${project.version}</version>
<scope>compile</scope>
</dependency>
<dependency> <dependency>
<groupId>com.njcn</groupId> <groupId>com.njcn</groupId>
<artifactId>system-api</artifactId> <artifactId>system-api</artifactId>

View File

@@ -105,6 +105,7 @@ public class CsEventPOServiceImpl extends ServiceImpl<CsEventPOMapper, CsEventPO
eventDataSetDTOS.add(eventDataSetDTO); eventDataSetDTOS.add(eventDataSetDTO);
} }
temp.setDataSet(eventDataSetDTOS); temp.setDataSet(eventDataSetDTOS);
}); });
return list; return list;

View File

@@ -118,15 +118,59 @@ public class CsEventUserPOServiceImpl extends ServiceImpl<CsEventUserPOMapper, C
BeanUtils.copyProperties(eleEvtParm,eventDataSetDTO); BeanUtils.copyProperties(eleEvtParm,eventDataSetDTO);
EventDataSetDTO evtData = evtDataService.getEventDataSet("evt_data", temp.getId(), eleEvtParm.getName()); EventDataSetDTO evtData = evtDataService.getEventDataSet("evt_data", temp.getId(), eleEvtParm.getName());
if (evtData == null) { if (evtData == null) {
eventDataSetDTO.setValue("3.1415926"); eventDataSetDTO.setValue("-");
}else { }else {
eventDataSetDTO.setValue(Optional.ofNullable(evtData.getValue()).orElse("3.1415926")); eventDataSetDTO.setValue(Optional.ofNullable(evtData.getValue()).orElse("-"));
} }
eventDataSetDTOS.add(eventDataSetDTO); eventDataSetDTOS.add(eventDataSetDTO);
} }
temp.setDataSet(eventDataSetDTOS); temp.setDataSet(eventDataSetDTOS);
List<EventDataSetDTO> evtParamVVaDepth = eventDataSetDTOS.stream().
filter(dataSetDTO -> Objects.equals(dataSetDTO.getName(), "Evt_Param_VVaDepth")).
collect(Collectors.toList());
if(CollectionUtil.isEmpty(evtParamVVaDepth)){
temp.setEvtParamVVaDepth("-");
}else {
temp.setEvtParamVVaDepth(evtParamVVaDepth.get(0).getValue()+(Objects.isNull(evtParamVVaDepth.get(0).getUnit())?"":evtParamVVaDepth.get(0).getUnit()));
}
List<EventDataSetDTO> evtParamPosition = eventDataSetDTOS.stream().
filter(dataSetDTO -> Objects.equals(dataSetDTO.getName(), "Evt_Param_Position")).
collect(Collectors.toList());
if(CollectionUtil.isEmpty(evtParamPosition)){
temp.setEvtParamPosition("-");
}else {
temp.setEvtParamPosition(evtParamPosition.get(0).getValue()+(Objects.isNull(evtParamPosition.get(0).getUnit())?"":evtParamPosition.get(0).getUnit()));
}
List<EventDataSetDTO> evtParamTm = eventDataSetDTOS.stream().
filter(dataSetDTO -> Objects.equals(dataSetDTO.getName(), "Evt_Param_Tm")).
collect(Collectors.toList());
if(CollectionUtil.isEmpty(evtParamTm)){
temp.setEvtParamTm("-");
}else {
temp.setEvtParamTm(evtParamTm.get(0).getValue()+(Objects.isNull(evtParamTm.get(0).getUnit())?"":evtParamTm.get(0).getUnit()));
}
List<EventDataSetDTO> evtParamPhase = eventDataSetDTOS.stream().
filter(dataSetDTO -> Objects.equals(dataSetDTO.getName(), "Evt_Param_Phase")).
collect(Collectors.toList());
if(CollectionUtil.isEmpty(evtParamPhase)){
temp.setEvtParamPhase("-");
}else {
temp.setEvtParamPhase(evtParamPhase.get(0).getValue()+(Objects.isNull(evtParamPhase.get(0).getUnit())?"":evtParamPhase.get(0).getUnit()));
}
}); });
} }

View File

@@ -12,14 +12,14 @@ import com.njcn.csharmonic.param.FrequencyStatisticalQueryParam;
import com.njcn.csharmonic.param.ThdDataQueryParm; import com.njcn.csharmonic.param.ThdDataQueryParm;
import com.njcn.csharmonic.pojo.vo.ThdDataVO; import com.njcn.csharmonic.pojo.vo.ThdDataVO;
import com.njcn.csharmonic.service.StableDataService; import com.njcn.csharmonic.service.StableDataService;
import com.njcn.influx.deprecated.InfluxDBPublicParam;
import com.njcn.influx.pojo.dto.StatisticalDataDTO; import com.njcn.influx.pojo.dto.StatisticalDataDTO;
import com.njcn.influx.pojo.po.HarmonicRatioData; import com.njcn.influx.pojo.po.HarmonicRatioData;
import com.njcn.influx.pojo.po.PowerQualityData; import com.njcn.influx.pojo.po.PowerQualityData;
import com.njcn.influx.service.CommonService; import com.njcn.influx.service.CommonService;
import com.njcn.influx.service.HaronicRatioService; import com.njcn.influx.service.HaronicRatioService;
import com.njcn.influx.service.PowerQualityService; import com.njcn.influx.service.PowerQualityService;
import com.njcn.influxdb.param.InfluxDBPublicParam; import com.njcn.influx.utils.InfluxDbUtils;
import com.njcn.influxdb.utils.InfluxDbUtils;
import com.njcn.system.api.CsStatisticalSetFeignClient; import com.njcn.system.api.CsStatisticalSetFeignClient;
import com.njcn.system.api.DicDataFeignClient; import com.njcn.system.api.DicDataFeignClient;
import com.njcn.system.api.EpdFeignClient; import com.njcn.system.api.EpdFeignClient;
@@ -28,11 +28,9 @@ import com.njcn.system.pojo.po.EleEpdPqd;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.influxdb.dto.QueryResult; import org.influxdb.dto.QueryResult;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.DecimalFormat; import java.text.DecimalFormat;
import java.time.ZoneId; import java.time.ZoneId;
import java.util.ArrayList; import java.util.ArrayList;