Commit d28fc2cc by unknown

Fix 1:修复编译出错问题

parent 2a952a5e
......@@ -51,8 +51,8 @@ using namespace rapidjson;
// std::string strOrderid = vOrderid.GetString();
// LOG(INFO)<<"statusCode:"<<iStatusCode;
// LOG(INFO)<<"msg:"<<strMsg.data();
// LOG(INFO)<<"orderId:"<<strOrderid.data();
// LOG(INFO)<<"msg:"<<strMsg;
// LOG(INFO)<<"orderId:"<<strOrderid;
// }
// }
......@@ -133,6 +133,7 @@ bool JsonModule::getPushOrders(IN const char* json,OUT orderObj &order)
order.create_time = createTime.GetString();
//用户信息
//TODO 顾客信息为数组 因接口改版目前只有一个顾客信息
rapidjson::Value& customer_array = orderContent_obj["customer"];
if(customer_array.IsArray())
{
......@@ -143,7 +144,7 @@ bool JsonModule::getPushOrders(IN const char* json,OUT orderObj &order)
order.customerInfo.account = accountId.GetString();
rapidjson::Value& accountType= customer_obj["accountType"];
order.customerInfo.account_type = atoi(accountType.GetString().data());
order.customerInfo.account_type = atoi(accountType.GetString());
rapidjson::Value& level = customer_obj["level"];
order.customerInfo.account_level = level.GetString();
......@@ -159,7 +160,7 @@ bool JsonModule::getPushOrders(IN const char* json,OUT orderObj &order)
rapidjson::Value& orders_obj = orderContent_obj["orders"];
rapidjson::Value& deliveryStatus = orders_obj["deliveryStatus"];
order.deliveryInfo.status = atoi(deliveryStatus.GetString().data());
order.deliveryInfo.status = atoi(deliveryStatus.GetString());
rapidjson::Value& deliveryStatusDesc = orders_obj["deliveryStatusDesc"];
order.deliveryInfo.status_desc = deliveryStatusDesc.GetString();
......@@ -173,7 +174,7 @@ bool JsonModule::getPushOrders(IN const char* json,OUT orderObj &order)
rapidjson::Value& remark = orders_obj["remark"];
remark.GetString();
rapidjson::Value& status = orders_obj["status"];
order.status = atoi(status.GetString().data());
order.status = atoi(status.GetString());
rapidjson::Value& statusDesc = orders_obj["statusDesc"];
order.status_desc = statusDesc.GetString();
......@@ -260,7 +261,7 @@ bool JsonModule::getPushOrders(IN const char* json,OUT orderObj &order)
detail.amount = amount.GetInt();
rapidjson::Value& payType = payInfos_obj["payType"];
detail.type = atoi(payType.GetString().data());
detail.type = atoi(payType.GetString());
rapidjson::Value& transNum = payInfos_obj["transNum"];
detail.trans_id = transNum.GetString();
......@@ -277,7 +278,7 @@ bool JsonModule::getPushOrders(IN const char* json,OUT orderObj &order)
rapidjson::Value& totalPoint= points_obj["totalPoint"];
char temp[20]={0};
int iPoint=totalPoint.GetInt();
itoa(iPoint,temp,10);
sprintf(temp, "%d", iPoint);
order.bonusInfo.summary = temp;
//积分信息详情
......@@ -308,7 +309,7 @@ bool JsonModule::getPushOrders(IN const char* json,OUT orderObj &order)
detail.sku = sku.GetString();
rapidjson::Value& type = pointDetails_obj["type"];
detail.type = atoi(type.GetString().data());
detail.type = atoi(type.GetString());
order.bonusInfo.vecDetail.push_back(detail);
}
......@@ -580,7 +581,7 @@ bool JsonModule::convertDataOds2Pos(const std::string &data, std::string &result
{
bool rlt=true;
orderObj order;
rlt=getPushOrders(data.data(),order);
rlt=getPushOrders(data.c_str(),order);
if(ORDERSTATUS_NEW==order.status){
result = _convertToNewOrderJson(order);
}
......
#ifndef JSON_MODULE_H
#define JSON_MODULE_H
#include <stdlib.h>
#include <stdio.h>
#include "../base/CommonStruct.h"
#include "../base/BaseDefine.h"
//std::string GetTestJson(const int statuscode,const char* msg,const char* orderid);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment