Esempio n. 1
0
        /// <summary>
        /// 分页获取门店已结算订单
        /// </summary>
        /// <param name="page"></param>
        /// <param name="pagesize"></param>
        /// <param name="startDate"></param>
        /// <param name="endDate"></param>
        /// <param name="orderId"></param>
        /// <returns></returns>
        public DataGridModel <DTO.SettledOrders> GetSettlementOrders(int page           = 1, int pagesize = 10,
                                                                     DateTime?startDate = null, DateTime?endDate = null, long?orderId = null, long?WeekSettlementId = null)
        {
            CheckShopManageLogin();
            var  shop   = CurrentShop;
            long shopId = shop.Id;

            var query = new SettlementOrderQuery()
            {
                OrderStart       = startDate,
                OrderEnd         = endDate,
                PageNo           = page,
                PageSize         = pagesize,
                OrderId          = orderId,
                ShopId           = shopId,
                WeekSettlementId = WeekSettlementId
            };
            var model = BillingApplication.GetSettlementOrders(query);
            DataGridModel <DTO.SettledOrders> result = new DataGridModel <DTO.SettledOrders>()
            {
                rows  = model.Models,
                total = model.Total
            };

            return(result);
        }
        /// <summary>
        /// 提现申请数据提交
        /// </summary>
        /// <returns></returns>
        public JsonResult ApplyWithDrawSubmit(string pluginId, string destination, string code, decimal amount, int WithdrawType)
        {
            int result = MemberApplication.CheckCode(pluginId, code, destination, CurrentUser.Id);

            if (result > 0)
            {
                Himall.DTO.ShopWithDraw model = new ShopWithDraw()
                {
                    SellerId         = CurrentUser.Id,
                    SellerName       = CurrentUser.UserName,
                    ShopId           = CurrentSellerManager.ShopId,
                    WithdrawalAmount = amount,
                    WithdrawType     = (Himall.CommonModel.WithdrawType)WithdrawType
                };

                bool isbool = BillingApplication.ShopApplyWithDraw(model);

                if (isbool)
                {
                    return(Json(new { success = true, msg = "成功!" }));
                }
                else
                {
                    return(Json(new { success = false, msg = "余额不足,无法提现!" }));
                }
            }
            else
            {
                return(Json(new { success = false, msg = "验证码错误!" }));
            }
        }
Esempio n. 3
0
        public ActionResult PendingSettlementOrders()
        {
            ViewBag.Payments = PaymentApplication.GetPaymentTypeDesc();
            var model = BillingApplication.GetPlatSettlementCycle();

            return(View(model));
        }
Esempio n. 4
0
        public ContentResult ShopEnterpriseNotify_Post(string id, string outid)
        {
            Log.Info("[SENP]" + Core.Helper.WebHelper.GetRawUrl());
            id = DecodePaymentId(id);
            string errorMsg = string.Empty;
            string response = string.Empty;
            var    _iOperationLogService = ServiceApplication.Create <IOperationLogService>();
            var    withdrawId            = long.Parse(outid);
            var    withdrawData          = BillingApplication.GetShopWithDrawInfo(withdrawId);

            if (withdrawData == null)
            {
                Log.Info("[ShopEnterpriseNotify_Post]" + id + " ^ " + outid);
                throw new HimallException("参数错误");
            }
            try
            {
                var payment = Core.PluginsManagement.GetPlugin <IPaymentPlugin>(id);
                var payInfo = payment.Biz.ProcessEnterprisePayNotify(HttpContext.Request);
                if (withdrawData.Status == Himall.CommonModel.WithdrawStaus.PayPending)
                {
                    BillingApplication.ShopApplyWithDrawCallBack(withdrawId, Himall.CommonModel.WithdrawStaus.Succeed, payInfo, "支付宝提现成功", Request.UserHostAddress, "异步回调");
                }
                response = payment.Biz.ConfirmPayResult();
            }
            catch (Exception ex)
            {
                BillingApplication.ShopApplyWithDrawCallBack(withdrawId, Himall.CommonModel.WithdrawStaus.Fail, null, "支付宝提现失败", Request.UserHostAddress, "异步回调");
                errorMsg = ex.Message;
                Log.Error("ShopEnterpriseNotify_Post", ex);
            }
            return(Content(response));
        }
        public object ApplyWithDraw(ApplayWithDrawParam applay)
        {
            long userId  = UserCookieEncryptHelper.Decrypt(applay.userKey, CookieKeysCollection.USERROLE_SELLERADMIN);
            var  manager = ServiceProvider.Instance <IManagerService> .Create.GetSellerManager(userId);

            var shopinfo = ServiceProvider.Instance <IShopService> .Create.GetShop(manager.ShopId);

            Himall.DTO.ShopWithDraw model = new ShopWithDraw()
            {
                SellerId         = manager.Id,
                SellerName       = manager.UserName,
                ShopId           = shopinfo.Id,
                WithdrawalAmount = applay.amount,
                WithdrawType     = (Himall.CommonModel.WithdrawType)applay.withdrawType
            };

            bool isbool = BillingApplication.ShopApplyWithDraw(model);

            if (isbool)
            {
                return(Json(new { success = true, msg = "成功!" }));
            }
            else
            {
                return(Json(new { success = false, msg = "余额不足,无法提现!" }));
            }
        }
Esempio n. 6
0
        public ActionResult MarketServiceRecordInfo(long Id)
        {
            var shopId = CurrentSellerManager.ShopId;
            var model  = BillingApplication.GetMarketServiceRecord(Id, shopId);

            return(View(model));
        }
Esempio n. 7
0
        public ActionResult CapitalChargeReturn(string id)
        {
            id = DecodePaymentId(id);
            Log.Info("商家充值同步回调key:" + id);
            string error = string.Empty;

            try
            {
                var payment = Core.PluginsManagement.GetPlugin <IPaymentPlugin>(id);
                var payInfo = payment.Biz.ProcessReturn(HttpContext.Request);
                CashDepositDetailInfo model = new CashDepositDetailInfo();
                bool result = Cache.Get(CacheKeyCollection.PaymentState(string.Join(",", payInfo.OrderIds))) == null ? false : true;//记录缓存,不重复处理
                if (!result)
                {
                    long orderIds = payInfo.OrderIds.FirstOrDefault();
                    Log.Info("商家充值同步回调订单号:" + orderIds);
                    BillingApplication.ShopRecharge(orderIds, payInfo.TradNo, id);

                    //写入支付状态缓存
                    string payStateKey = CacheKeyCollection.PaymentState(string.Join(",", payInfo.OrderIds)); //获取支付状态缓存键
                    Cache.Insert(payStateKey, true);                                                          //标记为已支付
                }
            }
            catch (Exception ex)
            {
                Log.Error("商家充值同步回调错误:" + ex.Message);
                error = ex.Message;
            }
            ViewBag.Error = error;
            return(View());
        }
Esempio n. 8
0
        public ActionResult PlatSettlementOrders()
        {
            ViewBag.Payments = PaymentApplication.GetPaymentTypeDesc();
            var model = BillingApplication.GetPlatSettlementStatistics();

            return(View("SettlementOrders", model));
        }
        public JsonResult ChargeSubmit(decimal amount)
        {
            string webRoot = CurrentUrlHelper.CurrentUrlNoPort();
            var    model   = BillingApplication.PaymentList(CurrentSellerManager.ShopId, amount, webRoot);

            return(Json(model.models));
        }
Esempio n. 10
0
        public ContentResult CapitalChargeNotify(string id)
        {
            id = DecodePaymentId(id);
            Log.Info("商家充值异步回调key:" + id);
            string str = string.Empty;

            try
            {
                var payment = Core.PluginsManagement.GetPlugin <IPaymentPlugin>(id);
                var payInfo = payment.Biz.ProcessReturn(HttpContext.Request);
                CashDepositDetailInfo model = new CashDepositDetailInfo();
                string payStateKey          = CacheKeyCollection.PaymentState(string.Join(",", payInfo.OrderIds)); //获取支付状态缓存键
                bool   result = Cache.Get <bool>(payStateKey);                                                     //记录缓存,不重复处理
                if (!result)
                {
                    long orderIds = payInfo.OrderIds.FirstOrDefault();
                    Log.Info("商家充值异步回调订单号:" + orderIds);
                    BillingApplication.ShopRecharge(orderIds, payInfo.TradNo, id);

                    str = payment.Biz.ConfirmPayResult();
                    //写入支付状态缓存
                    Cache.Insert(payStateKey, true);//标记为已支付
                }
            }
            catch (Exception ex)
            {
                Log.Error("商家充值异步回调错误:" + ex.Message);
            }
            return(Content(str));
        }
Esempio n. 11
0
        public ActionResult SettlementOrders(long?shopId, long?detailId = null)
        {
            ViewBag.Payments = PaymentApplication.GetPaymentTypeDesc();
            var model = BillingApplication.GetShopSettlementStatistics(shopId, detailId);

            return(View(model));
        }
Esempio n. 12
0
        /// <summary>
        /// 提现申请数据提交
        /// </summary>
        /// <returns></returns>
        public object ApplyWithDrawSubmit(ApplyWithDrawSubmitPostModel model)
        {
            CheckShopManageLogin();

            if (!CheckCertificate(model.Certificate))
            {
                return(ErrorResult("凭证无效"));
            }

            Himall.DTO.ShopWithDraw info = new ShopWithDraw()
            {
                SellerId         = CurrentUser.Id,
                SellerName       = CurrentUser.UserName,
                ShopId           = CurrentShop.Id,
                WithdrawalAmount = model.Amount,
                WithdrawType     = WithdrawType.BankCard
            };

            if (model.Amount <= 0)
            {
                return(ErrorResult("提现金额不正确"));
            }

            bool isbool = BillingApplication.ShopApplyWithDraw(info);

            if (isbool)
            {
                return(Json(new { success = true, msg = "成功!" }));
            }
            else
            {
                return(Json(new { success = false, msg = "余额不足,无法提现!" }));
            }
        }
        public JsonResult ChargeSubmit(decimal amount)
        {
            string webRoot = Request.Url.Scheme + "://" + HttpContext.Request.Url.Host + (HttpContext.Request.Url.Port == 80 ? "" : (":" + HttpContext.Request.Url.Port.ToString()));
            var    model   = BillingApplication.PaymentList(CurrentSellerManager.ShopId, amount, webRoot);

            return(Json(model.models));
        }
Esempio n. 14
0
        public ActionResult GetTradeChartMonthChart()
        {
            var enddate   = DateTime.Now;
            var startdate = new DateTime(enddate.Year, enddate.Month, 1);
            var data      = BillingApplication.GetTradeChartMonth(startdate, enddate, 0);

            return(Json(new { success = true, chart = data }));
        }
Esempio n. 15
0
        public ActionResult GetThirdtyDaysTradeChart()
        {
            var enddate   = DateTime.Now.Date;
            var startdate = DateTime.Now.AddDays(-29);
            var data      = BillingApplication.GetTradeChart(startdate, enddate, CurrentSellerManager.ShopId);

            return(Json(new { successful = true, chart = data }, JsonRequestBehavior.AllowGet));
        }
Esempio n. 16
0
        // GET: SellerAdmin/Billing
        public ActionResult Index()
        {
            var shopID = CurrentSellerManager.ShopId;
            var model  = BillingApplication.GetShopBillingIndex(shopID);

            ViewBag.IsMainAccount = CurrentSellerManager.IsMainAccount;
            return(View(model));
        }
Esempio n. 17
0
        public ActionResult GetTradeChartMonthChart()
        {
            var enddate   = DateTime.Now;
            var startdate = new DateTime(enddate.Year, enddate.Month, 1);
            var data      = BillingApplication.GetTradeChartMonth(startdate, enddate, CurrentSellerManager.ShopId);

            return(Json(new { successful = true, chart = data }, JsonRequestBehavior.AllowGet));
        }
Esempio n. 18
0
        public ActionResult GetThirdtyDaysTradeChart()
        {
            var enddate   = DateTime.Now;
            var startdate = DateTime.Now.AddDays(-29);
            var data      = BillingApplication.GetTradeChart(startdate, enddate, 0);

            return(Json(new { success = true, chart = data }, JsonRequestBehavior.AllowGet));
        }
Esempio n. 19
0
        public ActionResult GetSevenDaysTradeChart()
        {
            var enddate   = DateTime.Now.Date;
            var startdate = DateTime.Now.AddDays(-6);
            var data      = BillingApplication.GetTradeChart(startdate, enddate, CurrentSellerManager.ShopId);

            return(Json(new { success = true, chart = data }));
        }
Esempio n. 20
0
        /// <summary>
        /// 获取已结算详情
        /// </summary>
        /// <param name="orderId"></param>
        /// <returns></returns>
        public OrderSettlementDetail GetOrderSettlementDetail(long orderId)
        {
            CheckShopManageLogin();
            var  shop   = CurrentShop;
            long shopId = shop.Id;
            var  model  = BillingApplication.GetOrderSettlementDetail(orderId, shopId);

            return(model);
        }
Esempio n. 21
0
        /// <summary>
        /// 获取平台帐户流水
        /// </summary>
        /// <param name="startDate"></param>
        /// <param name="endDate"></param>
        /// <param name="type"></param>
        /// <param name="page"></param>
        /// <param name="rows"></param>
        /// <returns></returns>
        public ActionResult ExportPlatAccountItems(DateTime?startDate, DateTime?endDate, PlatAccountType?type)
        {
            PlatAccountItemQuery query = new PlatAccountItemQuery();

            query.TimeStart       = startDate;
            query.TimeEnd         = endDate;
            query.PlatAccountType = type;
            var models = BillingApplication.GetAllPlatAccountItem(query);

            return(ExcelView("结余明细", models));
        }
Esempio n. 22
0
 public JsonResult ConfirmPay(long id, int status, string remark)
 {
     if (BillingApplication.ShopApplyWithDraw(id, (Himall.CommonModel.WithdrawStaus)status, remark, Request.UserHostAddress, CurrentManager.UserName))
     {
         return(Json(new { success = true, msg = "成功!" }));
     }
     else
     {
         return(Json(new { success = false, msg = "操作失败!" }));
     }
 }
Esempio n. 23
0
        /// <summary>
        /// 获取诊所帐户流水
        /// </summary>
        /// <param name="startDate"></param>
        /// <param name="endDate"></param>
        /// <param name="type"></param>
        /// <returns></returns>
        public ActionResult ExportShopAccountItemlist(DateTime?startDate, DateTime?endDate, ShopAccountType?type)
        {
            ShopAccountItemQuery query = new ShopAccountItemQuery();

            query.TimeStart       = startDate;
            query.TimeEnd         = endDate;
            query.ShopAccountType = type;
            query.ShopId          = CurrentSellerManager.ShopId;
            var models = BillingApplication.GetShopAccountItemNoPage(query);

            return(ExcelView("收支明细", models));
        }
Esempio n. 24
0
        /// <summary>
        /// 导出未结算预约单
        /// </summary>
        /// <param name="startDate"></param>
        /// <param name="endDate"></param>
        /// <param name="orderId"></param>
        /// <param name="fileName"></param>
        /// <returns></returns>
        public ActionResult ExportUnSettlementOrder(DateTime?startDate, DateTime?endDate, long?orderId)
        {
            var query = new PendingSettlementOrderQuery();

            query.OrderStart = startDate;
            query.OrderEnd   = endDate;
            query.OrderId    = orderId;
            query.ShopId     = CurrentSellerManager.ShopId;
            var models = BillingApplication.GetPendingSettlementOrdersNoPage(query);

            return(ExcelView("待结算预约单", models));
        }
Esempio n. 25
0
        public JsonResult PendingSettlementList(StatisticsPendingSettlementQuery query)
        {
            var result = BillingApplication.StatisticsPendingSettlementOrders(query);

            if (result.Models != null)
            {
                foreach (var item in result.Models)
                {
                    item.ShopName = ShopApplication.GetShop(item.ShopId) == null ? item.ShopName : ShopApplication.GetShop(item.ShopId).ShopName;
                }
            }
            return(Json(new { rows = result.Models, result.Total }, true));
        }
Esempio n. 26
0
        public JsonResult ConfirmPay(long id, int status, string remark)
        {
            var result = BillingApplication.ShopApplyWithDraw(id, (Mall.CommonModel.WithdrawStaus)status, remark, Request.HttpContext.Features.Get <IHttpConnectionFeature>()?.RemoteIpAddress.ToString(), CurrentManager.UserName, webRoot: CurrentUrlHelper.CurrentUrlNoPort());

            if (result.Success)
            {
                return(Json(new { success = true, msg = "成功!", jumpurl = result.JumpUrl, status = !string.IsNullOrWhiteSpace(result.JumpUrl) ? 2 : 0 }));
            }
            else
            {
                return(Json(new { success = false, msg = "操作失败,可能微信证书设置错误或者扣款账号余额不足,检查完稍后再试。" }));
            }
        }
Esempio n. 27
0
        public JsonResult GetPlatAccountItemlist(DateTime?startDate, DateTime?endDate, PlatAccountType?type, int page, int rows)
        {
            PlatAccountItemQuery query = new PlatAccountItemQuery();

            query.PageNo          = page;
            query.PageSize        = rows;
            query.TimeStart       = startDate;
            query.TimeEnd         = endDate;
            query.PlatAccountType = type;
            var model  = BillingApplication.GetPlatAccountItem(query);
            var result = new { rows = model.Models, total = model.Total };

            return(Json(result));
        }
Esempio n. 28
0
        public ActionResult ExportPendingSettlementOrders(DateTime?startDate, DateTime?endDate, string shopName, string paymentName, long?orderId, long?shopId)
        {
            var query = new PendingSettlementOrderQuery();

            query.OrderStart  = startDate;
            query.OrderEnd    = endDate;
            query.PaymentName = paymentName;
            query.ShopName    = shopName;
            query.OrderId     = orderId;
            query.ShopId      = shopId;
            var models = BillingApplication.GetAllPendingSettlementOrders(query);

            return(ExcelView("待结算订单", models));
        }
        /// <summary>
        /// 提现信息列表
        /// </summary>
        /// <returns></returns>
        public ActionResult ExportShopWithDraw(DateTime?applyStartTime, DateTime?applyEndTime, DateTime?auditedStartTime, DateTime?auditedEndTime, long?staus)
        {
            var query = new CommonModel.WithdrawQuery()
            {
                ApplyStartTime   = applyStartTime,
                ApplyEndTime     = applyEndTime,
                AuditedStartTime = auditedStartTime,
                AuditedEndTime   = auditedEndTime,
                Status           = (Himall.CommonModel.WithdrawStaus?)staus,
                ShopId           = CurrentSellerManager.ShopId,
            };
            var models = BillingApplication.GetShopWithDrawNoPage(query);

            return(ExcelView("提现明细", models));
        }
Esempio n. 30
0
        /// <summary>
        /// 导出已结算预约单
        /// </summary>
        /// <param name="startDate"></param>
        /// <param name="endDate"></param>
        /// <param name="orderId"></param>
        /// <param name="fileName"></param>
        /// <returns></returns>
        public ActionResult ExportSettlementOrder(DateTime?startDate, DateTime?endDate, DateTime?BillingstartDate, DateTime?BillingendDate, long?orderId, long?detailId)
        {
            var query = new SettlementOrderQuery();

            query.OrderStart       = startDate;
            query.OrderEnd         = endDate;
            query.SettleStart      = BillingstartDate;
            query.SettleEnd        = BillingendDate;
            query.OrderId          = orderId;
            query.ShopId           = CurrentSellerManager.ShopId;
            query.WeekSettlementId = detailId;
            var models = BillingApplication.GetSettlementOrdersNoPage(query);

            return(ExcelView("已结算预约单", models));
        }