Example #1
0
        private void GetContractInfo(string key)
        {
            string contactno = this.key;
            string strSQL    = @"SELECT a.ProductName, a.PlanAmount,a.ProjectTypes,a.Deadline,b.RepeatInvestType,
                             b.YearRate, b.MinYearRate, a.StartDate,a.UnitAmount, b.Amount as JoinAmount, b.OrderQty,
                             b.UserId, b.OrderDate, c.TypeWord, a.ProductTypeId,a.ExitLockMonth
                             FROM dbo.We_Product a WITH(NOLOCK)
                             left JOIN dbo.We_Order b WITH(NOLOCK) on b.ProductId=a.Id
                             inner join We_ProductType c  WITH(NOLOCK) on c.Id=a.ProductTypeId
                             WHERE b.Id=@WeOrderId";
            var    dyParams  = new Dapper.DynamicParameters();

            dyParams.Add("@WeOrderId", contactno);
            model = TuanDai.DB.TuanDaiDB.QueryFirstOrDefault <MyWeOrderInfo>(TdConfig.ApplicationName, TdConfig.DBRead, strSQL, ref dyParams);
            if (model == null)
            {
                model = new MyWeOrderInfo();
            }

            this.subBasicModel = userbll.GetUserBasicInfoModelById(model.UserId);

            WeFTBBLL ftbll = new WeFTBBLL();

            ftbRateList = this.GetWeFTBRateList(model.ProductTypeId, model.StartDate ?? DateTime.Today);
            if (ftbRateList == null)
            {
                ftbRateList = new List <WeProductFTBRateInfo>();
            }
        }
Example #2
0
        private bool GetData()
        {
            //获取项目信息
            if (GlobalUtils.IsRedis && GlobalUtils.IsWePlanRedis)
            {
                this.model = new WeProductBLL().GetWePlanByRedis(TypeId, projectId.Value, IsPreSell, TdConfig.ApplicationName);
            }
            else
            {
                this.model = bll.GetWeProductInfo(projectId.Value);
            }
            if (model == null || model.IsFTB == false)
            {
                return(false);
            }

            #region 判断满标
            if (model.StartDate > DateTime.Now && model.StatusId == 1)
            {
                IsWeFinish = false;
            }
            else if (model.StartDate < DateTime.Now && model.OrderQty != model.TotalQty)
            {
                IsWeFinish = false;
            }
            else
            {
                IsWeFinish = true;
            }
            #endregion

            #region 判断新手标
            if (!model.IsNewHand)
            {
                WeFTBBLL ftbll = new WeFTBBLL();
                FTBRateList = this.GetWeFTBRateList(model.ProductTypeId ?? 0, model.StartDate ?? DateTime.Today);
                if (FTBRateList == null)
                {
                    FTBRateList = new List <WeProductFTBRateInfo>();
                }

                //补充提前退出前几个月的数据
                if (FTBRateList.Any())
                {
                    WeProductFTBRateInfo        firstRate = FTBRateList[0];
                    List <WeProductFTBRateInfo> tmpList   = new List <WeProductFTBRateInfo>();
                    for (int i = 1; i < model.ExitLockMonth; i++)
                    {
                        tmpList.Add(new WeProductFTBRateInfo()
                        {
                            MonthType = i, ProductTypeId = model.ProductTypeId ?? 0, YearRate = firstRate.YearRate
                        });
                    }
                    if (tmpList.Any())
                    {
                        FTBRateList.InsertRange(0, tmpList);
                    }
                }
                FTBRateList = FTBRateList.OrderByDescending(p => p.MonthType).ToList();
            }
            #endregion

            decimal deadLineType = model.DeadType == 1 ? 12 : 365;
            PreInterestRate = decimal.Parse("10000") * (model.Deadline ?? 0) * ((model.YearRate ?? 0) + (model.TuandaiRedRate ?? 0)) * decimal.Parse("0.01") / deadLineType;
            EbaoMultiple    = int.Parse(Math.Ceiling(model.YearRate.Value / decimal.Parse("2.5")).ToString());
            EbaoInterest    = GetEbaoMultipleInterest(10000);

            GetLimitInvestMoney();

            WebSettingBLL webSettingBll = new WebSettingBLL();

            preSellSet    = webSettingBll.GetWebSettingInfo("6F9D3B77-C15C-4A5A-B883-21004E10BE29");
            curSellSet    = webSettingBll.GetWebSettingInfo("B11558CB-3C6B-4DAD-9D2F-D6D2DE13CCF7");
            sellSet518    = webSettingBll.GetWebSettingInfo("5E02F517-E6FC-4451-8232-378377837EC1");
            IsPreView1218 = System.Configuration.ConfigurationManager.AppSettings["IsPreView1218"];
            if (IsPreView1218 == "1")
            {
                preSellSet.Param1Value = DateTime.Today.ToString("yyyy-MM-dd");
                preSellSet.Param2Value = DateTime.Today.ToString("yyyy-MM-dd 23:59:59");
            }
            else if (IsPreView1218 == "2")
            {
                preSellSet.Param1Value = DateTime.Today.AddDays(-1).ToString("yyyy-MM-dd");
                preSellSet.Param2Value = DateTime.Today.AddDays(-1).ToString("yyyy-MM-dd 23:59:59");

                curSellSet.Param1Value = DateTime.Today.ToString("yyyy-MM-dd");
                curSellSet.Param2Value = DateTime.Today.ToString("yyyy-MM-dd 23:59:59");
            }
            return(true);
        }
Example #3
0
        /// <summary>
        /// 获取复投宝债仅信息
        /// </summary>
        public void GetWeFtbObligatoryList()
        {
            Guid?productId = SafeConvert.ToGuid(WEBRequest.GetFormString("projectid"));
            int  pageSize, pageIndex, totalCount;

            pageSize = 15;
            int.TryParse(Context.Request["pageIndex"], out pageIndex);
            WeFTBBLL weFtBll = new WeFTBBLL();

            List <FTBInvestProjectInfo> ftbInvestProjectInfoList = weFtBll.GetFTBObligatoryList(productId.Value, pageSize, pageIndex, out totalCount);
            List <FTBInvestProjectInfo> newList = new List <FTBInvestProjectInfo>();

            for (int i = 0; i < ftbInvestProjectInfoList.Count; i++)
            {
                var borrowerName = ftbInvestProjectInfoList[i].BorrowerName;
                var phone        = ftbInvestProjectInfoList[i].TelNo;
                var IdentityCard = ftbInvestProjectInfoList[i].IdentityCard;
                var address      = ftbInvestProjectInfoList[i].Address.ToText();
                if (borrowerName.Length > 0)
                {
                    borrowerName = borrowerName.Substring(0, 1) + "**";
                }
                if (!phone.IsEmpty())
                {
                    if (phone.Length > 11)
                    {
                        phone = phone.Left(11);
                    }
                    phone = StringHandler.MaskTelNo(phone);
                }

                if (!string.IsNullOrWhiteSpace(IdentityCard))
                {
                    if (IdentityCard.Length > 18)
                    {
                        IdentityCard = IdentityCard.Left(18);
                    }
                    IdentityCard = StringHandler.MaskCardNo(IdentityCard);
                }

                if (address.Length > 5)
                {
                    address = address.Substring(0, 6) + "...";
                }
                FTBInvestProjectInfo tempModel = new FTBInvestProjectInfo();
                tempModel.Address      = address;
                tempModel.Amount       = ftbInvestProjectInfoList[i].Amount;
                tempModel.BorrowerName = borrowerName;
                tempModel.Id           = ftbInvestProjectInfoList[i].Id;
                tempModel.InvestDate   = ftbInvestProjectInfoList[i].InvestDate;
                tempModel.ProductName  = ftbInvestProjectInfoList[i].ProductName;
                tempModel.ProjectTitle = ftbInvestProjectInfoList[i].ProjectTitle;
                tempModel.ProjectId    = ftbInvestProjectInfoList[i].ProjectId;
                tempModel.TelNo        = phone;
                tempModel.IdentityCard = IdentityCard;
                newList.Add(tempModel);
            }
            this.Context.Response.Write(JsonConvert.SerializeObject(
                                            new
            {
                result     = totalCount > 0 ? 1 : 0,
                totalcount = totalCount,
                msg        = newList
            }));

            this.Context.Response.End();
        }