申请情况加入资源的存续情况

This commit is contained in:
wangliwen 2022-05-11 16:32:59 +08:00
parent 39b76c5c76
commit fd132c749c
3 changed files with 23 additions and 6 deletions

View File

@ -70,18 +70,31 @@ public class CensusController {
@GetMapping(value = "/whole_amount")
@ApiOperation("平台整体情况")
public Result<List<Map<String, Object>>> wholeAmount() {
List<Map<String, Object>> result = new ArrayList<Map<String, Object>>();
CompletableFuture<Long> resourceAmount = CompletableFuture.supplyAsync(() -> { // 获取资源汇聚总量
List<Map<String, Object>> result = new ArrayList<>();
CompletableFuture<Void> resourceAmount = CompletableFuture.supplyAsync(() -> { // 获取资源汇聚总量
List<Map<String, Object>> dbAmount = resourceService.getAmountGroupByType();
Long sum = dbAmount.stream().mapToLong(index -> Long.valueOf(index.get("amount").toString())).sum();
return sum;
}).thenAccept(sum -> {
result.add(new HashMap<String, Object>() {
{
put("amount", sum);
put("type", "资源汇聚总量");
}
});
CompletableFuture<Long> userAmount = CompletableFuture.supplyAsync(() -> { // 获取平台用户总数
});
CompletableFuture<Void> userAmount = CompletableFuture.supplyAsync(() -> { // 获取平台用户总数
return sysUserService.countAllUser();
}).thenAccept(sum -> {
result.add(new HashMap<String, Object>() {
{
put("amount", sum);
put("type", "用户量");
}
});
});
CompletableFuture<Void> all = CompletableFuture.allOf(resourceAmount, userAmount);
all.join();
return new Result<List<Map<String, Object>>>().ok(result);
}
}

View File

@ -63,5 +63,8 @@ public class ProcessInstanceDTO {
@ApiModelProperty(value = "当前任务")
private List<TaskDTO> currentTaskList;
@ApiModelProperty(value = "资源情况")
private int resourceStatus;
@ApiModelProperty(value = "资源情况")
private String resourceStatusTip;
}

View File

@ -256,7 +256,6 @@ public class ActHistoryService {
PageData<ProcessInstanceDTO> pageData = this.getHistoryProcessInstancePage(params);
List<ProcessInstanceDTO> 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());
}
}
}