Browse Source

2021-11-18

pull/3/head
赖勇兰 4 years ago
committed by DESKTOP-74M199N\qniao
parent
commit
1639975f5e
47 changed files with 6992 additions and 218 deletions
  1. 13
      0-Database.robot
  2. 38
      001.robot
  3. 63
      1-Client/2-Createorder.robot
  4. 64
      1-Client(Test)/1-APPlogin(master).robot
  5. 11
      1-Client(Test)/1.1-APPlogin(Test).robot
  6. 123
      1-Client(Test)/2.1-CreateRegularorder.robot
  7. 75
      1-Client(Test)/2.2createActiveorder-1.robot
  8. 74
      1-Client(Test)/2.3createActiveorder-2.robot
  9. 17
      1-Client(Test)/3-Withdrawal_application.robot
  10. 18
      1-Client(Test)/3.1-Automatic withdrawal.robot
  11. 0
      1-Client(Test)/4-Real name authentication.robot
  12. 0
      1-Client(Test)/5-Add_bank_card.robot
  13. 5
      1-Client(Test)/6-Enterprise_certification.robot
  14. 25
      1-Client(Test)/7-Consignment_order.robot
  15. 2
      1-Client(Test)/__init__.robot
  16. 0
      1-Client(Test)/factory.robot
  17. 77
      2-Background_system/1-Consignment management/New_paper_mill.robot
  18. 18
      2-Background_system/3-operation management/contract.robot
  19. 0
      2-Background_system(Test)/1-WebLogin/weblogin.robot
  20. 153
      2-Background_system(Test)/1.1-New_PaperMill/New_paper_mill.robot
  21. 0
      2-Background_system(Test)/1.2-enterprise_management/__init__.robot
  22. 0
      2-Background_system(Test)/1.2-enterprise_management/__init__.txt
  23. 50
      2-Background_system(Test)/1.2-enterprise_management/enterprise-management.robot
  24. 80
      2-Background_system(Test)/1.3-operation management/contract.robot
  25. 139
      2-Background_system(Test)/1.4-Consignment activities/Consignment_activities.robot
  26. 39
      2-Background_system(Test)/2.1-Consignment management/1-appointment.robot
  27. 68
      2-Background_system(Test)/2.1-Consignment management/2.1-RegularUpload-weightnote.robot
  28. 205
      2-Background_system(Test)/2.1-Consignment management/2.2-RegularUpload-weightnote-1.robot
  29. 188
      2-Background_system(Test)/2.1-Consignment management/2.3-ActiveUpload-deliverynote.robot
  30. 77
      2-Background_system(Test)/2.1-Consignment management/3.1-Operation_audit.robot
  31. 78
      2-Background_system(Test)/2.1-Consignment management/3.2-Operation_audit.robot
  32. 78
      2-Background_system(Test)/2.1-Consignment management/3.3-Operation_audit.robot
  33. 39
      2-Background_system(Test)/3-Withdrawal_application/4-Financial_audit.robot
  34. 33
      2-Background_system(Test)/3-Withdrawal_application/5-Sales_receivables.robot
  35. 15
      2-Background_system(Test)/3-Withdrawal_application/Withdrawal application/1-Automatic_receipt.robot
  36. 2
      2-Background_system(Test)/3-Withdrawal_application/Withdrawal application/2-Manual_receipt.robot
  37. 207
      2-Background_system(Test)/4-Consignment_management/2.3-ActiveUpload-weightnote.robot
  38. 18
      2-Background_system(Test)/4-Consignment_management/3.3--Operation_audit.robot
  39. 7
      2-Background_system(Test)/4-Consignment_management/4.3-Financial_audit.robot
  40. 33
      2-Background_system(Test)/4-Consignment_management/5.3-sales_receivable.robot
  41. 0
      2-Background_system(Test)/4-Consignment_management/__init__.robot
  42. 55
      2-Background_system(Test)/5-Data comparison/5-Consignment_order.robot
  43. 0
      2-Background_system(Test)/5-Data comparison/__init__.txt
  44. 2
      __init__.robot
  45. 2125
      log.html
  46. 465
      output.xml
  47. 2431
      report.html

13
0-Database.robot

@ -0,0 +1,13 @@
*** Settings ***
Library DatabaseLibrary
*** Test Cases ***
Connect to database
#连接数据库
Connect To Database Using Custom Params pymysql host='8.135.8.221',user='root', password='password', \ port=3306,database='ztb_recycle' #连接数据库
${username} Query SELECT * FROM `ztb_recycle`.`qn_user` WHERE `real_name` LIKE '%赖勇兰%' #查找数据库ztb_recycle,表qn_user中real_name是赖勇兰的所有数据
log many ${username}
#Execute Sql String DELETE FROM `ztb_recycle`.`qn_user` WHERE `real_name` LIKE '%赖勇兰%' AND `id` = 584452885719420928 #删除数据
#Execute Sql String UPDATE `ztb_recycle`.`qn_user` SET `nick_name` = 'GGG' WHERE `id` = 597492076942331904 #修改数据
#Query SELECT * FROM `ztb_recycle`.`qn_user` WHERE `real_name` LIKE '%赖勇兰%' into outfile 'C:/Users/qniao/Desktop/测试.xls'
Disconnect From Database #断开数据库的连接

38
001.robot

@ -1,6 +1,9 @@
*** Settings *** *** Settings ***
Test Timeout 10 seconds
Library RequestsLibrary Library RequestsLibrary
Library Collections Library Collections
Library DateTime
Library String
*** Variables *** *** Variables ***
${num} [1,2,3] ${num} [1,2,3]
@ -13,8 +16,8 @@ ${list} [1,2,3,4,5]
#log to console \nvalue: ${value} #log to console \nvalue: ${value}
@{list} Set Variable A B C D @{list} Set Variable A B C D
FOR ${var} IN @{list} FOR ${var} IN @{list}
Run Keyword If '${var}'==B Exit For Loop
log ${var}
Run Keyword If '${var}'==B Exit For Loop
log ${var}
#Set Global Variable ${var} #Set Global Variable ${var}
图片base64加密 图片base64加密
@ -22,8 +25,39 @@ ${list} [1,2,3,4,5]
${pic_base64} Evaluate base64.b64encode(open('${filepath}','rb').read()).decode('utf-8') base64 ${pic_base64} Evaluate base64.b64encode(open('${filepath}','rb').read()).decode('utf-8') base64
log ${pic_base64} log ${pic_base64}
生成多个随机数
#获取列表内2个随机数
${rand_str} evaluate random.sample([0,1,2,3,4,5],2) random,string
条件判断后赋值
#条件判断后赋值
${a} Set Variable If 4
${a} Set Variable If '${a}'=='null' 1 2
Set Global Variable ${a}
数据断言
${data} Set Variable a
Should Be Equal ${data} a
获取时间
${datatime} Get Current Date result_format=%Y-%m-%d
${DT} Add Time To Date ${datatime} 7 days
${str} Get Substring ${DT} 0 10
#${time_stamp} Convert Date ${datatime} epoch
#log 年:${time_stamp.year}
#Should Be Equal As Integers ${DT} 2021
*** Keywords *** *** Keywords ***
list list
[Arguments] ${list} [Arguments] ${list}
${value} Evaluate random.choice(${num}) random ${value} Evaluate random.choice(${num}) random
log to console \nvalue: ${value} log to console \nvalue: ${value}
链接redis
#连接redis
${redis_conn}= Connect To Redis 8.135.8.221 6379 2 qnredis
#Set To Redis ${redis_conn} PAPER_MILL_ID | 01234567890 ${data}
#${data} Get From Redis ${redis_conn} *PAPER_MILL_ID496656259144093696
#${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 All Match Keys ${redis_conn} PAPER_MILL_ID* 50

63
1-Client/2-Createorder.robot

@ -1,63 +0,0 @@
*** Settings ***
Documentation 创建常规订单
Library RequestsLibrary
Library Collections
Library DateTime
Library RedisLibrary
*** Variables ***
${header} {'content-type':'application/json','X-APP-ID':'470236309865238528'}
*** Test Cases ***
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
#log ${reps.json()}
#Set Global Variable ${reps}
Should Be Equal As Strings ${reps.json()["message"]} successful
log ${reps.json()["data"]["records"]}
${categoryid} Get From Dictionary ${reps.json()["data"]["records"][0]["paperCategoryList"][1]} categoryId #纸厂品类id
${unitPrice} Get From Dictionary ${reps.json()["data"]["records"][0]["paperCategoryList"][1]} unitPrice #纸厂品类价格
${cumulativeWeight} Get From Dictionary ${reps.json()["data"]["records"][0]} cumulativeWeight #累计已代卖吨数
Set Global Variable ${categoryid}
Set Global Variable ${unitPrice}
链接redis
#连接redis
${redis_conn}= Connect To Redis 8.135.8.221 6379 2 qnredis
${data} Get From Redis ${redis_conn} 1234567890
${redis_data} Get From Redis ${redis_conn} PAPER_MILL_ID
get-carinfo
#获取使用过的车辆信息
${header} Create Dictionary content-type=application/json X-APP-ID=470236309865238528 Authorization=${gettoken}
Create Session get-carinfo http://api-client-ztb-test.qniao.cn ${header}
${reps} Get On Session get-carinfo recycle-service/proxy-sell/get/his-car-info
log ${reps.json()}
${carNumber} Get From Dictionary ${reps.json()["data"]} records
${plateNumber1} Evaluate random.choice(${carNumber}) random
log to console \nvalue:${plateNumber1}
${plateNumber} Get From Dictionary ${plateNumber1} plateNumber #车辆信息
Set Global Variable ${plateNumber}
choose-factory
${header} Create Dictionary content-type=application/json X-APP-ID=470236309865238528 Authorization=${gettoken}
Create Session choose-factory https://api-client-ztb-test.qniao.cn ${header}
${reps} Get On Session choose-factory recycle-service/get/paper-mill-paper-category-price-details/612629674392162304
log ${reps.json()["data"]}
Should Be Equal As Strings ${reps.json()["message"]} successful
createorder
#下单
${header} Create Dictionary content-type=application/json X-APP-ID=470236309865238528 Authorization=QNT ${gettoken}
${datatime} get current date result_format=%Y-%m-%d
log ${datatime}
${data} Set Variable {"paperCategoryId":"${categoryid}" ,"unitPrice":${unitPrice},"totalEstimatedWeight":30000,"customerName":"赖勇兰","deliveryTime":"${datatime}","carInfos":[{"plateNumber":"${plateNumber}"}]}
log ${data}
Create Session createorder http://api-client-ztb-test.qniao.cn ${header}
${reps} Post On Session createorder recycle-service/proxy-sell/create/order ${data.encode('utf-8')}
log ${reps.json()}
Should Be Equal As Strings ${reps.json()["message"]} successful
Set Global Variable ${datatime}
#sleep 10

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

@ -0,0 +1,64 @@
*** 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}

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

@ -1,7 +1,10 @@
*** Settings *** *** Settings ***
Suite Setup Suite Setup
Test Timeout
Library RequestsLibrary Library RequestsLibrary
Library Collections Library Collections
Library urllib3
Library DatabaseLibrary
*** Variables *** *** Variables ***
${header} {'content-type':'application/json','X-APP-ID':'470236309865238528'} ${header} {'content-type':'application/json','X-APP-ID':'470236309865238528'}
@ -11,14 +14,14 @@ ${url} http://api-client-ztb-test.qniao.cn
userlogin userlogin
[Setup] [Setup]
#验证码登录 #验证码登录
#${header} Create Dictionary content-type=application/json X-APP-ID=470236309865238528
Create Session ZTBT http://api-client-uec-test.qniao.cn ${header}
Disable Warnings
Create Session ZTBT https://api-client-uec-test.qniao.cn ${header}
${data} Create Dictionary account=15014242835 captcha=888888 accountType=2 ${data} Create Dictionary account=15014242835 captcha=888888 accountType=2
${respones} POST On Session ZTBT /uec/authorize/by-captcha json=${data}
#${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.status_code}
log ${respones.json()} log ${respones.json()}
${token} Get From Dictionary ${respones.json()["data"]} token ${token} Get From Dictionary ${respones.json()["data"]} token
#log ${respones.json()["data"]["token"]}
Set Global Variable ${token} Set Global Variable ${token}
[Teardown] [Teardown]

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

@ -0,0 +1,123 @@
*** Settings ***
Documentation 创建常规订单
Test Teardown Run Keyword If Test Failed Fatal Error
Test Timeout 10 seconds
Library RequestsLibrary
Library Collections
Library DateTime
Library RedisLibrary
Library urllib3
*** Variables ***
${header} {'content-type':'application/json','X-APP-ID':'470236309865238528','Authorization':'QNT ${gettoken}'}
${url} http://api-client-ztb-test.qniao.cn
*** Test Cases ***
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}
paper-mill-paper-category-price-details
#获取纸厂详情信息
Create Session ZTBT ${url} ${header}
${reps} Get On Session ZTBT recycle-service/get/paper-mill-paper-category-price-details/${paperMillId}
log ${reps.json()}
relation
#获取业务邀请码弹窗
Create Session ZTBT ${url} ${header}
${reps} get On Session ZTBT recycle-service/proxy-sell/get/relation
log ${reps,json()}
relation_code
#填写业务人员邀请码
Create Session ZTBT ${url} ${header}
${data} Set Variable {"code":"9999"}
${reps} Post On Session ZTBT recycle-service/proxy-sell/bind/relation ${data.encode('utf-8')}
log ${reps.json()}
get-carinfo
#获取使用过的车辆信息
#${header} Create Dictionary content-type=application/json X-APP-ID=470236309865238528 Authorization=${gettoken}
Create Session get-carinfo http://api-client-ztb-test.qniao.cn ${header}
${reps} Get On Session get-carinfo recycle-service/proxy-sell/get/his-car-info
log ${reps.json()}
${carNumber} Get From Dictionary ${reps.json()["data"]} records #获取车辆列表
${plateNumber1} Evaluate random.choice(${carNumber}) random
log to console \nvalue:${plateNumber1}
${plateNumber} Get From Dictionary ${plateNumber1} plateNumber #车辆信息
Set Global Variable ${plateNumber}
choose-factory
#选择纸厂
${header} Create Dictionary content-type=application/json X-APP-ID=470236309865238528 Authorization=${gettoken}
Create Session choose-factory https://api-client-ztb-test.qniao.cn ${header}
${reps} Get On Session choose-factory recycle-service/get/paper-mill-paper-category-price-details/612629674392162304
log ${reps.json()["data"]}
Should Be Equal As Strings ${reps.json()["message"]} successful
save_factory-by-shipment-info
#填写发货信息
#${headers} Create Dictionary content-type=application/json X-APP-ID=470236309865238528 Authorization=QNT d6SX3ESr8Jb2tYq/89Ft7ONlmJEiWUarjlNpFfW2lU9rgLvV1vzRLbb1Y4C5/b3g/PxwWTrvGmZUIarJEaEOkQ==
Disable Warnings
${datatime} Get Current Date result_format=%Y-%m-%d
Create Session ZTBT https://api-client-ztb-test.qniao.cn ${header}
${data} Set Variable {"packageFactoryName":"${datatime}打包站"}
${reps} Post On Session ZTBT recycle-user-center/save/factory-by-shipment-info ${data.encode('utf-8')}
log ${reps.json()}
Should Be Equal As Strings ${reps.json()["message"]} successful
createorder
#创建下单
#${header} Create Dictionary content-type=application/json X-APP-ID=470236309865238528 Authorization=QNT ${gettoken}
${datatime} get current date result_format=%Y-%m-%d
log ${datatime}
${data} Set Variable {"paperCategoryId":"${categoryid}" ,"unitPrice":${unitPrice},"totalEstimatedWeight":30000,"customerName":"赖勇兰","deliveryTime":"${datatime}","carInfos":[{"plateNumber":"${plateNumber}"}]}
log ${data}
Create Session createorder http://api-client-ztb-test.qniao.cn ${header}
${reps} Post On Session createorder recycle-service/proxy-sell/create/order ${data.encode('utf-8')}
${orderId} Get From Dictionary ${reps.json()["data"]} orderId #获取订单编号
log ${reps.json()}
Should Be Equal As Strings ${reps.json()["message"]} successful
Set Global Variable ${datatime}
Set Global Variable ${orderId}
createorder-newcar
#创建下单(填写车辆信息)
#${header} Create Dictionary content-type=application/json X-APP-ID=470236309865238528 Authorization=QNT ${gettoken}
${datatime} get current date result_format=%Y-%m-%d
log ${datatime}
${data} Set Variable {"paperCategoryId":"${categoryid}" ,"unitPrice":${unitPrice},"totalEstimatedWeight":30000,"customerName":"赖勇兰","deliveryTime":"${datatime}","carInfos":[{"plateNumber":"宁G54321"}]}
log ${data}
Create Session createorder http://api-client-ztb-test.qniao.cn ${header}
${reps} Post On Session createorder recycle-service/proxy-sell/create/order ${data.encode('utf-8')}
${orderId} Get From Dictionary ${reps.json()["data"]} orderId #获取订单编号
log ${reps.json()}
Should Be Equal As Strings ${reps.json()["message"]} successful
Set Global Variable ${datatime}
Set Global Variable ${orderId}

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

@ -0,0 +1,75 @@
*** Settings ***
Library DateTime
Library Collections
Library RequestsLibrary
*** Variables ***
${url} http://api-client-ztb-test.qniao.cn
${headers} {'content-type':'application/json','X-APP-ID':'470236309865238528','Authorization':'QNT ${gettoken}'}
*** Test Cases ***
proxy-sell-activity_list
#获取活动代卖列表
Create Session ZTBT ${url} ${headers}
${repsponse} Get On Session ZTBT recycle-service/proxy-sell-activity/list params=pageNum=1&pageSize=15
${records} Get From Dictionary ${repsponse.json()["data"]} records #获取代卖活动列表
FOR ${item} IN @{records}
${activityName} Get From Dictionary ${item} activityName #获取活动名称
${paperCategoryList} Get From Dictionary ${item} paperCategoryList #获取纸厂品类
${paperMillId} Get From Dictionary ${item} paperMillId #获取纸厂id
${activityId} Get From Dictionary ${item} activityId #获取活动id
Exit For Loop If '${activityName}'=='无账期活动一次'
END
${Category_value} Evaluate random.choice(${paperCategoryList}) random #获取纸品列表
log to console \nvalue: ${Category_value}
${categoryId} Get From Dictionary ${Category_value} categoryId #获取纸品id
${categoryName} Get From Dictionary ${Category_value} categoryName #获取纸品名称
${unitPrice} Get From Dictionary ${Category_value} unitPrice #获取纸品价格
Set Global Variable ${paperMillId}
Set Global Variable ${activityId}
Set Global Variable ${categoryId}
Set Global Variable ${categoryName}
Set Global Variable ${unitPrice}
get-carinfo
#获取使用过的车辆信息
#${header} Create Dictionary content-type=application/json X-APP-ID=470236309865238528 Authorization=${gettoken}
Create Session get-carinfo ${url} ${headers}
${reps} Get On Session get-carinfo recycle-service/proxy-sell/get/his-car-info
log ${reps.json()}
${carNumber} Get From Dictionary ${reps.json()["data"]} records #车辆列表
${plateNumber_value} Evaluate random.sample(${carNumber},1) random
log to console \nvalue:${plateNumber_value}
${plateNumber1} Get From Dictionary ${plateNumber_value[0]} plateNumber #车辆信息1
#${plateNumber2} Get From Dictionary ${plateNumber_value[1]} plateNumber #车辆信息2
Set Global Variable ${plateNumber1}
#Set Global Variable ${plateNumber2}
get_paper-mill-paper-category-price-details
#获取纸厂详情
Create Session ZTBT ${url} ${headers}
${reps} Get On Session ZTBT recycle-service/get/paper-mill-paper-category-price-details/${paperMillId}
log ${reps.json()}
get_relation
#创建用户和业务归属人关系
Create Session ZTBT ${url} ${headers}
${reps} Get On Session ZTBT recycle-service/proxy-sell/get/relation
${bizUserId} Get From Dictionary ${reps.json()["data"]} bizUserId #业务归属人id
${cusormerId} Get From Dictionary ${reps.json()["data"]} cusormerId #用户id
${customerName} Get From Dictionary ${reps.json()["data"]} customerName #用户名称
Set Global Variable ${bizUserId}
Set Global Variable ${cusormerId}
Set Global Variable ${customerName}
create_order
#创建代卖活动订单-1次付款
Create Session ZTBT ${url} ${headers}
${datatime} get current date result_format=%Y-%m-%d
${order_data} Set Variable { \ \ \ \ "paperCategoryId":"${categoryId}", \ \ \ \ "unitPrice":"${unitPrice}", \ \ \ \ "totalEstimatedWeight":30000, \ \ \ \ "activityId":"${activityId}", \ \ \ \ "customerName":"${customerName}", \ \ \ \ "deliveryTime":"${datatime}", \ \ \ \ "carInfos":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "plateNumber":"${plateNumber1}" \ \ \ \ \ \ \ \ } \ \ \ \ ] }
${reps} Post On Session ZTBT recycle-service/proxy-sell/create/order ${order_data.encode('utf-8')}
log ${reps.json()}
${orderId} Get From Dictionary ${reps.json()["data"]} orderId #获取订单编号
Should Be Equal As Strings ${reps.json()["message"]} successful
Set Global Variable ${orderId}
Set Global Variable ${datatime}

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

@ -0,0 +1,74 @@
*** Settings ***
Library DateTime
Library Collections
Library RequestsLibrary
*** Variables ***
${url} http://api-client-ztb-test.qniao.cn
${headers} {'content-type':'application/json','X-APP-ID':'470236309865238528','Authorization':'QNT ${gettoken}'}
*** Test Cases ***
proxy-sell-activity_list
#获取活动代卖列表
Create Session ZTBT ${url} ${headers}
${repsponse} Get On Session ZTBT recycle-service/proxy-sell-activity/list params=pageNum=1&pageSize=15
${records} Get From Dictionary ${repsponse.json()["data"]} records #获取代卖活动列表
FOR ${item} IN @{records}
${activityName} Get From Dictionary ${item} activityName #获取活动名称
${paperCategoryList} Get From Dictionary ${item} paperCategoryList #获取纸厂品类
${paperMillId} Get From Dictionary ${item} paperMillId #获取纸厂id
${activityId} Get From Dictionary ${item} activityId #获取活动id
Exit For Loop If '${activityName}'=='无账期九一(两次)'
END
${Category_value} Evaluate random.choice(${paperCategoryList}) random #获取纸品
log to console \nvalue: ${Category_value}
${categoryId} Get From Dictionary ${Category_value} categoryId #获取纸品id
${categoryName} Get From Dictionary ${Category_value} categoryName #获取纸品名称
${unitPrice} Get From Dictionary ${Category_value} unitPrice #获取纸品价格
Set Global Variable ${paperMillId}
Set Global Variable ${activityId}
Set Global Variable ${categoryId}
Set Global Variable ${categoryName}
Set Global Variable ${unitPrice}
get-carinfo
#获取使用过的车辆信息
#${header} Create Dictionary content-type=application/json X-APP-ID=470236309865238528 Authorization=${gettoken}
Create Session get-carinfo ${url} ${headers}
${reps} Get On Session get-carinfo recycle-service/proxy-sell/get/his-car-info
log ${reps.json()}
${carNumber} Get From Dictionary ${reps.json()["data"]} records #车辆列表
${plateNumber_value} Evaluate random.sample(${carNumber},1) random
log to console \nvalue:${plateNumber_value}
${plateNumber1} Get From Dictionary ${plateNumber_value[0]} plateNumber #车辆信息1
#${plateNumber2} Get From Dictionary ${plateNumber_value[1]} plateNumber #车辆信息2
Set Global Variable ${plateNumber1}
#Set Global Variable ${plateNumber2}
get_paper-mill-paper-category-price-details
#获取纸厂详情
Create Session ZTBT ${url} ${headers}
${reps} Get On Session ZTBT recycle-service/get/paper-mill-paper-category-price-details/${paperMillId}
log ${reps.json()}
get_relation
#创建用户和业务归属人关系
Create Session ZTBT ${url} ${headers}
${reps} Get On Session ZTBT recycle-service/proxy-sell/get/relation
${bizUserId} Get From Dictionary ${reps.json()["data"]} bizUserId #业务归属人id
${cusormerId} Get From Dictionary ${reps.json()["data"]} cusormerId #用户id
${customerName} Get From Dictionary ${reps.json()["data"]} customerName #用户名称
Set Global Variable ${bizUserId}
Set Global Variable ${cusormerId}
Set Global Variable ${customerName}
create_order
#创建代卖活动订单-2次付款
Create Session ZTBT ${url} ${headers}
${datatime} get current date result_format=%Y-%m-%d
${order_data} Set Variable { \ \ \ \ "paperCategoryId":"${categoryId}", \ \ \ \ "unitPrice":"${unitPrice}", \ \ \ \ "totalEstimatedWeight":30000, \ \ \ \ "activityId":"${activityId}", \ \ \ \ "customerName":"${customerName}", \ \ \ \ "deliveryTime":"${datatime}", \ \ \ \ "carInfos":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "plateNumber":"${plateNumber1}" \ \ \ \ \ \ \ \ } \ \ \ \ ] }
${reps} Post On Session ZTBT recycle-service/proxy-sell/create/order ${order_data.encode('utf-8')}
log ${reps.json()}
${orderId} Get From Dictionary ${reps.json()["data"]} orderId #获取订单编号
Should Be Equal As Strings ${reps.json()["message"]} successful
Set Global Variable ${orderId}

1-Client/3-Withdrawal_application.robot → 1-Client(Test)/3-Withdrawal_application.robot

@ -18,12 +18,15 @@ get_order-withdrawal-list
#获取可提现单列表 #获取可提现单列表
Create Session ZTBT ${URL} ${header} Create Session ZTBT ${URL} ${header}
${reps_data} Get On Session ZTBT payment-settlement-center/balance/get/order-withdrawal-list ${reps_data} Get On Session ZTBT payment-settlement-center/balance/get/order-withdrawal-list
log ${reps_data.json()}
${tradeOrderId} Get From Dictionary ${reps_data.json()["data"]["orderWithdrawalList"][-1]} tradeOrderId #交易订单号
${提现订单id} Get From Dictionary ${reps_data.json()["data"]["orderWithdrawalList"][-1]} id #提现订单id
#${orderWithdrawalList} Get From Dictionary ${reps_data.json()["data"]} orderWithdrawalList
#${value} Evaluate random.choice(${orderWithdrawalList} ) random
#log to console \nvalue: ${value}
${orderWithdrawalList} Get From Dictionary ${reps_data.json()["data"]} orderWithdrawalList #可提现单列表
FOR ${item} IN @{orderWithdrawalList}
${status} Get From Dictionary ${item} status #获取提现单状态
${tradeOrderId} Get From Dictionary ${item} tradeOrderId #获取提现单订单号
${提现订单id} Get From Dictionary ${item} id #获取提现单id
Exit For Loop If '${status}'=='1'
END
#${tradeOrderId} Get From Dictionary ${reps_data.json()["data"]["orderWithdrawalList"][-1]} tradeOrderId #交易订单号
#${提现订单id} Get From Dictionary ${reps_data.json()["data"]["orderWithdrawalList"][-1]} id #提现订单id
Set Global Variable ${tradeOrderId} Set Global Variable ${tradeOrderId}
Set Global Variable ${提现订单id} Set Global Variable ${提现订单id}
@ -41,7 +44,7 @@ getBankCardList
order_withdraw order_withdraw
#提交申请提现 #提交申请提现
Create Session ZTBT ${URL} ${header} Create Session ZTBT ${URL} ${header}
${data} Set Variable {"bankId":"${银行卡id} ","ids":["${提现订单id} "]}
${data} Set Variable {"bankId":"${银行卡id}","ids":["${提现订单id}"]}
${reps} Post On Session ZTBT payment-settlement-center/balance/order/withdraw ${data} ${reps} Post On Session ZTBT payment-settlement-center/balance/order/withdraw ${data}
#log ${reps.json()} #log ${reps.json()}
${markedWords} Get From Dictionary ${reps.json()["data"]} markedWords ${markedWords} Get From Dictionary ${reps.json()["data"]} markedWords

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

@ -0,0 +1,18 @@
*** Settings ***
Library RequestsLibrary
Library DateTime
Library urllib3
*** Test Cases ***
login
Automatic withdrawal
#自动提现
Disable Warnings
${headers} Create Dictionary Content-Type=application/x-www-form-urlencoded
${datatime} Get Current Date result_format=%Y-%m-%d
log ${datatime}
Create Session xxl-job http://xxl-job-admin-test.qniao.cn ${headers}
${data} Create Dictionary id=2 executorParam={'datatime':'${datatime}','period':'0'} addressList=
${reps} Post On Session xxl-job xxl-job-admin/jobinfo/trigger data=${data}
#log ${reps.json()}

1-Client/4-Real name authentication.robot → 1-Client(Test)/4-Real name authentication.robot

1-Client/5-Add_bank_card.robot → 1-Client(Test)/5-Add_bank_card.robot

5
1-Client(Test)/6-Enterprise_certification.robot

@ -0,0 +1,5 @@
*** Settings ***
Library Collections
Library RequestsLibrary
*** Test Cases ***

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

@ -0,0 +1,25 @@
*** Settings ***
Documentation 查看代卖订单
Library RequestsLibrary
Library Collections
Library DateTime
Library RedisLibrary
Library urllib3
*** Variables ***
${header} {'content-type':'application/json','X-APP-ID':'470236309865238528','Authorization':'QNT ${gettoken}'}
${url} http://api-client-ztb-test.qniao.cn
*** Test Cases ***
get_proxy-order-list
Create Session ZTBT ${url} ${header}
${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}
get_proxy-order_details
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}

2
1-Client(Test)/__init__.robot

@ -0,0 +1,2 @@
*** Settings ***
Test Setup

1-Client/factory.robot → 1-Client(Test)/factory.robot

77
2-Background_system/1-Consignment management/New_paper_mill.robot

@ -1,77 +0,0 @@
*** Settings ***
Library RequestsLibrary
Library Collections
Library requests
*** Variables ***
${header} {'X-APP-ID':'470236309865238555','Authorization':'Token 6b08add42d6bcf73abb935b2adf83525','Content-Type':'application/json'}
${URL} http://api-ops-ztb-test.qniao.cn
*** Test Cases ***
get_paperMill_list
#获取纸厂列表
Create Session ZTBT ${URL} ${header}
${reps} Get On Session ZTBT recycle-service/admin/paperMill/get/paper-mill-list params=pageNum=1&pageSize=20
log ${reps}
Should Be Equal As Strings ${reps.json()["message"]} successful
get_regions
#获取区域
Create Session ZTBT http://api-ops-uec.qniao.cn ${header}
${reps} Get On Session ZTBT uec/get/regions
log ${reps.json()}
${省区域} Get From Dictionary ${reps.json()} data
log ${省区域}
${value} Evaluate random.choice(${省区域}) random
log to console \nvalue: ${value}
${市区域} Get From Dictionary ${value} children #区域省
log ${市区域}
${value1} Evaluate random.choice(${市区域}) random
log to console \nvalue: ${value1}
${区区域} Get From Dictionary ${value1} children
log ${区区域}
${value2} Evaluate random.choice(${区区域}) random
log to console \nvalue: ${value2}
${区域id} Get From Dictionary ${value2} id #区区域id
${区域name} Get From Dictionary ${value2} name #区区域名称
Set Suite Variable ${区域id}
paperMill_logo
#上传纸厂logo
#${dict} Create Dictionary Content-Type=image/jpeg filename=20210803.jpg
#Create Session ZTBT ${URL} ${dict}
${filepath} Evaluate open('E:/lyl/图片/21042217001449712.png','rb')
${image} Evaluate open('E:/lyl/图片/21042217001449712.png','rb')
${file} Create Dictionary filepath=${filepath} image=${image}
Create Session ZTBT ${URL}
log ${file}
${result} Post On Session ZTBT recycle-user-center/upload/image files=${file}
${pictures} Get From Dictionary ${result.json()} data
log ${result.content}
Set Global Variable ${pictures} #本地图片
get_employer-auditor-list
#获取渠道归属人
Create Session ZTBT ${URL} ${header}
${reps} Get On Session ZTBT recycle-service/admin/employer/get/employer-auditor-list params=name=
log ${reps}
${归属人} Get From Dictionary ${reps.json()} data
${value} Evaluate random.choice(${归属人}) random
log to console \nvalue: ${value}
${adminId} Get From Dictionary ${value} adminId #归属人id
${name} Get From Dictionary ${value} name #归属人名称
Set Suite Variable ${adminId}
Set Suite Variable ${name}
New_paper_mill
Create Session ZTBT ${URL} ${header}
${data} Set Variable { \ \ \ \ "newTime":[ \ ], \ \ \ \ "name":"天河纸业有限公司", \ \ \ \ "locDistrictId":130204, \ \ \ \ "contacts":"", \ \ \ \ "mobile":"", \ \ \ \ "logoImg":"https://qncloudprintfile.oss-cn-shenzhen.aliyuncs.com/cloudprint/1628499726181.jpg", \ \ \ \ "millSupplierNameList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "account":"天河1号" \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "account":"天河2号" \ \ \ \ \ \ \ \ } \ \ \ \ ], \ \ \ \ "locDetails":"", \ \ \ \ "attentionsReportCar":"", \ \ \ \ "attentionsLoadingCar":"", \ \ \ \ "attentionsArrival":"", \ \ \ \ "attentionsRegulations":"", \ \ \ \ "shortName":"天河纸业", \ \ \ \ "enableSalesAgent":"", \ \ \ \ "paperMillSettlementInfo":{ \ \ \ \ \ \ \ \ "invoicePoint":null, \ \ \ \ \ \ \ \ "invoiceType":null, \ \ \ \ \ \ \ \ "isInvoice":null, \ \ \ \ \ \ \ \ "paperMillId":null, \ \ \ \ \ \ \ \ "paybackIntever":"30" \ \ \ \ }, \ \ \ \ "operatingStrategy":{ \ \ \ \ \ \ \ \ "enableSalesAgent":null, \ \ \ \ \ \ \ \ "fundWarningPercentage":null, \ \ \ \ \ \ \ \ "weightWarningPercentage":null, \ \ \ \ \ \ \ \ "isOperations":null, \ \ \ \ \ \ \ \ "manageNotifyMessage":"该纸厂已暂停接单,请联系相关负责人!", \ \ \ \ \ \ \ \ "proxyPaySurcharge":0.015, \ \ \ \ \ \ \ \ "stopManageThreshold":null, \ \ \ \ \ \ \ \ "surplusFund":null, \ \ \ \ \ \ \ \ "surplusWeight":null, \ \ \ \ \ \ \ \ "adminIds":[ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ "paperMillBizId":"619675947926425600", \ \ \ \ \ \ \ \ "paperMillBizAccount":{ \ \ \ \ \ \ \ \ \ \ \ \ "id":"619675947926425600", \ \ \ \ \ \ \ \ \ \ \ \ "name":"李雷刚" \ \ \ \ \ \ \ \ } \ \ \ \ }, \ \ \ \ "paperMillBizId":"619675947926425600", \ \ \ \ "matCharges":null, \ \ \ \ "collectionCharges":null }
${reps} Post On Session ZTBT recycle-service/admin/paperMill/add/paper-mill ${data.encode('utf-8')}
log ${reps.json()}
update
Create Session ZTBT http://api-ops-uec.qniao.cn ${header}
${reps} Get On Session ZTBT uec/get/application/update
Should Be Equal As Strings ${reps.json()["message"]} successful
*** Keywords ***

18
2-Background_system/3-operation management/contract.robot

@ -1,18 +0,0 @@
*** Settings ***
Library DateTime
Library Collections
Library RequestsLibrary
*** Variables ***
${URL} http://api-ops-ztb-test.qniao.cn
${header} {'X-APP-ID':'470236309865238555','Authorization':'Token 6b08add42d6bcf73abb935b2adf83525','Content-Type':'application/json'}
*** Test Cases ***
get_contract_list
#获取合同列表
Create Session ZTBT ${URL} ${header}
${response} Get On Session ZTBT recycle-service/admin/contract/get/page-list params=pageNum=1&pageSize=20&status=1
log ${response.json()}
get_contract_by_paperMilldName
#通过纸厂查找合同

2-Background_system/weblogin.robot → 2-Background_system(Test)/1-WebLogin/weblogin.robot

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

@ -0,0 +1,153 @@
*** Settings ***
Library RequestsLibrary
Library Collections
Library requests
Library DateTime
*** Variables ***
${header} {'X-APP-ID':'470236309865238555','Authorization':'${gettoken}','Content-Type':'application/json'}
${URL} http://api-ops-ztb-test.qniao.cn
*** Test Cases ***
get_paperMill_list
#获取纸厂列表
Create Session ZTBT ${URL} ${header}
${reps} Get On Session ZTBT recycle-service/admin/paperMill/get/paper-mill-list params=pageNum=1&pageSize=20
log ${reps}
Should Be Equal As Strings ${reps.json()["message"]} successful
get_regions
#获取区域
Create Session ZTBT http://api-ops-uec.qniao.cn ${header}
${reps} Get On Session ZTBT uec/get/regions
log ${reps.json()}
${省区域} Get From Dictionary ${reps.json()} data
log ${省区域}
${value} Evaluate random.choice(${省区域}) random
log to console \nvalue: ${value}
${市区域} Get From Dictionary ${value} children #区域省
log ${市区域}
${value1} Evaluate random.choice(${市区域}) random
log to console \nvalue: ${value1}
${区区域} Get From Dictionary ${value1} children
log ${区区域}
${value2} Evaluate random.choice(${区区域}) random
log to console \nvalue: ${value2}
${区域id} Get From Dictionary ${value2} id #区区域id
${区域name} Get From Dictionary ${value2} name #区区域名称
Set Suite Variable ${区域id}
paperMill_logo
#上传纸厂logo
#${dict} Create Dictionary Content-Type=image/jpeg filename=20210803.jpg
#Create Session ZTBT ${URL} ${dict}
${filepath} Evaluate open('E:/lyl/图片/21042217001449712.png','rb')
${image} Evaluate open('E:/lyl/图片/21042217001449712.png','rb')
${file} Create Dictionary filepath=${filepath} image=${image}
Create Session ZTBT ${URL}
log ${file}
${result} Post On Session ZTBT recycle-user-center/upload/image files=${file}
${pictures} Get From Dictionary ${result.json()} data
log ${result.content}
Set Global Variable ${pictures} #本地图片
get_employer-auditor-list
#获取渠道归属人
Create Session ZTBT ${URL} ${header}
${reps} Get On Session ZTBT recycle-service/admin/employer/get/employer-auditor-list params=name=
log ${reps}
${归属人} Get From Dictionary ${reps.json()} data
${value} Evaluate random.choice(${归属人}) random
log to console \nvalue: ${value}
${adminId} Get From Dictionary ${value} adminId #归属人id
${name} Get From Dictionary ${value} name #归属人名称
Set Suite Variable ${adminId}
Set Suite Variable ${name}
New_paper_mill
#新建纸厂
Create Session ZTBT ${URL} ${header}
${data} Set Variable { \ \ \ \ "newTime":[ \ ], \ \ \ \ "name":"宇茂纸业有限公司", \ \ \ \ "locDistrictId":"${区域id}", \ \ \ \ "contacts":"", \ \ \ \ "mobile":"", \ \ \ \ "logoImg":"https://qncloudprintfile.oss-cn-shenzhen.aliyuncs.com/cloudprint/1628499726181.jpg", \ \ \ \ "millSupplierNameList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "account":"宇茂纸业1号" \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "account":"宇茂纸业2号" \ \ \ \ \ \ \ \ } \ \ \ \ ], \ \ \ \ "locDetails":"", \ \ \ \ "attentionsReportCar":"", \ \ \ \ "attentionsLoadingCar":"", \ \ \ \ "attentionsArrival":"", \ \ \ \ "attentionsRegulations":"", \ \ \ \ "shortName":"宇茂纸业", \ \ \ \ "enableSalesAgent":"", \ \ \ \ "paperMillSettlementInfo":{ \ \ \ \ \ \ \ \ "invoicePoint":null, \ \ \ \ \ \ \ \ "invoiceType":null, \ \ \ \ \ \ \ \ "isInvoice":null, \ \ \ \ \ \ \ \ "paperMillId":null, \ \ \ \ \ \ \ \ "paybackIntever":"30" \ \ \ \ }, \ \ \ \ "operatingStrategy":{ \ \ \ \ \ \ \ \ "enableSalesAgent":1, \ \ \ \ \ \ \ \ "fundWarningPercentage":null, \ \ \ \ \ \ \ \ "weightWarningPercentage":null, \ \ \ \ \ \ \ \ "isOperations":1, \ \ \ \ \ \ \ \ "manageNotifyMessage":"该纸厂已暂停接单,请联系相关负责人!", \ \ \ \ \ \ \ \ "proxyPaySurcharge":0.015, \ \ \ \ \ \ \ \ "stopManageThreshold":null, \ \ \ \ \ \ \ \ "surplusFund":null, \ \ \ \ \ \ \ \ "surplusWeight":null, \ \ \ \ \ \ \ \ "adminIds":[ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ "paperMillBizId":"619675947926425600", \ \ \ \ \ \ \ \ "paperMillBizAccount":{ \ \ \ \ \ \ \ \ \ \ \ \ "id":"619675947926425600", \ \ \ \ \ \ \ \ \ \ \ \ "name":"李雷刚" \ \ \ \ \ \ \ \ } \ \ \ \ }, \ \ \ \ "paperMillBizId":"619675947926425600", \ \ \ \ "matCharges":null, \ \ \ \ "collectionCharges":null }
${reps} Post On Session ZTBT recycle-service/admin/paperMill/add/paper-mill ${data.encode('utf-8')}
log ${reps.json()}
update
Create Session ZTBT http://api-ops-uec.qniao.cn ${header}
${reps} Get On Session ZTBT uec/get/application/update
Should Be Equal As Strings ${reps.json()["message"]} successful
get_paperMill_list-1
#获取纸厂列表
Create Session ZTBT ${URL} ${header}
${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
Should Be Equal As Strings ${reps.json()["message"]} successful
Set Global Variable ${paperMillId}
Set Global Variable ${paperMilld_name}
get_paper-mill-category
#获取纸厂品类列表
Create Session ZTBT ${URL} ${header}
${reps} Get On Session ZTBT recycle-service/admin/paperMill/get/paper-mill-category/${paperMillId} params=id=${paperMillId}
log ${reps.json()}
update_paper-mill-category
#更新纸品品类
Create Session ZTBT ${URL} ${header}
${data} Set Variable { \ \ \ \ "paperMillCategories":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "categoryName":"1号", \ \ \ \ \ \ \ \ \ \ \ \ "inspectionNote":"" \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "categoryName":"2号", \ \ \ \ \ \ \ \ \ \ \ \ "inspectionNote":"" \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "categoryName":"3号", \ \ \ \ \ \ \ \ \ \ \ \ "inspectionNote":"" \ \ \ \ \ \ \ \ } \ \ \ \ ], \ \ \ \ "id":"${paperMillId} " }
${reps} Post On Session ZTBT recycle-service/admin/paperMill/update/paper-mill-category/${paperMillId} ${data.encode('utf-8')}
log ${reps.json()}
get_paper-mill-category-list
#获取品类列表
Create Session ZTBT ${URL} ${header}
${reps} Get On Session ZTBT recycle-service/admin/paperMill/get/paper-mill-category/${paperMillId} params=id=${paperMillId}
${data} Get From Dictionary ${reps.json()} data
${List} Create List
FOR ${items} IN @{data}
${paperMillCategoryId} Get From Dictionary ${items} paperMillCategoryId #纸品id
${categoryName} Get From Dictionary ${items} categoryName #纸品name
Append To List ${List} ${paperMillCategoryId}
END
#${paperMillCategoryId1} Get From Dictionary ${reps.json()["data"][0]} paperMillCategoryId #获取品类1id
#${categoryName1} Get From Dictionary ${reps.json()["data"][0]} categoryName #品类1名称
#Set Global Variable ${paperMillCategoryId}
#Set Global Variable ${categoryName}
${List0} Get From List ${List} 0
${List1} Get From List ${List} 1
${List2} Get From List ${List} 2
Set Global Variable ${List0}
Set Global Variable ${List1}
Set Global Variable ${List2}
get_paper-mill-category-price-list
#获取报价列表
Create Session ZTBT ${URL} ${header}
${reps} Get On Session ZTBT recycle-service/admin/paperMillCategory/get/paper-mill-category-price-list params=pageNum=1&pageSize=10&paperMillId=${paperMillId}
log ${reps.json()}
get_paper-mill-category-price-last
#获取纸厂报价详情
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')}
log ${reps.json()}
add_paper-mill-category-price
#发布最新报价
Create Session ZTBT ${URL} ${header}
${Datatime} Get Time
${data} Set Variable { \ \ \ \ "publishDate":"${Datatime}", \ \ \ \ "paperMillCategoryDetailsEntries":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "paperCategoryId":"${List0}", \ \ \ \ \ \ \ \ \ \ \ \ "unitPrice":1.52, \ \ \ \ \ \ \ \ \ \ \ \ "publicSubsidies":0.005 \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "paperCategoryId":"${List1}", \ \ \ \ \ \ \ \ \ \ \ \ "unitPrice":1.32, \ \ \ \ \ \ \ \ \ \ \ \ "publicSubsidies":0.01 \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "paperCategoryId":"${List2}", \ \ \ \ \ \ \ \ \ \ \ \ "unitPrice":1.55, \ \ \ \ \ \ \ \ \ \ \ \ "publicSubsidies":null \ \ \ \ \ \ \ \ } \ \ \ \ ], \ \ \ \ "paperMillId":"${paperMillId}", \ \ \ \ "time":"${Datatime}" }
${reps} Post On Session ZTBT recycle-service/admin/paperMillCategory/add/paper-mill-category-price ${data.encode('utf-8')}
Should Be Equal As Strings ${reps.json()["message"]} successful
upadte_paper-mill-category-price
#更新最新报价
Create Session ZTBT ${URL} ${header}
${Datatime} Get Time
${data} Set Variable { \ \ \ \ "publishDate":"${Datatime}", \ \ \ \ "paperMillCategoryDetailsEntries":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "paperCategoryId":"${List0}", \ \ \ \ \ \ \ \ \ \ \ \ "unitPrice":1.53, \ \ \ \ \ \ \ \ \ \ \ \ "publicSubsidies":0.005 \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "paperCategoryId":"${List1}", \ \ \ \ \ \ \ \ \ \ \ \ "unitPrice":1.32, \ \ \ \ \ \ \ \ \ \ \ \ "publicSubsidies":0.01 \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "paperCategoryId":"${List2}", \ \ \ \ \ \ \ \ \ \ \ \ "unitPrice":1.55, \ \ \ \ \ \ \ \ \ \ \ \ "publicSubsidies":null \ \ \ \ \ \ \ \ } \ \ \ \ ], \ \ \ \ "paperMillId":"${paperMillId}", \ \ \ \ "time":"${Datatime}" }
${reps} Post On Session ZTBT recycle-service/admin/paperMillCategory/update/paper-mill-category-price ${data.encode('utf-8')}
Should Be Equal As Strings ${reps.json()["message"]} successful
*** Keywords ***

1-Client/__init__.robot → 2-Background_system(Test)/1.2-enterprise_management/__init__.robot

0
2-Background_system(Test)/1.2-enterprise_management/__init__.txt

50
2-Background_system(Test)/1.2-enterprise_management/enterprise-management.robot

@ -0,0 +1,50 @@
*** Settings ***
Library RequestsLibrary
Library Collections
Library DateTime
Library urllib3
*** Variables ***
${header} {'X-APP-ID':'470236309865238555','Authorization':'${gettoken}','Content-Type':'application/json'}
${URL} https://api-ops-uec-test.qniao.cn
*** Test Cases ***
Find_enterprise
#查找企业基本信息
Disable Warnings
Create Session ZTBT https://api-ops-ztb-test.qniao.cn ${header}
${reps} Get On Session ZTBT recycle-user-center/admin/get/enterprise-profile-list params=pageNum=1&pageSize=10
${records} Get From Dictionary ${reps.json()["data"]} records #企业列表
FOR ${items} IN @{records}
${enterpriseName} Get From Dictionary ${items} enterpriseName #企业名称
${enterpriseId} Get From Dictionary ${items} enterpriseId #企业id
Exit For Loop If '${enterpriseName}'=='${paperMilld_name}'
END
Set Global Variable ${enterpriseId}
Set Global Variable ${enterpriseName}
get_enterprise-profile-list
#获取企业列表
Create Session ZTBT ${URL} ${header}
${reps} Get On Session ZTBT recycle-user-center/admin/get/enterprise-profile-list pageNum=1&pageSize=10
log ${reps.json()}
get_user-list
#获取关联用户信息
Create Session ZTBT ${URL} ${header}
${reps} Get On Session ZTBT uec/admin/get/user/user-list pageNum=1&pageSize=30&keyword=133
log ${reps.json()}
Upload_pictures
#上传图片
#${dict} Create Dictionary Content-Type=image/jpeg filename=20210803.jpg
#Create Session ZTBT ${URL} ${dict}
${filepath} Evaluate open('E:/lyl/图片/16pic_6879381_b.jpg','rb')
${image} Evaluate open('E:/lyl/图片/16pic_6879381_b.jpg','rb')
${file} Create Dictionary filepath=${filepath} image=${image}
Create Session ZTBT ${URL}
log ${file}
${result} Post On Session ZTBT recycle-user-center/upload/image files=${file}
${pictures} Get From Dictionary ${result.json()} data
log ${result.content}
Set Global Variable ${pictures}

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

@ -0,0 +1,80 @@
*** Settings ***
Library DateTime
Library Collections
Library RequestsLibrary
Library String
*** Variables ***
${URL} http://api-ops-ztb-test.qniao.cn
${header} {'X-APP-ID':'470236309865238555','Authorization':'${gettoken}','Content-Type':'application/json'}
${psc_url} http://api-ops-psc-test.qniao.cn
*** Test Cases ***
get_contract_list
#获取生效中的合同列表
Create Session ZTBT ${URL} ${header}
${response} Get On Session ZTBT recycle-service/admin/contract/get/page-list params=pageNum=1&pageSize=10&status=1
log ${response.json()}
get_contract_by_paperMilldName
#通过纸厂查找合同
Create Session ZTBT ${URL} ${header}
${reps} Get On Session ZTBT recycle-service/admin/contract/get/page-list params=pageNum=1&pageSize=10&status=1&buyerEnterpriseId=${enterpriseId}
log ${reps.json()}
Seller_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
log ${reps.json()}
${data} Get From Dictionary ${reps.json()} data #获取企业列表
FOR ${items} IN @{data}
${sellerEnterpriseName} Get From Dictionary ${items} enterpriseName #卖方企业名称
${sellerEnterpriseId} Get From Dictionary ${items} enterpriseId #卖方企业id
${seller_id} Get From Dictionary ${items} id #企业标识符
Exit For Loop If '${enterpriseName}'=='企业'
END
Set Global Variable ${seller_id}
Set Global Variable ${sellerEnterpriseName}
Set Global Variable ${sellerEnterpriseId}
Buyer_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
log ${reps.json()}
${data} Get From Dictionary ${reps.json()} data #获取企业列表
FOR ${items} IN @{data}
${buyerEnterpriseName} Get From Dictionary ${items} enterpriseName #买方企业名称
${buyerEnterpriseId} Get From Dictionary ${items} enterpriseId #买方企业id
${buyer_id} Get From Dictionary ${items} id #企业标识符
Exit For Loop If '${enterpriseName}'=='${paperMilld_name}'
END
Set Global Variable ${buyer_id}
Set Global Variable ${buyerEnterpriseName}
Set Global Variable ${buyerEnterpriseId}
buyer-paper-mill-categories_list
#买方纸厂品类
Create Session ZTBT ${URL} ${header}
${reps} Get On Session ZTBT recycle-service/admin/contract/get/buyer-paper-mill-categories/list params=enterpriseId=${enterpriseId}
log ${reps.json()}
${category_data} Get From Dictionary ${reps.json()} data #获取纸厂所有品类
${category_value} Evaluate random.choice(${category_data}) random #获取随机品类信息
log to console \nvalue: ${category_value}
${categoryId} Get From Dictionary ${category_value} categoryId #获取品类id
${categoryName} Get From Dictionary ${category_value} categoryName #品类名称
${paperMillId} Get From Dictionary ${category_value} paperMillId #纸厂id
Set Global Variable ${categoryId}
Set Global Variable ${categoryName}
Set Global Variable ${paperMillId}
create_contract
#创建纸厂合同
Create Session ZTBT ${URL} ${header}
${datatime} Get Current Date result_format=%Y-%m-%d
${New_DataTime} Add Time To Date ${datatime} 10 days
${str_time} Get Substring ${New_DataTime} 0 10
${data} Set Variable { \ \ \ \ "contractCategories":[ \ \ \ \ \ ], \ \ \ \ "limitLine":null, \ \ \ \ "accountPeriod":[ \ \ \ \ \ \ \ \ 30 \ \ \ \ ], \ \ \ \ "settleRules":0, \ \ \ \ "isSubsidyAndDeductIncludeTax":0, \ \ \ \ "settlePriceIncludeTaxSettleRules":0, \ \ \ \ "contractType":"0", \ \ \ \ "contractNo":"${datatime}合同", \ \ \ \ "accountPeriodType":0, \ \ \ \ "sellerEnterpriseId":"${sellerEnterpriseId}", \ \ \ \ "buyerEnterpriseId":"${buyerEnterpriseId}", \ \ \ \ "hasInvoice":1, \ \ \ \ "taxRefundRate":6.5, \ \ \ \ "startDate":"${datatime}", \ \ \ \ "endDate":"${str_time}", \ \ \ \ "signDateStart":"${datatime}", \ \ \ \ "signDateEnd":"${str_time}", \ \ \ \ "buyerEnterpriseName":"${buyerEnterpriseName}", \ \ \ \ "sellerEnterpriseName":"${sellerEnterpriseName}", \ \ \ \ "hasSubsidiesTax":0 }
${reps} Post On Session ZTBT recycle-service/admin/contract/create ${data.encode('utf-8')}
log ${reps.json()}

139
2-Background_system(Test)/1.4-Consignment activities/Consignment_activities.robot

@ -0,0 +1,139 @@
*** Settings ***
Library DateTime
Library Collections
Library RequestsLibrary
Library String
*** Variables ***
${URL} http://api-ops-ztb-test.qniao.cn
${header} {'X-APP-ID':'470236309865238555','Authorization':'${gettoken}','Content-Type':'application/json'}
*** Test Cases ***
proxy-sell-activity_list
#代卖活动列表
Create Session ZTBT ${URL} ${header}
${reps} Get On Session ZTBT recycle-service/admin/proxy-sell-activity/list params=pageNum=1&pageSize=10&status=1
${records} Get From Dictionary ${reps.json()["data"]} records #代卖活动列表
${value} Evaluate random.choice(${records}) random
log to console \nvalue: ${value}
${settlementModes} Get From Dictionary ${value} settlementModes #代卖活动结算方式
${settlementMode} Set Variable If '${settlementModes}'=='1' 1 0
Set Global Variable ${settlementMode}
get_paper-mill-list
#获取纸厂列表
Create Session ZTBT ${URL} ${header}
${reps} Get On Session ZTBT recycle-service/admin/paperMill/get/paper-mill-list params=pageNum=1&pageSize=30&enableSalesAgent=1
${records} Get From Dictionary ${reps.json()["data"]} records #获取纸厂列表
FOR ${items} IN @{records}
${shortName} Get From Dictionary ${items} shortName #纸厂简称
${PaperMillId} Get From Dictionary ${items} id #纸厂id
Exit For Loop If '${shortName}'=='宇茂纸业'
END
Set Global Variable ${shortName}
Set Global Variable ${PaperMillId}
factory-licence-list
#纸厂企业对照表
Create Session ZTBT ${URL} ${header}
${reps} Get On Session ZTBT recycle-user-center/admin/get/factory-licence-list params=pageNum=1&pageSize=30
get-Transaction subject
#获取交易主体
Create Session ZTBT ${URL} ${header}
${reps} Get On Session ZTBT recycle-service/admin/transaction-main-enterprise/list
${交易数据} Get From Dictionary ${reps.json()} data
#随机获取交易主体
${交易信息} Evaluate random.choice(${交易数据}) random
log to console \nvalue:${交易信息}
${交易主体id} Get From Dictionary ${交易信息} id #交易主体id
${交易主体name} Get From Dictionary ${交易信息} name #交易主体name
Set Global Variable ${交易主体id}
Set Global Variable ${交易主体name}
user_search
#参与用户
Create Session ZTBT ${URL} ${header}
${reps} Get On Session ZTBT recycle-service/admin/proxy-sell-activity/user/search
${data} Get From Dictionary ${reps.json()} data #用户列表
FOR ${items} IN @{data}
${userId} Get From Dictionary ${items} userId #用户id
${phone} Get From Dictionary ${items} phone #用户手机号
Exit For Loop If '${phone}'=='15014242835'
END
Set Global Variable ${userId}
get_paper-mill-category
#获取纸厂品类
Create Session ZTBT ${URL} ${header}
${reps} Get On Session ZTBT recycle-service/admin/paperMill/get/paper-mill-category/${PaperMillId}
${data} Get From Dictionary ${reps.json()} data #纸厂品类列表
${value} Evaluate random.choice(${data}) random
log to console \nvalue: ${value}
${categoryName} Get From Dictionary ${value} categoryName #品类名称
${paperMillCategoryId} Get From Dictionary ${value} paperMillCategoryId #品类id
Set Global Variable ${categoryName}
Set Global Variable ${paperMillCategoryId}
get_mill-supplier-list
#获取纸厂供应商列表
Create Session ZTBT ${URL} ${header}
${reps} Get On Session ZTBT recycle-service/get/mill-supplier-list/${PaperMillId}
${data} Get From Dictionary ${reps.json()} data #供应商列表
${supplier_value} Evaluate random.choice(${data}) random
log to console \nvalue: ${supplier_value}
${account} Get From Dictionary ${supplier_value} account #供应商名称
${merchantAccountId} Get From Dictionary ${supplier_value} merchantAccountId #供应商id
Set Global Variable ${account}
Set Global Variable ${merchantAccountId}
Upload_pictures
#上传本地图片
#${dict} Create Dictionary Content-Type=image/jpeg filename=20210803.jpg
#Create Session ZTBT ${URL} ${dict}
${filepath} Evaluate open('E:/lyl/图片/21042217001449712.png','rb')
${image} Evaluate open('E:/lyl/图片/21042217001449712.png','rb')
${file} Create Dictionary filepath=${filepath} image=${image}
Create Session ZTBT ${URL}
log ${file}
${result} Post On Session ZTBT recycle-user-center/upload/image files=${file}
${pictures} Get From Dictionary ${result.json()} data
log ${result.content}
Set Global Variable ${pictures}
saveOrUpdate-2
#新增代卖活动(2次)
Create Session ZTBT ${URL} ${header}
${datatime} Get Time
${DT} Add Time To Date ${datatime} 2 days
${DT_str} Get Substring ${DT} 0 19
${activity_data} Set Variable { \ \ \ \ "id":null, \ \ \ \ "activityName":"${shortName}-两次", \ \ \ \ "paperMillId":"${PaperMillId}", \ \ \ \ "millSupplierId":"${merchantAccountId}", \ \ \ \ "settlementModes":1, \ \ \ \ "tradeOwnerName":"${交易主体name}", \ \ \ \ "tradeOwnerId":"${交易主体id}", \ \ \ \ "isEntire":0, \ \ \ \ "agreedDeliveryWeight":100000, \ \ \ \ "ruleUrl":"${pictures}", \ \ \ \ "paperMillPaperCategoriesList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "paperMillPaperCategoryId":"${paperMillCategoryId}", \ \ \ \ \ \ \ \ \ \ \ \ "paperMillPaperCategoryPrice":1.23, \ \ \ \ \ \ \ \ \ \ \ \ "paperMillPaperCategorySubsidyPrice":0.01 \ \ \ \ \ \ \ \ } \ \ \ \ ], \ \ \ \ "activityId":null, \ \ \ \ "users":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "userId":"${userId}", \ \ \ \ \ \ \ \ \ \ \ \ "paymentModes":1, \ \ \ \ \ \ \ \ \ \ \ \ "surcharge":0.015 \ \ \ \ \ \ \ \ } \ \ \ \ ], \ \ \ \ "factorys":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "factoryId":null, \ \ \ \ \ \ \ \ \ \ \ \ "paymentModes":0, \ \ \ \ \ \ \ \ \ \ \ \ "surcharge":0 \ \ \ \ \ \ \ \ } \ \ \ \ ], \ \ \ \ "startTime":"${datatime}", \ \ \ \ "endTime":"${DT_str}" }
${reps} Post On Session ZTBT recycle-service/admin/proxy-sell-activity/saveOrUpdate ${activity_data.encode('utf-8')}
saveOrUpdate-1
#新增代卖活动(1次)
Create Session ZTBT ${URL} ${header}
${datatime} Get Time
${DT} Add Time To Date ${datatime} 2 days
${DT_str} Get Substring ${DT} 0 19
${activity_data} Set Variable { \ \ \ \ "id":null, \ \ \ \ "activityName":"${shortName}-一次", \ \ \ \ "paperMillId":"${PaperMillId}", \ \ \ \ "millSupplierId":"${merchantAccountId}", \ \ \ \ "settlementModes":0, \ \ \ \ "tradeOwnerName":"${交易主体name}", \ \ \ \ "tradeOwnerId":"${交易主体id}", \ \ \ \ "isEntire":0, \ \ \ \ "agreedDeliveryWeight":100000, \ \ \ \ "ruleUrl":"${pictures}", \ \ \ \ "paperMillPaperCategoriesList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "paperMillPaperCategoryId":"${paperMillCategoryId}", \ \ \ \ \ \ \ \ \ \ \ \ "paperMillPaperCategoryPrice":1.33, \ \ \ \ \ \ \ \ \ \ \ \ "paperMillPaperCategorySubsidyPrice":0.015 \ \ \ \ \ \ \ \ } \ \ \ \ ], \ \ \ \ "activityId":null, \ \ \ \ "users":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "userId":"${userId}", \ \ \ \ \ \ \ \ \ \ \ \ "paymentModes":1, \ \ \ \ \ \ \ \ \ \ \ \ "surcharge":0.02 \ \ \ \ \ \ \ \ } \ \ \ \ ], \ \ \ \ "factorys":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "factoryId":null, \ \ \ \ \ \ \ \ \ \ \ \ "paymentModes":0, \ \ \ \ \ \ \ \ \ \ \ \ "surcharge":0 \ \ \ \ \ \ \ \ } \ \ \ \ ], \ \ \ \ "startTime":"${datatime}", \ \ \ \ "endTime":"${DT_str}" }
${reps} Post On Session ZTBT recycle-service/admin/proxy-sell-activity/saveOrUpdate ${activity_data.encode('utf-8')}
proxy-sell-activity_list1
#代卖活动列表
Create Session ZTBT ${URL} ${header}
${reps} Get On Session ZTBT recycle-service/admin/proxy-sell-activity/list params=pageNum=1&pageSize=10&status=1
${records} Get From Dictionary ${reps.json()["data"]} records #活动列表
FOR ${items} IN @{records}
${Activity_id} Get From Dictionary ${items} id #获取活动id
${activityName} Get From Dictionary ${items} activityName #获取活动名称
Exit For Loop If '${activityName}'=='${shortName}-一次'
END
Set Global Variable ${Activity_id}
shutActivity
#结束活动
Create Session ZTBT ${URL} ${header}
${data} Set Variable {"activityId":"${Activity_id}"}
${reps} Post On Session ZTBT recycle-service/admin/proxy-sell-activity/shutActivity ${data.encode('utf-8')}
Should Be Equal As Strings ${reps.json()["message"]} successful

2-Background_system/1-Consignment management/1-appointment.robot → 2-Background_system(Test)/2.1-Consignment management/1-appointment.robot

@ -1,25 +1,50 @@
*** Settings *** *** Settings ***
Documentation 预约送货
Library RequestsLibrary Library RequestsLibrary
Library Collections Library Collections
Library DateTime Library DateTime
*** Variables *** *** Variables ***
${header} {'X-APP-ID':'470236309865238555','Authorization':'Token 6b08add42d6bcf73abb935b2adf83525','Content-Type':'application/json'}
${header} {'X-APP-ID':'470236309865238555','Authorization':'${gettoken}','Content-Type':'application/json'}
${URL} http://api-ops-ztb-test.qniao.cn ${URL} http://api-ops-ztb-test.qniao.cn
*** Test Cases *** *** Test Cases ***
get_paper-mill-order-reservation-list
Create Session ZTBT ${URL} ${header}
${reps_data} Get On Session ZTBT recycle-service/admin/customer-service/get/paper-mill-order-reservation-list params=pageNum=1&pageSize=10&status=&orderId=${orderId}
log ${reps_data.json()}
#获取订单编号${orderId}、纸厂id${paperMillId}、订单类型${orderType}
${orderId} Get From Dictionary ${reps_data.json()["data"]["records"][0]} orderId #订单编号
${paperMillId} Get From Dictionary ${reps_data.json()["data"]["records"][0]} paperMillId #纸厂id
${id} Get From Dictionary ${reps_data.json()["data"]["records"][0]} id #预约id
${orderType} Get From Dictionary ${reps_data.json()["data"]["records"][0]} orderType #订单类型
${carNoList} Get From Dictionary ${reps_data.json()["data"]["records"][0]} carNoList #车辆信息列表
${paperMillName} Get From Dictionary ${reps_data.json()["data"]["records"][0]} paperMillName #纸厂名称
${sellerReservationDate} Get From Dictionary ${reps_data.json()["data"]["records"][0]} sellerReservationDate #送货时间
#随机获取车辆信息
${carList} Evaluate random.choice(${carNoList}) random
log to console \nvalue:${carList}
Should Be Equal As Strings ${reps_data.json()["message"]} successful
Set Global Variable ${orderId}
Set Global Variable ${paperMillId}
Set Global Variable ${id}
Set Global Variable ${paperMillName}
Set Global Variable ${sellerReservationDate}
Set Global Variable ${orderType}
Set Global Variable ${carList}
reservation-list reservation-list
#${header} Create Dictionary X-APP-ID=470236309865238555 Authorization=Token 6b08add42d6bcf73abb935b2adf83525 #${header} Create Dictionary X-APP-ID=470236309865238555 Authorization=Token 6b08add42d6bcf73abb935b2adf83525
#获取预约列表信息 #获取预约列表信息
Create Session ZTBT http://api-ops-ztb-test.qniao.cn ${header}
${reps_data} Get On Session ZTBT recycle-service/admin/customer-service/get/paper-mill-order-reservation-list params=pageNum=1&pageSize=20&status=
Create Session ZTBT ${URL} ${header}
${reps_data} Get On Session ZTBT recycle-service/admin/customer-service/get/paper-mill-order-reservation-list params=pageNum=1&pageSize=10&status=
log ${reps_data.json()} log ${reps_data.json()}
#获取订单编号${orderId}、纸厂id${paperMillId}、订单类型${orderType} #获取订单编号${orderId}、纸厂id${paperMillId}、订单类型${orderType}
${orderId} Get From Dictionary ${reps_data.json()["data"]["records"][0]} orderId #订单编号 ${orderId} Get From Dictionary ${reps_data.json()["data"]["records"][0]} orderId #订单编号
${paperMillId} Get From Dictionary ${reps_data.json()["data"]["records"][0]} paperMillId #纸厂id ${paperMillId} Get From Dictionary ${reps_data.json()["data"]["records"][0]} paperMillId #纸厂id
${id} Get From Dictionary ${reps_data.json()["data"]["records"][0]} id #预约id ${id} Get From Dictionary ${reps_data.json()["data"]["records"][0]} id #预约id
${orderType} Get From Dictionary ${reps_data.json()["data"]["records"][0]} orderType #订单类型 ${orderType} Get From Dictionary ${reps_data.json()["data"]["records"][0]} orderType #订单类型
${carNoList} Get From Dictionary ${reps_data.json()["data"]["records"][0]} carNoList #车辆信息
${carNoList} Get From Dictionary ${reps_data.json()["data"]["records"][0]} carNoList #车辆信息列表
${paperMillName} Get From Dictionary ${reps_data.json()["data"]["records"][0]} paperMillName #纸厂名称 ${paperMillName} Get From Dictionary ${reps_data.json()["data"]["records"][0]} paperMillName #纸厂名称
${sellerReservationDate} Get From Dictionary ${reps_data.json()["data"]["records"][0]} sellerReservationDate #送货时间 ${sellerReservationDate} Get From Dictionary ${reps_data.json()["data"]["records"][0]} sellerReservationDate #送货时间
#随机获取车辆信息 #随机获取车辆信息
@ -51,15 +76,15 @@ get-supplier
log to console \nvalue: ${value} log to console \nvalue: ${value}
${supplier_id} Get From Dictionary ${value} id #供应商id ${supplier_id} Get From Dictionary ${value} id #供应商id
${millSupplierName} Get From Dictionary ${value} name #供应商名称 ${millSupplierName} Get From Dictionary ${value} name #供应商名称
Set Suite Variable ${supplier_id}
Set Suite Variable ${millSupplierName}
Set Global Variable ${supplier_id}
Set Global Variable ${millSupplierName}
Submit-appointment Submit-appointment
#${headers} Create Dictionary Content-Type=application/json X-APP-ID=470236309865238555 Authorization=Token 6b08add42d6bcf73abb935b2adf83525 #${headers} Create Dictionary Content-Type=application/json X-APP-ID=470236309865238555 Authorization=Token 6b08add42d6bcf73abb935b2adf83525
#提交预约信息 #提交预约信息
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 {"attention":"${orderId}","buyerReservationDate":"${datatime}", "id":"${id}","millDeliveryOrderId":"${orderId}","millSupplierId":"${supplier_id}","millSupplierName":"${millSupplierName}","proxySellerSettleType":1,"scrapeOrderId":"${orderId}"}
${data} Set Variable {"attention":"${orderId}","buyerReservationDate":"${datatime}", "id":"${id}","millDeliveryOrderId":"${orderId}","millSupplierId":"${supplier_id}","millSupplierName":"${millSupplierName}","proxySellerSettleType":0,"scrapeOrderId":"${orderId}"}
log ${data} log ${data}
${reps} Post On Session ZTBT recycle-service/admin/customer-service/update/reservation ${data.encode('utf-8')} ${reps} Post On Session ZTBT recycle-service/admin/customer-service/update/reservation ${data.encode('utf-8')}
Should Be Equal As Strings ${reps.json()["message"]} successful Should Be Equal As Strings ${reps.json()["message"]} successful

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

@ -1,23 +1,26 @@
*** Settings *** *** Settings ***
Documentation 上传磅单-常规
Test Timeout 10 seconds
Library Collections Library Collections
Library RequestsLibrary Library RequestsLibrary
Library DateTime Library DateTime
Library requests Library requests
*** Variables *** *** Variables ***
${header} {'X-APP-ID':'470236309865238555','Authorization':'Token 6b08add42d6bcf73abb935b2adf83525','Content-Type':'application/json'}
${header} {'X-APP-ID':'470236309865238555','Authorization':'${gettoken}','Content-Type':'application/json'}
${URL} http://api-ops-ztb-test.qniao.cn ${URL} http://api-ops-ztb-test.qniao.cn
${filepath} E:\lyl\图片\ChMkKWCUz0SIX9MmADmjEvANMxkAAOa3QAAAAAAOaMq795.jpg
*** Test Cases *** *** Test Cases ***
get-order-item-list get-order-item-list
#查找预约的订单列表
#查找预约的订单列表
Create Session ZTBT ${URL} ${header} Create Session ZTBT ${URL} ${header}
${reps} Get On Session ZTBT recycle-service/admin/customer-service/get/proxy-order-item-list params=orderType=${orderType} &pageNum=1&pageSize=10&status=51&orderId=${orderId} ${reps} Get On Session ZTBT recycle-service/admin/customer-service/get/proxy-order-item-list params=orderType=${orderType} &pageNum=1&pageSize=10&status=51&orderId=${orderId}
log ${reps.json()} log ${reps.json()}
${orderItemId} Get From Dictionary ${reps.json()["data"]["records"][0]} orderItemId #订单项编号 ${orderItemId} Get From Dictionary ${reps.json()["data"]["records"][0]} orderItemId #订单项编号
${bizOwnerName} Get From Dictionary ${reps.json()["data"]["records"][0]} bizOwnerName #业务归属人name
${bizOwnerId} Get From Dictionary ${reps.json()["data"]["records"][0]} bizOwnerId #业务归属人id
Set Global Variable ${orderItemId} Set Global Variable ${orderItemId}
Should Be Equal As Strings ${reps.json()["data"]["records"][0]["orderId"]} ${orderId}
Should Be Equal ${reps.json()["data"]["records"][0]["orderId"]} ${orderId}
get-order-item-details get-order-item-details
#查看订单列表详情 #查看订单列表详情
@ -32,14 +35,15 @@ get-order-item-details
${publicSubsidies} Get From Dictionary ${reps.json()["data"]["orderItems"][0]} publicSubsidies #公开补贴 ${publicSubsidies} Get From Dictionary ${reps.json()["data"]["orderItems"][0]} publicSubsidies #公开补贴
${millSupplierId} Get From Dictionary ${reps.json()["data"]} millSupplierId #纸厂供应商ID ${millSupplierId} Get From Dictionary ${reps.json()["data"]} millSupplierId #纸厂供应商ID
${paperMillSupplierName} Get From Dictionary ${reps.json()["data"]} paperMillSupplierName #纸厂供应商名称 ${paperMillSupplierName} Get From Dictionary ${reps.json()["data"]} paperMillSupplierName #纸厂供应商名称
${settleUtiPrice} Evaluate ${unitPrice}+${publicSubsidies} #结算单价
${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 ${contractId} Get From Dictionary ${reps.json()["data"]["orderItems"][0]} contractId #合同id
log ${contractId} log ${contractId}
Set Global Variable ${contractId} Set Global Variable ${contractId}
Set Global Variable ${unitSurcharge} Set Global Variable ${unitSurcharge}
Set Global Variable ${paperCategoryId} Set Global Variable ${paperCategoryId}
Set Global Variable ${settleUtiPrice} Set Global Variable ${settleUtiPrice}
log ${reps.json()}
Set Global Variable ${unitPrice} Set Global Variable ${unitPrice}
Set Global Variable ${publicSubsidies} Set Global Variable ${publicSubsidies}
Set Global Variable ${millSupplierId} Set Global Variable ${millSupplierId}
@ -50,12 +54,15 @@ get-order-item-details
get-Transaction subject get-Transaction subject
#获取交易主体 #获取交易主体
Create Session ZTBT ${URL} ${header} Create Session ZTBT ${URL} ${header}
${reps} Get On Session ZTBT recycle-service/admin/transaction-main-enterprise/list/name
${交易} Get From Dictionary ${reps.json()} data
${reps} Get On Session ZTBT recycle-service/admin/transaction-main-enterprise/list
${交易数据} Get From Dictionary ${reps.json()} data
#随机获取交易主体 #随机获取交易主体
${交易主体} Evaluate random.choice(${交易}) random
log to console \nvalue:${交易主体}
Set Global Variable ${交易主体}
${交易信息} Evaluate random.choice(${交易数据}) random
log to console \nvalue:${交易信息}
${交易主体id} Get From Dictionary ${交易信息} id #交易主体id
${交易主体name} Get From Dictionary ${交易信息} name #交易主体name
Set Global Variable ${交易主体id}
Set Global Variable ${交易主体name}
get-Warehouse get-Warehouse
#获取所属仓库 #获取所属仓库
@ -72,16 +79,16 @@ get-Source of funds
Create Session ZTBT ${URL} ${header} Create Session ZTBT ${URL} ${header}
${reps} Get On Session ZTBT recycle-service/admin/fund-source/get/list ${reps} Get On Session ZTBT recycle-service/admin/fund-source/get/list
log ${reps.json()} log ${reps.json()}
#@{data} Get From Dictionary ${reps.json()} data
${name} Get From Dictionary ${reps.json()["data"][5]} name #资金来源名称
${id} Get From Dictionary ${reps.json()["data"][5]} id #资金来源id
${data} Get From Dictionary ${reps.json()} data
FOR ${item} IN @{data}
log ${item}
${isDefault} Get From Dictionary ${item} isDefault #获取启用状态
${name} Get From Dictionary ${item} name #获取name
${id} Get From Dictionary ${item} id #获取id
Exit For Loop If '${isDefault}'=='1'
END
Set Global Variable ${name} Set Global Variable ${name}
Set Global Variable ${id} Set Global Variable ${id}
#FOR ${isDefault} IN @{data}
#${isDefault} Set Variable 1
#Run Keyword If ${isDefault}==1 log ${reps.json()["data"][5]["name"]}
#Set Global Variable ${isDefault}
#\ Run Keyword If '${isDefault}'==5 log @{data}
get-contract-list get-contract-list
#获取订单纸厂的所有合同信息 #获取订单纸厂的所有合同信息
@ -130,6 +137,8 @@ get_contract_by_id
${isSubsidyAndDeductIncludeTax} Get From Dictionary ${reps.json()["data"]} isSubsidyAndDeductIncludeTax #纸厂补贴是否含税 ${isSubsidyAndDeductIncludeTax} Get From Dictionary ${reps.json()["data"]} isSubsidyAndDeductIncludeTax #纸厂补贴是否含税
${receivableSettlementRules} Get From Dictionary ${reps.json()["data"]} settleRules #应收金额结算规则 ${receivableSettlementRules} Get From Dictionary ${reps.json()["data"]} settleRules #应收金额结算规则
${settlePriceIncludeTaxSettleRules} Get From Dictionary ${reps.json()["data"]} settlePriceIncludeTaxSettleRules #含税结算单价结算规则 ${settlePriceIncludeTaxSettleRules} Get From Dictionary ${reps.json()["data"]} settlePriceIncludeTaxSettleRules #含税结算单价结算规则
${advanceFund} Set Variable If '${advanceFund}'=='${None}' 0 ${advanceFund}
${proxyPaySurcharge} Set Variable If '${proxyPaySurcharge}'=='${None}' 0 ${proxyPaySurcharge}
Set Global Variable ${advanceFund} Set Global Variable ${advanceFund}
Set Global Variable ${buyerEnterpriseId} Set Global Variable ${buyerEnterpriseId}
Set Global Variable ${taxRefundRate} Set Global Variable ${taxRefundRate}
@ -159,18 +168,29 @@ Upload_pictures
get_repeat_proxy-order get_repeat_proxy-order
#获取重复订单信息 #获取重复订单信息
Create Session ZTBT ${URL} ${header} Create Session ZTBT ${URL} ${header}
#${datatime}
${reps} Get On Session ZTBT recycle-service/admin/customer-service/get/repeat/proxy-order params=orderItemId=${orderItemId}&plateNumber=${carList}&settleWeight=13550&weighingDate=${datatime}&orderType=${orderType}
log ${reps.json()}
${reps} Get On Session ZTBT recycle-service/admin/customer-service/get/repeat/proxy-order params=orderItemId=${orderItemId}&plateNumber=${carList}&settleWeight=17550&weighingDate=${datatime}&orderType=${orderType}&settlePrice= 41953.05
${records} Get From Dictionary ${reps.json()["data"]} records #获取重复订单列表
${orderItemId_list} Create List
#sleep 0.5
FOR ${items} IN @{records}
${orderItemId} Get From Dictionary ${items} orderItemId #重复订单项编号
Append To List ${orderItemId_list} '''${orderItemId}'''
END
Should Be Equal As Strings ${reps.json()["message"]} successful Should Be Equal As Strings ${reps.json()["message"]} successful
Set Global Variable ${orderItemId_list}
repeat_proxy-order
Create Session ZTBT ${URL} ${header}
${data} Set Variable { \ \ \ \ "orderItemId":"${orderItemId}", \ \ \ \ "remark":"${datatime}", \ \ \ \ "repeatOrderItem":${orderItemId_list} }
${reps} Post On Session ZTBT recycle-service/admin/customer-service/confirm/repeat/proxy-order ${data.encode('utf-8')}
weightnote weightnote
#提交磅单 #提交磅单
Create Session ZTBT ${URL} ${header} Create Session ZTBT ${URL} ${header}
${datatime} Get Current Date result_format=%Y-%m-%d ${datatime} Get Current Date result_format=%Y-%m-%d
${data} Set Variable { \ \ \ \ "deductedPoint":9.666666666666666, \ \ \ \ "imageUrl":["${pictures}"], \ \ \ \ "orderItemId":"${orderItemId}", \ \ \ \ "unitPrice":"${unitPrice}", \ \ \ \ "paperCategoryId":"${paperCategoryId}", \ \ \ \ "millSupplierId":"${millSupplierId}", \ \ \ \ "millSupplierName":"${paperMillSupplierName}", \ \ \ \ "settleUtiPriceIncludeTax":2.2677065, \ \ \ \ "settleUtiPriceIncludeTaxType":1, \ \ \ \ "receivableAdjustMoney":"10", \ \ \ \ "refundSubsidy":0.002, \ \ \ \ "adjustMoney":"30", \ \ \ \ "collectionCharges":0, \ \ \ \ "advanceFund":0, \ \ \ \ "contractId":"${contractId}", \ \ \ \ "warehouseName":"${所属仓库}", \ \ \ \ "weightDay":"${datatime}", \ \ \ \ "settleDay":"${datatime}", \ \ \ \ "transactionMainEnterpriseName":"${交易主体}", \ \ \ \ "proxySellerSettleType":"${proxySellerSettleType}", \ \ \ \ "receivableSettlementRules":"${receivableSettlementRules}", \ \ \ \ "isInvoice":"${hasInvoice}", \ \ \ \ "invoicePoint":"${taxRefundRate}", \ \ \ \ "deductionNotes":"2021年8月9号", \ \ \ \ "plateNumber":"${carList}", \ \ \ \ "settlePriceIncludeTaxSettleRules":"${settlePriceIncludeTaxSettleRules}", \ \ \ \ "settleUtiPrice":"${settleUtiPrice}", \ \ \ \ "netWeight":15000, \ \ \ \ "activitySettleType":null, \ \ \ \ "unitSurcharge":"${unitSurcharge}", \ \ \ \ "deliveryImageUrls":[], \ \ \ \ "publicSubsidies":"${publicSubsidies}", \ \ \ \ "isSubsidyAndDeductIncludeTax":1, \ \ \ \ "orderId":"621039556547973120", \ \ \ \ "settleWeight":13550, \ \ \ \ "deductedWeight":1.45, \ \ \ \ "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":"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 \ \ \ \ \ \ \ \ } \ \ \ \ ] }
log ${data} log ${data}
${reps} Post On Session ZTBT recycle-service/admin/proxy-sell/save/weightnote data=${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"]}
${weightNoteId} Get From Dictionary ${reps.json()["data"]} weightNoteId ${weightNoteId} Get From Dictionary ${reps.json()["data"]} weightNoteId
Set Global Variable ${weightNoteId} Set Global Variable ${weightNoteId}

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

@ -0,0 +1,205 @@
*** Settings ***
Documentation 上传磅单-一次付款活动
Library DateTime
Library RequestsLibrary
Library Collections
Library requests
*** Variables ***
${header} {'X-APP-ID':'470236309865238555','Authorization':'${gettoken}','Content-Type':'application/json'}
${URL} http://api-ops-ztb-test.qniao.cn
*** Test Cases ***
get-order-item-list
#查找预约的订单项列表
Create Session ZTBT ${URL} ${header}
${reps} Get On Session ZTBT recycle-service/admin/customer-service/get/proxy-order-item-list params=orderType=${orderType} &pageNum=1&pageSize=10&status=51&orderId=${orderId}
log ${reps.json()}
${records} Get From Dictionary ${reps.json()["data"]} records #获取订单列表
${orderItemId_value} Evaluate random.choice(${records}) random #随机获取订单信息
log to console \nvalue: ${orderItemId_value}
${orderItemId} Get From Dictionary ${orderItemId_value} orderItemId #订单项编号
Set Global Variable ${orderItemId}
#Should Be Equal As Strings ${reps.json()["data"]["records"][0]} orderId=${orderId}
get-order-item-details
#获取订单详情信息
Create Session ZTBT ${URL} ${header}
${reps} Get On Session ZTBT recycle-service/admin/customer-service/get/proxy-order/${orderId} params=orderId=${orderId} &orderItemId=${orderItemId}
${contractId} Get From Dictionary ${reps.json()["data"]["orderItems"][0]} contractId #合同id
${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 #代卖费单价
${settleUtiPriceIncludeTaxType} Get From Dictionary ${reps.json()["data"]["orderItems"][0]} settleUtiPriceIncludeTaxType #含税补贴类型
${publicSubsidies} Set Variable If '${publicSubsidies}'=='${null}' 0 ${publicSubsidies}
${settleUtiPrice}= Evaluate ${unitPrice}+${publicSubsidies} #结算单价
${unitSurcharge} Set Variable If '${unitSurcharge}'=='${None}' 0 ${unitSurcharge}
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 ${unitSurcharge}
Set Global Variable ${settleUtiPriceIncludeTaxType}
get_delivery-info
#获取订单名片信息
Create Session ZTBT ${URL} ${header}
${reps} Get On Session ZTBT recycle-service/admin/proxy-sell/get/proxy-order/delivery-info/${orderItemId}
log ${reps.json()}
${plateNumber} Get From Dictionary ${reps.json()["data"]} plateNumber #车牌号
${settleUtiPrice} Get From Dictionary ${reps.json()["data"]} settleUtiPrice #结算单价
Set Global Variable ${plateNumber}
Set Global Variable ${settleUtiPrice}
get_contract_by_id
#获取下单时绑定的合同
Create Session ZTBT ${URL} ${header}
${reps} Get On Session ZTBT recycle-service/admin/contract/get/detail-by-id params=id=${contractId}
log ${reps.json()}
#获取垫资费、企业ID、应收金额结算规则、含税结算单价结算规则
${advanceFund} Get From Dictionary ${reps.json()["data"]} advanceFund #垫资费
${accountPeriod} Get From Dictionary ${reps.json()["data"]} accountPeriod #账期
${buyerEnterpriseId} Get From Dictionary ${reps.json()["data"]} buyerEnterpriseId #企业id
${settlePriceIncludeTaxSettleRules} Get From Dictionary ${reps.json()["data"]} settlePriceIncludeTaxSettleRules #含税结算单价结算规则
${taxRefundRate} Get From Dictionary ${reps.json()["data"]} taxRefundRate #税点
${proxyPaySurcharge} Get From Dictionary ${reps.json()["data"]} proxyPaySurcharge #代收费
${hasInvoice} Get From Dictionary ${reps.json()["data"]} hasInvoice #是否开票
${accountPeriodType} Get From Dictionary ${reps.json()["data"]} accountPeriodType #账期类型
${isSubsidyAndDeductIncludeTax} Get From Dictionary ${reps.json()["data"]} isSubsidyAndDeductIncludeTax #纸厂补贴是否含税
${receivableSettlementRules} Get From Dictionary ${reps.json()["data"]} settleRules #应收金额结算规则
${settlePriceIncludeTaxSettleRules} Get From Dictionary ${reps.json()["data"]} settlePriceIncludeTaxSettleRules #含税结算单价结算规则
${advanceFund} Set Variable If '${advanceFund}'=='${None}' 0 ${advanceFund}
${proxyPaySurcharge} Set Variable If '${proxyPaySurcharge}'=='${None}' 0 ${proxyPaySurcharge}
Set Global Variable ${advanceFund}
Set Global Variable ${accountPeriod}
Set Global Variable ${buyerEnterpriseId}
Set Global Variable ${taxRefundRate}
Set Global Variable ${proxyPaySurcharge}
Set Global Variable ${hasInvoice}
Set Global Variable ${accountPeriodType}
Set Global Variable ${settlePriceIncludeTaxSettleRules}
Set Global Variable ${isSubsidyAndDeductIncludeTax}
Set Global Variable ${receivableSettlementRules}
Set Global Variable ${settlePriceIncludeTaxSettleRules}
get-contract-list
#获取订单纸厂的所有合同信息
Create Session ZTBT ${URL} ${header}
${reps} Get On Session ZTBT /recycle-service/admin/contract/get/selectable-contract-list params=orderItemId=${orderItemId}
log ${reps.json()}
get-supplier
#获取纸厂供应商
Create Session ZTBT ${URL} ${header}
${reps} Get On Session ZTBT recycle-service/admin/customer-service/get/paper-mill-merchant/${paperMillId} params=paperMillId=${paperMillId}
log ${reps.json()}
get-Source of funds
#获取资金来源
Create Session ZTBT ${URL} ${header}
${reps} Get On Session ZTBT recycle-service/admin/fund-source/get/list
log ${reps.json()}
${data} Get From Dictionary ${reps.json()} data
FOR ${item} IN @{data}
log ${item}
${isDefault} Get From Dictionary ${item} isDefault #获取启用状态
${name} Get From Dictionary ${item} name #获取name
${id} Get From Dictionary ${item} id #获取id
Exit For Loop If '${isDefault}'=='1'
END
Set Global Variable ${name}
Set Global Variable ${id}
get-Warehouse
#获取所属仓库
Create Session ZTBT ${URL} ${header}
${reps} Get On Session ZTBT recycle-service/admin/transaction-main-enterprise/get/warehouse-name
${仓库} Get From Dictionary ${reps.json()} data
#随机获取仓库
${所属仓库} Evaluate random.choice(${仓库}) random
log to console \nvalue:${所属仓库}
Set Global Variable ${所属仓库}
get_proxy-order_delivery-info
#获取订单名片信息
Create Session ZTBT ${URL} ${header}
${reps} Get On Session ZTBT recycle-service/admin/proxy-sell/get/proxy-order/delivery-info/${orderItemId}
log ${reps.json()}
${plateNumber} Get From Dictionary ${reps.json()["data"]} plateNumber #车牌号
${settleUtiPrice} Get From Dictionary ${reps.json()["data"]} settleUtiPrice #结算单价
Set Global Variable ${plateNumber}
Set Global Variable ${settleUtiPrice}
get_paper-mill-category
#获取当前纸厂的所有纸品品类
Create Session ZTBT ${URL} ${header}
${reps} Get On Session ZTBT recycle-service/admin/paperMill/get/paper-mill-category/${paperMillId} params=id=${paperMillId}
log ${reps.json()}
Upload_pictures
#上传图片
#${dict} Create Dictionary Content-Type=image/jpeg filename=20210803.jpg
#Create Session ZTBT ${URL} ${dict}
${filepath} Evaluate open('E:/lyl/图片/16pic_6879381_b.jpg','rb')
${image} Evaluate open('E:/lyl/图片/16pic_6879381_b.jpg','rb')
${file} Create Dictionary filepath=${filepath} image=${image}
Create Session ZTBT ${URL}
log ${file}
${result} Post On Session ZTBT recycle-user-center/upload/image files=${file}
${pictures} Get From Dictionary ${result.json()} data
log ${result.content}
Set Global Variable ${pictures}
get_repeat_proxy-order
#获取重复订单信息
Create Session ZTBT ${URL} ${header}
${reps} Get On Session ZTBT recycle-service/admin/customer-service/get/repeat/proxy-order params=orderItemId=${orderItemId}&plateNumber=${carList}&settleWeight=14800&weighingDate=${datatime}&orderType=${orderType}&settlePrice=29466.6
${records} Get From Dictionary ${reps.json()["data"]} records #获取重复订单列表
${orderItemId_list} Create List
#sleep 0.5
FOR ${items} IN @{records}
${orderItemId} Get From Dictionary ${items} orderItemId
Append To List ${orderItemId_list} '''${orderItemId}'''
END
Should Be Equal As Strings ${reps.json()["message"]} successful
Set Global Variable ${orderItemId_list}
repeat_proxy-order
Create Session ZTBT ${URL} ${header}
${data} Set Variable { \ \ \ \ "orderItemId":"${orderItemId}", \ \ \ \ "remark":"${datatime}", \ \ \ \ "repeatOrderItem":${orderItemId_list} }
${reps} Post On Session ZTBT recycle-service/admin/customer-service/confirm/repeat/proxy-order ${data.encode('utf-8')}
weightnote
#提交磅单
Create Session ZTBT ${URL} ${header}
${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 \ \ \ \ \ \ \ \ } \ \ \ \ ] }
log ${data}
${reps} Post On Session ZTBT recycle-service/admin/proxy-sell/save/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}
audit_weightnote
#磅单审核接口
Create Session ZTBT ${URL} ${header}
${repsonse} Post On Session ZTBT recycle-service/admin/customer-service/audit/weightnote/${weightNoteId}
log ${repsonse.json()}
get_proxy-order
Create Session ZTBT ${URL} ${header}
${reps} Get On Session ZTBT recycle-service/admin/customer-service/get/proxy-order/${orderId} params=orderId=${orderId}&orderItemId=${orderItemId}
log ${reps.json()}
Should Be Equal As Strings ${reps.json()["message"]} successful

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

@ -0,0 +1,188 @@
*** Settings ***
Documentation 上次送货单-两次付款活动
Library DateTime
Library RequestsLibrary
Library Collections
Library requests
*** Variables ***
${header} {'X-APP-ID':'470236309865238555','Authorization':'${gettoken}','Content-Type':'application/json'}
${URL} http://api-ops-ztb-test.qniao.cn
*** Test Cases ***
get-order-item-list
#查找预约的订单项列表
Create Session ZTBT ${URL} ${header}
${reps} Get On Session ZTBT recycle-service/admin/customer-service/get/proxy-order-item-list params=orderType=${orderType} &pageNum=1&pageSize=10&status=51&orderId=${orderId}
log ${reps.json()}
${records} Get From Dictionary ${reps.json()["data"]} records #获取订单列表
${orderItemId_value} Evaluate random.choice(${records}) random #随机获取订单信息
log to console \nvalue: ${orderItemId_value}
${orderItemId} Get From Dictionary ${orderItemId_value} orderItemId #订单项编号
Set Global Variable ${orderItemId}
#Should Be Equal As Strings ${reps.json()["data"]["records"][0]} orderId=${orderId}
get-order-item-details
#获取订单详情信息
Create Session ZTBT ${URL} ${header}
${reps} Get On Session ZTBT recycle-service/admin/customer-service/get/proxy-order/${orderId} params=orderId=${orderId} &orderItemId=${orderItemId}
${contractId} Get From Dictionary ${reps.json()["data"]["orderItems"][0]} contractId #合同id
${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
${publicSubsidies} Set Variable If '${publicSubsidies}'=='${null}' 0 ${publicSubsidies}
${settleUtiPrice}= Evaluate ${unitPrice}+${publicSubsidies} #结算单价
${contractId} Get From Dictionary ${reps.json()["data"]["orderItems"][0]} contractId #合同id
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}
get_delivery-info
#获取订单名片信息
Create Session ZTBT ${URL} ${header}
${reps} Get On Session ZTBT recycle-service/admin/proxy-sell/get/proxy-order/delivery-info/${orderItemId}
log ${reps.json()}
${plateNumber} Get From Dictionary ${reps.json()["data"]} plateNumber #车牌号
${settleUtiPrice} Get From Dictionary ${reps.json()["data"]} settleUtiPrice #结算单价
Set Global Variable ${plateNumber}
Set Global Variable ${settleUtiPrice}
get_contract_by_id
#获取下单时绑定的合同
Create Session ZTBT ${URL} ${header}
${reps} Get On Session ZTBT recycle-service/admin/contract/get/detail-by-id params=id=${contractId}
log ${reps.json()}
#获取垫资费、企业ID、应收金额结算规则、含税结算单价结算规则
${advanceFund} Get From Dictionary ${reps.json()["data"]} advanceFund #垫资费
${accountPeriod} Get From Dictionary ${reps.json()["data"]} accountPeriod #账期
${buyerEnterpriseId} Get From Dictionary ${reps.json()["data"]} buyerEnterpriseId #企业id
${settlePriceIncludeTaxSettleRules} Get From Dictionary ${reps.json()["data"]} settlePriceIncludeTaxSettleRules #含税结算单价结算规则
${taxRefundRate} Get From Dictionary ${reps.json()["data"]} taxRefundRate #税点
${proxyPaySurcharge} Get From Dictionary ${reps.json()["data"]} proxyPaySurcharge #代收费
${hasInvoice} Get From Dictionary ${reps.json()["data"]} hasInvoice #是否开票
${accountPeriodType} Get From Dictionary ${reps.json()["data"]} accountPeriodType #账期类型
${isSubsidyAndDeductIncludeTax} Get From Dictionary ${reps.json()["data"]} isSubsidyAndDeductIncludeTax #纸厂补贴是否含税
${receivableSettlementRules} Get From Dictionary ${reps.json()["data"]} settleRules #应收金额结算规则
${settlePriceIncludeTaxSettleRules} Get From Dictionary ${reps.json()["data"]} settlePriceIncludeTaxSettleRules #含税结算单价结算规则
${advanceFund} Set Variable If '${advanceFund}'=='${None}' 0 ${advanceFund}
${proxyPaySurcharge} Set Variable If '${proxyPaySurcharge}'=='${None}' 0 ${proxyPaySurcharge}
Set Global Variable ${advanceFund}
Set Global Variable ${accountPeriod}
Set Global Variable ${buyerEnterpriseId}
Set Global Variable ${taxRefundRate}
Set Global Variable ${proxyPaySurcharge}
Set Global Variable ${hasInvoice}
Set Global Variable ${accountPeriodType}
Set Global Variable ${settlePriceIncludeTaxSettleRules}
Set Global Variable ${isSubsidyAndDeductIncludeTax}
Set Global Variable ${receivableSettlementRules}
Set Global Variable ${settlePriceIncludeTaxSettleRules}
get-contract-list
#获取订单纸厂的所有合同信息
Create Session ZTBT ${URL} ${header}
${reps} Get On Session ZTBT /recycle-service/admin/contract/get/selectable-contract-list params=orderItemId=${orderItemId}
log ${reps.json()}
get-supplier
#获取纸厂供应商
Create Session ZTBT ${URL} ${header}
${reps} Get On Session ZTBT recycle-service/admin/customer-service/get/paper-mill-merchant/${paperMillId} params=paperMillId=${paperMillId}
log ${reps.json()}
get-Source of funds
#获取资金来源
Create Session ZTBT ${URL} ${header}
${reps} Get On Session ZTBT recycle-service/admin/fund-source/get/list
log ${reps.json()}
${data} Get From Dictionary ${reps.json()} data
FOR ${item} IN @{data}
log ${item}
${isDefault} Get From Dictionary ${item} isDefault #获取启用状态
${name} Get From Dictionary ${item} name #获取name
${id} Get From Dictionary ${item} id #获取id
Exit For Loop If '${isDefault}'=='1'
END
Set Global Variable ${name}
Set Global Variable ${id}
get-Warehouse
#获取所属仓库
Create Session ZTBT ${URL} ${header}
${reps} Get On Session ZTBT recycle-service/admin/transaction-main-enterprise/get/warehouse-name
${仓库} Get From Dictionary ${reps.json()} data
#随机获取仓库
${所属仓库} Evaluate random.choice(${仓库}) random
log to console \nvalue:${所属仓库}
Set Global Variable ${所属仓库}
get_proxy-order_delivery-info
#获取订单名片信息
Create Session ZTBT ${URL} ${header}
${reps} Get On Session ZTBT recycle-service/admin/proxy-sell/get/proxy-order/delivery-info/${orderItemId}
log ${reps.json()}
${plateNumber} Get From Dictionary ${reps.json()["data"]} plateNumber #车牌号
${settleUtiPrice} Get From Dictionary ${reps.json()["data"]} settleUtiPrice #结算单价
Set Global Variable ${plateNumber}
Set Global Variable ${settleUtiPrice}
get_paper-mill-category
#获取当前纸厂的所有纸品品类
Create Session ZTBT ${URL} ${header}
${reps} Get On Session ZTBT recycle-service/admin/paperMill/get/paper-mill-category/${paperMillId} params=id=${paperMillId}
log ${reps.json()}
Upload_pictures
#上传图片
#${dict} Create Dictionary Content-Type=image/jpeg filename=20210803.jpg
#Create Session ZTBT ${URL} ${dict}
${filepath} Evaluate open('E:/lyl/图片/16pic_6879381_b.jpg','rb')
${image} Evaluate open('E:/lyl/图片/16pic_6879381_b.jpg','rb')
${file} Create Dictionary filepath=${filepath} image=${image}
Create Session ZTBT ${URL}
log ${file}
${result} Post On Session ZTBT recycle-user-center/upload/image files=${file}
${pictures} Get From Dictionary ${result.json()} data
log ${result.content}
Set Global Variable ${pictures}
get_repeat/proxy-order
Create Session ZTBT ${URL} ${header}
${datatime} Get Current Date result_format=%Y-%m-%d
${reps} Get On Session ZTBT recycle-service/admin/customer-service/get/repeat/proxy-order params=orderItemId=${orderItemId} &plateNumber=${plateNumber} &netWeight=30000&weighingDate=${datatime}&orderType=3
log ${reps.json()}
weightnote
#提交磅单
Create Session ZTBT ${URL} ${header}
${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}" }
log ${data}
${reps} Post On Session ZTBT recycle-service/admin/proxy-sell/save/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}
audit_weightnote
#磅单审核接口
Create Session ZTBT ${URL} ${header}
${repsonse} Post On Session ZTBT recycle-service/admin/customer-service/audit/weightnote/${weightNoteId}
log ${repsonse.json()}
get_proxy-order
Create Session ZTBT ${URL} ${header}
${reps} Get On Session ZTBT recycle-service/admin/customer-service/get/proxy-order/${orderId} params=orderId=${orderId}&orderItemId=${orderItemId}
log ${reps.json()}
Should Be Equal As Strings ${reps.json()["message"]} successful

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

@ -0,0 +1,77 @@
*** Settings ***
Documentation 运营审核-常规
Library DateTime
Library Collections
Library RequestsLibrary
*** Variables ***
${header} {'X-APP-ID':'470236309865238555','Authorization':'${gettoken}','Content-Type':'application/json'}
${URL} http://api-ops-ztb-test.qniao.cn
*** Test Cases ***
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
log ${reps.json()}
get_paper-mill-order-by-orderItemId
#根据订单编号获取运营审核单
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=${orderItemId}
log ${reps.json()}
${auditRequestId} Get From Dictionary ${reps.json()["data"]["records"][0]} auditRequestId #获取审核id
${weightNoteId} Get From Dictionary ${reps.json()["data"]["records"][0]} weightNoteId #获取磅单id
Set Global Variable ${auditRequestId}
Set Global Variable ${weightNoteId}
get_order-log-detail
#获取订单日志
Create Session ZTBT ${URL} ${header}
${reps} Get On Session ZTBT recycle-service/admin/operation/get/order-log-detail params=orderId=${orderId}&weightNoteId=${weightNoteId}
log ${reps.json()}
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 #结算重量
${surcharge} Set Variable If '${proxySellerSettleType}'=='0' '${unitSurcharge}'*'${netWeight}' '${unitSurcharge}'*'${settleWeight}' #代卖费总额
${paperMillPayAt} Set Variable If '${paperMillPayAt}'=='无账期' null ${paperMillPayAt} #纸厂账期
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}
order-receipt-audit-details
#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":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}" }
${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
get_order-log-detail2
#运营审核驳回操作日志
Create Session ZTBT ${URL} ${header}
${reps} Get On Session ZTBT recycle-service/admin/operation/get/order-log-detail params=orderId=${orderId}&weightNoteId=${weightNoteId} &operationStatus=2
log ${reps.json()}
Should Be Equal As Strings ${reps.json()["message"]} successful
operation_audit
#运营审核确认通过
Create Session ZTBT ${URL} ${header}
${data} Set Variable { \ "auditRequestId":"${auditRequestId}", \ \ \ \ "isPass":1, \ \ \ \ "remark":"${datatime}" }
${reps} Post On Session ZTBT recycle-service/admin/operation/operation/audit ${data.encode('utf-8')}
Should Be Equal As Strings ${reps.json()["message"]} successful

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

@ -0,0 +1,78 @@
*** Settings ***
Documentation 运用审核-一次付款活动
Library RequestsLibrary
Library Collections
Library DateTime
*** Variables ***
${header} {'X-APP-ID':'470236309865238555','Authorization':'${gettoken}','Content-Type':'application/json'}
${URL} http://api-ops-ztb-test.qniao.cn
*** Test Cases ***
get_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
log ${reps.json()}
get_paper-mill-order-by-orderItemId
#根据订单编号获取运营审核单
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=${orderItemId}
log ${reps.json()}
${auditRequestId} Get From Dictionary ${reps.json()["data"]["records"][0]} auditRequestId #获取审核id
${weightNoteId} Get From Dictionary ${reps.json()["data"]["records"][0]} weightNoteId #获取磅单id
Set Global Variable ${auditRequestId}
Set Global Variable ${weightNoteId}
get_order-log-detail
#获取订单日志
Create Session ZTBT ${URL} ${header}
${reps} Get On Session ZTBT recycle-service/admin/operation/get/order-log-detail params=orderId=${orderId}&weightNoteId=${weightNoteId}
log ${reps.json()}
get_order-receipt-audit-details
#查看运营审核详情
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 #结算重量
${surcharge} Set Variable If '${proxySellerSettleType}'=='0' '${unitSurcharge}'*'${netWeight}' '${unitSurcharge}'*'${settleWeight}' #代卖费总额
${paperMillPayAt} Set Variable If '${paperMillPayAt}'=='无账期' null ${paperMillPayAt} #纸厂账期
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-details
#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
get_order-log-detail2
#运营审核驳回操作日志
Create Session ZTBT ${URL} ${header}
${reps} Get On Session ZTBT recycle-service/admin/operation/get/order-log-detail params=orderId=${orderId}&weightNoteId=${weightNoteId} &operationStatus=2
log ${reps.json()}
Should Be Equal As Strings ${reps.json()["message"]} successful
operation_audit
#运营审核确认通过
Create Session ZTBT ${URL} ${header}
${data} Set Variable { \ "auditRequestId":"${auditRequestId}", \ \ \ \ "isPass":1, \ \ \ \ "remark":"${datatime}" }
${reps} Post On Session ZTBT recycle-service/admin/operation/operation/audit ${data.encode('utf-8')}
Should Be Equal As Strings ${reps.json()["message"]} successful
sleep 1

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

@ -0,0 +1,78 @@
*** Settings ***
Documentation 运营审核-两次付款活动
Library RequestsLibrary
Library Collections
Library DateTime
*** Variables ***
${header} {'X-APP-ID':'470236309865238555','Authorization':'${gettoken}','Content-Type':'application/json'}
${URL} http://api-ops-ztb-test.qniao.cn
*** Test Cases ***
get_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
log ${reps.json()}
get_paper-mill-order-by-orderItemId
#根据订单编号获取运营审核单
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=${orderItemId}
log ${reps.json()}
${auditRequestId} Get From Dictionary ${reps.json()["data"]["records"][0]} auditRequestId #获取审核id
${weightNoteId} Get From Dictionary ${reps.json()["data"]["records"][0]} weightNoteId #获取磅单id
Set Global Variable ${auditRequestId}
Set Global Variable ${weightNoteId}
get_order-log-detail
#获取订单日志
Create Session ZTBT ${URL} ${header}
${reps} Get On Session ZTBT recycle-service/admin/operation/get/order-log-detail params=orderId=${orderId}&weightNoteId=${weightNoteId}
log ${reps.json()}
get_order-receipt-audit-details
#查看运营审核详情
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-details
#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
get_order-log-detail2
#运营审核驳回操作日志
Create Session ZTBT ${URL} ${header}
${reps} Get On Session ZTBT recycle-service/admin/operation/get/order-log-detail params=orderId=${orderId}&weightNoteId=${weightNoteId} &operationStatus=2
log ${reps.json()}
Should Be Equal As Strings ${reps.json()["message"]} successful
operation_audit
#运营审核确认通过
Create Session ZTBT ${URL} ${header}
${data} Set Variable { \ "auditRequestId":"${auditRequestId}", \ \ \ \ "isPass":1, \ \ \ \ "remark":"${datatime}" }
${reps} Post On Session ZTBT recycle-service/admin/operation/operation/audit ${data.encode('utf-8')}
Should Be Equal As Strings ${reps.json()["message"]} successful
sleep 1

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

@ -0,0 +1,39 @@
*** Settings ***
Documentation 代卖应付
Library RequestsLibrary
Library Collections
*** Variables ***
${header} {'X-APP-ID':'470236309865238555','Authorization':'${gettoken}','Content-Type':'application/json'}
${url} http://api-ops-psc-test.qniao.cn
${URL1} http://api-ops-ztb-test.qniao.cn
*** Test Cases ***
get_list
#获取财务审核列表
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 #财务第一次确认结算时间
log ${auditedTime.year}
Should Be Equal As Strings ${reps.json()["message"]} successful
Set Global Variable ${auditedTime}
get_order-log-detail
#财务审核驳回操作记录
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
paper-mill-order-receipt-proof-request_audit
#财务审核确认通过
Create Session ZTBT ${url} ${header}
${data} Set Variable {"auditRequestId":"${auditRequestId}","adminId":null,"isPass":1,"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
paper-mill-order-receipt-proof-request_settle
#确认结算
Create Session ZTBT ${url} ${header}
${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')}
sleep 1

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

@ -0,0 +1,33 @@
*** Settings ***
Documentation 代卖应收
Library RequestsLibrary
Library Collections
*** Variables ***
${header} {'X-APP-ID':'470236309865238555','Authorization':'${gettoken}','Content-Type':'application/json'}
${URL} http://api-ops-ztb-test.qniao.cn
*** Test Cases ***
get_paper-payment-order-list
#通过订单编号获取代卖应收列表
Create Session ZTBT ${URL} ${header}
${reps} Get On Session ZTBT recycle-service/admin/operation/get/paper-payment-order-list params=pageNum=1&pageSize=10&orderId=${orderId}
${paymentOrderId} Get From Dictionary ${reps.json()["data"]["records"][0]} id #回款单号
log ${reps.json()}
Set Global Variable ${paymentOrderId}
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}
${receivablePriceIncludeTax} Get From Dictionary ${reps.json()["data"]["items"][0]} receivablePriceIncludeTax #获取应收金额
${noReceivablePrice} Get From Dictionary ${reps.json()["data"]["items"][0]} noReceivablePrice #未回款金额
Set Global Variable ${receivablePriceIncludeTax}
Set Global Variable ${noReceivablePrice}
update_payment-order-status
#确认回款操作
Create Session ZTBT ${URL} ${header}
${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')}
Should Be Equal As Strings ${reps.json()["message"]} successful

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

@ -4,7 +4,7 @@ Library RequestsLibrary
*** Variables *** *** Variables ***
${URL} http://api-ops-psc-test.qniao.cn ${URL} http://api-ops-psc-test.qniao.cn
${header} {'X-APP-ID':'470236309865238555','Authorization':'Token 6b08add42d6bcf73abb935b2adf83525','Content-Type':'application/json'}
${header} {'X-APP-ID':'470236309865238555','Authorization':'${gettoken}','Content-Type':'application/json'}
*** Test Cases *** *** Test Cases ***
get_withdraw-list get_withdraw-list
@ -12,16 +12,17 @@ get_withdraw-list
Create Session ZTBT ${URL} ${header} Create Session ZTBT ${URL} ${header}
${reps} Get On Session ZTBT payment-settlement-center/admin/settlement/get/withdraw-list params=pageNum=1&pageSize=10&isAutoHandle=1&status=&money=&orderId=${tradeOrderId} ${reps} Get On Session ZTBT payment-settlement-center/admin/settlement/get/withdraw-list params=pageNum=1&pageSize=10&isAutoHandle=1&status=&money=&orderId=${tradeOrderId}
log ${reps.json()} log ${reps.json()}
${records} Get From Dictionary ${reps.json()["data"]} records #提现单列表
${value} Evaluate random.choice(${records} ) random
log to console \nvalue: ${value}
${提现id} Get From Dictionary ${value} id #提现id
Set Global Variable ${提现id}
#${records} Get From Dictionary ${reps.json()["data"]} records #提现单列表
#${value} Evaluate random.choice(${records} ) random
#log to console \nvalue: ${value}
#${id} Get From Dictionary ${value} id #提现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

2-Background_system/2-Withdrawal_application/Withdrawal application/2-Manual_receipt.robot → 2-Background_system(Test)/3-Withdrawal_application/Withdrawal application/2-Manual_receipt.robot

@ -4,7 +4,7 @@ Library Collections
*** Variables *** *** Variables ***
${URL} http://api-ops-psc-test.qniao.cn ${URL} http://api-ops-psc-test.qniao.cn
${header} {'X-APP-ID':'470236309865238555','Authorization':'Token 6b08add42d6bcf73abb935b2adf83525','Content-Type':'application/json'}
${header} {'X-APP-ID':'470236309865238555','Authorization':'${gettoken}','Content-Type':'application/json'}
*** Test Cases *** *** Test Cases ***
get_withdraw-list get_withdraw-list

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

@ -0,0 +1,207 @@
*** Settings ***
Library requests
Library Collections
Library RequestsLibrary
Library DateTime
*** Variables ***
${header} {'X-APP-ID':'470236309865238555','Authorization':'${gettoken}','Content-Type':'application/json'}
${URL} http://api-ops-ztb-test.qniao.cn
*** Test Cases ***
get_proxy-order-item-list
#查找预约的订单项列表
Create Session ZTBT ${URL} ${header}
${reps} Get On Session ZTBT recycle-service/admin/customer-service/get/proxy-order-item-list params=pageNum=1&pageSize=10&orderType=2&status=51&weightNoteType=2&orderItemId=${orderItemId}
log ${reps.json()}
${orderItemId} Get From Dictionary ${reps.json()["data"]["records"][0]} orderItemId #订单项编号
Set Global Variable ${orderItemId}
Should Be Equal As Strings ${reps.json()["data"]["records"][0]["orderId"]} ${orderId}
get_proxy-order-details
#查看订单详情
Create Session ZTBT ${URL} ${header}
${reps} Get On Session ZTBT recycle-service/admin/customer-service/get/proxy-order/${orderId} params=orderId=${orderId}&orderItemId=${orderItemId}
${contractId} Get From Dictionary ${reps.json()["data"]["orderItems"][0]} contractId #当前订单下单时的合同id
${unitSurcharge} Get From Dictionary ${reps.json()["data"]} unitSurcharge #代卖费
${proxySellerSettleType} Get From Dictionary ${reps.json()["data"]} proxySellerSettleType #代卖费结算方式
${paperCategoryId} Get From Dictionary ${reps.json()["data"]} paperCategoryId #纸厂品类ID
${unitPrice} Get From Dictionary ${reps.json()["data"]} paperCategoryPrice #品类单价
${publicSubsidies} Get From Dictionary ${reps.json()["data"]["orderItems"][0]} publicSubsidies #公开补贴
${millSupplierId} Get From Dictionary ${reps.json()["data"]} millSupplierId #纸厂供应商ID
${paperMillSupplierName} Get From Dictionary ${reps.json()["data"]} paperMillSupplierName #纸厂供应商名称
${surcharge} Get From Dictionary ${reps.json()["data"]["orderItems"][0]} surcharge #代卖费总额
${contractId} Get From Dictionary ${reps.json()["data"]["orderItems"][0]} contractId #合同id
${paymentType} Get From Dictionary ${reps.json()["data"]["orderItems"][0]} paymentType #支付类型
${activityNoteStatus} Get From Dictionary ${reps.json()["data"]["orderItems"][0]} activityNoteStatus #活动状态
${交易主体id} Get From Dictionary ${reps.json()["data"]} transactionMainEnterpriseId #交易主体id
${交易主体name} Get From Dictionary ${reps.json()["data"]} transactionMainEnterpriseName #交易主体name
${publicSubsidies} Set Variable If '${publicSubsidies}'=='${null}' 0 ${publicSubsidies}
${settleUtiPrice}= Evaluate ${unitPrice}+${publicSubsidies} #结算单价
log ${contractId}
Set Global Variable ${contractId}
Set Global Variable ${unitSurcharge}
Set Global Variable ${paperCategoryId}
Set Global Variable ${settleUtiPrice}
Set Global Variable ${unitPrice}
Set Global Variable ${publicSubsidies}
Set Global Variable ${millSupplierId}
Set Global Variable ${paperMillSupplierName}
Set Global Variable ${proxySellerSettleType}
Set Global Variable ${contractId}
Set Global Variable ${surcharge}
Set Global Variable ${paymentType}
Set Global Variable ${activityNoteStatus}
Set Global Variable ${交易主体name}
Set Global Variable ${交易主体id}
get_delivery-info
#获取订单名片信息
Create Session ZTBT ${URL} ${header}
${reps} Get On Session ZTBT recycle-service/admin/proxy-sell/get/proxy-order/delivery-info/${orderItemId}
log ${reps.json()}
${plateNumber} Get From Dictionary ${reps.json()["data"]} plateNumber #车牌号
${settleUtiPrice} Get From Dictionary ${reps.json()["data"]} settleUtiPrice #结算单价
${settleUtiPriceIncludeTaxType} Get From Dictionary ${reps.json()["data"]} settleUtiPriceIncludeTaxType #含税补贴价类型
${netWeight} Get From Dictionary ${reps.json()["data"]} netWeight #净重
Set Global Variable ${plateNumber}
Set Global Variable ${settleUtiPrice}
Set Global Variable ${settleUtiPriceIncludeTaxType}
Set Global Variable ${netWeight}
get-contract-list
#获取订单纸厂的所有合同信息
Create Session ZTBT ${URL} ${header}
${reps} Get On Session ZTBT /recycle-service/admin/contract/get/selectable-contract-list params=orderItemId=${orderItemId}
log ${reps.json()}
get_weightnote
Create Session ZTBT ${URL} ${header}
${reps} Post On Session ZTBT recycle-service/admin/proxy-sell/get/weightnote/${weightnoteId}
log ${reps.json()}
get_paperMill-supplier
#获取纸厂供应商
Create Session ZTBT ${URL} ${header}
${reps} Get On Session ZTBT recycle-service/admin/customer-service/get/paper-mill-merchant/${paperMillId} params=paperMillId=${paperMillId}
log ${reps.json()}
get-Warehouse
#获取所属仓库
Create Session ZTBT ${URL} ${header}
${reps} Get On Session ZTBT recycle-service/admin/transaction-main-enterprise/get/warehouse-name
${仓库} Get From Dictionary ${reps.json()} data
#随机获取仓库
${所属仓库} Evaluate random.choice(${仓库}) random
log to console \nvalue:${所属仓库}
Set Global Variable ${所属仓库}
get-Source of funds
#获取资金来源
Create Session ZTBT ${URL} ${header}
${reps} Get On Session ZTBT recycle-service/admin/fund-source/get/list
log ${reps.json()}
${data} Get From Dictionary ${reps.json()} data
FOR ${item} IN @{data}
log ${item}
${isDefault} Get From Dictionary ${item} isDefault #获取启用状态
${name} Get From Dictionary ${item} name #获取name
${id} Get From Dictionary ${item} id #获取id
Exit For Loop If '${isDefault}'=='1'
END
Set Global Variable ${name}
Set Global Variable ${id}
get_paper-mill-category
#获取当前纸厂的所有纸品品类
Create Session ZTBT ${URL} ${header}
${reps} Get On Session ZTBT recycle-service/admin/paperMill/get/paper-mill-category/${paperMillId} params=id=${paperMillId}
log ${reps.json()}
get_contract_by_id
#获取下单时绑定的合同
Create Session ZTBT ${URL} ${header}
${reps} Get On Session ZTBT recycle-service/admin/contract/get/detail-by-id params=id=${contractId}
log ${reps.json()}
#获取垫资费、企业ID、应收金额结算规则、含税结算单价结算规则
${advanceFund} Get From Dictionary ${reps.json()["data"]} advanceFund #垫资费
${buyerEnterpriseId} Get From Dictionary ${reps.json()["data"]} buyerEnterpriseId #企业id
${settleRules} Get From Dictionary ${reps.json()["data"]} settleRules #应收金额结算规则
${settlePriceIncludeTaxSettleRules} Get From Dictionary ${reps.json()["data"]} settlePriceIncludeTaxSettleRules #含税结算单价结算规则
${taxRefundRate} Get From Dictionary ${reps.json()["data"]} taxRefundRate #税点
${proxyPaySurcharge} Get From Dictionary ${reps.json()["data"]} proxyPaySurcharge #代收费
${hasInvoice} Get From Dictionary ${reps.json()["data"]} hasInvoice #是否开票
${accountPeriodType} Get From Dictionary ${reps.json()["data"]} accountPeriodType #账期类型
${isSubsidyAndDeductIncludeTax} Get From Dictionary ${reps.json()["data"]} isSubsidyAndDeductIncludeTax #纸厂补贴是否含税
${receivableSettlementRules} Get From Dictionary ${reps.json()["data"]} settleRules #应收金额结算规则
${settlePriceIncludeTaxSettleRules} Get From Dictionary ${reps.json()["data"]} settlePriceIncludeTaxSettleRules #含税结算单价结算规则
${advanceFund} Set Variable If '${advanceFund}'=='${None}' 0 ${advanceFund}
${proxyPaySurcharge} Set Variable If '${proxyPaySurcharge}'=='${None}' 0 ${proxyPaySurcharge}
Set Global Variable ${advanceFund}
Set Global Variable ${buyerEnterpriseId}
Set Global Variable ${taxRefundRate}
Set Global Variable ${proxyPaySurcharge}
Set Global Variable ${hasInvoice}
Set Global Variable ${accountPeriodType}
Set Global Variable ${settleRules}
Set Global Variable ${settlePriceIncludeTaxSettleRules}
Set Global Variable ${isSubsidyAndDeductIncludeTax}
Set Global Variable ${receivableSettlementRules}
Set Global Variable ${settlePriceIncludeTaxSettleRules}
get-category price
#获取下单品类,上传磅单时的价格
Create Session ZTBT ${URL} ${header}
${dataTime} Get Current Date result_format=%Y-%m-%d
${reps} Get On Session ZTBT recycle-service/admin/proxy-sell/get-category-price-by-date params=orderItemId=${orderItemId}&weightDay=${dataTime}
log ${reps.json()}
${price} Get From Dictionary ${reps.json()["data"][0]} price #下单品类价格
${publicSubsidies} Get From Dictionary ${reps.json()["data"][0]} publicSubsidies #下单品类公开补贴
Set Global Variable ${price}
Set Global Variable ${publicSubsidies}
Set Global Variable ${dataTime}
Upload_pictures
#上传图片
#${dict} Create Dictionary Content-Type=image/jpeg filename=20210803.jpg
#Create Session ZTBT ${URL} ${dict}
${filepath} Evaluate open('E:/lyl/图片/21042217001449712.png','rb')
${image} Evaluate open('E:/lyl/图片/21042217001449712.png','rb')
${file} Create Dictionary filepath=${filepath} image=${image}
Create Session ZTBT ${URL}
log ${file}
${result} Post On Session ZTBT recycle-user-center/upload/image files=${file}
${pictures} Get From Dictionary ${result.json()} data
log ${result.content}
Set Global Variable ${pictures}
get_repeat_proxy-order
#获取重复订单信息
Create Session ZTBT ${URL} ${header}
#${datatime}
${reps} Get On Session ZTBT recycle-service/admin/customer-service/get/repeat/proxy-order params=orderItemId=${orderItemId}&plateNumber=${carList}&settleWeight=13550&weighingDate=${datatime}&orderType=${orderType}
log ${reps.json()}
Should Be Equal As Strings ${reps.json()["message"]} successful
weightnote
#提交磅单
Create Session ZTBT ${URL} ${header}
${datatime} Get Current Date result_format=%Y-%m-%d
${data} Set Variable { \ \ \ \ "id":"${weightNoteId}", \ \ \ \ "orderId":"${orderId}", \ \ \ \ "orderItemId":"${orderItemId}", \ \ \ \ "type":null, \ \ \ \ "weightDay":"${datatime}", \ \ \ \ "settleDay":"${datatime}", \ \ \ \ "settleUtiPrice":"${settleUtiPrice}", \ \ \ \ "netWeight":"${netWeight}", \ \ \ \ "settleWeight":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}" }
log ${data}
${reps} Post On Session ZTBT recycle-service/admin/proxy-sell/update/weightnote ${data.encode('utf-8')}
log ${reps.json()["data"]}
${weightNoteId} Get From Dictionary ${reps.json()["data"]} weightNoteId
Set Global Variable ${weightNoteId}
Should Be Equal As Strings ${reps.json()["message"]} successful
audit_weightnote
Create Session ZTBT ${URL} ${header}
${repsonse} Post On Session ZTBT recycle-service/admin/customer-service/audit/weightnote/${weightNoteId}
log ${repsonse.json()}
get_proxy-order
Create Session ZTBT ${URL} ${header}
${reps} Get On Session ZTBT recycle-service/admin/customer-service/get/proxy-order/${orderId} params=orderId=${orderId}&orderItemId=${orderItemId}
log ${reps.json()}
Should Be Equal As Strings ${reps.json()["message"]} successful

2-Background_system/1-Consignment management/3-Operation_audit.robot → 2-Background_system(Test)/4-Consignment_management/3.3--Operation_audit.robot

@ -1,10 +1,10 @@
*** Settings *** *** Settings ***
Library DateTime
Library Collections
Library RequestsLibrary Library RequestsLibrary
Library Collections
Library DateTime
*** Variables *** *** Variables ***
${header} {'X-APP-ID':'470236309865238555','Authorization':'Token 6b08add42d6bcf73abb935b2adf83525','Content-Type':'application/json'}
${header} {'X-APP-ID':'470236309865238555','Authorization':'${gettoken}','Content-Type':'application/json'}
${URL} http://api-ops-ztb-test.qniao.cn ${URL} http://api-ops-ztb-test.qniao.cn
*** Test Cases *** *** Test Cases ***
@ -33,25 +33,32 @@ get_order-log-detail
get_order-receipt-audit-details get_order-receipt-audit-details
#查看运营审核详情 #查看运营审核详情
Create Session ZTBT ${URL} ${header} 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} ${reps} Post On Session ZTBT recycle-service/admin/operation/get/order-receipt-audit-details/${auditRequestId}/${weightNoteId}
log ${reps.json()} log ${reps.json()}
${auditRequestItemId} Get From Dictionary ${reps.json()["data"]["items"][0]} auditRequestItemId #审核项id ${auditRequestItemId} Get From Dictionary ${reps.json()["data"]["items"][0]} auditRequestItemId #审核项id
${categoryName} Get From Dictionary ${reps.json()["data"]["items"][0]} categoryName #纸品品类名称 ${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 #净重 ${netWeight} Get From Dictionary ${reps.json()["data"]["items"][0]} netWeight #净重
${settleWeight} Get From Dictionary ${reps.json()["data"]["items"][0]} settleWeight #结算重量
${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 #结算重量
${paperMillPayAt} Set Variable If '${paperMillPayAt}'=='无账期' null ${paperMillPayAt} #纸厂账期
Set Global Variable ${auditRequestItemId} Set Global Variable ${auditRequestItemId}
Set Global Variable ${categoryName} Set Global Variable ${categoryName}
Set Global Variable ${netWeight} Set Global Variable ${netWeight}
Set Global Variable ${paperMillPayAt} Set Global Variable ${paperMillPayAt}
Set Global Variable ${plateNumber} Set Global Variable ${plateNumber}
Set Global Variable ${settleWeight} Set Global Variable ${settleWeight}
Set Global Variable ${paperCategoryId}
Set Global Variable ${datatime}
Set Global Variable ${settleWeight}
order-receipt-audit-details order-receipt-audit-details
#b保存磅单信息 #b保存磅单信息
Create Session ZTBT ${URL} ${header} Create Session ZTBT ${URL} ${header}
${data} Set Variable { \ \ \ \ "auditRequestItemId":"${auditRequestItemId}", \ \ \ \ "categoryName":"${categoryName}", \ \ \ \ "netWeight":${netWeight}, \ \ \ \ "paperCategoryId":null, \ \ \ \ "paperMillPayAt":"${paperMillPayAt}", \ \ \ \ "plateNumber":"${plateNumber}", \ \ \ \ "receivablePrice":29186.7, \ \ \ \ "settlementDate":"${datatime}", \ \ \ \ "weighingDate":"${datatime}", \ \ \ \ "settleWeight":${settleWeight}, \ \ \ \ "isInvoice":${hasInvoice}, \ \ \ \ "fundSourceId":${id}, \ \ \ \ "transactionMainEnterpriseName":"${交易主体}", \ \ \ \ "invoicePoint":${taxRefundRate}, \ \ \ \ "publicSubsidies":${publicSubsidies}, \ \ \ \ "publicSubsidiesIncludeTax":0, \ \ \ \ "settleUnitPrice":${settleUtiPrice}, \ \ \ \ "settleUnitPriceIncludeTax":2.281517, \ \ \ \ "fundSourceName":"${name}" }
${data} Set Variable { \ \ \ \ "auditRequestItemId":"${auditRequestItemId}", \ \ \ \ "categoryName":"${categoryName}", \ \ \ \ "netWeight":"${netWeight}", \ \ \ \ "paperCategoryId":"${paperCategoryId}", \ \ \ \ "paperMillPayAt":null, \ \ \ \ "plateNumber":"${plateNumber}", \ \ \ \ "receivablePrice":5550, \ \ \ \ "settlementDate":"${datatime}", \ \ \ \ "weighingDate":"${datatime}", \ \ \ \ "settleWeight":"${settleWeight}", \ \ \ \ "isInvoice":"${hasInvoice}", \ \ \ \ "fundSourceId":"${id}", \ \ \ \ "transactionMainEnterpriseName":"${交易主体name}", \ \ \ \ "invoicePoint":"${taxRefundRate}", \ \ \ \ "publicSubsidies":0, \ \ \ \ "publicSubsidiesIncludeTax":0, \ \ \ \ "settleUnitPrice":"${settleUtiPrice}", \ \ \ \ "settleUnitPriceIncludeTax":1.337449, \ \ \ \ "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
@ -65,6 +72,7 @@ get_order-log-detail2
operation_audit operation_audit
#运营审核确认通过 #运营审核确认通过
Create Session ZTBT ${URL} ${header} Create Session ZTBT ${URL} ${header}
${data} Set Variable { \ "auditRequestId":"${auditRequestId}", \ \ \ \ "isPass":1, \ \ \ \ "remark":"2021年8月10号" }
${data} Set Variable { \ "auditRequestId":"${auditRequestId}", \ \ \ \ "isPass":1, \ \ \ \ "remark":"${datatime}" }
${reps} Post On Session ZTBT recycle-service/admin/operation/operation/audit ${data.encode('utf-8')} ${reps} Post On Session ZTBT recycle-service/admin/operation/operation/audit ${data.encode('utf-8')}
Should Be Equal As Strings ${reps.json()["message"]} successful Should Be Equal As Strings ${reps.json()["message"]} successful
sleep 2

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

@ -3,14 +3,14 @@ Library RequestsLibrary
Library Collections Library Collections
*** Variables *** *** Variables ***
${header} {'X-APP-ID':'470236309865238555','Authorization':'Token 6b08add42d6bcf73abb935b2adf83525','Content-Type':'application/json'}
${header} {'X-APP-ID':'470236309865238555','Authorization':'${gettoken}','Content-Type':'application/json'}
${url} http://api-ops-psc-test.qniao.cn ${url} http://api-ops-psc-test.qniao.cn
${URL1} http://api-ops-ztb-test.qniao.cn ${URL1} http://api-ops-ztb-test.qniao.cn
*** Test Cases *** *** Test Cases ***
get_list 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}
log ${reps.json()} log ${reps.json()}
Should Be Equal As Strings ${reps.json()["message"]} successful Should Be Equal As Strings ${reps.json()["message"]} successful
@ -23,9 +23,10 @@ get_order-log-detail
paper-mill-order-receipt-proof-request_audit paper-mill-order-receipt-proof-request_audit
#财务审核确认通过 #财务审核确认通过
Create Session ZTBT ${url} ${header} Create Session ZTBT ${url} ${header}
${data} Set Variable {"auditRequestId":"${auditRequestId}","adminId":null,"isPass":1,"remark":"2021年8月10号" }
${data} Set Variable {"auditRequestId":"${auditRequestId}","adminId":null,"isPass":1,"remark":"${datatime}" }
${reps} Post On Session ZTBT payment-settlement-center/admin/paper-mill-order-receipt-proof-request/audit ${data.encode('utf-8')} ${reps} Post On Session ZTBT payment-settlement-center/admin/paper-mill-order-receipt-proof-request/audit ${data.encode('utf-8')}
log ${reps.json()} log ${reps.json()}
sleep 1
paper-mill-order-receipt-proof-request_settle paper-mill-order-receipt-proof-request_settle
#确认结算 #确认结算

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

@ -0,0 +1,33 @@
*** Settings ***
Documentation 代卖应收
Library RequestsLibrary
Library Collections
*** Variables ***
${header} {'X-APP-ID':'470236309865238555','Authorization':'${gettoken}','Content-Type':'application/json'}
${URL} http://api-ops-ztb-test.qniao.cn
*** Test Cases ***
get_paper-payment-order-list
#通过订单编号获取代卖应收列表
Create Session ZTBT ${URL} ${header}
${reps} Get On Session ZTBT recycle-service/admin/operation/get/paper-payment-order-list params=pageNum=1&pageSize=10&orderId=${orderId}
${paymentOrderId} Get From Dictionary ${reps.json()["data"]["records"][0]} id #回款单号
log ${reps.json()}
Set Global Variable ${paymentOrderId}
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}
${receivablePriceIncludeTax} Get From Dictionary ${reps.json()["data"]["items"][0]} receivablePriceIncludeTax #获取应收金额
${noReceivablePrice} Get From Dictionary ${reps.json()["data"]["items"][0]} noReceivablePrice #未回款金额
Set Global Variable ${receivablePriceIncludeTax}
Set Global Variable ${noReceivablePrice}
update_payment-order-status
#确认回款操作
Create Session ZTBT ${URL} ${header}
${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')}
Should Be Equal As Strings ${reps.json()["message"]} successful

0
2-Background_system(Test)/4-Consignment_management/__init__.robot

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

@ -0,0 +1,55 @@
*** Settings ***
Documentation 查看代卖订单(数据对比)
Library RequestsLibrary
Library Collections
Library DateTime
Library RedisLibrary
Library urllib3
*** Variables ***
${header} {'content-type':'application/json','X-APP-ID':'470236309865238528'}
${url} http://api-client-ztb-test.qniao.cn
*** Test Cases ***
userlogin
[Setup]
#验证码登录
#${header} Create Dictionary content-type=application/json X-APP-ID=470236309865238528
Create Session ZTBT http://api-client-uec-test.qniao.cn ${header}
${data} Create Dictionary account=15014242835 captcha=888888 accountType=2
${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
#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}
get_proxy-order-list
#获取代卖订单列表
${header} Create Dictionary content-type=application/json X-APP-ID=470236309865238528 Authorization=QNT ${gettoken}
Create Session ZTBT http://api-client-ztb-test.qniao.cn ${header}
${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}
get_proxy-order_details
#获取代卖订单详情
${header} Create Dictionary content-type=application/json X-APP-ID=470236309865238528 Authorization=QNT ${gettoken}
Create Session ZTBT http://api-client-ztb-test.qniao.cn ${header}
${reps} Get On Session ZTBT recycle-service/proxy-sell/get/proxy-order/${orderId}
${data} Get From Dictionary ${reps.json()} data
${data_value} Set Variable
#Run Keyword If '${orderId}' in ${data} Log To Console ${data}
Should Be Equal ${data} ${data_value}

0
2-Background_system(Test)/5-Data comparison/__init__.txt

2
__init__.robot

@ -1,3 +1,5 @@
*** Settings *** *** Settings ***
Suite Setup Suite Setup
Library RequestsLibrary Library RequestsLibrary
Library SeleniumLibrary
Library AppiumLibrary

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

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

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

Loading…
Cancel
Save