using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using Platform.Common.RunningParameters;

namespace TellerSystem.Contract.Function
{
    /// <summary>
    /// 柜员信息查询
    /// 柜员信息查询
    /// </summary>
    public class QueryTellerInformation : TFOutput
    {
        #region Output
        /// <summary>
        /// 柜员名称 0250
        /// (null)
        /// </summary>
        public string GYMC { get; internal set; }

        /// <summary>
        /// 钱箱账号 0300
        /// (null)
        /// </summary>
        public string QXZH { get; internal set; }

        /// <summary>
        /// 钱箱余额 0390
        /// (null)
        /// </summary>
        public string QXYE { get; internal set; }

        /// <summary>
        /// 余额最大限额 0400
        /// (null)
        /// </summary>
        public string YEZDXE { get; internal set; }

        /// <summary>
        /// 节假日最大限额 0410
        /// (null)
        /// </summary>
        public string JJRZDXE { get; internal set; }

        /// <summary>
        /// 最小凭证号 0610
        /// (null)
        /// </summary>
        public string ZXPZH { get; internal set; }

        /// <summary>
        /// 柜员状态 0700
        /// 0.签到1.临时签退2.正式签退3.锁定4.删除
        /// </summary>
        public string GYZT { get; internal set; }

        /// <summary>
        /// 柜员角色 0710
        /// 1.普通柜员2.营业主任3.ATM/POS4.科技柜员5.管理员
        /// </summary>
        public string GYJS { get; internal set; }

        /// <summary>
        /// 现金账号启用状态 0720
        /// 0.正常1.不可用
        /// </summary>
        public string XJZHQYZT { get; internal set; }

        /// <summary>
        /// 标志 0730
        /// [空格表示没有查询相关数据]第一位[0]柜员密码验证是否成功(0.否1.是) 第二位[1]柜员有无此种钱箱(0.无1.有) 第三位[2]柜员有无此种凭证(0.无1.有) 第四位[3]柜员有无待接收凭证(0.无1.有) 第五位[4]柜员有无凭证(0.无1.有) 第六位[5]柜员交接登记簿中有无该柜员需要收入的记录(0.无1.有) 第七位[6]柜员交接登记簿中有无付出但对方未接收的记录 第八位[7]柜员今日有登陆记录(0.无1.有) (相关位可能为空）
        /// </summary>
        public string BZ { get; internal set; }

        /// <summary>
        /// 柜员流水号 0770
        /// (null)
        /// </summary>
        public string GYLSH { get; internal set; }

        /// <summary>
        /// 机构号 0910
        /// (null)
        /// </summary>
        public string JGH { get; internal set; }


        #endregion

        #region Input
        /// <summary>
        /// 参数清单
        /// </summary>
        public class Input : TFInput
        {
            /// <summary>
            /// 币种 0210
            /// (null) 
            /// </summary>
            public string BZ { get; set; }

            /// <summary>
            /// 柜员密码 0790
            /// 非空进行验证 
            /// </summary>
            public string GYMM { get; set; }

            /// <summary>
            /// 凭证类型 0890
            /// 为空则查询柜员是否有正常凭证 
            /// </summary>
            public string PZLX { get; set; }

            /// <summary>
            /// 柜员号 0920
            /// (null) 
            /// </summary>
            public string GYH { get; set; }

            /// <summary>
            /// 介质类型 1161
            /// 允许根据介质种类查询凭证类型 
            /// </summary>
            public string JZLX { get; set; }


            /// <summary>                 
            /// 定义业务逻辑              
            /// </summary>                
            /// <returns></returns>  
            public override TFOutput Raise()
            {
                //拉取数据                                  
                var output = new QueryTellerInformation();
                PageData.TradeAPIs.InitFd(MessageData);
                PageData.TradeAPIs.CommSend(MessageData);
                MessageData.Fd126_5 = MainCode;
                MessageData.Fd16 = "K019";
                MessageData.Fd21 = BZ;
                MessageData.Fd79 = GYMM;
                MessageData.Fd89 = PZLX;
                MessageData.Fd92 = GYH;
                MessageData.Fd116_1 = JZLX;
                MessageData.Fd91 = LoginUserInfo.KinbrNo;
                PageData.TradeAPIs.CallServer(MessageData);
                if (MessageData.Fd12 != "0000")
                {
                    output.IsFailed = true;
                    output.FailureCause = PageData.TradeAPIs.GetError(MessageData);
                }
                output.GYMC = (MessageData.Fd25);
                output.QXZH = (MessageData.Fd30);
                output.QXYE = (MessageData.Fd39);
                output.YEZDXE = (MessageData.Fd40);
                output.JJRZDXE = (MessageData.Fd41);
                output.ZXPZH = (MessageData.Fd61);
                output.GYZT = (MessageData.Fd70);
                output.GYJS = (MessageData.Fd71);
                output.XJZHQYZT = (MessageData.Fd72);
                output.BZ = (MessageData.Fd73);
                output.GYLSH = (MessageData.Fd77);
                output.JGH = (MessageData.Fd91);

                return output;
            }
        }
        #endregion
    }
}
