纸通宝交易版
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

207 lines
15 KiB

*** Settings ***
Library requests
Library Collections
Library RequestsLibrary
Library DateTime
*** Variables ***
${header} {'X-APP-ID':'470236309865238555','Authorization':'${gettoken}','Content-Type':'application/json'}
${URL} http://api-ops-ztb-test.qniao.cn
*** Test Cases ***
get_proxy-order-item-list
#查找预约的订单项列表
Create Session ZTBT ${URL} ${header}
${reps} Get On Session ZTBT recycle-service/admin/customer-service/get/proxy-order-item-list params=pageNum=1&pageSize=10&orderType=2&status=51&weightNoteType=2&orderItemId=${orderItemId}
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_proxy-order-details
#查看订单详情
Create Session ZTBT ${URL} ${header}
${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 #代卖费结算方式
${paperCategoryId} Get From Dictionary ${reps.json()["data"]} paperCategoryId #纸厂品类ID
${unitPrice} Get From Dictionary ${reps.json()["data"]} paperCategoryPrice #品类单价
${publicSubsidies} Get From Dictionary ${reps.json()["data"]["orderItems"][0]} publicSubsidies #公开补贴
${millSupplierId} Get From Dictionary ${reps.json()["data"]} millSupplierId #纸厂供应商ID
${paperMillSupplierName} Get From Dictionary ${reps.json()["data"]} paperMillSupplierName #纸厂供应商名称
${surcharge} Get From Dictionary ${reps.json()["data"]["orderItems"][0]} surcharge #代卖费总额
${contractId} Get From Dictionary ${reps.json()["data"]["orderItems"][0]} contractId #合同id
${paymentType} Get From Dictionary ${reps.json()["data"]["orderItems"][0]} paymentType #支付类型
${activityNoteStatus} Get From Dictionary ${reps.json()["data"]["orderItems"][0]} activityNoteStatus #活动状态
${交易主体id} Get From Dictionary ${reps.json()["data"]} transactionMainEnterpriseId #交易主体id
${交易主体name} Get From Dictionary ${reps.json()["data"]} transactionMainEnterpriseName #交易主体name
${publicSubsidies} Set Variable If '${publicSubsidies}'=='${null}' 0 ${publicSubsidies}
${settleUtiPrice}= Evaluate ${unitPrice}+${publicSubsidies} #结算单价
log ${contractId}
Set Global Variable ${contractId}
Set Global Variable ${unitSurcharge}
Set Global Variable ${paperCategoryId}
Set Global Variable ${settleUtiPrice}
Set Global Variable ${unitPrice}
Set Global Variable ${publicSubsidies}
Set Global Variable ${millSupplierId}
Set Global Variable ${paperMillSupplierName}
Set Global Variable ${proxySellerSettleType}
Set Global Variable ${contractId}
Set Global Variable ${surcharge}
Set Global Variable ${paymentType}
Set Global Variable ${activityNoteStatus}
Set Global Variable ${交易主体name}
Set Global Variable ${交易主体id}
get_delivery-info
#获取订单名片信息
Create Session ZTBT ${URL} ${header}
${reps} Get On Session ZTBT recycle-service/admin/proxy-sell/get/proxy-order/delivery-info/${orderItemId}
log ${reps.json()}
${plateNumber} Get From Dictionary ${reps.json()["data"]} plateNumber #车牌号
${settleUtiPrice} Get From Dictionary ${reps.json()["data"]} settleUtiPrice #结算单价
${settleUtiPriceIncludeTaxType} Get From Dictionary ${reps.json()["data"]} settleUtiPriceIncludeTaxType #含税补贴价类型
${netWeight} Get From Dictionary ${reps.json()["data"]} netWeight #净重
Set Global Variable ${plateNumber}
Set Global Variable ${settleUtiPrice}
Set Global Variable ${settleUtiPriceIncludeTaxType}
Set Global Variable ${netWeight}
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_weightnote
Create Session ZTBT ${URL} ${header}
${reps} Post On Session ZTBT recycle-service/admin/proxy-sell/get/weightnote/${weightnoteId}
log ${reps.json()}
get_paperMill-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-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
log ${reps.json()}
${data} Get From Dictionary ${reps.json()} data
FOR ${item} IN @{data}
log ${item}
${isDefault} Get From Dictionary ${item} isDefault #获取启用状态
${name} Get From Dictionary ${item} name #获取name
${id} Get From Dictionary ${item} id #获取id
Exit For Loop If '${isDefault}'=='1'
END
Set Global Variable ${name}
Set Global Variable ${id}
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 #纸厂补贴是否含税
${receivableSettlementRules} Get From Dictionary ${reps.json()["data"]} settleRules #应收金额结算规则
${settlePriceIncludeTaxSettleRules} Get From Dictionary ${reps.json()["data"]} settlePriceIncludeTaxSettleRules #含税结算单价结算规则
${advanceFund} Set Variable If '${advanceFund}'=='${None}' 0 ${advanceFund}
${proxyPaySurcharge} Set Variable If '${proxyPaySurcharge}'=='${None}' 0 ${proxyPaySurcharge}
Set Global Variable ${advanceFund}
Set Global Variable ${buyerEnterpriseId}
Set Global Variable ${taxRefundRate}
Set Global Variable ${proxyPaySurcharge}
Set Global Variable ${hasInvoice}
Set Global Variable ${accountPeriodType}
Set Global Variable ${settleRules}
Set Global Variable ${settlePriceIncludeTaxSettleRules}
Set Global Variable ${isSubsidyAndDeductIncludeTax}
Set Global Variable ${receivableSettlementRules}
Set Global Variable ${settlePriceIncludeTaxSettleRules}
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}
Set Global Variable ${dataTime}
Upload_pictures
#上传图片
#${dict} Create Dictionary Content-Type=image/jpeg filename=20210803.jpg
#Create Session ZTBT ${URL} ${dict}
${filepath} Evaluate open('./21042217001449712.png','rb')
${image} Evaluate open('./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}
#${datatime}
${reps} Get On Session ZTBT recycle-service/admin/customer-service/get/repeat/proxy-order params=orderItemId=${orderItemId}&plateNumber=${carList}&settleWeight=13550&weighingDate=${datatime}&orderType=${orderType}
log ${reps.json()}
Should Be Equal As Strings ${reps.json()["message"]} successful
weightnote
#提交磅单
Create Session ZTBT ${URL} ${header}
${datatime} Get Current Date result_format=%Y-%m-%d
${data} Set Variable { \ \ \ \ "id":"${weightNoteId}", \ \ \ \ "orderId":"${orderId}", \ \ \ \ "orderItemId":"${orderItemId}", \ \ \ \ "type":null, \ \ \ \ "weightDay":"${datatime}", \ \ \ \ "settleDay":"${datatime}", \ \ \ \ "settleUtiPrice":"${settleUtiPrice}", \ \ \ \ "netWeight":"${netWeight}", \ \ \ \ "settleWeight":16200, \ \ \ \ "deductedPoint":7.5, \ \ \ \ "unitSurcharge":"${unitSurcharge}", \ \ \ \ "surcharge":"${surcharge}", \ \ \ \ "adjustMoney":"20", \ \ \ \ "remark":"${datatime}", \ \ \ \ "imageUrls":null, \ \ \ \ "transactionMainEnterpriseid":"${交易主体id}", \ \ \ \ \ "transactionMainEnterpriseName":"${交易主体name}", \ \ \ \ "warehouseName":"${所属仓库}", \ \ \ \ "settlePrice":22585.5, \ \ \ \ "activitySettleType":"${activitySettleType}", \ \ \ \ "proxySellerSettleType":"${proxySellerSettleType}", \ \ \ \ "publicSubsidies":0, \ \ \ \ "unitPrice":"${unitPrice}", \ \ \ \ "plateNumber":"${plateNumber}", \ \ \ \ "remarkImgs":[ \ \ \ \ \ \ \ \ "${pictures}" \ \ \ \ ], \ \ \ \ "otherAmountList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "unitType":1, \ \ \ \ \ \ \ \ \ \ \ \ "unitAmount":0.001, \ \ \ \ \ \ \ \ \ \ \ \ "title":"freightSubsidies", \ \ \ \ \ \ \ \ \ \ \ \ "isSubsidies":1 \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "unitType":1, \ \ \ \ \ \ \ \ \ \ \ \ "unitAmount":0.001, \ \ \ \ \ \ \ \ \ \ \ \ "title":"otherSubsidies", \ \ \ \ \ \ \ \ \ \ \ \ "isSubsidies":1 \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "unitType":1, \ \ \ \ \ \ \ \ \ \ \ \ "unitAmount":0.002, \ \ \ \ \ \ \ \ \ \ \ \ "title":"contrabandPenalty", \ \ \ \ \ \ \ \ \ \ \ \ "isSubsidies":0 \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "unitType":2, \ \ \ \ \ \ \ \ \ \ \ \ "unitAmount":20, \ \ \ \ \ \ \ \ \ \ \ \ "title":"nonStandardPenalty", \ \ \ \ \ \ \ \ \ \ \ \ "isSubsidies":0 \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "unitType":2, \ \ \ \ \ \ \ \ \ \ \ \ "unitAmount":10, \ \ \ \ \ \ \ \ \ \ \ \ "title":"otherPenalty", \ \ \ \ \ \ \ \ \ \ \ \ "isSubsidies":0 \ \ \ \ \ \ \ \ } \ \ \ \ ], \ \ \ \ "isInvoice":"${hasInvoice}", \ \ \ \ "invoicePoint":"${taxRefundRate}", \ \ \ \ "receivableSettlementRules":"${receivableSettlementRules}", \ \ \ \ "refundSubsidy":0.003, \ \ \ \ "receivableAdjustMoney":"20", \ \ \ \ "settleUtiPriceIncludeTax":1.337448648648649, \ \ \ \ "settleUtiPriceIncludeTaxType":"${settleUtiPriceIncludeTaxType}", \ \ \ \ "collectionCharges":"${proxyPaySurcharge}", \ \ \ \ "advanceFund":"${advanceFund}", \ \ \ \ "millSupplierId":"${supplier_id}", \ \ \ \ "millSupplierName":"${millSupplierName}", \ \ \ \ "contractId":"${contractId}", \ \ \ \ "settlePriceIncludeTaxSettleRules":"${settlePriceIncludeTaxSettleRules}", \ \ \ \ "paperCategoryId":"${categoryId}", \ \ \ \ "deductionNotes":"${datatime}", \ \ \ \ "imageUrl":[ \ \ \ \ \ \ \ \ "${pictures}" \ \ \ \ ], \ \ \ \ "deductedWeight":1.5, \ \ \ \ "orderType":"${orderType}" }
log ${data}
${reps} Post On Session ZTBT recycle-service/admin/proxy-sell/update/weightnote ${data.encode('utf-8')}
log ${reps.json()["data"]}
${weightNoteId} Get From Dictionary ${reps.json()["data"]} weightNoteId
Set Global Variable ${weightNoteId}
Should Be Equal As Strings ${reps.json()["message"]} successful
audit_weightnote
Create Session ZTBT ${URL} ${header}
${repsonse} Post On Session ZTBT recycle-service/admin/customer-service/audit/weightnote/${weightNoteId}
log ${repsonse.json()}
get_proxy-order
Create Session ZTBT ${URL} ${header}
${reps} Get On Session ZTBT recycle-service/admin/customer-service/get/proxy-order/${orderId} params=orderId=${orderId}&orderItemId=${orderItemId}
log ${reps.json()}
Should Be Equal As Strings ${reps.json()["message"]} successful