|
@@ -4,12 +4,15 @@ package com.energy.manage.analyse.service.anomaly.impl;
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
|
import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
|
|
import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
|
|
|
|
|
+import com.energy.manage.analyse.common.NetUtils;
|
|
|
import com.energy.manage.analyse.constant.AnomalySensorType;
|
|
import com.energy.manage.analyse.constant.AnomalySensorType;
|
|
|
import com.energy.manage.analyse.constant.DetectorTableEnum;
|
|
import com.energy.manage.analyse.constant.DetectorTableEnum;
|
|
|
import com.energy.manage.analyse.constant.DetectorType;
|
|
import com.energy.manage.analyse.constant.DetectorType;
|
|
|
import com.energy.manage.analyse.domain.dto.AnomalyDTO;
|
|
import com.energy.manage.analyse.domain.dto.AnomalyDTO;
|
|
|
import com.energy.manage.analyse.domain.dto.AnomalyModelDTO;
|
|
import com.energy.manage.analyse.domain.dto.AnomalyModelDTO;
|
|
|
import com.energy.manage.analyse.domain.vo.anomaly.*;
|
|
import com.energy.manage.analyse.domain.vo.anomaly.*;
|
|
|
|
|
+import com.energy.manage.analyse.domain.vo.healthscores.HealthOverviewListVO;
|
|
|
|
|
+import com.energy.manage.analyse.domain.vo.healthscores.HealthscoresWindVO;
|
|
|
import com.energy.manage.analyse.mappers.anomaly.AnomalyWindfarmMapper;
|
|
import com.energy.manage.analyse.mappers.anomaly.AnomalyWindfarmMapper;
|
|
|
import com.energy.manage.analyse.mappers.windenginegroup.WindEngineGroupMapper;
|
|
import com.energy.manage.analyse.mappers.windenginegroup.WindEngineGroupMapper;
|
|
|
import com.energy.manage.analyse.mappers.windfield.WindFieldMapper;
|
|
import com.energy.manage.analyse.mappers.windfield.WindFieldMapper;
|
|
@@ -54,7 +57,7 @@ public class AnomalyServiceImpl implements AnomalyService {
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public AnomalyOverviewVO getAnomalyOverview(AnomalyDTO anomalyDTO) {
|
|
|
|
|
|
|
+ public List<AnomalyOverviewVO> getAnomalyOverview(AnomalyDTO anomalyDTO) {
|
|
|
|
|
|
|
|
String fieldId = null;
|
|
String fieldId = null;
|
|
|
WindFieldPO windFieldPO = getWindField(anomalyDTO.getFieldCode());
|
|
WindFieldPO windFieldPO = getWindField(anomalyDTO.getFieldCode());
|
|
@@ -81,7 +84,35 @@ public class AnomalyServiceImpl implements AnomalyService {
|
|
|
DynamicDataSourceContextHolder.poll();
|
|
DynamicDataSourceContextHolder.poll();
|
|
|
// 切换数据源
|
|
// 切换数据源
|
|
|
DynamicDataSourceContextHolder.push("slave");
|
|
DynamicDataSourceContextHolder.push("slave");
|
|
|
- return anomalyWindfarmMapper.selectAnomalyWindfarmAndFieldId(fieldId, beginTime, endTime);
|
|
|
|
|
|
|
+
|
|
|
|
|
+ List<AnomalyOverviewVO> anomalyOverviewVOList = anomalyWindfarmMapper.selectAnomalyWindfarmAndFieldId(fieldId, beginTime, endTime);
|
|
|
|
|
+
|
|
|
|
|
+ Set<String> fids = anomalyOverviewVOList.parallelStream().map(AnomalyOverviewVO::getFieldId).collect(Collectors.toSet());
|
|
|
|
|
+ List<WindFieldPO> fList = getWindFGroupList(fids);
|
|
|
|
|
+ for(AnomalyOverviewVO vo : anomalyOverviewVOList){
|
|
|
|
|
+ for(WindFieldPO po : fList){
|
|
|
|
|
+ if(vo.getFieldId().equals(po.getFieldId())){
|
|
|
|
|
+ vo.setFieldName(po.getFieldName());
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ return anomalyOverviewVOList;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @param fids
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
|
|
+ private List<WindFieldPO> getWindFGroupList(Set<String> fids) {
|
|
|
|
|
+ // 清除当前
|
|
|
|
|
+ DynamicDataSourceContextHolder.poll();
|
|
|
|
|
+ // 切换数据源
|
|
|
|
|
+ DynamicDataSourceContextHolder.push("master");
|
|
|
|
|
+ // 查询平台风机模块
|
|
|
|
|
+ Example example = new Example(WindFieldPO.class);
|
|
|
|
|
+ Example.Criteria criteria = example.createCriteria();
|
|
|
|
|
+ criteria.andIn("fieldId", fids);
|
|
|
|
|
+ return windFieldMapper.selectByExample(example);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -205,9 +236,37 @@ public class AnomalyServiceImpl implements AnomalyService {
|
|
|
.map(source -> BeanUtil.copyProperties(source, AnomalyModelVO.class))
|
|
.map(source -> BeanUtil.copyProperties(source, AnomalyModelVO.class))
|
|
|
.collect(Collectors.toList());
|
|
.collect(Collectors.toList());
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ Set<String> eids = anomalyModelVOS.parallelStream().map(AnomalyModelVO::getEngineId).collect(Collectors.toSet());
|
|
|
|
|
+ List<WindEngineGroupPO> list = getWindEngineGroupList(eids);
|
|
|
|
|
+ for(AnomalyModelVO vo : anomalyModelVOS){
|
|
|
|
|
+ for(WindEngineGroupPO po : list){
|
|
|
|
|
+ if(vo.getEngineId().equals(po.getEngineId())){
|
|
|
|
|
+ vo.setEngineName(po.getEngineName());
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
return anomalyModelVOS;
|
|
return anomalyModelVOS;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 查询风机对象集合
|
|
|
|
|
+ * @param eids
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
|
|
+ private List<WindEngineGroupPO> getWindEngineGroupList(Set<String> eids) {
|
|
|
|
|
+ // 清除当前
|
|
|
|
|
+ DynamicDataSourceContextHolder.poll();
|
|
|
|
|
+ // 切换数据源
|
|
|
|
|
+ DynamicDataSourceContextHolder.push("master");
|
|
|
|
|
+ // 查询平台风机模块
|
|
|
|
|
+ Example example = new Example(WindEngineGroupPO.class);
|
|
|
|
|
+ Example.Criteria criteria = example.createCriteria();
|
|
|
|
|
+ criteria.andIn("engineId", eids);
|
|
|
|
|
+ return windEngineGroupMapper.selectByExample(example);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public AnomalyChartVO getAnomalyModelMap(AnomalyDTO anomalyDTO){
|
|
public AnomalyChartVO getAnomalyModelMap(AnomalyDTO anomalyDTO){
|
|
@@ -270,7 +329,7 @@ public class AnomalyServiceImpl implements AnomalyService {
|
|
|
// 模块1:风速功率检测器
|
|
// 模块1:风速功率检测器
|
|
|
List<AnomalyThermodynamicDiagramVO> model1PowercurveList = new ArrayList<>();
|
|
List<AnomalyThermodynamicDiagramVO> model1PowercurveList = new ArrayList<>();
|
|
|
List<AnomalyThermodynamicDiagramVO> model1ScatterList = new ArrayList<>();
|
|
List<AnomalyThermodynamicDiagramVO> model1ScatterList = new ArrayList<>();
|
|
|
- List<AnomalyThermodynamicDiagramVO> model1SimulinkList = new ArrayList<>();
|
|
|
|
|
|
|
+// List<AnomalyThermodynamicDiagramVO> model1SimulinkList = new ArrayList<>();
|
|
|
|
|
|
|
|
// 模块2:偏航检测器
|
|
// 模块2:偏航检测器
|
|
|
List<AnomalyThermodynamicDiagramVO> model2StaticyawList = new ArrayList<>();
|
|
List<AnomalyThermodynamicDiagramVO> model2StaticyawList = new ArrayList<>();
|
|
@@ -279,7 +338,7 @@ public class AnomalyServiceImpl implements AnomalyService {
|
|
|
// 模块3:变桨检测器
|
|
// 模块3:变桨检测器
|
|
|
List<AnomalyThermodynamicDiagramVO> model3PitchregulationList = new ArrayList<>();
|
|
List<AnomalyThermodynamicDiagramVO> model3PitchregulationList = new ArrayList<>();
|
|
|
List<AnomalyThermodynamicDiagramVO> model3PitchcoordList = new ArrayList<>();
|
|
List<AnomalyThermodynamicDiagramVO> model3PitchcoordList = new ArrayList<>();
|
|
|
- List<AnomalyThermodynamicDiagramVO> model3MinpitchList = new ArrayList<>();
|
|
|
|
|
|
|
+// List<AnomalyThermodynamicDiagramVO> model3MinpitchList = new ArrayList<>();
|
|
|
|
|
|
|
|
// 模块4:运行状态检测器
|
|
// 模块4:运行状态检测器
|
|
|
List<AnomalyThermodynamicDiagramVO> model4PowerqualityList = new ArrayList<>();
|
|
List<AnomalyThermodynamicDiagramVO> model4PowerqualityList = new ArrayList<>();
|
|
@@ -295,14 +354,14 @@ public class AnomalyServiceImpl implements AnomalyService {
|
|
|
// 模块1:风速功率检测器
|
|
// 模块1:风速功率检测器
|
|
|
AnomalyThermodynamicDiagramVO model1Powercurve = null;
|
|
AnomalyThermodynamicDiagramVO model1Powercurve = null;
|
|
|
AnomalyThermodynamicDiagramVO model1Scatter = null;
|
|
AnomalyThermodynamicDiagramVO model1Scatter = null;
|
|
|
- AnomalyThermodynamicDiagramVO model1Simulink = null;
|
|
|
|
|
|
|
+// AnomalyThermodynamicDiagramVO model1Simulink = null;
|
|
|
// 模块2:偏航检测器
|
|
// 模块2:偏航检测器
|
|
|
AnomalyThermodynamicDiagramVO model2Staticyaw = null;
|
|
AnomalyThermodynamicDiagramVO model2Staticyaw = null;
|
|
|
AnomalyThermodynamicDiagramVO model2Cabletwist = null;
|
|
AnomalyThermodynamicDiagramVO model2Cabletwist = null;
|
|
|
// 模块3:变桨检测器
|
|
// 模块3:变桨检测器
|
|
|
AnomalyThermodynamicDiagramVO model3Pitchregulation = null;
|
|
AnomalyThermodynamicDiagramVO model3Pitchregulation = null;
|
|
|
AnomalyThermodynamicDiagramVO model3Pitchcoord = null;
|
|
AnomalyThermodynamicDiagramVO model3Pitchcoord = null;
|
|
|
- AnomalyThermodynamicDiagramVO model3Minpitch = null;
|
|
|
|
|
|
|
+// AnomalyThermodynamicDiagramVO model3Minpitch = null;
|
|
|
// 模块4:运行状态检测器
|
|
// 模块4:运行状态检测器
|
|
|
AnomalyThermodynamicDiagramVO model4Powerquality = null;
|
|
AnomalyThermodynamicDiagramVO model4Powerquality = null;
|
|
|
AnomalyThermodynamicDiagramVO model4Operationstate = null;
|
|
AnomalyThermodynamicDiagramVO model4Operationstate = null;
|
|
@@ -327,10 +386,10 @@ public class AnomalyServiceImpl implements AnomalyService {
|
|
|
model1Scatter.setRatio(anomalyModelPO.getModel1WindpwrScatterRatio());
|
|
model1Scatter.setRatio(anomalyModelPO.getModel1WindpwrScatterRatio());
|
|
|
model1ScatterList.add(model1Scatter);
|
|
model1ScatterList.add(model1Scatter);
|
|
|
|
|
|
|
|
- model1Simulink = new AnomalyThermodynamicDiagramVO();
|
|
|
|
|
- model1Simulink.setEngineName(engineMap.get(anomalyModelPO.getEngineId()));
|
|
|
|
|
- model1Simulink.setIfAbnorma(anomalyModelPO.getModel1WindpwrSimulink());
|
|
|
|
|
- model1SimulinkList.add(model1Simulink);
|
|
|
|
|
|
|
+// model1Simulink = new AnomalyThermodynamicDiagramVO();
|
|
|
|
|
+// model1Simulink.setEngineName(engineMap.get(anomalyModelPO.getEngineId()));
|
|
|
|
|
+// model1Simulink.setIfAbnorma(anomalyModelPO.getModel1WindpwrSimulink());
|
|
|
|
|
+// model1SimulinkList.add(model1Simulink);
|
|
|
|
|
|
|
|
// 模块2:偏航检测器
|
|
// 模块2:偏航检测器
|
|
|
model2Staticyaw = new AnomalyThermodynamicDiagramVO();
|
|
model2Staticyaw = new AnomalyThermodynamicDiagramVO();
|
|
@@ -358,10 +417,10 @@ public class AnomalyServiceImpl implements AnomalyService {
|
|
|
model3Pitchcoord.setRatio(anomalyModelPO.getModel3PitchPitchcoordRatio());
|
|
model3Pitchcoord.setRatio(anomalyModelPO.getModel3PitchPitchcoordRatio());
|
|
|
model3PitchcoordList.add(model3Pitchcoord);
|
|
model3PitchcoordList.add(model3Pitchcoord);
|
|
|
|
|
|
|
|
- model3Minpitch = new AnomalyThermodynamicDiagramVO();
|
|
|
|
|
- model3Minpitch.setEngineName(engineMap.get(anomalyModelPO.getEngineId()));
|
|
|
|
|
- model3Minpitch.setIfAbnorma(anomalyModelPO.getModel3PitchMinpitch());
|
|
|
|
|
- model3MinpitchList.add(model3Minpitch);
|
|
|
|
|
|
|
+// model3Minpitch = new AnomalyThermodynamicDiagramVO();
|
|
|
|
|
+// model3Minpitch.setEngineName(engineMap.get(anomalyModelPO.getEngineId()));
|
|
|
|
|
+// model3Minpitch.setIfAbnorma(anomalyModelPO.getModel3PitchMinpitch());
|
|
|
|
|
+// model3MinpitchList.add(model3Minpitch);
|
|
|
|
|
|
|
|
// 模块4:运行状态检测器
|
|
// 模块4:运行状态检测器
|
|
|
model4Powerquality = new AnomalyThermodynamicDiagramVO();
|
|
model4Powerquality = new AnomalyThermodynamicDiagramVO();
|
|
@@ -401,14 +460,14 @@ public class AnomalyServiceImpl implements AnomalyService {
|
|
|
// 模块1:风速功率检测器
|
|
// 模块1:风速功率检测器
|
|
|
map.put(DetectorType.MODEL1_POWERCURVE.getCode(),model1PowercurveList);
|
|
map.put(DetectorType.MODEL1_POWERCURVE.getCode(),model1PowercurveList);
|
|
|
map.put(DetectorType.MODEL1_SCATTER.getCode(),model1ScatterList);
|
|
map.put(DetectorType.MODEL1_SCATTER.getCode(),model1ScatterList);
|
|
|
- map.put(DetectorType.MODEL1_SIMULINK.getCode(),model1SimulinkList);
|
|
|
|
|
|
|
+// map.put(DetectorType.MODEL1_SIMULINK.getCode(),model1SimulinkList);
|
|
|
// 模块2:偏航检测器
|
|
// 模块2:偏航检测器
|
|
|
map.put(DetectorType.MODEL2_STATICYAW.getCode(),model2StaticyawList);
|
|
map.put(DetectorType.MODEL2_STATICYAW.getCode(),model2StaticyawList);
|
|
|
map.put(DetectorType.MODEL2_CABLETWIST.getCode(),model2CabletwistList);
|
|
map.put(DetectorType.MODEL2_CABLETWIST.getCode(),model2CabletwistList);
|
|
|
// 模块3:变桨检测器
|
|
// 模块3:变桨检测器
|
|
|
map.put(DetectorType.MODEL3_PITCHREGULATION.getCode(),model3PitchregulationList);
|
|
map.put(DetectorType.MODEL3_PITCHREGULATION.getCode(),model3PitchregulationList);
|
|
|
map.put(DetectorType.MODEL3_PITCHCOORD.getCode(),model3PitchcoordList);
|
|
map.put(DetectorType.MODEL3_PITCHCOORD.getCode(),model3PitchcoordList);
|
|
|
- map.put(DetectorType.MODEL3_MINPITCH.getCode(),model3MinpitchList);
|
|
|
|
|
|
|
+// map.put(DetectorType.MODEL3_MINPITCH.getCode(),model3MinpitchList);
|
|
|
// 模块4:运行状态检测器
|
|
// 模块4:运行状态检测器
|
|
|
map.put(DetectorType.MODEL4_POWERQUALITY.getCode(),model4PowerqualityList);
|
|
map.put(DetectorType.MODEL4_POWERQUALITY.getCode(),model4PowerqualityList);
|
|
|
map.put(DetectorType.MODEL4_OPERATIONSTATE.getCode(),model4OperationstateList);
|
|
map.put(DetectorType.MODEL4_OPERATIONSTATE.getCode(),model4OperationstateList);
|
|
@@ -553,6 +612,10 @@ public class AnomalyServiceImpl implements AnomalyService {
|
|
|
}
|
|
}
|
|
|
String year = String.valueOf(LocalDate.now().getYear());
|
|
String year = String.valueOf(LocalDate.now().getYear());
|
|
|
|
|
|
|
|
|
|
+ // 清除当前
|
|
|
|
|
+ DynamicDataSourceContextHolder.poll();
|
|
|
|
|
+ // 切换数据源
|
|
|
|
|
+ DynamicDataSourceContextHolder.push("slave");
|
|
|
AnomalySensorCountVO anomalySensorCountVO = anomalyWindfarmMapper.selectAnomalySensorCountVO(fieldId,year,beginTime,endTime);
|
|
AnomalySensorCountVO anomalySensorCountVO = anomalyWindfarmMapper.selectAnomalySensorCountVO(fieldId,year,beginTime,endTime);
|
|
|
|
|
|
|
|
return anomalySensorCountVO;
|
|
return anomalySensorCountVO;
|
|
@@ -584,6 +647,10 @@ public class AnomalyServiceImpl implements AnomalyService {
|
|
|
}
|
|
}
|
|
|
String year = String.valueOf(LocalDate.now().getYear());
|
|
String year = String.valueOf(LocalDate.now().getYear());
|
|
|
|
|
|
|
|
|
|
+ // 清除当前
|
|
|
|
|
+ DynamicDataSourceContextHolder.poll();
|
|
|
|
|
+ // 切换数据源
|
|
|
|
|
+ DynamicDataSourceContextHolder.push("slave");
|
|
|
AnomalyCount anomalyCount = anomalyWindfarmMapper.selectModeCount(fieldId,year,beginTime,endTime);
|
|
AnomalyCount anomalyCount = anomalyWindfarmMapper.selectModeCount(fieldId,year,beginTime,endTime);
|
|
|
|
|
|
|
|
return anomalyCount;
|
|
return anomalyCount;
|
|
@@ -605,6 +672,11 @@ public class AnomalyServiceImpl implements AnomalyService {
|
|
|
// 场景1:同一年 → 查询单张分表
|
|
// 场景1:同一年 → 查询单张分表
|
|
|
if (startYear == endYear) {
|
|
if (startYear == endYear) {
|
|
|
String tableName = TABLE_PREFIX + startYear;
|
|
String tableName = TABLE_PREFIX + startYear;
|
|
|
|
|
+
|
|
|
|
|
+ // 清除当前
|
|
|
|
|
+ DynamicDataSourceContextHolder.poll();
|
|
|
|
|
+ // 切换数据源
|
|
|
|
|
+ DynamicDataSourceContextHolder.push("slave");
|
|
|
return anomalyWindfarmMapper.selectBySingleTable(anomalyModelDTO.getFieldId(),anomalyModelDTO.getEngineId(),
|
|
return anomalyWindfarmMapper.selectBySingleTable(anomalyModelDTO.getFieldId(),anomalyModelDTO.getEngineId(),
|
|
|
tableName, start.toString(), end.toString());
|
|
tableName, start.toString(), end.toString());
|
|
|
}
|
|
}
|
|
@@ -612,6 +684,11 @@ public class AnomalyServiceImpl implements AnomalyService {
|
|
|
else {
|
|
else {
|
|
|
String table1 = TABLE_PREFIX + startYear;
|
|
String table1 = TABLE_PREFIX + startYear;
|
|
|
String table2 = TABLE_PREFIX + endYear;
|
|
String table2 = TABLE_PREFIX + endYear;
|
|
|
|
|
+
|
|
|
|
|
+ // 清除当前
|
|
|
|
|
+ DynamicDataSourceContextHolder.poll();
|
|
|
|
|
+ // 切换数据源
|
|
|
|
|
+ DynamicDataSourceContextHolder.push("slave");
|
|
|
return anomalyWindfarmMapper.selectByUnionTables(anomalyModelDTO.getFieldId(),anomalyModelDTO.getEngineId(),
|
|
return anomalyWindfarmMapper.selectByUnionTables(anomalyModelDTO.getFieldId(),anomalyModelDTO.getEngineId(),
|
|
|
table1,table2, start.toString(), end.toString());
|
|
table1,table2, start.toString(), end.toString());
|
|
|
}
|
|
}
|
|
@@ -622,15 +699,34 @@ public class AnomalyServiceImpl implements AnomalyService {
|
|
|
* 补全无数据日期(赋值0)
|
|
* 补全无数据日期(赋值0)
|
|
|
*/
|
|
*/
|
|
|
private List<AnomalyDailyVO> fillMissingDate(LocalDate start, LocalDate end, List<AnomalyDailyVO> data) {
|
|
private List<AnomalyDailyVO> fillMissingDate(LocalDate start, LocalDate end, List<AnomalyDailyVO> data) {
|
|
|
- Map<Date, AnomalyDailyVO> dataMap = data.stream().collect(Collectors.toMap(AnomalyDailyVO::getCreateTime, dto -> dto));
|
|
|
|
|
|
|
+
|
|
|
|
|
+ // 统一使用东八区,和数据库时间对齐,杜绝时区错位
|
|
|
|
|
+ ZoneId zoneId = ZoneId.of("Asia/Shanghai");
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ // Map key:VO的Date统一转东八区LocalDate
|
|
|
|
|
+ Map<LocalDate, AnomalyDailyVO> dataMap = data.stream()
|
|
|
|
|
+ .collect(Collectors.toMap(
|
|
|
|
|
+ vo -> vo.getCreateTime()
|
|
|
|
|
+ .toInstant()
|
|
|
|
|
+ .atZone(zoneId)
|
|
|
|
|
+ .toLocalDate(),
|
|
|
|
|
+ vo -> vo
|
|
|
|
|
+ ));
|
|
|
|
|
|
|
|
List<AnomalyDailyVO> result = new ArrayList<>();
|
|
List<AnomalyDailyVO> result = new ArrayList<>();
|
|
|
|
|
|
|
|
for (LocalDate date = start; !date.isAfter(end); date = date.plusDays(1)) {
|
|
for (LocalDate date = start; !date.isAfter(end); date = date.plusDays(1)) {
|
|
|
-
|
|
|
|
|
- result.add(dataMap.getOrDefault(Date.from(date.atStartOfDay(ZoneId.systemDefault()).toInstant()),
|
|
|
|
|
- new AnomalyDailyVO(Date.from(date.atStartOfDay(ZoneId.systemDefault()).toInstant()),
|
|
|
|
|
- new BigDecimal(0), new BigDecimal(0), new BigDecimal(0),new BigDecimal(0),new BigDecimal(0))));
|
|
|
|
|
|
|
+ AnomalyDailyVO vo = dataMap.get(date);
|
|
|
|
|
+ if (vo == null) {
|
|
|
|
|
+ // 生成当天0点Date,同样用东八区
|
|
|
|
|
+ Date dayDate = Date.from(date.atStartOfDay(zoneId).toInstant());
|
|
|
|
|
+ vo = new AnomalyDailyVO(dayDate,
|
|
|
|
|
+ BigDecimal.ZERO, BigDecimal.ZERO, BigDecimal.ZERO, BigDecimal.ZERO, BigDecimal.ZERO,
|
|
|
|
|
+ BigDecimal.ZERO, BigDecimal.ZERO, BigDecimal.ZERO,
|
|
|
|
|
+ BigDecimal.ZERO, BigDecimal.ZERO, BigDecimal.ZERO, BigDecimal.ZERO);
|
|
|
|
|
+ }
|
|
|
|
|
+ result.add(vo);
|
|
|
}
|
|
}
|
|
|
return result;
|
|
return result;
|
|
|
}
|
|
}
|
|
@@ -642,8 +738,9 @@ public class AnomalyServiceImpl implements AnomalyService {
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
|
@Override
|
|
@Override
|
|
|
- public AnomalyWindpwrVO getAnomalyWindpwr(AnomalyModelDTO anomalyModelDTO){
|
|
|
|
|
|
|
+ public AnomalyWindpwrVO getAnomalyWindpwr(AnomalyModelDTO anomalyModelDTO,boolean isIntranet){
|
|
|
|
|
|
|
|
|
|
+ AnomalyWindpwrVO anomalyWindpwrVO = new AnomalyWindpwrVO();
|
|
|
String beginTime = null;
|
|
String beginTime = null;
|
|
|
String endTime = null;
|
|
String endTime = null;
|
|
|
if (!StringUtils.isEmpty(anomalyModelDTO.getDatatime())) {
|
|
if (!StringUtils.isEmpty(anomalyModelDTO.getDatatime())) {
|
|
@@ -665,24 +762,41 @@ public class AnomalyServiceImpl implements AnomalyService {
|
|
|
anomalyModelDTO.getEngineId(),beginTime,endTime);
|
|
anomalyModelDTO.getEngineId(),beginTime,endTime);
|
|
|
AnomalyPowercurvePO anomalyPowercurvePO = new AnomalyPowercurvePO();
|
|
AnomalyPowercurvePO anomalyPowercurvePO = new AnomalyPowercurvePO();
|
|
|
BeanUtil.copyProperties(powerPO,anomalyPowercurvePO);
|
|
BeanUtil.copyProperties(powerPO,anomalyPowercurvePO);
|
|
|
|
|
+ if(powerPO != null){
|
|
|
|
|
+ anomalyPowercurvePO.setFilePath(NetUtils.getFilePath(isIntranet,powerPO.getFilePath()));
|
|
|
|
|
+ anomalyPowercurvePO.setGraphPath(NetUtils.getFilePath(isIntranet,powerPO.getGraphPath()));
|
|
|
|
|
+ anomalyWindpwrVO.setAnomalyPowercurvePO(anomalyPowercurvePO);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
+ // 清除当前
|
|
|
|
|
+ DynamicDataSourceContextHolder.poll();
|
|
|
|
|
+ // 切换数据源
|
|
|
|
|
+ DynamicDataSourceContextHolder.push("slave");
|
|
|
BaseAnomalyDetectorPO scatterPO = anomalyWindfarmMapper.selectAnomalyDetectorAll(anomalyModelDTO.getFieldId(),
|
|
BaseAnomalyDetectorPO scatterPO = anomalyWindfarmMapper.selectAnomalyDetectorAll(anomalyModelDTO.getFieldId(),
|
|
|
DetectorTableEnum.SCATTER.getFullTableName(year),
|
|
DetectorTableEnum.SCATTER.getFullTableName(year),
|
|
|
anomalyModelDTO.getEngineId(),beginTime,endTime);
|
|
anomalyModelDTO.getEngineId(),beginTime,endTime);
|
|
|
AnomalyScatterPO anomalyScatterPO = new AnomalyScatterPO();
|
|
AnomalyScatterPO anomalyScatterPO = new AnomalyScatterPO();
|
|
|
BeanUtil.copyProperties(scatterPO,anomalyScatterPO);
|
|
BeanUtil.copyProperties(scatterPO,anomalyScatterPO);
|
|
|
|
|
+ if(scatterPO != null){
|
|
|
|
|
+ anomalyScatterPO.setFilePath(NetUtils.getFilePath(isIntranet,scatterPO.getFilePath()));
|
|
|
|
|
+ anomalyScatterPO.setGraphPath(NetUtils.getFilePath(isIntranet,scatterPO.getGraphPath()));
|
|
|
|
|
+ anomalyWindpwrVO.setAnomalyScatterPO(anomalyScatterPO);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
+ // 清除当前
|
|
|
|
|
+ DynamicDataSourceContextHolder.poll();
|
|
|
|
|
+ // 切换数据源
|
|
|
|
|
+ DynamicDataSourceContextHolder.push("slave");
|
|
|
BaseAnomalyDetectorPO simulinkPO = anomalyWindfarmMapper.selectAnomalyDetectorAll(anomalyModelDTO.getFieldId(),
|
|
BaseAnomalyDetectorPO simulinkPO = anomalyWindfarmMapper.selectAnomalyDetectorAll(anomalyModelDTO.getFieldId(),
|
|
|
DetectorTableEnum.SIMULINK.getFullTableName(year),
|
|
DetectorTableEnum.SIMULINK.getFullTableName(year),
|
|
|
anomalyModelDTO.getEngineId(),beginTime,endTime);
|
|
anomalyModelDTO.getEngineId(),beginTime,endTime);
|
|
|
AnomalySimulinkPO anomalySimulinkPO = new AnomalySimulinkPO();
|
|
AnomalySimulinkPO anomalySimulinkPO = new AnomalySimulinkPO();
|
|
|
BeanUtil.copyProperties(simulinkPO,anomalySimulinkPO);
|
|
BeanUtil.copyProperties(simulinkPO,anomalySimulinkPO);
|
|
|
-
|
|
|
|
|
- AnomalyWindpwrVO anomalyWindpwrVO = new AnomalyWindpwrVO();
|
|
|
|
|
- anomalyWindpwrVO.setAnomalyPowercurvePO(anomalyPowercurvePO);
|
|
|
|
|
- anomalyWindpwrVO.setAnomalyScatterPO(anomalyScatterPO);
|
|
|
|
|
- anomalyWindpwrVO.setAnomalySimulinkPO(anomalySimulinkPO);
|
|
|
|
|
-
|
|
|
|
|
|
|
+ if(simulinkPO != null){
|
|
|
|
|
+ anomalySimulinkPO.setFilePath(NetUtils.getFilePath(isIntranet,simulinkPO.getFilePath()));
|
|
|
|
|
+ anomalySimulinkPO.setGraphPath(NetUtils.getFilePath(isIntranet,simulinkPO.getGraphPath()));
|
|
|
|
|
+ anomalyWindpwrVO.setAnomalySimulinkPO(anomalySimulinkPO);
|
|
|
|
|
+ }
|
|
|
return anomalyWindpwrVO;
|
|
return anomalyWindpwrVO;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -692,8 +806,9 @@ public class AnomalyServiceImpl implements AnomalyService {
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
|
@Override
|
|
@Override
|
|
|
- public AnomalyYawVO geAnomalyYaw(AnomalyModelDTO anomalyModelDTO){
|
|
|
|
|
|
|
+ public AnomalyYawVO geAnomalyYaw(AnomalyModelDTO anomalyModelDTO,boolean isIntranet){
|
|
|
|
|
|
|
|
|
|
+ AnomalyYawVO anomalyYawVO = new AnomalyYawVO();
|
|
|
String beginTime = null;
|
|
String beginTime = null;
|
|
|
String endTime = null;
|
|
String endTime = null;
|
|
|
if (!StringUtils.isEmpty(anomalyModelDTO.getDatatime())) {
|
|
if (!StringUtils.isEmpty(anomalyModelDTO.getDatatime())) {
|
|
@@ -715,17 +830,28 @@ public class AnomalyServiceImpl implements AnomalyService {
|
|
|
anomalyModelDTO.getEngineId(),beginTime,endTime);
|
|
anomalyModelDTO.getEngineId(),beginTime,endTime);
|
|
|
AnomalyStaticyawPO anomalyStaticyawPO = new AnomalyStaticyawPO();
|
|
AnomalyStaticyawPO anomalyStaticyawPO = new AnomalyStaticyawPO();
|
|
|
BeanUtil.copyProperties(staticyaw,anomalyStaticyawPO);
|
|
BeanUtil.copyProperties(staticyaw,anomalyStaticyawPO);
|
|
|
|
|
+ if(staticyaw != null){
|
|
|
|
|
+ anomalyStaticyawPO.setFilePath(NetUtils.getFilePath(isIntranet,staticyaw.getFilePath()));
|
|
|
|
|
+ anomalyStaticyawPO.setGraphPath(NetUtils.getFilePath(isIntranet,staticyaw.getGraphPath()));
|
|
|
|
|
+ anomalyYawVO.setAnomalyStaticyawPO(anomalyStaticyawPO);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ // 清除当前
|
|
|
|
|
+ DynamicDataSourceContextHolder.poll();
|
|
|
|
|
+ // 切换数据源
|
|
|
|
|
+ DynamicDataSourceContextHolder.push("slave");
|
|
|
|
|
|
|
|
BaseAnomalyDetectorPO cabletwistPO = anomalyWindfarmMapper.selectAnomalyDetectorAll(anomalyModelDTO.getFieldId(),
|
|
BaseAnomalyDetectorPO cabletwistPO = anomalyWindfarmMapper.selectAnomalyDetectorAll(anomalyModelDTO.getFieldId(),
|
|
|
DetectorTableEnum.STATIC_YAW.getFullTableName(year),
|
|
DetectorTableEnum.STATIC_YAW.getFullTableName(year),
|
|
|
anomalyModelDTO.getEngineId(),beginTime,endTime);
|
|
anomalyModelDTO.getEngineId(),beginTime,endTime);
|
|
|
AnomalyCabletwistPO anomalyCabletwistPO = new AnomalyCabletwistPO();
|
|
AnomalyCabletwistPO anomalyCabletwistPO = new AnomalyCabletwistPO();
|
|
|
BeanUtil.copyProperties(cabletwistPO,anomalyCabletwistPO);
|
|
BeanUtil.copyProperties(cabletwistPO,anomalyCabletwistPO);
|
|
|
-
|
|
|
|
|
- AnomalyYawVO anomalyYawVO = new AnomalyYawVO();
|
|
|
|
|
- anomalyYawVO.setAnomalyStaticyawPO(anomalyStaticyawPO);
|
|
|
|
|
- anomalyYawVO.setAnomalyCabletwistPO(anomalyCabletwistPO);
|
|
|
|
|
-
|
|
|
|
|
|
|
+ if(cabletwistPO != null){
|
|
|
|
|
+ anomalyCabletwistPO.setFilePath(NetUtils.getFilePath(isIntranet,cabletwistPO.getFilePath()));
|
|
|
|
|
+ anomalyCabletwistPO.setGraphPath(NetUtils.getFilePath(isIntranet,cabletwistPO.getGraphPath()));
|
|
|
|
|
+ anomalyYawVO.setAnomalyCabletwistPO(anomalyCabletwistPO);
|
|
|
|
|
+ }
|
|
|
return anomalyYawVO;
|
|
return anomalyYawVO;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -736,8 +862,9 @@ public class AnomalyServiceImpl implements AnomalyService {
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
|
@Override
|
|
@Override
|
|
|
- public AnomalyPitchVO getAnomalyPitch(AnomalyModelDTO anomalyModelDTO){
|
|
|
|
|
|
|
+ public AnomalyPitchVO getAnomalyPitch(AnomalyModelDTO anomalyModelDTO,boolean isIntranet){
|
|
|
|
|
|
|
|
|
|
+ AnomalyPitchVO anomalyPitchVO = new AnomalyPitchVO();
|
|
|
String beginTime = null;
|
|
String beginTime = null;
|
|
|
String endTime = null;
|
|
String endTime = null;
|
|
|
if (!StringUtils.isEmpty(anomalyModelDTO.getDatatime())) {
|
|
if (!StringUtils.isEmpty(anomalyModelDTO.getDatatime())) {
|
|
@@ -758,25 +885,47 @@ public class AnomalyServiceImpl implements AnomalyService {
|
|
|
DetectorTableEnum.PITCH_REGULATION.getFullTableName(year),
|
|
DetectorTableEnum.PITCH_REGULATION.getFullTableName(year),
|
|
|
anomalyModelDTO.getEngineId(),beginTime,endTime);
|
|
anomalyModelDTO.getEngineId(),beginTime,endTime);
|
|
|
AnomalyPitchregulationPO anomalyPitchregulationPO = new AnomalyPitchregulationPO();
|
|
AnomalyPitchregulationPO anomalyPitchregulationPO = new AnomalyPitchregulationPO();
|
|
|
- BeanUtil.copyProperties(pitchregulationPO,anomalyPitchregulationPO);
|
|
|
|
|
|
|
+
|
|
|
|
|
+ if(pitchregulationPO != null){
|
|
|
|
|
+ BeanUtil.copyProperties(pitchregulationPO,anomalyPitchregulationPO);
|
|
|
|
|
+ anomalyPitchregulationPO.setFilePath(NetUtils.getFilePath(isIntranet,pitchregulationPO.getFilePath()));
|
|
|
|
|
+ anomalyPitchregulationPO.setGraphPath(NetUtils.getFilePath(isIntranet,pitchregulationPO.getGraphPath()));
|
|
|
|
|
+ anomalyPitchVO.setAnomalyPitchregulationPO (anomalyPitchregulationPO);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 清除当前
|
|
|
|
|
+ DynamicDataSourceContextHolder.poll();
|
|
|
|
|
+ // 切换数据源
|
|
|
|
|
+ DynamicDataSourceContextHolder.push("slave");
|
|
|
|
|
|
|
|
BaseAnomalyDetectorPO pitchcoordPO = anomalyWindfarmMapper.selectAnomalyDetectorAll(anomalyModelDTO.getFieldId(),
|
|
BaseAnomalyDetectorPO pitchcoordPO = anomalyWindfarmMapper.selectAnomalyDetectorAll(anomalyModelDTO.getFieldId(),
|
|
|
DetectorTableEnum.PITCH_COORD.getFullTableName(year),
|
|
DetectorTableEnum.PITCH_COORD.getFullTableName(year),
|
|
|
anomalyModelDTO.getEngineId(),beginTime,endTime);
|
|
anomalyModelDTO.getEngineId(),beginTime,endTime);
|
|
|
AnomalyPitchcoordPO anomalyPitchcoordPO = new AnomalyPitchcoordPO();
|
|
AnomalyPitchcoordPO anomalyPitchcoordPO = new AnomalyPitchcoordPO();
|
|
|
- BeanUtil.copyProperties(pitchcoordPO,anomalyPitchcoordPO);
|
|
|
|
|
|
|
+
|
|
|
|
|
+ if(pitchcoordPO != null){
|
|
|
|
|
+ BeanUtil.copyProperties(pitchcoordPO,anomalyPitchcoordPO);
|
|
|
|
|
+ anomalyPitchcoordPO.setFilePath(NetUtils.getFilePath(isIntranet,pitchcoordPO.getFilePath()));
|
|
|
|
|
+ anomalyPitchcoordPO.setGraphPath(NetUtils.getFilePath(isIntranet,pitchcoordPO.getGraphPath()));
|
|
|
|
|
+ anomalyPitchVO.setAnomalyPitchcoordPO(anomalyPitchcoordPO);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 清除当前
|
|
|
|
|
+ DynamicDataSourceContextHolder.poll();
|
|
|
|
|
+ // 切换数据源
|
|
|
|
|
+ DynamicDataSourceContextHolder.push("slave");
|
|
|
|
|
|
|
|
BaseAnomalyDetectorPO minpitchPO = anomalyWindfarmMapper.selectAnomalyDetectorAll(anomalyModelDTO.getFieldId(),
|
|
BaseAnomalyDetectorPO minpitchPO = anomalyWindfarmMapper.selectAnomalyDetectorAll(anomalyModelDTO.getFieldId(),
|
|
|
DetectorTableEnum.MIN_PITCH.getFullTableName(year),
|
|
DetectorTableEnum.MIN_PITCH.getFullTableName(year),
|
|
|
anomalyModelDTO.getEngineId(),beginTime,endTime);
|
|
anomalyModelDTO.getEngineId(),beginTime,endTime);
|
|
|
AnomalyMinpitchPO anomalyMinpitchPO = new AnomalyMinpitchPO();
|
|
AnomalyMinpitchPO anomalyMinpitchPO = new AnomalyMinpitchPO();
|
|
|
- BeanUtil.copyProperties(minpitchPO,anomalyMinpitchPO);
|
|
|
|
|
-
|
|
|
|
|
- AnomalyPitchVO anomalyPitchVO = new AnomalyPitchVO();
|
|
|
|
|
- anomalyPitchVO.setAnomalyPitchregulationPO (anomalyPitchregulationPO);
|
|
|
|
|
- anomalyPitchVO.setAnomalyPitchcoordPO(anomalyPitchcoordPO);
|
|
|
|
|
- anomalyPitchVO.setAnomalyMinpitchPO(anomalyMinpitchPO);
|
|
|
|
|
|
|
|
|
|
|
|
+ if(minpitchPO != null){
|
|
|
|
|
+ BeanUtil.copyProperties(minpitchPO,anomalyMinpitchPO);
|
|
|
|
|
+ anomalyMinpitchPO.setFilePath(NetUtils.getFilePath(isIntranet,minpitchPO.getFilePath()));
|
|
|
|
|
+ anomalyMinpitchPO.setGraphPath(NetUtils.getFilePath(isIntranet,minpitchPO.getGraphPath()));
|
|
|
|
|
+ anomalyPitchVO.setAnomalyMinpitchPO(anomalyMinpitchPO);
|
|
|
|
|
+ }
|
|
|
return anomalyPitchVO;
|
|
return anomalyPitchVO;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -786,8 +935,9 @@ public class AnomalyServiceImpl implements AnomalyService {
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
|
@Override
|
|
@Override
|
|
|
- public AnomalyCtrlParamVO getAnomalyCtrlParam(AnomalyModelDTO anomalyModelDTO){
|
|
|
|
|
|
|
+ public AnomalyCtrlParamVO getAnomalyCtrlParam(AnomalyModelDTO anomalyModelDTO,boolean isIntranet){
|
|
|
|
|
|
|
|
|
|
+ AnomalyCtrlParamVO anomalyCtrlParamVO = new AnomalyCtrlParamVO();
|
|
|
String beginTime = null;
|
|
String beginTime = null;
|
|
|
String endTime = null;
|
|
String endTime = null;
|
|
|
if (!StringUtils.isEmpty(anomalyModelDTO.getDatatime())) {
|
|
if (!StringUtils.isEmpty(anomalyModelDTO.getDatatime())) {
|
|
@@ -809,16 +959,26 @@ public class AnomalyServiceImpl implements AnomalyService {
|
|
|
anomalyModelDTO.getEngineId(),beginTime,endTime);
|
|
anomalyModelDTO.getEngineId(),beginTime,endTime);
|
|
|
AnomalyPowerqualityPO anomalyPowerqualityPO = new AnomalyPowerqualityPO();
|
|
AnomalyPowerqualityPO anomalyPowerqualityPO = new AnomalyPowerqualityPO();
|
|
|
BeanUtil.copyProperties(powerqualityPO,anomalyPowerqualityPO);
|
|
BeanUtil.copyProperties(powerqualityPO,anomalyPowerqualityPO);
|
|
|
|
|
+ if(powerqualityPO != null){
|
|
|
|
|
+ anomalyPowerqualityPO.setFilePath(NetUtils.getFilePath(isIntranet,powerqualityPO.getFilePath()));
|
|
|
|
|
+ anomalyPowerqualityPO.setGraphPath(NetUtils.getFilePath(isIntranet,powerqualityPO.getGraphPath()));
|
|
|
|
|
+ anomalyCtrlParamVO.setAnomalyPowerqualityPO (anomalyPowerqualityPO);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
+ // 清除当前
|
|
|
|
|
+ DynamicDataSourceContextHolder.poll();
|
|
|
|
|
+ // 切换数据源
|
|
|
|
|
+ DynamicDataSourceContextHolder.push("slave");
|
|
|
BaseAnomalyDetectorPO operationPO = anomalyWindfarmMapper.selectAnomalyDetectorAll(anomalyModelDTO.getFieldId(),
|
|
BaseAnomalyDetectorPO operationPO = anomalyWindfarmMapper.selectAnomalyDetectorAll(anomalyModelDTO.getFieldId(),
|
|
|
DetectorTableEnum.OPERATION.getFullTableName(year),
|
|
DetectorTableEnum.OPERATION.getFullTableName(year),
|
|
|
anomalyModelDTO.getEngineId(),beginTime,endTime);
|
|
anomalyModelDTO.getEngineId(),beginTime,endTime);
|
|
|
AnomalyOperationPO anomalyOperationPO = new AnomalyOperationPO();
|
|
AnomalyOperationPO anomalyOperationPO = new AnomalyOperationPO();
|
|
|
BeanUtil.copyProperties(operationPO,anomalyOperationPO);
|
|
BeanUtil.copyProperties(operationPO,anomalyOperationPO);
|
|
|
-
|
|
|
|
|
- AnomalyCtrlParamVO anomalyCtrlParamVO = new AnomalyCtrlParamVO();
|
|
|
|
|
- anomalyCtrlParamVO.setAnomalyPowerqualityPO (anomalyPowerqualityPO);
|
|
|
|
|
- anomalyCtrlParamVO.setAnomalyOperationPO(anomalyOperationPO);
|
|
|
|
|
|
|
+ if(operationPO != null){
|
|
|
|
|
+ anomalyOperationPO.setFilePath(NetUtils.getFilePath(isIntranet,operationPO.getFilePath()));
|
|
|
|
|
+ anomalyOperationPO.setGraphPath(NetUtils.getFilePath(isIntranet,operationPO.getGraphPath()));
|
|
|
|
|
+ anomalyCtrlParamVO.setAnomalyOperationPO(anomalyOperationPO);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
return anomalyCtrlParamVO;
|
|
return anomalyCtrlParamVO;
|
|
|
}
|
|
}
|
|
@@ -830,7 +990,7 @@ public class AnomalyServiceImpl implements AnomalyService {
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
|
@Override
|
|
@Override
|
|
|
- public AnomalyAerodynamicsVO getAerodynamics(AnomalyModelDTO anomalyModelDTO){
|
|
|
|
|
|
|
+ public AnomalyAerodynamicsVO getAerodynamics(AnomalyModelDTO anomalyModelDTO,boolean isIntranet){
|
|
|
|
|
|
|
|
String beginTime = null;
|
|
String beginTime = null;
|
|
|
String endTime = null;
|
|
String endTime = null;
|
|
@@ -848,31 +1008,49 @@ public class AnomalyServiceImpl implements AnomalyService {
|
|
|
// 切换数据源
|
|
// 切换数据源
|
|
|
DynamicDataSourceContextHolder.push("slave");
|
|
DynamicDataSourceContextHolder.push("slave");
|
|
|
|
|
|
|
|
|
|
+ AnomalyAerodynamicsVO anomalyAerodynamicsVO = new AnomalyAerodynamicsVO();
|
|
|
|
|
|
|
|
BaseAnomalyDetectorPO anomalyCpBasePO = anomalyWindfarmMapper.selectAnomalyDetectorAll(anomalyModelDTO.getFieldId(),
|
|
BaseAnomalyDetectorPO anomalyCpBasePO = anomalyWindfarmMapper.selectAnomalyDetectorAll(anomalyModelDTO.getFieldId(),
|
|
|
DetectorTableEnum.CP_DETECTOR.getFullTableName(year),
|
|
DetectorTableEnum.CP_DETECTOR.getFullTableName(year),
|
|
|
anomalyModelDTO.getEngineId(),beginTime,endTime);
|
|
anomalyModelDTO.getEngineId(),beginTime,endTime);
|
|
|
AnomalyCpPO anomalyCpPO = new AnomalyCpPO();
|
|
AnomalyCpPO anomalyCpPO = new AnomalyCpPO();
|
|
|
BeanUtil.copyProperties(anomalyCpBasePO,anomalyCpPO);
|
|
BeanUtil.copyProperties(anomalyCpBasePO,anomalyCpPO);
|
|
|
|
|
+ if(anomalyCpBasePO != null){
|
|
|
|
|
+ anomalyCpPO.setFilePath(NetUtils.getFilePath(isIntranet,anomalyCpBasePO.getFilePath()));
|
|
|
|
|
+ anomalyCpPO.setGraphPath(NetUtils.getFilePath(isIntranet,anomalyCpBasePO.getGraphPath()));
|
|
|
|
|
+ anomalyAerodynamicsVO.setAnomalyCpPO(anomalyCpPO);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
+ // 清除当前
|
|
|
|
|
+ DynamicDataSourceContextHolder.poll();
|
|
|
|
|
+ // 切换数据源
|
|
|
|
|
+ DynamicDataSourceContextHolder.push("slave");
|
|
|
BaseAnomalyDetectorPO anomalyTsrBasePO = anomalyWindfarmMapper.selectAnomalyDetectorAll(anomalyModelDTO.getFieldId(),
|
|
BaseAnomalyDetectorPO anomalyTsrBasePO = anomalyWindfarmMapper.selectAnomalyDetectorAll(anomalyModelDTO.getFieldId(),
|
|
|
DetectorTableEnum.TSR_DETECTOR.getFullTableName(year),
|
|
DetectorTableEnum.TSR_DETECTOR.getFullTableName(year),
|
|
|
anomalyModelDTO.getEngineId(),beginTime,endTime);
|
|
anomalyModelDTO.getEngineId(),beginTime,endTime);
|
|
|
AnomalyTsrPO anomalyTsrPO = new AnomalyTsrPO();
|
|
AnomalyTsrPO anomalyTsrPO = new AnomalyTsrPO();
|
|
|
BeanUtil.copyProperties(anomalyTsrBasePO,anomalyTsrPO);
|
|
BeanUtil.copyProperties(anomalyTsrBasePO,anomalyTsrPO);
|
|
|
|
|
+ if(anomalyTsrBasePO != null){
|
|
|
|
|
+ anomalyTsrPO.setFilePath(NetUtils.getFilePath(isIntranet,anomalyTsrBasePO.getFilePath()));
|
|
|
|
|
+ anomalyTsrPO.setGraphPath(NetUtils.getFilePath(isIntranet,anomalyTsrBasePO.getGraphPath()));
|
|
|
|
|
+ anomalyAerodynamicsVO.setAnomalyTsrPO(anomalyTsrPO);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
+ // 清除当前
|
|
|
|
|
+ DynamicDataSourceContextHolder.poll();
|
|
|
|
|
+ // 切换数据源
|
|
|
|
|
+ DynamicDataSourceContextHolder.push("slave");
|
|
|
BaseAnomalyDetectorPO anomalyCpTsrBasePO = anomalyWindfarmMapper.selectAnomalyDetectorAll(anomalyModelDTO.getFieldId(),
|
|
BaseAnomalyDetectorPO anomalyCpTsrBasePO = anomalyWindfarmMapper.selectAnomalyDetectorAll(anomalyModelDTO.getFieldId(),
|
|
|
DetectorTableEnum.CP_TSR_DETECTOR.getFullTableName(year),
|
|
DetectorTableEnum.CP_TSR_DETECTOR.getFullTableName(year),
|
|
|
anomalyModelDTO.getEngineId(),beginTime,endTime);
|
|
anomalyModelDTO.getEngineId(),beginTime,endTime);
|
|
|
AnomalyCpTsrPO anomalyCpTsrPO = new AnomalyCpTsrPO();
|
|
AnomalyCpTsrPO anomalyCpTsrPO = new AnomalyCpTsrPO();
|
|
|
BeanUtil.copyProperties(anomalyCpTsrBasePO,anomalyCpTsrPO);
|
|
BeanUtil.copyProperties(anomalyCpTsrBasePO,anomalyCpTsrPO);
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- AnomalyAerodynamicsVO anomalyAerodynamicsVO = new AnomalyAerodynamicsVO();
|
|
|
|
|
- anomalyAerodynamicsVO.setAnomalyCpPO(anomalyCpPO);
|
|
|
|
|
- anomalyAerodynamicsVO.setAnomalyCpTsrPO(anomalyCpTsrPO);
|
|
|
|
|
- anomalyAerodynamicsVO.setAnomalyTsrPO(anomalyTsrPO);
|
|
|
|
|
-
|
|
|
|
|
|
|
+ if(anomalyCpTsrBasePO != null){
|
|
|
|
|
+ anomalyCpTsrPO.setFilePath(NetUtils.getFilePath(isIntranet,anomalyCpTsrBasePO.getFilePath()));
|
|
|
|
|
+ anomalyCpTsrPO.setGraphPath(NetUtils.getFilePath(isIntranet,anomalyCpTsrBasePO.getGraphPath()));
|
|
|
|
|
+ anomalyAerodynamicsVO.setAnomalyCpPO(anomalyCpPO);
|
|
|
|
|
+ }
|
|
|
return anomalyAerodynamicsVO;
|
|
return anomalyAerodynamicsVO;
|
|
|
}
|
|
}
|
|
|
|
|
|