|
@@ -242,15 +242,9 @@ void CMqttClientWorker::HandleMessage(std::string message)
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- int type;
|
|
|
|
|
- if (document["msg_type"].IsInt())
|
|
|
|
|
- {
|
|
|
|
|
- type = document["msg_type"].GetInt();
|
|
|
|
|
- }
|
|
|
|
|
- else
|
|
|
|
|
- {
|
|
|
|
|
- type = atoi(document["msg_type"].GetString());
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ rapidjson::Value& data = document["data"];
|
|
|
|
|
+
|
|
|
|
|
+ int type = CLewaimaiJson::ToInt(data["msg_type"]);
|
|
|
|
|
|
|
|
if (type == MESSAGE_TYPE::LOGIN_OFFLINE)
|
|
if (type == MESSAGE_TYPE::LOGIN_OFFLINE)
|
|
|
{
|
|
{
|
|
@@ -259,8 +253,8 @@ void CMqttClientWorker::HandleMessage(std::string message)
|
|
|
}
|
|
}
|
|
|
else if (type == MESSAGE_TYPE::NEW_WAIMAI_ORDER)
|
|
else if (type == MESSAGE_TYPE::NEW_WAIMAI_ORDER)
|
|
|
{
|
|
{
|
|
|
- std::string order_id = document["waimai_order_id"].GetString();
|
|
|
|
|
- std::string order_no = document["waimai_order_no"].GetString();
|
|
|
|
|
|
|
+ std::string order_id = CLewaimaiJson::ToString(data["waimai_order_id"]);
|
|
|
|
|
+ std::string order_no = CLewaimaiJson::ToString(data["waimai_order_no"]);
|
|
|
|
|
|
|
|
//新订单来了,首先判断是否要语音提醒
|
|
//新订单来了,首先判断是否要语音提醒
|
|
|
if (CSetting::GetInstance()->GetParam("setting_is_new_waimai_voice") == "1")
|
|
if (CSetting::GetInstance()->GetParam("setting_is_new_waimai_voice") == "1")
|
|
@@ -294,7 +288,7 @@ void CMqttClientWorker::HandleMessage(std::string message)
|
|
|
}
|
|
}
|
|
|
else if (type == MESSAGE_TYPE::NEW_KAUICANTANGSHI_ORDER)
|
|
else if (type == MESSAGE_TYPE::NEW_KAUICANTANGSHI_ORDER)
|
|
|
{
|
|
{
|
|
|
- std::string order_id = document["waimai_order_id"].GetString();
|
|
|
|
|
|
|
+ std::string order_id = CLewaimaiJson::ToString(data["waimai_order_id"]);
|
|
|
|
|
|
|
|
//新订单来了,首先判断是否要语音提醒
|
|
//新订单来了,首先判断是否要语音提醒
|
|
|
if (CSetting::GetInstance()->GetParam("setting_is_new_diannei_voice") == "1")
|
|
if (CSetting::GetInstance()->GetParam("setting_is_new_diannei_voice") == "1")
|
|
@@ -310,7 +304,7 @@ void CMqttClientWorker::HandleMessage(std::string message)
|
|
|
}
|
|
}
|
|
|
else if (type == MESSAGE_TYPE::NEW_KUAICANSHANGJIAAPP_ORDER)
|
|
else if (type == MESSAGE_TYPE::NEW_KUAICANSHANGJIAAPP_ORDER)
|
|
|
{
|
|
{
|
|
|
- std::string order_id = document["waimai_order_id"].GetString();
|
|
|
|
|
|
|
+ std::string order_id = CLewaimaiJson::ToString(data["waimai_order_id"]);
|
|
|
|
|
|
|
|
//新订单来了,首先判断是否要语音提醒
|
|
//新订单来了,首先判断是否要语音提醒
|
|
|
if (CSetting::GetInstance()->GetParam("setting_is_new_diannei_voice") == "1")
|
|
if (CSetting::GetInstance()->GetParam("setting_is_new_diannei_voice") == "1")
|
|
@@ -326,8 +320,8 @@ void CMqttClientWorker::HandleMessage(std::string message)
|
|
|
}
|
|
}
|
|
|
else if (type == MESSAGE_TYPE::NEW_ZHENGCAN_JIACAI)
|
|
else if (type == MESSAGE_TYPE::NEW_ZHENGCAN_JIACAI)
|
|
|
{
|
|
{
|
|
|
- std::string order_id = document["waimai_order_id"].GetString();
|
|
|
|
|
- std::string jiacai_no = document["jiacai_no"].GetString();
|
|
|
|
|
|
|
+ std::string order_id = CLewaimaiJson::ToString(data["waimai_order_id"]);
|
|
|
|
|
+ std::string jiacai_no = CLewaimaiJson::ToString(data["jiacai_no"]);
|
|
|
|
|
|
|
|
if (CSetting::GetInstance()->GetParam("setting_is_new_diannei_saomadiancan_printer") == "1")
|
|
if (CSetting::GetInstance()->GetParam("setting_is_new_diannei_saomadiancan_printer") == "1")
|
|
|
{
|
|
{
|
|
@@ -344,8 +338,8 @@ void CMqttClientWorker::HandleMessage(std::string message)
|
|
|
}
|
|
}
|
|
|
else if (type == MESSAGE_TYPE::NEW_ZHENGCAN_TUICAI)
|
|
else if (type == MESSAGE_TYPE::NEW_ZHENGCAN_TUICAI)
|
|
|
{
|
|
{
|
|
|
- std::string order_id = document["waimai_order_id"].GetString();
|
|
|
|
|
- std::string tuicai_item_id = document["tuicai_item_id"].GetString();
|
|
|
|
|
|
|
+ std::string order_id = CLewaimaiJson::ToString(data["waimai_order_id"]);
|
|
|
|
|
+ std::string tuicai_item_id = CLewaimaiJson::ToString(data["tuicai_item_id"]);
|
|
|
|
|
|
|
|
if (CSetting::GetInstance()->GetParam("setting_is_new_diannei_saomadiancan_printer") == "1")
|
|
if (CSetting::GetInstance()->GetParam("setting_is_new_diannei_saomadiancan_printer") == "1")
|
|
|
{
|
|
{
|
|
@@ -355,7 +349,7 @@ void CMqttClientWorker::HandleMessage(std::string message)
|
|
|
}
|
|
}
|
|
|
else if (type == MESSAGE_TYPE::NEW_ZHENGCAN_JIESUAN)
|
|
else if (type == MESSAGE_TYPE::NEW_ZHENGCAN_JIESUAN)
|
|
|
{
|
|
{
|
|
|
- std::string order_id = document["waimai_order_id"].GetString();
|
|
|
|
|
|
|
+ std::string order_id = CLewaimaiJson::ToString(data["waimai_order_id"]);
|
|
|
|
|
|
|
|
if (CSetting::GetInstance()->GetParam("setting_is_new_diannei_saomadiancan_printer") == "1")
|
|
if (CSetting::GetInstance()->GetParam("setting_is_new_diannei_saomadiancan_printer") == "1")
|
|
|
{
|
|
{
|