main_text.py 13.61 KiB
import time
import sys
import os
# print('根据当前文件获取当前文件所在目录的路径', os.path.dirname(__file__))
import traceback
from air_case.public1.public1.public1 import approval_center, approval_center_all
curPath = os.path.abspath(os.path.dirname(__file__))  # 获取当前文件的所在目录的绝对路径
# print('将路径中的/换成\\', curPath)  # C:\Users\Administrator\Desktop\temp\dbshop99\main
# # #将当前文件的所在目录的绝对路径进行分离,分离成 ('C:\\Users\\Administrator\\Desktop\\temp\\dbshop99', 'main'),存到元组中
# print('切割路径,切割成一个元组,将路径分离', os.path.split(curPath))
rootPath = os.path.split(curPath)[0]  # [0]表示元组中的为一个元素
# print('当前项目的根目录', rootPath)
sys.path.append(rootPath)  # 将项目的根目录路径添加到环境变量中,然后在cmd命令行中就可以正常运行脚本
sys.path.append(os.path.join(rootPath,'common'))
# print('根据当前文件获取当前文件所在目录的路径', os.path.dirname(__file__))
from airtest.core.helper import using
from common.common_func import commonFuc
from common.db.sql.sql_del_branch_info import delData
# curPath = os.path.abspath(os.path.dirname(__file__))  # 获取当前文件的所在目录的绝对路径
# print('将路径中的/换成\\', curPath)  # C:\Users\Administrator\Desktop\temp\dbshop99\main
# # #将当前文件的所在目录的绝对路径进行分离,分离成 ('C:\\Users\\Administrator\\Desktop\\temp\\dbshop99', 'main'),存到元组中
# print('切割路径,切割成一个元组,将路径分离', os.path.split(curPath))
# rootPath = os.path.split(curPath)[0]  # [0]表示元组中的为一个元素
# print('当前项目的根目录', rootPath)
# sys.path.append(rootPath)  # 将项目的根目录路径添加到环境变量中,然后在cmd命令行中就可以正常运行脚本
# print('rootPath',rootPath)
# print(sys.path)
import tkinter as tk
from tkinter import *
import tkinter.messagebox
from common.run_cmd_script import execute_command
pro_path = commonFuc().get_pro_path2()
sys.path.append(pro_path + r'/air_case/b5_spd3_core_business_flow/execute.air')
using(pro_path + r'//air_case/b5_spd3_core_business_flow/execute.air')
def main_text():
    # 创建窗口
    root = tk.Tk()
    # 获取屏幕宽高
    window_width = root.winfo_screenwidth()
    window_height = root.winfo_screenheight()
    # 设置窗口大小
    root.geometry('800x560')
    # 刷新窗口参数
    root.update()
    # 计算窗口居中时左上角的坐标
    x = (window_width - root.winfo_width()) // 2
    y = (window_height - root.winfo_height()) // 2
    # 设置窗口左上角的坐标
    root.geometry("+{}+{}".format(x, y))
    root.title (string ="核心业务流")
    root.resizable(False,False)
    # for a in ['n', 's', 'e', 'w', 'ne', 'nw', 'se', 'sw']:
    #     Button(root,
    #            text='anchor',
    #            anchor=a,
    #            width=30,
    #            height=4).pack()
    def flow1():
        print('调用流程一')
        from execute import flow1
        flow1()
        print('流程一执行完毕')
        # execute_command("python runner_test.py tag id2302-1 debug mdm3")
7172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
# sys.exit(0) def flow2(): print('调用流程二') from execute import flow2 flow2() print('流程2执行完毕') # execute_command("python runner_test.py tag id2302-2 debug mdm3") # sys.exit(0) def flow3(): from execute import flow3 flow3() print('流程3执行完毕') # execute_command("python runner_test.py tag id2302-3 debug mdm3") # sys.exit(0) def flow4(): # execute_command("python runner_test.py tag id2302-4 debug mdm3") from execute import flow4 flow4() # 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,dept_query_all,grants_user,set_dept_lead1,add_StockArea,recover_dataFile # test1(2) # 参数2是新增院区后缀为6位数的参数1是老模式 # test2() # 科室添加产品信息(产品是从外网同步过来的) # dept_query_all() # 科室查询,将科室id写入文件中 # grants_user() # 给用户授权 # set_dept_lead1() # 设置一级科室负责人 # add_StockArea() # 添加库区 # recover_dataFile()#恢复备份的data目录 # commonFuc().check_text_exist_result_text('succees', 'succees') print('流程4执行完毕') # sys.exit(0) def flow5(): # execute_command("python runner_test.py tag id2302-5,id2302-6,id2302-7,id2302-8 debug mdm3") from execute import flow5,flow6,flow7,flow8 flow5() flow6() flow7() flow8() print('流程5执行完毕') # sys.exit(0) def flow6(): from execute import flow9 flow9() print('流程6执行完毕') # sys.exit(0) def flow7(): print('流程七开始执行') from execute import flow10 flow10() print('流程七执行完毕') # sys.exit(0) def flow8(): from execute import flow11 flow11() print('流程八执行完毕','流程八执行完毕 ') # sys.exit(0) def flow9(): from execute import flow12 flow12() print('流程9执行完毕','流程9执行完毕') # sys.exit(0) def flow10(): from execute import flow13 flow13() print('流程十执行完毕','流程十执行完毕') # sys.exit(0) def flow11(): from execute import flow14 flow14() print('流程11执行完毕','flow11执行完毕')