From eca03dada76ac4c42a909d061a06c687d3bb9af1 Mon Sep 17 00:00:00 2001 From: lc <15038716315@163.com> Date: Fri, 21 Jun 2024 17:39:12 +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?= =?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 | 5 ++- .../EnterpriseInformationService.java | 3 +- .../EnterpriseInformationServiceImpl.java | 31 +++++++++++++++++-- 3 files changed, 31 insertions(+), 8 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 1581817..91b46fe 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 @@ -24,7 +24,6 @@ import javax.servlet.http.HttpServletResponse; import javax.validation.Valid; import java.io.IOException; import java.util.List; -import java.util.Map; import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; @@ -132,8 +131,8 @@ public class EnterpriseInformationController { @GetMapping("/statisticByStatus") @Operation(summary = "根据审核状态统计企业数据") - public CommonResult> statisticByStatus(){ - Map integerLongMap = enterpriseInformationService.statisticByStatus(); + public CommonResult> statisticByStatus(){ + List 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 44609be..a34ff39 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 @@ -9,7 +9,6 @@ import cn.iocoder.yudao.module.fta.dal.dataobject.enterpriseinformation.Statisti import javax.validation.Valid; import java.util.List; -import java.util.Map; /** * 企业信息 Service 接口 @@ -107,5 +106,5 @@ public interface EnterpriseInformationService { * 根据审核状态统计企业数据 * @return */ - Map statisticByStatus(); + List 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 f8616a4..6df7321 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 @@ -367,10 +367,35 @@ public class EnterpriseInformationServiceImpl implements EnterpriseInformationSe * @return */ @Override - public Map statisticByStatus() { + public List statisticByStatus() { List enterpriseInformationDOS = enterpriseInformationMapper.selectList(); - Map statusCounts = enterpriseInformationDOS.stream().collect(Collectors.groupingBy(EnterpriseInformationDO::getStatus, Collectors.counting())); - return statusCounts; + Map statusCounts = enterpriseInformationDOS.stream() + .collect(Collectors.groupingBy(EnterpriseInformationDO::getStatus, Collectors.counting())); + + List list = new ArrayList<>(); + + StatisticsResultData running = new StatisticsResultData(); + running.setName("analysis.running"); + running.setValue(statusCounts.get(1));//审批中 + + StatisticsResultData approve = new StatisticsResultData(); + approve.setName("analysis.approve"); + approve.setValue(statusCounts.get(2));//审批通过 + + StatisticsResultData reject = new StatisticsResultData(); + reject.setName("analysis.reject"); + reject.setValue(statusCounts.get(4));//审批不通过 + + StatisticsResultData cancel = new StatisticsResultData(); + cancel.setName("analysis.cancel"); + cancel.setValue(statusCounts.get(4));//已取消 + + list.add(running); + list.add(approve); + list.add(reject); + list.add(cancel); + + return list; } private void validateLeaveExists(Long id) {