Commit 2e27ad9e authored by liguangyu06's avatar liguangyu06
Browse files

用例新增:集配供应商代客下单验证

parent acf4e368
# -*- encoding=utf8 -*-
__author__ = "liguangyu"
"""
case_tag:cmdc_api,cmdc集配供应商代客下单验证,00,00-1,sit,be
主数据平台:后台运营系统代客下单接口
"""
from common.common_func import commonFuc
from air_case.cmdc_login.后台管理系统登录.后台管理系统登录 import CmdcDoLogin
import requests
import json
module = "cmdc_special_version"
# 第一步登录后台运营系统获取token
username = commonFuc().get_business_data(module, "username_do_be")
password = commonFuc().get_business_data(module, "password_do_be")
# 获取登录后Cmdc_access_token
cmdc_access_token = CmdcDoLogin(username, password).get_token()
headers = commonFuc().get_business_data(module, "json_headers", cmdc_access_token)
# 第二步集配供应商下单
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url1")
request_body = commonFuc().get_business_data(module, "payload1")
"""
场景: 集配供应商代客下单验证
用例名称:集配供应商代客下单验证
输出:{"success":true,"code":"200","message":"ok"}
"""
# 发送请求
result = requests.post(url, json=request_body, headers=headers)
# 获取接口响应时间
api_time = float(result.elapsed.total_seconds())
# 将接口响应时间添加至result
result = json.loads(result.content)
result["api_time"] = api_time
# 获取预期结果
check_dict = commonFuc().get_business_data(module, "checkDict1")
# print(check_dict)
# 断言实际结果中是否包含预期结果的内容
commonFuc().check_result(check_dict, result)
# 多采商城图形验证码url
"getVerifyCode_url": "/sso/getVerifyCode"
# 国药运营后台管理系统登录地址
"do_login_url": "/sso/mallLogin"
#beta环境
#多采商城
"username_be": "dc1000193"
"password_be": "Aa123456"
#多采商城
"username_test0411": "test0411"
"password_test0411": "Aa123456"
#后台运营平台
"username_do_be": "1021002584"
"password_do_be": "102@63719195"
#后台运营平台(总站)
"username_admin": "admin1"
"password_admin": "Aa123456"
#uat环境
#后台管理系统headers
json_headers: {
"Content-Type": "application/json",
"Cmdc_access_token": "%s"
}
#文件上传headers
json_headers_file: {
"Cmdc_access_token": "%s"
}
#多采商城headers
json_headers1: {
"Cmdc_access_token": "%s",
"Sourcetype": "mall"
}
#测试场景1:集配供应商代客下单验证
"url1": "/order/saveBackDemandOrder"
"payload1": {"orderStatus":102,"demandItems":[{"maxProductNum":999999,"minProductNum":1,"addMinProductNum":1,"minProductNumSign":false,"isMultiple":false,"quantityTip":"","productCode":"10146513","productId":111704,"materialCode":"","productName":"介入类批量测试1","specifications":"002","manufacturer":"BIOTRONIKSE&Co.KG","productLineName":null,"productLineCode":null,"zonePriceVOList":null,"price":222,"storageType":"999","optionStr":"002","measuringUnit":"BN","ippMiniPurchaseNum":null,"ippMultipleSign":null,"ippPurchaseMultiple":null,"ippStatus":null,"quantity":1,"isGift":0,"measuringUnit1":"支","imageUrl":null,"companyCode":"-12313384","areaName":"报价","areaPrice":222,"agreementPriceId":534212,"hidden":null,"description":"","taxRate":"0.17","allMaterialSign":null,"materialCodeExact":null,"specificationsExact":null,"hospitalOrderType":null,"hospitalHopeDate":null,"siteCompanyCode":"00102","propertyName":null,"propertyVal":null,"propertyNote":null,"mustInstallDate":false,"showDemandAuditLineLabel":false,"yaPei":false,"installedDateMust":0,"boxQuantity":null,"cartonNumber":null,"remainder":null,"productPackagingManage":null,"yapeiPrice":null,"customerCode":"-1506240","editProductCode":false,"quantityErr":false,"fresenuis":false,"zeroSign":false,"purchaseZeroProductList":[],"activityBasicId":null,"giftList":[],"selectGiftArr":[],"selectZeroGiftObj":{"mainProductList":[],"giftProductList":[]},"giftGroupQuantity":1,"propertyStr":"","hasRestProductNumFlagF":false,"giftSign":0,"realPay":"222.00","priceChange":0}],"paymentAmount":222,"productAmount":222,"userId":12313385,"userNo":"-1506240","customerCode":"-1506240","userName":"〇五单位五五一部","companyId":"745","paymentType":1,"receiveBankName":"北京威联德骨科技术有限公司","receiveBankAccount":"暂无","accountId":100,"receiverName":"甘文科","receiverContact":"13059865603","receiverAddress":"浙江省舟山市定海区文化路98号","addressNumber":5739,"remark":"","receiverNote":"甘文科","receiverPhoneNote":"13059865603","receiverAddressNote":"浙江省舟山市定海区文化路98号","addressNoNote":5739,"fileList":[],"sellerCompanyCode":"-12313384","sellerCompanyName":"北京威联德骨科技术有限公司","orderSource":2,"replaceCustomerOrder":{"orderStatus":102,"demandItems":[{"maxProductNum":999999,"minProductNum":1,"addMinProductNum":1,"minProductNumSign":false,"isMultiple":false,"quantityTip":"","productCode":"10146513","productId":111704,"materialCode":"","productName":"介入类批量测试1","specifications":"002","manufacturer":"BIOTRONIKSE&Co.KG","productLineName":null,"productLineCode":null,"zonePriceVOList":null,"price":222,"storageType":"999","optionStr":"002","measuringUnit":"BN","ippMiniPurchaseNum":null,"ippMultipleSign":null,"ippPurchaseMultiple":null,"ippStatus":null,"quantity":1,"isGift":0,"measuringUnit1":"支","imageUrl":null,"companyCode":"-12313384","areaName":"报价","areaPrice":222,"agreementPriceId":534212,"hidden":null,"description":"","taxRate":"0.17","allMaterialSign":null,"materialCodeExact":null,"specificationsExact":null,"hospitalOrderType":null,"hospitalHopeDate":null,"siteCompanyCode":"00102","propertyName":null,"propertyVal":null,"propertyNote":null,"mustInstallDate":false,"showDemandAuditLineLabel":false,"yaPei":false,"installedDateMust":0,"boxQuantity":null,"cartonNumber":null,"remainder":null,"productPackagingManage":null,"yapeiPrice":null,"customerCode":null,"editProductCode":false,"quantityErr":false,"fresenuis":false,"zeroSign":false,"purchaseZeroProductList":[],"activityBasicId":null,"giftList":[],"selectGiftArr":[],"selectZeroGiftObj":{"mainProductList":[],"giftProductList":[]},"giftGroupQuantity":1,"propertyStr":"","hasRestProductNumFlagF":false}],"paymentAmount":222,"productAmount":222,"userId":12313385,"userNo":"-1506240","customerCode":"-1506240","userName":"〇五单位五五一部","companyId":"745","paymentType":1,"receiveBankName":"北京威联德骨科技术有限公司","receiveBankAccount":"暂无","accountId":100,"receiverName":"甘文科","receiverContact":"13059865603","receiverAddress":"浙江省舟山市定海区文化路98号","addressNumber":5739,"remark":"","receiverNote":"甘文科","receiverPhoneNote":"13059865603","receiverAddressNote":"浙江省舟山市定海区文化路98号","addressNoNote":5739,"fileList":[],"sellerCompanyCode":"-12313384","sellerCompanyName":"北京威联德骨科技术有限公司","orderSource":2,"customerInfo":{"userId":12313385,"userName":"dc1000193","rejectUserName":null,"password":null,"realName":null,"userNo":"-1506240","telephone":"","rejectTelephone":null,"registerAddress":null,"detailAddress":null,"businessScope":null,"companyProperty":108,"companyId":null,"companyCode":null,"companyName":"北京威联德骨科技术有限公司","companyNameList":null,"customerCompanyName":"〇五单位五五一部","lienceNo":"〇五单位五五一部","userType":2,"companyType":null,"status":3,"disableSign":0,"deleteSign":null,"createBy":null,"updateBy":null,"createTime":null,"updateTime":null,"licenceSketchUrl":null,"licenceUrl":null,"openId":null,"referrer":null,"gift":null,"identity":null,"department":null,"platformStatus":1,"rejectionReason":null,"registerType":null,"siteType":null,"departmentCode":null,"personName":null,"registration":null,"realPassword":null,"recommend":null,"merchantsStatus":null,"backAuditing":false,"taxRate":null,"roleNames":null,"subCompanyName":"北京威联德骨科技术有限公司","roleIds":null,"addressList":null,"licenseList":null,"labelList":null,"managerList":null,"createTimeStr":null,"categoriesList":null,"merchantsAddress":null,"merchantStatus":null,"refuseReason":null,"merchantsId":null,"userTransactionAmount":"0","gray":null,"bindingTime":null,"bindSign":1,"jdeStatus":null,"jdePhone":null,"recommender":null,"coopeSgin":0,"cusCompanyName":null,"registerLicenceList":null,"bindflowList":null,"userJDEInfo":null,"kse8JYCS":null,"kse8FR":null,"kse8CKDZ":null,"ksdl010":null,"kse8KHFLMS":null}},"hospitalOrderType":0,"draftId":null,"demands":[{"otherNote":null,"sellerCompanyCode":null,"productLineCode":"","demandId":null,"demandParentId":null,"demandParentCode":null,"demandCode":null,"customerId":null,"customerName":null,"customerCode":-1506240,"loginName":null,"realName":null,"addressNumber":null,"mobile":null,"productName":null,"productCode":null,"sellerCompanyName":null,"paymentType":null,"receiveBankName":null,"receiveBankAccount":null,"paymentAmount":"222.00","productAmount":222,"payableAmount":222,"refundAmount":null,"cancelAmount":null,"discountAmount":0,"orderStatus":null,"refundStatus":null,"receiverName":null,"receiverContact":null,"receiverAddress":null,"remark":null,"revokedReason":null,"auditById":null,"auditByName":null,"auditTime":null,"auditRemark":null,"flhsStatus":null,"pushJdeStatus":null,"createTime":null,"updateTime":null,"submitTime":null,"pushJdeTime":null,"successTime":null,"auditStatus":null,"deleteSign":null,"firstOrderFlag":null,"demandItems":[{"demandSkuId":null,"demandId":null,"distributionId":null,"companyCode":"-12313384","demandCode":null,"demandParentId":null,"sellerCompanyId":null,"sellerCompanyName":null,"sellerCompanyCode":null,"customerCode":-1506240,"productLineCode":"","productLineName":"","propertyStr":"","storageType":"999","suppDist":null,"productId":111704,"productName":"介入类批量测试1","productCode":"10146513","productNature":null,"brandName":null,"optionStr":"002","imageUrl":null,"lineNumber":null,"price":222,"rebateId":null,"rebateDetail":null,"useMaxLimit":null,"useLimitStart":null,"useBalance":null,"originalPrice":null,"biddingDiscountTax":null,"salesDiscountTax":null,"quantity":1,"sumQuantity":null,"sendQuantity":null,"lackQuantity":null,"cancelQuantity":null,"cancelAmount":null,"refundQuantity":null,"refundAmount":null,"discountQuantity":null,"discountAmount":null,"subtotal":222,"measuringUnit":"支","auxiliaryMeasuringUnit":null,"procurementMeasuringUnit":null,"pricingMeasuringUnit":null,"materialCode":"","manufacturer":"BIOTRONIKSE&Co.KG","produceRegisterNum":null,"riskRank":null,"productClassify":null,"createTime":null,"updateTime":null,"deleteSign":null,"calCancelFlag":null,"refundFlag":null,"discountRate":0,"realPay":222,"promotionPrice":null,"promotionTotalPrice":null,"demandParentCode":null,"regionId":null,"regionName":null,"spitSign":null,"activityAmount":null,"couponAmount":null,"activityUnitAmount":0,"couponUnitAmount":null,"activityBasicId":null,"couponSgin":null,"couponSgin2":null,"returnQuantity":null,"returnAmount":null,"customerId":null,"prescription":null,"specifications":"002","lineCodeDelete":null,"sdOutStorage":null,"licenseNo":null,"demandCodes":null,"areaName":"报价","agreementPriceId":534212,"offerPrice":null,"orderMark":null,"totalPrice":null,"productLimitBuyList":null,"giftSign":0,"giftProductCode":null,"activityCarDataVoList":null,"productReplaceLogs":null,"orderSource":null,"receiverName":null,"receiverContact":null,"receiverAddress":null,"rebateTripId":null,"allSign":null,"replaceSgin":null,"salesReturn":null,"nowAmount":null,"taxSign":0,"plusMinuKey":null,"rebateRule":null,"areaPrice":222,"lockType":null,"estimatedDeliveryDate":null,"licenseInfoFeignDtos":null,"receivedQty":null,"version":null,"installedDateMust":0,"sizeSign":0,"boxQuantity":null,"cartonNumber":null,"remainder":null,"itemIndex":null,"groupPrice":null,"rebateSign":null,"ippMiniPurchaseNum":null,"ippMultipleSign":null,"ippPurchaseMultiple":null,"ippStatus":null,"lineNumberOrg":null,"changeSgin":null,"addSgin":null,"ptbfa1":null,"ptbfa2":null,"ptbfa3":null,"ptbfa4":null,"ptbfa5":null,"yapeiPriceId":null,"ypLinePromotion":null,"yapeiPrice":null,"companyId":null,"buyerCartId":0,"userReceiveIdx":null,"userReceiveIdx2":null,"limitNum":null,"productLimitBuyId":null,"alreadyBuyNum":null,"limitBuySign":0,"proposeNum":null,"takeEffectRange":null,"takeEffectTime":null,"endTime1":null,"groupId":null,"fsGroupId":null,"proposalQuantity":null,"proposalSign":0,"manufacturerUserNo":null,"manufacturerUserDesc":null,"manufacturerProductNo":null,"manufacturerProductDesc":null,"manufacturerUserId":null,"manufacturerProductId":null,"busProductCode":"","paidTime":null,"customerName":null,"paymentAmount":null,"specQuantity":null,"disQuantity":null,"fulfilledQuantity":null,"fulCancelQuantity":null,"couponId":null,"couponId2":null,"limitS":null,"starts":null,"ends":null,"userId":null,"productTax":"","taxRate":0,"demandSplitSign":"1","hospitalHopeDate":null,"uniqueKey":null,"productType":null,"activityRuleId":null,"allowanceBeginTime":null,"allowanceEndTime":null,"sign":null,"differenceActivityUserId":null,"groupNumber":1,"groupName":null,"skuGroup":null,"subList":null,"dataJson":null,"skuMergeSign":null,"freseniusPriceId":null,"quantityAndGroupAll":null,"booleaTime":null,"spitSgin":0,"groupSpitSign":0,"purchaseEntryId":null,"activityType":0,"giftSettlementMethod":null,"giftInitQuantity":null,"packageCode":null,"giftGroupQuantity":1,"mustInstallDate":false,"installedDate":null,"installedDateStr":null,"demandLines":null,"subLineNumber":null,"demandSubCode":null,"passSign":null,"wholeQuantity":null,"propertyName":null,"propertyVal":null,"propertyNote":null,"sendManualSign":0,"exceedSign":0,"passJson":null,"activityJson":null,"sort":0,"circleArea":null,"siteCompanyCode":"00102","hospitalOrderType":null,"isCollectionAllocation":null,"recDifferenceQty":null,"orderStatus":null,"distributionType":null,"replaceSign":null,"groupCode":null,"groupProductType":null,"pSign":0,"backSign":0,"description":"","stockNumber":null,"priceChange":false,"confirmSkuNote":null,"confirmNote":null,"confirmCustNode":null,"confirmCustSkuNode":null,"jdeStockNumber":null,"packagingJson":null,"rebate":false,"hasRestProductNumFlagF":false,"userBalance":null,"purchaseQuantity":1,"purchaseZeroProductList":[]}],"expireDemandSkus":null,"demandSubItems":null,"rebateDetail":null,"rebateAmountList":null,"productLineName":"","auditLoginName":null,"showPurchaseNo":false,"isRebate":null,"isShowReate":null,"taxRate":0,"rebateType":0,"paymentAmountWholeLine":222,"discountAmountWholeLine":0,"payableAmountWholeLine":222,"discountRate":0,"singleRebateAmount":null,"isRebateEdit":null,"payCertUrl":null,"rebateAmount":null,"demandCance":null,"soAdd":null,"soCance":null,"orderReturn":null,"needCustomerConfirm":false,"measuringUnit":null,"productId":null,"version":null,"mainVersion":null,"agencyConfigId":null,"confirmSign":null,"replySign":null,"agencySign":null,"editIng":null,"editIngStr":null,"jdeType":null,"isElectronicSeal":null,"contractAgreementNo":null,"alesDepartmentNo":null,"alesDepartmentName":null,"salesPersonNo":null,"salesPersonName":null,"customerNote":null,"contractAgreementCode":null,"projectName":null,"projectCode":null,"regionId":null,"regionName":null,"productLineBindSign":null,"rebateDetailVOList":null,"shipVia":null,"orderSource":null,"userBalance":null,"liquidCode":null,"shipmentTypeStr":null,"distributionTypeStr":null,"soStr":null,"soList":null,"specifications":"002","pageStart":null,"pageSize":null,"changeSgin":null,"yapei":2,"companyId":null,"userReceiveId2":null,"preemptConfig":null,"productSpec":null,"secondAuditSign":null,"secondAuditById":null,"secondAuditByName":null,"secondAuditTime":null,"secondAuditRemark":null,"secondAuditStatus":null,"rebateRule":null,"rebateControlSign":0,"rebateId":null,"preferenceType":null,"preferenceName":null,"disPrice":null,"lineNum":0,"auditStaySign":0,"fileList":null,"imageUrls":null,"total":null,"submitTimeStr":null,"updateTimeStr":null,"auditTimeStr":null,"acceptTime":null,"acceptTimeStr":null,"paidTime":null,"paidTimeStr":null,"erpHandingTime":null,"erpHandingTimeStr":null,"partShippingTime":null,"partShippingTimeStr":null,"allShippingTime":null,"allShippingTimeStr":null,"pushJdeTimeStr":null,"successTimeStr":null,"onlinePaySuccessTime":null,"onlinePaySuccessTimeStr":null,"bankTransactionSerial":null,"newIsTax":null,"countFormula":null,"countNumber":null,"noTaxRebateAmount":0,"isCollectionAllocation":1,"siteCompanyCode":"00102","hospitalOrderType":0,"proofTime":null,"proofURL":null,"proofRemark":null,"proofSign":0,"customerCancelSign":null,"cancelRecords":null,"cancelCount":0,"updateNewTime":null,"updateNewTimeStr":null,"fsDedUseSign":null,"preDisSign":0,"auditStay":null,"shareType":null,"singleRebateSign":null,"cf":false,"notice":null,"isPre":null,"showDemandAuditLineLabel":false,"orderType":null,"newDiscountRate":null,"oldOrderType":null,"oldNewDiscountRate":null,"pendding":null,"modifySign":null,"refuseType":null,"groupChangeSign":null,"custModify":null,"demandSubCode":null,"firstAuditTime":null,"exceedSign":0,"auditStayId":null,"staySign":0,"confirmNote":null,"confirmCustNode":null,"noNeedMerge":false,"operationUserName":null,"pushJdeStatusDemandSub":null,"circleGiftSign":0,"delay":null,"limitS":null,"starts":null,"ends":null,"completedS":null,"confirmDays":null,"remindS":null,"skuGroupList":null,"groupProductType":0,"purchaseId":null,"purchaseCode":null,"contractAgreementName":null,"sdCancelTime":null,"sdTipSign":0,"receiverNote":null,"receiverPhoneNote":null,"receiverAddressNote":null,"flag":null,"sourceStr":null,"addressNoNote":null,"detailIsSpit":false,"spitSgin":null,"distributionType":4,"rebateValidity":null,"orderChangeType":null,"logoIcon":null,"detail":null,"changeBigType":null,"promotionType":null,"activityTotalAmount":null,"couponTotalAmount":null,"userReceiveId":null,"editSgin":null,"snSgin":null,"jdeOutAmount":null,"totalAllPaAmount":null,"diffShowSgin":0,"lineCodeDelete":null,"startTime":null,"endTime":null,"changeSign":null,"distributionId":null,"limitBuySign":0,"companyType":"3","afterSale":null,"csId":null,"sdStatusNodeParamList":null,"ypPromotionTotal":null,"acrossMainCode":null,"forceApprovedSign":0,"circleGiftContinueSgin":0,"customerCharge":null,"onlinePaySign":0,"recodeDemandSkuList":null,"mergeDemandSkuList":null,"inventoryNode":null,"customCode":null,"terminalSource":null,"potentialClientsId":null,"settlementStatus":null,"firstOrderAuditStatus":null,"confirmReceiptSign":null,"confirmReceiptTime":null,"afterSaleDays":null,"deliveryCompletedTime":null,"taxSign":0,"orderSplitSign":0,"demandRebateSkuList":null,"confirmTime":null,"customerPurchaseNo":null,"mustInstallDate":false,"secondAddressList":null,"splitOrMerge":null,"spitOrderSign":null,"storageRoomNo":null,"storageRoomName":null,"edit":false,"productAmountWholeLine":222,"auditCompanyName":null,"auditCompanyNameCode":null,"showMoreAttribute":false,"installedDateMust":true,"ratio":null,"ratioFlag":false,"rebateFlags":false,"userBalancePrice":0,"allQuantity":1,"totalPriceNum":0,"maxTotalLimitPrice":0,"lastNoTaxDiscountAmount":0,"lastDiscountAmount":0}]}
#预期结果
checkDict1: {"success":true,"code":"200","message":"ok"}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment