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

流程十六脚本提交

parent 36bc5231
......@@ -7,7 +7,8 @@ from air_case.public1.public1.public1 import *
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_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
from common.fileUtls import FileUtils
from common.run_cmd_script import execute_command
......@@ -55,10 +56,10 @@ def check_mcms_psi_out(type=1):
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)
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)
......@@ -71,14 +72,9 @@ def check_mcms_psi_out(type=1):
pickOrderNo = get_PICK_order_no(branch_id, bill_mode)
pickBillId = get_PICK_id(branch_id, bill_mode)
planBillId = get_planBillId(hos_goods_id)
psiDeptOutBillId = 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, bill_mode))
psiDeptOutOrderNo = get_id(
"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;" % (
branch_id, bill_mode))
psiInBillId = id
psiInOrderNo = order_no
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)
......@@ -98,38 +94,38 @@ def check_mcms_psi_out(type=1):
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_psi1_1', 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,
psiDeptOutBillId, psiDeptOutOrderNo, psiInBillId, psiInOrderNo,
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_psi1_2', 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,
psiDeptOutBillId, psiDeptOutOrderNo, psiInBillId, psiInOrderNo,
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_psi1_3', 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,
psiDeptOutBillId, psiDeptOutOrderNo, psiInBillId, psiInOrderNo,
psiOutBillId, psiOutOrderNo,
create_user
, create_time, last_modified, last_modified_user)
# 对比预期值和实际值是否一致
......@@ -167,8 +163,8 @@ def check_mcms_psi_batch_out(DR_ID, type, order_no, source_id1):
batch_main_key = get_id("select id from mcms_psi_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 = source_id1 + '0001'
pick_detail_id = None
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:
......@@ -199,27 +195,27 @@ def check_mcms_psi_batch_out(DR_ID, type, order_no, source_id1):
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
last_modified_user = create_user
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,
'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
)
elif type == 2:
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'mcms_psi_batch_in1_2', batch_main_key, pid, order_no, source_detail_id
, hos_goods_id, mdm_goods_code, goods_code, source_batch_id,
'mcms_psi_batch_out1_2', 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_batch_in1_3', batch_main_key, pid, order_no, source_detail_id
, hos_goods_id, mdm_goods_code, goods_code, source_batch_id,
'mcms_psi_batch_out1_3', 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
......@@ -252,12 +248,16 @@ using(pro_path + r'//air_case/b5_spd3_core_business_flow/a_c0流程十七退货
from a_c0流程十七退货业务_中心库退供应商 import center_Stock_return_Out
try:
updateUserLoginDefaultRange(get_listUserMgrRangePage1(1)) #设置登录账号默认权限是1级库
center_Stock_return_Out(2) #高值耗材退货出库
time.sleep(6)
# updateUserLoginDefaultRange(get_listUserMgrRangePage1(1)) #设置登录账号默认权限是1级库
# center_Stock_return_Out(2) #高值耗材退货出库
# time.sleep(6)
check_mcms_psi_out(2)
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')
except Exception as e:
# 打印错误信息
......
......@@ -215,3 +215,12 @@
"mcms_psi_batch_in1_1": '{"id":"%s","pid":"%s","order_no":"%s","source_detail_id":"%s","pick_detail_id":null,"pur_mode":10,"hos_goods_id":"%s","mdm_goods_code":"%s","goods_code":"%s","source_batch_id":"%s","target_batch_id":"%s","psi_price":Decimal("99.999900"),"qty":Decimal("100.00"),"unit_name":"100支/100","barcode_id":"%s","sub_barcode_id":null,"shelf_code":"%s-2-01-01","settle_flag":0,"tb_status":0,"pur_task_id":null,"create_user":"%s","create_time":%s,"last_modified":%s,"last_modified_user":%s,"version":0}'
"mcms_psi_batch_in1_2": '{"id":"%s","pid":"%s","order_no":"%s","source_detail_id":"%s","pick_detail_id":null,"pur_mode":20,"hos_goods_id":"%s","mdm_goods_code":"%s","goods_code":"%s","source_batch_id":"%s","target_batch_id":"%s","psi_price":Decimal("99.999900"),"qty":Decimal("1.00"),"unit_name":"1支","barcode_id":"%s","sub_barcode_id":null,"shelf_code":"%s-2-01-01","settle_flag":0,"tb_status":0,"pur_task_id":null,"create_user":"%s","create_time":%s,"last_modified":%s,"last_modified_user":%s,"version":0}'
"mcms_psi_batch_in1_3": '{"id":"%s","pid":"%s","order_no":"%s","source_detail_id":"%s","pick_detail_id":null,"pur_mode":60,"hos_goods_id":"%s","mdm_goods_code":"%s","goods_code":"%s","source_batch_id":"%s","target_batch_id":"%s","psi_price":Decimal("99.999900"),"qty":Decimal("100.00"),"unit_name":"100支/100","barcode_id":"%s","sub_barcode_id":null,"shelf_code":"%s-2-01-01","settle_flag":0,"tb_status":0,"pur_task_id":null,"create_user":"%s","create_time":%s,"last_modified":%s,"last_modified_user":%s,"version":0}'
#中心库退供应商子表
"mcms_psi_batch_out1_1": '{"id":"%s","pid":"%s","order_no":"%s","source_detail_id":"%s","pick_detail_id":"%s","pur_mode":10,"hos_goods_id":"%s","mdm_goods_code":"%s","goods_code":"%s","source_batch_id":"%s","target_batch_id":"%s","psi_price":Decimal("99.999900"),"qty":Decimal("100.00"),"unit_name":"100支/100","barcode_id":"%s","sub_barcode_id":null,"shelf_code":"%s-2-01-01","settle_flag":1,"tb_status":0,"pur_task_id":null,"create_user":"%s","create_time":%s,"last_modified":%s,"last_modified_user":"%s","version":0}'
"mcms_psi_batch_out1_2": '{"id":"%s","pid":"%s","order_no":"%s","source_detail_id":"%s","pick_detail_id":"%s","pur_mode":20,"hos_goods_id":"%s","mdm_goods_code":"%s","goods_code":"%s","source_batch_id":"%s","target_batch_id":"%s","psi_price":Decimal("99.999900"),"qty":Decimal("1.00"),"unit_name":"1支","barcode_id":"%s","sub_barcode_id":null,"shelf_code":"%s-2-01-01","settle_flag":1,"tb_status":0,"pur_task_id":null,"create_user":"%s","create_time":%s,"last_modified":%s,"last_modified_user":"%s","version":0}'
"mcms_psi_batch_out1_3": '{"id":"%s","pid":"%s","order_no":"%s","source_detail_id":"%s","pick_detail_id":"%s","pur_mode":60,"hos_goods_id":"%s","mdm_goods_code":"%s","goods_code":"%s","source_batch_id":"%s","target_batch_id":"%s","psi_price":Decimal("99.999900"),"qty":Decimal("100.00"),"unit_name":"100支/100","barcode_id":"%s","sub_barcode_id":null,"shelf_code":"%s-2-01-01","settle_flag":1,"tb_status":0,"pur_task_id":null,"create_user":"%s","create_time":%s,"last_modified":%s,"last_modified_user":"%s","version":0}'
#中心库退供应商主表
"check_mcms_psi_out_1_1": '{"id": "%s", "order_no": "%s", "bill_mode": "16", "rec_type": "YND", "psi_flag": -1, "psi_kind": "299", "stock_kind": "CK_TH", "target_corp_id": "%s", "target_branch_id": %s, "target_dept_id": "%s", "target_dept_name": "%s", "target_stock_id": "%s", "target_area_code": %s, "target_area_name":null , "source_id": "%s", "source_no": %s, "source_repl_id": %s, "source_corp_id": "%s", "source_branch_id": "%s", "source_dept_id": "%s", "source_dept_name": "%s", "source_stock_id": "%s", "source_area_code": "%s", "source_area_name": "自动化测试", "remark": "", "tb_status": 30, "accounter": "%s", "account_date": %s, "bill_relation_json": "{"pickOrderNo":"%s","pickBillId":"%s","psiOutBillId":"%s","psiOutOrderNo":"%s"}", "reject_time": None, "reject_remark": None, "create_user": "%s","create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 1, "last_auditor": None, "last_audit_time": None, "reject_user": None, "initial_order": None, "source_type": "SG", "reject_reason": None, "receipt_status": 0}'
"check_mcms_psi_out_1_2": '{"id": "%s", "order_no": "%s", "bill_mode": "20", "rec_type": "YND", "psi_flag": -1, "psi_kind": "299", "stock_kind": "CK_TH", "target_corp_id": "%s", "target_branch_id": %s, "target_dept_id": "%s", "target_dept_name": "%s", "target_stock_id": "%s", "target_area_code": %s, "target_area_name":null, "source_id": "%s", "source_no": %s, "source_repl_id": %s, "source_corp_id": "%s", "source_branch_id": "%s", "source_dept_id": "%s", "source_dept_name": "%s", "source_stock_id": "%s", "source_area_code": "%s", "source_area_name": "自动化测试", "remark": "", "tb_status": 30, "accounter": "%s", "account_date": %s, "bill_relation_json": "{"pickOrderNo":"%s","pickBillId":"%s","psiOutBillId":"%s","psiOutOrderNo":"%s"}", "reject_time": None, "reject_remark": None, "create_user": "%s","create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 1, "last_auditor": None, "last_audit_time": None, "reject_user": None, "initial_order": None, "source_type": "SG", "reject_reason": None, "receipt_status": 0}'
"check_mcms_psi_out_1_3": '{"id": "%s", "order_no": "%s", "bill_mode": "66", "rec_type": "YND", "psi_flag": -1, "psi_kind": "299", "stock_kind": "CK_TH", "target_corp_id": "%s", "target_branch_id": %s, "target_dept_id": "%s", "target_dept_name": "%s", "target_stock_id": "%s", "target_area_code": %s, "target_area_name":null, "source_id": "%s", "source_no": %s, "source_repl_id": %s, "source_corp_id": "%s", "source_branch_id": "%s", "source_dept_id": "%s", "source_dept_name": "%s", "source_stock_id": "%s", "source_area_code": "%s", "source_area_name": "自动化测试", "remark": "", "tb_status": 30, "accounter": "%s", "account_date": %s, "bill_relation_json": "{"pickOrderNo":"%s","pickBillId":"%s","psiOutBillId":"%s","psiOutOrderNo":"%s"}", "reject_time": None, "reject_remark": None, "create_user": "%s","create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 1, "last_auditor": None, "last_audit_time": None, "reject_user": None, "initial_order": None, "source_type": "SG", "reject_reason": None, "receipt_status": 0}'
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