|
@@ -545,7 +545,7 @@ int CIDCertFSM::ReadAndScanUTF8(SpReqAnsContext<IDCert_ReadAndScanUTF8_Req, IDCe
|
|
|
ErrorCodeEnum errReadEx2 = Error_Unexpect;
|
|
|
LogEvent(Severity_Middle, LOG_EVT_IDCERTIFICATE_GREEN_ON, "IDCer warning on");
|
|
|
|
|
|
- DeleteZP(Bmp_ZP | Bmp_SCAN);
|
|
|
+ DeleteZP(Bmp_ZP | Bmp_SCAN, 1);
|
|
|
|
|
|
bool bOpenRF = false, bGetIDCert = false;
|
|
|
IDCerInfoEx2 idInfoEx2;
|
|
@@ -832,7 +832,7 @@ int CIDCertFSM::ReadAndScanUTF8(SpReqAnsContext<IDCert_ReadAndScanUTF8_Req, IDCe
|
|
|
//idfront.bmp" and "idback.bmp
|
|
|
ErrorCodeEnum eErrFront, eErrBack;
|
|
|
eErrFront = GetPngBlobEx(ctx->Ans.frontphoto, "idfront");
|
|
|
- eErrBack = GetPngBlobEx(ctx->Ans.backphoto, "idback", true);
|
|
|
+ eErrBack = GetPngBlobEx(ctx->Ans.backphoto, "idback");
|
|
|
if (eErrFront == Error_Succeed && eErrBack == Error_Succeed)
|
|
|
{
|
|
|
ctx->Ans.hasscan = 1;
|
|
@@ -885,7 +885,7 @@ int CIDCertFSM::ReadAndScanUTF8(SpReqAnsContext<IDCert_ReadAndScanUTF8_Req, IDCe
|
|
|
LogWarn(Severity_Low, Error_Succeed, IDCertificate_UserErrorCode_ReadAndScan_GetIDInfo, csIDLogInfo.GetData());
|
|
|
|
|
|
ctx->Ans.photodata = ctx->Ans.headphoto;
|
|
|
- DeleteZP(Bmp_ZP);
|
|
|
+ DeleteZP(Bmp_ZP | Bmp_SCAN, 2);
|
|
|
|
|
|
bGetIDCert = true;
|
|
|
break;
|
|
@@ -1360,7 +1360,7 @@ int CIDCertFSM::ReadAndScanUTF8JS(SpReqAnsContext<IDCert_ReadAndScanUTF8JS_Req,
|
|
|
memcpy(ctx->Ans.othercode_utf8.m_pData, englishNameEx, strlen((char*)englishNameEx)); //英文名备用字段
|
|
|
|
|
|
ctx->Ans.hasscan = 0;
|
|
|
- GetPngBlobEx(ctx->Ans.headphoto, "zp", true); //转换头像图片
|
|
|
+ GetPngBlobEx(ctx->Ans.headphoto, "zp"); //转换头像图片
|
|
|
|
|
|
if (igestionVer == TRUE)//吸入式设备才调用正反扫描功能
|
|
|
{
|
|
@@ -1385,7 +1385,7 @@ int CIDCertFSM::ReadAndScanUTF8JS(SpReqAnsContext<IDCert_ReadAndScanUTF8JS_Req,
|
|
|
//idfront.bmp" and "idback.bmp
|
|
|
ErrorCodeEnum eErrFront, eErrBack;
|
|
|
eErrFront = GetPngBlobEx(ctx->Ans.frontphoto, "idfront");
|
|
|
- eErrBack = GetPngBlobEx(ctx->Ans.backphoto, "idback", true);
|
|
|
+ eErrBack = GetPngBlobEx(ctx->Ans.backphoto, "idback");
|
|
|
if (eErrFront == Error_Succeed && eErrBack == Error_Succeed)
|
|
|
{
|
|
|
ctx->Ans.hasscan = 1;
|
|
@@ -1754,7 +1754,7 @@ void CIDCertFSM::SelfTest(EntityTestEnum eTestType,CSmartPointer<ITransactionCon
|
|
|
pTransactionContext->SendAnswer(m_testResult);
|
|
|
}
|
|
|
|
|
|
-ErrorCodeEnum CIDCertFSM::DeleteFileIfExisted(LPCTSTR fileName)
|
|
|
+ErrorCodeEnum CIDCertFSM::DeleteFileIfExisted(LPCTSTR fileName, int deleteTiming)
|
|
|
{
|
|
|
if(strlen(fileName) == 0 || strchr(fileName, (int)'*') != NULL)
|
|
|
{
|
|
@@ -1770,6 +1770,12 @@ ErrorCodeEnum CIDCertFSM::DeleteFileIfExisted(LPCTSTR fileName)
|
|
|
|
|
|
if (ExistsFileA((LPCTSTR)strAimPath))
|
|
|
{
|
|
|
+ if (deleteTiming == 1) //检测到上次读证残留图片
|
|
|
+ {
|
|
|
+ CSimpleStringA errMsg = CSimpleStringA::Format("检测到上次读证残留图片:[%s]", strAimPath.GetData());
|
|
|
+ DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode("RTA2112").setAPI("DeleteFileIfExisted")(errMsg.GetData());
|
|
|
+ }
|
|
|
+
|
|
|
if (RemoveFileA((LPCTSTR)strAimPath))
|
|
|
{
|
|
|
DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("RemoveFileA(%s) suc.", (LPCTSTR)strAimPath);
|
|
@@ -1777,12 +1783,27 @@ ErrorCodeEnum CIDCertFSM::DeleteFileIfExisted(LPCTSTR fileName)
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("DeleteFile(%s) failed LastError(%d).", (LPCTSTR)strAimPath, GetLastError());
|
|
|
+ CSimpleStringA rtaCode = "";
|
|
|
+ if (deleteTiming == 1) //删除上次读证残留图片失败
|
|
|
+ {
|
|
|
+ rtaCode = "RTA2113";
|
|
|
+ }
|
|
|
+ else if (deleteTiming == 2) //删除本次读证生成图片失败
|
|
|
+ {
|
|
|
+ rtaCode = "RTA2115";
|
|
|
+ }
|
|
|
+ DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode(rtaCode.GetData()).setAPI("DeleteFileIfExisted")
|
|
|
+ ("DeleteFile(%s) failed LastError(%d).", (LPCTSTR)strAimPath, GetLastError());
|
|
|
return Error_Unexpect;
|
|
|
}
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
+ if (deleteTiming == 2) //未发现本次读证生成的图片
|
|
|
+ {
|
|
|
+ CSimpleStringA errMsg = CSimpleStringA::Format("未发现本次读证生成的图片:[%s]", strAimPath.GetData());
|
|
|
+ DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode("RTA2114").setAPI("DeleteFileIfExisted")(errMsg.GetData());
|
|
|
+ }
|
|
|
return Error_Succeed;
|
|
|
}
|
|
|
}
|
|
@@ -1835,24 +1856,19 @@ int CIDCertFSM::WaitFetchIDCard()
|
|
|
return -1;
|
|
|
}
|
|
|
|
|
|
-void CIDCertFSM::DeleteZP(int type)
|
|
|
+void CIDCertFSM::DeleteZP(int type, int deleteTiming)
|
|
|
{
|
|
|
if ((type&Bmp_ZP) == Bmp_ZP)
|
|
|
{
|
|
|
- DeleteFileIfExisted("zp.JPEG");
|
|
|
- DeleteFileIfExisted("zp.jpg");
|
|
|
- DeleteFileIfExisted("zp.bmp"); //All
|
|
|
- DeleteFileIfExisted("wz.txt"); //Sankyo
|
|
|
- DeleteFileIfExisted("xp.wlt");
|
|
|
- DeleteFileIfExisted("ImgTemp.bmp"); //Nantian
|
|
|
- DeleteFileIfExisted("BP8913_ID.bmp"); //Nantian
|
|
|
+ DeleteFileIfExisted("zp.jpg", deleteTiming);
|
|
|
+ DeleteFileIfExisted("zp.bmp", deleteTiming); //All
|
|
|
}
|
|
|
if ((type&Bmp_SCAN) == Bmp_SCAN)
|
|
|
{
|
|
|
- DeleteFileIfExisted("idfront.bmp");
|
|
|
- DeleteFileIfExisted("idback.bmp");
|
|
|
- DeleteFileIfExisted("idfront.jpg");
|
|
|
- DeleteFileIfExisted("idback.jpg");
|
|
|
+ DeleteFileIfExisted("idfront.bmp", deleteTiming);
|
|
|
+ DeleteFileIfExisted("idback.bmp", deleteTiming);
|
|
|
+ DeleteFileIfExisted("idfront.jpg", deleteTiming);
|
|
|
+ DeleteFileIfExisted("idback.jpg", deleteTiming);
|
|
|
}
|
|
|
}
|
|
|
|