|
@@ -517,6 +517,10 @@ int CIDCertFSM::ReadAndScanUTF8(SpReqAnsContext<IDCert_ReadAndScanUTF8_Req, IDCe
|
|
|
m_bCancelRead = false;
|
|
|
m_bReading = true;
|
|
|
m_bExit = false;
|
|
|
+ m_bGetHeadPhotoFailed = false;
|
|
|
+ m_bHeadPhotoTimeError = false;
|
|
|
+ m_bFrontPhotoTimeError = false;
|
|
|
+ m_bBackPhotoTimeError = false;
|
|
|
|
|
|
LogEvent(Severity_Middle, LOG_EVT_IDCERTIFICATE_GREEN_ON, "IDCer warning on");
|
|
|
while (elapsed < IDCER_READ_TIMEOUT && (errReadEx2 != Error_Succeed) && !m_bCancelRead)
|
|
@@ -587,6 +591,10 @@ int CIDCertFSM::ReadAndScanUTF8(SpReqAnsContext<IDCert_ReadAndScanUTF8_Req, IDCe
|
|
|
|
|
|
//转换数据并赋值至传出字段
|
|
|
CopyIDCerDataToCtx(idInfoEx2, ctx);
|
|
|
+ if (m_bGetHeadPhotoFailed)
|
|
|
+ {
|
|
|
+ break;
|
|
|
+ }
|
|
|
ctx->Ans.photodata = ctx->Ans.headphoto; //现接口继续保持复制图片,JS接口下掉photodata字段 - 2025.6.17
|
|
|
|
|
|
ctx->Ans.hasscan = 0;
|
|
@@ -637,7 +645,30 @@ int CIDCertFSM::ReadAndScanUTF8(SpReqAnsContext<IDCert_ReadAndScanUTF8_Req, IDCe
|
|
|
|
|
|
if (errReadEx2 == Error_Succeed)
|
|
|
{
|
|
|
- ctx->Answer(Error_Succeed);
|
|
|
+ if (m_bGetHeadPhotoFailed) //头像图片获取失败
|
|
|
+ {
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setResultCode("RTAXXXX")("Get Headphoto failed!");
|
|
|
+ ctx->Answer(Error_Unexpect, IDCertificate_UserErrorCode_ReadAndScan_GetHeadPhotoFailed);
|
|
|
+ }
|
|
|
+ else if (m_bHeadPhotoTimeError) //头像图片修改时间异常
|
|
|
+ {
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setResultCode("RTAXXXX")("Headphoto time error!");
|
|
|
+ ctx->Answer(Error_Unexpect, IDCertificate_UserErrorCode_ReadAndScan_HeadPhotoTimeError);
|
|
|
+ }
|
|
|
+ else if (m_bFrontPhotoTimeError) //正面扫描件修改时间异常
|
|
|
+ {
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setResultCode("RTAXXXX")("Frontphoto time error!");
|
|
|
+ ctx->Answer(Error_Unexpect, IDCertificate_UserErrorCode_ReadAndScan_FrontPhotoTimeError);
|
|
|
+ }
|
|
|
+ else if (m_bBackPhotoTimeError) //背面扫描件修改时间异常
|
|
|
+ {
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setResultCode("RTAXXXX")("Backphoto time error!");
|
|
|
+ ctx->Answer(Error_Unexpect, IDCertificate_UserErrorCode_ReadAndScan_BackPhotoTimeError);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ ctx->Answer(Error_Succeed);
|
|
|
+ }
|
|
|
}
|
|
|
else if (m_bCancelRead)
|
|
|
{
|
|
@@ -729,6 +760,10 @@ int CIDCertFSM::ReadAndScanUTF8JS(SpReqAnsContext<IDCert_ReadAndScanUTF8JS_Req,
|
|
|
m_bCancelRead = false;
|
|
|
m_bReading = true;
|
|
|
m_bExit = false;
|
|
|
+ m_bGetHeadPhotoFailed = false;
|
|
|
+ m_bHeadPhotoTimeError = false;
|
|
|
+ m_bFrontPhotoTimeError = false;
|
|
|
+ m_bBackPhotoTimeError = false;
|
|
|
|
|
|
LogEvent(Severity_Middle, LOG_EVT_IDCERTIFICATE_GREEN_ON, "IDCer warning on");
|
|
|
while (elapsed < IDCER_READ_TIMEOUT && (errReadEx2 != Error_Succeed) && !m_bCancelRead)
|
|
@@ -792,6 +827,10 @@ int CIDCertFSM::ReadAndScanUTF8JS(SpReqAnsContext<IDCert_ReadAndScanUTF8JS_Req,
|
|
|
|
|
|
//转换数据并赋值至传出字段
|
|
|
CopyIDCerDataToCtx(idInfoEx2, ctx);
|
|
|
+ if (m_bGetHeadPhotoFailed)
|
|
|
+ {
|
|
|
+ break;
|
|
|
+ }
|
|
|
|
|
|
ctx->Ans.hasscan = 0;
|
|
|
if (igestionVer == TRUE) //吸入式设备才调用正反扫描功能
|
|
@@ -840,7 +879,30 @@ int CIDCertFSM::ReadAndScanUTF8JS(SpReqAnsContext<IDCert_ReadAndScanUTF8JS_Req,
|
|
|
|
|
|
if (errReadEx2 == Error_Succeed)
|
|
|
{
|
|
|
- ctx->Answer(Error_Succeed);
|
|
|
+ if (m_bGetHeadPhotoFailed) //头像图片获取失败
|
|
|
+ {
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setResultCode("RTAXXXX")("Get Headphoto failed!");
|
|
|
+ ctx->Answer(Error_Unexpect, IDCertificate_UserErrorCode_ReadAndScan_GetHeadPhotoFailed);
|
|
|
+ }
|
|
|
+ else if (m_bHeadPhotoTimeError) //头像图片修改时间异常
|
|
|
+ {
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setResultCode("RTAXXXX")("Headphoto time error!");
|
|
|
+ ctx->Answer(Error_Unexpect, IDCertificate_UserErrorCode_ReadAndScan_HeadPhotoTimeError);
|
|
|
+ }
|
|
|
+ else if (m_bFrontPhotoTimeError) //正面扫描件修改时间异常
|
|
|
+ {
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setResultCode("RTAXXXX")("Frontphoto time error!");
|
|
|
+ ctx->Answer(Error_Unexpect, IDCertificate_UserErrorCode_ReadAndScan_FrontPhotoTimeError);
|
|
|
+ }
|
|
|
+ else if (m_bBackPhotoTimeError) //背面扫描件修改时间异常
|
|
|
+ {
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setResultCode("RTAXXXX")("Backphoto time error!");
|
|
|
+ ctx->Answer(Error_Unexpect, IDCertificate_UserErrorCode_ReadAndScan_BackPhotoTimeError);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ ctx->Answer(Error_Succeed);
|
|
|
+ }
|
|
|
}
|
|
|
else if (m_bCancelRead)
|
|
|
{
|
|
@@ -974,6 +1036,7 @@ ErrorCodeEnum CIDCertFSM::GetPngBlobEx(CBlob &data, CSimpleStringA fileNamePrefi
|
|
|
errInfo["description"] = disecription.GetData();
|
|
|
tErrStr = generateJsonStr(errInfo).second.c_str();
|
|
|
DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode(imgRTACode).setAPI("DeleteFileIfExisted")(tErrStr.GetData());
|
|
|
+ m_bGetHeadPhotoFailed = true;
|
|
|
}
|
|
|
|
|
|
errMsg = CSimpleStringA::Format("read file %s.bmp failed.err:%d", (const char*)strPath, GetLastError());
|
|
@@ -1777,9 +1840,11 @@ void CIDCertFSM::WarnImgCreateTime()
|
|
|
CSimpleStringA fileTimeWarn = CSimpleStringA::Format("头像图片时间:[%s], 正面图片时间:[%s],背面图片时间:[%s]",
|
|
|
headPhotoTimeStr.GetData(), frontPhotoTimeStr.GetData(), backPhotoTimeStr.GetData());
|
|
|
SeverityLevelEnum ImgTimeWarnLevel = Severity_Low;
|
|
|
- if ((headPhotoTime > 0 && headPhotoTime < currentSysTime) ||
|
|
|
- (frontPhotoTime > 0 && frontPhotoTime < currentSysTime) ||
|
|
|
- (backPhotoTime > 0 && backPhotoTime < currentSysTime))
|
|
|
+ m_bHeadPhotoTimeError = headPhotoTime > 0 && headPhotoTime < currentSysTime;
|
|
|
+ m_bFrontPhotoTimeError = frontPhotoTime > 0 && frontPhotoTime < currentSysTime;
|
|
|
+ m_bBackPhotoTimeError = backPhotoTime > 0 && backPhotoTime < currentSysTime;
|
|
|
+
|
|
|
+ if (m_bHeadPhotoTimeError || m_bFrontPhotoTimeError || m_bBackPhotoTimeError)
|
|
|
{
|
|
|
ImgTimeWarnLevel = Severity_Middle; //若生成图片的时间早于本次交易时间,则告LEVEL2
|
|
|
}
|