From 18efab2ac4b5512ff7acf65da877efb667d14c4b Mon Sep 17 00:00:00 2001 From: xiao-hesheng Date: Mon, 8 Jul 2024 17:47:24 +0800 Subject: [PATCH] =?UTF-8?q?=E8=84=9A=E6=9C=AC=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...56\345\272\223\351\252\214\350\257\201.py" | 127 +++++++++--------- data/b5_spd3_core_business_flow/message21 | 28 ++-- .../data | 2 +- 3 files changed, 82 insertions(+), 75 deletions(-) diff --git "a/air_case/b6_spd3_core_business_flow_database_check/a_b3\346\265\201\347\250\213\345\215\201\350\257\267\351\242\206\344\270\232\345\212\241\346\265\201_\344\272\214\347\272\247\345\272\223\345\220\221\350\276\271\344\273\223_\346\225\260\346\215\256\345\272\223\351\252\214\350\257\201.air/a_b3\346\265\201\347\250\213\345\215\201\350\257\267\351\242\206\344\270\232\345\212\241\346\265\201_\344\272\214\347\272\247\345\272\223\345\220\221\350\276\271\344\273\223_\346\225\260\346\215\256\345\272\223\351\252\214\350\257\201.py" "b/air_case/b6_spd3_core_business_flow_database_check/a_b3\346\265\201\347\250\213\345\215\201\350\257\267\351\242\206\344\270\232\345\212\241\346\265\201_\344\272\214\347\272\247\345\272\223\345\220\221\350\276\271\344\273\223_\346\225\260\346\215\256\345\272\223\351\252\214\350\257\201.air/a_b3\346\265\201\347\250\213\345\215\201\350\257\267\351\242\206\344\270\232\345\212\241\346\265\201_\344\272\214\347\272\247\345\272\223\345\220\221\350\276\271\344\273\223_\346\225\260\346\215\256\345\272\223\351\252\214\350\257\201.py" index 7a3f222d..5203caae 100644 --- "a/air_case/b6_spd3_core_business_flow_database_check/a_b3\346\265\201\347\250\213\345\215\201\350\257\267\351\242\206\344\270\232\345\212\241\346\265\201_\344\272\214\347\272\247\345\272\223\345\220\221\350\276\271\344\273\223_\346\225\260\346\215\256\345\272\223\351\252\214\350\257\201.air/a_b3\346\265\201\347\250\213\345\215\201\350\257\267\351\242\206\344\270\232\345\212\241\346\265\201_\344\272\214\347\272\247\345\272\223\345\220\221\350\276\271\344\273\223_\346\225\260\346\215\256\345\272\223\351\252\214\350\257\201.py" +++ "b/air_case/b6_spd3_core_business_flow_database_check/a_b3\346\265\201\347\250\213\345\215\201\350\257\267\351\242\206\344\270\232\345\212\241\346\265\201_\344\272\214\347\272\247\345\272\223\345\220\221\350\276\271\344\273\223_\346\225\260\346\215\256\345\272\223\351\252\214\350\257\201.air/a_b3\346\265\201\347\250\213\345\215\201\350\257\267\351\242\206\344\270\232\345\212\241\346\265\201_\344\272\214\347\272\247\345\272\223\345\220\221\350\276\271\344\273\223_\346\225\260\346\215\256\345\272\223\351\252\214\350\257\201.py" @@ -21,65 +21,70 @@ python runner_test.py tag id2303-13 debug mdm3 """ -def check_mcms_dept_buy(type): - if type == 1: # 低值 +def check_mcms_dept_buy(type=1): + hos_goods_id='hos_goods_id' + if type==1: hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"] - branch_id = get_branch_id() - # 获取每次都会变化的字段create_time的值 - create_time = get_create_time( - "select create_time from mcms_dept_buy_car where branch_id='%s'and hos_goods_id='%s';" % ( - branch_id, hos_goods_id)) - print('create_time',create_time) - id = get_id( - "select id from mcms_dept_buy_car where branch_id='%s'and hos_goods_id='%s';" % (branch_id, hos_goods_id)) - print('id',id) - create_user = get_id( - "select create_user from mcms_dept_buy_car where branch_id='%s'and hos_goods_id='%s' LIMIT 1;" % ( - branch_id, hos_goods_id)) - print('create_time', create_time, 'id', id) - sql = """select * from mcms_dept_buy_car where branch_id='%s' and hos_goods_id='%s' LIMIT 1; - """ % (branch_id, hos_goods_id) - actual_value1 = check_mcms_dept_buy_car(sql) - print(actual_value1) - deptid2 = FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid2'] - deptname2 = FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid2'] - areaCode = get_stockAreaId_new(deptid2, deptname2, 2) - areaName = '默认库区' - # 读取文件中的信息 - info = FileUtils().r_info8('b5_spd3_core_business_flow', "二级库请领产品信息", 'message21') - list_a = info['list_a'] - mdm_goods_code = commonFuc().analysis_json('mdmGoodsCode', list_a) - pur_mode = commonFuc().analysis_json('purMode', list_a) - goodsCode = commonFuc().analysis_json('goodsCode', list_a) - pkgDefId = commonFuc().analysis_json('pkgDefId', list_a) - pkgDefName = commonFuc().analysis_json('pkgDefName', list_a) - last_modified_user = create_user - last_modified = create_time - # print('actual_value1',actual_value1) - actual_value2 = get_process_list2(actual_value1) - # print('actual_value2') - # print( actual_value2) - # prov_hos_goods_id = '8d6273b7bca84dd8aace12b9422d7fd6' - expected_value2 = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', - 'check_mcms_dept_buy_car', id, get_hosid(), branch_id, deptid2, - deptname2, areaCode, areaName, hos_goods_id, mdm_goods_code, - goodsCode, pkgDefId, pkgDefName - , create_user, create_time, last_modified, last_modified_user) - # print('expected_value2', expected_value2) - # expected_value2=get_process_list2(expected_value2) - actual_value2 = actual_value2.replace(" ", "") - expected_value2 = expected_value2.replace(" ", "") - # print('actual_value2',actual_value2) - print('expected_value2') - print(expected_value2) - print('actual_value2') - print(actual_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') + elif type==2: + hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message1')["hosGoodsId"] + + branch_id = get_branch_id() + # 获取每次都会变化的字段create_time的值 + create_time = get_create_time( + "select create_time from mcms_dept_buy_car where branch_id='%s'and hos_goods_id='%s';" % ( + branch_id, hos_goods_id)) + print('create_time',create_time) + id = get_id( + "select id from mcms_dept_buy_car where branch_id='%s'and hos_goods_id='%s';" % (branch_id, hos_goods_id)) + print('id',id) + create_user = get_id( + "select create_user from mcms_dept_buy_car where branch_id='%s'and hos_goods_id='%s' LIMIT 1;" % ( + branch_id, hos_goods_id)) + print('create_time', create_time, 'id', id) + sql = """select * from mcms_dept_buy_car where branch_id='%s' and hos_goods_id='%s' LIMIT 1; + """ % (branch_id, hos_goods_id) + actual_value1 = check_mcms_dept_buy_car(sql) + print(actual_value1) + deptid2 = FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid2'] + deptname2 = FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid2'] + areaCode = get_stockAreaId_new(deptid2, deptname2, 2) + areaName = '默认库区' + # 读取文件中的信息 + info = FileUtils().r_info8('b5_spd3_core_business_flow', "二级库请领产品信息", 'message21') + list_a = info['list_a'] + mdm_goods_code = commonFuc().analysis_json('mdmGoodsCode', list_a) + pur_mode = commonFuc().analysis_json('purMode', list_a) + goodsCode = commonFuc().analysis_json('goodsCode', list_a) + pkgDefId = commonFuc().analysis_json('pkgDefId', list_a) + pkgDefName = commonFuc().analysis_json('pkgDefName', list_a) + last_modified_user = create_user + last_modified = create_time + # print('actual_value1',actual_value1) + actual_value2 = get_process_list2(actual_value1) + # print('actual_value2') + # print( actual_value2) + # prov_hos_goods_id = '8d6273b7bca84dd8aace12b9422d7fd6' + expected_value2 = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', + 'check_mcms_dept_buy_car', id, get_hosid(), branch_id, deptid2, + deptname2, areaCode, areaName, hos_goods_id, mdm_goods_code, + goodsCode,pur_mode, pkgDefId, pkgDefName + , create_user, create_time, last_modified, last_modified_user) + # print('expected_value2', expected_value2) + # expected_value2=get_process_list2(expected_value2) + actual_value2 = actual_value2.replace(" ", "") + expected_value2 = expected_value2.replace(" ", "") + # print('actual_value2',actual_value2) + print('expected_value2') + print(expected_value2) + print('actual_value2') + print(actual_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') + try: @@ -105,9 +110,11 @@ try: second_dept_Request(FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message2')['hosGoodsId'], 1) check_mcms_dept_buy(1) # # # 高值 - # second_dept_Request(FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message1')['hosGoodsId'], 2) + second_dept_Request(FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message1')['hosGoodsId'], 2) + check_mcms_dept_buy(2) # # # 试剂 - # second_dept_Request(FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message3')['hosGoodsId'], 3) + second_dept_Request(FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message3')['hosGoodsId'], 3) + check_mcms_dept_buy(3) # BuyCarSubmit() # 请领车提交 # for i in range(6): # 三个单据共审批6次 # approval_center() diff --git a/data/b5_spd3_core_business_flow/message21 b/data/b5_spd3_core_business_flow/message21 index f7e18f26..3f53d291 100644 --- a/data/b5_spd3_core_business_flow/message21 +++ b/data/b5_spd3_core_business_flow/message21 @@ -1,26 +1,26 @@ 二级库请领产品信息: list_a: - &id001 - - hosGoodsId: h034700004500 - purMode: 10 + - hosGoodsId: h034700004499 + purMode: 20 grantRule: id: - goodsName: 一次性注射器_低值wExpg + goodsName: 高值牙钻机PFKHm goodsSpec: G-31891 - mdmGoodsCode: '11661453' - goodsCode: '00004500' + mdmGoodsCode: '11661452' + goodsCode: '00004499' unit: 支 goodsMfrsName: 德国歌德公司 Geuder AG miDjmc: '' miCode: '' - pkgDefName: '100' - pkgDefQty: 100.0 + pkgDefName: + pkgDefQty: 1.0 pkgQty: - qty: 500.0 + qty: 5.0 goodsImg: [] - pkgDefId: 34b26233759a4720920cc8328dd1f8d1 + pkgDefId: buyPkgQty: - unitName: 100支/100 + unitName: 1支 price: 99.9999 hosId: branchId: @@ -37,12 +37,12 @@ grantWay: 2 deptGoodsStatus: codingType: 0 - purModeText: 低值耗材 - goodsGeneralName: 一次性注射器 + purModeText: 高值耗材 + goodsGeneralName: 牙钻机 provName: 国药集团公司^n1@F noRecPkgQty: 15.0 - noRecQty: 1500.0 - autoUnpack: 0 + noRecQty: 15.0 + autoUnpack: consumeQty: consumePkgQty: list_b: diff --git a/data/b6_spd3_core_business_flow_database_check/data b/data/b6_spd3_core_business_flow_database_check/data index 6957cdd4..c2085182 100644 --- a/data/b6_spd3_core_business_flow_database_check/data +++ b/data/b6_spd3_core_business_flow_database_check/data @@ -1 +1 @@ -"check_mcms_dept_buy_car": '{"id": "%s", "hos_id": "%s", "branch_id": "%s", "dept_id": "%s", "dept_name": "%s", "area_code": "%s", "area_name": "%s", "hos_goods_id": "%s", "mdm_goods_code": "%s", "goods_code": "%s", "pur_mode": 10, "pkg_def_id": "%s", "pkg_def_name": "%s", "pkg_def_qty": Decimal("100.00"), "buy_pkg_qty": Decimal("1.00"), "buy_qty": Decimal("100.00"), "tb_status": 0, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0, "coding_type": 0}' \ No newline at end of file +"check_mcms_dept_buy_car": '{"id": "%s", "hos_id": "%s", "branch_id": "%s", "dept_id": "%s", "dept_name": "%s", "area_code": "%s", "area_name": "%s", "hos_goods_id": "%s", "mdm_goods_code": "%s", "goods_code": "%s", "pur_mode": %s, "pkg_def_id": "%s", "pkg_def_name": "%s", "pkg_def_qty": Decimal("100.00"), "buy_pkg_qty": Decimal("1.00"), "buy_qty": Decimal("100.00"), "tb_status": 0, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0, "coding_type": 0}' \ No newline at end of file -- GitLab