fix: 新增太阳能网控添加接口。
This commit is contained in:
@@ -24,10 +24,15 @@ public class DeviceTypeProperties {
|
||||
*/
|
||||
private String controlIntegrated;
|
||||
|
||||
/**
|
||||
* 太阳能网控 ProductKey
|
||||
*/
|
||||
private String solarController;
|
||||
|
||||
/**
|
||||
* 根据 ProductKey 判断设备类型
|
||||
* @param productKey ProductKey
|
||||
* @return 设备类型: 1-水质检测仪, 2-控制一体机, null-未知类型
|
||||
* @return 设备类型: 1-水质检测仪, 2-控制一体机, 3-太阳能网控, null-未知类型
|
||||
*/
|
||||
public Integer getDeviceTypeByProductKey(String productKey) {
|
||||
if (productKey == null) {
|
||||
@@ -37,13 +42,15 @@ public class DeviceTypeProperties {
|
||||
return 1;
|
||||
} else if (productKey.equals(controlIntegrated)) {
|
||||
return 2;
|
||||
} else if (productKey.equals(solarController)) {
|
||||
return 3;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据设备类型获取 ProductKey
|
||||
* @param deviceType 1-水质检测仪, 2-控制一体机
|
||||
* @param deviceType 1-水质检测仪, 2-控制一体机, 3-太阳能网控
|
||||
* @return ProductKey
|
||||
*/
|
||||
public String getProductKeyByType(Integer deviceType) {
|
||||
@@ -55,6 +62,8 @@ public class DeviceTypeProperties {
|
||||
return waterQualityMonitor;
|
||||
case 2:
|
||||
return controlIntegrated;
|
||||
case 3:
|
||||
return solarController;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user