예제 #1
0
        public void WithDraw_Add()
        {
            M_UserInfo mu    = buser.GetLogin(false);
            double     money = Convert.ToDouble(Request.Form["Money_T"]);
            double     fee   = SiteConfig.SiteOption.MastMoney > 0 ? (money * (SiteConfig.SiteOption.MastMoney / 100)) : 0;

            if (money < 1)
            {
                function.WriteErrMsg("提现金额错误,不能小于1"); return;
            }
            if (mu.Purse < (money + fee))
            {
                function.WriteErrMsg("你只有[" + mu.Purse.ToString("f2") + "],需[" + (money + fee).ToString("F2") + "]才可提现"); return;
            }
            //生成提现单据
            M_Cash cashMod = new M_Cash();

            cashMod.UserID      = mu.UserID;
            cashMod.money       = money;
            cashMod.WithDrawFee = fee;
            cashMod.YName       = mu.UserName;
            cashMod.Account     = Request.Form["Account_T"];
            cashMod.Bank        = Request.Form["Bank_T"];
            cashMod.PeopleName  = Request.Form["PName_T"];
            //cashMod.Remark = mu.UserName + "发起提现,金额:" + cashMod.money.ToString("f2");
            cashMod.Remark = Request.Form["Remark_T"];
            buser.MinusVMoney(mu.UserID, money, M_UserExpHis.SType.Purse, cashMod.Remark);
            if (cashMod.WithDrawFee > 0)
            {
                buser.MinusVMoney(mu.UserID, cashMod.WithDrawFee, M_UserExpHis.SType.Purse, "提现手续费率" + SiteConfig.SiteOption.MastMoney.ToString("F2") + "%");
            }
            cashBll.insert(cashMod);
            function.WriteSuccessMsg("提现申请成功,请等待管理员审核", "WithDrawLog"); return;
        }
예제 #2
0
    protected void Deposit_RPT_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
        switch (e.CommandName)
        {
        case "Check":
            int        id      = Convert.ToInt32(e.CommandArgument);
            M_Cash     cashMod = cashBll.SelReturnModel(id);
            M_UserInfo mu      = buser.SelReturnModel(cashMod.UserID);
            if (cashMod.yState != (int)ZLEnum.WDState.WaitDeal)
            {
                function.WriteErrMsg("申请单状态异常,特征码:[" + cashMod.yState + "]");
            }
            if (mu.IsNull)
            {
                function.WriteErrMsg("提现用户信息错误");
            }
            cashBll.UpdateState(id.ToString(), ZLEnum.WDState.Dealed);
            if (cashMod.Classes == 1)
            {
                string codeNo = "WD" + DateTime.Now.ToString("yyyyMMddHHmmss") + cashMod.Y_ID;
                //将申请的额度转入余额(银币已在申请时扣除)
                buser.AddMoney(cashMod.UserID, cashMod.money, M_UserExpHis.SType.Purse, "余额提现,单号[" + codeNo + "]");
                //余额提现相当于充值,享受充值包优惠
                B_Shop_MoneyRegular regularBll = new B_Shop_MoneyRegular();
                regularBll.AddMoneyByMin(mu, cashMod.money, ",余额提现,充值包优惠[" + codeNo + "]");
                //存入余额进行分红
                AutoUnit(mu, cashMod.money);
            }

            break;
        }
        MyBind();
    }
        protected void Page_Load(object sender, EventArgs e)
        {
            B_Admin badmin = new B_Admin();
            string  menu   = Request.QueryString["menu"];
            int     pageid = DataConverter.CLng(Request.QueryString["id"]);

            switch (menu)
            {
            case "del":
                if (bc.Del(pageid))
                {
                    Response.Write("<script language=javascript>alert('删除成功!');location.href='CashManage.aspx';</script>");
                }
                else
                {
                    Response.Write("<script language=javascript>alert('删除失败!请选择您要删除的数据');location.href='CCashManage.aspx';</script>");
                }
                break;

            case "stop":
                M_Cash mc = new M_Cash();
                mc.eTime  = DateTime.Now;
                mc.Y_ID   = pageid;
                mc.yState = 1;
                bc.UpdateByID(mc);
                break;
            }
            Call.SetBreadCrumb(Master, "<li><a href='" + CustomerPageAction.customPath2 + "Main.aspx'>工作台</a></li><li><a href='ProductManage.aspx'>商城管理</a></li> <li><a href='DeliverType.aspx'>商城设置</a></li><li>处理VIP卡提现金</li><li><a href='AddCard.aspx'>[ 生成VIP卡 ]</a>&nbsp;&nbsp;&nbsp;<a href='CardTypeManage.aspx'>[ 卡类型管理 ]</a>&nbsp;&nbsp;&nbsp;<a href='Addcardtype.aspx'>[ 添加卡类型 ]</a></li>");
        }
예제 #4
0
    protected void Sure_Btn_Click(object sender, EventArgs e)
    {
        M_UserInfo mu    = buser.GetLogin(false);
        int        money = DataConvert.CLng(Money_T.Text);

        if (BeforeCheck(mu, money))
        {
            //生成提现单据
            M_Cash cashMod = new M_Cash();
            cashMod.UserID     = mu.UserID;
            cashMod.money      = money;
            cashMod.YName      = mu.UserName;
            cashMod.Account    = Account_T.Text;
            cashMod.Bank       = Bank_T.Text;
            cashMod.PeopleName = PName_T.Text;
            //cashMod.Remark = mu.UserName + "发起提现,金额:" + cashMod.money.ToString("f2");
            cashMod.yState  = 0;
            cashMod.Classes = 0;
            cashMod.Remark  = Remark_T.Text;
            buser.MinusVMoney(mu.UserID, money, M_UserExpHis.SType.SIcon, "提现至银行卡");
            cashBll.insert(cashMod);
            function.WriteSuccessMsg("提现申请成功,请等待管理员审核", "WithDrawLog.aspx");
        }
        else
        {
            function.WriteErrMsg("提现申请拒绝");
        }
    }
예제 #5
0
        //确认提现,上传打款凭证等
        protected void Accept_Btn_Click(object sender, EventArgs e)
        {
            M_Cash cashMod = FillCashModel();

            cashMod.yState = (int)ZLEnum.WDState.Dealed;
            cashBll.UpdateByID(cashMod);
            function.Script(this, "parent.diag.CloseModal();parent.location.reload();");
        }
예제 #6
0
        //拒绝提现,金额不返还
        protected void BackDe_B_Click(object sender, EventArgs e)
        {
            M_Cash cashMod = cashBll.SelReturnModel(Convert.ToInt32(backID_Hid.Value));

            cashMod.yState = (int)ZLEnum.WDState.Rejected;
            cashMod.Result = BackDecs_T.Text;
            //double price = Convert.ToDouble(model.Str1);
            //buser.ChangeVirtualMoney(model.UserID, new M_UserExpHis() { UserID = model.UserID, score = (int)(price + (price * 0.1)), ScoreType = (int)M_UserExpHis.SType.Purse, detail = "管理员拒绝提现申请,余额返还" });
            cashBll.UpdateByID(cashMod);
            Response.Redirect(Request.RawUrl);
        }
예제 #7
0
        protected void Pay_Btn_Click(object sender, EventArgs e)
        {
            B_Cash cashBll = new B_Cash();
            double min = 29, multi = 29, max = 0;
            int    count = Unbrealla.LendCountByUser(mu.UserID);

            max = mu.SilverCoin - (count * PlugConfig.Info.Foregift);
            double money = DataConverter.CDouble(Money_T.Text);

            //double fee = SiteConfig.UserConfig.WD_FeePrecent > 0 ? (money * (SiteConfig.UserConfig.WD_FeePrecent / 100)) : 0;
            //string shortPwd = Request.Form["ShortPwd_T"];
            if (money < 1)
            {
                function.WriteErrMsg("提现金额错误,不能小于1"); return;
            }
            if (money < min)
            {
                function.WriteErrMsg("提现金额必须>=[" + min.ToString("F0") + "]"); return;
            }
            if (money > max)
            {
                function.WriteErrMsg("提现金额必须小于[" + max + "]");
                return;
            }
            if ((money % multi) != 0)
            {
                function.WriteErrMsg("提现金额必须是[" + multi + "]的倍数");
                return;
            }
            //if (mu.Purse < (money + fee)) { function.WriteErrMsg("你只有[" + mu.Purse.ToString("f2") + "],需[" + (money + fee).ToString("F2") + "]才可提现"); return; }
            //if (string.IsNullOrEmpty(shortPwd)) { function.WriteErrMsg("未输入支付密码"); return; }
            //if (!mu.PayPassWord.Equals(StringHelper.MD5(shortPwd))) { function.WriteErrMsg("支付密码不正确"); return; }
            //生成提现单据
            M_Cash cashMod = new M_Cash();

            cashMod.UserID      = mu.UserID;
            cashMod.money       = money;
            cashMod.WithDrawFee = 0;
            cashMod.YName       = mu.UserName;

            //cashMod.Account = bankMod.CardNum;
            //cashMod.Bank = Request.Form["Bank_T"];
            cashMod.PeopleName = mu.TrueName;
            cashMod.Remark     = "押金提现";
            buser.MinusVMoney(mu.UserID, money, M_UserExpHis.SType.SIcon, cashMod.Remark);
            //if (cashMod.WithDrawFee > 0)
            //{
            //    buser.MinusVMoney(mu.UserID, cashMod.WithDrawFee, M_UserExpHis.SType.Purse, "提现手续费率" + SiteConfig.SiteOption.MastMoney.ToString("F2") + "%");
            //}
            cashBll.insert(cashMod);
            function.WriteSuccessMsg("押金提现申请成功,请等待管理员审核", "/User/");
        }
예제 #8
0
        private M_Cash FillCashModel()
        {
            M_AdminInfo adminMod = B_Admin.GetLogin();
            M_Cash      cashMod  = cashBll.SelReturnModel(Mid);

            cashMod.Result    = BackDecs_T.Text;
            cashMod.ResultImg = Attach_Hid.Value;
            cashMod.AdminID   = adminMod.AdminId;
            if (cashMod.AdminID < 1)
            {
                throw new Exception("管理员ID不正确");
            }
            return(cashMod);
        }
예제 #9
0
    //拒绝提现
    protected void BackDe_B_Click(object sender, EventArgs e)
    {
        M_Cash cashMod = cashBll.SelReturnModel(Convert.ToInt32(backID_Hid.Value));

        if (cashMod.yState != (int)ZLEnum.WDState.WaitDeal)
        {
            function.WriteErrMsg("申请单状态异常,特征码:[" + cashMod.yState + "]");
        }
        cashMod.yState = (int)ZLEnum.WDState.Rejected;
        cashMod.Result = BackDecs_T.Text;
        //返还银币
        buser.AddMoney(cashMod.UserID, cashMod.money, M_UserExpHis.SType.SIcon, "管理员拒绝提现申请,返还");
        cashBll.UpdateByID(cashMod);
        Response.Redirect(Request.RawUrl);
    }
        public string showuse(string id)
        {
            int    sid = DataConverter.CLng(id);
            string str = "";
            M_Cash tp  = bc.SelReturnModel(sid);

            if (tp.yState == 0)
            {
                str = "<a href=?menu=stop&id=" + sid + ">提交处理</a>";
            }
            else
            {
                str = "<span style='color:red;'>完成操作</span>";
            }
            return(str);
        }
예제 #11
0
        //拒绝提现,返还金额
        protected void Reject_Btn_Click(object sender, EventArgs e)
        {
            M_Cash cashMod = FillCashModel();

            cashMod.yState = (int)ZLEnum.WDState.Rejected;
            cashBll.UpdateByID(cashMod);
            switch (cashMod.Classes)
            {
            case 0:
                buser.AddMoney(cashMod.UserID, (cashMod.money + cashMod.WithDrawFee), M_UserExpHis.SType.SIcon, "拒绝提现,返还预扣押金");
                break;

            case 1:
                buser.AddMoney(cashMod.UserID, (cashMod.money + cashMod.WithDrawFee), M_UserExpHis.SType.Purse, "拒绝提现,返还预扣余额");
                break;

            default:
                throw new Exception("申请单类型不正确");
            }
            function.Script(this, "parent.diag.CloseModal();parent.location.reload();");
        }
예제 #12
0
    protected void ToPurse_Btn_Click(object sender, EventArgs e)
    {
        M_UserInfo mu    = buser.GetLogin(false);
        int        money = DataConvert.CLng(Money_T.Text);

        if (BeforeCheck(mu, money))
        {
            //完成币值转换,并计算分成
            buser.MinusVMoney(mu.UserID, money, M_UserExpHis.SType.SIcon, "提现入余额");
            //buser.AddMoney(mu.UserID, money, M_UserExpHis.SType.Purse, "提现入余额");
            //AutoUnit(mu, money);
            ////生成提现记录,由后台管理员确认后再转入余额
            M_Cash cashMod = new M_Cash();
            cashMod.UserID  = mu.UserID;
            cashMod.money   = money;
            cashMod.YName   = mu.UserName;
            cashMod.Bank    = "余额";
            cashMod.Classes = 1;//余额提现
            cashBll.insert(cashMod);
            function.WriteSuccessMsg("申请成功,请等待管理员审核");
        }
    }
예제 #13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Mid < 1)
                {
                    function.WriteErrMsg("未指定提现申请ID");
                }
                M_Cash cashMod = cashBll.SelReturnModel(Mid);
                if (cashMod == null)
                {
                    function.WriteErrMsg("指定的提现申请不存在");
                }
                M_UserInfo mu = buser.SelReturnModel(cashMod.UserID);
                UName_L.Text     = cashMod.YName;
                Money_L.Text     = cashMod.money.ToString("F2");
                BackDecs_T.Text  = cashMod.Result;
                Attach_Hid.Value = cashMod.ResultImg;
                switch (Action)
                {
                case "dealed":
                    Accept_Btn.Visible = true;
                    break;

                case "view":
                    optr.Visible       = false;
                    upfile_btn.Visible = false;
                    break;

                default:
                    Reject_Btn.Visible = true;
                    break;
                }
                Call.HideBread(Master);
            }
        }
예제 #14
0
        /// <summary>
        /// 提现提交处理方法---快速提现
        /// </summary>
        /// <returns></returns>
        public ActionResult CashGENERAL()
        {
            int     userid        = CurrentUserId;
            string  url           = Utils.GetChinapnrUrl();
            decimal Amt           = decimal.Parse(DNTRequest.GetString("amt"));
            int     UsrBindCardID = DNTRequest.GetInt("UsrBindCardID", 0);
            int     UsrCashType   = DNTRequest.GetInt("UsrCashType", 1);

            /*
             * string vcode = DNTRequest.GetString("vcode");
             * string strIdentify = "CashValidateCode"; //随机字串存储键值,以便存储到Session中
             * if (Session[strIdentify] != null)
             * {
             *  if (Session[strIdentify].ToString() != vcode)
             *  {
             *      return Content(StringAlert.Alert("验证码不对!"), "text/html");
             *  }
             * }
             * else
             * {
             *  return Content(StringAlert.Alert("验证码已过期!"), "text/html");
             * }*/
            ViewBag.errCode = "0";
            B_member_table b = new B_member_table();
            M_member_table p = new M_member_table();

            p = b.GetModel(userid);
            if (p.available_balance < Amt)
            {
                ViewBag.errCode = "-1";
                return(View(new M_Cash()));
            }
            hx_UsrBindCardC ubc = ef.hx_UsrBindCardC.Where(g => g.UsrBindCardID == UsrBindCardID).FirstOrDefault();

            if (ubc == null)
            {
                ViewBag.errCode = "-2";
                return(View(new M_Cash()));
            }
            ViewBag.url = url;
            decimal servf   = 0.00M;
            string  cashChl = Enum.GetName(typeof(EnumCommon.E_hx_td_UserCash.EnumCashChl), (int)EnumCommon.E_hx_td_UserCash.EnumCashChl.GENERAL);
            //string cashType = "FAST";
            string FeeObjFlag = "M";

            if (UsrCashType == 2)
            {
                cashChl = Enum.GetName(typeof(EnumCommon.E_hx_td_UserCash.EnumCashChl), (int)EnumCommon.E_hx_td_UserCash.EnumCashChl.IMMEDIATE);
                //FeeObjFlag = "U";
            }
            //bug 修复,应该为快速提现。此前为普通提现 by fangjianmin
            M_Cash mc = ChinapnrFacade.Cash(p.UsrCustId, Amt.ToString("0.00"), ubc.OpenAcctId, cashChl, servf.ToString("0.00"), FeeObjFlag);

            if (mc != null)
            {
                M_td_UserCash mu = new M_td_UserCash();
                B_td_UserCash mo = new B_td_UserCash();
                mu.registerid = p.registerid;
                mu.UsrCustId  = p.UsrCustId;
                mu.TransAmt   = decimal.Parse(mc.TransAmt);
                mu.FeeAmt     = servf;
                mu.OrdId      = mc.OrdId;
                mu.OrdIdTime  = DateTime.Now;
                mu.OrdIdState = 0;
                mu.FeeObjFlag = FeeObjFlag;
                mu.CashChl    = cashChl;
                mo.Add(mu);
            }
            return(View(mc));
        }
예제 #15
0
 public int insert(M_Cash model)
 {
     return(DBCenter.Insert(model));
 }
예제 #16
0
 public bool UpdateByID(M_Cash model)
 {
     return(DBCenter.UpdateByID(model, model.Y_ID));
 }
예제 #17
0
        /// <summary>
        /// 提现
        /// </summary>
        /// <param name="userCustId"></param>
        /// <param name="cashAmt">提现金额</param>
        /// <param name="openAcctId">卡号</param>
        /// <param name="cashChl">GENERAL:一般提现  FAST:快速取现  IMMEDIATE:即时取现 </param>
        /// <param name="servFee">服务费</param>
        /// <param name="feeObjFlag">商家(M)/用户(U)付手费续</param>
        /// <returns></returns>
        public static M_Cash Cash(string userCustId, string cashAmt, string openAcctId, string cashChl, string servFee = "0.00", string feeObjFlag = "M")
        {
            M_Cash m = new M_Cash();

            m.Version   = "20";
            m.CmdId     = "Cash";
            m.MerCustId = Utils.GetMerCustID();
            m.OrdId     = Utils.Createcode();
            m.UsrCustId = userCustId;
            m.TransAmt  = cashAmt;

            /*普通取现不收会员手续费*/
            m.ServFee       = servFee;
            m.ServFeeAcctId = Utils.GetMERDT();
            m.OpenAcctId    = openAcctId;
            m.RetUrl        = Utils.GetRe_url("Cash/PostGENERALAmt");
            m.BgRetUrl      = Utils.GetRe_url("Thirdparty/PostGENERALAmt");
            m.Remark        = "";
            m.CharSet       = "UTF-8";
            m.MerPriv       = "chuanglitou";

            M_ReqExt mr = new M_ReqExt();

            mr.FeeObjFlag = feeObjFlag;
            mr.FeeAcctId  = Utils.GetMERDT();
            mr.CashChl    = cashChl;
            m.ReqExt      = "[" + FastJSON.toJOSN(mr) + "]";
            StringBuilder chkVal = new StringBuilder();

            chkVal.Append(m.Version);
            chkVal.Append(m.CmdId);
            chkVal.Append(m.MerCustId);
            chkVal.Append(m.OrdId);
            chkVal.Append(m.UsrCustId);
            chkVal.Append(m.TransAmt);
            chkVal.Append(m.ServFee);
            chkVal.Append(m.ServFeeAcctId);
            chkVal.Append(m.OpenAcctId);
            chkVal.Append(m.RetUrl);
            chkVal.Append(m.BgRetUrl);
            chkVal.Append(m.Remark);
            chkVal.Append(m.MerPriv);
            chkVal.Append(m.ReqExt);
            string chkv = chkVal.ToString();

            //私钥文件的位置(这里是放在了站点的根目录下)
            string merKeyFile = AppDomain.CurrentDomain.BaseDirectory + Utils.GetMerPr();
            //需要指定提交字符串的长度
            int           len        = Encoding.UTF8.GetBytes(chkv).Length;
            StringBuilder sbChkValue = new StringBuilder(256);
            //加签
            int ret = DllInterop.SignMsg(Utils.GetMerId(), merKeyFile, chkv, len, sbChkValue);

            m.ChkValue = sbChkValue.ToString();
            LogInfo.WriteLog("加签字符:" + ret.ToString() + "提现渠道" + mr.CashChl + "取现chkv字符:" + chkv);
            LogInfo.WriteLog("提现渠道" + mr.CashChl + "提现提交表单报文:" + FastJSON.toJOSN(m));
            if (ret == 0)
            {
                return(m);
            }
            return(null);
        }
예제 #18
0
        public ActionResult CashIMMEDIATE()
        {
            int     userid        = Utils.checkloginsession();
            string  url           = Utils.GetChinapnrUrl();
            decimal Amt           = decimal.Parse(DNTRequest.GetString("TransAmt"));
            int     UsrBindCardID = DNTRequest.GetInt("UsrBindCardID", 0);
            //string vcode = DNTRequest.GetString("vcode");
            string strIdentify = "CashValidateCode"; //随机字串存储键值,以便存储到Session中

            LogInfo.WriteLog("即时取现:userid=" + userid + ";url=" + url + ";Amt=" + Amt + ";UsrBindCardID=" + UsrBindCardID + ";strIdentify=" + strIdentify);

            decimal ServFee = 0.00M;
            //if (Session[strIdentify] != null)
            //{
            //    if (Session[strIdentify].ToString() != vcode)
            //    {
            //        return Content(StringAlert.Alert("验证码不对!"), "text/html");
            //    }
            //}
            //else
            //{
            //    return Content(StringAlert.Alert("验证码已过期!"), "text/html");
            //}
            decimal servf = ServFee;

            ViewBag.errCode = "0";
            B_member_table b = new B_member_table();
            M_member_table p = new M_member_table();

            p = b.GetModel(userid);
            if (p.available_balance < Amt)
            {
                ViewBag.errCode = "-1";
                return(View(new M_Cash()));
            }
            if (Amt <= ServFee)
            {
                return(Content(StringAlert.Alert("取现金额小于或等于手续费,不能提现!"), "text/html"));
            }
            else if (p.available_balance < Amt + ServFee)
            {
                Amt = Amt - ServFee;
            }
            hx_UsrBindCardC ubc = ef.hx_UsrBindCardC.Where(g => g.UsrBindCardID == UsrBindCardID).FirstOrDefault();

            if (ubc == null)
            {
                ViewBag.errCode = "-2";
                return(View(new M_Cash()));
            }
            ViewBag.url = url;
            string FeeObjFlag = "M";//"U";

            string cashChl = Enum.GetName(typeof(EnumCommon.E_hx_td_UserCash.EnumCashChl), (int)EnumCommon.E_hx_td_UserCash.EnumCashChl.IMMEDIATE);
            M_Cash mc      = ChinapnrFacade.Cash(p.UsrCustId, Amt.ToString("0.00"), ubc.OpenAcctId, cashChl, ServFee.ToString("0.00"), FeeObjFlag);

            if (mc != null)
            {
                M_td_UserCash mu = new M_td_UserCash();
                B_td_UserCash mo = new B_td_UserCash();
                mu.registerid = p.registerid;
                mu.UsrCustId  = p.UsrCustId;
                mu.TransAmt   = decimal.Parse(mc.TransAmt);
                mu.FeeAmt     = ChinapnrFacade.CalcCashFee(Amt.ToString("0.00"), cashChl, FeeObjFlag) + servf;
                mu.OrdId      = mc.OrdId;
                mu.OrdIdTime  = DateTime.Now;
                mu.OrdIdState = 0;
                mu.FeeObjFlag = FeeObjFlag;
                mu.CashChl    = cashChl;
                mo.Add(mu);
            }
            return(View("CashQm", mc));
        }
예제 #19
0
        public void WithDraw_Add()
        {
            M_UserInfo mu       = buser.GetLogin(false);
            double     money    = Convert.ToDouble(Request.Form["Money_T"]);
            double     fee      = SiteConfig.UserConfig.WD_FeePrecent > 0 ? (money * (SiteConfig.UserConfig.WD_FeePrecent / 100)) : 0;
            string     shortPwd = Request.Form["ShortPwd_T"];

            if (money < 1)
            {
                function.WriteErrMsg("提现金额错误,不能小于1"); return;
            }
            if (money < SiteConfig.UserConfig.WD_Min)
            {
                function.WriteErrMsg("提现金额必须>=[" + SiteConfig.UserConfig.WD_Min + "]"); return;
            }
            if (SiteConfig.UserConfig.WD_Max > 0 && money > SiteConfig.UserConfig.WD_Max)
            {
                function.WriteErrMsg("提现金额必须小于[" + SiteConfig.UserConfig.WD_Max + "]");
                return;
            }
            if (SiteConfig.UserConfig.WD_Multi > 0 && (money % SiteConfig.UserConfig.WD_Multi) != 0)
            {
                function.WriteErrMsg("提现金额必须是[" + SiteConfig.UserConfig.WD_Multi + "]的倍数");
                return;
            }
            if (mu.Purse < (money + fee))
            {
                function.WriteErrMsg("你只有[" + mu.Purse.ToString("f2") + "],需[" + (money + fee).ToString("F2") + "]才可提现"); return;
            }
            if (string.IsNullOrEmpty(shortPwd))
            {
                function.WriteErrMsg("未输入支付密码"); return;
            }
            if (!mu.PayPassWord.Equals(StringHelper.MD5(shortPwd)))
            {
                function.WriteErrMsg("支付密码不正确"); return;
            }
            //生成提现单据
            M_Cash cashMod = new M_Cash();

            cashMod.UserID      = mu.UserID;
            cashMod.money       = money;
            cashMod.WithDrawFee = fee;
            cashMod.YName       = mu.UserName;
            cashMod.CardType    = Request.Form["cardType_rad"];
            cashMod.Remark      = Request.Form["Remark_T"];
            switch (cashMod.CardType)
            {
            case "银行卡":
            {
                cashMod.Account    = Request.Form["Account_T"];
                cashMod.Bank       = Request.Form["Bank_T"];
                cashMod.PeopleName = Request.Form["PName_T"];
            }
            break;

            default:    //其它网络支付方式
            {
                cashMod.Account    = Request.Form["Net_Account_T"];
                cashMod.Bank       = cashMod.CardType;
                cashMod.PeopleName = Request.Form["Net_PName_T"];
                cashMod.QRcode     = Request.Form["QRCode_t"];
            }
            break;
            }

            //银行账户信息
            int         bankid  = DataConverter.CLng(Request.Form["bankid"]);
            M_User_Bank bankMod = bankBll.SelReturnModel(bankid);

            //账户不存在则新增
            if (bankMod == null || !bankMod.CardNum.Equals(cashMod.Account.Trim()))
            {
                bankMod            = new M_User_Bank();
                bankMod.CardNum    = cashMod.Account;
                bankMod.BankName   = cashMod.Bank;
                bankMod.PeopleName = cashMod.PeopleName;
                bankMod.Remark     = cashMod.Remark;
                bankMod.UserID     = mu.UserID;
                bankMod.ID         = bankBll.Insert(bankMod);
            }
            buser.MinusVMoney(mu.UserID, money, M_UserExpHis.SType.Purse, cashMod.Remark);
            if (cashMod.WithDrawFee > 0)
            {
                buser.MinusVMoney(mu.UserID, cashMod.WithDrawFee, M_UserExpHis.SType.Purse, "提现手续费率" + SiteConfig.SiteOption.MastMoney.ToString("F2") + "%");
            }
            cashBll.insert(cashMod);
            function.WriteSuccessMsg("提现申请成功,请等待管理员审核", "WithDrawLog");
        }
예제 #20
0
        public ActionResult Index(RequestParam <RequestCash> reqst)
        {
            LoggerHelper.Info(reqst);
            ResultInfo <string> res = new ResultInfo <string>("99999");

            int            userId        = ConvertHelper.ParseValue(reqst.body.userId.ToString(), 0);        //用户id
            decimal        Amt           = reqst.body.transAmt;                                              //提现金额
            int            usrBindCardId = ConvertHelper.ParseValue(reqst.body.usrBindCardId.ToString(), 0); //提现卡id
            decimal        servf         = 0.00M;
            string         orderid       = Settings.Instance.OrderCode;
            B_member_table b             = new B_member_table();
            M_member_table p             = new M_member_table();
            M_Cash         mc            = new M_Cash();
            M_ReqExt       mr            = new M_ReqExt();

            p = b.GetModel(userId);
            MemberLogic _logic = new MemberLogic();


            var result = _logic.SelectUserBindCards(usrBindCardId);

            if (result == null || result.Count < 0)
            {
                LoggerHelper.Info("提现失败,用户关联的银行卡不存在:" + JsonHelper.Entity2Json(reqst));
                return(Content("提现失败,用户关联的银行卡不存在!"));
            }
            if (!_logic.IsAllowWithdrawalCash(usrBindCardId, reqst.body.withdrawalType))
            {
                LoggerHelper.Info("提现失败,用户关联的银行卡不支持此类型的取现请求:" + JsonHelper.Entity2Json(reqst));
                return(Content("提现失败,用户关联的银行卡不支持此类型的取现请求!"));
            }

            MemberBankEntity ubc = result.FirstOrDefault();

            if (ubc.UsrCustId == p.UsrCustId)
            {
                mc.Version   = "20";
                mc.CmdId     = "Cash";
                mc.MerCustId = Settings.Instance.MerCustId;
                mc.OrdId     = orderid;
                mc.UsrCustId = p.UsrCustId;
                mc.TransAmt  = Amt.ToString("0.00");

                /*普通取现不收会员手续费*/
                mc.ServFee       = "";
                mc.ServFeeAcctId = Settings.Instance.MerDt;
                mc.OpenAcctId    = ubc.OpenAcctId;
                mc.RetUrl        = Settings.Instance.GetCallbackUrl("/Cash/Index/CashCallback");

                mc.BgRetUrl = Settings.Instance.GetCallbackUrl("/Cash/Index/CashBgCallback");
                mc.Remark   = "";
                mc.CharSet  = "UTF-8";
                mc.MerPriv  = "chuanglitou";
                //if (reqst.body.withdrawalType == 2)
                //    mr.FeeObjFlag = "U";  //客户承担提现手费续
                //else
                mr.FeeObjFlag = "M";  //商家承担提现手费续
                mr.FeeAcctId  = Settings.Instance.MerDt;
                //reqst.body.withdrawalType = 1;
                switch (reqst.body.withdrawalType)
                {
                case 2:
                    mr.CashChl = "IMMEDIATE";
                    break;

                case 1:
                    mr.CashChl = "FAST";
                    break;

                case 0:
                default:
                    mr.CashChl = "GENERAL";     //一般取现
                    break;
                }
                //mr.CashChl = "GENERAL"; //一般取现
                // mr.CashChl = "FAST";  //快速取现
                // mr.CashChl = "IMMEDIATE";  // 即时取现
                mc.ReqExt = "[" + FastJSON.toJOSN(mr) + "]";

                StringBuilder chkVal = new StringBuilder();
                chkVal.Append(mc.Version);
                chkVal.Append(mc.CmdId);
                chkVal.Append(mc.MerCustId);
                chkVal.Append(mc.OrdId);
                chkVal.Append(mc.UsrCustId);
                chkVal.Append(mc.TransAmt);
                chkVal.Append(mc.ServFee);
                chkVal.Append(mc.ServFeeAcctId);
                chkVal.Append(mc.OpenAcctId);
                chkVal.Append(mc.RetUrl);
                chkVal.Append(mc.BgRetUrl);
                chkVal.Append(mc.Remark);
                chkVal.Append(mc.MerPriv);
                chkVal.Append(mc.ReqExt);
                string chkv = chkVal.ToString();

                LoggerHelper.Info("取现chkv字符:" + chkv);

                //私钥文件的位置(这里是放在了站点的根目录下)
                string merKeyFile = AppDomain.CurrentDomain.BaseDirectory + Settings.Instance.MerPr;
                //需要指定提交字符串的长度
                int           len        = Encoding.UTF8.GetBytes(chkv).Length;
                StringBuilder sbChkValue = new StringBuilder(256);
                //加签
                int str = DllInterop.SignMsg(Settings.Instance.MerId, merKeyFile, chkv, len, sbChkValue);
                mc.ChkValue = sbChkValue.ToString();
                if (str == 0)
                {
                    M_td_UserCash mu = new M_td_UserCash();
                    B_td_UserCash mo = new B_td_UserCash();
                    mu.registerid = p.registerid;
                    mu.UsrCustId  = p.UsrCustId;
                    mu.TransAmt   = decimal.Parse(mc.TransAmt);
                    mu.FeeAmt     = servf;
                    mu.OrdId      = mc.OrdId;
                    mu.OrdIdTime  = DateTime.Now;
                    mu.OrdIdState = 0;
                    mu.FeeObjFlag = mr.FeeObjFlag;
                    mo.Add(mu);
                }
                LoggerHelper.Info("加签字符:" + str);
                LoggerHelper.Info("提现提交表单:" + JsonHelper.Entity2Json(mc));
                return(View(mc));
            }
            else
            {
                LoggerHelper.Info("提现失败,用户提现的银行卡的关联帐户和当前用户关联的银行卡帐户不一致:" + JsonHelper.Entity2Json(reqst));
                return(Content("提现失败,用户提现的银行卡的关联帐户和当前用户关联的银行卡帐户不一致!"));
            }
        }