/// <summary>
        /// 获取退款明细
        /// </summary>
        /// <param name="roomRegId"></param>
        /// <returns></returns>
        public string GetTkListForZz(long roomRegId)
        {
            var datas = new List <RoomRegTk>();
            //获取退款数据
            var tkList = RoomRegTkBll.GetList(roomRegId).Where(m => m.RType == StkTypeEnum.预收退款).ToList();

            if (tkList != null && tkList.Count > 0)
            {
                foreach (var item in tkList)
                {
                    datas.Add(item);
                }
            }
            return(Newtonsoft.Json.JsonConvert.SerializeObject(datas));
        }
        /// <summary>
        /// 获取收退款明细
        /// </summary>
        /// <param name="roomRegId"></param>
        /// <param name="type">1:收退款   2:总收退款</param>
        /// <returns></returns>
        public string GetStkList(long roomRegId, int type)
        {
            var datas = new List <RoomRegStkViewHelp>();
            //获取收款数据
            var skList = RoomRegSkBll.GetList(roomRegId, type);

            if (skList != null && skList.Count > 0)
            {
                var sum = skList.Sum(m => m.Money);
                var sk  = new RoomRegStkViewHelp()
                {
                    Type     = 0,
                    Id       = Guid.NewGuid().ToString(),
                    Name     = "收款",
                    Money    = $"汇总:{sum}",
                    children = new List <RoomRegStkViewHelp>()
                };
                foreach (var item in skList)
                {
                    //var rtype = item.RType == StkTypeEnum.银行卡预收款 ? "预收账款" : item.RType.ToString();
                    sk.children.Add(new RoomRegStkViewHelp()
                    {
                        Type        = 1,
                        Id          = item.Id.ToString(),
                        Name        = string.Empty,
                        DjNum       = item.DjNum,
                        SgDh        = item.SgDh,
                        FsTime      = item.FsTime,
                        PayTypeName = item.PayTypeName,
                        RType       = item.RType.ToString(),
                        YhkId       = item.YhkId.ToString(),
                        Money       = item.Money.ToString(),
                        HandlerName = item.HandlerName,
                        Remark      = item.Remark,
                        KdRemark    = item.KdRemark,
                    });
                }
                datas.Add(sk);
            }

            //获取退款数据
            var tkList = RoomRegTkBll.GetList(roomRegId, type);

            if (tkList != null && tkList.Count > 0)
            {
                var sum = tkList.Sum(m => m.Money);
                var tk  = new RoomRegStkViewHelp()
                {
                    Type     = 0,
                    Id       = Guid.NewGuid().ToString(),
                    Name     = "退款",
                    Money    = $"汇总:{sum}",
                    children = new List <RoomRegStkViewHelp>()
                };
                foreach (var item in tkList)
                {
                    tk.children.Add(new RoomRegStkViewHelp()
                    {
                        Type        = 2,
                        Id          = item.Id.ToString(),
                        Name        = string.Empty,
                        DjNum       = item.DjNum,
                        SgDh        = item.SgDh,
                        FsTime      = item.FsTime,
                        PayTypeName = item.PayTypeName,
                        RType       = item.RType.ToString(),
                        Money       = item.Money.ToString(),
                        HandlerName = item.HandlerName,
                        Remark      = item.Remark,
                        KdRemark    = item.KdRemark,
                    });
                }
                datas.Add(tk);
            }
            return(Newtonsoft.Json.JsonConvert.SerializeObject(datas));
        }
Exemplo n.º 3
0
        public string GetList(long roomRegId)
        {
            var datas = RoomRegTkBll.GetList(roomRegId);

            return(JsonConvert.SerializeObject(datas));
        }