Browse Source

优化网口打印,改版本号

张洋 6 years ago
parent
commit
6f18db7d4a

+ 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.1.9"
+!define PRODUCT_VERSION "1.0.2.0"
 !define PRODUCT_PUBLISHER "深圳市迅享科技有限公司"
 !define PRODUCT_WEB_SITE "https://www.lewaimai.com"
 !define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\${PRODUCT_NAME}.exe"

BIN
lewaimai_pos_windows/resource/lewaimai_pos_windows.aps


BIN
lewaimai_pos_windows/resource/lewaimai_pos_windows.rc


+ 10 - 3
lewaimai_pos_windows/tool/CPosPrinter.cpp

@@ -474,7 +474,7 @@ void CPosPrinter::PrintWaimaiOrderShouyin(CWaimaiOrder& order)
         catch(std::exception& e)
         {
             std::string err = e.what();
-            LOG_INFO("打印机失败,IP地址:" << wangkou_ip.c_str() << ",错误信息:" << err.c_str());
+            LOG_INFO("网口打印机连接失败,IP地址:" << wangkou_ip.c_str() << ",错误信息:" << err.c_str());
         }
     }
 
@@ -900,6 +900,11 @@ void CPosPrinter::PrintWaimaiOrderShouyin(CWaimaiOrder& order)
     {
         CloseHandle((*it).hPort);
     }
+
+	if (m_type == 2)
+	{
+		m_socket.close();
+	}
 }
 
 void CPosPrinter::PrintWaimaiOrderBiaoqian(CWaimaiOrder& order)
@@ -1025,7 +1030,7 @@ void CPosPrinter::PrintWaimaiOrderChufang(CWaimaiOrder& order)
         catch(std::exception& e)
         {
             std::string err = e.what();
-            LOG_INFO("连接厨房打印机失败,IP地址:" << ip.c_str() << ",错误信息:" << err.c_str());
+            LOG_INFO("厨房网口打印机连接失败,IP地址:" << ip.c_str() << ",错误信息:" << err.c_str());
 
             //连接失败了,处理下一个厨房打印机
             continue;
@@ -1313,6 +1318,7 @@ int CPosPrinter::WriteBuf(const unsigned char* buf, int len)
 {
     if(m_type == 1)
     {
+		//USB、串口、并口,走这里
         DWORD dwWrite;
 
         for(std::vector<PrinterHandle>::iterator it = m_hPorts.begin(); it != m_hPorts.end(); it++)
@@ -1361,13 +1367,14 @@ int CPosPrinter::WriteBuf(const unsigned char* buf, int len)
     }
     else
     {
+		//网口走这里
         try
         {
             m_socket.write_some(boost::asio::buffer(buf, len));
         }
         catch(const std::exception& e)
         {
-            LOG_INFO(e.what());
+			LOG_INFO("网口打印机发送消息失败,错误信息:" << e.what());
         }
 
         return 0;