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
715acd0f
Commit
715acd0f
authored
Aug 14, 2024
by
tianyiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
特设大屏-气瓶页面-区域安全指数排名、区域安全指标统计修改
parent
d957a4a2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
82 additions
and
32 deletions
+82
-32
SecurityIndexCountItemDto.java
.../module/statistics/api/dto/SecurityIndexCountItemDto.java
+10
-0
CylinderStatisticsMapper.xml
...pi/src/main/resources/mapper/CylinderStatisticsMapper.xml
+5
-4
AQZSDPStatisticsServiceImpl.java
...atistcs/biz/service/impl/AQZSDPStatisticsServiceImpl.java
+67
-28
No files found.
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-api/src/main/java/com/yeejoin/amos/boot/module/statistics/api/dto/SecurityIndexCountItemDto.java
View file @
715acd0f
...
@@ -42,4 +42,14 @@ public class SecurityIndexCountItemDto {
...
@@ -42,4 +42,14 @@ public class SecurityIndexCountItemDto {
* 充装检查率
* 充装检查率
*/
*/
String
czjchege
;
String
czjchege
;
/**
* 人员合规率(资质有效期统计)
*/
String
ryhg
;
/**
* 数据合规率
*/
String
sjhg
;
}
}
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-api/src/main/resources/mapper/CylinderStatisticsMapper.xml
View file @
715acd0f
...
@@ -19,11 +19,12 @@
...
@@ -19,11 +19,12 @@
count(DISTINCT(a.use_unit_credit_code)) as num
count(DISTINCT(a.use_unit_credit_code)) as num
FROM
FROM
"tzs_jg_use_registration_manage" a,
"tzs_jg_use_registration_manage" a,
privilege_company c
"tz_base_enterprise_info" tbei
where
where
a.receive_company_code = c.company_code
a.use_unit_credit_code = tbei.use_code
and a.certificate_status='已登记'
AND tbei.unit_type LIKE'%充装单位%'
and c.org_code like concat(#{orgCode},'%')) s1,
and a.certificate_status='已登记'
and tbei.supervise_org_code like concat(#{orgCode},'%')) s1,
(SELECT
(SELECT
count(1) as total
count(1) as total
FROM "tz_base_enterprise_info"
FROM "tz_base_enterprise_info"
...
...
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/AQZSDPStatisticsServiceImpl.java
View file @
715acd0f
...
@@ -13,26 +13,17 @@ import com.yeejoin.amos.boot.module.statistics.api.dto.EquipQuestionNumCountDto;
...
@@ -13,26 +13,17 @@ import com.yeejoin.amos.boot.module.statistics.api.dto.EquipQuestionNumCountDto;
import
com.yeejoin.amos.boot.module.statistics.api.dto.SecurityIndexCountItemDto
;
import
com.yeejoin.amos.boot.module.statistics.api.dto.SecurityIndexCountItemDto
;
import
com.yeejoin.amos.boot.module.statistics.api.mapper.AQZSDPStatisticsMapper
;
import
com.yeejoin.amos.boot.module.statistics.api.mapper.AQZSDPStatisticsMapper
;
import
com.yeejoin.amos.boot.module.statistics.api.mapper.CylinderStatisticsMapper
;
import
com.yeejoin.amos.boot.module.statistics.api.mapper.CylinderStatisticsMapper
;
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
;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.EquipTechParamPipelineMapper
;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.TzBaseEnterpriseInfoMapper
;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.TzBaseEnterpriseInfoMapper
;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.TzsUserInfoMapper
;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.TzsUserInfoMapper
;
import
com.yeejoin.amos.feign.systemctl.model.RegionModel
;
import
com.yeejoin.amos.feign.systemctl.model.RegionModel
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.lucene.queryparser.classic.QueryParser
;
import
org.elasticsearch.action.search.SearchRequest
;
import
org.elasticsearch.action.search.SearchResponse
;
import
org.elasticsearch.client.RequestOptions
;
import
org.elasticsearch.client.RequestOptions
;
import
org.elasticsearch.client.RestHighLevelClient
;
import
org.elasticsearch.client.RestHighLevelClient
;
import
org.elasticsearch.client.core.CountRequest
;
import
org.elasticsearch.client.core.CountRequest
;
import
org.elasticsearch.client.core.CountResponse
;
import
org.elasticsearch.client.core.CountResponse
;
import
org.elasticsearch.index.query.BoolQueryBuilder
;
import
org.elasticsearch.index.query.BoolQueryBuilder
;
import
org.elasticsearch.index.query.QueryBuilders
;
import
org.elasticsearch.index.query.QueryBuilders
;
import
org.elasticsearch.search.aggregations.AggregationBuilders
;
import
org.elasticsearch.search.aggregations.bucket.terms.Terms
;
import
org.elasticsearch.search.aggregations.bucket.terms.TermsAggregationBuilder
;
import
org.elasticsearch.search.builder.SearchSourceBuilder
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.ObjectUtils
;
...
@@ -166,13 +157,15 @@ public class AQZSDPStatisticsServiceImpl {
...
@@ -166,13 +157,15 @@ public class AQZSDPStatisticsServiceImpl {
public
Map
<
String
,
Object
>
getChildEarlyWarning
(
DPFilterParamDto
dpFilterParamDto
)
{
public
Map
<
String
,
Object
>
getChildEarlyWarning
(
DPFilterParamDto
dpFilterParamDto
)
{
List
<
RegionModel
>
regionModels
=
stCommonService
.
setRegionIfRootParentAndNoAccessIf3Level
(
dpFilterParamDto
.
getCityCode
());
List
<
RegionModel
>
regionModels
=
stCommonService
.
setRegionIfRootParentAndNoAccessIf3Level
(
dpFilterParamDto
.
getCityCode
());
Map
<
String
,
SecurityIndexCountItemDto
>
regionCodeSecurityIndexMap
=
getSecurityIndexCountItemDtoMap
(
regionModels
);
Map
<
String
,
SecurityIndexCountItemDto
>
regionCodeSecurityIndexMap
=
getSecurityIndexCountItemDtoMap
(
regionModels
);
Set
<
String
>
legendData
=
getLegendForCyArea
();
Set
<
Map
<
String
,
String
>
>
legendData
=
getLegendForCyArea
();
List
<
String
>
xuke
=
new
ArrayList
<>();
List
<
String
>
xuke
=
new
ArrayList
<>();
List
<
String
>
shiyongdengji
=
new
ArrayList
<>();
List
<
String
>
shiyongdengji
=
new
ArrayList
<>();
List
<
String
>
jianyanchaoqi
=
new
ArrayList
<>();
List
<
String
>
jianyanchaoqi
=
new
ArrayList
<>();
List
<
String
>
jianyanhege
=
new
ArrayList
<>();
List
<
String
>
jianyanhege
=
new
ArrayList
<>();
List
<
String
>
czjc
=
new
ArrayList
<>();
List
<
String
>
czjc
=
new
ArrayList
<>();
List
<
String
>
czjchege
=
new
ArrayList
<>();
List
<
String
>
czjchege
=
new
ArrayList
<>();
List
<
String
>
ryhg
=
new
ArrayList
<>();
List
<
String
>
sjhg
=
new
ArrayList
<>();
//TODO 多线程处理后,regionCodeSecurityIndexMap顺序与regionModels的顺序不一致,需让数据和x轴的顺序保存一致
//TODO 多线程处理后,regionCodeSecurityIndexMap顺序与regionModels的顺序不一致,需让数据和x轴的顺序保存一致
List
<
String
>
xdata
=
stCommonService
.
buildXData
(
regionModels
);
List
<
String
>
xdata
=
stCommonService
.
buildXData
(
regionModels
);
regionModels
.
forEach
(
r
->
{
regionModels
.
forEach
(
r
->
{
...
@@ -183,6 +176,8 @@ public class AQZSDPStatisticsServiceImpl {
...
@@ -183,6 +176,8 @@ public class AQZSDPStatisticsServiceImpl {
jianyanhege
.
add
(
this
.
castScore2Percent
(
countItemDto
.
getJianyanhege
()));
jianyanhege
.
add
(
this
.
castScore2Percent
(
countItemDto
.
getJianyanhege
()));
czjc
.
add
(
this
.
castScore2Percent
(
countItemDto
.
getCzjc
()));
czjc
.
add
(
this
.
castScore2Percent
(
countItemDto
.
getCzjc
()));
czjchege
.
add
(
this
.
castScore2Percent
(
countItemDto
.
getCzjchege
()));
czjchege
.
add
(
this
.
castScore2Percent
(
countItemDto
.
getCzjchege
()));
ryhg
.
add
(
this
.
castScore2Percent
(
countItemDto
.
getRyhg
()));
sjhg
.
add
(
this
.
castScore2Percent
(
countItemDto
.
getSjhg
()));
});
});
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
result
.
put
(
"xdata"
,
xdata
);
result
.
put
(
"xdata"
,
xdata
);
...
@@ -193,6 +188,8 @@ public class AQZSDPStatisticsServiceImpl {
...
@@ -193,6 +188,8 @@ public class AQZSDPStatisticsServiceImpl {
result
.
put
(
"jianyanhege"
,
jianyanhege
);
result
.
put
(
"jianyanhege"
,
jianyanhege
);
result
.
put
(
"czjc"
,
czjc
);
result
.
put
(
"czjc"
,
czjc
);
result
.
put
(
"czjchege"
,
czjchege
);
result
.
put
(
"czjchege"
,
czjchege
);
result
.
put
(
"ryhg"
,
ryhg
);
result
.
put
(
"sjhg"
,
sjhg
);
return
result
;
return
result
;
}
}
...
@@ -202,14 +199,37 @@ public class AQZSDPStatisticsServiceImpl {
...
@@ -202,14 +199,37 @@ public class AQZSDPStatisticsServiceImpl {
return
percent
.
toPlainString
();
return
percent
.
toPlainString
();
}
}
private
Set
<
String
>
getLegendForCyArea
()
{
private
Set
<
Map
<
String
,
String
>>
getLegendForCyArea
()
{
Set
<
String
>
legendData
=
new
HashSet
<>();
Set
<
Map
<
String
,
String
>>
legendData
=
new
HashSet
<>();
legendData
.
add
(
"许可有效率"
);
for
(
int
i
=
0
;
i
<
8
;
i
++)
{
legendData
.
add
(
"使用登记办理率"
);
Map
<
String
,
String
>
map
=
new
HashMap
<>();
legendData
.
add
(
"检验超期率"
);
if
(
i
==
0
)
{
legendData
.
add
(
"检验合格率"
);
map
.
put
(
"dataKey"
,
"xuke"
);
legendData
.
add
(
"充装检查率"
);
map
.
put
(
"value"
,
"许可有效率"
);
legendData
.
add
(
"充装检查合格率"
);
}
else
if
(
i
==
1
)
{
map
.
put
(
"dataKey"
,
"shiyongdengji"
);
map
.
put
(
"value"
,
"使用登记办理率"
);
}
else
if
(
i
==
2
)
{
map
.
put
(
"dataKey"
,
"jianyanchaoqi"
);
map
.
put
(
"value"
,
"检验超期率"
);
}
else
if
(
i
==
3
)
{
map
.
put
(
"dataKey"
,
"jianyanhege"
);
map
.
put
(
"value"
,
"检验合格率"
);
}
else
if
(
i
==
4
)
{
map
.
put
(
"dataKey"
,
"czjc"
);
map
.
put
(
"value"
,
"充装检查"
);
}
else
if
(
i
==
5
)
{
map
.
put
(
"dataKey"
,
"czjchege"
);
map
.
put
(
"value"
,
"充装检查合格率"
);
}
else
if
(
i
==
6
)
{
map
.
put
(
"dataKey"
,
"ryhg"
);
map
.
put
(
"value"
,
"人员合规率(资质有效期统计)"
);
}
else
if
(
i
==
7
)
{
map
.
put
(
"dataKey"
,
"sjhg"
);
map
.
put
(
"value"
,
"数据合规率"
);
}
legendData
.
add
(
map
);
}
return
legendData
;
return
legendData
;
}
}
...
@@ -219,20 +239,34 @@ public class AQZSDPStatisticsServiceImpl {
...
@@ -219,20 +239,34 @@ public class AQZSDPStatisticsServiceImpl {
Map
<
String
,
SecurityIndexCountItemDto
>
regionCodeSecurityIndexMap
=
getSecurityIndexCountItemDtoMap
(
regionModels
);
Map
<
String
,
SecurityIndexCountItemDto
>
regionCodeSecurityIndexMap
=
getSecurityIndexCountItemDtoMap
(
regionModels
);
List
<
Map
<
String
,
String
>>
data
=
new
ArrayList
<>();
List
<
Map
<
String
,
String
>>
data
=
new
ArrayList
<>();
List
<
Map
<
String
,
String
>>
finalData
=
data
;
List
<
Map
<
String
,
String
>>
finalData
=
data
;
/**
* 计算权重,总分100分:
* 检验超期率、检验合格率、充装检查率、充装检查合格率,占15%
* 许可有效率、使用登记办理率、人员合规率(资质有效期统计)、数据合规率,占10%
*/
double
weightTen
=
0.10
;
double
weightFifteen
=
0.15
;
regionCodeSecurityIndexMap
.
forEach
((
k
,
v
)
->
{
regionCodeSecurityIndexMap
.
forEach
((
k
,
v
)
->
{
Map
<
String
,
String
>
item
=
new
HashMap
<>();
Map
<
String
,
String
>
item
=
new
HashMap
<>();
item
.
put
(
"name"
,
v
.
getRegionName
());
item
.
put
(
"name"
,
v
.
getRegionName
());
// 计算xuke的加权值
// 许可有效率的加权值
double
xukeWeighted
=
Double
.
parseDouble
(
v
.
getXuke
())
*
0.10
;
double
xukeWeighted
=
Double
.
parseDouble
(
v
.
getXuke
())
*
weightTen
;
// 剩余权重平均分配给四个因素,每个因素大约22.5%(但为了简化,我们这里用25%的剩余权重)
// 使用登记办理率的加权值
double
remainingWeightPerFactor
=
0.90
/
4
;
double
sydjWeighted
=
Double
.
parseDouble
(
v
.
getShiyongdengji
())
*
weightTen
;
// 计算其他四个因素的加权值
// 人员合规率(资质有效期统计)的加权值
double
jianyanchaoqiWeighted
=
Double
.
parseDouble
(
v
.
getJianyanchaoqi
())
*
remainingWeightPerFactor
;
double
ryhgWeighted
=
Double
.
parseDouble
(
v
.
getRyhg
())
*
weightTen
;
double
jianyanhegeWeighted
=
Double
.
parseDouble
(
v
.
getJianyanhege
())
*
remainingWeightPerFactor
;
// 数据合规率的加权值
double
czjcWeighted
=
Double
.
parseDouble
(
v
.
getCzjc
())
*
remainingWeightPerFactor
;
double
sjhgWeighted
=
Double
.
parseDouble
(
v
.
getSjhg
())
*
weightTen
;
double
czjchegeWeighted
=
Double
.
parseDouble
(
v
.
getCzjchege
())
*
remainingWeightPerFactor
;
// 检验超期率的加权值
double
jianyanchaoqiWeighted
=
Double
.
parseDouble
(
v
.
getJianyanchaoqi
())
*
weightFifteen
;
// 检验合格率的加权值
double
jianyanhegeWeighted
=
Double
.
parseDouble
(
v
.
getJianyanhege
())
*
weightFifteen
;
// 充装检查率的加权值
double
czjcWeighted
=
Double
.
parseDouble
(
v
.
getCzjc
())
*
weightFifteen
;
// 充装检查合格率的加权值
double
czjchegeWeighted
=
Double
.
parseDouble
(
v
.
getCzjchege
())
*
weightFifteen
;
// 计算总指数
// 计算总指数
double
totalIndex
=
xukeWeighted
+
jianyanchaoqiWeighted
+
jianyanhegeWeighted
+
czjcWeighted
+
czjchegeWeighted
;
double
totalIndex
=
xukeWeighted
+
sydjWeighted
+
ryhgWeighted
+
sjhgWeighted
+
jianyanchaoqiWeighted
+
jianyanhegeWeighted
+
czjcWeighted
+
czjchegeWeighted
;
item
.
put
(
"value"
,
String
.
format
(
"%.2f"
,
totalIndex
));
item
.
put
(
"value"
,
String
.
format
(
"%.2f"
,
totalIndex
));
finalData
.
add
(
item
);
finalData
.
add
(
item
);
});
});
...
@@ -303,6 +337,11 @@ public class AQZSDPStatisticsServiceImpl {
...
@@ -303,6 +337,11 @@ public class AQZSDPStatisticsServiceImpl {
}
else
{
}
else
{
countItemDto
.
setCzjchege
(
"0"
);
countItemDto
.
setCzjchege
(
"0"
);
}
}
// todo: 7.人员合规率(资质有效期统计) 8.数据合规率需求未明确暂时都为0
// 7.人员合规率(资质有效期统计)
countItemDto
.
setRyhg
(
"0"
);
// 8.数据合规率
countItemDto
.
setSjhg
(
"0"
);
}
}
return
countItemDto
;
return
countItemDto
;
}).
collect
(
Collectors
.
toList
());
}).
collect
(
Collectors
.
toList
());
...
...
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