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
d8dc9e35
Commit
d8dc9e35
authored
Mar 18, 2026
by
zhangxingmin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
push
parent
f9ee0fb4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
+12
-2
yd-csf-api/src/main/java/com/yd/csf/api/service/impl/ApiCsfCommonServiceImpl.java
+12
-2
No files found.
yd-csf-api/src/main/java/com/yd/csf/api/service/impl/ApiCsfCommonServiceImpl.java
View file @
d8dc9e35
...
...
@@ -229,16 +229,26 @@ public class ApiCsfCommonServiceImpl implements ApiCsfCommonService {
LocalDate
currentDate
=
LocalDate
.
now
();
if
(
birthDate
.
isAfter
(
currentDate
))
{
throw
new
IllegalArgumentException
(
"生日日期不能
晚
于当前日期"
);
throw
new
IllegalArgumentException
(
"生日日期不能
大
于当前日期"
);
}
Period
period
=
Period
.
between
(
birthDate
,
currentDate
);
return
String
.
valueOf
(
period
.
getYears
());
}
catch
(
Exception
e
)
{
throw
new
IllegalArgumentException
(
"生日格式不正确,应为yyyy-MM-dd格式"
);
// throw new IllegalArgumentException("生日格式不正确,应为yyyy-MM-dd格式");
throw
new
IllegalArgumentException
(
e
.
getMessage
());
}
}
public
static
void
main
(
String
[]
args
)
{
ApiCsfCommonServiceImpl
commonService
=
new
ApiCsfCommonServiceImpl
();
ApiCsfCalculateRequest
request
=
new
ApiCsfCalculateRequest
();
request
.
setRequestValue
(
"310111202603191111"
);
request
.
setCalculateType
(
6
);
Result
<
List
<
ApiCsfCalculateResponse
>>
result
=
commonService
.
calculate
(
request
);
System
.
out
.
println
(
result
);
}
/**
* 身高和体重计算BMI指数
* @param requestValueList
...
...
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