public JsonResult Auditing(long Id, int status, string comment = "")
        {
            //更新实地认证状态
            ServiceHelper.Create <ICertification>().UpdateStatus(Id, (FieldCertification.CertificationStatus)status, DateTime.Now, comment);

            IOperationLogService operationLogService = ServiceHelper.Create <IOperationLogService>();
            LogInfo logInfo = new LogInfo()
            {
                Date        = DateTime.Now,
                Description = string.Format("实地认证审核页面,供应商Id={0},状态为:{1}, 说明是:{2}", Id, (FieldCertification.CertificationStatus)status, comment),
                IPAddress   = base.Request.UserHostAddress,
                PageUrl     = string.Concat("/FieldCertification/Auditing/", Id),
                UserName    = base.CurrentManager.UserName,
                Id          = 0
            };

            operationLogService.AddPlatformOperationLog(logInfo);
            ManagerInfo Info = ServiceHelper.Create <ICertification>().GetManager(Id);

            if (Info != null)
            {
                UserMemberInfo userInfo = ServiceHelper.Create <IMemberService>().GetMemberByName(Info.UserName);
                //ServiceHelper.Create<ISiteMessagesService>().SendCertificationResultMessage(userInfo.Id, base.CurrentManager.UserName);
            }
            //更新供应商认证状态
            ServiceHelper.Create <IShopService>().UpdateShopGrade(Info.ShopId, (FieldCertification.CertificationStatus)status);
            return(Json(new { Successful = true }));
        }
Example #2
0
        public JsonResult DeleteType(long Id)
        {
            Result result = new Result();

            try
            {
                ServiceHelper.Create <ITypeService>().DeleteType(Id);
                IOperationLogService operationLogService = ServiceHelper.Create <IOperationLogService>();
                LogInfo logInfo = new LogInfo()
                {
                    Date        = DateTime.Now,
                    Description = string.Concat("删除平台类目,Id=", Id),
                    IPAddress   = base.Request.UserHostAddress,
                    PageUrl     = "/ProductType/DeleteTyp",
                    UserName    = base.CurrentManager.UserName,
                    ShopId      = 0
                };
                operationLogService.AddPlatformOperationLog(logInfo);
                result.success = true;
            }
            catch (HimallException himallException)
            {
                result.msg = himallException.Message;
            }
            catch (Exception exception)
            {
                Log.Error("删除平台类目失败", exception);
                result.msg = "删除平台类目失败";
            }
            return(Json(result));
        }
        public JsonResult BatchDeleteCategory(string Ids)
        {
            int num;

            string[] strArrays = Ids.Split(new char[] { '|' });
            for (int i = 0; i < strArrays.Length; i++)
            {
                string str = strArrays[i];
                if (!string.IsNullOrWhiteSpace(str) && int.TryParse(str, out num))
                {
                    ServiceHelper.Create <ICategoryService>().DeleteCategory(num);
                    IOperationLogService operationLogService = ServiceHelper.Create <IOperationLogService>();
                    LogInfo logInfo = new LogInfo()
                    {
                        Date        = DateTime.Now,
                        Description = string.Concat("删除平台分类,Id=", num),
                        IPAddress   = base.Request.UserHostAddress,
                        PageUrl     = string.Concat("/Category/BatchDeleteCategory/", num),
                        UserName    = base.CurrentManager.UserName,
                        ShopId      = 0
                    };
                    operationLogService.AddPlatformOperationLog(logInfo);
                }
            }
            return(Json(new { Successful = true }, JsonRequestBehavior.AllowGet));
        }
Example #4
0
        public JsonResult Auditing(long shopId, int status, string comment = "")
        {
            ServiceHelper.Create <IShopService>().UpdateShopStatus(shopId, (ShopInfo.ShopAuditStatus)status, comment);
            IOperationLogService operationLogService = ServiceHelper.Create <IOperationLogService>();
            LogInfo logInfo = new LogInfo()
            {
                Date        = DateTime.Now,
                Description = string.Format("开店审核页面,店铺Id={0},状态为:{1}, 说明是:{2}", shopId, (ShopInfo.ShopAuditStatus)status, comment),
                IPAddress   = base.Request.UserHostAddress,
                PageUrl     = string.Concat("/Shop/Auditing/", shopId),
                UserName    = base.CurrentManager.UserName,
                ShopId      = 0
            };

            operationLogService.AddPlatformOperationLog(logInfo);
            return(Json(new { Successful = true }));
        }
Example #5
0
        public JsonResult DeleteShop(long Id)
        {
            ServiceHelper.Create <IShopService>().DeleteShop(Id);
            IOperationLogService operationLogService = ServiceHelper.Create <IOperationLogService>();
            LogInfo logInfo = new LogInfo()
            {
                Date        = DateTime.Now,
                Description = string.Concat("删除店铺,Id=", Id),
                IPAddress   = base.Request.UserHostAddress,
                PageUrl     = string.Concat("/Shop/Edit/", Id),
                UserName    = base.CurrentManager.UserName,
                ShopId      = 0
            };

            operationLogService.AddPlatformOperationLog(logInfo);
            return(Json(new { Successful = true }));
        }
        public JsonResult DeleteCategoryById(long id)
        {
            ServiceHelper.Create <ICategoryService>().DeleteCategory(id);
            IOperationLogService operationLogService = ServiceHelper.Create <IOperationLogService>();
            LogInfo logInfo = new LogInfo()
            {
                Date        = DateTime.Now,
                Description = string.Concat("删除平台分类,Id=", id),
                IPAddress   = base.Request.UserHostAddress,
                PageUrl     = string.Concat("/Category/DeleteCategoryById/", id),
                UserName    = base.CurrentManager.UserName,
                ShopId      = 0
            };

            operationLogService.AddPlatformOperationLog(logInfo);
            return(Json(new { Successful = true }, JsonRequestBehavior.AllowGet));
        }
        public JsonResult Receing(long Id, int status, string comment = "")
        {
            /*状态*/
            ServiceHelper.Create <ICertification>().UpdateStatus(Id, (FieldCertification.CertificationStatus)status, DateTime.Now, comment);

            /*日志*/
            IOperationLogService operationLogService = ServiceHelper.Create <IOperationLogService>();
            LogInfo logInfo = new LogInfo()
            {
                Date        = DateTime.Now,
                Description = string.Format("实地认证接收页面,供应商Id={0},状态为:{1}, 说明是:{2}", Id, (FieldCertification.CertificationStatus)status, comment),
                IPAddress   = base.Request.UserHostAddress,
                PageUrl     = string.Concat("/FieldCertification/Receing/", Id),
                UserName    = base.CurrentManager.UserName,
                Id          = 0
            };

            operationLogService.AddPlatformOperationLog(logInfo);

            return(Json(new { Successful = true }));
        }
Example #8
0
        public JsonResult SaveBusinessCategory(long shopId = 0L, string bcategory = "")
        {
            Dictionary <long, decimal> nums = new Dictionary <long, decimal>();

            string[] strArrays = bcategory.Split(new char[] { ',' });
            for (int i = 0; i < strArrays.Length; i++)
            {
                string str = strArrays[i];
                if (!string.IsNullOrWhiteSpace(str))
                {
                    char[] chrArray = new char[] { '|' };
                    if (!nums.ContainsKey(int.Parse(str.Split(chrArray)[0])))
                    {
                        char[] chrArray1 = new char[] { '|' };
                        long   num       = int.Parse(str.Split(chrArray1)[0]);
                        char[] chrArray2 = new char[] { '|' };
                        nums.Add(num, decimal.Parse(str.Split(chrArray2)[1]));
                    }
                }
            }
            ServiceHelper.Create <IShopService>().SaveBusinessCategory(shopId, nums);
            IOperationLogService operationLogService = ServiceHelper.Create <IOperationLogService>();
            LogInfo logInfo = new LogInfo()
            {
                Date        = DateTime.Now,
                Description = string.Concat("修改店铺经营类目,店铺Id=", shopId),
                IPAddress   = base.Request.UserHostAddress
            };

            object[] objArray = new object[] { "/Shop/SaveBusinessCategory?shopId=", shopId, "&bcategory=", bcategory };
            logInfo.PageUrl  = string.Concat(objArray);
            logInfo.UserName = base.CurrentManager.UserName;
            logInfo.ShopId   = 0;
            operationLogService.AddPlatformOperationLog(logInfo);
            return(Json(new { Successful = true }));
        }
 public ActionResult Edit(CategoryModel category)
 {
     if (base.ModelState.IsValid)
     {
         ICategoryService categoryService = ServiceHelper.Create <ICategoryService>();
         ProcessingIcon(category, categoryService);
         categoryService.UpdateCategory(category);
         IOperationLogService operationLogService = ServiceHelper.Create <IOperationLogService>();
         LogInfo logInfo = new LogInfo()
         {
             Date        = DateTime.Now,
             Description = string.Concat("修改平台分类,Id=", category.Id),
             IPAddress   = base.Request.UserHostAddress,
             PageUrl     = string.Concat("/Category/Edit/", category.Id),
             UserName    = base.CurrentManager.UserName,
             ShopId      = 0
         };
         operationLogService.AddPlatformOperationLog(logInfo);
         return(RedirectToAction("Management"));
     }
     ViewBag.Types = GetTypesList(category.TypeId);
     ViewBag.Depth = category.Depth;
     return(View(category));
 }
Example #10
0
        public ActionResult SaveModel(TypeInfoModel type)
        {
            if (0 != type.Id)
            {
                ServiceHelper.Create <ITypeService>().UpdateType(type);
            }
            else if (0 == type.Id)
            {
                ServiceHelper.Create <ITypeService>().AddType(type);
            }
            IOperationLogService operationLogService = ServiceHelper.Create <IOperationLogService>();
            LogInfo logInfo = new LogInfo()
            {
                Date        = DateTime.Now,
                Description = string.Concat("修改平台类目,Id=", type.Id),
                IPAddress   = base.Request.UserHostAddress,
                PageUrl     = "/ProductType/SaveModel",
                UserName    = base.CurrentManager.UserName,
                ShopId      = 0
            };

            operationLogService.AddPlatformOperationLog(logInfo);
            return(RedirectToAction("Management"));
        }
Example #11
0
 public JsonResult FreezeShop(long id, bool state)
 {
     _iShopService.FreezeShop(id, state);
     Task.Factory.StartNew(() =>
     {
         _iSearchProductService.UpdateSearchStatusByShop(id);
     });
     _iOperationLogService.AddPlatformOperationLog(new Entities.LogInfo
     {
         Date        = DateTime.Now,
         Description = (state ? "冻结" : "解冻") + "店铺信息,Id=" + id,
         IPAddress   = Request.UserHostAddress,
         PageUrl     = "/Shop/FreezeShop/",
         UserName    = CurrentManager.UserName,
         ShopId      = 0
     });
     return(Json(new Result()
     {
         success = true, msg = "操作成功"
     }));
 }
Example #12
0
        public JsonResult Edit(ShopModel shop)
        {
            IShopService shopService = ServiceHelper.Create <IShopService>();
            ShopInfo     companyName = shopService.GetShop(shop.Id, false);

            if (!CheckShopGrade(shop.Id, Convert.ToInt64(shop.ShopGrade)))
            {
                throw new HimallException("该店铺已使用空间数或已添加商品数大于该套餐");
            }
            if (shopService.ExistShop(companyName.ShopName, shop.Id))
            {
                throw new HimallException("该店铺已存在");
            }
            if (!base.ModelState.IsValid)
            {
                List <string> strs = new List <string>();
                foreach (string list in base.ModelState.Keys.ToList())
                {
                    foreach (ModelError modelError in base.ModelState[list].Errors.ToList())
                    {
                        strs.Add(modelError.ErrorMessage);
                    }
                }
                Result result = new Result()
                {
                    success = false,
                    msg     = strs[0].ToString()
                };
                return(Json(result));
            }
            companyName.CompanyName              = shop.CompanyName;
            companyName.CompanyAddress           = shop.CompanyAddress;
            companyName.CompanyPhone             = shop.CompanyPhone;
            companyName.CompanyEmployeeCount     = shop.CompanyEmployeeCount;
            companyName.CompanyRegisteredCapital = shop.CompanyRegisteredCapital;
            companyName.ContactsName             = shop.ContactsName;
            companyName.ContactsEmail            = shop.ContactsEmail;
            companyName.ContactsPhone            = shop.ContactsPhone;
            companyName.BankAccountName          = shop.BankAccountName;
            companyName.BankAccountNumber        = shop.BankAccountNumber;
            companyName.BankCode        = shop.BankCode;
            companyName.BankName        = shop.BankName;
            companyName.BankPhoto       = shop.BankPhoto;
            companyName.ShopName        = shop.Name;
            companyName.GradeId         = Convert.ToInt64(shop.ShopGrade);
            companyName.EndDate         = new DateTime?(Convert.ToDateTime(shop.EndDate));
            companyName.CompanyRegionId = shop.NewCompanyRegionId;
            companyName.BankRegionId    = shop.NewBankRegionId;
            companyName.ShopStatus      = (ShopInfo.ShopAuditStatus)Convert.ToInt32(shop.Status);
            ServiceHelper.Create <IShopService>().UpdateShop(companyName);
            IOperationLogService operationLogService = ServiceHelper.Create <IOperationLogService>();
            LogInfo logInfo = new LogInfo()
            {
                Date        = DateTime.Now,
                Description = string.Concat("修改店铺信息,Id=", shop.Id),
                IPAddress   = base.Request.UserHostAddress,
                PageUrl     = string.Concat("/Shop/Edit/", shop.Id),
                UserName    = base.CurrentManager.UserName,
                ShopId      = 0
            };

            operationLogService.AddPlatformOperationLog(logInfo);
            Result result1 = new Result()
            {
                success = true,
                msg     = "保存成功!"
            };

            return(Json(result1));
        }
 /// <summary>
 /// 增加平台日志信息
 /// </summary>
 /// <param name="info"></param>
 public static void AddPlatformOperationLog(LogInfo info)
 {
     _iOperationLogService.AddPlatformOperationLog(info);
 }
Example #14
0
        public JsonResult ConfirmApply(long id, Himall.Entities.ApplyWithDrawInfo.ApplyWithDrawStatus comfirmStatus, string remark)
        {
            var service = _iMemberCapitalService;
            var status  = comfirmStatus;
            var model   = service.GetApplyWithDrawInfo(id);

            if (status == Himall.Entities.ApplyWithDrawInfo.ApplyWithDrawStatus.Refuse)
            {
                service.RefuseApplyWithDraw(id, status, CurrentManager.UserName, remark);
                //操作日志
                _iOperationLogService.AddPlatformOperationLog(
                    new Entities.LogInfo
                {
                    Date        = DateTime.Now,
                    Description = string.Format("会员提现审核拒绝,会员Id={0},状态为:{1}, 说明是:{2}", model.MemId,
                                                status, remark),
                    IPAddress = Request.UserHostAddress,
                    PageUrl   = "/Admin/Capital/WithDraw",
                    UserName  = CurrentManager.UserName,
                    ShopId    = 0
                });
                return(Json(new Result {
                    success = true, msg = "审核成功!"
                }));
            }
            else
            {
                if (model.ApplyType == CommonModel.UserWithdrawType.ALiPay)
                {
                    #region 支付宝提现
                    if (model.ApplyStatus == Entities.ApplyWithDrawInfo.ApplyWithDrawStatus.PayPending)
                    {
                        return(Json(new Result {
                            success = false, msg = "等待第三方处理中,如有误操作,请先取消后再进行付款操作!"
                        }));
                    }

                    var plugins = PluginsManagement.GetPlugins <IPaymentPlugin>(true).FirstOrDefault(e => e.PluginInfo.PluginId == PLUGIN_PAYMENT_ALIPAY);
                    if (plugins != null)
                    {
                        try
                        {
                            string webRoot = CurrentUrlHelper.CurrentUrlNoPort();
                            //异步通知地址
                            string payNotify = webRoot + "/Pay/EnterpriseNotify/{0}?outid={1}";

                            EnterprisePayPara para = new EnterprisePayPara()
                            {
                                amount       = model.ApplyAmount,
                                check_name   = true,//支付宝验证实名
                                openid       = model.OpenId,
                                re_user_name = model.NickName,
                                out_trade_no = model.ApplyTime.ToString("yyyyMMddHHmmss") + model.Id.ToString(),
                                desc         = "提现",
                                notify_url   = string.Format(payNotify, EncodePaymentId(plugins.PluginInfo.PluginId), model.Id.ToString())
                            };
                            PaymentInfo result = plugins.Biz.EnterprisePay(para);
                            Himall.Entities.ApplyWithDrawInfo info = new Himall.Entities.ApplyWithDrawInfo
                            {
                                PayNo       = result.TradNo,
                                ApplyStatus = Himall.Entities.ApplyWithDrawInfo.ApplyWithDrawStatus.WithDrawSuccess,
                                PayTime     = result.TradeTime.HasValue ? result.TradeTime.Value : DateTime.Now,
                                ConfirmTime = DateTime.Now,
                                OpUser      = CurrentManager.UserName,
                                ApplyAmount = model.ApplyAmount,
                                Id          = model.Id,
                                Remark      = remark
                            };
                            //Log.Debug("提现:" + info.PayNo);
                            service.ConfirmApplyWithDraw(info);

                            //操作日志
                            _iOperationLogService.AddPlatformOperationLog(new Entities.LogInfo
                            {
                                Date        = DateTime.Now,
                                Description = string.Format("会员提现审核成功,会员Id={0},状态为:{1}, 说明是:{2}", model.MemId,
                                                            status, remark),
                                IPAddress = Request.UserHostAddress,
                                PageUrl   = "/Admin/Capital/WithDraw",
                                UserName  = CurrentManager.UserName,
                                ShopId    = 0
                            });
                            //ResponseContentWhenFinished 会回传跳转付款的链接
                            return(Json(new Result {
                                success = true, msg = "审核操作成功", status = 2, data = result.ResponseContentWhenFinished
                            }));
                        }
                        catch (PluginException pex)
                        {
                            //插件异常,直接返回错误信息
                            Log.Error("调用企业付款接口异常:" + pex.Message);
                            //操作日志
                            _iOperationLogService.AddPlatformOperationLog(new Entities.LogInfo
                            {
                                Date        = DateTime.Now,
                                Description = string.Format("会员提现审核失败,会员Id={0},状态为:{1}, 说明是:{2}", model.MemId,
                                                            status, remark),
                                IPAddress = Request.UserHostAddress,
                                PageUrl   = "/Admin/Capital/WithDraw",
                                UserName  = CurrentManager.UserName,
                                ShopId    = 0
                            });
                            return(Json(new Result {
                                success = false, msg = pex.Message
                            }));
                        }
                        catch (Exception ex)
                        {
                            Log.Error("提现审核异常:" + ex.Message);
                            return(Json(new Result {
                                success = false, msg = ex.Message
                            }));
                        }
                    }
                    else
                    {
                        return(Json(new Result {
                            success = false, msg = "未找到支付插件"
                        }));
                    }
                    #endregion
                }
                else
                {
                    #region 微信提现
                    var plugins = PluginsManagement.GetPlugins <IPaymentPlugin>(true).Where(e => e.PluginInfo.PluginId.ToLower().Contains("weixin")).FirstOrDefault();
                    if (plugins != null)
                    {
                        try
                        {
                            EnterprisePayPara para = new EnterprisePayPara()
                            {
                                amount       = model.ApplyAmount,
                                check_name   = false,
                                openid       = model.OpenId,
                                out_trade_no = model.ApplyTime.ToString("yyyyMMddHHmmss") + model.Id.ToString(),
                                desc         = "提现"
                            };
                            PaymentInfo result = plugins.Biz.EnterprisePay(para);
                            Himall.Entities.ApplyWithDrawInfo info = new Himall.Entities.ApplyWithDrawInfo
                            {
                                PayNo       = result.TradNo,
                                ApplyStatus = Himall.Entities.ApplyWithDrawInfo.ApplyWithDrawStatus.WithDrawSuccess,
                                Remark      = remark,
                                PayTime     = result.TradeTime.HasValue ? result.TradeTime.Value : DateTime.Now,
                                ConfirmTime = DateTime.Now,
                                OpUser      = CurrentManager.UserName,
                                ApplyAmount = model.ApplyAmount,
                                Id          = model.Id
                            };
                            //Log.Debug("提现:" + info.PayNo);
                            service.ConfirmApplyWithDraw(info);

                            //操作日志
                            _iOperationLogService.AddPlatformOperationLog(new Entities.LogInfo
                            {
                                Date        = DateTime.Now,
                                Description = string.Format("会员提现审核成功,会员Id={0},状态为:{1}, 说明是:{2}", model.MemId,
                                                            status, remark),
                                IPAddress = Request.UserHostAddress,
                                PageUrl   = "/Admin/Capital/WithDraw",
                                UserName  = CurrentManager.UserName,
                                ShopId    = 0
                            });
                        }
                        catch (PluginException pex)
                        {//插件异常,直接返回错误信息
                            Log.Error("调用企业付款接口异常:" + pex.Message);
                            //操作日志
                            _iOperationLogService.AddPlatformOperationLog(new Entities.LogInfo
                            {
                                Date        = DateTime.Now,
                                Description = string.Format("会员提现审核失败,会员Id={0},状态为:{1}, 说明是:{2}", model.MemId,
                                                            status, remark),
                                IPAddress = Request.UserHostAddress,
                                PageUrl   = "/Admin/Capital/WithDraw",
                                UserName  = CurrentManager.UserName,
                                ShopId    = 0
                            });
                            return(Json(new Result {
                                success = false, msg = pex.Message
                            }));
                        }
                        catch (Exception ex)
                        {
                            Log.Error("提现审核异常:" + ex.Message);
                            Himall.Entities.ApplyWithDrawInfo info = new Himall.Entities.ApplyWithDrawInfo
                            {
                                ApplyStatus = Himall.Entities.ApplyWithDrawInfo.ApplyWithDrawStatus.PayFail,
                                Remark      = remark,
                                ConfirmTime = DateTime.Now,
                                OpUser      = CurrentManager.UserName,
                                ApplyAmount = model.ApplyAmount,
                                Id          = model.Id
                            };
                            service.ConfirmApplyWithDraw(info);

                            //操作日志
                            _iOperationLogService.AddPlatformOperationLog(new Entities.LogInfo
                            {
                                Date        = DateTime.Now,
                                Description = string.Format("会员提现审核失败,会员Id={0},状态为:{1}, 说明是:{2}", model.MemId,
                                                            status, remark),
                                IPAddress = Request.UserHostAddress,
                                PageUrl   = "/Admin/Capital/WithDraw",
                                UserName  = CurrentManager.UserName,
                                ShopId    = 0
                            });

                            return(Json(new Result {
                                success = false, msg = ex.Message
                            }));
                        }
                    }
                    else
                    {
                        return(Json(new Result {
                            success = false, msg = "未找到支付插件"
                        }));
                    }
                    #endregion
                }
            }

            return(Json(new Result {
                success = true, msg = "审核操作成功"
            }));
        }
        /// <summary>
        /// 店铺提现审核
        /// </summary>
        /// <param name="Id">审核ID</param>
        /// <param name="status">审核状态</param>
        /// <param name="Remark">平台备注</param>
        /// <param name="IpAddress">操作IP</param>
        /// <param name="UserName">操作人名称</param>
        /// <returns></returns>
        public static bool ShopApplyWithDraw(long Id, Himall.CommonModel.WithdrawStaus status, string Remark, string IpAddress = "", string UserName = "")
        {
            var model = _iBillingService.GetShopWithDrawInfo(Id);

            if (status == Himall.CommonModel.WithdrawStaus.Refused)//拒绝
            {
                model.Status     = status;
                model.PlatRemark = Remark;
                model.DealTime   = DateTime.Now;
                _iBillingService.UpdateShopWithDraw(model);

                lock (obj)
                {
                    //处理余额
                    var mShopAccountInfo = _iBillingService.GetShopAccount(model.ShopId);
                    mShopAccountInfo.Balance += model.CashAmount;
                    _iBillingService.UpdateShopAccount(mShopAccountInfo);
                }


                //操作日志
                _iOperationLogService.AddPlatformOperationLog(
                    new LogInfo
                {
                    Date        = DateTime.Now,
                    Description = string.Format("店铺提现拒绝,店铺Id={0},状态为:{1}, 说明是:{2}", model.ShopId,
                                                status, Remark),
                    IPAddress = IpAddress,
                    PageUrl   = "/Admin/ShopWithDraw/Management",
                    UserName  = UserName,
                    ShopId    = 0
                });
                return(true);
            }
            else if (model.CashType == Himall.CommonModel.WithdrawType.BankCard)//银行卡
            {
                model.Status     = status;
                model.PlatRemark = Remark;
                model.DealTime   = DateTime.Now;
                _iBillingService.UpdateShopWithDraw(model);
                //资金处理
                updateAccount(model.ShopId, model.CashAmount, Himall.CommonModel.ShopAccountType.WithDraw, DateTime.Now.ToString("yyyyMMddHHmmssffff"), "银行卡提现", Id);


                //操作日志
                _iOperationLogService.AddPlatformOperationLog(
                    new LogInfo
                {
                    Date        = DateTime.Now,
                    Description = string.Format("店铺银行卡提现审核成功,店铺Id={0},状态为:{1}, 说明是:{2}", model.ShopId,
                                                status, Remark),
                    IPAddress = IpAddress,
                    PageUrl   = "/Admin/ShopWithDraw/Management",
                    UserName  = UserName,
                    ShopId    = 0
                });
                return(true);
            }
            else
            {
                var plugins = PluginsManagement.GetPlugins <IPaymentPlugin>(true).Where(e => e.PluginInfo.PluginId.ToLower().Contains("weixin")).FirstOrDefault();
                if (plugins != null)
                {
                    try
                    {
                        var shopModel          = _iShopService.GetShop(model.ShopId);
                        EnterprisePayPara para = new EnterprisePayPara()
                        {
                            amount       = model.CashAmount,
                            check_name   = false,
                            openid       = shopModel.WeiXinOpenId,
                            out_trade_no = model.CashNo.ToString(),
                            desc         = "提现"
                        };
                        PaymentInfo result = plugins.Biz.EnterprisePay(para);

                        model.SerialNo   = result.TradNo;
                        model.DealTime   = DateTime.Now;
                        model.Status     = WithdrawStaus.Succeed;
                        model.PlatRemark = Remark;
                        _iBillingService.UpdateShopWithDraw(model);
                        //资金处理
                        updateAccount(model.ShopId, model.CashAmount, Himall.CommonModel.ShopAccountType.WithDraw, result.TradNo, "微信提现", Id);

                        //操作日志
                        _iOperationLogService.AddPlatformOperationLog(
                            new LogInfo
                        {
                            Date        = DateTime.Now,
                            Description = string.Format("店铺微信提现审核成功,店铺Id={0},状态为:{1}, 说明是:{2}", model.ShopId,
                                                        status, Remark),
                            IPAddress = IpAddress,
                            PageUrl   = "/Admin/ShopWithDraw/Management",
                            UserName  = UserName,
                            ShopId    = 0
                        });

                        return(true);
                    }
                    catch (Exception ex)
                    {
                        Log.Error("调用企业付款接口异常:" + ex.Message);
                        model.Status     = WithdrawStaus.Fail;
                        model.PlatRemark = Remark;
                        model.DealTime   = DateTime.Now;
                        _iBillingService.UpdateShopWithDraw(model);

                        //操作日志
                        _iOperationLogService.AddPlatformOperationLog(
                            new LogInfo
                        {
                            Date        = DateTime.Now,
                            Description = string.Format("店铺微信提现审核失败,店铺Id={0},状态为:{1}, 说明是:{2}", model.ShopId,
                                                        status, Remark),
                            IPAddress = IpAddress,
                            PageUrl   = "/Admin/ShopWithDraw/Management",
                            UserName  = UserName,
                            ShopId    = 0
                        });
                        return(false);
                    }
                }
                else
                {
                    return(false);
                }
            }
        }
        public JsonResult ConfirmApply(long id, ApplyWithDrawInfo.ApplyWithDrawStatus comfirmStatus, string remark)
        {
            var service = _iMemberCapitalService;
            ApplyWithDrawQuery query = new ApplyWithDrawQuery
            {
                withDrawNo = id,
                PageNo     = 1,
                PageSize   = 1
            };
            var status = comfirmStatus;
            var model  = service.GetApplyWithDraw(query).Models.FirstOrDefault();

            if (status == ApplyWithDrawInfo.ApplyWithDrawStatus.Refuse)
            {
                service.RefuseApplyWithDraw(id, status, CurrentManager.UserName, remark);
                //操作日志
                _iOperationLogService.AddPlatformOperationLog(
                    new LogInfo
                {
                    Date        = DateTime.Now,
                    Description = string.Format("会员提现审核拒绝,会员Id={0},状态为:{1}, 说明是:{2}", model.MemId,
                                                status, remark),
                    IPAddress = Request.UserHostAddress,
                    PageUrl   = "/Admin/Capital/WithDraw",
                    UserName  = CurrentManager.UserName,
                    ShopId    = 0
                });
                return(Json(new { success = true, msg = "审核成功!" }));
            }
            else
            {
                var plugins = PluginsManagement.GetPlugins <IPaymentPlugin>(true).Where(e => e.PluginInfo.PluginId.ToLower().Contains("weixin")).FirstOrDefault();
                if (plugins != null)
                {
                    try
                    {
                        EnterprisePayPara para = new EnterprisePayPara()
                        {
                            amount       = model.ApplyAmount,
                            check_name   = false,
                            openid       = model.OpenId,
                            out_trade_no = model.Id.ToString(),
                            desc         = "提现"
                        };
                        PaymentInfo       result = plugins.Biz.EnterprisePay(para);
                        ApplyWithDrawInfo info   = new ApplyWithDrawInfo
                        {
                            PayNo       = result.TradNo,
                            ApplyStatus = ApplyWithDrawInfo.ApplyWithDrawStatus.WithDrawSuccess,
                            Remark      = plugins.PluginInfo.Description,
                            PayTime     = result.TradeTime.HasValue ? result.TradeTime.Value : DateTime.Now,
                            ConfirmTime = DateTime.Now,
                            OpUser      = CurrentManager.UserName,
                            ApplyAmount = model.ApplyAmount,
                            Id          = model.Id
                        };
                        //Log.Debug("提现:" + info.PayNo);
                        service.ConfirmApplyWithDraw(info);

                        //操作日志
                        _iOperationLogService.AddPlatformOperationLog(
                            new LogInfo
                        {
                            Date        = DateTime.Now,
                            Description = string.Format("会员提现审核成功,会员Id={0},状态为:{1}, 说明是:{2}", model.MemId,
                                                        status, remark),
                            IPAddress = Request.UserHostAddress,
                            PageUrl   = "/Admin/Capital/WithDraw",
                            UserName  = CurrentManager.UserName,
                            ShopId    = 0
                        });
                    }
                    catch (PluginException pex)
                    {//插件异常,直接返回错误信息
                        Log.Error("调用企业付款接口异常:" + pex.Message);
                        //操作日志
                        _iOperationLogService.AddPlatformOperationLog(
                            new LogInfo
                        {
                            Date        = DateTime.Now,
                            Description = string.Format("会员提现审核失败,会员Id={0},状态为:{1}, 说明是:{2}", model.MemId,
                                                        status, remark),
                            IPAddress = Request.UserHostAddress,
                            PageUrl   = "/Admin/Capital/WithDraw",
                            UserName  = CurrentManager.UserName,
                            ShopId    = 0
                        });
                        return(Json(new { success = false, msg = pex.Message }));
                    }
                    catch (Exception ex)
                    {
                        Log.Error("提现审核异常:" + ex.Message);
                        ApplyWithDrawInfo info = new ApplyWithDrawInfo
                        {
                            ApplyStatus = ApplyWithDrawInfo.ApplyWithDrawStatus.PayFail,
                            Remark      = plugins.PluginInfo.Description,
                            ConfirmTime = DateTime.Now,
                            OpUser      = CurrentManager.UserName,
                            ApplyAmount = model.ApplyAmount,
                            Id          = model.Id
                        };
                        service.ConfirmApplyWithDraw(info);

                        //操作日志
                        _iOperationLogService.AddPlatformOperationLog(
                            new LogInfo
                        {
                            Date        = DateTime.Now,
                            Description = string.Format("会员提现审核失败,会员Id={0},状态为:{1}, 说明是:{2}", model.MemId,
                                                        status, remark),
                            IPAddress = Request.UserHostAddress,
                            PageUrl   = "/Admin/Capital/WithDraw",
                            UserName  = CurrentManager.UserName,
                            ShopId    = 0
                        });

                        return(Json(new { success = false, msg = "付款接口异常" }));
                    }
                }
                else
                {
                    return(Json(new { success = false, msg = "未找到支付插件" }));
                }
            }

            return(Json(new { success = true, msg = "付款成功" }));
        }