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

27 lines
1.1 KiB
Plaintext

async def client_product_approve(ns={}):
"""
apv_id={processInstanceId}&status={status}
:param ns:
:return:
"""
if not ns.get('apv_id'):
return {'status': False, 'msg': '审核失败'}
if ns.get('apv_id'):
if ns.get('status') != 'agree':
return {'status': False, 'msg': '审核失败'}
db = DBPools()
async with db.sqlorContext('kboss') as sor:
apv_json = (await sor.R('apv_data', {'apv_id': ns.get('apv_id')}))[0]['apv_json']
apv_dic = json.loads(apv_json)
callback_flag = apv_dic['callback_flag']
if callback_flag == 'single_discount':
return await path_call('../product/xiaoshou_gai_zhekou_dijia.dspy', apv_dic)
elif callback_flag == 'single_price':
return await path_call('../product/xiaoshou_gai_zhekou_dijia.dspy', apv_dic)
elif callback_flag == 'uniform_discount':
return await path_call('../product/discount_guanli_jia.dspy', apv_dic)
elif callback_flag == 'uniform_price':
return await path_call('../product/price_guanli_jia.dspy', apv_dic)
ret = await client_product_approve(params_kw)
return ret