Commit 801dfa42 authored by 李灿灿's avatar 李灿灿

登记保单保费接口调试

parent f42e63a6
...@@ -284,10 +284,34 @@ public class InsurancesConstants { ...@@ -284,10 +284,34 @@ public class InsurancesConstants {
* 保单号不能为空 * 保单号不能为空
*/ */
public static final String POLICY_NO_EMPTY = "保单号不能为空"; public static final String POLICY_NO_EMPTY = "保单号不能为空";
/**
* 保单号长度超过50字符限制
*/
public static final String POLICY_NO_MORE_THAN_50 = "保单号长度超过50字符限制";
/**
* 发票号长度超过50字符限制
*/
public static final String INVOICE_NO_MORE_THAN_50 = "发票号长度超过50字符限制";
/** /**
* 保费不能为空 * 保费不能为空
*/ */
public static final String ACTUAL_PREMIUM_NO_EMPTY = "保费不能为空"; public static final String ACTUAL_PREMIUM_EMPTY = "保费不能为空";
/**
* 保费金额格式错误
*/
public static final String ACTUAL_PREMIUM_PARSE_ERROR= "保费金额格式错误";
/**
* 替换类型无法登记保单保费
*/
public static final String BUY_TYPE_FOUR_NOT_REGISTERED= "替换类型无法登记保单保费";
/**
* 商险待投保,无法登记保单保费
*/
public static final String BUY_HANDLE_ONE_NOT_REGISTERED = "商险待投保,无法登记保单保费";
/**
* 商险投保中,无法登记保单保费
*/
public static final String BUY_HANDLE_TWO_NOT_REGISTERED = "商险投保中,无法登记保单保费";
/** /**
* 保单号不存在或已过期 * 保单号不存在或已过期
*/ */
......
...@@ -259,7 +259,7 @@ public class ValidityUtil { ...@@ -259,7 +259,7 @@ public class ValidityUtil {
} }
/** /**
* 验证字符串 最多50位 * 验证字符串 最多60位
* *
* @author licancan * @author licancan
* @param str * @param str
......
...@@ -1669,12 +1669,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1669,12 +1669,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
continue; continue;
} }
// 身份证号位数校验(18 位合法)
if (!ValidityUtil.validateIDCard(param.getEmpIdcardNo())){
param.setErrorMessage(InsurancesConstants.EMP_IDCARD_NO_NOT_LEGITIMATE);
listResult.add(param);
continue;
}
if(!LocalDateUtil.isDate(param.getPolicyStart(),LocalDateUtil.NORM_DATE_PATTERN)){ if(!LocalDateUtil.isDate(param.getPolicyStart(),LocalDateUtil.NORM_DATE_PATTERN)){
param.setErrorMessage(InsurancesConstants.POLICY_START_PARSE_ERROR); param.setErrorMessage(InsurancesConstants.POLICY_START_PARSE_ERROR);
listResult.add(param); listResult.add(param);
...@@ -1685,6 +1679,13 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1685,6 +1679,13 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
listResult.add(param); listResult.add(param);
continue; continue;
} }
if (StringUtils.isNotBlank(param.getInvoiceNo())){
if (!ValidityUtil.validate50(param.getInvoiceNo())){
param.setErrorMessage(InsurancesConstants.INVOICE_NO_MORE_THAN_50);
listResult.add(param);
continue;
}
}
//查数据是否存在:姓名 + 身份证号 + 保险公司 + 险种名称 + 保单开始时间 + 保单结束时间 //查数据是否存在:姓名 + 身份证号 + 保险公司 + 险种名称 + 保单开始时间 + 保单结束时间
TInsuranceDetail detail = this.baseMapper.selectOne(Wrappers.<TInsuranceDetail>query().lambda() TInsuranceDetail detail = this.baseMapper.selectOne(Wrappers.<TInsuranceDetail>query().lambda()
.eq(TInsuranceDetail::getEmpName, param.getEmpName()) .eq(TInsuranceDetail::getEmpName, param.getEmpName())
...@@ -1707,11 +1708,36 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1707,11 +1708,36 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
listResult.add(param); listResult.add(param);
continue; continue;
} }
if (!ValidityUtil.validate50(param.getPolicyNo())){
param.setErrorMessage(InsurancesConstants.POLICY_NO_MORE_THAN_50);
listResult.add(param);
continue;
}
if (StringUtils.isBlank(param.getActualPremium())){ if (StringUtils.isBlank(param.getActualPremium())){
param.setErrorMessage(InsurancesConstants.ACTUAL_PREMIUM_NO_EMPTY); param.setErrorMessage(InsurancesConstants.ACTUAL_PREMIUM_EMPTY);
listResult.add(param); listResult.add(param);
continue; continue;
} }
if(BigDecimalUtils.isBigDecimal(param.getActualPremium())){
param.setErrorMessage(InsurancesConstants.ACTUAL_PREMIUM_PARSE_ERROR);
listResult.add(param);
continue;
}
}
if (detail.getBuyType() == CommonConstants.FOUR_INT){
param.setErrorMessage(InsurancesConstants.BUY_TYPE_FOUR_NOT_REGISTERED);
listResult.add(param);
continue;
}
if (detail.getBuyHandleStatus() == CommonConstants.ONE_INT){
param.setErrorMessage(InsurancesConstants.BUY_HANDLE_ONE_NOT_REGISTERED);
listResult.add(param);
continue;
}
if (detail.getBuyHandleStatus() == CommonConstants.TWO_INT){
param.setErrorMessage(InsurancesConstants.BUY_HANDLE_TWO_NOT_REGISTERED);
listResult.add(param);
continue;
} }
} }
listSuccess.add(param); listSuccess.add(param);
......
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