internal static CoreAcctDetail OnRetrieveAccounting(String tellerno, String orgno, DateTime tradedate, String coreSN, out String outmsg)
        {
            outmsg = "";
            CoreAcctDetail resultdetail = null;
            byte[] codemsg = null;
            bool sent = false;
            string dbexception = "";
            MessageData reqdata = null;
            MessageData recdata = null;
            Guid msgid = Guid.Empty;
            try
            {
                msgid = MsgTransferUtility.RetrieveAccounting(tellerno, orgno, tradedate, coreSN, ref codemsg);
                reqdata = MsgHandlerEntry.CreateMessageData(msgid, PlatformType.Core, tellerno, orgno, (int)MessageBizType.CoreAcctRetrieve, codemsg);
#if MQSYNC
                recdata = MQMsgHandlerEntry.DeliverMessage(reqdata, codemsg, out sent);
#else
                recdata = MsgHandlerEntry.DeliverMessage(MsgHandlerEntry.CreateMessageData(msgid, PlatformType.Core, codemsg));
#endif
                AcctRetrieveData retdata = MsgTransfer.DecodeMsg(recdata.MessageID, recdata.CurrentRespPackage.PackageMessage) as AcctRetrieveData;
                if (retdata != null)
                {
                    if (!String.IsNullOrEmpty(retdata.SyserrHandler.Message))
                    {
                        outmsg = retdata.SyserrHandler.Message;
                    }
                    else if (retdata.OmsgHandler.NUM_ENT > 0)
                    {
                        outmsg = MsgHandlerEntry.ExtractOMsg(retdata);
                    }
                    else if (retdata.OData != null)
                    {
                        resultdetail = new CoreAcctDetail();
                        if (retdata.OData.DB_BGO30800 != null && !String.IsNullOrEmpty(retdata.OData.DB_BGO30800.CoreTradeSN))
                        {
                            resultdetail.DB_BGO30800.CoreTradeSN = CommonDataHelper.StrTrimer(retdata.OData.DB_BGO30800.CoreTradeSN, null);
                            resultdetail.DB_BGO30800.SrcSystemCode = CommonDataHelper.StrTrimer(retdata.OData.DB_BGO30800.SrcSystemCode, null);
                            resultdetail.DB_BGO30800.AcctSNFlag = CommonDataHelper.StrTrimer(retdata.OData.DB_BGO30800.AcctSNFlag, null);
                            resultdetail.DB_BGO30800.OutsideSN = CommonDataHelper.StrTrimer(retdata.OData.DB_BGO30800.OutsideSN, null);
                            resultdetail.DB_BGO30800.ErasedFlag = CommonDataHelper.StrTrimer(retdata.OData.DB_BGO30800.ErasedFlag, null);
                        }

                        foreach (AcctRetrieveODATA_DB2 item in retdata.OData.DB_BGO30801_List)
                        {
                            AcctDetail_BGO30801 detail01item = new AcctDetail_BGO30801();
                            detail01item.CoreTradeSN = CommonDataHelper.StrTrimer(item.CoreTradeSN, null);
                            detail01item.TradeAccount = CommonDataHelper.StrTrimer(item.TradeAccount, null);
                            detail01item.AccountName = CommonDataHelper.StrTrimer(item.AccountName, null);
                            detail01item.CashFalg = CommonDataHelper.StrTrimer(item.CashFalg, null);
                            detail01item.LoanFlag = CommonDataHelper.StrTrimer(item.LoanFlag, null);
                            detail01item.Amount = CommonDataHelper.StrTrimer(item.Amount, null);
                            detail01item.VoucherNO = CommonDataHelper.StrTrimer(item.VoucherNO, null);
                            detail01item.SrcSystemCode = CommonDataHelper.StrTrimer(item.SrcSystemCode, null);
                            detail01item.PostingCashFlag = CommonDataHelper.StrTrimer(item.PostingCashFlag, null);
                            resultdetail.DB_BGO30801_List.Add(detail01item);
                        }

                        if (retdata.OData.DB_BGO30802 != null)
                        {
                            resultdetail.DB_BGO30802.IsQuotaMoney = CommonDataHelper.StrTrimer(retdata.OData.DB_BGO30802.IsQuotaMoney, null);
                            resultdetail.DB_BGO30802.QuotaMoneyCount = retdata.OData.DB_BGO30802.QuotaMoneyCount;
                        }

                        foreach (AcctRetrieveODATA_DB4 item in retdata.OData.DB_BGO30803_List)
                        {
                            AcctDetail_BGO30803 detail03item = new AcctDetail_BGO30803();
                            detail03item.Currency = CommonDataHelper.StrTrimer(item.Currency, null);
                            detail03item.QuotaAmount = CommonDataHelper.StrTrimer(item.QuotaAmount, null);
                            resultdetail.DB_BGO30803_List.Add(detail03item);
                        }
                        //MQMsgCommonHelper.UpdateMQLog(recdata, null, outmsg, MsgLogState.RecvSucceed, out dbexception);
                        return resultdetail;
                    }
                }
                else
                {
                    outmsg = MsgHandlerEntry.Type_Convert_Error;
                }
                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;
            }
        }
 /// <summary>
 /// 记账查询
 /// </summary>
 /// <param name="orgno">机构号</param>
 /// <param name="tellerno">柜员号</param>
 /// <param name="tradedate">发生日期</param>
 /// <param name="coreSN">核心交易流水号</param>
 /// <param name="result">查询结构</param>
 /// <param name="outmsg">记账失败时的信息</param>
 /// <returns>查询成功与否</returns>
 public static bool CoreAcctRetrieve(String orgno, String tellerno, DateTime tradedate, String coreSN, out CoreAcctDetail result, out String outmsg)
 {
     result = ClientSyncHelper.OnRetrieveAccounting(tellerno, orgno, tradedate, coreSN, out outmsg);
     if (result != null)
     {
         return true;
     }
     outmsg = string.Format("{0}{1}", MsgHandlerEntry.Info_Return_Core, outmsg);
     return false;
 }