/// <summary>
        /// 内部账查询
        /// </summary>
        /// <param name="tellerNO">操作柜员号</param>
        /// <param name="organNO">交易机构号</param>
        /// <param name="tradeDate">业务交易日</param>
        /// <param name="condition">查询条件数据对象</param>
        /// <param name="codemsg"></param>
        /// <returns></returns>
        public static Guid RetrieveInternalAcct(String tellerNO, String organNO, DateTime tradeDate, InternalAcctCondtion condition, ref byte[] codemsg)
        {
            InterAcctRetrieveData interdata = new InterAcctRetrieveData();

            interdata.RQhdrHandler.SYS_TXID = "230110"; // 会计记账,主机启动原交易码
            interdata.RQhdrHandler.TX_OUNO = organNO;
            interdata.RQhdrHandler.TEL_ID = tellerNO;
            interdata.RQhdrHandler.TX_MODE = "0";
            interdata.RQhdrHandler.TX_DTE = tradeDate.ToString("yyyy-MM-dd");
            interdata.RQhdrHandler.SRV_JNO = CommonDataHelper.SpaceString(12);
            interdata.RQhdrHandler.SRV_REV_JNO = CommonDataHelper.SpaceString(12);
            interdata.RQhdrHandler.SRV_JNO = CommonDataHelper.SpaceString(12);
            interdata.RQhdrHandler.SRV_REV_JNO = CommonDataHelper.SpaceString(12);
            interdata.RQhdrHandler.HOST_JNO = CommonDataHelper.SpaceString(11);

            interdata.RQDTL.AccountNO = condition.AccountNO;
            interdata.RQDTL.Currcency = condition.Currcency;
            interdata.RQDTL.OrgnaztionNO = condition.OrgnaztionNO;
            interdata.RQDTL.SequenceNO = condition.SequenceNO;
            interdata.RQDTL.BalanceQueryType = condition.BalanceQueryType;
            interdata.RQDTL.CheckCode = condition.CheckCode;
            return MsgTransfer.CodeMsgToBinary(interdata, ref codemsg);
        }
 private String TestForInterAcctRetrieved(StringBuilder result, InterAcctRetrieveData respData)
 {
     if (respData == null)
     {
         return result.ToString();
     }
     if (respData.OmsgHandler.NUM_ENT > 0)
     {
         result.AppendFormat("OMSG:{0} item(s)", respData.OmsgHandler.NUM_ENT);
         result.AppendLine();
         foreach (OMSG_Item_Handler omsgItem in respData.OmsgHandler.OMSGItemList)
         {
             result.AppendFormat("MOD_ID:{0};MSG_NO:{1};MSG_TYPE:{2};MSG_TEXT:{3};", omsgItem.MOD_ID, omsgItem.MSG_NO, omsgItem.MSG_TYPE, omsgItem.MSG_TEXT);
             result.AppendLine();
         }
     }
     if (!String.IsNullOrEmpty(respData.SyserrHandler.Message))
     {
         result.AppendFormat("SYSERR:{0}", respData.SyserrHandler.Message);
     }
     if (!String.IsNullOrEmpty(respData.OData.OrgnaztionNO))
     {
         result.AppendFormat(
             "账号:{0};归属机构号:{1};币种:{2};科目号:{3};顺序号:{4};户名:{5};上一交易日:{6};昨日余额方向:{7};昨日余额:{8};余额方向:{9};当前余额:{10};",
             respData.OData.AccountNO, respData.OData.OrgnaztionNO, respData.OData.Currcency, respData.OData.SubjectNO, respData.OData.SequenceNO,
             respData.OData.AccountName, respData.OData.PreviousTradeDate, respData.OData.PreviousBalanceDirection, respData.OData.PreviousBalance,
             respData.OData.BalanceDirection, respData.OData.CurrentBalance);
         result.AppendLine();
         result.AppendFormat(
             "透支限额:{0};利率:{1};透支利率:{2};利息积数:{3};透支积数:{4};使用范围:{5};是否采用销账管理:{6};是否收付现:{7};结息方式:{8};结息是否入账:{9};",
             respData.OData.OverdraftLimitation, respData.OData.Rate, respData.OData.OverdraftRate, respData.OData.InterestCumulation, respData.OData.OverdraftCumulation,
             respData.OData.UsageRange, respData.OData.IsEliminate, respData.OData.IsExchangePay, respData.OData.SettlementType, respData.OData.IsSettlementWithAccount);
         result.AppendLine();
         result.AppendFormat(
             "收息账号:{0};付息账号:{1};账户状态:{2};开户机构:{3};归属总账机构:{4};通兑级别:{5};开户日期:{6};开户柜员:{7};",
             respData.OData.IncomeAccount, respData.OData.PaymentAccount, respData.OData.AccountStatus, respData.OData.AccountOrgan, respData.OData.HeadOrgan,
             respData.OData.CirculateExchangeLevel, respData.OData.AccountDate, respData.OData.AccountTeller);
     }
     return result.ToString();
 }
        /// <summary>
        /// 内部账查询
        /// </summary>
        /// <param name="tellerNO">操作柜员号</param>
        /// <param name="organNO">交易机构号</param>
        /// <param name="tradeDate">业务交易日</param>
        /// <param name="condition">查询条件数据对象</param>
        /// <param name="codemsg"></param>
        /// <returns></returns>
        public static Guid RetrieveInternalAcct(String tellerNO, String organNO, DateTime tradeDate, InternalAcctCondtion condition, ref byte[] codemsg)
        {
            InterAcctRetrieveData interdata = new InterAcctRetrieveData();

            interdata.RQhdrHandler.SYS_TXID = "230110"; // 会计记账,主机启动原交易码
            interdata.RQhdrHandler.TX_OUNO = organNO;
            interdata.RQhdrHandler.TEL_ID = tellerNO;
            interdata.RQhdrHandler.TX_MODE = "0";
            interdata.RQhdrHandler.TX_DTE = tradeDate.ToString("yyyy-MM-dd");
            interdata.RQhdrHandler.SRV_JNO = CommonDataHelper.SpaceString(12);
            interdata.RQhdrHandler.SRV_REV_JNO = CommonDataHelper.SpaceString(12);
            interdata.RQhdrHandler.SRV_JNO = CommonDataHelper.SpaceString(12);
            interdata.RQhdrHandler.SRV_REV_JNO = CommonDataHelper.SpaceString(12);
            interdata.RQhdrHandler.HOST_JNO = CommonDataHelper.SpaceString(11);

            interdata.RQDTL.AccountNO = condition.AccountNO;
            interdata.RQDTL.Currcency = condition.Currcency;
            interdata.RQDTL.OrgnaztionNO = condition.OrgnaztionNO;
            interdata.RQDTL.SequenceNO = condition.SequenceNO;
            interdata.RQDTL.BalanceQueryType = condition.BalanceQueryType;
            interdata.RQDTL.CheckCode = condition.CheckCode;
            try
            {
                return PreProcessReqMsg(interdata, ref codemsg);
            }
            catch (Exception ex)
            {
                throw new Exception(MESSAGE_ENCODE_EXCEPTION, ex);
            }
        }