예제 #1
0
        internal static PaymentResult OnPayCheckAcct(DateTime queryDate, out List<PayCheckAcct> outData, out String outmsg)
        {
            outmsg = "";
            outData = null;
            PaymentResult resultdetail = null;
            byte[] codemsg = null;
            bool sent = false;
            string dbexception = "";
            MessageData recdata = null;
            MessageData reqdata = null;
            Guid msgid = Guid.Empty;
            try
            {
                msgid = MsgTransferUtility.PayCheckAccount(queryDate, ref codemsg);
                reqdata = MsgHandlerEntry.CreateMessageData(msgid, PlatformType.PaymentDownload, MsgHandlerEntry.System_Organ_ID, MsgHandlerEntry.System_Teller_ID, (int)MessageBizType.PayCheckAccout, codemsg, "");
#if MQSYNC
                recdata = MQMsgHandlerEntry.DeliverMessage(reqdata, codemsg, out sent);
#else
                recdata = MsgHandlerEntry.DeliverMessage(MsgHandlerEntry.CreateMessageData(msgid, PlatformType.Payment, codemsg));
#endif
                PayAcctCheckData retdata = MsgTransfer.DecodeMsg(recdata.MessageID, recdata.CurrentRespPackage.PackageMessage) as PayAcctCheckData;
                MsgLogState statecode = MsgLogState.RecvFailed;
                if (retdata != null && retdata.RPData != null)
                {
                    resultdetail = new PaymentResult();
                    resultdetail.Succeed = (CommonDataHelper.StrTrimer(retdata.RPData.RetCode, null) == "0");
                    resultdetail.HostReturnMessage = CommonDataHelper.StrTrimer(retdata.RPData.RetMsg, null);
                    outmsg = CommonDataHelper.StrTrimer(retdata.RPData.RetMsg, null);
                    
                    if (CommonDataHelper.StrTrimer(retdata.RPData.RetCode, null) == "0")
                    {
                        statecode = MsgLogState.RecvSucceed;
                        if (retdata.RPData.AccoutCount > 0)
                        {
                            outData = new List<PayCheckAcct>();
                            foreach (PayAcctCheckItemRP item in retdata.RPData.AccountList)
                            {
                                PayCheckAcct check = new PayCheckAcct();
                                check.AccountFlag = CommonDataHelper.StrTrimer(item.AccountFlag, null);
                                check.Amount = CommonDataHelper.StrTrimer(item.Amount, null);
                                check.BizType = CommonDataHelper.StrTrimer(item.BizType, null);
                                check.ChanelFlag = CommonDataHelper.StrTrimer(item.ChanelFlag, null);
                                check.Currency = CommonDataHelper.StrTrimer(item.Currency, null);
                                check.Fee = CommonDataHelper.StrTrimer(item.Fee, null);
                                check.HostFlowNO = CommonDataHelper.StrTrimer(item.HostFlowNO, null);
                                check.HostRespCode = CommonDataHelper.StrTrimer(item.HostRespCode, null);
                                check.HostRespMsg = CommonDataHelper.StrTrimer(item.HostRespMsg, null);
                                check.HostTradeDate = CommonDataHelper.StrTrimer(item.HostTradeDate, null);
                                check.IBOLimit = CommonDataHelper.StrTrimer(item.IBOLimit, null);
                                check.IBORate = CommonDataHelper.StrTrimer(item.IBORate, null);
                                check.MsgNO = CommonDataHelper.StrTrimer(item.MsgNO, null);
                                check.Note = CommonDataHelper.StrTrimer(item.Note, null);
                                check.Operator = CommonDataHelper.StrTrimer(item.Operator, null);
                                check.OrganNO = CommonDataHelper.StrTrimer(item.OrganNO, null);
                                check.PayAccount = CommonDataHelper.StrTrimer(item.PayAccount, null);
                                check.PayBankName = CommonDataHelper.StrTrimer(item.PayBankName, null);
                                check.PayBankNO = CommonDataHelper.StrTrimer(item.PayBankNO, null);
                                check.PayName = CommonDataHelper.StrTrimer(item.PayName, null);
                                check.PlatDate = CommonDataHelper.StrTrimer(item.PlatDate, null);
                                check.RecvAccount = CommonDataHelper.StrTrimer(item.RecvAccount, null);
                                check.RecvBankName = CommonDataHelper.StrTrimer(item.RecvBankName, null);
                                check.RecvBankNO = CommonDataHelper.StrTrimer(item.RecvBankNO, null);
                                check.RecvName = CommonDataHelper.StrTrimer(item.RecvName, null);
                                check.SeqNO = CommonDataHelper.StrTrimer(item.SeqNO, null);
                                check.SysSeqNO = CommonDataHelper.StrTrimer(item.SysSeqNO, null);
                                check.TradeDate = CommonDataHelper.StrTrimer(item.TradeDate, null);
                                check.TradeTime = CommonDataHelper.StrTrimer(item.TradeTime, null);
                                check.UploadChannel = CommonDataHelper.StrTrimer(item.UploadChannel, null);
                                outData.Add(check);
                            }
                        }

                    }
                    else
                    {
                        statecode = MsgLogState.RecvFailed;
                    }
                }
                else
                {
                    outmsg = MsgHandlerEntry.Type_Convert_Error;
                }
                if (statecode != MsgLogState.RecvSucceed)
                {
                    //MQMsgCommonHelper.UpdateMQLog(recdata.MessageID, outmsg, statecode, out dbexception);
                    OnUpdateDBLog(recdata.MessageID, outmsg, MsgLogState.RecvFailed, out dbexception);
                }
                return resultdetail;
            }
            catch (Exception ex)
            {
                outmsg = ex.Message;
                OnException(sent, reqdata, recdata, msgid, ex, outmsg);
                return resultdetail;
            }
        }
예제 #2
0
        internal static PaymentResult OnPayDownloadBanksInfo(out List<PayBanksInfo> outData, out String outmsg)
        {
            outmsg = "";
            outData = null;
            PaymentResult resultdetail = null;
            byte[] codemsg = null;
            bool sent = false;
            string dbexception = "";
            MessageData recdata = null;
            MessageData reqdata = null;
            Guid msgid = Guid.Empty;
            try
            {
                msgid = MsgTransferUtility.PayRetrieveBanksInfo(ref codemsg);
                reqdata = MsgHandlerEntry.CreateMessageData(msgid, PlatformType.PaymentDownload, MsgHandlerEntry.System_Organ_ID, MsgHandlerEntry.System_Teller_ID, (int)MessageBizType.PayBanksInfoDownload, codemsg, "");
#if MQSYNC
                recdata = MQMsgHandlerEntry.DeliverMessage(reqdata, codemsg, out sent);
#else
                recdata = MsgHandlerEntry.DeliverMessage(MsgHandlerEntry.CreateMessageData(msgid, PlatformType.Payment, codemsg));
#endif
                PayBankInfoData retdata = MsgTransfer.DecodeMsg(recdata.MessageID, recdata.CurrentRespPackage.PackageMessage) as PayBankInfoData;
                MsgLogState statecode = MsgLogState.RecvFailed;
                if (retdata != null && retdata.RPData != null)
                {
                    resultdetail = new PaymentResult();
                    resultdetail.Succeed = (CommonDataHelper.StrTrimer(retdata.RPData.RetCode, null) == "0");
                    resultdetail.HostReturnMessage = CommonDataHelper.StrTrimer(retdata.RPData.RetMsg, null);
                    outmsg = CommonDataHelper.StrTrimer(retdata.RPData.RetMsg, null);
                    
                    if (CommonDataHelper.StrTrimer(retdata.RPData.RetCode, null) == "0")
                    {
                        statecode = MsgLogState.RecvSucceed;
                        if (retdata.RPData.BankCount > 0)
                        {
                            outData = new List<PayBanksInfo>();
                            foreach (PayBankInfoItemRP item in retdata.RPData.BankList)
                            {
                                PayBanksInfo check = new PayBanksInfo();
                                check.Address = CommonDataHelper.StrTrimer(item.Address, null);
                                check.BankName = CommonDataHelper.StrTrimer(item.BankName, null);
                                check.BankNO = CommonDataHelper.StrTrimer(item.BankNO, null);
                                check.CityCode = CommonDataHelper.StrTrimer(item.CityCode, null);
                                check.DirectParticipator = CommonDataHelper.StrTrimer(item.DirectParticipator, null);
                                check.NodeCode = CommonDataHelper.StrTrimer(item.NodeCode, null);
                                check.TelephoneNO = CommonDataHelper.StrTrimer(item.TelephoneNO, null);
                               
                                outData.Add(check);
                            }
                        }
                    }
                    else
                    {
                        statecode = MsgLogState.RecvFailed;
                    }
                }
                else
                {
                    outmsg = MsgHandlerEntry.Type_Convert_Error;
                }
                if (statecode != MsgLogState.RecvSucceed)
                {
                    //MQMsgCommonHelper.UpdateMQLog(recdata.MessageID, outmsg, statecode, out dbexception);
                    OnUpdateDBLog(recdata.MessageID, outmsg, MsgLogState.RecvFailed, out dbexception);
                }
                return resultdetail;
            }
            catch (Exception ex)
            {
                outmsg = ex.Message;
                OnException(sent, reqdata, recdata, msgid, ex, outmsg);
                return resultdetail;
            }
        }
예제 #3
0
        internal static PaymentResult OnPayVostroAccountEliminate(String tellerNO, String orgNO, DateTime delegateDate, PayVostroAcctEliminate inputData, String exFlowNO, out String outmsg)
        {
            outmsg = "";
            PaymentResult resultdetail = null;
            byte[] codemsg = null;
            bool sent = false;
            string dbexception = "";
            MessageData reqdata = null;
            MessageData recdata = null;
            Guid msgid = Guid.Empty;
            try
            {
                msgid = MsgTransferUtility.PayVostroAccountEliminate(tellerNO, orgNO, delegateDate.ToString("yyyyMMdd"), inputData, ref codemsg);
                reqdata = MsgHandlerEntry.CreateMessageData(msgid, PlatformType.Payment, tellerNO, orgNO, (int)MessageBizType.PayVostroAcctEliminate, codemsg);
#if MQSYNC
                recdata = MQMsgHandlerEntry.DeliverMessage(reqdata, codemsg, out sent);
#else
                recdata = MsgHandlerEntry.DeliverMessage(MsgHandlerEntry.CreateMessageData(msgid, PlatformType.Payment, codemsg));
#endif
                PayVostroAcctEliminateData retdata = MsgTransfer.DecodeMsg(recdata.MessageID, recdata.CurrentRespPackage.PackageMessage) as PayVostroAcctEliminateData;
                MsgLogState statecode = MsgLogState.RecvFailed;
                if (retdata != null && retdata.RPData != null)
                {
                    resultdetail = new PaymentResult();
                    resultdetail.Succeed = (retdata.RPData.RetCode == "00");
                    resultdetail.HostReturnMessage = CommonDataHelper.StrTrimer(retdata.RPData.HostReturnMessage, null);
                    resultdetail.HostReturnCode = CommonDataHelper.StrTrimer(retdata.RPData.HostReturnCode, null);
                    resultdetail.HostTranFlowNo = CommonDataHelper.StrTrimer(retdata.RPData.HostTranFlowNo, null);
                    resultdetail.TransSeq = CommonDataHelper.StrTrimer(retdata.RPData.TransSeq, null);
                    resultdetail.PendingSN = CommonDataHelper.StrTrimer(retdata.RPData.PendingSN, null);
                    outmsg = CommonDataHelper.StrTrimer(retdata.RPData.HostReturnMessage, null);
                    
                    if (retdata.RPData.RetCode == "00")
                    {
                        statecode = MsgLogState.RecvSucceed;
                    }
                    else if (retdata.RPData.RetCode == "02")
                    {
                        statecode = MsgLogState.PayTimeOut;
                    }
                }
                else
                {
                    outmsg = MsgHandlerEntry.Type_Convert_Error;
                }
                //转换保存此次来账销账的资金流水号
                if (!string.IsNullOrEmpty(exFlowNO))
                {
                    recdata.BizMsgID = exFlowNO;
                    //MQMsgCommonHelper.UpdateMQLog(recdata,  resultdetail.HostTranFlowNo, outmsg, statecode, out dbexception);
                    OnUpdateDBLog(recdata, resultdetail.HostTranFlowNo, outmsg, statecode, out dbexception);
                }
                return resultdetail;
            }
            catch (Exception ex)
            {
                outmsg = ex.Message;
                OnException(sent, reqdata, recdata, msgid, ex, outmsg);
                return resultdetail;
            }
        }
예제 #4
0
        internal static PaymentResult OnPayInterBankBiz(String tellerNO, String orgNO, DateTime tradeDate, PayInterBank inputData, out String outmsg)
        {
            outmsg = "";
            PaymentResult resultdetail = null;
            byte[] codemsg = null;
            bool sent = false;
            string dbexception = "";
            MessageData recdata = null;
            MessageData reqdata = null;
            Guid msgid = Guid.Empty;
            try
            {
                msgid = MsgTransferUtility.PayInterBankBiz(tellerNO, orgNO, tradeDate, inputData, ref codemsg);
                reqdata = MsgHandlerEntry.CreateMessageData(msgid, PlatformType.Payment, tellerNO, orgNO, (int)MessageBizType.PayInterBank, codemsg, inputData.TransferFlowNo);
#if MQSYNC
                recdata = MQMsgHandlerEntry.DeliverMessage(reqdata, codemsg, out sent);
#else
                recdata = MsgHandlerEntry.DeliverMessage(MsgHandlerEntry.CreateMessageData(msgid, PlatformType.Payment, codemsg));
#endif
                PayInterBankData retdata = MsgTransfer.DecodeMsg(recdata.MessageID, recdata.CurrentRespPackage.PackageMessage) as PayInterBankData;
                MsgLogState statecode = MsgLogState.RecvFailed;
                if (retdata != null && retdata.RPData != null)
                {
                    resultdetail = new PaymentResult();
                    resultdetail.Succeed = (retdata.RPData.RetCode == "00");
                    resultdetail.HostReturnMessage = CommonDataHelper.StrTrimer(retdata.RPData.HostReturnMessage, null);
                    resultdetail.HostReturnCode = CommonDataHelper.StrTrimer(retdata.RPData.HostReturnCode, null);
                    resultdetail.HostTranFlowNo = CommonDataHelper.StrTrimer(retdata.RPData.HostTranFlowNo, null);
                    resultdetail.TransSeq = CommonDataHelper.StrTrimer(retdata.RPData.TransSeq, null);
                    outmsg = CommonDataHelper.StrTrimer(retdata.RPData.HostReturnMessage, null);
                    
                    if (retdata.RPData.RetCode == "00")
                    {
                        statecode = MsgLogState.RecvSucceed;
                    }
                    else if (retdata.RPData.RetCode == "02")
                    {
                        statecode = MsgLogState.PayTimeOut;
                    }
                }
                else
                {
                    outmsg = MsgHandlerEntry.Type_Convert_Error;
                }
                //MQMsgCommonHelper.UpdateMQLog(recdata, resultdetail.HostTranFlowNo, outmsg, statecode, out dbexception);
                OnUpdateDBLog(recdata, resultdetail.HostTranFlowNo, outmsg, statecode, out dbexception);
                return resultdetail;
            }
            catch (Exception ex)
            {
                outmsg = ex.Message;
                OnException(sent, reqdata, recdata, msgid, ex, outmsg);
                return resultdetail;
            }
        }
예제 #5
0
        internal static PaymentResult OnPayRegisterRetrieved(String tellerNO, String orgNO, String flowNO, DateTime orignalDate, out String outmsg)
        {
            outmsg = "";
            PaymentResult resultdetail = null;
            byte[] codemsg = null;
            bool sent = false;
            string dbexception = "";
            MessageData reqdata = null;
            MessageData recdata = null;
            Guid msgid = Guid.Empty;
            try
            {
                msgid = MsgTransferUtility.PayRegisterRetrieved(tellerNO, orgNO,flowNO,orignalDate, ref codemsg);
                reqdata = MsgHandlerEntry.CreateMessageData(msgid, PlatformType.Payment, tellerNO, orgNO, (int)MessageBizType.PayRegisterRetrieve, codemsg, flowNO);
                recdata = MQMsgHandlerEntry.DeliverMessage(reqdata, codemsg, out sent);

                PayRegisterRetrievedData retdata = MsgTransfer.DecodeMsg(recdata.MessageID, recdata.CurrentRespPackage.PackageMessage) as PayRegisterRetrievedData;
                MsgLogState statecode = MsgLogState.RecvFailed;
                if (retdata != null && retdata.RPData != null)
                {
                    resultdetail = new PaymentResult();
                    resultdetail.Succeed = (retdata.RPData.RetCode == "00");
                    resultdetail.HostReturnMessage = CommonDataHelper.StrTrimer(retdata.RPData.RetMsg,null);
                    resultdetail.AccountStatus = CommonDataHelper.StrTrimer(retdata.RPData.AccountStatus,null);
                    resultdetail.PackageChannelType = CommonDataHelper.StrTrimer(retdata.RPData.PackageChannelType,null);
                    outmsg = CommonDataHelper.StrTrimer(retdata.RPData.RetMsg, null);
                                       
                    if (retdata.RPData.RetCode == "00")
                    {
                        statecode = MsgLogState.RecvSucceed;
                    }
                    else if (retdata.RPData.RetCode == "02")
                    {
                        statecode = MsgLogState.PayTimeOut;
                    }
                }
                else
                {
                    outmsg = MsgHandlerEntry.Type_Convert_Error;
                }

                if (statecode != MsgLogState.RecvSucceed)
                {
                    OnUpdateDBLog(recdata.MessageID, outmsg, statecode, out dbexception);
                }
                
                return resultdetail;
            }
            catch (Exception ex)
            {
                outmsg = ex.Message;
                OnException(sent, reqdata, recdata, msgid, ex, outmsg);
                
                return resultdetail;
            }
        }
 /// <summary>
 /// 同业拆借业务
 /// </summary>
 /// <param name="tellerNO">机构号</param>
 /// <param name="orgNO">柜员号</param>
 /// <param name="tradeDate">交易日期</param>
 /// <param name="inputData">输入数据</param>
 /// <param name="result">返回结果的数据</param>
 /// <param name="outmsg">失败时的信息</param>
 /// <returns>成功与否</returns>
 public static bool PayInterBankBiz(String tellerNO, String orgNO, DateTime tradeDate, PayInterBank inputData, out PaymentResult result, out String outmsg)
 {
     result = ClientSyncHelper.OnPayInterBankBiz(tellerNO, orgNO, tradeDate, inputData, out outmsg);
     if (result != null && result.Succeed)
     {
         return true;
     }
     outmsg = string.Format("{0}{1}", MsgHandlerEntry.Info_Return_Pay, outmsg);
     return false;
 }
 /// <summary>
 /// 来账的销账
 /// </summary>
 /// <param name="tellerNO">机构号</param>
 /// <param name="orgNO">柜员号</param>
 /// <param name="delegateDate">委托日期</param>
 /// <param name="inputData">销账输入数据</param>
 /// <param name="result">返回结果的数据</param>
 /// <param name="outmsg">失败时的信息</param>
 /// <returns>成功与否</returns>
 public static bool PayVostroAccountEliminate(String tellerNO, String orgNO, DateTime delegateDate, PayVostroAcctEliminate inputData, String exFlowNO, out PaymentResult result, out String outmsg)
 {
     result = ClientSyncHelper.OnPayVostroAccountEliminate(tellerNO, orgNO, delegateDate, inputData, exFlowNO, out outmsg);
     if (result != null && result.Succeed)
     {
         return true;
     }
     outmsg = string.Format("{0}{1}", MsgHandlerEntry.Info_Return_Pay, outmsg);
     return false;
 }
 /// <summary>
 /// 来帐销账后的抹帐交易
 /// </summary>
 /// <returns></returns>
 public static bool PayIncomeEraseAccounting(String tellerNO, String orgNO, String srcBankNO, String paySN, DateTime orignalDate, String channelType, String hostFlowNO, out PaymentResult result, out String outmsg)
 {
     result = ClientSyncHelper.OnPayIncomeEraseAccounting(tellerNO, orgNO, paySN, srcBankNO, orignalDate, channelType, hostFlowNO, out outmsg);
     if (result != null && result.Succeed)
     {
         return true;
     }
     outmsg = string.Format("{0}{1}", MsgHandlerEntry.Info_Return_Pay, outmsg);
     return false;
 }
 /// <summary>
 /// 登记簿查询
 /// </summary>
 /// <param name="tellerNO">交易机构号</param>
 /// <param name="orgNO">柜员号</param>
 /// <param name="flowNO">资金业务系统流水号</param>
 /// <param name="orignalDate">原委托日期</param>
 /// <param name="result">返回结果的数据</param>
 /// <param name="outmsg">失败时的信息</param>
 /// <returns>查询成功与否</returns>
 public static bool RetrievePayRegister(String tellerNO, String orgNO, String flowNO, DateTime orignalDate, out PaymentResult result, out String outmsg)
 {
     result = ClientSyncHelper.OnPayRegisterRetrieved(tellerNO, orgNO, flowNO, orignalDate, out outmsg);
     if (result != null && result.Succeed)
     {
         return true;
     }
     outmsg = string.Format("{0}{1}", MsgHandlerEntry.Info_Return_Pay, outmsg);
     return false;
 }