32 lines
847 B
Plaintext
32 lines
847 B
Plaintext
async def specification_template_add(ns={}):
|
|
"""
|
|
规格模板加
|
|
:param ns:
|
|
:return:
|
|
"""
|
|
ns_template = {
|
|
'id': uuid(),
|
|
'orgid': ns.get('orgid'),
|
|
'providerid': ns.get('providerid'),
|
|
'patternname': ns.get('patternname'),
|
|
'productid': ns.get('productid'),
|
|
'spec_pattern': ns.get('spec_pattern')
|
|
}
|
|
db = DBPools()
|
|
async with db.sqlorContext('kboss') as sor:
|
|
try:
|
|
await sor.C('specification',ns_template)
|
|
return {
|
|
"status": True,
|
|
"msg": "add specification template success"
|
|
}
|
|
except Exception as e:
|
|
raise e
|
|
return {
|
|
"status": False,
|
|
"msg": "add specification template failed"
|
|
}
|
|
|
|
|
|
ret = await specification_template_add(params_kw)
|
|
return ret |