Merge remote-tracking branch 'origin/open_v2' into open_v2

This commit is contained in:
2026-02-01 08:21:20 +08:00
6 changed files with 9 additions and 9 deletions
@@ -144,7 +144,7 @@ public class CommercialController {
JSONObject locObj = json.getJSONObject("location");
Double lng = locObj.getDouble("lon");
Double lat = locObj.getDouble("lat");
List<DealSample> houseSelf = dealSampleService.querySampleByLocation(lng, lat, model.getMinPrice(), model.getMaxPrice(), "shop_sell", 30);
List<DealSample> houseSelf = dealSampleService.querySampleByLocation(json.getString("city"), lng, lat, model.getMinPrice(), model.getMaxPrice(), "shop_sell", 30);
List<BusinessCaseDto> dtos = createSample(houseSelf, "sell", ratio, lng, lat, unitPrice.doubleValue());
if(dtos!=null && dtos.size()>5){
@@ -419,7 +419,7 @@ public class CommercialController {
JSONObject locObj = json.getJSONObject("location");
Double lng = locObj.getDouble("lon");
Double lat = locObj.getDouble("lat");
List<DealSample> houseSelf = dealSampleService.querySampleByLocation(lng, lat, DataUtil.getDoubleRound(2, minPrice), DataUtil.getDoubleRound(2, maxPrice), "shop_rent", 30);
List<DealSample> houseSelf = dealSampleService.querySampleByLocation(json.getString("city"), lng, lat, DataUtil.getDoubleRound(2, minPrice), DataUtil.getDoubleRound(2, maxPrice), "shop_rent", 30);
List<BusinessCaseDto> dtos = createSample(houseSelf, "rent", ratio, lng, lat, unitPrice);
@@ -904,7 +904,7 @@ public class OfficeController {
Double lng = district.getLng()/10000000000.0;
Double lat = district.getLat()/10000000000.0;
List<DealSample> houseSelf = dealSampleService.querySampleByLocation(lng, lat, DataUtil.getDoubleRound(2, minPrice), DataUtil.getDoubleRound(2, maxPrice), "office_rent", pager.getPageSize());
List<DealSample> houseSelf = dealSampleService.querySampleByLocation(district.getCity(), lng, lat, DataUtil.getDoubleRound(2, minPrice), DataUtil.getDoubleRound(2, maxPrice), "office_rent", pager.getPageSize());
List<BusinessCaseDto> createBusiness = createSample(houseSelf, "office_rent", district, ratio, lng, lat, unitPrice);
if(createBusiness!=null && createBusiness.size()>5){
@@ -642,7 +642,7 @@ public class OfficeSellController {
Double lng = district.getLng()/10000000000.0;
Double lat = district.getLat()/10000000000.0;
List<DealSample> houseSelf = dealSampleService.querySampleByLocation(lng, lat, model.getMinPrice(), model.getMaxPrice(), "office_sell", pager.getPageSize());
List<DealSample> houseSelf = dealSampleService.querySampleByLocation(district.getCity(), lng, lat, model.getMinPrice(), model.getMaxPrice(), "office_sell", pager.getPageSize());
List<BusinessCaseDto> createBusiness = createSample(houseSelf, "office_sell", district, ratio, lng, lat, unitPrice);
if(createBusiness!=null && createBusiness.size()>5){
@@ -6720,7 +6720,7 @@ public class PropertyController {
}
if(caseDtos.size() < pager.getPageSize()){
List<DealSample> houseSelf = dealSampleService.querySampleByLocation(district.getLng()/10000000000.0, district.getLat()/10000000000.0, minPrice, maxPrice, "rent", pager.getPageSize());
List<DealSample> houseSelf = dealSampleService.querySampleByLocation(district.getCity(),district.getLng()/10000000000.0, district.getLat()/10000000000.0, minPrice, maxPrice, "rent", pager.getPageSize());
if(houseSelf!=null && houseSelf.size()>0){
caseDtos = createHouseSample(caseDtos, houseSelf, model.getShowSource(), ratio, district.getLng()/10000000000.0, district.getLat()/10000000000.0, avgPrice);
}
@@ -6842,11 +6842,10 @@ public class PropertyController {
}
if(caseDtos.size() < pager.getPageSize()){
List<DealSample> houseSelf = dealSampleService.querySampleByLocation(district.getLng()/10000000000.0, district.getLat()/10000000000.0, minPrice, maxPrice, "sell", pager.getPageSize());
List<DealSample> houseSelf = dealSampleService.querySampleByLocation(district.getCity(), district.getLng()/10000000000.0, district.getLat()/10000000000.0, minPrice, maxPrice, "sell", pager.getPageSize());
if(houseSelf!=null && houseSelf.size()>0){
caseDtos = createHouseSample(caseDtos, houseSelf, model.getShowSource(), ratio, district.getLng()/10000000000.0, district.getLat()/10000000000.0, avgPrice);
}
}
}
@@ -6,5 +6,5 @@ import scala.math.Numeric;
import java.util.List;
public interface DealSampleService {
List<DealSample> querySampleByLocation(Double lng, Double lat, Number minPrice, Number maxPrice, String cat, int pageSize);
List<DealSample> querySampleByLocation(String city, Double lng, Double lat, Number minPrice, Number maxPrice, String cat, int pageSize);
}
@@ -27,7 +27,7 @@ public class DealSampleServiceImpl implements DealSampleService{
}
@Override
public List<DealSample> querySampleByLocation(Double lng, Double lat, Number minPrice, Number maxPrice, String cat, int pageSize) {
public List<DealSample> querySampleByLocation(String city, Double lng, Double lat, Number minPrice, Number maxPrice, String cat, int pageSize) {
if(lng!=null && lat!=null){
List<QueryParam> params = new ArrayList<QueryParam>();
BasicDBObject geo = new BasicDBObject();
@@ -37,6 +37,7 @@ public class DealSampleServiceImpl implements DealSampleService{
nearQuery.append("$maxDistance", 3000);
geo.append("$near", nearQuery);
params.add(new QueryParam("city", city));
params.add(new QueryParam("cat", cat));
params.add(new QueryParam("location", geo));