记得上下班打卡 | git大法好,push需谨慎

Commit 5b8f579e authored by 张国柄's avatar 张国柄

fix:入场人非证件号格式校验;

parent 187764af
...@@ -23,7 +23,8 @@ public class AdamEntersParam implements java.io.Serializable { ...@@ -23,7 +23,8 @@ public class AdamEntersParam implements java.io.Serializable {
@ApiModelProperty(position = 13, required = true, value = "证件类型:1-大陆身份证,2-港澳通行证,3-台胞证,4-护照,5-军官证", allowableValues = "1,2,3,4,5") @ApiModelProperty(position = 13, required = true, value = "证件类型:1-大陆身份证,2-港澳通行证,3-台胞证,4-护照,5-军官证", allowableValues = "1,2,3,4,5")
@NotNull @Min(1) @Max(5) @NotNull @Min(1) @Max(5)
private Integer type; private Integer type;
@ApiModelProperty(position = 14, required = true, value = "入场人证件号[11]", example = "110101110001010111") @ApiModelProperty(position = 14, required = true, value = "入场人证件号[30]", example = "110101110001010111")
// @Pattern(regexp = LnsRegex.Valid.CHINESE_ID_CARD, message = "身份证号格式有误") @Pattern(regexp = LnsRegex.Valid.LETTER_NUMBER, message = "证件号格式有误")
@Size(min = 1, max = 30)
private String idCard; private String idCard;
} }
...@@ -22,5 +22,9 @@ public class LnsRegex { ...@@ -22,5 +22,9 @@ public class LnsRegex {
* 身份证号(15位||18位) * 身份证号(15位||18位)
*/ */
public static final String CHINESE_ID_CARD = "(^\\d{15}$)|(^\\d{18}$)|(^\\d{17}(\\d|X|x)$)"; public static final String CHINESE_ID_CARD = "(^\\d{15}$)|(^\\d{18}$)|(^\\d{17}(\\d|X|x)$)";
/**
* 字母、数字组合
*/
public static final String LETTER_NUMBER = "^[A-Z0-9]+$";
} }
} }
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