bugfix
This commit is contained in:
parent
d98479ee6e
commit
e7381291e8
@ -258,12 +258,12 @@ class PricingProgram:
|
|||||||
if not recs:
|
if not recs:
|
||||||
debug(f'id={ppid} pricing_program not found')
|
debug(f'id={ppid} pricing_program not found')
|
||||||
r = recs[0]
|
r = recs[0]
|
||||||
recs = await sor.R('pricing_program', {'id': r.ppid})
|
recs = await sor.R('pricing_program', {'id': r.ppid})
|
||||||
x = DictObject(** yaml.safe_load(r.pricing_data))
|
x = DictObject(** yaml.safe_load(r.pricing_data))
|
||||||
fields = x
|
fields = x
|
||||||
if x.get('fields'):
|
if x.get('fields'):
|
||||||
fields = x['fields']
|
fields = x['fields']
|
||||||
data = x.get('pricings')
|
data = x.get('pricings')
|
||||||
|
|
||||||
fpath = write_pattern_xlsx(recs[0].name, fields, data=data)
|
fpath = write_pattern_xlsx(recs[0].name, fields, data=data)
|
||||||
return fpath
|
return fpath
|
||||||
@ -345,7 +345,7 @@ class PricingProgram:
|
|||||||
async def buffered_charging(ppid, data):
|
async def buffered_charging(ppid, data):
|
||||||
r = await PricingProgram.get_ppid_pricing(ppid)
|
r = await PricingProgram.get_ppid_pricing(ppid)
|
||||||
prices = PricingProgram.get_pricing_from_ymalstr(data,
|
prices = PricingProgram.get_pricing_from_ymalstr(data,
|
||||||
r.pricing_data)
|
r.pricing_data)
|
||||||
amt = 0.0
|
amt = 0.0
|
||||||
for p in prices:
|
for p in prices:
|
||||||
p.cost = p.amount * r.discount
|
p.cost = p.amount * r.discount
|
||||||
@ -514,11 +514,11 @@ if __name__ == '__main__':
|
|||||||
MyLogger('Pricing', levelname='info')
|
MyLogger('Pricing', levelname='info')
|
||||||
yamlstr = """fields:
|
yamlstr = """fields:
|
||||||
formula:
|
formula:
|
||||||
label: 计算公式
|
label: 计算公式
|
||||||
type: str
|
type: str
|
||||||
model:
|
model:
|
||||||
label: 模型
|
label: 模型
|
||||||
type: str
|
type: str
|
||||||
model_mappings: # 模型映射
|
model_mappings: # 模型映射
|
||||||
"doubao-seed-2-0-pro-260215": "doubao-seed-2-0-pro"
|
"doubao-seed-2-0-pro-260215": "doubao-seed-2-0-pro"
|
||||||
"doubao-seed-2-0-lite-260215": "doubao-seed-2-0-lite"
|
"doubao-seed-2-0-lite-260215": "doubao-seed-2-0-lite"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user