fix:太阳能网控,后台代码修改完善。

This commit is contained in:
tianyongbao
2026-04-25 06:49:58 +08:00
parent 9217efc155
commit 03c8bfb276
8 changed files with 61 additions and 21 deletions

View File

@@ -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)");
}