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
a0d77385
Commit
a0d77385
authored
Aug 10, 2023
by
tangwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增定时获取发电量参数
parent
3a7d9421
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
290 additions
and
16 deletions
+290
-16
ESDailyPowerGeneration.java
...s/boot/module/jxiop/biz/ESDto/ESDailyPowerGeneration.java
+47
-8
ESMoonPowerGeneration.java
...os/boot/module/jxiop/biz/ESDto/ESMoonPowerGeneration.java
+53
-2
ESYearPowerGeneration.java
...os/boot/module/jxiop/biz/ESDto/ESYearPowerGeneration.java
+52
-2
ESDailyPowerGenerationRepository.java
...xiop/biz/repository/ESDailyPowerGenerationRepository.java
+15
-0
ESMoonPowerGenerationRepository.java
...jxiop/biz/repository/ESMoonPowerGenerationRepository.java
+15
-0
ESYearPowerGenerationRepository.java
...jxiop/biz/repository/ESYearPowerGenerationRepository.java
+16
-0
PowerGeneration.java
...amos/boot/module/jxiop/biz/scheduled/PowerGeneration.java
+74
-1
application-dev.properties
...monitor-biz/src/main/resources/application-dev.properties
+18
-3
No files found.
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/ESDto/ESDailyPowerGeneration.java
View file @
a0d77385
...
...
@@ -19,19 +19,58 @@ import java.util.Date;
@Data
@Accessors
(
chain
=
true
)
@Document
(
indexName
=
"jxiop_dailyPowerGeneration"
)
public
class
ESDailyPowerGeneration
extends
ESEquipments
{
public
class
ESDailyPowerGeneration
{
@Id
private
String
id
;
@Field
(
type
=
FieldType
.
Keyword
)
private
String
stationType
;
//场站类型
private
String
stationId
;
//场站名称
@Field
(
type
=
FieldType
.
Text
)
private
String
stationName
;
//场站类型
@Field
(
type
=
FieldType
.
Text
)
private
String
stationType
;
//所属省份
@Field
(
type
=
FieldType
.
Text
)
private
String
belongProvince
;
//所属片区
@Field
(
type
=
FieldType
.
Text
)
private
String
belongArea
;
@Field
(
type
=
FieldType
.
Keyword
)
private
String
day
;
//时间标识
@Field
(
type
=
FieldType
.
Keyword
)
private
String
gatewayId
;
@Field
(
type
=
FieldType
.
Date
,
format
=
DateFormat
.
basic_date_time
,
index
=
false
)
private
Date
createdTime
;
@Field
(
type
=
FieldType
.
Double
,
index
=
false
)
private
Double
value
;
@Field
(
type
=
FieldType
.
Keyword
)
private
String
equipmentIndexName
;
@Field
(
type
=
FieldType
.
Keyword
)
private
String
equipmentNumber
;
@Field
(
type
=
FieldType
.
Text
,
index
=
false
)
private
String
address
;
public
ESDailyPowerGeneration
(
String
id
,
String
stationId
,
String
stationName
,
String
stationType
,
String
belongProvince
,
String
belongArea
,
String
day
,
String
gatewayId
,
Date
createdTime
,
Double
value
,
String
equipmentIndexName
,
String
equipmentNumber
,
String
address
)
{
this
.
id
=
id
;
this
.
stationId
=
stationId
;
this
.
stationName
=
stationName
;
this
.
stationType
=
stationType
;
this
.
belongProvince
=
belongProvince
;
this
.
belongArea
=
belongArea
;
this
.
day
=
day
;
this
.
gatewayId
=
gatewayId
;
this
.
createdTime
=
createdTime
;
this
.
value
=
value
;
this
.
equipmentIndexName
=
equipmentIndexName
;
this
.
equipmentNumber
=
equipmentNumber
;
this
.
address
=
address
;
}
public
ESDailyPowerGeneration
()
{
}
}
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/ESDto/ESMoonPowerGeneration.java
View file @
a0d77385
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
ESDto
;
import
io.github.classgraph.json.Id
;
import
lombok.Data
;
import
lombok.experimental.Accessors
;
import
org.springframework.data.elasticsearch.annotations.DateFormat
;
import
org.springframework.data.elasticsearch.annotations.Document
;
import
org.springframework.data.elasticsearch.annotations.Field
;
import
org.springframework.data.elasticsearch.annotations.FieldType
;
import
java.util.Date
;
/**
* @description:
* @author: tw
...
...
@@ -14,12 +18,59 @@ import org.springframework.data.elasticsearch.annotations.FieldType;
@Data
@Accessors
(
chain
=
true
)
@Document
(
indexName
=
"jxiop_moonPowerGeneration"
)
public
class
ESMoonPowerGeneration
extends
ESEquipments
{
public
class
ESMoonPowerGeneration
{
@Id
private
String
id
;
@Field
(
type
=
FieldType
.
Keyword
)
private
String
stationType
;
//场站类型
private
String
stationId
;
//场站名称
@Field
(
type
=
FieldType
.
Text
)
private
String
stationName
;
//场站类型
@Field
(
type
=
FieldType
.
Text
)
private
String
stationType
;
//所属省份
@Field
(
type
=
FieldType
.
Text
)
private
String
belongProvince
;
//所属片区
@Field
(
type
=
FieldType
.
Text
)
private
String
belongArea
;
@Field
(
type
=
FieldType
.
Keyword
)
private
String
day
;
//时间标识
@Field
(
type
=
FieldType
.
Keyword
)
private
String
gatewayId
;
@Field
(
type
=
FieldType
.
Date
,
format
=
DateFormat
.
basic_date_time
,
index
=
false
)
private
Date
createdTime
;
@Field
(
type
=
FieldType
.
Double
,
index
=
false
)
private
Double
value
;
@Field
(
type
=
FieldType
.
Keyword
)
private
String
equipmentIndexName
;
@Field
(
type
=
FieldType
.
Keyword
)
private
String
equipmentNumber
;
@Field
(
type
=
FieldType
.
Text
,
index
=
false
)
private
String
address
;
public
ESMoonPowerGeneration
(
String
id
,
String
stationId
,
String
stationName
,
String
stationType
,
String
belongProvince
,
String
belongArea
,
String
day
,
String
gatewayId
,
Date
createdTime
,
Double
value
,
String
equipmentIndexName
,
String
equipmentNumber
,
String
address
)
{
this
.
id
=
id
;
this
.
stationId
=
stationId
;
this
.
stationName
=
stationName
;
this
.
stationType
=
stationType
;
this
.
belongProvince
=
belongProvince
;
this
.
belongArea
=
belongArea
;
this
.
day
=
day
;
this
.
gatewayId
=
gatewayId
;
this
.
createdTime
=
createdTime
;
this
.
value
=
value
;
this
.
equipmentIndexName
=
equipmentIndexName
;
this
.
equipmentNumber
=
equipmentNumber
;
this
.
address
=
address
;
}
public
ESMoonPowerGeneration
()
{
}
}
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/ESDto/ESYearPowerGeneration.java
View file @
a0d77385
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
ESDto
;
import
io.github.classgraph.json.Id
;
import
lombok.Data
;
import
lombok.experimental.Accessors
;
import
org.springframework.data.elasticsearch.annotations.DateFormat
;
import
org.springframework.data.elasticsearch.annotations.Document
;
import
org.springframework.data.elasticsearch.annotations.Field
;
import
org.springframework.data.elasticsearch.annotations.FieldType
;
import
java.util.Date
;
/**
* @description:
* @author: tw
...
...
@@ -15,12 +19,58 @@ import org.springframework.data.elasticsearch.annotations.FieldType;
@Data
@Accessors
(
chain
=
true
)
@Document
(
indexName
=
"jxiop_yearPowerGeneration"
)
public
class
ESYearPowerGeneration
extends
ESEquipments
{
public
class
ESYearPowerGeneration
{
@Id
private
String
id
;
@Field
(
type
=
FieldType
.
Keyword
)
private
String
stationType
;
//场站类型
private
String
stationId
;
//场站名称
@Field
(
type
=
FieldType
.
Text
)
private
String
stationName
;
//场站类型
@Field
(
type
=
FieldType
.
Text
)
private
String
stationType
;
//所属省份
@Field
(
type
=
FieldType
.
Text
)
private
String
belongProvince
;
//所属片区
@Field
(
type
=
FieldType
.
Text
)
private
String
belongArea
;
@Field
(
type
=
FieldType
.
Keyword
)
private
String
day
;
//时间标识
@Field
(
type
=
FieldType
.
Keyword
)
private
String
gatewayId
;
@Field
(
type
=
FieldType
.
Date
,
format
=
DateFormat
.
basic_date_time
,
index
=
false
)
private
Date
createdTime
;
@Field
(
type
=
FieldType
.
Double
,
index
=
false
)
private
Double
value
;
@Field
(
type
=
FieldType
.
Keyword
)
private
String
equipmentIndexName
;
@Field
(
type
=
FieldType
.
Keyword
)
private
String
equipmentNumber
;
@Field
(
type
=
FieldType
.
Text
,
index
=
false
)
private
String
address
;
public
ESYearPowerGeneration
(
String
id
,
String
stationId
,
String
stationName
,
String
stationType
,
String
belongProvince
,
String
belongArea
,
String
day
,
String
gatewayId
,
Date
createdTime
,
Double
value
,
String
equipmentIndexName
,
String
equipmentNumber
,
String
address
)
{
this
.
id
=
id
;
this
.
stationId
=
stationId
;
this
.
stationName
=
stationName
;
this
.
stationType
=
stationType
;
this
.
belongProvince
=
belongProvince
;
this
.
belongArea
=
belongArea
;
this
.
day
=
day
;
this
.
gatewayId
=
gatewayId
;
this
.
createdTime
=
createdTime
;
this
.
value
=
value
;
this
.
equipmentIndexName
=
equipmentIndexName
;
this
.
equipmentNumber
=
equipmentNumber
;
this
.
address
=
address
;
}
public
ESYearPowerGeneration
()
{
}
}
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/repository/ESDailyPowerGenerationRepository.java
0 → 100644
View file @
a0d77385
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
repository
;
import
com.yeejoin.amos.boot.module.jxiop.biz.ESDto.ESDailyPowerGeneration
;
import
org.springframework.data.repository.PagingAndSortingRepository
;
import
org.springframework.stereotype.Repository
;
/**
* @description:
* @author: tw
* @createDate: 2023/8/9
*/
@Repository
public
interface
ESDailyPowerGenerationRepository
extends
PagingAndSortingRepository
<
ESDailyPowerGeneration
,
String
>
{
}
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/repository/ESMoonPowerGenerationRepository.java
0 → 100644
View file @
a0d77385
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
repository
;
import
com.yeejoin.amos.boot.module.jxiop.biz.ESDto.ESDailyPowerGeneration
;
import
com.yeejoin.amos.boot.module.jxiop.biz.ESDto.ESMoonPowerGeneration
;
import
org.springframework.data.repository.PagingAndSortingRepository
;
import
org.springframework.stereotype.Repository
;
/**
* @description:
* @author: tw
* @createDate: 2023/8/9
*/
@Repository
public
interface
ESMoonPowerGenerationRepository
extends
PagingAndSortingRepository
<
ESMoonPowerGeneration
,
String
>
{
}
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/repository/ESYearPowerGenerationRepository.java
0 → 100644
View file @
a0d77385
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
repository
;
import
com.yeejoin.amos.boot.module.jxiop.biz.ESDto.ESDailyPowerGeneration
;
import
com.yeejoin.amos.boot.module.jxiop.biz.ESDto.ESYearPowerGeneration
;
import
org.springframework.data.repository.PagingAndSortingRepository
;
import
org.springframework.stereotype.Repository
;
/**
* @description:
* @author: tw
* @createDate: 2023/8/9
*/
@Repository
public
interface
ESYearPowerGenerationRepository
extends
PagingAndSortingRepository
<
ESYearPowerGeneration
,
String
>
{
}
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/scheduled/PowerGeneration.java
View file @
a0d77385
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
scheduled
;
import
com.yeejoin.amos.boot.module.jxiop.biz.ESDto.ESDailyPowerGeneration
;
import
com.yeejoin.amos.boot.module.jxiop.biz.ESDto.ESMoonPowerGeneration
;
import
com.yeejoin.amos.boot.module.jxiop.biz.dto.StationCacheInfoDto
;
import
com.yeejoin.amos.boot.module.jxiop.biz.service.impl.PowerGenerationImpl
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.stereotype.Component
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* @description:
* @author: tw
* @createDate: 2023/8/9
*/
@Component
@EnableScheduling
public
class
PowerGeneration
{
@Autowired
PowerGenerationImpl
powerGenerationImpl
;
private
final
String
dayvalue
=
"日发电量"
;
private
final
String
moonValue
=
"月发电量"
;
private
final
String
yearValue
=
"年发电量"
;
private
final
String
dayDateFormat
=
"YYYY-MM-DD"
;
private
final
String
moonDateFormat
=
"YYYY-MM"
;
private
final
String
yearDateFormat
=
"YYYY"
;
private
final
String
dayType
=
"day"
;
private
final
String
moonType
=
"moon"
;
private
final
String
yearType
=
"year"
;
//定时更新日发电量
@Scheduled
(
cron
=
"${daily.power.generation.cron}"
)
public
void
addESDailyPowerGeneration
(){
List
<
StationCacheInfoDto
>
list
=
new
ArrayList
<>();
for
(
StationCacheInfoDto
stationCacheInfoDto
:
list
)
{
//风机
powerGenerationImpl
.
addPowerGeneration
(
stationCacheInfoDto
,
stationCacheInfoDto
.
getFanGatewayId
(),
dayvalue
,
dayDateFormat
,
dayType
);
//光伏
powerGenerationImpl
.
addPowerGeneration
(
stationCacheInfoDto
,
stationCacheInfoDto
.
getBoosterGatewayId
(),
dayvalue
,
dayDateFormat
,
dayType
);
}
}
//定时更新月发电量
@Scheduled
(
cron
=
"${moon.power.generation.cron}"
)
public
void
addESMoonPowerGeneration
(){
List
<
StationCacheInfoDto
>
list
=
new
ArrayList
<>();
for
(
StationCacheInfoDto
stationCacheInfoDto
:
list
)
{
//风机
powerGenerationImpl
.
addPowerGeneration
(
stationCacheInfoDto
,
stationCacheInfoDto
.
getFanGatewayId
(),
moonValue
,
moonDateFormat
,
moonType
);
//光伏
powerGenerationImpl
.
addPowerGeneration
(
stationCacheInfoDto
,
stationCacheInfoDto
.
getBoosterGatewayId
(),
moonValue
,
moonDateFormat
,
moonType
);
}
}
//定时更新年发电量
@Scheduled
(
cron
=
"${year.power.generation.cron}"
)
public
void
addESYearPowerGeneration
(){
List
<
StationCacheInfoDto
>
list
=
new
ArrayList
<>();
for
(
StationCacheInfoDto
stationCacheInfoDto
:
list
)
{
//风机
powerGenerationImpl
.
addPowerGeneration
(
stationCacheInfoDto
,
stationCacheInfoDto
.
getFanGatewayId
(),
yearValue
,
yearDateFormat
,
yearType
);
//光伏
powerGenerationImpl
.
addPowerGeneration
(
stationCacheInfoDto
,
stationCacheInfoDto
.
getBoosterGatewayId
(),
yearValue
,
yearDateFormat
,
yearType
);
}
}
}
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/resources/application-dev.properties
View file @
a0d77385
## DB properties:
## db1-production database
spring.db1.datasource.type
:
com.alibaba.druid.pool.DruidDataSource
spring.db1.datasource.url
=
jdbc:mysql://
139.9.173.44
:3306/production?allowMultiQueries=true&serverTimezone=GMT%2B8&characterEncoding=utf8
spring.db1.datasource.url
=
jdbc:mysql://
39.98.224.23
:3306/production?allowMultiQueries=true&serverTimezone=GMT%2B8&characterEncoding=utf8
spring.db1.datasource.username
=
root
spring.db1.datasource.password
=
Yeejoin@2020
spring.db1.datasource.driver-class-name
:
com.mysql.cj.jdbc.Driver
## db2-sync_data
spring.db2.datasource.type
:
com.alibaba.druid.pool.DruidDataSource
spring.db2.datasource.url
=
jdbc:mysql://
139.9.173.44
:3306/jxiop_sync_data?allowMultiQueries=true&serverTimezone=GMT%2B8&characterEncoding=utf8
spring.db2.datasource.url
=
jdbc:mysql://
39.98.224.23
:3306/jxiop_sync_data?allowMultiQueries=true&serverTimezone=GMT%2B8&characterEncoding=utf8
spring.db2.datasource.username
=
root
spring.db2.datasource.password
=
Yeejoin@2020
spring.db2.datasource.driver-class-name
:
com.mysql.cj.jdbc.Driver
...
...
@@ -84,7 +84,7 @@ emqx.max-inflight=1000
#spring.influx.bufferLimit=20000
spring.influx.url
=
http://
139.9.173.44:1
8086
spring.influx.url
=
http://
39.98.224.23:
8086
spring.influx.password
=
Yeejoin@2020
spring.influx.user
=
root
spring.influx.database
=
iot_platform
...
...
@@ -124,3 +124,18 @@ myqueue=amos.privilege.v1.JXIOP.AQSC_FDGL.userBusiness
fan.statuts.stattuspath
=
upload/jxiop/device_status
pictureUrl
=
upload/jxiop/syz/
daily.power.generation.cron
=
* * */10 * * ?
moon.power.generation.cron
=
* * */10 * * ?
year.power.generation.cron
=
* * */10 * * ?
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