Преглед изворни кода

Merge branch 'feature_fingerPrint_js' of https://gitee.paas.cmbchina.cn/QD_RemoteBankArea/LR04.02_RVCTerminalPlus into feature_fingerPrint_js

chenliangyu пре 4 месеци
родитељ
комит
7f279fc608
69 измењених фајлова са 776 додато и 3683 уклоњено
  1. 2 2
      Module/CMakeLists.txt
  2. 0 31
      Module/mod_CenterSetting/CMakeLists.txt
  3. 0 795
      Module/mod_CenterSetting/CenterSettingConn.cpp
  4. 0 198
      Module/mod_CenterSetting/CenterSettingConn.h
  5. 0 42
      Module/mod_CenterSetting/CenterSettingService.xml
  6. 0 255
      Module/mod_CenterSetting/CenterSetting_client_g.h
  7. 0 131
      Module/mod_CenterSetting/CenterSetting_def_g.h
  8. 0 218
      Module/mod_CenterSetting/CenterSetting_server_g.h
  9. 0 4
      Module/mod_CenterSetting/ChangeLog
  10. 0 19
      Module/mod_CenterSetting/Event.h
  11. 0 239
      Module/mod_CenterSetting/mod_centersetting.cpp
  12. 0 105
      Module/mod_CenterSetting/mod_centersetting.h
  13. 0 3
      Module/mod_CenterSetting/test/testCenterSettingEntity.cpp
  14. 35 0
      Module/mod_HSPScanner/HSPSCanner_LogCode.h
  15. 0 4
      Module/mod_HSPScanner/HSPSCanner_UserErrorCode.h
  16. 42 17
      Module/mod_HSPScanner/HSPScannerFSM.cpp
  17. 70 304
      Module/mod_IDCertificate/IDCertFSM.cpp
  18. 1 2
      Module/mod_IDCertificate/IDCertFSM.h
  19. 11 0
      Module/mod_IDCertificate/IDCertificate_LogCode.h
  20. 0 6
      Module/mod_IDCertificate/IDCertificate_UserErrorCode.h
  21. 0 2
      Module/mod_SalesRecorder/CMakeLists.txt
  22. 28 184
      Module/mod_SalesRecorder/mod_SalesRecorder.cpp
  23. 2 19
      Module/mod_SalesRecorder/mod_SalesRecorder.h
  24. 3 3
      Module/mod_counterconnector/http_callrouter.cpp
  25. 0 1
      Module/mod_counterconnector/mod_counterconnector.cpp
  26. 2 2
      Module/mod_countercontext/mod_countercontext.cpp
  27. 1 1
      Module/mod_customeraware/CustomerHandleFSM.cpp
  28. 2 2
      Module/mod_facetracking/mod_facetracking.cpp
  29. 1 1
      Module/mod_gpio/GpioFSM.cpp
  30. 1 0
      Module/mod_healthmanager/HealthManagerFSM.cpp
  31. 1 1
      Module/mod_healthmanager/HealthManagerFSM.h
  32. 0 4
      Module/mod_healthmanager/mod_healthmanager.cpp
  33. 15 12
      Module/mod_interactivecontrol/mod_interactivecontrol.cpp
  34. 1 4
      Module/mod_livenessdetection/RvcFaceVideo.cpp
  35. 2 3
      Module/mod_livenessdetection/mod_livenessdetection.cpp
  36. 1 0
      Module/mod_mediacontroller/Event.h
  37. 39 21
      Module/mod_mediacontroller/capture.cpp
  38. 8 3
      Module/mod_mediacontroller/capture.h
  39. 75 60
      Module/mod_mediacontroller/mod_mediacontroller.cpp
  40. 2 1
      Module/mod_mediacontroller/mod_mediacontroller.h
  41. 13 10
      Module/mod_pinpad/PinPadFSM.cpp
  42. 30 45
      Module/mod_recorder/mod_recorder.cpp
  43. 1 1
      Module/mod_recorder/recordinfo.cpp
  44. 1 1
      Module/mod_sipphone/audio_session.cpp
  45. 0 2
      Module/mod_sipphone/mod_sipphone.cpp
  46. 50 12
      Module/mod_vtmloader/VtmLoaderFSM.cpp
  47. 31 1
      Module/mod_vtmloader/VtmLoaderFSM.h
  48. 2 1
      Module/mod_vtmloader/VtmLoader_UserCode.h
  49. 1 1
      Module/mod_vtmloader/mod_vtmloader.h
  50. 41 4
      Other/libaudioqueue/libaudioqueue.cpp
  51. 3 1
      Other/libaudioqueue/libaudioqueue.h
  52. 9 47
      Other/libfacecapture/libfacecapture.cpp
  53. 23 23
      Other/libfilecryption/filecryption.cpp
  54. 5 4
      Other/libfilecryption/filecryption.h
  55. 9 9
      Other/libfilecryption/mp4info.cpp
  56. 3 3
      Other/libfilecryption/rvcfileheader.cpp
  57. 41 41
      Other/libvideorecord/FFmpegWriter.cpp
  58. 3 2
      Other/libvideorecord/libvideorecord.h
  59. 40 25
      Other/libvideorecord/libvideorecord_impl.cpp
  60. 0 3
      Other/unix/libvideocapture/linux/videocapture_linux.cpp
  61. 0 101
      addin/res/ManagerDesktop/audioErr.html
  62. 7 7
      addin/res/ManagerDesktop/css/errType.css
  63. 0 101
      addin/res/ManagerDesktop/entityCheck.html
  64. 0 101
      addin/res/ManagerDesktop/homePageErr.html
  65. 6 40
      addin/res/ManagerDesktop/js/getTerminalInfo.js
  66. 2 286
      addin/res/ManagerDesktop/js/initPsd.js
  67. 3 10
      addin/res/ManagerDesktop/js/navOprator.js
  68. 1 102
      addin/res/ManagerDesktop/serverNoAccess.html
  69. 106 0
      addin/res/ManagerDesktop/upgradeRestart.html

+ 2 - 2
Module/CMakeLists.txt

@@ -152,7 +152,7 @@ add_subdirectory(mod_healthmanager)
 add_subdirectory(mod_accessauth)
 #will be offline in future cly said
 add_subdirectory(mod_guiconsole)
-add_subdirectory(mod_CenterSetting)
+#add_subdirectory(mod_CenterSetting)
 add_subdirectory(mod_tokenmgr)
 add_subdirectory(mod_evtconverter)
 #zhaohu
@@ -213,7 +213,7 @@ add_subdirectory(mod_upload)
 add_subdirectory(mod_healthmanager)
 add_subdirectory(mod_accessauth)
 add_subdirectory(mod_guiconsole)
-add_subdirectory(mod_CenterSetting)
+#add_subdirectory(mod_CenterSetting)
 add_subdirectory(mod_tokenmgr)
 add_subdirectory(mod_evtconverter)
 #add_subdirectory(mod_interactivelog)

+ 0 - 31
Module/mod_CenterSetting/CMakeLists.txt

@@ -1,31 +0,0 @@
-define_module("CenterSetting")
-
-set(${MODULE_PREFIX}_SRCS
-	CenterSettingConn.cpp
-	CenterSettingConn.h
-	mod_centersetting.cpp
-	mod_centersetting.h
-	)
-
-set(MOD_VERSION_STRING "0.0.1-dev1")
-add_module_libraries(${MODULE_PREFIX} ${MODULE_NAME} ${MOD_VERSION_STRING})
-
-target_include_directories(${MODULE_NAME} PRIVATE
-	${RVC_TOOLKIT_INCLUDE_DIR}
-	${OTHER_LIB_BASE_DIR}/libpublicFun
-	${OTHER_LIB_BASE_DIR}/libRestfulFunc
-	${CONAN_INCLUDE_DIRS_JSONCPP}
-)
-
-set(CMAKE_CXX_FLAGS "${CMAK_CXX_FLAGS} -g3")
-
-target_link_directories(${MODULE_NAME} PRIVATE
-	${CONAN_LIB_DIRS_JSONCPP}
-)
-
-# 添加实体需要依赖的其他共享库(包括系统库)
-set(${MODULE_PREFIX}_LIBS ${MODULE_BASE_LIBS} ${RVCCOMM_LIB})
-target_link_libraries(${MODULE_NAME} 
-	${${MODULE_PREFIX}_LIBS} CONAN_PKG::OpenSSL libpublicFun ${CONAN_PKG_LIBS_JSONCPP})
-
-deploy_module(${MODULE_PREFIX} ${MODULE_NAME})

+ 0 - 795
Module/mod_CenterSetting/CenterSettingConn.cpp

@@ -1,795 +0,0 @@
-#include "stdafx.h"
-#include "CenterSettingConn.h"
-#include "Event.h"
-#include <map>
-#include <regex>
-using namespace std;
-using std::regex;
-#include "mod_centersetting.h"
-#include <iostream>
-#include <sys/types.h> 
-#include <sys/stat.h>
-#include <fstream>
-#include "fileutil.h"
-#pragma comment(lib, "crypt32.lib")
-
-#ifdef RVC_OS_LINUX
-#include "CommEntityUtil.hpp"
-#include "iniutil.h"
-#include "json/json.h"
-#include "CommEntityRestful.hpp"
-#include "SpUtility.h"
-#include "RVCComm.h"
-#endif //RVC_OS_WIN
-
-#ifdef RVC_OS_WIN
-char* ConvertUtf8ToGBK(const char* strUtf8)
-{
-	int len = MultiByteToWideChar(CP_UTF8, 0, strUtf8, -1, NULL, 0);
-	WCHAR* wszGBK = new WCHAR[len + 1];
-	memset(wszGBK, 0, len * 2 + 2);
-	MultiByteToWideChar(CP_UTF8, 0, strUtf8, -1, wszGBK, len);
-
-	len = WideCharToMultiByte(CP_ACP, 0, wszGBK, -1, NULL, 0, NULL, NULL);
-	char* szGBK = new char[len + 1];
-	memset(szGBK, 0, len + 1);
-	WideCharToMultiByte(CP_ACP, 0, wszGBK, -1, szGBK, len, NULL, NULL);
-	delete[] wszGBK;
-
-	return szGBK;
-}
-
-void ConvertUtf8ToGBK(std::string& str)
-{
-	char* dst = ConvertUtf8ToGBK(str.c_str());
-	str = dst;
-	delete[] dst;
-}
-
-char* ConvertGBKToUtf8(const char* gbk, int* n)
-{
-	int len = MultiByteToWideChar(CP_ACP, 0, gbk, -1, NULL, 0);
-	WCHAR* wszGBK = new WCHAR[len + 1];
-	memset(wszGBK, 0, len * 2 + 2);
-	MultiByteToWideChar(CP_ACP, 0, gbk, -1, wszGBK, len);
-
-	len = WideCharToMultiByte(CP_UTF8, 0, wszGBK, -1, NULL, 0, NULL, NULL);
-	char* szUtf8 = new char[len + 1];
-	memset(szUtf8, 0, len + 1);
-	WideCharToMultiByte(CP_UTF8, 0, wszGBK, -1, szUtf8, len, NULL, NULL);
-
-	delete[] wszGBK;
-	*n = len - 1;
-	return szUtf8;
-}
-
-void ConvertGBKToUtf8(std::string& str)
-{
-	//char *src = new char[str.length() + 1];
-	//strncpy(src, str.c_str(), str.length() + 1);
-	int len = 0;
-	char* dst = ConvertGBKToUtf8(str.c_str(), &len);
-
-	str = dst;
-	//delete[] src;
-	delete[] dst;
-}
-
-static char* ConvertBytesToHexStr(BYTE *pBuf, int nLen)
-{
-	char *pRet = (char*)malloc(nLen * 2 + 1);
-	memset(pRet, 0, nLen * 2 + 1);
-	char *p = pRet;
-	for (int i = 0; i < nLen; i++)
-	{
-		BYTE b = pBuf[i];
-		BYTE l = (b >> 4) & 0x0F;
-		if (l >= 10)
-			*p = l - 10 + 'a';
-		else
-			*p = l + '0';
-
-		p++;
-		BYTE r = b & 0x0F;
-		if (r >= 10)
-			*p = r - 10 + 'a';
-		else
-			*p = r + '0';
-		p++;
-	}
-
-	return pRet;
-}
-#endif //RVC_OS_WIN
-
-void convert(string& str)
-{
-    //将单斜杠转为双斜杠
-    for (size_t i = 0; i < str.size(); i++) {
-        if (str[i] == '\\') {
-            str.insert(i, string("\\"));
-            i++;
-        }
-    }
-}
-
-void transferblank(string& str)
-{
-    int oldLen = str.length();
-    int cnt = 0;
-    for(int idx = 0; idx < oldLen; idx++)
-    {
-        if(str[idx] == ' ')
-            cnt++;
-    }
-
-    str.resize(oldLen + cnt * 2);
-    int j = oldLen - 1;
-    int i = str.length() - 1;
-    while( i >= 0 )
-    {
-        if(str[j] == ' ')
-        {
-            str[i--] = '0';
-            str[i--] = '2';
-            str[i--] = '%';
-            j--;
-        }
-        else
-        {
-            str[i--] = str[j--];
-        }
-    }
-}
-
-#ifndef  WITH_CPPRESTSDK_IN_CENTER
-bool CenterSettingResponse::Parse(string strData)
-{
-    Json::Value root;
-    Json::Reader reader;
-    Json::Value arrConfig;
-
-    reader.parse(strData, root, false);
-
-    m_success = root["success"].asBool();
-
-    if(m_success)
-    {
-        m_message = root["message"].asString();
-        m_is_update = root["data"]["is_update"].asBool();
-        m_is_reset = root["data"]["is_reset"].asBool();
-        m_version_no = root["data"]["version_no"].asString();
-        transferblank(m_version_no);
-        DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("m_version_no:%s", m_version_no.c_str());
-        DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("m_is_reset:%d", m_is_reset ? 1 : 0);
-        m_sm3 = root["data"]["sm3"].asString();
-        m_strConfig = root["data"]["config"].asString();
-
-        if(m_is_update)
-        {
-            reader.parse(m_strConfig, arrConfig, false);
-            if(arrConfig.isArray())
-            {
-                for(int j = 0; j < arrConfig.size(); j++)
-                {
-                    ConfigItem configItem;
-
-                    configItem.m_moudle = arrConfig[j]["moudle"].asString();
-                    configItem.m_name = arrConfig[j]["name"].asString();
-                    configItem.m_value = arrConfig[j]["value"].asString();
-
-                    m_config.push_back(configItem);
-                }
-            }
-        }
-    }
-    return true;
-}
-#endif
-
-bool AddVersionResponse::Parse(string strData)
-{
-    Json::Value root;
-    Json::Reader reader;
-    reader.parse(strData, root, false);
-    m_success = root["success"].asBool();
-    return m_success;
-}
-
-CenterSettingsMicroServiceHelper::CenterSettingsMicroServiceHelper(CEntityBase* pEntity)
-    :m_pEntity(pEntity), m_strLastTime(true), m_strCurSite(true), m_arrKeys(NULL), m_arrURLs(NULL), m_isFirst(true)
-{
-    m_pEntity->GetFunction()->OpenConfig(Config_CenterSetting, m_pCenterConfig);
-    m_pEntity->GetFunction()->OpenConfig(Config_Run, m_pRunConfig);
-
-    m_pEntity->GetFunction()->GetSystemStaticInfo(m_terminalInfo);
-    m_pHttpFunc = create_http(HTTPLogCallback);
-
-    InitCenterSettingInfo();
-}
-
-#ifdef RVC_OS_WIN
-int CenterSettingsMicroServiceHelper::GetCenterSetting()
-{
-#else
-int CenterSettingsMicroServiceHelper::GetCenterSetting(bool byHand)
-{
-#endif
-    LOG_FUNCTION();
-
-    if(m_strUrl.IsNullOrEmpty() && m_urlsFromShell.size() <= 0)
-    {
-        m_strErrMsg = "集中配置服务地址不存在";
-        return AllAddressNull;
-    }
-
-    CenterSettingReq req;
-    CenterSettingResponse res;
-    req.m_terminal_no = m_terminalInfo.strTerminalID.GetData();
-
-    DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("m_strFilePath:%s", m_strFilePath.GetData());
-#ifdef RVC_OS_WIN
-	if(!ExistsFile(m_strFilePath))
-	{
-		Dbg("!ExistsFile(m_strFilePath)");
-#else
-if ((byHand && !m_isFirst) || !ExistsFile(m_strFilePath)) 
-    {
-        if (byHand && !m_isFirst && ExistsFileA(m_strFilePath)) {
-            LogWarn(Severity_Low, Error_Debug, EVENT_MOD_CENTERSETTING_UPDATE_CENTER_FORCE, "尝试强制重新下载集中配置");
-        }
-#endif
-        req.m_version = "";
-        req.m_config = "";
-    }
-    else
-    {
-#ifdef RVC_OS_LINUX
-if (m_isFirst) //如果是第一次更新则强制下载集中配置
-        {
-            req.m_version = "";
-            req.m_config = "";
-        }
-        else
-#endif
-        {
-            req.m_version = m_strVersion.GetData();
-            req.m_config = GetLocalConfig();
-        }
-    }
-
-    if(m_isFirst) m_isFirst = false;
-
-    DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("m_strVersion:%s", req.m_version.c_str());
-    req.m_update_time = GetUpdateTime();
-    GetTimeoutValue(req.m_timeOut);
-
-    DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM).setAPI("GetCenterSetting")(CSimpleStringA::Format("timeout:%d", req.m_timeOut));
-
-    int ret1 = MANUAL, ret2 = MANUAL;
-    if(!m_strUrl.IsNullOrEmpty())
-    {
-        req.m_url = m_strUrl;
-        m_strCurUrl = req.m_url;
-        req.m_url += "?update_time=" + req.m_update_time + "&terminal_no=" + req.m_terminal_no + "&version=" + req.m_version;
-#ifdef RVC_OS_WIN
-		ret1 = OnRequest(req, res, m_strErrMsg);
-#else
-        ret1 = GetCenterSettingsFromHttp(req, m_strErrMsg);
-#endif
-    }
-    else
-    {
-        DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("GetCenterSetting")("集中配置文件中地址为空,使用默认地址");
-    }
-
-    if(SUCC != ret1 && ret1 != EXIST)
-    {
-
-        if(m_urlsFromShell.size() <= 0)
-        {
-            DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("GetCenterSetting")("shell.ini中找不到集中配置地址");
-            return ret1;
-        }
-
-        for(int i = 0; i < m_urlsFromShell.size(); i++)
-        {
-            req.m_url = m_urlsFromShell[i].GetData();
-            m_strCurUrl = m_urlsFromShell[i].GetData();
-            req.m_url += "?update_time=" + req.m_update_time + "&terminal_no=" + req.m_terminal_no + "&version=" + req.m_version;
-#ifdef RVC_OS_WIN
-			ret2 = OnRequest(req, res);
-			if(ret2 == SUCC)
-				break;
-#else
-            ret1 = GetCenterSettingsFromHttp(req, m_strErrMsg);
-            if (ret1 == SUCC || ret1 == EXIST)
-                break;
-#endif
-        }
-    }
-	
-#ifdef RVC_OS_WIN
-    if(SUCC == ret1 || SUCC == ret2)
-	{
-		if(!res.m_is_update)
-		{
-			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("GetCenterSetting")("Centersetting not changed.");
-			m_strErrMsg = "集中配置已是最新版本";
-			return EXIST;
-		}
-
-		if(WriteToConfig(res))
-		{
-			m_strVersion = res.m_version_no.c_str();
-			Dbg("WriteToConfig m_strVersion:%s", m_strVersion.GetData());
-			m_pEntity->GetFunction()->OpenConfig(Config_CenterSetting, m_pCenterConfig, true);
-			m_pRunConfig->WriteConfigValue("CenterSetting", "version", m_strVersion);
-			UpdateVersion();
-			if(res.m_is_reset)
-				LogEvent(Severity_Middle, EVENT_MOD_CENTERSETTING_CRITICAL_UPDATE, "Update centersetting with critical items.");
-			
-			return SUCC;
-		}
-	}
-#endif	
-
-    return ret1;
-}
-
-void CenterSettingsMicroServiceHelper::InitCenterSettingInfo()
-{
-    CSmartPointer<IConfigInfo> shellConfig;
-    m_pEntity->GetFunction()->OpenConfig(Config_Shell, shellConfig);
-
-    m_pCenterConfig->ReadConfigValue("CenterSetting", "LastUpdateTime", m_strLastTime);
-    m_pRunConfig->ReadConfigValue("CenterSetting", "version", m_strVersion);
-#ifdef RVC_OS_LINUX
-    if (!m_strVersion.IsNullOrEmpty()) {
-        std::string tmp = m_strVersion.GetData();
-        transferblank(tmp);
-        m_strVersion = tmp.c_str();
-    }
-#endif
-    //从集中配置和shell.ini获取url
-    m_pCenterConfig->ReadConfigValue("CenterSetting", "CenterConfigUrlNew", m_strUrl);
-    if(m_strUrl.IsNullOrEmpty())
-    {
-        DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("InitCenterSettingInfo")("集中配置中的服务链接为空,使用默认链接");
-    } 
-    else
-    {
-        DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("CenterConfigUrlNew:%s", m_strUrl.GetData());
-    }
-
-    CSimpleStringA strMicroServiceURLSection = "MicroServiceURL";
-
-#ifdef RVC_OS_WIN /** UOS配置后置后没这堆玩意,至少现在的配置中没有  但是windows还有[Gifur@202397]*/
-#ifdef DEVOPS_ON_ST /*DevOps流水线编译,ST环境*/
-    strMicroServiceURLSection = "MicroServiceURL-ST";
-#elif defined(DEVOPS_ON_UAT)/*DevOps流水线编译,UAT环境*/
-    strMicroServiceURLSection = "MicroServiceURL-UAT";
-#elif defined(DEVOPS_ON_PRD)/*DevOps流水线编译,PRD环境*/
-    //strMicroServiceURLSection = "MicroServiceURL-PRD";
-#elif defined(DEVOPS_ON_DEV)/*DevOps流水线编译,Dev环境*/
-    strMicroServiceURLSection = "MicroServiceURL-Dev";
-#else/*本地编译等非DevOps环境编译的版本*/
-    strMicroServiceURLSection = "MicroServiceURL-Dev";
-#endif
-#endif //RVC_OS_WIN
-
-    DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("InitCenterSettingInfo")("获取集中配置服务地址 Section name:%s", strMicroServiceURLSection.GetData());
-
-    shellConfig->ReadAllKeys(strMicroServiceURLSection, m_arrKeys);
-
-    CSimpleStringA strUrl;
-    for(int i = 0; i < m_arrKeys.GetCount() && m_arrKeys[i].IsStartWith("CenterConfigUrl", true); i++)
-    {
-        shellConfig->ReadConfigValue(strMicroServiceURLSection, m_arrKeys[i].GetData(), strUrl);
-        if(!strUrl.IsNullOrEmpty())
-        {
-            DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("add CenterURL:%s", strUrl.GetData());
-            m_urlsFromShell.push_back(strUrl);
-        }
-    }
-
-    //获取集中配置路径、文件名、场所
-    m_pEntity->GetFunction()->GetPath("CenterSetting", m_strFilePath);
-    m_pEntity->GetFunction()->GetPath("RunInfo", m_strBakPath);
-#ifdef RVC_OS_WIN
-    m_strBakPath += "\\runcfg\\CenterSetting.ini";
-#else
-    m_strBakPath += SPLIT_SLASH_STR "runcfg" SPLIT_SLASH_STR "CenterSetting.ini";
-#endif
-}
-
-bool CenterSettingsMicroServiceHelper::WriteToConfig(const CenterSettingResponse& sResponse)
-{
-    CSimpleStringA newPath = m_strBakPath + ".new";
-
-    DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("config size: %d", sResponse.m_config.size());
-    for(int i = 0; i < sResponse.m_config.size(); i++)
-	{
-		string module = sResponse.m_config[i].m_moudle;
-		string name = sResponse.m_config[i].m_name;
-		string value = sResponse.m_config[i].m_value;
-
-#ifdef RVC_OS_WIN
-		if(!WritePrivateProfileStringA(module.c_str(), name.c_str(), value.c_str(), newPath))
-		{
-#else
-		if (inifile_write_str(newPath.GetData(), module.c_str(), name.c_str(), value.c_str()) == -1) 
-        {
-#endif
-            DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("WriteToConfig")
-                ("write %s:%s:%s fail", module.c_str(), name.c_str(), value.c_str());
-            m_strErrMsg = "集中配置写入失败";
-            LogWarn(Severity_Middle, Error_Unexpect, ERR_MOD_CENTERSETTING_WRITE_FAILED,
-                    CSimpleStringA::Format("集中配置写入失败:%s:%s:%s", module.c_str(), name.c_str(), value.c_str()));
-            return false;
-        }
-    }
-
-    DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("WriteToConfig")("集中配置写入成功");
-#ifdef RVC_OS_WIN
-    CopyFileA(newPath, m_strFilePath, FALSE);
-    DeleteFileA(newPath);
-#else
-    fileutil_copy_file(m_strFilePath, newPath);
-    fileutil_delete_file(newPath);
-#endif
-    return true;
-}
-
-string CenterSettingsMicroServiceHelper::GetLocalConfig()
-{
-    CAutoArray<CSimpleStringA> arrSections, arrKeys;
-    CSimpleStringA strItem;
-
-    if(Error_Succeed != m_pCenterConfig->ReadAllSections(arrSections))
-        DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("GetLocalConfig")("Read all sections failed.");
-
-    if(arrSections.GetCount() == 0)
-        return "";
-
-    for(int i = 0; i < arrSections.GetCount(); ++i)
-    {
-        m_pCenterConfig->ReadAllKeys(arrSections[i].GetData(), arrKeys);
-        for(int j = 0; j < arrKeys.GetCount(); ++j)
-        {
-            CSimpleStringA value, tmp;
-            m_pCenterConfig->ReadConfigValue(arrSections[i].GetData(), arrKeys[j].GetData(), value);
-
-            tmp = CSimpleStringA::Format("{\"moudle\":\"%s\", \"name\":\"%s\", \"value\":\"%s\"}",
-                                        arrSections[i].GetData(), arrKeys[j].GetData(), value.GetData());
-
-            strItem += tmp + ",";
-        }
-    }
-
-
-    string strConfig = strItem.SubString(0, strItem.GetLength() - 1).GetData();
-    convert(strConfig);
-    return strConfig;
-}
-
-void CenterSettingsMicroServiceHelper::UpdateVersion()
-{
-    AddVersionReq sReq;
-    AddVersionResponse sResponse;
-#ifdef RVC_OS_WIN
-	CSimpleStringA url;
-	m_pCenterConfig->ReadConfigValue("CenterSetting", "UpdateVersionUrl", url);
-	sReq.m_url = url.GetData();
-	sReq.m_terminal_no = m_terminalInfo.strTerminalID.GetData();
-	sReq.m_version = m_strVersion;
-	sReq.m_update_time = GetUpdateTime();
-	GetTimeoutValue(sReq.m_timeOut);
-	
-	//IHttpFunc* m_pHttpFunc = create_http(HTTPLogCallback);
-    PROCESS_LINK_CONTEXT("LR0402101UploadVersion")
-	bool ret =  m_pHttpFunc->Post(sReq, sResponse, &nextLink);
-
-	if(ret && sResponse.m_success)
-	{
-		CSimpleStringA msg = CSimpleStringA::Format("上传版本号成功:{version : %s, update_time : %s}", 
-			sReq.m_version.c_str(), sReq.m_update_time.c_str());
-		LogWarn(Severity_Low, Error_Succeed, EVENT_MOD_CENTERSETTING_UPDATE_VERSION_SUCC, msg.GetData());
-	}
-	else
-	{
-		CSimpleStringA msg = CSimpleStringA::Format("上传版本号失败:%s", sResponse.m_errMsg.c_str());
-		LogWarn(Severity_Middle, Error_Succeed, EVENT_MOD_CENTERSETTING_UPDATE_VERSION_FAILED, msg.GetData());
-
-	}
-#else
-	struct UpdateVersionReq  //Req和Ans的变量名必须和服务端json要求的一致,切记!
-    {
-        string terminal_no;
-        string version_no;
-        string terminal_update_time;
-        JSONCONVERT2OBJECT_MEMEBER_REGISTER(terminal_no, version_no, terminal_update_time)
-    } updateVersionReq;
-
-    CSimpleStringA url;
-    m_pCenterConfig->ReadConfigValue("CenterSetting", "UpdateVersionUrl", url);
-
-    HttpClientResponseResult result;
-    HttpClientRequestConfig config(HttpRequestMethod::POST, url.GetData(), &SpGetToken);
-
-    updateVersionReq.terminal_no = m_terminalInfo.strTerminalID.GetData();
-    updateVersionReq.version_no = m_strVersion;
-    updateVersionReq.terminal_update_time = GetUpdateTime();
-
-    SP::Module::Restful::FulfillRequestJsonBody(&config, updateVersionReq);
-
-    RestfulClient client = RestfulClient::getInstance();
-    PROCESS_LINK_CONTEXT("LR0402101UpdateVersion");
-    config.PreDo();
-    client.Do(&config, &result, &nextLink);
-
-    DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("返回内容为 %s", result.content.length() > 1000 ? result.content.substr(0, 1000).c_str() : result.content.c_str());
-
-    if (!result.ResponseOK()) {
-        DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("Do failed: %s", result.WhatError().c_str());
-        return;
-    }
-
-    SP::Module::Restful::CommResponseJson responseStatus;
-    SP::Module::Restful::GetStatusFromDebranchResponse(result.content, responseStatus);
-
-    if (responseStatus.success) {
-        CSimpleStringA msg = CSimpleStringA::Format("上传版本号成功:{version : %s, update_time : %s}",
-            updateVersionReq.version_no.c_str(), updateVersionReq.terminal_update_time.c_str());
-        LogWarn(Severity_Low, Error_Succeed, EVENT_MOD_CENTERSETTING_UPDATE_VERSION_SUCC, msg.GetData());
-    } else {
-        CSimpleStringA msg = CSimpleStringA::Format("上传版本号失败:%s", result.content.c_str());
-        LogWarn(Severity_Middle, Error_Succeed, EVENT_MOD_CENTERSETTING_UPDATE_VERSION_FAILED, msg.GetData());
-
-    }
-#endif
-}
-
-SYSTEMTIME GetModifyTime(const string& strFilename)
-{
-#if defined(_MSC_VER)
-    struct _stat64i32 statbuf;
-    _stat64i32(strFilename.c_str(), &statbuf);
-    struct tm* temptm = _localtime64(&statbuf.st_mtime);
-#else
-    struct stat statbuf;
-    ZeroMemory(&statbuf, sizeof(statbuf));
-    stat(strFilename.c_str(), &statbuf);
-    struct tm* temptm = localtime(&statbuf.st_mtime);
-#endif //_MSC_VER
-
-    SYSTEMTIME st = { 1900 + temptm->tm_year,
-        1 + temptm->tm_mon,
-        temptm->tm_wday,
-        temptm->tm_mday,
-        temptm->tm_hour,
-        temptm->tm_min,
-        temptm->tm_sec,
-        0 };
-
-    return st;
-}
-
-string CenterSettingsMicroServiceHelper::GetUpdateTime()
-{
-    CSimpleStringA strUpdateTime;
-
-    /** 配置后置后本地没有这个实体文件,都被框架放到运行时了,所以需要处理这个逻辑 [Gifur@202397]*/
-    if(ExistsFileA(m_strFilePath))
-    {
-#ifdef RVC_OS_WIN
-		struct _stat64i32 statbuf;
-		_stat64i32(m_strFilePath.GetData(), &statbuf);
-#endif
-        SYSTEMTIME st = GetModifyTime(m_strFilePath.GetData());
-        strUpdateTime = CSimpleStringA::Format("%d-%02d-%02d-%02d:%02d:%02d",
-                                               st.wYear, st.wMonth, st.wDay, st.wHour, st.wMinute, st.wSecond);
-	}
-	else
-	{
-#ifdef RVC_OS_WIN
-        SYSTEMTIME st, stLocal;
-		GetSystemTime(&st);
-		SystemTimeToTzSpecificLocalTime(NULL, &st, &stLocal);
-#else
-        SYSTEMTIME stLocal = CSmallDateTime::GetNow().ToSystemTime();
-#endif
-        strUpdateTime = CSimpleStringA::Format("%d-%02d-%02d-%02d:%02d:%02d",
-                                               stLocal.wYear, stLocal.wMonth, stLocal.wDay,
-                                               stLocal.wHour, stLocal.wMinute, stLocal.wSecond);
-    }
-    return strUpdateTime.GetData();
-}
-
-void CenterSettingsMicroServiceHelper::GetTimeoutValue(int& timeout)
-{
-    int timeoutFromConfig = 0;
-    m_pCenterConfig->ReadConfigValueInt("CenterSetting", "Timeout", timeoutFromConfig);
-    if(timeoutFromConfig == 0)
-        return;
-    else
-        timeout = timeoutFromConfig;
-}
-
-#ifdef RVC_OS_WIN
-int CenterSettingsMicroServiceHelper::OnRequest(CenterSettingReq& req, CenterSettingResponse& res, string& errMsg)
-{
-    PROCESS_LINK_CONTEXT("LR0402101SyncCenter")
-	bool ret = m_pHttpFunc->Post(req, res, &nextLink);
-
-	if(ret && res.m_success)
-	{
-		if(!res.m_is_update)
-			return SUCC;
-
-		ConvertGBKToUtf8(res.m_strConfig);
-		string strConfig = res.m_strConfig;
-
-
-		BYTE sm3[32] = {};
-		if(strConfig.length() > 2)
-		{
-			if (!SM3Hash((BYTE*)(strConfig.c_str()), strlen(strConfig.c_str()), sm3))
-			{
-				errMsg = "计算SM3失败";
-				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("OnRequest")
-					(CSimpleStringA::Format("计算SM3失败(%s)", req.m_url.c_str()));
-				return CalcSM3Fail;
-			}
-			else
-			{
-				int sm3len = sizeof(sm3);
-				char* strsm3 = ConvertBytesToHexStr(sm3, 32);
-
-				if(0 != strcmp(strsm3, res.m_sm3.c_str()))
-				{
-					errMsg = "SM3校验失败";
-					DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("OnRequest")
-						(CSimpleStringA::Format("SM3校验失败(%s)", req.m_url.c_str()));
-					return CheckSM3Fail;
-				}
-
-				m_strVersion = res.m_version_no.c_str();
-				
-				return SUCC;
-			}
-		}
-	}
-	else
-	{
-		//ConvertUtf8ToGBK(res.m_errMsg);
-		errMsg = res.m_errMsg;
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("OnRequest")
-			(CSimpleStringA::Format("访问失败:%s", res.m_errMsg.c_str()));
-
-		if(res.m_sysCode == 28 || res.m_sysCode == 7)
-			return AccessServiceFail;
-
-		return MANUAL;
-	}
-}
-#else
-int CenterSettingsMicroServiceHelper::GetCenterSettingsFromHttp(CenterSettingReq& req, string& errMsg)
-{
-    LOG_FUNCTION();
-    CenterSettingResponse res;
-
-    struct GetCenterSettingReq //Req和Ans的变量名必须和服务端json要求的一致,切记!
-    {
-        string m_terminal_no;
-        string m_version;
-        string m_update_time;
-        string m_config;
-        JSONCONVERT2OBJECT_MEMEBER_REGISTER(m_terminal_no, m_version, m_update_time, m_config)
-    } getCenterSettingReq;
-
-    struct GetCenterSettingAns //Req和Ans的变量名必须和服务端json要求的一致,切记!
-    {
-        bool success;
-        string message;
-        bool is_update;
-        bool is_reset;
-        string version_no;
-        string sm3;
-        string config;
-        JSONCONVERT2OBJECT_MEMEBER_REGISTER(success, message, is_update, is_reset, version_no, sm3, config)
-    }getCenterSettingAns;
-
-    HttpClientResponseResult result;
-    HttpClientRequestConfig config(HttpRequestMethod::POST, req.m_url, &SpGetToken);
-    if (req.m_timeOut > 0) config.SetTimeout(req.m_timeOut);
-
-    getCenterSettingReq.m_terminal_no = req.m_terminal_no;
-    getCenterSettingReq.m_version = req.m_version;
-    getCenterSettingReq.m_update_time = req.m_update_time;
-    getCenterSettingReq.m_config = req.m_config;
-
-    SP::Module::Restful::FulfillRequestJsonBody(&config, getCenterSettingReq);
-
-    Dbg("Geting centtersetting...");
-
-    RestfulClient client = RestfulClient::getInstance();
-    PROCESS_LINK_CONTEXT("LR0402101GetCenterSetting");
-    config.PreDo();
-    client.Do(&config, &result, &nextLink);
-
-    Dbg("ret result.ResponseOK() = %d.", result.ResponseOK());
-    if (!result.ResponseOK()) {
-        DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("Do failed: %s", result.WhatError().c_str());
-        errMsg = result.WhatError();
-        return AccessServiceFail;
-    }
-    SP::Module::Restful::CommResponseJson responseStatus;
-    SP::Module::Restful::GetStatusFromDebranchResponse(result.content, responseStatus);
-    if (!responseStatus.IsOperatedOK()) {
-        DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)(result.content.c_str());
-        errMsg = responseStatus.WhatError().c_str();
-        return MANUAL;
-    }
-
-    DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("%s", result.content.length() > 1000 ? result.content.substr(0, 1000).c_str() : result.content.c_str());
-    if (!SP::Module::Restful::ExtractDataFromDebranchResponse(result.content, getCenterSettingAns)) {
-        DbgWithLink(LOG_LEVEL_ERROR, LOG_TYPE_SYSTEM)("parse json data node failed: ");
-        errMsg = "解析集中配置返回的信息失败";
-        return UNknown;
-    }
-    //transferblank(centerSettingAns.version_no);
-    ///** 当时粤超开发Windows版本时,要求服务端将数组转化为字符串传送,这边信创为了兼容,需要重新转为数组处理(信创是支持JSON数组) [Gifur@202398]*/
-    //string strConfig = centerSettingAns.config;  
-    //vector<ConfigItem> m_config;
-    //SP::Utility::replaceInPlace(centerSettingAns.config, "\\\"", "\"");
-    //if (!Json2Object(m_config, centerSettingAns.config)) {
-    //    DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("parse config content failed!");
-    //    errMsg = "解析集中配置返回的配置信息失败";
-    //    return UNknown;
-    //}
-    res.Parse(result.content);
-    string strConfig = SP::Utility::GBK2UTF8(res.m_strConfig);
-
-    if (!res.m_is_update) {
-        DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("GetCenterSetting")("Centersetting not changed.");
-        errMsg = "集中配置已是最新版本";
-        return EXIST;
-    }
-
-    DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("config length:%d", strConfig.length());
-
-    BYTE sm3[32] = {};
-    if (strConfig.length() > 2) {
-        if (!SM3Hash((BYTE*)(strConfig.c_str()), strConfig.length(), sm3)) {
-            errMsg = "计算SM3失败";
-            DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("GetCenterSettingsFromHttp")("计算SM3失败(%s)", req.m_url.c_str());
-            return CalcSM3Fail;
-        } else {
-            DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("sm3:%s", res.m_sm3.c_str());
-            char* strsm3 = SP::Module::Util::ConvertBytesToHexStr(sm3, 32);
-            if (0 != strcmp(strsm3, res.m_sm3.c_str())) {
-                errMsg = "SM3校验失败";
-                DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("GetCenterSettingsFromHttp")("SM3校验失败(%s)", req.m_url.c_str());
-                delete[] strsm3;
-                return CheckSM3Fail;
-            }
-            m_strVersion = res.m_version_no.c_str();
-            delete[] strsm3;
-        }
-
-        if (WriteToConfig(res)) {
-            m_strVersion = res.m_version_no.c_str();
-            DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("WriteToConfig m_strVersion:%s", m_strVersion.GetData());
-            m_pEntity->GetFunction()->OpenConfig(Config_CenterSetting, m_pCenterConfig, true);
-            m_pRunConfig->WriteConfigValue("CenterSetting", "version", m_strVersion);
-            UpdateVersion();
-            if (res.m_is_reset) {
-                LogEvent(Severity_Middle, EVENT_MOD_CENTERSETTING_CRITICAL_UPDATE, "Update centersetting with critical items.");
-            }
-            return SUCC;
-        }
-    }
-    return UNknown;
-}
-#endif

+ 0 - 198
Module/mod_CenterSetting/CenterSettingConn.h

@@ -1,198 +0,0 @@
-#ifndef RVC_MOD_CENTERSETTING_CONN_H_
-#define RVC_MOD_CENTERSETTING_CONN_H_
-
-#pragma once
-#include "json/json.h"
-#include "SpSecureClient.h"
-#include "SpIni.h"
-#include "IHttpFunc.h"
-#include "EventCode.h"
-#include <vector>
-#include <string>
-
-#ifdef WITH_CPPRESTSDK_IN_CENTER
-#include "CommEntityRestful.hpp"
-#include "microservices/api_terminal_center_config.h"
-
-struct ModuleConfigItemJson : public MicroServices::API::TerminalV3::ModuleConfigItem
-{
-    JSONCONVERT2OBJECT_MEMEBER_REGISTER(m_moudle, m_name, m_value)
-        JSONCONVERT2OBJECT_MEMEBER_RENAME_REGISTER("moudle", "name", "value")
-};
-
-struct CenterSettingReq
-{
-    CenterSettingReq() :m_terminal_no(""), m_version(""), m_update_time(""),m_url(""),m_timeOut(0) {}
-    std::string m_terminal_no;
-    std::string m_version;
-    std::string m_update_time;
-    /** 兼容用途 [Gifur@202398]*/
-    std::string m_url;
-    int m_timeOut;
-    std::string m_config;
-    std::vector<ModuleConfigItemJson> configs;
-    JSONCONVERT2OBJECT_MEMEBER_REGISTER(m_terminal_no, m_version, configs, m_update_time)
-        JSONCONVERT2OBJECT_MEMEBER_RENAME_REGISTER("terminal_no", "version", "config", "update_time")
-};
-
-struct CenterSettingResponse
-{
-    bool m_is_update;
-    bool m_is_reset;
-    std::string m_sm3;
-    std::string m_version_no;
-    std::vector<ModuleConfigItemJson> m_config;
-    std::string m_strConfig;
-    JSONCONVERT2OBJECT_MEMEBER_REGISTER(m_is_update, m_is_reset, m_sm3, m_version_no, m_strConfig)
-        JSONCONVERT2OBJECT_MEMEBER_RENAME_REGISTER("is_update", "is_reset", "sm3", "version_no", "config")
-};
-
-#else
-
-struct CenterSettingReq : CHTTPReq
-{
-    CenterSettingReq()
-    {
-#if defined(_MSC_VER)
-        m_bTransCode = true;
-#else
-        m_bTransCode = false;
-#endif //_MSC_VER
-    }
-    string m_terminal_no;
-    string m_version;
-    string m_update_time;
-    string m_config;
-
-    virtual string ToJson()
-    {
-        CSimpleStringA reqcontent = CSimpleStringA::Format("{\"terminal_no\":\"%s\", \"version\":\"%s\", \"update_time\":\"%s\", \"config\":[%s]}",
-            m_terminal_no.c_str(), m_version.c_str(), m_update_time.c_str(), m_config.c_str());
-        return reqcontent.GetData();
-    }
-};
-
-struct ConfigItem
-{
-    std::string m_moudle;
-    std::string m_name;
-    std::string m_value;
-
-#ifdef RVC_OS_LINUX
-    // 默认构造函数
-    ConfigItem()
-        : m_moudle(""), m_name(""), m_value("")
-    {
-    }
-
-    // 带参数的构造函数
-    ConfigItem(const std::string& module, const std::string& name, const std::string& value)
-        : m_moudle(module), m_name(name), m_value(value)
-    {
-    }
-
-    // 拷贝构造函数
-    ConfigItem(const ConfigItem& other)
-        : m_moudle(other.m_moudle), m_name(other.m_name), m_value(other.m_value)
-    {
-    }
-#endif
-};
-
-struct CenterSettingResponse : CHTTPRet
-{
-    CenterSettingResponse(){}
-
-    bool m_success;
-    string m_message;
-    bool m_is_update;
-    bool m_is_reset;
-    string m_version_no;
-    string m_sm3;
-    string m_strConfig;
-    vector<ConfigItem> m_config;
-
-    virtual bool Parse(string strData);
-};
-
-#ifdef RVC_OS_LINUX
-#define SAFE_DELETE_HTTPCLIENT(obj)	\
-	do{if(obj != NULL) { obj->Destory(); obj = NULL; }}while(false)
-#endif //RVC_OS_LINUX
-
-#endif //WITH_CPPRESTSDK_IN_CENTER
-
-struct AddVersionReq : CHTTPReq
-{
-    AddVersionReq(){}
-    string m_terminal_no;
-    string m_version;
-    string m_update_time;
-
-    virtual string ToJson()
-    {
-        char reqcontent[256];
-        sprintf(reqcontent, "{\"terminal_no\":\"%s\", \"version_no\":\"%s\", \"terminal_update_time\":\"%s\"}",
-                m_terminal_no.c_str(), m_version.c_str(), m_update_time.c_str());
-        return reqcontent;
-    }
-};
-
-struct AddVersionResponse : CHTTPRet
-{
-    AddVersionResponse() {}
-
-    bool m_success;
-    string m_message;
-
-    virtual bool Parse(string strData);
-};
-
-class CenterSettingsMicroServiceHelper
-{
-public:
-    CenterSettingsMicroServiceHelper(CEntityBase* pEntity);
-#ifdef RVC_OS_WIN
-    int GetCenterSetting();
-#else
-	int GetCenterSetting(bool byHand);
-#endif
-    string GetLocalConfig(); //将集中配置转换成Json串
-    string GetUpdateTime();  //获取集中配置更新时间,如果文件不存在则获取当前系统时间
-    const char* GetErrMsg() { return m_strErrMsg.c_str(); }
-    void GetTimeoutValue(int& timeout);
-    void InitCenterSettingInfo();
-    bool WriteToConfig(const CenterSettingResponse& sResponse);
-    void UpdateVersion();
-    void UpdateUrl(const string& url) { m_strUrl = url.c_str(); };
-
-#ifdef RVC_OS_WIN
-    int OnRequest(CenterSettingReq& req, CenterSettingResponse& res, string& errMsg = string(""));  //轮询域名下载集中配置
-#else
-	int GetCenterSettingsFromHttp(CenterSettingReq& req, string& errMsg);  //轮询域名下载集中配置
-#endif
-
-    string GetCurUrl() { return m_strCurUrl; }
-
-private:
-    string m_strErrMsg;
-    CEntityBase* m_pEntity;
-    CSimpleStringA m_strLastTime;
-    CSystemStaticInfo m_terminalInfo;
-    IHttpFunc* m_pHttpFunc;
-    CAutoArray<CSimpleStringA> m_arrKeys;
-    vector<CSimpleStringA> m_arrURLs;
-
-    CSimpleStringA m_strCurSite;
-    CSmartPointer<IConfigInfo> m_pCenterConfig;
-    CSmartPointer<IConfigInfo> m_pRunConfig;
-    CSimpleStringA m_strFilePath;
-    CSimpleStringA m_strBakPath;
-    CSimpleStringA m_strVersion;
-    CSimpleStringA m_strUrl;
-    vector<CSimpleStringA> m_urlsFromShell;
-    string m_strCurUrl;
-    bool m_isFirst;
-};
-
-#endif //RVC_MOD_CENTERSETTING_CONN_H_

+ 0 - 42
Module/mod_CenterSetting/CenterSettingService.xml

@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="gb2312" ?>
-<entity name="CenterSetting">
-	<class name="CenterSettingService" overlap="true" exclusive="false">
-		<twoway name="Downloadv2" overlap="true">
-			<req>
-				<param name="reqCenterConfigUrl" type="string"/>
-			</req>
-			<res>
-				<param name="downloadStat" type="int"/>
-				<param name="strErrMsg" type="string"/>
-				<param name="retCenterConfigUrl" type="string"/>
-				<param name="HostUrl" type="string"/>
-			</res>
-		</twoway>
-		<oneway name="Hold1" overlap="true">
-		</oneway>
-		<oneway name="Hold2" overlap="true">
-		</oneway>
-		<twoway name="GetAccessUrl" overlap="true">
-			<res>
-				<param name="HostUrl" type="string"/>
-			</res>
-		</twoway>
-		<twoway name="GetCertainAceessUrl" overlap="true">
-			<req>
-				<param name="reqName" type="string"/>
-				<param name="reverse1" type="string"/>
-				<param name="reverse2" type="string"/>
-				<param name="intreverse1" type="int"/>
-				<param name="intreverse2" type="int"/>
-			</req>
-			<res>
-				<param name="CertainAceessUrl" type="string"/>
-				<param name="reverse1" type="string"/>
-				<param name="reverse2" type="string"/>
-				<param name="intreverse1" type="int"/>
-				<param name="intreverse2" type="int"/>
-			</res>
-		</twoway>
-
-	</class>
-</entity>

+ 0 - 255
Module/mod_CenterSetting/CenterSetting_client_g.h

@@ -1,255 +0,0 @@
-
-#ifndef __CENTERSETTING_CLIENT_G_H
-#define __CENTERSETTING_CLIENT_G_H
-
-#pragma once
-
-// This code is generated by spgen tool!
-
-#include "CenterSetting_def_g.h"
-
-namespace CenterSetting {
-class CenterSettingService_ClientBase : public CClientSessionBase {
-public:
-	explicit CenterSettingService_ClientBase(CEntityBase *pEntity) : m_pEntityBase(pEntity), m_bSysManaged(false) {}
-
-	CenterSettingService_ClientBase* operator () (const linkContext &curLink) 
-	{
-		m_context = curLink;
-		return this;
-	}
-
-protected:
-	virtual ~CenterSettingService_ClientBase()
-	{
-		/// override by user
-	}
-public:
-
-	void OnConnectSucceed()
-	{
-		bSessionClosed = false;
-	}
-	void OnClose(ErrorCodeEnum)
-	{
-		bSessionClosed = true;
-	}
-	bool QuerySessionClosed()
-	{
-		return bSessionClosed;
-	}
-	ErrorCodeEnum Connect(CSmartPointer<IAsynWaitSp> &spAsyncWait)
-	{
-		CSmartPointer<IEntityFunction> pFunc = m_pEntityBase->GetFunction();
-		ErrorCodeEnum Error = pFunc->ConnectRemoteEntity(this, "CenterSetting", "CenterSettingService", spAsyncWait);
-		if (Error == Error_Succeed) {
-			m_bSysManaged = true;
-			bSessionClosed = false;
-		}
-		return Error;
-	}
-	ErrorCodeEnum Connect()
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = Connect(spAsyncWait);
-		if (Error == Error_Succeed) {
-			Error = spAsyncWait->WaitAnswer();
-		}
-		return Error;
-	}
-
-	ErrorCodeEnum Downloadv2(CenterSettingService_Downloadv2_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(CenterSettingService_Method_Downloadv2, CenterSettingService_MethodSignature_Downloadv2, Buf, spAsyncWait, m_context, dwTimeout);
-		m_context.clear();
-		return ret;
-	}
-	ErrorCodeEnum Downloadv2(CenterSettingService_Downloadv2_Req &Req, CenterSettingService_Downloadv2_Ans &Ans, DWORD dwTimeout)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = Downloadv2(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-	ErrorCodeEnum Downloadv2(CenterSettingService_Downloadv2_Req &Req, CenterSettingService_Downloadv2_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError, CSimpleString &str)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = Downloadv2(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 Downloadv2(CenterSettingService_Downloadv2_Req &Req, CenterSettingService_Downloadv2_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = Downloadv2(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 Hold1()
-	{
-		CSmartPointer<IClientSessionFunction> pFunc = GetFunction();
-		if (m_context.checkEmpty())
-		{
-			m_context.AutoGenerate();
-			DbgToBeidou(m_context, m_pEntityBase != NULL ? m_pEntityBase->GetEntityName() : "")();
-			m_context = m_context.upgradeLink();
-		}
-		auto ret = pFunc->OnewayCall(CenterSettingService_Method_Hold1, CenterSettingService_MethodSignature_Hold1, m_context);
-		m_context.clear();
-		return ret;
-	}
-
-	ErrorCodeEnum Hold2()
-	{
-		CSmartPointer<IClientSessionFunction> pFunc = GetFunction();
-		if (m_context.checkEmpty())
-		{
-			m_context.AutoGenerate();
-			DbgToBeidou(m_context, m_pEntityBase != NULL ? m_pEntityBase->GetEntityName() : "")();
-			m_context = m_context.upgradeLink();
-		}
-		auto ret = pFunc->OnewayCall(CenterSettingService_Method_Hold2, CenterSettingService_MethodSignature_Hold2, m_context);
-		m_context.clear();
-		return ret;
-	}
-
-	ErrorCodeEnum GetAccessUrl(CenterSettingService_GetAccessUrl_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(CenterSettingService_Method_GetAccessUrl, CenterSettingService_MethodSignature_GetAccessUrl, Buf, spAsyncWait, m_context, dwTimeout);
-		m_context.clear();
-		return ret;
-	}
-	ErrorCodeEnum GetAccessUrl(CenterSettingService_GetAccessUrl_Req &Req, CenterSettingService_GetAccessUrl_Ans &Ans, DWORD dwTimeout)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = GetAccessUrl(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-	ErrorCodeEnum GetAccessUrl(CenterSettingService_GetAccessUrl_Req &Req, CenterSettingService_GetAccessUrl_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError, CSimpleString &str)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = GetAccessUrl(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 GetAccessUrl(CenterSettingService_GetAccessUrl_Req &Req, CenterSettingService_GetAccessUrl_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = GetAccessUrl(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 GetCertainAceessUrl(CenterSettingService_GetCertainAceessUrl_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(CenterSettingService_Method_GetCertainAceessUrl, CenterSettingService_MethodSignature_GetCertainAceessUrl, Buf, spAsyncWait, m_context, dwTimeout);
-		m_context.clear();
-		return ret;
-	}
-	ErrorCodeEnum GetCertainAceessUrl(CenterSettingService_GetCertainAceessUrl_Req &Req, CenterSettingService_GetCertainAceessUrl_Ans &Ans, DWORD dwTimeout)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = GetCertainAceessUrl(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-	ErrorCodeEnum GetCertainAceessUrl(CenterSettingService_GetCertainAceessUrl_Req &Req, CenterSettingService_GetCertainAceessUrl_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError, CSimpleString &str)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = GetCertainAceessUrl(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 GetCertainAceessUrl(CenterSettingService_GetCertainAceessUrl_Req &Req, CenterSettingService_GetCertainAceessUrl_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = GetCertainAceessUrl(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()
-	{
-		if (!m_bSysManaged) {
-			delete this;
-		}
-		return m_bSysManaged;
-	}
-
-protected:
-	bool m_bSysManaged;
-	CEntityBase *m_pEntityBase;
-	linkContext m_context;
-	bool bSessionClosed;
-};
-
-///////////////////////////
-
-} // namespace CenterSetting
-#endif // __CENTERSETTING_CLIENT_G_H

+ 0 - 131
Module/mod_CenterSetting/CenterSetting_def_g.h

@@ -1,131 +0,0 @@
-#ifndef __CENTERSETTING_DEF_G_H
-#define __CENTERSETTING_DEF_G_H
-
-#pragma once
-
-// This code is generated by spgen tool!
-
-#include "SpHelper.h"
-
-namespace CenterSetting {
-//
-// const goes here
-//
-
-#define CenterSettingService_Method_Downloadv2 0
-#define CenterSettingService_Method_Hold1 1
-#define CenterSettingService_Method_Hold2 2
-#define CenterSettingService_Method_GetAccessUrl 3
-#define CenterSettingService_Method_GetCertainAceessUrl 4
-
-#define CenterSettingService_MethodSignature_Downloadv2 -1569222403
-#define CenterSettingService_MethodSignature_Hold1 35758230
-#define CenterSettingService_MethodSignature_Hold2 35758233
-#define CenterSettingService_MethodSignature_GetAccessUrl 1887530540
-#define CenterSettingService_MethodSignature_GetCertainAceessUrl -927544309
-
-#define CenterSettingService_LogCode_Downloadv2 "QLR040210100"
-#define CenterSettingService_LogCode_Hold1 "QLR040210101"
-#define CenterSettingService_LogCode_Hold2 "QLR040210102"
-#define CenterSettingService_LogCode_GetAccessUrl "QLR040210103"
-#define CenterSettingService_LogCode_GetCertainAceessUrl "QLR040210104"
-
-struct CenterSettingService_Downloadv2_Req
-{
-	CSimpleStringA reqCenterConfigUrl;
-
-	void Serialize(SpBuffer &Buf)
-	{
-		auto & buf = Buf & reqCenterConfigUrl;
-	}
-
-};
-
-struct CenterSettingService_Downloadv2_Ans
-{
-	int downloadStat;
-	CSimpleStringA strErrMsg;
-	CSimpleStringA retCenterConfigUrl;
-	CSimpleStringA HostUrl;
-
-	void Serialize(SpBuffer &Buf)
-	{
-		auto & buf = Buf & downloadStat & strErrMsg & retCenterConfigUrl & HostUrl;
-	}
-
-};
-
-struct CenterSettingService_Hold1_Info
-{
-
-	void Serialize(SpBuffer &Buf)
-	{
-	}
-
-};
-
-struct CenterSettingService_Hold2_Info
-{
-
-	void Serialize(SpBuffer &Buf)
-	{
-	}
-
-};
-
-struct CenterSettingService_GetAccessUrl_Req
-{
-
-	void Serialize(SpBuffer &Buf)
-	{
-	}
-
-};
-
-struct CenterSettingService_GetAccessUrl_Ans
-{
-	CSimpleStringA HostUrl;
-
-	void Serialize(SpBuffer &Buf)
-	{
-		auto & buf = Buf & HostUrl;
-	}
-
-};
-
-struct CenterSettingService_GetCertainAceessUrl_Req
-{
-	CSimpleStringA reqName;
-	CSimpleStringA reverse1;
-	CSimpleStringA reverse2;
-	int intreverse1;
-	int intreverse2;
-
-	void Serialize(SpBuffer &Buf)
-	{
-		auto & buf = Buf & reqName & reverse1 & reverse2 & intreverse1 & intreverse2;
-	}
-
-};
-
-struct CenterSettingService_GetCertainAceessUrl_Ans
-{
-	CSimpleStringA CertainAceessUrl;
-	CSimpleStringA reverse1;
-	CSimpleStringA reverse2;
-	int intreverse1;
-	int intreverse2;
-
-	void Serialize(SpBuffer &Buf)
-	{
-		auto & buf = Buf & CertainAceessUrl & reverse1 & reverse2 & intreverse1 & intreverse2;
-	}
-
-};
-
-
-///////////////////////////
-
-} // namespace CenterSetting
-
-#endif // __CENTERSETTING_DEF_G_H

+ 0 - 218
Module/mod_CenterSetting/CenterSetting_server_g.h

@@ -1,218 +0,0 @@
-
-#ifndef __CENTERSETTING_SERVER_G_H
-#define __CENTERSETTING_SERVER_G_H
-
-#pragma once
-
-// This code is generated by spgen tool!
-
-#include "CenterSetting_def_g.h"
-
-namespace CenterSetting {
-class CenterSettingService_ServerSessionBase : public CServerSessionBase
-{
-public:
-	CenterSettingService_ServerSessionBase()
-	{
-		/// override by user
-	}
-
-	virtual ~CenterSettingService_ServerSessionBase()
-	{
-		/// override by user
-	}
-
-	virtual bool IsExclusive() { return false; }
-
-	virtual bool IsSessionOverlap() { return true; }
-
-	virtual ErrorCodeEnum GetMessageAttr(DWORD dwMessageID, DWORD dwSignature, bool &bOverlap)
-	{
-		ErrorCodeEnum Error = Error_Succeed;
-		switch (dwMessageID) {
-		case CenterSettingService_Method_Downloadv2:
-			if (dwSignature == CenterSettingService_MethodSignature_Downloadv2) {
-				bOverlap = true;
-			} else {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
-		case CenterSettingService_Method_Hold1:
-			if (dwSignature == CenterSettingService_MethodSignature_Hold1) {
-				bOverlap = true;
-			} else {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
-		case CenterSettingService_Method_Hold2:
-			if (dwSignature == CenterSettingService_MethodSignature_Hold2) {
-				bOverlap = true;
-			} else {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
-		case CenterSettingService_Method_GetAccessUrl:
-			if (dwSignature == CenterSettingService_MethodSignature_GetAccessUrl) {
-				bOverlap = true;
-			} else {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
-		case CenterSettingService_Method_GetCertainAceessUrl:
-			if (dwSignature == CenterSettingService_MethodSignature_GetCertainAceessUrl) {
-				bOverlap = true;
-			} else {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
-		default:
-			Error = Error_MethodNotFound;
-			break;
-		}
-		return Error;
-	}
-
-	int CheckMessageSignature(DWORD dwMessageID, DWORD dwSignature)
-	{
-		ErrorCodeEnum Error = Error_Succeed;
-		switch (dwMessageID) {
-		case CenterSettingService_Method_Downloadv2:
-			if (dwSignature != CenterSettingService_MethodSignature_Downloadv2) {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
-		case CenterSettingService_Method_Hold1:
-			if (dwSignature != CenterSettingService_MethodSignature_Hold1) {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
-		case CenterSettingService_Method_Hold2:
-			if (dwSignature != CenterSettingService_MethodSignature_Hold2) {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
-		case CenterSettingService_Method_GetAccessUrl:
-			if (dwSignature != CenterSettingService_MethodSignature_GetAccessUrl) {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
-		case CenterSettingService_Method_GetCertainAceessUrl:
-			if (dwSignature != CenterSettingService_MethodSignature_GetCertainAceessUrl) {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
-		default:
-			Error = Error_MethodNotFound;
-			break;
-		}
-		return Error;
-	}
-
-	virtual void Handle_Downloadv2(SpReqAnsContext<CenterSettingService_Downloadv2_Req, CenterSettingService_Downloadv2_Ans>::Pointer ctx)
-	{
-	/// override by user
-	}
-
-	virtual void Handle_Hold1(SpOnewayCallContext<CenterSettingService_Hold1_Info>::Pointer ctx)
-	{
-	/// override by user
-	}
-
-	virtual void Handle_Hold2(SpOnewayCallContext<CenterSettingService_Hold2_Info>::Pointer ctx)
-	{
-	/// override by user
-	}
-
-	virtual void Handle_GetAccessUrl(SpReqAnsContext<CenterSettingService_GetAccessUrl_Req, CenterSettingService_GetAccessUrl_Ans>::Pointer ctx)
-	{
-	/// override by user
-	}
-
-	virtual void Handle_GetCertainAceessUrl(SpReqAnsContext<CenterSettingService_GetCertainAceessUrl_Req, CenterSettingService_GetCertainAceessUrl_Ans>::Pointer ctx)
-	{
-	/// override by user
-	}
-
-	virtual void OnRequest(CSmartPointer<ITransactionContext> pTransactionContext)
-	{
-		CAutoBuffer Buf;
-		DWORD dwMessageID;
-		DWORD dwMessageSignature;
-		ErrorCodeEnum Error = pTransactionContext->GetReceiveBuffer(dwMessageID, dwMessageSignature, Buf);
-		if (Error == Error_Succeed) {
-#ifdef DEBUG
-			assert(CheckMessageSignature(dwMessageID, dwMessageSignature) == Error_Succeed);
-#else
-			if (CheckMessageSignature(dwMessageID, dwMessageSignature) != Error_Succeed) {
-				pTransactionContext->SendAnswer(Error_MethodSignatureFailed);
-				return;
-			}
-#endif
-			switch (dwMessageID) {
-				case CenterSettingService_Method_Downloadv2:
-					{
-						SpReqAnsContext<CenterSettingService_Downloadv2_Req,CenterSettingService_Downloadv2_Ans>::Pointer ctx;
-						ctx.Attach(new SpReqAnsContext<CenterSettingService_Downloadv2_Req,CenterSettingService_Downloadv2_Ans>(pTransactionContext));
-						SpBuffer2Object(Buf, ctx->Req);
-						pTransactionContext->GetLinkContext(ctx->link);
-						EntityResource::setLink(ctx->link);
-						Handle_Downloadv2(ctx);
-					}
-					break;
-				case CenterSettingService_Method_Hold1:
-					{
-						SpOnewayCallContext<CenterSettingService_Hold1_Info>::Pointer ctx;
-						ctx.Attach(new SpOnewayCallContext<CenterSettingService_Hold1_Info>());
-						SpBuffer2Object(Buf, ctx->Info);
-						pTransactionContext->GetLinkContext(ctx->link);
-						EntityResource::setLink(ctx->link);
-						Handle_Hold1(ctx);
-					}
-					break;
-				case CenterSettingService_Method_Hold2:
-					{
-						SpOnewayCallContext<CenterSettingService_Hold2_Info>::Pointer ctx;
-						ctx.Attach(new SpOnewayCallContext<CenterSettingService_Hold2_Info>());
-						SpBuffer2Object(Buf, ctx->Info);
-						pTransactionContext->GetLinkContext(ctx->link);
-						EntityResource::setLink(ctx->link);
-						Handle_Hold2(ctx);
-					}
-					break;
-				case CenterSettingService_Method_GetAccessUrl:
-					{
-						SpReqAnsContext<CenterSettingService_GetAccessUrl_Req,CenterSettingService_GetAccessUrl_Ans>::Pointer ctx;
-						ctx.Attach(new SpReqAnsContext<CenterSettingService_GetAccessUrl_Req,CenterSettingService_GetAccessUrl_Ans>(pTransactionContext));
-						SpBuffer2Object(Buf, ctx->Req);
-						pTransactionContext->GetLinkContext(ctx->link);
-						EntityResource::setLink(ctx->link);
-						Handle_GetAccessUrl(ctx);
-					}
-					break;
-				case CenterSettingService_Method_GetCertainAceessUrl:
-					{
-						SpReqAnsContext<CenterSettingService_GetCertainAceessUrl_Req,CenterSettingService_GetCertainAceessUrl_Ans>::Pointer ctx;
-						ctx.Attach(new SpReqAnsContext<CenterSettingService_GetCertainAceessUrl_Req,CenterSettingService_GetCertainAceessUrl_Ans>(pTransactionContext));
-						SpBuffer2Object(Buf, ctx->Req);
-						pTransactionContext->GetLinkContext(ctx->link);
-						EntityResource::setLink(ctx->link);
-						Handle_GetCertainAceessUrl(ctx);
-					}
-					break;
-				default:
-					assert(0);
-					break;
-			}
-			
-		} else {
-			pTransactionContext->SendAnswer(Error);
-		}
-	}
-
-};
-
-
-///////////////////////////
-
-} // namespace CenterSetting
-#endif // __CENTERSETTING_SERVER_G_H

+ 0 - 4
Module/mod_CenterSetting/ChangeLog

@@ -1,4 +0,0 @@
-* 网络不通时不切备用地址(廖桂发,2021年1月26日)
-* 处理主动下载集中配置的问题(廖桂发,2020年12月26日)
-* 2020年10月27日 合并国密版本的代码
-* 2020-7-3 调通与分行服务进行通信的功能,双活机制中用到

+ 0 - 19
Module/mod_CenterSetting/Event.h

@@ -1,19 +0,0 @@
-#pragma once
-
-enum CenterSetting_UserErrorCode
-{
-    CenterSetting_UserErrorCode_Start = 0x10100200,
-    ERR_MOD_CENTERSETTING_CONNECT_FAILED,                //获取集中配置失败
-    EVENT_MOD_CENTERSETTING_CONNECT_SUCC,                //获取集中配置成功
-    ERR_MOD_CENTERSETTING_HTTP_FAILED,                   //HTTP连接失败
-    ERR_MOD_CENTERSETTING_WRITE_FAILED,                  //集中配置写入失败
-    ERR_MOD_CENTERSETTING_LOST,		          		     //集中配置丢失
-    EVENT_MOD_CENTERSETTING_UPDATE_VERSION_FAILED,    	 //上传版本号失败
-    EVENT_MOD_CENTERSETTING_UPDATE_VERSION_SUCC,      	 //上传版本号成功
-    EVENT_MOD_CENTERSETTING_CENTER,               //总行模式
-    EVENT_MOD_CENTERSETTING_UPDATE_CENTER_FORCE,               //强制下载集中配置
-    EVENT_MOD_CENTERSETTING_UPDATE_CENTER,               //集中配置发生更新(总行)  
-};
-
-// 下载成功	事件	2	0x10100011	向后台成功进行配置下载,或完成比较当前序列化版本为后台最新版本。
-#define EVENT_MOD_CENTERSETTING_DOWNOK	0x10100011

+ 0 - 239
Module/mod_CenterSetting/mod_centersetting.cpp

@@ -1,239 +0,0 @@
-#include "stdafx.h"
-#include "SpBase.h"
-#include "Event.h"
-#include "mod_centersetting.h"
-#include <regex>
-#include "fileutil.h"
-#include "array.h"
-using namespace std;
-
-CServerSessionBase* CCenterSettingEntity::OnNewSession(const char* /*pszRemoteEntityName*/, const char* /*pszClass*/)
-{
-	return new CCenterSettingService(this);
-}
-
-void CCenterSettingEntity::OnStarted()
-{
-	GetFunction()->GetPath("CenterSetting", m_strFilePath);
-	GetFunction()->OpenConfig(Config_CenterSetting, m_pCenterConfig);
-
-	GetFunction()->GetPath("RunInfo", m_strBakPath);
-
-#ifdef RVC_OS_WIN
-	m_strBakPath += "\\runcfg\\CenterSetting.ini";
-#else
-	m_strBakPath += SPLIT_SLASH_STR "runcfg" SPLIT_SLASH_STR "CenterSetting.ini";
-#endif
-
-	m_pMicroServiceHelper = new CenterSettingsMicroServiceHelper(this);
-
-	if(!m_pCenterConfig->storageInMem())
-	{
-		m_isUseMemCfg = false;
-		BeginDownloadCenterSetting();
-	}
-	else
-	{
-		m_isUseMemCfg = true;
-	}
-
-	// 启动轮询定时器
-	const DWORD interval = 60000 * 5;
-	GetFunction()->SetTimer(1, this, interval);
-}
-
-void CCenterSettingEntity::OnPreClose(EntityCloseCauseEnum eCloseCause, CSmartPointer<ITransactionContext> pTransactionContext)
-{
-	GetFunction()->KillTimer(1);
-	pTransactionContext->SendAnswer(Error_Succeed);
-}
-
-ErrorCodeEnum CCenterSettingEntity::BeginDownloadCenterSetting(bool bByHand, const string& url)
-{
-	LOG_FUNCTION();
-#ifdef _MSC_VER
-	EnterCriticalSection(&m_lock);
-#else
-	std::unique_lock<std::mutex> lock1(m_lock);
-#endif
-
-	if(!url.empty())
-	{
-		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("update centersettings url...");
-		m_pMicroServiceHelper->UpdateUrl(url);
-	}
-
-#ifdef RVC_OS_WIN
-	int rc = m_pMicroServiceHelper->GetCenterSetting();
-#else
-	int rc = m_pMicroServiceHelper->GetCenterSetting(bByHand);
-#endif
-
-	if(EXIST == rc)
-	{
-	}
-	else if(SUCC == rc)
-	{
-		LogWarn(Severity_Low, Error_Succeed, EVENT_MOD_CENTERSETTING_UPDATE_CENTER,
-				CSimpleStringA::Format("下载集中配置成功:%s", m_pMicroServiceHelper->GetCurUrl().c_str()));
-		LogEvent(Severity_Low, EVENT_MOD_CENTERSETTING_UPDATE_CENTER, "Update Centersetting.");
-		if (bByHand)
-			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setLogCode("QLR040210101")("手工下载集中配置成功");
-		else
-			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setLogCode("QLR0402101Z01")("自动下载集中配置成功");
-	}
-	else
-	{
-		LogWarn(Severity_High, Error_Unexpect, ERR_MOD_CENTERSETTING_CONNECT_FAILED,
-				CSimpleStringA::Format("下载集中配置失败:%s", m_pMicroServiceHelper->GetErrMsg()));
-		if (!bByHand)
-			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setLogCode("QLR0402101Z01").setResultCode("RTA1104")("集中配置下载失败");
-	}
-
-	if(m_spDownloadCall != NULL)
-	{
-		m_spDownloadCall->Ans.downloadStat = rc;
-		m_spDownloadCall->Ans.retCenterConfigUrl = m_pMicroServiceHelper->GetCurUrl().c_str();
-
-		if(rc == AllAddressNull)
-		{
-			m_spDownloadCall->Ans.strErrMsg = "所有地址都为空,请检查终端版本";
-			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setLogCode("QLR040210101").setResultCode("RTA1101")("所有集中配置下载地址都为空");
-		}
-		else if(rc == AccessServiceFail)
-		{
-			m_spDownloadCall->Ans.strErrMsg = "网络异常,请检查网络连接情况";
-			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setLogCode("QLR040210101").setResultCode("RTA1102")("网络异常,请检查网络连接情况");
-		}
-		else if(rc == CalcSM3Fail || rc == CheckSM3Fail)
-		{
-			m_spDownloadCall->Ans.strErrMsg = "集中配置内容校验失败,请重试";
-			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setLogCode("QLR040210101").setResultCode("RTA1103")("集中配置内容校验失败");
-		}
-		else if(rc == MANUAL)
-		{
-			m_spDownloadCall->Ans.strErrMsg = "集中配置下载失败";
-			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setLogCode("QLR040210101").setResultCode("RTA1104")("集中配置下载失败");
-		}
-		else if(rc == EXIST)
-		{
-			m_spDownloadCall->Ans.strErrMsg = "集中配置已是最新版本";
-		}
-
-		CSimpleStringA hostUrl;
-		m_pCenterConfig->ReadConfigValue("AccessAuthorization", "HostInitUrl", hostUrl);
-		m_spDownloadCall->Ans.HostUrl = hostUrl;
-
-		m_spDownloadCall->Answer(Error_Succeed);
-		m_spDownloadCall.Clear();
-	}
-#ifdef _MSC_VER
-	LeaveCriticalSection(&m_lock);
-#endif
-	return Error_Succeed;
-}
-
-ErrorCodeEnum CCenterSettingEntity::DownloadCenterSetting(SpReqAnsContext<CenterSettingService_Downloadv2_Req, CenterSettingService_Downloadv2_Ans>::Pointer sp)
-{
-	if (m_spDownloadCall != NULL)
-	{
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("DownloadCenterSetting")
-			("last download call not complet");
-		sp->Answer(Error_Duplication);
-		return Error_Duplication;
-	}
-
-	m_spDownloadCall = sp;
-	ErrorCodeEnum error = BeginDownloadCenterSetting(true, sp->Req.reqCenterConfigUrl.GetData());
-	if (error != Error_Succeed) {
-		m_spDownloadCall = nullptr;
-		if (sp != NULL) {
-			sp->Answer(Error_Succeed);
-		}
-		return error;
-	}
-	return Error_Succeed;
-}
-
-DWORD getCenterCfgThread(LPVOID param)
-{
-	CCenterSettingEntity* req = (CCenterSettingEntity*)param;
-	bool isUpdate = false, isReset = false;
-	CSimpleString version;
-	if(false == req->GetFunction()->HasPrivilege())
-	{
-		LogWarn(Severity_High, Error_Unexpect, ERR_MOD_CENTERSETTING_CONNECT_FAILED,
-			CSimpleStringA::Format("下载集中配置失败:%s do not has privilege", __FUNCTION__));
-		DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setLogCode("QLR0402101Z01").setResultCode("RTA1104")("集中配置下载失败");
-		return -1;
-	}
-
-
-	auto ret = req->GetFunction()->GetPrivilegeFunction()->TryUpdateCenterCfg(isUpdate, isReset, version);
-	if (ret != ErrorCodeEnum::Error_Succeed)
-	{
-		LogWarn(Severity_High, Error_Unexpect, ERR_MOD_CENTERSETTING_CONNECT_FAILED,
-			CSimpleStringA::Format("下载集中配置失败:%d", ret));
-		DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setLogCode("QLR0402101Z01").setResultCode("RTA1104")("集中配置下载失败");
-		return -1;
-	}
-
-	if (!isUpdate)
-	{
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("GetCenterSetting")("Centersetting not changed from spshell");
-		return -1;
-	}
-
-	LogWarn(Severity_Low, Error_Succeed, EVENT_MOD_CENTERSETTING_UPDATE_CENTER,
-		CSimpleStringA::Format("下载集中配置成功,版本号变更成:%s", version.GetData()));
-	LogEvent(Severity_Low, EVENT_MOD_CENTERSETTING_UPDATE_CENTER, "Update Centersetting.");
-
-	if (isReset)
-		LogEvent(Severity_Middle, EVENT_MOD_CENTERSETTING_CRITICAL_UPDATE, "SpShell:Update centersetting with critical items.");
-	return 0;
-}
-
-void CCenterSettingEntity::OnTimeout(DWORD dwTimerID)
-{
-	if(m_isUseMemCfg)
-	{
-		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("use memory config....");
-		CloseHandle(CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)&getCenterCfgThread, this, 0, NULL));
-	} 
-	else
-	{
-		BeginDownloadCenterSetting();
-	}
-		
-}
-
-ErrorCodeEnum CCenterSettingEntity::GetAccessUrl(CSimpleStringA& url) //初始化地址
-{
-	CSimpleStringA hostInitUrl;
-	m_pCenterConfig->ReadConfigValue("AccessAuthorization", "HostInitUrl", hostInitUrl);
-	if(hostInitUrl.IsNullOrEmpty())
-		url = "初始化地址为空";
-	else
-		url = hostInitUrl;
-
-	return Error_Succeed;
-}
-
-ErrorCodeEnum CCenterSettingEntity::GetCertainAceessUrl(CSimpleStringA& accessName, CSimpleStringA& url) //准入地址
-{
-	LOG_FUNCTION();
-	CSimpleStringA tUrl;
-	m_pCenterConfig->ReadConfigValue("AccessAuthorization", accessName.GetData(), tUrl);
-	if (tUrl.IsNullOrEmpty())
-		url = "地址为空";
-	else
-		url = tUrl;
-
-	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("准入地址 = %s", url.GetData());
-	return Error_Succeed;
-}
-
-SP_BEGIN_ENTITY_MAP()
-	SP_ENTITY(CCenterSettingEntity)
-SP_END_ENTITY_MAP()
-

+ 0 - 105
Module/mod_CenterSetting/mod_centersetting.h

@@ -1,105 +0,0 @@
-#ifndef RVC_MOD_CENTERSETTING_H__
-#define RVC_MOD_CENTERSETTING_H__
-
-#pragma once
-
-#include "CenterSetting_server_g.h"
-using namespace CenterSetting;
-#include "CenterSettingConn.h"
-#include <regex>
-#include <map>
-#include <string>
-#ifdef RVC_OS_LINUX
-#include <mutex>
-#endif
-using namespace std;
-
-enum DownloadStat
-{
-	SUCC = 1,
-	AccessServiceFail = 2,
-	EXIST = 3,
-	MANUAL = 4,
-	AllAddressNull = 5,
-	CalcSM3Fail = 6,
-	CheckSM3Fail = 7,
-	UNknown = 8
-};
-
-static void HTTPLogCallback(const char* msg){
-}
-
-class CCenterSettingEntity : public CEntityBase, public ITimerListener
-{
-public:
-	CCenterSettingEntity() : m_strFilePath(true){}
-	virtual ~CCenterSettingEntity() {}
-	virtual const char* GetEntityName() const { return "CenterSetting"; }
-	virtual bool IsService()const{ return true; }
-
-	virtual void OnStarted();
-	virtual void OnPreClose(EntityCloseCauseEnum eCloseCause, CSmartPointer<ITransactionContext> pTransactionContext);
-	virtual void OnTimeout(DWORD dwTimerID);
-	virtual CServerSessionBase* OnNewSession(const char* /*pszRemoteEntityName*/, const char* /*pszClass*/);
-
-	ErrorCodeEnum DownloadCenterSetting(SpReqAnsContext<CenterSettingService_Downloadv2_Req, CenterSettingService_Downloadv2_Ans>::Pointer sp);
-	ErrorCodeEnum GetAccessUrl(CSimpleStringA &url);
-	ErrorCodeEnum GetCertainAceessUrl(CSimpleStringA &accessName, CSimpleStringA& url);
-
-private:
-	ErrorCodeEnum BeginDownloadCenterSetting(bool bByHand = false, const string& url = "");
-
-private:
-
-	CenterSettingsMicroServiceHelper* m_pMicroServiceHelper;
-
-	CSimpleStringA m_strFilePath;
-	CSmartPointer<IConfigInfo> m_pCenterConfig;
-
-	CSimpleStringA m_strBakPath;
-
-#ifdef _MSC_VER
-	CRITICAL_SECTION m_lock;
-#else
-	std::mutex m_lock;
-#endif
-
-	SpReqAnsContext<CenterSettingService_Downloadv2_Req, CenterSettingService_Downloadv2_Ans>::Pointer m_spDownloadCall;
-	friend class CCenterSettingConn;
-	bool m_isUseMemCfg;
-};
-
-class CCenterSettingService : public CenterSettingService_ServerSessionBase
-{
-public:
-	CCenterSettingService(CCenterSettingEntity* pEntity) :m_pEntity(pEntity){}
-	virtual ~CCenterSettingService(){}
-
-	virtual void Handle_Downloadv2(SpReqAnsContext<CenterSettingService_Downloadv2_Req, CenterSettingService_Downloadv2_Ans>::Pointer ctx)
-	{
-		DbgToBeidou(ctx->link, __FUNCTION__)();
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setLogCode(CenterSettingService_LogCode_Downloadv2).setAPI(__FUNCTION__)(__FUNCTION__);
-		m_pEntity->DownloadCenterSetting(ctx);
-	}
-
-	/** 有必要废弃,采用通用化的接口获取即可,特别是要JS化时 [Gifur@2023823]*/
-	virtual void Handle_GetAccessUrl(SpReqAnsContext<CenterSettingService_GetAccessUrl_Req, CenterSettingService_GetAccessUrl_Ans>::Pointer ctx)
-	{
-		DbgToBeidou(ctx->link, __FUNCTION__)();
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setLogCode(CenterSettingService_LogCode_GetAccessUrl).setAPI(__FUNCTION__)(__FUNCTION__);
-		auto rc = m_pEntity->GetAccessUrl(ctx->Ans.HostUrl); //获取初始化地址,是的,就是初始化地址,不要在意这里的名称问题,之前同事开发接口的时候估计随手一打
-		ctx->Answer(rc);
-	}
-
-	virtual void Handle_GetCertainAceessUrl(SpReqAnsContext<CenterSettingService_GetCertainAceessUrl_Req, CenterSettingService_GetCertainAceessUrl_Ans>::Pointer ctx)
-	{
-		DbgToBeidou(ctx->link, __FUNCTION__)();
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setLogCode(CenterSettingService_LogCode_GetCertainAceessUrl).setAPI(__FUNCTION__)(__FUNCTION__);
-		auto rc = m_pEntity->GetCertainAceessUrl(ctx->Req.reqName, ctx->Ans.CertainAceessUrl); //获取准入地址,这个接口是后面加的
-		ctx->Answer(rc);
-	}
-private:
-	CCenterSettingEntity* m_pEntity;
-};
-
-#endif /*RVC_MOD_CENTERSETTING_H__*/

+ 0 - 3
Module/mod_CenterSetting/test/testCenterSettingEntity.cpp

@@ -1,3 +0,0 @@
-
-#include "mod_centersetting.h"
-

+ 35 - 0
Module/mod_HSPScanner/HSPSCanner_LogCode.h

@@ -0,0 +1,35 @@
+#ifndef _HSPSCANNER_USER_LOGRCODE_H
+#define _HSPSCANNER_USER_LOGRCODE_H
+#pragma once
+
+
+/*
+*/
+
+#define CustomLogCode_Start "QLR0402217A0"
+#define CustomLogCode_Reset "QLR0402217A1"
+
+#define CustomLogCode_Preview_Default "QLR0402217A2"
+#define CustomLogCode_CancelPreview_Default "QLR0402217A3"
+
+
+/*
+#define HSPScannerService_LogCode_StartPreview "QLR040221700"
+#define HSPScannerService_LogCode_CancelPreview "QLR040221701"
+#define HSPScannerService_LogCode_ScanImage "QLR040221702"
+#define HSPScannerService_LogCode_ScanImageEx "QLR040221703"
+#define HSPScannerService_LogCode_SetProperty "QLR040221704"
+#define HSPScannerService_LogCode_SetWinPos "QLR040221705"
+#define HSPScannerService_LogCode_ShowProperty "QLR040221706"
+#define HSPScannerService_LogCode_GetDevStatus "QLR040221707"
+#define HSPScannerService_LogCode_GetDevInfo "QLR040221799"
+#define HSPScannerService_LogCode_Exit "QLR040221708"
+#define HSPScannerService_LogCode_StartPreviewJS "QLR040221709"
+#define HSPScannerService_LogCode_CancelPreviewJS "QLR040221710"
+#define HSPScannerService_LogCode_ScanImageJS "QLR040221711"
+#define HSPScannerService_LogCode_SetParamJS "QLR040221712"
+
+*/
+
+
+#endif //_HSPSCANNER_USER_LOGRCODE_H

+ 0 - 4
Module/mod_HSPScanner/HSPSCanner_UserErrorCode.h

@@ -2,10 +2,6 @@
 #define _HSPSCANNER_USER_ERRORCODE_H
 #pragma once
 
-#define HSPScannerService_CustomLogCode_Start "QLR040221720"
-#define HSPScannerService_CustomLogCode_Reset "QLR040221721"
-
-
 #define LOG_ERR_HSPS_DEVOPEN_FAILED 0x21700001
 #define LOG_ERR_HSPS_PREVIEW_FAILED 0x21700003
 #define LOG_EVT_HSPS_CANCEL_PREVIEW_FAILED 0x21700004

+ 42 - 17
Module/mod_HSPScanner/HSPScannerFSM.cpp

@@ -13,6 +13,7 @@
 #else
 #include <opencv2/opencv.hpp>
 #endif //NOT _WIN32
+#include "HSPSCanner_LogCode.h"
 
 #define RESET_TIMER_ID 1
 #define CHECK_CONNECT_TIMER_ID 2
@@ -111,6 +112,29 @@ CSimpleStringA CombineJsonContext(const char* szMessage)
 	return  result;
 }
 
+CSimpleStringA CombineJsonContext4SetPreview(bool bOpen, const char* szMessage = NULL)
+{
+	CSimpleStringA result(true);
+	if (szMessage == NULL || strlen(szMessage) == 0) {
+		if (bOpen) {
+			result = CSimpleStringA::Format("{\"PreviewSwitch\": ON}");
+		}
+		else {
+			result = CSimpleStringA::Format("{\"PreviewSwitch\": OFF}");
+		}
+	}
+	else {
+		if (bOpen) {
+			result = CSimpleStringA::Format("{\"addition\": \"%s\", \"PreviewSwitch\": ON}", szMessage);
+		}
+		else {
+			result = CSimpleStringA::Format("{\"addition\": \"%s\", \"PreviewSwitch\": OFF}", szMessage);
+		}
+	}
+	return  result;
+}
+
+
 CHSPScannerFSM::CHSPScannerFSM(void)
 	:
 	m_ecSelfTest(Error_Succeed),
@@ -752,7 +776,7 @@ unsigned int CHSPScannerFSM::s3_Failed_on_event(FSMEvent* e)
 				ULONGLONG ullEnd = SP::Module::Comm::RVCGetTickCount();
 				if (FAILURED(erroCode)) {
 					//RTA2N0B
-					SetErrorAndLog(erroCode, MEC_DEVAPI_HSPSCANNER_Reset, "DevAdapter::Reset", __FUNCTION__, false, ullEnd - ullStart, HSPScannerService_CustomLogCode_Reset);
+					SetErrorAndLog(erroCode, MEC_DEVAPI_HSPSCANNER_Reset, "DevAdapter::Reset", __FUNCTION__, false, ullEnd - ullStart, CustomLogCode_Reset);
 					SetDevState(DEVICE_STATUS_FAULT);
 					uRet = 1;
 				} else {
@@ -762,7 +786,7 @@ unsigned int CHSPScannerFSM::s3_Failed_on_event(FSMEvent* e)
 					ullEnd = SP::Module::Comm::RVCGetTickCount();
 					if (FAILURED(eXYW)) {
 						//RTA2N07
-						SetErrorAndLog(eXYW, MEC_DEVAPI_HSPSCANNER_SetViewPos, "DevAdapter::SetViewPos", __FUNCTION__, false, ullEnd - ullStart, HSPScannerService_CustomLogCode_Reset);
+						SetErrorAndLog(eXYW, MEC_DEVAPI_HSPSCANNER_SetViewPos, "DevAdapter::SetViewPos", __FUNCTION__, false, ullEnd - ullStart, CustomLogCode_Reset);
 						SetDevState(DEVICE_STATUS_FAULT);
 						uRet = 1;
 						e->SetHandled();
@@ -780,10 +804,10 @@ unsigned int CHSPScannerFSM::s3_Failed_on_event(FSMEvent* e)
 								erroCode = m_hDevHelper->SetPreview(0);
 								ullEnd = SP::Module::Comm::RVCGetTickCount();
 								if (erroCode == Error_Succeed) {
-									DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("DevAdapter::CancelPreview").setCostTime(ullEnd - ullStart)();
+									DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setLogCode(CustomLogCode_CancelPreview_Default).setAPI("DevAdapter::SetPreview").setCostTime(ullEnd - ullStart)(CombineJsonContext4SetPreview(false));
 								} else {
 									//RTA2N04
-									SetErrorAndLog(erroCode, MEC_DEVAPI_HSPSCANNER_SetPreview_Close, "DevAdapter::CancelPreview", __FUNCTION__, false, ullEnd - ullStart, HSPScannerService_CustomLogCode_Reset);
+									SetErrorAndLog(erroCode, MEC_DEVAPI_HSPSCANNER_SetPreview_Close, "DevAdapter::SetPreview", __FUNCTION__, false, ullEnd - ullStart, CustomLogCode_CancelPreview_Default, CombineJsonContext4SetPreview(false));
 								}
 							} while (false);
 							do 
@@ -799,7 +823,7 @@ unsigned int CHSPScannerFSM::s3_Failed_on_event(FSMEvent* e)
 									}
 									else {
 										//RTA2N0Q
-										SetErrorAndLog(erroCode, MEC_DEVAPI_HSPSCANNER_SetParam, "DevAdapter::SetParam", __FUNCTION__, false, ullEnd - ullStart, HSPScannerService_CustomLogCode_Reset, CombineJsonContext("HSPS_VIEW_HIDE"));
+										SetErrorAndLog(erroCode, MEC_DEVAPI_HSPSCANNER_SetParam, "DevAdapter::SetParam", __FUNCTION__, false, ullEnd - ullStart, CustomLogCode_Reset, CombineJsonContext("HSPS_VIEW_HIDE"));
 									}
 								}
 							} while (false);
@@ -814,12 +838,12 @@ unsigned int CHSPScannerFSM::s3_Failed_on_event(FSMEvent* e)
 									DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("DevAdapter::SetParam").setCostTime(ullEnd - ullStart)("HSPS_VIEW_HIDE");
 								} else {
 									//RTA2N0Q
-									SetErrorAndLog(erroCode, MEC_DEVAPI_HSPSCANNER_SetParam, "DevAdapter::SetParam", __FUNCTION__, false, ullEnd - ullStart, HSPScannerService_CustomLogCode_Reset, CombineJsonContext("HSPS_VIEW_HIDE"));
+									SetErrorAndLog(erroCode, MEC_DEVAPI_HSPSCANNER_SetParam, "DevAdapter::SetParam", __FUNCTION__, false, ullEnd - ullStart, CustomLogCode_Reset, CombineJsonContext("HSPS_VIEW_HIDE"));
 								}
 							} while (false);
 						}
 						else {
-							DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM).setLogCode(HSPScannerService_CustomLogCode_Reset)("Recover routine done");
+							DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM).setLogCode(CustomLogCode_Reset)("Recover routine done");
 							uRet = 2;
 						}
 					}
@@ -1485,10 +1509,10 @@ int CHSPScannerFSM::StartPreview(SpReqAnsContext<HSPScannerService_StartPreview_
 		const ULONGLONG ullEnd = SP::Module::Comm::RVCGetTickCount();
 		if (FAILURED(erroCode)) {
 			//RTA2N03
-			SetErrorAndLog(erroCode, MEC_DEVAPI_HSPSCANNER_SetPreview_Open, "DevAdapter::SetPreview", __FUNCTION__, IsInBusiness(), ullEnd - ullStart, HSPScannerService_LogCode_StartPreview, CombineJsonContext("StartPreview::SetPreview(1)"));
+			SetErrorAndLog(erroCode, MEC_DEVAPI_HSPSCANNER_SetPreview_Open, "DevAdapter::SetPreview", __FUNCTION__, IsInBusiness(), ullEnd - ullStart, HSPScannerService_LogCode_StartPreview, CombineJsonContext4SetPreview(true, "StartPreview"));
 			SetLastUserCode(GetAlarmDEC());
 		} else {
-			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setLogCode(HSPScannerService_LogCode_StartPreview).setAPI("DevAdapter::SetPreview").setCostTime(ullEnd - ullStart)("StartPreview::SetPreview(1)");
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setLogCode(HSPScannerService_LogCode_StartPreview).setAPI("DevAdapter::SetPreview").setCostTime(ullEnd - ullStart)(CombineJsonContext4SetPreview(true, "StartPreview"));
 		}
 	}
 
@@ -1529,10 +1553,10 @@ int CHSPScannerFSM::StopPreview(SpReqAnsContext<HSPScannerService_CancelPreview_
 		const ULONGLONG ullEnd = SP::Module::Comm::RVCGetTickCount();
 		if (ISSUCCEEDED(erroCode)) {
 			nRes = 2;
-			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setLogCode(HSPScannerService_LogCode_CancelPreview).setAPI("DevAdapter::CancelPreview").setCostTime(ullEnd - ullStart)("SetPreview(0) succ");
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setLogCode(HSPScannerService_LogCode_CancelPreview).setAPI("DevAdapter::SetPreview").setCostTime(ullEnd - ullStart)(CombineJsonContext4SetPreview(false));
 		} else {
 			//RTA2N04
-			SetErrorAndLog(erroCode, MEC_DEVAPI_HSPSCANNER_SetPreview_Close, "DevAdapter::CancelPreview", __FUNCTION__, IsInBusiness(), ullEnd - ullStart, HSPScannerService_LogCode_CancelPreview, CombineJsonContext("SetPreview(0)"));
+			SetErrorAndLog(erroCode, MEC_DEVAPI_HSPSCANNER_SetPreview_Close, "DevAdapter::SetPreview", __FUNCTION__, IsInBusiness(), ullEnd - ullStart, HSPScannerService_LogCode_CancelPreview, CombineJsonContext4SetPreview(false));
 			const DWORD dwCode = GetAlarmDEC();
 			CSimpleStringA tmpRTA(true), tmpDesc(true);
 			if (GetEntityBase()->GetFunction()->GetVTMErrMsg(dwCode, tmpDesc, tmpRTA) == Error_Succeed)
@@ -2077,11 +2101,11 @@ ErrorCodeEnum CHSPScannerFSM::OnDevExit()
 				erroCode = m_hDevHelper->SetPreview(0);
 				const ULONGLONG ullEnd = SP::Module::Comm::RVCGetTickCount();
 				if (ISSUCCEEDED(erroCode)) {
-					DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setLogCode(__FUNCTION__).setAPI("DevAdapter::CancelPreview").setCostTime(ullEnd - ullStart)("OnDevExit::SetPreview(0)");
+					DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setLogCode(__FUNCTION__).setLogCode(CustomLogCode_CancelPreview_Default).setAPI("DevAdapter::SetPreview").setCostTime(ullEnd - ullStart)(CombineJsonContext4SetPreview(false, "OnDevExit"));
 					ToSwithLight(false);
 				} else {
 					//RTA2N04
-					SetErrorAndLog(erroCode, MEC_DEVAPI_HSPSCANNER_SetPreview_Close, "DevAdapter::CancelPreview", __FUNCTION__, false, ullEnd - ullStart, "", CombineJsonContext("OnDevExit::SetPreview(0)"));
+					SetErrorAndLog(erroCode, MEC_DEVAPI_HSPSCANNER_SetPreview_Close, "DevAdapter::SetPreview", __FUNCTION__, false, ullEnd - ullStart, CustomLogCode_CancelPreview_Default, CombineJsonContext4SetPreview(false));
 				}
 			}
 		} else if(ISSUCCEEDED(erroCode) && !status.isConnected){
@@ -2124,15 +2148,16 @@ int CHSPScannerFSM::StartPreviewJS(SpReqAnsContext<HSPScannerService_StartPrevie
 	erroCode = m_hDevHelper->SetPreview(1);
 	ULONGLONG ullEnd = SP::Module::Comm::RVCGetTickCount();
 	if (FAILURED(erroCode)) {
-		SetErrorAndLog(erroCode, MEC_DEVAPI_HSPSCANNER_SetPreview_Open, "DevAdapter::SetPreview", __FUNCTION__, IsInBusiness(), ullEnd - ullStart, HSPScannerService_LogCode_StartPreviewJS, CombineJsonContext("StartPreview::SetPreview(1)"));
+		SetErrorAndLog(erroCode, MEC_DEVAPI_HSPSCANNER_SetPreview_Open, "DevAdapter::SetPreview", __FUNCTION__, IsInBusiness(), ullEnd - ullStart, HSPScannerService_LogCode_StartPreviewJS, CombineJsonContext4SetPreview(true));
 		SetLastUserCode(GetAlarmDEC());
 		erroCode = Error_Unexpect;
 		ret = 1;
 	}
 	else {
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setLogCode(HSPScannerService_LogCode_StartPreviewJS).setAPI("DevAdapter::SetPreview").setCostTime(ullEnd - ullStart)("StartPreview::SetPreview(1)");
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setLogCode(HSPScannerService_LogCode_StartPreviewJS).setAPI("DevAdapter::SetPreview").setCostTime(ullEnd - ullStart)(CombineJsonContext4SetPreview(true, "StartPreview"));
 		ToSwithLight();
 	}
+
 	ctx->Answer(erroCode, GetLastUserCode());
 	return ret;
 }
@@ -2159,12 +2184,12 @@ int CHSPScannerFSM::CancelPreview(SpReqAnsContext<HSPScannerService_CancelPrevie
 		erroCode = m_hDevHelper->SetPreview(0);
 		const ULONGLONG ullEnd = SP::Module::Comm::RVCGetTickCount();
 		if (ISSUCCEEDED(erroCode)) {
-			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setLogCode(HSPScannerService_LogCode_CancelPreviewJS).setAPI("DevAdapter::CancelPreview").setCostTime(ullEnd - ullStart)("SetPreview(0) succ");
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setLogCode(HSPScannerService_LogCode_CancelPreviewJS).setAPI("DevAdapter::SetPreview").setCostTime(ullEnd - ullStart)(CombineJsonContext4SetPreview(false, "JS::CancelPreview"));
 			ctx->Answer(Error_Succeed);
 		}
 		else {
 			//RTA2N04
-			SetErrorAndLog(erroCode, LOG_EVT_HSPS_CANCEL_PREVIEW_FAILED, "DevAdapter::CancelPreview", __FUNCTION__, IsInBusiness(), ullEnd - ullStart, HSPScannerService_LogCode_CancelPreviewJS, CombineJsonContext("SetPreview(0)"));
+			SetErrorAndLog(erroCode, LOG_EVT_HSPS_CANCEL_PREVIEW_FAILED, "DevAdapter::SetPreview", __FUNCTION__, IsInBusiness(), ullEnd - ullStart, HSPScannerService_LogCode_CancelPreviewJS, CombineJsonContext4SetPreview(false));
 			SetLastUserCode(GetAlarmDEC());
 			ctx->Answer(Error_Unexpect, GetLastUserCode());
 			ret = 1;

+ 70 - 304
Module/mod_IDCertificate/IDCertFSM.cpp

@@ -536,6 +536,12 @@ int CIDCertFSM::ReadAndScanUTF8(SpReqAnsContext<IDCert_ReadAndScanUTF8_Req, IDCe
 {
 	LOG_FUNCTION();
 
+	ULLINT OpenRFControlTime = 0;
+	ULLINT CloseRFControlTime = 0;
+	ULLINT IDCerAuthenticateTime = 0;
+	ULLINT IDCerGetDataEx2Time = 0;
+	ULLINT ScanIDAndSaveImageTime = 0;
+
 	DWORD elapsed = 0;
 	DWORD dwStart = SP::Module::Comm::RVCGetTickCount();
 	DWORD dwEnd = SP::Module::Comm::RVCGetTickCount();
@@ -589,10 +595,12 @@ int CIDCertFSM::ReadAndScanUTF8(SpReqAnsContext<IDCert_ReadAndScanUTF8_Req, IDCe
 			m_ullBeginTime = SP::Module::Comm::RVCGetTickCount();
 			errRfOpen = m_hDevHelper->IDCerRFControl(true);
 			m_ullEndTime = SP::Module::Comm::RVCGetTickCount();
+			OpenRFControlTime = m_ullEndTime - m_ullBeginTime;
 			if (Error_Succeed == errRfOpen)
 			{
 				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)
-					.setAPI("DevAdapter::IDCerRFControl").setCostTime(m_ullEndTime - m_ullBeginTime)();
+					.setAPI("DevAdapter::IDCerRFControl").setLogCode(IDCertService_LogCode_OpenIDCerRFControl)
+					.setCostTime(OpenRFControlTime)();
 			}
 			else
 			{
@@ -609,6 +617,7 @@ int CIDCertFSM::ReadAndScanUTF8(SpReqAnsContext<IDCert_ReadAndScanUTF8_Req, IDCe
 		m_ullBeginTime = SP::Module::Comm::RVCGetTickCount();
 		errAuth = m_hDevHelper->IDCerAuthenticate();
 		m_ullEndTime = SP::Module::Comm::RVCGetTickCount();
+		IDCerAuthenticateTime = m_ullEndTime - m_ullBeginTime;
 		if (Error_Succeed != errAuth)
 		{
 			dwEnd = SP::Module::Comm::RVCGetTickCount();
@@ -618,12 +627,13 @@ int CIDCertFSM::ReadAndScanUTF8(SpReqAnsContext<IDCert_ReadAndScanUTF8_Req, IDCe
 		else
 		{
 			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)
-				.setAPI("DevAdapter::IDCerAuthenticate").setCostTime(m_ullEndTime - m_ullBeginTime)();
+				.setAPI("DevAdapter::IDCerAuthenticate").setCostTime(IDCerAuthenticateTime)();
 			bIDCerAuthenticate = true;
 
 			m_ullBeginTime = SP::Module::Comm::RVCGetTickCount();
 			errReadEx2 = m_hDevHelper->IDCerGetDataEx2(idInfoEx2);
 			m_ullEndTime = SP::Module::Comm::RVCGetTickCount();
+			IDCerGetDataEx2Time = m_ullEndTime - m_ullBeginTime;
 
 			if (errReadEx2 == Error_NotImpl)
 			{
@@ -659,8 +669,7 @@ int CIDCertFSM::ReadAndScanUTF8(SpReqAnsContext<IDCert_ReadAndScanUTF8_Req, IDCe
 					unsigned char IssuedSN[1024]; memset(IssuedSN, 0, 1024); //换证次数
 
 					DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER)
-						.setAPI("DevAdapter::IDCerGetDataEx2").setCostTime(m_ullEndTime - m_ullBeginTime)
-						.setLogCode(IDCertService_LogCode_ReadAndScanUTF8)();
+						.setAPI("DevAdapter::IDCerGetDataEx2").setCostTime(IDCerGetDataEx2Time)();
 					bReadSuccess = true;
 					LogEvent(Severity_Middle, LOG_EVT_IDCERTIFICATE_OP, "IDCertifacate op.");
 
@@ -816,10 +825,13 @@ int CIDCertFSM::ReadAndScanUTF8(SpReqAnsContext<IDCert_ReadAndScanUTF8_Req, IDCe
 						m_ullBeginTime = SP::Module::Comm::RVCGetTickCount();
 						eErr = m_hDevHelper->ScanIDAndSaveImage();
 						m_ullEndTime = SP::Module::Comm::RVCGetTickCount();
+						ScanIDAndSaveImageTime = m_ullEndTime - m_ullBeginTime;
+
 						if (eErr == Error_Succeed)
 						{
 							curDeleteType = Bmp_ZP | Bmp_SCAN;
-							DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("DevAdapter::ScanIDAndSaveImage").setCostTime(m_ullEndTime - m_ullBeginTime)();
+							DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("DevAdapter::ScanIDAndSaveImage")
+								.setCostTime(ScanIDAndSaveImageTime)();
 
 							transImgMsg.Clear();
 							//idfront.bmp" and "idback.bmp
@@ -867,7 +879,7 @@ int CIDCertFSM::ReadAndScanUTF8(SpReqAnsContext<IDCert_ReadAndScanUTF8_Req, IDCe
 						{
 							if (eErr != Error_NotImpl)
 								SetErrorAndLog(eErr, MEC_DEVAPI_IDCER_ScanIDAndSaveImage, "DevAdapter::ScanIDAndSaveImage", __FUNCTION__,
-									false, m_ullEndTime - m_ullBeginTime, IDCertService_LogCode_ReadAndScanUTF8);
+									false, ScanIDAndSaveImageTime);
 						}
 					}
 
@@ -904,114 +916,21 @@ int CIDCertFSM::ReadAndScanUTF8(SpReqAnsContext<IDCert_ReadAndScanUTF8_Req, IDCe
 	m_bReading = false;
 	LogEvent(Severity_Middle, LOG_EVT_IDCERTIFICATE_GREEN_OFF, "IDCer warning off");
 
-	int pos = 99;
 	m_ullBeginTime = SP::Module::Comm::RVCGetTickCount();
-	ErrorCodeEnum eErr1 = m_hDevHelper->QueryCardPos(pos);
+	ErrorCodeEnum eErr1 = m_hDevHelper->IDCerRFControl(false);
 	m_ullEndTime = SP::Module::Comm::RVCGetTickCount();
-	if (eErr1 == Error_NotImpl)
+	CloseRFControlTime = m_ullEndTime - m_ullBeginTime;
+
+	if (eErr1 != Error_Succeed)
 	{
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("DevAdapter::QueryCardPos").setCostTime(m_ullEndTime - m_ullBeginTime)
-			("old version.no need position.");
+		SetErrorAndLog(eErr1, MEC_DEVAPI_IDCER_IDCerRFControl, "DevAdapter::IDCerRFControl", __FUNCTION__,
+			false, CloseRFControlTime, IDCertService_LogCode_CloseIDCerRFControl);
 	}
 	else
 	{
-		if (eErr1 == Error_Succeed)
-		{
-			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("DevAdapter::QueryCardPos")
-				.setCostTime(m_ullEndTime - m_ullBeginTime)();
-			switch (pos)
-			{
-			case 1:
-			case 2:
-				m_ullBeginTime = SP::Module::Comm::RVCGetTickCount();
-				eErr1 = m_hDevHelper->IDCerRFControl(false);
-				m_ullEndTime = SP::Module::Comm::RVCGetTickCount();
-				if (eErr1 != Error_Succeed)
-				{
-					SetErrorAndLog(eErr1, MEC_DEVAPI_IDCER_IDCerRFControl, "DevAdapter::IDCerRFControl", __FUNCTION__,
-						false, m_ullEndTime - m_ullBeginTime);
-					
-					m_ullBeginTime = SP::Module::Comm::RVCGetTickCount();
-					ErrorCodeEnum errEject = m_hDevHelper->ForceIDEject();
-					m_ullEndTime = SP::Module::Comm::RVCGetTickCount();
-					
-					if (errEject != Error_Succeed)
-					{
-						SetErrorAndLog(errEject, MEC_DEVAPI_IDCER_ForceIDEject, "DevAdapter::ForceIDEject", __FUNCTION__,
-							false, m_ullEndTime - m_ullBeginTime);
-					}
-					else
-					{
-						DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("DevAdapter::ForceIDEject").setCostTime(m_ullEndTime - m_ullBeginTime)();
-					}
-
-					CheckEjectCardRes(eErr1, errEject);
-				}
-				else
-				{
-					DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("DevAdapter::CloseIDCerRFControl")
-						.setCostTime(m_ullEndTime - m_ullBeginTime)();
-				}
-				break;
-			case 0:
-			default:
-				break;
-			}
-		}
-		else
-		{
-			SetErrorAndLog(eErr1, MEC_DEVAPI_IDCER_QueryCardPos, "DevAdapter::QueryCardPos", __FUNCTION__,
-				false, m_ullEndTime - m_ullBeginTime, IDCertService_LogCode_ReadAndScanUTF8);
-		}
-
-		//查询卡片位置以决定跳转
-		m_ullBeginTime = SP::Module::Comm::RVCGetTickCount();
-		eErr1 = m_hDevHelper->QueryCardPos(pos);
-		m_ullEndTime = SP::Module::Comm::RVCGetTickCount();
-		if (eErr1 == Error_Succeed)
-		{
-			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("DevAdapter::QueryCardPos")
-				.setCostTime(m_ullEndTime - m_ullBeginTime)();
-		}
-		else
-		{
-			SetErrorAndLog(eErr1, MEC_DEVAPI_IDCER_QueryCardPos, "DevAdapter::QueryCardPos", __FUNCTION__,
-				false, m_ullEndTime - m_ullBeginTime, IDCertService_LogCode_ReadAndScanUTF8);
-		}
-	}
-
-	if (eErr1 != Error_Succeed || (eErr1 == Error_Succeed && (pos != 0)))
-	{
-		//oilyang@20180531 add for close enter card
-		m_ullBeginTime = SP::Module::Comm::RVCGetTickCount();
-		ErrorCodeEnum errRf = m_hDevHelper->IDCerRFControl(false);
-		m_ullEndTime = SP::Module::Comm::RVCGetTickCount();
-		if (errRf != Error_Succeed)
-		{
-			SetErrorAndLog(errRf, MEC_DEVAPI_IDCER_IDCerRFControl, "DevAdapter::CloseIDCerRFControl", __FUNCTION__,
-				false, m_ullEndTime - m_ullBeginTime, IDCertService_LogCode_ReadAndScanUTF8);
-			m_ullBeginTime = SP::Module::Comm::RVCGetTickCount();
-			ErrorCodeEnum errEject = m_hDevHelper->ForceIDEject();
-			m_ullEndTime = SP::Module::Comm::RVCGetTickCount();
-
-			if (errEject != Error_Succeed)
-			{
-				SetErrorAndLog(errEject, MEC_DEVAPI_IDCER_ForceIDEject, "DevAdapter::ForceIDEject", __FUNCTION__,
-					false, m_ullEndTime - m_ullBeginTime, IDCertService_LogCode_ReadAndScanUTF8);
-			}
-			else
-			{
-				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)
-					.setAPI("DevAdapter::ForceIDEject").setCostTime(m_ullEndTime - m_ullBeginTime)();
-			}
-
-			CheckEjectCardRes(errRf, errEject);
-		}
-		else
-		{
-			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)
-				.setAPI("DevAdapter::CloseIDCerRFControl").setCostTime(m_ullEndTime - m_ullBeginTime)();
-		}
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("DevAdapter::IDCerRFControl")
+			.setLogCode(IDCertService_LogCode_CloseIDCerRFControl)
+			.setCostTime(CloseRFControlTime)();
 	}
 
 	if (bGetIDCert)
@@ -1028,14 +947,14 @@ int CIDCertFSM::ReadAndScanUTF8(SpReqAnsContext<IDCert_ReadAndScanUTF8_Req, IDCe
 			if (bInvokeReadEx2 && !bReadSuccess) {
 
 				SetErrorAndLog(errReadEx2, MEC_DEVAPI_IDCER_IDCerGetDataEx2, "DevAdapter::IDCerGetDataEx2", __FUNCTION__,
-					true, m_ullEndTime - m_ullBeginTime, IDCertService_LogCode_ReadAndScanUTF8);
+					true, IDCerGetDataEx2Time);
 				ctx->Answer(Error_TimeOut, GetAlarmDEC()); //RTA2109
 			}
 		}
 		else if (!bOpenRF)
 		{
-			SetErrorAndLog(errRfOpen, MEC_DEVAPI_IDCER_IDCerRFControl, "DevAdapter::OpenIDCerRFControl", __FUNCTION__,
-				true, m_ullEndTime - m_ullBeginTime, IDCertService_LogCode_ReadAndScanUTF8);
+			SetErrorAndLog(errRfOpen, MEC_DEVAPI_IDCER_IDCerRFControl, "DevAdapter::IDCerRFControl", __FUNCTION__,
+				true, OpenRFControlTime, IDCertService_LogCode_OpenIDCerRFControl);
 			ctx->Answer(Error_TimeOut, GetAlarmDEC());
 		}
 		else
@@ -1043,36 +962,30 @@ int CIDCertFSM::ReadAndScanUTF8(SpReqAnsContext<IDCert_ReadAndScanUTF8_Req, IDCe
 			if (errAuth == Error_DevMedia)
 			{
 				LogWarn(Severity_Low, Error_Unexpect, IDCertificate_UserErrorCode_Timeout_OtherCard, "读证超时,插入的卡片非身份.");
-				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setLogCode(IDCertService_LogCode_ReadAndScanUTF8)();
+				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setAPI("DevAdapter::IDCerAuthenticate").setCostTime(IDCerAuthenticateTime)();
 				ctx->Answer(Error_TimeOut);
 			}
 			else if(errAuth == Error_Dev_IDCardNotFound)
 			{
 				LogWarn(Severity_Low, Error_Unexpect, IDCertificate_UserErrorCode_Timeout_NoCard, "读证超时,未检测到有卡片插入.");
-				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setLogCode(IDCertService_LogCode_ReadAndScanUTF8)();
+				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setAPI("DevAdapter::IDCerAuthenticate").setCostTime(IDCerAuthenticateTime)();
 				ctx->Answer(Error_TimeOut);
 			}
 			else
 			{
 				SetErrorAndLog(errAuth, MEC_DEVAPI_IDCER_IDCerAuthenticate, "DevAdapter::IDCerAuthenticate", __FUNCTION__,
-					false, m_ullEndTime - m_ullBeginTime, IDCertService_LogCode_ReadAndScanUTF8); //RTA2107
+					false, IDCerAuthenticateTime); //RTA2107
 				ctx->Answer(Error_Unexpect, GetAlarmDEC());
 			}
 		}
 	}
 	else 
 	{
-		DbgWithLink(LOG_LEVEL_ERROR, LOG_TYPE_USER).setLogCode(IDCertService_LogCode_ReadAndScanUTF8).setResultCode("RTA2104")("ReadAndScanUTF8 some thing wrong.");
+		DbgWithLink(LOG_LEVEL_ERROR, LOG_TYPE_USER).setResultCode("RTA2104")("ReadAndScanUTF8JS some thing wrong.");
 		ctx->Answer(Error_Unexpect, IDCertificate_UserErrorCode_ReadAndScan_Failed);
 		LogError(Severity_High, Error_Unexpect, IDCertificate_UserErrorCode_ReadAndScan_Failed, "ReadAndScanUTF8 some thing wrong.");
 	}
 
-	if (eErr1 == Error_Succeed && pos == 2)
-	{
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("return 4");
-		return 4;
-	}
-
 	if (m_bCancelRead)
 	{
 		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("return 2");
@@ -1095,6 +1008,12 @@ int CIDCertFSM::ReadAndScanUTF8JS(SpReqAnsContext<IDCert_ReadAndScanUTF8JS_Req,
 {
 	LOG_FUNCTION();
 
+	ULLINT OpenRFControlTime = 0;
+	ULLINT CloseRFControlTime = 0;
+	ULLINT IDCerAuthenticateTime = 0;
+	ULLINT IDCerGetDataEx2Time = 0;
+	ULLINT ScanIDAndSaveImageTime = 0;
+
 	DWORD elapsed = 0;
 	DWORD dwStart = SP::Module::Comm::RVCGetTickCount();
 	DWORD dwEnd = SP::Module::Comm::RVCGetTickCount();
@@ -1148,11 +1067,13 @@ int CIDCertFSM::ReadAndScanUTF8JS(SpReqAnsContext<IDCert_ReadAndScanUTF8JS_Req,
 			m_ullBeginTime = SP::Module::Comm::RVCGetTickCount();
 			errRfOpen = m_hDevHelper->IDCerRFControl(true);
 			m_ullEndTime = SP::Module::Comm::RVCGetTickCount();
+			OpenRFControlTime = m_ullEndTime - m_ullBeginTime;
 			
 			if (Error_Succeed == errRfOpen)
 			{
 				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)
-					.setAPI("DevAdapter::OpenIDCerRFControl").setCostTime(m_ullEndTime - m_ullBeginTime)();
+					.setAPI("DevAdapter::IDCerRFControl").setLogCode(IDCertService_LogCode_OpenIDCerRFControl)
+					.setCostTime(OpenRFControlTime)();
 			}
 			else
 			{
@@ -1169,6 +1090,8 @@ int CIDCertFSM::ReadAndScanUTF8JS(SpReqAnsContext<IDCert_ReadAndScanUTF8JS_Req,
 		m_ullBeginTime = SP::Module::Comm::RVCGetTickCount();
 		errAuth = m_hDevHelper->IDCerAuthenticate();
 		m_ullEndTime = SP::Module::Comm::RVCGetTickCount();
+		IDCerAuthenticateTime = m_ullEndTime - m_ullBeginTime;
+
 		if (Error_Succeed != errAuth)
 		{
 			dwEnd = SP::Module::Comm::RVCGetTickCount();
@@ -1178,12 +1101,14 @@ int CIDCertFSM::ReadAndScanUTF8JS(SpReqAnsContext<IDCert_ReadAndScanUTF8JS_Req,
 		else
 		{
 			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)
-				.setAPI("DevAdapter::IDCerAuthenticate").setCostTime(m_ullEndTime - m_ullBeginTime)();
+				.setAPI("DevAdapter::IDCerAuthenticate").setCostTime(IDCerAuthenticateTime)();
 			bIDCerAuthenticate = true;
 
 			m_ullBeginTime = SP::Module::Comm::RVCGetTickCount();
 			errReadEx2 = m_hDevHelper->IDCerGetDataEx2(idInfoEx2);
 			m_ullEndTime = SP::Module::Comm::RVCGetTickCount();
+			IDCerGetDataEx2Time = m_ullEndTime - m_ullBeginTime;
+
 			if (errReadEx2 == Error_NotImpl)
 			{
 				ctx->Ans.msgtype = 0; //旧字段传递,GBK、字符串传递文字信息
@@ -1218,8 +1143,7 @@ int CIDCertFSM::ReadAndScanUTF8JS(SpReqAnsContext<IDCert_ReadAndScanUTF8JS_Req,
 					unsigned char IssuedSN[1024]; memset(IssuedSN, 0, 1024); //换证次数
 
 					DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER)
-						.setAPI("DevAdapter::IDCerGetDataEx2").setCostTime(m_ullEndTime - m_ullBeginTime)
-						.setLogCode(IDCertService_LogCode_ReadAndScanUTF8JS)();
+						.setAPI("DevAdapter::IDCerGetDataEx2").setCostTime(IDCerGetDataEx2Time)();
 					bReadSuccess = true;
 					LogEvent(Severity_Middle, LOG_EVT_IDCERTIFICATE_OP, "IDCertifacate op.");
 
@@ -1375,10 +1299,13 @@ int CIDCertFSM::ReadAndScanUTF8JS(SpReqAnsContext<IDCert_ReadAndScanUTF8JS_Req,
 						m_ullBeginTime = SP::Module::Comm::RVCGetTickCount();
 						eErr = m_hDevHelper->ScanIDAndSaveImage();
 						m_ullEndTime = SP::Module::Comm::RVCGetTickCount();
+						ScanIDAndSaveImageTime = m_ullEndTime - m_ullBeginTime;
+
 						if (eErr == Error_Succeed)
 						{
 							curDeleteType = Bmp_ZP | Bmp_SCAN;
-							DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("DevAdapter::ScanIDAndSaveImage").setCostTime(m_ullEndTime - m_ullBeginTime)();
+							DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("DevAdapter::ScanIDAndSaveImage")
+								.setCostTime(ScanIDAndSaveImageTime)();
 							
 							transImgMsg.Clear();
 							//idfront.bmp" and "idback.bmp
@@ -1426,7 +1353,7 @@ int CIDCertFSM::ReadAndScanUTF8JS(SpReqAnsContext<IDCert_ReadAndScanUTF8JS_Req,
 						{
 							if(eErr != Error_NotImpl)
 							SetErrorAndLog(eErr, MEC_DEVAPI_IDCER_ScanIDAndSaveImage, "DevAdapter::ScanIDAndSaveImage", __FUNCTION__,
-								false, m_ullEndTime - m_ullBeginTime, IDCertService_LogCode_ReadAndScanUTF8JS);
+								false, ScanIDAndSaveImageTime);
 						}
 					}
 
@@ -1459,135 +1386,25 @@ int CIDCertFSM::ReadAndScanUTF8JS(SpReqAnsContext<IDCert_ReadAndScanUTF8JS_Req,
 	if (m_bExit)
 		bExitWhenReading = true;
 
-	if (!m_bExit && !bOpenRF && errRfOpen != Error_Succeed)
-	{
-		SetErrorAndLog(errRfOpen, MEC_DEVAPI_IDCER_IDCerRFControl, "DevAdapter::OpenIDCerRFControl", __FUNCTION__,
-			true, m_ullEndTime - m_ullBeginTime, IDCertService_LogCode_ReadAndScanUTF8JS);
-
-		/*DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)
-			.setResultCode(std::to_string(errRfOpen).c_str())
-			("ReadAndScanUTF8JS::IDCerRFControl Open failed with errcode: %d", errRfOpen);*/
-	}
-
 	m_bExit = false;
 	m_bReading = false;
 	LogEvent(Severity_Middle, LOG_EVT_IDCERTIFICATE_GREEN_OFF, "IDCer warning off");
 
-	int pos = 99;
 	m_ullBeginTime = SP::Module::Comm::RVCGetTickCount();
-	ErrorCodeEnum eErr1 = m_hDevHelper->QueryCardPos(pos);
+	ErrorCodeEnum eErr1 = m_hDevHelper->IDCerRFControl(false);
 	m_ullEndTime = SP::Module::Comm::RVCGetTickCount();
-	if (eErr1 == Error_NotImpl)
+	CloseRFControlTime = m_ullEndTime - m_ullBeginTime;
+
+	if (eErr1 != Error_Succeed)
 	{
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("DevAdapter::QueryCardPos").setCostTime(m_ullEndTime - m_ullBeginTime)
-			("old version.no need position.");
+		SetErrorAndLog(eErr1, MEC_DEVAPI_IDCER_IDCerRFControl, "DevAdapter::IDCerRFControl", __FUNCTION__,
+			false, CloseRFControlTime, IDCertService_LogCode_CloseIDCerRFControl);
 	}
 	else
 	{
-		if (eErr1 == Error_Succeed)
-		{
-			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("DevAdapter::QueryCardPos")
-				.setCostTime(m_ullEndTime - m_ullBeginTime)();
-			switch (pos)
-			{
-			case 1:
-			case 2:
-				m_ullBeginTime = SP::Module::Comm::RVCGetTickCount();
-				eErr1 = m_hDevHelper->IDCerRFControl(false);
-				m_ullEndTime = SP::Module::Comm::RVCGetTickCount();
-				if (eErr1 != Error_Succeed)
-				{
-					//DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("exec IDCerRFControl(false) failed, force eject...");
-					SetErrorAndLog(eErr1, MEC_DEVAPI_IDCER_IDCerRFControl, "DevAdapter::CloseIDCerRFControl", __FUNCTION__,
-						false, m_ullEndTime - m_ullBeginTime);
-					m_ullBeginTime = SP::Module::Comm::RVCGetTickCount();
-					ErrorCodeEnum errEject = m_hDevHelper->ForceIDEject();
-					m_ullEndTime = SP::Module::Comm::RVCGetTickCount();
-					if (errEject != Error_Succeed)
-					{
-						SetErrorAndLog(eErr1, MEC_DEVAPI_IDCER_ForceIDEject, "DevAdapter::ForceIDEject", __FUNCTION__,
-							false, m_ullEndTime - m_ullBeginTime);
-					}
-					else
-					{
-						DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)
-							.setAPI("DevAdapter::ForceIDEject").setCostTime(m_ullEndTime - m_ullBeginTime)();
-					}
-				}
-				else
-				{
-					DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("DevAdapter::CloseIDCerRFControl")
-						.setCostTime(m_ullEndTime - m_ullBeginTime)();
-				}
-				break;
-			case 0:
-			default:
-				break;
-			}
-		}
-		else
-		{
-			SetErrorAndLog(eErr1, MEC_DEVAPI_IDCER_QueryCardPos, "DevAdapter::QueryCardPos", __FUNCTION__,
-				true, m_ullEndTime - m_ullBeginTime, IDCertService_LogCode_ReadAndScanUTF8JS);
-
-			/*DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setAPI("DevAdapter::QueryCardPos")
-				.setCostTime(m_ullEndTime - m_ullBeginTime)
-				.setResultCode("RTA210A")
-				("exec QueryCardPos first time failed.");*/
-		}
-
-		//查询卡片位置以决定跳转
-		m_ullBeginTime = SP::Module::Comm::RVCGetTickCount();
-		eErr1 = m_hDevHelper->QueryCardPos(pos);
-		m_ullEndTime = SP::Module::Comm::RVCGetTickCount();
-		if (eErr1 == Error_Succeed)
-		{
-			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("DevAdapter::QueryCardPos")
-				.setCostTime(m_ullEndTime - m_ullBeginTime)();
-		}
-		else
-		{
-			SetErrorAndLog(eErr1, MEC_DEVAPI_IDCER_QueryCardPos, "DevAdapter::QueryCardPos", __FUNCTION__,
-				true, m_ullEndTime - m_ullBeginTime, IDCertService_LogCode_ReadAndScanUTF8JS);
-
-			/*DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setAPI("DevAdapter::QueryCardPos")
-				.setCostTime(m_ullEndTime - m_ullBeginTime)
-				.setResultCode("RTA210A")
-				("exec QueryCardPos second time failed with errcode: %d", eErr1);*/
-		}
-	}
-
-	if (eErr1 != Error_Succeed || (eErr1 == Error_Succeed && (pos != 0)))
-	{
-		//oilyang@20180531 add for close enter card
-		m_ullBeginTime = SP::Module::Comm::RVCGetTickCount();
-		ErrorCodeEnum errRfClose = m_hDevHelper->IDCerRFControl(false);
-		m_ullEndTime = SP::Module::Comm::RVCGetTickCount();
-		if (errRfClose != Error_Succeed)
-		{
-			SetErrorAndLog(errRfClose, MEC_DEVAPI_IDCER_IDCerRFControl, "DevAdapter::CloseIDCerRFControl", __FUNCTION__,
-				false, m_ullEndTime - m_ullBeginTime, IDCertService_LogCode_ReadAndScanUTF8JS);
-
-			m_ullBeginTime = SP::Module::Comm::RVCGetTickCount();
-			ErrorCodeEnum errEject = m_hDevHelper->ForceIDEject();
-			m_ullEndTime = SP::Module::Comm::RVCGetTickCount();
-
-			if (errEject != Error_Succeed)
-			{
-				SetErrorAndLog(errEject, MEC_DEVAPI_IDCER_ForceIDEject, "DevAdapter::ForceIDEject", __FUNCTION__,
-					false, m_ullEndTime - m_ullBeginTime, IDCertService_LogCode_ReadAndScanUTF8JS);
-			}
-			else
-			{
-				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)
-					.setAPI("DevAdapter::ForceIDEject").setCostTime(m_ullEndTime - m_ullBeginTime)();
-			}
-		}
-		else
-		{
-			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)
-				.setAPI("DevAdapter::CloseIDCerRFControl").setCostTime(m_ullEndTime - m_ullBeginTime)();
-		}
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("DevAdapter::IDCerRFControl")
+			.setLogCode(IDCertService_LogCode_CloseIDCerRFControl)
+			.setCostTime(CloseRFControlTime)();
 	}
 
 	if (bGetIDCert)
@@ -1604,7 +1421,7 @@ int CIDCertFSM::ReadAndScanUTF8JS(SpReqAnsContext<IDCert_ReadAndScanUTF8JS_Req,
 			if (bInvokeReadEx2 && !bReadSuccess) {
 
 				SetErrorAndLog(errReadEx2, MEC_DEVAPI_IDCER_IDCerGetDataEx2, "DevAdapter::IDCerGetDataEx2", __FUNCTION__,
-					true, m_ullEndTime - m_ullBeginTime, IDCertService_LogCode_ReadAndScanUTF8JS);
+					true, IDCerGetDataEx2Time);
 				//DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Invoke IDCerGetDataEx2(Timeout) failed: %s", SpStrError(errReadEx2));
 
 				ctx->Answer(Error_TimeOut, GetAlarmDEC()); //RTA2109
@@ -1612,8 +1429,8 @@ int CIDCertFSM::ReadAndScanUTF8JS(SpReqAnsContext<IDCert_ReadAndScanUTF8JS_Req,
 		}
 		else if (!bOpenRF)
 		{
-			SetErrorAndLog(errRfOpen, MEC_DEVAPI_IDCER_IDCerRFControl, "DevAdapter::OpenIDCerRFControl", __FUNCTION__,
-				true, m_ullEndTime - m_ullBeginTime, IDCertService_LogCode_ReadAndScanUTF8JS);
+			SetErrorAndLog(errRfOpen, MEC_DEVAPI_IDCER_IDCerRFControl, "DevAdapter::IDCerRFControl", __FUNCTION__,
+				true, OpenRFControlTime, IDCertService_LogCode_OpenIDCerRFControl);
 			//DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("Open IDCerRFControl(Timeout) failed: %s", SpStrError(errRfOpen));
 
 			ctx->Answer(Error_TimeOut, GetAlarmDEC());
@@ -1624,36 +1441,30 @@ int CIDCertFSM::ReadAndScanUTF8JS(SpReqAnsContext<IDCert_ReadAndScanUTF8JS_Req,
 			if (errAuth == Error_DevMedia)
 			{
 				LogWarn(Severity_Low, Error_Unexpect, IDCertificate_UserErrorCode_Timeout_OtherCard, "读证超时,插入的卡片非身份.");
-				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setLogCode(IDCertService_LogCode_ReadAndScanUTF8)();
+				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setAPI("DevAdapter::IDCerAuthenticate").setCostTime(IDCerAuthenticateTime)();
 				ctx->Answer(Error_TimeOut);
 			}
 			else if (errAuth == Error_Dev_IDCardNotFound)
 			{
 				LogWarn(Severity_Low, Error_Unexpect, IDCertificate_UserErrorCode_Timeout_NoCard, "读证超时,未检测到有卡片插入.");
-				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setLogCode(IDCertService_LogCode_ReadAndScanUTF8)();
+				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setAPI("DevAdapter::IDCerAuthenticate").setCostTime(IDCerAuthenticateTime)();
 				ctx->Answer(Error_TimeOut);
 			}
 			else
 			{
 				SetErrorAndLog(errAuth, MEC_DEVAPI_IDCER_IDCerAuthenticate, "DevAdapter::IDCerAuthenticate", __FUNCTION__,
-					false, m_ullEndTime - m_ullBeginTime, IDCertService_LogCode_ReadAndScanUTF8); //RTA2107
+					false, IDCerAuthenticateTime); //RTA2107
 				ctx->Answer(Error_Unexpect, GetAlarmDEC());
 			}
 		}
 	}
 	else
 	{
-		DbgWithLink(LOG_LEVEL_ERROR, LOG_TYPE_USER).setLogCode(IDCertService_LogCode_ReadAndScanUTF8).setResultCode("RTA2104")("ReadAndScanUTF8JS some thing wrong.");
+		DbgWithLink(LOG_LEVEL_ERROR, LOG_TYPE_USER).setResultCode("RTA2104")("ReadAndScanUTF8JS some thing wrong.");
 		ctx->Answer(Error_Unexpect, IDCertificate_UserErrorCode_ReadAndScan_Failed);
 		LogError(Severity_High, Error_Unexpect, IDCertificate_UserErrorCode_ReadAndScan_Failed, "ReadAndScanUTF8 some thing wrong.");
 	}
 
-	if (eErr1 == Error_Succeed && pos == 2)
-	{
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("return 4");
-		return 4;
-	}
-
 	if (m_bCancelRead)
 	{
 		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("return 2");
@@ -2293,51 +2104,6 @@ void CIDCertFSM::CheckHanZi(UINT16* ucs2_code)
 	}
 }
 
-void CIDCertFSM::CheckEjectCardRes(ErrorCodeEnum errRf, ErrorCodeEnum errForceIDEject)
-{
-	int pos = 99;
-	m_ullBeginTime = SP::Module::Comm::RVCGetTickCount();
-	ErrorCodeEnum posErr = m_hDevHelper->QueryCardPos(pos);
-	m_ullEndTime = SP::Module::Comm::RVCGetTickCount();
-
-	if (posErr == Error_Succeed)
-	{
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("DevAdapter::QueryCardPos")
-			.setCostTime(m_ullEndTime - m_ullBeginTime)
-			("执行吐卡后,获取卡片位置成功, pos : %d", pos);
-
-		CSimpleStringA warnMsg = CSimpleStringA::Format("RFControl返回:%s. ForceIDEject返回%s. 获取卡片位置 pos = %d.", 
-			SpStrError(errRf), SpStrError(errForceIDEject), pos);
-		switch (pos)
-		{
-		case 0:
-			LogWarn(Severity_Middle, Error_Succeed,
-				IDCertificate_UserErrorCode_EjectCardRes_Pos_0, warnMsg.GetData());
-			break;
-		case 1:
-			LogWarn(Severity_Middle, Error_Succeed,
-				IDCertificate_UserErrorCode_EjectCardRes_Pos_1, warnMsg.GetData());
-			break;
-		case 2:
-			LogWarn(Severity_Middle, Error_Succeed,
-				IDCertificate_UserErrorCode_EjectCardRes_Pos_2, warnMsg.GetData());
-			break;
-		default:
-			LogWarn(Severity_Middle, Error_Succeed,
-				IDCertificate_UserErrorCode_EjectCardRes_Pos_X, warnMsg.GetData());
-			break;
-		}
-
-	}
-	else
-	{
-		SetErrorAndLog(posErr, MEC_DEVAPI_IDCER_QueryCardPos, "DevAdapter::QueryCardPos", __FUNCTION__,
-			false, m_ullEndTime - m_ullBeginTime, IDCertService_LogCode_ReadAndScanUTF8);
-
-		DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("执行吐卡后,获取卡片位置失败.", posErr);
-	}
-}
-
 CSimpleStringA CIDCertFSM::GetFileHashStr(CSimpleStringA filePath)
 {
 	//calculate file hash value

+ 1 - 2
Module/mod_IDCertificate/IDCertFSM.h

@@ -93,6 +93,7 @@ enum BmpType
 
 #include "IDCerClass.h"
 #include "IDCertificate_def_g.h"
+#include "IDCertificate_LogCode.h"
 #pragma region forsonar
 typedef IDCertificate::IDCertService_CancelRead_Info IDCert_CancelRead_Info;
 typedef IDCertificate::IDCertService_ReadAndScanUTF8_Req IDCert_ReadAndScanUTF8_Req; //ex2
@@ -272,8 +273,6 @@ private:
 	int GetUCS2ByteLength(UINT16* ucs2_code);
 	void CheckHanZi(UINT16* ucs2_code);
 
-	void CheckEjectCardRes(ErrorCodeEnum errRf, ErrorCodeEnum errForceIDEject); //退卡情况收集,cjl-2024.11.21
-
 	CSimpleStringA GetFileHashStr(CSimpleStringA filePath);
 	CSimpleStringA GetFileLastModifyTime(CSimpleStringA filePath);
 

+ 11 - 0
Module/mod_IDCertificate/IDCertificate_LogCode.h

@@ -0,0 +1,11 @@
+#pragma once
+#ifndef _IDCERTIFICATE_LOGCODE_H
+#define _IDCERTIFICATE_LOGCODE_H
+
+namespace IDCertificate {
+
+#define IDCertService_LogCode_OpenIDCerRFControl "QLR040220121"
+#define IDCertService_LogCode_CloseIDCerRFControl "QLR040220122"
+
+}
+#endif

+ 0 - 6
Module/mod_IDCertificate/IDCertificate_UserErrorCode.h

@@ -27,12 +27,6 @@
 #define IDCertificate_UserErrorCode_Timeout_NoCard			0x20100221 //超时未插卡
 #define IDCertificate_UserErrorCode_Timeout_OtherCard		0x20100221 //插入其他卡片(非身份证)
 
-#define IDCertificate_UserErrorCode_EjectCardRes_Pos_0		0x20100230 //退卡结果-位置0:被取走
-#define IDCertificate_UserErrorCode_EjectCardRes_Pos_1		0x20100231 //退卡结果-位置1:读卡器内
-#define IDCertificate_UserErrorCode_EjectCardRes_Pos_2		0x20100232 //退卡结果-位置2:读卡口,未被取走
-#define IDCertificate_UserErrorCode_EjectCardRes_Pos_X		0x20100233 //退卡结果-异常值
-
-
 
 //#define IDCertificate_UserErrorCode_Real_Root_Config		(IDCertificate_UserErrorCode_Start + 31) //加载实际的root配置
 

+ 0 - 2
Module/mod_SalesRecorder/CMakeLists.txt

@@ -4,8 +4,6 @@ set(${MODULE_PREFIX}_SRCS
 	Event.h
 	mod_SalesRecorder.h
 	${CMAKE_CURRENT_SOURCE_DIR}/mod_SalesRecorder.cpp
-	${MODULE_BASE_DIR}/mod_recorder/recordinfo.h
-	${MODULE_BASE_DIR}/mod_recorder/recordinfo.cpp
 )
 
 set(MOD_VERSION_STRING "0.0.1-dev1")

+ 28 - 184
Module/mod_SalesRecorder/mod_SalesRecorder.cpp

@@ -297,11 +297,6 @@ static unsigned long GetFileSize(const char* pfilename)
 
 static void rvcDbg(filecrypt_loglevel elevel, const char* fmt, ...)
 {
-	LOG_LEVEL_E eloglevel = LOG_LEVEL_DEBUG;
-	if (FILECRYPT_LOG_INFO <= elevel) {
-		eloglevel = LOG_LEVEL_INFO;
-	}
-
 	va_list arg;
 	va_start(arg, fmt);
 
@@ -309,13 +304,13 @@ static void rvcDbg(filecrypt_loglevel elevel, const char* fmt, ...)
 	if (n >= MAX_LOG_LEN) {
 		char* buf = (char*)malloc((size_t)(n + 1));
 		vsnprintf(buf, n + 1, fmt, arg);
-		DbgWithLink(eloglevel, LOG_TYPE_SYSTEM)("%s", buf);
+		DbgWithLink((LOG_LEVEL_E)elevel, LOG_TYPE_SYSTEM)("%s", buf);
 		free(buf);
 	}
 	else {
 		char strlog[MAX_LOG_LEN] = { 0 };
 		vsnprintf(strlog, MAX_LOG_LEN, fmt, arg);
-		DbgWithLink(eloglevel, LOG_TYPE_SYSTEM)("%s", strlog);
+		DbgWithLink((LOG_LEVEL_E)elevel, LOG_TYPE_SYSTEM)("%s", strlog);
 	}
 	va_end(arg);
 }
@@ -466,11 +461,6 @@ ErrorCodeEnum CSalesRecorderEntity::__OnStart( ErrorCodeEnum preOperationError )
 		m_iActiveCamera = CAMERA_TYPE_ENV;
 	}
 
-	Error = GetFunction()->RegistSysVarEvent("SessionID", this);
-	if (Error != Error_Succeed) {
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("register sysvar %s failed!", "SessionID");
-	}
-
 	Error = GetFunction()->GetPath("Temp", m_TempDir);
 	if (Error != Error_Succeed) {
 		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("get global record temp path failed!");
@@ -497,24 +487,10 @@ void CSalesRecorderEntity::OnStarted()
 	m_bIsAudioNsOn = false;
 	m_iAudioNsPolicy = 2;
 	m_iAudioChannels = 1;
-
-	m_strHttpServerAPI = RVC_UPLOAD_VIDEORECORDING_HTTP_API;
-	m_iHttpTimeOut = RVC_HTTPTIMEOUT;
-	m_strHttpServerAddr = NULL;
-	m_strAppVersion = NULL;
-	m_strTerminalId = NULL;
-	m_bPostOn = false;
 	m_bWholeSection = false;
 	m_bEncFlag = true;
 	m_iRemoteRecordType = 0;
 
-	CSystemStaticInfo si;
-	ErrorCodeEnum Error = GetFunction()->GetSystemStaticInfo(si);
-	if (Error == Error_Succeed) {
-		m_strAppVersion = si.InstallVersion.ToString();
-		m_strTerminalId = si.strTerminalID;
-	}
-
 	GetEntityConfig();
 
 #ifndef RVC_OS_WIN
@@ -565,42 +541,36 @@ void CSalesRecorderEntity::OnSelfTest(EntityTestEnum eTestType,CSmartPointer<ITr
 
 void CSalesRecorderEntity::Debug(record_loglevel elevel, const char* fmt, ...)
 {
-	record_loglevel entitylevel = (m_lowestlevel > m_loglevel) ? m_lowestlevel : m_loglevel;
-	if (entitylevel <= elevel) {
-		va_list arg;
-		va_start(arg, fmt);
-		int n = vsnprintf(NULL, 0, fmt, arg);
-		if (n >= MAX_PATH) {
-			char* buf = (char*)malloc((size_t)(n + 1));
-			vsnprintf(buf, n + 1, fmt, arg);
-			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("%s", buf);
-			free(buf);
-		}
-		else {
-			char strlog[MAX_PATH] = { 0 };
-			vsnprintf(strlog, MAX_PATH, fmt, arg);
-			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("%s", strlog);
-		}
-		va_end(arg);
+	va_list arg;
+	va_start(arg, fmt);
+	int n = vsnprintf(NULL, 0, fmt, arg);
+	if (n >= MAX_PATH) {
+		char* buf = (char*)malloc((size_t)(n + 1));
+		vsnprintf(buf, n + 1, fmt, arg);
+		DbgWithLink((LOG_LEVEL_E)elevel, LOG_TYPE_SYSTEM)("%s", buf);
+		free(buf);
+	}
+	else {
+		char strlog[MAX_PATH] = { 0 };
+		vsnprintf(strlog, MAX_PATH, fmt, arg);
+		DbgWithLink((LOG_LEVEL_E)elevel, LOG_TYPE_SYSTEM)("%s", strlog);
 	}
+	va_end(arg);
 }
 
 void CSalesRecorderEntity::vDebug(record_loglevel elevel, const char* str, va_list list)
 {
-	record_loglevel entitylevel = (m_lowestlevel > m_loglevel) ? m_lowestlevel : m_loglevel;
-	if (entitylevel <= elevel) {
-		int n = vsnprintf(NULL, 0, str, list);
-		if (n >= MAX_PATH) {
-			char* buf = (char*)malloc((size_t)(n + 1));
-			vsnprintf(buf, n + 1, str, list);
-			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("%s", buf);
-			free(buf);
-		}
-		else {
-			char strlog[MAX_PATH] = { 0 };
-			vsnprintf(strlog, MAX_PATH, str, list);
-			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("%s", strlog);
-		}
+	int n = vsnprintf(NULL, 0, str, list);
+	if (n >= MAX_PATH) {
+		char* buf = (char*)malloc((size_t)(n + 1));
+		vsnprintf(buf, n + 1, str, list);
+		DbgWithLink((LOG_LEVEL_E)elevel, LOG_TYPE_SYSTEM)("%s", buf);
+		free(buf);
+	}
+	else {
+		char strlog[MAX_PATH] = { 0 };
+		vsnprintf(strlog, MAX_PATH, str, list);
+		DbgWithLink((LOG_LEVEL_E)elevel, LOG_TYPE_SYSTEM)("%s", strlog);
 	}
 }
 
@@ -642,7 +612,6 @@ void CSalesRecorderEntity::OnRecordFailed(eRvcRecordFailedCase eCase, const char
 		LogEvent(Severity_Middle, LOG_EVT_UI_RECORDFAILED, record_failed_case_table[eCase]);
 	}
 
-	m_loglevel = RECORD_LOG_INFO;
 #ifdef RVC_OS_WIN
 	LogWarn(Severity_Middle, Error_Debug, LOG_EVT_SALESRECORD_FAILED, CSimpleStringA::Format("{%s} current memory usage is %d, and cpu usage is %f.", pszMessage ? pszMessage : " ", GetSystemMemoryUsage(), fCpuUsage).GetData());
 #else
@@ -652,8 +621,6 @@ void CSalesRecorderEntity::OnRecordFailed(eRvcRecordFailedCase eCase, const char
 		m_bNeedRestart = true;
 		RealSelfCheck();
 	}
-
-	m_eBusinessStatus = eInterrupt;
 }
 
 void CSalesRecorderEntity::OnRecordEntityExcption()
@@ -801,15 +768,10 @@ void CSalesRecorderEntity::StartOnSiteSalesRecord(const int fps, const char* vid
 	if (m_pRecorder->StartVideoRecord(fps, videoquality, eMP4, &tAudioParams, subtitleParam, bWholeSection, false, m_TempDir.GetData(),
 		m_TempDir.GetLength(), videofilename, strlen(videofilename)))
 	{
-		m_eBusinessStatus = eSuccess;
 		m_bStarted = true;
 	}
 	else {
 		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Start VideoRecord failed!");
-		m_eBusinessStatus = eFailed;
-		if (m_bPostOn) {
-			PostSalesRecordInfos();
-		}
 	}
 }
 
@@ -926,14 +888,6 @@ ErrorCodeEnum CSalesRecorderEntity::DeleteVideo( const char *videofilename)
 		ErrorCode = Error_NotImpl;
 	}
 
-	if (eInterrupt != m_eBusinessStatus) {
-		m_eBusinessStatus = eCancel;
-	}
-
-	if (m_bPostOn) {
-		PostSalesRecordInfos();
-	}
-
 	return ErrorCode;
 }
 
@@ -1004,9 +958,6 @@ ErrorCodeEnum CSalesRecorderEntity::SaveVideo( const char * videofilename)
 						else {
 							bMoveSucc = true;
 							CSimpleStringA strVideoName = CSimpleStringA::Format("%s_%d.%s", strFindFileName.GetData(), i, RECORD_MP4_SUFFIX);
-							if (m_bPostOn) {
-								AddToSalesRecordList(destFileName.GetData(), strVideoName.GetData(), ufilesize);
-							}
 						}
 
 						if (RVC_MIN_FILESIZE > ufilesize){
@@ -1017,11 +968,6 @@ ErrorCodeEnum CSalesRecorderEntity::SaveVideo( const char * videofilename)
 
 					if (bMoveSucc) {
 						LogWarn(Severity_Low, Error_Debug, LOG_EVT_RECORD_SAVED_SUCCESS, CSimpleStringA::Format("succeed to save sales video, move it from %s to %s.", sourFileName.GetData(), destFileName.GetData()).GetData());
-						if (m_bPostOn) {
-							if (Error_Succeed != PostSalesRecordInfos()) {
-								ErrorCode = Error_Failed;
-							}
-						}
 					}
 				}
 			}
@@ -1680,81 +1626,6 @@ DeviceTypeEnum CSalesRecorderEntity::RvcGetDeviceType()
 	return eType;
 }
 
-
-
-ErrorCodeEnum CSalesRecorderEntity::AddToSalesRecordList(const char* videopath, const char* strfilename, unsigned long ufilesize)
-{
-	ErrorCodeEnum Error = Error_Failed;
-	if (NULL == videopath || NULL == strfilename) {
-		return Error;
-	}
-
-	record_item_t* item = new record_item_t();
-
-	item->file_path = videopath;
-
-	item->file_length = (int)ufilesize;
-
-	item->file_name = strfilename;
-	
-	m_vRecordList.push_back(item);
-
-	Error = Error_Succeed;
-
-	return Error;
-}
-
-ErrorCodeEnum CSalesRecorderEntity::PostSalesRecordInfos()
-{
-	ErrorCodeEnum Error = Error_Failed;
-
-	char strtimenow[MAX_PATH] = { 0 };
-	y2k_time_t nowtime = y2k_time_now();
-	y2k_to_string(nowtime, strtimenow, MAX_PATH);
-
-	video_record_info_t video_params;
-	video_params.strServerURL = m_strHttpServerAddr;
-	video_params.strAPI = m_strHttpServerAPI;
-	video_params.strAppVersion = m_strAppVersion;
-	video_params.strRecordEndTime = strtimenow;
-
-	video_params.strTerminalNo = m_strTerminalId;
-
-	video_params.iBusinessStatus = (int)m_eBusinessStatus;
-	if (eFailed == m_eBusinessStatus) {
-		if (m_vRecordList.size() > 0) {
-			video_params.iBusinessStatus = eInterrupt;
-		}
-	}
-
-	video_params.strRecordID = m_SalesVideoName + strlen(RVC_SALES_RECORD_SUFFIX);
-	for (vector<record_item_t*>::iterator it = m_vRecordList.begin(); it < m_vRecordList.end(); ++it) {
-		video_params.vRecordList.push_back(*it);
-	}
-
-	unsigned int uposttime = 0;
-	CSimpleStringA strErrorMsg("");
-	if (0 == post_video_recordinfo_list(uposttime, strErrorMsg, &video_params, m_iHttpTimeOut, false)) {
-		LogWarn(Severity_Low, Error_Debug, LOG_EVT_POST_SALESRECORD_INFO_COST_TIME, CSimpleStringA::Format("post video record infos cost time is %ums.", uposttime).GetData());
-		Error = Error_Succeed;
-	}
-	else {
-		LogWarn(Severity_Middle, Error_Exception, LOG_EVT_POST_SALESRECORD_INFO_FAILED, strErrorMsg.GetData());
-	}
-
-	for (vector<record_item_t*>::iterator it = m_vRecordList.begin(); it < m_vRecordList.end(); ++it) {
-		if (NULL != *it) {
-			delete* it;
-			*it = NULL;
-		}
-	}
-
-	m_vRecordList.clear();
-
-	return Error;
-}
-
-
 int CSalesRecorderEntity::HandleEncryptVideoRecord(const char* videofilename)
 {
 	int iRet = -1;
@@ -1796,7 +1667,7 @@ int CSalesRecorderEntity::HandleEncryptVideoRecord(const char* videofilename)
 	}
 	else {
 		if (rvcMoveFile(strOutFile, videofilename)) {
-			DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("rename %s to %s Success!", strOutFile, videofilename);
+			DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("rename %s to %s success!", strOutFile, videofilename);
 			iRet = 0;
 		}
 		else {
@@ -1850,8 +1721,6 @@ ErrorCodeEnum CSalesRecorderEntity::GetEntityConfig()
 	int iAudioNsPolicy = 2;
 	int iIsAudioNsOn = 0;
 	int iAudioChannels = 1;
-	int iLogLevel = 2;
-	int iLowestLevel = 1;
 	int iTimeOut = RVC_HTTPTIMEOUT;
 	CSimpleStringA strHttpServerAddr("");
 	int iPostOn = 0;
@@ -1866,35 +1735,10 @@ ErrorCodeEnum CSalesRecorderEntity::GetEntityConfig()
 		spConfig->ReadConfigValueInt("SalesRecorder", "IsAudioNsOn", iIsAudioNsOn);
 		spConfig->ReadConfigValueInt("SalesRecorder", "AudioQuality", iAudioQuality);
 		spConfig->ReadConfigValueInt("SalesRecorder", "AudioChannels", iAudioChannels);
-		spConfig->ReadConfigValueInt("SalesRecorder", "LogLevel", iLogLevel);
-		spConfig->ReadConfigValueInt("SalesRecorder", "LowestLevel", iLowestLevel);
-		spConfig->ReadConfigValueInt("SalesRecorder", "post_salesrecord_info_on", iPostOn);
-		spConfig->ReadConfigValue("Recorder", "http_video_record_addr", strHttpServerAddr);
-		spConfig->ReadConfigValueInt("Recorder", "http_timeout", iTimeOut);
 		spConfig->ReadConfigValueInt("SalesRecorder", "stopencflag", iStopEncflag);
 		spConfig->ReadConfigValueInt("InteractiveControl", "RemoteRecordType", iRemoteRecordType);
 	}
 
-	if (iLogLevel <= RECORD_LOG_ERROR && iLogLevel > 0) {
-		m_loglevel = (record_loglevel)iLogLevel;
-	}
-
-	if (iLowestLevel <= RECORD_LOG_ERROR && iLowestLevel > 0) {
-		m_lowestlevel = (record_loglevel)iLowestLevel;
-	}
-
-	if (strHttpServerAddr.GetLength() > 0) {
-		m_strHttpServerAddr = strHttpServerAddr;
-	}
-
-	if (iTimeOut > 0 && iTimeOut < 20 * RVC_HTTPTIMEOUT) {
-		m_iHttpTimeOut = iTimeOut;
-	}
-
-	if (1 == iPostOn) {
-		m_bPostOn = true;
-	}
-
 	SetRecordAudioQuality(iAudioQuality);
 	SetRecordAudioNsPolicy(iAudioNsPolicy);
 	SetRecordAudioChannles(iAudioChannels);

+ 2 - 19
Module/mod_SalesRecorder/mod_SalesRecorder.h

@@ -39,12 +39,12 @@ namespace SalesRecorder {
 	class CSalesRecorderEntity : public CEntityBase, public CHostApi, public ILogListener,public ISysVarListener, public ITimerListener
 	{
 	public:
-		CSalesRecorderEntity() : m_pRecorder(NULL), m_bStarted(false), m_loglevel(RECORD_LOG_INFO), m_lowestlevel(RECORD_LOG_DEBUG) { ZeroMemory(m_SalesVideoName, MAX_PATH); }
+		CSalesRecorderEntity() : m_pRecorder(NULL), m_bStarted(false) { ZeroMemory(m_SalesVideoName, MAX_PATH); }
 #else
 	class CSalesRecorderEntity : public CEntityBase, public CHostApi, public ILogListener, public ISysVarListener, public ITimerListener
 	{
 	public:
-		CSalesRecorderEntity() : m_pRecorder(NULL), m_bStarted(false), m_loglevel(RECORD_LOG_INFO), m_lowestlevel(RECORD_LOG_DEBUG) { ZeroMemory(m_SalesVideoName, MAX_PATH); }
+		CSalesRecorderEntity() : m_pRecorder(NULL), m_bStarted(false) { ZeroMemory(m_SalesVideoName, MAX_PATH); }
 #endif // RVC_OS_WIN
 
 		virtual ~CSalesRecorderEntity() { /*empty implementation*/ }
@@ -149,10 +149,6 @@ namespace SalesRecorder {
 
 		DeviceTypeEnum RvcGetDeviceType();
 
-		ErrorCodeEnum PostSalesRecordInfos();
-
-		ErrorCodeEnum AddToSalesRecordList(const char* videopath, const char* strfilename, unsigned long ufilesize);
-
 		int HandleEncryptVideoRecord(const char* videofilename);
 
 		ErrorCodeEnum SetRecordCamera(int iCamera);
@@ -184,24 +180,11 @@ namespace SalesRecorder {
 
 		bool m_last_disk_overtop;
 		int m_max_disk_percent;		      
-       
-		record_loglevel m_loglevel;
-		record_loglevel m_lowestlevel;
 
 		eAudioOutPutType m_eAudioOutQuality;
 		bool m_bIsAudioNsOn;
 		int m_iAudioNsPolicy;
 		int m_iAudioChannels;
-
-		bool m_bPostOn;
-		
-		CSimpleStringA m_strHttpServerAddr;
-		CSimpleStringA m_strHttpServerAPI;
-		int m_iHttpTimeOut;
-		CSimpleStringA m_strAppVersion;
-		CSimpleStringA m_strTerminalId;
-		vector<record_item_t*> m_vRecordList;
-		eRvcBusinessStatus m_eBusinessStatus;
 		bool m_bEncFlag;
 		int m_iRemoteRecordType;
 	};

+ 3 - 3
Module/mod_counterconnector/http_callrouter.cpp

@@ -93,7 +93,7 @@ node_list_head_t* get_http_callroute_list(http_call_info_t* pinfo, int itimeout,
 		req.terminalNo = pData;
 	}
 
-	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("begin http get request, timeout is %d, printdbg flag is %s.", req.m_timeOut, req.m_printDbg ? "true":"false");
+	//DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("begin http get request, timeout is %d, printdbg flag is %s.", req.m_timeOut, req.m_printDbg ? "true":"false");
 
 	CallRouteHTTPRet ret;
 	PROCESS_LINK_CONTEXT("LR0402304CallRoute")
@@ -107,13 +107,13 @@ node_list_head_t* get_http_callroute_list(http_call_info_t* pinfo, int itimeout,
 
 		node_info_t tnode = {0};
 		if (0 == get_http_callnodeinfo(&tnode, pinfo->strTerminalNo.GetData(), ret.m_call_route.m_accessNum.c_str(), ret.m_call_route.m_voiceGateAddress.c_str(), ret.m_call_route.m_mediaGateAddress.c_str())) {
-			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("new http_callroute node: new_caller_number:%s new_touri:%s, assist_ip:%s, assist_port:%s!",
+			DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("new http_callroute node: new_caller_number:%s new_touri:%s, assist_ip:%s, assist_port:%s!",
 				tnode.strcallernum, tnode.strcallurl, tnode.strassistip, tnode.strport);
 			add_node_to_list(phead, tnode.strcallernum, tnode.strcallurl, tnode.strassistip, tnode.strport);
 
 			memset(&tnode, 0, sizeof(node_info_t));
 			if (0 == get_http_callnodeinfo(&tnode, pinfo->strTerminalNo.GetData(), ret.m_call_route.m_accessNum.c_str(), ret.m_call_route.m_voiceGateAddressBackUp.c_str(), ret.m_call_route.m_mediaGateAddressBackUp.c_str())) {
-				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("new backup http_callroute node: new_caller_number:%s new_touri:%s, assist_ip:%s, assist_port:%s!",
+				DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("new backup http_callroute node: new_caller_number:%s new_touri:%s, assist_ip:%s, assist_port:%s!",
 					tnode.strcallernum, tnode.strcallurl, tnode.strassistip, tnode.strport);
 				add_node_to_list(phead, tnode.strcallernum, tnode.strcallurl, tnode.strassistip, tnode.strport);
 			}

+ 0 - 1
Module/mod_counterconnector/mod_counterconnector.cpp

@@ -637,7 +637,6 @@ void CCounterConnectorEntity ::OnReceivePkt(int type, int sub_type, const char *
 			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("unknown sub_type %d from agent!", sub_type);
 			break;
 		}
-
 	}
 	else if (type == ACM_TYPE_CALLTRANS)
 	{

+ 2 - 2
Module/mod_countercontext/mod_countercontext.cpp

@@ -133,9 +133,9 @@ public:
 			buf& level16;
 			evt.level = CSimpleString16Bit2A(level16);
 #endif //RVC_OS_WIN
-
 			SpSendBroadcast(GetFunction(), SP_MSG_OF(CounterBasicInfo), SP_MSG_SIG_OF(CounterBasicInfo), evt);
-		} else {
+		} 
+		else {
 			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("unknown sub_type %d from agent!", sub_type);
 		}
 	}

+ 1 - 1
Module/mod_customeraware/CustomerHandleFSM.cpp

@@ -91,7 +91,7 @@ ErrorCodeEnum CCustomerHandleFSM::SetSysState( int state )
 			//客户离开,清空sessionid
 			errCode = GetEntityBase()->GetFunction()->SetSysVar("SessionID","N");
 			if (errCode != Error_Succeed){
-				DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("customeraware end set SessionID to Null failed (%d).",errCode);
+				DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("customeraware end set SessionID to Null failed (%d).", errCode);
 			}
 		}
 	}

+ 2 - 2
Module/mod_facetracking/mod_facetracking.cpp

@@ -239,7 +239,7 @@ void CFaceTrackingEntity::OnTimeout(DWORD dwTimerID)
 		{
 			if (strValue[0] == 'O') 
 			{
-				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("ActiveTrackingCamera change from Opt->Env!");
+				DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("ActiveTrackingCamera change from Opt->Env!");
 				spFunction->SetSysVar(SYSVAR_ACTIVETRACKINGCAMERA, ACTIVETRACKINGCAMERA_ENV); // from Operation -> Environment
 			}
 		} 
@@ -247,7 +247,7 @@ void CFaceTrackingEntity::OnTimeout(DWORD dwTimerID)
 		{
 			if (strValue[0] == 'E') 
 			{
-				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("ActiveTrackingCamera change from Env->Opt!");
+				DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("ActiveTrackingCamera change from Env->Opt!");
 				spFunction->SetSysVar(SYSVAR_ACTIVETRACKINGCAMERA, ACTIVETRACKINGCAMERA_OPT); // from Environment -> Operation
 			}
 		}			

+ 1 - 1
Module/mod_gpio/GpioFSM.cpp

@@ -247,7 +247,7 @@ CSimpleStringA CombineJsonContext(const char* szMessage)
 	return  result;
 }
 
-CGPIOFSM::CGPIOFSM(void) :m_bVibrationFlag(false), m_bOpenFlag(false), m_bMoveFlag(false), m_bCardGateFlag(false)
+CGPIOFSM::CGPIOFSM(void) :m_ePickUpFlag(UnknownStatus),m_bVibrationFlag(false), m_bOpenFlag(false), m_bMoveFlag(false), m_bCardGateFlag(false)
 	, m_moveHoldTimes(0)
 	, m_moveDisappearTimes(0)
 	, m_bNewVersion(FALSE), m_bFuncVer2(FALSE), m_btLastRevcInput(-1), m_RecvErrTims(0)

+ 1 - 0
Module/mod_healthmanager/HealthManagerFSM.cpp

@@ -757,6 +757,7 @@ void CHealthManagerFSM::ToLogWarnTermAboutInfo()
 		termStartInfo["AccessAuthResult"] = CSimpleStringA::Format("%d", m_iAccessAuth);
 		
 		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("TerminalStartCost")("%s", generateJsonStr(termStartInfo).second.c_str());
+		LogWarn(Severity_Low, Error_Debug, HealthManager_UserErrorCode_TerminalAppLoadInfo, generateJsonStr(termStartInfo).second.c_str());
 	}
 	QueryAndSaveDNS();
 	QueryAndSendCPUInfo();

+ 1 - 1
Module/mod_healthmanager/HealthManagerFSM.h

@@ -45,7 +45,7 @@ enum HealthManger_UserErrorCode {
 	HealthManager_UserErrorCode_Need_Guardian = 0x50100210,				//健康需要启动guardian
 	HealthManager_UserErrorCode_Need_No_Guardian = 0x50100211,			//健康不需要启动guardian	
 	HealthManager_UserErrorCode_WaitForAccessAuthEntityIdle = 0x50100212,	//健康等待准入启动正常
-	HealthManager_UserErrorCode_First_Info_AboutPC = 0x50100213,			//健康启动结束后第一次上送计算机信息(主要是确定pad的归属厂商信息)
+	HealthManager_UserErrorCode_TerminalAppLoadInfo = 0x50100213,			//终端应用启动过程信息
 	//
 	HealthManager_UserErrorCode_PrivilegeCMD = 0x50100215,				//上送终端收到的启动、重启事件(非关门页、用户桌面?需要调查后理清楚)
 	HealthManager_UserErrorCode_SogouInput_UsingSys = 0x50100216,    // 使用普通调用的搜狗输入法

+ 0 - 4
Module/mod_healthmanager/mod_healthmanager.cpp

@@ -74,10 +74,6 @@ const int MAX_START_AYSNC_TIMEOUT = 20000;
 #define FREE(x) HeapFree(GetProcessHeap(), 0, (x))
 
 #if defined(RVC_OS_LINUX)//oiltmp
-#include "CenterSetting_client_g.h"	
-using namespace CenterSetting;
-
-
 //for defines in header file
 #include "Chromium_client_g.h"
 using namespace Chromium;

+ 15 - 12
Module/mod_interactivecontrol/mod_interactivecontrol.cpp

@@ -163,10 +163,10 @@ DeviceTypeEnum CITCtrlEntity::RvcGetDeviceType()
 	CSystemStaticInfo stStaticinfo;
 	spFunction->GetSystemStaticInfo(stStaticinfo);
 
-	if (_stricmp(stStaticinfo.strMachineType, "RVC.Stand1SPlus") == 0) {
+	if (_stricmp(stStaticinfo.strMachineType.GetData(), "RVC.Stand1SPlus") == 0) {
 		eType = eStand1SPlusType;
 	}
-	else if (stricmp(stStaticinfo.strMachineType, "RVC.CardStore") == 0 || stricmp(stStaticinfo.strMachineType, "RVC.CardPrinter") == 0) {
+	else if (_stricmp(stStaticinfo.strMachineType.GetData(), "RVC.CardStore") == 0 || _stricmp(stStaticinfo.strMachineType.GetData(), "RVC.CardPrinter") == 0) {
 		eType = eCardStore;
 	}
 	else {
@@ -239,14 +239,12 @@ ErrorCodeEnum CITCtrlEntity::__OnClose(ErrorCodeEnum preOperationError)
 	CSmartPointer<IEntityFunction> pFunc = GetFunction();
 	pFunc->UnregistSysVarEvent("UIState");
 	pFunc->UnregistSysVarEvent("CustomerHandle");
-	if (eStand1SPlusType == m_eDeviceType)
-	{
+	if (eStand1SPlusType == m_eDeviceType){
 		pFunc->UnregistSysVarEvent(SYSVAR_CAMERASTATE);
 	}
 
 	if (NULL != m_pChannelClient) {
 		m_pChannelClient->GetFunction()->CloseSession();
-
 		m_pChannelClient = NULL;
 	}
 
@@ -289,16 +287,20 @@ void CITCtrlEntity::BcastCustomerState(const char *pszValue,const char *pszOldVa
 	if (pszValue[0] == 'N') { // None
 		evt.state = eCustomerState_None;
 		evt.status = L"Customer:None";
-	} else if (pszValue[0] == 'A') { // Attention
+	} 
+	else if (pszValue[0] == 'A') { // Attention
 		evt.state = eCustomerState_Attention;
 		evt.status = L"Customer:Attention";
-	} else if (pszValue[0] == 'C') { // Control
+	}
+	else if (pszValue[0] == 'C') { // Control
 		evt.state = eCustomerState_Control;
 		evt.status = L"Customer:Control";
-	} else if (pszValue[0] == 'T') { // Assist
+	}
+	else if (pszValue[0] == 'T') { // Assist
 		evt.state = eCustomerState_Assist;
 		evt.status = L"Customer:Assist";
-	} else if (pszValue[0] == 'G') { // Agent
+	}
+	else if (pszValue[0] == 'G') { // Agent
 		evt.state = eCustomerState_AgentOperation;
 		evt.status = L"Customer:AgentOperation";
 	} 
@@ -306,6 +308,7 @@ void CITCtrlEntity::BcastCustomerState(const char *pszValue,const char *pszOldVa
 		ok = 0;
 		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("bug! OnSysVarEvent unknown %s", pszValue);
 	}
+
 	GetFunction()->GetSysVar("SessionID",m_SessionID);
 	evt.session_id = CSimpleStringA2W(m_SessionID);
 	if (ok) {
@@ -2508,11 +2511,11 @@ void UIServiceSession::Handle_StopPlayNotice(SpReqAnsContext<UIService_StopPlayN
 			req.CfgInx = ctx->Req.CfgInx;
 			Error = pPlayClient->StopPlayNotice(req, ans, 5000);
 			if (Error_Succeed == Error) {
-				ctx->Ans.ErrorMsg = CSimpleStringA2W("Stop Play Notice success!");
-				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setLogCode("QLR040230BZ80201")("Stop Play Notice success.");
+				ctx->Ans.ErrorMsg = CSimpleStringA2W("stop play notice success!");
+				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setLogCode("QLR040230BZ80201")("stop play notice success.");
 			}
 			else {
-				ctx->Ans.ErrorMsg = CSimpleStringA2W("Stop Play Notice failed!");
+				ctx->Ans.ErrorMsg = CSimpleStringA2W("stop play notice failed!");
 				LogWarn(Severity_Middle, Error_Debug, LOG_EVT_STOP_NOTICEPLAY_FAILED, CSimpleStringA::Format("StopPlayNotice Result = 0x%08x.", Error).GetData());
 				DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setLogCode("QLR040230BZ80201").setResultCode("RTA3B04")("停止业务视频播放失败");
 			}

+ 1 - 4
Module/mod_livenessdetection/RvcFaceVideo.cpp

@@ -65,7 +65,7 @@ RvcFaceVideo::~RvcFaceVideo(void)
 	}
 
 	if (NULL != m_preview_env_videoframe){
-		delete m_preview_env_videoname;
+		delete []m_preview_env_videoname;
 		m_preview_env_videoframe = NULL;
 	}
 
@@ -79,8 +79,6 @@ RvcFaceVideo::~RvcFaceVideo(void)
 int RvcFaceVideo::InitVideoQueue(const char* strenvqueue, const char* stroptqueue, const char* strpreview_envqueue, const char* strpreview_optqueue)
 {
 	int iRet = -1;
-	
-	DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("begin new copy video queue name.");
 
 	if (NULL != strenvqueue){
 		rvc_snprintf(m_env_videoname, MAX_PATH, "%s", strenvqueue);
@@ -98,7 +96,6 @@ int RvcFaceVideo::InitVideoQueue(const char* strenvqueue, const char* stroptqueu
 		rvc_snprintf(m_preview_opt_videoname, MAX_PATH, "%s", strpreview_optqueue);
 	}
 
-	DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("begin new video queue.");
 	if (strlen(m_env_videoname)){
 		m_env_videoqueue = new Clibvideoqueue(m_env_videoname);
 		iRet = 0;

+ 2 - 3
Module/mod_livenessdetection/mod_livenessdetection.cpp

@@ -108,7 +108,6 @@ void CLivenessDetectionEntity::OnStarted()
 		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("[LivenessDetectionFSM] Get Entity Configure Failed!");
 	}
 
-
 #ifdef RVC_OS_WIN
 	m_hWsServerThread = (HANDLE)_beginthreadex(NULL, 0, &start_wsserver, this, 0, NULL);
 	if (NULL == m_hWsServerThread){
@@ -213,14 +212,14 @@ void CLivenessDetectionEntity::OnLog( const CAutoArray<CUUID> &SubIDs, const CUU
 	switch (dwUserCode) 
 	{
 	case LOG_EVT_MEDIACONTROLLER_CAMERA_STARTED:
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("recv LOG_EVT_MEDIACONTROLLER_CAMERA_STARTED event");
+		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("recv LOG_EVT_MEDIACONTROLLER_CAMERA_STARTED event");
 #ifdef RVC_OS_LINUX
 		InitVideoQueueInfo();
 #endif
 		break;
 
 	case LOG_EVT_MEDIACONTROLLER_CAMERA_STOPPED:
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("recv LOG_EVT_MEDIACONTROLLER_CAMERA_STOPPED event");
+		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("recv LOG_EVT_MEDIACONTROLLER_CAMERA_STOPPED event");
 #ifdef RVC_OS_LINUX
 		if (m_pFaceVideo){
 			delete m_pFaceVideo;

+ 1 - 0
Module/mod_mediacontroller/Event.h

@@ -31,6 +31,7 @@
 #define ERROR_MOD_MEDIACONTROLLER_RECORD_DISKFULL			0x20880031  //录像磁盘满,级别2
 #define ERROR_MOD_MEDIACONTROLLER_RECORD_WRITEFAIL			0x20880032  //录像写入失败,级别3
 
+#define ERROR_MOD_MEDIACONTROLLER_HANDFREEIN_BUG			0x20880040
 //warning
 #define ERROR_MOD_MEDIACONTROLLER_HANDFREE_OPENFAIL			0x20880041  //打开免提失败,级别3	
 

+ 39 - 21
Module/mod_mediacontroller/capture.cpp

@@ -245,19 +245,20 @@ static int StreamCallback(const void *input,
 		}
 		frm.iseriesnumber = audio_cap->iseriesnumber;
 
-		if (!audio_cap->shm_queue->InsertAudio(&frm)) {
+		int unowtime = y2k_time_now();
+		if (!audio_cap->shm_queue->InsertAudio(&frm, unowtime)) {
 			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("[StreamCallback] InsertAudio to shm_queue failed! frameCount:%d", frameCount);
 		}
-		else {
-			//DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("%s:%d InsertAudio to shm_queue success! and framesize is :%d, and shm_queue length is %d, frm.iseriesnumber = %d.", __FUNCTION__, __LINE__, frm.framesize, audio_cap->shm_queue->GetAudioLens(), frm.iseriesnumber);
-		}
+		//else {
+		//	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("%s:%d InsertAudio to shm_queue success! and framesize is :%d, and shm_queue length is %d, frm.iseriesnumber = %d, and now time is %d.", __FUNCTION__, __LINE__, frm.framesize, audio_cap->shm_queue->GetAudioLens(), frm.iseriesnumber, unowtime);
+		//}
 
 		if (!audio_cap->salesol_shm_queue->InsertAudio(&frm)) {
 			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("[StreamCallback] InsertAudio to salesol_shm_queue failed! frameCount:%d", frameCount);
 		}
-		else {
-			//DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("%s:%d InsertAudio to salesol_shm_queue success! and framesize is :%d, and salesol_shm_queue length is %d, frm.iseriesnumber = %d.", __FUNCTION__, __LINE__, frm.framesize, audio_cap->salesol_shm_queue->GetAudioLens(), frm.iseriesnumber);
-		}
+		//else {
+		//	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("%s:%d InsertAudio to salesol_shm_queue success! and framesize is :%d, and salesol_shm_queue length is %d, frm.iseriesnumber = %d.", __FUNCTION__, __LINE__, frm.framesize, audio_cap->salesol_shm_queue->GetAudioLens(), frm.iseriesnumber);
+		//}
 	}
 
 	if (output) {
@@ -294,9 +295,9 @@ static int Sales_StreamCallback(const void *input,
 		if (!audio_cap->audio_shm_queue->InsertAudio(&frm)) {
 			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("[Sales_StreamCallback] InsertAudio failed! frameCount:%d", frameCount);
 		}
-		else {
-			//DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("%s:%d InsertAudio to audio_shm_queue success! and framesize is :%d, and shm_queue length is %d, frm.iseriesnumber = %d.", __FUNCTION__, __LINE__, frm.framesize, audio_cap->audio_shm_queue->GetAudioLens(), frm.iseriesnumber);
-		}
+		//else {
+		//	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("%s:%d InsertAudio to audio_shm_queue success! and framesize is :%d, and shm_queue length is %d, frm.iseriesnumber = %d.", __FUNCTION__, __LINE__, frm.framesize, audio_cap->audio_shm_queue->GetAudioLens(), frm.iseriesnumber);
+		//}
 	}
 
 	if (output) {
@@ -496,11 +497,12 @@ static void audio_data_callback(const void* input, unsigned long audiolen, void*
 			}
 			frm.iseriesnumber = audio_cap->iseriesnumber;
 
-			if (!audio_cap->shm_queue->InsertAudio(&frm)) {
+			int unowtime = y2k_time_now();
+			if (!audio_cap->shm_queue->InsertAudio(&frm, unowtime)) {
 				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("%s:%d InsertAudio to shm_queue failed!", __FUNCTION__, __LINE__);
 			}
 			//else {
-			//	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("%s:%d InsertAudio to shm_queue success! and framesize is :%d, and shm_queue length is %d, frm.iseriesnumber = %d.", __FUNCTION__, __LINE__, frm.framesize, audio_cap->shm_queue->GetAudioLens(), frm.iseriesnumber);
+			//	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("%s:%d InsertAudio to shm_queue success! and framesize is :%d, and shm_queue length is %d, frm.iseriesnumber = %d, and now time is %d.", __FUNCTION__, __LINE__, frm.framesize, audio_cap->shm_queue->GetAudioLens(), frm.iseriesnumber, unowtime);
 			//}
 			audio_cap->uaudiolen -= RVC_AUDIO_BUFFER_LEN;
 		}
@@ -585,9 +587,9 @@ static void record_audio_data_callback(const void* input, unsigned long audiolen
 			if (!audio_cap->audio_shm_queue->InsertAudio(&frm)) {
 				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("%s:%d InsertAudio to audio_shm_queue failed!", __FUNCTION__, __LINE__);
 			}
-			else {
-				//DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("%s:%d InsertAudio to audio_shm_queue success!", __FUNCTION__, __LINE__);
-			}
+			//else {
+			//	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("%s:%d InsertAudio to audio_shm_queue success!", __FUNCTION__, __LINE__);
+			//}
 			
 			audio_cap->uaudiolen -= RVC_AUDIO_BUFFER_LEN;
 		}
@@ -666,7 +668,6 @@ static void salesrecord_audio_capture_destroy(rvc_audio_capture_t *audio_cap)
 			audio_cap->audio_shm_queue = NULL;
 		}
 
-
 #ifdef RVC_OS_LINUX
 		if (NULL != audio_cap->paudio_buffer){
 			delete audio_cap->paudio_buffer;
@@ -1675,7 +1676,8 @@ namespace MediaController {
 			if ('N' == cap->config.strAudioState[0] || 'P' == cap->config.strAudioState[0]) {
 				ErrorCodeEnum rslt = start_audio_capture(cap->handfree_audio);
 				if (Error_Succeed != rslt) {
-					return rslt;
+					//return rslt;
+					DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("start handfree audio capture failed!");
 				}
 			}
 			else {
@@ -1781,7 +1783,7 @@ namespace MediaController {
 		if (cap->env_video) {
 			if (0 != cap->env_video->ustarttime) {
 				int ienvtime = y2k_time_now() - cap->env_video->ustarttime;
-				LogWarn(Severity_Low, Error_Debug, LOG_EVT_MEDIACONTROLLER_ENVCAM_CLOSE, CSimpleStringA::Format("stop envcam, and camera open time is %us.", ienvtime).GetData());
+				//LogWarn(Severity_Low, Error_Debug, LOG_EVT_MEDIACONTROLLER_ENVCAM_CLOSE, CSimpleStringA::Format("stop envcam, and camera open time is %us.", ienvtime).GetData());
 				if (ienvtime >= 1) {
 					float fenvframerate = (float)((float)cap->env_video->frame_id / (float)ienvtime);
 					LogWarn(Severity_Low, Error_Debug, LOG_EVT_MEDIACONTROLLER_ENVCAM_FRAME_INFO, CSimpleStringA::Format("env camera frame info is dest frame number is %d(%us), real frame number is %d, difference is %d, real frmerate is %.2ffps.", ienvtime * cap->config.video_env_fps, ienvtime, cap->env_video->frame_id, ienvtime * cap->config.video_env_fps - cap->env_video->frame_id, fenvframerate).GetData());
@@ -1792,7 +1794,7 @@ namespace MediaController {
 		if (cap->opt_video) {
 			if (0 != cap->opt_video->ustarttime) {
 				int iopttime = y2k_time_now() - cap->opt_video->ustarttime;
-				LogWarn(Severity_Low, Error_Debug, LOG_EVT_MEDIACONTROLLER_OPTCAM_CLOSE, CSimpleStringA::Format("stop optcam, and camera open time is %us.", iopttime).GetData());
+				//LogWarn(Severity_Low, Error_Debug, LOG_EVT_MEDIACONTROLLER_OPTCAM_CLOSE, CSimpleStringA::Format("stop optcam, and camera open time is %us.", iopttime).GetData());
 				if (iopttime >= 1) {	
 					float foptframerate = (float)((float)cap->opt_video->frame_id / (float)iopttime);
 					LogWarn(Severity_Low, Error_Debug, LOG_EVT_MEDIACONTROLLER_OPTCAM_FRAME_INFO, CSimpleStringA::Format("opt camera frame info is dest frame number is %d(%us), real frame number is %d, difference is %d, real frmerate is %.2ffps.", iopttime * cap->config.video_opt_fps, iopttime, cap->opt_video->frame_id, iopttime * cap->config.video_opt_fps - cap->opt_video->frame_id, foptframerate).GetData());
@@ -1802,6 +1804,7 @@ namespace MediaController {
 		}
 	}
 
+
 	int capture_detect_camera_bug(capture_t *cap, int *env_n, int *opt_n, bool bsinglecam)
 	{
 		*env_n = 0;
@@ -1836,6 +1839,21 @@ namespace MediaController {
 				*opt_n = 1;
 			}
 		}
+
+		return 0;
+	}
+
+	int capture_get_last_audio_frametime(capture_t* cap, unsigned int* handfreein_n)
+	{
+		*handfreein_n = 0;
+		if (cap->handfree_audio)
+		{
+			if (cap->handfree_audio->shm_queue)
+			{
+				*handfreein_n = cap->handfree_audio->shm_queue->GetLastFrameTime();
+			}
+		}
+
 		return 0;
 	}
 
@@ -2342,7 +2360,7 @@ namespace MediaController {
 			video_capture_stop(cap->env_video);
 			if (0 != cap->env_video->ustarttime) {
 				int ienvtime = y2k_time_now() - cap->env_video->ustarttime;
-				LogWarn(Severity_Low, Error_Debug, LOG_EVT_MEDIACONTROLLER_ENVCAM_CLOSE, CSimpleStringA::Format("stop envcam, and camera open time is %us.", ienvtime).GetData());
+				//LogWarn(Severity_Low, Error_Debug, LOG_EVT_MEDIACONTROLLER_ENVCAM_CLOSE, CSimpleStringA::Format("stop envcam, and camera open time is %us.", ienvtime).GetData());
 				LogWarn(Severity_Low, Error_Debug, LOG_EVT_MEDIACONTROLLER_ENVCAM_FRAME_INFO, CSimpleStringA::Format("env camera frame info is dest frame number is %d(%us), real frame number is %d, difference is %d.", ienvtime * cap->config.video_env_fps, ienvtime, cap->env_video->frame_id, ienvtime * cap->config.video_env_fps - cap->env_video->frame_id).GetData());
 			}
 
@@ -2355,7 +2373,7 @@ namespace MediaController {
 			video_capture_stop(cap->opt_video);
 			if (0 != cap->opt_video->ustarttime) {
 				int iopttime = y2k_time_now() - cap->opt_video->ustarttime;
-				LogWarn(Severity_Low, Error_Debug, LOG_EVT_MEDIACONTROLLER_OPTCAM_CLOSE, CSimpleStringA::Format("stop optcam, and camera open time is %us.", iopttime).GetData());
+				//LogWarn(Severity_Low, Error_Debug, LOG_EVT_MEDIACONTROLLER_OPTCAM_CLOSE, CSimpleStringA::Format("stop optcam, and camera open time is %us.", iopttime).GetData());
 				LogWarn(Severity_Low, Error_Debug, LOG_EVT_MEDIACONTROLLER_OPTCAM_FRAME_INFO, CSimpleStringA::Format("opt camera frame info is dest frame number is %d(%us), real frame number is %d, difference is %d.", iopttime * cap->config.video_opt_fps, iopttime, cap->opt_video->frame_id, iopttime * cap->config.video_opt_fps - cap->opt_video->frame_id).GetData());
 			}
 

+ 8 - 3
Module/mod_mediacontroller/capture.h

@@ -54,9 +54,11 @@ extern "C"{
 #define RVC_CAM_INTERVAL_TIME 3000
 #endif // !RVC_CAM_INTERVAL_TIME
 
-#ifndef MAX_PATH
-#define MAX_PATH 260
-#endif
+#ifndef AUDIO_BUG_THRESHOLD_TIME
+#define AUDIO_BUG_THRESHOLD_TIME 60
+#endif // !AUDIO_BUG_THRESHOLD_TIME
+
+
 
 namespace MediaController {
 	typedef struct capture_t capture_t;
@@ -182,8 +184,11 @@ namespace MediaController {
 	void capture_stop(capture_t *cap);
 	int capture_lib_init(int* ivideonum);
 
+
 	int capture_detect_camera_bug(capture_t *cap, int *env_n, int *opt_n, bool bsinglecam);
 	int capture_get_last_frametime(capture_t *cap, unsigned int* env_n, unsigned int* opt_n);
+	
+	int capture_get_last_audio_frametime(capture_t* cap, unsigned int* handfreein_n);
 
 	int salesaudio_capture_create(rvc_audio_capture_config_t *config, rvc_sales_audio_capture_t **p_cap);
 	void salesaudio_capture_destroy(rvc_sales_audio_capture_t *cap);

+ 75 - 60
Module/mod_mediacontroller/mod_mediacontroller.cpp

@@ -20,7 +20,6 @@
 #include "../mod_SalesRecorder/Event.h"
 #include "../mod_evtconverter/Event.h"
 
-
 #ifndef AUTOMATCH_CAMERA_ENV
 #define AUTOMATCH_CAMERA_ENV	"ENV_"
 #endif
@@ -33,27 +32,26 @@
 #define MAX_PATH 260
 #endif
 
+#ifndef RVC_MEDIADEV_STATUS_CHECK_TIMER
+#define RVC_MEDIADEV_STATUS_CHECK_TIMER 1
+#endif // !RVC_MEDIADEV_STATUS_CHECK_TIMER
 
 #ifndef RVC_CAMERA_OFF_TIMER
 #define RVC_CAMERA_OFF_TIMER 3
 #endif // !RVC_CAMERA_OFF_TIMER
 
-
 #ifndef RVC_CAMERA_CAP_PROCESS
 #define RVC_CAMERA_CAP_PROCESS 4
 #endif // !RVC_CAMERA_CAP_PROCESS
 
-
 #ifndef RVC_MIN_CAMERA_BRIGHNESS
 #define RVC_MIN_CAMERA_BRIGHNESS 30
 #endif // !RVC_MIN_CAMERA_BRIGHNESS
 
-
 #ifndef RVC_DEFAULT_CAMERA_BRIGHNESS
 #define RVC_DEFAULT_CAMERA_BRIGHNESS 50
 #endif // !RVC_DEFAULT_CAMERA_BRIGHNESS
 
-
 #ifdef RVC_OS_WIN
 static void __audio_render_log(audiorender_loglevel elevel, void* user_data, const char* fmt, va_list arg)
 {
@@ -137,6 +135,7 @@ CMediaControllerEntity::CMediaControllerEntity(): m_capture(NULL), m_salesaudio_
 	m_iCamTimeout = CAMERA_TIMEOUT;
 	m_iDelayTime = RVC_MAX_DELAY_TIME;
 	m_interValTime = RVC_CAM_INTERVAL_TIME;
+	m_iAudioTimeout = AUDIO_BUG_THRESHOLD_TIME;
 	m_bOnBusiness = false;
 	m_bJsOccupyCamera = false;
 	m_bCameraOffTimerOn = false;
@@ -202,10 +201,6 @@ void CMediaControllerEntity::OnPreStart(CAutoArray<CSimpleStringA> strArgs,CSmar
 	}
 #endif
 
-	if (GetFunction()->RegistSysVarEvent("SessionID", this) != Error_Succeed){
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("register sysvar %s failed!", "SessionID");
-	}
-
 	if (GetFunction()->RegistSysVarEvent(SYSVAR_CALLSTATE, this) != Error_Succeed) {
 		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("register sysvar %s failed!", SYSVAR_CALLSTATE);
 	}
@@ -471,12 +466,14 @@ ErrorCodeEnum CMediaControllerEntity::GetMediaConfig()
 	int itimeout = CAMERA_TIMEOUT;
 	int iDelayTime = RVC_MAX_DELAY_TIME;
 	unsigned int intervaltime = RVC_CAM_INTERVAL_TIME;
+	int iaudiotimeout = AUDIO_BUG_THRESHOLD_TIME;
 
 	Error = GetFunction()->OpenConfig(Config_CenterSetting, spConfig);
 	if (Error == Error_Succeed){
 		table.AddEntryInt("MediaController", "CamTimeOut", itimeout, CAMERA_TIMEOUT);
 		table.AddEntryInt("MediaController", "MaxDelayTime", iDelayTime, RVC_MAX_DELAY_TIME);
 		table.AddEntryUInt("MediaController", "InterValTime", intervaltime, RVC_CAM_INTERVAL_TIME);
+		table.AddEntryInt("MediaController", "AudioTimeOut", iaudiotimeout, AUDIO_BUG_THRESHOLD_TIME);
 		Error= table.Load(spConfig);
 	}
 	 
@@ -495,6 +492,10 @@ ErrorCodeEnum CMediaControllerEntity::GetMediaConfig()
 		if (intervaltime <= RVC_CAM_INTERVAL_TIME && intervaltime >= RVC_CAM_INTERVAL_TIME / 3) {
 			m_interValTime = intervaltime;
 		}
+
+		if (iaudiotimeout > 0) {
+			m_iAudioTimeout = iaudiotimeout;
+		}
 	}
 
 	return Error;
@@ -507,7 +508,7 @@ ErrorCodeEnum CMediaControllerEntity::SetCameraSysVar(const CSimpleStringA &newV
 		
 	CSimpleStringA val = newVal;
 	if('B' == val[0]){
-		LogWarn(Severity_Middle, Error_Debug, ERROR_MOD_MEDIACONTROLLER_CONFIG_ALLERROR, "all config cameras error");
+		LogWarn(Severity_Middle, Error_DevMedia, ERROR_MOD_MEDIACONTROLLER_CONFIG_ALLERROR, "all config cameras error");
 	}
 
 	return spFunction->SetSysVar(SYSVAR_CAMERASTATE, newVal.GetData());
@@ -554,7 +555,7 @@ void CMediaControllerEntity::OnPreClose(EntityCloseCauseEnum eCloseCause,CSmartP
 
 void CMediaControllerEntity::OnTimeout(DWORD dwTimerID)
 {
-	if (dwTimerID == 1) {
+	if (RVC_MEDIADEV_STATUS_CHECK_TIMER == dwTimerID) {
 		if (!m_capture) {
 			return;
 		}
@@ -564,6 +565,8 @@ void CMediaControllerEntity::OnTimeout(DWORD dwTimerID)
 		}
 
 		OnTimeCameraStatusCheck();
+
+		OnTimeHandfreeMicroStatusCheck();
 	}
 	else if (2 == dwTimerID) {
 		if (false == m_bConnectedAssist) {
@@ -582,7 +585,7 @@ void CMediaControllerEntity::OnTimeout(DWORD dwTimerID)
 			if (Error_Succeed == GetFunction()->GetSysVar(SYSVAR_CALLSTATE, strCallState)) {
 				if (strCallState.Compare("O") == 0) {
 					if (m_capture) {
-						GetFunction()->KillTimer(1);
+						GetFunction()->KillTimer(RVC_MEDIADEV_STATUS_CHECK_TIMER);
 						capture_stop(m_capture);
 						DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setLogCode("QLR0402208V5")("关闭摄像头");
 						capture_destroy(m_capture);
@@ -614,6 +617,42 @@ void CMediaControllerEntity::OnTimeout(DWORD dwTimerID)
 }
 
 
+void CMediaControllerEntity::OnTimeHandfreeMicroStatusCheck()
+{
+	CSimpleStringA strValue = m_capture->config.strAudioState;
+	if ('B' == strValue[0] || 'H' == strValue[0]) {
+		return;
+	}
+
+	unsigned int nHandfreeinAudioTime = 0;
+	static bool bTimeout = false;
+	static bool bPost = false;
+
+	capture_get_last_audio_frametime(m_capture, &nHandfreeinAudioTime);
+
+	if (nHandfreeinAudioTime > 0)
+	{
+		if (((y2k_time_now() - nHandfreeinAudioTime) > m_iAudioTimeout) && !bTimeout)
+		{
+			bTimeout = true;
+			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("bTimeout.");
+		}
+		else if (((y2k_time_now() - nHandfreeinAudioTime) < m_iAudioTimeout) && bTimeout)
+		{
+			bTimeout = false;
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("change handfree audio in from bTimeout to ok.");
+		}
+	}
+
+	if (bTimeout){
+		if (!bPost) {
+			LogWarn(Severity_Middle, Error_Hardware, ERROR_MOD_MEDIACONTROLLER_HANDFREEIN_BUG, CSimpleStringA::Format("{%s}故障,采集不到音频", m_capture->config.strAudioIn.GetData()).GetData());
+			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setResultCode("RTA2820")("免提麦克风故障,采集不到音频");
+			bPost = true;
+		}
+	}
+}
+
 void CMediaControllerEntity::OnTimeCameraStatusCheck()
 {
 	int env_n = -1, opt_n = -1;
@@ -633,7 +672,7 @@ void CMediaControllerEntity::OnTimeCameraStatusCheck()
 	if (env_n == 0) {
 		if (iEnvEmptyTimes < CAMERA_BUG_THRESHOLD){
 			iEnvEmptyTimes++; 
-			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("get env camera picture fail, times=%d.",iEnvEmptyTimes);
+			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("get env camera picture fail, times=%d.", iEnvEmptyTimes);
 		}	
 	} 
 	else if (env_n == -1){
@@ -662,7 +701,7 @@ void CMediaControllerEntity::OnTimeCameraStatusCheck()
 	}
 
 	//env是否30S没有图像或者图像15秒没有更新
-	if(((iEnvEmptyTimes == CAMERA_BUG_THRESHOLD)||bEnvTimeout)&&(m_nCameraErrorCode!=Error_EnvCamera)&&(m_nCameraErrorCode!=Error_AllCamera))
+	if(((iEnvEmptyTimes == CAMERA_BUG_THRESHOLD)||bEnvTimeout)&&(m_nCameraErrorCode != Error_EnvCamera)&&(m_nCameraErrorCode != Error_AllCamera))
 	{
 		char strMessage[MAX_PATH*2] = {0};
 		get_camera_exception_message(strMessage, MAX_PATH*2, conf.strVideoEnv, "Env camera bug detected!");
@@ -1092,7 +1131,7 @@ void CMediaControllerEntity::DelayCloseCameras()
 ErrorCodeEnum CMediaControllerEntity::StopAllCameras()
 {
 	if (m_capture){
-		GetFunction()->KillTimer(1);
+		GetFunction()->KillTimer(RVC_MEDIADEV_STATUS_CHECK_TIMER);
 		capture_stop(m_capture);
 		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setLogCode("QLR0402208V5")("关闭摄像头");
 		capture_destroy(m_capture);
@@ -1149,6 +1188,13 @@ ErrorCodeEnum CMediaControllerEntity::CheckConfigCameraName(capture_config_t *co
 		EnvConfigNameError = 1;
 	}
 
+	if (0 != EnvConfigNameError) {
+		char strMessage[MAX_PATH * 2] = { 0 };
+		get_camera_exception_message(strMessage, MAX_PATH * 2, conf->strVideoEnv, "env camera config error, please check config file or device.");
+		LogWarn(Severity_Middle, Error_DevMedia, ERROR_MOD_MEDIACONTROLLER_ENVCAM_INITFAIL, strMessage);
+		DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setLogCode("QLR0402208V2").setResultCode("RTA2801")("上摄像头配置错误,请检查摄像头配置");
+	}
+
 	//check opt device
 	if (conf->strVideoOpt.GetLength() > 1) { // is not "$"
 		conf->video_opt_dev = capture_get_video_device_id(conf->strVideoOpt.GetData());
@@ -1162,6 +1208,13 @@ ErrorCodeEnum CMediaControllerEntity::CheckConfigCameraName(capture_config_t *co
 		OptConfigNameError = 1;
 	}
 
+	if ((eStand2sType == eType) && (0 != OptConfigNameError)) {
+		char strMessage[MAX_PATH * 2] = { 0 };
+		get_camera_exception_message(strMessage, MAX_PATH * 2, conf->strVideoOpt, "operation camera config error, please check config file or device.");
+		LogWarn(Severity_Middle, Error_DevMedia, ERROR_MOD_MEDIACONTROLLER_OPTCAM_INITFAIL, strMessage);
+		DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setLogCode("QLR0402208V2").setResultCode("RTA2802")("下摄像头配置错误,请检查摄像头配置");
+	}
+
 	if (eStand2sType == eType) {
 		//配置的环境摄像头能识别到
 		if (0 == EnvConfigNameError) {
@@ -1354,22 +1407,7 @@ ErrorCodeEnum CMediaControllerEntity::LoadConfig(capture_config_t *conf)
 #endif // RVC_OS_WIN
 
 			Error = CheckConfigCameraName(conf, m_eDeviceType);
-			if (Error == Error_EnvCamera){
-				char strMessage[MAX_PATH*2] = {0};
-				get_camera_exception_message(strMessage, MAX_PATH*2, conf->strVideoEnv ,"env camera config error,please check config file or device.");
-				LogWarn(Severity_Middle,Error_DevMedia,ERROR_MOD_MEDIACONTROLLER_ENVCAM_INITFAIL,strMessage);
-				DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setLogCode("QLR0402208V2").setResultCode("RTA2801")("上摄像头配置错误,请检查摄像头配置");
-			} else if (Error == Error_OptCamera){
-				char strMessage[MAX_PATH*2] = {0};
-				get_camera_exception_message(strMessage, MAX_PATH*2, conf->strVideoOpt, "operation camera config error,please check config file or device.");
-				LogWarn(Severity_Middle,Error_DevMedia,ERROR_MOD_MEDIACONTROLLER_OPTCAM_INITFAIL, strMessage);
-				DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setLogCode("QLR0402208V2").setResultCode("RTA2802")("下摄像头配置错误,请检查摄像头配置");
-			}
-			else if (Error == Error_AllCamera) {
-				LogWarn(Severity_Middle, Error_DevMedia, ERROR_MOD_MEDIACONTROLLER_CONFIG_ALLERROR, "all config cameras error");
-				DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setLogCode("QLR0402208V2").setResultCode("RTA280B")("上下摄像头配置都错误,请检查摄像头配置");
-			}
-			else {
+			if (Error == Error_Succeed){
 				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setLogCode("QLR0402208V2")("摄像头配置正确");
 			}
 		}
@@ -1385,21 +1423,6 @@ ErrorCodeEnum CMediaControllerEntity::LoadConfig(capture_config_t *conf)
 }
 
 
-void CMediaControllerEntity::OnExternalCameraSwitchFailed(const char* pszFailedMsg)
-{
-	CSmartPointer<IEntityFunction> Func = GetFunction();
-	CSimpleStringA strValue;
-	Func->GetSysVar("DesktopType", strValue);
-	if (strValue == CSimpleStringA("U")) {
-#ifdef RVC_OS_WIN
-		MessageBoxA(NULL, pszFailedMsg, NULL, MB_SYSTEMMODAL);
-#else
-
-#endif // RVC_OS_WIN
-	}
-}
-
-
 #ifdef DEVOPS_ON_PRD
 #else
 #ifdef RVC_OS_WIN
@@ -1567,12 +1590,12 @@ void CMediaControllerEntity::OnLog( const CAutoArray<CUUID> &SubIDs, const CUUID
 
 	case LOG_EVT_RECORDFAILED: 
 		{
-			GetFunction()->KillTimer(1);
+			GetFunction()->KillTimer(RVC_MEDIADEV_STATUS_CHECK_TIMER);
 
 			char FaildFlag = pszMessage[0];
 			if (FaildFlag == '0')
 			{
-				GetFunction()->SetTimer(1, this, 5000);
+				GetFunction()->SetTimer(RVC_MEDIADEV_STATUS_CHECK_TIMER, this, 5000);
 				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("本地录音录像失败,已停止!");
 			}
 			else 
@@ -1587,14 +1610,12 @@ void CMediaControllerEntity::OnLog( const CAutoArray<CUUID> &SubIDs, const CUUID
 
 	case  LOG_EVT_UI_RECORDFAILED: 
 		{
-			OnExternalCameraSwitchFailed(pszMessage);
-
-			GetFunction()->KillTimer(1);
+			GetFunction()->KillTimer(RVC_MEDIADEV_STATUS_CHECK_TIMER);
 			if (m_bIsRemoteRecord){
 				LogEvent(Severity_Middle, LOG_EVT_UI_STOPREMOTERECORD, NULL);
 			}
 				
-			GetFunction()->SetTimer(1, this, 5000);
+			GetFunction()->SetTimer(RVC_MEDIADEV_STATUS_CHECK_TIMER, this, 5000);
 		}
 		break;
 
@@ -1833,7 +1854,7 @@ ErrorCodeEnum CMediaControllerEntity::StartCamera(bool bstartaudio)
 						SetConfigBright(Error);
 						m_bsynchronized = true;
 					}
-					GetFunction()->SetTimer(1, this, 5000);
+					GetFunction()->SetTimer(RVC_MEDIADEV_STATUS_CHECK_TIMER, this, 5000);
 					if((Error == Error_OptCamera)&&(eStand1SPlusType == m_eDeviceType))
 					{
 						return Error_Succeed;
@@ -1851,7 +1872,7 @@ ErrorCodeEnum CMediaControllerEntity::StartCamera(bool bstartaudio)
 					SetConfigBright(Error);
 					m_bsynchronized = true;
 				}
-				GetFunction()->SetTimer(1, this, 5000);
+				GetFunction()->SetTimer(RVC_MEDIADEV_STATUS_CHECK_TIMER, this, 5000);
 				return Error_Succeed;
 			}
 		} 
@@ -2259,11 +2280,9 @@ void CMediaControllerEntity::GetCameraBrightness(SpReqAnsContext<MediaService_Ge
 	else {
 		ctx->Ans.result = -1;
 		if (0 == ctx->Req.icameraid) {
-			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode("RTA280D").setAPI(__FUNCTION__)("上摄像头故障,请联系厂商排查");
 			ctx->Answer(Error_EnvCamera, LOG_WARN_ENVCAMERA_ERROR);
 		}
 		else if (1 == ctx->Req.icameraid) {
-			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode("RTA280E").setAPI(__FUNCTION__)("下摄像头故障,请联系厂商排查");
 			ctx->Answer(Error_OptCamera, LOG_WARN_OPTCAMERA_ERROR);
 		}
 	}
@@ -2279,11 +2298,9 @@ void CMediaControllerEntity::SetCameraBrightness(SpReqAnsContext<MediaService_Se
 	else {
 		ctx->Ans.result = -1;
 		if (0 == ctx->Req.icameraid) {
-			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode("RTA280D").setAPI(__FUNCTION__)("上摄像头故障,请联系厂商排查");
 			ctx->Answer(Error_EnvCamera, LOG_WARN_ENVCAMERA_ERROR);
 		}
 		else if (1 == ctx->Req.icameraid) {
-			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode("RTA280E").setAPI(__FUNCTION__)("下摄像头故障,请联系厂商排查");
 			ctx->Answer(Error_OptCamera, LOG_WARN_OPTCAMERA_ERROR);
 		}
 	}
@@ -2624,10 +2641,8 @@ void MediaServiceSession::Handle_TurnOnCamera(SpReqAnsContext<MediaService_TurnO
 	}
 	else {
 		ctx->Ans.result = -3;
-		DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode("RTA2808").setAPI(__FUNCTION__)("摄像头故障,请联系厂商排查");
 		ctx->Answer(Error_AllCamera, LOG_WARN_ALLCAMERA_ERRORS);
 	}
-	//DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("Error = %d, CameraErrorCode = %d, result = %d.", Error, CameraErrorCode, ctx->Ans.result);
 }
 
 void MediaServiceSession::Handle_TurnOffCamera(SpReqAnsContext<MediaService_TurnOffCamera_Req, MediaService_TurnOffCamera_Ans>::Pointer ctx)

+ 2 - 1
Module/mod_mediacontroller/mod_mediacontroller.h

@@ -105,7 +105,6 @@ public:
 
 	ErrorCodeEnum GetSalesAudioConfig(rvc_audio_capture_config_t *conf, bool bRemoteRecord);
 	ErrorCodeEnum LoadConfig(capture_config_t* conf);
-	void OnExternalCameraSwitchFailed(const char* pszFailedMsg);
 	virtual void OnLog(const CAutoArray<CUUID>& SubIDs, const CUUID nLogID, const LogTypeEnum eLogType, const SeverityLevelEnum eLevel,
 		const DWORD dwSysError, const DWORD dwUserCode, const DWORD dwEntityInstanceID, const WORD wEntityDevelID,
 		const CAutoArray<DWORD>& Param, const char* pszEntityName, const char* pszModuleName, const char* pszMessage, const linkContext& pLinkInfo);	
@@ -123,6 +122,7 @@ public:
 	ErrorCodeEnum GetEnvCamRawBrightnessInfo(int* iMin, int* iMax);
 	ErrorCodeEnum SetEnvCamRawBrightness(int iBrightness);
 	ErrorCodeEnum GetEnvCameraVideoCaptureInfo(CSimpleStringA& strnotice, CSimpleStringA& strcmd);
+	void OnTimeHandfreeMicroStatusCheck();
 
 #ifdef DEVOPS_ON_PRD
 #else
@@ -180,6 +180,7 @@ private:
 	int m_iDelayTime;
 	int m_interValTime;
 	bool m_bCameraOffTimerOn;
+	int m_iAudioTimeout;
 
 	CSimpleStringA m_strHttpServerAddr;
 	CSimpleStringA m_strHttpServerAPI;

+ 13 - 10
Module/mod_pinpad/PinPadFSM.cpp

@@ -800,10 +800,13 @@ Err:
 	m_ullBeginTime = SP::Module::Comm::RVCGetTickCount();
 	errCode = m_hDevHelper->GetPinBlock(pinBlk);
 	m_ullEndTime = SP::Module::Comm::RVCGetTickCount();
-
 	
-	LogWarn(Severity_Low, Error_Succeed, PinPad_UserErrorCode_PinPad_GetPinBlock_Call
-		, CSimpleStringA::Format("{\"cost\":%d}", m_ullEndTime - m_ullBeginTime));
+	ULLINT ullGetPinBlockCost = m_ullEndTime - m_ullBeginTime;
+	char* tmpCheckCode = new char[MAX_PIN_BLOCK_SIZE];
+	if (tmpCheckCode == NULL)
+		return Error_Resource;
+	memset(tmpCheckCode, 0, MAX_PIN_BLOCK_SIZE);
+
 	if (errCode == Error_Succeed)
 	{
 		char* tmpPinData = new char[MAX_PIN_BLOCK_SIZE];
@@ -853,15 +856,9 @@ Err:
 		}
 		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("DevAdapter::EncryptData").setCostTime(m_ullEndTime - m_ullBeginTime)();
 
-		char* tmpCheckCode = new char[MAX_PIN_BLOCK_SIZE];
-		if (tmpCheckCode == NULL)
-			return Error_Resource;
-		memset(tmpCheckCode, 0, MAX_PIN_BLOCK_SIZE);
 		//HexBuf2StrBuf(dstInfo.data,&tmpCheckCode,dstInfo.dwSize);
 		memcpy(tmpCheckCode, dstInfo.data, dstInfo.dwSize);
 
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("ckckck[%s], m_keySNSM:%s", tmpCheckCode, m_keySNSM.GetData());
-
 
 		if (strnicmp(tmpCheckCode, "9F1F7BFF6F5511384D9430531E538FD3", strlen("9F1F7BFF6F5511384D9430531E538FD3")) == 0)
 			SetErrorAndLog(Error_Unexpect, PinPad_UserErrorCode_KEY_LOST_SM, "", __FUNCTION__);
@@ -895,8 +892,14 @@ Err:
 		ctxSM->Answer(Error_DevCommFailed, dwUserCode);
 		return Error_DevCommFailed;
 	}
+	map<string, string> encryptTextInfo;
+	encryptTextInfo["text"] = "获取密文成功";
+	encryptTextInfo["ckCode"] = tmpCheckCode;
+	encryptTextInfo["keySN"] = m_keySNSM.GetData();
+	encryptTextInfo["getPinBlockCost"] = CSimpleStringA::Format("%d",ullGetPinBlockCost).GetData();
+
 	DbgWithLink(LOG_LEVEL_INFO, ctxSM->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setLogCode(PinPadService_LogCode_GetInputSM)
-		.setAPI("DevAdapter::GetPinBlock").setCostTime(m_ullEndTime - m_ullBeginTime)("获取密文成功");
+		.setAPI("DevAdapter::GetPinBlock").setCostTime(m_ullEndTime - m_ullBeginTime)("%s", generateJsonStr(encryptTextInfo).second.c_str());
 	//oilyang@20240410 move to out space,after stopinput & turn off the light
 	//Sleep(100);
 	//ctxSM->Answer(Error_Succeed);

+ 30 - 45
Module/mod_recorder/mod_recorder.cpp

@@ -93,11 +93,6 @@ static void LogRecordFileInfo(const char* pszMessage)
 
 static void rvcDbg(filecrypt_loglevel elevel, const char* fmt, ...)
 {
-	LOG_LEVEL_E eloglevel = LOG_LEVEL_DEBUG;
-	if (FILECRYPT_LOG_INFO <= elevel) {
-		eloglevel = LOG_LEVEL_INFO;
-	}
-
 	va_list arg;
 	va_start(arg, fmt);
 
@@ -105,13 +100,13 @@ static void rvcDbg(filecrypt_loglevel elevel, const char* fmt, ...)
 	if (n >= MAX_LOG_LEN) {
 		char* buf = (char*)malloc((size_t)(n + 1));
 		vsnprintf(buf, n + 1, fmt, arg);
-		DbgWithLink(eloglevel, LOG_TYPE_SYSTEM)("%s", buf);
+		DbgWithLink((LOG_LEVEL_E)elevel, LOG_TYPE_SYSTEM)("%s", buf);
 		free(buf);
 	}
 	else{
 		char strlog[MAX_LOG_LEN] = {0};
 		vsnprintf(strlog, MAX_LOG_LEN, fmt, arg);
-		DbgWithLink(eloglevel, LOG_TYPE_SYSTEM)("%s", strlog);
+		DbgWithLink((LOG_LEVEL_E)elevel, LOG_TYPE_SYSTEM)("%s", strlog);
 	}
 	va_end(arg);
 }
@@ -123,13 +118,11 @@ static bool rvcMoveFile(const char* strSrcFile, const char* strDstFile)
 	if (NULL == strSrcFile || NULL == strDstFile) {
 		return bRet;
 	}
-#ifdef RVC_OS_WIN
-	bRet = MoveFile(strSrcFile, strDstFile);
-#else
+
 	if (0 == rename(strSrcFile, strDstFile)) {
 		bRet = true;
 	}
-#endif // RVC_OS_WIN
+
 	return bRet;
 }
 
@@ -141,13 +134,9 @@ static bool RvcDeleteFile(const char* strSrcFile)
 		return bRet;
 	}
 
-#ifdef RVC_OS_WIN
-	bRet = DeleteFile(strSrcFile);
-#else
 	if (0 == remove(strSrcFile)) {
 		bRet = true;
 	}
-#endif // RVC_OS_WIN
 	
 	return bRet;
 }
@@ -334,42 +323,38 @@ CServerSessionBase* CRecorderEntity::OnNewSession(const char* pszRemoteEntityNam
 
 void CRecorderEntity::Debug(record_loglevel elevel, const char *fmt, ...)
 {
-	if (RECORD_LOG_INFO <= elevel) {
-		va_list arg;
-		va_start(arg, fmt);
-
-		int n = vsnprintf(NULL, 0, fmt, arg);
-		if (n >= MAX_LOG_LEN) {
-			char* buf = (char*)malloc((size_t)(n + 1));
-			vsnprintf(buf, n + 1, fmt, arg);
-			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("%s", buf);
-			free(buf);
-		}
-		else{
-			char strlog[MAX_LOG_LEN] = {0};
-			vsnprintf(strlog, MAX_LOG_LEN, fmt, arg);
-			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("%s", strlog);
-		}
-		va_end(arg);
+	va_list arg;
+	va_start(arg, fmt);
+
+	int n = vsnprintf(NULL, 0, fmt, arg);
+	if (n >= MAX_LOG_LEN) {
+		char* buf = (char*)malloc((size_t)(n + 1));
+		vsnprintf(buf, n + 1, fmt, arg);
+		DbgWithLink((LOG_LEVEL_E)elevel, LOG_TYPE_SYSTEM)("%s", buf);
+		free(buf);
 	}
+	else{
+		char strlog[MAX_LOG_LEN] = {0};
+		vsnprintf(strlog, MAX_LOG_LEN, fmt, arg);
+		DbgWithLink((LOG_LEVEL_E)elevel, LOG_TYPE_SYSTEM)("%s", strlog);
+	}
+	va_end(arg);
 }
 
 
 void CRecorderEntity::vDebug(record_loglevel elevel, const char* str, va_list list)
 {
-	if (RECORD_LOG_INFO <= elevel) {
-		int n = vsnprintf(NULL, 0, str, list);
-		if (n >= MAX_LOG_LEN) {
-			char* buf = (char*)malloc((size_t)(n + 1));
-			vsnprintf(buf, n + 1, str, list);
-			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("%s", buf);
-			free(buf);
-		}
-		else {
-			char strlog[MAX_LOG_LEN] = { 0 };
-			vsnprintf(strlog, MAX_LOG_LEN, str, list);
-			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("%s", strlog);
-		}
+	int n = vsnprintf(NULL, 0, str, list);
+	if (n >= MAX_LOG_LEN) {
+		char* buf = (char*)malloc((size_t)(n + 1));
+		vsnprintf(buf, n + 1, str, list);
+		DbgWithLink((LOG_LEVEL_E)elevel, LOG_TYPE_SYSTEM)("%s", buf);
+		free(buf);
+	}
+	else {
+		char strlog[MAX_LOG_LEN] = { 0 };
+		vsnprintf(strlog, MAX_LOG_LEN, str, list);
+		DbgWithLink((LOG_LEVEL_E)elevel, LOG_TYPE_SYSTEM)("%s", strlog);
 	}
 }
 

+ 1 - 1
Module/mod_recorder/recordinfo.cpp

@@ -66,7 +66,7 @@ int post_video_recordinfo_list(unsigned int& uposttime, CSimpleStringA& errormsg
 
 	DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("m_reqContent is %s.", req.m_reqContent.c_str());
 
-	DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("begin http get request, timeout is %d, printdbg flag is %s.", req.m_timeOut, req.m_printDbg ? "true" : "false");
+	//DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("begin http get request, timeout is %d, printdbg flag is %s.", req.m_timeOut, req.m_printDbg ? "true" : "false");
 
 	unsigned int ustarttime = SP::Module::Comm::RVCGetTickCount();
 

+ 1 - 1
Module/mod_sipphone/audio_session.cpp

@@ -183,7 +183,7 @@ static void recv_hook_callback(const char *buf, int size, void *arg)
 	audio_session_t* psession = (audio_session_t*)arg;
 
 	if (false == psession->baudiorecved){
-		LogWarn(Severity_Low, Error_Debug, EVENT_MOD_SIP_AUDIO_STREAM_RECEIVED, CSimpleStringA::Format("received first audio packet, and packet size is %d.", size).GetData());
+		//LogWarn(Severity_Low, Error_Debug, EVENT_MOD_SIP_AUDIO_STREAM_RECEIVED, CSimpleStringA::Format("received first audio packet, and packet size is %d.", size).GetData());
 		psession->baudiorecved = true;
 	}
 }

+ 0 - 2
Module/mod_sipphone/mod_sipphone.cpp

@@ -1507,7 +1507,6 @@ void CSIPEntity::HandleSendBroadcastMsg(bool bHandfreeError)
 			evt.strmessage = CSimpleStringA2W("免提设备故障,请使用话筒办理业务");
 			SpSendBroadcast(GetFunction(), SP_MSG_OF(UIMessageBox), SP_MSG_SIG_OF(UIMessageBox), evt);
 			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("SpSendBroadcast SwitchHandFree UIMessageBox.");
-			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode("RTA3107")("免提设备故障,请使用话筒办理业务");
 			m_bMessageBox = false;
 		}
 		else {
@@ -1522,7 +1521,6 @@ void CSIPEntity::HandleSendBroadcastMsg(bool bHandfreeError)
 			evt.strmessage = CSimpleStringA2W("话筒设备故障,请使用免提办理业务");
 			SpSendBroadcast(GetFunction(), SP_MSG_OF(UIMessageBox), SP_MSG_SIG_OF(UIMessageBox), evt);
 			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("SpSendBroadcast SwitchPickup UIMessageBox.");
-			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode("RTA3108")("话筒设备故障,请使用免提办理业务");
 			m_bMessageBox = false;
 		}
 		else {

+ 50 - 12
Module/mod_vtmloader/VtmLoaderFSM.cpp

@@ -253,6 +253,7 @@ ErrorCodeEnum CVtmLoaderFSM::OnInit()
 
 ErrorCodeEnum CVtmLoaderFSM::OnExit()
 {
+	GetEntityBase()->GetFunction()->KillTimer(TIMER_CENTERSETTING_UPDATE_CHECK);
 	RemoveStateHooker(this);
 	return Error_Succeed;
 }
@@ -1547,8 +1548,8 @@ void CVtmLoaderFSM::NoticeEntityLoad(int evtCode)
 	{
 		if (m_csEntityList.IndexOf(strEntityNames[i]) != -1)
 		{
-			LogWarn(Severity_Low, Error_Debug, LOG_TRACE_ENTITY_START_TIME,
-				SP::Module::Util::generateConsumeTimeJson(strEntityNames[i], SP::Module::Util::formatTime(Infos[i].startTime).c_str(), GetDualTime(Infos[i].startTime, Infos[i].startEndTime)).GetData());
+			//LogWarn(Severity_Low, Error_Debug, LOG_TRACE_ENTITY_START_TIME,
+			//	SP::Module::Util::generateConsumeTimeJson(strEntityNames[i], SP::Module::Util::formatTime(Infos[i].startTime).c_str(), GetDualTime(Infos[i].startTime, Infos[i].startEndTime)).GetData());
 			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("EntityStartCost")
 				(SP::Module::Util::generateConsumeTimeJson(strEntityNames[i], SP::Module::Util::formatTime(Infos[i].startTime).c_str(), GetDualTime(Infos[i].startTime, Infos[i].startEndTime)).GetData());
 		}
@@ -1757,8 +1758,10 @@ bool CVtmLoaderFSM::GetConfig()
 	}
 	refreshLogLevel();
 
-
-	//all cfg is ready, then init the entity
+	//all cfg is ready, then init the entity, set centersetting update timer
+	void* pTmpData = NULL;
+	ITimerListener* pListener = new TimerOutHelper<CVtmLoaderFSM>(this, &CVtmLoaderFSM::OnCentersettingUpdateTimeout, pTmpData);
+	GetEntityBase()->GetFunction()->SetTimer(TIMER_CENTERSETTING_UPDATE_CHECK, pListener, CENTERSETTING_UPDATE_CHECK_TIME);
 
 	eErr = SubscribeEntitysEvents();
 	if (eErr != Error_Succeed)
@@ -1966,14 +1969,7 @@ void CVtmLoaderFSM::CheckDeviceEntity(SpReqAnsContext<VtmLoaderService_CheckDevi
 	CEntityStaticInfo staticInfo;
 	ErrorCodeEnum eErrCode = Error_Unexpect;
 	CSimpleStringA csEntityName = ctx->Req.entityName;
-	//oiltmp@20240415 to be delete after x months
-	if (ctx->Req.entityName.Compare("CardIssuer") == 0)
-	{
-		if (m_sysInfo.strMachineType.Compare("RVC.CardStore") == 0 || m_sysInfo.strMachineType.Compare("RVC.CardPrinter") == 0)
-			csEntityName = "CardIssuerStore";
-		else
-			csEntityName = "CardIssuerStand";
-	}
+	
 	if ((eErrCode = m_pEntity->GetFunction()->GetEntityStaticInfo(csEntityName.GetData(), staticInfo)) != Error_Succeed)
 	{
 		DbgWithLink(LOG_LEVEL_ERROR, LOG_TYPE_SYSTEM)("GetEntityStaticInfo(%s), failed:%d", ctx->Req.entityName.GetData(), eErrCode);
@@ -3028,4 +3024,46 @@ void CVtmLoaderFSM::DoSpecialJobInTestRoom()
 		Sleep(10000);
 		GetEntityBase()->GetFunction()->GetPrivilegeFunction()->Reboot(RebootTrigger_ManualLocal, RebootWayEnum::RebootWay_Framework);
 	}
+}
+
+DWORD CVtmLoaderFSM::GetCenterCfgThread()
+{
+	bool isUpdate = false, isReset = false;
+	CSimpleString version;
+	if (false == GetEntityBase()->GetFunction()->HasPrivilege())
+	{
+		LogWarn(Severity_High, Error_Unexpect, VtmLoader_CenterSettingConnectFailed,
+			CSimpleStringA::Format("下载集中配置失败:%s do not has privilege", __FUNCTION__));
+		DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setLogCode("QLR0402101Z01").setResultCode("RTA1104")("集中配置下载失败");
+		return -1;
+	}
+
+
+	auto ret = GetEntityBase()->GetFunction()->GetPrivilegeFunction()->TryUpdateCenterCfg(isUpdate, isReset, version);
+	if (ret != ErrorCodeEnum::Error_Succeed)
+	{
+		LogWarn(Severity_High, Error_Unexpect, VtmLoader_CenterSettingConnectFailed,
+			CSimpleStringA::Format("下载集中配置失败:%d", ret));
+		DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setLogCode("QLR0402101Z01").setResultCode("RTA1104")("集中配置下载失败");
+		return -1;
+	}
+
+	if (!isUpdate)
+	{
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("GetCenterSetting")("Centersetting not changed from spshell");
+		return -1;
+	}
+
+	LogWarn(Severity_Low, Error_Succeed, VtmLoader_CenterSettingConnectFailed,
+		CSimpleStringA::Format("下载集中配置成功,版本号变更成:%s", version.GetData()));
+
+	if (isReset)
+		LogEvent(Severity_Middle, EVENT_MOD_CENTERSETTING_CRITICAL_UPDATE, "SpShell:Update centersetting with critical items.");
+	return 0;
+}
+
+void CVtmLoaderFSM::OnCentersettingUpdateTimeout(void* pData)
+{
+	GetCenterCfgThread();
+	GetEntityBase()->GetFunction()->ResetTimer(TIMER_CENTERSETTING_UPDATE_CHECK, CENTERSETTING_UPDATE_CHECK_TIME);
 }

+ 31 - 1
Module/mod_vtmloader/VtmLoaderFSM.h

@@ -7,6 +7,10 @@
 #include "VtmLoader_server_g.h"
 using namespace VtmLoader;
 
+//集中配置更新  
+#define CENTERSETTING_UPDATE_CHECK_TIME 60000 * 5 //集中配置更新时间5分钟
+#define TIMER_CENTERSETTING_UPDATE_CHECK 1
+
 enum EvtType
 {
 	USER_EVT_NetworkCheck_Passed = EVT_USER + 1,		// 网络检查通过,包括网卡及到总行服务的连通性
@@ -74,6 +78,30 @@ struct EntityLoadFault
 };
 class CVtmLoaderEntity;
 
+template<class T>
+class TimerOutHelper : public ITimerListener
+{
+public:
+	typedef void (T::* FuncTimer)(void* pUserdata);
+
+	TimerOutHelper(T* p, FuncTimer pTimerFunc, void* pData, bool bDeleteSelf = false)
+		: m_pObject(p), m_pUserData(pData), m_pTimer(pTimerFunc), m_bDeleteSelf(bDeleteSelf)
+	{
+	}
+
+	virtual void OnTimeout(DWORD dwTimerID)
+	{
+		(m_pObject->*m_pTimer)(m_pUserData);
+		if (m_bDeleteSelf)
+			delete this;
+	}
+private:
+	void* m_pUserData;
+	T* m_pObject;
+	FuncTimer m_pTimer;
+	bool m_bDeleteSelf;
+};
+
 class CVtmLoaderFSM : public FSMImpl<CVtmLoaderFSM>, public IFSMStateHooker, public ICallbackListener
 {
 public:
@@ -198,7 +226,9 @@ private:
 	void CheckAudio(SpReqAnsContext<VtmLoaderService_CheckDeviceEntity_Req, VtmLoaderService_CheckDeviceEntity_Ans>::Pointer ctx);
 	void CheckVideo(SpReqAnsContext<VtmLoaderService_CheckDeviceEntity_Req, VtmLoaderService_CheckDeviceEntity_Ans>::Pointer ctx);
 	bool IfInExcludedLoadList(CSimpleStringA csEntityName);
-		
+	
+	DWORD GetCenterCfgThread();
+	void OnCentersettingUpdateTimeout(void* pData);
 	
 };
 class CheckDeviceEntityEvent : public FSMEvent

+ 2 - 1
Module/mod_vtmloader/VtmLoader_UserCode.h

@@ -28,4 +28,5 @@ const int VtmLoader_CheckAudio_CfgHandFreeError = 0x10f0021b;
 const int VtmLoader_SIPPhoneEntityLoad_Cost = 0x10f0021c;
 const int VtmLoader_DepDirCopyFailed = 0x10f0021d;
 const int VtmLoader_DepDirCopySuc = 0x10f0021e;
-const int VtmLoader_InfoAboutBootCost = 0x10f0021f;
+const int VtmLoader_InfoAboutBootCost = 0x10f0021f;
+const int VtmLoader_CenterSettingConnectFailed = 0x10f00220;

+ 1 - 1
Module/mod_vtmloader/mod_vtmloader.h

@@ -55,7 +55,7 @@ public:
 	virtual void OnLog(const CAutoArray<CUUID> &SubIDs, const CUUID nLogID,const LogTypeEnum eLogType, const SeverityLevelEnum eLevel,
 		const DWORD dwSysError,const DWORD dwUserCode,const DWORD dwEntityInstanceID, const WORD wEntityDevelID, 
 		const CAutoArray<DWORD> &Param, const char *pszEntityName, const char *pszModuleName,const char *pszMessage, const linkContext &pLinkInfo);
-	
+
 	ErrorCodeEnum UnsubscribeEntitysEvents();
 	CSimpleStringA GetCurMaintainer(){ return m_strUserID;}
 

+ 41 - 4
Other/libaudioqueue/libaudioqueue.cpp

@@ -29,6 +29,7 @@ private:
 		Clibsharememory m_ShareMem;
 		void* m_lpMem;
 		linkqueue*m_pQueue;
+		int m_nTimeSignLens;
 		int m_nQueueAddrLens;
 		int m_nQnodeAddrLens;
 		int m_nFrameAddrLens;
@@ -37,6 +38,7 @@ private:
 		unsigned long aQnodeAddr[MAX_AUDIOQUEUE_LENS];
 		unsigned long aAudioFrameAddr[MAX_AUDIOQUEUE_LENS];
 		unsigned long aAudioDataAddr[MAX_AUDIOQUEUE_LENS];
+		unsigned long nTimeSignAddr;
 public:
 	libaudioqueue_impl(const char* audioqueuename,int framesize=MAX_AUDIOQNODE_SIZE)
 	{
@@ -45,6 +47,7 @@ public:
 		szShareMemName = NULL;
 		m_nQueueAddrLens = 0;
 		m_nQnodeAddrLens = 0;
+		m_nTimeSignLens = 0;
 		m_nFrameAddrLens = 0;
 		m_nDataAddrlens = 0;
 		for(int i=0;i<MAX_AUDIOQUEUE_LENS;i++)
@@ -53,6 +56,7 @@ public:
 			aAudioFrameAddr[i] = 0;
 			aAudioDataAddr[i] = 0;
 		}
+		nTimeSignAddr = 0;
 		InitQueue(audioqueuename,framesize);
 	}
 
@@ -60,6 +64,7 @@ public:
 	{
 		ClearAudioQueue();
 	}
+
 	//初始化队列
 	bool InitQueue(const char* szName,int framesize=MAX_AUDIOQNODE_SIZE)
 	{
@@ -68,7 +73,8 @@ public:
 		m_nQnodeAddrLens = MAX_AUDIOQUEUE_LENS*sizeof(Qnode);
 		m_nFrameAddrLens = MAX_AUDIOQUEUE_LENS*sizeof(audio_frame);
 		m_nDataAddrlens	= MAX_AUDIOQUEUE_LENS*framesize;
-		int nMemTotalNum = m_nQueueAddrLens+m_nQnodeAddrLens+m_nFrameAddrLens+m_nDataAddrlens;
+		m_nTimeSignLens = sizeof(unsigned int);
+		int nMemTotalNum = m_nTimeSignLens+m_nQueueAddrLens+m_nQnodeAddrLens+m_nFrameAddrLens+m_nDataAddrlens;
 
 		if (m_ShareMem.Create(szName,nMemTotalNum)&&(m_nDataAddrlens!=0))
 		{
@@ -83,6 +89,7 @@ public:
 					aAudioFrameAddr[i] = (unsigned long)m_pQueue+m_nQueueAddrLens+m_nQnodeAddrLens+sizeof(audio_frame)*i;
 					aAudioDataAddr[i] = (unsigned long)m_pQueue+m_nQueueAddrLens+m_nQnodeAddrLens+m_nFrameAddrLens+framesize*i;
 				}
+				nTimeSignAddr =  (unsigned long)m_pQueue+m_nQueueAddrLens+m_nQnodeAddrLens+m_nFrameAddrLens+m_nDataAddrlens;
 				m_pQueue->frontindex = m_pQueue->rearindex = 0;
 				m_pQueue->queuelens = 0;
 				m_ShareMem.Unlock();
@@ -102,6 +109,7 @@ public:
 					aAudioFrameAddr[i] = (unsigned long)m_pQueue+m_nQueueAddrLens+m_nQnodeAddrLens+sizeof(audio_frame)*i;
 					aAudioDataAddr[i] = (unsigned long)m_pQueue+m_nQueueAddrLens+m_nQnodeAddrLens+m_nFrameAddrLens+framesize*i;
 				}
+				nTimeSignAddr =  (unsigned long)m_pQueue+m_nQueueAddrLens+m_nQnodeAddrLens+m_nFrameAddrLens+m_nDataAddrlens;
 				m_ShareMem.Unlock();
 				bret = true;
 			}
@@ -132,7 +140,7 @@ public:
 		}
 	}
 	//往音频循环队列尾部插节点
-	bool InsertAudio(audio_frame* Audio)
+	bool InsertAudio(audio_frame* Audio,unsigned int nowtime)
 	{
 		if(m_ShareMem.IsValid())
 		{
@@ -174,6 +182,8 @@ public:
 					audiotmp->nchannels				= Audio->nchannels;
 					audiotmp->samplespersec			= Audio->samplespersec;
 					audiotmp->iseriesnumber			= Audio->iseriesnumber;
+					unsigned int*Ptr				= (unsigned int*)nTimeSignAddr;
+					*Ptr	= nowtime;
 					memcpy(audiotmp->data,Audio->data,Audio->framesize);
 					rearptrfront->nextqnodeindex = m_pQueue->rearindex;
 					//delete Audio->data;
@@ -373,6 +383,29 @@ public:
 			return 0;
 		}
 	}
+
+	unsigned int GetLastFrameTime()
+	{
+		if(m_ShareMem.IsValid())
+		{
+			m_lpMem = m_ShareMem.Lock(1000);
+			if(m_lpMem != NULL)
+			{
+				unsigned int nLastFrameTime = 0;
+				nLastFrameTime = *(unsigned int *)nTimeSignAddr;
+				m_ShareMem.Unlock();
+				return nLastFrameTime;
+			}
+			else
+			{
+				return 0;
+			}
+		}
+		else
+		{
+			return 0;
+		}
+	}
 };
 
 // 这是已导出类的构造函数。
@@ -391,9 +424,9 @@ Clibaudioqueue::~Clibaudioqueue()
 }
 
 
-bool Clibaudioqueue::InsertAudio(audio_frame* Audio)
+bool Clibaudioqueue::InsertAudio(audio_frame* Audio,unsigned int nowtime)
 {
-	bool bRst = m_pImpl->InsertAudio(Audio);
+	bool bRst = m_pImpl->InsertAudio(Audio, nowtime);
 	return bRst;
 }
 
@@ -433,3 +466,7 @@ void Clibaudioqueue::DeleteHeadAudio()
 	return;
 }
 
+unsigned int Clibaudioqueue::GetLastFrameTime()
+{
+	return m_pImpl->GetLastFrameTime();
+}

+ 3 - 1
Other/libaudioqueue/libaudioqueue.h

@@ -50,11 +50,13 @@ private:
 	libaudioqueue_impl*m_pImpl;
 public:
 	//插音频到队尾
-	bool InsertAudio(audio_frame* Audio);
+	bool InsertAudio(audio_frame* Audio,unsigned int nowtime = 0);
 	//读队头
 	bool GetAudio(audio_frame* Audio);
 	//读队头并删除队头数据
 	bool GetAudioAndDel(audio_frame* Audio);
+	//获取最后的帧时间
+	unsigned int GetLastFrameTime();
 	//获得音频队列的长度
 	int GetAudioLens(void);
 	//获得音频单个节点的大小

+ 9 - 47
Other/libfacecapture/libfacecapture.cpp

@@ -1030,9 +1030,7 @@ private:
 			//计算人脸亮度
 			//if (m_stFaceConfig.nServersType == 0)
 			//{
-			//	m_pHostApi->Debug(FACECAP_DEBUG, "%s:%d eCamera = %d.", __FUNCTION__, __LINE__, eCamera);
 			//	m_stAllFaceInfo.astFaceInfo[0].eBrightness = CalcFaceBrightness(m_pProcessImg,&m_stAllFaceInfo.astFaceInfo[0].stRegion.stFaceRect);
-			//	m_pHostApi->Debug(FACECAP_DEBUG, "%s:%d m_stAllFaceInfo.astFaceInfo[0].eBrightness = %d.", __FUNCTION__, __LINE__, m_stAllFaceInfo.astFaceInfo[0].eBrightness);
 			//}
 		}
 		//清空存储区
@@ -1656,44 +1654,6 @@ private:
 		}
 	}
 
-	//void SetUpperbodyToCenter(CameraEnum eCamera)
-	//{
-	//	int nImgWidth,nImgHeight;
-	//	m_stAllFaceInfo.astFaceInfo[0].eCamera = eCamera;
-	//	m_pHostApi->Debug(FACECAP_DEBUG, "%s:%d set m_stAllFaceInfo.astFaceInfo[0].eCamera = %d.", __FUNCTION__, __LINE__, eCamera);
-	//	if (m_stAllFaceInfo.astFaceInfo[0].eCamera == EnvironCamera)
-	//	{
-	//		if (m_pEnvironVideoQueue == NULL)
-	//		{
-	//			return;
-	//		}
-	//		if (m_pEnvironVideoQueue->GetVideoLens()<=0)
-	//		{
-	//			m_pHostApi->Debug(FACECAP_DEBUG, "获取环境相机图像队列长度错误!");
-	//			return;
-	//		}
-	//		int size = m_pEnvironVideoQueue->GetFrameSize(nImgWidth,nImgHeight);
-	//	}
-	//	else if(m_stAllFaceInfo.astFaceInfo[0].eCamera == OperatorCamera)
-	//	{
-	//		if (m_pOperatorVideoQueue == NULL)
-	//		{
-	//			return;
-	//		}
-	//		if (m_pOperatorVideoQueue->GetVideoLens()<=0)
-	//		{
-	//			m_pHostApi->Debug(FACECAP_DEBUG, "获取操作相机图像队列长度错误!");
-	//			return ;
-	//		}
-	//		int size = m_pOperatorVideoQueue->GetFrameSize(nImgWidth,nImgHeight);
-	//	}
-	//	m_stAllFaceInfo.astFaceInfo[0].stRegion.stUpperBodyRect.height = nImgHeight/2;
-	//	m_stAllFaceInfo.astFaceInfo[0].stRegion.stUpperBodyRect.width = nImgWidth/2;
-	//	m_stAllFaceInfo.astFaceInfo[0].stRegion.stUpperBodyRect.x = nImgWidth/4;
-	//	m_stAllFaceInfo.astFaceInfo[0].stRegion.stUpperBodyRect.y = nImgHeight/4;
-	//	WriteAllFaceInfo(m_stAllFaceInfo);
-	//}
-
 	//根据主用户设置人脸剪辑区域
 	void SetUpperbodyToCenter()
 	{
@@ -1830,11 +1790,9 @@ private:
 		bool bRst = false;
 		uint32_t nSearchFaceFailNum = 0;   //搜索人脸失败次数
 		uint32_t nDetectFailNum = 0;   //检测人脸失败的次数
-		uint32_t nMotionTrackNum = 0;
 
 		//select camera
 		m_eCamera = GetInitPrimCamera();
-
 		uint32_t iwaittime = m_stFaceConfig.nSleepShort;
 
 		while (!m_bStopVieoMonitor)
@@ -1850,7 +1808,6 @@ private:
 				//灯光变化时,清空历史记录,防止误判
 				if (m_bLightChange){
 					ReleaseMotionTrackRst();
-					nMotionTrackNum = 0;
 					m_bLightChange = false;
 				}
 
@@ -2144,16 +2101,21 @@ public:
 #ifdef _WIN32
 		ResetEvent(m_hStopEventWait);
 		if (NULL == m_hVieoMonitorThread){
-			m_pHostApi->Debug(FACECAP_DEBUG, "create video monitor thread.");
 			m_hVieoMonitorThread = (HANDLE)_beginthreadex(NULL, 0, VideoMonitorThread, this, 0, (unsigned int*)&m_nVieoMonitorThreadId);
-			m_bStopVieoMonitor = false;
-			m_eMonitorState = MonitorStateEnum::NoBody;
+			if (m_hVieoMonitorThread) {
+				m_bStopVieoMonitor = false;
+				m_eMonitorState = MonitorStateEnum::NoBody;
+				m_pHostApi->Debug(FACECAP_DEBUG, "create video monitor thread success.");
+			}
+			else {
+				m_pHostApi->Debug(FACECAP_INFO, "create video monitor thread failed!");
+			}
 		}
 #else
 		if (0 == pthread_create(&m_videomonitorthreadid, NULL, videomonitorfunc, (void*)this)){
-			m_pHostApi->Debug(FACECAP_DEBUG, "create video monitor thread and thread id is %u.", m_videomonitorthreadid);
 			m_bStopVieoMonitor = false;
 			m_eMonitorState = MonitorStateEnum::NoBody;
+			m_pHostApi->Debug(FACECAP_DEBUG, "create video monitor thread success and thread id is %u.", m_videomonitorthreadid);
 		}
 		else {
 			m_pHostApi->Debug(FACECAP_INFO, "create video monitor thread failed.");

+ 23 - 23
Other/libfilecryption/filecryption.cpp

@@ -48,7 +48,7 @@ static int encrypt_asf_file(char* poutfilename, char* phead, uint32_t uheaderlen
 	char strGuid[HEADER_OBJECT_GUID_LEN] = { 0 };
 	fread(strGuid, 1, HEADER_OBJECT_GUID_LEN, pSrcFile);
 	if (0 != memcmp(strGuid, ASF_Header_GUID, HEADER_OBJECT_GUID_LEN)) {
-		safe_log(pcallback, FILECRYPT_LOG_ERROR, "%s", "math guid failed, current format is not surpport!");
+		safe_log(pcallback, FILECRYPT_LEVEL_ERROR, "%s", "math guid failed, current format is not surpport!");
 		fclose(pDestFile);
 		return iret;
 	}
@@ -100,22 +100,22 @@ static int encrypt_mp4_file(char* poutfilename, char* phead, uint32_t uheaderlen
 
 	unsigned int unoencryptlen = get_noencrypt_boxs_size(pSrcFile, pcallback, true);
 	if (0 == unoencryptlen) {
-		safe_log(pcallback, FILECRYPT_LOG_ERROR, "get not encrypt boxs size failed.");
+		safe_log(pcallback, FILECRYPT_LEVEL_ERROR, "get not encrypt boxs size failed.");
 		return iret;
 	}
-	//safe_log(pcallback, FILECRYPT_LOG_DEBUG, "not encrypt file length is %u.", unoencryptlen);
+	//safe_log(pcallback, FILECRYPT_LEVEL_DEBUG, "not encrypt file length is %u.", unoencryptlen);
 
 	FILE* pDestFile = fopen(poutfilename, "wb");
 	if (NULL == pDestFile) {
 		fclose(pSrcFile);
-		safe_log(pcallback, FILECRYPT_LOG_ERROR, "open output file failed.");
+		safe_log(pcallback, FILECRYPT_LEVEL_ERROR, "open output file failed.");
 		return iret;
 	}
 
 	fseek(pSrcFile, 0, SEEK_END);
 	uint32_t usrcfilelen = (uint32_t)ftell(pSrcFile);
 	rewind(pSrcFile);
-	safe_log(pcallback, FILECRYPT_LOG_DEBUG, "src file length is %u.", usrcfilelen);
+	safe_log(pcallback, FILECRYPT_LEVEL_DEBUG, "src file length is %u.", usrcfilelen);
 
 	//1. 新增自定义文件头
 	fwrite(phead, 1, uheaderlen, pDestFile);
@@ -150,7 +150,7 @@ static int encrypt_mp4_file(char* poutfilename, char* phead, uint32_t uheaderlen
 	unsigned char* pobjdataenc = (unsigned char*)malloc(iencdatalen);
 	
 	if (0 == SM4EncECBMode(pstrkey, pmoovboxdata, umoovboxlen, pobjdataenc, &iencdatalen)) {
-		safe_log(pcallback, FILECRYPT_LOG_DEBUG, "after encode, moov box length is %u.", iencdatalen);
+		safe_log(pcallback, FILECRYPT_LEVEL_DEBUG, "after encode, moov box length is %u.", iencdatalen);
 		if (iencdatalen > 0) {
 			//3. 填充加密后的moov box长度
 			fwrite(&iencdatalen, 1, sizeof(uint32_t), pDestFile);
@@ -161,7 +161,7 @@ static int encrypt_mp4_file(char* poutfilename, char* phead, uint32_t uheaderlen
 	}
 	
 	if(0 != iret){
-		safe_log(pcallback, FILECRYPT_LOG_ERROR, "SM4 encrypt moovbox failed, and src moovbox len is %d.", umoovboxlen);
+		safe_log(pcallback, FILECRYPT_LEVEL_ERROR, "SM4 encrypt moovbox failed, and src moovbox len is %d.", umoovboxlen);
 	}
 	
 	fclose(pDestFile);
@@ -273,7 +273,7 @@ static int decrypt_mp4_file(char* poutfilename, FILE* pSrcFile, unsigned char* p
 	if (0 == unoencryptlen) {
 		return iret;
 	}
-	safe_log(pcallback, FILECRYPT_LOG_DEBUG, "not encrypt file length is %u.", unoencryptlen);
+	safe_log(pcallback, FILECRYPT_LEVEL_DEBUG, "not encrypt file length is %u.", unoencryptlen);
 
 	//1. 填充ftyp, free, mdat box
 	char* data_buffer = (char*)malloc(RVC_READ_BUFFER_SIZE);
@@ -294,7 +294,7 @@ static int decrypt_mp4_file(char* poutfilename, FILE* pSrcFile, unsigned char* p
 	//2. 获取加密后的moov box大小
 	uint32_t uencryptboxsize = 0;
 	fread(&uencryptboxsize, 1, sizeof(uint32_t), pSrcFile);
-	safe_log(pcallback, FILECRYPT_LOG_DEBUG, "encrypt moov box size is = %d.", uencryptboxsize);
+	safe_log(pcallback, FILECRYPT_LEVEL_DEBUG, "encrypt moov box size is = %d.", uencryptboxsize);
 
 	if (uencryptboxsize > 0) {
 		//3. 读取加密后的moov box
@@ -305,7 +305,7 @@ static int decrypt_mp4_file(char* poutfilename, FILE* pSrcFile, unsigned char* p
 
 		//4. 解密moov box
 		SM4DecECBMode(pstrkey, pmoovboxdata, uencryptboxsize, pdecmoovboxdata, &ioutlen);
-		safe_log(pcallback, FILECRYPT_LOG_DEBUG, "decrypt moov box size is = %d.", ioutlen);
+		safe_log(pcallback, FILECRYPT_LEVEL_DEBUG, "decrypt moov box size is = %d.", ioutlen);
 
 		//5. 填充解密后的moov box
 		fwrite(pdecmoovboxdata, 1, ioutlen, pDestFile);
@@ -316,7 +316,7 @@ static int decrypt_mp4_file(char* poutfilename, FILE* pSrcFile, unsigned char* p
 		iret = 0;
 	}
 	else {
-		safe_log(pcallback, FILECRYPT_LOG_ERROR, "get encrypt moovbox failed, decrypt failed!");
+		safe_log(pcallback, FILECRYPT_LEVEL_ERROR, "get encrypt moovbox failed, decrypt failed!");
 	}
 
 	fclose(pDestFile);
@@ -330,20 +330,20 @@ int decryption_file(char* poutfile, uint32_t uoutlen, const char* pfilename, con
 	int iret = -1;
 
 	if (NULL == pfilename || eversion >= sizeof(cryption_ver_flag_table)/sizeof(char*) || eversion < 0){
-		safe_log(pcallback, FILECRYPT_LOG_ERROR, "%s","invalid encryption version param.");
+		safe_log(pcallback, FILECRYPT_LEVEL_ERROR, "%s","invalid encryption version param.");
 		return iret;
 	}
 
 	FILE* pSrcFile = fopen(pfilename, "rb");
 	if (NULL == pSrcFile){
-		safe_log(pcallback, FILECRYPT_LOG_ERROR, "open file %s failed!",pfilename);
+		safe_log(pcallback, FILECRYPT_LEVEL_ERROR, "open file %s failed!",pfilename);
 		return iret;
 	}
 
 	char strrvcflag[RVC_FILE_HEADER_FLAG_LEN] = {0};
 	fread(strrvcflag,1, RVC_FILE_HEADER_FLAG_LEN, pSrcFile);
 	if (0 != memcmp(strrvcflag, rvc_header, RVC_FILE_HEADER_FLAG_LEN)){
-		safe_log(pcallback, FILECRYPT_LOG_INFO, "file %s is not encryption!",pfilename);
+		safe_log(pcallback, FILECRYPT_LEVEL_INFO, "file %s is not encryption!",pfilename);
 		fclose(pSrcFile);
 		return iret;
 	}
@@ -356,7 +356,7 @@ int decryption_file(char* poutfile, uint32_t uoutlen, const char* pfilename, con
 
 	if (0 != memcmp(prvcbuffer+sizeof(uint32_t), cryption_ver_flag_table[eversion], RVC_CRYPTION_VER_FLAG_LEN)){
 		if (0 == memcmp(prvcbuffer+sizeof(uint32_t), cryption_ver_flag_table[eversion], RVC_CRYPTION_VER_FLAG_LEN-1)){
-			safe_log(pcallback, FILECRYPT_LOG_ERROR, "file %s is encrypt but decrypt version is not matched!",pfilename);
+			safe_log(pcallback, FILECRYPT_LEVEL_ERROR, "file %s is encrypt but decrypt version is not matched!",pfilename);
 		} 
 		fclose(pSrcFile);
 		safe_free(prvcbuffer);
@@ -397,7 +397,7 @@ bool is_file_encrypted(const char* pfilename, const filecryption_callback_t* pca
 
 	FILE* pSrcFile = fopen(pfilename, "rb");
 	if (NULL == pSrcFile){
-		safe_log(pcallback, FILECRYPT_LOG_ERROR, "open file %s failed!",pfilename);
+		safe_log(pcallback, FILECRYPT_LEVEL_ERROR, "open file %s failed!",pfilename);
 		return bret;
 	}
 
@@ -407,7 +407,7 @@ bool is_file_encrypted(const char* pfilename, const filecryption_callback_t* pca
 			bret = true;
 		} 
 		else{
-			safe_log(pcallback, FILECRYPT_LOG_INFO, "file %s is not encryption!",pfilename);
+			safe_log(pcallback, FILECRYPT_LEVEL_INFO, "file %s is not encryption!",pfilename);
 		}
 	}
 	fclose(pSrcFile);
@@ -425,13 +425,13 @@ int rvc_file_decrypt(unsigned char** pdechead, uint32_t* udecheadlen, int* ioffs
 {
 	int iret = -1;
 	if (NULL == pfilename || eversion >= sizeof(cryption_ver_flag_table)/sizeof(char*) || eversion < 0){
-		safe_log(pcallback, FILECRYPT_LOG_ERROR, "%s","invalid cryption version param.");
+		safe_log(pcallback, FILECRYPT_LEVEL_ERROR, "%s","invalid cryption version param.");
 		return iret;
 	}
 
 	FILE* pSrcFile = fopen(pfilename, "rb");
 	if (NULL == pSrcFile){
-		safe_log(pcallback, FILECRYPT_LOG_ERROR, "open file %s failed!",pfilename);
+		safe_log(pcallback, FILECRYPT_LEVEL_ERROR, "open file %s failed!",pfilename);
 		return iret;
 	}
 
@@ -441,7 +441,7 @@ int rvc_file_decrypt(unsigned char** pdechead, uint32_t* udecheadlen, int* ioffs
 	char strrvcflag[RVC_FILE_HEADER_FLAG_LEN] = {0};
 	fread(strrvcflag,1, RVC_FILE_HEADER_FLAG_LEN, pSrcFile);
 	if (0 != memcmp(strrvcflag, rvc_header, RVC_FILE_HEADER_FLAG_LEN)){
-		safe_log(pcallback, FILECRYPT_LOG_INFO, "file %s is not encrypted!",pfilename);
+		safe_log(pcallback, FILECRYPT_LEVEL_INFO, "file %s is not encrypted!",pfilename);
 		*pdechead = NULL;
 		*udecheadlen = 0;
 		*ioffset = 0;
@@ -458,7 +458,7 @@ int rvc_file_decrypt(unsigned char** pdechead, uint32_t* udecheadlen, int* ioffs
 
 		if (0 != memcmp(prvcbuffer+sizeof(uint32_t), cryption_ver_flag_table[eversion], RVC_CRYPTION_VER_FLAG_LEN)){
 			if (0 == memcmp(prvcbuffer+sizeof(uint32_t), cryption_ver_flag_table[eversion], RVC_CRYPTION_VER_FLAG_LEN-1)){
-				safe_log(pcallback, FILECRYPT_LOG_ERROR, "file %s encryption and decrption version is not matched!",pfilename);
+				safe_log(pcallback, FILECRYPT_LEVEL_ERROR, "file %s encryption and decrption version is not matched!",pfilename);
 			} 
 			safe_free(prvcbuffer);
 			fclose(pSrcFile);
@@ -473,7 +473,7 @@ int rvc_file_decrypt(unsigned char** pdechead, uint32_t* udecheadlen, int* ioffs
 
 		int ijson = get_file_json_infos_from_rvc_header(pstrjson, ujsonlen, prvcbuffer, irvcheadlen - RVC_FILE_HEADER_FLAG_LEN - sizeof(uint32_t));
 		if (0 == ijson){
-			safe_log(pcallback, FILECRYPT_LOG_DEBUG, "get_file_json_infos_from_rvc_header success!");
+			safe_log(pcallback, FILECRYPT_LEVEL_DEBUG, "get_file_json_infos_from_rvc_header success!");
 		}
 		safe_free(prvcbuffer);
 	}
@@ -481,7 +481,7 @@ int rvc_file_decrypt(unsigned char** pdechead, uint32_t* udecheadlen, int* ioffs
 	char strasfheader[ASF_HEADER_GUID_LEN] = {0};
 	if (ASF_HEADER_GUID_LEN == fread(strasfheader, 1, ASF_HEADER_GUID_LEN, pSrcFile)){
 		if (0 != memcmp(strasfheader, ASF_Header_GUID, ASF_HEADER_GUID_LEN)){
-			safe_log(pcallback, FILECRYPT_LOG_ERROR, "file %s is current not surrport format!",pfilename);
+			safe_log(pcallback, FILECRYPT_LEVEL_ERROR, "file %s is current not surrport format!",pfilename);
 			fclose(pSrcFile);
 			return iret;
 		}

+ 5 - 4
Other/libfilecryption/filecryption.h

@@ -35,10 +35,11 @@ enum eRvcCryptionVersion{
 };
 
 enum filecrypt_loglevel {
-	FILECRYPT_LOG_NO,
-	FILECRYPT_LOG_DEBUG,
-	FILECRYPT_LOG_INFO,
-	FILECRYPT_LOG_ERROR
+	FILECRYPT_LEVEL_DEBUG,
+	FILECRYPT_LEVEL_INFO,
+	FILECRYPT_LEVEL_WARN,
+	FILECRYPT_LEVEL_ERROR,
+	FILECRYPT_LEVEL_FATAL
 };
 
 typedef struct filecryption_callback_s  {

+ 9 - 9
Other/libfilecryption/mp4info.cpp

@@ -29,10 +29,10 @@ uint32_t get_noencrypt_boxs_size(FILE* pSrcFile, const filecryption_callback_t*
 	fread(&box_head, sizeof(box_head_t), 1, pSrcFile);
 	unsigned int uboxsize = big_to_small_endian_32bit(box_head.ibox_size);
 	if (BOX_FTYP != big_to_small_endian_32bit(box_head.box_type)) {
-		safe_log(pcallback, FILECRYPT_LOG_ERROR, "get ftyp box failed.");
+		safe_log(pcallback, FILECRYPT_LEVEL_ERROR, "get ftyp box failed.");
 		return 0;
 	}
-	safe_log(pcallback, FILECRYPT_LOG_DEBUG, "get ftyp box success, box size is %d.", uboxsize);
+	safe_log(pcallback, FILECRYPT_LEVEL_DEBUG, "get ftyp box success, box size is %d.", uboxsize);
 	uret += uboxsize;
 	fseek(pSrcFile, uboxsize - sizeof(box_head_t), SEEK_CUR);
 
@@ -40,10 +40,10 @@ uint32_t get_noencrypt_boxs_size(FILE* pSrcFile, const filecryption_callback_t*
 	fread(&box_head, sizeof(box_head_t), 1, pSrcFile);
 	uboxsize = big_to_small_endian_32bit(box_head.ibox_size);
 	if (FREE_BOX != big_to_small_endian_32bit(box_head.box_type)) {
-		safe_log(pcallback, FILECRYPT_LOG_ERROR, "get free box failed.");
+		safe_log(pcallback, FILECRYPT_LEVEL_ERROR, "get free box failed.");
 		return 0;
 	}
-	safe_log(pcallback, FILECRYPT_LOG_DEBUG, "get free box success, box size is %d.", uboxsize);
+	safe_log(pcallback, FILECRYPT_LEVEL_DEBUG, "get free box success, box size is %d.", uboxsize);
 	uret += uboxsize;
 	fseek(pSrcFile, uboxsize - sizeof(box_head_t), SEEK_CUR);
 
@@ -51,12 +51,12 @@ uint32_t get_noencrypt_boxs_size(FILE* pSrcFile, const filecryption_callback_t*
 	fread(&box_head, sizeof(box_head_t), 1, pSrcFile);
 	uboxsize = big_to_small_endian_32bit(box_head.ibox_size);
 	if (MDAT_BOX != big_to_small_endian_32bit(box_head.box_type)) {
-		safe_log(pcallback, FILECRYPT_LOG_ERROR, "get mdat box failed.");
+		safe_log(pcallback, FILECRYPT_LEVEL_ERROR, "get mdat box failed.");
 		return 0;
 	}
-	safe_log(pcallback, FILECRYPT_LOG_DEBUG, "get mdat box success, box size is %d.", uboxsize);
+	safe_log(pcallback, FILECRYPT_LEVEL_DEBUG, "get mdat box success, box size is %d.", uboxsize);
 	uret += uboxsize;
-	safe_log(pcallback, FILECRYPT_LOG_DEBUG, "ftyp box, free box and mdat box total size is %u.", uret);
+	safe_log(pcallback, FILECRYPT_LEVEL_DEBUG, "ftyp box, free box and mdat box total size is %u.", uret);
 
 	//moov box
 	if (bgetmoov) {
@@ -64,10 +64,10 @@ uint32_t get_noencrypt_boxs_size(FILE* pSrcFile, const filecryption_callback_t*
 		fread(&box_head, sizeof(box_head_t), 1, pSrcFile);
 		uboxsize = big_to_small_endian_32bit(box_head.ibox_size);
 		if (MOOV_BOX != big_to_small_endian_32bit(box_head.box_type)) {
-			safe_log(pcallback, FILECRYPT_LOG_ERROR, "get moov box failed.");
+			safe_log(pcallback, FILECRYPT_LEVEL_ERROR, "get moov box failed.");
 			return 0;
 		}
-		safe_log(pcallback, FILECRYPT_LOG_DEBUG, "get moov box success, box size is %d.", uboxsize);
+		safe_log(pcallback, FILECRYPT_LEVEL_DEBUG, "get moov box success, box size is %d.", uboxsize);
 	}
 
 	fseek(pSrcFile, ipostion, SEEK_SET);

+ 3 - 3
Other/libfilecryption/rvcfileheader.cpp

@@ -25,7 +25,7 @@ int constrcut_rvc_file_header(char* pbuffer, uint32_t* ulen, const char* pfilena
 	//4. 源文件hash值
 	char strhash[RVC_FILE_HASH_LEN] = {0};
 	if (get_srcfile_hash(strhash, RVC_FILE_HASH_LEN, pfilename)){
-		safe_log(pcallback, FILECRYPT_LOG_ERROR, "%s","get file hash failed!");
+		safe_log(pcallback, FILECRYPT_LEVEL_ERROR, "%s","get file hash failed!");
 		return iret;
 	}
 	if (0 == fill_tag_buffer(pbuffer + udatalen, *ulen - udatalen, strhash, RVC_FILE_HASH_LEN)){
@@ -140,12 +140,12 @@ int get_key_from_header_info(unsigned char* pkey, uint32_t ukeysize, char* phead
 
 	rvc_fileheader_t t_param = {0};
 	if (0 != get_rvc_file_header_info(&t_param, pheader, udatalen, pcallback)){
-		safe_log(pcallback, FILECRYPT_LOG_ERROR, "%s", "get rvc file header infos failed!");
+		safe_log(pcallback, FILECRYPT_LEVEL_ERROR, "%s", "get rvc file header infos failed!");
 		return iret;
 	}
 
 	if (0 == GenerateSM4Key(pkey, ukeysize, t_param.strhash, RVC_FILE_HASH_LEN, t_param.usrcfilelen)){
-		safe_log(pcallback, FILECRYPT_LOG_DEBUG, "%s", "Generate SM4Key success!");
+		safe_log(pcallback, FILECRYPT_LEVEL_DEBUG, "%s", "Generate SM4Key success!");
 		iret = 0;
 	}
 

+ 41 - 41
Other/libvideorecord/FFmpegWriter.cpp

@@ -99,7 +99,7 @@ static bool add_stream(LogApi* pLogApi, OutputStream *ost, AVFormatContext *oc,
     /* find the encoder */
     *codec = avcodec_find_encoder(codec_id);
     if (!(*codec)) {
-        pLogApi->Debug("add_stream failed for Could not find encoder for %s", avcodec_get_name(codec_id));
+        pLogApi->Debug("add_stream failed for Could not find encoder for %s.", avcodec_get_name(codec_id));
         return false;
     }
 
@@ -125,7 +125,7 @@ static bool add_stream(LogApi* pLogApi, OutputStream *ost, AVFormatContext *oc,
             enc_ctx->sample_rate = nSamplePsec;
             if ((*codec)->supported_samplerates) {
                 for (int i = 0; (*codec)->supported_samplerates[i]; i++) {
-				    pLogApi->Debug("(*codec)->supported_samplerates[%d] = %d.", i, (*codec)->supported_samplerates[i]);
+				    //pLogApi->Debug("(*codec)->supported_samplerates[%d] = %d.", i, (*codec)->supported_samplerates[i]);
                 }
             }
 		    if (nchannels == 2){
@@ -197,7 +197,7 @@ static bool add_stream(LogApi* pLogApi, OutputStream *ost, AVFormatContext *oc,
         enc_ctx->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
     }
 
-    pLogApi->Debug("add_stream success get encoder for '%s'", avcodec_get_name(codec_id));
+    //pLogApi->Debug("add_stream success get encoder for '%s'", avcodec_get_name(codec_id));
 
 	return true;
 }
@@ -292,7 +292,7 @@ static bool open_audio(LogApi* pLogApi, AVFormatContext *oc, AVCodec *codec, Out
         return false;
     }
 
-    pLogApi->Debug("open_audio success encoder for %s, nb_samples:%d.", avcodec_get_name(codec->id), nb_samples);
+    //pLogApi->Debug("open_audio success encoder for %s, nb_samples:%d.", avcodec_get_name(codec->id), nb_samples);
 
 	return true;
 }
@@ -343,7 +343,7 @@ static int write_audio_frame(LogApi* pLogApi, AVFormatContext *oc, OutputStream
          */
         ret = av_frame_make_writable(audio_ost->frame);
         if (ret < 0) {
-            pLogApi->Debug("write_audio_frame failed for av_frame_make_writable: %d", ret);
+            pLogApi->Debug("write_audio_frame failed for av_frame_make_writable: %d.", ret);
             return -1;
         }
 
@@ -358,7 +358,7 @@ static int write_audio_frame(LogApi* pLogApi, AVFormatContext *oc, OutputStream
             audio_ost->frame->data, dst_nb_samples,
                           (const uint8_t **)frame->data, frame->nb_samples);
         if (ret < 0) {
-            pLogApi->Debug("write_audio_frame failed for Error while converting");
+            pLogApi->Debug("write_audio_frame failed for Error while converting.");
             return -1;
         }
         frame = audio_ost->frame;
@@ -392,7 +392,7 @@ static int write_audio_frame(LogApi* pLogApi, AVFormatContext *oc, OutputStream
         //pLogApi->Debug("write_audio_frame got_packet");
         ret = write_frame(oc, &enc_ctx->time_base, audio_ost->st, &pkt, pLogApi);
         if (ret < 0) {
-            pLogApi->Debug("write_audio_frame failed for Error while writing audio frame: %d", ret);
+            pLogApi->Debug("write_audio_frame failed for Error while writing audio frame: %d.", ret);
             return -1;
         }
     }
@@ -448,14 +448,14 @@ static bool open_video(LogApi* pLogApi, AVFormatContext *oc, AVCodec *codec, Out
     ret = avcodec_open2(enc_ctx, codec, &opt);
     av_dict_free(&opt);
     if (ret < 0) {
-        pLogApi->Debug("open_video failed for Could not open video codec: %s, ret :%d", avcodec_get_name(codec->id), ret);
+        pLogApi->Debug("open_video failed for Could not open video codec: %s, ret :%d.", avcodec_get_name(codec->id), ret);
         return false;
     }
 
     /* allocate and init a re-usable frame */
     video_ost->frame = alloc_picture(enc_ctx->pix_fmt, enc_ctx->width, enc_ctx->height);
     if (!video_ost->frame) {
-        pLogApi->Debug("open_video failed for Could not allocate video frame");
+        pLogApi->Debug("open_video failed for Could not allocate video frame.");
         return false;
     }
 
@@ -466,7 +466,7 @@ static bool open_video(LogApi* pLogApi, AVFormatContext *oc, AVCodec *codec, Out
     if (enc_ctx->pix_fmt != input_pix_fmt) {
         video_ost->tmp_frame = alloc_picture(input_pix_fmt, enc_ctx->width, enc_ctx->height);
         if (!video_ost->tmp_frame) {
-            pLogApi->Debug("Could not allocate temporary picture");
+            pLogApi->Debug("Could not allocate temporary picture.");
             return false;
         }
     }
@@ -474,15 +474,15 @@ static bool open_video(LogApi* pLogApi, AVFormatContext *oc, AVCodec *codec, Out
     /* copy the stream parameters to the muxer */
     ret = avcodec_parameters_from_context(video_ost->st->codecpar, enc_ctx);
     if (ret < 0) {
-        pLogApi->Debug("open_video failed for Could not copy the stream parameters");
+        pLogApi->Debug("open_video failed for Could not copy the stream parameters.");
         return false;
     }
 
-    pLogApi->Debug("open_video success encoder for %s.", avcodec_get_name(codec->id));
-    pLogApi->Debug("open_video success encoder output_fmt: %s.", av_get_pix_fmt_name(enc_ctx->pix_fmt));
-    pLogApi->Debug("open_video success encoder input_fmt: %s.", av_get_pix_fmt_name(input_pix_fmt));
-    pLogApi->Debug("open_video success encoder, video enc_ctx time_base num: %d.", enc_ctx->time_base.num);
-    pLogApi->Debug("open_video success encoder, video enc_ctx time_base den: %d.", enc_ctx->time_base.den);
+    //pLogApi->Debug("open_video success encoder for %s.", avcodec_get_name(codec->id));
+    //pLogApi->Debug("open_video success encoder output_fmt: %s.", av_get_pix_fmt_name(enc_ctx->pix_fmt));
+    //pLogApi->Debug("open_video success encoder input_fmt: %s.", av_get_pix_fmt_name(input_pix_fmt));
+    //pLogApi->Debug("open_video success encoder, video enc_ctx time_base num: %d.", enc_ctx->time_base.num);
+    //pLogApi->Debug("open_video success encoder, video enc_ctx time_base den: %d.", enc_ctx->time_base.den);
 
 	return true;
 }
@@ -603,7 +603,7 @@ static int write_video_frame(LogApi* pLogApi, AVFormatContext *oc, OutputStream
     }
 
     if (ret < 0) {
-        pLogApi->Debug("open_video failed for Error while writing video frame: %d", ret);
+        pLogApi->Debug("open_video failed for Error while writing video frame: %d.", ret);
         return -1;
     }
 
@@ -631,15 +631,15 @@ bool FFmpegWriter::InitWriter(char* filename, int width, int height, int colorbi
 	bool result = true;
 
 	if (nBitPerSample != 8 && nBitPerSample != 16 && nBitPerSample != 32){
-        m_pLogApi->Debug("Init FFmpegWriter Failed for BitPerSample = %d", nBitPerSample);
+        m_pLogApi->Debug("Init FFmpegWriter Failed for BitPerSample = %d.", nBitPerSample);
 		return false;
 	}
 	if (nchannels != 1 && nchannels != 2){
-        m_pLogApi->Debug("Init FFmpegWriter Failed for channels = %d", nchannels);
+        m_pLogApi->Debug("Init FFmpegWriter Failed for channels = %d.", nchannels);
 		return false;
 	}
 	if (colorbit != 24){
-        m_pLogApi->Debug("Init FFmpegWriter Failed for colorbit = %d", colorbit);
+        m_pLogApi->Debug("Init FFmpegWriter Failed for colorbit = %d.", colorbit);
 		return false;
 	}
 
@@ -651,14 +651,14 @@ bool FFmpegWriter::InitWriter(char* filename, int width, int height, int colorbi
     /* allocate the output media context */
     avformat_alloc_output_context2(&m_formatctx, NULL, NULL, filename);
     if (!m_formatctx) {
-        m_pLogApi->Debug("Init FFmpegWriter Failed for avformat_alloc_output_context2, filename = %s", filename);
+        m_pLogApi->Debug("Init FFmpegWriter Failed for avformat_alloc_output_context2, filename = %s.", filename);
         return false;
     }
 
     //av_log_set_level(AV_LOG_ERROR);
     //av_log_set_callback(log_callback);
     m_outfmt = m_formatctx->oformat;
-	m_pLogApi->Debug("real output format name of '%s' is %s, long_name is %s, mime_type is %s, extensions is %s.", filename, m_outfmt->name, m_outfmt->long_name, m_outfmt->mime_type, m_outfmt->extensions);
+	//m_pLogApi->Debug("real output format name of '%s' is %s, long_name is %s, mime_type is %s, extensions is %s.", filename, m_outfmt->name, m_outfmt->long_name, m_outfmt->mime_type, m_outfmt->extensions);
 
     m_video_st = new OutputStream();
     m_audio_st = new OutputStream();
@@ -669,7 +669,7 @@ bool FFmpegWriter::InitWriter(char* filename, int width, int height, int colorbi
         result = add_stream(m_pLogApi, m_video_st, m_formatctx, &m_video_codec, m_outfmt->video_codec, width, height, colorbit, nfps, nSamplePsec, nchannels);
 		if (result == false){
 			Close();
-            m_pLogApi->Debug("Init FFmpegWriter Failed for add_stream, video_codec = %d", m_outfmt->video_codec);
+            m_pLogApi->Debug("Init FFmpegWriter Failed for add_stream, video_codec = %d.", m_outfmt->video_codec);
 			return result;
 		}		
         m_bhave_video = true;
@@ -678,7 +678,7 @@ bool FFmpegWriter::InitWriter(char* filename, int width, int height, int colorbi
         result = add_stream(m_pLogApi, m_audio_st, m_formatctx, &m_audio_codec, m_outfmt->audio_codec, width, height, colorbit, nfps, nSamplePsec, nchannels);
 		if (result == false){
 			Close();
-            m_pLogApi->Debug("Init FFmpegWriter Failed for add_stream, audio_codec = %d", m_outfmt->audio_codec);
+            m_pLogApi->Debug("Init FFmpegWriter Failed for add_stream, audio_codec = %d.", m_outfmt->audio_codec);
 			return result;
 		}	
 		m_bhave_audio = true;
@@ -690,7 +690,7 @@ bool FFmpegWriter::InitWriter(char* filename, int width, int height, int colorbi
         result = open_video(m_pLogApi, m_formatctx, m_video_codec, m_video_st, opt, m_input_pix_fmt);
 		if (result == false){
 			Close();
-            m_pLogApi->Debug("Init FFmpegWriter Failed for open_video, video_codec = %d", m_outfmt->video_codec);
+            m_pLogApi->Debug("Init FFmpegWriter Failed for open_video, video_codec = %d.", m_outfmt->video_codec);
 			return result;
 		}	
     }
@@ -699,21 +699,21 @@ bool FFmpegWriter::InitWriter(char* filename, int width, int height, int colorbi
 			result = open_audio(m_pLogApi, m_formatctx, m_audio_codec, m_audio_st, opt, AV_SAMPLE_FMT_U8);
 			if (result == false){
 				Close();
-                m_pLogApi->Debug("Init FFmpegWriter Failed for open_audio, AV_SAMPLE_FMT_U8");
+                m_pLogApi->Debug("Init FFmpegWriter Failed for open_audio, AV_SAMPLE_FMT_U8.");
 				return result;
 			}				
 		}else if (nBitPerSample == 16){
 			result = open_audio(m_pLogApi, m_formatctx, m_audio_codec, m_audio_st, opt, AV_SAMPLE_FMT_S16);
 			if (result == false){
 				Close();
-                m_pLogApi->Debug("Init FFmpegWriter Failed for open_audio, AV_SAMPLE_FMT_S16");
+                m_pLogApi->Debug("Init FFmpegWriter Failed for open_audio, AV_SAMPLE_FMT_S16.");
 				return result;
 			}				
 		}else if (nBitPerSample == 32) {
             result = open_audio(m_pLogApi, m_formatctx, m_audio_codec, m_audio_st, opt, AV_SAMPLE_FMT_FLT);
             if (result == false) {
                 Close();
-                m_pLogApi->Debug("Init FFmpegWriter Failed for open_audio, AV_SAMPLE_FMT_FLT");
+                m_pLogApi->Debug("Init FFmpegWriter Failed for open_audio, AV_SAMPLE_FMT_FLT.");
                 return result;
             }
         }
@@ -726,13 +726,13 @@ bool FFmpegWriter::InitWriter(char* filename, int width, int height, int colorbi
         iret = avio_open(&m_formatctx->pb, filename, AVIO_FLAG_WRITE);
         if (iret < 0) {
 			Close();
-            m_pLogApi->Debug("Init FFmpegWriter Failed for avio_open, %s", filename);
+            m_pLogApi->Debug("Init FFmpegWriter Failed for avio_open, %s.", filename);
             return false;
         }
     }
 
     m_audio_input_buffer = new ByteBuffer(3*nBitPerSample/8 * nchannels* nSamplePsec);
-    m_pLogApi->Debug("Init FFmpegWriter success, audio_input_buffer:%d", 3 * nBitPerSample / 8 * nchannels * nSamplePsec);
+    m_pLogApi->Debug("Init FFmpegWriter success, audio_input_buffer:%d.", 3 * nBitPerSample / 8 * nchannels * nSamplePsec);
 
     m_bstart = false;
 
@@ -747,11 +747,11 @@ bool FFmpegWriter::StartWrite()
     /* Write the stream header, if any. */ 
     int ret = avformat_write_header(m_formatctx, &opt);
     if (ret < 0) {
-        m_pLogApi->Debug("StartWrite Failed when opening output file: %d", ret);
+        m_pLogApi->Debug("StartWrite Failed when opening output file: %d.", ret);
         return false;
     }
 
-    m_pLogApi->Debug("FFmpegWriter StartWrite success");
+    m_pLogApi->Debug("FFmpegWriter StartWrite success.");
 
     m_bstart = true;
 
@@ -765,7 +765,7 @@ bool FFmpegWriter::StopWrite() {
      * av_write_trailer() may try to use memory that was freed on
      * av_codec_close(). */
 	if (m_formatctx == NULL){
-        m_pLogApi->Debug("End Failed when oc is null");
+        m_pLogApi->Debug("End Failed when oc is null.");
 		return false;
 	}
 	
@@ -779,7 +779,7 @@ bool FFmpegWriter::StopWrite() {
 
     m_bstart = false;
 
-    m_pLogApi->Debug("FFmpegWriter End success");
+    m_pLogApi->Debug("FFmpegWriter End success.");
 
 	return true;
 }
@@ -820,13 +820,13 @@ void FFmpegWriter::Close()
         m_audio_input_buffer = NULL;
     }
 
-    m_pLogApi->Debug("FFmpegWriter Close success");
+    m_pLogApi->Debug("FFmpegWriter Close success.");
 }
 
 bool FFmpegWriter::ReceiveAudioData(unsigned char* pData, unsigned long len) 
 {
 	if (m_formatctx == NULL || m_audio_st == NULL || !m_bhave_audio){
-        m_pLogApi->Debug("ReceiveAudioData Failed when oc is null");
+        m_pLogApi->Debug("ReceiveAudioData Failed when oc is null.");
 		return false;
 	}
     //插入audio_input_buffer
@@ -836,13 +836,13 @@ bool FFmpegWriter::ReceiveAudioData(unsigned char* pData, unsigned long len)
     int frame_size = av_samples_get_buffer_size(NULL, frame->channels,
         frame->nb_samples,
         (AVSampleFormat)frame->format, 0);
-    //m_pLogApi->Debug("ReceiveAudioData len:%d, available_data_len:%d, frame_size:%d", len, audio_input_buffer->bytesRemaining(), frame_size);
+    //m_pLogApi->Debug("ReceiveAudioData len:%d, available_data_len:%d, frame_size:%d.", len, audio_input_buffer->bytesRemaining(), frame_size);
     //循环写帧
     while (frame_size <= m_audio_input_buffer->bytesRemaining()) {
-        //m_pLogApi->Debug("ReceiveAudioData available_data_len:%d", audio_input_buffer->bytesRemaining());
+        //m_pLogApi->Debug("ReceiveAudioData available_data_len:%d.", audio_input_buffer->bytesRemaining());
         int result = write_audio_frame(m_pLogApi, m_formatctx, m_audio_st, m_audio_input_buffer);
         if (result < 0) {
-            m_pLogApi->Debug("write_audio_frame Failed, %d", result);
+            m_pLogApi->Debug("write_audio_frame Failed, %d.", result);
             return false;
         }
     }
@@ -861,14 +861,14 @@ bool FFmpegWriter::ReceiveAudioData(unsigned char* pData, unsigned long len)
 bool FFmpegWriter::ReceiveVideoData(unsigned char* pData, unsigned long len) 
 {
 	if (m_formatctx == NULL || m_video_st == NULL || !m_bhave_video){
-        m_pLogApi->Debug("ReceiveVideoData Failed when oc is null");
+        m_pLogApi->Debug("ReceiveVideoData Failed when oc is null.");
 		return false;
 	}
 
     //m_pLogApi->Debug("ReceiveVideoData len:%d", len);
     int result = write_video_frame(m_pLogApi, m_formatctx, m_video_st, (char*)pData, len, m_input_pix_fmt);
 	if (result < 0){
-        m_pLogApi->Debug("write_video_frame Failed, %d", result);
+        m_pLogApi->Debug("write_video_frame Failed, %d.", result);
 		return false;
 	}
 	return true;

+ 3 - 2
Other/libvideorecord/libvideorecord.h

@@ -45,10 +45,11 @@ enum eStereoArrayType{
 };
 
 enum record_loglevel {
-	RECORD_LOG_NO,
 	RECORD_LOG_DEBUG,
 	RECORD_LOG_INFO,
-	RECORD_LOG_ERROR
+	RECORD_LOG_WARN,
+	RECORD_LOG_ERROR,
+	RECORD_LOG_FATAL
 };
 
 enum eAudioOutPutType{

+ 40 - 25
Other/libvideorecord/libvideorecord_impl.cpp

@@ -803,7 +803,7 @@ bool libvideorecord_impl::GetRecordVideoFrameSize()
 {
 	bool bRet = false;
 
-	m_pHostApi->Debug(RECORD_LOG_DEBUG, "Get Video FrameSize,record type is %s.", record_type_table[m_eRecordType]);
+	m_pHostApi->Debug(RECORD_LOG_DEBUG, "get video framesize, and record type is %s.", record_type_table[m_eRecordType]);
 	for (int i = 0; i < RECORD_FAILED_MAX_TIMES; i++) {
 		m_iVideoFrameSize = GetDestTypeVideoFrameSize(m_iWidth, m_iHeight, m_eRecordType);
 		if (m_iVideoFrameSize <= 0) {
@@ -818,15 +818,17 @@ bool libvideorecord_impl::GetRecordVideoFrameSize()
 			}
 		}
 		else {
-			m_pHostApi->Debug(RECORD_LOG_INFO, "get video framesize success, and failed times is %d.", i);
+			if (i > 0) {
+				m_pHostApi->Debug(RECORD_LOG_INFO, "get video framesize success, and failed times is %d.", i);
+			}
 			bRet = true;
 			break;
 		}
 	}
 
-	if (bRet) {
-		m_pHostApi->Debug(RECORD_LOG_DEBUG, "get video framesize is %d, and width is %d, height is %d.", m_iVideoFrameSize, m_iWidth, m_iHeight);
-	}
+	//if (bRet) {
+	//	m_pHostApi->Debug(RECORD_LOG_DEBUG, "get video framesize is %d, and width is %d, height is %d.", m_iVideoFrameSize, m_iWidth, m_iHeight);
+	//}
 		
 	return bRet;
 }
@@ -850,15 +852,17 @@ bool libvideorecord_impl::GetRecordAudioFrameSize()
 			}
 		}
 		else {
-			m_pHostApi->Debug(RECORD_LOG_INFO, "get audio frame size success, and failed time is %d.", i);
+			if (i > 0) {
+				m_pHostApi->Debug(RECORD_LOG_INFO, "get audio framesize success, and failed times is %d.", i);
+			}
 			bRet = true;
 			break;
 		}
 	}
 
-	if (bRet) {
-		m_pHostApi->Debug(RECORD_LOG_DEBUG, "local audio frame size = %d.", m_iAudioFrameSize);
-	}
+	//if (bRet) {
+	//	m_pHostApi->Debug(RECORD_LOG_DEBUG, "local audio frame size = %d.", m_iAudioFrameSize);
+	//}
 
 	return bRet;
 }
@@ -889,9 +893,9 @@ bool libvideorecord_impl::GetRecordAudioParams(audio_frame** paudio)
 
 	RECORD_SAFE_DELETE((*paudio)->data);
 
-	if (bRet) {
-		m_pHostApi->Debug(RECORD_LOG_DEBUG, "audio samplespersec=%d,framesize=%d,channels=%d,format=%d,bitspersample=%d,series number=%d.", (*paudio)->samplespersec, (*paudio)->framesize, (*paudio)->nchannels, (*paudio)->format, (*paudio)->bitspersample, (*paudio)->iseriesnumber);
-	}
+	//if (bRet) {
+	//	m_pHostApi->Debug(RECORD_LOG_DEBUG, "audio samplespersec=%d,framesize=%d,channels=%d,format=%d,bitspersample=%d,series number=%d.", (*paudio)->samplespersec, (*paudio)->framesize, (*paudio)->nchannels, (*paudio)->format, (*paudio)->bitspersample, (*paudio)->iseriesnumber);
+	//}
 
 	return bRet;
 }
@@ -919,13 +923,12 @@ bool libvideorecord_impl::CalcuRecordAudioParams(audio_frame* paudio)
 	//计算每秒音频的长度
 	m_iAudioPerSecBufLen = paudio->samplespersec * paudio->bitspersample / 8;
 	m_iRecordAudioBufSize = m_iAudioPerSecBufLen;
-	m_pHostApi->Debug(RECORD_LOG_DEBUG, "m_iAudioPerSecBufLen=%d", m_iAudioPerSecBufLen);
+	//m_pHostApi->Debug(RECORD_LOG_DEBUG, "m_iAudioPerSecBufLen=%d", m_iAudioPerSecBufLen);
 	//计算音频帧的帧频,
 	m_iLocalAudioFps = m_iAudioPerSecBufLen / paudio->framesize;
-	m_pHostApi->Debug(RECORD_LOG_DEBUG, "音频帧的帧频 m_iLocalAudioFps=%d", m_iLocalAudioFps);
+	//m_pHostApi->Debug(RECORD_LOG_DEBUG, "音频帧的帧频 m_iLocalAudioFps=%d", m_iLocalAudioFps);
 	if (eSingleSide != m_eRecordType) {
 		if (eStand2Agent == m_eRecordType) {  //可视柜台渠道的双向录像,本地端和坐席端声音采用左右声道方式录制
-		
 			m_iRemoteAudioFps = 50;
 			m_iRecordAudioBufSize = m_iAudioPerSecBufLen * 2;
 		}
@@ -940,7 +943,7 @@ bool libvideorecord_impl::CalcuRecordAudioParams(audio_frame* paudio)
 		}
 	}
 
-	m_pHostApi->Debug(RECORD_LOG_DEBUG, "audio fps = %d, record audio buffer size = %d.", m_iLocalAudioFps, m_iRecordAudioBufSize);
+	//m_pHostApi->Debug(RECORD_LOG_DEBUG, "audio fps = %d, record audio buffer size = %d.", m_iLocalAudioFps, m_iRecordAudioBufSize);
 
 	bRet = true;
 
@@ -1365,7 +1368,6 @@ bool libvideorecord_impl::InitCvxText()
 
 	string fontfile = "";
 
-	m_pHostApi->Debug(RECORD_LOG_DEBUG, "FindMatchedFile");
 #ifdef _WIN32
 	if (FindMatchedFile(TtcDir.c_str(), "msyh.", fontfile))
 #else
@@ -2110,9 +2112,9 @@ bool libvideorecord_impl::GetLocalAudioFrame(int iAudioLens)
 		if (CAPTURE_CLOCK == m_audioframe->samplespersec) {
 			m_iAudioBufferLen += m_audioframe->framesize;
 			m_iAudioFromQueNum++;
-			if ((0 == m_iAudioFromQueNum % 100) && 0 != m_audioframe->iseriesnumber) {
-				m_pHostApi->Debug(RECORD_LOG_DEBUG, "current audio queue len is %d and audio series number is: %d.", iAudioLens, m_audioframe->iseriesnumber);
-			}
+			//if ((0 == m_iAudioFromQueNum % 100) && 0 != m_audioframe->iseriesnumber) {
+			//	m_pHostApi->Debug(RECORD_LOG_DEBUG, "current audio queue len is %d and audio series number is: %d.", iAudioLens, m_audioframe->iseriesnumber);
+			//}
 			bRet = true;
 		}
 		else {
@@ -2206,6 +2208,9 @@ bool libvideorecord_impl::GetRecordAudioFrame()
 	if (eSingleSide == m_eRecordType) {
 		if (false == m_bMuteAudio) {
 			bRet = GetSingleSideAudioFrame();
+			if (!bRet) {
+				bRet = AddMuteAudioFrame(true, m_iAudioPerSecBufLen / 50);
+			}
 		}
 		else {
 			bRet = AddMuteAudioFrame(true, m_iAudioPerSecBufLen / 50);
@@ -2244,7 +2249,6 @@ bool libvideorecord_impl::GetRecordAudioFrame()
 			m_iAudioBufferLen = uOutlen;
 		}
 	}
-	m_pHostApi->Debug(RECORD_LOG_DEBUG, "current m_iAudioBufferLen = %d, m_iAudioPerSecBufLen = %d.", m_iAudioBufferLen, m_iAudioPerSecBufLen);
 
 	return bRet;
 }
@@ -2296,10 +2300,21 @@ bool libvideorecord_impl::InitVideoRecordParams()
 	else {
 		//获取音频帧大小
 		if (!GetRecordAudioFrameSize()) {
-			if (false == m_bStopRecord) {
-				LogFailedEvent(eLocalAudioGetFailed, "Get Audio Frame Failed Max Times.", true);
+			if (eSingleSide == m_eRecordType) {
+				if (false == m_bStopRecord) {
+					m_bMuteAudio = true;
+					m_iAudioFrameSize = 320;
+				}
+				else {
+					return bRet;
+				}
+			}
+			else {
+				if (false == m_bStopRecord) {
+					LogFailedEvent(eLocalAudioGetFailed, "Get Audio Frame Failed Max Times.", true);
+				}
+				return bRet;
 			}
-			return bRet;
 		}
 	}
 
@@ -2331,7 +2346,7 @@ bool libvideorecord_impl::InitVideoRecordParams()
 			m_pHostApi->Debug(RECORD_LOG_INFO, "Ns audio set params failed, set AudioNsOn false.");
 		}
 	}
-	m_pHostApi->Debug(RECORD_LOG_DEBUG, "InitRecordWriter samplespersec=%d,audioOutChannels=%d,audioOutBitRate=%d bps.", audio->samplespersec, m_iAudioChannels, uOutPutBitRate);
+	//m_pHostApi->Debug(RECORD_LOG_DEBUG, "InitRecordWriter samplespersec=%d,audioOutChannels=%d,audioOutBitRate=%d bps.", audio->samplespersec, m_iAudioChannels, uOutPutBitRate);
 
 	if (!InitRecordWriter(m_VideoFileName, m_iWidth, m_iHeight, 24, m_nFps, audio->samplespersec,
 		m_iAudioChannels, audio->bitspersample, 6, m_videoquality, uOutPutBitRate, (int)m_eAudioType)) {

+ 0 - 3
Other/unix/libvideocapture/linux/videocapture_linux.cpp

@@ -933,7 +933,6 @@ int VideoCaptureImpl::StopVideoCapture()
 
 		if (0 == pthread_join(m_CaptureThreadId, NULL))		{
 			m_CaptureThreadId = 0;
-			CapLog("thread join video capture thread success.");
 		}
 		else {
 			CapLog("thread join video capture thread failed for %s.", strerror(errno));
@@ -943,8 +942,6 @@ int VideoCaptureImpl::StopVideoCapture()
 		FreeAlignedMallocVideoBuffer();
 		close(m_deviceFd);
 		m_deviceFd = -1;
-
-		CapLog("video capture has stopped!");
 	}
 
 	return 0;

+ 0 - 101
addin/res/ManagerDesktop/audioErr.html

@@ -40,7 +40,6 @@
 				<img width="100%" src="./images/logo_cmb.png" />
 			</div>
 			<ul id="navBtns">
-				<li class="fz_20" id="downLoadConfig" onclick="downLoadv3('auto')">	下载集中配置 </li>
 				<li class="fz_20" id="resetPsd" onclick="resetRSA()">	重置密钥 </li>
 				<li class="fz_20" onclick="RebootShell()">	重启应用 </li>
 				<li class="fz_20" onclick="RebootComputer()">	重启计算机 </li>
@@ -143,106 +142,6 @@
 		</div>
 		<!-- 退出提示框 -->
 
-		<!-- 下载集中配置 Start -->
-		<div class="toast_box" id="ManuallyDownload">
-			<div class="modal_warpper">
-				<div class="box_wrapper" style="margin-top: 50px;">
-					<div class="modal_title">手动下载</div>
-					<div class="input_wrapper">
-						<input name="centerConfigUrl" placeholder="请输入集中配置下载地址" class="inputURL" oninput="changeInput(this)"/>
-					</div>
-					<div id="ManuallyDownloadError" class="input_error">集中配置下载失败</div>
-				</div>
-				<div class="btn_wrapper">
-					<div class="btn_cancel"  onclick="exit()">返回</div>
-					<button class="btn_confirm" onclick="downLoadv3('manual')" disabled="true" id="btn-downLoad">下载</button>
-				</div>
-			</div>
-		</div>
-
-		<div class="toast_box" id="toastErrorBox">
-			<div class="toast_wrapper">
-				<div class="box_wrapper">
-					<img src="./images/warningCircle.png" class="wran_icon"/>
-					<p id="toastErrTips">下载集中配置成功</p>
-				</div>
-			</div>
-		</div>
-
-		<div class="toast_box" id="modalErrorBox">
-			<div class="modal_warpper">
-				<div class="box_wrapper" style="margin-top: 50px;">
-					<div class="modal_title">下载集中配置</div>
-					<div id="modalErrTips">目标地址异常,请联系总行信息技术部处理,是否进行手动下载?</div>
-				</div>
-				<div class="btn_wrapper">
-					<div class="btn_cancel" onclick="closeModal('toast')">返回</div>
-					<div class="btn_confirm" onclick="showManuallyDownloadModal()">确认</div>
-				</div>
-			</div>
-		</div>
-
-		<div class="toast_box" id="boxRestart">
-			<div class="modal_warpper">
-				<div class="box_wrapper" style="margin-top: 20px;">
-					<div class="modal_title">重启应用</div>
-					<div class="restart_span">
-						集中配置已完成下载,重启后生效
-					</div>
-				</div>
-				<div class="rows_restart">
-					<span>
-						<span id="restart-time">29</span>
-						<span>秒后自动重启</span>
-					</span>
-					<button class="btn_confirm" onclick="restart()">重启应用</button>
-				</div>
-			</div>
-		</div>
-
-		<div id='loading_mask'>
-			<div class='loading_wrapper'>
-				<!-- loading 菊花旋转-->
-				<div class='loading_icon_wrapper'>
-					<div class='loading_icon'>
-						<div class="load-line rotate-0">
-							<span class="left"></span>
-							<span class="right"></span>
-						</div>
-						<div class="load-line rotate-30">
-							<span class="left"></span>
-							<span class="right"></span>
-						</div>
-						<div class="load-line rotate-60">
-							<span class="left"></span>
-							<span class="right"></span>
-						</div>
-						<div class="load-line rotate-90">
-							<span class="left"></span>
-							<span class="right"></span>
-						</div>
-						<div class="load-line rotate-120">
-							<span class="left"></span>
-							<span class="right"></span>
-						</div>
-						<div class="load-line rotate-150">
-							<span class="left"></span>
-							<span class="right"></span>
-						</div>
-						<div id="circle-center"></div>
-					</div>
-				</div>
-				<!-- loading 菊花旋转-->
-				<div class='loading_title'>
-					<span>正在下载中</span>
-					<span class="loading_point"></span>
-					<span class="loading_point"></span>
-					<span class="loading_point"></span>
-				</div>
-			</div>
-		</div>
-		<!-- 下载集中配置 End-->
-
 		<!-- loading -->
 		<div id='loadContent'>
 			<div class="back_cover" ></div>

+ 7 - 7
addin/res/ManagerDesktop/css/errType.css

@@ -382,29 +382,29 @@ nav ul li::before{
 	margin-right: 5px;
 	content: '';
 }
-nav ul li:nth-child(1)::before{
+/* nav ul li:nth-child(1)::before{
 	background: url('../images/config.png');
 	background-size: cover;
-}
+} */
 
-nav ul li:nth-child(2)::before{
+nav ul li:nth-child(1)::before{
 	background: url('../images/reset.png');
 	background-size: cover;
 }
 
-nav ul li:nth-child(3)::before{
+nav ul li:nth-child(2)::before{
 	background: url('../images/restart_a.png');
 	background-size: cover;
 }
-nav ul li:nth-child(4)::before{
+nav ul li:nth-child(3)::before{
 	background: url('../images/restart_c.png');
 	background-size: cover;
 }
-nav ul li:nth-child(5)::before{
+nav ul li:nth-child(4)::before{
 	background: url('../images/off.png');
 	background-size: cover;
 }
-nav ul li:nth-child(6)::before{
+nav ul li:nth-child(5)::before{
 	background: url('../images/min.png');
 	background-size: cover;
 }

+ 0 - 101
addin/res/ManagerDesktop/entityCheck.html

@@ -40,7 +40,6 @@
 				<img width="100%" src="./images/logo_cmb.png" />
 			</div>
 			<ul id="navBtns">
-				<li class="fz_20" id="downLoadConfig" onclick="downLoadv3('auto')">	下载集中配置 </li>
 				<li class="fz_20" id="resetPsd" onclick="resetRSA()">	重置密钥 </li>
 				<li class="fz_20" onclick="RebootShell()">	重启应用 </li>
 				<li class="fz_20" onclick="RebootComputer()">	重启计算机 </li>
@@ -161,106 +160,6 @@
 		</div>
 		<!-- 退出提示框 -->
 
-		<!-- 下载集中配置 Start -->
-		<div class="toast_box" id="ManuallyDownload">
-			<div class="modal_warpper">
-				<div class="box_wrapper" style="margin-top: 50px;">
-					<div class="modal_title">手动下载</div>
-					<div class="input_wrapper">
-						<input name="centerConfigUrl" placeholder="请输入集中配置下载地址" class="inputURL" oninput="changeInput(this)"/>
-					</div>
-					<div id="ManuallyDownloadError" class="input_error">集中配置下载失败</div>
-				</div>
-				<div class="btn_wrapper">
-					<div class="btn_cancel"  onclick="exit()">返回</div>
-					<button class="btn_confirm" onclick="downLoadv3('manual')" disabled="true" id="btn-downLoad">下载</button>
-				</div>
-			</div>
-		</div>
-
-		<div class="toast_box" id="toastErrorBox">
-			<div class="toast_wrapper">
-				<div class="box_wrapper">
-					<img src="./images/warningCircle.png" class="wran_icon"/>
-					<p id="toastErrTips">下载集中配置成功</p>
-				</div>
-			</div>
-		</div>
-
-		<div class="toast_box" id="modalErrorBox">
-			<div class="modal_warpper">
-				<div class="box_wrapper" style="margin-top: 50px;">
-					<div class="modal_title">下载集中配置</div>
-					<div id="modalErrTips">目标地址异常,请联系总行信息技术部处理,是否进行手动下载?</div>
-				</div>
-				<div class="btn_wrapper">
-					<div class="btn_cancel" onclick="closeModal('toast')">返回</div>
-					<div class="btn_confirm" onclick="showManuallyDownloadModal()">确认</div>
-				</div>
-			</div>
-		</div>
-
-		<div class="toast_box" id="boxRestart">
-			<div class="modal_warpper">
-				<div class="box_wrapper" style="margin-top: 20px;">
-					<div class="modal_title">重启应用</div>
-					<div class="restart_span">
-						集中配置已完成下载,重启后生效
-					</div>
-				</div>
-				<div class="rows_restart">
-					<span>
-						<span id="restart-time">29</span>
-						<span>秒后自动重启</span>
-					</span>
-					<button class="btn_confirm" onclick="restart()">重启应用</button>
-				</div>
-			</div>
-		</div>
-
-		<div id='loading_mask'>
-			<div class='loading_wrapper'>
-				<!-- loading 菊花旋转-->
-				<div class='loading_icon_wrapper'>
-					<div class='loading_icon'>
-						<div class="load-line rotate-0">
-							<span class="left"></span>
-							<span class="right"></span>
-						</div>
-						<div class="load-line rotate-30">
-							<span class="left"></span>
-							<span class="right"></span>
-						</div>
-						<div class="load-line rotate-60">
-							<span class="left"></span>
-							<span class="right"></span>
-						</div>
-						<div class="load-line rotate-90">
-							<span class="left"></span>
-							<span class="right"></span>
-						</div>
-						<div class="load-line rotate-120">
-							<span class="left"></span>
-							<span class="right"></span>
-						</div>
-						<div class="load-line rotate-150">
-							<span class="left"></span>
-							<span class="right"></span>
-						</div>
-						<div id="circle-center"></div>
-					</div>
-				</div>
-				<!-- loading 菊花旋转-->
-				<div class='loading_title'>
-					<span>正在下载中</span>
-					<span class="loading_point"></span>
-					<span class="loading_point"></span>
-					<span class="loading_point"></span>
-				</div>
-			</div>
-		</div>
-		<!-- 下载集中配置 End-->
-
 		<!-- loading -->
 		<div id='loadContent'>
 			<div class="back_cover" ></div>

+ 0 - 101
addin/res/ManagerDesktop/homePageErr.html

@@ -40,7 +40,6 @@
 				<img width="100%" src="./images/logo_cmb.png" />
 			</div>
 			<ul id="navBtns">
-				<li class="fz_20" id="downLoadConfig" onclick="downLoadv3('auto')">	下载集中配置 </li>
 				<li class="fz_20" id="resetPsd" onclick="resetRSA()">	重置密钥 </li>
 				<li class="fz_20" onclick="RebootShell()">	重启应用 </li>
 				<li class="fz_20" onclick="RebootComputer()">	重启计算机 </li>
@@ -160,106 +159,6 @@
 		</div>
 		<!-- 退出提示框 -->
 
-		<!-- 下载集中配置 Start -->
-		<div class="toast_box" id="ManuallyDownload">
-			<div class="modal_warpper">
-				<div class="box_wrapper" style="margin-top: 50px;">
-					<div class="modal_title">手动下载</div>
-					<div class="input_wrapper">
-						<input name="centerConfigUrl" placeholder="请输入集中配置下载地址" class="inputURL" oninput="changeInput(this)"/>
-					</div>
-					<div id="ManuallyDownloadError" class="input_error">集中配置下载失败</div>
-				</div>
-				<div class="btn_wrapper">
-					<div class="btn_cancel"  onclick="exit()">返回</div>
-					<button class="btn_confirm" onclick="downLoadv3('manual')" disabled="true" id="btn-downLoad">下载</button>
-				</div>
-			</div>
-		</div>
-
-		<div class="toast_box" id="toastErrorBox">
-			<div class="toast_wrapper">
-				<div class="box_wrapper">
-					<img src="./images/warningCircle.png" class="wran_icon"/>
-					<p id="toastErrTips">下载集中配置成功</p>
-				</div>
-			</div>
-		</div>
-
-		<div class="toast_box" id="modalErrorBox">
-			<div class="modal_warpper">
-				<div class="box_wrapper" style="margin-top: 50px;">
-					<div class="modal_title">下载集中配置</div>
-					<div id="modalErrTips">目标地址异常,请联系总行信息技术部处理,是否进行手动下载?</div>
-				</div>
-				<div class="btn_wrapper">
-					<div class="btn_cancel" onclick="closeModal('toast')">返回</div>
-					<div class="btn_confirm" onclick="showManuallyDownloadModal()">确认</div>
-				</div>
-			</div>
-		</div>
-
-		<div class="toast_box" id="boxRestart">
-			<div class="modal_warpper">
-				<div class="box_wrapper" style="margin-top: 20px;">
-					<div class="modal_title">重启应用</div>
-					<div class="restart_span">
-						集中配置已完成下载,重启后生效
-					</div>
-				</div>
-				<div class="rows_restart">
-					<span>
-						<span id="restart-time">29</span>
-						<span>秒后自动重启</span>
-					</span>
-					<button class="btn_confirm" onclick="restart()">重启应用</button>
-				</div>
-			</div>
-		</div>
-
-		<div id='loading_mask'>
-			<div class='loading_wrapper'>
-				<!-- loading 菊花旋转-->
-				<div class='loading_icon_wrapper'>
-					<div class='loading_icon'>
-						<div class="load-line rotate-0">
-							<span class="left"></span>
-							<span class="right"></span>
-						</div>
-						<div class="load-line rotate-30">
-							<span class="left"></span>
-							<span class="right"></span>
-						</div>
-						<div class="load-line rotate-60">
-							<span class="left"></span>
-							<span class="right"></span>
-						</div>
-						<div class="load-line rotate-90">
-							<span class="left"></span>
-							<span class="right"></span>
-						</div>
-						<div class="load-line rotate-120">
-							<span class="left"></span>
-							<span class="right"></span>
-						</div>
-						<div class="load-line rotate-150">
-							<span class="left"></span>
-							<span class="right"></span>
-						</div>
-						<div id="circle-center"></div>
-					</div>
-				</div>
-				<!-- loading 菊花旋转-->
-				<div class='loading_title'>
-					<span>正在下载中</span>
-					<span class="loading_point"></span>
-					<span class="loading_point"></span>
-					<span class="loading_point"></span>
-				</div>
-			</div>
-		</div>
-		<!-- 下载集中配置 End-->
-
 		<!-- loading -->
 		<div id='loadContent'>
 			<div class="back_cover" ></div>

+ 6 - 40
addin/res/ManagerDesktop/js/getTerminalInfo.js

@@ -34,7 +34,6 @@ window.onload=function(){
 	}
 
   HealthManagerService.init();
-  CenterSettingService.init();
 	ResourceWatcherService.init();
   getHardwareInfo()
   // getAccessUrl()
@@ -125,32 +124,6 @@ function hardwareConfig(module){ //todo
 }
 
 
-/**
- * @description: 查询初始化地址
- * @param {} 
- * @return: HostUrl
- */
-let HostUrl = ''
-function getAccessUrl(){
-	let req = new Request()
-	let timeoutFn= setTimeout(function(){
-		let tips = 'GetAccessUrl 请求超时'
-		ModalPrompt(tips, 'pathN')
-	},60000)
-		
-	CenterSettingService.GetAccessUrl(req, function(ret) {
-		logEvent("GetAccessUrl ret: "+JSON.stringify(ret));
-		console.log("GetAccessUrl ret: "+JSON.stringify(ret));
-		if(ret){
-			clearTimeout(timeoutFn);
-			HostUrl = ret.HostUrl
-			// $('.urlAccessAddr').html(ret.HostUrl)
-		}
-		
-	})
-}
-
-
 /**
  * @description: 查询准入地址
  * @param {reqName:'HostUrl'} 
@@ -158,28 +131,24 @@ function getAccessUrl(){
  */
 function getCertainAceessUrl(){
 	let req = new Request()
-	req.reqName = 'HostUrl'
+	req['{e12a3dc0-3a0b-47c4-a8c3-75190a42ae68}'] ={entity:'AccessAuthorization',key:'HostUrl'}
 	let timeoutFn= setTimeout(function(){
-		let tips = 'GetCertainAceessUrl 请求超时'
+		let tips = 'ReadCenterConfigStr 请求超时'
 		ModalPrompt(tips, 'pathN')
 	},60000)
 		
-	CenterSettingService.GetCertainAceessUrl(req, function(ret) {
-		logEvent("GetCertainAceessUrl ret: "+JSON.stringify(ret));
-		console.log("GetCertainAceessUrl ret: "+JSON.stringify(ret));
+	HealthManagerService.ReadCenterConfigStr(req, function(ret) {
+		logEvent("ReadCenterConfigStr ret: "+JSON.stringify(ret));
+		console.log("ReadCenterConfigStr ret: "+JSON.stringify(ret));
 		if(ret){
 			clearTimeout(timeoutFn);
-			HostUrl = ret.CertainAceessUrl
-			$('.urlAccessAddr').html(ret.CertainAceessUrl) 
+			$('.urlAccessAddr').html(ret.value) 
 		}
-		
 	})
 }
 
 
 
-
-
 /**
  * @description: modal显示设置
  * @param {tips: 提示信息,pathType:pathY|pathN 提示类型,origion:选填 来源 InitializeNew| } 
@@ -215,7 +184,6 @@ function closeModal(type){
 
 			$('#scanIdentity').fadeOut(); //二维码关闭
 			$('#RSAReseting').fadeOut(); //重置密钥中···关闭
-			$('#ManuallyDownload').fadeOut();
 
 			setTimeout(()=>{ //延时显示,避免内容污染
 				$('#entityCheckout').fadeIn('slow')
@@ -223,8 +191,6 @@ function closeModal(type){
 				$('#navBtns').fadeIn('slow')
 			},500)
 		}
-	}else if(type=='toast'){
-		$('#modalErrorBox').fadeOut('slow')
 	} else{
 		$('#modalConfirm').fadeOut('slow')
 	}

+ 2 - 286
addin/res/ManagerDesktop/js/initPsd.js

@@ -9,9 +9,7 @@ window.onload=function(){
 		}
 	}
 	
-	CenterSettingService.init();
 	AccessAuthService.init();
-	HealthManagerService.init();
 
 	WebSocketBase.socket.onerror = function () {
 		logEvent("HealthManagerService startSession callback");
@@ -28,30 +26,11 @@ window.onload=function(){
  * @return: 
  */
 function ModalStyle(tips,pathType){
-	$('#modalBox').fadeIn('slow')
 	$('#loadContent').fadeOut('slow')
-
 	$('#errTips').html(tips);
 	let path = (pathType == 'pathY') ? './images/success.png' :  './images/fail.png'
-	$('#modalBox img').attr('src', path)
-}
-
-function showToast(title){
-	$('#toastErrTips').html(title);
-	$('#loading_mask').hide();
-	$('#toastErrorBox').fadeIn('slow')
-	setTimeout(()=>{
-		$('#toastErrorBox').fadeOut('slow')
-	},2000)
 }
 
-function changeInput(obj){
-	if(obj.value!=''){
-		$('#btn-downLoad').removeAttr('disabled');
-	}else{
-		$('#btn-downLoad').attr('disabled','disabled');
-	}
-}
 
 /**
  * @description: 输入不为null校验
@@ -73,30 +52,6 @@ function RegExpNull(vals){
 	return IsNull;
 }
 
-/**
- * @description: IP地址校验
- * @param {type} 
- * @return: 
- */
-function onblurAddr(IPType){
-	let RegxIP = new RegExp("^((25[0-5]|2[0-4]\\d|[1]{1}\\d{1}\\d{1}|[1-9]{1}\\d{1}|\\d{1})($|(?!\\.$)\\.)){4}$");
-	let tips,IpAddr
-	switch(IPType)
-	{
-		case 'config': 
-			IpAddr = $(".config input[name='configAddr']").val(); 
-			tips = '集中配置地址格式不正确'
-			break;
-		case 'access': 
-			IpAddr = $(".setting input[name='accessAddr']").val();
-			tips = '准入服务地址格式不正确'
-			break;
-	}
-	if(IpAddr=='')return
-	if( !RegxIP.test(IpAddr) ){
-		ModalStyle(tips,'pathN')
-	}
-}
 
 let timeout=60000;
 /**
@@ -129,207 +84,6 @@ function restart(){
 	DeviceService.RebootShell();
 }
 
-function downLoad(){
-	let req = new Request(),reqIn ={};
-	// req.downloadv2 = 1;
-
-	let IsNull = RegExpNull(reqIn)
-	if(IsNull) return false
-	$('#loadContent').fadeIn('slow')
-	// timeoutFn
-	let timeoutFn= setTimeout(function(){
-		$('#loadContent').fadeOut('slow')
-		let tips = '请求超时'
-		showToast(tips);
-	},timeout)
-
-	CenterSettingService.Downloadv2(req, function(ret) {
-		logEvent("Download ret: "+JSON.stringify(ret));
-		console.log("Download ret: "+JSON.stringify(ret));
-		
-		if(ret){
-			clearTimeout(timeoutFn);
-			$('#loadContent').fadeOut('slow')
-			if(ret.downloadStat==2){
-				let tips = ret.strErrMsg
-				ModalStyle(tips,'pathN');
-				return false
-			}
-			let tips = '下载集中配置成功'
-				ModalStyle(tips,'pathY')
-				document.getElementById("urlConfigAddr").innerHTML = ret.CenterConfigUrl;
-		}
-		
-	})
-}
-
-function downLoadv3(value){
-	if(value=='auto'){
-		let req = new Request();
-		$('#loading_mask').fadeIn('slow');
-		let timeoutFn= setTimeout(function(){
-			$('#loading_mask').fadeOut('slow');
-			let tips = '请求超时'
-			showToast(tips);
-		},timeout)
-
-		CenterSettingService.Downloadv3(req, function(ret) {
-			logEvent("Download ret: "+JSON.stringify(ret));
-			console.log("Download ret: "+JSON.stringify(ret));
-			
-			if(ret){
-				clearInterval(timeChange);
-				clearTimeout(timeoutFn);
-				$('#loading_mask').fadeOut('slow');
-				if(ret.downloadStat==1){
-					// document.getElementById("configUrl").innerHTML = ret.retCenterConfigUrl;
-					$('#boxRestart').fadeIn();
-					timeChange = setInterval(clock, 1000);
-				}else if(ret.downloadStat==3 || ret.downloadStat==2){
-					let tips = ret.strErrMsg?ret.strErrMsg:'集中配置下载失败';
-					showToast(tips);
-					return false
-				}else {
-					let msg = ret.strErrMsg?ret.strErrMsg:'集中配置下载失败';
-					let tips = msg + ',请联系总行信息部处理,是否进行手动下载?';
-					$('#modalErrorBox').fadeIn('slow');
-					$('#modalErrTips').html(tips);
-					return false
-				}
-			}
-		})
-	}else{
-		$('#ManuallyDownloadError').html("");
-		$('#ManuallyDownloadError').hide();
-		let req = new Request(),reqIn ={};
-		let data = document.getElementsByTagName('input');
-		reqIn.reqCenterConfigUrl = data['centerConfigUrl'].value;
-		req = Object.assign({},req,reqIn)
-		$('#loading_mask').fadeIn('slow');
-		let timeoutFn= setTimeout(function(){
-			$('#loading_mask').fadeOut('slow');
-			let tips = '请求超时'
-			ModalStyle(tips,'pathN')
-		},timeout)
-
-		CenterSettingService.Downloadv3(req, function(ret) {
-			logEvent("Download ret: "+JSON.stringify(ret));
-			console.log("Download ret: "+JSON.stringify(ret));
-			if(ret){
-				clearInterval(timeChange);
-				clearTimeout(timeoutFn);
-				$('#loading_mask').fadeOut('slow');
-				if(ret.downloadStat==1){
-					exit();
-					// document.getElementById("configUrl").innerHTML = ret.retCenterConfigUrl;
-					$('#boxRestart').fadeIn();
-					timeChange = setInterval(clock, 1000);
-				}else if(ret.downloadStat==3){
-					exit();
-					let tips = ret.strErrMsg?ret.strErrMsg:'集中配置是最新版本';
-					showToast(tips);
-					return false
-				}else {
-					let msg = ret.strErrMsg?ret.strErrMsg:'集中配置下载失败';
-					$('#ManuallyDownloadError').html(msg);
-					$('#ManuallyDownloadError').show();
-					return false
-				}
-			}
-		})
-	}
-	
-}
-
-
-let HostUrl = "" //准入服务地址
-function getAccessUrl(){
-	let req = new Request()
-	let timeoutFn= setTimeout(function(){
-		$('#loadContent').fadeOut('slow');
-		let tips = '请求超时'
-		showToast(tips);
-	},5000)
-		
-	CenterSettingService.GetAccessUrl(req, function(ret) {
-		logEvent("GetAccessUrl ret: "+JSON.stringify(ret));
-		console.log("GetAccessUrl ret: "+JSON.stringify(ret));
-		if(ret){
-			clearTimeout(timeoutFn);
-			$('#loadContent').fadeOut('slow')
-			
-			// let tips = '获取准入服务地址成功'
-			// ModalStyle(tips,'pathY')
-			HostUrl = ret.HostUrl
-			document.getElementById("urlAccessAddr").innerHTML= ret.HostUrl;
-		}
-		
-	})
-}
-
-/**
- * @description: 读取集中配置文件,注入密钥初始化url,port
- * @param {type} 
- * @return: 
- */
-function ReadCenterConfig(readType,readConfig){
-	$('#loadContent').fadeIn('slow');
-	let timeoutFn= setTimeout(function(){
-		$('#loadContent').fadeOut('slow')
-		let tips = '请求超时'
-		ModalStyle(tips,'pathN')
-		console.log('timeoutFn--ReadCenterConfig-setTimeout222->')
-	},timeout)
-
-	let req = new Request(),reqIn ={};
-	if(readType==='access'){
-		req.entityName = 'AccessAuthorization' 
-		req.key = 'Server' 
-	}else{
-		req.entityName = 'CenterSetting' 
-		req.key = 'Server' 
-	}
-	req.reserved1 = 0
-	req.reserved2 = 0
-	req.reserved3 = ''
-	req.reserved4 = ''
-	req.timeout = 60000
-	logEvent("HealthManagerService->ReadCenterConfigStr");
-	
-	HealthManagerService.ReadCenterConfigStr(req, function(ret) {
-		logEvent("ReadCenterConfigStr ret: "+JSON.stringify(ret));
-		console.log('ReadCenterConfigStr----',ret)
-		if(ret){
-			$('#loadContent').fadeOut('slow');
-			clearTimeout(timeoutFn)
-		}
-
-		if(ret.errorCode ===0){
-			let result = JSON.parse(ret['{e12a3dc0-3a0b-47c4-a8c3-75190a42ae68}'] )
-			let addr = result.value.split(' ')[0]
-			let port = result.value.split(' ')[1]
-
-			if(readType==='access'){
-				$('.setting input[name=accessAddr]').val(addr)
-				$('.setting input[name=accessPort]').val(port)
-			}else{
-				$('.config input[name=configAddr]').val(addr)
-				$('.config input[name=configPoint]').val(port)
-			}
-			
-
-		}else{
-			let tips ='读取集中配置失败'+ret.errorCode.toString(16)
-			if(readConfig==='readConfig'){
-				ModalStyle(tips,'pathN')	
-
-			}
-		}
-		
-	})
-}
-
-
 // 扫码登录后接收code
 window.onmessage = (event) => {
   console.log('event----',event)
@@ -351,20 +105,9 @@ window.onmessage = (event) => {
  * @return: 
  */
 function ResetRSA(code){
-		let data = document.getElementsByTagName('input');
-
     let req = new Request(),reqIn={};
-    reqIn.strAuthServer = HostUrl; 
-    // reqIn.nAuthPort = Number( data['accessPort'].value)   todo
-    reqIn.strUserID =  code //data['account'].value 
-		// let agentId = data['account'].value;
-		// if(Number(reqIn.strUserID) ){
-		// 	if (agentId.trim().length == 8) {
-		// 		reqIn.strUserID = "SP" + agentId.trim();
-		// 	} else {
-		// 		reqIn.strUserID = "ST" + agentId.trim();
-		// 	}
-		// }
+    // reqIn.strAuthServer = HostUrl; 
+    reqIn.strUserID =  code 
 		reqIn.strPassword = '88888888' //默认值,后台不做校验
 
 		req.timeout = 60000
@@ -374,14 +117,7 @@ function ResetRSA(code){
 			ModalStyle(tips,'pathN')
 			return;
 		}
-		// if(reqIn.strPassword==''){
-		// 	let tips = '密码不能为空'
-		// 	ModalStyle(tips,'pathN')
-		// 	return;
-		// }
 
-		let IsNull = RegExpNull(reqIn)
-		if(IsNull) return false
 		$('#loadContent').fadeIn('slow')
 		// timeoutFn
 		let timeoutFn= setTimeout(function(){
@@ -421,33 +157,13 @@ function ResetRSA(code){
 		});
 }
 
-function closeModal(value){
-	if(value=='modal'){
-		$('#modalBox').fadeOut('slow')
-	}else{
-		$('#modalErrorBox').fadeOut('slow')
-	}
-}
-
-function showManuallyDownloadModal(){
-	$('#modalErrorBox').fadeOut('slow');
-	$('#ManuallyDownload').fadeIn('slow');
-}
-
 
 function exit(){
-	// document.getElementById("urlConfigAddr").innerHTML ="";
-	// document.getElementById("urlAccessAddr").innerHTML = "";
-	// document.getElementsByTagName('input')['centerConfigUrl'].value="";
-	$('#ManuallyDownloadError').html("");
-	$('#ManuallyDownloadError').hide();
-	$('#btn-downLoad').attr('disabled','disabled');
 	// 进入的方式,决定退出的方式
 	if(window.location.href.indexOf('errPage')>-1){
 		$('.iframeDiv').fadeOut();
 		$('.iframe-box').fadeOut();
 		$('.result-wrap').fadeOut();
-		$('#ManuallyDownload').fadeOut();
 	}else{
 		let req = {};
 		req.messageType = 0;

+ 3 - 10
addin/res/ManagerDesktop/js/navOprator.js

@@ -88,11 +88,7 @@ function downLoadv3(value){
 			}
 		})
 	}else{
-		$('#ManuallyDownloadError').html("");
-		$('#ManuallyDownloadError').hide();
-		let req = new Request(),reqIn ={};
-		let data = document.getElementsByTagName('input');
-		reqIn.reqCenterConfigUrl = data['centerConfigUrl'].value;
+		let req = new Request(),reqIn ={}
 		req = Object.assign({},req,reqIn)
 		$('#loading_mask').fadeIn('slow');
 		let timeoutFn= setTimeout(function(){
@@ -182,7 +178,7 @@ window.onmessage = (event) => {
 
 function initializeNew(code){
   let req = new Request()
-  req.strAuthServer = HostUrl; 
+  req.strAuthServer = ''; 
   req.strUserID =  code 
   req.strPassword = '88888888' // 默认虚拟值,后台不做校验以及相关处理(仅供终端实体逻辑判断-loginway)
   req.timeout = 60000
@@ -251,12 +247,9 @@ function stopAnimation(){
 
 // 退出
 function exit(){
-	document.getElementsByTagName('input')['centerConfigUrl'].value="";
-	$('#ManuallyDownloadError').html("");
-	$('#ManuallyDownloadError').hide();
 	$('#btn-downLoad').attr('disabled','disabled');
 	// 进入的方式,决定退出的方式
-	if(window.location.href.indexOf('entityCheck')>-1||window.location.href.indexOf('serverNoAccess')>-1||window.location.href.indexOf('audioErr')>-1){
+	if(window.location.href.indexOf('entityCheck')>-1||window.location.href.indexOf('serverNoAccess')>-1||window.location.href.indexOf('audioErr')>-1||window.location.href.indexOf('homePageErr')>-1){
 		$('#scanIdentity').fadeOut(); //二维码关闭
 		$('#RSAReseting').fadeOut(); //重置密钥中···关闭
 		$('#ManuallyDownload').fadeOut();

+ 1 - 102
addin/res/ManagerDesktop/serverNoAccess.html

@@ -52,7 +52,6 @@
 				<img width="100%" src="./images/logo_cmb.png" />
 			</div>
 			<ul id="navBtns">
-				<li class="fz_20" id="downLoadConfig" onclick="downLoadv3('auto')">	下载集中配置 </li>
 				<li class="fz_20" id="resetPsd" onclick="resetRSA()">	重置密钥 </li>
 				<li class="fz_20" onclick="RebootShell()">	重启应用 </li>
 				<li class="fz_20" onclick="RebootComputer()">	重启计算机 </li>
@@ -156,107 +155,7 @@
 			</div>
 		</div>
 		<!-- 退出提示框 -->
-
-		<!-- 下载集中配置 Start -->
-		<div class="toast_box" id="ManuallyDownload">
-			<div class="modal_warpper">
-				<div class="box_wrapper" style="margin-top: 50px;">
-					<div class="modal_title">手动下载</div>
-					<div class="input_wrapper">
-						<input name="centerConfigUrl" placeholder="请输入集中配置下载地址" class="inputURL" oninput="changeInput(this)"/>
-					</div>
-					<div id="ManuallyDownloadError" class="input_error">集中配置下载失败</div>
-				</div>
-				<div class="btn_wrapper">
-					<div class="btn_cancel"  onclick="exit()">返回</div>
-					<button class="btn_confirm" onclick="downLoadv3('manual')" disabled="true" id="btn-downLoad">下载</button>
-				</div>
-			</div>
-		</div>
-
-		<div class="toast_box" id="toastErrorBox">
-			<div class="toast_wrapper">
-				<div class="box_wrapper">
-					<img src="./images/warningCircle.png" class="wran_icon"/>
-					<p id="toastErrTips">下载集中配置成功</p>
-				</div>
-			</div>
-		</div>
-
-		<div class="toast_box" id="modalErrorBox">
-			<div class="modal_warpper">
-				<div class="box_wrapper" style="margin-top: 50px;">
-					<div class="modal_title">下载集中配置</div>
-					<div id="modalErrTips">目标地址异常,请联系总行信息技术部处理,是否进行手动下载?</div>
-				</div>
-				<div class="btn_wrapper">
-					<div class="btn_cancel" onclick="closeModal('toast')">返回</div>
-					<div class="btn_confirm" onclick="showManuallyDownloadModal()">确认</div>
-				</div>
-			</div>
-		</div>
-
-		<div class="toast_box" id="boxRestart">
-			<div class="modal_warpper">
-				<div class="box_wrapper" style="margin-top: 20px;">
-					<div class="modal_title">重启应用</div>
-					<div class="restart_span">
-						集中配置已完成下载,重启后生效
-					</div>
-				</div>
-				<div class="rows_restart">
-					<span>
-						<span id="restart-time">29</span>
-						<span>秒后自动重启</span>
-					</span>
-					<button class="btn_confirm" onclick="restart()">重启应用</button>
-				</div>
-			</div>
-		</div>
-
-		<div id='loading_mask'>
-			<div class='loading_wrapper'>
-				<!-- loading 菊花旋转-->
-				<div class='loading_icon_wrapper'>
-					<div class='loading_icon'>
-						<div class="load-line rotate-0">
-							<span class="left"></span>
-							<span class="right"></span>
-						</div>
-						<div class="load-line rotate-30">
-							<span class="left"></span>
-							<span class="right"></span>
-						</div>
-						<div class="load-line rotate-60">
-							<span class="left"></span>
-							<span class="right"></span>
-						</div>
-						<div class="load-line rotate-90">
-							<span class="left"></span>
-							<span class="right"></span>
-						</div>
-						<div class="load-line rotate-120">
-							<span class="left"></span>
-							<span class="right"></span>
-						</div>
-						<div class="load-line rotate-150">
-							<span class="left"></span>
-							<span class="right"></span>
-						</div>
-						<div id="circle-center"></div>
-					</div>
-				</div>
-				<!-- loading 菊花旋转-->
-				<div class='loading_title'>
-					<span>正在下载中</span>
-					<span class="loading_point"></span>
-					<span class="loading_point"></span>
-					<span class="loading_point"></span>
-				</div>
-			</div>
-		</div>
-		<!-- 下载集中配置 End-->
-
+		
 		<!-- loading -->
 		<div id='loadContent'>
 			<div class="back_cover" ></div>

+ 106 - 0
addin/res/ManagerDesktop/upgradeRestart.html

@@ -0,0 +1,106 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml">
+	<head>
+		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+		<title>错误页-重启应用</title>
+		<meta name="viewport" content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
+		<link rel="stylesheet" type="text/css" href="css/errType.css" />
+		<link rel="stylesheet" type="text/css" href="css/non-ie-style.css" /> 
+		<link rel="stylesheet" type="text/css" href="css/loading.css" />
+
+		<style>
+			.upgrade-restart h3{
+				margin-bottom: 40px;
+			}
+		</style>
+	</head>
+	<body class="errType">
+		<nav>
+			<div class="logo">
+				<img width="100%" src="./images/logo_cmb.png" />
+			</div>
+		</nav>
+		<div class="hareword-info upgrade-restart">
+			<h3 class="fz_44">系统升级中,稍后自动重启应用<dot class="dot">●●●●●●</dot></h3>
+			<!-- <p id="errorInfo">
+				该设备硬件地址信息和后台记录不一致,请联系分行设备管理员扫描下方二维码。
+			</p> -->
+			<div class="result-wrap">
+				<div class="result-item">
+					<label class="fz_28">终端号</label>
+					<span class="fz_28 terminalNo"></span>
+				</div>
+				<div class="result-item">
+					<label class="fz_28">当前时间</label>
+					<span class="fz_28 currDate"></span>
+				</div>
+				<div class="result-item">
+					<label class="fz_28">终端版本</label>
+					<span class="fz_28 termVersion"></span>
+				</div>
+				<div class="result-item">
+					<label class="fz_28">准入地址</label>
+					<span class="fz_28 urlAccessAddr"></span>
+				</div>
+			</div>
+
+			<!-- 二维码授权验证start -->
+			<!-- <div class="scan-verify">
+				<iframe frameborder="no" border="0" allowtransparency="yes" allow="microphone;camera;midi;encrypted-media;"
+				  id="iframeSrc"
+					src="https://one-account-gateway.paasuat.cmbchina.cn/auth-plugin/v2/identity-authentication?clientId=6898ec10629f499187d7b31fbe9823a4&ui=eyJhdXRoVHlwZXMiOlsicXJDb2RlIl0sImhlYWRlciI6dHJ1ZSwicXJDb2RlU2l6ZSI6MTQ1fQ%253D%253D"
+					></iframe>
+				<p>完成扫码授权后</br>请重置密钥</p>
+				<button class="btn-blue" onclick="exit()">重置密钥</button>
+			</div> -->
+			<!-- 二维码授权验证end -->
+		</div>
+
+		<!-- 提示框 -->
+		<div class="modal-box" id="modalBox">
+			<div class="coverBg"></div>
+			<div class="modal" id="modal">
+				<img src="./images/success.png" />
+				<p class="fz_24" id="errTips"></p>
+				<button class="fz_23" onclick="closeModal('modal')">确定</button>
+			</div>
+		</div>
+		<!-- 提示框 -->
+
+		<!-- loading -->
+		<div id='loadContent'>
+			<div class="back_cover" ></div>
+			<div class='loading' id='loading'>
+				<div class='circle circle1'>
+					<span></span>
+					<span></span>
+					<span></span>
+					<span></span>
+				</div>
+				<div class='circle circle2'>
+					<span></span>
+					<span></span>
+					<span></span>
+					<span></span>
+				</div>
+				<div class='circle circle3'>
+					<span></span>
+					<span></span>
+					<span></span>
+					<span></span>
+				</div>
+			</div>
+		</div>
+		<!-- loading -->
+	</body>
+	<script type="text/javascript" src="js/common.js"></script>
+	<script type="text/javascript" src="js/websocket.js"></script>
+	<script type="text/javascript" src="js/webSocketBase.js"></script>
+	<script type="text/javascript" src="js/entityMessage.js"></script>
+	<script type="text/javascript" src="js/eventEmitter.js"></script>
+	<script type="text/javascript" src="js/innerEventEmitter.js"></script>
+	<script type="text/javascript" src="js/errorCodeEnum.js"></script>
+	<script type="text/javascript" src="js/entityService.js"></script>
+	<script type="text/javascript" src="Include/jQuery/js/jquery.min.js" ></script>
+	<script type="text/javascript" src="js/getTerminalInfo.js"></script>
+</html>