# -*- encoding=utf8 -*-
from air_case.public1.public1.public1 import *
from common.db.sql.sql_del_branch_info import delData
from common.fileUtls import FileUtils
from common.run_cmd_script import execute_command

__author__ = "xiaohesheng"

"""
case_tag:api,b6_spd3_core_business_flow_database_check1,a_a4_流程四_基础模块设置,id2303,id2303-4,sit,on
主数据平台:a_a4_流程四_基础模块设置
python runner_test.py tag id2303-4 debug mdm3
"""

from common.common_func import commonFuc
from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_system
from airtest.core.api import using
import sys
import time

module = "b6_spd3_core_business_flow_database_check"




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_a4_流程四_基础模块设置.air')
using(pro_path + r'//air_case/b5_spd3_core_business_flow/a_a4_流程四_基础模块设置.air')
from a_a4_流程四_基础模块设置 import test1,test2, grants_user, add_StockArea


try:
    # ==============删除业务数据和报表数据
    # delData().Delete_business_Data()#删除业务数据
    # delData().Del_reporter_data() # 删除报表数据
    #==============删除业务数据和报表数据
    test1()#参数2是新增院区后缀为6位数的参数1是老模式
    test2()# 科室添加产品信息(产品是从外网同步过来的)
    dept_query_all()# 科室查询，将科室id写入文件中
    grants_user()#给用户授权
    set_dept_lead1() #设置一级科室负责人
    add_StockArea()#添加库区
    commonFuc().check_text_exist_result_text('succees', 'succees')
    print('=================流程四结束=================')
except Exception as e:
    commonFuc().check_text_exist_result_text('succees','error')
    print("发生异常：", str(e))