|
|
@ -15,6 +15,8 @@ import com.epmet.commons.tools.redis.common.bean.BuildingInfoCache; |
|
|
|
import com.epmet.commons.tools.utils.EpmetRequestHolder; |
|
|
|
import com.epmet.dataaggre.constant.OrgConstant; |
|
|
|
import com.epmet.dataaggre.dto.coverage.AnalysisGovernedTargetsResult; |
|
|
|
import com.epmet.dataaggre.constant.OrgConstant; |
|
|
|
import com.epmet.dataaggre.constant.TableConstant; |
|
|
|
import com.epmet.dataaggre.dto.coverage.AnalysisResourceCategoriesResult; |
|
|
|
import com.epmet.dataaggre.dto.epmetuser.result.IcResiInfoResultDTO; |
|
|
|
import com.epmet.dataaggre.dto.govorg.form.CoverageAnalisisDataListLeftFormDTO; |
|
|
@ -23,11 +25,14 @@ import com.epmet.dataaggre.dto.govorg.result.CoverageAnalisisDataListResultDTO; |
|
|
|
import com.epmet.dataaggre.dto.govorg.result.CoverageAnalisisDataListResultDTOV2; |
|
|
|
import com.epmet.dataaggre.dto.govorg.result.CoverageHomeSearchResultDTO; |
|
|
|
import com.epmet.dataaggre.dto.govorg.result.IcEnterisePatrolResultDTO; |
|
|
|
import com.epmet.dataaggre.dto.govorg.result.*; |
|
|
|
import com.epmet.dataaggre.entity.epmetuser.IcResiUserEntity; |
|
|
|
import com.epmet.dataaggre.entity.govorg.*; |
|
|
|
import com.epmet.dataaggre.entity.govproject.IcEventEntity; |
|
|
|
import com.epmet.dataaggre.entity.heart.IcCommunitySelfOrganizationEntity; |
|
|
|
import com.epmet.dataaggre.entity.heart.IcPartyUnitEntity; |
|
|
|
import com.epmet.dataaggre.enums.MenusEnums; |
|
|
|
import com.epmet.dataaggre.redis.GovCustomerMenuRedis; |
|
|
|
import com.epmet.dataaggre.entity.opercustomize.IcResiCategoryWarnConfigEntity; |
|
|
|
import com.epmet.dataaggre.service.CoverageService; |
|
|
|
import com.epmet.dataaggre.service.epmetuser.IcResiService; |
|
|
@ -35,6 +40,9 @@ import com.epmet.dataaggre.service.govorg.GovOrgCoverageService; |
|
|
|
import com.epmet.dataaggre.service.govorg.GovOrgService; |
|
|
|
import com.epmet.dataaggre.service.govproject.GovProjectService; |
|
|
|
import com.epmet.dataaggre.service.heart.HeartService; |
|
|
|
import com.epmet.dto.GovMenuDTO; |
|
|
|
import com.github.pagehelper.PageHelper; |
|
|
|
import com.github.pagehelper.PageInfo; |
|
|
|
import com.epmet.dataaggre.service.opercustomize.IcResiCategoryWarnService; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.apache.commons.collections4.CollectionUtils; |
|
|
@ -69,6 +77,9 @@ public class CoverageServiceImpl implements CoverageService { |
|
|
|
@Autowired |
|
|
|
private GovOrgCoverageService govOrgCoverageService; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private GovCustomerMenuRedis govCustomerMenuRedis; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private IcResiCategoryWarnService icResiCategoryWarnService; |
|
|
|
|
|
|
@ -217,7 +228,146 @@ public class CoverageServiceImpl implements CoverageService { |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public CoverageHomeSearchResultDTO coverageHomeSearch(CoverageHomeSearchFormDTO formDTO) { |
|
|
|
return null; |
|
|
|
String customerId = formDTO.getCustomerId(); |
|
|
|
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(customerId, formDTO.getUserId()); |
|
|
|
if (null == staffInfo){ |
|
|
|
throw new EpmetException("查询工作人员失败:"+formDTO.getUserId()); |
|
|
|
} |
|
|
|
formDTO.setOrgId(staffInfo.getAgencyId()); |
|
|
|
CoverageHomeSearchResultDTO result = new CoverageHomeSearchResultDTO(); |
|
|
|
// 缓存的客户菜单
|
|
|
|
List<GovMenuDTO> customerMenuList = govCustomerMenuRedis.getCustomerMenuList(customerId, 0, "gov_menu"); |
|
|
|
// org库配置的
|
|
|
|
List<String> resources = govOrgCoverageService.getAllTypeCoverageByCustomerAndType(customerId, "resources"); |
|
|
|
if (CollectionUtils.isEmpty(resources)){ |
|
|
|
return result; |
|
|
|
} |
|
|
|
if (CollectionUtils.isEmpty(customerMenuList)){ |
|
|
|
return result; |
|
|
|
} |
|
|
|
List<String> tables = new ArrayList<>(); |
|
|
|
customerMenuList.forEach(cm -> { |
|
|
|
resources.forEach(r -> { |
|
|
|
if (cm.getUrl().equals(r)){ |
|
|
|
String tableName = MenusEnums.getValueByUrl(r); |
|
|
|
if (StringUtils.isNotBlank(tableName)){ |
|
|
|
tables.add(tableName); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
if (CollectionUtils.isEmpty(tables)){ |
|
|
|
return result; |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(formDTO.getSearchType())){ |
|
|
|
if (formDTO.getSearchType().equals(OrgConstant.SEARCH_TYPE_USER)){ |
|
|
|
PageInfo<UserInfoResultDTO> allIcUserPageInfo = getIcUserPageInfo(formDTO); |
|
|
|
result.setUserInfos(allIcUserPageInfo.getList()); |
|
|
|
result.setUserInfosTotal(allIcUserPageInfo.getTotal()); |
|
|
|
}else if (formDTO.getSearchType().equals(OrgConstant.SEARCH_TYPE_EVENT)){ |
|
|
|
for (String resource : resources) { |
|
|
|
if (MenusEnums.IC_EVENT.getUrl().equals(resource)){ |
|
|
|
PageInfo<EventInfoResultDTO> eventPageInfo = getEventInfo(formDTO); |
|
|
|
result.setEventInfos(eventPageInfo.getList()); |
|
|
|
result.setEventInfoTotal(eventPageInfo.getTotal()); |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
}else if (formDTO.getSearchType().equals(OrgConstant.SEARCH_TYPE_RESOURCE)){ |
|
|
|
|
|
|
|
} |
|
|
|
}else { |
|
|
|
// 查询居民
|
|
|
|
PageInfo<UserInfoResultDTO> allIcUserPageInfo = getIcUserPageInfo(formDTO); |
|
|
|
result.setUserInfos(allIcUserPageInfo.getList()); |
|
|
|
result.setUserInfosTotal(allIcUserPageInfo.getTotal()); |
|
|
|
List<ResourceInfoResultDTO> reInfos = new ArrayList<>(); |
|
|
|
for (String table : tables) { |
|
|
|
switch (table){ |
|
|
|
case TableConstant.IC_SUPERIOR_RESOURCE: |
|
|
|
PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(),formDTO.getIsPage()).doSelectPageInfo(() -> govOrgService.getSuperiorResourceInfos(formDTO)); |
|
|
|
List<ResourceInfoResultDTO> superiorResourceInfos = govOrgService.getSuperiorResourceInfos(formDTO); |
|
|
|
if (!superiorResourceInfos.isEmpty()){ |
|
|
|
reInfos.addAll(superiorResourceInfos); |
|
|
|
} |
|
|
|
break; |
|
|
|
case TableConstant.IC_CITY_MANAGEMENT: |
|
|
|
PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(),formDTO.getIsPage()).doSelectPageInfo(() -> govOrgService.getCityManageInfos(formDTO)); |
|
|
|
List<ResourceInfoResultDTO> cityManageInfos = govOrgService.getCityManageInfos(formDTO); |
|
|
|
if (!cityManageInfos.isEmpty()){ |
|
|
|
reInfos.addAll(cityManageInfos); |
|
|
|
} |
|
|
|
break; |
|
|
|
case TableConstant.IC_COMMUNITY_SELF_ORGANIZATION: |
|
|
|
PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(),formDTO.getIsPage()).doSelectPageInfo(() -> heartService.getCommunitySelOrgInfos(formDTO)); |
|
|
|
List<ResourceInfoResultDTO> communitySelOrgInfos = heartService.getCommunitySelOrgInfos(formDTO); |
|
|
|
if (!communitySelOrgInfos.isEmpty()){ |
|
|
|
reInfos.addAll(communitySelOrgInfos); |
|
|
|
} |
|
|
|
break; |
|
|
|
case TableConstant.IC_DANGEROUS_CHEMICALS: |
|
|
|
PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(),formDTO.getIsPage()).doSelectPageInfo(() -> govOrgService.getDangerousChemicalsInfos(formDTO)); |
|
|
|
List<ResourceInfoResultDTO> dangerousChemicalsInfos = govOrgService.getDangerousChemicalsInfos(formDTO); |
|
|
|
if (!dangerousChemicalsInfos.isEmpty()){ |
|
|
|
reInfos.addAll(dangerousChemicalsInfos); |
|
|
|
} |
|
|
|
break; |
|
|
|
case TableConstant.IC_ENTERPRISE: |
|
|
|
PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(),formDTO.getIsPage()).doSelectPageInfo(() -> govOrgService.getEnterpriseInfos(formDTO)); |
|
|
|
List<ResourceInfoResultDTO> enterpriseInfos = govOrgService.getEnterpriseInfos(formDTO); |
|
|
|
if (!enterpriseInfos.isEmpty()){ |
|
|
|
reInfos.addAll(enterpriseInfos); |
|
|
|
} |
|
|
|
break; |
|
|
|
case TableConstant.IC_PUBLIC_SERVICE: |
|
|
|
PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(),formDTO.getIsPage()).doSelectPageInfo(() -> govOrgService.getPublicServiceInfos(formDTO)); |
|
|
|
List<ResourceInfoResultDTO> publicServiceInfos = govOrgService.getPublicServiceInfos(formDTO); |
|
|
|
if (!publicServiceInfos.isEmpty()){ |
|
|
|
reInfos.addAll(publicServiceInfos); |
|
|
|
} |
|
|
|
break; |
|
|
|
case TableConstant.IC_EVENT: |
|
|
|
PageInfo<EventInfoResultDTO> eventPageInfo = getEventInfo(formDTO); |
|
|
|
result.setEventInfos(eventPageInfo.getList()); |
|
|
|
result.setEventInfoTotal(eventPageInfo.getTotal()); |
|
|
|
break; |
|
|
|
default: |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
result.setResourceInfos(reInfos); |
|
|
|
} |
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|
public PageInfo<UserInfoResultDTO> getIcUserPageInfo (CoverageHomeSearchFormDTO formDTO){ |
|
|
|
PageInfo<UserInfoResultDTO> result = new PageInfo<>(); |
|
|
|
if (formDTO.getIsPage()){ |
|
|
|
result = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()).doSelectPageInfo(() -> icResiService.getAllIcUser(formDTO)); |
|
|
|
}else { |
|
|
|
List<UserInfoResultDTO> allIcUser = icResiService.getAllIcUser(formDTO); |
|
|
|
result.setTotal(Long.valueOf(String.valueOf(allIcUser.size()))); |
|
|
|
result.setList(allIcUser); |
|
|
|
} |
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* Desc: 事件查询 |
|
|
|
* @param formDTO |
|
|
|
* @author zxc |
|
|
|
* @date 2022/7/28 16:03 |
|
|
|
*/ |
|
|
|
public PageInfo<EventInfoResultDTO> getEventInfo (CoverageHomeSearchFormDTO formDTO){ |
|
|
|
PageInfo<EventInfoResultDTO> result = new PageInfo<>(); |
|
|
|
if (formDTO.getIsPage()){ |
|
|
|
result = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()).doSelectPageInfo(() -> govProjectService.getEventInfos(formDTO)); |
|
|
|
}else { |
|
|
|
List<EventInfoResultDTO> eventInfos = govProjectService.getEventInfos(formDTO); |
|
|
|
result.setTotal(Long.valueOf(String.valueOf(eventInfos.size()))); |
|
|
|
result.setList(eventInfos); |
|
|
|
} |
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|