# -*- encoding=utf8 -*-

__author__ = "xiaohesheng"

"""
case_tag:api,mdm-web,企业审核,id2248,id2248-5,sit,on
主数据平台:注册企业审核认领流程 
"""

from common.common_func import commonFuc
from air_case.mdm_login.登录外网系统.登录外网系统 import login_system
from airtest.core.api import using
import sys
module = "mdm3_ea"
pro_path=commonFuc().get_pro_path()
sys.path.append(pro_path+r'\\air_case\\mdm3_ea\\a企业认领.air')
using(pro_path+r'\\air_case\\mdm3_ea\\a企业认领.air')
from a企业认领 import *
# print('global_var_id',global_var_id)
cname=global_var_cname
"""
 场景:企业查询
 用例名称：企业查询
 输入：Cname
 输出："rtn_msg": "企业信息"
"""

username = commonFuc().get_business_data(module, "username")
password = commonFuc().get_business_data(module, "password")
# print(username, password)
# 获取token和projectCode
token,projectCode,uxid,corpId,info= login_system(username, password).get_token()
#获取请求头信息
headers = commonFuc().get_business_data(module, "json_headers2",
                                        commonFuc().get_business_data(module, "json_contentType"), token,
                                        projectCode, token)

#企业审核接口_再次查询数据_开始
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "upCompanyList_url")
request_body = commonFuc().get_business_data(module, "payload4",cname)
# 发送请求
result = commonFuc().http_post(url, request_body, headers)
#获取接口返回数据
code = commonFuc().analysis_json('code', result)
#断言实际结果中是否包含预期结果的内容
commonFuc().check_text_exist(code, result)
# #===============企业注册提交接口_查询数据_结束