mod_cardissuerStand.cpp 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  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. LOG_FUNCTION();
  88. DbgToBeidou(ctx->link, __FUNCTION__)();
  89. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("WriteTrack");
  90. m_pEntity->WriteTrack(ctx);
  91. }
  92. void CardIssuerServerSession::Handle_GetMaterialCountEx(SpReqAnsContext<CardIssuerStandService_GetMaterialCountEx_Req, CardIssuerStandService_GetMaterialCountEx_Ans>::Pointer ctx)
  93. {
  94. LOG_FUNCTION();
  95. DbgToBeidou(ctx->link, __FUNCTION__)();
  96. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("GetMaterialCountEx");
  97. m_pEntity->GetMaterialCountEx(ctx);
  98. }
  99. void CardIssuerServerSession::Handle_SetMaterialCountEx(SpReqAnsContext<CardIssuerStandService_SetMaterialCountEx_Req, CardIssuerStandService_SetMaterialCountEx_Ans>::Pointer ctx)
  100. {
  101. LOG_FUNCTION();
  102. DbgToBeidou(ctx->link, __FUNCTION__)();
  103. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("SetMaterialCountEx");
  104. m_pEntity->SetMaterialCountEx(ctx);
  105. }
  106. void CardIssuerServerSession::Handle_SetSomeFlag(SpReqAnsContext<CardIssuerStandService_SetSomeFlag_Req, CardIssuerStandService_SetSomeFlag_Ans>::Pointer ctx)
  107. {
  108. LOG_FUNCTION();
  109. DbgToBeidou(ctx->link, __FUNCTION__)();
  110. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("SetSomeFlag , IssueBusiness=%d", ctx->Req.IssueBusiness);
  111. m_pEntity->SetSomeFlag(ctx);
  112. }
  113. void CardIssuerServerSession::Handle_IssueEx(SpReqAnsContext<CardIssuerStandService_IssueEx_Req, CardIssuerStandService_IssueEx_Ans>::Pointer ctx)
  114. {
  115. LOG_FUNCTION();
  116. DbgToBeidou(ctx->link, __FUNCTION__)();
  117. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("IssueEx, Req.hopper=%d",ctx->Req.hopper);
  118. m_pEntity->IssueEx(ctx);
  119. }
  120. void CardIssuerServerSession::Handle_SAMICCommand(SpReqAnsContext<CardIssuerStandService_SAMICCommand_Req, CardIssuerStandService_SAMICCommand_Ans>::Pointer ctx)
  121. {
  122. DbgToBeidou(ctx->link, __FUNCTION__)();
  123. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("SAMICCommand");
  124. m_pEntity->SAMICCommand(ctx);
  125. }
  126. void CardIssuerServerSession::Handle_QueryCIStatus(SpReqAnsContext<CardIssuerStandService_QueryCIStatus_Req, CardIssuerStandService_QueryCIStatus_Ans>::Pointer ctx)
  127. {
  128. LOG_FUNCTION();
  129. DbgToBeidou(ctx->link, __FUNCTION__)();
  130. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("QueryCIStatus");
  131. m_pEntity->QueryCIStatus(ctx);
  132. }
  133. void CardIssuerServerSession::Handle_GetDevInfo(SpReqAnsContext<CardIssuerStandService_GetDevInfo_Req, CardIssuerStandService_GetDevInfo_Ans>::Pointer ctx)
  134. {
  135. LOG_FUNCTION();
  136. DbgToBeidou(ctx->link, __FUNCTION__)();
  137. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("GetDevInfo");
  138. m_pEntity->GetDevInfo(ctx);
  139. }
  140. //JS½Ó¿ÚʵÏÖ
  141. void CardIssuerServerSession::Handle_ReadJS(SpReqAnsContext<CardIssuerStandService_ReadJS_Req, CardIssuerStandService_ReadJS_Ans>::Pointer ctx)
  142. {
  143. LOG_FUNCTION();
  144. DbgToBeidou(ctx->link, __FUNCTION__)();
  145. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke ReadJS req.aid=%s, req.business=%s", ctx->Req.aid.GetData(), ctx->Req.businessData.GetData());
  146. m_pEntity->ReadJS(ctx);
  147. }
  148. void CardIssuerServerSession::Handle_PostOnlineJS(SpReqAnsContext<CardIssuerStandService_PostOnlineJS_Req, CardIssuerStandService_PostOnlineJS_Ans>::Pointer ctx)
  149. {
  150. LOG_FUNCTION();
  151. DbgToBeidou(ctx->link, __FUNCTION__)();
  152. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke PostOnlineJS");
  153. m_pEntity->PostOnlineJS(ctx);
  154. }
  155. void CardIssuerServerSession::Handle_EjectJS(SpReqAnsContext<CardIssuerStandService_EjectJS_Req, CardIssuerStandService_EjectJS_Ans>::Pointer ctx)
  156. {
  157. LOG_FUNCTION();
  158. DbgToBeidou(ctx->link, __FUNCTION__)();
  159. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke EjectJS");
  160. m_pEntity->EjectJS(ctx);
  161. }
  162. void CardIssuerServerSession::Handle_CaptureJS(SpReqAnsContext<CardIssuerStandService_CaptureJS_Req, CardIssuerStandService_CaptureJS_Ans>::Pointer ctx)
  163. {
  164. LOG_FUNCTION();
  165. DbgToBeidou(ctx->link, __FUNCTION__)();
  166. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke CaptureJS");
  167. m_pEntity->CaptureJS(ctx);
  168. }
  169. void CardIssuerServerSession::Handle_QueryHasCardJS(SpReqAnsContext<CardIssuerStandService_QueryHasCardJS_Req, CardIssuerStandService_QueryHasCardJS_Ans>::Pointer ctx)
  170. {
  171. LOG_FUNCTION();
  172. DbgToBeidou(ctx->link, __FUNCTION__)();
  173. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke QueryHasCardJS");
  174. m_pEntity->QueryHasCardJS(ctx);
  175. }
  176. void CardIssuerServerSession::Handle_IssueFromBoxJS(SpReqAnsContext<CardIssuerStandService_IssueFromBoxJS_Req, CardIssuerStandService_IssueFromBoxJS_Ans>::Pointer ctx)
  177. {
  178. LOG_FUNCTION();
  179. DbgToBeidou(ctx->link, __FUNCTION__)();
  180. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke IssueFromBoxJS Req.hopper=%d", ctx->Req.hopper);
  181. m_pEntity->IssueFromBoxJS(ctx);
  182. }
  183. void CardIssuerServerSession::Handle_InsertJS(SpReqAnsContext<CardIssuerStandService_InsertJS_Req, CardIssuerStandService_InsertJS_Ans>::Pointer ctx)
  184. {
  185. LOG_FUNCTION();
  186. DbgToBeidou(ctx->link, __FUNCTION__)();
  187. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke InsertJS");
  188. m_pEntity->InsertJS(ctx);
  189. }
  190. void CardIssuerServerSession::Handle_CancelInsertJS(SpOnewayCallContext<CardIssuerStandService_CancelInsertJS_Info>::Pointer ctx)
  191. {
  192. LOG_FUNCTION();
  193. DbgToBeidou(ctx->link, __FUNCTION__)();
  194. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke CancelInsertJS");
  195. m_pEntity->CancelInsertJS(ctx);
  196. }
  197. void CCardIssuerEntity::OnSysVarEvent(const char* pszKey, const char* pszValue, const char* pszOldValue, const char* pszEntityName)
  198. {
  199. if ((_strnicmp(pszKey, "UIState", strlen("UIState")) == 0))
  200. {
  201. m_fsm.OnUIState4SetWhatPage(pszValue);
  202. }
  203. }
  204. SP_BEGIN_ENTITY_MAP()
  205. SP_ENTITY(CCardIssuerEntity)
  206. SP_END_ENTITY_MAP()