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
ff3dddf2
Commit
ff3dddf2
authored
Nov 13, 2023
by
caotao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.户用光伏数据采集逆变器告警增加告警时长处理。
parent
483282d3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
15 deletions
+28
-15
GoLangDataAcquisitionServiceImpl.java
...i/face/service/impl/GoLangDataAcquisitionServiceImpl.java
+9
-4
ImasterDataServiceImpl.java
...ouseholdapi/face/service/impl/ImasterDataServiceImpl.java
+2
-1
KsolarDataAcquisitionServiceImpl.java
...i/face/service/impl/KsolarDataAcquisitionServiceImpl.java
+17
-10
No files found.
amos-boot-data/amos-boot-data-housepvapi/src/main/java/com/yeejoin/amos/api/householdapi/face/service/impl/GoLangDataAcquisitionServiceImpl.java
View file @
ff3dddf2
...
@@ -38,7 +38,6 @@ import java.util.concurrent.TimeUnit;
...
@@ -38,7 +38,6 @@ import java.util.concurrent.TimeUnit;
@Service
@Service
public
class
GoLangDataAcquisitionServiceImpl
implements
GoLangDataAcquisitionService
{
public
class
GoLangDataAcquisitionServiceImpl
implements
GoLangDataAcquisitionService
{
//定时任务执行频率 当前为10分钟一次
//定时任务执行频率 当前为10分钟一次
//锦浪云请求工具封装
//锦浪云请求工具封装
...
@@ -149,7 +148,7 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe
...
@@ -149,7 +148,7 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe
jpStation
.
setUserName
(
golangStationDetail
.
getUsername
());
jpStation
.
setUserName
(
golangStationDetail
.
getUsername
());
jpStation
.
setUserPhone
(
String
.
valueOf
(
golangStationDetail
.
getUsermobile
()));
jpStation
.
setUserPhone
(
String
.
valueOf
(
golangStationDetail
.
getUsermobile
()));
jpStation
.
setStationContact
(
String
.
valueOf
(
golangStationDetail
.
getMobile
()).
toLowerCase
().
replace
(
"null"
,
""
));
jpStation
.
setStationContact
(
String
.
valueOf
(
golangStationDetail
.
getMobile
()).
toLowerCase
().
replace
(
"null"
,
""
));
jpStation
.
setModuleCount
(
ObjectUtils
.
isEmpty
(
Math
.
toIntExact
(
golangStationDetail
.
getModule
()))
?
0
:
Math
.
toIntExact
(
golangStationDetail
.
getModule
()));
jpStation
.
setModuleCount
(
ObjectUtils
.
isEmpty
(
Math
.
toIntExact
(
golangStationDetail
.
getModule
()))
?
0
:
Math
.
toIntExact
(
golangStationDetail
.
getModule
()));
//并网类型
//并网类型
jpStation
.
setState
(
GoLangConstant
.
stationStaus
.
get
(
String
.
valueOf
(
golangStationDetail
.
getState
())));
jpStation
.
setState
(
GoLangConstant
.
stationStaus
.
get
(
String
.
valueOf
(
golangStationDetail
.
getState
())));
jpStation
.
setThirdStationId
(
String
.
valueOf
(
golangStationDetail
.
getId
()));
jpStation
.
setThirdStationId
(
String
.
valueOf
(
golangStationDetail
.
getId
()));
...
@@ -509,7 +508,6 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe
...
@@ -509,7 +508,6 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe
hygfjpInverterWarn
=
new
HYGFJPInverterWarn
();
hygfjpInverterWarn
=
new
HYGFJPInverterWarn
();
}
}
hygfjpInverterWarn
.
setTime
(
System
.
currentTimeMillis
());
hygfjpInverterWarn
.
setTime
(
System
.
currentTimeMillis
());
hygfjpInverterWarn
.
setTimeLong
(
System
.
currentTimeMillis
());
hygfjpInverterWarn
.
setSnCode
(
alarmDto
.
getAlarmDeviceSn
());
hygfjpInverterWarn
.
setSnCode
(
alarmDto
.
getAlarmDeviceSn
());
hygfjpInverterWarn
.
setThirdStationId
(
String
.
valueOf
(
alarmDto
.
getStationId
()));
hygfjpInverterWarn
.
setThirdStationId
(
String
.
valueOf
(
alarmDto
.
getStationId
()));
hygfjpInverterWarn
.
setLevel
(
GoLangConstant
.
alarmLevel
.
get
(
alarmDto
.
getAlarmLevel
()));
hygfjpInverterWarn
.
setLevel
(
GoLangConstant
.
alarmLevel
.
get
(
alarmDto
.
getAlarmLevel
()));
...
@@ -517,7 +515,14 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe
...
@@ -517,7 +515,14 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe
hygfjpInverterWarn
.
setThirdCode
(
PVProducerInfoEnum
.
JLY
.
getCode
());
hygfjpInverterWarn
.
setThirdCode
(
PVProducerInfoEnum
.
JLY
.
getCode
());
hygfjpInverterWarn
.
setTreatment
(
alarmDto
.
getAdvice
());
hygfjpInverterWarn
.
setTreatment
(
alarmDto
.
getAdvice
());
hygfjpInverterWarn
.
setStartTime
(
alarmDto
.
getAlarmBeginTime
());
hygfjpInverterWarn
.
setStartTime
(
alarmDto
.
getAlarmBeginTime
());
hygfjpInverterWarn
.
setRecoverTime
(
alarmDto
.
getAlarmEndTime
());
hygfjpInverterWarn
.
setRecoverTime
(
null
);
if
(!
ObjectUtils
.
isEmpty
(
alarmDto
.
getAlarmEndTime
()))
{
hygfjpInverterWarn
.
setRecoverTime
(
alarmDto
.
getAlarmEndTime
());
}
hygfjpInverterWarn
.
setTimeLong
(
null
);
if
(!
ObjectUtils
.
isEmpty
(
alarmDto
.
getAlarmEndTime
())
&&
!
ObjectUtils
.
isEmpty
(
alarmDto
.
getAlarmEndTime
()))
{
hygfjpInverterWarn
.
setTimeLong
(
alarmDto
.
getAlarmEndTime
()
-
alarmDto
.
getAlarmBeginTime
());
}
hygfjpInverterWarn
.
setState
(
GoLangConstant
.
alarmstatus
.
get
(
alarmDto
.
getState
()));
hygfjpInverterWarn
.
setState
(
GoLangConstant
.
alarmstatus
.
get
(
alarmDto
.
getState
()));
if
(
ObjectUtils
.
isEmpty
(
hygfjpInverterWarn
.
getCreatedTime
()))
{
if
(
ObjectUtils
.
isEmpty
(
hygfjpInverterWarn
.
getCreatedTime
()))
{
hygfjpInverterWarn
.
setCreatedTime
(
System
.
currentTimeMillis
());
hygfjpInverterWarn
.
setCreatedTime
(
System
.
currentTimeMillis
());
...
...
amos-boot-data/amos-boot-data-housepvapi/src/main/java/com/yeejoin/amos/api/householdapi/face/service/impl/ImasterDataServiceImpl.java
View file @
ff3dddf2
...
@@ -770,7 +770,6 @@ public class ImasterDataServiceImpl implements ImasterDataService {
...
@@ -770,7 +770,6 @@ public class ImasterDataServiceImpl implements ImasterDataService {
hygfjpInverterWarn
=
new
HYGFJPInverterWarn
();
hygfjpInverterWarn
=
new
HYGFJPInverterWarn
();
}
}
hygfjpInverterWarn
.
setTime
(
System
.
currentTimeMillis
());
hygfjpInverterWarn
.
setTime
(
System
.
currentTimeMillis
());
hygfjpInverterWarn
.
setTimeLong
(
System
.
currentTimeMillis
());
hygfjpInverterWarn
.
setSnCode
(
alarmDto
.
getEsnCode
());
hygfjpInverterWarn
.
setSnCode
(
alarmDto
.
getEsnCode
());
hygfjpInverterWarn
.
setThirdStationId
(
String
.
valueOf
(
alarmDto
.
getStationCode
()));
hygfjpInverterWarn
.
setThirdStationId
(
String
.
valueOf
(
alarmDto
.
getStationCode
()));
hygfjpInverterWarn
.
setLevel
(
ImasterConstant
.
alarmLevel
.
get
(
alarmDto
.
getLev
().
toString
()));
hygfjpInverterWarn
.
setLevel
(
ImasterConstant
.
alarmLevel
.
get
(
alarmDto
.
getLev
().
toString
()));
...
@@ -778,6 +777,8 @@ public class ImasterDataServiceImpl implements ImasterDataService {
...
@@ -778,6 +777,8 @@ public class ImasterDataServiceImpl implements ImasterDataService {
hygfjpInverterWarn
.
setThirdCode
(
PVProducerInfoEnum
.
HUAWEI
.
getCode
());
hygfjpInverterWarn
.
setThirdCode
(
PVProducerInfoEnum
.
HUAWEI
.
getCode
());
hygfjpInverterWarn
.
setTreatment
(
alarmDto
.
getDevName
());
hygfjpInverterWarn
.
setTreatment
(
alarmDto
.
getDevName
());
hygfjpInverterWarn
.
setStartTime
(
alarmDto
.
getRaiseTime
());
hygfjpInverterWarn
.
setStartTime
(
alarmDto
.
getRaiseTime
());
hygfjpInverterWarn
.
setRecoverTime
(
null
);
hygfjpInverterWarn
.
setTimeLong
(
null
);
hygfjpInverterWarn
.
setState
(
ImasterConstant
.
alarmstatus
.
get
(
alarmDto
.
getStatus
().
toString
()));
hygfjpInverterWarn
.
setState
(
ImasterConstant
.
alarmstatus
.
get
(
alarmDto
.
getStatus
().
toString
()));
if
(
ObjectUtils
.
isEmpty
(
hygfjpInverterWarn
.
getCreatedTime
()))
{
if
(
ObjectUtils
.
isEmpty
(
hygfjpInverterWarn
.
getCreatedTime
()))
{
hygfjpInverterWarn
.
setCreatedTime
(
System
.
currentTimeMillis
());
hygfjpInverterWarn
.
setCreatedTime
(
System
.
currentTimeMillis
());
...
...
amos-boot-data/amos-boot-data-housepvapi/src/main/java/com/yeejoin/amos/api/householdapi/face/service/impl/KsolarDataAcquisitionServiceImpl.java
View file @
ff3dddf2
package
com
.
yeejoin
.
amos
.
api
.
householdapi
.
face
.
service
.
impl
;
package
com
.
yeejoin
.
amos
.
api
.
householdapi
.
face
.
service
.
impl
;
import
cn.hutool.core.date.DatePattern
;
import
cn.hutool.core.date.DateTime
;
import
cn.hutool.core.date.DateTime
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.date.DateUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
...
@@ -1053,12 +1054,12 @@ public class KsolarDataAcquisitionServiceImpl implements KSolarDataAcquisitionSe
...
@@ -1053,12 +1054,12 @@ public class KsolarDataAcquisitionServiceImpl implements KSolarDataAcquisitionSe
if
(!
CollectionUtils
.
isEmpty
(
result
))
{
if
(!
CollectionUtils
.
isEmpty
(
result
))
{
for
(
KsolarAlarmDto
ksolarAlarmDto
:
result
)
{
for
(
KsolarAlarmDto
ksolarAlarmDto
:
result
)
{
if
(!
ObjectUtils
.
isEmpty
(
ksolarAlarmDto
.
getInverterId
()))
{
if
(!
ObjectUtils
.
isEmpty
(
ksolarAlarmDto
.
getInverterId
()))
{
String
startTime
=
ksolarAlarmDto
.
getSaveTime
();
//
String startTime = ksolarAlarmDto.getSaveTime();
String
recoverTime
=
ksolarAlarmDto
.
getRemoveTime
();
//
String recoverTime = ksolarAlarmDto.getRemoveTime();
String
pattern
=
"yyyy-MM-dd HH:mm:ss"
;
//
String pattern = "yyyy-MM-dd HH:mm:ss";
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
pattern
);
//
SimpleDateFormat sdf = new SimpleDateFormat(pattern);
Date
startTimeL
=
sdf
.
parse
(
startTime
);
//
Date startTimeL = sdf.parse(startTime);
Date
recoverTimeL
=
sdf
.
parse
(
recoverTime
);
//
Date recoverTimeL = sdf.parse(recoverTime);
String
snCode
=
null
;
String
snCode
=
null
;
...
@@ -1072,7 +1073,7 @@ public class KsolarDataAcquisitionServiceImpl implements KSolarDataAcquisitionSe
...
@@ -1072,7 +1073,7 @@ public class KsolarDataAcquisitionServiceImpl implements KSolarDataAcquisitionSe
}
}
HYGFJPInverterWarn
hygfjpInverterWarn
=
hygfjpInverterWarnMapper
.
selectOne
(
new
QueryWrapper
<
HYGFJPInverterWarn
>()
HYGFJPInverterWarn
hygfjpInverterWarn
=
hygfjpInverterWarnMapper
.
selectOne
(
new
QueryWrapper
<
HYGFJPInverterWarn
>()
.
eq
(
"sn_code"
,
snCode
)
.
eq
(
"sn_code"
,
snCode
)
.
eq
(
"start_time"
,
startTimeL
.
getTime
())
.
eq
(
"start_time"
,
DateUtil
.
parse
(
ksolarAlarmDto
.
getSaveTime
(),
DatePattern
.
NORM_DATETIME_PATTERN
)
.
getTime
())
.
eq
(
"third_code"
,
PVProducerInfoEnum
.
KSOLAR
.
getCode
())
.
eq
(
"third_code"
,
PVProducerInfoEnum
.
KSOLAR
.
getCode
())
.
eq
(
"third_station_id"
,
ksolarAlarmDto
.
getStationId
())
.
eq
(
"third_station_id"
,
ksolarAlarmDto
.
getStationId
())
);
);
...
@@ -1081,16 +1082,22 @@ public class KsolarDataAcquisitionServiceImpl implements KSolarDataAcquisitionSe
...
@@ -1081,16 +1082,22 @@ public class KsolarDataAcquisitionServiceImpl implements KSolarDataAcquisitionSe
}
}
hygfjpInverterWarn
.
setTime
(
System
.
currentTimeMillis
());
hygfjpInverterWarn
.
setTime
(
System
.
currentTimeMillis
());
hygfjpInverterWarn
.
setTimeLong
(
System
.
currentTimeMillis
());
hygfjpInverterWarn
.
setSnCode
(
snCode
);
hygfjpInverterWarn
.
setSnCode
(
snCode
);
hygfjpInverterWarn
.
setThirdStationId
(
ksolarAlarmDto
.
getStationId
());
hygfjpInverterWarn
.
setThirdStationId
(
ksolarAlarmDto
.
getStationId
());
hygfjpInverterWarn
.
setLevel
(
KSolarConstant
.
alarmLevel
.
get
(
ksolarAlarmDto
.
getLevels
()));
hygfjpInverterWarn
.
setLevel
(
KSolarConstant
.
alarmLevel
.
get
(
ksolarAlarmDto
.
getLevels
()));
hygfjpInverterWarn
.
setContent
(
ksolarAlarmDto
.
getMessage
());
hygfjpInverterWarn
.
setContent
(
ksolarAlarmDto
.
getMessage
());
hygfjpInverterWarn
.
setThirdCode
(
PVProducerInfoEnum
.
KSOLAR
.
getCode
());
hygfjpInverterWarn
.
setThirdCode
(
PVProducerInfoEnum
.
KSOLAR
.
getCode
());
hygfjpInverterWarn
.
setTreatment
(
ksolarAlarmDto
.
getSolution
());
hygfjpInverterWarn
.
setTreatment
(
ksolarAlarmDto
.
getSolution
());
hygfjpInverterWarn
.
setStartTime
(
startTimeL
.
getTime
());
hygfjpInverterWarn
.
setStartTime
(
DateUtil
.
parse
(
ksolarAlarmDto
.
getSaveTime
(),
DatePattern
.
NORM_DATETIME_PATTERN
).
getTime
());
hygfjpInverterWarn
.
setRecoverTime
(
recoverTimeL
.
getTime
());
hygfjpInverterWarn
.
setState
(
KSolarConstant
.
alarmstatus
.
get
(
ksolarAlarmDto
.
getStatus
()));
hygfjpInverterWarn
.
setState
(
KSolarConstant
.
alarmstatus
.
get
(
ksolarAlarmDto
.
getStatus
()));
hygfjpInverterWarn
.
setTimeLong
(
null
);
hygfjpInverterWarn
.
setRecoverTime
(
null
);
if
(
StringUtils
.
isNotBlank
(
ksolarAlarmDto
.
getRemoveTime
())){
hygfjpInverterWarn
.
setRecoverTime
(
DateUtil
.
parse
(
ksolarAlarmDto
.
getRemoveTime
(),
DatePattern
.
NORM_DATETIME_PATTERN
).
getTime
());
}
if
(!
ObjectUtils
.
isEmpty
(
ksolarAlarmDto
.
getSaveTime
())&&!
ObjectUtils
.
isEmpty
(
ksolarAlarmDto
.
getRemoveTime
())){
hygfjpInverterWarn
.
setTimeLong
(
hygfjpInverterWarn
.
getRecoverTime
()-
hygfjpInverterWarn
.
getStartTime
());
}
if
(
ObjectUtils
.
isEmpty
(
hygfjpInverterWarn
.
getCreatedTime
()))
{
if
(
ObjectUtils
.
isEmpty
(
hygfjpInverterWarn
.
getCreatedTime
()))
{
hygfjpInverterWarn
.
setCreatedTime
(
System
.
currentTimeMillis
());
hygfjpInverterWarn
.
setCreatedTime
(
System
.
currentTimeMillis
());
hygfjpInverterWarnMapper
.
insert
(
hygfjpInverterWarn
);
hygfjpInverterWarnMapper
.
insert
(
hygfjpInverterWarn
);
...
...
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