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
21bcda80
Commit
21bcda80
authored
Sep 06, 2023
by
chenzhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改代码
parent
d9577110
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
52 additions
and
24 deletions
+52
-24
MonitorFanIdxController.java
.../module/jxiop/biz/controller/MonitorFanIdxController.java
+2
-3
TemporaryDataMapper.java
...os/boot/module/jxiop/biz/mapper2/TemporaryDataMapper.java
+1
-1
MonitorFanIndicatorImpl.java
...odule/jxiop/biz/service/impl/MonitorFanIndicatorImpl.java
+37
-12
TemporaryDataMapper.xml
...src/main/resources/mapper/cluster/TemporaryDataMapper.xml
+4
-2
MonitorFanIndicatorImpl.java
...odule/jxiop/biz/service/impl/MonitorFanIndicatorImpl.java
+8
-6
No files found.
amos-boot-system-jxiop/amos-boot-module-jxiop-bigscreen-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/controller/MonitorFanIdxController.java
View file @
21bcda80
...
...
@@ -976,7 +976,6 @@ public class MonitorFanIdxController extends BaseController {
DecimalFormat
format2
=
new
DecimalFormat
(
"#.0000"
);
Double
num
=
0.00
;
if
(
map
.
containsKey
(
"gateWayId"
)&&
map
.
get
(
"gateWayId"
).
size
()
>
0
){
for
(
Terms
.
Bucket
bucket
:
lidate
)
{
Aggregations
aggregation
=
bucket
.
getAggregations
();
List
<
Aggregation
>
listdata
=
Objects
.
nonNull
(
aggregation
)?
aggregation
.
asList
():
null
;
...
...
@@ -985,7 +984,7 @@ public class MonitorFanIdxController extends BaseController {
num
=
Double
.
valueOf
(
format2
.
format
(
parsedSum
.
getValue
()));
}
}
}
return
ResponseHelper
.
buildResponse
(
commonServiceImpl
.
getSocialContributionDtoList
(
num
));
}
...
...
@@ -1160,7 +1159,7 @@ public class MonitorFanIdxController extends BaseController {
map
.
put
(
"total"
,
list
.
size
());
map
.
put
(
"num"
,
sum
);
try
{
emqKeeper
.
getMqttClient
().
publish
(
"/accessSituation/topic/"
+
"s"
,
JSON
.
toJSONString
(
map
).
getBytes
(),
0
,
false
);
emqKeeper
.
getMqttClient
().
publish
(
"/accessSituation/topic/"
+
s
,
JSON
.
toJSONString
(
map
).
getBytes
(),
0
,
false
);
}
catch
(
MqttException
e
)
{
}
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-bigscreen-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/mapper2/TemporaryDataMapper.java
View file @
21bcda80
...
...
@@ -11,7 +11,7 @@ import java.util.Map;
public
interface
TemporaryDataMapper
extends
BaseMapper
<
TemporaryData
>
{
List
<
Map
<
String
,
String
>>
timingTemporarysSorageData
(
@RequestParam
(
value
=
"gatewayId"
)
String
gatewayId
);
List
<
Map
<
String
,
Object
>>
timingTemporarysSorageData
(
@RequestParam
(
value
=
"gatewayId"
)
String
gatewayId
);
Map
<
String
,
Object
>
getStatisticsInfo
(
@RequestParam
(
value
=
"gatewayId"
)
String
gatewayId
,
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-bigscreen-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/MonitorFanIndicatorImpl.java
View file @
21bcda80
...
...
@@ -526,21 +526,40 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
public
Map
<
String
,
Object
>
getDetailsWindSpeedAll
(
String
gatewayId
){
List
<
Map
<
String
,
String
>>
list
=
temporaryDataMapper
.
timingTemporarysSorageData
(
gatewayId
);
List
<
Map
<
String
,
Object
>>
list
=
temporaryDataMapper
.
timingTemporarysSorageData
(
gatewayId
);
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
List
<
String
>
values
=
new
ArrayList
<>();
List
<
String
>
valueList
=
new
ArrayList
<>();
Set
<
String
>
time
=
new
TreeSet
<>();
for
(
Map
<
String
,
String
>
stringStringMap
:
list
)
{
String
v
=
list
.
get
(
0
).
get
(
"value"
).
toString
();
double
min
=
Double
.
parseDouble
(
v
);
double
max
=
Double
.
parseDouble
(
v
);
double
mean
=
0.0
;
String
minTime
=
list
.
get
(
0
).
get
(
"createdTime"
).
toString
();
String
maxTime
=
list
.
get
(
0
).
get
(
"createdTime"
).
toString
();
for
(
Map
<
String
,
Object
>
stringStringMap
:
list
)
{
if
(
stringStringMap
.
get
(
"equipmentIndexName"
).
equals
(
"有功功率"
)){
values
.
add
(
stringStringMap
.
get
(
"value"
));
double
value
=
Double
.
parseDouble
(
stringStringMap
.
get
(
"value"
).
toString
());
values
.
add
(
String
.
format
(
"%.2f"
,
value
));
if
(
value
<
min
){
min
=
value
;
minTime
=
stringStringMap
.
get
(
"createdTime"
).
toString
();
}
else
if
(
value
>
max
){
max
=
value
;
maxTime
=
stringStringMap
.
get
(
"createdTime"
).
toString
();
}
time
.
add
(
stringStringMap
.
get
(
"createdTime"
).
toString
());
}
else
{
valueList
.
add
(
stringStringMap
.
get
(
"value"
));
time
.
add
(
stringStringMap
.
get
(
"createdTime"
));
valueList
.
add
(
stringStringMap
.
get
(
"value"
).
toString
());
}
}
for
(
String
value
:
values
)
{
mean
+=
Double
.
parseDouble
(
value
);
}
mean
=
Double
.
parseDouble
(
String
.
format
(
"%.2f"
,
mean
/
values
.
size
()));
List
<
Map
<
String
,
Object
>>
seriesData
=
new
ArrayList
<>();
Map
<
String
,
Object
>
map3
=
new
HashMap
<>();
Map
<
String
,
Object
>
map1
=
new
HashMap
<>();
...
...
@@ -553,6 +572,11 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
seriesData
.
add
(
map1
);
map
.
put
(
"seriesData"
,
seriesData
);
map
.
put
(
"axisData"
,
time
);
map
.
put
(
"mean"
,
mean
);
map
.
put
(
"max"
,
max
);
map
.
put
(
"min"
,
min
);
map
.
put
(
"maxTime"
,
maxTime
);
map
.
put
(
"minTime"
,
minTime
);
return
map
;
}
...
...
@@ -630,12 +654,13 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
LambdaQueryWrapper
<
StationBasic
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
BaseEntity:
:
getIsDelete
,
false
);
List
<
StationBasic
>
stationBasics
=
stationBasicMapper
.
selectList
(
wrapper
);
long
timeInMillis
=
new
Date
().
getTime
();
for
(
StationBasic
stationBasic
:
stationBasics
)
{
if
(
stationBasic
.
getStationType
().
equals
(
"FDZ"
)){
timingTemporarysSorageData
(
stationBasic
.
getFanGatewayId
());
timingTemporarysSorageData
(
stationBasic
.
getFanGatewayId
()
,
timeInMillis
);
}
if
(
stationBasic
.
getStationType
().
equals
(
"JZSGFDZ"
)){
schedSolarPower
(
stationBasic
.
getBoosterGatewayId
());
schedSolarPower
(
stationBasic
.
getBoosterGatewayId
()
,
timeInMillis
);
}
}
}
...
...
@@ -723,7 +748,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
public
void
timingTemporarysSorageData
(
String
gatewayId
){
public
void
timingTemporarysSorageData
(
String
gatewayId
,
long
timeInMillis
){
String
sql
=
"SELECT * FROM indicators_"
+
gatewayId
+
" WHERE equipmentIndexName = '瞬时风速' "
;
String
sql1
=
"SELECT * FROM indicators_"
+
gatewayId
+
" WHERE equipmentIndexName = '有功功率'"
;
List
<
IndicatorsDto
>
indicatorsDtoList
=
influxDButils
.
getListDataAll
(
sql
,
IndicatorsDto
.
class
);
...
...
@@ -736,7 +761,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
}
long
timeInMillis
=
new
Date
().
getTime
();
//
long timeInMillis = new Date().getTime();
for
(
IndicatorsDto
indicatorsDto
:
indicatorsDtoList
)
{
try
{
TemporaryData
temporaryData
=
new
TemporaryData
();
...
...
@@ -769,7 +794,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
temporaryDataService
.
saveBatch
(
temporaryDatass
);
}
public
void
schedSolarPower
(
String
gatewayId
){
public
void
schedSolarPower
(
String
gatewayId
,
long
timeInMillis
){
String
sql
=
"SELECT * FROM indicators_"
+
gatewayId
+
" WHERE displayName = '总辐射累计' "
;
String
sql1
=
"SELECT * FROM indicators_"
+
gatewayId
+
" WHERE displayName = '有功功率'"
;
List
<
IndicatorsDto
>
indicatorsDtoList
=
influxDButils
.
getListDataAll
(
sql
,
IndicatorsDto
.
class
);
...
...
@@ -782,7 +807,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
}
long
timeInMillis
=
new
Date
().
getTime
();
//
long timeInMillis = new Date().getTime();
for
(
IndicatorsDto
indicatorsDto
:
indicatorsDtoList
)
{
try
{
TemporaryData
temporaryData
=
new
TemporaryData
();
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-bigscreen-biz/src/main/resources/mapper/cluster/TemporaryDataMapper.xml
View file @
21bcda80
...
...
@@ -5,7 +5,8 @@
<select
id=
"timingTemporarysSorageData"
resultType=
"map"
>
SELECT avg(value) as value ,
SELECT
avg(value) as value ,
created_time as createdTime ,
equipmentIndexName
FROM
...
...
@@ -17,8 +18,9 @@
<if
test=
"gatewayId == null or gatewayId == ''"
>
equipmentNumber is not null and equipmentIndexName is not null
</if>
AND equipmentIndexName='有功功率'
</where>
GROUP BY
batch_no
,equipmentIndexName;
GROUP BY
created_time
,equipmentIndexName;
</select>
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/MonitorFanIndicatorImpl.java
View file @
21bcda80
...
...
@@ -644,12 +644,14 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
LambdaQueryWrapper
<
StationBasic
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
BaseEntity:
:
getIsDelete
,
false
);
List
<
StationBasic
>
stationBasics
=
stationBasicMapper
.
selectList
(
wrapper
);
long
timeInMillis
=
new
Date
().
getTime
();
for
(
StationBasic
stationBasic
:
stationBasics
)
{
if
(
stationBasic
.
getStationType
().
equals
(
"FDZ"
))
{
timingTemporarysSorageData
(
stationBasic
.
getFanGatewayId
());
timingTemporarysSorageData
(
stationBasic
.
getFanGatewayId
()
,
timeInMillis
);
}
if
(
stationBasic
.
getStationType
().
equals
(
"JZSGFDZ"
))
{
schedSolarPower
(
stationBasic
.
getBoosterGatewayId
());
schedSolarPower
(
stationBasic
.
getBoosterGatewayId
()
,
timeInMillis
);
}
}
}
...
...
@@ -734,7 +736,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
}
public
void
timingTemporarysSorageData
(
String
gatewayId
)
{
public
void
timingTemporarysSorageData
(
String
gatewayId
,
long
timeInMillis
)
{
String
sql
=
"SELECT * FROM indicators_"
+
gatewayId
+
" WHERE equipmentIndexName = '瞬时风速' "
;
String
sql1
=
"SELECT * FROM indicators_"
+
gatewayId
+
" WHERE equipmentIndexName = '有功功率'"
;
List
<
IndicatorsDto
>
indicatorsDtoList
=
influxDButils
.
getListDataAll
(
sql
,
IndicatorsDto
.
class
);
...
...
@@ -747,7 +749,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
}
long
timeInMillis
=
new
Date
().
getTime
();
//
long timeInMillis = new Date().getTime();
for
(
IndicatorsDto
indicatorsDto
:
indicatorsDtoList
)
{
try
{
TemporaryData
temporaryData
=
new
TemporaryData
();
...
...
@@ -780,7 +782,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
temporaryDataService
.
saveBatch
(
temporaryDatass
);
}
public
void
schedSolarPower
(
String
gatewayId
)
{
public
void
schedSolarPower
(
String
gatewayId
,
long
timeInMillis
)
{
String
sql
=
"SELECT * FROM indicators_"
+
gatewayId
+
" WHERE displayName = '总辐射累计' "
;
String
sql1
=
"SELECT * FROM indicators_"
+
gatewayId
+
" WHERE displayName = '有功功率'"
;
List
<
IndicatorsDto
>
indicatorsDtoList
=
influxDButils
.
getListDataAll
(
sql
,
IndicatorsDto
.
class
);
...
...
@@ -793,7 +795,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
}
long
timeInMillis
=
new
Date
().
getTime
();
//
long timeInMillis = new Date().getTime();
for
(
IndicatorsDto
indicatorsDto
:
indicatorsDtoList
)
{
try
{
TemporaryData
temporaryData
=
new
TemporaryData
();
...
...
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