Commit 18efab2a authored by xiao-hesheng's avatar xiao-hesheng
Browse files

脚本优化

parent e635078e
...@@ -21,65 +21,70 @@ python runner_test.py tag id2303-13 debug mdm3 ...@@ -21,65 +21,70 @@ python runner_test.py tag id2303-13 debug mdm3
""" """
def check_mcms_dept_buy(type): def check_mcms_dept_buy(type=1):
if type == 1: # 低值 hos_goods_id='hos_goods_id'
if type==1:
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"] hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"]
branch_id = get_branch_id() elif type==2:
# 获取每次都会变化的字段create_time的值 hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message1')["hosGoodsId"]
create_time = get_create_time(
"select create_time from mcms_dept_buy_car where branch_id='%s'and hos_goods_id='%s';" % ( branch_id = get_branch_id()
branch_id, hos_goods_id)) # 获取每次都会变化的字段create_time的值
print('create_time',create_time) create_time = get_create_time(
id = get_id( "select create_time from mcms_dept_buy_car where branch_id='%s'and hos_goods_id='%s';" % (
"select id from mcms_dept_buy_car where branch_id='%s'and hos_goods_id='%s';" % (branch_id, hos_goods_id)) branch_id, hos_goods_id))
print('id',id) print('create_time',create_time)
create_user = get_id( id = get_id(
"select create_user from mcms_dept_buy_car where branch_id='%s'and hos_goods_id='%s' LIMIT 1;" % ( "select id from mcms_dept_buy_car where branch_id='%s'and hos_goods_id='%s';" % (branch_id, hos_goods_id))
branch_id, hos_goods_id)) print('id',id)
print('create_time', create_time, 'id', id) create_user = get_id(
sql = """select * from mcms_dept_buy_car where branch_id='%s' and hos_goods_id='%s' LIMIT 1; "select create_user from mcms_dept_buy_car where branch_id='%s'and hos_goods_id='%s' LIMIT 1;" % (
""" % (branch_id, hos_goods_id) branch_id, hos_goods_id))
actual_value1 = check_mcms_dept_buy_car(sql) print('create_time', create_time, 'id', id)
print(actual_value1) sql = """select * from mcms_dept_buy_car where branch_id='%s' and hos_goods_id='%s' LIMIT 1;
deptid2 = FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid2'] """ % (branch_id, hos_goods_id)
deptname2 = FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid2'] actual_value1 = check_mcms_dept_buy_car(sql)
areaCode = get_stockAreaId_new(deptid2, deptname2, 2) print(actual_value1)
areaName = '默认库区' deptid2 = FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid2']
# 读取文件中的信息 deptname2 = FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid2']
info = FileUtils().r_info8('b5_spd3_core_business_flow', "二级库请领产品信息", 'message21') areaCode = get_stockAreaId_new(deptid2, deptname2, 2)
list_a = info['list_a'] areaName = '默认库区'
mdm_goods_code = commonFuc().analysis_json('mdmGoodsCode', list_a) # 读取文件中的信息
pur_mode = commonFuc().analysis_json('purMode', list_a) info = FileUtils().r_info8('b5_spd3_core_business_flow', "二级库请领产品信息", 'message21')
goodsCode = commonFuc().analysis_json('goodsCode', list_a) list_a = info['list_a']
pkgDefId = commonFuc().analysis_json('pkgDefId', list_a) mdm_goods_code = commonFuc().analysis_json('mdmGoodsCode', list_a)
pkgDefName = commonFuc().analysis_json('pkgDefName', list_a) pur_mode = commonFuc().analysis_json('purMode', list_a)
last_modified_user = create_user goodsCode = commonFuc().analysis_json('goodsCode', list_a)
last_modified = create_time pkgDefId = commonFuc().analysis_json('pkgDefId', list_a)
# print('actual_value1',actual_value1) pkgDefName = commonFuc().analysis_json('pkgDefName', list_a)
actual_value2 = get_process_list2(actual_value1) last_modified_user = create_user
# print('actual_value2') last_modified = create_time
# print( actual_value2) # print('actual_value1',actual_value1)
# prov_hos_goods_id = '8d6273b7bca84dd8aace12b9422d7fd6' actual_value2 = get_process_list2(actual_value1)
expected_value2 = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', # print('actual_value2')
'check_mcms_dept_buy_car', id, get_hosid(), branch_id, deptid2, # print( actual_value2)
deptname2, areaCode, areaName, hos_goods_id, mdm_goods_code, # prov_hos_goods_id = '8d6273b7bca84dd8aace12b9422d7fd6'
goodsCode, pkgDefId, pkgDefName expected_value2 = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
, create_user, create_time, last_modified, last_modified_user) 'check_mcms_dept_buy_car', id, get_hosid(), branch_id, deptid2,
# print('expected_value2', expected_value2) deptname2, areaCode, areaName, hos_goods_id, mdm_goods_code,
# expected_value2=get_process_list2(expected_value2) goodsCode,pur_mode, pkgDefId, pkgDefName
actual_value2 = actual_value2.replace(" ", "") , create_user, create_time, last_modified, last_modified_user)
expected_value2 = expected_value2.replace(" ", "") # print('expected_value2', expected_value2)
# print('actual_value2',actual_value2) # expected_value2=get_process_list2(expected_value2)
print('expected_value2') actual_value2 = actual_value2.replace(" ", "")
print(expected_value2) expected_value2 = expected_value2.replace(" ", "")
print('actual_value2') # print('actual_value2',actual_value2)
print(actual_value2) print('expected_value2')
if actual_value2 == expected_value2: print(expected_value2)
print('ok') print('actual_value2')
commonFuc().check_text_exist_result_text('succees', 'succees') print(actual_value2)
else: if actual_value2 == expected_value2:
print('error') print('ok')
commonFuc().check_text_exist_result_text('error', 'succees') commonFuc().check_text_exist_result_text('succees', 'succees')
else:
print('error')
commonFuc().check_text_exist_result_text('error', 'succees')
try: try:
...@@ -105,9 +110,11 @@ try: ...@@ -105,9 +110,11 @@ try:
second_dept_Request(FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message2')['hosGoodsId'], 1) second_dept_Request(FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message2')['hosGoodsId'], 1)
check_mcms_dept_buy(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() # 请领车提交 # BuyCarSubmit() # 请领车提交
# for i in range(6): # 三个单据共审批6次 # for i in range(6): # 三个单据共审批6次
# approval_center() # approval_center()
......
二级库请领产品信息: 二级库请领产品信息:
list_a: list_a:
- &id001 - &id001
- hosGoodsId: h034700004500 - hosGoodsId: h034700004499
purMode: 10 purMode: 20
grantRule: grantRule:
id: id:
goodsName: 一次性注射器_低值wExpg goodsName: 高值牙钻机PFKHm
goodsSpec: G-31891 goodsSpec: G-31891
mdmGoodsCode: '11661453' mdmGoodsCode: '11661452'
goodsCode: '00004500' goodsCode: '00004499'
unit: unit:
goodsMfrsName: 德国歌德公司 Geuder AG goodsMfrsName: 德国歌德公司 Geuder AG
miDjmc: '' miDjmc: ''
miCode: '' miCode: ''
pkgDefName: '100' pkgDefName:
pkgDefQty: 100.0 pkgDefQty: 1.0
pkgQty: pkgQty:
qty: 500.0 qty: 5.0
goodsImg: [] goodsImg: []
pkgDefId: 34b26233759a4720920cc8328dd1f8d1 pkgDefId:
buyPkgQty: buyPkgQty:
unitName: 100支/100 unitName: 1
price: 99.9999 price: 99.9999
hosId: hosId:
branchId: branchId:
...@@ -37,12 +37,12 @@ ...@@ -37,12 +37,12 @@
grantWay: 2 grantWay: 2
deptGoodsStatus: deptGoodsStatus:
codingType: 0 codingType: 0
purModeText: 值耗材 purModeText: 值耗材
goodsGeneralName: 一次性注射器 goodsGeneralName: 牙钻机
provName: 国药集团公司^n1@F provName: 国药集团公司^n1@F
noRecPkgQty: 15.0 noRecPkgQty: 15.0
noRecQty: 1500.0 noRecQty: 15.0
autoUnpack: 0 autoUnpack:
consumeQty: consumeQty:
consumePkgQty: consumePkgQty:
list_b: list_b:
......
"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}' "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 \ 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