fix(approve): 添加流程配置验证逻辑
- 在获取审批流程节点后检查列表是否为空
- 当流程不存在时抛出运行时异常提示用户
- 防止后续节点ID提取操作出现空指针异常
| | |
| | | SysUser sysUser = SecurityUtils.getLoginUser().getUser(); |
| | | SysDept sysDept = sysDeptMapper.selectDeptById(SecurityUtils.getLoginUser().getCurrentDeptId()); |
| | | List<ApproveProcessConfigNodeVo> list = approveProcessConfigNodeService.listNode( approveProcessVO.getApproveType()); |
| | | if(list.isEmpty()) { |
| | | throw new RuntimeException("流程不存在"); |
| | | } |
| | | List<Long> nodeIds = list.stream() |
| | | .map(ApproveProcessConfigNodeVo::getApproverId) |
| | | .collect(Collectors.toList()); |
| | |
| | | for (String record : unmatchedRecords) { |
| | | message.append(record).append("\n"); |
| | | } |
| | | return R.ok(message.toString()); |
| | | return R.fail(message.toString()); |
| | | } |
| | | |
| | | return R.ok("导入成功,共处理 " + successCount + " 条记录"); |