北交所样本查询
This commit is contained in:
+29
-2
@@ -658,8 +658,35 @@ public class CzbankSampleServiceImpl implements CzbankSampleService {
|
|||||||
SampleWrapper minSample = null;
|
SampleWrapper minSample = null;
|
||||||
|
|
||||||
querySamples.addAll(samples);
|
querySamples.addAll(samples);
|
||||||
if (querySamples.size() < max) {
|
if (querySamples.size() < max + 10) {
|
||||||
// 查询成交补充 TODO
|
// 查询成交补充 TODO
|
||||||
|
List<QueryParam> dealPriceQuery = new ArrayList<QueryParam>();
|
||||||
|
dealPriceQuery.add(new QueryParam("city", district.getCity()));
|
||||||
|
dealPriceQuery.add(new QueryParam("region", district.getRegion()));
|
||||||
|
List<String> names = new ArrayList<String>();
|
||||||
|
names.add(district.getName());
|
||||||
|
if (district.getAlias() != null) {
|
||||||
|
for (String alias : district.getAlias()) {
|
||||||
|
if (StringUtils.isNotBlank(alias) && alias.length() >= 4) {
|
||||||
|
names.add(alias);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dealPriceQuery.add(new QueryParam("districtName", QueryParam.IN_OPERATOR, names));
|
||||||
|
dealPriceQuery.add(new QueryParam("tradeDate", QueryParam.GREATER_THAN_OPERATOR, DateUtil.add(new Date(), Calendar.MONTH, -6)));
|
||||||
|
List<SortParam> dealPriceSortParams = new ArrayList<SortParam>();
|
||||||
|
dealPriceSortParams.add(new SortParam("tradeDate", false));
|
||||||
|
List<DealPrice> dealPrices = dealPriceDao.findAllByParams(dealPriceQuery, dealPriceSortParams, 0, 10, DEAL_PRICE_FIELDS);
|
||||||
|
for (DealPrice dealPrice : dealPrices) {
|
||||||
|
SampleWrapper sample = convertDealPrice2Sample(dealPrice);
|
||||||
|
if (isAvailableSample(sample)) {
|
||||||
|
// 过滤价格差异非常大的成交
|
||||||
|
if (districtStat != null && districtStat.getAvg_price_2b() != null && (districtStat.getAvg_price_2b() <= sample.getUnitPrice() * 1.3)
|
||||||
|
&& (districtStat.getAvg_price_2b() >= sample.getUnitPrice() * 0.7)) {
|
||||||
|
querySamples.add(sample);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
for (SampleWrapper sample : querySamples) {
|
for (SampleWrapper sample : querySamples) {
|
||||||
sample.setProperty(queryBean.getProperty());
|
sample.setProperty(queryBean.getProperty());
|
||||||
@@ -1409,7 +1436,7 @@ public class CzbankSampleServiceImpl implements CzbankSampleService {
|
|||||||
}
|
}
|
||||||
// 根据2B与均价的系数进行判断
|
// 根据2B与均价的系数进行判断
|
||||||
for (SampleWrapper sample : samples) {
|
for (SampleWrapper sample : samples) {
|
||||||
if (districtStat.getAvg_price_2b() != null) {
|
if (districtStat != null && districtStat.getAvg_price_2b() != null) {
|
||||||
sample.setUnitPrice((int) (sample.getUnitPrice() * (districtStat.getAvg_price_2b() * 1.00 / districtStat.getAvgPrice())));
|
sample.setUnitPrice((int) (sample.getUnitPrice() * (districtStat.getAvg_price_2b() * 1.00 / districtStat.getAvgPrice())));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user