diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/CoverageServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/CoverageServiceImpl.java index 3e4e824fda..0bb8752a16 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/CoverageServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/CoverageServiceImpl.java @@ -43,10 +43,7 @@ import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.concurrent.atomic.AtomicReference; import java.util.stream.Collectors; @@ -323,7 +320,7 @@ public class CoverageServiceImpl implements CoverageService { } else if (PLACE_TYPE_SUPERIOR_RESOURCE.equals(placeType)) { // 优势资源 return orgCoverageService.countSuporiorResourceEntities(customerId, staffOrgIds, search, categoryKey); - } else if(CoveragePlaceTypeEnum.ENTERPRISE_PATROL_UNQUALIFIED.equals(placeType)){ + } else if(CoveragePlaceTypeEnum.ENTERPRISE_PATROL_UNQUALIFIED.getCode().equals(placeType)){ // 企事业单位巡查 // 最新巡查结果【0:合格 1:不合格】 return orgCoverageService.countEnterprisePatrol(customerId, agencyId, staffOrgIds, search, categoryKey,NumConstant.ONE_STR ); @@ -477,13 +474,16 @@ public class CoverageServiceImpl implements CoverageService { .map(dc -> new CoverageAnalisisDataListResultDTO(dc.getId(), categoryKey, isPage ? categoryDict.getCategoryName() : null, placeType, isPage ? dc.getName() : null, dc.getLatitude(), dc.getLongitude())) .collect(Collectors.toList()); - } else if(CoveragePlaceTypeEnum.ENTERPRISE_PATROL_UNQUALIFIED.equals(placeType)){ + } else if(CoveragePlaceTypeEnum.ENTERPRISE_PATROL_UNQUALIFIED.getCode().equals(placeType)){ + //最新巡查结果【0:合格 1:不合格】 List list = orgCoverageService.listEnterprisePatrol( customerId, agencyId, staffOrgIds, search, categoryKey, isPage, pageNo, pageSize,NumConstant.ONE_STR); return list.stream() .map(dc -> new CoverageAnalisisDataListResultDTO(dc.getEnterpriseId(), categoryKey, - isPage ? categoryDict.getCategoryName() : null, placeType, isPage ? dc.getPlaceOrgName() : null, dc.getLatitude(), dc.getLongitude())) + isPage ? categoryDict.getCategoryName() : null, placeType, dc.getPlaceOrgName() , + StringUtils.isNotBlank(dc.getLatitude()) ? dc.getLatitude() : rootAgency.getLatitude(), + StringUtils.isNotBlank(dc.getLongitude()) ? dc.getLongitude() : rootAgency.getLongitude())) .collect(Collectors.toList()); } return new ArrayList<>(); @@ -657,7 +657,8 @@ public class CoverageServiceImpl implements CoverageService { ); List list = new ArrayList<>(); if (CollectionUtils.isNotEmpty(page.getList())) { - Map> group = page.getList().stream().collect(Collectors.groupingBy(CoverageAnalisisDataListResultDTO::getLongLat)); + Map> group = page.getList().stream().collect(Collectors.groupingBy(x->Optional.ofNullable(x.getLongLat()).orElse("O"))); + if (MapUtils.isNotEmpty(group)) { for (Map.Entry> entry : group.entrySet()) { if (CollectionUtils.isEmpty(entry.getValue())) { diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/IcEnterprisePatrolRecordDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/IcEnterprisePatrolRecordDao.xml index 313eedb9c3..c682c31548 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/IcEnterprisePatrolRecordDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/IcEnterprisePatrolRecordDao.xml @@ -10,7 +10,9 @@ where e.CUSTOMER_ID = #{customerId} and e.PLACE_ORG_NAME like CONCAT('%',#{search},'%') and (e.AGENCY_ID = #{agencyId} or e.AGENCY_PIDS like CONCAT(#{staffOrgIds}, '%')) - and e.PLACE_TYPE = #{categoryKey} + + and e.PLACE_TYPE = #{categoryKey} + and e.DEL_FLAG = '0' and e.LATEST_RESULT = #{latestResult} @@ -35,7 +37,9 @@ where e.CUSTOMER_ID = #{customerId} and e.PLACE_ORG_NAME like CONCAT('%',#{search},'%') and (e.AGENCY_ID = #{agencyId} or e.AGENCY_PIDS like CONCAT(#{staffOrgIds}, '%')) - and e.PLACE_TYPE = #{categoryKey} + + and e.PLACE_TYPE = #{categoryKey} + and e.DEL_FLAG = '0' and e.LATEST_RESULT = #{latestResult}