Commit 33608364 authored by fangxinjiang's avatar fangxinjiang

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

parents 3a02c593 ceb2d549
...@@ -55,4 +55,10 @@ public class ValidityConstants { ...@@ -55,4 +55,10 @@ public class ValidityConstants {
/** 全汉字 最多20位 规则 */ /** 全汉字 最多20位 规则 */
public static final String CHINESE_PATTERN_20 = "^[\\u4E00-\\u9FA5]{1,20}"; public static final String CHINESE_PATTERN_20 = "^[\\u4E00-\\u9FA5]{1,20}";
/** 最多20位 规则 */
public static final String PATTERN_20 = "^.{1,20}$";
/** 最多32位 规则 */
public static final String PATTERN_32 = "^.{1,32}$";
/** 最多50位 规则 */
public static final String PATTERN_50 = "^.{1,50}$";
} }
...@@ -201,6 +201,7 @@ public class ValidityUtil { ...@@ -201,6 +201,7 @@ public class ValidityUtil {
} }
return str.matches(ValidityConstants.CHINESE_PATTERN) ; return str.matches(ValidityConstants.CHINESE_PATTERN) ;
} }
/** /**
* 验证字符串是否全是汉字 最多20位 * 验证字符串是否全是汉字 最多20位
* *
...@@ -215,6 +216,48 @@ public class ValidityUtil { ...@@ -215,6 +216,48 @@ public class ValidityUtil {
return str.matches(ValidityConstants.CHINESE_PATTERN_20) ; return str.matches(ValidityConstants.CHINESE_PATTERN_20) ;
} }
/**
* 验证字符串 最多20位
*
* @author licancan
* @param str
* @return {@link boolean}
*/
public static boolean validate20(final String str){
if(Common.isEmpty(str)){
return Boolean.FALSE;
}
return str.matches(ValidityConstants.PATTERN_20) ;
}
/**
* 验证字符串 最多32位
*
* @author licancan
* @param str
* @return {@link boolean}
*/
public static boolean validate32(final String str){
if(Common.isEmpty(str)){
return Boolean.FALSE;
}
return str.matches(ValidityConstants.PATTERN_32) ;
}
/**
* 验证字符串 最多50位
*
* @author licancan
* @param str
* @return {@link boolean}
*/
public static boolean validate50(final String str){
if(Common.isEmpty(str)){
return Boolean.FALSE;
}
return str.matches(ValidityConstants.PATTERN_50) ;
}
/** /**
* 校验用户姓名是否是初始化的值 * 校验用户姓名是否是初始化的值
* *
......
...@@ -340,9 +340,20 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -340,9 +340,20 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
} }
if (byId.getBuyHandleStatus() == CommonConstants.FOUR_INT && byId.getBuyType() != CommonConstants.FOUR_INT){ if (byId.getBuyHandleStatus() == CommonConstants.FOUR_INT && byId.getBuyType() != CommonConstants.FOUR_INT){
// 身份证号位数校验(18 位合法) // 身份证号位数校验(18 位合法)
if (ValidityUtil.validateIDCard(param.getEmpIdcardNo())){ if (!ValidityUtil.validateIDCard(param.getEmpIdcardNo())){
return R.failed(InsurancesConstants.EMP_IDCARD_NO_NOT_LEGITIMATE); return R.failed(InsurancesConstants.EMP_IDCARD_NO_NOT_LEGITIMATE);
} }
//校验身份合法
TCheckIdCard checkIdCard = new TCheckIdCard();
checkIdCard.setName(param.getEmpName());
checkIdCard.setIdCard(param.getEmpIdcardNo());
R<TCheckIdCard> tCheckIdCardR = checkDaprUtil.checkIdCardSingle(checkIdCard);
if (null != tCheckIdCardR && tCheckIdCardR.getCode() == CommonConstants.SUCCESS){
TCheckIdCard data = tCheckIdCardR.getData();
if (CommonConstants.ONE_INT != data.getIsTrue()){
return R.failed(InsurancesConstants.EMP_ID_CARD_NO_NOT_FIT);
}
}
// 保单开始日期 > 当前派单日期 // 保单开始日期 > 当前派单日期
if(!LocalDateUtil.isDate(param.getPolicyStart(),LocalDateUtil.NORM_DATE_PATTERN)){ if(!LocalDateUtil.isDate(param.getPolicyStart(),LocalDateUtil.NORM_DATE_PATTERN)){
return R.failed(InsurancesConstants.POLICY_START_PARSE_ERROR); return R.failed(InsurancesConstants.POLICY_START_PARSE_ERROR);
......
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