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
a838e5ac
Commit
a838e5ac
authored
Jul 31, 2024
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.应急中评增加统计项,下钻到区县后接口报错bug
parent
d73afb51
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
26 deletions
+29
-26
YJDPStatisticsServiceImpl.java
...statistcs/biz/service/impl/YJDPStatisticsServiceImpl.java
+29
-26
No files found.
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-biz/src/main/java/com/yeejoin/amos/boot/module/statistcs/biz/service/impl/YJDPStatisticsServiceImpl.java
View file @
a838e5ac
package
com
.
yeejoin
.
amos
.
boot
.
module
.
statistcs
.
biz
.
service
.
impl
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
statistcs
.
biz
.
service
.
impl
;
import
cn.hutool.core.date.DateTime
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
...
@@ -8,14 +7,12 @@ import com.yeejoin.amos.boot.biz.common.dto.CountDto;
...
@@ -8,14 +7,12 @@ import com.yeejoin.amos.boot.biz.common.dto.CountDto;
import
com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamDto
;
import
com.yeejoin.amos.boot.module.common.api.entity.AlertRescueStatistics
;
import
com.yeejoin.amos.boot.module.common.api.entity.AlertRescueStatistics
;
import
com.yeejoin.amos.boot.module.common.api.entity.AlertUseUnitStatistics
;
import
com.yeejoin.amos.boot.module.common.api.entity.AlertUseUnitStatistics
;
import
com.yeejoin.amos.boot.module.jg.api.enums.DPMapStatisticsItemEnum
;
import
com.yeejoin.amos.boot.module.statistics.api.dto.AlertUseUnitStatisticsDto
;
import
com.yeejoin.amos.boot.module.statistics.api.dto.AlertUseUnitStatisticsDto
;
import
com.yeejoin.amos.boot.module.statistics.api.mapper.AlertRescueStatisticsMapper
;
import
com.yeejoin.amos.boot.module.statistics.api.mapper.AlertRescueStatisticsMapper
;
import
com.yeejoin.amos.boot.module.statistics.api.mapper.AlertStatisticsMapper
;
import
com.yeejoin.amos.boot.module.statistics.api.mapper.AlertStatisticsMapper
;
import
com.yeejoin.amos.boot.module.statistics.api.mapper.AlertUseUnitStatisticsMapper
;
import
com.yeejoin.amos.boot.module.statistics.api.mapper.AlertUseUnitStatisticsMapper
;
import
com.yeejoin.amos.boot.module.ymt.api.dto.AlertPaperInfoDto
;
import
com.yeejoin.amos.boot.module.ymt.api.dto.AlertPaperInfoDto
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.DispatchPaper
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.DispatchPaper
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.MainParts
;
import
com.yeejoin.amos.boot.module.ymt.api.enums.DispatchPaperEnums
;
import
com.yeejoin.amos.boot.module.ymt.api.enums.DispatchPaperEnums
;
import
com.yeejoin.amos.boot.module.ymt.api.enums.EquimentEnum
;
import
com.yeejoin.amos.boot.module.ymt.api.enums.EquimentEnum
;
import
com.yeejoin.amos.boot.module.ymt.api.enums.EquipmentClassifityEnum
;
import
com.yeejoin.amos.boot.module.ymt.api.enums.EquipmentClassifityEnum
;
...
@@ -135,9 +132,9 @@ public class YJDPStatisticsServiceImpl {
...
@@ -135,9 +132,9 @@ public class YJDPStatisticsServiceImpl {
return
jsonObject
;
return
jsonObject
;
}
}
public
JSONObject
elevatorCountStat
(
DPFilterParamDto
dpFilterParamDto
)
throws
Exception
{
public
JSONObject
elevatorCountStat
(
DPFilterParamDto
dpFilterParamDto
)
{
List
<
RegionModel
>
regionList
=
stCommonService
.
setRegionIfRootParent
(
dpFilterParamDto
);
List
<
RegionModel
>
regionList
=
stCommonService
.
setRegionIfRootParent
(
dpFilterParamDto
);
List
<
String
>
xdata
=
regionList
.
stream
().
map
(
r
->
r
.
getRegionName
().
toString
()
).
collect
(
Collectors
.
toList
());
List
<
String
>
xdata
=
regionList
.
stream
().
map
(
RegionModel:
:
getRegionName
).
collect
(
Collectors
.
toList
());
List
<
Long
>
ydata
=
new
ArrayList
<>();
List
<
Long
>
ydata
=
new
ArrayList
<>();
regionList
.
forEach
(
x
->
{
regionList
.
forEach
(
x
->
{
...
@@ -366,12 +363,15 @@ public class YJDPStatisticsServiceImpl {
...
@@ -366,12 +363,15 @@ public class YJDPStatisticsServiceImpl {
}
}
public
List
<
Map
<
String
,
Object
>>
getCenterMapCountDataForOverview
(
DPFilterParamDto
dpFilterParamDto
)
{
public
List
<
Map
<
String
,
Object
>>
getCenterMapCountDataForOverview
(
DPFilterParamDto
dpFilterParamDto
)
{
return
stCommonService
.
setRegionIfRootParent
(
dpFilterParamDto
).
parallelS
tream
().
map
(
r
->
{
return
stCommonService
.
setRegionIfRootParent
(
dpFilterParamDto
).
s
tream
().
map
(
r
->
{
DPFilterParamDto
filterParamDto
=
new
DPFilterParamDto
();
DPFilterParamDto
filterParamDto
=
new
DPFilterParamDto
();
filterParamDto
.
setCityCode
(
r
.
getRegionCode
().
toString
());
filterParamDto
.
setCityCode
(
r
.
getRegionCode
().
toString
());
String
orgCode
=
stCommonService
.
getAndSetOrgCode
(
filterParamDto
);
String
orgCode
=
stCommonService
.
getAndSetOrgCode
(
filterParamDto
);
this
.
setDefaultFilter
(
filterParamDto
);
Map
<
String
,
Object
>
itemResult
=
new
HashMap
<>();
Map
<
String
,
Object
>
itemResult
=
getCenterMapOverviewData
(
orgCode
,
filterParamDto
);
if
(
StringUtils
.
isNotEmpty
(
orgCode
))
{
this
.
setDefaultFilter
(
filterParamDto
);
itemResult
=
getCenterMapOverviewData
(
orgCode
,
filterParamDto
);
}
itemResult
.
put
(
"regionCode"
,
r
.
getRegionCode
());
itemResult
.
put
(
"regionCode"
,
r
.
getRegionCode
());
itemResult
.
put
(
"regionName"
,
r
.
getRegionName
());
itemResult
.
put
(
"regionName"
,
r
.
getRegionName
());
return
itemResult
;
return
itemResult
;
...
@@ -385,37 +385,37 @@ public class YJDPStatisticsServiceImpl {
...
@@ -385,37 +385,37 @@ public class YJDPStatisticsServiceImpl {
Map
<
String
,
Long
>
alertTypeNumMap
=
countDtos
.
stream
().
collect
(
Collectors
.
toMap
(
CountDto:
:
getKeyStr
,
CountDto:
:
getLongValue
));
Map
<
String
,
Long
>
alertTypeNumMap
=
countDtos
.
stream
().
collect
(
Collectors
.
toMap
(
CountDto:
:
getKeyStr
,
CountDto:
:
getLongValue
));
Map
<
String
,
Long
>
equDefineNumMap
=
staticsElevatorByEquDefine
(
filterParamDto
.
getCityCode
());
Map
<
String
,
Long
>
equDefineNumMap
=
staticsElevatorByEquDefine
(
filterParamDto
.
getCityCode
());
// 电梯总量(台)
// 电梯总量(台)
result
.
put
(
"dtCount"
,
equDefineNumMap
.
values
().
stream
().
mapToLong
(
e
->
e
).
sum
());
result
.
put
(
"dtCount"
,
equDefineNumMap
.
values
().
stream
().
mapToLong
(
e
->
e
).
sum
());
// 曳引驱动乘客电梯(台)
// 曳引驱动乘客电梯(台)
result
.
put
(
"zyqdcjdtCount"
,
equDefineNumMap
.
getOrDefault
(
"3110"
,
0L
));
result
.
put
(
"zyqdcjdtCount"
,
equDefineNumMap
.
getOrDefault
(
"3110"
,
0L
));
// 曳引驱动载货电梯(台)
// 曳引驱动载货电梯(台)
result
.
put
(
"zyqdzhdtCount"
,
equDefineNumMap
.
getOrDefault
(
"3120"
,
0L
));
result
.
put
(
"zyqdzhdtCount"
,
equDefineNumMap
.
getOrDefault
(
"3120"
,
0L
));
// 强制驱动载货电梯(台)
// 强制驱动载货电梯(台)
result
.
put
(
"qzqdzgdtCount"
,
equDefineNumMap
.
getOrDefault
(
"3130"
,
0L
));
result
.
put
(
"qzqdzgdtCount"
,
equDefineNumMap
.
getOrDefault
(
"3130"
,
0L
));
// 液压乘客电梯(台)
// 液压乘客电梯(台)
result
.
put
(
"yackdtount"
,
equDefineNumMap
.
getOrDefault
(
"3210"
,
0L
));
result
.
put
(
"yackdtount"
,
equDefineNumMap
.
getOrDefault
(
"3210"
,
0L
));
// 液压载货电梯(台)
// 液压载货电梯(台)
result
.
put
(
"yyzhdtCount"
,
equDefineNumMap
.
getOrDefault
(
"3220"
,
0L
));
result
.
put
(
"yyzhdtCount"
,
equDefineNumMap
.
getOrDefault
(
"3220"
,
0L
));
// 自动扶梯(台)
// 自动扶梯(台)
result
.
put
(
"zdftCount"
,
equDefineNumMap
.
getOrDefault
(
"3310"
,
0L
));
result
.
put
(
"zdftCount"
,
equDefineNumMap
.
getOrDefault
(
"3310"
,
0L
));
// 自动人行道(台)
// 自动人行道(台)
result
.
put
(
"zdrxdCount"
,
equDefineNumMap
.
getOrDefault
(
"3320"
,
0L
));
result
.
put
(
"zdrxdCount"
,
equDefineNumMap
.
getOrDefault
(
"3320"
,
0L
));
// 防爆电梯(台)
// 防爆电梯(台)
result
.
put
(
"fbdtCount"
,
equDefineNumMap
.
getOrDefault
(
"3410"
,
0L
));
result
.
put
(
"fbdtCount"
,
equDefineNumMap
.
getOrDefault
(
"3410"
,
0L
));
// 消防员电梯(台)
// 消防员电梯(台)
result
.
put
(
"xfydtCount"
,
equDefineNumMap
.
getOrDefault
(
"3420"
,
0L
));
result
.
put
(
"xfydtCount"
,
equDefineNumMap
.
getOrDefault
(
"3420"
,
0L
));
// 杂物电梯(台)
// 杂物电梯(台)
result
.
put
(
"zhdtCount"
,
equDefineNumMap
.
getOrDefault
(
"3430"
,
0L
));
result
.
put
(
"zhdtCount"
,
equDefineNumMap
.
getOrDefault
(
"3430"
,
0L
));
// 应急事件(起)
// 应急事件(起)
result
.
put
(
"alarmCount"
,
alertTypeNumMap
.
getOrDefault
(
DispatchPaperEnums
.
KRJY
.
getId
(),
0L
)
+
alertTypeNumMap
.
getOrDefault
(
DispatchPaperEnums
.
GZWX
.
getId
(),
0L
));
result
.
put
(
"alarmCount"
,
alertTypeNumMap
.
getOrDefault
(
DispatchPaperEnums
.
KRJY
.
getId
(),
0L
)
+
alertTypeNumMap
.
getOrDefault
(
DispatchPaperEnums
.
GZWX
.
getId
(),
0L
));
// 困人救援事件(起)
// 困人救援事件(起)
result
.
put
(
"krjysjCount"
,
alertTypeNumMap
.
getOrDefault
(
DispatchPaperEnums
.
KRJY
.
getId
(),
0L
));
result
.
put
(
"krjysjCount"
,
alertTypeNumMap
.
getOrDefault
(
DispatchPaperEnums
.
KRJY
.
getId
(),
0L
));
// 故障维修(起)
// 故障维修(起)
result
.
put
(
"gzwxCount"
,
alertTypeNumMap
.
getOrDefault
(
DispatchPaperEnums
.
GZWX
.
getId
(),
0L
));
result
.
put
(
"gzwxCount"
,
alertTypeNumMap
.
getOrDefault
(
DispatchPaperEnums
.
GZWX
.
getId
(),
0L
));
// 投诉咨询(起)
// 投诉咨询(起)
result
.
put
(
"tszxCount"
,
alertTypeNumMap
.
getOrDefault
(
DispatchPaperEnums
.
TSZX
.
getId
(),
0L
));
result
.
put
(
"tszxCount"
,
alertTypeNumMap
.
getOrDefault
(
DispatchPaperEnums
.
TSZX
.
getId
(),
0L
));
// 解救被困乘客数(人)
// 解救被困乘客数(人)
result
.
put
(
"jjbkcksCount"
,
alertStatisticsMapper
.
countRescuedPersonNum
(
orgCode
,
filterParamDto
));
result
.
put
(
"jjbkcksCount"
,
alertStatisticsMapper
.
countRescuedPersonNum
(
orgCode
,
filterParamDto
));
return
result
;
return
result
;
}
}
...
@@ -423,7 +423,10 @@ public class YJDPStatisticsServiceImpl {
...
@@ -423,7 +423,10 @@ public class YJDPStatisticsServiceImpl {
public
Map
<
String
,
Object
>
getCenterMapCountDataForGlobal
(
DPFilterParamDto
dpFilterParamDto
)
{
public
Map
<
String
,
Object
>
getCenterMapCountDataForGlobal
(
DPFilterParamDto
dpFilterParamDto
)
{
this
.
setDefaultFilter
(
dpFilterParamDto
);
this
.
setDefaultFilter
(
dpFilterParamDto
);
String
orgCode
=
stCommonService
.
getAndSetOrgCode
(
dpFilterParamDto
);
String
orgCode
=
stCommonService
.
getAndSetOrgCode
(
dpFilterParamDto
);
return
this
.
getCenterMapOverviewData
(
orgCode
,
dpFilterParamDto
);
if
(
StringUtils
.
isNotEmpty
(
orgCode
))
{
return
this
.
getCenterMapOverviewData
(
orgCode
,
dpFilterParamDto
);
}
return
new
HashMap
<>();
}
}
private
void
setDefaultFilter
(
DPFilterParamDto
dpFilterParamDto
)
{
private
void
setDefaultFilter
(
DPFilterParamDto
dpFilterParamDto
)
{
...
@@ -475,7 +478,7 @@ public class YJDPStatisticsServiceImpl {
...
@@ -475,7 +478,7 @@ public class YJDPStatisticsServiceImpl {
Terms
terms
=
response
.
getAggregations
().
get
(
"count_by_equ_define_code"
);
Terms
terms
=
response
.
getAggregations
().
get
(
"count_by_equ_define_code"
);
for
(
Terms
.
Bucket
bucket
:
terms
.
getBuckets
())
{
for
(
Terms
.
Bucket
bucket
:
terms
.
getBuckets
())
{
// 按照真实的过滤,防止有脏数据
// 按照真实的过滤,防止有脏数据
if
(
ELEVATOR_EQU_DEFINE_CODES
.
contains
(
bucket
.
getKeyAsString
()))
{
if
(
ELEVATOR_EQU_DEFINE_CODES
.
contains
(
bucket
.
getKeyAsString
()))
{
countMap
.
put
(
bucket
.
getKeyAsString
(),
bucket
.
getDocCount
());
countMap
.
put
(
bucket
.
getKeyAsString
(),
bucket
.
getDocCount
());
}
}
}
}
...
...
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