Ver Fonte

CameraPhoto 中的 lat 或 lng 为 0 时将 geo_valid 设置为 false

reghao há 7 meses atrás
pai
commit
82fb9c8121

+ 4 - 2
content/content-service/src/main/java/cn/reghao/tnb/content/app/geo/model/po/CameraPhoto.java

@@ -40,14 +40,16 @@ public class CameraPhoto extends BaseObject<Integer> {
         this.manufacturer = camPhoto.getManufacturer();
         this.model = camPhoto.getModel();
         this.software = camPhoto.getSoftware();
-        if (camPhoto.getLongitude() != null) {
+        Double lng = camPhoto.getLongitude();
+        if (lng != null && lng != 0.0) {
             this.longitude = BigDecimal.valueOf(camPhoto.getLongitude());
             this.geoValid = true;
         } else {
             this.geoValid = false;
         }
 
-        if (camPhoto.getLatitude() != null) {
+        Double lat = camPhoto.getLatitude();
+        if (lat != null && lat != 0.0) {
             this.latitude = BigDecimal.valueOf(camPhoto.getLatitude());
             this.geoValid = true;
         } else {