Пример #1
0
        /// <summary>
        /// 设置收银
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public ExectueResult SetCashNo(RmaSetCashNoRequest request, int userId)
        {
            if (request == null)
            {
                throw new ArgumentNullException("request");
            }

            /*  设置收银
             *  1.只有迷你银的RMA单可以设置
             *  2.[Description("完成打印退货单")] PrintRMA = 30,
             *  3.收银状态不判断,可以重复录收银
             */
            var rmaModel = _rmaRepository.GetItem(request.RmaNo);

            if (rmaModel == null)
            {
                throw new NotExistsRmaException(request.RmaNo);
            }

            if (rmaModel.OrderProductType != OrderProductType.MiniSilver.AsId())
            {
                throw new NotOrderProductTypeRmaException(request.RmaNo, OrderProductType.MiniSilver);
            }

            if (rmaModel.Status != EnumRMAStatus.PrintRMA.AsId())
            {
                throw new NotStatusRmaException(request.RmaNo, (EnumRMAStatus)rmaModel.Status, EnumRMAStatus.PrintRMA);
            }

            var entity = _rmaRepository.GetByRmaNo2(rmaModel.RMANo);


            entity.UpdatedUser = UserId;
            //entity.UpdatedDate = DateTime.Now;
            entity.RmaCashNum    = request.CashNo;
            entity.RmaCashDate   = DateTime.Now;
            entity.RMACashStatus = EnumRMACashStatus.CashOver.AsId();

            _rmaRepository.Update(entity);

            //rma_details.cash
            //var details = _rmaDetailRepository.GetListByRmano(entity.RMANo);
            //foreach (var item in details)
            //{
            //    item.UpdatedDate = DateTime.Now;
            //    item.UpdatedUser = UserId;
            //    item.CashNum = entity.RmaCashNum;
            //}

            return(new OkExectueResult());
        }
Пример #2
0
        public void ShippingReceiveGoods(string rmaNo)
        {
            var saleRma = _rmaRepository.GetByRmaNo2(rmaNo);

            if (saleRma == null)
            {
                throw new OpcException("快递单不存在,退货单号:" + rmaNo);
            }
            if (saleRma.RMAStatus < (int)EnumReturnGoodsStatus.NoProcess)
            {
                throw new OpcException("客服未确认,退货单号:" + rmaNo);
            }
            if (saleRma.Status > (int)EnumRMAStatus.ShipNoReceive)
            {
                throw new OpcException("该退货单已经确认或正在审核,退货单号:" + rmaNo);
            }

            saleRma.Status = EnumRMAStatus.ShipReceive.AsId();
            _rmaRepository.Update(saleRma);
        }