Beispiel #1
0
 public ActionResult Index2(long roomRegId, long itemId = 0)
 {
     if (itemId == 0)
     {
         return(View(new RoomRegTk()
         {
             RoomRegId = roomRegId,
             FsTime = DateTime.Now.ToString("yyyy-MM-dd HH:ss")
         }));
     }
     else
     {
         var model = RoomRegTkBll.SingleOrDefault(itemId);
         if (model == null)
         {
             model = new RoomRegTk()
             {
                 HotelId   = UserContext.CurrentUser.HotelId,
                 RoomRegId = roomRegId,
                 FsTime    = DateTime.Now.ToString("yyyy-MM-dd HH:ss")
             };
         }
         return(View(model));
     }
 }
        /// <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));
        }
Beispiel #3
0
        public JsonResult EditKdRemark(long id, string kdRemark)
        {
            var apiResult = new APIResult();

            try
            {
                RoomRegTkBll.EditKdRemark(id, kdRemark);
            }
            catch (Exception ex)
            {
                apiResult.Ret = -1;
                apiResult.Msg = ex.Message;
                if (!(ex is OperationExceptionFacade))
                {
                    LogFactory.GetLogger().Log(LogLevel.Error, ex);
                }
            }
            return(Json(apiResult));
        }
Beispiel #4
0
        public JsonResult Del(long id)
        {
            var apiResult = new APIResult();

            try
            {
                RoomRegTkBll.DeleteById(id);
            }
            catch (Exception ex)
            {
                apiResult.Ret = -1;
                apiResult.Msg = ex.Message;
                if (!(ex is OperationExceptionFacade))
                {
                    LogFactory.GetLogger().Log(LogLevel.Error, ex);
                }
            }
            return(Json(apiResult));
        }
Beispiel #5
0
        public JsonResult AddOrUpdate(RoomRegTk model)
        {
            var apiResult = new APIResult();
            var user      = UserContext.CurrentUser;

            try
            {
                RoomRegTkBll.AddOrUpdate(model, user.Id, user.Name, user.HotelId);
            }
            catch (Exception ex)
            {
                apiResult.Ret = -1;
                apiResult.Msg = ex.Message;
                if (!(ex is OperationExceptionFacade))
                {
                    LogFactory.GetLogger().Log(LogLevel.Error, ex);
                }
            }
            return(Json(apiResult));
        }
        /// <summary>
        /// 获取已转账明细
        /// </summary>
        /// <param name="roomRegId"></param>
        /// <returns></returns>
        public string GetYzzList(long roomRegId)
        {
            if (roomRegId == 0)
            {
                roomRegId = -1;
            }
            var datas = new List <RoomRegYzzHelp>();
            //获取费用数据
            var fyList = RoomRegZwBll.GetFyListForYzz(roomRegId);

            datas.AddRange(fyList);
            //获取收款数据
            var skList = RoomRegSkBll.GetListForYzz(roomRegId);

            if (skList != null && skList.Count > 0)
            {
                var sum = skList.Sum(m => m.Money);
                var sk  = new RoomRegYzzHelp()
                {
                    Id        = Guid.NewGuid().ToString(),
                    ZzTime    = string.Empty,
                    Name      = "收款",
                    Price     = string.Empty,
                    Quantity  = string.Empty,
                    Money     = $"汇总:{sum}",
                    DjNum     = string.Empty,
                    KdRemark  = string.Empty,
                    Remark    = string.Empty,
                    ZzHandler = string.Empty,
                    YsTime    = string.Empty,
                    children  = new List <RoomRegYzzHelp>()
                };
                foreach (var item in skList)
                {
                    sk.children.Add(new RoomRegYzzHelp()
                    {
                        RType        = FyAndStkTypeEnum.收款,
                        Id           = item.Id.ToString(),
                        RoomRegId    = item.RoomRegId.ToString(),
                        ZzTime       = TypeConvert.IntToDateTime(item.ZzTime).ToString("yyyy-MM-dd HH:mm"),
                        Name         = string.Empty,
                        Price        = string.Empty,
                        Quantity     = string.Empty,
                        Money        = item.Money.ToString(),
                        DjNum        = string.Empty,
                        KdRemark     = string.Empty,
                        Remark       = item.Remark,
                        ZzHandler    = item.ZzHandler,
                        YsTime       = item.YsTime,
                        OldRoomRegId = item.OldRoomRegId.ToString(),
                        Desc         = $"从房间【房号:{item.OldRoomNO},登记单:{item.OldDjdNum}】转到房间【{item.RoomNO},登记单:{item.DjdNum}】"
                    });
                }
                datas.Add(sk);
            }
            //获取退款数据
            var tkList = RoomRegTkBll.GetListYzz(roomRegId);

            if (tkList != null && tkList.Count > 0)
            {
                var sum = tkList.Sum(m => m.Money);
                var tk  = new RoomRegYzzHelp()
                {
                    Id        = Guid.NewGuid().ToString(),
                    ZzTime    = string.Empty,
                    Name      = "退款",
                    Price     = string.Empty,
                    Quantity  = string.Empty,
                    Money     = $"汇总:{sum}",
                    DjNum     = string.Empty,
                    KdRemark  = string.Empty,
                    Remark    = string.Empty,
                    ZzHandler = string.Empty,
                    YsTime    = string.Empty,
                    children  = new List <RoomRegYzzHelp>()
                };
                foreach (var item in tkList)
                {
                    tk.children.Add(new RoomRegYzzHelp()
                    {
                        RType        = FyAndStkTypeEnum.退款,
                        Id           = item.Id.ToString(),
                        RoomRegId    = item.RoomRegId.ToString(),
                        ZzTime       = TypeConvert.IntToDateTime(item.ZzTime).ToString("yyyy-MM-dd HH:mm"),
                        Name         = string.Empty,
                        Price        = string.Empty,
                        Quantity     = string.Empty,
                        Money        = item.Money.ToString(),
                        DjNum        = string.Empty,
                        KdRemark     = string.Empty,
                        Remark       = item.Remark,
                        ZzHandler    = item.ZzHandler,
                        YsTime       = item.YsTime,
                        OldRoomRegId = item.OldRoomRegId.ToString(),
                        Desc         = $"从房间【房号:{item.OldRoomNO},登记单:{item.OldDjdNum}】转到房间【{item.RoomNO},登记单:{item.DjdNum}】"
                    });
                }
                datas.Add(tk);
            }
            return(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));
        }
Beispiel #8
0
        public string GetList(long roomRegId)
        {
            var datas = RoomRegTkBll.GetList(roomRegId);

            return(JsonConvert.SerializeObject(datas));
        }