diff --git "a/air_case/b6_spd3_core_business_flow_database_check/a_c1\346\265\201\347\250\213\345\215\201\345\205\253\344\270\255\345\277\203\345\272\223\344\270\232\345\212\241_\346\213\206\345\214\205\345\212\237\350\203\275_\346\225\260\346\215\256\345\272\223\351\252\214\350\257\201.air/a_c1\346\265\201\347\250\213\345\215\201\345\205\253\344\270\255\345\277\203\345\272\223\344\270\232\345\212\241_\346\213\206\345\214\205\345\212\237\350\203\275_\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_c1\346\265\201\347\250\213\345\215\201\345\205\253\344\270\255\345\277\203\345\272\223\344\270\232\345\212\241_\346\213\206\345\214\205\345\212\237\350\203\275_\346\225\260\346\215\256\345\272\223\351\252\214\350\257\201.air/a_c1\346\265\201\347\250\213\345\215\201\345\205\253\344\270\255\345\277\203\345\272\223\344\270\232\345\212\241_\346\213\206\345\214\205\345\212\237\350\203\275_\346\225\260\346\215\256\345\272\223\351\252\214\350\257\201.py" index db5c266437dac9986623fd6f4ad407fec61335e0..73b0cace69ca27d8f1e18fc3a6862c2c33a77b3b 100644 --- "a/air_case/b6_spd3_core_business_flow_database_check/a_c1\346\265\201\347\250\213\345\215\201\345\205\253\344\270\255\345\277\203\345\272\223\344\270\232\345\212\241_\346\213\206\345\214\205\345\212\237\350\203\275_\346\225\260\346\215\256\345\272\223\351\252\214\350\257\201.air/a_c1\346\265\201\347\250\213\345\215\201\345\205\253\344\270\255\345\277\203\345\272\223\344\270\232\345\212\241_\346\213\206\345\214\205\345\212\237\350\203\275_\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_c1\346\265\201\347\250\213\345\215\201\345\205\253\344\270\255\345\277\203\345\272\223\344\270\232\345\212\241_\346\213\206\345\214\205\345\212\237\350\203\275_\346\225\260\346\215\256\345\272\223\351\252\214\350\257\201.air/a_c1\346\265\201\347\250\213\345\215\201\345\205\253\344\270\255\345\277\203\345\272\223\344\270\232\345\212\241_\346\213\206\345\214\205\345\212\237\350\203\275_\346\225\260\346\215\256\345\272\223\351\252\214\350\257\201.py" @@ -5,6 +5,9 @@ import traceback from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_system 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_dept_buy_sql, get_pick_detail_id, get_mdm_goods_code1, get_goods_code1, \ + get_pkg_def_id, get_login_user_uxid_bydb, check_batch_id, check_barcode_id, get_create_time, get_PICK_id, \ + get_buyBillId, get_PICK_order_no, get_buyOrderNo from common.fileUtls import FileUtils from common.run_cmd_script import execute_command @@ -18,356 +21,316 @@ case_tag:api,b6_spd3_core_business_flow_database_check,a_c1流程十八中心库 核心业务流:a_c1流程十八中心库业务_拆包功能 python runner_test.py tag id2303-21 debug mdm3 """ +def check_mcms_psi_dept_batch(DR_ID,type,order_no): + branch_id = get_branch_id() + sql = " select * from mcms_psi_dept_batch where pid='%s';" % ( + DR_ID) + actual = check_mcms_dept_buy_sql(sql) + print('actual', actual) + batch_main_key = get_id("select id from mcms_psi_dept_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 = get_pick_detail_id(branch_id,type) + pick_detail_id=source_detail_id + if type == 16: + hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"] + elif type == 20: + hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message1')["hosGoodsId"] + else: + hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message3')["hosGoodsId"] + mdm_goods_code = get_mdm_goods_code1(hos_goods_id) + goods_code = get_goods_code1(hos_goods_id) + pkg_def_id = get_pkg_def_id(hos_goods_id) + picker_name = FileUtils().r_info8("b2_herp3_bs", "用户名信息", 'message3')['username1'] + picker = get_login_user_uxid_bydb(picker_name) + source_batch_id=get_id("select source_batch_id from mcms_psi_dept_batch where pid='%s';" % DR_ID) + target_batch_id=source_batch_id + if check_batch_id(source_batch_id)==True: + print('ok') + commonFuc().check_text_exist_result_text('succees', 'succees') + else: + commonFuc().check_text_exist_result_text('error', 'succees') + barcode_id=get_id("select barcode_id from mcms_psi_dept_batch where pid='%s';" % DR_ID) + if check_barcode_id(barcode_id)==True: + print('ok') + commonFuc().check_text_exist_result_text('succees', 'succees') + else: + commonFuc().check_text_exist_result_text('error', 'succees') + dept_name=FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid2'] + shelf_code= get_stockAreaId_new_fromDb(dept_name, 2) + 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_dept_batch where pid='%s';" % DR_ID) + last_modified = get_create_time("select last_modified from mcms_psi_dept_batch where pid='%s';" % DR_ID) + last_modified_user = create_user + if type == 16: + expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', + 'mcms_psi_dept_batch1', 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 -def center_Stock_unpack(type): # 扫码发放(高值不能扫码发放) - module = "b5_spd3_core_business_flow" - # # 登录获取用户id等信息,使用创建的用户登录===========开始 - info = FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3') - username = info['username1'] - password = commonFuc().get_business_data("b2_herp3_bs", "password") - print('username,password', username, password) - # # 获取token和projectCode - token, projectCode, uxid, corpId, info = login(username, password, 2) - # 登录获取用户id等信息,使用创建的用户登录============结束 - # 我要请领_手工请领_列表查询=========================== - headers = commonFuc().get_business_data(module, "json_headers2", - commonFuc().get_business_data(module, "json_contentType"), token, - commonFuc().get_business_data(module, "X-APP-CODE")) + ) + elif type == 20: + expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', + 'mcms_psi_dept_batch2', 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 - if type == 1: - print('低值耗材扫码发放') - module = "b5_spd3_core_business_flow" - # # 登录获取用户id等信息,使用创建的用户登录===========开始 - info = FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3') - username = info['username1'] - password = commonFuc().get_business_data("b2_herp3_bs", "password") - print('username,password', username, password) - # # 获取token和projectCode - token, projectCode, uxid, corpId, info = login(username, password, 2) - # 登录获取用户id等信息,使用创建的用户登录============结束 - # 到库房明细查询,查询产品的udi码 - udi_code = get_udi1(1) - # 扫码==================== - url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module, - "herpService_stock_pick_scan_url") - # 从message18文件中获取信息 - info = FileUtils().r_info8(module, "条码信息", 'message18') - # print('info', info) - list_a = info['list_a'] - stockId = commonFuc().analysis_json('stockId', list_a) - stockName = commonFuc().analysis_json('stockName', list_a) - areaCode = commonFuc().analysis_json('areaCode', list_a) - areaName = commonFuc().analysis_json('areaName', list_a) - deptId2 = FileUtils().r_info8('b2_herp3_bs', '所有科室id', 'message6')["deptid2"] - targetDeptId = FileUtils().r_info8('b2_herp3_bs', '所有科室id', 'message6')["deptid1"] - deptName = get_branch_name() - targetStockId = get_stockId(deptName + '中心库房', 1) + ) + else: + expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', + 'mcms_psi_dept_batch3_1',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 - request_body = commonFuc().get_business_data(module, "payload67", udi_code, stockId, stockName, areaCode, - areaName - ) - print('request_body', request_body) - result = commonFuc().http_post(url, request_body, headers) - print('扫码发放result', result) - price = commonFuc().analysis_json('price', commonFuc().analysis_json('data', result)) - createTime = commonFuc().analysis_json('createTime', commonFuc().analysis_json('data', result)) - hosId = commonFuc().analysis_json('hosId', commonFuc().analysis_json('data', result)) - tbStatus = commonFuc().analysis_json('tbStatus', commonFuc().analysis_json('data', result)) - printNum = commonFuc().analysis_json('printNum', commonFuc().analysis_json('data', result)) - # 扫码======================= - url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module, "herpService_centCbSubmit_url") - print('url', url) - headers = commonFuc().get_business_data(module, "json_headers2", - commonFuc().get_business_data(module, "json_contentType"), token, - commonFuc().get_business_data(module, "X-APP-CODE")) + ) - # 从文件中获取必要信息 - info = FileUtils().r_info8(module, "条码信息", 'message18') - # print('info', info) - list_a = info['list_a'] - # print('list_a', list_a[0], type(list_a), len(list_a)) - UTid = 'UT' - areaCode = 'areaCode' - # createTime = 'createTime' - hosId = 'hosId' - stockId = 'stockId' - areaCode = 'areaCode' - areaName = 'areaName' - shelfCode = 'shelfCode' - codeType = 'codeType' - # tagType = 'tagType' - hosGoodsId = 'hosGoodsId' - mdmGoodsCode = 'mdmGoodsCode' - goodsCode = 'goodsCode' - goodsDi = 'goodsDi' - barName = 'barName' - batchCode = 'batchCode' - expdtDate = 'expdtDate' - productDate = 'productDate' - pkgCode = 'pkgCode' - pkgCodeSee= 'pkgCodeSee' - ssccCode= 'ssccCode' - pkgDefId= 'pkgDefId' - pkgDefQty= 'pkgDefQty' - purBillId= 'purBillId' - pkgDefName= 'pkgDefName' - distrBillId= 'distrBillId' - inStockTime= 'inStockTime' - distrDetailId= 'distrDetailId' - purMode= 'purMode' - goodsMfrsName= 'goodsMfrsName' - goodsSpec= 'goodsSpec' - unit= 'unit' - goodsName= 'goodsName' - made= 'made' - unitName= 'unitName' - hosGoodsCode= 'hosGoodsCode' - purModeText= 'purModeText' - for i in list_a: - print(i) - UTid = i['id'] - areaCode = i['areaCode'] - # createTime = i['createTime'] - # hosId = i['hosId'] - stockId = i['stockId'] - areaCode = i['areaCode'] - areaName = i['areaName'] - shelfCode = i['shelfCode'] - codeType = i['codeType'] - # tagType = i['tagType'] - hosGoodsId = i['hosGoodsId'] - # mdmGoodsCode = i['mdmGoodsCode'] - goodsCode = i['goodsCode'] - # goodsDi = i['goodsDi'] - barName = i['barName'] - batchCode = i['batchCode'] - expdtDate = i['expdtDate'] - productDate = i['productDate'] - # pkgCode = i['pkgCode'] - pkgCodeSee = i['pkgCodeSee'] - ssccCode = i['ssccCode'] - # tbStatus = i['tbStatus'] - onlyKey = i['hosGoodsId'] - ext = i['extInfo'] - print('ext', ext) - distrDetailId = reGetString(ext, r'distrDetailId": "', r'", ') - distrBillId = reGetString(ext, r'distrBillId": "', r'", ') - purBillId = reGetString(ext, r'purBillId": "', r'", ') - pkgDefQty = reGetString(ext, r'pkgDefQty": "', r'", ') - pkgDefId = reGetString(ext, r'pkgDefId": "', r'", ') - pkgDefName = reGetString(ext, r'pkgDefName": "', r'", ') - purMode = i['purMode'] - goodsMfrsName = i['goodsMfrsName'] - goodsSpec = i['goodsSpec'] - unit = i['unit'] - goodsName = i['goodsName'] - pkgDefId = i['pkgDefId'] - pkgDefQty = i['pkgDefQty'] - pkgDefName = i['pkgDefName'] - # printNum = i['printNum'] - made = i['made'] - # provId = i['provId'] - # provName = i['provName'] - # subProvId = i['subProvId'] - # subProvName = i['subProvName'] - hosGoodsCode = i['hosGoodsCode'] - # subSendFlag = i['subSendFlag'] - areaName = i['areaName'] - # hosId = i['hosId'] - unitName = i['unitName'] - purModeText = i['purModeText'] - extInfo = i['extInfo'] - inStockTime = reGetString(extInfo, r'inStockTime": "', r'",') - break - deptid1 = FileUtils().r_info8('b2_herp3_bs', '所有科室id', 'message6')["deptid1"] - deptName = FileUtils().r_info8('b2_herp3_bs', '所有科室name', 'message6')["deptid1"] - # # 请求体 - request_body = commonFuc().get_business_data(module, "payload68", stockId, stockName, areaCode, areaName, UTid, - createTime, UTid, hosId, - stockId, - areaCode, areaName, shelfCode, codeType, hosGoodsId, - mdmGoodsCode, goodsCode, goodsDi, barName, batchCode, expdtDate, - productDate, pkgCode, pkgCodeSee, ssccCode, tbStatus, pkgDefId, - pkgDefQty, - purBillId, pkgDefName, distrBillId, inStockTime,distrDetailId, - purMode, price, - goodsMfrsName, goodsSpec, unit, goodsName, pkgDefId, pkgDefQty, - pkgDefName, printNum, made, unitName, hosGoodsCode, purModeText,tbStatus) - print('request_body', 'ccccccc', request_body) - # # # # 发送请求 - result = commonFuc().http_post(url, request_body, headers) - print('result', result) + print('expected', expected) + print('aaaaaaaaaaaaaaaaa') + 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) + print(compare_text_index(actual_value2, expected_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') +def check_mcms_psi_dept_out_and_in(type1=16,type2=10): + branch_id = get_branch_id() + if type1==20: + sql = " select * from mcms_psi_dept where target_branch_id='%s' and bill_mode='%s' and stock_kind='CK_XH' order by CREATE_TIME desc LIMIT 1;" % ( + branch_id, type1) + else: + sql = " select * from mcms_psi_dept where target_branch_id='%s' and bill_mode='%s' and stock_kind='CK_CB' order by CREATE_TIME desc LIMIT 1;" % ( + branch_id, type1) + actual = check_mcms_dept_buy_sql(sql) + print(actual) + if type1==20: + DR_ID=get_id(" select id from mcms_psi_dept where target_branch_id='%s' and bill_mode='%s' and stock_kind='CK_XH' order by CREATE_TIME desc LIMIT 1;" % ( + branch_id, type1)) + else: + DR_ID = get_id( + " select id from mcms_psi_dept where target_branch_id='%s' and bill_mode='%s' and stock_kind='CK_CB' order by CREATE_TIME desc LIMIT 1;" % ( + branch_id, type1)) + sql = "select order_no from mcms_psi_dept where id='%s';" % DR_ID + order_no = get_id(sql) + target_corp_id = get_hosid() + target_branch_id = get_branch_id() + target_dept_id = FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid2'] + target_dept_name = FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid2'] + target_stock_id = get_stockId_fromdb(target_dept_name + '库房') + target_area_code = get_stockAreaId_new_fromDb(target_dept_name, 2) + PICK_id = get_PICK_id(branch_id, type1) + source_id = PICK_id + 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) + buyBillId = get_buyBillId(branch_id, type1) + pickOrderNo = get_PICK_order_no(branch_id, type1) + buyOrderNo = get_buyOrderNo(branch_id, type1) + pickBillId = get_PICK_id(branch_id, type1) + psiDeptOutBillId = DR_ID + psiDeptOutOrderNo = 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_dept where id='%s';" % DR_ID) + last_modified = get_create_time("select last_modified from mcms_psi_dept where id='%s';" % DR_ID) + last_modified_user = create_user + accounter=create_user + account_date = process_tuple(get_create_time("select account_date from mcms_psi_dept where id='%s';" % DR_ID)) + if type1 == 16: + # 子表检查 + check_mcms_psi_dept_batch(DR_ID,type1,order_no) + expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', + 'mcms_psi_dept4', DR_ID, order_no, target_corp_id, target_branch_id, + target_dept_id, target_dept_name, target_stock_id + , target_area_code, source_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 + , create_user, create_time, last_modified, last_modified_user - elif type == 3: - print('试剂产品扫码发放') - module = "b5_spd3_core_business_flow" - # # 登录获取用户id等信息,使用创建的用户登录===========开始 - info = FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3') - username = info['username1'] - password = commonFuc().get_business_data("b2_herp3_bs", "password") - print('username,password', username, password) - # # 获取token和projectCode - token, projectCode, uxid, corpId, info = login(username, password, 2) - # 登录获取用户id等信息,使用创建的用户登录============结束 - # 到库房明细查询,查询产品的udi码 - udi_code = get_udi1(3) - # 扫码==================== - url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module, - "herpService_stock_pick_scan_url") - # 从message18文件中获取信息 - info = FileUtils().r_info8(module, "条码信息", 'message18') - # print('info', info) - list_a = info['list_a'] - stockId = commonFuc().analysis_json('stockId', list_a) - stockName = commonFuc().analysis_json('stockName', list_a) - areaCode = commonFuc().analysis_json('areaCode', list_a) - areaName = commonFuc().analysis_json('areaName', list_a) - deptId2 = FileUtils().r_info8('b2_herp3_bs', '所有科室id', 'message6')["deptid2"] - targetDeptId = FileUtils().r_info8('b2_herp3_bs', '所有科室id', 'message6')["deptid1"] - deptName = get_branch_name() - targetStockId = get_stockId(deptName + '中心库房', 1) + ) + elif type1 == 20: + # 子表检查 + check_mcms_psi_dept_batch(DR_ID,type1,order_no) + his_charge_no=get_id(" select his_charge_no from his_order where branch_id='%s' and psi_dept_id='%s' order by create_time desc LIMIT 1;"%(branch_id,DR_ID)) + expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', + 'mcms_psi_dept5', DR_ID, order_no, target_corp_id, target_branch_id, + target_dept_id, target_dept_name, target_stock_id + , target_area_code, source_id, source_corp_id, source_branch_id, + source_dept_id, source_dept_name, source_stock_id, source_area_code,his_charge_no,accounter,account_date, + pickOrderNo, pickBillId, psiDeptOutBillId, psiDeptOutOrderNo + , create_user, create_time, last_modified, last_modified_user) + else: + # 子表检查 + check_mcms_psi_dept_batch(DR_ID,type1,order_no) + expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', + 'mcms_psi_dept6', DR_ID, order_no, target_corp_id, target_branch_id, + target_dept_id, target_dept_name, target_stock_id + , target_area_code, source_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 + , create_user, create_time, last_modified, last_modified_user - request_body = commonFuc().get_business_data(module, "payload67", udi_code, stockId, stockName, areaCode, - areaName - ) - print('request_body', request_body) - result = commonFuc().http_post(url, request_body, headers) - print('扫码发放result', result) - price = commonFuc().analysis_json('price', commonFuc().analysis_json('data', result)) - createTime = commonFuc().analysis_json('createTime', commonFuc().analysis_json('data', result)) - hosId = commonFuc().analysis_json('hosId', commonFuc().analysis_json('data', result)) - tbStatus = commonFuc().analysis_json('tbStatus', commonFuc().analysis_json('data', result)) - printNum = commonFuc().analysis_json('printNum', commonFuc().analysis_json('data', result)) - # 扫码======================= - url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module, "herpService_centCbSubmit_url") - print('url', url) - headers = commonFuc().get_business_data(module, "json_headers2", - commonFuc().get_business_data(module, "json_contentType"), token, - commonFuc().get_business_data(module, "X-APP-CODE")) + ) + print('expected', expected) + print('aaaaaaaaaaaaaaaaa') + 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) + print(compare_text_index(actual_value2, expected_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') + #检查拆包后生成的入库单============================================================ + + branch_id = get_branch_id() + if type1==20: + sql = " select * from mcms_psi_dept where target_branch_id='%s' and bill_mode='%s' and stock_kind='RK_XH' order by CREATE_TIME desc LIMIT 1;" % ( + branch_id, type2) + else: + sql = " select * from mcms_psi_dept where target_branch_id='%s' and bill_mode='%s' and stock_kind='RK_CB' order by CREATE_TIME desc LIMIT 1;" % ( + branch_id, type2) + actual = check_mcms_dept_buy_sql(sql) + print(actual) + if type1==20: + DR_ID1 = get_id( + " select id from mcms_psi_dept where target_branch_id='%s' and bill_mode='%s' and stock_kind='RK_XH' order by CREATE_TIME desc LIMIT 1;" % ( + branch_id, type2)) + else: + DR_ID1 = get_id( + " select id from mcms_psi_dept where target_branch_id='%s' and bill_mode='%s' and stock_kind='RK_CB' order by CREATE_TIME desc LIMIT 1;" % ( + branch_id, type2)) + sql = "select order_no from mcms_psi_dept where id='%s';" % DR_ID1 + order_no1 = get_id(sql) + target_corp_id = get_hosid() + target_branch_id = get_branch_id() + target_dept_id = FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid2'] + target_dept_name = FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid2'] + target_stock_id = get_stockId_fromdb(target_dept_name + '库房') + target_area_code = get_stockAreaId_new_fromDb(target_dept_name, 2) + PICK_id = get_PICK_id(branch_id, type1) + source_id = DR_ID + 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) + buyBillId = get_buyBillId(branch_id, type1) + pickOrderNo = get_PICK_order_no(branch_id, type1) + buyOrderNo = get_buyOrderNo(branch_id, type1) + pickBillId = get_PICK_id(branch_id, type1) + psiDeptOutBillId = DR_ID + psiDeptOutOrderNo = order_no + psiDeptInBillId=DR_ID1 + psiDeptInOrderNo=order_no1 + 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_dept where id='%s';" % DR_ID1) + last_modified = get_create_time("select last_modified from mcms_psi_dept where id='%s';" % DR_ID1) + last_modified_user = create_user + accounter = create_user + source_no=order_no + last_auditor=create_user + last_audit_time= get_create_time("select last_audit_time from mcms_psi_dept where id='%s';" % DR_ID1) + account_date = process_tuple(get_create_time("select account_date from mcms_psi_dept where id='%s';" % DR_ID1)) + if type2 == 10: + # 子表检查 + check_mcms_psi_dept_batch_in(DR_ID1, DR_ID,type2) + expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', + 'mcms_psi_dept7', DR_ID1, order_no1, target_corp_id, target_branch_id, + target_dept_id, target_dept_name, target_stock_id + , target_area_code, source_id,source_no, 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 + , psiDeptInBillId,psiDeptInOrderNo,create_user, create_time, last_modified, last_modified_user, + last_auditor,last_audit_time + + + ) + elif type2 == 20: + # 子表检查 + check_mcms_psi_dept_batch_in(DR_ID1, DR_ID, type2) + his_charge_no = get_id( + " select his_charge_no from his_order where branch_id='%s'order by create_time desc LIMIT 1;" % branch_id) + expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', + 'mcms_psi_dept8', DR_ID1, order_no1, target_corp_id, target_branch_id, + target_dept_id, target_dept_name, target_stock_id + , target_area_code, source_corp_id, source_branch_id, + source_dept_id, source_dept_name, source_stock_id, + his_charge_no,accounter, account_date, + create_user, create_time, last_modified, last_modified_user + ) + else: + # 子表检查 + check_mcms_psi_dept_batch_in(DR_ID1, DR_ID, type2) + expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', + 'mcms_psi_dept9', DR_ID1, order_no1, target_corp_id, target_branch_id, + target_dept_id, target_dept_name, target_stock_id + , target_area_code, source_id,source_no, 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 + , psiDeptInBillId,psiDeptInOrderNo,create_user, create_time, last_modified, last_modified_user, + last_auditor,last_audit_time) + + print('expected', expected) + print('aaaaaaaaaaaaaaaaa') + 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) + print(compare_text_index(actual_value2, expected_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') + +pro_path = commonFuc().get_pro_path2() +print('pro_path', pro_path) +sys.path.append(pro_path + r'/air_case/b5_spd3_core_business_flow/a_c1流程十八中心库业务_拆包功能.air') +using(pro_path + r'//air_case/b5_spd3_core_business_flow/a_c1流程十八中心库业务_拆包功能.air') +from a_c1流程十八中心库业务_拆包功能 import center_Stock_unpack - # 从文件中获取必要信息 - info = FileUtils().r_info8(module, "条码信息", 'message18') - # print('info', info) - list_a = info['list_a'] - # print('list_a', list_a[0], type(list_a), len(list_a)) - UTid = 'UT' - areaCode = 'areaCode' - # createTime = 'createTime' - hosId = 'hosId' - stockId = 'stockId' - areaCode = 'areaCode' - areaName = 'areaName' - shelfCode = 'shelfCode' - codeType = 'codeType' - # tagType = 'tagType' - hosGoodsId = 'hosGoodsId' - mdmGoodsCode = 'mdmGoodsCode' - goodsCode = 'goodsCode' - goodsDi = 'goodsDi' - barName = 'barName' - batchCode = 'batchCode' - expdtDate = 'expdtDate' - productDate = 'productDate' - pkgCode = 'pkgCode' - pkgCodeSee = 'pkgCodeSee' - ssccCode = 'ssccCode' - pkgDefId = 'pkgDefId' - pkgDefQty = 'pkgDefQty' - purBillId = 'purBillId' - pkgDefName = 'pkgDefName' - distrBillId = 'distrBillId' - inStockTime = 'inStockTime' - distrDetailId = 'distrDetailId' - purMode = 'purMode' - goodsMfrsName = 'goodsMfrsName' - goodsSpec = 'goodsSpec' - unit = 'unit' - goodsName = 'goodsName' - made = 'made' - unitName = 'unitName' - hosGoodsCode = 'hosGoodsCode' - purModeText = 'purModeText' - for i in list_a: - print(i) - UTid = i['id'] - areaCode = i['areaCode'] - # createTime = i['createTime'] - # hosId = i['hosId'] - stockId = i['stockId'] - areaCode = i['areaCode'] - areaName = i['areaName'] - shelfCode = i['shelfCode'] - codeType = i['codeType'] - # tagType = i['tagType'] - hosGoodsId = i['hosGoodsId'] - # mdmGoodsCode = i['mdmGoodsCode'] - goodsCode = i['goodsCode'] - # goodsDi = i['goodsDi'] - barName = i['barName'] - batchCode = i['batchCode'] - expdtDate = i['expdtDate'] - productDate = i['productDate'] - # pkgCode = i['pkgCode'] - pkgCodeSee = i['pkgCodeSee'] - ssccCode = i['ssccCode'] - # tbStatus = i['tbStatus'] - onlyKey = i['hosGoodsId'] - ext = i['extInfo'] - print('ext', ext) - distrDetailId = reGetString(ext, r'distrDetailId": "', r'", ') - distrBillId = reGetString(ext, r'distrBillId": "', r'", ') - purBillId = reGetString(ext, r'purBillId": "', r'", ') - pkgDefQty = reGetString(ext, r'pkgDefQty": "', r'", ') - pkgDefId = reGetString(ext, r'pkgDefId": "', r'", ') - pkgDefName = reGetString(ext, r'pkgDefName": "', r'", ') - purMode = i['purMode'] - goodsMfrsName = i['goodsMfrsName'] - goodsSpec = i['goodsSpec'] - unit = i['unit'] - goodsName = i['goodsName'] - pkgDefId = i['pkgDefId'] - pkgDefQty = i['pkgDefQty'] - pkgDefName = i['pkgDefName'] - # printNum = i['printNum'] - made = i['made'] - # provId = i['provId'] - # provName = i['provName'] - # subProvId = i['subProvId'] - # subProvName = i['subProvName'] - hosGoodsCode = i['hosGoodsCode'] - # subSendFlag = i['subSendFlag'] - areaName = i['areaName'] - # hosId = i['hosId'] - unitName = i['unitName'] - purModeText = i['purModeText'] - extInfo = i['extInfo'] - inStockTime = reGetString(extInfo, r'inStockTime": "', r'",') - break - deptid1 = FileUtils().r_info8('b2_herp3_bs', '所有科室id', 'message6')["deptid1"] - deptName = FileUtils().r_info8('b2_herp3_bs', '所有科室name', 'message6')["deptid1"] - # # 请求体 - request_body = commonFuc().get_business_data(module, "payload69", stockId, stockName, areaCode, areaName, UTid, - createTime, UTid, hosId, - stockId, - areaCode, areaName, shelfCode, codeType, hosGoodsId, - mdmGoodsCode, goodsCode, goodsDi, barName, batchCode, expdtDate, - productDate, pkgCode, pkgCodeSee, ssccCode, tbStatus, pkgDefId, - pkgDefQty, - purBillId, pkgDefName, distrBillId, inStockTime, distrDetailId, - purMode, price, - goodsMfrsName, goodsSpec, unit, goodsName, pkgDefId, pkgDefQty, - pkgDefName, printNum, made, unitName, hosGoodsCode, purModeText,tbStatus) - print('request_body', 'ccccccc', request_body) - # # # # 发送请求 - result = commonFuc().http_post(url, request_body, headers) - print('result', result) try: updateUserLoginDefaultRange(get_listUserMgrRangePage1(1)) # 设置登录账号默认权限是二级库 center_Stock_unpack(1) # 低值耗材扫码发放 + check_mcms_psi_dept_out_and_in(16, 10) # 检查出库单和入库单(包括主表和子表) + time.sleep(6) center_Stock_unpack(3) # 试剂耗材扫码发放 + check_mcms_psi_dept_out_and_in(66, 67) # 检查出库单和入库单(包括主表和子表) commonFuc().check_text_exist_result_text('succees', 'succees') except Exception as e: # 打印错误信息 diff --git a/data/a2_mdm3_ea/data b/data/a2_mdm3_ea/data index 072c7ea4dc83cf1725d285ab7d9584cd559759d1..c527ffd471b6b989d32f07599787939b259dc828 100644 --- a/data/a2_mdm3_ea/data +++ b/data/a2_mdm3_ea/data @@ -26,8 +26,7 @@ json_headers3: { "Content-Type": "%s", "token": "%s", "X-APP-CODE":"%s", - "X-JS-HASH":"%s", - "Host":"spdtest.cmic.com.cn" + "X-JS-HASH":"%s" } "payload1": { "id": "%s",