Browse Source

大屏调度指挥增加重点单位

dev
luyan 2 years ago
parent
commit
454171a37c
  1. 9
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/CoverageEnums.java
  2. 3
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/CoveragePlaceTypeEnum.java
  3. 20
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/KeyEnterpriseDao.java
  4. 57
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govorg/KeyEnterpriseEntity.java
  5. 58
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java
  6. 222
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java
  7. 323
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/CoverageServiceImpl.java
  8. 24
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/KeyEnterpriseDao.xml

9
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/CoverageEnums.java

@ -6,10 +6,11 @@ package com.epmet.commons.tools.enums;
public enum CoverageEnums { public enum CoverageEnums {
ZHZL("zhzl", "综合治理图层", 1), ZHZL("zhzl", "综合治理图层", 1),
YJCL("yjcl", "应急处置图层", 1), YJCL("yjcl", "应急处置资源", 1),
AQSC("aqsc", "安全生产图层", 1), AQSC("aqsc", "安全生产资源", 1),
CSGL("csgl", "城市管理图层", 1), ZDDW("zddw", "重点单位", 1), //日照专用
GGFW("ggfw", "公共服务图层", 1), CSGL("csgl", "城市管理资源", 1),
GGFW("ggfw", "公共服务资源", 1),
DATA_TYPE_GOVERNED_TARGET("governedTarget", "被管理对象", 2), DATA_TYPE_GOVERNED_TARGET("governedTarget", "被管理对象", 2),
DATA_TYPE_RESOURCES("resources", "资源", 2); DATA_TYPE_RESOURCES("resources", "资源", 2);

3
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/CoveragePlaceTypeEnum.java

@ -20,7 +20,8 @@ public enum CoveragePlaceTypeEnum {
EVENT("event", "城市管理事件"), EVENT("event", "城市管理事件"),
ZHZL_RQ("zhzl_rq", "综合治理人群"), ZHZL_RQ("zhzl_rq", "综合治理人群"),
NUCLEIC_POINT("nucleic_point", "核酸检测点"), NUCLEIC_POINT("nucleic_point", "核酸检测点"),
VACCINE_POINT("vaccine_point", "疫苗接种点"); VACCINE_POINT("vaccine_point", "疫苗接种点"),
KEY_UNIT("key_unit", "重点单位"); //日照专用
private final String code; private final String code;
private final String name; private final String name;

20
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/KeyEnterpriseDao.java

@ -0,0 +1,20 @@
package com.epmet.dataaggre.dao.govorg;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dataaggre.entity.govorg.KeyEnterpriseEntity;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* @author yan Lu
* @description 描述
* @create 2023/6/25 13:44
*/
@Mapper
public interface KeyEnterpriseDao extends BaseDao {
Integer countKeyEnterprise();
List<KeyEnterpriseEntity> getList();
}

57
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govorg/KeyEnterpriseEntity.java

@ -0,0 +1,57 @@
package com.epmet.dataaggre.entity.govorg;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* @author yan Lu
* @description 描述
* @create 2023/6/25 15:11
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("key_enterprise")
public class KeyEnterpriseEntity extends BaseEpmetEntity {
/**
* 单位名称
*/
private String unitName;
/**
* 单位类型
*/
private String unitType;
/**
* 主营业务
*/
private String business;
/**
* 法人代表
*/
private String legalPerson;
/**
* 电话
*/
private String mobile;
/**
* 地址
*/
private String address;
/**
* 经度
*/
private String longitude;
/**
* 纬度
*/
private String latitude;
}

58
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java

@ -13,6 +13,7 @@ import com.epmet.dataaggre.dto.govorg.form.*;
import com.epmet.dataaggre.dto.govorg.result.*; import com.epmet.dataaggre.dto.govorg.result.*;
import com.epmet.dataaggre.dto.resigroup.result.OrgInfoCommonDTO; import com.epmet.dataaggre.dto.resigroup.result.OrgInfoCommonDTO;
import com.epmet.dataaggre.entity.govorg.CustomerAgencyEntity; import com.epmet.dataaggre.entity.govorg.CustomerAgencyEntity;
import com.epmet.dataaggre.entity.govorg.KeyEnterpriseEntity;
import com.epmet.dto.IcNeighborHoodDTO; import com.epmet.dto.IcNeighborHoodDTO;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
@ -48,7 +49,7 @@ public interface GovOrgService {
List<GridsInfoListResultDTO> gridListByIds(List<String> gridIdList); List<GridsInfoListResultDTO> gridListByIds(List<String> gridIdList);
/** /**
* @Description 根据userId查询组织ID * @Description 根据userId查询组织ID
* @Param userId * @Param userId
* @author zxc * @author zxc
* @date 2020/12/25 下午4:53 * @date 2020/12/25 下午4:53
@ -67,19 +68,19 @@ public interface GovOrgService {
List<CustomerGridDTO> gridListByStaffId(String staffId); List<CustomerGridDTO> gridListByStaffId(String staffId);
/** /**
* @Description 查询网格下有网格员角色的人 * @Description 查询网格下有网格员角色的人
* @author sun * @author sun
*/ */
List<GridStaffResultDTO> selectGridStaffByGridIds(List<String> gridIds, String staffName); List<GridStaffResultDTO> selectGridStaffByGridIds(List<String> gridIds, String staffName);
/** /**
* @Description 查询网格信息或查询当前人员所属组织下所有网格信息 * @Description 查询网格信息或查询当前人员所属组织下所有网格信息
* @author sun * @author sun
*/ */
List<CustomerGridDTO> getGridInfoList(List<String> gridIds, String staffId); List<CustomerGridDTO> getGridInfoList(List<String> gridIds, String staffId);
/** /**
* @Description 查询工作人员所属组织信息 * @Description 查询工作人员所属组织信息
* @author sun * @author sun
*/ */
CustomerAgencyDTO gridByAgencyId(String customerId, String staffId); CustomerAgencyDTO gridByAgencyId(String customerId, String staffId);
@ -97,6 +98,7 @@ public interface GovOrgService {
* @author sun * @author sun
*/ */
OrgStaffListResultDTO staffList(OrgStaffListFormDTO formDTO); OrgStaffListResultDTO staffList(OrgStaffListFormDTO formDTO);
OrgStaffListResultDTO getCurrentOrgStafflist(OrgStaffListFormDTO formDTO); OrgStaffListResultDTO getCurrentOrgStafflist(OrgStaffListFormDTO formDTO);
/** /**
@ -124,6 +126,7 @@ public interface GovOrgService {
/** /**
* desc:工作人员所在网格 * desc:工作人员所在网格
*
* @param staffId * @param staffId
* @return * @return
*/ */
@ -131,6 +134,7 @@ public interface GovOrgService {
/** /**
* desc:工作人员所在部门 * desc:工作人员所在部门
*
* @param staffId * @param staffId
* @return * @return
*/ */
@ -138,6 +142,7 @@ public interface GovOrgService {
/** /**
* desc获取工作人员是由哪个类型添加进来的 * desc获取工作人员是由哪个类型添加进来的
*
* @param staffId * @param staffId
* @return * @return
*/ */
@ -163,16 +168,16 @@ public interface GovOrgService {
List<String> getStaffOrgList(String staffId); List<String> getStaffOrgList(String staffId);
/** /**
* @Description 查询组织信息
* @param agencyId * @param agencyId
* @Description 查询组织信息
* @author zxc * @author zxc
* @date 2021/11/5 2:54 下午 * @date 2021/11/5 2:54 下午
*/ */
CustomerAgencyDTO getAgencyInfo(String agencyId); CustomerAgencyDTO getAgencyInfo(String agencyId);
/** /**
* @Description 查询网格信息
* @param gridId * @param gridId
* @Description 查询网格信息
* @author zxc * @author zxc
* @date 2021/11/5 2:57 下午 * @date 2021/11/5 2:57 下午
*/ */
@ -198,6 +203,7 @@ public interface GovOrgService {
/** /**
* 获取楼栋信息 * 获取楼栋信息
*
* @param buildingId * @param buildingId
* @return * @return
*/ */
@ -205,6 +211,7 @@ public interface GovOrgService {
/** /**
* 组织下的工作人员下拉框 * 组织下的工作人员下拉框
*
* @param customerId * @param customerId
* @param agencyId * @param agencyId
* @return * @return
@ -213,14 +220,15 @@ public interface GovOrgService {
/** /**
* 查询跟组织信息 * 查询跟组织信息
*
* @param customerId * @param customerId
* @return * @return
*/ */
CustomerAgencyEntity getRootAgencyByCustomerId(String customerId); CustomerAgencyEntity getRootAgencyByCustomerId(String customerId);
List<String> listHouseIdsByRules(String customerId, String orgIdPath, String orgId, String orgType, String neighborHoodId, String buildingId, List<String> listHouseIdsByRules(String customerId, String orgIdPath, String orgId, String orgType, String neighborHoodId, String buildingId,
String unitId, String houseId, List<ResisByPolicyRulesFormDTO.HouseRule> houseRule, String unitId, String houseId, List<ResisByPolicyRulesFormDTO.HouseRule> houseRule,
List<ResisByPolicyRulesFormDTO.StatRule> statRule, Integer pageNo, Integer pageSize); List<ResisByPolicyRulesFormDTO.StatRule> statRule, Integer pageNo, Integer pageSize);
List<IcNeighborHoodDTO> neighborhoodsByIds(List<String> neighborhoodIds); List<IcNeighborHoodDTO> neighborhoodsByIds(List<String> neighborhoodIds);
@ -229,7 +237,7 @@ public interface GovOrgService {
* *
* @Param tokenDto * @Param tokenDto
* @Param formDTO * @Param formDTO
* @Return {@link PageData< MemberProjectInfoResultDTO>} * @Return {@link PageData < MemberProjectInfoResultDTO >}
* @Author zhaoqifeng * @Author zhaoqifeng
* @Date 2022/7/27 9:43 * @Date 2022/7/27 9:43
*/ */
@ -240,7 +248,7 @@ public interface GovOrgService {
* *
* @Param tokenDto * @Param tokenDto
* @Param formDTO * @Param formDTO
* @Return {@link PageData< MemberProjectInfoResultDTO>} * @Return {@link PageData < MemberProjectInfoResultDTO >}
* @Author zhaoqifeng * @Author zhaoqifeng
* @Date 2022/7/27 9:44 * @Date 2022/7/27 9:44
*/ */
@ -248,57 +256,73 @@ public interface GovOrgService {
/** /**
* Desc: 资源获取城市管理信息 * Desc: 资源获取城市管理信息
*
* @param formDTO * @param formDTO
* @author zxc * @author zxc
* @date 2022/7/28 10:22 * @date 2022/7/28 10:22
*/ */
List<ResourceInfoResultDTO> getCityManageInfos(CoverageHomeSearchFormDTO formDTO); List<ResourceInfoResultDTO> getCityManageInfos(CoverageHomeSearchFormDTO formDTO);
Integer getCityManageInfosCount(CoverageHomeSearchFormDTO formDTO);
/** /**
* Desc: 资源获取公共服务信息 * Desc: 资源获取公共服务信息
*
* @param formDTO * @param formDTO
* @author zxc * @author zxc
* @date 2022/7/28 10:22 * @date 2022/7/28 10:22
*/ */
List<ResourceInfoResultDTO> getPublicServiceInfos(CoverageHomeSearchFormDTO formDTO); List<ResourceInfoResultDTO> getPublicServiceInfos(CoverageHomeSearchFormDTO formDTO);
Integer getPublicServiceInfosCount(CoverageHomeSearchFormDTO formDTO);
/** /**
* Desc: 资源获取重点危化品企业信息 * Desc: 资源获取重点危化品企业信息
*
* @param formDTO * @param formDTO
* @author zxc * @author zxc
* @date 2022/7/28 10:22 * @date 2022/7/28 10:22
*/ */
List<ResourceInfoResultDTO> getDangerousChemicalsInfos(CoverageHomeSearchFormDTO formDTO); List<ResourceInfoResultDTO> getDangerousChemicalsInfos(CoverageHomeSearchFormDTO formDTO);
Integer getDangerousChemicalsInfosCount(CoverageHomeSearchFormDTO formDTO);
/** /**
* Desc: 资源获取优势资源信息 * Desc: 资源获取优势资源信息
*
* @param formDTO * @param formDTO
* @author zxc * @author zxc
* @date 2022/7/28 10:22 * @date 2022/7/28 10:22
*/ */
List<ResourceInfoResultDTO> getSuperiorResourceInfos(CoverageHomeSearchFormDTO formDTO); List<ResourceInfoResultDTO> getSuperiorResourceInfos(CoverageHomeSearchFormDTO formDTO);
Integer getSuperiorResourceInfosCount(CoverageHomeSearchFormDTO formDTO);
/** /**
* Desc: 资源获取企事业单位巡查信息 * Desc: 资源获取企事业单位巡查信息
*
* @param formDTO * @param formDTO
* @author zxc * @author zxc
* @date 2022/7/28 10:22 * @date 2022/7/28 10:22
*/ */
List<ResourceInfoResultDTO> getEnterpriseInfos(CoverageHomeSearchFormDTO formDTO); List<ResourceInfoResultDTO> getEnterpriseInfos(CoverageHomeSearchFormDTO formDTO);
Integer getEnterpriseInfosCount(CoverageHomeSearchFormDTO formDTO);
ScreenAgencyOrGridListDTO getSubAgencyOrGridList(String customerId, String agencyId, Boolean isGetSubAllGrid); ScreenAgencyOrGridListDTO getSubAgencyOrGridList(String customerId, String agencyId, Boolean isGetSubAllGrid);
/** /**
* @Description 查询员工的证件号和手机号
* @param registerId * @param registerId
* @Description 查询员工的证件号和手机号
* @Author zxc * @Author zxc
* @Date 2022/10/27 14:03 * @Date 2022/10/27 14:03
*/ */
Map<String,String> getEmployeeRegisterMobileAndIdCard(String registerId); Map<String, String> getEmployeeRegisterMobileAndIdCard(String registerId);
/**
* 日照统计重点单位数量
*
* @return
*/
Integer countKeyEnterprise();
/**
* 日照获取重点单位坐标位置关系
*
* @return
*/
List<KeyEnterpriseEntity> getKeyEnterprise();
} }

222
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java

@ -49,6 +49,7 @@ import com.epmet.dataaggre.dto.govorg.result.*;
import com.epmet.dataaggre.dto.resigroup.result.OrgInfoCommonDTO; import com.epmet.dataaggre.dto.resigroup.result.OrgInfoCommonDTO;
import com.epmet.dataaggre.entity.govorg.CustomerAgencyEntity; import com.epmet.dataaggre.entity.govorg.CustomerAgencyEntity;
import com.epmet.dataaggre.entity.govorg.CustomerGridEntity; import com.epmet.dataaggre.entity.govorg.CustomerGridEntity;
import com.epmet.dataaggre.entity.govorg.KeyEnterpriseEntity;
import com.epmet.dataaggre.excel.GridLivelyDetailExcel; import com.epmet.dataaggre.excel.GridLivelyDetailExcel;
import com.epmet.dataaggre.excel.GridLivelyExcel; import com.epmet.dataaggre.excel.GridLivelyExcel;
import com.epmet.dataaggre.service.commonservice.AreaCodeService; import com.epmet.dataaggre.service.commonservice.AreaCodeService;
@ -133,6 +134,9 @@ public class GovOrgServiceImpl implements GovOrgService {
private GovProjectService govProjectService; private GovProjectService govProjectService;
@Autowired @Autowired
private IcCityManagementDao cityManagementDao; private IcCityManagementDao cityManagementDao;
@Resource
private KeyEnterpriseDao keyEnterpriseDao;
/** /**
* @param staffId * @param staffId
@ -205,7 +209,7 @@ public class GovOrgServiceImpl implements GovOrgService {
} }
/** /**
* @Description 根据userId查询组织ID * @Description 根据userId查询组织ID
* @Param userId * @Param userId
* @author zxc * @author zxc
* @date 2020/12/25 下午4:53 * @date 2020/12/25 下午4:53
@ -217,9 +221,9 @@ public class GovOrgServiceImpl implements GovOrgService {
@Override @Override
public List<NextAreaCodeResultDTO> queryNextLevelAreaCodeList(NextAreaCodeFormDTO formDTO) { public List<NextAreaCodeResultDTO> queryNextLevelAreaCodeList(NextAreaCodeFormDTO formDTO) {
CustomerAgencyEntity parent=customerAgencyDao.selectById(formDTO.getParentAgencyId()); CustomerAgencyEntity parent = customerAgencyDao.selectById(formDTO.getParentAgencyId());
if (null == parent || StringUtils.isBlank(parent.getAreaCode())) { if (null == parent || StringUtils.isBlank(parent.getAreaCode())) {
throw new RenException(EpmetErrorCode.SET_PARENT_AREA_CODE.getCode(),EpmetErrorCode.SET_PARENT_AREA_CODE.getMsg()); throw new RenException(EpmetErrorCode.SET_PARENT_AREA_CODE.getCode(), EpmetErrorCode.SET_PARENT_AREA_CODE.getMsg());
} }
//全部下级 //全部下级
List<NextAreaCodeResultDTO> allList = areaCodeService.queryNextLevelAreaCodeList(formDTO); List<NextAreaCodeResultDTO> allList = areaCodeService.queryNextLevelAreaCodeList(formDTO);
@ -229,11 +233,11 @@ public class GovOrgServiceImpl implements GovOrgService {
// List<String> usedAreaCodeList1 = customerAgencyDao.selectUsedAreaCodeList(formDTO.getAreaCode()); // List<String> usedAreaCodeList1 = customerAgencyDao.selectUsedAreaCodeList(formDTO.getAreaCode());
//外部子客户: //外部子客户:
List<String> usedAreaCodeList2 = customerRelation.selectUsedAreaCodeList(formDTO.getAreaCode()); List<String> usedAreaCodeList2 = customerRelation.selectUsedAreaCodeList(formDTO.getAreaCode());
List<String> list=new ArrayList<>(); List<String> list = new ArrayList<>();
/*if(CollectionUtils.isNotEmpty(usedAreaCodeList1)){ /*if(CollectionUtils.isNotEmpty(usedAreaCodeList1)){
list.addAll(usedAreaCodeList1); list.addAll(usedAreaCodeList1);
}*/ }*/
if(CollectionUtils.isNotEmpty(usedAreaCodeList2)){ if (CollectionUtils.isNotEmpty(usedAreaCodeList2)) {
list.addAll(usedAreaCodeList2); list.addAll(usedAreaCodeList2);
} }
HashSet set = new HashSet(list); HashSet set = new HashSet(list);
@ -255,11 +259,11 @@ public class GovOrgServiceImpl implements GovOrgService {
@Override @Override
public List<OrgInfoCommonDTO> queryNextOrgInfoDTO(String customerId, String orgId) { public List<OrgInfoCommonDTO> queryNextOrgInfoDTO(String customerId, String orgId) {
List<OrgInfoCommonDTO> result=new ArrayList<>(); List<OrgInfoCommonDTO> result = new ArrayList<>();
List<CustomerAgencyEntity> customerAgencyEntityList = customerAgencyDao.selectNextAgency(customerId, orgId); List<CustomerAgencyEntity> customerAgencyEntityList = customerAgencyDao.selectNextAgency(customerId, orgId);
if(CollectionUtils.isNotEmpty(customerAgencyEntityList)){ if (CollectionUtils.isNotEmpty(customerAgencyEntityList)) {
customerAgencyEntityList.forEach(agencyEntity->{ customerAgencyEntityList.forEach(agencyEntity -> {
OrgInfoCommonDTO agecnyInfo=new OrgInfoCommonDTO(); OrgInfoCommonDTO agecnyInfo = new OrgInfoCommonDTO();
agecnyInfo.setOrgId(agencyEntity.getId()); agecnyInfo.setOrgId(agencyEntity.getId());
agecnyInfo.setOrgName(agencyEntity.getOrganizationName()); agecnyInfo.setOrgName(agencyEntity.getOrganizationName());
agecnyInfo.setOrgType("agency"); agecnyInfo.setOrgType("agency");
@ -269,10 +273,10 @@ public class GovOrgServiceImpl implements GovOrgService {
}); });
return result; return result;
} }
List<GridInfoResultDTO> gridInfoResultDTOList=customerGridDao.selectGridListByAgencyId(orgId); List<GridInfoResultDTO> gridInfoResultDTOList = customerGridDao.selectGridListByAgencyId(orgId);
if(CollectionUtils.isNotEmpty(gridInfoResultDTOList)){ if (CollectionUtils.isNotEmpty(gridInfoResultDTOList)) {
gridInfoResultDTOList.forEach(grid->{ gridInfoResultDTOList.forEach(grid -> {
OrgInfoCommonDTO gridInfo=new OrgInfoCommonDTO(); OrgInfoCommonDTO gridInfo = new OrgInfoCommonDTO();
gridInfo.setOrgId(grid.getGridId()); gridInfo.setOrgId(grid.getGridId());
gridInfo.setOrgName(grid.getGridName()); gridInfo.setOrgName(grid.getGridName());
gridInfo.setOrgType("grid"); gridInfo.setOrgType("grid");
@ -297,29 +301,29 @@ public class GovOrgServiceImpl implements GovOrgService {
} }
/** /**
* @Description 查询网格下有网格员角色的人 * @Description 查询网格下有网格员角色的人
* @author sun * @author sun
*/ */
@Override @Override
public List<GridStaffResultDTO> selectGridStaffByGridIds(List<String> gridIds, String staffName) { public List<GridStaffResultDTO> selectGridStaffByGridIds(List<String> gridIds, String staffName) {
if (org.springframework.util.CollectionUtils.isEmpty(gridIds)){ if (org.springframework.util.CollectionUtils.isEmpty(gridIds)) {
return new ArrayList<>(); return new ArrayList<>();
} }
// 查询网格下所有的人 // 查询网格下所有的人
List<GridStaffResultDTO> gridStaff = customerStaffGridDao.selectGridStaffByGridIds(gridIds); List<GridStaffResultDTO> gridStaff = customerStaffGridDao.selectGridStaffByGridIds(gridIds);
if (org.springframework.util.CollectionUtils.isEmpty(gridStaff)){ if (org.springframework.util.CollectionUtils.isEmpty(gridStaff)) {
return new ArrayList<>(); return new ArrayList<>();
} }
// 拿着网格下所有人去筛选网格员 // 拿着网格下所有人去筛选网格员
List<GridStaffResultDTO> result = epmetUserService.staffGridRole(gridStaff, staffName); List<GridStaffResultDTO> result = epmetUserService.staffGridRole(gridStaff, staffName);
if (org.springframework.util.CollectionUtils.isEmpty(result)){ if (org.springframework.util.CollectionUtils.isEmpty(result)) {
return new ArrayList<>(); return new ArrayList<>();
} }
return result; return result;
} }
/** /**
* @Description 查询网格信息或查询当前人员所属组织下所有网格信息 * @Description 查询网格信息或查询当前人员所属组织下所有网格信息
* @author sun * @author sun
*/ */
@Override @Override
@ -401,6 +405,7 @@ public class GovOrgServiceImpl implements GovOrgService {
return resultDTO; return resultDTO;
} }
/** /**
* @Author sun * @Author sun
* @Description 递归查询当前组织的下一级组织网格列表 * @Description 递归查询当前组织的下一级组织网格列表
@ -433,13 +438,13 @@ public class GovOrgServiceImpl implements GovOrgService {
} }
formDTO.setStaffIds(staffIds); formDTO.setStaffIds(staffIds);
//是否包含自己 //是否包含自己
if("0".equals(formDTO.getIncludeMe())){ if ("0".equals(formDTO.getIncludeMe())) {
staffIds.removeIf(s->s.equals(formDTO.getStaffId())); staffIds.removeIf(s -> s.equals(formDTO.getStaffId()));
} }
//是否具有超级管理员或管理员角色 //是否具有超级管理员或管理员角色
CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId()); CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId());
Map<String,String> roleMap = staffInfoCache.getRoleMap(); Map<String, String> roleMap = staffInfoCache.getRoleMap();
if (roleMap.containsKey("root_manager") || roleMap.containsKey("manager")) { if (roleMap.containsKey("root_manager") || roleMap.containsKey("manager")) {
formDTO.setEnableFlag("disabled"); formDTO.setEnableFlag("disabled");
} }
@ -449,7 +454,7 @@ public class GovOrgServiceImpl implements GovOrgService {
//3.查询工作人员注册组织关系信息 //3.查询工作人员注册组织关系信息
List<String> staffIdList = staffList.stream().map(ListStaffResultDTO::getStaffId).collect(Collectors.toList()); List<String> staffIdList = staffList.stream().map(ListStaffResultDTO::getStaffId).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(staffIdList)){ if (!CollectionUtils.isEmpty(staffIdList)) {
List<StaffOrgNameResultDTO> list = customerAgencyDao.selelctStaffOrg(staffIdList); List<StaffOrgNameResultDTO> list = customerAgencyDao.selelctStaffOrg(staffIdList);
staffList.forEach(re -> list.stream().filter(l -> re.getStaffId().equals(l.getStaffId())).forEach(s -> re.setOrgType(s.getOrgType()))); staffList.forEach(re -> list.stream().filter(l -> re.getStaffId().equals(l.getStaffId())).forEach(s -> re.setOrgType(s.getOrgType())));
} }
@ -475,8 +480,8 @@ public class GovOrgServiceImpl implements GovOrgService {
} }
formDTO.setStaffIds(staffIds); formDTO.setStaffIds(staffIds);
//是否包含自己 //是否包含自己
if("0".equals(formDTO.getIncludeMe())){ if ("0".equals(formDTO.getIncludeMe())) {
staffIds.removeIf(s->s.equals(formDTO.getStaffId())); staffIds.removeIf(s -> s.equals(formDTO.getStaffId()));
} }
//2.分页查询工作人员基础信息、角色信息【组织人员单位领导角色人员在前;部门人员部门领导角色人员在前;网格人员网格长角色人员在前】 //2.分页查询工作人员基础信息、角色信息【组织人员单位领导角色人员在前;部门人员部门领导角色人员在前;网格人员网格长角色人员在前】
@ -484,7 +489,7 @@ public class GovOrgServiceImpl implements GovOrgService {
//3.查询工作人员注册组织关系信息 //3.查询工作人员注册组织关系信息
List<String> staffIdList = staffList.stream().map(ListStaffResultDTO::getStaffId).collect(Collectors.toList()); List<String> staffIdList = staffList.stream().map(ListStaffResultDTO::getStaffId).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(staffIdList)){ if (!CollectionUtils.isEmpty(staffIdList)) {
List<StaffOrgNameResultDTO> list = customerAgencyDao.selelctStaffOrg(staffIdList); List<StaffOrgNameResultDTO> list = customerAgencyDao.selelctStaffOrg(staffIdList);
staffList.forEach(re -> list.stream().filter(l -> re.getStaffId().equals(l.getStaffId())).forEach(s -> re.setOrgType(s.getOrgType()))); staffList.forEach(re -> list.stream().filter(l -> re.getStaffId().equals(l.getStaffId())).forEach(s -> re.setOrgType(s.getOrgType())));
} }
@ -504,8 +509,8 @@ public class GovOrgServiceImpl implements GovOrgService {
public StaffDetailV2FormDTO staffDetailV2(StaffDetailV2ResultDTO formDTO) { public StaffDetailV2FormDTO staffDetailV2(StaffDetailV2ResultDTO formDTO) {
//1.查询工作人员基本信息、角色信息 //1.查询工作人员基本信息、角色信息
StaffDetailV2FormDTO result = epmetUserService.selectByStaffId(formDTO.getStaffId()); StaffDetailV2FormDTO result = epmetUserService.selectByStaffId(formDTO.getStaffId());
if (null == result||StringUtils.isBlank(result.getStaffId())) { if (null == result || StringUtils.isBlank(result.getStaffId())) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"customer_staff is null staffId:"+formDTO.getStaffId(),"未查询到工作人员基本信息"); throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "customer_staff is null staffId:" + formDTO.getStaffId(), "未查询到工作人员基本信息");
// return new StaffDetailV2FormDTO(); // return new StaffDetailV2FormDTO();
} }
@ -514,7 +519,7 @@ public class GovOrgServiceImpl implements GovOrgService {
staffIdList.add(formDTO.getStaffId()); staffIdList.add(formDTO.getStaffId());
List<StaffOrgNameResultDTO> list = customerAgencyDao.selelctStaffOrg(staffIdList); List<StaffOrgNameResultDTO> list = customerAgencyDao.selelctStaffOrg(staffIdList);
if (null == list || list.size() < NumConstant.ONE) { if (null == list || list.size() < NumConstant.ONE) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"未查询到工作人员注册组织信息","未查询到工作人员所属组织信息"); throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "未查询到工作人员注册组织信息", "未查询到工作人员所属组织信息");
} }
//3.封装数据并返回 //3.封装数据并返回
@ -591,13 +596,13 @@ public class GovOrgServiceImpl implements GovOrgService {
@Override @Override
public List<OrgTreeResultDTO> getAgencyTree(TokenDto tokenDto, SubOrgFormDTO formDTO) { public List<OrgTreeResultDTO> getAgencyTree(TokenDto tokenDto, SubOrgFormDTO formDTO) {
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId()); CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId());
if (staffInfo == null || StringUtils.isBlank(staffInfo.getAgencyId())){ if (staffInfo == null || StringUtils.isBlank(staffInfo.getAgencyId())) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"工作人员所属组织不存在"); throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "工作人员所属组织不存在");
} }
String agencyId = staffInfo.getAgencyId(); String agencyId = staffInfo.getAgencyId();
String client = formDTO.getClient(); String client = formDTO.getClient();
//组织缓存key //组织缓存key
String treeCacheKey = RedisKeys.getOrgTreeCacheKey(agencyId,tokenDto.getCustomerId()).concat(StrConstant.COLON).concat(client); String treeCacheKey = RedisKeys.getOrgTreeCacheKey(agencyId, tokenDto.getCustomerId()).concat(StrConstant.COLON).concat(client);
Long expiryTime = redisUtils.getTTL(treeCacheKey); Long expiryTime = redisUtils.getTTL(treeCacheKey);
List<OrgTreeResultDTO> orgTreeResultDTOS = (List<OrgTreeResultDTO>) redisUtils.get(treeCacheKey); List<OrgTreeResultDTO> orgTreeResultDTOS = (List<OrgTreeResultDTO>) redisUtils.get(treeCacheKey);
//如果接近过期或已经过期且缓存数据不为空 则异步查询 //如果接近过期或已经过期且缓存数据不为空 则异步查询
@ -606,13 +611,14 @@ public class GovOrgServiceImpl implements GovOrgService {
List<OrgTreeResultDTO> list = buildTempOrgTree(agencyId, client); List<OrgTreeResultDTO> list = buildTempOrgTree(agencyId, client);
redisUtils.set(treeCacheKey, list, RedisUtils.HOUR_FOUR_EXPIRE); redisUtils.set(treeCacheKey, list, RedisUtils.HOUR_FOUR_EXPIRE);
}); });
} else if (CollectionUtils.isEmpty(orgTreeResultDTOS)){ } else if (CollectionUtils.isEmpty(orgTreeResultDTOS)) {
orgTreeResultDTOS = buildTempOrgTree(staffInfo.getAgencyId(), formDTO.getClient()); orgTreeResultDTOS = buildTempOrgTree(staffInfo.getAgencyId(), formDTO.getClient());
redisUtils.set(treeCacheKey, orgTreeResultDTOS, RedisUtils.HOUR_FOUR_EXPIRE); redisUtils.set(treeCacheKey, orgTreeResultDTOS, RedisUtils.HOUR_FOUR_EXPIRE);
} }
return orgTreeResultDTOS; return orgTreeResultDTOS;
} }
private List<OrgTreeResultDTO> buildTempOrgTree(String agencyId, String client){
private List<OrgTreeResultDTO> buildTempOrgTree(String agencyId, String client) {
List<OrgTreeResultDTO> list = new ArrayList<>(); List<OrgTreeResultDTO> list = new ArrayList<>();
if ("resi".equals(client)) { if ("resi".equals(client)) {
list.add(customerAgencyDao.getResiOrgTree(agencyId)); list.add(customerAgencyDao.getResiOrgTree(agencyId));
@ -636,15 +642,15 @@ public class GovOrgServiceImpl implements GovOrgService {
} }
/** /**
* @Description 查询组织信息
* @param agencyId * @param agencyId
* @Description 查询组织信息
* @author zxc * @author zxc
* @date 2021/11/5 2:54 下午 * @date 2021/11/5 2:54 下午
*/ */
@Override @Override
public CustomerAgencyDTO getAgencyInfo(String agencyId) { public CustomerAgencyDTO getAgencyInfo(String agencyId) {
CustomerAgencyEntity customerAgencyEntity=customerAgencyDao.selectById(agencyId); CustomerAgencyEntity customerAgencyEntity = customerAgencyDao.selectById(agencyId);
CustomerAgencyDTO res= ConvertUtils.sourceToTarget(customerAgencyEntity,CustomerAgencyDTO.class); CustomerAgencyDTO res = ConvertUtils.sourceToTarget(customerAgencyEntity, CustomerAgencyDTO.class);
//设置行政地区编码全路径 //设置行政地区编码全路径
if (null != res && StringUtils.isNotBlank(res.getAreaCode()) && StringUtils.isNotBlank(res.getParentAreaCode())) { if (null != res && StringUtils.isNotBlank(res.getAreaCode()) && StringUtils.isNotBlank(res.getParentAreaCode())) {
res.setAreaCodePath(queryAreaCodePath(res)); res.setAreaCodePath(queryAreaCodePath(res));
@ -685,8 +691,8 @@ public class GovOrgServiceImpl implements GovOrgService {
} }
/** /**
* @Description 查询网格信息
* @param gridId * @param gridId
* @Description 查询网格信息
* @author zxc * @author zxc
* @date 2021/11/5 2:57 下午 * @date 2021/11/5 2:57 下午
*/ */
@ -711,7 +717,7 @@ public class GovOrgServiceImpl implements GovOrgService {
if (StringUtils.isNotBlank(formDTO.getType()) && "historyScore".equals(formDTO.getType())) { if (StringUtils.isNotBlank(formDTO.getType()) && "historyScore".equals(formDTO.getType())) {
GridLivelyResultDTO dto = evaluationIndexService.streetGridList(formDTO); GridLivelyResultDTO dto = evaluationIndexService.streetGridList(formDTO);
subList.add(dto); subList.add(dto);
}else { } else {
subList = customerAgencyDao.subAgencyListAndGridSumNum(formDTO.getAgencyId()); subList = customerAgencyDao.subAgencyListAndGridSumNum(formDTO.getAgencyId());
} }
//2.查询直属下级组织下网格在查询时间段内存在例行工作次数的网格,一天一条 //2.查询直属下级组织下网格在查询时间段内存在例行工作次数的网格,一天一条
@ -770,7 +776,7 @@ public class GovOrgServiceImpl implements GovOrgService {
LinkedList<GridLivelyResultDTO> subList = customerAgencyDao.subAgencyListAndGridSumNum(formDTO.getAgencyId()); LinkedList<GridLivelyResultDTO> subList = customerAgencyDao.subAgencyListAndGridSumNum(formDTO.getAgencyId());
//1.查询当前组织下所有网格列表 //1.查询当前组织下所有网格列表
List<GridInfoResultDTO> gridList = customerGridDao.selectAgencyGridList(formDTO.getAgencyId()); List<GridInfoResultDTO> gridList = customerGridDao.selectAgencyGridList(formDTO.getAgencyId());
Map<String, GridInfoResultDTO> gridMap = gridList.stream().collect(Collectors.toMap(GridInfoResultDTO :: getGridId, v -> v, (v1, v2) -> v1)); Map<String, GridInfoResultDTO> gridMap = gridList.stream().collect(Collectors.toMap(GridInfoResultDTO::getGridId, v -> v, (v1, v2) -> v1));
//2.查询直属下级组织下网格在查询时间段内存在例行工作次数的网格,一天一条 //2.查询直属下级组织下网格在查询时间段内存在例行工作次数的网格,一天一条
List<GridDateIdResultDTO> workList = epmetUserService.getGridDateRoutineWorkList(formDTO); List<GridDateIdResultDTO> workList = epmetUserService.getGridDateRoutineWorkList(formDTO);
/*//3.查询直属下级组织下网格在查询时间段内存在上报事件(直接立项)数的网格,一天一条 /*//3.查询直属下级组织下网格在查询时间段内存在上报事件(直接立项)数的网格,一天一条
@ -801,7 +807,7 @@ public class GovOrgServiceImpl implements GovOrgService {
//活跃网格数、普通网格数、僵尸网格数 //活跃网格数、普通网格数、僵尸网格数
int gridLivelyNum = 0; int gridLivelyNum = 0;
int gridOrdinaryNum = 0; int gridOrdinaryNum = 0;
for (Map.Entry<String, Integer> ma : hash.entrySet()){ for (Map.Entry<String, Integer> ma : hash.entrySet()) {
gridSet.add(ma.getKey()); gridSet.add(ma.getKey());
if (ma.getValue() >= NumConstant.FIVE) {//活跃网格 if (ma.getValue() >= NumConstant.FIVE) {//活跃网格
gridLivelyNum++; gridLivelyNum++;
@ -809,7 +815,7 @@ public class GovOrgServiceImpl implements GovOrgService {
lively.setAgencyId(sub.getAgencyId()); lively.setAgencyId(sub.getAgencyId());
lively.setAgencyName(sub.getAgencyName()); lively.setAgencyName(sub.getAgencyName());
lively.setGridId(ma.getKey()); lively.setGridId(ma.getKey());
lively.setGridName(null!=gridMap.get(ma.getKey())?gridMap.get(ma.getKey()).getGridName():""); lively.setGridName(null != gridMap.get(ma.getKey()) ? gridMap.get(ma.getKey()).getGridName() : "");
lively.setDatyNum(ma.getValue()); lively.setDatyNum(ma.getValue());
livelyGrid.add(lively); livelyGrid.add(lively);
} else if (ma.getValue() >= NumConstant.TWO && ma.getValue() < NumConstant.FIVE) {//正常网格 } else if (ma.getValue() >= NumConstant.TWO && ma.getValue() < NumConstant.FIVE) {//正常网格
@ -818,15 +824,15 @@ public class GovOrgServiceImpl implements GovOrgService {
ordinary.setAgencyId(sub.getAgencyId()); ordinary.setAgencyId(sub.getAgencyId());
ordinary.setAgencyName(sub.getAgencyName()); ordinary.setAgencyName(sub.getAgencyName());
ordinary.setGridId(ma.getKey()); ordinary.setGridId(ma.getKey());
ordinary.setGridName(null!=gridMap.get(ma.getKey())?gridMap.get(ma.getKey()).getGridName():""); ordinary.setGridName(null != gridMap.get(ma.getKey()) ? gridMap.get(ma.getKey()).getGridName() : "");
ordinary.setDatyNum(ma.getValue()); ordinary.setDatyNum(ma.getValue());
ordinaryGrid.add(ordinary); ordinaryGrid.add(ordinary);
}else if (ma.getValue() < NumConstant.TWO) {//部分僵尸网格[这是活跃天数为1的,还有部分活跃天数为0的] } else if (ma.getValue() < NumConstant.TWO) {//部分僵尸网格[这是活跃天数为1的,还有部分活跃天数为0的]
GridLivelyDetailExcel.LazyGrid lazy = new GridLivelyDetailExcel.LazyGrid(); GridLivelyDetailExcel.LazyGrid lazy = new GridLivelyDetailExcel.LazyGrid();
lazy.setAgencyId(sub.getAgencyId()); lazy.setAgencyId(sub.getAgencyId());
lazy.setAgencyName(sub.getAgencyName()); lazy.setAgencyName(sub.getAgencyName());
lazy.setGridId(ma.getKey()); lazy.setGridId(ma.getKey());
lazy.setGridName(null!=gridMap.get(ma.getKey())?gridMap.get(ma.getKey()).getGridName():""); lazy.setGridName(null != gridMap.get(ma.getKey()) ? gridMap.get(ma.getKey()).getGridName() : "");
lazy.setDatyNum(ma.getValue()); lazy.setDatyNum(ma.getValue());
lazyGrid.add(lazy); lazyGrid.add(lazy);
} }
@ -845,20 +851,20 @@ public class GovOrgServiceImpl implements GovOrgService {
livelyExcelList.add(gridLively); livelyExcelList.add(gridLively);
//5-2.组装不存在活跃度的数据【网格活跃天数为0的】 //5-2.组装不存在活跃度的数据【网格活跃天数为0的】
gridList.forEach(g->{ gridList.forEach(g -> {
if(g.getPids().contains(sub.getAgencyId())&&!gridSet.contains(g.getGridId())){ if (g.getPids().contains(sub.getAgencyId()) && !gridSet.contains(g.getGridId())) {
GridLivelyDetailExcel.LazyGrid lazy = new GridLivelyDetailExcel.LazyGrid(); GridLivelyDetailExcel.LazyGrid lazy = new GridLivelyDetailExcel.LazyGrid();
lazy.setAgencyId(sub.getAgencyId()); lazy.setAgencyId(sub.getAgencyId());
lazy.setAgencyName(sub.getAgencyName()); lazy.setAgencyName(sub.getAgencyName());
lazy.setGridId(g.getGridId()); lazy.setGridId(g.getGridId());
lazy.setGridName(null!=gridMap.get(g.getGridId())?gridMap.get(g.getGridId()).getGridName():""); lazy.setGridName(null != gridMap.get(g.getGridId()) ? gridMap.get(g.getGridId()).getGridName() : "");
lazy.setDatyNum(NumConstant.ZERO); lazy.setDatyNum(NumConstant.ZERO);
lazyGrid.add(lazy); lazyGrid.add(lazy);
} }
}); });
}); });
//5-3.网格运行情况合计 //5-3.网格运行情况合计
if (!CollectionUtils.isEmpty(livelyExcelList)){ if (!CollectionUtils.isEmpty(livelyExcelList)) {
GridLivelyExcel gridLively = new GridLivelyExcel(); GridLivelyExcel gridLively = new GridLivelyExcel();
gridLively.setAgencyName("合计"); gridLively.setAgencyName("合计");
gridLively.setGridSumNum(livelyExcelList.stream().mapToInt(GridLivelyExcel::getGridSumNum).sum()); gridLively.setGridSumNum(livelyExcelList.stream().mapToInt(GridLivelyExcel::getGridSumNum).sum());
@ -908,18 +914,18 @@ public class GovOrgServiceImpl implements GovOrgService {
} }
//2.查询网格活跃度数据 //2.查询网格活跃度数据
GridLivelyDetailExcel resultDTO = gridActiveList(formDTO); GridLivelyDetailExcel resultDTO = gridActiveList(formDTO);
if(null==resultDTO||CollectionUtils.isEmpty(resultDTO.getLivelyExcelList())){ if (null == resultDTO || CollectionUtils.isEmpty(resultDTO.getLivelyExcelList())) {
log.warn(String.format("网格员活跃度统计数据为空,入参【%s】", JSON.toJSONString(formDTO))); log.warn(String.format("网格员活跃度统计数据为空,入参【%s】", JSON.toJSONString(formDTO)));
return; return;
} }
//3.生成多sheet页excel文件并写入数据导出文件 //3.生成多sheet页excel文件并写入数据导出文件
List<Map<String,Object>> headerList = getHeaderList(formDTO,agencyInfo,resultDTO); List<Map<String, Object>> headerList = getHeaderList(formDTO, agencyInfo, resultDTO);
try { try {
Workbook workbook = ExcelExportUtil.exportExcel(headerList, ExcelType.XSSF); Workbook workbook = ExcelExportUtil.exportExcel(headerList, ExcelType.XSSF);
response.setCharacterEncoding("UTF-8"); response.setCharacterEncoding("UTF-8");
response.setHeader("content-Type", "application/vnd.ms-excel"); response.setHeader("content-Type", "application/vnd.ms-excel");
String fileName = excelTitleName(formDTO.getStartTime(), formDTO.getEndTime(), agencyInfo.getOrganizationName()+"网格活跃度统计.xls"); String fileName = excelTitleName(formDTO.getStartTime(), formDTO.getEndTime(), agencyInfo.getOrganizationName() + "网格活跃度统计.xls");
response.setHeader("Content-Disposition", "attachment;filename=" +fileName); response.setHeader("Content-Disposition", "attachment;filename=" + fileName);
ServletOutputStream out = response.getOutputStream(); ServletOutputStream out = response.getOutputStream();
workbook.write(out); workbook.write(out);
out.flush(); out.flush();
@ -929,15 +935,15 @@ public class GovOrgServiceImpl implements GovOrgService {
} }
} }
private List<Map<String, Object>> getHeaderList(GridLivelyFormDTO formDTO, AgencyInfoCache agencyInfo,GridLivelyDetailExcel resultDTO) { private List<Map<String, Object>> getHeaderList(GridLivelyFormDTO formDTO, AgencyInfoCache agencyInfo, GridLivelyDetailExcel resultDTO) {
List<Map<String,Object>> headerList = new ArrayList<>(); List<Map<String, Object>> headerList = new ArrayList<>();
String titleName = excelTitleName(formDTO.getStartTime(), formDTO.getEndTime(), agencyInfo.getOrganizationName()+"网格活跃度统计表"); String titleName = excelTitleName(formDTO.getStartTime(), formDTO.getEndTime(), agencyInfo.getOrganizationName() + "网格活跃度统计表");
headerList.add(getHaderMap(resultDTO.getLivelyExcelList(), titleName, "各街镇网格运行情况", GridLivelyExcel.class)); headerList.add(getHaderMap(resultDTO.getLivelyExcelList(), titleName, "各街镇网格运行情况", GridLivelyExcel.class));
titleName = excelTitleName(formDTO.getStartTime(), formDTO.getEndTime(), agencyInfo.getOrganizationName()+"活跃网格明细"); titleName = excelTitleName(formDTO.getStartTime(), formDTO.getEndTime(), agencyInfo.getOrganizationName() + "活跃网格明细");
headerList.add(getHaderMap(resultDTO.getLivelyGrid(), titleName, "活跃网格统计", GridLivelyDetailExcel.LivelyGrid.class)); headerList.add(getHaderMap(resultDTO.getLivelyGrid(), titleName, "活跃网格统计", GridLivelyDetailExcel.LivelyGrid.class));
titleName = excelTitleName(formDTO.getStartTime(), formDTO.getEndTime(), agencyInfo.getOrganizationName()+"正常运行网格明细"); titleName = excelTitleName(formDTO.getStartTime(), formDTO.getEndTime(), agencyInfo.getOrganizationName() + "正常运行网格明细");
headerList.add(getHaderMap(resultDTO.getOrdinaryGrid(), titleName, "正常运行网格统计", GridLivelyDetailExcel.OrdinaryGrid.class)); headerList.add(getHaderMap(resultDTO.getOrdinaryGrid(), titleName, "正常运行网格统计", GridLivelyDetailExcel.OrdinaryGrid.class));
titleName = excelTitleName(formDTO.getStartTime(), formDTO.getEndTime(), agencyInfo.getOrganizationName()+"僵尸网格明细"); titleName = excelTitleName(formDTO.getStartTime(), formDTO.getEndTime(), agencyInfo.getOrganizationName() + "僵尸网格明细");
headerList.add(getHaderMap(resultDTO.getLazyGrid(), titleName, "僵尸网格统计", GridLivelyDetailExcel.LazyGrid.class)); headerList.add(getHaderMap(resultDTO.getLazyGrid(), titleName, "僵尸网格统计", GridLivelyDetailExcel.LazyGrid.class));
return headerList; return headerList;
} }
@ -950,23 +956,24 @@ public class GovOrgServiceImpl implements GovOrgService {
* cl sheet页列头对应实体类 * cl sheet页列头对应实体类
* @Description 生成多sheet页excel文件模板数据 * @Description 生成多sheet页excel文件模板数据
**/ **/
private Map<String, Object> getHaderMap(Collection<?> data, String title, String name, Class<?> cl){ private Map<String, Object> getHaderMap(Collection<?> data, String title, String name, Class<?> cl) {
Map<String,Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
map.put("data",data); map.put("data", data);
ExportParams param1 = new ExportParams(title, name); ExportParams param1 = new ExportParams(title, name);
map.put("title", param1); map.put("title", param1);
map.put("entity", cl); map.put("entity", cl);
return map; return map;
} }
/** /**
* @Author sun * @Author sun
* @Description excel文件sheet页主标题拼接 * @Description excel文件sheet页主标题拼接
**/ **/
private String excelTitleName(String startTime, String endTime, String name){ private String excelTitleName(String startTime, String endTime, String name) {
StringBuilder titleName = new StringBuilder(); StringBuilder titleName = new StringBuilder();
SimpleDateFormat format1 = new SimpleDateFormat("yyyyMMdd"); SimpleDateFormat format1 = new SimpleDateFormat("yyyyMMdd");
SimpleDateFormat format2 = new SimpleDateFormat("yyyy年MM月dd日"); SimpleDateFormat format2 = new SimpleDateFormat("yyyy年MM月dd日");
try{ try {
titleName.append("(").append(format2.format(format1.parse(startTime))).append("至").append(format2.format(format1.parse(endTime))).append(")").append(name); titleName.append("(").append(format2.format(format1.parse(startTime))).append("至").append(format2.format(format1.parse(endTime))).append(")").append(name);
} catch (Exception e) { } catch (Exception e) {
log.error("method exception", e); log.error("method exception", e);
@ -974,11 +981,11 @@ public class GovOrgServiceImpl implements GovOrgService {
return titleName.toString(); return titleName.toString();
} }
private String excelSheetName(GridLivelyFormDTO formDTO){ private String excelSheetName(GridLivelyFormDTO formDTO) {
StringBuilder name = new StringBuilder(); StringBuilder name = new StringBuilder();
SimpleDateFormat format1 = new SimpleDateFormat("yyyyMMdd"); SimpleDateFormat format1 = new SimpleDateFormat("yyyyMMdd");
SimpleDateFormat format2 = new SimpleDateFormat("yyyy年MM月dd日"); SimpleDateFormat format2 = new SimpleDateFormat("yyyy年MM月dd日");
try{ try {
name.append(format2.format(format1.parse(formDTO.getStartTime()))).append("至").append(format2.format(format1.parse(formDTO.getEndTime()))).append("网格活跃度统计"); name.append(format2.format(format1.parse(formDTO.getStartTime()))).append("至").append(format2.format(format1.parse(formDTO.getEndTime()))).append("网格活跃度统计");
} catch (Exception e) { } catch (Exception e) {
log.error("method exception", e); log.error("method exception", e);
@ -1013,7 +1020,7 @@ public class GovOrgServiceImpl implements GovOrgService {
return; return;
} }
//3.生成多sheet页excel文件并写入数据导出文件 //3.生成多sheet页excel文件并写入数据导出文件
List<Map<String,Object>> headerList = getHeaderList(formDTO,agencyInfo,resultDTO); List<Map<String, Object>> headerList = getHeaderList(formDTO, agencyInfo, resultDTO);
// 文件名 // 文件名
String sheetName = excelSheetName(formDTO); String sheetName = excelSheetName(formDTO);
String resultDescFileName = sheetName.concat(".xlsx"); String resultDescFileName = sheetName.concat(".xlsx");
@ -1054,7 +1061,7 @@ public class GovOrgServiceImpl implements GovOrgService {
// String secret = DingDingRobotConstant.YZM_TEST_SECRET; // String secret = DingDingRobotConstant.YZM_TEST_SECRET;
// String url = DingDingRobotConstant.YZM_TEST_URL; // String url = DingDingRobotConstant.YZM_TEST_URL;
DingTextBriefNessFormDTO dingTalkTextMsg=new DingTextBriefNessFormDTO(); DingTextBriefNessFormDTO dingTalkTextMsg = new DingTextBriefNessFormDTO();
dingTalkTextMsg.setMsgtype("text"); dingTalkTextMsg.setMsgtype("text");
//小雷哥手机号:18660295251, //小雷哥手机号:18660295251,
@ -1068,7 +1075,7 @@ public class GovOrgServiceImpl implements GovOrgService {
OapiRobotSendRequest.Text text = new OapiRobotSendRequest.Text(); OapiRobotSendRequest.Text text = new OapiRobotSendRequest.Text();
text.setContent("网格活跃度统计: \n" + text.setContent("网格活跃度统计: \n" +
"起止时间: " + formDTO.getStartTime().concat(StrConstant.UNDER_LINE).concat(formDTO.getEndTime()) + "\n" + "起止时间: " + formDTO.getStartTime().concat(StrConstant.UNDER_LINE).concat(formDTO.getEndTime()) + "\n" +
"文件下载地址: " + uploadResult.getData().getUrl() + "\n"+ "文件下载地址: " + uploadResult.getData().getUrl() + "\n" +
"请查收@18660295251"); "请查收@18660295251");
dingTalkTextMsg.setText(text); dingTalkTextMsg.setText(text);
HttpClientManager.getInstance().sendDingMsg(JSON.toJSONString(dingTalkTextMsg), url, secret); HttpClientManager.getInstance().sendDingMsg(JSON.toJSONString(dingTalkTextMsg), url, secret);
@ -1083,9 +1090,9 @@ public class GovOrgServiceImpl implements GovOrgService {
*/ */
@Override @Override
public BuildingInfoCache queryBuildingInfo(String buildingId) { public BuildingInfoCache queryBuildingInfo(String buildingId) {
BuildingInfoCache infoCache=icBuildingDao.selectBuildInfo(buildingId); BuildingInfoCache infoCache = icBuildingDao.selectBuildInfo(buildingId);
if(null!=infoCache){ if (null != infoCache) {
GridInfoCache gridInfoCache= CustomerOrgRedis.getGridInfo(infoCache.getGridId()); GridInfoCache gridInfoCache = CustomerOrgRedis.getGridInfo(infoCache.getGridId());
//赋值 XXX-网格名 //赋值 XXX-网格名
infoCache.setGridName(null == gridInfoCache || StringUtils.isBlank(gridInfoCache.getGridNamePath()) ? StrConstant.EPMETY_STR : gridInfoCache.getGridNamePath()); infoCache.setGridName(null == gridInfoCache || StringUtils.isBlank(gridInfoCache.getGridNamePath()) ? StrConstant.EPMETY_STR : gridInfoCache.getGridNamePath());
} }
@ -1120,15 +1127,15 @@ public class GovOrgServiceImpl implements GovOrgService {
public String getOrgIdPath(String orgId, String orgType) { public String getOrgIdPath(String orgId, String orgType) {
if ("agency".equals(orgType)) { if ("agency".equals(orgType)) {
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(orgId); AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(orgId);
if (agencyInfo != null) { if (agencyInfo != null) {
String pids = agencyInfo.getPids(); String pids = agencyInfo.getPids();
String id = agencyInfo.getId(); String id = agencyInfo.getId();
if (StringUtils.isBlank(pids)) { if (StringUtils.isBlank(pids)) {
return id; return id;
} else { } else {
return pids.concat(":").concat(id); return pids.concat(":").concat(id);
}
} }
}
} else { } else {
GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(orgId); GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(orgId);
return gridInfo.getPids().concat(":").concat(gridInfo.getId()); return gridInfo.getPids().concat(":").concat(gridInfo.getId());
@ -1138,8 +1145,8 @@ public class GovOrgServiceImpl implements GovOrgService {
@Override @Override
public List<String> listHouseIdsByRules(String customerId, String orgIdPath, String orgId, String orgType, String neighborHoodId, String buildingId, public List<String> listHouseIdsByRules(String customerId, String orgIdPath, String orgId, String orgType, String neighborHoodId, String buildingId,
String unitId, String houseId, List<ResisByPolicyRulesFormDTO.HouseRule> houseRule, String unitId, String houseId, List<ResisByPolicyRulesFormDTO.HouseRule> houseRule,
List<ResisByPolicyRulesFormDTO.StatRule> statRule, Integer pageNo, Integer pageSize) { List<ResisByPolicyRulesFormDTO.StatRule> statRule, Integer pageNo, Integer pageSize) {
if (CollectionUtils.isEmpty(houseRule) && CollectionUtils.isEmpty(statRule)) { if (CollectionUtils.isEmpty(houseRule) && CollectionUtils.isEmpty(statRule)) {
return new ArrayList<>(); return new ArrayList<>();
@ -1256,8 +1263,8 @@ public class GovOrgServiceImpl implements GovOrgService {
int memberCount = agencyIds.stream().filter(memberMap::containsKey).mapToInt(memberMap::get).sum(); int memberCount = agencyIds.stream().filter(memberMap::containsKey).mapToInt(memberMap::get).sum();
dto.setMemberCount(memberCount); dto.setMemberCount(memberCount);
if (memberCount != NumConstant.ZERO) { if (memberCount != NumConstant.ZERO) {
dto.setProjectAve(dto.getProjectCount()/memberCount); dto.setProjectAve(dto.getProjectCount() / memberCount);
dto.setClosedAve(dto.getClosedCount()/memberCount); dto.setClosedAve(dto.getClosedCount() / memberCount);
} }
return dto; return dto;
@ -1277,7 +1284,7 @@ public class GovOrgServiceImpl implements GovOrgService {
* @param formDTO * @param formDTO
* @Param tokenDto * @Param tokenDto
* @Param formDTO * @Param formDTO
* @Return {@link PageData< MemberProjectInfoResultDTO>} * @Return {@link PageData < MemberProjectInfoResultDTO >}
* @Author zhaoqifeng * @Author zhaoqifeng
* @Date 2022/7/27 9:44 * @Date 2022/7/27 9:44
*/ */
@ -1335,7 +1342,7 @@ public class GovOrgServiceImpl implements GovOrgService {
for (StaffOrgRelationResultDTO staff : staffList) { for (StaffOrgRelationResultDTO staff : staffList) {
CustomerStaffInfoCacheResult staffInfo = getStaffInfo(formDTO.getCustomerId(), staff.getStaffId()); CustomerStaffInfoCacheResult staffInfo = getStaffInfo(formDTO.getCustomerId(), staff.getStaffId());
if (null != staffInfo) { if (null != staffInfo) {
if(staffInfo.getRoleMap().containsKey("grid_member")) { if (staffInfo.getRoleMap().containsKey("grid_member")) {
MemberProjectInfoResultDTO dto = new MemberProjectInfoResultDTO(); MemberProjectInfoResultDTO dto = new MemberProjectInfoResultDTO();
dto.setStaffId(staff.getStaffId()); dto.setStaffId(staff.getStaffId());
dto.setStaffName(staffInfo.getRealName()); dto.setStaffName(staffInfo.getRealName());
@ -1352,7 +1359,7 @@ public class GovOrgServiceImpl implements GovOrgService {
for (StaffOrgRelationResultDTO staff : staffList) { for (StaffOrgRelationResultDTO staff : staffList) {
CustomerStaffInfoCacheResult staffInfo = getStaffInfo(formDTO.getCustomerId(), staff.getStaffId()); CustomerStaffInfoCacheResult staffInfo = getStaffInfo(formDTO.getCustomerId(), staff.getStaffId());
if (null != staffInfo) { if (null != staffInfo) {
if(staffInfo.getRoleMap().containsKey("grid_member")) { if (staffInfo.getRoleMap().containsKey("grid_member")) {
MemberProjectInfoResultDTO dto = new MemberProjectInfoResultDTO(); MemberProjectInfoResultDTO dto = new MemberProjectInfoResultDTO();
dto.setStaffId(staff.getStaffId()); dto.setStaffId(staff.getStaffId());
dto.setStaffName(staffInfo.getRealName()); dto.setStaffName(staffInfo.getRealName());
@ -1370,7 +1377,7 @@ public class GovOrgServiceImpl implements GovOrgService {
PageInfo<MemberProjectInfoResultDTO> pageInfo = new PageInfo<>(list); PageInfo<MemberProjectInfoResultDTO> pageInfo = new PageInfo<>(list);
list = list.stream().sorted((o1, o2) -> list = list.stream().sorted((o1, o2) ->
Collator.getInstance(Locale.SIMPLIFIED_CHINESE) Collator.getInstance(Locale.SIMPLIFIED_CHINESE)
.compare(o1.getStaffName(),o2.getStaffName())).collect(Collectors.toList()); .compare(o1.getStaffName(), o2.getStaffName())).collect(Collectors.toList());
list = list.stream().skip(num).limit(formDTO.getPageSize()).collect(Collectors.toList()); list = list.stream().skip(num).limit(formDTO.getPageSize()).collect(Collectors.toList());
return new PageData<>(list, pageInfo.getTotal()); return new PageData<>(list, pageInfo.getTotal());
@ -1396,8 +1403,8 @@ public class GovOrgServiceImpl implements GovOrgService {
private CustomerStaffInfoCacheResult getStaffInfo(String customerId, String staffId) { private CustomerStaffInfoCacheResult getStaffInfo(String customerId, String staffId) {
if (StringUtils.isBlank(customerId) || StringUtils.isBlank(staffId)){ if (StringUtils.isBlank(customerId) || StringUtils.isBlank(staffId)) {
log.warn("getStaffInfo param is blank,customerId:{},staffId:{}",customerId,staffId); log.warn("getStaffInfo param is blank,customerId:{},staffId:{}", customerId, staffId);
return null; return null;
} }
String key = RedisKeys.getCustomerStaffInfoKey(customerId, staffId); String key = RedisKeys.getCustomerStaffInfoKey(customerId, staffId);
@ -1421,7 +1428,7 @@ public class GovOrgServiceImpl implements GovOrgService {
log.warn("getStaffInfo staff is null,staffId:{}", staffId); log.warn("getStaffInfo staff is null,staffId:{}", staffId);
return null; return null;
} }
CustomerStaffInfoCache resultData =ConvertUtils.sourceToTarget(staffResult, CustomerStaffInfoCache.class); CustomerStaffInfoCache resultData = ConvertUtils.sourceToTarget(staffResult, CustomerStaffInfoCache.class);
Map<String, Object> map = BeanUtil.beanToMap(resultData, false, true); Map<String, Object> map = BeanUtil.beanToMap(resultData, false, true);
redisUtils.hMSet(key, map); redisUtils.hMSet(key, map);
@ -1434,51 +1441,27 @@ public class GovOrgServiceImpl implements GovOrgService {
return cityManagementDao.getCityManageInfos(formDTO); return cityManagementDao.getCityManageInfos(formDTO);
} }
@Override
public Integer getCityManageInfosCount(CoverageHomeSearchFormDTO formDTO) {
return cityManagementDao.getCityManageInfosCount(formDTO);
}
@Override @Override
public List<ResourceInfoResultDTO> getPublicServiceInfos(CoverageHomeSearchFormDTO formDTO) { public List<ResourceInfoResultDTO> getPublicServiceInfos(CoverageHomeSearchFormDTO formDTO) {
return cityManagementDao.getPublicServiceInfos(formDTO); return cityManagementDao.getPublicServiceInfos(formDTO);
} }
@Override
public Integer getPublicServiceInfosCount(CoverageHomeSearchFormDTO formDTO) {
return cityManagementDao.getPublicServiceInfosCount(formDTO);
}
@Override @Override
public List<ResourceInfoResultDTO> getDangerousChemicalsInfos(CoverageHomeSearchFormDTO formDTO) { public List<ResourceInfoResultDTO> getDangerousChemicalsInfos(CoverageHomeSearchFormDTO formDTO) {
return cityManagementDao.getDangerousChemicalsInfos(formDTO); return cityManagementDao.getDangerousChemicalsInfos(formDTO);
} }
@Override
public Integer getDangerousChemicalsInfosCount(CoverageHomeSearchFormDTO formDTO) {
return cityManagementDao.getDangerousChemicalsInfosCount(formDTO);
}
@Override @Override
public List<ResourceInfoResultDTO> getSuperiorResourceInfos(CoverageHomeSearchFormDTO formDTO) { public List<ResourceInfoResultDTO> getSuperiorResourceInfos(CoverageHomeSearchFormDTO formDTO) {
return cityManagementDao.getSuperiorResourceInfos(formDTO); return cityManagementDao.getSuperiorResourceInfos(formDTO);
} }
@Override
public Integer getSuperiorResourceInfosCount(CoverageHomeSearchFormDTO formDTO) {
return cityManagementDao.getSuperiorResourceInfosCount(formDTO);
}
@Override @Override
public List<ResourceInfoResultDTO> getEnterpriseInfos(CoverageHomeSearchFormDTO formDTO) { public List<ResourceInfoResultDTO> getEnterpriseInfos(CoverageHomeSearchFormDTO formDTO) {
return cityManagementDao.getEnterpriseInfos(formDTO); return cityManagementDao.getEnterpriseInfos(formDTO);
} }
@Override
public Integer getEnterpriseInfosCount(CoverageHomeSearchFormDTO formDTO) {
return cityManagementDao.getEnterpriseInfosCount(formDTO);
}
@Override @Override
public ScreenAgencyOrGridListDTO getSubAgencyOrGridList(String customerId, String agencyId, Boolean isGetSubAllGrid) { public ScreenAgencyOrGridListDTO getSubAgencyOrGridList(String customerId, String agencyId, Boolean isGetSubAllGrid) {
ScreenAgencyOrGridListDTO resultDTO = new ScreenAgencyOrGridListDTO(); ScreenAgencyOrGridListDTO resultDTO = new ScreenAgencyOrGridListDTO();
@ -1530,8 +1513,8 @@ public class GovOrgServiceImpl implements GovOrgService {
} }
/** /**
* @Description 查询员工的证件号和手机号
* @param registerId * @param registerId
* @Description 查询员工的证件号和手机号
* @Author zxc * @Author zxc
* @Date 2022/10/27 14:03 * @Date 2022/10/27 14:03
*/ */
@ -1540,4 +1523,13 @@ public class GovOrgServiceImpl implements GovOrgService {
return customerAgencyDao.getEmployeeRegisterMobileAndIdCard(registerId); return customerAgencyDao.getEmployeeRegisterMobileAndIdCard(registerId);
} }
@Override
public Integer countKeyEnterprise() { //日照,统计重点单位数量
return keyEnterpriseDao.countKeyEnterprise();
}
@Override
public List<KeyEnterpriseEntity> getKeyEnterprise() {
return keyEnterpriseDao.getList();
}
} }

323
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/CoverageServiceImpl.java

@ -105,17 +105,18 @@ public class CoverageServiceImpl implements CoverageService {
/** /**
* 图层大屏数据分析数据列表 * 图层大屏数据分析数据列表
*
* @param coverageTypes 图层列表 * @param coverageTypes 图层列表
* @param categoryKeys 分类列表 * @param categoryKeys 分类列表
* @param search 搜索关键词 * @param search 搜索关键词
* @param pageNo 页码 * @param pageNo 页码
* @param pageSize 页面大小 * @param pageSize 页面大小
* @return * @return
*/ */
@Override @Override
public PageData<CoverageAnalisisDataListResultDTO> analysisDataList(String customerId,String staffId,String orgId,String orgType, public PageData<CoverageAnalisisDataListResultDTO> analysisDataList(String customerId, String staffId, String orgId, String orgType,
List<String> coverageTypes, List<String> categoryKeys, List<String> coverageTypes, List<String> categoryKeys,
String search, Integer pageNo, Integer pageSize, Boolean isPage) { String search, Integer pageNo, Integer pageSize, Boolean isPage) {
// 获取跟组织的坐标 // 获取跟组织的坐标
CustomerAgencyEntity rootAgency = govOrgService.getRootAgencyByCustomerId(customerId); CustomerAgencyEntity rootAgency = govOrgService.getRootAgencyByCustomerId(customerId);
@ -137,7 +138,7 @@ public class CoverageServiceImpl implements CoverageService {
} }
// 2.循环coverageTypes,使用key到map中查询(为了顺序),得到categoryKeys列表之后,根据实际情况做相应的查询 // 2.循环coverageTypes,使用key到map中查询(为了顺序),得到categoryKeys列表之后,根据实际情况做相应的查询
Map<String,String> agencyMap=getStaffPidsFromStaffInfo(customerId,staffId,orgId,orgType); Map<String, String> agencyMap = getStaffPidsFromStaffInfo(customerId, staffId, orgId, orgType);
String agencyPath = agencyMap.get(OrgConstant.AGENC_PATH); String agencyPath = agencyMap.get(OrgConstant.AGENC_PATH);
String agencyId = agencyMap.get(OrgConstant.AGENCY_ID); String agencyId = agencyMap.get(OrgConstant.AGENCY_ID);
@ -168,7 +169,7 @@ public class CoverageServiceImpl implements CoverageService {
for (GovOrgCoverageService.CategoryCoverageMapping e : ccm) { for (GovOrgCoverageService.CategoryCoverageMapping e : ccm) {
Integer tempCount = doDataListCount(EpmetRequestHolder.getLoginUserCustomerId(), agencyId, agencyPath, e.getPlaceType(), Integer tempCount = doDataListCount(EpmetRequestHolder.getLoginUserCustomerId(), agencyId, agencyPath, e.getPlaceType(),
e.getCategoryKey(), search,null); e.getCategoryKey(), search, null);
lastTotalCount = totalCount; lastTotalCount = totalCount;
totalCount += tempCount; totalCount += tempCount;
@ -224,6 +225,7 @@ public class CoverageServiceImpl implements CoverageService {
/** /**
* Desc: 五大图层首页搜索 * Desc: 五大图层首页搜索
*
* @param formDTO * @param formDTO
* @author zxc * @author zxc
* @date 2022/7/26 16:29 * @date 2022/7/26 16:29
@ -232,8 +234,8 @@ public class CoverageServiceImpl implements CoverageService {
public CoverageHomeSearchResultDTO coverageHomeSearch(CoverageHomeSearchFormDTO formDTO) { public CoverageHomeSearchResultDTO coverageHomeSearch(CoverageHomeSearchFormDTO formDTO) {
String customerId = formDTO.getCustomerId(); String customerId = formDTO.getCustomerId();
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(customerId, formDTO.getUserId()); CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(customerId, formDTO.getUserId());
if (null == staffInfo){ if (null == staffInfo) {
throw new EpmetException("查询工作人员失败:"+formDTO.getUserId()); throw new EpmetException("查询工作人员失败:" + formDTO.getUserId());
} }
formDTO.setOrgId(staffInfo.getAgencyId()); formDTO.setOrgId(staffInfo.getAgencyId());
CoverageHomeSearchResultDTO result = new CoverageHomeSearchResultDTO(); CoverageHomeSearchResultDTO result = new CoverageHomeSearchResultDTO();
@ -241,61 +243,61 @@ public class CoverageServiceImpl implements CoverageService {
List<GovMenuDTO> customerMenuList = govCustomerMenuRedis.getCustomerMenuList(customerId, 0, "gov_menu"); List<GovMenuDTO> customerMenuList = govCustomerMenuRedis.getCustomerMenuList(customerId, 0, "gov_menu");
// org库配置的 // org库配置的
List<String> resources = govOrgCoverageService.getAllTypeCoverageByCustomerAndType(customerId, "resources"); List<String> resources = govOrgCoverageService.getAllTypeCoverageByCustomerAndType(customerId, "resources");
if (CollectionUtils.isEmpty(resources)){ if (CollectionUtils.isEmpty(resources)) {
return result; return result;
} }
if (CollectionUtils.isEmpty(customerMenuList)){ if (CollectionUtils.isEmpty(customerMenuList)) {
return result; return result;
} }
List<String> tableMore = new ArrayList<>(); List<String> tableMore = new ArrayList<>();
customerMenuList.forEach(cm -> { customerMenuList.forEach(cm -> {
resources.forEach(r -> { resources.forEach(r -> {
if (cm.getUrl().equals(r)){ if (cm.getUrl().equals(r)) {
String tableName = MenusEnums.getValueByUrl(r); String tableName = MenusEnums.getValueByUrl(r);
if (StringUtils.isNotBlank(tableName)){ if (StringUtils.isNotBlank(tableName)) {
tableMore.add(tableName); tableMore.add(tableName);
} }
} }
}); });
}); });
List<String> tables = tableMore.stream().distinct().collect(Collectors.toList()); List<String> tables = tableMore.stream().distinct().collect(Collectors.toList());
if (CollectionUtils.isEmpty(tables)){ if (CollectionUtils.isEmpty(tables)) {
return result; return result;
} }
// 更多,查询出直接返回 // 更多,查询出直接返回
if (StringUtils.isNotBlank(formDTO.getSearchType())){ if (StringUtils.isNotBlank(formDTO.getSearchType())) {
if (formDTO.getSearchType().equals(OrgConstant.SEARCH_TYPE_USER)){ if (formDTO.getSearchType().equals(OrgConstant.SEARCH_TYPE_USER)) {
PageInfo<UserInfoResultDTO> allIcUserPageInfo = getIcUserPageInfo(formDTO); PageInfo<UserInfoResultDTO> allIcUserPageInfo = getIcUserPageInfo(formDTO);
result.setUserInfos(allIcUserPageInfo.getList()); result.setUserInfos(allIcUserPageInfo.getList());
result.setUserInfosTotal(allIcUserPageInfo.getTotal()); result.setUserInfosTotal(allIcUserPageInfo.getTotal());
return result; return result;
}else if (formDTO.getSearchType().equals(OrgConstant.SEARCH_TYPE_RESOURCE)){ } else if (formDTO.getSearchType().equals(OrgConstant.SEARCH_TYPE_RESOURCE)) {
List<ResourceInfoResultDTO> reInfos = new ArrayList<>(); List<ResourceInfoResultDTO> reInfos = new ArrayList<>();
List<CompletableFuture<List<ResourceInfoResultDTO>>> futures = new ArrayList<>(); List<CompletableFuture<List<ResourceInfoResultDTO>>> futures = new ArrayList<>();
for (String resource : resources) { for (String resource : resources) {
if (MenusEnums.IC_SUPERIOR_RESOURCE.getUrl().equals(resource)){ if (MenusEnums.IC_SUPERIOR_RESOURCE.getUrl().equals(resource)) {
CompletableFuture<List<ResourceInfoResultDTO>> c = CompletableFuture.supplyAsync(() -> govOrgService.getSuperiorResourceInfos(formDTO),executorService); CompletableFuture<List<ResourceInfoResultDTO>> c = CompletableFuture.supplyAsync(() -> govOrgService.getSuperiorResourceInfos(formDTO), executorService);
futures.add(c); futures.add(c);
}else if (MenusEnums.IC_CITY_MANAGEMENT.getUrl().equals(resource)){ } else if (MenusEnums.IC_CITY_MANAGEMENT.getUrl().equals(resource)) {
CompletableFuture<List<ResourceInfoResultDTO>> c = CompletableFuture.supplyAsync(() -> govOrgService.getCityManageInfos(formDTO),executorService); CompletableFuture<List<ResourceInfoResultDTO>> c = CompletableFuture.supplyAsync(() -> govOrgService.getCityManageInfos(formDTO), executorService);
futures.add(c); futures.add(c);
}else if (MenusEnums.IC_COMMUNITY_SELF_ORGANIZATION.getUrl().equals(resource)){ } else if (MenusEnums.IC_COMMUNITY_SELF_ORGANIZATION.getUrl().equals(resource)) {
CompletableFuture<List<ResourceInfoResultDTO>> c = CompletableFuture.supplyAsync(() -> heartService.getCommunitySelOrgInfos(formDTO),executorService); CompletableFuture<List<ResourceInfoResultDTO>> c = CompletableFuture.supplyAsync(() -> heartService.getCommunitySelOrgInfos(formDTO), executorService);
futures.add(c); futures.add(c);
}else if (MenusEnums.IC_DANGEROUS_CHEMICALS.getUrl().equals(resource)){ } else if (MenusEnums.IC_DANGEROUS_CHEMICALS.getUrl().equals(resource)) {
CompletableFuture<List<ResourceInfoResultDTO>> c = CompletableFuture.supplyAsync(() -> govOrgService.getDangerousChemicalsInfos(formDTO),executorService); CompletableFuture<List<ResourceInfoResultDTO>> c = CompletableFuture.supplyAsync(() -> govOrgService.getDangerousChemicalsInfos(formDTO), executorService);
futures.add(c); futures.add(c);
}else if (MenusEnums.IC_ENTERPRISE.getUrl().equals(resource)){ } else if (MenusEnums.IC_ENTERPRISE.getUrl().equals(resource)) {
CompletableFuture<List<ResourceInfoResultDTO>> c = CompletableFuture.supplyAsync(() -> govOrgService.getEnterpriseInfos(formDTO),executorService); CompletableFuture<List<ResourceInfoResultDTO>> c = CompletableFuture.supplyAsync(() -> govOrgService.getEnterpriseInfos(formDTO), executorService);
futures.add(c); futures.add(c);
}else if (MenusEnums.IC_PUBLIC_SERVICE.getUrl().equals(resource)){ } else if (MenusEnums.IC_PUBLIC_SERVICE.getUrl().equals(resource)) {
CompletableFuture<List<ResourceInfoResultDTO>> c = CompletableFuture.supplyAsync(() -> govOrgService.getPublicServiceInfos(formDTO),executorService); CompletableFuture<List<ResourceInfoResultDTO>> c = CompletableFuture.supplyAsync(() -> govOrgService.getPublicServiceInfos(formDTO), executorService);
futures.add(c); futures.add(c);
} }
} }
for (CompletableFuture<List<ResourceInfoResultDTO>> future : futures) { for (CompletableFuture<List<ResourceInfoResultDTO>> future : futures) {
try { try {
if (CollectionUtils.isNotEmpty(future.get())){ if (CollectionUtils.isNotEmpty(future.get())) {
reInfos.addAll(future.get()); reInfos.addAll(future.get());
} }
} catch (InterruptedException e) { } catch (InterruptedException e) {
@ -307,63 +309,63 @@ public class CoverageServiceImpl implements CoverageService {
result.setResourceInfos(reInfos); result.setResourceInfos(reInfos);
return result; return result;
} }
}else { } else {
// 查询居民 // 查询居民
PageInfo<UserInfoResultDTO> allIcUserPageInfo = getIcUserPageInfo(formDTO); PageInfo<UserInfoResultDTO> allIcUserPageInfo = getIcUserPageInfo(formDTO);
result.setUserInfos(allIcUserPageInfo.getList()); result.setUserInfos(allIcUserPageInfo.getList());
result.setUserInfosTotal(allIcUserPageInfo.getTotal()); result.setUserInfosTotal(allIcUserPageInfo.getTotal());
List<ResourceInfoResultDTO> reInfos = new ArrayList<>(); List<ResourceInfoResultDTO> reInfos = new ArrayList<>();
for (String table : tables) { for (String table : tables) {
if (formDTO.getIsPage() && reInfos.size() == formDTO.getPageSize()){ if (formDTO.getIsPage() && reInfos.size() == formDTO.getPageSize()) {
break; break;
} }
Integer flag = formDTO.getPageSize() - reInfos.size(); Integer flag = formDTO.getPageSize() - reInfos.size();
switch (table){ switch (table) {
case TableConstant.IC_SUPERIOR_RESOURCE: case TableConstant.IC_SUPERIOR_RESOURCE:
List<ResourceInfoResultDTO> superiorResourceInfos = govOrgService.getSuperiorResourceInfos(formDTO); List<ResourceInfoResultDTO> superiorResourceInfos = govOrgService.getSuperiorResourceInfos(formDTO);
if (formDTO.getIsPage() && superiorResourceInfos.size() > flag){ if (formDTO.getIsPage() && superiorResourceInfos.size() > flag) {
reInfos.addAll(superiorResourceInfos.subList(NumConstant.ZERO, flag)); reInfos.addAll(superiorResourceInfos.subList(NumConstant.ZERO, flag));
}else { } else {
reInfos.addAll(superiorResourceInfos); reInfos.addAll(superiorResourceInfos);
} }
break; break;
case TableConstant.IC_CITY_MANAGEMENT: case TableConstant.IC_CITY_MANAGEMENT:
List<ResourceInfoResultDTO> cityManageInfos = govOrgService.getCityManageInfos(formDTO); List<ResourceInfoResultDTO> cityManageInfos = govOrgService.getCityManageInfos(formDTO);
if (formDTO.getIsPage() && cityManageInfos.size() > flag){ if (formDTO.getIsPage() && cityManageInfos.size() > flag) {
reInfos.addAll(cityManageInfos.subList(NumConstant.ZERO,flag)); reInfos.addAll(cityManageInfos.subList(NumConstant.ZERO, flag));
}else { } else {
reInfos.addAll(cityManageInfos); reInfos.addAll(cityManageInfos);
} }
break; break;
case TableConstant.IC_COMMUNITY_SELF_ORGANIZATION: case TableConstant.IC_COMMUNITY_SELF_ORGANIZATION:
List<ResourceInfoResultDTO> communitySelOrgInfos = heartService.getCommunitySelOrgInfos(formDTO); List<ResourceInfoResultDTO> communitySelOrgInfos = heartService.getCommunitySelOrgInfos(formDTO);
if (formDTO.getIsPage() && communitySelOrgInfos.size() > flag){ if (formDTO.getIsPage() && communitySelOrgInfos.size() > flag) {
reInfos.addAll(communitySelOrgInfos.subList(NumConstant.ZERO,flag)); reInfos.addAll(communitySelOrgInfos.subList(NumConstant.ZERO, flag));
}else { } else {
reInfos.addAll(communitySelOrgInfos); reInfos.addAll(communitySelOrgInfos);
} }
break; break;
case TableConstant.IC_DANGEROUS_CHEMICALS: case TableConstant.IC_DANGEROUS_CHEMICALS:
List<ResourceInfoResultDTO> dangerousChemicalsInfos = govOrgService.getDangerousChemicalsInfos(formDTO); List<ResourceInfoResultDTO> dangerousChemicalsInfos = govOrgService.getDangerousChemicalsInfos(formDTO);
if (formDTO.getIsPage() && dangerousChemicalsInfos.size() > flag){ if (formDTO.getIsPage() && dangerousChemicalsInfos.size() > flag) {
reInfos.addAll(dangerousChemicalsInfos.subList(NumConstant.ZERO,flag)); reInfos.addAll(dangerousChemicalsInfos.subList(NumConstant.ZERO, flag));
}else { } else {
reInfos.addAll(dangerousChemicalsInfos); reInfos.addAll(dangerousChemicalsInfos);
} }
break; break;
case TableConstant.IC_ENTERPRISE: case TableConstant.IC_ENTERPRISE:
List<ResourceInfoResultDTO> enterpriseInfos = govOrgService.getEnterpriseInfos(formDTO); List<ResourceInfoResultDTO> enterpriseInfos = govOrgService.getEnterpriseInfos(formDTO);
if (formDTO.getIsPage() && enterpriseInfos.size() > flag){ if (formDTO.getIsPage() && enterpriseInfos.size() > flag) {
reInfos.addAll(enterpriseInfos.subList(NumConstant.ZERO,flag)); reInfos.addAll(enterpriseInfos.subList(NumConstant.ZERO, flag));
}else { } else {
reInfos.addAll(enterpriseInfos); reInfos.addAll(enterpriseInfos);
} }
break; break;
case TableConstant.IC_PUBLIC_SERVICE: case TableConstant.IC_PUBLIC_SERVICE:
List<ResourceInfoResultDTO> publicServiceInfos = govOrgService.getPublicServiceInfos(formDTO); List<ResourceInfoResultDTO> publicServiceInfos = govOrgService.getPublicServiceInfos(formDTO);
if (formDTO.getIsPage() && publicServiceInfos.size() > flag){ if (formDTO.getIsPage() && publicServiceInfos.size() > flag) {
reInfos.addAll(publicServiceInfos.subList(NumConstant.ZERO,flag)); reInfos.addAll(publicServiceInfos.subList(NumConstant.ZERO, flag));
}else { } else {
reInfos.addAll(publicServiceInfos); reInfos.addAll(publicServiceInfos);
} }
break; break;
@ -375,7 +377,7 @@ public class CoverageServiceImpl implements CoverageService {
result.setResourceInfoTotal(Long.valueOf(String.valueOf(reInfos.size()))); result.setResourceInfoTotal(Long.valueOf(String.valueOf(reInfos.size())));
} }
for (String resource : resources) { for (String resource : resources) {
if (MenusEnums.IC_EVENT.getUrl().equals(resource)){ if (MenusEnums.IC_EVENT.getUrl().equals(resource)) {
PageInfo<EventInfoResultDTO> eventPageInfo = getEventInfo(formDTO); PageInfo<EventInfoResultDTO> eventPageInfo = getEventInfo(formDTO);
result.setEventInfos(eventPageInfo.getList()); result.setEventInfos(eventPageInfo.getList());
result.setEventInfoTotal(eventPageInfo.getTotal()); result.setEventInfoTotal(eventPageInfo.getTotal());
@ -385,116 +387,28 @@ public class CoverageServiceImpl implements CoverageService {
return result; return result;
} }
/**
* Desc: 资源优势资源查询
* @param formDTO
* @author zxc
* @date 2022/7/29 08:37
*/
public PageInfo<ResourceInfoResultDTO> getSuperiorResourcePageInfo (CoverageHomeSearchFormDTO formDTO){
PageInfo<ResourceInfoResultDTO> result = new PageInfo<>();
if (formDTO.getIsPage()){
result = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()).doSelectPageInfo(() -> govOrgService.getSuperiorResourceInfos(formDTO));
}else {
List<ResourceInfoResultDTO> superiorResourceInfos = govOrgService.getSuperiorResourceInfos(formDTO);
result.setTotal(Long.valueOf(String.valueOf(superiorResourceInfos.size())));
result.setList(superiorResourceInfos);
}
return result;
}
/**
* Desc: 资源城市管理查询
* @param formDTO
* @author zxc
* @date 2022/7/29 08:37
*/
public PageInfo<ResourceInfoResultDTO> getCityManagePageInfo (CoverageHomeSearchFormDTO formDTO){
PageInfo<ResourceInfoResultDTO> result = new PageInfo<>();
if (formDTO.getIsPage()){
result = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()).doSelectPageInfo(() -> govOrgService.getCityManageInfos(formDTO));
}else {
List<ResourceInfoResultDTO> cityManageInfos = govOrgService.getCityManageInfos(formDTO);
result.setTotal(Long.valueOf(String.valueOf(cityManageInfos.size())));
result.setList(cityManageInfos);
}
return result;
}
/**
* Desc: 资源公共服务查询
* @param formDTO
* @author zxc
* @date 2022/7/29 08:37
*/
public PageInfo<ResourceInfoResultDTO> getPublicServicePageInfo (CoverageHomeSearchFormDTO formDTO){
PageInfo<ResourceInfoResultDTO> result = new PageInfo<>();
if (formDTO.getIsPage()){
result = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()).doSelectPageInfo(() -> govOrgService.getPublicServiceInfos(formDTO));
}else {
List<ResourceInfoResultDTO> publicServiceInfos = govOrgService.getPublicServiceInfos(formDTO);
result.setTotal(Long.valueOf(String.valueOf(publicServiceInfos.size())));
result.setList(publicServiceInfos);
}
return result;
}
/**
* Desc: 资源重点危化品企业查询
* @param formDTO
* @author zxc
* @date 2022/7/29 08:37
*/
public PageInfo<ResourceInfoResultDTO> getDangerousChemicalsPageInfo (CoverageHomeSearchFormDTO formDTO){
PageInfo<ResourceInfoResultDTO> result = new PageInfo<>();
if (formDTO.getIsPage()){
result = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()).doSelectPageInfo(() -> govOrgService.getDangerousChemicalsInfos(formDTO));
}else {
List<ResourceInfoResultDTO> dangerousChemicalsInfos = govOrgService.getDangerousChemicalsInfos(formDTO);
result.setTotal(Long.valueOf(String.valueOf(dangerousChemicalsInfos.size())));
result.setList(dangerousChemicalsInfos);
}
return result;
}
/**
* Desc: 资源企事业单位查询
* @param formDTO
* @author zxc
* @date 2022/7/29 08:37
*/
public PageInfo<ResourceInfoResultDTO> getEnterpriseInfosPageInfo (CoverageHomeSearchFormDTO formDTO){
PageInfo<ResourceInfoResultDTO> result = new PageInfo<>();
if (formDTO.getIsPage()){
result = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()).doSelectPageInfo(() -> govOrgService.getEnterpriseInfos(formDTO));
}else {
List<ResourceInfoResultDTO> enterpriseInfos = govOrgService.getEnterpriseInfos(formDTO);
result.setTotal(Long.valueOf(String.valueOf(enterpriseInfos.size())));
result.setList(enterpriseInfos);
}
return result;
}
/** /**
* Desc: 居民信息查询 * Desc: 居民信息查询
*
* @param formDTO * @param formDTO
* @author zxc * @author zxc
* @date 2022/7/29 08:34 * @date 2022/7/29 08:34
*/ */
public PageInfo<UserInfoResultDTO> getIcUserPageInfo (CoverageHomeSearchFormDTO formDTO){ public PageInfo<UserInfoResultDTO> getIcUserPageInfo(CoverageHomeSearchFormDTO formDTO) {
PageInfo<UserInfoResultDTO> result = new PageInfo<>(); PageInfo<UserInfoResultDTO> result = new PageInfo<>();
if (formDTO.getIsPage()){ if (formDTO.getIsPage()) {
result = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()).doSelectPageInfo(() -> icResiService.getAllIcUser(formDTO)); result = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()).doSelectPageInfo(() -> icResiService.getAllIcUser(formDTO));
}else { } else {
List<UserInfoResultDTO> allIcUser = icResiService.getAllIcUser(formDTO); List<UserInfoResultDTO> allIcUser = icResiService.getAllIcUser(formDTO);
result.setTotal(Long.valueOf(String.valueOf(allIcUser.size()))); result.setTotal(Long.valueOf(String.valueOf(allIcUser.size())));
result.setList(allIcUser); result.setList(allIcUser);
} }
if (CollectionUtils.isNotEmpty(result.getList())){ if (CollectionUtils.isNotEmpty(result.getList())) {
result.getList().forEach(r -> { result.getList().forEach(r -> {
HouseInfoCache houseInfo = CustomerIcHouseRedis.getHouseInfo(formDTO.getCustomerId(), r.getHomeId()); HouseInfoCache houseInfo = CustomerIcHouseRedis.getHouseInfo(formDTO.getCustomerId(), r.getHomeId());
if (null == houseInfo){ if (null == houseInfo) {
throw new EpmetException("获取房屋信息失败:"+r.getHomeId()); throw new EpmetException("获取房屋信息失败:" + r.getHomeId());
} }
r.setLongitude(houseInfo.getBuildingLongitude()); r.setLongitude(houseInfo.getBuildingLongitude());
r.setLatitude(houseInfo.getBuildingLatitude()); r.setLatitude(houseInfo.getBuildingLatitude());
@ -505,15 +419,16 @@ public class CoverageServiceImpl implements CoverageService {
/** /**
* Desc: 事件查询 * Desc: 事件查询
*
* @param formDTO * @param formDTO
* @author zxc * @author zxc
* @date 2022/7/28 16:03 * @date 2022/7/28 16:03
*/ */
public PageInfo<EventInfoResultDTO> getEventInfo (CoverageHomeSearchFormDTO formDTO){ public PageInfo<EventInfoResultDTO> getEventInfo(CoverageHomeSearchFormDTO formDTO) {
PageInfo<EventInfoResultDTO> result = new PageInfo<>(); PageInfo<EventInfoResultDTO> result = new PageInfo<>();
if (formDTO.getIsPage()){ if (formDTO.getIsPage()) {
result = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()).doSelectPageInfo(() -> govProjectService.getEventInfos(formDTO)); result = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()).doSelectPageInfo(() -> govProjectService.getEventInfos(formDTO));
}else { } else {
List<EventInfoResultDTO> eventInfos = govProjectService.getEventInfos(formDTO); List<EventInfoResultDTO> eventInfos = govProjectService.getEventInfos(formDTO);
result.setTotal(Long.valueOf(String.valueOf(eventInfos.size()))); result.setTotal(Long.valueOf(String.valueOf(eventInfos.size())));
result.setList(eventInfos); result.setList(eventInfos);
@ -523,6 +438,7 @@ public class CoverageServiceImpl implements CoverageService {
/** /**
* 从staff信息中获取工作人员的PIDS * 从staff信息中获取工作人员的PIDS
*
* @param staffInfo * @param staffInfo
* @return * @return
*/ */
@ -573,6 +489,7 @@ public class CoverageServiceImpl implements CoverageService {
/** /**
* 计算数据条数 * 计算数据条数
*
* @param customerId * @param customerId
* @param agencyId * @param agencyId
* @param staffOrgIds * @param staffOrgIds
@ -582,18 +499,18 @@ public class CoverageServiceImpl implements CoverageService {
* @return * @return
*/ */
public Integer doDataListCount(String customerId, String agencyId, String staffOrgIds, String placeType, public Integer doDataListCount(String customerId, String agencyId, String staffOrgIds, String placeType,
String categoryKey, String search,String gridId) { String categoryKey, String search, String gridId) {
if (CoveragePlaceTypeEnum.RESI.getCode().equals(placeType)) { if (CoveragePlaceTypeEnum.RESI.getCode().equals(placeType)) {
// 使用分类查询居民信息 // 使用分类查询居民信息
return icResiService.countResisByCategories4Coverage(customerId, agencyId, return icResiService.countResisByCategories4Coverage(customerId, agencyId,
staffOrgIds, categoryKey, search,gridId); staffOrgIds, categoryKey, search, gridId);
} else if (CoveragePlaceTypeEnum.SPECIAL_RESI.getCode().equals(placeType)) { } else if (CoveragePlaceTypeEnum.SPECIAL_RESI.getCode().equals(placeType)) {
// 特殊人群 // 特殊人群
return icResiService.countSpecialResisBySpecialType(customerId, agencyId, staffOrgIds, categoryKey, search,gridId); return icResiService.countSpecialResisBySpecialType(customerId, agencyId, staffOrgIds, categoryKey, search, gridId);
} else if (CoveragePlaceTypeEnum.EVENT.getCode().equals(placeType)) { } else if (CoveragePlaceTypeEnum.EVENT.getCode().equals(placeType)) {
// 难点痛点 // 难点痛点
return govProjectService.countIcEventEntities(customerId, staffOrgIds, search, true,gridId); return govProjectService.countIcEventEntities(customerId, staffOrgIds, search, true, gridId);
} else if (CoveragePlaceTypeEnum.CITY_MANAGEMENT.getCode().equals(placeType)) { } else if (CoveragePlaceTypeEnum.CITY_MANAGEMENT.getCode().equals(placeType)) {
// 城市资源管理 // 城市资源管理
return orgCoverageService.countCityResourceEntities(customerId, staffOrgIds, search, categoryKey); return orgCoverageService.countCityResourceEntities(customerId, staffOrgIds, search, categoryKey);
@ -612,7 +529,7 @@ public class CoverageServiceImpl implements CoverageService {
return orgCoverageService.countDangerousChemicalEntities(customerId, staffOrgIds, search, categoryKey); return orgCoverageService.countDangerousChemicalEntities(customerId, staffOrgIds, search, categoryKey);
} else if (CoveragePlaceTypeEnum.ENTERPRISE_PATROL.getCode().equals(placeType)) { } else if (CoveragePlaceTypeEnum.ENTERPRISE_PATROL.getCode().equals(placeType)) {
// 企事业单位巡查 // 企事业单位巡查
return orgCoverageService.countEnterprisePatrol(customerId, agencyId, staffOrgIds, search, categoryKey,null,null); return orgCoverageService.countEnterprisePatrol(customerId, agencyId, staffOrgIds, search, categoryKey, null, null);
} else if (CoveragePlaceTypeEnum.GROUP_RENT.getCode().equals(placeType)) { } else if (CoveragePlaceTypeEnum.GROUP_RENT.getCode().equals(placeType)) {
// 群租房。出租的房屋,住的人口超过5人属于群租房(是个规定 // 群租房。出租的房屋,住的人口超过5人属于群租房(是个规定
return orgCoverageService.countByResiNumber(customerId, staffOrgIds, search, 5, HOUSE_RENT_FLAG_RENT); return orgCoverageService.countByResiNumber(customerId, staffOrgIds, search, 5, HOUSE_RENT_FLAG_RENT);
@ -622,11 +539,11 @@ public class CoverageServiceImpl implements CoverageService {
} else if (CoveragePlaceTypeEnum.SUPERIOR_RESOURCE.getCode().equals(placeType)) { } else if (CoveragePlaceTypeEnum.SUPERIOR_RESOURCE.getCode().equals(placeType)) {
// 优势资源 // 优势资源
return orgCoverageService.countSuporiorResourceEntities(customerId, staffOrgIds, search, categoryKey); return orgCoverageService.countSuporiorResourceEntities(customerId, staffOrgIds, search, categoryKey);
} else if(CoveragePlaceTypeEnum.ENTERPRISE_PATROL_UNQUALIFIED.getCode().equals(placeType)){ } else if (CoveragePlaceTypeEnum.ENTERPRISE_PATROL_UNQUALIFIED.getCode().equals(placeType)) {
// 企事业单位巡查 // 企事业单位巡查
// 最新巡查结果【0:合格 1:不合格】 // 最新巡查结果【0:合格 1:不合格】
// 左侧用,可以到网格, // 左侧用,可以到网格,
return orgCoverageService.countEnterprisePatrol(customerId, agencyId, staffOrgIds, search, categoryKey,NumConstant.ONE_STR,gridId); return orgCoverageService.countEnterprisePatrol(customerId, agencyId, staffOrgIds, search, categoryKey, NumConstant.ONE_STR, gridId);
} else if (CoveragePlaceTypeEnum.VOLUNTEER.getCode().equals(placeType)) { } else if (CoveragePlaceTypeEnum.VOLUNTEER.getCode().equals(placeType)) {
// 志愿者 // 志愿者
String[] parts = categoryKey.split("_"); String[] parts = categoryKey.split("_");
@ -634,9 +551,11 @@ public class CoverageServiceImpl implements CoverageService {
} else if (CoveragePlaceTypeEnum.VACCINE_POINT.getCode().equals(placeType)) { } else if (CoveragePlaceTypeEnum.VACCINE_POINT.getCode().equals(placeType)) {
// 疫苗接种点 // 疫苗接种点
return epmetUserService.countVaccinePoint(customerId, agencyId, staffOrgIds, search); return epmetUserService.countVaccinePoint(customerId, agencyId, staffOrgIds, search);
} else if (CoveragePlaceTypeEnum.NUCLEIC_POINT.getCode().equals(placeType)) { } else if (CoveragePlaceTypeEnum.NUCLEIC_POINT.getCode().equals(placeType)) {
// 核酸检测点 // 核酸检测点
return epmetUserService.countNucleicPoint(customerId, agencyId, staffOrgIds, search); return epmetUserService.countNucleicPoint(customerId, agencyId, staffOrgIds, search);
} else if (CoveragePlaceTypeEnum.KEY_UNIT.getCode().equals(placeType)) {
return govOrgService.countKeyEnterprise();//重点单位数量统计 日照专用
} }
return 0; return 0;
@ -644,17 +563,18 @@ public class CoverageServiceImpl implements CoverageService {
/** /**
* 执行数据查询 * 执行数据查询
*
* @param customerId * @param customerId
* @param agencyId 查询的工作人员所在组织id * @param agencyId 查询的工作人员所在组织id
* @param staffOrgIds 查询的工作人员所在组织的id path包含agencyId * @param staffOrgIds 查询的工作人员所在组织的id path包含agencyId
* @param placeType 场所类型 * @param placeType 场所类型
* @param categoryKey 类别key * @param categoryKey 类别key
* @param search 关键词 * @param search 关键词
* @return * @return
*/ */
public List<CoverageAnalisisDataListResultDTO> doDataListSearch(String customerId, String agencyId, String staffOrgIds, public List<CoverageAnalisisDataListResultDTO> doDataListSearch(String customerId, String agencyId, String staffOrgIds,
String placeType, String categoryKey, String search, String placeType, String categoryKey, String search,
Integer pageNo, Integer pageSize,Boolean isPage, Integer pageNo, Integer pageSize, Boolean isPage,
CustomerAgencyEntity rootAgency) { CustomerAgencyEntity rootAgency) {
// 根据categoryKey查询类别名称 // 根据categoryKey查询类别名称
@ -747,7 +667,7 @@ public class CoverageServiceImpl implements CoverageService {
} else if (CoveragePlaceTypeEnum.ENTERPRISE_PATROL.getCode().equals(placeType)) { } else if (CoveragePlaceTypeEnum.ENTERPRISE_PATROL.getCode().equals(placeType)) {
// 企事业单位巡查 // 企事业单位巡查
List<IcEnterisePatrolResultDTO> list = orgCoverageService.listEnterprisePatrol( List<IcEnterisePatrolResultDTO> list = orgCoverageService.listEnterprisePatrol(
customerId, agencyId, staffOrgIds, search, categoryKey, isPage, pageNo, pageSize,null); customerId, agencyId, staffOrgIds, search, categoryKey, isPage, pageNo, pageSize, null);
return list.stream() return list.stream()
.map(dc -> new CoverageAnalisisDataListResultDTO(dc.getEnterpriseId(), categoryKey, .map(dc -> new CoverageAnalisisDataListResultDTO(dc.getEnterpriseId(), categoryKey,
@ -788,14 +708,14 @@ public class CoverageServiceImpl implements CoverageService {
.map(dc -> new CoverageAnalisisDataListResultDTO(dc.getId(), categoryKey, .map(dc -> new CoverageAnalisisDataListResultDTO(dc.getId(), categoryKey,
isPage ? categoryDict.getCategoryName() : null, placeType, isPage ? dc.getName() : null, dc.getLatitude(), dc.getLongitude())) isPage ? categoryDict.getCategoryName() : null, placeType, isPage ? dc.getName() : null, dc.getLatitude(), dc.getLongitude()))
.collect(Collectors.toList()); .collect(Collectors.toList());
} else if(CoveragePlaceTypeEnum.ENTERPRISE_PATROL_UNQUALIFIED.getCode().equals(placeType)){ } else if (CoveragePlaceTypeEnum.ENTERPRISE_PATROL_UNQUALIFIED.getCode().equals(placeType)) {
//最新巡查结果【0:合格 1:不合格】 //最新巡查结果【0:合格 1:不合格】
List<IcEnterisePatrolResultDTO> list = orgCoverageService.listEnterprisePatrol( List<IcEnterisePatrolResultDTO> list = orgCoverageService.listEnterprisePatrol(
customerId, agencyId, staffOrgIds, search, categoryKey, isPage, pageNo, pageSize,NumConstant.ONE_STR); customerId, agencyId, staffOrgIds, search, categoryKey, isPage, pageNo, pageSize, NumConstant.ONE_STR);
return list.stream() return list.stream()
.map(dc -> new CoverageAnalisisDataListResultDTO(dc.getEnterpriseId(), categoryKey, .map(dc -> new CoverageAnalisisDataListResultDTO(dc.getEnterpriseId(), categoryKey,
isPage ? categoryDict.getCategoryName() : null, placeType, dc.getPlaceOrgName() , isPage ? categoryDict.getCategoryName() : null, placeType, dc.getPlaceOrgName(),
StringUtils.isNotBlank(dc.getLatitude()) ? dc.getLatitude() : rootAgency.getLatitude(), StringUtils.isNotBlank(dc.getLatitude()) ? dc.getLatitude() : rootAgency.getLatitude(),
StringUtils.isNotBlank(dc.getLongitude()) ? dc.getLongitude() : rootAgency.getLongitude())) StringUtils.isNotBlank(dc.getLongitude()) ? dc.getLongitude() : rootAgency.getLongitude()))
.collect(Collectors.toList()); .collect(Collectors.toList());
@ -821,19 +741,26 @@ public class CoverageServiceImpl implements CoverageService {
.map(vp -> new CoverageAnalisisDataListResultDTO(vp.getId(), categoryKey, isPage ? categoryDict.getCategoryName() : null, .map(vp -> new CoverageAnalisisDataListResultDTO(vp.getId(), categoryKey, isPage ? categoryDict.getCategoryName() : null,
placeType, vp.getName(), vp.getLatitude(), vp.getLongitude())) placeType, vp.getName(), vp.getLatitude(), vp.getLongitude()))
.collect(Collectors.toList()); .collect(Collectors.toList());
} else if (CoveragePlaceTypeEnum.NUCLEIC_POINT.getCode().equals(placeType)) { } else if (CoveragePlaceTypeEnum.NUCLEIC_POINT.getCode().equals(placeType)) {
// 核酸检测点 // 核酸检测点
List<IcPointNucleicMonitoringEntity> nps = epmetUserService.listNucleicPoints(customerId, agencyId, staffOrgIds, search); List<IcPointNucleicMonitoringEntity> nps = epmetUserService.listNucleicPoints(customerId, agencyId, staffOrgIds, search);
return nps.stream() return nps.stream()
.map(np -> new CoverageAnalisisDataListResultDTO(np.getId(), categoryKey, isPage ? categoryDict.getCategoryName() : null, .map(np -> new CoverageAnalisisDataListResultDTO(np.getId(), categoryKey, isPage ? categoryDict.getCategoryName() : null,
placeType, np.getName(), np.getLatitude(), np.getLongitude())) placeType, np.getName(), np.getLatitude(), np.getLongitude()))
.collect(Collectors.toList()); .collect(Collectors.toList());
} else if (CoveragePlaceTypeEnum.KEY_UNIT.getCode().equals(placeType)) {
List<KeyEnterpriseEntity> enterpriseList = govOrgService.getKeyEnterprise();
if (null != enterpriseList && enterpriseList.size() > 0) {
return enterpriseList.stream().map(enter -> new CoverageAnalisisDataListResultDTO(enter.getId(),
categoryKey, isPage ? categoryDict.getCategoryName() : null, placeType, enter.getUnitName(), enter.getLatitude(), enter.getLongitude())).collect(Collectors.toList());
}
} }
return new ArrayList<>(); return new ArrayList<>();
} }
/** /**
* 获取用户的坐标信息 * 获取用户的坐标信息
*
* @param resiId * @param resiId
* @param buildingId * @param buildingId
* @param rootAgency 跟组织用于备选从其中获取坐标 * @param rootAgency 跟组织用于备选从其中获取坐标
@ -861,6 +788,7 @@ public class CoverageServiceImpl implements CoverageService {
/** /**
* 五大图层-可视化-右侧分类树列表 * 五大图层-可视化-右侧分类树列表
*
* @return * @return
*/ */
@Override @Override
@ -932,7 +860,7 @@ public class CoverageServiceImpl implements CoverageService {
String customerId = EpmetRequestHolder.getLoginUserCustomerId(); String customerId = EpmetRequestHolder.getLoginUserCustomerId();
String userId = EpmetRequestHolder.getLoginUserId(); String userId = EpmetRequestHolder.getLoginUserId();
Map<String,String> stafInfoMap=getStaffPidsFromStaffInfo(customerId, userId, agencyId,OrgConstant.AGENCY); Map<String, String> stafInfoMap = getStaffPidsFromStaffInfo(customerId, userId, agencyId, OrgConstant.AGENCY);
String staffOrgPath = stafInfoMap.get(OrgConstant.AGENC_PATH); String staffOrgPath = stafInfoMap.get(OrgConstant.AGENC_PATH);
// 填充数量quantity字段 // 填充数量quantity字段
@ -978,8 +906,8 @@ public class CoverageServiceImpl implements CoverageService {
private void fillQuantities4ResourcesCategories(AnalysisResourceCategoriesResult coverage, private void fillQuantities4ResourcesCategories(AnalysisResourceCategoriesResult coverage,
AnalysisResourceCategoriesResult.PlaceType placeType, AnalysisResourceCategoriesResult.PlaceType placeType,
List<AnalysisResourceCategoriesResult.Category> categories, List<AnalysisResourceCategoriesResult.Category> categories,
String customerId, String agencyId, String staffOrgIds) { String customerId, String agencyId, String staffOrgIds) {
AtomicInteger total = new AtomicInteger(); AtomicInteger total = new AtomicInteger();
@ -1064,7 +992,7 @@ public class CoverageServiceImpl implements CoverageService {
String customerId = EpmetRequestHolder.getLoginUserCustomerId(); String customerId = EpmetRequestHolder.getLoginUserCustomerId();
String staffId = EpmetRequestHolder.getLoginUserId(); String staffId = EpmetRequestHolder.getLoginUserId();
Map<String,String> agencyMap=getStaffPidsFromStaffInfo(customerId,staffId,agencyId,OrgConstant.AGENCY); Map<String, String> agencyMap = getStaffPidsFromStaffInfo(customerId, staffId, agencyId, OrgConstant.AGENCY);
String agencyPath = agencyMap.get(OrgConstant.AGENC_PATH); String agencyPath = agencyMap.get(OrgConstant.AGENC_PATH);
// 再最后,多线程setQuantity // 再最后,多线程setQuantity
@ -1075,6 +1003,7 @@ public class CoverageServiceImpl implements CoverageService {
/** /**
* 填充数量接收参数为多个placeType(对应左侧菜单的所有一级) * 填充数量接收参数为多个placeType(对应左侧菜单的所有一级)
*
* @param results * @param results
*/ */
private void fillQuantities4GovernedTarges(List<AnalysisGovernedTargetsResult> results, String customerId, String agencyId, String staffOrgIds) { private void fillQuantities4GovernedTarges(List<AnalysisGovernedTargetsResult> results, String customerId, String agencyId, String staffOrgIds) {
@ -1103,6 +1032,7 @@ public class CoverageServiceImpl implements CoverageService {
/** /**
* 填充数量接收参数为左侧单个placeType * 填充数量接收参数为左侧单个placeType
*
* @param targetsOfOnePlaceType * @param targetsOfOnePlaceType
* @param customerId * @param customerId
* @param agencyId * @param agencyId
@ -1132,7 +1062,6 @@ public class CoverageServiceImpl implements CoverageService {
} }
/** /**
* 五大图层左侧菜单点击事件查询人.事的分布 * 五大图层左侧菜单点击事件查询人.事的分布
* *
@ -1150,7 +1079,7 @@ public class CoverageServiceImpl implements CoverageService {
); );
List<CoverageAnalisisDataListResultDTOV2> list = new ArrayList<>(); List<CoverageAnalisisDataListResultDTOV2> list = new ArrayList<>();
if (CollectionUtils.isNotEmpty(page.getList())) { if (CollectionUtils.isNotEmpty(page.getList())) {
Map<String, List<CoverageAnalisisDataListResultDTO>> group = page.getList().stream().collect(Collectors.groupingBy(x->Optional.ofNullable(x.getLongLat()).orElse("O"))); Map<String, List<CoverageAnalisisDataListResultDTO>> group = page.getList().stream().collect(Collectors.groupingBy(x -> Optional.ofNullable(x.getLongLat()).orElse("O")));
if (MapUtils.isNotEmpty(group)) { if (MapUtils.isNotEmpty(group)) {
for (Map.Entry<String, List<CoverageAnalisisDataListResultDTO>> entry : group.entrySet()) { for (Map.Entry<String, List<CoverageAnalisisDataListResultDTO>> entry : group.entrySet()) {
@ -1175,16 +1104,16 @@ public class CoverageServiceImpl implements CoverageService {
CoverageHomeSearchFormDTO dto = ConvertUtils.sourceToTarget(formDTO, CoverageHomeSearchFormDTO.class); CoverageHomeSearchFormDTO dto = ConvertUtils.sourceToTarget(formDTO, CoverageHomeSearchFormDTO.class);
UserInfoResultDTO result = new UserInfoResultDTO(); UserInfoResultDTO result = new UserInfoResultDTO();
List<UserInfoResultDTO> allIcUser = icResiService.getAllIcUser(dto); List<UserInfoResultDTO> allIcUser = icResiService.getAllIcUser(dto);
if (CollectionUtils.isNotEmpty(allIcUser)){ if (CollectionUtils.isNotEmpty(allIcUser)) {
result = allIcUser.get(NumConstant.ZERO); result = allIcUser.get(NumConstant.ZERO);
GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(result.getGridId()); GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(result.getGridId());
if (null == gridInfo){ if (null == gridInfo) {
throw new EpmetException("获取网格信息失败:"+result.getGridId()); throw new EpmetException("获取网格信息失败:" + result.getGridId());
} }
result.setGridName(gridInfo.getGridNamePath()); result.setGridName(gridInfo.getGridNamePath());
HouseInfoCache houseInfo = CustomerIcHouseRedis.getHouseInfo(formDTO.getCustomerId(), result.getHomeId()); HouseInfoCache houseInfo = CustomerIcHouseRedis.getHouseInfo(formDTO.getCustomerId(), result.getHomeId());
if (null == houseInfo){ if (null == houseInfo) {
throw new EpmetException("获取房屋信息失败:"+result.getHomeId()); throw new EpmetException("获取房屋信息失败:" + result.getHomeId());
} }
result.setHouseName(houseInfo.getAllName()); result.setHouseName(houseInfo.getAllName());
result.setLongitude(houseInfo.getBuildingLongitude()); result.setLongitude(houseInfo.getBuildingLongitude());
@ -1198,11 +1127,11 @@ public class CoverageServiceImpl implements CoverageService {
CoverageHomeSearchFormDTO dto = ConvertUtils.sourceToTarget(formDTO, CoverageHomeSearchFormDTO.class); CoverageHomeSearchFormDTO dto = ConvertUtils.sourceToTarget(formDTO, CoverageHomeSearchFormDTO.class);
EventInfoResultDTO result = new EventInfoResultDTO(); EventInfoResultDTO result = new EventInfoResultDTO();
List<EventInfoResultDTO> eventInfos = govProjectService.getEventInfos(dto); List<EventInfoResultDTO> eventInfos = govProjectService.getEventInfos(dto);
if (CollectionUtils.isNotEmpty(eventInfos)){ if (CollectionUtils.isNotEmpty(eventInfos)) {
result = eventInfos.get(NumConstant.ZERO); result = eventInfos.get(NumConstant.ZERO);
GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(result.getGridId()); GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(result.getGridId());
if (null == gridInfo){ if (null == gridInfo) {
throw new EpmetException("获取网格信息失败:"+result.getGridId()); throw new EpmetException("获取网格信息失败:" + result.getGridId());
} }
result.setGridName(gridInfo.getGridNamePath()); result.setGridName(gridInfo.getGridNamePath());
} }
@ -1214,7 +1143,7 @@ public class CoverageServiceImpl implements CoverageService {
CoverageHomeSearchFormDTO dto = ConvertUtils.sourceToTarget(formDTO, CoverageHomeSearchFormDTO.class); CoverageHomeSearchFormDTO dto = ConvertUtils.sourceToTarget(formDTO, CoverageHomeSearchFormDTO.class);
ResourceInfoResultDTO result = new ResourceInfoResultDTO(); ResourceInfoResultDTO result = new ResourceInfoResultDTO();
List<ResourceInfoResultDTO> infos = new ArrayList<>(); List<ResourceInfoResultDTO> infos = new ArrayList<>();
switch (formDTO.getResourceType()){ switch (formDTO.getResourceType()) {
case "community_org": case "community_org":
infos = heartService.getCommunitySelOrgInfos(dto); infos = heartService.getCommunitySelOrgInfos(dto);
break; break;
@ -1236,7 +1165,7 @@ public class CoverageServiceImpl implements CoverageService {
default: default:
break; break;
} }
if (CollectionUtils.isNotEmpty(infos)){ if (CollectionUtils.isNotEmpty(infos)) {
result = infos.get(NumConstant.ZERO); result = infos.get(NumConstant.ZERO);
} }
return result; return result;
@ -1250,26 +1179,26 @@ public class CoverageServiceImpl implements CoverageService {
*/ */
@Override @Override
public List<DataListLeftSubTotalResDTO> dataListLeftSubTotal(DataListLeftSubTotalFormDTO formDTO) { public List<DataListLeftSubTotalResDTO> dataListLeftSubTotal(DataListLeftSubTotalFormDTO formDTO) {
List<DataListLeftSubTotalResDTO> resultList=new ArrayList<>(); List<DataListLeftSubTotalResDTO> resultList = new ArrayList<>();
List<OrgInfoCommonDTO> list = SpringContextUtils.getBean(GovOrgService.class).queryNextOrgInfoDTO(formDTO.getCustomerId(), formDTO.getOrgId()); List<OrgInfoCommonDTO> list = SpringContextUtils.getBean(GovOrgService.class).queryNextOrgInfoDTO(formDTO.getCustomerId(), formDTO.getOrgId());
if(CollectionUtils.isNotEmpty(list)){ if (CollectionUtils.isNotEmpty(list)) {
resultList=ConvertUtils.sourceToTarget(list,DataListLeftSubTotalResDTO.class); resultList = ConvertUtils.sourceToTarget(list, DataListLeftSubTotalResDTO.class);
for(DataListLeftSubTotalResDTO orgRes:resultList){ for (DataListLeftSubTotalResDTO orgRes : resultList) {
String gridId=StrConstant.EPMETY_STR; String gridId = StrConstant.EPMETY_STR;
String agencyId=StrConstant.EPMETY_STR; String agencyId = StrConstant.EPMETY_STR;
String orgIdPath=StrConstant.EPMETY_STR; String orgIdPath = StrConstant.EPMETY_STR;
if(OrgConstant.AGENCY.equals(orgRes.getOrgType())){ if (OrgConstant.AGENCY.equals(orgRes.getOrgType())) {
agencyId=orgRes.getOrgId(); agencyId = orgRes.getOrgId();
AgencyInfoCache agencyInfoCache=CustomerOrgRedis.getAgencyInfo(orgRes.getOrgId()); AgencyInfoCache agencyInfoCache = CustomerOrgRedis.getAgencyInfo(orgRes.getOrgId());
if (StringUtils.isNotBlank(agencyInfoCache.getPids()) && !"0".equals(agencyInfoCache.getPids()) && !"0".equals(agencyInfoCache)) { if (StringUtils.isNotBlank(agencyInfoCache.getPids()) && !"0".equals(agencyInfoCache.getPids()) && !"0".equals(agencyInfoCache)) {
orgIdPath = agencyInfoCache.getPids().concat(":").concat(agencyId); orgIdPath = agencyInfoCache.getPids().concat(":").concat(agencyId);
} else { } else {
orgIdPath = agencyId; orgIdPath = agencyId;
} }
}else{ } else {
gridId=orgRes.getOrgId(); gridId = orgRes.getOrgId();
GridInfoCache gridInfoCache=CustomerOrgRedis.getGridInfo(orgRes.getOrgId()); GridInfoCache gridInfoCache = CustomerOrgRedis.getGridInfo(orgRes.getOrgId());
orgIdPath=gridInfoCache.getPids(); orgIdPath = gridInfoCache.getPids();
} }
int count = doDataListCount(formDTO.getCustomerId(), agencyId, orgIdPath, formDTO.getPlaceType(), formDTO.getCategoryKey(), null, gridId); int count = doDataListCount(formDTO.getCustomerId(), agencyId, orgIdPath, formDTO.getPlaceType(), formDTO.getCategoryKey(), null, gridId);
orgRes.setTotal(count); orgRes.setTotal(count);

24
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/KeyEnterpriseDao.xml

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dataaggre.dao.govorg.KeyEnterpriseDao">
<select id="countKeyEnterprise" resultType="java.lang.Integer">
select count(id) from key_enterprise where DEL_FLAG = 0
</select>
<select id="getList" resultType="com.epmet.dataaggre.entity.govorg.KeyEnterpriseEntity">
SELECT
ke.ID,
ke.UNIT_NAME,
ke.UNIT_TYPE,
ke.BUSINESS,
ke.LEGAL_PERSON,
ke.MOBILE,
ke.ADDRESS,
ke.LONGITUDE,
ke.LATITUDE
FROM key_enterprise ke
<where>
ke.DEL_FLAG = 0
</where>
</select>
</mapper>
Loading…
Cancel
Save