Exemple #1
0
        public ActionResult GroupIndex()
        {
            SalesGroupDAL sgdal  = new SalesGroupDAL();
            var           sglist = sgdal.GetAll().ToList().Select(t => new SalesGroupViewModel().CastModel(t));

            return(View(sglist));
        }
Exemple #2
0
        public IEnumerable <SelectListItem> GroupBySales(string id)
        {
            SalesGroupDAL dal   = new SalesGroupDAL();
            SalesManDAL   sd    = new SalesManDAL();
            var           sales = sd.Get(id);

            var viewList = new List <SelectListItem>();
            var list     = dal.GetAll();

            foreach (var vi in list)
            {
                SelectListItem se = new SelectListItem();
                se.Text  = vi.Name;
                se.Value = vi.ID.ToString();
                if (sales != null && sales.GroupID == vi.ID)
                {
                    se.Selected = true;;
                }
                viewList.Add(se);
            }
            viewList.Insert(0, new SelectListItem()
            {
                Value = string.Empty, Text = "请选择"
            });
            return(viewList);
        }
Exemple #3
0
        public ActionResult EditGroup(SalesGroupViewModel model)
        {
            SalesGroupDAL sgdal = new SalesGroupDAL();

            sgdal.Update(model.CastDB(model));
            sgdal.AcceptAllChange();
            return(GetBaseResponse <DistrictViewModel>(true));
        }
Exemple #4
0
        public ActionResult EditGroup(string id)
        {
            SalesGroupDAL sgdal = new SalesGroupDAL();
            var           model = new SalesGroupViewModel();

            model = model.CastModel(sgdal.Get(id));
            return(View(model));
        }
Exemple #5
0
        public ActionResult DeleteGroup(string id)
        {
            SalesGroupDAL sgdal = new SalesGroupDAL();
            var           model = sgdal.Get(id);

            sgdal.Delete(model);
            sgdal.AcceptAllChange();
            return(GetBaseResponse <DistrictViewModel>(true));
        }
Exemple #6
0
        public ActionResult CreateGroup(SalesGroupViewModel model)
        {
            SalesGroupDAL sgdal = new SalesGroupDAL();

            model.ID = Guid.NewGuid().ToString();
            sgdal.Add(model.CastDB(model));
            sgdal.AcceptAllChange();
            return(GetBaseResponse <DistrictViewModel>(true));
        }
Exemple #7
0
 public DayStatisticsBll()
 {
     _baseAuditDal  = new BaseAuditDAL();
     _salesGroupDal = new SalesGroupDAL();
     _mortgageDal   = new MortgageDAL();
     _log           = new LogManagerExtend();
     _baseCaseDal   = new BaseCaseDAL();
     _lendingDal    = new LendingDAL();
 }
 public AfterCaseController()
 {
     _auditDal               = new BaseAuditDAL();
     _salesGroupDal          = new SalesGroupDAL();
     _relationPersonAuditDal = new RelationPersonAuditDAL();
     _lendingDal             = new LendingDAL();
     _mortgageBll            = new MortgageBll();
     _dictionaryBll          = new DictionaryBLL();
     symm = new SymmCrypto(_Key, _IV);
 }
Exemple #9
0
        public ActionResult GetSalesGroup(string districtId)
        {
            SalesGroupDAL sgdal  = new SalesGroupDAL();
            var           sglist = sgdal.GetAll().Where(t => t.DistrictID == districtId && t.State == 1).Select(x => new
            {
                ID   = x.ID,
                Name = x.Name
            }).ToList();
            BaseResponse <object> br = new BaseResponse <object>();

            br.Status = "Success";
            br.Data   = sglist;
            return(Json(br, JsonRequestBehavior.AllowGet));
        }
Exemple #10
0
        public IEnumerable <SelectListItem> GroupList(string id)
        {
            SalesGroupDAL dal      = new SalesGroupDAL();
            var           viewList = new List <SelectListItem>();
            var           list     = dal.GetAll();

            foreach (var vi in list)
            {
                SelectListItem se = new SelectListItem();
                se.Text  = vi.Name;
                se.Value = vi.ID.ToString();
                if (id == vi.ID)
                {
                    se.Selected = true;;
                }
                viewList.Add(se);
            }
            return(viewList);
        }
        private void UpdateAuditCaseNum(BaseAuditDAL baseAuditDal, SalesGroupDAL salesGroupDal)
        {
            string[] caseNum = baseAuditDal.GetAll().Where(p => p.CaseNum != null).Select(p => p.CaseNum).Distinct().ToArray();
            caseNum.ForEach(p =>
            {
                var sameCaseNumCases = baseAuditDal.GetAllBase().Where(c => c.CaseNum == p).ToList();
                var salesGroupId     = sameCaseNumCases.First().SalesGroupID;

                var salesGroup = salesGroupDal.GetAll().First(t => t.ID == salesGroupId);
                sameCaseNumCases.ForEach(t =>
                {
                    t.CaseNum    = (Convert.ToInt32(t.CaseNum.Substring(4)) + 100000).ToString();
                    t.NewCaseNum = "L" + salesGroup.ShortCode + "-" + t.CaseNum;
                });

                baseAuditDal.UpdateRange(sameCaseNumCases);
                baseAuditDal.AcceptAllChange();
            });
        }
Exemple #12
0
        public ActionResult DatapermissionList(string roleid)
        {
            List <CheckBoxListModel> list = new List <CheckBoxListModel>();
            DistrictDAL       dtdal       = new DistrictDAL();
            SalesGroupDAL     sgdal       = new SalesGroupDAL();
            DictionaryDAL     dicdal      = new DictionaryDAL();
            DataPermissionDAL ddal        = new DataPermissionDAL();
            var dpuer     = ddal.GetAll().Where(t => t.RoleID == roleid).Select(t => t.DataPermissionID);
            var dataplist = dtdal.GetAll().Select(t => new { t.ID, t.Name })
                            .Union(dicdal.GetAll(t => t.ParentKey == "-ThirdPlatform").Select(t => new { ID = t.Path, Name = t.Text }))
                            .Union(sgdal.GetAll().Select(t => new { t.ID, t.Name }));

            foreach (var t in dataplist)
            {
                list.Add(new CheckBoxListModel(t.ID, t.Name, dpuer.Contains(t.ID)));
            }

            //为数据权限增加 自有资金
            list.Add(new CheckBoxListModel(CaseMode.ZiYouZiJin, "自有资金", dpuer.Contains(CaseMode.ZiYouZiJin)));
            //为数据权限增加 未选择
            list.Add(new CheckBoxListModel(CaseMode.WeiXuanZe, "未选择案件模式", dpuer.Contains(CaseMode.WeiXuanZe)));
            return(View(list));
        }
Exemple #13
0
 public SalesGroupBll()
 {
     _salesGroup = new SalesGroupDAL();
 }
Exemple #14
0
 public BaseCaseBll()
 {
     _baseCaseDal   = new BaseCaseDAL();
     _salesGroupDal = new SalesGroupDAL();
 }
        public void InsertHisCase()
        {
            var migDAL        = new MigTDAL();
            var personDAL     = new RelationPersonAuditDAL();
            var salesGroupDAL = new SalesGroupDAL();
            var miglist       = migDAL.GetAll();

            if (miglist.Any())
            {
                var salesGroups = salesGroupDAL.GetAll().ToList();

                int i = 1;
                foreach (var mig in miglist)
                {
                    var audit = new BaseAudit();
                    audit.ID      = Guid.NewGuid().ToString();
                    audit.CaseNum = i.ToString("d6");

                    audit.BorrowerName = mig.CO2;
                    audit.BankCard     = mig.CO30;
                    // 所属分公司名称 新的案件编号
                    switch (mig.CO4)
                    {
                    case "北京泓申":
                        audit.SalesGroupID = salesGroups.First(x => x.Name == "北京泓申投资管理有限公司").ID;
                        audit.DistrictID   = salesGroups.First(x => x.Name == "北京泓申投资管理有限公司").DistrictID;
                        audit.SalesID      = "bff3003c-bfcb-4c34-898d-c9799db56e68";

                        break;

                    case "诚驰":
                        audit.SalesGroupID = salesGroups.First(x => x.Name == "上海诚驰泓申投资管理有限公司").ID;
                        audit.DistrictID   = salesGroups.First(x => x.Name == "上海诚驰泓申投资管理有限公司").DistrictID;
                        audit.SalesID      = "0d17d335-6c79-4130-82d5-16173c142911";

                        break;

                    case "上海泓申":
                        audit.SalesGroupID = salesGroups.First(x => x.Name == "上海泓申投资管理有限公司").ID;
                        audit.DistrictID   = salesGroups.First(x => x.Name == "上海泓申投资管理有限公司").DistrictID;
                        audit.SalesID      = "34965801-2ba7-4a80-a40b-7aff4f5c36a7";
                        break;

                    case "铉宇":
                        audit.SalesGroupID = salesGroups.First(x => x.Name == "上海铉宇金融信息服务有限公司").ID;
                        audit.DistrictID   = salesGroups.First(x => x.Name == "上海铉宇金融信息服务有限公司").DistrictID;
                        audit.SalesID      = "f68acef9-b478-4ab0-ac43-ccaf6bf77988";
                        break;

                    case "银携":
                        audit.SalesGroupID = salesGroups.First(x => x.Name == "上海银携投资管理有限公司").ID;
                        audit.DistrictID   = salesGroups.First(x => x.Name == "上海银携投资管理有限公司").DistrictID;
                        audit.SalesID      = "028bcc6f-dc7d-4994-9f2e-196b5cf974ad";

                        break;

                    default:
                        audit.NewCaseNum = "HIS" + "-" + audit.CaseNum;
                        break;
                    }
                    audit.EarnestMoney = string.IsNullOrEmpty(mig.CO7) ? (decimal?)null : Convert.ToDecimal(mig.CO7);
                    audit.LenderName   = mig.CO8;
                    audit.NewCaseNum   = "HIS" + "-" + audit.CaseNum;
                    // 客户贷款期数
                    switch (mig.CO9)
                    {
                    case "1": audit.Term = "-LoanTerm-1M"; break;

                    case "2": audit.Term = "-LoanTerm-2M"; break;

                    case "3": audit.Term = "-LoanTerm-3M"; break;

                    case "4": audit.Term = "-LoanTerm-4M"; break;

                    case "5": audit.Term = "-LoanTerm-5M"; break;

                    case "6": audit.Term = "-LoanTerm-6M"; break;

                    case "12": audit.Term = "-LoanTerm-12M"; break;

                    case "24": audit.Term = "-LoanTerm-24M"; break;

                    default:
                        audit.Term = "-LoanTerm-2M"; break;
                        break;
                    }
                    audit.AuditTerm = audit.Term;

                    audit.LendingDate = string.IsNullOrEmpty(mig.CO10) ? default(DateTime?) : Convert.ToDateTime(mig.CO10);
                    audit.PaymentDate = string.IsNullOrEmpty(mig.CO11) ? default(DateTime?) : Convert.ToDateTime(mig.CO11);
                    audit.LoanAmount  = string.IsNullOrEmpty(mig.CO13) ? default(decimal?) : Convert.ToDecimal(mig.CO13);
                    audit.AuditAmount = audit.LoanAmount;

                    audit.AnnualRate = string.IsNullOrEmpty(mig.CO14) ? null : (decimal?)Convert.ToDecimal(mig.CO14);
                    audit.AuditRate  = audit.AnnualRate;

                    // 资金方名称
                    switch (mig.CO18)
                    {
                    case "点融": audit.ThirdParty = "-ThirdPlatform-DianRong"; break;

                    case "聚财猫": audit.ThirdParty = "-ThirdPlatform-JuCaiMao"; break;

                    case "米缸": audit.ThirdParty = "-ThirdPlatform-MiGang"; break;

                    case "诺亚": audit.ThirdParty = "-ThirdPlatform-NuoYa"; break;

                    case "挖财": audit.ThirdParty = "-ThirdPlatform-WaCai"; break;

                    default:
                        break;
                    }
                    audit.ThirdPartyAuditRate   = string.IsNullOrEmpty(mig.CO19) ? null : (decimal?)Convert.ToDecimal(mig.CO19);
                    audit.ThirdPartyAuditAmount = string.IsNullOrEmpty(mig.CO28) ? null : (decimal?)Convert.ToDecimal(mig.CO28);
                    switch (mig.CO27)
                    {
                    case "1": audit.ThirdPartyAuditTerm = "-LoanTerm-1M"; break;

                    case "2": audit.ThirdPartyAuditTerm = "-LoanTerm-2M"; break;

                    case "3": audit.ThirdPartyAuditTerm = "-LoanTerm-3M"; break;

                    case "4": audit.ThirdPartyAuditTerm = "-LoanTerm-4M"; break;

                    case "5": audit.ThirdPartyAuditTerm = "-LoanTerm-5M"; break;

                    case "6": audit.ThirdPartyAuditTerm = "-LoanTerm-6M"; break;

                    case "12": audit.ThirdPartyAuditTerm = "-LoanTerm-12M"; break;

                    case "24": audit.ThirdPartyAuditTerm = "-LoanTerm-24M"; break;

                    default:
                        break;
                    }
                    // 贷款模式
                    switch (mig.CO20)
                    {
                    case "居间": audit.CaseMode = "-CaseMode-JuJian"; break;

                    case "债转": audit.CaseMode = "-CaseMode-ZhaiZhuan"; break;

                    default: audit.CaseMode = "-CaseMode-ZiYouZiJin"; break;
                    }

                    audit.OpeningBank = mig.CO23;
                    audit.BankCard    = mig.CO26;
                    audit.CaseDetail  = mig.CO30;
                    audit.CreateTime  = DateTime.Now;
                    audit.CreateUser  = "******";
                    audit.CaseStatus  = "After";



                    var person = new RelationPersonAudit();
                    person.ID           = Guid.NewGuid().ToString();
                    person.AuditID      = audit.ID;
                    person.Name         = mig.CO2;
                    person.RelationType = "-PersonType-JieKuanRen";
                    switch (mig.CO5)
                    {
                    case "香港居民身份证":
                        person.IdentificationType = "-DocType-HongKong";
                        break;

                    case "身份证":
                        person.IdentificationType = "-DocType-IDCard";
                        break;

                    case "台湾同胞来往内地通行证":
                        person.IdentificationType = "-DocType-Taiwan";
                        break;

                    default:
                        person.IdentificationType = "-DocType-Passport";
                        break;
                    }


                    person.IdentificationNumber = mig.CO6;

                    personDAL.Add(person);

                    var lend    = new Com.HSJF.Framework.EntityFramework.Model.Lending.Lending();
                    var lenddal = new LendingDAL();
                    lend.ID       = audit.ID;
                    lend.Borrower = audit.BorrowerName;
                    //lend.ContactNumber = mig.CO0;
                    lend.ContractAmount = audit.AuditAmount;
                    lend.CreateTime     = DateTime.Now.ToShortDateString();
                    lend.CreateUser     = "******";
                    lend.CustomerName   = audit.BorrowerName;
                    lend.LendTime       = audit.LendingDate;
                    lend.PaymentDay     = string.IsNullOrEmpty(mig.CO12) ? default(int?) : Convert.ToInt32(mig.CO12);
                    lenddal.Add(lend);

                    _baseAuditDal.Add(audit);
                    mig.Status = audit.NewCaseNum;
                    migDAL.Update(mig);
                    i++;
                }
            }
            _baseAuditDal.AcceptAllChange();
            migDAL.AcceptAllChange();
        }