def getUserRelation(host, phone, password): url = "{}{}".format(rc.read_json()['url'][str(host)], rc.read_json()['path']['getUserRelation']) headers = ah.get_headers(host, phone, password) try: res = requests.post(url=url, headers=headers) return res.text except Exception as e: return "error_info: {}".format(str(e))
def get_customer_work_info(host, phone, password): url = "{}{}".format(rc.read_json()['url'][str(host)], rc.read_json()['houseLoanPath']['getCustomerWorkInfo']) headers = ah.get_headers(host, phone, password) try: res = requests.post(url=url, headers=headers) return res.text except Exception as e: return "error_info: {}".format(str(e))
def get_house_base_info(host, phone, password): url = "{}{}".format(rc.read_json()['url'][str(host)], rc.read_json()['houseLoanPath']['getBaseHouseInfo']) headers = ah.get_headers(host, phone, password) try: res = requests.post(url=url, headers=headers) if "success" in res.text: return res.text except Exception as e: return "error_info:{}".format(str(e))
def perfectOccupation(host, phone, password): url = "{}{}".format(rc.read_json()['url'][str(host)], rc.read_json()['path']['occupation']) headers = ah.get_headers(host, phone, password) data = rc.read_json()['data']['occupationData'] try: res = requests.post(url=url, data=data, headers=headers) if "添加成功" in res.text: print("用户职业信息添加成功,职业信息内容如下:" + getOccupationInfo(host, phone, password)) # print("错误信息为:" + res.text) except Exception as e: print("error_info: {}".format(str(e)))
def get_customer_manageMent_info(host, phone, password): url = "{}{}".format( rc.read_json()['url'][str(host)], rc.read_json()['houseLoanPath']['getCustomerManageMentInfo']) headers = ah.get_headers(host, phone, password) try: res = requests.post(url=url, headers=headers) if res.status_code == 200: return res.text except Exception as e: return "error_info:{}".format(e)
def save_property_holder_info(host, phone, password): url = "{}{}".format(rc.read_json()['url'][str(host)], rc.read_json()['houseLoanPath']['propertyHolderInfo']) headers = ah.get_headers(host, phone, password) data = rc.read_json()['data']['propertyHodlerInfo'] try: res = requests.post(url=url, data=data, headers=headers) if "success" in res.text: print("添加共有产权人信息成功,共有产权人信息内容如下:" + get_property_hodler_info(host, phone, password)) except Exception as e: print("error_info:{}".format(str(e)))
def userBase(host, phone, password): url = "{}{}".format(rc.read_json()['url'][str(host)], rc.read_json()['path']['userBase']) headers = headers = ah.get_headers(host,phone,password) data = rc.read_json()['data']['userBaseData'] try: res = requests.post(url=url, data=data, headers=headers) if "添加成功" in res.text: print("添加个人基本信息成功,个人基本信息内容如下:" + getUserBase(host, phone, password)) else: print("错误信息为:" + res.text) except Exception as e: print("error_info: %s" %e)
def save_custome_work_info(host, phone, password): url = "{}{}".format(rc.read_json()['url'][str(host)], rc.read_json()['houseLoanPath']['customerWorkInfo']) headers = ah.get_headers(host, phone, password) data = rc.read_json()['data']['customerWorkInfo'] try: res = requests.post(url=url, data=data, headers=headers) if "success" in res.text: print("添加工作信息成功,工作信息内容如下:" + get_customer_work_info(host, phone, password)) else: print("接口异常信息为:" + res.text) except Exception as e: print("error_info:{}".format(str(e)))
def get_credit_mobile_authUrl(host, phone, password): url = "{}{}".format(rc.read_json()['url'][str(host)], rc.read_json()['path']['creditAuthMobileUrl']) headers = ah.get_headers(host, phone, password) data = {'type': '1'} try: res = requests.post(url=url, data=data, headers=headers) if res.status_code == 200: result = json.loads(res.text) print("获取信贷运营商认证ULR地址成功,地址如下:{}".format(result['url'])) else: print("接口异常信息为:" + res.text) except Exception as e: print("error_info:{}".format(str(e)))
def save_house_base_info(host, phone, password): url = "{}{}".format(rc.read_json()['url'][str(host)], rc.read_json()['houseLoanPath']['houseBaseInfo']) headers = ah.get_headers(host, phone, password) data = rc.read_json()['data']['houseloanBaseInfo'] data['id'] = get_house_base_info_id(host, phone, password) try: res = requests.post(url=url, data=data, headers=headers) if "success" in res.text: print("添加房产基本信息成功,房产基本信息内容如下:" + get_house_base_info(host, phone, password)) else: print("接口异常信息为:" + res.text) except Exception as e: print("error_info:{}".format(str(e)))
def get_house_auth_mobile_url(host, phone, password): url = "{}{}".format( rc.read_json()['url'][str(host)], rc.read_json()['houseLoanPath']['houseLoanAuthMobileUrl']) headers = ah.get_headers(host, phone, password) data = {'type': '1'} try: res = requests.post(url=url, data=data, headers=headers) if "success" in res.text: url_info = json.loads(res.text) print("获取房贷运营商认证地址成功,地址内容如下:" + url_info['url']) else: print("接口异常信息为:" + res.text) except Exception as e: print("error_info:{}".format(str(e)))
def getMobileCertification(host, phone, password): url = "{}{}".format(rc.read_json()['url'][str(host)], rc.read_json()['path']['onLineAuthMobileUrl']) headers = ah.get_headers(host, phone, password) data = { 'type': '1' } try: res = requests.post(url=url, data=data, headers=headers) result = json.loads(res.text) if res.status_code == 200: print("获取网销运营商认证地址成功,地址内容如下:{}".format(result['url'])) else: print("错误信息为:" + res.text) except Exception as e: print("Error_info:{}".format(str(e)))
def confirmation(host,idCard,idCardName,phone,password): url = "{}{}".format(readConfig.read_json()['url'][str(host)],readConfig.read_json()['path']['confirmation']) headers = gh.get_headers(host,phone,password) data = { 'confirmation':1, 'idCardCode':idCard, 'idCardName':idCardName } try: res = requests.post(url=url,data=data,headers=headers) result = json.loads(res.text) if res.status_code == 200: print("实名认证通过,接口返回内容为:{}".format(result)) else: print("实名认证失败,接口错误信息为:{}".format(res.text)) except Exception as e: print("error_info:{}".format(str(e)))
def save_CustomerForHouseLoan(host, phone, password): url = "{}{}".format( rc.read_json()['url'][str(host)], rc.read_json()['houseLoanPath']['CustomerForHouseLoan']) headers = ah.get_headers(host, phone, password) link1 = rc.read_json()['data']['linkMen']["a"] link2 = rc.read_json()['data']['linkMen']["b"] link3 = rc.read_json()['data']['linkMen']["c"] link4 = rc.read_json()['data']['linkMen']["d"] linkMen = "[{},{},{},{}]".format(link1, link2, link3, link4) linkMen = linkMen.replace('\'', '\"').replace(' ', '') data = rc.read_json()['data']['houseloan_couserInfo'] data['linkMen'] = linkMen try: res = requests.post(url=url, data=data, headers=headers) if "success" in res.text: print("添加基本信息成功,基本信息内容如下:" + get_customer_info(host, phone, password)) else: print("接口异常信息为:" + res.text) except Exception as e: print("error_info:{}".format(str(e)))
def userRelation(host, phone, password): url = "{}{}".format(rc.read_json()['url'][str(host)], rc.read_json()['path']['userRelation']) headers = ah.get_headers(host, phone, password) spouse = rc.read_json()['data']['userRelationData']['a'] family = rc.read_json()['data']['userRelationData']['b'] colleague = rc.read_json()['data']['userRelationData']['c'] friend = rc.read_json()['data']['userRelationData']['d'] contacts = "[{},{},{},{}]".format(spouse, family, colleague, friend) contacts = contacts.replace('\'', '\"').replace(' ', '') data = {"contacts": contacts, "emergencyContactKnow": rc.read_json()['data']['userRelationData']['emergencyContactKnow'], "familyKnow": rc.read_json()['data']['userRelationData']['familyKnow'] } try: res = requests.post(url=url, data=data, headers=headers) if "添加成功" in res.text: print("添加联系人信息成功,联系人信息如下:" + getUserRelation(host, phone, password)) else: print("错误信息为:" + res.text) except Exception as e: print("Error_info:{}".format(str(e)))