Commit 0074e707 by unknown

Fix 1:修复部分字段类型错误

parent 2410d3ad
......@@ -81,7 +81,7 @@ bool JsonModule::getPushOrders(IN const char* json,OUT orderObj &order)
}
else
{
rapidjson::Value& channel = documentdocument["channel"];
rapidjson::Value& channel = document["channel"];
order.channel=channel.GetString();
rapidjson::Value& order_id = document["order_id"];
......@@ -312,18 +312,23 @@ bool JsonModule::getOdsResponseData(const std::string &posResponse, const std::s
bool JsonModule::convertDataPos2Ods(const std::string &data, std::string &result)
{
return true;
}
bool JsonModule::convertDataOds2Pos(const std::string &data, std::string &result)
{
bool rlt=true;
orderObj order;
rlt=getPushOrders(data.data(),order);
if(ORDERSTATUS_NEW==order.status){
result = _convertToNewOrderJson(order);
}
else if(ORDERSTATUS_CONFIRMED==order_status||ORDERSTATUS_CANCELED==order_status||ORDERSTATUS_SHIPPING==order_status||ORDERSTATUS_COMPLETE==order_status||ORDERSTATUS_REFUND_COMPLETE){
else if(ORDERSTATUS_CONFIRMED==order.status||ORDERSTATUS_CANCELED==order.status||ORDERSTATUS_SHIPPING==order.status||ORDERSTATUS_COMPLETE==order.status||ORDERSTATUS_REFUND_COMPLETE){
orderStatusObj statusObj;
_getStatusObj(order,statusObj);
result = _convertToOrderStatusJson(statusObj);
}
else if(ORDERSTATUS_REFUND_FULL==order_status||ORDERSTATUS_REFUND_PART==order_status){
else if(ORDERSTATUS_REFUND_FULL==order.status||ORDERSTATUS_REFUND_PART==order.status){
refundObj refund;
_getRefundObj(order,refund);
result = _convertToRefundJson(refund);
......@@ -331,11 +336,6 @@ bool JsonModule::convertDataPos2Ods(const std::string &data, std::string &result
return rlt;
}
bool JsonModule::convertDataOds2Pos(const std::string &data, std::string &result)
{
return true;
}
std::string JsonModule::_convertToNewOrderJson(orderObj &obj)
{
rapidjson::StringBuffer buffer;
......
......@@ -190,20 +190,24 @@ int main()
// 注册socket信息
while(true)
{
g_init_data = "{\"fm_cmd\": 1000,\"store_id\": \"0001\",\"pos_id\": \"0001\",\"operator_id\": \"00001\",\"business_date\": \"20171225\",\"is_master\": false,\"listen_port\": 3289}";
if(!g_init_data.empty())
{
if( ods.send(g_init_data) )
{
ods.receive(odsPushData);
break;
}
}
usleep(500);
sleep(1);
continue;
}
}else
{
LOG(INFO) << "连接ODS失败";
sleep(2);
continue;
usleep(800);
}
}
......
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