|
|
@@ -3,6 +3,8 @@
|
|
|
|
|
|
#include "../tool/CPosPrinter.h"
|
|
|
|
|
|
+#include "mmsystem.h"
|
|
|
+
|
|
|
CMessagePush::~CMessagePush()
|
|
|
{
|
|
|
|
|
|
@@ -96,6 +98,21 @@ void CMessagePush::HandleMessage(std::string msg)
|
|
|
std::string order_id = document["order_id"].GetString();
|
|
|
std::string order_no = document["order_no"].GetString();
|
|
|
|
|
|
+ //新订单来了,首先判断是否要语音提醒
|
|
|
+ if (CSetting::GetParam("setting_is_new_waimai_voice") == "1")
|
|
|
+ {
|
|
|
+ //需要语音提醒
|
|
|
+ std::wstring filepath = L"music/new_wamai_order.mp3";
|
|
|
+ std::wstring Open = L"OPEN " + filepath + L" ALIAS MUSIC";
|
|
|
+ mciSendString(Open.c_str(), NULL, 0, 0);
|
|
|
+
|
|
|
+ std::wstring Play = L"PLAY MUSIC FROM 0";
|
|
|
+ mciSendString(Play.c_str(), NULL, 0, 0);
|
|
|
+
|
|
|
+ std::wstring Close = L"CLOSE MUSIC";
|
|
|
+ mciSendString(Close.c_str(), NULL, 0, 0);
|
|
|
+ }
|
|
|
+
|
|
|
CPosPrinter printer;
|
|
|
printer.PrintWaimaiOrder(order_id, order_no);
|
|
|
}
|