Commit dfbd0aba authored by xiao-hesheng's avatar xiao-hesheng
Browse files

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

parent ad2dbe99
......@@ -725,6 +725,10 @@ def check_mcms_purchase(type=16):
branch_id, type,id1)
print(sql)
order_no= process_tuple(get_dept_buy_id(sql))
sql = "select id from mcms_dept_buy where branch_id='%s' and bill_mode='%s' order by create_time desc LIMIT 1;" % (
branch_id, type)
print(sql)
buyBillId = process_tuple(get_dept_buy_id(sql))
# 要验证的数据sql
sql1 = "select * from mcms_purchase where branch_id='%s' and bill_mode='%s' and id='%s' order by create_time desc LIMIT 1;" % (
......@@ -734,7 +738,6 @@ def check_mcms_purchase(type=16):
print('actual', actual)
hos_id = get_hosid()
dept_id1 = FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid1']
dept_name1 = FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid1']
dept_name2 = FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid2']
......@@ -752,26 +755,45 @@ def check_mcms_purchase(type=16):
branch_id, id1)
print(sql)
bill_expdt_date = get_expdt_date(sql)
buyBillId = id1
planBillId = id2
buyOrderNo = buyOrderNo1
create_user = rec_user
create_time = get_create_time(
"select create_time from mcms_pur_plan where branch_id='%s' and source_id='%s' order by create_time desc LIMIT 1;" % (
branch_id, id1))
last_modified = create_time
last_modified_user = create_user
planOrderNo = PLAN_order_no
if type == 16:
# 验证子表数据
# check_mcms_mcms_pur_plan_detail(id2, type, planOrderNo)
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"]
planBillId = process_tuple(
get_id("select pid from mcms_pur_plan_detail where hos_goods_id='%s' order by create_time desc LIMIT 1;" % (
hos_goods_id)))
planOrderNo= process_tuple(
get_id("select order_no from mcms_pur_plan_detail where hos_goods_id='%s' order by create_time desc LIMIT 1;" % (
hos_goods_id)))
sql = "select order_no from mcms_dept_buy where branch_id='%s' and bill_mode='%s' order by create_time desc LIMIT 1;" % (
branch_id, type)
print(sql)
buyOrderNo=process_tuple(get_dept_buy_id(sql))
purOrderNo=order_no
purBillId=id1
prov_id = FileUtils().r_info8('b5_spd3_core_business_flow', '供货关系申请2', 'message')["e_corpId"]
prov_name = FileUtils().r_info8('b5_spd3_core_business_flow', '供货关系申请2', 'message')["e_username"]
exe_prov_id = prov_id
exe_prov_name=prov_name
close_date=get_create_time(
"select create_time from mcms_pur_plan where id='%s';" % (
id1))
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'mcms_purchase', id1, order_no, hos_id,
get_branch_id(), dept_id1, dept_name1, rec_org_id, rec_org_name,
area_code, area_name, source_id, rec_user,
rec_addr, bill_expdt_date, buyBillId, planBillId, planOrderNo,
buyOrderNo,
create_user, create_time, last_modified, last_modified_user)
area_code, area_name, bill_expdt_date,source_id, rec_user,
rec_addr, prov_id,prov_name,exe_prov_id,exe_prov_name, buyBillId, planBillId, planOrderNo,
buyOrderNo,purOrderNo,purBillId,close_date,create_user,create_time,last_modified,last_auditor,last_audit_time
)
# elif type == 20:
# check_mcms_mcms_pur_plan_detail(id2, type, planOrderNo)
# expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
......
......@@ -36,4 +36,4 @@
"mcms_pur_plan_detail3": '{"id": "%s", "pid": "%s", "order_no": "%s", "source_id": "%s", "hos_goods_id": "%s", "mdm_goods_code": "%s", "goods_code": "%s", "pur_mode": 60, "pkg_def_id": "%s", "pkg_def_name": "100", "pkg_def_qty": Decimal("100.00"), "plan_pkg_qty": Decimal("1.00"), "plan_qty": Decimal("100.00"), "pkg_qty": Decimal("1.00"), "price": Decimal("99.999900"), "qty": Decimal("100.00"), "in_settlement": None, "supply_id": "%s", "prov_id": "%s", "prov_name": "%s", "sub_send_flag": 10, "sub_prov_id": "%s", "sub_prov_name": "%s", "contract_id": None, "remark": None, "close_status": 0, "tb_status": 10, "pur_task_id": None, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0, "coding_type": 0}'
"mcms_purchase": '{"id": "%s", "order_no": "%s", "bill_mode": "16", "rec_type": "HDI", "hos_id": "h0347", "branch_id": "h0347-3755", "dept_id": "63c734f07fcc422ea80f49ca8e5bbd95", "dept_name": "设备科001", "rec_org_id": "b12c7c6ca56e4b46b418b319cbadbea5", "rec_org_name": "二级检验科002", "area_code": "areah03472781", "area_name": "默认库区", "bill_expdt_date": datetime.datetime(2024, 8, 16, 0, 0), "source_id": "Ph034720240716029571", "source_type": "CGJH", "in_settlement": None, "rec_user": "自动化测试w&vqF", "rec_phone": "None", "rec_addr": "自动化测试", "prov_id": "p1e35e", "prov_name": "国药集团公司S57ui", "sub_send_flag": 10, "exe_prov_id": "p1e35e", "exe_prov_name": "国药集团公司S57ui", "bill_relation_json": "{"buyBillId":"Bh03472024071600022","planBillId":"Ph034720240716029571","planOrderNo":"PLAN2024071632926","buyOrderNo":"BUY2024071609399","purOrderNo":"CG2024071621466","purBillId":"Ch034720240716000019"}", "ext_info": "{"epidemicFlag":0,"purMode":10}", "barcode_flag": 1, "pkg_flag": 1, "remark": "", "priority": 0, "close_status": 0, "close_date": datetime.datetime(2024, 7, 17, 15, 20, 54), "up_status": 0, "tb_status": 30, "create_user": "h0347_UID-051420", "create_time": datetime.datetime(2024, 7, 16, 15, 20, 54), "last_modified": datetime.datetime(2024, 7, 16, 15, 20, 54), "last_modified_user": None, "version": 0, "del_flag": 0, "last_auditor": "自动化测试w&vqF", "last_audit_time": datetime.datetime(2024, 7, 16, 15, 20, 54)}'
\ No newline at end of file
"mcms_purchase": '{"id": "%s", "order_no": "%s", "bill_mode": "16", "rec_type": "HDI", "hos_id": "%s", "branch_id": "%s", "dept_id": "%s", "dept_name": "%s", "rec_org_id": "%s", "rec_org_name": "%s", "area_code": "%s", "area_name": "%s", "bill_expdt_date": %s, "source_id": "%s", "source_type": "CGJH", "in_settlement": None, "rec_user": "%s", "rec_phone": "None", "rec_addr": "%s", "prov_id": "%s", "prov_name": "%s", "sub_send_flag": 10, "exe_prov_id": "%s", "exe_prov_name": "%s", "bill_relation_json": "{"buyBillId":"%s","planBillId":"%s","planOrderNo":"%s","buyOrderNo":"%s","purOrderNo":"%s","purBillId":"%s"}", "ext_info": "{"epidemicFlag":0,"purMode":10}", "barcode_flag": 1, "pkg_flag": 1, "remark": "", "priority": 0, "close_status": 0, "close_date": %s, "up_status": 0, "tb_status": 30, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": None, "version": 0, "del_flag": 0, "last_auditor": "%s", "last_audit_time": %s}'
\ 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