xufenglei
2018-04-23 c599900db9ab533bc702b94b19ac89edbe191724
src/main/java/com/moral/service/impl/DeviceServiceImpl.java
@@ -210,10 +210,13 @@
   private void refreshDeviceInRedis(Device device){
        if(!StringUtils.isBlank(device.getMac())){
             Device simpleDevice = new Device();
             simpleDevice.setId(device.getId());
             simpleDevice.setDeviceVersion(device.getDeviceVersion());
             simpleDevice.setMac(device.getMac());
             simpleDevice.setMonitorPointId(device.getMonitorPointId());
          simpleDevice.setId(device.getId());// id
          simpleDevice.setName(device.getName());// name
          simpleDevice.setAddress(device.getAddress());// address
          simpleDevice.setDeviceVersionId(device.getDeviceVersionId());// version
          simpleDevice.setMac(device.getMac()); // mac
          simpleDevice.setMonitorPointId(device.getMonitorPointId());// 监控地id
          simpleDevice.setOrganizationIds(device.getOrganizationIds());// 组织数组
             if(device.getMonitorPointId()!=null){
                 List<Integer> orgIds = monitorPointMapper.selectOrganizationIds(device.getMonitorPointId());
                 simpleDevice.setOrganizationIds(orgIds);
@@ -265,6 +268,7 @@
            device.setMac(device.getMac().toLowerCase());
         }
         if(device.getId()==null){
            device.setState(Constants.DEVICE_STATE_OFFLINE);
            device.setIsDelete(Constants.IS_DELETE_FALSE);
            deviceMapper.insertSelective(device);
         }else{