public JsonResult BeforeCheckout(CheckOutBillDTO billDto, WholeOrPartialCheckoutDto req) { Response res = new Response(); if (ModelState.IsValid) { try { var currentUser = OperatorProvider.Provider.GetCurrent(); var user = _userService.GetUserInfo(new VerifyUserDTO() { UserId = currentUser.UserId }); var discount = user.MinDiscountValue; req.OrderTableStatus = OrderTableStatus.未结; req.CompanyId = currentUser.CompanyId.ToInt(); req.OperateUser = currentUser.UserId; req.CurrentMarketId = currentUser.LoginMarketId; req.AuthPermissionDiscount = discount; req.OperateUserCode = currentUser.UserCode; res.Data = _checkOutService.BeforeWholeOrPartialCheckout(req); _printService.CheckedOutBill(billDto); } catch (Exception ex) { res.Data = false; res.Message = ex.Message; } } else { res.Data = false; res.Message = string.Join(",", ModelState .SelectMany(ms => ms.Value.Errors) .Select(e => e.ErrorMessage)); } return(Json(res)); }