|
@@ -111,6 +111,7 @@ public class ReceiveDataService {
|
|
AnalysisData(body, windTurbineInfo.getId(), windTurbineInfo.getEquipmentType().getCode(), electricField);
|
|
AnalysisData(body, windTurbineInfo.getId(), windTurbineInfo.getEquipmentType().getCode(), electricField);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ savePowerStationStatusData(electricField);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
}
|
|
}
|
|
@@ -136,6 +137,7 @@ public class ReceiveDataService {
|
|
Map<String, String> map = new HashMap<>();
|
|
Map<String, String> map = new HashMap<>();
|
|
map.put("equipmentNo", equipmentId.toString());
|
|
map.put("equipmentNo", equipmentId.toString());
|
|
map.put("time", new Date(rows.getTimestamp()).toString());
|
|
map.put("time", new Date(rows.getTimestamp()).toString());
|
|
|
|
+ log.info("循环点表");
|
|
for (DataPoint dataPoint : dataPointList) {
|
|
for (DataPoint dataPoint : dataPointList) {
|
|
for (int i = 0; i < sensorIds.length; i++) {
|
|
for (int i = 0; i < sensorIds.length; i++) {
|
|
if (dataPoint.getMeasuringPoint().equals(sensorIds[i])) {
|
|
if (dataPoint.getMeasuringPoint().equals(sensorIds[i])) {
|
|
@@ -152,6 +154,7 @@ public class ReceiveDataService {
|
|
weatherStationStatusDataRepository.save(weatherStationStatusData);
|
|
weatherStationStatusDataRepository.save(weatherStationStatusData);
|
|
} else {
|
|
} else {
|
|
InverterInfo inverterInfo = inverterInfoService.get(equipmentId);
|
|
InverterInfo inverterInfo = inverterInfoService.get(equipmentId);
|
|
|
|
+ log.info("计算电压");
|
|
if (map.get("activePower") != null && map.get("electricalCurrent") != null) {
|
|
if (map.get("activePower") != null && map.get("electricalCurrent") != null) {
|
|
//有功
|
|
//有功
|
|
BigDecimal activePower = new BigDecimal(map.get("activePower"));
|
|
BigDecimal activePower = new BigDecimal(map.get("activePower"));
|
|
@@ -161,6 +164,7 @@ public class ReceiveDataService {
|
|
BigDecimal voltage = activePower.divide(electricalCurrent, 2, BigDecimal.ROUND_HALF_UP);
|
|
BigDecimal voltage = activePower.divide(electricalCurrent, 2, BigDecimal.ROUND_HALF_UP);
|
|
map.put("voltage", voltage.toString());
|
|
map.put("voltage", voltage.toString());
|
|
}
|
|
}
|
|
|
|
+ log.info("电压等于" + map.get("voltage"));
|
|
if (inverterInfo != null) {
|
|
if (inverterInfo != null) {
|
|
redisUtils.hmset("nbq-" + electricField.getStationCode() + "-" + equipmentId, map);
|
|
redisUtils.hmset("nbq-" + electricField.getStationCode() + "-" + equipmentId, map);
|
|
InverterStatusData inverterStatusData = JSON.parseObject(JSON.toJSONString(map), InverterStatusData.class);
|
|
InverterStatusData inverterStatusData = JSON.parseObject(JSON.toJSONString(map), InverterStatusData.class);
|
|
@@ -184,12 +188,14 @@ public class ReceiveDataService {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
|
+ log.info("程序异常");
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
public void savePowerStationStatusData(ElectricField electricField) {
|
|
public void savePowerStationStatusData(ElectricField electricField) {
|
|
try {
|
|
try {
|
|
|
|
+ log.info("开始计算实际功率");
|
|
BigDecimal powerStationStatusData = new BigDecimal("0");
|
|
BigDecimal powerStationStatusData = new BigDecimal("0");
|
|
if (electricField.getElectricFieldTypeEnum().getCode() == 1) {
|
|
if (electricField.getElectricFieldTypeEnum().getCode() == 1) {
|
|
List<InverterInfo> inverterInfoList = inverterInfoService.getByStationCode(electricField.getStationCode());
|
|
List<InverterInfo> inverterInfoList = inverterInfoService.getByStationCode(electricField.getStationCode());
|
|
@@ -217,6 +223,7 @@ public class ReceiveDataService {
|
|
Map<String, String> map = JSON.parseObject(JSON.toJSONString(p), new TypeReference<Map<String, String>>() {
|
|
Map<String, String> map = JSON.parseObject(JSON.toJSONString(p), new TypeReference<Map<String, String>>() {
|
|
});
|
|
});
|
|
redisUtils.hmset("power-" + electricField.getStationCode(), map);
|
|
redisUtils.hmset("power-" + electricField.getStationCode(), map);
|
|
|
|
+ log.info("实际功率结束");
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
}
|
|
}
|