示例#1
0
 public void WriteLRInsureContSheet()
 {
     try
     {
         string        path          = @"C:\Users\Administrator\Desktop\template\template\yyyymm\output";
         ExcelTemplate excelTemplate = new ExcelTemplate();
         IExcel        excelApp      = new ExcelCore.ExcelCore();
         excelTemplate.CreateTemplate(excelApp, path + @"\TEMP_" + ExcelTemplateName.LRProduct + ".xlsx", ExcelTemplateName.LRProduct);
         excelTemplate.CreateTemplate(excelApp, path + @"\TEMP_" + ExcelTemplateName.LRInsureCont + ".xlsx", ExcelTemplateName.LRInsureCont);
         excelTemplate.CreateTemplate(excelApp, path + @"\TEMP_" + ExcelTemplateName.LRAccount + ".xlsx", ExcelTemplateName.LRAccount);
         excelTemplate.CreateTemplate(excelApp, path + @"\TEMP_" + ExcelTemplateName.LJInvoiceRelation + ".xlsx", ExcelTemplateName.LJInvoiceRelation);
         excelTemplate.CreateTemplate(excelApp, path + @"\TEMP_" + ExcelTemplateName.LJInvoice + ".xlsx", ExcelTemplateName.LJInvoice);
         LRInsureCont         lRInsureCont         = new LRInsureCont();
         ContractInfoBusiness contractInfoBusiness = new ContractInfoBusiness();
         string TEMP_LMLiabilityInfoExcelPath      = @"C:\Users\Administrator\Desktop\template\template\inputPath2";
         contractInfoBusiness.GetInformationDataFromExcel(TEMP_LMLiabilityInfoExcelPath, @"C:\Users\Administrator\Desktop\template\template\yyyymm");
         lRInsureCont.WriteLRInsureContSheet(contractInfoBusiness, path + @"\TEMP_" + ExcelTemplateName.LRInsureCont + ".xlsx", "20170131");
         LRAccount lRAccount = new LRAccount();
         lRAccount.WriteLRAccountSheet(contractInfoBusiness, path + @"\TEMP_" + ExcelTemplateName.LRAccount + ".xlsx", "201701");
     }
     catch (Exception ex)
     {
         throw;
     }
 }
        public void GetInforceBusinessListingDataTest()
        {
            ContractInfoBusiness contractInfoBusiness = new ContractInfoBusiness();

            // contractInfoBusiness.GetInforceBusinessListingData(@"C:\Users\Administrator\Desktop\template00\template\yyyymm");

            Assert.Fail();
        }
        public void GetPolicyAlternationReportGroupDataTest()
        {
            ContractInfoBusiness contractInfoBusiness = new ContractInfoBusiness();

            // contractInfoBusiness.GetPolicyAlternationReportGroupData(@"C:\Users\Administrator\Desktop\template00\template\yyyymm\group");

            Assert.Fail();
        }
示例#4
0
 public void GetLRInsureContData(ContractInfoBusiness contractInfoBusiness)
 {
     GetLRInsureContByRIContractInfo(contractInfoBusiness.lstMuReModel);
     GetLRInsureContByRIContractInfo(contractInfoBusiness.lstHanReModel);
     GetLRInsureContByRIContractInfo(contractInfoBusiness.lstRGAModel);
     GetLRInsureContByRIContractInfo(contractInfoBusiness.lstSwissReModel);
     GetLRInsureContByHugeDisasterModel(contractInfoBusiness.lstHugeDisasterModel);
     contractInfoBusiness.lstLRInsureContModel = listLRInsureContModel;
 }
示例#5
0
        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;
                }
            }
        }
示例#6
0
        public void WriteLRAccountSheet(ContractInfoBusiness contractInfoBusiness, string OutPutFolderPath, string dateyyyymm)
        {
            IExcel excelApp = new ExcelCore.ExcelCore();

            try
            {
                ProcessLogProxy.Normal("Start building LRAccount excel");
                var           excelPath     = OutPutFolderPath + @"\TEMP_" + ExcelTemplateName.LRAccount + ".xlsx";
                ExcelTemplate excelTemplate = new ExcelTemplate();
                excelTemplate.CreateTemplate(excelApp, excelPath, ExcelTemplateName.LRAccount);//创建模板
                GetLRAccountData(contractInfoBusiness, dateyyyymm);
                excelApp.OpenExcel(excelPath, false);
                for (int i = 0; i < listLRAccount.Count; i++)
                {
                    var model = listLRAccount[i];
                    excelApp.SetCellValue("Sheet1", i + 2, "A", model.TransactionNo);
                    excelApp.SetCellValue("Sheet1", i + 2, "B", model.CompanyCode);
                    excelApp.SetCellValue("Sheet1", i + 2, "C", model.AccountID);
                    excelApp.SetCellValue("Sheet1", i + 2, "D", model.AccountingPeriodfrom);
                    excelApp.SetCellValue("Sheet1", i + 2, "E", model.AccountingPeriodto);
                    excelApp.SetCellValue("Sheet1", i + 2, "F", model.ReinsurerCode);
                    excelApp.SetCellValue("Sheet1", i + 2, "G", model.ReinsurerName);
                    excelApp.SetCellValue("Sheet1", i + 2, "H", model.ReInsuranceContNo);
                    excelApp.SetCellValue("Sheet1", i + 2, "I", model.ReInsuranceContName);
                    excelApp.SetCellValue("Sheet1", i + 2, "J", model.Currency);
                    excelApp.SetCellValue("Sheet1", i + 2, "K", model.ReinsurancePremium);
                    excelApp.SetCellValue("Sheet1", i + 2, "L", model.ReinsuranceCommssionRate);
                    excelApp.SetCellValue("Sheet1", i + 2, "M", model.ReinsuranceCommssion);
                    excelApp.SetCellValue("Sheet1", i + 2, "N", model.ReturnReinsurancePremium);
                    excelApp.SetCellValue("Sheet1", i + 2, "O", model.ReturnReinsuranceCommssion);
                    excelApp.SetCellValue("Sheet1", i + 2, "P", model.ReturnSurrenderPay);
                    excelApp.SetCellValue("Sheet1", i + 2, "Q", model.ReturnClaimPay);
                    excelApp.SetCellValue("Sheet1", i + 2, "R", model.ReturnMaturity);
                    excelApp.SetCellValue("Sheet1", i + 2, "S", model.ReturnAnnuity);
                    excelApp.SetCellValue("Sheet1", i + 2, "T", model.ReturnLivBene);
                    excelApp.SetCellValue("Sheet1", i + 2, "U", model.AccountStatus);
                    excelApp.SetCellValue("Sheet1", i + 2, "V", model.PairingStatus);
                    excelApp.SetCellValue("Sheet1", i + 2, "W", model.PairingDate);
                    excelApp.SetCellValue("Sheet1", i + 2, "X", model.CurrentRate);
                }
                excelApp.SetSheetAutoFit("Sheet1");
                excelApp.Save();
                excelApp.Close();
                ProcessLogProxy.SuccessMessage("Build Success");
            }
            catch (Exception ex)
            {
                ProcessLogProxy.Error(ex.Message);
                ProcessLogProxy.Error("Build fail");
            }
        }
 public void GetInformationDataFromExcelTest()
 {
     try
     {
         string path  = @"C:\Users\Administrator\Desktop\template\template\yyyymm\Contract Info.xlsx";
         string path1 = @"C:\Users\Administrator\Desktop\template\template\inputPath2\TEMP_LMLiability.xlsx";
         string path2 = @"C:\Users\Administrator\Desktop\template\template\inputPath2\TEMP_LMProduct.xlsx";
         ContractInfoBusiness contractInfoBusiness = new ContractInfoBusiness();
         contractInfoBusiness.GetInformationDataFromExcel(path1, @"C:\Users\Administrator\Desktop\template\template\yyyymm");
         Assert.Fail();
     }
     catch (Exception EX)
     {
         throw;
     }
 }
示例#8
0
    private void CounsellorDetailInfoDisplay()
    {
        long lUsersID = long.Parse(Session["UsersID"].ToString());

        if (lUsersID == 0 || lUsersID % 100 == 67)
        {
            BTNEstablishContract.Visible = false;
        }

        long lCounsellorID = long.Parse(Request.QueryString["CounsellorID"].ToString());
        //long lCounsellorID = 2020110619480567;//测试用

        CounsellorInfoBusiness CounsellorInfoBusiness = new CounsellorInfoBusiness();//实体化BLL层中的CounsellorInfoBusiness类
        CounsellorInfoEntity   CounsellorInfoEntity   = new CounsellorInfoEntity();
        ContractInfoBusiness   ContractInfo           = new ContractInfoBusiness();

        //最上面的信息
        CounsellorInfoEntity         = CounsellorInfoBusiness.GetCounsellorInfoByID(lCounsellorID);
        LBLCounsellorName.Text       = CounsellorInfoEntity.scounsellorName;
        LBLCounsellorLevel.Text      = CounsellorInfoEntity.icounsellorLevel.ToString();
        IMGCounsellorImage.ImageUrl  = CounsellorInfoEntity.scounsellorImage.ToString();
        LBLCounsellorTips.Text       = CounsellorInfoEntity.scounsellorSelfIntroduction.ToString();
        LBLCounsellorOfferMoney.Text = CounsellorInfoEntity.lcounsellorOfferMoney.ToString();

        //第一页信息
        LBLCounsellorNamePage1.Text      = CounsellorInfoEntity.scounsellorName;
        LBLCounsellorSex.Text            = CounsellorInfoEntity.scounsellorSex;
        LBLCounsellorContractAmount.Text = ((int)ContractInfo.CounsellorContractAmount(lCounsellorID)).ToString();
        //第三页信息

        for (int iCounter = 0; iCounter < CounsellorInfoEntity.sacounsellorAdvantageField.Length; iCounter++)
        {
            //循环给Label赋值
            Label LBLCounsellorAdvantageFields = (Label)this.Master.FindControl("ContentPlaceHolder1").FindControl("LBLCounsellorAdvantageField" + iCounter);
            if (CounsellorInfoEntity.sacounsellorAdvantageField[iCounter] == "待定")
            {
                LBLCounsellorAdvantageFields.Visible = false;
            }
            else
            {
                LBLCounsellorAdvantageFields.Text = CounsellorInfoEntity.sacounsellorAdvantageField[iCounter];
            }
        }
        //第四页的信息
        LBLCounsellorPhoneNumber.Text = CounsellorInfoEntity.lcounsellorPhoneNumber.ToString();
    }
示例#9
0
        public void WriteLRInsureContSheet(ContractInfoBusiness contractInfoBusiness, string OutPutFolderPath, string LastDateOfMonthyyyyMMdd)
        {
            IExcel excelApp = new ExcelCore.ExcelCore();

            try
            {
                ProcessLogProxy.Normal("Start building LRInsureCont excel");
                LastDateOfMonth = LastDateOfMonthyyyyMMdd;
                var           excelPath     = OutPutFolderPath + @"\TEMP_" + ExcelTemplateName.LRInsureCont + ".xlsx";
                ExcelTemplate excelTemplate = new ExcelTemplate();
                excelTemplate.CreateTemplate(excelApp, excelPath, ExcelTemplateName.LRInsureCont);//创建模板
                //GetLRInsureContData(contractInfoBusiness);//得到需写入excel的数据
                excelApp.OpenExcel(excelPath, false);
                for (int i = 0; i < contractInfoBusiness.lstLRInsureContModel.Count; i++)
                {
                    var model = listLRInsureContModel[i];
                    excelApp.SetCellValue("Sheet1", i + 2, "A", CommFuns.GetTransactionNo2(i + 1, LastDateOfMonth));
                    excelApp.SetCellValue("Sheet1", i + 2, "B", model.CompanyCode);
                    excelApp.SetCellValue("Sheet1", i + 2, "C", model.ReInsuranceContNo);
                    excelApp.SetCellValue("Sheet1", i + 2, "D", model.ReInsuranceContName);
                    excelApp.SetCellValue("Sheet1", i + 2, "E", model.ReInsuranceContTitle);
                    excelApp.SetCellValue("Sheet1", i + 2, "F", model.MainReInsuranceContNo);
                    excelApp.SetCellValue("Sheet1", i + 2, "G", model.ContOrAmendmentType);
                    excelApp.SetCellValue("Sheet1", i + 2, "H", model.ContAttribute);
                    excelApp.SetCellValue("Sheet1", i + 2, "I", model.ContStatus);
                    excelApp.SetCellValue("Sheet1", i + 2, "J", model.TreatyOrFacultativeFlag);
                    excelApp.SetCellValue("Sheet1", i + 2, "K", model.ContSigndate);
                    excelApp.SetCellValue("Sheet1", i + 2, "L", model.PeriodFrom);
                    excelApp.SetCellValue("Sheet1", i + 2, "M", model.PeriodTo);
                    excelApp.SetCellValue("Sheet1", i + 2, "N", model.ContType);
                    excelApp.SetCellValue("Sheet1", i + 2, "O", model.ReinsurerCode);
                    excelApp.SetCellValue("Sheet1", i + 2, "P", model.ReinsurerName);
                    excelApp.SetCellValue("Sheet1", i + 2, "Q", model.ChargeType);
                }
                excelApp.SetSheetAutoFit("Sheet1");
                excelApp.Save();
                excelApp.Close();
                ProcessLogProxy.SuccessMessage("Build Success");
            }
            catch (Exception ex)
            {
                ProcessLogProxy.Error(ex.Message);
                ProcessLogProxy.Error("Build fail");
            }
        }
示例#10
0
    protected void BTNEstablishContract_Click(object sender, EventArgs e)
    {
        long lClientID = long.Parse(Session["UsersID"].ToString());
        ClientInfoBusiness GetClientWallet = new ClientInfoBusiness();
        ClientInfoEntity   ClientWallet    = new ClientInfoEntity();

        ClientWallet = GetClientWallet.GetClientInfoByID(lClientID);


        long lCounsellorID = long.Parse(Request.QueryString["CounsellorID"].ToString());
        CounsellorInfoBusiness CounsellorInfoBusiness = new CounsellorInfoBusiness();//实体化BLL层中的CounsellorInfoBusiness类
        CounsellorInfoEntity   CounsellorInfoEntity   = new CounsellorInfoEntity();

        CounsellorInfoEntity = CounsellorInfoBusiness.GetCounsellorInfoByID(lCounsellorID);

        ContractInfoBusiness ContractEstablish = new ContractInfoBusiness();

        int iCounsellorContractExistDetect = int.Parse(ContractEstablish.CounsellorContractExistDetect(lClientID).ToString());

        if (iCounsellorContractExistDetect > 0)
        {
            Response.Write("<script>alert('您已经与该律师签约!')</script>");
        }
        else
        {
            if (ClientWallet.lclientWallet >= CounsellorInfoEntity.lcounsellorOfferMoney)
            {
                int iContractJudegementValue   = ContractEstablish.ContractEstablish(lCounsellorID, lClientID);
                int iClientJudegementValue     = GetClientWallet.ClientWalletMoneyUpdate(CounsellorInfoEntity.lcounsellorOfferMoney, lClientID);
                int iCounsellorJudegementValue = CounsellorInfoBusiness.CounsellorWalletMoneyUpdate(lCounsellorID, CounsellorInfoEntity.lcounsellorOfferMoney);
                if (iContractJudegementValue > 0 && iClientJudegementValue > 0 && iCounsellorJudegementValue > 0)
                {
                    Response.Write("<script>alert('您已经成功签约!')</script>");
                }
                else
                {
                    Response.Write("<script>alert('签约失败!')</script>");
                }
            }
            else
            {
                Response.Write("<script>alert('您的余额不足以签约!')</script>");
            }
        }
    }
示例#11
0
 public void WriteLRInsureContSheetTest()
 {
     try
     {
         LRInsureCont         lRInsureCont         = new LRInsureCont();
         ContractInfoBusiness contractInfoBusiness = new ContractInfoBusiness();
         string outPutFilePath = @"C:\Users\Administrator\Desktop\v20180309.xlsx";
         string TEMP_LMLiabilityInfoExcelPath = @"C:\Users\Administrator\Desktop\template\template\inputPath2";
         contractInfoBusiness.GetInformationDataFromExcel(TEMP_LMLiabilityInfoExcelPath, @"C:\Users\Administrator\Desktop\template\template\yyyymm");
         ExcelTemplate excelTemplate = new ExcelTemplate();
         //  excelTemplate.CreateTemplate(outPutFilePath);
         lRInsureCont.WriteLRInsureContSheet(contractInfoBusiness, outPutFilePath, "20170131");
         LRAccount lRAccount = new LRAccount();
         lRAccount.WriteLRAccountSheet(contractInfoBusiness, outPutFilePath, "201701");
     }
     catch (Exception ex)
     {
         throw;
     }
 }
示例#12
0
        private void SetIndividualDataToModel(ContractInfoBusiness businessModel, string yearMonthDay,
                                              ref int serialNumber)
        {
            if (businessModel.lstInforceBusinessListing.Count > 0)
            {
                foreach (var tempModel in businessModel.lstInforceBusinessListing)
                {
                    LRContModel currentModel = new LRContModel();

                    //交易编码
                    currentModel.TransactionNo = CommFuns.GetTransactionNo4(serialNumber, yearMonthDay);

                    //保险机构代码
                    currentModel.CompanyCode = CommFuns.OriganizationCode;

                    //团体保单号
                    currentModel.GrpPolicyNo = string.Empty;

                    //团体保单险种号码
                    currentModel.GrpProductNo = string.Empty;

                    //个人保单号
                    string tempPolicyNo = string.IsNullOrWhiteSpace(tempModel.PolicyNo) ? string.Empty : tempModel.PolicyNo.Trim();
                    currentModel.PolicyNo = tempPolicyNo.PadLeft(8, '0');

                    //主附险性质代码
                    currentModel.MainProductFlag = this.GetMainProductFlag(tempModel.ProductCode);

                    // 个单保险险种号码
                    var tempLCProduct = businessModel.lstTEMP_LCProduct.Where(e =>
                                                                              e.PolicyNo.Equal(currentModel.PolicyNo) &&
                                                                              e.ProductCode.Equal(tempModel.ProductCode) &&
                                                                              e.MainProductFlag.Equals(currentModel.MainProductFlag)).FirstOrDefault();

                    currentModel.ProductNo = tempLCProduct == null ? string.Empty : tempLCProduct.ProductNo;

                    //保单团个性质代码
                    currentModel.GPFlag = "01";

                    // 主险保险险种号码
                    tempLCProduct = businessModel.lstTEMP_LCProduct.Where(e =>
                                                                          e.PolicyNo.Equal(currentModel.PolicyNo) &&
                                                                          e.ProductNo.Equal(currentModel.ProductNo)).FirstOrDefault();

                    currentModel.MainProductNo = tempLCProduct == null ? string.Empty : tempLCProduct.MainProductNo;

                    //产品编码
                    currentModel.ProductCode = tempModel.ProductCode;

                    //责任代码
                    currentModel.LiabilityCode = tempModel.Coverage1;

                    //责任名称
                    var tempCategory = PersonalLiabilityCategory.LstCategory.Where(e => e.CategoryCode.Equal(tempModel.Coverage1)).FirstOrDefault();
                    currentModel.LiabilityName = tempCategory == null ? string.Empty : tempCategory.CategoryName;

                    //责任分类代码
                    currentModel.Classification = tempCategory == null ? string.Empty : tempCategory.LiabilityCategoryCode;

                    // 续期续保次数
                    var tempLCCont = businessModel.lstTEMP_LCCont.Where(e => e.PolicyNo.Equals(tempModel.PolicyNo)).FirstOrDefault();
                    currentModel.RenewalTimes = tempLCCont == null ? string.Empty : tempLCCont.RenewalTimes;

                    //保险期限类型
                    var tempProductModel = businessModel.lstTEMP_LMProductModel.Where(e => e.ProductCode == currentModel.ProductCode).FirstOrDefault();
                    currentModel.TermType = tempProductModel == null ? string.Empty : tempProductModel.TermType;

                    //管理机构代码
                    currentModel.ManageCom = tempLCCont == null ? string.Empty : tempLCCont.ManageCom;

                    //签单日期
                    DateTime tempSignDate;
                    string   strSignDate = string.Empty;
                    if (tempLCCont != null)
                    {
                        bool convertResult = DateTime.TryParse(tempLCCont.SignDate, out tempSignDate);

                        if (convertResult)
                        {
                            strSignDate = tempSignDate.ToString("yyyy/MM/dd");
                        }
                    }
                    currentModel.SignDate = strSignDate;

                    //业务类型
                    if (!string.IsNullOrEmpty(strSignDate))
                    {
                        bool checkResult = Common.CheckEventType(yearMonthDay, strSignDate);

                        if (checkResult)
                        {
                            currentModel.EventType = "01";
                        }
                        else
                        {
                            if (!currentModel.ProductCode.ToUpper().Equal("HBA"))
                            {
                                currentModel.EventType = "02";
                            }
                            else
                            {
                                currentModel.EventType = "03";
                            }
                        }
                    }
                    else
                    {
                        currentModel.EventType = string.Empty;
                    }

                    //保险责任生效日期
                    currentModel.EffDate = tempLCProduct == null ? string.Empty : tempLCProduct.EffDate;

                    //PolYear 所跑数据年份减去签单日期年份
                    if (!string.IsNullOrEmpty(strSignDate))
                    {
                        int currentYear  = int.Parse(yearMonthDay.Substring(0, 4));
                        int signDateYear = int.Parse(strSignDate.Substring(0, 4));
                        currentModel.PolYear = (currentYear - signDateYear).ToString();
                    }
                    else
                    {
                        currentModel.PolYear = "0";
                    }

                    //保险责任终止日期
                    currentModel.InvalidDate = tempLCProduct == null ? string.Empty : tempLCProduct.InvalidDate;

                    //核保结论代码
                    currentModel.UWConclusion = tempLCProduct == null ? string.Empty : tempLCProduct.UWConclusion;

                    //保单状态代码
                    currentModel.PolStatus = "01";

                    //保单险种状态代码
                    currentModel.Status = "01";

                    //基本保额
                    currentModel.BasicSumInsured = Common.ConvertToStrToStrDecimal(tempModel.SumInsured);

                    // 风险保额
                    currentModel.RiskAmnt = Common.ConvertToStrToStrDecimal(tempModel.InitialSumatRisk);

                    //保费
                    currentModel.Premium = tempLCCont == null ? string.Empty :
                                           Common.ConvertToStrToStrDecimal(tempLCCont.Premium);

                    //保险账户价值
                    var tempLstInsureAcc = businessModel.lstTEMP_LCInsureAcc.Where(e => e.PolicyNo.Equal(currentModel.PolicyNo) &&
                                                                                   e.ProductNo.Equal(currentModel.ProductNo));

                    decimal tempAccountTotal = 0m;
                    foreach (var temp in tempLstInsureAcc)
                    {
                        if (!string.IsNullOrWhiteSpace(temp.AccountValue))
                        {
                            tempAccountTotal += decimal.Parse(temp.AccountValue.Trim());
                        }
                    }

                    string strTempAccountTotal = tempAccountTotal.ToString("0.00");
                    currentModel.AccountValue = strTempAccountTotal;

                    //临分标记
                    if (tempModel.IsMrHealth)
                    {
                        currentModel.FacultativeFlag = "0";
                    }
                    else
                    {
                        currentModel.FacultativeFlag = tempModel.AutomaticorFacultative.Equals("A") ? "0" : "1";
                    }

                    //无名单标志
                    currentModel.AnonymousFlag = "0";

                    //豁免险标志
                    currentModel.WaiverFlag = "0";

                    //所需豁免剩余保费
                    currentModel.WaiverPrem = "0";

                    //期末现金价值
                    currentModel.FinalCashValue = ConfigInformation.NumberValue;

                    //期末责任准备金
                    currentModel.FinalLiabilityReserve = ConfigInformation.NumberValue;

                    //被保人客户号
                    currentModel.InsuredNo = tempModel.MemberCertificateNo;

                    //被保人姓名
                    var tempInsured = businessModel.lstTEMP_LCInsured.Where(e => e.PolicyNo.Equal(currentModel.PolicyNo) &&
                                                                            e.InsuredNo.Equal(currentModel.InsuredNo)).FirstOrDefault();
                    currentModel.InsuredName = tempInsured == null ? string.Empty : tempInsured.InsuredName;

                    //被保人性别
                    currentModel.InsuredSex = tempInsured == null ? string.Empty : tempInsured.InsuredSex;

                    //被保人证件类型
                    currentModel.InsuredCertType = tempInsured == null ? string.Empty : tempInsured.InsuredCertType;

                    //被保人证件编码
                    currentModel.InsuredCertNo = tempInsured == null ? string.Empty : tempInsured.InsuredCertNo;

                    //职业代码
                    currentModel.OccupationType = tempInsured == null ? string.Empty : tempInsured.OccupationType;

                    //投保年龄
                    currentModel.AppntAge = tempInsured == null ? string.Empty : tempInsured.AppAge;

                    //当前年龄
                    currentModel.PreAge = tempModel.Attainedage;

                    //职业加费金额
                    currentModel.ProfessionalFee = tempLCProduct == null ? string.Empty : Common.ConvertToStrToStrDecimal(tempLCProduct.ProfessionalFee);

                    //次标准体加费金额
                    currentModel.SubStandardFee = tempLCProduct == null ? string.Empty : Common.ConvertToStrToStrDecimal(tempLCProduct.SubStandardFee);

                    //EM加点
                    currentModel.EMRate = tempLCProduct == null ? string.Empty : Common.ConvertToStrToStrDecimal(tempLCProduct.EMRate);

                    //建工险标志
                    currentModel.ProjectFlag = ConfigInformation.TextValue;

                    //被保人数
                    currentModel.InsurePeoples = "1";

                    //再保险公司名称
                    currentModel.ReinsurerName = tempModel.CompanyName;

                    //再保险公司代码
                    var tempReinsurer = reinsurer.GetReinsurerInforByName(currentModel.ReinsurerName);
                    currentModel.ReinsurerCode = tempReinsurer == null ? string.Empty : tempReinsurer.ReinsurerCode;

                    //再保险合同号码
                    var templstZaiBaoProductInfo = businessModel.lstZaiBaoProductInfo.Where(e =>
                                                                                            e.ReinsurerCode.Equal(currentModel.ReinsurerCode) &&
                                                                                            e.ProductCode.Equals(currentModel.ProductCode) && e.LiabilityCode.Equals(currentModel.LiabilityCode)).FirstOrDefault();

                    currentModel.ReInsuranceContNo = templstZaiBaoProductInfo == null ? string.Empty :
                                                     templstZaiBaoProductInfo.ReInsuranceContNo;

                    // 分保方式
                    currentModel.ReinsurMode = templstZaiBaoProductInfo == null ? string.Empty :
                                               templstZaiBaoProductInfo.ReinsurMode;

                    //分出标记
                    string tempQuotaSharePercentage = templstZaiBaoProductInfo == null ? string.Empty : (templstZaiBaoProductInfo.QuotaSharePercentage == "0" ||
                                                                                                         templstZaiBaoProductInfo.QuotaSharePercentage == "0.00") ? "0" : "1";
                    currentModel.SaparateFlag = templstZaiBaoProductInfo == null ? string.Empty : tempQuotaSharePercentage;

                    //分保保额
                    if (tempModel.IsMrHealth)
                    {
                        currentModel.ReinsuranceAmnt = tempModel.SumReinsured;
                    }
                    else
                    {
                        string para1 = string.IsNullOrWhiteSpace(tempModel.SumReinsured) ? string.Empty : tempModel.SumReinsured.Trim();
                        string para2 = string.IsNullOrWhiteSpace(tempModel.SumReinsured2) ? string.Empty : tempModel.SumReinsured2.Trim();
                        currentModel.ReinsuranceAmnt = this.GetReinsuranceAmnt(para1, para2);
                    }

                    //自留额
                    currentModel.RetentionAmount = templstZaiBaoProductInfo == null ? string.Empty :
                                                   templstZaiBaoProductInfo.RetentionAmount;

                    //货币代码
                    currentModel.Currency = "156";

                    //分保比例
                    currentModel.QuotaSharePercentage = templstZaiBaoProductInfo == null ? string.Empty :
                                                        templstZaiBaoProductInfo.QuotaSharePercentage;

                    //分保费
                    if (tempModel.IsMrHealth)
                    {
                        currentModel.ReinsurancePremium = Common.ConvertToStrToStrDecimal(tempModel.MonthlyReinsurancePremium);
                    }
                    else
                    {
                        string para1 = string.IsNullOrWhiteSpace(tempModel.MonthlyReinsurancePremium) ?
                                       string.Empty : tempModel.MonthlyReinsurancePremium.Trim();
                        string para2 = string.IsNullOrWhiteSpace(tempModel.MonthlyReinsurancePremium2) ?
                                       string.Empty : tempModel.MonthlyReinsurancePremium2.Trim();

                        currentModel.ReinsurancePremium = this.GetReinsuranceAmnt(para1, para2);
                    }

                    //分保佣金
                    if (tempModel.IsMrHealth)
                    {
                        currentModel.ReinsuranceCommssion = Common.ConvertToStrToStrDecimal(tempModel.MonthlyReinsuranceCommission);
                    }
                    else
                    {
                        string para1 = string.IsNullOrWhiteSpace(tempModel.MonthlyReinsuranceCommission) ?
                                       string.Empty : tempModel.MonthlyReinsuranceCommission.Trim();
                        string para2 = string.IsNullOrWhiteSpace(tempModel.MonthlyReinsuranceCommission2) ?
                                       string.Empty : tempModel.MonthlyReinsuranceCommission2.Trim();

                        currentModel.ReinsuranceCommssion = this.GetReinsuranceAmnt(para1, para2);
                    }

                    //ReComputationsDate
                    currentModel.ReComputationsDate = Common.GetLastDayOfMonth(yearMonthDay);

                    //账单归属日期
                    currentModel.AccountGetDate = Common.GetLastDayOfMonth(yearMonthDay);

                    serialNumber++;

                    lRContModelList.Add(currentModel);
                }
            }
        }
示例#13
0
        public void WriteLRContSheet(ContractInfoBusiness contractInfoBusiness,
                                     string OutPutFolderPath, string dateyyyymm)
        {
            IExcel excelApp = new ExcelCore.ExcelCore();

            try
            {
                ProcessLogProxy.Normal("Start building LRCont excel");
                var           excelPath     = OutPutFolderPath + @"\TEMP_" + ExcelTemplateName.LRCont + ".xlsx";
                ExcelTemplate excelTemplate = new ExcelTemplate();
                excelTemplate.CreateTemplate(excelApp, excelPath, ExcelTemplateName.LRCont);//创建模板
                int serialNumber = 1;
                SetGroupDataToModel(contractInfoBusiness, dateyyyymm, ref serialNumber);
                SetIndividualDataToModel(contractInfoBusiness, dateyyyymm, ref serialNumber);
                excelApp.OpenExcel(excelPath, false);
                for (int i = 0; i < lRContModelList.Count; i++)
                {
                    var model = lRContModelList[i];

                    excelApp.SetCellValue(i + 2, "A", model.TransactionNo);
                    excelApp.SetCellValue(i + 2, "B", model.CompanyCode);
                    excelApp.SetCellValue(i + 2, "C", model.GrpPolicyNo);

                    if (model.IsGroup && string.IsNullOrWhiteSpace(model.GrpProductNo))
                    {
                        Color errorBackGroudColor = Color.Yellow;
                        excelApp.SetCellBackgroundColor(i + 2, 4, errorBackGroudColor);
                    }
                    else
                    {
                        excelApp.SetCellValue(i + 2, "D", model.GrpProductNo);
                    }

                    excelApp.SetCellValue(i + 2, "E", model.PolicyNo);
                    excelApp.SetCellValue(i + 2, "F", model.ProductNo);
                    excelApp.SetCellValue(i + 2, "G", model.GPFlag);
                    excelApp.SetCellValue(i + 2, "H", model.MainProductNo);
                    excelApp.SetCellValue(i + 2, "I", model.MainProductFlag);
                    excelApp.SetCellValue(i + 2, "J", model.ProductCode);
                    excelApp.SetCellValue(i + 2, "K", model.LiabilityCode);
                    excelApp.SetCellValue(i + 2, "L", model.LiabilityName);
                    excelApp.SetCellValue(i + 2, "M", model.Classification);
                    excelApp.SetCellValue(i + 2, "N", model.EventType);
                    excelApp.SetCellValue(i + 2, "O", model.RenewalTimes);
                    excelApp.SetCellValue(i + 2, "P", model.TermType);
                    excelApp.SetCellValue(i + 2, "Q", model.ManageCom);
                    excelApp.SetCellValue(i + 2, "R", model.SignDate);
                    excelApp.SetCellValue(i + 2, "S", model.EffDate);
                    excelApp.SetCellValue(i + 2, "T", model.PolYear);
                    excelApp.SetCellValue(i + 2, "U", model.InvalidDate);
                    excelApp.SetCellValue(i + 2, "V", model.UWConclusion);
                    excelApp.SetCellValue(i + 2, "W", model.PolStatus);
                    excelApp.SetCellValue(i + 2, "X", model.Status);
                    excelApp.SetCellValue(i + 2, "Y", model.BasicSumInsured);
                    excelApp.SetCellValue(i + 2, "Z", model.RiskAmnt);
                    excelApp.SetCellValue(i + 2, "AA", model.Premium);
                    excelApp.SetCellValue(i + 2, "AB", model.AccountValue);
                    excelApp.SetCellValue(i + 2, "AC", model.FacultativeFlag);
                    excelApp.SetCellValue(i + 2, "AD", model.AnonymousFlag);
                    excelApp.SetCellValue(i + 2, "AE", model.WaiverFlag);
                    excelApp.SetCellValue(i + 2, "AF", model.WaiverPrem);
                    excelApp.SetCellValue(i + 2, "AG", model.FinalCashValue);
                    excelApp.SetCellValue(i + 2, "AH", model.FinalLiabilityReserve);
                    excelApp.SetCellValue(i + 2, "AI", model.InsuredNo);
                    excelApp.SetCellValue(i + 2, "AJ", model.InsuredName);
                    excelApp.SetCellValue(i + 2, "AK", model.InsuredSex);
                    excelApp.SetCellValue(i + 2, "AL", model.InsuredCertType);
                    excelApp.SetCellValue(i + 2, "AM", model.InsuredCertNo);
                    excelApp.SetCellValue(i + 2, "AN", model.OccupationType);
                    excelApp.SetCellValue(i + 2, "AO", model.AppntAge);
                    excelApp.SetCellValue(i + 2, "AP", model.PreAge);
                    excelApp.SetCellValue(i + 2, "AQ", model.ProfessionalFee);
                    excelApp.SetCellValue(i + 2, "AR", model.SubStandardFee);
                    excelApp.SetCellValue(i + 2, "AS", model.EMRate);
                    excelApp.SetCellValue(i + 2, "AT", model.ProjectFlag);
                    excelApp.SetCellValue(i + 2, "AU", model.InsurePeoples);
                    excelApp.SetCellValue(i + 2, "AV", model.SaparateFlag);
                    excelApp.SetCellValue(i + 2, "AW", model.ReInsuranceContNo);
                    excelApp.SetCellValue(i + 2, "AX", model.ReinsurerCode);
                    excelApp.SetCellValue(i + 2, "AY", model.ReinsurerName);
                    excelApp.SetCellValue(i + 2, "AZ", model.ReinsurMode);
                    excelApp.SetCellValue(i + 2, "BA", model.ReinsuranceAmnt);
                    excelApp.SetCellValue(i + 2, "BB", model.RetentionAmount);
                    excelApp.SetCellValue(i + 2, "BC", model.Currency);
                    excelApp.SetCellValue(i + 2, "BD", model.QuotaSharePercentage);
                    excelApp.SetCellValue(i + 2, "BE", model.ReinsurancePremium);
                    excelApp.SetCellValue(i + 2, "BF", model.ReinsuranceCommssion);
                    excelApp.SetCellValue(i + 2, "BG", model.ReComputationsDate);
                    excelApp.SetCellValue(i + 2, "BH", model.AccountGetDate);
                }
                excelApp.SetSheetAutoFit("Sheet1");
                excelApp.Save();
                excelApp.Close();
                ProcessLogProxy.SuccessMessage("Build Success");
            }
            catch (Exception ex)
            {
                ProcessLogProxy.Error(ex.Message);
                ProcessLogProxy.Error("Build fail");
            }
        }
示例#14
0
        public void InputDataToLRProductSheet(ContractInfoBusiness contractInfoBusiness,
                                              string OutPutFolderPath, string yearMonthDay)
        {
            excelApp = new ExcelCore.ExcelCore();
            try
            {
                //contractInfoBusiness.lstLRInsureContModel
                ProcessLogProxy.Normal("Start building LRProduct excel");
                var lstHanReModel          = contractInfoBusiness.lstHanReModel;
                var lstMuReModel           = contractInfoBusiness.lstMuReModel;
                var lstRGAModel            = contractInfoBusiness.lstRGAModel;
                var lstSwissReModel        = contractInfoBusiness.lstSwissReModel;
                var lstHugeDisasterModel   = contractInfoBusiness.lstHugeDisasterModel;
                var lstTEMP_LMProductModel = contractInfoBusiness.lstTEMP_LMProductModel;
                var lstProductInfoModel    = contractInfoBusiness.lstProductInfoModel;
                //var lstTEMP_LMLiabilityModel = contractInfoBusiness.lstTEMP_LMLiabilityModel;
                var           excelPath     = OutPutFolderPath + @"\TEMP_" + ExcelTemplateName.LRProduct + ".xlsx";
                ExcelTemplate excelTemplate = new ExcelTemplate();
                excelTemplate.CreateTemplate(excelApp, excelPath, ExcelTemplateName.LRProduct);
                excelApp.OpenExcel(excelPath, false);
                excelApp.SelectSheet(LRProductSheetName);

                int serialNumber  = 1;
                int startRowIndex = 2;

                this.Test2(lstHanReModel, yearMonthDay, ref serialNumber, ref startRowIndex,
                           lstTEMP_LMProductModel, contractInfoBusiness);
                this.Test2(lstMuReModel, yearMonthDay, ref serialNumber, ref startRowIndex,
                           lstTEMP_LMProductModel, contractInfoBusiness);
                this.Test2(lstRGAModel, yearMonthDay, ref serialNumber, ref startRowIndex,
                           lstTEMP_LMProductModel, contractInfoBusiness);
                this.Test2(lstSwissReModel, yearMonthDay, ref serialNumber, ref startRowIndex,
                           lstTEMP_LMProductModel, contractInfoBusiness);

                foreach (var temp in lstHugeDisasterModel)
                {
                    var tempList = lstTEMP_LMProductModel.Where(e => e.StartDate <= temp.EffectiveDate);

                    var tempModel = (from lmProduct in tempList
                                     join productInfo in lstProductInfoModel
                                     on lmProduct.ProductCode equals productInfo.ProductCode
                                     select new
                    {
                        productCode = lmProduct.ProductCode,
                        productName = lmProduct.ProductName,
                        productType = lmProduct.ProductType,
                        TermType = lmProduct.TermType
                    }).ToList();

                    int contractOrder = 0;
                    foreach (var temp1 in tempModel)
                    {
                        this.Test3(yearMonthDay, serialNumber, startRowIndex, temp, contractOrder,
                                   temp1.productCode, temp1.productName, temp1.productType,
                                   temp1.TermType, contractInfoBusiness);

                        contractOrder += 1;
                        serialNumber++;
                        startRowIndex++;
                    }

                    //foreach (var temp1 in tempModel)
                    //{
                    //    this.Test3(yearMonthDay, serialNumber, ref startRowIndex, temp, contractOrder,
                    //        temp1.productCode, temp1.productName, temp1.productType, temp1.LiabilityCode,
                    //        temp1.TermType, contractInfoBusiness);

                    //    contractOrder += 1;
                    //}
                }
                ProcessLogProxy.SuccessMessage("Build Success");
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                excelApp.SetSheetAutoFit(LRProductSheetName);
                excelApp.Save();
                excelApp.Close();
            }
        }
示例#15
0
        private void TestCommand()
        {
            if (!CheckExcelPath())
            {
                return;
            }
            Task.Factory.StartNew(() =>
            {
                CommFuns.KillExcelProcess();
                ContractInfoBusiness contractInfoBusiness = new ContractInfoBusiness();
                LRProduct lrProduct       = new LRProduct();
                LRInsureCont lRInsureCont = new LRInsureCont();
                LRAccount LRAccount       = new LRAccount();
                string lastDateOfMonth    = string.Empty;
                SetConfigInformationFilePath();
                try
                {
                    string[] lstInputStruct = this.InputFolderPath.Trim('\\').Split('\\');

                    if (lstInputStruct.Length > 1)
                    {
                        bool isValid;
                        string rootInputPathFolderName = lstInputStruct[lstInputStruct.Length - 1];
                        lastDateOfMonth = this.GetCurrentMonthLastDay(rootInputPathFolderName, out isValid);

                        if (!isValid)
                        {
                            ProcessLogProxy.Error("The input path is illegal. The last folder format must be yyyymm or yyyymmdd!");
                            return;
                        }
                    }
                    else
                    {
                        ProcessLogProxy.Error("The input path is illegal. The last folder format must be yyyymm or yyyymmdd!");
                        return;
                    }

                    // get data source from ContractInfo
                    contractInfoBusiness.GetInformationDataFromExcel(ReferenceFolder, InputFolderPath);

                    //得到表二的数据
                    lRInsureCont.GetLRInsureContData(contractInfoBusiness);

                    //1.16.1 input data to LRProduct sheet 再保产品信息表
                    if (LRProductChecked)
                    {
                        lrProduct.InputDataToLRProductSheet(contractInfoBusiness, OutputFolderPath, lastDateOfMonth);
                    }

                    //1.16.2 LRInsureCont 生成再保合同信息表
                    if (LRInsureContChecked)
                    {
                        lRInsureCont.WriteLRInsureContSheet(contractInfoBusiness, OutputFolderPath, lastDateOfMonth);
                    }

                    //1.16.3 LRAccount 再保账单信息表
                    if (LRAccountChecked)
                    {
                        LRAccount.WriteLRAccountSheet(contractInfoBusiness, OutputFolderPath, lastDateOfMonth);
                    }

                    //1.16.4 LRCont 再保首续期险种明细表
                    if (LRContChecked)
                    {
                        LRCont lRCont = new LRCont(); lRCont.WriteLRContSheet(contractInfoBusiness, OutputFolderPath, lastDateOfMonth);
                    }

                    //1.16.5 LREdor 再保保全变更信息表
                    if (LREdorChecked)
                    {
                        LREdor lREdor = new LREdor(); lREdor.WriteLREdorSheet(contractInfoBusiness, OutputFolderPath, lastDateOfMonth);
                    }

                    //1.16.6 LRClaim 再保理赔信息表
                    if (LRClaimChecked)
                    {
                        LRClaim lRClaim = new LRClaim(); lRClaim.WriteLRClaimSheet(contractInfoBusiness, OutputFolderPath, lastDateOfMonth);
                    }

                    ProcessLogProxy.SuccessMessage("Success");
                }
                catch (Exception ex)
                {
                    ProcessLogProxy.Error(ex.Message);
                }
                finally
                {
                    CommFuns.KillExcelProcess();
                }
            });
        }
示例#16
0
        /// <summary>
        /// 得到团体信息
        /// </summary>
        /// <param name="businessModel"></param>
        /// <param name="yyyymm"></param>
        private void GetGroupLRClaimData(ContractInfoBusiness businessModel, string yyyymm, ref int serialNumber)
        {
            for (int i = 0; i < businessModel.lstRIClaimReportGroup.Count; i++)
            {
                var          tempModel    = businessModel.lstRIClaimReportGroup[i];
                LRClaimModel currentModel = new LRClaimModel();
                //交易编码
                currentModel.TransactionNo = CommFuns.GetTransactionNo6(serialNumber, yyyymm);//已赋值
                //保险机构代码
                currentModel.CompanyCode = origanizationCode;
                //团体保单号
                currentModel.GrpPolicyNo = tempModel.Chdrnum;

                //团体保单险种号码
                currentModel.GrpProductNo = tempModel.ProdTyp;//16.4

                //个人保单号
                currentModel.PolicyNo = tempModel.PolicyNo.PadLeft(7, '0');


                //个单保险险种号码
                currentModel.ProductNo = tempModel.ProdTyp;


                //保单团个性质代码
                currentModel.GPFlag = "02";

                // 主险保险险种号码
                var tempLCProductGroup = businessModel.lstTEMP_LCProductGroup.Where(e =>
                                                                                    e.GrpPolicyNo.Equals(currentModel.GrpPolicyNo) &&
                                                                                    e.PolicyNo.Substring(1, 7).Equal(currentModel.PolicyNo) &&
                                                                                    e.ProductNo.Equal(currentModel.ProductNo)).FirstOrDefault();
                currentModel.MainProductNo = tempLCProductGroup == null ? string.Empty : tempLCProductGroup.MainProductNo;

                //主附险性质代码
                currentModel.MainProductFlag = tempLCProductGroup == null ? string.Empty : tempLCProductGroup.MainProductFlag;

                //产品编码
                currentModel.ProductCode = tempModel.ProductCode;

                //责任代码
                currentModel.LiabilityCode = tempModel.Claimcond;

                //责任名称
                var tempCategory = PersonalLiabilityCategory.LstCategory.Where(e => e.CategoryCode.Equal(tempModel.Claimcond)).FirstOrDefault();
                currentModel.LiabilityName = tempCategory == null ? string.Empty : tempCategory.CategoryName;//16.4

                //给付责任代码
                currentModel.GetLiabilityCode = currentModel.LiabilityCode;

                //给付责任名称
                currentModel.GetLiabilityName = currentModel.LiabilityName;

                //赔案号
                var LLClaimDetailGroup = businessModel.lstLLClaimDetailGroup.Where(A => A.PolicyNo.PadLeft(7, '0') == currentModel.PolicyNo && A.GrpPolicyNo == currentModel.GrpPolicyNo).FirstOrDefault();
                currentModel.ClaimNo = LLClaimDetailGroup == null ? "" : LLClaimDetailGroup.ClmCaseNo;

                //赔付责任类型代码
                LLClaimDetailGroup       = businessModel.lstLLClaimDetailGroup.Where(A => A.ClmCaseNo == currentModel.ClaimNo).FirstOrDefault();
                currentModel.BenefitType = LLClaimDetailGroup == null ? "" : LLClaimDetailGroup.BenefitType;

                //保险期限类型
                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 ? ConfigInformation.TextValue : 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 = tempLcGrpContGroup == null ? string.Empty : tempLcGrpContGroup.EffDate;

                //保单年度
                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";

                //基本保额
                var lCProduct_Group = businessModel.lstTEMP_LCProductGroup.Where(A => A.GrpPolicyNo == currentModel.GrpPolicyNo && A.PolicyNo.Substring(1, 7) == currentModel.PolicyNo && A.ProductNo == currentModel.GrpProductNo).FirstOrDefault();
                currentModel.BasicSumInsured = lCProduct_Group == null ? string.Empty : Common.ConvertToStrToStrDecimal(lCProduct_Group.BasicSumInsured.Trim());

                //风险保额
                currentModel.RiskAmnt = lCProduct_Group == null ? string.Empty : Common.ConvertToStrToStrDecimal(lCProduct_Group.RiskAmnt.Trim());

                //保费
                currentModel.Premium = lCProduct_Group == null ? string.Empty : Common.ConvertToStrToStrDecimal(lCProduct_Group.Premium.Trim());


                //免赔类型代码
                LLClaimDetailGroup          = businessModel.lstLLClaimDetailGroup.Where(A => A.ClmCaseNo == currentModel.ClaimNo).FirstOrDefault();
                currentModel.DeductibleType = LLClaimDetailGroup == null ? "" : LLClaimDetailGroup.DeductibleType;

                //免赔额
                currentModel.Deductible = LLClaimDetailGroup == null ? "" : LLClaimDetailGroup.Deductible;

                //赔付比例
                currentModel.ClaimRatio = LLClaimDetailGroup == null ? "" : LLClaimDetailGroup.ClaimRatio;

                //保险账户价值 //TODO 团体
                var tempInsureAcc = businessModel.lstTEMP_LCInsureAcc.Where(e => e.PolicyNo.Equal(currentModel.PolicyNo) &&
                                                                            e.ProductNo.Equal(currentModel.ProductNo)).FirstOrDefault();

                currentModel.AccountValue = "0";

                //临分标记
                currentModel.FacultativeFlag = ConfigInformation.TextValue;

                //无名单标志
                currentModel.AnonymousFlag = "0";

                //豁免险标志
                currentModel.WaiverFlag = "0";

                //所需豁免剩余保费
                currentModel.WaiverPrem = "0";
                //期末现金价值
                currentModel.FinalCashValue = ConfigInformation.NumberValue;

                //被保人客户号
                currentModel.InsuredNo = tempModel.Clntnum.PadLeft(8, '0');

                //被保人姓名
                var tempInsuredGroup = businessModel.lst_LCInsuredGroup.Where(e => e.PolicyNo.Substring(1, 7).Equal(currentModel.PolicyNo) &&
                                                                              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.TextValue;

                //期末责任准备金
                currentModel.FinalLiabilityReserve = ConfigInformation.NumberValue;

                //职业加费金额
                currentModel.ProfessionalFee = "0";

                //次标准体加费金额
                currentModel.SubStandardFee = "0";

                //EM加点
                currentModel.EMRate = tempLCProductGroup == null ? string.Empty : Common.ConvertToStrToStrDecimal(tempLCProductGroup.EMRate);

                //建工险标志
                currentModel.ProjectFlag = ConfigInformation.TextValue;

                //投保总人数
                currentModel.InsurePeoples = "1";

                //再保险公司名称
                currentModel.ReinsurerName = Common.DefaultCommanyName;

                //再保险公司代码
                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();

                currentModel.ReInsuranceContNo = templstZaiBaoProductInfo == null ? string.Empty :
                                                 templstZaiBaoProductInfo.ReInsuranceContNo;

                //分保方式
                currentModel.ReinsurMode = templstZaiBaoProductInfo == null ? string.Empty :
                                           templstZaiBaoProductInfo.ReinsurMode;

                //分出标记
                string tempQuotaSharePercentage = templstZaiBaoProductInfo == null ? string.Empty : (templstZaiBaoProductInfo.QuotaSharePercentage == "0" ||
                                                                                                     templstZaiBaoProductInfo.QuotaSharePercentage == "0.00") ? "0" : "1";

                currentModel.SaparateFlag = templstZaiBaoProductInfo == null ? string.Empty : tempQuotaSharePercentage;

                //分保保额
                currentModel.ReinsuranceAmnt = ConfigInformation.NumberValue;

                //自留额
                currentModel.RetentionAmount = templstZaiBaoProductInfo == null ? string.Empty :
                                               Common.ConvertToStrToStrDecimal(templstZaiBaoProductInfo.RetentionAmount);

                //分保比例
                currentModel.QuotaSharePercentage = templstZaiBaoProductInfo == null ? string.Empty :
                                                    templstZaiBaoProductInfo.QuotaSharePercentage;

                //赔案号  lRClaimModel.ClaimNo  前面赋值

                //出险日期
                currentModel.AccidentDate = tempModel.Incurrdate.Substring(0, 4) + "/" + tempModel.Incurrdate.Substring(4, 2) + "/" + tempModel.Incurrdate.Substring(6, 2);

                //结案日期
                LLClaimDetailGroup       = businessModel.lstLLClaimDetailGroup.Where(A => A.ClmCaseNo == currentModel.ClaimNo).FirstOrDefault();
                currentModel.ClmSettDate = LLClaimDetailGroup == null ? "" : LLClaimDetailGroup.ClmSettDate;

                //理赔结论代码
                currentModel.PayStatusCode = LLClaimDetailGroup == null ? "" : LLClaimDetailGroup.PayStatusCode;

                //实际赔款金额
                currentModel.ClaimMoney = tempModel.Payclam;

                //摊回赔款金额
                currentModel.BackClaimMoney = tempModel.Clmrcusr01;

                //摊回日期
                currentModel.BackDate = GetLastDayOfMonth(yyyymm);

                //货币代码
                currentModel.Currency = "156";

                //分保计算日期
                currentModel.ReComputationsDate = GetLastDayOfMonth(yyyymm);

                //账单归属日期
                currentModel.AccountGetDate = GetLastDayOfMonth(yyyymm);

                serialNumber++;

                lRClaimModelList.Add(currentModel);
            }
        }
示例#17
0
        private void Test(string yearMonthDay, int serialNumber, int rowIndex,
                          RIContractInfo temp, int contractOrder, int currentIndex,
                          string productType, string liabilityCode, string termType,
                          ContractInfoBusiness contractInfoBusiness, bool isMainContract = true)
        {
            ZaiBaoProductInfo tempModel = new ZaiBaoProductInfo();

            string currentTransactionNo = CommFuns.GetTransactionNo2(serialNumber, yearMonthDay);

            excelApp.SetCellValue(rowIndex, "A", currentTransactionNo);
            excelApp.SetCellValue(rowIndex, "B", origanizationCode);

            var tempEntity      = reinsurer.GetReinsurerInforByName(temp.Reinsurer);
            var tempCompanyCode = tempEntity == null ? string.Empty : tempEntity.ReinsurerCode;

            string currentReInsuranceContNo = string.Empty;
            string mainContractCode         = string.Empty;

            #region  废代码
            //string mainContractCode = "RICN" + tempCompanyCode + "M"
            //    + contractOrder.ToString().PadLeft(2, '0') + "000";

            //if (isMainContract)
            //{
            //    currentReInsuranceContNo = "RICN" + tempCompanyCode + temp.ContractTypeSign
            //    + contractOrder.ToString().PadLeft(2, '0') + "000";
            //}
            //else
            //{
            //    currentReInsuranceContNo = "RICN" + tempCompanyCode + temp.ContractTypeSign
            //    + contractOrder.ToString().PadLeft(2, '0') + currentIndex.ToString().PadLeft(3, '0');
            //}
            #endregion

            var referenceEntity = contractInfoBusiness.lstLRInsureContModel.Where(e => e.ReInsuranceContName.Equals(temp.TreatyName) &&
                                                                                  e.ReinsurerCode.Equals(tempCompanyCode)).FirstOrDefault();

            currentReInsuranceContNo = referenceEntity == null ? string.Empty : referenceEntity.ReInsuranceContNo;
            mainContractCode         = referenceEntity == null ? string.Empty : referenceEntity.MainReInsuranceContNo;

            excelApp.SetCellValue(rowIndex, "C", currentReInsuranceContNo);
            excelApp.SetCellValue(rowIndex, "D", temp.TreatyName);

            excelApp.SetCellValue(rowIndex, "E", string.Empty);
            excelApp.SetCellValue(rowIndex, "F", mainContractCode);

            string tempContractType = temp.ContractTypeSign.Equals("M") ? "1" : "2";

            excelApp.SetCellValue(rowIndex, "G", tempContractType);

            excelApp.SetCellValue(rowIndex, "H", temp.ProductCode);

            excelApp.SetCellValue(rowIndex, "I", temp.ReinsurerName);

            //string tempGpfFlag = string.Empty;
            string productCodeFirstChar = string.Empty;

            if (!string.IsNullOrEmpty(temp.ProductCode))
            {
                productCodeFirstChar = temp.ProductCode.Trim().Substring(0, 1);

                productCodeFirstChar = productCodeFirstChar.Equals("G") ? "02" : "01";

                excelApp.SetCellValue(rowIndex, "J", productCodeFirstChar);
            }

            excelApp.SetCellValue(rowIndex, "K", productType);
            excelApp.SetCellValue(rowIndex, "L", liabilityCode);

            excelApp.SetCellValue(rowIndex, "M", temp.BenefitReinsured);
            excelApp.SetCellValue(rowIndex, "N", tempCompanyCode);

            //excelApp.SetCellValue(rowIndex, "O", temp.Reinsurer);
            excelApp.SetCellValue(rowIndex, "O", tempEntity == null ? string.Empty : tempEntity.ReinsurerChineseName);

            excelApp.SetCellValue(rowIndex, "P", temp.RIratio);

            string tempMethodCode = this.GetRiMethodICodeByName(temp.RImethodI);

            excelApp.SetCellValue(rowIndex, "Q", tempMethodCode);

            excelApp.SetCellValue(rowIndex, "R", "04");
            excelApp.SetCellValue(rowIndex, "S", termType);

            string currentRetentionAmount = this.GetRetentionAmount(tempMethodCode, temp.Retention);
            excelApp.SetCellValue(rowIndex, "T", currentRetentionAmount);

            string currentRetentionPercentage = this.GetRetentionPercentage(tempMethodCode, temp.Retention);
            excelApp.SetCellValue(rowIndex, "U", currentRetentionPercentage);

            string QuotaSharePercentage = "0";
            if (tempMethodCode.Equals("2") || tempMethodCode.Equals("3"))
            {
                QuotaSharePercentage = (1 - decimal.Parse(currentRetentionPercentage)).ToString("0.00");
            }
            excelApp.SetCellValue(rowIndex, "V", QuotaSharePercentage);

            tempModel.TransactionNo       = currentTransactionNo;
            tempModel.CompanyCode         = origanizationCode;
            tempModel.ReInsuranceContNo   = currentReInsuranceContNo;
            tempModel.ReInsuranceContName = temp.TreatyName;

            tempModel.ReInsuranceContTitle  = ConfigInformation.TextValue;
            tempModel.MainReInsuranceContNo = mainContractCode;
            tempModel.ContOrAmendmentType   = tempContractType;
            tempModel.ProductCode           = temp.ProductCode;

            tempModel.ProductName   = temp.ReinsurerName;
            tempModel.GPFlag        = productCodeFirstChar;
            tempModel.ProductType   = productType;
            tempModel.LiabilityCode = liabilityCode;

            tempModel.LiabilityName    = temp.BenefitReinsured;
            tempModel.ReinsurerCode    = tempCompanyCode;
            tempModel.ReinsurerName    = temp.Reinsurer;
            tempModel.ReinsuranceShare = temp.RIratio;

            tempModel.ReinsurMode     = tempMethodCode;
            tempModel.ReInsuranceType = "04";
            tempModel.TermType        = termType;
            tempModel.RetentionAmount = currentRetentionAmount;

            tempModel.RetentionPercentage  = currentRetentionPercentage;
            tempModel.QuotaSharePercentage = QuotaSharePercentage;

            contractInfoBusiness.lstZaiBaoProductInfo.Add(tempModel);
        }
示例#18
0
        public void WriteLREdorSheet(ContractInfoBusiness contractInfoBusiness, string OutPutFolderPath, string dateyyyymm)
        {
            IExcel excelApp     = new ExcelCore.ExcelCore();
            int    serialNumber = 0;

            try
            {
                ProcessLogProxy.Normal("Start building LREdor excel");
                var           excelPath     = OutPutFolderPath + @"\TEMP_" + ExcelTemplateName.LREdor + ".xlsx";
                ExcelTemplate excelTemplate = new ExcelTemplate();
                excelTemplate.CreateTemplate(excelApp, excelPath, ExcelTemplateName.LREdor);//创建模板
                GetGroupLREdorData(contractInfoBusiness, dateyyyymm);
                GetLREdorData(contractInfoBusiness, dateyyyymm);
                excelApp.OpenExcel(excelPath, false);
                for (int i = 0; i < lREdorModelList.Count; i++)
                {
                    serialNumber++;
                    var model = lREdorModelList[i];
                    excelApp.SetCellValue(i + 2, "A", CommFuns.GetTransactionNo5(i + 1, dateyyyymm));
                    excelApp.SetCellValue(i + 2, "B", model.CompanyCode);
                    excelApp.SetCellValue(i + 2, "C", model.GrpPolicyNo);
                    excelApp.SetCellValue(i + 2, "D", model.GrpProductNo);
                    excelApp.SetCellValue(i + 2, "E", model.PolicyNo);
                    excelApp.SetCellValue(i + 2, "F", model.ProductNo);
                    excelApp.SetCellValue(i + 2, "G", model.GPFlag);
                    excelApp.SetCellValue(i + 2, "H", model.MainProductNo);
                    excelApp.SetCellValue(i + 2, "I", model.MainProductFlag);
                    excelApp.SetCellValue(i + 2, "J", model.ProductCode);
                    excelApp.SetCellValue(i + 2, "K", model.LiabilityCode);
                    excelApp.SetCellValue(i + 2, "L", model.LiabilityName);
                    excelApp.SetCellValue(i + 2, "M", model.Classification);
                    excelApp.SetCellValue(i + 2, "N", model.TermType);
                    excelApp.SetCellValue(i + 2, "O", model.ManageCom);
                    excelApp.SetCellValue(i + 2, "P", model.SignDate);
                    excelApp.SetCellValue(i + 2, "Q", model.EffDate);
                    excelApp.SetCellValue(i + 2, "R", model.PolYear);
                    excelApp.SetCellValue(i + 2, "S", model.InvalidDate);
                    excelApp.SetCellValue(i + 2, "T", model.UWConclusion);
                    excelApp.SetCellValue(i + 2, "U", model.PolStatus);
                    excelApp.SetCellValue(i + 2, "V", model.Status);
                    excelApp.SetCellValue(i + 2, "W", model.BasicSumInsured);
                    excelApp.SetCellValue(i + 2, "X", model.RiskAmnt);
                    excelApp.SetCellValue(i + 2, "Y", model.Premium);
                    excelApp.SetCellValue(i + 2, "Z", model.AccountValue);
                    excelApp.SetCellValue(i + 2, "AA", model.FacultativeFlag);
                    excelApp.SetCellValue(i + 2, "AB", model.AnonymousFlag);
                    excelApp.SetCellValue(i + 2, "AC", model.WaiverFlag);
                    excelApp.SetCellValue(i + 2, "AD", model.WaiverPrem);
                    excelApp.SetCellValue(i + 2, "AE", model.FinalCashValue);
                    excelApp.SetCellValue(i + 2, "AF", model.FinalLiabilityReserve);
                    excelApp.SetCellValue(i + 2, "AG", model.InsuredNo);
                    excelApp.SetCellValue(i + 2, "AH", model.InsuredName);
                    excelApp.SetCellValue(i + 2, "AI", model.InsuredSex);
                    excelApp.SetCellValue(i + 2, "AJ", model.InsuredCertType);
                    excelApp.SetCellValue(i + 2, "AK", model.InsuredCertNo);
                    excelApp.SetCellValue(i + 2, "AL", model.OccupationType);
                    excelApp.SetCellValue(i + 2, "AM", model.AppntAge);
                    excelApp.SetCellValue(i + 2, "AN", model.PreAge);
                    excelApp.SetCellValue(i + 2, "AO", model.ProfessionalFee);
                    excelApp.SetCellValue(i + 2, "AP", model.SubStandardFee);
                    excelApp.SetCellValue(i + 2, "AQ", model.EMRate);
                    excelApp.SetCellValue(i + 2, "AR", model.ProjectFlag);
                    excelApp.SetCellValue(i + 2, "AS", model.InsurePeoples);
                    excelApp.SetCellValue(i + 2, "AT", model.EndorAcceptNo);
                    excelApp.SetCellValue(i + 2, "AU", model.EndorsementNo);
                    excelApp.SetCellValue(i + 2, "AV", model.EdorType);
                    excelApp.SetCellValue(i + 2, "AW", model.EdorValiDate);
                    excelApp.SetCellValue(i + 2, "AX", model.EdorConfDate);
                    excelApp.SetCellValue(i + 2, "AY", model.EdorMoney);
                    excelApp.SetCellValue(i + 2, "AZ", model.SaparateFlag);
                    excelApp.SetCellValue(i + 2, "BA", model.ReInsuranceContNo);
                    excelApp.SetCellValue(i + 2, "BB", model.ReinsurerCode);
                    excelApp.SetCellValue(i + 2, "BC", model.ReinsurerName);
                    excelApp.SetCellValue(i + 2, "BD", model.ReinsurMode);
                    excelApp.SetCellValue(i + 2, "BE", model.QuotaSharePercentage);
                    excelApp.SetCellValue(i + 2, "BF", model.PreInsuredAge);
                    excelApp.SetCellValue(i + 2, "BG", model.PreBasicSumInsured);
                    excelApp.SetCellValue(i + 2, "BH", model.PreRiskAmnt);
                    excelApp.SetCellValue(i + 2, "BI", model.PreReinsuranceAmnt);
                    excelApp.SetCellValue(i + 2, "BJ", model.PreRetentionAmount);
                    excelApp.SetCellValue(i + 2, "BK", model.PrePremium);
                    excelApp.SetCellValue(i + 2, "BL", model.PreAccountValue);
                    excelApp.SetCellValue(i + 2, "BM", model.PreWaiverPrem);
                    excelApp.SetCellValue(i + 2, "BN", model.ProjectAcreageChange);
                    excelApp.SetCellValue(i + 2, "BO", model.ProjectCostChange);
                    excelApp.SetCellValue(i + 2, "BP", model.ReinsuranceAmntChange);
                    excelApp.SetCellValue(i + 2, "BQ", model.RetentionAmount);
                    excelApp.SetCellValue(i + 2, "BR", model.ReinsurancePremiumChange);
                    excelApp.SetCellValue(i + 2, "BS", model.ReinsuranceCommssionChange);
                    excelApp.SetCellValue(i + 2, "BT", model.Currency);
                    excelApp.SetCellValue(i + 2, "BU", model.ReComputationsDate);
                    excelApp.SetCellValue(i + 2, "BV", model.AccountGetDate);
                }
                excelApp.SetSheetAutoFit("Sheet1");
                excelApp.Save();
                excelApp.Close();
                ProcessLogProxy.SuccessMessage("Build Success");
            }
            catch (Exception ex)
            {
                ProcessLogProxy.Error(ex.Message);
                ProcessLogProxy.Error("Build fail");
            }
        }
示例#19
0
        /// <summary>
        /// 得到个人信息
        /// </summary>
        /// <param name="businessModel"></param>
        /// <param name="yyyymm"></param>
        private void GetLRClaimData(ContractInfoBusiness businessModel, string yearMonthDay, ref int serialNumber)
        {
            for (int i = 0; i < businessModel.lstClaimSheetModel.Count; i++)
            {
                var tempModel = businessModel.lstClaimSheetModel[i];

                LRClaimModel currentModel = new LRClaimModel();
                //交易编码
                currentModel.TransactionNo = CommFuns.GetTransactionNo6(serialNumber, yearMonthDay);

                //保险机构代码
                currentModel.CompanyCode = origanizationCode;

                //团体保单号
                currentModel.GrpPolicyNo = "";

                //团体保单险种号码
                currentModel.GrpProductNo = ""; //kong

                //个人保单号
                currentModel.PolicyNo = tempModel.PolicyNo.PadLeft(8, '0');

                //主附险性质代码
                currentModel.MainProductFlag = CommFuns.GetMainProductFlag(tempModel.Product);

                // 个单保险险种号码
                var tempLCProduct = businessModel.lstTEMP_LCProduct.Where(e =>
                                                                          e.PolicyNo.Equal(currentModel.PolicyNo) &&
                                                                          e.ProductCode.Equal(tempModel.Product) &&
                                                                          e.MainProductFlag.Equals(currentModel.MainProductFlag)).FirstOrDefault();
                currentModel.ProductNo = tempLCProduct == null ? string.Empty : tempLCProduct.ProductNo;

                //保单团个性质代码
                currentModel.GPFlag = "01";

                // 主险保险险种号码
                tempLCProduct = businessModel.lstTEMP_LCProduct.Where(e => e.PolicyNo.Equal(currentModel.PolicyNo) && e.ProductNo.Equal(currentModel.ProductNo)).FirstOrDefault();
                currentModel.MainProductNo = tempLCProduct == null ? string.Empty : tempLCProduct.MainProductNo;



                //产品编码
                currentModel.ProductCode = tempModel.Product;

                //责任代码
                currentModel.LiabilityCode = tempModel.CauseOfClaim;

                //责任名称
                var tempCategory = PersonalLiabilityCategory.LstCategory.Where(e => e.CategoryCode.Equal(currentModel.LiabilityCode)).FirstOrDefault();
                currentModel.LiabilityName = tempCategory == null ? string.Empty : tempCategory.CategoryName;

                //赔案号
                var TEMPLLClaimDetail = businessModel.lstTEMP_LLClaimDetail.Where(A => A.PolicyNo == currentModel.PolicyNo && A.ProductNo == currentModel.ProductNo).FirstOrDefault();
                currentModel.ClaimNo = TEMPLLClaimDetail == null ? "" : TEMPLLClaimDetail.ClmCaseNo;

                //给付责任代码
                TEMPLLClaimDetail             = businessModel.lstTEMP_LLClaimDetail.Where(A => A.ClmCaseNo == currentModel.ClaimNo).FirstOrDefault();
                currentModel.GetLiabilityCode = TEMPLLClaimDetail == null ? "" : TEMPLLClaimDetail.GetLiabilityCode;

                //给付责任名称
                currentModel.GetLiabilityName = TEMPLLClaimDetail == null ? "" : TEMPLLClaimDetail.GetLiabilityName;

                //赔付责任类型代码
                currentModel.BenefitType = TEMPLLClaimDetail == null ? "" : TEMPLLClaimDetail.BenefitType;

                //保险期限类型
                var tempProductModel = businessModel.lstTEMP_LMProductModel.Where(e => e.ProductCode == currentModel.ProductCode).FirstOrDefault();
                currentModel.TermType = tempProductModel == null ? string.Empty : tempProductModel.TermType;

                //管理机构代码
                var tempLCCont = businessModel.lstTEMP_LCCont.Where(e => e.PolicyNo.Equals(tempModel.PolicyNo)).FirstOrDefault();
                currentModel.ManageCom = tempLCCont == null ? string.Empty : tempLCCont.ManageCom;

                //签单日期
                DateTime tempSignDate;
                string   strSignDate = string.Empty;
                if (tempLCCont != null)
                {
                    bool convertResult = DateTime.TryParse(tempLCCont.SignDate, out tempSignDate);

                    if (convertResult)
                    {
                        strSignDate = tempSignDate.ToString("yyyy/MM/dd");
                    }
                }
                currentModel.SignDate = strSignDate;

                //保险责任生效日期
                currentModel.EffDate = tempLCProduct == null ? string.Empty : tempLCProduct.EffDate;



                //保单年度
                if (!string.IsNullOrEmpty(strSignDate))
                {
                    int currentYear  = int.Parse(yearMonthDay.Substring(0, 4));
                    int signDateYear = int.Parse(strSignDate.Substring(0, 4));
                    currentModel.PolYear = (currentYear - signDateYear).ToString();
                }
                else
                {
                    currentModel.PolYear = "0";
                }

                //保险责任终止日期
                currentModel.InvalidDate = tempLCProduct == null ? string.Empty : tempLCProduct.InvalidDate;

                //核保结论代码
                currentModel.UWConclusion = tempLCProduct == null ? string.Empty : tempLCProduct.UWConclusion;

                //保单状态代码
                currentModel.PolStatus = "01";

                //保单险种状态代码
                currentModel.Status = "01";

                //基本保额
                var newTEMPLCProduct = businessModel.lstTEMP_LCProduct.Where(e => e.PolicyNo.Equal(currentModel.PolicyNo) && e.ProductNo.Equal(currentModel.ProductNo)).FirstOrDefault();
                currentModel.BasicSumInsured = newTEMPLCProduct == null ? string.Empty : Common.ConvertToStrToStrDecimal(newTEMPLCProduct.BasicSumInsured.Trim());

                //风险保额
                currentModel.RiskAmnt = newTEMPLCProduct == null ? string.Empty : Common.ConvertToStrToStrDecimal(newTEMPLCProduct.RiskAmnt.Trim());

                //保费
                currentModel.Premium = newTEMPLCProduct == null ? string.Empty : Common.ConvertToStrToStrDecimal(newTEMPLCProduct.Premium.Trim());

                //免赔类型代码
                currentModel.DeductibleType = TEMPLLClaimDetail == null ? "" : TEMPLLClaimDetail.DeductibleType;

                //免赔额
                currentModel.Deductible = TEMPLLClaimDetail == null ? "" : TEMPLLClaimDetail.Deductible;

                //赔付比例
                currentModel.ClaimRatio = TEMPLLClaimDetail == null ? "" : TEMPLLClaimDetail.ClaimRatio;

                //保险账户价值
                var tempInsureAcc = businessModel.lstTEMP_LCInsureAcc.Where(e => e.PolicyNo.Equal(currentModel.PolicyNo) &&
                                                                            e.ProductNo.Equal(currentModel.ProductNo)).ToList();
                decimal AccountValue = 0;
                for (int j = 0; j < tempInsureAcc.Count; j++)
                {
                    AccountValue += Common.ConvertToDecimalToStrDecimal(tempInsureAcc[i].AccountValue);
                }

                currentModel.AccountValue = AccountValue.ToString("0.00");

                //临分标记
                currentModel.FacultativeFlag = ConfigInformation.TextValue;

                //无名单标志
                currentModel.AnonymousFlag = "0";

                //豁免险标志
                currentModel.WaiverFlag = "0";

                //所需豁免剩余保费
                currentModel.WaiverPrem = "0";

                //期末现金价值
                currentModel.FinalCashValue = ConfigInformation.NumberValue;

                //被保人客户号
                currentModel.InsuredNo = tempModel.MembersCertificateNo.PadLeft(8, '0');;

                //被保人姓名
                var tempInsured = businessModel.lstTEMP_LCInsured.Where(e => e.PolicyNo.Equal(currentModel.PolicyNo) &&
                                                                        e.InsuredNo.Equal(currentModel.InsuredNo)).FirstOrDefault();
                currentModel.InsuredName = tempInsured == null ? string.Empty : tempInsured.InsuredName;

                //被保人性别
                currentModel.InsuredSex = tempInsured == null ? string.Empty : tempInsured.InsuredSex;

                //被保人证件类型
                currentModel.InsuredCertType = tempInsured == null ? string.Empty : tempInsured.InsuredCertType;

                //被保人证件编码
                currentModel.InsuredCertNo = tempInsured == null ? string.Empty : tempInsured.InsuredCertNo;

                //职业代码
                currentModel.OccupationType = tempInsured == null ? string.Empty : tempInsured.OccupationType;

                //投保年龄
                currentModel.AppntAge = tempInsured == null ? string.Empty : tempInsured.AppAge;

                //当前年龄
                currentModel.PreAge = ConfigInformation.TextValue;

                //期末责任准备金
                currentModel.FinalLiabilityReserve = ConfigInformation.NumberValue;

                //职业加费金额
                currentModel.ProfessionalFee = tempLCProduct == null ? string.Empty : Common.ConvertToStrToStrDecimal(tempLCProduct.ProfessionalFee);

                //次标准体加费金额
                currentModel.SubStandardFee = tempLCProduct == null ? string.Empty : Common.ConvertToStrToStrDecimal(tempLCProduct.SubStandardFee);

                //EM加点
                currentModel.EMRate = tempLCProduct == null ? string.Empty : Common.ConvertToStrToStrDecimal(tempLCProduct.EMRate);

                //建工险标志
                currentModel.ProjectFlag = ConfigInformation.TextValue;

                //投保总人数
                currentModel.InsurePeoples = "1";

                //再保险公司名称
                currentModel.ReinsurerName = tempModel.CompanyName;

                //再保险公司代码
                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();

                currentModel.ReInsuranceContNo = templstZaiBaoProductInfo == null ? string.Empty :
                                                 templstZaiBaoProductInfo.ReInsuranceContNo;

                //分保方式
                currentModel.ReinsurMode = templstZaiBaoProductInfo == null ? string.Empty :
                                           templstZaiBaoProductInfo.ReinsurMode;

                //分出标记
                string tempQuotaSharePercentage = templstZaiBaoProductInfo == null ? string.Empty : (templstZaiBaoProductInfo.QuotaSharePercentage == "0" ||
                                                                                                     templstZaiBaoProductInfo.QuotaSharePercentage == "0.00") ? "0" : "1";

                currentModel.SaparateFlag = templstZaiBaoProductInfo == null ? string.Empty : tempQuotaSharePercentage;

                //分保保额
                currentModel.ReinsuranceAmnt = ConfigInformation.NumberValue;

                //自留额
                currentModel.RetentionAmount = templstZaiBaoProductInfo == null ? string.Empty :
                                               Common.ConvertToStrToStrDecimal(templstZaiBaoProductInfo.RetentionAmount);

                //分保比例
                currentModel.QuotaSharePercentage = templstZaiBaoProductInfo == null ? string.Empty : templstZaiBaoProductInfo.QuotaSharePercentage;

                //赔案号 前面已经赋值 lRClaimModel.ClaimNo

                //出险日期
                var TEMP_LLClaimInfoModel = businessModel.lstTEMP_LLClaimInfo.Where(A => A.ClaimNo == currentModel.ClaimNo).FirstOrDefault();
                currentModel.AccidentDate = TEMP_LLClaimInfoModel == null ? "" : TEMP_LLClaimInfoModel.AccidentDate;

                //结案日期
                currentModel.ClmSettDate = TEMPLLClaimDetail == null ? "" : TEMPLLClaimDetail.ClmSettDate;

                //理赔结论代码
                currentModel.PayStatusCode = TEMPLLClaimDetail == null ? "" : TEMPLLClaimDetail.PayStatusCode;

                //实际赔款金额
                currentModel.ClaimMoney = tempModel.PaidAmount;

                //摊回赔款金额
                currentModel.BackClaimMoney = tempModel.RecoveryAmount;

                //摊回日期
                currentModel.BackDate = GetLastDayOfMonth(yearMonthDay);

                //货币代码
                currentModel.Currency = "156";

                //分保计算日期
                currentModel.ReComputationsDate = GetLastDayOfMonth(yearMonthDay);

                //账单归属日期
                currentModel.AccountGetDate = GetLastDayOfMonth(yearMonthDay);

                serialNumber++;
                lRClaimModelList.Add(currentModel);
            }
        }
示例#20
0
        private void Test3(string yearMonthDay, int serialNumber, int rowIndex,
                           HugeDisasterModel temp, int contractOrder, string productCode,
                           string productName, string productType, string termType, ContractInfoBusiness business)
        {
            ZaiBaoProductInfo tempModel            = new ZaiBaoProductInfo();
            string            currentTransactionNo = CommFuns.GetTransactionNo2(serialNumber, yearMonthDay);

            excelApp.SetCellValue(rowIndex, "A", currentTransactionNo);
            excelApp.SetCellValue(rowIndex, "B", origanizationCode);

            var tempEntity      = reinsurer.GetReinsurerInforByName(temp.Reinsurer);
            var tempCompanyCode = tempEntity == null ? string.Empty : tempEntity.ReinsurerCode;

            //string currentReInsuranceContNo = "RICN" + tempCompanyCode + "M"
            //    + contractOrder.ToString().PadLeft(2, '0') + "000";

            var referenceEntity = business.lstLRInsureContModel.Where(e => e.ReInsuranceContName.Equals(temp.TreatyName) &&
                                                                      e.ReinsurerCode.Equals(tempCompanyCode)).FirstOrDefault();

            string currentReInsuranceContNo = referenceEntity == null ? string.Empty : referenceEntity.ReInsuranceContNo;

            //mainContractCode = referenceEntity == null ? string.Empty : referenceEntity.MainReInsuranceContNo;

            excelApp.SetCellValue(rowIndex, "C", currentReInsuranceContNo);
            excelApp.SetCellValue(rowIndex, "D", temp.TreatyName);
            excelApp.SetCellValue(rowIndex, "E", string.Empty);
            excelApp.SetCellValue(rowIndex, "F", currentReInsuranceContNo);

            excelApp.SetCellValue(rowIndex, "G", "1");

            excelApp.SetCellValue(rowIndex, "H", productCode);

            excelApp.SetCellValue(rowIndex, "I", productName);

            //string tempGpfFlag = string.Empty;
            string productCodeFirstChar = string.Empty;

            if (!string.IsNullOrEmpty(productCode))
            {
                productCodeFirstChar = productCode.Trim().Substring(0, 1);

                productCodeFirstChar = productCodeFirstChar.Equals("G") ? "02" : "01";

                excelApp.SetCellValue(rowIndex, "J", productCodeFirstChar);
            }

            excelApp.SetCellValue(rowIndex, "K", productType);

            var tempCateGory = PersonalLiabilityCategory.LstCategory.Where(e => e.CategoryName.Equals(temp.BenefitReinsured)).FirstOrDefault();

            //excelApp.SetCellValue(rowIndex, "L", liabilityCode);
            excelApp.SetCellValue(rowIndex, "L", tempCateGory == null ? string.Empty : tempCateGory.CategoryCode);

            excelApp.SetCellValue(rowIndex, "M", temp.BenefitReinsured);
            excelApp.SetCellValue(rowIndex, "N", tempCompanyCode);

            excelApp.SetCellValue(rowIndex, "O", tempEntity == null ? string.Empty : tempEntity.ReinsurerChineseName);
            //excelApp.SetCellValue(rowIndex, "O", temp.Reinsurer);

            excelApp.SetCellValue(rowIndex, "P", temp.RIratio);

            string tempMethodCode = this.GetRiMethodICodeByName(temp.RImethodI);

            excelApp.SetCellValue(rowIndex, "Q", tempMethodCode);

            excelApp.SetCellValue(rowIndex, "R", "01");
            excelApp.SetCellValue(rowIndex, "S", termType);
            excelApp.SetCellValue(rowIndex, "T", "0");
            excelApp.SetCellValue(rowIndex, "U", "0");
            excelApp.SetCellValue(rowIndex, "V", "0");

            tempModel.TransactionNo       = currentTransactionNo;
            tempModel.CompanyCode         = origanizationCode;
            tempModel.ReInsuranceContNo   = currentReInsuranceContNo;
            tempModel.ReInsuranceContName = temp.TreatyName;

            tempModel.ReInsuranceContTitle  = ConfigInformation.TextValue;
            tempModel.MainReInsuranceContNo = currentReInsuranceContNo;
            tempModel.ContOrAmendmentType   = "1";
            tempModel.ProductCode           = productCode;

            tempModel.ProductName   = productName;
            tempModel.GPFlag        = productCodeFirstChar;
            tempModel.ProductType   = productType;
            tempModel.LiabilityCode = tempCateGory == null ? string.Empty : tempCateGory.CategoryCode;

            tempModel.LiabilityName    = temp.BenefitReinsured;
            tempModel.ReinsurerCode    = tempCompanyCode;
            tempModel.ReinsurerName    = temp.Reinsurer;
            tempModel.ReinsuranceShare = temp.RIratio;

            tempModel.ReinsurMode     = tempMethodCode;
            tempModel.ReInsuranceType = "01";
            tempModel.TermType        = termType;
            tempModel.RetentionAmount = "0";

            tempModel.RetentionPercentage  = "0";
            tempModel.QuotaSharePercentage = "0";


            business.lstZaiBaoProductInfo.Add(tempModel);
        }
示例#21
0
        /// <summary>
        /// 得到个人信息
        /// </summary>
        /// <param name="businessModel"></param>
        /// <param name="yyyymm"></param>
        private void GetLREdorData(ContractInfoBusiness businessModel, string yyyymm)
        {
            for (int i = 0; i < businessModel.lstInforceBusinessListing.Count; i++)
            {
                var         tempModel    = businessModel.lstInforceBusinessListing[i];
                LREdorModel currentModel = new LREdorModel();
                //交易编码
                currentModel.TransactionNo = "";

                //保险机构代码
                currentModel.CompanyCode = origanizationCode;

                //团体保单号
                currentModel.GrpPolicyNo = "";

                //团体保单险种号码
                currentModel.GrpProductNo = "";

                //个人保单号
                currentModel.PolicyNo = tempModel.PolicyNo;
                if (businessModel.lstTEMP_LCPolTransaction.Where(A => A.PolicyNo == tempModel.PolicyNo).Count() == 0)
                {
                    continue;
                }

                //主附险性质代码
                currentModel.MainProductFlag = this.GetMainProductFlag(tempModel.ProductCode);

                //个单保险险种号码
                var tempLCProduct = businessModel.lstTEMP_LCProduct.Where(e =>
                                                                          e.PolicyNo.Equal(currentModel.PolicyNo.PadLeft(8, '0')) &&
                                                                          e.ProductCode.Equal(tempModel.ProductCode) &&
                                                                          e.MainProductFlag.Equals(currentModel.MainProductFlag)).FirstOrDefault();

                currentModel.ProductNo = tempLCProduct == null ? string.Empty : tempLCProduct.ProductNo;

                //保单团个性质代码
                currentModel.GPFlag = "01";

                //主险保险险种号码
                tempLCProduct = businessModel.lstTEMP_LCProduct.Where(e =>
                                                                      e.PolicyNo.Equal(currentModel.PolicyNo.PadLeft(8, '0')) &&
                                                                      e.ProductNo.Equal(currentModel.ProductNo)).FirstOrDefault();

                currentModel.MainProductNo = tempLCProduct == null ? string.Empty : tempLCProduct.MainProductNo;

                //产品编码
                currentModel.ProductCode = tempModel.ProductCode;

                //责任代码
                currentModel.LiabilityCode = tempModel.Coverage1;

                //责任名称
                var tempCategory = PersonalLiabilityCategory.LstCategory.Where(e => e.CategoryCode.Equal(tempModel.Coverage1)).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 tempLCCont = businessModel.lstTEMP_LCCont.Where(e => e.PolicyNo.Equals(tempModel.PolicyNo)).FirstOrDefault();
                currentModel.ManageCom = tempLCCont == null ? string.Empty : tempLCCont.ManageCom;

                //签单日期
                DateTime tempSignDate;
                string   strSignDate = string.Empty;
                if (tempLCCont != null)
                {
                    bool convertResult = DateTime.TryParse(tempLCCont.SignDate, out tempSignDate);

                    if (convertResult)
                    {
                        strSignDate = tempSignDate.ToString("yyyy/MM/dd");
                    }
                }
                currentModel.SignDate = strSignDate;

                //保险责任生效日期
                currentModel.EffDate = tempLCProduct == null ? string.Empty : tempLCProduct.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 = tempLCProduct == null ? string.Empty : tempLCProduct.InvalidDate;

                //核保结论代码
                currentModel.UWConclusion = tempLCProduct == null ? string.Empty : tempLCProduct.UWConclusion;

                //保单状态代码
                currentModel.PolStatus = "01";

                //保单险种状态代码
                currentModel.Status = "01";

                //基本保额
                currentModel.BasicSumInsured = Common.ConvertToStrToStrDecimal(tempModel.SumInsured);

                // 风险保额
                currentModel.RiskAmnt = Common.ConvertToStrToStrDecimal(tempModel.InitialSumatRisk);

                //保费
                currentModel.Premium = tempLCCont == null ? string.Empty :
                                       Common.ConvertToStrToStrDecimal(tempLCCont.Premium);

                //保险账户价值
                var tempLstInsureAcc = businessModel.lstTEMP_LCInsureAcc.Where(e => e.PolicyNo.Equal(currentModel.PolicyNo.PadLeft(8, '0')) &&
                                                                               e.ProductNo.Equal(currentModel.ProductNo));

                decimal tempAccountTotal = 0m;
                foreach (var temp in tempLstInsureAcc)
                {
                    if (!string.IsNullOrWhiteSpace(temp.AccountValue))
                    {
                        tempAccountTotal += decimal.Parse(temp.AccountValue.Trim());
                    }
                }

                string strTempAccountTotal = tempAccountTotal.ToString("0.00");

                currentModel.AccountValue = strTempAccountTotal;

                //临分标记
                if (tempModel.IsMrHealth)
                {
                    currentModel.FacultativeFlag = "0";
                }
                else
                {
                    currentModel.FacultativeFlag = tempModel.AutomaticorFacultative.Equals("A") ? "0" : "1";
                }

                //无名单标志
                currentModel.AnonymousFlag = "0";

                //豁免险标志
                currentModel.WaiverFlag = "0";

                //所需豁免剩余保费
                currentModel.WaiverPrem = "0";

                //期末现金价值
                currentModel.FinalCashValue = ConfigInformation.NumberValue;

                //期末责任准备金
                currentModel.FinalLiabilityReserve = ConfigInformation.NumberValue;

                //被保人客户号
                currentModel.InsuredNo = tempModel.MemberCertificateNo.PadLeft(8, '0');

                //被保人姓名
                var tempInsured = businessModel.lstTEMP_LCInsured.Where(e => e.PolicyNo.Equal(currentModel.PolicyNo.PadLeft(8, '0')) &&
                                                                        e.InsuredNo.Equal(currentModel.InsuredNo)).FirstOrDefault();
                currentModel.InsuredName = tempInsured == null ? string.Empty : tempInsured.InsuredName;

                //被保人性别
                currentModel.InsuredSex = tempInsured == null ? string.Empty : tempInsured.InsuredSex;

                //被保人证件类型
                currentModel.InsuredCertType = tempInsured == null ? string.Empty : tempInsured.InsuredCertType;

                //被保人证件编码
                currentModel.InsuredCertNo = tempInsured == null ? string.Empty : tempInsured.InsuredCertNo;

                //职业代码
                currentModel.OccupationType = tempInsured == null ? string.Empty : tempInsured.OccupationType;

                //投保年龄
                currentModel.AppntAge = tempInsured == null ? string.Empty : tempInsured.AppAge;

                //当前年龄
                currentModel.PreAge = tempModel.Attainedage;

                //职业加费金额
                currentModel.ProfessionalFee = tempLCProduct == null ? ConfigInformation.NumberValue : Common.ConvertToStrToStrDecimal(tempLCProduct.ProfessionalFee);

                //次标准体加费金额
                currentModel.SubStandardFee = tempLCProduct == null ? ConfigInformation.NumberValue : Common.ConvertToStrToStrDecimal(tempLCProduct.SubStandardFee);

                //EM加点
                currentModel.EMRate = tempLCProduct == null ? ConfigInformation.NumberValue : Common.ConvertToStrToStrDecimal(tempLCProduct.EMRate);

                //建工险标志
                currentModel.ProjectFlag = ConfigInformation.TextValue;

                // 投保总人数
                currentModel.InsurePeoples = "1";
                //保全受理号码
                var listLCPolTransaction = businessModel.lstTEMP_LCPolTransaction.Where(A => A.PolicyNo == tempModel.PolicyNo).ToList();
                currentModel.EndorAcceptNo = listLCPolTransaction.Count == 0 ? "" : listLCPolTransaction.First().EndorAcceptNo;
                //保全批单号码
                currentModel.EndorsementNo = listLCPolTransaction.Count == 0 ? "" : listLCPolTransaction.First().EndorsementNo;
                //保全项目类型
                currentModel.EdorType = "99";
                //保全生效日期
                currentModel.EdorValiDate = ConfigInformation.DateValue;
                //保全确认日期
                currentModel.EdorConfDate = ConfigInformation.DateValue;
                //保全发生费用
                currentModel.EdorMoney = ConfigInformation.NumberValue;

                //再保险公司名称
                currentModel.ReinsurerName = tempModel.CompanyName;

                //再保险公司代码
                currentModel.ReinsurerCode = new 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();

                currentModel.ReInsuranceContNo = templstZaiBaoProductInfo == null ? string.Empty :
                                                 templstZaiBaoProductInfo.ReInsuranceContNo;

                // 分保方式
                currentModel.ReinsurMode = templstZaiBaoProductInfo == null ? string.Empty :
                                           templstZaiBaoProductInfo.ReinsurMode;

                //分出标记
                string tempQuotaSharePercentage = (templstZaiBaoProductInfo.QuotaSharePercentage == "0" ||
                                                   templstZaiBaoProductInfo.QuotaSharePercentage == "0.00") ? "0" : "1";
                currentModel.SaparateFlag = templstZaiBaoProductInfo == null ? string.Empty : tempQuotaSharePercentage;

                //分保比例
                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);
            }
        }
示例#22
0
        private void SetGroupDataToModel(ContractInfoBusiness businessModel, string yearMonthDay,
                                         ref int serialNumber)
        {
            if (businessModel.lstRIMonthlyReportGroup.Count > 0)
            {
                foreach (var tempModel in businessModel.lstRIMonthlyReportGroup)
                {
                    LRContModel currentModel = new LRContModel();

                    currentModel.IsGroup       = true;
                    currentModel.TransactionNo = CommFuns.GetTransactionNo4(serialNumber, yearMonthDay);
                    currentModel.CompanyCode   = CommFuns.OriganizationCode;
                    currentModel.GrpPolicyNo   = tempModel.ChdrNumber;

                    //var tempLCGrpProduct = businessModel.lstTEMP_LCGrpProduct.Where(e => e.GrpPolicyNo == currentModel.GrpPolicyNo
                    //&& e.ProductCode == tempModel.Prodtyp).FirstOrDefault();

                    //若为团单则按右侧位置取数,inputFile: yyyymm\group\"RI Monthly report-GROUP.csv" -> Col F
                    //if (tempLCGrpProduct != null)
                    //{
                    //    currentModel.GrpProductNo = tempLCGrpProduct.GrpProductNo;
                    //}
                    //else
                    //{
                    //    currentModel.GrpProductNo = string.Empty;
                    //}

                    currentModel.GrpProductNo = tempModel.Prodtyp;

                    //个人保单号
                    //var tempLCCont = businessModel.lstTEMP_LCCont.Where(e => e.PolicyNo.Equals(currentModel.GrpPolicyNo)).FirstOrDefault();
                    //currentModel.PolicyNo = tempLCCont == null ? string.Empty : (tempLCCont.PolicyNo + "00").PadLeft(7, '0');

                    currentModel.PolicyNo = (tempModel.Mbrno + "00").PadLeft(7, '0');

                    // 个单保险险种号码
                    currentModel.ProductNo = tempModel.Prodtyp;

                    //保单团个性质代码
                    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;

                    //责任代码
                    //var templstZaiBaoProductInfo2 = businessModel.lstZaiBaoProductInfo.Where(e => e.ProductCode.Equals(tempModel.ProductCode)).FirstOrDefault();
                    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;

                    // 续期续保次数
                    currentModel.RenewalTimes = "0";

                    //保险期限类型
                    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 ? ConfigInformation.TextValue : 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;

                    //业务类型
                    if (!string.IsNullOrEmpty(strSignDate))
                    {
                        bool checkResult = Common.CheckEventType(yearMonthDay, strSignDate);

                        if (checkResult)
                        {
                            currentModel.EventType = "01";
                        }
                        else
                        {
                            if (!currentModel.ProductCode.ToUpper().Equal("HBA"))
                            {
                                currentModel.EventType = "02";
                            }
                            else
                            {
                                currentModel.EventType = "03";
                            }
                        }
                    }
                    else
                    {
                        currentModel.EventType = string.Empty;
                    }

                    //保险责任生效日期
                    currentModel.EffDate = tempLcGrpContGroup == null ? string.Empty : tempLcGrpContGroup.EffDate;

                    //PolYear 所跑数据年份减去签单日期年份
                    if (!string.IsNullOrEmpty(strSignDate))
                    {
                        int currentYear  = int.Parse(yearMonthDay.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);

                    //保险账户价值
                    //var tempInsureAcc = businessModel.lstTEMP_LCInsureAcc.Where(e => e.PolicyNo.Equal(currentModel.PolicyNo)
                    //&& e.ProductNo.Equal(currentModel.ProductNo)).FirstOrDefault();

                    currentModel.AccountValue = "0";

                    //临分标记
                    currentModel.FacultativeFlag = string.Empty;

                    //无名单标志
                    currentModel.AnonymousFlag = "0";

                    //豁免险标志
                    currentModel.WaiverFlag = "0";

                    //所需豁免剩余保费
                    currentModel.WaiverPrem = "0";

                    //期末现金价值
                    currentModel.FinalCashValue = ConfigInformation.NumberValue;

                    //期末责任准备金
                    currentModel.FinalLiabilityReserve = ConfigInformation.NumberValue;

                    //被保人客户号
                    currentModel.InsuredNo = tempModel.Clntnum;

                    //被保人姓名
                    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";

                    //再保险公司名称
                    currentModel.ReinsurerName = Common.DefaultCommanyName;

                    //再保险公司代码
                    var tempReinsurer = reinsurer.GetReinsurerInforByName(currentModel.ReinsurerName);
                    currentModel.ReinsurerCode = tempReinsurer == null ? string.Empty : tempReinsurer.ReinsurerCode;

                    //再保险合同号码
                    var templstZaiBaoProductInfo = businessModel.lstZaiBaoProductInfo.Where(e =>
                                                                                            e.ReinsurerCode.Equal(currentModel.ReinsurerCode) &&
                                                                                            e.ProductCode.Equals(currentModel.ProductCode) && e.LiabilityCode.Equals(currentModel.LiabilityCode)).FirstOrDefault();

                    currentModel.ReInsuranceContNo = templstZaiBaoProductInfo == null ? string.Empty :
                                                     templstZaiBaoProductInfo.ReInsuranceContNo;

                    // 分保方式
                    currentModel.ReinsurMode = templstZaiBaoProductInfo == null ? string.Empty :
                                               templstZaiBaoProductInfo.ReinsurMode;

                    //分出标记
                    if (templstZaiBaoProductInfo == null)
                    {
                        currentModel.SaparateFlag = string.Empty;
                    }
                    else
                    {
                        string tempQuotaSharePercentage = (templstZaiBaoProductInfo.QuotaSharePercentage == "0" ||
                                                           templstZaiBaoProductInfo.QuotaSharePercentage == "0.00") ? "0" : "1";
                        currentModel.SaparateFlag = templstZaiBaoProductInfo == null ? string.Empty : tempQuotaSharePercentage;
                    }



                    //分保保额
                    currentModel.ReinsuranceAmnt = ConfigInformation.NumberValue;

                    //自留额
                    currentModel.RetentionAmount = templstZaiBaoProductInfo == null ? string.Empty :
                                                   templstZaiBaoProductInfo.RetentionAmount;

                    //货币代码
                    currentModel.Currency = "156";

                    //分保比例
                    currentModel.QuotaSharePercentage = templstZaiBaoProductInfo == null ? string.Empty :
                                                        templstZaiBaoProductInfo.QuotaSharePercentage;

                    //分保费
                    currentModel.ReinsurancePremium = Common.ConvertToStrToStrDecimal(tempModel.RIAnnualizedPremiumTot);

                    //分保佣金
                    currentModel.ReinsuranceCommssion = Common.ConvertToStrToStrDecimal(tempModel.ReinsuranceCommssion);

                    //ReComputationsDate
                    currentModel.ReComputationsDate = Common.GetLastDayOfMonth(yearMonthDay);

                    //账单归属日期
                    currentModel.AccountGetDate = Common.GetLastDayOfMonth(yearMonthDay);

                    serialNumber++;

                    lRContModelList.Add(currentModel);
                }
            }
        }
示例#23
0
        /// <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);
            }
        }
示例#24
0
        private void Test2(List <RIContractInfo> lstHanReModel, string yearMonthDay,
                           ref int serialNumber, ref int startRowIndex,
                           List <TEMP_LMProduct> lstTEMP_LMProductModel,
                           ContractInfoBusiness contractInfoBusiness)
        {
            //  从第二行开始输入数据
            if (lstHanReModel.Count > 0)
            {
                int contractOrder = 1;
                foreach (var temp in lstHanReModel)
                {
                    var    tempProductModel = lstTEMP_LMProductModel.Where(e => e.ProductCode == temp.ProductCode).FirstOrDefault();
                    string tempProductType  = tempProductModel == null ? string.Empty : tempProductModel.ProductType;
                    var    tempTermType     = tempProductModel == null ? string.Empty : tempProductModel.TermType;

                    //var tempLMLiabilityModel = lstTEMP_LMLiabilityModel.Where(e => e.ProductCode == temp.ProductCode).FirstOrDefault();
                    //string tempLiabilityCode = tempLMLiabilityModel == null ? string.Empty : tempLMLiabilityModel.LiabilityCode;

                    var    tempCategory      = PersonalLiabilityCategory.LstCategory.Where(e => e.CategoryName.Equals(temp.BenefitReinsured)).FirstOrDefault();
                    string tempLiabilityCode = tempCategory == null ? string.Empty : tempCategory.CategoryCode;

                    if (!string.IsNullOrWhiteSpace(temp.ProductCode))
                    {
                        this.Test(yearMonthDay, serialNumber, startRowIndex, temp,
                                  contractOrder, 0, tempProductType, tempLiabilityCode, tempTermType, contractInfoBusiness);
                        startRowIndex++;
                        serialNumber++;
                    }

                    bool isAdd = false;
                    if (temp.lstChildRIContractInfo != null && temp.lstChildRIContractInfo.Count > 0)
                    {
                        for (int i = 0; i < temp.lstChildRIContractInfo.Count; i++)
                        {
                            var tempChildModel = temp.lstChildRIContractInfo[i];

                            tempProductModel = lstTEMP_LMProductModel.Where(e => e.ProductCode == tempChildModel.ProductCode).FirstOrDefault();
                            string tempProductType2 = tempProductModel == null ? string.Empty : tempProductModel.ProductType;
                            var    tempTermType2    = tempProductModel == null ? string.Empty : tempProductModel.TermType;

                            //tempLMLiabilityModel = lstTEMP_LMLiabilityModel.Where(e => e.ProductCode == tempChildModel.ProductCode).FirstOrDefault();
                            //string tempLiabilityCode2 = tempLMLiabilityModel == null ? string.Empty : tempLMLiabilityModel.LiabilityCode;

                            tempCategory = PersonalLiabilityCategory.LstCategory.Where(e => e.CategoryName.Equals(tempChildModel.BenefitReinsured)).FirstOrDefault();
                            string tempLiabilityCode2 = tempCategory == null ? string.Empty : tempCategory.CategoryCode;

                            if (!string.IsNullOrWhiteSpace(tempChildModel.ProductCode))
                            {
                                this.Test(yearMonthDay, serialNumber, startRowIndex, tempChildModel,
                                          contractOrder, i + 1, tempProductType2, tempLiabilityCode2, tempTermType2, contractInfoBusiness, false);
                                serialNumber++;
                                startRowIndex++;
                            }
                        }
                    }
                    else
                    {
                        isAdd = true;
                    }

                    contractOrder++;
                    if (isAdd)
                    {
                        startRowIndex++;
                        serialNumber++;
                    }
                }
            }
        }