Commit 6d3731d3 authored by xiao-hesheng's avatar xiao-hesheng
Browse files

产品信息申报

产品信息审核_获取必要信息
产品信息审核_通过
parent 4cc40faa
......@@ -10,6 +10,8 @@ case_tag:api,mdm-web企业审核,id2248,sit,on,2023090802
from common.common_func import commonFuc
from air_case.mdm_login.登录外网系统.登录外网系统 import login_system
def Enterprise_audit():
module = "mdm3-ea"
# 注册企业
......@@ -33,140 +35,188 @@ def Enterprise_audit():
password = commonFuc().get_business_data(module, "password")
print(username, password)
# 获取token和projectCode
token,projectCode,uxid,corpId = login_system(username, password).get_token()
#获取请求头信息
token, projectCode, uxid, corpId = login_system(username, password).get_token()
# 获取请求头信息
headers = commonFuc().get_business_data(module, "json_headers2",
commonFuc().get_business_data(module, "json_contentType"), token,
projectCode, token)
request_body = commonFuc().get_business_data(module, "payload1",id1)
request_body = commonFuc().get_business_data(module, "payload1", id1)
# 发送请求
result = commonFuc().http_post(url, request_body, headers)
# # print(result)
#获取预期结果
# 获取预期结果
check_dict = commonFuc().get_business_data(module, "checkDict")
print(check_dict)
#断言实际结果中是否包含预期结果的内容
# 断言实际结果中是否包含预期结果的内容
commonFuc().check_result(check_dict, result)
#=============== 企业注册提交接口_认领结束
#企业审核接口_查询数据_开始
# =============== 企业注册提交接口_认领结束
# 企业审核接口_查询数据_开始
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "queryListPage_url")
request_body = commonFuc().get_business_data(module, "payload2",cname)
request_body = commonFuc().get_business_data(module, "payload2", cname)
# 发送请求
result = commonFuc().http_post(url, request_body, headers)
#获取接口返回数据
# 获取接口返回数据
code = commonFuc().analysis_json('code', result)
#断言实际结果中是否包含预期结果的内容
# 断言实际结果中是否包含预期结果的内容
# commonFuc().check_result(code, result)
#断言实际结果中是否包含预期的文本
commonFuc().check_text_exist(code,result)
#===============企业注册提交接口_查询数据_结束
# 断言实际结果中是否包含预期的文本
commonFuc().check_text_exist(code, result)
# ===============企业注册提交接口_查询数据_结束
#企业注册提交接口_锁定_开始
# 企业注册提交接口_锁定_开始
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "queryAlCompanyRegistInfo_url")
request_body = commonFuc().get_business_data(module, "payload3",id1)
request_body = commonFuc().get_business_data(module, "payload3", id1)
# 发送请求
result = commonFuc().http_post(url, request_body, headers)
#获取接口返回数据
# 获取接口返回数据
code = commonFuc().analysis_json('code', result)
#断言实际结果中是否包含预期结果的内容
# 断言实际结果中是否包含预期结果的内容
commonFuc().check_text_exist(code, result)
#===============企业注册提交接口_锁定_结束
# ===============企业注册提交接口_锁定_结束
#企业审核接口_再次查询数据_开始
# 企业审核接口_再次查询数据_开始
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "upCompanyList_url")
request_body = commonFuc().get_business_data(module, "payload4",cname)
request_body = commonFuc().get_business_data(module, "payload4", cname)
# 发送请求
result = commonFuc().http_post(url, request_body, headers)
#获取接口返回数据
# 获取接口返回数据
code = commonFuc().analysis_json('code', result)
#断言实际结果中是否包含预期结果的内容
# 断言实际结果中是否包含预期结果的内容
commonFuc().check_text_exist(code, result)
#===============企业注册提交接口_查询数据_结束
# ===============企业注册提交接口_查询数据_结束
#企业注册提交接口_审核通过_开始
# 企业注册提交接口_审核通过_开始
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "auditCompanyRegistBill_url")
request_body = commonFuc().get_business_data(module, "payload5",id1)
request_body = commonFuc().get_business_data(module, "payload5", id1)
# 发送请求
result = commonFuc().http_post(url, request_body, headers)
# print('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',result)
#获取接口返回数据
# 获取接口返回数据
code = commonFuc().analysis_json('code', result)
check_dict1 = commonFuc().get_business_data(module, "checkDict1")
#断言实际结果中是否包含预期结果的内容
# 断言实际结果中是否包含预期结果的内容
commonFuc().check_result(check_dict1, result)
return cname
#===============企业注册提交接口_审核通过_结束
# ===============企业注册提交接口_审核通过_结束
module = "mdm3-pim"
#登录
# 登录
username = Enterprise_audit()
password = commonFuc().get_business_data(module, "password")
print(username, password)
# 获取token和projectCode
token,projectCode,uxid,corpId= login_system(username, password).get_token()
#分页查询供应商产品数据接口
token, projectCode, uxid, corpId = login_system(username, password).get_token()
# 分页查询供应商产品数据接口
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "listVoPage_url")
#获取请求头信息
# 获取请求头信息
headers = commonFuc().get_business_data(module, "json_headers2",
commonFuc().get_business_data(module, "json_contentType"), token,
projectCode)
request_body = commonFuc().get_business_data(module, "payload",corpId)
request_body = commonFuc().get_business_data(module, "payload", corpId)
# 发送请求
result = commonFuc().http_post(url, request_body, headers)
# print('实际值',result)
code = commonFuc().analysis_json('code', result)
data=commonFuc().analysis_json('data', result)
data=commonFuc().analysis_json('data', data)
data = commonFuc().analysis_json('data', result)
data = commonFuc().analysis_json('data', data)
# print('aaaaaaaaaaaaaaaaaaaaaaaaaaaa',data)
# 断言实际结果中是否包含预期结果的内容
#新注册的企业首次查询产品信息,预期结果为空
# 新注册的企业首次查询产品信息,预期结果为空
check_dict = commonFuc().get_business_data(module, "checkDict")
# print('预期值',check_dict)
commonFuc().check_text_exist(code, result) #检查验证码
commonFuc().check_text_exist(data, result)#检查数据data为空[]
#产品申报
commonFuc().check_text_exist(code, result) # 检查验证码
commonFuc().check_text_exist(data, result) # 检查数据data为空[]
# 产品申报
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "submitGoodsRegist_url")
#获取请求头信息
# 获取请求头信息
headers = commonFuc().get_business_data(module, "json_headers2",
commonFuc().get_business_data(module, "json_contentType"), token,
projectCode)
p_name = commonFuc().get_business_data(module, "name1") # 获取前缀name
p_name = p_name + commonFuc().randomString(5) # 随机数生成拼接产品名称
request_body = commonFuc().get_business_data(module, "payload6",p_name,p_name,p_name,p_name)
request_body = commonFuc().get_business_data(module, "payload6", p_name, p_name, p_name, p_name, p_name, p_name, p_name,
p_name, p_name, p_name, p_name, p_name, p_name, p_name)
print('新增产品请求体', request_body)
# 发送请求
result = commonFuc().http_post(url, request_body, headers)
# print("新增产品返回结果",result)
goodsRegistVO=commonFuc().analysis_json('goodsRegistVO', result)
goodsName=commonFuc().analysis_json('goodsName', goodsRegistVO)
commonFuc().check_text_exist(goodsName, result) #检查返回结果中是否存在新增的产品名称
#===================产品查询==========================================
url= commonFuc().get_api_url() + commonFuc().get_business_data(module, "listAuditBillByPage_url")
#获取请求头信息
print("新增产品返回结果", result)
goodsRegistVO = commonFuc().analysis_json('goodsRegistVO', result)
goodsName = commonFuc().analysis_json('goodsName', goodsRegistVO)
commonFuc().check_text_exist(goodsName, result) # 检查返回结果中是否存在新增的产品名称
# ===================产品查询==========================================
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "listAuditBillByPage_url")
# 获取请求头信息
headers = commonFuc().get_business_data(module, "json_headers2",
commonFuc().get_business_data(module, "json_contentType"), token,
projectCode)
request_body = commonFuc().get_business_data(module, "payload7",p_name)
request_body = commonFuc().get_business_data(module, "payload7", p_name)
# 发送请求
result = commonFuc().http_post(url, request_body, headers)
# print('查询产品信息',result)
data=commonFuc().analysis_json('data', result)
GRBid=commonFuc().analysis_json('id', data)
#===================产品查询后锁定==========================================
url= commonFuc().get_api_url() + commonFuc().get_business_data(module, "updateById_url2")
#获取请求头信息
print('查询产品信息',result)
data = commonFuc().analysis_json('data', result)
GRBid = commonFuc().analysis_json('id', data)
print('GRBid',GRBid)
# ===================产品查询后锁定==================================================
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "updateById_url2")
# 获取请求头信息
headers = commonFuc().get_business_data(module, "json_headers2",
commonFuc().get_business_data(module, "json_contentType"), token,
projectCode)
now=timeUtils().get_time_hms()
request_body = commonFuc().get_business_data(module, "payload8",GRBid,uxid,now)
now = timeUtils().get_time_hms()
request_body = commonFuc().get_business_data(module, "payload8", GRBid, uxid, now)
# 发送请求
result = commonFuc().http_post(url, request_body, headers)
# print('锁定结果',result)
#===================产品锁定后查询获取必要信息==========================================
\ No newline at end of file
# ===================产品锁定后查询获取产品详情登等必要信息==========================================
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "getGoodsRegistBillDetail_url")
url = url + GRBid + "/1"
print('url', url)
# 获取请求头信息
headers = commonFuc().get_business_data(module, "json_headers2",
commonFuc().get_business_data(module, "json_contentType"), token,
projectCode)
# 发送请求
result = commonFuc().http_get(url, headers)
print('产品锁定后查询获取必要信息', result)
# print('data',data)
goodsRegistVO_id = commonFuc().analysis_json('id', commonFuc().analysis_json('goodsRegistVO',
commonFuc().analysis_json('data', result)))
print('goodsRegistVO_id', goodsRegistVO_id)
goodsName = p_name
goodsMfrsId = commonFuc().analysis_json('goodsMfrsId', commonFuc().analysis_json('goodsRegistVO',
commonFuc().analysis_json('data',
result)))
corpId = commonFuc().analysis_json('corpId', commonFuc().analysis_json('goodsRegistVO',
commonFuc().analysis_json('data', result)))
registrationRegistVO_id = commonFuc().analysis_json('id', commonFuc().analysis_json('registrationRegistVO',
commonFuc().analysis_json('data',
result)))
goodsSpecsRegistVOList_id = commonFuc().analysis_json('id', commonFuc().analysis_json('goodsSpecsRegistVOList',
commonFuc().analysis_json('data',
result)))
print(goodsRegistVO_id, goodsMfrsId, corpId, registrationRegistVO_id, goodsSpecsRegistVOList_id)
# =============================产品审核通过======================================
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "handleAuditGoodsRegist_url")
# 获取请求头信息
headers = commonFuc().get_business_data(module, "json_headers2",
commonFuc().get_business_data(module, "json_contentType"), token,
projectCode)
request_body = commonFuc().get_business_data(module, "payload9", GRBid, goodsRegistVO_id, now, now, uxid, uxid, GRBid,
goodsName, goodsMfrsId, goodsMfrsId, corpId, corpId,
goodsSpecsRegistVOList_id, now, now, uxid, uxid, GRBid, goodsRegistVO_id,
goodsMfrsId, goodsName, goodsName, goodsName, goodsName, goodsName,
goodsName, registrationRegistVO_id, now, now, uxid, uxid, GRBid,
goodsRegistVO_id, goodsName, now, goodsMfrsId, goodsMfrsId, goodsName)
# 发送请求
result = commonFuc().http_post(url, request_body, headers)
print('产品审核通过',result)
code= commonFuc().analysis_json('code', result)
commonFuc().check_text_exist_result_text(code,result)
......@@ -375,6 +375,7 @@ class commonFuc(object):
结果检查,检查文本内容是否存在于返回结果中,返回结果也是文本
"""
Flag = False
check_text=str(check_text)
# print('bbbbbbbbbbbbbbbbbbbbbbbbb'+str(result.values()))
if check_text in result_text:
Flag = True
......
......@@ -6,6 +6,8 @@
"submitGoodsRegist_url": "/test2api/mdmService/goodsRegistBill/submitGoodsRegist"
"listAuditBillByPage_url": "/test2api/mdmService/goodsRegistBill/listAuditBillByPage"
"updateById_url2": "/test2api/mdmService/goodsRegistBill/updateById"
"getGoodsRegistBillDetail_url": "/test2api/mdmService/goodsRegistBill/getGoodsRegistBillDetail/"
"handleAuditGoodsRegist_url": "/test2api/mdmService/goodsRegistBill/handleAuditGoodsRegist/"
"username": "1679886114521"
"password": "a123456!"
......@@ -144,7 +146,7 @@ json_headers2: {
"miDjmc": "%s",
"mi20code": "12345678901234567890",
"made": "美国",
"certCode": "1234567890",
"certCode": "%s",
"certKind": "0",
"certKindName": "医疗器械注册证",
"expdtBeginDate": "2023-09-05",
......@@ -153,12 +155,12 @@ json_headers2: {
"uploadFilePath": "/sfile/2023/pub/src=http___10wallpaper.com_wallp_f7d03d60d2fe42da8be7d65dfe1de601.jpg",
"tableFromDec": [
{
"goodsGg": "10ml",
"miGoodsGg": "10ml",
"goodsGg": "%s",
"miGoodsGg": "%s",
"miGoodsXh": "%s",
"goodsUseUnit": "支",
"mi27code": "12345678901234567890",
"udiCode": "12345678901234",
"mi27code": "%s",
"udiCode": "%s",
"diType": "0",
"rowNum": 1
}
......@@ -172,7 +174,7 @@ json_headers2: {
"corpId": "",
"corpName": "",
"registrationRegistVO": {
"certCode": "1234567890",
"certCode": "%s",
"certKind": "0",
"certKindName": "医疗器械注册证",
"expdtBeginDate": "2023-09-05 00:00:00",
......@@ -182,12 +184,12 @@ json_headers2: {
},
"goodsSpecsRegistVOList": [
{
"goodsGg": "10ml",
"miGoodsGg": "10ml",
"goodsGg": "%s",
"miGoodsGg": "%s",
"miGoodsXh": "%s",
"goodsUseUnit": "支",
"mi27code": "12345678901234567890",
"udiCode": "12345678901234",
"mi27code": "%s",
"udiCode": "%s",
"diType": "0",
"rowNum": 1
}
......@@ -212,6 +214,94 @@ json_headers2: {
"auditor": "%s",
"auditStartTime": "%s"
}
"payload9": {
"id": "%s",
"auditStatus": 20,
"auditComment": "",
"goodsRegistVO": {
"id": "%s",
"lastModified": "%s",
"version": 0,
"createTime": "%s",
"createUser": "%s",
"lastModifiedUser": "%s",
"billId": "%s",
"provGoodsId": null,
"mdmGoodsCode": null,
"goodsName": "%s",
"goodsMfrsId": "%s",
"goodsAgentMfrsId": "%s",
"brand": null,
"miDjmc": null,
"mi20code": null,
"miKindCode": null,
"isAbroad": 0,
"made": null,
"property": "1",
"mgrLevel": "1",
"goodsDesc": null,
"corpId": "%s",
"createUserCorpId": "%s",
"goodsMfrsName": "北京中杉金桥生物技术有限公司(test)",
"goodsAgentMfrsName": "北京中杉金桥生物技术有限公司(test)",
"purpose": "01",
"purposeName": "有源手术器械",
"kind68Code": "6801",
"kind68CodeName": "基础外科手术器械",
"mgrLevelName": "I级"
},
"goodsSpecsRegistVOList": [
{
"id": "%s",
"lastModified": "%s",
"version": 0,
"createTime": "%s",
"createUser": "%s",
"lastModifiedUser": "%s",
"billId": "%s",
"goodsRegistId": "%s",
"mdmGoodsSpecCode": null,
"provGoodsSpecsId": null,
"goodsMfrsId": "%s",
"goodsName": "%s",
"shortPinyin": "%s",
"goodsGg": "%s",
"miGoodsGg": "%s",
"miGoodsXh": "%s",
"mi27code": "%s",
"udiCode": null,
"goodsUseUnit": "个",
"auditStatus": 10,
"auditComment": null,
"specAuditStatus": true
}
],
"registrationRegistVO": {
"id": "%s",
"lastModified": "%s",
"version": 0,
"createTime": "%s",
"createUser": "%s",
"lastModifiedUser": "%s",
"billId": "%s",
"goodsRegistId": "%s",
"certKind": "0",
"certKindName": "医疗器械注册证",
"certCode": "%s",
"expdtBeginDate": "%sT00:00:00.000+00:00",
"expdtEndDate": "2093-06-01 00:00:00T00:00:00.000+00:00",
"regMfrsId": "%s",
"agentMfrsId": "%s",
"productName": "%s",
"activeFlag": 1,
"registSourceProject": "h0347",
"filePath": "/sfile/2023/hdi/2023-04-30_090212_2ed1db473e3d42c3b2265a18a6596e5b.png",
"fileOriginalName": "2023-04-30_090212.png"
},
"version": 1
}
"name1": "一次性注射器"
checkDict: {"code": 0, "msg":None,"data": {"pageNum": 1, "pageSize": 20, "total": 0, "data": [], "totalInfo": None}}
checkDict1: {"code": -2,"msg": "医院已被注册,请耐心等待审核通知!", "data": None}
......
......@@ -55,9 +55,9 @@
<tr width="600">
<td class='details-col-elapsed'>1</td>
<td class='details-col-elapsed'>1</td>
<td class='details-col-elapsed'>0</td>
<td class='details-col-elapsed'>0分2秒</td>
<td class="details-col-elapsed">100.0%</td>
<td class="details-col-elapsed">0.0%</td>
</tr>
</table>
......@@ -73,8 +73,8 @@
<tr width="600">
<td class="details-col-elapsed"><a href='../log/产品新增和审核通过/log.html' target='_blank'>产品新增和审核通过</a></td>
<td class="success">成功</td>
<td class="details-col-elapsed">2.154</td>
<td class="fail">失败</td>
<td class="details-col-elapsed">2.514</td>
<td class="details-col-elapsed">xiaohesheng</td>
</tr>
......
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