Commit a0d9c64d by guanghui.cui

增加空值判断

parent 166f20c2
......@@ -233,6 +233,12 @@ void* listen_pos_func(void* arg)
int main(int argc,char *argv[])
{
////--------test------------
//JsonModule jsonTest;
//std::string json = "{\"alertTime\":1534416551000,\"channel\":\"201\",\"id\":117049102732151083,\"pcId\":\"10\",\"qty\":0,\"saftQty\":1,\"selfMacId\":\"2027490121\",\"shelfNo\":\"20274901210405\",\"sku\":\"20627836\",\"storeId\":\"202749\",\"pk_id\":1}";
//std::string rltTest;
//jsonTest.convertDataOds2Pos(json, rltTest);
////-------------------------
if (2 == argc && 0 == strcmp("-v", argv[1])) {
printf("version:%s\n", VERSION);
return 0;
......@@ -387,7 +393,7 @@ int main(int argc,char *argv[])
{
LOG(INFO) << "----------- PLUGIN ===>> POS ------------";
LOG(INFO) << pushPosData;
if (!order_send_to_pos(pushPosData, odsPushData, responseData)) {
if (!pushPosData.empty() && !order_send_to_pos(pushPosData, odsPushData, responseData)) {
jsonTool.getOdsResponseData(101, "send to pos failed or receive data illegal!", odsPushData, responseData);
}
}else
......
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