// mod_cardissuer.cpp : Defines the exported functions for the DLL application. // #include "stdafx.h" #pragma once #include "SpBase.h" #include "mod_cardissuer.h" #include "CardIssuerClass.h" void CardIssuerStoreServerSession::Handle_Read(SpReqAnsContext::Pointer ctx) { //卡库暂时读卡功能不使用 LOG_FUNCTION(); DbgToBeidou(ctx->link, __FUNCTION__)(); DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Read"); m_pEntity->Read(ctx); } void CardIssuerStoreServerSession::Handle_Capture(SpReqAnsContext::Pointer ctx) { LOG_FUNCTION(); DbgToBeidou(ctx->link, __FUNCTION__)(); DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Capture"); m_pEntity->Capture(ctx); } void CardIssuerStoreServerSession::Handle_Eject(SpReqAnsContext::Pointer ctx) { LOG_FUNCTION(); DbgToBeidou(ctx->link, __FUNCTION__)(); DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke Eject"); m_pEntity->Eject(ctx); } void CardIssuerStoreServerSession::Handle_PreOnline(SpReqAnsContext::Pointer ctx) { LOG_FUNCTION(); DbgToBeidou(ctx->link, __FUNCTION__)(); DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("PreOnline"); m_pEntity->PreOnline(ctx); } void CardIssuerStoreServerSession::Handle_PostOnline(SpReqAnsContext::Pointer ctx) { LOG_FUNCTION(); DbgToBeidou(ctx->link, __FUNCTION__)(); DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("PostOnline"); m_pEntity->PostOnline(ctx); } void CardIssuerStoreServerSession::Handle_Exit(SpOnewayCallContext::Pointer ctx) { LOG_FUNCTION(); DbgToBeidou(ctx->link, __FUNCTION__)(); DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Exit"); m_pEntity->Exit(ctx); } void CardIssuerStoreServerSession::Handle_SetIssueFlag(SpOnewayCallContext::Pointer ctx) { LOG_FUNCTION(); DbgToBeidou(ctx->link, __FUNCTION__)(); DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("SetIssueFlag"); m_pEntity->SetIssueFlag(ctx); } void CardIssuerStoreServerSession::Handle_QueryCardInfo(SpReqAnsContext::Pointer ctx) { LOG_FUNCTION(); DbgToBeidou(ctx->link, __FUNCTION__)(); DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("QueryCardInfo"); m_pEntity->QueryCardInfo(ctx); } void CardIssuerStoreServerSession::Handle_WriteTrack(SpReqAnsContext::Pointer ctx) { LOG_FUNCTION(); DbgToBeidou(ctx->link, __FUNCTION__)(); DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("WriteTrack"); m_pEntity->WriteTrack(ctx); } void CardIssuerStoreServerSession::Handle_GetMaterialCountEx(SpReqAnsContext::Pointer ctx) { LOG_FUNCTION(); DbgToBeidou(ctx->link, __FUNCTION__)(); DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("GetMaterialCountEx"); m_pEntity->GetMaterialCountEx(ctx); } void CardIssuerStoreServerSession::Handle_SetMaterialCountEx(SpReqAnsContext::Pointer ctx) { LOG_FUNCTION(); DbgToBeidou(ctx->link, __FUNCTION__)(); DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("SetMaterialCountEx"); m_pEntity->SetMaterialCountEx(ctx); } void CardIssuerStoreServerSession::Handle_SetSomeFlag(SpReqAnsContext::Pointer ctx) { LOG_FUNCTION(); DbgToBeidou(ctx->link, __FUNCTION__)(); DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("SetSomeFlag,Req.IssueBusiness:%d", ctx->Req.IssueBusiness); m_pEntity->SetSomeFlag(ctx); } void CardIssuerStoreServerSession::Handle_IssueEx(SpReqAnsContext::Pointer ctx) { LOG_FUNCTION(); DbgToBeidou(ctx->link, __FUNCTION__)(); DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("IssueEx,req.hopper:%d", ctx->Req.hopper); m_pEntity->IssueEx(ctx); } void CardIssuerStoreServerSession::Handle_SAMICCommand(SpReqAnsContext::Pointer ctx) { DbgToBeidou(ctx->link, __FUNCTION__)(); DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("SAMICCommand"); m_pEntity->SAMICCommand(ctx); } void CardIssuerStoreServerSession::Handle_QueryCardInfoOnStore(SpReqAnsContext::Pointer ctx) { LOG_FUNCTION(); DbgToBeidou(ctx->link, __FUNCTION__)(); DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("QueryCardInfoOnStore"); m_pEntity->QueryCardInfoOnStore(ctx); } void CardIssuerStoreServerSession::Handle_GetAddCardInfo(SpReqAnsContext::Pointer ctx) { LOG_FUNCTION(); DbgToBeidou(ctx->link, __FUNCTION__)(); DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("GetAddCardInfo"); m_pEntity->GetAddCardInfo(ctx); } void CardIssuerStoreServerSession::Handle_PrintCardImmediately(SpReqAnsContext::Pointer ctx) { LOG_FUNCTION(); DbgToBeidou(ctx->link, __FUNCTION__)(); DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("PrintCardImmediately"); m_pEntity->PrintCardImmediately(ctx); } void CardIssuerStoreServerSession::Handle_QueryCIStatus(SpReqAnsContext::Pointer ctx) { LOG_FUNCTION(); DbgToBeidou(ctx->link, __FUNCTION__)(); DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("QueryCIStatus"); m_pEntity->QueryCIStatus(ctx); } void CardIssuerStoreServerSession::Handle_GetDevInfo(SpReqAnsContext::Pointer ctx) { LOG_FUNCTION(); DbgToBeidou(ctx->link, __FUNCTION__)(); DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("GetDevInfo"); m_pEntity->GetDevInfo(ctx); } #pragma region JS接口实现 //吐卡 void CardIssuerStoreServerSession::Handle_EjectJS(SpReqAnsContext::Pointer ctx) { LOG_FUNCTION(); DbgToBeidou(ctx->link, __FUNCTION__)(); DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke EjectJS"); m_pEntity->EjectJS(ctx); } //吞卡 void CardIssuerStoreServerSession::Handle_CaptureJS(SpReqAnsContext::Pointer ctx) { LOG_FUNCTION(); DbgToBeidou(ctx->link, __FUNCTION__)(); DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke CaptureJS"); m_pEntity->CaptureJS(ctx); } //区间盘库 void CardIssuerStoreServerSession::Handle_ReadBatchCardInfoInRangeJS(SpReqAnsContext::Pointer ctx) { LOG_FUNCTION(); DbgToBeidou(ctx->link, __FUNCTION__)(); DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke ReadBatchCardInfoInRangeJS"); m_pEntity->ReadBatchCardInfoInRangeJS(ctx); } //卡库容量和卡槽状态 void CardIssuerStoreServerSession::Handle_GetCardInStoreJS(SpReqAnsContext::Pointer ctx) { LOG_FUNCTION(); DbgToBeidou(ctx->link, __FUNCTION__)(); DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke GetCardInStoreJS"); m_pEntity->GetCardInStoreJS(ctx); } //加卡 void CardIssuerStoreServerSession::Handle_AddAndReadCardFromBoxJS(SpReqAnsContext::Pointer ctx) { LOG_FUNCTION(); DbgToBeidou(ctx->link, __FUNCTION__)(); DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke AddAndReadCardFromBoxJS"); m_pEntity->AddAndReadCardFromBoxJS(ctx); } //移卡读卡 void CardIssuerStoreServerSession::Handle_MoveAndReadCardFromSlotJS(SpReqAnsContext::Pointer ctx) { LOG_FUNCTION(); DbgToBeidou(ctx->link, __FUNCTION__)(); DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke MoveAndReadCardFromSlotJS"); m_pEntity->MoveAndReadCardFromSlotJS(ctx); } //移回卡槽 void CardIssuerStoreServerSession::Handle_MoveBacktoSlotJS(SpReqAnsContext::Pointer ctx) { LOG_FUNCTION(); DbgToBeidou(ctx->link, __FUNCTION__)(); DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke MoveBacktoSlotJS"); m_pEntity->MoveBacktoSlotJS(ctx); } //卡库领卡 //void CardIssuerStoreServerSession::Handle_IssueFromSlotJS(SpReqAnsContext::Pointer ctx) //{ // LOG_FUNCTION(); // DbgToBeidou(ctx->link, __FUNCTION__)(); // DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke IssueFromSlotJS"); // m_pEntity->IssueFromSlotJS(ctx); //} //查询卡机内部中是否有卡 //void CardIssuerStoreServerSession::Handle_QueryInternalHasCardJS(SpReqAnsContext::Pointer ctx) //{ // LOG_FUNCTION(); // DbgToBeidou(ctx->link, __FUNCTION__)(); // DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke QueryInternalHasCardJS"); // m_pEntity->QueryInternalHasCardJS(ctx); //} //查询卡机内部中是否有卡 void CardIssuerStoreServerSession::Handle_QueryHasCardJS(SpReqAnsContext::Pointer ctx) { LOG_FUNCTION(); DbgToBeidou(ctx->link, __FUNCTION__)(); DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke QueryHasCardJS"); m_pEntity->QueryHasCardJS(ctx); } //写卡 void CardIssuerStoreServerSession::Handle_WriteTrackJS(SpReqAnsContext::Pointer ctx) { LOG_FUNCTION(); DbgToBeidou(ctx->link, __FUNCTION__)(); DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke WriteTrackJS"); m_pEntity->WriteTrackJS(ctx); } //打印 void CardIssuerStoreServerSession::Handle_PrintCardImmediatelyJS(SpReqAnsContext::Pointer ctx) { LOG_FUNCTION(); DbgToBeidou(ctx->link, __FUNCTION__)(); DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke PrintCardImmediatelyJS"); m_pEntity->PrintCardImmediatelyJS(ctx); } //IC交互 //void CardIssuerStoreServerSession::Handle_SAMICCommandJS(SpReqAnsContext::Pointer ctx) //{ // LOG_FUNCTION(); // DbgToBeidou(ctx->link, __FUNCTION__)(); // DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke SAMICCommandJS"); // m_pEntity->SAMICCommandJS(ctx); //} //IC交互 void CardIssuerStoreServerSession::Handle_ICCommandJS(SpReqAnsContext::Pointer ctx) { LOG_FUNCTION(); DbgToBeidou(ctx->link, __FUNCTION__)(); DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke ICCommandJS"); m_pEntity->ICCommandJS(ctx); } //联机后处理 void CardIssuerStoreServerSession::Handle_PostOnlineJS(SpReqAnsContext::Pointer ctx) { LOG_FUNCTION(); DbgToBeidou(ctx->link, __FUNCTION__)(); DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke PostOnlineJS"); m_pEntity->PostOnlineJS(ctx); } //卡箱发卡 void CardIssuerStoreServerSession::Handle_IssueFromBoxJS(SpReqAnsContext::Pointer ctx) { LOG_FUNCTION(); DbgToBeidou(ctx->link, __FUNCTION__)(); DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke IssueFromBoxJS"); m_pEntity->IssueFromBoxJS(ctx); } //跨机激活 void CardIssuerStoreServerSession::Handle_PreOnlineCrossJS(SpReqAnsContext::Pointer ctx) { LOG_FUNCTION(); DbgToBeidou(ctx->link, __FUNCTION__)(); DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke PreOnlineCrossJS"); m_pEntity->PreOnlineCrossJS(ctx); } //读卡 void CardIssuerStoreServerSession::Handle_ReadJS(SpReqAnsContext::Pointer ctx) { LOG_FUNCTION(); DbgToBeidou(ctx->link, __FUNCTION__)(); DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke ReadJS"); m_pEntity->ReadJS(ctx); } //加卡箱移卡 void CardIssuerStoreServerSession::Handle_AddCardFromBoxJS(SpReqAnsContext::Pointer ctx) { LOG_FUNCTION(); DbgToBeidou(ctx->link, __FUNCTION__)(); DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke AddCardFromBoxJS"); m_pEntity->AddCardFromBoxJS(ctx); } //卡槽移卡 void CardIssuerStoreServerSession::Handle_MoveCardFromSlotJS(SpReqAnsContext::Pointer ctx) { LOG_FUNCTION(); DbgToBeidou(ctx->link, __FUNCTION__)(); DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke MoveCardFromSlotJS"); m_pEntity->MoveCardFromSlotJS(ctx); } #pragma endregion JS接口实现 void CCardIssuerEntity::OnSysVarEvent(const char* pszKey, const char* pszValue, const char* pszOldValue, const char* pszEntityName) { if ((_strnicmp(pszKey, "UIState", strlen("UIState")) == 0)) { m_fsm.OnUIState4SetWhatPage(pszValue); if (_strnicmp(pszValue, "M", strlen("M")) == 0) { m_fsm.SetEnterMainPage();//设置进入首页 } } } SP_BEGIN_ENTITY_MAP() SP_ENTITY(CCardIssuerEntity) SP_END_ENTITY_MAP()