Commit 87a4f724c847455e6022e478a8be9a91b094f4f3
1 parent
ac04b79d
修改经纬度信息
Showing
2 changed files
with
25 additions
and
18 deletions
trash-garbage/src/main/java/com/trash/garbage/pojo/domain/DisposalSiteEntity.java
| 1 | 1 | package com.trash.garbage.pojo.domain; |
| 2 | 2 | |
| 3 | 3 | import com.baomidou.mybatisplus.annotation.TableName; |
| 4 | +import org.apache.commons.lang3.StringUtils; | |
| 4 | 5 | |
| 5 | 6 | /** |
| 6 | 7 | * @author liujun |
| ... | ... | @@ -201,14 +202,11 @@ public class DisposalSiteEntity implements java.io.Serializable { |
| 201 | 202 | // */ |
| 202 | 203 | // private String auditStatus; |
| 203 | 204 | |
| 205 | + | |
| 204 | 206 | /** |
| 205 | - * 经度 | |
| 206 | - */ | |
| 207 | - private Double longitude; | |
| 208 | - /** | |
| 209 | - * 纬度 | |
| 207 | + * 经度和纬度 | |
| 210 | 208 | */ |
| 211 | - private Double latitude; | |
| 209 | + private String addressGps; | |
| 212 | 210 | |
| 213 | 211 | |
| 214 | 212 | public Long getId() { |
| ... | ... | @@ -244,20 +242,12 @@ public class DisposalSiteEntity implements java.io.Serializable { |
| 244 | 242 | } |
| 245 | 243 | |
| 246 | 244 | |
| 247 | - public Double getLongitude() { | |
| 248 | - return longitude; | |
| 249 | - } | |
| 250 | - | |
| 251 | - public void setLongitude(Double longitude) { | |
| 252 | - this.longitude = longitude; | |
| 245 | + public String getAddressGps() { | |
| 246 | + return addressGps; | |
| 253 | 247 | } |
| 254 | 248 | |
| 255 | - public Double getLatitude() { | |
| 256 | - return latitude; | |
| 257 | - } | |
| 258 | - | |
| 259 | - public void setLatitude(Double latitude) { | |
| 260 | - this.latitude = latitude; | |
| 249 | + public void setAddressGps(String addressGps) { | |
| 250 | + this.addressGps = addressGps; | |
| 261 | 251 | } |
| 262 | 252 | |
| 263 | 253 | public String getLocalArea() { |
| ... | ... | @@ -283,4 +273,20 @@ public class DisposalSiteEntity implements java.io.Serializable { |
| 283 | 273 | public void setConstructionUnitPersonPhone(String constructionUnitPersonPhone) { |
| 284 | 274 | this.constructionUnitPersonPhone = constructionUnitPersonPhone; |
| 285 | 275 | } |
| 276 | + | |
| 277 | + public Double getLongitude() { | |
| 278 | + if (StringUtils.isEmpty(getAddressGps())) { | |
| 279 | + return null; | |
| 280 | + } | |
| 281 | + String value = StringUtils.substringBefore(getAddressGps(), ","); | |
| 282 | + return StringUtils.isEmpty(value) ? null : Double.parseDouble(value); | |
| 283 | + } | |
| 284 | + | |
| 285 | + public Double getLatitude() { | |
| 286 | + if (StringUtils.isEmpty(getAddressGps())) { | |
| 287 | + return null; | |
| 288 | + } | |
| 289 | + String value = StringUtils.substringAfter(getAddressGps(), ","); | |
| 290 | + return StringUtils.isEmpty(value) ? null : Double.parseDouble(value); | |
| 291 | + } | |
| 286 | 292 | } | ... | ... |
trash-garbage/src/main/java/com/trash/garbage/service/impl/GarOrderServiceImpl.java
| ... | ... | @@ -221,6 +221,7 @@ public class GarOrderServiceImpl extends ServiceImpl<GarOrderMapper, GarOrder> |
| 221 | 221 | } |
| 222 | 222 | DisposalSiteVo vo = new DisposalSiteVo(); |
| 223 | 223 | BeanUtils.copyProperties(en, vo); |
| 224 | + // vo.setLongitude(en.getLongitude()); | |
| 224 | 225 | return vo; |
| 225 | 226 | }).filter(obj -> Objects.nonNull(obj)).collect(Collectors.toList()); |
| 226 | 227 | } | ... | ... |