Browse Source
Merge pull request '工厂版订单' (#3) from test into master
Merge pull request '工厂版订单' (#3) from test into master
Reviewed-on: http://git.qniao.cn/automated-test-scripts/ztb-factory-rf-api/pulls/3master
26 changed files with 364 additions and 23 deletions
Split View
Diff Options
-
36000-Data/3-Infomation.robot
-
22001-FactoryReceiptManual/Client/FactoryReceipt.robot
-
37002-FactoryReceiptSwipe/1-Client/FactoryReceipt.robot
-
34002-FactoryReceiptSwipe/2-FactoryBackstage/PaymentOperation.robot
-
59003-FactoryOffsite/Client/FactoryOffsite.robot
-
0004-FactoryOutOrderManual/Client/FactoryOutbound.robot
-
64005-FactoryOutSwipe/Client/FactoryOutbound.robot
-
29Factory/Client/1-FactoryReceipt.robot
-
0Factory/Client/2-FactoryOffsite.robot
-
100Factory/Client/3-FactoryOutbound.robot
-
6Factory/FactoryBackstage/1-PaymentOperation.robot
-
0Test/Login/__init__.robot
-
0Test/Login/factory.robot
-
0Test/Login/关键字.robot
-
0Test/ZTB小程序/出货.robot
-
0Test/ZTB小程序/厂内收货.robot
-
0Test/ZTB小程序/厂外收货.robot
-
0Test/ZTB小程序/常规代卖.robot
-
0Test/ZTB小程序/登录.robot
-
0Test/__init__.txt
-
0Test/log.html
-
0Test/output.xml
-
0Test/report.html
-
0Test/ztb-factory.sh
-
0Test/系统设置/员工管理.robot
-
BINcommon_26091119022578881.jpg
@ -0,0 +1,22 @@ |
|||
*** 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')} |
|||
@ -0,0 +1,37 @@ |
|||
*** Settings *** |
|||
Library Collections |
|||
Library RequestsLibrary |
|||
|
|||
*** Test Cases *** |
|||
ReceiptWeigh |
|||
#厂内收货--刷卡过磅 |
|||
#刷卡过磅--过毛重 |
|||
Create Session ztbf ${ztbClient} ${client_header} |
|||
${weight} Set Variable 2410 |
|||
${weighData} Set Variable {"cardNo":"${ReceiptcardNo}","weight":${weight}} |
|||
${reps} POST On Session ztbf ztb-factory/factory-customer/save/order ${weighData.encode('utf-8')} |
|||
${ReceiptOrderId} Get From Dictionary ${reps.json()['data']} id #订单id |
|||
Set Global Variable ${ReceiptOrderId} |
|||
Should Be Equal As Strings ${reps.json()["message"]} 毛重称重成功,${weight}公斤,请下地磅 |
|||
#定价详情 |
|||
${reps} GET On Session ztbf ztb-factory/factory/wechat-applet/get/order-detail/${ReceiptOrderId} |
|||
${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":"${ReceiptOrderId}", \ \ \ \ "productInfoDtoList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "productId":"${categoryId}", \ \ \ \ \ \ \ \ \ \ \ \ "productName":"${categoryName}", \ \ \ \ \ \ \ \ \ \ \ \ "unitPrice":"2.1", \ \ \ \ \ \ \ \ \ \ \ \ "proportionOfProduct":"${proportionOfProduct}", \ \ \ \ \ \ \ \ \ \ \ \ "konePrice":"指导价格:${defaultUnitPrice}", \ \ \ \ \ \ \ \ \ \ \ \ "highestUnitPrice":"${highestUnitPrice}", \ \ \ \ \ \ \ \ \ \ \ \ "lowestUnitPrice":0 \ \ \ \ \ \ \ \ } \ \ \ \ ], \ \ \ \ "plateNumber":${plateNumber}, \ \ \ \ "factoryCustomerId":"${ReceiptCustomerId}", \ \ \ \ "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":"${ReceiptcardNo}","weight":${weightTare}} |
|||
${reps} POST On Session ztbf ztb-factory/factory-customer/save/order ${weighData.encode('utf-8')} |
|||
${ReceiptOrderId} Get From Dictionary ${reps.json()['data']} id #订单id |
|||
Should Be Equal As Strings ${reps.json()["message"]} 皮重称重成功,${weightTare}公斤,正在打印磅单 |
|||
#过磅审核 |
|||
${auditData} Set Variable {"id":"${ReceiptOrderId}"} |
|||
${reps} POST On Session ztbf ztb-factory/factory/audit-pass/order ${auditData.encode('utf-8')} |
|||
#支付订单--千鸟代付 |
|||
${paymentData} Set Variable {"settleType":3,"ids":["${ReceiptOrderId}"]} |
|||
${reps} POST On Session ztbf ztb-factory/wechat-applet/merge-receiving-pay-order/pay ${paymentData.encode('utf-8')} |
|||
@ -0,0 +1,34 @@ |
|||
*** Settings *** |
|||
Library Collections |
|||
Library RequestsLibrary |
|||
Library DateTime |
|||
|
|||
*** Test Cases *** |
|||
PaymentReview |
|||
#千鸟代付审核列表 |
|||
Create Session ztbf ${opsztb} ${ops_header} |
|||
${reps} GET On Session ztbf ztb-factory/admin/get/agency-payment-order-audit-request-list params=status=&orderId=${ReceiptOrderId}&pageNum=1&pageSize=10 |
|||
${AuditId} Get From Dictionary ${reps.json()['data']['records'][0]} id #代付审核id |
|||
#代付审核通过 |
|||
${data} Set Variable { \ \ \ \ "id":"${AuditId}", \ \ \ \ "remark":"", \ \ \ \ "status":1 } |
|||
${reps} POST On Session ztbf ztb-factory/admin/audit/agency-payment-order-audit-request ${data.encode('utf-8')} |
|||
|
|||
PaymentPayable |
|||
#代付应付 |
|||
Create Session ztbf ${opspsc} ${ops_header} |
|||
${reps} GET On Session ztbf payment-settlement-center/admin/get/agency-payment-order-payable-list params=status=&pageNum=1&pageSize=10&orderId=${ReceiptOrderId} |
|||
${PayId} Get From Dictionary ${reps.json()['data']['records'][0]} id #代付应付Id |
|||
#代付应付通过 |
|||
${PayData} Set Variable { \ \ \ \ "id":"${PayId}", \ \ \ \ "isMergePayment":0, \ \ \ \ "auditStatus":1 } |
|||
${reps} POST On Session ztbf payment-settlement-center/admin/audit/agency-payment-order-payable/${PayId} ${PayData.encode('utf-8')} |
|||
|
|||
PaymentReceivable |
|||
#代付应收 |
|||
Create Session ztbf ${opspsc} ${ops_header} |
|||
${reps} GET On Session ztbf /payment-settlement-center/admin/get/agency-payment-order-receivable-list params=status=0&orderId=${ReceiptOrderId}&pageNum=1&pageSize=10 |
|||
${ReceiveId} Get From Dictionary ${reps.json()['data']['records'][0]} id #代付应收id |
|||
${receivablePrice} Get From Dictionary ${reps.json()['data']['records'][0]} receivablePrice #代付应收金额 |
|||
#确认收款 |
|||
${Time} get current date result_format=%Y-%m-%d |
|||
${ReceiveData} Set Variable { \ \ \ \ "id":"${ReceiveId}", \ \ \ \ "realReceivedPrice":"${receivablePrice}", \ \ \ \ "realReceivedTime":"${Time}" } |
|||
${reps} POST On Session ztbf payment-settlement-center/admin/comfirm-receive/agency-payment-order-receivable-list ${ReceiveData.encode('utf-8')} |
|||
@ -0,0 +1,59 @@ |
|||
*** Settings *** |
|||
Library String |
|||
Library urllib3 |
|||
Library Collections |
|||
Library RequestsLibrary |
|||
|
|||
*** Test Cases *** |
|||
OffsiteOrder |
|||
#创建厂外收货订单 |
|||
Create Session ztbf ${ztbClient} ${client_header} |
|||
${unitPrice} Set Variable 1.66 #单价(公斤) |
|||
${plateNumber} Set Variable 粤M33333 #车牌号 |
|||
${equipmentRemark} Set Variable NP-003 #设备 |
|||
${ReceiptData} Set Variable { \ \ \ \ "productCategoryInfos":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "productId":"${categoryId}", \ \ \ \ \ \ \ \ \ \ \ \ "productCategoryName":"${categoryName}", \ \ \ \ \ \ \ \ \ \ \ \ "unitPrice":"${unitPrice}", \ \ \ \ \ \ \ \ \ \ \ \ "konePrice":"指导价格:${defaultUnitPrice}", \ \ \ \ \ \ \ \ \ \ \ \ "highestUnitPrice":"${highestUnitPrice}", \ \ \ \ \ \ \ \ \ \ \ \ "lowestUnitPrice":0 \ \ \ \ \ \ \ \ } \ \ \ \ ], \ \ \ \ "predictDeliveryToFactoryTime":null, \ \ \ \ "factoryCustomerId":"${OffsiteCustomerId}", \ \ \ \ "factoryCustomerName":"${Offsitename}", \ \ \ \ "plateNumber":"${plateNumber}", \ \ \ \ "driverId":"${enterpriseMemberId}", \ \ \ \ "driverName":"${enterpriseMemberName}" } |
|||
${reps} POST On Session ztbf ztb-factory/create/scrap-paper-offsite-receipt-order ${ReceiptData.encode('utf-8')} |
|||
#外出收货订单列表 |
|||
${reps} GET On Session ztbf ztb-factory/get/scrap-paper-offsite-receipt-order-list params=orderStatus=0&orderType=2&pageNum=1&pageSize=15 |
|||
${OrderList} Get From Dictionary ${reps.json()['data']} records #订单列表 |
|||
FOR ${items} IN @{OrderList} |
|||
${driverId} Get From Dictionary ${items} driverId #司机id |
|||
${OffsiteOrderId} Get From Dictionary ${items} orderId #订单编号 |
|||
Exit For Loop If '${driverId}'=='${enterpriseMemberId}' |
|||
END |
|||
#外出收货订单详情 |
|||
${reps} GET On Session ztbf ztb-factory/get/scrap-paper-offsite-receipt-order-detail params=id=${OffsiteOrderId} |
|||
${scrapPaperPurchaseOrderId} Get From Dictionary ${reps.json()['data']['productCategoryInfos'][0]} scrapPaperPurchaseOrderId #收货订单id |
|||
#提交订单 |
|||
${offsiteTareWeight} Set Variable 500 #皮重(公斤) |
|||
${offsiteGrossWeight} Set Variable 1000 #毛重(公斤) |
|||
${netWeight} Evaluate ${offsiteGrossWeight}-${offsiteTareWeight} |
|||
${ReceiptWeight} Set Variable { \ \ \ \ "scrapPaperReceiptId":"${OffsiteOrderId}", \ \ \ \ "offsiteGrossWeight":"${offsiteGrossWeight}", \ \ \ \ "offsiteTareWeight":"${offsiteTareWeight}", \ \ \ \ "weightNoteList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "grossWeight":null, \ \ \ \ \ \ \ \ \ \ \ \ "tareWeight":null, \ \ \ \ \ \ \ \ \ \ \ \ "weightNoteImage":null, \ \ \ \ \ \ \ \ \ \ \ \ "netWeight":"${netWeight}", \ \ \ \ \ \ \ \ \ \ \ \ "scrapPaperPurchaseOrderId":"${scrapPaperPurchaseOrderId}" \ \ \ \ \ \ \ \ } \ \ \ \ ], \ \ \ \ "orderImageList":[ \ \ \ \ \ \ \ \ "${Image}", \ \ \ \ \ \ \ \ "${Image}", \ \ \ \ \ \ \ \ "${Image}" \ \ \ \ ] } |
|||
${reps} POST On Session ztbf ztb-factory/submit/scrap-paper-offsite-receipt-weight-note ${ReceiptWeight.encode('utf-8')} |
|||
#确认定价 |
|||
${OrderPrice} Set Variable { \ \ \ \ "scrapPaperReceiptId":"${OffsiteOrderId}", \ \ \ \ "productCategorySettleInfoDtoList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "productId":"${categoryId}", \ \ \ \ \ \ \ \ \ \ \ \ "scrapPaperPurchaseOrderId":"${scrapPaperPurchaseOrderId}", \ \ \ \ \ \ \ \ \ \ \ \ "deductWeight":null, \ \ \ \ \ \ \ \ \ \ \ \ "deductPercent":null, \ \ \ \ \ \ \ \ \ \ \ \ "settleUnitPrice":"${unitPrice}" \ \ \ \ \ \ \ \ } \ \ \ \ ] } |
|||
${reps} POST On Session ztbf ztb-factory/submit/scrap-paper-offsite-receipt-order-price ${OrderPrice.encode('utf-8')} |
|||
#刷卡过毛重 |
|||
${weight} Set Variable ${offsiteGrossWeight} |
|||
${weighData} Set Variable {"cardNo":"${OffsitecardNo}","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}公斤,请下地磅 |
|||
#过磅审核通过 |
|||
${ReceiptData} Set Variable {"scrapPaperReceiptId":"${OffsiteOrderId}"} |
|||
${reps} POST On Session ztbf ztb-factory/renew/scrap-paper-offsite-receipt-order-price ${ReceiptData.encode('utf-8')} |
|||
#非代付 |
|||
#获取客户所有未支付订单 |
|||
${reps} GET On Session ztbf ztb-factory/get/scrap-paper-offsite-receipt-order-list params=factoryCustomerId=${OffsiteCustomerId}&statusList=4%2C%2042&pageSize=100 |
|||
${orderList} Get From Dictionary ${reps.json()['data']} records #客户所有订单列表 |
|||
${List} Create List |
|||
FOR ${items} IN @{orderList} |
|||
${orderId} Get From Dictionary ${items} orderId #客户订单id |
|||
Append To List ${List} ${orderId} |
|||
END |
|||
${str} Convert To String ${List} |
|||
${List} Replace String ${str} ' " |
|||
#支付订单 |
|||
${paymentData} Set Variable { \ \ \ \ "settleType":2, \ \ \ \ "ids":${List}} |
|||
${reps} POST On Session ztbf ztb-factory/wechat-applet/merge-receiving-pay-order/pay ${paymentData.encode('utf-8')} |
|||
@ -0,0 +1,64 @@ |
|||
*** Settings *** |
|||
Library Collections |
|||
Library RequestsLibrary |
|||
|
|||
*** Test Cases *** |
|||
OutboundDeviceOrder |
|||
#出货--刷卡单 |
|||
#第一次刷卡过磅--皮重 |
|||
Create Session ztbf ${ztbClient} ${client_header} |
|||
${OutFirstWeight} Set Variable 2000 |
|||
${OutFirstWeightData} Set Variable { \ \ \ \ "cardNo":"${OutCarNo}", \ \ \ \ "weight":"${OutFirstWeight}" } |
|||
${reps} POST On Session ztbf ztb-factory/factory-customer/save/order ${OutFirstWeightData.encode('utf-8')} |
|||
${OutWeightId} Get From Dictionary ${reps.json()['data']} id #刷卡过磅id |
|||
Should Be Equal As Strings ${reps.json()['message']} 第一次过磅成功,${OutFirstWeight}公斤,请下地磅 |
|||
#绑定磅单图片 |
|||
${OutFirstBinding} Set Variable { \ \ \ \ "orderId":"${OutWeightId}", \ \ \ \ "imageUrl":"${OutboundImage}", \ \ \ \ "index":"1" } |
|||
${reps} POST On Session ztbf /ztb-factory/binding/order-image ${OutFirstBinding.encode('utf-8')} |
|||
sleep 0.5 |
|||
#第二次刷卡过磅--毛重 |
|||
${OutSecondWeight} Set Variable 4520 |
|||
${OutSecondWeightData} Set Variable { \ \ \ \ "cardNo":"${OutCarNo}", \ \ \ \ "weight":"${OutSecondWeight}" } |
|||
${reps} POST On Session ztbf ztb-factory/factory-customer/save/order ${OutSecondWeightData.encode('utf-8')} |
|||
Should Be Equal As Strings ${reps.json()['message']} 第二次过磅成功,${OutSecondWeight}公斤,请下地磅 |
|||
#绑定磅单图片 |
|||
${OutSecondBinding} Set Variable { \ \ \ \ "orderId":"${OutWeightId}", \ \ \ \ "imageUrl":"${OutboundImage}", \ \ \ \ "index":"1" } |
|||
${reps} POST On Session ztbf /ztb-factory/binding/order-image ${OutSecondBinding.encode('utf-8')} |
|||
sleep 0.5 |
|||
#出货列表 |
|||
${reps} GET On Session ztbf ztb-factory/get/outbound-delivery-order-list params=pageNum=1&pageSize=15 |
|||
${OutList} Get From Dictionary ${reps.json()['data']} records #出货列表 |
|||
FOR ${OutInfo} IN @{OutList} |
|||
${OutId} Get From Dictionary ${OutInfo} id #出货id |
|||
${status} Get From Dictionary ${OutInfo} status #出货订单状态 |
|||
${factoryId} Get From Dictionary ${OutInfo} factoryId #出货工厂id |
|||
${createTime} Get From Dictionary ${OutInfo} createTime #出货订单创建时间 |
|||
${orderNumber} Get From Dictionary ${OutInfo} orderNumber #出货订单 |
|||
${weightNoteId} Get From Dictionary ${OutInfo} weightNoteId #出货磅单id |
|||
${NetWeight} Get From Dictionary ${OutInfo} outboundDeliveryNetWeight #出货总净重(公斤) |
|||
Exit For Loop If '${weightNoteId}'=='${OutWeightId}' #判断订单编号是否相等 |
|||
END |
|||
#确认出货 |
|||
${unitPrice} Set Variable 2.35 #出货品类单价 |
|||
${plateNumber} Set Variable 川F66666 #出货车牌号 |
|||
${estimatedAmount} Evaluate ${unitPrice}*${NetWeight} #预估金额(元) |
|||
${defaultUnitPrice} Set Variable ${defaultUnitPrice}*1000 #指导价格 |
|||
${OutboundOrderData} Set Variable { \ \ \ \ "id":"${OutId}", \ \ \ \ "factoryId":"${factoryId}", \ \ \ \ "operaterId":null, \ \ \ \ "operaterName":null, \ \ \ \ "weightNoteId":"${weightNoteId}", \ \ \ \ "deliveryChannelType":1, \ \ \ \ "consigneeId":null, \ \ \ \ "consigneeName":"${ChannelName}", \ \ \ \ "productId":null, \ \ \ \ "productName":null, \ \ \ \ "packageQuantity":null, \ \ \ \ "status":"${status}", \ \ \ \ "plateNumber":"${plateNumber}", \ \ \ \ "driverName":null, \ \ \ \ "auditorName":null, \ \ \ \ "auditorId":null, \ \ \ \ "createTime":"${createTime}", \ \ \ \ "updadeTime":null, \ \ \ \ "agencySellOrderItemId":null, \ \ \ \ "unitPrice":null, \ \ \ \ "totalEstimatedAmount":0, \ \ \ \ "orderNumber":"${orderNumber}", \ \ \ \ "remark":null, \ \ \ \ "isHandworkOrder":0, \ \ \ \ "salesGuy":null, \ \ \ \ "receiptAddress":null, \ \ \ \ "roleName":null, \ \ \ \ "totalWeight":"${OutFirstWeight}", \ \ \ \ "netWeight":"${NetWeight}", \ \ \ \ "emptyWeight":"${OutSecondWeight}", \ \ \ \ "factoryDeliveryChannelId":"${ChannelId}", \ \ \ \ "estimatedAmount":"${estimatedAmount}", \ \ \ \ "outboundDeliveryOrderProductItemList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "productId":"${categoryId}", \ \ \ \ \ \ \ \ \ \ \ \ "productName":"${categoryName}", \ \ \ \ \ \ \ \ \ \ \ \ "unitPrice":"${unitPrice}", \ \ \ \ \ \ \ \ \ \ \ \ "productCategoryId":"${productcategoryId}", \ \ \ \ \ \ \ \ \ \ \ \ "konePrice":"指导价格:${defaultUnitPrice}", \ \ \ \ \ \ \ \ \ \ \ \ "highestUnitPrice":"${highestUnitPrice}", \ \ \ \ \ \ \ \ \ \ \ \ "lowestUnitPrice":0, \ \ \ \ \ \ \ \ \ \ \ \ "settleWeight":null, \ \ \ \ \ \ \ \ \ \ \ \ "deductPercent":null, \ \ \ \ \ \ \ \ \ \ \ \ "estimatedAmount":"${estimatedAmount}", \ \ \ \ \ \ \ \ \ \ \ \ "proportionOfProduct":100 \ \ \ \ \ \ \ \ } \ \ \ \ ] } |
|||
${reps} POST On Session ztbf ztb-factory/relevancy/weight-note/and/outbound-delivery-order ${OutboundOrderData.encode('utf-8')} |
|||
#出货审核通过 |
|||
${OutAuditData} Set Variable {"id":"${OutId}","auditStatus":1} |
|||
${reps} POST On Session ztbf ztb-factory/audit/outbount-delivery-order ${OutAuditData.encode('utf-8')} |
|||
#待付款列表 |
|||
${reps} GET On Session ztbf ztb-factory/get/outbound-delivery-order-list params=pageNum=1&pageSize=15&status=1 |
|||
${deliveryList} Get From Dictionary ${reps.json()['data']} records |
|||
FOR ${items} IN @{deliveryList} |
|||
${id} Get From Dictionary ${items} id #订单编号 |
|||
${productItemId} Get From Dictionary ${items['productItemList'][0]} id #订单项编号 |
|||
Exit For Loop If '${id}'=='${OutId}' |
|||
END |
|||
#确认付款 |
|||
${paperMillNetWeight} Set Variable 10 #纸厂净重(吨) |
|||
${deductPercent} Set Variable 2 #扣点(%) |
|||
${settleWeight} Evaluate ${paperMillNetWeight}-${paperMillNetWeight}*${deductPercent}/1000 #结算重量(吨) |
|||
${OutPayData} Set Variable { \ \ \ \ "id":"${OutId}", \ \ \ \ "categoryId":"${categoryId}", \ \ \ \ "outboundDeliveryOrderProductItemList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "settlementProductId":"${categoryId}", \ \ \ \ \ \ \ \ \ \ \ \ "id":"${productItemId}", \ \ \ \ \ \ \ \ \ \ \ \ "paperMillNetWeight":"${paperMillNetWeight}", \ \ \ \ \ \ \ \ \ \ \ \ "settleWeight":"${settleWeight}", \ \ \ \ \ \ \ \ \ \ \ \ "deductPercent":"${deductPercent}", \ \ \ \ \ \ \ \ \ \ \ \ "settleUnitPrice":"${unitPrice}" \ \ \ \ \ \ \ \ } \ \ \ \ ] } |
|||
${reps} POST On Session ztbf ztb-factory/confirm/outbound-delivery-order-receipt ${OutPayData.encode('utf-8')} |
|||
@ -0,0 +1,100 @@ |
|||
*** Settings *** |
|||
Library Collections |
|||
Library RequestsLibrary |
|||
|
|||
*** Test Cases *** |
|||
OutboundOrder |
|||
#出货--手工单 |
|||
Create Session ztbf ${ztbClient} ${client_header} |
|||
${netWeight} Set Variable 5000 #净重(公斤) |
|||
${unitPrice} Set Variable 2.02 #单价(元/公斤) |
|||
${konePrice} Evaluate ${defaultUnitPrice}*1000 #指导价格 |
|||
${plateNumber} Set Variable 沪H22222 #车牌号 |
|||
${estimatedAmount} Evaluate ${netWeight}*${unitPrice} |
|||
${OutData} Set Variable { \ \ \ \ "isHandworkOrder":1, \ \ \ \ "estimatedAmount":"${estimatedAmount}", \ \ \ \ "deliveryChannelType":1, \ \ \ \ "factoryDeliveryChannelId":"${ChannelId}", \ \ \ \ "consigneeName":"${ChannelName}", \ \ \ \ "plateNumber":"${plateNumber}", \ \ \ \ "outboundDeliveryOrderProductItemList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "productId":"${categoryId}", \ \ \ \ \ \ \ \ \ \ \ \ "productName":"${categoryName}", \ \ \ \ \ \ \ \ \ \ \ \ "unitPrice":"${unitPrice}", \ \ \ \ \ \ \ \ \ \ \ \ "productCategoryId":"${productcategoryId}", \ \ \ \ \ \ \ \ \ \ \ \ "konePrice":"指导价格:${konePrice}", \ \ \ \ \ \ \ \ \ \ \ \ "highestUnitPrice":"${highestUnitPrice}", \ \ \ \ \ \ \ \ \ \ \ \ "lowestUnitPrice":0, \ \ \ \ \ \ \ \ \ \ \ \ "netWeight":"${netWeight}", \ \ \ \ \ \ \ \ \ \ \ \ "settleWeight":null, \ \ \ \ \ \ \ \ \ \ \ \ "deductPercent":null, \ \ \ \ \ \ \ \ \ \ \ \ "estimatedAmount":"${estimatedAmount}" \ \ \ \ \ \ \ \ } \ \ \ \ ], \ \ \ \ "weightNoteImageUrls":[ \ \ \ \ \ ] } |
|||
${reps} POST On Session ztbf ztb-factory/save/outbound-delivery-order ${OutData.encode('utf-8')} |
|||
#待审核列表 |
|||
${reps} GET On Session ztbf ztb-factory/get/outbound-delivery-order-list params=pageNum=1&pageSize=15&status=0 |
|||
${weightNoteList} Get From Dictionary ${reps.json()['data']} records #待审核列表 |
|||
FOR ${items} IN @{weightNoteList} |
|||
${OrderId} Get From Dictionary ${items} id #出货订单id |
|||
${productId} Get From Dictionary ${items} productId #纸品id |
|||
Exit For Loop If '${productId}'=='${categoryId}' |
|||
END |
|||
#磅单审核通过 |
|||
${auditData} Set Variable {"id":"${OrderId}","auditStatus":1} |
|||
${reps} POST On Session ztbf ztb-factory/audit/outbount-delivery-order ${auditData.encode('utf-8')} |
|||
#待付款列表 |
|||
${reps} GET On Session ztbf ztb-factory/get/outbound-delivery-order-list params=pageNum=1&pageSize=15&status=1 |
|||
${deliveryList} Get From Dictionary ${reps.json()['data']} records |
|||
FOR ${items} IN @{deliveryList} |
|||
${id} Get From Dictionary ${items} id #订单编号 |
|||
${productItemId} Get From Dictionary ${items['productItemList'][0]} id #订单项编号 |
|||
Exit For Loop If '${id}'=='${OrderId}' |
|||
END |
|||
#确认付款 |
|||
${paperMillNetWeight} Set Variable 13 #纸厂净重(吨) |
|||
${deductPercent} Set Variable 2.1 #扣点(%) |
|||
${settleWeight} Evaluate ${paperMillNetWeight}-${paperMillNetWeight}*${deductPercent}/1000 #结算重量(吨) |
|||
${PayData} Set Variable { \ \ \ \ "id":"${OrderId}", \ \ \ \ "categoryId":"${categoryId}", \ \ \ \ "otherFee":0, \ \ \ \ "subsidy":0, \ \ \ \ "proxyPaySurcharge":0, \ \ \ \ "freight":0, \ \ \ \ "outboundDeliveryOrderProductItemList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "settlementProductId":"${categoryId}", \ \ \ \ \ \ \ \ \ \ \ \ "id":"${productItemId}", \ \ \ \ \ \ \ \ \ \ \ \ "paperMillNetWeight":"${paperMillNetWeight}", \ \ \ \ \ \ \ \ \ \ \ \ "settleWeight":"${settleWeight}", \ \ \ \ \ \ \ \ \ \ \ \ "deductPercent":"${deductPercent}", \ \ \ \ \ \ \ \ \ \ \ \ "settleUnitPrice":"${unitPrice}" \ \ \ \ \ \ \ \ } \ \ \ \ ], \ \ \ \ "factoryId":"${factoryId}" } |
|||
${reps} POST On Session ztbf ztb-factory/confirm/outbound-delivery-order-receipt ${PayData.encode('utf-8')} |
|||
|
|||
OutboundDeviceOrder |
|||
#出货--刷卡单 |
|||
#第一次刷卡过磅--皮重 |
|||
Create Session ztbf ${ztbClient} ${client_header} |
|||
${OutFirstWeight} Set Variable 2000 |
|||
${OutFirstWeightData} Set Variable { \ \ \ \ "cardNo":"${OutCarNo}", \ \ \ \ "weight":"${OutFirstWeight}" } |
|||
${reps} POST On Session ztbf ztb-factory/factory-customer/save/order ${OutFirstWeightData.encode('utf-8')} |
|||
${OutWeightId} Get From Dictionary ${reps.json()['data']} id #刷卡过磅id |
|||
Should Be Equal As Strings ${reps.json()['message']} 第一次过磅成功,${OutFirstWeight}公斤,请下地磅 |
|||
#绑定磅单图片 |
|||
${OutFirstBinding} Set Variable { \ \ \ \ "orderId":"${OutWeightId}", \ \ \ \ "imageUrl":"${OutboundImage}", \ \ \ \ "index":"1" } |
|||
${reps} POST On Session ztbf /ztb-factory/binding/order-image ${OutFirstBinding.encode('utf-8')} |
|||
sleep 0.5 |
|||
#第二次刷卡过磅--毛重 |
|||
${OutSecondWeight} Set Variable 4520 |
|||
${OutSecondWeightData} Set Variable { \ \ \ \ "cardNo":"${OutCarNo}", \ \ \ \ "weight":"${OutSecondWeight}" } |
|||
${reps} POST On Session ztbf ztb-factory/factory-customer/save/order ${OutSecondWeightData.encode('utf-8')} |
|||
Should Be Equal As Strings ${reps.json()['message']} 第二次过磅成功,${OutSecondWeight}公斤,请下地磅 |
|||
#绑定磅单图片 |
|||
${OutSecondBinding} Set Variable { \ \ \ \ "orderId":"${OutWeightId}", \ \ \ \ "imageUrl":"${OutboundImage}", \ \ \ \ "index":"1" } |
|||
${reps} POST On Session ztbf /ztb-factory/binding/order-image ${OutSecondBinding.encode('utf-8')} |
|||
sleep 0.5 |
|||
#出货列表 |
|||
${reps} GET On Session ztbf ztb-factory/get/outbound-delivery-order-list params=pageNum=1&pageSize=15 |
|||
${OutList} Get From Dictionary ${reps.json()['data']} records #出货列表 |
|||
FOR ${OutInfo} IN @{OutList} |
|||
${OutId} Get From Dictionary ${OutInfo} id #出货id |
|||
${status} Get From Dictionary ${OutInfo} status #出货订单状态 |
|||
${factoryId} Get From Dictionary ${OutInfo} factoryId #出货工厂id |
|||
${createTime} Get From Dictionary ${OutInfo} createTime #出货订单创建时间 |
|||
${orderNumber} Get From Dictionary ${OutInfo} orderNumber #出货订单 |
|||
${weightNoteId} Get From Dictionary ${OutInfo} weightNoteId #出货磅单id |
|||
${NetWeight} Get From Dictionary ${OutInfo} outboundDeliveryNetWeight #出货总净重(公斤) |
|||
Exit For Loop If '${weightNoteId}'=='${OutWeightId}' #判断订单编号是否相等 |
|||
END |
|||
#确认出货 |
|||
${unitPrice} Set Variable 2.35 #出货品类单价 |
|||
${plateNumber} Set Variable 川F66666 #出货车牌号 |
|||
${estimatedAmount} Evaluate ${unitPrice}*${NetWeight} #预估金额(元) |
|||
${defaultUnitPrice} Set Variable ${defaultUnitPrice}*1000 #指导价格 |
|||
${OutboundOrderData} Set Variable { \ \ \ \ "id":"${OutId}", \ \ \ \ "factoryId":"${factoryId}", \ \ \ \ "operaterId":null, \ \ \ \ "operaterName":null, \ \ \ \ "weightNoteId":"${weightNoteId}", \ \ \ \ "deliveryChannelType":1, \ \ \ \ "consigneeId":null, \ \ \ \ "consigneeName":"${ChannelName}", \ \ \ \ "productId":null, \ \ \ \ "productName":null, \ \ \ \ "packageQuantity":null, \ \ \ \ "status":"${status}", \ \ \ \ "plateNumber":"${plateNumber}", \ \ \ \ "driverName":null, \ \ \ \ "auditorName":null, \ \ \ \ "auditorId":null, \ \ \ \ "createTime":"${createTime}", \ \ \ \ "updadeTime":null, \ \ \ \ "agencySellOrderItemId":null, \ \ \ \ "unitPrice":null, \ \ \ \ "totalEstimatedAmount":0, \ \ \ \ "orderNumber":"${orderNumber}", \ \ \ \ "remark":null, \ \ \ \ "isHandworkOrder":0, \ \ \ \ "salesGuy":null, \ \ \ \ "receiptAddress":null, \ \ \ \ "roleName":null, \ \ \ \ "totalWeight":"${OutFirstWeight}", \ \ \ \ "netWeight":"${NetWeight}", \ \ \ \ "emptyWeight":"${OutSecondWeight}", \ \ \ \ "factoryDeliveryChannelId":"${ChannelId}", \ \ \ \ "estimatedAmount":"${estimatedAmount}", \ \ \ \ "outboundDeliveryOrderProductItemList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "productId":"${categoryId}", \ \ \ \ \ \ \ \ \ \ \ \ "productName":"${categoryName}", \ \ \ \ \ \ \ \ \ \ \ \ "unitPrice":"${unitPrice}", \ \ \ \ \ \ \ \ \ \ \ \ "productCategoryId":"${productcategoryId}", \ \ \ \ \ \ \ \ \ \ \ \ "konePrice":"指导价格:${defaultUnitPrice}", \ \ \ \ \ \ \ \ \ \ \ \ "highestUnitPrice":"${highestUnitPrice}", \ \ \ \ \ \ \ \ \ \ \ \ "lowestUnitPrice":0, \ \ \ \ \ \ \ \ \ \ \ \ "settleWeight":null, \ \ \ \ \ \ \ \ \ \ \ \ "deductPercent":null, \ \ \ \ \ \ \ \ \ \ \ \ "estimatedAmount":"${estimatedAmount}", \ \ \ \ \ \ \ \ \ \ \ \ "proportionOfProduct":100 \ \ \ \ \ \ \ \ } \ \ \ \ ] } |
|||
${reps} POST On Session ztbf ztb-factory/relevancy/weight-note/and/outbound-delivery-order ${OutboundOrderData.encode('utf-8')} |
|||
#出货审核通过 |
|||
${OutAuditData} Set Variable {"id":"${OutId}","auditStatus":1} |
|||
${reps} POST On Session ztbf ztb-factory/audit/outbount-delivery-order ${OutAuditData.encode('utf-8')} |
|||
#待付款列表 |
|||
${reps} GET On Session ztbf ztb-factory/get/outbound-delivery-order-list params=pageNum=1&pageSize=15&status=1 |
|||
${deliveryList} Get From Dictionary ${reps.json()['data']} records |
|||
FOR ${items} IN @{deliveryList} |
|||
${id} Get From Dictionary ${items} id #订单编号 |
|||
${productItemId} Get From Dictionary ${items['productItemList'][0]} id #订单项编号 |
|||
Exit For Loop If '${id}'=='${OutId}' |
|||
END |
|||
#确认付款 |
|||
${paperMillNetWeight} Set Variable 10 #纸厂净重(吨) |
|||
${deductPercent} Set Variable 2 #扣点(%) |
|||
${settleWeight} Evaluate ${paperMillNetWeight}-${paperMillNetWeight}*${deductPercent}/1000 #结算重量(吨) |
|||
${OutPayData} Set Variable { \ \ \ \ "id":"${OutId}", \ \ \ \ "categoryId":"${categoryId}", \ \ \ \ "outboundDeliveryOrderProductItemList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "settlementProductId":"${categoryId}", \ \ \ \ \ \ \ \ \ \ \ \ "id":"${productItemId}", \ \ \ \ \ \ \ \ \ \ \ \ "paperMillNetWeight":"${paperMillNetWeight}", \ \ \ \ \ \ \ \ \ \ \ \ "settleWeight":"${settleWeight}", \ \ \ \ \ \ \ \ \ \ \ \ "deductPercent":"${deductPercent}", \ \ \ \ \ \ \ \ \ \ \ \ "settleUnitPrice":"${unitPrice}" \ \ \ \ \ \ \ \ } \ \ \ \ ] } |
|||
${reps} POST On Session ztbf ztb-factory/confirm/outbound-delivery-order-receipt ${OutPayData.encode('utf-8')} |
|||
Write
Preview
Loading…
Cancel
Save