# -*- encoding=utf8 -*-
from common.timeUtils import timeUtils
from common.fileUtls import FileUtils
import sys

__author__ = "xiaohesheng"

"""
case_tag:api,mdm-web旧接口,产品信息审核锁定,id2251,id2251-x,sit,on
主数据平台:产品信息审核锁定
"""
module = "mdm3_pim"
from common.common_func import commonFuc, using
from air_case.mdm_login.登录外网系统.登录外网系统 import login_system
pro_path=commonFuc().get_pro_path()
sys.path.append(pro_path+r'\\air_case\\mdm3_pim\\a3产品信息审核_查询.air')
using(pro_path+r'\\air_case\\mdm3_pim\\a3产品信息审核_查询.air')
from a3产品信息审核_查询 import *

"""
 场景:产品信息审核锁定
 用例名称：产品信息审核锁定
 输入：CRid
 输出："rtn_msg": "ok"
"""
# 登录
username = global_var_cname
password = commonFuc().get_business_data(module, "password")
print(username, password)
# 获取token和projectCode
token, projectCode, uxid, corpId,info = login_system(username, password).get_token()
# 产品信息审核查询
module = "mdm3_pim"
# 产品信息审核查询
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "updateById_url2")
# 获取请求头信息
headers = commonFuc().get_business_data(module, "json_headers2",
                                        commonFuc().get_business_data(module, "json_contentType"), token,
                                        projectCode)
now = timeUtils().get_time_hms()
GRBid=global_var_GRBid
request_body = commonFuc().get_business_data(module, "payload8", GRBid, uxid, now)
# 发送请求
result = commonFuc().http_post(url, request_body, headers)
# print('锁定结果',result)
checkDict3=commonFuc().get_business_data(module,"checkDict3")
commonFuc().check_result(checkDict3,result)