示例#1
0
        protected void ActiveCgt()
        {
            Guid userid   = WebUserAuth.UserId.Value;
            var  usermode = new UserBLL().GetUserBasicInfoModelById(userid);

            if (usermode != null)
            {
                var cgtmode = new QueryClient().GetUserByPlatformUserNo(userid);
                if (cgtmode == null || cgtmode.accountStage == 1)
                {
                    Response.Redirect("/Member/cgt/openCgt.aspx", false);
                    return;
                }
                string rtn = string.Empty;
                if (usermode.UserTypeId == 1)
                {
                    string      errorMessage = string.Empty;
                    string      respData     = string.Empty;
                    QueryClient cli          = new QueryClient();
                    bool        isCli        = cli.QUERY_USER_INFORMATION_API(userid, ref errorMessage, ref respData);
                    if (isCli)
                    {
                        //QUERY_USER_INFORMATION
                        QUERY_USER_INFORMATION_Response model = Newtonsoft.Json.JsonConvert.DeserializeObject <QUERY_USER_INFORMATION_Response>(respData);
                        if ((model != null) && (model.isImportUserActivate))
                        {
                            bool result = TuanDai.CunGuanTong.Client.UserClient.USER_INFORMATION_CHECK(userid, ref errorMessage);
                            if (result)
                            {
                                Response.Redirect("/Member/my_account.aspx");
                                return;
                            }
                        }
                    }

                    ACTIVATE_IMPORT_USER_Request request = new ACTIVATE_IMPORT_USER_Request();

                    request.callbackUrl    = CgtCallBackConfig.GetCgtCallBackUrl(CgtCallBackConfig.CgtCallBackType.ActivateImportUser);
                    request.platformUserNo = userid.ToString();
                    request.userDevice     = userDevice.MOBILE;
                    rtn      = UserClient.ACTIVATE_IMPORT_USER_Req(request);
                    strGoUrl = rtn;
                    return;
                }
                else
                {
                    StrErr = "暂时不支持企业用户";
                }
            }
            Response.Redirect("/Member/my_account.aspx");
        }
示例#2
0
        private string CheckPwd(Guid userid, string content, CgtCallBackConfig.CgtCallBackType type)
        {
            CHECK_PASSWORD_Request request = new CHECK_PASSWORD_Request();
            CHECK_PASSWORD_Req_Td  reqTd   = new CHECK_PASSWORD_Req_Td();

            //ProductId|BuyQty|RepeatInvestType
            request.callbackUrl = CgtCallBackConfig.GetCgtCallBackUrl(type);

            request.platformUserNo = userid.ToString();
            request.userDevice     = userDevice.MOBILE;

            reqTd.applicationid           = 3;
            reqTd.businessid              = Guid.NewGuid();
            reqTd.content                 = content;
            reqTd.mCHECK_PASSWORD_Request = request;


            switch (type)
            {
            case CgtCallBackConfig.CgtCallBackType.WeInvest:
                string productName = Request["pname"];
                if (string.IsNullOrEmpty(productName))
                {
                    productName = "WE计划";
                }
                request.bizTypeDescription = "您正在购买" + GetWePlanTitle(productName);
                reqTd.typeid = 4;
                break;

            case CgtCallBackConfig.CgtCallBackType.TransferInvest:
                request.bizTypeDescription = "您正在购买债权转让";
                reqTd.typeid = 2;
                break;

            case CgtCallBackConfig.CgtCallBackType.ProjectInvest:
                string projectTypeName = Request["ptype"];
                int    projectTypeId;
                int.TryParse(projectTypeName, out projectTypeId);
                projectTypeName            = TypeIdToTitle(projectTypeId);
                request.bizTypeDescription = "您正在购买" + projectTypeName;
                reqTd.typeid = 2;
                break;

            case CgtCallBackConfig.CgtCallBackType.WeFqbPreExit:
                request.bizTypeDescription = "您正在进行提前退出申请";
                reqTd.typeid = 6;
                break;

            case CgtCallBackConfig.CgtCallBackType.EndProject:
                request.bizTypeDescription = "您正在进行结束发标";
                reqTd.typeid = 5;
                break;

            case CgtCallBackConfig.CgtCallBackType.ApplyZqzr:
                request.bizTypeDescription = "您正在进行债权转让申请";
                reqTd.typeid = 10;
                break;

            case CgtCallBackConfig.CgtCallBackType.Withdraw:
                request.bizTypeDescription = "您正在进行提现申请";
                reqTd.typeid = 8;
                break;

            case CgtCallBackConfig.CgtCallBackType.ModifyTradePwdStatus:
                bool isTenderNeedPayPassword = false;
                if (!string.IsNullOrEmpty(content))
                {
                    var req = JsonConvert.DeserializeObject <CgtCallbackUrl.Model.ModelRequest.UpdatePayPwdStatusRequest>(content);
                    isTenderNeedPayPassword = req.IsTenderNeedPayPassword;
                }
                request.bizTypeDescription = string.Format("您正在进行{0}交易密码", isTenderNeedPayPassword?"开启":"关闭");
                reqTd.typeid = 7;
                break;

            case CgtCallBackConfig.CgtCallBackType.Prepayment:
                request.bizTypeDescription = "您正在进行提前还款申请";
                reqTd.typeid = 3;
                break;

            case CgtCallBackConfig.CgtCallBackType.FTBPreExit:
                request.bizTypeDescription = "复投宝提前退出交易密码验证";
                reqTd.typeid = 11;
                break;
            }

            string rtn = UserClient.CHECK_PASSWORD_Req_Td(reqTd);

            return(rtn);
        }
示例#3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Guid userid = WebUserAuth.UserId.Value;
            //if (GetBankInfo(userid, 2) == 1)
            //{
            //    //if (bankmodel.Status==2)
            //    //{
            //    //Response.Write("您好,银行卡在审核中不允许充值!");
            //    ClientScript.RegisterStartupScript(this.GetType(), "ss",
            //        "<script>ShowMsg('您好,银行卡在审核中不允许充值!','1','确定');</script>");
            //    return;
            //    //}
            //}
            decimal Amount    = Tool.SafeConvert.ToDecimal(Request.Params["Amount"], 0);
            decimal tmpAmount = Math.Floor(Amount * 100) / 100;

            if (tmpAmount != Amount)
            {
                ClientScript.RegisterStartupScript(this.GetType(), "ss",
                                                   "<script>ShowMsg('充值金额最多只能2位小数,如106.32!','1','确定');</script>");
                return;
            }
            TuanDai.PortalSystem.Model.WebSettingInfo rechargeSet =
                new TuanDai.PortalSystem.DAL.WebSettingDAL().GetWebSettingInfo("9A89CBAE-6550-4EA1-8224-EB645F38F8FA");
            decimal minRecharge = decimal.Parse(rechargeSet.Param1Value);

            if (Amount < minRecharge)
            {
                ClientScript.RegisterStartupScript(this.GetType(), "ss",
                                                   "<script>ShowMsg('单次充值最少" + minRecharge.ToString("N2") + "元!','1','确定');</script>");
                return;
            }
            if (Amount > 500000)
            {
                ClientScript.RegisterStartupScript(this.GetType(), "ss",
                                                   "<script>ShowMsg('单次充值不能超过50万!','1','确定');</script>");
                return;
            }

            var cgtMode = new QueryClient().GetUserByPlatformUserNo(userid);

            if (cgtMode == null)
            {
                ClientScript.RegisterStartupScript(this.GetType(), "ss",
                                                   "<script>ShowMsg('存管通未开通,不能进行充值!','1','确定');</script>");
                return;
            }
            if (!cgtMode.isActivate)
            {
                ClientScript.RegisterStartupScript(this.GetType(), "ss",
                                                   "<script>ShowMsg('存管通未激活,不能进行充值!','1','确定');</script>");
                return;
            }

            NoHandler noHandler = new NoHandler();
            string    orderNo   = noHandler.OnLineRechare();

            if (orderNo == "0")
            {
                ClientScript.RegisterStartupScript(this.GetType(), "ss",
                                                   "<script>ShowMsg('您好,您的提交失败请重试!','1','确定');</script>");
                return;
            }

            string err        = string.Empty;
            bool   isRecharge = new CgtCheckBLL().GetUserCgtIsOper(userid, "recharge", ref err);

            if (!isRecharge)
            {
                ClientScript.RegisterStartupScript(this.GetType(), "ss",
                                                   "<script>ShowMsg('" + err + "','1','确定');</script>");
                return;
            }
            //获取银行卡号
            string bankNo  = Request["bankno"];
            string outCode = string.Empty;

            if (!string.IsNullOrEmpty(bankNo))
            {
                try
                {
                    bankNo = Tool.DESC.Decrypt(bankNo);
                }
                catch (Exception)
                {
                    bankNo = null;
                }
            }

            BankFromJavaService bankJavaService = new BankFromJavaService();

            if (GlobalUtils.IsBankService)
            {
                var bankInfoFromJava = bankJavaService.GetBankInfo(userid, ServiceType.NotTuomin);
                if (bankInfoFromJava != null && bankInfoFromJava.respData != null)
                {
                    bankNo  = bankInfoFromJava.respData.bankNo;
                    outCode = bankInfoFromJava.respData.bankCode;
                }
            }
            else
            {
                var userInfo = new PortalSystem.BLL.UserBLL().GetUserBasicInfoModelById(userid);
                if (userInfo == null || string.IsNullOrEmpty(userInfo.BankAccountNo))
                {
                    var bankInfo = GlobalUtils.GetBankInfo(userid);
                    bankNo = bankInfo.BankNo;
                }
                else
                {
                    bankNo = userInfo.BankAccountNo;
                }
            }

            string userIP = Tool.WebFormHandler.GetIP();

            if (!GlobalUtils.IsBankService)
            {
                var sss = TuanDai.Payment.Client.BankInfo.GetPayBankInfo(userid);

                TuanDai.Payment.Models.PayRoute.RouteInfo bank = new TuanDai.Payment.Client.Recharge().GetCgtRechargeInfo(userid, sss.BankNo);
                int Sel = bank.Sel;

                int    outStatus = 0;
                string bankcode  = "";
                if (Request.Params["bankcode"] != null)
                {
                    bankcode = Request.Params["bankcode"];
                }


                var paramData = new Dapper.DynamicParameters();
                paramData.Add("@userid", userid);
                paramData.Add("@type", Sel);
                paramData.Add("@amount", Amount);
                paramData.Add("@orderNo", orderNo);
                paramData.Add("@backcode", bankcode);
                paramData.Add("@clientIp", userIP);
                paramData.Add("@from", "5");
                if (bank.RouteId.IsEmpty())
                {
                    paramData.Add("@RouteId", null);
                }
                else
                {
                    paramData.Add("@RouteId", bank.RouteId);
                }
                paramData.Add("@outStatus", 0, System.Data.DbType.Int32, System.Data.ParameterDirection.Output);
                paramData.Add("@cmorderNo", "");
                PublicConn.ExecuteTD(PublicConn.DBWriteType.FundWrite, "p_cgt_AccountRechargeInit", ref paramData, CommandType.StoredProcedure);
                outStatus = paramData.Get <int>("@outStatus");

                int result = outStatus;
                if (result > 0)
                {
                    lock (lockstatus)
                    {
                        var isCallBackPayment =
                            System.Configuration.ConfigurationManager.AppSettings["IsCallBackPayment"];
                        var    paymentUrl  = System.Configuration.ConfigurationManager.AppSettings["PaymentUrl"];
                        string callBackUrl = paymentUrl + "/PaymentPlatform/H5/commonCallBack.aspx";
                        if (isCallBackPayment == "0")
                        {
                            callBackUrl = CgtCallBackConfig.GetCgtCallBackUrl(CgtCallBackConfig.CgtCallBackType.Recharge);
                        }
                        var recharInfo = new Payment.Client.Recharge().GetCgtRechargeInfo(userid, bankNo);
                        var url        = CunGuanTong.Client.FundClient.RECHARGE_Req(new CunGuanTong.Model.RECHARGE_Request
                        {
                            rechargeWay      = rechargeWay.SWIFT,
                            requestNo        = orderNo,
                            amount           = Amount,
                            bankcode         = recharInfo.OutCode,
                            callbackMode     = "DIRECT_CALLBACK",
                            platformUserNo   = userid.ToString(),
                            expectPayCompany = recharInfo.CgtPayCompany,
                            //callbackUrl = CgtCallBackConfig.GetCgtCallBackUrl(CgtCallBackConfig.CgtCallBackType.Recharge),
                            callbackUrl = callBackUrl,
                            userDevice  = CunGuanTong.Model.userDevice.MOBILE
                        });

                        if (string.IsNullOrEmpty(url))
                        {
                            if (Request.UrlReferrer != null)
                            {
                                url = Request.UrlReferrer.ToString();
                            }
                            else
                            {
                                url = GlobalUtils.WebURL;
                            }
                        }
                        Response.Redirect(url);
                    }
                }
                else
                {
                    ClientScript.RegisterStartupScript(this.GetType(), "ss", "<script>ShowMsg('您好,充值提交失败请重试!','1','确定');</script>");
                }
            }
            else
            {  //走Java银行卡服务
                string retUrl = bankJavaService.GetCgtRechargeUrl(userid, bankNo, Amount, userIP, outCode);
                if (!string.IsNullOrEmpty(retUrl))
                {
                    Response.Redirect(retUrl);
                }
            }
        }
示例#4
0
        public void CheckPayPwd()
        {
            Guid userid = WebUserAuth.UserId.Value;

            if (userid == Guid.Empty)
            {
                PrintJson("-99", "登录已失效");
            }
            string msg          = string.Empty;
            var    isWithdrawal = new CgtCheckBLL().GetUserCgtIsOper(userid, "tixian", ref msg);

            if (!isWithdrawal)
            {
                PrintJson("-199", msg + ",不允许提现");
                return;
            }

            string  amountStr       = Context.Request.Form["amount"];
            string  couponAmountStr = Context.Request.Form["couponAmount"];
            decimal amount          = 0m;
            decimal couponAmount    = 0m;

            if (!string.IsNullOrEmpty(amountStr))
            {
                amount = Convert.ToDecimal(amountStr);
            }
            if (!string.IsNullOrEmpty(couponAmountStr))
            {
                couponAmount = Convert.ToDecimal(couponAmountStr);
            }
            string userPrizeId = Context.Request.Form["userPrizeId"];
            Guid   couponId    = new Guid();

            if (!string.IsNullOrEmpty(userPrizeId))
            {
                couponId = Guid.Parse(userPrizeId);//优惠券Id
            }
            //可提现金额
            decimal aviMoney = new UserBLL().GetDrawAviAmount(userid);

            if (amount > aviMoney)
            {
                PrintJson("-1", "申请提现金额大于可用金额");
                return;
            }

            string withdrawNo = string.Empty;

            if (GlobalUtils.IsBankService)
            {
                WXResponsePublicInfo <WXResponseWithdrawInit> init =
                    new BankFromJavaService().WithdrawalInit(new WXRequestPublicInfo <WXRequestWithdrawInit>
                {
                    serverName = TdConfig.ApplicationName,
                    reqData    = new WXRequestWithdrawInit
                    {
                        amount       = amount,
                        couponId     = couponId,
                        couponAmount = couponAmount,
                        fundType     = "USER",
                        userId       = userid,
                        withdrawType = "GATEWAY"
                    }
                });
                if (init != null)
                {
                    withdrawNo = init.respData.withdrawNo;
                }
                else
                {
                    PrintJson("-1", "生成提现申请出错");
                    return;
                }
            }
            else
            {
                string err = "";
                WithdrawResponseModel resmodel = TuanDai.Payment.Client.Withdraw.ApplyWithdraw(new WithdrawRequestModel
                {
                    Amount       = amount,
                    CouponAmount = couponAmount,
                    CouponId     = couponId,
                    FundType     = 0,
                    UserId       = userid,
                    WithdrawType = 1//1:存管通,2:定期
                }, ref err);

                if (resmodel == null)
                {
                    TuanDai.LogSystem.LogClient.LogClients.ErrorLog(TdConfig.ApplicationName, "生成提现申请出错", "", err);
                    PrintJson("-1", "生成提现申请出错");
                    return;
                }
                if (resmodel.ReturnCode != 1)
                {
                    TuanDai.LogSystem.LogClient.LogClients.ErrorLog("WXTouch", "TuanDai.Payment.Client.Withdraw.ApplyWithdraw", "提现申请错误", resmodel.ReturnMessage);
                    PrintJson("-1", resmodel.ReturnMessage);
                }

                withdrawNo = resmodel.WithdrawNo;
            }


            //申请提现金额
            //decimal handingcharge= decimal.Parse(resmodel.HandingCharge.ToString());
            //if ((aviMoney - amount - handingcharge) < 0)
            //{
            //    amount = amount - handingcharge;
            //}
            string strSQL = "SELECT TOP 1 * FROM AppWithdrewFund WHERE UserId=@UserId and WithdrawNo=@WithdrawNo";

            var dyParams = new Dapper.DynamicParameters();

            dyParams.Add("@UserId", userid);
            dyParams.Add("@WithdrawNo", withdrawNo);
            WXAppWithdrewFund fundInfo = TuanDai.DB.TuanDaiDB.QuerySingleOrDefault <WXAppWithdrewFund>(TdConfig.ApplicationName, TdConfig.DBRealRead, strSQL, ref dyParams);

            if (fundInfo == null)
            {
                PrintJson("-1", "获取提现金额失败");
                return;
            }
            var    isCallBackPayment = System.Configuration.ConfigurationManager.AppSettings["IsCallBackPayment"];
            var    paymentUrl        = System.Configuration.ConfigurationManager.AppSettings["PaymentUrl"];
            string callBackUrl       = paymentUrl + "/PaymentPlatform/H5/commonCallBack.aspx";

            if (isCallBackPayment != "1")
            {
                callBackUrl = CgtCallBackConfig.GetCgtCallBackUrl(CgtCallBackConfig.CgtCallBackType.Withdraw);
            }
            TuanDai.CunGuanTong.Model.WITHDRAW_Request info = new TuanDai.CunGuanTong.Model.WITHDRAW_Request
            {
                callbackUrl    = callBackUrl,
                platformUserNo = userid.ToString(),
                userDevice     = TuanDai.CunGuanTong.Model.userDevice.MOBILE,
                amount         = decimal.Parse(fundInfo.ActualWithdrawDeposit.Value.ToString("0.00")),
                commission     = fundInfo.HandingCharge.HasValue ? decimal.Parse(fundInfo.HandingCharge.Value.ToString("0.00")) : decimal.Zero, //,//提现手续费
                requestNo      = withdrawNo                                                                                                     //提现订单流水号
            };
            string responseStr = TuanDai.CunGuanTong.Client.FundClient.WITHDRAW_Req(info);

            PrintJson("1", responseStr);
        }