|
@@ -15,6 +15,7 @@ from common.db import db_event_management, db_user, db_area, db_emergency_plan
|
|
|
from common.security import valid_access_token
|
|
|
import traceback
|
|
|
from utils import *
|
|
|
+import uuid
|
|
|
from utils.ry_system_util import *
|
|
|
from datetime import datetime, timedelta
|
|
|
from common.db import db_dict
|
|
@@ -104,10 +105,10 @@ def get_dept_tree2(db: Session, tag_id: int = None) -> Dict:
|
|
|
tags = db.query(SysTag).filter(SysTag.tag_id.in_(user_tags_subquery)).all()
|
|
|
return [{"tag_id": tag.tag_id, "tag_name": tag.tag_name} for tag in tags]
|
|
|
def build_dept_tree(depts, parent_dept):
|
|
|
-
|
|
|
+ dept_tree = []
|
|
|
for dept_info in depts:
|
|
|
dept = {
|
|
|
- "uuid":new_guid().replace('-',''),
|
|
|
+ "uuid":str(uuid.uuid4()).replace('-',''),
|
|
|
"id": dept_info.dept_id,
|
|
|
"label": dept_info.dept_name,
|
|
|
"deptType": True
|
|
@@ -120,7 +121,7 @@ def get_dept_tree2(db: Session, tag_id: int = None) -> Dict:
|
|
|
users = db.query(SysUser).filter(SysUser.dept_id == dept_info.dept_id).filter(SysUser.del_flag != '2').all()
|
|
|
for user_info in users:
|
|
|
user = {
|
|
|
- "uuid": new_guid().replace('-', ''),
|
|
|
+ "uuid": str(uuid.uuid4()).replace('-', ''),
|
|
|
"id": user_info.user_id,
|
|
|
"label": user_info.user_name,
|
|
|
"deptType": False,
|