| | |
| | | import com.moral.mapper.SensorMapper; |
| | | import com.moral.service.DeviceService; |
| | | import com.moral.service.HistoryHourlyService; |
| | | import com.moral.service.SensorService; |
| | | import javax.annotation.Resource; |
| | | |
| | | @Service |
| | |
| | | |
| | | @Resource |
| | | private DeviceService deviceService; |
| | | |
| | | @Resource |
| | | private SensorService sensorService; |
| | | |
| | | @Resource |
| | | private SensorMapper sensorMapper; |
| | |
| | | sensorKeys.add(sensor.getSensorKey()); |
| | | } |
| | | parameters.put("sensorKeys", sensorKeys); |
| | | return historyHourlyMapper.getPollutionSourceData(parameters); |
| | | Map<String, Object> pollutionSourceData = historyHourlyMapper.getPollutionSourceData(parameters); |
| | | if (MapUtils.isNotEmpty(pollutionSourceData)) { |
| | | Map<String, String> sensorsMap = sensorService.getSensorsMap(parameters); |
| | | String selectSensorKey = parameters.get("sensorKey").toString(); |
| | | for (Map.Entry<String, String> s : sensorsMap.entrySet()) { |
| | | if (selectSensorKey.equals(s.getKey())) { |
| | | selectSensorKey = s.getValue(); |
| | | } |
| | | } |
| | | pollutionSourceData.put("selectSensorKey", selectSensorKey); |
| | | } |
| | | return pollutionSourceData; |
| | | } |
| | | |
| | | @Override |