/house/around 完善
This commit is contained in:
@@ -376,6 +376,12 @@ public class SeawaterDaoImpl extends com.fangjia.dal.SeawaterDaoImpl<Seawater> i
|
|||||||
if(source.containsKey("elevator")){
|
if(source.containsKey("elevator")){
|
||||||
seawater.setElevator(source.getString("elevator"));
|
seawater.setElevator(source.getString("elevator"));
|
||||||
}
|
}
|
||||||
|
if(source.containsKey("level")){
|
||||||
|
seawater.setLevel(source.getString("level"));
|
||||||
|
}
|
||||||
|
if(source.containsKey("business_range")){
|
||||||
|
seawater.setBusinessRange(source.getString("business_range"));
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
seawater.setDistance((int)jsonList.get(i).getJSONArray("sort").getDouble(0));
|
seawater.setDistance((int)jsonList.get(i).getJSONArray("sort").getDouble(0));
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
|
|||||||
@@ -84,6 +84,20 @@ public class Seawater implements SeawaterEntity {
|
|||||||
|
|
||||||
private String location;
|
private String location;
|
||||||
|
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
// 商铺经营范围
|
||||||
|
private String businessScope;
|
||||||
|
private String businessRange;
|
||||||
|
|
||||||
|
//商铺类型
|
||||||
|
private String shopType;
|
||||||
|
|
||||||
|
// 写字楼等级
|
||||||
|
private String level;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
@Column(name = "_id")
|
@Column(name = "_id")
|
||||||
public String getId() {
|
public String getId() {
|
||||||
@@ -473,4 +487,46 @@ public class Seawater implements SeawaterEntity {
|
|||||||
public void setLocation(String location) {
|
public void setLocation(String location) {
|
||||||
this.location = location;
|
this.location = location;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getTitle() {
|
||||||
|
return title;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTitle(String title) {
|
||||||
|
this.title = title;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBusinessScope() {
|
||||||
|
return businessScope;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBusinessScope(String businessScope) {
|
||||||
|
this.businessScope = businessScope;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getShopType() {
|
||||||
|
return shopType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setShopType(String shopType) {
|
||||||
|
this.shopType = shopType;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Column(name = "level")
|
||||||
|
public String getLevel() {
|
||||||
|
return level;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLevel(String level) {
|
||||||
|
this.level = level;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Column(name = "business_range")
|
||||||
|
public String getBusinessRange() {
|
||||||
|
return businessRange;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBusinessRange(String businessRange) {
|
||||||
|
this.businessRange = businessRange;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+41
-33
@@ -1014,11 +1014,21 @@ public class HouseController {
|
|||||||
seawater.setCity(house.getCity());
|
seawater.setCity(house.getCity());
|
||||||
seawater.setDistrict(house.getRegion());
|
seawater.setDistrict(house.getRegion());
|
||||||
seawater.setAddress(house.getAddress());
|
seawater.setAddress(house.getAddress());
|
||||||
String districtName = house.getDistrictName();
|
seawater.setName(house.getDistrictName());
|
||||||
if (!"暂无数据".equals(districtName) && StringUtils.isNotBlank(districtName)) {
|
String name = house.getName();
|
||||||
seawater.setName(districtName);
|
if (!"暂无数据".equals(name) && StringUtils.isNotBlank(name)) {
|
||||||
}else {
|
seawater.setTitle(name);
|
||||||
seawater.setName(house.getName());
|
}
|
||||||
|
if (cat.contains("office")){
|
||||||
|
seawater.setLevel(house.getLevel());
|
||||||
|
}
|
||||||
|
if (cat.contains("shop")){
|
||||||
|
if (StringUtils.isNotBlank(house.getEstateType()) && !"其他".equals(house.getEstateType())){
|
||||||
|
seawater.setShopType(house.getEstateType());
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotBlank(house.getBusinessRange())){
|
||||||
|
seawater.setBusinessScope(house.getBusinessRange());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
seawater.setSize(house.getArea() == null || house.getArea() == 0 ? null : house.getArea());
|
seawater.setSize(house.getArea() == null || house.getArea() == 0 ? null : house.getArea());
|
||||||
seawater.setUnitPrice(house.getAvgPrice() == null || house.getAvgPrice() == 0 ? null : house.getAvgPrice());
|
seawater.setUnitPrice(house.getAvgPrice() == null || house.getAvgPrice() == 0 ? null : house.getAvgPrice());
|
||||||
@@ -1029,37 +1039,36 @@ public class HouseController {
|
|||||||
seawater.setRoom(house.getRoom() == null || house.getRoom() == 0 ? null : house.getRoom());
|
seawater.setRoom(house.getRoom() == null || house.getRoom() == 0 ? null : house.getRoom());
|
||||||
seawater.setHall(house.getHall() == null || house.getHall() == 0 ? null : house.getHall());
|
seawater.setHall(house.getHall() == null || house.getHall() == 0 ? null : house.getHall());
|
||||||
seawater.setToilet(house.getToilet() == null || house.getToilet() == 0 ? null : house.getToilet());
|
seawater.setToilet(house.getToilet() == null || house.getToilet() == 0 ? null : house.getToilet());
|
||||||
if (house.getAvgPrice() != null && house.getAvgPrice() != 0) {
|
seawater.setDecoration(house.getFitment());
|
||||||
seawater.setDecoration(house.getFitment());
|
if (house.getpDate() != null && house.getpDate() > 10000000) {
|
||||||
if (house.getpDate() != null && house.getpDate() > 10000000) {
|
String numberStr = String.valueOf(house.getpDate());
|
||||||
String numberStr = String.valueOf(house.getpDate());
|
// 拆分字符串并格式化
|
||||||
// 拆分字符串并格式化
|
String year = numberStr.substring(0, 4); // 前四位是年份
|
||||||
String year = numberStr.substring(0, 4); // 前四位是年份
|
String month = numberStr.substring(4, 6); // 中间两位是月份
|
||||||
String month = numberStr.substring(4, 6); // 中间两位是月份
|
String day = numberStr.substring(6, 8); // 最后两位是日期
|
||||||
String day = numberStr.substring(6, 8); // 最后两位是日期
|
String formattedDate = year + "-" + month + "-" + day;
|
||||||
String formattedDate = year + "-" + month + "-" + day;
|
seawater.setPublishDate(formattedDate);
|
||||||
seawater.setPublishDate(formattedDate);
|
}
|
||||||
}
|
seawater.setDistance(house.getDistance());
|
||||||
seawater.setDistance(house.getDistance());
|
if (StringUtils.isNotBlank(house.getLocation())) {
|
||||||
if (StringUtils.isNotBlank(house.getLocation())) {
|
if ("2".equals(model.getLocationType())) {
|
||||||
if ("2".equals(model.getLocationType())) {
|
String[] split = house.getLocation().split(",");
|
||||||
String[] split = house.getLocation().split(",");
|
Double lon = Double.valueOf(split[0]);
|
||||||
Double lon = Double.valueOf(split[0]);
|
Double latt = Double.valueOf(split[1]);
|
||||||
Double latt = Double.valueOf(split[1]);
|
Map<String, Double> toBd09 = GeoUtils.gcj02ToBd09(latt, lon);
|
||||||
Map<String, Double> toBd09 = GeoUtils.gcj02ToBd09(latt, lon);
|
seawater.setLocation(sub6(toBd09.get("lng")) + "," + sub6(toBd09.get("lat")));
|
||||||
seawater.setLocation(sub6(toBd09.get("lng")) + "," + sub6(toBd09.get("lat")));
|
} else {
|
||||||
} else {
|
String location = house.getLocation();
|
||||||
String location = house.getLocation();
|
String[] split = location.split(",");
|
||||||
String[] split = location.split(",");
|
if (split.length == 2) {
|
||||||
if (split.length == 2) {
|
String location1 = sub6(Double.valueOf(split[0])) + "," + sub6(Double.valueOf(split[1]));
|
||||||
String location1 = sub6(Double.valueOf(split[0])) + "," + sub6(Double.valueOf(split[1]));
|
seawater.setLocation(location1);
|
||||||
seawater.setLocation(location1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
houseList.add(seawater);
|
|
||||||
}
|
}
|
||||||
|
houseList.add(seawater);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// } else {
|
// } else {
|
||||||
// if ("sell".equals(cat)) {
|
// if ("sell".equals(cat)) {
|
||||||
// List<House> houseByLocation = houseService.findNearestHasHouseByLocation(model.getCity(), lat, lng, cat, model.getRadius(), 5);
|
// List<House> houseByLocation = houseService.findNearestHasHouseByLocation(model.getCity(), lat, lng, cat, model.getRadius(), 5);
|
||||||
@@ -1129,7 +1138,6 @@ public class HouseController {
|
|||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
BasicModel basicModel = new BasicModel(200, "ok");
|
BasicModel basicModel = new BasicModel(200, "ok");
|
||||||
|
|||||||
Reference in New Issue
Block a user