${reps} Post On Session ZTBTSC uec/admin/save/enterprise-tax-info ${enterprise_data.encode('utf-8')}
${trader_baseinfo} Get On Session ZTBTSC uec/admin/get/enterprise/detail/by-org-id params=orgId=${trader_orgId} #获取代理商基础信息
${trader_Name} Get From Dictionary ${trader_baseinfo.json()["data"]} name
Set Global Variable ${trader_Name}
Create Session agent ${ztbscops} ${ztbsc_header}
${OrgData} Set Variable { \ \ \ \ "fullName":"测试代理商830" }
${reps} POST On Session agent ztb-user-enterprise-service/admin/scrap-paper/agent/create ${OrgData.encode('utf-8')}
${AgentId} Get From Dictionary ${reps.json()['data']} id #代理商id
${AgentOrgId} Get From Dictionary ${reps.json()['data']} organizationId #代理商组织id
Set Global Variable ${AgentOrgId}
sleep 0.5
#获取创建的代理商信息
${reps} GET On Session agent ztb-user-enterprise-service/admin/scrap-paper/agent/get/agent-list params=certificationStatus=&status=&pageNum=1&pageSize=10
${AgentList} Get From Dictionary ${reps.json()['data']} records #代理商列表
FOR ${items} IN @{AgentList}
${AgentOrgId} Get From Dictionary ${items} organizationId #代理商组织id
${AgentFullName} Get From Dictionary ${items} fullName #代理商组织名称
Exit For Loop If '${AgentOrgId}'=='${AgentOrgId}'
END
Set Global Variable ${AgentFullName}
#创建代理商店铺信息
${SaleNum} Evaluate random.randint(1000,3000) random #线下交易吨数
${OrgData} Set Variable { \ \ \ \ "fullName":"测试造纸厂830" }
${reps} POST On Session papermill ztb-user-enterprise-service/admin/paper-mill/create ${OrgData.encode('utf-8')}
${PaperMillId} Get From Dictionary ${reps.json()['data']} id #造纸厂id
${PaperMillOrgId} Get From Dictionary ${reps.json()['data']} organizationId #造纸厂组织id
Set Global Variable ${PaperMillId}
Set Global Variable ${PaperMillOrgId}
sleep 0.5
#获取创建的纸厂信息
${reps} GET On Session papermill ztb-user-enterprise-service/admin/paper-mill/get/paper-mill-list params=certificationStatus=&status=&pageNum=1&pageSize=10
${PaperList} Get From Dictionary ${reps.json()['data']} records #造纸厂列表
FOR ${items} IN @{PaperList}
${PaperOrgId} Get From Dictionary ${items} organizationId #纸厂组织id
${PaperFullName} Get From Dictionary ${items} fullName #纸厂组织名称
Exit For Loop If '${PaperOrgId}'=='${PaperMillOrgId}'
${reps} POST On Session papermill uec/admin/save/enterprise-tax-info ${TaxInfo.encode('utf-8')}
Sleep 0.5
create_supply
#选择代理纸厂匹配税点
Disable Warnings
Create Session ZTBTSC ${ztbscops} ${ztbsc_header}
${papermill_list} Get On Session ZTBTSC ztb-user-enterprise-service/admin/get/paper-mill-list/by-name params=pageNum=1&pageSize=30
${papermill_data} Get From Dictionary ${papermill_list.json()["data"]} records
FOR ${items} IN @{papermill_data}
${papermill_name} Get From Dictionary ${items} paperMillName
${papermill_orgid} Get From Dictionary ${items} paperMillOrgId
${papermill_id} Get From Dictionary ${items} paperMillId
Exit For Loop If '${papermill_name}'=='${papermill_Name}'
Information
#新增纸厂情报
#获取当前时间未添加情报纸厂列表
${statsDate} Get Current Date result_format=%Y-%m-%d #获取当前日期
Create Session information ${ztbscops} ${ztbsc_header}
${reps} GET On Session information ztb-supply-chain-service/admin/get/paper-mill-info/selectable-paper-mill-list params=pageNum=1&pageSize=30&statsDate=${statsDate}&paperMillName=${PaperFullName}
${PaperMillList} Get From Dictionary ${reps.json()['data']} records #选择时间没有情报的纸厂列表
FOR ${PpaerMill} IN @{PaperMillList}
${paperMillId} Get From Dictionary ${PpaerMill} paperMillId #造纸厂id
Exit For Loop If '${paperMillId}'=='${PaperMillId}'
END
Set Global Variable ${papermill_orgid}
${match_point_reps} Get On Session ZTBTSC ztb-supply-chain-service/admin/match/tax-point params=agentOrgId=${trader_orgId}&paperMillOrgId=${papermill_orgid}
Create Session information ${ztbscops} ${ztbsc_header}
${reps} POST On Session information ztb-supply-chain-service/admin/save/scrap-paper-category ${CategoryData.encode('utf-8')}
#获取纸厂品类信息
${paperMillCategory_info} Get On Session ZTBTSC /ztb-supply-chain-service/admin/get/paper-mill-purchase/scrap-paper-category-last-quote params=paperMillId=${papermill_id}
${quoteEffectiveTime} Get From Dictionary ${paperMillCategory_info.json()["data"]} quoteEffectiveTime
${paperCategoryQuoteVoList} Get From List ${paperMillCategory_info.json()["data"]} paperCategoryQuoteVoList
FOR ${list} IN ${paperCategoryQuoteVoList}
${paperMillScrapPaperCategoryId} Get From Dictionary ${list.json()} paperMillScrapPaperCategoryId
${paperMillScrapPaperCategoryName} Get From Dictionary ${list.json()} paperMillScrapPaperCategoryName
${quotedPrice} Get From Dictionary ${list.json()} quotedPrice
END
${reps} GET On Session information ztb-supply-chain-service/admin/list/scrap-paper-category/by/${paperMillId}
${CategoryId} Get From Dictionary ${reps.json()['data'][0]} id #纸厂品类id
${CategoryName} Get From Dictionary ${reps.json()['data'][0]} paperMillScrapPaperCategoryName #纸厂品类name
Set Global Variable ${CategoryId}
Set Global Variable ${CategoryName}
#发布纸厂品类报价
${Time} Get Time #获取当前时间
${quotedPrice} Evaluate round(random.uniform(1,2.5),2) random #随机获取纸厂价格
${reps} POST On Session information ztb-supply-chain-service/admin/create/scrap-paper-category-quote-effective-time ${CategoryQuotePrice.encode('utf-8')}
Set Global Variable ${quotedPrice}
#获取纸厂品类报价列表
${reps} GET On Session information ztb-supply-chain-service/admin/get/paper-mill-purchase/scrap-paper-category-quote-list params=paperMillId=${paperMillId}&pageNum=1&pageSize=10
${PaperMillQuoteId} Get From Dictionary ${reps.json()['data']['records'][0]} id #纸厂品类报价id
AgencyPaperMillContract
#创建代理纸厂合同
#选择纸厂
Create Session agent ${ztbscops} ${ztbsc_header}
${reps} GET On Session agent ztb-user-enterprise-service/admin/get/paper-mill-list/by-name params=pageNum=1&pageSize=30&keyword=${PaperFullName}
${paperMillId} Get From Dictionary ${reps.json()['data']['records'][0]} paperMillId #获取纸厂id
#获取代理商税务信息
${reps} GET On Session agent ztb-supply-chain-service/admin/match/tax-point params=agentOrgId=${AgentOrgId}&paperMillOrgId=${PaperMillOrgId}
${agentInputTaxPointList} Get From Dictionary ${reps.json()['data']} agentInputTaxPointList #代理商进项税点List
${2052} Get From List ${agentInputTaxPointList} 0
${2053} Get From List ${agentInputTaxPointList} 1
${2054} Get From List ${agentInputTaxPointList} 2
${agentSalesTaxPoint} Get From Dictionary ${reps.json()['data']} agentSalesTaxPoint #代理商销项税点
#创建代理支持供应链合同
${Time} Get Time #获取当前时间
${endTime} Get Current Date result_format=%Y-%m-%d 23:59:59
${endDate} Add Time To Date ${endTime} 30 days
${endDate} Get Substring ${endDate} 0 19
${startDate} Set Variable ${Time}
${Surcharge} Evaluate round(random.uniform(0.005,0.02),3) random #代理服务费
${accountPeriod} Evaluate random.randint(1,10) random #代理商付款账期(天)
${category_reps} Post On Session ZTBTSC ztb-supply-chain-service/admin/save/scrap-paper-category-quote ${category_data.encode('utf-8')}
Should Be Equal As Strings ${category_reps.json()["message"]} successful
${category_list_reps} Get On Session ZTBTSC ztb-supply-chain-service/admin/get/paper-mill-purchase/scrap-paper-category-quote-list params=paperMillId=${papermill_Id}&pageNum=1&pageSize=10
${quoteEffectiveTime} Get From Dictionary ${category_list_reps.json()["data"]["records"][0]} quoteEffectiveTime
${CategoryQuoteVoList} Get From Dictionary ${category_list_reps.json()["data"]["records"][0]} paperCategoryQuoteVoList
FOR ${index} ${items} IN ENUMERATE @{CategoryQuoteVoList}
${category_id} Evaluate [category_id['paperMillScrapPaperCategoryId']for category_id in ${items}]
#${category_name} Get From Dictionary ${items} paperMillScrapPaperCategoryName
#${publicSubsidies} Get From Dictionary ${items} publicSubsidies
#${publicSubsidies} Set Variable If ${publicSubsidies}==None 0 ${publicSubsidies}
#${quotedPrice} Get From Dictionary ${items} quotedPrice