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

namespace TellerSystem.Contract.Function
{
    /// <summary>
    /// 统计单一客户或账户当天交易额
    /// 以客户级或账户级为单位统计当天交易额
    /// </summary>
    public class StatisticsSingleCustomerOraccountDayturnover : TFOutput
    {
        #region Output
        /// <summary>
        /// 当日交易总额 0390
        /// (null)
        /// </summary>
        public string DRJYZE { get; internal set; }

        /// <summary>
        /// 当日交易总次数 0520
        /// (null)
        /// </summary>
        public string DRJYZCS { get; internal set; }


        #endregion

        #region Input
		/// <summary>
        /// 参数清单
        /// </summary>
        public class Input : TFInput
        {
            /// <summary>
            /// 客户号 0280
            /// 以客户为单位统计时必输 
            /// </summary>
            public string KHH { get; set; }

            /// <summary>
            /// 账号 0300
            /// 以账户为单位统计时必输 
            /// </summary>
            public string ZH { get; set; }

            /// <summary>
            /// 账户序号 0340
            /// </summary>
            public string ZHXH { get; set; }

            /// <summary>
            /// 周期值 0450
            /// 1 
            /// </summary>
            public string ZQZ { get; set; }

            /// <summary>
            /// 渠道类型列表代码 0580
            /// 默认为空 
            /// </summary>
            public string QDLXLBDM { get; set; }

            /// <summary>
            /// 业务类型列表代码 0590
            /// 默认为空 
            /// </summary>
            public string YWLXLBDM { get; set; }

            /// <summary>
            /// 距离类型列表代码 0600
            /// 默认为空 
            /// </summary>
            public string JLLXLBDM { get; set; }

            /// <summary>
            /// 交易类型 0650
            /// 2100-代表所有取款业务类型，跟0590域赋值"3000"效果相同 
            /// </summary>
            public string JYLX { get; set; }

            /// <summary>
            /// 周期类型 0670
            /// 1:当日累计 
            /// </summary>
            public string ZQLX { get; set; }

            /// <summary>
            /// 查询类型 0680
            /// 0账户级 1客户级 
            /// </summary>
            public string CXLX { get; set; }

            /// <summary>
            /// 统计类型 0690
            /// 1.交易金额 2.交易次数 3-交易金额+交易次数 
            /// </summary>
            public string TJLX { get; set; }


            /// <summary>                 
            /// 定义业务逻辑              
            /// </summary>                
            /// <returns></returns>  
            public override TFOutput Raise()
            {
                //拉取数据                                  
                var output = new StatisticsSingleCustomerOraccountDayturnover();
                PageData.TradeAPIs.InitFd(MessageData);
                PageData.TradeAPIs.CommSend(MessageData);
				MessageData.Fd126_5 = MainCode;
                MessageData.Fd16 = "K031";
                MessageData.Fd28 = KHH;
                MessageData.Fd30 = ZH;
                MessageData.Fd34 = ZHXH;
                MessageData.Fd45 = ZQZ;
                MessageData.Fd58 = QDLXLBDM;
                MessageData.Fd59 = YWLXLBDM;
                MessageData.Fd60 = JLLXLBDM;
                MessageData.Fd65 = JYLX;
                MessageData.Fd67 = ZQLX;
                MessageData.Fd68 = CXLX;
                MessageData.Fd69 = TJLX;

                PageData.TradeAPIs.CallServer(MessageData);
                if (MessageData.Fd12 != "0000")
                {
                    output.IsFailed = true;
                    output.FailureCause = PageData.TradeAPIs.GetError(MessageData);
                }                
                output.DRJYZE = (MessageData.Fd39);
                output.DRJYZCS = (MessageData.Fd52);

                return output;
            }
        }
        #endregion
    }
}
