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) {