From fd132c749c0d7bc7b5599d25c2216f5b6c31b0d8 Mon Sep 17 00:00:00 2001 From: wangliwen Date: Wed, 11 May 2022 16:32:59 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=B3=E8=AF=B7=E6=83=85=E5=86=B5=E5=8A=A0?= =?UTF-8?q?=E5=85=A5=E8=B5=84=E6=BA=90=E7=9A=84=E5=AD=98=E7=BB=AD=E6=83=85?= =?UTF-8?q?=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/controller/CensusController.java | 21 +++++++++++++++---- .../activiti/dto/ProcessInstanceDTO.java | 5 ++++- .../activiti/service/ActHistoryService.java | 3 ++- 3 files changed, 23 insertions(+), 6 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 0829cf6f..d41c964f 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 @@ -70,18 +70,31 @@ public class CensusController { @GetMapping(value = "/whole_amount") @ApiOperation("平台整体情况") public Result>> wholeAmount() { - List> result = new ArrayList>(); - CompletableFuture resourceAmount = CompletableFuture.supplyAsync(() -> { // 获取资源汇聚总量 + List> result = new ArrayList<>(); + CompletableFuture resourceAmount = CompletableFuture.supplyAsync(() -> { // 获取资源汇聚总量 List> dbAmount = resourceService.getAmountGroupByType(); Long sum = dbAmount.stream().mapToLong(index -> Long.valueOf(index.get("amount").toString())).sum(); return sum; + }).thenAccept(sum -> { + result.add(new HashMap() { + { + put("amount", sum); + put("type", "资源汇聚总量"); + } + }); }); - CompletableFuture userAmount = CompletableFuture.supplyAsync(() -> { // 获取平台用户总数 + CompletableFuture userAmount = CompletableFuture.supplyAsync(() -> { // 获取平台用户总数 return sysUserService.countAllUser(); + }).thenAccept(sum -> { + result.add(new HashMap() { + { + put("amount", sum); + put("type", "用户量"); + } + }); }); CompletableFuture all = CompletableFuture.allOf(resourceAmount, userAmount); all.join(); - return new Result>>().ok(result); } } diff --git a/renren-admin/src/main/java/io/renren/modules/activiti/dto/ProcessInstanceDTO.java b/renren-admin/src/main/java/io/renren/modules/activiti/dto/ProcessInstanceDTO.java index 62c908d7..7e9e55a7 100644 --- a/renren-admin/src/main/java/io/renren/modules/activiti/dto/ProcessInstanceDTO.java +++ b/renren-admin/src/main/java/io/renren/modules/activiti/dto/ProcessInstanceDTO.java @@ -63,5 +63,8 @@ public class ProcessInstanceDTO { @ApiModelProperty(value = "当前任务") private List currentTaskList; - + @ApiModelProperty(value = "资源情况") + private int resourceStatus; + @ApiModelProperty(value = "资源情况") + private String resourceStatusTip; } 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 82c3af1c..b4f74ddf 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 @@ -256,7 +256,6 @@ public class ActHistoryService { PageData pageData = this.getHistoryProcessInstancePage(params); List list = pageData.getList(); for (ProcessInstanceDTO dto : list) { - logger.info(dto.toString()); TAbilityApplicationDTO abilityApplicationDTO = tAbilityApplicationService.getByInstanceId(dto.getProcessInstanceId()); // 获取申请表单 if (abilityApplicationDTO != null && StringUtils.isNotEmpty(abilityApplicationDTO.getSystem()) && StringUtils.isEmpty(dto.getName())) { dto.setName(abilityApplicationDTO.getSystem()); @@ -276,6 +275,8 @@ public class ActHistoryService { if (resourceDTO != null) { dto.setName(resourceDTO.getName()); dto.setResourceId(resourceDTO.getId().toString()); + dto.setResourceStatus(resourceDTO.getDelFlag()); + dto.setResourceStatusTip(resourceDTO.getDelFlagTip()); } } }