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
3b428914
Commit
3b428914
authored
Sep 28, 2023
by
zhangsen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
监盘大屏bug修改
parent
077f636e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
13 deletions
+23
-13
CommonServiceImpl.java
...boot/module/jxiop/biz/service/impl/CommonServiceImpl.java
+11
-2
LargeScreenImpl.java
...s/boot/module/jxiop/biz/service/impl/LargeScreenImpl.java
+12
-11
No files found.
amos-boot-system-jxiop/amos-boot-module-jxiop-bigscreen-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/CommonServiceImpl.java
View file @
3b428914
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
service
.
impl
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
service
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.jxiop.api.entity.MapRegion
;
import
com.yeejoin.amos.boot.module.jxiop.api.entity.MapRegion
;
...
@@ -16,10 +17,14 @@ import com.yeejoin.amos.boot.module.jxiop.biz.initdata.StationCacheDataInit;
...
@@ -16,10 +17,14 @@ import com.yeejoin.amos.boot.module.jxiop.biz.initdata.StationCacheDataInit;
import
com.yeejoin.amos.boot.module.jxiop.biz.mapper2.SjglZsjZsbtzMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.mapper2.SjglZsjZsbtzMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.utils.InfluxDButils
;
import
com.yeejoin.amos.boot.module.jxiop.biz.utils.InfluxDButils
;
import
com.yeejoin.amos.component.influxdb.InfluxdbUtil
;
import
com.yeejoin.amos.component.influxdb.InfluxdbUtil
;
import
lombok.extern.slf4j.Slf4j
;
import
org.elasticsearch.action.search.SearchRequestBuilder
;
import
org.elasticsearch.action.search.SearchResponse
;
import
org.elasticsearch.index.query.BoolQueryBuilder
;
import
org.elasticsearch.index.query.BoolQueryBuilder
;
import
org.elasticsearch.index.query.MatchPhraseQueryBuilder
;
import
org.elasticsearch.index.query.MatchPhraseQueryBuilder
;
import
org.elasticsearch.index.query.QueryBuilders
;
import
org.elasticsearch.index.query.QueryBuilders
;
import
org.elasticsearch.search.aggregations.Aggregation
;
import
org.elasticsearch.search.aggregations.Aggregation
;
import
org.elasticsearch.search.aggregations.AggregationBuilder
;
import
org.elasticsearch.search.aggregations.AggregationBuilders
;
import
org.elasticsearch.search.aggregations.AggregationBuilders
;
import
org.elasticsearch.search.aggregations.Aggregations
;
import
org.elasticsearch.search.aggregations.Aggregations
;
import
org.elasticsearch.search.aggregations.bucket.terms.ParsedStringTerms
;
import
org.elasticsearch.search.aggregations.bucket.terms.ParsedStringTerms
;
...
@@ -46,6 +51,7 @@ import java.util.Objects;
...
@@ -46,6 +51,7 @@ import java.util.Objects;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
@Service
@Service
@Slf4j
public
class
CommonServiceImpl
{
public
class
CommonServiceImpl
{
@Autowired
@Autowired
InfluxDButils
influxDButils
;
InfluxDButils
influxDButils
;
...
@@ -216,11 +222,14 @@ public class CommonServiceImpl {
...
@@ -216,11 +222,14 @@ public class CommonServiceImpl {
SumAggregationBuilder
buyCountSum
=
AggregationBuilders
.
sum
(
"buyCountSum"
).
field
(
keyavg
);
SumAggregationBuilder
buyCountSum
=
AggregationBuilders
.
sum
(
"buyCountSum"
).
field
(
keyavg
);
tb1
.
subAggregation
(
buyCountSum
);
// 通过typeId字段分组统计总数
tb1
.
subAggregation
(
buyCountSum
);
// 通过typeId字段分组统计总数
Query
query
=
new
NativeSearchQueryBuilder
()
Query
query
=
new
NativeSearchQueryBuilder
()
.
withQuery
(
queryBuilder
)
.
addAggregation
(
tb1
)
.
addAggregation
(
tb1
)
.
withPageable
(
PageRequest
.
of
(
0
,
1
))
.
withQuery
(
queryBuilder
)
.
withPageable
(
PageRequest
.
of
(
0
,
10000
))
.
build
();
.
build
();
query
.
setTrackTotalHits
(
true
);
query
.
setTrackTotalHits
(
true
);
SearchHits
search
=
elasticsearchTemplate
.
search
(
query
,
clas
);
SearchHits
search
=
elasticsearchTemplate
.
search
(
query
,
clas
);
if
(
search
.
hasAggregations
())
{
if
(
search
.
hasAggregations
())
{
Aggregations
aggregations
=
search
.
getAggregations
();
Aggregations
aggregations
=
search
.
getAggregations
();
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-bigscreen-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/LargeScreenImpl.java
View file @
3b428914
...
@@ -303,7 +303,7 @@ public class LargeScreenImpl {
...
@@ -303,7 +303,7 @@ public class LargeScreenImpl {
List
<
String
>
listdate
=
dayReportnq
(
new
Date
());
List
<
String
>
listdate
=
dayReportnq
(
new
Date
());
seriesData
.
setAxisData
(
listdate
);
seriesData
.
setAxisData
(
listdate
);
try
{
try
{
emqKeeper
.
getMqttClient
().
publish
(
"country
Fd
"
,
JSON
.
toJSONString
(
seriesData
).
getBytes
(),
0
,
false
);
emqKeeper
.
getMqttClient
().
publish
(
"country"
,
JSON
.
toJSONString
(
seriesData
).
getBytes
(),
0
,
false
);
}
catch
(
MqttException
e
)
{
}
catch
(
MqttException
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
...
@@ -341,8 +341,8 @@ public class LargeScreenImpl {
...
@@ -341,8 +341,8 @@ public class LargeScreenImpl {
mapjn
.
put
(
"data"
,
listjn
);
mapjn
.
put
(
"data"
,
listjn
);
mapjn
.
put
(
"name"
,
"当前值"
);
mapjn
.
put
(
"name"
,
"当前值"
);
Map
<
String
,
Object
>
mapqn
=
new
HashMap
<>();
Map
<
String
,
Object
>
mapqn
=
new
HashMap
<>();
map
j
n
.
put
(
"data"
,
listqn
);
map
q
n
.
put
(
"data"
,
listqn
);
map
j
n
.
put
(
"name"
,
"同期值"
);
map
q
n
.
put
(
"name"
,
"同期值"
);
List
<
Map
<
String
,
Object
>>
list
=
new
ArrayList
<>();
List
<
Map
<
String
,
Object
>>
list
=
new
ArrayList
<>();
list
.
add
(
mapjn
);
list
.
add
(
mapjn
);
...
@@ -374,12 +374,13 @@ public class LargeScreenImpl {
...
@@ -374,12 +374,13 @@ public class LargeScreenImpl {
List
<
String
>
value
=
new
ArrayList
<>();
List
<
String
>
value
=
new
ArrayList
<>();
value
.
add
(
RSD
);
value
.
add
(
RSD
);
Map
<
String
,
List
<
String
>>
map
=
new
HashMap
<>();
Map
<
String
,
List
<
String
>>
map
=
new
HashMap
<>();
map
.
put
(
"equipmentIndexName
.keyword
"
,
value
);
map
.
put
(
"equipmentIndexName"
,
value
);
List
<
String
>
value1
=
new
ArrayList
<>();
List
<
String
>
value1
=
new
ArrayList
<>();
value1
.
add
(
monthy
);
value1
.
add
(
monthy
);
map
.
put
(
"moon.keyword"
,
value1
);
map
.
put
(
"moon"
,
value1
);
List
<?
extends
Terms
.
Bucket
>
lidate
=
commonServiceImpl
.
getgroupsum
(
map
,
"value"
,
"day
.keyword
"
,
ESDailyPowerGeneration
.
class
);
List
<?
extends
Terms
.
Bucket
>
lidate
=
commonServiceImpl
.
getgroupsum
(
map
,
"value"
,
"day"
,
ESDailyPowerGeneration
.
class
);
Map
<
String
,
Double
>
mapdta
=
new
HashMap
<>();
Map
<
String
,
Double
>
mapdta
=
new
HashMap
<>();
DecimalFormat
format2
=
new
DecimalFormat
(
"#.0000"
);
DecimalFormat
format2
=
new
DecimalFormat
(
"#.0000"
);
...
@@ -422,13 +423,13 @@ public class LargeScreenImpl {
...
@@ -422,13 +423,13 @@ public class LargeScreenImpl {
List
<
String
>
value
=
new
ArrayList
<>();
List
<
String
>
value
=
new
ArrayList
<>();
value
.
add
(
RSD
);
value
.
add
(
RSD
);
Map
<
String
,
List
<
String
>>
map
=
new
HashMap
<>();
Map
<
String
,
List
<
String
>>
map
=
new
HashMap
<>();
map
.
put
(
"equipmentIndexName
.keyword
"
,
value
);
map
.
put
(
"equipmentIndexName"
,
value
);
map
.
put
(
"gatewayId
.keyword
"
,
gatewayId
);
map
.
put
(
"gatewayId"
,
gatewayId
);
List
<
String
>
value1
=
new
ArrayList
<>();
List
<
String
>
value1
=
new
ArrayList
<>();
value1
.
add
(
monthy
);
value1
.
add
(
monthy
);
map
.
put
(
"moon
.keyword
"
,
value1
);
map
.
put
(
"moon"
,
value1
);
List
<?
extends
Terms
.
Bucket
>
lidate
=
commonServiceImpl
.
getgroupsum
(
map
,
"value
Double"
,
"day.keyword"
,
ESEquipments
.
class
);
List
<?
extends
Terms
.
Bucket
>
lidate
=
commonServiceImpl
.
getgroupsum
(
map
,
"value
"
,
"day"
,
ESDailyPowerGeneration
.
class
);
Map
<
String
,
Double
>
mapdta
=
new
HashMap
<>();
Map
<
String
,
Double
>
mapdta
=
new
HashMap
<>();
DecimalFormat
format2
=
new
DecimalFormat
(
"#.0000"
);
DecimalFormat
format2
=
new
DecimalFormat
(
"#.0000"
);
...
@@ -473,7 +474,7 @@ public class LargeScreenImpl {
...
@@ -473,7 +474,7 @@ public class LargeScreenImpl {
cal
.
setTime
(
month
);
//month 为指定月份任意日期
cal
.
setTime
(
month
);
//month 为指定月份任意日期
int
year
=
cal
.
get
(
Calendar
.
YEAR
);
int
year
=
cal
.
get
(
Calendar
.
YEAR
);
int
m
=
cal
.
get
(
Calendar
.
MONTH
);
int
m
=
cal
.
get
(
Calendar
.
MONTH
);
int
dayNumOfMonth
=
DateUtil
.
getDaysByYearMonth
(
year
,
m
);
int
dayNumOfMonth
=
DateUtil
.
getDaysByYearMonth
(
year
,
m
+
1
);
cal
.
set
(
Calendar
.
DAY_OF_MONTH
,
1
);
// 从一号开始
cal
.
set
(
Calendar
.
DAY_OF_MONTH
,
1
);
// 从一号开始
for
(
int
i
=
0
;
i
<
dayNumOfMonth
;
i
++
)
{
for
(
int
i
=
0
;
i
<
dayNumOfMonth
;
i
++
)
{
...
...
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