From 9ed01b3bf42bd26753bdec6c6c1b660a9bc34382 Mon Sep 17 00:00:00 2001 From: LG_lai Date: Tue, 30 Aug 2022 14:21:47 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9B=E5=BB=BA=E4=BB=A3=E7=90=86=E7=BA=B8?= =?UTF-8?q?=E5=8E=82=E5=90=88=E5=90=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...2.1-APPlogin.robot => 2.1-PAPPlogin.robot} | 2 +- ...2.2-APPlogin.robot => 2.2-EAPPlogin.robot} | 2 +- RF-TEST/0-Data driven/dataDriven.robot | 10 +- RF-TEST/2-Platform/Organization.robot | 185 ++++++++++++------ RF-TEST/2-Platform/PaperMill.robot | 44 ----- 5 files changed, 135 insertions(+), 108 deletions(-) rename 000-LoginToken/{2.1-APPlogin.robot => 2.1-PAPPlogin.robot} (98%) rename 000-LoginToken/{2.2-APPlogin.robot => 2.2-EAPPlogin.robot} (98%) delete mode 100644 RF-TEST/2-Platform/PaperMill.robot diff --git a/000-LoginToken/2.1-APPlogin.robot b/000-LoginToken/2.1-PAPPlogin.robot similarity index 98% rename from 000-LoginToken/2.1-APPlogin.robot rename to 000-LoginToken/2.1-PAPPlogin.robot index 973294e..44d69ca 100644 --- a/000-LoginToken/2.1-APPlogin.robot +++ b/000-LoginToken/2.1-PAPPlogin.robot @@ -1,5 +1,5 @@ *** Settings *** -Documentation \#登录客户端 +Documentation \#个人组织登录客户端 Test Setup Library urllib3 Library Collections diff --git a/000-LoginToken/2.2-APPlogin.robot b/000-LoginToken/2.2-EAPPlogin.robot similarity index 98% rename from 000-LoginToken/2.2-APPlogin.robot rename to 000-LoginToken/2.2-EAPPlogin.robot index 3d761f6..27ab298 100644 --- a/000-LoginToken/2.2-APPlogin.robot +++ b/000-LoginToken/2.2-EAPPlogin.robot @@ -1,5 +1,5 @@ *** Settings *** -Documentation \#登录客户端 +Documentation \#企业组织用户登录客户端 Test Setup Library urllib3 Library Collections diff --git a/RF-TEST/0-Data driven/dataDriven.robot b/RF-TEST/0-Data driven/dataDriven.robot index 93b1919..61d64e2 100644 --- a/RF-TEST/0-Data driven/dataDriven.robot +++ b/RF-TEST/0-Data driven/dataDriven.robot @@ -112,11 +112,13 @@ ztbsc ${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 + ${DataTime} Get Current Date result_format=%Y-%m-%d %H:%M:%S #转换'为空 #${List} Set Variable ['{"id":"742739866076450816"}', '{"id":"742363192650502144"}'] #${BList} Convert To String ${List} - #${BList} Replace String Using Regexp ${BList} ' \ + #${BList} Replace String Using Regexp ${BList} ' #随机获取多个数值 - ${List} Set Variable [{0},{1},{2},3,4,5,6,7,8,9] - ${num} Evaluate random.randint(1,8) random - ${data} Evaluate random.sample(${List},${num}) random + #${List} Set Variable [{0},{1},{2},3,4,5,6,7,8,9] + #${num} Evaluate random.randint(1,8) random + #${data} Evaluate random.sample(${List},${num}) random + ${i} Evaluate round(random.uniform(0.005,0.02),3) random diff --git a/RF-TEST/2-Platform/Organization.robot b/RF-TEST/2-Platform/Organization.robot index b4c8935..d0a081c 100644 --- a/RF-TEST/2-Platform/Organization.robot +++ b/RF-TEST/2-Platform/Organization.robot @@ -3,68 +3,137 @@ Library RequestsLibrary Library Collections Library DateTime Library urllib3 +Library String *** Test Cases *** -create_trader_org +AgentOrg #创建代理商组织 - 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} + Create Session agent ${ztbscops} ${ztbsc_header} + ${OrgData} Set Variable { \ \ \ \ "fullName":"测试代理商830" } + ${reps} POST On Session agent ztb-user-enterprise-service/admin/scrap-paper/agent/create ${OrgData.encode('utf-8')} + ${AgentId} Get From Dictionary ${reps.json()['data']} id #代理商id + ${AgentOrgId} Get From Dictionary ${reps.json()['data']} organizationId #代理商组织id + Set Global Variable ${AgentOrgId} + sleep 0.5 + #获取创建的代理商信息 + ${reps} GET On Session agent ztb-user-enterprise-service/admin/scrap-paper/agent/get/agent-list params=certificationStatus=&status=&pageNum=1&pageSize=10 + ${AgentList} Get From Dictionary ${reps.json()['data']} records #代理商列表 + FOR ${items} IN @{AgentList} + ${AgentOrgId} Get From Dictionary ${items} organizationId #代理商组织id + ${AgentFullName} Get From Dictionary ${items} fullName #代理商组织名称 + Exit For Loop If '${AgentOrgId}'=='${AgentOrgId}' + END + Set Global Variable ${AgentFullName} + #创建代理商店铺信息 + ${SaleNum} Evaluate random.randint(1000,3000) random #线下交易吨数 + ${TradingVolume} Evaluate ${SaleNum}*1000 + ${StoreData} Set Variable { \ \ \ \ "id":null, \ \ \ \ "ownerAgentId":"${AgentId}", \ \ \ \ "name":"${AgentFullName}的店铺", \ \ \ \ "introduction":null, \ \ \ \ "logoImgUrl":"", \ \ \ \ "offlineHistoricalTradingVolume":${TradingVolume} } + ${reps} POST On Session agent ztb-supply-chain-service/admin/save/scrap-paper-store ${StoreData.encode('utf-8')} + #获取店铺信息 + ${reps} GET On Session agent ztb-supply-chain-service/admin/scrap-paper/store/get/${AgentId} + ${AgentStoreId} Get From Dictionary ${reps.json()['data']} id #代理商组织店铺id + Set Global Variable ${AgentStoreId} + #修改代理商税务信息 + Create Session agent ${uecops} ${ztbsc_header} + ${TaxInfo} Set Variable { \ \ \ \ "inputTaxPoint":"2052,2053,2054", \ \ \ \ "salesTaxPoint":2052, \ \ \ \ "organizationId":"${AgentOrgId}" } + ${reps} POST On Session agent uec/admin/save/enterprise-tax-info ${TaxInfo.encode('utf-8')} -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} #获取组织企业信息 +PaperMillOrg + #创建造纸厂组织 + Create Session papermill ${ztbscops} ${ztbsc_header} + ${OrgData} Set Variable { \ \ \ \ "fullName":"测试造纸厂830" } + ${reps} POST On Session papermill ztb-user-enterprise-service/admin/paper-mill/create ${OrgData.encode('utf-8')} + ${PaperMillId} Get From Dictionary ${reps.json()['data']} id #造纸厂id + ${PaperMillOrgId} Get From Dictionary ${reps.json()['data']} organizationId #造纸厂组织id + Set Global Variable ${PaperMillId} + Set Global Variable ${PaperMillOrgId} + sleep 0.5 + #获取创建的纸厂信息 + ${reps} GET On Session papermill ztb-user-enterprise-service/admin/paper-mill/get/paper-mill-list params=certificationStatus=&status=&pageNum=1&pageSize=10 + ${PaperList} Get From Dictionary ${reps.json()['data']} records #造纸厂列表 + FOR ${items} IN @{PaperList} + ${PaperOrgId} Get From Dictionary ${items} organizationId #纸厂组织id + ${PaperFullName} Get From Dictionary ${items} fullName #纸厂组织名称 + Exit For Loop If '${PaperOrgId}'=='${PaperMillOrgId}' + END + Set Global Variable ${PaperFullName} + #修改造纸厂税务信息 + Create Session papermill ${uecops} ${ztbsc_header} + ${TaxInfo} Set Variable { \ \ \ \ "inputTaxPoint":"2051,2052,2053,2054", \ \ \ \ "salesTaxPoint":null, \ \ \ \ "organizationId":"${PaperMillOrgId}" } + ${reps} POST On Session papermill uec/admin/save/enterprise-tax-info ${TaxInfo.encode('utf-8')} + Sleep 0.5 -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}' +Information + #新增纸厂情报 + #获取当前时间未添加情报纸厂列表 + ${statsDate} Get Current Date result_format=%Y-%m-%d #获取当前日期 + Create Session information ${ztbscops} ${ztbsc_header} + ${reps} GET On Session information ztb-supply-chain-service/admin/get/paper-mill-info/selectable-paper-mill-list params=pageNum=1&pageSize=30&statsDate=${statsDate}&paperMillName=${PaperFullName} + ${PaperMillList} Get From Dictionary ${reps.json()['data']} records #选择时间没有情报的纸厂列表 + FOR ${PpaerMill} IN @{PaperMillList} + ${paperMillId} Get From Dictionary ${PpaerMill} paperMillId #造纸厂id + Exit For Loop If '${paperMillId}'=='${PaperMillId}' 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} + #确认新增 + ${InfoData} Set Variable { \ \ \ \ "informationStatistics":{ \ \ \ \ \ \ \ \ "startingDeductionPoint":null \ \ \ \ }, \ \ \ \ "paperMillId":"${paperMillId}", \ \ \ \ "receivedWeight":{ \ \ \ \ \ \ \ \ "retainedQuantity":null, \ \ \ \ \ \ \ \ "totalQuantity":null \ \ \ \ }, \ \ \ \ "statsDate":"${statsDate}" } + ${reps} POST On Session information ztb-supply-chain-service/admin/create/paper-mill-info ${InfoData.encode('utf-8')} + #获取纸品大类 + Create Session information ${ztbops} ${ztbsc_header} + ${reps} GET On Session information recycle-user-center/admin/get/first-two-level-product-category + ${categoryList} Get From Dictionary ${reps.json()['data'][0]} categoryList #废纸列表 + ${CategoryInfo} Evaluate random.choice(${categoryList}) random #随机获取纸品大类 + ${parentId} Get From Dictionary ${CategoryInfo} id #纸品大类id + ${MainCategoryName} Get From Dictionary ${CategoryInfo} name #纸品大类name + #创建纸厂品类 + ${CategoryData} Set Variable { \ \ \ \ "toCreateCategoryList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "paperMillScrapPaperCategoryName":"一级纸", \ \ \ \ \ \ \ \ \ \ \ \ "parentId":"${parentId}", \ \ \ \ \ \ \ \ \ \ \ \ "sortNumber":1, \ \ \ \ \ \ \ \ \ \ \ \ "paperMillId":"${paperMillId}" \ \ \ \ \ \ \ \ } \ \ \ \ ], \ \ \ \ "toUpdateCategoryList":[ \ \ \ \ \ ], \ \ \ \ "toDeleteCategoryList":[ \ \ \ \ \ ] } + Create Session information ${ztbscops} ${ztbsc_header} + ${reps} POST On Session information ztb-supply-chain-service/admin/save/scrap-paper-category ${CategoryData.encode('utf-8')} #获取纸厂品类信息 - ${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 + ${reps} GET On Session information ztb-supply-chain-service/admin/list/scrap-paper-category/by/${paperMillId} + ${CategoryId} Get From Dictionary ${reps.json()['data'][0]} id #纸厂品类id + ${CategoryName} Get From Dictionary ${reps.json()['data'][0]} paperMillScrapPaperCategoryName #纸厂品类name + Set Global Variable ${CategoryId} + Set Global Variable ${CategoryName} + #发布纸厂品类报价 + ${Time} Get Time #获取当前时间 + ${quotedPrice} Evaluate round(random.uniform(1,2.5),2) random #随机获取纸厂价格 + ${CategoryQuotePrice} Set Variable { \ \ \ \ "categoryQuoteList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "id":null, \ \ \ \ \ \ \ \ \ \ \ \ "scrapPaperCategoryQuoteEffectiveTimeId":null, \ \ \ \ \ \ \ \ \ \ \ \ "paperMillScrapPaperCategoryId":"${CategoryId}", \ \ \ \ \ \ \ \ \ \ \ \ "paperMillScrapPaperCategoryName":"${CategoryName}", \ \ \ \ \ \ \ \ \ \ \ \ "paperMillScrapPaperMainCategoryName":"${MainCategoryName}", \ \ \ \ \ \ \ \ \ \ \ \ "quotedPrice":${quotedPrice}, \ \ \ \ \ \ \ \ \ \ \ \ "totalQuotedPrice":0, \ \ \ \ \ \ \ \ \ \ \ \ "sortNumber":1, \ \ \ \ \ \ \ \ \ \ \ \ "publicSubsidies":"", \ \ \ \ \ \ \ \ \ \ \ \ "allowOrder":1, \ \ \ \ \ \ \ \ \ \ \ \ "floatingQuotedPrice":"", \ \ \ \ \ \ \ \ \ \ \ \ "inspectionNote":null, \ \ \ \ \ \ \ \ \ \ \ \ "parentId":${parentId}, \ \ \ \ \ \ \ \ \ \ \ \ "quoteEffectiveTime":null, \ \ \ \ \ \ \ \ \ \ \ \ "paperMillId":"${paperMillId}" \ \ \ \ \ \ \ \ } \ \ \ \ ], \ \ \ \ "id":null, \ \ \ \ "isUpdatedFloatingQuotedPrice":false, \ \ \ \ "paperMillId":"${paperMillId}", \ \ \ \ "quoteEffectiveTime":"${Time}" } + ${reps} POST On Session information ztb-supply-chain-service/admin/create/scrap-paper-category-quote-effective-time ${CategoryQuotePrice.encode('utf-8')} + Set Global Variable ${quotedPrice} + #获取纸厂品类报价列表 + ${reps} GET On Session information ztb-supply-chain-service/admin/get/paper-mill-purchase/scrap-paper-category-quote-list params=paperMillId=${paperMillId}&pageNum=1&pageSize=10 + ${PaperMillQuoteId} Get From Dictionary ${reps.json()['data']['records'][0]} id #纸厂品类报价id + +AgencyPaperMillContract + #创建代理纸厂合同 + #选择纸厂 + Create Session agent ${ztbscops} ${ztbsc_header} + ${reps} GET On Session agent ztb-user-enterprise-service/admin/get/paper-mill-list/by-name params=pageNum=1&pageSize=30&keyword=${PaperFullName} + ${paperMillId} Get From Dictionary ${reps.json()['data']['records'][0]} paperMillId #获取纸厂id + #获取代理商税务信息 + ${reps} GET On Session agent ztb-supply-chain-service/admin/match/tax-point params=agentOrgId=${AgentOrgId}&paperMillOrgId=${PaperMillOrgId} + ${agentInputTaxPointList} Get From Dictionary ${reps.json()['data']} agentInputTaxPointList #代理商进项税点List + ${2052} Get From List ${agentInputTaxPointList} 0 + ${2053} Get From List ${agentInputTaxPointList} 1 + ${2054} Get From List ${agentInputTaxPointList} 2 + ${agentSalesTaxPoint} Get From Dictionary ${reps.json()['data']} agentSalesTaxPoint #代理商销项税点 + #创建代理支持供应链合同 + ${Time} Get Time #获取当前时间 + ${endTime} Get Current Date result_format=%Y-%m-%d 23:59:59 + ${endDate} Add Time To Date ${endTime} 30 days + ${endDate} Get Substring ${endDate} 0 19 + ${startDate} Set Variable ${Time} + ${Surcharge} Evaluate round(random.uniform(0.005,0.02),3) random #代理服务费 + ${accountPeriod} Evaluate random.randint(1,10) random #代理商付款账期(天) + #${rebateStrategy} Set Variable { \ \ \ \ \ \ \ \ \ \ \ \ "id":null, \ \ \ \ \ \ \ \ \ \ \ \ "rebate":1, \ \ \ \ \ \ \ \ \ \ \ \ "rebateStrategyType":${agentSalesTaxPoint}, \ \ \ \ \ \ \ \ \ \ \ \ "label":"销项税点" \ \ \ \ \ \ \ \ } + #${rebateStrategyList} Set Variable [ \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "id":null, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "rebate":1, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "rebateStrategyType":${2052}, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "label":"进项税点", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "rebatesLabel":"1%" \ \ \ \ \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "id":null, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "rebate":3, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "rebateStrategyType":${2053}, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "label":"进项税点", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "rebatesLabel":"3%" \ \ \ \ \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "id":null, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "rebate":13, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "rebateStrategyType":${2054}, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "label":"进项税点", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "rebatesLabel":"13%" \ \ \ \ \ \ \ \ \ \ \ \ } \ \ \ \ \ \ \ \ ] #代理商进项税点 + ${supplyData} Set Variable { \ \ \ \ "receivingPaperMillId":"${paperMillId}", \ \ \ \ "storeId":"${AgentStoreId}", \ \ \ \ "purchaseStrategy":{ \ \ \ \ \ \ \ \ "role":[ \ \ \ \ \ \ \ \ \ \ \ \ 2, \ \ \ \ \ \ \ \ \ \ \ \ 3 \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ "accountPeriodType":2041, \ \ \ \ \ \ \ \ "proxyPaySurchargeType":2012, \ \ \ \ \ \ \ \ "accountPeriod":${accountPeriod}, \ \ \ \ \ \ \ \ "rebateStrategyList":[ \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "id":null, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "rebate":1, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "rebateStrategyType":${2052}, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "label":"进项税点", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "rebatesLabel":"1%" \ \ \ \ \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "id":null, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "rebate":3, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "rebateStrategyType":${2053}, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "label":"进项税点", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "rebatesLabel":"3%" \ \ \ \ \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "id":null, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "rebate":13, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "rebateStrategyType":${2054}, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "label":"进项税点", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "rebatesLabel":"13%" \ \ \ \ \ \ \ \ \ \ \ \ } \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ "supplyPartnerOrgId":"${AgentOrgId}", \ \ \ \ \ \ \ \ "supplyPartnerName":"${AgentFullName}", \ \ \ \ \ \ \ \ "proxyPaySurcharge":${Surcharge} \ \ \ \ }, \ \ \ \ "supplyChainContract":{ \ \ \ \ \ \ \ \ "role":[ \ \ \ \ \ \ \ \ \ \ \ \ 4 \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ "accountPeriodType":2042, \ \ \ \ \ \ \ \ "supplyPartnerOrgId":null, \ \ \ \ \ \ \ \ "accountPeriod":${accountPeriod}, \ \ \ \ \ \ \ \ "paperMillRebateType":null, \ \ \ \ \ \ \ \ "contractType":1, \ \ \ \ \ \ \ \ "billType":1, \ \ \ \ \ \ \ \ "contractDate":"${Time}", \ \ \ \ \ \ \ \ "contractName":"${PaperFullName}代理合同", \ \ \ \ \ \ \ \ "startDate":"${startDate}", \ \ \ \ \ \ \ \ "endDate":"${endDate}", \ \ \ \ \ \ \ \ "firstPartyOrgId":"${AgentOrgId}", \ \ \ \ \ \ \ \ "secondPartyOrgId":"${PaperMillOrgId}", \ \ \ \ \ \ \ \ "rebateStrategy":{ \ \ \ \ \ \ \ \ \ \ \ \ "id":null, \ \ \ \ \ \ \ \ \ \ \ \ "rebate":1, \ \ \ \ \ \ \ \ \ \ \ \ "rebateStrategyType":${agentSalesTaxPoint}, \ \ \ \ \ \ \ \ \ \ \ \ "label":"销项税点" \ \ \ \ \ \ \ \ } \ \ \ \ }, \ \ \ \ "supplyChainOrgList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "role":[ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 2, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 3 \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ "orgId":"${AgentOrgId}" \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "role":[ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 4 \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ "orgId":"${PaperMillOrgId}" \ \ \ \ \ \ \ \ } \ \ \ \ ], \ \ \ \ "startDate":"${startDate}", \ \ \ \ "endDate":"${endDate}" } + ${reps} POST On Session agent ztb-supply-chain-service/admin/create/scrap-paper-supply-chain ${supplyData.encode('utf-8')} + ${supplyChainId} Get From Dictionary ${reps.json()['data']} supplyChainId #供应链id + ${purchaseStrategyId} Get From Dictionary ${reps.json()['data']} purchaseStrategyId #供应链纸厂采购策略id + #获取代理纸厂供应链详情 + ${reps} GET On Session agent ztb-supply-chain-service/admin/get/supply-chain-detail params=supplyChainId=${supplyChainId} + ${StrategyId} Get From Dictionary ${reps.json()['data']['purchaseStrategy']} id #代理纸厂采购id + #保存供应链纸厂采购策略 + ${StrategyData} Set Variable { \ \ \ \ "strategyId":"${StrategyId}", \ \ \ \ "toDeletedCategoryStrategyIdList":[ \ \ \ \ \ ], \ \ \ \ "toCreateCategoryStrategyList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "id":null, \ \ \ \ \ \ \ \ \ \ \ \ "strategyId":"${StrategyId}", \ \ \ \ \ \ \ \ \ \ \ \ "paperMillCategoryId":"${CategoryId}", \ \ \ \ \ \ \ \ \ \ \ \ "paperMillCategoryQuote":${quotedPrice}, \ \ \ \ \ \ \ \ \ \ \ \ "paperMillCategoryName":"${CategoryName}", \ \ \ \ \ \ \ \ \ \ \ \ "paperMillCategoryQuoteTime":"${Time}", \ \ \ \ \ \ \ \ \ \ \ \ "categoryPrice":${quotedPrice}, \ \ \ \ \ \ \ \ \ \ \ \ "categoryDisplayName":"${CategoryName}", \ \ \ \ \ \ \ \ \ \ \ \ "enable":true, \ \ \ \ \ \ \ \ \ \ \ \ "categoryStrategyItems":[ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "name":1, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "type":1, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "value":null \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ } \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ "isAdd":true \ \ \ \ \ \ \ \ } \ \ \ \ ], \ \ \ \ "toUpdateCategoryStrategyList":[ \ \ \ \ \ ] } + ${reps} POST On Session agent ztb-supply-chain-service/admin/save/scrap-paper-category/agency-purchase-strategy ${StrategyData.encode('utf-8')} diff --git a/RF-TEST/2-Platform/PaperMill.robot b/RF-TEST/2-Platform/PaperMill.robot deleted file mode 100644 index 92aa6a4..0000000 --- a/RF-TEST/2-Platform/PaperMill.robot +++ /dev/null @@ -1,44 +0,0 @@ -*** 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}