Merge branch 'master' into docker_package
This commit is contained in:
commit
29a5dffb65
|
@ -91,6 +91,43 @@ public class AbilityCenterControllerV3 {
|
|||
}
|
||||
};
|
||||
|
||||
@PostMapping(value = "/applyAllApplication")
|
||||
@ApiOperation("批量进行能力申请")
|
||||
@LogOperation("批量进行能力申请")
|
||||
public Result<List<ProcessInstanceDTO>> applyV2AllApplication(@RequestBody TAbilityBatchApplicationDTO abilityBatchApplicationDTO) {
|
||||
// 仿照请求接口 /act/process/lastestPage
|
||||
PageData<Map<String, Object>> page = actProcessService.page(params);
|
||||
if (page.getTotal() <= 0) { //
|
||||
return new Result().error("联系管理员添加流程");
|
||||
}
|
||||
|
||||
List<Map<String, Object>> system_ = jdbcTemplate.queryForList("SELECT `name` AS resourceName,id AS resourceId FROM tb_data_resource WHERE type = '应用资源' AND del_flag = 0;");
|
||||
if (system_.isEmpty()) {
|
||||
return new Result().error("无应用资源");
|
||||
}
|
||||
List<Map<String, String>> system = system_.stream().map(index ->
|
||||
index.entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, e -> e.getValue().toString()))
|
||||
).collect(Collectors.toList());
|
||||
abilityBatchApplicationDTO.setSystem(system); // 申请所有的正常的应用资源
|
||||
logger.info("申请入参{}", JSON.toJSONString(abilityBatchApplicationDTO));
|
||||
final String applyFlag = UUID.randomUUID().toString();
|
||||
abilityBatchApplicationDTO.setApplyFlag(applyFlag); // 同一次的申请标识
|
||||
final Optional<SysDeptDTO> deptDTO = Optional.ofNullable(sysDeptService.getByName(bigDateDeptName));
|
||||
final UserDetail user = SecurityUser.getUser();
|
||||
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());
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量进行批量能力申请(按资源所属部门分配审核人)
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue