{"record":{"id":"853eec52d4e43486","repo":"jeecgboot/JeecgBoot","slug":"id-853eec","errorCode":null,"errorMessage":"流程ID不能为空","messagePattern":"流程ID不能为空","errorType":"exception","errorClass":"JeecgBootException","httpStatus":null,"severity":"error","filePath":"jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysBaseApiImpl.java","lineNumber":2145,"sourceCode":"        query.orderByAsc(SysDepart::getOrgType);\n        List<SysDepart> sysDepartList = sysDepartService.list(query);\n        if (!CollectionUtils.isEmpty(sysDepartList)) {\n            //获取上级公司\n            SysDepart depart = getParentCompanyByOrgCode(orgCode, sysDepartList, level, 1);\n            if(depart == null){\n                depart = sysDepartList.get(0);\n            }\n            SysDepartModel respData = new SysDepartModel();\n            BeanUtils.copyProperties(depart, respData);\n            return respData;\n        }\n        return null;\n    }\n\n    @Override\n    public Object runAiragFlow(AiragFlowDTO airagFlowDTO) {\n        if(oConvertUtils.isEmpty(airagFlowDTO.getFlowId())) {\n            throw new JeecgBootException(\"流程ID不能为空\");\n        }\n        Result<Object> o = (Result<Object>)airagFlowService.runFlow(airagFlowDTO);\n        return o.getResult();\n    }\n\n\t@Override\n\tpublic SseEmitter runAiragFlowStream(AiragFlowDTO airagFlowDTO) {\n\t\tif (oConvertUtils.isEmpty(airagFlowDTO.getFlowId())) {\n\t\t\tthrow new JeecgBootException(\"流程ID不能为空\");\n\t\t}\n\t\treturn airagFlowService.runFlowStream(airagFlowDTO);\n\t}\n\n\t/**\n\t * uniPush推送消息给APP用户\n\t * @param pushMessageDTO\n\t */\n\t@Override","sourceCodeStart":2127,"sourceCodeEnd":2163,"githubUrl":"https://github.com/jeecgboot/JeecgBoot/blob/96fb33f5ec68516da0b0147da06b2eb0419e063a/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysBaseApiImpl.java#L2127-L2163","documentation":"runAiragFlow requires a non-empty flowId on the AiragFlowDTO and validates it with oConvertUtils.isEmpty before delegating to airagFlowService.runFlow. An empty flowId means no AI-RAG flow can be identified, so execution is rejected up front.","triggerScenarios":"Calling runAiragFlow with flowId null, empty, or whitespace-only (oConvertUtils.isEmpty treats all three as empty).","commonSituations":"Frontend did not bind the flow selector; DTO constructed by copy-paste without setting flowId; flow was deleted between page load and submit; JSON field name mismatch (e.g. flow_id vs flowId) leaving the field null after deserialization.","solutions":["Set airagFlowDTO.setFlowId(<valid flow id>) before calling runAiragFlow.","Validate flowId on the caller/controller side and return a clear 400 instead of relying on the service throw.","Confirm the JSON payload uses the correct field name (flowId) so deserialization populates it."],"exampleFix":"// before\nResult<?> r = (Result<?>) sysBaseApi.runAiragFlow(dto); // flowId null\n// after\nif (oConvertUtils.isEmpty(dto.getFlowId())) {\n    return Result.error(\"请选择要执行的AI流程\");\n}\nResult<?> r = (Result<?>) sysBaseApi.runAiragFlow(dto);","handlingStrategy":"validation","validationCode":"if (oConvertUtils.isEmpty(airagFlowDTO.getFlowId())) {\n    return Result.error(\"请选择要执行的AI流程\");\n}\nResult<?> r = (Result<?>) sysBaseApi.runAiragFlow(airagFlowDTO);","typeGuard":"public boolean hasFlowId(AiragFlowDTO dto) {\n    return dto != null && oConvertUtils.isNotEmpty(dto.getFlowId());\n}","tryCatchPattern":"try {\n    return sysBaseApi.runAiragFlow(dto);\n} catch (JeecgBootException e) {\n    if (\"流程ID不能为空\".equals(e.getMessage())) {\n        return Result.error(\"flowId 缺失, 请选择流程\");\n    }\n    throw e;\n}","preventionTips":["Validate flowId in the controller and return HTTP 400 rather than relying on the service throw.","Confirm the request field name (flowId) matches the DTO so deserialization populates it.","Disable the run button until a flow is selected on the frontend."],"tags":["airag","flow","validation"],"backgroundTag":null,"analyzedSha":"96fb33f5ec68516da0b0147da06b2eb0419e063a","analyzedAt":"2026-08-14T00:04:16.786Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}