This commit is contained in:
wangliwen 2022-07-21 10:02:03 +08:00
parent 162b016d36
commit 76255c5ff3
1 changed files with 3 additions and 5 deletions

View File

@ -53,7 +53,7 @@ import java.util.stream.Collectors;
@RestController
@RequestMapping("/ability/center/v2")
public class AbilityCenterControllerV2 {
private static final ExecutorService executor = Executors.newCachedThreadPool();
private static final ExecutorService executor = Executors.newWorkStealingPool();
private static final Logger logger = LoggerFactory.getLogger(AbilityCenterController.class);
private static final ObjectMapper oMapper = new ObjectMapper();
@Autowired
@ -108,10 +108,9 @@ public class AbilityCenterControllerV2 {
abilityBatchApplicationDTO.setApplyFlag(applyFlag); // 同一次的申请标识
final Optional<SysDeptDTO> deptDTO = Optional.ofNullable(sysDeptService.getByName(bigDateDeptName));
final UserDetail user = SecurityUser.getUser();
CompletableFuture.runAsync(() -> {
logger.info("处理能力申请!");
executor.execute(() -> {
deal(abilityBatchApplicationDTO, deptDTO, applyFlag, user);
}, executor);
});
return new Result().ok(LocalDateTime.now().toString());
}
@ -132,7 +131,6 @@ public class AbilityCenterControllerV2 {
logger.info("申请入参{}", JSON.toJSONString(abilityBatchApplicationDTO));
final Optional<SysDeptDTO> deptDTO = Optional.ofNullable(sysDeptService.getByName(bigDateDeptName));
final UserDetail user = SecurityUser.getUser();
deal(abilityBatchApplicationDTO, deptDTO, applyFlag, user);
return new Result().ok(LocalDateTime.now().toString());
}