diff --git a/yudao-module-fta/yudao-module-fta-biz/src/main/java/cn/iocoder/yudao/module/fta/controller/admin/enterpriseinformation/EnterpriseInformationController.java b/yudao-module-fta/yudao-module-fta-biz/src/main/java/cn/iocoder/yudao/module/fta/controller/admin/enterpriseinformation/EnterpriseInformationController.java index 03bb43b..1581817 100644 --- a/yudao-module-fta/yudao-module-fta-biz/src/main/java/cn/iocoder/yudao/module/fta/controller/admin/enterpriseinformation/EnterpriseInformationController.java +++ b/yudao-module-fta/yudao-module-fta-biz/src/main/java/cn/iocoder/yudao/module/fta/controller/admin/enterpriseinformation/EnterpriseInformationController.java @@ -103,8 +103,8 @@ public class EnterpriseInformationController { } @GetMapping("/statisticByEnterpriseType") @Operation(summary = "根据企业类型统计企业数据") - public CommonResult> statisticByEnterpriseType(){ - Map integerLongMap = enterpriseInformationService.statisticByEnterpriseType(); + public CommonResult> statisticByEnterpriseType(){ + List integerLongMap = enterpriseInformationService.statisticByEnterpriseType(); return success(integerLongMap); } @GetMapping("/selectEnterpriseByYear") diff --git a/yudao-module-fta/yudao-module-fta-biz/src/main/java/cn/iocoder/yudao/module/fta/service/enterpriseinformation/EnterpriseInformationService.java b/yudao-module-fta/yudao-module-fta-biz/src/main/java/cn/iocoder/yudao/module/fta/service/enterpriseinformation/EnterpriseInformationService.java index a4dd92a..44609be 100644 --- a/yudao-module-fta/yudao-module-fta-biz/src/main/java/cn/iocoder/yudao/module/fta/service/enterpriseinformation/EnterpriseInformationService.java +++ b/yudao-module-fta/yudao-module-fta-biz/src/main/java/cn/iocoder/yudao/module/fta/service/enterpriseinformation/EnterpriseInformationService.java @@ -83,7 +83,7 @@ public interface EnterpriseInformationService { * 根据企业类型统计企业数据 * @return */ - Map statisticByEnterpriseType(); + List statisticByEnterpriseType(); /** * 查询平台企业年度注册数 diff --git a/yudao-module-fta/yudao-module-fta-biz/src/main/java/cn/iocoder/yudao/module/fta/service/enterpriseinformation/EnterpriseInformationServiceImpl.java b/yudao-module-fta/yudao-module-fta-biz/src/main/java/cn/iocoder/yudao/module/fta/service/enterpriseinformation/EnterpriseInformationServiceImpl.java index 915f717..f8616a4 100644 --- a/yudao-module-fta/yudao-module-fta-biz/src/main/java/cn/iocoder/yudao/module/fta/service/enterpriseinformation/EnterpriseInformationServiceImpl.java +++ b/yudao-module-fta/yudao-module-fta-biz/src/main/java/cn/iocoder/yudao/module/fta/service/enterpriseinformation/EnterpriseInformationServiceImpl.java @@ -243,10 +243,28 @@ public class EnterpriseInformationServiceImpl implements EnterpriseInformationSe * @return */ @Override - public Map statisticByEnterpriseType() { + public List statisticByEnterpriseType() { List enterpriseInformationDOS = enterpriseInformationMapper.selectList(); - Map enterpriseTypeCounts = enterpriseInformationDOS.stream().collect(Collectors.groupingBy(EnterpriseInformationDO::getEnterpriseType, Collectors.counting())); - return enterpriseTypeCounts; + Map enterpriseTypeCounts = enterpriseInformationDOS.stream() + .collect(Collectors.groupingBy(EnterpriseInformationDO::getEnterpriseType, Collectors.counting())); + List list = new ArrayList<>(); + + StatisticsResultData greatEnterprise = new StatisticsResultData(); + greatEnterprise.setName("analysis.greatEnterprise"); + greatEnterprise.setValue(enterpriseTypeCounts.get(3));//大型企业 + + StatisticsResultData centreEnterprise = new StatisticsResultData(); + centreEnterprise.setName("analysis.centreEnterprise"); + centreEnterprise.setValue(enterpriseTypeCounts.get(2));//中型企业 + + StatisticsResultData smallEnterprise = new StatisticsResultData(); + smallEnterprise.setName("analysis.smallEnterprise"); + smallEnterprise.setValue(enterpriseTypeCounts.get(1));//小型企业 + + list.add(greatEnterprise); + list.add(centreEnterprise); + list.add(smallEnterprise); + return list; } /**