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); }
public ActionResult SubmitLending(LendingViewModel model) { var response = new BaseResponse <LendingViewModel>(); var relationPersonauditDal = new RelationPersonAuditDAL(); var baseAuditDal = new BaseAuditDAL(); //var relationstatebll = new RelationStateBLL(); #region 验证 List <ErrorMessage> em = new List <ErrorMessage>(); if (!ModelState.IsValid) { foreach (var e in ModelState.Keys) { if (ModelState[e].Errors.Any()) { if (e.Contains("FileName")) { continue; } if (string.IsNullOrEmpty(ModelState[e].Errors[0].ErrorMessage)) { continue; } var error = new ErrorMessage(); error.Key = e; error.Message = ModelState[e].Errors[0].ErrorMessage; em.Add(error); } } } if (em.Any()) { response.Status = "Failed"; response.Message = em.ToArray(); response.Data = null; return(Json(response, JsonRequestBehavior.AllowGet)); } #endregion 验证 var baseaduit = baseAuditDal.GetAuthorizeAndSelf(model.ID, CurrentUser); if (baseaduit == null && baseaduit.CaseStatus != CaseStatus.Lending) { response.Status = "Failed"; return(Json(response, JsonRequestBehavior.AllowGet)); } var db = new Lending(); LendingDAL bd = new LendingDAL(); db = model.CastDB(model); // 合同文件 db.LendFile = SaveFiles(model.LendFile, model.ID, model.ID); //IEnumerable<RelationPersonAudit> relationPersonList = relationPersonauditDal.FindByCaseID(baseaduit.ID).ToList(); //if (relationPersonList != null && relationPersonList.Any()) //{ // foreach (var item in relationPersonList) // { // var relationbllModel = new RelationStateBLLModel() // { // Number = item.IdentificationNumber, // Desc = "Bind" // }; // relationstatebll.UpdateLockRelationState(relationbllModel); // } //} var pushResult = PushToHats(model.CaseNum); if (pushResult.IsSuccess) { bd.SubmitCase(db, CurrentUser.UserName, model.Description); bd.AcceptAllChange(); response.Status = "Success"; } else { response.Status = StatusEnum.Failed.ToString(); if (pushResult.Message.IsNullOrWhiteSpace() || pushResult.Message.IsNullOrWhiteSpace()) { response.Message = new ErrorMessage[] { new ErrorMessage("", "推送失败") }; } else { response.Message = new ErrorMessage[] { new ErrorMessage("", pushResult.Message) }; } } return(Json(response)); }
public void SaveRelationPersons <T>(ICollection <RelationPerson> relationPersons, string auditId) where T : class, new() { Type type = typeof(T); if (type.Equals(typeof(RelationPersonAudit))) { RelationPersonAuditDAL rpDAL = new RelationPersonAuditDAL(); foreach (var model in relationPersons) { #region 关系人信息集合 RelationPersonAudit rpModel = new RelationPersonAudit() { ID = Guid.NewGuid().ToString(), AuditID = auditId, RelationType = model.RelationType, BorrowerRelation = model.BorrowerRelation, Name = model.Name, IdentificationType = model.IdentificationType, IdentificationNumber = model.IdentificationNumber, ExpiryDate = model.ExpiryDate, Birthday = model.Birthday, MaritalStatus = model.MaritalStatus, SalaryDescription = model.SalaryDescription, Warranty = model.Warranty, IsCoBorrower = model.IsCoBorrower, Sequence = model.Sequence }; // 上传身份证复印件 rpModel.IdentificationFile = SaveFiles(model.IdentificationFile, rpModel.ID, auditId); // 上传婚姻证明文件保存 rpModel.MarryFile = SaveFiles(model.MarryFile, rpModel.ID, auditId); // 上传单身证明文件保存 rpModel.SingleFile = SaveFiles(model.SingleFile, rpModel.ID, auditId); // 上传出生证明文件保存 rpModel.BirthFile = SaveFiles(model.BirthFile, rpModel.ID, auditId); // 上传户口本复印件文件保存 rpModel.AccountFile = SaveFiles(model.AccountFile, rpModel.ID, auditId); // 上传收入证明(受薪水人士)文件保存 rpModel.SalaryPersonFile = SaveFiles(model.SalaryPersonFile, rpModel.ID, auditId); // 上传收入证明(自雇有执照)文件保存 rpModel.SelfLicenseFile = SaveFiles(model.SelfLicenseFile, rpModel.ID, auditId); // 上传收入证明(自雇无执照)文件保存 rpModel.SelfNonLicenseFile = SaveFiles(model.SelfNonLicenseFile, rpModel.ID, auditId); // 银行流水 rpModel.BankFlowFile = SaveFiles(model.BankFlowFile, rpModel.ID, auditId); // 个人征信 rpModel.IndividualFile = SaveFiles(model.IndividualFile, rpModel.ID, auditId); // 其他证明 rpModel.OtherFile = SaveFiles(model.OtherFile, rpModel.ID, auditId); rpDAL.Add(rpModel); #endregion 关系人信息集合 #region 保存关系人地址信息集合 SaveAddresses <AddressAudit>(model.Addresses, rpModel.ID); #endregion 保存关系人地址信息集合 #region 保存关系人紧急联系人信息集合 SaveEmergencyContacts <EmergencyContactAudit>(model.EmergencyContacts, rpModel.ID); #endregion 保存关系人紧急联系人信息集合 #region 保存关系人联系方式信息集合 SaveContacts <ContactAudit>(model.Contacts, rpModel.ID); #endregion 保存关系人联系方式信息集合 #region 关系人相关企业信息集合 SaveRelationEnterprises <RelationEnterpriseAudit>(model.RelationEnterprises, rpModel.ID, auditId); #endregion 关系人相关企业信息集合 } } else if (type.Equals(typeof(RelationPerson))) { RelationPersonDAL rpDAL = new RelationPersonDAL(); foreach (var model in relationPersons) { #region 关系人信息集合 RelationPerson rpModel = new RelationPerson() { ID = Guid.NewGuid().ToString(), RelationType = model.RelationType, BorrowerRelation = model.BorrowerRelation, Name = model.Name, IdentificationType = model.IdentificationType, IdentificationNumber = model.IdentificationNumber, ExpiryDate = model.ExpiryDate, Birthday = model.Birthday, MaritalStatus = model.MaritalStatus, SalaryDescription = model.SalaryDescription, Warranty = model.Warranty, IsCoBorrower = model.IsCoBorrower, CaseID = auditId, Sequence = model.Sequence }; // 上传身份证复印件 rpModel.IdentificationFile = SaveFiles(model.IdentificationFile, rpModel.ID, auditId); // 上传婚姻证明文件保存 rpModel.MarryFile = SaveFiles(model.MarryFile, rpModel.ID, auditId); // 上传单身证明文件保存 rpModel.SingleFile = SaveFiles(model.SingleFile, rpModel.ID, auditId); // 上传出生证明文件保存 rpModel.BirthFile = SaveFiles(model.BirthFile, rpModel.ID, auditId); // 上传户口本复印件文件保存 rpModel.AccountFile = SaveFiles(model.AccountFile, rpModel.ID, auditId); // 上传收入证明(受薪水人士)文件保存 rpModel.SalaryPersonFile = SaveFiles(model.SalaryPersonFile, rpModel.ID, auditId); // 上传收入证明(自雇有执照)文件保存 rpModel.SelfLicenseFile = SaveFiles(model.SelfLicenseFile, rpModel.ID, auditId); // 上传收入证明(自雇无执照)文件保存 rpModel.SelfNonLicenseFile = SaveFiles(model.SelfNonLicenseFile, rpModel.ID, auditId); // 银行流水 rpModel.BankFlowFile = SaveFiles(model.BankFlowFile, rpModel.ID, auditId); // 个人征信 rpModel.IndividualFile = SaveFiles(model.IndividualFile, rpModel.ID, auditId); // 其他证明 rpModel.OtherFile = SaveFiles(model.OtherFile, rpModel.ID, auditId); rpDAL.Add(rpModel); #endregion 关系人信息集合 #region 保存关系人地址信息集合 SaveAddresses <Address>(model.Addresses, rpModel.ID); #endregion 保存关系人地址信息集合 #region 保存关系人紧急联系人信息集合 SaveEmergencyContacts <EmergencyContact>(model.EmergencyContacts, rpModel.ID); #endregion 保存关系人紧急联系人信息集合 #region 保存关系人联系方式信息集合 SaveContacts <Contact>(model.Contacts, rpModel.ID); #endregion 保存关系人联系方式信息集合 #region 关系人相关企业信息集合 SaveRelationEnterprises <RelationEnterprise>(model.RelationEnterprises, rpModel.ID, auditId); #endregion 关系人相关企业信息集合 } } }
/// <summary> /// 保存关系人信息集合 /// </summary> /// <param name="RelationPersons"></param> /// <param name="auditId"></param> public void SaveRelationPersons(ICollection <RelationPerson> relationPersons, string auditId) { RelationPersonAuditDAL rpDAL = new RelationPersonAuditDAL(); foreach (var model in relationPersons) { RelationPersonAudit rpModel = new RelationPersonAudit(); #region 关系人信息集合 rpModel.ID = Guid.NewGuid().ToString(); rpModel.AuditID = auditId; rpModel.RelationType = model.RelationType; rpModel.BorrowerRelation = model.BorrowerRelation; rpModel.Name = model.Name; rpModel.IdentificationType = model.IdentificationType; rpModel.IdentificationNumber = model.IdentificationNumber; rpModel.ExpiryDate = model.ExpiryDate; rpModel.Birthday = model.Birthday; rpModel.MaritalStatus = model.MaritalStatus; rpModel.SalaryDescription = model.SalaryDescription; rpModel.Warranty = model.Warranty; rpModel.IsCoBorrower = model.IsCoBorrower; rpModel.Sequence = model.Sequence; // 上传身份证复印件 rpModel.IdentificationFile = SaveFiles(model.IdentificationFile, rpModel.ID, auditId); // 上传婚姻证明文件保存 rpModel.MarryFile = SaveFiles(model.MarryFile, rpModel.ID, auditId); // 上传单身证明文件保存 rpModel.SingleFile = SaveFiles(model.SingleFile, rpModel.ID, auditId); // 上传出生证明文件保存 rpModel.BirthFile = SaveFiles(model.BirthFile, rpModel.ID, auditId); // 上传户口本复印件文件保存 rpModel.AccountFile = SaveFiles(model.AccountFile, rpModel.ID, auditId); // 上传收入证明(受薪水人士)文件保存 rpModel.SalaryPersonFile = SaveFiles(model.SalaryPersonFile, rpModel.ID, auditId); // 上传收入证明(自雇有执照)文件保存 rpModel.SelfLicenseFile = SaveFiles(model.SelfLicenseFile, rpModel.ID, auditId); // 上传收入证明(自雇无执照)文件保存 rpModel.SelfNonLicenseFile = SaveFiles(model.SelfNonLicenseFile, rpModel.ID, auditId); // 银行流水 rpModel.BankFlowFile = SaveFiles(model.BankFlowFile, rpModel.ID, auditId); // 个人征信 rpModel.IndividualFile = SaveFiles(model.IndividualFile, rpModel.ID, auditId); // 其他证明 rpModel.OtherFile = SaveFiles(model.OtherFile, rpModel.ID, auditId); rpDAL.Add(rpModel); #endregion 关系人信息集合 #region 保存关系人地址信息集合 SaveAddresses(model.Addresses, rpModel.ID); #endregion 保存关系人地址信息集合 #region 保存关系人紧急联系人信息集合 SaveEmergencyContacts(model.EmergencyContacts, rpModel.ID); #endregion 保存关系人紧急联系人信息集合 #region 保存关系人联系方式信息集合 SaveContacts(model.Contacts, rpModel.ID); #endregion 保存关系人联系方式信息集合 #region 关系人相关企业信息集合 SaveRelationEnterprises <RelationEnterpriseAudit>(model.RelationEnterprises, rpModel.ID, auditId); #endregion 关系人相关企业信息集合 } }
/// <summary> /// 签约失败,退回 /// </summary> /// <param name="id">案件Id</param> /// <param name="Description">退回理由</param> /// <returns></returns> public ActionResult RejectMortgage(string id, string Description, string RejectReason) { var response = new BaseResponse <string>(); var baseAuditDal = new BaseAuditDAL(); var entity = baseAuditDal.GetAuthorizeAndSelf(id, CurrentUser); if (entity == null) { response.Status = "Failed"; response.Message = new ErrorMessage[] { new ErrorMessage("权限", "权限不足") { } }; return(Json(response)); } //RelationStateBLL relationstatebll = new RelationStateBLL(); RelationPersonAuditDAL relationpersonauditdal = new RelationPersonAuditDAL(); CollateralAuditDAL collateralauditdal = new CollateralAuditDAL(); var baseaduit = _baseAuditDal.Get(id); if (baseaduit == null && baseaduit.CaseStatus != CaseStatus.PublicMortgage) { response.Status = "Failed"; return(Json(response, JsonRequestBehavior.AllowGet)); } //IEnumerable<RelationPersonAudit> relationPersonList = relationpersonauditdal.FindByCaseID(baseaduit.ID).ToList(); //IEnumerable<CollateralAudit> collateralauditList = collateralauditdal.FindByAuditID(baseaduit.ID).ToList(); //if (relationPersonList.Any()) //{ // foreach (var item in relationPersonList) // { // //RelationState Relation = relationstatebll.QueryRelationState(s => s.RelationNumber.Equals(item.IdentificationNumber)); // //if (Relation != null) // //{ // // Relation.IsLock = 0; // // Relation.CreateTime = DateTime.Now; // // relationstatebll.UpdateRelationState(Relation); // //} // RelationStateBLLModel RelationbllModel = new RelationStateBLLModel() // { // Number = item.IdentificationNumber, // }; // relationstatebll.UpdateLockRelationState(RelationbllModel); // } //} //if (collateralauditList.Any()) //{ // foreach (var item in collateralauditList) // { // //RelationState Relation = relationstatebll.QueryRelationState(s => s.RelationNumber.Equals(item.HouseNumber)); // //if (Relation != null) // //{ // // Relation.IsLock = 0; // // Relation.CreateTime = DateTime.Now; // // relationstatebll.UpdateRelationState(Relation); // //} // RelationStateBLLModel RelationbllModel = new RelationStateBLLModel() // { // Number = item.HouseNumber, // }; // relationstatebll.UpdateLockRelationState(RelationbllModel); // } //} var pushResult = _mortgagePush.Reject(baseaduit.NewCaseNum); if (pushResult.IsSuccess) { response.Status = _mortgageDal.RejectCase(id, CurrentUser.UserName, Description, RejectReason) ? "Success" : "Failed"; } else { response.Status = StatusEnum.Failed.ToString(); response.Message = new[] { new ErrorMessage("", pushResult.Message) }; } return(Json(response, JsonRequestBehavior.AllowGet)); }
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(); }