mod_cardissuerStand.cpp 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  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_QueryCardInfo(SpReqAnsContext<CardIssuerStandService_QueryCardInfo_Req, CardIssuerStandService_QueryCardInfo_Ans>::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__)("QueryCardInfo");
  76. m_pEntity->QueryCardInfo(ctx);
  77. }
  78. void CardIssuerServerSession::Handle_GetMaterialCountEx(SpReqAnsContext<CardIssuerStandService_GetMaterialCountEx_Req, CardIssuerStandService_GetMaterialCountEx_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__)("GetMaterialCountEx");
  83. m_pEntity->GetMaterialCountEx(ctx);
  84. }
  85. void CardIssuerServerSession::Handle_SetMaterialCountEx(SpReqAnsContext<CardIssuerStandService_SetMaterialCountEx_Req, CardIssuerStandService_SetMaterialCountEx_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__)("SetMaterialCountEx");
  90. m_pEntity->SetMaterialCountEx(ctx);
  91. }
  92. void CardIssuerServerSession::Handle_SetSomeFlag(SpReqAnsContext<CardIssuerStandService_SetSomeFlag_Req, CardIssuerStandService_SetSomeFlag_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__)("SetSomeFlag , IssueBusiness=%d", ctx->Req.IssueBusiness);
  97. m_pEntity->SetSomeFlag(ctx);
  98. }
  99. void CardIssuerServerSession::Handle_IssueEx(SpReqAnsContext<CardIssuerStandService_IssueEx_Req, CardIssuerStandService_IssueEx_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__)("IssueEx, Req.hopper=%d",ctx->Req.hopper);
  104. m_pEntity->IssueEx(ctx);
  105. }
  106. void CardIssuerServerSession::Handle_QueryCIStatus(SpReqAnsContext<CardIssuerStandService_QueryCIStatus_Req, CardIssuerStandService_QueryCIStatus_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__)("QueryCIStatus");
  111. m_pEntity->QueryCIStatus(ctx);
  112. }
  113. void CardIssuerServerSession::Handle_GetDevInfo(SpReqAnsContext<CardIssuerStandService_GetDevInfo_Req, CardIssuerStandService_GetDevInfo_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__)("GetDevInfo");
  118. m_pEntity->GetDevInfo(ctx);
  119. }
  120. //JS½Ó¿ÚʵÏÖ
  121. void CardIssuerServerSession::Handle_ReadJS(SpReqAnsContext<CardIssuerStandService_ReadJS_Req, CardIssuerStandService_ReadJS_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__)("Invoke ReadJS req.mode=%d, req.business=%s", ctx->Req.mode, ctx->Req.businessData.GetData());
  126. m_pEntity->ReadJS(ctx);
  127. }
  128. void CardIssuerServerSession::Handle_PostOnlineJS(SpReqAnsContext<CardIssuerStandService_PostOnlineJS_Req, CardIssuerStandService_PostOnlineJS_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__)("Invoke PostOnlineJS");
  133. m_pEntity->PostOnlineJS(ctx);
  134. }
  135. void CardIssuerServerSession::Handle_EjectJS(SpReqAnsContext<CardIssuerStandService_EjectJS_Req, CardIssuerStandService_EjectJS_Ans>::Pointer ctx)
  136. {
  137. LOG_FUNCTION();
  138. DbgToBeidou(ctx->link, __FUNCTION__)();
  139. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke EjectJS");
  140. m_pEntity->EjectJS(ctx);
  141. }
  142. void CardIssuerServerSession::Handle_CaptureJS(SpReqAnsContext<CardIssuerStandService_CaptureJS_Req, CardIssuerStandService_CaptureJS_Ans>::Pointer ctx)
  143. {
  144. LOG_FUNCTION();
  145. DbgToBeidou(ctx->link, __FUNCTION__)();
  146. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke CaptureJS");
  147. m_pEntity->CaptureJS(ctx);
  148. }
  149. void CardIssuerServerSession::Handle_QueryHasCardJS(SpReqAnsContext<CardIssuerStandService_QueryHasCardJS_Req, CardIssuerStandService_QueryHasCardJS_Ans>::Pointer ctx)
  150. {
  151. LOG_FUNCTION();
  152. DbgToBeidou(ctx->link, __FUNCTION__)();
  153. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke QueryHasCardJS");
  154. m_pEntity->QueryHasCardJS(ctx);
  155. }
  156. void CardIssuerServerSession::Handle_IssueFromBoxJS(SpReqAnsContext<CardIssuerStandService_IssueFromBoxJS_Req, CardIssuerStandService_IssueFromBoxJS_Ans>::Pointer ctx)
  157. {
  158. LOG_FUNCTION();
  159. DbgToBeidou(ctx->link, __FUNCTION__)();
  160. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke IssueFromBoxJS Req.hopper=%d", ctx->Req.hopper);
  161. m_pEntity->IssueFromBoxJS(ctx);
  162. }
  163. void CardIssuerServerSession::Handle_InsertJS(SpReqAnsContext<CardIssuerStandService_InsertJS_Req, CardIssuerStandService_InsertJS_Ans>::Pointer ctx)
  164. {
  165. LOG_FUNCTION();
  166. DbgToBeidou(ctx->link, __FUNCTION__)();
  167. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke InsertJS");
  168. m_pEntity->InsertJS(ctx);
  169. }
  170. void CardIssuerServerSession::Handle_CancelInsertJS(SpOnewayCallContext<CardIssuerStandService_CancelInsertJS_Info>::Pointer ctx)
  171. {
  172. LOG_FUNCTION();
  173. DbgToBeidou(ctx->link, __FUNCTION__)();
  174. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke CancelInsertJS");
  175. m_pEntity->CancelInsertJS(ctx);
  176. }
  177. void CCardIssuerEntity::OnSysVarEvent(const char* pszKey, const char* pszValue, const char* pszOldValue, const char* pszEntityName)
  178. {
  179. if ((_strnicmp(pszKey, "UIState", strlen("UIState")) == 0))
  180. {
  181. m_fsm.OnUIState4SetWhatPage(pszValue);
  182. }
  183. }
  184. SP_BEGIN_ENTITY_MAP()
  185. SP_ENTITY(CCardIssuerEntity)
  186. SP_END_ENTITY_MAP()