Commit 139068fe authored by 肖 和生's avatar 肖 和生
Browse files

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

# Conflicts:
#	data/b5_spd3_core_business_flow/message
#	data/b5_spd3_core_business_flow/message1
#	data/b5_spd3_core_business_flow/message2
parents c04df304 1a0ad915
......@@ -17,6 +17,7 @@ __author__ = "xiaohesheng"
case_tag:api,spd_core,a_b7流程十四退库业务_消耗退库,id2302,id2302-17,sit,on
核心业务流:a_b7流程十四退库业务_消耗退库
python runner_test.py tag id2302-17 debug mdm3
低值产品需要保证2个库存,脚本才能正常
"""
......@@ -174,6 +175,9 @@ def second_dept_consume_Out_Stock(type): # 二级库消耗出库
elif type == 1:
print('低值耗材消耗出库')
udi_code = get_udi2(1,token)
if udi_code=='pkgCodeSee':
print('没有获取到有效条码')
sys.exit(0)
data1 = pickScan4(udi_code)
# 获取必要信息
areaCode = commonFuc().analysis_json('areaCode', data1)
......@@ -389,6 +393,9 @@ def sCan_grant(type=1): # 获取条码and扫码发放高值不能发放
udi_code = get_udi2(3,token) # 获取条码 低值1 高值2 试剂3
else:
udi_code = 'udi_code'
if udi_code=='pkgCodeSee':
print('没有获取有效条码')
sys.exit(0)
if type == 1:
pickScan3(udi_code, 1) # 低值扫码发放
elif type == 3:
......
......@@ -23,7 +23,7 @@ python runner_test.py tag id2302-20 debug mdm3
def second_center_Stock_return_Out(type): # 中心库退供应商
def center_Stock_return_Out(type): # 中心库退供应商
module = "b5_spd3_core_business_flow"
# # 登录获取用户id等信息,使用创建的用户登录===========开始
info = FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3')
......@@ -629,9 +629,9 @@ def second_center_Stock_return_Out(type): # 中心库退供应商
def main():
try:
updateUserLoginDefaultRange(get_listUserMgrRangePage1(1)) # 设置登录账号默认权限是二级库
second_center_Stock_return_Out(2) #高值耗材退货出库
second_center_Stock_return_Out(1) #低值耗材退货出库
second_center_Stock_return_Out(3) #试剂耗材退货出库
center_Stock_return_Out(2) #高值耗材退货出库
center_Stock_return_Out(1) #低值耗材退货出库
center_Stock_return_Out(3) #试剂耗材退货出库
commonFuc().check_text_exist_result_text('succees', 'succees')
print('================流程十七执行完毕====================')
......
......@@ -205,7 +205,8 @@ def check_mcms_dept_buy(type=16):
# area_code = get_stockAreaId_new(deptid2, deptname2, 2)
info = FileUtils().r_info8("b5_spd3_core_business_flow", "库区信息", 'message22')
list_a = info['list_a']
area_code = commonFuc().analysis_json('shelfCode', list_a)
# area_code = commonFuc().analysis_json('shelfCode', list_a)
area_code = get_stockAreaId_new_fromDb(deptname2, 2)
area_name = '默认库区'
# 读取文件中的信息
info = FileUtils().r_info8('b5_spd3_core_business_flow', "二级库请领产品信息", 'message21')
......@@ -217,7 +218,7 @@ def check_mcms_dept_buy(type=16):
pkgDefId = commonFuc().analysis_json('pkgDefId', list_a)
pkgDefName = commonFuc().analysis_json('pkgDefName', list_a)
# 获取边仓id
time.sleep(3)
time.sleep(6)
target_stock_id = get_id("select logic_id FROM yb_direct WHERE branch_id ='%s' order by create_time desc LIMIT 1;" % branch_id)
bill_expdt_date = get_expdt_date(
"select bill_expdt_date from mcms_dept_buy where branch_id='%s' and bill_mode='%s' and buy_kind='KS' order by create_time desc LIMIT 1;" % (
......@@ -305,7 +306,7 @@ def check_mcms_dept_buy_approval_after(type=16):
# area_code = get_stockAreaId_new(deptid2, deptname2, 2)
info = FileUtils().r_info8("b5_spd3_core_business_flow", "库区信息", 'message22')
list_a = info['list_a']
area_code = commonFuc().analysis_json('shelfCode', list_a)
area_code = get_stockAreaId_new_fromDb(deptname2, 2)
area_name = '默认库区'
# 读取文件中的信息
info = FileUtils().r_info8('b5_spd3_core_business_flow', "二级库请领产品信息", 'message21')
......@@ -495,6 +496,7 @@ def main():
# # # 试剂
second_dept_Request(FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message3')['hosGoodsId'], 3)
check_mcms_dept_buy_car(3)
time.sleep(8)
BuyCarSubmit() # 请领车提交
time.sleep(8)
# 调用函数对数据库中的数据进行验证和比对
......
......@@ -218,7 +218,7 @@ def check_mcms_dept_buy(type=16):
# area_code = get_stockAreaId_new(deptid2, deptname2, 2)
info = FileUtils().r_info8("b5_spd3_core_business_flow", "库区信息", 'message22')
list_a = info['list_a']
area_code = commonFuc().analysis_json('shelfCode', list_a)
area_code = get_stockAreaId_new_fromDb(deptname2, 2)
area_name = '默认库区'
# 读取文件中的信息
info = FileUtils().r_info8('b5_spd3_core_business_flow', "二级库请领产品信息", 'message21')
......@@ -321,7 +321,7 @@ def check_mcms_dept_buy_approval_after(type=16):
# area_code = get_stockAreaId_new(deptid2, deptname2, 2)
info = FileUtils().r_info8("b5_spd3_core_business_flow", "库区信息", 'message22')
list_a = info['list_a']
area_code = commonFuc().analysis_json('shelfCode', list_a)
area_code =get_stockAreaId_new_fromDb(deptname2, 2)
area_name = '默认库区'
# 读取文件中的信息
info = FileUtils().r_info8('b5_spd3_core_business_flow', "二级库请领产品信息", 'message21')
......@@ -522,7 +522,7 @@ def check_mcms_mcms_pur_plan(type=16):
rec_org_name = dept_name2
info = FileUtils().r_info8("b5_spd3_core_business_flow", "库区信息", 'message22')
list_a = info['list_a']
area_code = commonFuc().analysis_json('shelfCode', list_a)
area_code =get_stockAreaId_new_fromDb(dept_name2, 2)
sql1 = "select area_name from mcms_pur_plan where branch_id='%s' and source_id='%s' order by create_time desc LIMIT 1;" % (
branch_id, id1)
area_name = process_tuple(get_id(sql1))
......@@ -778,7 +778,7 @@ def check_mcms_purchase(type=16):
rec_org_name = dept_name2
info = FileUtils().r_info8("b5_spd3_core_business_flow", "库区信息", 'message22')
list_a = info['list_a']
area_code = commonFuc().analysis_json('shelfCode', list_a)
area_code =get_stockAreaId_new_fromDb(dept_name2, 2)
sql1 = "select area_name from mcms_purchase where branch_id='%s' and id='%s' order by create_time desc LIMIT 1;" % (
branch_id, id1)
area_name = process_tuple(get_id(sql1))
......@@ -2287,6 +2287,7 @@ def check_mcms_hos_batch(type=1): # 检查批次表信息
stock_id = get_stockId_fromdb(stock_name)
src_batch_id = get_id("select src_batch_id from mcms_hos_batch where id='%s';" % id)
src_batch_id = id
hos_goods_id='hos_goods_id'
if type == 1:
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"]
elif type == 2:
......@@ -2350,7 +2351,8 @@ def check_mcms_hos_batch(type=1): # 检查批次表信息
goodsName, erpCode, create_user, create_time
, last_modified, last_modified_user)
else:
fcatId=get_id("select id from mcms_goods_kind where kind_name='财务试剂';")
# fcatId=get_id("select id from mcms_goods_kind where kind_name='财务试剂';")
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', 'check_mcms_hos_batch3',
id,
hos_id, branch_id, stock_id, src_batch_id, hos_goods_id,
......@@ -2358,7 +2360,7 @@ def check_mcms_hos_batch(type=1): # 检查批次表信息
, mfrs_id, supply_id, prov_id, prov_name, sub_prov_id,
sub_prov_name, expdt_date, product_date
, distr_id, distr_detail_id, purBillId, in_time, goodsGg, goodsCode,
goodsName, erpCode, fcatId,create_user, create_time
goodsName, erpCode,create_user, create_time
, last_modified, last_modified_user)
# 对比预期值和实际值是否一致
actual_value1 = get_process_list2(actual)
......@@ -2477,7 +2479,7 @@ def main():
second_dept_one_key_in()
second_dept_one_key_in()
second_dept_one_key_in()
time.sleep(6)
# 检查二级库入库单
check_mcms_psi_dept_in(16)
check_mcms_psi_dept_in(20)
......
......@@ -352,6 +352,7 @@ def check_mcms_psi_dept_batch(DR_ID,type,order_no):
)
else:
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'mcms_psi_dept_batch3',batch_main_key, pid, order_no,source_detail_id
,pick_detail_id,hos_goods_id,mdm_goods_code,goods_code,source_batch_id,
......@@ -396,7 +397,7 @@ def check_mcms_psi_dept(type=16):
info = FileUtils().r_info8('b5_spd3_core_business_flow', "拣货单高值id", 'message26')
DR_ID = info['DR_NO1高值']
else:
info = FileUtils().r_info8('b5_spd3_core_business_flow', "拣货单试剂id", 'message28')
info = FileUtils().r_info8('b5_spd3_core_business_flow', "拣货单试剂id", 'message26')
DR_ID = info['DR_NO1试剂']
DR_ID = ''.join(DR_ID)
sql = "select order_no from mcms_psi_dept where id='%s';" % DR_ID
......@@ -732,13 +733,16 @@ def check_mcms_psi_dept_in(type=16):
branch_id, type)
actual = check_mcms_dept_buy_sql(sql)
print(actual)
info = FileUtils().r_info8('b5_spd3_core_business_flow', "拣货单id", 'message26')
# info = FileUtils().r_info8('b5_spd3_core_business_flow', "拣货单id", 'message26')
if type == 16:
source_id = info['DR_NO2']
info = FileUtils().r_info8('b5_spd3_core_business_flow', "拣货单低值id", 'message26')
source_id = info['DR_NO1低值']
elif type == 20:
source_id = info['DR_NO3']
info = FileUtils().r_info8('b5_spd3_core_business_flow', "拣货单高值id", 'message26')
source_id = info['DR_NO1高值']
else:
source_id = info['DR_NO1']
info = FileUtils().r_info8('b5_spd3_core_business_flow', "拣货单试剂id", 'message26')
source_id = info['DR_NO1试剂']
source_id = ''.join(source_id)
source_no=get_id("select order_no from mcms_psi_dept where id='%s';"%source_id)
#获取入库单主键DR_ID
......@@ -899,11 +903,13 @@ def main():
# # 二级科室领用出库
# # 低值拣货执行
pick_execute()
time.sleep(8)
# 检查拣货单
list_data = ['16', '20', '66']
for i in list_data:
check_mcms_pick(int(i))
time.sleep(8)
# 检查出库单
check_mcms_psi_dept(16)
check_mcms_psi_dept(20)
......@@ -911,6 +917,7 @@ def main():
second_dept_one_key_in(5)
second_dept_one_key_in(5)
second_dept_one_key_in(5)
time.sleep(8)
# # 上面暂时注释========================
# 检查入库单
check_mcms_psi_dept_in(16)
......
......@@ -80,6 +80,7 @@ def check_mcms_dept_buy_car(type=1):
goodsCode,
create_user, create_time, last_modified, last_modified_user)
else:
# mdm_goods_code="null"
expected_value2 = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'check_mcms_dept_buy_car3', id, get_hosid(), branch_id,
deptid3,
......
......@@ -136,7 +136,7 @@ def check_mcms_psi_dept_in(type=10):
def check_mcms_psi_dept_batch_in(DR_ID1,DR_ID,type):
branch_id = get_branch_id()
if type==67:
sql = " select * from mcms_psi_dept_batch where pid='%s' order by create_time desc LIMIT 1;" % (
sql = "select * from mcms_psi_dept_batch where pid='%s' order by create_time desc LIMIT 1;" % (
DR_ID1)
count=process_tuple(get_id("select count(*) from mcms_psi_dept_batch where pid='%s'"%DR_ID1))
if count=='100':
......@@ -145,7 +145,7 @@ def check_mcms_psi_dept_batch_in(DR_ID1,DR_ID,type):
else:
commonFuc().check_text_exist_result_text('error', 'SUCCESS')
else:
sql = " select * from mcms_psi_dept_batch where pid='%s';" % (
sql = "select * from mcms_psi_dept_batch where pid='%s';" % (
DR_ID1)
actual = check_mcms_dept_buy_sql(sql)
print('actual', actual)
......@@ -851,7 +851,7 @@ def check_mcms_psi_dept_XH_CK(type1=10,type2=16):
check_mcms_psi_dept_batch_xhrk(DR_ID1,source_id,type2,order_no1)
source_id="-"
source_area_code=None
his_charge_no=get_id(" select his_charge_no from his_order where branch_id='%s' and psi_dept_id='%s' order by create_time desc LIMIT 1;"%(branch_id,DR_ID1))
his_charge_no=get_id("select his_charge_no from his_order where branch_id='%s' and psi_dept_id='%s' order by create_time desc LIMIT 1;"%(branch_id,DR_ID1))
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'mcms_psi_dept_out_xhrk1', DR_ID1, order_no1, target_corp_id, target_branch_id,
target_dept_id, target_dept_name, target_stock_id
......@@ -867,7 +867,7 @@ def check_mcms_psi_dept_XH_CK(type1=10,type2=16):
source_id = "-"
source_area_code = None
his_charge_no = get_id(
" select his_charge_no from his_order where branch_id='%s' and psi_dept_id='%s' order by create_time desc LIMIT 1;" % (
"select his_charge_no from his_order where branch_id='%s' and psi_dept_id='%s' order by create_time desc LIMIT 1;" % (
branch_id, DR_ID1))
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'mcms_psi_dept_out_xhrk2', DR_ID1, order_no1, target_corp_id,
......@@ -920,17 +920,25 @@ from a_b7流程十四退库业务_消耗退库 import sCan_grant,second_dept_con
try:
updateUserLoginDefaultRange(get_listUserMgrRangePage1(2)) # 设置登录账号默认权限是二级库
sCan_grant(1) # 低值扫码发放
time.sleep(8)
check_mcms_psi_dept_out_and_in(16,10)#检查出库单和入库单(包括主表和子表)
sCan_grant(3) # 试剂扫码发放
time.sleep(8)
check_mcms_psi_dept_out_and_in(66,67)#检查出库单和入库单(包括主表和子表)
second_dept_consume_Out_Stock(2) # 高值消耗出库
time.sleep(8)
second_dept_consume_in_Stock(2) # 高值消耗退货入库
time.sleep(8)
check_mcms_psi_dept_out_and_in(20, 20) #检查高值消耗出库单和消耗入库单包括主表和子表)
second_dept_consume_Out_Stock(1) # 低值消耗出库
time.sleep(8)
second_dept_consume_in_Stock(1) # 低值消耗退回入库
time.sleep(8)
check_mcms_psi_dept_XH_CK(10,10)#检查低值消耗出库单和消耗入库单包括主表和子表
second_dept_consume_Out_Stock(3) # 试剂消耗出库
time.sleep(8)
second_dept_consume_in_Stock(3) # 试剂消耗退回入库
time.sleep(8)
check_mcms_psi_dept_XH_CK(67, 67)#检查试剂消耗出库单和消耗入库单包括主表和子表
commonFuc().check_text_exist_result_text('SUCCESS', 'SUCCESS')
except Exception as e:
......
......@@ -331,7 +331,6 @@ def check_mcms_psi_dept_in(type1=16):
if type1 == 16:
# 子表检查
check_mcms_psi_dept_batch_in(DR_ID,type1,order_no)
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'mcms_psi_dept_tkrk1', DR_ID, order_no, target_corp_id, target_branch_id,
target_dept_id, target_dept_name, target_stock_id
......@@ -344,7 +343,6 @@ def check_mcms_psi_dept_in(type1=16):
elif type1 == 20:
# 子表检查
check_mcms_psi_dept_batch_in(DR_ID,type1,order_no)
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'mcms_psi_dept_tkrk2', DR_ID, order_no, target_corp_id, target_branch_id,
target_dept_id, target_dept_name, target_stock_id
......@@ -352,7 +350,6 @@ def check_mcms_psi_dept_in(type1=16):
source_dept_id, source_dept_name, source_stock_id, source_area_code,accounter,account_date,
pickOrderNo, pickBillId, psiDeptOutBillId, psiDeptOutOrderNo,psiDeptInBillId,psiDeptInOrderNo
, create_user, create_time, last_modified, last_modified_user
)
else:
# 子表检查
......@@ -364,7 +361,6 @@ def check_mcms_psi_dept_in(type1=16):
source_dept_id, source_dept_name, source_stock_id, source_area_code,accounter,account_date,
pickOrderNo, pickBillId, psiDeptOutBillId, psiDeptOutOrderNo,psiDeptInBillId,psiDeptInOrderNo
, create_user, create_time, last_modified, last_modified_user
)
print('expected', expected)
print('aaaaaaaaaaaaaaaaa')
......
......@@ -2060,7 +2060,8 @@ def get_stockAreaId_new_fromDb(deptName, type=1):
# 中心库房名称
branch_name = FileUtils().r_info(module, '院区新增')["branch_name"]
stockId = get_stockId_fromdb(branch_name + '中心库房')
deptName = FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid1']
# deptName = FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid1']
deptName='自动化测试'
# 二级库房名称
elif type == 2:
stockId = get_stockId_fromdb(deptName + '库房')
......@@ -2072,7 +2073,6 @@ def get_stockAreaId_new_fromDb(deptName, type=1):
# 获取库房id==========结束============
# ====获取库区id===== 开始==========
sql = "select shelf_code from mcms_stock_shelf where stock_Id='%s'and address='%s';" % (stockId, deptName)
print(sql)
shelfCode = get_id(sql)
......
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