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

流程十四脚本编写

parent 3d24daa5
...@@ -203,14 +203,99 @@ def check_mcms_psi_dept_batch(DR_ID,type,order_no): ...@@ -203,14 +203,99 @@ def check_mcms_psi_dept_batch(DR_ID,type,order_no):
print('error') print('error')
commonFuc().check_text_exist_result_text('error', 'succees') commonFuc().check_text_exist_result_text('error', 'succees')
def check_mcms_psi_dept_in(type1=16): def check_mcms_psi_dept_batch_in(DR_ID,type,order_no):
branch_id = get_branch_id() branch_id = get_branch_id()
sql = " select * from mcms_psi_dept_batch where pid='%s';" % (
DR_ID)
actual = check_mcms_dept_buy_sql(sql)
print('actual', actual)
batch_main_key = get_id("select id from mcms_psi_dept_batch where pid='%s';" % DR_ID)
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,type)
pick_detail_id=source_detail_id
sql = " select * from mcms_psi_dept where target_branch_id='%s' and bill_mode='%s' and stock_kind='CK_LYTK' order by CREATE_TIME desc LIMIT 1;" % ( 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)
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')['deptid3']
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
)
print('expected', expected)
print('aaaaaaaaaaaaaaaaa')
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)
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_psi_dept_in(type1=16):
branch_id = get_branch_id()
sql = " select * from mcms_psi_dept where target_branch_id='%s' and bill_mode='%s' and stock_kind='RK_LYTK' order by CREATE_TIME desc LIMIT 1;" % (
branch_id, type1) branch_id, type1)
actual = check_mcms_dept_buy_sql(sql) actual = check_mcms_dept_buy_sql(sql)
print(actual) 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_LYTK' order by CREATE_TIME desc LIMIT 1;" % ( DR_ID=get_id(" select id from mcms_psi_dept where target_branch_id='%s' and bill_mode='%s' and stock_kind='RK_LYTK' order by CREATE_TIME desc LIMIT 1;" % (
branch_id, type1)) branch_id, type1))
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
order_no = get_id(sql) order_no = get_id(sql)
...@@ -242,7 +327,7 @@ def check_mcms_psi_dept_in(type1=16): ...@@ -242,7 +327,7 @@ def check_mcms_psi_dept_in(type1=16):
account_date = process_tuple(get_create_time("select account_date from mcms_psi_dept where id='%s';" % DR_ID)) account_date = process_tuple(get_create_time("select account_date from mcms_psi_dept where id='%s';" % DR_ID))
if type1 == 16: if type1 == 16:
# 子表检查 # 子表检查
check_mcms_psi_dept_batch(DR_ID,type1,order_no) check_mcms_psi_dept_batch_in(DR_ID,type1,order_no)
target_area_code = None target_area_code = None
accounter = None accounter = None
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
...@@ -256,7 +341,7 @@ def check_mcms_psi_dept_in(type1=16): ...@@ -256,7 +341,7 @@ def check_mcms_psi_dept_in(type1=16):
) )
elif type1 == 20: elif type1 == 20:
# 子表检查 # 子表检查
check_mcms_psi_dept_batch(DR_ID,type1,order_no) check_mcms_psi_dept_batch_in(DR_ID,type1,order_no)
target_area_code=None target_area_code=None
accounter=None accounter=None
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
...@@ -268,7 +353,7 @@ def check_mcms_psi_dept_in(type1=16): ...@@ -268,7 +353,7 @@ def check_mcms_psi_dept_in(type1=16):
, create_user, create_time, last_modified, last_modified_user) , create_user, create_time, last_modified, last_modified_user)
else: else:
# 子表检查 # 子表检查
check_mcms_psi_dept_batch(DR_ID, type1, order_no) check_mcms_psi_dept_batch_in(DR_ID, type1, order_no)
target_area_code = None target_area_code = None
accounter = None accounter = None
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
...@@ -314,13 +399,13 @@ try: ...@@ -314,13 +399,13 @@ try:
# time.sleep(6) # time.sleep(6)
# check_mcms_psi_dept_out(16) # 检查出库单(包括主表和子表) # check_mcms_psi_dept_out(16) # 检查出库单(包括主表和子表)
# second_dept_return_Out_Stock(3) # 试剂耗材退货出库 # second_dept_return_Out_Stock(3) # 试剂耗材退货出库
check_mcms_psi_dept_out(66) # 检查出库单(包括主表和子表) # check_mcms_psi_dept_out(66) # 检查出库单(包括主表和子表)
second_dept_one_key_in(2) # second_dept_one_key_in(2)
second_dept_one_key_in(2) # second_dept_one_key_in(2)
second_dept_one_key_in(2) # second_dept_one_key_in(2)
check_mcms_psi_dept_in(16) # 检查库单(包括主表和子表) check_mcms_psi_dept_in(16) # 检查库单(包括主表和子表)
check_mcms_psi_dept_in(20) # 检查库单(包括主表和子表) check_mcms_psi_dept_in(20) # 检查库单(包括主表和子表)
check_mcms_psi_dept_in(66) # 检查库单(包括主表和子表) check_mcms_psi_dept_in(66) # 检查库单(包括主表和子表)
commonFuc().check_text_exist_result_text('succees', 'succees') commonFuc().check_text_exist_result_text('succees', 'succees')
except Exception as e: except Exception as e:
# 打印错误信息 # 打印错误信息
......
条码信息: 条码信息:
list_a: list_a:
- &id001 - &id001
id: '100000142024080600000552' id: '100000142024080600000751'
snCode: '100000142024080600000552' snCode: '100000142024080600000751'
ssccCode: '010839000192063824' ssccCode: '010839000192083723'
pkgCodeSee: '0137610000047780112408061725021210333241100000142024080600000552' pkgCodeSee: '01376100000477901124080617250212104444241100000142024080600000751'
hosGoodsId: h034700004778 hosGoodsId: h034700004779
hosGoodsCode: '00004778' hosGoodsCode: '00004779'
goodsCode: '00004778' goodsCode: '00004779'
goodsName: 一次性注射器_低值rFp7& goodsName: 新型冠状病毒检测试剂nDxo8
goodsSpec: G-31891 goodsSpec: G-31891
goodsMfrsName: 德国歌德公司 Geuder AG goodsMfrsName: 德国歌德公司 Geuder AG
unit: unit:
purMode: 10 purMode: 60
batchCode: '333' batchCode: '4444'
productDate: '2024-08-06' productDate: '2024-08-06'
expdtDate: '2025-02-12' expdtDate: '2025-02-12'
pkgDefName: '100' pkgDefName: '100'
...@@ -26,13 +26,13 @@ ...@@ -26,13 +26,13 @@
unitName: 100支/100 unitName: 100支/100
shelfCode: areah03472821-A-01-01 shelfCode: areah03472821-A-01-01
shelfNo: A01-A-01-01 shelfNo: A01-A-01-01
pkgDefId: 8abd5ced93ea47728011202ccb7c2168 pkgDefId: 75012af7fbea44af9dd050857dac199f
extInfo: '{"pkgDefId": "8abd5ced93ea47728011202ccb7c2168", "pkgDefQty": 100, "purBillId": extInfo: '{"pkgDefId": "75012af7fbea44af9dd050857dac199f", "pkgDefQty": 100, "purBillId":
"CG2024080622675", "pkgDefName": "100", "distrBillId": "PSh0347202408060023", "CG2024080622677", "pkgDefName": "100", "distrBillId": "PSh0347202408060025",
"inStockTime": "2024-08-07 14:22:33", "distrDetailId": "03840786", "certificateCode": "inStockTime": "2024-08-07 14:22:47", "distrDetailId": "03840788", "certificateCode":
""}' ""}'
bottleId: bottleId:
pkgType: '16' pkgType: '66'
miDjmc: '' miDjmc: ''
miCode: '' miCode: ''
transferRatio: 1.0 transferRatio: 1.0
...@@ -41,13 +41,13 @@ ...@@ -41,13 +41,13 @@
shelfKindName: 普通货位 shelfKindName: 普通货位
provName: 国药集团公司uAfpK provName: 国药集团公司uAfpK
provId: p1e386 provId: p1e386
inStockDate: '2024-08-07 14:22:33' inStockDate: '2024-08-07 14:22:47'
mfrCode: mfrCode:
made: 德国 made: 德国
price: price:
barName: 100支/100 barName: 100支/100
purModeText: 低值耗材 purModeText: 检验试剂
codeType: 16 codeType: 66
list_b: list_b:
- *id001 - *id001
list_c: list_c:
......
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