using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;

namespace TellerSystem.Contract.Function
{
    /// <summary>
    /// 根据承兑汇票协议编号查询协议信息
    /// 根据承兑汇票协议编号查询承兑汇票协议详细信息
    /// </summary>
    public class QueryAcceptanceAgreementNum : TFOutput
    {
        #region Output
        /// <summary>
        /// 纸票电票标志 0200
        /// P：纸票 E：电票
        /// </summary>
        public string ZPDPBZ { get; internal set; }

        /// <summary>
        /// 付款人开户行行名 0250
        /// (null)
        /// </summary>
        public string FKRKHXXM { get; internal set; }

        /// <summary>
        /// 付款人全称 0260
        /// (null)
        /// </summary>
        public string FKRQC { get; internal set; }

        /// <summary>
        /// 收款人全称 0270
        /// (null)
        /// </summary>
        public string SKRQC { get; internal set; }

        /// <summary>
        /// 付款人开户行机构号 0300
        /// (null)
        /// </summary>
        public string FKRKHXJGH { get; internal set; }

        /// <summary>
        /// 质押协议总编号 0310
        /// (null)
        /// </summary>
        public string ZYXYZBH { get; internal set; }

        /// <summary>
        /// 保证金账号 0320
        /// (null)
        /// </summary>
        public string BZJZH { get; internal set; }

        /// <summary>
        /// 付款人账号 0380
        /// (null)
        /// </summary>
        public string FKRZH { get; internal set; }

        /// <summary>
        /// 保证金比例 0400
        /// (null)
        /// </summary>
        public string BZJBL { get; internal set; }

        /// <summary>
        /// 已签发票据总金额 0410
        /// (null)
        /// </summary>
        public string YQFPJZJE { get; internal set; }

        /// <summary>
        /// 到期日期 0440
        /// (null)
        /// </summary>
        public string DQRQ { get; internal set; }

        /// <summary>
        /// 申请日期 0460
        /// (null)
        /// </summary>
        public string SQRQ { get; internal set; }

        /// <summary>
        /// 该协议下最大编号 0480
        /// (null)
        /// </summary>
        public string GXYXZDBH { get; internal set; }

        /// <summary>
        /// 承兑汇票的记账科目（表外） 0640
        /// (null)
        /// </summary>
        public string CDHPDJZKMBW { get; internal set; }

        /// <summary>
        /// 承兑类型 0670
        /// 1：差额承兑；2：100%质押存单；3：100%保证金；4：保兑仓；5：承兑拆分
        /// </summary>
        public string CDLX { get; internal set; }

        /// <summary>
        /// 协议状态 0700
        /// 9：外行的承兑汇票过来质押X:信贷审批录入1：审核；2：全部签发；3：退票修改；4:部分签发
        /// </summary>
        public string XYZT { get; internal set; }

        /// <summary>
        /// 到期标志处理 0710
        /// 0：未到期处理；1：已到期处理
        /// </summary>
        public string DQBZCL { get; internal set; }

        /// <summary>
        /// 是否有该协议 0720
        /// 0无 1有
        /// </summary>
        public string SFYGXY { get; internal set; }

        /// <summary>
        /// 收款人行名 0810
        /// (null)
        /// </summary>
        public string SKRXM { get; internal set; }

        /// <summary>
        /// 收款人账号 0830
        /// (null)
        /// </summary>
        public string SKRZH { get; internal set; }

        /// <summary>
        /// 罚息利率 0840
        /// (null)
        /// </summary>
        public string FXLL { get; internal set; }

        /// <summary>
        /// 申请机构编码 0910
        /// (null)
        /// </summary>
        public string SQJGBM { get; internal set; }

        /// <summary>
        /// 协议金额 1001
        /// (null)
        /// </summary>
        public string XYJE { get; internal set; }

        /// <summary>
        /// 质押总金额 1002
        /// (null)
        /// </summary>
        public string ZYZJE { get; internal set; }

        /// <summary>
        /// 保证金金额 1003
        /// (null)
        /// </summary>
        public string BZJJE { get; internal set; }

        /// <summary>
        /// 银行垫款账号 1011
        /// (null)
        /// </summary>
        public string YXDKZH { get; internal set; }

        /// <summary>
        /// 银行垫款额 1013
        /// (null)
        /// </summary>
        public string YXDKE { get; internal set; }

        /// <summary>
        /// 审核柜员 0650
        /// 
        /// </summary>
        public string SHGY { get; internal set; }

        /// <summary>
        /// 录入柜员 0920
        /// 
        /// </summary>
        public string LRGY { get; internal set; }

        /// <summary>
        /// 保证金利率 0850
        /// 
        /// </summary>
        public string BZJLL { get; internal set; }
        #endregion

        #region Input
		/// <summary>
        /// 参数清单
        /// </summary>
        public class Input : TFInput
        {
            /// <summary>
            /// 承兑汇票协议编号 0330
            /// (null) 
            /// </summary>
            public string CDHPXYBH { get; set; }


            /// <summary>                 
            /// 定义业务逻辑              
            /// </summary>                
            /// <returns></returns>  
            public override TFOutput Raise()
            {
                //拉取数据                                  
                var output = new QueryAcceptanceAgreementNum();
                PageData.TradeAPIs.InitFd(MessageData);
                PageData.TradeAPIs.CommSend(MessageData);
				MessageData.Fd126_5 = MainCode;
                MessageData.Fd16 = "K001";
                MessageData.Fd33 = CDHPXYBH;

                PageData.TradeAPIs.CallServer(MessageData);
                if (MessageData.Fd12 != "0000")
                {
                    output.IsFailed = true;
                    output.FailureCause = PageData.TradeAPIs.GetError(MessageData);
                }                
                output.ZPDPBZ = DelSpace(MessageData.Fd20);
                output.FKRKHXXM = DelSpace(MessageData.Fd25);
                output.FKRQC = DelSpace(MessageData.Fd26);
                output.SKRQC = DelSpace(MessageData.Fd27);
                output.FKRKHXJGH = DelSpace(MessageData.Fd30);
                output.ZYXYZBH = DelSpace(MessageData.Fd31);
                output.BZJZH = DelSpace(MessageData.Fd32);
                output.FKRZH = DelSpace(MessageData.Fd38);
                output.BZJBL = DelSpace(MessageData.Fd40);
                output.YQFPJZJE = DelSpace(MessageData.Fd41);
                output.DQRQ = DelSpace(MessageData.Fd44);
                output.SQRQ = DelSpace(MessageData.Fd46);
                output.GXYXZDBH = DelSpace(MessageData.Fd48);
                output.CDHPDJZKMBW = DelSpace(MessageData.Fd64);
                output.CDLX = DelSpace(MessageData.Fd67);
                output.XYZT = DelSpace(MessageData.Fd70);
                output.DQBZCL = DelSpace(MessageData.Fd71);
                output.SFYGXY = DelSpace(MessageData.Fd72);
                output.SKRXM = DelSpace(MessageData.Fd81);
                output.SKRZH = DelSpace(MessageData.Fd83);
                output.FXLL = DelSpace(MessageData.Fd84);
                output.SQJGBM = DelSpace(MessageData.Fd91);
                output.XYJE = DelSpace(MessageData.Fd100_1);
                output.ZYZJE = DelSpace(MessageData.Fd100_2);
                output.BZJJE = DelSpace(MessageData.Fd100_3);
                output.YXDKZH = DelSpace(MessageData.Fd101_1);
                output.YXDKE = DelSpace(MessageData.Fd101_3);
                output.SHGY = DelSpace(MessageData.Fd65);
                output.LRGY = DelSpace(MessageData.Fd92);
                output.BZJLL = DelSpace(MessageData.Fd85);

                return output;
            }
        }
        #endregion
    }
}
