资源无所属部门时 默认所属部门为 平台设置大数据局
This commit is contained in:
parent
8a4e11430e
commit
292ec95d3c
|
@ -216,6 +216,7 @@ public class AbilityCenterControllerV3 {
|
|||
sysNoticeService.save(dto);
|
||||
}, executor);
|
||||
}
|
||||
logger.info("开始申请流程!");
|
||||
List<TAbilityApplicationDTO> tAbilityApplicationDTOList = abilityBatchApplicationDTO.getSystem().stream().map(index -> {
|
||||
if (tAbilityApplicationService.countUserResourceApply(SecurityUser.getUserId(), Long.valueOf(index.get("resourceId"))) > 0) { // 防止重复发起申请
|
||||
logger.error("重复发起申请");
|
||||
|
@ -283,19 +284,24 @@ public class AbilityCenterControllerV3 {
|
|||
if (deptId == 0L) { // 部门id不存在时
|
||||
return;
|
||||
}
|
||||
final SysDeptDTO sysDeptDTO = sysDeptService.get(deptId);
|
||||
SysDeptDTO sysDeptDTO = sysDeptService.get(deptId);
|
||||
if (sysDeptDTO == null) { // 部门不存在
|
||||
return;
|
||||
logger.info("资源部门不存在时!!!");
|
||||
if (!deptDTO.isPresent()) {
|
||||
return;
|
||||
}
|
||||
sysDeptDTO = deptDTO.isPresent() ? deptDTO.get() : null;
|
||||
}
|
||||
List<TAbilityApplicationDTO> dtoList = temp.get(deptId);
|
||||
SysDeptDTO finalSysDeptDTO = sysDeptDTO;
|
||||
dtoList = dtoList.stream().map(index -> {
|
||||
index.setResourceOwnerDept(sysDeptDTO);
|
||||
index.setResourceOwnerDept(finalSysDeptDTO);
|
||||
return index;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
List<TAbilityApplicationDTO> finalDtoList = dtoList;
|
||||
CompletableFuture.runAsync(() -> {
|
||||
String[] sqls = finalDtoList.stream().map(index -> String.format("UPDATE t_ability_application SET resource_owner_dept = '%s' WHERE id = %s", JSON.toJSONString(sysDeptDTO), index.getId())).collect(Collectors.toList()).toArray(new String[finalDtoList.size()]);
|
||||
String[] sqls = finalDtoList.stream().map(index -> String.format("UPDATE t_ability_application SET resource_owner_dept = '%s' WHERE id = %s", JSON.toJSONString(finalSysDeptDTO), index.getId())).collect(Collectors.toList()).toArray(new String[finalDtoList.size()]);
|
||||
jdbcTemplate.batchUpdate(sqls); // 批量更新资源所属部门信息
|
||||
logger.info("批量更新申请的资源的部门信息完成");
|
||||
}, executor);
|
||||
|
@ -362,7 +368,7 @@ public class AbilityCenterControllerV3 {
|
|||
put("city_apply", finalCityApply); // 是否为市级部门发起申请
|
||||
put("cross_region", finalCrossRegion); // 是否跨区
|
||||
put("city_apply_city", finalCityApplyCity); // 是否为市区申请市区
|
||||
put("resource_dept", sysDeptDTO); // 同一审核单内部门信息
|
||||
put("resource_dept", finalSysDeptDTO); // 同一审核单内部门信息
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue