新增平米租金接口
This commit is contained in:
@@ -22,8 +22,8 @@ public class SqmetreRent implements MongoEntity {
|
|||||||
private String city;
|
private String city;
|
||||||
private String region;
|
private String region;
|
||||||
private String districtName;
|
private String districtName;
|
||||||
private Integer avgPrice;
|
private Number avgPrice;
|
||||||
private Integer calcAvgPrice;
|
private Number calcAvgPrice;
|
||||||
private Double markup;
|
private Double markup;
|
||||||
private Date weekend;
|
private Date weekend;
|
||||||
private String cat;
|
private String cat;
|
||||||
@@ -74,20 +74,20 @@ public class SqmetreRent implements MongoEntity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Column(name = "avg_price")
|
@Column(name = "avg_price")
|
||||||
public Integer getAvgPrice() {
|
public Number getAvgPrice() {
|
||||||
return avgPrice;
|
return avgPrice;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setAvgPrice(Integer avgPrice) {
|
public void setAvgPrice(Number avgPrice) {
|
||||||
this.avgPrice = avgPrice;
|
this.avgPrice = avgPrice;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Column(name = "calc_avg_price")
|
@Column(name = "calc_avg_price")
|
||||||
public Integer getCalcAvgPrice() {
|
public Number getCalcAvgPrice() {
|
||||||
return calcAvgPrice;
|
return calcAvgPrice;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCalcAvgPrice(Integer calcAvgPrice) {
|
public void setCalcAvgPrice(Number calcAvgPrice) {
|
||||||
this.calcAvgPrice = calcAvgPrice;
|
this.calcAvgPrice = calcAvgPrice;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -164,6 +164,4 @@ public class SqmetreRent implements MongoEntity {
|
|||||||
this.cat = cat;
|
this.cat = cat;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+202
-146
@@ -14,6 +14,7 @@ import java.util.*;
|
|||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
import javax.persistence.Id;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
@@ -177,7 +178,7 @@ public class PropertyController {
|
|||||||
|
|
||||||
private FileDao fileDao = FileDao.getInstance();
|
private FileDao fileDao = FileDao.getInstance();
|
||||||
private static final int DEFAULT_PAGE_SIZE = 20;
|
private static final int DEFAULT_PAGE_SIZE = 20;
|
||||||
private static final String[] PROPERTY_SEARCH_API_FIELDS = { "address", "city", "region", "name", "lat2", "lng2","lat", "lng", "block", "estateType2", "addrAlias", "alias" };
|
private static final String[] PROPERTY_SEARCH_API_FIELDS = {"address", "city", "region", "name", "lat2", "lng2", "lat", "lng", "block", "estateType2", "addrAlias", "alias"};
|
||||||
static final int BAI_DU_GEO = 1;// 百度系坐标
|
static final int BAI_DU_GEO = 1;// 百度系坐标
|
||||||
static final int GAO_DE_GEO = 2;// 高德系坐标
|
static final int GAO_DE_GEO = 2;// 高德系坐标
|
||||||
|
|
||||||
@@ -608,7 +609,7 @@ public class PropertyController {
|
|||||||
if (StringUtils.isNotBlank(model.getKeyword())) {
|
if (StringUtils.isNotBlank(model.getKeyword())) {
|
||||||
for (String mappingAlias : district.getAlias()) {
|
for (String mappingAlias : district.getAlias()) {
|
||||||
double curr = AddressParserUtil.getSimilarityRatio(mappingAlias, model.getKeyword());
|
double curr = AddressParserUtil.getSimilarityRatio(mappingAlias, model.getKeyword());
|
||||||
if (curr > similarity ) {
|
if (curr > similarity) {
|
||||||
similarity = curr;
|
similarity = curr;
|
||||||
alias = mappingAlias;
|
alias = mappingAlias;
|
||||||
}
|
}
|
||||||
@@ -676,7 +677,7 @@ public class PropertyController {
|
|||||||
if (StringUtils.isNotBlank(region)) {
|
if (StringUtils.isNotBlank(region)) {
|
||||||
params.put("suggestDistrict", region);
|
params.put("suggestDistrict", region);
|
||||||
}
|
}
|
||||||
if(StringUtils.isNotBlank(name)){
|
if (StringUtils.isNotBlank(name)) {
|
||||||
params.put("suggestName", name);
|
params.put("suggestName", name);
|
||||||
}
|
}
|
||||||
String content = addressMatchProxyService.parser(params);
|
String content = addressMatchProxyService.parser(params);
|
||||||
@@ -708,10 +709,10 @@ public class PropertyController {
|
|||||||
String userId = FangjiaApiUtil.parseUserId(model.getToken());
|
String userId = FangjiaApiUtil.parseUserId(model.getToken());
|
||||||
|
|
||||||
District district = null;
|
District district = null;
|
||||||
if (StringUtils.isNotBlank(model.getId())){
|
if (StringUtils.isNotBlank(model.getId())) {
|
||||||
if(ObjectId.isValid(model.getId())){
|
if (ObjectId.isValid(model.getId())) {
|
||||||
district = districtService.findById(model.getId());
|
district = districtService.findById(model.getId());
|
||||||
}else{
|
} else {
|
||||||
mav.setModel(BasicModel.buildBadRequestModel("非法的住宅ID"));
|
mav.setModel(BasicModel.buildBadRequestModel("非法的住宅ID"));
|
||||||
return mav;
|
return mav;
|
||||||
}
|
}
|
||||||
@@ -849,10 +850,10 @@ public class PropertyController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
District district = null;
|
District district = null;
|
||||||
if (StringUtils.isNotBlank(model.getId())){
|
if (StringUtils.isNotBlank(model.getId())) {
|
||||||
if(ObjectId.isValid(model.getId())){
|
if (ObjectId.isValid(model.getId())) {
|
||||||
district = districtService.findById(model.getId());
|
district = districtService.findById(model.getId());
|
||||||
}else{
|
} else {
|
||||||
mav.setModel(BasicModel.buildBadRequestModel("非法的住宅ID"));
|
mav.setModel(BasicModel.buildBadRequestModel("非法的住宅ID"));
|
||||||
return mav;
|
return mav;
|
||||||
}
|
}
|
||||||
@@ -1060,7 +1061,7 @@ public class PropertyController {
|
|||||||
if (StringUtils.isNotBlank(request.getParameter("calDate"))) {
|
if (StringUtils.isNotBlank(request.getParameter("calDate"))) {
|
||||||
Date calDate = null;
|
Date calDate = null;
|
||||||
try {
|
try {
|
||||||
calDate = DateUtils.parseDate(request.getParameter("calDate"), new String[] { "yyyy-MM-dd" });
|
calDate = DateUtils.parseDate(request.getParameter("calDate"), new String[]{"yyyy-MM-dd"});
|
||||||
} catch (ParseException e) {
|
} catch (ParseException e) {
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1075,10 +1076,10 @@ public class PropertyController {
|
|||||||
District district = districtService.findByNameAndAlias(model.getCity(), model.getDistrict(), model.getName(),
|
District district = districtService.findByNameAndAlias(model.getCity(), model.getDistrict(), model.getName(),
|
||||||
"district");
|
"district");
|
||||||
if (district == null) {
|
if (district == null) {
|
||||||
if(model.getDistrict().contains("市辖区") || model.getDistrict().contains(model.getCity())){
|
if (model.getDistrict().contains("市辖区") || model.getDistrict().contains(model.getCity())) {
|
||||||
district = districtService.findByNameAndAlias(model.getCity(), null, model.getName(), "district");
|
district = districtService.findByNameAndAlias(model.getCity(), null, model.getName(), "district");
|
||||||
}
|
}
|
||||||
if(district == null){
|
if (district == null) {
|
||||||
mav.setModel(BasicModel.buildBadRequestModel("该小区不存在"));
|
mav.setModel(BasicModel.buildBadRequestModel("该小区不存在"));
|
||||||
return mav;
|
return mav;
|
||||||
}
|
}
|
||||||
@@ -1103,14 +1104,14 @@ public class PropertyController {
|
|||||||
return mav;
|
return mav;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(model.getFloor() == null){
|
if (model.getFloor() == null) {
|
||||||
JSONObject structureOb = addressMatchProxyService.addressStructure(district.getCity(), model.getAddress());
|
JSONObject structureOb = addressMatchProxyService.addressStructure(district.getCity(), model.getAddress());
|
||||||
if(structureOb != null){
|
if (structureOb != null) {
|
||||||
if(structureOb.containsKey("buildingNumber")){
|
if (structureOb.containsKey("buildingNumber")) {
|
||||||
model.setBuildingNumber(structureOb.getString("buildingNumber"));
|
model.setBuildingNumber(structureOb.getString("buildingNumber"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(structureOb.containsKey("roomNumber")){
|
if (structureOb.containsKey("roomNumber")) {
|
||||||
String roomNumber = structureOb.getString("roomNumber");
|
String roomNumber = structureOb.getString("roomNumber");
|
||||||
model.setFloor(getFloor(roomNumber));
|
model.setFloor(getFloor(roomNumber));
|
||||||
}
|
}
|
||||||
@@ -1118,9 +1119,9 @@ public class PropertyController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(model.getMaxFloor() == null && model.getFloor() != null &&StringUtils.isNotBlank(model.getBuildingNumber())){
|
if (model.getMaxFloor() == null && model.getFloor() != null && StringUtils.isNotBlank(model.getBuildingNumber())) {
|
||||||
Loudong loudong = loudongService.findForEvaluate(district.getId(), model.getBuildingNumber(), model.getUnitNumber());
|
Loudong loudong = loudongService.findForEvaluate(district.getId(), model.getBuildingNumber(), model.getUnitNumber());
|
||||||
if(loudong != null && loudong.getFloors() >= model.getFloor()){
|
if (loudong != null && loudong.getFloors() >= model.getFloor()) {
|
||||||
model.setMaxFloor(loudong.getFloors());
|
model.setMaxFloor(loudong.getFloors());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1178,8 +1179,8 @@ public class PropertyController {
|
|||||||
if (evaluation != null && evaluation.getAvgPrice() != null && evaluation.getAvgPrice() > 0) {
|
if (evaluation != null && evaluation.getAvgPrice() != null && evaluation.getAvgPrice() > 0) {
|
||||||
int factorPrice = evaluation.getAvgPrice();
|
int factorPrice = evaluation.getAvgPrice();
|
||||||
int avgPrice = evaluateFactorService.recompose(district.getCity(), district.getRegion(), evaluation.getArea(), factorPrice, orgAvgPrice);
|
int avgPrice = evaluateFactorService.recompose(district.getCity(), district.getRegion(), evaluation.getArea(), factorPrice, orgAvgPrice);
|
||||||
Integer minPrice = (int)(evaluation.getAvgPrice() * 0.95);
|
Integer minPrice = (int) (evaluation.getAvgPrice() * 0.95);
|
||||||
Integer maxPrice = (int)(evaluation.getAvgPrice() * 1.05);
|
Integer maxPrice = (int) (evaluation.getAvgPrice() * 1.05);
|
||||||
// 偏离度超过5%不进行调整
|
// 偏离度超过5%不进行调整
|
||||||
if (minPrice <= avgPrice && avgPrice <= maxPrice) {
|
if (minPrice <= avgPrice && avgPrice <= maxPrice) {
|
||||||
evaluation.setAvgPrice(avgPrice);
|
evaluation.setAvgPrice(avgPrice);
|
||||||
@@ -1247,12 +1248,12 @@ public class PropertyController {
|
|||||||
districtPriceMap.put("id", evaluation.getId());
|
districtPriceMap.put("id", evaluation.getId());
|
||||||
}
|
}
|
||||||
mav.setModel(BasicModel.buildOKModel().setResult(districtPriceMap));
|
mav.setModel(BasicModel.buildOKModel().setResult(districtPriceMap));
|
||||||
try{
|
try {
|
||||||
if(StringUtils.isNotBlank(evaluation.getFromUserId()) && !evaluation.getFromUserId().equals("1007497")){
|
if (StringUtils.isNotBlank(evaluation.getFromUserId()) && !evaluation.getFromUserId().equals("1007497")) {
|
||||||
openApiLogService.saveLog(CommonUtils.convertToMap(model), districtPriceMap, evaluation, "/property/evaluate");
|
openApiLogService.saveLog(CommonUtils.convertToMap(model), districtPriceMap, evaluation, "/property/evaluate");
|
||||||
}
|
}
|
||||||
|
|
||||||
}catch(Exception e){
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1300,6 +1301,7 @@ public class PropertyController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static final Map<String, Double> CITY_CORRECTION_FACTOR = new HashMap<String, Double>();
|
static final Map<String, Double> CITY_CORRECTION_FACTOR = new HashMap<String, Double>();
|
||||||
|
|
||||||
static {
|
static {
|
||||||
CITY_CORRECTION_FACTOR.put("上海", 0.02);
|
CITY_CORRECTION_FACTOR.put("上海", 0.02);
|
||||||
CITY_CORRECTION_FACTOR.put("杭州", 0.1);
|
CITY_CORRECTION_FACTOR.put("杭州", 0.1);
|
||||||
@@ -1320,15 +1322,15 @@ public class PropertyController {
|
|||||||
mav.setModel(BasicModel.buildBadRequestModel("城市为必填项"));
|
mav.setModel(BasicModel.buildBadRequestModel("城市为必填项"));
|
||||||
return mav;
|
return mav;
|
||||||
}
|
}
|
||||||
if (model.getSize() <= 0){
|
if (model.getSize() <= 0) {
|
||||||
mav.setModel(BasicModel.buildBadRequestModel("面积为必填项"));
|
mav.setModel(BasicModel.buildBadRequestModel("面积为必填项"));
|
||||||
return mav;
|
return mav;
|
||||||
}
|
}
|
||||||
if(StringUtils.isBlank(model.getAddress()) && StringUtils.isBlank(model.getName())){
|
if (StringUtils.isBlank(model.getAddress()) && StringUtils.isBlank(model.getName())) {
|
||||||
mav.setModel(BasicModel.buildBadRequestModel("地址和小区名至少填一个"));
|
mav.setModel(BasicModel.buildBadRequestModel("地址和小区名至少填一个"));
|
||||||
return mav;
|
return mav;
|
||||||
}
|
}
|
||||||
if(StringUtils.isNotBlank(model.getName()) && StringUtils.isBlank(model.getAddress())){
|
if (StringUtils.isNotBlank(model.getName()) && StringUtils.isBlank(model.getAddress())) {
|
||||||
model.setAddress(model.getName());
|
model.setAddress(model.getName());
|
||||||
}
|
}
|
||||||
if (StringUtils.isNotBlank(request.getParameter("calDate"))) {
|
if (StringUtils.isNotBlank(request.getParameter("calDate"))) {
|
||||||
@@ -1337,10 +1339,10 @@ public class PropertyController {
|
|||||||
}
|
}
|
||||||
/* 先到CPDB库中查找小区 */
|
/* 先到CPDB库中查找小区 */
|
||||||
District district = districtService.findDistrict(new DistrictKey(model.getCity(), model.getDistrict(), model.getName()), "district");//matchDistrict(model.getCity(), model.getAddress(), model.getDistrict(), model.getName());
|
District district = districtService.findDistrict(new DistrictKey(model.getCity(), model.getDistrict(), model.getName()), "district");//matchDistrict(model.getCity(), model.getAddress(), model.getDistrict(), model.getName());
|
||||||
if(district == null){
|
if (district == null) {
|
||||||
//防止地址模糊,名称详细的情况
|
//防止地址模糊,名称详细的情况
|
||||||
district = matchDistrict(model.getCity(), model.getName(), model.getDistrict(), model.getAddress());
|
district = matchDistrict(model.getCity(), model.getName(), model.getDistrict(), model.getAddress());
|
||||||
if(district == null){
|
if (district == null) {
|
||||||
mav.setModel(BasicModel.buildBadRequestModel("该小区不存在"));
|
mav.setModel(BasicModel.buildBadRequestModel("该小区不存在"));
|
||||||
return mav;
|
return mav;
|
||||||
}
|
}
|
||||||
@@ -1382,7 +1384,7 @@ public class PropertyController {
|
|||||||
model.setCalDate(DateUtil.getFirstDayOfWeek(new Date()));
|
model.setCalDate(DateUtil.getFirstDayOfWeek(new Date()));
|
||||||
}
|
}
|
||||||
Evaluation evaluation = evaluationService.evaluate(district, buildEvaluation(model, request), model.getCalDate());
|
Evaluation evaluation = evaluationService.evaluate(district, buildEvaluation(model, request), model.getCalDate());
|
||||||
if(!"self".equalsIgnoreCase(evaluation.getEvaluateWay())){
|
if (!"self".equalsIgnoreCase(evaluation.getEvaluateWay())) {
|
||||||
evaluationService.remove(evaluation.getId());
|
evaluationService.remove(evaluation.getId());
|
||||||
mav.setModel(BasicModel.buildOKModel().setMsg("暂时不支持该小区的估价").markNoData());
|
mav.setModel(BasicModel.buildOKModel().setMsg("暂时不支持该小区的估价").markNoData());
|
||||||
return mav;
|
return mav;
|
||||||
@@ -1404,8 +1406,8 @@ public class PropertyController {
|
|||||||
if (evaluation != null && evaluation.getAvgPrice() != null && evaluation.getAvgPrice() > 0) {
|
if (evaluation != null && evaluation.getAvgPrice() != null && evaluation.getAvgPrice() > 0) {
|
||||||
int factorPrice = evaluation.getAvgPrice();
|
int factorPrice = evaluation.getAvgPrice();
|
||||||
int avgPrice = evaluateFactorService.recompose(district.getCity(), district.getRegion(), evaluation.getArea(), factorPrice, orgAvgPrice);
|
int avgPrice = evaluateFactorService.recompose(district.getCity(), district.getRegion(), evaluation.getArea(), factorPrice, orgAvgPrice);
|
||||||
Integer minPrice = (int)(evaluation.getAvgPrice() * 0.95);
|
Integer minPrice = (int) (evaluation.getAvgPrice() * 0.95);
|
||||||
Integer maxPrice = (int)(evaluation.getAvgPrice() * 1.05);
|
Integer maxPrice = (int) (evaluation.getAvgPrice() * 1.05);
|
||||||
// 偏离度超过5%不进行调整
|
// 偏离度超过5%不进行调整
|
||||||
if (minPrice <= avgPrice && avgPrice <= maxPrice) {
|
if (minPrice <= avgPrice && avgPrice <= maxPrice) {
|
||||||
evaluation.setAvgPrice(avgPrice);
|
evaluation.setAvgPrice(avgPrice);
|
||||||
@@ -1431,17 +1433,17 @@ public class PropertyController {
|
|||||||
}
|
}
|
||||||
List<String> names = new ArrayList<String>();
|
List<String> names = new ArrayList<String>();
|
||||||
names.add(district.getName());
|
names.add(district.getName());
|
||||||
if(district.getAlias() != null){
|
if (district.getAlias() != null) {
|
||||||
for(String alia : district.getAlias()){
|
for (String alia : district.getAlias()) {
|
||||||
if(StringUtils.isNotBlank(alia) && !names.contains(alia)){
|
if (StringUtils.isNotBlank(alia) && !names.contains(alia)) {
|
||||||
names.add(alia);
|
names.add(alia);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Integer minPrice = (int)(evaluation.getAvgPrice() * 0.8);
|
Integer minPrice = (int) (evaluation.getAvgPrice() * 0.8);
|
||||||
Integer maxPrice = (int)(evaluation.getAvgPrice() * 1.2);
|
Integer maxPrice = (int) (evaluation.getAvgPrice() * 1.2);
|
||||||
Integer min10Price = (int)(evaluation.getAvgPrice() * 0.9);
|
Integer min10Price = (int) (evaluation.getAvgPrice() * 0.9);
|
||||||
Integer max10Price = (int)(evaluation.getAvgPrice() * 1.1);
|
Integer max10Price = (int) (evaluation.getAvgPrice() * 1.1);
|
||||||
// 新增第三方均价
|
// 新增第三方均价
|
||||||
try {
|
try {
|
||||||
double dCredit = 0.61;
|
double dCredit = 0.61;
|
||||||
@@ -1465,11 +1467,11 @@ public class PropertyController {
|
|||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
|
|
||||||
}
|
}
|
||||||
List<Seawater> houses = seawaterDao.findHouses(district.getCity(), district.getRegion(), names,minPrice, maxPrice, 20);
|
List<Seawater> houses = seawaterDao.findHouses(district.getCity(), district.getRegion(), names, minPrice, maxPrice, 20);
|
||||||
if(houses.size() > 3){
|
if (houses.size() > 3) {
|
||||||
districtPriceMap.put("calcType", 1);
|
districtPriceMap.put("calcType", 1);
|
||||||
List<UniversalDto> houseDtos = new ArrayList<UniversalDto>();
|
List<UniversalDto> houseDtos = new ArrayList<UniversalDto>();
|
||||||
for(Seawater seawater: houses){
|
for (Seawater seawater : houses) {
|
||||||
UniversalDto houseDto = new UniversalDto();
|
UniversalDto houseDto = new UniversalDto();
|
||||||
houseDto.append("city", seawater.getCity());
|
houseDto.append("city", seawater.getCity());
|
||||||
houseDto.append("district", seawater.getRegion());
|
houseDto.append("district", seawater.getRegion());
|
||||||
@@ -1484,17 +1486,17 @@ public class PropertyController {
|
|||||||
houseDto.append("direction", HouseValidator.fetchDirectionInfo(seawater.getDirection()));
|
houseDto.append("direction", HouseValidator.fetchDirectionInfo(seawater.getDirection()));
|
||||||
houseDto.append("decoration", HouseValidator.fetchFitmentInfo(seawater.getFitment()));
|
houseDto.append("decoration", HouseValidator.fetchFitmentInfo(seawater.getFitment()));
|
||||||
houseDto.append("publishDate", seawater.getpDate());
|
houseDto.append("publishDate", seawater.getpDate());
|
||||||
if(seawater.getHeight() != null && seawater.getHeight() > 0){
|
if (seawater.getHeight() != null && seawater.getHeight() > 0) {
|
||||||
houseDto.append("maxFloor", seawater.getHeight());
|
houseDto.append("maxFloor", seawater.getHeight());
|
||||||
}
|
}
|
||||||
houseDtos.add(houseDto);
|
houseDtos.add(houseDto);
|
||||||
}
|
}
|
||||||
districtPriceMap.put("houses", houseDtos);
|
districtPriceMap.put("houses", houseDtos);
|
||||||
}else if(district.getLng() != null && district.getLng() > 0){
|
} else if (district.getLng() != null && district.getLng() > 0) {
|
||||||
double lng = DataUtil.roundDouble(district.getLng() / 10000000000.0,6);
|
double lng = DataUtil.roundDouble(district.getLng() / 10000000000.0, 6);
|
||||||
double lat = DataUtil.roundDouble(district.getLat() / 10000000000.0, 6);
|
double lat = DataUtil.roundDouble(district.getLat() / 10000000000.0, 6);
|
||||||
List<District> districts = districtService.findNearestDistrict(district.getEstateType2(), lng, lat, 1000 * 3 , 6, null);
|
List<District> districts = districtService.findNearestDistrict(district.getEstateType2(), lng, lat, 1000 * 3, 6, null);
|
||||||
if(districts.size() < 2){
|
if (districts.size() < 2) {
|
||||||
evaluationService.remove(evaluation.getId());
|
evaluationService.remove(evaluation.getId());
|
||||||
mav.setModel(BasicModel.buildOKModel().setMsg("暂时不支持该小区的估价").markNoData());
|
mav.setModel(BasicModel.buildOKModel().setMsg("暂时不支持该小区的估价").markNoData());
|
||||||
return mav;
|
return mav;
|
||||||
@@ -1505,33 +1507,33 @@ public class PropertyController {
|
|||||||
modelFeaturesFto.append("lng", lng);
|
modelFeaturesFto.append("lng", lng);
|
||||||
modelFeaturesFto.append("lat", lat);
|
modelFeaturesFto.append("lat", lat);
|
||||||
DistrictAnalyData districtAnalyData = districtAnalyDataService.findByDistrictKey(new DistrictKey(district));
|
DistrictAnalyData districtAnalyData = districtAnalyDataService.findByDistrictKey(new DistrictKey(district));
|
||||||
if(districtAnalyData != null && districtAnalyData.getHalfYearMarkup() != null){
|
if (districtAnalyData != null && districtAnalyData.getHalfYearMarkup() != null) {
|
||||||
modelFeaturesFto.append("halfYearMarkup", DataUtil.roundDouble(districtAnalyData.getHalfYearMarkup() * 100 ,2));
|
modelFeaturesFto.append("halfYearMarkup", DataUtil.roundDouble(districtAnalyData.getHalfYearMarkup() * 100, 2));
|
||||||
}
|
}
|
||||||
RegionAnaData regionAnaData = regionAnaDataService.findRegionAnaData(district.getCity(), district.getRegion());
|
RegionAnaData regionAnaData = regionAnaDataService.findRegionAnaData(district.getCity(), district.getRegion());
|
||||||
if(regionAnaData != null){
|
if (regionAnaData != null) {
|
||||||
modelFeaturesFto.append("region20PercentPrice", regionAnaData.getRegion20PercentPrice());
|
modelFeaturesFto.append("region20PercentPrice", regionAnaData.getRegion20PercentPrice());
|
||||||
modelFeaturesFto.append("region80PercentPrice", regionAnaData.getRegion80PercentPrice());
|
modelFeaturesFto.append("region80PercentPrice", regionAnaData.getRegion80PercentPrice());
|
||||||
}
|
}
|
||||||
List<UniversalDto> nearCommunityDtos = new ArrayList<UniversalDto>();
|
List<UniversalDto> nearCommunityDtos = new ArrayList<UniversalDto>();
|
||||||
for(District d : districts){
|
for (District d : districts) {
|
||||||
if(d.getId().equals(district.getId())){
|
if (d.getId().equals(district.getId())) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
UniversalDto districtDto = UniversalDto.newDto();
|
UniversalDto districtDto = UniversalDto.newDto();
|
||||||
districtDto.append("city", d.getCity());
|
districtDto.append("city", d.getCity());
|
||||||
districtDto.append("region", d.getRegion());
|
districtDto.append("region", d.getRegion());
|
||||||
districtDto.append("name", d.getName());
|
districtDto.append("name", d.getName());
|
||||||
districtDto.append("lng", DataUtil.roundDouble(d.getLng()/10000000000.0 ,6));
|
districtDto.append("lng", DataUtil.roundDouble(d.getLng() / 10000000000.0, 6));
|
||||||
districtDto.append("lat", DataUtil.roundDouble(d.getLat()/10000000000.0, 6));
|
districtDto.append("lat", DataUtil.roundDouble(d.getLat() / 10000000000.0, 6));
|
||||||
districtDto.append("distance", GeoUtils.calculateDistance(lng, lat, d.getLng()/10000000000.0, d.getLat()/10000000000.0));
|
districtDto.append("distance", GeoUtils.calculateDistance(lng, lat, d.getLng() / 10000000000.0, d.getLat() / 10000000000.0));
|
||||||
districtDto.append("propertyType", d.getEstateType2());
|
districtDto.append("propertyType", d.getEstateType2());
|
||||||
Integer buildYear = districtService.getBuildYear(d);
|
Integer buildYear = districtService.getBuildYear(d);
|
||||||
if(buildYear != null){
|
if (buildYear != null) {
|
||||||
districtDto.append("buildYear", String.valueOf(buildYear));
|
districtDto.append("buildYear", String.valueOf(buildYear));
|
||||||
}
|
}
|
||||||
districtAnalyData = districtAnalyDataService.findByDistrictKey(new DistrictKey(d));
|
districtAnalyData = districtAnalyDataService.findByDistrictKey(new DistrictKey(d));
|
||||||
if(districtAnalyData != null){
|
if (districtAnalyData != null) {
|
||||||
if (districtAnalyData.getHalfYearMarkup() != null) {
|
if (districtAnalyData.getHalfYearMarkup() != null) {
|
||||||
districtDto.append("halfYearMarkup", DataUtil.roundDouble(districtAnalyData.getHalfYearMarkup() * 100, 2));
|
districtDto.append("halfYearMarkup", DataUtil.roundDouble(districtAnalyData.getHalfYearMarkup() * 100, 2));
|
||||||
}
|
}
|
||||||
@@ -1543,7 +1545,7 @@ public class PropertyController {
|
|||||||
nearCommunityDtos.add(districtDto);
|
nearCommunityDtos.add(districtDto);
|
||||||
}
|
}
|
||||||
Integer buildYear = districtService.getBuildYear(district);
|
Integer buildYear = districtService.getBuildYear(district);
|
||||||
if(buildYear != null){
|
if (buildYear != null) {
|
||||||
modelFeaturesFto.put("buildYear", String.valueOf(buildYear));
|
modelFeaturesFto.put("buildYear", String.valueOf(buildYear));
|
||||||
}
|
}
|
||||||
modelFeaturesFto.append("nearCommunity", nearCommunityDtos);
|
modelFeaturesFto.append("nearCommunity", nearCommunityDtos);
|
||||||
@@ -1564,8 +1566,10 @@ public class PropertyController {
|
|||||||
mav.setModel(BasicModel.buildOKModel().setResult(districtPriceMap));
|
mav.setModel(BasicModel.buildOKModel().setResult(districtPriceMap));
|
||||||
return mav;
|
return mav;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 地址估值
|
* 地址估值
|
||||||
|
*
|
||||||
* @param model 参数
|
* @param model 参数
|
||||||
* @param request
|
* @param request
|
||||||
* @return
|
* @return
|
||||||
@@ -1577,10 +1581,10 @@ public class PropertyController {
|
|||||||
mav.setModel(BasicModel.buildBadRequestModel("参数非法:城市,地址,面积(size)为必填项"));
|
mav.setModel(BasicModel.buildBadRequestModel("参数非法:城市,地址,面积(size)为必填项"));
|
||||||
return mav;
|
return mav;
|
||||||
}
|
}
|
||||||
if(model.getDistrict()!=null){
|
if (model.getDistrict() != null) {
|
||||||
//区域编码转房价网区域
|
//区域编码转房价网区域
|
||||||
FangjiaOfficialAreaMap fangjiaOfficialAreaMap = fangjiaOfficialAreaService.convertOfficialCodeToFangjia(model.getDistrict());
|
FangjiaOfficialAreaMap fangjiaOfficialAreaMap = fangjiaOfficialAreaService.convertOfficialCodeToFangjia(model.getDistrict());
|
||||||
if(fangjiaOfficialAreaMap != null){
|
if (fangjiaOfficialAreaMap != null) {
|
||||||
model.setDistrict(fangjiaOfficialAreaMap.getFangjiaDistrict());
|
model.setDistrict(fangjiaOfficialAreaMap.getFangjiaDistrict());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1590,25 +1594,25 @@ public class PropertyController {
|
|||||||
District district = null;
|
District district = null;
|
||||||
Map<String, Object> params = new HashMap<String, Object>();
|
Map<String, Object> params = new HashMap<String, Object>();
|
||||||
params.put("city", model.getCity());
|
params.put("city", model.getCity());
|
||||||
if(StringUtils.isNotBlank(model.getDistrict())){
|
if (StringUtils.isNotBlank(model.getDistrict())) {
|
||||||
params.put("suggestDistrict", model.getDistrict());
|
params.put("suggestDistrict", model.getDistrict());
|
||||||
}
|
}
|
||||||
params.put("address", model.getAddress());
|
params.put("address", model.getAddress());
|
||||||
if(StringUtils.isNotBlank(model.getName())){
|
if (StringUtils.isNotBlank(model.getName())) {
|
||||||
params.put("suggestName", model.getName());
|
params.put("suggestName", model.getName());
|
||||||
}
|
}
|
||||||
params.put("category", "district");
|
params.put("category", "district");
|
||||||
String result = addressMatchProxyService.parser(params);
|
String result = addressMatchProxyService.parser(params);
|
||||||
if (result != null) {
|
if (result != null) {
|
||||||
JSONObject json = JSONObject.fromObject(result);
|
JSONObject json = JSONObject.fromObject(result);
|
||||||
if(json.getInt("code")==200){
|
if (json.getInt("code") == 200) {
|
||||||
Map<String, Object> map = (Map<String, Object>) json.get("result");
|
Map<String, Object> map = (Map<String, Object>) json.get("result");
|
||||||
if((Integer)map.get("precise")>=0){
|
if ((Integer) map.get("precise") >= 0) {
|
||||||
String propertyType = (String) map.get("propertyType");
|
String propertyType = (String) map.get("propertyType");
|
||||||
if(villaFlag && StringUtils.isNotBlank(propertyType) && !propertyType.equals("别墅")){
|
if (villaFlag && StringUtils.isNotBlank(propertyType) && !propertyType.equals("别墅")) {
|
||||||
district = districtService.findByNameAndAlias((String) map.get("city"), (String) map.get("district"), (String) map.get("name")+"别墅", "district");
|
district = districtService.findByNameAndAlias((String) map.get("city"), (String) map.get("district"), (String) map.get("name") + "别墅", "district");
|
||||||
}
|
}
|
||||||
if(null == district){
|
if (null == district) {
|
||||||
district = districtService.findByNameAndAlias((String) map.get("city"), (String) map.get("district"), (String) map.get("name"), "district");
|
district = districtService.findByNameAndAlias((String) map.get("city"), (String) map.get("district"), (String) map.get("name"), "district");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1616,13 +1620,13 @@ public class PropertyController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(district == null){
|
if (district == null) {
|
||||||
mav.setModel(BasicModel.buildBadRequestModel("该地址不支持估价!"));
|
mav.setModel(BasicModel.buildBadRequestModel("该地址不支持估价!"));
|
||||||
return mav;
|
return mav;
|
||||||
}
|
}
|
||||||
model.setDistrict(district.getRegion());
|
model.setDistrict(district.getRegion());
|
||||||
model.setName(district.getName());
|
model.setName(district.getName());
|
||||||
return this.evaluateAction(model,request);
|
return this.evaluateAction(model, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Object evaluate2Action(PropertyEvaluationModel model, HttpServletRequest request)
|
public Object evaluate2Action(PropertyEvaluationModel model, HttpServletRequest request)
|
||||||
@@ -1640,7 +1644,7 @@ public class PropertyController {
|
|||||||
if (StringUtils.isNotBlank(request.getParameter("calDate"))) {
|
if (StringUtils.isNotBlank(request.getParameter("calDate"))) {
|
||||||
Date calDate = null;
|
Date calDate = null;
|
||||||
try {
|
try {
|
||||||
calDate = DateUtils.parseDate(request.getParameter("calDate"), new String[] { "yyyy-MM-dd" });
|
calDate = DateUtils.parseDate(request.getParameter("calDate"), new String[]{"yyyy-MM-dd"});
|
||||||
} catch (ParseException e) {
|
} catch (ParseException e) {
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1779,6 +1783,7 @@ public class PropertyController {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 四川锦程 定制接口 多建筑年代
|
* 四川锦程 定制接口 多建筑年代
|
||||||
|
*
|
||||||
* @param model
|
* @param model
|
||||||
* @param request
|
* @param request
|
||||||
* @return
|
* @return
|
||||||
@@ -1800,7 +1805,7 @@ public class PropertyController {
|
|||||||
if (StringUtils.isNotBlank(request.getParameter("calDate"))) {
|
if (StringUtils.isNotBlank(request.getParameter("calDate"))) {
|
||||||
Date calDate = null;
|
Date calDate = null;
|
||||||
try {
|
try {
|
||||||
calDate = DateUtils.parseDate(request.getParameter("calDate"), new String[] { "yyyy-MM-dd" });
|
calDate = DateUtils.parseDate(request.getParameter("calDate"), new String[]{"yyyy-MM-dd"});
|
||||||
} catch (ParseException e) {
|
} catch (ParseException e) {
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1881,7 +1886,7 @@ public class PropertyController {
|
|||||||
districtPriceMap.put("district", district.getRegion());
|
districtPriceMap.put("district", district.getRegion());
|
||||||
districtPriceMap.put("name", district.getName());
|
districtPriceMap.put("name", district.getName());
|
||||||
districtPriceMap.put("avgPrice", evaluation.getAvgPrice());
|
districtPriceMap.put("avgPrice", evaluation.getAvgPrice());
|
||||||
if(StringUtils.isNotBlank(district.getFinishBuildingDate())){
|
if (StringUtils.isNotBlank(district.getFinishBuildingDate())) {
|
||||||
Pattern pat3 = Pattern.compile("\\d{4}");
|
Pattern pat3 = Pattern.compile("\\d{4}");
|
||||||
Matcher matcher3 = pat3.matcher(district.getFinishBuildingDate());
|
Matcher matcher3 = pat3.matcher(district.getFinishBuildingDate());
|
||||||
if (matcher3.find()) {
|
if (matcher3.find()) {
|
||||||
@@ -2457,6 +2462,67 @@ public class PropertyController {
|
|||||||
return mav;
|
return mav;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 平米租金
|
||||||
|
* cat 表示租金类型
|
||||||
|
* city:城市 , region : 区域 ,district :小区
|
||||||
|
*
|
||||||
|
* @param model
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
|
||||||
|
public Object sqmeterRentAction(AvgPriceQueryModel model) {
|
||||||
|
RestfulModelAndView mav = new RestfulModelAndView();
|
||||||
|
mav.setViewType("rest");
|
||||||
|
if (StringUtils.isBlank(model.getCat())) {
|
||||||
|
mav.setModel(BasicModel.buildBadRequestModel("参数缺失:cat(租金类型)是必须参数"));
|
||||||
|
return mav;
|
||||||
|
}
|
||||||
|
if ("city".equals(model.getCity()) && StringUtils.isBlank(model.getCity())) {
|
||||||
|
mav.setModel(BasicModel.buildBadRequestModel("城市平米租金,city(城市)是必须参数"));
|
||||||
|
return mav;
|
||||||
|
}
|
||||||
|
if ("region".equals(model.getCity()) && (StringUtils.isBlank(model.getCity()) || StringUtils.isBlank(model.getDistrict()))) {
|
||||||
|
mav.setModel(BasicModel.buildBadRequestModel("区域平米租金,city(城市),district(区域)是必须参数"));
|
||||||
|
return mav;
|
||||||
|
}
|
||||||
|
if ("district".equals(model.getCity()) && (StringUtils.isBlank(model.getCity()) || StringUtils.isBlank(model.getDistrict()) || StringUtils.isBlank(model.getName()))) {
|
||||||
|
mav.setModel(BasicModel.buildBadRequestModel("小区平米租金,city(城市),district(区域),name(小区名)是必须参数"));
|
||||||
|
return mav;
|
||||||
|
}
|
||||||
|
if ("district".equals(model.getCat())) {
|
||||||
|
District district = districtService.findByNameAndAlias(model.getCity(), model.getDistrict(), model.getName(),
|
||||||
|
"district");
|
||||||
|
if (null == district) {
|
||||||
|
mav.setModel(BasicModel.buildBadRequestModel("小区不存在"));
|
||||||
|
return mav;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (model.getPeriodCount() == null) {
|
||||||
|
model.setPeriodCount(1);
|
||||||
|
}
|
||||||
|
if (model.getPeriodCount() < 1 || model.getPeriodCount() > 156) {
|
||||||
|
mav.setModel(BasicModel.buildBadRequestModel("periodCount值不合法,取值范围是:[1-156]"));
|
||||||
|
return mav;
|
||||||
|
}
|
||||||
|
Date startDate = DateUtil.add(new Date(), Calendar.MONTH, -model.getPeriodCount());
|
||||||
|
|
||||||
|
List<SqmetreRent> sqmetreRents = sqmetreRentService.findSqmetreRents(model.getCity(), model.getDistrict(), model.getName(), model.getCat(), startDate, null);
|
||||||
|
List<Map<String, Object>> result = new ArrayList<Map<String, Object>>(model.getPeriodCount());
|
||||||
|
|
||||||
|
for (SqmetreRent sqmetreRent : sqmetreRents) {
|
||||||
|
Map<String, Object> item = new LinkedHashMap<String, Object>();
|
||||||
|
item.put("city", sqmetreRent.getCity());
|
||||||
|
item.put("district", sqmetreRent.getRegion());
|
||||||
|
item.put("name", sqmetreRent.getDistrictName());
|
||||||
|
item.put("rent", sqmetreRent.getAvgPrice().intValue());
|
||||||
|
item.put("date", DateUtil.formatByPattern(sqmetreRent.getWeekend(), "yyyy-MM"));
|
||||||
|
result.add(item);
|
||||||
|
}
|
||||||
|
mav.setModel(BasicModel.buildOKModel().setResult(result));
|
||||||
|
return mav;
|
||||||
|
}
|
||||||
|
|
||||||
public Object rankAction(final DealPriceModel model) {
|
public Object rankAction(final DealPriceModel model) {
|
||||||
|
|
||||||
RestfulModelAndView mav = new RestfulModelAndView();
|
RestfulModelAndView mav = new RestfulModelAndView();
|
||||||
@@ -2483,7 +2549,7 @@ public class PropertyController {
|
|||||||
UniversalDto dto = new UniversalDto();
|
UniversalDto dto = new UniversalDto();
|
||||||
dto.append("relativeRank", DataUtil.roundDouble(((total - rank) / (double) total) * 100, 2));
|
dto.append("relativeRank", DataUtil.roundDouble(((total - rank) / (double) total) * 100, 2));
|
||||||
|
|
||||||
if(null != districtAnalyData.getRegionRank()){
|
if (null != districtAnalyData.getRegionRank()) {
|
||||||
dto.append("regionRelativeRank", DataUtil.roundDouble(((districtAnalyData.getRegionRankTotal() - districtAnalyData.getRegionRank()) / (double) districtAnalyData.getRegionRankTotal()) * 100, 2));
|
dto.append("regionRelativeRank", DataUtil.roundDouble(((districtAnalyData.getRegionRankTotal() - districtAnalyData.getRegionRank()) / (double) districtAnalyData.getRegionRankTotal()) * 100, 2));
|
||||||
}
|
}
|
||||||
mav.setModel(BasicModel.buildOKModel().setResult(dto));
|
mav.setModel(BasicModel.buildOKModel().setResult(dto));
|
||||||
@@ -2495,7 +2561,6 @@ public class PropertyController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 小区成交记录查询
|
* 小区成交记录查询
|
||||||
*
|
*
|
||||||
@@ -2552,7 +2617,7 @@ public class PropertyController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// districtNames 不包含 主小区名,加进去
|
// districtNames 不包含 主小区名,加进去
|
||||||
if (!districtNames.contains(masterDistrictName)){
|
if (!districtNames.contains(masterDistrictName)) {
|
||||||
districtNames.add(masterDistrictName);
|
districtNames.add(masterDistrictName);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2708,7 +2773,7 @@ public class PropertyController {
|
|||||||
mav.setModel(BasicModel.buildBadRequestModel("size(面积)不能为空"));
|
mav.setModel(BasicModel.buildBadRequestModel("size(面积)不能为空"));
|
||||||
return mav;
|
return mav;
|
||||||
}
|
}
|
||||||
District district = districtService.findByNameAndAlias(model.getCity(), model.getDistrict(), model.getName().replace(" ",""),
|
District district = districtService.findByNameAndAlias(model.getCity(), model.getDistrict(), model.getName().replace(" ", ""),
|
||||||
"district");
|
"district");
|
||||||
if (null == district) {
|
if (null == district) {
|
||||||
mav.setModel(BasicModel.buildBadRequestModel("该小区不存在"));
|
mav.setModel(BasicModel.buildBadRequestModel("该小区不存在"));
|
||||||
@@ -3860,7 +3925,7 @@ public class PropertyController {
|
|||||||
return mav;
|
return mav;
|
||||||
}
|
}
|
||||||
avgPrice = avgPrice / count;
|
avgPrice = avgPrice / count;
|
||||||
tatalPrice = (int)Math.round(avgPrice * model.getSize());
|
tatalPrice = (int) Math.round(avgPrice * model.getSize());
|
||||||
Map<String, Object> districtPriceMap = new HashMap<String, Object>();
|
Map<String, Object> districtPriceMap = new HashMap<String, Object>();
|
||||||
districtPriceMap.put("city", district.getCity());
|
districtPriceMap.put("city", district.getCity());
|
||||||
districtPriceMap.put("district", district.getRegion());
|
districtPriceMap.put("district", district.getRegion());
|
||||||
@@ -3919,7 +3984,7 @@ public class PropertyController {
|
|||||||
return listHouse;
|
return listHouse;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final String[] DFIELDS = { "city", "region", "name", "address" };
|
public static final String[] DFIELDS = {"city", "region", "name", "address"};
|
||||||
|
|
||||||
public Object autoCompleteAction(PropertySearchModel model) {
|
public Object autoCompleteAction(PropertySearchModel model) {
|
||||||
RestfulModelAndView mav = new RestfulModelAndView();
|
RestfulModelAndView mav = new RestfulModelAndView();
|
||||||
@@ -4021,8 +4086,8 @@ public class PropertyController {
|
|||||||
// QueryParser.escape(model.getKeyword()).toLowerCase()));
|
// QueryParser.escape(model.getKeyword()).toLowerCase()));
|
||||||
|
|
||||||
}
|
}
|
||||||
List<District> districts = districtService.findAllByParams(params, 0, model.getMax(), new String[] { "city",
|
List<District> districts = districtService.findAllByParams(params, 0, model.getMax(), new String[]{"city",
|
||||||
"region", "name", "alias", "address", "addrAlias", "lat2", "lng2", "householdCount" });
|
"region", "name", "alias", "address", "addrAlias", "lat2", "lng2", "householdCount"});
|
||||||
|
|
||||||
List<BasicDBObject> result = new ArrayList<BasicDBObject>();
|
List<BasicDBObject> result = new ArrayList<BasicDBObject>();
|
||||||
if (districts != null) {
|
if (districts != null) {
|
||||||
@@ -4112,7 +4177,7 @@ public class PropertyController {
|
|||||||
return mav;
|
return mav;
|
||||||
}
|
}
|
||||||
// 在库中找到对应的小区
|
// 在库中找到对应的小区
|
||||||
District district = districtService.findByNameAndAlias(model.getCity(), model.getDistrict(), model.getName(),"district");
|
District district = districtService.findByNameAndAlias(model.getCity(), model.getDistrict(), model.getName(), "district");
|
||||||
if (district == null) {
|
if (district == null) {
|
||||||
mav.setModel(BasicModel.buildBadRequestModel("该小区不存在"));
|
mav.setModel(BasicModel.buildBadRequestModel("该小区不存在"));
|
||||||
return mav;
|
return mav;
|
||||||
@@ -4144,7 +4209,7 @@ public class PropertyController {
|
|||||||
return mav;
|
return mav;
|
||||||
}
|
}
|
||||||
avgPrice = avgPrice / count;
|
avgPrice = avgPrice / count;
|
||||||
tatalPrice = (int)Math.round(avgPrice * model.getSize());
|
tatalPrice = (int) Math.round(avgPrice * model.getSize());
|
||||||
Map<String, Object> districtPriceMap = new HashMap<String, Object>();
|
Map<String, Object> districtPriceMap = new HashMap<String, Object>();
|
||||||
districtPriceMap.put("city", district.getCity());
|
districtPriceMap.put("city", district.getCity());
|
||||||
districtPriceMap.put("district", district.getRegion());
|
districtPriceMap.put("district", district.getRegion());
|
||||||
@@ -4166,13 +4231,13 @@ public class PropertyController {
|
|||||||
return "fangjia.com";
|
return "fangjia.com";
|
||||||
}
|
}
|
||||||
|
|
||||||
private Integer getFloor(String roomNumber){
|
private Integer getFloor(String roomNumber) {
|
||||||
if(StringUtils.isNotBlank(roomNumber) && DataUtil.isNumber(roomNumber)){
|
if (StringUtils.isNotBlank(roomNumber) && DataUtil.isNumber(roomNumber)) {
|
||||||
if(roomNumber.length() == 3){
|
if (roomNumber.length() == 3) {
|
||||||
return Integer.valueOf(roomNumber.substring(0,1));
|
return Integer.valueOf(roomNumber.substring(0, 1));
|
||||||
}else if(roomNumber.length() == 4){
|
} else if (roomNumber.length() == 4) {
|
||||||
return Integer.valueOf(roomNumber.substring(0,2));
|
return Integer.valueOf(roomNumber.substring(0, 2));
|
||||||
}else{
|
} else {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4403,17 +4468,13 @@ public class PropertyController {
|
|||||||
* 相同小区相似户型房源挂牌量接口<br>
|
* 相同小区相似户型房源挂牌量接口<br>
|
||||||
* 获取该小区的满足指定相似条件的挂牌房源量 条件说明: 1.输入面积-5<=房源面积<=输入面积+5 2.上个月发布的房源
|
* 获取该小区的满足指定相似条件的挂牌房源量 条件说明: 1.输入面积-5<=房源面积<=输入面积+5 2.上个月发布的房源
|
||||||
*
|
*
|
||||||
|
* @param city 城市
|
||||||
|
* @param district 区域
|
||||||
|
* @param name 小区名
|
||||||
|
* @param size 面积
|
||||||
|
* @return
|
||||||
* @author yinjihuan
|
* @author yinjihuan
|
||||||
* @date 2016年9月1日
|
* @date 2016年9月1日
|
||||||
* @param city
|
|
||||||
* 城市
|
|
||||||
* @param district
|
|
||||||
* 区域
|
|
||||||
* @param name
|
|
||||||
* 小区名
|
|
||||||
* @param size
|
|
||||||
* 面积
|
|
||||||
* @return
|
|
||||||
*/
|
*/
|
||||||
public Object similarHouseAmoutAction(@Param(name = "city") String city, @Param(name = "district") String district,
|
public Object similarHouseAmoutAction(@Param(name = "city") String city, @Param(name = "district") String district,
|
||||||
@Param(name = "name") String name, @Param(name = "size") Double size) {
|
@Param(name = "name") String name, @Param(name = "size") Double size) {
|
||||||
@@ -4443,19 +4504,14 @@ public class PropertyController {
|
|||||||
* 周边小区相似户型挂牌量接口<br>
|
* 周边小区相似户型挂牌量接口<br>
|
||||||
* 获取该小区的满足指定相似条件的挂牌房源量 条件说明: 1.输入面积-5<=房源面积<=输入面积+5 2.上个月发布的房源
|
* 获取该小区的满足指定相似条件的挂牌房源量 条件说明: 1.输入面积-5<=房源面积<=输入面积+5 2.上个月发布的房源
|
||||||
*
|
*
|
||||||
|
* @param city 城市
|
||||||
|
* @param district 区域
|
||||||
|
* @param name 小区名
|
||||||
|
* @param size 面积
|
||||||
|
* @param radius 周边小区最大半径(单位:米,默认2000)
|
||||||
|
* @return
|
||||||
* @author yinjihuan
|
* @author yinjihuan
|
||||||
* @date 2016年9月1日
|
* @date 2016年9月1日
|
||||||
* @param city
|
|
||||||
* 城市
|
|
||||||
* @param district
|
|
||||||
* 区域
|
|
||||||
* @param name
|
|
||||||
* 小区名
|
|
||||||
* @param size
|
|
||||||
* 面积
|
|
||||||
* @param radius
|
|
||||||
* 周边小区最大半径(单位:米,默认2000)
|
|
||||||
* @return
|
|
||||||
*/
|
*/
|
||||||
public Object nearbySimilarHouseAmoutAction(@Param(name = "city") String city,
|
public Object nearbySimilarHouseAmoutAction(@Param(name = "city") String city,
|
||||||
@Param(name = "district") String district, @Param(name = "name") String name,
|
@Param(name = "district") String district, @Param(name = "name") String name,
|
||||||
@@ -4494,9 +4550,9 @@ public class PropertyController {
|
|||||||
/**
|
/**
|
||||||
* 小区周边一公里均价
|
* 小区周边一公里均价
|
||||||
*
|
*
|
||||||
* @author wenyan
|
|
||||||
* @param model
|
* @param model
|
||||||
* @return
|
* @return
|
||||||
|
* @author wenyan
|
||||||
*/
|
*/
|
||||||
public Object aroundAverageAction(@Valid AroundAverageModel model) {
|
public Object aroundAverageAction(@Valid AroundAverageModel model) {
|
||||||
|
|
||||||
@@ -5354,7 +5410,7 @@ public class PropertyController {
|
|||||||
* @throws IllegalAccessException
|
* @throws IllegalAccessException
|
||||||
*/
|
*/
|
||||||
@Authority(role = Role.NONE)
|
@Authority(role = Role.NONE)
|
||||||
public Object rentReportAction(PropertyEvaluationModel model, HttpServletRequest request)throws NumberFormatException, IllegalAccessException {
|
public Object rentReportAction(PropertyEvaluationModel model, HttpServletRequest request) throws NumberFormatException, IllegalAccessException {
|
||||||
RestfulModelAndView mav = new RestfulModelAndView();
|
RestfulModelAndView mav = new RestfulModelAndView();
|
||||||
mav.setViewType("rest");
|
mav.setViewType("rest");
|
||||||
if (StringUtils.isBlank(model.getCity()) || StringUtils.isBlank(model.getName())
|
if (StringUtils.isBlank(model.getCity()) || StringUtils.isBlank(model.getName())
|
||||||
@@ -5368,7 +5424,7 @@ public class PropertyController {
|
|||||||
if (StringUtils.isNotBlank(request.getParameter("calDate"))) {
|
if (StringUtils.isNotBlank(request.getParameter("calDate"))) {
|
||||||
Date calDate = null;
|
Date calDate = null;
|
||||||
try {
|
try {
|
||||||
calDate = org.apache.commons.lang.time.DateUtils.parseDate(request.getParameter("calDate"), new String[] { "yyyy-MM-dd" });
|
calDate = org.apache.commons.lang.time.DateUtils.parseDate(request.getParameter("calDate"), new String[]{"yyyy-MM-dd"});
|
||||||
} catch (ParseException e) {
|
} catch (ParseException e) {
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -5427,7 +5483,7 @@ public class PropertyController {
|
|||||||
|
|
||||||
|
|
||||||
if (evaluation.getTotalPrice() != null && evaluation.getTotalPrice() != 0) {
|
if (evaluation.getTotalPrice() != null && evaluation.getTotalPrice() != 0) {
|
||||||
evaluation.setAvgPrice((int)(evaluation.getTotalPrice()/evaluation.getArea()));
|
evaluation.setAvgPrice((int) (evaluation.getTotalPrice() / evaluation.getArea()));
|
||||||
Map<String, Object> districtPriceMap = new HashMap<String, Object>();
|
Map<String, Object> districtPriceMap = new HashMap<String, Object>();
|
||||||
districtPriceMap.put("city", district.getCity());
|
districtPriceMap.put("city", district.getCity());
|
||||||
districtPriceMap.put("district", district.getRegion());
|
districtPriceMap.put("district", district.getRegion());
|
||||||
@@ -5441,10 +5497,10 @@ public class PropertyController {
|
|||||||
districtPriceMap.put("floor", model.getFloor());
|
districtPriceMap.put("floor", model.getFloor());
|
||||||
districtPriceMap.put("height", model.getHeight());
|
districtPriceMap.put("height", model.getHeight());
|
||||||
districtPriceMap.put("fitment", evaluation.getFitment());
|
districtPriceMap.put("fitment", evaluation.getFitment());
|
||||||
districtPriceMap.put("buildYear",district.getFinishBuildingDate());
|
districtPriceMap.put("buildYear", district.getFinishBuildingDate());
|
||||||
|
|
||||||
Integer startPrice = (int)(evaluation.getTotalPrice() - evaluation.getTotalPrice()*0.2);
|
Integer startPrice = (int) (evaluation.getTotalPrice() - evaluation.getTotalPrice() * 0.2);
|
||||||
Integer endPrice = (int)(evaluation.getTotalPrice() + evaluation.getTotalPrice()*0.2);
|
Integer endPrice = (int) (evaluation.getTotalPrice() + evaluation.getTotalPrice() * 0.2);
|
||||||
|
|
||||||
//周边相似小区
|
//周边相似小区
|
||||||
// if (null == model.getRadius()) {// 设置默认值
|
// if (null == model.getRadius()) {// 设置默认值
|
||||||
@@ -5571,11 +5627,11 @@ public class PropertyController {
|
|||||||
* @throws IllegalAccessException
|
* @throws IllegalAccessException
|
||||||
*/
|
*/
|
||||||
@Authority(role = Role.NONE)
|
@Authority(role = Role.NONE)
|
||||||
public Object rentReport2Action(PropertyEvaluationModel model, HttpServletRequest request)throws NumberFormatException, IllegalAccessException {
|
public Object rentReport2Action(PropertyEvaluationModel model, HttpServletRequest request) throws NumberFormatException, IllegalAccessException {
|
||||||
RestfulModelAndView mav = new RestfulModelAndView();
|
RestfulModelAndView mav = new RestfulModelAndView();
|
||||||
mav.setViewType("rest");
|
mav.setViewType("rest");
|
||||||
/* 先到CPDB库中查找小区 */
|
/* 先到CPDB库中查找小区 */
|
||||||
District district = districtService.findByNameAndAlias(model.getCity(), model.getDistrict(), model.getName(),"district");
|
District district = districtService.findByNameAndAlias(model.getCity(), model.getDistrict(), model.getName(), "district");
|
||||||
model.setRegion(district.getRegion());
|
model.setRegion(district.getRegion());
|
||||||
model.setDistrictName(district.getName());
|
model.setDistrictName(district.getName());
|
||||||
if (StringUtils.isBlank(model.getPropertyType())) {
|
if (StringUtils.isBlank(model.getPropertyType())) {
|
||||||
@@ -5588,30 +5644,30 @@ public class PropertyController {
|
|||||||
evaluation = evaluationService.evaluateRent(district, evaluation, model.getCalDate());
|
evaluation = evaluationService.evaluateRent(district, evaluation, model.getCalDate());
|
||||||
|
|
||||||
if (evaluation.getTotalPrice() != null && evaluation.getTotalPrice() != 0) {
|
if (evaluation.getTotalPrice() != null && evaluation.getTotalPrice() != 0) {
|
||||||
evaluation.setAvgPrice((int)(evaluation.getTotalPrice()/evaluation.getArea()));
|
evaluation.setAvgPrice((int) (evaluation.getTotalPrice() / evaluation.getArea()));
|
||||||
Map<String, Object> districtPriceMap = new HashMap<String, Object>();
|
Map<String, Object> districtPriceMap = new HashMap<String, Object>();
|
||||||
Integer startPrice = (int)(evaluation.getTotalPrice() - evaluation.getTotalPrice()*0.2);
|
Integer startPrice = (int) (evaluation.getTotalPrice() - evaluation.getTotalPrice() * 0.2);
|
||||||
Integer endPrice = (int)(evaluation.getTotalPrice() + evaluation.getTotalPrice()*0.2);
|
Integer endPrice = (int) (evaluation.getTotalPrice() + evaluation.getTotalPrice() * 0.2);
|
||||||
|
|
||||||
//周边相似小区
|
//周边相似小区
|
||||||
if (null == model.getRadius()) {// 设置默认值
|
if (null == model.getRadius()) {// 设置默认值
|
||||||
model.setRadius(1000);
|
model.setRadius(1000);
|
||||||
}
|
}
|
||||||
String[] fields = { "city", "region", "name", "estateType2", "id","finishBuildingDate"};
|
String[] fields = {"city", "region", "name", "estateType2", "id", "finishBuildingDate"};
|
||||||
List<District> allDistricts = districtService.findNearestDistrict(district, model.getRadius(), fields, Integer.MAX_VALUE);
|
List<District> allDistricts = districtService.findNearestDistrict(district, model.getRadius(), fields, Integer.MAX_VALUE);
|
||||||
//按条件过滤相似小区
|
//按条件过滤相似小区
|
||||||
Integer buildYear = null;
|
Integer buildYear = null;
|
||||||
List<District> districts = new ArrayList<District>();
|
List<District> districts = new ArrayList<District>();
|
||||||
if(StringUtils.isNotBlank(district.getFinishBuildingDate())){
|
if (StringUtils.isNotBlank(district.getFinishBuildingDate())) {
|
||||||
buildYear = DistrictScoreUtil.parseStringToDate(district.getFinishBuildingDate());
|
buildYear = DistrictScoreUtil.parseStringToDate(district.getFinishBuildingDate());
|
||||||
if(buildYear!=null){
|
if (buildYear != null) {
|
||||||
districts = new ArrayList<District>();
|
districts = new ArrayList<District>();
|
||||||
int startYear = buildYear -7;
|
int startYear = buildYear - 7;
|
||||||
int endYear = buildYear + 7;
|
int endYear = buildYear + 7;
|
||||||
for(District dist : allDistricts){
|
for (District dist : allDistricts) {
|
||||||
if(StringUtils.isNotBlank(dist.getFinishBuildingDate())){
|
if (StringUtils.isNotBlank(dist.getFinishBuildingDate())) {
|
||||||
int simlarDistYear = DistrictScoreUtil.parseStringToDate(district.getFinishBuildingDate());
|
int simlarDistYear = DistrictScoreUtil.parseStringToDate(district.getFinishBuildingDate());
|
||||||
if(simlarDistYear>=startYear && simlarDistYear<=endYear && StringUtils.isNotBlank(district.getEstateType2()) && StringUtils.isNotBlank(dist.getEstateType2()) && district.getEstateType2().equals(dist.getEstateType2())){
|
if (simlarDistYear >= startYear && simlarDistYear <= endYear && StringUtils.isNotBlank(district.getEstateType2()) && StringUtils.isNotBlank(dist.getEstateType2()) && district.getEstateType2().equals(dist.getEstateType2())) {
|
||||||
districts.add(dist);
|
districts.add(dist);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -5620,17 +5676,17 @@ public class PropertyController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//相似房源
|
//相似房源
|
||||||
Double startArea = model.getSize() - model.getSize()*0.1;
|
Double startArea = model.getSize() - model.getSize() * 0.1;
|
||||||
Double endArea = model.getSize() + model.getSize()*0.1;
|
Double endArea = model.getSize() + model.getSize() * 0.1;
|
||||||
Integer startDate = Integer.parseInt(org.apache.tools.ant.util.DateUtils.format(DateUtil.addMonthToDate(new Date(), -12), "yyyyMMdd"));
|
Integer startDate = Integer.parseInt(org.apache.tools.ant.util.DateUtils.format(DateUtil.addMonthToDate(new Date(), -12), "yyyyMMdd"));
|
||||||
List<Seawater> houses = seawaterService.findSeawatersFromEs2("rent", district.getCity(), district.getRegion(), district.getName(), null, null, startDate, null,
|
List<Seawater> houses = seawaterService.findSeawatersFromEs2("rent", district.getCity(), district.getRegion(), district.getName(), null, null, startDate, null,
|
||||||
startArea, endArea, startPrice, endPrice, null, null, "p_date", false, 1, 5 , null,"seawater-20*/_doc");
|
startArea, endArea, startPrice, endPrice, null, null, "p_date", false, 1, 5, null, "seawater-20*/_doc");
|
||||||
//无评估小区房源用周边相似小区的房源
|
//无评估小区房源用周边相似小区的房源
|
||||||
if(null == houses || houses.size()==0){
|
if (null == houses || houses.size() == 0) {
|
||||||
for (District dist : districts) {
|
for (District dist : districts) {
|
||||||
houses = seawaterService.findSeawatersFromEs2("rent", dist.getCity(), dist.getRegion(), dist.getName(), null, null, startDate, null,
|
houses = seawaterService.findSeawatersFromEs2("rent", dist.getCity(), dist.getRegion(), dist.getName(), null, null, startDate, null,
|
||||||
startArea, endArea, startPrice, endPrice, null, null, "p_date", false, 1, 5 , null,"seawater-20*/_doc");
|
startArea, endArea, startPrice, endPrice, null, null, "p_date", false, 1, 5, null, "seawater-20*/_doc");
|
||||||
if(houses!=null && houses.size()>0){
|
if (houses != null && houses.size() > 0) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -5639,10 +5695,10 @@ public class PropertyController {
|
|||||||
|
|
||||||
//周边相似小区租金
|
//周边相似小区租金
|
||||||
Integer room = null;
|
Integer room = null;
|
||||||
if(model.getRoom()!=null && model.getRoom()>0){
|
if (model.getRoom() != null && model.getRoom() > 0) {
|
||||||
room = model.getRoom();
|
room = model.getRoom();
|
||||||
}else{
|
} else {
|
||||||
room = houseService.getDistrictRoomType((float)model.getSize());
|
room = houseService.getDistrictRoomType((float) model.getSize());
|
||||||
}
|
}
|
||||||
if (null != districts) {
|
if (null != districts) {
|
||||||
if (null != room) {
|
if (null != room) {
|
||||||
@@ -5657,10 +5713,10 @@ public class PropertyController {
|
|||||||
DistrictRoomSqmetreRent districtRoomSqmetreRent = districtRoomSqmetreRents.get(0);
|
DistrictRoomSqmetreRent districtRoomSqmetreRent = districtRoomSqmetreRents.get(0);
|
||||||
if (districtRoomSqmetreRent.getAvgPrice() > 0) {
|
if (districtRoomSqmetreRent.getAvgPrice() > 0) {
|
||||||
|
|
||||||
int startSqPrice = (int)(evaluation.getAvgPrice() - evaluation.getAvgPrice()*0.1);
|
int startSqPrice = (int) (evaluation.getAvgPrice() - evaluation.getAvgPrice() * 0.1);
|
||||||
int endSqPrice = (int)(evaluation.getAvgPrice() + evaluation.getAvgPrice()*0.1);
|
int endSqPrice = (int) (evaluation.getAvgPrice() + evaluation.getAvgPrice() * 0.1);
|
||||||
// SqmetreRent sqmetreRent = sqmetreRentService.findNearestSqmetreRent(dist.getCity(), dist.getRegion(), dist.getName(), DateUtil.formatToYYYYMMDD(weekend), "district");
|
// SqmetreRent sqmetreRent = sqmetreRentService.findNearestSqmetreRent(dist.getCity(), dist.getRegion(), dist.getName(), DateUtil.formatToYYYYMMDD(weekend), "district");
|
||||||
if(districtRoomSqmetreRent.getAvgPrice()>=startSqPrice && districtRoomSqmetreRent.getAvgPrice()<=endSqPrice){
|
if (districtRoomSqmetreRent.getAvgPrice() >= startSqPrice && districtRoomSqmetreRent.getAvgPrice() <= endSqPrice) {
|
||||||
DistrictHouseDtao dto = new DistrictHouseDtao();
|
DistrictHouseDtao dto = new DistrictHouseDtao();
|
||||||
dto.setCity(dist.getCity());
|
dto.setCity(dist.getCity());
|
||||||
dto.setRegion(dist.getRegion());
|
dto.setRegion(dist.getRegion());
|
||||||
@@ -5668,7 +5724,7 @@ public class PropertyController {
|
|||||||
dto.setSqAvgPrice(districtRoomSqmetreRent.getAvgPrice());
|
dto.setSqAvgPrice(districtRoomSqmetreRent.getAvgPrice());
|
||||||
dto.setRoom(room);
|
dto.setRoom(room);
|
||||||
dtos.add(dto);
|
dtos.add(dto);
|
||||||
if(dtos.size()>=5){
|
if (dtos.size() >= 5) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -5709,7 +5765,7 @@ public class PropertyController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public Object evaluateRentAction(PropertyEvaluationModel model, HttpServletRequest request)throws NumberFormatException, IllegalAccessException {
|
public Object evaluateRentAction(PropertyEvaluationModel model, HttpServletRequest request) throws NumberFormatException, IllegalAccessException {
|
||||||
RestfulModelAndView mav = new RestfulModelAndView();
|
RestfulModelAndView mav = new RestfulModelAndView();
|
||||||
mav.setViewType("rest");
|
mav.setViewType("rest");
|
||||||
if (StringUtils.isBlank(model.getCity()) || StringUtils.isBlank(model.getName())
|
if (StringUtils.isBlank(model.getCity()) || StringUtils.isBlank(model.getName())
|
||||||
@@ -5723,7 +5779,7 @@ public class PropertyController {
|
|||||||
if (StringUtils.isNotBlank(request.getParameter("calDate"))) {
|
if (StringUtils.isNotBlank(request.getParameter("calDate"))) {
|
||||||
Date calDate = null;
|
Date calDate = null;
|
||||||
try {
|
try {
|
||||||
calDate = org.apache.commons.lang.time.DateUtils.parseDate(request.getParameter("calDate"), new String[] { "yyyy-MM-dd" });
|
calDate = org.apache.commons.lang.time.DateUtils.parseDate(request.getParameter("calDate"), new String[]{"yyyy-MM-dd"});
|
||||||
} catch (ParseException e) {
|
} catch (ParseException e) {
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -5798,11 +5854,11 @@ public class PropertyController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Object searchHouseLoudongAction(PropertyEvaluationModel model, HttpServletRequest request)throws NumberFormatException, IllegalAccessException {
|
public Object searchHouseLoudongAction(PropertyEvaluationModel model, HttpServletRequest request) throws NumberFormatException, IllegalAccessException {
|
||||||
RestfulModelAndView mav = new RestfulModelAndView();
|
RestfulModelAndView mav = new RestfulModelAndView();
|
||||||
mav.setViewType("rest");
|
mav.setViewType("rest");
|
||||||
|
|
||||||
if (StringUtils.isBlank(model.getId()) || StringUtils.isBlank(model.getHouseNumber()) || StringUtils.isBlank(model.getRoomNumber())){
|
if (StringUtils.isBlank(model.getId()) || StringUtils.isBlank(model.getHouseNumber()) || StringUtils.isBlank(model.getRoomNumber())) {
|
||||||
mav.setModel(BasicModel.buildBadRequestModel("参数非法:楼盘编号,楼栋号,室为必填项"));
|
mav.setModel(BasicModel.buildBadRequestModel("参数非法:楼盘编号,楼栋号,室为必填项"));
|
||||||
return mav;
|
return mav;
|
||||||
}
|
}
|
||||||
@@ -5813,11 +5869,11 @@ public class PropertyController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public Object searchLoudongAction(PropertyEvaluationModel model, HttpServletRequest request)throws NumberFormatException, IllegalAccessException {
|
public Object searchLoudongAction(PropertyEvaluationModel model, HttpServletRequest request) throws NumberFormatException, IllegalAccessException {
|
||||||
RestfulModelAndView mav = new RestfulModelAndView();
|
RestfulModelAndView mav = new RestfulModelAndView();
|
||||||
mav.setViewType("rest");
|
mav.setViewType("rest");
|
||||||
|
|
||||||
if (StringUtils.isBlank(model.getId()) || StringUtils.isBlank(model.getHouseNumber())){
|
if (StringUtils.isBlank(model.getId()) || StringUtils.isBlank(model.getHouseNumber())) {
|
||||||
mav.setModel(BasicModel.buildBadRequestModel("参数非法:楼盘编号,楼栋号为必填项"));
|
mav.setModel(BasicModel.buildBadRequestModel("参数非法:楼盘编号,楼栋号为必填项"));
|
||||||
return mav;
|
return mav;
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -203,7 +203,7 @@ public class RentController {
|
|||||||
private Double getSqmetreRent(District district){
|
private Double getSqmetreRent(District district){
|
||||||
SqmetreRent sqmetreRent = sqmetreRentService.findNearestSqmetreRent(district.getCity(), district.getRegion(), district.getName(), null, "district");
|
SqmetreRent sqmetreRent = sqmetreRentService.findNearestSqmetreRent(district.getCity(), district.getRegion(), district.getName(), null, "district");
|
||||||
if(null != sqmetreRent){
|
if(null != sqmetreRent){
|
||||||
return Double.valueOf(sqmetreRent.getAvgPrice());
|
return Double.valueOf(sqmetreRent.getAvgPrice().intValue());
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,6 +27,15 @@ public class AvgPriceQueryModel {
|
|||||||
Integer periodCount;
|
Integer periodCount;
|
||||||
String periodType;
|
String periodType;
|
||||||
Integer houseType;
|
Integer houseType;
|
||||||
|
String cat;
|
||||||
|
|
||||||
|
public String getCat() {
|
||||||
|
return cat;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCat(String cat) {
|
||||||
|
this.cat = cat;
|
||||||
|
}
|
||||||
|
|
||||||
public Integer getPeriodCount() {
|
public Integer getPeriodCount() {
|
||||||
return periodCount;
|
return periodCount;
|
||||||
|
|||||||
+1
-1
@@ -1038,7 +1038,7 @@ public class EvaluationServiceImpl implements EvaluationService {
|
|||||||
|
|
||||||
SqmetreRent sqmetreRent = sqmetreRentService.findNearestSqmetreRent(district.getCity(), district.getRegion(), district.getName(), DateUtil.formatToYYYYMMDD(weekend), "district");
|
SqmetreRent sqmetreRent = sqmetreRentService.findNearestSqmetreRent(district.getCity(), district.getRegion(), district.getName(), DateUtil.formatToYYYYMMDD(weekend), "district");
|
||||||
if(sqmetreRent!=null){
|
if(sqmetreRent!=null){
|
||||||
long totalPrice = evaluationRateService.evaluationRent(sqmetreRent.getAvgPrice(), evaluation);
|
long totalPrice = evaluationRateService.evaluationRent(sqmetreRent.getAvgPrice().intValue(), evaluation);
|
||||||
|
|
||||||
evaluation.setTotalPrice(((Number) (totalPrice)).intValue());
|
evaluation.setTotalPrice(((Number) (totalPrice)).intValue());
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -194,7 +194,7 @@ public class HouseReportServiceImpl implements HouseReportService{
|
|||||||
SqmetreRent citySqmetreRent = sqmetreRentService.findNearestSqmetreRent(city, null, null, "city");
|
SqmetreRent citySqmetreRent = sqmetreRentService.findNearestSqmetreRent(city, null, null, "city");
|
||||||
RegionStat cityRegionStat = regionStatService.findByCity(city);
|
RegionStat cityRegionStat = regionStatService.findByCity(city);
|
||||||
if(null != citySqmetreRent && null != cityRegionStat){
|
if(null != citySqmetreRent && null != cityRegionStat){
|
||||||
Double rate = DataUtil.getDoubleRound(2, citySqmetreRent.getAvgPrice()*12*100/cityRegionStat.getAvgPrice());
|
Double rate = DataUtil.getDoubleRound(2, citySqmetreRent.getAvgPrice().intValue()*12*100/cityRegionStat.getAvgPrice());
|
||||||
return rate;
|
return rate;
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
@@ -205,7 +205,7 @@ public class HouseReportServiceImpl implements HouseReportService{
|
|||||||
SqmetreRent regionSqmetreRent = sqmetreRentService.findNearestSqmetreRent(city, region, null, "region");
|
SqmetreRent regionSqmetreRent = sqmetreRentService.findNearestSqmetreRent(city, region, null, "region");
|
||||||
RegionStat regionStat = regionStatService.findRegionStat(city, region);
|
RegionStat regionStat = regionStatService.findRegionStat(city, region);
|
||||||
if(null != regionSqmetreRent && null != regionStat){
|
if(null != regionSqmetreRent && null != regionStat){
|
||||||
Double rate = DataUtil.getDoubleRound(2, regionSqmetreRent.getAvgPrice()*12*100/regionStat.getAvgPrice());
|
Double rate = DataUtil.getDoubleRound(2, regionSqmetreRent.getAvgPrice().intValue()*12*100/regionStat.getAvgPrice());
|
||||||
return rate;
|
return rate;
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
@@ -224,7 +224,7 @@ public class HouseReportServiceImpl implements HouseReportService{
|
|||||||
distAvgPrice = statBo.getVillaDistrictStat().getAvgPrice();
|
distAvgPrice = statBo.getVillaDistrictStat().getAvgPrice();
|
||||||
}
|
}
|
||||||
if(distAvgPrice > 0){
|
if(distAvgPrice > 0){
|
||||||
Double rate = DataUtil.getDoubleRound(2, distSqmetreRent.getAvgPrice()*12*100/distAvgPrice);
|
Double rate = DataUtil.getDoubleRound(2, distSqmetreRent.getAvgPrice().intValue()*12*100/distAvgPrice);
|
||||||
return rate;
|
return rate;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+7
@@ -126,6 +126,13 @@ public class SqmetreRentServiceImpl implements SqmetreRentService{
|
|||||||
if(StringUtils.isNotBlank(cat)){
|
if(StringUtils.isNotBlank(cat)){
|
||||||
params.add(new QueryParam("cat", cat));
|
params.add(new QueryParam("cat", cat));
|
||||||
}
|
}
|
||||||
|
if(null != startDate){
|
||||||
|
params.add(new QueryParam("weekend",QueryParam.GREATER_THAN_EQUAL_OPERATOR, startDate));
|
||||||
|
}
|
||||||
|
|
||||||
|
if(null != endDate){
|
||||||
|
params.add(new QueryParam("weekend",QueryParam.LESS_THAN_EQUAL_OPERATOR, endDate));
|
||||||
|
}
|
||||||
|
|
||||||
List<SortParam> sortParams = new ArrayList<SortParam>();
|
List<SortParam> sortParams = new ArrayList<SortParam>();
|
||||||
sortParams.add(new SortParam("weekend", true));
|
sortParams.add(new SortParam("weekend", true));
|
||||||
|
|||||||
Reference in New Issue
Block a user