查deal_sample表,加city
This commit is contained in:
+2
-2
@@ -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);
|
||||
|
||||
|
||||
+1
-1
@@ -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){
|
||||
|
||||
+1
-1
@@ -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){
|
||||
|
||||
+2
-3
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -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);
|
||||
}
|
||||
|
||||
+2
-1
@@ -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));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user