Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
yifu-mvp
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fangxinjiang
yifu-mvp
Commits
c1c812fd
Commit
c1c812fd
authored
Jul 26, 2022
by
李灿灿
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
编辑修改
parent
630b136f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
61 additions
and
1 deletion
+61
-1
ValidityConstants.java
....plus.v1/yifu/common/core/constant/ValidityConstants.java
+6
-0
ValidityUtil.java
...yifu/cloud/plus/v1/yifu/insurances/util/ValidityUtil.java
+43
-0
TInsuranceDetailServiceImpl.java
.../insurances/service/impl/TInsuranceDetailServiceImpl.java
+12
-1
No files found.
yifu-common/yifu-common-core/src/main/java/com/yifu.cloud.plus.v1/yifu/common/core/constant/ValidityConstants.java
View file @
c1c812fd
...
@@ -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}$"
;
}
}
yifu-insurances/yifu-insurances-api/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/util/ValidityUtil.java
View file @
c1c812fd
...
@@ -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
)
;
}
/**
/**
* 校验用户姓名是否是初始化的值
* 校验用户姓名是否是初始化的值
*
*
...
...
yifu-insurances/yifu-insurances-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/service/impl/TInsuranceDetailServiceImpl.java
View file @
c1c812fd
...
@@ -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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment