纸通宝工厂版
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.
 
 

70 lines
5.6 KiB

*** Settings ***
Library Collections
Library RequestsLibrary
*** Test Cases ***
ReceiptOrder
#创建厂内收货订单--手工单
Create Session ztbf ${ztbClient} ${client_header}
${unitPrice} Set Variable 1.8
${netWeight} Set Variable 11000
${settleWeight} Set Variable 11000
${settlePrice} Evaluate ${unitPrice}*${settleWeight}
${data} Set Variable { \ \ \ \ "deductType":1, \ \ \ \ "isWithoutTare":0, \ \ \ \ "status":null, \ \ \ \ "factoryCustomerId":"${CustomerId}", \ \ \ \ "factoryCustomerName":"${name}", \ \ \ \ "netWeight":"${netWeight}", \ \ \ \ "settleWeight":"${settleWeight}", \ \ \ \ "plateNumber":"55555", \ \ \ \ "productInfoList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "productId":"${categoryId}", \ \ \ \ \ \ \ \ \ \ \ \ "productName":"${categoryName}", \ \ \ \ \ \ \ \ \ \ \ \ "unitPrice":"${unitPrice}", \ \ \ \ \ \ \ \ \ \ \ \ "konePrice":"指导价格:${defaultUnitPrice}", \ \ \ \ \ \ \ \ \ \ \ \ "highestUnitPrice":"${highestUnitPrice}", \ \ \ \ \ \ \ \ \ \ \ \ "lowestUnitPrice":0, \ \ \ \ \ \ \ \ \ \ \ \ "settleWeight":"${settleWeight}", \ \ \ \ \ \ \ \ \ \ \ \ "settlePrice":"${settlePrice}" \ \ \ \ \ \ \ \ } \ \ \ \ ] }
${reps} POST On Session ztbf ztb-factory/save/scrap-paper-onside-receipt-order ${data.encode('utf-8')}
${OrderId} Get From Dictionary ${reps.json()} data
Set Global Variable ${OrderId}
#审核过磅单
${auditData} Set Variable {"id":"${OrderId}"}
${reps} POST On Session ztbf ztb-factory/factory/audit-pass/order ${auditData.encode('utf-8')}
#支付订单:现金、银行卡支付
${paymentData} Set Variable {"settleType":2,"ids":["${OrderId}"]}
${reps} POST On Session ztbf ztb-factory/wechat-applet/merge-receiving-pay-order/pay ${paymentData.encode('utf-8')}
ReceiptWeigh
#厂内收货--刷卡过磅
#获取客户列表
Create Session ztbf ${ztbClient} ${client_header}
${reps} GET On Session ztbf ztb-factory/factory/get/customer-list params=name=&pageNum=1&pageSize=1500
${customerList} Get From Dictionary ${reps.json()['data']} records #客户列表
FOR ${CustomerInfo} IN @{customerList}
${name} Get From Dictionary ${CustomerInfo} name #客户姓名
${cardNo} Get From Dictionary ${CustomerInfo} cardNo #客户卡ID
${CustomerId} Get From Dictionary ${CustomerInfo} id #客户唯一标识
Exit For Loop If '${CustomerId}'=='136'
END
#刷卡过磅--过毛重
${weight} Set Variable 2410
${weighData} Set Variable {"cardNo":"${cardNo}","weight":${weight}}
${reps} POST On Session ztbf ztb-factory/factory-customer/save/order ${weighData.encode('utf-8')}
${orderId} Get From Dictionary ${reps.json()['data']} id #订单id
Set Global Variable ${orderId}
Should Be Equal As Strings ${reps.json()["message"]} 毛重称重成功,${weight}公斤,请下地磅
#定价详情
${reps} GET On Session ztbf ztb-factory/factory/wechat-applet/get/order-detail/${orderId}
${plateNumber} Get From Dictionary ${reps.json()['data']} plateNumber #车牌号
${isWithoutTare} Get From Dictionary ${reps.json()['data']} isWithoutTare #是否无皮过磅,0否1是
${proportionOfProduct} Get From Dictionary ${reps.json()['data']} proportionOfProduct
${plateNumber} Set Variable If '${plateNumber}'=='${None}' null ${plateNumber}
#确定定价
${unitPrice} Set Variable 1.88
${submitData} Set Variable { \ \ \ \ "id":"${orderId}", \ \ \ \ "productInfoDtoList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "productId":"${categoryId}", \ \ \ \ \ \ \ \ \ \ \ \ "productName":"${categoryName}", \ \ \ \ \ \ \ \ \ \ \ \ "unitPrice":"2.1", \ \ \ \ \ \ \ \ \ \ \ \ "proportionOfProduct":"${proportionOfProduct}", \ \ \ \ \ \ \ \ \ \ \ \ "konePrice":"指导价格:${defaultUnitPrice}", \ \ \ \ \ \ \ \ \ \ \ \ "highestUnitPrice":"${highestUnitPrice}", \ \ \ \ \ \ \ \ \ \ \ \ "lowestUnitPrice":0 \ \ \ \ \ \ \ \ } \ \ \ \ ], \ \ \ \ "plateNumber":${plateNumber}, \ \ \ \ "factoryCustomerId":"${CustomerId}", \ \ \ \ "deductType":1, \ \ \ \ "inspectionRemark":"确定定价", \ \ \ \ "isWithoutTare":"${isWithoutTare}" }
${reps} POST On Session ztbf ztb-factory/factory/submit/order-price ${submitData.encode('utf-8')}
#刷卡过磅--过皮重
${weightTare} Set Variable 2000
${weighData} Set Variable {"cardNo":"${cardNo}","weight":${weightTare}}
${reps} POST On Session ztbf ztb-factory/factory-customer/save/order ${weighData.encode('utf-8')}
${orderId} Get From Dictionary ${reps.json()['data']} id #订单id
Should Be Equal As Strings ${reps.json()["message"]} 皮重称重成功,${weightTare}公斤,正在打印磅单
#过磅审核
${auditData} Set Variable {"id":"${OrderId}"}
${reps} POST On Session ztbf ztb-factory/factory/audit-pass/order ${auditData.encode('utf-8')}
#支付订单--千鸟代付
${paymentData} Set Variable {"settleType":3,"ids":["${OrderId}"]}
${reps} POST On Session ztbf ztb-factory/wechat-applet/merge-receiving-pay-order/pay ${paymentData.encode('utf-8')}
Print_weight_order
#打印磅单
Create Session ztbf ${ztbClient} ${client_header}
${data} Set Variable {"id":"${OrderId}","printType":1}
${reps} POST On Session ztbf ztb-factory/print/weight-order ${data.encode('utf-8')}