新增人寿险类型下分红保险等,健康险类型下定期重疾险等 年缴保费计算接口

保险产品表添加年缴保费字段用于回显 减少计算次数
master
xiaoCJ 5 months ago
parent 7ff5d6b917
commit c8de79b2a6

@ -11,6 +11,7 @@ import com.sztzjy.money_management.mapper.ChapterMapper;
import com.sztzjy.money_management.mapper.ComCaseMapper;
import com.sztzjy.money_management.mapper.InsuranceProMapper;
import com.sztzjy.money_management.service.CaseService;
import com.sztzjy.money_management.service.ComputeService;
import com.sztzjy.money_management.util.ResultEntity;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@ -19,6 +20,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.*;
import java.math.BigDecimal;
import java.util.List;
import java.util.stream.Collectors;
@ -40,6 +42,8 @@ public class CaseController {
private ChapterMapper chapterMapper;
@Autowired
private InsuranceProMapper insuranceProMapper;
@Autowired
private ComputeService computeService;
@PostMapping("/insertCase")
@ApiOperation("新增/编辑案例老师和管理员新增根据caseInfo中的publish区分都是题目答案学生端新增传isAnswer为学生答案+userId")
@ -53,7 +57,7 @@ public class CaseController {
@PostMapping("/insertComprehensivePlanCase")
@ApiOperation("新增/编辑综合规划案例")
private ResultEntity<HttpStatus> insertComprehensivePlanCase(@ApiParam("主表caseInfo必传")@RequestBody StuCaseDto stuCaseDto) {
private ResultEntity<HttpStatus> insertComprehensivePlanCase(@ApiParam("主表caseInfo必传") @RequestBody StuCaseDto stuCaseDto) {
return caseService.insertComprehensivePlanCase(stuCaseDto);
}
@ -208,4 +212,14 @@ public class CaseController {
}
return new ResultEntity<>(chapter.getKnowledge());
}
@PostMapping("/getAnnualPremium")
@ApiOperation("年缴保费计算")
@AnonymousAccess
private ResultEntity<BigDecimal> getInsuranceExpense(@ApiParam("需要年龄,性别,保险年份,缴费方式,保险金额,InsuranceProId") @RequestBody CaseInvestmentPlanInsuranceProductInfo productInfo) {
BigDecimal AnnualPremium = computeService.getAnnualPremium(productInfo);
return new ResultEntity<BigDecimal>(AnnualPremium);
}
}

@ -41,6 +41,9 @@ public class CaseInvestmentPlanInsuranceProductInfo {
@ApiModelProperty("缴费方式")
private String paymentMethod;
@ApiModelProperty("年缴保费")
private BigDecimal annualPremium;
@ApiModelProperty("添加时间")
private Date addTime;
@ -124,6 +127,14 @@ public class CaseInvestmentPlanInsuranceProductInfo {
this.paymentMethod = paymentMethod == null ? null : paymentMethod.trim();
}
public BigDecimal getAnnualPremium() {
return annualPremium;
}
public void setAnnualPremium(BigDecimal annualPremium) {
this.annualPremium = annualPremium;
}
public Date getAddTime() {
return addTime;
}

@ -786,6 +786,66 @@ public class CaseInvestmentPlanInsuranceProductInfoExample {
return (Criteria) this;
}
public Criteria andAnnualPremiumIsNull() {
addCriterion("annual_premium is null");
return (Criteria) this;
}
public Criteria andAnnualPremiumIsNotNull() {
addCriterion("annual_premium is not null");
return (Criteria) this;
}
public Criteria andAnnualPremiumEqualTo(BigDecimal value) {
addCriterion("annual_premium =", value, "annualPremium");
return (Criteria) this;
}
public Criteria andAnnualPremiumNotEqualTo(BigDecimal value) {
addCriterion("annual_premium <>", value, "annualPremium");
return (Criteria) this;
}
public Criteria andAnnualPremiumGreaterThan(BigDecimal value) {
addCriterion("annual_premium >", value, "annualPremium");
return (Criteria) this;
}
public Criteria andAnnualPremiumGreaterThanOrEqualTo(BigDecimal value) {
addCriterion("annual_premium >=", value, "annualPremium");
return (Criteria) this;
}
public Criteria andAnnualPremiumLessThan(BigDecimal value) {
addCriterion("annual_premium <", value, "annualPremium");
return (Criteria) this;
}
public Criteria andAnnualPremiumLessThanOrEqualTo(BigDecimal value) {
addCriterion("annual_premium <=", value, "annualPremium");
return (Criteria) this;
}
public Criteria andAnnualPremiumIn(List<BigDecimal> values) {
addCriterion("annual_premium in", values, "annualPremium");
return (Criteria) this;
}
public Criteria andAnnualPremiumNotIn(List<BigDecimal> values) {
addCriterion("annual_premium not in", values, "annualPremium");
return (Criteria) this;
}
public Criteria andAnnualPremiumBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("annual_premium between", value1, value2, "annualPremium");
return (Criteria) this;
}
public Criteria andAnnualPremiumNotBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("annual_premium not between", value1, value2, "annualPremium");
return (Criteria) this;
}
public Criteria andAddTimeIsNull() {
addCriterion("add_time is null");
return (Criteria) this;

@ -14,7 +14,6 @@ import java.util.List;
public class CaseInvestmentPlanSelectDto {
@ApiModelProperty("案例-投资规划-产品选择表")
private CaseInvestmentPlanSelect caseInvestmentPlanSelect;
//其余表
@ApiModelProperty("投资规划-银行储蓄信息表")
private List<CaseInvestmentPlanBankProductInfo> investmentPlanBankProductInfos;

@ -2,11 +2,14 @@ package com.sztzjy.money_management.service;
import com.nimbusds.jose.shaded.gson.Gson;
import com.sztzjy.money_management.entity.CaseInfo;
import com.sztzjy.money_management.entity.CaseInvestmentPlanInsuranceProductInfo;
import com.sztzjy.money_management.entity.StuCaseDto;
import com.sztzjy.money_management.entity.dto.CaseInvestmentPlanDto;
import com.sztzjy.money_management.util.ResultEntity;
import org.springframework.http.HttpStatus;
import java.math.BigDecimal;
/**
* @Author xcj

@ -0,0 +1,14 @@
package com.sztzjy.money_management.service;
import com.sztzjy.money_management.entity.CaseInvestmentPlanInsuranceProductInfo;
import java.math.BigDecimal;
/**
* @Author xcj
* @Date 2024/10/9
*/
public interface ComputeService {
BigDecimal getAnnualPremium(CaseInvestmentPlanInsuranceProductInfo productInfo);
}

@ -17,6 +17,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.*;
@ -80,7 +81,8 @@ public class CaseServiceImpl implements CaseService {
private CaseInvestmentPlanRealGoldProductInfoMapper investmentPlanRealGoldProductInfoMapper;
@Autowired
private CaseInvestmentPlanSelectMapper caseInvestmentPlanSelectMapper;
@Autowired
private InsuranceProMapper insuranceProMapper;
private void insertSynthesisPlanClient(CaseInfo newCase) {
SynthesisPlanClient synthesisPlanClient = new SynthesisPlanClient();
@ -361,6 +363,138 @@ public class CaseServiceImpl implements CaseService {
return null;
}
// @Override
// public BigDecimal getAnnualPremium(CaseInvestmentPlanInsuranceProductInfo productInfo) {
// Integer age = productInfo.getAge(); //年龄
// String gender = productInfo.getGender(); //性别
// String insurancePeriod = productInfo.getInsurancePeriod(); //保险年份
// String paymentMethod = productInfo.getPaymentMethod();//缴费方式
// BigDecimal insuranceAmount = productInfo.getInsuranceAmount();//保险金额
// String insuranceProId = productInfo.getInsuranceProId();
// InsuranceProWithBLOBs insuranceProWithBLOBs = insuranceProMapper.selectByPrimaryKey(insuranceProId);
// String name = insuranceProWithBLOBs.getName();//保险名称
//
// if (name.equals("爱相随定期寿险")) {
// if (paymentMethod.equals("趸交")) {
// if (insurancePeriod.equals("10年")) {
// if (insuranceAmount.compareTo(BigDecimal.valueOf(100000)) == 0) { //10万
// if (gender.equals("男")) {
//
// }
// if (gender.equals("女")) {
//
// }
// }
// if (insuranceAmount.compareTo(BigDecimal.valueOf(200000)) == 0) { //20万
// if (gender.equals("男")) {
//
// }
// if (gender.equals("女")) {
//
// }
// }
// if (insuranceAmount.compareTo(BigDecimal.valueOf(300000)) == 0) { //30万
// if (gender.equals("男")) {
//
// }
// if (gender.equals("女")) {
//
// }
// }
// if (insuranceAmount.compareTo(BigDecimal.valueOf(400000)) == 0) { //40万
// if (gender.equals("男")) {
//
// }
// if (gender.equals("女")) {
//
// }
// }
// if (insuranceAmount.compareTo(BigDecimal.valueOf(500000)) == 0) { //50万
// if (gender.equals("男")) {
//
// }
// if (gender.equals("女")) {
//
// }
// }
// }
// if (insurancePeriod.equals("20年")) {
// if (gender.equals("男")) {
//
// }
// if (gender.equals("女")) {
//
// }
// }
// if (insurancePeriod.equals("30年")) {
// if (gender.equals("男")) {
//
// }
// if (gender.equals("女")) {
//
// }
// }
// }
// if (paymentMethod.equals("5年交")) {
// if (insuranceAmount.compareTo(BigDecimal.valueOf(100000)) == 0) { //10万
// if (gender.equals("男")) {
//
// }
// if (gender.equals("女")) {
//
// }
// }
// if (insuranceAmount.compareTo(BigDecimal.valueOf(200000)) == 0) { //20万
// if (gender.equals("男")) {
//
// }
// if (gender.equals("女")) {
//
// }
// }
// if (insuranceAmount.compareTo(BigDecimal.valueOf(300000)) == 0) { //30万
// if (gender.equals("男")) {
//
// }
// if (gender.equals("女")) {
//
// }
// }
// }
// if (paymentMethod.equals("10年交")) {
// if (insurancePeriod.equals("20年")) {
// if (gender.equals("男")) {
//
// }
// if (gender.equals("女")) {
//
// }
// }
// if (insurancePeriod.equals("30年")) {
// if (gender.equals("男")) {
//
// }
// if (gender.equals("女")) {
//
// }
// }
// }
// if (paymentMethod.equals("20年交")) {
// if (insurancePeriod.equals("30年")) {
// if (gender.equals("男")) {
//
// }
// if (gender.equals("女")) {
//
// }
// }
// }
// }
//
// return null;
// }
@Override
public ResultEntity<HttpStatus> insertCase(String caseInfo, String json, String operator, String type) {
@ -811,12 +945,10 @@ public class CaseServiceImpl implements CaseService {
CaseInvestmentPlanSelect caseInvestmentPlanSelect = investmentPlanSelect.getCaseInvestmentPlanSelect(); //产品选择表
//操作产品选择表
//id为空则新增
if (StringUtils.isBlank(caseInvestmentPlanSelect.getProductSelectId())) {
if (StringUtils.isBlank(newCase.getCaseid())) {
}
//id为空则新增 表不可能为null
if (caseInvestmentPlanSelect != null && StringUtils.isBlank(caseInvestmentPlanSelect.getProductSelectId())) {
caseInvestmentPlanSelect.setProductSelectId(IdUtil.randomUUID());
//todo caseid前端能否传过来
caseInvestmentPlanSelectMapper.insert(caseInvestmentPlanSelect);
} else {
caseInvestmentPlanSelectMapper.updateByPrimaryKeySelective(caseInvestmentPlanSelect);

@ -12,6 +12,7 @@
<result column="insurance_amount" jdbcType="DECIMAL" property="insuranceAmount" />
<result column="insurance_period" jdbcType="VARCHAR" property="insurancePeriod" />
<result column="payment_method" jdbcType="VARCHAR" property="paymentMethod" />
<result column="annual_premium" jdbcType="DECIMAL" property="annualPremium" />
<result column="add_time" jdbcType="TIMESTAMP" property="addTime" />
</resultMap>
<sql id="Example_Where_Clause">
@ -74,7 +75,8 @@
</sql>
<sql id="Base_Column_List">
insurance_productinfo_id, product_select_id, level, insurance_pro_id, insured_person,
gender, age, insurance_amount, insurance_period, payment_method, add_time
gender, age, insurance_amount, insurance_period, payment_method, annual_premium,
add_time
</sql>
<select id="selectByExample" parameterType="com.sztzjy.money_management.entity.CaseInvestmentPlanInsuranceProductInfoExample" resultMap="BaseResultMap">
select
@ -110,13 +112,13 @@
insert into case_investment_plan_insurance_productinfo (insurance_productinfo_id, product_select_id,
level, insurance_pro_id, insured_person,
gender, age, insurance_amount,
insurance_period, payment_method, add_time
)
insurance_period, payment_method, annual_premium,
add_time)
values (#{insuranceProductinfoId,jdbcType=VARCHAR}, #{productSelectId,jdbcType=VARCHAR},
#{level,jdbcType=VARCHAR}, #{insuranceProId,jdbcType=VARCHAR}, #{insuredPerson,jdbcType=VARCHAR},
#{gender,jdbcType=CHAR}, #{age,jdbcType=INTEGER}, #{insuranceAmount,jdbcType=DECIMAL},
#{insurancePeriod,jdbcType=VARCHAR}, #{paymentMethod,jdbcType=VARCHAR}, #{addTime,jdbcType=TIMESTAMP}
)
#{insurancePeriod,jdbcType=VARCHAR}, #{paymentMethod,jdbcType=VARCHAR}, #{annualPremium,jdbcType=DECIMAL},
#{addTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="com.sztzjy.money_management.entity.CaseInvestmentPlanInsuranceProductInfo">
insert into case_investment_plan_insurance_productinfo
@ -151,6 +153,9 @@
<if test="paymentMethod != null">
payment_method,
</if>
<if test="annualPremium != null">
annual_premium,
</if>
<if test="addTime != null">
add_time,
</if>
@ -186,6 +191,9 @@
<if test="paymentMethod != null">
#{paymentMethod,jdbcType=VARCHAR},
</if>
<if test="annualPremium != null">
#{annualPremium,jdbcType=DECIMAL},
</if>
<if test="addTime != null">
#{addTime,jdbcType=TIMESTAMP},
</if>
@ -230,6 +238,9 @@
<if test="record.paymentMethod != null">
payment_method = #{record.paymentMethod,jdbcType=VARCHAR},
</if>
<if test="record.annualPremium != null">
annual_premium = #{record.annualPremium,jdbcType=DECIMAL},
</if>
<if test="record.addTime != null">
add_time = #{record.addTime,jdbcType=TIMESTAMP},
</if>
@ -250,6 +261,7 @@
insurance_amount = #{record.insuranceAmount,jdbcType=DECIMAL},
insurance_period = #{record.insurancePeriod,jdbcType=VARCHAR},
payment_method = #{record.paymentMethod,jdbcType=VARCHAR},
annual_premium = #{record.annualPremium,jdbcType=DECIMAL},
add_time = #{record.addTime,jdbcType=TIMESTAMP}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
@ -285,6 +297,9 @@
<if test="paymentMethod != null">
payment_method = #{paymentMethod,jdbcType=VARCHAR},
</if>
<if test="annualPremium != null">
annual_premium = #{annualPremium,jdbcType=DECIMAL},
</if>
<if test="addTime != null">
add_time = #{addTime,jdbcType=TIMESTAMP},
</if>
@ -302,6 +317,7 @@
insurance_amount = #{insuranceAmount,jdbcType=DECIMAL},
insurance_period = #{insurancePeriod,jdbcType=VARCHAR},
payment_method = #{paymentMethod,jdbcType=VARCHAR},
annual_premium = #{annualPremium,jdbcType=DECIMAL},
add_time = #{addTime,jdbcType=TIMESTAMP}
where insurance_productinfo_id = #{insuranceProductinfoId,jdbcType=VARCHAR}
</update>

Loading…
Cancel
Save