作者 钟来

添加主机离线逻辑

@@ -153,6 +153,8 @@ public class DefaultDbService { @@ -153,6 +153,8 @@ public class DefaultDbService {
153 break; 153 break;
154 default: 154 default:
155 iotDevice.setStatus(4); 155 iotDevice.setStatus(4);
  156 + //如果主机离线所有终端也离线
  157 + baseDao.updateBySql("UPDATE `iot_terminal` SET online=4 WHERE device_id=?",iotDevice.getClient_id());
156 break; 158 break;
157 } 159 }
158 } 160 }
@@ -170,7 +172,7 @@ public class DefaultDbService { @@ -170,7 +172,7 @@ public class DefaultDbService {
170 IotTerminal iotTerminal = new IotTerminal(); 172 IotTerminal iotTerminal = new IotTerminal();
171 iotTerminal.setId(parserDeviceInfoDto.getId()); 173 iotTerminal.setId(parserDeviceInfoDto.getId());
172 iotTerminal.setData_update_time(parserDeviceInfoDto.getUpdateTime()); 174 iotTerminal.setData_update_time(parserDeviceInfoDto.getUpdateTime());
173 - iotTerminal.setOnline(1); 175 + iotTerminal.setOnline(3);
174 if(parserDeviceInfoDto.is_data_up()) 176 if(parserDeviceInfoDto.is_data_up())
175 { 177 {
176 iotTerminal.setThings_model_value(parserDeviceInfoDto.getData().toString()); 178 iotTerminal.setThings_model_value(parserDeviceInfoDto.getData().toString());