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

70 lines
7.5 KiB

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