修正无结果时空指针问题

This commit is contained in:
2025-09-09 23:00:00 +08:00
parent 4292d4a092
commit 700d867ffc
@@ -1688,7 +1688,7 @@ public class PropertyController {
resultMap.put("avgPrice", Long.valueOf(json.getString("unitPrice")));
resultMap.put("totalPrice", Long.valueOf(json.getString("totalPrice")));
if (apiUser.getId() == 1007497) {
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);
@@ -1708,9 +1708,15 @@ public class PropertyController {
}
return mav;
}
model.setDistrict(district.getRegion());
model.setName(district.getName());
return this.evaluateAction(model, request);
if(district!=null){
model.setDistrict(district.getRegion());
model.setName(district.getName());
return this.evaluateAction(model, request);
}else{
mav.setModel(BasicModel.buildBadRequestModel("该地址不支持估价!"));
return mav;
}
}
public Object evaluate2Action(PropertyEvaluationModel model, HttpServletRequest request)