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
71ca1109
Commit
71ca1109
authored
Oct 30, 2024
by
麻笑宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
应急处置 / 办理量 (近7天)
代码修改
parent
9758beed
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
8 deletions
+44
-8
YJDPStatisticsServiceImpl.java
...statistcs/biz/service/impl/YJDPStatisticsServiceImpl.java
+44
-8
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 @
71ca1109
...
@@ -54,6 +54,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseHelper;
...
@@ -54,6 +54,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.text.DecimalFormat
;
import
java.time.LocalDate
;
import
java.time.LocalDate
;
import
java.time.format.DateTimeFormatter
;
import
java.time.format.DateTimeFormatter
;
import
java.time.temporal.ChronoUnit
;
import
java.time.temporal.ChronoUnit
;
...
@@ -572,7 +573,7 @@ public class YJDPStatisticsServiceImpl {
...
@@ -572,7 +573,7 @@ public class YJDPStatisticsServiceImpl {
JSONObject
res
=
new
JSONObject
();
JSONObject
res
=
new
JSONObject
();
JSONArray
legendData
=
new
JSONArray
();
JSONArray
legendData
=
new
JSONArray
();
legendData
.
add
(
createLegendData
());
legendData
.
add
All
(
createLegendData
());
List
<
RegionModel
>
regionList
=
stCommonService
.
setRegionIfRootParentAndNoAccessIf3Level
(
ValidationUtil
.
isEmpty
(
recordFilterVo
.
getCityCode
())
?
"610000"
:
recordFilterVo
.
getCityCode
());
List
<
RegionModel
>
regionList
=
stCommonService
.
setRegionIfRootParentAndNoAccessIf3Level
(
ValidationUtil
.
isEmpty
(
recordFilterVo
.
getCityCode
())
?
"610000"
:
recordFilterVo
.
getCityCode
());
...
@@ -595,18 +596,53 @@ public class YJDPStatisticsServiceImpl {
...
@@ -595,18 +596,53 @@ public class YJDPStatisticsServiceImpl {
}
}
return
alertStatisticsMapper
.
countAlertRecordByOrgCodeAndDate
(
orgCode
,
recordFilterVo
);
return
alertStatisticsMapper
.
countAlertRecordByOrgCodeAndDate
(
orgCode
,
recordFilterVo
);
}).
collect
(
Collectors
.
toList
());
}).
collect
(
Collectors
.
toList
());
Long
totalCount
=
alertRecordTotal
.
stream
().
reduce
(
0L
,
Long:
:
sum
);
res
.
put
(
"legendData"
,
legendData
);
res
.
put
(
"legendData"
,
legendData
);
res
.
put
(
"xdata"
,
xData
);
res
.
put
(
"xdata"
,
xData
);
res
.
put
(
"alertRecordTotal"
,
alertRecordTotal
);
res
.
put
(
"alertCount"
,
alertRecordTotal
);
List
<
Long
>
totalCountList
=
new
ArrayList
();
List
<
String
>
rateList
=
new
ArrayList
();
// 计算比率
double
completionRate
=
0.0
;
for
(
int
i
=
0
;
i
<
xData
.
size
();
i
++){
totalCountList
.
add
(
totalCount
);
if
(
totalCount
!=
0
&&
alertRecordTotal
.
get
(
i
)
!=
0
){
completionRate
=
(
double
)
alertRecordTotal
.
get
(
i
)
/
totalCount
;
}
DecimalFormat
df
=
new
DecimalFormat
(
"#,##0.00"
);
String
rate
=
df
.
format
(
completionRate
);
rateList
.
add
(
rate
);
}
res
.
put
(
"totalCount"
,
totalCountList
);
res
.
put
(
"rate"
,
rateList
);
return
res
;
return
res
;
}
}
private
JSONObject
createLegendData
()
{
private
JSONArray
createLegendData
()
{
JSONObject
legendSubData
=
new
JSONObject
();
legendSubData
.
put
(
"dataKey"
,
"alertRecordTotal"
);
JSONArray
legendData
=
new
JSONArray
();
legendSubData
.
put
(
"value"
,
"应急事件总数"
);
legendSubData
.
put
(
"chartType"
,
"bar"
);
for
(
int
i
=
0
;
i
<
3
;
i
++){
return
legendSubData
;
JSONObject
legendSubData
=
new
JSONObject
();
if
(
i
==
0
){
legendSubData
.
put
(
"dataKey"
,
"alertCount"
);
legendSubData
.
put
(
"value"
,
"发生数量"
);
legendSubData
.
put
(
"chartType"
,
"bar"
);
}
else
if
(
i
==
1
){
legendSubData
.
put
(
"dataKey"
,
"totalCount"
);
legendSubData
.
put
(
"value"
,
"总量"
);
legendSubData
.
put
(
"chartType"
,
"bar"
);
}
else
{
legendSubData
.
put
(
"dataKey"
,
"rate"
);
legendSubData
.
put
(
"value"
,
"比率"
);
legendSubData
.
put
(
"chartType"
,
"line"
);
}
legendData
.
add
(
legendSubData
);
}
return
legendData
;
}
}
...
...
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