广州市慧合临时修改
This commit is contained in:
+29
-1
@@ -1211,6 +1211,16 @@ public class PropertyController {
|
||||
evaluation.setAvgPrice(avgPrice);
|
||||
evaluation.setBigTotalPrice((long) (avgPrice * evaluation.getArea()));
|
||||
}
|
||||
if (StringUtils.isNotBlank(evaluation.getFromUserId())) {
|
||||
// 1007839 广州市慧合信息科技有限公司 huihe_test 价格向上2%-10% 向下 2%-5%
|
||||
if (evaluation.getFromUserId().equals("1007839")) {
|
||||
int round = DataUtil.generateRandomNumber(district.getCity() + model.getAddress());
|
||||
int newAvgPrice = (int) (evaluation.getAvgPrice() + evaluation.getAvgPrice() * round / 100);
|
||||
evaluation.setAvgPrice(newAvgPrice);
|
||||
evaluation.setBigTotalPrice((long) (newAvgPrice * evaluation.getArea()));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
LOGGER.error("调整面积不同面积价格异常{}", ex.getMessage());
|
||||
@@ -1651,7 +1661,16 @@ public class PropertyController {
|
||||
}
|
||||
}
|
||||
|
||||
if (district == null) {
|
||||
ApiUser apiUser = checkNewAuthorized(model.getToken());
|
||||
String userName = null;
|
||||
if (apiUser != null) {
|
||||
User user = userService.findById(apiUser.getId());
|
||||
if (user != null) {
|
||||
userName = user.getUserName();
|
||||
}
|
||||
}
|
||||
|
||||
if (district == null && userName!=null && !userName.equals("huihe_test")) {
|
||||
//加上高德获取经纬度 和 根据经纬度估值
|
||||
Map<String, String> map = GeoUtils.parserByGaode(model.getCity(), model.getAddress());
|
||||
if (map != null && map.containsKey("level") && GAODE_LEVEL.contains(map.get("level"))
|
||||
@@ -1668,6 +1687,15 @@ public class PropertyController {
|
||||
HashMap<String, String> resultMap = new HashMap<String, String>();
|
||||
resultMap.put("avgPrice", json.getString("unitPrice"));
|
||||
resultMap.put("totalPrice", json.getString("totalPrice"));
|
||||
|
||||
if (apiUser.getId() == 1007839) {
|
||||
int round = DataUtil.generateRandomNumber(model.getCity() + model.getAddress());
|
||||
Long newAvgPrice = (Long) (json.getLong("unitPrice") + json.getLong("unitPrice") * round / 100);
|
||||
resultMap.put("avgPrice", newAvgPrice.toString());
|
||||
double totalPrice = newAvgPrice * model.getSize();
|
||||
resultMap.put("totalPrice", String.valueOf((int)totalPrice));
|
||||
}
|
||||
|
||||
mav.setModel(BasicModel.buildOKModel().setResult(resultMap));
|
||||
} else {
|
||||
mav.setModel(BasicModel.buildBadRequestModel("该地址不支持估价!"));
|
||||
|
||||
Reference in New Issue
Block a user