kaiyu
2020-11-16 cd264145f9b4107f1430da46269dd306d26f3116
src/main/java/com/moral/service/impl/SensorServiceImpl.java
@@ -9,9 +9,6 @@
import javax.annotation.Resource;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.stereotype.Service;
import com.alibaba.fastjson.JSONObject;
import com.moral.common.bean.PageBean;
import com.moral.common.util.MyBatisBaseMapUtil;
@@ -22,6 +19,8 @@
import com.moral.service.MonitorPointService;
import com.moral.service.SensorService;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example;
@Service
@@ -152,6 +151,23 @@
    }
    @Override
    public List<Map<String, String>> getSensorsAllMap() {
        List<Sensor> sensors = sensorMapper.selectAll();
        Map<String, String> sensorsDescriptionMap = new HashMap<>();
        for (Sensor sensor : sensors) {
            sensorsDescriptionMap.put(sensor.getSensorKey(), sensor.getDescription());
        }
        Map<String, String> sensorsUnitMap = new HashMap<>();
        for (Sensor sensor : sensors) {
            sensorsUnitMap.put(sensor.getSensorKey(), sensor.getUnit());
        }
        List<Map<String, String>> sensorsMapList = new ArrayList<>();
        sensorsMapList.add(sensorsDescriptionMap);
        sensorsMapList.add(sensorsUnitMap);
        return sensorsMapList;
    }
    @Override
    public List<Sensor> selectSenosrsByOrgId(Map<String, Object> parameters) {
        List<String> macList = new ArrayList<>();
        List<MonitorPoint> monitorPoints = monitorPointService.getMonitorPointsAndDevicesByRegion(parameters);
@@ -229,4 +245,9 @@
        return sheets;
    }
    @Override
    public List<String> getSensorKeys() {
        return sensorMapper.getSensorKeys();
    }
}