private void GetLRInsureContByRIContractInfo(List <RIContractInfo> RIContractInfo, bool isChild = false, int contractNumber = 0, string MainReInsuranceContNo = "") { int ReInsuranceContNo = 0; for (int i = 0; i < RIContractInfo.Count; i++) { LRInsureContModel lRInsureContModel = new LRInsureContModel(); var model = RIContractInfo[i]; var reinsurer = new Reinsurer().GetReinsurerInforByName(model.Reinsurer); var reinsurerCode = reinsurer == null ? string.Empty : reinsurer.ReinsurerCode; string currentReInsuranceContNo = ""; if (isChild) { if (listLRInsureContModel.Where(A => A.ReInsuranceContName == model.TreatyName && A.ReinsurerName == reinsurer.ReinsurerChineseName).ToList().Count() > 0) { continue; } currentReInsuranceContNo = "RICN" + reinsurerCode + model.ContractTypeSign + (contractNumber + 1).ToString().PadLeft(2, '0') + (ReInsuranceContNo++ + 1).ToString().PadLeft(3, '0'); //ReInsuranceContNo++; } else { currentReInsuranceContNo = "RICN" + reinsurerCode + model.ContractTypeSign + (i + 1).ToString().PadLeft(2, '0') + "000"; MainReInsuranceContNo = currentReInsuranceContNo; } lRInsureContModel.TransactionNo = ""; lRInsureContModel.CompanyCode = origanizationCode; lRInsureContModel.ReInsuranceContNo = currentReInsuranceContNo; // lRInsureContModel.ReInsuranceContName = model.TreatyName; lRInsureContModel.ReInsuranceContTitle = ""; lRInsureContModel.MainReInsuranceContNo = MainReInsuranceContNo;//主合同号码 lRInsureContModel.ContOrAmendmentType = "合同".Equals(model.ContOrAmendmentType) ? "1" : "2"; lRInsureContModel.ContAttribute = "1"; lRInsureContModel.ContStatus = "1"; lRInsureContModel.TreatyOrFacultativeFlag = "1"; lRInsureContModel.ContSigndate = Convert.ToDateTime(model.SignDate_INSH).ToString("yyyy/MM/dd"); lRInsureContModel.PeriodFrom = Convert.ToDateTime(model.EffectiveDate).ToString("yyyy/MM/dd"); lRInsureContModel.PeriodTo = ""; lRInsureContModel.ContType = model.RImethodI == "非比例" ? "2" : "1"; lRInsureContModel.ReinsurerCode = reinsurer == null ? "" : reinsurer.ReinsurerCode; lRInsureContModel.ReinsurerName = reinsurer == null ? "" : reinsurer.ReinsurerChineseName; lRInsureContModel.ChargeType = "2"; listLRInsureContModel.Add(lRInsureContModel); if (!isChild) { GetLRInsureContByRIContractInfo(model.lstChildRIContractInfo, true, i, MainReInsuranceContNo); } } }
private void GetLRAccountData(ContractInfoBusiness contractInfoBusiness, string dateyyyymm) { var listLRInsureContModel = contractInfoBusiness.lstLRInsureContModel; var listStatement = contractInfoBusiness.lstInsuranceReinsuranceStatementModel; for (int i = 0; i < listStatement.Count; i++) { var model = listStatement[i]; try { LRInsureContModel lRInsureContModel = GetLRInsureContModel(listLRInsureContModel, model); if (lRInsureContModel == null) { throw new Exception("Get " + model.ToCompanyName + " information error"); } LRAccountModel lrAccountModel = new LRAccountModel(); var reinsurer = new Reinsurer().GetReinsurerInforByName(model.ToCompanyName); var reinsurerCode = reinsurer == null ? string.Empty : reinsurer.ReinsurerCode; lrAccountModel.TransactionNo = CommFuns.GetTransactionNo2(i + 1, dateyyyymm); lrAccountModel.CompanyCode = origanizationCode; lrAccountModel.AccountID = lRInsureContModel.MainReInsuranceContNo + dateyyyymm.Substring(0, 6);//账单编号 lrAccountModel.AccountingPeriodfrom = Convert.ToDateTime(dateyyyymm.Substring(0, 4) + "-" + dateyyyymm.Substring(4, 2) + "-01").ToString("yyyy/MM/dd"); lrAccountModel.AccountingPeriodto = Convert.ToDateTime(dateyyyymm.Substring(0, 4) + "-" + dateyyyymm.Substring(4, 2) + "-01").AddMonths(1).AddDays(-1).ToString("yyyy/MM/dd"); lrAccountModel.ReinsurerCode = reinsurerCode; lrAccountModel.ReinsurerName = reinsurer == null ? string.Empty : reinsurer.ReinsurerChineseName; lrAccountModel.ReInsuranceContNo = lRInsureContModel.MainReInsuranceContNo; //合同号码 lrAccountModel.ReInsuranceContName = lRInsureContModel.ReInsuranceContName; //合同名称 lrAccountModel.Currency = "156"; lrAccountModel.ReinsurancePremium = decimal.Round(decimal.Parse(model.Debit.ReinsurancePremiums), 2).ToString(); // lrAccountModel.ReinsuranceCommssionRate = "0.5"; //分保佣金、分保费50% lrAccountModel.ReinsuranceCommssion = decimal.Round(decimal.Parse(model.Credit.ReinsuranceCommissions), 2).ToString(); // lrAccountModel.ReturnReinsurancePremium = "0"; lrAccountModel.ReturnReinsuranceCommssion = "0"; lrAccountModel.ReturnSurrenderPay = "0"; lrAccountModel.ReturnClaimPay = decimal.Round(decimal.Parse(model.Credit.ReinsuranceClaimAmounts), 2).ToString(); lrAccountModel.ReturnMaturity = "0"; lrAccountModel.ReturnAnnuity = "0"; lrAccountModel.ReturnLivBene = "0"; lrAccountModel.AccountStatus = "1"; lrAccountModel.PairingStatus = "2"; lrAccountModel.PairingDate = lrAccountModel.AccountingPeriodto == null ? "" : Convert.ToDateTime(lrAccountModel.AccountingPeriodto).ToString("yyyy/MM/dd"); lrAccountModel.CurrentRate = "1"; listLRAccount.Add(lrAccountModel); } catch (Exception ex) { throw; } } }
private void GetLRInsureContByHugeDisasterModel(List <HugeDisasterModel> RIContractInfo) { int reInsuranceContNo = 0; for (int i = 0; i < RIContractInfo.Count; i++) { LRInsureContModel lRInsureContModel = new LRInsureContModel(); var model = RIContractInfo[i]; var reinsurer = new Reinsurer().GetReinsurerInforByName(model.Reinsurer); var reinsurerCode = reinsurer == null ? string.Empty : reinsurer.ReinsurerCode; if (listLRInsureContModel.Where(A => A.ReInsuranceContName == model.TreatyName && A.ReinsurerName == reinsurer.ReinsurerChineseName).ToList().Count() > 0) { continue; } string currentReInsuranceContNo = "RICN" + reinsurerCode + "M" + (reInsuranceContNo++ + 1).ToString().PadLeft(2, '0') + "000"; lRInsureContModel.TransactionNo = ""; lRInsureContModel.CompanyCode = origanizationCode; lRInsureContModel.ReInsuranceContNo = currentReInsuranceContNo; //合同号码需赋值 lRInsureContModel.ReInsuranceContName = model.TreatyName; lRInsureContModel.ReInsuranceContTitle = ""; lRInsureContModel.MainReInsuranceContNo = currentReInsuranceContNo;//主合同号码 lRInsureContModel.ContOrAmendmentType = "合同".Equals(model.ContOrAmendmentType) ? "1" : "2"; lRInsureContModel.ContAttribute = "1"; lRInsureContModel.ContStatus = "ChinaRe".Equals(model.Reinsurer) && "Terminated".Equals(model.Remark) ? "2" : "1"; lRInsureContModel.TreatyOrFacultativeFlag = "1"; lRInsureContModel.ContSigndate = Convert.ToDateTime(model.SignDate_INSH).ToString("yyyy/MM/dd"); lRInsureContModel.PeriodFrom = Convert.ToDateTime(model.EffectiveDate).ToString("yyyy/MM/dd"); lRInsureContModel.PeriodTo = "ChinaRe".Equals(model.Reinsurer) && "Terminated".Equals(model.Remark) ? Convert.ToDateTime(Convert.ToDateTime(model.EffectiveDate).AddYears(1).ToString("yyyy") + "/01/01").AddDays(-1).ToString("yyyy/MM/dd") : ""; lRInsureContModel.ContType = model.RImethodI == "非比例" ? "2" : "1"; lRInsureContModel.ReinsurerCode = reinsurer == null ? "" : reinsurer.ReinsurerCode; lRInsureContModel.ReinsurerName = reinsurer == null ? "" : reinsurer.ReinsurerChineseName; lRInsureContModel.ChargeType = "2"; listLRInsureContModel.Add(lRInsureContModel); } }
/// <summary> /// 得到团体信息 /// </summary> /// <param name="businessModel"></param> /// <param name="yyyymm"></param> private void GetGroupLREdorData(ContractInfoBusiness businessModel, string yyyymm) { for (int i = 0; i < businessModel.lstPolicyAlternationReportGroup.Count; i++) { var tempModel = businessModel.lstPolicyAlternationReportGroup[i]; LREdorModel currentModel = new LREdorModel(); //交易编码 currentModel.TransactionNo = ""; //保险机构代码 currentModel.CompanyCode = origanizationCode; //团体保单号 currentModel.GrpPolicyNo = tempModel.ChdrNum; //团体保单险种号码 //var tempLCGrpProduct = businessModel.lstTEMP_LCGrpProduct.Where(e => e.GrpPolicyNo == currentModel.GrpPolicyNo // && e.ProductCode == tempModel.ProdTyp).FirstOrDefault(); //currentModel.GrpProductNo = tempLCGrpProduct != null ? tempLCGrpProduct.GrpProductNo : string.Empty; currentModel.GrpProductNo = tempModel.ProdTyp; //个人保单号 //var tempLCCont = businessModel.lstTEMP_LCCont.Where(a => a.GrpPolicyNo == currentModel.GrpPolicyNo).ToList().FirstOrDefault(); string tempMbrno = string.IsNullOrWhiteSpace(tempModel.Mbrno) ? string.Empty : tempModel.Mbrno.Trim() + "00"; currentModel.PolicyNo = tempMbrno.PadLeft(7, '0'); // 个单保险险种号码 currentModel.ProductNo = currentModel.GrpProductNo; //保单团个性质代码 currentModel.GPFlag = "02"; //主险保险险种号码 var tempLCProductGroup = businessModel.lstTEMP_LCProductGroup.Where(e => e.GrpPolicyNo.Equals(currentModel.GrpPolicyNo) && e.PolicyNo.Equal(currentModel.PolicyNo.PadLeft(8, '0')) && e.ProductNo.Equal(currentModel.ProductNo)).FirstOrDefault(); currentModel.MainProductNo = tempLCProductGroup == null ? string.Empty : tempLCProductGroup.MainProductNo; //主附险性质代码 currentModel.MainProductFlag = tempLCProductGroup == null ? string.Empty : tempLCProductGroup.MainProductFlag; //产品编码 string tempProductCode = string.IsNullOrWhiteSpace(tempModel.ProductCode) ? string.Empty : tempModel.ProductCode.Trim(); currentModel.ProductCode = (tempProductCode.Equals("GIP") || tempProductCode.Equals("GOP") || tempProductCode.Equals("GMA")) ? "GHB" : tempProductCode; //currentModel.ProductCode = tempModel.ProdTyp; //责任代码 currentModel.LiabilityCode = Common.GetLiabilityCode(currentModel.ProductCode); //责任名称 var tempCategory = PersonalLiabilityCategory.LstCategory.Where(e => e.CategoryCode.Equal(currentModel.LiabilityCode)).FirstOrDefault(); currentModel.LiabilityName = tempCategory == null ? string.Empty : tempCategory.CategoryName; //责任分类代码 currentModel.Classification = tempCategory == null ? string.Empty : tempCategory.LiabilityCategoryCode; //保险期限类型 var tempProductModel = businessModel.lstTEMP_LMProductModel.Where(e => e.ProductCode == currentModel.ProductCode).FirstOrDefault(); currentModel.TermType = tempProductModel == null ? string.Empty : tempProductModel.TermType; //管理机构代码 var tempLcGrpContGroup = businessModel.lstLCGrpContGroup.Where(e => e.GrpPolicyNo.Equal(currentModel.GrpPolicyNo)).FirstOrDefault(); currentModel.ManageCom = tempLcGrpContGroup == null ? string.Empty : tempLcGrpContGroup.ManageCom; //签单日期 DateTime tempSignDate; string strSignDate = string.Empty; if (tempLcGrpContGroup != null) { bool convertResult = DateTime.TryParse(tempLcGrpContGroup.SignDate, out tempSignDate); if (convertResult) { strSignDate = tempSignDate.ToString("yyyy-MM-dd"); } } currentModel.SignDate = strSignDate; //保险责任生效日期 currentModel.EffDate = tempLCProductGroup == null ? string.Empty : tempLCProductGroup.EffDate; //PolYear 所跑数据年份减去签单日期年份 if (!string.IsNullOrEmpty(strSignDate)) { int currentYear = int.Parse(yyyymm.Substring(0, 4)); int signDateYear = int.Parse(strSignDate.Substring(0, 4)); currentModel.PolYear = (currentYear - signDateYear).ToString(); } else { currentModel.PolYear = "0"; } //保险责任终止日期 currentModel.InvalidDate = tempLCProductGroup == null ? string.Empty : tempLCProductGroup.InvalidDate; //核保结论代码 currentModel.UWConclusion = "10"; //保单状态代码 currentModel.PolStatus = "03"; //保单险种状态代码 currentModel.Status = "03"; //基本保额 currentModel.BasicSumInsured = Common.ConvertToStrToStrDecimal(tempModel.SumSi); // 风险保额 currentModel.RiskAmnt = ConfigInformation.NumberValue; //保费 currentModel.Premium = Common.ConvertToStrToStrDecimal(tempModel.Pprem); //保险账户价值 currentModel.AccountValue = "0"; //临分标记 currentModel.FacultativeFlag = ConfigInformation.TextValue; //无名单标志 currentModel.AnonymousFlag = "0"; //豁免险标志 currentModel.WaiverFlag = "0"; //所需豁免剩余保费 currentModel.WaiverPrem = "0"; //期末现金价值 currentModel.FinalCashValue = ConfigInformation.NumberValue; //期末责任准备金 currentModel.FinalLiabilityReserve = ConfigInformation.NumberValue; //被保人客户号 currentModel.InsuredNo = tempModel.Clntnum.PadLeft(8, '0'); //被保人姓名 var tempInsuredGroup = businessModel.lst_LCInsuredGroup.Where(e => e.PolicyNo.Equal(currentModel.PolicyNo.PadLeft(8, '0')) && e.GrpPolicyNo.Equal(currentModel.GrpPolicyNo)).FirstOrDefault(); currentModel.InsuredName = tempInsuredGroup == null ? string.Empty : tempInsuredGroup.InsuredName; //被保人性别 currentModel.InsuredSex = tempInsuredGroup == null ? string.Empty : tempInsuredGroup.InsuredSex; //被保人证件类型 currentModel.InsuredCertType = tempInsuredGroup == null ? string.Empty : tempInsuredGroup.InsuredCertType; //被保人证件编码 currentModel.InsuredCertNo = tempInsuredGroup == null ? string.Empty : tempInsuredGroup.InsuredCertNo; //职业代码 currentModel.OccupationType = tempInsuredGroup == null ? string.Empty : tempInsuredGroup.OccupationType; //投保年龄 currentModel.AppntAge = tempInsuredGroup == null ? string.Empty : tempInsuredGroup.AppAge; //当前年龄 currentModel.PreAge = ConfigInformation.NumberValue; //职业加费金额 currentModel.ProfessionalFee = "0"; //次标准体加费金额 currentModel.SubStandardFee = "0"; //EM加点 if (tempLCProductGroup != null) { currentModel.EMRate = Common.ConvertToStrToStrDecimal(tempLCProductGroup.EMRate); } else { currentModel.EMRate = string.Empty; } //建工险标志 currentModel.ProjectFlag = ConfigInformation.TextValue; //投保总人数 currentModel.InsurePeoples = "1"; //保全受理号码 var listLCPolTransaction = businessModel.lstTEMP_LCPolTransaction.Where(A => A.PolicyNo == currentModel.PolicyNo.PadLeft(8, '0')).ToList(); //currentModel.EndorAcceptNo = listLCPolTransaction.Count == 0 ? "" : listLCPolTransaction.First().EndorAcceptNo; string tempSign = "1"; if (!string.IsNullOrWhiteSpace(currentModel.Premium)) { decimal d; var tempConvertResult = decimal.TryParse(currentModel.Premium, out d); if (tempConvertResult) { tempSign = d > 0 ? "0" : "1"; } } currentModel.EndorAcceptNo = "PS" + currentModel.PolicyNo + yyyymm + tempSign + "00000"; //保全批单号码 //currentModel.EndorsementNo = listLCPolTransaction.Count == 0 ? "" : listLCPolTransaction.First().EndorsementNo; currentModel.EndorsementNo = currentModel.EndorAcceptNo; //保全项目类型 currentModel.EdorType = "99"; //保全生效日期 currentModel.EdorValiDate = ConfigInformation.DateValue; //保全确认日期 currentModel.EdorConfDate = ConfigInformation.DateValue; //保全发生费用 currentModel.EdorMoney = ConfigInformation.NumberValue; //分出标记 currentModel.SaparateFlag = ""; //再保险公司名称 currentModel.ReinsurerName = Common.DefaultCommanyName;///////////////////////////////////// //再保险公司代码 Reinsurer Reinsurer = new Reinsurer(); currentModel.ReinsurerCode = Reinsurer.GetReinsurerInforByName(currentModel.ReinsurerName).ReinsurerCode; //分出标记 var templstZaiBaoProductInfo = businessModel.lstZaiBaoProductInfo.Where(e => e.ReinsurerCode.Equal(currentModel.ReinsurerCode) && e.ProductCode.Equals(currentModel.ProductCode) && e.LiabilityCode.Equals(currentModel.LiabilityCode)).FirstOrDefault(); string tempQuotaSharePercentage = templstZaiBaoProductInfo == null ? string.Empty : (templstZaiBaoProductInfo.QuotaSharePercentage == "0" || templstZaiBaoProductInfo.QuotaSharePercentage == "0.00") ? "0" : "1"; currentModel.SaparateFlag = templstZaiBaoProductInfo == null ? string.Empty : tempQuotaSharePercentage; //再保险合同号码 currentModel.ReInsuranceContNo = templstZaiBaoProductInfo == null ? string.Empty : templstZaiBaoProductInfo.ReInsuranceContNo; // 分保方式 currentModel.ReinsurMode = templstZaiBaoProductInfo == null ? string.Empty : templstZaiBaoProductInfo.ReinsurMode; //分保比例 currentModel.QuotaSharePercentage = templstZaiBaoProductInfo == null ? string.Empty : templstZaiBaoProductInfo.QuotaSharePercentage; //变更前被保人投保年龄 currentModel.PreInsuredAge = ConfigInformation.NumberValue; //变更前基本保额 currentModel.PreBasicSumInsured = ConfigInformation.NumberValue; //变更前风险保额 currentModel.PreRiskAmnt = ConfigInformation.NumberValue; //变更前分保保额 currentModel.PreReinsuranceAmnt = ConfigInformation.NumberValue; //变更前自留额 currentModel.PreRetentionAmount = ConfigInformation.NumberValue; //变更前保费 currentModel.PrePremium = ConfigInformation.NumberValue; //变更前账户价值 currentModel.PreAccountValue = ConfigInformation.NumberValue; //变更前所需豁免剩余保费 currentModel.PreWaiverPrem = ConfigInformation.NumberValue; //建筑面积变化量 currentModel.ProjectAcreageChange = ConfigInformation.NumberValue; //工程造价变化量 currentModel.ProjectCostChange = ConfigInformation.NumberValue; //变更后分保保额 currentModel.ReinsuranceAmntChange = ConfigInformation.NumberValue; //变更后自留额 currentModel.RetentionAmount = ConfigInformation.NumberValue; //变更分保费 currentModel.ReinsurancePremiumChange = ConfigInformation.NumberValue; //变更分保佣金 currentModel.ReinsuranceCommssionChange = ConfigInformation.NumberValue; //货币代码 currentModel.Currency = "156"; //分保计算日期 currentModel.ReComputationsDate = GetLastDayOfMonth(yyyymm); //账单归属日期 currentModel.AccountGetDate = GetLastDayOfMonth(yyyymm); lREdorModelList.Add(currentModel); } }