添加相似样本面积控制
This commit is contained in:
+10
-9
@@ -229,7 +229,7 @@ public class CzbankSampleServiceImpl implements CzbankSampleService {
|
||||
}
|
||||
}
|
||||
|
||||
List<SampleWrapper> samples = findJnbankSampleByDistrict(district, keys, names, queryBean.getPropertyTypeCode(), queryBean.getUpdateDate(), districtStat);
|
||||
List<SampleWrapper> samples = findJnbankSampleByDistrict(district, keys, names, queryBean.getPropertyTypeCode(), queryBean.getUpdateDate(), districtStat, target.getStrctureArea());
|
||||
|
||||
// scoreForSample(samples, target);
|
||||
sortForSample(samples, target);
|
||||
@@ -269,7 +269,7 @@ public class CzbankSampleServiceImpl implements CzbankSampleService {
|
||||
}
|
||||
}
|
||||
|
||||
List<SampleWrapper> nearlySample = findJnbankSampleByDistrict(district, arroundKeys, arroundNnames, queryBean.getPropertyTypeCode(), queryBean.getUpdateDate(), districtStat);
|
||||
List<SampleWrapper> nearlySample = findJnbankSampleByDistrict(district, arroundKeys, arroundNnames, queryBean.getPropertyTypeCode(), queryBean.getUpdateDate(), districtStat, target.getStrctureArea());
|
||||
|
||||
for (SampleWrapper sample : nearlySample) {
|
||||
sample.setProperty(district);
|
||||
@@ -346,13 +346,13 @@ public class CzbankSampleServiceImpl implements CzbankSampleService {
|
||||
propertyLife = "40";
|
||||
} else {
|
||||
if (sample.getBuildStructureCode() != null) {
|
||||
if ("10".equals(sample.getBuildStructureCode())) {
|
||||
if ("10".equals(sample.getBuildStructureCode().toString())) {
|
||||
propertyLife = "70";
|
||||
} else if ("20".equals(sample.getBuildStructureCode())) {
|
||||
} else if ("20".equals(sample.getBuildStructureCode().toString())) {
|
||||
propertyLife = "60";
|
||||
} else if ("40".equals(sample.getBuildStructureCode())) {
|
||||
} else if ("40".equals(sample.getBuildStructureCode().toString())) {
|
||||
propertyLife = "40";
|
||||
} else if ("30".equals(sample.getBuildStructureCode())) {
|
||||
} else if ("30".equals(sample.getBuildStructureCode().toString())) {
|
||||
propertyLife = "50";
|
||||
} else {
|
||||
propertyLife = "60";
|
||||
@@ -770,7 +770,6 @@ public class CzbankSampleServiceImpl implements CzbankSampleService {
|
||||
return d1.compareTo(d2);
|
||||
}
|
||||
});
|
||||
|
||||
List<Integer> prices = new ArrayList<Integer>();
|
||||
for (SampleWrapper sample : samples) {
|
||||
if (!prices.contains(sample.getUnitPrice())) {
|
||||
@@ -989,7 +988,7 @@ public class CzbankSampleServiceImpl implements CzbankSampleService {
|
||||
* @param startDate
|
||||
* @return
|
||||
*/
|
||||
private List<SampleWrapper> findJnbankSampleByDistrict(District district, List<String> keys, List<String> names, String estateType, Date startDate, DistrictStat districtStat) {
|
||||
private List<SampleWrapper> findJnbankSampleByDistrict(District district, List<String> keys, List<String> names, String estateType, Date startDate, DistrictStat districtStat,double area) {
|
||||
|
||||
|
||||
BooleanQuery nameQuery = new BooleanQuery();
|
||||
@@ -1013,8 +1012,10 @@ public class CzbankSampleServiceImpl implements CzbankSampleService {
|
||||
houseQuery.add(new QueryParam("avgPrice", QueryParam.GREATER_THAN_EQUAL_OPERATOR, (int) (avgPrice * 0.5)));//0.85
|
||||
houseQuery.add(new QueryParam("avgPrice", QueryParam.LESS_THAN_EQUAL_OPERATOR, (int) (avgPrice * 1.5)));//1.15
|
||||
}
|
||||
houseQuery.add(new QueryParam("area", QueryParam.LESS_THAN_EQUAL_OPERATOR, area + 30));
|
||||
houseQuery.add(new QueryParam("area", QueryParam.GREATER_THAN_EQUAL_OPERATOR, area - 30));
|
||||
|
||||
if (nameQuery.clauses().size() == 0) {
|
||||
if (nameQuery.clauses().isEmpty()){
|
||||
return samples;
|
||||
}
|
||||
BooleanQuery srQuery = new BooleanQuery();
|
||||
|
||||
Reference in New Issue
Block a user