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
7b2de331
Commit
7b2de331
authored
Sep 21, 2023
by
wujiang
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'developer' of
http://39.98.45.134:8090/moa/amos-boot-biz
into developer
parents
506eaa65
98722217
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
80 additions
and
16 deletions
+80
-16
HYGFJPDayPower.java
...pi/face/orm/houseapi/entity/tdeingine/HYGFJPDayPower.java
+14
-0
HYGFJPStationPowerHistory.java
.../houseapi/entity/tdeingine/HYGFJPStationPowerHistory.java
+1
-1
HYGFJPDayPowerMapper.java
...oldapi/face/orm/mapper/tdengine/HYGFJPDayPowerMapper.java
+7
-0
GoLangDataAcquisitionServiceImpl.java
...i/face/service/impl/GoLangDataAcquisitionServiceImpl.java
+58
-15
No files found.
amos-boot-data/amos-boot-data-housepvapi/src/main/java/com/yeejoin/amos/api/householdapi/face/orm/houseapi/entity/tdeingine/HYGFJPDayPower.java
0 → 100644
View file @
7b2de331
package
com
.
yeejoin
.
amos
.
api
.
householdapi
.
face
.
orm
.
houseapi
.
entity
.
tdeingine
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
lombok.Data
;
@Data
@TableName
(
value
=
"td_hygf_day_power"
,
autoResultMap
=
true
)
public
class
HYGFJPDayPower
{
private
Long
createdTime
;
private
String
tationId
;
private
String
hour
;
private
String
yearMonthDay
;
private
Double
power
;
}
amos-boot-data/amos-boot-data-housepvapi/src/main/java/com/yeejoin/amos/api/householdapi/face/orm/houseapi/entity/tdeingine/HYGFJPStationPowerHistory.java
View file @
7b2de331
...
...
@@ -7,7 +7,7 @@ import java.io.Serializable;
import
java.util.Date
;
@Data
@TableName
(
value
=
"td_hygf_jp_
invertor_elec
_history"
,
autoResultMap
=
true
)
@TableName
(
value
=
"td_hygf_jp_
station_power
_history"
,
autoResultMap
=
true
)
public
class
HYGFJPStationPowerHistory
implements
Serializable
{
private
Long
createdTime
;
private
Double
power
;
...
...
amos-boot-data/amos-boot-data-housepvapi/src/main/java/com/yeejoin/amos/api/householdapi/face/orm/mapper/tdengine/HYGFJPDayPowerMapper.java
0 → 100644
View file @
7b2de331
package
com
.
yeejoin
.
amos
.
api
.
householdapi
.
face
.
orm
.
mapper
.
tdengine
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.tdeingine.HYGFJPDayPower
;
public
interface
HYGFJPDayPowerMapper
extends
BaseMapper
<
HYGFJPDayPower
>
{
}
amos-boot-data/amos-boot-data-housepvapi/src/main/java/com/yeejoin/amos/api/householdapi/face/service/impl/GoLangDataAcquisitionServiceImpl.java
View file @
7b2de331
...
...
@@ -2,6 +2,7 @@ package com.yeejoin.amos.api.householdapi.face.service.impl;
import
cn.hutool.core.date.DateTime
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.yeejoin.amos.api.householdapi.Utils.GolangRequestUtil
;
import
com.yeejoin.amos.api.householdapi.constant.GoLangConstant
;
...
...
@@ -21,6 +22,7 @@ import com.yeejoin.amos.api.householdapi.face.service.GoLangDataAcquisitionServi
import
com.yeejoin.amos.api.householdapi.face.orm.mapper.hygf.JpStationMapper
;
import
com.yeejoin.amos.openapi.enums.PVProducerInfoEnum
;
import
fastjson.JSON
;
import
org.bouncycastle.crypto.engines.AESLightEngine
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.scheduling.annotation.Scheduled
;
...
...
@@ -38,6 +40,7 @@ import java.util.concurrent.TimeUnit;
@Service
public
class
GoLangDataAcquisitionServiceImpl
implements
GoLangDataAcquisitionService
{
private
final
String
dataRequstScheduled
=
"0 0/10 * * * *"
;
private
final
String
stationPowerScheduled
=
"0 0 * * * *"
;
@Autowired
private
GolangRequestUtil
golangRequestUtil
;
@Autowired
...
...
@@ -68,9 +71,10 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe
private
HYGFJPInverterWarnMapper
hygfjpInverterWarnMapper
;
@Autowired
private
HYGFJPInverterElecHistoryMapper
hygfjpInverterElecHistoryMapper
;
@Autowired
private
HYGFJPDayPowerMapper
hygfjpDayPowerMapper
;
@Scheduled
(
cron
=
dataRequstScheduled
)
@Scheduled
(
cron
=
dataRequstScheduled
)
@Override
public
void
stationList
()
{
HashMap
<
String
,
Object
>
requestInfo
=
new
HashMap
<>();
...
...
@@ -89,10 +93,13 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe
golangStationMapper
.
insert
(
golangStationList
);
}
}
@Scheduled
(
cron
=
dataRequstScheduled
)
@Scheduled
(
cron
=
dataRequstScheduled
)
@Override
public
void
stationDetail
()
{
List
<
String
>
stationIds
=
golangStationMapper
.
getStationIds
();
String
today
=
DateUtil
.
today
();
String
hour
=
new
Date
().
getHours
()
+
":00"
;
for
(
int
i
=
0
;
i
<
stationIds
.
size
();
i
++)
{
try
{
TimeUnit
.
SECONDS
.
sleep
(
1
);
...
...
@@ -127,7 +134,7 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe
jpStation
.
setLatitude
(
golangStationDetail
.
getLatitude
());
jpStation
.
setUserName
(
golangStationDetail
.
getUsername
());
jpStation
.
setUserPhone
(
String
.
valueOf
(
golangStationDetail
.
getUsermobile
()));
jpStation
.
setStationContact
(
Str
ing
.
valueOf
(
golangStationDetail
.
getMobile
()
));
jpStation
.
setStationContact
(
Str
Util
.
nullToDefault
(
String
.
valueOf
(
golangStationDetail
.
getMobile
()),
""
));
jpStation
.
setModuleCount
(
Math
.
toIntExact
(
golangStationDetail
.
getModule
()));
//并网类型
jpStation
.
setOnGridType
(
GoLangConstant
.
stationStaus
.
get
(
String
.
valueOf
(
golangStationDetail
.
getState
())));
...
...
@@ -149,18 +156,37 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe
jpStationMapper
.
insert
(
jpStation
);
}
HYGFJPStationPowerHistory
hygfjpStationPowerHistory
=
new
HYGFJPStationPowerHistory
();
hygfjpStationPowerHistory
=
new
HYGFJPStationPowerHistory
();
hygfjpStationPowerHistory
.
setCreatedTime
(
System
.
currentTimeMillis
());
hygfjpStationPowerHistory
.
setThirdStationId
(
jpStation
.
getThirdStationId
());
hygfjpStationPowerHistory
.
setPower
(
jpStation
.
getRealTimePower
());
hygfjpStationPowerHistory
.
setThirdCode
(
jpStation
.
getThirdCode
());
hygfjpStationPowerHistory
.
setTime
(
System
.
currentTimeMillis
());
golangStationDetailMapper
.
updateById
(
golangStationDetail
);
hygfjpStationPowerHistoryMapper
.
insert
(
hygfjpStationPowerHistory
);
HYGFJPDayPower
hygfjpDayPower
=
hygfjpDayPowerMapper
.
selectOne
(
new
QueryWrapper
<
HYGFJPDayPower
>().
eq
(
"tation_id"
,
String
.
valueOf
(
golangStationDetail
.
getId
())).
eq
(
"year_month_day"
,
today
).
eq
(
"hour"
,
hour
)
);
if
(
ObjectUtils
.
isEmpty
(
hygfjpDayPower
))
{
hygfjpDayPower
=
new
HYGFJPDayPower
();
}
hygfjpDayPower
=
new
HYGFJPDayPower
();
hygfjpDayPower
.
setTationId
(
String
.
valueOf
(
golangStationDetail
.
getId
()));
hygfjpDayPower
.
setHour
(
hour
);
hygfjpDayPower
.
setYearMonthDay
(
today
);
hygfjpDayPower
.
setPower
(
golangStationDetail
.
getPower
());
if
(
ObjectUtils
.
isEmpty
(
hygfjpDayPower
.
getCreatedTime
()))
{
hygfjpDayPower
.
setCreatedTime
(
System
.
currentTimeMillis
());
hygfjpDayPowerMapper
.
insert
(
hygfjpDayPower
);
}
else
{
hygfjpDayPowerMapper
.
insert
(
hygfjpDayPower
);
}
}
}
}
@Scheduled
(
cron
=
dataRequstScheduled
)
@Scheduled
(
cron
=
dataRequstScheduled
)
@Override
public
void
collectorList
()
{
List
<
String
>
stationIds
=
golangStationMapper
.
getStationIds
();
...
...
@@ -188,7 +214,8 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe
}
}
}
@Scheduled
(
cron
=
dataRequstScheduled
)
@Scheduled
(
cron
=
dataRequstScheduled
)
@Override
public
void
collectorDetail
()
{
List
<
Long
>
collectorIds
=
golangCollectorListMapper
.
getCollectIds
();
...
...
@@ -255,7 +282,8 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe
}
}
}
@Scheduled
(
cron
=
dataRequstScheduled
)
@Scheduled
(
cron
=
dataRequstScheduled
)
@Override
public
void
inverterList
()
{
List
<
String
>
stationIds
=
golangStationMapper
.
getStationIds
();
...
...
@@ -283,7 +311,8 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe
}
}
}
@Scheduled
(
cron
=
dataRequstScheduled
)
@Scheduled
(
cron
=
dataRequstScheduled
)
@Override
public
void
inverterDetail
()
{
List
<
Long
>
inverterIds
=
golangInverterListMapper
.
getInverterIds
();
...
...
@@ -418,7 +447,8 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe
}
}
}
@Scheduled
(
cron
=
dataRequstScheduled
)
@Scheduled
(
cron
=
dataRequstScheduled
)
@Override
public
void
inverAlramInfo
()
{
List
<
String
>
inverterIds
=
golangInverterListMapper
.
getInverterSns
();
...
...
@@ -443,12 +473,19 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe
);
for
(
int
j
=
0
;
j
<
result
.
size
();
j
++)
{
AlarmDto
alarmDto
=
result
.
get
(
j
);
HYGFJPInverterWarn
hygfjpInverterWarn
=
new
HYGFJPInverterWarn
();
hygfjpInverterWarn
.
setCreatedTime
(
System
.
currentTimeMillis
());
if
(!
ObjectUtils
.
isEmpty
(
alarmDto
.
getAlarmDeviceSn
()))
{
HYGFJPInverterWarn
hygfjpInverterWarn
=
hygfjpInverterWarnMapper
.
selectOne
(
new
QueryWrapper
<
HYGFJPInverterWarn
>()
.
eq
(
"sn_code"
,
alarmDto
.
getAlarmDeviceSn
())
.
eq
(
"start_time"
,
alarmDto
.
getAlarmBeginTime
())
.
eq
(
"third_station_id"
,
String
.
valueOf
(
alarmDto
.
getStationId
()))
);
if
(
ObjectUtils
.
isEmpty
(
hygfjpInverterWarn
))
{
hygfjpInverterWarn
=
new
HYGFJPInverterWarn
();
}
hygfjpInverterWarn
.
setTime
(
System
.
currentTimeMillis
());
hygfjpInverterWarn
.
setTimeLong
(
System
.
currentTimeMillis
());
hygfjpInverterWarn
.
setSnCode
(
alarmDto
.
getAlarmDeviceSn
());
hygfjpInverterWarn
.
setThirdCode
(
String
.
valueOf
(
alarmDto
.
getStationId
()));
hygfjpInverterWarn
.
setThirdStationId
(
String
.
valueOf
(
alarmDto
.
getStationId
()));
hygfjpInverterWarn
.
setLevel
(
GoLangConstant
.
alarmLevel
.
get
(
alarmDto
.
getAlarmLevel
()));
hygfjpInverterWarn
.
setContent
(
alarmDto
.
getAlarmMsg
());
hygfjpInverterWarn
.
setThirdCode
(
PVProducerInfoEnum
.
JLY
.
getCode
());
...
...
@@ -456,9 +493,15 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe
hygfjpInverterWarn
.
setStartTime
(
alarmDto
.
getAlarmBeginTime
());
hygfjpInverterWarn
.
setRecoverTime
(
alarmDto
.
getAlarmEndTime
());
hygfjpInverterWarn
.
setState
(
GoLangConstant
.
alarmstatus
.
get
(
alarmDto
.
getState
()));
if
(
ObjectUtils
.
isEmpty
(
hygfjpInverterWarn
.
getCreatedTime
()))
{
hygfjpInverterWarn
.
setCreatedTime
(
System
.
currentTimeMillis
());
hygfjpInverterWarnMapper
.
insert
(
hygfjpInverterWarn
);
}
else
{
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