审核状态不正确的处理

This commit is contained in:
wangliwen 2022-05-11 16:10:13 +08:00
parent 7c99310df7
commit 39b76c5c76
3 changed files with 26 additions and 5 deletions

View File

@ -3,6 +3,7 @@ package io.renren.common.controller;
import io.renren.common.utils.Result; import io.renren.common.utils.Result;
import io.renren.modules.resource.service.ResourceService; import io.renren.modules.resource.service.ResourceService;
import io.renren.modules.sys.service.SysUserService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger; import org.slf4j.Logger;
@ -13,10 +14,8 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.Arrays; import java.util.*;
import java.util.HashMap; import java.util.concurrent.CompletableFuture;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
@ -31,6 +30,8 @@ public class CensusController {
@Autowired @Autowired
private ResourceService resourceService; private ResourceService resourceService;
@Autowired
private SysUserService sysUserService;
@Value("${census.type}") @Value("${census.type}")
private String[] censusTypes; // 大数据局名称 private String[] censusTypes; // 大数据局名称
@ -65,4 +66,22 @@ public class CensusController {
dbAmount.add(sumMap); dbAmount.add(sumMap);
return new Result<List<Map<String, Object>>>().ok(dbAmount); return new Result<List<Map<String, Object>>>().ok(dbAmount);
} }
@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>> dbAmount = resourceService.getAmountGroupByType();
Long sum = dbAmount.stream().mapToLong(index -> Long.valueOf(index.get("amount").toString())).sum();
return sum;
});
CompletableFuture<Long> userAmount = CompletableFuture.supplyAsync(() -> { // 获取平台用户总数
return sysUserService.countAllUser();
});
CompletableFuture<Void> all = CompletableFuture.allOf(resourceAmount, userAmount);
all.join();
return new Result<List<Map<String, Object>>>().ok(result);
}
} }

View File

@ -151,6 +151,7 @@ public class ResourceMountController {
}); });
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
resourceService.update(dto); resourceService.update(dto);
logger.error(resourceDTO.get().toString());
}); });
logger.info("-------------------1.保存申请表单成功--------------------------"); logger.info("-------------------1.保存申请表单成功--------------------------");
@ -159,7 +160,7 @@ public class ResourceMountController {
processStartDTO.setBusinessKey(resourceId.toString()); processStartDTO.setBusinessKey(resourceId.toString());
processStartDTO.setProcessDefinitionKey(undercarriage_key); // 限定资源下架 processStartDTO.setProcessDefinitionKey(undercarriage_key); // 限定资源下架
ObjectMapper oMapper = new ObjectMapper(); ObjectMapper oMapper = new ObjectMapper();
Map<String, Object> variables = oMapper.convertValue(resourceDTO, Map.class); Map<String, Object> variables = oMapper.convertValue(resourceDTO.get(), Map.class);
processStartDTO.setVariables(variables); processStartDTO.setVariables(variables);
ProcessInstanceDTO dto = actRunningService.startOfBusinessKey(processStartDTO); ProcessInstanceDTO dto = actRunningService.startOfBusinessKey(processStartDTO);
logger.info("-------------------2.启动流程成功--------------------------"); logger.info("-------------------2.启动流程成功--------------------------");

View File

@ -91,6 +91,7 @@ public class ResourceUndercarriageListener implements TaskListener, ExecutionLis
JsonElement jsonElement = gson.toJsonTree(kv); JsonElement jsonElement = gson.toJsonTree(kv);
ResourceDTO re = gson.fromJson(jsonElement, ResourceDTO.class); ResourceDTO re = gson.fromJson(jsonElement, ResourceDTO.class);
if (re != null) { if (re != null) {
logger.error(kv.toString());
re.setDelFlag(ResourceEntityDelFlag.UNDERCARRIAGE.getFlag()); re.setDelFlag(ResourceEntityDelFlag.UNDERCARRIAGE.getFlag());
resourceService.update(re); resourceService.update(re);
logger.error("下架审批通过 资源id:" + re.getId()); logger.error("下架审批通过 资源id:" + re.getId());