审核状态不正确的处理
This commit is contained in:
parent
7c99310df7
commit
39b76c5c76
|
@ -3,6 +3,7 @@ package io.renren.common.controller;
|
|||
|
||||
import io.renren.common.utils.Result;
|
||||
import io.renren.modules.resource.service.ResourceService;
|
||||
import io.renren.modules.sys.service.SysUserService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
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.RestController;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
|
@ -31,6 +30,8 @@ public class CensusController {
|
|||
|
||||
@Autowired
|
||||
private ResourceService resourceService;
|
||||
@Autowired
|
||||
private SysUserService sysUserService;
|
||||
|
||||
@Value("${census.type}")
|
||||
private String[] censusTypes; // 大数据局名称
|
||||
|
@ -65,4 +66,22 @@ public class CensusController {
|
|||
dbAmount.add(sumMap);
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -151,6 +151,7 @@ public class ResourceMountController {
|
|||
});
|
||||
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
|
||||
resourceService.update(dto);
|
||||
logger.error(resourceDTO.get().toString());
|
||||
});
|
||||
|
||||
logger.info("-------------------1.保存申请表单成功--------------------------");
|
||||
|
@ -159,7 +160,7 @@ public class ResourceMountController {
|
|||
processStartDTO.setBusinessKey(resourceId.toString());
|
||||
processStartDTO.setProcessDefinitionKey(undercarriage_key); // 限定资源下架
|
||||
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);
|
||||
ProcessInstanceDTO dto = actRunningService.startOfBusinessKey(processStartDTO);
|
||||
logger.info("-------------------2.启动流程成功--------------------------");
|
||||
|
|
|
@ -91,6 +91,7 @@ public class ResourceUndercarriageListener implements TaskListener, ExecutionLis
|
|||
JsonElement jsonElement = gson.toJsonTree(kv);
|
||||
ResourceDTO re = gson.fromJson(jsonElement, ResourceDTO.class);
|
||||
if (re != null) {
|
||||
logger.error(kv.toString());
|
||||
re.setDelFlag(ResourceEntityDelFlag.UNDERCARRIAGE.getFlag());
|
||||
resourceService.update(re);
|
||||
logger.error("下架审批通过 资源id:" + re.getId());
|
||||
|
|
Loading…
Reference in New Issue