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" ...@@ -17,6 +17,7 @@ __author__ = "xiaohesheng"
case_tag:api,spd_core,a_b7流程十四退库业务_消耗退库,id2302,id2302-17,sit,on case_tag:api,spd_core,a_b7流程十四退库业务_消耗退库,id2302,id2302-17,sit,on
核心业务流:a_b7流程十四退库业务_消耗退库 核心业务流:a_b7流程十四退库业务_消耗退库
python runner_test.py tag id2302-17 debug mdm3 python runner_test.py tag id2302-17 debug mdm3
低值产品需要保证2个库存,脚本才能正常
""" """
...@@ -174,6 +175,9 @@ def second_dept_consume_Out_Stock(type): # 二级库消耗出库 ...@@ -174,6 +175,9 @@ def second_dept_consume_Out_Stock(type): # 二级库消耗出库
elif type == 1: elif type == 1:
print('低值耗材消耗出库') print('低值耗材消耗出库')
udi_code = get_udi2(1,token) udi_code = get_udi2(1,token)
if udi_code=='pkgCodeSee':
print('没有获取到有效条码')
sys.exit(0)
data1 = pickScan4(udi_code) data1 = pickScan4(udi_code)
# 获取必要信息 # 获取必要信息
areaCode = commonFuc().analysis_json('areaCode', data1) areaCode = commonFuc().analysis_json('areaCode', data1)
...@@ -389,6 +393,9 @@ def sCan_grant(type=1): # 获取条码and扫码发放高值不能发放 ...@@ -389,6 +393,9 @@ def sCan_grant(type=1): # 获取条码and扫码发放高值不能发放
udi_code = get_udi2(3,token) # 获取条码 低值1 高值2 试剂3 udi_code = get_udi2(3,token) # 获取条码 低值1 高值2 试剂3
else: else:
udi_code = 'udi_code' udi_code = 'udi_code'
if udi_code=='pkgCodeSee':
print('没有获取有效条码')
sys.exit(0)
if type == 1: if type == 1:
pickScan3(udi_code, 1) # 低值扫码发放 pickScan3(udi_code, 1) # 低值扫码发放
elif type == 3: elif type == 3:
......
...@@ -23,7 +23,7 @@ python runner_test.py tag id2302-20 debug mdm3 ...@@ -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" module = "b5_spd3_core_business_flow"
# # 登录获取用户id等信息,使用创建的用户登录===========开始 # # 登录获取用户id等信息,使用创建的用户登录===========开始
info = FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3') info = FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3')
...@@ -629,9 +629,9 @@ def second_center_Stock_return_Out(type): # 中心库退供应商 ...@@ -629,9 +629,9 @@ def second_center_Stock_return_Out(type): # 中心库退供应商
def main(): def main():
try: try:
updateUserLoginDefaultRange(get_listUserMgrRangePage1(1)) # 设置登录账号默认权限是二级库 updateUserLoginDefaultRange(get_listUserMgrRangePage1(1)) # 设置登录账号默认权限是二级库
second_center_Stock_return_Out(2) #高值耗材退货出库 center_Stock_return_Out(2) #高值耗材退货出库
second_center_Stock_return_Out(1) #低值耗材退货出库 center_Stock_return_Out(1) #低值耗材退货出库
second_center_Stock_return_Out(3) #试剂耗材退货出库 center_Stock_return_Out(3) #试剂耗材退货出库
commonFuc().check_text_exist_result_text('succees', 'succees') commonFuc().check_text_exist_result_text('succees', 'succees')
print('================流程十七执行完毕====================') print('================流程十七执行完毕====================')
......
...@@ -205,7 +205,8 @@ def check_mcms_dept_buy(type=16): ...@@ -205,7 +205,8 @@ def check_mcms_dept_buy(type=16):
# area_code = get_stockAreaId_new(deptid2, deptname2, 2) # area_code = get_stockAreaId_new(deptid2, deptname2, 2)
info = FileUtils().r_info8("b5_spd3_core_business_flow", "库区信息", 'message22') info = FileUtils().r_info8("b5_spd3_core_business_flow", "库区信息", 'message22')
list_a = info['list_a'] 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 = '默认库区' area_name = '默认库区'
# 读取文件中的信息 # 读取文件中的信息
info = FileUtils().r_info8('b5_spd3_core_business_flow', "二级库请领产品信息", 'message21') info = FileUtils().r_info8('b5_spd3_core_business_flow', "二级库请领产品信息", 'message21')
...@@ -217,7 +218,7 @@ def check_mcms_dept_buy(type=16): ...@@ -217,7 +218,7 @@ def check_mcms_dept_buy(type=16):
pkgDefId = commonFuc().analysis_json('pkgDefId', list_a) pkgDefId = commonFuc().analysis_json('pkgDefId', list_a)
pkgDefName = commonFuc().analysis_json('pkgDefName', list_a) pkgDefName = commonFuc().analysis_json('pkgDefName', list_a)
# 获取边仓id # 获取边仓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) 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( 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;" % ( "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): ...@@ -305,7 +306,7 @@ def check_mcms_dept_buy_approval_after(type=16):
# area_code = get_stockAreaId_new(deptid2, deptname2, 2) # area_code = get_stockAreaId_new(deptid2, deptname2, 2)
info = FileUtils().r_info8("b5_spd3_core_business_flow", "库区信息", 'message22') info = FileUtils().r_info8("b5_spd3_core_business_flow", "库区信息", 'message22')
list_a = info['list_a'] list_a = info['list_a']
area_code = commonFuc().analysis_json('shelfCode', list_a) area_code = get_stockAreaId_new_fromDb(deptname2, 2)
area_name = '默认库区' area_name = '默认库区'
# 读取文件中的信息 # 读取文件中的信息
info = FileUtils().r_info8('b5_spd3_core_business_flow', "二级库请领产品信息", 'message21') info = FileUtils().r_info8('b5_spd3_core_business_flow', "二级库请领产品信息", 'message21')
...@@ -495,6 +496,7 @@ def main(): ...@@ -495,6 +496,7 @@ def main():
# # # 试剂 # # # 试剂
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_car(3) check_mcms_dept_buy_car(3)
time.sleep(8)
BuyCarSubmit() # 请领车提交 BuyCarSubmit() # 请领车提交
time.sleep(8) time.sleep(8)
# 调用函数对数据库中的数据进行验证和比对 # 调用函数对数据库中的数据进行验证和比对
......
...@@ -218,7 +218,7 @@ def check_mcms_dept_buy(type=16): ...@@ -218,7 +218,7 @@ def check_mcms_dept_buy(type=16):
# area_code = get_stockAreaId_new(deptid2, deptname2, 2) # area_code = get_stockAreaId_new(deptid2, deptname2, 2)
info = FileUtils().r_info8("b5_spd3_core_business_flow", "库区信息", 'message22') info = FileUtils().r_info8("b5_spd3_core_business_flow", "库区信息", 'message22')
list_a = info['list_a'] list_a = info['list_a']
area_code = commonFuc().analysis_json('shelfCode', list_a) area_code = get_stockAreaId_new_fromDb(deptname2, 2)
area_name = '默认库区' area_name = '默认库区'
# 读取文件中的信息 # 读取文件中的信息
info = FileUtils().r_info8('b5_spd3_core_business_flow', "二级库请领产品信息", 'message21') info = FileUtils().r_info8('b5_spd3_core_business_flow', "二级库请领产品信息", 'message21')
...@@ -321,7 +321,7 @@ def check_mcms_dept_buy_approval_after(type=16): ...@@ -321,7 +321,7 @@ def check_mcms_dept_buy_approval_after(type=16):
# area_code = get_stockAreaId_new(deptid2, deptname2, 2) # area_code = get_stockAreaId_new(deptid2, deptname2, 2)
info = FileUtils().r_info8("b5_spd3_core_business_flow", "库区信息", 'message22') info = FileUtils().r_info8("b5_spd3_core_business_flow", "库区信息", 'message22')
list_a = info['list_a'] list_a = info['list_a']
area_code = commonFuc().analysis_json('shelfCode', list_a) area_code =get_stockAreaId_new_fromDb(deptname2, 2)
area_name = '默认库区' area_name = '默认库区'
# 读取文件中的信息 # 读取文件中的信息
info = FileUtils().r_info8('b5_spd3_core_business_flow', "二级库请领产品信息", 'message21') info = FileUtils().r_info8('b5_spd3_core_business_flow', "二级库请领产品信息", 'message21')
...@@ -522,7 +522,7 @@ def check_mcms_mcms_pur_plan(type=16): ...@@ -522,7 +522,7 @@ def check_mcms_mcms_pur_plan(type=16):
rec_org_name = dept_name2 rec_org_name = dept_name2
info = FileUtils().r_info8("b5_spd3_core_business_flow", "库区信息", 'message22') info = FileUtils().r_info8("b5_spd3_core_business_flow", "库区信息", 'message22')
list_a = info['list_a'] 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;" % ( 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) branch_id, id1)
area_name = process_tuple(get_id(sql1)) area_name = process_tuple(get_id(sql1))
...@@ -778,7 +778,7 @@ def check_mcms_purchase(type=16): ...@@ -778,7 +778,7 @@ def check_mcms_purchase(type=16):
rec_org_name = dept_name2 rec_org_name = dept_name2
info = FileUtils().r_info8("b5_spd3_core_business_flow", "库区信息", 'message22') info = FileUtils().r_info8("b5_spd3_core_business_flow", "库区信息", 'message22')
list_a = info['list_a'] 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;" % ( sql1 = "select area_name from mcms_purchase where branch_id='%s' and id='%s' order by create_time desc LIMIT 1;" % (
branch_id, id1) branch_id, id1)
area_name = process_tuple(get_id(sql1)) area_name = process_tuple(get_id(sql1))
...@@ -2287,6 +2287,7 @@ def check_mcms_hos_batch(type=1): # 检查批次表信息 ...@@ -2287,6 +2287,7 @@ def check_mcms_hos_batch(type=1): # 检查批次表信息
stock_id = get_stockId_fromdb(stock_name) 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 = get_id("select src_batch_id from mcms_hos_batch where id='%s';" % id)
src_batch_id = id src_batch_id = id
hos_goods_id='hos_goods_id'
if type == 1: if type == 1:
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"] hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"]
elif type == 2: elif type == 2:
...@@ -2350,7 +2351,8 @@ def check_mcms_hos_batch(type=1): # 检查批次表信息 ...@@ -2350,7 +2351,8 @@ def check_mcms_hos_batch(type=1): # 检查批次表信息
goodsName, erpCode, create_user, create_time goodsName, erpCode, create_user, create_time
, last_modified, last_modified_user) , last_modified, last_modified_user)
else: 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', expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', 'check_mcms_hos_batch3',
id, id,
hos_id, branch_id, stock_id, src_batch_id, hos_goods_id, hos_id, branch_id, stock_id, src_batch_id, hos_goods_id,
...@@ -2358,7 +2360,7 @@ def check_mcms_hos_batch(type=1): # 检查批次表信息 ...@@ -2358,7 +2360,7 @@ def check_mcms_hos_batch(type=1): # 检查批次表信息
, mfrs_id, supply_id, prov_id, prov_name, sub_prov_id, , mfrs_id, supply_id, prov_id, prov_name, sub_prov_id,
sub_prov_name, expdt_date, product_date sub_prov_name, expdt_date, product_date
, distr_id, distr_detail_id, purBillId, in_time, goodsGg, goodsCode, , 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) , last_modified, last_modified_user)
# 对比预期值和实际值是否一致 # 对比预期值和实际值是否一致
actual_value1 = get_process_list2(actual) actual_value1 = get_process_list2(actual)
...@@ -2477,7 +2479,7 @@ def main(): ...@@ -2477,7 +2479,7 @@ def main():
second_dept_one_key_in() second_dept_one_key_in()
second_dept_one_key_in() 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(16)
check_mcms_psi_dept_in(20) check_mcms_psi_dept_in(20)
......
...@@ -352,6 +352,7 @@ def check_mcms_psi_dept_batch(DR_ID,type,order_no): ...@@ -352,6 +352,7 @@ def check_mcms_psi_dept_batch(DR_ID,type,order_no):
) )
else: else:
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', 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 '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, ,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): ...@@ -396,7 +397,7 @@ def check_mcms_psi_dept(type=16):
info = FileUtils().r_info8('b5_spd3_core_business_flow', "拣货单高值id", 'message26') info = FileUtils().r_info8('b5_spd3_core_business_flow', "拣货单高值id", 'message26')
DR_ID = info['DR_NO1高值'] DR_ID = info['DR_NO1高值']
else: 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 = info['DR_NO1试剂']
DR_ID = ''.join(DR_ID) DR_ID = ''.join(DR_ID)
sql = "select order_no from mcms_psi_dept where id='%s';" % 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): ...@@ -732,13 +733,16 @@ def check_mcms_psi_dept_in(type=16):
branch_id, type) branch_id, type)
actual = check_mcms_dept_buy_sql(sql) actual = check_mcms_dept_buy_sql(sql)
print(actual) 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: 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: 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: 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_id = ''.join(source_id)
source_no=get_id("select order_no from mcms_psi_dept where id='%s';"%source_id) source_no=get_id("select order_no from mcms_psi_dept where id='%s';"%source_id)
#获取入库单主键DR_ID #获取入库单主键DR_ID
...@@ -899,11 +903,13 @@ def main(): ...@@ -899,11 +903,13 @@ def main():
# # 二级科室领用出库 # # 二级科室领用出库
# # 低值拣货执行 # # 低值拣货执行
pick_execute() pick_execute()
time.sleep(8)
# 检查拣货单 # 检查拣货单
list_data = ['16', '20', '66'] list_data = ['16', '20', '66']
for i in list_data: for i in list_data:
check_mcms_pick(int(i)) check_mcms_pick(int(i))
time.sleep(8)
# 检查出库单 # 检查出库单
check_mcms_psi_dept(16) check_mcms_psi_dept(16)
check_mcms_psi_dept(20) check_mcms_psi_dept(20)
...@@ -911,6 +917,7 @@ def main(): ...@@ -911,6 +917,7 @@ def main():
second_dept_one_key_in(5) second_dept_one_key_in(5)
second_dept_one_key_in(5) 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) check_mcms_psi_dept_in(16)
......
...@@ -80,6 +80,7 @@ def check_mcms_dept_buy_car(type=1): ...@@ -80,6 +80,7 @@ def check_mcms_dept_buy_car(type=1):
goodsCode, goodsCode,
create_user, create_time, last_modified, last_modified_user) create_user, create_time, last_modified, last_modified_user)
else: else:
# mdm_goods_code="null"
expected_value2 = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', expected_value2 = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'check_mcms_dept_buy_car3', id, get_hosid(), branch_id, 'check_mcms_dept_buy_car3', id, get_hosid(), branch_id,
deptid3, deptid3,
......
...@@ -136,7 +136,7 @@ def check_mcms_psi_dept_in(type=10): ...@@ -136,7 +136,7 @@ def check_mcms_psi_dept_in(type=10):
def check_mcms_psi_dept_batch_in(DR_ID1,DR_ID,type): def check_mcms_psi_dept_batch_in(DR_ID1,DR_ID,type):
branch_id = get_branch_id() branch_id = get_branch_id()
if type==67: 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) DR_ID1)
count=process_tuple(get_id("select count(*) from mcms_psi_dept_batch where pid='%s'"%DR_ID1)) count=process_tuple(get_id("select count(*) from mcms_psi_dept_batch where pid='%s'"%DR_ID1))
if count=='100': if count=='100':
...@@ -145,7 +145,7 @@ def check_mcms_psi_dept_batch_in(DR_ID1,DR_ID,type): ...@@ -145,7 +145,7 @@ def check_mcms_psi_dept_batch_in(DR_ID1,DR_ID,type):
else: else:
commonFuc().check_text_exist_result_text('error', 'SUCCESS') commonFuc().check_text_exist_result_text('error', 'SUCCESS')
else: else:
sql = " select * from mcms_psi_dept_batch where pid='%s';" % ( sql = "select * from mcms_psi_dept_batch where pid='%s';" % (
DR_ID1) DR_ID1)
actual = check_mcms_dept_buy_sql(sql) actual = check_mcms_dept_buy_sql(sql)
print('actual', actual) print('actual', actual)
...@@ -851,7 +851,7 @@ def check_mcms_psi_dept_XH_CK(type1=10,type2=16): ...@@ -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) check_mcms_psi_dept_batch_xhrk(DR_ID1,source_id,type2,order_no1)
source_id="-" source_id="-"
source_area_code=None 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', 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, 'mcms_psi_dept_out_xhrk1', DR_ID1, order_no1, target_corp_id, target_branch_id,
target_dept_id, target_dept_name, target_stock_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): ...@@ -867,7 +867,7 @@ def check_mcms_psi_dept_XH_CK(type1=10,type2=16):
source_id = "-" source_id = "-"
source_area_code = None source_area_code = None
his_charge_no = get_id( 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)) branch_id, DR_ID1))
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'mcms_psi_dept_out_xhrk2', DR_ID1, order_no1, target_corp_id, '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 ...@@ -920,17 +920,25 @@ from a_b7流程十四退库业务_消耗退库 import sCan_grant,second_dept_con
try: try:
updateUserLoginDefaultRange(get_listUserMgrRangePage1(2)) # 设置登录账号默认权限是二级库 updateUserLoginDefaultRange(get_listUserMgrRangePage1(2)) # 设置登录账号默认权限是二级库
sCan_grant(1) # 低值扫码发放 sCan_grant(1) # 低值扫码发放
time.sleep(8)
check_mcms_psi_dept_out_and_in(16,10)#检查出库单和入库单(包括主表和子表) check_mcms_psi_dept_out_and_in(16,10)#检查出库单和入库单(包括主表和子表)
sCan_grant(3) # 试剂扫码发放 sCan_grant(3) # 试剂扫码发放
time.sleep(8)
check_mcms_psi_dept_out_and_in(66,67)#检查出库单和入库单(包括主表和子表) check_mcms_psi_dept_out_and_in(66,67)#检查出库单和入库单(包括主表和子表)
second_dept_consume_Out_Stock(2) # 高值消耗出库 second_dept_consume_Out_Stock(2) # 高值消耗出库
time.sleep(8)
second_dept_consume_in_Stock(2) # 高值消耗退货入库 second_dept_consume_in_Stock(2) # 高值消耗退货入库
time.sleep(8)
check_mcms_psi_dept_out_and_in(20, 20) #检查高值消耗出库单和消耗入库单包括主表和子表) check_mcms_psi_dept_out_and_in(20, 20) #检查高值消耗出库单和消耗入库单包括主表和子表)
second_dept_consume_Out_Stock(1) # 低值消耗出库 second_dept_consume_Out_Stock(1) # 低值消耗出库
time.sleep(8)
second_dept_consume_in_Stock(1) # 低值消耗退回入库 second_dept_consume_in_Stock(1) # 低值消耗退回入库
time.sleep(8)
check_mcms_psi_dept_XH_CK(10,10)#检查低值消耗出库单和消耗入库单包括主表和子表 check_mcms_psi_dept_XH_CK(10,10)#检查低值消耗出库单和消耗入库单包括主表和子表
second_dept_consume_Out_Stock(3) # 试剂消耗出库 second_dept_consume_Out_Stock(3) # 试剂消耗出库
time.sleep(8)
second_dept_consume_in_Stock(3) # 试剂消耗退回入库 second_dept_consume_in_Stock(3) # 试剂消耗退回入库
time.sleep(8)
check_mcms_psi_dept_XH_CK(67, 67)#检查试剂消耗出库单和消耗入库单包括主表和子表 check_mcms_psi_dept_XH_CK(67, 67)#检查试剂消耗出库单和消耗入库单包括主表和子表
commonFuc().check_text_exist_result_text('SUCCESS', 'SUCCESS') commonFuc().check_text_exist_result_text('SUCCESS', 'SUCCESS')
except Exception as e: except Exception as e:
......
...@@ -331,7 +331,6 @@ def check_mcms_psi_dept_in(type1=16): ...@@ -331,7 +331,6 @@ def check_mcms_psi_dept_in(type1=16):
if type1 == 16: if type1 == 16:
# 子表检查 # 子表检查
check_mcms_psi_dept_batch_in(DR_ID,type1,order_no) check_mcms_psi_dept_batch_in(DR_ID,type1,order_no)
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', 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, 'mcms_psi_dept_tkrk1', DR_ID, order_no, target_corp_id, target_branch_id,
target_dept_id, target_dept_name, target_stock_id target_dept_id, target_dept_name, target_stock_id
...@@ -344,7 +343,6 @@ def check_mcms_psi_dept_in(type1=16): ...@@ -344,7 +343,6 @@ def check_mcms_psi_dept_in(type1=16):
elif type1 == 20: elif type1 == 20:
# 子表检查 # 子表检查
check_mcms_psi_dept_batch_in(DR_ID,type1,order_no) check_mcms_psi_dept_batch_in(DR_ID,type1,order_no)
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', 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, 'mcms_psi_dept_tkrk2', DR_ID, order_no, target_corp_id, target_branch_id,
target_dept_id, target_dept_name, target_stock_id target_dept_id, target_dept_name, target_stock_id
...@@ -352,7 +350,6 @@ def check_mcms_psi_dept_in(type1=16): ...@@ -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, source_dept_id, source_dept_name, source_stock_id, source_area_code,accounter,account_date,
pickOrderNo, pickBillId, psiDeptOutBillId, psiDeptOutOrderNo,psiDeptInBillId,psiDeptInOrderNo pickOrderNo, pickBillId, psiDeptOutBillId, psiDeptOutOrderNo,psiDeptInBillId,psiDeptInOrderNo
, create_user, create_time, last_modified, last_modified_user , create_user, create_time, last_modified, last_modified_user
) )
else: else:
# 子表检查 # 子表检查
...@@ -364,7 +361,6 @@ def check_mcms_psi_dept_in(type1=16): ...@@ -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, source_dept_id, source_dept_name, source_stock_id, source_area_code,accounter,account_date,
pickOrderNo, pickBillId, psiDeptOutBillId, psiDeptOutOrderNo,psiDeptInBillId,psiDeptInOrderNo pickOrderNo, pickBillId, psiDeptOutBillId, psiDeptOutOrderNo,psiDeptInBillId,psiDeptInOrderNo
, create_user, create_time, last_modified, last_modified_user , create_user, create_time, last_modified, last_modified_user
) )
print('expected', expected) print('expected', expected)
print('aaaaaaaaaaaaaaaaa') print('aaaaaaaaaaaaaaaaa')
......
...@@ -5,6 +5,10 @@ import traceback ...@@ -5,6 +5,10 @@ import traceback
from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_system from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_system
from air_case.public1.public1.public1 import * from air_case.public1.public1.public1 import *
from common.db.sql.sql_del_branch_info import delData from common.db.sql.sql_del_branch_info import delData
from common.db.sql.sql_tools import check_mcms_dept_buy_sql, get_PICK_id, get_buyBillId, get_PICK_order_no, \
get_buyOrderNo, get_login_user_uxid_bydb, get_create_time, get_pick_detail_id, get_mdm_goods_code1, get_goods_code1, \
get_pkg_def_id, check_batch_id, check_barcode_id, check_mcms_pur_plan_sql, get_distrBillId, get_planBillId, \
get_planOrderNo, get_purOrderNo, get_purBillId, get_purBillDate2, get_distrOrderNo, get_DRID
from common.fileUtls import FileUtils from common.fileUtls import FileUtils
from common.run_cmd_script import execute_command from common.run_cmd_script import execute_command
...@@ -19,557 +23,455 @@ case_tag:api,b6_spd3_core_business_flow_database_check,a_b9流程十六退库业 ...@@ -19,557 +23,455 @@ case_tag:api,b6_spd3_core_business_flow_database_check,a_b9流程十六退库业
python runner_test.py tag id2303-19 debug mdm3 python runner_test.py tag id2303-19 debug mdm3
""" """
# 入库上架
def putaway():
module = "b5_spd3_core_business_flow"
updateUserLoginDefaultRange(get_listUserMgrRangePage1(1)) # 设置登录账号默认权限是一级库
# # 登录获取用户id等信息,使用创建的用户登录===========开始
info = FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3')
# print(info)
username = info['username1']
password = commonFuc().get_business_data("b2_herp3_bs", "password") def check_mcms_psi_dept_out(type1=16):
# username = '001f90380' branch_id = get_branch_id()
# password='1qaz!QAZ'
print('username,password', username, password)
# # print(username, password,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
# # 获取token和projectCode
token, projectCode, uxid, corpId, info = login_system(username, password).get_token()
# 登录获取用户id等信息,使用创建的用户登录============结束
# =====================上架入库列表查询==========================
headers = commonFuc().get_business_data(module, "json_headers2",
commonFuc().get_business_data(module, "json_contentType"), token,
projectCode)
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module, "stock_in_page_url")
print(url)
branch_id = FileUtils().r_info('b2_herp3_bs', '院区新增')["branch_id"]
hosId = branch_id[0:5]
request_body = commonFuc().get_business_data(module, "payload6", branch_id, hosId)
result = commonFuc().http_post(url, request_body, headers)
print('result', result)
data = commonFuc().analysis_json('data', result)
total = commonFuc().analysis_json('total', data)
if total >= 1:
# 将上架入库列表数据写入文件
data = commonFuc().analysis_json('data', result)
data1 = commonFuc().analysis_json('data', data)
list_a = []
list_b = []
list_c = []
list_a.append(data1)
list_b.append(data1)
list_c.append(data1)
# print('list_a', len(list_a), list_a)
info = (list_a, list_b, list_c)
titlename = ('list_a', 'list_b', 'list_c')
# 将验收单详细信息写入到文件中
FileUtils().w_info8(info, 'b5_spd3_core_business_flow', '上架入库列表数据', titlename, 'message16')
# =====================上架入库列表查询==========================
# =============查看验收单详情========================
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module, "stock_detail_url")
print('查看验收单详情',url)
deptid1 = FileUtils().r_info8('b2_herp3_bs', '所有科室id', 'message6')["deptid1"]
areaCode = FileUtils().r_info8('b2_herp3_bs', 'shelfinfo', 'message7')["shelfCode"]
branch_id = FileUtils().r_info('b2_herp3_bs', '院区新增')["branch_id"]
hosId = branch_id[0:5]
# 从message16文件中获取信息
info = FileUtils().r_info8('b5_spd3_core_business_flow', "上架入库列表数据", 'message16')
list_a = info['list_a']
print('list_a', list_a)
sourceId = 'sourceId'
sourceType='sourceType'
for i in list_a:
for j in i:
sourceId = j['sourceId']
sourceType = j["sourceType"]
break
request_body = commonFuc().get_business_data(module, "payload4_1", deptid1, areaCode, hosId, sourceId, sourceType)
print('request_body', 'd', request_body)
result = commonFuc().http_post(url, request_body, headers)
print('result', result)
targetDeptId =commonFuc().analysis_json('targetDeptId',commonFuc().analysis_json('data',result))
# 将验收单详情写入文件
data = commonFuc().analysis_json('data', result)
list_a = []
list_b = []
list_c = []
list_a.append(data)
list_b.append(data)
list_c.append(data)
# print('list_a', len(list_a), list_a)
info = (list_a, list_b, list_c)
titlename = ('list_a', 'list_b', 'list_c')
# 将验收单详细信息写入到文件中
FileUtils().w_info8(info, 'b5_spd3_core_business_flow', '验收单库存详情信息', titlename, 'message17')
time.sleep(6)
# ============= # =============查看验收单详情================================================
# ================================入库上架===================
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module, "stock_detail_submit_url")
print(url)
viewId = 'viewId'
shelfCode = 'shelfCode'
sourceId = 'sourceId'
sourceVersion = '1'
targetDeptId = deptid1
targetDeptName = FileUtils().r_info8('b2_herp3_bs', '所有科室name', 'message6')["deptid1"]
targetAreaCode = FileUtils().r_info8('b2_herp3_bs', 'shelfinfo', 'message7')["shelfCode"]
targetAreaName = FileUtils().r_info8('b2_herp3_bs', 'shelfinfo', 'message7')["areaName"]
# 从message17文件中获取信息
info = FileUtils().r_info8('b5_spd3_core_business_flow', "验收单库存详情信息", 'message17')
# print('info', info)
list_a = info['list_a']
print('list_a', list_a)
for i in list_a:
print('i', i)
for j in i:
viewId = j["viewId"]
shelfCode = j['shelfCode']
sourceId = j['pid']
break
# # 从message16文件中获取信息
# info = FileUtils().r_info8('b5_spd3_core_business_flow', "上架入库列表数据", 'message16')
# list_a = info['list_a']
# print('list_a', list_a)
# for i in list_a:
# for j in i:
# sourceId = j['sourceId']
# targetAreaName = j['areaName']
# targetAreaCode = j['areaCode']
# break
request_body = commonFuc().get_business_data(module, "payload5", viewId, shelfCode, sourceId, sourceType,
sourceVersion, targetDeptId,
targetDeptName, targetAreaCode, targetAreaName)
print('request_body', request_body)
time.sleep(3)
result = commonFuc().http_post(url, request_body, headers)
print('result', result)
# ================================入库上架================================
sql = " select * from mcms_psi_dept where target_branch_id='%s' and bill_mode='%s' and stock_kind='CK_TK' order by CREATE_TIME desc LIMIT 1;" % (
branch_id, type1)
actual = check_mcms_dept_buy_sql(sql)
print(actual)
DR_ID = get_id(
" select id from mcms_psi_dept where target_branch_id='%s' and bill_mode='%s' and stock_kind='CK_TK' order by CREATE_TIME desc LIMIT 1;" % (
branch_id, type1))
sql = "select order_no from mcms_psi_dept where id='%s';" % DR_ID
order_no = get_id(sql)
target_corp_id = get_hosid()
target_branch_id = get_branch_id()
target_dept_id = FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid1']
target_dept_name = FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid1']
target_stock_id = get_stockId_fromdb(get_branch_name() + '中心库房')
target_area_code = get_stockAreaId_new_fromDb(target_dept_name, 1)
PICK_id = get_PICK_id(branch_id, type1)
source_id = PICK_id
source_corp_id = get_hosid()
source_branch_id = get_branch_id()
source_dept_id = FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid2']
source_dept_name = FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid2']
source_stock_id = get_stockId_fromdb(source_dept_name + '库房')
source_area_code = get_stockAreaId_new_fromDb(source_dept_name, 2)
buyBillId = get_buyBillId(branch_id, type1)
pickOrderNo = get_PICK_order_no(branch_id, type1)
buyOrderNo = get_buyOrderNo(branch_id, type1)
pickBillId = get_PICK_id(branch_id, type1)
psiDeptOutBillId = DR_ID
psiDeptOutOrderNo = order_no
create_user = get_login_user_uxid_bydb(FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3')['username1'])
create_time = get_create_time("select create_time from mcms_psi_dept where id='%s';" % DR_ID)
last_modified = get_create_time("select last_modified from mcms_psi_dept where id='%s';" % DR_ID)
last_modified_user = create_user
accounter = create_user
account_date = process_tuple(get_create_time("select account_date from mcms_psi_dept where id='%s';" % DR_ID))
if type1 == 16:
# 子表检查
check_mcms_psi_dept_batch(DR_ID, type1, order_no)
target_area_code = None
accounter = None
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'mcms_psi_dept_tkck1_1', DR_ID, order_no, target_corp_id,
target_branch_id,
target_dept_id, target_dept_name, target_stock_id
, target_area_code, source_id, source_corp_id, source_branch_id,
source_dept_id, source_dept_name, source_stock_id, source_area_code,
accounter, account_date,
pickOrderNo, pickBillId, psiDeptOutBillId, psiDeptOutOrderNo
, create_user, create_time, last_modified, last_modified_user
)
elif type1 == 20:
# 子表检查
check_mcms_psi_dept_batch(DR_ID, type1, order_no)
target_area_code = None
accounter = None
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'mcms_psi_dept_tkck1_2', DR_ID, order_no, target_corp_id,
target_branch_id,
target_dept_id, target_dept_name, target_stock_id
, target_area_code, source_id, source_corp_id, source_branch_id,
source_dept_id, source_dept_name, source_stock_id, source_area_code,
accounter, account_date,
pickOrderNo, pickBillId, psiDeptOutBillId, psiDeptOutOrderNo
, create_user, create_time, last_modified, last_modified_user)
else:
# 子表检查
check_mcms_psi_dept_batch(DR_ID, type1, order_no)
target_area_code = None
accounter = None
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'mcms_psi_dept_tkck1_3', DR_ID, order_no, target_corp_id,
target_branch_id,
target_dept_id, target_dept_name, target_stock_id
, target_area_code, source_id, source_corp_id, source_branch_id,
source_dept_id, source_dept_name, source_stock_id, source_area_code,
accounter, account_date,
pickOrderNo, pickBillId, psiDeptOutBillId, psiDeptOutOrderNo
, create_user, create_time, last_modified, last_modified_user
def second_dept_return_Out_Stock(type): # 二级库退库出库 )
module = "b5_spd3_core_business_flow" print('expected', expected)
# # 登录获取用户id等信息,使用创建的用户登录===========开始 print('aaaaaaaaaaaaaaaaa')
info = FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3') actual_value1 = get_process_list2(actual)
username = info['username1'] expected_value1 = get_process_list2(expected)
password = commonFuc().get_business_data("b2_herp3_bs", "password") actual_value2 = actual_value1.replace(" ", "")
print('username,password', username, password) expected_value2 = expected_value1.replace(" ", "")
# # 获取token和projectCode # print('actual_value2',actual_value2)
token, projectCode, uxid, corpId, info = login(username, password, 2) print('expected_value2')
# 登录获取用户id等信息,使用创建的用户登录============结束 print(expected_value2)
# 我要请领_手工请领_列表查询=========================== print('actual_value2')
headers = commonFuc().get_business_data(module, "json_headers2", print(actual_value2)
commonFuc().get_business_data(module, "json_contentType"), token, print(compare_text_index(actual_value2, expected_value2))
commonFuc().get_business_data(module, "X-APP-CODE")) 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')
if type == 2:
udi_code = get_udi2(2,token) # 获取条码 低值1 高值2 试剂3
# 高值退库出库 def check_mcms_psi_dept_batch(DR_ID, type, order_no):
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module, branch_id = get_branch_id()
"herpService_stock_pick_scan_url") sql = " select * from mcms_psi_dept_batch where pid='%s';" % (
# 从message18文件中获取信息 DR_ID)
info = FileUtils().r_info8(module, "条码信息", 'message18') actual = check_mcms_dept_buy_sql(sql)
# print('info', info) print('actual', actual)
list_a = info['list_a'] batch_main_key = get_id("select id from mcms_psi_dept_batch where pid='%s';" % DR_ID)
stockId = commonFuc().analysis_json('stockId', list_a) pid = DR_ID
stockName = commonFuc().analysis_json('stockName', list_a) # order_no = get_id("select order_no from mcms_psi_dept_batch where pid='%s';" % DR_ID)
areaCode = commonFuc().analysis_json('areaCode', list_a) source_detail_id = get_pick_detail_id(branch_id, type)
areaName = commonFuc().analysis_json('areaName', list_a) pick_detail_id = source_detail_id
deptId2= FileUtils().r_info8('b2_herp3_bs', '所有科室id', 'message6')["deptid2"]
targetDeptId= FileUtils().r_info8('b2_herp3_bs', '所有科室id', 'message6')["deptid1"]
deptName = get_branch_name()
targetStockId =get_stockId(deptName+'中心库房',1)
request_body = commonFuc().get_business_data(module, "payload65", udi_code, stockId, deptId2,areaCode, areaName, if type == 16:
targetStockId,targetDeptId) hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"]
print('request_body',request_body) elif type == 20:
result = commonFuc().http_post(url, request_body, headers) hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message1')["hosGoodsId"]
print('退库出库扫码result',result) else:
# 获取必要信息 hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message3')["hosGoodsId"]
deptid2 = FileUtils().r_info8('b2_herp3_bs', '所有科室id', 'message6')["deptid2"] mdm_goods_code = get_mdm_goods_code1(hos_goods_id)
goods_code = get_goods_code1(hos_goods_id)
pkg_def_id = get_pkg_def_id(hos_goods_id)
picker_name = FileUtils().r_info8("b2_herp3_bs", "用户名信息", 'message3')['username1']
picker = get_login_user_uxid_bydb(picker_name)
source_batch_id = get_id("select source_batch_id from mcms_psi_dept_batch where pid='%s';" % DR_ID)
target_batch_id = source_batch_id
if check_batch_id(source_batch_id) == True:
print('ok')
commonFuc().check_text_exist_result_text('succees', 'succees')
else:
commonFuc().check_text_exist_result_text('error', 'succees')
barcode_id = get_id("select barcode_id from mcms_psi_dept_batch where pid='%s';" % DR_ID)
if check_barcode_id(barcode_id) == True:
print('ok')
commonFuc().check_text_exist_result_text('succees', 'succees')
else:
commonFuc().check_text_exist_result_text('error', 'succees')
dept_name = FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid2']
shelf_code = get_stockAreaId_new_fromDb(dept_name, 2)
create_user = get_login_user_uxid_bydb(FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3')['username1'])
create_time = get_create_time("select create_time from mcms_psi_dept_batch where pid='%s';" % DR_ID)
last_modified = get_create_time("select last_modified from mcms_psi_dept_batch where pid='%s';" % DR_ID)
last_modified_user = create_user
if type == 16:
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'mcms_psi_dept_batch1', batch_main_key, pid, order_no, source_detail_id
, pick_detail_id, hos_goods_id, mdm_goods_code, goods_code,
source_batch_id,
target_batch_id, barcode_id, shelf_code, create_user, create_time,
last_modified,
last_modified_user)
elif type == 20:
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'mcms_psi_dept_batch2', batch_main_key, pid, order_no, source_detail_id
, pick_detail_id, hos_goods_id, mdm_goods_code, goods_code,
source_batch_id,
target_batch_id, barcode_id, shelf_code, create_user, create_time,
last_modified,
last_modified_user)
else:
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'mcms_psi_dept_batch3_1', batch_main_key, pid, order_no,
source_detail_id
, pick_detail_id, hos_goods_id, mdm_goods_code, goods_code,
source_batch_id,
target_batch_id, barcode_id, shelf_code, create_user, create_time,
last_modified,
last_modified_user)
data1 = commonFuc().analysis_json('data', result) print('expected', expected)
areaCode = commonFuc().analysis_json('areaCode', data1) print('aaaaaaaaaaaaaaaaa')
UTid = commonFuc().analysis_json('id', data1) actual_value1 = get_process_list2(actual)
createTime = commonFuc().analysis_json('id', data1) expected_value1 = get_process_list2(expected)
stockId = commonFuc().analysis_json('stockId', data1) actual_value2 = actual_value1.replace(" ", "")
areaCode = commonFuc().analysis_json('areaCode', data1) expected_value2 = expected_value1.replace(" ", "")
areaName = commonFuc().analysis_json('areaName', data1) # print('actual_value2',actual_value2)
shelfCode = commonFuc().analysis_json('shelfCode', data1) print('expected_value2')
codeType = commonFuc().analysis_json('codeType', data1) print(expected_value2)
tagType = commonFuc().analysis_json('tagType', data1) print('actual_value2')
hosGoodsId = commonFuc().analysis_json('hosGoodsId', data1) print(actual_value2)
mdmGoodsCode = commonFuc().analysis_json('mdmGoodsCode', data1) print(compare_text_index(actual_value2, expected_value2))
goodsCode = commonFuc().analysis_json('goodsCode', data1) if actual_value2 == expected_value2:
goodsDi = commonFuc().analysis_json('goodsDi', data1) print('ok')
barName = commonFuc().analysis_json('barName', data1) commonFuc().check_text_exist_result_text('succees', 'succees')
batchCode = commonFuc().analysis_json('batchCode', data1) else:
expdtDate = commonFuc().analysis_json('expdtDate', data1) print('error')
productDate = commonFuc().analysis_json('productDate', data1) commonFuc().check_text_exist_result_text('error', 'succees')
pkgCode = commonFuc().analysis_json('pkgCode', data1)
pkgCodeSee = commonFuc().analysis_json('pkgCodeSee', data1)
ssccCode = commonFuc().analysis_json('ssccCode', data1)
tbStatus = commonFuc().analysis_json('tbStatus', data1)
ext = commonFuc().analysis_json('ext', data1)
distrDetailId = commonFuc().analysis_json('distrDetailId', ext)
distrBillId = commonFuc().analysis_json('distrBillId', ext)
purBillId = commonFuc().analysis_json('purBillId', ext)
pkgDefQty = commonFuc().analysis_json('pkgDefQty', ext)
pkgDefId = commonFuc().analysis_json('pkgDefId', ext)
pkgDefName = commonFuc().analysis_json('pkgDefName', ext)
purMode = commonFuc().analysis_json('purMode', data1)
goodsMfrsName = commonFuc().analysis_json('goodsMfrsName', data1)
goodsSpec = commonFuc().analysis_json('goodsSpec', data1)
unit = commonFuc().analysis_json('unit', data1)
goodsName = commonFuc().analysis_json('goodsName', data1)
pkgDefId = commonFuc().analysis_json('pkgDefId', data1)
# pkgDefQty=commonFuc().analysis_json('pkgDefQty',data1)
pkgDefName = commonFuc().analysis_json('pkgDefName', data1)
printNum = commonFuc().analysis_json('printNum', data1)
made = commonFuc().analysis_json('made', data1)
hosGoodsCode = commonFuc().analysis_json('hosGoodsCode', data1)
sourceId = commonFuc().analysis_json('sourceId', data1)
price = commonFuc().analysis_json('price', data1)
purModeText = commonFuc().analysis_json('purModeText', data1)
version = commonFuc().analysis_json('version', data1)
unitName = commonFuc().analysis_json('unitName', data1)
# ==============================获取条码信息
# 从message18文件中获取信息
info = FileUtils().r_info8(module, "条码信息", 'message18')
# print('info', info)
list_a = info['list_a']
extInfo = commonFuc().analysis_json('extInfo', list_a)
print('extInfo', extInfo)
# inStockTime = commonFuc().analysis_json('inStockTime', extInfo)
inStockTime = reGetString(extInfo, r'inStockTime": "', r'", "')
print('inStockTime', inStockTime)
# import pdb
# pdb.set_trace()
# 从message18文件中获取信息
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module,
"dept_stock_out_submit_url")
deptid1 = FileUtils().r_info8('b2_herp3_bs', '所有科室id', 'message6')["deptid1"] def check_mcms_psi_in(type=1):
deptName2 = FileUtils().r_info8('b2_herp3_bs', '所有科室name', 'message6')["deptid2"] print('检查中心库入库单')
stockName2 = deptName2 + "库房" if type == 1:
createTime = timeUtils().get_time_hms(1) bill_mode = 16
request_body = "request_body" elif type == 2:
mgrCorpName = get_hosname() bill_mode = 20
mgrRangeId = deptid2 else:
mgrRangeName = deptName2 bill_mode = 66
extStr1 = get_branch_name() branch_id = get_branch_id()
extStr3 = get_branch_name() sql = "select * from mcms_psi where target_branch_id='%s' and bill_mode='%s' and stock_kind='RK_TK' order by CREATE_TIME desc LIMIT 1;" % (
snCode = UTid branch_id, bill_mode)
userLoginCode = username # 获取实际值
cname = username actual = check_mcms_pur_plan_sql(sql)
orgCode1 = get_orgCode() print('actual', actual)
orgName1 = get_orgName() sql = "select id from mcms_psi where target_branch_id='%s' and bill_mode='%s' and stock_kind='RK_TK' order by CREATE_TIME desc LIMIT 1;" % (
# print(orgCode1, orgName1) branch_id, bill_mode)
# import pdb id = get_id(sql)
# pdb.set_trace() sql = "select order_no from mcms_psi where target_branch_id='%s' and bill_mode='%s' and stock_kind='RK_TK' order by CREATE_TIME desc LIMIT 1;" % (
branch_id, bill_mode)
order_no = get_id(sql)
target_corp_id = get_hosid()
target_branch_id = get_branch_id()
target_dept_id = FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid1']
target_dept_name = FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid1']
stock_name = get_branch_name() + "中心库房"
target_stock_id = get_stockId_fromdb(stock_name)
target_area_code = get_stockAreaId_new_fromDb(target_dept_name, 1)
source_id = get_DRID(branch_id, bill_mode)
source_no = None
source_repl_id = None
source_corp_id = get_hosid()
source_branch_id = get_branch_id()
source_dept_id = FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid2']
source_dept_name = FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid2']
source_stock_id = get_stockId_fromdb(source_dept_name + '库房')
source_area_code = get_stockAreaId_new_fromDb(source_dept_name, 2)
accounter = get_login_user_uxid_bydb(FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3')['username1'])
account_date = get_create_time("select account_date from mcms_psi where id='%s';" % id)
request_body = commonFuc().get_business_data(module, "payload50_2_3", stockId, deptId2, areaCode, buyBillId = get_buyBillId(branch_id, bill_mode)
areaName,targetStockId,targetDeptId, if type == 1:
uxid, userLoginCode, cname, get_hosid(), get_branch_id(), hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"]
deptid1, elif type == 2:
orgCode1, orgName1, get_hosid(), get_hosid(), mgrCorpName, hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message1')["hosGoodsId"]
get_branch_id(), else:
get_branch_name(), mgrRangeId, mgrRangeName, extStr1, extStr3, hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message3')["hosGoodsId"]
get_hosid(), stockId,deptId2, pickOrderNo = get_PICK_order_no(branch_id, bill_mode)
areaCode, areaName, targetStockId, targetDeptId, UTid,createTime,snCode, pickBillId = get_PICK_id(branch_id, bill_mode)
get_hosid(), stockId, areaCode, areaName, shelfCode, planBillId = get_planBillId(hos_goods_id)
codeType, hosGoodsId, mdmGoodsCode, goodsCode, goodsDi, psiDeptOutBillId = get_id(
barName, "select id from mcms_psi_dept where target_branch_id='%s' and bill_mode='%s' and stock_kind='CK_TK' order by CREATE_TIME desc LIMIT 1;" % (
batchCode, expdtDate, productDate, pkgCode, pkgCodeSee, branch_id, bill_mode))
ssccCode, psiDeptOutOrderNo = get_id(
tbStatus, purBillId, "select order_no from mcms_psi_dept where target_branch_id='%s' and bill_mode='%s' and stock_kind='CK_TK' order by CREATE_TIME desc LIMIT 1;" % (
distrBillId, branch_id, bill_mode))
inStockTime, distrDetailId, purMode, price, goodsMfrsName, psiInBillId = id
goodsSpec, unit, goodsName,made, unitName, psiInOrderNo = order_no
hosGoodsCode, purModeText) buyOrderNo = get_buyOrderNo(branch_id, bill_mode)
print('request_body', '高值退库出库', request_body) purOrderNo = get_purOrderNo(branch_id, bill_mode)
# import pdb purBillId = get_purBillId(branch_id, bill_mode)
# pdb.set_trace() bill_relation_json = get_purBillDate2(branch_id, bill_mode)
# # # # 发送请求 purBillDate = reGetString(bill_relation_json, r'purBillDate":"', r'""distrBillId')
result = commonFuc().http_post(url, request_body, headers) distrBillId = get_distrBillId(branch_id, bill_mode)
print('result', result) distrOrderNo = get_distrOrderNo(branch_id, bill_mode)
elif type == 1: checkBillId = source_id
print('低值耗材或者试剂退库出库') sql = "select order_no from mcms_check where id='%s';" % checkBillId
udi_code = get_udi2(1,token) # 获取条码 低值1 高值2 试剂3 checkOrderNo = get_id(sql)
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module, psiInBillId = id
"herpService_stock_pick_scan_url") psiInOrderNo = order_no
# 从message18文件中获取信息 create_user = get_login_user_uxid_bydb(FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3')['username1'])
info = FileUtils().r_info8(module, "条码信息", 'message18') create_time = get_create_time("select create_time from mcms_psi where id='%s';" % id)
# print('info', info) last_modified = get_create_time("select last_modified from mcms_psi where id='%s';" % id)
list_a = info['list_a'] last_modified_user = create_user
stockId = commonFuc().analysis_json('stockId', list_a) if type == 1:
stockName = commonFuc().analysis_json('stockName', list_a) # 检查子表
areaCode = commonFuc().analysis_json('areaCode', list_a) check_mcms_psi_batch_in(id, type, order_no, source_id)
areaName = commonFuc().analysis_json('areaName', list_a) expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', 'check_mcms_psi1_1', id,
deptId2 = FileUtils().r_info8('b2_herp3_bs', '所有科室id', 'message6')["deptid2"] order_no, target_corp_id, target_branch_id, target_dept_id,
targetDeptId = FileUtils().r_info8('b2_herp3_bs', '所有科室id', 'message6')["deptid1"] target_dept_name, target_stock_id
deptName = get_branch_name() , target_area_code, source_id, source_no, source_repl_id,
targetStockId = get_stockId(deptName + '中心库房', 1) source_corp_id, source_branch_id, source_dept_id, source_dept_name
, source_stock_id, source_area_code, accounter, account_date,
request_body = commonFuc().get_business_data(module, "payload65", udi_code, stockId, deptId2, areaCode, pickOrderNo, pickBillId,
areaName, psiDeptOutBillId, psiDeptOutOrderNo, psiInBillId, psiInOrderNo,
targetStockId, targetDeptId) create_user
print('request_body', request_body) , create_time, last_modified, last_modified_user)
result = commonFuc().http_post(url, request_body, headers) elif type == 2:
print('退库出库扫码result', result) check_mcms_psi_batch_in(id, type, order_no, source_id)
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', 'check_mcms_psi1_2', id,
# 获取必要信息 order_no, target_corp_id, target_branch_id, target_dept_id,
deptid2 = FileUtils().r_info8('b2_herp3_bs', '所有科室id', 'message6')["deptid2"] target_dept_name, target_stock_id
data1 = commonFuc().analysis_json('data', result) , target_area_code, source_id, source_no, source_repl_id,
areaCode = commonFuc().analysis_json('areaCode', data1) source_corp_id, source_branch_id, source_dept_id, source_dept_name
UTid = commonFuc().analysis_json('id', data1) , source_stock_id, source_area_code, accounter, account_date,
createTime = commonFuc().analysis_json('id', data1) pickOrderNo, pickBillId,
stockId = commonFuc().analysis_json('stockId', data1) psiDeptOutBillId, psiDeptOutOrderNo, psiInBillId, psiInOrderNo,
areaCode = commonFuc().analysis_json('areaCode', data1) create_user
areaName = commonFuc().analysis_json('areaName', data1) , create_time, last_modified, last_modified_user)
shelfCode = commonFuc().analysis_json('shelfCode', data1) else:
codeType = commonFuc().analysis_json('codeType', data1) check_mcms_psi_batch_in(id, type, order_no, source_id)
tagType = commonFuc().analysis_json('tagType', data1) expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', 'check_mcms_psi1_3', id,
hosGoodsId = commonFuc().analysis_json('hosGoodsId', data1) order_no, target_corp_id, target_branch_id, target_dept_id,
mdmGoodsCode = commonFuc().analysis_json('mdmGoodsCode', data1) target_dept_name, target_stock_id
goodsCode = commonFuc().analysis_json('goodsCode', data1) , target_area_code, source_id, source_no, source_repl_id,
goodsDi = commonFuc().analysis_json('goodsDi', data1) source_corp_id, source_branch_id, source_dept_id, source_dept_name
barName = commonFuc().analysis_json('barName', data1) , source_stock_id, source_area_code, accounter, account_date,
batchCode = commonFuc().analysis_json('batchCode', data1) pickOrderNo, pickBillId,
expdtDate = commonFuc().analysis_json('expdtDate', data1) psiDeptOutBillId, psiDeptOutOrderNo, psiInBillId, psiInOrderNo,
productDate = commonFuc().analysis_json('productDate', data1) create_user
pkgCode = commonFuc().analysis_json('pkgCode', data1) , create_time, last_modified, last_modified_user)
pkgCodeSee = commonFuc().analysis_json('pkgCodeSee', data1) # 对比预期值和实际值是否一致
ssccCode = commonFuc().analysis_json('ssccCode', data1) actual_value1 = get_process_list2(actual)
tbStatus = commonFuc().analysis_json('tbStatus', data1) expected_value1 = get_process_list2(expected)
ext = commonFuc().analysis_json('ext', data1) actual_value2 = actual_value1.replace(" ", "")
distrDetailId = commonFuc().analysis_json('distrDetailId', ext) expected_value2 = expected_value1.replace(" ", "")
distrBillId = commonFuc().analysis_json('distrBillId', ext) # print('actual_value2',actual_value2)
purBillId = commonFuc().analysis_json('purBillId', ext) print('expected_value2')
pkgDefQty = commonFuc().analysis_json('pkgDefQty', ext) print(expected_value2)
pkgDefId = commonFuc().analysis_json('pkgDefId', ext) print('actual_value2')
pkgDefName = commonFuc().analysis_json('pkgDefName', ext) print(actual_value2)
purMode = commonFuc().analysis_json('purMode', data1) result = (compare_text_index(actual_value2, expected_value2))
goodsMfrsName = commonFuc().analysis_json('goodsMfrsName', data1) print('result', result)
goodsSpec = commonFuc().analysis_json('goodsSpec', data1) if actual_value2 == expected_value2:
unit = commonFuc().analysis_json('unit', data1) print('ok')
goodsName = commonFuc().analysis_json('goodsName', data1) commonFuc().check_text_exist_result_text('succees', 'succees')
pkgDefId = commonFuc().analysis_json('pkgDefId', data1) else:
# pkgDefQty=commonFuc().analysis_json('pkgDefQty',data1) print('error')
pkgDefName = commonFuc().analysis_json('pkgDefName', data1) commonFuc().check_text_exist_result_text('error', 'succees')
printNum = commonFuc().analysis_json('printNum', data1)
made = commonFuc().analysis_json('made', data1)
hosGoodsCode = commonFuc().analysis_json('hosGoodsCode', data1)
sourceId = commonFuc().analysis_json('sourceId', data1)
price = commonFuc().analysis_json('price', data1)
purModeText = commonFuc().analysis_json('purModeText', data1)
version = commonFuc().analysis_json('version', data1)
unitName = commonFuc().analysis_json('unitName', data1)
# ==============================获取条码信息
# 从message18文件中获取信息
info = FileUtils().r_info8(module, "条码信息", 'message18')
# print('info', info)
list_a = info['list_a']
extInfo = commonFuc().analysis_json('extInfo', list_a)
print('extInfo', extInfo)
# inStockTime = commonFuc().analysis_json('inStockTime', extInfo)
inStockTime = reGetString(extInfo, 'inStockTime\"\: \"', '\"\, \"distrDetailId')
print('inStockTime', inStockTime)
# 从message18文件中获取信息
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module,
"dept_stock_out_submit_url")
deptid2 = FileUtils().r_info8('b2_herp3_bs', '所有科室id', 'message6')["deptid2"]
deptid1 = FileUtils().r_info8('b2_herp3_bs', '所有科室id', 'message6')["deptid1"]
deptName2 = FileUtils().r_info8('b2_herp3_bs', '所有科室name', 'message6')["deptid2"]
stockName2 = deptName2 + "库房"
createTime = timeUtils().get_time_hms(1)
request_body = "request_body"
mgrCorpName = get_hosname()
mgrRangeId = deptid2
mgrRangeName = deptName2
extStr1 = get_branch_name()
extStr3 = get_branch_name()
snCode = UTid
userLoginCode = username
cname = username
orgCode1 = get_orgCode()
orgName1 = get_orgName()
request_body = commonFuc().get_business_data(module, "payload50_2_4", stockId, deptId2, areaCode,
areaName,targetStockId,targetDeptId,
uxid, userLoginCode, cname, get_hosid(), get_branch_id(),
deptid1,
orgCode1, orgName1, get_hosid(), get_hosid(), mgrCorpName,
get_branch_id(),
get_branch_name(), mgrRangeId, mgrRangeName, extStr1, extStr3,
get_hosid(), stockId,deptId2,
areaCode, areaName, targetStockId, targetDeptId, UTid,createTime,snCode,
get_hosid(), stockId, areaCode, areaName, shelfCode,
codeType, hosGoodsId, mdmGoodsCode, goodsCode, goodsDi,
barName,
batchCode, expdtDate, productDate, pkgCode, pkgCodeSee,
ssccCode,
tbStatus, pkgDefId,purBillId,
distrBillId,
inStockTime, distrDetailId,purMode, price, goodsMfrsName,
goodsSpec, unit, goodsName,pkgDefId,pkgDefName,made, unitName,
hosGoodsCode, purModeText)
print('request_body', request_body) def check_mcms_psi_batch_in(DR_ID, type, order_no, source_id1):
# # # # 发送请求 if type == 1:
result = commonFuc().http_post(url, request_body, headers) bill_mode = 16
print('低值产品退库出库,result', result) elif type == 2:
elif type == 3: bill_mode = 20
print('试剂产品退库出库') else:
udi_code = get_udi2(3,token) # 获取条码 低值1 高值2 试剂3 bill_mode = 66
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module, branch_id = get_branch_id()
"herpService_stock_pick_scan_url") sql = " select * from mcms_psi_batch where pid='%s';" % (
# 从message18文件中获取信息 DR_ID)
info = FileUtils().r_info8(module, "条码信息", 'message18') actual = check_mcms_dept_buy_sql(sql)
# print('info', info) print('actual', actual)
list_a = info['list_a'] batch_main_key = get_id("select id from mcms_psi_batch where pid='%s';" % DR_ID)
stockId = commonFuc().analysis_json('stockId', list_a) pid = DR_ID
stockName = commonFuc().analysis_json('stockName', list_a) # order_no = get_id("select order_no from mcms_psi_dept_batch where pid='%s';" % DR_ID)
areaCode = commonFuc().analysis_json('areaCode', list_a) source_detail_id = source_id1 + '0001'
areaName = commonFuc().analysis_json('areaName', list_a) pick_detail_id = None
deptId2 = FileUtils().r_info8('b2_herp3_bs', '所有科室id', 'message6')["deptid2"] if type == 1:
targetDeptId = FileUtils().r_info8('b2_herp3_bs', '所有科室id', 'message6')["deptid1"] hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"]
deptName = get_branch_name() elif type == 2:
targetStockId = get_stockId(deptName + '中心库房', 1) hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message1')["hosGoodsId"]
else:
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message3')["hosGoodsId"]
mdm_goods_code = get_mdm_goods_code1(hos_goods_id)
goods_code = get_goods_code1(hos_goods_id)
pkg_def_id = get_pkg_def_id(hos_goods_id)
picker_name = FileUtils().r_info8("b2_herp3_bs", "用户名信息", 'message3')['username1']
picker = get_login_user_uxid_bydb(picker_name)
source_batch_id = get_id("select source_batch_id from mcms_psi_batch where pid='%s';" % DR_ID)
distrBillId = get_distrBillId(branch_id, bill_mode)
target_batch_id = source_batch_id
if check_batch_id(source_batch_id) == True:
print('ok')
commonFuc().check_text_exist_result_text('succees', 'succees')
else:
commonFuc().check_text_exist_result_text('error', 'succees')
barcode_id = get_id("select barcode_id from mcms_psi_batch where pid='%s';" % DR_ID)
if check_barcode_id(barcode_id) == True:
print('ok')
commonFuc().check_text_exist_result_text('succees', 'succees')
else:
commonFuc().check_text_exist_result_text('error', 'succees')
dept_name = FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid2']
shelf_code = get_stockAreaId_new_fromDb(get_branch_name(), 1)
create_user = get_login_user_uxid_bydb(FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3')['username1'])
create_time = get_create_time("select create_time from mcms_psi_batch where pid='%s';" % DR_ID)
last_modified = get_create_time("select last_modified from mcms_psi_batch where pid='%s';" % DR_ID)
last_modified_user = None
if type == 1:
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'mcms_psi_batch_in1_1', batch_main_key, pid, order_no, source_detail_id
, hos_goods_id, mdm_goods_code, goods_code, source_batch_id,
target_batch_id, barcode_id, shelf_code, create_user, create_time,
last_modified, last_modified_user
request_body = commonFuc().get_business_data(module, "payload65", udi_code, stockId, deptId2, areaCode, )
areaName, elif type == 2:
targetStockId, targetDeptId) expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
print('request_body', request_body) 'mcms_psi_batch_in1_2', batch_main_key, pid, order_no, source_detail_id
result = commonFuc().http_post(url, request_body, headers) , hos_goods_id, mdm_goods_code, goods_code, source_batch_id,
print('退库出库扫码result', result) target_batch_id, barcode_id, shelf_code, create_user, create_time,
last_modified, last_modified_user
# 获取必要信息 )
deptid2 = FileUtils().r_info8('b2_herp3_bs', '所有科室id', 'message6')["deptid2"] else:
data1 = commonFuc().analysis_json('data', result) expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
areaCode = commonFuc().analysis_json('areaCode', data1) 'mcms_psi_batch_in1_3', batch_main_key, pid, order_no, source_detail_id
UTid = commonFuc().analysis_json('id', data1) , hos_goods_id, mdm_goods_code, goods_code, source_batch_id,
createTime = commonFuc().analysis_json('id', data1) target_batch_id, barcode_id, shelf_code, create_user, create_time,
stockId = commonFuc().analysis_json('stockId', data1) last_modified, last_modified_user
areaCode = commonFuc().analysis_json('areaCode', data1)
areaName = commonFuc().analysis_json('areaName', data1)
shelfCode = commonFuc().analysis_json('shelfCode', data1)
codeType = commonFuc().analysis_json('codeType', data1)
tagType = commonFuc().analysis_json('tagType', data1)
hosGoodsId = commonFuc().analysis_json('hosGoodsId', data1)
mdmGoodsCode = commonFuc().analysis_json('mdmGoodsCode', data1)
goodsCode = commonFuc().analysis_json('goodsCode', data1)
goodsDi = commonFuc().analysis_json('goodsDi', data1)
barName = commonFuc().analysis_json('barName', data1)
batchCode = commonFuc().analysis_json('batchCode', data1)
expdtDate = commonFuc().analysis_json('expdtDate', data1)
productDate = commonFuc().analysis_json('productDate', data1)
pkgCode = commonFuc().analysis_json('pkgCode', data1)
pkgCodeSee = commonFuc().analysis_json('pkgCodeSee', data1)
ssccCode = commonFuc().analysis_json('ssccCode', data1)
tbStatus = commonFuc().analysis_json('tbStatus', data1)
ext = commonFuc().analysis_json('ext', data1)
distrDetailId = commonFuc().analysis_json('distrDetailId', ext)
distrBillId = commonFuc().analysis_json('distrBillId', ext)
purBillId = commonFuc().analysis_json('purBillId', ext)
pkgDefQty = commonFuc().analysis_json('pkgDefQty', ext)
pkgDefId = commonFuc().analysis_json('pkgDefId', ext)
pkgDefName = commonFuc().analysis_json('pkgDefName', ext)
purMode = commonFuc().analysis_json('purMode', data1)
goodsMfrsName = commonFuc().analysis_json('goodsMfrsName', data1)
goodsSpec = commonFuc().analysis_json('goodsSpec', data1)
unit = commonFuc().analysis_json('unit', data1)
goodsName = commonFuc().analysis_json('goodsName', data1)
pkgDefId = commonFuc().analysis_json('pkgDefId', data1)
# pkgDefQty=commonFuc().analysis_json('pkgDefQty',data1)
pkgDefName = commonFuc().analysis_json('pkgDefName', data1)
printNum = commonFuc().analysis_json('printNum', data1)
made = commonFuc().analysis_json('made', data1)
hosGoodsCode = commonFuc().analysis_json('hosGoodsCode', data1)
sourceId = commonFuc().analysis_json('sourceId', data1)
price = commonFuc().analysis_json('price', data1)
purModeText = commonFuc().analysis_json('purModeText', data1)
version = commonFuc().analysis_json('version', data1)
unitName = commonFuc().analysis_json('unitName', data1)
# ==============================获取条码信息
# 从message18文件中获取信息
info = FileUtils().r_info8(module, "条码信息", 'message18')
# print('info', info)
list_a = info['list_a']
extInfo = commonFuc().analysis_json('extInfo', list_a)
print('extInfo', extInfo)
# inStockTime = commonFuc().analysis_json('inStockTime', extInfo)
inStockTime = reGetString(extInfo, 'inStockTime\"\: \"', '\"\, \"distrDetailId')
print('inStockTime', inStockTime)
# 从message18文件中获取信息
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module,
"dept_stock_out_submit_url")
deptid2 = FileUtils().r_info8('b2_herp3_bs', '所有科室id', 'message6')["deptid2"] )
deptid1 = FileUtils().r_info8('b2_herp3_bs', '所有科室id', 'message6')["deptid1"]
deptName2 = FileUtils().r_info8('b2_herp3_bs', '所有科室name', 'message6')["deptid2"]
stockName2 = deptName2 + "库房"
createTime = timeUtils().get_time_hms(1)
request_body = "request_body"
mgrCorpName = get_hosname()
mgrRangeId = deptid2
mgrRangeName = deptName2
extStr1 = get_branch_name()
extStr3 = get_branch_name()
snCode = UTid
userLoginCode = username
cname = username
orgCode1 = get_orgCode()
orgName1 = get_orgName()
request_body = commonFuc().get_business_data(module, "payload50_2_4", stockId, deptId2, areaCode, print('expected', expected)
areaName, targetStockId, targetDeptId, print('aaaaaaaaaaaaaaaaa')
uxid, userLoginCode, cname, get_hosid(), get_branch_id(), actual_value1 = get_process_list2(actual)
deptid1, expected_value1 = get_process_list2(expected)
orgCode1, orgName1, get_hosid(), get_hosid(), mgrCorpName, actual_value2 = actual_value1.replace(" ", "")
get_branch_id(), expected_value2 = expected_value1.replace(" ", "")
get_branch_name(), mgrRangeId, mgrRangeName, extStr1, extStr3, # print('actual_value2',actual_value2)
get_hosid(), stockId, deptId2, print('expected_value2')
areaCode, areaName, targetStockId, targetDeptId, UTid, createTime, print(expected_value2)
snCode, print('actual_value2')
get_hosid(), stockId, areaCode, areaName, shelfCode, print(actual_value2)
codeType, hosGoodsId, mdmGoodsCode, goodsCode, goodsDi, print(compare_text_index(actual_value2, expected_value2))
barName, if actual_value2 == expected_value2:
batchCode, expdtDate, productDate, pkgCode, pkgCodeSee, print('ok')
ssccCode, commonFuc().check_text_exist_result_text('succees', 'succees')
tbStatus, pkgDefId, purBillId, else:
distrBillId, print('error')
inStockTime, distrDetailId, purMode, price, goodsMfrsName, commonFuc().check_text_exist_result_text('error', 'succees')
goodsSpec, unit, goodsName, pkgDefId, pkgDefName, made, unitName,
hosGoodsCode, purModeText)
print('request_body', request_body)
# # # # 发送请求
result = commonFuc().http_post(url, request_body, headers)
print('试剂产品退库出库,result', result)
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_b9流程十六退库业务_二级库向一级库退库.air')
using(pro_path + r'//air_case/b5_spd3_core_business_flow/a_b9流程十六退库业务_二级库向一级库退库.air')
from a_b9流程十六退库业务_二级库向一级库退库 import second_dept_return_Out_Stock, putaway
try: try:
updateUserLoginDefaultRange(get_listUserMgrRangePage1(2))#设置登录账号默认权限是二级库 updateUserLoginDefaultRange(get_listUserMgrRangePage1(2))#设置登录账号默认权限是二级库
second_dept_return_Out_Stock(2)#高值耗材退货出库 second_dept_return_Out_Stock(2)#高值耗材退货出库
time.sleep(6)
check_mcms_psi_dept_out(20)#检查出库单数据库数据
approval_center()#审批 approval_center()#审批
putaway()#中心库上架 putaway()#中心库上架
updateUserLoginDefaultRange(get_listUserMgrRangePage1(2))#设置登录账号默认权限是二级库 time.sleep(6)
second_dept_return_Out_Stock(1)#低值耗材退货出库 check_mcms_psi_in(2) # 检查中心库入库单数据库数据
updateUserLoginDefaultRange(get_listUserMgrRangePage1(2)) # 设置登录账号默认权限是二级库
second_dept_return_Out_Stock(1) # 低值耗材退货出库
time.sleep(6)
check_mcms_psi_dept_out(16) # 检查出库单数据库数据
approval_center() # 审批 approval_center() # 审批
putaway() # 中心库上架 putaway() # 中心库上架
updateUserLoginDefaultRange(get_listUserMgrRangePage1(2))#设置登录账号默认权限是二级库 time.sleep(6)
second_dept_return_Out_Stock(3)#试剂耗材退货出库 check_mcms_psi_in(1) # 检查中心库入库单数据库数据
approval_center()#审批 updateUserLoginDefaultRange(get_listUserMgrRangePage1(2)) # 设置登录账号默认权限是二级库
putaway()#中心库上架 second_dept_return_Out_Stock(3) #试剂耗材退货出库
check_mcms_psi_dept_out(66) # 检查出库单数据库数据
approval_center() # 审批
putaway() # 中心库上架
time.sleep(6)
check_mcms_psi_in(3) # 检查中心库入库单数据库数据
# ===============上面调通了================================ # ===============上面调通了================================
commonFuc().check_text_exist_result_text('succees', 'succees') commonFuc().check_text_exist_result_text('succees', 'succees')
except Exception as e: except Exception as e:
# 打印错误信息 # 打印错误信息
print(f"发生错误: {e}") print(f"发生错误: {e}")
commonFuc().check_text_exist_result_text('error', 'SUCCESS') commonFuc().check_text_exist_result_text('error', 'SUCCESS')
\ No newline at end of file
...@@ -5,6 +5,10 @@ import traceback ...@@ -5,6 +5,10 @@ import traceback
from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_system from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_system
from air_case.public1.public1.public1 import * from air_case.public1.public1.public1 import *
from common.db.sql.sql_del_branch_info import delData from common.db.sql.sql_del_branch_info import delData
from common.db.sql.sql_tools import check_mcms_pur_plan_sql, get_DRID, get_login_user_uxid_bydb, get_create_time, \
get_buyBillId, get_PICK_order_no, get_PICK_id, get_planBillId, get_buyOrderNo, get_purOrderNo, get_purBillId, \
get_purBillDate2, get_distrBillId, get_distrOrderNo, get_mdm_goods_code1, get_goods_code1, get_pkg_def_id, \
check_mcms_dept_buy_sql, check_batch_id, check_barcode_id, get_pick_detail_id, get_expdt_date
from common.fileUtls import FileUtils from common.fileUtls import FileUtils
from common.run_cmd_script import execute_command from common.run_cmd_script import execute_command
...@@ -20,620 +24,400 @@ python runner_test.py tag id2303-20 debug mdm3 ...@@ -20,620 +24,400 @@ python runner_test.py tag id2303-20 debug mdm3
""" """
def check_mcms_psi_out(type=1):
print('检查中心库出库单')
if type == 1:
bill_mode = 16
elif type == 2:
bill_mode = 20
else:
bill_mode = 66
branch_id = get_branch_id()
sql = "select * from mcms_psi where source_branch_id='%s' and bill_mode='%s' and stock_kind='CK_TH' order by CREATE_TIME desc LIMIT 1;" % (
branch_id, bill_mode)
# 获取实际值
actual = check_mcms_pur_plan_sql(sql)
print('actual', actual)
sql = "select id from mcms_psi where source_branch_id='%s' and bill_mode='%s' and stock_kind='CK_TH' order by CREATE_TIME desc LIMIT 1;" % (
branch_id, bill_mode)
id = get_id(sql)
sql = "select order_no from mcms_psi where source_branch_id='%s' and bill_mode='%s' and stock_kind='CK_TH' order by CREATE_TIME desc LIMIT 1;" % (
branch_id, bill_mode)
order_no = get_id(sql)
target_corp_id = get_hosid()
target_branch_id =None
target_dept_id = FileUtils().r_info8("b5_spd3_core_business_flow", "供货关系申请2", 'message')['e_corpId']
target_dept_name = FileUtils().r_info8("b5_spd3_core_business_flow", "供货关系申请2", 'message')['e_username']
stock_name = get_branch_name() + "中心库房"
target_stock_id =target_dept_id
target_area_code =None
source_id = get_PICK_id(branch_id, bill_mode)
source_no = None
source_repl_id = None
source_corp_id = get_hosid()
source_branch_id = get_branch_id()
source_dept_id = FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid1']
source_dept_name = FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid1']
source_stock_id = get_stockId_fromdb(get_branch_name()+'中心库房')
source_area_code = get_stockAreaId_new_fromDb(source_dept_name, 1)
accounter = get_login_user_uxid_bydb(FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3')['username1'])
account_date = get_create_time("select account_date from mcms_psi where id='%s';" % id)
buyBillId = get_buyBillId(branch_id, bill_mode)
if type == 1:
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"]
elif type == 2:
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message1')["hosGoodsId"]
else:
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message3')["hosGoodsId"]
pickOrderNo = get_PICK_order_no(branch_id, bill_mode)
pickBillId = get_PICK_id(branch_id, bill_mode)
planBillId = get_planBillId(hos_goods_id)
psiOutBillId = id
psiOutOrderNo =order_no
buyOrderNo = get_buyOrderNo(branch_id, bill_mode)
purOrderNo = get_purOrderNo(branch_id, bill_mode)
purBillId = get_purBillId(branch_id, bill_mode)
bill_relation_json = get_purBillDate2(branch_id, bill_mode)
purBillDate = reGetString(bill_relation_json, r'purBillDate":"', r'""distrBillId')
distrBillId = get_distrBillId(branch_id, bill_mode)
distrOrderNo = get_distrOrderNo(branch_id, bill_mode)
checkBillId = source_id
sql = "select order_no from mcms_check where id='%s';" % checkBillId
checkOrderNo = get_id(sql)
psiInBillId = id
psiInOrderNo = order_no
create_user = get_login_user_uxid_bydb(FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3')['username1'])
create_time = get_create_time("select create_time from mcms_psi where id='%s';" % id)
last_modified = get_create_time("select last_modified from mcms_psi where id='%s';" % id)
last_modified_user = create_user
if type == 1:
# 检查子表
check_mcms_psi_batch_out(id, type, order_no, source_id)
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', 'check_mcms_psi_out_1_1', id,
order_no, target_corp_id, target_branch_id, target_dept_id,
target_dept_name, target_stock_id
, target_area_code, source_id, source_no, source_repl_id,
source_corp_id, source_branch_id, source_dept_id, source_dept_name
, source_stock_id, source_area_code, accounter, account_date,
pickOrderNo, pickBillId,
psiOutBillId, psiOutOrderNo,
create_user
, create_time, last_modified, last_modified_user)
elif type == 2:
check_mcms_psi_batch_out(id, type, order_no, source_id)
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', 'check_mcms_psi_out_1_2', id,
order_no, target_corp_id, target_branch_id, target_dept_id,
target_dept_name, target_stock_id
, target_area_code, source_id, source_no, source_repl_id,
source_corp_id, source_branch_id, source_dept_id, source_dept_name
, source_stock_id, source_area_code, accounter, account_date,
pickOrderNo, pickBillId,
psiOutBillId, psiOutOrderNo,
create_user
, create_time, last_modified, last_modified_user)
else:
check_mcms_psi_batch_out(id, type, order_no, source_id)
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', 'check_mcms_psi_out_1_3', id,
order_no, target_corp_id, target_branch_id, target_dept_id,
target_dept_name, target_stock_id
, target_area_code, source_id, source_no, source_repl_id,
source_corp_id, source_branch_id, source_dept_id, source_dept_name
, source_stock_id, source_area_code, accounter, account_date,
pickOrderNo, pickBillId,
psiOutBillId, psiOutOrderNo,
create_user
, create_time, last_modified, last_modified_user)
# 对比预期值和实际值是否一致
actual_value1 = get_process_list2(actual)
expected_value1 = get_process_list2(expected)
actual_value2 = actual_value1.replace(" ", "")
expected_value2 = expected_value1.replace(" ", "")
# print('actual_value2',actual_value2)
print('expected_value2')
print(expected_value2)
print('actual_value2')
print(actual_value2)
result = (compare_text_index(actual_value2, expected_value2))
print('result', result)
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')
def second_center_Stock_return_Out(type): # 中心库退供应商 def check_mcms_psi_batch_out(DR_ID, type, order_no, source_id1):
module = "b5_spd3_core_business_flow" if type == 1:
# # 登录获取用户id等信息,使用创建的用户登录===========开始 bill_mode = 16
info = FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3') elif type == 2:
username = info['username1'] bill_mode = 20
password = commonFuc().get_business_data("b2_herp3_bs", "password") else:
print('username,password', username, password) bill_mode = 66
# # 获取token和projectCode branch_id = get_branch_id()
token, projectCode, uxid, corpId, info = login(username, password, 2) sql = " select * from mcms_psi_batch where pid='%s';" % (
# 登录获取用户id等信息,使用创建的用户登录============结束 DR_ID)
# 我要请领_手工请领_列表查询=========================== actual = check_mcms_dept_buy_sql(sql)
headers = commonFuc().get_business_data(module, "json_headers2", print('actual', actual)
commonFuc().get_business_data(module, "json_contentType"), token, batch_main_key = get_id("select id from mcms_psi_batch where pid='%s';" % DR_ID)
commonFuc().get_business_data(module, "X-APP-CODE")) pid = DR_ID
# order_no = get_id("select order_no from mcms_psi_dept_batch where pid='%s';" % DR_ID)
source_detail_id = get_pick_detail_id(branch_id,bill_mode)
pick_detail_id = source_detail_id
if type == 1:
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"]
elif type == 2:
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message1')["hosGoodsId"]
else:
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message3')["hosGoodsId"]
mdm_goods_code = get_mdm_goods_code1(hos_goods_id)
goods_code = get_goods_code1(hos_goods_id)
pkg_def_id = get_pkg_def_id(hos_goods_id)
picker_name = FileUtils().r_info8("b2_herp3_bs", "用户名信息", 'message3')['username1']
picker = get_login_user_uxid_bydb(picker_name)
source_batch_id = get_id("select source_batch_id from mcms_psi_batch where pid='%s';" % DR_ID)
distrBillId = get_distrBillId(branch_id, bill_mode)
target_batch_id = source_batch_id
if check_batch_id(source_batch_id) == True:
print('ok')
commonFuc().check_text_exist_result_text('succees', 'succees')
else:
commonFuc().check_text_exist_result_text('error', 'succees')
barcode_id = get_id("select barcode_id from mcms_psi_batch where pid='%s';" % DR_ID)
if check_barcode_id(barcode_id) == True:
print('ok')
commonFuc().check_text_exist_result_text('succees', 'succees')
else:
commonFuc().check_text_exist_result_text('error', 'succees')
dept_name = FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid2']
shelf_code = get_stockAreaId_new_fromDb(get_branch_name(), 1)
create_user = get_login_user_uxid_bydb(FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3')['username1'])
create_time = get_create_time("select create_time from mcms_psi_batch where pid='%s';" % DR_ID)
last_modified = get_create_time("select last_modified from mcms_psi_batch where pid='%s';" % DR_ID)
last_modified_user = create_user
if type == 1:
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'mcms_psi_batch_out1_1', batch_main_key, pid, order_no, source_detail_id
, hos_goods_id, mdm_goods_code, goods_code, source_batch_id,pick_detail_id,
target_batch_id, barcode_id, shelf_code, create_user, create_time,
last_modified, last_modified_user
if type == 2:#高值退货出库 )
module = "b5_spd3_core_business_flow" elif type == 2:
# # 登录获取用户id等信息,使用创建的用户登录===========开始 expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
info = FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3') 'mcms_psi_batch_out1_2', batch_main_key, pid, order_no, source_detail_id
username = info['username1'] , pick_detail_id,hos_goods_id, mdm_goods_code, goods_code, source_batch_id,
password = commonFuc().get_business_data("b2_herp3_bs", "password") target_batch_id, barcode_id, shelf_code, create_user, create_time,
print('username,password', username, password) last_modified, last_modified_user
# # 获取token和projectCode
token, projectCode, uxid, corpId, info = login(username, password, 2)
# 登录获取用户id等信息,使用创建的用户登录============结束
# 到库房明细查询,查询产品的udi码
get_udi(2)
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module, "herpService_pick_submit_url")
print('url', url)
headers = commonFuc().get_business_data(module, "json_headers2",
commonFuc().get_business_data(module, "json_contentType"), token,
commonFuc().get_business_data(module, "X-APP-CODE"))
# 从文件中获取必要信息
info = FileUtils().r_info8(module, "条码信息", 'message18')
# print('info', info)
list_a = info['list_a']
# print('list_a', list_a[0], type(list_a), len(list_a))
UTid = 'UT'
areaCode = 'areaCode'
createTime = 'createTime'
hosId = 'hosId'
stockId = 'stockId'
areaCode = 'areaCode'
areaName = 'areaName'
shelfCode = 'shelfCode'
codeType = 'codeType'
tagType = 'tagType'
hosGoodsId = 'hosGoodsId'
mdmGoodsCode = 'mdmGoodsCode'
goodsCode = 'goodsCode'
goodsDi = 'goodsDi'
barName = 'barName'
batchCode = 'batchCode'
expdtDate = 'expdtDate'
productDate = 'productDate'
pkgCode = 'pkgCode'
pkgCodeSee='pkgCodeSee'
ssccCode='ssccCode'
tbStatus='tbStatus'
pkgDefQty='pkgDefQty'
purBillId='purBillId'
distrBillId='distrBillId'
inStockTime='inStockTime'
distrDetailId='distrDetailId'
purMode='purMode'
goodsMfrsName='goodsMfrsName'
goodsSpec='goodsSpec'
unit='unit'
goodsName='goodsName'
printNum='printNum'
made='made'
provId='provId'
provName='provName'
subProvId='subProvId'
subProvName='subProvName'
hosGoodsCode='hosGoodsCode'
subSendFlag='subSendFlag'
onlyKey='onlyKey'
pkgDefId='pkgDefId'
pkgDefName='pkgDefName'
print('aaaaaaaaaaaaaaaaaaaaaaaaa', list_a[0])
list_b = list_a[0]
for i in list_b:
print(i)
UTid = i['id']
areaCode = i['areaCode']
createTime = i['createTime']
hosId = i['hosId']
stockId = i['stockId']
areaCode = i['areaCode']
areaName = i['areaName']
shelfCode = i['shelfCode']
codeType = i['codeType']
tagType = i['tagType']
hosGoodsId = i['hosGoodsId']
mdmGoodsCode = i['mdmGoodsCode']
goodsCode = i['goodsCode']
goodsDi = i['goodsDi']
barName = i['barName']
batchCode = i['batchCode']
expdtDate = i['expdtDate']
productDate = i['productDate']
pkgCode = i['pkgCode']
pkgCodeSee = i['pkgCodeSee']
ssccCode = i['ssccCode']
tbStatus = i['tbStatus']
onlyKey = i['hosGoodsId']
ext = i['ext']
print('ext', ext)
distrDetailId = ext['distrDetailId']
distrBillId = ext['distrBillId']
purBillId = ext['purBillId']
pkgDefQty = ext['pkgDefQty']
# pkgDefId = ext['pkgDefId']
# pkgDefName = ext['pkgDefName']
purMode = i['purMode']
goodsMfrsName = i['goodsMfrsName']
goodsSpec = i['goodsSpec']
unit = i['unit']
goodsName = i['goodsName']
pkgDefId = i['pkgDefId']
# pkgDefQty = i['pkgDefQty']
pkgDefName = i['pkgDefName']
printNum = i['printNum']
made = i['made']
provId = i['provId']
provName = i['provName']
subProvId = i['subProvId']
subProvName = i['subProvName']
hosGoodsCode = i['hosGoodsCode']
subSendFlag = i['subSendFlag']
areaName = i['areaName']
hosId = i['hosId']
inStockTime=i['inStockTime']
break
# pkgDefQty=1
deptid1 = FileUtils().r_info8('b2_herp3_bs', '所有科室id', 'message6')["deptid1"]
deptName = FileUtils().r_info8('b2_herp3_bs', '所有科室name', 'message6')["deptid1"]
# # 请求体
request_body = commonFuc().get_business_data(module, "payload66", areaCode, UTid, createTime, UTid, hosId,
stockId,
areaCode, areaName, shelfCode, codeType, tagType, hosGoodsId,
mdmGoodsCode, goodsCode, goodsDi, barName, batchCode, expdtDate,
productDate, pkgCode, pkgCodeSee, ssccCode, tbStatus,pkgDefQty,
purBillId,distrBillId,inStockTime,distrDetailId,
purMode,
goodsMfrsName, goodsSpec, unit, goodsName
, printNum, made, provId, provName, subProvId,
subProvName,
hosGoodsCode, subSendFlag, onlyKey, areaName, hosId,
get_branch_id(),
deptid1, deptName, stockId)
print('request_body', 'ccccccc', request_body)
# # # # 发送请求 )
result = commonFuc().http_post(url, request_body, headers) else:
print('result', result) expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
PICK_ID = commonFuc().analysis_json('data', result) 'mcms_psi_batch_out1_3', batch_main_key, pid, order_no, source_detail_id
# =====================出库复核列表查询获取pickid=============== , hos_goods_id, mdm_goods_code, goods_code, source_batch_id,pick_detail_id,
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module, target_batch_id, barcode_id, shelf_code, create_user, create_time,
"herpService_pick_return_page_url") last_modified, last_modified_user
print('url', url)
request_body = commonFuc().get_business_data(module, "payload20", get_branch_id(), get_hosid(), deptid1)
# # # # 发送请求
result = commonFuc().http_post(url, request_body, headers)
print('result', result)
# =====================出库复核列表查询获取pickid=============== )
# =======================查看出库单详细信息===============
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module,
"herpService_pick_checkReview_url")
url = url + ' '.join(PICK_ID) + '?pickedFlag=true'
print('url', url)
# # # # 发送请求
result = commonFuc().http_get(url, headers)
print('查看出库单详细信息result', result)
# =======================查看出库单详细信息===============
# ========================扫码复核
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module,
"herpService_stock_hdiBarcode_scan_url")
url = url + pkgCode
print('url', url)
# # # # 发送请求
result = commonFuc().http_get(url, headers)
print('扫码复核result', result)
data = commonFuc().analysis_json('data', result)
UT_id = commonFuc().analysis_json('id', data)
createTime = commonFuc().analysis_json('createTime', data)
snCode = commonFuc().analysis_json('snCode', data)
tbStatus = commonFuc().analysis_json('tbStatus', data)
print(UT_id)
# ========================扫码复核
# ========出库复核提交==========
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module,
"herpService_stock_review_pass_submit_url")
print('url', url) print('expected', expected)
sourceId = ' '.join(PICK_ID) print('aaaaaaaaaaaaaaaaa')
# 请求体 actual_value1 = get_process_list2(actual)
request_body = commonFuc().get_business_data(module, "payload21", UT_id, createTime, snCode, hosId, stockId, expected_value1 = get_process_list2(expected)
areaCode, areaName, shelfCode, codeType, tagType, hosGoodsId, actual_value2 = actual_value1.replace(" ", "")
mdmGoodsCode, goodsCode, goodsDi, barName, batchCode, expdtDate, expected_value2 = expected_value1.replace(" ", "")
productDate, pkgCode, pkgCodeSee, ssccCode, tbStatus, # print('actual_value2',actual_value2)
distrDetailId, print('expected_value2')
distrBillId, purBillId, pkgDefQty, pkgDefId, pkgDefName, purMode, print(expected_value2)
goodsMfrsName, goodsSpec, unit, goodsName, pkgDefId, pkgDefQty, print('actual_value2')
pkgDefName, made, hosGoodsCode, sourceId) print(actual_value2)
print('request_body', request_body) print(compare_text_index(actual_value2, expected_value2))
# # # # 发送请求 if actual_value2 == expected_value2:
result = commonFuc().http_post(url, request_body, headers) print('ok')
print('herpService_stock_review_pass_submit_urlresult', result) commonFuc().check_text_exist_result_text('succees', 'succees')
# ========出库复核提交 else:
elif type == 1: print('error')
print('低值耗材退货出库') commonFuc().check_text_exist_result_text('error', 'succees')
module = "b5_spd3_core_business_flow" def check_mcms_pick(type=16):
# # 登录获取用户id等信息,使用创建的用户登录===========开始 branch_id = get_branch_id()
info = FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3') print('拣货单验证')
username = info['username1'] sql = " select * from mcms_pick where branch_id='%s' and bill_mode='%s' order by CREATE_TIME desc LIMIT 1;" % (
password = commonFuc().get_business_data("b2_herp3_bs", "password") branch_id, type)
print('username,password', username, password) actual = check_mcms_dept_buy_sql(sql)
# # 获取token和projectCode print(actual)
token, projectCode, uxid, corpId, info = login(username, password, 2) id = get_id(
# 登录获取用户id等信息,使用创建的用户登录============结束 "select id from mcms_pick where branch_id='%s' and bill_mode='%s' order by CREATE_TIME desc LIMIT 1;" % (
# 到库房明细查询,查询产品的udi码 branch_id, type))
get_udi(1) order_no = get_id(
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module, "herpService_pick_submit_url") "select order_no from mcms_pick where branch_id='%s' and bill_mode='%s' order by CREATE_TIME desc LIMIT 1;" % (
print('url', url) branch_id, type))
headers = commonFuc().get_business_data(module, "json_headers2", source_id = get_buyBillId(branch_id, type)
commonFuc().get_business_data(module, "json_contentType"), token, dept_id = FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid1']
commonFuc().get_business_data(module, "X-APP-CODE")) dept_name = FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid1']
# 从文件中获取必要信息 stock_id = get_stockId_fromdb(dept_name + '中心库房')
info = FileUtils().r_info8(module, "条码信息", 'message18') area_code = get_stockAreaId_new_fromDb(dept_name, 1)
# print('info', info) target_dept_id = FileUtils().r_info8("b5_spd3_core_business_flow", "供货关系申请2", 'message')['e_corpId']
list_a = info['list_a'] target_dept_name = FileUtils().r_info8("b5_spd3_core_business_flow", "供货关系申请2", 'message')['e_username']
UTid = 'UT' target_stock_id = target_dept_id
areaCode = 'areaCode' target_area_code = None
createTime = 'createTime' username = FileUtils().r_info8("b2_herp3_bs", "用户名信息", 'message3')['username1']
hosId = 'hosId' reviewer = get_login_user_uxid_bydb(username)
stockId = 'stockId' review_date = get_expdt_date(
areaCode = 'areaCode' "select review_date from mcms_pick where branch_id='%s' and bill_mode='%s' order by CREATE_TIME desc LIMIT 1;" % (
areaName = 'areaName' branch_id, type))
shelfCode = 'shelfCode' buyBillId = get_buyBillId(branch_id, type)
codeType = 'codeType' pickOrderNo = order_no
tagType = 'tagType' buyOrderNo = get_buyOrderNo(branch_id, type)
hosGoodsId = 'hosGoodsId' pickBillId = id
mdmGoodsCode = 'mdmGoodsCode' create_user = reviewer
goodsCode = 'goodsCode' create_time = get_expdt_date(
goodsDi = 'goodsDi' "select create_time from mcms_pick where branch_id='%s' and bill_mode='%s' order by CREATE_TIME desc LIMIT 1;" % (
barName = 'barName' branch_id, type))
batchCode = 'batchCode' last_modified = get_expdt_date(
expdtDate = 'expdtDate' "select last_modified from mcms_pick where branch_id='%s' and bill_mode='%s' order by CREATE_TIME desc LIMIT 1;" % (
productDate = 'productDate' branch_id, type))
pkgCode = 'pkgCode' last_modified_user=create_user
pkgCodeSee = 'pkgCodeSee' picker = create_user
ssccCode = 'ssccCode' picker_name = username
tbStatus = 'tbStatus' if type == 16:
pkgDefQty = 'pkgDefQty' #检查拣货单子表
purBillId = 'purBillId' check_mcms_pick_detail(id,type,order_no)
distrBillId = 'distrBillId' expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
inStockTime = 'inStockTime' 'mcms_pick1', id, get_hosid(), get_branch_id(), order_no, source_id,
distrDetailId = 'distrDetailId' dept_id,
purMode = 'purMode' dept_name, stock_id, area_code, target_dept_id, target_dept_name,
goodsMfrsName = 'goodsMfrsName' target_stock_id, target_area_code, reviewer,
goodsSpec = 'goodsSpec' review_date, buyBillId, pickOrderNo, buyOrderNo, pickBillId,
unit = 'unit' create_user, create_time, last_modified, last_modified_user,picker, picker_name
goodsName = 'goodsName' )
printNum = 'printNum' elif type == 20:
made = 'made' # 检查拣货单子表
provId = 'provId' check_mcms_pick_detail(id,type,order_no)
provName = 'provName' expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
subProvId = 'subProvId' 'mcms_pick2', id, get_hosid(), get_branch_id(), order_no, source_id,
subProvName = 'subProvName' dept_id,
hosGoodsCode = 'hosGoodsCode' dept_name, stock_id, area_code, target_dept_id, target_dept_name,
subSendFlag = 'subSendFlag' target_stock_id, target_area_code, reviewer,
onlyKey = 'onlyKey' review_date, buyBillId, pickOrderNo, buyOrderNo, pickBillId,
pkgDefId = 'pkgDefId' create_user, create_time, last_modified, last_modified_user,picker, picker_name
pkgDefName = 'pkgDefName' )
print('aaaaaaaaaaaaaaaaaaaaaaaaa', list_a[0]) else:
list_b = list_a[0] # 检查拣货单子表
for i in list_b: check_mcms_pick_detail(id, type, order_no)
print(i) expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
UTid = i['id'] 'mcms_pick3', id, get_hosid(), get_branch_id(), order_no, source_id,
areaCode = i['areaCode'] dept_id,
createTime = i['createTime'] dept_name, stock_id, area_code, target_dept_id, target_dept_name,
hosId = i['hosId'] target_stock_id, target_area_code, reviewer,
stockId = i['stockId'] review_date, buyBillId, pickOrderNo, buyOrderNo, pickBillId,
areaCode = i['areaCode'] create_user, create_time, last_modified, last_modified_user,picker, picker_name
areaName = i['areaName'] )
shelfCode = i['shelfCode']
codeType = i['codeType']
tagType = i['tagType']
hosGoodsId = i['hosGoodsId']
mdmGoodsCode = i['mdmGoodsCode']
goodsCode = i['goodsCode']
goodsDi = i['goodsDi']
barName = i['barName']
batchCode = i['batchCode']
expdtDate = i['expdtDate']
productDate = i['productDate']
pkgCode = i['pkgCode']
pkgCodeSee = i['pkgCodeSee']
ssccCode = i['ssccCode']
tbStatus = i['tbStatus']
onlyKey = i['hosGoodsId']
ext = i['ext']
print('ext', ext)
distrDetailId = ext['distrDetailId']
distrBillId = ext['distrBillId']
purBillId = ext['purBillId']
pkgDefQty = ext['pkgDefQty']
pkgDefId = ext['pkgDefId']
pkgDefName = ext['pkgDefName']
purMode = i['purMode']
goodsMfrsName = i['goodsMfrsName']
goodsSpec = i['goodsSpec']
unit = i['unit']
goodsName = i['goodsName']
pkgDefId = i['pkgDefId']
pkgDefQty = i['pkgDefQty']
pkgDefName = i['pkgDefName']
printNum = i['printNum']
made = i['made']
provId = i['provId']
provName = i['provName']
subProvId = i['subProvId']
subProvName = i['subProvName']
hosGoodsCode = i['hosGoodsCode']
subSendFlag = i['subSendFlag']
areaName = i['areaName']
hosId = i['hosId']
break
deptid1 = FileUtils().r_info8('b2_herp3_bs', '所有科室id', 'message6')["deptid1"]
deptName = FileUtils().r_info8('b2_herp3_bs', '所有科室name', 'message6')["deptid1"]
# # 请求体
request_body = commonFuc().get_business_data(module, "payload19", areaCode, UTid, createTime, UTid, hosId,
stockId,
areaCode, areaName, shelfCode, codeType, tagType, hosGoodsId,
mdmGoodsCode, goodsCode, goodsDi, barName, batchCode, expdtDate,
productDate, pkgCode, pkgCodeSee, ssccCode, tbStatus,
distrDetailId,
distrBillId, purBillId, pkgDefQty, pkgDefId, pkgDefName, purMode,
goodsMfrsName, goodsSpec, unit, goodsName, pkgDefId, pkgDefQty,
pkgDefName, printNum, made, provId, provName, subProvId,
subProvName,
hosGoodsCode, subSendFlag, onlyKey, areaName, hosId,
get_branch_id(),
deptid1, deptName, stockId)
print('request_body', 'ccccccc', request_body)
# # # # 发送请求 print('expected', expected)
result = commonFuc().http_post(url, request_body, headers) print('aaaaaaaaaaaaaaaaa')
print('result', result) actual_value1 = get_process_list2(actual)
PICK_ID = commonFuc().analysis_json('data', result) expected_value1 = get_process_list2(expected)
# =====================出库复核列表查询获取pickid=============== actual_value2 = actual_value1.replace(" ", "")
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module, expected_value2 = expected_value1.replace(" ", "")
"herpService_pick_return_page_url") # print('actual_value2',actual_value2)
print('url', url) print('expected_value2')
request_body = commonFuc().get_business_data(module, "payload20", get_branch_id(), get_hosid(), deptid1) print(expected_value2)
# # # # 发送请求 print('actual_value2')
result = commonFuc().http_post(url, request_body, headers) print(actual_value2)
print('result', result) print(compare_text_index(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')
def check_mcms_pick_detail(pid,type,order_no):
branch_id = get_branch_id()
print('拣货单子表检查')
sql = " select * from mcms_pick_detail where pid='%s';" % (
pid)
actual = check_mcms_dept_buy_sql(sql)
print(actual)
id=get_id("select id from mcms_pick_detail where pid='%s';" % ( pid))
source_id=get_buyBillId(branch_id,type)
if type == 16:
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"]
elif type == 20:
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message1')["hosGoodsId"]
else:
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message3')["hosGoodsId"]
mdm_goods_code=get_mdm_goods_code1(hos_goods_id)
goods_code=get_goods_code1(hos_goods_id)
pkg_def_id=get_pkg_def_id(hos_goods_id)
picker_name=FileUtils().r_info8("b2_herp3_bs", "用户名信息", 'message3')['username1']
picker=get_login_user_uxid_bydb(picker_name)
create_user=picker
create_time=get_create_time("select create_time from mcms_pick_detail where pid='%s';" % (pid))
last_modified=get_create_time("select last_modified from mcms_pick_detail where pid='%s';" % (pid))
last_modified_user=create_user
if type == 16:
# =====================出库复核列表查询获取pickid=============== expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
# =======================查看出库单详细信息=============== 'mcms_pick_detail1', id,pid,order_no,source_id,hos_goods_id
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module, ,mdm_goods_code,goods_code,pkg_def_id,picker,picker_name,
"herpService_pick_checkReview_url") create_user,create_time,last_modified,last_modified_user
url = url + ' '.join(PICK_ID) + '?pickedFlag=true'
print('url', url)
# # # # 发送请求
result = commonFuc().http_get(url, headers)
print('查看出库单详细信息result', result)
# =======================查看出库单详细信息===============
# ========================扫码复核
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module,
"herpService_stock_hdiBarcode_scan_url")
url = url + pkgCode
print('url', url)
# # # # 发送请求
result = commonFuc().http_get(url, headers)
print('扫码复核result', result)
data = commonFuc().analysis_json('data', result)
UT_id = commonFuc().analysis_json('id', data)
createTime = commonFuc().analysis_json('createTime', data)
snCode = commonFuc().analysis_json('snCode', data)
tbStatus = commonFuc().analysis_json('tbStatus', data)
print(UT_id)
# ========================扫码复核
# ========出库复核提交==========
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module,
"herpService_stock_review_pass_submit_url")
print('url', url) )
sourceId = ' '.join(PICK_ID) elif type == 20:
# 请求体 pkg_def_id=None
request_body = commonFuc().get_business_data(module, "payload21", UT_id, createTime, snCode, hosId, stockId, expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
areaCode, areaName, shelfCode, codeType, tagType, hosGoodsId, 'mcms_pick_detail2', id,pid,order_no,source_id,hos_goods_id
mdmGoodsCode, goodsCode, goodsDi, barName, batchCode, expdtDate, ,mdm_goods_code,goods_code,pkg_def_id,picker,picker_name,
productDate, pkgCode, pkgCodeSee, ssccCode, tbStatus, create_user,create_time,last_modified,last_modified_user
distrDetailId,
distrBillId, purBillId, pkgDefQty, pkgDefId, pkgDefName, purMode,
goodsMfrsName, goodsSpec, unit, goodsName, pkgDefId, pkgDefQty,
pkgDefName, made, hosGoodsCode, sourceId)
print('request_body', request_body)
# # # # 发送请求
result = commonFuc().http_post(url, request_body, headers)
print('herpService_stock_review_pass_submit_urlresult', result)
# ========出库复核提交
elif type == 3:
print('试剂产品退库出库')
module = "b5_spd3_core_business_flow"
# # 登录获取用户id等信息,使用创建的用户登录===========开始
info = FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3')
username = info['username1']
password = commonFuc().get_business_data("b2_herp3_bs", "password")
print('username,password', username, password)
# # 获取token和projectCode
token, projectCode, uxid, corpId, info = login(username, password, 2)
# 登录获取用户id等信息,使用创建的用户登录============结束
# 到库房明细查询,查询产品的udi码
get_udi(3)
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module, "herpService_pick_submit_url")
print('url', url)
headers = commonFuc().get_business_data(module, "json_headers2",
commonFuc().get_business_data(module, "json_contentType"), token,
commonFuc().get_business_data(module, "X-APP-CODE"))
# 从文件中获取必要信息
info = FileUtils().r_info8(module, "条码信息", 'message18')
# print('info', info)
list_a = info['list_a']
# print('list_a', list_a[0], type(list_a), len(list_a))
UTid = 'UT'
areaCode = 'areaCode'
createTime = 'createTime'
hosId = 'hosId'
stockId = 'stockId'
areaCode = 'areaCode'
areaName = 'areaName'
shelfCode = 'shelfCode'
codeType = 'codeType'
tagType = 'tagType'
hosGoodsId = 'hosGoodsId'
mdmGoodsCode = 'mdmGoodsCode'
goodsCode = 'goodsCode'
goodsDi = 'goodsDi'
barName = 'barName'
batchCode = 'batchCode'
expdtDate = 'expdtDate'
productDate = 'productDate'
pkgCode = 'pkgCode'
pkgCodeSee = 'pkgCodeSee'
ssccCode = 'ssccCode'
tbStatus = 'tbStatus'
pkgDefQty = 'pkgDefQty'
purBillId = 'purBillId'
distrBillId = 'distrBillId'
inStockTime = 'inStockTime'
distrDetailId = 'distrDetailId'
purMode = 'purMode'
goodsMfrsName = 'goodsMfrsName'
goodsSpec = 'goodsSpec'
unit = 'unit'
goodsName = 'goodsName'
printNum = 'printNum'
made = 'made'
provId = 'provId'
provName = 'provName'
subProvId = 'subProvId'
subProvName = 'subProvName'
hosGoodsCode = 'hosGoodsCode'
subSendFlag = 'subSendFlag'
onlyKey = 'onlyKey'
pkgDefId = 'pkgDefId'
pkgDefName = 'pkgDefName'
print('aaaaaaaaaaaaaaaaaaaaaaaaa', list_a[0])
list_b = list_a[0]
for i in list_b:
print(i)
UTid = i['id']
areaCode = i['areaCode']
createTime = i['createTime']
hosId = i['hosId']
stockId = i['stockId']
areaCode = i['areaCode']
areaName = i['areaName']
shelfCode = i['shelfCode']
codeType = i['codeType']
tagType = i['tagType']
hosGoodsId = i['hosGoodsId']
mdmGoodsCode = i['mdmGoodsCode']
goodsCode = i['goodsCode']
goodsDi = i['goodsDi']
barName = i['barName']
batchCode = i['batchCode']
expdtDate = i['expdtDate']
productDate = i['productDate']
pkgCode = i['pkgCode']
pkgCodeSee = i['pkgCodeSee']
ssccCode = i['ssccCode']
tbStatus = i['tbStatus']
onlyKey = i['hosGoodsId']
ext = i['ext']
print('ext', ext)
distrDetailId = ext['distrDetailId']
distrBillId = ext['distrBillId']
purBillId = ext['purBillId']
pkgDefQty = ext['pkgDefQty']
pkgDefId = ext['pkgDefId']
pkgDefName = ext['pkgDefName']
purMode = i['purMode']
goodsMfrsName = i['goodsMfrsName']
goodsSpec = i['goodsSpec']
unit = i['unit']
goodsName = i['goodsName']
pkgDefId = i['pkgDefId']
pkgDefQty = i['pkgDefQty']
pkgDefName = i['pkgDefName']
printNum = i['printNum']
made = i['made']
provId = i['provId']
provName = i['provName']
subProvId = i['subProvId']
subProvName = i['subProvName']
hosGoodsCode = i['hosGoodsCode']
subSendFlag = i['subSendFlag']
areaName = i['areaName']
hosId = i['hosId']
break
deptid1 = FileUtils().r_info8('b2_herp3_bs', '所有科室id', 'message6')["deptid1"]
deptName = FileUtils().r_info8('b2_herp3_bs', '所有科室name', 'message6')["deptid1"]
# # 请求体
request_body = commonFuc().get_business_data(module, "payload19", areaCode, UTid, createTime, UTid, hosId,
stockId,
areaCode, areaName, shelfCode, codeType, tagType, hosGoodsId,
mdmGoodsCode, goodsCode, goodsDi, barName, batchCode, expdtDate,
productDate, pkgCode, pkgCodeSee, ssccCode, tbStatus,
distrDetailId,
distrBillId, purBillId, pkgDefQty, pkgDefId, pkgDefName, purMode,
goodsMfrsName, goodsSpec, unit, goodsName, pkgDefId, pkgDefQty,
pkgDefName, printNum, made, provId, provName, subProvId,
subProvName,
hosGoodsCode, subSendFlag, onlyKey, areaName, hosId,
get_branch_id(),
deptid1, deptName, stockId)
print('request_body', 'ccccccc', request_body)
# # # # 发送请求 )
result = commonFuc().http_post(url, request_body, headers) else:
print('result', result) expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
PICK_ID = commonFuc().analysis_json('data', result) 'mcms_pick_detail3', id,pid,order_no,source_id,hos_goods_id
# =====================出库复核列表查询获取pickid=============== ,mdm_goods_code,goods_code,pkg_def_id,picker,picker_name,
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module, create_user,create_time,last_modified,last_modified_user
"herpService_pick_return_page_url")
print('url', url)
request_body = commonFuc().get_business_data(module, "payload20", get_branch_id(), get_hosid(), deptid1)
# # # # 发送请求
result = commonFuc().http_post(url, request_body, headers)
print('result', result)
# =====================出库复核列表查询获取pickid=============== )
# =======================查看出库单详细信息===============
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module,
"herpService_pick_checkReview_url")
url = url + ' '.join(PICK_ID) + '?pickedFlag=true'
print('url', url)
# # # # 发送请求
result = commonFuc().http_get(url, headers)
print('查看出库单详细信息result', result)
# =======================查看出库单详细信息===============
# ========================扫码复核
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module,
"herpService_stock_hdiBarcode_scan_url")
url = url + pkgCode
print('url', url)
# # # # 发送请求
result = commonFuc().http_get(url, headers)
print('扫码复核result', result)
data = commonFuc().analysis_json('data', result)
UT_id = commonFuc().analysis_json('id', data)
createTime = commonFuc().analysis_json('createTime', data)
snCode = commonFuc().analysis_json('snCode', data)
tbStatus = commonFuc().analysis_json('tbStatus', data)
print(UT_id)
# ========================扫码复核
# ========出库复核提交==========
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module,
"herpService_stock_review_pass_submit_url")
print('url', url) print('expected', expected)
sourceId = ' '.join(PICK_ID) print('aaaaaaaaaaaaaaaaa')
# 请求体 actual_value1 = get_process_list2(actual)
request_body = commonFuc().get_business_data(module, "payload21", UT_id, createTime, snCode, hosId, stockId, expected_value1 = get_process_list2(expected)
areaCode, areaName, shelfCode, codeType, tagType, hosGoodsId, actual_value2 = actual_value1.replace(" ", "")
mdmGoodsCode, goodsCode, goodsDi, barName, batchCode, expdtDate, expected_value2 = expected_value1.replace(" ", "")
productDate, pkgCode, pkgCodeSee, ssccCode, tbStatus, # print('actual_value2',actual_value2)
distrDetailId, print('expected_value2')
distrBillId, purBillId, pkgDefQty, pkgDefId, pkgDefName, purMode, print(expected_value2)
goodsMfrsName, goodsSpec, unit, goodsName, pkgDefId, pkgDefQty, print('actual_value2')
pkgDefName, made, hosGoodsCode, sourceId) print(actual_value2)
print('request_body', request_body) print(compare_text_index(actual_value2, expected_value2))
# # # # 发送请求 if actual_value2 == expected_value2:
result = commonFuc().http_post(url, request_body, headers) print('ok')
print('herpService_stock_review_pass_submit_urlresult', result) commonFuc().check_text_exist_result_text('succees', 'succees')
# ========出库复核提交 else:
print('error')
commonFuc().check_text_exist_result_text('error', 'succees')
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_c0流程十七退货业务_中心库退供应商.air')
using(pro_path + r'//air_case/b5_spd3_core_business_flow/a_c0流程十七退货业务_中心库退供应商.air')
from a_c0流程十七退货业务_中心库退供应商 import center_Stock_return_Out
try: try:
updateUserLoginDefaultRange(get_listUserMgrRangePage1(1)) # 设置登录账号默认权限是二级库 # updateUserLoginDefaultRange(get_listUserMgrRangePage1(1)) #设置登录账号默认权限是1级库
second_center_Stock_return_Out(2) #高值耗材退货出库 # center_Stock_return_Out(2) #高值耗材退货出库
second_center_Stock_return_Out(1) #低值耗材退货出库 # time.sleep(6)
second_center_Stock_return_Out(3) #试剂耗材退货出库 check_mcms_psi_out(2)#检查出库单主表和子表
check_mcms_pick(20) #检查拣货单主表和子表
center_Stock_return_Out(1) #低值耗材退货出库
time.sleep(6)
check_mcms_psi_out(1)
center_Stock_return_Out(3) #试剂耗材退货出库
time.sleep(6)
check_mcms_psi_out(3)
commonFuc().check_text_exist_result_text('succees', 'succees') commonFuc().check_text_exist_result_text('succees', 'succees')
except Exception as e: except Exception as e:
# 打印错误信息 # 打印错误信息
print(f"发生错误: {e}") print(f"发生错误: {e}")
commonFuc().check_text_exist_result_text('error', 'SUCCESS') commonFuc().check_text_exist_result_text('error', 'SUCCESS')
\ No newline at end of file
...@@ -2060,7 +2060,8 @@ def get_stockAreaId_new_fromDb(deptName, type=1): ...@@ -2060,7 +2060,8 @@ def get_stockAreaId_new_fromDb(deptName, type=1):
# 中心库房名称 # 中心库房名称
branch_name = FileUtils().r_info(module, '院区新增')["branch_name"] branch_name = FileUtils().r_info(module, '院区新增')["branch_name"]
stockId = get_stockId_fromdb(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: elif type == 2:
stockId = get_stockId_fromdb(deptName + '库房') stockId = get_stockId_fromdb(deptName + '库房')
...@@ -2072,7 +2073,6 @@ def get_stockAreaId_new_fromDb(deptName, type=1): ...@@ -2072,7 +2073,6 @@ def get_stockAreaId_new_fromDb(deptName, type=1):
# 获取库房id==========结束============ # 获取库房id==========结束============
# ====获取库区id===== 开始========== # ====获取库区id===== 开始==========
sql = "select shelf_code from mcms_stock_shelf where stock_Id='%s'and address='%s';" % (stockId, deptName) sql = "select shelf_code from mcms_stock_shelf where stock_Id='%s'and address='%s';" % (stockId, deptName)
print(sql) print(sql)
shelfCode = get_id(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