ZhuDongming
2020-06-30 67a7a24b47d71dd843dd0b17c5cdf9f519e29d5d
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);