This commit is contained in:
wangliwen 2022-08-24 16:22:02 +08:00
parent 9b2d222ebf
commit 6da1b5b6b1
1 changed files with 12 additions and 4 deletions

View File

@ -239,9 +239,14 @@ public class AbilityCenterControllerV3 {
return; return;
} }
List<TAbilityApplicationDTO> dtoList = temp.get(deptId); List<TAbilityApplicationDTO> dtoList = temp.get(deptId);
dtoList = dtoList.stream().map(index -> {
index.setResourceOwnerDept(sysDeptDTO);
return index;
}).collect(Collectors.toList());
List<TAbilityApplicationDTO> finalDtoList = dtoList;
CompletableFuture.runAsync(() -> { CompletableFuture.runAsync(() -> {
String[] sqls = dtoList.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[dtoList.size()]); 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()]);
jdbcTemplate.batchUpdate(sqls); // 批量更新资源所属部门信息 jdbcTemplate.batchUpdate(sqls); // 批量更新资源所属部门信息
logger.info("批量更新申请的资源的部门信息完成"); logger.info("批量更新申请的资源的部门信息完成");
}, executor); }, executor);
@ -292,9 +297,10 @@ public class AbilityCenterControllerV3 {
Boolean finalCityApply = cityApply; Boolean finalCityApply = cityApply;
Boolean finalCityApplyCity = cityApplyCity; Boolean finalCityApplyCity = cityApplyCity;
Boolean finalCrossRegion = crossRegion; Boolean finalCrossRegion = crossRegion;
List<TAbilityApplicationDTO> finalDtoList1 = dtoList;
variables.putAll(new HashMap<String, Object>() { // 流程内携带属性值 variables.putAll(new HashMap<String, Object>() { // 流程内携带属性值
{ {
put("tAbilityApplicationDTOList", dtoList); // 归属该部门的申请 put("tAbilityApplicationDTOList", finalDtoList1); // 归属该部门的申请
put("key", processStartDTO.getBusinessKey()); // 归属该部门申请的表单id put("key", processStartDTO.getBusinessKey()); // 归属该部门申请的表单id
put("deptId", deptId); // 归属部门 put("deptId", deptId); // 归属部门
put("_id", applyFlag); //申请id put("_id", applyFlag); //申请id
@ -306,6 +312,7 @@ public class AbilityCenterControllerV3 {
put("city_apply", finalCityApply); // 是否为市级部门发起申请 put("city_apply", finalCityApply); // 是否为市级部门发起申请
put("cross_region", finalCrossRegion); // 是否跨区 put("cross_region", finalCrossRegion); // 是否跨区
put("city_apply_city", finalCityApplyCity); // 是否为市区申请市区 put("city_apply_city", finalCityApplyCity); // 是否为市区申请市区
put("resource_dept", sysDeptDTO); // 同一审核单内部门信息
} }
}); });
@ -313,10 +320,11 @@ public class AbilityCenterControllerV3 {
ProcessInstanceDTO dto = actRunningService.startOfBusinessKey(processStartDTO); ProcessInstanceDTO dto = actRunningService.startOfBusinessKey(processStartDTO);
// 仿照请求接口 /processForm/tabilityapplication/updateInstanceId // 仿照请求接口 /processForm/tabilityapplication/updateInstanceId
List<TAbilityApplicationDTO> finalDtoList2 = dtoList;
CompletableFuture.runAsync(() -> { CompletableFuture.runAsync(() -> {
if (dto.getBusinessKey() != null) { if (dto.getBusinessKey() != null) {
String[] sqls = dtoList.stream().map(i -> String.format("UPDATE t_ability_application SET instance_id = %s WHERE id = %s", dto.getProcessInstanceId(), i.getId())) String[] sqls = finalDtoList2.stream().map(i -> String.format("UPDATE t_ability_application SET instance_id = %s WHERE id = %s", dto.getProcessInstanceId(), i.getId()))
.collect(Collectors.toList()).toArray(new String[dtoList.size()]); .collect(Collectors.toList()).toArray(new String[finalDtoList2.size()]);
jdbcTemplate.batchUpdate(sqls); jdbcTemplate.batchUpdate(sqls);
} }
}, executor); }, executor);