*** Settings *** Library Collections Library RequestsLibrary Library DateTime Library requests *** Variables *** ${header} {'X-APP-ID':'470236309865238555','Authorization':'Token 6b08add42d6bcf73abb935b2adf83525','Content-Type':'application/json'} ${URL} http://api-ops-ztb-test.qniao.cn ${filepath} E:\lyl\图片\ChMkKWCUz0SIX9MmADmjEvANMxkAAOa3QAAAAAAOaMq795.jpg *** Test Cases *** get-order-item-list #查找预约的订单列表 Create Session ZTBT ${URL} ${header} ${reps} Get On Session ZTBT recycle-service/admin/customer-service/get/proxy-order-item-list params=orderType=${orderType} &pageNum=1&pageSize=10&status=51&orderId=${orderId} log ${reps.json()} ${orderItemId} Get From Dictionary ${reps.json()["data"]["records"][0]} orderItemId #订单项编号 Set Global Variable ${orderItemId} Should Be Equal As Strings ${reps.json()["data"]["records"][0]["orderId"]} ${orderId} get-order-item-details #查看订单列表详情 Create Session ZTBT ${URL} ${header} #${data} Set Variable orderId=${orderId} orderItemId=${orderItemId} ${reps} Get On Session ZTBT recycle-service/admin/customer-service/get/proxy-order/${orderId} params=orderId=${orderId}&orderItemId=${orderItemId} ${contractId} Get From Dictionary ${reps.json()["data"]["orderItems"][0]} contractId #当前订单下单时的合同id ${unitSurcharge} Get From Dictionary ${reps.json()["data"]} unitSurcharge #代卖费 ${proxySellerSettleType} Get From Dictionary ${reps.json()["data"]} proxySellerSettleType #代卖费结算方式 log ${contractId} Set Global Variable ${contractId} ${unitSurcharge} log ${reps.json()} get-Transaction subject #获取交易主体 Create Session ZTBT ${URL} ${header} ${reps} Get On Session ZTBT recycle-service/admin/transaction-main-enterprise/list/name ${交易} Get From Dictionary ${reps.json()} data #随机获取交易主体 ${交易主体} Evaluate random.choice(${交易}) random log to console \nvalue:${交易主体} Set Global Variable ${交易主体} get-Warehouse #获取所属仓库 Create Session ZTBT ${URL} ${header} ${reps} Get On Session ZTBT recycle-service/admin/transaction-main-enterprise/get/warehouse-name ${仓库} Get From Dictionary ${reps.json()} data #随机获取仓库 ${所属仓库} Evaluate random.choice(${仓库}) random log to console \nvalue:${所属仓库} Set Global Variable ${所属仓库} get-Source of funds #获取资金来源 Create Session ZTBT ${URL} ${header} ${reps} Get On Session ZTBT recycle-service/admin/fund-source/get/list ${isDefault} Set Variable 1 Run Keyword If ${isDefault}==1 log ${reps.json()["data"][5]["name"]} Set Global Variable ${isDefault} get-contract-list #获取订单纸厂的所有合同信息 Create Session ZTBT ${URL} ${header} ${reps} Get On Session ZTBT /recycle-service/admin/contract/get/selectable-contract-list params=orderItemId=${orderItemId} log ${reps.json()} get-supplier #获取纸厂供应商 Create Session ZTBT ${URL} ${header} ${reps} Get On Session ZTBT recycle-service/admin/customer-service/get/paper-mill-merchant/${paperMillId} params=paperMillId=${paperMillId} log ${reps.json()} get-category price #获取下单品类,上传磅单时的价格 Create Session ZTBT ${URL} ${header} ${dataTime} Get Current Date result_format=%Y-%m-%d ${reps} Get On Session ZTBT recycle-service/admin/proxy-sell/get-category-price-by-date params=orderItemId=${orderItemId}&weightDay=${dataTime} log ${reps.json()} ${price} Get From Dictionary ${reps.json()["data"][0]} price #下单品类价格 ${publicSubsidies} Get From Dictionary ${reps.json()["data"][0]} publicSubsidies #下单品类公开补贴 Set Global Variable ${price} Set Global Variable ${publicSubsidies} get_paper-mill-category #获取当前纸厂的所有纸品品类 Create Session ZTBT ${URL} ${header} ${reps} Get On Session ZTBT recycle-service/admin/paperMill/get/paper-mill-category/${paperMillId} params=id=${paperMillId} log ${reps.json()} get_contract_by_id #获取下单时绑定的合同 Create Session ZTBT ${URL} ${header} ${reps} Get On Session ZTBT recycle-service/admin/contract/get/detail-by-id params=id=${contractId} log ${reps.json()} #获取垫资费、企业ID、应收金额结算规则、含税结算单价结算规则 ${advanceFund} Get From Dictionary ${reps.json()["data"]} advanceFund #垫资费 ${buyerEnterpriseId} Get From Dictionary ${reps.json()["data"]} buyerEnterpriseId #企业id ${settleRules} Get From Dictionary ${reps.json()["data"]} settleRules #应收金额结算规则 ${settlePriceIncludeTaxSettleRules} Get From Dictionary ${reps.json()["data"]} settlePriceIncludeTaxSettleRules #含税结算单价结算规则 ${taxRefundRate} Get From Dictionary ${reps.json()["data"]} taxRefundRate #税点 ${proxyPaySurcharge} Get From Dictionary ${reps.json()["data"]} proxyPaySurcharge #代收费 ${hasInvoice} Get From Dictionary ${reps.json()["data"]} hasInvoice #是否开票 ${accountPeriodType} Get From Dictionary ${reps.json()["data"]} accountPeriodType #账期类型 ${isSubsidyAndDeductIncludeTax} Get From Dictionary ${reps.json()["data"]} isSubsidyAndDeductIncludeTax #纸厂补贴是否含税 Set Global Variable ${advanceFund} ${taxRefundRate} ${proxyPaySurcharge} ${hasInvoice} ${accountPeriodType} ${settleRules} ${settlePriceIncludeTaxSettleRules} Set Global Variable ${buyerEnterpriseId} ${isSubsidyAndDeductIncludeTax} Upload_pictures #上传图片 #${dict} Create Dictionary Content-Type=image/jpeg filename=20210803.jpg #Create Session ZTBT ${URL} ${dict} ${filepath} Evaluate open('E:/lyl/pict/21042217001449712.png','rb') ${image} Evaluate open('E:/lyl/pict/21042217001449712.png','rb') ${file} Create Dictionary filepath=${filepath} image=${image} Create Session ZTBT ${URL} log ${file} ${result} Post On Session ZTBT recycle-user-center/upload/image files=${file} ${pictures} Get From Dictionary ${result.json()} data log ${result.content} Set Global Variable ${pictures} get_repeat_proxy-order #获取重复订单信息 Create Session ZTBT ${URL} ${header} ${reps} Get On Session ZTBT recycle-service/admin/customer-service/get/repeat/proxy-order params=orderItemId=${orderItemId}&plateNumber=${plateNumber}&settleWeight=9000&weighingDate=${datatime}&orderType=${orderType} log ${reps.json()} Should Be Equal As Strings ${reps.json()["message"]} successful Submit_pound #提交磅单 Create Session ZTBT ${URL} ${header} ${data} Set Variable ${reps} Post On Session ZTBT