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