mod_cardissuer.cpp 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. // mod_cardissuer.cpp : Defines the exported functions for the DLL application.
  2. //
  3. #include "stdafx.h"
  4. #pragma once
  5. #include "SpBase.h"
  6. #include "mod_cardissuer.h"
  7. #include "CardIssuerClass.h"
  8. void CardIssuerServerSession::Handle_Insert(SpReqAnsContext<CardIssuerService_Insert_Req, CardIssuerService_Insert_Ans>::Pointer ctx)
  9. {
  10. LOG_FUNCTION();
  11. m_pEntity->Insert(ctx);
  12. }
  13. void CardIssuerServerSession::Handle_Read(SpReqAnsContext<CardIssuerService_Read_Req, CardIssuerService_Read_Ans>::Pointer ctx)
  14. {
  15. LOG_FUNCTION();
  16. m_pEntity->Read(ctx);
  17. }
  18. void CardIssuerServerSession::Handle_Capture(SpReqAnsContext<CardIssuerService_Capture_Req, CardIssuerService_Capture_Ans>::Pointer ctx)
  19. {
  20. LOG_FUNCTION();
  21. m_pEntity->Capture(ctx);
  22. }
  23. void CardIssuerServerSession::Handle_Eject(SpReqAnsContext<CardIssuerService_Eject_Req, CardIssuerService_Eject_Ans>::Pointer ctx)
  24. {
  25. LOG_FUNCTION();
  26. m_pEntity->Eject(ctx);
  27. }
  28. void CardIssuerServerSession::Handle_CancelInsert(SpOnewayCallContext<CardIssuerService_CancelInsert_Info>::Pointer ctx)
  29. {
  30. LOG_FUNCTION();
  31. m_pEntity->CancelInsert(ctx);
  32. }
  33. void CardIssuerServerSession::Handle_InsertWaitMore(SpOnewayCallContext<CardIssuerService_InsertWaitMore_Info>::Pointer ctx)
  34. {
  35. LOG_FUNCTION();
  36. m_pEntity->InsertWaitMore(ctx);
  37. }
  38. void CardIssuerServerSession::Handle_Issue(SpReqAnsContext<CardIssuerService_Issue_Req, CardIssuerService_Issue_Ans>::Pointer ctx)
  39. {
  40. LOG_FUNCTION();
  41. m_pEntity->Issue(ctx);
  42. }
  43. void CardIssuerServerSession::Handle_PreOnline(SpReqAnsContext<CardIssuerService_PreOnline_Req, CardIssuerService_PreOnline_Ans>::Pointer ctx)
  44. {
  45. LOG_FUNCTION();
  46. m_pEntity->PreOnline(ctx);
  47. }
  48. void CardIssuerServerSession::Handle_PostOnline(SpReqAnsContext<CardIssuerService_PostOnline_Req, CardIssuerService_PostOnline_Ans>::Pointer ctx)
  49. {
  50. LOG_FUNCTION();
  51. m_pEntity->PostOnline(ctx);
  52. }
  53. void CardIssuerServerSession::Handle_Exit(SpOnewayCallContext<CardIssuerService_Exit_Info>::Pointer ctx)
  54. {
  55. LOG_FUNCTION();
  56. m_pEntity->Exit(ctx);
  57. }
  58. void CardIssuerServerSession::Handle_GetMaterialCount(SpReqAnsContext<CardIssuerService_GetMaterialCount_Req, CardIssuerService_GetMaterialCount_Ans>::Pointer ctx)
  59. {
  60. LOG_FUNCTION();
  61. m_pEntity->GetMaterialCount(ctx);
  62. }
  63. void CardIssuerServerSession::Handle_SetMaterialCount(SpReqAnsContext<CardIssuerService_SetMaterialCount_Req, CardIssuerService_SetMaterialCount_Ans>::Pointer ctx)
  64. {
  65. LOG_FUNCTION();
  66. m_pEntity->SetMaterialCount(ctx);
  67. }
  68. void CardIssuerServerSession::Handle_SetIssueFlag(SpOnewayCallContext<CardIssuerService_SetIssueFlag_Info>::Pointer ctx)
  69. {
  70. LOG_FUNCTION();
  71. m_pEntity->SetIssueFlag(ctx);
  72. }
  73. void CardIssuerServerSession::Handle_ReadEx(SpReqAnsContext<CardIssuerService_ReadEx_Req, CardIssuerService_ReadEx_Ans>::Pointer ctx)
  74. {
  75. LOG_FUNCTION();
  76. m_pEntity->ReadEx(ctx);
  77. }
  78. void CardIssuerServerSession::Handle_QueryCardInfo(SpReqAnsContext<CardIssuerService_QueryCardInfo_Req, CardIssuerService_QueryCardInfo_Ans>::Pointer ctx)
  79. {
  80. LOG_FUNCTION();
  81. m_pEntity->QueryCardInfo(ctx);
  82. }
  83. void CardIssuerServerSession::Handle_WriteTrack(SpReqAnsContext<CardIssuerService_WriteTrack_Req, CardIssuerService_WriteTrack_Ans>::Pointer ctx)
  84. {
  85. LOG_FUNCTION();
  86. m_pEntity->WriteTrack(ctx);
  87. }
  88. void CardIssuerServerSession::Handle_GetMaterialCountEx(SpReqAnsContext<CardIssuerService_GetMaterialCountEx_Req, CardIssuerService_GetMaterialCountEx_Ans>::Pointer ctx)
  89. {
  90. LOG_FUNCTION();
  91. m_pEntity->GetMaterialCountEx(ctx);
  92. }
  93. void CardIssuerServerSession::Handle_SetMaterialCountEx(SpReqAnsContext<CardIssuerService_SetMaterialCountEx_Req, CardIssuerService_SetMaterialCountEx_Ans>::Pointer ctx)
  94. {
  95. Dbg("Handle_SetMaterialCountEx");
  96. LOG_FUNCTION();
  97. m_pEntity->SetMaterialCountEx(ctx);
  98. }
  99. void CardIssuerServerSession::Handle_SetSomeFlag(SpReqAnsContext<CardIssuerService_SetSomeFlag_Req, CardIssuerService_SetSomeFlag_Ans>::Pointer ctx)
  100. {
  101. LOG_FUNCTION();
  102. m_pEntity->SetSomeFlag(ctx);
  103. }
  104. void CardIssuerServerSession::Handle_GetSCIInfo(SpReqAnsContext<CardIssuerService_GetSCIInfo_Req, CardIssuerService_GetSCIInfo_Ans>::Pointer ctx)
  105. {
  106. LOG_FUNCTION();
  107. m_pEntity->GetSCIInfo(ctx);
  108. }
  109. void CardIssuerServerSession::Handle_IssueEx(SpReqAnsContext<CardIssuerService_IssueEx_Req, CardIssuerService_IssueEx_Ans>::Pointer ctx)
  110. {
  111. LOG_FUNCTION();
  112. m_pEntity->IssueEx(ctx);
  113. }
  114. void CardIssuerServerSession::Handle_OpenSafeLock(SpReqAnsContext<CardIssuerService_OpenSafeLock_Req, CardIssuerService_OpenSafeLock_Ans>::Pointer ctx)
  115. {
  116. LOG_FUNCTION();
  117. m_pEntity->OpenSafeLock(ctx);
  118. }
  119. void CardIssuerServerSession::Handle_SAMICCommand(SpReqAnsContext<CardIssuerService_SAMICCommand_Req, CardIssuerService_SAMICCommand_Ans>::Pointer ctx)
  120. {
  121. m_pEntity->SAMICCommand(ctx);
  122. }
  123. void CardIssuerServerSession::Handle_QueryPrinterStatus(SpReqAnsContext<CardIssuerService_QueryPrinterStatus_Req, CardIssuerService_QueryPrinterStatus_Ans>::Pointer ctx)
  124. {
  125. m_pEntity->QueryPrinterStatus(ctx);
  126. }
  127. void CardIssuerServerSession::Handle_Print(SpReqAnsContext<CardIssuerService_Print_Req, CardIssuerService_Print_Ans>::Pointer ctx)
  128. {
  129. LOG_FUNCTION();
  130. m_pEntity->Print(ctx);
  131. }
  132. void CardIssuerServerSession::Handle_QuerySCIList(SpReqAnsContext<CardIssuerService_QuerySCIList_Req, CardIssuerService_QuerySCIList_Ans>::Pointer ctx)
  133. {
  134. LOG_FUNCTION();
  135. m_pEntity->QuerySCIList(ctx);
  136. }
  137. void CardIssuerServerSession::Handle_BindSCI(SpReqAnsContext<CardIssuerService_BindSCI_Req, CardIssuerService_BindSCI_Ans>::Pointer ctx)
  138. {
  139. LOG_FUNCTION();
  140. CSimpleStringA tmpSCINo("");
  141. m_pEntity->GetSCINo(tmpSCINo);
  142. Dbg("type:%d",ctx->Req.type);
  143. if ((ctx->Req.type == 2 && tmpSCINo.Compare(ctx->Req.sciNo) == 0) || (ctx->Req.type == 4 && tmpSCINo.GetLength() < 2))
  144. ctx->Answer(Error_Succeed);
  145. else
  146. {
  147. m_pEntity->BindSCI(ctx);
  148. Dbg("%d,%s", ctx->Req.type, (const char*)ctx->Req.sciNo);
  149. }
  150. }
  151. void CardIssuerServerSession::Handle_PreOnlineOnStore(SpReqAnsContext<CardIssuerService_PreOnlineOnStore_Req, CardIssuerService_PreOnlineOnStore_Ans>::Pointer ctx)
  152. {
  153. LOG_FUNCTION();
  154. m_pEntity->PreOnlineOnStore(ctx);
  155. }
  156. void CardIssuerServerSession::Handle_NotifyPreonline(SpReqAnsContext<CardIssuerService_NotifyPreonline_Req, CardIssuerService_NotifyPreonline_Ans>::Pointer ctx)
  157. {
  158. LOG_FUNCTION();
  159. m_pEntity->NotifyPreonline(ctx);
  160. }
  161. void CardIssuerServerSession::Handle_QueryCardInfoOnStore(SpReqAnsContext<CardIssuerService_QueryCardInfoOnStore_Req, CardIssuerService_QueryCardInfoOnStore_Ans>::Pointer ctx)
  162. {
  163. LOG_FUNCTION();
  164. m_pEntity->QueryCardInfoOnStore(ctx);
  165. }
  166. void CardIssuerServerSession::Handle_GetAddCardInfo(SpReqAnsContext<CardIssuerService_GetAddCardInfo_Req, CardIssuerService_GetAddCardInfo_Ans>::Pointer ctx)
  167. {
  168. LOG_FUNCTION();
  169. m_pEntity->GetAddCardInfo(ctx);
  170. }
  171. void CardIssuerServerSession::Handle_PrintCardImmediately(SpReqAnsContext<CardIssuerService_PrintCardImmediately_Req, CardIssuerService_PrintCardImmediately_Ans>::Pointer ctx)
  172. {
  173. LOG_FUNCTION();
  174. m_pEntity->PrintCardImmediately(ctx);
  175. }
  176. void CardIssuerServerSession::Handle_GetDevInfo(SpReqAnsContext<CardIssuerService_GetDevInfo_Req, CardIssuerService_GetDevInfo_Ans>::Pointer ctx)
  177. {
  178. LOG_FUNCTION();
  179. m_pEntity->GetDevInfo(ctx);
  180. }
  181. void CCardIssuerEntity::OnSysVarEvent(const char* pszKey, const char* pszValue, const char* pszOldValue, const char* pszEntityName)
  182. {
  183. if ((_strnicmp(pszKey, "UIState", strlen("UIState")) == 0))
  184. {
  185. if (_strnicmp(pszValue, "M", strlen("M")) == 0)
  186. {
  187. m_fsm.SetMainPageFlag(true);
  188. }
  189. else
  190. m_fsm.SetMainPageFlag(false);
  191. }
  192. }
  193. SP_BEGIN_ENTITY_MAP()
  194. SP_ENTITY(CCardIssuerEntity)
  195. SP_END_ENTITY_MAP()