Просмотр исходного кода

先保存一下,继续调整兼容性

张洋 1 день назад
Родитель
Сommit
2e76262114
55 измененных файлов с 7 добавлено и 2583 удалено
  1. 5 4
      DuiLib/DuiLib.vcxproj
  2. 0 15
      bin/Win32/Debug/conf/lewaimai_pos_windows_server.conf
  3. BIN
      dll/debug/DuiLib.dll
  4. BIN
      dll/debug/libcrypto-3.dll
  5. BIN
      dll/debug/libeay32.dll
  6. BIN
      dll/debug/libssl-3.dll
  7. BIN
      dll/debug/ssleay32.dll
  8. BIN
      dll/release/DuiLib.dll
  9. BIN
      dll/release/libcrypto-3.dll
  10. BIN
      dll/release/libeay32.dll
  11. BIN
      dll/release/libssl-3.dll
  12. BIN
      dll/release/ssleay32.dll
  13. BIN
      lib/debug/libcrypto.lib
  14. BIN
      lib/debug/libeay32.lib
  15. BIN
      lib/debug/libssl.lib
  16. BIN
      lib/debug/ssleay32.lib
  17. BIN
      lib/debug/zs.lib
  18. BIN
      lib/release/libcrypto.lib
  19. BIN
      lib/release/libeay32.lib
  20. BIN
      lib/release/libssl.lib
  21. BIN
      lib/release/mnscpp.lib
  22. BIN
      lib/release/ssleay32.lib
  23. BIN
      lib/release/zs.lib
  24. 2 22
      zhipuzi_pos_windows.sln
  25. 0 15
      zhipuzi_pos_windows_server/conf/zhipuzi_pos_windows_server.conf
  26. 0 108
      zhipuzi_pos_windows_server/helper/CAliyunMNS.cpp
  27. 0 24
      zhipuzi_pos_windows_server/helper/CAliyunMNS.h
  28. 0 214
      zhipuzi_pos_windows_server/helper/CConfigReader.cpp
  29. 0 33
      zhipuzi_pos_windows_server/helper/CConfigReader.h
  30. 0 63
      zhipuzi_pos_windows_server/helper/CLewaimaiString.cpp
  31. 0 104
      zhipuzi_pos_windows_server/helper/CLewaimaiString.h
  32. 0 11
      zhipuzi_pos_windows_server/helper/CRandomHelper.cpp
  33. 0 40
      zhipuzi_pos_windows_server/helper/CRandomHelper.h
  34. 0 32
      zhipuzi_pos_windows_server/helper/CSystem.cpp
  35. 0 119
      zhipuzi_pos_windows_server/helper/CSystem.h
  36. 0 22
      zhipuzi_pos_windows_server/helper/define.h
  37. 0 34
      zhipuzi_pos_windows_server/main.cpp
  38. 0 180
      zhipuzi_pos_windows_server/network/CClientSession.cpp
  39. 0 61
      zhipuzi_pos_windows_server/network/CClientSession.h
  40. 0 518
      zhipuzi_pos_windows_server/network/CServer.cpp
  41. 0 72
      zhipuzi_pos_windows_server/network/CServer.h
  42. 0 15
      zhipuzi_pos_windows_server/network/PosMessage.h
  43. 0 2
      zhipuzi_pos_windows_server/obj/x86/Release/zhipuzi_pos_windows_server_linux.log
  44. 0 6
      zhipuzi_pos_windows_server/pch/pch.cpp
  45. 0 72
      zhipuzi_pos_windows_server/pch/pch.h
  46. 0 56
      zhipuzi_pos_windows_server/tool/CLewaimaiLog.cpp
  47. 0 29
      zhipuzi_pos_windows_server/tool/CLewaimaiLog.h
  48. 0 164
      zhipuzi_pos_windows_server/tool/CLewaimaiTime.cpp
  49. 0 29
      zhipuzi_pos_windows_server/tool/CLewaimaiTime.h
  50. 0 24
      zhipuzi_pos_windows_server/zhipuzi_pos_windows_server.cpp
  51. 0 127
      zhipuzi_pos_windows_server/zhipuzi_pos_windows_server_linux.vcxproj
  52. 0 21
      zhipuzi_pos_windows_server/zhipuzi_pos_windows_server_linux.vcxproj.user
  53. 0 233
      zhipuzi_pos_windows_server/zhipuzi_pos_windows_server_windows.vcxproj
  54. 0 93
      zhipuzi_pos_windows_server/zhipuzi_pos_windows_server_windows.vcxproj.filters
  55. 0 21
      zhipuzi_pos_windows_server/zhipuzi_pos_windows_server_windows.vcxproj.user

+ 5 - 4
DuiLib/DuiLib.vcxproj

@@ -21,7 +21,7 @@
   <PropertyGroup Label="Globals">
     <ProjectGuid>{E106ACD7-4E53-4AEE-942B-D0DD426DB34E}</ProjectGuid>
     <RootNamespace>DuiLib</RootNamespace>
-    <WindowsTargetPlatformVersion>7.0</WindowsTargetPlatformVersion>
+    <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
   </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='UnicodeRelease|Win32'" Label="Configuration">
@@ -118,7 +118,7 @@
       <PrecompiledHeaderOutputFile>$(IntDir)$(TargetName).pch</PrecompiledHeaderOutputFile>
       <WarningLevel>Level3</WarningLevel>
       <SuppressStartupBanner>true</SuppressStartupBanner>
-      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
       <DisableSpecificWarnings>4099;4091;4302</DisableSpecificWarnings>
     </ClCompile>
     <ResourceCompile>
@@ -156,7 +156,7 @@ copy $(SolutionDir)temp\link\$(Platform)\$(Configuration)\$(ProjectName)\DuiLib.
       <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;UILIB_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <MinimalRebuild>true</MinimalRebuild>
       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
-      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
       <PrecompiledHeader>Use</PrecompiledHeader>
       <PrecompiledHeaderFile>stdafx.h</PrecompiledHeaderFile>
       <PrecompiledHeaderOutputFile>$(IntDir)$(TargetName).pch</PrecompiledHeaderOutputFile>
@@ -202,7 +202,7 @@ copy $(SolutionDir)temp\link\$(Platform)\$(Configuration)\$(ProjectName)\DuiLib.
       <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;UILIB_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <MinimalRebuild>true</MinimalRebuild>
       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
-      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
       <PrecompiledHeader>Use</PrecompiledHeader>
       <PrecompiledHeaderFile>stdafx.h</PrecompiledHeaderFile>
       <PrecompiledHeaderOutputFile>.\Build\Debug_u/DuiLib.pch</PrecompiledHeaderOutputFile>
@@ -247,6 +247,7 @@ copy $(SolutionDir)temp\link\$(Platform)\$(Configuration)\$(ProjectName)\DuiLib.
       <PrecompiledHeaderOutputFile>.\Build\Release_u/DuiLib.pch</PrecompiledHeaderOutputFile>
       <WarningLevel>Level3</WarningLevel>
       <SuppressStartupBanner>true</SuppressStartupBanner>
+      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
     </ClCompile>
     <ResourceCompile>
       <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>

+ 0 - 15
bin/Win32/Debug/conf/lewaimai_pos_windows_server.conf

@@ -1,15 +0,0 @@
-#这个是调度中心的配置文件,“#"用来注释当前行
-
-#模式,debug或者release
-mode = release
-
-#debug环境的队列参数
-debug_pos_task_queue = prod-windows-pos-push
-
-#release环境的队列参数
-release_pos_task_queue = prod-windows-pos-push
-
-#连接阿里云的mns需要用到的参数
-mns.accountendpoint = https://1111769578085953.mns.cn-hangzhou.aliyuncs.com/
-mns.accesskeyid = 2HUnzc9XJV92PjvW
-mns.accesskeysecret = 20mMc8wuzlfC0r323b6oJqxlBPEyjW

BIN
dll/debug/DuiLib.dll


BIN
dll/debug/libcrypto-3.dll


BIN
dll/debug/libeay32.dll


BIN
dll/debug/libssl-3.dll


BIN
dll/debug/ssleay32.dll


BIN
dll/release/DuiLib.dll


BIN
dll/release/libcrypto-3.dll


BIN
dll/release/libeay32.dll


BIN
dll/release/libssl-3.dll


BIN
dll/release/ssleay32.dll


BIN
lib/debug/libcrypto.lib


BIN
lib/debug/libeay32.lib


BIN
lib/debug/libssl.lib


BIN
lib/debug/ssleay32.lib


BIN
lib/debug/zs.lib


BIN
lib/release/libcrypto.lib


BIN
lib/release/libeay32.lib


BIN
lib/release/libssl.lib


BIN
lib/release/mnscpp.lib


BIN
lib/release/ssleay32.lib


BIN
lib/release/zs.lib


+ 2 - 22
zhipuzi_pos_windows.sln

@@ -1,14 +1,10 @@
 
 Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 15
-VisualStudioVersion = 15.0.28010.2016
+# Visual Studio Version 18
+VisualStudioVersion = 18.3.11512.155 d18.3
 MinimumVisualStudioVersion = 10.0.40219.1
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zhipuzi_pos_windows", "zhipuzi_pos_windows\zhipuzi_pos_windows.vcxproj", "{1D694BE0-D976-4F29-8997-3308ADFFF413}"
 EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zhipuzi_pos_windows_server", "zhipuzi_pos_windows_server\zhipuzi_pos_windows_server_windows.vcxproj", "{2FF637C1-9F58-473C-A156-25EFE35C2FD7}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zhipuzi_pos_windows_server_linux", "zhipuzi_pos_windows_server\zhipuzi_pos_windows_server_linux.vcxproj", "{E085AFD9-5D62-44EA-A5DB-17BB32177D19}"
-EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DuiLib", "DuiLib\DuiLib.vcxproj", "{E106ACD7-4E53-4AEE-942B-D0DD426DB34E}"
 EndProject
 Global
@@ -27,22 +23,6 @@ Global
 		{1D694BE0-D976-4F29-8997-3308ADFFF413}.Release|x64.Build.0 = Release|x64
 		{1D694BE0-D976-4F29-8997-3308ADFFF413}.Release|x86.ActiveCfg = Release|Win32
 		{1D694BE0-D976-4F29-8997-3308ADFFF413}.Release|x86.Build.0 = Release|Win32
-		{2FF637C1-9F58-473C-A156-25EFE35C2FD7}.Debug|x64.ActiveCfg = Debug|x64
-		{2FF637C1-9F58-473C-A156-25EFE35C2FD7}.Debug|x64.Build.0 = Debug|x64
-		{2FF637C1-9F58-473C-A156-25EFE35C2FD7}.Debug|x86.ActiveCfg = Debug|Win32
-		{2FF637C1-9F58-473C-A156-25EFE35C2FD7}.Debug|x86.Build.0 = Debug|Win32
-		{2FF637C1-9F58-473C-A156-25EFE35C2FD7}.Release|x64.ActiveCfg = Release|x64
-		{2FF637C1-9F58-473C-A156-25EFE35C2FD7}.Release|x64.Build.0 = Release|x64
-		{2FF637C1-9F58-473C-A156-25EFE35C2FD7}.Release|x86.ActiveCfg = Release|Win32
-		{2FF637C1-9F58-473C-A156-25EFE35C2FD7}.Release|x86.Build.0 = Release|Win32
-		{E085AFD9-5D62-44EA-A5DB-17BB32177D19}.Debug|x64.ActiveCfg = Debug|x64
-		{E085AFD9-5D62-44EA-A5DB-17BB32177D19}.Debug|x64.Build.0 = Debug|x64
-		{E085AFD9-5D62-44EA-A5DB-17BB32177D19}.Debug|x86.ActiveCfg = Release|x86
-		{E085AFD9-5D62-44EA-A5DB-17BB32177D19}.Debug|x86.Build.0 = Release|x86
-		{E085AFD9-5D62-44EA-A5DB-17BB32177D19}.Release|x64.ActiveCfg = Release|x64
-		{E085AFD9-5D62-44EA-A5DB-17BB32177D19}.Release|x64.Build.0 = Release|x64
-		{E085AFD9-5D62-44EA-A5DB-17BB32177D19}.Release|x86.ActiveCfg = Release|x86
-		{E085AFD9-5D62-44EA-A5DB-17BB32177D19}.Release|x86.Build.0 = Release|x86
 		{E106ACD7-4E53-4AEE-942B-D0DD426DB34E}.Debug|x64.ActiveCfg = Debug|Win32
 		{E106ACD7-4E53-4AEE-942B-D0DD426DB34E}.Debug|x86.ActiveCfg = Debug|Win32
 		{E106ACD7-4E53-4AEE-942B-D0DD426DB34E}.Debug|x86.Build.0 = Debug|Win32

+ 0 - 15
zhipuzi_pos_windows_server/conf/zhipuzi_pos_windows_server.conf

@@ -1,15 +0,0 @@
-#这个是调度中心的配置文件,“#"用来注释当前行
-
-#模式,debug或者release
-mode = release
-
-#debug环境的队列参数
-debug_pos_task_queue = prod-windows-pos-push
-
-#release环境的队列参数
-release_pos_task_queue = prod-windows-pos-push
-
-#连接阿里云的mns需要用到的参数
-mns.accountendpoint = https://1733013318510961.mns.cn-hangzhou.aliyuncs.com/
-mns.accesskeyid = LTAIpYffXvFnEUzp
-mns.accesskeysecret = F3lqBxo6Uj9pJpLs7btMW5u30X5uKB

+ 0 - 108
zhipuzi_pos_windows_server/helper/CAliyunMNS.cpp

@@ -1,108 +0,0 @@
-#include "../pch/pch.h"
-#include "CAliyunMNS.h"
-
-CAliyunMNS::CAliyunMNS(std::string queueName)
-{
-    string endpoint;
-    string accessId;
-    string accessKey;
-    string stsToken;
-
-    endpoint = CConfigReader::getConfigValue("mns.accountendpoint");
-    accessId = CConfigReader::getConfigValue("mns.accesskeyid");
-    accessKey = CConfigReader::getConfigValue("mns.accesskeysecret");
-    stsToken = "";
-
-    m_mnsClient = new MNSClient(endpoint, accessId, accessKey, stsToken);
-
-    try
-    {
-        queue = m_mnsClient->getQueueRef(queueName.c_str());
-
-        LOG_ERROR("queueName:" << queueName.c_str());
-        LOG_ERROR("endpoint:" << endpoint.c_str());
-        LOG_ERROR("accessId:" << accessId.c_str());
-        LOG_ERROR("accessKey:" << accessKey.c_str());
-        LOG_ERROR("stsToken:" << stsToken.c_str());
-
-        is_init = true;
-    }
-    catch(MNSServerException& me)
-    {
-        //cout << "Request Failed: " << me.GetErrorCode().c_str() << endl;
-        LOG_INFO("Request Failed: " << me.GetErrorCode().c_str());
-        is_init = false;
-
-        return;
-    }
-    catch(MNSExceptionBase& mb)
-    {
-        //cout << "Request Failed: " << mb.ToString().c_str() << endl;
-        LOG_INFO("Request Failed: " << mb.ToString().c_str());
-        is_init = false;
-
-        return;
-    }
-}
-
-CAliyunMNS::~CAliyunMNS()
-{
-    if(m_mnsClient)
-    {
-        delete m_mnsClient;
-    }
-}
-
-std::string CAliyunMNS::getMessage()
-{
-    if(is_init == false)
-    {
-		LOG_INFO("is_init is false");
-        return "error!";
-    }
-
-    try
-    {
-        Message message;
-        queue->receiveMessage(30, message);
-
-        std::string newMessage;
-        bool res = CLewaimaiString::base64_decode(message.getMessageBody(), &newMessage);
-        if(res == false)
-        {
-            LOG_INFO("base64解码失败!");
-            return "error!";
-        }
-
-        queue->deleteMessage(message.getReceiptHandle());
-
-        return newMessage;
-    }
-    catch(MNSServerException& me)
-    {
-        cout << "Request Failed: " << me.GetErrorCode().c_str() << endl;
-        LOG_INFO("Request Failed: " << me.GetErrorCode().c_str());
-        return "error!";
-    }
-    catch(MNSExceptionBase& mb)
-    {
-        cout << "Request Failed: " << mb.ToString().c_str() << endl;
-        LOG_INFO("Request Failed: " << mb.ToString().c_str());
-        return "error!";
-    }
-}
-
-void CAliyunMNS::sendMessage(std::string message)
-{
-    std::string newMessage;
-
-    CLewaimaiString::base64_encode(message, &newMessage);
-
-    SendMessageResponse smResp;
-    queue->sendMessage(newMessage.c_str(), smResp);
-}
-
-bool CAliyunMNS::getIsInit()
-{
-    return is_init;
-}

+ 0 - 24
zhipuzi_pos_windows_server/helper/CAliyunMNS.h

@@ -1,24 +0,0 @@
-#pragma once
-
-#include <mns/mns_client.h>
-
-using namespace std;
-using namespace mns::sdk;
-
-class CAliyunMNS
-{
-private:
-	MNSClient* m_mnsClient = NULL;
-	QueuePtr queue;
-
-	bool is_init = false;
-public:
-	CAliyunMNS(std::string queueName);
-	~CAliyunMNS();
-
-	std::string getMessage();
-	void sendMessage(std::string message);
-
-	bool getIsInit();
-};
-

+ 0 - 214
zhipuzi_pos_windows_server/helper/CConfigReader.cpp

@@ -1,214 +0,0 @@
-#include "../pch/pch.h"
-#include "CConfigReader.h"
-
-std::map<string, string> CConfigReader::m_mapConfigInfo;
-
-CConfigReader::CConfigReader()
-{
-}
-
-
-CConfigReader::~CConfigReader()
-{
-}
-
-/*
- *读取配置文件内容,以#注释的忽略掉
- **/
-void CConfigReader::ReadConfigFile()
-{
-	ifstream configFile;
-
-	string path = "/usr/local/zhipuzi_pos_windows_server/conf/zhipuzi_pos_windows_server.conf";
-
-	configFile.open(path.c_str());
-	string str_line;
-	if (configFile.is_open())
-	{
-		while (!configFile.eof())
-		{
-			getline(configFile, str_line);
-
-			//过滤掉注释信息,即如果首个字符为#就过滤掉这一行
-			if (str_line.find('#') == 0)
-			{
-				continue;
-			}
-
-			size_t pos = str_line.find('=');
-			string str_key = str_line.substr(0, pos);
-			string str_value = str_line.substr(pos + 1);
-
-			//去掉首尾的空格
-			CLewaimaiString::trim(str_key);
-			CLewaimaiString::trim(str_value);
-
-			CConfigReader::m_mapConfigInfo[str_key] = str_value;
-		}
-	}
-	else
-	{
-		cout << "找不到配置文件,启动失败!";
-		LOG_INFO("找不到配置文件,启动失败!");
-
-		exit(-1);
-	}
-}
-
-std::string CConfigReader::getConfigValue(std::string key)
-{
-	if (CConfigReader::m_mapConfigInfo.find(key) == CConfigReader::m_mapConfigInfo.end())
-	{
-		cout << "找不到配置文件参数:" << key.c_str() << endl;
-		LOG_INFO("找不到配置文件参数:" << key.c_str());
-
-		//找不到就返回空字符串
-		return "";
-	}
-
-	return CConfigReader::m_mapConfigInfo[key];
-}
-
-bool CConfigReader::IsDebugMode()
-{
-	std::string mode = CConfigReader::getConfigValue("mode");
-
-	if (mode == "debug")
-	{
-		return true;
-	}
-
-	return false;
-}
-
-std::string CConfigReader::getPathPlanningHost()
-{
-	std::string mode = CConfigReader::getConfigValue("mode");
-
-	if (mode == "debug")
-	{
-		return CConfigReader::getConfigValue("debug_pathplanning_host");
-	}
-	else
-	{
-		return CConfigReader::getConfigValue("release_pathplanning_host");
-	}
-}
-
-std::string CConfigReader::getMysqlHost()
-{
-	std::string mode = CConfigReader::getConfigValue("mode");
-
-	if (mode == "debug")
-	{
-		return CConfigReader::getConfigValue("debug_host");
-	}
-	else
-	{
-		return CConfigReader::getConfigValue("release_host");
-	}
-}
-
-std::string CConfigReader::getMysqlPort()
-{
-	std::string mode = CConfigReader::getConfigValue("mode");
-
-	if (mode == "debug")
-	{
-		return CConfigReader::getConfigValue("debug_port");
-	}
-	else
-	{
-		return CConfigReader::getConfigValue("release_port");
-	}
-}
-
-std::string CConfigReader::getMysqlUsername()
-{
-	std::string mode = CConfigReader::getConfigValue("mode");
-
-	if (mode == "debug")
-	{
-		return CConfigReader::getConfigValue("debug_username");
-	}
-	else
-	{
-		return CConfigReader::getConfigValue("release_username");
-	}
-}
-
-std::string CConfigReader::getMysqlPassword()
-{
-	std::string mode = CConfigReader::getConfigValue("mode");
-
-	if (mode == "debug")
-	{
-		return CConfigReader::getConfigValue("debug_password");
-	}
-	else
-	{
-		return CConfigReader::getConfigValue("release_password");
-	}
-}
-
-std::string CConfigReader::getDBName()
-{
-	std::string mode = CConfigReader::getConfigValue("mode");
-
-	if (mode == "debug")
-	{
-		return CConfigReader::getConfigValue("debug_dbname");
-	}
-	else
-	{
-		return CConfigReader::getConfigValue("release_dbname");
-	}
-}
-
-std::string CConfigReader::getTaskQueue()
-{
-	std::string mode = CConfigReader::getConfigValue("mode");
-
-	if (mode == "debug")
-	{
-		return CConfigReader::getConfigValue("debug_pos_task_queue");
-	}
-	else
-	{
-		return CConfigReader::getConfigValue("release_pos_task_queue");
-	}
-}
-
-std::string CConfigReader::getResultQueue()
-{
-	std::string mode = CConfigReader::getConfigValue("mode");
-
-	if (mode == "debug")
-	{
-		return CConfigReader::getConfigValue("debug_dispatch_result_queue");
-	}
-	else
-	{
-		return CConfigReader::getConfigValue("release_dispatch_result_queue");
-	}
-}
-
-int CConfigReader::getDeliverymanMaxOrderNum()
-{
-	std::string deliveryman_max_order_num = CConfigReader::getConfigValue("deliveryman_max_order_num");
-
-	int n_deliveryman_max_order_num = stoi(deliveryman_max_order_num);
-
-	//最大不能超过10
-	if (n_deliveryman_max_order_num > 10)
-	{
-		n_deliveryman_max_order_num = 10;
-	}
-
-	if (n_deliveryman_max_order_num < 1)
-	{
-		n_deliveryman_max_order_num = 1;
-	}
-
-	return n_deliveryman_max_order_num;
-}

+ 0 - 33
zhipuzi_pos_windows_server/helper/CConfigReader.h

@@ -1,33 +0,0 @@
-#pragma once
-
-/*
- *这个类用来读取配置文件
- **/
-class CConfigReader
-{
-public:
-	CConfigReader();
-	~CConfigReader();
-
-	static void ReadConfigFile();
-
-	static std::string getConfigValue(std::string key);
-
-	static bool IsDebugMode();
-
-	static std::string getPathPlanningHost();
-
-	static std::string getMysqlHost();
-	static std::string getMysqlPort();
-	static std::string getMysqlUsername();
-	static std::string getMysqlPassword();
-	static std::string getDBName();
-
-	static std::string getTaskQueue();
-	static std::string getResultQueue();
-
-	static int getDeliverymanMaxOrderNum();
-public:
-	static std::map<string, string> m_mapConfigInfo;
-};
-

+ 0 - 63
zhipuzi_pos_windows_server/helper/CLewaimaiString.cpp

@@ -1,63 +0,0 @@
-#include "../pch/pch.h"
-#include "CLewaimaiString.h"
-
-#include <boost/archive/iterators/base64_from_binary.hpp>
-#include <boost/archive/iterators/binary_from_base64.hpp>
-#include <boost/archive/iterators/transform_width.hpp>
-#include <string>
-#include <iostream>
-#include <sstream>
-
-using namespace std;
-using namespace boost::archive::iterators;
-
-CLewaimaiString::CLewaimaiString()
-{
-}
-
-
-CLewaimaiString::~CLewaimaiString()
-{
-}
-
-bool CLewaimaiString::base64_encode(const string& input, string* output)
-{
-	typedef base64_from_binary<transform_width<string::const_iterator, 6, 8>> Base64EncodeIterator;
-	stringstream result;
-	try {
-		copy(Base64EncodeIterator(input.begin()), Base64EncodeIterator(input.end()), ostream_iterator<char>(result));
-	}
-	catch (...) {
-		return false;
-	}
-	size_t equal_count = (3 - input.length() % 3) % 3;
-	for (size_t i = 0; i < equal_count; i++)
-	{
-		result.put('=');
-	}
-	*output = result.str();
-	return output->empty() == false;
-}
-
-bool CLewaimaiString::base64_decode(const string& input, string* output)
-{
-	typedef transform_width<binary_from_base64<string::const_iterator>, 8, 6> Base64DecodeIterator;
-	stringstream result;
-	try {
-		copy(Base64DecodeIterator(input.begin()), Base64DecodeIterator(input.end()), ostream_iterator<char>(result));
-	}
-	catch (...) {
-		return false;
-	}
-	*output = result.str();
-	return output->empty() == false;
-}
-
-void CLewaimaiString::trim(string &s)
-{
-	if (!s.empty())
-	{
-		s.erase(0, s.find_first_not_of(" "));
-		s.erase(s.find_last_not_of(" ") + 1);
-	}
-}

+ 0 - 104
zhipuzi_pos_windows_server/helper/CLewaimaiString.h

@@ -1,104 +0,0 @@
-#pragma once
-
-#ifdef _WIN32
-#include <codecvt>
-#else
-
-#endif
-
-#include <iostream>
-#include <sstream>
-
-class CLewaimaiString
-{
-public:
-	CLewaimaiString();
-	~CLewaimaiString();
-
-	static bool base64_encode(const string& input, string* output);
-	static bool base64_decode(const string& input, string* output);
-
-	static void trim(string &s);
-
-#ifdef _WIN32
-	static std::string UnicodeToUTF8(const std::wstring & wstr)
-	{
-		std::string ret;
-		try {
-			std::wstring_convert< std::codecvt_utf8<wchar_t> > wcv;
-			ret = wcv.to_bytes(wstr);
-		}
-		catch (const std::exception & e) {
-			std::cerr << e.what() << std::endl;
-		}
-		return ret;
-	}
-
-	static std::wstring UTF8ToUnicode(const std::string & str)
-	{
-		std::wstring ret;
-		try {
-			std::wstring_convert< std::codecvt_utf8<wchar_t> > wcv;
-			ret = wcv.from_bytes(str);
-		}
-		catch (const std::exception & e) {
-			std::cerr << e.what() << std::endl;
-		}
-		return ret;
-	}
-
-	static std::string UnicodeToANSI(const std::wstring & wstr)
-	{
-		std::string ret;
-		std::mbstate_t state = {};
-		const wchar_t *src = wstr.data();
-		size_t len = std::wcsrtombs(nullptr, &src, 0, &state);
-		if (static_cast<size_t>(-1) != len) {
-			std::unique_ptr< char[] > buff(new char[len + 1]);
-			len = std::wcsrtombs(buff.get(), &src, len, &state);
-			if (static_cast<size_t>(-1) != len) {
-				ret.assign(buff.get(), len);
-			}
-		}
-		return ret;
-	}
-
-	static std::wstring ANSIToUnicode(const std::string & str)
-	{
-		std::wstring ret;
-		std::mbstate_t state = {};
-		const char *src = str.data();
-		size_t len = std::mbsrtowcs(nullptr, &src, 0, &state);
-		if (static_cast<size_t>(-1) != len) {
-			std::unique_ptr< wchar_t[] > buff(new wchar_t[len + 1]);
-			len = std::mbsrtowcs(buff.get(), &src, len, &state);
-			if (static_cast<size_t>(-1) != len) {
-				ret.assign(buff.get(), len);
-			}
-		}
-		return ret;
-	}
-
-	static std::string UTF8ToANSI(const std::string & str)
-	{
-		return UnicodeToANSI(UTF8ToUnicode(str));
-	}
-
-	static std::string ANSIToUTF8(const std::string & str)
-	{
-		return UnicodeToUTF8(ANSIToUnicode(str));
-	}
-#else
-
-#endif
-	static std::string DoubleToString(const double value, unsigned int precisionAfterPoint)
-	{
-		char str[256];
-
-		std::string pre = "%." + to_string(precisionAfterPoint) + "f";
-		sprintf(str, pre.c_str(), value);
-		string result = str;
-		return result;
-	}
-};
-

+ 0 - 11
zhipuzi_pos_windows_server/helper/CRandomHelper.cpp

@@ -1,11 +0,0 @@
-#include "../pch/pch.h"
-#include "CRandomHelper.h"
-
-CRandomHelper::CRandomHelper()
-{
-}
-
-
-CRandomHelper::~CRandomHelper()
-{
-}

+ 0 - 40
zhipuzi_pos_windows_server/helper/CRandomHelper.h

@@ -1,40 +0,0 @@
-#pragma once
-
-class CRandomHelper
-{
-public:
-	CRandomHelper();
-	~CRandomHelper();
-
-	CRandomHelper(unsigned int seed)
-	{
-		next_seed = seed;
-	}
-
-	//生成0到1之间的随机数
-	inline double lewaimai_rand()
-	{
-		return (double)myrand() / 0x7fff;
-	}
-
-	//生成范围内的随机整数
-	inline int randInt(int begin, int end)
-	{
-		return begin + (myrand() % (end - begin + 1));
-	}
-
-	/* RAND_MAX assumed to be 32767 */
-	inline int myrand(void)
-	{
-		next_seed = next_seed * 1103515245 + 12345;
-		return((unsigned)(next_seed / 65536) % 32768);
-	}
-
-	inline void mysrand(unsigned int seed)
-	{
-		next_seed = seed;
-	}
-
-private:
-	unsigned long next_seed = 1;
-};

+ 0 - 32
zhipuzi_pos_windows_server/helper/CSystem.cpp

@@ -1,32 +0,0 @@
-#include "../pch/pch.h"
-#include "CSystem.h"
-
-CSystem::CSystem()
-{
-}
-
-
-CSystem::~CSystem()
-{
-}
-
-
-int CSystem::get_CPU_core_num()
-{
-#ifdef _WIN32
-	SYSTEM_INFO info;
-	GetSystemInfo(&info);
-	return info.dwNumberOfProcessors;
-#else
-	return get_nprocs();
-#endif
-}
-
-void CSystem::my_sleep(int second)
-{
-#ifdef _WIN32
-	Sleep(second * 1000);
-#else
-	sleep(second);
-#endif
-}

+ 0 - 119
zhipuzi_pos_windows_server/helper/CSystem.h

@@ -1,119 +0,0 @@
-#pragma once
-
-#include "../pch/pch.h"
-
-class CSystem
-{
-public:
-	CSystem();
-	~CSystem();
-
-	static int get_CPU_core_num();
-
-	//程序休眠X秒
-	static void my_sleep(int second);
-
-#ifdef _WIN32
-	// 程序开机自动启动
-	static void autostart()
-	{
-		HKEY hKey;
-		wstring strRegPath = L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run";
-
-		//1、找到系统的启动项
-		if (RegOpenKeyEx(HKEY_CURRENT_USER, strRegPath.c_str(), 0, KEY_ALL_ACCESS, &hKey) == ERROR_SUCCESS)  ///打开启动项
-		{
-			//2、得到本程序自身的全路径
-			TCHAR strExeFullDir[MAX_PATH];
-			GetModuleFileName(NULL, strExeFullDir, MAX_PATH);
-
-			//3、添加一个子Key,并设置值,"GISRestart"是应用程序名字(不加后缀.exe)
-			RegSetValueEx(hKey, L"智铺子收银软件", 0, REG_SZ, (LPBYTE)strExeFullDir, (lstrlen(strExeFullDir) + 1) * sizeof(TCHAR));
-
-			//4、关闭注册表
-			RegCloseKey(hKey);
-		}
-
-		else
-		{
-			cout << "系统参数错误, 不能随系统启动";
-		}
-	}
-
-	// 取消开机自动启动
-	static void cancelAutoStart()
-	{
-		HKEY hKey;
-		wstring strRegPath = L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run";
-
-		//1、找到系统的启动项
-		if (RegOpenKeyEx(HKEY_CURRENT_USER, strRegPath.c_str(), 0, KEY_ALL_ACCESS, &hKey) == ERROR_SUCCESS)
-		{
-			//2、删除值
-			RegDeleteValue(hKey, L"智铺子收银软件");
-
-			//3、关闭注册表
-			RegCloseKey(hKey);
-		}
-	}
-
-	static std::wstring GetProgramDir()
-	{
-		wchar_t exeFullPath[MAX_PATH]; // Full path
-		std::wstring strPath = L"";
-
-		GetModuleFileName(NULL, exeFullPath, MAX_PATH);
-		strPath = (wstring)exeFullPath;    // Get full path of the file
-
-		int pos = strPath.find_last_of('\\', strPath.length());
-		return strPath.substr(0, pos);  // Return the directory without the file name
-	}
-
-	// 判断文件是否存在
-	static BOOL IsFileExist(const wstring& csFile)
-	{
-		DWORD dwAttrib = GetFileAttributes(csFile.c_str());
-		return INVALID_FILE_ATTRIBUTES != dwAttrib && 0 == (dwAttrib & FILE_ATTRIBUTE_DIRECTORY);
-	}
-
-	// 判断文件夹是否存在
-	static BOOL IsDirExist(const wstring& csDir)
-	{
-		DWORD dwAttrib = GetFileAttributes(csDir.c_str());
-		return INVALID_FILE_ATTRIBUTES != dwAttrib && 0 != (dwAttrib & FILE_ATTRIBUTE_DIRECTORY);
-	}
-
-	// 判断文件或文件夹是否存在
-	static BOOL IsPathExist(const wstring& csPath)
-	{
-		DWORD dwAttrib = GetFileAttributes(csPath.c_str());
-		return INVALID_FILE_ATTRIBUTES != dwAttrib;
-	}
-#else
-	static std::string getAbsopath()
-	{
-		char buf[1024];
-		size_t size = 1024;
-
-		size_t i;
-		size_t len = readlink("/proc/self/exe", buf, size - 1);
-
-		if (len < 0 || (len >= size - 1))
-		{
-			return NULL;
-		}
-
-		buf[len] = '\0';
-		for (i = len; i >= 0; i--)
-		{
-			if (buf[i] == '/')
-			{
-				buf[i + 1] = '\0';
-				break;
-			}
-		}
-
-		return buf;
-	}
-#endif
-};

+ 0 - 22
zhipuzi_pos_windows_server/helper/define.h

@@ -1,22 +0,0 @@
-#pragma once
-
-//配送员app的智能路径传过来的RPC任务,最多的订单数量
-#define MAX_ORDER_NUM 10
-
-//调度中心传过来的RPC任务,最多的订单数量
-#define MAX_DISPATCH_ORDER_NUM 10
-
-//最大任务数量,每个订单最多2个任务
-#define MAX_TASK_NUM MAX_ORDER_NUM * 2
-
-//最大顶点数量
-#define MAX_POS_NUM MAX_TASK_NUM + 1
-
-//种群数量对应于任务数量的倍数
-#define POPULATION_PLUS 10
-
-//遗传算法的代数对应于任务数量的倍数
-#define GENERATION_PLUS 25
-
-//最大种群数量
-#define MAX_POPULATION_SIZE MAX_TASK_NUM * POPULATION_PLUS

+ 0 - 34
zhipuzi_pos_windows_server/main.cpp

@@ -1,34 +0,0 @@
-#include "pch/pch.h"
-#include "network/CServer.h"
-
-int main()
-{
-	//初始化日志
-	CLewaimaiLog log;
-	log.Init();
-
-	//读取配置文件
-	CConfigReader::ReadConfigFile();
-
-	//开启守护进程
-	if (daemon(0, 0) == -1)
-	{
-		exit(EXIT_FAILURE);
-	}
-
-	try
-	{
-		//初始化服务器,开始监听和处理消息
-		CServer s;
-		s.Init();
-	}
-	catch (std::exception& e)
-	{
-		std::cerr << "Exception: " << e.what() << "\n";
-		LOG_ERROR("Exception: " << e.what());
-	}
-
-	LOG_ERROR("ready to exit program");
-
-	return 0;
-}

+ 0 - 180
zhipuzi_pos_windows_server/network/CClientSession.cpp

@@ -1,180 +0,0 @@
-#include "CClientSession.h"
-
-#include "CServer.h"
-#include <sqlite3/sqlite3.h>
-
-#include "PosMessage.h"
-
-CClientSession::~CClientSession()
-{
-	
-}
-
-void CClientSession::start()
-{
-	m_pos_message.clear();
-
-	boost::asio::async_read(socket_, boost::asio::buffer(&m_pos_message, sizeof(PosMessage)),
-		boost::bind(&CClientSession::handle_read, this,
-			boost::asio::placeholders::error,
-			boost::asio::placeholders::bytes_transferred));
-}
-
-/*
- *服务器端主动关闭,才能调用这个函数
- **/
-void CClientSession::stop()
-{
-	//先给客户端发送一个下线通知
-	rapidjson::Document doc;
-	doc.SetObject();
-	rapidjson::Document::AllocatorType& allocator = doc.GetAllocator(); //获取分配器
-
-	std::string timestamp = to_string(time(NULL));
-
-	doc.AddMember("msg_type", "0", allocator);
-	doc.AddMember("timestamp", StringRef(timestamp.c_str(), timestamp.length()), allocator);
-
-	rapidjson::StringBuffer buffer;
-	rapidjson::Writer<StringBuffer> writer(buffer);
-	doc.Accept(writer);
-
-	//返回给接入层的消息
-	std::string login_out_msg = buffer.GetString();
-
-	bool ret = send_message(login_out_msg);
-
-	if (ret)
-	{
-		//然后关闭socket
-		//LOG_INFO("in stop, send_message success!");
-		socket_.close();
-	}
-	else
-	{
-		//LOG_ERROR("in stop, send_message failed!");
-		//如果同步写数据失败,说明socket已经失效了,这里不要调用关闭操作,等待异步读返回错误就好
-	}
-
-	//注意这里不能调用delete this,因为后面会异步返回,要判断状态,如果这里delete了,后面就会内存越界
-}
-
-/*
- *同步发送消息,返回true表示发送成功,返回false表示发送失败
- **/
-bool CClientSession::send_message(std::string msg)
-{
-	try
-	{
-		PosMessage new_msg;
-		new_msg.m_length = (int)msg.length();
-		memcpy(new_msg.data, msg.c_str(), msg.length());
-		new_msg.data[new_msg.m_length] = '\0';
-
-		socket_.write_some(boost::asio::buffer(&new_msg, sizeof(PosMessage)));
-	}
-	catch (const std::exception& e)
-	{
-		std::string err = e.what();
-
-		//LOG_ERROR("send_message error, message:" << err.c_str());
-
-		//注意这里是同步发送消息,这里不要处理socket的关闭和delete操作,让后面的异步读错误处理
-		return false;
-	}
-
-	return true;
-}
-
-void CClientSession::SetServer(CServer* server)
-{
-    m_server = server;
-}
-
-void CClientSession::handle_read(const boost::system::error_code& error,
-                                 size_t bytes_transferred)
-{
-    if(!error)
-    {
-        //读到客户端发过来的内容,进行绑定
-        std::string msg = m_pos_message.data;
-
-        rapidjson::Document document;
-        document.Parse(msg.c_str());
-        if(!document.IsObject())
-        {
-            LOG_ERROR("message 非法! msg:" << msg.c_str());
-			LOG_ERROR("msg length:" << m_pos_message.m_length);
-			LOG_ERROR("ip:" << socket_.remote_endpoint().address().to_string());
-
-			//处理完了,重新读取
-			m_pos_message.clear();
-
-			boost::asio::async_read(socket_, boost::asio::buffer(&m_pos_message, sizeof(PosMessage)),
-				boost::bind(&CClientSession::handle_read, this,
-					boost::asio::placeholders::error,
-					boost::asio::placeholders::bytes_transferred));
-
-            return;
-        }
-
-        std::string username = document["username"].GetString();
-		std::string timestamp = document["timestamp"].GetString();
-		std::string is_login = document["is_login"].GetString();
-
-		//这个用于判断是否成功绑定用户名了
-		m_username = username;
-
-		if (is_login == "1")
-		{
-			LOG_INFO("get client login message:" << msg.c_str());
-
-			//获取到用户名了,进行绑定
-			m_server->BindUsername(username, this);
-
-			//绑定完了检查这个用户有没有离线消息
-			m_server->CheckOfflineMessage(username);
-		}
-
-        //处理完了,重新读取
-		m_pos_message.clear();
-
-		boost::asio::async_read(socket_, boost::asio::buffer(&m_pos_message, sizeof(PosMessage)),
-			boost::bind(&CClientSession::handle_read, this,
-				boost::asio::placeholders::error,
-				boost::asio::placeholders::bytes_transferred));
-    }
-    else
-    {
-		std::string err = error.message();
-		//LOG_ERROR("handle_read error, err message:" << err.c_str());
-
-		if (socket_.is_open())
-		{
-			socket_.close();
-
-			//这个是客户端断开了链接
-			if (m_username == "")
-			{
-				//说明这个socket还没获取过用户名,直接销毁对象即可
-				LOG_ERROR("111 handle_read error, err message:" << err.c_str());
-				delete this;
-			}
-			else
-			{
-				//说明这个socket已经绑定过用户名了,先从map中删除,再销毁对象
-				LOG_ERROR("222 handle_read error, err message:" << err.c_str());
-				LOG_ERROR("222 username:" << m_username.c_str());
-				m_server->DeleteClient(m_username);
-
-				delete this;
-			}
-		}
-		else
-		{
-			//这个是服务端断开了链接,已经调用过close了
-			//LOG_INFO("handle_read error,服务端断开了链接");
-			delete this;
-		}
-    }
-}

+ 0 - 61
zhipuzi_pos_windows_server/network/CClientSession.h

@@ -1,61 +0,0 @@
-#pragma once
-
-#include "../pch/pch.h"
-#include "PosMessage.h"
-
-using boost::asio::ip::tcp;
-
-class CServer;
-
-class CClientSession
-{
-public:
-    CClientSession(boost::asio::io_context& io_context)
-        : socket_(io_context)
-    {
-    }
-
-    ~CClientSession();
-
-	void SetServer(CServer* server);
-
-    tcp::socket& socket()
-    {
-        return socket_;
-    }
-
-	void start();
-
-	void stop();
-
-	bool send_message(std::string msg);
-
-	void SetNum(int m_num)
-	{
-		m_nClientNum = m_num;
-	}
-
-	int GetNum()
-	{
-		return m_nClientNum;
-	}
-
-private:
-	void handle_read(const boost::system::error_code& error,
-		size_t bytes_transferred);
-
-    tcp::socket socket_;
-    
-	PosMessage m_pos_message;
-
-	CServer* m_server;
-
-	int m_nClientNum = 0;
-
-	//本连接对应的客户端用户名
-	std::string m_username = "";
-
-	bool is_stop_work = false;
-	std::mutex stop_mutex;
-};
-

+ 0 - 518
zhipuzi_pos_windows_server/network/CServer.cpp

@@ -1,518 +0,0 @@
-#include "../pch/pch.h"
-#include "CServer.h"
-
-#include "../helper/CAliyunMNS.h"
-
-CServer::CServer()
-{
-
-}
-
-CServer::~CServer()
-{
-	LOG_ERROR("start ~CServer");
-	delete acceptor_;
-
-	if (m_db != NULL)
-	{
-		sqlite3_close(m_db);
-	}
-
-	LOG_ERROR("end ~CServer");
-}
-
-void CServer::Init()
-{
-	LOG_ERROR("start Init()");
-
-	//初始化数据库
-	InitSqlLite();
-
-	//使用9001端口
-	boost::asio::ip::tcp::endpoint endpotion(boost::asio::ip::tcp::v4(), 9001);
-	acceptor_ = new tcp::acceptor(io_context_, endpotion);
-
-	//开始监听客户端的消息
-	start_accept();
-
-	int n_cpu = CSystem::get_CPU_core_num();
-
-	//开始接受和处理mns的消息
-	for (int i = 0; i < n_cpu * 2; i++)
-	{
-		std::thread t(&CServer::ReceiveMNSMessage, this);
-		t.detach();
-	}
-
-	//任务队列,发送消息给客户端
-	for (int i = 0; i < n_cpu * 2; i++)
-	{
-		std::thread t(&CServer::SendMessageToClient, this);
-		t.detach();
-	}
-
-	//处理离线消息的队列
-	for (int i = 0; i < n_cpu * 2; i++)
-	{
-		std::thread t(&CServer::HandleOfflineMessage, this);
-		t.detach();
-	}
-
-	//开一个线程,每隔30分钟清理一次过期的消息
-	for (int i = 0; i < 1; i++)
-	{
-		std::thread t(&CServer::HandleCleanupDueMessage, this);
-		t.detach();
-	}
-
-	LOG_ERROR("ready to run");
-
-	try
-	{
-		//开始异步执行
-		io_context_.run();
-	}
-	catch (std::exception& e)
-	{
-		LOG_ERROR("io_context Exception: " << e.what());
-	}
-
-	LOG_ERROR("stop run");
-}
-
-void CServer::InitSqlLite()
-{
-#ifdef _WIN32
-	wstring folderPath = CSystem::GetProgramDir() + L"\\db";
-	if (!CSystem::IsDirExist(folderPath))
-	{
-		bool flag = CreateDirectory(folderPath.c_str(), NULL);
-		bool a = flag;
-	}
-
-	//如果没有这个文件,这里会创建这个文件
-	wstring path = CSystem::GetProgramDir() + L"\\db\\pos.db";
-	string s_path = CLewaimaiString::UnicodeToUTF8(path);
-
-	m_rc = sqlite3_open(s_path.c_str(), &m_db);
-#else
-	std::string db_path = CSystem::getAbsopath() + "../db/pos.db";
-	//LOG_INFO("db path:" << db_path.c_str());
-
-	m_rc = sqlite3_open(db_path.c_str(), &m_db);
-#endif
-
-	if (m_rc)
-	{
-		LOG_ERROR("Can't open database: " << sqlite3_errmsg(m_db));
-		return;
-	}
-
-	else
-	{
-		//LOG_INFO("Opened database successfully");
-	}
-
-	//初始化数据表
-	std::string sql = "SELECT COUNT(*) FROM sqlite_master where type = 'table' and name = 'pos_message';";
-	sqlite3_stmt * stmt = NULL;
-
-	//读取厨房打印机的参数
-	if (sqlite3_prepare_v2(m_db, sql.c_str(), -1, &stmt, NULL) == SQLITE_OK)
-	{
-		if (sqlite3_step(stmt) == SQLITE_ROW)
-		{
-			int count = sqlite3_column_int(stmt, 0);
-
-			if (count == 0)
-			{
-				//说明没找到这个表,那么这个时候新建这个表,先释放前面的stmt
-				sqlite3_finalize(stmt);
-				stmt = NULL;
-
-				sql = "CREATE TABLE pos_message("  \
-					"id         INTEGER          PRIMARY KEY AUTOINCREMENT,"\
-					"username   CHAR(100)        NOT NULL," \
-					"due_time   CHAR(100)        NOT NULL," \
-					"data       CHAR(2000)       NOT NULL);";
-
-				if (sqlite3_prepare_v2(m_db, sql.c_str(), -1, &stmt, NULL) == SQLITE_OK)
-				{
-					//执行该语句
-					if (sqlite3_step(stmt) != SQLITE_DONE)
-					{
-						std::string err = sqlite3_errmsg(m_db);
-						LOG_INFO("create table fail: " << err.c_str());
-
-						sqlite3_finalize(stmt);
-						return;
-					}
-
-					//走到这里就是表创建成功了
-					LOG_INFO("create table success");
-					sqlite3_finalize(stmt);
-				}
-
-				else
-				{
-					LOG_INFO("create table prepare fail: " << sqlite3_errmsg(m_db));
-
-					sqlite3_finalize(stmt);
-
-					return;
-				}
-			}
-
-			else
-			{
-				//说明已经有这个表了,就不用再创建了
-				sqlite3_finalize(stmt);
-			}
-		}
-	}
-}
-
-bool CServer::AddMessageToDB(std::string username, std::string due_time, std::string data)
-{
-	int result = sqlite3_exec(m_db, "BEGIN;", 0, 0, 0);
-
-	std::string sql = "INSERT INTO pos_message (username, due_time, data) VALUES ('" + username + "' ,'" + due_time + "','" + data + "')";
-	result = sqlite3_exec(m_db, sql.c_str(), 0, 0, 0);
-
-	result = sqlite3_exec(m_db, "COMMIT;", 0, 0, 0);
-
-	if (result == SQLITE_OK)
-	{
-		//LOG_INFO("save params success");
-		return true;
-	}
-
-	//LOG_INFO("save params fail");
-	return false;
-}
-
-/*
- *把要处理离线消息的用户名,加入到队列
- **/
-void CServer::CheckOfflineMessage(std::string username)
-{
-	m_offlineMsg_mutex.lock();
-
-	m_offlineMsg.push(username);
-
-	m_offlineMsg_mutex.unlock();
-}
-
-void CServer::HandleOfflineMessage()
-{
-	while (1)
-	{
-		m_offlineMsg_mutex.lock();
-
-		if (m_offlineMsg.empty())
-		{
-			m_offlineMsg_mutex.unlock();
-
-			CSystem::my_sleep(1);
-
-			continue;
-		}
-
-		std::string username = m_offlineMsg.front();
-		m_offlineMsg.pop();
-
-		m_offlineMsg_mutex.unlock();
-
-		//先把过期的消息全部删除
-		std::string curTime = CLewaimaiTime::DatetimeToString(time(NULL));
-		std::string sql = "DELETE FROM pos_message WHERE username = '" + username + "' AND due_time <= '" + curTime + "';";
-		sqlite3_exec(m_db, sql.c_str(), 0, 0, 0);
-
-		//再看有没有剩余的离线消息
-		sql = "SELECT * FROM pos_message WHERE username = '" + username + "' AND due_time > '" + curTime + "';";
-		sqlite3_stmt * stmt = NULL;
-
-		if (sqlite3_prepare_v2(m_db, sql.c_str(), -1, &stmt, NULL) == SQLITE_OK)
-		{
-			while (sqlite3_step(stmt) == SQLITE_ROW)
-			{
-				std::string id = (char*)sqlite3_column_text(stmt, 0);
-				std::string username = (char*)sqlite3_column_text(stmt, 1);
-				std::string due_time = (char*)sqlite3_column_text(stmt, 2);
-				std::string data = (char*)sqlite3_column_text(stmt, 3);
-
-				m_map_mutex.lock();
-				if (m_clients_map.find(username) == m_clients_map.end())
-				{
-					m_map_mutex.unlock();
-
-					//socket失效了,下次再处理
-					break;
-				}
-				else
-				{
-					CClientSession* session = m_clients_map[username];
-					m_map_mutex.unlock();
-
-					bool ret = session->send_message(data);
-					if (ret == false)
-					{
-						//发送失败,等下次发送
-						break;
-					}
-
-					//成功发送一条,这里就删除一条
-					sql = "DELETE FROM pos_message WHERE id = '" + id + "';";
-					sqlite3_exec(m_db, sql.c_str(), 0, 0, 0);
-				}
-			}
-
-			sqlite3_finalize(stmt);
-		}
-
-		else
-		{
-			//异常情况
-			sqlite3_finalize(stmt);
-		}
-	}
-}
-
-void CServer::start_accept()
-{
-	//新建一个客户端会话
-	CClientSession* new_session = new CClientSession(io_context_);
-	new_session->SetServer(this);
-
-	//记录客户端的顺序
-	m_nClientCount++;
-	new_session->SetNum(m_nClientCount);
-
-	acceptor_->async_accept(new_session->socket(),
-		boost::bind(&CServer::handle_accept, this, new_session,
-			boost::asio::placeholders::error));
-}
-
-void CServer::handle_accept(CClientSession* new_session,
-	const boost::system::error_code& error)
-{
-	LOG_INFO("new client, handle_accept!");
-
-	if (!error)
-	{
-		new_session->start();
-	}
-	else
-	{
-		LOG_ERROR("handle_accept error");
-		delete new_session;
-	}
-
-	//继续监听下一个客户端
-	start_accept();
-}
-
-/*
- *将客户端的用户名和socket进行绑定,每个用户名只能绑定一个socket,后登陆的会删掉前面先登录的
- **/
-void CServer::BindUsername(std::string username, CClientSession* session)
-{
-	m_map_mutex.lock();
-
-	if (m_clients_map.find(username) != m_clients_map.end())
-	{
-		if (m_clients_map[username]->GetNum() < session->GetNum())
-		{
-			//之前已经存在了一个,先把之前的关闭掉(这个是服务器端主动的关闭)
-			m_clients_map[username]->stop();
-		}
-		else
-		{
-			LOG_ERROR("异常情况,不应该出现");
-		}
-	}
-
-	m_clients_map[username] = session;
-
-	m_map_mutex.unlock();
-
-	LOG_INFO("绑定新客户端成功,当前客户端数量:" << m_clients_map.size());
-}
-
-void CServer::DeleteClient(std::string username)
-{
-	m_map_mutex.lock();
-
-	if (m_clients_map.find(username) != m_clients_map.end())
-	{
-		m_clients_map.erase(username);
-	}
-
-	m_map_mutex.unlock();
-
-	LOG_INFO("删除客户端成功,当前客户端数量:" << m_clients_map.size());
-}
-
-/*
-*接收消息,并且对消息进行处理
-**/
-void CServer::ReceiveMNSMessage()
-{
-    CAliyunMNS mns(CConfigReader::getTaskQueue());
-    if(mns.getIsInit() == false)
-    {
-        //初始化消息队列失败了,线程直接退出
-        LOG_INFO("Init AliyunMNS Failed!");
-        return;
-    }
-
-	//LOG_INFO("Init AliyunMNS success!");
-
-    while(true)
-    {
-        std::string message = mns.getMessage();
-        if(message == "error!")
-        {
-			LOG_INFO("message error!");
-            continue;
-        }
-
-		LOG_INFO("new msn message:" << message.c_str());
-
-        //获取到了新的消息,开始进行处理
-        rapidjson::Document document;
-        document.Parse(message.c_str());
-        if(!document.IsObject())
-        {
-            LOG_INFO("message 非法!");
-			LOG_INFO("get new message:" << message.c_str());
-            continue;
-        }
-
-        //处理消息类型
-		if (!document["username"].IsString() || !document["timestamp"].IsString())
-		{
-			continue;
-		}
-
-		std::string use_time;
-		if (document["use_time"].IsInt())
-		{
-			use_time = to_string(document["use_time"].GetInt());
-		}
-		else
-		{
-			use_time = document["use_time"].GetString();
-		}
-
-		std::string username = document["username"].GetString();
-		std::string timestamp = document["timestamp"].GetString();
-
-		rapidjson::Value& data = document["data"];
-
-		rapidjson::StringBuffer sbBuf;
-		rapidjson::Writer<rapidjson::StringBuffer> Writer(sbBuf);
-		data.Accept(Writer);
-		std::string strData = std::string(sbBuf.GetString());
-
-		//判断是否过期
-		if (time(NULL) > atoi(timestamp.c_str()) + atoi(use_time.c_str()))
-		{
-			//消息过了有效期,直接丢弃
-			//LOG_INFO("message due date!");
-			continue;
-		}		
-
-		//把消息放进队列
-		CClientMessage newMessage;
-		newMessage.m_username = username;
-
-		time_t start = atoi(timestamp.c_str());
-		time_t due = atoi(use_time.c_str());
-		time_t end = start + due;
-		newMessage.m_due_time = CLewaimaiTime::DatetimeToString(end);
-
-		newMessage.m_data = strData;
-
-		m_queue_mutex.lock();
-		m_message_queue.push(newMessage);
-		m_queue_mutex.unlock();
-    }
-}
-
-/*
- *负责把队列中的消息发给客户端
- **/
-void CServer::SendMessageToClient()
-{
-	while (1)
-	{
-		m_queue_mutex.lock();
-
-		if (m_message_queue.empty())
-		{
-			m_queue_mutex.unlock();
-
-			CSystem::my_sleep(1);
-
-			continue;
-		}
-
-		CClientMessage msg = m_message_queue.front();
-		m_message_queue.pop();
-
-		m_queue_mutex.unlock();
-
-		std::string username = msg.m_username;
-		std::string due_time = msg.m_due_time;
-		std::string data = msg.m_data;
-
-		//LOG_INFO("queue get new message: username:" << username.c_str() << ", due_time:" << due_time.c_str() << ", data:" << data.c_str());
-
-		//判断消息对应的用户是否在线,如果不在线就消息暂存在数据库
-		m_map_mutex.lock();
-		if (m_clients_map.find(username) == m_clients_map.end())
-		{
-			m_map_mutex.unlock();
-
-			//LOG_INFO("can not find client, save to db, username:"<<username.c_str());
-
-			//客户端不在线,操作存数据库
-			AddMessageToDB(username, due_time, data);
-		}
-		else
-		{
-			CClientSession* session = m_clients_map[username];
-
-			m_map_mutex.unlock();
-
-			//直接把消息发给客户端
-			bool ret = session->send_message(data);
-			if (ret == false)
-			{
-				//LOG_INFO("send to client fail, save it to db, username:" << username.c_str());
-				//如果发送失败了,把消息存回到数据库
-				AddMessageToDB(username, due_time, data);
-			}
-			else
-			{
-				//LOG_INFO("send to client success, username:" << username.c_str());
-			}
-		}
-	}	
-}
-
-/*
- *每30分钟清理一次数据库
- **/
-void CServer::HandleCleanupDueMessage()
-{
-	while (true)
-	{
-		std::string curTime = CLewaimaiTime::DatetimeToString(time(NULL));
-		std::string sql = "DELETE FROM pos_message WHERE due_time <= '" + curTime + "';";
-		sqlite3_exec(m_db, sql.c_str(), 0, 0, 0);
-
-		CSystem::my_sleep(60 * 30);
-	}
-}

+ 0 - 72
zhipuzi_pos_windows_server/network/CServer.h

@@ -1,72 +0,0 @@
-#pragma once
-
-#include "../pch/pch.h"
-#include "CClientSession.h"
-
-#include <sqlite3/sqlite3.h>
-
-using boost::asio::ip::tcp;
-
-class CClientMessage
-{
-public:
-    std::string m_username;
-	std::string m_due_time;
-	std::string m_data;
-};
-
-class CServer
-{
-public:
-	CServer();
-
-	~CServer();
-
-	void Init();
-
-	void BindUsername(std::string username, CClientSession* session);
-
-	void DeleteClient(std::string username);
-
-	void InitSqlLite();
-
-	bool AddMessageToDB(std::string username, std::string due_time, std::string data);
-
-	void CheckOfflineMessage(std::string username);
-
-	void HandleOfflineMessage();
-
-	void HandleCleanupDueMessage();
-
-private:
-    void start_accept();
-
-    void handle_accept(CClientSession* new_session,
-                       const boost::system::error_code& error);
-
-    //开启线程,监听接口层的消息
-    void ReceiveMNSMessage();
-
-    //开启线程,专门负责把消息发给客户端
-    void SendMessageToClient();
-
-    boost::asio::io_context io_context_;    
-	tcp::acceptor* acceptor_;
-
-	//给客户端发送消息的队列
-    std::queue<CClientMessage> m_message_queue;
-    std::mutex m_queue_mutex;
-
-	std::map<std::string, CClientSession*> m_clients_map;
-	std::mutex m_map_mutex;
-
-	//处理离线消息的队列
-	std::queue<std::string> m_offlineMsg;
-	std::mutex m_offlineMsg_mutex;
-
-	int m_nClientCount = 0;
-
-	int m_rc;
-
-	sqlite3* m_db = NULL;
-};

+ 0 - 15
zhipuzi_pos_windows_server/network/PosMessage.h

@@ -1,15 +0,0 @@
-#pragma once
-
-class PosMessage
-{
-public:
-	enum { max_length = 1024 };
-	char data[max_length];
-
-	int m_length;
-
-	void clear()
-	{
-		memset(this, 0, sizeof(PosMessage));
-	}
-};

+ 0 - 2
zhipuzi_pos_windows_server/obj/x86/Release/zhipuzi_pos_windows_server_linux.log

@@ -1,2 +0,0 @@
-  Cleaning remote project directory
-D:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Application Type\Linux\1.0\Linux.targets(210,6): error : Could not connect to the remote system. Please verify your connection settings, and that your machine is on the network and reachable.

+ 0 - 6
zhipuzi_pos_windows_server/pch/pch.cpp

@@ -1,6 +0,0 @@
-// pch.cpp: 与预编译标头对应的源文件;编译成功所必需的
-
-#include "pch.h"
-
-// 一般情况下,忽略此文件,但如果你使用的是预编译标头,请保留它。
-

+ 0 - 72
zhipuzi_pos_windows_server/pch/pch.h

@@ -1,72 +0,0 @@
-// 入门提示: 
-//   1. 使用解决方案资源管理器窗口添加/管理文件
-//   2. 使用团队资源管理器窗口连接到源代码管理
-//   3. 使用输出窗口查看生成输出和其他消息
-//   4. 使用错误列表窗口查看错误
-//   5. 转到“项目”>“添加新项”以创建新的代码文件,或转到“项目”>“添加现有项”以将现有代码文件添加到项目
-//   6. 将来,若要再次打开此项目,请转到“文件”>“打开”>“项目”并选择 .sln 文件
-
-#ifndef PCH_H
-#define PCH_H
-
- /*
- 标准库头文件
- */
-#include <string>
-#include <vector>
-#include <list>
-#include <queue>
-#include <map>
-#include <algorithm>
-#include <limits>
-#include <thread>
-#include <chrono>
-#include <mutex>
-#include <stdexcept>  
-#include <exception>
-#include <cstdlib>
-#include <ctime>
-#include <cstring>
-#include <iostream>
-#include <fstream>
-#include <iomanip>
-
-using namespace std;
-
-/*
- *boost库的头文件
- **/
-#include <boost/bind.hpp>
-#include <boost/asio.hpp>
-
- /*
-  *操作系统相关的头文件
-  **/
-#ifdef _WIN32
-#include <windows.h>
-#else
-#include <unistd.h>
-#include <sys/sysinfo.h>
-#endif
-
-//json库
-#include "rapidjson/document.h"
-#include "rapidjson/prettywriter.h"  
-#include "rapidjson/writer.h"
-#include "rapidjson/stringbuffer.h"
-
-using namespace rapidjson;
-
-/*
- *常用的辅助函数
- **/
-#include "../helper/define.h"
-#include "../helper/CRandomHelper.h"
-#include "../helper/CSystem.h"
-#include "../helper/CLewaimaiString.h"
-#include "../helper/CConfigReader.h"
-
-#include "../tool/CLewaimaiLog.h"
-#include "../tool/CLewaimaiTime.h"
-
-#endif //PCH_H

+ 0 - 56
zhipuzi_pos_windows_server/tool/CLewaimaiLog.cpp

@@ -1,56 +0,0 @@
-#include "../pch/pch.h"
-#include "CLewaimaiLog.h"
-
-CLewaimaiLog::CLewaimaiLog()
-{
-
-}
-
-CLewaimaiLog::~CLewaimaiLog()
-{
-	log4cplus::Logger::shutdown();
-}
-
-void CLewaimaiLog::Init()
-{
-	log4cplus::initialize();
-
-	//调试模式
-	helpers::LogLog::getLogLog()->setInternalDebugging(false);
-
-#ifdef _WIN32
-	SharedFileAppenderPtr append_1(
-		new RollingFileAppender(LOG4CPLUS_TEXT("log/zhipuzi_pos_windows_server.log"), 200 * 1024 * 1024, 100,
-			true, true));
-
-	SharedFileAppenderPtr append_2(
-		new RollingFileAppender(LOG4CPLUS_TEXT("log/zhipuzi_pos_windows_server_error.log"), 200 * 1024 * 1024, 100,
-			true, true));
-#else
-	SharedFileAppenderPtr append_1(
-		new RollingFileAppender(LOG4CPLUS_TEXT("/usr/local/zhipuzi_pos_windows_server/log/zhipuzi_pos_windows_server.log"), 200 * 1024 * 1024, 100,
-			true, true));
-
-	SharedFileAppenderPtr append_2(
-		new RollingFileAppender(LOG4CPLUS_TEXT("/usr/local/zhipuzi_pos_windows_server/log/zhipuzi_pos_windows_server_error.log"), 200 * 1024 * 1024, 100,
-			true, true));
-#endif
-
-	append_1->setName(LOG4CPLUS_TEXT("zhipuzi_pos_windows_server"));
-	append_1->setLayout(std::auto_ptr<Layout>(new PatternLayout(LOG4CPLUS_TEXT("%D{%Y-%m-%d %H:%M:%S}[%p] - %m [%l]%n"))));
-	append_1->getloc();
-
-	append_2->setName(LOG4CPLUS_TEXT("zhipuzi_pos_windows_server_error"));
-	append_2->setLayout(std::auto_ptr<Layout>(new PatternLayout(LOG4CPLUS_TEXT("%D{%Y-%m-%d %H:%M:%S}[%p] - %m [%l]%n"))));
-	append_2->getloc();
-
-	Logger _Logger_info = Logger::getInstance(LOG4CPLUS_TEXT("zhipuzi_pos_windows_server"));
-	_Logger_info.addAppender(SharedAppenderPtr(append_1.get()));
-	//日志优先级从低到高ALL_LOG_LEVEL、TRACE_LOG_LEVEL、DEBUG_LOG_LEVEL、INFO_LOG_LEVEL、WARN_LOG_LEVEL、ERROR_LOG_LEVEL、FATAL_LOG_LEVEL、OFF_LOG_LEVEL
-	_Logger_info.setLogLevel(ALL_LOG_LEVEL);
-
-	Logger _Logger_error = Logger::getInstance(LOG4CPLUS_TEXT("zhipuzi_pos_windows_server_error"));
-	_Logger_error.addAppender(SharedAppenderPtr(append_2.get()));
-	//日志优先级从低到高ALL_LOG_LEVEL、TRACE_LOG_LEVEL、DEBUG_LOG_LEVEL、INFO_LOG_LEVEL、WARN_LOG_LEVEL、ERROR_LOG_LEVEL、FATAL_LOG_LEVEL、OFF_LOG_LEVEL
-	_Logger_error.setLogLevel(ERROR_LOG_LEVEL);
-}

+ 0 - 29
zhipuzi_pos_windows_server/tool/CLewaimaiLog.h

@@ -1,29 +0,0 @@
-#pragma once
-
-#define LOG_TRACE(logs) LOG4CPLUS_TRACE(log4cplus::Logger::getInstance(LOG4CPLUS_TEXT("zhipuzi_pos_windows_server")), logs)
-#define LOG_DEBUG(logs) LOG4CPLUS_DEBUG(log4cplus::Logger::getInstance(LOG4CPLUS_TEXT("zhipuzi_pos_windows_server")), logs)
-#define LOG_INFO(logs) LOG4CPLUS_INFO(log4cplus::Logger::getInstance(LOG4CPLUS_TEXT("zhipuzi_pos_windows_server")), logs)
-#define LOG_ERROR(logs) LOG4CPLUS_ERROR(log4cplus::Logger::getInstance(LOG4CPLUS_TEXT("zhipuzi_pos_windows_server_error")), logs)
-
-/*
-日志库头文件
-*/
-#include <log4cplus/logger.h>
-#include <log4cplus/fileappender.h>
-#include <log4cplus/layout.h>
-#include <log4cplus/ndc.h>
-#include <log4cplus/helpers/loglog.h>
-#include <log4cplus/helpers/property.h>
-#include <log4cplus/loggingmacros.h>
-
-using namespace log4cplus;
-
-class CLewaimaiLog
-{
-public:
-	CLewaimaiLog();
-	~CLewaimaiLog();
-
-	void Init();
-};
-

+ 0 - 164
zhipuzi_pos_windows_server/tool/CLewaimaiTime.cpp

@@ -1,164 +0,0 @@
-#include "../pch/pch.h"
-#include "CLewaimaiTime.h"
-
-
-CLewaimaiTime::CLewaimaiTime()
-{
-}
-
-
-CLewaimaiTime::~CLewaimaiTime()
-{
-}
-
-time_t CLewaimaiTime::StringToDatetime(string str)
-{
-	char *cha = (char*)str.data();             // 将string转换成char*。
-	tm tm_;                                    // 定义tm结构体。
-	int year, month, day, hour, minute, second;// 定义时间的各个int临时变量。
-	sscanf(cha, "%d-%d-%d %d:%d:%d", &year, &month, &day, &hour, &minute, &second);// 将string存储的日期时间,转换为int临时变量。
-	tm_.tm_year = year - 1900;                 // 年,由于tm结构体存储的是从1900年开始的时间,所以tm_year为int临时变量减去1900。
-	tm_.tm_mon = month - 1;                    // 月,由于tm结构体的月份存储范围为0-11,所以tm_mon为int临时变量减去1。
-	tm_.tm_mday = day;                         // 日。
-	tm_.tm_hour = hour;                        // 时。
-	tm_.tm_min = minute;                       // 分。
-	tm_.tm_sec = second;                       // 秒。
-	tm_.tm_isdst = 0;                          // 非夏令时。
-	time_t t_ = mktime(&tm_);                  // 将tm结构体转换成time_t格式。
-	return t_;                                 // 返回值。 
-}
-
-string CLewaimaiTime::DatetimeToString(time_t time)
-{
-	struct tm tm_;
-
-#ifdef _WIN32
-	localtime_s(&tm_, &time);                // 将time_t格式转换为tm结构体
-#else
-	localtime_r(&time, &tm_);                // 将time_t格式转换为tm结构体
-#endif
-	
-	int year, month, day, hour, minute, second;// 定义时间的各个int临时变量。
-	year = tm_.tm_year + 1900;                // 临时变量,年,由于tm结构体存储的是从1900年开始的时间,所以临时变量int为tm_year加上1900。
-	month = tm_.tm_mon + 1;                   // 临时变量,月,由于tm结构体的月份存储范围为0-11,所以临时变量int为tm_mon加上1。
-	day = tm_.tm_mday;                        // 临时变量,日。
-	hour = tm_.tm_hour;                       // 临时变量,时。
-	minute = tm_.tm_min;                      // 临时变量,分。
-	second = tm_.tm_sec;                      // 临时变量,秒。
-	char yearStr[5], monthStr[3], dayStr[3], hourStr[3], minuteStr[3], secondStr[3];// 定义时间的各个char*变量。
-	sprintf(yearStr, "%d", year);              // 年。
-	sprintf(monthStr, "%d", month);            // 月。
-	sprintf(dayStr, "%d", day);                // 日。
-	sprintf(hourStr, "%d", hour);              // 时。
-	sprintf(minuteStr, "%d", minute);          // 分。
-	if (hourStr[1] == '\0')                  // 如果小时为一位,如5,则需要转换字符串为两位,如05。
-	{
-		hourStr[2] = '\0';
-		hourStr[1] = hourStr[0];
-		hourStr[0] = '0';
-	}
-	if (minuteStr[1] == '\0')                  // 如果分为一位,如5,则需要转换字符串为两位,如05。
-	{
-		minuteStr[2] = '\0';
-		minuteStr[1] = minuteStr[0];
-		minuteStr[0] = '0';
-	}
-	sprintf(secondStr, "%d", second);          // 秒。
-	if (secondStr[1] == '\0')                  // 如果秒为一位,如5,则需要转换字符串为两位,如05。
-	{
-		secondStr[2] = '\0';
-		secondStr[1] = secondStr[0];
-		secondStr[0] = '0';
-	}
-	char s[20];                                // 定义总日期时间char*变量。
-	sprintf(s, "%s-%s-%s %s:%s:%s", yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);// 将年月日时分秒合并。
-	string str(s);                             // 定义string变量,并将总日期时间char*变量作为构造函数的参数传入。
-	return str;                                // 返回转换日期时间后的string变量。
-}
-
-string CLewaimaiTime::DatetimeToDateString(time_t time)
-{
-	struct tm tm_;
-
-#ifdef _WIN32
-	localtime_s(&tm_, &time);                // 将time_t格式转换为tm结构体
-#else
-	localtime_r(&time, &tm_);                // 将time_t格式转换为tm结构体
-#endif
-
-	int year, month, day, hour, minute, second;// 定义时间的各个int临时变量。
-	year = tm_.tm_year + 1900;                // 临时变量,年,由于tm结构体存储的是从1900年开始的时间,所以临时变量int为tm_year加上1900。
-	month = tm_.tm_mon + 1;                   // 临时变量,月,由于tm结构体的月份存储范围为0-11,所以临时变量int为tm_mon加上1。
-	day = tm_.tm_mday;                        // 临时变量,日。
-	hour = tm_.tm_hour;                       // 临时变量,时。
-	minute = tm_.tm_min;                      // 临时变量,分。
-	second = tm_.tm_sec;                      // 临时变量,秒。
-	char yearStr[5], monthStr[3], dayStr[3], hourStr[3], minuteStr[3], secondStr[3];// 定义时间的各个char*变量。
-	sprintf(yearStr, "%d", year);              // 年。
-	sprintf(monthStr, "%d", month);            // 月。
-	sprintf(dayStr, "%d", day);                // 日。
-	sprintf(hourStr, "%d", hour);              // 时。
-	sprintf(minuteStr, "%d", minute);          // 分。
-	if (hourStr[1] == '\0')                  // 如果小时为一位,如5,则需要转换字符串为两位,如05。
-	{
-		hourStr[2] = '\0';
-		hourStr[1] = hourStr[0];
-		hourStr[0] = '0';
-	}
-	if (minuteStr[1] == '\0')                  // 如果分为一位,如5,则需要转换字符串为两位,如05。
-	{
-		minuteStr[2] = '\0';
-		minuteStr[1] = minuteStr[0];
-		minuteStr[0] = '0';
-	}
-	sprintf(secondStr, "%d", second);          // 秒。
-	if (secondStr[1] == '\0')                  // 如果秒为一位,如5,则需要转换字符串为两位,如05。
-	{
-		secondStr[2] = '\0';
-		secondStr[1] = secondStr[0];
-		secondStr[0] = '0';
-	}
-	char s[11];                                // 定义总日期时间char*变量。
-	sprintf(s, "%s-%s-%s", yearStr, monthStr, dayStr);// 将年月日合并。
-	string str(s);                             // 定义string变量,并将总日期时间char*变量作为构造函数的参数传入。
-	return str;                                // 返回转换日期时间后的string变量。
-}
-
-string CLewaimaiTime::DatetimeToHourString(time_t time)
-{
-	struct tm tm_;
-
-#ifdef _WIN32
-	localtime_s(&tm_, &time);                // 将time_t格式转换为tm结构体
-#else
-	localtime_r(&time, &tm_);                // 将time_t格式转换为tm结构体
-#endif
-
-	int hour = tm_.tm_hour;
-
-	return to_string(hour);
-}
-
-#ifdef _WIN32
-std::chrono::steady_clock::time_point CLewaimaiTime::getTimeStamp()
-{
-	return std::chrono::high_resolution_clock::now();
-}
-
-float CLewaimaiTime::getTimeDiff(std::chrono::steady_clock::time_point start, std::chrono::steady_clock::time_point end)
-{
-	return std::chrono::duration<float, std::milli>(end - start).count();
-}
-#else
-std::chrono::_V2::system_clock::time_point CLewaimaiTime::getTimeStamp()
-{
-	return std::chrono::high_resolution_clock::now();
-}
-
-float CLewaimaiTime::getTimeDiff(std::chrono::_V2::system_clock::time_point start, std::chrono::_V2::system_clock::time_point end)
-{
-	return std::chrono::duration<float, std::milli>(end - start).count();
-}
-#endif
-
-

+ 0 - 29
zhipuzi_pos_windows_server/tool/CLewaimaiTime.h

@@ -1,29 +0,0 @@
-#pragma once
-
-#include <ctime>
-
-class CLewaimaiTime
-{
-public:
-	CLewaimaiTime();
-	~CLewaimaiTime();
-
-	static time_t StringToDatetime(string str);
-	static string DatetimeToString(time_t time);
-
-	//将time转换成日期,不包含时间
-	static string DatetimeToDateString(time_t time);
-
-	//将time转换成小时数
-	static string DatetimeToHourString(time_t time);
-
-#ifdef _WIN32
-	static std::chrono::steady_clock::time_point getTimeStamp();
-	static float getTimeDiff(std::chrono::steady_clock::time_point start, std::chrono::steady_clock::time_point end);
-#else
-	static std::chrono::_V2::system_clock::time_point getTimeStamp();
-	static float getTimeDiff(std::chrono::_V2::system_clock::time_point start, std::chrono::_V2::system_clock::time_point end);
-#endif
-
-};
-

+ 0 - 24
zhipuzi_pos_windows_server/zhipuzi_pos_windows_server.cpp

@@ -1,24 +0,0 @@
-#include "pch/pch.h"
-#include "network/CServer.h"
-
-int main()
-{
-	//初始化日志
-	CLewaimaiLog log;
-	log.Init();
-
-	//读取配置文件
-	CConfigReader::ReadConfigFile();
-
-	try
-	{
-		//初始化服务器,开始监听和处理消息
-		CServer s;
-		s.Init();		
-	}
-	catch (std::exception& e)
-	{
-		std::cerr << "Exception: " << e.what() << "\n";
-		LOG_INFO("Exception: " << e.what());
-	}
-}

Разница между файлами не показана из-за своего большого размера
+ 0 - 127
zhipuzi_pos_windows_server/zhipuzi_pos_windows_server_linux.vcxproj


+ 0 - 21
zhipuzi_pos_windows_server/zhipuzi_pos_windows_server_linux.vcxproj.user

@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <PropertyGroup>
-    <ShowAllFiles>true</ShowAllFiles>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <RemoteTarget>-647472749;101.37.14.57 (username=, port=22, authentication=Password)</RemoteTarget>
-    <RemoteDebuggerCommand>/usr/local/zhipuzi_pos_windows_server/bin/zhipuzi_pos_windows_server_linux</RemoteDebuggerCommand>
-    <DebuggerFlavor>LinuxDebugger</DebuggerFlavor>
-    <RemoteDebuggerWorkingDirectory>/usr/local/zhipuzi_pos_windows_server/bin</RemoteDebuggerWorkingDirectory>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x86'">
-    <RemoteTarget>-647472749;101.37.14.57 (username=, port=22, authentication=Password)</RemoteTarget>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x86'">
-    <RemoteTarget>-647472749;101.37.14.57 (username=, port=22, authentication=Password)</RemoteTarget>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-    <RemoteTarget>-647472749;101.37.14.57 (username=, port=22, authentication=Password)</RemoteTarget>
-  </PropertyGroup>
-</Project>

+ 0 - 233
zhipuzi_pos_windows_server/zhipuzi_pos_windows_server_windows.vcxproj

@@ -1,233 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="Debug|Win32">
-      <Configuration>Debug</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|Win32">
-      <Configuration>Release</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Debug|x64">
-      <Configuration>Debug</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|x64">
-      <Configuration>Release</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <VCProjectVersion>15.0</VCProjectVersion>
-    <ProjectGuid>{2FF637C1-9F58-473C-A156-25EFE35C2FD7}</ProjectGuid>
-    <Keyword>Win32Proj</Keyword>
-    <RootNamespace>zhipuziposwindowsserverwindows</RootNamespace>
-    <WindowsTargetPlatformVersion>10.0.26100.0</WindowsTargetPlatformVersion>
-    <ProjectName>zhipuzi_pos_windows_server</ProjectName>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseDebugLibraries>true</UseDebugLibraries>
-    <PlatformToolset>v145</PlatformToolset>
-    <CharacterSet>Unicode</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseDebugLibraries>false</UseDebugLibraries>
-    <PlatformToolset>v145</PlatformToolset>
-    <WholeProgramOptimization>true</WholeProgramOptimization>
-    <CharacterSet>Unicode</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseDebugLibraries>true</UseDebugLibraries>
-    <PlatformToolset>v145</PlatformToolset>
-    <CharacterSet>Unicode</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseDebugLibraries>false</UseDebugLibraries>
-    <PlatformToolset>v145</PlatformToolset>
-    <WholeProgramOptimization>true</WholeProgramOptimization>
-    <CharacterSet>Unicode</CharacterSet>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Label="Shared">
-  </ImportGroup>
-  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-    <LinkIncremental>true</LinkIncremental>
-    <OutDir>$(SolutionDir)temp\link\$(Platform)\$(Configuration)\$(ProjectName)\</OutDir>
-    <IntDir>$(SolutionDir)temp\compile\$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <LinkIncremental>true</LinkIncremental>
-    <OutDir>$(SolutionDir)temp\link\$(Platform)\$(Configuration)\$(ProjectName)\</OutDir>
-    <IntDir>$(SolutionDir)temp\compile\$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <LinkIncremental>false</LinkIncremental>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <LinkIncremental>false</LinkIncremental>
-    <OutDir>$(SolutionDir)temp\link\$(Platform)\$(Configuration)\$(ProjectName)\</OutDir>
-    <IntDir>$(SolutionDir)temp\compile\$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-    <ClCompile>
-      <PrecompiledHeader>NotUsing</PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <Optimization>Disabled</Optimization>
-      <SDLCheck>true</SDLCheck>
-      <PreprocessorDefinitions>_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;_WIN32_WINNT=0x600;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <ConformanceMode>true</ConformanceMode>
-      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
-      <AdditionalIncludeDirectories>$(SolutionDir)include;$(ProjectDir)pch</AdditionalIncludeDirectories>
-    </ClCompile>
-    <Link>
-      <SubSystem>Console</SubSystem>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <AdditionalLibraryDirectories>$(SolutionDir)lib\debug\grpc;$(SolutionDir)lib;$(SolutionDir)lib\debug</AdditionalLibraryDirectories>
-      <AdditionalDependencies>log4cplusUD.lib;aliyun-mns.lib;libcurl_debug.lib;libeay32.lib;ssleay32.lib;mysqlcppconn.lib;Dbghelp.lib;libprotobufd.lib;grpc.lib;grpc++.lib;cares.lib;gpr.lib;zlibd.lib;address_sorting.lib;ssl.lib;crypto.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <AdditionalOptions>/ignore:4099 %(AdditionalOptions)</AdditionalOptions>
-      <IgnoreSpecificDefaultLibraries>
-      </IgnoreSpecificDefaultLibraries>
-    </Link>
-    <PostBuildEvent>
-      <Command>$(SolutionDir)bin\$(Platform)\$(Configuration)\$(ProjectName)\
-copy $(TargetPath) $(SolutionDir)bin\$(Platform)\$(Configuration)\$(ProjectName)\
-copy $(SolutionDir)dll\debug\ $(SolutionDir)bin\$(Platform)\$(Configuration)\$(ProjectName)\
-mkdir $(SolutionDir)bin\$(Platform)\$(Configuration)\conf\
-copy $(ProjectDir)conf\ $(SolutionDir)bin\$(Platform)\$(Configuration)\conf\</Command>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <ClCompile>
-      <PrecompiledHeader>NotUsing</PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <Optimization>Disabled</Optimization>
-      <SDLCheck>true</SDLCheck>
-      <PreprocessorDefinitions>WIN32;_CRT_SECURE_NO_WARNINGS;_DEBUG;_CONSOLE;_WIN32_WINNT=0x600;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <ConformanceMode>true</ConformanceMode>
-      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
-      <AdditionalIncludeDirectories>$(SolutionDir)include;$(ProjectDir)pch</AdditionalIncludeDirectories>
-    </ClCompile>
-    <Link>
-      <SubSystem>Console</SubSystem>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <AdditionalLibraryDirectories>$(SolutionDir)lib\debug</AdditionalLibraryDirectories>
-      <AdditionalDependencies>log4cplusUD.lib;libboost_date_time-vc141-mt-gd-x32-1_70.lib;libboost_regex-vc141-mt-gd-x32-1_70.lib;DbgHelp.lib;mnscpp.lib;libcurl_debug.lib;ssleay32MTd.lib;libeay32MTd.lib;sqlite3.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <AdditionalOptions>/ignore:4099 %(AdditionalOptions)</AdditionalOptions>
-      <IgnoreAllDefaultLibraries>
-      </IgnoreAllDefaultLibraries>
-      <IgnoreSpecificDefaultLibraries>LIBCMTD</IgnoreSpecificDefaultLibraries>
-    </Link>
-    <PostBuildEvent>
-      <Command>mkdir $(SolutionDir)bin\$(Platform)\$(Configuration)\$(ProjectName)\
-mkdir $(SolutionDir)bin\$(Platform)\$(Configuration)\$(ProjectName)\conf\
-copy $(TargetPath) $(SolutionDir)bin\$(Platform)\$(Configuration)\$(ProjectName)\
-copy $(SolutionDir)dll\debug\ $(SolutionDir)bin\$(Platform)\$(Configuration)\$(ProjectName)\
-copy $(ProjectDir)conf\ $(SolutionDir)bin\$(Platform)\$(Configuration)\$(ProjectName)\conf\</Command>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <ClCompile>
-      <PrecompiledHeader>Use</PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <Optimization>MaxSpeed</Optimization>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <IntrinsicFunctions>true</IntrinsicFunctions>
-      <SDLCheck>true</SDLCheck>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <ConformanceMode>true</ConformanceMode>
-      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
-      <LanguageStandard>stdcpp20</LanguageStandard>
-      <LanguageStandard_C>stdc17</LanguageStandard_C>
-    </ClCompile>
-    <Link>
-      <SubSystem>Console</SubSystem>
-      <EnableCOMDATFolding>true</EnableCOMDATFolding>
-      <OptimizeReferences>true</OptimizeReferences>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <ClCompile>
-      <PrecompiledHeader>NotUsing</PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <Optimization>MaxSpeed</Optimization>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <IntrinsicFunctions>true</IntrinsicFunctions>
-      <SDLCheck>true</SDLCheck>
-      <PreprocessorDefinitions>NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;_WIN32_WINNT=0x600</PreprocessorDefinitions>
-      <ConformanceMode>true</ConformanceMode>
-      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
-      <AdditionalIncludeDirectories>$(SolutionDir)include;$(ProjectDir)pch</AdditionalIncludeDirectories>
-    </ClCompile>
-    <Link>
-      <SubSystem>Console</SubSystem>
-      <EnableCOMDATFolding>true</EnableCOMDATFolding>
-      <OptimizeReferences>true</OptimizeReferences>
-      <GenerateDebugInformation>false</GenerateDebugInformation>
-      <AdditionalLibraryDirectories>$(SolutionDir)lib\release\grpc;$(SolutionDir)lib;$(SolutionDir)lib\release</AdditionalLibraryDirectories>
-      <AdditionalDependencies>log4cplus.lib;aliyun-mns.lib;libcurl.lib;libeay32.lib;ssleay32.lib;mysqlcppconn.lib;libprotobuf.lib;grpc.lib;grpc++.lib;cares.lib;gpr.lib;zlib.lib;address_sorting.lib;ssl.lib;crypto.lib</AdditionalDependencies>
-      <AdditionalOptions>/ignore:4099 %(AdditionalOptions)</AdditionalOptions>
-    </Link>
-    <PostBuildEvent>
-      <Command>$(SolutionDir)bin\$(Platform)\$(Configuration)\$(ProjectName)\
-copy $(TargetPath) $(SolutionDir)bin\$(Platform)\$(Configuration)\$(ProjectName)\
-copy $(SolutionDir)dll\release\ $(SolutionDir)bin\$(Platform)\$(Configuration)\$(ProjectName)\
-mkdir $(SolutionDir)bin\$(Platform)\$(Configuration)\conf\
-copy $(ProjectDir)conf\ $(SolutionDir)bin\$(Platform)\$(Configuration)\conf\</Command>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <ClInclude Include="helper\CAliyunMNS.h" />
-    <ClInclude Include="network\CServer.h" />
-    <ClInclude Include="network\CClientSession.h" />
-    <ClInclude Include="helper\CConfigReader.h" />
-    <ClInclude Include="helper\CLewaimaiString.h" />
-    <ClInclude Include="helper\define.h" />
-    <ClInclude Include="network\PosMessage.h" />
-    <ClInclude Include="tool\CLewaimaiLog.h" />
-    <ClInclude Include="pch\pch.h" />
-    <ClInclude Include="tool\CLewaimaiTime.h" />
-    <ClInclude Include="helper\CRandomHelper.h" />
-    <ClInclude Include="helper\CSystem.h" />
-  </ItemGroup>
-  <ItemGroup>
-    <ClCompile Include="helper\CAliyunMNS.cpp" />
-    <ClCompile Include="network\CServer.cpp" />
-    <ClCompile Include="network\CClientSession.cpp" />
-    <ClCompile Include="helper\CConfigReader.cpp" />
-    <ClCompile Include="helper\CLewaimaiString.cpp" />
-    <ClCompile Include="tool\CLewaimaiLog.cpp" />
-    <ClCompile Include="zhipuzi_pos_windows_server.cpp" />
-    <ClCompile Include="pch\pch.cpp" />
-    <ClCompile Include="tool\CLewaimaiTime.cpp" />
-    <ClCompile Include="helper\CRandomHelper.cpp" />
-    <ClCompile Include="helper\CSystem.cpp" />
-  </ItemGroup>
-  <ItemGroup>
-    <None Include="conf\zhipuzi_pos_windows_server.conf" />
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>

+ 0 - 93
zhipuzi_pos_windows_server/zhipuzi_pos_windows_server_windows.vcxproj.filters

@@ -1,93 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup>
-    <Filter Include="源文件">
-      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
-      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
-    </Filter>
-    <Filter Include="头文件">
-      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
-      <Extensions>h;hh;hpp;hxx;hm;inl;inc;ipp;xsd</Extensions>
-    </Filter>
-    <Filter Include="资源文件">
-      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
-      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
-    </Filter>
-  </ItemGroup>
-  <ItemGroup>
-    <ClInclude Include="pch\pch.h">
-      <Filter>头文件</Filter>
-    </ClInclude>
-    <ClInclude Include="tool\CLewaimaiTime.h">
-      <Filter>头文件</Filter>
-    </ClInclude>
-    <ClInclude Include="tool\CLewaimaiLog.h">
-      <Filter>头文件</Filter>
-    </ClInclude>
-    <ClInclude Include="helper\CRandomHelper.h">
-      <Filter>头文件</Filter>
-    </ClInclude>
-    <ClInclude Include="helper\CSystem.h">
-      <Filter>头文件</Filter>
-    </ClInclude>
-    <ClInclude Include="helper\define.h">
-      <Filter>头文件</Filter>
-    </ClInclude>
-    <ClInclude Include="helper\CConfigReader.h">
-      <Filter>头文件</Filter>
-    </ClInclude>
-    <ClInclude Include="helper\CLewaimaiString.h">
-      <Filter>头文件</Filter>
-    </ClInclude>
-    <ClInclude Include="network\CClientSession.h">
-      <Filter>头文件</Filter>
-    </ClInclude>
-    <ClInclude Include="network\CServer.h">
-      <Filter>头文件</Filter>
-    </ClInclude>
-    <ClInclude Include="helper\CAliyunMNS.h">
-      <Filter>头文件</Filter>
-    </ClInclude>
-    <ClInclude Include="network\PosMessage.h">
-      <Filter>头文件</Filter>
-    </ClInclude>
-  </ItemGroup>
-  <ItemGroup>
-    <ClCompile Include="pch\pch.cpp">
-      <Filter>源文件</Filter>
-    </ClCompile>
-    <ClCompile Include="tool\CLewaimaiTime.cpp">
-      <Filter>源文件</Filter>
-    </ClCompile>
-    <ClCompile Include="tool\CLewaimaiLog.cpp">
-      <Filter>源文件</Filter>
-    </ClCompile>
-    <ClCompile Include="helper\CRandomHelper.cpp">
-      <Filter>源文件</Filter>
-    </ClCompile>
-    <ClCompile Include="helper\CSystem.cpp">
-      <Filter>源文件</Filter>
-    </ClCompile>
-    <ClCompile Include="helper\CConfigReader.cpp">
-      <Filter>源文件</Filter>
-    </ClCompile>
-    <ClCompile Include="helper\CLewaimaiString.cpp">
-      <Filter>源文件</Filter>
-    </ClCompile>
-    <ClCompile Include="network\CClientSession.cpp">
-      <Filter>源文件</Filter>
-    </ClCompile>
-    <ClCompile Include="network\CServer.cpp">
-      <Filter>源文件</Filter>
-    </ClCompile>
-    <ClCompile Include="helper\CAliyunMNS.cpp">
-      <Filter>源文件</Filter>
-    </ClCompile>
-    <ClCompile Include="zhipuzi_pos_windows_server.cpp">
-      <Filter>源文件</Filter>
-    </ClCompile>
-  </ItemGroup>
-  <ItemGroup>
-    <None Include="conf\zhipuzi_pos_windows_server.conf" />
-  </ItemGroup>
-</Project>

+ 0 - 21
zhipuzi_pos_windows_server/zhipuzi_pos_windows_server_windows.vcxproj.user

@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <PropertyGroup>
-    <ShowAllFiles>true</ShowAllFiles>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-    <LocalDebuggerCommand>$(SolutionDir)bin\$(Platform)\$(Configuration)\$(ProjectName)\$(TargetFileName)</LocalDebuggerCommand>
-    <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
-    <LocalDebuggerWorkingDirectory>$(SolutionDir)bin\$(Platform)\$(Configuration)\$(ProjectName)\</LocalDebuggerWorkingDirectory>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <LocalDebuggerCommand>$(SolutionDir)bin\$(Platform)\$(Configuration)\$(ProjectName)\$(TargetFileName)</LocalDebuggerCommand>
-    <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
-    <LocalDebuggerWorkingDirectory>$(SolutionDir)bin\$(Platform)\$(Configuration)\$(ProjectName)\</LocalDebuggerWorkingDirectory>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <LocalDebuggerCommand>$(SolutionDir)bin\$(Platform)\$(Configuration)\$(ProjectName)\$(TargetFileName)</LocalDebuggerCommand>
-    <LocalDebuggerWorkingDirectory>$(SolutionDir)bin\$(Platform)\$(Configuration)\$(ProjectName)\</LocalDebuggerWorkingDirectory>
-    <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
-  </PropertyGroup>
-</Project>