| | |
| | | @GetMapping("alarm-levels")
|
| | | public Object getAlarmLevels(HttpServletRequest request, Integer orgId) {
|
| | | List<Map<String,Object>> sensorAlarmList = null;
|
| | | AlarmConfigValue alarmConfigValue = null;
|
| | | try {
|
| | | alarmConfigValue = alarmConfigService.queryValueByOrganizationId(orgId).get();
|
| | | AlarmConfigValue alarmConfigValue = alarmConfigService.queryValueByOrganizationId(orgId).get();
|
| | | Map<String,AlarmSensorLevel> alarmLevelMap = alarmConfigValue.getAlarmLevels();
|
| | | sensorAlarmList = alarmLevelMap.keySet().stream().map(key -> {
|
| | | AlarmSensorLevel alarmSensorLevel = alarmLevelMap.get(key);
|
| | |
| | | * @param request
|
| | | * the request
|
| | | * @return the average by all
|
| | | * @throws Exception |
| | | */
|
| | | @GetMapping("all-average")
|
| | | public Map<String, Object> getAllSensorAverageByDevice(HttpServletRequest request) {
|
| | | public Map<String, Object> getAllSensorAverageByDevice(HttpServletRequest request) throws Exception {
|
| | | Map<String, Object> parameters = getParametersStartingWith(request, null);
|
| | | return historyService.getAllSensorAverageByDevice(parameters);
|
| | | }
|
| | |
| | | Account account = accountService.getAccountById(accountId);
|
| | | String regionName = areaService.selectFullNameByCode(code);
|
| | | if(account!=null&®ionName!=null){
|
| | | //去除空格
|
| | | regionName = regionName.replace(" ","");
|
| | | Object sensors = sensorService.queryAll();
|
| | | JSONObject params = new JSONObject();
|
| | | params.put("regionCode",code);
|