Commit 9a9e90b9 authored by liguangyu06's avatar liguangyu06
Browse files

用例新增:草稿单创建验证_代客下单_套包

parent 9af5cd64
# -*- encoding=utf8 -*-
__author__ = "liguangyu"
"""
case_tag:cmdc_api,cmdc草稿单创建验证_代客下单_套包,2295,2295-57,sit,bs
主数据平台:后台运营系统草稿订单创建接口
"""
from common.common_func import commonFuc
from air_case.cmdc_login.后台管理系统登录.后台管理系统登录 import CmdcDoLogin
import requests
import json
module = "cmdc_order_list"
# 第一步登录后台运营系统获取token
username = commonFuc().get_business_data(module, "username2")
password = commonFuc().get_business_data(module, "password2")
# 获取登录后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, "url57")
request_body = commonFuc().get_business_data(module, "payload57")
# print(request_body)
"""
场景: 草稿单创建验证_代客下单_套包
用例名称:草稿单创建验证_代客下单_套包
输出:{"userNo":"1000086"}
"""
# 发送请求
result = requests.post(url, json=request_body, headers=headers)
# 获取接口响应时间
api_time = float(result.elapsed.total_seconds())
# 获取生成草稿订单对应的客户信息
result = json.loads(result.content)
result = {"userNo": result["data"]["userNo"]}
# 将接口响应时间添加至result
result["api_time"] = api_time
# 获取预期结果
check_dict = commonFuc().get_business_data(module, "checkDict57")
# print(check_dict)
# 断言实际结果中是否包含预期结果的内容
commonFuc().check_result(check_dict, result)
......@@ -397,7 +397,11 @@ checkDict55: {"success":true,"code":"200","message":"OK","data":false,"freshToke
#预期结果
checkDict56: {"userNo":"1000086"}
#测试场景五十七:草稿单创建验证_代客下单_套包
"url57": "/product/public/draft/add"
"payload57": {"productMap":{"orderStatus":102,"demandItems":[{"manufacturerGroupName":"","groupCode1":"sspg00304409","groupId":1077,"customerCode":"1000086","timeStr":"2024-02-11至2036-03-31","productName":null,"documentNo":"123321test","multipleSign":null,"booleaTime":1,"groupPrice":642,"groupPriceStatus":1,"purchaseMultiple":null,"miniPurchaseNum":null,"limitStr":"5.0000","surplusQuantity":5,"groupCode":"sspg00304409","companyCode":"00102","groupProductType":3,"subList":[{"productLineCode":null,"optionStr":"RF*PA35263M","groupId":1077,"description":"","productName":"导丝","manufacturer":"泰尔茂株式会社(テルモ株式会社)","propertyNote":"10000841","installedDateMust":0,"booleaTime":"1","imageUrl":"https://pro-cmdc.oss-cn-beijing.aliyuncs.com/productFile/2021/04/16/123149d7-fe49-462d-9111-3438af9b8a01.png","id":1037,"activityUnitAmount":"321.0000","class":null,"groupCode":"sspg00304409","companyCode":"00102","product":{"firstCategory":"冠脉介入器械","secondCategory":"介入耗材","thirdCategory":"导丝","productId":8853,"productName":"导丝","productCode":"10000841","firstCategoryId":517,"firstCategoryName":null,"secondCategoryId":518,"secondCategoryName":null,"thirdCategoryId":524,"thirdCategoryName":null,"defaultImageUrl":"https://pro-cmdc.oss-cn-beijing.aliyuncs.com/productFile/2021/04/16/123149d7-fe49-462d-9111-3438af9b8a01.png","referencePrice":10,"filialeName":"","filialeCode":"00102","brandId":null,"brandName":null,"status":101,"uploadTime":1701065990000,"deleteSign":0,"isSee":0,"isGift":0,"isControlSales":0,"specifications":"RF*PA35263M","productCategories":"01","productNature":"01","riskRank":"003","specialSort":"0103","productClassify":"6877","storageCondition":"999","otherStorageCondition":"不要在超常温度和湿度环境中存放,避免阳光直射。","countryOfOrigin":"JP","diagnosticMedicineCategories":"","materialCode":"RF*PA35263M","manufacturer":"泰尔茂株式会社(テルモ株式会社)","manufacturerCode":"7000333","newRiskRank":"003","newProductClassify":"03","newProductClassify2":"","newClassifyLevel":"003","approvalNumber":"","dosageForm":"","atcCategories":"","atcClassify":"","serialNumber":"","medicineType":"","measuringUnit":"EA","keyWords":"DS","jdeStatus":"P","commonName":"导丝","isSerialNumberManage":"","medicalInsuranceCode":"","auxiliaryMeasuringUnit":"EA","procurementMeasuringUnit":"EA","applicationDepartment":"","pricingMeasuringUnit":"EA","productAuditId":null,"imageUrls":null,"detailImageUrls":null,"groupId":null,"measuringUnitName":"个","productNo":null,"busProductCode":null,"description":"","taxRate":"0.17","jdeUpdate":null,"jdeUpdateStr":null,"startTime":null,"endTime":null,"conSign":0,"medicaCode":null,"classCode":null,"mappinCode":null,"measuringUnitStr":null,"productLineName":null,"productLineCode":null,"pageNum":null,"pageSize":null,"isUpload":null,"relevanceCode":null,"produceRegisterNum":"国械注进20153032566","relevanceName":null,"prescription":null,"sdOutStorage":0,"installedDateMust":0,"miniPurchaseNum":null,"multipleSign":null,"purchaseMultiple":null,"inventoryTotal":null,"kpde8YX02":null,"prescriptionStr":null,"replaceSgin":0},"quantity":1,"productId":8853,"propertyVal":"10000841","freseniusPriceId":568,"materialCode":"RF*PA35263M","updateTime":null,"manufacturerCode":"7000333","measuringUnitStr":"个","produceRegisterNum":"国械注进20153032566","showDemandAuditLineLabel":false,"taxRate":"0.17","productCode":"10000841","defaultimageurl":"https://pro-cmdc.oss-cn-beijing.aliyuncs.com/productFile/2021/04/16/123149d7-fe49-462d-9111-3438af9b8a01.png","createTime":null,"propertyName":"商品属性名","measuringUnit":"个","productLineName":null,"storageType":"999","storageCondition":"999","fsGroupId":1077,"groupProductType":3,"propertyStr":"商品属性名:10000841&10000841"},{"productLineCode":null,"optionStr":"RF*GA35263M","groupId":1077,"description":"","productName":"导丝","manufacturer":"泰尔茂株式会社(テルモ株式会社)","propertyNote":"10000842","installedDateMust":0,"booleaTime":"1","imageUrl":"https://pro-cmdc.oss-cn-beijing.aliyuncs.com/productFile/2021/04/16/a228c369-ad79-4a11-bbab-9949a65d433f.png","id":1038,"activityUnitAmount":"321.0000","class":null,"groupCode":"sspg00304409","companyCode":"00102","product":{"firstCategory":"冠脉介入器械","secondCategory":"介入耗材","thirdCategory":"导丝","productId":8854,"productName":"导丝","productCode":"10000842","firstCategoryId":517,"firstCategoryName":null,"secondCategoryId":518,"secondCategoryName":null,"thirdCategoryId":524,"thirdCategoryName":null,"defaultImageUrl":"https://pro-cmdc.oss-cn-beijing.aliyuncs.com/productFile/2021/04/16/a228c369-ad79-4a11-bbab-9949a65d433f.png","referencePrice":9999999.99,"filialeName":"","filialeCode":"00102","brandId":null,"brandName":null,"status":101,"uploadTime":1618553482000,"deleteSign":0,"isSee":0,"isGift":0,"isControlSales":0,"specifications":"RF*GA35263M","productCategories":"01","productNature":"01","riskRank":"003","specialSort":"0103","productClassify":"6877","storageCondition":"999","otherStorageCondition":"不要再超常温度和湿度环境中存放,避免阳光直射","countryOfOrigin":"JP","diagnosticMedicineCategories":"","materialCode":"","manufacturer":"泰尔茂株式会社(テルモ株式会社)","manufacturerCode":"7000333","newRiskRank":"","newProductClassify":"03","newProductClassify2":"","newClassifyLevel":"003","approvalNumber":"","dosageForm":"","atcCategories":"","atcClassify":"","serialNumber":"","medicineType":"","measuringUnit":"EA","keyWords":"DS","jdeStatus":"P","commonName":"导丝","isSerialNumberManage":"","medicalInsuranceCode":"","auxiliaryMeasuringUnit":"EA","procurementMeasuringUnit":"EA","applicationDepartment":"","pricingMeasuringUnit":"EA","productAuditId":null,"imageUrls":null,"detailImageUrls":null,"groupId":null,"measuringUnitName":"个","productNo":null,"busProductCode":"","description":"","taxRate":"0.17","jdeUpdate":null,"jdeUpdateStr":null,"startTime":null,"endTime":null,"conSign":0,"medicaCode":null,"classCode":null,"mappinCode":null,"measuringUnitStr":null,"productLineName":null,"productLineCode":null,"pageNum":null,"pageSize":null,"isUpload":null,"relevanceCode":null,"produceRegisterNum":"国械注进20153032566","relevanceName":null,"prescription":null,"sdOutStorage":0,"installedDateMust":0,"miniPurchaseNum":null,"multipleSign":null,"purchaseMultiple":null,"inventoryTotal":null,"kpde8YX02":null,"prescriptionStr":null,"replaceSgin":0},"quantity":1,"productId":8854,"propertyVal":"10000842","freseniusPriceId":568,"materialCode":"","updateTime":null,"manufacturerCode":"7000333","measuringUnitStr":"个","produceRegisterNum":"国械注进20153032566","showDemandAuditLineLabel":false,"taxRate":"0.17","productCode":"10000842","defaultimageurl":"https://pro-cmdc.oss-cn-beijing.aliyuncs.com/productFile/2021/04/16/a228c369-ad79-4a11-bbab-9949a65d433f.png","createTime":null,"propertyName":"商品属性名","measuringUnit":"个","productLineName":null,"storageType":"999","storageCondition":"999","fsGroupId":1077,"groupProductType":3,"propertyStr":"商品属性名:10000842&10000842"}],"calSubFreName":"导丝(RF*PA35263M)*<span style=\\\"color:red\\\">1</span>个+导丝(RF*GA35263M)*<span style=\\\"color:red\\\">1</span>个","quantity":1,"freseniusPriceId":568,"manufacturerGroupCode":"","groupName":"套包协议价验证测试","productCode":null,"limitPurchase":5,"buyCartNum":1,"isLimit":1,"isRegularPrice":0,"giftList":[]}],"paymentAmount":642,"productAmount":642,"userId":124100,"userNo":"1000086","customerCode":"1000086","userName":"北京海德锐视科技有限公司","companyId":"7","paymentType":1,"receiveBankName":"国药集团联合医疗器械有限公司","receiveBankAccount":"0200002919200155850","accountId":5,"receiverName":"张梦怡","receiverContact":"","receiverAddress":"上海市浦东新区浦电路3号1","addressNumber":17823,"remark":"","receiverNote":"张梦怡","receiverPhoneNote":"","receiverAddressNote":"上海市浦东新区浦电路3号1","addressNoNote":17823,"fileList":[],"sellerCompanyCode":"00102","sellerCompanyName":"国药集团联合医疗器械有限公司","orderSource":2,"customerInfo":{"userId":124100,"userName":"GL1000086","rejectUserName":null,"password":null,"realName":"张梦","userNo":"1000086","telephone":"18008613531","rejectTelephone":null,"registerAddress":null,"detailAddress":"国联客户地址","businessScope":null,"companyProperty":101,"companyId":null,"companyCode":null,"companyName":"国药集团联合医疗器械有限公司","companyNameList":null,"customerCompanyName":"北京海德锐视科技有限公司","lienceNo":"91110106579004448R","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":0.17,"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":"630.63","gray":null,"bindingTime":null,"bindSign":1,"jdeStatus":0,"jdePhone":"","recommender":null,"coopeSgin":null,"cusCompanyName":null,"registerLicenceList":null,"bindflowList":null,"userJDEInfo":null}},"id":null,"type":1,"userNo":"1000086","customerCode":"1000086","userName":"北京海德锐视科技有限公司"}
#预期结果
checkDict57: {"userNo":"1000086"}
......
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