Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
HYH.APSJ
Project
Project
Details
Activity
Releases
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
佟礼
HYH.APSJ
Commits
18420541
Commit
18420541
authored
Jan 19, 2026
by
DESKTOP-VKRD9QF\Administration
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
取消固定日期
parent
5942f615
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
2 deletions
+21
-2
ChromosomeDataService.java
...in/java/com/aps/service/common/ChromosomeDataService.java
+21
-2
No files found.
src/main/java/com/aps/service/common/ChromosomeDataService.java
View file @
18420541
...
...
@@ -1184,13 +1184,23 @@ public class ChromosomeDataService {
// 处理带Z后缀的格式,将其转换为带+00:00时区的格式
dateString
=
dateString
.
substring
(
0
,
dateString
.
length
()
-
1
)
+
"+00:00"
;
parsedDateTime
=
OffsetDateTime
.
parse
(
dateString
).
toLocalDateTime
();
}
else
if
(
dateString
.
contains
(
" "
))
{
// 处理包含空格的日期时间格式,如 "2026-01-07 00:00:00"
DateTimeFormatter
spaceFormatter
=
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd HH:mm:ss"
);
parsedDateTime
=
LocalDateTime
.
parse
(
dateString
,
spaceFormatter
);
}
else
{
// 尝试解析为OffsetDateTime然后转换为LocalDateTime
try
{
parsedDateTime
=
OffsetDateTime
.
parse
(
dateString
).
toLocalDateTime
();
}
catch
(
DateTimeParseException
e
)
{
// 如果不是偏移格式,尝试直接解析为LocalDateTime
parsedDateTime
=
LocalDateTime
.
parse
(
dateString
,
DateTimeFormatter
.
ISO_LOCAL_DATE_TIME
);
try
{
parsedDateTime
=
LocalDateTime
.
parse
(
dateString
,
DateTimeFormatter
.
ISO_LOCAL_DATE_TIME
);
}
catch
(
DateTimeParseException
ex
)
{
// 最后尝试使用 "yyyy-MM-dd HH:mm:ss" 格式
DateTimeFormatter
fallbackFormatter
=
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd HH:mm:ss"
);
parsedDateTime
=
LocalDateTime
.
parse
(
dateString
,
fallbackFormatter
);
}
}
}
field
.
set
(
obj
,
parsedDateTime
);
...
...
@@ -1198,7 +1208,16 @@ public class ChromosomeDataService {
field
.
set
(
obj
,
(
LocalDateTime
)
fieldValue
);
}
else
{
// 尝试将其他类型转换为字符串再解析
field
.
set
(
obj
,
LocalDateTime
.
parse
(
fieldValue
.
toString
(),
DateTimeFormatter
.
ISO_LOCAL_DATE_TIME
));
String
dateString
=
fieldValue
.
toString
();
// 同样处理各种格式
LocalDateTime
parsedDateTime
;
if
(
dateString
.
contains
(
" "
))
{
DateTimeFormatter
spaceFormatter
=
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd HH:mm:ss"
);
parsedDateTime
=
LocalDateTime
.
parse
(
dateString
,
spaceFormatter
);
}
else
{
parsedDateTime
=
LocalDateTime
.
parse
(
dateString
,
DateTimeFormatter
.
ISO_LOCAL_DATE_TIME
);
}
field
.
set
(
obj
,
parsedDateTime
);
}
}
else
{
field
.
set
(
obj
,
fieldValue
);
...
...
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