修改时间

This commit is contained in:
huangzj
2023-11-02 15:53:00 +08:00
parent f4de861a3b
commit 925f48ff81
3 changed files with 13 additions and 11 deletions

View File

@@ -1,9 +1,12 @@
package com.njcn.csharmonic.pojo.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.njcn.common.utils.serializer.InstantDateSerializer;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.Instant;
import java.time.LocalDateTime;
/**
@@ -15,9 +18,8 @@ import java.time.LocalDateTime;
*/
@Data
public class ThdDataVO {
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private LocalDateTime time;
@JsonSerialize(using = InstantDateSerializer.class)
private Instant time;
private String lineId;
private String position;
private String lineName;

View File

@@ -64,7 +64,7 @@ public class DeviceDataTrendServiceImpl implements DeviceDataTrendService {
vo.setLineId(statisticalDataDTO.getLineId());
vo.setPhase(statisticalDataDTO.getPhaseType());
vo.setTime(statisticalDataDTO.getTime().atZone(ZoneId.systemDefault()).toLocalDateTime());
vo.setTime(statisticalDataDTO.getTime());
vo.setStatMethod(statisticalDataDTO.getValueType());
vo.setStatisticalData(BigDecimal.valueOf(statisticalDataDTO.getValue()).setScale(4, RoundingMode.UP).doubleValue());
vo.setStatisticalIndex(temp.getDataId());

View File

@@ -80,7 +80,7 @@ public class StableDataServiceImpl implements StableDataService {
ThdDataVO thdDataVO = new ThdDataVO();
BeanUtils.copyProperties(temp,thdDataVO);
thdDataVO.setStatisticalName(statisticalName);
thdDataVO.setTime(temp.getTime().atZone(ZoneId.systemDefault()).toLocalDateTime());
thdDataVO.setTime(temp.getTime());
String position = csLinePOList.stream().filter(csLinePO -> Objects.equals(csLinePO.getLineId(), thdDataVO.getLineId())).collect(Collectors.toList()).get(0).getPosition();
thdDataVO.setPosition(position);
Double statisticalValue = 0.00;
@@ -106,7 +106,7 @@ public class StableDataServiceImpl implements StableDataService {
ThdDataVO thdDataVO = new ThdDataVO();
BeanUtils.copyProperties(temp,thdDataVO);
thdDataVO.setStatisticalName(thdDataQueryParm.getStatisticalName());
thdDataVO.setTime(temp.getTime().atZone(ZoneId.systemDefault()).toLocalDateTime());
thdDataVO.setTime(temp.getTime());
String position = csLinePOList.stream().filter(csLinePO -> Objects.equals(csLinePO.getLineId(), thdDataVO.getLineId())).collect(Collectors.toList()).get(0).getPosition();
thdDataVO.setPosition(position);
Double statisticalValue = 0.00;
@@ -133,7 +133,7 @@ public class StableDataServiceImpl implements StableDataService {
ThdDataVO thdDataVO = new ThdDataVO();
BeanUtils.copyProperties(temp,thdDataVO);
thdDataVO.setStatisticalName(statisticalName);
thdDataVO.setTime(temp.getTime().atZone(ZoneId.systemDefault()).toLocalDateTime());
thdDataVO.setTime(temp.getTime());
String position = csLinePOList.stream().filter(csLinePO -> Objects.equals(csLinePO.getLineId(), thdDataVO.getLineId())).collect(Collectors.toList()).get(0).getPosition();
thdDataVO.setPosition(position);
Double statisticalValue = 0.00;
@@ -158,7 +158,7 @@ public class StableDataServiceImpl implements StableDataService {
ThdDataVO thdDataVO = new ThdDataVO();
BeanUtils.copyProperties(temp,thdDataVO);
thdDataVO.setStatisticalName(thdDataQueryParm.getStatisticalName());
thdDataVO.setTime(temp.getTime().atZone(ZoneId.systemDefault()).toLocalDateTime());
thdDataVO.setTime(temp.getTime());
String position = csLinePOList.stream().filter(csLinePO -> Objects.equals(csLinePO.getLineId(), thdDataVO.getLineId())).collect(Collectors.toList()).get(0).getPosition();
thdDataVO.setPosition(position);
Double statisticalValue = 0.00;
@@ -214,7 +214,7 @@ public class StableDataServiceImpl implements StableDataService {
vo.setPhase(phaseReflection(temp.getPhaseType()));
String position = finalCsLinePOList.stream().filter(csLinePO -> Objects.equals(csLinePO.getLineId(), vo.getLineId())).collect(Collectors.toList()).get(0).getPosition();
vo.setPosition(position);
vo.setTime(temp.getTime().atZone(ZoneId.systemDefault()).toLocalDateTime());
vo.setTime(temp.getTime());
vo.setStatMethod(temp.getValueType());
vo.setStatisticalData(Double.valueOf(df.format(temp.getValue())));
vo.setStatisticalIndex(data.getId());
@@ -265,7 +265,7 @@ public class StableDataServiceImpl implements StableDataService {
vo.setPhase(temp.getPhaseType());
String position = csLinePOList.stream().filter(csLinePO -> Objects.equals(csLinePO.getLineId(), vo.getLineId())).collect(Collectors.toList()).get(0).getPosition();
vo.setPosition(position);
vo.setTime(temp.getTime().atZone(ZoneId.systemDefault()).toLocalDateTime());
vo.setTime(temp.getTime());
vo.setStatMethod(temp.getValueType());
vo.setStatisticalData(Double.valueOf(df.format(temp.getValue())));
vo.setStatisticalIndex(epdPqd.getId());
@@ -325,7 +325,7 @@ public class StableDataServiceImpl implements StableDataService {
vo.setLineName(lineName);
vo.setPosition(position);
vo.setTime(temp.getTime().atZone(ZoneId.systemDefault()).toLocalDateTime());
vo.setTime(temp.getTime());
vo.setStatMethod(temp.getValueType());
vo.setStatisticalData(Double.valueOf(df.format(temp.getValue())));
vo.setStatisticalIndex(epdPqd.getId());