diff --git a/epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.9__add_data_type.sql b/epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.9__add_data_type.sql new file mode 100644 index 0000000000..d4aebf1828 --- /dev/null +++ b/epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.9__add_data_type.sql @@ -0,0 +1,10 @@ +INSERT INTO `epmet_admin`.`sys_dict_type` (`id`, `dict_type`, `dict_name`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1000000000000000012', 'grid_type', '网格类型', '', 12, 0, 0, '', '2021-12-23 18:23:27', '', '2021-12-23 18:23:27'); + +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1000000000000000300', 1000000000000000012, '党政机关', '0', '0', '', 0, 0, 0, '', '2021-12-23 18:39:18', '', '2021-12-23 18:39:18'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1000000000000000301', 1000000000000000012, '企业', '1', '0', '', 0, 0, 0, '', '2021-12-23 18:39:18', '', '2021-12-23 18:39:18'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1000000000000000302', 1000000000000000012, '园区', '2', '0', '', 4, 0, 0, '', '2021-12-23 18:39:18', '', '2021-12-23 18:39:18'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1000000000000000303', 1000000000000000012, '商圈', '3', '0', '', 4, 0, 0, '', '2021-12-23 18:39:18', '', '2021-12-23 18:39:18'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1000000000000000304', 1000000000000000012, '市场', '4', '0', '', 4, 0, 0, '', '2021-12-23 18:39:18', '', '2021-12-23 18:39:18'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1000000000000000305', 1000000000000000012, '景区', '5', '0', '', 4, 0, 0, '', '2021-12-23 18:39:18', '', '2021-12-23 18:39:18'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1000000000000000306', 1000000000000000012, '医院', '6', '0', '', 4, 0, 0, '', '2021-12-23 18:39:18', '', '2021-12-23 18:39:18'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1000000000000000307', 1000000000000000012, '学校', '7', '0', '', 4, 0, 0, '', '2021-12-23 18:39:18', '', '2021-12-23 18:39:18'); diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java index 116b3c47a5..67391ef70c 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java @@ -96,6 +96,7 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl list = baseDao.selectList(wrapper); + PageInfo pageInfo = new PageInfo<>(list); List dtoList = ConvertUtils.sourceToTarget(list, IcPartyActivityDTO.class); IcPartyUnitDTO unitDTO = new IcPartyUnitDTO(); @@ -106,7 +107,7 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl pageInfo = new PageInfo<>(dtoList); + return new PageData<>(dtoList, pageInfo.getTotal()); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java index 2370562d4b..3850acd354 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java @@ -101,6 +101,7 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl list = baseDao.selectList(wrapper); + PageInfo pageInfo = new PageInfo<>(list); List dtoList = ConvertUtils.sourceToTarget(list, IcPartyUnitDTO.class); Result> unitTypeMap = epmetAdminOpenFeignClient.dictMap(DictTypeEnum.PARTY_UNIT_TYPE.getCode()); SubCodeFormDTO codeFormDTO = new SubCodeFormDTO(); @@ -121,7 +122,6 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl pageInfo = new PageInfo<>(dtoList); return new PageData<>(dtoList, pageInfo.getTotal()); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java index ee7f66bc8a..ec787bcf1e 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java @@ -99,7 +99,6 @@ public class VolunteerInfoServiceImpl extends BaseServiceImpl { * @author zxc * @date 2021/12/10 10:31 上午 */ - List selectProjectCountByOrg(@Param("orgIds")List orgIds,@Param("startDate")String startDate,@Param("endDate")String endDate); + List selectProjectCountByOrg(List orgIds,@Param("startDate")String startDate,@Param("endDate")String endDate); } \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java index 69d14d5723..8547a254b7 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java @@ -2918,26 +2918,31 @@ public class ProjectServiceImpl extends BaseServiceImpl orgList = new ArrayList<>(); Result> sonOrgList = govOrgOpenFeignClient.getSonAgencyId(formDTO.getOrgId(), agencyInfo.getLevel()); - if (!sonOrgList.success() || CollectionUtils.isEmpty(sonOrgList.getData())){ - throw new EpmetException(String.format("查询组织{%s}的下级组织失败或为空...",formDTO.getOrgId())); + if (!sonOrgList.success()){ + throw new EpmetException(String.format("查询组织{%s}的下级组织失败...",formDTO.getOrgId())); } + if (CollectionUtils.isEmpty(sonOrgList.getData())){ + return result; + } + // 所有子级orgId,并构建全部数据 List orgIds = sonOrgList.getData(); + for (SonOrgResultDTO o : orgIds) { + ProjectDistributionAnalysisRightDTO dto = new ProjectDistributionAnalysisRightDTO(); + dto.setOrgId(o.getOrgId()); + orgList.add(dto); + } + List dtos; if (!agencyInfo.getLevel().equals(ProjectConstant.ORG_LEVEL_COMMUNITY)){ - orgList = baseDao.selectProjectCountByOrg(orgIds.stream().map(m -> m.getPids()).collect(Collectors.toList()), formDTO.getStartDate(),formDTO.getEndDate()); + dtos = baseDao.selectProjectCountByOrg(orgIds, formDTO.getStartDate(),formDTO.getEndDate()); }else { - for (SonOrgResultDTO o : orgIds) { - ProjectDistributionAnalysisRightDTO dto = new ProjectDistributionAnalysisRightDTO(); - dto.setOrgId(o.getOrgId()); - orgList.add(dto); - } Result> projectCountByGrid = govIssueOpenFeignClient.getProjectCountByGrid(formDTO); if (!projectCountByGrid.success()){ throw new EpmetException("查询网格项目数失败..."); } - if (CollectionUtils.isNotEmpty(projectCountByGrid.getData())){ - orgList.stream().forEach(o -> projectCountByGrid.getData().stream().filter(p -> p.getOrgId().equals(o.getOrgId())).forEach(p -> o.setCount(p.getCount()))); - - } + dtos = projectCountByGrid.getData(); + } + if (CollectionUtils.isNotEmpty(dtos)){ + orgList.stream().forEach(o -> dtos.stream().filter(p -> p.getOrgId().equals(o.getOrgId())).forEach(p -> o.setCount(p.getCount()))); } if (CollectionUtils.isEmpty(orgList)){ return result; diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml index 30fd6d415c..c21670f5a5 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml @@ -470,13 +470,13 @@