Commit e97c4c96 authored by 肖 和生's avatar 肖 和生
Browse files

Merge remote-tracking branch 'remotes/origin/master' into core_folw1

# Conflicts:
#	data/b5_spd3_core_business_flow/message10
#	data/b5_spd3_core_business_flow/message11
#	data/b5_spd3_core_business_flow/message12
#	data/b5_spd3_core_business_flow/message13
#	data/b5_spd3_core_business_flow/message14
#	data/b5_spd3_core_business_flow/message15
#	data/b5_spd3_core_business_flow/message8
#	data/b5_spd3_core_business_flow/message9
parents 863d7f20 8ae13a75
......@@ -184,7 +184,7 @@ def check_accept_order(type=1):
data = commonFuc().analysis_json('data', result)
code= commonFuc().analysis_json('code', result)
print(code)
if code ==0 and data==100:
if code ==0 and len(data)>=100:
break
else:
print('设置产品合格出现问题')
......
......@@ -19,58 +19,112 @@ case_tag:api,b6_spd3_core_business_flow_database_check,a_b3流程十请领业务
核心业务流:a_b3流程十请领业务流_二级库向边仓
python runner_test.py tag id2303-13 debug mdm3
"""
def check_mcms_dept_buy(type):
import pdb
pdb.set_trace()
if type==1:#低值
def check_mcms_dept_buy(type=1):
hos_goods_id='hos_goods_id'
if type==1:
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"]
branch_id=get_branch_id()
actual_value1 = tools_check_mcms_dept_buy(branch_id,hos_goods_id)
print(actual_value1)
# print('actual_value2',actual_value1)
actual_value2 = get_process_list2(actual_value1)
print('actual_value2', actual_value2, type(actual_value2))
prov_hos_goods_id = '8d6273b7bca84dd8aace12b9422d7fd6'
expected_value2 = commonFuc().get_business_data('b5_spd3_core_business_flow', 'expected_value2', prov_hos_goods_id)
print('expected_value2', expected_value2, type(expected_value2))
actual_value2 = actual_value2.replace(" ", "")
expected_value2 = expected_value2.replace(" ", "")
print(actual_value2 == expected_value2)
if actual_value2 == expected_value2:
print('ok')
commonFuc().check_text_exist_result_text('succees', 'succees')
else:
print('error')
commonFuc().check_text_exist_result_text('error', 'succees')
elif type==2:
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message1')["hosGoodsId"]
elif type==3:
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message3')["hosGoodsId"]
branch_id = get_branch_id()
# 获取每次都会变化的字段create_time的值
create_time = get_create_time(
"select create_time from mcms_dept_buy_car where branch_id='%s'and hos_goods_id='%s';" % (
branch_id, hos_goods_id))
print('create_time',create_time)
id = get_id(
"select id from mcms_dept_buy_car where branch_id='%s'and hos_goods_id='%s';" % (branch_id, hos_goods_id))
print('id',id)
create_user = get_id(
"select create_user from mcms_dept_buy_car where branch_id='%s'and hos_goods_id='%s' LIMIT 1;" % (
branch_id, hos_goods_id))
print('create_time', create_time, 'id', id)
sql = """select * from mcms_dept_buy_car where branch_id='%s' and hos_goods_id='%s' LIMIT 1;
""" % (branch_id, hos_goods_id)
actual_value1 = check_mcms_dept_buy_car(sql)
print(actual_value1)
deptid2 = FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid2']
deptname2 = FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid2']
areaCode = get_stockAreaId_new(deptid2, deptname2, 2)
areaName = '默认库区'
# 读取文件中的信息
info = FileUtils().r_info8('b5_spd3_core_business_flow', "二级库请领产品信息", 'message21')
list_a = info['list_a']
mdm_goods_code = commonFuc().analysis_json('mdmGoodsCode', list_a)
pur_mode = commonFuc().analysis_json('purMode', list_a)
goodsCode = commonFuc().analysis_json('goodsCode', list_a)
pkgDefId = commonFuc().analysis_json('pkgDefId', list_a)
pkgDefName = commonFuc().analysis_json('pkgDefName', list_a)
last_modified_user = create_user
last_modified = create_time
# print('actual_value1',actual_value1)
actual_value2 = get_process_list2(actual_value1)
# print('actual_value2')
# print( actual_value2)
# prov_hos_goods_id = '8d6273b7bca84dd8aace12b9422d7fd6'
expected_value2='expected_value2'
if type==1 or type==3:
expected_value2 = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'check_mcms_dept_buy_car_low_value', id, get_hosid(), branch_id, deptid2,
deptname2, areaCode, areaName, hos_goods_id, mdm_goods_code,
goodsCode,pur_mode, pkgDefId, pkgDefName
, create_user, create_time, last_modified, last_modified_user)
elif type==2:
expected_value2 = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'check_mcms_dept_buy_car_high_value', id, get_hosid(), branch_id,
deptid2,
deptname2, areaCode, areaName, hos_goods_id, mdm_goods_code,
goodsCode, pur_mode,
create_user, create_time, last_modified, last_modified_user)
# print('expected_value2', expected_value2)
# expected_value2=get_process_list2(expected_value2)
actual_value2 = actual_value2.replace(" ", "")
expected_value2 = expected_value2.replace(" ", "")
# print('actual_value2',actual_value2)
print('expected_value2')
print(expected_value2)
print('actual_value2')
print(actual_value2)
if actual_value2 == expected_value2:
print('ok')
commonFuc().check_text_exist_result_text('succees', 'succees')
else:
print('error')
commonFuc().check_text_exist_result_text('error', 'succees')
try:
# set_dept_lead() # 设置二级科室负责人
set_dept_lead() # 设置二级科室负责人
# 科室必须同步到外网,集中管控平台创建边仓才能选择到用户,"deptType":"0"
pro_path = commonFuc().get_pro_path2()
print('pro_path',pro_path)
# sys.path.append(pro_path + r'/air_case/b5_spd3_core_business_flow/a_b3流程十请领业务流_二级库向边仓.air')
print('pro_path', pro_path)
sys.path.append(pro_path + r'/air_case/b5_spd3_core_business_flow/a_b3流程十请领业务流_二级库向边仓.air')
using(pro_path + r'//air_case/b5_spd3_core_business_flow/a_b3流程十请领业务流_二级库向边仓.air')
# from a_b3流程十请领业务流_二级库向边仓 import add_logic_stock
# add_logic_stock()
from a_b3流程十请领业务流_二级库向边仓 import add_logic_stock
add_logic_stock()
from a_b3流程十请领业务流_二级库向边仓 import goods_move
from a_b3流程十请领业务流_二级库向边仓 import second_dept_Request
from a_b3流程十请领业务流_二级库向边仓 import BuyCarSubmit
from a_b3流程十请领业务流_二级库向边仓 import check_buyWayText
# from a_b3流程十请领业务流_二级库向边仓 import goods_move
# from a_b3流程十请领业务流_二级库向边仓 import second_dept_Request
# from a_b3流程十请领业务流_二级库向边仓 import BuyCarSubmit
# from a_b3流程十请领业务流_二级库向边仓 import check_buyWayText
# add_logic_stock()
#
# # 设置产品出库渠道为边仓
# goods_move()
# updateUserLoginDefaultRange(get_listUserMgrRangePage(2)) # 设置登录账号默认权限是二级库
goods_move()
updateUserLoginDefaultRange(get_listUserMgrRangePage(2)) # 设置登录账号默认权限是二级库
# # # # 低值
# second_dept_Request(FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message2')['hosGoodsId'], 1)
# check_mcms_dept_buy(1)
second_dept_Request(FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message2')['hosGoodsId'], 1)
check_mcms_dept_buy(1)
# # # 高值
# second_dept_Request(FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message1')['hosGoodsId'], 2)
second_dept_Request(FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message1')['hosGoodsId'], 2)
check_mcms_dept_buy(2)
# # # 试剂
# second_dept_Request(FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message3')['hosGoodsId'], 3)
second_dept_Request(FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message3')['hosGoodsId'], 3)
check_mcms_dept_buy(3)
# BuyCarSubmit() # 请领车提交
# for i in range(6): # 三个单据共审批6次
# approval_center()
......
......@@ -18,19 +18,19 @@ from airtest.core.api import using
import sys
# 第一种方式===========================
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"]
actual_value=delData().check_goods_info(hos_goods_id)
print('actual_value',actual_value)
expected_value=commonFuc().get_business_data('b5_spd3_core_business_flow','expected_value')
print('expected_value',expected_value)
actual_value = actual_value.replace(" ", "")
expected_value = expected_value.replace(" ", "")
if actual_value==expected_value:
print('ok')
commonFuc().check_text_exist_result_text('succees', 'succees')
else:
print('error')
commonFuc().check_text_exist_result_text('error', 'succees')
# hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"]
# actual_value=delData().check_goods_info(hos_goods_id)
# print('actual_value',actual_value)
# expected_value=commonFuc().get_business_data('b5_spd3_core_business_flow','expected_value')
# print('expected_value',expected_value)
# actual_value = actual_value.replace(" ", "")
# expected_value = expected_value.replace(" ", "")
# if actual_value==expected_value:
# print('ok')
# commonFuc().check_text_exist_result_text('succees', 'succees')
# else:
# print('error')
# commonFuc().check_text_exist_result_text('error', 'succees')
# 第一种方式===========================
......@@ -41,11 +41,15 @@ print(actual_value1)
# print('actual_value2',actual_value1)
actual_value2 = get_process_list2(actual_value1)
print('actual_value2', actual_value2, type(actual_value2))
prov_hos_goods_id = '8d6273b7bca84dd8aace12b9422d7fd6'
prov_hos_goods_id = '7be89fe4c5ee4689a5e249d3197b9947'
expected_value2 = commonFuc().get_business_data('b5_spd3_core_business_flow', 'expected_value2', prov_hos_goods_id)
expected_value2=get_process_list2(expected_value2)
print('expected_value2', expected_value2, type(expected_value2))
actual_value2 = actual_value2.replace(" ", "")
expected_value2 = expected_value2.replace(" ", "")
print(actual_value2)
print(expected_value2)
print(actual_value2 == expected_value2)
if actual_value2 == expected_value2:
print('ok')
......
......@@ -43,6 +43,7 @@ def get_process_list2(request_body):
return request_body_json
def get_branch_id():
return FileUtils().r_info('b2_herp3_bs', '院区新增')["branch_id"]
......
......@@ -104,13 +104,36 @@ def main2(hos_goods_id):
res_dict = get_dict_data_sql(cursor, sql)
print('res_dict',res_dict)
return res_dict
def tools_check_mcms_dept_buy(branch_id,hos_goods_id):
def check_mcms_dept_buy_car(sql):
db, cursor = get_sql_conn()
sql = """select * from mcms_dept_buy_car where branch_id='%s' and hos_goods_id='%s';
""" % (branch_id,hos_goods_id)
# sql = """select * from mcms_dept_buy_car where branch_id='%s' and hos_goods_id='%s';
# """ % (branch_id,hos_goods_id)
res_dict = get_dict_data_sql(cursor, sql)
print('res_dict', res_dict)
return res_dict
def get_create_time(sql):
db, cursor = get_sql_conn()
cursor.execute(sql)
results = cursor.fetchone()
str1 = str(results)
new_str1 = str1.replace(',)', '')
new_str1 = new_str1.replace('(date', 'date')
# new_str1 = new_str1.replace(',', '')
# print(new_str1)
cursor.close()
return new_str1
def get_id(sql):
db, cursor = get_sql_conn()
cursor.execute(sql)
results = cursor.fetchone()
str1 = str(results)
new_str1 = str1.replace(',)', '')
new_str1 = new_str1.replace('(', '')
new_str1 = new_str1.replace(',', '')
new_str1 = new_str1.replace("'", '')
# print(new_str1)
cursor.close()
return new_str1
hos_goods_id = 'h034700004220'
main2(hos_goods_id)
\ No newline at end of file
企业信息:
e_id: CR202407080038
cname: 国药集团公司^n1@F
e_id: CR202407090038
cname: 国药集团公司L1slG
医院信息:
h_id: 湖南省人民医院1b&Ew
h_name: 湖南省人民医院1b&Ew
h_id: 湖南省人民医院@mRoD
h_name: 湖南省人民医院@mRoD
产品审核信息:
MSPid: MSP2407080011_1
MSPid: MSP2407090011_1
hosId: h0347
hosGoodsId: h034700004503
provGoodsid: provGood-99221699
goodsAuditBillId: MSP2407080011
targetId: MSP2407080011_1
hosGoodsId: h034700004514
provGoodsid: provGood-99221710
goodsAuditBillId: MSP2407090011
targetId: MSP2407090011_1
院区新增:
branch_id: h0347-3736
branch_name: 东土城路院区IjnkG
branch_id: h0347-3738
branch_name: 东土城路院区8SpTq
科室信息:
dept2_id: b3e6c5f2887148389f8535862f789f0a
dept2_id: 7b4d11aec57042e096684a46e9148fdd
dept2_name: 二级检验科002
用户名信息:
username1: 自动化测试xgQKu
username2: 自动化测试xgQKu
username1: 自动化测试lVbzF
username2: 自动化测试lVbzF
一级科室信息:
dept1_id: a762aa0aa2df47dbac4a96173a89e85d
dept1_id: d467187bce7f458eb5c4e1007f557353
dept1_name: 设备科001
所有科室id:
deptid1: a762aa0aa2df47dbac4a96173a89e85d
deptid2: b3e6c5f2887148389f8535862f789f0a
deptid3: b011a25d37e248d1aa1c94d01bb59466
deptid4: 096ad30186f448778c685c7d68c5bfe3
deptid5: b316f3f5225a45949077163a47655ad5
deptid1: d467187bce7f458eb5c4e1007f557353
deptid2: 7b4d11aec57042e096684a46e9148fdd
deptid3: 9a0e8ab0eb5544deafbeb2ce79eabf72
deptid4: 319b64576fe24cc2b24bff3e7d8815c7
所有科室name:
deptid1: 设备科001
deptid2: 二级检验科002
deptid3: 三级检测组003
deptid4: 科室004
deptid5: 二级科室005
shelfinfo:
shelfid: 8bf86ca088f440c1874c09528445cf44
shelfCode: areah03472677
shelfid: 4227bbab7b3c4ea98553cf1c9e764bf6
shelfCode: areah03472689
areaName: 自动化测试
供货关系申请2:
e_corpId: p1e32e
e_corpId: p1e332
h_corpId: h0347
e_username: 国药集团公司^n1@F
e_username: 国药集团公司L1slG
h_name: test001
产品审核信息:
MSPid: MSP2407080007_1
MSPid: MSP2407090007_1
hosId: h0347
hosGoodsId: h034700004499
provGoodsid: provGood-99221695
goodsAuditBillId: MSP2407080007
targetId: MSP2407080007_1
hosGoodsId: h034700004510
provGoodsid: provGood-99221706
goodsAuditBillId: MSP2407090007
targetId: MSP2407090007_1
产品审核信息:
MSPid: MSP2407080008_1
MSPid: MSP2407090008_1
hosId: h0347
hosGoodsId: h034700004500
provGoodsid: provGood-99221696
goodsAuditBillId: MSP2407080008
targetId: MSP2407080008_1
hosGoodsId: h034700004511
provGoodsid: provGood-99221707
goodsAuditBillId: MSP2407090008
targetId: MSP2407090008_1
产品审核信息:
MSPid: MSP2407080009_1
MSPid: MSP2407090009_1
hosId: h0347
hosGoodsId: h034700004501
provGoodsid: provGood-99221697
goodsAuditBillId: MSP2407080009
targetId: MSP2407080009_1
hosGoodsId: h034700004512
provGoodsid: provGood-99221708
goodsAuditBillId: MSP2407090009
targetId: MSP2407090009_1
产品审核信息:
MSPid: MSP2407080010_1
MSPid: MSP2407090010_1
hosId: h0347
hosGoodsId: h034700004502
provGoodsid: provGood-99221698
goodsAuditBillId: MSP2407080010
targetId: MSP2407080010_1
hosGoodsId: h034700004513
provGoodsid: provGood-99221709
goodsAuditBillId: MSP2407090010
targetId: MSP2407090010_1
产品审核信息:
MSPid: MSP2407080011_1
MSPid: MSP2407090011_1
hosId: h0347
hosGoodsId: h034700004503
provGoodsid: provGood-99221699
goodsAuditBillId: MSP2407080011
targetId: MSP2407080011_1
hosGoodsId: h034700004514
provGoodsid: provGood-99221710
goodsAuditBillId: MSP2407090011
targetId: MSP2407090011_1
产品包装信息:
unitPackageid1: 2d4d3bd0ebe745efa73bb7123cf21f6a
unitPackageid2: 2d4d3bd0ebe745efa73bb7123cf21f6a
unitPackageid1: 8ce905b956f14453b958d0da398c0350
unitPackageid2: 8ce905b956f14453b958d0da398c0350
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