|
@@ -192,38 +192,57 @@ public class PersonalFacePriceServiceImpl extends ServiceImpl<PersonalFacePriceM
|
|
|
facePriceQuery.setAcreageMin(acreage.subtract(diff));
|
|
|
}
|
|
|
|
|
|
- facePriceQuery.setLimit("一年内");
|
|
|
|
|
|
//获取数据源集合
|
|
|
List<DayouPersonalPriceVO> dyPrices = this.personalPriceByLocation(facePriceQuery);
|
|
|
ExternalFacePriceVO externalFacePriceVO = this.externalPriceByLocation(facePriceQuery);
|
|
|
+
|
|
|
+ //提升查询结果率
|
|
|
+ if (CollectionUtil.isEmpty(dyPrices)){
|
|
|
+ facePriceQuery.setAcreageMin(null);
|
|
|
+ facePriceQuery.setAcreageMax(null);
|
|
|
+ dyPrices = this.personalPriceByLocation(facePriceQuery);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (externalFacePriceVO==null){
|
|
|
+ facePriceQuery.setAcreageMin(null);
|
|
|
+ facePriceQuery.setAcreageMax(null);
|
|
|
+ externalFacePriceVO = this.externalPriceByLocation(facePriceQuery);
|
|
|
+ }
|
|
|
+
|
|
|
BigDecimal dealAvgPrice = BigDecimal.ZERO;
|
|
|
BigDecimal dyAvgPrice = BigDecimal.ZERO;
|
|
|
int i = 0;
|
|
|
if (externalFacePriceVO != null){
|
|
|
//链家成交均价
|
|
|
dealAvgPrice = externalFacePriceVO.getDealPrice();
|
|
|
- i += 1;
|
|
|
+ if (dealAvgPrice.compareTo(BigDecimal.ZERO) > 0){
|
|
|
+ i+=1;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
if (CollectionUtil.isNotEmpty(dyPrices)){
|
|
|
//大友评估均价
|
|
|
double reduce = dyPrices.stream().filter(x->x.getPrice()!=null).map(DayouPersonalPriceVO::getPrice).mapToDouble(BigDecimal::doubleValue).reduce(0, Double::sum);
|
|
|
dyAvgPrice = BigDecimal.valueOf(reduce).divide(BigDecimal.valueOf(dyPrices.size()==0?1:dyPrices.size()), 0, RoundingMode.HALF_UP);
|
|
|
- i += 1;
|
|
|
+ if (dyAvgPrice.compareTo(BigDecimal.ZERO) > 0){
|
|
|
+ i+=1;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
+
|
|
|
//综合均价
|
|
|
return i==0?BigDecimal.ZERO:dealAvgPrice.add(dyAvgPrice).divide(new BigDecimal(i), RoundingMode.HALF_UP);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public String uploadPersonalFacePriceTemp(MultipartFile file) {
|
|
|
+ public String uploadPersonalFacePriceTemp(MultipartFile file,String limit) {
|
|
|
try {
|
|
|
List<PersonalFacePriceBatchDTO> batchQuery = ExcelUtil.importExcel(PersonalFacePriceBatchDTO.class,file.getInputStream(),1);
|
|
|
for (PersonalFacePriceBatchDTO batch : batchQuery) {
|
|
|
PersonalFacePriceQueryDTO target = new PersonalFacePriceQueryDTO();
|
|
|
BeanUtil.copyProperties(batch, target);
|
|
|
+ target.setLimit(limit);
|
|
|
batch.setPrice(this.querySysFacePrice(target));
|
|
|
batch.setAmount(batch.getPrice().multiply(batch.getAcreage()==null?BigDecimal.ZERO:batch.getAcreage()).setScale(2, RoundingMode.HALF_UP));
|
|
|
batch.setValueTiming(LocalDate.now());
|