Browse Source

2021-11-18

pull/3/head
赖勇兰 4 years ago
parent
commit
9f6eebc863
65 changed files with 2895 additions and 799 deletions
  1. 5
      .pabotsuitenames
  2. 33
      001.robot
  3. 4
      1-Client(Test)/1-APPlogin(Test).robot
  4. 64
      1-Client(Test)/1-APPlogin(master).robot
  5. 58
      1-Client(Test)/2.1-CreateRegularorder.robot
  6. 2
      1-Client(Test)/2.2createActiveorder-1.robot
  7. 2
      1-Client(Test)/2.3createActiveorder-2.robot
  8. 2
      1-Client(Test)/3-Withdrawal_application.robot
  9. 9
      1-Client(Test)/3.1-Automatic withdrawal.robot
  10. 20
      1-Client(Test)/7-Consignment_order.robot
  11. 28
      1-Client(Test)/factory.robot
  12. BIN
      1635824097672.xlsx
  13. BIN
      1637047948939.xlsx
  14. BIN
      1637048116722.xlsx
  15. BIN
      1637048161685.xlsx
  16. 20
      2-Background_system(Test)/1.1-New_PaperMill/New_paper_mill.robot
  17. 17
      2-Background_system(Test)/1.3-operation management/contract.robot
  18. 72
      2-Background_system(Test)/1.5-Information_management/information.robot
  19. 7
      2-Background_system(Test)/2.1-Consignment management/2.1-RegularUpload-weightnote.robot
  20. 2
      2-Background_system(Test)/2.1-Consignment management/2.2-RegularUpload-weightnote-1.robot
  21. 4
      2-Background_system(Test)/2.1-Consignment management/2.3-ActiveUpload-deliverynote.robot
  22. 69
      2-Background_system(Test)/2.1-Consignment management/3.1-Operation_audit.robot
  23. 4
      2-Background_system(Test)/2.1-Consignment management/3.2-Operation_audit.robot
  24. 59
      2-Background_system(Test)/2.1-Consignment management/3.3-Operation_audit.robot
  25. 0
      2-Background_system(Test)/2.1-Consignment management/__init__.robot
  26. 16
      2-Background_system(Test)/2.1-Consignment management/台账查询.txt
  27. 135
      2-Background_system(Test)/2.1-Consignment management/提交磅单.txt
  28. 61
      2-Background_system(Test)/2.1-Consignment management/运营审核驳回.txt
  29. 21
      2-Background_system(Test)/3-Withdrawal_application/4-Financial_audit.robot
  30. 1
      2-Background_system(Test)/3-Withdrawal_application/5-Sales_receivables.robot
  31. 6
      2-Background_system(Test)/3-Withdrawal_application/Withdrawal application/1-Automatic_receipt.robot
  32. 20
      2-Background_system(Test)/3-Withdrawal_application/台账查询.txt
  33. 30
      2-Background_system(Test)/3-Withdrawal_application/财务审核驳回.txt
  34. 72
      2-Background_system(Test)/3-Withdrawal_application/运营审核通过.txt
  35. 2
      2-Background_system(Test)/4-Consignment_management/2.3-ActiveUpload-weightnote.robot
  36. 16
      2-Background_system(Test)/4-Consignment_management/3.3--Operation_audit.robot
  37. 1
      2-Background_system(Test)/4-Consignment_management/4.3-Financial_audit.robot
  38. 11
      2-Background_system(Test)/4-Consignment_management/台账查询.txt
  39. 84
      2-Background_system(Test)/4-Consignment_management/更新磅单.txt
  40. 53
      2-Background_system(Test)/4-Consignment_management/运营审核驳回.txt
  41. 2
      2-Background_system(Test)/5-Data comparison/5-Consignment_order.robot
  42. 65
      2-Background_system(Test)/6-Parameter/1-Operation_audit.robot
  43. 18
      2-Background_system(Test)/6-Parameter/2-parameter.robot
  44. 26
      2-Background_system(Test)/6-Parameter/Sys_keyword.txt
  45. 0
      2-Background_system(Test)/6-Parameter/__init__.robot
  46. 45
      3-pabotdemo/1-get_list.robot
  47. 36
      3-pabotdemo/login.txt
  48. 12
      4-Data-comparison/1-Formula-calculation.robot
  49. 12
      DemoApp/APP_login.robot
  50. 6
      DemoApp/Keyword.txt
  51. 0
      DemoApp/__init__.robot
  52. BIN
      DemoApp/app-release.apk
  53. 0
      Resource/__init__.robot
  54. 35
      Resource/关键字.txt
  55. 25
      Resource/关键字使用.robot
  56. 5
      UI-APP.robot
  57. 10
      UI-Browser.robot
  58. 320
      log.html
  59. 881
      output.xml
  60. 657
      pabot_results/0/output.xml
  61. 2
      pabot_results/0/robot_stderr.out
  62. 18
      pabot_results/0/robot_stdout.out
  63. 52
      pabotdemo/添加银行卡.robot
  64. 46
      pabotdemo/登录关键字.txt
  65. 411
      report.html

5
.pabotsuitenames

@ -0,0 +1,5 @@
datasources:1f57f0dac55f5a53bbfff68148aacd196d320d85
commandlineoptions:97d170e1550eee4afc0af065b78cda302a97674c
suitesfrom:no-suites-from-option
file:e6bd2b6f473842e0707ffeac9e6799b3f750b5d7
--suite 3-Pabotdemo.1-Get List

33
001.robot

@ -4,6 +4,7 @@ Library RequestsLibrary
Library Collections Library Collections
Library DateTime Library DateTime
Library String Library String
Library pabot.PabotLib
*** Variables *** *** Variables ***
${num} [1,2,3] ${num} [1,2,3]
@ -34,6 +35,7 @@ ${list} [1,2,3,4,5]
${a} Set Variable If 4 ${a} Set Variable If 4
${a} Set Variable If '${a}'=='null' 1 2 ${a} Set Variable If '${a}'=='null' 1 2
Set Global Variable ${a} Set Global Variable ${a}
Repeat Keyword 100 ${a}
数据断言 数据断言
${data} Set Variable a ${data} Set Variable a
@ -41,12 +43,34 @@ ${list} [1,2,3,4,5]
获取时间 获取时间
${datatime} Get Current Date result_format=%Y-%m-%d ${datatime} Get Current Date result_format=%Y-%m-%d
${DT} Add Time To Date ${datatime} 7 days
${str} Get Substring ${DT} 0 10
${DT} Add Time To Date ${datatime} -1 day
#${str} Get Substring ${DT} 0 10
#${time_stamp} Convert Date ${datatime} epoch #${time_stamp} Convert Date ${datatime} epoch
#log 年:${time_stamp.year} #log 年:${time_stamp.year}
#Should Be Equal As Integers ${DT} 2021 #Should Be Equal As Integers ${DT} 2021
重复执行测试用例
Repeat Keyword 10 times log 赋值判断
for循环
FOR ${items} IN RANGE 15
${a} Set Variable 2
${b} Evaluate ${a}+1
FOR ${index} IN RANGE 10
Exit For Loop If '${index}'=='${b}'
END
END
嵌套使用关键字
FOR ${index} IN 51 56
${a} Set Variable ${index}
END
${c} Set Variable If '${a}'=='51' 待上传磅单
'${a}'=='52' 待运营审核
'${a}'=='53' 待财务审核
'${a}'=='54' 待回款
'${a}'=='55' 已完成
*** Keywords *** *** Keywords ***
list list
[Arguments] ${list} [Arguments] ${list}
@ -61,3 +85,8 @@ list
#${redis_data} Get From Redis ${redis_conn} PAPER_MILL_ID #${redis_data} Get From Redis ${redis_conn} PAPER_MILL_ID
${key_list}= Get Dictionary From Redis Hash ${redis_conn} PAPER_MILL_ID* ${key_list}= Get Dictionary From Redis Hash ${redis_conn} PAPER_MILL_ID*
${key_list}= Get All Match Keys ${redis_conn} PAPER_MILL_ID* 50 ${key_list}= Get All Match Keys ${redis_conn} PAPER_MILL_ID* 50
赋值判断
${a} Set Variable If 4
${a} Set Variable If '${a}'=='null' 1 2
Set Global Variable ${a}

1-Client(Test)/1.1-APPlogin(Test).robot → 1-Client(Test)/1-APPlogin(Test).robot

@ -1,6 +1,4 @@
*** Settings *** *** Settings ***
Suite Setup
Test Timeout
Library RequestsLibrary Library RequestsLibrary
Library Collections Library Collections
Library urllib3 Library urllib3
@ -16,7 +14,7 @@ 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=15014242835 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}"} #${data} Set Variable {"accountType":2,"password":null,"account":"13168550964","captcha":"${text_code}"}
${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}

64
1-Client(Test)/1-APPlogin(master).robot

@ -1,64 +0,0 @@
*** Settings ***
Suite Setup
Library RequestsLibrary
Library Collections
Library urllib3
Library DatabaseLibrary
*** Variables ***
${header} {'content-type':'application/json','X-APP-ID':'470236309865238528'}
${url} http://api-client-ztb.qniao.cn
*** Test Cases ***
Get_verification-code
#获取验证码
Disable Warnings
${headers} Create Dictionary content-type=application/json X-APP-ID=470236309865238528
Create Session ZTBT https://api-client-uec.qniao.cn ${headers}
${value} Set Variable {"verifiableAccount":"13168550964","verifiableAccountType":1,"purpose":1}
${reps} Post On Session ZTBT uec/get/auth-captcha ${value.encode('utf-8')}
log ${reps.json()}
sleep 5
Connect to database
#正式环境数据库获取验证码
Connect To Database Using Custom Params pymysql database='user_enterprise_center', host='rm-wz9it4fs5tk7n4tm1zo.mysql.rds.aliyuncs.com', user='uec_root', password='@qniaouecroot88', port=3306 #连接uec数据库
${Verification Code1} Query SELECT code FROM user_enterprise_center.qn_captcha WHERE verifiable_account LIKE '%13168550964%' ORDER BY id DESC LIMIT 0,1
${text_code} Set Variable ${Verification Code1[0][0]}
Set Global Variable ${text_code}
Disconnect From Database
userlogin
[Setup]
#验证码登录
Create Session ZTBT https://api-client-uec.qniao.cn ${header}
#${data} Create Dictionary account=13168550964 captcha=${text_code} accountType=2
${data} Set Variable {"accountType":2,"password":null,"account":"13168550964","captcha":"${text_code}"}
${respones} POST On Session ZTBT uec/authorize/by-captcha ${data.encode('utf-8')}
log ${respones.status_code}
log ${respones.json()}
${token} Get From Dictionary ${respones.json()["data"]} token
#log ${respones.json()["data"]["token"]}
Set Global Variable ${token}
[Teardown]
login-token
#${header} Create Dictionary content-type=application/json X-APP-ID=470236309865238528
Create Session ZTBT ${url} ${header}
${token1} Create Dictionary loginToken=${token}
${reps} Post On Session ZTBT recycle-user-center/authorize/get/product-line-token/by/login-token json=${token1}
${gettoken} Get From Dictionary ${reps.json()["data"]} token #获取token
${userId} Get From Dictionary ${reps.json()["data"]} userId #获取用户id
log ${reps.json()["data"]["token"]}
Set Global Variable ${gettoken}
Set Global Variable ${userId}
getuserinfo
#获取用户信息
${header} Create Dictionary content-type=application/json X-APP-ID=470236309865238528 Authorization=${gettoken}
Create Session baseinfo ${url} ${header}
${reps} Get On Session baseinfo recycle-service/user/get/base-info
${realName} Get From Dictionary ${reps.json()["data"]} realName #获取实名
${userId} Get From Dictionary ${reps.json()["data"]} userId #获取用户id
Set Global Variable ${realName}
Set Global Variable ${userId}

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

@ -1,23 +1,35 @@
*** Settings *** *** Settings ***
Documentation 创建常规订单 Documentation 创建常规订单
Test Teardown Run Keyword If Test Failed Fatal Error Test Teardown Run Keyword If Test Failed Fatal Error
Test Timeout 10 seconds
Test Timeout
Library RequestsLibrary Library RequestsLibrary
Library Collections Library Collections
Library DateTime Library DateTime
Library RedisLibrary
Library urllib3 Library urllib3
Library String
*** Variables *** *** Variables ***
${header} {'content-type':'application/json','X-APP-ID':'470236309865238528','Authorization':'QNT ${gettoken}'} ${header} {'content-type':'application/json','X-APP-ID':'470236309865238528','Authorization':'QNT ${gettoken}'}
${url} http://api-client-ztb-test.qniao.cn
${url} https://api-client-ztb-test.qniao.cn
*** Test Cases *** *** Test Cases ***
get_paper-mill-city
#获取纸厂所在城市
Create Session ZTBT ${url} ${header}
${reps} Get On Session ZTBT recycle-service/get/paper-mill-city
${data} Get From Dictionary ${reps.json()} data #城市列表
FOR ${items} IN @{data}
${cityName} Get From Dictionary ${items} cityName #城市name
${cityId} Get From Dictionary ${items} cityId #城市id
Exit For Loop If '${cityName}'=='茂名市'
END
Set Global Variable ${cityId}
get-factorylist get-factorylist
#获取代卖列表 #获取代卖列表
#${header} Create Dictionary content-type=application/json X-APP-ID=470236309865238528 Authorization=${gettoken} #${header} Create Dictionary content-type=application/json X-APP-ID=470236309865238528 Authorization=${gettoken}
Create Session factorylist http://api-client-ztb-test.qniao.cn ${header} 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
${reps} Get On Session factorylist recycle-service/get/paper-mill-paper-category-price-list params=cityId=${cityId}&enableSalesAgent=1&pageNum=1&pageSize=20&listType=0
Should Be Equal As Strings ${reps.json()["message"]} successful Should Be Equal As Strings ${reps.json()["message"]} successful
${records} Get From Dictionary ${reps.json()["data"]} records #获取代卖纸厂列表 ${records} Get From Dictionary ${reps.json()["data"]} records #获取代卖纸厂列表
FOR ${item} IN @{records} FOR ${item} IN @{records}
@ -28,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}'=='高州市金墩纸业有限公司'
END END
${value} Evaluate random.choice(${paperCategoryList}) random ${value} Evaluate random.choice(${paperCategoryList}) random
log to console \nvalue: ${value} log to console \nvalue: ${value}
@ -41,6 +53,7 @@ get-factorylist
Set Global Variable ${paperMillId} Set Global Variable ${paperMillId}
Set Global Variable ${paperMillAddress} Set Global Variable ${paperMillAddress}
Set Global Variable ${categoryName} Set Global Variable ${categoryName}
Set Global Variable ${name}
paper-mill-paper-category-price-details paper-mill-paper-category-price-details
#获取纸厂详情信息 #获取纸厂详情信息
@ -96,6 +109,8 @@ createorder
#创建下单 #创建下单
#${header} Create Dictionary content-type=application/json X-APP-ID=470236309865238528 Authorization=QNT ${gettoken} #${header} Create Dictionary content-type=application/json X-APP-ID=470236309865238528 Authorization=QNT ${gettoken}
${datatime} get current date result_format=%Y-%m-%d ${datatime} get current date result_format=%Y-%m-%d
#${DT} Add Time To Date ${datatime} -1 day
#${str} Get Substring ${DT} 0 10
log ${datatime} log ${datatime}
${data} Set Variable {"paperCategoryId":"${categoryid}" ,"unitPrice":${unitPrice},"totalEstimatedWeight":30000,"customerName":"赖勇兰","deliveryTime":"${datatime}","carInfos":[{"plateNumber":"${plateNumber}"}]} ${data} Set Variable {"paperCategoryId":"${categoryid}" ,"unitPrice":${unitPrice},"totalEstimatedWeight":30000,"customerName":"赖勇兰","deliveryTime":"${datatime}","carInfos":[{"plateNumber":"${plateNumber}"}]}
log ${data} log ${data}
@ -121,3 +136,36 @@ createorder-newcar
Should Be Equal As Strings ${reps.json()["message"]} successful Should Be Equal As Strings ${reps.json()["message"]} successful
Set Global Variable ${datatime} Set Global Variable ${datatime}
Set Global Variable ${orderId} Set Global Variable ${orderId}
Repeat
Repeat Keyword 10 get-factorylist
*** 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}'=='谷木--一次'
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}'=='格森--两次活动'
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)/3-Withdrawal_application.robot

@ -23,7 +23,7 @@ get_order-withdrawal-list
${status} Get From Dictionary ${item} status #获取提现单状态 ${status} Get From Dictionary ${item} status #获取提现单状态
${tradeOrderId} Get From Dictionary ${item} tradeOrderId #获取提现单订单号 ${tradeOrderId} Get From Dictionary ${item} tradeOrderId #获取提现单订单号
${提现订单id} Get From Dictionary ${item} id #获取提现单id ${提现订单id} Get From Dictionary ${item} id #获取提现单id
Exit For Loop If '${status}'=='1'
Exit For Loop If '${status}'=='0'
END END
#${tradeOrderId} Get From Dictionary ${reps_data.json()["data"]["orderWithdrawalList"][-1]} tradeOrderId #交易订单号 #${tradeOrderId} Get From Dictionary ${reps_data.json()["data"]["orderWithdrawalList"][-1]} tradeOrderId #交易订单号
#${提现订单id} Get From Dictionary ${reps_data.json()["data"]["orderWithdrawalList"][-1]} id #提现订单id #${提现订单id} Get From Dictionary ${reps_data.json()["data"]["orderWithdrawalList"][-1]} id #提现订单id

9
1-Client(Test)/3.1-Automatic withdrawal.robot

@ -2,6 +2,7 @@
Library RequestsLibrary Library RequestsLibrary
Library DateTime Library DateTime
Library urllib3 Library urllib3
Library SeleniumLibrary
*** Test Cases *** *** Test Cases ***
login login
@ -16,3 +17,11 @@ Automatic withdrawal
${data} Create Dictionary id=2 executorParam={'datatime':'${datatime}','period':'0'} addressList= ${data} Create Dictionary id=2 executorParam={'datatime':'${datatime}','period':'0'} addressList=
${reps} Post On Session xxl-job xxl-job-admin/jobinfo/trigger data=${data} ${reps} Post On Session xxl-job xxl-job-admin/jobinfo/trigger data=${data}
#log ${reps.json()} #log ${reps.json()}
Automatic-withdrawal(UI)
Open Browser http://xxl-job-admin-test.qniao.cn/xxl-job-admin/ chrome #在浏览器中打开网页
SeleniumLibrary.Input Text //input[@placeholder="请输入登录账号"] admin
sleep 1
SeleniumLibrary.Input Text //input[@placeholder="请输入登录密码"] 123456
Click Button //button[@class='btn btn-primary btn-block btn-flat']
Click Image class='fa fa-circle-o text-yellow'

20
1-Client(Test)/7-Consignment_order.robot

@ -3,7 +3,7 @@ Documentation 查看代卖订单
Library RequestsLibrary Library RequestsLibrary
Library Collections Library Collections
Library DateTime Library DateTime
Library RedisLibrary
Library redis
Library urllib3 Library urllib3
*** Variables *** *** Variables ***
@ -14,12 +14,18 @@ ${url} http://api-client-ztb-test.qniao.cn
get_proxy-order-list get_proxy-order-list
Create Session ZTBT ${url} ${header} Create Session ZTBT ${url} ${header}
${reps} Get On Session ZTBT recycle-service/proxy-sell/get/proxy-order-list params=status=&pageNum=1&pageSize=15 ${reps} Get On Session ZTBT recycle-service/proxy-sell/get/proxy-order-list params=status=&pageNum=1&pageSize=15
${orderId} Get From Dictionary ${reps.json()["data"]["records"][0]} orderId #获取代卖订单编号
Set Global Variable ${orderId}
${records} Get From Dictionary ${reps.json()["data"]} records #获取代卖订单列表
FOR ${items} IN @{records}
${orderid} Get From Dictionary ${items} orderId #获取订单编号
Exit For Loop If ${orderid}==${orderId} #当订单id相等时跳出循环
END
log ${orderid}
get_proxy-order_details get_proxy-order_details
#查看订单详情
Create Session ZTBT ${url} ${header} Create Session ZTBT ${url} ${header}
${reps} Get On Session ZTBT recycle-service/proxy-sell/get/proxy-order/${orderId}
${data} Get From Dictionary ${reps.json()} data
Set Global Variable ${data}
Run Keyword If '${orderId}' in ${data} Log To Console ${data}
${reps} Get On Session ZTBT recycle-service/proxy-sell/get/proxy-order/${orderid}
Should Be Equal As Strings ${name} ${reps.json()["data"]["paperMillName"]} #断言纸厂名称是否相等
Should Be Equal As Strings ${categoryName} ${reps.json()["data"]["paperCategoryName"]} #断言品类名称是否相等
Should Be Equal As Strings ${orderId} ${reps.json()["data"]["orderId"]} #断言订单id是否相等
Should Be Equal As Strings ${plateNumber} ${reps.json()["data"]["orderItems"][0]["logisticcsInfo"]["plateNumber"]} #断言车牌号是否相等

28
1-Client(Test)/factory.robot

@ -1,28 +0,0 @@
*** Settings ***
Library RequestsLibrary
Library Collections
*** Variables ***
${header} {'Content-Type': 'application/json','X-APP-ID':'503258978847953924'}
*** Test Cases ***
login
${header} Create Dictionary Content-Type=application/json X-APP-ID=503258978847953924
Create Session ZTBF http://api-client-uec-test.qniao.cn ${header}
${data} Create Dictionary account=13517986787 captcha=888888 accountType=2
log ${data}
#${data} Set Variable {"account":"13517986787","accountType":2,"captcha":"888888","signType":1,"sign":"c2d5ef09b96575e04503461af4bc7044","signStr":"{\"account\":\"13517986787\",\"accountType\":2,\"captcha\":\"888888\",\"signType\":1}"}
${respones} POST On Session ZTBF /uec/authorize/by-captcha json=${data}
${gettoken} Get From Dictionary ${respones.json()["data"]} token
Set Global Variable ${gettoken}
login-token
${header} Create Dictionary Content-Type=application/json;charset=UTF-8 X-APP-ID=503258978847953924 Authorization=QNT ${gettoken}
Create Session ZTB http://api-client-ztb-test.qniao.cn ${header}
${data} Set Variable {"loginToken":"${gettoken}"}
${respones} POST On Session ZTB recycle-user-center/authorize/get/product-line-token/by/login-token ${data}
员工管理
${header} Create Dictionary X-APP-ID=503258978847953924 X-FACTORY-ID=615992051053498368 Authorization=QNT ${gettoken}
Create Session ZTBF http://api-client-ztb-test.qniao.cn ${header}
${reps} Get On Session ZTBF recycle-user-center/get/self-department-role-list

BIN
1635824097672.xlsx

BIN
1637047948939.xlsx

BIN
1637048116722.xlsx

BIN
1637048161685.xlsx

20
2-Background_system(Test)/1.1-New_PaperMill/New_paper_mill.robot

@ -80,11 +80,17 @@ get_paperMill_list-1
#获取纸厂列表 #获取纸厂列表
Create Session ZTBT ${URL} ${header} Create Session ZTBT ${URL} ${header}
${reps} Get On Session ZTBT recycle-service/admin/paperMill/get/paper-mill-list params=pageNum=1&pageSize=20 ${reps} Get On Session ZTBT recycle-service/admin/paperMill/get/paper-mill-list params=pageNum=1&pageSize=20
${paperMillId} Get From Dictionary ${reps.json()["data"]["records"][0]} id #纸厂信息
${paperMilld_name} Get From Dictionary ${reps.json()["data"]["records"][0]} name #纸厂name
${records} Get From Dictionary ${reps.json()["data"]} records #获取纸厂列表信息
FOR ${items} IN @{records}
${paperMillId} Get From Dictionary ${items} id #纸厂信息
${paperMilld_name} Get From Dictionary ${items} name #纸厂name
${shortName} Get From Dictionary ${items} shortName #纸厂简称
Exit For Loop If '${paperMilld_name}'=='格森纸业有限公司'
END
Should Be Equal As Strings ${reps.json()["message"]} successful Should Be Equal As Strings ${reps.json()["message"]} successful
Set Global Variable ${paperMillId} Set Global Variable ${paperMillId}
Set Global Variable ${paperMilld_name} Set Global Variable ${paperMilld_name}
Set Global Variable ${shortName}
get_paper-mill-category get_paper-mill-category
#获取纸厂品类列表 #获取纸厂品类列表
@ -121,6 +127,11 @@ get_paper-mill-category-list
Set Global Variable ${List1} Set Global Variable ${List1}
Set Global Variable ${List2} Set Global Variable ${List2}
get-papermill-information-management
#获取纸厂情报信息
Create Session ZTBT ${URL} ${header}
${reps} Get On Session ZTBT recycle-service/admin/information-management/page params=paperMillId=${paperMillId}&queryDate=&pageNum=1&pageSize=100000
get_paper-mill-category-price-list get_paper-mill-category-price-list
#获取报价列表 #获取报价列表
Create Session ZTBT ${URL} ${header} Create Session ZTBT ${URL} ${header}
@ -128,10 +139,9 @@ get_paper-mill-category-price-list
log ${reps.json()} log ${reps.json()}
get_paper-mill-category-price-last get_paper-mill-category-price-last
#获取纸厂报价详情
#修改纸厂报价
Create Session ZTBT ${URL} ${header} Create Session ZTBT ${URL} ${header}
${data} Set Variable { \ \ \ \ "paperMillId":"${paperMillId}" }
${reps} Post On Session ZTBT recycle-service/admin/paperMillCategory/get/paper-mill-category-price-last ${data.encode('utf-8')}
${reps} Get On Session ZTBT recycle-service/admin/paperMajorCategory/get/paper-major-category-list
log ${reps.json()} log ${reps.json()}
add_paper-mill-category-price add_paper-mill-category-price

17
2-Background_system(Test)/1.3-operation management/contract.robot

@ -10,6 +10,19 @@ ${header} {'X-APP-ID':'470236309865238555','Authorization':'${gettoken}'
${psc_url} http://api-ops-psc-test.qniao.cn ${psc_url} http://api-ops-psc-test.qniao.cn
*** Test Cases *** *** Test Cases ***
get_enterprise-list
#获取企业列表
Create Session ZTBT ${psc_url} ${header}
${reps} Get On Session ZTBT payment-settlement-center/admin/supplier/get/enterprise-list/serarch-by-name-and-type
${data} Get From Dictionary ${reps.json()} data #企业列表
FOR ${items} IN @{data}
${enterpriseName} Get From Dictionary ${items} enterpriseName #企业name
${enterpriseId} Get From Dictionary ${items} enterpriseId #企业id
Exit For Loop If '${enterpriseName}'=='高州市金墩纸业有限公司'
END
Set Global Variable ${enterpriseName}
Set Global Variable ${enterpriseId}
get_contract_list get_contract_list
#获取生效中的合同列表 #获取生效中的合同列表
Create Session ZTBT ${URL} ${header} Create Session ZTBT ${URL} ${header}
@ -32,7 +45,7 @@ Seller_enterprise-list
${sellerEnterpriseName} Get From Dictionary ${items} enterpriseName #卖方企业名称 ${sellerEnterpriseName} Get From Dictionary ${items} enterpriseName #卖方企业名称
${sellerEnterpriseId} Get From Dictionary ${items} enterpriseId #卖方企业id ${sellerEnterpriseId} Get From Dictionary ${items} enterpriseId #卖方企业id
${seller_id} Get From Dictionary ${items} id #企业标识符 ${seller_id} Get From Dictionary ${items} id #企业标识符
Exit For Loop If '${enterpriseName}'=='企业'
Exit For Loop If '${sellerEnterpriseName}'=='企业'
END END
Set Global Variable ${seller_id} Set Global Variable ${seller_id}
Set Global Variable ${sellerEnterpriseName} Set Global Variable ${sellerEnterpriseName}
@ -48,7 +61,7 @@ Buyer_enterprise-list
${buyerEnterpriseName} Get From Dictionary ${items} enterpriseName #买方企业名称 ${buyerEnterpriseName} Get From Dictionary ${items} enterpriseName #买方企业名称
${buyerEnterpriseId} Get From Dictionary ${items} enterpriseId #买方企业id ${buyerEnterpriseId} Get From Dictionary ${items} enterpriseId #买方企业id
${buyer_id} Get From Dictionary ${items} id #企业标识符 ${buyer_id} Get From Dictionary ${items} id #企业标识符
Exit For Loop If '${enterpriseName}'=='${paperMilld_name}'
Exit For Loop If '${buyerEnterpriseName}'=='高州市金墩纸业有限公司'
END END
Set Global Variable ${buyer_id} Set Global Variable ${buyer_id}
Set Global Variable ${buyerEnterpriseName} Set Global Variable ${buyerEnterpriseName}

72
2-Background_system(Test)/1.5-Information_management/information.robot

@ -0,0 +1,72 @@
*** Settings ***
Library DateTime
Library Collections
Library RequestsLibrary
Library urllib3
Library SSHLibrary
*** Variables ***
${header} {'X-APP-ID':'470236309865238555','Authorization':'${gettoken}','Content-Type':'application/json'}
${URL} https://api-ops-ztb-test.qniao.cn
*** Test Cases ***
get_price-guide-list
#获取情报信息列表
Disable Warnings
Create Session ZTBT ${URL} ${header}
${reps} Get On Session ZTBT recycle-service/admin/information-management/page params=queryDate=&pageNum=1&pageSize=100000
log ${reps.json()}
update_price-guide-list
#编辑情报信息
Disable Warnings
Create Session ZTBT ${URL} ${header}
${data} Set Variable \ { \ \ \ \ "id": 0, \ \ \ \ "isShow": 0, \ \ \ \ "paperMillOrgId": 0 \ \ }
${reps} Post On Session ZTBT recycle-service/admin/priceGuide/update/price-guide-list ${data.encode('utf-8')}
Download_template
#下载导入模板
Disable Warnings
Create Session ZTBT ${URL} ${header}
${reps} Get On Session ZTBT recycle-service/admin/information-management/down-load-template
${data} Get From Dictionary ${reps.json()} data #获取文件
Set Global Variable ${data}
download_temp
#导出文档
#Create Session ZTBT ${URL} ${header}
#${reps} Get On Session ZTBT recycle-service/admin/download/temp/${data}
#log ${reps.content}
Open Connection 39.108.227.105 22
Login root @Qniaoyy2020
Get File /root/recycle-service/files/temp/${data}
Import
#批量导入
Disable Warnings
${file} Evaluate open("E:/lyl/Test/1631937001388.xlsx","rb")
${file_data} Create Dictionary file=${file}
${headers} Create Dictionary multipart/form-data; boundary=<calculated when request is sent> X-APP-ID=470236309865238555 Authorization=${gettoken}
Create Session ZTBT ${URL} ${headers}
${reponse} Post On Session ZTBT recycle-service/admin/received-weight/upload/ files=${file_data}
Export
#导出纸厂车辆排队信息
Disable Warnings
Create Session ZTBT ${URL} ${header}
${data} Set Variable { \ \ \ \ "paperMillId":null, \ \ \ \ "queryDate":[ \ \ \ \ \ ] }
${reps} Post On Session ZTBT recycle-service/admin/information-management/export ${data}
${DT} Get From Dictionary ${reps.json()} data
Set Global Variable ${DT}
download_temp1
#导出文档
#Create Session ZTBT ${URL} ${header}
#${reps} Get On Session ZTBT recycle-service/admin/download/temp/${data}
#log ${reps.content}
Open Connection 39.108.227.105 22
Login root @Qniaoyy2020
Get File /root/recycle-service/files/temp/${DT}
Write cd /root/recycle-service/files/temp/
Write rm -f \ ${DT}
Close Connection

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

@ -1,6 +1,6 @@
*** Settings *** *** Settings ***
Documentation 上传磅单-常规 Documentation 上传磅单-常规
Test Timeout 10 seconds
Test Timeout
Library Collections Library Collections
Library RequestsLibrary Library RequestsLibrary
Library DateTime Library DateTime
@ -39,6 +39,7 @@ get-order-item-details
${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
#${activitySettleType} Get From Dictionary ${reps.json()["data"]["orderItems"][0]} activitySettleType #活动结算方式(0:70%,1:85%,2:全额)
log ${contractId} log ${contractId}
Set Global Variable ${contractId} Set Global Variable ${contractId}
Set Global Variable ${unitSurcharge} Set Global Variable ${unitSurcharge}
@ -50,6 +51,7 @@ get-order-item-details
Set Global Variable ${paperMillSupplierName} Set Global Variable ${paperMillSupplierName}
Set Global Variable ${proxySellerSettleType} Set Global Variable ${proxySellerSettleType}
Set Global Variable ${contractId} Set Global Variable ${contractId}
#Set Global Variable ${activitySettleType}
get-Transaction subject get-Transaction subject
#获取交易主体 #获取交易主体
@ -139,6 +141,7 @@ get_contract_by_id
${settlePriceIncludeTaxSettleRules} Get From Dictionary ${reps.json()["data"]} settlePriceIncludeTaxSettleRules #含税结算单价结算规则 ${settlePriceIncludeTaxSettleRules} Get From Dictionary ${reps.json()["data"]} settlePriceIncludeTaxSettleRules #含税结算单价结算规则
${advanceFund} Set Variable If '${advanceFund}'=='${None}' 0 ${advanceFund} ${advanceFund} Set Variable If '${advanceFund}'=='${None}' 0 ${advanceFund}
${proxyPaySurcharge} Set Variable If '${proxyPaySurcharge}'=='${None}' 0 ${proxyPaySurcharge} ${proxyPaySurcharge} Set Variable If '${proxyPaySurcharge}'=='${None}' 0 ${proxyPaySurcharge}
${taxRefundRate} Set Variable If '${taxRefundRate}'=='${None}' 0 ${taxRefundRate}
Set Global Variable ${advanceFund} Set Global Variable ${advanceFund}
Set Global Variable ${buyerEnterpriseId} Set Global Variable ${buyerEnterpriseId}
Set Global Variable ${taxRefundRate} Set Global Variable ${taxRefundRate}
@ -188,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":"30", \ \ \ \ "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":18000, \ \ \ \ "activitySettleType":null, \ \ \ \ "unitSurcharge":"${unitSurcharge}", \ \ \ \ "deliveryImageUrls":[ \ \ \ \ \ ], \ \ \ \ "publicSubsidies":0, \ \ \ \ "isSubsidyAndDeductIncludeTax":0, \ \ \ \ "orderId":"${orderId}", \ \ \ \ "settleWeight":17550, \ \ \ \ "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":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 \ \ \ \ \ \ \ \ } \ \ \ \ ] }
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"]}

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

@ -183,7 +183,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}" \ \ \ \ ], \ \ \ \ "scrapeOrderId":"", \ \ \ \ "orderItemId":"${orderItemId}", \ \ \ \ "unitPrice":"${paperCategoryPrice}", \ \ \ \ "paperCategoryId":"${categoryId}", \ \ \ \ "millSupplierId":"${supplier_id}", \ \ \ \ "millSupplierName":"${millSupplierName}", \ \ \ \ "settleUtiPriceIncludeTax":1.6608157894736841, \ \ \ \ "settleUtiPriceIncludeTaxType":"${settleUtiPriceIncludeTaxType}", \ \ \ \ "receivableAdjustMoney":"30", \ \ \ \ "refundSubsidy":0.002, \ \ \ \ "adjustMoney":"20", \ \ \ \ "collectionCharges":"${proxyPaySurcharge}", \ \ \ \ "advanceFund":"${advanceFund}", \ \ \ \ "transactionMainEnterpriseId":"${交易主体id}", \ \ \ \ "contractId":"${contractId}", \ \ \ \ "warehouseName":"${所属仓库}", \ \ \ \ "weightDay":"${datatime}", \ \ \ \ "settleDay":"${datatime}", \ \ \ \ "transactionMainEnterpriseName":"${交易主体name}", \ \ \ \ "proxySellerSettleType":"${proxySellerSettleType}", \ \ \ \ "receivableSettlementRules":"${receivableSettlementRules}", \ \ \ \ "isInvoice":"${hasInvoice}", \ \ \ \ "invoicePoint":"${taxRefundRate}", \ \ \ \ "deductionNotes":"${datatime}", \ \ \ \ "plateNumber":"${plateNumber}", \ \ \ \ "settlePriceIncludeTaxSettleRules":"${settlePriceIncludeTaxSettleRules}", \ \ \ \ "settleUtiPrice":"${settleUtiPrice}", \ \ \ \ "netWeight":15800, \ \ \ \ "activitySettleType":null, \ \ \ \ "unitSurcharge":"${unitSurcharge}", \ \ \ \ "deliveryImageUrls":[ \ \ \ \ \ ], \ \ \ \ "publicSubsidies":0, \ \ \ \ "orderId":"${orderId}", \ \ \ \ "nonStandardPenalty_car":"", \ \ \ \ "settleWeight":14800, \ \ \ \ "deductedWeight":0, \ \ \ \ "orderType":1, \ \ \ \ "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":2, \ \ \ \ \ \ \ \ \ \ \ \ "unitAmount":15, \ \ \ \ \ \ \ \ \ \ \ \ "title":"otherPenalty", \ \ \ \ \ \ \ \ \ \ \ \ "isSubsidies":0 \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "unitType":1, \ \ \ \ \ \ \ \ \ \ \ \ "unitAmount":0.001, \ \ \ \ \ \ \ \ \ \ \ \ "title":"nonStandardPenalty", \ \ \ \ \ \ \ \ \ \ \ \ "isSubsidies":0 \ \ \ \ \ \ \ \ } \ \ \ \ ] }
${data} Set Variable { \ \ \ \ "deductedPoint":0, \ \ \ \ "imageUrl":[ \ \ \ \ \ \ \ \ "${pictures}" \ \ \ \ ], \ \ \ \ "scrapeOrderId":"", \ \ \ \ "orderItemId":"${orderItemId}", \ \ \ \ "unitPrice":"${paperCategoryPrice}", \ \ \ \ "paperCategoryId":"${categoryId}", \ \ \ \ "millSupplierId":"${supplier_id}", \ \ \ \ "millSupplierName":"${millSupplierName}", \ \ \ \ "settleUtiPriceIncludeTax":1.6608157894736841, \ \ \ \ "settleUtiPriceIncludeTaxType":"${settleUtiPriceIncludeTaxType}", \ \ \ \ "receivableAdjustMoney":"30", \ \ \ \ "refundSubsidy":0.002, \ \ \ \ "adjustMoney":"20", \ \ \ \ "collectionCharges":"${proxyPaySurcharge}", \ \ \ \ "advanceFund":"${advanceFund}", \ \ \ \ "transactionMainEnterpriseId":"${交易主体id}", \ \ \ \ "contractId":"${contractId}", \ \ \ \ "warehouseName":"${所属仓库}", \ \ \ \ "weightDay":"${datatime}", \ \ \ \ "settleDay":"${datatime}", \ \ \ \ "transactionMainEnterpriseName":"${交易主体name}", \ \ \ \ "proxySellerSettleType":"${proxySellerSettleType}", \ \ \ \ "receivableSettlementRules":"${receivableSettlementRules}", \ \ \ \ "isInvoice":"${hasInvoice}", \ \ \ \ "invoicePoint":"${taxRefundRate}", \ \ \ \ "deductionNotes":"${datatime}", \ \ \ \ "plateNumber":"${plateNumber}", \ \ \ \ "settlePriceIncludeTaxSettleRules":"${settlePriceIncludeTaxSettleRules}", \ \ \ \ "settleUtiPrice":"${settleUtiPrice}", \ \ \ \ "netWeight":20000, \ \ \ \ "activitySettleType":null, \ \ \ \ "unitSurcharge":"${unitSurcharge}", \ \ \ \ "deliveryImageUrls":[ \ \ \ \ \ ], \ \ \ \ "publicSubsidies":0, \ \ \ \ "orderId":"${orderId}", \ \ \ \ "nonStandardPenalty_car":"", \ \ \ \ "settleWeight":10000, \ \ \ \ "deductedWeight":0, \ \ \ \ "orderType":1, \ \ \ \ "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":2, \ \ \ \ \ \ \ \ \ \ \ \ "unitAmount":15, \ \ \ \ \ \ \ \ \ \ \ \ "title":"otherPenalty", \ \ \ \ \ \ \ \ \ \ \ \ "isSubsidies":0 \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "unitType":1, \ \ \ \ \ \ \ \ \ \ \ \ "unitAmount":0.001, \ \ \ \ \ \ \ \ \ \ \ \ "title":"nonStandardPenalty", \ \ \ \ \ \ \ \ \ \ \ \ "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()} log ${reps.json()}

4
2-Background_system(Test)/2.1-Consignment management/2.3-ActiveUpload-deliverynote.robot

@ -34,6 +34,7 @@ get-order-item-details
${proxySellerSettleType} Get From Dictionary ${reps.json()["data"]} proxySellerSettleType #代卖费结算方式 ${proxySellerSettleType} Get From Dictionary ${reps.json()["data"]} proxySellerSettleType #代卖费结算方式
${交易主体id} Get From Dictionary ${reps.json()["data"]} transactionMainEnterpriseId #交易主体id ${交易主体id} Get From Dictionary ${reps.json()["data"]} transactionMainEnterpriseId #交易主体id
${交易主体name} Get From Dictionary ${reps.json()["data"]} transactionMainEnterpriseName #交易主体name ${交易主体name} Get From Dictionary ${reps.json()["data"]} transactionMainEnterpriseName #交易主体name
${unitSurcharge} Get From Dictionary ${reps.json()["data"]} unitSurcharge #代卖费单价
${publicSubsidies} Set Variable If '${publicSubsidies}'=='${null}' 0 ${publicSubsidies} ${publicSubsidies} Set Variable If '${publicSubsidies}'=='${null}' 0 ${publicSubsidies}
${settleUtiPrice}= Evaluate ${unitPrice}+${publicSubsidies} #结算单价 ${settleUtiPrice}= Evaluate ${unitPrice}+${publicSubsidies} #结算单价
${contractId} Get From Dictionary ${reps.json()["data"]["orderItems"][0]} contractId #合同id ${contractId} Get From Dictionary ${reps.json()["data"]["orderItems"][0]} contractId #合同id
@ -46,6 +47,7 @@ get-order-item-details
Set Global Variable ${settleUtiPrice} Set Global Variable ${settleUtiPrice}
Set Global Variable ${交易主体id} Set Global Variable ${交易主体id}
Set Global Variable ${交易主体name} Set Global Variable ${交易主体name}
Set Global Variable ${unitSurcharge}
get_delivery-info get_delivery-info
#获取订单名片信息 #获取订单名片信息
@ -166,7 +168,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 { \ \ \ \ "settleUtiPrice":"${settleUtiPrice}", \ \ \ \ "publicSubsidies":0, \ \ \ \ "netWeight":13000, \ \ \ \ "settleWeight":null, \ \ \ \ "unitSurcharge":0.02, \ \ \ \ "transactionMainEnterpriseId":"${交易主体id}", \ \ \ \ \ "transactionMainEnterpriseName":"${交易主体name}", \ \ \ \ "activitySettleType":"${activitySettleType}", \ \ \ \ "proxySellerSettleType":"${proxySellerSettleType}", \ \ \ \ "remark":null, \ \ \ \ "imageUrl":[ \ \ \ \ \ \ \ \ "${pictures}" \ \ \ \ ], \ \ \ \ "orderItemId":"${orderItemId}", \ \ \ \ "orderId":"${orderId}", \ \ \ \ "settleDay":"${datatime}", \ \ \ \ "settlePrice":0, \ \ \ \ "contractId":"${contractId}", \ \ \ \ "millSupplierId":"${supplier_id}", \ \ \ \ "millSupplierName":"${millSupplierName}", \ \ \ \ "invoicePoint":"${taxRefundRate}", \ \ \ \ "orderType":"${orderType}", \ \ \ \ "weightDay":"${datatime}", \ \ \ \ "isInvoice":"${hasInvoice}", \ \ \ \ "warehouseName":"${所属仓库}", \ \ \ \ "deductionNotes":"${datatime}", \ \ \ \ "receivableSettlementRules":"${receivableSettlementRules}", \ \ \ \ "plateNumber":"${plateNumber}", \ \ \ \ "otherAmountList":[ \ \ \ \ \ ], \ \ \ \ "unitPrice":"${paperCategoryPrice}" }
${data} Set Variable { \ \ \ \ "settleUtiPrice":"${settleUtiPrice}", \ \ \ \ "publicSubsidies":0, \ \ \ \ "netWeight":15500, \ \ \ \ "settleWeight":null, \ \ \ \ "unitSurcharge":${unitSurcharge}, \ \ \ \ "transactionMainEnterpriseId":"${交易主体id}", \ \ \ \ \ "transactionMainEnterpriseName":"${交易主体name}", \ \ \ \ "activitySettleType":"${activitySettleType}", \ \ \ \ "proxySellerSettleType":"${proxySellerSettleType}", \ \ \ \ "remark":null, \ \ \ \ "imageUrl":[ \ \ \ \ \ \ \ \ "${pictures}" \ \ \ \ ], \ \ \ \ "orderItemId":"${orderItemId}", \ \ \ \ "orderId":"${orderId}", \ \ \ \ "settleDay":"${datatime}", \ \ \ \ "settlePrice":0, \ \ \ \ "contractId":"${contractId}", \ \ \ \ "millSupplierId":"${supplier_id}", \ \ \ \ "millSupplierName":"${millSupplierName}", \ \ \ \ "invoicePoint":"${taxRefundRate}", \ \ \ \ "orderType":"${orderType}", \ \ \ \ "weightDay":"${datatime}", \ \ \ \ "isInvoice":"${hasInvoice}", \ \ \ \ "warehouseName":"${所属仓库}", \ \ \ \ "deductionNotes":"${datatime}", \ \ \ \ "receivableSettlementRules":"${receivableSettlementRules}", \ \ \ \ "plateNumber":"${plateNumber}", \ \ \ \ "otherAmountList":[ \ \ \ \ \ ], \ \ \ \ "unitPrice":"${paperCategoryPrice}" }
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()} log ${reps.json()}

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

@ -1,8 +1,12 @@
*** Settings *** *** Settings ***
Documentation 运营审核-常规 Documentation 运营审核-常规
Test Timeout
Library DateTime Library DateTime
Library Collections Library Collections
Library RequestsLibrary Library RequestsLibrary
Resource 提交磅单.txt
Resource 运营审核驳回.txt
Resource 台账查询.txt
*** Variables *** *** Variables ***
${header} {'X-APP-ID':'470236309865238555','Authorization':'${gettoken}','Content-Type':'application/json'} ${header} {'X-APP-ID':'470236309865238555','Authorization':'${gettoken}','Content-Type':'application/json'}
@ -43,8 +47,11 @@ get_order-receipt-audit-details
${paperMillPayAt} Get From Dictionary ${reps.json()["data"]["items"][0]} paperMillPayAt #计划回款日期 ${paperMillPayAt} Get From Dictionary ${reps.json()["data"]["items"][0]} paperMillPayAt #计划回款日期
${plateNumber} Get From Dictionary ${reps.json()["data"]["items"][0]} plateNumber #车牌号 ${plateNumber} Get From Dictionary ${reps.json()["data"]["items"][0]} plateNumber #车牌号
${settleWeight} Get From Dictionary ${reps.json()["data"]["items"][0]} settleWeight #结算重量 ${settleWeight} Get From Dictionary ${reps.json()["data"]["items"][0]} settleWeight #结算重量
${surcharge} Set Variable If '${proxySellerSettleType}'=='0' '${unitSurcharge}'*'${netWeight}' '${unitSurcharge}'*'${settleWeight}' #代卖费总额
${surcharge1} Evaluate ${unitSurcharge}*${netWeight}
${surcharge2} Evaluate ${unitSurcharge}*${settleWeight}
${surcharge} Set Variable If '${proxySellerSettleType}'=='0' ${surcharge1} ${surcharge2} #代卖费总额
${paperMillPayAt} Set Variable If '${paperMillPayAt}'=='无账期' null ${paperMillPayAt} #纸厂账期 ${paperMillPayAt} Set Variable If '${paperMillPayAt}'=='无账期' null ${paperMillPayAt} #纸厂账期
${audit_status} Get From Dictionary ${reps.json()["data"]} status
Set Global Variable ${auditRequestItemId} Set Global Variable ${auditRequestItemId}
Set Global Variable ${categoryName} Set Global Variable ${categoryName}
Set Global Variable ${netWeight} Set Global Variable ${netWeight}
@ -53,12 +60,13 @@ get_order-receipt-audit-details
Set Global Variable ${settleWeight} Set Global Variable ${settleWeight}
Set Global Variable ${paperCategoryId} Set Global Variable ${paperCategoryId}
Set Global Variable ${surcharge} Set Global Variable ${surcharge}
Set Global Variable ${audit_status}
order-receipt-audit-details order-receipt-audit-details
#b保存磅单信息 #b保存磅单信息
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 { \ \ \ \ "auditRequestItemId":"${auditRequestItemId}", \ \ \ \ "categoryName":"${categoryName}", \ \ \ \ "netWeight":"${netWeight}", \ \ \ \ "paperCategoryId":null, \ \ \ \ "paperMillPayAt":${paperMillPayAt}, \ \ \ \ "plateNumber":"${plateNumber}", \ \ \ \ "settlementDate":"${datatime}", \ \ \ \ "weighingDate":"${datatime}", \ \ \ \ "settleWeight":"${settleWeight}", \ \ \ \ "isInvoice":"${hasInvoice}", \ \ \ \ "fundSourceId":"${id}", \ \ \ \ "transactionMainEnterpriseName":"${交易主体name}", \ \ \ \ "invoicePoint":"${taxRefundRate}", \ \ \ \ "publicSubsidies":"${publicSubsidies}", \ \ \ \ "publicSubsidiesIncludeTax":0, \ \ \ \ "settleUnitPrice":"${settleUtiPrice}", \ \ \ \ "fundSourceName":"${name}" }
${data} Set Variable { \ \ \ \ "auditRequestItemId":"${auditRequestItemId}", \ \ \ \ "categoryName":"${categoryName}", \ \ \ \ "netWeight":"${netWeight}", \ \ \ \ "paperCategoryId":"${paperCategoryId}", \ \ \ \ "paperMillPayAt":"${paperMillPayAt}", \ \ \ \ "plateNumber":"${plateNumber}", \ \ \ \ "settlementDate":"${datatime}", \ \ \ \ "weighingDate":"${datatime}", \ \ \ \ "settleWeight":"${settleWeight}", \ \ \ \ "isInvoice":"${hasInvoice}", \ \ \ \ "fundSourceId":"${id}", \ \ \ \ "transactionMainEnterpriseName":"${交易主体name}", \ \ \ \ "invoicePoint":"${taxRefundRate}", \ \ \ \ "publicSubsidies":"${publicSubsidies}", \ \ \ \ "publicSubsidiesIncludeTax":0, \ \ \ \ "settleUnitPrice":"${settleUtiPrice}", \ \ \ \ "fundSourceName":"${name}" }
${reps} Post On Session ZTBT recycle-service/admin/operation/edit/order-receipt-audit-details ${data.encode('utf-8')} ${reps} Post On Session ZTBT recycle-service/admin/operation/edit/order-receipt-audit-details ${data.encode('utf-8')}
Should Be Equal As Strings ${reps.json()["message"]} successful Should Be Equal As Strings ${reps.json()["message"]} successful
@ -69,6 +77,63 @@ get_order-log-detail2
log ${reps.json()} log ${reps.json()}
Should Be Equal As Strings ${reps.json()["message"]} successful Should Be Equal As Strings ${reps.json()["message"]} successful
重复执行驳回上传磅单
#重复执行上传磅单、运营驳回操作
FOR ${items} IN RANGE 3
Run Keyword get_operation_list
Run Keyword get_order-receipt-audit-details
Run Keyword If '${audit_status}'=='0' Run Keyword 运营审核驳回
sleep 1
Run Keyword 获取磅单详情
Run Keyword If '${status}'=='51' weightnote
Run Keyword audit_weightnote
END
get_operation_list1
#获取运营审核列表
Create Session ZTBT ${URL} ${header}
${reps} Get On Session ZTBT recycle-service/admin/operation/get/paper-mill-order-receipt-audit params=pageNum=1&pageSize=10&status=0&orderItemId=&orderId=${orderId}
${audit_status} Get From Dictionary ${reps.json()["data"]["records"][0]} status
${auditRequestId} Get From Dictionary ${reps.json()["data"]["records"][0]} auditRequestId
Set Global Variable ${audit_status}
Set Global Variable ${auditRequestId}
get_order-receipt-audit-details1
#查看运营审核详情
Create Session ZTBT ${URL} ${header}
${reps} Post On Session ZTBT recycle-service/admin/operation/get/order-receipt-audit-details/${auditRequestId}/${weightNoteId}
log ${reps.json()}
${auditRequestItemId} Get From Dictionary ${reps.json()["data"]["items"][0]} auditRequestItemId #审核项id
${categoryName} Get From Dictionary ${reps.json()["data"]["items"][0]} categoryName #纸品品类名称
${paperCategoryId} Get From Dictionary ${reps.json()["data"]["items"][0]} paperCategoryId #纸厂品类id
${netWeight} Get From Dictionary ${reps.json()["data"]["items"][0]} netWeight #净重
${paperMillPayAt} Get From Dictionary ${reps.json()["data"]["items"][0]} paperMillPayAt #计划回款日期
${plateNumber} Get From Dictionary ${reps.json()["data"]["items"][0]} plateNumber #车牌号
${settleWeight} Get From Dictionary ${reps.json()["data"]["items"][0]} settleWeight #结算重量
${settleWeight} Set Variable If '${settleWeight}'=='None' 0 ${settleWeight}
${surcharge1} Evaluate ${unitSurcharge}*${netWeight}
${surcharge2} Evaluate ${unitSurcharge}*${settleWeight}
${surcharge} Set Variable If '${proxySellerSettleType}'=='0' ${surcharge1} ${surcharge2} #代卖费总额
${paperMillPayAt} Set Variable If '${paperMillPayAt}'=='无账期' null ${paperMillPayAt} #纸厂账期
${auditRequestId} Get From Dictionary ${reps.json()["data"]} auditRequestId
Set Global Variable ${auditRequestItemId}
Set Global Variable ${categoryName}
Set Global Variable ${netWeight}
Set Global Variable ${paperMillPayAt}
Set Global Variable ${plateNumber}
Set Global Variable ${settleWeight}
Set Global Variable ${paperCategoryId}
Set Global Variable ${surcharge}
Set Global Variable ${auditRequestId}
order-receipt-audit-details1
#b保存磅单信息
Create Session ZTBT ${URL} ${header}
${datatime} Get Current Date result_format=%Y-%m-%d #获取当前时间
${data} Set Variable { \ \ \ \ "auditRequestItemId":"${auditRequestItemId}", \ \ \ \ "categoryName":"${categoryName}", \ \ \ \ "netWeight":"${netWeight}", \ \ \ \ "paperCategoryId":"${paperCategoryId}", \ \ \ \ "paperMillPayAt":"${paperMillPayAt}", \ \ \ \ "plateNumber":"${plateNumber}", \ \ \ \ "settlementDate":"${datatime}", \ \ \ \ "weighingDate":"${datatime}", \ \ \ \ "settleWeight":"${settleWeight}", \ \ \ \ "isInvoice":"${hasInvoice}", \ \ \ \ "fundSourceId":"${id}", \ \ \ \ "transactionMainEnterpriseName":"${交易主体name}", \ \ \ \ "invoicePoint":"${taxRefundRate}", \ \ \ \ "publicSubsidies":"${publicSubsidies}", \ \ \ \ "publicSubsidiesIncludeTax":0, \ \ \ \ "settleUnitPrice":"${settleUtiPrice}", \ \ \ \ "fundSourceName":"${name}" }
${reps} Post On Session ZTBT recycle-service/admin/operation/edit/order-receipt-audit-details ${data.encode('utf-8')}
Should Be Equal As Strings ${reps.json()["message"]} successful
operation_audit operation_audit
#运营审核确认通过 #运营审核确认通过
Create Session ZTBT ${URL} ${header} Create Session ZTBT ${URL} ${header}

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

@ -44,7 +44,9 @@ get_order-receipt-audit-details
${paperMillPayAt} Get From Dictionary ${reps.json()["data"]["items"][0]} paperMillPayAt #计划回款日期 ${paperMillPayAt} Get From Dictionary ${reps.json()["data"]["items"][0]} paperMillPayAt #计划回款日期
${plateNumber} Get From Dictionary ${reps.json()["data"]["items"][0]} plateNumber #车牌号 ${plateNumber} Get From Dictionary ${reps.json()["data"]["items"][0]} plateNumber #车牌号
${settleWeight} Get From Dictionary ${reps.json()["data"]["items"][0]} settleWeight #结算重量 ${settleWeight} Get From Dictionary ${reps.json()["data"]["items"][0]} settleWeight #结算重量
${surcharge} Set Variable If '${proxySellerSettleType}'=='0' '${unitSurcharge}'*'${netWeight}' '${unitSurcharge}'*'${settleWeight}' #代卖费总额
${surcharge1} Evaluate ${unitSurcharge}*${netWeight}
${surcharge2} Evaluate ${unitSurcharge}*${settleWeight}
${surcharge} Set Variable If '${proxySellerSettleType}'=='0' ${surcharge1} ${surcharge2} #代卖费总额
${paperMillPayAt} Set Variable If '${paperMillPayAt}'=='无账期' null ${paperMillPayAt} #纸厂账期 ${paperMillPayAt} Set Variable If '${paperMillPayAt}'=='无账期' null ${paperMillPayAt} #纸厂账期
Set Global Variable ${auditRequestItemId} Set Global Variable ${auditRequestItemId}
Set Global Variable ${categoryName} Set Global Variable ${categoryName}

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

@ -3,6 +3,9 @@ Documentation 运营审核-两次付款活动
Library RequestsLibrary Library RequestsLibrary
Library Collections Library Collections
Library DateTime Library DateTime
Resource 提交磅单.txt
Resource 运营审核驳回.txt
Resource 台账查询.txt
*** Variables *** *** Variables ***
${header} {'X-APP-ID':'470236309865238555','Authorization':'${gettoken}','Content-Type':'application/json'} ${header} {'X-APP-ID':'470236309865238555','Authorization':'${gettoken}','Content-Type':'application/json'}
@ -45,7 +48,7 @@ get_order-receipt-audit-details
${plateNumber} Get From Dictionary ${reps.json()["data"]["items"][0]} plateNumber #车牌号 ${plateNumber} Get From Dictionary ${reps.json()["data"]["items"][0]} plateNumber #车牌号
${settleWeight} Get From Dictionary ${reps.json()["data"]["items"][0]} settleWeight #结算重量 ${settleWeight} Get From Dictionary ${reps.json()["data"]["items"][0]} settleWeight #结算重量
${paperMillPayAt} Set Variable If '${paperMillPayAt}'=='无账期' null ${paperMillPayAt} #纸厂账期 ${paperMillPayAt} Set Variable If '${paperMillPayAt}'=='无账期' null ${paperMillPayAt} #纸厂账期
${settleWeight} Set Variable If '${settleWeight}'=='None' 0 ${settleWeight} #纸厂账期
${settleWeight} Set Variable If '${settleWeight}'=='None' 0 ${settleWeight} #结算重量
Set Global Variable ${auditRequestItemId} Set Global Variable ${auditRequestItemId}
Set Global Variable ${categoryName} Set Global Variable ${categoryName}
Set Global Variable ${netWeight} Set Global Variable ${netWeight}
@ -69,6 +72,60 @@ get_order-log-detail2
log ${reps.json()} log ${reps.json()}
Should Be Equal As Strings ${reps.json()["message"]} successful Should Be Equal As Strings ${reps.json()["message"]} successful
重复执行驳回和上传磅单操作
#重复执行上传磅单、运营驳回操作
FOR ${items} IN RANGE 10
Run Keyword get_operation_list
Run Keyword get_order-receipt-audit-details
Run Keyword If '${audit_status}'=='0' Run Keyword 运营审核驳回
sleep 1
Run Keyword 获取送货单详情
Run Keyword If '${status}'=='51' 上传送货单
Run Keyword audit_weightnote
Run Keyword 获取上传送货单后的订单详情
Run Keyword 台账查询
END
get_operation_list3
#获取运营审核列表
Create Session ZTBT ${URL} ${header}
${reps} Get On Session ZTBT recycle-service/admin/operation/get/paper-mill-order-receipt-audit params=pageNum=1&pageSize=10&status=0&orderItemId=&orderId=${orderId}
${audit_status} Get From Dictionary ${reps.json()["data"]["records"][0]} status
${auditRequestId} Get From Dictionary ${reps.json()["data"]["records"][0]} auditRequestId
Set Global Variable ${audit_status}
Set Global Variable ${auditRequestId}
get_order-receipt-audit-details3
#查看运营审核详情
Create Session ZTBT ${URL} ${header}
${datatime} Get Current Date result_format=%Y-%m-%d
${reps} Post On Session ZTBT recycle-service/admin/operation/get/order-receipt-audit-details/${auditRequestId}/${weightNoteId}
log ${reps.json()}
${auditRequestItemId} Get From Dictionary ${reps.json()["data"]["items"][0]} auditRequestItemId #审核项id
${categoryName} Get From Dictionary ${reps.json()["data"]["items"][0]} categoryName #纸品品类名称
${paperCategoryId} Get From Dictionary ${reps.json()["data"]} paperCategoryId #纸厂品类id
${netWeight} Get From Dictionary ${reps.json()["data"]["items"][0]} netWeight #净重
${paperMillPayAt} Get From Dictionary ${reps.json()["data"]["items"][0]} paperMillPayAt #计划回款日期
${plateNumber} Get From Dictionary ${reps.json()["data"]["items"][0]} plateNumber #车牌号
${settleWeight} Get From Dictionary ${reps.json()["data"]["items"][0]} settleWeight #结算重量
${paperMillPayAt} Set Variable If '${paperMillPayAt}'=='无账期' null ${paperMillPayAt} #纸厂账期
${settleWeight} Set Variable If '${settleWeight}'=='None' 0 ${settleWeight} #结算重量
Set Global Variable ${auditRequestItemId}
Set Global Variable ${categoryName}
Set Global Variable ${netWeight}
Set Global Variable ${paperMillPayAt}
Set Global Variable ${plateNumber}
Set Global Variable ${settleWeight}
Set Global Variable ${paperCategoryId}
Set Global Variable ${datatime}
order-receipt-audit-details3
#b保存磅单信息
Create Session ZTBT ${URL} ${header}
${data} Set Variable { \ \ \ \ "auditRequestItemId":"${auditRequestItemId}", \ \ \ \ "categoryName":"${categoryName}", \ \ \ \ "netWeight":"${netWeight}", \ \ \ \ "paperCategoryId":"${paperCategoryId}", \ \ \ \ "paperMillPayAt":"${paperMillPayAt}", \ \ \ \ "plateNumber":"${plateNumber}", \ \ \ \ "settlementDate":"${datatime}", \ \ \ \ "weighingDate":"${datatime}", \ \ \ \ "settleWeight":"${settleWeight}", \ \ \ \ "isInvoice":"${hasInvoice}", \ \ \ \ "fundSourceId":"${id}", \ \ \ \ "transactionMainEnterpriseName":"${交易主体name}", \ \ \ \ "invoicePoint":"${taxRefundRate}", \ \ \ \ "publicSubsidies":"${publicSubsidies}", \ \ \ \ "publicSubsidiesIncludeTax":0, \ \ \ \ "settleUnitPrice":"${settleUtiPrice}", \ \ \ \ "fundSourceName":"${name}" }
${reps} Post On Session ZTBT recycle-service/admin/operation/edit/order-receipt-audit-details ${data.encode('utf-8')}
Should Be Equal As Strings ${reps.json()["message"]} successful
operation_audit operation_audit
#运营审核确认通过 #运营审核确认通过
Create Session ZTBT ${URL} ${header} Create Session ZTBT ${URL} ${header}

0
2-Background_system(Test)/2.1-Consignment management/__init__.robot

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

@ -0,0 +1,16 @@
*** Settings ***
Library Collections
Library RequestsLibrary
*** Variables ***
${URL} http://api-ops-ztb-test.qniao.cn
${header} {'X-APP-ID':'470236309865238555','Authorization':'${gettoken}','Content-Type':'application/json'}
*** Keywords ***
台账查询
#获取台账列表
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}
${台账列表数据} Get From List ${reps.json()["data"]["records"]} 0 #获取台账列表数据
#Set Global Variable ${台账列表数据}
Should Be Equal As Numbers ${netWeight} ${reps.json()["data"]["records"][0]["netWeight"]}

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

@ -0,0 +1,135 @@
*** Settings ***
Library RequestsLibrary
Library DateTime
Library Collections
*** Variables ***
${URL} http://api-ops-ztb-test.qniao.cn
${header} {'X-APP-ID':'470236309865238555','Authorization':'${gettoken}','Content-Type':'application/json'}
*** Keywords ***
获取磅单详情
#查看订单列表详情
Create Session ZTBT ${URL} ${header}
#${data} Set Variable orderId=${orderId} orderItemId=${orderItemId}
${reps} Get On Session ZTBT recycle-service/admin/customer-service/get/proxy-order/${orderId} params=orderId=${orderId}&orderItemId=${orderItemId}
${contractId} Get From Dictionary ${reps.json()["data"]["orderItems"][0]} contractId #当前订单下单时的合同id
${unitSurcharge} Get From Dictionary ${reps.json()["data"]["orderItems"][0]} 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 #纸厂供应商名称
${publicSubsidies} Set Variable If '${publicSubsidies}'=='${null}' 0 ${publicSubsidies}
${settleUtiPrice}= Evaluate ${unitPrice}+${publicSubsidies} #结算单价
${unitSurcharge} Set Variable If '${unitSurcharge}'=='${None}' 0 ${unitSurcharge}
${contractId} Get From Dictionary ${reps.json()["data"]["orderItems"][0]} contractId #合同id
${磅单id} Get From Dictionary ${reps.json()["data"]["orderItems"][0]["weightnoteInfo"]} id #获取磅单id
${status} Get From Dictionary ${reps.json()["data"]} status
${netWeight} Get From Dictionary ${reps.json()["data"]["orderItems"][0]["weightnoteInfo"]} netWeight #获取净重
${settleWeight} Get From Dictionary ${reps.json()["data"]["orderItems"][0]["weightnoteInfo"]} settleWeight #获取结算重量
${netWeight1} Evaluate ${netWeight}+100
FOR ${净重index} IN RANGE ${netWeight} 30
Exit For Loop If '${净重index}'=='${netWeight1}'
END
${settleWeight1} Evaluate ${settleWeight}+100
FOR ${结算重量index} IN RANGE ${settleWeight} 30
Exit For Loop If '${结算重量index}'=='${settleWeight1}'
END
${unitSurcharge1} Evaluate ${unitSurcharge}+0.001
FOR ${代卖费index} IN RANGE ${unitSurcharge} 100
Exit For Loop If '${代卖费index}'=='${unitSurcharge1}'
END
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 ${netWeight1}
Set Global Variable ${settleWeight1}
Set Global Variable ${磅单id}
Set Global Variable ${status}
Set Global Variable ${unitSurcharge1}
weightnote
#驳回后重新提交磅单
Create Session ZTBT ${URL} ${header}
${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}" \ \ \ \ }
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
获取送货单详情
#获取订单详情信息
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
${paperMillId} Get From Dictionary ${reps.json()["data"]} paperMillId #纸厂id
${paperCategoryPrice} Get From Dictionary ${reps.json()["data"]} paperCategoryPrice #品类价格
${publicSubsidies} Get From Dictionary ${reps.json()["data"]["orderItems"][0]} publicSubsidies #公开补贴
${activitySettleType} Get From Dictionary ${reps.json()["data"]} activitySettleType #活动订单结算方式
${proxySellerSettleType} Get From Dictionary ${reps.json()["data"]} proxySellerSettleType #代卖费结算方式
${交易主体id} Get From Dictionary ${reps.json()["data"]} transactionMainEnterpriseId #交易主体id
${交易主体name} Get From Dictionary ${reps.json()["data"]} transactionMainEnterpriseName #交易主体name
${unitSurcharge} Get From Dictionary ${reps.json()["data"]} unitSurcharge #代卖费单价
${publicSubsidies} Set Variable If '${publicSubsidies}'=='${null}' 0 ${publicSubsidies}
${settleUtiPrice}= Evaluate ${unitPrice}+${publicSubsidies} #结算单价
${contractId} Get From Dictionary ${reps.json()["data"]["orderItems"][0]} contractId #合同id
${磅单id} Get From Dictionary ${reps.json()["data"]["orderItems"][0]["weightnoteInfo"]} id #获取磅单id
${status} Get From Dictionary ${reps.json()["data"]} status
${unitSurcharge3} Evaluate ${unitSurcharge}+0.001
FOR ${代卖费index} IN RANGE ${unitSurcharge} 100
Exit For Loop If '${代卖费index}'=='${unitSurcharge3}'
END
${netWeight} Get From Dictionary ${reps.json()["data"]["orderItems"][0]["weightnoteInfo"]} netWeight #获取净重
${netWeight3} Evaluate ${netWeight}+100
FOR ${净重index} IN RANGE ${netWeight} 30
Exit For Loop If '${净重index}'=='${netWeight3}'
END
Set Global Variable ${contractId}
Set Global Variable ${paperMillId}
Set Global Variable ${paperCategoryPrice}
Set Global Variable ${publicSubsidies}
Set Global Variable ${activitySettleType}
Set Global Variable ${proxySellerSettleType}
Set Global Variable ${settleUtiPrice}
Set Global Variable ${交易主体id}
Set Global Variable ${交易主体name}
Set Global Variable ${unitSurcharge3}
Set Global Variable ${netWeight3}
Set Global Variable ${磅单id}
Set Global Variable ${status}
上传送货单
#上传送货单
Create Session ZTBT ${URL} ${header}
${datatime} Get Current Date result_format=%Y-%m-%d
${data} Set Variable { \ \ \ \ "settleUtiPrice":"${settleUtiPrice}", \ \ \ \ "publicSubsidies":0, \ \ \ \ "netWeight":"${netWeight3}", \ \ \ \ "settleWeight":null, \ \ \ \ "unitSurcharge":${unitSurcharge3}, \ \ \ \ "transactionMainEnterpriseId":"${交易主体id}", \ \ \ \ \ "transactionMainEnterpriseName":"${交易主体name}", \ \ \ \ "activitySettleType":"${activitySettleType}", \ \ \ \ "proxySellerSettleType":"${proxySellerSettleType}", \ \ \ \ "remark":null, \ \ \ \ "imageUrl":[ \ \ \ \ \ \ \ \ "${pictures}" \ \ \ \ ], \ \ \ \ "orderItemId":"${orderItemId}", \ \ \ \ "orderId":"${orderId}", \ \ \ \ "settleDay":"${datatime}", \ \ \ \ "settlePrice":0, \ \ \ \ "contractId":"${contractId}", \ \ \ \ "millSupplierId":"${supplier_id}", \ \ \ \ "millSupplierName":"${millSupplierName}", \ \ \ \ "invoicePoint":"${taxRefundRate}", \ \ \ \ "orderType":"${orderType}", \ \ \ \ "weightDay":"${datatime}", \ \ \ \ "isInvoice":"${hasInvoice}", \ \ \ \ "warehouseName":"${所属仓库}", \ \ \ \ "deductionNotes":"${datatime}", \ \ \ \ "receivableSettlementRules":"${receivableSettlementRules}", \ \ \ \ "plateNumber":"${plateNumber}", \ \ \ \ "otherAmountList":[ \ \ \ \ \ ], \ \ \ \ "unitPrice":"${paperCategoryPrice}", \ \ \ \ "id":"${磅单id}" \ \ \ \ \ }
log ${data}
${reps} Post On Session ZTBT recycle-service/admin/proxy-sell/update/weightnote ${data.encode('utf-8')}
log ${reps.json()}
${weightNoteId} Get From Dictionary ${reps.json()["data"]} weightNoteId #磅单编号
Set Global Variable ${weightNoteId}
Should Be Equal As Strings ${reps.json()["message"]} successful
Set Global Variable ${datatime}
获取上传送货单后的订单详情
Create Session ZTBT ${URL} ${header}
${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
Set Global Variable ${netWeight}
audit_weightnote
Create Session ZTBT ${URL} ${header}
${repsonse} Post On Session ZTBT recycle-service/admin/customer-service/audit/weightnote/${weightNoteId}
log ${repsonse.json()}

61
2-Background_system(Test)/2.1-Consignment management/运营审核驳回.txt

@ -0,0 +1,61 @@
*** Settings ***
Library RequestsLibrary
Library DateTime
Library Collections
*** Variables ***
${URL} http://api-ops-ztb-test.qniao.cn
${header} {'X-APP-ID':'470236309865238555','Authorization':'${gettoken}','Content-Type':'application/json'}
*** Keywords ***
get_operation_list
#获取运营审核列表
Create Session ZTBT ${URL} ${header}
${reps} Get On Session ZTBT recycle-service/admin/operation/get/paper-mill-order-receipt-audit params=pageNum=1&pageSize=10&status=0&orderItemId=&orderId=${orderId}
${audit_status} Get From Dictionary ${reps.json()["data"]["records"][0]} status
${auditRequestId} Get From Dictionary ${reps.json()["data"]["records"][0]} auditRequestId
Set Global Variable ${audit_status}
Set Global Variable ${auditRequestId}
get_order-receipt-audit-details
#查看运营审核详情
Create Session ZTBT ${URL} ${header}
${reps} Post On Session ZTBT recycle-service/admin/operation/get/order-receipt-audit-details/${auditRequestId}/${weightNoteId}
log ${reps.json()}
${auditRequestItemId} Get From Dictionary ${reps.json()["data"]["items"][0]} auditRequestItemId #审核项id
${categoryName} Get From Dictionary ${reps.json()["data"]["items"][0]} categoryName #纸品品类名称
${paperCategoryId} Get From Dictionary ${reps.json()["data"]} paperCategoryId #纸厂品类id
${netWeight} Get From Dictionary ${reps.json()["data"]["items"][0]} netWeight #净重
${paperMillPayAt} Get From Dictionary ${reps.json()["data"]["items"][0]} paperMillPayAt #计划回款日期
${plateNumber} Get From Dictionary ${reps.json()["data"]["items"][0]} plateNumber #车牌号
${settleWeight} Get From Dictionary ${reps.json()["data"]["items"][0]} settleWeight #结算重量
${settleWeight} Set Variable If '${settleWeight}'=='None' 0 ${settleWeight}
${surcharge1} Evaluate ${unitSurcharge}*${netWeight}
${surcharge2} Evaluate ${unitSurcharge}*${settleWeight}
${surcharge} Set Variable If '${proxySellerSettleType}'=='0' ${surcharge1} ${surcharge2} #代卖费总额
${paperMillPayAt} Set Variable If '${paperMillPayAt}'=='无账期' null ${paperMillPayAt} #纸厂账期
${auditRequestId} Get From Dictionary ${reps.json()["data"]} auditRequestId
Set Global Variable ${auditRequestItemId}
Set Global Variable ${categoryName}
Set Global Variable ${netWeight}
Set Global Variable ${paperMillPayAt}
Set Global Variable ${plateNumber}
Set Global Variable ${settleWeight}
Set Global Variable ${paperCategoryId}
Set Global Variable ${surcharge}
Set Global Variable ${auditRequestId}
保存磅单信息
#b保存磅单信息
Create Session ZTBT ${URL} ${header}
${datatime} Get Current Date result_format=%Y-%m-%d #获取当前时间
${data} Set Variable { \ \ \ \ "auditRequestItemId":"${auditRequestItemId}", \ \ \ \ "categoryName":"${categoryName}", \ \ \ \ "netWeight":"${netWeight}", \ \ \ \ "paperCategoryId":"${paperCategoryId}", \ \ \ \ "paperMillPayAt":"${paperMillPayAt}", \ \ \ \ "plateNumber":"${plateNumber}", \ \ \ \ "settlementDate":"${datatime}", \ \ \ \ "weighingDate":"${datatime}", \ \ \ \ "settleWeight":"${settleWeight}", \ \ \ \ "isInvoice":"${hasInvoice}", \ \ \ \ "fundSourceId":"${id}", \ \ \ \ "transactionMainEnterpriseName":"${交易主体name}", \ \ \ \ "invoicePoint":"${taxRefundRate}", \ \ \ \ "publicSubsidies":"${publicSubsidies}", \ \ \ \ "publicSubsidiesIncludeTax":0, \ \ \ \ "settleUnitPrice":"${settleUtiPrice}", \ \ \ \ "fundSourceName":"${name}" }
${reps} Post On Session ZTBT recycle-service/admin/operation/edit/order-receipt-audit-details ${data.encode('utf-8')}
Should Be Equal As Strings ${reps.json()["message"]} successful
运营审核驳回
#运营审核驳回
Create Session ZTBT ${URL} ${header}
${datatime} Get Current Date result_format=%Y-%m-%d
${data} Set Variable { \ \ \ \ "auditRequestId":"${auditRequestId}", \ \ \ \ "isPass":2, \ \ \ \ "remark":"${datatime}" }
${reps} Post On Session ZTBT recycle-service/admin/operation/operation/audit ${data.encode('utf-8')}

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

@ -2,6 +2,9 @@
Documentation 代卖应付 Documentation 代卖应付
Library RequestsLibrary Library RequestsLibrary
Library Collections Library Collections
Resource 财务审核驳回.txt
Resource 运营审核通过.txt
Resource 台账查询.txt
*** Variables *** *** Variables ***
${header} {'X-APP-ID':'470236309865238555','Authorization':'${gettoken}','Content-Type':'application/json'} ${header} {'X-APP-ID':'470236309865238555','Authorization':'${gettoken}','Content-Type':'application/json'}
@ -14,15 +17,27 @@ get_list
Create Session ZTBT ${url} ${header} Create Session ZTBT ${url} ${header}
${reps} Get On Session ZTBT payment-settlement-center/admin/paper-mill-order-receipt-proof-request/get/list params=pageNum=1&pageSize=10&status=&orderId=&orderItemId=${orderItemId} ${reps} Get On Session ZTBT payment-settlement-center/admin/paper-mill-order-receipt-proof-request/get/list params=pageNum=1&pageSize=10&status=&orderId=&orderItemId=${orderItemId}
${auditedTime} Get From Dictionary ${reps.json()["data"]["records"][0]} auditedTime #财务第一次确认结算时间 ${auditedTime} Get From Dictionary ${reps.json()["data"]["records"][0]} auditedTime #财务第一次确认结算时间
log ${auditedTime.year}
Should Be Equal As Strings ${reps.json()["message"]} successful Should Be Equal As Strings ${reps.json()["message"]} successful
Set Global Variable ${auditedTime}
#Set Global Variable ${auditedTime}
get_order-log-detail get_order-log-detail
#财务审核驳回操作记录 #财务审核驳回操作记录
Create Session ZTBT ${URL1} ${header} Create Session ZTBT ${URL1} ${header}
${reps} Get On Session ZTBT recycle-service/admin/operation/get/order-log-detail params=orderId=${orderId}&weightNoteId=${weightNoteId}&operationStatus=3 ${reps} Get On Session ZTBT recycle-service/admin/operation/get/order-log-detail params=orderId=${orderId}&weightNoteId=${weightNoteId}&operationStatus=3
重复执行财务审核驳回何运营审核通过
#重复执行财务审核驳回何运营审核通过操作
FOR ${index} IN RANGE 5
Run Keyword 获取财务审核列表
Run Keyword If '${staus}'=='0' 财务驳回
Run Keyword get_operation_list
Run Keyword get_order-receipt-audit-details
Run Keyword order-receipt-audit-details
Run Keyword If '${audit_status}'=='0' 运营审核通过
Run Keyword 运营审核后详情
Run Keyword 台账查询
END
paper-mill-order-receipt-proof-request_audit paper-mill-order-receipt-proof-request_audit
#财务审核确认通过 #财务审核确认通过
Create Session ZTBT ${url} ${header} Create Session ZTBT ${url} ${header}
@ -36,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 1
sleep 3

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

@ -31,3 +31,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

6
2-Background_system(Test)/3-Withdrawal_application/Withdrawal application/1-Automatic_receipt.robot

@ -16,13 +16,13 @@ get_withdraw-list
#${value} Evaluate random.choice(${records} ) random #${value} Evaluate random.choice(${records} ) random
#log to console \nvalue: ${value} #log to console \nvalue: ${value}
#${id} Get From Dictionary ${value} id #提现id #${id} Get From Dictionary ${value} id #提现id
${id} Get From Dictionary ${reps.json()["data"]["records"][0]} id #提现id
Set Global Variable ${id}
${提现id} Get From Dictionary ${reps.json()["data"]["records"][0]} id #提现id
Set Global Variable ${提现id}
withdraw_{id} withdraw_{id}
#提现审核 #提现审核
Create Session ZTBT ${URL} ${header} Create Session ZTBT ${URL} ${header}
${data} Set Variable { \ \ "billType": 0, \ \ "remark": "string", \ \ "status": 1 } ${data} Set Variable { \ \ "billType": 0, \ \ "remark": "string", \ \ "status": 1 }
${reps} Post On Session ZTBT payment-settlement-center/admin/settlement/verify/withdraw/${id} ${data}
${reps} Post On Session ZTBT payment-settlement-center/admin/settlement/verify/withdraw/${提现id} ${data}
log ${reps.json()} log ${reps.json()}
Should Be Equal As Strings ${reps.json()["message"]} successful Should Be Equal As Strings ${reps.json()["message"]} successful

20
2-Background_system(Test)/3-Withdrawal_application/台账查询.txt

@ -0,0 +1,20 @@
*** Settings ***
Library Collections
Library RequestsLibrary
*** Variables ***
${URL1} http://api-ops-ztb-test.qniao.cn
${header} {'X-APP-ID':'470236309865238555','Authorization':'${gettoken}','Content-Type':'application/json'}
*** Keywords ***
台账查询
#获取台账列表
Create Session ZTBT ${URL1} ${header}
${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 #获取台账列表数据
#Set Global Variable ${台账列表数据}
#${receivableAdjustMoney1} Get From Dictionary ${reps.json()["data"]["records"][0]} receivableAdjustMoney #获取应收调节费
#${receivableAdjustMoney1} Set Variable If '${receivableAdjustMoney}'=='None' Should Not Be Equal As Numbers ${receivableAdjustMoney} ${receivableAdjustMoney1}
#Should Be Equal As Numbers ${receivableAdjustMoney} ${reps.json()["data"]["records"][0]["receivableAdjustMoney"]} #对比应收调节费
Should Be Equal As Numbers ${noReceivablePrice} ${reps.json()["data"]["records"][0]["noReceivablePrice"]} #对比未收款金额
Should Be Equal As Strings ${paperMillPayAt} ${reps.json()["data"]["records"][0]["paperMillPayAt"]} #对比预计回款日期

30
2-Background_system(Test)/3-Withdrawal_application/财务审核驳回.txt

@ -0,0 +1,30 @@
*** Settings ***
Library Collections
Library DateTime
Library RequestsLibrary
*** Variables ***
${URL1} http://api-ops-ztb-test.qniao.cn
${url} http://api-ops-psc-test.qniao.cn
${header} {'X-APP-ID':'470236309865238555','Authorization':'${gettoken}','Content-Type':'application/json'}
*** Keywords ***
获取财务审核列表
#获取财务审核列表
Create Session ZTBT ${url} ${header}
${reps} Get On Session ZTBT payment-settlement-center/admin/paper-mill-order-receipt-proof-request/get/list params=pageNum=1&pageSize=10&status=&orderId=&orderItemId=${orderItemId}
#${auditedTime} Get From Dictionary ${reps.json()["data"]["records"][0]} auditedTime #财务第一次确认结算时间
${staus} Get From Dictionary ${reps.json()["data"]["records"][0]} status #获取审核状态
${auditRequestId} Get From Dictionary ${reps.json()["data"]["records"][0]} auditRequestId
Should Be Equal As Strings ${reps.json()["message"]} successful
#Set Global Variable ${auditedTime}
Set Global Variable ${staus}
Set Global Variable ${auditRequestId}
财务驳回
#财务审核驳回
Create Session ZTBT ${url} ${header}
${data} Set Variable {"auditRequestId":"${auditRequestId}","adminId":null,"isPass":2,"remark":"${datatime}" }
${reps} Post On Session ZTBT payment-settlement-center/admin/paper-mill-order-receipt-proof-request/audit ${data.encode('utf-8')}
log ${reps.json()}
sleep 1

72
2-Background_system(Test)/3-Withdrawal_application/运营审核通过.txt

@ -0,0 +1,72 @@
*** Settings ***
Library RequestsLibrary
Library DateTime
Library Collections
*** Variables ***
${URL1} http://api-ops-ztb-test.qniao.cn
${header} {'X-APP-ID':'470236309865238555','Authorization':'${gettoken}','Content-Type':'application/json'}
*** Keywords ***
get_operation_list
#获取运营审核列表
Create Session ZTBT ${URL1} ${header}
${reps} Get On Session ZTBT recycle-service/admin/operation/get/paper-mill-order-receipt-audit params=pageNum=1&pageSize=10&status=0&orderItemId=&orderId=${orderId}
${audit_status} Get From Dictionary ${reps.json()["data"]["records"][0]} status
${auditRequestId} Get From Dictionary ${reps.json()["data"]["records"][0]} auditRequestId
Set Global Variable ${audit_status}
Set Global Variable ${auditRequestId}
get_order-receipt-audit-details
#查看运营审核详情
Create Session ZTBT ${URL1} ${header}
${reps} Post On Session ZTBT recycle-service/admin/operation/get/order-receipt-audit-details/${auditRequestId}/${weightNoteId}
log ${reps.json()}
${auditRequestItemId} Get From Dictionary ${reps.json()["data"]["items"][0]} auditRequestItemId #审核项id
${categoryName} Get From Dictionary ${reps.json()["data"]["items"][0]} categoryName #纸品品类名称
${paperCategoryId} Get From Dictionary ${reps.json()["data"]["items"][0]} paperCategoryId #纸厂品类id
${netWeight} Get From Dictionary ${reps.json()["data"]["items"][0]} netWeight #净重
${paperMillPayAt} Get From Dictionary ${reps.json()["data"]["items"][0]} paperMillPayAt #计划回款日期
${plateNumber} Get From Dictionary ${reps.json()["data"]["items"][0]} plateNumber #车牌号
${settleWeight} Get From Dictionary ${reps.json()["data"]["items"][0]} settleWeight #结算重量
${settleWeight} Set Variable If '${settleWeight}'=='None' 0 ${settleWeight}
${surcharge1} Evaluate ${unitSurcharge}*${netWeight}
${surcharge2} Evaluate ${unitSurcharge}*${settleWeight}
${surcharge} Set Variable If '${proxySellerSettleType}'=='0' ${surcharge1} ${surcharge2} #代卖费总额
${paperMillPayAt} Set Variable If '${paperMillPayAt}'=='无账期' null ${paperMillPayAt} #纸厂账期
${auditRequestId} Get From Dictionary ${reps.json()["data"]} auditRequestId
Set Global Variable ${auditRequestItemId}
Set Global Variable ${categoryName}
Set Global Variable ${netWeight}
Set Global Variable ${paperMillPayAt}
Set Global Variable ${plateNumber}
Set Global Variable ${settleWeight}
Set Global Variable ${paperCategoryId}
Set Global Variable ${surcharge}
Set Global Variable ${auditRequestId}
order-receipt-audit-details
#b保存磅单信息
Create Session ZTBT ${URL1} ${header}
${data} Set Variable { \ \ \ \ "auditRequestItemId":"${auditRequestItemId}", \ \ \ \ "categoryName":"${categoryName}", \ \ \ \ "netWeight":"${netWeight}", \ \ \ \ "paperCategoryId":"${paperCategoryId}", \ \ \ \ "paperMillPayAt":"${paperMillPayAt}", \ \ \ \ "plateNumber":"${plateNumber}", \ \ \ \ "settlementDate":"${datatime}", \ \ \ \ "weighingDate":"${datatime}", \ \ \ \ "settleWeight":"${settleWeight}", \ \ \ \ "isInvoice":"${hasInvoice}", \ \ \ \ "fundSourceId":"${id}", \ \ \ \ "transactionMainEnterpriseName":"${交易主体name}", \ \ \ \ "invoicePoint":"${taxRefundRate}", \ \ \ \ "publicSubsidies":"${publicSubsidies}", \ \ \ \ "publicSubsidiesIncludeTax":0, \ \ \ \ "settleUnitPrice":"${settleUtiPrice}", \ \ \ \ "fundSourceName":"${name}" }
${reps} Post On Session ZTBT recycle-service/admin/operation/edit/order-receipt-audit-details ${data.encode('utf-8')}
Should Be Equal As Strings ${reps.json()["message"]} successful
运营审核通过
#运营审核通过
Create Session ZTBT ${URL1} ${header}
${datatime} Get Current Date result_format=%Y-%m-%d
${data} Set Variable { \ \ \ \ "auditRequestId":"${auditRequestId}", \ \ \ \ "isPass":1, \ \ \ \ "remark":"${datatime}" }
${reps} Post On Session ZTBT recycle-service/admin/operation/operation/audit ${data.encode('utf-8')}
运营审核后详情
#查看运营审核详情
Create Session ZTBT ${URL1} ${header}
${reps} Post On Session ZTBT recycle-service/admin/operation/get/order-receipt-audit-details/${auditRequestId}/${weightNoteId}
${noReceivablePrice} Get From Dictionary ${reps.json()["data"]["items"][0]} noReceivablePrice #获取未收款金额
${paperMillPayAt} Get From Dictionary ${reps.json()["data"]["items"][0]} paperMillPayAt #获取计划回款日期
${receivableAdjustMoney} Get From Dictionary ${reps.json()["data"]["items"][0]} receivableAdjustMoney #获取应收调节费
#${noReceivablePrice} Evaluate ${noReceivablePrice}+1
Set Global Variable ${noReceivablePrice}
Set Global Variable ${paperMillPayAt}
Set Global Variable ${receivableAdjustMoney}

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":12500, \ \ \ \ "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":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}" }
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"]}

16
2-Background_system(Test)/4-Consignment_management/3.3--Operation_audit.robot

@ -2,6 +2,9 @@
Library RequestsLibrary Library RequestsLibrary
Library Collections Library Collections
Library DateTime Library DateTime
Resource 更新磅单.txt
Resource 运营审核驳回.txt
Resource 台账查询.txt
*** Variables *** *** Variables ***
${header} {'X-APP-ID':'470236309865238555','Authorization':'${gettoken}','Content-Type':'application/json'} ${header} {'X-APP-ID':'470236309865238555','Authorization':'${gettoken}','Content-Type':'application/json'}
@ -69,6 +72,19 @@ get_order-log-detail2
log ${reps.json()} log ${reps.json()}
Should Be Equal As Strings ${reps.json()["message"]} successful Should Be Equal As Strings ${reps.json()["message"]} successful
重复运营审核驳回更新磅单
#重复执行上传磅单、运营驳回操作
FOR ${items} IN RANGE 30
Run Keyword get_operation_list
Run Keyword get_order-receipt-audit-details
Run Keyword If '${audit_status}'=='0' Run Keyword 运营审核驳回
sleep 1
Run Keyword 获取磅单详情
Run Keyword If '${status}'=='51' weightnote
Run Keyword audit_weightnote
Run Keyword 台账查询
END
operation_audit operation_audit
#运营审核确认通过 #运营审核确认通过
Create Session ZTBT ${URL} ${header} Create Session ZTBT ${URL} ${header}

1
2-Background_system(Test)/4-Consignment_management/4.3-Financial_audit.robot

@ -33,3 +33,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 2

11
2-Background_system(Test)/4-Consignment_management/台账查询.txt

@ -0,0 +1,11 @@
*** Settings ***
Library Collections
Library RequestsLibrary
*** Keywords ***
台账查询
#获取台账列表
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}
${台账列表数据} Get From List ${reps.json()["data"]["records"]} 0 #获取台账列表数据
#Set Global Variable ${台账列表数据}

84
2-Background_system(Test)/4-Consignment_management/更新磅单.txt

@ -0,0 +1,84 @@
*** Settings ***
Library RequestsLibrary
Library DateTime
Library Collections
*** Variables ***
${URL} http://api-ops-ztb-test.qniao.cn
${header} {'X-APP-ID':'470236309865238555','Authorization':'${gettoken}','Content-Type':'application/json'}
*** Keywords ***
获取磅单详情
#查看订单详情
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} #结算单价
${unitSurcharge} Set Variable If '${unitSurcharge}'=='${None}' 0 ${unitSurcharge}
${id} Get From Dictionary ${reps.json()["data"]["orderItems"][0]["weightnoteInfo"]} id #获取磅单id
${status} Get From Dictionary ${reps.json()["data"]} status
${netWeight} Get From Dictionary ${reps.json()["data"]["orderItems"][0]["weightnoteInfo"]} netWeight #获取净重
${settleWeight} Get From Dictionary ${reps.json()["data"]["orderItems"][0]["weightnoteInfo"]} settleWeight #获取结算重量
${netWeight1} Evaluate ${netWeight}+100
FOR ${净重index} IN RANGE ${netWeight} 30
Exit For Loop If '${净重index}'=='${netWeight1}'
END
${settleWeight1} Evaluate ${settleWeight}+100
FOR ${结算重量index} IN RANGE ${settleWeight} 30
Exit For Loop If '${结算重量index}'=='${settleWeight1}'
END
${unitSurcharge1} Evaluate ${unitSurcharge}+0.01
FOR ${代卖费index} IN RANGE ${unitSurcharge} 100
Exit For Loop If '${代卖费index}'=='${unitSurcharge1}'
END
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}
Set Global Variable ${netWeight1}
Set Global Variable ${settleWeight1}
Set Global Variable ${id}
Set Global Variable ${status}
Set Global Variable ${unitSurcharge1}
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":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}" }
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()}

53
2-Background_system(Test)/4-Consignment_management/运营审核驳回.txt

@ -0,0 +1,53 @@
*** Settings ***
Library RequestsLibrary
Library DateTime
Library Collections
*** Variables ***
${URL} http://api-ops-ztb-test.qniao.cn
${header} {'X-APP-ID':'470236309865238555','Authorization':'${gettoken}','Content-Type':'application/json'}
*** Keywords ***
get_operation_list
#获取运营审核列表
Create Session ZTBT ${URL} ${header}
${reps} Get On Session ZTBT recycle-service/admin/operation/get/paper-mill-order-receipt-audit params=pageNum=1&pageSize=10&status=0&orderItemId=&orderId=${orderId}
${audit_status} Get From Dictionary ${reps.json()["data"]["records"][0]} status
${auditRequestId} Get From Dictionary ${reps.json()["data"]["records"][0]} auditRequestId
Set Global Variable ${audit_status}
Set Global Variable ${auditRequestId}
get_order-receipt-audit-details
#查看运营审核详情
Create Session ZTBT ${URL} ${header}
${reps} Post On Session ZTBT recycle-service/admin/operation/get/order-receipt-audit-details/${auditRequestId}/${weightNoteId}
log ${reps.json()}
${auditRequestItemId} Get From Dictionary ${reps.json()["data"]["items"][0]} auditRequestItemId #审核项id
${categoryName} Get From Dictionary ${reps.json()["data"]["items"][0]} categoryName #纸品品类名称
${paperCategoryId} Get From Dictionary ${reps.json()["data"]["items"][0]} paperCategoryId #纸厂品类id
${netWeight} Get From Dictionary ${reps.json()["data"]["items"][0]} netWeight #净重
${paperMillPayAt} Get From Dictionary ${reps.json()["data"]["items"][0]} paperMillPayAt #计划回款日期
${plateNumber} Get From Dictionary ${reps.json()["data"]["items"][0]} plateNumber #车牌号
${settleWeight} Get From Dictionary ${reps.json()["data"]["items"][0]} settleWeight #结算重量
${settleWeight} Set Variable If '${settleWeight}'=='None' 0 ${settleWeight}
${surcharge1} Evaluate ${unitSurcharge}*${netWeight}
${surcharge2} Evaluate ${unitSurcharge}*${settleWeight}
${surcharge} Set Variable If '${proxySellerSettleType}'=='0' ${surcharge1} ${surcharge2} #代卖费总额
${paperMillPayAt} Set Variable If '${paperMillPayAt}'=='无账期' null ${paperMillPayAt} #纸厂账期
${auditRequestId} Get From Dictionary ${reps.json()["data"]} auditRequestId
Set Global Variable ${auditRequestItemId}
Set Global Variable ${categoryName}
Set Global Variable ${netWeight}
Set Global Variable ${paperMillPayAt}
Set Global Variable ${plateNumber}
Set Global Variable ${settleWeight}
Set Global Variable ${paperCategoryId}
Set Global Variable ${surcharge}
Set Global Variable ${auditRequestId}
运营审核驳回
#运营审核驳回
Create Session ZTBT ${URL} ${header}
${datatime} Get Current Date result_format=%Y-%m-%d
${data} Set Variable { \ \ \ \ "auditRequestId":"${auditRequestId}", \ \ \ \ "isPass":2, \ \ \ \ "remark":"${datatime}" }
${reps} Post On Session ZTBT recycle-service/admin/operation/operation/audit ${data.encode('utf-8')}

2
2-Background_system(Test)/5-Data comparison/5-Consignment_order.robot

@ -3,7 +3,7 @@ Documentation 查看代卖订单(数据对比)
Library RequestsLibrary Library RequestsLibrary
Library Collections Library Collections
Library DateTime Library DateTime
Library RedisLibrary
Library redis
Library urllib3 Library urllib3
*** Variables *** *** Variables ***

65
2-Background_system(Test)/6-Parameter/1-Operation_audit.robot

@ -0,0 +1,65 @@
*** Settings ***
Library Collections
Library RequestsLibrary
*** Variables ***
${URL} http://api-ops-ztb-test.qniao.cn
${header} {'X-APP-ID':'470236309865238555','Authorization':'${gettoken}','Content-Type':'application/json'}
*** Test Cases ***
get_order-receipt-audit-details
#获取运营审核详情
Create Session ZTBT ${URL} ${header}
${reps} Post On Session ZTBT recycle-service/admin/operation/get/order-receipt-audit-details/${auditRequestId}/${weightNoteId}
${auditRequestItemId} Get From Dictionary ${reps.json()["data"]["items"][0]} auditRequestItemId #审核项id
${categoryName} Get From Dictionary ${reps.json()["data"]["items"][0]} categoryName #纸品品类名称
${paperCategoryId} Get From Dictionary ${reps.json()["data"]["items"][0]} paperCategoryId #纸厂品类id
${netWeight} Get From Dictionary ${reps.json()["data"]["items"][0]} netWeight #净重
${paperMillPayAt} Get From Dictionary ${reps.json()["data"]["items"][0]} paperMillPayAt #计划回款日期
${plateNumber} Get From Dictionary ${reps.json()["data"]["items"][0]} plateNumber #车牌号
${settleWeight} Get From Dictionary ${reps.json()["data"]["items"][0]} settleWeight #结算重量
${surcharge1} Evaluate ${unitSurcharge}*${netWeight}
${surcharge2} Evaluate ${unitSurcharge}*${settleWeight}
${surcharge} Set Variable If '${proxySellerSettleType}'=='0' ${surcharge1} ${surcharge2} #代卖费总额
${paperMillPayAt} Set Variable If '${paperMillPayAt}'=='无账期' null ${paperMillPayAt} #纸厂账期
${settleWeight} Set Variable If '${settleWeight}'=='None' 0 ${settleWeight}
${activitySettleType} Get From Dictionary ${reps.json()["data"]} activitySettleType #活动类型
${isSubsidyAndDeductIncludeTax} Get From Dictionary ${reps.json()["data"]["items"][0]} isSubsidyAndDeductIncludeTax #结算单价是否含税
${运费补贴} Get From Dictionary ${reps.json()["data"]["items"][0]["otherAmountList"][0]} amount #运费补贴总额
${其他补贴} Get From Dictionary ${reps.json()["data"]["items"][0]["otherAmountList"][1]} amount #其他补贴费用总额
${违禁物品扣款} Get From Dictionary ${reps.json()["data"]["items"][0]["otherAmountList"][2]} amount #违禁物品扣款总额
${装车不规范扣款} Get From Dictionary ${reps.json()["data"]["items"][0]["otherAmountList"][3]} amount #装车不规范扣款总额
${其他扣款} Get From Dictionary ${reps.json()["data"]["items"][0]["otherAmountList"][4]} amount #其他扣款总额
${返还补贴} Get From Dictionary ${reps.json()["data"]["items"][0]} refundSubsidy #返还补贴
${调节费} Get From Dictionary ${reps.json()["data"]["items"][0]} adjustmentFee #调节费
${垫资费} Get From Dictionary ${reps.json()["data"]["items"][0]} advanceFund #垫资费
${代收费} Get From Dictionary ${reps.json()["data"]["items"][0]} collectionCharges #代收费
Set Global Variable ${auditRequestItemId}
Set Global Variable ${categoryName}
Set Global Variable ${netWeight}
Set Global Variable ${paperMillPayAt}
Set Global Variable ${plateNumber}
Set Global Variable ${settleWeight}
Set Global Variable ${paperCategoryId}
Set Global Variable ${surcharge}
Set Global Variable ${activitySettleType}
Set Global Variable ${运费补贴}
Set Global Variable ${其他补贴}
Set Global Variable ${违禁物品扣款}
Set Global Variable ${装车不规范扣款}
Set Global Variable ${其他扣款}
Set Global Variable ${返还补贴}
Set Global Variable ${垫资费}
Set Global Variable ${调节费}
Set Global Variable ${代收费}
Set Global Variable ${isSubsidyAndDeductIncludeTax}
get_parameter
#获取台账列表
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}
${台账列表数据} Get From List ${reps.json()["data"]["records"]} 0 #获取台账列表数据
${settlementType} Get From Dictionary ${台账列表数据} settlementType #获取结算类型
${firstPayPercent} Get From Dictionary ${台账列表数据} firstPayPercent #获取付款比例
Set Global Variable ${settlementType}
Set Global Variable ${firstPayPercent}

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

@ -0,0 +1,18 @@
*** Settings ***
Suite Setup 计算公式
Library RequestsLibrary
Library Collections
Resource Sys_keyword.txt
*** Variables ***
${header} {'X-APP-ID':'470236309865238555','Authorization':'${gettoken}','Content-Type':'application/json'}
${URL} http://api-ops-ztb-test.qniao.cn
*** Test Cases ***
get_parameter
#获取台账列表
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}
${台账列表数据} Get From List ${reps.json()["data"]["records"]} 0 #获取台账列表数据
Set Global Variable ${台账列表数据}
Should Be Equal As Numbers ${扣点(%)}= ${reps.json()["data"]["record"][0]["deductedPoint"]}

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

@ -0,0 +1,26 @@
*** Keywords ***
计算公式
#公式计算
${品类单价} Set Variable ${unitPrice}
${公开补贴} Set Variable ${publicSubsidies}
${净重} Set Variable ${netWeight}
${结算单价} Evaluate ${unitPrice}+${publicSubsidies}
${扣点(%)}= Evaluate (${netWeight}-${settleWeight})/${netWeight}
${纸厂补贴和扣款} Evaluate ${运费补贴}+${其他补贴}+${违禁物品扣款}+${装车不规范扣款}+${其他扣款}
${扣点前代卖费} Evaluate ${unitSurcharge}*${netWeight}
${扣点后代卖费} Evaluate ${unitSurcharge}*${settleWeight}
${代卖费总额} Set Variable If '${proxySellerSettleType} '=='0' ${扣点前代卖费} ${扣点后代卖费} #0:扣点前,1:扣点后
${一次应付} 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}+${纸厂补贴和扣款}
#${第二笔金额} Evaluate
#${总金额} Evaluate ${第一笔金额}+${第二笔金额}
#${金额} Set Variable If '${settlementType}'==0 ${第一笔金额} ${总金额}
${垫资费总额} Evaluate ${垫资费}*${settleWeight}
${代收费总额} Evaluate ${代收费}*${settleWeight}
${返还补贴总额} Evaluate ${返还补贴}*${settleWeight}
${采购单价} Evaluate ${应付金额(元)}/${settleWeight}
Set Global Variable ${扣点(%)}=

0
2-Background_system(Test)/6-Parameter/__init__.robot

45
3-pabotdemo/1-get_list.robot

@ -0,0 +1,45 @@
*** Settings ***
Library RequestsLibrary
Library Collections
Library DateTime
Library redis
Library urllib3
Library pabot.pabotlib
Resource login.txt
*** Variables ***
*** Test Cases ***
a
userlogin {"accountType":2,"password":null,"account":"15014242835","captcha":"888888"}
userlogin {"accountType":2,"password":null,"account":"13333333333","captcha":"888888"}
login-token ${token}
get-factorylist
#获取代卖列表
${header} Create Dictionary content-type=application/json X-APP-ID=470236309865238528 Authorization=${token}
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}

36
3-pabotdemo/login.txt

@ -0,0 +1,36 @@
*** Settings ***
Library RequestsLibrary
Library Collections
Library urllib3
Library DatabaseLibrary
*** Variables ***
${url} http://api-client-ztb-test.qniao.cn
*** Keywords ***
userlogin
[Arguments] ${data}
#验证码登录
Disable Warnings
${header} Create Dictionary content-type=application/json X-APP-ID=470236309865238528
Create Session ZTBT https://api-client-uec-test.qniao.cn ${header}
${data} Create Dictionary account=15014242835 captcha=888888 accountType=2
#${data} Set Variable {"accountType":2,"password":null,"account":"15014242835","captcha":"${text_code}"}
${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]
login-token
[Arguments] ${token}
${header} Create Dictionary content-type=application/json X-APP-ID=470236309865238528
Create Session ZTBT ${url} ${header}
${token1} Create Dictionary loginToken=${token}
${reps} Post On Session ZTBT recycle-user-center/authorize/get/product-line-token/by/login-token json=${token1}
${gettoken} Get From Dictionary ${reps.json()["data"]} token #获取token
${userId} Get From Dictionary ${reps.json()["data"]} userId #获取用户id
log ${reps.json()["data"]["token"]}
Set Global Variable ${gettoken}
Set Global Variable ${userId}

12
4-Data-comparison/1-Formula-calculation.robot

@ -0,0 +1,12 @@
*** Settings ***
Library RequestsLibrary
Library Collections
*** Test Cases ***
Formula_calculation
#公式计算
${结算单价}= Evaluate ${unitPrice}+${publicSubsidies}
${扣点(%)}= Evaluate (${netWeight}-${settleWeight})/${netWeight}
${代卖费(元)}= Set Variable If '${proxySellerSettleType}'=='1' ${unitSurcharge}*${netWeight} ${unitSurcharge}*${settleWeight}
${第一笔应付金额(元)}= Set Variable If '${activitySettleType}'=='null'
'${activitySettleType}'=='2'

12
DemoApp/APP_login.robot

@ -0,0 +1,12 @@
*** Settings ***
Suite Setup OpenApp
Library AppiumLibrary
Resource Keyword.txt
Library urllib3
*** Test Cases ***
login
Wait Until Element Is Visible com.qniao.cloudprint:id/tabs 10 #进入首页等待10S
Click Element name=我的 #点击-我的
Click Element name=点击登录 #点击-点击登录
Click Button //button[@class='wux-button wux-button--positive wux-button--default wux-button--block wux-button--bordered'] #点击-同意

6
DemoApp/Keyword.txt

@ -0,0 +1,6 @@
*** Settings ***
Library AppiumLibrary
*** Keywords ***
OpenApp
Open Application http://localhost:4723/wd/hub/session platformName=Android platformVersion=5.1.1 deviceName=127.0.0.1:5555 app=E:/lyl/Order/Order/DemoApp/app-release.apk appPackage=com.qniao.cloudprint appActivity=com.qniao.cloudprint.MainActivity unicodeKeyboard=True resetKeyboard=True

0
DemoApp/__init__.robot

BIN
DemoApp/app-release.apk

0
Resource/__init__.robot

35
Resource/关键字.txt

@ -0,0 +1,35 @@
*** Settings ***
Library urllib3
Library Collections
Library RequestsLibrary
*** Variables ***
${header} {'content-type':'application/json','X-APP-ID':'470236309865238528'}
${url} http://api-client-ztb-test.qniao.cn
*** Keywords ***
userlogin
#验证码登录
Disable Warnings
Create Session ZTBT https://api-client-uec-test.qniao.cn ${header}
${data} Create Dictionary account=15014242835 captcha=888888 accountType=2
#${data} Set Variable {"accountType":2,"password":null,"account":"13168550964","captcha":"${text_code}"}
${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]
[Return] ${token}
login-token
#${header} Create Dictionary content-type=application/json X-APP-ID=470236309865238528
Create Session ZTBT ${url} ${header}
${token1} Create Dictionary loginToken=${token}
${reps} Post On Session ZTBT recycle-user-center/authorize/get/product-line-token/by/login-token json=${token1}
${gettoken} Get From Dictionary ${reps.json()["data"]} token #获取token
${userId} Get From Dictionary ${reps.json()["data"]} userId #获取用户id
log ${reps.json()["data"]["token"]}
Set Global Variable ${gettoken}
Set Global Variable ${userId}
[Return] ${gettoken}

25
Resource/关键字使用.robot

@ -0,0 +1,25 @@
*** Settings ***
Suite Setup Run Keywords userlogin
... AND 关键字.Login-token
Resource 关键字.txt
Library urllib3
Library Collections
Library RequestsLibrary
*** Variables ***
${url} https://api-client-ztb-test.qniao.cn
*** Test Cases ***
get_paper-mill-city
#获取纸厂所在城市
userlogin
${header} Create Dictionary content-type=application/json X-APP-ID=470236309865238528 Authorization=QNT ${gettoken}
Create Session ZTBT ${url} ${header}
${reps} Get On Session ZTBT recycle-service/get/paper-mill-city
${data} Get From Dictionary ${reps.json()} data #城市列表
FOR ${items} IN @{data}
${cityName} Get From Dictionary ${items} cityName #城市name
${cityId} Get From Dictionary ${items} cityId #城市id
Exit For Loop If '${cityName}'=='荆州市'
END
Set Global Variable ${cityId}

5
UI-APP.robot

@ -0,0 +1,5 @@
*** Settings ***
Library AppiumLibrary
*** Test Cases ***
login

10
UI-Browser.robot

@ -0,0 +1,10 @@
*** Settings ***
Library SeleniumLibrary
*** Test Cases ***
1-Open_browser
Open Browser http://backstage.test.qniao.cn/ chrome #在浏览器中打开网页
SeleniumLibrary.Input Text //input[@placeholder="手机号/邮箱"] laiyonglan@qniao.cn #登录交易版系统
sleep 1
SeleniumLibrary.Input Text //input[@placeholder="密码"] qn123456
Click Button //button[@class='ant-btn ant-btn-primary ant-btn-block']

320
log.html
File diff suppressed because it is too large
View File

881
output.xml
File diff suppressed because it is too large
View File

657
pabot_results/0/output.xml
File diff suppressed because it is too large
View File

2
pabot_results/0/robot_stderr.out

@ -0,0 +1,2 @@
[ ERROR ] RuntimeError catched in remotelib keyword execution. Maybe there is no connection - is pabot called with --pabotlib option? ErrorDetails: RuntimeError('Connection to remote server broken: [WinError 10061] 由于目标计算机积极拒绝,无法连接。',)
pabot.PabotLib#_close: threw an exception: is --pabotlib flag used? ErrorDetails: RuntimeError('Connection to remote server broken: [WinError 10061] 由于目标计算机积极拒绝,无法连接。',)

18
pabot_results/0/robot_stdout.out

@ -0,0 +1,18 @@
==============================================================================
3-Pabotdemo
==============================================================================
3-Pabotdemo.1-Get List
==============================================================================
a | PASS |
------------------------------------------------------------------------------
get-factorylist
value: {'categoryId': '630378353517531136', 'categoryName': 'ºÚ¿¨', 'yesterdayUnitPrice': None, 'unitPrice': 1.23, 'floatingPrice': 0.01, 'publicSubsidies': None}
| PASS |
------------------------------------------------------------------------------
3-Pabotdemo.1-Get List | PASS |
2 tests, 2 passed, 0 failed
==============================================================================
3-Pabotdemo | PASS |
2 tests, 2 passed, 0 failed
==============================================================================
Output: E:\lyl\Order\Order\pabot_results\0\output.xml

52
pabotdemo/添加银行卡.robot

@ -0,0 +1,52 @@
*** Settings ***
Documentation 添加银行卡
Library RequestsLibrary
Library Collections
Resource 登录关键字.txt
Library pabot.pabotlib
*** Variables ***
*** Test Cases ***
a
userlogin {"accountType":2,"password":null,"account":"15014242835","captcha":"888888"}
login-token ${token}
getuserinfo
getBankCardList
#获取银行卡列表
${headers} Create Dictionary content-type=application/json X-APP-ID=470236309865238528 Authorization=${token}
Create Session ZTBT http://api-client-psc-test.qniao.cn ${headers}
${reps} Get On Session ZTBT payment-settlement-center/bankcard/getBankCardList
log ${reps.json()}
bankcard_home
#获取银行卡信息
${headers} Create Dictionary content-type=application/json X-APP-ID=470236309865238528 Authorization=${token}
Create Session ZTBT http://api-client-psc-test.qniao.cn ${headers}
${reps} Get On Session ZTBT payment-settlement-center/bankcard/bankcard/home/6212263602133910992
log ${reps.json()}
${cardNo} Get From Dictionary ${reps.json()["data"]} cardNo #获取银行卡号
${bankName} Get From Dictionary ${reps.json()["data"]} bankName #获取银行名称
${bank} Get From Dictionary ${reps.json()["data"]} bank #银行名称
${cardType} Get From Dictionary ${reps.json()["data"]} cardType #银行卡类型
Set Global Variable ${cardNo}
Set Global Variable ${bankName}
Set Global Variable ${bank}
Set Global Variable ${cardType}
bankverify
#添加银行卡
${headers} Create Dictionary content-type=application/json X-APP-ID=470236309865238528 Authorization=${token}
Create Session ZTBT http://api-client-psc-test.qniao.cn ${headers}
${data} Set Variable {"phone":null,"cardName":null,"cardNo":"${cardNo}","openingBank":null,"cardType":null,"idno":null,"name":"${realName}","verificationCode":null,"isExist":0,"type":2}
${repsponse} Post On Session ZTBT payment-settlement-center/bankcard/post/verify/bankverify ${data.encode('utf-8')}
log ${repsponse.json()}
post_bankverify
#提交银行卡验证
${headers} Create Dictionary content-type=application/json X-APP-ID=470236309865238528 Authorization=${token}
Create Session ZTBT http://api-client-psc-test.qniao.cn ${headers}
${data} Set Variable {"phone":"15014242835","cardName":"${bank}","cardNo":"${cardNo}","openingBank":null,"cardType":"${cardType}","idno":null,"name":"${realName}","verificationCode":"888888","isExist":0,"type":4}
${reps} Post On Session ZTBT payment-settlement-center/bankcard/post/verify/bankverify ${data.encode('utf-8')}
log ${reps.json()}

46
pabotdemo/登录关键字.txt

@ -0,0 +1,46 @@
*** Settings ***
Library RequestsLibrary
Library Collections
Library urllib3
Library DatabaseLibrary
*** Variables ***
${url} http://api-client-ztb-test.qniao.cn
*** Keywords ***
userlogin
[Arguments] ${data}
#验证码登录
Disable Warnings
${header} Create Dictionary content-type=application/json X-APP-ID=470236309865238528
Create Session ZTBT https://api-client-uec-test.qniao.cn ${header}
${data} Create Dictionary account=15014242835 captcha=888888 accountType=2
#${data} Set Variable {"accountType":2,"password":null,"account":"15014242835","captcha":"${text_code}"}
${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]
login-token
[Arguments] ${token}
${header} Create Dictionary content-type=application/json X-APP-ID=470236309865238528
Create Session ZTBT ${url} ${header}
${token1} Create Dictionary loginToken=${token}
${reps} Post On Session ZTBT recycle-user-center/authorize/get/product-line-token/by/login-token json=${token1}
${gettoken} Get From Dictionary ${reps.json()["data"]} token #获取token
${userId} Get From Dictionary ${reps.json()["data"]} userId #获取用户id
log ${reps.json()["data"]["token"]}
Set Global Variable ${gettoken}
Set Global Variable ${userId}
getuserinfo
#获取用户信息
${header} Create Dictionary content-type=application/json X-APP-ID=470236309865238528 Authorization=${gettoken}
Create Session baseinfo ${url} ${header}
${reps} Get On Session baseinfo recycle-service/user/get/base-info
${realName} Get From Dictionary ${reps.json()["data"]} realName #获取实名
${userId} Get From Dictionary ${reps.json()["data"]} userId #获取用户id
Set Global Variable ${realName}
Set Global Variable ${userId}

411
report.html
File diff suppressed because it is too large
View File

Loading…
Cancel
Save