张洋 1 rok temu
rodzic
commit
f4a2a4e114

BIN
bin/Win32/Release/setup/zhipuzi_pos_windows_setup_1.0.2.2.exe


+ 1 - 1
bin/Win32/Release/setup/智铺子收银系统安装脚本.nsi

@@ -2,7 +2,7 @@
 
 ; HM NIS Edit Wizard helper defines
 !define PRODUCT_NAME "智铺子收银系统"
-!define PRODUCT_VERSION "1.0.2.2"
+!define PRODUCT_VERSION "1.0.2.3"
 !define PRODUCT_PUBLISHER "深圳市迅享智慧云科技有限公司"
 !define PRODUCT_WEB_SITE "https://www.zhipuzi.com"
 !define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\${PRODUCT_NAME}.exe"

BIN
zhipuzi_pos_windows/resource/zhipuzi_pos_windows.aps


BIN
zhipuzi_pos_windows/resource/zhipuzi_pos_windows.rc


+ 8 - 6
zhipuzi_pos_windows/worker/CMqttClientWorker.cpp

@@ -35,11 +35,7 @@ void CMqttClientWorker::Stop()
 {
     m_is_running = false;
 
-	//等待进程结束
-	while (m_nStopNum < 1)
-	{
-		Sleep(50);
-	}
+	Sleep(100);
 }
 
 void CMqttClientWorker::Run()
@@ -92,7 +88,6 @@ void CMqttClientWorker::Run()
     catch(const mqtt::exception& exc)
     {
         LOG_INFO(("disconnect error, exc:" + exc.get_message()).c_str());
-        return;
     }
 
 	//销毁客户端
@@ -409,9 +404,16 @@ void CMqttClientWorker::HandleMessage(std::string message)
 	}
 	else if (type == "shouyintai_order")
 	{
+		std::string order_id = CLewaimaiJson::ToString(data["order_id"]);
 		std::string content = CLewaimaiJson::ToString(data["content"]);
 
 		CVoiceWorker::GetInstance()->AddVoice(content);
+
+		if (CSetting::GetInstance()->GetParam("setting_is_new_diannei_saomadiancan_printer") == "1")
+		{
+			CPosPrinter printer;
+			printer.PrintShoukuanOrder(order_id);
+		}
 	}
 	else if (type == "tangshi_service")
 	{

+ 4 - 8
zhipuzi_pos_windows/worker/CVoiceWorker.cpp

@@ -36,11 +36,7 @@ void CVoiceWorker::Stop()
 
 	m_voice_mutex.unlock();
 
-	//等待进程结束
-	while (m_nStopNum < 2)
-	{
-		Sleep(50);
-	}
+	Sleep(100);
 }
 
 void CVoiceWorker::AddVoice(int voice_type)
@@ -72,7 +68,7 @@ void CVoiceWorker::HandleVoice()
 		{
 			m_voice_mutex.unlock();
 
-			CSystem::my_sleep(1);
+			Sleep(100);
 			continue;
 		}
 
@@ -113,7 +109,7 @@ void CVoiceWorker::HandleVoice()
 		}
 
 		//8秒内最多播放一次
-		CSystem::my_sleep(8);
+		//CSystem::my_sleep(8);
 	}
 
 	AddStopNum();
@@ -130,7 +126,7 @@ void CVoiceWorker::HandleVoiceContent()
 		{
 			m_voice_mutex.unlock();
 
-			CSystem::my_sleep(1);
+			Sleep(100);
 			continue;
 		}