Merge branch 'open_bohai' into 'master'

新增接口

See merge request !296
This commit is contained in:
2022-05-11 23:03:11 +08:00
20 changed files with 635 additions and 10 deletions
@@ -0,0 +1,7 @@
package com.fangjia.dal.mongo.dao;
import com.fangjia.dal.MongoDao;
import com.fangjia.dal.mongo.model.BsEvaluation;
public interface BsEvaluationDao extends MongoDao<BsEvaluation> {
}
@@ -0,0 +1,8 @@
package com.fangjia.dal.mongo.dao;
import com.fangjia.dal.MongoDaoImpl;
import com.fangjia.dal.mongo.model.BsEvaluation;
public class BsEvaluationDaoImpl extends MongoDaoImpl<BsEvaluation> implements
BsEvaluationDao {
}
@@ -0,0 +1,184 @@
package com.fangjia.dal.mongo.model;
import com.fangjia.dal.MongoEntity;
import javax.persistence.*;
import java.util.Date;
@Entity
@Table(name = "business.evaluation")
public class BsEvaluation implements MongoEntity {
private String id;
private String fullAddress;
private String commid;
private String cityName;
private String distName;
private String commName;
private String address;
private Double buildArea;
private Integer floor;
private Integer floorcnt;
private Integer roomcnt;
private Integer livingroomcnt;
private String houseaspect;//ÄÏ
private String fitment;
private Date cDate;
private Integer unitPrice;
private Integer totalPrice;
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name = "_id")
public String getId() {
return id;
}
@Override
public void setId(String id) {
this.id = id;
}
@Column(name = "full_address")
public String getFullAddress() {
return fullAddress;
}
public void setFullAddress(String fullAddress) {
this.fullAddress = fullAddress;
}
@Column(name = "commid")
public String getCommid() {
return commid;
}
public void setCommid(String commid) {
this.commid = commid;
}
@Column(name = "cityname")
public String getCityName() {
return cityName;
}
public void setCityName(String cityName) {
this.cityName = cityName;
}
@Column(name = "distname")
public String getDistName() {
return distName;
}
public void setDistName(String distName) {
this.distName = distName;
}
@Column(name = "commname")
public String getCommName() {
return commName;
}
public void setCommName(String commName) {
this.commName = commName;
}
@Column(name = "address")
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
@Column(name = "buildarea")
public Double getBuildArea() {
return buildArea;
}
public void setBuildArea(Double buildArea) {
this.buildArea = buildArea;
}
@Column(name = "floor")
public Integer getFloor() {
return floor;
}
public void setFloor(Integer floor) {
this.floor = floor;
}
@Column(name = "floorcnt")
public Integer getFloorcnt() {
return floorcnt;
}
public void setFloorcnt(Integer floorcnt) {
this.floorcnt = floorcnt;
}
@Column(name = "roomcnt")
public Integer getRoomcnt() {
return roomcnt;
}
public void setRoomcnt(Integer roomcnt) {
this.roomcnt = roomcnt;
}
@Column(name = "livingroomcnt")
public Integer getLivingroomcnt() {
return livingroomcnt;
}
public void setLivingroomcnt(Integer livingroomcnt) {
this.livingroomcnt = livingroomcnt;
}
@Column(name = "houseaspect")
public String getHouseaspect() {
return houseaspect;
}
public void setHouseaspect(String houseaspect) {
this.houseaspect = houseaspect;
}
@Column(name = "fitment")
public String getFitment() {
return fitment;
}
public void setFitment(String fitment) {
this.fitment = fitment;
}
@Column(name = "c_date")
public Date getcDate() {
return cDate;
}
public void setcDate(Date cDate) {
this.cDate = cDate;
}
@Column(name = "unitprice")
public Integer getUnitPrice() {
return unitPrice;
}
public void setUnitPrice(Integer unitPrice) {
this.unitPrice = unitPrice;
}
@Column(name = "totalprice")
public Integer getTotalPrice() {
return totalPrice;
}
public void setTotalPrice(Integer totalPrice) {
this.totalPrice = totalPrice;
}
}
@@ -48,6 +48,11 @@ public class DealPrice implements MongoEntity {
private Integer floor;//当前楼层
private Long score;
private String matchId;
private String matchCity;
private String matchRegion;
private String matchName;
@Id
@GeneratedValue
@Column(name = "_id", unique = true, nullable = false)
@@ -296,4 +301,40 @@ public class DealPrice implements MongoEntity {
}
return true;
}
@Column(name = "match_id")
public String getMatchId() {
return matchId;
}
public void setMatchId(String matchId) {
this.matchId = matchId;
}
@Column(name = "match_city")
public String getMatchCity() {
return matchCity;
}
public void setMatchCity(String matchCity) {
this.matchCity = matchCity;
}
@Column(name = "match_region")
public String getMatchRegion() {
return matchRegion;
}
public void setMatchRegion(String matchRegion) {
this.matchRegion = matchRegion;
}
@Column(name = "match_name")
public String getMatchName() {
return matchName;
}
public void setMatchName(String matchName) {
this.matchName = matchName;
}
}
@@ -67,6 +67,13 @@ public class SeawaterDaoImpl extends com.fangjia.dal.SeawaterDaoImpl<Seawater> i
must.add(addTerms("district_name", alias));
must.add(addMatch("cat", "sell"));
must.add(addRange("avg_price", minPrice, maxPrice));
JSONObject term = new JSONObject();
JSONObject match = new JSONObject();
match.put("p_date", 20210501);
term.put("match", match);
must.add(term);
bool.put("must", must);
query.put("bool", bool);
reqBody.put("query", query);
@@ -58,6 +58,8 @@ public class Seawater implements SeawaterEntity {
private String url;
private String root;
private Integer avgPrice;
private String purpose;
private String estateType;
@Id
@Column(name = "_id")
@@ -285,4 +287,22 @@ public class Seawater implements SeawaterEntity {
public void setAvgPrice(Integer avgPrice) {
this.avgPrice = avgPrice;
}
@Column(name = "purpose")
public String getPurpose() {
return purpose;
}
public void setPurpose(String purpose) {
this.purpose = purpose;
}
@Column(name = "estate_type")
public String getEstateType() {
return estateType;
}
public void setEstateType(String estateType) {
this.estateType = estateType;
}
}
@@ -23,13 +23,13 @@ import java.util.regex.Pattern;
/**
* 法拍数据提供接口
*/
@Authority(role = Role.USER)
//@Authority(role = Role.USER)
public class AuctionController {
private PaiMaiService paiMaiService;
private DistrictNewPriceService districtNewPriceService;
private static final String[] SEARCH_FIELDS = new String[]{"marketAvgPrice", "startDate", "curPrice", "imgUrls", "id", "matchCity", "matchRegion", "matchName", "address", "marketTotalPrice", "startPrice", "curPrice", "predictPrice", "depositPrice", "area", "status", "url", "matchEstateType"};
private static final String[] SEARCH_FIELDS = new String[]{"marketAvgPrice", "startDate", "curPrice", "imgUrls", "id", "matchCity", "matchRegion", "matchName", "address", "marketTotalPrice", "startPrice", "curPrice", "predictPrice", "depositPrice", "area", "status", "url", "matchEstateType","type","count"};
public Object housesAction(AuctionModel model){
RestfulModelAndView mav = new RestfulModelAndView();
@@ -187,6 +187,27 @@ public class AuctionController {
return mav;
}
public Object searchPaimaisAction(AuctionModel model) {
RestfulModelAndView mav = new RestfulModelAndView();
List<QueryParam> params = new ArrayList<QueryParam>();
if(StringUtils.isNotBlank(model.getCity())){
params.add(new QueryParam("matchCity", model.getCity()));
}
if(StringUtils.isNotBlank(model.getDistrict())){
params.add(new QueryParam("matchRegion", model.getDistrict()));
}
if(StringUtils.isNotBlank(model.getName())){
params.add(new QueryParam("matchName", model.getName()));
}
List<SortParam> sortParams = new ArrayList<SortParam>();
sortParams.add(new SortParam("startDate", false));
List<PaiMai> paimais = paiMaiService.findAll(params, sortParams, model.getLimit(), SEARCH_FIELDS);
mav.setModel(BasicModel.buildOKModel().setResult(paimais));
return mav;
}
public void setPaiMaiService(PaiMaiService paiMaiService) {
this.paiMaiService = paiMaiService;
}
@@ -15,8 +15,10 @@ import java.util.Map.Entry;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import com.fangjia.dal.common.DistrictKey;
import com.fangjia.dal.mongo.model.Metro;
import com.fangjia.open.model.BasicModel;
import com.fangjia.service.bo.DistrictStatBo;
import org.apache.commons.lang.StringUtils;
import com.fangjia.core.util.DateUtil;
@@ -211,6 +213,42 @@ public class DealPriceController {
mv.setModel(resMap);
return mv;
}
public Object searchListAction(final DealPriceModel model) {
RestfulModelAndView mv = new RestfulModelAndView();
mv.setViewType("rest");
if (StringUtils.isBlank(model.getId())) {
mv.setModel(new HttpCode(OpenHttpCodeEnum.ARGUMENT_LOSE, "楼盘编号不能为空"));
return mv;
}
District district = districtService.findDistrictById(model.getId());
DistrictKey districtKey = new DistrictKey(district.getCity(), district.getRegion(), district.getName());
if(district == null){
mv.setModel(BasicModel.buildBadRequestModel("该小区不存在"));
return mv;
}
DistrictStatBo bo = districtStatService.findCurrentDistrictStat(districtKey);
Integer minPrice = null;
Integer maxPrice = null;
if(bo.getDistrictStat()!=null){
minPrice = (int)(bo.getDistrictStat().getAvgPrice() * 0.8);
maxPrice = (int)(bo.getDistrictStat().getAvgPrice() * 1.2);
}
Date startDate = null;
Date endDate = null;
if(StringUtils.isNotBlank(model.getStartDate())){
startDate = DateUtil.parseDate(model.getStartDate(),"yyyyMMdd");
}
if(StringUtils.isNotBlank(model.getEndDate())){
endDate = DateUtil.parseDate(model.getEndDate(),"yyyyMMdd");
}
List<DealPrice> dealPrices = dealPriceService.getNearlySameDealPrice(model.getId(), minPrice, maxPrice, startDate, endDate, model.getLimit());
mv.setModel(BasicModel.buildOKModel().setResult(dealPrices));
return mv;
}
private List<DealPrice> findDealPricesByName(String city,String region ,String name){
Calendar calendar = Calendar.getInstance();
@@ -10,9 +10,14 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.fangjia.dal.mongo.model.BsEvaluation;
import com.fangjia.dal.mongo.model.bkoff.DealPrice;
import com.fangjia.service.bo.AddrEvaResult;
import com.fangjia.service.bo.DistrictStatBo;
import com.fangjia.service.bo.EvaluationBo;
import com.fangjia.service.bo.HouseScorer;
import com.fangjia.service.datastore.*;
import com.fangjia.service.district.DistrictStatService;
import org.apache.commons.collections.MapUtils;
import org.apache.commons.lang.ArrayUtils;
import org.apache.commons.lang.StringUtils;
@@ -54,11 +59,6 @@ import com.fangjia.open.model.RestfulModelAndView;
import com.fangjia.service.api.AutoCompleteService;
import com.fangjia.service.api.KnowbaseService;
import com.fangjia.service.common.SellSimilar;
import com.fangjia.service.datastore.BusinessEstateService;
import com.fangjia.service.datastore.DistrictService;
import com.fangjia.service.datastore.EvaluationReportService;
import com.fangjia.service.datastore.EvaluationService;
import com.fangjia.service.datastore.HouseService;
import com.fangjia.service.sql.ApiUserService;
import com.fangjia.service.sql.UserService;
import com.fangjia.service.web.AddressService;
@@ -94,6 +94,8 @@ public class EvaluationController {
private ApiUserService apiUserService;
private UserService userService;
private AddressService addressService;
private DistrictStatService districtStatService;
private BsEvaluationService bsEvaluationService;
private final static String AK = OpenConfig.getConfig().getBaiduAk();
public Object lngLatEvaluateAction(EvaluationModel model) {
@@ -1005,6 +1007,44 @@ public class EvaluationController {
return mav;
}
public Object bsListAction(EvaluationModel model) {
RestfulModelAndView mv = new RestfulModelAndView();
mv.setViewType("rest");
if (StringUtils.isBlank(model.getId())) {
mv.setModel(new HttpCode(OpenHttpCodeEnum.ARGUMENT_LOSE, "楼盘编号不能为空"));
return mv;
}
District district = districtService.findDistrictById(model.getId());
DistrictKey districtKey = new DistrictKey(district.getCity(), district.getRegion(), district.getName());
if(district == null){
mv.setModel(BasicModel.buildBadRequestModel("该小区不存在"));
return mv;
}
DistrictStatBo bo = districtStatService.findCurrentDistrictStat(districtKey);
Integer minPrice = null;
Integer maxPrice = null;
if(bo.getDistrictStat()!=null){
minPrice = (int)(bo.getDistrictStat().getAvgPrice() * 0.8);
maxPrice = (int)(bo.getDistrictStat().getAvgPrice() * 1.2);
}
Date startDate = null;
Date endDate = null;
if(StringUtils.isNotBlank(model.getStartDate())){
startDate = DateUtil.parseDate(model.getStartDate(),"yyyyMMdd");
}
if(StringUtils.isNotBlank(model.getEndDate())){
endDate = DateUtil.parseDate(model.getEndDate(),"yyyyMMdd");
}
List<BsEvaluation> dealPrices = bsEvaluationService.getNearlySameEvaluation(model.getId(), minPrice, maxPrice, startDate, endDate, model.getLimit());
mv.setModel(BasicModel.buildOKModel().setResult(dealPrices));
return mv;
}
public void setEvaluationService(EvaluationService evaluationService) {
this.evaluationService = evaluationService;
}
@@ -1017,6 +1057,18 @@ public class EvaluationController {
this.knowbaseService = knowbaseService;
}
public void setDistrictStatService(DistrictStatService districtStatService) {
this.districtStatService = districtStatService;
}
public void setBsEvaluationService(BsEvaluationService bsEvaluationService) {
this.bsEvaluationService = bsEvaluationService;
}
public void setAutoCompleteService(AutoCompleteService autoCompleteService) {
this.autoCompleteService = autoCompleteService;
}
@@ -11,6 +11,8 @@ import com.fangjia.dal.mongo.model.DistrictFacilitys;
import com.fangjia.dal.mongo.model.FangjiaOfficialAreaMap;
import com.fangjia.dal.mongo.model.Metro;
import com.fangjia.dal.mongo.model.StatsIndex;
import com.fangjia.dal.seawater.dao.SeawaterDao;
import com.fangjia.dal.seawater.model.Seawater;
import com.fangjia.dal.seaweed.model.District;
import com.fangjia.dal.sql.model.ApiUser;
import com.fangjia.datastore.driver.FacetResult;
@@ -29,6 +31,7 @@ import com.fangjia.open.ws.query.CollateralSampleQuery;
import com.fangjia.open.ws.query.ShopCollateralSampleQuery;
import com.fangjia.service.address.AddressParser;
import com.fangjia.service.bo.Collateral;
import com.fangjia.service.bo.DistrictStatBo;
import com.fangjia.service.bo.Sample;
import com.fangjia.service.bo.ShopSample;
import com.fangjia.service.datastore.CzbankSampleService;
@@ -39,11 +42,13 @@ import com.fangjia.service.datastore.bean.CollateralSampleQueryBean;
import com.fangjia.service.datastore.bean.ShopCollateralSampleQueryBean;
import com.fangjia.service.district.DistrictFacilitysService;
import com.fangjia.service.district.DistrictStatService;
import com.fangjia.service.district.SqmetreRentService;
import com.fangjia.service.menu.Item;
import com.fangjia.service.menu.MenuCategoryEnum;
import com.fangjia.service.menu.Value;
import com.fangjia.service.mongo.fangjia.DealPriceService;
import com.fangjia.service.mongo.fangjia.MetroService;
import com.fangjia.service.mongo.fangjia.SeawaterService;
import com.fangjia.service.mongo.fangjia.StatsIndexService;
import com.fangjia.service.open.FangjiaOfficialAreaService;
import com.fangjia.service.open.HousePojo;
@@ -86,6 +91,9 @@ public class HouseController {
private CzbankSampleService czbankSampleService;
private DistrictService districtService;
private FangjiaOfficialAreaService fangjiaOfficialAreaService;
private SeawaterService seawaterService;
private SeawaterDao seawaterDao;
private List<String> PROPERTY_TYPE_CODE_LIST = Arrays.asList("01", "02");
@@ -399,6 +407,49 @@ public class HouseController {
}
}
public Object listAction(final HouseSearchModel model) {
RestfulModelAndView mav = new RestfulModelAndView();
mav.setViewType("rest");
if (StringUtils.isBlank(model.getId()) && (StringUtils.isBlank(model.getCity()) || StringUtils.isBlank(model.getRegion()) || StringUtils.isBlank(model.getName()))) {
mav.setModel(BasicModel.buildBadRequestModel("楼盘编号或城市,区域,名称为必填项"));
return mav;
}
District district = null;
DistrictKey districtKey = null;
if(StringUtils.isNotBlank(model.getName())){
districtKey = new DistrictKey(model.getCity(), model.getRegion(), model.getName());
district = districtService.findDistrict(districtKey, "district");
}else{
district = districtService.findDistrictById(model.getId());
districtKey = new DistrictKey(district.getCity(), district.getRegion(), district.getName());
}
if(district == null){
mav.setModel(BasicModel.buildBadRequestModel("该小区不存在"));
return mav;
}
DistrictStatBo bo = districtStatService.findCurrentDistrictStat(districtKey);
Integer minPrice = null;
Integer maxPrice = null;
if(bo.getDistrictStat()!=null){
minPrice = (int)(bo.getDistrictStat().getAvgPrice() * 0.8);
maxPrice = (int)(bo.getDistrictStat().getAvgPrice() * 1.2);
}
List<String> names = new ArrayList<String>();
names.add(district.getName());
if(district.getAlias() != null){
for(String alia : district.getAlias()){
if(StringUtils.isNotBlank(alia) && !names.contains(alia)){
names.add(alia);
}
}
}
List<Seawater> houses = seawaterDao.findSeawatersFromEs("sell", district.getCity(), district.getRegion(), district.getName(), district.getAlias(), null, model.getStartTime(), model.getEndTime(),null,null,minPrice, maxPrice,null,null,"p_date", false,0, model.getPageSize(),"latest_seawater");
//List<Seawater> houses1 = seawaterDao.findHouses(district.getCity(), district.getRegion(), names, minPrice, maxPrice, model.getPageSize());
mav.setModel(BasicModel.buildOKModel().setResult(houses));
return mav;
}
String getPicUrl(String url, List<String> urls) {
if (!urls.contains(url)) {
urls.add(url);
@@ -832,6 +883,13 @@ public class HouseController {
return ret;
}
public void setSeawaterService(SeawaterService seawaterService) {
this.seawaterService = seawaterService;
}
public void setSeawaterDao(SeawaterDao seawaterDao) {
this.seawaterDao = seawaterDao;
}
private boolean checkExists(FacetQueryResult<HousePojo> houseBoList, HousePojo house) {
for (HousePojo bo : houseBoList) {
@@ -665,6 +665,7 @@ public class PropertyController {
return mav;
}
String userId = FangjiaApiUtil.parseUserId(model.getToken());
District district = null;
if (StringUtils.isNotBlank(model.getId())){
if(ObjectId.isValid(model.getId())){
@@ -8,6 +8,7 @@ public class AuctionModel extends FangjiaApiModel{
private String city;
private String district;
private String address;
private String name;
private Date minStartTime;
private Date maxStartTime;
private Integer minStartPrice;
@@ -121,4 +122,12 @@ public class AuctionModel extends FangjiaApiModel{
public void setStatus(Integer status) {
this.status = status;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
@@ -1,6 +1,9 @@
package com.fangjia.open.model;
import java.util.Date;
public class DealPriceModel extends FangjiaApiModel{
private String id;
private String city;
@@ -34,9 +37,13 @@ public class DealPriceModel extends FangjiaApiModel{
private Double size;
private Integer max;
private Integer limit = 10;
private String decoration;
private boolean convert;
private String startDate;
private String endDate;
public String getCity() {
@@ -198,4 +205,36 @@ public class DealPriceModel extends FangjiaApiModel{
public void setConvert(boolean convert) {
this.convert = convert;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getStartDate() {
return startDate;
}
public void setStartDate(String startDate) {
this.startDate = startDate;
}
public String getEndDate() {
return endDate;
}
public void setEndDate(String endDate) {
this.endDate = endDate;
}
public Integer getLimit() {
return limit;
}
public void setLimit(Integer limit) {
this.limit = limit;
}
}
@@ -246,6 +246,42 @@ public class EvaluationModel extends FangjiaApiModel {
private Date buildDate;
private String sid;//微信小程序中的sid
private String code;//微信小程序中的code
private String id;
private String startDate;
private String endDate;
private Integer limit = 10;
public Integer getLimit() {
return limit;
}
public void setLimit(Integer limit) {
this.limit = limit;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getStartDate() {
return startDate;
}
public void setStartDate(String startDate) {
this.startDate = startDate;
}
public String getEndDate() {
return endDate;
}
public void setEndDate(String endDate) {
this.endDate = endDate;
}
public String getRegion() {
return region;
@@ -4,6 +4,7 @@ import com.fangjia.service.datastore.bean.HouseQueryBean;
import com.fangjia.service.query.QueryBean;
public class HouseSearchModel extends SearchModel {
private String id;
private String kind;
private String estateType;
private String buildingType;
@@ -116,7 +117,12 @@ public class HouseSearchModel extends SearchModel {
public void setShowDetail(Boolean showDetail) {
this.showDetail = showDetail;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
}
@@ -16,6 +16,8 @@ public abstract class SearchModel extends FangjiaApiModel {
protected Integer totalPriceEnd;
protected Integer avgPriceStart;
protected Integer avgPriceEnd;
protected Integer startTime;
protected Integer endTime;
protected Integer areaStart;
protected Integer areaEnd;
protected Integer room;
@@ -358,4 +360,20 @@ public abstract class SearchModel extends FangjiaApiModel {
public void setTotalPrice(Integer totalPrice) {
this.totalPrice = totalPrice;
}
public Integer getStartTime() {
return startTime;
}
public void setStartTime(Integer startTime) {
this.startTime = startTime;
}
public Integer getEndTime() {
return endTime;
}
public void setEndTime(Integer endTime) {
this.endTime = endTime;
}
}
@@ -0,0 +1,11 @@
package com.fangjia.service.datastore;
import com.fangjia.dal.mongo.model.BsEvaluation;
import java.util.Date;
import java.util.List;
public interface BsEvaluationService {
List<BsEvaluation> getNearlySameEvaluation(String id, Integer minPrice, Integer maxPrice, Date startDate, Date endDate, Integer limit);
}
@@ -0,0 +1,44 @@
package com.fangjia.service.datastore;
import com.fangjia.dal.QueryParam;
import com.fangjia.dal.SortParam;
import com.fangjia.dal.mongo.dao.BsEvaluationDao;
import com.fangjia.dal.mongo.dao.EvaluationDao;
import com.fangjia.dal.mongo.model.BsEvaluation;
import com.fangjia.dal.mongo.model.bkoff.DealPrice;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class BsEvaluationServiceImpl implements BsEvaluationService {
private BsEvaluationDao bsEvaluationDao;
public void setBsEvaluationDao(BsEvaluationDao bsEvaluationDao) {
this.bsEvaluationDao = bsEvaluationDao;
}
@Override
public List<BsEvaluation> getNearlySameEvaluation(String id, Integer minPrice, Integer maxPrice, Date startDate, Date endDate, Integer limit) {
List<QueryParam> params = new ArrayList<QueryParam>();
params.add(new QueryParam("commid", id));
if(startDate!=null){
params.add(new QueryParam("cDate", QueryParam.GREATER_THAN_EQUAL_OPERATOR, startDate));
}
if(endDate!=null){
params.add(new QueryParam("cDate", QueryParam.LESS_THAN_EQUAL_OPERATOR, startDate));
}
if (minPrice > 0) {
params.add(new QueryParam("unitPrice", QueryParam.GREATER_THAN_OPERATOR, minPrice));
}
if (maxPrice > 0) {
params.add(new QueryParam("unitPrice", QueryParam.LESS_THAN_OPERATOR, maxPrice));
}
List<SortParam> sortParams = new ArrayList<SortParam>();
sortParams.add(new SortParam("cDate", false));
List<BsEvaluation> bsEvaluations = bsEvaluationDao.findAllByParams(params, sortParams, limit);
return bsEvaluations;
}
}
@@ -82,6 +82,8 @@ public interface DealPriceService {
public List<DealPrice> getNearlySameDealPrice(DistrictKey key, int minPrice, int maxPrice, int radius, int limit);
public List<DealPrice> getNearlySameDealPrice(String districtId, Integer minPrice, Integer maxPrice,Date startDate, Date endDate, int limit);
public List<DealPrice> getDisSameDealPrice(DistrictKey key, int minPrice, int maxPrice, int limit);
/**
@@ -354,6 +354,29 @@ public class DealPriceServiceImpl implements DealPriceService {
return houses;
}
@Override
public List<DealPrice> getNearlySameDealPrice(String districtId, Integer minPrice, Integer maxPrice, Date startDate, Date endDate, int limit) {
List<QueryParam> params = new ArrayList<QueryParam>();
params.add(new QueryParam("matchId", districtId));
if(startDate!=null){
params.add(new QueryParam("tradeDate", QueryParam.GREATER_THAN_EQUAL_OPERATOR, startDate));
}
if(endDate!=null){
params.add(new QueryParam("tradeDate", QueryParam.LESS_THAN_EQUAL_OPERATOR, startDate));
}
if (minPrice > 0) {
params.add(new QueryParam("avgPrice", QueryParam.GREATER_THAN_OPERATOR, minPrice));
}
if (maxPrice > 0) {
params.add(new QueryParam("avgPrice", QueryParam.LESS_THAN_OPERATOR, maxPrice));
}
List<SortParam> sortParams = new ArrayList<SortParam>();
sortParams.add(new SortParam("tradeDate", false));
List<DealPrice> dealPrices = dealPriceDao.findAllByParams(params, sortParams, limit);
return dealPrices;
}
@Override
public List<DealPrice> getDisSameDealPrice(DistrictKey key, int minPrice, int maxPrice, int limit) {
List<QueryParam> params = new ArrayList<QueryParam>();