kboss/b/hpc/binding_search.dspy
2025-07-16 14:27:17 +08:00

30 lines
1.0 KiB
Plaintext

async def binding_search(ns={}):
"""
绑定济南超算ldap账号
:param ns:
:return:
"""
db = DBPools()
async with db.sqlorContext('kboss') as sor:
try:
bind_list = []
custos = await sor.R('customer', {'salemanid': await get_user(), 'del_flg': '0'})
custos_ids = [item.get('customerid') for item in custos]
bindings_sql = """select * from jncs_usermapping where del_flg='0';"""
bindingss = await sor.sqlExe(bindings_sql, {})
for bindss in bindingss:
orgidss = bindss.get('orgid')
if orgidss and orgidss in custos_ids:
bind_list.append(bindss)
return {
'status': '查找绑定过的用户成功',
'data': bind_list
}
except Exception as e:
raise e
return {
'status': False,
'msg': '查找绑定过的用户失败'
}
ret = await binding_search(params_kw)
return ret