能力申请 V3

This commit is contained in:
wangliwen 2022-08-19 10:03:06 +08:00
parent 368d78f48f
commit 633339f64b
1 changed files with 24 additions and 4 deletions

View File

@ -221,8 +221,8 @@ public class AbilityCenterControllerV3 {
}
return false;
}).filter(index -> index).findAny().orElse(Boolean.FALSE);
logger.error("--------------------是否全是基础设施{}----------------------------------------------", basicFacilities);
final List<Long> ids = dtoList.stream().map(TAbilityApplicationDTO::getId).collect(Collectors.toList()); // 发起申请的表单id
logger.error("--------------------是否全是基础设施 {}----------------------------------------------", basicFacilities);
final List<Long> ids = dtoList.stream().map(TAbilityApplicationDTO::getId).distinct().collect(Collectors.toList()); // 发起申请的表单id
// 仿照请求接口 /act/running/startOfBusinessKey
ProcessStartDTO processStartDTO = new ProcessStartDTO();
processStartDTO.setBusinessKey(Boolean.TRUE.equals(basicFacilities) ? tAbilityApplicationDTOList.stream().filter(index -> StringUtils.isNotEmpty(index.getResourceId()))
@ -233,14 +233,30 @@ public class AbilityCenterControllerV3 {
auditingBaseDTO.setCompleteEntry(Boolean.TRUE); // 首次录入
auditingBaseDTO.setFlowType("能力申请");
Boolean cityApply = Boolean.FALSE; // 是否为市级部门发起申请
Boolean crossRegion = Boolean.FALSE; // 是否跨区
Boolean cityApplyCity = Boolean.FALSE; // 是否为市区申请市区
// TODO
if (user.getDeptId() != null) {
SysDeptDTO applyUserDeptDTO = sysDeptService.get(user.getDeptId()); // 发起人的部门
applyUserDeptDTO.getType(); // 发起人
sysDeptDTO.getType(); // 资源所属部门
Integer applyUserDeptType = applyUserDeptDTO.getType(); // 发起人
Integer resourceDeptType = sysDeptDTO.getType(); // 资源所属部门
if (applyUserDeptType == 2) {
cityApply = Boolean.TRUE; // 市级部门发起申请
}
if (cityApply && resourceDeptType == 2) {
cityApplyCity = Boolean.TRUE; // 市区申请市区
}
if (!cityApply && (user.getDeptId() != sysDeptDTO.getId())) { // 非市申请且发起人与资源所属部门不一致
crossRegion = Boolean.TRUE; // 跨区
}
}
Map<String, Object> variables = oMapper.convertValue(auditingBaseDTO, Map.class);
Boolean finalCityApply = cityApply;
Boolean finalCityApplyCity = cityApplyCity;
Boolean finalCrossRegion = crossRegion;
variables.putAll(new HashMap<String, Object>() { // 流程内携带属性值
{
put("tAbilityApplicationDTOList", dtoList); // 归属该部门的申请
@ -250,6 +266,10 @@ public class AbilityCenterControllerV3 {
put("creator", user == null ? null : user.getId().toString()); // 创建人
put("userId", user == null ? null : user.getId().toString()); // 创建人
put("basic_facilities", basicFacilities); // 是否为基础设施
// 以下为V3增加
put("city_apply", finalCityApply); // 是否为市级部门发起申请
put("cross_region", finalCrossRegion); // 是否跨区
put("city_apply_city", finalCityApplyCity); // 是否为市区申请市区
}
});