From 226202d6eee6480f3386c6295be26fad42940cc8 Mon Sep 17 00:00:00 2001 From: zhaoqingang <zhaoqg0118@163.com> Date: 星期五, 28 三月 2025 09:41:39 +0800 Subject: [PATCH] 知识库分享,历史记录文件 --- app/service/organization.py | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/app/service/organization.py b/app/service/organization.py index db4152c..608cbf2 100644 --- a/app/service/organization.py +++ b/app/service/organization.py @@ -17,7 +17,7 @@ async def create_dept(db, dept_name, leader, phone, address, status, order_num, roles, groups,parent_id): try: - dept_model = OrganizationModel(id=str(uuid.uuid4()),name=dept_name, address=address,leader=leader,phone=phone,seq=order_num,status=status) + dept_model = OrganizationModel(id=str(uuid.uuid4()),name=dept_name, address=address,leader=leader,phone=phone,seq=order_num,status=str(status)) if parent_id: dept_model.parent = db.get(OrganizationModel, parent_id) if roles: @@ -113,6 +113,10 @@ next_dept_list = [] base_dept = db.query(OrganizationModel).filter(OrganizationModel.id.__eq__(dept_id)).first() if status == DEPT_STATUS_ON: + print(11) + print(base_dept.name) + if base_dept.parent and base_dept.parent.status != DEPT_STATUS_ON: + return '涓婄骇鑺傜偣鐘舵�佸紓甯革紒' try: base_dept.status=status db.commit() -- Gitblit v1.8.0