|
|
@ -9,10 +9,9 @@ import com.epmet.commons.tools.utils.EpmetRequestHolder; |
|
|
|
import com.epmet.dataaggre.dto.epmetuser.result.IcResiInfoResultDTO; |
|
|
|
import com.epmet.dataaggre.dto.govorg.result.CoverageAnalisisDataListResultDTO; |
|
|
|
import com.epmet.dataaggre.entity.epmetuser.IcResiUserEntity; |
|
|
|
import com.epmet.dataaggre.entity.govorg.IcCityManagementEntity; |
|
|
|
import com.epmet.dataaggre.entity.govorg.IcDangerousChemicalsEntity; |
|
|
|
import com.epmet.dataaggre.entity.govorg.IcHouseEntity; |
|
|
|
import com.epmet.dataaggre.entity.govorg.*; |
|
|
|
import com.epmet.dataaggre.entity.heart.IcCommunitySelfOrganizationEntity; |
|
|
|
import com.epmet.dataaggre.entity.heart.IcPartyUnitEntity; |
|
|
|
import com.epmet.dataaggre.service.CoverageService; |
|
|
|
import com.epmet.dataaggre.service.epmetuser.IcResiService; |
|
|
|
import com.epmet.dataaggre.service.epmetuser.impl.IcResiServiceImpl; |
|
|
@ -59,6 +58,7 @@ public class CoverageServiceImpl implements CoverageService { |
|
|
|
public static final String PLACE_TYPE_GROUP_RENT= "group_rent"; |
|
|
|
public static final String PLACE_TYPE_PUBLIC_SERVICE= "public_service"; |
|
|
|
public static final String PLACE_TYPE_SUPERIOR_RESOURCE= "superior_resource"; |
|
|
|
public static final String PLACE_TYPE_PARTY_UNIT= "party_unit"; |
|
|
|
|
|
|
|
/** |
|
|
|
* 图层,大屏数据分析,数据列表 |
|
|
@ -80,10 +80,10 @@ public class CoverageServiceImpl implements CoverageService { |
|
|
|
Map<String, List<GovOrgCoverageService.CategoryCoverageMapping>> mapping; |
|
|
|
if (CollectionUtils.isNotEmpty(categoryKeys)) { |
|
|
|
// 有分类keys,使用分类keys查询,使用coverageTypes分组
|
|
|
|
mapping = orgCoverageService.getMappingRelationByCategoryKey(categoryKeys); |
|
|
|
mapping = orgCoverageService.getMappingRelationByCategoryKey(categoryKeys, customerId); |
|
|
|
} else { |
|
|
|
// 没有分类keys,使用coverageTypes直接查询
|
|
|
|
mapping = orgCoverageService.getMappingRelationByCoverageType(coverageTypes); |
|
|
|
mapping = orgCoverageService.getMappingRelationByCoverageType(coverageTypes, customerId); |
|
|
|
} |
|
|
|
|
|
|
|
// 2.循环coverageTypes,使用key到map中查询(为了顺序),得到categoryKeys列表之后,根据实际情况做相应的查询
|
|
|
@ -172,20 +172,29 @@ public class CoverageServiceImpl implements CoverageService { |
|
|
|
|
|
|
|
} else if (PLACE_TYPE_CITY_MANAGEMENT.equals(placeType)) { |
|
|
|
// 城市资源管理
|
|
|
|
List<IcCityManagementEntity> cityResources = orgCoverageService.searchCityResourceEntities(customerId, staffOrgIds, search, isPage, pageNo, pageSize); |
|
|
|
List<IcCityManagementEntity> cityResources = orgCoverageService.searchCityResourceEntities(customerId, staffOrgIds, search, categoryKey, isPage, pageNo, pageSize); |
|
|
|
cityResources.stream() |
|
|
|
.map(resource -> new CoverageAnalisisDataListResultDTO(resource.getId(), categoryKey, placeType, resource.getName(), resource.getLatitude(), resource.getLongitude())) |
|
|
|
.collect(Collectors.toList()); |
|
|
|
|
|
|
|
} else if (PLACE_TYPE_COMUNITY_ORG.equals(placeType)) { |
|
|
|
// 社区自组织
|
|
|
|
List<IcCommunitySelfOrganizationEntity> l = heartService.searchCommunityOrgEntities(customerId, agencyId, staffOrgIds, search, isPage, pageNo, pageSize); |
|
|
|
List<IcCommunitySelfOrganizationEntity> l = heartService.searchCommunityOrgEntities(customerId, agencyId, staffOrgIds, search, categoryKey, isPage, pageNo, pageSize); |
|
|
|
return l.stream() |
|
|
|
.map(org -> new CoverageAnalisisDataListResultDTO(org.getId(), categoryKey, placeType, org.getOrganizationName(), org.getLatitude(), org.getLongitude())) |
|
|
|
.collect(Collectors.toList()); |
|
|
|
} else if (PLACE_TYPE_PARTY_UNIT.equals(placeType)) { |
|
|
|
// 机关直属部门(联建单位) 楼宇党建 0;两新组织 1;区域单位党建 2;机关直属部门 3;社会团体 4;民办非企业单位 5;基金会 6;其他 7
|
|
|
|
if (categoryKey.equals("pu_jgzsbm")) { |
|
|
|
String partyUnitType = "3"; |
|
|
|
List<IcPartyUnitEntity> l = heartService.searchPartyUnitEntities(customerId, agencyId, staffOrgIds, partyUnitType, search, isPage, pageNo, pageSize); |
|
|
|
return l.stream().map(dc -> new CoverageAnalisisDataListResultDTO(dc.getId(), categoryKey, placeType, dc.getUnitName(), dc.getLatitude(), dc.getLongitude())) |
|
|
|
.collect(Collectors.toList()); |
|
|
|
} |
|
|
|
return new ArrayList<>(); |
|
|
|
} else if (PLACE_TYPE_DANGEROUS_CHEMICALS.equals(placeType)) { |
|
|
|
// 危化企业
|
|
|
|
List<IcDangerousChemicalsEntity> l = orgCoverageService.searchDangerousChemicalEntities(customerId, staffOrgIds, search, isPage, pageNo, pageSize); |
|
|
|
List<IcDangerousChemicalsEntity> l = orgCoverageService.searchDangerousChemicalEntities(customerId, staffOrgIds, search, categoryKey, isPage, pageNo, pageSize); |
|
|
|
return l.stream().map(dc -> new CoverageAnalisisDataListResultDTO(dc.getId(), categoryKey, placeType, dc.getName(), dc.getLatitude(), dc.getLongitude())) |
|
|
|
.collect(Collectors.toList()); |
|
|
|
} else if (PLACE_TYPE_ENTERPRISE_PARTROL.equals(placeType)) { |
|
|
@ -193,18 +202,28 @@ public class CoverageServiceImpl implements CoverageService { |
|
|
|
|
|
|
|
|
|
|
|
} else if (PLACE_TYPE_GROUP_RENT.equals(placeType)) { |
|
|
|
// 群租房。出租的房屋,住的人口超过5人属于群租房(是个规定)
|
|
|
|
List<IcHouseEntity> icHouseEntities = orgCoverageService.searchGroupRentHouseEntities(customerId, staffOrgIds, search, isPage, pageNo, pageSize); |
|
|
|
//icHouseEntities
|
|
|
|
// 群租房。出租的房屋,住的人口超过5人属于群租房(是个规定) todo
|
|
|
|
//select h.id, b.LATITUDE, b.LONGITUDE, concat(nei.NEIGHBOR_HOOD_NAME, b.BUILDING_NAME, u.UNIT_NAME)
|
|
|
|
//from ic_house h
|
|
|
|
//inner join ic_neighbor_hood nei on (h.NEIGHBOR_HOOD_ID = nei.ID and nei.DEL_FLAG='0')
|
|
|
|
//inner join ic_building b on (h.BUILDING_ID = b.ID and b.DEL_FLAG='0')
|
|
|
|
//inner join ic_building_unit u on (h.BUILDING_UNIT_ID = u.ID and u.DEL_FLAG='0')
|
|
|
|
//List<IcHouseEntity> houses = orgCoverageService.searchGroupRentHouseEntities(customerId, staffOrgIds, search, isPage, pageNo, pageSize);
|
|
|
|
//return houses.stream().map(h -> {
|
|
|
|
// new CoverageAnalisisDataListResultDTO(h.getId(), categoryKey, placeType, h.getName(), h.getLatitude(), h.getLongitude());
|
|
|
|
//})
|
|
|
|
// .collect(Collectors.toList());
|
|
|
|
|
|
|
|
} else if (PLACE_TYPE_PUBLIC_SERVICE.equals(placeType)) { |
|
|
|
// 公共服务
|
|
|
|
|
|
|
|
|
|
|
|
List<IcPublicServiceEntity> l = orgCoverageService.searchPublicServiceEntities(customerId, staffOrgIds, search, categoryKey, isPage, pageNo, pageSize); |
|
|
|
return l.stream().map(dc -> new CoverageAnalisisDataListResultDTO(dc.getId(), categoryKey, placeType, dc.getName(), dc.getLatitude(), dc.getLongitude())) |
|
|
|
.collect(Collectors.toList()); |
|
|
|
} else if (PLACE_TYPE_SUPERIOR_RESOURCE.equals(placeType)) { |
|
|
|
// 优势资源
|
|
|
|
|
|
|
|
|
|
|
|
List<IcSuperiorResourceEntity> l = orgCoverageService.searchSuporiorResourceEntities(customerId, staffOrgIds, search, categoryKey, isPage, pageNo, pageSize); |
|
|
|
return l.stream().map(dc -> new CoverageAnalisisDataListResultDTO(dc.getId(), categoryKey, placeType, dc.getName(), dc.getLatitude(), dc.getLongitude())) |
|
|
|
.collect(Collectors.toList()); |
|
|
|
} |
|
|
|
return new ArrayList<>(); |
|
|
|
} |
|
|
|