Merge branch 'master' into docker_package

This commit is contained in:
wangliwen 2022-08-05 17:15:05 +08:00
commit 3f2a769542
2 changed files with 28 additions and 5 deletions

View File

@ -3,6 +3,7 @@ package io.renren.common.controller;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSON;
import io.renren.common.annotation.LogOperation;
import io.renren.common.constant.Constant;
import io.renren.common.dto.AuditingBaseDTO;
import io.renren.common.page.PageData;
import io.renren.common.utils.CodeGenerationUtils;
@ -53,7 +54,7 @@ import java.util.stream.Collectors;
@RestController
@RequestMapping("/ability/center/v2")
public class AbilityCenterControllerV2 {
private static final ExecutorService executor = Executors.newWorkStealingPool();
private static final ExecutorService executor = Executors.newCachedThreadPool();
private static final Logger logger = LoggerFactory.getLogger(AbilityCenterControllerV2.class);
private static final ObjectMapper oMapper = new ObjectMapper();
@Autowired
@ -70,6 +71,9 @@ public class AbilityCenterControllerV2 {
@Autowired
private SysDeptService sysDeptService;
@Value("${project.place}")
private Integer projectPlace;
private final CodeGenerationUtils codeGenerationUtils = CodeGenerationUtils.getInstance();
@ -108,9 +112,17 @@ public class AbilityCenterControllerV2 {
abilityBatchApplicationDTO.setApplyFlag(applyFlag); // 同一次的申请标识
final Optional<SysDeptDTO> deptDTO = Optional.ofNullable(sysDeptService.getByName(bigDateDeptName));
final UserDetail user = SecurityUser.getUser();
executor.execute(() -> {
deal(abilityBatchApplicationDTO, deptDTO, applyFlag, user);
});
switch (Constant.ProjectPlace.getByFlag(projectPlace)) {
case TSINGTAO: { // 青岛市局 异步会死锁
deal(abilityBatchApplicationDTO, deptDTO, applyFlag, user);
}
break;
default: {
executor.execute(() -> {
deal(abilityBatchApplicationDTO, deptDTO, applyFlag, user);
});
}
}
return new Result().ok(LocalDateTime.now().toString());
}
@ -131,7 +143,17 @@ 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);
switch (Constant.ProjectPlace.getByFlag(projectPlace)) {
case TSINGTAO: { // 青岛市局 异步会死锁
deal(abilityBatchApplicationDTO, deptDTO, applyFlag, user);
}
break;
default: {
executor.execute(() -> {
deal(abilityBatchApplicationDTO, deptDTO, applyFlag, user);
});
}
}
return new Result().ok(LocalDateTime.now().toString());
}

View File

@ -1058,6 +1058,7 @@
AND tdr.del_flag = 0
AND tda.del_flag = 0
AND tdr.id = tda.data_resource_id
AND tda.attr_type = '应用领域'
AND MATCH (attr_value) AGAINST ( #{type} IN BOOLEAN MODE)
</select>