tangxuelian 发表于 2016-8-3 09:24:45

LR 关联的参数无法入库

我用LR录制了一个脚本,新增订单的,做了关联,回放也没有错误,我看的日志参数也取到值了,但是数据库里确没有数据,有哪位大神可以看一下是何原因!!
add_order()
{

/*---------------------------------add_order--------------------------------------*/

        lr_start_transaction("add_order");

        web_url("neworder.html",
                "URL=http://10.40.1.10:8100/ebiz/view/sale/neworder.html",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=http://10.40.1.10:8100/ebiz/#/sale/dealerLists",
                "Snapshot=t163.inf",
                "Mode=HTTP",
                LAST);

        web_url("neworder.dealer.html",
                "URL=http://10.40.1.10:8100/ebiz/view/sale/neworder.dealer.html",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=http://10.40.1.10:8100/ebiz/#/sale/dealerLists",
                "Snapshot=t164.inf",
                "Mode=HTTP",
                LAST);

        web_set_max_html_param_len("9999999");

        web_reg_save_param("sellerid",
                "LB=\"OrgId\":\"",
                "RB=\",",
                "Ord=1",
                LAST);

        web_reg_save_param("dealerid",
                "LB=\"DealerOrgId\":\"",
                "RB=\",",
                "Ord=1",
                LAST);

        web_reg_save_param("dealername",
                "LB=\"DealerRemarkName\":\"",
                "RB=\"}",
                "Ord=1",
                LAST);

        web_url("GetBoundDealerList",
                "URL=http://10.40.1.10:8100/site/Dealer/GetBoundDealerList?CurPage=1&PageSize=10",
                "Resource=1",
                "RecContentType=application/json",
                "Referer=http://10.40.1.10:8100/ebiz/#/sale/dealerLists",
                "Snapshot=t165.inf",
                LAST);


        web_url("selectProducts.html",
                "URL=http://10.40.1.10:8100/ebiz/view/product/selectProducts.html",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=http://10.40.1.10:8100/ebiz/#/sale/neworder/dealer",
                "Snapshot=t166.inf",
                "Mode=HTTP",
                LAST);

/*        web_reg_save_param("SubDescription",
      "LB=\"AttrDesc\":\"",
                "RB=\",",
                "Ord=1",
                LAST);*/

        web_set_max_html_param_len("999999");

       web_reg_save_param("code",
                "LB={\"ProductCode\":\"",
                "RB=\",",
                "Ord=1",
                LAST);

        web_reg_save_param("price",
                "LB=\"SalePrice\":",
                "RB=,",
                "Ord=1",
                LAST);

       web_reg_save_param("name",
                "LB=\"Fullname\":\"",
                "RB=\",",
                "Ord=1",
                LAST);

        web_reg_save_param("check",
                "LB=\"Code\":",
                "RB=,",
                LAST);

        web_reg_save_param("errorinfo",
                "LB={",
                "RB=,\"Proposal\"",
                LAST);

        web_url("GetShelvesSkuList",
                "URL=http://10.40.1.10:8100/site/Product/GetShelvesSkuList?CurPage=1&FullName=&MarketingDealerOrgId={dealerid}&PageSize=10&ProductCode=",
                "Resource=1",
                "RecContentType=application/json",
                "Referer=http://10.40.1.10:8100/ebiz/#/sale/neworder/dealer",
                "Snapshot=t167.inf",
                LAST);

        web_url("neworder.info.html",
                "URL=http://10.40.1.10:8100/ebiz/view/sale/neworder.info.html",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=http://10.40.1.10:8100/ebiz/#/sale/neworder/products?type=3&OrgId={dealerid}",
                "Snapshot=t168.inf",
                "Mode=HTTP",
                LAST);

        web_url("Get",
                "URL=http://10.40.1.10:8100/site/SystemSetting/Get",
                "Resource=1",
                "RecContentType=application/json",
                "Referer=http://10.40.1.10:8100/ebiz/#/sale/neworder/products?type=3&OrgId={dealerid}",
                "Snapshot=t169.inf",
                LAST);

        web_url("GetSettingInfo",
                "URL=http://10.40.1.10:8100/site/SystemSetting/GetSettingInfo?SupplierOrgId=",
                "Resource=1",
                "RecContentType=application/json",
                "Referer=http://10.40.1.10:8100/ebiz/#/sale/neworder/products?type=3&OrgId={dealerid}",
                "Snapshot=t170.inf",
                LAST);

        web_custom_request("SubmitOrder",
                "URL=http://10.40.1.10:8100/site/Sales/SubmitOrder",
                "Method=POST",
                "Resource=0",
                "RecContentType=application/json",
                "Referer=http://10.40.1.10:8100/ebiz/#/sale/neworder/info",
                "Snapshot=t174.inf",
                "Mode=HTTP",
                "EncType=application/json;charset=utf-8",                                           
                //"Body={\"DealerOrgId\":\"{dealerid}\",\"DealerOrgName\":\"{dealername}\",\"SupplierOrgType\":0,\"DealerOrgType\":2,\"Remark\":\"\",\"ShipmentAddress\":\"\",\"isCredit\":false,\"isEntrust\":false,\"BillId\":\"\",\"TotalValue\":12.35,\"SettlementTotalValue\":\"12.35\",\"ProductData\":\"[{\\\"ID\\\":1,\\\"Price\\\":12.35,\\\"ProductCode\\\":\\\"1000021686\\\",\\\"ProductName\\\":\\\"TANG\\\",\\\"ProductSubCode\\\":\\\"006\\\",\\\"Quantity\\\":1,\\\"SettlementPrice\\\":12.35,\\\"UomCode\\\":\\\"00001\\"
                //"\",\\\"UomName\\\":\\\"\\\\u4e2a\\\",\\\"SubDescription\\\":\\\"{SubDescription}\\\"}]\"}",
                //"Body={\"DealerOrgId\":\"{dealerid}\",\"DealerOrgName\":\"{dealername}\",\"SupplierOrgType\":0,\"DealerOrgType\":2,\"Remark\":\"\",\"ShipmentAddress\":\"\",\"isCredit\":false,\"isEntrust\":false,\"BillId\":\"\",\"TotalValue\":12,\"SettlementTotalValue\":\"12.35\",\"ProductData\":\"[{\\\"ID\\\":1,\\\"Price\\\":{price},\\\"ProductCode\\\":\\\"{code}\\\",\\\"ProductName\\\":\\\"{name}\\\",\\\"ProductSubCode\\\":\\\"006\\\",\\\"Quantity\\\":1,\\\"SettlementPrice\\\":12.35,\\\"UomCode\\\":\\\"00001\\\",\\\"UomName\\\":\\\"\\\\u4e2a\\\",\\\"SubDescription\\\":\\\"{SubDescription}\\\"}]\"}",
                "Body={\"DealerOrgId\":\"{dealerid}\",\"DealerOrgName\":\"{dealername}\",\"SupplierOrgType\":0,\"DealerOrgType\":2,\"Remark\":\"\",\"ShipmentAddress\":\"\",\"isCredit\":false,\"isEntrust\":false,\"BillId\":\"\",\"TotalValue\":12.35,\"SettlementTotalValue\":\"12.35\",\"ProductData\":\"[{\\\"ID\\\":1,\\\"Price\\\":{price},\\\"ProductCode\\\":\\\"code\\\",\\\"ProductName\\\":\\\"name\\\",\\\"ProductSubCode\\\":\\\"006\\\",\\\"Quantity\\\":1,\\\"SettlementPrice\\\":12.35,\\\"UomCode\\\":\\\"00001\\"
                "\",\\\"UomName\\\":\\\"\\\\u4e2a\\\",\\\"SubDescription\\\":\\\"\\\"}]\"}",
                LAST);


        if(atoi(lr_eval_string("{check}"))==0)
                lr_end_transaction("add_order", LR_PASS);
        else
        {
                lr_error_message(lr_eval_string("{errorinfo}"));
                lr_end_transaction("add_order", LR_FAIL);
        }


        return 0;
}

tangxuelian 发表于 2016-8-3 09:27:11

我回放的没有错误,参数也取到值了
add_order.c(46): Notify: Saving Parameter "sellerid = 1100142744".
add_order.c(46): Notify: Saving Parameter "dealerid = 1103693170".
add_order.c(46): Notify: Saving Parameter "dealername = txli2033253852".

add_order.c(133): Notify: Parameter Substitution: parameter "dealerid" ="1103693170"
add_order.c(133): Notify: Parameter Substitution: parameter "dealername" ="txli2033253852"
add_order.c(133): Notify: Parameter Substitution: parameter "price" ="12.35"

seagull1985 发表于 2016-8-3 10:55:13

抓个包。。看看。。。请求出去的数据有没有错。。如果没错。。就是服务端的问题了。。看下服务端的日志

tangxuelian 发表于 2016-8-3 11:58:16

我一个一个参数排查的,现在找到问题了,是productcode何fullname这2个地方关联参数插不进去,我改成静态的值就可以了,但是关联看的参数是取到了,不知道为什么最后提交数据的时候就不入库
{"Code":0,"Message":"鎴愬姛","Proposal":"","Value":{"TotalRows":6,"CurPage":1,"List":[{"ProductCode":"1000000001","Fullname":"tang","AttrDesc":"color:blue;","UomName":"涓?,"UomCode":"00001","SalePrice":12.35,"ProductSubCode":"006","ProductSubName":null,"DiscountPrice":12.35,"OrgId":"5000000007","Barcode":"21345325","BuyPrice":10.0,"MarketingName":"","ImgUrl":null,"IsAllowDecimal":false}
以上是服务器返回的数据,我想取productcode何fullname,不知道是不是关联的问题呢
web_reg_save_param("code",
                "LB={\"ProductCode\":\"",
                "RB=\",",
                "Ord=1",
                LAST);

        web_reg_save_param("name",
           "LB=\"Fullname\":\"",
           "RB=\",",
           "Ord=1",
           LAST);

jingzizx 发表于 2016-8-3 17:24:32

数据库收到的是与你发的一样吗

tangxuelian 发表于 2016-8-3 18:04:29

服务器返回的信息时根据登录名获取的,我看的是一样的,price可以正常获取并用作参数插入数据库,但是productcode和fullname就是有问题,回放的脚本也没有错误,不知从何下手,有哪位大神知道的
页: [1]
查看完整版本: LR 关联的参数无法入库