Beispiel #1
0
        //中止债权转让
        public void StopTransfer()
        {
            Guid userId     = WebUserAuth.UserId.Value;
            Guid transferId = Guid.Empty;

            Guid.TryParse(Context.Request["transferid"], out transferId);
            string            code      = Context.Request["code"];
            UserBLL           bll       = new UserBLL();
            UserBasicInfoInfo userModel = bll.GetUserBasicInfoModelById(userId);

            if (userModel != null && !string.IsNullOrEmpty(userModel.TelNo))
            {
                int msgCode = new TuanDai.PortalSystem.BLL.CodeRecordBLL().CheckCodeRecord(code, userModel.TelNo, MsCodeType.PhoneCode, MsCodeType2.PCStopTransferCode, userId, true);
                /*1:验证通过;0:参数错误;-1:验证码不存在;-2:验证码已过期;-3:验证码已使用;-4:验证已过期*/
                string msg = string.Empty;
                switch (msgCode)
                {
                case 0:
                    msg = "参数错误";
                    break;

                case -1:
                    msg = "验证码不存在";
                    break;

                case -2:
                    msg = "验证码已过期";
                    break;

                case -3:
                    msg = "验证码已使用";
                    break;

                case -4:
                    msg = "验证已过期";
                    break;

                default:
                    break;
                }
                if (msgCode != 1)
                {
                    PrintJson(msgCode.ToString(), msg);
                    return;
                }
                int result = new TuanDai.PortalSystem.BLL.SubScriberansferBLL().StopTransfer(userId, transferId);
                if (result != 1)
                {
                    PrintJson(result.ToString(), "终止转让失败");
                    return;
                }
                PrintJson(result.ToString(), "终止转让成功");
            }
        }
Beispiel #2
0
        //获取债权转让列表
        public void GetZQZRCanTransferList()
        {
            int    pageSize  = GlobalUtils.PageSize;
            int    pageIndex = Tool.SafeConvert.ToInt32(Context.Request.Form["pageIndex"], 1);
            string pStatus   = WEBRequest.GetFormString("status");

            if (pageIndex < 1)
            {
                pageIndex = 1;
            }
            Guid userid = WebUserAuth.UserId.HasValue ? WebUserAuth.UserId.Value : Guid.Empty;

            if (userid == Guid.Empty)
            {
                PrintJson("0", "您还未登录!");
                return;
            }

            int outputStatus = 0;

            if (pStatus == "CanTran")
            {
                #region 可转让标
                int count = 0;
                List <NegotiableInfo>    list     = new TuanDai.PortalSystem.BLL.SubScriberansferBLL().GetNegotiableList(userid, 3, pageIndex, pageSize, out outputStatus, out count);
                List <NegotiableInfoExt> dataList = new List <NegotiableInfoExt>();

                if (outputStatus == -1)
                {
                    PrintJson("0", "有发净股标或者逾期垫付未还");
                }
                else
                {
                    foreach (NegotiableInfo item in list)
                    {
                        NegotiableInfoExt extItem = new NegotiableInfoExt();
                        extItem.ProjectId         = item.ProjectId;
                        extItem.Id                = item.Id;
                        extItem.Title             = item.Title;
                        extItem.TotalRefundMonths = item.TotalRefundMonths;
                        extItem.RefundedMonths    = item.RefundedMonths;
                        extItem.TypeName          = ToolStatus.ConvertProjectType(item.Type);
                        extItem.DueInAmount       = ToolStatus.ConvertLowerMoney(item.Amount + item.InterestAmout);
                        extItem.PreCycDateStr     = item.PreCycDate.ToString("yyyy-MM-dd");
                        extItem.TenderModeName    = GetTenderMode(item.TenderMode);
                        extItem.InterestRate      = ToolStatus.DeleteZero(item.InterestRate);
                        extItem.RepaymentType     = ToolStatus.ConvertRepaymentType(item.RepaymentType);
                        dataList.Add(extItem);
                    }
                }
                if (count == 0)
                {
                    PrintJson("0", "没有找到数据");
                    return;
                }
                int pageCount = GetPageCount(count, pageSize);
                var objData   = new { result = "1", msg = "", pageCount = pageCount, list = dataList };
                PrintJson(objData);
                #endregion
            }
            else if (pStatus == "Traning")
            {
                #region 转让中
                int transferCount = 0;
                List <SubScribeTransferInfo> tempList = new TuanDai.PortalSystem.BLL.SubScriberansferBLL().GetSubScribeTransferList(userid, 1, pageSize, pageIndex, out transferCount);
                if (transferCount == 0)
                {
                    PrintJson("0", "没有找到数据");
                    return;
                }
                int pageCount = GetPageCount(transferCount, pageSize);
                List <SubScribeTransferInfoExt> dataList = new List <SubScribeTransferInfoExt>();
                foreach (SubScribeTransferInfo item in tempList)
                {
                    SubScribeTransferInfoExt extItem = new SubScribeTransferInfoExt();
                    extItem.ProjectId         = item.ProjectId;
                    extItem.Id                = item.Id;
                    extItem.Title             = item.Title;
                    extItem.SumTransferAmount = ToolStatus.ConvertLowerMoney(item.sumTransferAmount);
                    extItem.ProgressStr       = Convert.ToDouble(item.Progress).ToString("f1");
                    extItem.LastTimeStr       = item.remainTime;
                    extItem.AddDate           = item.AddDate;
                    extItem.TotalAmountStr    = ToolStatus.ConvertLowerMoney(item.TotalAmount);
                    DateTime EndTransferDate = DateTime.Parse(item.AddDate.ToString("yyyy-MM-dd") + " 23:59:59");
                    if (DateTime.Now > EndTransferDate)
                    {
                        extItem.LastSecond = 0;
                    }
                    else
                    {
                        extItem.LastSecond = Convert.ToInt32((EndTransferDate - DateTime.Now).TotalSeconds);
                    }
                    dataList.Add(extItem);
                }
                var objData = new { result = "1", msg = "", pageCount = pageCount, list = dataList };
                PrintJson(objData);
                #endregion
            }
            else
            {
                #region 已完成
                int transferCount = 0;
                List <SubScribeTransferInfo> tempList = new TuanDai.PortalSystem.BLL.SubScriberansferBLL().GetSubScribeTransferList(userid, 2, pageSize, pageIndex, out transferCount);
                if (transferCount == 0)
                {
                    PrintJson("0", "没有找到数据");
                    return;
                }
                int pageCount = GetPageCount(transferCount, pageSize);
                List <SubScribeTransferInfoExt> dataList = new List <SubScribeTransferInfoExt>();
                foreach (SubScribeTransferInfo item in tempList)
                {
                    SubScribeTransferInfoExt extItem = new SubScribeTransferInfoExt();
                    extItem.ProjectId         = item.ProjectId;
                    extItem.Id                = item.Id;
                    extItem.Title             = item.Title;
                    extItem.SumTransferAmount = ToolStatus.ConvertLowerMoney(item.sumTransferAmount);
                    extItem.ProgressStr       = Convert.ToDouble(item.Progress).ToString("f1");
                    dataList.Add(extItem);
                }
                var objData = new { result = "1", msg = "", pageCount = pageCount, list = dataList };
                PrintJson(objData);
                #endregion
            }
        }