test #6

Merged
laiyonglan merged 2 commits from test into master 3 years ago
  1. 2
      000-LoginToken/2.1-PAPPlogin.robot
  2. 2
      000-LoginToken/2.2-EAPPlogin.robot
  3. 10
      RF-TEST/0-Data driven/dataDriven.robot
  4. 52
      RF-TEST/2-Platform/Auction.robot
  5. 185
      RF-TEST/2-Platform/Organization.robot
  6. 44
      RF-TEST/2-Platform/PaperMill.robot

000-LoginToken/2.1-APPlogin.robot → 000-LoginToken/2.1-PAPPlogin.robot

@ -1,5 +1,5 @@
*** Settings ***
Documentation \#登录客户端
Documentation \#个人组织登录客户端
Test Setup
Library urllib3
Library Collections

000-LoginToken/2.2-APPlogin.robot → 000-LoginToken/2.2-EAPPlogin.robot

@ -1,5 +1,5 @@
*** Settings ***
Documentation \#登录客户端
Documentation \#企业组织用户登录客户端
Test Setup
Library urllib3
Library Collections

10
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

52
RF-TEST/2-Platform/Auction.robot

@ -98,59 +98,13 @@ auction_detail
${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}
${isDown} Get From Dictionary ${items} isDown #拍品上、下架状态
${auctionId} Get From Dictionary ${items} auctionId #竞拍唯一标识
${auctionSellerOrgName} Get From Dictionary ${items} auctionSellerOrgName #委托组织名称
Exit For Loop If '${auctionSellerOrgName}'=='${fullName}'
END
${isDown} Set Variable If '${isDown}'=='${true}' false true
#上架拍品
${PutonAuction} Set Variable { \ \ \ \ "id":"${auctionId}", \ \ \ \ "isDown":false }
${PutonAuction} Set Variable { \ \ \ \ "id":"${auctionId}", \ \ \ \ "isDown":${isDown}}
${reps} POST On Session auction auction-service/admin/operate/auction ${PutonAuction.encode('utf-8')}
Should Be Equal As Strings ${reps.json()['message']} successful
auction_detail1
#拍品详情
Create Session auction ${uecops} ${ztbsc_header}
${reps} GET On Session auction auction-service/admin/get/auction/detail/${auctionEntrustId}
${auctionId} Get From Dictionary ${reps.json()['data']} auctionId #拍品唯一标识
${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 #拍品描述
${auctionId} Set Variable If '${auctionId}'=='${None}' null ${auctionId}
#修改拍品设置
#上传图片
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}
${quantity} Evaluate round(random.uniform(2,30),2) random #拍卖重量(吨)
${auctionData} Set Variable { \ \ \ \ "auctionLotImageList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "url":"${pictures}", \ \ \ \ \ \ \ \ \ \ \ \ "type":1 \ \ \ \ \ \ \ \ }], \ \ \ \ "displayDescribe":"${displayDescribe}", \ \ \ \ "displayAddress":"${displayAddress}", \ \ \ \ "displayName":"${displayName}", \ \ \ \ "quantity":${quantity}, \ \ \ \ "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":"${id}"}
END
${Num} Evaluate random.randint(1,6) random #获取随机数字
${bidders_List} Evaluate random.sample(${List},${Num}) random
${BList} Convert To String ${bidders_List}
${BList} Replace Variables ${BList} ' "

185
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')}

44
RF-TEST/2-Platform/PaperMill.robot

@ -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}
Loading…
Cancel
Save