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

namespace TellerSystem.Contract.Function
{
    /// <summary>
    /// 假币没收多笔查询(文件)
    /// 查询没收假币的详细信息
    /// </summary>
    public class QueryJBMSDBJL : TFOutput
    {
        #region Output
        /// <summary>
        /// 文件
        /// 登记日期|交易机构|登记柜员|收缴凭证号|收缴假币序号|客户姓名|证件类型|证件号码|上缴编号|上缴日期|币种|版别|劵别|没收张数|冲销张数|制假类型|冠字号码|状态|接收日期|接收机构|接收柜员|复核柜员|现金管理员|
        /// </summary>
        public string WJ { get; internal set; }

        /// <summary>
        /// 文件
        /// 登记日期|交易机构|登记柜员|收缴凭证号|收缴假币序号|客户姓名|证件类型|证件号码|上缴编号|上缴日期|币种|版别|劵别|没收张数|冲销张数|制假类型|冠字号码|状态|接收日期|接收机构|接收柜员|复核柜员|现金管理员|
        /// </summary>
        public List<E_WJ> WJData { get; internal set; }

        /// <summary>
        /// 文件
        /// 登记日期|交易机构|登记柜员|收缴凭证号|收缴假币序号|客户姓名|证件类型|证件号码|上缴编号|上缴日期|币种|版别|劵别|没收张数|冲销张数|制假类型|冠字号码|状态|接收日期|接收机构|接收柜员|复核柜员|现金管理员|
        /// </summary>
        public class E_WJ
        {
            /// <summary>
            /// 登记日期
            /// </summary>
            public string DJRQ { get; set; }

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

            /// <summary>
            /// 登记柜员
            /// </summary>
            public string DJGY { get; set; }

            /// <summary>
            /// 收缴凭证号
            /// </summary>
            public string SJPZH { get; set; }

            /// <summary>
            /// 收缴假币序号
            /// </summary>
            public string SJJBXH { get; set; }

            /// <summary>
            /// 客户姓名
            /// </summary>
            public string KHXM { get; set; }

            /// <summary>
            /// 证件类型
            /// </summary>
            public string ZJLX { get; set; }

            /// <summary>
            /// 证件号码
            /// </summary>
            public string ZJHM { get; set; }

            /// <summary>
            /// 上缴编号
            /// </summary>
            public string SJBH { get; set; }

            /// <summary>
            /// 上缴日期
            /// </summary>
            public string SJRQ { get; set; }

            /// <summary>
            /// 币种
            /// </summary>
            public string BZ { get; set; }

            /// <summary>
            /// 版别
            /// </summary>
            public string BB { get; set; }

            /// <summary>
            /// 劵别
            /// </summary>
            public string B { get; set; }

            /// <summary>
            /// 没收张数
            /// </summary>
            public string MSZS { get; set; }

            /// <summary>
            /// 冲销张数
            /// </summary>
            public string CXZS { get; set; }

            /// <summary>
            /// 制假类型
            /// </summary>
            public string ZJLX_1 { get; set; }

            /// <summary>
            /// 冠字号码
            /// </summary>
            public string GZHM { get; set; }

            /// <summary>
            /// 状态
            /// </summary>
            public string ZT { get; set; }

            /// <summary>
            /// 接收日期
            /// </summary>
            public string JSRQ { get; set; }

            /// <summary>
            /// 接收机构
            /// </summary>
            public string JSJG { get; set; }

            /// <summary>
            /// 接收柜员
            /// </summary>
            public string JSGY { get; set; }

            /// <summary>
            /// 复核柜员
            /// </summary>
            public string FHGY { get; set; }

            /// <summary>
            /// 现金管理员
            /// </summary>
            public string XJGLY { get; set; }

        }

        #endregion

        #region Input
		/// <summary>
        /// 参数清单
        /// </summary>
        public class Input : TFInput
        {
            /// <summary>
            /// 起始日期 0440
            ///  
            /// </summary>
            public string QSRQ { get; set; }

            /// <summary>
            /// 终止日期 0450
            ///  
            /// </summary>
            public string ZZRQ { get; set; }

            /// <summary>
            /// 接收机构 0640
            ///  
            /// </summary>
            public string JSJG { get; set; }

            /// <summary>
            /// 制假方式 0680
            /// 0伪造1变造 
            /// </summary>
            public string ZJFS { get; set; }

            /// <summary>
            /// 状态 0690
            /// 0已登记未上缴1已上缴未接收2已接收3已出库 
            /// </summary>
            public string ZT { get; set; }

            /// <summary>
            /// 接收柜员 0730
            ///  
            /// </summary>
            public string JSGY { get; set; }

            /// <summary>
            /// 登记机构 0910
            ///  
            /// </summary>
            public string DJJG { get; set; }

            /// <summary>
            /// 登记柜员 0920
            ///  
            /// </summary>
            public string DJGY { get; set; }

            /// <summary>
            /// 上缴编号 0300
            ///  
            /// </summary>
            public string SJBH { get; set; }

            /// <summary>
            /// 没收证编号 0620
            ///  
            /// </summary>
            public string MSZBH { get; set; }

            /// <summary>
            /// 现金管理员 0650
            ///  
            /// </summary>
            public string XJGLY { get; set; }

            /// <summary>
            /// 券别 0890
            ///  
            /// </summary>
            public string QB { get; set; }


            /// <summary>                 
            /// 定义业务逻辑              
            /// </summary>                
            /// <returns></returns>  
            public override TFOutput Raise()
            {
                //拉取数据                                  
                var output = new QueryJBMSDBJL();
                PageData.TradeAPIs.InitFd(MessageData);
                PageData.TradeAPIs.CommSend(MessageData);
				MessageData.Fd126_5 = MainCode;
                MessageData.Fd16 = "CXCL";
                MessageData.Fd44 = QSRQ;
                MessageData.Fd45 = ZZRQ;
                MessageData.Fd64 = JSJG;
                MessageData.Fd68 = ZJFS;
                MessageData.Fd69 = ZT;
                MessageData.Fd73 = JSGY;
                MessageData.Fd91 = DJJG;
                MessageData.Fd92 = DJGY;
                MessageData.Fd128 = "0082";
                MessageData.Fd30 = SJBH;
                MessageData.Fd62 = MSZBH;
                MessageData.Fd65 = XJGLY;
                MessageData.Fd89 = QB;

                PageData.TradeAPIs.CallServer(MessageData);
                if (MessageData.Fd12 != "0000")
                {
                    output.IsFailed = true;
                    output.FailureCause = PageData.TradeAPIs.GetError(MessageData);
                }                
                output.WJData = AnilyzeFileData<E_WJ>(MessageData.FileData,
                                            "登记日期|交易机构|登记柜员|收缴凭证号|收缴假币序号|客户姓名|证件类型|证件号码|上缴编号|上缴日期|币种|版别|劵别|没收张数|冲销张数|制假类型|冠字号码|状态|接收日期|接收机构|接收柜员|复核柜员|现金管理员|",
                                            x =>
                                            {
                                                return new E_WJ
                                                {
                                                    DJRQ = x["登记日期"],
                                                    JYJG = x["交易机构"],
                                                    DJGY = x["登记柜员"],
                                                    SJPZH = x["收缴凭证号"],
                                                    SJJBXH = x["收缴假币序号"],
                                                    KHXM = x["客户姓名"],
                                                    ZJLX = x["证件类型"],
                                                    ZJHM = x["证件号码"],
                                                    SJBH = x["上缴编号"],
                                                    SJRQ = x["上缴日期"],
                                                    BZ = x["币种"],
                                                    BB = x["版别"],
                                                    B = x["劵别"],
                                                    MSZS = x["没收张数"],
                                                    CXZS = x["冲销张数"],
                                                    ZJLX_1 = x["制假类型"],
                                                    GZHM = x["冠字号码"],
                                                    ZT = x["状态"],
                                                    JSRQ = x["接收日期"],
                                                    JSJG = x["接收机构"],
                                                    JSGY = x["接收柜员"],
                                                    FHGY = x["复核柜员"],
                                                    XJGLY = x["现金管理员"]
                                                };
                                            });
                output.WJ = MessageData.FileData;

                return output;
            }
        }
        #endregion
    }
}
