Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yd-csf
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xingmin
yd-csf
Commits
99f7e07c
Commit
99f7e07c
authored
Mar 16, 2026
by
zhangxingmin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
push
parent
760e13be
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
+11
-11
yd-csf-feign/src/main/java/com/yd/csf/feign/dto/appointment/ApiInsurantInfoDto.java
+11
-11
No files found.
yd-csf-feign/src/main/java/com/yd/csf/feign/dto/appointment/ApiInsurantInfoDto.java
View file @
99f7e07c
...
@@ -81,17 +81,17 @@ public class ApiInsurantInfoDto {
...
@@ -81,17 +81,17 @@ public class ApiInsurantInfoDto {
@NotNull
(
message
=
"受保人-生日不能为空"
,
groups
=
GroupValid
.
NotSelf
.
class
)
@NotNull
(
message
=
"受保人-生日不能为空"
,
groups
=
GroupValid
.
NotSelf
.
class
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
LocalDateTime
birthday
;
private
LocalDateTime
birthday
;
@AssertTrue
(
message
=
"受保人-必须大于18周岁"
,
groups
=
GroupValid
.
NotSelf
.
class
)
//
@AssertTrue(message = "受保人-必须大于18周岁", groups = GroupValid.NotSelf.class)
public
boolean
isBirthdayValid
()
{
//
public boolean isBirthdayValid() {
if
(
birthday
==
null
)
{
//
if (birthday == null) {
// @NotNull 会处理空值
//
// @NotNull 会处理空值
return
true
;
//
return true;
}
//
}
LocalDateTime
now
=
LocalDateTime
.
now
();
//
LocalDateTime now = LocalDateTime.now();
// 计算年龄
//
// 计算年龄
int
age
=
Period
.
between
(
birthday
.
toLocalDate
(),
now
.
toLocalDate
()).
getYears
();
//
int age = Period.between(birthday.toLocalDate(), now.toLocalDate()).getYears();
return
age
>
18
;
//
return age > 18;
}
//
}
/**
/**
* 年龄(通过生日自动获取年龄)
* 年龄(通过生日自动获取年龄)
...
...
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