Esempio n. 1
0
def get_eva_pid_channel(pid, channelId):
    param = {
        "_head": {
            "_interface": "get_eva_pid_channel",
            "_msgType": "request",
            "_remark": "",
            "_version": "0.01",
            "_timestamps": "1525332832",
            "_invokeId": "SALESDETECT152533283241636",
            "_callerServiceId": "212013",
            "_groupNo": "1"
        },
        "_param": {
            "pid": pid,
            "channelId": channelId
        }
    }

    secret_key = "CtN4bZr7qYyxygRyP5T0VWMEvWhpH0uf"
    callerserviceid = "212013"
    # eva_query 估价查询服务
    url = "http://evaserver.huishoubao.com/eva_query/get_eva_pid_channel"
    md5value = json.dumps(param) + "_" + secret_key
    headers = {
        "Content-Type": "application/json;charset=UTF-8",
        "HSB-OPENAPI-SIGNATURE": Md5Enerypt(md5value),
        "HSB-OPENAPI-CALLERSERVICEID": callerserviceid
    }
    respone = requests.post(url,
                            json=param,
                            headers=headers,
                            proxies=hsb_eva_ipProxy_test())
    hsb_response_print(respone=respone)
Esempio n. 2
0
 def evaluateengineer(self, orderid, isOverInsurance, channel_id, product_id, pid, platform_type):
     # select = self.eva_option_get(channel_id=channel_id, product_id=product_id, pid=pid, platform_type=platform_type)
     select = ["12","3246","20","2171","23","223","35","40","53","55","5535","59","63","65","71","6702","6931","9","73","77","7641"]
     param = {"head":{"interface":"evaluateengineer","msgtype":"request","remark":"","version":"0.01"},"params":{"cookies":"server-evaluate_detect","ip":"127.0.0.1","orderid":orderid, "productId":product_id, "select":select,  "isOverInsurance":isOverInsurance, "userid":"1311"}}
     headers = {"Content-Type":"application/json;charset=UTF-8"}
     url = "http://evaserver.huishoubao.com/rpc/evaluate"  # 大质检 /rpc/evaluate
     respone = requests.post(url, json=param, headers=headers, proxies=hsb_eva_ipProxy_test())
     hsb_response_print(respone=respone)
Esempio n. 3
0
    def base_price_evaluatee(self, channelId, pid, productId, ip,
                             freqLimitType):
        (str_sku_answer_list,
         str_Option_answer_desc) = self.pdt_sku_query(productId=productId)
        # (str_options_list, str_options_list_desc) = self.product_6_eva_option_get(channel_id=channelId, product_id=productId, pid=pid)
        str_options_list = [
            '82', '62', '66', '58', '236', '5530', '55', '78', '7642', '6931',
            '23', '5534', '224', '20', '1078', '2171', '3245'
        ]

        # "evaType":"2" 大质检; "priceType":"1" 销售定价
        param = {
            "_head": {
                "_interface": "evaluate",
                "_msgType": "request",
                "_remark": "",
                "_version": "0.01",
                "_timestamps": "1525332832",
                "_invokeId": "mikingzhang_adjustPrice",
                "_callerServiceId": "116006",
                "_groupNo": "1"
            },
            "_param": {
                "channelId": channelId,
                "pid": pid,
                "productId": productId,
                "evaType": "2",
                "skuItem": str_sku_answer_list,
                "optItem": str_options_list,
                "ip": ip,
                "userId": "1002",
                "priceType": "1",
                "freqLimitType": freqLimitType
            }
        }
        secret_key = "R2gFCRbILiNhwv3YbtaGceYJlPS5Ku02"
        callerserviceid = "116006"
        url = "http://bpeserver.huishoubao.com/base_price/evaluate"
        md5value = json.dumps(param) + "_" + secret_key
        headers = {
            "Content-Type": "application/json;charset=UTF-8",
            "HSB-OPENAPI-SIGNATURE": Md5Enerypt(md5value),
            "HSB-OPENAPI-CALLERSERVICEID": callerserviceid
        }
        respone = requests.post(url,
                                json=param,
                                headers=headers,
                                proxies=hsb_eva_ipProxy_test())
        respone.encoding = respone.apparent_encoding  # 编码设置
        respone_dict = json.loads(respone.text)  # 转成字典

        print('========>1.『{0}』 产品的『标准sku,ID』(随机取)为:\n'.format(productId),
              str_sku_answer_list)
        print('\n========>2. 以上『标准sku,名称』为:\n',
              '{' + str_Option_answer_desc[:-1] + '}')
        # print('\n========>3.『{0}』 产品的『大质检机况17,ID』(随机取)为:\n'.format(productId), str_options_list)
        # print('\n========>4. 以上『大质检机况17,名称』为:\n', '{' + str_options_list_desc[:-1] + '}')
        hsb_response_print(respone=respone)