# -*- encoding=utf8 -*-

__author__ = "xiaohesheng"

"""
case_tag:api,mdm-web,企业锁定,id2248,id2248-2,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)
id1=global_var_id
"""
 场景:注册企业锁定
 用例名称：企业锁定
 输入：CRid
 输出："rtn_msg": "企业被锁定"
"""
#企业注册提交接口_锁定_开始
username = commonFuc().get_business_data(module, "username")
password = commonFuc().get_business_data(module, "password")
# 获取token和projectCode
token,projectCode,uxid,corpId,info= login_system(username, password).get_token()

url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "queryAlCompanyRegistInfo_url")
#获取请求头信息
headers = commonFuc().get_business_data(module, "json_headers2",
                                        commonFuc().get_business_data(module, "json_contentType"), token,
                                        projectCode, token)
request_body = commonFuc().get_business_data(module, "payload3",id1)
# 发送请求
result = commonFuc().http_post(url, request_body, headers)
#获取接口返回数据
code = commonFuc().analysis_json('code', result)
#断言实际结果中是否包含预期结果的内容
commonFuc().check_text_exist(code, result)
#===============企业注册提交接口_锁定_结束