自身房源
This commit is contained in:
@@ -234,7 +234,7 @@ public class Seawater implements SeawaterEntity {
|
||||
this.floor = floor;
|
||||
}
|
||||
|
||||
@Column(name = "floorInfo")
|
||||
@Column(name = "floor_info")
|
||||
public String getFloorInfo() {
|
||||
return floorInfo;
|
||||
}
|
||||
|
||||
+129
-9
@@ -27,10 +27,7 @@ import com.fangjia.open.dto.UniversalDto;
|
||||
import com.fangjia.open.dto.addressGovernance.MatchedBuildingDto;
|
||||
import com.fangjia.open.interceptors.Authority;
|
||||
import com.fangjia.open.interceptors.Role;
|
||||
import com.fangjia.open.model.BasicModel;
|
||||
import com.fangjia.open.model.HousePublishModel;
|
||||
import com.fangjia.open.model.HouseSearchModel;
|
||||
import com.fangjia.open.model.RestfulModelAndView;
|
||||
import com.fangjia.open.model.*;
|
||||
import com.fangjia.open.util.CommonDtoUtils;
|
||||
import com.fangjia.open.util.FileDao;
|
||||
import com.fangjia.open.ws.query.CollateralSampleQuery;
|
||||
@@ -1019,14 +1016,14 @@ public class HouseController {
|
||||
if (!"暂无数据".equals(name) && StringUtils.isNotBlank(name)) {
|
||||
seawater.setTitle(name);
|
||||
}
|
||||
if (cat.contains("office")){
|
||||
if (cat.contains("office")) {
|
||||
seawater.setLevel(house.getLevel());
|
||||
}
|
||||
if (cat.contains("shop")){
|
||||
if (StringUtils.isNotBlank(house.getEstateType()) && !"其他".equals(house.getEstateType())){
|
||||
if (cat.contains("shop")) {
|
||||
if (StringUtils.isNotBlank(house.getEstateType()) && !"其他".equals(house.getEstateType())) {
|
||||
seawater.setShopType(house.getEstateType());
|
||||
}
|
||||
if (StringUtils.isNotBlank(house.getBusinessRange())){
|
||||
if (StringUtils.isNotBlank(house.getBusinessRange())) {
|
||||
seawater.setBusinessScope(house.getBusinessRange());
|
||||
}
|
||||
}
|
||||
@@ -1147,10 +1144,11 @@ public class HouseController {
|
||||
mav.setViewType("rest");
|
||||
return mav;
|
||||
}
|
||||
|
||||
public Object rentAction(final HouseSearchModel model) {
|
||||
RestfulModelAndView mav = new RestfulModelAndView();
|
||||
mav.setViewType("rest");
|
||||
if (model.getSize()!= null && model.getSize()<0) {
|
||||
if (model.getSize() != null && model.getSize() < 0) {
|
||||
mav.setModel(BasicModel.buildBadRequestModel("参数(size)有误"));
|
||||
return mav;
|
||||
}
|
||||
@@ -1243,6 +1241,128 @@ public class HouseController {
|
||||
return mav;
|
||||
}
|
||||
|
||||
public Object resourcesAction(final HouseSearchModel model) {
|
||||
RestfulModelAndView mav = new RestfulModelAndView();
|
||||
mav.setViewType("rest");
|
||||
if (model.getSize() != null && model.getSize() < 0) {
|
||||
mav.setModel(BasicModel.buildBadRequestModel("参数(size)有误"));
|
||||
return mav;
|
||||
}
|
||||
if (StringUtils.isBlank(model.getCity()) || StringUtils.isBlank(model.getDistrict()) || StringUtils.isBlank(model.getName())) {
|
||||
mav.setModel(BasicModel.buildBadRequestModel("城市(city),区域(district),小区名(name)为必填参数"));
|
||||
return mav;
|
||||
}
|
||||
District property = districtService.findByNameAndAlias(model.getCity(), model.getDistrict(), model.getName(), "district");
|
||||
if (null == property) {
|
||||
mav.setModel(BasicModel.buildBadRequestModel("未找到该小区"));
|
||||
return mav;
|
||||
}
|
||||
// 没有输入时间范围,则是默认六个月的
|
||||
if (model.getStartTime() == null && model.getEndTime() == null) {
|
||||
// 获取当前日期
|
||||
Calendar today = Calendar.getInstance();
|
||||
|
||||
// 复制一份当前日期,用于计算半年前的日期
|
||||
Calendar sixMonthsAgo = (Calendar) today.clone();
|
||||
|
||||
// 减去 6 个月
|
||||
sixMonthsAgo.add(Calendar.MONTH, -6);
|
||||
|
||||
// 格式化日期为 yyyyMMdd
|
||||
int todayInt = formatDate(today);
|
||||
int sixMonthsAgoInt = formatDate(sixMonthsAgo);
|
||||
model.setStartTime(sixMonthsAgoInt);
|
||||
model.setEndTime(todayInt);
|
||||
}
|
||||
|
||||
List<Seawater> houses = null;
|
||||
List<Seawater> houseList = new ArrayList<Seawater>();
|
||||
SeawaterQuery query = new SeawaterQuery();
|
||||
List catList = Arrays.asList("rent", "sell", "office_rent", "office_sell", "shop_sell", "shop_rent");
|
||||
if (!catList.contains(model.getCat())) {
|
||||
model.setCat("rent");
|
||||
}
|
||||
query.setCat(model.getCat());
|
||||
query.setStartDate(model.getStartTime());
|
||||
query.setEndDate(model.getEndTime());
|
||||
if (model.getSize() != null && model.getSize() != 0) {
|
||||
query.setStartArea(model.getSize() * 0.9);
|
||||
query.setEndArea(model.getSize() * 1.1);
|
||||
}
|
||||
query.setCityDisplay(model.getCity());
|
||||
query.setRegion(model.getDistrict());
|
||||
query.setDistrictName(model.getName());
|
||||
query.setDistrictAlias(property.getAlias());
|
||||
Pager pager = new Pager();
|
||||
// 没有查询数量,默认查前五个
|
||||
if (model.getPageIndex() == null) {
|
||||
pager.setStartRow(0);
|
||||
} else {
|
||||
pager.setStartRow(model.getPageIndex());
|
||||
}
|
||||
pager.setPageSize(model.getPageSize());
|
||||
query.setPager(pager);
|
||||
query.setTable("latest_seawater");
|
||||
if (StringUtils.isNotBlank(model.getSortField())){
|
||||
query.setSortField(model.getSortField());
|
||||
}else {
|
||||
query.setSortField("p_date");
|
||||
}
|
||||
if ("asc".equals(model.getSortBy())) {
|
||||
query.setOrder(true);
|
||||
}else {
|
||||
query.setOrder(false);
|
||||
}
|
||||
houses = seawaterDao.findSeawatersByQuery(query);
|
||||
if (houses != null && !houses.isEmpty()) {
|
||||
for (Seawater house : houses) {
|
||||
Seawater seawater = new Seawater();
|
||||
seawater.setId(house.getId());
|
||||
seawater.setCity(house.getCity());
|
||||
seawater.setDistrict(house.getRegion());
|
||||
seawater.setAddress(house.getAddress());
|
||||
seawater.setName(house.getDistrictName());
|
||||
String name = house.getName();
|
||||
if (!"暂无数据".equals(name) && StringUtils.isNotBlank(name)) {
|
||||
seawater.setTitle(name);
|
||||
}
|
||||
seawater.setSize(house.getArea() == null || house.getArea() == 0 ? null : house.getArea());
|
||||
seawater.setUnitPrice(house.getAvgPrice() == null || house.getAvgPrice() == 0 ? null : house.getAvgPrice());
|
||||
seawater.setTotalPrice(house.getTotalPrice() == null || house.getTotalPrice() == 0 ? null : house.getTotalPrice());
|
||||
seawater.setDirection(house.getDirection());
|
||||
seawater.setFloor(house.getFloor() == null || house.getFloor() == 0 ? null : house.getFloor());
|
||||
seawater.setMaxFloor(house.getHeight() == null || house.getHeight() == 0 ? null : house.getHeight());
|
||||
seawater.setRoom(house.getRoom() == null || house.getRoom() == 0 ? null : house.getRoom());
|
||||
seawater.setHall(house.getHall() == null || house.getHall() == 0 ? null : house.getHall());
|
||||
seawater.setToilet(house.getToilet() == null || house.getToilet() == 0 ? null : house.getToilet());
|
||||
seawater.setDecoration(house.getFitment());
|
||||
seawater.setFloorInfo(house.getFloorInfo());
|
||||
seawater.setRoot(house.getRoot());
|
||||
if (house.getpDate() != null && house.getpDate() > 10000000) {
|
||||
String numberStr = String.valueOf(house.getpDate());
|
||||
// 拆分字符串并格式化
|
||||
String year = numberStr.substring(0, 4); // 前四位是年份
|
||||
String month = numberStr.substring(4, 6); // 中间两位是月份
|
||||
String day = numberStr.substring(6, 8); // 最后两位是日期
|
||||
String formattedDate = year + "-" + month + "-" + day;
|
||||
seawater.setPublishDate(formattedDate);
|
||||
}
|
||||
houseList.add(seawater);
|
||||
}
|
||||
}
|
||||
BasicPageModel pageModel = new BasicPageModel(200, "ok");
|
||||
pager.setPageSize(-1);
|
||||
pager.setStartRow(-1);
|
||||
query.setPager(pager);
|
||||
long count = seawaterDao.findSeawatersCountByQuery(query);
|
||||
pageModel.setTotal((int) count);
|
||||
// 组装数据
|
||||
pageModel.setResult(houseList);
|
||||
mav.setModel(pageModel);
|
||||
mav.setViewType("rest");
|
||||
return mav;
|
||||
}
|
||||
|
||||
Double sub6(Double a) {
|
||||
BigDecimal bd = new BigDecimal(a);
|
||||
BigDecimal bigDecimal = bd.setScale(6, BigDecimal.ROUND_DOWN);
|
||||
|
||||
@@ -0,0 +1,115 @@
|
||||
package com.fangjia.open.model;
|
||||
|
||||
import com.fangjia.open.APIConstant;
|
||||
import com.fangjia.open.HttpStatusCodeEnum;
|
||||
import com.thoughtworks.xstream.annotations.XStreamAlias;
|
||||
import org.sothis.web.mvc.ActionContext;
|
||||
|
||||
@XStreamAlias("xml")
|
||||
public class BasicPageModel {
|
||||
|
||||
private int code;
|
||||
|
||||
private String msg;
|
||||
|
||||
private Object result;
|
||||
|
||||
private String tid;
|
||||
|
||||
private int total;
|
||||
|
||||
public BasicPageModel(int code, String msg) {
|
||||
super();
|
||||
this.code = code;
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public BasicPageModel(HttpStatusCodeEnum status){
|
||||
this.code = status.getCode();
|
||||
this.msg = status.getMsg();
|
||||
}
|
||||
|
||||
public static BasicPageModel buildOKModel() {
|
||||
BasicPageModel model = new BasicPageModel(HttpStatusCodeEnum.OK);
|
||||
return model;
|
||||
}
|
||||
|
||||
public static BasicPageModel buildModel(int code, String msg){
|
||||
return new BasicPageModel( code, msg);
|
||||
}
|
||||
|
||||
public static BasicPageModel buildUnAuthorizedModel() {
|
||||
BasicPageModel model = new BasicPageModel(HttpStatusCodeEnum.UN_AUTHORIZED);
|
||||
return model;
|
||||
}
|
||||
|
||||
public static BasicPageModel buildBadRequestModel(String msg){
|
||||
BasicPageModel model = new BasicPageModel(HttpStatusCodeEnum.BAD_REQUEST);
|
||||
model.setMsg(msg);
|
||||
return model;
|
||||
}
|
||||
|
||||
public static BasicPageModel buildForbidModel(String msg){
|
||||
BasicPageModel model = new BasicPageModel(HttpStatusCodeEnum.SERVER_FORBID);
|
||||
model.setMsg(msg);
|
||||
return model;
|
||||
}
|
||||
|
||||
|
||||
public static BasicPageModel buildServerErrorModel(){
|
||||
BasicPageModel model = new BasicPageModel(HttpStatusCodeEnum.SERVER_ERROR);
|
||||
return model;
|
||||
}
|
||||
|
||||
public static void markNoDataRequest(){
|
||||
ActionContext.getContext().set(APIConstant.IS_RETURN_DATA, Boolean.FALSE);
|
||||
}
|
||||
|
||||
public BasicPageModel markNoData(){
|
||||
markNoDataRequest();
|
||||
return this;
|
||||
}
|
||||
|
||||
public int getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public BasicPageModel setCode(int code) {
|
||||
this.code = code;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public BasicPageModel setMsg(String msg) {
|
||||
this.msg = msg;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Object getResult() {
|
||||
return result;
|
||||
}
|
||||
|
||||
public BasicPageModel setResult(Object result) {
|
||||
this.result = result;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void setTid(String tid) {
|
||||
this.tid = tid;
|
||||
}
|
||||
|
||||
public String getTid() {
|
||||
return tid;
|
||||
}
|
||||
|
||||
public int getTotal() {
|
||||
return total;
|
||||
}
|
||||
|
||||
public void setTotal(int total) {
|
||||
this.total = total;
|
||||
}
|
||||
}
|
||||
+344
@@ -0,0 +1,344 @@
|
||||
package com.fangjia.open.model;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 小区周边配套
|
||||
*/
|
||||
public class DistrictFacilitysModel {
|
||||
private static final long serialVersionUID = -9200383212669643823L;
|
||||
private String id;
|
||||
private String city;
|
||||
private String region;
|
||||
private String districtName;
|
||||
private List<String> kindergarten;
|
||||
private List<String> primarySchool;
|
||||
private List<String> middleSchool;
|
||||
private List<String> university;
|
||||
private List<String> hospital;
|
||||
private List<String> shop;
|
||||
private List<String> supermarket;
|
||||
private List<String> foodShop;
|
||||
private List<String> bus;
|
||||
private List<String> metro;
|
||||
private List<String> bank;
|
||||
private List<String> atm;
|
||||
private String innerFacilities;
|
||||
private String carSite;
|
||||
private String carSiteDes;
|
||||
|
||||
private Double trafficScore;
|
||||
private Double hospitalScore;
|
||||
private Double shopScore;
|
||||
private Double schoolScore;
|
||||
private Double bankScore;
|
||||
|
||||
private Date creationDate;
|
||||
|
||||
private List<String> positives; // 正面
|
||||
private List<String> negatives; // 负面
|
||||
private List<String> appraisalNegative; // 负面
|
||||
private List<String> appraisalPositive; // 正面
|
||||
|
||||
/**
|
||||
* 鏍囩寰楀垎
|
||||
*/
|
||||
private Double traScore;
|
||||
private Double virScore;
|
||||
private Double aroScore;
|
||||
private Double tradScore;
|
||||
|
||||
private String imgUrl3D;
|
||||
|
||||
private List<String> school;
|
||||
private List<String> keySchool;
|
||||
|
||||
public String getCity() {
|
||||
return city;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public void setCity(String city) {
|
||||
this.city = city;
|
||||
}
|
||||
|
||||
public String getRegion() {
|
||||
return region;
|
||||
}
|
||||
|
||||
public void setRegion(String region) {
|
||||
this.region = region;
|
||||
}
|
||||
|
||||
public String getDistrictName() {
|
||||
return districtName;
|
||||
}
|
||||
|
||||
public void setDistrictName(String districtName) {
|
||||
this.districtName = districtName;
|
||||
}
|
||||
|
||||
public List<String> getKindergarten() {
|
||||
return kindergarten;
|
||||
}
|
||||
|
||||
public void setKindergarten(List<String> kindergarten) {
|
||||
this.kindergarten = kindergarten;
|
||||
}
|
||||
|
||||
public List<String> getPrimarySchool() {
|
||||
return primarySchool;
|
||||
}
|
||||
|
||||
public void setPrimarySchool(List<String> primarySchool) {
|
||||
this.primarySchool = primarySchool;
|
||||
}
|
||||
|
||||
public List<String> getMiddleSchool() {
|
||||
return middleSchool;
|
||||
}
|
||||
|
||||
public void setMiddleSchool(List<String> middleSchool) {
|
||||
this.middleSchool = middleSchool;
|
||||
}
|
||||
|
||||
public List<String> getUniversity() {
|
||||
return university;
|
||||
}
|
||||
|
||||
public void setUniversity(List<String> university) {
|
||||
this.university = university;
|
||||
}
|
||||
|
||||
public List<String> getHospital() {
|
||||
return hospital;
|
||||
}
|
||||
|
||||
public void setHospital(List<String> hospital) {
|
||||
this.hospital = hospital;
|
||||
}
|
||||
|
||||
public List<String> getShop() {
|
||||
return shop;
|
||||
}
|
||||
|
||||
public void setShop(List<String> shop) {
|
||||
this.shop = shop;
|
||||
}
|
||||
|
||||
public List<String> getSupermarket() {
|
||||
return supermarket;
|
||||
}
|
||||
|
||||
public void setSupermarket(List<String> supermarket) {
|
||||
this.supermarket = supermarket;
|
||||
}
|
||||
|
||||
public List<String> getFoodShop() {
|
||||
return foodShop;
|
||||
}
|
||||
|
||||
public void setFoodShop(List<String> foodShop) {
|
||||
this.foodShop = foodShop;
|
||||
}
|
||||
|
||||
public List<String> getBus() {
|
||||
return bus;
|
||||
}
|
||||
|
||||
public void setBus(List<String> bus) {
|
||||
this.bus = bus;
|
||||
}
|
||||
|
||||
public List<String> getMetro() {
|
||||
return metro;
|
||||
}
|
||||
|
||||
public void setMetro(List<String> metro) {
|
||||
this.metro = metro;
|
||||
}
|
||||
|
||||
public List<String> getBank() {
|
||||
return bank;
|
||||
}
|
||||
|
||||
public void setBank(List<String> bank) {
|
||||
this.bank = bank;
|
||||
}
|
||||
|
||||
public List<String> getAtm() {
|
||||
return atm;
|
||||
}
|
||||
|
||||
public void setAtm(List<String> atm) {
|
||||
this.atm = atm;
|
||||
}
|
||||
|
||||
public String getInnerFacilities() {
|
||||
return innerFacilities;
|
||||
}
|
||||
|
||||
public void setInnerFacilities(String innerFacilities) {
|
||||
this.innerFacilities = innerFacilities;
|
||||
}
|
||||
|
||||
public String getCarSite() {
|
||||
return carSite;
|
||||
}
|
||||
|
||||
public void setCarSite(String carSite) {
|
||||
this.carSite = carSite;
|
||||
}
|
||||
|
||||
public String getCarSiteDes() {
|
||||
return carSiteDes;
|
||||
}
|
||||
|
||||
public void setCarSiteDes(String carSiteDes) {
|
||||
this.carSiteDes = carSiteDes;
|
||||
}
|
||||
|
||||
public Double getTrafficScore() {
|
||||
return trafficScore;
|
||||
}
|
||||
|
||||
public void setTrafficScore(Double trafficScore) {
|
||||
this.trafficScore = trafficScore;
|
||||
}
|
||||
|
||||
public Double getHospitalScore() {
|
||||
return hospitalScore;
|
||||
}
|
||||
|
||||
public void setHospitalScore(Double hospitalScore) {
|
||||
this.hospitalScore = hospitalScore;
|
||||
}
|
||||
|
||||
public Double getShopScore() {
|
||||
return shopScore;
|
||||
}
|
||||
|
||||
public void setShopScore(Double shopScore) {
|
||||
this.shopScore = shopScore;
|
||||
}
|
||||
|
||||
public Double getSchoolScore() {
|
||||
return schoolScore;
|
||||
}
|
||||
|
||||
public void setSchoolScore(Double schoolScore) {
|
||||
this.schoolScore = schoolScore;
|
||||
}
|
||||
|
||||
public Double getBankScore() {
|
||||
return bankScore;
|
||||
}
|
||||
|
||||
public void setBankScore(Double bankScore) {
|
||||
this.bankScore = bankScore;
|
||||
}
|
||||
|
||||
public Date getCreationDate() {
|
||||
return creationDate;
|
||||
}
|
||||
|
||||
public void setCreationDate(Date creationDate) {
|
||||
this.creationDate = creationDate;
|
||||
}
|
||||
|
||||
public List<String> getPositives() {
|
||||
return positives;
|
||||
}
|
||||
|
||||
public void setPositives(List<String> positives) {
|
||||
this.positives = positives;
|
||||
}
|
||||
|
||||
public List<String> getNegatives() {
|
||||
return negatives;
|
||||
}
|
||||
|
||||
public void setNegatives(List<String> negatives) {
|
||||
this.negatives = negatives;
|
||||
}
|
||||
|
||||
public List<String> getAppraisalNegative() {
|
||||
return appraisalNegative;
|
||||
}
|
||||
|
||||
public void setAppraisalNegative(List<String> appraisalNegative) {
|
||||
this.appraisalNegative = appraisalNegative;
|
||||
}
|
||||
|
||||
public List<String> getAppraisalPositive() {
|
||||
return appraisalPositive;
|
||||
}
|
||||
|
||||
public void setAppraisalPositive(List<String> appraisalPositive) {
|
||||
this.appraisalPositive = appraisalPositive;
|
||||
}
|
||||
|
||||
public Double getTraScore() {
|
||||
return traScore;
|
||||
}
|
||||
|
||||
public void setTraScore(Double traScore) {
|
||||
this.traScore = traScore;
|
||||
}
|
||||
|
||||
public Double getVirScore() {
|
||||
return virScore;
|
||||
}
|
||||
|
||||
public void setVirScore(Double virScore) {
|
||||
this.virScore = virScore;
|
||||
}
|
||||
|
||||
public Double getAroScore() {
|
||||
return aroScore;
|
||||
}
|
||||
|
||||
public void setAroScore(Double aroScore) {
|
||||
this.aroScore = aroScore;
|
||||
}
|
||||
|
||||
public Double getTradScore() {
|
||||
return tradScore;
|
||||
}
|
||||
|
||||
public void setTradScore(Double tradScore) {
|
||||
this.tradScore = tradScore;
|
||||
}
|
||||
|
||||
public String getImgUrl3D() {
|
||||
return imgUrl3D;
|
||||
}
|
||||
|
||||
public void setImgUrl3D(String imgUrl3D) {
|
||||
this.imgUrl3D = imgUrl3D;
|
||||
}
|
||||
|
||||
public List<String> getSchool() {
|
||||
return school;
|
||||
}
|
||||
|
||||
public void setSchool(List<String> school) {
|
||||
this.school = school;
|
||||
}
|
||||
|
||||
public List<String> getKeySchool() {
|
||||
return keySchool;
|
||||
}
|
||||
|
||||
public void setKeySchool(List<String> keySchool) {
|
||||
this.keySchool = keySchool;
|
||||
}
|
||||
}
|
||||
@@ -25,6 +25,8 @@ public class HouseSearchModel extends SearchModel {
|
||||
private String houseType;
|
||||
|
||||
private String district;
|
||||
|
||||
private String cat;
|
||||
@Override
|
||||
public QueryBean getQueryBean() {
|
||||
HouseQueryBean queryBean = new HouseQueryBean();
|
||||
@@ -187,4 +189,12 @@ public class HouseSearchModel extends SearchModel {
|
||||
public void setDistrict(String district) {
|
||||
this.district = district;
|
||||
}
|
||||
|
||||
public String getCat() {
|
||||
return cat;
|
||||
}
|
||||
|
||||
public void setCat(String cat) {
|
||||
this.cat = cat;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user