fix:太阳能网控,后台代码修改完善。
This commit is contained in:
@@ -1704,15 +1704,18 @@ public class IotController extends BaseController {
|
||||
// 初始化警告码
|
||||
int warnCode = 0;
|
||||
|
||||
// 判断是否离线
|
||||
boolean isOffline = status != null && "OFFLINE".equalsIgnoreCase(status);
|
||||
|
||||
// 如果设备离线,添加离线警告
|
||||
if (status != null && "OFFLINE".equalsIgnoreCase(status)) {
|
||||
if (isOffline) {
|
||||
warnCode |= 0x0080; // 设备离线
|
||||
}
|
||||
|
||||
device.setWarnCode(warnCode);
|
||||
|
||||
// 验证 ICCID 是否存在
|
||||
if (device.getIccId() == null || device.getIccId().isEmpty()) {
|
||||
// 验证 ICCID 是否存在:设备离线时属性无法读取,允许跳过,上线后会通过数据上报补全
|
||||
if (!isOffline && (device.getIccId() == null || device.getIccId().isEmpty())) {
|
||||
return R.fail("设备缺少物联网卡号(ICCID)");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user