|
@@ -76,7 +76,7 @@ public class SquareLightCtlHandler extends BaseDevHandler {
|
|
|
private static final String DEV_MODE_CODE = "M_Z010_DEV_SQUARE_LIGHT";
|
|
private static final String DEV_MODE_CODE = "M_Z010_DEV_SQUARE_LIGHT";
|
|
|
|
|
|
|
|
// 集中器设备代码
|
|
// 集中器设备代码
|
|
|
- private static final String CONCENTRATOR_MODE_CODE = "M_Z010_DEV_SQUARE_CONCENTRATOR";
|
|
|
|
|
|
|
+ private static final String CONCENTRATOR = "M_Z010_DEV_SQUARE_CONCENTRATOR";
|
|
|
|
|
|
|
|
// 设备子系统代码
|
|
// 设备子系统代码
|
|
|
private static final String SUBSYSTEM_CODE = "SYS_ZHZM";
|
|
private static final String SUBSYSTEM_CODE = "SYS_ZHZM";
|
|
@@ -470,7 +470,7 @@ public class SquareLightCtlHandler extends BaseDevHandler {
|
|
|
public void syncCentDeviceList(List<SlcDevice> slcDevices) {
|
|
public void syncCentDeviceList(List<SlcDevice> slcDevices) {
|
|
|
// 查询数据库记录
|
|
// 查询数据库记录
|
|
|
QueryDevice param = new QueryDevice();
|
|
QueryDevice param = new QueryDevice();
|
|
|
- param.setDeviceModel(CONCENTRATOR_MODE_CODE);
|
|
|
|
|
|
|
+ param.setDeviceModel(CONCENTRATOR);
|
|
|
param.setSubsystemCode(SUBSYSTEM_CODE);
|
|
param.setSubsystemCode(SUBSYSTEM_CODE);
|
|
|
List<EmsDevice> dbDevs = deviceService.selectList(param);
|
|
List<EmsDevice> dbDevs = deviceService.selectList(param);
|
|
|
Set<String> dbDevCodeSet = dbDevs.stream().map(EmsDevice::getDeviceCode).collect(Collectors.toSet());
|
|
Set<String> dbDevCodeSet = dbDevs.stream().map(EmsDevice::getDeviceCode).collect(Collectors.toSet());
|
|
@@ -485,7 +485,7 @@ public class SquareLightCtlHandler extends BaseDevHandler {
|
|
|
|
|
|
|
|
if (CollectionUtils.isNotEmpty(delCodes)) {
|
|
if (CollectionUtils.isNotEmpty(delCodes)) {
|
|
|
for (String code : delCodes) {
|
|
for (String code : delCodes) {
|
|
|
- deviceService.deleteDevice(CONCENTRATOR_MODE_CODE, code);
|
|
|
|
|
|
|
+ deviceService.deleteDevice(CONCENTRATOR, code);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -556,7 +556,7 @@ public class SquareLightCtlHandler extends BaseDevHandler {
|
|
|
device.setDeviceBrand("佐通");
|
|
device.setDeviceBrand("佐通");
|
|
|
device.setDeviceSpec("单灯控制器");
|
|
device.setDeviceSpec("单灯控制器");
|
|
|
device.setDeviceStatus(slcDevice.getStatus());
|
|
device.setDeviceStatus(slcDevice.getStatus());
|
|
|
- device.setDeviceModel(CONCENTRATOR_MODE_CODE);
|
|
|
|
|
|
|
+ device.setDeviceModel(CONCENTRATOR);
|
|
|
device.setSubsystemCode(SUBSYSTEM_CODE);
|
|
device.setSubsystemCode(SUBSYSTEM_CODE);
|
|
|
|
|
|
|
|
if (StringUtils.startsWith(slcDevice.getDeviceName(), "北区")) {
|
|
if (StringUtils.startsWith(slcDevice.getDeviceName(), "北区")) {
|
|
@@ -593,6 +593,7 @@ public class SquareLightCtlHandler extends BaseDevHandler {
|
|
|
if (CollectionUtils.isNotEmpty(oaValues)) {
|
|
if (CollectionUtils.isNotEmpty(oaValues)) {
|
|
|
Map<String, EmsObjAttrValue> vMap = oaValues.stream()
|
|
Map<String, EmsObjAttrValue> vMap = oaValues.stream()
|
|
|
.collect(Collectors.toMap(EmsObjAttrValue::getAttrKey, Function.identity()));
|
|
.collect(Collectors.toMap(EmsObjAttrValue::getAttrKey, Function.identity()));
|
|
|
|
|
+ checkAndUpdate(vMap, deviceId, CONCENTRATOR, "deviceStatus", convertDeviceStatus(slcDevice.getAbnormal()));
|
|
|
|
|
|
|
|
if (null != deviceInfo.getBaselineInfo()) {
|
|
if (null != deviceInfo.getBaselineInfo()) {
|
|
|
BaselineInfo baselineInfo = deviceInfo.getBaselineInfo();
|
|
BaselineInfo baselineInfo = deviceInfo.getBaselineInfo();
|
|
@@ -627,20 +628,16 @@ public class SquareLightCtlHandler extends BaseDevHandler {
|
|
|
if (null != slcDevice) {
|
|
if (null != slcDevice) {
|
|
|
oaValues.add(new EmsObjAttrValue(deviceId, DEV_MODE_CODE, "deviceName", slcDevice.getDeviceName()));
|
|
oaValues.add(new EmsObjAttrValue(deviceId, DEV_MODE_CODE, "deviceName", slcDevice.getDeviceName()));
|
|
|
oaValues.add(new EmsObjAttrValue(deviceId, DEV_MODE_CODE, "imageUrl", slcDevice.getImageUrl()));
|
|
oaValues.add(new EmsObjAttrValue(deviceId, DEV_MODE_CODE, "imageUrl", slcDevice.getImageUrl()));
|
|
|
- oaValues.add(
|
|
|
|
|
- new EmsObjAttrValue(deviceId, DEV_MODE_CODE, "deviceStatus", String.valueOf(slcDevice.getAbnormal())));
|
|
|
|
|
|
|
+ oaValues.add(new EmsObjAttrValue(deviceId, DEV_MODE_CODE, "deviceStatus", convertDeviceStatus(slcDevice.getAbnormal())));
|
|
|
oaValues.add(new EmsObjAttrValue(deviceId, DEV_MODE_CODE, "csq", slcDevice.getCsq()));
|
|
oaValues.add(new EmsObjAttrValue(deviceId, DEV_MODE_CODE, "csq", slcDevice.getCsq()));
|
|
|
- oaValues.add(new EmsObjAttrValue(deviceId, DEV_MODE_CODE, "lampList",
|
|
|
|
|
- JSON.toJSONString(slcDevice.getLampList())));
|
|
|
|
|
|
|
+ oaValues.add(new EmsObjAttrValue(deviceId, DEV_MODE_CODE, "lampList", JSON.toJSONString(slcDevice.getLampList())));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (null != deviceInfo.getDeviceInfo()) {
|
|
if (null != deviceInfo.getDeviceInfo()) {
|
|
|
DevSub subInfo = deviceInfo.getDeviceInfo();
|
|
DevSub subInfo = deviceInfo.getDeviceInfo();
|
|
|
oaValues.add(new EmsObjAttrValue(deviceId, DEV_MODE_CODE, "deviceUid", subInfo.getDeviceUid()));
|
|
oaValues.add(new EmsObjAttrValue(deviceId, DEV_MODE_CODE, "deviceUid", subInfo.getDeviceUid()));
|
|
|
- oaValues.add(
|
|
|
|
|
- new EmsObjAttrValue(deviceId, DEV_MODE_CODE, "minCct", String.valueOf(subInfo.getMinCct())));
|
|
|
|
|
- oaValues.add(
|
|
|
|
|
- new EmsObjAttrValue(deviceId, DEV_MODE_CODE, "maxCct", String.valueOf(subInfo.getMaxCct())));
|
|
|
|
|
|
|
+ oaValues.add(new EmsObjAttrValue(deviceId, DEV_MODE_CODE, "minCct", String.valueOf(subInfo.getMinCct())));
|
|
|
|
|
+ oaValues.add(new EmsObjAttrValue(deviceId, DEV_MODE_CODE, "maxCct", String.valueOf(subInfo.getMaxCct())));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (null != deviceInfo.getBaselineInfo()) {
|
|
if (null != deviceInfo.getBaselineInfo()) {
|
|
@@ -652,25 +649,20 @@ public class SquareLightCtlHandler extends BaseDevHandler {
|
|
|
|
|
|
|
|
if (null != deviceInfo.getStatusInfo()) {
|
|
if (null != deviceInfo.getStatusInfo()) {
|
|
|
StatusInfo sInfo = deviceInfo.getStatusInfo();
|
|
StatusInfo sInfo = deviceInfo.getStatusInfo();
|
|
|
- oaValues.add(
|
|
|
|
|
- new EmsObjAttrValue(deviceId, DEV_MODE_CODE, "current", String.valueOf(sInfo.getCurrent())));
|
|
|
|
|
|
|
+ oaValues.add(new EmsObjAttrValue(deviceId, DEV_MODE_CODE, "current", String.valueOf(sInfo.getCurrent())));
|
|
|
oaValues.add(new EmsObjAttrValue(deviceId, DEV_MODE_CODE, "power", String.valueOf(sInfo.getPower())));
|
|
oaValues.add(new EmsObjAttrValue(deviceId, DEV_MODE_CODE, "power", String.valueOf(sInfo.getPower())));
|
|
|
oaValues.add(new EmsObjAttrValue(deviceId, DEV_MODE_CODE, "factor", String.valueOf(sInfo.getFactor())));
|
|
oaValues.add(new EmsObjAttrValue(deviceId, DEV_MODE_CODE, "factor", String.valueOf(sInfo.getFactor())));
|
|
|
- oaValues.add(
|
|
|
|
|
- new EmsObjAttrValue(deviceId, DEV_MODE_CODE, "voltage", String.valueOf(sInfo.getVoltage())));
|
|
|
|
|
|
|
+ oaValues.add(new EmsObjAttrValue(deviceId, DEV_MODE_CODE, "voltage", String.valueOf(sInfo.getVoltage())));
|
|
|
oaValues.add(new EmsObjAttrValue(deviceId, DEV_MODE_CODE, "energy", String.valueOf(sInfo.getEnergy())));
|
|
oaValues.add(new EmsObjAttrValue(deviceId, DEV_MODE_CODE, "energy", String.valueOf(sInfo.getEnergy())));
|
|
|
- oaValues.add(
|
|
|
|
|
- new EmsObjAttrValue(deviceId, DEV_MODE_CODE, "frequency", String.valueOf(sInfo.getFrequency())));
|
|
|
|
|
- oaValues.add(new EmsObjAttrValue(deviceId, DEV_MODE_CODE, "temperature",
|
|
|
|
|
- String.valueOf(sInfo.getTemperature())));
|
|
|
|
|
|
|
+ oaValues.add(new EmsObjAttrValue(deviceId, DEV_MODE_CODE, "frequency", String.valueOf(sInfo.getFrequency())));
|
|
|
|
|
+ oaValues.add(new EmsObjAttrValue(deviceId, DEV_MODE_CODE, "temperature", String.valueOf(sInfo.getTemperature())));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (CollectionUtils.isNotEmpty(deviceInfo.getLampList())) {
|
|
if (CollectionUtils.isNotEmpty(deviceInfo.getLampList())) {
|
|
|
List<SlcDeviceLamp> lampList = deviceInfo.getLampList();
|
|
List<SlcDeviceLamp> lampList = deviceInfo.getLampList();
|
|
|
SlcDeviceLamp lamp = lampList.get(0);
|
|
SlcDeviceLamp lamp = lampList.get(0);
|
|
|
oaValues.add(new EmsObjAttrValue(deviceId, DEV_MODE_CODE, "cct", String.valueOf(lamp.getCct())));
|
|
oaValues.add(new EmsObjAttrValue(deviceId, DEV_MODE_CODE, "cct", String.valueOf(lamp.getCct())));
|
|
|
- oaValues.add(
|
|
|
|
|
- new EmsObjAttrValue(deviceId, DEV_MODE_CODE, "Switch", String.valueOf(lamp.getLampOnOff())));
|
|
|
|
|
|
|
+ oaValues.add(new EmsObjAttrValue(deviceId, DEV_MODE_CODE, "Switch", String.valueOf(lamp.getLampOnOff())));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
objAttrValueService.insertBatch(oaValues);
|
|
objAttrValueService.insertBatch(oaValues);
|
|
@@ -678,80 +670,65 @@ public class SquareLightCtlHandler extends BaseDevHandler {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private void mergeCentDevAttrValue(String projectId, List<SlcDevice> slcDevices) {
|
|
private void mergeCentDevAttrValue(String projectId, List<SlcDevice> slcDevices) {
|
|
|
- for (SlcDevice slcDevice : slcDevices) {
|
|
|
|
|
- List<EmsObjAttrValue> objAttrValues = objAttrValueService.selectByObjCode(CONCENTRATOR_MODE_CODE,
|
|
|
|
|
- slcDevice.getDeviceCode());
|
|
|
|
|
- CcElecInfo info = slcDevice.getCcElecInfo();
|
|
|
|
|
|
|
+ for (SlcDevice slc : slcDevices) {
|
|
|
|
|
+ List<EmsObjAttrValue> objAttrValues = objAttrValueService.selectByObjCode(CONCENTRATOR,
|
|
|
|
|
+ slc.getDeviceCode());
|
|
|
|
|
+ CcElecInfo info = slc.getCcElecInfo();
|
|
|
|
|
|
|
|
if (CollectionUtils.isNotEmpty(objAttrValues)) {
|
|
if (CollectionUtils.isNotEmpty(objAttrValues)) {
|
|
|
- Map<String, EmsObjAttrValue> objAttrValueMap = objAttrValues.stream()
|
|
|
|
|
- .collect(Collectors.toMap(EmsObjAttrValue::getAttrKey, Function.identity()));
|
|
|
|
|
- checkAndUpdate(objAttrValueMap, slcDevice.getDeviceCode(), CONCENTRATOR_MODE_CODE, "deviceStatus",
|
|
|
|
|
- String.valueOf(slcDevice.getAbnormal()));
|
|
|
|
|
- checkAndUpdate(objAttrValueMap, slcDevice.getDeviceCode(), CONCENTRATOR_MODE_CODE, "csq", String.valueOf(slcDevice.getCsq()));
|
|
|
|
|
- checkAndUpdate(objAttrValueMap, slcDevice.getDeviceCode(), CONCENTRATOR_MODE_CODE, "kwh", String.valueOf(info.getKwh()));
|
|
|
|
|
- checkAndUpdate(objAttrValueMap, slcDevice.getDeviceCode(), CONCENTRATOR_MODE_CODE, "kvarh", String.valueOf(info.getKvarh()));
|
|
|
|
|
- checkAndUpdate(objAttrValueMap, slcDevice.getDeviceCode(), CONCENTRATOR_MODE_CODE, "ua", String.valueOf(info.getUa()));
|
|
|
|
|
- checkAndUpdate(objAttrValueMap, slcDevice.getDeviceCode(), CONCENTRATOR_MODE_CODE, "ub", String.valueOf(info.getUb()));
|
|
|
|
|
- checkAndUpdate(objAttrValueMap, slcDevice.getDeviceCode(), CONCENTRATOR_MODE_CODE, "uc", String.valueOf(info.getUc()));
|
|
|
|
|
- checkAndUpdate(objAttrValueMap, slcDevice.getDeviceCode(), CONCENTRATOR_MODE_CODE, "ia", String.valueOf(info.getIa()));
|
|
|
|
|
- checkAndUpdate(objAttrValueMap, slcDevice.getDeviceCode(), CONCENTRATOR_MODE_CODE, "ib", String.valueOf(info.getIb()));
|
|
|
|
|
- checkAndUpdate(objAttrValueMap, slcDevice.getDeviceCode(), CONCENTRATOR_MODE_CODE, "ic", String.valueOf(info.getIc()));
|
|
|
|
|
- checkAndUpdate(objAttrValueMap, slcDevice.getDeviceCode(), CONCENTRATOR_MODE_CODE, "pfa", String.valueOf(info.getPfa()));
|
|
|
|
|
- checkAndUpdate(objAttrValueMap, slcDevice.getDeviceCode(), CONCENTRATOR_MODE_CODE, "pfb", String.valueOf(info.getPfb()));
|
|
|
|
|
- checkAndUpdate(objAttrValueMap, slcDevice.getDeviceCode(), CONCENTRATOR_MODE_CODE, "pfc", String.valueOf(info.getPfc()));
|
|
|
|
|
- checkAndUpdate(objAttrValueMap, slcDevice.getDeviceCode(), CONCENTRATOR_MODE_CODE, "hza", String.valueOf(info.getHza()));
|
|
|
|
|
- checkAndUpdate(objAttrValueMap, slcDevice.getDeviceCode(), CONCENTRATOR_MODE_CODE, "hzb", String.valueOf(info.getHzb()));
|
|
|
|
|
- checkAndUpdate(objAttrValueMap, slcDevice.getDeviceCode(), CONCENTRATOR_MODE_CODE, "hzc", String.valueOf(info.getHzc()));
|
|
|
|
|
|
|
+ Map<String, EmsObjAttrValue> vMap = objAttrValues.stream().collect(Collectors.toMap(EmsObjAttrValue::getAttrKey, Function.identity()));
|
|
|
|
|
+ checkAndUpdate(vMap, slc.getDeviceCode(), CONCENTRATOR, "deviceStatus", convertDeviceStatus(slc.getAbnormal()));
|
|
|
|
|
+ checkAndUpdate(vMap, slc.getDeviceCode(), CONCENTRATOR, "csq", String.valueOf(slc.getCsq()));
|
|
|
|
|
+ checkAndUpdate(vMap, slc.getDeviceCode(), CONCENTRATOR, "kwh", String.valueOf(info.getKwh()));
|
|
|
|
|
+ checkAndUpdate(vMap, slc.getDeviceCode(), CONCENTRATOR, "kvarh", String.valueOf(info.getKvarh()));
|
|
|
|
|
+ checkAndUpdate(vMap, slc.getDeviceCode(), CONCENTRATOR, "ua", String.valueOf(info.getUa()));
|
|
|
|
|
+ checkAndUpdate(vMap, slc.getDeviceCode(), CONCENTRATOR, "ub", String.valueOf(info.getUb()));
|
|
|
|
|
+ checkAndUpdate(vMap, slc.getDeviceCode(), CONCENTRATOR, "uc", String.valueOf(info.getUc()));
|
|
|
|
|
+ checkAndUpdate(vMap, slc.getDeviceCode(), CONCENTRATOR, "ia", String.valueOf(info.getIa()));
|
|
|
|
|
+ checkAndUpdate(vMap, slc.getDeviceCode(), CONCENTRATOR, "ib", String.valueOf(info.getIb()));
|
|
|
|
|
+ checkAndUpdate(vMap, slc.getDeviceCode(), CONCENTRATOR, "ic", String.valueOf(info.getIc()));
|
|
|
|
|
+ checkAndUpdate(vMap, slc.getDeviceCode(), CONCENTRATOR, "pfa", String.valueOf(info.getPfa()));
|
|
|
|
|
+ checkAndUpdate(vMap, slc.getDeviceCode(), CONCENTRATOR, "pfb", String.valueOf(info.getPfb()));
|
|
|
|
|
+ checkAndUpdate(vMap, slc.getDeviceCode(), CONCENTRATOR, "pfc", String.valueOf(info.getPfc()));
|
|
|
|
|
+ checkAndUpdate(vMap, slc.getDeviceCode(), CONCENTRATOR, "hza", String.valueOf(info.getHza()));
|
|
|
|
|
+ checkAndUpdate(vMap, slc.getDeviceCode(), CONCENTRATOR, "hzb", String.valueOf(info.getHzb()));
|
|
|
|
|
+ checkAndUpdate(vMap, slc.getDeviceCode(), CONCENTRATOR, "hzc", String.valueOf(info.getHzc()));
|
|
|
}
|
|
}
|
|
|
else {
|
|
else {
|
|
|
objAttrValues = new ArrayList<>();
|
|
objAttrValues = new ArrayList<>();
|
|
|
- objAttrValues.add(
|
|
|
|
|
- new EmsObjAttrValue(slcDevice.getDeviceCode(), CONCENTRATOR_MODE_CODE, "projectId", projectId));
|
|
|
|
|
- objAttrValues.add(new EmsObjAttrValue(slcDevice.getDeviceCode(), CONCENTRATOR_MODE_CODE, "deviceId",
|
|
|
|
|
- slcDevice.getDeviceId()));
|
|
|
|
|
- objAttrValues.add(new EmsObjAttrValue(slcDevice.getDeviceCode(), CONCENTRATOR_MODE_CODE, "deviceUid",
|
|
|
|
|
- slcDevice.getDeviceUid()));
|
|
|
|
|
- objAttrValues.add(
|
|
|
|
|
- new EmsObjAttrValue(slcDevice.getDeviceCode(), CONCENTRATOR_MODE_CODE, "deviceModelId",
|
|
|
|
|
- slcDevice.getDeviceModelId()));
|
|
|
|
|
- objAttrValues.add(new EmsObjAttrValue(slcDevice.getDeviceCode(), CONCENTRATOR_MODE_CODE, "imageUrl",
|
|
|
|
|
- slcDevice.getImageUrl()));
|
|
|
|
|
- objAttrValues.add(new EmsObjAttrValue(slcDevice.getDeviceCode(), CONCENTRATOR_MODE_CODE, "deviceStatus",
|
|
|
|
|
- String.valueOf(slcDevice.getAbnormal())));
|
|
|
|
|
- objAttrValues.add(new EmsObjAttrValue(slcDevice.getDeviceCode(), CONCENTRATOR_MODE_CODE, "csq",
|
|
|
|
|
- String.valueOf(slcDevice.getCsq())));
|
|
|
|
|
- objAttrValues.add(new EmsObjAttrValue(slcDevice.getDeviceCode(), CONCENTRATOR_MODE_CODE, "kwh",
|
|
|
|
|
- String.valueOf(info.getKwh())));
|
|
|
|
|
- objAttrValues.add(new EmsObjAttrValue(slcDevice.getDeviceCode(), CONCENTRATOR_MODE_CODE, "kvarh",
|
|
|
|
|
- String.valueOf(info.getKvarh())));
|
|
|
|
|
- objAttrValues.add(new EmsObjAttrValue(slcDevice.getDeviceCode(), CONCENTRATOR_MODE_CODE, "ua",
|
|
|
|
|
- String.valueOf(info.getUa())));
|
|
|
|
|
- objAttrValues.add(new EmsObjAttrValue(slcDevice.getDeviceCode(), CONCENTRATOR_MODE_CODE, "ub",
|
|
|
|
|
- String.valueOf(info.getUb())));
|
|
|
|
|
- objAttrValues.add(new EmsObjAttrValue(slcDevice.getDeviceCode(), CONCENTRATOR_MODE_CODE, "uc",
|
|
|
|
|
- String.valueOf(info.getUc())));
|
|
|
|
|
- objAttrValues.add(new EmsObjAttrValue(slcDevice.getDeviceCode(), CONCENTRATOR_MODE_CODE, "ia",
|
|
|
|
|
- String.valueOf(info.getIa())));
|
|
|
|
|
- objAttrValues.add(new EmsObjAttrValue(slcDevice.getDeviceCode(), CONCENTRATOR_MODE_CODE, "ib",
|
|
|
|
|
- String.valueOf(info.getIb())));
|
|
|
|
|
- objAttrValues.add(new EmsObjAttrValue(slcDevice.getDeviceCode(), CONCENTRATOR_MODE_CODE, "ic",
|
|
|
|
|
- String.valueOf(info.getIc())));
|
|
|
|
|
- objAttrValues.add(new EmsObjAttrValue(slcDevice.getDeviceCode(), CONCENTRATOR_MODE_CODE, "pfa",
|
|
|
|
|
- String.valueOf(info.getPfa())));
|
|
|
|
|
- objAttrValues.add(new EmsObjAttrValue(slcDevice.getDeviceCode(), CONCENTRATOR_MODE_CODE, "pfb",
|
|
|
|
|
- String.valueOf(info.getPfb())));
|
|
|
|
|
- objAttrValues.add(new EmsObjAttrValue(slcDevice.getDeviceCode(), CONCENTRATOR_MODE_CODE, "pfc",
|
|
|
|
|
- String.valueOf(info.getPfc())));
|
|
|
|
|
- objAttrValues.add(new EmsObjAttrValue(slcDevice.getDeviceCode(), CONCENTRATOR_MODE_CODE, "hza",
|
|
|
|
|
- String.valueOf(info.getHza())));
|
|
|
|
|
- objAttrValues.add(new EmsObjAttrValue(slcDevice.getDeviceCode(), CONCENTRATOR_MODE_CODE, "hzb",
|
|
|
|
|
- String.valueOf(info.getHzb())));
|
|
|
|
|
- objAttrValues.add(new EmsObjAttrValue(slcDevice.getDeviceCode(), CONCENTRATOR_MODE_CODE, "hzc",
|
|
|
|
|
- String.valueOf(info.getHzc())));
|
|
|
|
|
|
|
+ objAttrValues.add(new EmsObjAttrValue(slc.getDeviceCode(), CONCENTRATOR, "projectId", projectId));
|
|
|
|
|
+ objAttrValues.add(new EmsObjAttrValue(slc.getDeviceCode(), CONCENTRATOR, "deviceId", slc.getDeviceId()));
|
|
|
|
|
+ objAttrValues.add(new EmsObjAttrValue(slc.getDeviceCode(), CONCENTRATOR, "deviceUid", slc.getDeviceUid()));
|
|
|
|
|
+ objAttrValues.add(new EmsObjAttrValue(slc.getDeviceCode(), CONCENTRATOR, "deviceModelId", slc.getDeviceModelId()));
|
|
|
|
|
+ objAttrValues.add(new EmsObjAttrValue(slc.getDeviceCode(), CONCENTRATOR, "imageUrl", slc.getImageUrl()));
|
|
|
|
|
+ objAttrValues.add(new EmsObjAttrValue(slc.getDeviceCode(), CONCENTRATOR, "deviceStatus", convertDeviceStatus(slc.getAbnormal())));
|
|
|
|
|
+ objAttrValues.add(new EmsObjAttrValue(slc.getDeviceCode(), CONCENTRATOR, "csq", String.valueOf(slc.getCsq())));
|
|
|
|
|
+ objAttrValues.add(new EmsObjAttrValue(slc.getDeviceCode(), CONCENTRATOR, "kwh", String.valueOf(info.getKwh())));
|
|
|
|
|
+ objAttrValues.add(new EmsObjAttrValue(slc.getDeviceCode(), CONCENTRATOR, "kvarh", String.valueOf(info.getKvarh())));
|
|
|
|
|
+ objAttrValues.add(new EmsObjAttrValue(slc.getDeviceCode(), CONCENTRATOR, "ua", String.valueOf(info.getUa())));
|
|
|
|
|
+ objAttrValues.add(new EmsObjAttrValue(slc.getDeviceCode(), CONCENTRATOR, "ub", String.valueOf(info.getUb())));
|
|
|
|
|
+ objAttrValues.add(new EmsObjAttrValue(slc.getDeviceCode(), CONCENTRATOR, "uc", String.valueOf(info.getUc())));
|
|
|
|
|
+ objAttrValues.add(new EmsObjAttrValue(slc.getDeviceCode(), CONCENTRATOR, "ia", String.valueOf(info.getIa())));
|
|
|
|
|
+ objAttrValues.add(new EmsObjAttrValue(slc.getDeviceCode(), CONCENTRATOR, "ib", String.valueOf(info.getIb())));
|
|
|
|
|
+ objAttrValues.add(new EmsObjAttrValue(slc.getDeviceCode(), CONCENTRATOR, "ic", String.valueOf(info.getIc())));
|
|
|
|
|
+ objAttrValues.add(new EmsObjAttrValue(slc.getDeviceCode(), CONCENTRATOR, "pfa", String.valueOf(info.getPfa())));
|
|
|
|
|
+ objAttrValues.add(new EmsObjAttrValue(slc.getDeviceCode(), CONCENTRATOR, "pfb", String.valueOf(info.getPfb())));
|
|
|
|
|
+ objAttrValues.add(new EmsObjAttrValue(slc.getDeviceCode(), CONCENTRATOR, "pfc", String.valueOf(info.getPfc())));
|
|
|
|
|
+ objAttrValues.add(new EmsObjAttrValue(slc.getDeviceCode(), CONCENTRATOR, "hza", String.valueOf(info.getHza())));
|
|
|
|
|
+ objAttrValues.add(new EmsObjAttrValue(slc.getDeviceCode(), CONCENTRATOR, "hzb", String.valueOf(info.getHzb())));
|
|
|
|
|
+ objAttrValues.add(new EmsObjAttrValue(slc.getDeviceCode(), CONCENTRATOR, "hzc", String.valueOf(info.getHzc())));
|
|
|
|
|
|
|
|
objAttrValueService.insertBatch(objAttrValues);
|
|
objAttrValueService.insertBatch(objAttrValues);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ private String convertDeviceStatus(Integer abnormal) {
|
|
|
|
|
+ if (null == abnormal) {
|
|
|
|
|
+ return "0";
|
|
|
|
|
+ }
|
|
|
|
|
+ else {
|
|
|
|
|
+ return abnormal == 0 ? "1" : "0";
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|