mod_cardissuerStand.cpp 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  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_cardissuerStand.h"
  7. #include "CardIssuerClass.h"
  8. void CardIssuerServerSession::Handle_Insert(SpReqAnsContext<CardIssuerStandService_Insert_Req, CardIssuerStandService_Insert_Ans>::Pointer ctx)
  9. {
  10. LOG_FUNCTION();
  11. DbgToBeidou(ctx->link, __FUNCTION__)();
  12. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Insert");
  13. m_pEntity->Insert(ctx);
  14. }
  15. void CardIssuerServerSession::Handle_Read(SpReqAnsContext<CardIssuerStandService_Read_Req, CardIssuerStandService_Read_Ans>::Pointer ctx)
  16. {
  17. LOG_FUNCTION();
  18. DbgToBeidou(ctx->link, __FUNCTION__)();
  19. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Read");
  20. m_pEntity->Read(ctx);
  21. }
  22. void CardIssuerServerSession::Handle_Capture(SpReqAnsContext<CardIssuerStandService_Capture_Req, CardIssuerStandService_Capture_Ans>::Pointer ctx)
  23. {
  24. LOG_FUNCTION();
  25. DbgToBeidou(ctx->link, __FUNCTION__)();
  26. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Capture");
  27. m_pEntity->Capture(ctx);
  28. }
  29. void CardIssuerServerSession::Handle_Eject(SpReqAnsContext<CardIssuerStandService_Eject_Req, CardIssuerStandService_Eject_Ans>::Pointer ctx)
  30. {
  31. LOG_FUNCTION();
  32. DbgToBeidou(ctx->link, __FUNCTION__)();
  33. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Eject");
  34. m_pEntity->Eject(ctx);
  35. }
  36. void CardIssuerServerSession::Handle_CancelInsert(SpOnewayCallContext<CardIssuerStandService_CancelInsert_Info>::Pointer ctx)
  37. {
  38. LOG_FUNCTION();
  39. DbgToBeidou(ctx->link, __FUNCTION__)();
  40. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("CancelInsert");
  41. m_pEntity->CancelInsert(ctx);
  42. }
  43. void CardIssuerServerSession::Handle_InsertWaitMore(SpOnewayCallContext<CardIssuerStandService_InsertWaitMore_Info>::Pointer ctx)
  44. {
  45. LOG_FUNCTION();
  46. DbgToBeidou(ctx->link, __FUNCTION__)();
  47. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("InsertWaitMore");
  48. m_pEntity->InsertWaitMore(ctx);
  49. }
  50. void CardIssuerServerSession::Handle_PreOnline(SpReqAnsContext<CardIssuerStandService_PreOnline_Req, CardIssuerStandService_PreOnline_Ans>::Pointer ctx)
  51. {
  52. LOG_FUNCTION();
  53. DbgToBeidou(ctx->link, __FUNCTION__)();
  54. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("PreOnline , req.businessData[%s], req.reserved1:[%s]", ctx->Req.businessData.GetData(), ctx->Req.reserved1.GetData());
  55. m_pEntity->PreOnline(ctx);
  56. }
  57. void CardIssuerServerSession::Handle_PostOnline(SpReqAnsContext<CardIssuerStandService_PostOnline_Req, CardIssuerStandService_PostOnline_Ans>::Pointer ctx)
  58. {
  59. LOG_FUNCTION();
  60. DbgToBeidou(ctx->link, __FUNCTION__)();
  61. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("PostOnline");
  62. m_pEntity->PostOnline(ctx);
  63. }
  64. void CardIssuerServerSession::Handle_Exit(SpOnewayCallContext<CardIssuerStandService_Exit_Info>::Pointer ctx)
  65. {
  66. LOG_FUNCTION();
  67. DbgToBeidou(ctx->link, __FUNCTION__)();
  68. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Exit");
  69. m_pEntity->Exit(ctx);
  70. }
  71. void CardIssuerServerSession::Handle_SetIssueFlag(SpOnewayCallContext<CardIssuerStandService_SetIssueFlag_Info>::Pointer ctx)
  72. {
  73. LOG_FUNCTION();
  74. DbgToBeidou(ctx->link, __FUNCTION__)();
  75. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("SetIssueFlag");
  76. m_pEntity->SetIssueFlag(ctx);
  77. }
  78. void CardIssuerServerSession::Handle_QueryCardInfo(SpReqAnsContext<CardIssuerStandService_QueryCardInfo_Req, CardIssuerStandService_QueryCardInfo_Ans>::Pointer ctx)
  79. {
  80. LOG_FUNCTION();
  81. DbgToBeidou(ctx->link, __FUNCTION__)();
  82. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("QueryCardInfo");
  83. m_pEntity->QueryCardInfo(ctx);
  84. }
  85. void CardIssuerServerSession::Handle_WriteTrack(SpReqAnsContext<CardIssuerStandService_WriteTrack_Req, CardIssuerStandService_WriteTrack_Ans>::Pointer ctx)
  86. {
  87. ctx->Answer(Error_NotImpl);
  88. }
  89. void CardIssuerServerSession::Handle_GetMaterialCountEx(SpReqAnsContext<CardIssuerStandService_GetMaterialCountEx_Req, CardIssuerStandService_GetMaterialCountEx_Ans>::Pointer ctx)
  90. {
  91. LOG_FUNCTION();
  92. DbgToBeidou(ctx->link, __FUNCTION__)();
  93. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("GetMaterialCountEx");
  94. m_pEntity->GetMaterialCountEx(ctx);
  95. }
  96. void CardIssuerServerSession::Handle_SetMaterialCountEx(SpReqAnsContext<CardIssuerStandService_SetMaterialCountEx_Req, CardIssuerStandService_SetMaterialCountEx_Ans>::Pointer ctx)
  97. {
  98. LOG_FUNCTION();
  99. DbgToBeidou(ctx->link, __FUNCTION__)();
  100. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("SetMaterialCountEx");
  101. m_pEntity->SetMaterialCountEx(ctx);
  102. }
  103. void CardIssuerServerSession::Handle_SetSomeFlag(SpReqAnsContext<CardIssuerStandService_SetSomeFlag_Req, CardIssuerStandService_SetSomeFlag_Ans>::Pointer ctx)
  104. {
  105. LOG_FUNCTION();
  106. DbgToBeidou(ctx->link, __FUNCTION__)();
  107. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("SetSomeFlag , IssueBusiness=%d", ctx->Req.IssueBusiness);
  108. m_pEntity->SetSomeFlag(ctx);
  109. }
  110. void CardIssuerServerSession::Handle_IssueEx(SpReqAnsContext<CardIssuerStandService_IssueEx_Req, CardIssuerStandService_IssueEx_Ans>::Pointer ctx)
  111. {
  112. LOG_FUNCTION();
  113. DbgToBeidou(ctx->link, __FUNCTION__)();
  114. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("IssueEx, Req.hopper=%d",ctx->Req.hopper);
  115. m_pEntity->IssueEx(ctx);
  116. }
  117. void CardIssuerServerSession::Handle_SAMICCommand(SpReqAnsContext<CardIssuerStandService_SAMICCommand_Req, CardIssuerStandService_SAMICCommand_Ans>::Pointer ctx)
  118. {
  119. ctx->Answer(Error_NotImpl);
  120. }
  121. void CardIssuerServerSession::Handle_QueryCIStatus(SpReqAnsContext<CardIssuerStandService_QueryCIStatus_Req, CardIssuerStandService_QueryCIStatus_Ans>::Pointer ctx)
  122. {
  123. LOG_FUNCTION();
  124. DbgToBeidou(ctx->link, __FUNCTION__)();
  125. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("QueryCIStatus");
  126. m_pEntity->QueryCIStatus(ctx);
  127. }
  128. void CardIssuerServerSession::Handle_GetDevInfo(SpReqAnsContext<CardIssuerStandService_GetDevInfo_Req, CardIssuerStandService_GetDevInfo_Ans>::Pointer ctx)
  129. {
  130. LOG_FUNCTION();
  131. DbgToBeidou(ctx->link, __FUNCTION__)();
  132. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("GetDevInfo");
  133. m_pEntity->GetDevInfo(ctx);
  134. }
  135. //JS½Ó¿ÚʵÏÖ
  136. void CardIssuerServerSession::Handle_ReadJS(SpReqAnsContext<CardIssuerStandService_ReadJS_Req, CardIssuerStandService_ReadJS_Ans>::Pointer ctx)
  137. {
  138. LOG_FUNCTION();
  139. DbgToBeidou(ctx->link, __FUNCTION__)();
  140. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke ReadJS req.aid=%s, req.mode=%d, req.business=%s", ctx->Req.aid.GetData(), ctx->Req.mode, ctx->Req.businessData.GetData());
  141. m_pEntity->ReadJS(ctx);
  142. }
  143. void CardIssuerServerSession::Handle_PostOnlineJS(SpReqAnsContext<CardIssuerStandService_PostOnlineJS_Req, CardIssuerStandService_PostOnlineJS_Ans>::Pointer ctx)
  144. {
  145. LOG_FUNCTION();
  146. DbgToBeidou(ctx->link, __FUNCTION__)();
  147. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke PostOnlineJS");
  148. m_pEntity->PostOnlineJS(ctx);
  149. }
  150. void CardIssuerServerSession::Handle_EjectJS(SpReqAnsContext<CardIssuerStandService_EjectJS_Req, CardIssuerStandService_EjectJS_Ans>::Pointer ctx)
  151. {
  152. LOG_FUNCTION();
  153. DbgToBeidou(ctx->link, __FUNCTION__)();
  154. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke EjectJS");
  155. m_pEntity->EjectJS(ctx);
  156. }
  157. void CardIssuerServerSession::Handle_CaptureJS(SpReqAnsContext<CardIssuerStandService_CaptureJS_Req, CardIssuerStandService_CaptureJS_Ans>::Pointer ctx)
  158. {
  159. LOG_FUNCTION();
  160. DbgToBeidou(ctx->link, __FUNCTION__)();
  161. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke CaptureJS");
  162. m_pEntity->CaptureJS(ctx);
  163. }
  164. void CardIssuerServerSession::Handle_QueryHasCardJS(SpReqAnsContext<CardIssuerStandService_QueryHasCardJS_Req, CardIssuerStandService_QueryHasCardJS_Ans>::Pointer ctx)
  165. {
  166. LOG_FUNCTION();
  167. DbgToBeidou(ctx->link, __FUNCTION__)();
  168. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke QueryHasCardJS");
  169. m_pEntity->QueryHasCardJS(ctx);
  170. }
  171. void CardIssuerServerSession::Handle_IssueFromBoxJS(SpReqAnsContext<CardIssuerStandService_IssueFromBoxJS_Req, CardIssuerStandService_IssueFromBoxJS_Ans>::Pointer ctx)
  172. {
  173. LOG_FUNCTION();
  174. DbgToBeidou(ctx->link, __FUNCTION__)();
  175. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke IssueFromBoxJS Req.hopper=%d", ctx->Req.hopper);
  176. m_pEntity->IssueFromBoxJS(ctx);
  177. }
  178. void CardIssuerServerSession::Handle_InsertJS(SpReqAnsContext<CardIssuerStandService_InsertJS_Req, CardIssuerStandService_InsertJS_Ans>::Pointer ctx)
  179. {
  180. LOG_FUNCTION();
  181. DbgToBeidou(ctx->link, __FUNCTION__)();
  182. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke InsertJS");
  183. m_pEntity->InsertJS(ctx);
  184. }
  185. void CardIssuerServerSession::Handle_CancelInsertJS(SpOnewayCallContext<CardIssuerStandService_CancelInsertJS_Info>::Pointer ctx)
  186. {
  187. LOG_FUNCTION();
  188. DbgToBeidou(ctx->link, __FUNCTION__)();
  189. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke CancelInsertJS");
  190. m_pEntity->CancelInsertJS(ctx);
  191. }
  192. void CCardIssuerEntity::OnSysVarEvent(const char* pszKey, const char* pszValue, const char* pszOldValue, const char* pszEntityName)
  193. {
  194. if ((_strnicmp(pszKey, "UIState", strlen("UIState")) == 0))
  195. {
  196. m_fsm.OnUIState4SetWhatPage(pszValue);
  197. }
  198. }
  199. SP_BEGIN_ENTITY_MAP()
  200. SP_ENTITY(CCardIssuerEntity)
  201. SP_END_ENTITY_MAP()