public UserOrderController( IShopBonusService iShopBonusService, ICashDepositsService iCashDepositsService, ISiteSettingService iSiteSettingService, IOrderService iOrderService, IRefundService iRefundService, ICustomerService iCustomerService, IProductService iProductService, ICouponService iCouponService, ICommentService iCommentService, IFightGroupService iFightGroupService, ITypeService iTypeService ) { _iShopBonusService = iShopBonusService; _iCashDepositsService = iCashDepositsService; _iSiteSettingService = iSiteSettingService; _iOrderService = iOrderService; _iRefundService = iRefundService; _iCustomerService = iCustomerService; _iProductService = iProductService; _iCouponService = iCouponService; _iCommentService = iCommentService; _iFightGroupService = iFightGroupService; _iTypeService = iTypeService; }
public JsonResult List(string shopName, int type, int page, int rows) { CashDepositQuery cashDepositQuery = new CashDepositQuery() { ShopName = shopName, PageNo = page, PageSize = rows }; CashDepositQuery nullable = cashDepositQuery; if (type == 1) { nullable.Type = new bool?(true); } if (type == 2) { nullable.Type = new bool?(false); } ICashDepositsService cashDepositsService = ServiceHelper.Create <ICashDepositsService>(); PageModel <CashDepositInfo> cashDeposits = cashDepositsService.GetCashDeposits(nullable); var collection = cashDeposits.Models.ToArray().Select((CashDepositInfo item) => { decimal needPayCashDepositByShopId = cashDepositsService.GetNeedPayCashDepositByShopId(item.ShopId); return(new { Id = item.Id, ShopName = item.ChemCloud_Shops.ShopName, Type = (needPayCashDepositByShopId > new decimal(0) ? "欠费" : "正常"), TotalBalance = item.TotalBalance, CurrentBalance = item.CurrentBalance, Date = item.Date.ToString("yyyy-MM-dd HH:mm"), NeedPay = needPayCashDepositByShopId, EnableLabels = item.EnableLabels }); }); return(Json(new { rows = collection, total = cashDeposits.Total })); }
public LimitTimeBuyController( ILimitTimeBuyService iLimitTimeBuyService, ISlideAdsService iSlideAdsService, IShopService iShopService, IProductService iProductService, IProductDescriptionTemplateService iProductDescriptionTemplateService, IShopCategoryService iShopCategoryService, ICommentService iCommentService, IConsultationService iConsultationService, ICouponService iCouponService, ICashDepositsService iCashDepositsService, ITypeService iTypeService ) { _iLimitTimeBuyService = iLimitTimeBuyService; _iSlideAdsService = iSlideAdsService; _iShopService = iShopService; _iProductService = iProductService; _iProductDescriptionTemplateService = iProductDescriptionTemplateService; _iShopCategoryService = iShopCategoryService; _iCommentService = iCommentService; _iConsultationService = iConsultationService; _iCouponService = iCouponService; _iCashDepositsService = iCashDepositsService; _iTypeService = iTypeService; }
public PayController(IOrderService iOrderService, ICashDepositsService iCashDepositsService, IMemberCapitalService iMemberCapitalService , IRefundService iRefundService, IShopService iShopService, IFightGroupService iFightGroupService) { _iOrderService = iOrderService; _iCashDepositsService = iCashDepositsService; _iMemberCapitalService = iMemberCapitalService; _iRefundService = iRefundService; _iShopService = iShopService; _iFightGroupService = iFightGroupService; }
public PortfolioBuyController(IShopService iShopService, IVShopService iVShopService, IProductService iProductService, ICashDepositsService iCashDepositsService, IFreightTemplateService iFreightTemplateService, IRegionService iRegionService ) { _iShopService = iShopService; _iVShopService = iVShopService; _iProductService = iProductService; _iCashDepositsService = iCashDepositsService; _iFreightTemplateService = iFreightTemplateService; _iRegionService = iRegionService; }
public ActionResult Return(string id, decimal balance) { id = DecodePaymentId(id); string empty = string.Empty; try { Plugin <IPaymentPlugin> plugin = PluginsManagement.GetPlugin <IPaymentPlugin>(id); PaymentInfo paymentInfo = plugin.Biz.ProcessReturn(base.HttpContext.Request); ICashDepositsService cashDepositsService = ServiceHelper.Create <ICashDepositsService>(); CashDepositDetailInfo cashDepositDetailInfo = new CashDepositDetailInfo(); if ((Cache.Get(CacheKeyCollection.PaymentState(string.Join <long>(",", paymentInfo.OrderIds))) == null ? true : false)) { cashDepositDetailInfo.AddDate = DateTime.Now; cashDepositDetailInfo.Balance = balance; cashDepositDetailInfo.Description = "保证金充值"; cashDepositDetailInfo.Operator = base.CurrentSellerManager.UserName; List <CashDepositDetailInfo> cashDepositDetailInfos = new List <CashDepositDetailInfo>() { cashDepositDetailInfo }; if (cashDepositsService.GetCashDepositByShopId(base.CurrentSellerManager.ShopId) != null) { cashDepositDetailInfo.CashDepositId = cashDepositsService.GetCashDepositByShopId(base.CurrentSellerManager.ShopId).Id; ServiceHelper.Create <ICashDepositsService>().AddCashDepositDetails(cashDepositDetailInfo); } else { CashDepositInfo cashDepositInfo = new CashDepositInfo() { CurrentBalance = balance, Date = DateTime.Now, ShopId = base.CurrentSellerManager.ShopId, TotalBalance = balance, EnableLabels = true, Himall_CashDepositDetail = cashDepositDetailInfos }; cashDepositsService.AddCashDeposit(cashDepositInfo); } string str = CacheKeyCollection.PaymentState(string.Join <long>(",", paymentInfo.OrderIds)); Cache.Insert(str, true); } } catch (Exception exception) { empty = exception.Message; } ViewBag.Error = empty; ViewBag.Logo = ServiceHelper.Create <ISiteSettingService>().GetSiteSettings().Logo; return(View()); }
public PayController(IOrderService iOrderService, ICashDepositsService iCashDepositsService, IMemberCapitalService iMemberCapitalService , IRefundService iRefundService, IShopService iShopService, IFightGroupService iFightGroupService, IHttpContextAccessor httpContextAccessor, IWebHostEnvironment environment ) { _iOrderService = iOrderService; _iCashDepositsService = iCashDepositsService; _iMemberCapitalService = iMemberCapitalService; _iRefundService = iRefundService; _iShopService = iShopService; _iFightGroupService = iFightGroupService; _httpContextAccessor = httpContextAccessor; _hostingEnvironment = environment; }
public JsonResult WeiXinPayReturn(decimal balance) { Result result = new Result(); try { ICashDepositsService cashDepositsService = ServiceHelper.Create <ICashDepositsService>(); CashDepositDetailInfo cashDepositDetailInfo = new CashDepositDetailInfo(); cashDepositDetailInfo.AddDate = DateTime.Now; cashDepositDetailInfo.Balance = balance; cashDepositDetailInfo.Description = "保证金充值"; cashDepositDetailInfo.Operator = base.CurrentSellerManager.UserName; List <CashDepositDetailInfo> cashDepositDetailInfos = new List <CashDepositDetailInfo>() { cashDepositDetailInfo }; if (cashDepositsService.GetCashDepositByShopId(base.CurrentSellerManager.ShopId) != null) { cashDepositDetailInfo.CashDepositId = cashDepositsService.GetCashDepositByShopId(base.CurrentSellerManager.ShopId).Id; ServiceHelper.Create <ICashDepositsService>().AddCashDepositDetails(cashDepositDetailInfo); } else { CashDepositInfo cashDepositInfo = new CashDepositInfo() { CurrentBalance = balance, Date = DateTime.Now, ShopId = base.CurrentSellerManager.ShopId, TotalBalance = balance, EnableLabels = true, Himall_CashDepositDetail = cashDepositDetailInfos }; cashDepositsService.AddCashDeposit(cashDepositInfo); } result.success = false; } catch (Exception exception) { result.msg = exception.Message; } return(Json(result)); }
public BranchOrderController() { _iOrderService = new OrderService(); _iCartService = new CartService(); _iMemberService = new MemberService(); _iProductService = new ProductService(); _iPaymentConfigService = new PaymentConfigService(); _iCashDepositsService = new CashDepositsService(); _iShopService = ServiceProvider.Instance<IShopService>.Create; _iLimitTimeBuyService = new LimitTimeBuyService(); _iCouponService = new CouponService(); _iShopBonusService = new ShopBonusService(); _iCollocationService = new CollocationService(); _iMemberCapitalService = new MemberCapitalService(); _iShippingAddressService = new ShippingAddressService(); _iMemberIntegralService = new MemberIntegralService(); _iRegionService = new RegionService(); _iVShopService = new VShopService(); _iRefundService = new RefundService(); _iFightGroupService = new FightGroupService(); }
public BranchOrderController() { this._iOrderService = (IOrderService) new OrderService(); this._iCartService = (ICartService) new CartService(); this._iMemberService = (IMemberService) new MemberService(); this._iProductService = (IProductService) new ProductService(); this._iPaymentConfigService = (IPaymentConfigService) new PaymentConfigService(); this._iCashDepositsService = (ICashDepositsService) new CashDepositsService(); this._iSiteSettingService = (ISiteSettingService) new SiteSettingService(); this._iShopService = (IShopService) new ShopService(); this._iLimitTimeBuyService = (ILimitTimeBuyService) new LimitTimeBuyService(); this._iCouponService = (ICouponService) new CouponService(); this._iShopBonusService = (IShopBonusService) new ShopBonusService(); this._iCollocationService = (ICollocationService) new CollocationService(); this._iMemberCapitalService = (IMemberCapitalService) new MemberCapitalService(); this._iShippingAddressService = (IShippingAddressService) new ShippingAddressService(); this._iMemberIntegralService = (IMemberIntegralService) new MemberIntegralService(); this._iRegionService = (IRegionService) new RegionService(); this._iVShopService = (IVShopService) new VShopService(); this._iRefundService = (IRefundService) new RefundService(); this._iFightGroupService = (IFightGroupService) new FightGroupService(); }
public ActionResult Index(string orderDate, string keywords, string orderids, DateTime?startDateTime, DateTime?endDateTime, int?orderStatus, int pageNo = 1, int pageSize = 10) { OrderInfo.OrderOperateStatus?nullable; ViewBag.Grant = (object)null; if (!string.IsNullOrEmpty(orderids) && orderids.IndexOf(',') <= 0) { ViewBag.Grant = ServiceHelper.Create <IShopBonusService>().GetByOrderId(long.Parse(orderids)); } DateTime?nullable1 = startDateTime; DateTime?nullable2 = endDateTime; if (!string.IsNullOrEmpty(orderDate) && orderDate.ToLower() != "all") { string lower = orderDate.ToLower(); string str = lower; if (lower != null) { if (str == "threemonth") { nullable1 = new DateTime?(DateTime.Now.AddMonths(-3)); } else if (str == "halfyear") { nullable1 = new DateTime?(DateTime.Now.AddMonths(-6)); } else if (str == "year") { nullable1 = new DateTime?(DateTime.Now.AddYears(-1)); } else if (str == "yearago") { nullable2 = new DateTime?(DateTime.Now.AddYears(-1)); } } } if (orderStatus.HasValue) { int?nullable3 = orderStatus; if ((nullable3.GetValueOrDefault() != 0 ? false : nullable3.HasValue)) { orderStatus = null; } } OrderQuery orderQuery = new OrderQuery() { StartDate = nullable1, EndDate = nullable2 }; OrderQuery orderQuery1 = orderQuery; int? nullable4 = orderStatus; if (nullable4.HasValue) { nullable = new OrderInfo.OrderOperateStatus?((OrderInfo.OrderOperateStatus)nullable4.GetValueOrDefault()); } else { nullable = null; } orderQuery1.Status = nullable; orderQuery.UserId = new long?(base.CurrentUser.Id); orderQuery.SearchKeyWords = keywords; orderQuery.PageSize = pageSize; orderQuery.PageNo = pageNo; PageModel <OrderInfo> orders = ServiceHelper.Create <IOrderService>().GetOrders <OrderInfo>(orderQuery, null); PagingInfo pagingInfo = new PagingInfo() { CurrentPage = pageNo, ItemsPerPage = pageSize, TotalItems = orders.Total }; ViewBag.pageInfo = pagingInfo; ViewBag.UserId = base.CurrentUser.Id; SiteSettingsInfo siteSettings = ServiceHelper.Create <ISiteSettingService>().GetSiteSettings(); IShopBonusService shopBonusService = ServiceHelper.Create <IShopBonusService>(); ViewBag.SalesRefundTimeout = siteSettings.SalesReturnTimeout; List <OrderInfo> list = orders.Models.ToList(); ICashDepositsService create = Instance <ICashDepositsService> .Create; IEnumerable <OrderListModel> orderListModel = from item in list select new OrderListModel() { Id = item.Id, ActiveType = item.ActiveType, OrderType = item.OrderType, Address = item.Address, CellPhone = item.CellPhone, CloseReason = item.CloseReason, CommisTotalAmount = item.CommisAmount, DiscountAmount = item.DiscountAmount, ExpressCompanyName = item.ExpressCompanyName, FinishDate = item.FinishDate, Freight = item.Freight, GatewayOrderId = item.GatewayOrderId, IntegralDiscount = item.IntegralDiscount, UserId = item.UserId, ShopId = item.ShopId, ShopName = item.ShopName, ShipTo = item.ShipTo, OrderTotalAmount = item.OrderTotalAmount, PaymentTypeName = item.PaymentTypeName, OrderStatus = item.OrderStatus, RefundStats = item.RefundStats, OrderCommentInfo = item.OrderCommentInfo, OrderDate = item.OrderDate, OrderItemList = from oItem in item.OrderItemInfo select new OrderItemListModel() { ProductId = oItem.ProductId, Color = oItem.Color, Size = oItem.Size, Version = oItem.Version, ProductName = oItem.ProductName, ThumbnailsUrl = oItem.ThumbnailsUrl, SalePrice = oItem.SalePrice, SkuId = oItem.SkuId, Quantity = oItem.Quantity, CashDepositsObligation = create.GetCashDepositsObligation(oItem.ProductId) }, ReceiveBonus = shopBonusService.GetGrantByUserOrder(item.Id, CurrentUser.Id) }; List <long> nums = ( from d in list select d.Id).ToList(); if (nums.Count > 0) { RefundQuery refundQuery = new RefundQuery() { OrderId = new long?(nums[0]), MoreOrderId = nums, PageNo = 1, PageSize = list.Count }; List <OrderRefundInfo> orderRefundInfos = ( from d in ServiceHelper.Create <IRefundService>().GetOrderRefunds(refundQuery).Models where (int)d.RefundMode == 1 select d).ToList(); if (orderRefundInfos.Count > 0) { foreach (OrderRefundInfo orderRefundInfo in orderRefundInfos) { OrderInfo orderInfo = list.FirstOrDefault((OrderInfo d) => d.Id == orderRefundInfo.OrderId); if (orderInfo == null) { continue; } orderInfo.RefundStats = (int)(orderRefundInfo.SellerAuditStatus); } } } return(View(orderListModel.ToList())); }
public ContentResult CashPayNotify_Post(string id, string str) { char[] chrArray = new char[] { '-' }; decimal num = decimal.Parse(str.Split(chrArray)[0]); char[] chrArray1 = new char[] { '-' }; string str1 = str.Split(chrArray1)[1]; char[] chrArray2 = new char[] { '-' }; long num1 = long.Parse(str.Split(chrArray2)[2]); id = DecodePaymentId(id); string empty = string.Empty; string empty1 = string.Empty; try { Plugin <IPaymentPlugin> plugin = PluginsManagement.GetPlugin <IPaymentPlugin>(id); PaymentInfo paymentInfo = plugin.Biz.ProcessReturn(base.HttpContext.Request); if ((Cache.Get(CacheKeyCollection.PaymentState(string.Join <long>(",", paymentInfo.OrderIds))) == null ? true : false)) { ICashDepositsService cashDepositsService = ServiceHelper.Create <ICashDepositsService>(); CashDepositDetailInfo cashDepositDetailInfo = new CashDepositDetailInfo() { AddDate = DateTime.Now, Balance = num, Description = "保证金充值", Operator = str1 }; List <CashDepositDetailInfo> cashDepositDetailInfos = new List <CashDepositDetailInfo>() { cashDepositDetailInfo }; if (cashDepositsService.GetCashDepositByShopId(num1) != null) { cashDepositDetailInfo.CashDepositId = cashDepositsService.GetCashDepositByShopId(num1).Id; ServiceHelper.Create <ICashDepositsService>().AddCashDepositDetails(cashDepositDetailInfo); } else { CashDepositInfo cashDepositInfo = new CashDepositInfo() { CurrentBalance = num, Date = DateTime.Now, ShopId = num1, TotalBalance = num, EnableLabels = true, Himall_CashDepositDetail = cashDepositDetailInfos }; cashDepositsService.AddCashDeposit(cashDepositInfo); } empty1 = plugin.Biz.ConfirmPayResult(); string str2 = CacheKeyCollection.PaymentState(string.Join <long>(",", paymentInfo.OrderIds)); Cache.Insert(str2, true); } } catch (Exception exception) { string message = exception.Message; } return(base.Content(empty1)); }
public CashDepositController(ICashDepositsService iCashDepositsService) { this._iCashDepositsService = iCashDepositsService; }
public CashDepositController(ICashDepositsService iCashDepositsService, ISiteSettingService iSiteSettingService) { this._iCashDepositsService = iCashDepositsService; _iSiteSettingService = iSiteSettingService; }
public ActionResult Index(string orderDate, string keywords, string orderids, DateTime?startDateTime, DateTime?endDateTime, int?orderStatus, int pageNo = 1, int pageSize = 10, string casno = "") { OrderInfo.OrderOperateStatus?nullable; DateTime?nullable1 = startDateTime; DateTime?nullable2 = endDateTime; if (!string.IsNullOrEmpty(orderDate) && orderDate.ToLower() != "all") { string lower = orderDate.ToLower(); string str = lower; if (lower != null) { if (str == "threemonth") { nullable1 = new DateTime?(DateTime.Now.AddMonths(-3)); } else if (str == "halfyear") { nullable1 = new DateTime?(DateTime.Now.AddMonths(-6)); } else if (str == "year") { nullable1 = new DateTime?(DateTime.Now.AddYears(-1)); } else if (str == "yearago") { nullable2 = new DateTime?(DateTime.Now.AddYears(-1)); } } } if (orderStatus.HasValue) { int?nullable3 = orderStatus; if ((nullable3.GetValueOrDefault() != 0 ? false : nullable3.HasValue)) { orderStatus = null; } } OrderQuery orderQuery = new OrderQuery() { StartDate = nullable1, EndDate = nullable2 }; OrderQuery orderQuery1 = orderQuery; int? nullable4 = orderStatus; if (nullable4.HasValue) { nullable = new OrderInfo.OrderOperateStatus?((OrderInfo.OrderOperateStatus)nullable4.GetValueOrDefault()); } else { nullable = null; } orderQuery1.Status = nullable; orderQuery.UserId = new long?(base.CurrentUser.Id); orderQuery.SearchKeyWords = keywords; orderQuery.PageSize = pageSize; orderQuery.PageNo = pageNo; orderQuery.CASNo = casno; PageModel <OrderInfo> orders = ServiceHelper.Create <IOrderService>().GetOrders <OrderInfo>(orderQuery, null); PagingInfo pagingInfo = new PagingInfo() { CurrentPage = pageNo, ItemsPerPage = pageSize, TotalItems = orders.Total }; ViewBag.pageInfo = pagingInfo; ViewBag.UserId = base.CurrentUser.Id; List <OrderInfo> list = orders.Models.ToList(); ICashDepositsService create = Instance <ICashDepositsService> .Create; IEnumerable <OrderListModel> orderListModel = from item in list select new OrderListModel() { IsBehalfShip = item.IsBehalfShip, BehalfShipNumber = item.BehalfShipNumber, BehalfShipType = item.BehalfShipType, Id = item.Id, ActiveType = item.ActiveType, OrderType = item.OrderType, Address = item.Address, CellPhone = item.CellPhone, CloseReason = item.CloseReason, CommisTotalAmount = item.CommisAmount, DiscountAmount = item.DiscountAmount, ExpressCompanyName = item.ExpressCompanyName, FinishDate = item.FinishDate, Freight = item.Freight, GatewayOrderId = item.GatewayOrderId, IntegralDiscount = item.IntegralDiscount, UserId = item.UserId, UserName = item.UserName, ShopId = item.ShopId, ShopName = item.ShopName, ShipTo = item.ShipTo, CoinType = item.CoinType, CoinTypeName = item.CoinTypeName, OrderTotalAmount = item.OrderTotalAmount, PaymentTypeName = item.PaymentTypeName, OrderStatus = item.OrderStatus, RefundStats = item.RefundStats, OrderCommentInfo = item.OrderCommentInfo, OrderDate = item.OrderDate, OrderItemList = from oItem in item.OrderItemInfo select new OrderItemListModel() { ProductId = oItem.ProductId, ProductName = oItem.ProductName, CASNo = ServiceHelper.Create <IProductService>().GetProduct(oItem.ProductId) == null ? "" : ServiceHelper.Create <IProductService>().GetProduct(oItem.ProductId).CASNo, SalePrice = oItem.SalePrice, Quantity = oItem.Quantity, Pub_CID = ServiceHelper.Create <IProductService>().GetProduct(oItem.ProductId) == null ? 0 : ServiceHelper.Create <IProductService>().GetProduct(oItem.ProductId).Pub_CID, PackingUnit = oItem.PackingUnit, Purity = oItem.Purity } }; List <long> nums = ( from d in list select d.Id).ToList(); if (nums.Count > 0) { RefundQuery refundQuery = new RefundQuery() { OrderId = new long?(nums[0]), MoreOrderId = nums, PageNo = 1, PageSize = list.Count }; List <OrderRefundInfo> orderRefundInfos = ( from d in ServiceHelper.Create <IRefundService>().GetOrderRefunds(refundQuery).Models where (int)d.RefundMode == 1 select d).ToList(); if (orderRefundInfos.Count > 0) { foreach (OrderRefundInfo orderRefundInfo in orderRefundInfos) { OrderInfo orderInfo = list.FirstOrDefault((OrderInfo d) => d.Id == orderRefundInfo.OrderId); if (orderInfo == null) { continue; } orderInfo.RefundStats = (int)(orderRefundInfo.SellerAuditStatus); } } } decimal totalamount = 0; if (orderListModel != null) { foreach (var item in orderListModel) { totalamount += item.OrderTotalAmount; } } ViewBag.totalamount = totalamount.ToString("F2"); return(View(orderListModel.ToList())); }
public CashDepositController(ICashDepositsService iCashDepositsService , IHttpContextAccessor httpContextAccessor) { this._iCashDepositsService = iCashDepositsService; _httpContextAccessor = httpContextAccessor; }