|
@@ -114,6 +114,7 @@ void CCardIssuerFSM::s0_on_entry()
|
|
|
//oilyang@20200426 add "Desk2S 2.1","Desk1S 1.0"
|
|
|
if (!_strnicmp("RVC.Stand2S", m_csMachineType, strlen("RVC.Stand2S"))
|
|
|
|| !_strnicmp("RVC.CardStore", m_csMachineType, strlen("RVC.CardStore"))
|
|
|
+ || !_strnicmp("RVC.CardPrinter", m_csMachineType, strlen("RVC.CardPrinter"))
|
|
|
|| (_strnicmp("RVC.Desk2S", m_csMachineType, strlen("RVC.Desk2S")) == 0 && m_majorVerion == 2 && m_minorVerion == 1)
|
|
|
|| (_strnicmp("RVC.Desk1S", m_csMachineType, strlen("RVC.Desk1S")) == 0 && m_majorVerion == 1 && m_minorVerion == 0))
|
|
|
{
|
|
@@ -1008,7 +1009,7 @@ unsigned int CCardIssuerFSM::s5_on_event(FSMEvent* pEvt)
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- pCRNFE->ctx->Answer(Error_Unexpect, AlarmDECToBusiness(MEC_DEVAPI_CARDISSUER_GetDevStatus));
|
|
|
+ pCRNFE->ctx->Answer(Error_Unexpect, AlarmDECToBusiness("Read finished,", Error_Unexpect,MEC_DEVAPI_CARDISSUER_GetDevStatus));
|
|
|
return 1;
|
|
|
}
|
|
|
}
|
|
@@ -1724,6 +1725,8 @@ ErrorCodeEnum CCardIssuerFSM::OnExit()
|
|
|
else
|
|
|
{
|
|
|
eExit = MachineMoveCardFrontGate();
|
|
|
+ if (eExit != Error_Succeed)
|
|
|
+ AlarmDEC("OnExit::MachineMoveCardFrontGate", eExit, CardIssuer_UserErrorCode_MoveCardToGate_Failed);
|
|
|
Dbg("entity quit to eject card(%d).",eExit);
|
|
|
}
|
|
|
}
|
|
@@ -1782,6 +1785,9 @@ bool CCardIssuerFSM::GetDevStatus()
|
|
|
if (Error_Succeed == err)
|
|
|
{
|
|
|
Dbg("GetDevStatus::eMedia: %d", m_devStatus.eMedia);
|
|
|
+ if (_strnicmp("RVC.CardPrinter", m_csMachineType, strlen("RVC.CardPrinter")) == 0)
|
|
|
+ Dbg("kaku tape(flat%d,concave:%d,gold:%d,silver:%d", m_devStatus.eKakuTape[0]
|
|
|
+ , m_devStatus.eKakuTape[1], m_devStatus.eKakuTape[2], m_devStatus.eKakuTape[3]);
|
|
|
if(m_devStatus.eMedia == CI_MEDIA_ENTERING) {
|
|
|
|
|
|
}
|
|
@@ -1794,7 +1800,7 @@ bool CCardIssuerFSM::GetDevStatus()
|
|
|
//DevErrorInfo devErrInfo;
|
|
|
//m_pCardIssuer->GetLastErr(devErrInfo);
|
|
|
//Dbg("GetDevStatus:[%s]",devErrInfo.szErrMsg);
|
|
|
- LogErrMsg("GetDevStatus::GetDevStatus", err, MEC_DEVAPI_CARDISSUER_GetDevStatus, TRUE);
|
|
|
+ AlarmDEC("GetDevStatus::GetDevStatus", err, MEC_DEVAPI_CARDISSUER_GetDevStatus);
|
|
|
|
|
|
getDevInfoCount++;
|
|
|
Sleep(3000);
|
|
@@ -1848,6 +1854,7 @@ int CCardIssuerFSM::Reset()
|
|
|
return 0;
|
|
|
}
|
|
|
else {
|
|
|
+ AlarmDEC("Reset::MachineMoveCardFrontGate", eMoveErr, CardIssuer_UserErrorCode_MoveCardToGate_Failed);
|
|
|
Dbg("after reset,move front failed(%d).",eMoveErr);
|
|
|
}
|
|
|
}
|
|
@@ -1866,7 +1873,7 @@ int CCardIssuerFSM::Reset()
|
|
|
}
|
|
|
}
|
|
|
else {
|
|
|
- LOG_CARDISSUER_ERROR_MSG_MACRO(ec, Reset);
|
|
|
+ AlarmDEC("Reset:", ec, MEC_DEVAPI_CARDISSUER_Reset);
|
|
|
return 1;
|
|
|
}
|
|
|
return 0;
|
|
@@ -2028,7 +2035,7 @@ ErrorCodeEnum CCardIssuerFSM::OpenDevice(BYTE btOpenType, const char *pDevSN)
|
|
|
{
|
|
|
if ((eErrDev = CreateDevComponent((DeviceBaseClass*&)m_pCardIssuer)) != Error_Succeed)
|
|
|
{
|
|
|
- LogErrMsg("OpenDevice:CreateDevComponent", eErrDev, MEC_DEV_OBJECT_CREATE_FAILED, TRUE);
|
|
|
+ AlarmDEC("OpenDevice:CreateDevComponent", eErrDev, MEC_DEV_OBJECT_CREATE_FAILED);
|
|
|
initTries++;
|
|
|
m_pCardIssuer = NULL;
|
|
|
continue;
|
|
@@ -2064,7 +2071,7 @@ ErrorCodeEnum CCardIssuerFSM::OpenDevice(BYTE btOpenType, const char *pDevSN)
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- LOG_CARDISSUER_ERROR_MSG_MACRO(eErrDev, GetDevCategory);
|
|
|
+ AlarmDEC("GetDevCategory:",eErrDev, MEC_DEVAPI_CARDISSUER_GetDevCategory);
|
|
|
//LogWarn(Severity_Low, Error_Unexpect, CardIssuer_UserErrorCode_GetDevCategory_Failed, "获取设备信息失败");
|
|
|
//Dbg("GetDevCategory failed.%d",eErrDev);
|
|
|
//LogDevErrorInfo();
|
|
@@ -2089,14 +2096,16 @@ ErrorCodeEnum CCardIssuerFSM::OpenDevice(BYTE btOpenType, const char *pDevSN)
|
|
|
eErr = m_pCardIssuer->GetDeviceSN(pDevSN);
|
|
|
if (eErr == Error_Succeed)
|
|
|
{
|
|
|
- m_csDevSN = pDevSN;
|
|
|
+ //m_csDevSN only for SCI/CIA (bluetooth)
|
|
|
+ if (IsValidSCIName(pDevSN, strlen(pDevSN)) > 0)
|
|
|
+ m_csDevSN = pDevSN;
|
|
|
Dbg("GetDeviceSN:%s", pDevSN);
|
|
|
if (pDevSN != NULL)
|
|
|
delete[]pDevSN;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- LogErrMsg("获取设备唯一号失败", eErr, MEC_DEVAPI_CARDISSUER_GetDeviceSN, TRUE);
|
|
|
+ AlarmDEC("获取设备唯一号失败", eErr, MEC_DEVAPI_CARDISSUER_GetDeviceSN);
|
|
|
//LogWarn(Severity_Low, Error_Unexpect, CardIssuer_UserErrorCode_GetDeviceSN_Failed, "获取设备唯一号失败");
|
|
|
//Dbg("GetDeviceSN failed.%d", eErr);
|
|
|
if (pDevSN != NULL)
|
|
@@ -2109,7 +2118,7 @@ ErrorCodeEnum CCardIssuerFSM::OpenDevice(BYTE btOpenType, const char *pDevSN)
|
|
|
if (!LoadCMBPrint(csBinPath))
|
|
|
{
|
|
|
Dbg("load CMBPrint failed.");
|
|
|
- LogErrMsg("OpenDevice::DevOpenEx", Error_DevLoadFileFailed, CardIssuer_UserErrorCode_Load_CMBPrint_Failed, TRUE);
|
|
|
+ AlarmDEC("OpenDevice::DevOpenEx", Error_DevLoadFileFailed, CardIssuer_UserErrorCode_Load_CMBPrint_Failed);
|
|
|
return Error_DevLoadFileFailed;
|
|
|
}
|
|
|
initTries = 0;
|
|
@@ -2117,7 +2126,7 @@ ErrorCodeEnum CCardIssuerFSM::OpenDevice(BYTE btOpenType, const char *pDevSN)
|
|
|
}
|
|
|
else {
|
|
|
//LogDevErrorInfo();
|
|
|
- LogErrMsg("OpenDevice::DevOpenEx", eErrDev, MEC_DEVAPI_CARDISSUER_DevOpenEx, TRUE);
|
|
|
+ AlarmDEC("OpenDevice::DevOpenEx", eErrDev, MEC_DEVAPI_CARDISSUER_DevOpenEx);
|
|
|
initTries++;
|
|
|
}
|
|
|
}while(initTries < INIT_TRY_NUM);
|
|
@@ -2266,7 +2275,7 @@ ErrorCodeEnum CCardIssuerFSM::OpenDevice(BYTE btOpenType, const char *pDevSN)
|
|
|
//超过5,认为是脏数据,用默认值3
|
|
|
CardIssuerStatus cis;
|
|
|
if ((eErrDev = m_pCardIssuer->GetDevStatus(cis)) != Error_Succeed) {
|
|
|
- LogErrMsg("GetDevStatus(OpenDevice)", eErrDev, MEC_DEVAPI_CARDISSUER_GetDevStatus, TRUE);
|
|
|
+ AlarmDEC("GetDevStatus(OpenDevice)", eErrDev, MEC_DEVAPI_CARDISSUER_GetDevStatus);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -2447,7 +2456,7 @@ int CCardIssuerFSM::UnAcceptCard()
|
|
|
//close shutter successful process.
|
|
|
}
|
|
|
else{
|
|
|
- LogErrMsg("after open,close shutter", eErr, MEC_DEVAPI_CARDISSUER_SetCardInType, TRUE);
|
|
|
+ AlarmDEC("after open,close shutter", eErr, MEC_DEVAPI_CARDISSUER_SetCardInType);
|
|
|
//close shutter failed process.
|
|
|
}
|
|
|
if (GetDevStatus())
|
|
@@ -2490,7 +2499,8 @@ int CCardIssuerFSM::IssueCard(SpReqAnsContext<CardIssuerService_Issue_Req, CardI
|
|
|
return 2;
|
|
|
}
|
|
|
//如果有盘库记录则清理掉(@zjw20190809)
|
|
|
- if (m_csMachineType.Compare("RVC.CardStore") == 0)
|
|
|
+ if (m_csMachineType.Compare("RVC.CardStore") == 0
|
|
|
+ || m_csMachineType.Compare("RVC.CardPrinter") == 0)
|
|
|
{
|
|
|
ErrorCodeEnum eErr = Error_Succeed;
|
|
|
CSmartPointer<IConfigInfo> spConfigRun;
|
|
@@ -2498,7 +2508,7 @@ int CCardIssuerFSM::IssueCard(SpReqAnsContext<CardIssuerService_Issue_Req, CardI
|
|
|
if(eErr != Error_Succeed)
|
|
|
{
|
|
|
Dbg("Open runcfg failed(%d).", eErr);
|
|
|
- ctx->Answer(Error_Unexpect, AlarmDECToBusiness(MEC_CFG_RUN_POINTER_FAILED));
|
|
|
+ ctx->Answer(Error_Unexpect, AlarmDECToBusiness("Open runcfg failed:",eErr,MEC_CFG_RUN_POINTER_FAILED));
|
|
|
return 2;
|
|
|
}
|
|
|
if(CheckHasPanKuRecord(spConfigRun))
|
|
@@ -2518,7 +2528,7 @@ int CCardIssuerFSM::IssueCard(SpReqAnsContext<CardIssuerService_Issue_Req, CardI
|
|
|
ErrorCodeEnum eGateForbid = m_pCardIssuer->SetCardInType(CI_CARD_IN_TYPE_ALL);
|
|
|
if (eGateForbid != Error_Succeed)
|
|
|
{
|
|
|
- LogErrMsg("SetCardInType(CI_CARD_IN_TYPE_ALL)", eGateForbid, MEC_DEVAPI_CARDISSUER_SetCardInType, TRUE);
|
|
|
+ AlarmDEC("SetCardInType(CI_CARD_IN_TYPE_ALL)", eGateForbid, MEC_DEVAPI_CARDISSUER_SetCardInType);
|
|
|
ctxEx->Answer(Error_Unexpect);
|
|
|
m_bForHangzhouSongruiMenjinka = false;
|
|
|
return 2;
|
|
@@ -2596,7 +2606,7 @@ int CCardIssuerFSM::IssueCard(SpReqAnsContext<CardIssuerService_Issue_Req, CardI
|
|
|
ctxEx->Answer(Error_Succeed);
|
|
|
return 2;
|
|
|
}
|
|
|
- Dbg("IssueCard from the %d hopper[%d].", ctxEx->Req.hopper,m_currentHopper);
|
|
|
+ Dbg("IssueCard from the %d hopper.", ctxEx->Req.hopper);
|
|
|
//param Req.hopper is wrong
|
|
|
if (ctxEx->Req.hopper < 1 || ctxEx->Req.hopper > 3)
|
|
|
return Error_Param;
|
|
@@ -2642,7 +2652,7 @@ int CCardIssuerFSM::IssueCard(SpReqAnsContext<CardIssuerService_Issue_Req, CardI
|
|
|
memset(&cis, 0, sizeof(CardIssuerStatus));
|
|
|
bool bEmpty = false;
|
|
|
if ((errCode = m_pCardIssuer->GetDevStatus(cis)) != Error_Succeed) {
|
|
|
- LogErrMsg("IssueCard::GetDevStatus", errCode, MEC_DEVAPI_CARDISSUER_GetDevStatus, TRUE);
|
|
|
+ AlarmDEC("IssueCard::GetDevStatus", errCode, MEC_DEVAPI_CARDISSUER_GetDevStatus);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -2692,11 +2702,10 @@ int CCardIssuerFSM::IssueCard(SpReqAnsContext<CardIssuerService_Issue_Req, CardI
|
|
|
errCode = m_pCardIssuer->SetCardInType(CI_CARD_IN_TYPE_FORBIDDEN);
|
|
|
if (errCode != Error_Succeed)
|
|
|
{
|
|
|
- LogErrMsg("before issue,close shutter", errCode, MEC_DEVAPI_CARDISSUER_SetCardInType, TRUE);
|
|
|
if (ctx != NULL)
|
|
|
- ctx->Answer(Error_Unexpect,AlarmDECToBusiness(MEC_DEVAPI_CARDISSUER_SetCardInType));
|
|
|
+ ctx->Answer(Error_Unexpect, AlarmDECToBusiness("SetCardInType:",errCode,MEC_DEVAPI_CARDISSUER_SetCardInType));
|
|
|
else
|
|
|
- ctxEx->Answer(Error_Unexpect, AlarmDECToBusiness(MEC_DEVAPI_CARDISSUER_SetCardInType));
|
|
|
+ ctxEx->Answer(Error_Unexpect, AlarmDECToBusiness("SetCardInType:", errCode, MEC_DEVAPI_CARDISSUER_SetCardInType));
|
|
|
return 1;
|
|
|
}
|
|
|
Dbg("move card to holder");
|
|
@@ -2714,9 +2723,9 @@ int CCardIssuerFSM::IssueCard(SpReqAnsContext<CardIssuerService_Issue_Req, CardI
|
|
|
//Dbg("Move card from hopper to position failed(%d),(%s).",errCode,errMove.szErrMsg);
|
|
|
FSMSetIssueFlag(2);
|
|
|
if (ctx != NULL)
|
|
|
- ctx->Answer(Error_Unexpect, AlarmDECToBusiness(MEC_DEVAPI_CARDISSUER_CI_MOVECARD_FROM_HOPPER));
|
|
|
+ ctx->Answer(Error_Unexpect, AlarmDECToBusiness("IssueCard::MoveCard", errCode,MEC_DEVAPI_CARDISSUER_CI_MOVECARD_FROM_HOPPER));
|
|
|
else
|
|
|
- ctxEx->Answer(Error_Unexpect, AlarmDECToBusiness(MEC_DEVAPI_CARDISSUER_CI_MOVECARD_FROM_HOPPER));
|
|
|
+ ctxEx->Answer(Error_Unexpect, AlarmDECToBusiness("IssueCard::MoveCard", errCode, MEC_DEVAPI_CARDISSUER_CI_MOVECARD_FROM_HOPPER));
|
|
|
return 1;
|
|
|
}
|
|
|
Dbg("set issue data");
|
|
@@ -2799,7 +2808,7 @@ int CCardIssuerFSM::CaptureCard(SpReqAnsContext<CardIssuerService_Capture_Req,Ca
|
|
|
if (Error_Succeed == eErr){
|
|
|
eErr = m_pCardIssuer->SetCardInType(CI_CARD_IN_TYPE_FORBIDDEN);
|
|
|
if (eErr != Error_Succeed) {
|
|
|
- LogErrMsg("after capture,close shutter", eErr, MEC_DEVAPI_CARDISSUER_SetCardInType, TRUE);
|
|
|
+ AlarmDEC("after capture,close shutter", eErr, MEC_DEVAPI_CARDISSUER_SetCardInType);
|
|
|
}
|
|
|
if (ctx != NULL)
|
|
|
ctx->Answer(Error_Succeed);
|
|
@@ -2830,7 +2839,7 @@ int CCardIssuerFSM::EjectCard(SpReqAnsContext<CardIssuerService_Eject_Req,CardIs
|
|
|
if (Error_Succeed == eErr){
|
|
|
eErr = m_pCardIssuer->SetCardInType(CI_CARD_IN_TYPE_FORBIDDEN);
|
|
|
if (eErr != Error_Succeed) {
|
|
|
- LogErrMsg("EjectCard::SetCardInType(CI_CARD_IN_TYPE_FORBIDDEN)", eErr, MEC_DEVAPI_CARDISSUER_SetCardInType, TRUE);
|
|
|
+ AlarmDEC("EjectCard::SetCardInType(CI_CARD_IN_TYPE_FORBIDDEN)", eErr, MEC_DEVAPI_CARDISSUER_SetCardInType);
|
|
|
}
|
|
|
if (ctx != NULL)
|
|
|
ctx->Answer(Error_Succeed);
|
|
@@ -2841,7 +2850,7 @@ int CCardIssuerFSM::EjectCard(SpReqAnsContext<CardIssuerService_Eject_Req,CardIs
|
|
|
//m_pCardIssuer->GetLastErr(devErrInfo);
|
|
|
//Dbg("ejectcard err:%s",devErrInfo.szErrMsg);
|
|
|
if (ctx != NULL)
|
|
|
- ctx->Answer(Error_Exception, CardIssuer_UserErrorCode_MoveCardToGate_Failed);
|
|
|
+ ctx->Answer(Error_Exception, AlarmDECToBusiness("ReadCard::MachineMoveCardFrontGate", eErr,CardIssuer_UserErrorCode_MoveCardToGate_Failed));
|
|
|
//if (GetDevStatus())
|
|
|
// return 0;
|
|
|
//else
|
|
@@ -2885,6 +2894,7 @@ int CCardIssuerFSM::InternalAcceptCard()
|
|
|
DWORD64 dwStart = GetTickCountRVC();
|
|
|
DWORD64 dwEnd = dwStart;
|
|
|
m_bWaitingAccept = true;
|
|
|
+ bool bHasSetCardInType = false;
|
|
|
//if (Error_Succeed == hr){
|
|
|
do {
|
|
|
if (m_bExit)
|
|
@@ -2916,11 +2926,13 @@ int CCardIssuerFSM::InternalAcceptCard()
|
|
|
acceptTries++;
|
|
|
Sleep(ACCEPT_TRY_INTERVAL);
|
|
|
//hr = m_pIDCard->IDC_Accept(IDC_ALL_CARD,&lpCardData);
|
|
|
- if (!m_bCancelAccept)
|
|
|
+ if (!m_bCancelAccept && !bHasSetCardInType)
|
|
|
eErr = m_pCardIssuer->SetCardInType(CI_CARD_IN_TYPE_ALL);
|
|
|
if (Error_Succeed != eErr) {
|
|
|
- LogErrMsg("InternalAcceptCard::SetCardInType(CI_CARD_IN_TYPE_ALL)", eErr, MEC_DEVAPI_CARDISSUER_SetCardInType, TRUE);
|
|
|
+ AlarmDEC("InternalAcceptCard::SetCardInType(CI_CARD_IN_TYPE_ALL)", eErr, MEC_DEVAPI_CARDISSUER_SetCardInType);
|
|
|
}
|
|
|
+ else
|
|
|
+ bHasSetCardInType = true;
|
|
|
//LogErrInfo("err while accepting card,open shutter");
|
|
|
}
|
|
|
}
|
|
@@ -2939,7 +2951,7 @@ Err:
|
|
|
eErr = m_pCardIssuer->SetCardInType(CI_CARD_IN_TYPE_FORBIDDEN);
|
|
|
if (Error_Succeed != eErr)
|
|
|
{
|
|
|
- LogErrMsg("InternalAcceptCard::SetCardInType(CI_CARD_IN_TYPE_FORBIDDEN)", eErr, MEC_DEVAPI_CARDISSUER_SetCardInType, TRUE);
|
|
|
+ AlarmDEC("InternalAcceptCard::SetCardInType(CI_CARD_IN_TYPE_FORBIDDEN)", eErr, MEC_DEVAPI_CARDISSUER_SetCardInType);
|
|
|
//LogErrInfo("after accept,close shutter");
|
|
|
//LOG_TRACE("Close shuttle");
|
|
|
//err = 2;
|
|
@@ -2961,12 +2973,15 @@ Err:
|
|
|
if (Error_Succeed == eErr){
|
|
|
eErr = m_pCardIssuer->SetCardInType(CI_CARD_IN_TYPE_FORBIDDEN);
|
|
|
if (eErr != Error_Succeed) {
|
|
|
- LogErrMsg("InternalAcceptCard::SetCardInType(CI_CARD_IN_TYPE_FORBIDDEN)", eErr, MEC_DEVAPI_CARDISSUER_SetCardInType, TRUE);
|
|
|
+ AlarmDEC("InternalAcceptCard::SetCardInType(CI_CARD_IN_TYPE_FORBIDDEN)", eErr, MEC_DEVAPI_CARDISSUER_SetCardInType);
|
|
|
}
|
|
|
//LogErrInfo("cancel&else eject,close shutter");
|
|
|
}
|
|
|
else
|
|
|
+ {
|
|
|
+ AlarmDECToBusiness("InternalAcceptCard::MachineMoveCardFrontGate", eErr, CardIssuer_UserErrorCode_MoveCardToGate_Failed);
|
|
|
err = 2;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
else
|
|
@@ -3017,7 +3032,7 @@ int CCardIssuerFSM::AcceptCard(SpReqAnsContext<CardIssuerService_Insert_Req, Car
|
|
|
}else
|
|
|
{
|
|
|
if (ctx != NULL)
|
|
|
- ctx->Answer(Error_Unexpect, AlarmDECToBusiness(MEC_DEVAPI_CARDISSUER_GetDevStatus));
|
|
|
+ ctx->Answer(Error_Unexpect, AlarmDECToBusiness("AcceptCard:", Error_Unexpect,MEC_DEVAPI_CARDISSUER_GetDevStatus));
|
|
|
}
|
|
|
return rc;
|
|
|
}
|
|
@@ -3303,7 +3318,7 @@ int CCardIssuerFSM::ReadCard(SpReqAnsContext<CardIssuerService_Read_Req,CardIssu
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- LogErrMsg("ReadCard::MagRead", eErr, MEC_DEVAPI_CARDISSUER_MagRead, TRUE);
|
|
|
+ AlarmDEC("ReadCard::MagRead", eErr, MEC_DEVAPI_CARDISSUER_MagRead);
|
|
|
//LogWarn(Severity_Low, Error_DevCommFailed, CardIssuer_UserErrorCode_ReadMagTrack_Failed, "CardIssuer read failed.");
|
|
|
/*DevErrorInfo devErrInfo;
|
|
|
m_pCardIssuer->GetLastErr(devErrInfo);*/
|
|
@@ -3341,6 +3356,8 @@ int CCardIssuerFSM::ReadCard(SpReqAnsContext<CardIssuerService_Read_Req,CardIssu
|
|
|
Dbg("read failed.eject self");
|
|
|
bEjectSelf = true;
|
|
|
}
|
|
|
+ else
|
|
|
+ AlarmDECToBusiness("ReadCard::MachineMoveCardFrontGate", errEject, CardIssuer_UserErrorCode_MoveCardToGate_Failed);
|
|
|
}
|
|
|
}
|
|
|
if (GetDevStatus())
|
|
@@ -3368,10 +3385,10 @@ int CCardIssuerFSM::WriteCard(SpReqAnsContext<CardIssuerService_WriteTrack_Req,C
|
|
|
eErr = m_pCardIssuer->MoveCard(CI_MOVECARD_MAG_POSITION);
|
|
|
if (eErr != Error_Succeed)
|
|
|
{
|
|
|
- LogErrMsg("WriteCard::MoveCard", eErr, MEC_DEVAPI_CARDISSUER_CI_MOVECARD_MAG_POSITION, TRUE);
|
|
|
+ //LogErrMsg("WriteCard::MoveCard", eErr, MEC_DEVAPI_CARDISSUER_CI_MOVECARD_MAG_POSITION, TRUE);
|
|
|
//LogWarn(Severity_Middle, Error_Unexpect, CardIssuer_UserErrorCode_MoveCardToMagPosition_Failed, "移动卡片到磁卡位失败");
|
|
|
//Dbg("move card to mag position failed.");
|
|
|
- ctx->Answer(Error_Unexpect, AlarmDECToBusiness(MEC_DEVAPI_CARDISSUER_CI_MOVECARD_MAG_POSITION));
|
|
|
+ ctx->Answer(Error_Unexpect, AlarmDECToBusiness("WriteCard::MoveCard",eErr,MEC_DEVAPI_CARDISSUER_CI_MOVECARD_MAG_POSITION));
|
|
|
return ret;
|
|
|
}
|
|
|
}
|
|
@@ -3418,7 +3435,7 @@ int CCardIssuerFSM::WriteCard(SpReqAnsContext<CardIssuerService_WriteTrack_Req,C
|
|
|
Dbg("after write %d",eErr);
|
|
|
if (eErr != Error_Succeed)
|
|
|
{
|
|
|
- LogErrMsg("WriteCard::MagWrite", eErr, MEC_DEVAPI_CARDISSUER_MagWrite, TRUE);
|
|
|
+ AlarmDEC("WriteCard::MagWrite", eErr, MEC_DEVAPI_CARDISSUER_MagWrite);
|
|
|
//LogWarn(Severity_Middle, Error_Unexpect, CardIssuer_UserErrorCode_WriteMagTrack_Failed, "写磁卡失败");
|
|
|
//Dbg("MagWrite failed(%d).",eErr);
|
|
|
//LogDevErrorInfo();
|
|
@@ -3443,7 +3460,7 @@ int CCardIssuerFSM::PreOnline(SpReqAnsContext<CardIssuerService_PreOnline_Req,Ca
|
|
|
if(eErr != Error_Succeed)
|
|
|
{
|
|
|
Dbg("Open runcfg failed(%d).", eErr);
|
|
|
- ctx->Answer(Error_Unexpect, AlarmDECToBusiness(MEC_CFG_RUN_POINTER_FAILED));
|
|
|
+ ctx->Answer(Error_Unexpect, AlarmDECToBusiness("Open runcfg failed",eErr,MEC_CFG_RUN_POINTER_FAILED));
|
|
|
return 2;
|
|
|
}
|
|
|
if(CheckHasPanKuRecord(spConfigRun))
|
|
@@ -3534,7 +3551,7 @@ int CCardIssuerFSM::PreOnline(SpReqAnsContext<CardIssuerService_PreOnline_Req,Ca
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- LogErrMsg("PreOnline::MoveCardFromSlot", eErr, MEC_DEVAPI_CARDISSUER_MoveCardFromSlot, TRUE);
|
|
|
+ AlarmDEC("PreOnline::MoveCardFromSlot", eErr, MEC_DEVAPI_CARDISSUER_MoveCardFromSlot);
|
|
|
//Dbg("move card from slot failed.ret:%d",eErr);
|
|
|
m_findCard = 4;
|
|
|
AfterPreOnlineOnStore(Error_Unexpect, slot);
|
|
@@ -3578,9 +3595,9 @@ int CCardIssuerFSM::PreOnline(SpReqAnsContext<CardIssuerService_PreOnline_Req,Ca
|
|
|
&& bCrossPreOnline)
|
|
|
AfterPreOnlineOnStore(Error_Unexpect, slot);
|
|
|
if (retDetectAndRead == -1)
|
|
|
- ctx->Answer(Error_Unexpect, AlarmDECToBusiness(MEC_DEVAPI_CARDISSUER_ActiveICCard));
|
|
|
+ ctx->Answer(Error_Unexpect, AlarmDECToBusiness("PreOnline:", Error_Unexpect,MEC_DEVAPI_CARDISSUER_ActiveICCard));
|
|
|
else if (retDetectAndRead == -2)
|
|
|
- ctx->Answer(Error_Unexpect, AlarmDECToBusiness(MEC_DEVAPI_CARDISSUER_ICCommand));
|
|
|
+ ctx->Answer(Error_Unexpect, AlarmDECToBusiness("PreOnline:", Error_Unexpect, MEC_DEVAPI_CARDISSUER_ICCommand));
|
|
|
return 0;
|
|
|
}
|
|
|
//if (m_cardType == CI_CARDTYPE_IC)
|
|
@@ -4055,7 +4072,7 @@ ErrorCodeEnum CCardIssuerFSM::MachineMoveCardBackNotHold()
|
|
|
//2016-11-10 14:30:54 joseph
|
|
|
if (eMoveNotHold != Error_Succeed)
|
|
|
{
|
|
|
- LogErrMsg("MachineMoveCardBackNotHold", eMoveNotHold, MEC_DEVAPI_CARDISSUER_CI_MOVECARD_BACK_NOT_HOLD, TRUE);
|
|
|
+ AlarmDEC("MachineMoveCardBackNotHold", eMoveNotHold, MEC_DEVAPI_CARDISSUER_CI_MOVECARD_BACK_NOT_HOLD);
|
|
|
//LogWarn(Severity_Middle, Error_Unexpect, CardIssuer_UserErrorCode_CaptureCard_Failed, "吞卡失败");
|
|
|
//DevErrorInfo devErrInfo;
|
|
|
//ErrorCodeEnum err = m_pCardIssuer->GetLastErr(devErrInfo);
|
|
@@ -4100,8 +4117,8 @@ ErrorCodeEnum CCardIssuerFSM::MachineMoveCardFrontGate()
|
|
|
{
|
|
|
LOG_FUNCTION();
|
|
|
ErrorCodeEnum eMoveFrontGate = m_pCardIssuer->MoveCard(CI_MOVECARD_FRONT_GATE);
|
|
|
- if (eMoveFrontGate != Error_Succeed)
|
|
|
- LogWarn(Severity_Middle, Error_Unexpect, CardIssuer_UserErrorCode_MoveCardToGate_Failed, "吐卡失败");
|
|
|
+ //if (eMoveFrontGate != Error_Succeed)
|
|
|
+ // LogWarn(Severity_Middle, Error_Unexpect, CardIssuer_UserErrorCode_MoveCardToGate_Failed, "吐卡失败");
|
|
|
return eMoveFrontGate;
|
|
|
}
|
|
|
int CCardIssuerFSM::QueryCardInfo()
|
|
@@ -4473,7 +4490,7 @@ int CCardIssuerFSM::OpenSafeLock(SpReqAnsContext<CardIssuerService_OpenSafeLock_
|
|
|
//ramData.data[3] = 0x84;
|
|
|
if (eErr != Error_Succeed)
|
|
|
{
|
|
|
- LogErrMsg("OpenSafeLock:SL_GetTempData ", eErr, MEC_DEVAPI_CARDISSUER_SLGetTempData, TRUE);
|
|
|
+ AlarmDEC("OpenSafeLock:SL_GetTempData ", eErr, MEC_DEVAPI_CARDISSUER_SLGetTempData);
|
|
|
Dbg("SLGetTempData failed.%d",eErr);
|
|
|
}
|
|
|
Dbg("Get temp data ok %d,%d.",ksnData.dwSize,ramData.dwSize);
|
|
@@ -4515,7 +4532,7 @@ int CCardIssuerFSM::OpenSafeLock(SpReqAnsContext<CardIssuerService_OpenSafeLock_
|
|
|
eErr = m_pCardIssuer->SLOpenDoor(enData);
|
|
|
if (eErr != Error_Succeed)
|
|
|
{
|
|
|
- LogErrMsg("OpenSafeLock:SLOpenDoor ", eErr, MEC_DEVAPI_CARDISSUER_SLOpenDoor, TRUE);
|
|
|
+ AlarmDEC("OpenSafeLock:SLOpenDoor ", eErr, MEC_DEVAPI_CARDISSUER_SLOpenDoor);
|
|
|
Dbg("SLOpenDoor failed.%d", eErr);
|
|
|
}
|
|
|
else
|
|
@@ -4534,7 +4551,7 @@ int CCardIssuerFSM::OpenSafeLock(SpReqAnsContext<CardIssuerService_OpenSafeLock_
|
|
|
if (bOpenSuc)
|
|
|
ctx->Answer(Error_Succeed);
|
|
|
else
|
|
|
- ctx->Answer(Error_Unexpect, AlarmDECToBusiness(MEC_DEVAPI_CARDISSUER_SLOpenDoor));
|
|
|
+ ctx->Answer(Error_Unexpect, AlarmDECToBusiness("SLOpenDoor", eErr,MEC_DEVAPI_CARDISSUER_SLOpenDoor));
|
|
|
}
|
|
|
return 0;
|
|
|
}
|
|
@@ -4735,7 +4752,7 @@ int CCardIssuerFSM::BluetoothCheck()
|
|
|
count++;
|
|
|
if (count >= 2)
|
|
|
{
|
|
|
- LogWarn(Severity_High, Error_DevConnFailed, AlarmDEC(DEC_DEV_DISCONNECTED), "CardIssuer(SCI) device disconnecetd.");
|
|
|
+ LogWarn(Severity_High, Error_DevConnFailed, GetAlarmDEC(DEC_DEV_DISCONNECTED), "CardIssuer(SCI) device disconnecetd.");
|
|
|
m_bBTConnected = false;
|
|
|
Dbg("DevClose returned %d", m_pCardIssuer->DevClose());
|
|
|
count = 0;
|
|
@@ -4843,7 +4860,7 @@ bool CCardIssuerFSM::JustReadCardNo()
|
|
|
}
|
|
|
}
|
|
|
else {
|
|
|
- LogErrMsg("JustReadCardNo::MagRead", eErr, MEC_DEVAPI_CARDISSUER_MagRead, TRUE);
|
|
|
+ AlarmDEC("JustReadCardNo::MagRead", eErr, MEC_DEVAPI_CARDISSUER_MagRead);
|
|
|
}
|
|
|
}
|
|
|
if (m_currCardNo.GetLength() > 8)
|
|
@@ -4959,25 +4976,25 @@ int CCardIssuerFSM::SAMICCommand(SpReqAnsContext<CardIssuerService_SAMICCommand_
|
|
|
case SAMICCommand_SAM_Select:
|
|
|
eErr = m_pCardIssuer->SAMSelect(ctx->Req.param1[0]);
|
|
|
if(eErr) {
|
|
|
- LogErrMsg("SAMICCommand::SAMSelect", eErr, MEC_DEVAPI_CARDISSUER_SAMSelect, TRUE);
|
|
|
+ AlarmDEC("SAMICCommand::SAMSelect", eErr, MEC_DEVAPI_CARDISSUER_SAMSelect);
|
|
|
}
|
|
|
break;
|
|
|
case SAMICCommand_SAM_Active:
|
|
|
eErr = m_pCardIssuer->SAMActive(ctx->Req.param1[0]);
|
|
|
if(eErr) {
|
|
|
- LogErrMsg("SAMICCommand::SAMActive", eErr, MEC_DEVAPI_CARDISSUER_SAMActive, TRUE);
|
|
|
+ AlarmDEC("SAMICCommand::SAMActive", eErr, MEC_DEVAPI_CARDISSUER_SAMActive);
|
|
|
}
|
|
|
break;
|
|
|
case SAMICCommand_SAM_Deactivate:
|
|
|
eErr = m_pCardIssuer->SAMDeactivate();
|
|
|
if(eErr) {
|
|
|
- LogErrMsg("SAMICCommand::SAMDeactivate", eErr, MEC_DEVAPI_CARDISSUER_SAMDeactivate, TRUE);
|
|
|
+ AlarmDEC("SAMICCommand::SAMDeactivate", eErr, MEC_DEVAPI_CARDISSUER_SAMDeactivate);
|
|
|
}
|
|
|
break;
|
|
|
case SAMICCommand_SAM_WarmReset:
|
|
|
eErr = m_pCardIssuer->SAMWarmReset();
|
|
|
if(eErr) {
|
|
|
- LogErrMsg("SAMICCommand::SAMWarmReset", eErr, MEC_DEVAPI_CARDISSUER_SAMWarmReset, TRUE);
|
|
|
+ AlarmDEC("SAMICCommand::SAMWarmReset", eErr, MEC_DEVAPI_CARDISSUER_SAMWarmReset);
|
|
|
}
|
|
|
break;
|
|
|
case SAMICCommand_SAM_QueryStatus:
|
|
@@ -4992,7 +5009,7 @@ int CCardIssuerFSM::SAMICCommand(SpReqAnsContext<CardIssuerService_SAMICCommand_
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- LogErrMsg("SAMICCommand::SAMQueryStatus", eErr, MEC_DEVAPI_CARDISSUER_SAMQueryStatus, TRUE);
|
|
|
+ AlarmDEC("SAMICCommand::SAMQueryStatus", eErr, MEC_DEVAPI_CARDISSUER_SAMQueryStatus);
|
|
|
}
|
|
|
}
|
|
|
break;
|
|
@@ -5020,7 +5037,7 @@ int CCardIssuerFSM::SAMICCommand(SpReqAnsContext<CardIssuerService_SAMICCommand_
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- LogErrMsg("SAMICCommand::SAMCommand", eErr, MEC_DEVAPI_CARDISSUER_SAMCommand, TRUE);
|
|
|
+ AlarmDEC("SAMICCommand::SAMCommand", eErr, MEC_DEVAPI_CARDISSUER_SAMCommand);
|
|
|
}
|
|
|
delete[]pTmp;
|
|
|
}
|
|
@@ -5060,7 +5077,7 @@ int CCardIssuerFSM::SAMICCommand(SpReqAnsContext<CardIssuerService_SAMICCommand_
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- LogErrMsg("SAMICCommand::ContactIC", eErr, MEC_DEVAPI_CARDISSUER_ContactIC, TRUE);
|
|
|
+ AlarmDEC("SAMICCommand::ContactIC", eErr, MEC_DEVAPI_CARDISSUER_ContactIC);
|
|
|
}
|
|
|
}
|
|
|
break;
|
|
@@ -5111,7 +5128,7 @@ int CCardIssuerFSM::SAMICCommand(SpReqAnsContext<CardIssuerService_SAMICCommand_
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- LogErrMsg("IC Channel(APDU) failed.",Error_Unexpect, CardIssuer_UserErrorCode_ICChannel_Failed);
|
|
|
+ AlarmDEC("IC Channel(APDU) failed.",Error_Unexpect, CardIssuer_UserErrorCode_ICChannel_Failed);
|
|
|
Dbg("ICCommand failed:%d", eErr);
|
|
|
}
|
|
|
delete[]pTmp;
|
|
@@ -5129,7 +5146,7 @@ int CCardIssuerFSM::SAMICCommand(SpReqAnsContext<CardIssuerService_SAMICCommand_
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- LogErrMsg("SAMICCommand::ActiveContactlessICCard", eErr, MEC_DEVAPI_CARDISSUER_ActiveContactlessICCard, TRUE);
|
|
|
+ AlarmDEC("SAMICCommand::ActiveContactlessICCard", eErr, MEC_DEVAPI_CARDISSUER_ActiveContactlessICCard);
|
|
|
}
|
|
|
}
|
|
|
break;
|
|
@@ -5307,8 +5324,7 @@ int CCardIssuerFSM::Print(SpReqAnsContext<CardIssuerService_Print_Req, CardIssue
|
|
|
//{
|
|
|
// Dbg("Print failed.%s", devErrInfo.szErrMsg);
|
|
|
//}
|
|
|
- LogErrMsg("Print::Print", eErr, MEC_DEVAPI_CARDISSUER_Print, TRUE);
|
|
|
- ctx->Answer(eErr);
|
|
|
+ ctx->Answer(eErr,AlarmDECToBusiness("Print:",eErr, MEC_DEVAPI_CARDISSUER_Print));
|
|
|
}
|
|
|
ctx->Answer(Error_Succeed);
|
|
|
}
|
|
@@ -6306,14 +6322,14 @@ int CCardIssuerFSM::IssueCardFromStore(SpReqAnsContext<CardIssuerService_IssueEx
|
|
|
eErr = m_pCardIssuer->SetCardInType(CI_CARD_IN_TYPE_FORBIDDEN);
|
|
|
if(eErr != Error_Succeed) {
|
|
|
//LogErrInfo("after capture,close shutter");
|
|
|
- LogErrMsg("IssueCardFromStore::SetCardInType", eErr, MEC_DEVAPI_CARDISSUER_SetCardInType, TRUE);
|
|
|
+ AlarmDEC("IssueCardFromStore::SetCardInType", eErr, MEC_DEVAPI_CARDISSUER_SetCardInType);
|
|
|
}
|
|
|
if(ctx != NULL)
|
|
|
ctx->Answer(Error_Succeed);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- LogErrMsg("IssueCardFromStore::MachineMoveCardBackNotHold", eErr, CardIssuer_UserErrorCode_CaptureCard_Failed, TRUE);
|
|
|
+ AlarmDEC("IssueCardFromStore::MachineMoveCardBackNotHold", eErr, CardIssuer_UserErrorCode_CaptureCard_Failed);
|
|
|
//DevErrorInfo devErrInfo;
|
|
|
//m_pCardIssuer->GetLastErr(devErrInfo);
|
|
|
//Dbg("capture err %s",devErrInfo.szErrMsg);
|
|
@@ -6358,8 +6374,8 @@ int CCardIssuerFSM::IssueCardFromStore(SpReqAnsContext<CardIssuerService_IssueEx
|
|
|
else
|
|
|
{
|
|
|
//Dbg("MoveCardFromSlot failed.%d",eErr);
|
|
|
- LogErrMsg("IssueCardFromStore::MoveCardFromSlot", eErr, MEC_DEVAPI_CARDISSUER_MoveCardFromSlot, TRUE);
|
|
|
- ctx->Answer(Error_Unexpect);
|
|
|
+ ctx->Answer(Error_Unexpect, AlarmDECToBusiness("IssueCardFromStore::MoveCardFromSlot", eErr
|
|
|
+ , MEC_DEVAPI_CARDISSUER_MoveCardFromSlot));
|
|
|
return 2;
|
|
|
}
|
|
|
return 0;
|
|
@@ -6499,11 +6515,11 @@ int CCardIssuerFSM::AddCardToStoreStepLast(SpReqAnsContext<CardIssuerService_Iss
|
|
|
else
|
|
|
{
|
|
|
Dbg("move card to slot failed.to capture card.");
|
|
|
- LogErrMsg("AddCardToStoreStepLast::MoveCardToSlot", eErr, MEC_DEVAPI_CARDISSUER_MoveCardToSlot, TRUE,TRUE);
|
|
|
ctx->Ans.reserved1[2] = 2;
|
|
|
RegistCardWhileCaptureCard();
|
|
|
MachineMoveCardBackNotHold();
|
|
|
- ctx->Answer(Error_Succeed);
|
|
|
+ ctx->Answer(Error_Succeed,AlarmDECToBusiness("AddCardToStoreStepLast::MoveCardToSlot"
|
|
|
+ , eErr, MEC_DEVAPI_CARDISSUER_MoveCardToSlot));
|
|
|
return 2;
|
|
|
}
|
|
|
ctx->Answer(Error_Succeed);
|
|
@@ -6516,7 +6532,7 @@ int CCardIssuerFSM::FindFirstEmptySlot()
|
|
|
ErrorCodeEnum eErr = m_pCardIssuer->QuerySlotsStatus(status, 0,true);
|
|
|
if (eErr != Error_Succeed)
|
|
|
{
|
|
|
- LogErrMsg("FindFirstEmptySlot::QuerySlotsStatus", eErr, MEC_DEVAPI_CARDISSUER_QuerySlotsStatus, TRUE);
|
|
|
+ AlarmDEC("FindFirstEmptySlot::QuerySlotsStatus", eErr, MEC_DEVAPI_CARDISSUER_QuerySlotsStatus);
|
|
|
return -1;
|
|
|
}
|
|
|
for (int i = 0; i < status.dwSize; i++)
|
|
@@ -6571,7 +6587,7 @@ void CCardIssuerFSM::AfterPreOnlineOnStore(ErrorCodeEnum err, const int slot)
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- LogErrMsg("GetDevStatus::AfterPreOnlineOnStore", eErr, MEC_DEVAPI_CARDISSUER_MoveCardToSlot, TRUE);
|
|
|
+ AlarmDECToBusiness("GetDevStatus::AfterPreOnlineOnStore", eErr, MEC_DEVAPI_CARDISSUER_MoveCardToSlot);
|
|
|
//Dbg("move card back to slot failed.%d",eErr);
|
|
|
RegistCardWhileCaptureCard();
|
|
|
eErr = MachineMoveCardBackNotHold();
|
|
@@ -6649,7 +6665,7 @@ bool CCardIssuerFSM::OperateCardStore(CSmartPointer<IConfigInfo> &spConfigRun, i
|
|
|
}
|
|
|
if(!bDataOK)
|
|
|
{
|
|
|
- LogErrMsg("OperateCardStore::ReadAccount", eErr, MEC_DEVAPI_CARDISSUER_ReadAccount, TRUE);
|
|
|
+ AlarmDECToBusiness("OperateCardStore::ReadAccount", eErr, MEC_DEVAPI_CARDISSUER_ReadAccount);
|
|
|
//m_pCardIssuer->GetLastErr(devErrorInfo);
|
|
|
//Dbg("read card(slot %d) info failed: %s(%d).", slot, devErrorInfo.szErrMsg, eErr);
|
|
|
Dbg("capture card...");
|
|
@@ -6677,7 +6693,7 @@ bool CCardIssuerFSM::OperateCardStore(CSmartPointer<IConfigInfo> &spConfigRun, i
|
|
|
else
|
|
|
{
|
|
|
//移回卡槽不成功,登记并吞卡
|
|
|
- LogErrMsg("OperateCardStore::MoveCardToSlot", eErr, MEC_DEVAPI_CARDISSUER_MoveCardToSlot, TRUE);
|
|
|
+ AlarmDECToBusiness("OperateCardStore::MoveCardToSlot", eErr, MEC_DEVAPI_CARDISSUER_MoveCardToSlot);
|
|
|
//m_pCardIssuer->GetLastErr(devErrorInfo);
|
|
|
//Dbg("move card to slot(%d) failed: %s(%d).", slot, devErrorInfo.szErrMsg, eErr);
|
|
|
Dbg("capture card...");
|
|
@@ -6691,7 +6707,7 @@ bool CCardIssuerFSM::OperateCardStore(CSmartPointer<IConfigInfo> &spConfigRun, i
|
|
|
{
|
|
|
//m_pCardIssuer->GetLastErr(devErrorInfo);
|
|
|
Dbg("move card from slot(%d) to cardreader failed!", slot);
|
|
|
- LogErrMsg("OperateCardStore::MoveCardFromSlot", eErr, MEC_DEVAPI_CARDISSUER_MoveCardFromSlot, TRUE);
|
|
|
+ AlarmDECToBusiness("OperateCardStore::MoveCardFromSlot", eErr, MEC_DEVAPI_CARDISSUER_MoveCardFromSlot);
|
|
|
status = 1;
|
|
|
}
|
|
|
return false;
|
|
@@ -6742,10 +6758,9 @@ int CCardIssuerFSM::QueryCardInfoOnStore(SpReqAnsContext<CardIssuerService_Query
|
|
|
eErr = m_pCardIssuer->QuerySlotsStatus(slotstatus, 0, true);
|
|
|
if(eErr != Error_Succeed)
|
|
|
{
|
|
|
- LogErrMsg("QueryCardInfoOnStore::QuerySlotsStatus", eErr, MEC_DEVAPI_CARDISSUER_QuerySlotsStatus, TRUE);
|
|
|
//m_pCardIssuer->GetLastErr(devErrorInfo);
|
|
|
//Dbg("query slots status failed: %s(%d).", devErrorInfo.szErrMsg, eErr);
|
|
|
- ctx->Answer(Error_Unexpect,AlarmDECToBusiness(MEC_DEVAPI_CARDISSUER_QuerySlotsStatus));
|
|
|
+ ctx->Answer(Error_Unexpect,AlarmDECToBusiness("QueryCardInfoOnStore::QuerySlotsStatus", eErr,MEC_DEVAPI_CARDISSUER_QuerySlotsStatus));
|
|
|
return 2;
|
|
|
}
|
|
|
spConfigRun->WriteConfigValueInt("OperateCardStore", "OperationFlag", 1);//设置盘库标志
|
|
@@ -7006,7 +7021,7 @@ void CCardIssuerFSM::GetAddCardInfo(SpReqAnsContext<CardIssuerService_GetAddCard
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- LogErrMsg("GetAddCardInfo::QuerySlotsStatus", eErr, MEC_DEVAPI_CARDISSUER_QuerySlotsStatus, TRUE);
|
|
|
+ AlarmDECToBusiness("GetAddCardInfo::QuerySlotsStatus", eErr, MEC_DEVAPI_CARDISSUER_QuerySlotsStatus);
|
|
|
//m_pCardIssuer->GetLastErr(devErrInfo);
|
|
|
//Dbg("Query slot status failed: %s(%d).", devErrInfo.szErrMsg, eErr);
|
|
|
}
|
|
@@ -7132,28 +7147,13 @@ void CCardIssuerFSM::CloseAndClearDevObj(bool bCheckConnecting, bool bCloseOnly)
|
|
|
}
|
|
|
|
|
|
void CCardIssuerFSM::LogErrMsg(
|
|
|
- const char *pMsgHead, ErrorCodeEnum eErrCode, DWORD defaultDevCode /*= 0*/, BOOL bAlarm /*= FALSE*/,BOOL bError /*= FALSE*/)
|
|
|
-{
|
|
|
- WORD wdErrCode = 0;
|
|
|
- CSimpleStringA csErrMsg(true);
|
|
|
- ErrorCodeEnum ec = DeviceBaseHelper::GetAndSplitDevErrInfo(m_pCardIssuer, csErrMsg, wdErrCode,
|
|
|
- bAlarm ? NULL : pMsgHead);
|
|
|
- if(ec == Error_Succeed && wdErrCode != 0) {
|
|
|
- //oilyang@20200525 if have been set ErrorCode of entity defined (not device),use it directly
|
|
|
- if ((defaultDevCode >> 20) == m_entCode.dwEntityId)
|
|
|
- UpdateDEC(defaultDevCode);
|
|
|
- else
|
|
|
- UpdateDEC(wdErrCode);
|
|
|
- } else if(defaultDevCode != 0) {
|
|
|
- UpdateDEC(defaultDevCode);
|
|
|
- }
|
|
|
- m_csAlarmMsg = CSimpleStringA::Format("(%s)%s failed EC= 0x%x : %s", (LPCTSTR)m_csDevSN, pMsgHead, eErrCode, (LPCTSTR)csErrMsg);
|
|
|
- if(bAlarm) {
|
|
|
- if (bError)
|
|
|
- LogWarn(Severity_High, eErrCode, AlarmDECToBusiness(), (LPCTSTR)m_csAlarmMsg);
|
|
|
- else
|
|
|
- LogWarn(Severity_High, eErrCode, AlarmDEC(), (LPCTSTR)m_csAlarmMsg);
|
|
|
- }
|
|
|
+ const char *pMsgHead, ErrorCodeEnum eErrCode, const char* pMsgBody, DWORD finalErrCode /*= 0*/, BOOL bAlarm /*= FALSE*/,BOOL bError /*= FALSE*/)
|
|
|
+{
|
|
|
+ m_csAlarmMsg = CSimpleStringA::Format("(%s)%s failed EC= 0x%x : %s", (LPCTSTR)m_csDevSN, pMsgHead, eErrCode, pMsgBody);
|
|
|
+ if(bAlarm)
|
|
|
+ LogWarn(Severity_High, eErrCode, finalErrCode, (LPCTSTR)m_csAlarmMsg);
|
|
|
+ if (bError)
|
|
|
+ LogError(Severity_High, eErrCode, finalErrCode, (LPCTSTR)m_csAlarmMsg);
|
|
|
return;
|
|
|
}
|
|
|
int CCardIssuerFSM::PrintCardIm(SpReqAnsContext<CardIssuerService_PrintCardImmediately_Req, CardIssuerService_PrintCardImmediately_Ans>::Pointer ctx)
|
|
@@ -7174,7 +7174,7 @@ int CCardIssuerFSM::PrintCardIm(SpReqAnsContext<CardIssuerService_PrintCardImmed
|
|
|
eErr = m_pCardIssuer->PrintCardFaceRightNow(kakuInfo);
|
|
|
if (eErr != Error_Succeed)
|
|
|
{
|
|
|
- LogErrMsg("PrintCardFaceRightNow::", eErr, MEC_DEVAPI_CARDISSUER_PrintCardFaceRightNow, TRUE);
|
|
|
+ AlarmDECToBusiness("PrintCardFaceRightNow::", eErr, MEC_DEVAPI_CARDISSUER_PrintCardFaceRightNow);
|
|
|
ret = 1;
|
|
|
}
|
|
|
ctx->Ans.ret = ret;
|