Răsfoiți Sursa

Z991239-5340 #comment 增加GetInputJS接口

oilyang 1 an în urmă
părinte
comite
c424041e2b

+ 49 - 0
Module/mod_pinpad/PinPad_client_g.h

@@ -101,6 +101,55 @@ public:
 		return ret;
 	}
 
+	ErrorCodeEnum GetInputJS(PinPadService_GetInputJS_Req &Req, CSmartPointer<IAsynWaitSp> &spAsyncWait, DWORD dwTimeout)
+	{
+		CSmartPointer<IClientSessionFunction> pFunc = GetFunction();
+		CAutoBuffer Buf = SpObject2Buffer(Req);
+		if (m_context.checkEmpty())
+		{
+			m_context.AutoGenerate();
+			DbgToBeidou(m_context, m_pEntityBase != NULL ? m_pEntityBase->GetEntityName() : "")();
+			m_context = m_context.upgradeLink();
+		}
+		auto ret = pFunc->AsyncRequest(PinPadService_Method_GetInputJS, PinPadService_MethodSignature_GetInputJS, Buf, spAsyncWait, m_context, dwTimeout);
+		m_context.clear();
+		return ret;
+	}
+	ErrorCodeEnum GetInputJS(PinPadService_GetInputJS_Req &Req, PinPadService_GetInputJS_Ans &Ans, DWORD dwTimeout)
+	{
+		CSmartPointer<IAsynWaitSp> spAsyncWait;
+		ErrorCodeEnum Error = GetInputJS(Req, spAsyncWait, dwTimeout);
+		if (Error == Error_Succeed) {
+			bool bEnd = false;
+			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwTimeout);
+			LOG_ASSERT(Error || bEnd);
+		}
+		return Error;
+	}
+	ErrorCodeEnum GetInputJS(PinPadService_GetInputJS_Req &Req, PinPadService_GetInputJS_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError, CSimpleString &str)
+	{
+		CSmartPointer<IAsynWaitSp> spAsyncWait;
+		ErrorCodeEnum Error = GetInputJS(Req, spAsyncWait, dwTimeout);
+		if (Error == Error_Succeed) {
+			bool bEnd = false;
+			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
+			LOG_ASSERT(Error || bEnd);
+		}
+		return Error;
+	}
+	ErrorCodeEnum GetInputJS(PinPadService_GetInputJS_Req &Req, PinPadService_GetInputJS_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError)
+	{
+		CSmartPointer<IAsynWaitSp> spAsyncWait;
+		ErrorCodeEnum Error = GetInputJS(Req, spAsyncWait, dwTimeout);
+		if (Error == Error_Succeed) {
+			bool bEnd = false;
+			CSimpleString str;
+			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
+			LOG_ASSERT(Error || bEnd);
+		}
+		return Error;
+	}
+
 	ErrorCodeEnum GetInputSM(PinPadService_GetInputSM_Req &Req, CSmartPointer<IAsynWaitSp> &spAsyncWait, DWORD dwTimeout)
 	{
 		CSmartPointer<IClientSessionFunction> pFunc = GetFunction();

+ 42 - 1
Module/mod_pinpad/PinPad_def_g.h

@@ -15,6 +15,7 @@ namespace PinPad {
 #define PinPadService_Method_InputWaitMore 1
 #define PinPadService_Method_InputCancel 2
 #define PinPadService_Method_Exit 3
+#define PinPadService_Method_GetInputJS 4
 #define PinPadService_Method_GetInputSM 6
 #define PinPadService_Method_LoadKeysSM 7
 #define PinPadService_Method_EncryptDataSM 8
@@ -25,6 +26,7 @@ namespace PinPad {
 #define PinPadService_MethodSignature_InputWaitMore -1387532134
 #define PinPadService_MethodSignature_InputCancel 1552926476
 #define PinPadService_MethodSignature_Exit -1158854104
+#define PinPadService_MethodSignature_GetInputJS -1183236923
 #define PinPadService_MethodSignature_GetInputSM -1531281659
 #define PinPadService_MethodSignature_LoadKeysSM -2091559314
 #define PinPadService_MethodSignature_EncryptDataSM 1251510330
@@ -32,10 +34,10 @@ namespace PinPad {
 #define PinPadService_MethodSignature_GetCheckCode -1480133527
 #define PinPadService_MethodSignature_GetDevInfo 296205965
 
-
 #define PinPadService_LogCode_InputWaitMore "QLR040220601"
 #define PinPadService_LogCode_InputCancel "QLR040220602"
 #define PinPadService_LogCode_Exit "QLR040220603"
+#define PinPadService_LogCode_GetInputJS "QLR040220604"
 #define PinPadService_LogCode_GetInputSM "QLR040220606"
 #define PinPadService_LogCode_LoadKeysSM "QLR040220607"
 #define PinPadService_LogCode_EncryptDataSM "QLR040220608"
@@ -70,6 +72,45 @@ struct PinPadService_Exit_Info
 
 };
 
+struct PinPadService_GetInputJS_Req
+{
+	int timeout;
+	int length;
+	bool encrypt;
+	bool confirm;
+	int smflag;
+	CSimpleStringA account;
+	int reserved1;
+	int reserved2;
+	CSimpleStringA reserved3;
+	CSimpleStringA reserved4;
+
+	void Serialize(SpBuffer &Buf)
+	{
+		auto & buf = Buf & timeout & length & encrypt & confirm & smflag & account & reserved1 & reserved2 & reserved3 & reserved4;
+	}
+
+};
+
+struct PinPadService_GetInputJS_Ans
+{
+	CSimpleStringA data;
+	CSimpleStringA deviceno;
+	CSimpleStringA keyseq;
+	CSimpleStringA checkcode;
+	bool enter;
+	int reserved1;
+	int reserved2;
+	CSimpleStringA reserved3;
+	CSimpleStringA reserved4;
+
+	void Serialize(SpBuffer &Buf)
+	{
+		auto & buf = Buf & data & deviceno & keyseq & checkcode & enter & reserved1 & reserved2 & reserved3 & reserved4;
+	}
+
+};
+
 struct PinPadService_GetInputSM_Req
 {
 	int timeout;

+ 27 - 0
Module/mod_pinpad/PinPad_server_g.h

@@ -51,6 +51,13 @@ public:
 				Error = Error_MethodSignatureFailed;
 			}
 			break;
+		case PinPadService_Method_GetInputJS:
+			if (dwSignature == PinPadService_MethodSignature_GetInputJS) {
+				bOverlap = true;
+			} else {
+				Error = Error_MethodSignatureFailed;
+			}
+			break;
 		case PinPadService_Method_GetInputSM:
 			if (dwSignature == PinPadService_MethodSignature_GetInputSM) {
 				bOverlap = true;
@@ -119,6 +126,11 @@ public:
 				Error = Error_MethodSignatureFailed;
 			}
 			break;
+		case PinPadService_Method_GetInputJS:
+			if (dwSignature != PinPadService_MethodSignature_GetInputJS) {
+				Error = Error_MethodSignatureFailed;
+			}
+			break;
 		case PinPadService_Method_GetInputSM:
 			if (dwSignature != PinPadService_MethodSignature_GetInputSM) {
 				Error = Error_MethodSignatureFailed;
@@ -171,6 +183,11 @@ public:
 	/// override by user
 	}
 
+	virtual void Handle_GetInputJS(SpReqAnsContext<PinPadService_GetInputJS_Req, PinPadService_GetInputJS_Ans>::Pointer ctx)
+	{
+	/// override by user
+	}
+
 	virtual void Handle_GetInputSM(SpReqAnsContext<PinPadService_GetInputSM_Req, PinPadService_GetInputSM_Ans>::Pointer ctx)
 	{
 	/// override by user
@@ -247,6 +264,16 @@ public:
 						Handle_Exit(ctx);
 					}
 					break;
+				case PinPadService_Method_GetInputJS:
+					{
+						SpReqAnsContext<PinPadService_GetInputJS_Req,PinPadService_GetInputJS_Ans>::Pointer ctx;
+						ctx.Attach(new SpReqAnsContext<PinPadService_GetInputJS_Req,PinPadService_GetInputJS_Ans>(pTransactionContext));
+						SpBuffer2Object(Buf, ctx->Req);
+						pTransactionContext->GetLinkContext(ctx->link);
+						EntityResource::setLink(ctx->link);
+						Handle_GetInputJS(ctx);
+					}
+					break;
 				case PinPadService_Method_GetInputSM:
 					{
 						SpReqAnsContext<PinPadService_GetInputSM_Req,PinPadService_GetInputSM_Ans>::Pointer ctx;

+ 25 - 0
Module/mod_pinpad/pinpad.xml

@@ -7,6 +7,31 @@
 		</oneway>
 		<oneway name="Exit" overlap="true" method_id="3">		
 		</oneway>
+		<twoway name="GetInputJS" overlap="true" method_id="4">
+			<req>
+				<param name="timeout" type="int" />
+				<param name="length" type="int" />
+				<param name="encrypt" type="bool" />
+				<param name="confirm" type="bool" />
+				<param name="smflag" type="int" />
+				<param name="account" type="string" />
+				<param name="reserved1" type="int" />
+				<param name="reserved2" type="int" />
+				<param name="reserved3" type="string" />
+				<param name="reserved4" type="string" />
+			</req>
+			<res>
+				<param name="data" type="string" />
+				<param name="deviceno" type="string" />
+				<param name="keyseq" type="string" />
+				<param name="checkcode" type="string" />
+				<param name="enter" type="bool" />
+				<param name="reserved1" type="int" />
+				<param name="reserved2" type="int" />
+				<param name="reserved3" type="string" />
+				<param name="reserved4" type="string" />
+			</res>			
+		</twoway>
 		<twoway name="GetInputSM" overlap="true" method_id="6">
 			<req>
 				<param name="timeout" type="int" />