Commit 485f138d authored by lixinglin's avatar lixinglin

经纬度信息填充,

载体 字段weight类型bug修复
parent 698b272f
...@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.IdType; ...@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
...@@ -14,10 +15,9 @@ import lombok.Data; ...@@ -14,10 +15,9 @@ import lombok.Data;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
/** /**
*
* @TableName carrier_info 载体主表 * @TableName carrier_info 载体主表
*/ */
@TableName(value ="carrier_info") @TableName(value = "carrier_info")
@Data @Data
public class CarrierInfo implements Serializable { public class CarrierInfo implements Serializable {
...@@ -155,7 +155,7 @@ public class CarrierInfo implements Serializable { ...@@ -155,7 +155,7 @@ public class CarrierInfo implements Serializable {
private String imgUrl; private String imgUrl;
@ApiModelProperty(value = "承重") @ApiModelProperty(value = "承重")
private String weight; private Double weight;
@TableField(exist = false) @TableField(exist = false)
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
......
...@@ -485,4 +485,9 @@ public class DevelopmentInfo implements Serializable { ...@@ -485,4 +485,9 @@ public class DevelopmentInfo implements Serializable {
@TableField(exist = false) @TableField(exist = false)
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "经度")
private BigDecimal longitude;
@ApiModelProperty(value = "纬度")
private BigDecimal latitude;
} }
\ No newline at end of file
...@@ -480,4 +480,9 @@ public class ParkInfo implements Serializable { ...@@ -480,4 +480,9 @@ public class ParkInfo implements Serializable {
@TableField(exist = false) @TableField(exist = false)
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "经度")
private BigDecimal longitude;
@ApiModelProperty(value = "纬度")
private BigDecimal latitude;
} }
\ No newline at end of file
...@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; ...@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lyy.admin.VO.*; import com.lyy.admin.VO.*;
import com.lyy.admin.common.utils.BusinessService;
import com.lyy.admin.domain.FileSource; import com.lyy.admin.domain.FileSource;
import com.lyy.admin.enumerate.*; import com.lyy.admin.enumerate.*;
import com.lyy.admin.common.exception.APIException; import com.lyy.admin.common.exception.APIException;
...@@ -33,6 +34,8 @@ import org.springframework.transaction.annotation.Propagation; ...@@ -33,6 +34,8 @@ import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -675,6 +678,39 @@ public class DevelopmentInfoServiceImpl extends ServiceImpl<DevelopmentInfoMappe ...@@ -675,6 +678,39 @@ public class DevelopmentInfoServiceImpl extends ServiceImpl<DevelopmentInfoMappe
} }
return result; return result;
} }
@Resource
BusinessService businessService;
@Override
public boolean saveOrUpdate(DevelopmentInfo developmentInfo) {
aSyncUpateLocation(developmentInfo);
return super.saveOrUpdate(developmentInfo);
}
public void aSyncUpateLocation(DevelopmentInfo entity) {
String address = entity.getAddress();
String city = entity.getCityName();
if (!StringUtils.isEmpty(address)) {
try {
String userIdetify = businessService.getUserIdetify(address, city);
if (!StringUtils.isEmpty(userIdetify)) {
String[] split = userIdetify.split(",");
if (split.length == 2) {
String longitudeStr = split[0];
BigDecimal longitude = new BigDecimal(longitudeStr);
String latitudeStr = split[1];
BigDecimal latitude = new BigDecimal(latitudeStr);
entity.setLongitude(longitude);
entity.setLatitude(latitude);
super.saveOrUpdate(entity);
}
}
} catch (Exception e) {
// throw new RuntimeException(e);
}
}
}
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment