Commit 3b1a5c7e authored by xiao-hesheng's avatar xiao-hesheng
Browse files

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

parent f4704d7d
...@@ -32,17 +32,17 @@ def check_mcms_dept_buy_car(type=1): ...@@ -32,17 +32,17 @@ def check_mcms_dept_buy_car(type=1):
branch_id = get_branch_id() branch_id = get_branch_id()
# 获取每次都会变化的字段create_time的值 # 获取每次都会变化的字段create_time的值
create_time = get_create_time( create_time = get_create_time(
"select create_time from mcms_dept_buy_car where branch_id='%s'and hos_goods_id='%s';" % ( "select create_time from mcms_dept_buy_car where branch_id='%s'and hos_goods_id='%s'order by create_time desc LIMIT 1;" % (
branch_id, hos_goods_id)) branch_id, hos_goods_id))
print('create_time', create_time) print('create_time', create_time)
id = get_id( id = get_id(
"select id from mcms_dept_buy_car where branch_id='%s'and hos_goods_id='%s';" % (branch_id, hos_goods_id)) "select id from mcms_dept_buy_car where branch_id='%s'and hos_goods_id='%s' order by create_time desc LIMIT 1;" % (branch_id, hos_goods_id))
print('id', id) print('id', id)
create_user = get_id( create_user = get_id(
"select create_user 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' order by create_time desc LIMIT 1;;" % (
branch_id, hos_goods_id)) branch_id, hos_goods_id))
print('create_time', create_time, 'id', 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; sql = """select * from mcms_dept_buy_car where branch_id='%s' and hos_goods_id='%s' order by create_time desc LIMIT 1;
""" % (branch_id, hos_goods_id) """ % (branch_id, hos_goods_id)
actual_value1 = check_mcms_dept_buy_car_sql(sql) actual_value1 = check_mcms_dept_buy_car_sql(sql)
print(actual_value1) print(actual_value1)
...@@ -90,6 +90,8 @@ def check_mcms_dept_buy_car(type=1): ...@@ -90,6 +90,8 @@ def check_mcms_dept_buy_car(type=1):
print(expected_value2) print(expected_value2)
print('actual_value2') print('actual_value2')
print(actual_value2) print(actual_value2)
result = (compare_text_index(actual_value2, expected_value2))
print('result', result)
if actual_value2 == expected_value2: if actual_value2 == expected_value2:
print('ok') print('ok')
commonFuc().check_text_exist_result_text('succees', 'succees') commonFuc().check_text_exist_result_text('succees', 'succees')
...@@ -464,41 +466,41 @@ def mcms_dept_buy_detail_approval_after(type=16): ...@@ -464,41 +466,41 @@ def mcms_dept_buy_detail_approval_after(type=16):
try: try:
# ==================暂时注释=================================== # ==================暂时注释===================================
# set_dept_lead() # 设置二级科室负责人 set_dept_lead() # 设置二级科室负责人
# # 科室必须同步到外网,集中管控平台创建边仓才能选择到用户,"deptType":"0" # 科室必须同步到外网,集中管控平台创建边仓才能选择到用户,"deptType":"0"
# pro_path = commonFuc().get_pro_path2() pro_path = commonFuc().get_pro_path2()
# print('pro_path', pro_path) print('pro_path', pro_path)
# sys.path.append(pro_path + r'/air_case/b5_spd3_core_business_flow/a_b3流程十请领业务流_二级库向边仓.air') sys.path.append(pro_path + r'/air_case/b5_spd3_core_business_flow/a_b3流程十请领业务流_二级库向边仓.air')
# using(pro_path + r'//air_case/b5_spd3_core_business_flow/a_b3流程十请领业务流_二级库向边仓.air') using(pro_path + r'//air_case/b5_spd3_core_business_flow/a_b3流程十请领业务流_二级库向边仓.air')
# from a_b3流程十请领业务流_二级库向边仓 import add_logic_stock from a_b3流程十请领业务流_二级库向边仓 import add_logic_stock
#
# add_logic_stock() add_logic_stock()
#
# from a_b3流程十请领业务流_二级库向边仓 import goods_move from a_b3流程十请领业务流_二级库向边仓 import goods_move
# from a_b3流程十请领业务流_二级库向边仓 import second_dept_Request from a_b3流程十请领业务流_二级库向边仓 import second_dept_Request
# from a_b3流程十请领业务流_二级库向边仓 import BuyCarSubmit from a_b3流程十请领业务流_二级库向边仓 import BuyCarSubmit
# from a_b3流程十请领业务流_二级库向边仓 import check_buyWayText from a_b3流程十请领业务流_二级库向边仓 import check_buyWayText
#
# # # 设置产品出库渠道为边仓 # # 设置产品出库渠道为边仓
# goods_move() goods_move()
# updateUserLoginDefaultRange(get_listUserMgrRangePage(2)) # 设置登录账号默认权限是二级库 updateUserLoginDefaultRange(get_listUserMgrRangePage(2)) # 设置登录账号默认权限是二级库
# # # # # 低值 # # # # 低值
# 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_car(1) check_mcms_dept_buy_car(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_car(2) check_mcms_dept_buy_car(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_car(3) check_mcms_dept_buy_car(3)
# BuyCarSubmit() # 请领车提交 BuyCarSubmit() # 请领车提交
# # 调用函数对数据库中的数据进行验证和比对 # 调用函数对数据库中的数据进行验证和比对
# list_data = ['16', '20', '66'] list_data = ['16', '20', '66']
# for i in list_data: for i in list_data:
# check_mcms_dept_buy(int(i)) check_mcms_dept_buy(int(i))
# mcms_dept_buy_detail(int(i)) mcms_dept_buy_detail(int(i))
# for i in range(6): # 三个单据共审批6次 for i in range(6): # 三个单据共审批6次
# approval_center() approval_center()
# ==================上面暂时注释=================================== # ==================上面暂时注释===================================
list_data = ['16', '20', '66'] list_data = ['16', '20', '66']
for i in list_data: for i in list_data:
......
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