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

namespace TellerSystem.Contract.Function
{
    /// <summary>
    /// 根据保函协议编号查询协议信息
    /// 根据保函协议编号查询保函登记簿的详细信息
    /// </summary>
    public class QueryGuaranteeInfomationByNum : TFOutput
    {
        #region Output
        /// <summary>
        /// 质押物类别 0220
        /// 
        /// </summary>
        public string ZYWLB { get; internal set; }

        /// <summary>
        /// 申请人户名 0250
        /// 
        /// </summary>
        public string SQRHM { get; internal set; }

        /// <summary>
        /// 受益人户名 0260
        /// 
        /// </summary>
        public string SYRHM { get; internal set; }

        /// <summary>
        /// 申请人客户号 0280
        /// 
        /// </summary>
        public string SQRKHH { get; internal set; }

        /// <summary>
        /// 受益人客户号 0290
        /// 
        /// </summary>
        public string SYRKHH { get; internal set; }

        /// <summary>
        /// 申请人账号 0300
        /// 
        /// </summary>
        public string SQRZH { get; internal set; }

        /// <summary>
        /// 受益人账号 0310
        /// 
        /// </summary>
        public string SYRZH { get; internal set; }

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

        /// <summary>
        /// 垫款账号 0330
        /// 
        /// </summary>
        public string DKZH { get; internal set; }

        /// <summary>
        /// 质押物号码 0370
        /// 
        /// </summary>
        public string ZYWHM { get; internal set; }

        /// <summary>
        /// 合同总金额 0390
        /// 
        /// </summary>
        public string HTZJE { get; internal set; }

        /// <summary>
        /// 保函金额 0400
        /// 
        /// </summary>
        public string BHJE { get; internal set; }

        /// <summary>
        /// 保证金金额 0410
        /// 
        /// </summary>
        public string BZJJE { get; internal set; }

        /// <summary>
        /// 赔偿金额 0420
        /// 
        /// </summary>
        public string PCJE { get; internal set; }

        /// <summary>
        /// 保证金比例 0430
        /// 
        /// </summary>
        public string BZJBL { get; internal set; }

        /// <summary>
        /// 交易日期 0440
        /// 
        /// </summary>
        public string JYRQ { get; internal set; }

        /// <summary>
        /// 保函到期日期 0450
        /// 
        /// </summary>
        public string BHDQRQ { get; internal set; }

        /// <summary>
        /// 开具保函日期 0460
        /// 
        /// </summary>
        public string KJBHRQ { get; internal set; }

        /// <summary>
        /// 保函有效期限 0470
        /// 
        /// </summary>
        public string BHYXQX { get; internal set; }

        /// <summary>
        /// 申请人电话 0580
        /// 
        /// </summary>
        public string SQRDH { get; internal set; }

        /// <summary>
        /// 受益人电话 0590
        /// 
        /// </summary>
        public string SYRDH { get; internal set; }

        /// <summary>
        /// 是否有记录 0660
        /// 0无1有
        /// </summary>
        public string SFYJL { get; internal set; }

        /// <summary>
        /// 协议状态 0670
        /// A-存保证金 0、审核1核销X信贷录入
        /// </summary>
        public string XYZT { get; internal set; }

        /// <summary>
        /// 保函类型 0700
        /// 0预付款退款保函 1付款保函 2关税保付保函 3工程投标保函 4工程承包履约保函 5工程维修保函 6加工承揽商贸履约保函 7质量保函
        /// </summary>
        public string BHLX { get; internal set; }

        /// <summary>
        /// 申请人地址 0810
        /// 
        /// </summary>
        public string SQRDZ { get; internal set; }

        /// <summary>
        /// 受益人地址 0820
        /// 
        /// </summary>
        public string SYRDZ { get; internal set; }

        /// <summary>
        /// 逾期利率 0840
        /// 
        /// </summary>
        public string YQLL { get; internal set; }

        /// <summary>
        /// 担保费比例 0850
        /// 
        /// </summary>
        public string DBFLL { get; internal set; }

        /// <summary>
        /// 垫款金额 1001
        /// 
        /// </summary>
        public string DKJE { get; internal set; }

        /// <summary>
        /// 质押总额 1002
        /// 
        /// </summary>
        public string ZYZE { get; internal set; }

        /// <summary>
        /// 交易机构 0910
        /// 
        /// </summary>
        public string JYJG { get; internal set; }

        /// <summary>
        /// 项目名称 0830
        /// 
        /// </summary>
        public string XMMC { get; internal set; }

        /// <summary>
        /// 担保合同号 0860
        /// 
        /// </summary>
        public string DBHTH { get; internal set; }

        /// <summary>
        /// 手续费比例 1005
        /// 
        /// </summary>
        public string SXFBL { get; internal set; }

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

        #region Input
		/// <summary>
        /// 参数清单
        /// </summary>
        public class Input : TFInput
        {
            /// <summary>
            /// 保函协议编号 0630
            ///  
            /// </summary>
            public string BHXYBH { get; set; }


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

                PageData.TradeAPIs.CallServer(MessageData);
                if (MessageData.Fd12 != "0000")
                {
                    output.IsFailed = true;
                    output.FailureCause = PageData.TradeAPIs.GetError(MessageData);
                }                
                output.ZYWLB = DelSpace(MessageData.Fd22);
                output.SQRHM = DelSpace(MessageData.Fd25);
                output.SYRHM = DelSpace(MessageData.Fd26);
                output.SQRKHH = DelSpace(MessageData.Fd28);
                output.SYRKHH = DelSpace(MessageData.Fd29);
                output.SQRZH = DelSpace(MessageData.Fd30);
                output.SYRZH = DelSpace(MessageData.Fd31);
                output.BZJZH = DelSpace(MessageData.Fd32);
                output.DKZH = DelSpace(MessageData.Fd33);
                output.ZYWHM = DelSpace(MessageData.Fd37);
                output.HTZJE = DelSpace(MessageData.Fd39);
                output.BHJE = DelSpace(MessageData.Fd40);
                output.BZJJE = DelSpace(MessageData.Fd41);
                output.PCJE = DelSpace(MessageData.Fd42);
                output.BZJBL = DelSpace(MessageData.Fd43);
                output.JYRQ = DelSpace(MessageData.Fd44);
                output.BHDQRQ = DelSpace(MessageData.Fd45);
                output.KJBHRQ = DelSpace(MessageData.Fd46);
                output.BHYXQX = DelSpace(MessageData.Fd47);
                output.SQRDH = DelSpace(MessageData.Fd58);
                output.SYRDH = DelSpace(MessageData.Fd59);
                output.SFYJL = DelSpace(MessageData.Fd66);
                output.XYZT = DelSpace(MessageData.Fd67);
                output.BHLX = DelSpace(MessageData.Fd70);
                output.SQRDZ = DelSpace(MessageData.Fd81);
                output.SYRDZ = DelSpace(MessageData.Fd82);
                output.YQLL = DelSpace(MessageData.Fd84);
                output.DBFLL = DelSpace(MessageData.Fd85);
                output.DKJE = DelSpace(MessageData.Fd100_1);
                output.ZYZE = DelSpace(MessageData.Fd100_2);
                output.JYJG = DelSpace(MessageData.Fd91);
                output.XMMC = DelSpace(MessageData.Fd83);
                output.DBHTH = DelSpace(MessageData.Fd86);
                output.SXFBL = DelSpace(MessageData.Fd100_5);
                output.BZJLL = DelSpace(MessageData.Fd97);

                return output;
            }
        }
        #endregion
    }
}
