feat: 提交审批单的时候通过AI核验报销是否符合报销规范
This commit is contained in:
@@ -6,6 +6,7 @@ from langgraph.graph import StateGraph
|
||||
from app.model.ApproveModel import ApproveService, ApproveModel
|
||||
from app.model.ReimburseModel import ReimburseService, ReimburseModel
|
||||
from app.utils.db_utils import AsyncSessionDep
|
||||
from app.utils.llm_approve_utils import get_llm_approve_result
|
||||
from app.utils.postgres_checkpointer import AsyncPostgresSaverDep
|
||||
from app.workflow.approve import create_approve_graph, ApproveGraphSchema
|
||||
|
||||
@@ -36,6 +37,7 @@ def add_reimburse_route(app: FastAPI):
|
||||
if reimburse_cls.approve.status == 'approved':
|
||||
return {"message": "报销单已通过审批,请勿重复提交!"}
|
||||
|
||||
llm_response_dict = await get_llm_approve_result(session, reimburse_cls)
|
||||
# 1,4,5 的情况下新建审批单
|
||||
# 创建审批单,使用新的审批单走审批流程
|
||||
|
||||
@@ -49,6 +51,7 @@ def add_reimburse_route(app: FastAPI):
|
||||
"apply_user_id": reimburse_cls.user_id,
|
||||
"proj_id": reimburse_cls.proj_id,
|
||||
"approve_from": "reimburse",
|
||||
**llm_response_dict,
|
||||
}
|
||||
insert_approve_cls: ApproveModel = await ApproveService.item_insert(session=session, row_dict=new_approve_dict)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user