From c1aa4004451121b4e5149ee599ae7dfc957fb754 Mon Sep 17 00:00:00 2001 From: lc <15038716315@163.com> Date: Thu, 20 Jun 2024 14:17: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=E5=AE=A1=E6=A0=B8=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E7=BB=9F=E8=AE=A1=E4=BC=81=E4=B8=9A=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../EnterpriseInformationController.java | 7 +++++++ .../EnterpriseInformationService.java | 6 ++++++ .../EnterpriseInformationServiceImpl.java | 11 +++++++++++ 3 files changed, 24 insertions(+) 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 6b8cd17..f331d93 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 @@ -126,4 +126,11 @@ public class EnterpriseInformationController { Map stringLongMap = enterpriseInformationService.selectEnterpriseByMonth(); return success(stringLongMap); } + + @GetMapping("/statisticByStatus") + @Operation(summary = "根据审核状态统计企业数据") + public CommonResult> statisticByStatus(){ + Map integerLongMap = enterpriseInformationService.statisticByStatus(); + return success(integerLongMap); + } } 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 b4004e5..56fe038 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 @@ -100,4 +100,10 @@ public interface EnterpriseInformationService { * @return */ Map selectEnterpriseByMonth(); + + /** + * 根据审核状态统计企业数据 + * @return + */ + Map statisticByStatus(); } 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 b648c00..fa56bc0 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 @@ -308,6 +308,17 @@ public class EnterpriseInformationServiceImpl implements EnterpriseInformationSe return monthlyCounts; } + /** + * 根据审核状态统计企业数据 + * @return + */ + @Override + public Map statisticByStatus() { + List enterpriseInformationDOS = enterpriseInformationMapper.selectList(); + Map statusCounts = enterpriseInformationDOS.stream().collect(Collectors.groupingBy(EnterpriseInformationDO::getStatus, Collectors.counting())); + return statusCounts; + } + private void validateLeaveExists(Long id) { if (enterpriseInformationMapper.selectById(id) == null) { throw exception(ENTERPRISE_INFORMATION_NOT_EXISTS);