Commit 538f5e78 authored by xiao-hesheng's avatar xiao-hesheng
Browse files

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

parent 72a51632
...@@ -1386,31 +1386,16 @@ def check_hdi_distr_detail(distr_main_key, type, purchase_id): ...@@ -1386,31 +1386,16 @@ def check_hdi_distr_detail(distr_main_key, type, purchase_id):
create_time, last_modified, last_modified_user) create_time, last_modified, last_modified_user)
else: else:
expected=None expected=None
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')
comparison_result(actual,expected)
def check_mcms_check(type=1): def check_mcms_check(type=1):
print('检查验收单数据库写值') print('检查验收单数据库写值')
check_no=FileUtils().r_info8('b5_spd3_core_business_flow', '验收单号', 'message15') check_no=FileUtils().r_info8('b5_spd3_core_business_flow', '验收单号', 'message15')['CHECK_NO1']
sql = "select * from mcms_check where id = '%s';" % check_no sql = "select * from mcms_check where id = '%s';" % check_no
# 获取实际值 # 获取实际值
actual = check_mcms_pur_plan_sql(sql) actual = check_mcms_pur_plan_sql(sql)
print('actual', actual) print('actual', actual)
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check','mcms_check', check_no)
try: try:
...@@ -1454,6 +1439,7 @@ try: ...@@ -1454,6 +1439,7 @@ try:
# check_mcms_dept_buy_approval_after(int(i)) # check_mcms_dept_buy_approval_after(int(i))
# mcms_dept_buy_detail_approval_after(int(i)) # mcms_dept_buy_detail_approval_after(int(i))
# #
# time.sleep(20)
# # 检查自动生成的采购计划数据 # # 检查自动生成的采购计划数据
# list_data = ['16', '20', '66'] # list_data = ['16', '20', '66']
# for i in list_data: # for i in list_data:
...@@ -1463,25 +1449,36 @@ try: ...@@ -1463,25 +1449,36 @@ try:
# #
# for i in range(3): # 三个单据共审批3次 # for i in range(3): # 三个单据共审批3次
# approval_center() # approval_center()
# 上面暂时注释========================================= # time.sleep(20)
list_data = ['16', '20', '66'] # list_data = ['16', '20', '66']
for i in list_data: # for i in list_data:
check_mcms_purchase(int(i)) # check_mcms_purchase(int(i))
#
#检查同步到外网的采购订单数据跟内网的是否一致 # #检查同步到外网的采购订单数据跟内网的是否一致
check_mcms_purchase_out_and_in(1) # check_mcms_purchase_out_and_in(1)
check_mcms_purchase_out_and_in(2) # print('检查同步到外网的采购订单数据跟内网的是否一致')
order_dp(1) # 1低值 # check_mcms_purchase_out_and_in(2)
order_dp(2) # 2高值 # order_dp(1) # 1低值
order_dp(3) # 3试剂 # time.sleep(6)
# order_dp(2) # 2高值
list_data = ['16', '20', '66'] # time.sleep(6)
for i in list_data: # order_dp(3) # 3试剂
check_hdi_distr(int(i)) # time.sleep(6)
# time.sleep(20)
# list_data = ['16', '20', '66']
# for i in list_data:
# check_hdi_distr(int(i))
#上面调通了
# 上面暂时注释========================================
# check_accept_order(1) # 低值 # check_accept_order(1) # 低值
# check_mcms_check(1)#调用函数检查验收单数据库写值
# check_mcms_check(1)#调用函数检查验收单数据库写值
check_accept_order(2) # 高值
check_accept_order(3) # 试剂
#这里验收后会自动生成入库单,批次信息,需要同步验证入库单和批次信息
#根据验收单号到mcms_psi表查询入库单
# #
# check_accept_order(2) # 高值 # check_accept_order(2) # 高值
# check_accept_order(3) # 试剂 # check_accept_order(3) # 试剂
......
...@@ -3464,4 +3464,23 @@ def get_login_user_uxid2(): ...@@ -3464,4 +3464,23 @@ def get_login_user_uxid2():
# print(username, password,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') # print(username, password,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
# 获取token和projectCode # 获取token和projectCode
token1, projectCode1, uxid1, corpId1, info1 = login(username, password,1) token1, projectCode1, uxid1, corpId1, info1 = login(username, password,1)
return uxid1 return uxid1
\ No newline at end of file
def comparison_result(actual,expected):
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')
\ No newline at end of file
...@@ -52,3 +52,6 @@ ...@@ -52,3 +52,6 @@
"hdi_distr_detail": '{"id": "%s", "pid": "%s", "source_id": "%s", "source_detail_id": "%s", "pur_detail_id": "%s", "hos_goods_id": "%s", "mdm_goods_code": "%s", "goods_code": "%s", "goods_name": "%s", "goods_gg": "%s", "pur_mode": "10", "mfrs_id": "%s", "mfrs_name": "德国歌德公司 Geuder AG", "made": "德国", "unit": "支", "pur_price": Decimal("99.999900"), "batch_code": "333", "expdt_date": %s, "product_date": %s, "pkg_def_id": "%s", "pkg_def_name": "100", "pkg_def_qty": Decimal("100.00"), "supply_id": "%s", "sub_prov_id": "%s", "sub_prov_name": "%s", "sub_price": Decimal("99.9999"), "distr_price": Decimal("99.9999"), "distr_pkg_qty": Decimal("1.00"), "distr_qty": Decimal("100.00"), "settlement": 1, "certificate_code": "", "product_cert_code": None, "detail_relation_json": "{"planBillId":"%s","buyDetailId":"%s","planDetailId":"%s","purDetailId":"%s","purBillId":"%s","distrDetailId":"%s","distrBillId":"%s"}", "ext_info": "{"goodsGg":"%s","goodsCode":"%s","purMode":10,"goodsName":"%s","ygptCode":"","transCond":"","storageCond":"","erpCode":"%s","ybDefId":""}", "tb_status": 0, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0, "del_flag": 0}' "hdi_distr_detail": '{"id": "%s", "pid": "%s", "source_id": "%s", "source_detail_id": "%s", "pur_detail_id": "%s", "hos_goods_id": "%s", "mdm_goods_code": "%s", "goods_code": "%s", "goods_name": "%s", "goods_gg": "%s", "pur_mode": "10", "mfrs_id": "%s", "mfrs_name": "德国歌德公司 Geuder AG", "made": "德国", "unit": "支", "pur_price": Decimal("99.999900"), "batch_code": "333", "expdt_date": %s, "product_date": %s, "pkg_def_id": "%s", "pkg_def_name": "100", "pkg_def_qty": Decimal("100.00"), "supply_id": "%s", "sub_prov_id": "%s", "sub_prov_name": "%s", "sub_price": Decimal("99.9999"), "distr_price": Decimal("99.9999"), "distr_pkg_qty": Decimal("1.00"), "distr_qty": Decimal("100.00"), "settlement": 1, "certificate_code": "", "product_cert_code": None, "detail_relation_json": "{"planBillId":"%s","buyDetailId":"%s","planDetailId":"%s","purDetailId":"%s","purBillId":"%s","distrDetailId":"%s","distrBillId":"%s"}", "ext_info": "{"goodsGg":"%s","goodsCode":"%s","purMode":10,"goodsName":"%s","ygptCode":"","transCond":"","storageCond":"","erpCode":"%s","ybDefId":""}", "tb_status": 0, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0, "del_flag": 0}'
"hdi_distr_detail2": '{"id": "%s", "pid": "%s", "source_id": "%s", "source_detail_id": "%s", "pur_detail_id": "%s", "hos_goods_id": "%s", "mdm_goods_code": "%s", "goods_code": "%s", "goods_name": "%s", "goods_gg": "%s", "pur_mode": "20", "mfrs_id": "%s", "mfrs_name": "德国歌德公司 Geuder AG", "made": "德国", "unit": "支", "pur_price": Decimal("99.999900"), "batch_code": "222", "expdt_date": %s, "product_date": %s, "pkg_def_id": %s, "pkg_def_name": null, "pkg_def_qty": Decimal("1.00"), "supply_id": "%s", "sub_prov_id": "%s", "sub_prov_name": "%s", "sub_price": Decimal("99.9999"), "distr_price": Decimal("99.9999"), "distr_pkg_qty": Decimal("1.00"), "distr_qty": Decimal("1.00"), "settlement": 1, "certificate_code": "", "product_cert_code": None, "detail_relation_json": "{"planBillId":"%s","buyDetailId":"%s","planDetailId":"%s","purDetailId":"%s","purBillId":"%s","distrDetailId":"%s","distrBillId":"%s"}", "ext_info": "{"goodsGg":"%s","goodsCode":"%s","purMode":20,"goodsName":"%s","ygptCode":"","transCond":"","storageCond":"","erpCode":"%s","ybDefId":""}", "tb_status": 0, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0, "del_flag": 0}' "hdi_distr_detail2": '{"id": "%s", "pid": "%s", "source_id": "%s", "source_detail_id": "%s", "pur_detail_id": "%s", "hos_goods_id": "%s", "mdm_goods_code": "%s", "goods_code": "%s", "goods_name": "%s", "goods_gg": "%s", "pur_mode": "20", "mfrs_id": "%s", "mfrs_name": "德国歌德公司 Geuder AG", "made": "德国", "unit": "支", "pur_price": Decimal("99.999900"), "batch_code": "222", "expdt_date": %s, "product_date": %s, "pkg_def_id": %s, "pkg_def_name": null, "pkg_def_qty": Decimal("1.00"), "supply_id": "%s", "sub_prov_id": "%s", "sub_prov_name": "%s", "sub_price": Decimal("99.9999"), "distr_price": Decimal("99.9999"), "distr_pkg_qty": Decimal("1.00"), "distr_qty": Decimal("1.00"), "settlement": 1, "certificate_code": "", "product_cert_code": None, "detail_relation_json": "{"planBillId":"%s","buyDetailId":"%s","planDetailId":"%s","purDetailId":"%s","purBillId":"%s","distrDetailId":"%s","distrBillId":"%s"}", "ext_info": "{"goodsGg":"%s","goodsCode":"%s","purMode":20,"goodsName":"%s","ygptCode":"","transCond":"","storageCond":"","erpCode":"%s","ybDefId":""}", "tb_status": 0, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0, "del_flag": 0}'
"hdi_distr_detail3": '{"id": "%s", "pid": "%s", "source_id": "%s", "source_detail_id": "%s", "pur_detail_id": "%s", "hos_goods_id": "%s", "mdm_goods_code": "%s", "goods_code": "%s", "goods_name": "%s", "goods_gg": "%s", "pur_mode": "60", "mfrs_id": "%s", "mfrs_name": "德国歌德公司 Geuder AG", "made": "德国", "unit": "支", "pur_price": Decimal("99.999900"), "batch_code": "4444", "expdt_date": %s, "product_date": %s, "pkg_def_id": "%s", "pkg_def_name": "100", "pkg_def_qty": Decimal("100.00"), "supply_id": "%s", "sub_prov_id": "%s", "sub_prov_name": "%s", "sub_price": Decimal("99.9999"), "distr_price": Decimal("99.9999"), "distr_pkg_qty": Decimal("1.00"), "distr_qty": Decimal("100.00"), "settlement": 1, "certificate_code": "", "product_cert_code": None, "detail_relation_json": "{"planBillId":"%s","buyDetailId":"%s","planDetailId":"%s","purDetailId":"%s","purBillId":"%s","distrDetailId":"%s","distrBillId":"%s"}", "ext_info": "{"goodsGg":"%s","goodsCode":"%s","purMode":60,"goodsName":"%s","ygptCode":"","transCond":"","storageCond":"","erpCode":"%s","ybDefId":""}", "tb_status": 0, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0, "del_flag": 0}' "hdi_distr_detail3": '{"id": "%s", "pid": "%s", "source_id": "%s", "source_detail_id": "%s", "pur_detail_id": "%s", "hos_goods_id": "%s", "mdm_goods_code": "%s", "goods_code": "%s", "goods_name": "%s", "goods_gg": "%s", "pur_mode": "60", "mfrs_id": "%s", "mfrs_name": "德国歌德公司 Geuder AG", "made": "德国", "unit": "支", "pur_price": Decimal("99.999900"), "batch_code": "4444", "expdt_date": %s, "product_date": %s, "pkg_def_id": "%s", "pkg_def_name": "100", "pkg_def_qty": Decimal("100.00"), "supply_id": "%s", "sub_prov_id": "%s", "sub_prov_name": "%s", "sub_price": Decimal("99.9999"), "distr_price": Decimal("99.9999"), "distr_pkg_qty": Decimal("1.00"), "distr_qty": Decimal("100.00"), "settlement": 1, "certificate_code": "", "product_cert_code": None, "detail_relation_json": "{"planBillId":"%s","buyDetailId":"%s","planDetailId":"%s","purDetailId":"%s","purBillId":"%s","distrDetailId":"%s","distrBillId":"%s"}", "ext_info": "{"goodsGg":"%s","goodsCode":"%s","purMode":60,"goodsName":"%s","ygptCode":"","transCond":"","storageCond":"","erpCode":"%s","ybDefId":""}", "tb_status": 0, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0, "del_flag": 0}'
"mcms_check": '{"id": "CHECKh03472024071800038", "order_no": "YS240718038", "bill_mode": "16", "hos_id": "h0347", "branch_id": "h0347-3755", "source_id": "PSh0347202407180060", "source_no": "PSh0347202407180060", "source_type": "PSD", "tb_status": 20, "prov_id": "p1e35e", "prov_name": "国药集团公司S57ui", "rec_org_id": "b12c7c6ca56e4b46b418b319cbadbea5", "rec_org_name": "二级检验科002", "dept_id": "b12c7c6ca56e4b46b418b319cbadbea5", "dept_name": "二级检验科002", "bill_relation_json": "{"buyBillId":"Bh03472024071800077","planBillId":"Ph034720240718029854","planOrderNo":"PLAN2024071833209","buyOrderNo":"BUY2024071809575","purOrderNo":"CG2024071821688","purBillId":"Ch034720240718000123","purBillDate":"2024-07-18 18:48:22","distrBillId":"PSh0347202407180060","distrOrderNo":"PSh0347202407180060","checkBillId":"CHECKh03472024071800038","checkOrderNo":"YS240718038"}", "create_user": "h0347_UID-051420", "create_time": datetime.datetime(2024, 7, 18, 18, 50, 20), "last_modified": datetime.datetime(2024, 7, 18, 18, 50, 20), "last_modified_user": "h0347_UID-051420", "version": 1, "initial_order": None, "remark": ""}'
\ 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