Merge branch 'master' of http://gitlab.fangjia.com/dev0/main
This commit is contained in:
+11
@@ -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);
|
||||
}
|
||||
+44
@@ -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;
|
||||
}
|
||||
}
|
||||
+2
@@ -94,4 +94,6 @@ public interface HouseLoudongService {
|
||||
public List<HouseLoudong> findAll(List<QueryParam> queryParams, Pager pager);
|
||||
|
||||
List<String> findAllSources();
|
||||
|
||||
public List<HouseLoudong> findAll(String id, String houseNum, String unitNum, String roomNum);
|
||||
}
|
||||
|
||||
+16
@@ -297,6 +297,22 @@ public class HouseLoudongServiceImpl implements HouseLoudongService {
|
||||
return froms;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HouseLoudong> findAll(String id, String houseNum, String unitNum, String roomNum) {
|
||||
List<QueryParam> params = new ArrayList<QueryParam>();
|
||||
params.add(new QueryParam("districtId", id));
|
||||
if (StringUtils.isNotBlank(houseNum)) {
|
||||
params.add(new QueryParam("houseNum", houseNum));
|
||||
}
|
||||
if (StringUtils.isNotBlank(unitNum)) {
|
||||
params.add(new QueryParam("houseNumUnit", unitNum));
|
||||
}
|
||||
if (StringUtils.isNotBlank(roomNum)) {
|
||||
params.add(new QueryParam("roomNum", roomNum));
|
||||
}
|
||||
return houseLoudongBkoffDao.findAllByParams(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HouseLoudong> queryHouseLoudongList(String city, String districtName, String roomNum, Pager pager) {
|
||||
List<QueryParam> params = new ArrayList<QueryParam>();
|
||||
|
||||
+4
@@ -23,6 +23,8 @@ public interface LoudongService {
|
||||
|
||||
List<Loudong> findAll(String city, String region, String name, String houseNumber, String unitNumber, int limit);
|
||||
|
||||
List<Loudong> findAll(String id, String houseNumber, String unitNumber);
|
||||
|
||||
Map<String, XSSFWorkbook> findAll(List<QueryParam> query, String city);
|
||||
|
||||
Loudong findById(String id);
|
||||
@@ -41,4 +43,6 @@ public interface LoudongService {
|
||||
void save(Map<String, Object> data);
|
||||
|
||||
List<String> findAllSources();
|
||||
|
||||
Loudong findForEvaluate(String idInSeaweed, String houseNumber, String unitNumber);
|
||||
}
|
||||
|
||||
+36
@@ -148,6 +148,23 @@ public class LoudongServiceImpl implements LoudongService {
|
||||
return loudongDao.findAllByParams(params,null, 0 , limit, ADDRESS_VERIFY_FIELDS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Loudong> findAll(String id, String houseNumber, String unitNumber) {
|
||||
List<QueryParam> params = new ArrayList<QueryParam>();
|
||||
if(StringUtils.isNotBlank(id)) {
|
||||
params.add(new QueryParam("idInSeaweed", id));
|
||||
}
|
||||
|
||||
if(StringUtils.isNotBlank(houseNumber)) {
|
||||
params.add(new QueryParam("houseNumber", houseNumber));
|
||||
}
|
||||
if(StringUtils.isNotBlank(unitNumber)) {
|
||||
params.add(new QueryParam("unitNumber", unitNumber));
|
||||
}
|
||||
|
||||
return loudongDao.findAllByParams(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Loudong findById(String id) {
|
||||
return loudongDao.findById(id);
|
||||
@@ -318,4 +335,23 @@ public class LoudongServiceImpl implements LoudongService {
|
||||
}
|
||||
return froms;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Loudong findForEvaluate(String idInSeaweed, String houseNumber, String unitNumber){
|
||||
if(StringUtils.isBlank(idInSeaweed) || StringUtils.isBlank(houseNumber)){
|
||||
return null;
|
||||
}
|
||||
List<QueryParam> params = Lists.newArrayList();
|
||||
params.add(new QueryParam("idInSeaweed", idInSeaweed));
|
||||
params.add(new QueryParam("houseNumber", houseNumber));
|
||||
if(StringUtils.isNotBlank(unitNumber)) {
|
||||
params.add(new QueryParam("unitNumber", unitNumber));
|
||||
}
|
||||
params.add(new QueryParam("floors", QueryParam.GREATER_THAN_OPERATOR, 0));
|
||||
params.add(new QueryParam("floors", QueryParam.LESS_THAN_OPERATOR, 60));
|
||||
params.add(new QueryParam("status", QueryParam.NOT_EQUAL_OPERATOR, 0));
|
||||
|
||||
List<SortParam> sortParams = ImmutableList.of(new SortParam("floors", false));
|
||||
return loudongDao.findFirstByParams(params, sortParams);
|
||||
}
|
||||
}
|
||||
|
||||
+2
@@ -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);
|
||||
|
||||
/**
|
||||
|
||||
+23
@@ -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>();
|
||||
|
||||
Reference in New Issue
Block a user