Compare commits

..

No commits in common. "3f5c12bc2c44b07b41e08c55bf843d9e2c829f06" and "de0884b76f22bfc978a477aabe6fd4baf41d8ff8" have entirely different histories.

1 changed files with 4 additions and 11 deletions

View File

@ -64,8 +64,6 @@ public class AbilityCenterControllerV3 {
private static final ExecutorService executor = Executors.newWorkStealingPool(CPUNUM * 2); private static final ExecutorService executor = Executors.newWorkStealingPool(CPUNUM * 2);
private static final ExecutorService executorMain = Executors.newCachedThreadPool();
private static final ObjectMapper oMapper = new ObjectMapper(); private static final ObjectMapper oMapper = new ObjectMapper();
@Value("${project.place}") @Value("${project.place}")
@ -131,10 +129,8 @@ public class AbilityCenterControllerV3 {
final Optional<SysDeptDTO> deptDTO = Optional.ofNullable(sysDeptService.getByName(bigDateDeptName)); final Optional<SysDeptDTO> deptDTO = Optional.ofNullable(sysDeptService.getByName(bigDateDeptName));
final UserDetail user = SecurityUser.getUser(); final UserDetail user = SecurityUser.getUser();
switch (Constant.ProjectPlace.getByFlag(projectPlace)) { switch (Constant.ProjectPlace.getByFlag(projectPlace)) {
case TSINGTAO: { // 青岛市局 异步会死锁 使用缓存线程池 case TSINGTAO: { // 青岛市局 异步会死锁
executorMain.execute(() -> { deal(abilityBatchApplicationDTO, deptDTO, applyFlag, user);
deal(abilityBatchApplicationDTO, deptDTO, applyFlag, user);
});
} }
break; break;
default: { default: {
@ -169,9 +165,7 @@ public class AbilityCenterControllerV3 {
final UserDetail user = SecurityUser.getUser(); final UserDetail user = SecurityUser.getUser();
switch (Constant.ProjectPlace.getByFlag(projectPlace)) { switch (Constant.ProjectPlace.getByFlag(projectPlace)) {
case TSINGTAO: { // 青岛市局 异步会死锁 case TSINGTAO: { // 青岛市局 异步会死锁
executorMain.execute(() -> { deal(abilityBatchApplicationDTO, deptDTO, applyFlag, user);
deal(abilityBatchApplicationDTO, deptDTO, applyFlag, user);
});
} }
break; break;
default: { default: {
@ -193,8 +187,7 @@ public class AbilityCenterControllerV3 {
// TODO 拆单进行审核 abilityprocess_v3 // TODO 拆单进行审核 abilityprocess_v3
private void deal(TAbilityBatchApplicationDTO abilityBatchApplicationDTO, Optional<SysDeptDTO> deptDTO, String applyFlag, UserDetail user) { private void deal(TAbilityBatchApplicationDTO abilityBatchApplicationDTO, Optional<SysDeptDTO> deptDTO, String applyFlag, UserDetail user) {
SysUserDTO sysUserDTO = sysUserService.get(user.getId()); SysUserDTO sysUserDTO = sysUserService.get(user.getId());
List<String> resourceName = abilityBatchApplicationDTO.getSystem().stream() List<String> resourceName = abilityBatchApplicationDTO.getSystem().stream().filter(index -> tAbilityApplicationService.countUserResourceApply(SecurityUser.getUserId(), Long.valueOf(index.get("resourceId"))) > 0)
.filter(index -> tAbilityApplicationService.countUserResourceApply(SecurityUser.getUserId(), Long.valueOf(index.get("resourceId"))) > 0)
.map(index -> index.get("resourceName")) .map(index -> index.get("resourceName"))
.collect(Collectors.toList()); // 获取已申请的资源名称 .collect(Collectors.toList()); // 获取已申请的资源名称
if (!resourceName.isEmpty()) { if (!resourceName.isEmpty()) {