diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageFragment.kt index 313af78..713d6d0 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageFragment.kt @@ -14,10 +14,7 @@ import com.amap.api.maps.AMapOptions import com.amap.api.maps.CameraUpdateFactory import com.amap.api.maps.CoordinateConverter -import com.amap.api.maps.model.CameraPosition -import com.amap.api.maps.model.LatLng -import com.amap.api.maps.model.Marker -import com.amap.api.maps.model.MarkerOptions +import com.amap.api.maps.model.* import com.casic.app.smartwell.R import com.casic.app.smartwell.adapter.HomeRecycleAdapter import com.casic.app.smartwell.extensions.valueToType @@ -267,47 +264,12 @@ allMarkerOptions.forEach { screenLocation = proj.toScreenLocation(it.position) if (screenLocation.x >= 0 && screenLocation.y >= 0 && screenLocation.x <= dm.widthPixels && screenLocation.y <= dm.heightPixels) { - //在当前可观区域内 + it.icon(BitmapDescriptorFactory.fromBitmap(BitmapDescriptorFactory.fromResource(R.mipmap.well_location).bitmap)) markerOptionsInView.add(it) } } - // 自定义的聚合类MarkerCluster - val clustersMarkers: MutableList = ArrayList() markerOptionsInView.forEach { - if (clustersMarkers.size == 0) { - //添加一个新的自定义marker - clustersMarkers.add( - GaoDeClusterMarkerView(requireContext(), it, proj, LocaleConstant.RADIUS_SIZE) - ) - } else { - var isInRange = false - //Kotlin foreach不能用break - for (view in clustersMarkers) { - //判断当前的marker是否在前面marker的聚合范围内 并且每个marker只会聚合一次。 - if (view.bounds.contains(it.position)) { - view.addMarker(it) - isInRange = true - break - } - } - //如果没在任何范围内,自己单独形成一个自定义marker。在和后面的marker进行比较 - if (!isInRange) { - clustersMarkers.add( - GaoDeClusterMarkerView( - requireContext(), it, proj, LocaleConstant.RADIUS_SIZE - ) - )//相距多少才聚合 - } - } - } - // 设置聚合点的位置和icon - clustersMarkers.forEach { - it.setPositionAndIcon() - } - aMap.clear() - // 重新添加 marker - clustersMarkers.forEach { - aMap.addMarker(it.options) + aMap.addMarker(it) } } diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageFragment.kt index 313af78..713d6d0 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageFragment.kt @@ -14,10 +14,7 @@ import com.amap.api.maps.AMapOptions import com.amap.api.maps.CameraUpdateFactory import com.amap.api.maps.CoordinateConverter -import com.amap.api.maps.model.CameraPosition -import com.amap.api.maps.model.LatLng -import com.amap.api.maps.model.Marker -import com.amap.api.maps.model.MarkerOptions +import com.amap.api.maps.model.* import com.casic.app.smartwell.R import com.casic.app.smartwell.adapter.HomeRecycleAdapter import com.casic.app.smartwell.extensions.valueToType @@ -267,47 +264,12 @@ allMarkerOptions.forEach { screenLocation = proj.toScreenLocation(it.position) if (screenLocation.x >= 0 && screenLocation.y >= 0 && screenLocation.x <= dm.widthPixels && screenLocation.y <= dm.heightPixels) { - //在当前可观区域内 + it.icon(BitmapDescriptorFactory.fromBitmap(BitmapDescriptorFactory.fromResource(R.mipmap.well_location).bitmap)) markerOptionsInView.add(it) } } - // 自定义的聚合类MarkerCluster - val clustersMarkers: MutableList = ArrayList() markerOptionsInView.forEach { - if (clustersMarkers.size == 0) { - //添加一个新的自定义marker - clustersMarkers.add( - GaoDeClusterMarkerView(requireContext(), it, proj, LocaleConstant.RADIUS_SIZE) - ) - } else { - var isInRange = false - //Kotlin foreach不能用break - for (view in clustersMarkers) { - //判断当前的marker是否在前面marker的聚合范围内 并且每个marker只会聚合一次。 - if (view.bounds.contains(it.position)) { - view.addMarker(it) - isInRange = true - break - } - } - //如果没在任何范围内,自己单独形成一个自定义marker。在和后面的marker进行比较 - if (!isInRange) { - clustersMarkers.add( - GaoDeClusterMarkerView( - requireContext(), it, proj, LocaleConstant.RADIUS_SIZE - ) - )//相距多少才聚合 - } - } - } - // 设置聚合点的位置和icon - clustersMarkers.forEach { - it.setPositionAndIcon() - } - aMap.clear() - // 重新添加 marker - clustersMarkers.forEach { - aMap.addMarker(it.options) + aMap.addMarker(it) } } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java index 319dfbe..9f9f3f4 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java @@ -6,9 +6,9 @@ import android.util.Log; import org.greenrobot.greendao.AbstractDaoMaster; +import org.greenrobot.greendao.database.StandardDatabase; import org.greenrobot.greendao.database.Database; import org.greenrobot.greendao.database.DatabaseOpenHelper; -import org.greenrobot.greendao.database.StandardDatabase; import org.greenrobot.greendao.identityscope.IdentityScopeType; @@ -19,9 +19,7 @@ public class DaoMaster extends AbstractDaoMaster { public static final int SCHEMA_VERSION = 1; - /** - * Creates underlying database table using DAOs. - */ + /** Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { NoticeLocaleBeanDao.createTable(db, ifNotExists); } diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageFragment.kt index 313af78..713d6d0 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageFragment.kt @@ -14,10 +14,7 @@ import com.amap.api.maps.AMapOptions import com.amap.api.maps.CameraUpdateFactory import com.amap.api.maps.CoordinateConverter -import com.amap.api.maps.model.CameraPosition -import com.amap.api.maps.model.LatLng -import com.amap.api.maps.model.Marker -import com.amap.api.maps.model.MarkerOptions +import com.amap.api.maps.model.* import com.casic.app.smartwell.R import com.casic.app.smartwell.adapter.HomeRecycleAdapter import com.casic.app.smartwell.extensions.valueToType @@ -267,47 +264,12 @@ allMarkerOptions.forEach { screenLocation = proj.toScreenLocation(it.position) if (screenLocation.x >= 0 && screenLocation.y >= 0 && screenLocation.x <= dm.widthPixels && screenLocation.y <= dm.heightPixels) { - //在当前可观区域内 + it.icon(BitmapDescriptorFactory.fromBitmap(BitmapDescriptorFactory.fromResource(R.mipmap.well_location).bitmap)) markerOptionsInView.add(it) } } - // 自定义的聚合类MarkerCluster - val clustersMarkers: MutableList = ArrayList() markerOptionsInView.forEach { - if (clustersMarkers.size == 0) { - //添加一个新的自定义marker - clustersMarkers.add( - GaoDeClusterMarkerView(requireContext(), it, proj, LocaleConstant.RADIUS_SIZE) - ) - } else { - var isInRange = false - //Kotlin foreach不能用break - for (view in clustersMarkers) { - //判断当前的marker是否在前面marker的聚合范围内 并且每个marker只会聚合一次。 - if (view.bounds.contains(it.position)) { - view.addMarker(it) - isInRange = true - break - } - } - //如果没在任何范围内,自己单独形成一个自定义marker。在和后面的marker进行比较 - if (!isInRange) { - clustersMarkers.add( - GaoDeClusterMarkerView( - requireContext(), it, proj, LocaleConstant.RADIUS_SIZE - ) - )//相距多少才聚合 - } - } - } - // 设置聚合点的位置和icon - clustersMarkers.forEach { - it.setPositionAndIcon() - } - aMap.clear() - // 重新添加 marker - clustersMarkers.forEach { - aMap.addMarker(it.options) + aMap.addMarker(it) } } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java index 319dfbe..9f9f3f4 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java @@ -6,9 +6,9 @@ import android.util.Log; import org.greenrobot.greendao.AbstractDaoMaster; +import org.greenrobot.greendao.database.StandardDatabase; import org.greenrobot.greendao.database.Database; import org.greenrobot.greendao.database.DatabaseOpenHelper; -import org.greenrobot.greendao.database.StandardDatabase; import org.greenrobot.greendao.identityscope.IdentityScopeType; @@ -19,9 +19,7 @@ public class DaoMaster extends AbstractDaoMaster { public static final int SCHEMA_VERSION = 1; - /** - * Creates underlying database table using DAOs. - */ + /** Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { NoticeLocaleBeanDao.createTable(db, ifNotExists); } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java index c574564..196fe19 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java @@ -1,6 +1,6 @@ package com.casic.app.smartwell.greendao; -import com.casic.app.smartwell.model.NoticeLocaleBean; +import java.util.Map; import org.greenrobot.greendao.AbstractDao; import org.greenrobot.greendao.AbstractDaoSession; @@ -8,13 +8,15 @@ import org.greenrobot.greendao.identityscope.IdentityScopeType; import org.greenrobot.greendao.internal.DaoConfig; -import java.util.Map; +import com.casic.app.smartwell.model.NoticeLocaleBean; + +import com.casic.app.smartwell.greendao.NoticeLocaleBeanDao; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. /** * {@inheritDoc} - * + * * @see org.greenrobot.greendao.AbstractDaoSession */ public class DaoSession extends AbstractDaoSession { @@ -34,7 +36,7 @@ registerDao(NoticeLocaleBean.class, noticeLocaleBeanDao); } - + public void clear() { noticeLocaleBeanDaoConfig.clearIdentityScope(); } diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageFragment.kt index 313af78..713d6d0 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageFragment.kt @@ -14,10 +14,7 @@ import com.amap.api.maps.AMapOptions import com.amap.api.maps.CameraUpdateFactory import com.amap.api.maps.CoordinateConverter -import com.amap.api.maps.model.CameraPosition -import com.amap.api.maps.model.LatLng -import com.amap.api.maps.model.Marker -import com.amap.api.maps.model.MarkerOptions +import com.amap.api.maps.model.* import com.casic.app.smartwell.R import com.casic.app.smartwell.adapter.HomeRecycleAdapter import com.casic.app.smartwell.extensions.valueToType @@ -267,47 +264,12 @@ allMarkerOptions.forEach { screenLocation = proj.toScreenLocation(it.position) if (screenLocation.x >= 0 && screenLocation.y >= 0 && screenLocation.x <= dm.widthPixels && screenLocation.y <= dm.heightPixels) { - //在当前可观区域内 + it.icon(BitmapDescriptorFactory.fromBitmap(BitmapDescriptorFactory.fromResource(R.mipmap.well_location).bitmap)) markerOptionsInView.add(it) } } - // 自定义的聚合类MarkerCluster - val clustersMarkers: MutableList = ArrayList() markerOptionsInView.forEach { - if (clustersMarkers.size == 0) { - //添加一个新的自定义marker - clustersMarkers.add( - GaoDeClusterMarkerView(requireContext(), it, proj, LocaleConstant.RADIUS_SIZE) - ) - } else { - var isInRange = false - //Kotlin foreach不能用break - for (view in clustersMarkers) { - //判断当前的marker是否在前面marker的聚合范围内 并且每个marker只会聚合一次。 - if (view.bounds.contains(it.position)) { - view.addMarker(it) - isInRange = true - break - } - } - //如果没在任何范围内,自己单独形成一个自定义marker。在和后面的marker进行比较 - if (!isInRange) { - clustersMarkers.add( - GaoDeClusterMarkerView( - requireContext(), it, proj, LocaleConstant.RADIUS_SIZE - ) - )//相距多少才聚合 - } - } - } - // 设置聚合点的位置和icon - clustersMarkers.forEach { - it.setPositionAndIcon() - } - aMap.clear() - // 重新添加 marker - clustersMarkers.forEach { - aMap.addMarker(it.options) + aMap.addMarker(it) } } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java index 319dfbe..9f9f3f4 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java @@ -6,9 +6,9 @@ import android.util.Log; import org.greenrobot.greendao.AbstractDaoMaster; +import org.greenrobot.greendao.database.StandardDatabase; import org.greenrobot.greendao.database.Database; import org.greenrobot.greendao.database.DatabaseOpenHelper; -import org.greenrobot.greendao.database.StandardDatabase; import org.greenrobot.greendao.identityscope.IdentityScopeType; @@ -19,9 +19,7 @@ public class DaoMaster extends AbstractDaoMaster { public static final int SCHEMA_VERSION = 1; - /** - * Creates underlying database table using DAOs. - */ + /** Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { NoticeLocaleBeanDao.createTable(db, ifNotExists); } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java index c574564..196fe19 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java @@ -1,6 +1,6 @@ package com.casic.app.smartwell.greendao; -import com.casic.app.smartwell.model.NoticeLocaleBean; +import java.util.Map; import org.greenrobot.greendao.AbstractDao; import org.greenrobot.greendao.AbstractDaoSession; @@ -8,13 +8,15 @@ import org.greenrobot.greendao.identityscope.IdentityScopeType; import org.greenrobot.greendao.internal.DaoConfig; -import java.util.Map; +import com.casic.app.smartwell.model.NoticeLocaleBean; + +import com.casic.app.smartwell.greendao.NoticeLocaleBeanDao; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. /** * {@inheritDoc} - * + * * @see org.greenrobot.greendao.AbstractDaoSession */ public class DaoSession extends AbstractDaoSession { @@ -34,7 +36,7 @@ registerDao(NoticeLocaleBean.class, noticeLocaleBeanDao); } - + public void clear() { noticeLocaleBeanDaoConfig.clearIdentityScope(); } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java index a7c544a..3ee3247 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java @@ -3,18 +3,18 @@ import android.database.Cursor; import android.database.sqlite.SQLiteStatement; -import com.casic.app.smartwell.model.NoticeLocaleBean; - import org.greenrobot.greendao.AbstractDao; import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; import org.greenrobot.greendao.database.Database; import org.greenrobot.greendao.database.DatabaseStatement; -import org.greenrobot.greendao.internal.DaoConfig; + +import com.casic.app.smartwell.model.NoticeLocaleBean; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. -/** +/** * DAO for table "NOTICE_LOCALE_BEAN". - */ +*/ public class NoticeLocaleBeanDao extends AbstractDao { public static final String TABLENAME = "NOTICE_LOCALE_BEAN"; @@ -41,16 +41,14 @@ public NoticeLocaleBeanDao(DaoConfig config) { super(config); } - + public NoticeLocaleBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS ": ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_LOCALE_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"MESSAGE_ID\" TEXT UNIQUE ," + // 1: messageId @@ -184,7 +182,7 @@ if (isRead != null) { stmt.bindString(10, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(11, noticeTime); @@ -194,22 +192,22 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public NoticeLocaleBean readEntity(Cursor cursor, int offset) { NoticeLocaleBean entity = new NoticeLocaleBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // isRead - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10) // noticeTime + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // isRead + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10) // noticeTime ); return entity; } @@ -227,17 +225,17 @@ entity.setDeviceCode(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); entity.setIsRead(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); entity.setNoticeTime(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); - } - + } + @Override protected final Long updateKeyAfterInsert(NoticeLocaleBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(NoticeLocaleBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageFragment.kt index 313af78..713d6d0 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageFragment.kt @@ -14,10 +14,7 @@ import com.amap.api.maps.AMapOptions import com.amap.api.maps.CameraUpdateFactory import com.amap.api.maps.CoordinateConverter -import com.amap.api.maps.model.CameraPosition -import com.amap.api.maps.model.LatLng -import com.amap.api.maps.model.Marker -import com.amap.api.maps.model.MarkerOptions +import com.amap.api.maps.model.* import com.casic.app.smartwell.R import com.casic.app.smartwell.adapter.HomeRecycleAdapter import com.casic.app.smartwell.extensions.valueToType @@ -267,47 +264,12 @@ allMarkerOptions.forEach { screenLocation = proj.toScreenLocation(it.position) if (screenLocation.x >= 0 && screenLocation.y >= 0 && screenLocation.x <= dm.widthPixels && screenLocation.y <= dm.heightPixels) { - //在当前可观区域内 + it.icon(BitmapDescriptorFactory.fromBitmap(BitmapDescriptorFactory.fromResource(R.mipmap.well_location).bitmap)) markerOptionsInView.add(it) } } - // 自定义的聚合类MarkerCluster - val clustersMarkers: MutableList = ArrayList() markerOptionsInView.forEach { - if (clustersMarkers.size == 0) { - //添加一个新的自定义marker - clustersMarkers.add( - GaoDeClusterMarkerView(requireContext(), it, proj, LocaleConstant.RADIUS_SIZE) - ) - } else { - var isInRange = false - //Kotlin foreach不能用break - for (view in clustersMarkers) { - //判断当前的marker是否在前面marker的聚合范围内 并且每个marker只会聚合一次。 - if (view.bounds.contains(it.position)) { - view.addMarker(it) - isInRange = true - break - } - } - //如果没在任何范围内,自己单独形成一个自定义marker。在和后面的marker进行比较 - if (!isInRange) { - clustersMarkers.add( - GaoDeClusterMarkerView( - requireContext(), it, proj, LocaleConstant.RADIUS_SIZE - ) - )//相距多少才聚合 - } - } - } - // 设置聚合点的位置和icon - clustersMarkers.forEach { - it.setPositionAndIcon() - } - aMap.clear() - // 重新添加 marker - clustersMarkers.forEach { - aMap.addMarker(it.options) + aMap.addMarker(it) } } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java index 319dfbe..9f9f3f4 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java @@ -6,9 +6,9 @@ import android.util.Log; import org.greenrobot.greendao.AbstractDaoMaster; +import org.greenrobot.greendao.database.StandardDatabase; import org.greenrobot.greendao.database.Database; import org.greenrobot.greendao.database.DatabaseOpenHelper; -import org.greenrobot.greendao.database.StandardDatabase; import org.greenrobot.greendao.identityscope.IdentityScopeType; @@ -19,9 +19,7 @@ public class DaoMaster extends AbstractDaoMaster { public static final int SCHEMA_VERSION = 1; - /** - * Creates underlying database table using DAOs. - */ + /** Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { NoticeLocaleBeanDao.createTable(db, ifNotExists); } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java index c574564..196fe19 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java @@ -1,6 +1,6 @@ package com.casic.app.smartwell.greendao; -import com.casic.app.smartwell.model.NoticeLocaleBean; +import java.util.Map; import org.greenrobot.greendao.AbstractDao; import org.greenrobot.greendao.AbstractDaoSession; @@ -8,13 +8,15 @@ import org.greenrobot.greendao.identityscope.IdentityScopeType; import org.greenrobot.greendao.internal.DaoConfig; -import java.util.Map; +import com.casic.app.smartwell.model.NoticeLocaleBean; + +import com.casic.app.smartwell.greendao.NoticeLocaleBeanDao; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. /** * {@inheritDoc} - * + * * @see org.greenrobot.greendao.AbstractDaoSession */ public class DaoSession extends AbstractDaoSession { @@ -34,7 +36,7 @@ registerDao(NoticeLocaleBean.class, noticeLocaleBeanDao); } - + public void clear() { noticeLocaleBeanDaoConfig.clearIdentityScope(); } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java index a7c544a..3ee3247 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java @@ -3,18 +3,18 @@ import android.database.Cursor; import android.database.sqlite.SQLiteStatement; -import com.casic.app.smartwell.model.NoticeLocaleBean; - import org.greenrobot.greendao.AbstractDao; import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; import org.greenrobot.greendao.database.Database; import org.greenrobot.greendao.database.DatabaseStatement; -import org.greenrobot.greendao.internal.DaoConfig; + +import com.casic.app.smartwell.model.NoticeLocaleBean; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. -/** +/** * DAO for table "NOTICE_LOCALE_BEAN". - */ +*/ public class NoticeLocaleBeanDao extends AbstractDao { public static final String TABLENAME = "NOTICE_LOCALE_BEAN"; @@ -41,16 +41,14 @@ public NoticeLocaleBeanDao(DaoConfig config) { super(config); } - + public NoticeLocaleBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS ": ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_LOCALE_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"MESSAGE_ID\" TEXT UNIQUE ," + // 1: messageId @@ -184,7 +182,7 @@ if (isRead != null) { stmt.bindString(10, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(11, noticeTime); @@ -194,22 +192,22 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public NoticeLocaleBean readEntity(Cursor cursor, int offset) { NoticeLocaleBean entity = new NoticeLocaleBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // isRead - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10) // noticeTime + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // isRead + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10) // noticeTime ); return entity; } @@ -227,17 +225,17 @@ entity.setDeviceCode(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); entity.setIsRead(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); entity.setNoticeTime(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); - } - + } + @Override protected final Long updateKeyAfterInsert(NoticeLocaleBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(NoticeLocaleBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; diff --git a/app/src/main/java/com/casic/app/smartwell/utils/LocaleConstant.kt b/app/src/main/java/com/casic/app/smartwell/utils/LocaleConstant.kt index 5005bc9..af9aced 100644 --- a/app/src/main/java/com/casic/app/smartwell/utils/LocaleConstant.kt +++ b/app/src/main/java/com/casic/app/smartwell/utils/LocaleConstant.kt @@ -23,7 +23,7 @@ const val ACCOUNT = "account" const val PASSWORD = "password" const val DEFAULT_SERVER_CONFIG = "defaultServerConfig" - const val DEFAULT_SERVER = "http://111.198.10.15:11308" + const val DEFAULT_SERVER = "http://60.208.121.150:5001" const val USER_DETAIL_MODEL = "userDetailModel" const val APP_AUTHORITY = "com.casic.app.smartwell.fileprovider" diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageFragment.kt index 313af78..713d6d0 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageFragment.kt @@ -14,10 +14,7 @@ import com.amap.api.maps.AMapOptions import com.amap.api.maps.CameraUpdateFactory import com.amap.api.maps.CoordinateConverter -import com.amap.api.maps.model.CameraPosition -import com.amap.api.maps.model.LatLng -import com.amap.api.maps.model.Marker -import com.amap.api.maps.model.MarkerOptions +import com.amap.api.maps.model.* import com.casic.app.smartwell.R import com.casic.app.smartwell.adapter.HomeRecycleAdapter import com.casic.app.smartwell.extensions.valueToType @@ -267,47 +264,12 @@ allMarkerOptions.forEach { screenLocation = proj.toScreenLocation(it.position) if (screenLocation.x >= 0 && screenLocation.y >= 0 && screenLocation.x <= dm.widthPixels && screenLocation.y <= dm.heightPixels) { - //在当前可观区域内 + it.icon(BitmapDescriptorFactory.fromBitmap(BitmapDescriptorFactory.fromResource(R.mipmap.well_location).bitmap)) markerOptionsInView.add(it) } } - // 自定义的聚合类MarkerCluster - val clustersMarkers: MutableList = ArrayList() markerOptionsInView.forEach { - if (clustersMarkers.size == 0) { - //添加一个新的自定义marker - clustersMarkers.add( - GaoDeClusterMarkerView(requireContext(), it, proj, LocaleConstant.RADIUS_SIZE) - ) - } else { - var isInRange = false - //Kotlin foreach不能用break - for (view in clustersMarkers) { - //判断当前的marker是否在前面marker的聚合范围内 并且每个marker只会聚合一次。 - if (view.bounds.contains(it.position)) { - view.addMarker(it) - isInRange = true - break - } - } - //如果没在任何范围内,自己单独形成一个自定义marker。在和后面的marker进行比较 - if (!isInRange) { - clustersMarkers.add( - GaoDeClusterMarkerView( - requireContext(), it, proj, LocaleConstant.RADIUS_SIZE - ) - )//相距多少才聚合 - } - } - } - // 设置聚合点的位置和icon - clustersMarkers.forEach { - it.setPositionAndIcon() - } - aMap.clear() - // 重新添加 marker - clustersMarkers.forEach { - aMap.addMarker(it.options) + aMap.addMarker(it) } } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java index 319dfbe..9f9f3f4 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java @@ -6,9 +6,9 @@ import android.util.Log; import org.greenrobot.greendao.AbstractDaoMaster; +import org.greenrobot.greendao.database.StandardDatabase; import org.greenrobot.greendao.database.Database; import org.greenrobot.greendao.database.DatabaseOpenHelper; -import org.greenrobot.greendao.database.StandardDatabase; import org.greenrobot.greendao.identityscope.IdentityScopeType; @@ -19,9 +19,7 @@ public class DaoMaster extends AbstractDaoMaster { public static final int SCHEMA_VERSION = 1; - /** - * Creates underlying database table using DAOs. - */ + /** Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { NoticeLocaleBeanDao.createTable(db, ifNotExists); } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java index c574564..196fe19 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java @@ -1,6 +1,6 @@ package com.casic.app.smartwell.greendao; -import com.casic.app.smartwell.model.NoticeLocaleBean; +import java.util.Map; import org.greenrobot.greendao.AbstractDao; import org.greenrobot.greendao.AbstractDaoSession; @@ -8,13 +8,15 @@ import org.greenrobot.greendao.identityscope.IdentityScopeType; import org.greenrobot.greendao.internal.DaoConfig; -import java.util.Map; +import com.casic.app.smartwell.model.NoticeLocaleBean; + +import com.casic.app.smartwell.greendao.NoticeLocaleBeanDao; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. /** * {@inheritDoc} - * + * * @see org.greenrobot.greendao.AbstractDaoSession */ public class DaoSession extends AbstractDaoSession { @@ -34,7 +36,7 @@ registerDao(NoticeLocaleBean.class, noticeLocaleBeanDao); } - + public void clear() { noticeLocaleBeanDaoConfig.clearIdentityScope(); } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java index a7c544a..3ee3247 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java @@ -3,18 +3,18 @@ import android.database.Cursor; import android.database.sqlite.SQLiteStatement; -import com.casic.app.smartwell.model.NoticeLocaleBean; - import org.greenrobot.greendao.AbstractDao; import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; import org.greenrobot.greendao.database.Database; import org.greenrobot.greendao.database.DatabaseStatement; -import org.greenrobot.greendao.internal.DaoConfig; + +import com.casic.app.smartwell.model.NoticeLocaleBean; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. -/** +/** * DAO for table "NOTICE_LOCALE_BEAN". - */ +*/ public class NoticeLocaleBeanDao extends AbstractDao { public static final String TABLENAME = "NOTICE_LOCALE_BEAN"; @@ -41,16 +41,14 @@ public NoticeLocaleBeanDao(DaoConfig config) { super(config); } - + public NoticeLocaleBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS ": ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_LOCALE_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"MESSAGE_ID\" TEXT UNIQUE ," + // 1: messageId @@ -184,7 +182,7 @@ if (isRead != null) { stmt.bindString(10, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(11, noticeTime); @@ -194,22 +192,22 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public NoticeLocaleBean readEntity(Cursor cursor, int offset) { NoticeLocaleBean entity = new NoticeLocaleBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // isRead - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10) // noticeTime + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // isRead + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10) // noticeTime ); return entity; } @@ -227,17 +225,17 @@ entity.setDeviceCode(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); entity.setIsRead(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); entity.setNoticeTime(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); - } - + } + @Override protected final Long updateKeyAfterInsert(NoticeLocaleBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(NoticeLocaleBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; diff --git a/app/src/main/java/com/casic/app/smartwell/utils/LocaleConstant.kt b/app/src/main/java/com/casic/app/smartwell/utils/LocaleConstant.kt index 5005bc9..af9aced 100644 --- a/app/src/main/java/com/casic/app/smartwell/utils/LocaleConstant.kt +++ b/app/src/main/java/com/casic/app/smartwell/utils/LocaleConstant.kt @@ -23,7 +23,7 @@ const val ACCOUNT = "account" const val PASSWORD = "password" const val DEFAULT_SERVER_CONFIG = "defaultServerConfig" - const val DEFAULT_SERVER = "http://111.198.10.15:11308" + const val DEFAULT_SERVER = "http://60.208.121.150:5001" const val USER_DETAIL_MODEL = "userDetailModel" const val APP_AUTHORITY = "com.casic.app.smartwell.fileprovider" diff --git a/app/src/main/java/com/casic/app/smartwell/view/SearchOrderActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/SearchOrderActivity.kt index 71393f3..f7c45c2 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/SearchOrderActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/SearchOrderActivity.kt @@ -75,7 +75,12 @@ bean.deviceType = "" contentModels.add(bean) it.data!!.list?.forEach { contentTypeBean -> - contentModels.add(contentTypeBean) + /** + * 章丘项目没有如下报警 + * */ + if (contentTypeBean.name != "井盖开盖报警" && contentTypeBean.name != "浓度超限") { + contentModels.add(contentTypeBean) + } } contentTypeAdapter = object : TagAdapter(contentModels) { @@ -100,8 +105,11 @@ } }) + /** + * 章丘项目只有一/二级报警 + * */ val levelMaps: MutableList> = ArrayList() - for (i in 0..3) { + for (i in 0..2) { val map = HashMap() map["name"] = i.toString().toChinese() map["value"] = i.toLevel() diff --git a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageFragment.kt b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageFragment.kt index 313af78..713d6d0 100644 --- a/app/src/main/java/com/casic/app/smartwell/fragment/HomePageFragment.kt +++ b/app/src/main/java/com/casic/app/smartwell/fragment/HomePageFragment.kt @@ -14,10 +14,7 @@ import com.amap.api.maps.AMapOptions import com.amap.api.maps.CameraUpdateFactory import com.amap.api.maps.CoordinateConverter -import com.amap.api.maps.model.CameraPosition -import com.amap.api.maps.model.LatLng -import com.amap.api.maps.model.Marker -import com.amap.api.maps.model.MarkerOptions +import com.amap.api.maps.model.* import com.casic.app.smartwell.R import com.casic.app.smartwell.adapter.HomeRecycleAdapter import com.casic.app.smartwell.extensions.valueToType @@ -267,47 +264,12 @@ allMarkerOptions.forEach { screenLocation = proj.toScreenLocation(it.position) if (screenLocation.x >= 0 && screenLocation.y >= 0 && screenLocation.x <= dm.widthPixels && screenLocation.y <= dm.heightPixels) { - //在当前可观区域内 + it.icon(BitmapDescriptorFactory.fromBitmap(BitmapDescriptorFactory.fromResource(R.mipmap.well_location).bitmap)) markerOptionsInView.add(it) } } - // 自定义的聚合类MarkerCluster - val clustersMarkers: MutableList = ArrayList() markerOptionsInView.forEach { - if (clustersMarkers.size == 0) { - //添加一个新的自定义marker - clustersMarkers.add( - GaoDeClusterMarkerView(requireContext(), it, proj, LocaleConstant.RADIUS_SIZE) - ) - } else { - var isInRange = false - //Kotlin foreach不能用break - for (view in clustersMarkers) { - //判断当前的marker是否在前面marker的聚合范围内 并且每个marker只会聚合一次。 - if (view.bounds.contains(it.position)) { - view.addMarker(it) - isInRange = true - break - } - } - //如果没在任何范围内,自己单独形成一个自定义marker。在和后面的marker进行比较 - if (!isInRange) { - clustersMarkers.add( - GaoDeClusterMarkerView( - requireContext(), it, proj, LocaleConstant.RADIUS_SIZE - ) - )//相距多少才聚合 - } - } - } - // 设置聚合点的位置和icon - clustersMarkers.forEach { - it.setPositionAndIcon() - } - aMap.clear() - // 重新添加 marker - clustersMarkers.forEach { - aMap.addMarker(it.options) + aMap.addMarker(it) } } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java index 319dfbe..9f9f3f4 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoMaster.java @@ -6,9 +6,9 @@ import android.util.Log; import org.greenrobot.greendao.AbstractDaoMaster; +import org.greenrobot.greendao.database.StandardDatabase; import org.greenrobot.greendao.database.Database; import org.greenrobot.greendao.database.DatabaseOpenHelper; -import org.greenrobot.greendao.database.StandardDatabase; import org.greenrobot.greendao.identityscope.IdentityScopeType; @@ -19,9 +19,7 @@ public class DaoMaster extends AbstractDaoMaster { public static final int SCHEMA_VERSION = 1; - /** - * Creates underlying database table using DAOs. - */ + /** Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { NoticeLocaleBeanDao.createTable(db, ifNotExists); } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java index c574564..196fe19 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/DaoSession.java @@ -1,6 +1,6 @@ package com.casic.app.smartwell.greendao; -import com.casic.app.smartwell.model.NoticeLocaleBean; +import java.util.Map; import org.greenrobot.greendao.AbstractDao; import org.greenrobot.greendao.AbstractDaoSession; @@ -8,13 +8,15 @@ import org.greenrobot.greendao.identityscope.IdentityScopeType; import org.greenrobot.greendao.internal.DaoConfig; -import java.util.Map; +import com.casic.app.smartwell.model.NoticeLocaleBean; + +import com.casic.app.smartwell.greendao.NoticeLocaleBeanDao; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. /** * {@inheritDoc} - * + * * @see org.greenrobot.greendao.AbstractDaoSession */ public class DaoSession extends AbstractDaoSession { @@ -34,7 +36,7 @@ registerDao(NoticeLocaleBean.class, noticeLocaleBeanDao); } - + public void clear() { noticeLocaleBeanDaoConfig.clearIdentityScope(); } diff --git a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java index a7c544a..3ee3247 100644 --- a/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java +++ b/app/src/main/java/com/casic/app/smartwell/greendao/NoticeLocaleBeanDao.java @@ -3,18 +3,18 @@ import android.database.Cursor; import android.database.sqlite.SQLiteStatement; -import com.casic.app.smartwell.model.NoticeLocaleBean; - import org.greenrobot.greendao.AbstractDao; import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; import org.greenrobot.greendao.database.Database; import org.greenrobot.greendao.database.DatabaseStatement; -import org.greenrobot.greendao.internal.DaoConfig; + +import com.casic.app.smartwell.model.NoticeLocaleBean; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. -/** +/** * DAO for table "NOTICE_LOCALE_BEAN". - */ +*/ public class NoticeLocaleBeanDao extends AbstractDao { public static final String TABLENAME = "NOTICE_LOCALE_BEAN"; @@ -41,16 +41,14 @@ public NoticeLocaleBeanDao(DaoConfig config) { super(config); } - + public NoticeLocaleBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** - * Creates the underlying database table. - */ + /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists ? "IF NOT EXISTS ": ""; + String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_LOCALE_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"MESSAGE_ID\" TEXT UNIQUE ," + // 1: messageId @@ -184,7 +182,7 @@ if (isRead != null) { stmt.bindString(10, isRead); } - + String noticeTime = entity.getNoticeTime(); if (noticeTime != null) { stmt.bindString(11, noticeTime); @@ -194,22 +192,22 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public NoticeLocaleBean readEntity(Cursor cursor, int offset) { NoticeLocaleBean entity = new NoticeLocaleBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // isRead - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10) // noticeTime + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // messageId + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // appid + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // clientId + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskId + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // userId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // title + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // content + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // deviceCode + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // isRead + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10) // noticeTime ); return entity; } @@ -227,17 +225,17 @@ entity.setDeviceCode(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); entity.setIsRead(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); entity.setNoticeTime(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); - } - + } + @Override protected final Long updateKeyAfterInsert(NoticeLocaleBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(NoticeLocaleBean entity) { - if (entity != null) { + if(entity != null) { return entity.getId(); } else { return null; diff --git a/app/src/main/java/com/casic/app/smartwell/utils/LocaleConstant.kt b/app/src/main/java/com/casic/app/smartwell/utils/LocaleConstant.kt index 5005bc9..af9aced 100644 --- a/app/src/main/java/com/casic/app/smartwell/utils/LocaleConstant.kt +++ b/app/src/main/java/com/casic/app/smartwell/utils/LocaleConstant.kt @@ -23,7 +23,7 @@ const val ACCOUNT = "account" const val PASSWORD = "password" const val DEFAULT_SERVER_CONFIG = "defaultServerConfig" - const val DEFAULT_SERVER = "http://111.198.10.15:11308" + const val DEFAULT_SERVER = "http://60.208.121.150:5001" const val USER_DETAIL_MODEL = "userDetailModel" const val APP_AUTHORITY = "com.casic.app.smartwell.fileprovider" diff --git a/app/src/main/java/com/casic/app/smartwell/view/SearchOrderActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/SearchOrderActivity.kt index 71393f3..f7c45c2 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/SearchOrderActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/SearchOrderActivity.kt @@ -75,7 +75,12 @@ bean.deviceType = "" contentModels.add(bean) it.data!!.list?.forEach { contentTypeBean -> - contentModels.add(contentTypeBean) + /** + * 章丘项目没有如下报警 + * */ + if (contentTypeBean.name != "井盖开盖报警" && contentTypeBean.name != "浓度超限") { + contentModels.add(contentTypeBean) + } } contentTypeAdapter = object : TagAdapter(contentModels) { @@ -100,8 +105,11 @@ } }) + /** + * 章丘项目只有一/二级报警 + * */ val levelMaps: MutableList> = ArrayList() - for (i in 0..3) { + for (i in 0..2) { val map = HashMap() map["name"] = i.toString().toChinese() map["value"] = i.toLevel() diff --git a/app/src/main/java/com/casic/app/smartwell/view/SplashScreenActivity.kt b/app/src/main/java/com/casic/app/smartwell/view/SplashScreenActivity.kt index f53ee53..b60a8ab 100644 --- a/app/src/main/java/com/casic/app/smartwell/view/SplashScreenActivity.kt +++ b/app/src/main/java/com/casic/app/smartwell/view/SplashScreenActivity.kt @@ -20,11 +20,11 @@ userViewModel.userDetailModel.observe(this@SplashScreenActivity, { if (it.code == 200) { navigatePageTo() - finish() + } else { + navigatePageTo() } + finish() }) - navigatePageTo() - finish() } override fun onTick(millisUntilFinished: Long) {