fix:太阳能网控,后台代码修改完善。
This commit is contained in:
@@ -2215,8 +2215,8 @@ public class DeviceDataHandler {
|
||||
: params.getDouble("phasedifference");
|
||||
sensorData.setPhaseDifference(value);
|
||||
}
|
||||
if (params.containsKey("battery")) {
|
||||
sensorData.setBattery(params.getDouble("battery"));
|
||||
if (params.containsKey("ChargeFlag")) {
|
||||
sensorData.setBattery(params.getDouble("ChargeFlag"));
|
||||
}
|
||||
|
||||
// TODO: 如果需要设置 deviceId、userId 等标签字段,需要从设备管理系统查询
|
||||
@@ -2271,6 +2271,9 @@ public class DeviceDataHandler {
|
||||
if (sensorData.getSalinity() != null) {
|
||||
updateDevice.setValueSalinity(sensorData.getSalinity());
|
||||
}
|
||||
if (sensorData.getBattery() != null) {
|
||||
updateDevice.setValueBattery(sensorData.getBattery().intValue());
|
||||
}
|
||||
int updated = deviceMapper.updateById(updateDevice);
|
||||
if (updated > 0) {
|
||||
log.debug("设备实时数据已更新: {}", deviceName);
|
||||
|
||||
Reference in New Issue
Block a user