纸通宝交易版
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

153 lines
11 KiB

*** 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 ***