|
|
@ -6,6 +6,7 @@
|
|
|
|
import sys
|
|
|
|
import sys
|
|
|
|
|
|
|
|
|
|
|
|
import sqlalchemy
|
|
|
|
import sqlalchemy
|
|
|
|
|
|
|
|
|
|
|
|
sys.path.append(".")
|
|
|
|
sys.path.append(".")
|
|
|
|
import jwt
|
|
|
|
import jwt
|
|
|
|
import base64
|
|
|
|
import base64
|
|
|
@ -16,6 +17,7 @@ from db_logic.db_base import Repository
|
|
|
|
from models.user_models import EntityUser
|
|
|
|
from models.user_models import EntityUser
|
|
|
|
from Common.Utils import Utils
|
|
|
|
from Common.Utils import Utils
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 用户操作业务逻辑类
|
|
|
|
# 用户操作业务逻辑类
|
|
|
|
class BllUser(Repository):
|
|
|
|
class BllUser(Repository):
|
|
|
|
|
|
|
|
|
|
|
@ -78,7 +80,8 @@ class BllUser(Repository):
|
|
|
|
return self.findEntity(payload.get('user_id'))
|
|
|
|
return self.findEntity(payload.get('user_id'))
|
|
|
|
|
|
|
|
|
|
|
|
# 用户管理
|
|
|
|
# 用户管理
|
|
|
|
def get_seach_user_list(self, user_code, real_name, role_name, is_enabled, page_param, user_id,role_name_self):
|
|
|
|
def get_seach_user_list(self, user_code, real_name, role_name, role_id, is_enabled, page_param, user_id,
|
|
|
|
|
|
|
|
role_name_self):
|
|
|
|
filter_base = ""
|
|
|
|
filter_base = ""
|
|
|
|
if user_code:
|
|
|
|
if user_code:
|
|
|
|
filter_base += f" user_code like '%{user_code}%'"
|
|
|
|
filter_base += f" user_code like '%{user_code}%'"
|
|
|
@ -90,20 +93,19 @@ class BllUser(Repository):
|
|
|
|
if filter_base:
|
|
|
|
if filter_base:
|
|
|
|
filter_base += " and "
|
|
|
|
filter_base += " and "
|
|
|
|
filter_base += f" role_name like '%{role_name}%'"
|
|
|
|
filter_base += f" role_name like '%{role_name}%'"
|
|
|
|
|
|
|
|
if role_id:
|
|
|
|
|
|
|
|
if filter_base:
|
|
|
|
|
|
|
|
filter_base += " and "
|
|
|
|
|
|
|
|
filter_base += f" role_id='{role_id}' "
|
|
|
|
if is_enabled:
|
|
|
|
if is_enabled:
|
|
|
|
if filter_base:
|
|
|
|
if filter_base:
|
|
|
|
filter_base += " and "
|
|
|
|
filter_base += " and "
|
|
|
|
filter_base += f" is_enabled={is_enabled}"
|
|
|
|
filter_base += f" is_enabled={is_enabled}"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# if role_name_self !='管理员':
|
|
|
|
# if filter_base:
|
|
|
|
# if filter_base:
|
|
|
|
# filter_base += " and "
|
|
|
|
# filter_base += " and "
|
|
|
|
# filter_base += f" user_id != '{user_id}' "
|
|
|
|
# filter_base += f" user_id = '{user_id}' "
|
|
|
|
# if filter_base:
|
|
|
|
|
|
|
|
# filter_base = f" where {filter_base}"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if role_name_self !='管理员':
|
|
|
|
|
|
|
|
if filter_base:
|
|
|
|
|
|
|
|
filter_base += " and "
|
|
|
|
|
|
|
|
filter_base += f" user_id = '{user_id}' "
|
|
|
|
|
|
|
|
if filter_base:
|
|
|
|
if filter_base:
|
|
|
|
filter_base = f" where {filter_base}"
|
|
|
|
filter_base = f" where {filter_base}"
|
|
|
|
|
|
|
|
|
|
|
@ -118,8 +120,6 @@ class BllUser(Repository):
|
|
|
|
sql_page = Utils.sql_paging_assemble(sql_all, page_param)
|
|
|
|
sql_page = Utils.sql_paging_assemble(sql_all, page_param)
|
|
|
|
return self.execute(sql_page).fetchall()
|
|
|
|
return self.execute(sql_page).fetchall()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# #根据条码获取用户
|
|
|
|
# #根据条码获取用户
|
|
|
|
# def getUserByBarCode(self, barCode):
|
|
|
|
# def getUserByBarCode(self, barCode):
|
|
|
|
# return self.findEntity(EntityUser.BarCode == barCode)
|
|
|
|
# return self.findEntity(EntityUser.BarCode == barCode)
|
|
|
|