From 11a80dd98508b84f623da66a04bf08c02f10b543 Mon Sep 17 00:00:00 2001 From: lc <15038716315@163.com> Date: Fri, 21 Jun 2024 17:18:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=81=E4=B8=9A=E4=BF=A1=E6=81=AF=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=20=E6=A0=B9=E6=8D=AE=E4=BC=81=E4=B8=9A=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E7=BB=9F=E8=AE=A1=E4=BC=81=E4=B8=9A=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E8=BF=94=E5=9B=9E=E6=A0=BC=E5=BC=8F=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../EnterpriseInformationController.java | 4 ++-- .../EnterpriseInformationService.java | 2 +- .../EnterpriseInformationServiceImpl.java | 24 ++++++++++++++++--- 3 files changed, 24 insertions(+), 6 deletions(-) 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; } /**