Commit 9e2bee27 authored by 李灿灿's avatar 李灿灿

Merge branch 'feature-licancan' into 'develop'

Feature licancan

See merge request fangxinjiang/yifu!89
parents f848382a 4b6809f4
......@@ -515,9 +515,12 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.notIn(TInsuranceDetail::getBuyHandleStatus, setRStatus)
.eq(TInsuranceDetail::getDeleteFlag, CommonConstants.ZERO_INT)
.and(
wrapper -> wrapper.between(TInsuranceDetail::getPolicyStart,LocalDateUtil.parseLocalDate(param.getPolicyStart()),LocalDateUtil.parseLocalDate(param.getPolicyEnd()))
.or()
.between(TInsuranceDetail::getPolicyEnd,LocalDateUtil.parseLocalDate(param.getPolicyStart()),LocalDateUtil.parseLocalDate(param.getPolicyEnd()))
wrapper -> wrapper.and(
s -> s.le(TInsuranceDetail::getPolicyStart,LocalDateUtil.parseLocalDate(param.getPolicyStart()))
.ge(TInsuranceDetail::getPolicyEnd,LocalDateUtil.parseLocalDate(param.getPolicyStart()))
)
.or(e -> e.le(TInsuranceDetail::getPolicyStart,LocalDateUtil.parseLocalDate(param.getPolicyEnd()))
.ge(TInsuranceDetail::getPolicyEnd,LocalDateUtil.parseLocalDate(param.getPolicyEnd())))
)
//有效
.and(
......@@ -533,7 +536,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
);
if (Optional.ofNullable(insuranceDetailBetween).isPresent() && !insuranceDetailBetween.getId().equals(param.getId())){
return R.failed("当前员工在["+param.getPolicyStart()+"-"+param.getPolicyEnd()+"]期间内有投保记录");
return R.failed("当前员工在["+insuranceDetailBetween.getPolicyStart()+"-"+insuranceDetailBetween.getPolicyEnd()+"]期间内有投保记录");
}
BeanCopyUtils.copyProperties(param,byId);
//投保状态:待投保
......@@ -786,7 +789,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//计算起止时间的天数
long day = LocalDateUtil.betweenDay(detail.getPolicyStart().toString(), detail.getPolicyEnd().toString());
//预估保费 = (购买标准 / 365) * 天数
BigDecimal estimatePremium = new BigDecimal(detail.getBuyStandard()).divide(new BigDecimal("365"),CommonConstants.TWO_INT,BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(day)).setScale(CommonConstants.TWO_INT,BigDecimal.ROUND_HALF_UP);
BigDecimal estimatePremium = new BigDecimal(detail.getBuyStandard()).multiply(new BigDecimal(day)).divide(new BigDecimal("365"),CommonConstants.TWO_INT,BigDecimal.ROUND_HALF_UP);
detail.setEstimatePremium(estimatePremium);
if (detail.getBuyType() == CommonConstants.THREE_INT){
detail.setPolicyEffect(LocalDate.now().plusDays(CommonConstants.ONE_INT));
......@@ -1275,9 +1278,12 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.notIn(TInsuranceDetail::getBuyHandleStatus, setRStatus)
.eq(TInsuranceDetail::getDeleteFlag, CommonConstants.ZERO_INT)
.and(
wrapper -> wrapper.between(TInsuranceDetail::getPolicyStart,LocalDateUtil.parseLocalDate(param.getPolicyStart()),LocalDateUtil.parseLocalDate(param.getPolicyEnd()))
.or()
.between(TInsuranceDetail::getPolicyEnd,LocalDateUtil.parseLocalDate(param.getPolicyStart()),LocalDateUtil.parseLocalDate(param.getPolicyEnd()))
wrapper -> wrapper.and(
s -> s.le(TInsuranceDetail::getPolicyStart,LocalDateUtil.parseLocalDate(param.getPolicyStart()))
.ge(TInsuranceDetail::getPolicyEnd,LocalDateUtil.parseLocalDate(param.getPolicyStart()))
)
.or(e -> e.le(TInsuranceDetail::getPolicyStart,LocalDateUtil.parseLocalDate(param.getPolicyEnd()))
.ge(TInsuranceDetail::getPolicyEnd,LocalDateUtil.parseLocalDate(param.getPolicyEnd())))
)
//有效
.and(
......@@ -1293,7 +1299,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
);
if (Optional.ofNullable(insuranceDetailBetween).isPresent()){
param.setErrorMessage("当前员工在["+param.getPolicyStart()+"-"+param.getPolicyEnd()+"]期间内有投保记录");
param.setErrorMessage("当前员工在["+insuranceDetailBetween.getPolicyStart()+"-"+insuranceDetailBetween.getPolicyEnd()+"]期间内有投保记录");
listResult.add(param);
continue;
}
......@@ -1921,9 +1927,12 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.notIn(TInsuranceDetail::getBuyHandleStatus, setRStatus)
.eq(TInsuranceDetail::getDeleteFlag, CommonConstants.ZERO_INT)
.and(
wrapper -> wrapper.between(TInsuranceDetail::getPolicyStart,LocalDateUtil.parseLocalDate(param.getPolicyStart()),LocalDateUtil.parseLocalDate(param.getPolicyEnd()))
.or()
.between(TInsuranceDetail::getPolicyEnd,LocalDateUtil.parseLocalDate(param.getPolicyStart()),LocalDateUtil.parseLocalDate(param.getPolicyEnd()))
wrapper -> wrapper.and(
s -> s.le(TInsuranceDetail::getPolicyStart,LocalDateUtil.parseLocalDate(param.getPolicyStart()))
.ge(TInsuranceDetail::getPolicyEnd,LocalDateUtil.parseLocalDate(param.getPolicyStart()))
)
.or(e -> e.le(TInsuranceDetail::getPolicyStart,LocalDateUtil.parseLocalDate(param.getPolicyEnd()))
.ge(TInsuranceDetail::getPolicyEnd,LocalDateUtil.parseLocalDate(param.getPolicyEnd())))
)
//有效
.and(
......@@ -1939,7 +1948,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
);
if (Optional.ofNullable(insuranceDetailBetween).isPresent()){
param.setErrorMessage("替换员工在["+param.getPolicyStart()+"-"+param.getPolicyEnd()+"]期间内有投保记录");
param.setErrorMessage("替换员工在["+insuranceDetailBetween.getPolicyStart()+"-"+insuranceDetailBetween.getPolicyEnd()+"]期间内有投保记录");
listResult.add(param);
continue;
}
......@@ -3456,7 +3465,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//计算起止时间的天数
long day = LocalDateUtil.betweenDay(insuranceDetail.getPolicyStart().toString(), insuranceDetail.getPolicyEnd().toString());
//预估保费 = (购买标准 / 365) * 天数
BigDecimal estimatePremium = new BigDecimal(insuranceDetail.getBuyStandard()).divide(new BigDecimal("365"),2,BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(day)).setScale(2,BigDecimal.ROUND_HALF_UP);
BigDecimal estimatePremium = new BigDecimal(insuranceDetail.getBuyStandard()).multiply(new BigDecimal(day)).divide(new BigDecimal("365"),CommonConstants.TWO_INT,BigDecimal.ROUND_HALF_UP);
param.setEstimatePremium(estimatePremium);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment