Commit 0bb9abb2 authored by hongguangwu's avatar hongguangwu

Merge remote-tracking branch 'origin/develop' into develop

parents 81bf81d2 f0c23405
......@@ -171,6 +171,21 @@ public class ValidityUtil {
return Boolean.TRUE;
}
/**
* 判断医疗额度和身故残疾额度
* @param money 金额
* @return boolean
*/
public static boolean validateStandard(final String money) {
if(!BigDecimalUtils.isBigDecimal(money)){
return Boolean.FALSE ;
}
if(!money.matches(ValidityConstants.POSITIVE_INTEGER_PATTERN_TWO_FLOAT)){
return Boolean.FALSE ;
}
return Boolean.TRUE;
}
/**
* 判断金额是否大于9999999.99
* @param money 金额
......
......@@ -306,13 +306,13 @@ public class TInsuranceDetailController {
}
/**
* 已减员列表不分页查询
* 已减员列表导出
*
* @author zhaji
* @param param 查询条件
* @return {@link R<List< InsuranceRefundListVo >>}
*/
@Operation(summary = "已减员列表不分页查询", description = "已减员列表不分页查询")
@Operation(summary = "已减员列表导出", description = "已减员列表导出")
@PostMapping("/getInsuranceRefundList")
public R<List<InsuranceRefundListVo>> getInsuranceRefundList(@RequestBody InsuranceRefundParam param) {
return R.ok(tInsuranceDetailService.getInsuranceRefundList(param));
......
......@@ -186,7 +186,7 @@ public interface TInsuranceDetailService extends IService<TInsuranceDetail> {
IPage<InsuranceRefundListVo> getInsuranceRefundPageList(Page<InsuranceRefundParam> page, InsuranceRefundParam param);
/**
* 已减员列表不分页查询
* 已减员列表导出
*
* @author zhaji
* @param param 查询参数
......
......@@ -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;
}
......@@ -2340,7 +2349,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
/**
* 已减员列表不分页查询
* 已减员列表导出
*
* @author zhaji
* @param param 查询参数
......@@ -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);
}
}
......
......@@ -19,6 +19,7 @@ import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceOperateService;
import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceTypeService;
import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceTypeStandardService;
import com.yifu.cloud.plus.v1.yifu.insurances.util.ValidityUtil;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
......@@ -128,17 +129,21 @@ public class TInsuranceTypeStandardServiceImpl extends ServiceImpl<TInsuranceTyp
if (!ValidityUtil.validateMoneyMax(buyStandard)){
return R.failed(InsurancesConstants.INSURANCE_TYPE_STANDARD_MAX_ERROR);
}
if (!ValidityUtil.validateMoney(medicalQuota)){
return R.failed("医疗额度格式不正确");
if (StringUtils.isNotBlank(medicalQuota)){
if (!ValidityUtil.validateStandard(medicalQuota)){
return R.failed("请输入大于等于0的数字最多两位小数");
}
if (!ValidityUtil.validateMoneyMax(medicalQuota)){
return R.failed(InsurancesConstants.MEDICAL_QUOTA_MAX_ERROR);
}
}
if (!ValidityUtil.validateMoneyMax(medicalQuota)){
return R.failed(InsurancesConstants.MEDICAL_QUOTA_MAX_ERROR);
}
if (!ValidityUtil.validateMoney(dieDisableQuota)){
return R.failed("身故或残疾额度格式不正确");
}
if (!ValidityUtil.validateMoneyMax(dieDisableQuota)){
return R.failed(InsurancesConstants.DIE_DISABLE_QUOTA_MAX_ERROR);
if (StringUtils.isNotBlank(dieDisableQuota)){
if (!ValidityUtil.validateStandard(dieDisableQuota)){
return R.failed("请输入大于等于0的数字最多两位小数");
}
if (!ValidityUtil.validateMoneyMax(dieDisableQuota)){
return R.failed(InsurancesConstants.DIE_DISABLE_QUOTA_MAX_ERROR);
}
}
LambdaQueryWrapper<TInsuranceTypeStandard> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(TInsuranceTypeStandard::getInsuranceTypeId,insuranceTypeStandard.getInsuranceTypeId())
......
......@@ -307,7 +307,7 @@
and detail.DEPT_NO like concat('%',replace(replace(#{param.deptNo},'_','\_'),'%','\%'),'%')
</if>
<if test="param.insuranceCompanyName != null and param.insuranceCompanyName.trim() != ''">
and detail.INSURANCE_COMPANY_NAME like concat('%',replace(replace(#{param.insuranceCompanyName},'_','\_'),'%','\%'),'%')
and detail.INSURANCE_COMPANY_NAME = #{param.insuranceCompanyName}
</if>
<if test="param.policyNo != null and param.policyNo.trim() != ''">
and detail.POLICY_NO like concat('%',replace(replace(#{param.policyNo},'_','\_'),'%','\%'),'%')
......@@ -385,7 +385,7 @@
and detail.DEPT_NO like concat('%',replace(replace(#{param.deptNo},'_','\_'),'%','\%'),'%')
</if>
<if test="param.insuranceCompanyName != null and param.insuranceCompanyName.trim() != ''">
and detail.INSURANCE_COMPANY_NAME like concat('%',replace(replace(#{param.insuranceCompanyName},'_','\_'),'%','\%'),'%')
and detail.INSURANCE_COMPANY_NAME = #{param.insuranceCompanyName}
</if>
<if test="param.policyNo != null and param.policyNo.trim() != ''">
and detail.POLICY_NO like concat('%',replace(replace(#{param.policyNo},'_','\_'),'%','\%'),'%')
......@@ -449,7 +449,7 @@
and detail.DEPT_NO like concat('%',replace(replace(#{param.deptNo},'_','\_'),'%','\%'),'%')
</if>
<if test="param.insuranceCompanyName != null and param.insuranceCompanyName.trim() != ''">
and detail.INSURANCE_COMPANY_NAME like concat('%',replace(replace(#{param.insuranceCompanyName},'_','\_'),'%','\%'),'%')
and detail.INSURANCE_COMPANY_NAME = #{param.insuranceCompanyName}
</if>
<if test="param.policyNo != null and param.policyNo.trim() != ''">
and detail.POLICY_NO like concat('%',replace(replace(#{param.policyNo},'_','\_'),'%','\%'),'%')
......@@ -509,7 +509,7 @@
and detail.DEPT_NO like concat('%',replace(replace(#{param.deptNo},'_','\_'),'%','\%'),'%')
</if>
<if test="param.insuranceCompanyName != null and param.insuranceCompanyName.trim() != ''">
and detail.INSURANCE_COMPANY_NAME like concat('%',replace(replace(#{param.insuranceCompanyName},'_','\_'),'%','\%'),'%')
and detail.INSURANCE_COMPANY_NAME = #{param.insuranceCompanyName}
</if>
<if test="param.policyNo != null and param.policyNo.trim() != ''">
and detail.POLICY_NO like concat('%',replace(replace(#{param.policyNo},'_','\_'),'%','\%'),'%')
......
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