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