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
860196b7
Commit
860196b7
authored
Sep 22, 2023
by
wujiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改时间转换
parent
d473455a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
68 additions
and
0 deletions
+68
-0
TdHygfJpInverterWarnDto.java
...mos/boot/module/hygf/api/dto/TdHygfJpInverterWarnDto.java
+10
-0
TimeUtil.java
.../com/yeejoin/amos/boot/module/hygf/api/util/TimeUtil.java
+47
-0
TdHygfJpInverterWarnServiceImpl.java
...ygf/biz/service/impl/TdHygfJpInverterWarnServiceImpl.java
+11
-0
No files found.
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/java/com/yeejoin/amos/boot/module/hygf/api/dto/TdHygfJpInverterWarnDto.java
View file @
860196b7
...
...
@@ -53,6 +53,8 @@ public class TdHygfJpInverterWarnDto {
@ApiModelProperty
(
value
=
"时间"
)
private
Long
time
;
private
String
stationName
;
private
String
stationContact
;
private
String
userName
;
...
...
@@ -63,8 +65,16 @@ public class TdHygfJpInverterWarnDto {
private
String
address
;
private
String
area
;
private
Long
createdTime
;
private
String
timeLongFormat
;
private
String
startTimeFormat
;
private
String
recoverTimeFormat
;
private
List
<
String
>
stationIds
;
private
List
<
String
>
states
;
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/java/com/yeejoin/amos/boot/module/hygf/api/util/TimeUtil.java
View file @
860196b7
package
com
.
yeejoin
.
amos
.
boot
.
module
.
hygf
.
api
.
util
;
import
java.text.SimpleDateFormat
;
import
java.util.Calendar
;
import
java.util.Date
;
...
...
@@ -23,4 +24,50 @@ public class TimeUtil {
todayEnd
.
set
(
Calendar
.
MILLISECOND
,
999
);
return
todayEnd
.
getTime
().
getTime
();
}
public
static
String
dateFormat
(
Long
time
)
{
SimpleDateFormat
dateFormat
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
return
dateFormat
.
format
(
new
Date
(
time
));
}
public
static
String
longFormat
(
Long
time
)
{
if
(
time
<
1000
)
{
return
"0"
+
"秒"
;
}
long
second
=
time
/
1000
;
long
seconds
=
second
%
60
;
long
minutes
=
second
/
60
;
long
hours
=
0
;
if
(
minutes
>=
60
)
{
hours
=
minutes
/
60
;
minutes
=
minutes
%
60
;
}
String
timeString
=
""
;
String
secondString
=
""
;
String
minuteString
=
""
;
String
hourString
=
""
;
if
(
seconds
<
10
)
{
secondString
=
"0"
+
seconds
+
"秒"
;
}
else
{
secondString
=
seconds
+
"秒"
;
}
if
(
minutes
<
10
&&
hours
<
1
)
{
minuteString
=
minutes
+
"分"
;
}
else
if
(
minutes
<
10
)
{
minuteString
=
"0"
+
minutes
+
"分"
;
}
else
{
minuteString
=
minutes
+
"分"
;
}
if
(
hours
<
10
)
{
hourString
=
hours
+
"时"
;
}
else
{
hourString
=
hours
+
""
+
"时"
;
}
if
(
hours
!=
0
)
{
timeString
=
hourString
+
minuteString
+
secondString
;
}
else
{
timeString
=
minuteString
+
secondString
;
}
return
timeString
;
}
}
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/service/impl/TdHygfJpInverterWarnServiceImpl.java
View file @
860196b7
...
...
@@ -6,6 +6,7 @@ import java.util.HashMap;
import
java.util.List
;
import
java.util.Map
;
import
org.apache.commons.lang3.time.DateUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
...
...
@@ -23,6 +24,7 @@ import com.yeejoin.amos.boot.module.hygf.api.entity.JpStation;
import
com.yeejoin.amos.boot.module.hygf.api.entity.TdHygfJpInverterWarn
;
import
com.yeejoin.amos.boot.module.hygf.api.service.ITdHygfJpInverterWarnService
;
import
com.yeejoin.amos.boot.module.hygf.api.tdenginemapper.TdHygfJpInverterWarnMapper
;
import
com.yeejoin.amos.boot.module.hygf.api.util.TimeUtil
;
/**
* 户用光伏监盘逆变器报警表服务实现类
...
...
@@ -74,11 +76,20 @@ public class TdHygfJpInverterWarnServiceImpl
JpStation
jpStation
=
jpStationServiceImpl
.
getOne
(
new
LambdaQueryWrapper
<
JpStation
>()
.
eq
(
JpStation:
:
getThirdStationId
,
tdHygfJpInverterWarnDto
.
getThirdStationId
()));
if
(
jpStation
!=
null
)
{
tdHygfJpInverterWarnDto
.
setStationName
(
jpStation
.
getName
());
tdHygfJpInverterWarnDto
.
setStationContact
(
jpStation
.
getStationContact
());
tdHygfJpInverterWarnDto
.
setUserName
(
jpStation
.
getUserName
());
tdHygfJpInverterWarnDto
.
setUserPhone
(
jpStation
.
getUserPhone
());
tdHygfJpInverterWarnDto
.
setEmail
(
jpStation
.
getEmail
());
tdHygfJpInverterWarnDto
.
setAddress
(
jpStation
.
getAddress
());
tdHygfJpInverterWarnDto
.
setArea
(
jpStation
.
getArea
());
if
(
tdHygfJpInverterWarnDto
.
getRecoverTime
()
!=
null
)
{
tdHygfJpInverterWarnDto
.
setRecoverTimeFormat
(
TimeUtil
.
dateFormat
(
tdHygfJpInverterWarnDto
.
getRecoverTime
()));
tdHygfJpInverterWarnDto
.
setTimeLongFormat
(
TimeUtil
.
longFormat
(
tdHygfJpInverterWarnDto
.
getRecoverTime
()
-
tdHygfJpInverterWarnDto
.
getStartTime
()));
}
tdHygfJpInverterWarnDto
.
setStartTimeFormat
(
TimeUtil
.
dateFormat
(
tdHygfJpInverterWarnDto
.
getStartTime
()));
}
return
tdHygfJpInverterWarnDto
;
...
...
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