示例#1
0
        //获取资产统计
        private void GetAccountInfo(Guid userid)
        {
            //获取We待投
            weWaitInvestment = GetWePlanWaitInvestment(userid);

            Tuple <decimal, decimal> ftbDueIn = GetFTBDueInAmountInterest(userid);


            var commandText        = @"SELECT * from dbo.FundAccountInfo with(nolock) WHERE UserId =@UserId";;
            DynamicParameters para = new DynamicParameters();

            para.Add("@UserId", userid);
            fundAccountInfo = PublicConn.QuerySingle <FundAccountInfoInfo>(commandText, ref para);

            //待收利息加上复投宝的利息
            fundAccountInfo.DueInPAndI      = (fundAccountInfo.DueInPAndI ?? 0) + ftbDueIn.Item1 + ftbDueIn.Item2;
            fundAccountInfo.DueComeInterest = (fundAccountInfo.DueComeInterest ?? 0) + ftbDueIn.Item2;
            fundAccountInfo.FreezeAcount    = (fundAccountInfo.FreezeAcount ?? 0) + weWaitInvestment; //冻结资金加上We待投
            fundAccountInfo.TotalInvest    += GetWeFtbTotalInvest(userid);

            TotalRecharge = fundAccountInfo.TotalRecharge ?? 0;

            totalamount = (fundAccountInfo.AviMoney ?? 0) + (fundAccountInfo.DueInPAndI ?? 0)
                          + (fundAccountInfo.BorrowerOut ?? 0) + (fundAccountInfo.DueConfirmWithdrawDeposit ?? 0) + (fundAccountInfo.RewardMoney ?? 0) + (fundAccountInfo.FreezeAcount ?? 0);
        }
示例#2
0
        protected void InitFormData()
        {
            Guid userId = WebUserAuth.UserId.Value;

            vipInfo = MUserVipInfoBLL.GetUserVipInfoById(WebUserAuth.UserId.Value);
            if (vipInfo == null)
            {
                vipInfo       = new MUserVipInfo();
                vipInfo.Level = 1;
            }

            NextReturnDay = GetNextReturnMoneyDay(userId);

            fundModel = new FundAccountBLL().GetFundAccountInfoById(userId);

            //待收本息加上复投宝的
            Tuple <decimal, decimal> ftbDueIn = GetFTBDueInAmountInterest(userId);

            fundModel.DueInPAndI  = (fundModel.DueInPAndI ?? 0) + ftbDueIn.Item1 + ftbDueIn.Item2;
            fundModel.DueOutPAndI = (fundModel.DueOutPAndI ?? 0) + fundModel.CurrentPreAdvance;

            #region 减去智享计划部分
            string sql      = @"SELECT  
                         sum(sd.Amount )+
                         sum(sd.InterestAmout )+
                         sum(ISNULL(sd.TuandaiRedPacket,0) )+
                        sum(ISNULL(sd.PublisherRedPacket,0))  
                        FROM dbo.SubscribeDetail sd with(nolock) 
                        inner join Project p with(nolock) on sd.ProjectId = p.Id
                        WHERE isnull(sd.InvestType,0)!=1 and sd.SubscribeUserId=@UserId  and sd.CycDate>getdate() and p.Type=37 ";
            var    dyParams = new Dapper.DynamicParameters();
            dyParams.Add("@UserId", userId);
            decimal p2pZxDueInAndI = TuanDaiDB.QuerySingle <decimal>(TdConfig.ApplicationName, "/BD/zxread", sql, ref dyParams);
            fundModel.DueInPAndI = fundModel.DueInPAndI - p2pZxDueInAndI;
            sql = @"SELECT  
                         sum(sd.Amount )+
                         sum(sd.InterestAmout )+
                         sum(ISNULL(sd.TuandaiRedPacket,0) )+
                        sum(ISNULL(sd.PublisherRedPacket,0))  
                        FROM dbo.SubscribeDetail sd with(nolock) 
                        inner join Project p with(nolock) on sd.ProjectId = p.Id
                        WHERE isnull(sd.InvestType,0)!=1 and sd.BorrowerUserId=@UserId  and sd.CycDate>getdate() and p.Type=37 ";
            decimal p2pZxDueOutPAndI = TuanDaiDB.QuerySingle <decimal>(TdConfig.ApplicationName, "/BD/zxread", sql, ref dyParams);
            fundModel.DueOutPAndI = fundModel.DueOutPAndI - p2pZxDueOutPAndI;
            #endregion

            decimal weWaitInvestAmount = GetWePlanWaitInvestment(userId);
            fundModel.FreezeAcount = fundModel.FreezeAcount + weWaitInvestAmount;  //冻结资金加上We待投

            pageModel = new PageMoneyModel();
            if (fundModel != null)
            {
                pageModel.P2PSumAmount = (fundModel.AviMoney ?? 0) + (fundModel.DueInPAndI ?? 0)
                                         + (fundModel.BorrowerOut ?? 0) + (fundModel.DueConfirmWithdrawDeposit ?? 0)
                                         + (fundModel.RewardMoney ?? 0) + (fundModel.FreezeAcount ?? 0);
            }

            pageModel.P2PAviAmount = fundModel.AviMoney ?? 0;
            pageModel.P2PDueIn     = fundModel.DueInPAndI ?? 0;
        }
示例#3
0
        //获取资产统计
        private void GetAccountInfo(Guid userid)
        {
            //获取We待投
            weWaitInvestment = GetWePlanWaitInvestment(userid);

            GetWe_FundAccountInfo(userid);

            var commandText        = @"SELECT * from dbo.FundAccountInfo with(nolock) WHERE UserId =@UserId";;
            DynamicParameters para = new DynamicParameters();

            para.Add("@UserId", userid);
            fundAccountInfo = PublicConn.QuerySingle <FundAccountInfoInfo>(commandText, ref para);

            //待收利息加上复投宝的利息
            fundAccountInfo.DueInPAndI           = (fundAccountInfo.DueInPAndI ?? 0) + (we_FundAccountInfo.DueComeInterest ?? 0) + (we_FundAccountInfo.RecoverBorrowOut ?? 0);
            fundAccountInfo.DueComeInterest      = (fundAccountInfo.DueComeInterest ?? 0) + (we_FundAccountInfo.DueComeInterest ?? 0);
            fundAccountInfo.FreezeAcount         = (fundAccountInfo.FreezeAcount ?? 0) + weWaitInvestment; //冻结资金加上We待投
            fundAccountInfo.TotalInvest         += (we_FundAccountInfo.TotalInvest ?? 0);
            fundAccountInfo.NetEarningsInterest += (we_FundAccountInfo.NetEarningsInterest ?? 0);

            if (fundAccountInfo.TotalPenaltyOfInvest < 0)
            {
                fundAccountInfo.TotalPenaltyOfInvest = 0;
            }

            TotalRecharge = fundAccountInfo.TotalRecharge ?? 0;

            totalamount = (fundAccountInfo.AviMoney ?? 0) + (fundAccountInfo.DueInPAndI ?? 0)
                          + (fundAccountInfo.BorrowerOut ?? 0) + (fundAccountInfo.DueConfirmWithdrawDeposit ?? 0) + (fundAccountInfo.RewardMoney ?? 0) + (fundAccountInfo.FreezeAcount ?? 0);
        }
示例#4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            fundModel = new FundAccountBLL().GetFundAccountInfoById(WebUserAuth.UserId.Value);
            if (fundModel == null)
            {
                fundModel = new FundAccountInfoInfo();
            }

            TuanDai.ZXSystem.Model.FundStatisticsInfo zxFund =
                new FundStatisticsBLL().GetFundStatisticsInfoByUserId(WebUserAuth.UserId.Value);
            if (zxFund == null)
            {
                zxFund = new FundStatisticsInfo();
            }
            ZxDueOutAmount = (zxFund.DueOutAmount_DQ ?? 0) + (zxFund.DueOutAmount_P2P ?? 0) + (zxFund.DueOutInterest_DQ ?? 0) +
                             (zxFund.DueOutInterest_P2P ?? 0);
            fundModel.DueOutPAndI = fundModel.DueOutPAndI - (zxFund.DueOutAmount_P2P ?? 0) - (zxFund.DueOutInterest_P2P ?? 0);
            if (fundModel.DueOutPAndI < 0)
            {
                fundModel.DueOutPAndI = 0;
            }
        }
示例#5
0
        private void OnInitData()
        {
            basicinfo = bll.GetUserBasicInfoModelById(userId);

            //从Java接口获取银行卡信息
            var bankJavaService = new BankFromJavaService();

            if (GlobalUtils.IsBankService)
            {
                WXResponsePublicInfo <WXResponseSelectBankInfoChild> bankInfo = bankJavaService.GetBankInfo(userId, ServiceType.TuoMin);
                if (bankInfo != null && bankInfo.respData != null)
                {
                    bankName = bankInfo.respData.bankName;
                    bankNo   = bankInfo.respData.bankNo;
                }
            }
            if (string.IsNullOrEmpty(bankNo))
            {
                GlobalUtils.GetBankImg(basicinfo.Id, out bankName);
                var bankinfo = GlobalUtils.GetBankInfo(basicinfo.Id);
                if (bankinfo != null)
                {
                    bankNo = bankinfo.BankNo;
                }
            }

            if (basicinfo.sex == 2)
            {
                sexname = "小姐";
            }
            vailStatus  = getVailStatusByUserModel(basicinfo);
            accountInfo = new FundAccountBLL().GetFundAccountInfoById(userId);
            if (GlobalUtils.IsBankService)
            {
                cadAviMoney = bankJavaService.GetAviMoney(userId);
            }
            else
            {
                cadAviMoney = bll.GetDrawAviAmount(userId);
            }

            WebSettingInfo setmodel = new WebSettingBLL().GetWebSettingInfo("1F9F7CF7-267E-4F88-B3A4-F2775401CA0F");

            topwithdrawamount = (basicinfo.Level ?? 1) == (int)ConstString.UserType.VipUser ? decimal.Parse(setmodel.Param5Value) : decimal.Parse(setmodel.Param4Value);

            //UserPrizeBll prizebll = new UserPrizeBll();
            //VoucherInfoList = prizebll.GetWithdrawVoucher(userId);
            string err = "";
            //从接口获取未使用提现券
            List <TuanDai.UserPrizeNew.ServiceClient.Models.UserPrizeInfo> ulist =
                new TuanDai.UserPrizeNew.Client.UserPrizeQueryClient(TdConfig.ApplicationName).GetWithdrawVoucher(userId, out err);

            if (!string.IsNullOrEmpty(err))
            {
                TuanDai.LogSystem.LogClient.LogClients.ErrorLog(TdConfig.ApplicationName, "TuanDai.UserPrizeNew.Client.UserPrizeQueryClient.GetUserPrizeListByUserId", userId.ToString(), err);
            }
            WithdrawVoucherInfo1 wvi = null;

            if (VoucherInfoList == null)
            {
                VoucherInfoList = new List <WithdrawVoucherInfo1>();
            }
            if (ulist != null && ulist.Count > 0)
            {   //循坏写入VoucherInfoList
                foreach (var u in ulist)
                {
                    wvi                = new WithdrawVoucherInfo1();
                    wvi.Amount         = u.PrizeValue;
                    wvi.ExpirationDate = u.ExpirationDate;
                    wvi.Id             = u.Id;
                    wvi.SubTypeId      = u.SubTypeId;
                    if (wvi.ExpirationDate.HasValue)
                    {
                        wvi.DateDeadline = (int)MyDateTime.DateDiff(MyDateTime.DateDiffOption.Day, DateTime.Now,
                                                                    wvi.ExpirationDate.Value);
                    }
                    VoucherInfoList.Add(wvi);
                }
            }
            count = VoucherInfoList.Count;
            //获取默认支付方式
            DefPayType = 2;

            IsNoCanDraw = (DateTime.Now > DateTime.Parse(DateTime.Now.ToString("d") + " 22:59:59") &&
                           DateTime.Now <= DateTime.Parse(DateTime.Now.ToString("d") + " 23:59:59")) || (DateTime.Now >= DateTime.Parse(DateTime.Now.ToString("d") + " 00:00:00") &&
                                                                                                         DateTime.Now < DateTime.Parse(DateTime.Now.ToString("d") + " 00:10:00"));
        }