|
@@ -48,33 +48,47 @@ public class PersonalFacePriceServiceImpl extends ServiceImpl<PersonalFacePriceM
|
|
|
Date startDate = DateUtils.facePriceLimitDate(facePriceQuery.getLimit());
|
|
|
//查询策略1:全地址查询
|
|
|
List<DayouPersonalPriceVO> byRoadNumberResult = new ArrayList<>();
|
|
|
+ List<DayouPersonalPriceVO> facePricesByRoadNumber = new ArrayList<>();
|
|
|
String location = facePriceQuery.getQueryTarget();
|
|
|
AddressDTO targetAddress = AddressUtil.parseAddress(location);
|
|
|
String roadNumberAddress = AddressUtil.getRoadNumberAddress(location);
|
|
|
if (StrUtil.isNotBlank(roadNumberAddress)) {
|
|
|
byRoadNumberResult = personalFacePriceMapper.queryByFuzzyAddress(roadNumberAddress,startDate);
|
|
|
+ facePricesByRoadNumber = personalFacePriceMapper.queryFromFacePriceHis(roadNumberAddress,startDate);
|
|
|
+ facePricesByRoadNumber.stream().forEach(x->x.setMatching("全地址匹配(口估)"));
|
|
|
byRoadNumberResult.stream().forEach(x->x.setMatching("全地址匹配"));
|
|
|
}
|
|
|
|
|
|
//查询策略2:路名路号查询
|
|
|
List<DayouPersonalPriceVO> byRoadNameNumberResult = new ArrayList<>();
|
|
|
+ List<DayouPersonalPriceVO> facePricesByRoadNameNumber = new ArrayList<>();
|
|
|
String roadAndRoadNumber = AddressUtil.getRoadAndRoadNumber(location);
|
|
|
if (StrUtil.isNotBlank(roadAndRoadNumber)){
|
|
|
byRoadNameNumberResult = personalFacePriceMapper.queryByFuzzyAddress(roadAndRoadNumber,startDate);
|
|
|
filterByCityAndDistrict(byRoadNameNumberResult,targetAddress);
|
|
|
+ facePricesByRoadNameNumber = personalFacePriceMapper.queryFromFacePriceHis(roadNumberAddress,startDate);
|
|
|
+ facePricesByRoadNameNumber.stream().forEach(x->x.setMatching("路名路号匹配(口估)"));
|
|
|
byRoadNameNumberResult.stream().forEach(x->x.setMatching("路名路号匹配"));
|
|
|
}
|
|
|
|
|
|
//查询策略3:尝试用小区名字查询
|
|
|
List<DayouPersonalPriceVO> byCommunityNameResult = new ArrayList<>();
|
|
|
+ List<DayouPersonalPriceVO> facePriceByCommunity = new ArrayList<>();
|
|
|
String communityNameFromAddress = AddressUtil.getCommunityNameFromAddress(location);
|
|
|
if (StrUtil.isNotBlank(communityNameFromAddress)){
|
|
|
byCommunityNameResult = personalFacePriceMapper.queryByFuzzyAddress(communityNameFromAddress,startDate);
|
|
|
+ facePriceByCommunity = personalFacePriceMapper.queryFromFacePriceHis(roadNumberAddress,startDate);
|
|
|
filterByCityAndDistrict(byCommunityNameResult,targetAddress);
|
|
|
byCommunityNameResult.stream().forEach(x->x.setMatching("楼盘名匹配"));
|
|
|
+ facePriceByCommunity.stream().forEach(x->x.setMatching("楼盘名匹配(口估)"));
|
|
|
}
|
|
|
|
|
|
|
|
|
+ //合并历史口估结果集
|
|
|
+ facePricesByRoadNumber.addAll(facePricesByRoadNameNumber);
|
|
|
+ facePricesByRoadNumber.addAll(facePriceByCommunity);
|
|
|
+ facePricesByRoadNumber = facePricesByRoadNumber.stream().distinct().collect(Collectors.toList());
|
|
|
+
|
|
|
|
|
|
//合并查询结果集
|
|
|
byRoadNumberResult.addAll(byRoadNameNumberResult);
|
|
@@ -83,6 +97,9 @@ public class PersonalFacePriceServiceImpl extends ServiceImpl<PersonalFacePriceM
|
|
|
//去重
|
|
|
byRoadNumberResult = byRoadNumberResult.stream().distinct().collect(Collectors.toList());
|
|
|
|
|
|
+ //合并评估和口估
|
|
|
+ byRoadNumberResult.addAll(facePricesByRoadNumber);
|
|
|
+
|
|
|
//排序
|
|
|
Collections.sort(byRoadNumberResult);
|
|
|
return byRoadNumberResult;
|
|
@@ -127,6 +144,14 @@ public class PersonalFacePriceServiceImpl extends ServiceImpl<PersonalFacePriceM
|
|
|
Date startDate = DateUtils.facePriceLimitDate(facePriceQuery.getLimit());
|
|
|
String community = facePriceQuery.getQueryTarget();
|
|
|
List<DayouPersonalPriceVO> result = personalFacePriceMapper.queryByFuzzyCommunityName(community,startDate);
|
|
|
+ List<DayouPersonalPriceVO> facePrices = personalFacePriceMapper.queryFromFacePriceHis(community, startDate);
|
|
|
+ facePrices.forEach(x->{
|
|
|
+ x.setMatching("楼盘名(口估)");
|
|
|
+ x.setCommunityName(x.getLocation());
|
|
|
+ x.setLocation(null);
|
|
|
+ });
|
|
|
+ result.addAll(facePrices);
|
|
|
+ Collections.sort(result);
|
|
|
return result;
|
|
|
}
|
|
|
|