Browse Source

2021.12.01

pull/3/head
赖勇兰 4 years ago
parent
commit
6de00aa37a
23 changed files with 131 additions and 66 deletions
  1. 5
      1-Client(Test)/1-APPlogin(Test).robot
  2. 32
      1-Client(Test)/2.1-CreateRegularorder.robot
  3. 2
      1-Client(Test)/2.2createActiveorder-1.robot
  4. 2
      1-Client(Test)/2.3createActiveorder-2.robot
  5. BIN
      111.xls
  6. BIN
      1635824097672.xlsx
  7. BIN
      1637047948939.xlsx
  8. BIN
      1637048116722.xlsx
  9. BIN
      1637048161685.xlsx
  10. 2
      2-Background_system(Test)/2.1-Consignment management/2.1-RegularUpload-weightnote.robot
  11. 4
      2-Background_system(Test)/2.1-Consignment management/3.1-Operation_audit.robot
  12. 2
      2-Background_system(Test)/2.1-Consignment management/3.3-Operation_audit.robot
  13. 5
      2-Background_system(Test)/2.1-Consignment management/台账查询.txt
  14. 51
      2-Background_system(Test)/2.1-Consignment management/提交磅单.txt
  15. 2
      2-Background_system(Test)/3-Withdrawal_application/4-Financial_audit.robot
  16. 8
      2-Background_system(Test)/3-Withdrawal_application/5-Sales_receivables.robot
  17. 2
      2-Background_system(Test)/4-Consignment_management/2.3-ActiveUpload-weightnote.robot
  18. 3
      2-Background_system(Test)/4-Consignment_management/5.3-sales_receivable.robot
  19. 5
      2-Background_system(Test)/6-Parameter/2-parameter.robot
  20. 22
      2-Background_system(Test)/6-Parameter/Sys_keyword.txt
  21. 27
      样例/001.robot
  22. 0
      样例/__init__.robot
  23. 23
      样例/形参.txt

5
1-Client(Test)/1-APPlogin(Test).robot

@ -15,12 +15,14 @@ userlogin
Disable Warnings Disable Warnings
Create Session ZTBT https://api-client-uec-test.qniao.cn ${header} Create Session ZTBT https://api-client-uec-test.qniao.cn ${header}
${data} Create Dictionary account=18888888888 captcha=888888 accountType=2 ${data} Create Dictionary account=18888888888 captcha=888888 accountType=2
#${data} Set Variable {"accountType":2,"password":null,"account":"13168550964","captcha":"${text_code}"}
${account} Set Variable 18888888888
#${data} Set Variable {"accountType":2,"account":"${account}","captcha":888888}
${respones} POST On Session ZTBT uec/authorize/by-captcha json=${data} ${respones} POST On Session ZTBT uec/authorize/by-captcha json=${data}
log ${respones.status_code} log ${respones.status_code}
log ${respones.json()} log ${respones.json()}
${token} Get From Dictionary ${respones.json()["data"]} token ${token} Get From Dictionary ${respones.json()["data"]} token
Set Global Variable ${token} Set Global Variable ${token}
Set Global Variable ${account}
[Teardown] [Teardown]
login-token login-token
@ -43,3 +45,4 @@ getuserinfo
${userId} Get From Dictionary ${reps.json()["data"]} userId #获取用户id ${userId} Get From Dictionary ${reps.json()["data"]} userId #获取用户id
Set Global Variable ${realName} Set Global Variable ${realName}
Set Global Variable ${userId} Set Global Variable ${userId}
Should Be Equal As Strings ${account} ${reps.json()["data"]["mobile"]}

32
1-Client(Test)/2.1-CreateRegularorder.robot

@ -21,7 +21,7 @@ get_paper-mill-city
FOR ${items} IN @{data} FOR ${items} IN @{data}
${cityName} Get From Dictionary ${items} cityName #城市name ${cityName} Get From Dictionary ${items} cityName #城市name
${cityId} Get From Dictionary ${items} cityId #城市id ${cityId} Get From Dictionary ${items} cityId #城市id
Exit For Loop If '${cityName}'=='茂名市'
Exit For Loop If '${cityName}'=='大同市'
END END
Set Global Variable ${cityId} Set Global Variable ${cityId}
@ -40,7 +40,7 @@ get-factorylist
${locProvinceName} Get From Dictionary ${item} locProvinceName #纸厂所在省 ${locProvinceName} Get From Dictionary ${item} locProvinceName #纸厂所在省
${locCityName} Get From Dictionary ${item} locCityName #纸厂所在市 ${locCityName} Get From Dictionary ${item} locCityName #纸厂所在市
${locDistrictName} Get From Dictionary ${item} locDistrictName #纸厂所在区 ${locDistrictName} Get From Dictionary ${item} locDistrictName #纸厂所在区
Exit For Loop If '${name}'=='高州市金墩纸业有限公司'
Exit For Loop If '${name}'=='Ceshi_factory'
END END
${value} Evaluate random.choice(${paperCategoryList}) random ${value} Evaluate random.choice(${paperCategoryList}) random
log to console \nvalue: ${value} log to console \nvalue: ${value}
@ -141,31 +141,3 @@ Repeat
Repeat Keyword 10 get-factorylist Repeat Keyword 10 get-factorylist
*** Keywords *** *** Keywords ***
get-factorylist
#获取代卖列表
#${header} Create Dictionary content-type=application/json X-APP-ID=470236309865238528 Authorization=${gettoken}
Create Session factorylist http://api-client-ztb-test.qniao.cn ${header}
${reps} Get On Session factorylist recycle-service/get/paper-mill-paper-category-price-list params=cityId=&enableSalesAgent=1&pageNum=1&pageSize=10&listType=0
Should Be Equal As Strings ${reps.json()["message"]} successful
${records} Get From Dictionary ${reps.json()["data"]} records #获取代卖纸厂列表
FOR ${item} IN @{records}
${name} Get From Dictionary ${item} name #获取纸厂name
${paperCategoryList} Get From Dictionary ${item} paperCategoryList #获取纸厂品类列表
${cumulativeWeight} Get From Dictionary ${item} cumulativeWeight #累计已代卖吨数
${paperMillId} Get From Dictionary ${item} paperMillId #获取纸厂id
${locProvinceName} Get From Dictionary ${item} locProvinceName #纸厂所在省
${locCityName} Get From Dictionary ${item} locCityName #纸厂所在市
${locDistrictName} Get From Dictionary ${item} locDistrictName #纸厂所在区
Exit For Loop If '${name}'=='格森纸业有限公司'
END
${value} Evaluate random.choice(${paperCategoryList}) random
log to console \nvalue: ${value}
${categoryid} Get From Dictionary ${value} categoryId #纸厂品类id
${categoryName} Get From Dictionary ${value} categoryName #纸厂品类name
${unitPrice} Get From Dictionary ${value} unitPrice #纸厂品类价格
${paperMillAddress} Catenate ${locProvinceName} ${locCityName} ${locDistrictName}
Set Global Variable ${categoryid}
Set Global Variable ${unitPrice}
Set Global Variable ${paperMillId}
Set Global Variable ${paperMillAddress}
Set Global Variable ${categoryName}

2
1-Client(Test)/2.2createActiveorder-1.robot

@ -18,7 +18,7 @@ proxy-sell-activity_list
${paperCategoryList} Get From Dictionary ${item} paperCategoryList #获取纸厂品类 ${paperCategoryList} Get From Dictionary ${item} paperCategoryList #获取纸厂品类
${paperMillId} Get From Dictionary ${item} paperMillId #获取纸厂id ${paperMillId} Get From Dictionary ${item} paperMillId #获取纸厂id
${activityId} Get From Dictionary ${item} activityId #获取活动id ${activityId} Get From Dictionary ${item} activityId #获取活动id
Exit For Loop If '${activityName}'=='谷木--一次'
Exit For Loop If '${activityName}'=='Ceshi_factory--一次'
END END
${Category_value} Evaluate random.choice(${paperCategoryList}) random #获取纸品列表 ${Category_value} Evaluate random.choice(${paperCategoryList}) random #获取纸品列表
log to console \nvalue: ${Category_value} log to console \nvalue: ${Category_value}

2
1-Client(Test)/2.3createActiveorder-2.robot

@ -18,7 +18,7 @@ proxy-sell-activity_list
${paperCategoryList} Get From Dictionary ${item} paperCategoryList #获取纸厂品类 ${paperCategoryList} Get From Dictionary ${item} paperCategoryList #获取纸厂品类
${paperMillId} Get From Dictionary ${item} paperMillId #获取纸厂id ${paperMillId} Get From Dictionary ${item} paperMillId #获取纸厂id
${activityId} Get From Dictionary ${item} activityId #获取活动id ${activityId} Get From Dictionary ${item} activityId #获取活动id
Exit For Loop If '${activityName}'=='格森--两次活动'
Exit For Loop If '${activityName}'=='Ceshi_factory--两次'
END END
${Category_value} Evaluate random.choice(${paperCategoryList}) random #获取纸品 ${Category_value} Evaluate random.choice(${paperCategoryList}) random #获取纸品
log to console \nvalue: ${Category_value} log to console \nvalue: ${Category_value}

BIN
111.xls

BIN
1635824097672.xlsx

BIN
1637047948939.xlsx

BIN
1637048116722.xlsx

BIN
1637048161685.xlsx

2
2-Background_system(Test)/2.1-Consignment management/2.1-RegularUpload-weightnote.robot

@ -191,7 +191,7 @@ weightnote
#提交磅单 #提交磅单
Create Session ZTBT ${URL} ${header} Create Session ZTBT ${URL} ${header}
${datatime} Get Current Date result_format=%Y-%m-%d ${datatime} Get Current Date result_format=%Y-%m-%d
${data} Set Variable { \ \ \ \ "deductedPoint":0, \ \ \ \ "imageUrl":[ \ \ \ \ \ \ \ \ "${pictures}" \ \ \ \ ], \ \ \ \ "orderItemId":"${orderItemId}", \ \ \ \ "unitPrice":"${unitPrice}", \ \ \ \ "paperCategoryId":"${paperCategoryId}", \ \ \ \ "millSupplierId":"${supplier_id}", \ \ \ \ "millSupplierName":"${millSupplierName}", \ \ \ \ "settleUtiPriceIncludeTax":2.04012, \ \ \ \ "settleUtiPriceIncludeTaxType":1, \ \ \ \ "receivableAdjustMoney":"100", \ \ \ \ "refundSubsidy":0.002, \ \ \ \ "adjustMoney":"0", \ \ \ \ "collectionCharges":"${proxyPaySurcharge}", \ \ \ \ "advanceFund":"${advanceFund}", \ \ \ \ "contractId":"${contractId}", \ \ \ \ "warehouseName":"${所属仓库}", \ \ \ \ "weightDay":"${datatime}", \ \ \ \ "settleDay":"${datatime}", \ \ \ \ "transactionMainEnterpriseId":"${交易主体id}", \ \ \ \ \ "transactionMainEnterpriseName":"${交易主体name}", \ \ \ \ "proxySellerSettleType":"${proxySellerSettleType}", \ \ \ \ "receivableSettlementRules":"${receivableSettlementRules}", \ \ \ \ "isInvoice":"${hasInvoice}", \ \ \ \ "invoicePoint":"${taxRefundRate}", \ \ \ \ "deductionNotes":"${datatime}", \ \ \ \ "plateNumber":"${carList}", \ \ \ \ "settlePriceIncludeTaxSettleRules":"${settlePriceIncludeTaxSettleRules}", \ \ \ \ "settleUtiPrice":"${settleUtiPrice}", \ \ \ \ "netWeight":2000, \ \ \ \ "activitySettleType":null, \ \ \ \ "unitSurcharge":"${unitSurcharge}", \ \ \ \ "deliveryImageUrls":[ \ \ \ \ \ ], \ \ \ \ "publicSubsidies":0, \ \ \ \ "isSubsidyAndDeductIncludeTax":0, \ \ \ \ "orderId":"${orderId}", \ \ \ \ "settleWeight":1800, \ \ \ \ "deductedWeight":2, \ \ \ \ "orderType":"${orderType}", \ \ \ \ "otherAmountList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "unitType":1, \ \ \ \ \ \ \ \ \ \ \ \ "unitAmount":0.001, \ \ \ \ \ \ \ \ \ \ \ \ "title":"freightSubsidies", \ \ \ \ \ \ \ \ \ \ \ \ "isSubsidies":1 \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "unitType":1, \ \ \ \ \ \ \ \ \ \ \ \ "unitAmount":0.001, \ \ \ \ \ \ \ \ \ \ \ \ "title":"otherSubsidies", \ \ \ \ \ \ \ \ \ \ \ \ "isSubsidies":1 \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "unitType":1, \ \ \ \ \ \ \ \ \ \ \ \ "unitAmount":0.001, \ \ \ \ \ \ \ \ \ \ \ \ "title":"contrabandPenalty", \ \ \ \ \ \ \ \ \ \ \ \ "isSubsidies":0 \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "unitType":1, \ \ \ \ \ \ \ \ \ \ \ \ "unitAmount":0.001, \ \ \ \ \ \ \ \ \ \ \ \ "title":"nonStandardPenalty", \ \ \ \ \ \ \ \ \ \ \ \ "isSubsidies":0 \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "unitType":1, \ \ \ \ \ \ \ \ \ \ \ \ "unitAmount":0.001, \ \ \ \ \ \ \ \ \ \ \ \ "title":"otherPenalty", \ \ \ \ \ \ \ \ \ \ \ \ "isSubsidies":0 \ \ \ \ \ \ \ \ } \ \ \ \ ] }
${data} Set Variable { \ \ \ \ "deductedPoint":0, \ \ \ \ "imageUrl":[ \ \ \ \ \ \ \ \ "${pictures}" \ \ \ \ ], \ \ \ \ "orderItemId":"${orderItemId}", \ \ \ \ "unitPrice":"${unitPrice}", \ \ \ \ "paperCategoryId":"${paperCategoryId}", \ \ \ \ "millSupplierId":"${supplier_id}", \ \ \ \ "millSupplierName":"${millSupplierName}", \ \ \ \ "settleUtiPriceIncludeTax":2.04012, \ \ \ \ "settleUtiPriceIncludeTaxType":1, \ \ \ \ "receivableAdjustMoney":"100", \ \ \ \ "refundSubsidy":0.002, \ \ \ \ "adjustMoney":"0", \ \ \ \ "collectionCharges":"${proxyPaySurcharge}", \ \ \ \ "advanceFund":"${advanceFund}", \ \ \ \ "contractId":"${contractId}", \ \ \ \ "warehouseName":"${所属仓库}", \ \ \ \ "weightDay":"${datatime}", \ \ \ \ "settleDay":"${datatime}", \ \ \ \ "transactionMainEnterpriseId":"${交易主体id}", \ \ \ \ \ "transactionMainEnterpriseName":"${交易主体name}", \ \ \ \ "proxySellerSettleType":"${proxySellerSettleType}", \ \ \ \ "receivableSettlementRules":"${receivableSettlementRules}", \ \ \ \ "isInvoice":"${hasInvoice}", \ \ \ \ "invoicePoint":"${taxRefundRate}", \ \ \ \ "deductionNotes":"${datatime}", \ \ \ \ "plateNumber":"${carList}", \ \ \ \ "settlePriceIncludeTaxSettleRules":"${settlePriceIncludeTaxSettleRules}", \ \ \ \ "settleUtiPrice":"${settleUtiPrice}", \ \ \ \ "netWeight":300, \ \ \ \ "activitySettleType":null, \ \ \ \ "unitSurcharge":"${unitSurcharge}", \ \ \ \ "deliveryImageUrls":[ \ \ \ \ \ ], \ \ \ \ "publicSubsidies":0, \ \ \ \ "isSubsidyAndDeductIncludeTax":0, \ \ \ \ "orderId":"${orderId}", \ \ \ \ "settleWeight":230, \ \ \ \ "deductedWeight":2, \ \ \ \ "orderType":"${orderType}", \ \ \ \ "otherAmountList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "unitType":1, \ \ \ \ \ \ \ \ \ \ \ \ "unitAmount":0.001, \ \ \ \ \ \ \ \ \ \ \ \ "title":"freightSubsidies", \ \ \ \ \ \ \ \ \ \ \ \ "isSubsidies":1 \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "unitType":1, \ \ \ \ \ \ \ \ \ \ \ \ "unitAmount":0.001, \ \ \ \ \ \ \ \ \ \ \ \ "title":"otherSubsidies", \ \ \ \ \ \ \ \ \ \ \ \ "isSubsidies":1 \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "unitType":1, \ \ \ \ \ \ \ \ \ \ \ \ "unitAmount":0.001, \ \ \ \ \ \ \ \ \ \ \ \ "title":"contrabandPenalty", \ \ \ \ \ \ \ \ \ \ \ \ "isSubsidies":0 \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "unitType":1, \ \ \ \ \ \ \ \ \ \ \ \ "unitAmount":0.001, \ \ \ \ \ \ \ \ \ \ \ \ "title":"nonStandardPenalty", \ \ \ \ \ \ \ \ \ \ \ \ "isSubsidies":0 \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "unitType":1, \ \ \ \ \ \ \ \ \ \ \ \ "unitAmount":0.001, \ \ \ \ \ \ \ \ \ \ \ \ "title":"otherPenalty", \ \ \ \ \ \ \ \ \ \ \ \ "isSubsidies":0 \ \ \ \ \ \ \ \ } \ \ \ \ ] }
log ${data} log ${data}
${reps} Post On Session ZTBT recycle-service/admin/proxy-sell/save/weightnote ${data.encode('utf-8')} ${reps} Post On Session ZTBT recycle-service/admin/proxy-sell/save/weightnote ${data.encode('utf-8')}
log ${reps.json()["data"]} log ${reps.json()["data"]}

4
2-Background_system(Test)/2.1-Consignment management/3.1-Operation_audit.robot

@ -79,7 +79,7 @@ get_order-log-detail2
重复执行驳回上传磅单 重复执行驳回上传磅单
#重复执行上传磅单、运营驳回操作 #重复执行上传磅单、运营驳回操作
FOR ${items} IN RANGE 3
FOR ${items} IN RANGE 10
Run Keyword get_operation_list Run Keyword get_operation_list
Run Keyword get_order-receipt-audit-details Run Keyword get_order-receipt-audit-details
Run Keyword If '${audit_status}'=='0' Run Keyword 运营审核驳回 Run Keyword If '${audit_status}'=='0' Run Keyword 运营审核驳回
@ -87,6 +87,8 @@ get_order-log-detail2
Run Keyword 获取磅单详情 Run Keyword 获取磅单详情
Run Keyword If '${status}'=='51' weightnote Run Keyword If '${status}'=='51' weightnote
Run Keyword audit_weightnote Run Keyword audit_weightnote
Run Keyword 获取上传磅单后的订单详情
Run Keyword 台账查询
END END
get_operation_list1 get_operation_list1

2
2-Background_system(Test)/2.1-Consignment management/3.3-Operation_audit.robot

@ -74,7 +74,7 @@ get_order-log-detail2
重复执行驳回和上传磅单操作 重复执行驳回和上传磅单操作
#重复执行上传磅单、运营驳回操作 #重复执行上传磅单、运营驳回操作
FOR ${items} IN RANGE 10
FOR ${items} IN RANGE 50
Run Keyword get_operation_list Run Keyword get_operation_list
Run Keyword get_order-receipt-audit-details Run Keyword get_order-receipt-audit-details
Run Keyword If '${audit_status}'=='0' Run Keyword 运营审核驳回 Run Keyword If '${audit_status}'=='0' Run Keyword 运营审核驳回

5
2-Background_system(Test)/2.1-Consignment management/台账查询.txt

@ -14,3 +14,8 @@ ${header} {'X-APP-ID':'470236309865238555','Authorization':'${gettoken}'
${台账列表数据} Get From List ${reps.json()["data"]["records"]} 0 #获取台账列表数据 ${台账列表数据} Get From List ${reps.json()["data"]["records"]} 0 #获取台账列表数据
#Set Global Variable ${台账列表数据} #Set Global Variable ${台账列表数据}
Should Be Equal As Numbers ${netWeight} ${reps.json()["data"]["records"][0]["netWeight"]} Should Be Equal As Numbers ${netWeight} ${reps.json()["data"]["records"][0]["netWeight"]}
Should Be Equal As Numbers ${unitSurcharge} ${reps.json()["data"]["records"][0]["unitSurcharge"]}
Should Be Equal As Numbers ${settleWeight} ${reps.json()["data"]["records"][0]["settleWeight"]}
Should Be Equal As Numbers ${settleUnitPrice} ${reps.json()["data"]["records"][0]["settleUtiPrice"]}
Should Be Equal As Numbers ${receivableAdjustMoney} ${reps.json()["data"]["records"][0]["receivableAdjustMoney"]}
Should Be Equal As Numbers ${adjustMoney} ${reps.json()["data"]["records"][0]["adjustMoney"]}

51
2-Background_system(Test)/2.1-Consignment management/提交磅单.txt

@ -22,18 +22,23 @@ ${header} {'X-APP-ID':'470236309865238555','Authorization':'${gettoken}'
${millSupplierId} Get From Dictionary ${reps.json()["data"]} millSupplierId #纸厂供应商ID ${millSupplierId} Get From Dictionary ${reps.json()["data"]} millSupplierId #纸厂供应商ID
${paperMillSupplierName} Get From Dictionary ${reps.json()["data"]} paperMillSupplierName #纸厂供应商名称 ${paperMillSupplierName} Get From Dictionary ${reps.json()["data"]} paperMillSupplierName #纸厂供应商名称
${publicSubsidies} Set Variable If '${publicSubsidies}'=='${null}' 0 ${publicSubsidies} ${publicSubsidies} Set Variable If '${publicSubsidies}'=='${null}' 0 ${publicSubsidies}
${settleUtiPrice}= Evaluate ${unitPrice}+${publicSubsidies} #结算单价
#${settleUtiPrice} Evaluate ${unitPrice}+${publicSubsidies} #结算单价
${unitSurcharge} Set Variable If '${unitSurcharge}'=='${None}' 0 ${unitSurcharge} ${unitSurcharge} Set Variable If '${unitSurcharge}'=='${None}' 0 ${unitSurcharge}
${contractId} Get From Dictionary ${reps.json()["data"]["orderItems"][0]} contractId #合同id ${contractId} Get From Dictionary ${reps.json()["data"]["orderItems"][0]} contractId #合同id
${磅单id} Get From Dictionary ${reps.json()["data"]["orderItems"][0]["weightnoteInfo"]} id #获取磅单id ${磅单id} Get From Dictionary ${reps.json()["data"]["orderItems"][0]["weightnoteInfo"]} id #获取磅单id
${status} Get From Dictionary ${reps.json()["data"]} status ${status} Get From Dictionary ${reps.json()["data"]} status
${receivableAdjustMoney} Get From Dictionary ${reps.json()["data"]["orderItems"][0]} receivableAdjustMoney #获取应收调节费
${adjustMoney} Get From Dictionary ${reps.json()["data"]["orderItems"][0]} adjustMoney #获取调节费
${receivableAdjustMoney} Set Variable If '${receivableAdjustMoney}'=='${None}' 0 ${receivableAdjustMoney}
${adjustMoney} Set Variable If '${adjustMoney}'=='${None}' 0 ${adjustMoney}
${settleUtiPrice} Get From Dictionary ${reps.json()["data"]["orderItems"][0]["weightnoteInfo"]} settleUtiPrice #获取结算单价
${netWeight} Get From Dictionary ${reps.json()["data"]["orderItems"][0]["weightnoteInfo"]} netWeight #获取净重 ${netWeight} Get From Dictionary ${reps.json()["data"]["orderItems"][0]["weightnoteInfo"]} netWeight #获取净重
${settleWeight} Get From Dictionary ${reps.json()["data"]["orderItems"][0]["weightnoteInfo"]} settleWeight #获取结算重量 ${settleWeight} Get From Dictionary ${reps.json()["data"]["orderItems"][0]["weightnoteInfo"]} settleWeight #获取结算重量
${netWeight1} Evaluate ${netWeight}+100
${netWeight1} Evaluate ${netWeight}+30
FOR ${净重index} IN RANGE ${netWeight} 30 FOR ${净重index} IN RANGE ${netWeight} 30
Exit For Loop If '${净重index}'=='${netWeight1}' Exit For Loop If '${净重index}'=='${netWeight1}'
END END
${settleWeight1} Evaluate ${settleWeight}+100
${settleWeight1} Evaluate ${settleWeight}+30
FOR ${结算重量index} IN RANGE ${settleWeight} 30 FOR ${结算重量index} IN RANGE ${settleWeight} 30
Exit For Loop If '${结算重量index}'=='${settleWeight1}' Exit For Loop If '${结算重量index}'=='${settleWeight1}'
END END
@ -41,10 +46,22 @@ ${header} {'X-APP-ID':'470236309865238555','Authorization':'${gettoken}'
FOR ${代卖费index} IN RANGE ${unitSurcharge} 100 FOR ${代卖费index} IN RANGE ${unitSurcharge} 100
Exit For Loop If '${代卖费index}'=='${unitSurcharge1}' Exit For Loop If '${代卖费index}'=='${unitSurcharge1}'
END END
${settleUtiPrice1} Evaluate ${settleUtiPrice}+0.1
FOR ${结算单价index} IN RANGE ${settleUtiPrice} 100
Exit For Loop If '${结算单价index}'=='${settleUtiPrice1}'
END
${receivableAdjustMoney1} Evaluate ${receivableAdjustMoney}+10
FOR ${应收调节费index} IN RANGE ${receivableAdjustMoney} 500
Exit For Loop If '${应收调节费index}'=='${receivableAdjustMoney1}'
END
${adjustMoney1} Evaluate ${adjustMoney}+10
FOR ${应收调节费index} IN RANGE ${adjustMoney} 500
Exit For Loop If '${应收调节费index}'=='${adjustMoney1}'
END
Set Global Variable ${contractId} Set Global Variable ${contractId}
Set Global Variable ${unitSurcharge} Set Global Variable ${unitSurcharge}
Set Global Variable ${paperCategoryId} Set Global Variable ${paperCategoryId}
Set Global Variable ${settleUtiPrice}
Set Global Variable ${settleUtiPrice1}
Set Global Variable ${unitPrice} Set Global Variable ${unitPrice}
Set Global Variable ${publicSubsidies} Set Global Variable ${publicSubsidies}
Set Global Variable ${millSupplierId} Set Global Variable ${millSupplierId}
@ -56,12 +73,14 @@ ${header} {'X-APP-ID':'470236309865238555','Authorization':'${gettoken}'
Set Global Variable ${磅单id} Set Global Variable ${磅单id}
Set Global Variable ${status} Set Global Variable ${status}
Set Global Variable ${unitSurcharge1} Set Global Variable ${unitSurcharge1}
Set Global Variable ${adjustMoney1}
Set Global Variable ${receivableAdjustMoney1}
weightnote weightnote
#驳回后重新提交磅单 #驳回后重新提交磅单
Create Session ZTBT ${URL} ${header} Create Session ZTBT ${URL} ${header}
${datatime} Get Current Date result_format=%Y-%m-%d ${datatime} Get Current Date result_format=%Y-%m-%d
${data} Set Variable { \ \ \ \ "deductedPoint":0, \ \ \ \ "imageUrl":[ \ \ \ \ \ \ \ \ "${pictures}" \ \ \ \ ], \ \ \ \ "orderItemId":"${orderItemId}", \ \ \ \ "unitPrice":"${unitPrice}", \ \ \ \ "paperCategoryId":"${paperCategoryId}", \ \ \ \ "millSupplierId":"${supplier_id}", \ \ \ \ "millSupplierName":"${millSupplierName}", \ \ \ \ "settleUtiPriceIncludeTax":2.04012, \ \ \ \ "settleUtiPriceIncludeTaxType":1, \ \ \ \ "receivableAdjustMoney":"100", \ \ \ \ "refundSubsidy":0.002, \ \ \ \ "adjustMoney":"0", \ \ \ \ "collectionCharges":"${proxyPaySurcharge}", \ \ \ \ "advanceFund":"${advanceFund}", \ \ \ \ "contractId":"${contractId}", \ \ \ \ "warehouseName":"${所属仓库}", \ \ \ \ "weightDay":"${datatime}", \ \ \ \ "settleDay":"${datatime}", \ \ \ \ "transactionMainEnterpriseId":"${交易主体id}", \ \ \ \ \ "transactionMainEnterpriseName":"${交易主体name}", \ \ \ \ "proxySellerSettleType":"${proxySellerSettleType}", \ \ \ \ "receivableSettlementRules":"${receivableSettlementRules}", \ \ \ \ "isInvoice":"${hasInvoice}", \ \ \ \ "invoicePoint":"${taxRefundRate}", \ \ \ \ "deductionNotes":"${datatime}", \ \ \ \ "plateNumber":"${carList}", \ \ \ \ "settlePriceIncludeTaxSettleRules":"${settlePriceIncludeTaxSettleRules}", \ \ \ \ "settleUtiPrice":"${settleUtiPrice}", \ \ \ \ "netWeight":"${netWeight1}", \ \ \ \ "activitySettleType":null, \ \ \ \ "unitSurcharge":"${unitSurcharge1}", \ \ \ \ "deliveryImageUrls":[ \ \ \ \ \ ], \ \ \ \ "publicSubsidies":0, \ \ \ \ "isSubsidyAndDeductIncludeTax":0, \ \ \ \ "orderId":"${orderId}", \ \ \ \ "settleWeight":"${settleWeight1}", \ \ \ \ "deductedWeight":2, \ \ \ \ "orderType":"${orderType}", \ \ \ \ "otherAmountList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "unitType":1, \ \ \ \ \ \ \ \ \ \ \ \ "unitAmount":0.001, \ \ \ \ \ \ \ \ \ \ \ \ "title":"freightSubsidies", \ \ \ \ \ \ \ \ \ \ \ \ "isSubsidies":1 \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "unitType":1, \ \ \ \ \ \ \ \ \ \ \ \ "unitAmount":0.001, \ \ \ \ \ \ \ \ \ \ \ \ "title":"otherSubsidies", \ \ \ \ \ \ \ \ \ \ \ \ "isSubsidies":1 \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "unitType":1, \ \ \ \ \ \ \ \ \ \ \ \ "unitAmount":0.001, \ \ \ \ \ \ \ \ \ \ \ \ "title":"contrabandPenalty", \ \ \ \ \ \ \ \ \ \ \ \ "isSubsidies":0 \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "unitType":1, \ \ \ \ \ \ \ \ \ \ \ \ "unitAmount":0.001, \ \ \ \ \ \ \ \ \ \ \ \ "title":"nonStandardPenalty", \ \ \ \ \ \ \ \ \ \ \ \ "isSubsidies":0 \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "unitType":1, \ \ \ \ \ \ \ \ \ \ \ \ "unitAmount":0.001, \ \ \ \ \ \ \ \ \ \ \ \ "title":"otherPenalty", \ \ \ \ \ \ \ \ \ \ \ \ "isSubsidies":0 \ \ \ \ \ \ \ \ } \ \ \ \ ], \ \ \ \ "id":"${磅单id}" \ \ \ \ }
${data} Set Variable { \ \ \ \ "deductedPoint":0, \ \ \ \ "imageUrl":[ \ \ \ \ \ \ \ \ "${pictures}" \ \ \ \ ], \ \ \ \ "orderItemId":"${orderItemId}", \ \ \ \ "unitPrice":"${unitPrice}", \ \ \ \ "paperCategoryId":"${paperCategoryId}", \ \ \ \ "millSupplierId":"${supplier_id}", \ \ \ \ "millSupplierName":"${millSupplierName}", \ \ \ \ "settleUtiPriceIncludeTax":2.04012, \ \ \ \ "settleUtiPriceIncludeTaxType":1, \ \ \ \ "receivableAdjustMoney":"${receivableAdjustMoney1}", \ \ \ \ "refundSubsidy":0.002, \ \ \ \ "adjustMoney":"${adjustMoney1}", \ \ \ \ "collectionCharges":"${proxyPaySurcharge}", \ \ \ \ "advanceFund":"${advanceFund}", \ \ \ \ "contractId":"${contractId}", \ \ \ \ "warehouseName":"${所属仓库}", \ \ \ \ "weightDay":"${datatime}", \ \ \ \ "settleDay":"${datatime}", \ \ \ \ "transactionMainEnterpriseId":"${交易主体id}", \ \ \ \ \ "transactionMainEnterpriseName":"${交易主体name}", \ \ \ \ "proxySellerSettleType":"${proxySellerSettleType}", \ \ \ \ "receivableSettlementRules":"${receivableSettlementRules}", \ \ \ \ "isInvoice":"${hasInvoice}", \ \ \ \ "invoicePoint":"${taxRefundRate}", \ \ \ \ "deductionNotes":"${datatime}", \ \ \ \ "plateNumber":"${carList}", \ \ \ \ "settlePriceIncludeTaxSettleRules":"${settlePriceIncludeTaxSettleRules}", \ \ \ \ "settleUtiPrice":"${settleUtiPrice1}", \ \ \ \ "netWeight":"${netWeight1}", \ \ \ \ "activitySettleType":null, \ \ \ \ "unitSurcharge":"${unitSurcharge1}", \ \ \ \ "deliveryImageUrls":[ \ \ \ \ \ ], \ \ \ \ "publicSubsidies":0, \ \ \ \ "isSubsidyAndDeductIncludeTax":0, \ \ \ \ "orderId":"${orderId}", \ \ \ \ "settleWeight":"${settleWeight1}", \ \ \ \ "deductedWeight":2, \ \ \ \ "orderType":"${orderType}", \ \ \ \ "otherAmountList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "unitType":1, \ \ \ \ \ \ \ \ \ \ \ \ "unitAmount":0.001, \ \ \ \ \ \ \ \ \ \ \ \ "title":"freightSubsidies", \ \ \ \ \ \ \ \ \ \ \ \ "isSubsidies":1 \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "unitType":1, \ \ \ \ \ \ \ \ \ \ \ \ "unitAmount":0.001, \ \ \ \ \ \ \ \ \ \ \ \ "title":"otherSubsidies", \ \ \ \ \ \ \ \ \ \ \ \ "isSubsidies":1 \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "unitType":1, \ \ \ \ \ \ \ \ \ \ \ \ "unitAmount":0.001, \ \ \ \ \ \ \ \ \ \ \ \ "title":"contrabandPenalty", \ \ \ \ \ \ \ \ \ \ \ \ "isSubsidies":0 \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "unitType":1, \ \ \ \ \ \ \ \ \ \ \ \ "unitAmount":0.001, \ \ \ \ \ \ \ \ \ \ \ \ "title":"nonStandardPenalty", \ \ \ \ \ \ \ \ \ \ \ \ "isSubsidies":0 \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "unitType":1, \ \ \ \ \ \ \ \ \ \ \ \ "unitAmount":0.001, \ \ \ \ \ \ \ \ \ \ \ \ "title":"otherPenalty", \ \ \ \ \ \ \ \ \ \ \ \ "isSubsidies":0 \ \ \ \ \ \ \ \ } \ \ \ \ ], \ \ \ \ "id":"${磅单id}" \ \ \ \ }
log ${data} log ${data}
${reps} Post On Session ZTBT recycle-service/admin/proxy-sell/update/weightnote ${data.encode('utf-8')} ${reps} Post On Session ZTBT recycle-service/admin/proxy-sell/update/weightnote ${data.encode('utf-8')}
log ${reps.json()["data"]} log ${reps.json()["data"]}
@ -69,6 +88,22 @@ weightnote
Set Global Variable ${weightNoteId} Set Global Variable ${weightNoteId}
Should Be Equal As Strings ${reps.json()["message"]} successful Should Be Equal As Strings ${reps.json()["message"]} successful
获取上传磅单后的订单详情
Create Session ZTBT ${URL} ${header}
${reps} Get On Session ZTBT recycle-service/admin/customer-service/get/proxy-order/${orderId} params=orderId=${orderId}&orderItemId=${orderItemId}
${settleUnitPrice} Get From Dictionary ${reps.json()["data"]["orderItems"][0]["weightnoteInfo"]} settleUtiPrice #获取结算单价
${unitSurcharge} Get From Dictionary ${reps.json()["data"]["orderItems"][0]} unitSurcharge #获取代卖费
${netWeight} Get From Dictionary ${reps.json()["data"]["orderItems"][0]["weightnoteInfo"]} netWeight #获取净重
${settleWeight} Get From Dictionary ${reps.json()["data"]["orderItems"][0]["weightnoteInfo"]} settleWeight #获取结算重量
${receivableAdjustMoney} Get From Dictionary ${reps.json()["data"]["orderItems"][0]} receivableAdjustMoney #获取应收调节费
${adjustMoney} Get From Dictionary ${reps.json()["data"]["orderItems"][0]} adjustMoney #获取调节费
Set Global Variable ${settleUnitPrice}
Set Global Variable ${unitSurcharge}
Set Global Variable ${netWeight}
Set Global Variable ${settleWeight}
Set Global Variable ${receivableAdjustMoney}
Set Global Variable ${adjustMoney}
获取送货单详情 获取送货单详情
#获取订单详情信息 #获取订单详情信息
Create Session ZTBT ${URL} ${header} Create Session ZTBT ${URL} ${header}
@ -92,7 +127,7 @@ weightnote
Exit For Loop If '${代卖费index}'=='${unitSurcharge3}' Exit For Loop If '${代卖费index}'=='${unitSurcharge3}'
END END
${netWeight} Get From Dictionary ${reps.json()["data"]["orderItems"][0]["weightnoteInfo"]} netWeight #获取净重 ${netWeight} Get From Dictionary ${reps.json()["data"]["orderItems"][0]["weightnoteInfo"]} netWeight #获取净重
${netWeight3} Evaluate ${netWeight}+100
${netWeight3} Evaluate ${netWeight}+300
FOR ${净重index} IN RANGE ${netWeight} 30 FOR ${净重index} IN RANGE ${netWeight} 30
Exit For Loop If '${净重index}'=='${netWeight3}' Exit For Loop If '${净重index}'=='${netWeight3}'
END END
@ -126,8 +161,10 @@ weightnote
获取上传送货单后的订单详情 获取上传送货单后的订单详情
Create Session ZTBT ${URL} ${header} Create Session ZTBT ${URL} ${header}
${reps} Get On Session ZTBT recycle-service/admin/customer-service/get/proxy-order/${orderId} params=orderId=${orderId}&orderItemId=${orderItemId} ${reps} Get On Session ZTBT recycle-service/admin/customer-service/get/proxy-order/${orderId} params=orderId=${orderId}&orderItemId=${orderItemId}
${netWeight} Get From Dictionary ${reps.json()["data"]["orderItems"][0]["weightnoteInfo"]} netWeight
${netWeight} Get From Dictionary ${reps.json()["data"]["orderItems"][0]["weightnoteInfo"]} netWeight #获取净重
${unitSurcharge} Get From Dictionary ${reps.json()["data"]["orderItems"][0]} unitSurcharge #获取代卖费
Set Global Variable ${netWeight} Set Global Variable ${netWeight}
Set Global Variable ${unitSurcharge}
audit_weightnote audit_weightnote
Create Session ZTBT ${URL} ${header} Create Session ZTBT ${URL} ${header}

2
2-Background_system(Test)/3-Withdrawal_application/4-Financial_audit.robot

@ -51,4 +51,4 @@ paper-mill-order-receipt-proof-request_settle
Create Session ZTBT ${url} ${header} Create Session ZTBT ${url} ${header}
${data} Set Variable { \ \ \ \ "id":"${auditRequestId}", \ \ \ \ "adminId":null } ${data} Set Variable { \ \ \ \ "id":"${auditRequestId}", \ \ \ \ "adminId":null }
${reps} Post On Session ZTBT payment-settlement-center/admin/paper-mill-order-receipt-proof-request/settle ${data.encode('utf-8')} ${reps} Post On Session ZTBT payment-settlement-center/admin/paper-mill-order-receipt-proof-request/settle ${data.encode('utf-8')}
sleep 3
sleep 1

8
2-Background_system(Test)/3-Withdrawal_application/5-Sales_receivables.robot

@ -20,8 +20,10 @@ get_order-receipt-audit-details
#代卖应收详情 #代卖应收详情
Create Session ZTBT ${URL} ${header} Create Session ZTBT ${URL} ${header}
${reps} Post On Session ZTBT recycle-service/admin/operation/get/order-receipt-audit-details/${auditRequestId}/${weightNoteId} ${reps} Post On Session ZTBT recycle-service/admin/operation/get/order-receipt-audit-details/${auditRequestId}/${weightNoteId}
${receivablePriceIncludeTax} Get From Dictionary ${reps.json()["data"]["items"][0]} receivablePriceIncludeTax #获取应收金额
${noReceivablePrice} Get From Dictionary ${reps.json()["data"]["items"][0]} noReceivablePrice #未回款金额
${receivablePriceIncludeTax} Get From Dictionary ${reps.json()["data"]["items"][0]} receivablePriceIncludeTax
#${receivablePrice} Get From Dictionary ${reps.json()["data"]["items"][0]} receivablePrice #获取应收金额
${noReceivablePrice} Get From Dictionary ${reps.json()["data"]["items"][0]} noReceivablePrice #获取未收金额
#Set Global Variable ${receivablePrice}
Set Global Variable ${receivablePriceIncludeTax} Set Global Variable ${receivablePriceIncludeTax}
Set Global Variable ${noReceivablePrice} Set Global Variable ${noReceivablePrice}
@ -31,4 +33,4 @@ update_payment-order-status
${data} Set Variable { \ \ \ \ "paymentOrderId":"${paymentOrderId}", \ \ \ \ "receivablePrice":"${receivablePriceIncludeTax}", \ \ \ \ "paidPrice":"${receivablePriceIncludeTax}", \ \ \ \ "noReceiveblePrice":"${noReceivablePrice}", \ \ \ \ "bankFlowNo":null, \ \ \ \ "paymentAdjustmentFee":null, \ \ \ \ "returnPayDate":"${datatime}" } ${data} Set Variable { \ \ \ \ "paymentOrderId":"${paymentOrderId}", \ \ \ \ "receivablePrice":"${receivablePriceIncludeTax}", \ \ \ \ "paidPrice":"${receivablePriceIncludeTax}", \ \ \ \ "noReceiveblePrice":"${noReceivablePrice}", \ \ \ \ "bankFlowNo":null, \ \ \ \ "paymentAdjustmentFee":null, \ \ \ \ "returnPayDate":"${datatime}" }
${reps} Post On Session ZTBT recycle-service/admin/operation/update/payment-order-status ${data.encode('utf-8')} ${reps} Post On Session ZTBT recycle-service/admin/operation/update/payment-order-status ${data.encode('utf-8')}
Should Be Equal As Strings ${reps.json()["message"]} successful Should Be Equal As Strings ${reps.json()["message"]} successful
sleep 3
sleep 5

2
2-Background_system(Test)/4-Consignment_management/2.3-ActiveUpload-weightnote.robot

@ -187,7 +187,7 @@ weightnote
#提交磅单 #提交磅单
Create Session ZTBT ${URL} ${header} Create Session ZTBT ${URL} ${header}
${datatime} Get Current Date result_format=%Y-%m-%d ${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":13500, \ \ \ \ "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}" }
${data} Set Variable { \ \ \ \ "id":"${weightNoteId}", \ \ \ \ "orderId":"${orderId}", \ \ \ \ "orderItemId":"${orderItemId}", \ \ \ \ "type":null, \ \ \ \ "weightDay":"${datatime}", \ \ \ \ "settleDay":"${datatime}", \ \ \ \ "settleUtiPrice":"${settleUtiPrice}", \ \ \ \ "netWeight":"${netWeight}", \ \ \ \ "settleWeight":14200, \ \ \ \ "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} log ${data}
${reps} Post On Session ZTBT recycle-service/admin/proxy-sell/update/weightnote ${data.encode('utf-8')} ${reps} Post On Session ZTBT recycle-service/admin/proxy-sell/update/weightnote ${data.encode('utf-8')}
log ${reps.json()["data"]} log ${reps.json()["data"]}

3
2-Background_system(Test)/4-Consignment_management/5.3-sales_receivable.robot

@ -21,7 +21,8 @@ get_order-receipt-audit-details
Create Session ZTBT ${URL} ${header} Create Session ZTBT ${URL} ${header}
${reps} Post On Session ZTBT recycle-service/admin/operation/get/order-receipt-audit-details/${auditRequestId}/${weightNoteId} ${reps} Post On Session ZTBT recycle-service/admin/operation/get/order-receipt-audit-details/${auditRequestId}/${weightNoteId}
${receivablePriceIncludeTax} Get From Dictionary ${reps.json()["data"]["items"][0]} receivablePriceIncludeTax #获取应收金额 ${receivablePriceIncludeTax} Get From Dictionary ${reps.json()["data"]["items"][0]} receivablePriceIncludeTax #获取应收金额
${noReceivablePrice} Get From Dictionary ${reps.json()["data"]["items"][0]} noReceivablePrice #未回款金额
#${receivablePrice} Get From Dictionary ${reps.json()["data"]["records"][0]} receivablePrice
${noReceivablePrice} Get From Dictionary ${reps.json()["data"]["items"][0]} noReceivablePrice #获取未收金额
Set Global Variable ${receivablePriceIncludeTax} Set Global Variable ${receivablePriceIncludeTax}
Set Global Variable ${noReceivablePrice} Set Global Variable ${noReceivablePrice}

5
2-Background_system(Test)/6-Parameter/2-parameter.robot

@ -1,5 +1,5 @@
*** Settings *** *** Settings ***
Suite Setup 计算公式
Suite Setup
Library RequestsLibrary Library RequestsLibrary
Library Collections Library Collections
Resource Sys_keyword.txt Resource Sys_keyword.txt
@ -11,8 +11,9 @@ ${URL} http://api-ops-ztb-test.qniao.cn
*** Test Cases *** *** Test Cases ***
get_parameter get_parameter
#获取台账列表 #获取台账列表
Run Keyword 计算公式
Create Session ZTBT ${URL} ${header} Create Session ZTBT ${URL} ${header}
${reps} Get On Session ZTBT recycle-service/admin/parameter/get/parameter params=pageNum=1&pageSize=10&withdrawState=&state=&orderItemId=${orderItemId} ${reps} Get On Session ZTBT recycle-service/admin/parameter/get/parameter params=pageNum=1&pageSize=10&withdrawState=&state=&orderItemId=${orderItemId}
${台账列表数据} Get From List ${reps.json()["data"]["records"]} 0 #获取台账列表数据 ${台账列表数据} Get From List ${reps.json()["data"]["records"]} 0 #获取台账列表数据
Set Global Variable ${台账列表数据} Set Global Variable ${台账列表数据}
Should Be Equal As Numbers ${扣点(%)}= ${reps.json()["data"]["record"][0]["deductedPoint"]}
Should Be Equal As Numbers ${netWeight} ${reps.json()["data"]["records"][0]["netWeight"]}

22
2-Background_system(Test)/6-Parameter/Sys_keyword.txt

@ -6,21 +6,21 @@
${净重} Set Variable ${netWeight} ${净重} Set Variable ${netWeight}
${结算单价} Evaluate ${unitPrice}+${publicSubsidies} ${结算单价} Evaluate ${unitPrice}+${publicSubsidies}
${扣点(%)}= Evaluate (${netWeight}-${settleWeight})/${netWeight} ${扣点(%)}= Evaluate (${netWeight}-${settleWeight})/${netWeight}
${纸厂补贴和扣款} Evaluate ${运费补贴}+${其他补贴}+${违禁物品扣款}+${装车不规范扣款}+${其他扣款}
#${纸厂补贴和扣款} Evaluate ${运费补贴}+${其他补贴}+${违禁物品扣款}+${装车不规范扣款}+${其他扣款}
${扣点前代卖费} Evaluate ${unitSurcharge}*${netWeight} ${扣点前代卖费} Evaluate ${unitSurcharge}*${netWeight}
${扣点后代卖费} Evaluate ${unitSurcharge}*${settleWeight} ${扣点后代卖费} Evaluate ${unitSurcharge}*${settleWeight}
${代卖费总额} Set Variable If '${proxySellerSettleType} '=='0' ${扣点前代卖费} ${扣点后代卖费} #0:扣点前,1:扣点后 ${代卖费总额} Set Variable If '${proxySellerSettleType} '=='0' ${扣点前代卖费} ${扣点后代卖费} #0:扣点前,1:扣点后
${一次应付} Evaluate ${结算单价}*${settleWeight}+${纸厂补贴和扣款}-${代卖费总额}+${返还补贴}+${调节费}
${两次首笔应付} Evaluate ${结算单价}*${netWeight}-${代卖费总额}
#${一次应付} Evaluate ${结算单价}*${settleWeight}+${纸厂补贴和扣款}-${代卖费总额}+${返还补贴}+${调节费}
#${两次首笔应付} Evaluate ${结算单价}*${netWeight}-${代卖费总额}
#${两次尾款应付} #${两次尾款应付}
${应付金额(元)} Set Variable If '${firstPayPercent}'=='100%' ${一次应付} ${两次首笔应付} #100%:一笔结算,70%、85%:两笔结算
${含税结算单价} Set Variable If '${isSubsidyAndDeductIncludeTax} '=='0' (${结算单价}+${纸厂补贴和扣款}/${settleWeight})*(1+${taxRefundRate} ) ${结算单价}*(1+${taxRefundRate}) #0:不含税,1:含税
${第一笔金额} Evaluate ${结算单价}*${settleWeight}+${纸厂补贴和扣款}
#${应付金额(元)} Set Variable If '${firstPayPercent}'=='100%' ${一次应付} ${两次首笔应付} #100%:一笔结算,70%、85%:两笔结算
#${含税结算单价} Set Variable If '${isSubsidyAndDeductIncludeTax} '=='0' (${结算单价}+${纸厂补贴和扣款}/${settleWeight})*(1+${taxRefundRate} ) ${结算单价}*(1+${taxRefundRate}) #0:不含税,1:含税
#${第一笔金额} Evaluate ${结算单价}*${settleWeight}+${纸厂补贴和扣款}
#${第二笔金额} Evaluate #${第二笔金额} Evaluate
#${总金额} Evaluate ${第一笔金额}+${第二笔金额} #${总金额} Evaluate ${第一笔金额}+${第二笔金额}
#${金额} Set Variable If '${settlementType}'==0 ${第一笔金额} ${总金额} #${金额} Set Variable If '${settlementType}'==0 ${第一笔金额} ${总金额}
${垫资费总额} Evaluate ${垫资费}*${settleWeight}
${代收费总额} Evaluate ${代收费}*${settleWeight}
${返还补贴总额} Evaluate ${返还补贴}*${settleWeight}
${采购单价} Evaluate ${应付金额(元)}/${settleWeight}
Set Global Variable ${扣点(%)}=
#${垫资费总额} Evaluate ${垫资费}*${settleWeight}
#${代收费总额} Evaluate ${代收费}*${settleWeight}
#${返还补贴总额} Evaluate ${返还补贴}*${settleWeight}
#${采购单价} Evaluate ${应付金额(元)}/${settleWeight}
#Set Global Variable ${扣点(%)}=

001.robot → 样例/001.robot

@ -5,6 +5,9 @@ Library Collections
Library DateTime Library DateTime
Library String Library String
Library pabot.PabotLib Library pabot.PabotLib
Library ExcelLibrary
Library urllib3
Resource 形参.txt
*** Variables *** *** Variables ***
${num} [1,2,3] ${num} [1,2,3]
@ -66,10 +69,26 @@ for循环
${a} Set Variable ${index} ${a} Set Variable ${index}
END END
${c} Set Variable If '${a}'=='51' 待上传磅单 ${c} Set Variable If '${a}'=='51' 待上传磅单
'${a}'=='52' 待运营审核
'${a}'=='53' 待财务审核
'${a}'=='54' 待回款
'${a}'=='55' 已完成
'${a}'=='52' 待运营审核
'${a}'=='53' 待财务审核
'${a}'=='54' 待回款
'${a}'=='55' 已完成
数据驱动
Open Excel E:\\lyl\\Robot Framework\\Test\\111.xls
${rowcount} Get Row Count 信息
FOR ${row} IN RANGE 1 ${rowcount} #遍历从第二行开始的数据
${phonenum} Read Cell Data By Coordinates 信息 0 ${row}
${captcha} Read Cell Data By Coordinates 信息 1 ${row}
#${phoneint} Convert To Integer ${phonenum} #转换为整数
#${apach} Convert To Integer ${apach}
Exit For Loop If '${phonenum}'=='18888888888'
END
Set Global Variable ${phonenum}
Set Global Variable ${captcha}
login
参数实例化 ${phonenum} ${captcha}
*** Keywords *** *** Keywords ***
list list

0
样例/__init__.robot

23
样例/形参.txt

@ -0,0 +1,23 @@
*** Settings ***
Library Collections
Library ExcelLibrary
Library urllib3
Library RequestsLibrary
*** Variables ***
${header} {'content-type':'application/json','X-APP-ID':'470236309865238528'}
*** Keywords ***
参数实例化
[Arguments] ${phonenum} ${captcha}
#验证码登录
Disable Warnings
Create Session ZTBT https://api-client-uec-test.qniao.cn ${header}
${data} Create Dictionary account=${phonenum} captcha=${captcha} accountType=2
#${data} Set Variable {"accountType":2,"account":"${account}","captcha":888888}
${respones} POST On Session ZTBT uec/authorize/by-captcha json=${data}
log ${respones.status_code}
log ${respones.json()}
${token} Get From Dictionary ${respones.json()["data"]} token
Set Global Variable ${token}
[Teardown]
Loading…
Cancel
Save