/// <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)); } }
public ActionResult GetOrderDeposits(int orderId) { Response res = new Response(); var data = _payRep.GetPaidRecordListByOrderId(orderId); data = data.Where(x => x.CyddJzType == CyddJzType.定金).ToList(); res.Data = data; return(Json(new { rows = data, total = data.Count, code = 0, msg = "", PrintModel = _printerRepository.GetPrintModel() }, JsonRequestBehavior.AllowGet)); }
public ActionResult InitFormInfo(List <int> orderTableId) { var itemAndDetails = _projectRepository.GetProjectAndDetailList(0, true); //菜品明细 var categories = _categoryRepository.GetAllCategoryList(); //菜品分类 var orderAndTables = _orderRepository.GetOrderAndTablesByOrderTableId(orderTableId[0]); //var projectExtendSplitList = _projectRepository.GetProjectExtendSplitList(); var projectExtendSplitList = _projectRepository.GetProjectExtendSplitListNew(); var projects = _projectRepository.GetDetailList(0, false); List <OrderDetailDTO> orderTableProjects = new List <OrderDetailDTO>(); if (orderTableId.Count == 1) // { orderTableProjects = _orderRepository.GetOrderTableProjects(orderTableId[0]); //已点菜品 } else if (orderTableId.Count > 1) { var Tables = _orderRepository.GetTablesByOrderTableIds(orderTableId); orderAndTables.TableName = Tables.Count > 1 ? string.Join(",", Tables.Select(p => p.Name)) : orderAndTables.TableName; orderTableProjects = _orderRepository.GetOrderTableProjects(orderTableId[0]);//已点菜品 } itemAndDetails = _restaurantCategoryRepository.FilterRestaurantCategorys(itemAndDetails, orderAndTables.R_Restaurant_Id); categories = _restaurantCategoryRepository.FilterRestaurantCategorys(categories, orderAndTables.R_Restaurant_Id); var currentUser = OperatorProvider.Provider.GetCurrent(); var permissions = new Dictionary <string, bool>(); permissions.Add("IsGive", (currentUser.Permission & (int)Permission.赠菜) == 0?false:true); permissions.Add("IsReturn", (currentUser.Permission & (int)Permission.退菜) == 0 ? false : true); var orderDetailCauses = _orderDetailCauseRepository.GetAllList(); var customConfigs = _customConfigRepository.GetList(new CustomConfigDTO() { PageModule = (int)PageModule.点餐界面PC端 }); var customConfigsFlat = _customConfigRepository.GetList(new CustomConfigDTO() { PageModule = (int)PageModule.点餐界面平板端 }); var info = new { OrderAndTables = orderAndTables, ProjectAndDetails = itemAndDetails, CategoryList = categories, OrderTableProjects = orderTableProjects, ProjectExtendSplitList = projectExtendSplitList, Projects = projects, PrintModel = _printerRepository.GetPrintModel(), UserPermission = permissions, GiveCauses = orderDetailCauses.Where(p => p.CauseType == CauseType.赠菜).ToList(), ReturnCauses = orderDetailCauses.Where(p => p.CauseType == CauseType.退菜).ToList(), OrderDetailTest = _projectRepository.GetOrderDetailIsTeset(), CustomConfigs = customConfigs, CustomConfigsFlat = customConfigsFlat, AutoListPrint = _orderRepository.GetAutoListPrint(), DefaultPromptly = _orderRepository.GetDefaultPromptly() }; return(Json(info)); }