res = context['input_data']['t_data']
product = context['input_data']['product']
res_product = {}
for p in product:
res_product[p['name']] = p['code']
t_data = res['t_data']
detail = t_data['采购明细']
result=[]
for i in detail:
dic={}
productCode = i['采购明细_物品名称']
if productCode in res_product:
productCode = res_product[productCode]
dic['productCode']=productCode
dic['warehouseCode']='DEFALUT'
dic['spec']=i['采购明细_型号或规格']
dic['isFreeGift']='0'
dic['taxPct']='0'
dic['transQty']=str(i['采购明细_数量'])
dic['transUomName']='米'
dic['price']=i['采购明细_金额']
dic['amount']=str(i['采购明细_金额'])
dic['comments']=i['采购明细_备注']
result.append(dic)
output={'result':result}