瀏覽代碼

!10813 防火墙+日志改造+文涛日志精简
Merge pull request !10813 from 80374463/ST2_0611_firewall

杨诗友80174847 5 月之前
父節點
當前提交
553f4f54d9
共有 51 個文件被更改,包括 1312 次插入2083 次删除
  1. 3 0
      Framework/Common/SpBase.h
  2. 52 2
      Framework/RvcLogSdk/baseFun.cpp
  3. 1 0
      Framework/RvcLogSdk/baseFun.h
  4. 0 0
      Framework/RvcLogSdk/baseFunc.h
  5. 20 0
      Framework/RvcLogSdk/log_api.cpp
  6. 18 2
      Framework/RvcLogSdk/log_builder.cpp
  7. 15 1
      Framework/RvcLogSdk/log_db.cpp
  8. 7 0
      Framework/RvcLogSdk/log_producer_client.cpp
  9. 2 0
      Framework/RvcLogSdk/log_producer_client.h
  10. 4 0
      Framework/RvcRestfulSdk/RestfulFunc.h
  11. 9 2
      Framework/RvcRestfulSdk/RestfulFuncImpl.cpp
  12. 9 5
      Framework/libtoolkit/log.c
  13. 7 1
      Framework/spbase/CMakeLists.txt
  14. 52 0
      Framework/spbase/SpEntity.cpp
  15. 1 0
      Framework/spbase/SpEntity.h
  16. 4 2
      Framework/spbase/SpSecureClient.cpp
  17. 29 8
      Framework/spbase/SpServerSessionFunction.cpp
  18. 4 0
      Framework/spbase/SpServerSessionFunction.h
  19. 461 0
      Framework/spbase/sp_firewallControl.cpp
  20. 78 0
      Framework/spbase/sp_firewallControl.h
  21. 3 0
      Framework/spbase/sp_iom.c
  22. 5 0
      Framework/spbase/sp_logwithlink.cpp
  23. 5 2
      Framework/spshell/spshell.cpp
  24. 1 101
      Module/mod_CardIssuerStand/CardIssuerStand.xml
  25. 24 23
      Module/mod_CardIssuerStand/CardIssuerStandFSM.cpp
  26. 0 294
      Module/mod_CardIssuerStand/CardIssuerStand_client_g.h
  27. 0 202
      Module/mod_CardIssuerStand/CardIssuerStand_def_g.h
  28. 0 162
      Module/mod_CardIssuerStand/CardIssuerStand_server_g.h
  29. 4 1
      Module/mod_CardIssuerStand/mod_cardissuerStand.h
  30. 15 275
      Module/mod_CardReadAdapter/CardReadAdapterFSM.cpp
  31. 3 3
      Module/mod_ContactlessCard/ContactlessFSM.cpp
  32. 4 1
      Module/mod_ContactlessCard/mod_ContactlessCard.h
  33. 51 0
      Module/mod_UpgradeMgr/UpgradeTaskFSM.cpp
  34. 3 1
      Module/mod_UpgradeMgr/UpgradeTaskFSM.h
  35. 4 4
      Module/mod_cardissuerstore/CMakeLists.txt
  36. 0 100
      Module/mod_cardissuerstore/CardIssuerStore.xml
  37. 148 167
      Module/mod_cardissuerstore/CardIssuerStoreFSM.cpp
  38. 44 26
      Module/mod_cardissuerstore/CardIssuerStoreFSM.h
  39. 0 294
      Module/mod_cardissuerstore/CardIssuerStore_client_g.h
  40. 0 202
      Module/mod_cardissuerstore/CardIssuerStore_def_g.h
  41. 0 162
      Module/mod_cardissuerstore/CardIssuerStore_server_g.h
  42. 17 20
      Module/mod_cardissuerstore/mod_cardissuerStore.cpp
  43. 21 18
      Module/mod_cardissuerstore/mod_cardissuerStore.h
  44. 6 1
      Module/mod_chromium/ReadMe.md
  45. 49 0
      Module/mod_guiconsole/GUIConsole_client_g.h
  46. 36 0
      Module/mod_guiconsole/GUIConsole_def_g.h
  47. 27 0
      Module/mod_guiconsole/GUIConsole_server_g.h
  48. 19 0
      Module/mod_guiconsole/GuiConsole.xml
  49. 2 0
      Module/mod_guiconsole/mod_GuiConsole.h
  50. 44 0
      Module/mod_guiconsole/mod_guiconsole.cpp
  51. 1 1
      Other/libRestfulFunc/RestfulFunc.h

+ 3 - 0
Framework/Common/SpBase.h

@@ -1059,6 +1059,8 @@ struct IEntityFunction
 	virtual void ResetEntityLastError() = 0;
 
 	virtual ErrorCodeEnum GetToken(CSimpleString& channelId, CSimpleString& token) = 0;
+
+	virtual ErrorCodeEnum SetNewPathToFirewall(CSimpleString& pszPath, int maxWaitMs = 30000) = 0;
 	/* GetRunningVersion
 	currently return version in active.txt, may be it will return the version from micro sever latter.
 	*/
@@ -1667,6 +1669,7 @@ SPBASE_API int getCurLogLevel();
 SPBASE_API int getReduceSpbaseLog();
 SPBASE_API void setReduceSpbaseLog(int isNor);
 SPBASE_API void setTestLogMode();
+SPBASE_API int SendTestLog_loki(const char* app, const char* env, const char* body);
 SPBASE_API ErrorCodeEnum GetAllEntityIdx(CAutoArray<CSimpleStringA>& strEntityNames, CAutoArray<WORD>& wEntityDevelopIDs);
 
 

+ 52 - 2
Framework/RvcLogSdk/baseFun.cpp

@@ -1,3 +1,4 @@
+#include <thread>
 #include <time.h>
 #include <RestfulFunc.h>
 #include "json/json.h"
@@ -49,10 +50,10 @@ int RvcLogSdkManager::LOG_OS_TestLogPost(const char* url, const char* body)
     return 0;
 }
 int RvcLogSdkManager::SendTestLog(const char* body)
-{
+{//http://99.12.43.134:9000/upload_msg
     if (m_testLogMode == false)
         return -1;
-    HttpClientRequestConfig sendErr(HttpRequestMethod::POST, "http://99.12.43.134:9000/upload_msg");
+    HttpClientRequestConfig sendErr(HttpRequestMethod::POST, "");
     HttpClientResponseResult curResult;
     Json::Value rootReq;
     Json::FastWriter writer;
@@ -66,6 +67,55 @@ int RvcLogSdkManager::SendTestLog(const char* body)
     return 0;
 }
 
+int RvcLogSdkManager::SendTestLog_loki(const char* app, const char* env, const char* body)
+{//http://99.12.23.49:3100/loki/api/v1/push
+    if (m_testLogMode == false)
+        return -1;
+    // 1. 构造Loki兼容的JSON请求体
+    Json::Value root;
+    Json::Value stream;
+    Json::Value values(Json::arrayValue);
+
+    // 设置标签
+    stream["app"] = app;
+    stream["env"] = env;
+
+    // 设置日志内容和时间戳(当前时间戳,纳秒级)
+    Json::Value logEntry(Json::arrayValue);
+    logEntry.append(std::to_string(std::chrono::duration_cast<std::chrono::nanoseconds>(
+        std::chrono::system_clock::now().time_since_epoch()).count()));
+    logEntry.append(body);
+    values.append(logEntry);
+
+    // 组装完整请求
+    Json::Value streams(Json::arrayValue);
+    Json::Value streamObj;
+    streamObj["stream"] = stream;
+    streamObj["values"] = values;
+    streams.append(streamObj);
+    root["streams"] = streams;
+
+    Json::FastWriter writer;
+    std::string jsonReq = writer.write(root);
+
+    auto send_loki = [](std::string jsonReq)
+    {
+        HttpClientRequestConfig sendErr(HttpRequestMethod::POST, "");
+        sendErr.setWithToken(false);
+        HttpClientResponseResult curResult;
+
+        sendErr.SetJsonBody(jsonReq.c_str());
+        RestfulClient client = RestfulClient::getInstance();
+        sendErr.PreDo();
+        client.Do(&sendErr, &curResult, NULL);//Test Logs
+    };
+
+    std::thread(send_loki, jsonReq).detach();//必须得用线程,猜测为外部变量析构或这
+
+    
+    return 0;
+}
+
 
 
 #ifndef _WIN32

+ 1 - 0
Framework/RvcLogSdk/baseFun.h

@@ -30,6 +30,7 @@ public:
 
     int LOG_OS_TestLogPost(const char* url, const char* body);
     int SendTestLog(const char* body);
+    int SendTestLog_loki(const char* app, const char* env, const char* body);
 private:
     std::list<log_group_builder*> m_resend_frame_list;
 private:

+ 0 - 0
Framework/RvcLogSdk/baseFunc.h


+ 20 - 0
Framework/RvcLogSdk/log_api.cpp

@@ -9,6 +9,7 @@
 #include "sds.h"
 #include "inner_log.h"
 #include "baseFun.h"
+#include <log_producer_client.h>
 
 
 //#define GBK_COMPACT
@@ -441,6 +442,25 @@ post_log_result* post_logs(const char* endpoint, const char* accesskeyId, const
         if(buffer->data != NULL && buffer->length != 0)
 			res = LOG_OS_HttpPost(url, header_array, header_count, (const void *) buffer->data, buffer->length, channelId, token, terminalno, reserve1);
 
+		/*
+		if (buffer->type == LOG_TYPE_BEIDOU)
+		{
+			for (auto i = 0; i < buffer->n_logs; i++)
+			{
+				std::string dstLog = std::string(buffer->uuid[i]) + " post_logs_beidou";
+				log_producer_sendTestLog_loki("RVCLogSDK", buffer->uuid[i], dstLog.c_str());
+			}
+		}
+		else
+		{
+			for (auto i = 0; i < buffer->n_logs; i++)
+			{
+				std::string dstLog = std::string(buffer->uuid[i]) + " post_logs_skyeye";
+				log_producer_sendTestLog_loki("RVCLogSDK", buffer->uuid[i], dstLog.c_str());
+			}
+		}
+		*/
+		
         result->statusCode = res;
 
         cur_slist_free_all(headers); /* free the list again */

+ 18 - 2
Framework/RvcLogSdk/log_builder.cpp

@@ -12,6 +12,7 @@
 #include <chrono>
 #include <ctime>
 #include <baseTime.h>
+#include "log_producer_client.h"
 
 
 /**
@@ -250,10 +251,13 @@ int add_log(log_group_builder* bder, long start_time, uint32_t pack_index, log_i
     if (bder->grp->n_logs >= MAX_LOG_COUNT) {
         return -1;
     }
-
+    
     memset(bder->grp->logs[bder->grp->n_logs].uuid, 0, MAX_UUID_LEN);
     get_format_uuid(bder->grp->logs[bder->grp->n_logs].uuid, MAX_UUID_LEN);
-
+    /*
+    std::string dstLog = std::to_string(pack_index) + " add_log_skyeye " + std::string(bder->grp->logs[bder->grp->n_logs].uuid);
+    log_producer_sendTestLog_loki("RVCLogSDK", bder->grp->logs[bder->grp->n_logs].uuid, dstLog.c_str());
+    */
     now = record_time;
 
     skyeye_content = cJSON_CreateObject();
@@ -1005,4 +1009,16 @@ void serialize_to_buf(build_item* log, serialize_buf* buf) {
     memcpy(buf->uuid, log->uuid, MAX_UUID_LEN);
     buf->buffer_len = log->buffer_len;
     memcpy(buf->buffer, log->buffer, log->buffer_len > sizeof(buf->buffer) - 1 ? sizeof(buf->buffer) - 1 : log->buffer_len);
+    /*
+    if (buf->type == LOG_TYPE_BEIDOU)
+    {
+        std::string dstLog = std::string(buf->uuid) + " flush_log_beidou";
+        log_producer_sendTestLog_loki("RVCLogSDK", buf->uuid, dstLog.c_str());
+    }
+    else
+    {
+        std::string dstLog = std::string(buf->uuid) + " flush_log_skyeye";
+        log_producer_sendTestLog_loki("RVCLogSDK", buf->uuid, dstLog.c_str());
+    }
+    */
 }

+ 15 - 1
Framework/RvcLogSdk/log_db.cpp

@@ -22,6 +22,7 @@
 #include "base64_openssl.h"
 #include <chrono>
 #include "baseFun.h"
+#include <log_producer_client.h>
 
 #ifndef _WIN32
 
@@ -294,6 +295,7 @@ int db_insert_group(log_db_manager* manager, log_group_builder* builder) {
 		memset(&buf, 0, sizeof(serialize_buf));
 		serialize_to_buf(&builder->grp->logs[i], &buf);
 		ret = db_insert_one(manager, &buf);
+		
 	}
 	return ret;
 }
@@ -430,7 +432,19 @@ int db_insert_one(log_db_manager* manager, serialize_buf* buf) {
 		if(decoded_bytes)
 			free(decoded_bytes);
 		*/
-			
+		/*
+		if (buf->type == LOG_TYPE_BEIDOU)
+		{
+			std::string dstLog = std::string(buf->uuid) + " db_insert_one_beidou encrypt3";
+			log_producer_sendTestLog_loki("RVCLogSDK", buf->uuid, dstLog.c_str());
+		}
+		else
+		{
+			std::string dstLog = std::string(buf->uuid) + " db_insert_one_skyeye encrypt3";
+			log_producer_sendTestLog_loki("RVCLogSDK", buf->uuid, dstLog.c_str());
+		}
+		*/
+		
 
 		strSql.append(manager->table_name).append("(" + COLUMN_DateTime +
 			"," + COLUMN_Uuid + "," + COLUMN_Level + "," + COLUMN_Type + "," + COLUMN_Content + "," + COLUMN_Encrypt + "," + COLUMN_Status +

+ 7 - 0
Framework/RvcLogSdk/log_producer_client.cpp

@@ -168,9 +168,11 @@ log_producer_result log_producer_client_add_beidou_log(log_producer_client* clie
         return LOG_PRODUCER_OK;
     }
     manager = ((producer_client_private*)client->private_data)->producer_manager;
+    /* beidou has no pack index
     CS_ENTER(manager->lock);
     manager->pack_index++;
     CS_LEAVE(manager->lock);
+    */
 
     //日志放入内存缓存,再发送
     rst = log_producer_manager_add_beidou_log(manager, log, flush);
@@ -182,4 +184,9 @@ log_producer_result log_producer_client_add_beidou_log(log_producer_client* clie
 void log_producer_set_testLogMode()
 {
     RvcLogSdkManager::getInstance().m_testLogMode = true;
+}
+
+int log_producer_sendTestLog_loki(const char* app, const char* env, const char* body)
+{
+    return RvcLogSdkManager::getInstance().SendTestLog_loki(app, env, body);
 }

+ 2 - 0
Framework/RvcLogSdk/log_producer_client.h

@@ -69,6 +69,8 @@ LOG_EXPORT log_producer_result log_producer_client_add_beidou_log(log_producer_c
 
 LOG_EXPORT void log_producer_set_testLogMode();
 
+LOG_EXPORT int log_producer_sendTestLog_loki(const char* app, const char* env, const char* body);
+
 LOG_CPP_END
 
 #endif

+ 4 - 0
Framework/RvcRestfulSdk/RestfulFunc.h

@@ -156,6 +156,10 @@ struct HttpClientRequestConfig
     uint32_t GetTimeout() const { return mTimeoutSecs; }
     bool getToken(std::string& t_channelId, std::string& t_token, std::string& terminalNo, std::string& reserve1) const;
 
+    void setWithToken(bool t_withToken) {
+        m_withToken = t_withToken;
+    }
+
     virtual void PreDo() {}
     virtual void PostDo() {}
 

+ 9 - 2
Framework/RvcRestfulSdk/RestfulFuncImpl.cpp

@@ -1,6 +1,7 @@
 #include "RestfulFunc.h"
 #include <string>
 #include <cpprest/http_client.h>
+#include <mutex>
 #if defined(_MSC_VER)
 #include <Windows.h>
 #endif //_MSC_VER
@@ -10,7 +11,7 @@ using namespace web;                        // Common features like URIs.
 using namespace web::http;                  // Common HTTP functionality
 using namespace web::http::client;          // HTTP client features
 
-GetRestfulTokenCallBack g_tokenCall = NULL;
+volatile GetRestfulTokenCallBack g_tokenCall = nullptr;
 RVCRESTFULSDK_API void SetRestfulTokenCallBack(GetRestfulTokenCallBack t_callBack)
 {
     g_tokenCall = t_callBack;
@@ -34,7 +35,10 @@ RestfulClient::~RestfulClient()
 
 
 bool HttpClientRequestConfig::getToken(std::string& t_channelId, std::string& t_token, std::string& terminalNo, std::string& reserve1) const {
-    if (m_withToken && g_tokenCall != NULL)
+    if (g_tokenCall == nullptr)
+        return false;
+    
+    if (m_withToken)
     {
         g_tokenCall(t_channelId, t_token, terminalNo, reserve1);
         if (t_channelId.length() > 0 && t_token.length() > 0)
@@ -176,6 +180,9 @@ namespace
 
 void RestfulClient::Do(const HttpClientRequestConfig* const pRequestConfig, HttpClientResponseResult* pResponse, HttpClientTraceLink* pTrace) const
 {
+    static std::mutex do_mtx;
+    std::lock_guard<std::mutex> lock(do_mtx);
+
     http_client_config config;
     config.set_validate_certificates(pRequestConfig->NeedValidCert());
     const uint32_t timeoutVal = pRequestConfig->GetTimeout();

+ 9 - 5
Framework/libtoolkit/log.c

@@ -444,11 +444,15 @@ TOOLKIT_API int xlog_log_v(const char *inst, int level, const char *fmt, va_list
 		
 
 	n = _vscprintf(fmt, arg);//因为添加了Debug {}, 所以可能超过了1024长度
-	if (n >= 0 && n < 1050) {
-		char *buf = _alloca(n+1);
-		vsprintf(buf, fmt, arg);
-		
-		logfactory_log_record(log->factory, log, level, ft.dwLowDateTime, ft.dwHighDateTime, buf, n);
+	if (n >= 0) {
+		int len = 1050 + 1;
+		char *buf = malloc(len);
+		if (buf) {
+			memset(buf, 0, len);
+			vsnprintf(buf, 1050, fmt, arg);
+			logfactory_log_record(log->factory, log, level, ft.dwLowDateTime, ft.dwHighDateTime, buf, strlen(buf));
+			free(buf);
+		}
 		return 0;
 	}
 	return -1;

+ 7 - 1
Framework/spbase/CMakeLists.txt

@@ -39,6 +39,7 @@ if(MSVC)
     "sp_dbg.cpp"
     "sp_dbg.h"
     "sp_tbs_win.cpp"
+    "sp_firewallControl.cpp"
     )
 endif(MSVC)
 list(APPEND ${MODULE_PREFIX}_SRCS ${CMAKE_SOURCE_DIR}/ThirdParty/Include/uuid4/uuid4.cpp)
@@ -78,13 +79,18 @@ target_link_directories(${MODULE_NAME} PRIVATE
 
 if(MSVC)
     target_compile_definitions(${MODULE_NAME} PRIVATE "-DSPBASE_EXPORTS")
+    set(OTHER_LIBS "comsupp")
+else()
+    set(OTHER_LIBS "")
 endif(MSVC)
 
 target_link_libraries(${MODULE_NAME}
     ${PRIVATE_KEYWORD} ${${MODULE_PREFIX}_LIBS} 
     ${PRIVATE_KEYWORD} ${CONAN_LIBS_JSONCPP}
     ${PRIVATE_KEYWORD} RVCLogSDK
-    ${PRIVATE_KEYWORD} RVCRestfulSDK)
+    ${PRIVATE_KEYWORD} RVCRestfulSDK
+    ${PRIVATE_KEYWORD} ${OTHER_LIBS}
+    )
 
 if (BUILD_TESTING)
     add_library(${MODULE_NAME}_a STATIC ${${MODULE_PREFIX}_SRCS})

+ 52 - 0
Framework/spbase/SpEntity.cpp

@@ -31,12 +31,18 @@
 #ifdef _WIN32
 #include "CodeSignVerify.h"
 #include "sp_checkEntity.h"
+#include "sp_firewallControl.h"
 #else
 #include "sp_dbg_export.h"
 #endif //_WIN32
 #include "sp_httpDefine.h"
 #include <iostream>
 #include <sstream>
+#include <future>
+#include <chrono>
+#include <thread>
+
+
 
 static void var_callback(sp_var_listener_t *listener, 
 						  const char *key, 
@@ -556,7 +562,10 @@ ErrorCodeEnum SpEntity::SetTimer(DWORD nTimerID, ITimerListener *pListener, DWOR
 	ErrorCodeEnum Error = Error_Succeed;
 
 	if (!pListener)
+	{
+		DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("timer id %d param error!", nTimerID);
 		return Error_Param;
+	}
 
 	SpTimerListLock(m_pTimerList);
 	if (SpTimerListFind(m_pTimerList, nTimerID)) {
@@ -575,6 +584,7 @@ ErrorCodeEnum SpEntity::SetTimer(DWORD nTimerID, ITimerListener *pListener, DWOR
 				//DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("timer %d added! interval = %d", nTimerID, dwInterval);
 			}
 		} else {
+			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("timer id %d create error!", nTimerID);
 			Error = Error_Unexpect;
 		}
 	}
@@ -1724,6 +1734,9 @@ ErrorCodeEnum SpEntity::GetEntityStaticInfo(const char *pszEntityName,CEntitySta
 	return ::GetEntityStaticInfo(Info, ent);
 }
 
+
+
+
 ErrorCodeEnum SpEntity::GetToken(CSimpleString &channelId, CSimpleString &token)
 {
 	sp_env_t* env = sp_get_env();
@@ -1735,6 +1748,45 @@ ErrorCodeEnum SpEntity::GetToken(CSimpleString &channelId, CSimpleString &token)
 		return ErrorCodeEnum::Error_Succeed;
 }
 
+ErrorCodeEnum SpEntity::SetNewPathToFirewall(CSimpleString &pszPath, int maxWaitMs)
+{
+	if (pszPath.GetLength() == 0) {
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("SetNewPathToFirewall param error");
+		return Error_Param;
+	}
+
+
+#ifdef _WIN32
+	auto addFirewall_worker = [this](std::string path)
+	{
+		return sp_AddFirewallRuleByPath(path.c_str()) ? Error_Succeed : Error_Bug;
+	};
+
+	std::future<ErrorCodeEnum> result = std::async(std::launch::async, addFirewall_worker, pszPath.GetData());
+
+	auto status = result.wait_for(std::chrono::milliseconds(maxWaitMs));
+	if (status == std::future_status::ready)
+	{
+		auto ret = result.get();
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("SetNewPathToFirewall ret:%d", ret);
+		return ret;
+	}
+	else
+	{
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("SetNewPathToFirewall run over %d milliseconds", maxWaitMs);
+		return Error_TimeOut;
+	}
+
+
+
+#else
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("SetNewPathToFirewall not support uos");
+	return Error_NotSupport;
+#endif // RVC_OS_WIN	
+
+	
+}
+
 ErrorCodeEnum SpEntity::GetEntityStaticInfo(WORD wEntitySerialNO, CEntityStaticInfo &Info)
 {
 	sp_env_t *env = sp_get_env();

+ 1 - 0
Framework/spbase/SpEntity.h

@@ -125,6 +125,7 @@ public:
 	virtual ErrorCodeEnum GetEntityLogPath(const char* pszEntityName, CEntityLogInfo& Info);
 	virtual WORD GetDevID();
 	virtual ErrorCodeEnum GetToken(CSimpleString &channelId, CSimpleString &token);
+	virtual ErrorCodeEnum SetNewPathToFirewall(CSimpleString &pszPath, int maxWaitMs = 30000); // Input path:D:\\Runxxx\\version\\7.1.1.1
 
 	// connect
 	virtual ErrorCodeEnum ConnectRemoteEntity(CClientSessionBase *pClientSession, const char *pszRemoteEntity,const char *pszParam,CSmartPointer<IAsynWaitSp> &pAsynWaitSp);

+ 4 - 2
Framework/spbase/SpSecureClient.cpp

@@ -25,8 +25,10 @@ void getHttpToken(std::string &channelId, std::string &token, std::string &termi
 	CSimpleString t_channelId, t_token;
 	CSystemStaticInfo info;
 	
-	if (SpSecureClient::m_pEntity == NULL ||
-		SpSecureClient::m_pEntity->GetFunction()->GetToken(t_channelId, t_token) != ErrorCodeEnum::Error_Succeed ||
+	if (SpSecureClient::m_pEntity == NULL)
+		return;
+
+	if (SpSecureClient::m_pEntity->GetFunction()->GetToken(t_channelId, t_token) != ErrorCodeEnum::Error_Succeed ||
 		SpSecureClient::m_pEntity->GetFunction()->GetSystemStaticInfo(info) != ErrorCodeEnum::Error_Succeed)
 		return;
 	if(t_channelId.GetLength() != 0 && t_token.GetLength() != 0 && info.strTerminalID.GetLength() != 0)

+ 29 - 8
Framework/spbase/SpServerSessionFunction.cpp

@@ -11,6 +11,9 @@
 #include <winpr/wlog.h>
 #define TAG SPBASE_TAG("SpServerSessionFunction")
 
+std::chrono::steady_clock::time_point SpServerSessionFunction::m_last_Begintime(std::chrono::steady_clock::now());
+std::chrono::steady_clock::time_point SpServerSessionFunction::m_last_Endtime(std::chrono::steady_clock::now());
+
 SpServerSessionFunction::SpServerSessionFunction(SpEntity *pEntity, CServerSessionBase *pServerSessionBase, int remote_epid, int remote_svc_id, int conn_id)
 : m_uas(NULL), m_remote_ent(NULL), m_pServerSessionBase(pServerSessionBase)
 {
@@ -139,6 +142,12 @@ int SpServerSessionFunction::get_method_attr(int method_id, int method_sig, int
 
 void SpServerSessionFunction::on_req(int tsx_id, int method_id, int method_sig, int timeout, iobuffer_t **req_pkt)
 {
+	auto current = std::chrono::steady_clock::now();
+    auto duration = current - m_last_Endtime;
+	auto costDuration = m_last_Endtime - m_last_Begintime;
+	CSimpleString lastReqInfo = CSimpleString::Format("last req complete at %lldms ago, cost %lldms",
+	 std::chrono::duration_cast<std::chrono::milliseconds>(duration).count(),
+	  std::chrono::duration_cast<std::chrono::milliseconds>(costDuration).count());
 	if (NULL != *req_pkt)
 	{
         /** 目前这里的数据读取后面没有用途 [Gifur@2022624]*/
@@ -153,20 +162,31 @@ void SpServerSessionFunction::on_req(int tsx_id, int method_id, int method_sig,
 
 		iobuffer_get_linkInfo(*req_pkt, bussinessId, traceId, spanId, parentSpanId);
 
-		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("on_req: tsx_id=%d, method_id=%d, method_sig=%d, pkt_size=%d, linkcontext=%s-%s-%s-%s", tsx_id, method_id, method_sig, iobuffer_get_length(*req_pkt), bussinessId, traceId, spanId, parentSpanId);
+		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)
+		("%s, on_req: tsx_id=%d, method_id=%d, method_sig=%d, pkt_size=%d, linkcontext=%s-%s-%s-%s",
+		 lastReqInfo.GetData(), tsx_id, method_id, method_sig, iobuffer_get_length(*req_pkt), bussinessId, traceId, spanId, parentSpanId);
 	}
 	else
-		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("on_req: tsx_id=%d, method_id=%d, method_sig=%d, pkt_size=%d", tsx_id, method_id, method_sig, 0);
+		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)
+		("%s, on_req: tsx_id=%d, method_id=%d, method_sig=%d, pkt_size=%d", lastReqInfo.GetData(), tsx_id, method_id, method_sig, 0);
 	
 
 	CSmartPointer<ITransactionContext> spTmp;
 	SpTransactionContext *pTransactionContext = new SpTransactionContext(m_uas, 0, method_id, method_sig, timeout, req_pkt, tsx_id);
 	spTmp.Attach(pTransactionContext);
+	m_last_Begintime = std::chrono::steady_clock::now();
 	m_pServerSessionBase->OnRequest(spTmp);
+	m_last_Endtime = std::chrono::steady_clock::now();
 }
 
 void SpServerSessionFunction::on_info(int method_id, int method_sig, iobuffer_t **info_pkt)
 {
+	auto current = std::chrono::steady_clock::now();
+    auto duration = current - m_last_Endtime;
+	auto costDuration = m_last_Endtime - m_last_Begintime;
+	CSimpleString lastReqInfo = CSimpleString::Format("last req complete at %lldms ago, cost %lldms",
+	 std::chrono::duration_cast<std::chrono::milliseconds>(duration).count(),
+	  std::chrono::duration_cast<std::chrono::milliseconds>(costDuration).count());
 	if (NULL != *info_pkt)
 	{
 		char bussinessId[LINKINFO_BUSSID_LEN + 1];
@@ -178,19 +198,20 @@ void SpServerSessionFunction::on_info(int method_id, int method_sig, iobuffer_t
 		ZeroMemory(spanId, sizeof(spanId));
 		ZeroMemory(parentSpanId, sizeof(parentSpanId));
 		iobuffer_get_linkInfo(*info_pkt, bussinessId, traceId, spanId, parentSpanId);
-		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("on_info: method_id=%d, method_sig=%d, pkt_size=%d, linkcontext=%s-%s-%s-%s", method_id, method_sig, iobuffer_get_length(*info_pkt), bussinessId, traceId, spanId, parentSpanId);
+		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)
+		("%s, on_info: method_id=%d, method_sig=%d, pkt_size=%d, linkcontext=%s-%s-%s-%s",
+		lastReqInfo.GetData(), method_id, method_sig, iobuffer_get_length(*info_pkt), bussinessId, traceId, spanId, parentSpanId);
 	}
 	else
-		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("on_info: method_id=%d, method_sig=%d, pkt_size=%d", method_id, method_sig, 0);
-		
-
-
-	
+		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)
+		("%s, on_info: method_id=%d, method_sig=%d, pkt_size=%d",lastReqInfo.GetData(), method_id, method_sig, 0);
 
 	CSmartPointer<ITransactionContext> spTmp;
 	SpTransactionContext *pTransactionContext = new SpTransactionContext(m_uas, 1, method_id, method_sig, 0, info_pkt, -1);
 	spTmp.Attach(pTransactionContext);
+	m_last_Begintime = std::chrono::steady_clock::now();
 	m_pServerSessionBase->OnRequest(spTmp);
+	m_last_Endtime = std::chrono::steady_clock::now();
 }
 
 void SpServerSessionFunction::on_close(int error)

+ 4 - 0
Framework/spbase/SpServerSessionFunction.h

@@ -4,6 +4,7 @@
 
 #include "sp_ses.h"
 #include "sp_mod.h"
+#include <chrono>
 
 class SpServerSessionFunction : public IServerSessionFunction
 {
@@ -32,4 +33,7 @@ private:
 	CServerSessionBase *m_pServerSessionBase;
 	sp_ses_uas_t *m_uas;
 	sp_entity_t *m_remote_ent;
+	static std::chrono::steady_clock::time_point m_last_Begintime;
+	static std::chrono::steady_clock::time_point m_last_Endtime;
+
 };

+ 461 - 0
Framework/spbase/sp_firewallControl.cpp

@@ -0,0 +1,461 @@
+#include "sp_firewallControl.h"
+#include <comutil.h>
+#include <map>
+#include "path.h"
+#include <locale>
+#include <codecvt>
+#include <string>
+
+// 静态成员初始化
+INetFwPolicy2* FirewallController::firewallPolicy = nullptr;
+bool FirewallController::comInitialized = false;
+
+// 通配符匹配实现(支持*和?)
+bool FirewallController::WildcardMatch(const std::wstring& pattern, const std::wstring& text) {
+    size_t p = 0, s = 0;
+    while (1) {
+        if (p == pattern.size() && s == text.size()) return true;
+        if (p == pattern.size()) return false;
+        if (s == text.size()) return p + 1 == pattern.size() && pattern[p] == L'*';
+
+        if (pattern[p] == text[s] || pattern[p] == L'?') {
+            p++; s++;
+            continue;
+        }
+
+        if (pattern[p] == L'*') {
+            if (p + 1 == pattern.size()) return true;
+            do {
+                if (WildcardMatch(pattern.substr(p + 1), text.substr(s)))
+                    return true;
+                s++;
+            } while (s != text.size());
+            return false;
+        }
+        return false;
+    }
+}
+
+bool FirewallController::Initialize() {
+    if (comInitialized) return true;
+    HRESULT hr = CoInitializeEx(0, COINIT_APARTMENTTHREADED);
+    if (FAILED(hr)) return false;
+
+    hr = CoCreateInstance(__uuidof(NetFwPolicy2), nullptr, CLSCTX_INPROC_SERVER,
+        __uuidof(INetFwPolicy2), (void**)&firewallPolicy);
+    comInitialized = SUCCEEDED(hr);
+    return comInitialized;
+}
+
+std::vector<FirewallRuleInfo> FirewallController::QueryRules(const std::wstring& ruleNamePattern) {
+    std::vector<FirewallRuleInfo> matchedRules;
+    if (!comInitialized || !firewallPolicy) return matchedRules;
+
+    INetFwRules* rules = nullptr;
+    if (FAILED(firewallPolicy->get_Rules(&rules))) return matchedRules;
+
+    IEnumVARIANT* enumerator = nullptr;
+    if (SUCCEEDED(rules->get__NewEnum((IUnknown**)&enumerator))) {
+        VARIANT var;
+        while (enumerator->Next(1, &var, nullptr) == S_OK) {
+            INetFwRule* rule = nullptr;
+            if (SUCCEEDED(V_DISPATCH(&var)->QueryInterface(__uuidof(INetFwRule), (void**)&rule))) {
+                BSTR name;
+                if (SUCCEEDED(rule->get_Name(&name))) {
+                    if (WildcardMatch(ruleNamePattern, name)) {
+                        FirewallRuleInfo info;
+                        info.name = name;
+
+                        BSTR desc, app, service;
+                        rule->get_Description(&desc);
+                        rule->get_ApplicationName(&app);
+                        rule->get_ServiceName(&service);
+                        NET_FW_RULE_DIRECTION direction;
+                        rule->get_Direction(&direction);
+                        info.direction = static_cast<long>(direction);
+                        VARIANT_BOOL enabled;
+                        rule->get_Enabled(&enabled);
+
+                        info.description = desc ? desc : L"";
+                        info.applicationName = app ? app : L"";
+                        info.serviceName = service ? service : L"";
+                        info.enabled = enabled == VARIANT_TRUE;
+
+                        matchedRules.push_back(info);
+                        SysFreeString(desc);
+                        SysFreeString(app);
+                        SysFreeString(service);
+                    }
+                    SysFreeString(name);
+                }
+                rule->Release();
+            }
+            VariantClear(&var);
+        }
+        enumerator->Release();
+    }
+    rules->Release();
+    return matchedRules;
+}
+
+void FirewallController::Shutdown() {
+    if (firewallPolicy)
+    {
+        firewallPolicy->Release();
+        firewallPolicy = nullptr;
+    }
+    if (comInitialized)
+    {
+        CoUninitialize();
+        comInitialized = false;
+    }
+}
+
+
+bool FirewallController::AddFirewallRule(
+    const std::wstring& ruleName,
+    const std::wstring& appPath,
+    FirewallRuleDirection direction,
+    FirewallRuleAction action,
+    const std::wstring& protocol,
+    const std::wstring& localPorts,
+    const std::wstring& remoteAddresses,
+    const std::wstring& description)
+{
+    if (!comInitialized || !firewallPolicy) return false;
+
+    INetFwRule* rule = nullptr;
+    HRESULT hr = CoCreateInstance(
+        __uuidof(NetFwRule),
+        nullptr,
+        CLSCTX_INPROC_SERVER,
+        __uuidof(INetFwRule),
+        (void**)&rule
+    );
+
+    if (FAILED(hr)) return false;
+
+    // 设置规则属性
+    rule->put_Name(_bstr_t(ruleName.c_str()));
+    if (!appPath.empty()) rule->put_ApplicationName(_bstr_t(appPath.c_str()));
+    if (!localPorts.empty()) rule->put_LocalPorts(_bstr_t(localPorts.c_str()));
+    
+    LONG protocolValue = 0;
+    if (protocol == L"TCP") protocolValue = NET_FW_IP_PROTOCOL_TCP;
+    else if (protocol == L"UDP") protocolValue = NET_FW_IP_PROTOCOL_UDP;
+    else protocolValue = NET_FW_IP_PROTOCOL_ANY;  // 默认值
+
+    rule->put_Protocol(protocolValue);  // 传入LONG类型值
+
+
+    rule->put_RemoteAddresses(_bstr_t(remoteAddresses.c_str()));
+    rule->put_Direction(static_cast<NET_FW_RULE_DIRECTION>(direction));
+    rule->put_Action(static_cast<NET_FW_ACTION>(action));
+    rule->put_Enabled(VARIANT_TRUE);
+    if (!description.empty()) rule->put_Description(_bstr_t(description.c_str()));
+
+    // 应用到所有配置文件
+    rule->put_Profiles(NET_FW_PROFILE2_DOMAIN | NET_FW_PROFILE2_PRIVATE | NET_FW_PROFILE2_PUBLIC);
+
+    // 添加规则
+    INetFwRules* rules = nullptr;
+    hr = firewallPolicy->get_Rules(&rules);
+    if (SUCCEEDED(hr)) {
+        hr = rules->Add(rule);
+        rules->Release();
+    }
+
+    rule->Release();
+    if (hr == S_OK) {
+        return true;  // 明确表示成功
+    } else if (hr == E_ACCESSDENIED) {
+        // 处理权限错误
+        return false;
+    }
+    else {
+        return false;
+    }
+}
+
+bool FirewallController::DeleteFirewallRule(const std::wstring& ruleName) {
+    if (!comInitialized || !firewallPolicy) return false;
+
+    INetFwRules* rules = nullptr;
+    HRESULT hr = firewallPolicy->get_Rules(&rules);
+    if (FAILED(hr)) return false;
+
+    hr = rules->Remove(_bstr_t(ruleName.c_str()));
+    rules->Release();
+
+    if (hr == S_OK) {
+        return true;  // 明确表示成功
+    } else if (hr == E_ACCESSDENIED) {
+        // 处理权限错误
+        return false;
+    }
+    else{
+        return false;
+    }
+}
+
+bool FirewallController::CleanupRulesExceptWhitelist(
+    const std::wstring& ruleNamePattern,
+    const std::vector<std::wstring>& whitelistPaths) {
+
+    if (!comInitialized || !firewallPolicy) return false;
+
+    auto matchedRules = QueryRules(ruleNamePattern);
+    if (matchedRules.empty()) return true;
+
+    INetFwRules* rules = nullptr;
+    HRESULT hr = firewallPolicy->get_Rules(&rules);
+    if (FAILED(hr)) return false;
+
+    bool allSuccess = true;
+    for (const auto& ruleInfo : matchedRules) {
+        bool isWhitelisted = false;
+
+        for (const auto& whitelistPath : whitelistPaths) {
+            if (WildcardMatch(whitelistPath, ruleInfo.applicationName)) {
+                isWhitelisted = true;
+                break;
+            }
+        }
+
+        if (!isWhitelisted) {
+            hr = rules->Remove(_bstr_t(ruleInfo.name.c_str()));
+            if (FAILED(hr)) allSuccess = false;
+        }
+    }
+
+    rules->Release();
+    return allSuccess;
+}
+
+
+
+std::wstring charToWstring(const char* szIn) {
+    int length = MultiByteToWideChar(CP_ACP, 0, szIn, -1, NULL, 0);
+    wchar_t* buf = new wchar_t[length];
+    MultiByteToWideChar(CP_ACP, 0, szIn, -1, buf, length);
+    std::wstring result(buf);
+    delete[] buf;
+    return result;
+}
+
+std::string WStringToString(const std::wstring& wstr, unsigned int codepage = CP_ACP) {
+    if (wstr.empty()) return "";
+    int len = WideCharToMultiByte(codepage, 0, wstr.c_str(), (int)wstr.size(), NULL, 0, NULL, NULL);
+    if (len <= 0) return "";
+    std::string result(len, '\0');
+    WideCharToMultiByte(codepage, 0, wstr.c_str(), (int)wstr.size(), &result[0], len, NULL, NULL);
+    return result;
+}
+
+bool sp_AddFirewallRule(const char *ruleName, const char *appPath)
+{
+    int ret = -1;
+    if (FirewallController::Initialize()) {
+
+        std::wstring ruleNameW = charToWstring(ruleName);
+        std::wstring appPathW = charToWstring(appPath);
+        ret = FirewallController::AddFirewallRule(ruleNameW, appPathW,
+         FirewallRuleDirection::Inbound, FirewallRuleAction::Allow) ? 0 : -1;
+
+        FirewallController::Shutdown();
+    }
+    return ret;
+}
+
+std::string getFirstLevelDir(const std::string& path) {
+    size_t start = path.find_first_of("\\/");  // 查找第一个分隔符
+    if (start == std::string::npos) return ""; // 无分隔符时返回空
+    
+    size_t end = path.find_first_of("\\/", start + 1); // 查找第二个分隔符
+    if (end == std::string::npos) end = path.length();
+    
+    return path.substr(start + 1, end - start - 1); // 截取Runxxx
+}
+
+std::string getLastFolderName(std::string path) {
+    // 找到最后一个反斜杠的位置
+    size_t lastSlash = path.find_last_of("\\/");
+    if (lastSlash != std::string::npos) {
+        return path.substr(lastSlash + 1);
+    }
+    return path; // 无斜杠时返回整个字符串
+}
+
+bool sp_AddFirewallRuleByPath(const char *pszPath)
+{
+    bool returnRet = true;
+	//pszPath input path D:\\Runxxx\\version\\7.1.1.1
+    std::string inputPath = std::string(pszPath);
+    while (!inputPath.empty() && (inputPath.back() == '\\' || inputPath.back() == '/')) {
+        inputPath.pop_back();
+    }
+
+	std::string firstLevelDir = getFirstLevelDir(inputPath);
+    std::string lastDir = getLastFolderName(inputPath);
+    std::string header = firstLevelDir + "_" + lastDir;
+	std::map<std::string, std::string> firewallRule;
+	firewallRule[header + "_guardian"] = inputPath + "\\bin\\guardian.exe";
+	firewallRule[header + "_sphost"] = inputPath + "\\bin\\sphost.exe";
+	firewallRule[header + "_spshell"] = inputPath + "\\bin\\spshell.exe";
+	firewallRule[header + "_cefclient"] = inputPath + "\\bin\\Chromium\\cefclient.exe";
+
+    FirewallController::Initialize();
+	for(auto &it : firewallRule)
+	{
+        std::wstring ruleNameW = charToWstring(it.first.c_str());
+        std::wstring appPathW = charToWstring(it.second.c_str());
+        bool ret = FirewallController::AddFirewallRule(ruleNameW, appPathW, FirewallRuleDirection::Inbound, FirewallRuleAction::Allow);
+		DbgWithLink(ret ? LOG_LEVEL_DEBUG : LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)
+			("Add firewall rule %s. firstLevelDir: %s, ruleName: %s, path: %s", ret ? "success" : "failed",
+			 firstLevelDir.c_str(), it.first.c_str(), it.second.c_str());
+		returnRet = returnRet && ret;
+	}
+    FirewallController::Shutdown();
+	return returnRet;
+}
+
+void listFolders(const std::string& dirPath, std::vector<std::string>& folders) {
+    folders.clear();
+    WIN32_FIND_DATA findData;
+    HANDLE hFind = FindFirstFile((dirPath + "\\*").c_str(), &findData);
+    if (hFind == INVALID_HANDLE_VALUE) {
+        return;
+    }
+    do {
+        if (findData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
+            if (strcmp(findData.cFileName, ".") != 0 && strcmp(findData.cFileName, "..") != 0) {
+                folders.push_back(findData.cFileName); // 存入vector
+            }
+        }
+    } while (FindNextFile(hFind, &findData));
+    FindClose(hFind);
+}
+
+using Multimap = std::multimap<std::string, std::string>;
+
+// 比较两个multimap,返回多出和缺少的键值对
+void compareMultimaps(const Multimap& base, const Multimap& target,
+                      std::vector<std::pair<std::string, std::string>>& extra,
+                      std::vector<std::pair<std::string, std::string>>& missing) {
+    // 检查多出的数据:遍历target,不在base中的键值对
+    for (const auto& pair : target) {
+        auto range = base.equal_range(pair.first);
+        auto it = std::find_if(range.first, range.second, [&pair](const auto& p) {
+            return p.second == pair.second;
+        });
+        if (it == range.second) {
+            extra.push_back(pair);
+        }
+    }
+
+    // 检查缺少的数据:遍历base,不在target中的键值对
+    for (const auto& pair : base) {
+        auto range = target.equal_range(pair.first);
+        auto it = std::find_if(range.first, range.second, [&pair](const auto& p) {
+            return p.second == pair.second;
+        });
+        if (it == range.second) {
+            missing.push_back(pair);
+        }
+    }
+}
+
+
+bool sp_CheckAllRules()
+{
+    if (FirewallController::Initialize() == false) 
+    {
+         DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("FirewallController::Initialize failed");
+        return false;
+    }
+
+
+    //get current first level dir and version path
+    char szVersionDir[MAX_PATH] = {};
+	GetModuleFileNameA(NULL, szVersionDir, MAX_PATH);
+	*strrchr(szVersionDir, SPLIT_SLASH) = 0;
+    *strrchr(szVersionDir, SPLIT_SLASH) = 0;
+    std::string currentVerDir = szVersionDir;
+    *strrchr(szVersionDir, SPLIT_SLASH) = 0;
+    std::string versionDir = szVersionDir;
+    while (!versionDir.empty() && (versionDir.back() == '\\' || versionDir.back() == '/')) {
+        versionDir.pop_back();
+    }
+
+    //basic check
+    std::string firstLevelDir = getFirstLevelDir(versionDir);
+    
+    std::vector<std::string> WhiteListDirs;
+    listFolders(versionDir, WhiteListDirs);
+    if (WhiteListDirs.size() == 0)
+    {
+        DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("WhiteListDirs is empty. versionDir: %s", versionDir.c_str());
+        return false;
+    }
+        
+    // firewall ruls I guess
+    Multimap firewallRuleAll;
+    for(auto &it : WhiteListDirs)
+    {
+        std::string lastDir = getLastFolderName(it);
+        std::string header = firstLevelDir + "_" + lastDir;
+        std::string currentVerDir = versionDir + "\\" + it;
+        firewallRuleAll.insert({header + "_guardian", currentVerDir + "\\bin\\guardian.exe"});
+        firewallRuleAll.insert({header + "_sphost", currentVerDir + "\\bin\\sphost.exe"});
+        firewallRuleAll.insert({header + "_spshell", currentVerDir + "\\bin\\spshell.exe"});
+        firewallRuleAll.insert({header + "_cefclient", currentVerDir + "\\bin\\Chromium\\cefclient.exe"});
+    }
+    
+
+
+
+    //query all rules
+    Multimap ruleArr;
+    std::string pattern = firstLevelDir + "_*";
+    std::wstring headerW = charToWstring(pattern.c_str());
+    auto rules = FirewallController::QueryRules(headerW);
+    for (const auto& ruleInfo : rules) {
+        std::string ruleName = WStringToString(ruleInfo.name);
+        std::string appPath = WStringToString(ruleInfo.applicationName);
+        ruleArr.insert(std::make_pair(ruleName, appPath));// can repeated
+    }
+
+    for(auto &it : firewallRuleAll)
+    {
+        DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("guess firewall rule:%s, %s", it.first.c_str(), it.second.c_str());
+    }
+    for(auto &it : ruleArr)
+    {
+        DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("current firewall rule:%s, %s", it.first.c_str(), it.second.c_str());
+    }
+
+    std::vector<std::pair<std::string, std::string>> extra, missing;
+    compareMultimaps(firewallRuleAll, ruleArr, extra, missing);
+
+    for(auto &it : extra)
+    {
+        std::wstring ruleName = charToWstring(it.first.c_str());
+        bool ret = FirewallController::DeleteFirewallRule(ruleName);
+        DbgWithLink(ret ? LOG_LEVEL_DEBUG : LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)
+			("Delete firewall rule %s. ruleName: %s", ret ? "success" : "failed", it.first.c_str());
+    }
+
+    for(auto &it : missing)
+    {
+        std::wstring ruleName = charToWstring(it.first.c_str());
+        std::wstring appPath = charToWstring(it.second.c_str());
+        bool ret = FirewallController::AddFirewallRule(ruleName, appPath, FirewallRuleDirection::Inbound, FirewallRuleAction::Allow);
+        DbgWithLink(ret ? LOG_LEVEL_DEBUG : LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)
+            ("Add firewall rule %s. header: %s, ruleName: %s, path: %s", ret ? "success" : "failed",
+             firstLevelDir.c_str(), it.first.c_str(), it.second.c_str());
+    }
+    
+    FirewallController::Shutdown();
+    return true;
+
+}

+ 78 - 0
Framework/spbase/sp_firewallControl.h

@@ -0,0 +1,78 @@
+#ifndef SP_FIREWALL_CONTROL_H
+#define SP_FIREWALL_CONTROL_H
+
+#include <windows.h>
+#include <netfw.h>
+#include <vector>
+#include <string>
+#include <optional>
+#include "SpBase.h"
+
+// 防火墙规则详细信息结构体
+struct FirewallRuleInfo {
+    std::wstring name;
+    std::wstring description;
+    std::wstring applicationName;
+    std::wstring serviceName;
+    long direction;  // 1=入站, 2=出站
+    bool enabled;
+};
+
+// 添加规则方向枚举
+enum class FirewallRuleDirection {
+    Inbound = NET_FW_RULE_DIR_IN,
+    Outbound = NET_FW_RULE_DIR_OUT
+};
+
+// 添加规则动作枚举
+enum class FirewallRuleAction {
+    Allow = NET_FW_ACTION_ALLOW,
+    Block = NET_FW_ACTION_BLOCK
+};
+
+class FirewallController {
+public:
+    // 初始化COM环境和防火墙策略
+    static bool Initialize();
+
+    // 查询匹配名称的防火墙规则(支持通配符*和?)
+    static std::vector<FirewallRuleInfo> QueryRules(const std::wstring& ruleNamePattern);
+
+    static bool AddFirewallRule(
+        const std::wstring& ruleName,
+        const std::wstring& appPath,
+        FirewallRuleDirection direction,
+        FirewallRuleAction action,
+        const std::wstring& protocol = L"",
+        const std::wstring& localPorts = L"",
+        const std::wstring& remoteAddresses = L"*",
+        const std::wstring& description = L""
+    );
+
+    static bool DeleteFirewallRule(const std::wstring& ruleName);
+    static bool CleanupRulesExceptWhitelist(
+        const std::wstring& ruleNamePattern,
+        const std::vector<std::wstring>& whitelistPaths);
+
+    // 释放资源
+    static void Shutdown();
+
+private:
+    static INetFwPolicy2* firewallPolicy;
+    static bool comInitialized;
+
+    // 通配符匹配函数
+    static bool WildcardMatch(const std::wstring& pattern, const std::wstring& text);
+};
+
+
+/*
+case: VTM upgrade
+may add 4 firewall rules
+*/
+
+SPBASE_API bool sp_AddFirewallRule(const char *ruleName, const char *appPath);
+SPBASE_API bool sp_AddFirewallRuleByPath(const char *pszPath);
+SPBASE_API bool sp_CheckAllRules();
+
+#endif // SP_FIREWALL_CONTROL_H

+ 3 - 0
Framework/spbase/sp_iom.c

@@ -530,7 +530,10 @@ int sp_iom_post(sp_iom_t *iom, int this_svc_id, int epid, int svc_id, int pkt_ty
 	}
 
 	if (rc != 0)
+	{
+		DbgWithLinkForC(LOG_LEVEL_ERROR, LOG_TYPE_SYSTEM, "iom post unexpected, epid:%d, rc:%d", epid, rc);
 		rc = Error_Unexpect;
+	}
 
 	return rc;
 }

+ 5 - 0
Framework/spbase/sp_logwithlink.cpp

@@ -833,6 +833,11 @@ SPBASE_API void setTestLogMode()
     log_producer_set_testLogMode();
 }
 
+SPBASE_API int SendTestLog_loki(const char* app, const char* env, const char* body)
+{
+    return log_producer_sendTestLog_loki(app, env, body);
+}
+
 int changeDbtoNew()
 {
     char tmp[MAX_PATH];

+ 5 - 2
Framework/spshell/spshell.cpp

@@ -25,6 +25,7 @@
 #ifdef RVC_OS_WIN
 #include <io.h>
 #pragma comment(lib, "dbghelp.lib")
+#include "sp_firewallControl.h"
 #else
 #include <unistd.h>
 #include <sys/syscall.h>
@@ -301,9 +302,10 @@ static bool AddFirewallRules()
 
 int AddFireAddFirewallRulesThread(void* param)
 {
-	if (!AddFirewallRules())
+	LOG_FUNCTION();
+	if (!sp_CheckAllRules())
 	{
-		DbgWithLink(LOG_LEVEL_FATAL, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("设置Windows防火墙策略失败!!!");
+		DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("设置Windows防火墙策略失败!!!");
 		Sleep(10000);
 		return -1;
 	}
@@ -746,6 +748,7 @@ std::string generateCenterSettingPath()
 
 int main(int argc, char** argv)
 {
+	//SendTestLog_loki("spshell", "log", "startup");
 	sp_cfg_start_args_t* args = DealWithArgs(argc, argv);
 #if defined(RVC_OS_LINUX)
 	if (args->debug_mode) {

+ 1 - 101
Module/mod_CardIssuerStand/CardIssuerStand.xml

@@ -102,30 +102,6 @@
 		</twoway>
 		<oneway name="SetIssueFlag" overlap="true" method_id="12">			
 		</oneway>
-		<twoway name="ReadEx" overlap="true" method_id="13">
-			<req>
-				<param name="aid" type="string"/>
-				<param name="reserved1" type="string"/>
-				<param name="reserved2" type="string"/>
-			</req>
-			<res>
-				<param name="track1" type="string"/>
-				<param name="track2" type="string"/>
-				<param name="track3" type="string"/>
-				<param name="CDType" type="int"/>
-				<param name="ICType" type="int"/>
-				<param name="CMBType" type="int"/>
-				<param name="ICData" type="string"/>
-				<param name="status" type="int" />
-				<param name="t2Account" type="string" />
-				<param name="t2Region" type="string" />
-				<param name="t2CardSerial" type="string" />
-				<param name="t2CVC" type="string" />
-				<param name="t2ExpireDate" type="string" />
-				<param name="reserved1" type="string"/>
-				<param name="reserved2" type="string"/>
-			</res>
-		</twoway>
 		<twoway name="QueryCardInfo" overlap="true" method_id="14">
 			<req>
 			</req>
@@ -228,16 +204,6 @@
 				<param name="reserved2" type="array_string"/>					
 			</res>			
 		</twoway>
-		<twoway name="OpenSafeLock" overlap="true" method_id="21">
-			<req>
-				<param name="reserved1" type="array_int"/>
-				<param name="reserved2" type="array_string"/>			
-			</req>
-			<res>
-				<param name="reserved1" type="array_int"/>
-				<param name="reserved2" type="array_string"/>					
-			</res>			
-		</twoway>
 		<twoway name="SAMICCommand" overlap="true" method_id="22">
 			<req>
 				<param name="cmdType" type="int"/>
@@ -252,73 +218,7 @@
 				<param name="reserved1" type="array_int"/>
 				<param name="reserved2" type="array_string"/>					
 			</res>			
-		</twoway>
-		<twoway name="QueryPrinterStatus" overlap="true" method_id="23">
-			<req>
-				<param name="param1" type="array_int"/>
-				<param name="param2" type="array_string"/>
-				<param name="reserved1" type="array_int"/>
-				<param name="reserved2" type="array_string"/>			
-			</req>
-			<res>
-				<param name="ret1" type="array_int"/>
-				<param name="ret2" type="array_string"/>
-				<param name="reserved1" type="array_int"/>
-				<param name="reserved2" type="array_string"/>					
-			</res>			
-		</twoway>
-		<twoway name="Print" overlap="true" method_id="24">
-			<req>
-				<param name="data1" type="blob"/>
-				<param name="data2" type="blob"/>
-				<param name="data3" type="blob"/>
-				<param name="data4" type="blob"/>
-				<param name="data5" type="blob"/>
-				<param name="data6" type="blob"/>				
-				<param name="reserved1" type="array_int"/>
-				<param name="reserved2" type="array_string"/>			
-			</req>
-			<res>
-				<param name="reserved1" type="array_int"/>
-				<param name="reserved2" type="array_string"/>					
-			</res>			
-		</twoway>
-		<twoway name="QuerySCIList" overlap="true" method_id="25">
-			<req>			
-				<param name="reserved1" type="array_int"/>
-				<param name="reserved2" type="array_string"/>			
-			</req>
-			<res>
-				<param name="sciNo" type="array_string"/>
-        <param name="arrMateriel" type="array_string"/>
-        <param name="CardGroove" type="array_string"/>
-        <param name="CardBoxNo" type="array_string"/>
-        <param name="PsbCode" type="array_string"/>
-        <param name="PsbName" type="array_string"/>
-        <param name="CardInit" type="array_uint"/>
-        <param name="CardRemains" type="array_uint"/>
-        <param name="CardIssued" type="array_uint"/>
-        <param name="CardMixed" type="array_uint"/>
-        <param name="CardPercent" type="array_uint"/>
-        <param name="Maintainer" type="array_string"/>
-        <param name="MaintainTime" type="array_string"/>
-        <param name="UpdateTime" type="array_string"/>				
-				<param name="reserved1" type="array_int"/>
-				<param name="reserved2" type="array_string"/>					
-			</res>			
-		</twoway>		
-		<twoway name="BindSCI" overlap="true" method_id="26">
-			<req>
-				<param name="type" type="int"/>
-				<param name="sciNo" type="string" />			
-				<param name="reserved1" type="array_int"/>
-				<param name="reserved2" type="array_string"/>			
-			</req>
-			<res>
-				<param name="reserved1" type="array_int"/>
-				<param name="reserved2" type="array_string"/>					
-			</res>			
-		</twoway>
+		</twoway>	
 		<twoway name="PreOnlineOnStore" overlap="true" method_id="27">
 			<req>
 				<param name="account" type="string"/>

+ 24 - 23
Module/mod_CardIssuerStand/CardIssuerStandFSM.cpp

@@ -47,13 +47,13 @@ unsigned long long GetTickCountRVC() {
 #define CARDREADER_INIT_COUNT 3
 #define GET_DEV_STATUS_COUNT 1//oilyang@20180104 change from 3 to 1,no need to test 3 times
 
-const int TIMER1 = 1;
-const int TIMER_EJECT = 2;
-const int INSERT_INTERVAL = 300;
-const int EJECT_INTERVAL = 300;
-const int INSERT_TRY_NUM = 200;
+//const int TIMER1 = 1;
+//const int TIMER_EJECT = 2;
+//const int INSERT_INTERVAL = 300;
+//const int EJECT_INTERVAL = 300;
+//const int INSERT_TRY_NUM = 200;
 const int READ_TRY_NUM = 1;//oiltmp
-const int RESET_TRY_NUM = 3;
+//const int RESET_TRY_NUM = 3;
 const int WAIT_TRY_NUM = 120;
 const int WAIT_INTERVAL = 500;
 const int MAX_RESET_TIMEROUT = 5000;
@@ -255,7 +255,7 @@ unsigned int CCardIssuerFSM::s2_on_event(FSMEvent* pEvt)
 				pGMEE->ctx->Ans.reserved1[i] = 0;
 				pGMEE->ctx->Ans.reserved2[i] = "";
 			}
-			DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_USER)("GetMaterial CardBoxNo (%d):%s, PsbCode:%s, PsbName:%s, CardInit:%d, remains:%d, issued:%d, mixed:%d,",i,
+			DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("GetMaterial CardBoxNo (%d):%s, PsbCode:%s, PsbName:%s, CardInit:%d, remains:%d, issued:%d, mixed:%d,",i,
 				pGMEE->ctx->Ans.CardBoxNo[i].GetData(),
 				pGMEE->ctx->Ans.PsbCode[i].GetData(),
 				pGMEE->ctx->Ans.PsbName[i].GetData(),
@@ -2021,9 +2021,9 @@ int CCardIssuerFSM::IssueCard(SpReqAnsContext<CardIssuerStandService_Issue_Req,
 
 		LogWarn(Severity_Middle, Error_Unexpect, dwTmpErrCode, errMsg.GetData());
 		if (ctx != NULL)
-			ctx->Answer(TransECWithRepeat(Error_DevMedia), dwTmpErrCode);
+			ctx->Answer(Error_DevMedia, dwTmpErrCode);
 		else
-			ctxEx->Answer(TransECWithRepeat(Error_DevMedia), dwTmpErrCode);
+			ctxEx->Answer(Error_DevMedia, dwTmpErrCode);
 		return 2;
 	}
 	ErrorCodeEnum errCode;
@@ -2050,7 +2050,7 @@ int CCardIssuerFSM::IssueCard(SpReqAnsContext<CardIssuerStandService_Issue_Req,
 		CSimpleStringA warnInfo = CSimpleStringA::Format("IssuerCard, hopper%d no more cards to issue. LocalRecord CardremainsEx:%d, Vendor return:NoCard(%d), CardCount(%d)",
 			m_currentHopper, m_remainsEx[m_currentHopper - 1], cis.eIssuerBin[m_currentHopper - 1],  cis.dwIssuerCount[m_currentHopper - 1]);
 		//LogWarn(Severity_Middle, Error_Unexpect, CardIssuer_UserErrorCode_No_More_Card_Issue, warnInfo.GetData());
-		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_USER)(warnInfo.GetData());
+		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)(warnInfo.GetData());
 
 		DWORD dwUsrErrCode = 0;
 		if (cis.eIssuerBin[m_currentHopper - 1] == CI_ISSUEHOPPER_NOTSUPP)
@@ -2169,7 +2169,7 @@ int CCardIssuerFSM::IssueCard(SpReqAnsContext<CardIssuerStandService_Issue_Req,
 		return 1;
 	}
 	else {
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("DevAdapter::MoveCard").setCostTime(l_endTime - l_beginTime).setLogCode("QLR040220320")("IssueCard::MoveCard succ, m_currentHopper:%d", m_currentHopper);
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setAPI("DevAdapter::MoveCard").setCostTime(l_endTime - l_beginTime).setLogCode("QLR040220320")("IssueCard::MoveCard succ, m_currentHopper:%d", m_currentHopper);
 	}
 	//LogWarn(Severity_Low, Error_Succeed, CardIssuer_UserErrorCode_MoveCard_FromHopper, "MoveCard from hopper suc.");
 	m_issuedEx[m_currentHopper - 1]++;
@@ -2218,6 +2218,7 @@ int CCardIssuerFSM::CaptureCard(SpReqAnsContext<CardIssuerStandService_Capture_R
 	eErr = MachineMoveCardBackNotHold();
 	if (eErr == Error_Succeed)
 	{
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setLogCode("QLR040220305")();
 		bool bCaptured = ToRegistCaptureCardInfo();
 		m_currCardNo = m_addCardNo = "";
 	}
@@ -3207,7 +3208,7 @@ int CCardIssuerFSM::PreOnline_Contact(SpReqAnsContext<CardIssuerStandService_Pre
 			CSimpleStringA csErrMsgWithReturnCode = "";
 			GetCardProcessLastErr(eErrCode, ApiName, alarmMsg, csErrMsgWithReturnCode);
 
-			DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_USER)("检测卡片类型时上电失败");
+			DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("检测卡片类型时上电失败");
 			if (!IfUseRf())
 			{
 				if (IsInBusiness())
@@ -3253,7 +3254,7 @@ int CCardIssuerFSM::PreOnline_Contact(SpReqAnsContext<CardIssuerStandService_Pre
 		else if (retDetectAndRead == -2){
 			if (!IfUseRf())
 			{
-				DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_USER)("读取IC数据失败");
+				DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("读取IC数据失败");
 				if (m_issueStatus) {
 					SetErrorAndLog(Error_Unexpect, MEC_DEVAPI_CARDISSUER_ICCommand, "DevAdapter::ICCommand", __FUNCTION__, IsInBusiness(), l_endTime - l_beginTime, "QLR040220320", "");
 				}
@@ -3264,7 +3265,7 @@ int CCardIssuerFSM::PreOnline_Contact(SpReqAnsContext<CardIssuerStandService_Pre
 			}
 			else //非终态,还有非接兜底
 			{
-				DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_USER)("读取IC数据失败");
+				DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("读取IC数据失败");
 				if (m_issueStatus) {
 					SetErrorAndLog(Error_Unexpect, MEC_DEVAPI_CARDISSUER_ICCommand, "DevAdapter::ICCommand", __FUNCTION__, false, l_endTime - l_beginTime, "QLR040220320", "");
 				}
@@ -3275,7 +3276,7 @@ int CCardIssuerFSM::PreOnline_Contact(SpReqAnsContext<CardIssuerStandService_Pre
 		}else if (retDetectAndRead == -3){
 			if (!IfUseRf())
 			{
-				DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_USER)("IC卡建立应用列表失败");
+				DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("IC卡建立应用列表失败");
 				if (m_issueStatus) {
 					SetErrorAndLog(Error_Unexpect, MEC_DEVAPI_CARDISSUER_ICCommand, "DevAdapter::ICCommand", __FUNCTION__, IsInBusiness(), l_endTime - l_beginTime, "QLR040220320", "");
 				}
@@ -3287,7 +3288,7 @@ int CCardIssuerFSM::PreOnline_Contact(SpReqAnsContext<CardIssuerStandService_Pre
 			}
 			else //非终态,还有非接兜底
 			{
-				DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_USER)("IC卡建立应用列表失败");
+				DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("IC卡建立应用列表失败");
 				if (m_issueStatus) {
 					SetErrorAndLog(Error_Unexpect, MEC_DEVAPI_CARDISSUER_ICCommand, "DevAdapter::ICCommand", __FUNCTION__, false, l_endTime - l_beginTime, "QLR040220320", "");
 				}
@@ -3584,7 +3585,7 @@ int CCardIssuerFSM::PreOnline_RF(SpReqAnsContext<CardIssuerStandService_PreOnlin
 			CSimpleStringA csErrMsgWithReturnCode = "";
 			GetCardProcessLastErr(eErrCode, ApiName, alarmMsg, csErrMsgWithReturnCode);
 
-			DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_USER)("检测卡片类型时上电失败(非接)");
+			DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("检测卡片类型时上电失败(非接)");
 
 			if (m_issueStatus)
 			{
@@ -3617,7 +3618,7 @@ int CCardIssuerFSM::PreOnline_RF(SpReqAnsContext<CardIssuerStandService_PreOnlin
 		}
 		else if (retDetectAndRead == -2) {
 
-			DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_USER)("读取IC数据失败");
+			DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("读取IC数据失败");
 			if (m_issueStatus) {
 				SetErrorAndLog(Error_Unexpect, MEC_DEVAPI_CARDISSUER_RFTypeABCommand, "DevAdapter::RFTypeABCommand", __FUNCTION__, IsInBusiness(), l_endTime - l_beginTime, "QLR040220320", "");
 			}
@@ -3629,7 +3630,7 @@ int CCardIssuerFSM::PreOnline_RF(SpReqAnsContext<CardIssuerStandService_PreOnlin
 		}
 		else if (retDetectAndRead == -3) {
 
-			DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_USER)("IC卡建立应用列表失败");
+			DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("IC卡建立应用列表失败");
 			if (m_issueStatus) {
 				SetErrorAndLog(Error_Unexpect, MEC_DEVAPI_CARDISSUER_RFTypeABCommand, "DevAdapter::RFTypeABCommand", __FUNCTION__, IsInBusiness(), l_endTime - l_beginTime, "QLR040220320", "");
 			}
@@ -4236,19 +4237,19 @@ ErrorCodeEnum CCardIssuerFSM::MachineMoveCardFrontGate(bool bInBussiness)
 	if (eMoveFrontGate != Error_Succeed){
 		if (m_bCardFromHopper)
 		{
-			DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_USER)("发卡,卡片吐出失败,请联系厂商检查卡嘴是否没对齐或是否有塞卡");
+			DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("发卡,卡片吐出失败,请联系厂商检查卡嘴是否没对齐或是否有塞卡");
 			SetErrorAndLog(eMoveFrontGate, MEC_DEVAPI_CARDISSUER_CI_MOVECARD_FRONT_GATE, "DevAdapter::MoveCard", __FUNCTION__, bInBussiness, l_endTime - l_beginTime, "QLR040220305", "后端发卡,卡片吐出失败");
 
 		}
 		else
 		{
-			DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_USER)("前端进卡,卡片吐出失败,请确认卡片是否平整");
+			DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("前端进卡,卡片吐出失败,请确认卡片是否平整");
 			SetErrorAndLog(eMoveFrontGate, CardIssuer_UserErrorCode_MoveCardToGate_Failed, "DevAdapter::MoveCard", __FUNCTION__, bInBussiness, l_endTime - l_beginTime, "QLR040220305", "前端进卡,卡片吐出失败");
 		
 		}
 	}
 	else {
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("DevAdapter::MoveCard").setCostTime(l_endTime - l_beginTime)("MachineMoveCardFrontGate::MoveCard");
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setAPI("DevAdapter::MoveCard").setCostTime(l_endTime - l_beginTime).setLogCode("QLR040220305")("MachineMoveCardFrontGate::MoveCard");
 	}
 	
 	return eMoveFrontGate;
@@ -5275,7 +5276,7 @@ int CCardIssuerFSM::SplitDevModelInfo()
 	LOG_FUNCTION();
 	if (strlen(m_devCat.szModel) < 3)
 	{
-		DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("<SplitDevModelInfo>, Wrong szModel:%s", m_devCat.szModel);
+		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("<SplitDevModelInfo>, Wrong szModel:%s", m_devCat.szModel);
 		return -1;
 	}
 	m_csRF = "";

+ 0 - 294
Module/mod_CardIssuerStand/CardIssuerStand_client_g.h

@@ -555,55 +555,6 @@ public:
 		return ret;
 	}
 
-	ErrorCodeEnum ReadEx(CardIssuerStandService_ReadEx_Req &Req, CSmartPointer<IAsynWaitSp> &spAsyncWait, DWORD dwTimeout)
-	{
-		CSmartPointer<IClientSessionFunction> pFunc = GetFunction();
-		CAutoBuffer Buf = SpObject2Buffer(Req);
-		if (m_context.checkEmpty())
-		{
-			m_context.AutoGenerate();
-			DbgToBeidou(m_context, m_pEntityBase != NULL ? m_pEntityBase->GetEntityName() : "")();
-			m_context = m_context.upgradeLink();
-		}
-		auto ret = pFunc->AsyncRequest(CardIssuerStandService_Method_ReadEx, CardIssuerStandService_MethodSignature_ReadEx, Buf, spAsyncWait, m_context, dwTimeout);
-		m_context.clear();
-		return ret;
-	}
-	ErrorCodeEnum ReadEx(CardIssuerStandService_ReadEx_Req &Req, CardIssuerStandService_ReadEx_Ans &Ans, DWORD dwTimeout)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = ReadEx(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-	ErrorCodeEnum ReadEx(CardIssuerStandService_ReadEx_Req &Req, CardIssuerStandService_ReadEx_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError, CSimpleString &str)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = ReadEx(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-	ErrorCodeEnum ReadEx(CardIssuerStandService_ReadEx_Req &Req, CardIssuerStandService_ReadEx_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = ReadEx(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			CSimpleString str;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-
 	ErrorCodeEnum QueryCardInfo(CardIssuerStandService_QueryCardInfo_Req &Req, CSmartPointer<IAsynWaitSp> &spAsyncWait, DWORD dwTimeout)
 	{
 		CSmartPointer<IClientSessionFunction> pFunc = GetFunction();
@@ -947,55 +898,6 @@ public:
 		return Error;
 	}
 
-	ErrorCodeEnum OpenSafeLock(CardIssuerStandService_OpenSafeLock_Req &Req, CSmartPointer<IAsynWaitSp> &spAsyncWait, DWORD dwTimeout)
-	{
-		CSmartPointer<IClientSessionFunction> pFunc = GetFunction();
-		CAutoBuffer Buf = SpObject2Buffer(Req);
-		if (m_context.checkEmpty())
-		{
-			m_context.AutoGenerate();
-			DbgToBeidou(m_context, m_pEntityBase != NULL ? m_pEntityBase->GetEntityName() : "")();
-			m_context = m_context.upgradeLink();
-		}
-		auto ret = pFunc->AsyncRequest(CardIssuerStandService_Method_OpenSafeLock, CardIssuerStandService_MethodSignature_OpenSafeLock, Buf, spAsyncWait, m_context, dwTimeout);
-		m_context.clear();
-		return ret;
-	}
-	ErrorCodeEnum OpenSafeLock(CardIssuerStandService_OpenSafeLock_Req &Req, CardIssuerStandService_OpenSafeLock_Ans &Ans, DWORD dwTimeout)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = OpenSafeLock(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-	ErrorCodeEnum OpenSafeLock(CardIssuerStandService_OpenSafeLock_Req &Req, CardIssuerStandService_OpenSafeLock_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError, CSimpleString &str)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = OpenSafeLock(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-	ErrorCodeEnum OpenSafeLock(CardIssuerStandService_OpenSafeLock_Req &Req, CardIssuerStandService_OpenSafeLock_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = OpenSafeLock(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			CSimpleString str;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-
 	ErrorCodeEnum SAMICCommand(CardIssuerStandService_SAMICCommand_Req &Req, CSmartPointer<IAsynWaitSp> &spAsyncWait, DWORD dwTimeout)
 	{
 		CSmartPointer<IClientSessionFunction> pFunc = GetFunction();
@@ -1045,202 +947,6 @@ public:
 		return Error;
 	}
 
-	ErrorCodeEnum QueryPrinterStatus(CardIssuerStandService_QueryPrinterStatus_Req &Req, CSmartPointer<IAsynWaitSp> &spAsyncWait, DWORD dwTimeout)
-	{
-		CSmartPointer<IClientSessionFunction> pFunc = GetFunction();
-		CAutoBuffer Buf = SpObject2Buffer(Req);
-		if (m_context.checkEmpty())
-		{
-			m_context.AutoGenerate();
-			DbgToBeidou(m_context, m_pEntityBase != NULL ? m_pEntityBase->GetEntityName() : "")();
-			m_context = m_context.upgradeLink();
-		}
-		auto ret = pFunc->AsyncRequest(CardIssuerStandService_Method_QueryPrinterStatus, CardIssuerStandService_MethodSignature_QueryPrinterStatus, Buf, spAsyncWait, m_context, dwTimeout);
-		m_context.clear();
-		return ret;
-	}
-	ErrorCodeEnum QueryPrinterStatus(CardIssuerStandService_QueryPrinterStatus_Req &Req, CardIssuerStandService_QueryPrinterStatus_Ans &Ans, DWORD dwTimeout)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = QueryPrinterStatus(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-	ErrorCodeEnum QueryPrinterStatus(CardIssuerStandService_QueryPrinterStatus_Req &Req, CardIssuerStandService_QueryPrinterStatus_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError, CSimpleString &str)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = QueryPrinterStatus(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-	ErrorCodeEnum QueryPrinterStatus(CardIssuerStandService_QueryPrinterStatus_Req &Req, CardIssuerStandService_QueryPrinterStatus_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = QueryPrinterStatus(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			CSimpleString str;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-
-	ErrorCodeEnum Print(CardIssuerStandService_Print_Req &Req, CSmartPointer<IAsynWaitSp> &spAsyncWait, DWORD dwTimeout)
-	{
-		CSmartPointer<IClientSessionFunction> pFunc = GetFunction();
-		CAutoBuffer Buf = SpObject2Buffer(Req);
-		if (m_context.checkEmpty())
-		{
-			m_context.AutoGenerate();
-			DbgToBeidou(m_context, m_pEntityBase != NULL ? m_pEntityBase->GetEntityName() : "")();
-			m_context = m_context.upgradeLink();
-		}
-		auto ret = pFunc->AsyncRequest(CardIssuerStandService_Method_Print, CardIssuerStandService_MethodSignature_Print, Buf, spAsyncWait, m_context, dwTimeout);
-		m_context.clear();
-		return ret;
-	}
-	ErrorCodeEnum Print(CardIssuerStandService_Print_Req &Req, CardIssuerStandService_Print_Ans &Ans, DWORD dwTimeout)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = Print(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-	ErrorCodeEnum Print(CardIssuerStandService_Print_Req &Req, CardIssuerStandService_Print_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError, CSimpleString &str)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = Print(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-	ErrorCodeEnum Print(CardIssuerStandService_Print_Req &Req, CardIssuerStandService_Print_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = Print(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			CSimpleString str;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-
-	ErrorCodeEnum QuerySCIList(CardIssuerStandService_QuerySCIList_Req &Req, CSmartPointer<IAsynWaitSp> &spAsyncWait, DWORD dwTimeout)
-	{
-		CSmartPointer<IClientSessionFunction> pFunc = GetFunction();
-		CAutoBuffer Buf = SpObject2Buffer(Req);
-		if (m_context.checkEmpty())
-		{
-			m_context.AutoGenerate();
-			DbgToBeidou(m_context, m_pEntityBase != NULL ? m_pEntityBase->GetEntityName() : "")();
-			m_context = m_context.upgradeLink();
-		}
-		auto ret = pFunc->AsyncRequest(CardIssuerStandService_Method_QuerySCIList, CardIssuerStandService_MethodSignature_QuerySCIList, Buf, spAsyncWait, m_context, dwTimeout);
-		m_context.clear();
-		return ret;
-	}
-	ErrorCodeEnum QuerySCIList(CardIssuerStandService_QuerySCIList_Req &Req, CardIssuerStandService_QuerySCIList_Ans &Ans, DWORD dwTimeout)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = QuerySCIList(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-	ErrorCodeEnum QuerySCIList(CardIssuerStandService_QuerySCIList_Req &Req, CardIssuerStandService_QuerySCIList_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError, CSimpleString &str)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = QuerySCIList(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-	ErrorCodeEnum QuerySCIList(CardIssuerStandService_QuerySCIList_Req &Req, CardIssuerStandService_QuerySCIList_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = QuerySCIList(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			CSimpleString str;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-
-	ErrorCodeEnum BindSCI(CardIssuerStandService_BindSCI_Req &Req, CSmartPointer<IAsynWaitSp> &spAsyncWait, DWORD dwTimeout)
-	{
-		CSmartPointer<IClientSessionFunction> pFunc = GetFunction();
-		CAutoBuffer Buf = SpObject2Buffer(Req);
-		if (m_context.checkEmpty())
-		{
-			m_context.AutoGenerate();
-			DbgToBeidou(m_context, m_pEntityBase != NULL ? m_pEntityBase->GetEntityName() : "")();
-			m_context = m_context.upgradeLink();
-		}
-		auto ret = pFunc->AsyncRequest(CardIssuerStandService_Method_BindSCI, CardIssuerStandService_MethodSignature_BindSCI, Buf, spAsyncWait, m_context, dwTimeout);
-		m_context.clear();
-		return ret;
-	}
-	ErrorCodeEnum BindSCI(CardIssuerStandService_BindSCI_Req &Req, CardIssuerStandService_BindSCI_Ans &Ans, DWORD dwTimeout)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = BindSCI(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-	ErrorCodeEnum BindSCI(CardIssuerStandService_BindSCI_Req &Req, CardIssuerStandService_BindSCI_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError, CSimpleString &str)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = BindSCI(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-	ErrorCodeEnum BindSCI(CardIssuerStandService_BindSCI_Req &Req, CardIssuerStandService_BindSCI_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = BindSCI(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			CSimpleString str;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-
 	ErrorCodeEnum PreOnlineOnStore(CardIssuerStandService_PreOnlineOnStore_Req &Req, CSmartPointer<IAsynWaitSp> &spAsyncWait, DWORD dwTimeout)
 	{
 		CSmartPointer<IClientSessionFunction> pFunc = GetFunction();

+ 0 - 202
Module/mod_CardIssuerStand/CardIssuerStand_def_g.h

@@ -25,7 +25,6 @@ namespace CardIssuerStand {
 #define CardIssuerStandService_Method_GetMaterialCount 10
 #define CardIssuerStandService_Method_SetMaterialCount 11
 #define CardIssuerStandService_Method_SetIssueFlag 12
-#define CardIssuerStandService_Method_ReadEx 13
 #define CardIssuerStandService_Method_QueryCardInfo 14
 #define CardIssuerStandService_Method_WriteTrack 15
 #define CardIssuerStandService_Method_GetMaterialCountEx 16
@@ -33,12 +32,7 @@ namespace CardIssuerStand {
 #define CardIssuerStandService_Method_SetSomeFlag 18
 #define CardIssuerStandService_Method_GetSCIInfo 19
 #define CardIssuerStandService_Method_IssueEx 20
-#define CardIssuerStandService_Method_OpenSafeLock 21
 #define CardIssuerStandService_Method_SAMICCommand 22
-#define CardIssuerStandService_Method_QueryPrinterStatus 23
-#define CardIssuerStandService_Method_Print 24
-#define CardIssuerStandService_Method_QuerySCIList 25
-#define CardIssuerStandService_Method_BindSCI 26
 #define CardIssuerStandService_Method_PreOnlineOnStore 27
 #define CardIssuerStandService_Method_NotifyPreonline 28
 #define CardIssuerStandService_Method_QueryCardInfoOnStore 29
@@ -68,7 +62,6 @@ namespace CardIssuerStand {
 #define CardIssuerStandService_MethodSignature_GetMaterialCount -605917749
 #define CardIssuerStandService_MethodSignature_SetMaterialCount 870103115
 #define CardIssuerStandService_MethodSignature_SetIssueFlag 187641303
-#define CardIssuerStandService_MethodSignature_ReadEx -842531343
 #define CardIssuerStandService_MethodSignature_QueryCardInfo 154962579
 #define CardIssuerStandService_MethodSignature_WriteTrack -1424799012
 #define CardIssuerStandService_MethodSignature_GetMaterialCountEx 1356148904
@@ -76,12 +69,7 @@ namespace CardIssuerStand {
 #define CardIssuerStandService_MethodSignature_SetSomeFlag -2033418025
 #define CardIssuerStandService_MethodSignature_GetSCIInfo 1097494981
 #define CardIssuerStandService_MethodSignature_IssueEx 1390328640
-#define CardIssuerStandService_MethodSignature_OpenSafeLock 177980614
 #define CardIssuerStandService_MethodSignature_SAMICCommand 406988293
-#define CardIssuerStandService_MethodSignature_QueryPrinterStatus -890728447
-#define CardIssuerStandService_MethodSignature_Print 2096006675
-#define CardIssuerStandService_MethodSignature_QuerySCIList -1772231453
-#define CardIssuerStandService_MethodSignature_BindSCI -1242011672
 #define CardIssuerStandService_MethodSignature_PreOnlineOnStore 158325869
 #define CardIssuerStandService_MethodSignature_NotifyPreonline -808637659
 #define CardIssuerStandService_MethodSignature_QueryCardInfoOnStore 1217447214
@@ -111,7 +99,6 @@ namespace CardIssuerStand {
 #define CardIssuerStandService_LogCode_GetMaterialCount "QLR040220310"
 #define CardIssuerStandService_LogCode_SetMaterialCount "QLR040220311"
 #define CardIssuerStandService_LogCode_SetIssueFlag "QLR040220312"
-#define CardIssuerStandService_LogCode_ReadEx "QLR040220313"
 #define CardIssuerStandService_LogCode_QueryCardInfo "QLR040220314"
 #define CardIssuerStandService_LogCode_WriteTrack "QLR040220315"
 #define CardIssuerStandService_LogCode_GetMaterialCountEx "QLR040220316"
@@ -119,12 +106,7 @@ namespace CardIssuerStand {
 #define CardIssuerStandService_LogCode_SetSomeFlag "QLR040220318"
 #define CardIssuerStandService_LogCode_GetSCIInfo "QLR040220319"
 #define CardIssuerStandService_LogCode_IssueEx "QLR040220320"
-#define CardIssuerStandService_LogCode_OpenSafeLock "QLR040220321"
 #define CardIssuerStandService_LogCode_SAMICCommand "QLR040220322"
-#define CardIssuerStandService_LogCode_QueryPrinterStatus "QLR040220323"
-#define CardIssuerStandService_LogCode_Print "QLR040220324"
-#define CardIssuerStandService_LogCode_QuerySCIList "QLR040220325"
-#define CardIssuerStandService_LogCode_BindSCI "QLR040220326"
 #define CardIssuerStandService_LogCode_PreOnlineOnStore "QLR040220327"
 #define CardIssuerStandService_LogCode_NotifyPreonline "QLR040220328"
 #define CardIssuerStandService_LogCode_QueryCardInfoOnStore "QLR040220329"
@@ -387,44 +369,6 @@ struct CardIssuerStandService_SetIssueFlag_Info
 
 };
 
-struct CardIssuerStandService_ReadEx_Req
-{
-	CSimpleStringA aid;
-	CSimpleStringA reserved1;
-	CSimpleStringA reserved2;
-
-	void Serialize(SpBuffer &Buf)
-	{
-		auto & buf = Buf & aid & reserved1 & reserved2;
-	}
-
-};
-
-struct CardIssuerStandService_ReadEx_Ans
-{
-	CSimpleStringA track1;
-	CSimpleStringA track2;
-	CSimpleStringA track3;
-	int CDType;
-	int ICType;
-	int CMBType;
-	CSimpleStringA ICData;
-	int status;
-	CSimpleStringA t2Account;
-	CSimpleStringA t2Region;
-	CSimpleStringA t2CardSerial;
-	CSimpleStringA t2CVC;
-	CSimpleStringA t2ExpireDate;
-	CSimpleStringA reserved1;
-	CSimpleStringA reserved2;
-
-	void Serialize(SpBuffer &Buf)
-	{
-		auto & buf = Buf & track1 & track2 & track3 & CDType & ICType & CMBType & ICData & status & t2Account & t2Region & t2CardSerial & t2CVC & t2ExpireDate & reserved1 & reserved2;
-	}
-
-};
-
 struct CardIssuerStandService_QueryCardInfo_Req
 {
 
@@ -623,30 +567,6 @@ struct CardIssuerStandService_IssueEx_Ans
 
 };
 
-struct CardIssuerStandService_OpenSafeLock_Req
-{
-	CAutoArray<int> reserved1;
-	CAutoArray<CSimpleStringA> reserved2;
-
-	void Serialize(SpBuffer &Buf)
-	{
-		auto & buf = Buf & reserved1 & reserved2;
-	}
-
-};
-
-struct CardIssuerStandService_OpenSafeLock_Ans
-{
-	CAutoArray<int> reserved1;
-	CAutoArray<CSimpleStringA> reserved2;
-
-	void Serialize(SpBuffer &Buf)
-	{
-		auto & buf = Buf & reserved1 & reserved2;
-	}
-
-};
-
 struct CardIssuerStandService_SAMICCommand_Req
 {
 	int cmdType;
@@ -676,128 +596,6 @@ struct CardIssuerStandService_SAMICCommand_Ans
 
 };
 
-struct CardIssuerStandService_QueryPrinterStatus_Req
-{
-	CAutoArray<int> param1;
-	CAutoArray<CSimpleStringA> param2;
-	CAutoArray<int> reserved1;
-	CAutoArray<CSimpleStringA> reserved2;
-
-	void Serialize(SpBuffer &Buf)
-	{
-		auto & buf = Buf & param1 & param2 & reserved1 & reserved2;
-	}
-
-};
-
-struct CardIssuerStandService_QueryPrinterStatus_Ans
-{
-	CAutoArray<int> ret1;
-	CAutoArray<CSimpleStringA> ret2;
-	CAutoArray<int> reserved1;
-	CAutoArray<CSimpleStringA> reserved2;
-
-	void Serialize(SpBuffer &Buf)
-	{
-		auto & buf = Buf & ret1 & ret2 & reserved1 & reserved2;
-	}
-
-};
-
-struct CardIssuerStandService_Print_Req
-{
-	CBlob data1;
-	CBlob data2;
-	CBlob data3;
-	CBlob data4;
-	CBlob data5;
-	CBlob data6;
-	CAutoArray<int> reserved1;
-	CAutoArray<CSimpleStringA> reserved2;
-
-	void Serialize(SpBuffer &Buf)
-	{
-		auto & buf = Buf & data1 & data2 & data3 & data4 & data5 & data6 & reserved1 & reserved2;
-	}
-
-};
-
-struct CardIssuerStandService_Print_Ans
-{
-	CAutoArray<int> reserved1;
-	CAutoArray<CSimpleStringA> reserved2;
-
-	void Serialize(SpBuffer &Buf)
-	{
-		auto & buf = Buf & reserved1 & reserved2;
-	}
-
-};
-
-struct CardIssuerStandService_QuerySCIList_Req
-{
-	CAutoArray<int> reserved1;
-	CAutoArray<CSimpleStringA> reserved2;
-
-	void Serialize(SpBuffer &Buf)
-	{
-		auto & buf = Buf & reserved1 & reserved2;
-	}
-
-};
-
-struct CardIssuerStandService_QuerySCIList_Ans
-{
-	CAutoArray<CSimpleStringA> sciNo;
-	CAutoArray<CSimpleStringA> arrMateriel;
-	CAutoArray<CSimpleStringA> CardGroove;
-	CAutoArray<CSimpleStringA> CardBoxNo;
-	CAutoArray<CSimpleStringA> PsbCode;
-	CAutoArray<CSimpleStringA> PsbName;
-	CAutoArray<unsigned int> CardInit;
-	CAutoArray<unsigned int> CardRemains;
-	CAutoArray<unsigned int> CardIssued;
-	CAutoArray<unsigned int> CardMixed;
-	CAutoArray<unsigned int> CardPercent;
-	CAutoArray<CSimpleStringA> Maintainer;
-	CAutoArray<CSimpleStringA> MaintainTime;
-	CAutoArray<CSimpleStringA> UpdateTime;
-	CAutoArray<int> reserved1;
-	CAutoArray<CSimpleStringA> reserved2;
-
-	void Serialize(SpBuffer &Buf)
-	{
-		auto & buf = Buf & sciNo & arrMateriel & CardGroove & CardBoxNo & PsbCode & PsbName & CardInit & CardRemains & CardIssued & CardMixed & CardPercent & Maintainer & MaintainTime & UpdateTime & reserved1 & reserved2;
-	}
-
-};
-
-struct CardIssuerStandService_BindSCI_Req
-{
-	int type;
-	CSimpleStringA sciNo;
-	CAutoArray<int> reserved1;
-	CAutoArray<CSimpleStringA> reserved2;
-
-	void Serialize(SpBuffer &Buf)
-	{
-		auto & buf = Buf & type & sciNo & reserved1 & reserved2;
-	}
-
-};
-
-struct CardIssuerStandService_BindSCI_Ans
-{
-	CAutoArray<int> reserved1;
-	CAutoArray<CSimpleStringA> reserved2;
-
-	void Serialize(SpBuffer &Buf)
-	{
-		auto & buf = Buf & reserved1 & reserved2;
-	}
-
-};
-
 struct CardIssuerStandService_PreOnlineOnStore_Req
 {
 	CSimpleStringA account;

+ 0 - 162
Module/mod_CardIssuerStand/CardIssuerStand_server_g.h

@@ -121,13 +121,6 @@ public:
 				Error = Error_MethodSignatureFailed;
 			}
 			break;
-		case CardIssuerStandService_Method_ReadEx:
-			if (dwSignature == CardIssuerStandService_MethodSignature_ReadEx) {
-				bOverlap = true;
-			} else {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
 		case CardIssuerStandService_Method_QueryCardInfo:
 			if (dwSignature == CardIssuerStandService_MethodSignature_QueryCardInfo) {
 				bOverlap = true;
@@ -177,13 +170,6 @@ public:
 				Error = Error_MethodSignatureFailed;
 			}
 			break;
-		case CardIssuerStandService_Method_OpenSafeLock:
-			if (dwSignature == CardIssuerStandService_MethodSignature_OpenSafeLock) {
-				bOverlap = true;
-			} else {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
 		case CardIssuerStandService_Method_SAMICCommand:
 			if (dwSignature == CardIssuerStandService_MethodSignature_SAMICCommand) {
 				bOverlap = true;
@@ -191,34 +177,6 @@ public:
 				Error = Error_MethodSignatureFailed;
 			}
 			break;
-		case CardIssuerStandService_Method_QueryPrinterStatus:
-			if (dwSignature == CardIssuerStandService_MethodSignature_QueryPrinterStatus) {
-				bOverlap = true;
-			} else {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
-		case CardIssuerStandService_Method_Print:
-			if (dwSignature == CardIssuerStandService_MethodSignature_Print) {
-				bOverlap = true;
-			} else {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
-		case CardIssuerStandService_Method_QuerySCIList:
-			if (dwSignature == CardIssuerStandService_MethodSignature_QuerySCIList) {
-				bOverlap = true;
-			} else {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
-		case CardIssuerStandService_Method_BindSCI:
-			if (dwSignature == CardIssuerStandService_MethodSignature_BindSCI) {
-				bOverlap = true;
-			} else {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
 		case CardIssuerStandService_Method_PreOnlineOnStore:
 			if (dwSignature == CardIssuerStandService_MethodSignature_PreOnlineOnStore) {
 				bOverlap = true;
@@ -400,11 +358,6 @@ public:
 				Error = Error_MethodSignatureFailed;
 			}
 			break;
-		case CardIssuerStandService_Method_ReadEx:
-			if (dwSignature != CardIssuerStandService_MethodSignature_ReadEx) {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
 		case CardIssuerStandService_Method_QueryCardInfo:
 			if (dwSignature != CardIssuerStandService_MethodSignature_QueryCardInfo) {
 				Error = Error_MethodSignatureFailed;
@@ -440,36 +393,11 @@ public:
 				Error = Error_MethodSignatureFailed;
 			}
 			break;
-		case CardIssuerStandService_Method_OpenSafeLock:
-			if (dwSignature != CardIssuerStandService_MethodSignature_OpenSafeLock) {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
 		case CardIssuerStandService_Method_SAMICCommand:
 			if (dwSignature != CardIssuerStandService_MethodSignature_SAMICCommand) {
 				Error = Error_MethodSignatureFailed;
 			}
 			break;
-		case CardIssuerStandService_Method_QueryPrinterStatus:
-			if (dwSignature != CardIssuerStandService_MethodSignature_QueryPrinterStatus) {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
-		case CardIssuerStandService_Method_Print:
-			if (dwSignature != CardIssuerStandService_MethodSignature_Print) {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
-		case CardIssuerStandService_Method_QuerySCIList:
-			if (dwSignature != CardIssuerStandService_MethodSignature_QuerySCIList) {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
-		case CardIssuerStandService_Method_BindSCI:
-			if (dwSignature != CardIssuerStandService_MethodSignature_BindSCI) {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
 		case CardIssuerStandService_Method_PreOnlineOnStore:
 			if (dwSignature != CardIssuerStandService_MethodSignature_PreOnlineOnStore) {
 				Error = Error_MethodSignatureFailed;
@@ -617,11 +545,6 @@ public:
 	/// override by user
 	}
 
-	virtual void Handle_ReadEx(SpReqAnsContext<CardIssuerStandService_ReadEx_Req, CardIssuerStandService_ReadEx_Ans>::Pointer ctx)
-	{
-	/// override by user
-	}
-
 	virtual void Handle_QueryCardInfo(SpReqAnsContext<CardIssuerStandService_QueryCardInfo_Req, CardIssuerStandService_QueryCardInfo_Ans>::Pointer ctx)
 	{
 	/// override by user
@@ -657,36 +580,11 @@ public:
 	/// override by user
 	}
 
-	virtual void Handle_OpenSafeLock(SpReqAnsContext<CardIssuerStandService_OpenSafeLock_Req, CardIssuerStandService_OpenSafeLock_Ans>::Pointer ctx)
-	{
-	/// override by user
-	}
-
 	virtual void Handle_SAMICCommand(SpReqAnsContext<CardIssuerStandService_SAMICCommand_Req, CardIssuerStandService_SAMICCommand_Ans>::Pointer ctx)
 	{
 	/// override by user
 	}
 
-	virtual void Handle_QueryPrinterStatus(SpReqAnsContext<CardIssuerStandService_QueryPrinterStatus_Req, CardIssuerStandService_QueryPrinterStatus_Ans>::Pointer ctx)
-	{
-	/// override by user
-	}
-
-	virtual void Handle_Print(SpReqAnsContext<CardIssuerStandService_Print_Req, CardIssuerStandService_Print_Ans>::Pointer ctx)
-	{
-	/// override by user
-	}
-
-	virtual void Handle_QuerySCIList(SpReqAnsContext<CardIssuerStandService_QuerySCIList_Req, CardIssuerStandService_QuerySCIList_Ans>::Pointer ctx)
-	{
-	/// override by user
-	}
-
-	virtual void Handle_BindSCI(SpReqAnsContext<CardIssuerStandService_BindSCI_Req, CardIssuerStandService_BindSCI_Ans>::Pointer ctx)
-	{
-	/// override by user
-	}
-
 	virtual void Handle_PreOnlineOnStore(SpReqAnsContext<CardIssuerStandService_PreOnlineOnStore_Req, CardIssuerStandService_PreOnlineOnStore_Ans>::Pointer ctx)
 	{
 	/// override by user
@@ -908,16 +806,6 @@ public:
 						Handle_SetIssueFlag(ctx);
 					}
 					break;
-				case CardIssuerStandService_Method_ReadEx:
-					{
-						SpReqAnsContext<CardIssuerStandService_ReadEx_Req,CardIssuerStandService_ReadEx_Ans>::Pointer ctx;
-						ctx.Attach(new SpReqAnsContext<CardIssuerStandService_ReadEx_Req,CardIssuerStandService_ReadEx_Ans>(pTransactionContext));
-						SpBuffer2Object(Buf, ctx->Req);
-						pTransactionContext->GetLinkContext(ctx->link);
-						EntityResource::setLink(ctx->link);
-						Handle_ReadEx(ctx);
-					}
-					break;
 				case CardIssuerStandService_Method_QueryCardInfo:
 					{
 						SpReqAnsContext<CardIssuerStandService_QueryCardInfo_Req,CardIssuerStandService_QueryCardInfo_Ans>::Pointer ctx;
@@ -988,16 +876,6 @@ public:
 						Handle_IssueEx(ctx);
 					}
 					break;
-				case CardIssuerStandService_Method_OpenSafeLock:
-					{
-						SpReqAnsContext<CardIssuerStandService_OpenSafeLock_Req,CardIssuerStandService_OpenSafeLock_Ans>::Pointer ctx;
-						ctx.Attach(new SpReqAnsContext<CardIssuerStandService_OpenSafeLock_Req,CardIssuerStandService_OpenSafeLock_Ans>(pTransactionContext));
-						SpBuffer2Object(Buf, ctx->Req);
-						pTransactionContext->GetLinkContext(ctx->link);
-						EntityResource::setLink(ctx->link);
-						Handle_OpenSafeLock(ctx);
-					}
-					break;
 				case CardIssuerStandService_Method_SAMICCommand:
 					{
 						SpReqAnsContext<CardIssuerStandService_SAMICCommand_Req,CardIssuerStandService_SAMICCommand_Ans>::Pointer ctx;
@@ -1008,46 +886,6 @@ public:
 						Handle_SAMICCommand(ctx);
 					}
 					break;
-				case CardIssuerStandService_Method_QueryPrinterStatus:
-					{
-						SpReqAnsContext<CardIssuerStandService_QueryPrinterStatus_Req,CardIssuerStandService_QueryPrinterStatus_Ans>::Pointer ctx;
-						ctx.Attach(new SpReqAnsContext<CardIssuerStandService_QueryPrinterStatus_Req,CardIssuerStandService_QueryPrinterStatus_Ans>(pTransactionContext));
-						SpBuffer2Object(Buf, ctx->Req);
-						pTransactionContext->GetLinkContext(ctx->link);
-						EntityResource::setLink(ctx->link);
-						Handle_QueryPrinterStatus(ctx);
-					}
-					break;
-				case CardIssuerStandService_Method_Print:
-					{
-						SpReqAnsContext<CardIssuerStandService_Print_Req,CardIssuerStandService_Print_Ans>::Pointer ctx;
-						ctx.Attach(new SpReqAnsContext<CardIssuerStandService_Print_Req,CardIssuerStandService_Print_Ans>(pTransactionContext));
-						SpBuffer2Object(Buf, ctx->Req);
-						pTransactionContext->GetLinkContext(ctx->link);
-						EntityResource::setLink(ctx->link);
-						Handle_Print(ctx);
-					}
-					break;
-				case CardIssuerStandService_Method_QuerySCIList:
-					{
-						SpReqAnsContext<CardIssuerStandService_QuerySCIList_Req,CardIssuerStandService_QuerySCIList_Ans>::Pointer ctx;
-						ctx.Attach(new SpReqAnsContext<CardIssuerStandService_QuerySCIList_Req,CardIssuerStandService_QuerySCIList_Ans>(pTransactionContext));
-						SpBuffer2Object(Buf, ctx->Req);
-						pTransactionContext->GetLinkContext(ctx->link);
-						EntityResource::setLink(ctx->link);
-						Handle_QuerySCIList(ctx);
-					}
-					break;
-				case CardIssuerStandService_Method_BindSCI:
-					{
-						SpReqAnsContext<CardIssuerStandService_BindSCI_Req,CardIssuerStandService_BindSCI_Ans>::Pointer ctx;
-						ctx.Attach(new SpReqAnsContext<CardIssuerStandService_BindSCI_Req,CardIssuerStandService_BindSCI_Ans>(pTransactionContext));
-						SpBuffer2Object(Buf, ctx->Req);
-						pTransactionContext->GetLinkContext(ctx->link);
-						EntityResource::setLink(ctx->link);
-						Handle_BindSCI(ctx);
-					}
-					break;
 				case CardIssuerStandService_Method_PreOnlineOnStore:
 					{
 						SpReqAnsContext<CardIssuerStandService_PreOnlineOnStore_Req,CardIssuerStandService_PreOnlineOnStore_Ans>::Pointer ctx;

+ 4 - 1
Module/mod_CardIssuerStand/mod_cardissuerStand.h

@@ -295,7 +295,7 @@ public:
 	{
 		LOG_FUNCTION();
 		ctx->Ans.state = m_fsm.GetDevState();
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("GetDevInfo state=%d", ctx->Ans.state);
+		
 
 		if (m_fsm.GetDevInitingFlag()) {
 			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("GetDevInfo device is opening,state return 0");
@@ -310,6 +310,9 @@ public:
 				ctx->Answer(Error_DevNotAvailable, CardIssuer_UserErrorCode_DevOpen_Failed);
 			}
 			else {
+				if (ctx->Ans.state != DEVICE_STATUS_NORMAL) {
+					DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("GetDevInfo state=%d", ctx->Ans.state);
+				}
 				ctx->Answer(Error_Succeed);
 			}
 		}

+ 15 - 275
Module/mod_CardReadAdapter/CardReadAdapterFSM.cpp

@@ -2195,49 +2195,8 @@ int CCardReadAdapterFSM::GetSCIInfo(SpReqAnsContext<CardReadAdapterService_GetSC
 int CCardReadAdapterFSM::OpenSafeLock(SpReqAnsContext<CardReadAdapterService_OpenSafeLock_Req, CardReadAdapterService_OpenSafeLock_Ans>::Pointer ctx)
 {
 	LOG_FUNCTION();
-	if (IsCardIssuerSessionOK())
-	{
-		if (!IsCardIssuerStore()) {
-			ErrorCodeEnum eErr = Error_Unexpect;
-			CardIssuerStandService_OpenSafeLock_Req req;
-			CardIssuerStandService_OpenSafeLock_Ans ans;
-			req.reserved1.Copy(ctx->Req.reserved1);
-			req.reserved2.Copy(ctx->Req.reserved2);
-			eErr = (*m_pCardIssuer)(EntityResource::getLink().upgradeLink())->OpenSafeLock(req, ans, 15000);
-			if (eErr == Error_Succeed)
-			{
-				ctx->Ans.reserved1.Copy(ans.reserved1);
-				ctx->Ans.reserved2.Copy(ans.reserved2);
-			}
-			else {
-				DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("OpenSafeLock, CardIssuerStand OpenSafeLock failed return:%d", eErr);
-			}
-			ctx->Answer(eErr);
-		}
-		else {
-			ErrorCodeEnum eErr = Error_Unexpect;
-			CardIssuerStoreService_OpenSafeLock_Req req;
-			CardIssuerStoreService_OpenSafeLock_Ans ans;
-			req.reserved1.Copy(ctx->Req.reserved1);
-			req.reserved2.Copy(ctx->Req.reserved2);
-			eErr = (*m_pCardIssuerStore)(EntityResource::getLink().upgradeLink())->OpenSafeLock(req, ans, 15000);
-			if (eErr == Error_Succeed)
-			{
-				ctx->Ans.reserved1.Copy(ans.reserved1);
-				ctx->Ans.reserved2.Copy(ans.reserved2);
-			}
-			else {
-				DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("OpenSafeLock, CardIssuerStore OpenSafeLock failed return:%d", eErr);
-			}
-			ctx->Answer(eErr);
-		}
-
-	}
-	else
-	{
-		DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("OpenSafeLock is err, session is not ok");
-		ctx->Answer(Error_Unexpect);
-	}
+	DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("OpenSafeLock is not deal with");
+	ctx->Answer(Error_Unexpect);
 	return 0;
 }
 int CCardReadAdapterFSM::MagTransferInit(SpReqAnsContext<CardReadAdapterService_MagTransferInit_Req, CardReadAdapterService_MagTransferInit_Ans>::Pointer ctx)
@@ -2340,254 +2299,35 @@ int CCardReadAdapterFSM::SAMICCommand(SpReqAnsContext<CardReadAdapterService_SAM
 int CCardReadAdapterFSM::QueryPrinterStatus(SpReqAnsContext<CardReadAdapterService_QueryPrinterStatus_Req, CardReadAdapterService_QueryPrinterStatus_Ans>::Pointer ctx)
 {
 	LOG_FUNCTION();
-	if (IsCardIssuerSessionOK())
-	{
-		if (!IsCardIssuerStore()) {
-			ErrorCodeEnum eErr = Error_Unexpect;
-			CardIssuerStandService_QueryPrinterStatus_Req req;
-			CardIssuerStandService_QueryPrinterStatus_Ans ans;
-			req.param1.Copy(ctx->Req.param1);
-			req.param2.Copy(ctx->Req.param2);
-			req.reserved1.Copy(ctx->Req.reserved1);
-			req.reserved2.Copy(ctx->Req.reserved2);
-			eErr = (*m_pCardIssuer)(EntityResource::getLink().upgradeLink())->QueryPrinterStatus(req, ans, 20000);
-			if (eErr == Error_Succeed)
-			{
-				ctx->Ans.ret1.Copy(ans.ret1);
-				ctx->Ans.ret2.Copy(ans.ret2);
-				ctx->Ans.reserved1.Copy(ans.reserved1);
-				ctx->Ans.reserved2.Copy(ans.reserved2);
-			}
-			else {
-				DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("QueryPrinterStatus, CardIssuerStand QueryPrinterStatus failed return:%d", eErr);
-			}
-			ctx->Answer(eErr);
-			return 0;
-		}
-		else {
-			ErrorCodeEnum eErr = Error_Unexpect;
-			CardIssuerStoreService_QueryPrinterStatus_Req req;
-			CardIssuerStoreService_QueryPrinterStatus_Ans ans;
-			req.param1.Copy(ctx->Req.param1);
-			req.param2.Copy(ctx->Req.param2);
-			req.reserved1.Copy(ctx->Req.reserved1);
-			req.reserved2.Copy(ctx->Req.reserved2);
-			eErr = (*m_pCardIssuerStore)(EntityResource::getLink().upgradeLink())->QueryPrinterStatus(req, ans, 20000);
-			if (eErr == Error_Succeed)
-			{
-				ctx->Ans.ret1.Copy(ans.ret1);
-				ctx->Ans.ret2.Copy(ans.ret2);
-				ctx->Ans.reserved1.Copy(ans.reserved1);
-				ctx->Ans.reserved2.Copy(ans.reserved2);
-			}
-			else {
-				DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("QueryPrinterStatus, CardIssuerStore QueryPrinterStatus failed return:%d", eErr);
-			}
-			ctx->Answer(eErr);
-			return 0;
-		}
-	}
-	else
-	{
-		DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("QueryPrinterStatus is err, session is not ok");
-		ctx->Answer(Error_Param);
-		return 1;
-	}
+	DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("QueryPrinterStatus is not deal with");
+	ctx->Answer(Error_Unexpect);
+	return 0;
 }
 int CCardReadAdapterFSM::Print(SpReqAnsContext<CardReadAdapterService_Print_Req, CardReadAdapterService_Print_Ans>::Pointer ctx)
 {
 	LOG_FUNCTION();
-	if (IsCardIssuerSessionOK())
-	{
-		if (!IsCardIssuerStore()) {
-			ErrorCodeEnum eErr = Error_Unexpect;
-			CardIssuerStandService_Print_Req req;
-			CardIssuerStandService_Print_Ans ans;
-			req.data1 = ctx->Req.data1;
-			req.data2 = ctx->Req.data2;
-			req.data3 = ctx->Req.data3;
-			req.data4 = ctx->Req.data4;
-			req.data5 = ctx->Req.data5;
-			req.data6 = ctx->Req.data6;
-			req.reserved1.Copy(ctx->Req.reserved1);
-			req.reserved2.Copy(ctx->Req.reserved2);
-			eErr = (*m_pCardIssuer)(EntityResource::getLink().upgradeLink())->Print(req, ans, 50000);
-			if (eErr == Error_Succeed)
-			{
-				ctx->Ans.reserved1.Copy(ans.reserved1);
-				ctx->Ans.reserved2.Copy(ans.reserved2);
-			}
-			else {
-				DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("Print, CardIssuerStand Print failed return:%d", eErr);
-			}
-			ctx->Answer(eErr);
-			return 0;
-		}
-		else {
-			ErrorCodeEnum eErr = Error_Unexpect;
-			CardIssuerStoreService_Print_Req req;
-			CardIssuerStoreService_Print_Ans ans;
-			req.data1 = ctx->Req.data1;
-			req.data2 = ctx->Req.data2;
-			req.data3 = ctx->Req.data3;
-			req.data4 = ctx->Req.data4;
-			req.data5 = ctx->Req.data5;
-			req.data6 = ctx->Req.data6;
-			req.reserved1.Copy(ctx->Req.reserved1);
-			req.reserved2.Copy(ctx->Req.reserved2);
-			eErr = (*m_pCardIssuerStore)(EntityResource::getLink().upgradeLink())->Print(req, ans, 50000);
-			if (eErr == Error_Succeed)
-			{
-				ctx->Ans.reserved1.Copy(ans.reserved1);
-				ctx->Ans.reserved2.Copy(ans.reserved2);
-			}
-			else {
-				DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("Print, CardIssuerStore Print failed return:%d", eErr);
-			}
-			ctx->Answer(eErr);
-			return 0;
-		}
+	DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("Print is not deal with");
+	ctx->Answer(Error_Unexpect);
+	return 0;
 
-	}
-	else
-	{
-		DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("Print is err, session is not ok");
-		ctx->Answer(Error_Param);
-		return 1;
-	}
 }
 int CCardReadAdapterFSM::QuerySCIList(SpReqAnsContext<CardReadAdapterService_QuerySCIList_Req, CardReadAdapterService_QuerySCIList_Ans>::Pointer ctx)
 {
 	LOG_FUNCTION();
 	DWORD dwUsrErrCode = 0;
-	if (IsCardIssuerSessionOK())
-	{
-		if (!IsCardIssuerStore()) {
-			ErrorCodeEnum eErr = Error_Unexpect;
-			CardIssuerStandService_QuerySCIList_Req req;
-			CardIssuerStandService_QuerySCIList_Ans ans;
-			req.reserved1.Copy(ctx->Req.reserved1);
-			req.reserved2.Copy(ctx->Req.reserved2);
-			eErr = (*m_pCardIssuer)(EntityResource::getLink().upgradeLink())->QuerySCIList(req, ans, 50000, dwUsrErrCode);
-			if (eErr == Error_Succeed)
-			{
-				ctx->Ans.sciNo.Copy(ans.sciNo);
-				ctx->Ans.arrMateriel.Copy(ans.arrMateriel);
-				ctx->Ans.CardGroove.Copy(ans.CardGroove);
-				ctx->Ans.CardBoxNo.Copy(ans.CardBoxNo);
-				ctx->Ans.PsbCode.Copy(ans.PsbCode);
-				ctx->Ans.PsbName.Copy(ans.PsbName);
-				ctx->Ans.CardInit.Copy(ans.CardInit);
-				ctx->Ans.CardRemains.Copy(ans.CardRemains);
-				ctx->Ans.CardIssued.Copy(ans.CardIssued);
-				ctx->Ans.CardMixed.Copy(ans.CardMixed);
-				ctx->Ans.CardPercent.Copy(ans.CardPercent);
-				ctx->Ans.Maintainer.Copy(ans.Maintainer);
-				ctx->Ans.MaintainTime.Copy(ans.MaintainTime);
-				ctx->Ans.UpdateTime.Copy(ans.UpdateTime);
-				ctx->Ans.reserved1.Copy(ans.reserved1);
-				ctx->Ans.reserved2.Copy(ans.reserved2);
-			}
-			else {
-				DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("QuerySCIList, CardIssuerStand QuerySCIList failed return:%d", eErr);
-			}
-			ctx->Answer(eErr, dwUsrErrCode);
-			return 0;
-		}
-		else {
-			ErrorCodeEnum eErr = Error_Unexpect;
-			CardIssuerStoreService_QuerySCIList_Req req;
-			CardIssuerStoreService_QuerySCIList_Ans ans;
-			req.reserved1.Copy(ctx->Req.reserved1);
-			req.reserved2.Copy(ctx->Req.reserved2);
-			eErr = (*m_pCardIssuerStore)(EntityResource::getLink().upgradeLink())->QuerySCIList(req, ans, 50000, dwUsrErrCode);
-			if (eErr == Error_Succeed)
-			{
-				ctx->Ans.sciNo.Copy(ans.sciNo);
-				ctx->Ans.arrMateriel.Copy(ans.arrMateriel);
-				ctx->Ans.CardGroove.Copy(ans.CardGroove);
-				ctx->Ans.CardBoxNo.Copy(ans.CardBoxNo);
-				ctx->Ans.PsbCode.Copy(ans.PsbCode);
-				ctx->Ans.PsbName.Copy(ans.PsbName);
-				ctx->Ans.CardInit.Copy(ans.CardInit);
-				ctx->Ans.CardRemains.Copy(ans.CardRemains);
-				ctx->Ans.CardIssued.Copy(ans.CardIssued);
-				ctx->Ans.CardMixed.Copy(ans.CardMixed);
-				ctx->Ans.CardPercent.Copy(ans.CardPercent);
-				ctx->Ans.Maintainer.Copy(ans.Maintainer);
-				ctx->Ans.MaintainTime.Copy(ans.MaintainTime);
-				ctx->Ans.UpdateTime.Copy(ans.UpdateTime);
-				ctx->Ans.reserved1.Copy(ans.reserved1);
-				ctx->Ans.reserved2.Copy(ans.reserved2);
-			}
-			else {
-				DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("QuerySCIList, CardIssuerStore QuerySCIList failed return:%d", eErr);
-			}
-			ctx->Answer(eErr, dwUsrErrCode);
-			return 0;
-		}
-	}
-	else
-	{
-		DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("QuerySCIList is err, session is not ok");
-		ctx->Answer(Error_Param);
-		return 1;
-	}
+	DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("QuerySCIList is not deal with");
+	ctx->Answer(Error_Unexpect);
+	return 0;
+
 }
 int CCardReadAdapterFSM::BindSCI(SpReqAnsContext<CardReadAdapterService_BindSCI_Req, CardReadAdapterService_BindSCI_Ans>::Pointer ctx)
 {
 	LOG_FUNCTION();
 	DWORD dwUsrErrCode = 0;
-	if (IsCardIssuerSessionOK())
-	{
-		if (!IsCardIssuerStore()) {
-			ErrorCodeEnum eErr = Error_Unexpect;
-			CardIssuerStandService_BindSCI_Req req;
-			CardIssuerStandService_BindSCI_Ans ans;
-			req.type = ctx->Req.type;
-			req.sciNo = ctx->Req.sciNo;
-			req.reserved1.Copy(ctx->Req.reserved1);
-			req.reserved2.Copy(ctx->Req.reserved2);
-			eErr = (*m_pCardIssuer)(EntityResource::getLink().upgradeLink())->BindSCI(req, ans, 50000, dwUsrErrCode);
-			if (eErr == Error_Succeed)
-			{
-				ctx->Ans.reserved1.Copy(ans.reserved1);
-				ctx->Ans.reserved2.Copy(ans.reserved2);
-			}
-			else {
-				DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("BindSCI, CardIssuerStand BindSCI failed return:%d", eErr);
-			}
-			ctx->Answer(eErr, dwUsrErrCode);
-			return 0;
-		}
-		else {
-			ErrorCodeEnum eErr = Error_Unexpect;
-			CardIssuerStoreService_BindSCI_Req req;
-			CardIssuerStoreService_BindSCI_Ans ans;
-			req.type = ctx->Req.type;
-			req.sciNo = ctx->Req.sciNo;
-			req.reserved1.Copy(ctx->Req.reserved1);
-			req.reserved2.Copy(ctx->Req.reserved2);
-			eErr = (*m_pCardIssuerStore)(EntityResource::getLink().upgradeLink())->BindSCI(req, ans, 50000, dwUsrErrCode);
-			if (eErr == Error_Succeed)
-			{
-				ctx->Ans.reserved1.Copy(ans.reserved1);
-				ctx->Ans.reserved2.Copy(ans.reserved2);
-			}
-			else {
-				DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("BindSCI, CardIssuerStore BindSCI failed return:%d", eErr);
-			}
-			ctx->Answer(eErr, dwUsrErrCode);
-			return 0;
-		}
+	DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("BindSCI is not deal with");
+	ctx->Answer(Error_Unexpect);
+	return 0;
 
-	}
-	else
-	{
-		DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("BindSCI is err, session is not ok");
-		ctx->Answer(Error_Param);
-		return 1;
-	}
 }
 int CCardReadAdapterFSM::PreOnlineOnStore(SpReqAnsContext<CardReadAdapterService_PreOnlineOnStore_Req, CardReadAdapterService_PreOnlineOnStore_Ans>::Pointer ctx)
 {

+ 3 - 3
Module/mod_ContactlessCard/ContactlessFSM.cpp

@@ -15,14 +15,14 @@
 #endif //RVC_OS_WIN
 
 
-const int GET_DEV_STATUS_COUNT = 3;
+const int GET_DEV_STATUS_COUNT = 1;
 const int MAX_RESET_TIMES_PERIOD = 1000;//oiltest configure to ini file?
 const int MAX_RESET_TIMEROUT = 5000;
 const int WAIT_TRY_NUM = 120;
 const int WAIT_INTERVAL = 500;
 const int ACCEPT_TRY_INTERVAL = 500;
 const int ACCEPT_TRY_NUM = 110; // 500*110=55 seconds
-const int READ_TRY_NUM = 1;//oiltest
+//const int READ_TRY_NUM = 1;//oiltest
 const int INIT_TRY_NUM = 1;
 
 class CContactlessCardEntity;
@@ -1479,7 +1479,7 @@ int CContactlessCardFSM::QueryCardInfo(SpReqAnsContext<ContactlessCardService_Qu
 	if (eErr != Error_Succeed)
 	{
 		SetErrorAndLog(eErr, MEC_DEVAPI_RF_GetDevStatus, "DevAdapter::GetDevStatus", __FUNCTION__, false, l_endTime - l_beginTime, "", "");
-		ctx->Answer(TransECWithRepeat(Error_Unexpect));
+		ctx->Answer(Error_Unexpect);
 		return 1;
 	}
 	int ret = 0;

+ 4 - 1
Module/mod_ContactlessCard/mod_ContactlessCard.h

@@ -151,7 +151,7 @@ public:
 	{
 		LOG_FUNCTION();
 		ctx->Ans.state = m_fsm.GetDevState();
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER)("GetDevInfo %d", ctx->Ans.state);
+		
 
 		if (m_fsm.GetDevInitingFlag()) {
 			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("GetDevInfo device is opening,state return 0");
@@ -165,6 +165,9 @@ public:
 				ctx->Answer(Error_DevNotAvailable, ContactlessCard_UserErrorCode_DevOpen_Failed);
 			}
 			else {
+				if (ctx->Ans.state != DEVICE_STATUS_NORMAL) {
+					DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("GetDevInfo %d", ctx->Ans.state);
+				}
 				ctx->Answer(Error_Succeed);
 			}
 		}

+ 51 - 0
Module/mod_UpgradeMgr/UpgradeTaskFSM.cpp

@@ -1675,6 +1675,10 @@ namespace Task
 				failStatus = m_fsm->ExecDepInstall(errMsg);
 			}
 			if(failStatus == 1){
+				//安装成功,执行防火墙设置
+				if (!m_fsm->m_stopSetFirewall) {
+					m_fsm->SetNewVersionPathToFirewall();
+				}
 				DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("======end ExecInstall:succ======");
 				isInstallSucc =true;
 			}else{
@@ -2802,6 +2806,10 @@ ErrorCodeEnum CUpgradeTaskFSM::UpgradeToNewVersion()
 			return Error_Unexpect;
 		}else{
 			fflush(fp);
+			int CommitRet = _commit(_fileno(fp));
+			if (CommitRet != 0) {
+				LogWarn(Severity_Middle, Error_Exception, ERR_TASK_UPDATE_ACTIVE_FAIL, CSimpleStringA::Format("UpgradeToNewVersion fail, commit write active.txt fail, err=%d", (int)GetLastError()).GetData());
+			}
 			fclose(fp);
 			if (ExistsFileA(strBackupActiveFile.GetData())) {
 				RemoveFileA(strBackupActiveFile.GetData());
@@ -2854,6 +2862,10 @@ ErrorCodeEnum CUpgradeTaskFSM::UpgradeToNewVersion()
 			return Error_Unexpect;
 		}else{
 			fflush(fp);
+			int CommitRet = fsync(fileno(fp));
+			if (CommitRet != 0) {
+				LogWarn(Severity_Middle, Error_Exception, ERR_TASK_UPDATE_ACTIVE_FAIL, CSimpleStringA::Format("UpgradeToNewVersion fail, commit write active.txt fail, err=%d", errno).GetData());
+			}
 			fclose(fp);
 			if (ExistsFileA(strBackupActiveFile.GetData())) {
 				RemoveFileA(strBackupActiveFile.GetData());
@@ -4019,6 +4031,23 @@ ErrorCodeEnum CUpgradeTaskFSM::loadCenterCfgInfo()
 			LogWarn(Severity_Middle, rc, ERR_TASK_READ_INI_FAIL,  "get CenterSetting.ini StartFlag error");
 			return rc;
 		} 
+
+		int stopSetFirewallInt = 0;
+		rc = spConfig->ReadConfigValueInt("UpgradeManager", "stopSetFirewall", stopSetFirewallInt);
+		if (rc == Error_Succeed) {
+			if (stopSetFirewallInt == 0) {
+				m_stopSetFirewall = false;
+			}
+			else {
+				m_stopSetFirewall = true;
+			}
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("init read CenterSetting.ini stopSetFirewall=%d", stopSetFirewallInt);
+		}
+		else {
+			LogWarn(Severity_Middle, rc, ERR_TASK_READ_INI_FAIL, "get CenterSetting.ini stopSetFirewall error");
+			return rc;
+		}
+
 		int queryNewTaskInterval = 0;
 		rc = spConfig->ReadConfigValueInt("UpgradeManager", "queryNewTaskInterval", queryNewTaskInterval);
 		if (rc == Error_Succeed) {
@@ -5628,6 +5657,28 @@ CSimpleStringA CUpgradeTaskFSM::getAlarmCurrVersion()
 	return m_currentVersion.ToString();
 }
 
+ErrorCodeEnum CUpgradeTaskFSM::SetNewVersionPathToFirewall()
+{
+	if (m_TempDepUpgradeFlag) {
+		return Error_Succeed;//适配器升级,不设置
+	}
+	if (isTerminalInstall()) {
+		return Error_Succeed;//安装新设备,不设置
+	}
+	if (!m_currentTask.NewVersion.IsNullOrEmpty()) {
+		//升级应用版本
+
+		CSimpleStringA rootVerPath;
+		ErrorCodeEnum rc = m_pEntity->GetFunction()->GetPath("RootVer", rootVerPath);//获取version根路径
+		if (rc != Error_Succeed) {
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("SetNewVersionPathToFirewall fail , get RootVer path is fail");
+			return Error_Bug;
+		}
+		CSimpleStringA strNewVerPath = CSimpleStringA::Format("%s" SPLIT_SLASH_STR "%s", rootVerPath.GetData(), m_currentTask.NewVersion.GetData());
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("SetNewVersionPathToFirewall path = %s", strNewVerPath.GetData());
+		return m_pEntity->GetFunction()->SetNewPathToFirewall(strNewVerPath);
+	}
+}
 
 ErrorCodeEnum CUpgradeTaskFSM::SM3FileToStr(CSimpleStringA strFilePath, CSimpleStringA &strSM3,bool isSub)
 {

+ 3 - 1
Module/mod_UpgradeMgr/UpgradeTaskFSM.h

@@ -446,7 +446,8 @@ public:
 
 	CSimpleStringA getAlarmCurrVersion();
 
-
+	//升级时添加防火墙策略
+	ErrorCodeEnum SetNewVersionPathToFirewall();
 
 	bool isWork();
 	bool isAuthSucc();
@@ -544,6 +545,7 @@ public:
 	int m_newEachDownloadLen;//新的每次下载数据长度阈值(k)
 	bool m_PrintHttpLog;  //是否打印通讯日志
 	bool m_startFlag; //升级实体启动标志位,默认是不开,
+	bool m_stopSetFirewall;//是否停止设置防火墙路径,默认是不停止
 	HashScanSet m_hashScanSet;//扫描文件hash设置
 
 	bool m_isSM3HashSucc;//hash是否计算成功

+ 4 - 4
Module/mod_cardissuerstore/CMakeLists.txt

@@ -1,10 +1,10 @@
 define_module("CardIssuerStore")
 
 set(${MODULE_PREFIX}_SRCS
-	mod_cardissuer.cpp
-	mod_cardissuer.h
-	CardIssuerFSM.cpp
-	CardIssuerFSM.h
+	mod_cardissuerStore.cpp
+	mod_cardissuerStore.h
+	CardIssuerStoreFSM.cpp
+	CardIssuerStoreFSM.h
 	CardIssuerStore_UserErrorCode.h
 	${DevHeadPath}/CardAssist.cpp)
 list(APPEND ${MODULE_PREFIX}_SRCS)

+ 0 - 100
Module/mod_cardissuerstore/CardIssuerStore.xml

@@ -102,30 +102,6 @@
 		</twoway>
 		<oneway name="SetIssueFlag" overlap="true" method_id="12">			
 		</oneway>
-		<twoway name="ReadEx" overlap="true" method_id="13">
-			<req>
-				<param name="aid" type="string"/>
-				<param name="reserved1" type="string"/>
-				<param name="reserved2" type="string"/>
-			</req>
-			<res>
-				<param name="track1" type="string"/>
-				<param name="track2" type="string"/>
-				<param name="track3" type="string"/>
-				<param name="CDType" type="int"/>
-				<param name="ICType" type="int"/>
-				<param name="CMBType" type="int"/>
-				<param name="ICData" type="string"/>
-				<param name="status" type="int" />
-				<param name="t2Account" type="string" />
-				<param name="t2Region" type="string" />
-				<param name="t2CardSerial" type="string" />
-				<param name="t2CVC" type="string" />
-				<param name="t2ExpireDate" type="string" />
-				<param name="reserved1" type="string"/>
-				<param name="reserved2" type="string"/>
-			</res>
-		</twoway>
 		<twoway name="QueryCardInfo" overlap="true" method_id="14">
 			<req>
 			</req>
@@ -228,16 +204,6 @@
 				<param name="reserved2" type="array_string"/>					
 			</res>			
 		</twoway>
-		<twoway name="OpenSafeLock" overlap="true" method_id="21">
-			<req>
-				<param name="reserved1" type="array_int"/>
-				<param name="reserved2" type="array_string"/>			
-			</req>
-			<res>
-				<param name="reserved1" type="array_int"/>
-				<param name="reserved2" type="array_string"/>					
-			</res>			
-		</twoway>
 		<twoway name="SAMICCommand" overlap="true" method_id="22">
 			<req>
 				<param name="cmdType" type="int"/>
@@ -253,72 +219,6 @@
 				<param name="reserved2" type="array_string"/>					
 			</res>			
 		</twoway>
-		<twoway name="QueryPrinterStatus" overlap="true" method_id="23">
-			<req>
-				<param name="param1" type="array_int"/>
-				<param name="param2" type="array_string"/>
-				<param name="reserved1" type="array_int"/>
-				<param name="reserved2" type="array_string"/>			
-			</req>
-			<res>
-				<param name="ret1" type="array_int"/>
-				<param name="ret2" type="array_string"/>
-				<param name="reserved1" type="array_int"/>
-				<param name="reserved2" type="array_string"/>					
-			</res>			
-		</twoway>
-		<twoway name="Print" overlap="true" method_id="24">
-			<req>
-				<param name="data1" type="blob"/>
-				<param name="data2" type="blob"/>
-				<param name="data3" type="blob"/>
-				<param name="data4" type="blob"/>
-				<param name="data5" type="blob"/>
-				<param name="data6" type="blob"/>				
-				<param name="reserved1" type="array_int"/>
-				<param name="reserved2" type="array_string"/>			
-			</req>
-			<res>
-				<param name="reserved1" type="array_int"/>
-				<param name="reserved2" type="array_string"/>					
-			</res>			
-		</twoway>
-		<twoway name="QuerySCIList" overlap="true" method_id="25">
-			<req>			
-				<param name="reserved1" type="array_int"/>
-				<param name="reserved2" type="array_string"/>			
-			</req>
-			<res>
-				<param name="sciNo" type="array_string"/>
-        <param name="arrMateriel" type="array_string"/>
-        <param name="CardGroove" type="array_string"/>
-        <param name="CardBoxNo" type="array_string"/>
-        <param name="PsbCode" type="array_string"/>
-        <param name="PsbName" type="array_string"/>
-        <param name="CardInit" type="array_uint"/>
-        <param name="CardRemains" type="array_uint"/>
-        <param name="CardIssued" type="array_uint"/>
-        <param name="CardMixed" type="array_uint"/>
-        <param name="CardPercent" type="array_uint"/>
-        <param name="Maintainer" type="array_string"/>
-        <param name="MaintainTime" type="array_string"/>
-        <param name="UpdateTime" type="array_string"/>				
-				<param name="reserved1" type="array_int"/>
-				<param name="reserved2" type="array_string"/>					
-			</res>			
-		</twoway>		
-		<twoway name="BindSCI" overlap="true" method_id="26">
-			<req>
-				<param name="type" type="int"/>
-				<param name="sciNo" type="string" />			
-				<param name="reserved1" type="array_int"/>
-				<param name="reserved2" type="array_string"/>			
-			</req>
-			<res>
-				<param name="reserved1" type="array_int"/>
-				<param name="reserved2" type="array_string"/>					
-			</res>			
-		</twoway>
 		<twoway name="PreOnlineOnStore" overlap="true" method_id="27">
 			<req>
 				<param name="account" type="string"/>

文件差異過大導致無法顯示
+ 148 - 167
Module/mod_cardissuerstore/CardIssuerStoreFSM.cpp


+ 44 - 26
Module/mod_cardissuerstore/CardIssuerFSM.h → Module/mod_cardissuerstore/CardIssuerStoreFSM.h

@@ -175,7 +175,7 @@ public:
 	{
 		if (ctx != NULL)
 		{
-			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("Operate CardStore unhandled");
+			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode("RTA2WCL")("Operate CardStore unhandled");
 			ctx->Answer(Error_InvalidState, CardIssuerStore_UserErrorCode_EntityInStateCannotProcess);
 		}
 	}
@@ -191,7 +191,7 @@ public:
 	{
 		if (ctx != NULL)
 		{
-			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("card read unhandled");
+			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode("RTA2WCL")("card read unhandled");
 			ctx->Answer(Error_InvalidState, CardIssuerStore_UserErrorCode_EntityInStateCannotProcess);
 		}
 	}
@@ -208,7 +208,7 @@ public:
 	{
 		if (ctx != NULL)
 		{
-			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("card read unhandled(new)");
+			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode("RTA2WCL")("card read unhandled(new)");
 		}
 	}
 protected:
@@ -297,7 +297,7 @@ public:
 	{
 		if (ctx != NULL)
 		{
-			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("card read unhandled");
+			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode("RTA2WCL")("card Write unhandled");
 			ctx->Answer(Error_InvalidState, CardIssuerStore_UserErrorCode_EntityInStateCannotProcess);
 		}
 	}
@@ -314,7 +314,7 @@ public:
 	{
 		if (ctx != NULL)
 		{
-			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("card read unhandled(new)");
+			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode("RTA2WCL")("card Write unhandled(new)");
 		}
 	}
 protected:
@@ -358,7 +358,7 @@ public:
 	{
 		if (ctx != NULL)
 		{
-			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("card issue ex unhandled");
+			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode("RTA2WCL")("card issue ex unhandled");
 			ctx->Answer(Error_InvalidState, CardIssuerStore_UserErrorCode_EntityInStateCannotProcess);
 		}
 	}
@@ -373,7 +373,7 @@ public:
 	{
 		if (ctx != NULL)
 		{
-			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("sam/ic unhandled");
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setResultCode("RTA2WCL")("sam/ic unhandled");
 			ctx->Answer(Error_InvalidState, CardIssuerStore_UserErrorCode_EntityInStateCannotProcess);
 		}
 	}
@@ -387,7 +387,7 @@ public:
 	virtual void OnUnhandled()
 	{
 		if (ctx != NULL){
-			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("PrintCardIm unhandled");
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setResultCode("RTA2WCL")("PrintCardIm unhandled");
 			ctx->Answer(Error_InvalidState, CardIssuerStore_UserErrorCode_EntityInStateCannotProcess);
 		}
 	}
@@ -629,7 +629,7 @@ typedef struct CRegistSwallowCardRet : CHTTPRet {
 		Json::Reader reader;
 		if (!reader.parse(strData, root, false))
 		{
-			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("reader.parse false");//又不能打印,有什么太大意义?
+			DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("reader.parse false");//又不能打印,有什么太大意义?
 			return false;
 		}
 		if (!root["returnInfo"].isNull()) {
@@ -758,7 +758,7 @@ public:
 	{
 		if (ctx != NULL)
 		{
-			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("EjectJS Operate unhandled");
+			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode("RTA2WCL")("EjectJS Operate unhandled");
 			//ctx->Answer(Error_Unexpect, CardIssuerStore_UserErrorCode_EntityInStateCannotProcess);
 		}
 	}
@@ -774,7 +774,7 @@ public:
 	{
 		if (ctx != NULL)
 		{
-			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("CaptureJS Operate unhandled");
+			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode("RTA2WCL")("CaptureJS Operate unhandled");
 			//ctx->Answer(Error_Unexpect, CardIssuerStore_UserErrorCode_EntityInStateCannotProcess);
 		}
 	}
@@ -790,7 +790,7 @@ public:
 	{
 		if (ctx != NULL)
 		{
-			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("ReadBatchCardInfoInRangeJS Operate unhandled");
+			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode("RTA2WCL")("ReadBatchCardInfoInRangeJS Operate unhandled");
 			//ctx->Answer(Error_Unexpect, CardIssuerStore_UserErrorCode_EntityInStateCannotProcess);
 		}
 	}
@@ -806,7 +806,7 @@ public:
 	{
 		if (ctx != NULL)
 		{
-			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("AddAndReadCardFromBoxJS Operate unhandled");
+			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode("RTA2WCL")("AddAndReadCardFromBoxJS Operate unhandled");
 			//ctx->Answer(Error_Unexpect, CardIssuerStore_UserErrorCode_EntityInStateCannotProcess);
 		}
 	}
@@ -822,7 +822,7 @@ public:
 	{
 		if (ctx != NULL)
 		{
-			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("AddCardFromBoxJS Operate unhandled");
+			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode("RTA2WCL")("AddCardFromBoxJS Operate unhandled");
 			//ctx->Answer(Error_Unexpect, CardIssuerStore_UserErrorCode_EntityInStateCannotProcess);
 		}
 	}
@@ -838,7 +838,7 @@ public:
 	{
 		if (ctx != NULL)
 		{
-			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("MoveAndReadCardFromSlotJS Operate unhandled");
+			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode("RTA2WCL")("MoveAndReadCardFromSlotJS Operate unhandled");
 			//ctx->Answer(Error_Unexpect, CardIssuerStore_UserErrorCode_EntityInStateCannotProcess);
 		}
 	}
@@ -854,7 +854,7 @@ public:
 	{
 		if (ctx != NULL)
 		{
-			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("MoveCardFromSlotJS Operate unhandled");
+			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode("RTA2WCL")("MoveCardFromSlotJS Operate unhandled");
 			//ctx->Answer(Error_Unexpect, CardIssuerStore_UserErrorCode_EntityInStateCannotProcess);
 		}
 	}
@@ -871,7 +871,7 @@ public:
 	{
 		if (ctx != NULL)
 		{
-			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("MoveBacktoSlotJS Operate unhandled");
+			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode("RTA2WCL")("MoveBacktoSlotJS Operate unhandled");
 			//ctx->Answer(Error_Unexpect, CardIssuerStore_UserErrorCode_EntityInStateCannotProcess);
 		}
 	}
@@ -903,7 +903,7 @@ public:
 	{
 		if (ctx != NULL)
 		{
-			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("ICCommandJS Operate unhandled");
+			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode("RTA2WCL")("ICCommandJS Operate unhandled");
 			//ctx->Answer(Error_Unexpect, CardIssuerStore_UserErrorCode_EntityInStateCannotProcess);
 		}
 	}
@@ -919,7 +919,7 @@ public:
 	{
 		if (ctx != NULL)
 		{
-			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("WriteTrackJS Operate unhandled");
+			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode("RTA2WCL")("WriteTrackJS Operate unhandled");
 			//ctx->Answer(Error_Unexpect, CardIssuerStore_UserErrorCode_EntityInStateCannotProcess);
 		}
 	}
@@ -935,7 +935,7 @@ public:
 	{
 		if (ctx != NULL)
 		{
-			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("PrintCardImmediatelyJS Operate unhandled");
+			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode("RTA2WCL")("PrintCardImmediatelyJS Operate unhandled");
 			//ctx->Answer(Error_Unexpect, CardIssuerStore_UserErrorCode_EntityInStateCannotProcess);
 		}
 	}
@@ -951,7 +951,7 @@ public:
 	{
 		if (ctx != NULL)
 		{
-			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("PostOnlineJS Operate unhandled");
+			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode("RTA2WCL")("PostOnlineJS Operate unhandled");
 			//ctx->Answer(Error_Unexpect, CardIssuerStore_UserErrorCode_EntityInStateCannotProcess);
 		}
 	}
@@ -967,7 +967,7 @@ public:
 	{
 		if (ctx != NULL)
 		{
-			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("IssueFromBoxJS Operate unhandled");
+			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode("RTA2WCL")("IssueFromBoxJS Operate unhandled");
 			//ctx->Answer(Error_Unexpect, CardIssuerStore_UserErrorCode_EntityInStateCannotProcess);
 		}
 	}
@@ -983,7 +983,7 @@ public:
 	{
 		if (ctx != NULL)
 		{
-			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("PreOnlineCrossJS Operate unhandled");
+			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode("RTA2WCL")("PreOnlineCrossJS Operate unhandled");
 			//ctx->Answer(Error_Unexpect, CardIssuerStore_UserErrorCode_EntityInStateCannotProcess);
 		}
 	}
@@ -1008,7 +1008,7 @@ public:
 	{
 		if (ctx != NULL)
 		{
-			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("ReadJS Operate unhandled");
+			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode("RTA2WCL")("ReadJS Operate unhandled");
 			//ctx->Answer(Error_Unexpect, CardIssuerStore_UserErrorCode_EntityInStateCannotProcess);
 		}
 	}
@@ -1022,7 +1022,7 @@ struct AddCardInfo
 };
 #pragma endregion JS接口 event
 
-class CCardIssuerFSM : public CCommDevFSM<CCardIssuerFSM, CardIssuerClass>
+class CCardIssuerFSM : public CCommDevFSM<CCardIssuerFSM, CardIssuerClass>, public IFSMStateHooker
 {
 public:
 	enum {s0,s1,s2,s4,s5,s6,s7,s8,s9,s10,s11,s14,s17,s18,s19};
@@ -1305,7 +1305,7 @@ public:
 	void SetCancelByRFICFlag(bool bCancel = true) { m_bCancelByRFIC = bCancel; }
 	CSimpleStringA GetPreOnlineICCardNo() { return m_currCardNo; }
 	void CloseAndClearDevObj(bool bCheckConnecting = true, bool bCloseOnly = false);
-	void SetEnterMainPage();
+
 	static void HttpsLogCallBack(const char* logtxt);
 	//0:unknow(havn't access microservice or access failed),1:both mag & ic ,2:mag only,3:ic only
 	int JudgeCardType(CSimpleStringA cardno, bool &bMismatch);
@@ -1490,6 +1490,24 @@ public:
 	}
 	bool SetCardCapturedJS(const int num, bool bNewClear = false);
 	void SetDoExitFlag(bool bFlag) { m_bDoExit = bFlag; }
+
+	virtual void OnStateTrans(int iSrcState, int iDstState);
+
+	CSimpleStringA getRTACode(DWORD dwUserCode) {
+		CSimpleStringA rtaMsg = this->GetEntityBase()->GetFunction()->UserCodeToRTACode(dwUserCode);
+		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("rtaMsg=%s", rtaMsg.GetData());
+		return rtaMsg;
+	}
+
+	CSimpleStringA CombineJsonContext(const char* szMessage)
+	{
+		CSimpleStringA result(true);
+		if (szMessage == NULL || strlen(szMessage) == 0) {
+			return result;
+		}
+		result = CSimpleStringA::Format("{\"addition\": \"%s\"}", szMessage);
+		return  result;
+	}
 #pragma endregion JS新增接口
 
 #pragma region JS新增字段

+ 0 - 294
Module/mod_cardissuerstore/CardIssuerStore_client_g.h

@@ -555,55 +555,6 @@ public:
 		return ret;
 	}
 
-	ErrorCodeEnum ReadEx(CardIssuerStoreService_ReadEx_Req &Req, CSmartPointer<IAsynWaitSp> &spAsyncWait, DWORD dwTimeout)
-	{
-		CSmartPointer<IClientSessionFunction> pFunc = GetFunction();
-		CAutoBuffer Buf = SpObject2Buffer(Req);
-		if (m_context.checkEmpty())
-		{
-			m_context.AutoGenerate();
-			DbgToBeidou(m_context, m_pEntityBase != NULL ? m_pEntityBase->GetEntityName() : "")();
-			m_context = m_context.upgradeLink();
-		}
-		auto ret = pFunc->AsyncRequest(CardIssuerStoreService_Method_ReadEx, CardIssuerStoreService_MethodSignature_ReadEx, Buf, spAsyncWait, m_context, dwTimeout);
-		m_context.clear();
-		return ret;
-	}
-	ErrorCodeEnum ReadEx(CardIssuerStoreService_ReadEx_Req &Req, CardIssuerStoreService_ReadEx_Ans &Ans, DWORD dwTimeout)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = ReadEx(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-	ErrorCodeEnum ReadEx(CardIssuerStoreService_ReadEx_Req &Req, CardIssuerStoreService_ReadEx_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError, CSimpleString &str)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = ReadEx(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-	ErrorCodeEnum ReadEx(CardIssuerStoreService_ReadEx_Req &Req, CardIssuerStoreService_ReadEx_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = ReadEx(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			CSimpleString str;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-
 	ErrorCodeEnum QueryCardInfo(CardIssuerStoreService_QueryCardInfo_Req &Req, CSmartPointer<IAsynWaitSp> &spAsyncWait, DWORD dwTimeout)
 	{
 		CSmartPointer<IClientSessionFunction> pFunc = GetFunction();
@@ -947,55 +898,6 @@ public:
 		return Error;
 	}
 
-	ErrorCodeEnum OpenSafeLock(CardIssuerStoreService_OpenSafeLock_Req &Req, CSmartPointer<IAsynWaitSp> &spAsyncWait, DWORD dwTimeout)
-	{
-		CSmartPointer<IClientSessionFunction> pFunc = GetFunction();
-		CAutoBuffer Buf = SpObject2Buffer(Req);
-		if (m_context.checkEmpty())
-		{
-			m_context.AutoGenerate();
-			DbgToBeidou(m_context, m_pEntityBase != NULL ? m_pEntityBase->GetEntityName() : "")();
-			m_context = m_context.upgradeLink();
-		}
-		auto ret = pFunc->AsyncRequest(CardIssuerStoreService_Method_OpenSafeLock, CardIssuerStoreService_MethodSignature_OpenSafeLock, Buf, spAsyncWait, m_context, dwTimeout);
-		m_context.clear();
-		return ret;
-	}
-	ErrorCodeEnum OpenSafeLock(CardIssuerStoreService_OpenSafeLock_Req &Req, CardIssuerStoreService_OpenSafeLock_Ans &Ans, DWORD dwTimeout)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = OpenSafeLock(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-	ErrorCodeEnum OpenSafeLock(CardIssuerStoreService_OpenSafeLock_Req &Req, CardIssuerStoreService_OpenSafeLock_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError, CSimpleString &str)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = OpenSafeLock(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-	ErrorCodeEnum OpenSafeLock(CardIssuerStoreService_OpenSafeLock_Req &Req, CardIssuerStoreService_OpenSafeLock_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = OpenSafeLock(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			CSimpleString str;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-
 	ErrorCodeEnum SAMICCommand(CardIssuerStoreService_SAMICCommand_Req &Req, CSmartPointer<IAsynWaitSp> &spAsyncWait, DWORD dwTimeout)
 	{
 		CSmartPointer<IClientSessionFunction> pFunc = GetFunction();
@@ -1045,202 +947,6 @@ public:
 		return Error;
 	}
 
-	ErrorCodeEnum QueryPrinterStatus(CardIssuerStoreService_QueryPrinterStatus_Req &Req, CSmartPointer<IAsynWaitSp> &spAsyncWait, DWORD dwTimeout)
-	{
-		CSmartPointer<IClientSessionFunction> pFunc = GetFunction();
-		CAutoBuffer Buf = SpObject2Buffer(Req);
-		if (m_context.checkEmpty())
-		{
-			m_context.AutoGenerate();
-			DbgToBeidou(m_context, m_pEntityBase != NULL ? m_pEntityBase->GetEntityName() : "")();
-			m_context = m_context.upgradeLink();
-		}
-		auto ret = pFunc->AsyncRequest(CardIssuerStoreService_Method_QueryPrinterStatus, CardIssuerStoreService_MethodSignature_QueryPrinterStatus, Buf, spAsyncWait, m_context, dwTimeout);
-		m_context.clear();
-		return ret;
-	}
-	ErrorCodeEnum QueryPrinterStatus(CardIssuerStoreService_QueryPrinterStatus_Req &Req, CardIssuerStoreService_QueryPrinterStatus_Ans &Ans, DWORD dwTimeout)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = QueryPrinterStatus(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-	ErrorCodeEnum QueryPrinterStatus(CardIssuerStoreService_QueryPrinterStatus_Req &Req, CardIssuerStoreService_QueryPrinterStatus_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError, CSimpleString &str)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = QueryPrinterStatus(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-	ErrorCodeEnum QueryPrinterStatus(CardIssuerStoreService_QueryPrinterStatus_Req &Req, CardIssuerStoreService_QueryPrinterStatus_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = QueryPrinterStatus(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			CSimpleString str;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-
-	ErrorCodeEnum Print(CardIssuerStoreService_Print_Req &Req, CSmartPointer<IAsynWaitSp> &spAsyncWait, DWORD dwTimeout)
-	{
-		CSmartPointer<IClientSessionFunction> pFunc = GetFunction();
-		CAutoBuffer Buf = SpObject2Buffer(Req);
-		if (m_context.checkEmpty())
-		{
-			m_context.AutoGenerate();
-			DbgToBeidou(m_context, m_pEntityBase != NULL ? m_pEntityBase->GetEntityName() : "")();
-			m_context = m_context.upgradeLink();
-		}
-		auto ret = pFunc->AsyncRequest(CardIssuerStoreService_Method_Print, CardIssuerStoreService_MethodSignature_Print, Buf, spAsyncWait, m_context, dwTimeout);
-		m_context.clear();
-		return ret;
-	}
-	ErrorCodeEnum Print(CardIssuerStoreService_Print_Req &Req, CardIssuerStoreService_Print_Ans &Ans, DWORD dwTimeout)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = Print(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-	ErrorCodeEnum Print(CardIssuerStoreService_Print_Req &Req, CardIssuerStoreService_Print_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError, CSimpleString &str)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = Print(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-	ErrorCodeEnum Print(CardIssuerStoreService_Print_Req &Req, CardIssuerStoreService_Print_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = Print(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			CSimpleString str;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-
-	ErrorCodeEnum QuerySCIList(CardIssuerStoreService_QuerySCIList_Req &Req, CSmartPointer<IAsynWaitSp> &spAsyncWait, DWORD dwTimeout)
-	{
-		CSmartPointer<IClientSessionFunction> pFunc = GetFunction();
-		CAutoBuffer Buf = SpObject2Buffer(Req);
-		if (m_context.checkEmpty())
-		{
-			m_context.AutoGenerate();
-			DbgToBeidou(m_context, m_pEntityBase != NULL ? m_pEntityBase->GetEntityName() : "")();
-			m_context = m_context.upgradeLink();
-		}
-		auto ret = pFunc->AsyncRequest(CardIssuerStoreService_Method_QuerySCIList, CardIssuerStoreService_MethodSignature_QuerySCIList, Buf, spAsyncWait, m_context, dwTimeout);
-		m_context.clear();
-		return ret;
-	}
-	ErrorCodeEnum QuerySCIList(CardIssuerStoreService_QuerySCIList_Req &Req, CardIssuerStoreService_QuerySCIList_Ans &Ans, DWORD dwTimeout)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = QuerySCIList(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-	ErrorCodeEnum QuerySCIList(CardIssuerStoreService_QuerySCIList_Req &Req, CardIssuerStoreService_QuerySCIList_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError, CSimpleString &str)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = QuerySCIList(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-	ErrorCodeEnum QuerySCIList(CardIssuerStoreService_QuerySCIList_Req &Req, CardIssuerStoreService_QuerySCIList_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = QuerySCIList(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			CSimpleString str;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-
-	ErrorCodeEnum BindSCI(CardIssuerStoreService_BindSCI_Req &Req, CSmartPointer<IAsynWaitSp> &spAsyncWait, DWORD dwTimeout)
-	{
-		CSmartPointer<IClientSessionFunction> pFunc = GetFunction();
-		CAutoBuffer Buf = SpObject2Buffer(Req);
-		if (m_context.checkEmpty())
-		{
-			m_context.AutoGenerate();
-			DbgToBeidou(m_context, m_pEntityBase != NULL ? m_pEntityBase->GetEntityName() : "")();
-			m_context = m_context.upgradeLink();
-		}
-		auto ret = pFunc->AsyncRequest(CardIssuerStoreService_Method_BindSCI, CardIssuerStoreService_MethodSignature_BindSCI, Buf, spAsyncWait, m_context, dwTimeout);
-		m_context.clear();
-		return ret;
-	}
-	ErrorCodeEnum BindSCI(CardIssuerStoreService_BindSCI_Req &Req, CardIssuerStoreService_BindSCI_Ans &Ans, DWORD dwTimeout)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = BindSCI(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-	ErrorCodeEnum BindSCI(CardIssuerStoreService_BindSCI_Req &Req, CardIssuerStoreService_BindSCI_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError, CSimpleString &str)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = BindSCI(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-	ErrorCodeEnum BindSCI(CardIssuerStoreService_BindSCI_Req &Req, CardIssuerStoreService_BindSCI_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = BindSCI(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			CSimpleString str;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-
 	ErrorCodeEnum PreOnlineOnStore(CardIssuerStoreService_PreOnlineOnStore_Req &Req, CSmartPointer<IAsynWaitSp> &spAsyncWait, DWORD dwTimeout)
 	{
 		CSmartPointer<IClientSessionFunction> pFunc = GetFunction();

+ 0 - 202
Module/mod_cardissuerstore/CardIssuerStore_def_g.h

@@ -25,7 +25,6 @@ namespace CardIssuerStore {
 #define CardIssuerStoreService_Method_GetMaterialCount 10
 #define CardIssuerStoreService_Method_SetMaterialCount 11
 #define CardIssuerStoreService_Method_SetIssueFlag 12
-#define CardIssuerStoreService_Method_ReadEx 13
 #define CardIssuerStoreService_Method_QueryCardInfo 14
 #define CardIssuerStoreService_Method_WriteTrack 15
 #define CardIssuerStoreService_Method_GetMaterialCountEx 16
@@ -33,12 +32,7 @@ namespace CardIssuerStore {
 #define CardIssuerStoreService_Method_SetSomeFlag 18
 #define CardIssuerStoreService_Method_GetSCIInfo 19
 #define CardIssuerStoreService_Method_IssueEx 20
-#define CardIssuerStoreService_Method_OpenSafeLock 21
 #define CardIssuerStoreService_Method_SAMICCommand 22
-#define CardIssuerStoreService_Method_QueryPrinterStatus 23
-#define CardIssuerStoreService_Method_Print 24
-#define CardIssuerStoreService_Method_QuerySCIList 25
-#define CardIssuerStoreService_Method_BindSCI 26
 #define CardIssuerStoreService_Method_PreOnlineOnStore 27
 #define CardIssuerStoreService_Method_NotifyPreonline 28
 #define CardIssuerStoreService_Method_QueryCardInfoOnStore 29
@@ -77,7 +71,6 @@ namespace CardIssuerStore {
 #define CardIssuerStoreService_MethodSignature_GetMaterialCount -605917749
 #define CardIssuerStoreService_MethodSignature_SetMaterialCount 870103115
 #define CardIssuerStoreService_MethodSignature_SetIssueFlag 187641303
-#define CardIssuerStoreService_MethodSignature_ReadEx -842531343
 #define CardIssuerStoreService_MethodSignature_QueryCardInfo 154962579
 #define CardIssuerStoreService_MethodSignature_WriteTrack -1424799012
 #define CardIssuerStoreService_MethodSignature_GetMaterialCountEx 1356148904
@@ -85,12 +78,7 @@ namespace CardIssuerStore {
 #define CardIssuerStoreService_MethodSignature_SetSomeFlag -2033418025
 #define CardIssuerStoreService_MethodSignature_GetSCIInfo 1097494981
 #define CardIssuerStoreService_MethodSignature_IssueEx 1390328640
-#define CardIssuerStoreService_MethodSignature_OpenSafeLock 177980614
 #define CardIssuerStoreService_MethodSignature_SAMICCommand 406988293
-#define CardIssuerStoreService_MethodSignature_QueryPrinterStatus -890728447
-#define CardIssuerStoreService_MethodSignature_Print 2096006675
-#define CardIssuerStoreService_MethodSignature_QuerySCIList -1772231453
-#define CardIssuerStoreService_MethodSignature_BindSCI -1242011672
 #define CardIssuerStoreService_MethodSignature_PreOnlineOnStore 158325869
 #define CardIssuerStoreService_MethodSignature_NotifyPreonline -808637659
 #define CardIssuerStoreService_MethodSignature_QueryCardInfoOnStore 1217447214
@@ -129,7 +117,6 @@ namespace CardIssuerStore {
 #define CardIssuerStoreService_LogCode_GetMaterialCount "QLR040222010"
 #define CardIssuerStoreService_LogCode_SetMaterialCount "QLR040222011"
 #define CardIssuerStoreService_LogCode_SetIssueFlag "QLR040222012"
-#define CardIssuerStoreService_LogCode_ReadEx "QLR040222013"
 #define CardIssuerStoreService_LogCode_QueryCardInfo "QLR040222014"
 #define CardIssuerStoreService_LogCode_WriteTrack "QLR040222015"
 #define CardIssuerStoreService_LogCode_GetMaterialCountEx "QLR040222016"
@@ -137,12 +124,7 @@ namespace CardIssuerStore {
 #define CardIssuerStoreService_LogCode_SetSomeFlag "QLR040222018"
 #define CardIssuerStoreService_LogCode_GetSCIInfo "QLR040222019"
 #define CardIssuerStoreService_LogCode_IssueEx "QLR040222020"
-#define CardIssuerStoreService_LogCode_OpenSafeLock "QLR040222021"
 #define CardIssuerStoreService_LogCode_SAMICCommand "QLR040222022"
-#define CardIssuerStoreService_LogCode_QueryPrinterStatus "QLR040222023"
-#define CardIssuerStoreService_LogCode_Print "QLR040222024"
-#define CardIssuerStoreService_LogCode_QuerySCIList "QLR040222025"
-#define CardIssuerStoreService_LogCode_BindSCI "QLR040222026"
 #define CardIssuerStoreService_LogCode_PreOnlineOnStore "QLR040222027"
 #define CardIssuerStoreService_LogCode_NotifyPreonline "QLR040222028"
 #define CardIssuerStoreService_LogCode_QueryCardInfoOnStore "QLR040222029"
@@ -414,44 +396,6 @@ struct CardIssuerStoreService_SetIssueFlag_Info
 
 };
 
-struct CardIssuerStoreService_ReadEx_Req
-{
-	CSimpleStringA aid;
-	CSimpleStringA reserved1;
-	CSimpleStringA reserved2;
-
-	void Serialize(SpBuffer &Buf)
-	{
-		auto & buf = Buf & aid & reserved1 & reserved2;
-	}
-
-};
-
-struct CardIssuerStoreService_ReadEx_Ans
-{
-	CSimpleStringA track1;
-	CSimpleStringA track2;
-	CSimpleStringA track3;
-	int CDType;
-	int ICType;
-	int CMBType;
-	CSimpleStringA ICData;
-	int status;
-	CSimpleStringA t2Account;
-	CSimpleStringA t2Region;
-	CSimpleStringA t2CardSerial;
-	CSimpleStringA t2CVC;
-	CSimpleStringA t2ExpireDate;
-	CSimpleStringA reserved1;
-	CSimpleStringA reserved2;
-
-	void Serialize(SpBuffer &Buf)
-	{
-		auto & buf = Buf & track1 & track2 & track3 & CDType & ICType & CMBType & ICData & status & t2Account & t2Region & t2CardSerial & t2CVC & t2ExpireDate & reserved1 & reserved2;
-	}
-
-};
-
 struct CardIssuerStoreService_QueryCardInfo_Req
 {
 
@@ -650,30 +594,6 @@ struct CardIssuerStoreService_IssueEx_Ans
 
 };
 
-struct CardIssuerStoreService_OpenSafeLock_Req
-{
-	CAutoArray<int> reserved1;
-	CAutoArray<CSimpleStringA> reserved2;
-
-	void Serialize(SpBuffer &Buf)
-	{
-		auto & buf = Buf & reserved1 & reserved2;
-	}
-
-};
-
-struct CardIssuerStoreService_OpenSafeLock_Ans
-{
-	CAutoArray<int> reserved1;
-	CAutoArray<CSimpleStringA> reserved2;
-
-	void Serialize(SpBuffer &Buf)
-	{
-		auto & buf = Buf & reserved1 & reserved2;
-	}
-
-};
-
 struct CardIssuerStoreService_SAMICCommand_Req
 {
 	int cmdType;
@@ -703,128 +623,6 @@ struct CardIssuerStoreService_SAMICCommand_Ans
 
 };
 
-struct CardIssuerStoreService_QueryPrinterStatus_Req
-{
-	CAutoArray<int> param1;
-	CAutoArray<CSimpleStringA> param2;
-	CAutoArray<int> reserved1;
-	CAutoArray<CSimpleStringA> reserved2;
-
-	void Serialize(SpBuffer &Buf)
-	{
-		auto & buf = Buf & param1 & param2 & reserved1 & reserved2;
-	}
-
-};
-
-struct CardIssuerStoreService_QueryPrinterStatus_Ans
-{
-	CAutoArray<int> ret1;
-	CAutoArray<CSimpleStringA> ret2;
-	CAutoArray<int> reserved1;
-	CAutoArray<CSimpleStringA> reserved2;
-
-	void Serialize(SpBuffer &Buf)
-	{
-		auto & buf = Buf & ret1 & ret2 & reserved1 & reserved2;
-	}
-
-};
-
-struct CardIssuerStoreService_Print_Req
-{
-	CBlob data1;
-	CBlob data2;
-	CBlob data3;
-	CBlob data4;
-	CBlob data5;
-	CBlob data6;
-	CAutoArray<int> reserved1;
-	CAutoArray<CSimpleStringA> reserved2;
-
-	void Serialize(SpBuffer &Buf)
-	{
-		auto & buf = Buf & data1 & data2 & data3 & data4 & data5 & data6 & reserved1 & reserved2;
-	}
-
-};
-
-struct CardIssuerStoreService_Print_Ans
-{
-	CAutoArray<int> reserved1;
-	CAutoArray<CSimpleStringA> reserved2;
-
-	void Serialize(SpBuffer &Buf)
-	{
-		auto & buf = Buf & reserved1 & reserved2;
-	}
-
-};
-
-struct CardIssuerStoreService_QuerySCIList_Req
-{
-	CAutoArray<int> reserved1;
-	CAutoArray<CSimpleStringA> reserved2;
-
-	void Serialize(SpBuffer &Buf)
-	{
-		auto & buf = Buf & reserved1 & reserved2;
-	}
-
-};
-
-struct CardIssuerStoreService_QuerySCIList_Ans
-{
-	CAutoArray<CSimpleStringA> sciNo;
-	CAutoArray<CSimpleStringA> arrMateriel;
-	CAutoArray<CSimpleStringA> CardGroove;
-	CAutoArray<CSimpleStringA> CardBoxNo;
-	CAutoArray<CSimpleStringA> PsbCode;
-	CAutoArray<CSimpleStringA> PsbName;
-	CAutoArray<unsigned int> CardInit;
-	CAutoArray<unsigned int> CardRemains;
-	CAutoArray<unsigned int> CardIssued;
-	CAutoArray<unsigned int> CardMixed;
-	CAutoArray<unsigned int> CardPercent;
-	CAutoArray<CSimpleStringA> Maintainer;
-	CAutoArray<CSimpleStringA> MaintainTime;
-	CAutoArray<CSimpleStringA> UpdateTime;
-	CAutoArray<int> reserved1;
-	CAutoArray<CSimpleStringA> reserved2;
-
-	void Serialize(SpBuffer &Buf)
-	{
-		auto & buf = Buf & sciNo & arrMateriel & CardGroove & CardBoxNo & PsbCode & PsbName & CardInit & CardRemains & CardIssued & CardMixed & CardPercent & Maintainer & MaintainTime & UpdateTime & reserved1 & reserved2;
-	}
-
-};
-
-struct CardIssuerStoreService_BindSCI_Req
-{
-	int type;
-	CSimpleStringA sciNo;
-	CAutoArray<int> reserved1;
-	CAutoArray<CSimpleStringA> reserved2;
-
-	void Serialize(SpBuffer &Buf)
-	{
-		auto & buf = Buf & type & sciNo & reserved1 & reserved2;
-	}
-
-};
-
-struct CardIssuerStoreService_BindSCI_Ans
-{
-	CAutoArray<int> reserved1;
-	CAutoArray<CSimpleStringA> reserved2;
-
-	void Serialize(SpBuffer &Buf)
-	{
-		auto & buf = Buf & reserved1 & reserved2;
-	}
-
-};
-
 struct CardIssuerStoreService_PreOnlineOnStore_Req
 {
 	CSimpleStringA account;

+ 0 - 162
Module/mod_cardissuerstore/CardIssuerStore_server_g.h

@@ -121,13 +121,6 @@ public:
 				Error = Error_MethodSignatureFailed;
 			}
 			break;
-		case CardIssuerStoreService_Method_ReadEx:
-			if (dwSignature == CardIssuerStoreService_MethodSignature_ReadEx) {
-				bOverlap = true;
-			} else {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
 		case CardIssuerStoreService_Method_QueryCardInfo:
 			if (dwSignature == CardIssuerStoreService_MethodSignature_QueryCardInfo) {
 				bOverlap = true;
@@ -177,13 +170,6 @@ public:
 				Error = Error_MethodSignatureFailed;
 			}
 			break;
-		case CardIssuerStoreService_Method_OpenSafeLock:
-			if (dwSignature == CardIssuerStoreService_MethodSignature_OpenSafeLock) {
-				bOverlap = true;
-			} else {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
 		case CardIssuerStoreService_Method_SAMICCommand:
 			if (dwSignature == CardIssuerStoreService_MethodSignature_SAMICCommand) {
 				bOverlap = true;
@@ -191,34 +177,6 @@ public:
 				Error = Error_MethodSignatureFailed;
 			}
 			break;
-		case CardIssuerStoreService_Method_QueryPrinterStatus:
-			if (dwSignature == CardIssuerStoreService_MethodSignature_QueryPrinterStatus) {
-				bOverlap = true;
-			} else {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
-		case CardIssuerStoreService_Method_Print:
-			if (dwSignature == CardIssuerStoreService_MethodSignature_Print) {
-				bOverlap = true;
-			} else {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
-		case CardIssuerStoreService_Method_QuerySCIList:
-			if (dwSignature == CardIssuerStoreService_MethodSignature_QuerySCIList) {
-				bOverlap = true;
-			} else {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
-		case CardIssuerStoreService_Method_BindSCI:
-			if (dwSignature == CardIssuerStoreService_MethodSignature_BindSCI) {
-				bOverlap = true;
-			} else {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
 		case CardIssuerStoreService_Method_PreOnlineOnStore:
 			if (dwSignature == CardIssuerStoreService_MethodSignature_PreOnlineOnStore) {
 				bOverlap = true;
@@ -463,11 +421,6 @@ public:
 				Error = Error_MethodSignatureFailed;
 			}
 			break;
-		case CardIssuerStoreService_Method_ReadEx:
-			if (dwSignature != CardIssuerStoreService_MethodSignature_ReadEx) {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
 		case CardIssuerStoreService_Method_QueryCardInfo:
 			if (dwSignature != CardIssuerStoreService_MethodSignature_QueryCardInfo) {
 				Error = Error_MethodSignatureFailed;
@@ -503,36 +456,11 @@ public:
 				Error = Error_MethodSignatureFailed;
 			}
 			break;
-		case CardIssuerStoreService_Method_OpenSafeLock:
-			if (dwSignature != CardIssuerStoreService_MethodSignature_OpenSafeLock) {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
 		case CardIssuerStoreService_Method_SAMICCommand:
 			if (dwSignature != CardIssuerStoreService_MethodSignature_SAMICCommand) {
 				Error = Error_MethodSignatureFailed;
 			}
 			break;
-		case CardIssuerStoreService_Method_QueryPrinterStatus:
-			if (dwSignature != CardIssuerStoreService_MethodSignature_QueryPrinterStatus) {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
-		case CardIssuerStoreService_Method_Print:
-			if (dwSignature != CardIssuerStoreService_MethodSignature_Print) {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
-		case CardIssuerStoreService_Method_QuerySCIList:
-			if (dwSignature != CardIssuerStoreService_MethodSignature_QuerySCIList) {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
-		case CardIssuerStoreService_Method_BindSCI:
-			if (dwSignature != CardIssuerStoreService_MethodSignature_BindSCI) {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
 		case CardIssuerStoreService_Method_PreOnlineOnStore:
 			if (dwSignature != CardIssuerStoreService_MethodSignature_PreOnlineOnStore) {
 				Error = Error_MethodSignatureFailed;
@@ -725,11 +653,6 @@ public:
 	/// override by user
 	}
 
-	virtual void Handle_ReadEx(SpReqAnsContext<CardIssuerStoreService_ReadEx_Req, CardIssuerStoreService_ReadEx_Ans>::Pointer ctx)
-	{
-	/// override by user
-	}
-
 	virtual void Handle_QueryCardInfo(SpReqAnsContext<CardIssuerStoreService_QueryCardInfo_Req, CardIssuerStoreService_QueryCardInfo_Ans>::Pointer ctx)
 	{
 	/// override by user
@@ -765,36 +688,11 @@ public:
 	/// override by user
 	}
 
-	virtual void Handle_OpenSafeLock(SpReqAnsContext<CardIssuerStoreService_OpenSafeLock_Req, CardIssuerStoreService_OpenSafeLock_Ans>::Pointer ctx)
-	{
-	/// override by user
-	}
-
 	virtual void Handle_SAMICCommand(SpReqAnsContext<CardIssuerStoreService_SAMICCommand_Req, CardIssuerStoreService_SAMICCommand_Ans>::Pointer ctx)
 	{
 	/// override by user
 	}
 
-	virtual void Handle_QueryPrinterStatus(SpReqAnsContext<CardIssuerStoreService_QueryPrinterStatus_Req, CardIssuerStoreService_QueryPrinterStatus_Ans>::Pointer ctx)
-	{
-	/// override by user
-	}
-
-	virtual void Handle_Print(SpReqAnsContext<CardIssuerStoreService_Print_Req, CardIssuerStoreService_Print_Ans>::Pointer ctx)
-	{
-	/// override by user
-	}
-
-	virtual void Handle_QuerySCIList(SpReqAnsContext<CardIssuerStoreService_QuerySCIList_Req, CardIssuerStoreService_QuerySCIList_Ans>::Pointer ctx)
-	{
-	/// override by user
-	}
-
-	virtual void Handle_BindSCI(SpReqAnsContext<CardIssuerStoreService_BindSCI_Req, CardIssuerStoreService_BindSCI_Ans>::Pointer ctx)
-	{
-	/// override by user
-	}
-
 	virtual void Handle_PreOnlineOnStore(SpReqAnsContext<CardIssuerStoreService_PreOnlineOnStore_Req, CardIssuerStoreService_PreOnlineOnStore_Ans>::Pointer ctx)
 	{
 	/// override by user
@@ -1061,16 +959,6 @@ public:
 						Handle_SetIssueFlag(ctx);
 					}
 					break;
-				case CardIssuerStoreService_Method_ReadEx:
-					{
-						SpReqAnsContext<CardIssuerStoreService_ReadEx_Req,CardIssuerStoreService_ReadEx_Ans>::Pointer ctx;
-						ctx.Attach(new SpReqAnsContext<CardIssuerStoreService_ReadEx_Req,CardIssuerStoreService_ReadEx_Ans>(pTransactionContext));
-						SpBuffer2Object(Buf, ctx->Req);
-						pTransactionContext->GetLinkContext(ctx->link);
-						EntityResource::setLink(ctx->link);
-						Handle_ReadEx(ctx);
-					}
-					break;
 				case CardIssuerStoreService_Method_QueryCardInfo:
 					{
 						SpReqAnsContext<CardIssuerStoreService_QueryCardInfo_Req,CardIssuerStoreService_QueryCardInfo_Ans>::Pointer ctx;
@@ -1141,16 +1029,6 @@ public:
 						Handle_IssueEx(ctx);
 					}
 					break;
-				case CardIssuerStoreService_Method_OpenSafeLock:
-					{
-						SpReqAnsContext<CardIssuerStoreService_OpenSafeLock_Req,CardIssuerStoreService_OpenSafeLock_Ans>::Pointer ctx;
-						ctx.Attach(new SpReqAnsContext<CardIssuerStoreService_OpenSafeLock_Req,CardIssuerStoreService_OpenSafeLock_Ans>(pTransactionContext));
-						SpBuffer2Object(Buf, ctx->Req);
-						pTransactionContext->GetLinkContext(ctx->link);
-						EntityResource::setLink(ctx->link);
-						Handle_OpenSafeLock(ctx);
-					}
-					break;
 				case CardIssuerStoreService_Method_SAMICCommand:
 					{
 						SpReqAnsContext<CardIssuerStoreService_SAMICCommand_Req,CardIssuerStoreService_SAMICCommand_Ans>::Pointer ctx;
@@ -1161,46 +1039,6 @@ public:
 						Handle_SAMICCommand(ctx);
 					}
 					break;
-				case CardIssuerStoreService_Method_QueryPrinterStatus:
-					{
-						SpReqAnsContext<CardIssuerStoreService_QueryPrinterStatus_Req,CardIssuerStoreService_QueryPrinterStatus_Ans>::Pointer ctx;
-						ctx.Attach(new SpReqAnsContext<CardIssuerStoreService_QueryPrinterStatus_Req,CardIssuerStoreService_QueryPrinterStatus_Ans>(pTransactionContext));
-						SpBuffer2Object(Buf, ctx->Req);
-						pTransactionContext->GetLinkContext(ctx->link);
-						EntityResource::setLink(ctx->link);
-						Handle_QueryPrinterStatus(ctx);
-					}
-					break;
-				case CardIssuerStoreService_Method_Print:
-					{
-						SpReqAnsContext<CardIssuerStoreService_Print_Req,CardIssuerStoreService_Print_Ans>::Pointer ctx;
-						ctx.Attach(new SpReqAnsContext<CardIssuerStoreService_Print_Req,CardIssuerStoreService_Print_Ans>(pTransactionContext));
-						SpBuffer2Object(Buf, ctx->Req);
-						pTransactionContext->GetLinkContext(ctx->link);
-						EntityResource::setLink(ctx->link);
-						Handle_Print(ctx);
-					}
-					break;
-				case CardIssuerStoreService_Method_QuerySCIList:
-					{
-						SpReqAnsContext<CardIssuerStoreService_QuerySCIList_Req,CardIssuerStoreService_QuerySCIList_Ans>::Pointer ctx;
-						ctx.Attach(new SpReqAnsContext<CardIssuerStoreService_QuerySCIList_Req,CardIssuerStoreService_QuerySCIList_Ans>(pTransactionContext));
-						SpBuffer2Object(Buf, ctx->Req);
-						pTransactionContext->GetLinkContext(ctx->link);
-						EntityResource::setLink(ctx->link);
-						Handle_QuerySCIList(ctx);
-					}
-					break;
-				case CardIssuerStoreService_Method_BindSCI:
-					{
-						SpReqAnsContext<CardIssuerStoreService_BindSCI_Req,CardIssuerStoreService_BindSCI_Ans>::Pointer ctx;
-						ctx.Attach(new SpReqAnsContext<CardIssuerStoreService_BindSCI_Req,CardIssuerStoreService_BindSCI_Ans>(pTransactionContext));
-						SpBuffer2Object(Buf, ctx->Req);
-						pTransactionContext->GetLinkContext(ctx->link);
-						EntityResource::setLink(ctx->link);
-						Handle_BindSCI(ctx);
-					}
-					break;
 				case CardIssuerStoreService_Method_PreOnlineOnStore:
 					{
 						SpReqAnsContext<CardIssuerStoreService_PreOnlineOnStore_Req,CardIssuerStoreService_PreOnlineOnStore_Ans>::Pointer ctx;

+ 17 - 20
Module/mod_cardissuerstore/mod_cardissuer.cpp → Module/mod_cardissuerstore/mod_cardissuerStore.cpp

@@ -6,7 +6,7 @@
 #pragma once
 
 #include "SpBase.h"
-#include "mod_cardissuer.h"
+#include "mod_cardissuerStore.h"
 
 #include "CardIssuerClass.h"
 
@@ -14,7 +14,7 @@ void CardIssuerStoreServerSession::Handle_Read(SpReqAnsContext<CardIssuerStoreSe
 {	//卡库暂时读卡功能不使用
 	LOG_FUNCTION();
 	DbgToBeidou(ctx->link, __FUNCTION__)();
-	DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Read");
+	DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Read, Req.aid=%s",ctx->Req.aid.GetData());
 	m_pEntity->Read(ctx);
 }
 
@@ -37,7 +37,7 @@ void CardIssuerStoreServerSession::Handle_PreOnline(SpReqAnsContext<CardIssuerSt
 {
 	LOG_FUNCTION();
 	DbgToBeidou(ctx->link, __FUNCTION__)();
-	DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("PreOnline");
+	DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("PreOnline , Req.businessData=%s, Req.reserved1=%s", ctx->Req.businessData.GetData(), ctx->Req.reserved1.GetData());
 	m_pEntity->PreOnline(ctx);
 }
 void CardIssuerStoreServerSession::Handle_PostOnline(SpReqAnsContext<CardIssuerStoreService_PostOnline_Req, CardIssuerStoreService_PostOnline_Ans>::Pointer ctx)
@@ -93,20 +93,20 @@ void CardIssuerStoreServerSession::Handle_SetSomeFlag(SpReqAnsContext<CardIssuer
 {
 	LOG_FUNCTION();
 	DbgToBeidou(ctx->link, __FUNCTION__)();
-	DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("SetSomeFlag,Req.IssueBusiness:%d", ctx->Req.IssueBusiness);
+	DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("SetSomeFlag, Req.IssueBusiness=%d", ctx->Req.IssueBusiness);
 	m_pEntity->SetSomeFlag(ctx);
 }
 void CardIssuerStoreServerSession::Handle_IssueEx(SpReqAnsContext<CardIssuerStoreService_IssueEx_Req, CardIssuerStoreService_IssueEx_Ans>::Pointer ctx)
 {
 	LOG_FUNCTION();
 	DbgToBeidou(ctx->link, __FUNCTION__)();
-	DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("IssueEx,req.hopper:%d", ctx->Req.hopper);
+	DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("IssueEx, Req.hopper=%d", ctx->Req.hopper);
 	m_pEntity->IssueEx(ctx);
 }
 void CardIssuerStoreServerSession::Handle_SAMICCommand(SpReqAnsContext<CardIssuerStoreService_SAMICCommand_Req, CardIssuerStoreService_SAMICCommand_Ans>::Pointer ctx)
 {
 	DbgToBeidou(ctx->link, __FUNCTION__)();
-	DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("SAMICCommand");
+	DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("SAMICCommand, Req.cmdType=%d", ctx->Req.cmdType);
 	m_pEntity->SAMICCommand(ctx);
 }
 
@@ -121,7 +121,7 @@ void CardIssuerStoreServerSession::Handle_GetAddCardInfo(SpReqAnsContext<CardIss
 {
 	LOG_FUNCTION();
 	DbgToBeidou(ctx->link, __FUNCTION__)();
-	DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("GetAddCardInfo");
+	DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("GetAddCardInfo, Req.isSync=%d",ctx->Req.isSync);
 	m_pEntity->GetAddCardInfo(ctx);
 }
 void CardIssuerStoreServerSession::Handle_PrintCardImmediately(SpReqAnsContext<CardIssuerStoreService_PrintCardImmediately_Req, CardIssuerStoreService_PrintCardImmediately_Ans>::Pointer ctx)
@@ -163,7 +163,7 @@ void CardIssuerStoreServerSession::Handle_CaptureJS(SpReqAnsContext<CardIssuerSt
 {
 	LOG_FUNCTION();
 	DbgToBeidou(ctx->link, __FUNCTION__)();
-	DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke CaptureJS");
+	DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke CaptureJS, captureCode:%s",ctx->Req.captureCode.GetData());
 	m_pEntity->CaptureJS(ctx);
 }
 //区间盘库
@@ -171,7 +171,7 @@ void CardIssuerStoreServerSession::Handle_ReadBatchCardInfoInRangeJS(SpReqAnsCon
 {
 	LOG_FUNCTION();
 	DbgToBeidou(ctx->link, __FUNCTION__)();
-	DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke ReadBatchCardInfoInRangeJS");
+	DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke ReadBatchCardInfoInRangeJS  beginSlot:%d, endSlot:%d", ctx->Req.beginSlot, ctx->Req.endSlot);
 	m_pEntity->ReadBatchCardInfoInRangeJS(ctx);
 }
 //卡库容量和卡槽状态
@@ -195,7 +195,7 @@ void CardIssuerStoreServerSession::Handle_MoveAndReadCardFromSlotJS(SpReqAnsCont
 {
 	LOG_FUNCTION();
 	DbgToBeidou(ctx->link, __FUNCTION__)();
-	DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke MoveAndReadCardFromSlotJS");
+	DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke MoveAndReadCardFromSlotJS, slot:%d",ctx->Req.slot);
 	m_pEntity->MoveAndReadCardFromSlotJS(ctx);
 }
 //移回卡槽
@@ -203,7 +203,7 @@ void CardIssuerStoreServerSession::Handle_MoveBacktoSlotJS(SpReqAnsContext<CardI
 {
 	LOG_FUNCTION();
 	DbgToBeidou(ctx->link, __FUNCTION__)();
-	DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke MoveBacktoSlotJS");
+	DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke MoveBacktoSlotJS, slot:%d",ctx->Req.slot);
 	m_pEntity->MoveBacktoSlotJS(ctx);
 }
 
@@ -265,7 +265,7 @@ void CardIssuerStoreServerSession::Handle_ICCommandJS(SpReqAnsContext<CardIssuer
 {
 	LOG_FUNCTION();
 	DbgToBeidou(ctx->link, __FUNCTION__)();
-	DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke ICCommandJS");
+	DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke ICCommandJS, cmdType:%d",ctx->Req.cmdType);
 	m_pEntity->ICCommandJS(ctx);
 }
 
@@ -274,7 +274,7 @@ void CardIssuerStoreServerSession::Handle_PostOnlineJS(SpReqAnsContext<CardIssue
 {
 	LOG_FUNCTION();
 	DbgToBeidou(ctx->link, __FUNCTION__)();
-	DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke PostOnlineJS");
+	DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke PostOnlineJS, data:%s",ctx->Req.data.GetData());
 	m_pEntity->PostOnlineJS(ctx);
 }
 
@@ -283,7 +283,7 @@ void CardIssuerStoreServerSession::Handle_IssueFromBoxJS(SpReqAnsContext<CardIss
 {
 	LOG_FUNCTION();
 	DbgToBeidou(ctx->link, __FUNCTION__)();
-	DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke IssueFromBoxJS");
+	DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke IssueFromBoxJS, hopper:%d",ctx->Req.hopper);
 	m_pEntity->IssueFromBoxJS(ctx);
 }
 
@@ -292,7 +292,7 @@ void CardIssuerStoreServerSession::Handle_PreOnlineCrossJS(SpReqAnsContext<CardI
 {
 	LOG_FUNCTION();
 	DbgToBeidou(ctx->link, __FUNCTION__)();
-	DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke PreOnlineCrossJS");
+	DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke PreOnlineCrossJS, slot:%d, businessData:%s",ctx->Req.slot, ctx->Req.businessData.GetData());
 	m_pEntity->PreOnlineCrossJS(ctx);
 }
 
@@ -301,7 +301,7 @@ void CardIssuerStoreServerSession::Handle_ReadJS(SpReqAnsContext<CardIssuerStore
 {
 	LOG_FUNCTION();
 	DbgToBeidou(ctx->link, __FUNCTION__)();
-	DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke ReadJS");
+	DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke ReadJS, aid:%s, businessData:%s",ctx->Req.aid.GetData(), ctx->Req.businessData.GetData());
 	m_pEntity->ReadJS(ctx);
 }
 
@@ -319,7 +319,7 @@ void CardIssuerStoreServerSession::Handle_MoveCardFromSlotJS(SpReqAnsContext<Car
 {
 	LOG_FUNCTION();
 	DbgToBeidou(ctx->link, __FUNCTION__)();
-	DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke MoveCardFromSlotJS");
+	DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke MoveCardFromSlotJS, slot:%d",ctx->Req.slot);
 	m_pEntity->MoveCardFromSlotJS(ctx);
 }
 
@@ -331,9 +331,6 @@ void CCardIssuerEntity::OnSysVarEvent(const char* pszKey, const char* pszValue,
 	if ((_strnicmp(pszKey, "UIState", strlen("UIState")) == 0))
 	{
 		m_fsm.OnUIState4SetWhatPage(pszValue);
-		if (_strnicmp(pszValue, "M", strlen("M")) == 0) {
-			m_fsm.SetEnterMainPage();//设置进入首页
-		}
 	}
 }
 

+ 21 - 18
Module/mod_cardissuerstore/mod_cardissuer.h → Module/mod_cardissuerstore/mod_cardissuerStore.h

@@ -1,6 +1,6 @@
 #include "CardIssuerStore_server_g.h"
 #include "CardIssuerStore_def_g.h"
-#include "CardIssuerFSM.h"
+#include "CardIssuerStoreFSM.h"
 #include "DevEntityCommBase.hpp"
 using namespace CardIssuerStore;
 
@@ -215,7 +215,7 @@ public:
 	}
 	void SetSomeFlag(SpReqAnsContext<CardIssuerStoreService_SetSomeFlag_Req, CardIssuerStoreService_SetSomeFlag_Ans>::Pointer ctx)
 	{
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("set issue flag to %d", ctx->Req.IssueBusiness);
+		//DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("set issue flag to %d", ctx->Req.IssueBusiness);
 		if (ctx->Req.IssueBusiness == 1)
 			m_fsm.FrontSetIssueFlag(true);
 		else if (ctx->Req.IssueBusiness == 0)
@@ -300,7 +300,7 @@ public:
 	{
 		LOG_FUNCTION();
 		ctx->Ans.state = m_fsm.GetDevState();
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("GetDevInfo state=%d", ctx->Ans.state);
+		
 
 		if (m_fsm.GetDevInitingFlag()) {
 			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("GetDevInfo device is opening,state return 0");
@@ -315,6 +315,9 @@ public:
 				ctx->Answer(Error_DevNotAvailable, CardIssuerStore_UserErrorCode_DevOpen_Failed);
 			}
 			else {
+				if (ctx->Ans.state != DEVICE_STATUS_NORMAL) {
+					DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("GetDevInfo state=%d", ctx->Ans.state);
+				}
 				ctx->Answer(Error_Succeed);
 			}
 		}
@@ -336,7 +339,7 @@ public:
 			//不符合请求调用,告知具体错误流程
 			DWORD errCode = m_fsm.GetFsmStateErrCode();
 			int state = m_fsm.GetFSMState();
-			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("EjectJS req is unhandled ,CurrState=%d",state);
+			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode(m_fsm.getRTACode(errCode))("EjectJS req is unhandled ,CurrState=%d",state);
 			ctx->Answer(Error_Unexpect, errCode);
 		}
 		else {
@@ -361,7 +364,7 @@ public:
 			//不符合请求调用,告知具体错误流程
 			DWORD errCode = m_fsm.GetFsmStateErrCode();
 			int state = m_fsm.GetFSMState();
-			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("CaptureJS req is unhandled ,CurrState=%d", state);
+			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode(m_fsm.getRTACode(errCode))("CaptureJS req is unhandled ,CurrState=%d", state);
 			ctx->Answer(Error_Unexpect, errCode);
 		}
 	}
@@ -376,7 +379,7 @@ public:
 			//不符合请求调用,告知具体错误流程
 			DWORD errCode = m_fsm.GetFsmStateErrCode();
 			int state = m_fsm.GetFSMState();
-			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("ReadBatchCardInfoInRangeJS req is unhandled ,CurrState=%d", state);
+			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode(m_fsm.getRTACode(errCode))("ReadBatchCardInfoInRangeJS req is unhandled ,CurrState=%d", state);
 			ctx->Answer(Error_Unexpect, errCode);
 		}
 		else {
@@ -408,7 +411,7 @@ public:
 			//不符合请求调用,告知具体错误流程
 			DWORD errCode = m_fsm.GetFsmStateErrCode();
 			int state = m_fsm.GetFSMState();
-			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("AddAndReadCardFromBoxJS req is unhandled ,CurrState=%d", state);
+			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode(m_fsm.getRTACode(errCode))("AddAndReadCardFromBoxJS req is unhandled ,CurrState=%d", state);
 			ctx->Answer(Error_Unexpect, errCode);
 		}
 		else {
@@ -428,7 +431,7 @@ public:
 			//不符合请求调用,告知具体错误流程
 			DWORD errCode = m_fsm.GetFsmStateErrCode();
 			int state = m_fsm.GetFSMState();
-			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("AddCardFromBoxJS req is unhandled ,CurrState=%d", state);
+			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode(m_fsm.getRTACode(errCode))("AddCardFromBoxJS req is unhandled ,CurrState=%d", state);
 			ctx->Answer(Error_Unexpect, errCode);
 		}
 		else {
@@ -448,7 +451,7 @@ public:
 			//不符合请求调用,告知具体错误流程
 			DWORD errCode = m_fsm.GetFsmStateErrCode();
 			int state = m_fsm.GetFSMState();
-			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("MoveAndReadCardFromSlotJS req is unhandled ,CurrState=%d", state);
+			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode(m_fsm.getRTACode(errCode))("MoveAndReadCardFromSlotJS req is unhandled ,CurrState=%d", state);
 			ctx->Answer(Error_Unexpect, errCode);
 		}
 		else {
@@ -468,7 +471,7 @@ public:
 			//不符合请求调用,告知具体错误流程
 			DWORD errCode = m_fsm.GetFsmStateErrCode();
 			int state = m_fsm.GetFSMState();
-			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("MoveCardFromSlotJS req is unhandled ,CurrState=%d", state);
+			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode(m_fsm.getRTACode(errCode))("MoveCardFromSlotJS req is unhandled ,CurrState=%d", state);
 			ctx->Answer(Error_Unexpect, errCode);
 		}
 		else {
@@ -488,7 +491,7 @@ public:
 			//不符合请求调用,告知具体错误流程
 			DWORD errCode = m_fsm.GetFsmStateErrCode();
 			int state = m_fsm.GetFSMState();
-			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("MoveBacktoSlotJS req is unhandled ,CurrState=%d", state);
+			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode(m_fsm.getRTACode(errCode))("MoveBacktoSlotJS req is unhandled ,CurrState=%d", state);
 			ctx->Answer(Error_Unexpect, errCode);
 		}
 		else {
@@ -521,7 +524,7 @@ public:
 			//不符合请求调用,告知具体错误流程
 			DWORD errCode = m_fsm.GetFsmStateErrCode();
 			int state = m_fsm.GetFSMState();
-			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("ICCommandJS req is unhandled ,CurrState=%d", state);
+			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode(m_fsm.getRTACode(errCode))("ICCommandJS req is unhandled ,CurrState=%d", state);
 			ctx->Answer(Error_Unexpect, errCode);
 		}
 		else {
@@ -541,7 +544,7 @@ public:
 			//不符合请求调用,告知具体错误流程
 			DWORD errCode = m_fsm.GetFsmStateErrCode();
 			int state = m_fsm.GetFSMState();
-			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("WriteTrackJS req is unhandled ,CurrState=%d", state);
+			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode(m_fsm.getRTACode(errCode))("WriteTrackJS req is unhandled ,CurrState=%d", state);
 			ctx->Answer(Error_Unexpect, errCode);
 		}
 		else {
@@ -561,7 +564,7 @@ public:
 			//不符合请求调用,告知具体错误流程
 			DWORD errCode = m_fsm.GetFsmStateErrCode();
 			int state = m_fsm.GetFSMState();
-			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("PrintCardImmediatelyJS req is unhandled ,CurrState=%d", state);
+			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode(m_fsm.getRTACode(errCode))("PrintCardImmediatelyJS req is unhandled ,CurrState=%d", state);
 			ctx->Answer(Error_Unexpect, errCode);
 		}
 		else {
@@ -581,7 +584,7 @@ public:
 			//不符合请求调用,告知具体错误流程
 			DWORD errCode = m_fsm.GetFsmStateErrCode();
 			int state = m_fsm.GetFSMState();
-			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("PostOnlineJS req is unhandled ,CurrState=%d", state);
+			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode(m_fsm.getRTACode(errCode))("PostOnlineJS req is unhandled ,CurrState=%d", state);
 			ctx->Answer(Error_Unexpect, errCode);
 		}
 		else {
@@ -601,7 +604,7 @@ public:
 			//不符合请求调用,告知具体错误流程
 			DWORD errCode = m_fsm.GetFsmStateErrCode();
 			int state = m_fsm.GetFSMState();
-			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("IssueFromBoxJS req is unhandled ,CurrState=%d", state);
+			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode(m_fsm.getRTACode(errCode))("IssueFromBoxJS req is unhandled ,CurrState=%d", state);
 			ctx->Answer(Error_Unexpect, errCode);
 		}
 		else {
@@ -625,7 +628,7 @@ public:
 			//不符合请求调用,告知具体错误流程
 			DWORD errCode = m_fsm.GetFsmStateErrCode();
 			int state = m_fsm.GetFSMState();
-			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("PreOnlineCrossJS req is unhandled ,CurrState=%d", state);
+			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode(m_fsm.getRTACode(errCode))("PreOnlineCrossJS req is unhandled ,CurrState=%d", state);
 			ctx->Answer(Error_InvalidState, CardIssuerStore_UserErrorCode_CardActive_CardStore_Issuing);
 			return;
 		}
@@ -651,7 +654,7 @@ public:
 			//不符合请求调用,告知具体错误流程
 			DWORD errCode = m_fsm.GetFsmStateErrCode();
 			int state = m_fsm.GetFSMState();
-			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("ReadJS req is unhandled ,CurrState=%d", state);
+			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode(m_fsm.getRTACode(errCode))("ReadJS req is unhandled ,CurrState=%d", state);
 			ctx->Answer(Error_Unexpect, errCode);
 		}
 		else {

+ 6 - 1
Module/mod_chromium/ReadMe.md

@@ -22,4 +22,9 @@
 # GetVar
 * {"messageType":13,"transID":310,"name":"TerminalStage"}
 # GetVarAck
-{"messageType":14,"sessionID":-1,"transID":258,"errorCode":0,"value":"M"}
+* {"messageType":14,"sessionID":-1,"transID":258,"errorCode":0,"value":"M"}
+
+# SetVar
+* {"messageType": 11, "transID": 310, "name": "UIState", "value": "M"}
+# SetVarAck
+{"messageType":12,"sessionID":-1,"transID":310,"errorCode":0,"errorMsg":""}

+ 49 - 0
Module/mod_guiconsole/GUIConsole_client_g.h

@@ -744,6 +744,55 @@ public:
 		return Error;
 	}
 
+	ErrorCodeEnum ReservedCall(GUIConsoleService_ReservedCall_Req &Req, CSmartPointer<IAsynWaitSp> &spAsyncWait, DWORD dwTimeout)
+	{
+		CSmartPointer<IClientSessionFunction> pFunc = GetFunction();
+		CAutoBuffer Buf = SpObject2Buffer(Req);
+		if (m_context.checkEmpty())
+		{
+			m_context.AutoGenerate();
+			DbgToBeidou(m_context, m_pEntityBase != NULL ? m_pEntityBase->GetEntityName() : "")();
+			m_context = m_context.upgradeLink();
+		}
+		auto ret = pFunc->AsyncRequest(GUIConsoleService_Method_ReservedCall, GUIConsoleService_MethodSignature_ReservedCall, Buf, spAsyncWait, m_context, dwTimeout);
+		m_context.clear();
+		return ret;
+	}
+	ErrorCodeEnum ReservedCall(GUIConsoleService_ReservedCall_Req &Req, GUIConsoleService_ReservedCall_Ans &Ans, DWORD dwTimeout)
+	{
+		CSmartPointer<IAsynWaitSp> spAsyncWait;
+		ErrorCodeEnum Error = ReservedCall(Req, spAsyncWait, dwTimeout);
+		if (Error == Error_Succeed) {
+			bool bEnd = false;
+			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwTimeout);
+			LOG_ASSERT(Error || bEnd);
+		}
+		return Error;
+	}
+	ErrorCodeEnum ReservedCall(GUIConsoleService_ReservedCall_Req &Req, GUIConsoleService_ReservedCall_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError, CSimpleString &str)
+	{
+		CSmartPointer<IAsynWaitSp> spAsyncWait;
+		ErrorCodeEnum Error = ReservedCall(Req, spAsyncWait, dwTimeout);
+		if (Error == Error_Succeed) {
+			bool bEnd = false;
+			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
+			LOG_ASSERT(Error || bEnd);
+		}
+		return Error;
+	}
+	ErrorCodeEnum ReservedCall(GUIConsoleService_ReservedCall_Req &Req, GUIConsoleService_ReservedCall_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError)
+	{
+		CSmartPointer<IAsynWaitSp> spAsyncWait;
+		ErrorCodeEnum Error = ReservedCall(Req, spAsyncWait, dwTimeout);
+		if (Error == Error_Succeed) {
+			bool bEnd = false;
+			CSimpleString str;
+			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
+			LOG_ASSERT(Error || bEnd);
+		}
+		return Error;
+	}
+
 
 	bool SafeDelete()
 	{

+ 36 - 0
Module/mod_guiconsole/GUIConsole_def_g.h

@@ -26,6 +26,7 @@ namespace GUIConsole {
 #define GUIConsoleService_Method_GetHelpDetail 11
 #define GUIConsoleService_Method_OpenCommonPage 12
 #define GUIConsoleService_Method_CloseCommonPage 13
+#define GUIConsoleService_Method_ReservedCall 14
 
 #define GUIConsoleService_MethodSignature_OpenLogSender -744778557
 #define GUIConsoleService_MethodSignature_CloseLogSender -1838250527
@@ -41,6 +42,7 @@ namespace GUIConsole {
 #define GUIConsoleService_MethodSignature_GetHelpDetail -45426198
 #define GUIConsoleService_MethodSignature_OpenCommonPage 15213547
 #define GUIConsoleService_MethodSignature_CloseCommonPage 1463237030
+#define GUIConsoleService_MethodSignature_ReservedCall -1877416012
 
 #define GUIConsoleService_LogCode_OpenLogSender "QLR040250800"
 #define GUIConsoleService_LogCode_CloseLogSender "QLR040250801"
@@ -56,6 +58,7 @@ namespace GUIConsole {
 #define GUIConsoleService_LogCode_GetHelpDetail "QLR040250811"
 #define GUIConsoleService_LogCode_OpenCommonPage "QLR040250812"
 #define GUIConsoleService_LogCode_CloseCommonPage "QLR040250813"
+#define GUIConsoleService_LogCode_ReservedCall "QLR040250814"
 
 struct GUIConsoleService_OpenLogSender_Req
 {
@@ -427,6 +430,39 @@ struct GUIConsoleService_CloseCommonPage_Ans
 
 };
 
+struct GUIConsoleService_ReservedCall_Req
+{
+	CSimpleStringA reqType;
+	CSimpleStringA reqStr1;
+	CSimpleStringA reqStr2;
+	CSimpleStringA reqStr3;
+	int reqInt1;
+	int reqInt2;
+	int reqInt3;
+
+	void Serialize(SpBuffer &Buf)
+	{
+		auto & buf = Buf & reqType & reqStr1 & reqStr2 & reqStr3 & reqInt1 & reqInt2 & reqInt3;
+	}
+
+};
+
+struct GUIConsoleService_ReservedCall_Ans
+{
+	CSimpleStringA retStr1;
+	CSimpleStringA retStr2;
+	CSimpleStringA retStr3;
+	int retInt1;
+	int retInt2;
+	int retInt3;
+
+	void Serialize(SpBuffer &Buf)
+	{
+		auto & buf = Buf & retStr1 & retStr2 & retStr3 & retInt1 & retInt2 & retInt3;
+	}
+
+};
+
 
 ///////////////////////////
 

+ 27 - 0
Module/mod_guiconsole/GUIConsole_server_g.h

@@ -128,6 +128,13 @@ public:
 				Error = Error_MethodSignatureFailed;
 			}
 			break;
+		case GUIConsoleService_Method_ReservedCall:
+			if (dwSignature == GUIConsoleService_MethodSignature_ReservedCall) {
+				bOverlap = true;
+			} else {
+				Error = Error_MethodSignatureFailed;
+			}
+			break;
 		default:
 			Error = Error_MethodNotFound;
 			break;
@@ -209,6 +216,11 @@ public:
 				Error = Error_MethodSignatureFailed;
 			}
 			break;
+		case GUIConsoleService_Method_ReservedCall:
+			if (dwSignature != GUIConsoleService_MethodSignature_ReservedCall) {
+				Error = Error_MethodSignatureFailed;
+			}
+			break;
 		default:
 			Error = Error_MethodNotFound;
 			break;
@@ -286,6 +298,11 @@ public:
 	/// override by user
 	}
 
+	virtual void Handle_ReservedCall(SpReqAnsContext<GUIConsoleService_ReservedCall_Req, GUIConsoleService_ReservedCall_Ans>::Pointer ctx)
+	{
+	/// override by user
+	}
+
 	virtual void OnRequest(CSmartPointer<ITransactionContext> pTransactionContext)
 	{
 		CAutoBuffer Buf;
@@ -442,6 +459,16 @@ public:
 						Handle_CloseCommonPage(ctx);
 					}
 					break;
+				case GUIConsoleService_Method_ReservedCall:
+					{
+						SpReqAnsContext<GUIConsoleService_ReservedCall_Req,GUIConsoleService_ReservedCall_Ans>::Pointer ctx;
+						ctx.Attach(new SpReqAnsContext<GUIConsoleService_ReservedCall_Req,GUIConsoleService_ReservedCall_Ans>(pTransactionContext));
+						SpBuffer2Object(Buf, ctx->Req);
+						pTransactionContext->GetLinkContext(ctx->link);
+						EntityResource::setLink(ctx->link);
+						Handle_ReservedCall(ctx);
+					}
+					break;
 				default:
 					assert(0);
 					break;

+ 19 - 0
Module/mod_guiconsole/GuiConsole.xml

@@ -282,6 +282,25 @@
 				<param name="additionalMsg" type="string"/>
 			</res>
 		</twoway>
+		<twoway name="ReservedCall" overlap="true" simpleret="true">
+			<req>
+				<param name="reqType" type="string"/>
+				<param name="reqStr1" type="string"/>
+				<param name="reqStr2" type="string"/>
+				<param name="reqStr3" type="string"/>
+				<param name="reqInt1" type="int"/>
+				<param name="reqInt2" type="int"/>
+				<param name="reqInt3" type="int"/>
+			</req>
+			<res>
+				<param name="retStr1" type="string"/>
+				<param name="retStr2" type="string"/>
+				<param name="retStr3" type="string"/>
+				<param name="retInt1" type="int"/>
+				<param name="retInt2" type="int"/>
+				<param name="retInt3" type="int"/>
+			</res>
+		</twoway>
 	</class>
 	
 	

+ 2 - 0
Module/mod_guiconsole/mod_GuiConsole.h

@@ -45,6 +45,8 @@ public:
 	virtual void Handle_OpenCommonPage(SpReqAnsContext<GUIConsoleService_OpenCommonPage_Req, GUIConsoleService_OpenCommonPage_Ans>::Pointer ctx);
 
 	virtual void Handle_CloseCommonPage(SpReqAnsContext<GUIConsoleService_CloseCommonPage_Req, GUIConsoleService_CloseCommonPage_Ans>::Pointer ctx);
+
+	virtual void Handle_ReservedCall(SpReqAnsContext<GUIConsoleService_ReservedCall_Req, GUIConsoleService_ReservedCall_Ans>::Pointer ctx);
 private:
 	CGUIConsoleEntity* m_pEntity;
 };

+ 44 - 0
Module/mod_guiconsole/mod_guiconsole.cpp

@@ -1045,6 +1045,50 @@ void CGUIConsoleSession::Handle_CloseCommonPage(SpReqAnsContext<GUIConsoleServic
 		ctx->Answer(ErrorCodeEnum::Error_Unexpect);
 }
 
+void CGUIConsoleSession::Handle_ReservedCall(SpReqAnsContext<GUIConsoleService_ReservedCall_Req, GUIConsoleService_ReservedCall_Ans>::Pointer ctx)
+{
+	LOG_FUNCTION();
+	DbgToBeidou(ctx->link, __FUNCTION__)();
+
+	if(ctx->Req.reqType == "multi_answer")
+	{
+		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("test answer multi times");
+		ctx->Answer(ErrorCodeEnum::Error_Succeed);
+		ctx->Answer(ErrorCodeEnum::Error_Succeed);
+	}
+	else if(ctx->Req.reqType == "test_timeout")
+	{
+		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("test timeout");
+		std::this_thread::sleep_for(std::chrono::seconds(10));
+		ctx->Answer(ErrorCodeEnum::Error_Succeed);
+	}
+	else if(ctx->Req.reqType == "test_longLog")
+	{
+		int srcLen = 2000;
+		int dstLen = 3000;
+		for(int i = srcLen; i < dstLen; i++)
+		{
+			CSimpleString len = CSimpleString::Format("%d,", i);
+			std::string src(i - len.GetLength(), 'a');
+			len += src.c_str();
+			DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("%s", len);
+		}
+		ctx->Answer(ErrorCodeEnum::Error_Succeed);
+	}
+	else if(ctx->Req.reqType == "test_firewall")
+	{
+		CSimpleStringA rootVerPath;
+		ErrorCodeEnum rc = m_pEntity->GetFunction()->GetPath("RootVer", rootVerPath);//获取version根路径
+		CSimpleStringA strNewVerPath = CSimpleStringA::Format("%s" "\\" "%s", rootVerPath.GetData(), "7.5.1.1");
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("SetNewVersionPathToFirewall path = %s", strNewVerPath.GetData());
+		m_pEntity->GetFunction()->SetNewPathToFirewall(strNewVerPath);
+		ctx->Answer(ErrorCodeEnum::Error_Succeed);
+	}
+
+	
+}
+
+
 CSimpleString CGUIConsoleEntity::getRunVersion()
 {
 	static CSimpleStringA activeVer;

+ 1 - 1
Other/libRestfulFunc/RestfulFunc.h

@@ -215,7 +215,7 @@ private:
     bool m_withToken;
     bool mToValidCert;
     uint32_t mTimeoutSecs;
-    restFul_GetTokenCallBack g_tokenCall;
+    volatile restFul_GetTokenCallBack g_tokenCall;
     void InitGetToken(restFul_GetTokenCallBack t_getToken) {
         if (t_getToken)
         {

部分文件因文件數量過多而無法顯示