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
6712e6b8
Commit
6712e6b8
authored
Jul 10, 2024
by
麻笑宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
大屏统计方法提交
1. 企业统计(完成) 2. 人员统计(完成) 3. 检验检测机构统计(完成) 5. 行业主管部门分布(完成)
parent
ee41c37f
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
453 additions
and
10 deletions
+453
-10
ScreenMapper.java
...yeejoin/amos/boot/module/tcm/api/mapper/ScreenMapper.java
+6
-0
IScreenService.java
...oot/module/tcm/api/service/statistics/IScreenService.java
+7
-0
ScreenMapper.xml
...module-tcm-api/src/main/resources/mapper/ScreenMapper.xml
+36
-0
ScreenController.java
...le/tcm/biz/controller/statistics/dp/ScreenController.java
+28
-1
ScreenImpl.java
...ot/module/tcm/biz/service/impl/statistics/ScreenImpl.java
+376
-9
No files found.
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-api/src/main/java/com/yeejoin/amos/boot/module/tcm/api/mapper/ScreenMapper.java
View file @
6712e6b8
...
@@ -18,4 +18,10 @@ public interface ScreenMapper {
...
@@ -18,4 +18,10 @@ public interface ScreenMapper {
List
<
Map
<
String
,
Object
>>
getCompanyInfo
(
@Param
(
"screenDto"
)
ScreenDto
screenDto
);
List
<
Map
<
String
,
Object
>>
getCompanyInfo
(
@Param
(
"screenDto"
)
ScreenDto
screenDto
);
List
<
Map
<
String
,
Object
>>
testOrg
(
@Param
(
"screenDto"
)
ScreenDto
screenDto
);
List
<
Map
<
String
,
String
>>
userCount
(
@Param
(
"screenDto"
)
ScreenDto
screenDto
);
List
<
Map
<
String
,
Object
>>
supervisorCount
(
@Param
(
"screenDto"
)
ScreenDto
screenDto
);
}
}
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-api/src/main/java/com/yeejoin/amos/boot/module/tcm/api/service/statistics/IScreenService.java
View file @
6712e6b8
...
@@ -21,4 +21,11 @@ import java.util.Map;
...
@@ -21,4 +21,11 @@ import java.util.Map;
public
interface
IScreenService
{
public
interface
IScreenService
{
List
<
Map
<
String
,
Object
>>
companyInfo
(
ScreenDto
screenDto
);
List
<
Map
<
String
,
Object
>>
companyInfo
(
ScreenDto
screenDto
);
List
<
Map
<
String
,
Object
>>
testOrg
(
ScreenDto
screenDto
);
Map
<
String
,
Object
>
userCount
(
ScreenDto
screenDto
);
Map
<
String
,
Object
>
supervisorCount
(
ScreenDto
screenDto
);
Map
<
String
,
Object
>
equipmentInformCount
(
ScreenDto
screenDto
);
}
}
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-api/src/main/resources/mapper/ScreenMapper.xml
View file @
6712e6b8
...
@@ -13,6 +13,42 @@
...
@@ -13,6 +13,42 @@
JOIN tz_base_enterprise_info bi ON bi.supervise_org_code LIKE CONCAT(subquery.org_code, '%')
JOIN tz_base_enterprise_info bi ON bi.supervise_org_code LIKE CONCAT(subquery.org_code, '%')
where bi.equip_category is not null and bi.equip_category != '[]' and bi.unit_type is not null;
where bi.equip_category is not null and bi.equip_category != '[]' and bi.unit_type is not null;
</select>
</select>
<select
id=
"testOrg"
resultType=
"java.util.Map"
>
SELECT COUNT(1),
bul.agency_type as agencyType
FROM
( SELECT org_code FROM privilege_company WHERE company_code = #{screenDto.cityCode} ) AS subquery
INNER JOIN tz_base_enterprise_info bi ON bi.supervise_org_code LIKE CONCAT ( subquery.org_code, '%' )
INNER JOIN tz_base_unit_licence bul ON bul.unit_code = bi.use_unit_code
WHERE
bi.unit_type LIKE concat ( '%', '检验检测机构', '%' )
AND bul.agency_type IS NOT NULL
GROUP BY
bul.agency_type
</select>
<select
id=
"userCount"
resultType=
"java.util.Map"
>
SELECT
bi.unit_type as unitType
FROM
( SELECT org_code FROM privilege_company WHERE company_code = #{screenDto.cityCode} ) AS subquery
INNER JOIN tz_base_enterprise_info bi ON bi.supervise_org_code LIKE CONCAT ( subquery.org_code, '%' )
INNER JOIN tzs_user_info tui ON bi.use_unit_code = tui.unit_code
WHERE
tui.post LIKE concat ( '%', '6552', '%' )
AND bi.unit_type IS NOT NULL;
</select>
<select
id=
"supervisorCount"
resultType=
"java.util.Map"
>
SELECT
COUNT(1),
bi.industry_supervisor as industrySupervisor
FROM
( SELECT org_code FROM privilege_company WHERE company_code = #{screenDto.cityCode} ) AS subquery
INNER JOIN tz_base_enterprise_info bi ON bi.supervise_org_code LIKE CONCAT ( subquery.org_code, '%' )
WHERE
bi.industry_supervisor IS NOT NULL
GROUP BY
bi.industry_supervisor
</select>
</mapper>
</mapper>
...
...
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-biz/src/main/java/com/yeejoin/amos/boot/module/tcm/biz/controller/statistics/dp/ScreenController.java
View file @
6712e6b8
...
@@ -24,7 +24,7 @@ import java.util.Map;
...
@@ -24,7 +24,7 @@ import java.util.Map;
* @date 2024-07-09
* @date 2024-07-09
*/
*/
@RestController
@RestController
@Api
(
tags
=
"
警情接警填报记录Api
"
)
@Api
(
tags
=
"
大屏企业统计
"
)
@RequestMapping
(
value
=
"/statistics"
)
@RequestMapping
(
value
=
"/statistics"
)
public
class
ScreenController
{
public
class
ScreenController
{
@Resource
@Resource
...
@@ -36,4 +36,31 @@ public class ScreenController {
...
@@ -36,4 +36,31 @@ public class ScreenController {
return
ResponseHelper
.
buildResponse
(
screenService
.
companyInfo
(
screenDto
));
return
ResponseHelper
.
buildResponse
(
screenService
.
companyInfo
(
screenDto
));
}
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/testOrg"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"大屏检测机构统计"
,
notes
=
"大屏检测机构统计"
)
public
ResponseModel
<
List
<
Map
<
String
,
Object
>>>
testOrg
(
@RequestBody
ScreenDto
screenDto
){
return
ResponseHelper
.
buildResponse
(
screenService
.
testOrg
(
screenDto
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/userCount"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"大屏人员统计"
,
notes
=
"大屏人员统计"
)
public
ResponseModel
<
Map
<
String
,
Object
>>
userCount
(
@RequestBody
ScreenDto
screenDto
){
return
ResponseHelper
.
buildResponse
(
screenService
.
userCount
(
screenDto
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/supervisorCount"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"大屏行业主管部门统计"
,
notes
=
"大屏行业主管部门统计"
)
public
ResponseModel
<
Map
<
String
,
Object
>>
supervisorCount
(
@RequestBody
ScreenDto
screenDto
){
return
ResponseHelper
.
buildResponse
(
screenService
.
supervisorCount
(
screenDto
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/equipmentInformCount"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"大屏设备使用场所统计"
,
notes
=
"大屏设备使用场所统计"
)
public
ResponseModel
<
Map
<
String
,
Object
>>
equipmentInformCount
(
@RequestBody
ScreenDto
screenDto
){
return
ResponseHelper
.
buildResponse
(
screenService
.
equipmentInformCount
(
screenDto
));
}
}
}
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-biz/src/main/java/com/yeejoin/amos/boot/module/tcm/biz/service/impl/statistics/ScreenImpl.java
View file @
6712e6b8
...
@@ -4,11 +4,25 @@ import com.alibaba.fastjson.JSONArray;
...
@@ -4,11 +4,25 @@ import com.alibaba.fastjson.JSONArray;
import
com.yeejoin.amos.boot.module.tcm.api.dto.ScreenDto
;
import
com.yeejoin.amos.boot.module.tcm.api.dto.ScreenDto
;
import
com.yeejoin.amos.boot.module.tcm.api.mapper.ScreenMapper
;
import
com.yeejoin.amos.boot.module.tcm.api.mapper.ScreenMapper
;
import
com.yeejoin.amos.boot.module.tcm.api.service.statistics.IScreenService
;
import
com.yeejoin.amos.boot.module.tcm.api.service.statistics.IScreenService
;
import
org.elasticsearch.action.search.SearchRequest
;
import
org.elasticsearch.action.search.SearchResponse
;
import
org.elasticsearch.client.RequestOptions
;
import
org.elasticsearch.client.RestHighLevelClient
;
import
org.elasticsearch.index.query.FuzzyQueryBuilder
;
import
org.elasticsearch.index.query.MatchQueryBuilder
;
import
org.elasticsearch.index.query.QueryBuilders
;
import
org.elasticsearch.search.aggregations.Aggregation
;
import
org.elasticsearch.search.aggregations.AggregationBuilders
;
import
org.elasticsearch.search.aggregations.Aggregations
;
import
org.elasticsearch.search.aggregations.metrics.ParsedCardinality
;
import
org.elasticsearch.search.aggregations.metrics.Sum
;
import
org.elasticsearch.search.builder.SearchSourceBuilder
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.CollectionUtils
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.io.IOException
;
import
java.util.*
;
import
java.util.*
;
@Service
@Service
...
@@ -17,13 +31,14 @@ public class ScreenImpl implements IScreenService {
...
@@ -17,13 +31,14 @@ public class ScreenImpl implements IScreenService {
@Resource
@Resource
private
ScreenMapper
screenMapper
;
private
ScreenMapper
screenMapper
;
@Autowired
RestHighLevelClient
restHighLevelClient
;
@Override
@Override
public
List
<
Map
<
String
,
Object
>>
companyInfo
(
ScreenDto
screenDto
)
{
public
List
<
Map
<
String
,
Object
>>
companyInfo
(
ScreenDto
screenDto
)
{
List
<
Map
<
String
,
Object
>>
list
=
screenMapper
.
getCompanyInfo
(
screenDto
);
List
<
Map
<
String
,
Object
>>
list
=
screenMapper
.
getCompanyInfo
(
screenDto
);
if
(
CollectionUtils
.
isEmpty
(
list
)){
List
<
Map
<
String
,
Object
>>
returnList
=
new
ArrayList
<>();
return
list
;
}
//数据处理后Map,key为企业类型+设备,value为计数
//数据处理后Map,key为企业类型+设备,value为计数
Map
<
String
,
Integer
>
dataMap
=
new
HashMap
<>();
Map
<
String
,
Integer
>
dataMap
=
new
HashMap
<>();
for
(
Map
<
String
,
Object
>
map
:
list
){
for
(
Map
<
String
,
Object
>
map
:
list
){
...
@@ -48,11 +63,92 @@ public class ScreenImpl implements IScreenService {
...
@@ -48,11 +63,92 @@ public class ScreenImpl implements IScreenService {
* 2000 压力容器
* 2000 压力容器
* 6000 大型游乐设施(B类)
* 6000 大型游乐设施(B类)
* 9000 客运索道
* 9000 客运索道
*企业数量:按单位类型及单位管理的设备进行统计(按设备类型收集制造单位数量,省、市-李静):八大类制造单位(不要气瓶)、电梯维保单位、八大类使用单位(不要气瓶)、气瓶充装单位、八大类安改维单位(不要气瓶)、八大类设计单位(不要气瓶)
* 8000 压力管道
* 1、设计单位只有压力容器设计和压力管道设计两类;(没有数据显示0)
* 3、安改维有锅炉、压力管道、电梯、起重机械、客运索道、场(厂)内专用机动车辆、大型游乐设施7类;
* 4、充装单位有移动式压力容器、气瓶两类(所有充装企业都统计为气瓶类型)
*/
*/
//充装Map
Map
<
String
,
Object
>
chongzhuangMap
=
new
HashMap
<>();
List
<
Map
<
String
,
Object
>>
chongzhuangCompanyList
=
new
ArrayList
<>();
chongzhuangMap
.
put
(
"key"
,
"chongzhuangCompany"
);
chongzhuangMap
.
put
(
"value"
,
"充装单位"
);
//充装压力容器
Map
<
String
,
Object
>
chongzhuangyalirongqiMap
=
new
HashMap
<>();
chongzhuangyalirongqiMap
.
put
(
"key"
,
"key04"
);
chongzhuangyalirongqiMap
.
put
(
"name"
,
"气瓶"
);
chongzhuangyalirongqiMap
.
put
(
"value"
,
dataMap
.
getOrDefault
(
"充装单位2000"
,
0
));
chongzhuangCompanyList
.
add
(
chongzhuangyalirongqiMap
);
chongzhuangMap
.
put
(
"data"
,
chongzhuangCompanyList
);
//安改维Map
Map
<
String
,
Object
>
angaiweiMap
=
new
HashMap
<>();
List
<
Map
<
String
,
Object
>>
angaiweiCompanyList
=
new
ArrayList
<>();
angaiweiMap
.
put
(
"key"
,
"angaiweiCompany"
);
angaiweiMap
.
put
(
"value"
,
"安改维单位"
);
//安改维电梯
Map
<
String
,
Object
>
angaiweidiantiMap
=
new
HashMap
<>();
angaiweidiantiMap
.
put
(
"key"
,
"key01"
);
angaiweidiantiMap
.
put
(
"name"
,
"电梯"
);
angaiweidiantiMap
.
put
(
"value"
,
dataMap
.
getOrDefault
(
"安装改造维修单位3000"
,
0
));
angaiweiCompanyList
.
add
(
angaiweidiantiMap
);
//安改维锅炉
Map
<
String
,
Object
>
angaiweiguoluMap
=
new
HashMap
<>();
angaiweiguoluMap
.
put
(
"key"
,
"key02"
);
angaiweiguoluMap
.
put
(
"name"
,
"锅炉"
);
angaiweiguoluMap
.
put
(
"value"
,
dataMap
.
getOrDefault
(
"安装改造维修单位1000"
,
0
));
angaiweiCompanyList
.
add
(
angaiweiguoluMap
);
//安改维场内机动车
Map
<
String
,
Object
>
angaiweijidongcheMap
=
new
HashMap
<>();
angaiweijidongcheMap
.
put
(
"key"
,
"key03"
);
angaiweijidongcheMap
.
put
(
"name"
,
"场内机动车"
);
angaiweijidongcheMap
.
put
(
"value"
,
dataMap
.
getOrDefault
(
"安装改造维修单位5000"
,
0
));
angaiweiCompanyList
.
add
(
angaiweijidongcheMap
);
//安改维压力管道
Map
<
String
,
Object
>
angaiweiyaliguandaoMap
=
new
HashMap
<>();
angaiweiyaliguandaoMap
.
put
(
"key"
,
"key05"
);
angaiweiyaliguandaoMap
.
put
(
"name"
,
"压力管道"
);
angaiweiyaliguandaoMap
.
put
(
"value"
,
dataMap
.
getOrDefault
(
"安装改造维修单位9000"
,
0
));
angaiweiCompanyList
.
add
(
angaiweiyaliguandaoMap
);
//安改维起重机械
Map
<
String
,
Object
>
angaiweiqizhongjixieMap
=
new
HashMap
<>();
angaiweiqizhongjixieMap
.
put
(
"key"
,
"key06"
);
angaiweiqizhongjixieMap
.
put
(
"name"
,
"起重机械"
);
angaiweiqizhongjixieMap
.
put
(
"value"
,
dataMap
.
getOrDefault
(
"安装改造维修单位4000"
,
0
));
angaiweiCompanyList
.
add
(
angaiweiqizhongjixieMap
);
//安改维游乐设施
Map
<
String
,
Object
>
angaiweiyoulesheshiMap
=
new
HashMap
<>();
angaiweiyoulesheshiMap
.
put
(
"key"
,
"key07"
);
angaiweiyoulesheshiMap
.
put
(
"name"
,
"大型游乐设施"
);
angaiweiyoulesheshiMap
.
put
(
"value"
,
dataMap
.
getOrDefault
(
"安装改造维修单位6000"
,
0
));
angaiweiCompanyList
.
add
(
angaiweiyoulesheshiMap
);
//安改维客运索道
Map
<
String
,
Object
>
angaiweikeyunsuodaoMap
=
new
HashMap
<>();
angaiweikeyunsuodaoMap
.
put
(
"key"
,
"key08"
);
angaiweikeyunsuodaoMap
.
put
(
"name"
,
"客运索道"
);
angaiweikeyunsuodaoMap
.
put
(
"value"
,
dataMap
.
getOrDefault
(
"安装改造维修单位9000"
,
0
));
angaiweiCompanyList
.
add
(
angaiweikeyunsuodaoMap
);
angaiweiMap
.
put
(
"data"
,
angaiweiCompanyList
);
//设计Map
Map
<
String
,
Object
>
shejiMap
=
new
HashMap
<>();
List
<
Map
<
String
,
Object
>>
shejiCompanyList
=
new
ArrayList
<>();
shejiMap
.
put
(
"key"
,
"shejiCompany"
);
shejiMap
.
put
(
"value"
,
"设计单位"
);
//设计压力容器
Map
<
String
,
Object
>
shejiyalirongqiMap
=
new
HashMap
<>();
shejiyalirongqiMap
.
put
(
"key"
,
"key04"
);
shejiyalirongqiMap
.
put
(
"name"
,
"压力容器"
);
shejiyalirongqiMap
.
put
(
"value"
,
dataMap
.
getOrDefault
(
"设计单位2000"
,
0
));
shejiCompanyList
.
add
(
shejiyalirongqiMap
);
//设计压力管道
Map
<
String
,
Object
>
shejiyaliguandaoMap
=
new
HashMap
<>();
shejiyaliguandaoMap
.
put
(
"key"
,
"key05"
);
shejiyaliguandaoMap
.
put
(
"name"
,
"压力管道"
);
shejiyaliguandaoMap
.
put
(
"value"
,
dataMap
.
getOrDefault
(
"设计单位8000"
,
0
));
shejiCompanyList
.
add
(
shejiyaliguandaoMap
);
shejiMap
.
put
(
"data"
,
shejiCompanyList
);
//制造Map
//制造Map
Map
<
String
,
Object
>
zhizaoMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
zhizaoMap
=
new
HashMap
<>();
List
<
Map
<
String
,
Object
>>
zhizaoCompanyList
=
new
ArrayList
<>();
List
<
Map
<
String
,
Object
>>
zhizaoCompanyList
=
new
ArrayList
<>();
...
@@ -101,7 +197,278 @@ public class ScreenImpl implements IScreenService {
...
@@ -101,7 +197,278 @@ public class ScreenImpl implements IScreenService {
zhizaokeyunsuodaoMap
.
put
(
"value"
,
dataMap
.
getOrDefault
(
"制造单位9000"
,
0
));
zhizaokeyunsuodaoMap
.
put
(
"value"
,
dataMap
.
getOrDefault
(
"制造单位9000"
,
0
));
zhizaoCompanyList
.
add
(
zhizaokeyunsuodaoMap
);
zhizaoCompanyList
.
add
(
zhizaokeyunsuodaoMap
);
zhizaoMap
.
put
(
"data"
,
zhizaoCompanyList
);
zhizaoMap
.
put
(
"data"
,
zhizaoCompanyList
);
return
null
;
//使用Map
Map
<
String
,
Object
>
shiyongMap
=
new
HashMap
<>();
List
<
Map
<
String
,
Object
>>
shiyongCompanyList
=
new
ArrayList
<>();
shiyongMap
.
put
(
"key"
,
"shiyongCompany"
);
shiyongMap
.
put
(
"value"
,
"使用单位"
);
//使用电梯
Map
<
String
,
Object
>
shiyongdiantiMap
=
new
HashMap
<>();
shiyongdiantiMap
.
put
(
"key"
,
"key01"
);
shiyongdiantiMap
.
put
(
"name"
,
"电梯"
);
shiyongdiantiMap
.
put
(
"value"
,
dataMap
.
getOrDefault
(
"使用单位3000"
,
0
));
shiyongCompanyList
.
add
(
shiyongdiantiMap
);
//使用锅炉
Map
<
String
,
Object
>
shiyongguoluMap
=
new
HashMap
<>();
shiyongguoluMap
.
put
(
"key"
,
"key02"
);
shiyongguoluMap
.
put
(
"name"
,
"锅炉"
);
shiyongguoluMap
.
put
(
"value"
,
dataMap
.
getOrDefault
(
"使用单位1000"
,
0
));
shiyongCompanyList
.
add
(
shiyongguoluMap
);
//使用锅炉
Map
<
String
,
Object
>
shiyongjidongcheMap
=
new
HashMap
<>();
shiyongjidongcheMap
.
put
(
"key"
,
"key03"
);
shiyongjidongcheMap
.
put
(
"name"
,
"场内机动车"
);
shiyongjidongcheMap
.
put
(
"value"
,
dataMap
.
getOrDefault
(
"使用单位5000"
,
0
));
shiyongCompanyList
.
add
(
shiyongjidongcheMap
);
//使用压力容器
Map
<
String
,
Object
>
shiyongyalirongqiMap
=
new
HashMap
<>();
shiyongyalirongqiMap
.
put
(
"key"
,
"key04"
);
shiyongyalirongqiMap
.
put
(
"name"
,
"压力容器"
);
shiyongyalirongqiMap
.
put
(
"value"
,
dataMap
.
getOrDefault
(
"使用单位2000"
,
0
));
shiyongCompanyList
.
add
(
shiyongyalirongqiMap
);
//使用压力管道
Map
<
String
,
Object
>
shiyongyaliguandaoMap
=
new
HashMap
<>();
shiyongyaliguandaoMap
.
put
(
"key"
,
"key05"
);
shiyongyaliguandaoMap
.
put
(
"name"
,
"压力管道"
);
shiyongyaliguandaoMap
.
put
(
"value"
,
dataMap
.
getOrDefault
(
"使用单位9000"
,
0
));
shiyongCompanyList
.
add
(
shiyongyaliguandaoMap
);
//使用起重机械
Map
<
String
,
Object
>
shiyongqizhongjixieMap
=
new
HashMap
<>();
shiyongqizhongjixieMap
.
put
(
"key"
,
"key06"
);
shiyongqizhongjixieMap
.
put
(
"name"
,
"起重机械"
);
shiyongqizhongjixieMap
.
put
(
"value"
,
dataMap
.
getOrDefault
(
"使用单位4000"
,
0
));
shiyongCompanyList
.
add
(
shiyongqizhongjixieMap
);
//使用游乐设施
Map
<
String
,
Object
>
shiyongyoulesheshiMap
=
new
HashMap
<>();
shiyongyoulesheshiMap
.
put
(
"key"
,
"key07"
);
shiyongyoulesheshiMap
.
put
(
"name"
,
"大型游乐设施"
);
shiyongyoulesheshiMap
.
put
(
"value"
,
dataMap
.
getOrDefault
(
"使用单位6000"
,
0
));
shiyongCompanyList
.
add
(
shiyongyoulesheshiMap
);
//使用客运索道
Map
<
String
,
Object
>
shiyongkeyunsuodaoMap
=
new
HashMap
<>();
shiyongkeyunsuodaoMap
.
put
(
"key"
,
"key08"
);
shiyongkeyunsuodaoMap
.
put
(
"name"
,
"客运索道"
);
shiyongkeyunsuodaoMap
.
put
(
"value"
,
dataMap
.
getOrDefault
(
"使用单位9000"
,
0
));
shiyongCompanyList
.
add
(
shiyongkeyunsuodaoMap
);
shiyongMap
.
put
(
"data"
,
shiyongCompanyList
);
returnList
.
add
(
zhizaoMap
);
returnList
.
add
(
angaiweiMap
);
returnList
.
add
(
shiyongMap
);
returnList
.
add
(
shejiMap
);
returnList
.
add
(
chongzhuangMap
);
return
returnList
;
}
@Override
public
List
<
Map
<
String
,
Object
>>
testOrg
(
ScreenDto
screenDto
)
{
List
<
Map
<
String
,
Object
>>
list
=
screenMapper
.
testOrg
(
screenDto
);
List
<
Map
<
String
,
Object
>>
returnList
=
new
ArrayList
<>();
Map
<
String
,
Object
>
dataMap
=
new
HashMap
<>();
for
(
int
i
=
0
;
i
<
list
.
size
();
i
++){
dataMap
.
put
((
String
)
list
.
get
(
i
).
get
(
"agencyType"
),
list
.
get
(
i
).
get
(
"count"
));
}
/**
* 1 甲类检验机构A1级
* 2 甲类检验机构A2级
* 4 甲类检验机构B1级
* 5 甲类检验机构B2级
* 6 乙类检验机构
* 7 丙类检验机构
* 8 检测机构
* 9 综合检验机构甲类(旧规)
* 10 综合检验机构乙类(旧规)
* 11 综合检验机构丙类(旧规)
* 12 自检机构(旧规)
* 13 气瓶检验机构(旧规)
* 14 无损检测机构(旧规)
*/
Map
<
String
,
Object
>
newMap
=
new
HashMap
<>();
newMap
.
put
(
"key"
,
"new"
);
newMap
.
put
(
"name"
,
"新分类"
);
List
<
Map
<
String
,
Object
>>
newList
=
new
ArrayList
<>();
Map
<
String
,
Object
>
newMap1
=
new
HashMap
<>();
newMap1
.
put
(
"name"
,
"甲类检验机构A1级"
);
newMap1
.
put
(
"value"
,
dataMap
.
getOrDefault
(
"1"
,
0
));
newList
.
add
(
newMap1
);
Map
<
String
,
Object
>
newMap2
=
new
HashMap
<>();
newMap2
.
put
(
"name"
,
"甲类检验机构A2级"
);
newMap2
.
put
(
"value"
,
dataMap
.
getOrDefault
(
"2"
,
0
));
newList
.
add
(
newMap2
);
Map
<
String
,
Object
>
newMap3
=
new
HashMap
<>();
newMap3
.
put
(
"name"
,
"甲类检验机构B1级"
);
newMap3
.
put
(
"value"
,
dataMap
.
getOrDefault
(
"4"
,
0
));
newList
.
add
(
newMap3
);
Map
<
String
,
Object
>
newMap4
=
new
HashMap
<>();
newMap4
.
put
(
"name"
,
"甲类检验机构B2级"
);
newMap4
.
put
(
"value"
,
dataMap
.
getOrDefault
(
"5"
,
0
));
newList
.
add
(
newMap4
);
Map
<
String
,
Object
>
newMap5
=
new
HashMap
<>();
newMap5
.
put
(
"name"
,
"乙类检验机构"
);
newMap5
.
put
(
"value"
,
dataMap
.
getOrDefault
(
"6"
,
0
));
newList
.
add
(
newMap5
);
Map
<
String
,
Object
>
newMap6
=
new
HashMap
<>();
newMap6
.
put
(
"name"
,
"丙类检验机构"
);
newMap6
.
put
(
"value"
,
dataMap
.
getOrDefault
(
"7"
,
0
));
newList
.
add
(
newMap6
);
Map
<
String
,
Object
>
newMap7
=
new
HashMap
<>();
newMap7
.
put
(
"name"
,
"检测机构"
);
newMap7
.
put
(
"value"
,
dataMap
.
getOrDefault
(
"8"
,
0
));
newList
.
add
(
newMap7
);
newMap
.
put
(
"data"
,
newList
);
Map
<
String
,
Object
>
oldMap
=
new
HashMap
<>();
oldMap
.
put
(
"key"
,
"old"
);
oldMap
.
put
(
"name"
,
"旧分类"
);
List
<
Map
<
String
,
Object
>>
oldList
=
new
ArrayList
<>();
Map
<
String
,
Object
>
oldMap1
=
new
HashMap
<>();
oldMap1
.
put
(
"name"
,
"综合检验机构甲类(旧规)"
);
oldMap1
.
put
(
"value"
,
dataMap
.
getOrDefault
(
"9"
,
0
));
oldList
.
add
(
oldMap1
);
Map
<
String
,
Object
>
oldMap2
=
new
HashMap
<>();
oldMap2
.
put
(
"name"
,
"综合检验机构乙类(旧规)"
);
oldMap2
.
put
(
"value"
,
dataMap
.
getOrDefault
(
"10"
,
0
));
oldList
.
add
(
oldMap2
);
Map
<
String
,
Object
>
oldMap3
=
new
HashMap
<>();
oldMap3
.
put
(
"name"
,
"综合检验机构丙类(旧规)"
);
oldMap3
.
put
(
"value"
,
dataMap
.
getOrDefault
(
"11"
,
0
));
oldList
.
add
(
oldMap3
);
Map
<
String
,
Object
>
oldMap4
=
new
HashMap
<>();
oldMap4
.
put
(
"name"
,
"自检机构(旧规)"
);
oldMap4
.
put
(
"value"
,
dataMap
.
getOrDefault
(
"12"
,
0
));
oldList
.
add
(
oldMap4
);
Map
<
String
,
Object
>
oldMap5
=
new
HashMap
<>();
oldMap5
.
put
(
"name"
,
"气瓶检验机构(旧规)"
);
oldMap5
.
put
(
"value"
,
dataMap
.
getOrDefault
(
"13"
,
0
));
oldList
.
add
(
oldMap5
);
Map
<
String
,
Object
>
oldMap6
=
new
HashMap
<>();
oldMap6
.
put
(
"name"
,
"无损检测机构(旧规)"
);
oldMap6
.
put
(
"value"
,
dataMap
.
getOrDefault
(
"14"
,
0
));
oldList
.
add
(
oldMap6
);
oldMap
.
put
(
"data"
,
oldList
);
returnList
.
add
(
newMap
);
returnList
.
add
(
oldMap
);
return
returnList
;
}
@Override
public
Map
<
String
,
Object
>
userCount
(
ScreenDto
screenDto
)
{
List
<
Map
<
String
,
String
>>
list
=
screenMapper
.
userCount
(
screenDto
);
Map
<
String
,
Integer
>
dataMap
=
new
HashMap
<>();
for
(
Map
<
String
,
String
>
map
:
list
){
String
[]
split
=
map
.
get
(
"unitType"
).
split
(
"#"
);
for
(
int
i
=
0
;
i
<
split
.
length
;
i
++){
if
(
dataMap
.
containsKey
(
split
[
i
])){
dataMap
.
put
(
split
[
i
],
dataMap
.
get
(
split
[
i
])+
1
);
}
else
{
dataMap
.
put
(
split
[
i
],
1
);
}
}
}
List
<
String
>
xlist
=
new
ArrayList
();
xlist
.
add
(
"制造单位"
);
xlist
.
add
(
"安改维单位"
);
xlist
.
add
(
"使用单位"
);
xlist
.
add
(
"设计单位"
);
xlist
.
add
(
"充装单位"
);
List
<
Integer
>
ylist
=
new
ArrayList
();
ylist
.
add
(
dataMap
.
getOrDefault
(
"制造单位"
,
0
));
ylist
.
add
(
dataMap
.
getOrDefault
(
"安装改造维修单位"
,
0
));
ylist
.
add
(
dataMap
.
getOrDefault
(
"使用单位"
,
0
));
ylist
.
add
(
dataMap
.
getOrDefault
(
"设计单位"
,
0
));
ylist
.
add
(
dataMap
.
getOrDefault
(
"充装单位"
,
0
));
Map
<
String
,
Object
>
returnMap
=
new
HashMap
<>();
returnMap
.
put
(
"xdata"
,
xlist
);
returnMap
.
put
(
"ydata"
,
ylist
);
return
returnMap
;
}
@Override
public
Map
<
String
,
Object
>
supervisorCount
(
ScreenDto
screenDto
)
{
List
<
Map
<
String
,
Object
>>
list
=
screenMapper
.
supervisorCount
(
screenDto
);
Map
<
String
,
Integer
>
dataMap
=
new
HashMap
<>();
for
(
Map
<
String
,
Object
>
map
:
list
){
dataMap
.
put
((
String
)
map
.
get
(
"industrySupervisor"
),
Integer
.
valueOf
(
map
.
get
(
"count"
).
toString
()));
}
/**
* 6513 公安
* 6515 能源电力
* 6516 商务
* 6517 应急管理(危化品)
* 6519 文化和旅游
* 6520 卫健
* 6521 教育
* 6522 住建
* 6523 工信
* 6524 交通运输
* 6526 国资
* 6527 其他
* 6525 农业
* 6514 林业
* 6518 消防
*/
List
<
String
>
xlist
=
new
ArrayList
();
xlist
.
add
(
"公安"
);
xlist
.
add
(
"能源电力"
);
xlist
.
add
(
"商务"
);
xlist
.
add
(
"应急管理(危化品)"
);
xlist
.
add
(
"文化和旅游"
);
xlist
.
add
(
"卫健"
);
xlist
.
add
(
"教育"
);
xlist
.
add
(
"住建"
);
xlist
.
add
(
"工信"
);
xlist
.
add
(
"交通运输"
);
xlist
.
add
(
"国资"
);
xlist
.
add
(
"其他"
);
xlist
.
add
(
"农业"
);
xlist
.
add
(
"林业"
);
xlist
.
add
(
"消防"
);
List
<
Object
>
ylist
=
new
ArrayList
();
ylist
.
add
(
dataMap
.
getOrDefault
(
"6513"
,
0
));
ylist
.
add
(
dataMap
.
getOrDefault
(
"6515"
,
0
));
ylist
.
add
(
dataMap
.
getOrDefault
(
"6516"
,
0
));
ylist
.
add
(
dataMap
.
getOrDefault
(
"6517"
,
0
));
ylist
.
add
(
dataMap
.
getOrDefault
(
"6519"
,
0
));
ylist
.
add
(
dataMap
.
getOrDefault
(
"6520"
,
0
));
ylist
.
add
(
dataMap
.
getOrDefault
(
"6521"
,
0
));
ylist
.
add
(
dataMap
.
getOrDefault
(
"6522"
,
0
));
ylist
.
add
(
dataMap
.
getOrDefault
(
"6523"
,
0
));
ylist
.
add
(
dataMap
.
getOrDefault
(
"6524"
,
0
));
ylist
.
add
(
dataMap
.
getOrDefault
(
"6526"
,
0
));
ylist
.
add
(
dataMap
.
getOrDefault
(
"6527"
,
0
));
ylist
.
add
(
dataMap
.
getOrDefault
(
"6525"
,
0
));
ylist
.
add
(
dataMap
.
getOrDefault
(
"6514"
,
0
));
ylist
.
add
(
dataMap
.
getOrDefault
(
"6518"
,
0
));
Map
<
String
,
Object
>
returnMap
=
new
HashMap
<>();
returnMap
.
put
(
"xdata"
,
xlist
);
returnMap
.
put
(
"ydata"
,
ylist
);
return
returnMap
;
}
@Override
public
Map
<
String
,
Object
>
equipmentInformCount
(
ScreenDto
screenDto
)
{
SearchRequest
searchRequest
=
new
SearchRequest
(
"idx_biz_view_jg_all"
);
SearchSourceBuilder
searchSourceBuilder
=
new
SearchSourceBuilder
();
//设置模糊搜索
FuzzyQueryBuilder
queryBuilder
=
QueryBuilders
.
fuzzyQuery
(
"USE_REGION_CODE;"
,
screenDto
.
getCityCode
());
searchSourceBuilder
.
query
(
queryBuilder
);
searchSourceBuilder
.
aggregation
(
AggregationBuilders
.
filter
(
"usePlaceCodeExists"
,
QueryBuilders
.
existsQuery
(
"USE_PLACE_CODE"
))
.
subAggregation
(
AggregationBuilders
.
terms
(
"USE_PLACE_CODE"
).
field
(
"USE_PLACE_CODE.keyword"
).
size
(
10
))
);
searchRequest
.
source
(
searchSourceBuilder
);
try
{
// 执行搜索请求
SearchResponse
searchResponse
=
restHighLevelClient
.
search
(
searchRequest
,
RequestOptions
.
DEFAULT
);
// 获取所有聚合结果
Aggregations
aggregations
=
searchResponse
.
getAggregations
();
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
return
Collections
.
emptyMap
();
}
}
}
}
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