Browse Source

先保存一下

张洋 3 years ago
parent
commit
f4056da74a

+ 28 - 0
bin/Win32/Debug/zhipuzi_pos_windows/skin/attention_dlg.xml

@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Window size="600,434" caption="0,0,0,44" roundcorner="4,4" >
+	<Font id="0" name="微软雅黑" size="26" />
+	<Font id="1" name="微软雅黑" size="32" />
+	<Font id="2" name="微软雅黑" size="22" />
+	<Font id="3" name="微软雅黑" size="20" />
+	<Font id="4" name="微软雅黑" size="18" />
+	
+	<VerticalLayout bkimage="shoukuan_bkg.png" >
+		<HorizontalLayout name="shoukuan_title_bkg" height="44" bkcolor="0xFF3CB371">
+			<Label name="memo_dlg_title" text="" height="44" align="center" valign="center" padding="0,0,0,0" textcolor="#FFFFFFFF" font="2"/>
+			<Button name="closebtn" keyboard="false" padding="0,13,15,0" width="16" height="16" normalimage="file='close_normal.png'" hotimage="file='close_hover.png'" pushedimage="file='close_normal.png'"/>
+		</HorizontalLayout>
+		
+		<HorizontalLayout>
+			<VerticalLayout>
+				<Label name="name" text="" height="30" padding="30,100,0,0" align="center" font="3"/>
+				
+				<HorizontalLayout height="56" valign="center" padding="30,100,0,20">
+					<Control></Control>
+					<Button name="save" align="center" text="确认" textcolor="#FFFFFFFF" height="50" width="250" padding="0,0,0,0" normalimage="file='green_zhengchang.png' corner='5,5,5,5'" hotimage="file='green_xuanfu.png' corner='5,5,5,5'" pushedimage="file='green_dianji.png' corner='5,5,5,5'" />
+					<Control></Control>
+				</HorizontalLayout>
+			</VerticalLayout>
+		</HorizontalLayout>
+		
+	</VerticalLayout>
+</Window>

+ 1 - 1
bin/Win32/Debug/zhipuzi_pos_windows/skin/login.xml

@@ -13,7 +13,7 @@
 		
 		<HorizontalLayout height="90">
 			<Control></Control>
-			<HorizontalLayout bkimage="file='logo_guanwang.png'" width="202" height="43" padding="0,20,0,0"></HorizontalLayout>
+			<HorizontalLayout bkimage="file='logo_guanwang.png'" width="248" height="57" padding="0,20,0,0"></HorizontalLayout>
 			<Control></Control>
 		</HorizontalLayout>
 		

BIN
bin/Win32/Debug/zhipuzi_pos_windows/skin/logo_guanwang.png


+ 9 - 2
bin/Win32/Debug/zhipuzi_pos_windows/skin/setting_diannei_tixing.xml

@@ -1,14 +1,14 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <Window>
 	<HorizontalLayout height="44">
-		<Label text="新订单语音通知" width="260" />
+		<Label text="快餐扫码点餐新订单语音通知" width="260" />
 		<CheckBox name="setting_is_new_diannei_voice" width="72" height="45" normalimage="file='switchbutton.png' source='0,0,143,91'" selectedimage="file='switchbutton.png' source='0,182,143,273'"/>
 	</HorizontalLayout>
 	
 	<Control height="1" bkcolor="#FFEAEAEA" padding="0,20,0,0"></Control>
 	
 	<HorizontalLayout height="44">
-		<Label text="新订单自动打印" width="260" />
+		<Label text="新订单自动打印收银小票" width="260" />
 		<CheckBox name="setting_is_new_diannei_printer" width="72" height="45" normalimage="file='switchbutton.png' source='0,0,143,91'" selectedimage="file='switchbutton.png' source='0,182,143,273'"/>
 	</HorizontalLayout>
 	
@@ -24,6 +24,13 @@
 	
 	<Control height="1" bkcolor="#FFEAEAEA" padding="0,20,0,0"></Control>
 	
+	<HorizontalLayout height="64">
+		<Label text="打印扫码点餐和手机app订单(如果一个店多台收银机请只开一台,否则多台机器会重复打印)" multiline="true" endellipsis="true" width="260" />
+		<CheckBox name="setting_is_new_diannei_saomadiancan_printer" width="72" height="45" normalimage="file='switchbutton.png' source='0,0,143,91'" selectedimage="file='switchbutton.png' source='0,182,143,273'"/>
+	</HorizontalLayout>
+	
+	<Control height="1" bkcolor="#FFEAEAEA" padding="0,20,0,0"></Control>
+	
 	<HorizontalLayout height="44">
 		<Label text="现金收款后自动打开钱箱" width="260" />
 		<CheckBox name="setting_is_diannei_xianjin_qianxiang" width="72" height="45" normalimage="file='switchbutton.png' source='0,0,143,91'" selectedimage="file='switchbutton.png' source='0,182,143,273'"/>

+ 1 - 1
bin/Win32/Debug/zhipuzi_pos_windows/skin/setting_waimai_tixing.xml

@@ -15,7 +15,7 @@
 	<Control height="1" bkcolor="#FFEAEAEA" padding="0,20,0,0"></Control>
 	
 	<HorizontalLayout height="44">
-		<Label text="新订单自动打印" width="260" />
+		<Label text="新订单自动打印收银小票" width="260" />
 		<CheckBox name="setting_is_new_waimai_printer" width="72" height="45" normalimage="file='switchbutton.png' source='0,0,143,91'" selectedimage="file='switchbutton.png' source='0,182,143,273'"/>
 	</HorizontalLayout>
 	

+ 1 - 1
bin/Win32/Debug/zhipuzi_pos_windows/skin/update.xml

@@ -9,7 +9,7 @@
 		
 		<HorizontalLayout height="80">
 			<Control></Control>
-			<HorizontalLayout bkimage="file='logo_guanwang.png'" width="202" height="43" padding="0,18,0,0"></HorizontalLayout>
+			<HorizontalLayout bkimage="file='logo_guanwang.png'" width="248" height="57" padding="0,18,0,0"></HorizontalLayout>
 			<Control></Control>
 		</HorizontalLayout>
 		

+ 2 - 2
bin/Win32/Debug/zhipuzi_pos_windows/skin/zhengcan_page.xml

@@ -5,11 +5,11 @@
 			<Control width="1" bkcolor="#FFD1D1D1"></Control>
 			
 			<VerticalLayout>
-				<VerticalLayout name="zhengcan_zhuozi_type_layout_scrolllayout" vscrollbar="true">
+				<HorizontalLayout name="zhengcan_zhuozi_type_layout_scrolllayout" vscrollbar="true">
 					<HorizontalLayout name="zhengcan_zhuozi_type_layout" padding="0,0,0,0" bkcolor="#FFFFFFFF">
 
 					</HorizontalLayout>
-				</VerticalLayout>
+				</HorizontalLayout>
 				
 				<VerticalLayout name="zhengcan_tablelist_scrolllayout" vscrollbar="true">
 					<VerticalLayout name="zhengcan_tablelist" padding="0,0,0,0">

+ 5 - 0
zhipuzi_pos_windows/control/CZhengcanTableItemUI.h

@@ -33,6 +33,11 @@ public:
 		return m_order_id;
 	}
 
+	std::string GetOrderStatus()
+	{
+		return m_order_status;
+	}
+
 	std::string GetTableName()
 	{
 		return m_table_name;

+ 23 - 0
zhipuzi_pos_windows/page/CSettingPageUI.cpp

@@ -121,6 +121,16 @@ void CSettingPageUI::InitShow()
 	{
 		box->Selected(false, false);
 	}
+	
+	box = static_cast<CCheckBoxUI*>(this->FindSubControl(_T("setting_is_new_diannei_saomadiancan_printer")));
+	if (CSetting::GetInstance()->GetParam("setting_is_new_diannei_saomadiancan_printer") == "1")
+	{
+		box->Selected(true, false);
+	}
+	else
+	{
+		box->Selected(false, false);
+	}
 
 	box = static_cast<CCheckBoxUI*>(this->FindSubControl(_T("setting_is_diannei_xianjin_qianxiang")));
 	if (CSetting::GetInstance()->GetParam("setting_is_diannei_xianjin_qianxiang") == "1")
@@ -1005,6 +1015,19 @@ void CSettingPageUI::HandleClickMsg(TNotifyUI& msg)
 			CSetting::GetInstance()->SetParam("setting_is_new_diannei_chufang_printer", "1");
 		}
 	}
+	else if (name == _T("setting_is_new_diannei_saomadiancan_printer"))
+	{
+		CCheckBoxUI* box = static_cast<CCheckBoxUI*>(this->FindSubControl(_T("setting_is_new_diannei_saomadiancan_printer")));
+
+		if (box->IsSelected())
+		{
+			CSetting::GetInstance()->SetParam("setting_is_new_diannei_saomadiancan_printer", "0");
+		}
+		else
+		{
+			CSetting::GetInstance()->SetParam("setting_is_new_diannei_saomadiancan_printer", "1");
+		}
+	}
 	else if (name == _T("setting_is_diannei_xianjin_qianxiang"))
 	{
 		CCheckBoxUI* box = static_cast<CCheckBoxUI*>(this->FindSubControl(_T("setting_is_diannei_xianjin_qianxiang")));

+ 106 - 14
zhipuzi_pos_windows/page/CZhengcanPageUI.cpp

@@ -6,6 +6,7 @@
 #include "../tool/CSqlite3.h"
 
 #include "../wnd/CZhengcanKaitaiWnd.h"
+#include "../wnd/CAttentionWnd.h"
 
 CZhengcanPageUI::CZhengcanPageUI()
 {
@@ -250,13 +251,6 @@ void CZhengcanPageUI::RefreshTableShow()
 
 void CZhengcanPageUI::DoRefreshTable()
 {
-	m_table_mutex.lock();
-
-	m_tableLayout = static_cast<CVerticalLayoutUI*>(this->FindSubControl(_T("zhengcan_tablelist")));
-	m_tableLayout->RemoveAll();
-
-	m_table_items.clear();
-
 	std::map<string, string> params;
 
 	if (m_cur_type_id == "all")
@@ -274,7 +268,6 @@ void CZhengcanPageUI::DoRefreshTable()
 	bool ret = CZhipuziHttpClient::GetInstance()->Request(url.c_str(), params, response);
 	if (ret == false)
 	{
-		m_table_mutex.unlock();
 		return;
 	}
 
@@ -284,14 +277,12 @@ void CZhengcanPageUI::DoRefreshTable()
 	if (document.HasParseError())
 	{
 		LOG_INFO("parse response error!");
-		m_table_mutex.unlock();
 		return;
 	}
 
 	if (!document.HasMember("errcode") || !document.HasMember("errmsg"))
 	{
 		LOG_INFO("json error!");
-		m_table_mutex.unlock();
 		return;
 	}
 
@@ -299,16 +290,22 @@ void CZhengcanPageUI::DoRefreshTable()
 	int errcode = v_errcode.GetInt();
 	if (errcode != 0)
 	{
-		m_table_mutex.unlock();
 		return;
 	}
 
 	if (!document.HasMember("data"))
 	{
-		m_table_mutex.unlock();
 		return;
 	}
 
+	//网络请求结束,要进行处理了,加锁
+	m_table_mutex.lock();
+
+	m_tableLayout = static_cast<CVerticalLayoutUI*>(this->FindSubControl(_T("zhengcan_tablelist")));
+	m_tableLayout->RemoveAll();
+
+	m_table_items.clear();
+
 	rapidjson::Value& data = document["data"];
 	rapidjson::Value& table = data["table"];
 
@@ -430,6 +427,7 @@ void CZhengcanPageUI::ClickTableAction()
 	std::string status = m_cur_click_table_item->GetStatus();
 	std::string order_id = m_cur_click_table_item->GetOrderId();
 	std::string table_name = m_cur_click_table_item->GetTableName();
+	std::string order_status = m_cur_click_table_item->GetOrderStatus();
 
 	if (m_nModel == 1)
 	{
@@ -481,8 +479,42 @@ void CZhengcanPageUI::ClickTableAction()
 		}
 		else if (status == "2")
 		{
-			//已开台
-			this->EnterTable(table_id);
+			if (order_status == "SUCCESS")
+			{
+				//表示已支付待清台
+				CAttentionWnd* pKaitaiDlg = new CAttentionWnd();
+
+				if (pKaitaiDlg != NULL)
+				{
+					pKaitaiDlg->Create(m_pManager->GetPaintWindow(), _T(""), UI_WNDSTYLE_DIALOG, WS_EX_WINDOWEDGE);
+					pKaitaiDlg->SetIcon(IDI_ICON_DUILIB);
+					pKaitaiDlg->CenterWindow();
+
+					pKaitaiDlg->SetTitle(CLewaimaiString::UTF8ToUnicode(table_name));
+					pKaitaiDlg->SetContent(L"该桌子已结账,确定要对该桌子进行清台吗?");
+
+					UINT ret = pKaitaiDlg->ShowModal();
+
+					if (ret == IDOK)
+					{
+						//开始对桌子进行清台
+						this->StartQingtai();
+
+						delete pKaitaiDlg;
+					}
+					else
+					{
+						delete pKaitaiDlg;
+
+						return;
+					}
+				}
+			}
+			else
+			{
+				//已开台
+				this->EnterTable(table_id);
+			}
 		}
 	}
 	else if (m_nModel == 2)
@@ -704,4 +736,64 @@ void CZhengcanPageUI::QurenZhuantai()
 	pZhuantaiLayout->SetVisible(false);
 
 	InitShow();
+}
+
+void CZhengcanPageUI::StartQingtai()
+{
+	//开始转菊花
+	CVerticalLayoutUI* pTableLayout = static_cast<CVerticalLayoutUI*>(this->FindSubControl(_T("zhengcan_tablelist")));
+	pTableLayout->SetVisible(false);
+
+	this->FindSubControl(_T("loading"))->SetVisible(true);
+
+	//启动一个线程,进行网络请求操作
+
+	std::thread t(&CZhengcanPageUI::DoQingtai, this);
+	t.detach();
+}
+
+void CZhengcanPageUI::DoQingtai()
+{
+	std::map<string, string> params;
+
+	params["order_id"] = m_cur_click_table_item->GetOrderId();
+
+	std::string response;
+
+	std::string url = "/dinnercash/cleartable";
+	bool ret = CZhipuziHttpClient::GetInstance()->Request(url.c_str(), params, response);
+	if (ret == false)
+	{
+		return;
+	}
+
+	rapidjson::Document document;
+	document.Parse(response.c_str());
+
+	if (document.HasParseError())
+	{
+		LOG_INFO("parse response error!");
+		return;
+	}
+
+	if (!document.HasMember("errcode") || !document.HasMember("errmsg"))
+	{
+		LOG_INFO("json error!");
+		return;
+	}
+
+	rapidjson::Value& v_errcode = document["errcode"];
+	int errcode = v_errcode.GetInt();
+	if (errcode != 0)
+	{
+		return;
+	}
+
+	if (!document.HasMember("data"))
+	{
+		return;
+	}
+
+	//清台成功,这时候要刷新桌子
+	DoRefreshTable();
 }

+ 4 - 0
zhipuzi_pos_windows/page/CZhengcanPageUI.h

@@ -64,6 +64,10 @@ public:
 	//进入到转台模式,处理相关的渲染展示
 	void ShowZhuanTai();
 
+	void StartQingtai();
+
+	void DoQingtai();
+
 private:
 	//执行开台动作,请求服务器
 	bool Kaitai(std::string table_id, std::string renshu);

+ 6 - 0
zhipuzi_pos_windows/tool/CSetting.cpp

@@ -106,6 +106,12 @@ void CSetting::Init()
 	{
 		m_paramsMap[setting_is_new_diannei_chufang_printer] = "1";
 	}
+	
+	std::string setting_is_new_diannei_saomadiancan_printer = "setting_is_new_diannei_saomadiancan_printer";
+	if (m_paramsMap.find(setting_is_new_diannei_saomadiancan_printer) == m_paramsMap.end())
+	{
+		m_paramsMap[setting_is_new_diannei_saomadiancan_printer] = "1";
+	}
 
 	std::string setting_is_diannei_xianjin_qianxiang = "setting_is_diannei_xianjin_qianxiang";
 	if (m_paramsMap.find(setting_is_diannei_xianjin_qianxiang) == m_paramsMap.end())

+ 166 - 0
zhipuzi_pos_windows/wnd/CAttentionWnd.cpp

@@ -0,0 +1,166 @@
+#include "../pch/pch.h"
+#include "CAttentionWnd.h"
+
+LRESULT CAttentionWnd::OnNcHitTest(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
+{
+	POINT pt;
+	pt.x = GET_X_LPARAM(lParam);
+	pt.y = GET_Y_LPARAM(lParam);
+	::ScreenToClient(*this, &pt);
+
+	RECT rcClient;
+	::GetClientRect(*this, &rcClient);
+
+	RECT rcCaption = m_pm.GetCaptionRect();
+	if (pt.x >= rcClient.left + rcCaption.left && pt.x < rcClient.right - rcCaption.right \
+		&& pt.y >= rcCaption.top && pt.y < rcCaption.bottom)
+	{
+		CControlUI* pControl = static_cast<CControlUI*>(m_pm.FindControl(pt));
+		if (pControl && _tcscmp(pControl->GetClass(), DUI_CTR_BUTTON) != 0)
+		{
+			return HTCAPTION;
+		}
+	}
+
+	return HTCLIENT;
+}
+
+LRESULT CAttentionWnd::OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
+{
+	SIZE szRoundCorner = m_pm.GetRoundCorner();
+	if (!::IsIconic(*this) && (szRoundCorner.cx != 0 || szRoundCorner.cy != 0))
+	{
+		CDuiRect rcWnd;
+		::GetWindowRect(*this, &rcWnd);
+		rcWnd.Offset(-rcWnd.left, -rcWnd.top);
+		rcWnd.right++;
+		rcWnd.bottom++;
+		HRGN hRgn = ::CreateRoundRectRgn(rcWnd.left, rcWnd.top, rcWnd.right, rcWnd.bottom, szRoundCorner.cx, szRoundCorner.cy);
+		::SetWindowRgn(*this, hRgn, TRUE);
+		::DeleteObject(hRgn);
+	}
+
+	bHandled = FALSE;
+	return 0;
+}
+
+LRESULT CAttentionWnd::HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
+{
+	LRESULT lRes = 0;
+	BOOL bHandled = TRUE;
+	switch (uMsg)
+	{
+	case WM_CREATE:
+		lRes = OnCreate(uMsg, wParam, lParam, bHandled);
+		break;
+	case WM_NCACTIVATE:
+		lRes = OnNcActivate(uMsg, wParam, lParam, bHandled);
+		break;
+	case WM_NCCALCSIZE:
+		lRes = OnNcCalcSize(uMsg, wParam, lParam, bHandled);
+		break;
+	case WM_NCPAINT:
+		lRes = OnNcPaint(uMsg, wParam, lParam, bHandled);
+		break;
+	case WM_NCHITTEST:
+		lRes = OnNcHitTest(uMsg, wParam, lParam, bHandled);
+		break;
+	case WM_SIZE:
+		lRes = OnSize(uMsg, wParam, lParam, bHandled);
+		break;
+	default:
+		bHandled = FALSE;
+	}
+	if (bHandled)
+	{
+		return lRes;
+	}
+	if (m_pm.MessageHandler(uMsg, wParam, lParam, lRes))
+	{
+		return lRes;
+	}
+	return CWindowWnd::HandleMessage(uMsg, wParam, lParam);
+}
+
+LRESULT CAttentionWnd::MessageHandler(UINT uMsg, WPARAM wParam, LPARAM lParam, bool& bHandled)
+{
+	if (uMsg == WM_KEYDOWN)
+	{
+		if (wParam == VK_RETURN)
+		{
+			Close(IDOK);
+
+			return true;
+		}
+		else if (wParam == VK_ESCAPE)
+		{
+			Close(IDCANCEL);
+
+			return true;
+		}
+	}
+	return false;
+}
+
+LRESULT CAttentionWnd::OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
+{
+	LONG styleValue = ::GetWindowLong(*this, GWL_STYLE);
+	styleValue &= ~WS_CAPTION;
+	::SetWindowLong(*this, GWL_STYLE, styleValue | WS_CLIPSIBLINGS | WS_CLIPCHILDREN);
+
+	// 把自己的窗口句柄与窗口绘制管理器挂接在一起
+	m_pm.Init(m_hWnd);
+
+	m_pm.AddPreMessageFilter(this);
+
+	CDialogBuilder builder;
+
+	CControlUI* pRoot = builder.Create(_T("attention_dlg.xml"), (UINT)0, NULL, &m_pm);
+	ASSERT(pRoot && "Failed to parse XML");
+
+	// 把这些控件绘制到本窗口上
+	m_pm.AttachDialog(pRoot);
+
+	// 把自己加入到CPaintManagerUI的m_aNotifiers数组中,用于处理Notify函数
+	m_pm.AddNotifier(this);
+
+	Init();
+
+	return 0;
+}
+
+void CAttentionWnd::Notify(TNotifyUI& msg)
+{
+	if (msg.sType == _T("click"))
+	{
+		DuiLib::CDuiString senderName = msg.pSender->GetName();
+
+		if (senderName == _T("closebtn"))
+		{
+			Close(IDCANCEL);
+			return;
+		}
+		else if (senderName == _T("save"))
+		{
+			Close(IDOK);
+			return;
+		}
+	}
+}
+
+void CAttentionWnd::Init()
+{
+
+}
+
+void CAttentionWnd::SetTitle(std::wstring title)
+{
+	CLabelUI* pLabel = static_cast<CLabelUI*>(m_pm.FindControl(_T("memo_dlg_title")));
+	pLabel->SetText(title.c_str());
+}
+
+void CAttentionWnd::SetContent(std::wstring content)
+{
+	CLabelUI* pLabel = static_cast<CLabelUI*>(m_pm.FindControl(_T("name")));
+	pLabel->SetText(content.c_str());
+}

+ 78 - 0
zhipuzi_pos_windows/wnd/CAttentionWnd.h

@@ -0,0 +1,78 @@
+#pragma once
+
+#include "../pch/pch.h"
+#include "CMainWnd.h"
+#include "CModalWnd.h"
+
+class CAttentionWnd : public CModalWnd
+{
+public:
+	LPCTSTR GetWindowClassName() const
+	{
+		return _T("UIMemoWndFrame");
+	};
+
+	UINT GetClassStyle() const
+	{
+		return UI_CLASSSTYLE_DIALOG;
+	};
+
+	void OnFinalMessage(HWND /*hWnd*/)
+	{
+		//WindowImplBase::OnFinalMessage(hWnd);
+		m_pm.RemovePreMessageFilter(this);
+
+		//delete this;
+	};
+
+	void Init();
+
+	void SetTitle(std::wstring title);
+
+	void SetContent(std::wstring content);
+
+	void Notify(TNotifyUI& msg);
+
+	LRESULT OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
+
+	LRESULT OnNcActivate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
+	{
+		if (::IsIconic(*this))
+		{
+			bHandled = FALSE;
+		}
+		return (wParam == 0) ? TRUE : FALSE;
+	}
+
+	LRESULT OnNcCalcSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
+	{
+		return 0;
+	}
+
+	LRESULT OnNcPaint(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
+	{
+		return 0;
+	}
+
+	LRESULT OnNcHitTest(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
+
+	LRESULT OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
+
+	LRESULT HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam);
+
+	LRESULT MessageHandler(UINT uMsg, WPARAM wParam, LPARAM lParam, bool& bHandled);
+
+	//´¦Àí¼üÅ̲¶×½½á¹û
+	void HandleTextCapture(std::string content)
+	{
+
+	}
+
+public:
+	CPaintManagerUI m_pm;
+
+	std::string m_content;
+
+	std::wstring m_errorInfo;
+};
+

+ 25 - 10
zhipuzi_pos_windows/worker/CMessagePushWorker.cpp

@@ -268,8 +268,11 @@ void CMessagePushWorker::HandelMessage(std::string msg)
 			CVoiceWorker::GetInstance()->AddVoice(5);
 		}
 
-		CPosPrinter printer;
-		printer.PrintDiandanOrder(order_id);
+		if (CSetting::GetInstance()->GetParam("setting_is_new_diannei_saomadiancan_printer") == "1")
+		{
+			CPosPrinter printer;
+			printer.PrintDiandanOrder(order_id);
+		}
 	}
 	else if (type == MESSAGE_TYPE::NEW_KUAICANSHANGJIAAPP_ORDER)
 	{
@@ -281,16 +284,22 @@ void CMessagePushWorker::HandelMessage(std::string msg)
 			CVoiceWorker::GetInstance()->AddVoice(5);
 		}
 
-		CPosPrinter printer;
-		printer.PrintDiandanOrder(order_id);
+		if (CSetting::GetInstance()->GetParam("setting_is_new_diannei_saomadiancan_printer") == "1")
+		{
+			CPosPrinter printer;
+			printer.PrintDiandanOrder(order_id);
+		}
 	}
 	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();
 
-		CPosPrinter printer;
-		printer.PrintZhengcanOrderXiadan(order_id, jiacai_no);
+		if (CSetting::GetInstance()->GetParam("setting_is_new_diannei_saomadiancan_printer") == "1")
+		{
+			CPosPrinter printer;
+			printer.PrintZhengcanOrderXiadan(order_id, jiacai_no);
+		}
 	}
 	else if (type == MESSAGE_TYPE::NEW_ZHENGCAN_H5_JIACAI)
 	{
@@ -301,14 +310,20 @@ void CMessagePushWorker::HandelMessage(std::string msg)
 		std::string order_id = document["waimai_order_id"].GetString();
 		std::string tuicai_item_id = document["tuicai_item_id"].GetString();
 
-		CPosPrinter printer;
-		printer.PrintZhengcanOrderTuicai(order_id, tuicai_item_id);
+		if (CSetting::GetInstance()->GetParam("setting_is_new_diannei_saomadiancan_printer") == "1")
+		{
+			CPosPrinter printer;
+			printer.PrintZhengcanOrderTuicai(order_id, tuicai_item_id);
+		}
 	}
 	else if (type == MESSAGE_TYPE::NEW_ZHENGCAN_JIESUAN)
 	{
 		std::string order_id = document["waimai_order_id"].GetString();
 
-		CPosPrinter printer;
-		printer.PrintZhengcanOrderJiesuan(order_id);
+		if (CSetting::GetInstance()->GetParam("setting_is_new_diannei_saomadiancan_printer") == "1")
+		{
+			CPosPrinter printer;
+			printer.PrintZhengcanOrderJiesuan(order_id);
+		}
 	}
 }

+ 2 - 0
zhipuzi_pos_windows/zhipuzi_pos_windows.vcxproj

@@ -229,6 +229,7 @@ copy $(ProjectDir)conf\ $(SolutionDir)bin\$(Platform)\$(Configuration)\conf\</Co
     </PostBuildEvent>
   </ItemDefinitionGroup>
   <ItemGroup>
+    <ClInclude Include="wnd\CAttentionWnd.h" />
     <ClInclude Include="control\CTabletypeOptionUI.h" />
     <ClInclude Include="control\CZhengcanTableItemUI.h" />
     <ClInclude Include="wnd\CZhengcanRenshuWnd.h" />
@@ -335,6 +336,7 @@ copy $(ProjectDir)conf\ $(SolutionDir)bin\$(Platform)\$(Configuration)\conf\</Co
     <ClInclude Include="helper\CSystem.h" />
   </ItemGroup>
   <ItemGroup>
+    <ClCompile Include="wnd\CAttentionWnd.cpp" />
     <ClCompile Include="control\CTabletypeOptionUI.cpp" />
     <ClCompile Include="control\CZhengcanTableItemUI.cpp" />
     <ClCompile Include="wnd\CZhengcanRenshuWnd.cpp" />

+ 6 - 0
zhipuzi_pos_windows/zhipuzi_pos_windows.vcxproj.filters

@@ -327,6 +327,9 @@
     <ClInclude Include="wnd\CZhengcanRenshuWnd.h">
       <Filter>头文件</Filter>
     </ClInclude>
+    <ClInclude Include="wnd\CAttentionWnd.h">
+      <Filter>头文件</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="pch\pch.cpp">
@@ -614,6 +617,9 @@
     <ClCompile Include="wnd\CZhengcanRenshuWnd.cpp">
       <Filter>源文件</Filter>
     </ClCompile>
+    <ClCompile Include="wnd\CAttentionWnd.cpp">
+      <Filter>源文件</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <Image Include="resource\zhipuzi.ico">