|
@@ -206,9 +206,8 @@ public class SaasWebServiceImpl implements ISaasWebService {
|
|
|
}
|
|
|
return allProjects.stream().
|
|
|
filter(
|
|
|
- poemsProjectVO -> StringUtils.isNotBlank(poemsProjectVO.getFunctionType()) &&
|
|
|
- buildingTypeCodes.contains(poemsProjectVO.getFunctionType()) &&
|
|
|
- climateZoneCode.equals(poemsProjectVO.getClimateZone())
|
|
|
+ poemsProjectVO -> satisfyBuildingTypeAndClimateZone(
|
|
|
+ buildingTypeCodes, climateZoneCode, poemsProjectVO.getProjectId())
|
|
|
).collect(Collectors.toList());
|
|
|
}
|
|
|
|
|
@@ -237,9 +236,43 @@ public class SaasWebServiceImpl implements ISaasWebService {
|
|
|
}
|
|
|
return projectsByArea.stream().
|
|
|
filter(
|
|
|
- poemsProjectVO -> StringUtils.isNotBlank(poemsProjectVO.getFunctionType()) &&
|
|
|
- buildingTypes.contains(poemsProjectVO.getFunctionType())).
|
|
|
- collect(Collectors.toList());
|
|
|
+ poemsProjectVO -> satisfyBuildingTypeAndClimateZone(
|
|
|
+ buildingTypes, null, poemsProjectVO.getProjectId())
|
|
|
+ ).collect(Collectors.toList());
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 判断项目是否满足业态和气候区筛选条件
|
|
|
+ *
|
|
|
+ * @param allBuildingTypes 所有用来筛选的业态
|
|
|
+ * @param climateZoneCode 用来筛选的气候区
|
|
|
+ * @param projectId 项目id
|
|
|
+ * @return 是否满足条件
|
|
|
+ * @author lixing
|
|
|
+ * @version V1.0 2021/6/15 5:12 下午
|
|
|
+ */
|
|
|
+ private boolean satisfyBuildingTypeAndClimateZone(
|
|
|
+ List<String> allBuildingTypes, String climateZoneCode, String projectId) {
|
|
|
+
|
|
|
+
|
|
|
+ if (StringUtils.isBlank(projectId)) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ SimpleProjectVO simpleProjectInfo = getSimpleProjectInfo(projectId);
|
|
|
+ boolean result = true;
|
|
|
+ // 如果要过滤的建筑类型不为空,根据建筑类型过滤
|
|
|
+ if (!CollectionUtils.isEmpty(allBuildingTypes)) {
|
|
|
+ result = result && StringUtils.isNotBlank(simpleProjectInfo.getFunctionType()) &&
|
|
|
+ allBuildingTypes.contains(simpleProjectInfo.getFunctionType());
|
|
|
+ }
|
|
|
+
|
|
|
+ // 如果要过滤的气候区不为空,根据气候区过滤
|
|
|
+ if (StringUtils.isNotBlank(climateZoneCode)) {
|
|
|
+ result = result && climateZoneCode.equals(simpleProjectInfo.getClimateZone());
|
|
|
+ }
|
|
|
+
|
|
|
+ return result;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -258,8 +291,8 @@ public class SaasWebServiceImpl implements ISaasWebService {
|
|
|
if (userProjectsInfoVO != null) {
|
|
|
List<PoemsProjectVO> projects = userProjectsInfoVO.getProjects();
|
|
|
projects = projects.stream().filter(
|
|
|
- poemsProjectVO -> StringUtils.isNotBlank(poemsProjectVO.getFunctionType()) &&
|
|
|
- buildingTypes.contains(poemsProjectVO.getFunctionType())
|
|
|
+ poemsProjectVO -> satisfyBuildingTypeAndClimateZone(
|
|
|
+ buildingTypes, null, poemsProjectVO.getProjectId())
|
|
|
).collect(Collectors.toList());
|
|
|
List<SimpleProjectVO> simpleProjectVOList = ConvertSaasWebTool.INSTANCE.convert2SimpleProjectVOList(projects);
|
|
|
result.addAll(simpleProjectVOList);
|
|
@@ -666,7 +699,7 @@ public class SaasWebServiceImpl implements ISaasWebService {
|
|
|
/**
|
|
|
* 如果开业时间早于报告月份上一年一月一日,项目为可同比项目
|
|
|
*
|
|
|
- * @param reportMonth 报告月份
|
|
|
+ * @param reportMonth 报告月份
|
|
|
* @param businessOpeningTime 开业时间
|
|
|
* @return 是否是可同比项目
|
|
|
* @author lixing
|