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
2fe5a287
Commit
2fe5a287
authored
Oct 10, 2023
by
chenzhao
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
39f897c0
1e13a0e8
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
27 deletions
+16
-27
PersonYardMessage.java
...in/amos/boot/module/jxiop/biz/emqx/PersonYardMessage.java
+0
-13
StationYardMessage.java
...n/amos/boot/module/jxiop/biz/emqx/StationYardMessage.java
+3
-8
MonitoringServiceImpl.java
.../module/jxiop/biz/service/impl/MonitoringServiceImpl.java
+13
-6
No files found.
amos-boot-system-jxiop/amos-boot-module-jxiop-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/emqx/PersonYardMessage.java
View file @
2fe5a287
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
emqx
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.ObjectUtils
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
com.yeejoin.amos.boot.module.jxiop.api.entity.PersonBasic
;
import
com.yeejoin.amos.boot.module.jxiop.api.mapper.PersonBasicMapper
;
import
com.yeejoin.amos.boot.module.jxiop.api.mapper.StationBasicMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.service.impl.PersonBasicServiceImpl
;
import
com.yeejoin.amos.component.robot.AmosRequestContext
;
import
lombok.extern.slf4j.Slf4j
;
import
org.eclipse.paho.client.mqttv3.MqttException
;
import
org.eclipse.paho.client.mqttv3.MqttMessage
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
import
org.springframework.stereotype.Component
;
import
org.typroject.tyboot.component.emq.EmqKeeper
;
import
org.typroject.tyboot.component.emq.EmqxListener
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
javax.annotation.PostConstruct
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.concurrent.BlockingQueue
;
import
java.util.concurrent.LinkedBlockingQueue
;
@Component
@EnableScheduling
@Slf4j
public
class
PersonYardMessage
extends
EmqxListener
{
@Autowired
private
AmosRequestContext
amosAuth
;
@Autowired
protected
EmqKeeper
emqKeeper
;
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/emqx/StationYardMessage.java
View file @
2fe5a287
...
...
@@ -3,15 +3,11 @@ package com.yeejoin.amos.boot.module.jxiop.biz.emqx;
import
com.alibaba.fastjson.JSONArray
;
import
com.yeejoin.amos.boot.module.jxiop.api.mapper.StationBasicMapper
;
import
lombok.extern.slf4j.Slf4j
;
import
com.yeejoin.amos.component.robot.AmosRequestContext
;
import
org.eclipse.paho.client.mqttv3.MqttMessage
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
import
org.springframework.stereotype.Component
;
import
org.typroject.tyboot.component.emq.EmqKeeper
;
import
org.typroject.tyboot.component.emq.EmqxListener
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
javax.annotation.PostConstruct
;
import
java.util.List
;
...
...
@@ -20,12 +16,9 @@ import java.util.concurrent.BlockingQueue;
import
java.util.concurrent.LinkedBlockingQueue
;
@Component
@EnableScheduling
@Slf4j
public
class
StationYardMessage
extends
EmqxListener
{
@Autowired
private
AmosRequestContext
amosAuth
;
@Autowired
protected
EmqKeeper
emqKeeper
;
...
...
@@ -34,7 +27,9 @@ public class StationYardMessage extends EmqxListener {
private
StationBasicMapper
stationBasicMapper
;
// 江西电建接收红黄绿码主题
/**
* 江西电建接收红黄绿码主题
*/
private
static
final
String
JXIOP_STATION_YARD
=
"jxIop/station/yard"
;
private
static
final
BlockingQueue
<
List
<
Map
<
String
,
String
>>>
blockingQueue
=
new
LinkedBlockingQueue
<
List
<
Map
<
String
,
String
>>>();
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/MonitoringServiceImpl.java
View file @
2fe5a287
...
...
@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.jxiop.biz.service.impl;
import
cn.hutool.core.date.DateUnit
;
import
cn.hutool.core.date.DateUtil
;
import
com.alibaba.druid.sql.visitor.functions.If
;
import
com.alibaba.fastjson.JSON
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
...
...
@@ -69,7 +70,7 @@ public class MonitoringServiceImpl {
@Autowired
EmqKeeper
emqKeeper
;
// @Autowired
// @Autowired
// InfluxdbUtil influxdbUtil;
@Autowired
IndicatorDataMapper
indicatorDataMapper
;
...
...
@@ -257,7 +258,7 @@ public class MonitoringServiceImpl {
List
<
ESEquipments
>
result
=
commonServiceImpl
.
getListDataByCondtions
(
queryCondtion
,
null
,
ESEquipments
.
class
,
null
);
List
<
ESEquipments
>
result1
=
commonServiceImpl
.
getListDataByCondtions
(
queryCondtion1
,
null
,
ESEquipments
.
class
);
completionOfPowerIndicatorsDto
.
setWindSpeedOrIrradiance
(
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
commonServiceImpl
.
getSumByEquipmentIndxName
(
result1
,
"WTX-801_25_WTX-801_总辐射"
)));
completionOfPowerIndicatorsDto
.
setActivePower
(
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
commonServiceImpl
.
getSumByEquipmentIndxName
(
result1
,
"南瑞光差保护_313P"
)
*
CommonConstans
.
kwToMv
));
completionOfPowerIndicatorsDto
.
setActivePower
(
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
commonServiceImpl
.
getSumByEquipmentIndxName
(
result1
,
"南瑞光差保护_313P"
)
*
CommonConstans
.
kwToMv
));
completionOfPowerIndicatorsDto
.
setDailyPower
(
String
.
format
(
CommonConstans
.
Fourdecimalplaces
,
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
CommonConstans
.
taiHeGenIndicatorDay
)));
completionOfPowerIndicatorsDto
.
setMonthlyPower
(
String
.
format
(
CommonConstans
.
Fourdecimalplaces
,
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
CommonConstans
.
taiHeGenIndicatorMonth
)));
completionOfPowerIndicatorsDto
.
setAnnualPower
(
String
.
format
(
CommonConstans
.
Fourdecimalplaces
,
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
CommonConstans
.
taiHeGenIndicatorYear
)));
...
...
@@ -691,6 +692,12 @@ public class MonitoringServiceImpl {
public
Page
<
HashMap
<
String
,
String
>>
getDetailsOnPowergeneration
(
String
areaName
)
{
Page
<
HashMap
<
String
,
String
>>
hashMapPage
=
new
Page
<>(
1
,
99
);
List
<
HashMap
<
String
,
String
>>
hashMapList
=
new
ArrayList
<>();
List
<
StationCacheInfoDto
>
stationCacheInfoDtoList
=
new
ArrayList
<>();
stationCacheInfoDtoList
=
commonServiceImpl
.
getListStationCacheInfoDto
();
if
(!
ObjectUtils
.
isEmpty
(
areaName
))
{
stationCacheInfoDtoList
=
stationCacheInfoDtoList
.
stream
().
filter
(
stationCacheInfoDto
->
stationCacheInfoDto
.
getBelongArea
().
equals
(
areaName
)).
collect
(
Collectors
.
toList
());
}
List
<
StationBasic
>
stationBasicList
=
stationBasicMapper
.
selectList
(
new
QueryWrapper
<
StationBasic
>().
isNotNull
(
"fan_gateway_id"
));
//日发电量
AtomicReference
<
Double
>
dailyPower
=
new
AtomicReference
<>(
0.0
);
...
...
@@ -698,11 +705,11 @@ public class MonitoringServiceImpl {
AtomicReference
<
Double
>
monthlyPower
=
new
AtomicReference
<>(
0.0
);
//年发电量
AtomicReference
<
Double
>
annualPower
=
new
AtomicReference
<>(
0.0
);
station
BasicList
.
forEach
(
stationBasic
->
{
if
(
"FDZ"
.
equals
(
station
Basic
.
getStationType
()))
{
station
CacheInfoDtoList
.
forEach
(
stationCacheInfoDto
->
{
if
(
"FDZ"
.
equals
(
station
CacheInfoDto
.
getStationType
()))
{
Map
<
String
,
List
<
String
>>
queryCondtion
=
new
HashMap
<>();
queryCondtion
.
put
(
CommonConstans
.
QueryStringEquipmentIndexName
,
Arrays
.
asList
(
"日发电量"
,
"月发电量"
,
"年发电量"
));
queryCondtion
.
put
(
CommonConstans
.
QueryStringGateWayId
,
Arrays
.
asList
(
station
Basic
.
getFanGatewayId
()));
queryCondtion
.
put
(
CommonConstans
.
QueryStringGateWayId
,
Arrays
.
asList
(
station
CacheInfoDto
.
getFanGatewayId
()));
List
<
ESEquipments
>
result
=
commonServiceImpl
.
getListDataByCondtions
(
queryCondtion
,
null
,
ESEquipments
.
class
);
dailyPower
.
updateAndGet
(
v
->
v
+
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"日发电量"
)));
monthlyPower
.
updateAndGet
(
v
->
v
+
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"月发电量"
)));
...
...
@@ -710,7 +717,7 @@ public class MonitoringServiceImpl {
}
else
{
Map
<
String
,
List
<
String
>>
queryCondtion
=
new
HashMap
<>();
queryCondtion
.
put
(
CommonConstans
.
QueryStringEquipmentIndexName
,
CommonConstans
.
taiHeGenIndicator
);
queryCondtion
.
put
(
CommonConstans
.
QueryStringGateWayId
,
Arrays
.
asList
(
station
Basic
.
getBoosterGatewayId
()));
queryCondtion
.
put
(
CommonConstans
.
QueryStringGateWayId
,
Arrays
.
asList
(
station
CacheInfoDto
.
getBoosterGatewayId
()));
List
<
ESEquipments
>
result
=
commonServiceImpl
.
getListDataByCondtions
(
queryCondtion
,
null
,
ESEquipments
.
class
);
dailyPower
.
updateAndGet
(
v
->
v
+
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
CommonConstans
.
taiHeGenIndicatorDay
)));
monthlyPower
.
updateAndGet
(
v
->
v
+
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
CommonConstans
.
taiHeGenIndicatorMonth
)));
...
...
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