|
@@ -515,6 +515,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)
|
|
@@ -585,6 +589,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;
|
|
@@ -635,7 +643,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("RTA211B")("Get Headphoto failed!");
|
|
|
+ ctx->Answer(Error_Unexpect, IDCertificate_UserErrorCode_ReadAndScan_GetHeadPhotoFailed);
|
|
|
+ }
|
|
|
+ else if (m_bHeadPhotoTimeError) //头像图片修改时间异常
|
|
|
+ {
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setResultCode("RTA211C")("Headphoto time error!");
|
|
|
+ ctx->Answer(Error_Unexpect, IDCertificate_UserErrorCode_ReadAndScan_HeadPhotoTimeError);
|
|
|
+ }
|
|
|
+ else if (m_bFrontPhotoTimeError) //正面扫描件修改时间异常
|
|
|
+ {
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setResultCode("RTA211D")("Frontphoto time error!");
|
|
|
+ ctx->Answer(Error_Unexpect, IDCertificate_UserErrorCode_ReadAndScan_FrontPhotoTimeError);
|
|
|
+ }
|
|
|
+ else if (m_bBackPhotoTimeError) //背面扫描件修改时间异常
|
|
|
+ {
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setResultCode("RTA211E")("Backphoto time error!");
|
|
|
+ ctx->Answer(Error_Unexpect, IDCertificate_UserErrorCode_ReadAndScan_BackPhotoTimeError);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ ctx->Answer(Error_Succeed);
|
|
|
+ }
|
|
|
}
|
|
|
else if (m_bCancelRead)
|
|
|
{
|
|
@@ -647,14 +678,14 @@ int CIDCertFSM::ReadAndScanUTF8(SpReqAnsContext<IDCert_ReadAndScanUTF8_Req, IDCe
|
|
|
if (errReadEx2 != Error_Succeed) {
|
|
|
|
|
|
SetErrorAndLog(errReadEx2, MEC_DEVAPI_IDCER_IDCerGetDataEx2, "DevAdapter::IDCerGetDataEx2", __FUNCTION__,
|
|
|
- true, IDCerGetDataEx2Time, IDCertService_LogCode_IDCerGetDataEx2);
|
|
|
+ IsInBusiness(), IDCerGetDataEx2Time, IDCertService_LogCode_IDCerGetDataEx2);
|
|
|
ctx->Answer(Error_TimeOut, GetAlarmDEC()); //RTA2109
|
|
|
}
|
|
|
}
|
|
|
else if (errRfOpen != Error_Succeed)
|
|
|
{
|
|
|
SetErrorAndLog(errRfOpen, MEC_DEVAPI_IDCER_IDCerRFControl, "DevAdapter::IDCerRFControl", __FUNCTION__,
|
|
|
- true, OpenRFControlTime, IDCertService_LogCode_OpenIDCerRFControl);
|
|
|
+ IsInBusiness(), OpenRFControlTime, IDCertService_LogCode_OpenIDCerRFControl);
|
|
|
ctx->Answer(Error_TimeOut, GetAlarmDEC());
|
|
|
}
|
|
|
else
|
|
@@ -727,6 +758,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)
|
|
@@ -790,6 +825,10 @@ int CIDCertFSM::ReadAndScanUTF8JS(SpReqAnsContext<IDCert_ReadAndScanUTF8JS_Req,
|
|
|
|
|
|
//转换数据并赋值至传出字段
|
|
|
CopyIDCerDataToCtx(idInfoEx2, ctx);
|
|
|
+ if (m_bGetHeadPhotoFailed)
|
|
|
+ {
|
|
|
+ break;
|
|
|
+ }
|
|
|
|
|
|
ctx->Ans.hasscan = 0;
|
|
|
if (igestionVer == TRUE) //吸入式设备才调用正反扫描功能
|
|
@@ -838,7 +877,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("RTA211B")("Get Headphoto failed!");
|
|
|
+ ctx->Answer(Error_Unexpect, IDCertificate_UserErrorCode_ReadAndScan_GetHeadPhotoFailed);
|
|
|
+ }
|
|
|
+ else if (m_bHeadPhotoTimeError) //头像图片修改时间异常
|
|
|
+ {
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setResultCode("RTA211C")("Headphoto time error!");
|
|
|
+ ctx->Answer(Error_Unexpect, IDCertificate_UserErrorCode_ReadAndScan_HeadPhotoTimeError);
|
|
|
+ }
|
|
|
+ else if (m_bFrontPhotoTimeError) //正面扫描件修改时间异常
|
|
|
+ {
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setResultCode("RTA211D")("Frontphoto time error!");
|
|
|
+ ctx->Answer(Error_Unexpect, IDCertificate_UserErrorCode_ReadAndScan_FrontPhotoTimeError);
|
|
|
+ }
|
|
|
+ else if (m_bBackPhotoTimeError) //背面扫描件修改时间异常
|
|
|
+ {
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setResultCode("RTA211E")("Backphoto time error!");
|
|
|
+ ctx->Answer(Error_Unexpect, IDCertificate_UserErrorCode_ReadAndScan_BackPhotoTimeError);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ ctx->Answer(Error_Succeed);
|
|
|
+ }
|
|
|
}
|
|
|
else if (m_bCancelRead)
|
|
|
{
|
|
@@ -850,14 +912,14 @@ int CIDCertFSM::ReadAndScanUTF8JS(SpReqAnsContext<IDCert_ReadAndScanUTF8JS_Req,
|
|
|
if (errReadEx2 != Error_Succeed) {
|
|
|
|
|
|
SetErrorAndLog(errReadEx2, MEC_DEVAPI_IDCER_IDCerGetDataEx2, "DevAdapter::IDCerGetDataEx2", __FUNCTION__,
|
|
|
- true, IDCerGetDataEx2Time, IDCertService_LogCode_IDCerGetDataEx2);
|
|
|
+ IsInBusiness(), IDCerGetDataEx2Time, IDCertService_LogCode_IDCerGetDataEx2);
|
|
|
ctx->Answer(Error_Unexpect, GetAlarmDEC()); //RTA2109
|
|
|
}
|
|
|
}
|
|
|
else if (errRfOpen != Error_Succeed)
|
|
|
{
|
|
|
SetErrorAndLog(errRfOpen, MEC_DEVAPI_IDCER_IDCerRFControl, "DevAdapter::IDCerRFControl", __FUNCTION__,
|
|
|
- true, OpenRFControlTime, IDCertService_LogCode_OpenIDCerRFControl);
|
|
|
+ IsInBusiness(), OpenRFControlTime, IDCertService_LogCode_OpenIDCerRFControl);
|
|
|
ctx->Answer(Error_Unexpect, GetAlarmDEC()); //RTA2106
|
|
|
}
|
|
|
else
|
|
@@ -972,6 +1034,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());
|
|
@@ -1770,9 +1833,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
|
|
|
}
|