Merge remote-tracking branch 'origin/master'

This commit is contained in:
沈健
2024-05-23 15:27:16 +08:00
6 changed files with 133 additions and 58 deletions
@@ -233,10 +233,12 @@ public class ComprehensiveQueryController {
communityAvgPriceParams.put("city", model.getCity());
communityAvgPriceParams.put("address", model.getAddress());
communityAvgPriceParams.put("category", model.getCategory());
communityAvgPriceParams.put("useMap", String.valueOf(model.isUseMap()));
// communityAvgPriceParams.put("useMap", String.valueOf(model.isUseMap()));
communityAvgPriceParams.put("suggestName", String.valueOf(model.getName()));
communityAvgPriceParams.put("token", "F54F52381C49BB9EB4A33EB1B65604AE4B71A28AEE53518A94A2F360408B9056D57553931D15CE6DDE765562DAD286BA38E05A4CDAFC51C3D527A4959BF8E75A3B95DB7108FCEA340DDE61925616DB55118E1851E67D83EAD800460D100D6B667A4ED8EE67C8F7FB");
JSONObject matchResponse = null;
try {
matchResponse = httpRequest.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/v2/match", communityAvgPriceParams, "UTF-8");
matchResponse = httpRequest.getJsonContent("http://open.fangjia.com/address/match", communityAvgPriceParams, "UTF-8");
// matchResponse = httpRequest.getJsonContent("http://192.168.0.19:31080/FangJiaAddressService/v2/match", communityAvgPriceParams, "UTF-8");
} catch (HttpRequestException e) {
@@ -256,9 +258,21 @@ public class ComprehensiveQueryController {
DistrictStatBo statBo = districtStatService.findCurrentDistrictStat(new DistrictKey(district));
if (null != statBo) {
if (statBo.getDistrictStat() != null) {
dto.setAvgPrice(statBo.getDistrictStat().getAvgPrice());
// 有2B价格,使用2B价格
Integer avgPrice2b = statBo.getDistrictStat().getAvg_price_2b();
if (avgPrice2b != null && avgPrice2b > 0) {
dto.setAvgPrice(avgPrice2b);
} else {
dto.setAvgPrice(statBo.getDistrictStat().getAvgPrice());
}
} else if (statBo.getVillaDistrictStat() != null) {
dto.setAvgPrice(statBo.getVillaDistrictStat().getAvgPrice());
// 有2B价格,使用2B价格
Integer avgPrice2b = statBo.getVillaDistrictStat().getAvg_price_2b();
if (avgPrice2b != null && avgPrice2b > 0) {
dto.setAvgPrice(avgPrice2b);
} else {
dto.setAvgPrice(statBo.getVillaDistrictStat().getAvgPrice());
}
}
}
@@ -638,10 +652,18 @@ public class ComprehensiveQueryController {
if (evaluation != null && evaluation.getAvgPrice() != null && evaluation.getAvgPrice() > 0) {
int factorPrice = evaluation.getAvgPrice();
int avgPrice = evaluateFactorService.recompose(district.getCity(), district.getRegion(), evaluation.getArea(), factorPrice, orgAvgPrice);
Integer minPrice = (int) (evaluation.getAvgPrice() * 0.95);
Integer maxPrice = (int) (evaluation.getAvgPrice() * 1.05);
// 有2B价格用2B价格,没有用2C
Integer minPrice = 0;
Integer maxPrice = 0;
if (evaluation.getAvgPrice2b() != null && evaluation.getAvgPrice2b() > 0) {
minPrice = (int) (evaluation.getAvgPrice2b() * 0.95);
maxPrice = (int) (evaluation.getAvgPrice2b() * 1.05);
} else {
minPrice = (int) (evaluation.getAvgPrice() * 0.95);
maxPrice = (int) (evaluation.getAvgPrice() * 1.05);
}
// 偏离度超过5%不进行调整
if (minPrice <= avgPrice && avgPrice <= maxPrice) {
if (minPrice != 0 && maxPrice != 0 && minPrice <= avgPrice && avgPrice <= maxPrice) {
evaluation.setAvgPrice(avgPrice);
evaluation.setBigTotalPrice((long) (avgPrice * evaluation.getArea()));
}
@@ -657,7 +679,11 @@ public class ComprehensiveQueryController {
districtPriceMap.put("district", district.getRegion());
districtPriceMap.put("name", district.getName());
districtPriceMap.put("totalPrice", evaluation.getBigTotalPrice());
districtPriceMap.put("avgPrice", evaluation.getAvgPrice());
if (evaluation.getAvgPrice2b() != null && evaluation.getAvgPrice2b() != 0) {
districtPriceMap.put("avgPrice", evaluation.getAvgPrice2b());
} else {
districtPriceMap.put("avgPrice", evaluation.getAvgPrice());
}
// 根据城市等 级设置D级可信度
ApiUserAuthority apiUserAuthority = apiUserAuthorityService
@@ -882,7 +908,11 @@ public class ComprehensiveQueryController {
otherPriceRets = new HashMap();
}
otherPriceRets.put("fjw_price", evaluation.getAvgPrice());
if (evaluation.getAvgPrice2b()!=null&&evaluation.getAvgPrice2b() > 0){
otherPriceRets.put("fjw_price", evaluation.getAvgPrice2b());
}else {
otherPriceRets.put("fjw_price", evaluation.getAvgPrice());
}
Map<String, Object> levelMap = getPriceLevel(otherPriceRets, evaluation.getCredit());
Long lastPrice = getLastPrice(levelMap, otherPriceRets, evaluation, dCredit);