public JsonResult List(DateTime?startDate, DateTime?endDate, long?orderId, int?complaintStatus, string userName, int page, int rows)
        {
            var queryModel = new ComplaintQuery()
            {
                StartDate = startDate,
                EndDate   = endDate,
                OrderId   = orderId,
                Status    = (Model.OrderComplaintInfo.ComplaintStatus?)complaintStatus,
                ShopId    = CurrentSellerManager.ShopId,
                UserName  = userName,
                PageSize  = rows,
                PageNo    = page
            };

            ObsoletePageModel <OrderComplaintInfo> orderComplaints = _iComplaintService.GetOrderComplaints(queryModel);

            var orderComplaintMode = orderComplaints.Models.ToArray().Select(item => new
            {
                Id               = item.Id,
                OrderId          = item.OrderId,
                OrderTotalAmount = item.OrderInfo.OrderTotalAmount.ToString("F2"),
                PaymentTypeName  = item.OrderInfo.OrderTotalAmount == 0 ? "积分支付" : item.OrderInfo.PaymentTypeName,
                ComplaintStatus  = item.Status.ToDescription(),
                ShopName         = item.ShopName,
                ShopPhone        = item.ShopPhone,
                UserName         = item.UserName,
                UserPhone        = item.UserPhone,
                ComplaintDate    = item.ComplaintDate.ToShortDateString(),
                ComplaintReason  = System.Text.RegularExpressions.Regex.Replace(item.ComplaintReason, @"(<|(&lt;))br[^>]*?(>|(&gt;))", "").Replace("<", "&lt;").Replace(">", "&gt;"),
                SellerReply      = item.SellerReply
            });

            return(Json(new { rows = orderComplaintMode, total = orderComplaints.Total }));
        }
        public JsonResult List(DateTime?startDate, DateTime?endDate, long?orderId, int?complaintStatus, string shopName, string userName, int page, int rows)
        {
            OrderComplaintInfo.ComplaintStatus?nullable;
            ComplaintQuery complaintQuery = new ComplaintQuery()
            {
                StartDate = startDate,
                EndDate   = endDate,
                OrderId   = orderId
            };
            ComplaintQuery complaintQuery1 = complaintQuery;
            int?           nullable1       = complaintStatus;

            if (nullable1.HasValue)
            {
                nullable = new OrderComplaintInfo.ComplaintStatus?((OrderComplaintInfo.ComplaintStatus)nullable1.GetValueOrDefault());
            }
            else
            {
                nullable = null;
            }
            complaintQuery1.Status  = nullable;
            complaintQuery.ShopName = shopName;
            complaintQuery.UserName = userName;
            complaintQuery.PageSize = rows;
            complaintQuery.PageNo   = page;
            PageModel <OrderComplaintInfo> orderComplaints = ServiceHelper.Create <IComplaintService>().GetOrderComplaints(complaintQuery);
            var array =
                from item in orderComplaints.Models.ToArray()
                select new { Id = item.Id, OrderId = item.OrderId, ComplaintStatus = item.Status.ToDescription(), ShopName = item.ShopName, ShopPhone = item.ShopPhone, UserName = item.UserName, UserPhone = item.UserPhone, ComplaintDate = item.ComplaintDate.ToShortDateString(), ComplaintReason = Server.HtmlEncode(item.ComplaintReason), SellerReply = (string.IsNullOrEmpty(item.SellerReply) ? string.Empty : Server.HtmlEncode(item.SellerReply)) };

            return(Json(new { rows = array, total = orderComplaints.Total }));
        }
Beispiel #3
0
        public ActionResult Record(int pageSize = 10, int pageNo = 1)
        {
            ComplaintQuery query = new ComplaintQuery();

            query.UserId   = CurrentUser.Id;
            query.PageNo   = pageNo;
            query.PageSize = pageSize;
            var model = _iComplaintService.GetOrderComplaints(query);

            #region 分页控制
            PagingInfo info = new PagingInfo
            {
                CurrentPage  = pageNo,
                ItemsPerPage = pageSize,
                TotalItems   = model.Total
            };
            ViewBag.pageInfo = info;
            #endregion
            ViewBag.Keyword  = string.IsNullOrWhiteSpace(SiteSettings.SearchKeyword) ? SiteSettings.Keyword : SiteSettings.SearchKeyword;
            ViewBag.Keywords = SiteSettings.HotKeyWords;
            if (model.Models != null)
            {
                foreach (var item in model.Models)
                {
                    item.ComplaintReason = ReplaceHtmlTag(HtmlHelper.ConvertHtmlToPlainText(item.ComplaintReason));
                    item.SellerReply     = ReplaceHtmlTag(HtmlHelper.ConvertHtmlToPlainText(item.SellerReply));
                }
            }
            return(View(model.Models.ToList()));
        }
        public JsonResult List(DateTime?startDate, DateTime?endDate, long?orderId, int?complaintStatus, string shopName, string userName, int page, int rows)
        {
            var queryModel = new ComplaintQuery()
            {
                StartDate = startDate,
                EndDate   = endDate,
                OrderId   = orderId,
                Status    = (Mall.Entities.OrderComplaintInfo.ComplaintStatus?)complaintStatus,
                ShopName  = shopName,
                UserName  = userName,
                PageSize  = rows,
                PageNo    = page
            };

            QueryPageModel <Mall.Entities.OrderComplaintInfo> orderComplaints = _iComplaintService.GetOrderComplaints(queryModel);

            var orderComplaintMode = orderComplaints.Models.ToArray().Select(item => new
            {
                Id              = item.Id,
                OrderId         = item.OrderId,
                ComplaintStatus = item.Status.ToDescription(),
                ShopName        = item.ShopName,
                ShopPhone       = item.ShopPhone,
                UserName        = item.UserName,
                UserPhone       = item.UserPhone,
                ComplaintDate   = item.ComplaintDate.ToShortDateString(),
                ComplaintReason = System.Text.RegularExpressions.Regex.Replace(item.ComplaintReason, @"(<|(&lt;))br[^>]*?(>|(&gt;))", "").Replace("<", "&lt;").Replace(">", "&gt;"),
                SellerReply     = item.SellerReply,
                PlatRemark      = string.IsNullOrWhiteSpace(item.PlatRemark) ? "" : item.PlatRemark
            }).ToList();

            return(Json(new { rows = orderComplaintMode, total = orderComplaints.Total }));
        }
        public JsonResult List(DateTime?startDate, DateTime?endDate, long?orderId, int?complaintStatus, string userName, int page, int rows)
        {
            OrderComplaintInfo.ComplaintStatus?nullable;
            ComplaintQuery complaintQuery = new ComplaintQuery()
            {
                StartDate = startDate,
                EndDate   = endDate,
                OrderId   = orderId
            };
            ComplaintQuery complaintQuery1 = complaintQuery;
            int?           nullable1       = complaintStatus;

            if (nullable1.HasValue)
            {
                nullable = new OrderComplaintInfo.ComplaintStatus?((OrderComplaintInfo.ComplaintStatus)nullable1.GetValueOrDefault());
            }
            else
            {
                nullable = null;
            }
            complaintQuery1.Status  = nullable;
            complaintQuery.ShopId   = new long?(base.CurrentSellerManager.ShopId);
            complaintQuery.UserName = userName;
            complaintQuery.PageSize = rows;
            complaintQuery.PageNo   = page;
            PageModel <OrderComplaintInfo> orderComplaints = ServiceHelper.Create <IComplaintService>().GetOrderComplaints(complaintQuery);
            var array =
                from item in orderComplaints.Models.ToArray()
                select new { Id = item.Id, OrderId = item.OrderId, OrderTotalAmount = item.OrderInfo.OrderTotalAmount.ToString("F2"), PaymentTypeName = (item.OrderInfo.OrderTotalAmount == new decimal(0) ? "积分支付" : item.OrderInfo.PaymentTypeName), ComplaintStatus = item.Status.ToDescription(), ShopName = item.ShopName, ShopPhone = item.ShopPhone, UserName = item.UserName, UserPhone = item.UserPhone, ComplaintDate = item.ComplaintDate.ToShortDateString(), ComplaintReason = item.ComplaintReason, SellerReply = item.SellerReply };

            return(Json(new { rows = array, total = orderComplaints.Total }));
        }
Beispiel #6
0
        public QueryPageModel <OrderComplaintInfo> GetOrderComplaints(ComplaintQuery query)
        {
            var db   = WhereBuilder(query);
            var data = db.OrderByDescending(o => o.Id).ToPagedList(query.PageNo, query.PageSize);

            return(new QueryPageModel <OrderComplaintInfo>
            {
                Models = data,
                Total = data.TotalRecordCount
            });
        }
Beispiel #7
0
        public JsonResult GetsellerAdminMessage()
        {
            CommentQuery commentQuery = new CommentQuery()
            {
                PageNo   = 1,
                PageSize = 100001,
                ShopID   = base.CurrentSellerManager.ShopId,
                IsReply  = new bool?(false)
            };
            CommentQuery      commentQuery1     = commentQuery;
            int               num               = ServiceHelper.Create <ICommentService>().GetComments(commentQuery1).Models.Count();
            ConsultationQuery consultationQuery = new ConsultationQuery()
            {
                PageNo   = 1,
                PageSize = 10000,
                ShopID   = base.CurrentSellerManager.ShopId,
                IsReply  = new bool?(false)
            };
            ConsultationQuery consultationQuery1 = consultationQuery;
            int           num1         = ServiceHelper.Create <IConsultationService>().GetConsultations(consultationQuery1).Models.Count();
            IOrderService orderService = ServiceHelper.Create <IOrderService>();
            OrderQuery    orderQuery   = new OrderQuery()
            {
                PageNo   = 1,
                PageSize = 10000,
                Status   = new OrderInfo.OrderOperateStatus?(OrderInfo.OrderOperateStatus.WaitPay),
                ShopId   = new long?(base.CurrentSellerManager.ShopId)
            };
            int           num2          = orderService.GetOrders <OrderInfo>(orderQuery, null).Models.Count();
            IOrderService orderService1 = ServiceHelper.Create <IOrderService>();
            OrderQuery    orderQuery1   = new OrderQuery()
            {
                PageNo   = 1,
                PageSize = 10000,
                Status   = new OrderInfo.OrderOperateStatus?(OrderInfo.OrderOperateStatus.WaitDelivery),
                ShopId   = new long?(base.CurrentSellerManager.ShopId)
            };
            int num3 = orderService1.GetOrders <OrderInfo>(orderQuery1, null).Models.Count();
            IComplaintService complaintService = ServiceHelper.Create <IComplaintService>();
            ComplaintQuery    complaintQuery   = new ComplaintQuery()
            {
                PageNo   = 1,
                PageSize = 10000,
                ShopId   = new long?(base.CurrentSellerManager.ShopId),
                Status   = new OrderComplaintInfo.ComplaintStatus?(OrderComplaintInfo.ComplaintStatus.WaitDeal)
            };
            int num4 = complaintService.GetOrderComplaints(complaintQuery).Models.Count();
            int num5 = num1 + num + num2 + num4 + num3;

            return(Json(new { UnReplyConsultations = num1, UnReplyComments = num, UnPayOrder = num2, UnComplaints = num4, UnDeliveryOrder = num3, AllMessageCount = num5 }, JsonRequestBehavior.AllowGet));
        }
        public ObsoletePageModel <OrderComplaintInfo> GetOrderComplaints(ComplaintQuery complaintQuery)
        {
            int total;

            //所有的子账号
            IList <long> childIds = new List <long>();

            IQueryable <OrderComplaintInfo> complaints = Context.OrderComplaintInfo.AsQueryable();

            if (complaintQuery.OrderId.HasValue)
            {
                complaints = complaints.Where(item => complaintQuery.OrderId == item.OrderId);
            }
            if (complaintQuery.StartDate.HasValue)
            {
                complaints = complaints.Where(item => item.ComplaintDate >= complaintQuery.StartDate.Value);
            }
            if (complaintQuery.EndDate.HasValue)
            {
                var endDay = complaintQuery.EndDate.Value.Date.AddDays(1);
                complaints = complaints.Where(item => item.ComplaintDate < endDay);
            }
            if (complaintQuery.Status.HasValue)
            {
                complaints = complaints.Where(item => complaintQuery.Status == item.Status);
            }
            if (complaintQuery.ShopId.HasValue)
            {
                complaints = complaints.Where(item => complaintQuery.ShopId == item.ShopId);
            }
            if (complaintQuery.UserId.HasValue)
            {
                complaints = complaints.Where(item => item.UserId == complaintQuery.UserId);
            }
            if (!string.IsNullOrWhiteSpace(complaintQuery.ShopName))
            {
                complaints = complaints.Where(item => item.ShopName.Contains(complaintQuery.ShopName));
            }
            if (!string.IsNullOrWhiteSpace(complaintQuery.UserName))
            {
                complaints = complaints.Where(item => item.UserName.Contains(complaintQuery.UserName));
            }
            complaints = complaints.GetPage(out total, complaintQuery.PageNo, complaintQuery.PageSize);
            ObsoletePageModel <OrderComplaintInfo> pageModel = new ObsoletePageModel <OrderComplaintInfo>()
            {
                Models = complaints, Total = total
            };

            return(pageModel);
        }
Beispiel #9
0
        public JsonResult GetPlatfromMessage()
        {
            ProductQuery productQuery = new ProductQuery()
            {
                PageSize    = 10000,
                PageNo      = 1,
                AuditStatus = new ProductInfo.ProductAuditStatus[] { ProductInfo.ProductAuditStatus.WaitForAuditing },
                SaleStatus  = new ProductInfo.ProductSaleStatus?(ProductInfo.ProductSaleStatus.OnSale)
            };
            ProductQuery productQuery1 = productQuery;
            int          num           = ServiceHelper.Create <IProductService>().GetProducts(productQuery1).Models.Count();
            ShopQuery    shopQuery     = new ShopQuery()
            {
                Status   = new ShopInfo.ShopAuditStatus?(0),
                PageSize = 10000,
                PageNo   = 1
            };
            int num1 = (
                from s in ServiceHelper.Create <IShopService>().GetShops(shopQuery).Models
                where (int)s.ShopStatus == 2 || (int)s.ShopStatus == 5 || (int)s.ShopStatus == 3
                select s).Count();
            long?          nullable       = null;
            int            num2           = ServiceHelper.Create <IBrandService>().GetShopBrandApplys(nullable, new int?(0), 1, 10000, "").Models.Count();
            ComplaintQuery complaintQuery = new ComplaintQuery()
            {
                Status   = new OrderComplaintInfo.ComplaintStatus?(OrderComplaintInfo.ComplaintStatus.Dispute),
                PageSize = 10000,
                PageNo   = 1
            };
            ComplaintQuery complaintQuery1 = complaintQuery;
            int            num3            = ServiceHelper.Create <IComplaintService>().GetOrderComplaints(complaintQuery1).Models.Count();
            RefundQuery    refundQuery     = new RefundQuery()
            {
                ConfirmStatus = new OrderRefundInfo.OrderRefundConfirmStatus?(OrderRefundInfo.OrderRefundConfirmStatus.UnConfirm),
                AuditStatus   = new OrderRefundInfo.OrderRefundAuditStatus?(OrderRefundInfo.OrderRefundAuditStatus.Audited),
                PageSize      = 10000,
                PageNo        = 1
            };
            RefundQuery refundQuery1 = refundQuery;
            int         num4         = ServiceHelper.Create <IRefundService>().GetOrderRefunds(refundQuery1).Models.Count();
            int         num5         = num + num1 + num2 + num3 + num4;

            return(Json(new { ProductWaitForAuditing = num, ShopWaitAudit = num1, BrandAudit = num2, ComplaintDispute = num3, RefundWaitAudit = num4, AllMessageCount = num5 }, JsonRequestBehavior.AllowGet));
        }
Beispiel #10
0
        public ActionResult Record(int pageSize = 10, int pageNo = 1)
        {
            ComplaintQuery complaintQuery = new ComplaintQuery()
            {
                UserId   = new long?(base.CurrentUser.Id),
                PageNo   = pageNo,
                PageSize = pageSize
            };
            PageModel <OrderComplaintInfo> orderComplaints = ServiceHelper.Create <IComplaintService>().GetOrderComplaints(complaintQuery);
            PagingInfo pagingInfo = new PagingInfo()
            {
                CurrentPage  = pageNo,
                ItemsPerPage = pageSize,
                TotalItems   = orderComplaints.Total
            };

            ViewBag.pageInfo = pagingInfo;
            return(View(orderComplaints.Models.ToList()));
        }
Beispiel #11
0
        public ActionResult Record(int pageSize = 10, int pageNo = 1)
        {
            ComplaintQuery query = new ComplaintQuery();

            query.UserId   = CurrentUser.Id;
            query.PageNo   = pageNo;
            query.PageSize = pageSize;
            var model = _iComplaintService.GetOrderComplaints(query);

            #region 分页控制
            PagingInfo info = new PagingInfo
            {
                CurrentPage  = pageNo,
                ItemsPerPage = pageSize,
                TotalItems   = model.Total
            };
            ViewBag.pageInfo = info;
            #endregion
            return(View(model.Models.ToList()));
        }
        public JsonResult List(DateTime?startDate, DateTime?endDate, long?orderId, int?complaintStatus, string userName, int page, int rows)
        {
            var queryModel = new ComplaintQuery()
            {
                StartDate = startDate,
                EndDate   = endDate,
                OrderId   = orderId,
                Status    = (Himall.Entities.OrderComplaintInfo.ComplaintStatus?)complaintStatus,
                ShopId    = CurrentSellerManager.ShopId,
                UserName  = userName,
                PageSize  = rows,
                PageNo    = page
            };

            var orderComplaints = _iComplaintService.GetOrderComplaints(queryModel);
            var orders          = OrderApplication.GetOrders(orderComplaints.Models.Select(p => p.OrderId));

            var orderComplaintMode = orderComplaints.Models.Select(item =>
            {
                var order = orders.FirstOrDefault(p => p.Id == item.OrderId);
                return(new
                {
                    Id = item.Id,
                    OrderId = item.OrderId,
                    OrderTotalAmount = order.OrderTotalAmount.ToString("F2"),
                    PaymentTypeName = (order.OrderTotalAmount == 0 && order.CapitalAmount == 0) ? "积分支付" : order.PaymentTypeName,
                    ComplaintStatus = item.Status.ToDescription(),
                    ShopName = item.ShopName,
                    ShopPhone = item.ShopPhone,
                    UserName = item.UserName,
                    UserPhone = item.UserPhone,
                    ComplaintDate = item.ComplaintDate.ToShortDateString(),
                    ComplaintReason = System.Text.RegularExpressions.Regex.Replace(item.ComplaintReason, @"(<|(&lt;))br[^>]*?(>|(&gt;))", "").Replace("<", "&lt;").Replace(">", "&gt;"),
                    SellerReply = item.SellerReply,
                    PlatRemark = item.PlatRemark
                });
            });

            return(Json(new { rows = orderComplaintMode, total = orderComplaints.Total }));
        }
Beispiel #13
0
        private GetBuilder <OrderComplaintInfo> WhereBuilder(ComplaintQuery query)
        {
            var db = DbFactory.Default.Get <OrderComplaintInfo>();

            if (query.OrderId.HasValue)
            {
                db.Where(item => query.OrderId == item.OrderId);
            }
            if (query.StartDate.HasValue)
            {
                db.Where(item => item.ComplaintDate >= query.StartDate.Value);
            }
            if (query.EndDate.HasValue)
            {
                var endDay = query.EndDate.Value.Date.AddDays(1);
                db.Where(item => item.ComplaintDate < endDay);
            }
            if (query.Status.HasValue)
            {
                db.Where(item => query.Status.Value == item.Status);
            }
            if (query.ShopId.HasValue)
            {
                db.Where(item => query.ShopId == item.ShopId);
            }
            if (query.UserId.HasValue)
            {
                db.Where(item => item.UserId == query.UserId);
            }
            if (!string.IsNullOrWhiteSpace(query.ShopName))
            {
                db.Where(item => item.ShopName.Contains(query.ShopName));
            }
            if (!string.IsNullOrWhiteSpace(query.UserName))
            {
                db.Where(item => item.UserName.Contains(query.UserName));
            }
            return(db);
        }
Beispiel #14
0
        public int GetOrderComplaintCount(ComplaintQuery query)
        {
            var db = WhereBuilder(query);

            return(db.Count());
        }
Beispiel #15
0
        public PageModel <OrderComplaintInfo> GetOrderComplaints(ComplaintQuery complaintQuery)
        {
            int         num;
            List <long> nums = new List <long>();
            IQueryable <OrderComplaintInfo> orderId = context.OrderComplaintInfo.AsQueryable <OrderComplaintInfo>();

            if (complaintQuery.OrderId.HasValue)
            {
                orderId =
                    from item in orderId
                    where complaintQuery.OrderId == item.OrderId
                    select item;
            }
            if (complaintQuery.StartDate.HasValue)
            {
                orderId =
                    from item in orderId
                    where complaintQuery.StartDate <= item.ComplaintDate
                    select item;
            }
            if (complaintQuery.EndDate.HasValue)
            {
                orderId =
                    from item in orderId
                    where complaintQuery.EndDate >= item.ComplaintDate
                    select item;
            }
            if (complaintQuery.Status.HasValue)
            {
                orderId =
                    from item in orderId
                    where (int?)complaintQuery.Status == (int?)item.Status
                    select item;
            }
            if (complaintQuery.ShopId.HasValue)
            {
                orderId =
                    from item in orderId
                    where complaintQuery.ShopId == item.ShopId
                    select item;
            }
            if (complaintQuery.UserId.HasValue)
            {
                orderId =
                    from item in orderId
                    where item.UserId == complaintQuery.UserId
                    select item;
            }
            if (!string.IsNullOrWhiteSpace(complaintQuery.ShopName))
            {
                orderId =
                    from item in orderId
                    where item.ShopName.Contains(complaintQuery.ShopName)
                    select item;
            }
            if (!string.IsNullOrWhiteSpace(complaintQuery.UserName))
            {
                orderId =
                    from item in orderId
                    where item.UserName.Contains(complaintQuery.UserName)
                    select item;
            }
            orderId = orderId.GetPage(out num, complaintQuery.PageNo, complaintQuery.PageSize, null);
            return(new PageModel <OrderComplaintInfo>()
            {
                Models = orderId,
                Total = num
            });
        }
Beispiel #16
0
 /// <summary>
 /// 获取投诉数量
 /// </summary>
 /// <param name="query"></param>
 /// <returns></returns>
 public static int GetOrderComplaintCount(ComplaintQuery query)
 {
     return(Service.GetOrderComplaintCount(query));
 }
Beispiel #17
0
        public PageModel <OrderComplaintInfo> GetOrderComplaints(ComplaintQuery complaintQuery)
        {
            int         num;
            List <long> nums = new List <long>();
            IQueryable <OrderComplaintInfo> orderId = context.OrderComplaintInfo.AsQueryable <OrderComplaintInfo>();

            if (complaintQuery.OrderId.HasValue)
            {
                orderId =
                    from item in orderId
                    where complaintQuery.OrderId == item.OrderId
                    select item;
            }
            if (complaintQuery.StartDate.HasValue)
            {
                orderId =
                    from item in orderId
                    where complaintQuery.StartDate <= item.ComplaintDate
                    select item;
            }
            if (complaintQuery.EndDate.HasValue)
            {
                orderId =
                    from item in orderId
                    where complaintQuery.EndDate >= item.ComplaintDate
                    select item;
            }
            if (complaintQuery.Status.HasValue)
            {
                orderId =
                    from item in orderId
                    where (int?)complaintQuery.Status == (int?)item.Status
                    select item;
            }
            if (complaintQuery.ShopId.HasValue)
            {
                orderId =
                    from item in orderId
                    where complaintQuery.ShopId == item.ShopId
                    select item;
            }
            if (complaintQuery.UserId.HasValue)
            {
                orderId =
                    from item in orderId
                    where item.UserId == complaintQuery.UserId
                    select item;
            }
            if (!string.IsNullOrWhiteSpace(complaintQuery.ShopName))
            {
                orderId =
                    from item in orderId
                    where item.ShopName.Contains(complaintQuery.ShopName)
                    select item;
            }
            if (!string.IsNullOrWhiteSpace(complaintQuery.UserName))
            {
                orderId =
                    from item in orderId
                    where item.UserName.Contains(complaintQuery.UserName)
                    select item;
            }
            orderId = orderId.GetPage(out num, complaintQuery.PageNo, complaintQuery.PageSize, null);
            foreach (OrderComplaintInfo info in orderId.ToList())
            {
                ShopInfo shopInfo = context.ShopInfo.FirstOrDefault((ShopInfo m) => m.Id.Equals(info.ShopId));
                info.CompanyName = (shopInfo == null ? "" : shopInfo.CompanyName);
            }
            return(new PageModel <OrderComplaintInfo>()
            {
                Models = orderId,
                Total = num
            });
        }