Commit 2bdf50c7 authored by xiao-hesheng's avatar xiao-hesheng
Browse files

数据库验证流程十二脚本编写

parent df5f27a1
......@@ -9,8 +9,8 @@ from common.db.sql.sql_tools import get_create_time, check_mcms_dept_buy_car_sql
check_mcms_dept_buy_sql, get_mdm_goods_code, get_expdt_date, check_mcms_pur_plan_sql, check_in_check_mcms_purchase, \
get_expdt_date1, process_date, get_mdm_goods_code1, get_goods_code1, get_goods_name, get_goods_gg, \
get_goods_mfrs_id, get_supply_id, check_mcms_pur_sql, check_source_id, get_pkg_def_id, get_buyBillId, \
get_planBillId, get_planOrderNo, get_buyOrderNo, get_purOrderNo, get_purBillId, get_purBillDate, get_distrBillId, \
get_distrOrderNo, get_distr_detail_id, get_ext_info, get_login_user_uxid_bydb
get_planBillId, get_planOrderNo, get_buyOrderNo, get_purOrderNo, get_purBillId, get_distrBillId, \
get_distrOrderNo, get_distr_detail_id, get_ext_info, get_login_user_uxid_bydb, get_purBillDate, get_purBillDate2
from common.db.sql.sql_tools_out import check_out_check_mcms_purchase
from common.fileUtls import FileUtils
......@@ -1621,11 +1621,11 @@ def check_mcms_psi(type=1):
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 = target_dept_name + "中心库房"
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 = FileUtils().r_info8('b5_spd3_core_business_flow', '验收单号', 'message15')['CHECK_NO1']
source_no = get_id("select order_no from mcms_check where id = '%s';" % source_id)
source_no = get_distrBillId(branch_id,bill_mode)
source_repl_id = source_no
source_corp_id = FileUtils().r_info8('b5_spd3_core_business_flow', '供货关系申请2', 'message')["e_corpId"]
source_dept_id = source_corp_id
......@@ -1634,7 +1634,7 @@ def check_mcms_psi(type=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, type)
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:
......@@ -1646,18 +1646,20 @@ def check_mcms_psi(type=1):
buyOrderNo = get_buyOrderNo(branch_id, bill_mode)
purOrderNo = get_purOrderNo(branch_id, bill_mode)
purBillId = get_purBillId(branch_id, bill_mode)
purBillDate = get_purBillDate(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
checkOrderNo = source_no
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 == 16:
if type == 1:
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', 'check_mcms_psi1', id,
order_no, target_corp_id, target_branch_id, target_dept_id,
target_dept_name, target_stock_id
......@@ -1668,7 +1670,7 @@ def check_mcms_psi(type=1):
, purBillDate, distrBillId, distrOrderNo, checkBillId, checkOrderNo,
psiInBillId, psiInOrderNo, create_user
, create_time, last_modified, last_modified_user)
elif type == 20:
elif type == 2:
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', 'mcms_check_batch1', id,
......
......@@ -354,16 +354,19 @@ def get_planOrderNo(hos_goods_id):
"select order_no from spd3_herp_test2.mcms_pur_plan_detail where hos_goods_id='%s' order by create_time desc LIMIT 1;" % (
hos_goods_id)))
def get_purBillDate(branch_id,bill_mode):
def get_ext_info(branch_id,bill_mode):
distr_main_key = get_id(
"select id from hdi_distr a where branch_id = '%s' and bill_mode='%s' order by create_time desc LIMIT 1;" % (
branch_id, bill_mode))
bill_relation_json = get_id(
"select bill_relation_json from hdi_distr a where id = '%s' and bill_mode='%s' order by create_time desc LIMIT 1;" % (
ext_info = get_id(
"select ext_info from hdi_distr a where id = '%s' and bill_mode='%s' order by create_time desc LIMIT 1;" % (
distr_main_key, bill_mode))
# print(bill_relation_json)
return bill_relation_json
def get_ext_info(branch_id,bill_mode):
return ext_info
def get_purBillDate(branch_id,bill_mode):
distr_main_key = get_id(
"select id from hdi_distr a where branch_id = '%s' and bill_mode='%s' order by create_time desc LIMIT 1;" % (
branch_id, bill_mode))
......@@ -372,7 +375,15 @@ def get_ext_info(branch_id,bill_mode):
distr_main_key, bill_mode))
# print(bill_relation_json)
return ext_info
def get_purBillDate2(branch_id,bill_mode):
main_key = get_id(
"select id from mcms_psi a where target_branch_id = '%s' and bill_mode='%s' order by create_time desc LIMIT 1;" % (
branch_id, bill_mode))
bill_relation_json = get_id(
"select bill_relation_json from mcms_psi a where id = '%s' and bill_mode='%s' order by create_time desc LIMIT 1;" % (
main_key, bill_mode))
# print(bill_relation_json)
return bill_relation_json
def get_distrBillId(branch_id,bill_mode):
distr_main_key = get_id(
"select id from hdi_distr a where branch_id = '%s' and bill_mode='%s' order by create_time desc LIMIT 1;" % (
......
......@@ -105,4 +105,4 @@
"mcms_psi_dept_batch_in3": '{"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", "settle_flag": 0, "psi_price": Decimal("99.9999"), "qty": Decimal("100.00"), "unit_name": "100支/100", "barcode_id": "%s", "sub_barcode_id": None, "shelf_code": "%s-A-01-01", "tb_status": 0, "charge_flag": null, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0}'
#中心库入库单
"check_mcms_psi1": '{"id": "%s", "order_no": "%s", "bill_mode": "16", "rec_type": "YND", "psi_flag": 1, "psi_kind": "101", "stock_kind": "RK_YS", "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": "默认库区", "source_id": "%s", "source_no": "%s", "source_repl_id": "%s", "source_corp_id": "%s", "source_branch_id": None, "source_dept_id": "%s", "source_dept_name": "%s", "source_stock_id": "%s", "source_area_code": None, "source_area_name": None, "remark": None, "tb_status": 30, "accounter": "%s", "account_date": %s, "bill_relation_json": "{"buyBillId":"%s","planBillId":"%s","planOrderNo":"%s","buyOrderNo":"%s","purOrderNo":"%s","purBillId":"%s","purBillDate":"%s","distrBillId":"%s","distrOrderNo":"%s","checkBillId":"%s","checkOrderNo":"%s","psiInBillId":"%s","psiInOrderNo":"%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": "BD", "reject_reason": None, "receipt_status": 0}'
\ No newline at end of file
"check_mcms_psi1": '{"id": "%s", "order_no": "%s", "bill_mode": "16", "rec_type": "YND", "psi_flag": 1, "psi_kind": "101", "stock_kind": "RK_YS", "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": "默认库区", "source_id": "%s", "source_no": "%s", "source_repl_id": "%s", "source_corp_id": "%s", "source_branch_id": None, "source_dept_id": "%s", "source_dept_name": "%s", "source_stock_id": "%s", "source_area_code": None, "source_area_name": None, "remark": None, "tb_status": 30, "accounter": "%s", "account_date": %s, "bill_relation_json": "{"buyBillId":"%s","planBillId":"%s","planOrderNo":"%s","buyOrderNo":"%s","purOrderNo":"%s","purBillId":"%s","purBillDate":"%s","distrBillId":"%s","distrOrderNo":"%s","checkBillId":"%s","checkOrderNo":"%s","psiInBillId":"%s","psiInOrderNo":"%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": "BD", "reject_reason": None, "receipt_status": 0}'
\ No newline at end of file
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