commit 1a914c3e86675fa7f738f9dbf5cbdc212182560c Author: LG_lai Date: Wed Aug 3 10:31:02 2022 +0800 ops-rf diff --git a/0-Data driven/WebLogin.robot b/0-Data driven/WebLogin.robot new file mode 100644 index 0000000..6c5edc5 --- /dev/null +++ b/0-Data driven/WebLogin.robot @@ -0,0 +1,112 @@ +*** Settings *** +Library ExcelLibrary +Library Collections +Library RequestsLibrary +Library urllib3 + +*** Variables *** + +*** Test Cases *** +Papermill_Login + #纸厂web端登录 + #验证码登录 + Disable Warnings + Create Session papermill ${uecclient} ${ztbsc_papermill_login_header} + ${Data} Set Variable { \ \ \ \ "account":"${papermill_account}", \ \ \ \ "accountType":2, \ \ \ \ "captcha":"${papermill_password}", \ \ \ \ "$loginType":"telphone", \ \ \ \ "$isNextAutoLogin":true } + ${reps} POST On Session papermill uec/authorize/by-captcha ${Data.encode('utf-8')} + ${papermill_token} Get From Dictionary ${reps.json()['data']} token #获取uectoken + Set Global Variable ${papermill_token} + #转换业务token + Create Session ZTBT ${ztbclient} ${ztbsc_papermill_login_header} + ${loginToken} Set Variable { \ \ \ \ "loginToken":"${papermill_token}", \ \ \ \ "$configs":{ \ \ \ \ \ \ \ \ "$isBizFailedNotToast":true \ \ \ \ } } + ${reps} Post On Session ZTBT ztb-user-enterprise-service/authorize/get/product-line-token/by/login-token ${loginToken.encode('utf-8')} + ${PM_userId} Get From Dictionary ${reps.json()["data"]} userId #获取用户id + ${PM_token} Get From Dictionary ${reps.json()["data"]} token #获取token + Set Global Variable ${PM_userId} + Set Global Variable ${PM_token} + #Execl写入数据 + Open Excel D:\\LYL\\Study\\Robot_framework\\New_Trading\\数据驱动.xls + Put String To Cell ztbsc 3 20 {'Content-Type':'application/json','Authorization':'QNT ${PM_token}','X-APP-ID':'503258978847966406'} #写入纸厂端请求头数据 + Save Excel Datadriven.xls + #数据驱动 + Open Excel D:\\LYL\\Study\\Robot_framework\\New_Trading\\Datadriven.xls + ${ztbsc_papermill_header} Read Cell Data By Name ztbsc D21 #纸厂端header + Set Global Variable ${ztbsc_papermill_header} + sleep 0.5 + #获取用户组织信息 + Create Session ZTBT ${ztbclient} ${ztbsc_papermill_header} + ${reps} GET On Session ZTBT ztb-supply-chain-service/get/paper-mill/user-base-info + ${paperMillOrgInfoList} Get From Dictionary ${reps.json()['data']} paperMillOrgInfoList #用户纸厂类型组织列表 + FOR ${items} IN @{paperMillOrgInfoList} + ${papermill_orgId} Get From Dictionary ${items} orgId #纸厂组织id + ${papermill_name} Get From Dictionary ${items} name #纸厂组织名称 + Exit For Loop If '${papermill_name}'=='516测试613' + END + Set Global Variable ${papermill_name} + #Execl写入数据 + Open Excel D:\\LYL\\Study\\Robot_framework\\New_Trading\\数据驱动.xls + Put String To Cell ztbsc 3 20 {'Content-Type':'application/json','Authorization':'QNT ${PM_token}','X-APP-ID':'503258978847966406','X-ORGANIZATION-ID':'${papermill_orgId}'} #写入纸厂端请求头数据 + Save Excel DatadrivenP.xls + #数据驱动 + Open Excel D:\\LYL\\Study\\Robot_framework\\New_Trading\\DatadrivenP.xls + ${ztbsc_papermill_header} Read Cell Data By Name ztbsc D21 #纸厂端header + Set Global Variable ${ztbsc_papermill_header} + sleep 0.5 + +Factoring_Login + #保理web端登录 + #验证码登录 + Disable Warnings + Create Session factoring ${uecclient} ${ztbsc_factoring_login_header} + ${Data} Set Variable { \ \ \ \ "account":"${papermill_account}", \ \ \ \ "accountType":2, \ \ \ \ "captcha":"${papermill_password}", \ \ \ \ "$loginType":"telphone", \ \ \ \ "$isNextAutoLogin":true } + ${reps} POST On Session factoring uec/authorize/by-captcha ${Data.encode('utf-8')} + ${factoring_token} Get From Dictionary ${reps.json()['data']} token #获取uectoken + Set Global Variable ${factoring_token} + #转换业务token + Create Session ZTBT ${uecclient} ${ztbsc_factoring_login_header} + ${loginToken} Set Variable { \ \ \ \ "loginToken":"${factoring_token}", \ \ \ \ "$configs":{ \ \ \ \ \ \ \ \ "$isBizFailedNotToast":true \ \ \ \ } } + ${reps} Post On Session ZTBT factoring/authorize/get/product-line-token/by/login-token ${loginToken.encode('utf-8')} + ${F_userId} Get From Dictionary ${reps.json()["data"]} userId #获取用户id + ${F_token} Get From Dictionary ${reps.json()["data"]} token #获取token + Set Global Variable ${F_userId} + Set Global Variable ${F_token} + #Execl写入数据 + Open Excel D:\\LYL\\Study\\Robot_framework\\New_Trading\\数据驱动.xls + Put String To Cell ztbsc 3 24 {'Content-Type':'application/json','Authorization':'QNT ${F_token}','X-APP-ID':'503258978847966410','X-ORGANIZATION-ID':'710132392618233856'} #写入保理商端请求头数据 + Save Excel DatadrivenF.xls + #数据驱动 + Open Excel D:\\LYL\\Study\\Robot_framework\\New_Trading\\DatadrivenF.xls + ${ztbsc_factoring_header} Read Cell Data By Name ztbsc D25 #保理商端header + ${ztbsc_factoring_login_header} Read Cell Data By Name ztbsc D23 #保理商端登录header + Set Global Variable ${ztbsc_factoring_header} + Set Global Variable ${ztbsc_factoring_login_header} + sleep 0.5 + +Traders_Login + #代理商web端登录 + #验证码登录 + Disable Warnings + Create Session traders ${uecclient} ${ztbsc_traders_login_header} + ${Data} Set Variable { \ \ \ \ "account":"${papermill_account}", \ \ \ \ "accountType":2, \ \ \ \ "captcha":"${papermill_password}", \ \ \ \ "$loginType":"telphone", \ \ \ \ "$isNextAutoLogin":true } + ${reps} POST On Session traders uec/authorize/by-captcha ${Data.encode('utf-8')} + ${traders_token} Get From Dictionary ${reps.json()['data']} token #获取uectoken + Set Global Variable ${traders_token} + #转换业务token + Create Session ZTBT ${ztbclient} ${ztbsc_traders_login_header} + ${loginToken} Set Variable { \ \ \ \ "loginToken":"${traders_token}", \ \ \ \ "$configs":{ \ \ \ \ \ \ \ \ "$isBizFailedNotToast":true \ \ \ \ } } + ${reps} Post On Session ZTBT ztb-user-enterprise-service/authorize/get/product-line-token/by/login-token ${loginToken.encode('utf-8')} + ${T_userId} Get From Dictionary ${reps.json()["data"]} userId #获取用户id + ${T_token} Get From Dictionary ${reps.json()["data"]} token #获取token + Set Global Variable ${T_userId} + Set Global Variable ${T_token} + #Execl写入数据 + Open Excel D:\\LYL\\Study\\Robot_framework\\New_Trading\\数据驱动.xls + Put String To Cell ztbsc 3 17 {'Content-Type':'application/json','Authorization':'QNT ${T_token}','X-APP-ID':'503258978847966406','X-ORGANIZATION-ID':'721760754042277888'} #写入代理商端请求头数据 + Save Excel DatadrivenT.xls + #数据驱动 + Open Excel D:\\LYL\\Study\\Robot_framework\\New_Trading\\DatadrivenF.xls + ${ztbsc_traders_header} Read Cell Data By Name ztbsc D18 #代理商端header + ${ztbsc_traders_login_header} Read Cell Data By Name ztbsc D16 #代理商端登录header + Set Global Variable ${ztbsc_traders_header} + Set Global Variable ${ztbsc_traders_login_header} + sleep 0.5 diff --git a/0-Data driven/dataDriven.robot b/0-Data driven/dataDriven.robot new file mode 100644 index 0000000..dc9eba7 --- /dev/null +++ b/0-Data driven/dataDriven.robot @@ -0,0 +1,114 @@ +*** Settings *** +Library ExcelLibrary +Library DateTime +Library String +Library Collections +Library RequestsLibrary +Library urllib3 +Library DatabaseLibrary + +*** Test Cases *** +ztbsc + #数据驱动 + Open Excel D:\\LYL\\Study\\Robot_framework\\New_Trading\\数据驱动.xls + ${uecops} Read Cell Data By Name ztbsc B10 #uec系统域名 + ${pscops} Read Cell Data By Name ztbsc B15 #psc系统域名 + ${ztbops} Read Cell Data By Name ztbsc B11 #ztb域名 + ${ztbscops} Read Cell Data By Name ztbsc B13 #ztbsc域名 + ${uecclient} Read Cell Data By Name ztbsc B2 #uec客户端域名 + ${ztbclient} Read Cell Data By Name ztbsc B4 #client域名 + Set Global Variable ${uecops} + Set Global Variable ${pscops} + Set Global Variable ${ztbops} + Set Global Variable ${ztbscops} + Set Global Variable ${uecclient} + Set Global Variable ${ztbclient} + ${ztbsc_header} Read Cell Data By Name ztbsc D10 #平台header + ${client_header} Read Cell Data By Name ztbsc D2 #客户端header + ${client_login_header} Read Cell Data By Name ztbsc D7 #客户端登录header + ${ztbsc_traders_header} Read Cell Data By Name ztbsc D18 #代理商端header + ${ztbsc_papermill_header} Read Cell Data By Name ztbsc D21 #纸厂端header + ${ztbsc_factoring_header} Read Cell Data By Name ztbsc D25 #保理商端header + ${ztbsc_ops_login_header} Read Cell Data By Name ztbsc D10 #平台登录header + ${client_firstlogin_header} Read Cell Data By Name ztbsc D8 #客户端首次登录header + ${ztbsc_traders_login_header} Read Cell Data By Name ztbsc D16 #代理商端登录header + ${ztbsc_papermill_login_header} Read Cell Data By Name ztbsc D20 #纸厂端登录header + ${ztbsc_factoring_login_header} Read Cell Data By Name ztbsc D23 #保理商端登录header + Set Global Variable ${ztbsc_header} + Set Global Variable ${client_header} + Set Global Variable ${client_login_header} + Set Global Variable ${ztbsc_traders_header} + Set Global Variable ${ztbsc_papermill_header} + Set Global Variable ${ztbsc_factoring_header} + Set Global Variable ${ztbsc_ops_login_header} + Set Global Variable ${client_firstlogin_header} + Set Global Variable ${ztbsc_traders_login_header} + Set Global Variable ${ztbsc_papermill_login_header} + Set Global Variable ${ztbsc_factoring_login_header} + ${ztbsc_account} Read Cell Data By Name Account password A4 #平台登录账号 + ${client_account} Read Cell Data By Name Account password A3 #移动端登录账号 + ${ztbsc_password} Read Cell Data By Name Account password B4 #平台登录密码 + ${client_password} Read Cell Data By Name Account password B2 #移动端登录密码 + ${traders_account} Read Cell Data By Name Account password A2 #代理商端登录账号 + ${traders_password} Read Cell Data By Name Account password B2 #代理商端登录密码 + ${papermill_account} Read Cell Data By Name Account password A2 #纸厂端登录账号 + ${factoring_account} Read Cell Data By Name Account password A2 #保理商端登录账号 + ${papermill_password} Read Cell Data By Name Account password B2 #纸厂端登录密码 + ${factoring_password} Read Cell Data By Name Account password B2 #保理商端登录密码 + Set Global Variable ${ztbsc_account} + Set Global Variable ${client_account} + Set Global Variable ${ztbsc_password} + Set Global Variable ${client_password} + Set Global Variable ${traders_account} + Set Global Variable ${traders_password} + Set Global Variable ${papermill_account} + Set Global Variable ${factoring_account} + Set Global Variable ${papermill_password} + Set Global Variable ${factoring_password} + ${start_time} get current date result_format=%Y-%m-%d + ${str_end_time} Add Time To Date ${start_time} 30 days + ${end_time} Get Substring ${str_end_time} 0 10 + ${time} Get Time + Set Global Variable ${start_time} + Set Global Variable ${end_time} + Set Global Variable ${time} + +001样例 + #C:\\test\\11.xls Evaluate random.randint(100, sys.maxsize) modules=random, sys + #上传磅单图片 + #Disable Warnings + #${filepath} Evaluate open('./21042217001449712.png','rb') + #${image} Evaluate open('./21042217001449712.png','rb') + #${file} Create Dictionary filepath=${filepath} image=${image} + #Create Session order ${ztbops} + #${reps} POST On Session order recycle-user-center/upload/image files=${file} + #${pictures} Get From Dictionary ${reps.json()} data + #Should Be Equal As Strings ${reps.json()['message']} successful + #${datatime} get current date result_format=%Y-%m-%d %H:%M:%S + #${value} Set Variable 1 + #${Time} Add Time To Date ${datatime} ${value} days + #${DataTime} Get Substring ${Time} 0 19 + #Execl写入数据 + #Open Excel D:\\LYL\\Study\\Robot_framework\\New_Trading\\11.xls + #Put String To Cell ztbsc 3 20 {'Authorization':'11','X-APP-ID':' 503258978847966406','X-ORGANIZATION-ID':'723518259651022848'} + #Save Excel D:\LYL\Study\Robot_framework\New_Trading\11.xls + #上传MP4文件 + #Disable Warnings + #${file} Evaluate open('./5e7f47fb6aea3.mp4','rb') + #${file_data} Create Dictionary file=${file} + #${type_data} Create Dictionary type='mp4' + #Create Session ztbt ${ztbops} + #${reps} POST On Session ztbt recycle-user-center/upload/file data=${type_data} files=${fileData} + #${data} Get From Dictionary ${reps.json()} data + #Set Global Variable ${data} + #sleep 0.5 + #获取随机数 + #${List} Set Variable [{0},{1},{2},3,4,5,6,7,8,9] + #${data} Evaluate random.choice(${List}) random + #Log To Console ${data} + #获取时间 + ${time} Get Time #获取当前时间 + ${start_time} Add Time To Date ${time} 02:00:00 + ${start_time} Get Substring ${start_time} 0 19 + ${end_time} Add Time To Date ${time} 1 day + ${end_time} Get Substring ${end_time} 0 19 diff --git a/1-Client/APPlogin.robot b/1-Client/APPlogin.robot new file mode 100644 index 0000000..c428d6b --- /dev/null +++ b/1-Client/APPlogin.robot @@ -0,0 +1,93 @@ +*** Settings *** +Documentation \#登录客户端 +Test Setup +Library urllib3 +Library Collections +Library RequestsLibrary +Library ExcelLibrary + +*** Test Cases *** +user_login + #验证码登录 + Disable Warnings + Create Session ZTBT ${uecclient} ${client_login_header} + ${data} Create Dictionary account=${client_account} captcha=${client_password} accountType=2 + ${respones} POST On Session ZTBT uec/authorize/by-captcha json=${data} + ${token} Get From Dictionary ${respones.json()['data']} token + Set Global Variable ${token} + +login_token + #转换业务token + Create Session ZTBT ${ztbclient} ${client_login_header} + ${token1} Create Dictionary loginToken=${token} + ${reps} Post On Session ZTBT ztb-user-enterprise-service/authorize/get/product-line-token/by/login-token json=${token1} + ${userId} Get From Dictionary ${reps.json()["data"]} userId #获取用户id + ${gettoken} Get From Dictionary ${reps.json()["data"]} token #获取token + Set Global Variable ${userId} + Set Global Variable ${gettoken} + #Execl写入数据 + Open Excel D:\\LYL\\Study\\Robot_framework\\New_Trading\\数据驱动.xls + Put String To Cell ztbsc 3 7 {'Content-Type':'application/json','Authorization':'QNT ${gettoken}','X-APP-ID':'470236309865238528'} #写入移动端请求头数据 + Save Excel DatadrivenC.xls + #数据驱动 + Open Excel D:\\LYL\\Study\\Robot_framework\\New_Trading\\DatadrivenC.xls + ${client_firstlogin_header} Read Cell Data By Name ztbsc D8 #客户端首次登录header + Set Global Variable ${client_firstlogin_header} + sleep 0.5 + +get_baseInfo + #获取用户基础信息 + Create Session baseinfo ${ztbclient} ${client_firstlogin_header} + ${reps} GET On Session baseinfo ztb-supply-chain-service/get/user/base-info + ${realName} Get From Dictionary ${reps.json()['data']} realName #获取用户真实姓名 + ${organizationList} Get From Dictionary ${reps.json()['data']} organizationList #用户组织列表 + FOR ${items} IN @{organizationList} + ${orgId} Get From Dictionary ${items} id #组织id + ${orgfullName} Get From Dictionary ${items} fullName #组织名称 + ${packerBaseInfo} Get From Dictionary ${items} packerBaseInfo #组织工厂信息 + Exit For Loop If '${orgfullName}'=='仔仔工厂' + END + ${packerId} Get From Dictionary ${packerBaseInfo['scrapPaperPackingFactoryList'][0]} id #组织工厂id + ${packerName} Get From Dictionary ${packerBaseInfo['scrapPaperPackingFactoryList'][0]} name #组织工厂名称 + Set Global Variable ${orgId} + Set Global Variable ${realName} + Set Global Variable ${packerId} + Set Global Variable ${packerName} + Set Global Variable ${orgfullName} + #Execl写入数据 + Open Excel D:\\LYL\\Study\\Robot_framework\\New_Trading\\数据驱动.xls + Put String To Cell ztbsc 3 1 {'Content-Type':'application/json','Authorization':'QNT ${gettoken}','X-APP-ID':'470236309865238528','X-ORGANIZATION-ID':'${orgId}','X-PACKING-FACTORY-ID':'${packerId}'} #写入移动端请求头数据 + Save Excel DatadrivenB.xls + #数据驱动 + Open Excel D:\\LYL\\Study\\Robot_framework\\New_Trading\\DatadrivenB.xls + ${client_header} Read Cell Data By Name ztbsc D2 #客户端首次登录header + Set Global Variable ${client_header} + sleep 0.5 + +get_Personal_baseInfo + #切换组织--个人 + Create Session baseinfo ${ztbclient} ${client_header} + ${reps} GET On Session baseinfo ztb-supply-chain-service/get/user/base-info + ${organizationList} Get From Dictionary ${reps.json()['data']} organizationList #用户组织列表 + FOR ${items} IN @{organizationList} + ${orgfullName} Get From Dictionary ${items} fullName #组织名称 + ${enterpriseInfo} Get From Dictionary ${items} enterpriseInfo #组织企业信息 + ${qualificationType} Get From Dictionary ${items} qualificationType + Exit For Loop If '${orgfullName}'=='仔仔工厂' + END + ${salesTaxPoint} Set Variable 2051 + Set Global Variable ${salesTaxPoint} + +get_Enterprise_baseInfo + #切换组织--企业 + Create Session baseinfo ${ztbclient} ${client_header} + ${reps} GET On Session baseinfo ztb-supply-chain-service/get/user/base-info + ${organizationList} Get From Dictionary ${reps.json()['data']} organizationList #用户组织列表 + FOR ${items} IN @{organizationList} + ${orgfullName} Get From Dictionary ${items} fullName #组织名称 + ${enterpriseInfo} Get From Dictionary ${items} enterpriseInfo #组织企业信息 + ${qualificationType} Get From Dictionary ${items} qualificationType + Exit For Loop If '${orgfullName}'=='长沙中联泵业股份有限公司' + END + ${salesTaxPoint} Get From Dictionary ${enterpriseInfo} salesTaxPoint + Set Global Variable ${salesTaxPoint} diff --git a/1-Client/create_order.robot b/1-Client/create_order.robot new file mode 100644 index 0000000..e4327ba --- /dev/null +++ b/1-Client/create_order.robot @@ -0,0 +1,86 @@ +*** Settings *** +Documentation \#移动端下单 +Library String +Library DateTime +Library urllib3 +Library Collections +Library RequestsLibrary + +*** Test Cases *** +get_paper-mill-city + #获取纸厂所在城市 + Create Session ZTBT ${ztbclient} ${client_header} + ${reps} Get On Session ZTBT ztb-supply-chain-service/user/get/paper-mill/city-list + ${data} Get From Dictionary ${reps.json()} data #城市列表 + FOR ${items} IN @{data} + ${cityId} Get From Dictionary ${items} id #城市id + ${cityName} Get From Dictionary ${items} name #城市name + Exit For Loop If '${cityName}'=='长沙市' + END + Set Global Variable ${cityId} + +get_papermill_list + #获取纸厂交易列表 + Create Session papermilllist ${ztbclient} ${client_header} + ${reps} Get On Session papermilllist ztb-supply-chain-service/user/packer/get/paper-mill-list params=cityId=${cityId}&enableSalesAgent=1&pageNum=1&pageSize=20&listType=0 + Should Be Equal As Strings ${reps.json()["message"]} successful + ${records} Get From Dictionary ${reps.json()["data"]} records #获取代卖纸厂列表 + FOR ${item} IN @{records} + ${address} Get From Dictionary ${item} address #获取纸厂地址 + ${paperMillId} Get From Dictionary ${item} id #获取纸厂id + ${papermillname} Get From Dictionary ${item} name #获取纸厂name + ${cumulativeWeight} Get From Dictionary ${item} cumulativeWeight #累计已代卖吨数 + ${paperCategoryList} Get From Dictionary ${item} paperCategoryList #获取纸厂品类列表 + Exit For Loop If '${papermillname}'=='516测试613' + END + ${value} Evaluate random.choice(${paperCategoryList}) random + ${categoryid} Get From Dictionary ${value} id #纸厂品类id + ${categoryName} Get From Dictionary ${value} name #纸厂品类name + ${quotedPrice} Get From Dictionary ${value} quotedPrice #纸厂品类价格 + Set Global Variable ${categoryid} + Set Global Variable ${quotedPrice} + Set Global Variable ${paperMillId} + Set Global Variable ${categoryName} + Set Global Variable ${papermillname} + +get-carinfo + #获取使用过的车辆信息 + Create Session get-carinfo ${ztbclient} ${client_header} + ${reps} Get On Session get-carinfo ztb-supply-chain-service/user/get/supply-reservation-order-org-vehicle-info-record-list + ${carNumber} Set Variable ${reps.json()['data']} #获取车辆列表 + ${plateNumber1} Evaluate random.choice(${carNumber}) random + #log to console \nvalue:${plateNumber1} + ${plateNumber} Get From Dictionary ${plateNumber1} plateNumber #车辆信息 + Set Global Variable ${plateNumber} + +financial_service_provider + #支付渠道--直卖 + Create Session order ${ztbclient} ${client_header} + ${reps} GET On Session order ztb-supply-chain-service/user/get/paper-mill-financial-service-provider-list params=paperMillId=${paperMillId}&paperMillCategoryId=${categoryid}&taxPoint=2051 + ${serviceId} Get From Dictionary ${reps.json()['data'][0]} id #采购策略id + Set Global Variable ${serviceId} + +createorder + #提交下单 + ${datatime} get current date result_format=%Y-%m-%d + #${DT} Add Time To Date ${datatime} -1 day + #${str} Get Substring ${DT} 0 10 + ${data} Set Variable { \ \ \ \ "paperMillId":"${paperMillId}", \ \ \ \ "paperMillScrapPaperCategoryId":"${categoryid}", \ \ \ \ "estimatedCategoryPrice":"${quotedPrice}", \ \ \ \ "estimatedTotalVolume":30000, \ \ \ \ "paperMillFinancialServiceProviderId":"${serviceId}", \ \ \ \ "customerName":"${realName}", \ \ \ \ "arrivalTime":"${datatime}", \ \ \ \ "plateNumbers":[ \ \ \ \ \ \ \ \ "${plateNumber}" \ \ \ \ ], \ \ \ \ "salesTaxPoint":${salesTaxPoint}} + log ${data} + Create Session createorder ${ztbclient} ${client_header} + ${reps} Post On Session createorder ztb-supply-chain-service/user/create/supply-reservation-order ${data.encode('utf-8')} + Should Be Equal As Strings ${reps.json()["message"]} successful + Set Global Variable ${datatime} + sleep 1 + +order_list + #获取订单列表 + Create Session orderlist ${ztbclient} ${client_header} + ${reps} GET On Session orderlist ztb-supply-chain-service/get/packer/order-list params=status=&pageNum=1&pageSize=15 + ${orderlist} Get From Dictionary ${reps.json()['data']} records #组织交易订单列表 + FOR ${item} IN @{orderlist} + ${plateNumber1} Get From Dictionary ${item['packerOrderList'][0]} plateNumber #获取订单车牌号 + ${supplyChainInstanceId} Get From Dictionary ${item['packerOrderList'][0]} supplyChainInstanceId #获取物流编号 + Exit For Loop If '${plateNumber1}'=='${plateNumber}' + END + Set Global Variable ${supplyChainInstanceId} diff --git a/2-Platform/0-login.robot b/2-Platform/0-login.robot new file mode 100644 index 0000000..8d2d8ef --- /dev/null +++ b/2-Platform/0-login.robot @@ -0,0 +1,12 @@ +*** Settings *** +Documentation \#登录后台操作系统 +Library RequestsLibrary +Library urllib3 + +*** Test Cases *** +pwlogin + #平台登录 + Disable Warnings + Create Session ZTBSC ${ztbops} ${ztbsc_ops_login_header} + ${data} Create Dictionary username=${ztbsc_account} password=${ztbsc_password} + ${reps} Post On Session ZTBSC recycle-service/admin/login data=${data} diff --git a/2-Platform/Auction.robot b/2-Platform/Auction.robot new file mode 100644 index 0000000..4760604 --- /dev/null +++ b/2-Platform/Auction.robot @@ -0,0 +1,94 @@ +*** Settings *** +Library RequestsLibrary +Library Collections +Library urllib3 +Library DateTime +Library String + +*** Test Cases *** +create_delegation + #创建委托 + #获取委托方组织 + Create Session auction ${uecops} ${ztbsc_header} + ${reps} GET On Session auction uec/admin/get/organization-list params=pageNum=1&pageSize=30&keyword=东莞市致远纸业有限公司 + ${fullName} Get From Dictionary ${reps.json()['data']['records'][0]} fullName #委托方组织名称 + ${orgId} Get From Dictionary ${reps.json()['data']['records'][0]} id #委托方组织id + Set Global Variable ${fullName} + #创建委托拍品 + ${autionData} Set Variable { \ \ \ \ "auctionEntrustDto":{ \ \ \ \ \ \ \ \ "contact":"就挺秃然的", \ \ \ \ \ \ \ \ "contactNumber":"15014242835", \ \ \ \ \ \ \ \ "entrustTime":"${time}", \ \ \ \ \ \ \ \ "orgId":"${orgId}" \ \ \ \ }, \ \ \ \ "auctionLotDto":{ \ \ \ \ \ \ \ \ "address":"重庆", \ \ \ \ \ \ \ \ "lotDescribe":"黄废", \ \ \ \ \ \ \ \ "name":"书本纸(黄废)" \ \ \ \ } } + ${reps} POST On Session auction auction-service/admin/create/auction ${autionData.encode('utf-8')} + Should Be Equal As Strings ${reps.json()['message']} successful + #委托拍品列表 + ${reps} GET On Session auction auction-service/admin/page/auction params=status=&pageNum=1&pageSize=10 + ${List} Get From Dictionary ${reps.json()['data']} records #委托拍品列表 + FOR ${items} IN @{List} + ${auctionEntrustId} Get From Dictionary ${items} auctionEntrustId #委托拍品id + ${auctionSellerOrgName} Get From Dictionary ${items} auctionSellerOrgName #委托组织名称 + Exit For Loop If '${auctionSellerOrgName}'=='${fullName}' + END + Set Global Variable ${auctionEntrustId} + +auction_detail + #拍品详情 + Create Session auction ${uecops} ${ztbsc_header} + ${reps} GET On Session auction auction-service/admin/get/auction/detail/${auctionEntrustId} + ${displayName} Get From Dictionary ${reps.json()['data']} displayName #拍品名称 + ${auctionLotId} Get From Dictionary ${reps.json()['data']} auctionLotId + ${displayAddress} Get From Dictionary ${reps.json()['data']} displayAddress #拍品地 + ${displayDescribe} Get From Dictionary ${reps.json()['data']} displayDescribe #拍品描述 + #修改拍品设置 + #上传图片 + Disable Warnings + ${image} Evaluate open('./标的1-6.jpg','rb') + ${filepath} Evaluate open('./标的1-6.jpg','rb') + ${file} Create Dictionary filepath=${filepath} image=${image} + Create Session auction ${ztbops} + ${reps} POST On Session auction recycle-user-center/upload/image files=${file} + ${pictures} Get From Dictionary ${reps.json()} data + #上传MP4文件 + #${file} Evaluate open('./5e7f47fb6aea3.mp4','rb') + #${file_data} Create Dictionary file=${file} + #${type_data} Create Dictionary type='mp4' + #Create Session auction ${ztbops} + #${reps} POST On Session auction recycle-user-center/upload/file data=${type_data} files=${fileData} + #${MP4Data} Get From Dictionary ${reps.json()} data + #Set Global Variable ${MP4Data} + #sleep 0.5 + #保存拍品设置 + Create Session auction ${uecops} ${ztbsc_header} + ${auctionData} Set Variable { \ \ \ \ "auctionLotImageList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "url":"${pictures}", \ \ \ \ \ \ \ \ \ \ \ \ "type":1 \ \ \ \ \ \ \ \ }], \ \ \ \ "displayDescribe":"${displayDescribe}", \ \ \ \ "displayAddress":"${displayAddress}", \ \ \ \ "displayName":"${displayName}", \ \ \ \ "quantity":9, \ \ \ \ "id":"${auctionLotId}" } + ${reps} POST On Session auction auction-service/admin/modify/auction-lot ${auctionData.encode('utf-8')} + Should Be Equal As Strings ${reps.json()['message']} successful + #设置拍品规则 + #随机获取竞拍人员 + ${reps} GET On Session auction auction-service/admin/page/auction-bidder params=pageNum=1&pageSize=30&keyword=&depositPaymentStatus=1 + ${List} Create List + ${Bidders} Get From Dictionary ${reps.json()['data']} records #竞拍人员列表 + FOR ${items} IN @{Bidders} + ${id} Get From Dictionary ${items} id #竞拍人员id + Append To List ${List} ${id} + END + ${bidders_List} Evaluate random.choice(${List}) random + #获取时间 + ${time} Get Current Date result_format=%Y-%m-%d %H:%M:00 #获取当前时间 + ${start_time} Add Time To Date ${time} 00:05:00 #获取未来两小时 + ${start_time} Get Substring ${start_time} 0 19 #截取正常时间时间 + ${end_time} Add Time To Date ${time} 1 day #获取第二天当前时间 + #${end_time} Add Time To Date ${time} 00:10:00 + ${end_time} Get Substring ${end_time} 0 19 #截取正常时间时间 + #保存拍品规则 + ${Auction_rules} Set Variable { \ \ \ \ "auctionBidderDtoList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "id":"${bidders_List}" \ \ \ \ \ \ \ \ } \ \ \ \ ], \ \ \ \ "auctionLotDto":{ \ \ \ \ \ \ \ \ "startingPrice":2500, \ \ \ \ \ \ \ \ "id":"${auctionLotId}" \ \ \ \ }, \ \ \ \ "auctionDto":{ \ \ \ \ \ \ \ \ "id":null, \ \ \ \ \ \ \ \ "auctionEntrustId":"${auctionEntrustId}", \ \ \ \ \ \ \ \ "bidOptions":"10,30,15,20", \ \ \ \ \ \ \ \ "bidScale":10, \ \ \ \ \ \ \ \ "endTime":"${end_time}", \ \ \ \ \ \ \ \ "startTime":"${start_time}" \ \ \ \ } } + ${reps} POST On Session auction auction-service/admin/modify/auction-rule ${Auction_rules.encode('utf-8')} + Should Be Equal As Strings ${reps.json()['message']} successful + #委托拍品列表 + ${reps} GET On Session auction auction-service/admin/page/auction params=status=&pageNum=1&pageSize=10 + ${List} Get From Dictionary ${reps.json()['data']} records #委托拍品列表 + FOR ${items} IN @{List} + ${auctionId} Get From Dictionary ${items} auctionId #竞拍唯一标识 + ${auctionSellerOrgName} Get From Dictionary ${items} auctionSellerOrgName #委托组织名称 + Exit For Loop If '${auctionSellerOrgName}'=='${fullName}' + END + #上架拍品 + ${PutonAuction} Set Variable { \ \ \ \ "id":"${auctionId}", \ \ \ \ "isDown":false } + ${reps} POST On Session auction auction-service/admin/operate/auction ${PutonAuction.encode('utf-8')} + Should Be Equal As Strings ${reps.json()['message']} successful diff --git a/2-Platform/Order/1-Platform dispatch.robot b/2-Platform/Order/1-Platform dispatch.robot new file mode 100644 index 0000000..3074468 --- /dev/null +++ b/2-Platform/Order/1-Platform dispatch.robot @@ -0,0 +1,91 @@ +*** Settings *** +Documentation \#订单中心 +Library String +Library urllib3 +Library DateTime +Library Collections +Library RequestsLibrary + +*** Test Cases *** +reservation + #平台派单 + Create Session order ${ztbscops} ${ztbsc_header} + ${reps} GET On Session order ztb-supply-chain-service/admin/list/supply-reservation-order-item params=dispatchStatus=1&pageNum=1&pageSize=10 + ${records} Get From Dictionary ${reps.json()['data']} records #获取未派单列表数据 + FOR ${items} IN @{records} + ${id} Get From Dictionary ${items} id #派单唯一标识id + ${isHosted} Get From Dictionary ${items} isHosted + ${orderTime} Get From Dictionary ${items} orderTime #订单时间 + ${sellerName} Get From Dictionary ${items} sellerName #供应商名称 + ${sellerOrgId} Get From Dictionary ${items} sellerOrgId #供应商组织id + ${arrivalTime} Get From Dictionary ${items} arrivalTime #到货时间 + ${SCInstanceId} Get From Dictionary ${items} supplyChainInstanceId #物流编号 + ${paperMillOrgId} Get From Dictionary ${items} paperMillOrgId #纸厂组织id + ${dispatchStatus} Get From Dictionary ${items} dispatchStatus + ${transactionType} Get From Dictionary ${items} transactionType #交易类型 + ${orderPlacerPhone} Get From Dictionary ${items} orderPlacerPhone #供应商电话 + ${receivingPaperMillName} Get From Dictionary ${items} receivingPaperMillName #送货纸厂 + ${supplyReservationOrderId} Get From Dictionary ${items} supplyReservationOrderId #预约单号 + ${paperMillScrapPaperCategoryId} Get From Dictionary ${items} paperMillScrapPaperCategoryId #派单品类id + ${paperMillScrapPaperCategoryName} Get From Dictionary ${items} paperMillScrapPaperCategoryName #品类名称 + ${paperMillFinancialServiceProviderId} Get From Dictionary ${items} paperMillFinancialServiceProviderId #支付渠道id + ${paperMillFinancialServiceProviderName} Get From Dictionary ${items} paperMillFinancialServiceProviderName #支付渠道name + Exit For Loop If '${SCInstanceId}'=='${supplyChainInstanceId}' + END + ${paperMillFinancialServiceProviderName} Set Variable If '${paperMillFinancialServiceProviderName}'=='${null}' null ${paperMillFinancialServiceProviderName} + Set Global Variable ${id} + Set Global Variable ${isHosted} + Set Global Variable ${orderTime} + Set Global Variable ${sellerName} + Set Global Variable ${sellerOrgId} + Set Global Variable ${arrivalTime} + Set Global Variable ${paperMillOrgId} + Set Global Variable ${dispatchStatus} + Set Global Variable ${transactionType} + Set Global Variable ${orderPlacerPhone} + Set Global Variable ${receivingPaperMillName} + Set Global Variable ${supplyReservationOrderId} + Set Global Variable ${paperMillScrapPaperCategoryId} + Set Global Variable ${paperMillScrapPaperCategoryName} + Set Global Variable ${paperMillFinancialServiceProviderId} + Set Global Variable ${paperMillFinancialServiceProviderName} + +orderdetail + #订单详情 + Create Session order ${ztbscops} ${ztbsc_header} + ${reps} GET On Session order ztb-supply-chain-service/admin/get/supply-reservation-order-detail params=supplyChainInstanceId=${supplyChainInstanceId} + Should Be Equal As Strings ${reps.json()['code']} 0 + +Direct_saletype + #选择交易类型-直卖 + Create Session order ${ztbscops} ${ztbsc_header} + ${reps} GET On Session order ztb-supply-chain-service/admin/get/financial-service-provider/for-dispatch params=paperMillCategoryId=${paperMillScrapPaperCategoryId}&supplierOrgId=${sellerOrgId}&paperMillOrgId=${paperMillOrgId} + ${dispatchSaleServiceProviderId} Get From Dictionary ${reps.json()['data']} dispatchSaleServiceProviderId #直卖采购策略id + Set Global Variable ${dispatchSaleServiceProviderId} + +Agent_saletype + #选择交易类型-代卖 + Create Session order center ${ztbscops} ${ztbsc_header} + ${reps} GET On Session order center ztb-supply-chain-service/admin/get/financial-service-provider/for-dispatch params=paperMillCategoryId=${paperMillScrapPaperCategoryId}&supplierOrgId=${sellerOrgId}&paperMillOrgId=${paperMillOrgId} + ${proxySaleServiceProviderList} Get From Dictionary ${reps.json()['data']} proxySaleServiceProviderList #代卖供应链id列表 + ${SupplyChainId} Evaluate random.choice(${proxySaleServiceProviderList}) random + ${paperMillFinancialServiceProviderId} Get From Dictionary ${SupplyChainId} paperMillFinancialServiceProviderId #随机选择供应链id + ${paperMillFinancialServiceProviderName} Get From Dictionary ${SupplyChainId} serviceProviderOrgName #随机选择供应链名称 + Set Global Variable ${paperMillFinancialServiceProviderId} + Set Global Variable ${paperMillFinancialServiceProviderName} + +Direct_dispatch + #提交直卖派单 + Create Session order center ${ztbscops} ${ztbsc_header} + ${data} Set Variable { \ \ \ \ "id":"${id}", \ \ \ \ "supplyChainInstanceId":"${supplyChainInstanceId}", \ \ \ \ "supplyReservationOrderId":"${supplyReservationOrderId}", \ \ \ \ "plateNumber":"${plateNumber}", \ \ \ \ "sellerOrgId":"${sellerOrgId}", \ \ \ \ "sellerName":"${sellerName}", \ \ \ \ "orderPlacerPhone":"${orderPlacerPhone}", \ \ \ \ "paperMillScrapPaperCategoryName":"${paperMillScrapPaperCategoryName}", \ \ \ \ "paperMillScrapPaperCategoryId":"${paperMillScrapPaperCategoryId}", \ \ \ \ "arrivalTime":"${arrivalTime}", \ \ \ \ "paperMillOrgId":"${paperMillOrgId}", \ \ \ \ "receivingPaperMillName":"${receivingPaperMillName}", \ \ \ \ "isHosted":"${isHosted}", \ \ \ \ "transactionType":"${transactionType}", \ \ \ \ "paperMillFinancialServiceProviderId":"${dispatchSaleServiceProviderId}", \ \ \ \ "orderTime":"${orderTime}", \ \ \ \ "orderPlacerName":"${realName}", \ \ \ \ "dispatchStatus":"${dispatchStatus}", \ \ \ \ "dispatchSaleServiceProviderId":"${dispatchSaleServiceProviderId}" } + ${reps} POST On Session order center ztb-supply-chain-service/admin/dispatch/supply-reservation-order ${data.encode('utf-8')} + Should Be Equal As Strings ${reps.json()['message']} successful + sleep 1 + +Agent_dispatch + #提交代卖派单 + Create Session order center ${ztbscops} ${ztbsc_header} + ${data} Set Variable { \ \ \ \ "id":"${id}", \ \ \ \ "supplyChainInstanceId":"${supplyChainInstanceId}", \ \ \ \ "supplyReservationOrderId":"${supplyReservationOrderId}", \ \ \ \ "plateNumber":"${plateNumber}", \ \ \ \ "sellerOrgId":"${sellerOrgId}", \ \ \ \ "sellerName":"${sellerName}", \ \ \ \ "orderPlacerPhone":"${orderPlacerPhone}", \ \ \ \ "paperMillScrapPaperCategoryName":"${paperMillScrapPaperCategoryName}", \ \ \ \ "paperMillScrapPaperCategoryId":"${paperMillScrapPaperCategoryId}", \ \ \ \ "arrivalTime":"${arrivalTime}", \ \ \ \ "paperMillOrgId":"${paperMillOrgId}", \ \ \ \ "receivingPaperMillName":"${receivingPaperMillName}", \ \ \ \ "isHosted":"${isHosted}", \ \ \ \ "transactionType":"${transactionType}", \ \ \ \ "paperMillFinancialServiceProviderId":"${paperMillFinancialServiceProviderId}", \ \ \ \ "orderTime":"${orderTime}", \ \ \ \ "orderPlacerName":"${realName}", \ \ \ \ "dispatchStatus":"${dispatchStatus}", \ \ \ \ "dispatchSaleServiceProviderId":"${paperMillFinancialServiceProviderId}" } + ${reps} POST On Session order center ztb-supply-chain-service/admin/dispatch/supply-reservation-order ${data.encode('utf-8')} + Should Be Equal As Strings ${reps.json()['message']} successful + sleep 1 diff --git a/2-Platform/Order/2-Order_management.robot b/2-Platform/Order/2-Order_management.robot new file mode 100644 index 0000000..cd06641 --- /dev/null +++ b/2-Platform/Order/2-Order_management.robot @@ -0,0 +1,270 @@ +*** Settings *** +Library RequestsLibrary +Library Collections +Library DateTime +Library String + +*** Test Cases *** +get_order_list + #获取订单列表 + Create Session order ${ztbscops} ${ztbsc_header} + ${reps} GET On Session order ztb-supply-chain-service/admin/get/supply-chain-instance-list params=supplyChainInstanceId=${supplyChainInstanceId}&pageNum=1&pageSize=10 + ${transactionType} Get From Dictionary ${reps.json()['data']['records'][0]} transactionType #订单类型,1:直卖;2:代卖 + Set Global Variable ${transactionType} + +confirm_order + #预约送货 + Create Session order ${ztbscops} ${ztbsc_header} + ${reps} GET On Session order ztb-supply-chain-service/admin/get/supply-reservation-order-detail params=supplyChainInstanceId=${supplyChainInstanceId} + ${id} Get From Dictionary ${reps.json()['data']} id #预约唯一标识 + ${arrivalTime} Get From Dictionary ${reps.json()['data']} arrivalTime #送货时间 + ${placeOrderRemark} Get From Dictionary ${reps.json()['data']} placeOrderRemark #订单备注 + ${paperMillReservationOrderId} Get From Dictionary ${reps.json()['data']} paperMillReservationOrderId #送货单号 + ${placeOrderRemark} Set Variable If '${placeOrderRemark}'=='${null}' null ${placeOrderRemark} + ${paperMillReservationOrderId} Set Variable If '${paperMillReservationOrderId}'=='${null}' null ${paperMillReservationOrderId} + Set Global Variable ${id} + Set Global Variable ${arrivalTime} + Set Global Variable ${placeOrderRemark} + Set Global Variable ${paperMillReservationOrderId} + #预约订单 + ${data} Set Variable { \ \ \ \ "arrivalTime":"${arrivalTime}", \ \ \ \ "placeOrderRemark":"${placeOrderRemark}", \ \ \ \ "id":"${id}", \ \ \ \ "paperMillReservationOrderId":"${paperMillReservationOrderId}" } + ${reps} POST On Session order ztb-supply-chain-service/admin/confirm/supply-reservation-order ${data.encode('utf-8')} + Should Be Equal As Strings ${reps.json()['message']} successful + sleep 2 + +Direc_Upload_weight + #上传磅单--直卖 + ${DataTime} Get Current Date result_format=%Y-%m-%d %H:%M:%S + Create Session order ${ztbscops} ${ztbsc_header} + ${reps} GET On Session order ztb-supply-chain-service/admin/get/order-detail params=supplyChainInstanceId=${supplyChainInstanceId} + ${id} Get From Dictionary ${reps.json()['data']} id #磅单唯一标识 + ${type} Get From Dictionary ${reps.json()['data']['orderList'][0]['contractTermList'][0]} type #账期类型:常规 + ${name} Get From Dictionary ${reps.json()['data']['orderList'][0]['contractTermList'][0]} name #付款账期 + ${value} Get From Dictionary ${reps.json()['data']['orderList'][0]['contractTermList'][0]} value #付款账期时常 + ${orderId} Get From Dictionary ${reps.json()['data']['orderList'][0]} id #采购订单编号 + ${roleList} Get From List ${reps.json()['data']['orderList'][0]['roleList']} 0 #组织类型 + ${adjustFee} Get From Dictionary ${reps.json()['data']['orderList'][0]} adjustFee #应付调节费 + ${RebateType} Get From Dictionary ${reps.json()['data']['orderList'][0]['contractTermList'][1]} type #返点不开票 + ${RebateName} Get From Dictionary ${reps.json()['data']['orderList'][0]['contractTermList'][1]} name #返点策略 + ${RebateValue} Get From Dictionary ${reps.json()['data']['orderList'][0]['contractTermList'][1]} value #采购返点 + ${displayName} Get From Dictionary ${reps.json()['data']['orderList'][0]['contractTermList'][0]} displayName #付款展示名称 + ${supplyChainId} Get From Dictionary ${reps.json()['data']['reservationOrder']} supplyChainId #采购策略id + ${transactionType} Get From Dictionary ${reps.json()['data']} transactionType #订单类型 + ${RebateDisplayname} Get From Dictionary ${reps.json()['data']['orderList'][0]['contractTermList'][1]} displayName #返点展示名称 + ${RebateValue} Set Variable If '${RebateValue}'=='${null}' null ${RebateValue} + ${paymentDueDate} Add Time To Date ${DataTime} ${value} days + ${paymentDueDate} Get Substring ${paymentDueDate} 0 19 + ${adjustFee} Set Variable 2000 #应付调节费 + ${reciverble_adjustFee} Set Variable 500 #应收调节费 + ${netWeight} Set Variable 11000 + ${settlementWeight} Set Variable 10600 + ${qualityInspectionSheetDeductionRulesList} Set Variable \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "strategyName":101, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "strategyType":1011, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "value":0.002 \ \ \ \ \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "strategyName":103, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "strategyType":1011, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "value":0.001 \ \ \ \ \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "strategyName":104, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "strategyType":1011, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "value":0.001 \ \ \ \ \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "strategyName":102, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "strategyType":1011, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "value":0.002 \ \ \ \ \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "strategyName":105, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "strategyType":1011, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "value":0.003 \ \ \ \ \ \ \ \ \ \ \ \ } + Set Global Variable ${id} + Set Global Variable ${type} + Set Global Variable ${name} + Set Global Variable ${value} + Set Global Variable ${orderId} + Set Global Variable ${DataTime} + Set Global Variable ${roleList} + Set Global Variable ${adjustFee} + Set Global Variable ${RebateType} + Set Global Variable ${RebateName} + Set Global Variable ${RebateValue} + Set Global Variable ${displayName} + Set Global Variable ${supplyChainId} + Set Global Variable ${paymentDueDate} + Set Global Variable ${transactionType} + Set Global Variable ${RebateDisplayname} + #采购策略品类信息 + ${reps} GET On Session order ztb-supply-chain-service/user/list/paper-mill-purchase/scrap-paper-category-price params=supplyChainId=${supplyChainId}&dateTime=${DataTime} + ${categorylist} Get From Dictionary ${reps.json()} data #品类列表 + ${categoryInfo} Evaluate random.choice(${categorylist}) random + ${categoryPrice} Get From Dictionary ${categoryInfo} categoryPrice #品类报价 + ${paperMillCategoryId} Get From Dictionary ${categoryInfo} paperMillCategoryId #品类id + ${categoryDisplayName} Get From Dictionary ${categoryInfo} categoryDisplayName #供应链品类展示名称 + ${paperMillCategoryName} Get From Dictionary ${categoryInfo} paperMillCategoryName #纸厂品类名称 + ${categoryName} Set Variable If '${transactionType}'==${1} ${paperMillCategoryName} ${categoryDisplayName} + #上传磅单图片 + ${filepath} Evaluate open('./21042217001449712.png','rb') + ${image} Evaluate open('./21042217001449712.png','rb') + ${file} Create Dictionary filepath=${filepath} image=${image} + Create Session order ${ztbops} + ${reps} POST On Session order recycle-user-center/upload/image files=${file} + ${pictures} Get From Dictionary ${reps.json()} data + Should Be Equal As Strings ${reps.json()['message']} successful + Set Global Variable ${pictures} + #选择磅单日期 + Create Session order ${ztbscops} ${ztbsc_header} + ${reps} GET On Session order ztb-supply-chain-service/user/list/paper-mill-purchase/scrap-paper-category-price params=supplyChainId=${supplyChainId}&dateTime=${DataTime} + Should Be Equal As Strings ${reps.json()['message']} successful + #计算订单总金额 + Create Session order ${ztbscops} ${ztbsc_header} + ${data} Set Variable { \ \ \ \ "netWeight":${netWeight}, \ \ \ \ "calculateContractList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "contractTermList":[ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "displayName":"${displayName}", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "name":${name}, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "type":${type}, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "value":"${value}" \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "displayName":"${RebateDisplayname}", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "name":${RebateName}, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "type":${RebateType}, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "value":${RebateValue} \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ } \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ "roleList":[${roleList}], \ \ \ \ \ \ \ \ \ \ \ \ "adjustFee":${adjustFee} \ \ \ \ \ \ \ \ } \ \ \ \ ], \ \ \ \ "qualityInspectionSheetItem":{ \ \ \ \ \ \ \ \ "settlementWeight":${settlementWeight}, \ \ \ \ \ \ \ \ "unitPrice":"${categoryPrice}" \ \ \ \ }, \ \ \ \ "qualityInspectionSheetDeductionRulesList":[ \ \ \ \ \ \ \ \ ${qualityInspectionSheetDeductionRulesList} \ \ \ \ ] } + ${reps} POST On Session order ztb-supply-chain-service/calculate/order-price ${data.encode('utf-8')} + ${price} Get From Dictionary ${reps.json()['data']['calculateContractList'][0]} price #采购单价 + ${amount} Get From Dictionary ${reps.json()['data']['calculateContractList'][0]} amount #应付金额 + ${deductedPoint} Get From Dictionary ${reps.json()['data']} deductedPoint #扣点 + ${totalDeduction} Get From Dictionary ${reps.json()['data']} totalDeduction #补贴与扣款 + Set Global Variable ${price} + Set Global Variable ${amount} + Set Global Variable ${deductedPoint} + Set Global Variable ${totalDeduction} + #判断重复订单 + ${reps} GET On Session order ztb-supply-chain-service/user/get/repeat-order params=id=${id}&plateNumber=${plateNumber}&settlementWeight=5000&weightingDateTime=${DataTime} + Should Be Equal As Strings ${reps.json()['message']} successful + #提交磅单 + ${weightData} Set Variable { \ \ \ \ "order":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "id":"${orderId}", \ \ \ \ \ \ \ \ \ \ \ \ "paymentDueDate":"${paymentDueDate}", \ \ \ \ \ \ \ \ \ \ \ \ "adjustFee":${adjustFee} \ \ \ \ \ \ \ \ } \ \ \ \ ], \ \ \ \ "plateNumber":"${plateNumber}", \ \ \ \ "supplyChainId":"${supplyChainId}", \ \ \ \ "qualityInspectionSheet":{ \ \ \ \ \ \ \ \ "qualityInspectionSheetDeductionRulesList":[ \ \ \ \ \ \ \ \ \ \ \ \ ${qualityInspectionSheetDeductionRulesList} \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ "qualityInspectionSheetItem":{ \ \ \ \ \ \ \ \ \ \ \ \ "paperMillScrapPaperCategoryId":"${paperMillCategoryId}", \ \ \ \ \ \ \ \ \ \ \ \ "paperMillScrapPaperCategoryName":"${categoryName}", \ \ \ \ \ \ \ \ \ \ \ \ "unitPrice":"${categoryPrice}", \ \ \ \ \ \ \ \ \ \ \ \ "settlementWeight":${settlementWeight} \ \ \ \ \ \ \ \ } \ \ \ \ }, \ \ \ \ "supplyChainInstanceId":"${supplyChainInstanceId}", \ \ \ \ "weightNote":{ \ \ \ \ \ \ \ \ "imageUrlList":[ \ \ \ \ \ \ \ \ \ \ \ \ "${pictures}" \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ "weightingDateTime":"${DataTime}", \ \ \ \ \ \ \ \ "netWeight":${netWeight} \ \ \ \ }, \ \ \ \ "paperMillWeightNoteImageIdList":[ \ \ \ \ \ ] } + ${reps} POST On Session order ztb-supply-chain-service/admin/save/weight-note ${weightData.encode('utf-8')} + Should Be Equal As Strings ${reps.json()['message']} successful + sleep 0.5 + +Agent_Upload_weight + #上传磅单--代卖 + ${DataTime} Get Current Date result_format=%Y-%m-%d %H:%M:%S + Create Session order ${ztbscops} ${ztbsc_header} + ${reps} GET On Session order ztb-supply-chain-service/admin/get/order-detail params=supplyChainInstanceId=${supplyChainInstanceId} + ${id} Get From Dictionary ${reps.json()['data']} id #磅单唯一标识 + ${saleId} Get From Dictionary ${reps.json()['data']['orderList'][1]} id #销售订单编号 + ${adjustFee} Get From Dictionary ${reps.json()['data']['orderList'][0]} adjustFee #应付调节费 + ${purchaseId} Get From Dictionary ${reps.json()['data']['orderList'][0]} id #采购订单编号 + ${storeOrgId} Get From Dictionary ${reps.json()['data']['reservationOrder']} storeOrgId #店长组织id + ${supplyChainId} Get From Dictionary ${reps.json()['data']['reservationOrder']} supplyChainId #采购策略id + ${paperMillOrgId} Get From Dictionary ${reps.json()['data']['reservationOrder']} paperMillOrgId #纸厂组织id + ${Agent_roleList} Get From Dictionary ${reps.json()['data']['orderList'][0]} roleList #代理商组织类型 + ${transactionType} Get From Dictionary ${reps.json()['data']} transactionType #订单类型 + ${Papermill_roleList} Get From Dictionary ${reps.json()['data']['orderList'][1]} roleList #造纸厂织类型 + ${adjustFee} Set Variable 150 #应付调节费 + ${reciverble_adjustFee} Set Variable 100 #应收调节费 + ${netWeight} Set Variable 1130 + ${settlementWeight} Set Variable 1100 + ${qualityInspectionSheetDeductionRulesList} Set Variable \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "strategyName":101, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "strategyType":1011, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "value":0.001 \ \ \ \ \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "strategyName":103, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "strategyType":1011, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "value":0.001 \ \ \ \ \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "strategyName":104, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "strategyType":1011, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "value":0.001 \ \ \ \ \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "strategyName":102, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "strategyType":1011, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "value":0.001 \ \ \ \ \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "strategyName":105, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "strategyType":1011, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "value":0.001 \ \ \ \ \ \ \ \ \ \ \ \ } + Set Global Variable ${id} + Set Global Variable ${saleId} + Set Global Variable ${DataTime} + Set Global Variable ${adjustFee} + Set Global Variable ${purchaseId} + Set Global Variable ${storeOrgId} + Set Global Variable ${supplyChainId} + Set Global Variable ${paperMillOrgId} + Set Global Variable ${Agent_roleList} + Set Global Variable ${transactionType} + Set Global Variable ${Papermill_roleList} + #采购策略品类信息 + ${reps} GET On Session order ztb-supply-chain-service/list/scrap-paper-category/by-supply_chain_id params=supplyChainId=${supplyChainId} + ${categorylist} Get From Dictionary ${reps.json()} data #品类列表 + ${categoryInfo} Evaluate random.choice(${categorylist}) random + ${categoryPrice} Get From Dictionary ${categoryInfo} categoryPrice #品类报价 + ${paperMillCategoryId} Get From Dictionary ${categoryInfo} paperMillCategoryId #品类id + ${categoryDisplayName} Get From Dictionary ${categoryInfo} categoryDisplayName #供应链品类展示名称 + ${paperMillCategoryName} Get From Dictionary ${categoryInfo} paperMillCategoryName #纸厂品类名称 + ${categoryName} Set Variable If '${transactionType}'==${1} ${paperMillCategoryName} ${categoryDisplayName} + #上传磅单图片 + ${filepath} Evaluate open('./21042217001449712.png','rb') + ${image} Evaluate open('./21042217001449712.png','rb') + ${file} Create Dictionary filepath=${filepath} image=${image} + Create Session order ${ztbops} + ${reps} POST On Session order recycle-user-center/upload/image files=${file} + ${pictures} Get From Dictionary ${reps.json()} data + Should Be Equal As Strings ${reps.json()['message']} successful + Set Global Variable ${pictures} + #选择磅单日期 + Create Session order ${ztbscops} ${ztbsc_header} + ${reps} GET On Session order ztb-supply-chain-service/user/get/supply-chain/by-weighting-date-time params=paperMillOrgId=${paperMillOrgId}&storeOrgId=${storeOrgId}&weightingDateTime=${DataTime}&supplyChainInstanceId=${supplyChainInstanceId} + ${contractList} Get From Dictionary ${reps.json()['data']} contractList #供应链合同信息 + ${agent_sellingFee} Get From Dictionary ${contractList[0]['contractTermList'][0]} displayName #代理商代卖费 + ${agent_sellingName} Get From Dictionary ${contractList[0]['contractTermList'][0]} name #代理商代卖费标识 + ${agent_sellingType} Get From Dictionary ${contractList[0]['contractTermList'][0]} type #代理商代卖费类型 + ${agent_sellingValue} Get From Dictionary ${contractList[0]['contractTermList'][0]} value #代理商代卖费数据 + ${agent_Paymentname} Get From Dictionary ${contractList[0]['contractTermList'][1]} name #代理商付款账期标识 + ${agent_Paymenttype} Get From Dictionary ${contractList[0]['contractTermList'][1]} type #代理商付款账期类型 + ${agent_Paymentvalue} Get From Dictionary ${contractList[0]['contractTermList'][1]} value #代理商付款账期数据 + ${agent_Paymentperiod} Get From Dictionary ${contractList[0]['contractTermList'][1]} displayName #代理商付款账期 + ${agent_Rebatename} Get From Dictionary ${contractList[0]['contractTermList'][2]} name #代理商返点策略标识 + ${agent_Rebatetype} Get From Dictionary ${contractList[0]['contractTermList'][2]} type #代理商返点策略类型 + ${agent_Rebatevalue} Get From Dictionary ${contractList[0]['contractTermList'][2]} value #代理商返点策略数据 + ${agent_Rebatestrategy} Get From Dictionary ${contractList[0]['contractTermList'][2]} displayName #代理商返点策略 + ${papermill_Paymentname} Get From Dictionary ${contractList[1]['contractTermList'][0]} name #造纸厂付款账期标识 + ${papermill_Paymenttype} Get From Dictionary ${contractList[1]['contractTermList'][0]} type #造纸厂付款账期类型 + ${papermill_Paymentvalue} Get From Dictionary ${contractList[1]['contractTermList'][0]} value #造纸厂付款账期数据 + ${papermill_Paymentperiod} Get From Dictionary ${contractList[1]['contractTermList'][0]} displayName #造纸厂付款账期 + ${papermill_Rebatename} Get From Dictionary ${contractList[1]['contractTermList'][1]} name #造纸厂返点策略标识 + ${papermill_Rebatetype} Get From Dictionary ${contractList[1]['contractTermList'][1]} type #造纸厂返点策略类型 + ${papermill_Rebatevalue} Get From Dictionary ${contractList[1]['contractTermList'][1]} value #造纸厂返点策略数据 + ${papermill_Rebatestrategy} Get From Dictionary ${contractList[1]['contractTermList'][1]} displayName #造纸厂返点策略 + ${agent_Rebatevalue} Set Variable If '${agent_Rebatevalue}'=='${null}' null ${agent_Rebatevalue} + ${papermill_Rebatevalue} Set Variable If '${papermill_Rebatevalue}'=='${null}' null ${papermill_Rebatevalue} + ${agent_paymentDueDate} Add Time To Date ${DataTime} ${agent_Paymentvalue} days + ${agent_paymentDueDate} Get Substring ${agent_paymentDueDate} 0 19 #代理商计划付款时间 + ${papermill_paymentDueDate} Add Time To Date ${DataTime} ${papermill_Paymentvalue} days + ${papermill_paymentDueDate} Get Substring ${papermill_paymentDueDate} 0 19 #造纸厂计划付款时间 + #计算订单总金额 + Create Session order ${ztbscops} ${ztbsc_header} + ${data} Set Variable { \ \ \ \ "netWeight":${netWeight}, \ \ \ \ "calculateContractList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "contractTermList":[ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "displayName":"${agent_sellingFee}", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "name":${agent_sellingName}, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "type":${agent_sellingType}, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "value":"${agent_sellingValue}" \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "displayName":"${agent_Paymentperiod}", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "name":${agent_Paymentname}, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "type":${agent_Paymenttype}, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "value":${agent_Paymentvalue} \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "displayName":"${agent_Rebatestrategy}", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "name":${agent_Rebatename}, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "type":${agent_Rebatetype}, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "value":${agent_Rebatevalue} \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ } \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ "roleList":${Agent_roleList}, \ \ \ \ \ \ \ \ \ \ \ \ "adjustFee":${reciverble_adjustFee} \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "contractTermList":[ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "displayName":"${papermill_Paymentperiod}", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "name":${papermill_Paymentname}, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "type":${papermill_Paymenttype}, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "value":"${papermill_Paymentvalue}" \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "displayName":"${papermill_Rebatestrategy}", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "name":${papermill_Rebatename}, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "type":${papermill_Rebatetype}, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "value":"${papermill_Rebatevalue}" \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ } \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ "roleList":${Papermill_roleList}, \ \ \ \ \ \ \ \ \ \ \ \ "adjustFee":${adjustFee} \ \ \ \ \ \ \ \ } \ \ \ \ ], \ \ \ \ "qualityInspectionSheetItem":{ \ \ \ \ \ \ \ \ "settlementWeight":${settlementWeight}, \ \ \ \ \ \ \ \ "unitPrice":"${categoryPrice}" \ \ \ \ }, \ \ \ \ "qualityInspectionSheetDeductionRulesList":[ ${qualityInspectionSheetDeductionRulesList} ] } + ${reps} POST On Session order ztb-supply-chain-service/calculate/order-price ${data.encode('utf-8')} + ${salePrice} Get From Dictionary ${reps.json()['data']['calculateContractList'][1]} price #销售单价 + ${Agent_amount} Get From Dictionary ${reps.json()['data']['calculateContractList'][0]} amount #代理商应付金额 + ${deductedPoint} Get From Dictionary ${reps.json()['data']} deductedPoint #扣点 + ${purchasePrice} Get From Dictionary ${reps.json()['data']['calculateContractList'][0]} price #采购单价 + ${totalDeduction} Get From Dictionary ${reps.json()['data']} totalDeduction #补贴与扣款 + ${Agent_receivable} Get From Dictionary ${reps.json()['data']['calculateContractList'][1]} amount #代理商应收金额 + Set Global Variable ${salePrice} + Set Global Variable ${Agent_amount} + Set Global Variable ${purchasePrice} + Set Global Variable ${deductedPoint} + Set Global Variable ${totalDeduction} + Set Global Variable ${Agent_receivable} + #判断重复订单 + ${reps} GET On Session order ztb-supply-chain-service/user/get/repeat-order params=id=${id}&plateNumber=${plateNumber}&settlementWeight=11300&weightingDateTime=${DataTime} + Should Be Equal As Strings ${reps.json()['message']} successful + #提交磅单 + ${weightData} Set Variable { \ \ \ \ "order":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "id":"${purchaseId}", \ \ \ \ \ \ \ \ \ \ \ \ "paymentDueDate":"${agent_paymentDueDate}", \ \ \ \ \ \ \ \ \ \ \ \ "adjustFee":${adjustFee} \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "id":"${saleId}", \ \ \ \ \ \ \ \ \ \ \ \ "paymentDueDate":"${papermill_paymentDueDate}", \ \ \ \ \ \ \ \ \ \ \ \ "adjustFee":${reciverble_adjustFee} \ \ \ \ \ \ \ \ } \ \ \ \ ], \ \ \ \ "plateNumber":"${plateNumber}", \ \ \ \ "supplyChainId":"${supplyChainId}", \ \ \ \ "qualityInspectionSheet":{ \ \ \ \ \ \ \ \ "qualityInspectionSheetDeductionRulesList":[ \ \ \ \ \ \ \ \ \ \ \ \ ${qualityInspectionSheetDeductionRulesList} \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ "qualityInspectionSheetItem":{ \ \ \ \ \ \ \ \ \ \ \ \ "paperMillScrapPaperCategoryId":"${paperMillCategoryId}", \ \ \ \ \ \ \ \ \ \ \ \ "paperMillScrapPaperCategoryName":"${categoryName}", \ \ \ \ \ \ \ \ \ \ \ \ "unitPrice":"${categoryPrice}", \ \ \ \ \ \ \ \ \ \ \ \ "settlementWeight":${settlementWeight} \ \ \ \ \ \ \ \ } \ \ \ \ }, \ \ \ \ "supplyChainInstanceId":"${supplyChainInstanceId}", \ \ \ \ "weightNote":{ \ \ \ \ \ \ \ \ "imageUrlList":[ \ \ \ \ \ \ \ \ \ \ \ \ "${pictures}" \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ "weightingDateTime":"${DataTime}", \ \ \ \ \ \ \ \ "netWeight":${netWeight} \ \ \ \ }, \ \ \ \ "paperMillWeightNoteImageIdList":[ \ \ \ \ \ ] } + ${reps} POST On Session order ztb-supply-chain-service/admin/save/weight-note ${weightData.encode('utf-8')} + Should Be Equal As Strings ${reps.json()['message']} successful + sleep 0.5 + +Order_audit + #订单审核 + Create Session order ${ztbscops} ${ztbsc_header} + ${reps} GET On Session order ztb-supply-chain-service/admin/get/supply-order-audit-list params=auditStatus=0&supplyChainInstanceId=${supplyChainInstanceId}&pageNum=1&pageSize=10 + ${AuditId} Get From Dictionary ${reps.json()['data']['records'][0]} id #审核单唯一标识 + Set Global Variable ${AuditId} + #确认审核--审核通过 + ${auditData} Set Variable { \ \ \ \ "id":"${AuditId}", \ \ \ \ "auditStatus":1 } + ${reps} POST On Session order ztb-supply-chain-service/admin/audit/supply-order ${auditData.encode('utf-8')} + Should Be Equal As Strings ${reps.json()['message']} successful + sleep 1 + +Order_settlement + #订单结算 + Create Session order ${ztbscops} ${ztbsc_header} + ${reps} GET On Session order ztb-supply-chain-service/admin/get/payment-order-list params=status=0&supplyChainInstanceId=${supplyChainInstanceId}&pageNum=1&pageSize=10 + ${settlementId} Get From Dictionary ${reps.json()['data']['records'][0]} id #审核单唯一标识 + Set Global Variable ${settlementId} + #确认结算--结算通过 + ${settlementData} Set Variable { \ \ \ \ "status":1, \ \ \ \ "id":"${settlementId}" } + ${reps} POST On Session order ztb-supply-chain-service/admin/audit/payment-order ${settlementData.encode('utf-8')} + Should Be Equal As Strings ${reps.json()['message']} successful + sleep 1 + +Order_payment + #付款 + Create Session order ${ztbscops} ${ztbsc_header} + ${reps} GET On Session order ztb-supply-chain-service/admin/list/scrap-paper-supply-payment-order params=status=1&supplyChainInstanceId=${supplyChainInstanceId}&pageNum=1&pageSize=10 + ${paymentId} Get From Dictionary ${reps.json()['data']['records'][0]} id #付款单唯一标识 + Set Global Variable ${paymentId} + #确认付款--付款通过 + ${paymentData} Set Variable { \ \ \ \ "dtoList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "id":"${paymentId}", \ \ \ \ \ \ \ \ \ \ \ \ "status":2 \ \ \ \ \ \ \ \ } \ \ \ \ ] } + ${reps} POST On Session order ztb-supply-chain-service/admin/operate/payment ${paymentData.encode('utf-8')} + Should Be Equal As Strings ${reps.json()['message']} successful + +Order_receivable + #收款管理 + Create Session order ${ztbscops} ${ztbsc_header} + ${reps} GET On Session order ztb-supply-chain-service/admin/get/receivable-order-page params=status=1&supplyChainInstanceId=${supplyChainInstanceId}&pageNum=1&pageSize=10 + ${receivableId} Get From Dictionary ${reps.json()['data']['records'][0]} id #收款单唯一标识 + ${unpaidAmount} Get From Dictionary ${reps.json()['data']['records'][0]} unpaidAmount #未收金额 + ${payableAmount} Get From Dictionary ${reps.json()['data']['records'][0]} payableAmount #应收金额 + #确认收款--收款通过 + ${receivableData} Set Variable { \ \ \ \ "id":"${receivableId}", \ \ \ \ "unpaidAmount":${unpaidAmount}, \ \ \ \ "unpaidAmountBackup":${unpaidAmount}, \ \ \ \ "payableAmount":${payableAmount}, \ \ \ \ "paidAmount":${payableAmount}, \ \ \ \ "lastPaymentTime":"${DataTime}", \ \ \ \ "remark":"测试收款", \ \ \ \ "bankFlowNo":"${DataTime}" } + ${reps} POST On Session order ztb-supply-chain-service/admin/confirm/receivable-order ${receivableData.encode('utf-8')} + Should Be Equal As Strings ${reps.json()['message']} successful diff --git a/2-Platform/Order/__init__.txt b/2-Platform/Order/__init__.txt new file mode 100644 index 0000000..e69de29 diff --git a/2-Platform/Organization.robot b/2-Platform/Organization.robot new file mode 100644 index 0000000..b4c8935 --- /dev/null +++ b/2-Platform/Organization.robot @@ -0,0 +1,70 @@ +*** Settings *** +Library RequestsLibrary +Library Collections +Library DateTime +Library urllib3 + +*** Test Cases *** +create_trader_org + #创建代理商组织 + Disable Warnings + Create Session ZTBTSC ${ztbscops} ${ztbsc_header} + ${data} Set Variable {"fullName":"自动化测试代理商"} + ${reps} Post On Session ZTBTSC ztb-user-enterprise-service/admin/scrap-paper/agent/create ${data.encode('utf-8')} + ${trader_orgId} Get From Dictionary ${reps.json()["data"]} organizationId #获取代理商组织id + ${TraderId} Get From Dictionary ${reps.json()["data"]} id #获取代理商id + Should Be Equal As Strings ${reps.json()["message"]} successful + Should Be Equal As Numbers ${reps.json()["code"]} 0 + Set Global Variable ${trader_orgId} + Set Global Variable ${TraderId} + #修改组织税点信息 + Create Session ZTBTSC ${uecops} ${ztbsc_header} + ${enterprise_data} Set Variable { \ \ \ \ "inputTaxPoint":"2051,2052", \ \ \ \ "salesTaxPoint":2053, \ \ \ \ "organizationId":"${trader_orgId}" } + ${reps} Post On Session ZTBTSC uec/admin/save/enterprise-tax-info ${enterprise_data.encode('utf-8')} + ${trader_baseinfo} Get On Session ZTBTSC uec/admin/get/enterprise/detail/by-org-id params=orgId=${trader_orgId} #获取代理商基础信息 + ${trader_Name} Get From Dictionary ${trader_baseinfo.json()["data"]} name + Set Global Variable ${trader_Name} + +get_Organizational basis + #创建组织店铺信息 + Disable Warnings + Create Session ZTBTSC ${ztbscops} ${ztbsc_header} + ${store_data} Set Variable { \ \ \ \ "id":null, \ \ \ \ "ownerAgentId":"${TraderId}", \ \ \ \ "name":"自动化测试代理商的店铺", \ \ \ \ "introduction":null, \ \ \ \ "logoImgUrl":"", \ \ \ \ "offlineHistoricalTradingVolume":null } + ${store_repose} Post On Session ZTBTSC ztb-supply-chain-service/admin/save/scrap-paper-store ${store_data.encode('utf-8')} + ${store_info} Get On Session ZTBTSC ztb-supply-chain-service/admin/scrap-paper/store/get/${TraderId} #获取组织店铺信息 + ${store_id} Get From Dictionary ${store_info.json()["data"]} id + Set Global Variable ${store_id} + ${business_reps} Get On Session ZTBTSC ztb-user-enterprise-service/admin/scrap-paper/agent/get/business-info/${TraderId} #获取组织经营信息 + Create Session ZTBTSC ${uecops} ${ztbsc_header} + ${enterprise_reps} Get On Session ZTBTSC uec/admin/get/enterprise/detail/by-org-id params=orgId=${trader_orgId} #获取组织企业信息 + +create_supply + #选择代理纸厂匹配税点 + Disable Warnings + Create Session ZTBTSC ${ztbscops} ${ztbsc_header} + ${papermill_list} Get On Session ZTBTSC ztb-user-enterprise-service/admin/get/paper-mill-list/by-name params=pageNum=1&pageSize=30 + ${papermill_data} Get From Dictionary ${papermill_list.json()["data"]} records + FOR ${items} IN @{papermill_data} + ${papermill_name} Get From Dictionary ${items} paperMillName + ${papermill_orgid} Get From Dictionary ${items} paperMillOrgId + ${papermill_id} Get From Dictionary ${items} paperMillId + Exit For Loop If '${papermill_name}'=='${papermill_Name}' + END + Set Global Variable ${papermill_orgid} + ${match_point_reps} Get On Session ZTBTSC ztb-supply-chain-service/admin/match/tax-point params=agentOrgId=${trader_orgId}&paperMillOrgId=${papermill_orgid} + #创建供应链 + ${supply_data} Set Variable { \ \ \ \ "receivingPaperMillId":"${papermill_Id}", \ \ \ \ "storeId":"${store_id}", \ \ \ \ "purchaseStrategy":{ \ \ \ \ \ \ \ \ "role":[ \ \ \ \ \ \ \ \ \ \ \ \ 2, \ \ \ \ \ \ \ \ \ \ \ \ 3 \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ "accountPeriodType":2041, \ \ \ \ \ \ \ \ "proxyPaySurchargeType":2012, \ \ \ \ \ \ \ \ "accountPeriod":10, \ \ \ \ \ \ \ \ "rebateStrategyList":[ \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "id":null, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "rebate":null, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "rebateStrategyType":2051, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "label":"进项税点", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "rebatesLabel":"不开票" \ \ \ \ \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "id":null, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "rebate":1, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "rebateStrategyType":2052, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "label":"进项税点", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "rebatesLabel":"1%" \ \ \ \ \ \ \ \ \ \ \ \ } \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ "supplyPartnerOrgId":"${trader_orgId}", \ \ \ \ \ \ \ \ "supplyPartnerName":"${trader_Name}", \ \ \ \ \ \ \ \ "proxyPaySurcharge":0.002 \ \ \ \ }, \ \ \ \ "supplyChainContract":{ \ \ \ \ \ \ \ \ "role":[ \ \ \ \ \ \ \ \ \ \ \ \ 4 \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ "accountPeriodType":2042, \ \ \ \ \ \ \ \ "supplyPartnerOrgId":null, \ \ \ \ \ \ \ \ "accountPeriod":1, \ \ \ \ \ \ \ \ "paperMillRebateType":null, \ \ \ \ \ \ \ \ "contractType":1, \ \ \ \ \ \ \ \ "billType":1, \ \ \ \ \ \ \ \ "contractDate":"2022-04-22T06:53:42.473Z", \ \ \ \ \ \ \ \ "contractName":"${papermill_Name}合同", \ \ \ \ \ \ \ \ "startDate":"${start_time} 00:00:00", \ \ \ \ \ \ \ \ "endDate":"${end_time} 23:59:59", \ \ \ \ \ \ \ \ "firstPartyOrgId":"${trader_orgId}", \ \ \ \ \ \ \ \ "secondPartyOrgId":"${papermill_orgId}", \ \ \ \ \ \ \ \ "rebateStrategy":{ \ \ \ \ \ \ \ \ \ \ \ \ "id":null, \ \ \ \ \ \ \ \ \ \ \ \ "rebate":5, \ \ \ \ \ \ \ \ \ \ \ \ "rebateStrategyType":2053, \ \ \ \ \ \ \ \ \ \ \ \ "label":"销项税点" \ \ \ \ \ \ \ \ } \ \ \ \ }, \ \ \ \ "supplyChainOrgList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "role":[ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 2, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 3 \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ "orgId":"${trader_orgId}" \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "role":[ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 4 \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ "orgId":"${papermill_orgId}" \ \ \ \ \ \ \ \ } \ \ \ \ ], \ \ \ \ "startDate":"${start_time} 00:00:00", \ \ \ \ "endDate":"${end_time} 23:59:59" } + ${supply_reps} Post On Session ZTBTSC ztb-supply-chain-service/admin/create/scrap-paper-supply-chain ${supply_data.encode('utf-8')} + ${supply_purchaseStrategyId} Get From Dictionary ${supply_reps.json()["data"]} purchaseStrategyId + ${supply_supplyChainId} Get From Dictionary ${supply_reps.json()["data"]} supplyChainId + Set Global Variable ${supply_purchaseStrategyId} + Set Global Variable ${supply_supplyChainId} + #获取纸厂品类信息 + ${paperMillCategory_info} Get On Session ZTBTSC /ztb-supply-chain-service/admin/get/paper-mill-purchase/scrap-paper-category-last-quote params=paperMillId=${papermill_id} + ${quoteEffectiveTime} Get From Dictionary ${paperMillCategory_info.json()["data"]} quoteEffectiveTime + ${paperCategoryQuoteVoList} Get From List ${paperMillCategory_info.json()["data"]} paperCategoryQuoteVoList + FOR ${list} IN ${paperCategoryQuoteVoList} + ${paperMillScrapPaperCategoryId} Get From Dictionary ${list.json()} paperMillScrapPaperCategoryId + ${paperMillScrapPaperCategoryName} Get From Dictionary ${list.json()} paperMillScrapPaperCategoryName + ${quotedPrice} Get From Dictionary ${list.json()} quotedPrice + END diff --git a/2-Platform/PaperMill.robot b/2-Platform/PaperMill.robot new file mode 100644 index 0000000..92aa6a4 --- /dev/null +++ b/2-Platform/PaperMill.robot @@ -0,0 +1,44 @@ +*** Settings *** +Library urllib3 +Library DateTime +Library Collections +Library RequestsLibrary + +*** Test Cases *** +create_papermill_org + #创建纸厂组织 + Disable Warnings + Create Session ZTBTSC ${ztbscops} ${ztbsc_header} + ${data} Set Variable {"fullName":"自动化测试纸厂"} + ${reps} Post On Session ZTBTSC ztb-user-enterprise-service/admin/paper-mill/create ${data.encode('utf-8')} + ${papermill_orgId} Get From Dictionary ${reps.json()["data"]} organizationId #获取造纸厂组织id + ${papermill_Id} Get From Dictionary ${reps.json()["data"]} id #获取造纸厂id + Should Be Equal As Strings ${reps.json()["message"]} successful + Should Be Equal As Numbers ${reps.json()["code"]} 0 + Set Global Variable ${papermill_orgId} + Set Global Variable ${papermill_Id} + #修改组织税点信息 + Create Session ZTBTSC ${uecops} ${ztbsc_header} + ${enterprise_data} Set Variable { \ \ \ \ "inputTaxPoint":"2051,2052,2053", "organizationId":"${papermill_orgId}" } + ${reps} Post On Session ZTBTSC uec/admin/save/enterprise-tax-info ${enterprise_data.encode('utf-8')} + ${papermill_baseinfo} Get On Session ZTBTSC uec/admin/get/enterprise/detail/by-org-id params=orgId=${papermill_orgId} #获取造纸厂基础信息 + ${papermill_Name} Get From Dictionary ${papermill_baseinfo.json()["data"]} name + Set Global Variable ${papermill_Name} + +create_category_quote + #新增纸厂品类报价 + Create Session ZTBTSC ${ztbscops} ${ztbsc_header} + ${category_data} Set Variable { \ \ \ \ "paperMillId":"${papermill_Id}", \ \ \ \ "quoteEffectiveTime":"${time}", \ \ \ \ "toCreateCategoryQuoteList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "paperCategoryDto":{ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "paperMillId":"${papermill_Id}", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "paperMillScrapPaperCategoryName":"一级纸" \ \ \ \ \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ \ \ \ \ "paperCategoryQuoteDto":{ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "floatingQuotedPrice":"", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "allowOrder":1, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "paperMillId":"${papermill_Id}", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "publicSubsidies":0.01, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "quotedPrice":2, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "sortNumber":1 \ \ \ \ \ \ \ \ \ \ \ \ } \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "paperCategoryDto":{ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "paperMillId":"${papermill_Id}", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "paperMillScrapPaperCategoryName":"白卡" \ \ \ \ \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ \ \ \ \ "paperCategoryQuoteDto":{ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "floatingQuotedPrice":"", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "allowOrder":1, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "paperMillId":"${papermill_Id}", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "publicSubsidies":"", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "quotedPrice":2.2, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "sortNumber":2 \ \ \ \ \ \ \ \ \ \ \ \ } \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "paperCategoryDto":{ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "paperMillId":"${papermill_Id}", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "paperMillScrapPaperCategoryName":"小白花" \ \ \ \ \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ \ \ \ \ "paperCategoryQuoteDto":{ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "floatingQuotedPrice":"", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "allowOrder":1, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "paperMillId":"${papermill_Id}", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "publicSubsidies":"", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "quotedPrice":2.11, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "sortNumber":3 \ \ \ \ \ \ \ \ \ \ \ \ } \ \ \ \ \ \ \ \ } \ \ \ \ ], \ \ \ \ "toUpdateCategoryQuoteList":[ \ \ \ \ \ ], \ \ \ \ "toDeleteCategoryList":[ \ \ \ \ \ ], \ \ \ \ "toDeleteCategoryQuoteList":[ \ \ \ \ \ ] } + ${category_reps} Post On Session ZTBTSC ztb-supply-chain-service/admin/save/scrap-paper-category-quote ${category_data.encode('utf-8')} + Should Be Equal As Strings ${category_reps.json()["message"]} successful + ${category_list_reps} Get On Session ZTBTSC ztb-supply-chain-service/admin/get/paper-mill-purchase/scrap-paper-category-quote-list params=paperMillId=${papermill_Id}&pageNum=1&pageSize=10 + ${quoteEffectiveTime} Get From Dictionary ${category_list_reps.json()["data"]["records"][0]} quoteEffectiveTime + ${CategoryQuoteVoList} Get From Dictionary ${category_list_reps.json()["data"]["records"][0]} paperCategoryQuoteVoList + FOR ${index} ${items} IN ENUMERATE @{CategoryQuoteVoList} + ${category_id} Evaluate [category_id['paperMillScrapPaperCategoryId']for category_id in ${items}] + #${category_name} Get From Dictionary ${items} paperMillScrapPaperCategoryName + #${publicSubsidies} Get From Dictionary ${items} publicSubsidies + #${publicSubsidies} Set Variable If ${publicSubsidies}==None 0 ${publicSubsidies} + #${quotedPrice} Get From Dictionary ${items} quotedPrice + END + Set Global Variable ${category_id} diff --git a/21042217001449712.png b/21042217001449712.png new file mode 100644 index 0000000..fba0436 Binary files /dev/null and b/21042217001449712.png differ diff --git a/3-Factoring/1-Packing.robot b/3-Factoring/1-Packing.robot new file mode 100644 index 0000000..1c98b8b --- /dev/null +++ b/3-Factoring/1-Packing.robot @@ -0,0 +1,23 @@ +*** Settings *** +Library Collections +Library RequestsLibrary +Library DatabaseLibrary +Library urllib3 +Library ExcelLibrary + +*** Test Cases *** +connect_databaseLibrary + #链接数据库 + Connect To Database Using Custom Params pymysql host='8.135.8.221',user='root', password='qniaothreetwoonego', \ port=3306,database='ztb_supply_chain' #连接ztb_supply_chain数据库 + ${paymentOrder} Query SELECT id FROM `ztb_supply_chain`.`qn_scrap_paper_supply_payment_order` WHERE `supply_chain_instance_id` = '${supplyChainInstanceId}' #通过物流编号查找收款单id + ${OrderId} Set Variable ${paymentOrder[0][0]} + Disconnect From Database #断开数据库的连接 + Set Global Variable ${OrderId} + +apply_factoring + #发起第三方保理 + Create Session factoring ${ztbclient} ${client_header} + ${data} Set Variable {"idList":["${OrderId}"]} + ${reps} POST On Session factoring ztb-supply-chain-service/user/apply/packer/factoring ${data.encode('utf-8')} + +*** Keywords *** diff --git a/3-Factoring/1.1-Trader.robot b/3-Factoring/1.1-Trader.robot new file mode 100644 index 0000000..35a6a06 --- /dev/null +++ b/3-Factoring/1.1-Trader.robot @@ -0,0 +1,63 @@ +*** Settings *** +Library Collections +Library RequestsLibrary +Library DatabaseLibrary +Library urllib3 +Library ExcelLibrary + +*** Test Cases *** +Traders_Login + #代理商web端登录 + #验证码登录 + Disable Warnings + Create Session traders ${uecclient} ${ztbsc_traders_login_header} + ${Data} Set Variable { \ \ \ \ "account":"${papermill_account}", \ \ \ \ "accountType":2, \ \ \ \ "captcha":"${papermill_password}", \ \ \ \ "$loginType":"telphone", \ \ \ \ "$isNextAutoLogin":true } + ${reps} POST On Session traders uec/authorize/by-captcha ${Data.encode('utf-8')} + ${traders_token} Get From Dictionary ${reps.json()['data']} token #获取uectoken + Set Global Variable ${traders_token} + #转换业务token + Create Session ZTBT ${ztbclient} ${ztbsc_traders_login_header} + ${loginToken} Set Variable { \ \ \ \ "loginToken":"${traders_token}", \ \ \ \ "$configs":{ \ \ \ \ \ \ \ \ "$isBizFailedNotToast":true \ \ \ \ } } + ${reps} Post On Session ZTBT ztb-user-enterprise-service/authorize/get/product-line-token/by/login-token ${loginToken.encode('utf-8')} + ${T_userId} Get From Dictionary ${reps.json()["data"]} userId #获取用户id + ${T_token} Get From Dictionary ${reps.json()["data"]} token #获取token + Set Global Variable ${T_userId} + Set Global Variable ${T_token} + #Execl写入数据 + Open Excel D:\\LYL\\Study\\Robot_framework\\New_Trading\\数据驱动.xls + Put String To Cell ztbsc 3 17 {'Content-Type':'application/json','Authorization':'QNT ${T_token}','X-APP-ID':'503258978847966406','X-ORGANIZATION-ID':'721760754042277888'} #写入代理商端请求头数据 + Save Excel DatadrivenT.xls + #数据驱动 + Open Excel D:\\LYL\\Study\\Robot_framework\\New_Trading\\DatadrivenT.xls + ${ztbsc_traders_header} Read Cell Data By Name ztbsc D18 #代理商端header + Set Global Variable ${ztbsc_traders_header} + sleep 0.5 + #获取用户组织信息 + Create Session ZTBT ${ztbclient} ${ztbsc_traders_header} + ${reps} GET On Session ZTBT ztb-supply-chain-service/get/agent/user-base-info + ${TraderOrgInfoList} Get From Dictionary ${reps.json()['data']} agentOrgInfoList #用户代理商类型组织列表 + FOR ${items} IN @{TraderOrgInfoList} + ${trader_orgId} Get From Dictionary ${items} orgId #纸厂组织id + ${trader_name} Get From Dictionary ${items} name #纸厂组织名称 + Exit For Loop If '${trader_name}'=='${paperMillFinancialServiceProviderName}' + END + Set Global Variable ${trader_name} + #Execl写入数据 + Open Excel D:\\LYL\\Study\\Robot_framework\\New_Trading\\数据驱动.xls + Put String To Cell ztbsc 3 17 {'Content-Type':'application/json','Authorization':'QNT ${T_token}','X-APP-ID':'503258978847966406','X-ORGANIZATION-ID':'${trader_orgId}'} #写入代理商端请求头数据 + Save Excel DatadrivenTT.xls + #数据驱动 + Open Excel D:\\LYL\\Study\\Robot_framework\\New_Trading\\DatadrivenTT.xls + ${ztbsc_traders_header} Read Cell Data By Name ztbsc D18 #代理商端header + Set Global Variable ${ztbsc_traders_header} + sleep 0.5 + +Agent_collection_list + #代理商端收款管理 + Create Session factoring ${ztbclient} ${ztbsc_traders_header} + ${reps} GET On Session factoring ztb-supply-chain-service/user/get/receivable-order-page params=status=1&supplyChainInstanceId=${supplyChainInstanceId}&pageNum=1&pageSize=10 + ${recycleId} Get From Dictionary ${reps.json()['data']['records'][0]} id #代理商收款id + #代理商发起融资 + ${TraderData} Set Variable { \ \ \ \ "idList":[ \ \ \ \ \ \ \ \ "${recycleId}" \ \ \ \ ] } + ${reps} POST On Session factoring ztb-supply-chain-service/user/apply/packer/factoring ${TraderData.encode('utf-8')} + Should Be Equal As Strings ${reps.json()['message']} successful diff --git a/3-Factoring/2-Papermill_operation.robot b/3-Factoring/2-Papermill_operation.robot new file mode 100644 index 0000000..14306f3 --- /dev/null +++ b/3-Factoring/2-Papermill_operation.robot @@ -0,0 +1,31 @@ +*** Settings *** +Library RequestsLibrary +Library Collections +Library ExcelLibrary +Library urllib3 + +*** Test Cases *** +Papermill_confirmation + #纸厂端确认转让 + Create Session papermill ${ztbclient} ${ztbsc_papermill_header} + ${reps} GET On Session papermill ztb-supply-chain-service/user/list/paper-mill/scrap-paper-supply-payment-order params=status=1&supplyChainInstanceId=${supplyChainInstanceId}&pageNum=1&pageSize=10 + ${supplyPaymentOrderId} Get From Dictionary ${reps.json()['data']['records'][0]} id #付款单id + #确认转让 + Create Session papermill ${ztbclient} ${ztbsc_papermill_header} + ${confirmData} Set Variable { \ \ \ \ "supplyPaymentOrderId":"${supplyPaymentOrderId}" } + ${reps} POST On Session papermill ztb-supply-chain-service/user/confirm/paper-mill/factoring ${confirmData.encode('utf-8')} + Should Be Equal As Strings ${reps.json()['message']} successful + +papermill_applyFactoring + #纸厂端发起保理 + Create Session factoring ${ztbclient} ${ztbsc_papermill_header} + ${reps} GET On Session factoring ztb-supply-chain-service/user/list/paper-mill/scrap-paper-supply-payment-order params=status=1&supplyChainInstanceId=${supplyChainInstanceId}&pageNum=1&pageSize=10 + ${supplyPaymentOrderId} Get From Dictionary ${reps.json()['data']['records'][0]} id #纸厂付款id + ${paymentDueDate} Get From Dictionary ${reps.json()['data']['records'][0]} paymentDueDate #计划付款日期 + #获取保理服务费 + ${reps} GET On Session factoring ztb-supply-chain-service/user/calculate/debt-service-fee params=paymentOrderId=${supplyPaymentOrderId}&repayDate=${paymentDueDate} + ${serviceFee} Get From Dictionary ${reps.json()['data']} serviceFee #发起保理服务费 + #发起保理 + ${FactoringData} Set Variable { \ \ \ \ "factoringPaymentDueDate":"${paymentDueDate}", \ \ \ \ "factoringServiceFee":${serviceFee}, \ \ \ \ "supplyPaymentOrderId":"${supplyPaymentOrderId}" } + ${reps} POST On Session factoring ztb-supply-chain-service/user/apply/paper-mill/factoring ${FactoringData.encode('utf-8')} + Should Be Equal As Strings ${reps.json()['message']} successful diff --git a/3-Factoring/3-Audit_factoring.robot b/3-Factoring/3-Audit_factoring.robot new file mode 100644 index 0000000..af26b98 --- /dev/null +++ b/3-Factoring/3-Audit_factoring.robot @@ -0,0 +1,15 @@ +*** Settings *** +Library Collections +Library RequestsLibrary + +*** Test Cases *** +Platform_audit + #平台审核 + Create Session factoring ${ztbscops} ${ztbsc_header} + ${reps} GET On Session factoring ztb-supply-chain-service/admin/get/factoring-audit-list params=auditStatus=0&supplyChainInstanceId=${supplyChainInstanceId}&pageNum=1&pageSize=10 + ${FauditId} Get From Dictionary ${reps.json()['data']['records'][0]} id #平台保理审核id + #保理审核通过 + ${FactoringData} Set Variable { \ \ \ \ "status":1, \ \ \ \ "id":"${FauditId}" } + ${reps} POST On Session factoring ztb-supply-chain-service/admin/audit/factoring ${FactoringData.encode('utf-8')} + Should Be Equal As Strings ${reps.json()['message']} successful + sleep 0.5 diff --git a/3-Factoring/4-Factoring.robot b/3-Factoring/4-Factoring.robot new file mode 100644 index 0000000..c43df70 --- /dev/null +++ b/3-Factoring/4-Factoring.robot @@ -0,0 +1,60 @@ +*** Settings *** +Library ExcelLibrary +Library Collections +Library RequestsLibrary +Library urllib3 +Library DateTime + +*** Test Cases *** +Factoring_audit + #保理审核列表 + Create Session factoring ${uecclient} ${ztbsc_factoring_header} + ${transactionType} Set Variable ${transactionType} + ${supplierOrgName} Set Variable If '${transactionType}'=='${1}' ${orgfullName} ${paperMillFinancialServiceProviderName} + ${reps} GET On Session factoring factoring/user/page/debt-assignment-application-stats params=status=1&supplierOrgName=${supplierOrgName}&pageNum=1&pageSize=10 + ${supplierOrgId} Get From Dictionary ${reps.json()['data']['records'][0]} supplierOrgId #供应商组织id + Set Global Variable ${supplierOrgName} + Set Global Variable ${supplierOrgId} + #保理审核供应商列表 + ${reps} GET On Session factoring factoring/user/get/debt-assignment-application-list params=status=1&supplierOrgId=${supplierOrgId}&extOrderId=${supplyChainInstanceId}&pageNum=1&pageSize=10&factoringType=3031 + ${factoringAuditId} Get From Dictionary ${reps.json()['data']['records'][0]} id #保理审核id + #保理审核通过 + ${AuditData} Set Variable { \ \ \ \ "status":2, \ \ \ \ "id":"${factoringAuditId}" } + ${reps} POST On Session factoring factoring/user/audit/debt-assignment-application ${AuditData.encode('utf-8')} + Should Be Equal As Strings ${reps.json()['message']} successful + sleep 0.5 + +Factoring_payment + #保理付款 + Create Session factoring ${uecclient} ${ztbsc_factoring_header} + ${reps} GET On Session factoring factoring/user/page/payment-order-stats params=status=0&supplierOrgName=${supplierOrgName}&pageNum=1&pageSize=10 + #保理供应商付款列表 + ${reps} GET On Session factoring factoring/user/get/payment-order-list params=status=0&supplierOrgId=${supplierOrgId}&extOrderId=${supplyChainInstanceId}&pageNum=1&pageSize=10&factoringType=3031 + ${factoringPaymentId} Get From Dictionary ${reps.json()['data']['records'][0]} id #保理付款id + #保理确认付款 + ${PaymentData} Set Variable { \ \ \ \ "idList":[ \ \ \ \ \ \ \ \ "${factoringPaymentId}" \ \ \ \ ] } + ${reps} POST On Session factoring factoring/user/confirm/payment-order/paid ${PaymentData.encode('utf-8')} + Should Be Equal As Strings ${reps.json()['message']} successful + sleep 0.5 + +Factoring_collection + #保理回款 + Create Session factoring ${uecclient} ${ztbsc_factoring_header} + ${reps} GET On Session factoring factoring/user/page/receivable-order-stats params=status=0&supplierOrgName=${supplierOrgName}&pageNum=1&pageSize=10 + #保理供应商回款列表 + ${reps} GET On Session factoring factoring/user/get/receivable-order-list params=status=0&supplierOrgId=${supplierOrgId}&extOrderId=${supplyChainInstanceId}&pageNum=1&pageSize=10&factoringType=3031 + ${amount} Get From Dictionary ${reps.json()['data']['records'][0]} amount #纸厂回款金额 + ${debtAmount} Get From Dictionary ${reps.json()['data']['records'][0]} debtAmount #保理货款金额 + ${paymentDays} Get From Dictionary ${reps.json()['data']['records'][0]} paymentDays #保理放款天数 + ${receivableId} Get From Dictionary ${reps.json()['data']['records'][0]} id #保理回款id + ${paymentAmount} Get From Dictionary ${reps.json()['data']['records'][0]} paymentAmount #保理放款金额 + ${creditorServiceFee} Get From Dictionary ${reps.json()['data']['records'][0]} creditorServiceFee #保理服务费 + ${packingFactoryOrgName} Get From Dictionary ${reps.json()['data']['records'][0]} packingFactoryOrgName #供应商名称 + ${receivingPaperMillName} Get From Dictionary ${reps.json()['data']['records'][0]} receivingPaperMillName #收货纸厂名称 + ${withholdingFactoringFee} Get From Dictionary ${reps.json()['data']['records'][0]} withholdingFactoringFee #保理预扣金额 + ${debtAssignmentApplicationId} Get From Dictionary ${reps.json()['data']['records'][0]} debtAssignmentApplicationId #保理申请ID + #保理确认回款 + ${datatime} get current date result_format=%Y-%m-%d + ${receiveData} Set Variable { \ \ \ \ "id":"${receivableId}", \ \ \ \ "debtAmount":${debtAmount}, \ \ \ \ "withholdingFactoringFee":${withholdingFactoringFee}, \ \ \ \ "paymentAmount":${paymentAmount}, \ \ \ \ "paymentTime":"${datatime}", \ \ \ \ "paymentDays":${paymentDays}, \ \ \ \ "serviceFee":${creditorServiceFee}, \ \ \ \ "factorReceivedAmount":${amount}, \ \ \ \ "receivableAmount":${amount}, \ \ \ \ "finishedTime":"${datatime}", \ \ \ \ "remark":"保理回款", \ \ \ \ "debtAssignmentApplicationId":"${debtAssignmentApplicationId}", \ \ \ \ "supplierOrgName":"${packingFactoryOrgName}", \ \ \ \ "receivingPaperMillName":"${receivingPaperMillName}", \ \ \ \ "plateNumber":"${plateNumber}" } + ${reps} POST On Session factoring factoring/user/confirm/receivable-order/received ${receiveData.encode('utf-8')} + Should Be Equal As Strings ${reps.json()['message']} successful diff --git a/3-Factoring/5-Reverse_factoring.robot b/3-Factoring/5-Reverse_factoring.robot new file mode 100644 index 0000000..6c28eaa --- /dev/null +++ b/3-Factoring/5-Reverse_factoring.robot @@ -0,0 +1,42 @@ +*** Settings *** +Library DateTime +Library RequestsLibrary +Library Collections +Library ExcelLibrary + +*** Test Cases *** +White_audit + #白条审核 + Create Session factoring ${uecclient} ${ztbsc_factoring_header} + ${reps} GET On Session factoring factoring/user/page/reverse_factoring/debt-assignment-application-stats params=status=1&debtOrgName=${papermillname}&pageNum=1&pageSize=10 + ${debtOrgId} Get From Dictionary ${reps.json()['data']['records'][0]} debtOrgId #纸厂组织id + Set Global Variable ${debtOrgId} + #白条审核纸厂订单明细 + ${reps} GET On Session factoring factoring/user/get/debt-assignment-application-list params=status=1&debtOrgId=${debtOrgId}&extOrderId=${supplyChainInstanceId}&pageNum=1&pageSize=10&factoringType=3032 + ${auditId} Get From Dictionary ${reps.json()['data']['records'][0]} id #白条审核纸厂id + #白条审核通过 + ${auditData} Set Variable { \ \ \ \ "status":2, \ \ \ \ "id":"${auditId}" } + ${reps} POST On Session factoring factoring/user/audit/debt-assignment-application ${auditData.encode('utf-8')} + +White_payment + #白条付款 + Create Session factoring ${uecclient} ${ztbsc_factoring_header} + ${reps} GET On Session factoring factoring/user/page/reverse_factoring/payment-order-stats params=status=0&supplierOrgName=${papermillname}&pageNum=1&pageSize=10 + #保理纸厂付款列表 + ${reps} GET On Session factoring factoring/user/get/payment-order-list params=status=0&debtOrgId=${debtOrgId}&extOrderId=${supplyChainInstanceId}&pageNum=1&pageSize=10&factoringType=3032 + ${factoringPaymentId} Get From Dictionary ${reps.json()['data']['records'][0]} id #保理付款id + #保理确认付款 + ${PaymentData} Set Variable { \ \ \ \ "idList":[ \ \ \ \ \ \ \ \ "${factoringPaymentId}" \ \ \ \ ] } + ${reps} POST On Session factoring factoring/user/confirm/payment-order/paid ${PaymentData.encode('utf-8')} + Should Be Equal As Strings ${reps.json()['message']} successful + sleep 0.5 + +papermill_payment + #纸厂端确认付款 + Create Session factoring ${uecclient} ${ztbsc_papermill_header} + ${reps} GET On Session factoring factoring/user/paper-mill/get/receivable-order-list params=status=0&extOrderId=${supplyChainInstanceId}&pageNum=1&pageSize=10 + ${repaymentId} Get From Dictionary ${reps.json()['data']['records'][0]} id #纸厂还款id + #确认还款 + ${repaymentData} Set Variable { \ \ \ \ "id":"${repaymentId}" } + ${reps} POST On Session factoring factoring/user/repay/receivable-order ${repaymentData.encode('utf-8')} + Should Be Equal As Strings ${reps.json()['message']} successful diff --git a/5e7f47fb6aea3.mp4 b/5e7f47fb6aea3.mp4 new file mode 100644 index 0000000..611061c Binary files /dev/null and b/5e7f47fb6aea3.mp4 differ diff --git a/Datadriven.xls b/Datadriven.xls new file mode 100644 index 0000000..0cc9954 Binary files /dev/null and b/Datadriven.xls differ diff --git a/DatadrivenB.xls b/DatadrivenB.xls new file mode 100644 index 0000000..5e9553a Binary files /dev/null and b/DatadrivenB.xls differ diff --git a/DatadrivenC.xls b/DatadrivenC.xls new file mode 100644 index 0000000..0eb617e Binary files /dev/null and b/DatadrivenC.xls differ diff --git a/DatadrivenF.xls b/DatadrivenF.xls new file mode 100644 index 0000000..91ecf54 Binary files /dev/null and b/DatadrivenF.xls differ diff --git a/DatadrivenP.xls b/DatadrivenP.xls new file mode 100644 index 0000000..80454f9 Binary files /dev/null and b/DatadrivenP.xls differ diff --git a/DatadrivenT.xls b/DatadrivenT.xls new file mode 100644 index 0000000..5e5e765 Binary files /dev/null and b/DatadrivenT.xls differ diff --git a/DatadrivenTT.xls b/DatadrivenTT.xls new file mode 100644 index 0000000..7795a90 Binary files /dev/null and b/DatadrivenTT.xls differ diff --git a/数据驱动.xls b/数据驱动.xls new file mode 100644 index 0000000..b62828d Binary files /dev/null and b/数据驱动.xls differ diff --git a/标的1-6.jpg b/标的1-6.jpg new file mode 100644 index 0000000..61fb6b6 Binary files /dev/null and b/标的1-6.jpg differ diff --git a/标的1-9.jpg b/标的1-9.jpg new file mode 100644 index 0000000..fb8e877 Binary files /dev/null and b/标的1-9.jpg differ