/house/around 完善
This commit is contained in:
+41
-33
@@ -1014,11 +1014,21 @@ public class HouseController {
|
||||
seawater.setCity(house.getCity());
|
||||
seawater.setDistrict(house.getRegion());
|
||||
seawater.setAddress(house.getAddress());
|
||||
String districtName = house.getDistrictName();
|
||||
if (!"暂无数据".equals(districtName) && StringUtils.isNotBlank(districtName)) {
|
||||
seawater.setName(districtName);
|
||||
}else {
|
||||
seawater.setName(house.getName());
|
||||
seawater.setName(house.getDistrictName());
|
||||
String name = house.getName();
|
||||
if (!"暂无数据".equals(name) && StringUtils.isNotBlank(name)) {
|
||||
seawater.setTitle(name);
|
||||
}
|
||||
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.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.setHall(house.getHall() == null || house.getHall() == 0 ? null : house.getHall());
|
||||
seawater.setToilet(house.getToilet() == null || house.getToilet() == 0 ? null : house.getToilet());
|
||||
if (house.getAvgPrice() != null && house.getAvgPrice() != 0) {
|
||||
seawater.setDecoration(house.getFitment());
|
||||
if (house.getpDate() != null && house.getpDate() > 10000000) {
|
||||
String numberStr = String.valueOf(house.getpDate());
|
||||
// 拆分字符串并格式化
|
||||
String year = numberStr.substring(0, 4); // 前四位是年份
|
||||
String month = numberStr.substring(4, 6); // 中间两位是月份
|
||||
String day = numberStr.substring(6, 8); // 最后两位是日期
|
||||
String formattedDate = year + "-" + month + "-" + day;
|
||||
seawater.setPublishDate(formattedDate);
|
||||
}
|
||||
seawater.setDistance(house.getDistance());
|
||||
if (StringUtils.isNotBlank(house.getLocation())) {
|
||||
if ("2".equals(model.getLocationType())) {
|
||||
String[] split = house.getLocation().split(",");
|
||||
Double lon = Double.valueOf(split[0]);
|
||||
Double latt = Double.valueOf(split[1]);
|
||||
Map<String, Double> toBd09 = GeoUtils.gcj02ToBd09(latt, lon);
|
||||
seawater.setLocation(sub6(toBd09.get("lng")) + "," + sub6(toBd09.get("lat")));
|
||||
} else {
|
||||
String location = house.getLocation();
|
||||
String[] split = location.split(",");
|
||||
if (split.length == 2) {
|
||||
String location1 = sub6(Double.valueOf(split[0])) + "," + sub6(Double.valueOf(split[1]));
|
||||
seawater.setLocation(location1);
|
||||
}
|
||||
seawater.setDecoration(house.getFitment());
|
||||
if (house.getpDate() != null && house.getpDate() > 10000000) {
|
||||
String numberStr = String.valueOf(house.getpDate());
|
||||
// 拆分字符串并格式化
|
||||
String year = numberStr.substring(0, 4); // 前四位是年份
|
||||
String month = numberStr.substring(4, 6); // 中间两位是月份
|
||||
String day = numberStr.substring(6, 8); // 最后两位是日期
|
||||
String formattedDate = year + "-" + month + "-" + day;
|
||||
seawater.setPublishDate(formattedDate);
|
||||
}
|
||||
seawater.setDistance(house.getDistance());
|
||||
if (StringUtils.isNotBlank(house.getLocation())) {
|
||||
if ("2".equals(model.getLocationType())) {
|
||||
String[] split = house.getLocation().split(",");
|
||||
Double lon = Double.valueOf(split[0]);
|
||||
Double latt = Double.valueOf(split[1]);
|
||||
Map<String, Double> toBd09 = GeoUtils.gcj02ToBd09(latt, lon);
|
||||
seawater.setLocation(sub6(toBd09.get("lng")) + "," + sub6(toBd09.get("lat")));
|
||||
} else {
|
||||
String location = house.getLocation();
|
||||
String[] split = location.split(",");
|
||||
if (split.length == 2) {
|
||||
String location1 = sub6(Double.valueOf(split[0])) + "," + sub6(Double.valueOf(split[1]));
|
||||
seawater.setLocation(location1);
|
||||
}
|
||||
}
|
||||
houseList.add(seawater);
|
||||
}
|
||||
houseList.add(seawater);
|
||||
}
|
||||
}
|
||||
// } else {
|
||||
// if ("sell".equals(cat)) {
|
||||
// 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");
|
||||
|
||||
Reference in New Issue
Block a user