From d6b9fa0677dbb59df0d4a173ebe9c677b12ac59e Mon Sep 17 00:00:00 2001 From: wangliwen Date: Wed, 11 May 2022 16:57:59 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E7=9A=84=E8=A1=A5=E5=85=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/controller/CensusController.java | 16 +++++++++++++++- .../activiti/service/ActHistoryService.java | 9 +++++++-- .../processForm/dao/TAbilityApplicationDao.java | 2 ++ .../service/TAbilityApplicationService.java | 7 ++++++- .../impl/TAbilityApplicationServiceImpl.java | 5 +++++ .../processForm/TAbilityApplicationDao.xml | 8 ++++++++ 6 files changed, 43 insertions(+), 4 deletions(-) diff --git a/renren-admin/src/main/java/io/renren/common/controller/CensusController.java b/renren-admin/src/main/java/io/renren/common/controller/CensusController.java index d41c964f..bb18aa55 100644 --- a/renren-admin/src/main/java/io/renren/common/controller/CensusController.java +++ b/renren-admin/src/main/java/io/renren/common/controller/CensusController.java @@ -2,6 +2,7 @@ package io.renren.common.controller; import io.renren.common.utils.Result; +import io.renren.modules.processForm.service.TAbilityApplicationService; import io.renren.modules.resource.service.ResourceService; import io.renren.modules.sys.service.SysUserService; import io.swagger.annotations.Api; @@ -32,6 +33,8 @@ public class CensusController { private ResourceService resourceService; @Autowired private SysUserService sysUserService; + @Autowired + private TAbilityApplicationService tAbilityApplicationService; @Value("${census.type}") private String[] censusTypes; // 大数据局名称 @@ -93,7 +96,18 @@ public class CensusController { } }); }); - CompletableFuture all = CompletableFuture.allOf(resourceAmount, userAmount); + + CompletableFuture applyAmount = CompletableFuture.supplyAsync(() -> { // 获取平台用户总数 + return tAbilityApplicationService.countApplyAll(); + }).thenAccept(sum -> { + result.add(new HashMap() { + { + put("amount", sum); + put("type", "资源申请量"); + } + }); + }); + CompletableFuture all = CompletableFuture.allOf(resourceAmount, userAmount, applyAmount); all.join(); return new Result>>().ok(result); } diff --git a/renren-admin/src/main/java/io/renren/modules/activiti/service/ActHistoryService.java b/renren-admin/src/main/java/io/renren/modules/activiti/service/ActHistoryService.java index b4f74ddf..c371739d 100644 --- a/renren-admin/src/main/java/io/renren/modules/activiti/service/ActHistoryService.java +++ b/renren-admin/src/main/java/io/renren/modules/activiti/service/ActHistoryService.java @@ -275,12 +275,17 @@ public class ActHistoryService { if (resourceDTO != null) { dto.setName(resourceDTO.getName()); dto.setResourceId(resourceDTO.getId().toString()); - dto.setResourceStatus(resourceDTO.getDelFlag()); - dto.setResourceStatusTip(resourceDTO.getDelFlagTip()); } } } } + if (dto.getResourceId() != null) { + ResourceDTO resourceDTO = resourceService.get(Long.valueOf(dto.getResourceId())); + if (resourceDTO != null) { + dto.setResourceStatus(resourceDTO.getDelFlag()); + dto.setResourceStatusTip(resourceDTO.getDelFlagTip()); + } + } if (dto.isEnded()) { // 已结束 continue; } diff --git a/renren-admin/src/main/java/io/renren/modules/processForm/dao/TAbilityApplicationDao.java b/renren-admin/src/main/java/io/renren/modules/processForm/dao/TAbilityApplicationDao.java index f7db5b12..1020534b 100644 --- a/renren-admin/src/main/java/io/renren/modules/processForm/dao/TAbilityApplicationDao.java +++ b/renren-admin/src/main/java/io/renren/modules/processForm/dao/TAbilityApplicationDao.java @@ -17,4 +17,6 @@ public interface TAbilityApplicationDao extends BaseDao + \ No newline at end of file