Commit 7c6a70c9 authored by lixuan's avatar lixuan

feat: 房源

parent b0c5f882
Pipeline #145040 failed with stages
in 29 minutes and 16 seconds
......@@ -170,8 +170,8 @@ public class HouseResourceServiceImpl implements HouseResourceService {
query.setWgCodes(gridRegionUsers.stream().map(GridRegionUser::getWgId).collect(Collectors.toList()));
}
IPage<HouseResourcePage> page = houseResourceMapper.selectPage(new Page<>(query.getPageNum(), query.getPageSize()), query);
List<HouseResourcePage> records = handleHouseList(page.getRecords());
page.setRecords(records.stream().sorted(Comparator.comparing(HouseResourcePage::getIncome, Comparator.nullsFirst(BigDecimal::compareTo))).collect(Collectors.toList()));
List<HouseResourcePage> records = handleHouseList(page.getRecords(), false);
page.setRecords(records);
return page;
}
......@@ -179,7 +179,7 @@ public class HouseResourceServiceImpl implements HouseResourceService {
public List<HouseResourceProfileGraph> profileGraphHouseResources(HouseResourcePageQuery query) {
List<HouseResourcePage> list = houseResourceMapper.selectProfileGraph(query);
list.forEach(x -> x.setIncome(businessEntityInfoMapper.selectYearSellByHouseResourceId(x.getId())));
List<HouseResourcePage> houseResourcePages = handleHouseList(list);
List<HouseResourcePage> houseResourcePages = handleHouseList(list, true);
if (StringUtils.hasText(query.getName())) {
houseResourcePages = houseResourcePages.stream().filter(x -> !CollectionUtils.isEmpty(x.getBusinessEntityInfoNames())).filter(x -> x.getBusinessEntityInfoNames().contains(query.getName())).collect(Collectors.toList());
}
......@@ -272,7 +272,7 @@ public class HouseResourceServiceImpl implements HouseResourceService {
pageList = pageList.stream().filter(x -> StringUtils.hasText(x.getHouseNumber())).filter(x -> x.getHouseNumber().contains(query.getFourOrHouseNumber()) || x.getFour().contains(query.getFourOrHouseNumber())).collect(Collectors.toList());
}
if (!CollectionUtils.isEmpty(pageList)) {
houseResourceProfileGraph.setHouseResources(handleHouseList(pageList));
houseResourceProfileGraph.setHouseResources(handleHouseList(pageList, true));
result.add(houseResourceProfileGraph);
}
}
......@@ -288,7 +288,7 @@ public class HouseResourceServiceImpl implements HouseResourceService {
if (CollectionUtils.isEmpty(list)) {
return Collections.emptyList();
} else {
return handleHouseList(list);
return handleHouseList(list, true);
}
}
......@@ -299,7 +299,7 @@ public class HouseResourceServiceImpl implements HouseResourceService {
if (CollectionUtils.isEmpty(listPages)) {
return new BusinessEntityStatisticsDetail();
}
List<HouseResourcePage> list = handleHouseList(listPages);
List<HouseResourcePage> list = handleHouseList(listPages, true);
BusinessEntityStatisticsDetail businessEntityStatisticsDetail = new BusinessEntityStatisticsDetail();
if (StringUtils.hasText(query.getTwo())) {
list = list.stream().filter(x -> x.getTwo().equals(query.getTwo())).collect(Collectors.toList());
......@@ -454,7 +454,7 @@ public class HouseResourceServiceImpl implements HouseResourceService {
}
}
private List<HouseResourcePage> handleHouseList(List<HouseResourcePage> list) {
private List<HouseResourcePage> handleHouseList(List<HouseResourcePage> list, boolean houseNumberSortFlag) {
list.forEach(x -> {
GridRegionExample twoExample = new GridRegionExample();
twoExample.createCriteria().andWgTypeEqualTo(String.valueOf(x.getType())).andWgCodeEqualTo(x.getTwo());
......@@ -479,7 +479,11 @@ public class HouseResourceServiceImpl implements HouseResourceService {
x.setBusinessEntityInfoNames(businessEntityInfos.stream().map(BusinessEntityInfo::getName).collect(Collectors.toList()));
}
});
return list.stream().sorted(Comparator.comparing(HouseResourcePage::getHouseNumber, Comparator.nullsLast(String::compareTo))).collect(Collectors.toList());
if (houseNumberSortFlag) {
return list.stream().sorted(Comparator.comparing(HouseResourcePage::getHouseNumber, Comparator.nullsLast(String::compareTo))).collect(Collectors.toList());
} else {
return list;
}
}
private BigDecimal getIndustrySellCount(List<BusinessEntityInfo> infos, String industry, BusinessEntitySellMapper sellMapper) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment