feat: 报销单需要有个字段保存报销人的id
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
from fastapi import FastAPI
|
||||
from typing import TypedDict
|
||||
|
||||
from fastapi import FastAPI
|
||||
from langgraph.graph import StateGraph
|
||||
|
||||
from app.model.ApproveModel import ApproveModel, ApproveService
|
||||
from app.model.ReimburseModel import ReimburseService, ReimburseModel
|
||||
from app.utils.db_utils import AsyncSessionDep
|
||||
|
||||
@@ -27,7 +31,36 @@ def add_approve_route(app: FastAPI):
|
||||
return {"message": "报销单已通过审批,请勿重复提交!"}
|
||||
|
||||
# 1,4,5 的情况下新建审批单
|
||||
# 新建审批单,走审批流程
|
||||
print(reimburse_cls.amount)
|
||||
# 新建审批单,使用新的审批单走审批流程
|
||||
|
||||
new_approve_dict = {
|
||||
"title": "title",
|
||||
"description": "description",
|
||||
"status": "status",
|
||||
"amount": "amount",
|
||||
"logs": "logs",
|
||||
"user_id": "user_id",
|
||||
"proj_id": "proj_id",
|
||||
}
|
||||
|
||||
return
|
||||
|
||||
|
||||
def create_approve_graph(session: AsyncSessionDep):
|
||||
class StateSchema(TypedDict):
|
||||
status: str
|
||||
insert_approve_id: str
|
||||
# 要新建的审批单信息
|
||||
input_approve: dict
|
||||
|
||||
builder = StateGraph(StateSchema)
|
||||
|
||||
async def node_create_approve(state: StateSchema):
|
||||
new_approve_dict = state.get('input_approve')
|
||||
if not new_approve_dict:
|
||||
raise Exception('缺少审批单信息参数!')
|
||||
insert_approve_cls = await ApproveService.item_insert(session=session, row_dict=new_approve_dict)
|
||||
|
||||
return {"insert_approve_id": insert_approve_cls.id}
|
||||
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user