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

70 lines
2.4 KiB
Plaintext

async def resellerOrgUpdate(ns={}):
"""
update reseller organization
`id` VARCHAR(32) comment '机构编码',
`orgname` VARCHAR(100) comment '机构名称',
`contactor` VARCHAR(32) comment '联系人',
`contactor_phone` VARCHAR(100) comment '联系人电话',
`province_id` VARCHAR(32) comment '所在省id',
`city_id` VARCHAR(32) comment '所在城市id',
`distinct_id` VARCHAR(32) comment '所在地区id',
`address` VARCHAR(400) comment '地址',
`main_business` VARCHAR(1000) comment '主营业务描述',
`orgcode` VARCHAR(100) comment '组织结构代码',
`license_img` VARCHAR(400) comment '营业执照',
`id_img` VARCHAR(400) comment '身份证',
`parentid` VARCHAR(32) comment '父机构id',
`org_type` VARCHAR(1) comment '机构类型',
`accountid` VARCHAR(32) comment '账号',
:param ns:
:return:
"""
ns_org = {
'id': ns.get('id'),
'orgname': ns.get('orgname') or '',
'contactor': ns.get('contactor') or '',
'contactor_phone': ns.get('contactor_phone') or '',
'province_id': ns.get('province_id') or '',
'city_id': ns.get('city_id') or '',
'distinct_id': ns.get('distinct_id') or '',
'address': ns.get('address') or '',
'main_business': ns.get('main_business') or '',
'orgcode': ns.get('orgcode') or '',
'license_img': ns.get('license_img') or '',
'id_img': ns.get('id_img') or '',
'org_type': ns.get('org_type') or '',
'accountid': ns.get('accountid') or '',
}
ns_reseller = {
'id': ns.get('reseller_table_id'),
'settle_mode': ns.get('settle_mode') or '',
'settle_flow': ns.get('settle_flow') or '',
'settle_datep': ns.get('settle_datep') or ''
}
if not ns:
return {
"status": False,
"message": "get no params..."
}
db = DBPools()
async with db.sqlorContext('kboss') as sor:
try:
await sor.U('organization', ns_org)
await sor.U('reseller', ns_reseller)
return {
"status": True,
"msg": "reseller organization update success"
}
except Exception as e:
raise e
return {
"status": False,
"message": "reseller organization update failed"
}
ret = await resellerOrgUpdate(params_kw)
return ret