Commit c0735942 authored by zhaji's avatar zhaji

"feature-zhaJi:优化购买标准,身故残疾,医疗额度提示语句"

parent 391dd7ae
......@@ -619,6 +619,20 @@ public class InsurancesConstants {
*/
public static final String DELETE_INSURANCE_TYPE_STANDARD = "删除购买标准";
/**
* 购买标准不能超过9999999.99
*/
public static final String INSURANCE_TYPE_STANDARD_MAX_ERROR = "购买标准不能超过9999999.99";
/**
* 医疗额度不能超过9999999.99
*/
public static final String MEDICAL_QUOTA_MAX_ERROR = "医疗额度不能超过9999999.99";
/**
* 身故和残疾不能超过9999999.99
*/
public static final String DIE_DISABLE_QUOTA_MAX_ERROR = "身故和残疾不能超过9999999.99";
/**
* 导入减员数据
......
......@@ -168,6 +168,15 @@ public class ValidityUtil {
if(!money.matches(ValidityConstants.POSITIVE_INTEGER_PATTERN_TWO_FLOAT)){
return Boolean.FALSE ;
}
return Boolean.TRUE;
}
/**
* 判断金额是否大于9999999.99
* @param money 金额
* @return boolean
*/
public static boolean validateMoneyMax(final String money) {
BigDecimal bigDecimalMoney= new BigDecimal(money);
boolean max = bigDecimalMoney.compareTo(CommonConstants.MONEY_MAX) >0;
if(max){
......
......@@ -125,12 +125,21 @@ public class TInsuranceTypeStandardServiceImpl extends ServiceImpl<TInsuranceTyp
if (!ValidityUtil.validateMoney(buyStandard)){
return R.failed("购买标准格式不正确");
}
if (!ValidityUtil.validateMoneyMax(buyStandard)){
return R.failed(InsurancesConstants.INSURANCE_TYPE_STANDARD_MAX_ERROR);
}
if (!ValidityUtil.validateMoney(medicalQuota)){
return R.failed("医疗额度格式不正确");
}
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);
}
LambdaQueryWrapper<TInsuranceTypeStandard> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(TInsuranceTypeStandard::getInsuranceTypeId,insuranceTypeStandard.getInsuranceTypeId())
.eq(TInsuranceTypeStandard::getBuyStandard,insuranceTypeStandard.getBuyStandard())
......
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