Commit bc1aab6f authored by 李灿灿's avatar 李灿灿

批增接口调试

parent 76ed41fc
......@@ -108,6 +108,10 @@ public class InsurancesConstants {
* 替换员工姓名不能为空
*/
public static final String REPLACE_EMP_NAME_NOT_EMPTY = "替换员工姓名不能为空";
/**
* 替换员工姓名超过20字符长度限制
*/
public static final String REPLACE_EMP_NAME_MORE_THAN_20 = "替换员工姓名超过20字符长度限制";
/**
* 员工身份证号不能为空
*/
......@@ -125,9 +129,9 @@ public class InsurancesConstants {
*/
public static final String EMP_ID_CARD_NO_NOT_FIT = "员工未通过实名认证";
/**
* 替换员工姓名、身份证号不一致
* 替换员工未通过实名认证
*/
public static final String REPLACE_EMP_ID_CARD_NO_NOT_FIT = "替换员工姓名、身份证号不一致";
public static final String REPLACE_EMP_ID_CARD_NO_NOT_FIT = "替换员工未通过实名认证";
/**
* 替换员工身份证号格式有误
*/
......@@ -137,9 +141,9 @@ public class InsurancesConstants {
*/
public static final String DEPT_NO_NOT_EMPTY = "项目编码不能为空";
/**
* 替换项目编码不能为空
* 替换员工项目编码不能为空
*/
public static final String REPLACE_DEPT_NO_NOT_EMPTY = "替换项目编码不能为空";
public static final String REPLACE_DEPT_NO_NOT_EMPTY = "替换员工项目编码不能为空";
/**
* 保险公司名称不能为空
*/
......@@ -253,9 +257,17 @@ public class InsurancesConstants {
*/
public static final String ACTUAL_PREMIUM_NO_EMPTY = "保费不能为空";
/**
* 保单号不存在
* 保单号不存在或已过期
*/
public static final String POLICY_NO_EXIST = "保单号不存在或已过期";
/**
* 保险公司错误
*/
public static final String POLICY_NO_COMPANY_NAME_NOT_SAME = "保险公司错误";
/**
* 险种名称错误
*/
public static final String POLICY_NO_EXIST= "保单号不存在";
public static final String POLICY_NO_TYPE_NAME_NOT_SAME = "险种名称错误";
/***********************减员办理错误码********************************/
......
......@@ -971,6 +971,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
listResult.add(param);
continue;
}
if (!ValidityUtil.validate20(param.getEmpName())){
param.setErrorMessage(InsurancesConstants.EMP_NAME_MORE_THAN_20);
listResult.add(param);
continue;
}
if (StringUtils.isBlank(param.getEmpIdcardNo())){
param.setErrorMessage(InsurancesConstants.EMP_IDCARD_NO_NOT_EMPTY);
listResult.add(param);
......@@ -981,6 +986,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
listResult.add(param);
continue;
}
if (!ValidityUtil.validate32(param.getPost())){
param.setErrorMessage(InsurancesConstants.POST_NOT_MORE_THAN_32);
listResult.add(param);
continue;
}
if (StringUtils.isBlank(param.getPolicyNo())){
param.setErrorMessage(InsurancesConstants.POLICY_NO_EMPTY);
listResult.add(param);
......@@ -1026,6 +1036,13 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
listResult.add(param);
continue;
}
if (StringUtils.isNotBlank(param.getRemark())){
if (!ValidityUtil.validate50(param.getRemark())){
param.setErrorMessage(InsurancesConstants.REMARK_NOT_MORE_THAN_50);
listResult.add(param);
continue;
}
}
// 身份证号位数校验(18 位合法)
if (!ValidityUtil.validateIDCard(param.getEmpIdcardNo())){
param.setErrorMessage(InsurancesConstants.EMP_IDCARD_NO_NOT_LEGITIMATE);
......@@ -1147,14 +1164,34 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
}
}
// 结算月份 >= 派单月份(结算月 < 派单月份的记录予以拦截,并提示)
if(!LocalDateUtil.isDate(param.getSettleMonth(),LocalDateUtil.NORM_MONTH_PATTERN)){
param.setErrorMessage(InsurancesConstants.SETTLE_MONTH_PARSE_ERROR);
listResult.add(param);
continue;
}
if(!LocalDateUtil.isCurrentOrFutureMonth(param.getSettleMonth())){
param.setErrorMessage(InsurancesConstants.SETTLE_MONTH_SHOULD_IS_FUTURE);
listResult.add(param);
continue;
}
//记录查重校验:姓名 + 身份证号 + 保险公司 + 险种
//待投保、投保中、已投保(有效、未过期)
Set<Integer> setRStatus = Sets.newHashSet();
setRStatus.add(CommonConstants.FOUR_INT);
setRStatus.add(CommonConstants.FIVE_INT);
TInsuranceDetail insuranceDetail = this.baseMapper.selectOne(Wrappers.<TInsuranceDetail>query().lambda()
.eq(TInsuranceDetail::getEmpName, param.getEmpName())
.eq(TInsuranceDetail::getEmpIdcardNo, param.getEmpIdcardNo())
.eq(TInsuranceDetail::getInsuranceCompanyName, param.getInsuranceCompanyName())
.eq(TInsuranceDetail::getInsuranceTypeName, param.getInsuranceTypeName())
//是否需要加状态过滤?
.notIn(TInsuranceDetail::getBuyHandleStatus, setRStatus)
.eq(TInsuranceDetail::getDeleteFlag, CommonConstants.ZERO_INT)
.ne(TInsuranceDetail::getIsEffect,CommonConstants.ONE_INT)
.ne(TInsuranceDetail::getIsOverdue,CommonConstants.ONE_INT)
.last(CommonConstants.LAST_ONE_SQL)
);
if (Optional.ofNullable(insuranceDetail).isPresent()){
param.setErrorMessage(InsurancesConstants.DATA_IS_EXIST);
......@@ -1165,6 +1202,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
TInsuranceDetail limitOne = this.baseMapper.selectOne(Wrappers.<TInsuranceDetail>query().lambda()
.eq(TInsuranceDetail::getPolicyNo, param.getPolicyNo())
.eq(TInsuranceDetail::getBuyHandleStatus, CommonConstants.THREE_INT)
.ne(TInsuranceDetail::getIsEffect,CommonConstants.ONE_INT)
.ne(TInsuranceDetail::getIsOverdue,CommonConstants.ONE_INT)
.eq(TInsuranceDetail::getDeleteFlag, CommonConstants.ZERO_INT)
.last(CommonConstants.LAST_ONE_SQL)
);
......@@ -1173,20 +1212,18 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
listResult.add(param);
continue;
}else {
param.setPolicyStart(limitOne.getPolicyStart());
param.setPolicyEnd(limitOne.getPolicyEnd());
}
// 结算月份 >= 派单月份(结算月 < 派单月份的记录予以拦截,并提示)
if(!LocalDateUtil.isDate(param.getSettleMonth(),LocalDateUtil.NORM_MONTH_PATTERN)){
param.setErrorMessage(InsurancesConstants.SETTLE_MONTH_PARSE_ERROR);
listResult.add(param);
continue;
}
if(!LocalDateUtil.isCurrentOrFutureMonth(param.getSettleMonth())){
param.setErrorMessage(InsurancesConstants.SETTLE_MONTH_SHOULD_IS_FUTURE);
listResult.add(param);
continue;
if(!limitOne.getInsuranceCompanyName().equals(param.getInsuranceCompanyName())){
param.setErrorMessage(InsurancesConstants.POLICY_NO_COMPANY_NAME_NOT_SAME);
listResult.add(param);
continue;
}else if (!limitOne.getInsuranceTypeName().equals(param.getInsuranceTypeName())){
param.setErrorMessage(InsurancesConstants.POLICY_NO_TYPE_NAME_NOT_SAME);
listResult.add(param);
continue;
}else {
param.setPolicyStart(limitOne.getPolicyStart());
param.setPolicyEnd(limitOne.getPolicyEnd());
}
}
listSuccess.add(param);
}
......@@ -1213,6 +1250,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
listResult.add(param);
continue;
}
if (!ValidityUtil.validate20(param.getEmpName())){
param.setErrorMessage(InsurancesConstants.EMP_NAME_MORE_THAN_20);
listResult.add(param);
continue;
}
if (StringUtils.isBlank(param.getEmpIdcardNo())){
param.setErrorMessage(InsurancesConstants.EMP_IDCARD_NO_NOT_EMPTY);
listResult.add(param);
......@@ -1248,6 +1290,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
listResult.add(param);
continue;
}
if (!ValidityUtil.validate20(param.getReplaceEmpName())){
param.setErrorMessage(InsurancesConstants.REPLACE_EMP_NAME_MORE_THAN_20);
listResult.add(param);
continue;
}
if (StringUtils.isBlank(param.getReplaceEmpIdcardNo())){
param.setErrorMessage(InsurancesConstants.REPLACE_EMP_IDCARD_NO_NOT_EMPTY);
listResult.add(param);
......@@ -1263,6 +1310,13 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
listResult.add(param);
continue;
}
if (!ValidityUtil.validate32(param.getPost())){
param.setErrorMessage(InsurancesConstants.POST_NOT_MORE_THAN_32);
listResult.add(param);
continue;
}
// 身份证号位数校验(18 位合法)
if (!ValidityUtil.validateIDCard(param.getEmpIdcardNo())){
param.setErrorMessage(InsurancesConstants.EMP_IDCARD_NO_NOT_LEGITIMATE);
......@@ -1337,6 +1391,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
listResult.add(param);
continue;
}
listSuccess.add(param);
}
map.put("listResult",listResult);
......@@ -1387,6 +1442,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
listResult.add(param);
continue;
}
// 身份证号位数校验(18 位合法)
if (!ValidityUtil.validateIDCard(param.getEmpIdcardNo())){
param.setErrorMessage(InsurancesConstants.EMP_IDCARD_NO_NOT_LEGITIMATE);
......
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