Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
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
项目统一框架
amos-boot-biz
Commits
c515e18b
Commit
c515e18b
authored
Apr 08, 2026
by
刘林
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/develop_tzs_main' into develop_tzs_main
parents
44a16e38
d5f17c74
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
0 deletions
+28
-0
JgChangeRegistrationUnitServiceImpl.java
...biz/service/impl/JgChangeRegistrationUnitServiceImpl.java
+28
-0
No files found.
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/impl/JgChangeRegistrationUnitServiceImpl.java
View file @
c515e18b
...
...
@@ -3656,6 +3656,34 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
if
(
device
.
containsKey
(
"record"
))
{
unitEq
.
setEquId
((
String
)
device
.
get
(
"record"
));
//设备主键
}
if
(
device
.
containsKey
(
"nextInspectDate"
)
&&
device
.
get
(
"nextInspectDate"
)
!=
null
)
{
Object
nextInspectDate
=
device
.
get
(
"nextInspectDate"
);
// 处理 Timestamp 类型
if
(
nextInspectDate
instanceof
java
.
sql
.
Timestamp
)
{
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
device
.
put
(
"nextInspectDate"
,
sdf
.
format
((
java
.
sql
.
Timestamp
)
nextInspectDate
));
}
else
if
(
nextInspectDate
instanceof
Date
)
{
// 处理其他 Date 类型
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
device
.
put
(
"nextInspectDate"
,
sdf
.
format
((
Date
)
nextInspectDate
));
}
else
if
(
nextInspectDate
instanceof
Number
)
{
// 如果是时间戳格式(纯数字),则转换为 YYYY-MM-DD 格式
Instant
instant
=
Instant
.
ofEpochMilli
(((
Number
)
nextInspectDate
).
longValue
());
ZoneId
zoneId
=
ZoneId
.
systemDefault
();
DateTimeFormatter
formatter
=
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
).
withZone
(
zoneId
);
device
.
put
(
"nextInspectDate"
,
formatter
.
format
(
instant
));
}
else
if
(
nextInspectDate
instanceof
String
&&
!((
String
)
nextInspectDate
).
contains
(
"-"
))
{
// 如果是不含 "-" 的字符串格式时间戳
try
{
Instant
instant
=
Instant
.
ofEpochMilli
(
Long
.
parseLong
((
String
)
nextInspectDate
));
ZoneId
zoneId
=
ZoneId
.
systemDefault
();
DateTimeFormatter
formatter
=
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
).
withZone
(
zoneId
);
device
.
put
(
"nextInspectDate"
,
formatter
.
format
(
instant
));
}
catch
(
NumberFormatException
e
)
{
// 如果转换失败,保持原值
}
}
}
unitEq
.
setUnitChangeRegistrationId
(
registrationUnit
.
getSequenceNbr
().
toString
());
//单位变更业务主键
unitEq
.
setDeviceInfo
(
JSON
.
toJSONString
(
device
));
//设备信息json
jgRelationEquipList
.
add
(
unitEq
);
...
...
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