Эх сурвалжийг харах

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

chenliangyu 4 сар өмнө
parent
commit
5390ab56ed

+ 34 - 0
DevAdapter/simulator/FingerPrint.1.1/FingerPrint_impl.cpp

@@ -104,6 +104,40 @@ ErrorCodeEnum FingerPrintImpl::Image2Feature(const char* imageName, LPBYTE lpbFe
 			string imgPath = GetCurrentDirectory() + SPLIT_SLASH_STR + imgName;
 			writeFile(imgPath.c_str());
 		}
+		else if (ans.bGenerateFile == 2) {
+#ifdef _MSC_VER
+			char exePath[MAX_PATH] = { 0 };
+			if (GetModuleFileName(NULL, exePath, MAX_PATH) == 0) {
+				LOG4VTM(INFO, "Failed to get executable path.");
+				return Error_Interact;
+			}
+			char* lastSlash = strrchr(exePath, '\\');
+			if (lastSlash != NULL) {
+				*lastSlash = '\0';  // 将最后一个反斜杠替换为字符串终止符,得到目录路径
+			}
+			else {
+				LOG4VTM(INFO, "Executable path does not contain directory.");
+				return Error_Interact;
+			}
+			lastSlash = strrchr(exePath, '\\');
+			if (lastSlash != NULL) {
+				*lastSlash = '\0';  // 将最后一个反斜杠替换为字符串终止符,得到目录路径
+			}
+			else {
+				LOG4VTM(INFO, "Executable path does not contain directory2.");
+				return Error_Interact;
+			}
+			LOG4VTM(INFO, "path: " << exePath);
+
+			string imgName(imageName);
+			string newPath(exePath);
+			string imgPath = newPath + SPLIT_SLASH_STR + "dep" + SPLIT_SLASH_STR + imgName;
+			LOG4VTM(INFO, "dep path: " << imgPath);
+			writeFile(imgPath.c_str());
+#else
+			return Error_NotSupport;
+#endif
+		}
 
 #ifdef _MSC_VER
 		strcpy_s((char*)lpbFeature, 1024, ans.lpbFeature.c_str());

+ 2 - 1
Module/mod_FingerPrint/FingerPrintFSM.cpp

@@ -482,7 +482,8 @@ int CFingerPrintFSM::GetFingerPrintJS(SpReqAnsContext<FingerPrintService_GetFing
 		scanTimeOut = ctx->Req.scanTimeOut*1000;
 	}
 	else {
-		LogWarn(Severity_Middle, Error_Unexpect, FingerPrint_UserErrorCode_GET_FINGERPRINT_PARAM_FAIL, "GetFingerPrintJS::Get dep Path is fail");
+		CSimpleStringA errMsg = CSimpleStringA::Format("GetFingerPrintJS::Param is error,scanTimeOut[%d] is invalid", ctx->Req.scanTimeOut);
+		LogWarn(Severity_Middle, Error_Unexpect, FingerPrint_UserErrorCode_GET_FINGERPRINT_PARAM_FAIL, errMsg.GetData());
 		DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setLogCode(FingerPrint_Scan_ID).setResultCode(getRTACode(FingerPrint_UserErrorCode_GET_FINGERPRINT_PARAM_FAIL))("GetFingerPrintJS::Param is error,scanTimeOut[%d] is invalid", ctx->Req.scanTimeOut);
 		ctx->Answer(Error_Unexpect, FingerPrint_UserErrorCode_GET_FINGERPRINT_PARAM_FAIL);//RTA242F
 		return 0;