暂态代码调整
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package com.njcn.event.pojo.po;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.datatype.jsr310.ser.InstantSerializer;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
@@ -28,8 +29,8 @@ public class EventDetail {
|
||||
|
||||
@Column(name = "time")
|
||||
@ApiModelProperty(value = "开始时间")
|
||||
@JsonSerialize(using = InstantSerializer.class)
|
||||
private Instant startTime;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss.SSS",timezone = "GMT+8")
|
||||
private LocalDateTime startTime;
|
||||
|
||||
@Column(name = "event_describe")
|
||||
@ApiModelProperty(value = "事件描述")
|
||||
|
||||
@@ -86,7 +86,7 @@ public class RmpEventDetailPO implements Serializable {
|
||||
|
||||
@ApiModelProperty(value = "开始时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss.SSS",timezone = "GMT+8")
|
||||
private String startTime;
|
||||
private LocalDateTime startTime;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "持续时间,单位秒")
|
||||
|
||||
@@ -6,6 +6,7 @@ import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
@@ -73,7 +74,7 @@ public class RmpEventDetailVO implements Serializable {
|
||||
*/
|
||||
@ApiModelProperty(name = "startTime",value = "开始时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss.SSS",timezone = "GMT+8")
|
||||
private Date startTime;
|
||||
private LocalDateTime startTime;
|
||||
|
||||
/**
|
||||
* 持续时间
|
||||
|
||||
@@ -16,6 +16,8 @@ import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.time.Instant;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZoneId;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.function.BiFunction;
|
||||
@@ -155,8 +157,9 @@ public class PqsEventDetailQuery extends QueryBuilder {
|
||||
* @return 数据
|
||||
*/
|
||||
public static BiFunction<DateTime, DateTime, List<EventDetail>> getBetweenTimeEventDetailList(List<EventDetail> eventDetailList) {
|
||||
ZoneId zone = ZoneId.systemDefault();
|
||||
return (beginTime, endTime) -> eventDetailList.stream().filter(eventDetail -> {
|
||||
Instant timeId = eventDetail.getStartTime();
|
||||
Instant timeId = eventDetail.getStartTime().atZone(zone).toInstant();
|
||||
return timeId.isAfter(beginTime.toInstant()) && timeId.isBefore(endTime.toInstant());
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@@ -36,6 +36,7 @@ import java.text.SimpleDateFormat;
|
||||
import java.time.Instant;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZoneId;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
@@ -332,7 +333,6 @@ public class PwEventCategoryDetailsServiceImpl implements PwEventCategoryDetails
|
||||
return EventFeatureAmplitudeCurveVO.empty();
|
||||
}
|
||||
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
List<EventFeatureAmplitudeCurveVO.EventFeatureAmplitudeCurveDataList> curveDataList = rmpEventDetailList.parallelStream()
|
||||
.map(dto -> {
|
||||
@@ -341,11 +341,7 @@ public class PwEventCategoryDetailsServiceImpl implements PwEventCategoryDetails
|
||||
eventFeatureAmplitudeCurve.setFeatureAmplitude(dto.getFeatureAmplitude());
|
||||
eventFeatureAmplitudeCurve.setDuration(dto.getDuration());
|
||||
|
||||
// Instant instant = dto.getStartTime().toInstant();
|
||||
// ZoneId zoneId = ZoneId.systemDefault();
|
||||
//
|
||||
// eventFeatureAmplitudeCurve.setStartTime(LocalDateTime.ofInstant(instant, zoneId));
|
||||
eventFeatureAmplitudeCurve.setStartTime(LocalDateTime.parse( dto.getStartTime()));
|
||||
eventFeatureAmplitudeCurve.setStartTime(dto.getStartTime());
|
||||
|
||||
return eventFeatureAmplitudeCurve;
|
||||
})
|
||||
|
||||
@@ -12,9 +12,7 @@ import com.njcn.device.pq.api.LineFeignClient;
|
||||
import com.njcn.device.pq.pojo.dto.GeneralDeviceDTO;
|
||||
import com.njcn.device.pq.pojo.param.DeviceInfoParam;
|
||||
import com.njcn.device.pq.pojo.vo.AreaLineInfoVO;
|
||||
import com.njcn.event.influxdb.PqsEventDetailQuery;
|
||||
import com.njcn.event.pojo.po.EventDetail;
|
||||
import com.njcn.event.pojo.po.RStatEventY;
|
||||
import com.njcn.event.pojo.po.RmpEventDetailPO;
|
||||
import com.njcn.event.pojo.vo.AreaAnalysisVO;
|
||||
import com.njcn.event.pojo.vo.VoltageToleranceCurveVO;
|
||||
@@ -35,10 +33,8 @@ import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.njcn.event.influxdb.PqsEventDetailQuery.lineIdOr;
|
||||
import static com.njcn.event.influxdb.PqsEventDetailQuery.timeAndType;
|
||||
import static com.njcn.event.influxdb.QueryBuilder.*;
|
||||
import static org.influxdb.querybuilder.BuiltQuery.QueryBuilder.eq;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* pqs-event
|
||||
@@ -54,7 +50,7 @@ public class AreaAnalysisServiceImpl implements AreaAnalysisService {
|
||||
private final DicDataFeignClient dicDataFeignClient;
|
||||
|
||||
private final LineFeignClient lineFeignClient;
|
||||
private final PqsEventDetailQuery pqsEventDetailQuery;
|
||||
|
||||
private final EventDetailService eventDetailService;
|
||||
@Override
|
||||
public AreaAnalysisVO getEventReason(DeviceInfoParam.BusinessParam deviceInfoParam) {
|
||||
@@ -151,7 +147,7 @@ public class AreaAnalysisServiceImpl implements AreaAnalysisService {
|
||||
voltageToleranceCurve.setLineId(dto.getLineId());
|
||||
voltageToleranceCurve.setPersistTime(dto.getDuration());
|
||||
voltageToleranceCurve.setEventValue(dto.getFeatureAmplitude());
|
||||
voltageToleranceCurve.setTime(LocalDateTime.ofInstant(dto.getStartTime(), ZoneId.systemDefault()));
|
||||
voltageToleranceCurve.setTime(dto.getStartTime());
|
||||
voltageToleranceCurve.setGdName(info.getGdName());
|
||||
voltageToleranceCurve.setSubName(info.getSubName());
|
||||
return voltageToleranceCurve;
|
||||
@@ -232,7 +228,7 @@ public class AreaAnalysisServiceImpl implements AreaAnalysisService {
|
||||
return reasonList;
|
||||
}
|
||||
|
||||
private List<AreaAnalysisVO.Children> assData(List<DictData> dicList, List<String> lineIds, String startTime, String endTime, String type) {
|
||||
/* private List<AreaAnalysisVO.Children> assData(List<DictData> dicList, List<String> lineIds, String startTime, String endTime, String type) {
|
||||
List<AreaAnalysisVO.Children> reasonList = new ArrayList<>();
|
||||
Integer allCount = 0;
|
||||
for (DictData reason : dicList) {
|
||||
@@ -284,5 +280,5 @@ public class AreaAnalysisServiceImpl implements AreaAnalysisService {
|
||||
allType.setValue(allCount);
|
||||
reasonList.add(allType);
|
||||
return reasonList;
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
@@ -325,12 +325,9 @@ public class EventDistributionStatisticsServiceImpl implements EventDistribution
|
||||
eventFeatureAmplitudeCurve.setFeatureAmplitude(dto.getFeatureAmplitude());
|
||||
eventFeatureAmplitudeCurve.setDuration(dto.getDuration());
|
||||
|
||||
// eventFeatureAmplitudeCurve.setStartTime(LocalDateTime.ofInstant(dto.getStartTime().toInstant(), ZoneId.systemDefault()));
|
||||
eventFeatureAmplitudeCurve.setStartTime(LocalDateTime.parse(dto.getStartTime(), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SSS")));
|
||||
eventFeatureAmplitudeCurve.setStartTime(dto.getStartTime());
|
||||
return eventFeatureAmplitudeCurve;
|
||||
})
|
||||
//.sorted(VoltageToleranceCurveDataList.sortAscTime())
|
||||
.collect(Collectors.toCollection(() -> Collections.synchronizedList(new ArrayList<>())));
|
||||
}).collect(Collectors.toCollection(() -> Collections.synchronizedList(new ArrayList<>())));
|
||||
|
||||
return EventFeatureAmplitudeCurveVO.buildVO(rmpEventDetailList.size(), curveDataList);
|
||||
}
|
||||
|
||||
@@ -99,6 +99,7 @@ import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDate;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.time.temporal.TemporalField;
|
||||
import java.util.*;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -1362,10 +1363,8 @@ public class ReportServiceImpl implements ReportService {
|
||||
insertRow(doc, table, centerParagraph, true, "序号", "暂降发生时刻", "暂降赋值(%)", "持续时间(s)", "暂降类型", "暂降原因", "严重度");
|
||||
for (int j = 0; j < plot.size(); j++) {
|
||||
EventDetail eventDetail = plot.get(j);
|
||||
long l = eventDetail.getStartTime().toEpochMilli();
|
||||
Date date1 = new Date(l);
|
||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
|
||||
String s = simpleDateFormat.format(date1);
|
||||
String s = eventDetail.getStartTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SSS"));
|
||||
|
||||
insertRow(doc, table, centerParagraph, false, j + 1 + "", s, eventDetail.getFeatureAmplitude() + "", eventDetail.getDuration() / 1000.0 + "", eventDetail.getAdvanceType(), eventDetail.getAdvanceReason(), eventDetail.getSeverity() + "");
|
||||
}
|
||||
i++;
|
||||
|
||||
@@ -99,7 +99,7 @@ public class RmpEventDetailServiceImpl extends ServiceImpl<RmpEventDetailMapper,
|
||||
}
|
||||
|
||||
// 蒋监测点信息转换成map集合
|
||||
Map<String, String> monitorInfoMap = monitorInfo.stream().collect(Collectors.toMap(PmsMonitorDTO::getId, PmsMonitorDTO::getName));
|
||||
//Map<String, String> monitorInfoMap = monitorInfo.stream().collect(Collectors.toMap(PmsMonitorDTO::getId, PmsMonitorDTO::getName));
|
||||
// 将事件类型转换成map集合
|
||||
Map<String, String> eventStatisDataMap = eventStatisData.stream().collect(Collectors.toMap(DictData::getId, DictData::getName));
|
||||
|
||||
|
||||
@@ -130,12 +130,9 @@ public class TransientServiceImpl implements TransientService {
|
||||
transientVO.setId(eventDetail.getLineId());
|
||||
transientVO.setNumber(i++);
|
||||
transientVO.setWaveName(eventDetail.getWavePath());
|
||||
Instant timeId = eventDetail.getStartTime();
|
||||
ZoneId zoneId = ZoneId.systemDefault();
|
||||
LocalDateTime localDateTime = LocalDateTime.ofInstant(timeId, zoneId);
|
||||
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SSS");
|
||||
String format = dateTimeFormatter.format(localDateTime);
|
||||
|
||||
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SSS");
|
||||
String format = dateTimeFormatter.format(eventDetail.getStartTime());
|
||||
transientVO.setTime(format);
|
||||
switch (eventDetail.getEventType()) {
|
||||
case 0+"":
|
||||
|
||||
Reference in New Issue
Block a user