Esempio n. 1
0
        /// <summary>
        /// 返回订单和订单下所有台号
        /// </summary>
        /// <param name="req">订单结账请求参数</param>
        /// <returns></returns>
        //[CustomerAuthorize(Permission.结账)]
        public ActionResult GetOrderInfo(CheckoutReqDTO checkoutReqDTO)
        {
            try
            {
                var currentUser = OperatorProvider.Provider.GetCurrent();
                checkoutReqDTO.OrderTableStatus = OrderTableStatus.未结;
                CheckOutOrderDTO checkoutOrder = GetCheckOutOrder(checkoutReqDTO);
                var user = _userService.GetUserInfo(new VerifyUserDTO()
                {
                    UserId = currentUser.UserId
                });
                //var payTypeList =  EnumToList.ConvertEnumToList(typeof(CyddPayType));
                var payTypeList = _payMethodRepository.GetList();

                checkoutOrder.OperateUser     = currentUser.UserId;
                checkoutOrder.OperateUserName = currentUser.UserName;
                checkoutOrder.TableIds        = checkoutReqDTO.TableIds;
                //checkoutOrder.PayTypeList = payTypeList.Where(x => x.Key > 0).ToList();
                checkoutOrder.PayTypeList    = payTypeList;
                checkoutOrder.DiscountRate   = user.MinDiscountValue;
                checkoutOrder.AuthClearValue = user.MaxClearValue;
                checkoutOrder.PaidRecordList = checkoutOrder.PaidRecordList
                                               .Where(x => x.CyddJzType == CyddJzType.定金 &&
                                                      x.CyddJzStatus == CyddJzStatus.已付).ToList();//只取当前订单已付的定金记录
                checkoutOrder.PrintModel            = _printerRepository.GetPrintModel();
                checkoutOrder.CheckOutStaticsList   = _checkOutService.GetCheckOutStatics(checkoutOrder.OrderTableList);
                checkoutOrder.CheckOutRemovePayType = _payMethodRepository.GetCheckOutRemovePayType();
                return(Json(checkoutOrder));
            }
            catch (Exception ex)
            {
                return(Json(ex.Message));
            }
        }