| | |
| | | }.getType()); |
| | | Environment env = data.getData(); |
| | | env.setRecordTime(now); |
| | | //存入数据库 |
| | | environmentService.add(env); |
| | | //存入数据库,插入或更新 |
| | | environmentService.addOrUpdate(env); |
| | | }break; |
| | | case "status": { |
| | | FireRobotData<RobotStatus> data = gson.fromJson(jsonStr, new TypeToken<FireRobotData<RobotStatus>>() { |
| | |
| | | RobotStatus status = data.getData(); |
| | | status.setRecordTime(now); |
| | | //存入数据库 |
| | | robotStatusService.add(status); |
| | | robotStatusService.addOrUpdate(status); |
| | | }break; |
| | | case "alarm": { |
| | | FireRobotData<RobotAlarm> data = gson.fromJson(jsonStr, new TypeToken<FireRobotData<RobotAlarm>>() { |
| | | }.getType()); |
| | | RobotAlarm alarm = data.getData(); |
| | | //存入数据库 |
| | | robotAlarmService.add(alarm); |
| | | robotAlarmService.addOrUpdate(alarm); |
| | | }break; |
| | | case "threshold": { |
| | | FireRobotData<EnvironmentThreshold> data = gson.fromJson(jsonStr, new TypeToken<FireRobotData<EnvironmentThreshold>>() { |
| | |
| | | EnvironmentThreshold threshold = data.getData(); |
| | | threshold.setRecordTime(now); |
| | | //存入数据库 |
| | | environmentThresholdService.add(threshold); |
| | | environmentThresholdService.addOrUpdate(threshold); |
| | | }break; |
| | | case "identifyAlarm": { |
| | | FireRobotData<IdentifyAlarm> data = gson.fromJson(jsonStr, new TypeToken<FireRobotData<IdentifyAlarm>>() { |