|
|
@ -18,20 +18,42 @@ class BllModuleRelation(Repository):
|
|
|
|
|
|
|
|
|
|
|
|
def get_login_user_module_list(self, user_id, role_id):
|
|
|
|
def get_login_user_module_list(self, user_id, role_id):
|
|
|
|
sql_all = f"""
|
|
|
|
sql_all = f"""
|
|
|
|
select c.module_id, c.module_code, c.sort_index, c.module_name from(
|
|
|
|
select c.module_id, c.module_code, c.sort_index, c.module_name, c.module_type from(
|
|
|
|
|
|
|
|
|
|
|
|
SELECT a.module_id, b.module_code, b.sort_index, b.module_name
|
|
|
|
SELECT a.module_id, b.module_code, b.sort_index, b.module_name, b.module_type
|
|
|
|
from rms_module_relation as a
|
|
|
|
from rms_module_relation as a
|
|
|
|
LEFT JOIN rms_module as b on a.module_id=b.module_id
|
|
|
|
LEFT JOIN rms_module as b on a.module_id=b.module_id
|
|
|
|
WHERE object_id='{user_id}' AND object_type=2 AND b.module_type!=1
|
|
|
|
WHERE object_id='{user_id}' AND object_type=2 AND b.module_type!=1
|
|
|
|
UNION
|
|
|
|
UNION
|
|
|
|
SELECT a.module_id, b.module_code, b.sort_index, b.module_name
|
|
|
|
SELECT a.module_id, b.module_code, b.sort_index, b.module_name, b.module_type
|
|
|
|
from rms_module_relation as a
|
|
|
|
from rms_module_relation as a
|
|
|
|
LEFT JOIN rms_module as b on a.module_id=b.module_id
|
|
|
|
LEFT JOIN rms_module as b on a.module_id=b.module_id
|
|
|
|
WHERE object_id='{role_id}' AND object_type=1 AND b.module_type!=1
|
|
|
|
WHERE object_id='{role_id}' AND object_type=1 AND b.module_type!=1
|
|
|
|
) c ORDER BY c.sort_index asc
|
|
|
|
) c ORDER BY c.sort_index asc
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
return self.execute(sql_all).fetchall()
|
|
|
|
sql_data = self.execute(sql_all).fetchall()
|
|
|
|
|
|
|
|
data = Utils.msyql_table_model(sql_data)
|
|
|
|
|
|
|
|
data_dict = {
|
|
|
|
|
|
|
|
"client_manage": [],
|
|
|
|
|
|
|
|
"drug_manage": [],
|
|
|
|
|
|
|
|
"standard_manage": [],
|
|
|
|
|
|
|
|
"consumables_manage": [],
|
|
|
|
|
|
|
|
"instrument_manage": []
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
for i in data:
|
|
|
|
|
|
|
|
if i["module_type"] == "1":
|
|
|
|
|
|
|
|
data_dict["client_manage"].append(i)
|
|
|
|
|
|
|
|
elif i["module_type"] == "2":
|
|
|
|
|
|
|
|
data_dict["drug_manage"].append(i)
|
|
|
|
|
|
|
|
elif i["module_type"] == "3":
|
|
|
|
|
|
|
|
data_dict["standard_manage"].append(i)
|
|
|
|
|
|
|
|
elif i["module_type"] == "4":
|
|
|
|
|
|
|
|
data_dict["consumables_manage"].append(i)
|
|
|
|
|
|
|
|
elif i["module_type"] == "5":
|
|
|
|
|
|
|
|
data_dict["instrument_manage"].append(i)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return data_dict
|
|
|
|
|
|
|
|
# return self.execute(sql_all).fetchall()
|
|
|
|
|
|
|
|
|
|
|
|
def get_user_module_list(self, user_info):
|
|
|
|
def get_user_module_list(self, user_info):
|
|
|
|
sql_all = f"""
|
|
|
|
sql_all = f"""
|
|
|
|