Esempio n. 1
0
        public PageResult <SaleRmaDto> GetByReturnGoodsCompensate(ReturnGoodsInfoRequest request)
        {
            var rep = _repository as ISaleRMARepository;

            return(rep.GetAll(request.OrderNo, request.SaleOrderNo, request.PayType, request.RmaNo,
                              request.StartDate, request.EndDate, request.RmaStatus, request.StoreID, EnumReturnGoodsStatus.CompensateVerifyFailed, request.pageIndex, request.pageSize));
        }
Esempio n. 2
0
        public PageResult <SaleRmaDto> GetByReturnGoodsInfo(ReturnGoodsInfoRequest request)
        {
            ISaleRMARepository rep = _repository as ISaleRMARepository;

            return(rep.GetAll(request.OrderNo, request.SaleOrderNo, request.PayType, request.RmaNo,
                              request.StartDate, request.EndDate, request.RmaStatus, request.StoreID, EnumReturnGoodsStatus.NoProcess, request.pageIndex, request.pageSize));
        }
Esempio n. 3
0
        public PageResult <OrderDto> GetSaleRmaByReturnGoodsCompensate(ReturnGoodsInfoRequest request)
        {
            request.FormatDate();
            _orderRepository.SetCurrentUser(_accountService.GetByUserID(UserId));
            var lst = _orderRepository.GetBySaleRma(request, null, EnumReturnGoodsStatus.CompensateVerifyFailed);

            return(Mapper.Map <Order, OrderDto>(lst));
        }
Esempio n. 4
0
        public PageResult <OrderDto> GetByReturnGoodsInfo(ReturnGoodsInfoRequest request)
        {
            request.FormatDate();
            _orderRepository.SetCurrentUser(_accountService.GetByUserID(UserId));
            var lst = _orderRepository.GetByReturnGoodsInfo(request);

            return(Mapper.Map <Order, OrderDto>(lst));
        }
Esempio n. 5
0
 public IHttpActionResult GetByReturnGoodsCompensate([FromUri] ReturnGoodsInfoRequest request, [UserId] int uid)
 {
     return(DoFunction(() =>
     {
         _orderService.UserId = uid;
         return _orderService.GetSaleRmaByReturnGoodsCompensate(request);
     }));
 }
Esempio n. 6
0
 public IHttpActionResult GetShippingBackByReturnGoodsInfo([FromUri] ReturnGoodsInfoRequest request, [UserId] int uid)
 {
     return(DoFunction(() =>
     {
         _orderService.UserId = uid;
         return _orderService.GetShippingBackByReturnGoodsInfo(request);
     }, "查询订单信息失败"));
 }
Esempio n. 7
0
 public IHttpActionResult GetByReturnGoodsInfo([FromUri] ReturnGoodsInfoRequest request, [UserId] int uid)
 {
     return(DoFunction(() =>
     {
         _saleRmaService.UserId = uid;
         return _saleRmaService.GetByReturnGoodsInfo(request);
     }, "查询订单信息失败"));
 }
Esempio n. 8
0
        public PageResult <Order> GetBySaleRma(ReturnGoodsInfoRequest request, int?rmaStatus, EnumReturnGoodsStatus returnGoodsStatus)
        {
            using (var db = new YintaiHZhouContext())
            {
                var filter2 = db.OPC_RMAs.Where(t => t.CreatedDate >= request.StartDate && t.CreatedDate < request.EndDate && t.RMAStatus == (int)returnGoodsStatus);

                if (rmaStatus.HasValue)
                {
                    filter2 = filter2.Where(t => t.Status == rmaStatus.Value);
                }

                var filter = db.Orders.Where(t => true);

                if (CurrentUser != null)
                {
                    filter = filter.Where(t => CurrentUser.StoreIds.Contains(t.StoreId));
                }

                if (request.OrderNo.IsNotNull())
                {
                    filter = filter.Where(t => t.OrderNo.Contains(request.OrderNo));
                }
                if (request.PayType.IsNotNull())
                {
                    filter = filter.Where(t => t.PaymentMethodCode == request.PayType);
                }
                if (request.SaleOrderNo.IsNotNull())
                {
                    filter = filter.Join(db.OPC_Sales.Where(t => t.SaleOrderNo.Contains(request.SaleOrderNo)),
                                         t => t.OrderNo, o => o.OrderNo, (t, o) => t);
                }


                if (request.RmaNo.IsNotNull())
                {
                    filter2 = filter2.Where(t => t.RMANo == request.RmaNo);
                }

                if (request.RmaStatus.HasValue)
                {
                    filter2 = filter2.Where(t => t.Status == request.RmaStatus.Value);
                }

                if (request.StoreID.HasValue)
                {
                    filter2 = filter2.Where(t => t.StoreId == request.StoreID.Value);
                }

                var orderIds = filter2.ToList().Select(t => t.OrderNo).Distinct().ToList();

                filter = filter.Where(t => orderIds.Contains(t.OrderNo)).OrderByDescending(t => t.CreateDate);

                return(filter.ToPageResult(request.pageIndex, request.pageSize));
            }
        }
Esempio n. 9
0
        public PageResult <OrderDto> GetShippingBackByReturnGoodsInfo(ReturnGoodsInfoRequest request)
        {
            request.FormatDate();

            int status = EnumRMAStatus.ShipVerifyNotPass.AsId();

            _orderRepository.SetCurrentUser(_accountService.GetByUserID(UserId));
            var lst = _orderRepository.GetBySaleRma(request, status, EnumReturnGoodsStatus.NoProcess);

            return(Mapper.Map <Order, OrderDto>(lst));
        }
Esempio n. 10
0
        public void TestGetByReturnGoodsInfo()
        {
            ReturnGoodsInfoRequest goods = new ReturnGoodsInfoRequest();

            goods.StartDate = new DateTime(2010, 1, 1);
            goods.EndDate   = DateTime.Now.Date.AddDays(1);


            var lst = Service.GetByReturnGoodsInfo(goods);

            AssertList <OrderDto>(lst);
        }
Esempio n. 11
0
        public IHttpActionResult GetByReturnGoodsInfo([FromUri] ReturnGoodsInfoRequest request, [UserId] int uid, [UserProfile] UserProfile userProfile)
        {
            var queryRequest = AutoMapper.Mapper.Map <ReturnGoodsInfoRequest, RmaQueryRequest>(request);

            return(GetPagedList4RmaPagedResult(queryRequest, userProfile));

            //return DoFunction(() =>
            //{
            //    _orderService.UserId = uid;
            //    return _orderService.GetByReturnGoodsInfo(request);
            //}, "查询订单信息失败");
        }
Esempio n. 12
0
        public PageResult <Order> GetByReturnGoodsInfo(ReturnGoodsInfoRequest request)
        {
            //todo 查询所有有退货的订单
            using (var db = new YintaiHZhouContext())
            {
                var filter2 = db.OPC_RMAs.Where(t => t.CreatedDate >= request.StartDate && t.CreatedDate < request.EndDate); //&& t.RMAStatus==(int)EnumReturnGoodsStatus.NoProcess;

                var filter = db.Orders.Where(t => true);

                if (request.OrderNo.IsNotNull())
                {
                    filter = filter.Where(t => t.OrderNo == request.OrderNo);
                }
                if (request.PayType.IsNotNull())
                {
                    filter = filter.Where(t => t.PaymentMethodCode == request.PayType);
                }
                if (request.SaleOrderNo.IsNotNull())
                {
                    filter = filter.Join(db.OPC_Sales.Where(t => t.SaleOrderNo == request.SaleOrderNo),
                                         t => t.OrderNo, o => o.OrderNo, (t, o) => t);
                }


                if (request.RmaNo.IsNotNull())
                {
                    filter2 = filter2.Where(t => t.RMANo == request.RmaNo);
                }

                if (request.RmaStatus.HasValue && request.RmaStatus != -1)
                {
                    filter2 = filter2.Where(t => t.Status == request.RmaStatus.Value);
                }

                if (request.StoreID.HasValue)
                {
                    filter2 = filter2.Where(t => t.StoreId == request.StoreID.Value);
                }

                var orderIds = filter2.ToList().Select(t => t.OrderNo).Distinct().ToList();

                filter = filter.Where(t => orderIds.Contains(t.OrderNo)).OrderByDescending(t => t.CreateDate);

                return(filter.ToPageResult(request.pageIndex, request.pageSize));
            }
        }
Esempio n. 13
0
 public PageResult <OPC_RMA> GetByReturnGoods(ReturnGoodsInfoRequest request)
 {
     //todo 为实现
     return(null);
 }