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
e15b8edc
Commit
e15b8edc
authored
Nov 18, 2024
by
麻笑宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
指标管理 安全追溯 / 当年主体单位隐患排名(Top10)代码提交
parent
5cfeee77
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
25 deletions
+49
-25
ZBGLStatisticsMapper.xml
...cs-api/src/main/resources/mapper/ZBGLStatisticsMapper.xml
+6
-4
DnztdwyhpmServiceImpl.java
...stcs/biz/service/impl/ZBGLImpl/DnztdwyhpmServiceImpl.java
+43
-21
No files found.
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-api/src/main/resources/mapper/ZBGLStatisticsMapper.xml
View file @
e15b8edc
...
...
@@ -137,10 +137,12 @@
FROM
tzs_safety_problem_tracing
WHERE
principal_unit_code IN
<foreach
collection=
"unitCodeList"
item=
"item"
separator=
","
open=
"("
close=
")"
>
principal_unit_code = #{item}
</foreach>
principal_unit_code IN (
<foreach
collection=
"unitCodeList"
item=
"item"
separator=
","
>
#{item}
</foreach>
)
AND source_type_code = '2'
GROUP BY
principal_unit_code,
problem_type_code
...
...
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/ZBGLImpl/DnztdwyhpmServiceImpl.java
View file @
e15b8edc
package
com
.
yeejoin
.
amos
.
boot
.
module
.
statistcs
.
biz
.
service
.
impl
.
ZBGLImpl
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.lang.UUID
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamForDetailDto
;
...
...
@@ -86,25 +87,42 @@ public class DnztdwyhpmServiceImpl implements IZBGLService {
@Override
public
Page
<
Map
<
String
,
Object
>>
getPage
(
Page
page
,
DPFilterParamForDetailDto
dpFilterParamForDetailDto
)
{
List
<
RegionModel
>
regionModels
=
stCommonService
.
setRegionIfRootParent
(
dpFilterParamForDetailDto
.
getCityCode
());
List
<
Map
<
String
,
Object
>>
result
=
regionModels
.
parallelStream
().
map
(
r
->
{
String
orgCode
=
stCommonService
.
getAndSetOrgCode
(
r
.
getRegionCode
()+
""
);
DPFilterParamForDetailDto
dpFilterParamForDetailDtoNew
=
new
DPFilterParamForDetailDto
();
dpFilterParamForDetailDtoNew
.
setOrgCode
(
orgCode
);
Map
<
String
,
Object
>
itemResult
=
new
HashMap
<>();
Page
<
Map
<
String
,
Object
>>
returnPage
=
zbglStatisticsMapper
.
getUnitByOrgCode
(
page
,
dpFilterParamForDetailDtoNew
);
List
<
String
>
unitCodeList
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
returnPage
.
getRecords
().
size
();
i
++){
unitCodeList
.
add
(
returnPage
.
getRecords
().
get
(
i
).
get
(
"principalUnitCode"
).
toString
());
String
orgCode
=
stCommonService
.
getAndSetOrgCode
(
dpFilterParamForDetailDto
.
getCityCode
());
dpFilterParamForDetailDto
.
setOrgCode
(
orgCode
);
Page
<
Map
<
String
,
Object
>>
returnPage
=
zbglStatisticsMapper
.
getUnitByOrgCode
(
page
,
dpFilterParamForDetailDto
);
List
<
String
>
unitCodeList
=
new
ArrayList
<>();
Map
<
String
,
Map
<
String
,
Object
>>
unitMap
=
new
HashMap
<>();
for
(
int
i
=
0
;
i
<
returnPage
.
getRecords
().
size
();
i
++){
unitMap
.
put
(
returnPage
.
getRecords
().
get
(
i
).
get
(
"principalUnitCode"
).
toString
(),
new
HashMap
<>());
unitCodeList
.
add
(
returnPage
.
getRecords
().
get
(
i
).
get
(
"principalUnitCode"
).
toString
());
}
Map
<
String
,
Long
>
countMap
=
new
HashMap
<>();
if
(!
CollectionUtil
.
isEmpty
(
unitCodeList
))
{
List
<
Map
<
String
,
Object
>>
list
=
zbglStatisticsMapper
.
getDNZTDWYHPMPageData
(
unitCodeList
);
for
(
int
i
=
0
;
i
<
list
.
size
();
i
++)
{
Map
<
String
,
Object
>
map
=
unitMap
.
get
(
list
.
get
(
i
).
get
(
"principalUnitCode"
));
map
.
put
(
list
.
get
(
i
).
get
(
"problemTypeCode"
)
+
""
,
list
.
get
(
i
).
get
(
"count"
));
map
.
put
(
"principalUnit"
,
list
.
get
(
i
).
get
(
"principalUnit"
));
map
.
put
(
"principalUnitCode"
,
list
.
get
(
i
).
get
(
"principalUnitCode"
));
Long
aLong
=
countMap
.
get
(
list
.
get
(
i
).
get
(
"principalUnitCode"
));
if
(
aLong
==
null
)
{
countMap
.
put
(
list
.
get
(
i
).
get
(
"principalUnitCode"
).
toString
(),
(
Long
)
list
.
get
(
i
).
get
(
"count"
));
}
else
{
countMap
.
put
(
list
.
get
(
i
).
get
(
"principalUnitCode"
).
toString
(),
aLong
+
(
Long
)
list
.
get
(
i
).
get
(
"count"
));
}
}
List
<
Map
<
String
,
Object
>>
list
=
zbglStatisticsMapper
.
getDNZTDWYHPMPageData
(
unitCodeList
);
Long
sum
=
0L
;
itemResult
.
put
(
"sequenceNbr"
,
UUID
.
fastUUID
().
toString
());
return
itemResult
;
}).
collect
(
Collectors
.
toList
());
page
.
setRecords
(
result
);
page
.
setTotal
(
result
.
size
());
List
<
Map
<
String
,
Object
>>
resultList
=
new
ArrayList
();
unitMap
.
entrySet
().
forEach
(
item
->
{
Map
<
String
,
Object
>
value
=
item
.
getValue
();
value
.
entrySet
().
forEach
(
t
->
{
if
(!
t
.
getKey
().
equals
(
"principalUnit"
)
&&
!
t
.
getKey
().
equals
(
"principalUnitCode"
))
{
t
.
setValue
(
t
.
getValue
()
+
" / "
+
new
BigDecimal
(
t
.
getValue
()
+
""
).
divide
(
BigDecimal
.
valueOf
(
countMap
.
get
(
item
.
getValue
().
get
(
"principalUnitCode"
))),
2
,
RoundingMode
.
HALF_UP
).
multiply
(
BigDecimal
.
valueOf
(
100
)).
stripTrailingZeros
().
toPlainString
()
+
"%"
);
}
});
resultList
.
add
(
value
);
});
page
.
setRecords
(
resultList
);
}
return
page
;
}
...
...
@@ -116,12 +134,16 @@ public class DnztdwyhpmServiceImpl implements IZBGLService {
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"dataIndex"
,
list
.
get
(
i
).
get
(
"code"
));
map
.
put
(
"title"
,
list
.
get
(
i
).
get
(
"name"
));
l
ist
.
add
(
map
);
returnL
ist
.
add
(
map
);
}
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"dataIndex"
,
"
unitName
"
);
map
.
put
(
"title"
,
"主体
信息
"
);
map
.
put
(
"dataIndex"
,
"
principalUnit
"
);
map
.
put
(
"title"
,
"主体
名称
"
);
returnList
.
add
(
0
,
map
);
Map
<
String
,
String
>
map1
=
new
HashMap
<>();
map1
.
put
(
"dataIndex"
,
"principalUnitCode"
);
map1
.
put
(
"title"
,
"主体编码"
);
returnList
.
add
(
1
,
map1
);
return
returnList
;
}
}
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