Ejemplo n.º 1
0
        /// <summary>
        /// 后收款提交
        /// </summary>
        /// <param name="userModel"></param>
        /// <param name="request"></param>
        /// <param name="msg"></param>
        /// <returns></returns>
        public bool PostPayReceive(UserModel userModel, SaleOrderReceiveModel request, out string msg)
        {
            var order = Da.Get <SaleOrder>(request.SaleOrderId);
            var b1    = CheckAuthOrder(userModel, order, out msg);

            if (!b1)
            {
                return(false);
            }

            if (order.Status == (int)SaleOrderStatusEnum.Draft)
            {
                msg = "订单已退回修改,操作失败";
                return(false);
            }

            if (order.Status != (int)SaleOrderStatusEnum.SubmitAfterPay &&
                order.Status != (int)SaleOrderStatusEnum.StockedAfterPay &&
                order.Status != (int)SaleOrderStatusEnum.ShipedAfterPay)
            {
                msg = "订单可能已提交,操作失败";
                return(false);
            }

            if (order.Status == (int)SaleOrderStatusEnum.SubmitAfterPay)
            {
                order.Status = (int)SaleOrderStatusEnum.SubmitPay;
            }
            else if (order.Status == (int)SaleOrderStatusEnum.StockedAfterPay)
            {
                order.Status = (int)SaleOrderStatusEnum.StockedPay;
            }
            else if (order.Status == (int)SaleOrderStatusEnum.ShipedAfterPay)
            {
                order.Status = (int)SaleOrderStatusEnum.ShipedPay;
            }
            else
            {
                throw new Exception("操作失败");
            }

            order.FinancePostDate = DateTime.Now;
            order.FinancePostName = userModel.UserNickName;
            return(Da.Update(order));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 后收款提交
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public IResponseResult PostPayReceive(SaleOrderReceiveModel request)
        {
            var result = Biz.PostPayReceive(UserModel, request, out var msg);

            return(ReturnResult(result, msg));
        }