mod_cardissuer.cpp 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  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. 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<CardIssuerService_Read_Req, CardIssuerService_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<CardIssuerService_Capture_Req, CardIssuerService_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<CardIssuerService_Eject_Req, CardIssuerService_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<CardIssuerService_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<CardIssuerService_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<CardIssuerService_PreOnline_Req, CardIssuerService_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");
  55. m_pEntity->PreOnline(ctx);
  56. }
  57. void CardIssuerServerSession::Handle_PostOnline(SpReqAnsContext<CardIssuerService_PostOnline_Req, CardIssuerService_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<CardIssuerService_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<CardIssuerService_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<CardIssuerService_QueryCardInfo_Req, CardIssuerService_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<CardIssuerService_WriteTrack_Req, CardIssuerService_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<CardIssuerService_GetMaterialCountEx_Req, CardIssuerService_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<CardIssuerService_SetMaterialCountEx_Req, CardIssuerService_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<CardIssuerService_SetSomeFlag_Req, CardIssuerService_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");
  111. m_pEntity->SetSomeFlag(ctx);
  112. }
  113. void CardIssuerServerSession::Handle_IssueEx(SpReqAnsContext<CardIssuerService_IssueEx_Req, CardIssuerService_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");
  118. m_pEntity->IssueEx(ctx);
  119. }
  120. void CardIssuerServerSession::Handle_SAMICCommand(SpReqAnsContext<CardIssuerService_SAMICCommand_Req, CardIssuerService_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<CardIssuerService_QueryCIStatus_Req, CardIssuerService_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<CardIssuerService_GetDevInfo_Req, CardIssuerService_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. void CCardIssuerEntity::OnSysVarEvent(const char* pszKey, const char* pszValue, const char* pszOldValue, const char* pszEntityName)
  141. {
  142. if ((_strnicmp(pszKey, "UIState", strlen("UIState")) == 0))
  143. {
  144. if (_strnicmp(pszValue, "M", strlen("M")) == 0)
  145. m_fsm.SetInWhatPage(PageType_MainPage);
  146. else if (_strnicmp(pszValue, "U", strlen("U")) == 0)
  147. m_fsm.SetInWhatPage(PageType_UserDesktop);
  148. else
  149. m_fsm.SetInWhatPage(PageType_Other);
  150. }
  151. }
  152. SP_BEGIN_ENTITY_MAP()
  153. SP_ENTITY(CCardIssuerEntity)
  154. SP_END_ENTITY_MAP()