influxdb查询修改
This commit is contained in:
@@ -34,7 +34,7 @@ public interface StableDataService {
|
||||
|
||||
List<ThdDataVO> queryCommonStatisticalByTime(CommonStatisticalQueryParam commonStatisticalQueryParam);
|
||||
|
||||
List<ThdDataVO> queryLineCommonStatistical(CommonStatisticalQueryParam commonStatisticalQueryParam);
|
||||
// List<ThdDataVO> queryLineCommonStatistical(CommonStatisticalQueryParam commonStatisticalQueryParam);
|
||||
|
||||
public List<ThdDataVO> QuerySqlData(FrequencyStatisticalQueryParam frequencyStatisticalQueryParam);
|
||||
}
|
||||
|
||||
@@ -1,17 +1,24 @@
|
||||
package com.njcn.csharmonic.service.impl;
|
||||
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.csdevice.api.CsLedgerFeignClient;
|
||||
import com.njcn.csdevice.api.CsLineFeignClient;
|
||||
import com.njcn.csdevice.api.DataArrayFeignClient;
|
||||
import com.njcn.csdevice.api.EquipmentFeignClient;
|
||||
import com.njcn.csdevice.enums.AlgorithmResponseEnum;
|
||||
import com.njcn.csdevice.pojo.dto.CsEquipmentDeliveryDTO;
|
||||
import com.njcn.csdevice.pojo.dto.LineParamDTO;
|
||||
import com.njcn.csdevice.pojo.po.CsLedger;
|
||||
import com.njcn.csharmonic.param.DevicDataTrendQueryParam;
|
||||
import com.njcn.csharmonic.pojo.vo.ThdDataVO;
|
||||
import com.njcn.csharmonic.service.DeviceDataTrendService;
|
||||
import com.njcn.influx.pojo.bo.CommonQueryParam;
|
||||
import com.njcn.influx.pojo.dto.StatisticalDataDTO;
|
||||
import com.njcn.influx.service.CommonService;
|
||||
import com.njcn.system.api.DicDataFeignClient;
|
||||
import com.njcn.system.api.EpdFeignClient;
|
||||
import com.njcn.system.enums.DicDataEnum;
|
||||
import com.njcn.system.pojo.po.DictData;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
@@ -21,6 +28,7 @@ import java.math.RoundingMode;
|
||||
import java.time.ZoneId;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
@@ -34,10 +42,10 @@ import java.util.stream.Stream;
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class DeviceDataTrendServiceImpl implements DeviceDataTrendService {
|
||||
private final EpdFeignClient epdFeignClient;
|
||||
private final CommonService commonService;
|
||||
private final DataArrayFeignClient dataArrayFeignClient;
|
||||
private final CsLedgerFeignClient csLedgerFeignClient;
|
||||
private final CsLineFeignClient csLineFeignClient;
|
||||
private final DicDataFeignClient dicDataFeignClient;
|
||||
private final EquipmentFeignClient equipmentFeignClient;
|
||||
@Override
|
||||
public List<List<ThdDataVO>> queryDataTrend(DevicDataTrendQueryParam devicDataTrendQueryParam) {
|
||||
@@ -51,14 +59,20 @@ public class DeviceDataTrendServiceImpl implements DeviceDataTrendService {
|
||||
List<CsLedger> data = csLedgerFeignClient.queryLine(lineParamDTO).getData();
|
||||
List<CsEquipmentDeliveryDTO> data1 = equipmentFeignClient.queryDeviceById(Stream.of(data.get(0).getPid()).collect(Collectors.toList())).getData();
|
||||
devicDataTrendQueryParam.getStatisticalParams().forEach(temp->{
|
||||
CommonQueryParam commonQueryParam = new CommonQueryParam();
|
||||
commonQueryParam.setLineId(devicDataTrendQueryParam.getLineId());
|
||||
commonQueryParam.setTableName(getTableNameByClassId(temp.getClassId()));
|
||||
commonQueryParam.setColumnName(temp.getName());
|
||||
commonQueryParam.setPhasic(temp.getPhase());
|
||||
commonQueryParam.setStartTime( devicDataTrendQueryParam.getStartTime());
|
||||
commonQueryParam.setEndTime(devicDataTrendQueryParam.getEndTime());
|
||||
commonQueryParam.setDataType( temp.getStatMethod());
|
||||
commonQueryParam.setProcess(data1.get(0).getProcess()+"");
|
||||
commonQueryParam.setClDid(getClDidByLineId(devicDataTrendQueryParam.getLineId()));
|
||||
|
||||
List<StatisticalDataDTO> deviceRtData = commonService.getDeviceRtDataByTime(Stream.of(devicDataTrendQueryParam.getLineId()).collect(Collectors.toList()),
|
||||
temp.getClassId(),
|
||||
temp.getName(), temp.getPhase(),
|
||||
temp.getStatMethod(),
|
||||
devicDataTrendQueryParam.getStartTime(),
|
||||
devicDataTrendQueryParam.getEndTime(),
|
||||
data1.get(0).getProcess()+"");
|
||||
|
||||
|
||||
List<StatisticalDataDTO> deviceRtData = commonService.getDeviceRtDataByTime(Stream.of(commonQueryParam).collect(Collectors.toList()));
|
||||
List<ThdDataVO> collect1 = deviceRtData.stream().map(statisticalDataDTO -> {
|
||||
ThdDataVO vo = new ThdDataVO();
|
||||
vo.setLineId(statisticalDataDTO.getLineId());
|
||||
@@ -80,4 +94,30 @@ public class DeviceDataTrendServiceImpl implements DeviceDataTrendService {
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/*表名换成了id本方法做转换*/
|
||||
private String getTableNameByClassId(String classId){
|
||||
DictData data = dicDataFeignClient.getDicDataById(classId).getData();
|
||||
if(Objects.isNull(data)){
|
||||
throw new BusinessException("数据缺失");
|
||||
}
|
||||
return data.getCode();
|
||||
}
|
||||
private String getClDidByLineId(String lineId){
|
||||
String position = csLineFeignClient.getPositionById(lineId).getData();
|
||||
if (Objects.isNull(position)){
|
||||
throw new BusinessException(AlgorithmResponseEnum.POSITION_ERROR);
|
||||
}
|
||||
String clDid = null;
|
||||
String areaCode = dicDataFeignClient.getDicDataById(position).getData().getCode();
|
||||
if (Objects.equals(areaCode, DicDataEnum.OUTPUT_SIDE.getCode())){
|
||||
clDid = "0";
|
||||
} else if (Objects.equals(areaCode, DicDataEnum.GRID_SIDE.getCode())){
|
||||
clDid = "1";
|
||||
} else if (Objects.equals(areaCode, DicDataEnum.LOAD_SIDE.getCode())){
|
||||
clDid = "2";
|
||||
}
|
||||
return clDid;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ import com.njcn.csharmonic.param.ThdDataQueryParm;
|
||||
import com.njcn.csharmonic.pojo.vo.ThdDataVO;
|
||||
import com.njcn.csharmonic.service.StableDataService;
|
||||
import com.njcn.influx.constant.InfluxDbSqlConstant;
|
||||
import com.njcn.influx.pojo.bo.CommonQueryParam;
|
||||
import com.njcn.influx.pojo.dto.StatisticalDataDTO;
|
||||
import com.njcn.influx.pojo.po.HarmonicRatioData;
|
||||
import com.njcn.influx.pojo.po.PowerQualityData;
|
||||
@@ -28,6 +29,7 @@ import com.njcn.system.api.CsStatisticalSetFeignClient;
|
||||
import com.njcn.system.api.DicDataFeignClient;
|
||||
import com.njcn.system.api.EpdFeignClient;
|
||||
import com.njcn.system.enums.DicDataEnum;
|
||||
import com.njcn.system.pojo.po.DictData;
|
||||
import com.njcn.system.pojo.po.EleEpdPqd;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.influxdb.dto.QueryResult;
|
||||
@@ -191,8 +193,7 @@ public class StableDataServiceImpl implements StableDataService {
|
||||
String areaId = dicDataFeignClient.getDicDataByCode(DicDataEnum.OUTPUT_SIDE.getCode()).getData().getId();
|
||||
|
||||
Optional.ofNullable(csLinePOList).orElseThrow(()-> new BusinessException(AlgorithmResponseEnum.LINE_DATA_ERROR));
|
||||
collect = csLinePOList.stream().filter(temp->Objects.equals(areaId,temp.getPosition())).map(CsLinePO::getLineId).distinct().collect(Collectors.toList());
|
||||
|
||||
List<CsLinePO> csLinePOList1 = csLinePOList.stream().filter(temp -> Objects.equals(areaId, temp.getPosition())).distinct().collect(Collectors.toList());
|
||||
|
||||
|
||||
EleEpdPqd data = epdFeignClient.selectById(commonStatisticalQueryParam.getStatisticalId()).getData();
|
||||
@@ -203,7 +204,22 @@ public class StableDataServiceImpl implements StableDataService {
|
||||
}else {
|
||||
frequency = "_"+commonStatisticalQueryParam.getFrequency();
|
||||
}
|
||||
List<StatisticalDataDTO> deviceRtData = commonService.getDeviceRtData(collect, data.getClassId(), data.getName()+frequency, data.getPhase(), commonStatisticalQueryParam.getValueType(),data1.get(0).getProcess()+"");
|
||||
String finalFrequency1 = frequency;
|
||||
List<CommonQueryParam> commonQueryParams = csLinePOList1.stream().map(temp -> {
|
||||
CommonQueryParam commonQueryParam = new CommonQueryParam();
|
||||
commonQueryParam.setLineId(temp.getLineId());
|
||||
commonQueryParam.setTableName(getTableNameByClassId(data.getClassId()));
|
||||
commonQueryParam.setColumnName(data.getName()+ finalFrequency1);
|
||||
commonQueryParam.setPhasic(data.getPhase());
|
||||
// commonQueryParam.setStartTime();
|
||||
// commonQueryParam.setEndTime();
|
||||
commonQueryParam.setDataType(commonStatisticalQueryParam.getValueType());
|
||||
commonQueryParam.setProcess(data1.get(0).getProcess()+"");
|
||||
commonQueryParam.setClDid(getClDidByLineId(temp.getLineId()));
|
||||
|
||||
return commonQueryParam;
|
||||
}).collect(Collectors.toList());
|
||||
List<StatisticalDataDTO> deviceRtData = commonService.getDeviceRtData(commonQueryParams);
|
||||
List<CsLinePO> finalCsLinePOList = csLinePOList;
|
||||
String finalFrequency = frequency;
|
||||
List<ThdDataVO> collect1 = deviceRtData.stream().map(temp -> {
|
||||
@@ -246,24 +262,40 @@ public class StableDataServiceImpl implements StableDataService {
|
||||
List<String> collect = csLinePOList.stream().map(CsLinePO::getLineId).collect(Collectors.toList());
|
||||
String areaId = dicDataFeignClient.getDicDataByCode(DicDataEnum.OUTPUT_SIDE.getCode()).getData().getId();
|
||||
Optional.ofNullable(csLinePOList).orElseThrow(()-> new BusinessException(AlgorithmResponseEnum.LINE_DATA_ERROR));
|
||||
collect = csLinePOList.stream().filter(temp->Objects.equals(areaId,temp.getPosition())).map(CsLinePO::getLineId).collect(Collectors.toList());
|
||||
List<CsLinePO> csLinePOList1 = csLinePOList.stream().filter(temp -> Objects.equals(areaId, temp.getPosition())).collect(Collectors.toList());
|
||||
|
||||
List<EleEpdPqd> data = csStatisticalSetFeignClient.queryStatisticalSelect(commonStatisticalQueryParam.getStatisticalId()).getData();
|
||||
|
||||
// EleEpdPqd data = epdFeignClient.selectById(commonStatisticalQueryParam.getStatisticalId()).getData();
|
||||
// Optional.ofNullable(data).orElseThrow(()-> new BusinessException(AlgorithmResponseEnum.ELEEPDPQD_DATA_ERROR));
|
||||
if(CollectionUtil.isNotEmpty(data)){
|
||||
List<String> finalCollect = collect;
|
||||
List<CsLinePO> finalCsLinePOList = csLinePOList;
|
||||
data.forEach(epdPqd->{
|
||||
String frequency = Optional.ofNullable(commonStatisticalQueryParam.getFrequency()).orElse("");
|
||||
List<StatisticalDataDTO> deviceRtData = commonService.getDeviceRtDataByTime(finalCollect, epdPqd.getClassId(), epdPqd.getName()+frequency, epdPqd.getPhase(), commonStatisticalQueryParam.getValueType(),commonStatisticalQueryParam.getStartTime(),commonStatisticalQueryParam.getEndTime(),data1.get(0).getProcess()+"");
|
||||
|
||||
String finalFrequency1 = frequency;
|
||||
List<CommonQueryParam> commonQueryParams = csLinePOList1.stream().map(temp -> {
|
||||
CommonQueryParam commonQueryParam = new CommonQueryParam();
|
||||
commonQueryParam.setLineId(temp.getLineId());
|
||||
commonQueryParam.setTableName(getTableNameByClassId(epdPqd.getClassId()));
|
||||
commonQueryParam.setColumnName(epdPqd.getName()+ finalFrequency1);
|
||||
commonQueryParam.setPhasic(epdPqd.getPhase());
|
||||
commonQueryParam.setStartTime(commonStatisticalQueryParam.getStartTime());
|
||||
commonQueryParam.setEndTime(commonStatisticalQueryParam.getEndTime());
|
||||
commonQueryParam.setDataType(commonStatisticalQueryParam.getValueType());
|
||||
commonQueryParam.setProcess(data1.get(0).getProcess()+"");
|
||||
commonQueryParam.setClDid(getClDidByLineId(temp.getLineId()));
|
||||
|
||||
return commonQueryParam;
|
||||
}).collect(Collectors.toList());
|
||||
List<StatisticalDataDTO> deviceRtData = commonService.getDeviceRtDataByTime(commonQueryParams);
|
||||
|
||||
|
||||
List<ThdDataVO> collect1 = deviceRtData.stream().map(temp -> {
|
||||
ThdDataVO vo = new ThdDataVO();
|
||||
vo.setLineId(temp.getLineId());
|
||||
vo.setPhase(temp.getPhaseType());
|
||||
String position = csLinePOList.stream().filter(csLinePO -> Objects.equals(csLinePO.getLineId(), vo.getLineId())).collect(Collectors.toList()).get(0).getPosition();
|
||||
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());
|
||||
vo.setStatMethod(temp.getValueType());
|
||||
@@ -282,65 +314,79 @@ public class StableDataServiceImpl implements StableDataService {
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ThdDataVO> queryLineCommonStatistical(CommonStatisticalQueryParam commonStatisticalQueryParam) {
|
||||
List<ThdDataVO> result = new ArrayList();
|
||||
if(CollectionUtil.isEmpty(commonStatisticalQueryParam.getLineList())){
|
||||
throw new BusinessException(AlgorithmResponseEnum.LINE_DATA_ERROR);
|
||||
}
|
||||
List<CsLinePO> csLinePOList = csLineFeignClient.queryLineById(commonStatisticalQueryParam.getLineList()).getData();
|
||||
if(CollectionUtil.isEmpty(csLinePOList)){
|
||||
throw new BusinessException(AlgorithmResponseEnum.LINE_DATA_ERROR);
|
||||
}
|
||||
|
||||
LineParamDTO lineParamDTO = new LineParamDTO();
|
||||
lineParamDTO.setLineId(commonStatisticalQueryParam.getLineList().get(0));
|
||||
List<CsLedger> csLedgers = csLedgerFeignClient.queryLine(lineParamDTO).getData();
|
||||
List<CsEquipmentDeliveryDTO> data1 = equipmentFeignClient.queryDeviceById(Stream.of(csLedgers.get(0).getPid()).collect(Collectors.toList())).getData();
|
||||
|
||||
|
||||
List<String> collect = csLinePOList.stream().map(CsLinePO::getLineId).collect(Collectors.toList());
|
||||
String areaId = dicDataFeignClient.getDicDataByCode(DicDataEnum.OUTPUT_SIDE.getCode()).getData().getId();
|
||||
Optional.ofNullable(csLinePOList).orElseThrow(()-> new BusinessException(AlgorithmResponseEnum.LINE_DATA_ERROR));
|
||||
// collect = csLinePOList.stream().filter(temp->Objects.equals(areaId,temp.getPosition())).map(CsLinePO::getLineId).collect(Collectors.toList());
|
||||
|
||||
List<EleEpdPqd> data = csStatisticalSetFeignClient.queryStatisticalSelect(commonStatisticalQueryParam.getStatisticalId()).getData();
|
||||
|
||||
// EleEpdPqd data = epdFeignClient.selectById(commonStatisticalQueryParam.getStatisticalId()).getData();
|
||||
Optional.ofNullable(data).orElseThrow(()-> new BusinessException(AlgorithmResponseEnum.ELEEPDPQD_DATA_ERROR));
|
||||
|
||||
String frequency = Optional.ofNullable(commonStatisticalQueryParam.getFrequency()).orElse("");
|
||||
if(CollectionUtil.isNotEmpty(data)){
|
||||
List<String> finalCollect = collect;
|
||||
data.forEach(epdPqd->{
|
||||
List<StatisticalDataDTO> deviceRtData = commonService.getDeviceRtDataByTime(finalCollect, epdPqd.getClassId(), epdPqd.getName()+frequency, epdPqd.getPhase(), commonStatisticalQueryParam.getValueType(),commonStatisticalQueryParam.getStartTime(),commonStatisticalQueryParam.getEndTime(),data1.get(0).getProcess()+"");
|
||||
|
||||
|
||||
List<ThdDataVO> collect1 = deviceRtData.stream().map(temp -> {
|
||||
ThdDataVO vo = new ThdDataVO();
|
||||
vo.setLineId(temp.getLineId());
|
||||
vo.setPhase(temp.getPhaseType());
|
||||
String position = csLinePOList.stream().filter(csLinePO -> Objects.equals(csLinePO.getLineId(), vo.getLineId())).collect(Collectors.toList()).get(0).getPosition();
|
||||
String lineName = csLinePOList.stream().filter(csLinePO -> Objects.equals(csLinePO.getLineId(), vo.getLineId())).collect(Collectors.toList()).get(0).getName();
|
||||
|
||||
vo.setLineName(lineName);
|
||||
vo.setPosition(position);
|
||||
vo.setTime(temp.getTime());
|
||||
vo.setStatMethod(temp.getValueType());
|
||||
vo.setStatisticalData(Double.valueOf(df.format(temp.getValue())));
|
||||
vo.setStatisticalIndex(epdPqd.getId());
|
||||
vo.setUnit(epdPqd.getUnit());
|
||||
vo.setStatisticalName(epdPqd.getName());
|
||||
vo.setAnotherName(epdPqd.getShowName());
|
||||
return vo;
|
||||
}).collect(Collectors.toList());
|
||||
collect1 = collect1.stream().distinct().collect(Collectors.toList());
|
||||
result.addAll(collect1);
|
||||
});
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
// @Override
|
||||
// public List<ThdDataVO> queryLineCommonStatistical(CommonStatisticalQueryParam commonStatisticalQueryParam) {
|
||||
// List<ThdDataVO> result = new ArrayList();
|
||||
// if(CollectionUtil.isEmpty(commonStatisticalQueryParam.getLineList())){
|
||||
// throw new BusinessException(AlgorithmResponseEnum.LINE_DATA_ERROR);
|
||||
// }
|
||||
// List<CsLinePO> csLinePOList = csLineFeignClient.queryLineById(commonStatisticalQueryParam.getLineList()).getData();
|
||||
// if(CollectionUtil.isEmpty(csLinePOList)){
|
||||
// throw new BusinessException(AlgorithmResponseEnum.LINE_DATA_ERROR);
|
||||
// }
|
||||
//
|
||||
// LineParamDTO lineParamDTO = new LineParamDTO();
|
||||
// lineParamDTO.setLineId(commonStatisticalQueryParam.getLineList().get(0));
|
||||
// List<CsLedger> csLedgers = csLedgerFeignClient.queryLine(lineParamDTO).getData();
|
||||
// List<CsEquipmentDeliveryDTO> data1 = equipmentFeignClient.queryDeviceById(Stream.of(csLedgers.get(0).getPid()).collect(Collectors.toList())).getData();
|
||||
//
|
||||
//
|
||||
// List<String> collect = csLinePOList.stream().map(CsLinePO::getLineId).collect(Collectors.toList());
|
||||
// String areaId = dicDataFeignClient.getDicDataByCode(DicDataEnum.OUTPUT_SIDE.getCode()).getData().getId();
|
||||
// Optional.ofNullable(csLinePOList).orElseThrow(()-> new BusinessException(AlgorithmResponseEnum.LINE_DATA_ERROR));
|
||||
//// collect = csLinePOList.stream().filter(temp->Objects.equals(areaId,temp.getPosition())).map(CsLinePO::getLineId).collect(Collectors.toList());
|
||||
//
|
||||
// List<EleEpdPqd> data = csStatisticalSetFeignClient.queryStatisticalSelect(commonStatisticalQueryParam.getStatisticalId()).getData();
|
||||
//
|
||||
//// EleEpdPqd data = epdFeignClient.selectById(commonStatisticalQueryParam.getStatisticalId()).getData();
|
||||
// Optional.ofNullable(data).orElseThrow(()-> new BusinessException(AlgorithmResponseEnum.ELEEPDPQD_DATA_ERROR));
|
||||
//
|
||||
// String frequency = Optional.ofNullable(commonStatisticalQueryParam.getFrequency()).orElse("");
|
||||
// if(CollectionUtil.isNotEmpty(data)){
|
||||
// List<String> finalCollect = collect;
|
||||
// data.forEach(epdPqd->{
|
||||
// List<CommonQueryParam> commonQueryParams = finalCsLinePOList.stream().map(temp -> {
|
||||
// CommonQueryParam commonQueryParam = new CommonQueryParam();
|
||||
// commonQueryParam.setLineId(temp.getLineId());
|
||||
// commonQueryParam.setTableName(getTableNameByClassId(epdPqd.getClassId()));
|
||||
// commonQueryParam.setColumnName(epdPqd.getName()+ finalFrequency1);
|
||||
// commonQueryParam.setPhasic(epdPqd.getPhase());
|
||||
// commonQueryParam.setStartTime(commonStatisticalQueryParam.getStartTime());
|
||||
// commonQueryParam.setEndTime(commonStatisticalQueryParam.getEndTime());
|
||||
// commonQueryParam.setDataType(commonStatisticalQueryParam.getValueType());
|
||||
// commonQueryParam.setProcess(data1.get(0).getProcess()+"");
|
||||
// commonQueryParam.setClDid(getClDidByLineId(temp.getLineId()));
|
||||
//
|
||||
// return commonQueryParam;
|
||||
// }).collect(Collectors.toList());
|
||||
// List<StatisticalDataDTO> deviceRtData = commonService.getDeviceRtDataByTime(finalCollect, epdPqd.getClassId(), epdPqd.getName()+frequency, epdPqd.getPhase(), commonStatisticalQueryParam.getValueType(),commonStatisticalQueryParam.getStartTime(),commonStatisticalQueryParam.getEndTime(),data1.get(0).getProcess()+"");
|
||||
//
|
||||
//
|
||||
// List<ThdDataVO> collect1 = deviceRtData.stream().map(temp -> {
|
||||
// ThdDataVO vo = new ThdDataVO();
|
||||
// vo.setLineId(temp.getLineId());
|
||||
// vo.setPhase(temp.getPhaseType());
|
||||
// String position = csLinePOList.stream().filter(csLinePO -> Objects.equals(csLinePO.getLineId(), vo.getLineId())).collect(Collectors.toList()).get(0).getPosition();
|
||||
// String lineName = csLinePOList.stream().filter(csLinePO -> Objects.equals(csLinePO.getLineId(), vo.getLineId())).collect(Collectors.toList()).get(0).getName();
|
||||
//
|
||||
// vo.setLineName(lineName);
|
||||
// vo.setPosition(position);
|
||||
// vo.setTime(temp.getTime());
|
||||
// vo.setStatMethod(temp.getValueType());
|
||||
// vo.setStatisticalData(Double.valueOf(df.format(temp.getValue())));
|
||||
// vo.setStatisticalIndex(epdPqd.getId());
|
||||
// vo.setUnit(epdPqd.getUnit());
|
||||
// vo.setStatisticalName(epdPqd.getName());
|
||||
// vo.setAnotherName(epdPqd.getShowName());
|
||||
// return vo;
|
||||
// }).collect(Collectors.toList());
|
||||
// collect1 = collect1.stream().distinct().collect(Collectors.toList());
|
||||
// result.addAll(collect1);
|
||||
// });
|
||||
// }
|
||||
//
|
||||
// return result;
|
||||
// }
|
||||
|
||||
private String phaseReflection(String phase){
|
||||
switch (phase) {
|
||||
@@ -431,4 +477,29 @@ public class StableDataServiceImpl implements StableDataService {
|
||||
return thdDataVOList;
|
||||
}
|
||||
|
||||
/*表名换成了id本方法做转换*/
|
||||
private String getTableNameByClassId(String classId){
|
||||
DictData data = dicDataFeignClient.getDicDataById(classId).getData();
|
||||
if(Objects.isNull(data)){
|
||||
throw new BusinessException("数据缺失");
|
||||
}
|
||||
return data.getCode();
|
||||
}
|
||||
private String getClDidByLineId(String lineId){
|
||||
String position = csLineFeignClient.getPositionById(lineId).getData();
|
||||
if (Objects.isNull(position)){
|
||||
throw new BusinessException(AlgorithmResponseEnum.POSITION_ERROR);
|
||||
}
|
||||
String clDid = null;
|
||||
String areaCode = dicDataFeignClient.getDicDataById(position).getData().getCode();
|
||||
if (Objects.equals(areaCode, DicDataEnum.OUTPUT_SIDE.getCode())){
|
||||
clDid = "0";
|
||||
} else if (Objects.equals(areaCode, DicDataEnum.GRID_SIDE.getCode())){
|
||||
clDid = "1";
|
||||
} else if (Objects.equals(areaCode, DicDataEnum.LOAD_SIDE.getCode())){
|
||||
clDid = "2";
|
||||
}
|
||||
return clDid;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user