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
4b03e7bc
Commit
4b03e7bc
authored
Aug 25, 2025
by
tianyiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor: 调整中屏查询
parent
9c62d23e
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
73 additions
and
64 deletions
+73
-64
DPMapStatisticsItemEnum.java
...mos/boot/module/jg/api/enums/DPMapStatisticsItemEnum.java
+3
-1
ComprehensiveStatisticalAnalysisServiceImpl.java
...ice/impl/ComprehensiveStatisticalAnalysisServiceImpl.java
+38
-50
JGDPStatisticsServiceImpl.java
...statistcs/biz/service/impl/JGDPStatisticsServiceImpl.java
+32
-13
No files found.
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/enums/DPMapStatisticsItemEnum.java
View file @
4b03e7bc
...
@@ -31,11 +31,13 @@ public enum DPMapStatisticsItemEnum {
...
@@ -31,11 +31,13 @@ public enum DPMapStatisticsItemEnum {
MANUFACTURING_UNITS
(
"制造单位 (家)"
,
"manufacturingUnits"
,
""
),
MANUFACTURING_UNITS
(
"制造单位 (家)"
,
"manufacturingUnits"
,
""
),
CONSTRUCTION_UNITS
(
"安改维单位 (家)"
,
"constructionUnits"
,
""
),
CONSTRUCTION_UNITS
(
"安改维单位 (家)"
,
"constructionUnits"
,
""
),
COMPANY_TOTAL
(
"企业总量 (家)"
,
"companyTotal"
,
""
),
COMPANY_TOTAL
(
"企业总量 (家)"
,
"companyTotal"
,
""
),
INSPECTION_AGENCY_COUNT
(
"检验检测机构总数 (家)"
,
"inspectionAgencyCount"
,
""
),
USERS_UNITS
(
"使用单位 (家)"
,
"usersUnits"
,
""
),
USERS_UNITS
(
"使用单位 (家)"
,
"usersUnits"
,
""
),
PERMIT_UNITS
(
"许可单位 (家)"
,
"permitUnits"
,
""
),
PERMIT_UNITS
(
"许可单位 (家)"
,
"permitUnits"
,
""
),
GAS_UNITS
(
"充装单位 (家)"
,
"gasUnits"
,
""
),
GAS_UNITS
(
"充装单位 (家)"
,
"gasUnits"
,
""
),
DESIGN_UNITS
(
"设计单位 (家)"
,
"designUnits"
,
""
),
DESIGN_UNITS
(
"设计单位 (家)"
,
"designUnits"
,
""
),
PERSON_TOTAL
(
"人员总数 (人)"
,
"personTotal"
,
""
),
PERSON_TOTAL
(
"企业人员总数 (人)"
,
"personTotal"
,
""
),
INSPECTION_PERSON_TOTAL
(
"检验检测人员总数 (人)"
,
"jyjcryzl"
,
""
),
OPERATORS
(
"作业人员 (人)"
,
"operators"
,
""
),
OPERATORS
(
"作业人员 (人)"
,
"operators"
,
""
),
DEVICE_COUNT
(
"已纳管设备数"
,
"deviceCount"
,
""
),
DEVICE_COUNT
(
"已纳管设备数"
,
"deviceCount"
,
""
),
PERSON_ISSUES_COUNT
(
"个人问题数"
,
"个人"
,
""
),
PERSON_ISSUES_COUNT
(
"个人问题数"
,
"个人"
,
""
),
...
...
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/ComprehensiveStatisticalAnalysisServiceImpl.java
View file @
4b03e7bc
...
@@ -3067,10 +3067,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
...
@@ -3067,10 +3067,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
// 一级统计
// 一级统计
if
(!
is2LeveFlag
)
{
if
(!
is2LeveFlag
)
{
BoolQueryBuilder
companyUnitTypeBoolMust
=
QueryBuilders
.
boolQuery
();
BoolQueryBuilder
companyUnitTypeBoolMust
=
QueryBuilders
.
boolQuery
();
companyUnitTypeBoolMust
companyBoolMust
(
companyUnitTypeBoolMust
,
"inspection"
);
.
should
(
QueryBuilders
.
wildcardQuery
(
"unitType.keyword"
,
"*检验机构*"
))
.
should
(
QueryBuilders
.
wildcardQuery
(
"unitType.keyword"
,
"*检测机构*"
))
.
minimumShouldMatch
(
1
);
boolMust
.
must
(
companyUnitTypeBoolMust
);
boolMust
.
must
(
companyUnitTypeBoolMust
);
result
=
getTotalAggMapsByUnitType
(
request
,
builder
,
boolMust
,
tabTotalMap
,
StatisticalAnalysisEnum
.
inspectionPerson
);
result
=
getTotalAggMapsByUnitType
(
request
,
builder
,
boolMust
,
tabTotalMap
,
StatisticalAnalysisEnum
.
inspectionPerson
);
}
else
{
}
else
{
...
@@ -3111,10 +3108,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
...
@@ -3111,10 +3108,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
boolMust
.
mustNot
(
QueryBuilders
.
wildcardQuery
(
"unitType.keyword"
,
"*检验检测机构*"
));
boolMust
.
mustNot
(
QueryBuilders
.
wildcardQuery
(
"unitType.keyword"
,
"*检验检测机构*"
));
if
(!
is2LeveFlag
)
{
if
(!
is2LeveFlag
)
{
BoolQueryBuilder
companyUnitTypeBoolMust
=
QueryBuilders
.
boolQuery
();
BoolQueryBuilder
companyUnitTypeBoolMust
=
QueryBuilders
.
boolQuery
();
companyUnitTypeBoolMust
companyBoolMust
(
companyUnitTypeBoolMust
,
"inspection"
);
.
should
(
QueryBuilders
.
wildcardQuery
(
"unitType.keyword"
,
"*检验机构*"
))
.
should
(
QueryBuilders
.
wildcardQuery
(
"unitType.keyword"
,
"*检测机构*"
))
.
minimumShouldMatch
(
1
);
boolMust
.
must
(
companyUnitTypeBoolMust
);
boolMust
.
must
(
companyUnitTypeBoolMust
);
result
=
getTotalAggMapsByUnitType
(
request
,
builder
,
boolMust
,
tabTotalMap
,
StatisticalAnalysisEnum
.
inspectionCompany
);
result
=
getTotalAggMapsByUnitType
(
request
,
builder
,
boolMust
,
tabTotalMap
,
StatisticalAnalysisEnum
.
inspectionCompany
);
}
else
{
}
else
{
...
@@ -3138,30 +3132,11 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
...
@@ -3138,30 +3132,11 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
equipBoolMust
.
mustNot
(
QueryBuilders
.
termQuery
(
"EQU_LIST_CODE"
,
"8000"
));
equipBoolMust
.
mustNot
(
QueryBuilders
.
termQuery
(
"EQU_LIST_CODE"
,
"8000"
));
equipBoolMust
.
must
(
QueryBuilders
.
termsQuery
(
"EQU_LIST_CODE"
,
Arrays
.
asList
(
"1000"
,
"2000"
,
"3000"
,
"4000"
,
"5000"
,
"6000"
,
"9000"
)));
equipBoolMust
.
must
(
QueryBuilders
.
termsQuery
(
"EQU_LIST_CODE"
,
Arrays
.
asList
(
"1000"
,
"2000"
,
"3000"
,
"4000"
,
"5000"
,
"6000"
,
"9000"
)));
String
sydwName
=
"*"
+
UnitTypeEnum
.
sydw
.
getName
()
+
"*"
;
String
grztName
=
"*"
+
UnitTypeEnum
.
grzt
.
getName
()
+
"*"
;
String
zzdwName
=
"*"
+
UnitTypeEnum
.
zzdw
.
getName
()
+
"*"
;
String
sjdwName
=
"*"
+
UnitTypeEnum
.
sjdw
.
getName
()
+
"*"
;
String
azgzwxdwName
=
"*"
+
UnitTypeEnum
.
azgzwxdw
.
getName
()
+
"*"
;
String
czdwName
=
"*"
+
UnitTypeEnum
.
czdw
.
getName
()
+
"*"
;
BoolQueryBuilder
companyUnitTypeBoolMust
=
QueryBuilders
.
boolQuery
();
BoolQueryBuilder
companyUnitTypeBoolMust
=
QueryBuilders
.
boolQuery
();
companyUnitTypeBoolMust
companyBoolMust
(
companyUnitTypeBoolMust
,
"company"
);
.
should
(
QueryBuilders
.
wildcardQuery
(
"unitType.keyword"
,
sydwName
))
.
should
(
QueryBuilders
.
wildcardQuery
(
"unitType.keyword"
,
grztName
))
.
should
(
QueryBuilders
.
wildcardQuery
(
"unitType.keyword"
,
zzdwName
))
.
should
(
QueryBuilders
.
wildcardQuery
(
"unitType.keyword"
,
sjdwName
))
.
should
(
QueryBuilders
.
wildcardQuery
(
"unitType.keyword"
,
azgzwxdwName
))
.
should
(
QueryBuilders
.
wildcardQuery
(
"unitType.keyword"
,
czdwName
))
.
minimumShouldMatch
(
1
);
String
jyjgName
=
"*"
+
UnitTypeEnum
.
jyjg
.
getName
()
+
"*"
;
String
jcjgName
=
"*"
+
UnitTypeEnum
.
jcjg
.
getName
()
+
"*"
;
BoolQueryBuilder
inspectionUnitTypeBoolMust
=
QueryBuilders
.
boolQuery
();
BoolQueryBuilder
inspectionUnitTypeBoolMust
=
QueryBuilders
.
boolQuery
();
inspectionUnitTypeBoolMust
companyBoolMust
(
inspectionUnitTypeBoolMust
,
"inspection"
);
.
should
(
QueryBuilders
.
wildcardQuery
(
"unitType.keyword"
,
jyjgName
))
.
should
(
QueryBuilders
.
wildcardQuery
(
"unitType.keyword"
,
jcjgName
))
.
minimumShouldMatch
(
1
);
BoolQueryBuilder
companyBoolMust
=
QueryBuilders
.
boolQuery
();
BoolQueryBuilder
companyBoolMust
=
QueryBuilders
.
boolQuery
();
companyBoolMust
.
must
(
QueryBuilders
.
prefixQuery
(
"superviseOrgCode.keyword"
,
orgCode
));
companyBoolMust
.
must
(
QueryBuilders
.
prefixQuery
(
"superviseOrgCode.keyword"
,
orgCode
));
...
@@ -3281,28 +3256,16 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
...
@@ -3281,28 +3256,16 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
// 一级统计
// 一级统计
if
(!
is2LeveFlag
)
{
if
(!
is2LeveFlag
)
{
// 计算总数
companyBoolMust
(
boolMust
,
"company"
);
boolMust
.
should
(
QueryBuilders
.
wildcardQuery
(
"unitType.keyword"
,
"*"
+
UnitTypeEnum
.
sydw
.
getName
()
+
"*"
))
.
should
(
QueryBuilders
.
wildcardQuery
(
"unitType.keyword"
,
"*"
+
UnitTypeEnum
.
grzt
.
getName
()
+
"*"
))
.
should
(
QueryBuilders
.
wildcardQuery
(
"unitType.keyword"
,
"*"
+
UnitTypeEnum
.
zzdw
.
getName
()
+
"*"
))
.
should
(
QueryBuilders
.
wildcardQuery
(
"unitType.keyword"
,
"*"
+
UnitTypeEnum
.
sjdw
.
getName
()
+
"*"
))
.
should
(
QueryBuilders
.
wildcardQuery
(
"unitType.keyword"
,
"*"
+
UnitTypeEnum
.
azgzwxdw
.
getName
()
+
"*"
))
.
should
(
QueryBuilders
.
wildcardQuery
(
"unitType.keyword"
,
"*"
+
UnitTypeEnum
.
czdw
.
getName
()
+
"*"
))
.
minimumShouldMatch
(
1
);
Map
<
String
,
Object
>
dats
=
getTotalAggMapsByUnitType
(
request
,
builder
,
boolMust
,
tabTotalMap
,
StatisticalAnalysisEnum
.
person
);
Map
<
String
,
Object
>
dats
=
getTotalAggMapsByUnitType
(
request
,
builder
,
boolMust
,
tabTotalMap
,
StatisticalAnalysisEnum
.
person
);
result
=
getUseAndProductAndFillingStatistics
(
dats
);
result
=
getUseAndProductAndFillingStatistics
(
dats
);
}
else
if
(!
is3LeveFlag
)
{
}
else
if
(!
is3LeveFlag
)
{
if
(
unitCategory
.
equals
(
UnitCategoryEnum
.
use
.
getCode
()))
{
if
(
unitCategory
.
equals
(
UnitCategoryEnum
.
use
.
getCode
()))
{
boolMust
.
should
(
QueryBuilders
.
wildcardQuery
(
"unitType.keyword"
,
"*"
+
UnitTypeEnum
.
sydw
.
getName
()
+
"*"
))
companyBoolMust
(
boolMust
,
UnitCategoryEnum
.
use
.
getCode
());
.
should
(
QueryBuilders
.
wildcardQuery
(
"unitType.keyword"
,
"*"
+
UnitTypeEnum
.
grzt
.
getName
()
+
"*"
))
.
minimumShouldMatch
(
1
);
}
else
if
(
unitCategory
.
equals
(
UnitCategoryEnum
.
produce
.
getCode
()))
{
}
else
if
(
unitCategory
.
equals
(
UnitCategoryEnum
.
produce
.
getCode
()))
{
boolMust
.
should
(
QueryBuilders
.
wildcardQuery
(
"unitType.keyword"
,
"*"
+
UnitTypeEnum
.
zzdw
.
getName
()
+
"*"
))
companyBoolMust
(
boolMust
,
UnitCategoryEnum
.
produce
.
getCode
());
.
should
(
QueryBuilders
.
wildcardQuery
(
"unitType.keyword"
,
"*"
+
UnitTypeEnum
.
sjdw
.
getName
()
+
"*"
))
.
should
(
QueryBuilders
.
wildcardQuery
(
"unitType.keyword"
,
"*"
+
UnitTypeEnum
.
azgzwxdw
.
getName
()
+
"*"
))
.
minimumShouldMatch
(
1
);
}
else
{
}
else
{
boolMust
.
must
(
QueryBuilders
.
wildcardQuery
(
"unitType.keyword"
,
"*"
+
UnitTypeEnum
.
czdw
.
getName
()
+
"*"
));
companyBoolMust
(
boolMust
,
UnitCategoryEnum
.
filling
.
getCode
(
));
JSONObject
expiryDateStatus
=
this
.
getExpiryDateStatusGroupStatistics
(
boolMust
);
JSONObject
expiryDateStatus
=
this
.
getExpiryDateStatusGroupStatistics
(
boolMust
);
JSONObject
personType
=
this
.
getPersonTypeGroupStatistics
(
boolMust
);
JSONObject
personType
=
this
.
getPersonTypeGroupStatistics
(
boolMust
);
result
.
put
(
"tabTotalMap"
,
new
JSONObject
()
result
.
put
(
"tabTotalMap"
,
new
JSONObject
()
...
@@ -3330,6 +3293,34 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
...
@@ -3330,6 +3293,34 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
return
Collections
.
singletonList
(
result
);
return
Collections
.
singletonList
(
result
);
}
}
public
void
companyBoolMust
(
BoolQueryBuilder
boolMust
,
String
type
)
{
if
(
"company"
.
equals
(
type
))
{
boolMust
.
should
(
QueryBuilders
.
wildcardQuery
(
"unitType.keyword"
,
"*"
+
UnitTypeEnum
.
sydw
.
getName
()
+
"*"
))
.
should
(
QueryBuilders
.
wildcardQuery
(
"unitType.keyword"
,
"*"
+
UnitTypeEnum
.
grzt
.
getName
()
+
"*"
))
.
should
(
QueryBuilders
.
wildcardQuery
(
"unitType.keyword"
,
"*"
+
UnitTypeEnum
.
zzdw
.
getName
()
+
"*"
))
.
should
(
QueryBuilders
.
wildcardQuery
(
"unitType.keyword"
,
"*"
+
UnitTypeEnum
.
sjdw
.
getName
()
+
"*"
))
.
should
(
QueryBuilders
.
wildcardQuery
(
"unitType.keyword"
,
"*"
+
UnitTypeEnum
.
azgzwxdw
.
getName
()
+
"*"
))
.
should
(
QueryBuilders
.
wildcardQuery
(
"unitType.keyword"
,
"*"
+
UnitTypeEnum
.
czdw
.
getName
()
+
"*"
))
.
minimumShouldMatch
(
1
);
}
else
if
(
UnitCategoryEnum
.
use
.
getCode
().
equals
(
type
))
{
boolMust
.
should
(
QueryBuilders
.
wildcardQuery
(
"unitType.keyword"
,
"*"
+
UnitTypeEnum
.
sydw
.
getName
()
+
"*"
))
.
should
(
QueryBuilders
.
wildcardQuery
(
"unitType.keyword"
,
"*"
+
UnitTypeEnum
.
grzt
.
getName
()
+
"*"
))
.
minimumShouldMatch
(
1
);
}
else
if
(
UnitCategoryEnum
.
produce
.
getCode
().
equals
(
type
))
{
boolMust
.
should
(
QueryBuilders
.
wildcardQuery
(
"unitType.keyword"
,
"*"
+
UnitTypeEnum
.
zzdw
.
getName
()
+
"*"
))
.
should
(
QueryBuilders
.
wildcardQuery
(
"unitType.keyword"
,
"*"
+
UnitTypeEnum
.
sjdw
.
getName
()
+
"*"
))
.
should
(
QueryBuilders
.
wildcardQuery
(
"unitType.keyword"
,
"*"
+
UnitTypeEnum
.
azgzwxdw
.
getName
()
+
"*"
))
.
minimumShouldMatch
(
1
);
}
else
if
(
UnitCategoryEnum
.
filling
.
getCode
().
equals
(
type
))
{
boolMust
.
must
(
QueryBuilders
.
wildcardQuery
(
"unitType.keyword"
,
"*"
+
UnitTypeEnum
.
czdw
.
getName
()
+
"*"
));
}
else
if
(
"inspection"
.
equals
(
type
))
{
boolMust
.
should
(
QueryBuilders
.
wildcardQuery
(
"unitType.keyword"
,
"*"
+
UnitTypeEnum
.
jyjg
.
getName
()
+
"*"
))
.
should
(
QueryBuilders
.
wildcardQuery
(
"unitType.keyword"
,
"*"
+
UnitTypeEnum
.
jcjg
.
getName
()
+
"*"
))
.
minimumShouldMatch
(
1
);
}
}
private
Map
<
String
,
Object
>
getTotalAggMapsByUnitType
(
SearchRequest
request
,
SearchSourceBuilder
builder
,
BoolQueryBuilder
boolMust
,
Map
<
String
,
Object
>
tabTotalMap
,
StatisticalAnalysisEnum
statisticalAnalysisEnum
)
{
private
Map
<
String
,
Object
>
getTotalAggMapsByUnitType
(
SearchRequest
request
,
SearchSourceBuilder
builder
,
BoolQueryBuilder
boolMust
,
Map
<
String
,
Object
>
tabTotalMap
,
StatisticalAnalysisEnum
statisticalAnalysisEnum
)
{
long
total
=
this
.
queryDpStatisticsTotalByIndex
(
boolMust
,
statisticalAnalysisEnum
.
getKey
());
long
total
=
this
.
queryDpStatisticsTotalByIndex
(
boolMust
,
statisticalAnalysisEnum
.
getKey
());
// 汇总总数
// 汇总总数
...
@@ -3398,6 +3389,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
...
@@ -3398,6 +3389,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
}
}
private
List
<
Map
<
String
,
Object
>>
queryDpCompanyStatistics
(
JSONObject
filter
,
SearchRequest
request
,
SearchSourceBuilder
builder
,
BoolQueryBuilder
boolMust
,
Map
<
String
,
Object
>
tabTotalMap
)
{
private
List
<
Map
<
String
,
Object
>>
queryDpCompanyStatistics
(
JSONObject
filter
,
SearchRequest
request
,
SearchSourceBuilder
builder
,
BoolQueryBuilder
boolMust
,
Map
<
String
,
Object
>
tabTotalMap
)
{
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
request
.
indices
(
StatisticalAnalysisEnum
.
company
.
getKey
());
request
.
indices
(
StatisticalAnalysisEnum
.
company
.
getKey
());
JSONObject
filterParams
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
filter
.
get
(
"filterParams"
)));
JSONObject
filterParams
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
filter
.
get
(
"filterParams"
)));
String
unitCategory
=
filterParams
.
getString
(
"unitCategory"
);
String
unitCategory
=
filterParams
.
getString
(
"unitCategory"
);
...
@@ -3434,7 +3426,6 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
...
@@ -3434,7 +3426,6 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
Map
<
String
,
Object
>
datas
=
getTotalAggMapsByUnitType
(
request
,
builder
,
boolMust
,
tabTotalMap
,
StatisticalAnalysisEnum
.
company
);
Map
<
String
,
Object
>
datas
=
getTotalAggMapsByUnitType
(
request
,
builder
,
boolMust
,
tabTotalMap
,
StatisticalAnalysisEnum
.
company
);
return
Collections
.
singletonList
(
getUseAndProductAndFillingStatistics
(
datas
));
return
Collections
.
singletonList
(
getUseAndProductAndFillingStatistics
(
datas
));
}
else
if
(!
is3LeveFlag
)
{
}
else
if
(!
is3LeveFlag
)
{
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
Long
companyCount
=
getStatisticCount
(
boolMust
,
StatisticalAnalysisEnum
.
company
.
getKey
());
Long
companyCount
=
getStatisticCount
(
boolMust
,
StatisticalAnalysisEnum
.
company
.
getKey
());
JSONObject
industrySupervisor
=
this
.
getItemGroupStatisticsByItemName
(
boolMust
,
JSONObject
industrySupervisor
=
this
.
getItemGroupStatisticsByItemName
(
boolMust
,
StatisticalAnalysisEnum
.
company
.
getKey
(),
StatisticalAnalysisEnum
.
company
.
getKey
(),
...
@@ -3494,7 +3485,6 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
...
@@ -3494,7 +3485,6 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
}
}
return
Collections
.
singletonList
(
result
);
return
Collections
.
singletonList
(
result
);
}
else
if
(
is3LeveFlag
)
{
}
else
if
(
is3LeveFlag
)
{
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
JSONArray
threeLevel
=
filterParams
.
getJSONArray
(
"threeLevel"
);
JSONArray
threeLevel
=
filterParams
.
getJSONArray
(
"threeLevel"
);
String
filterCode
=
threeLevel
.
getString
(
0
);
String
filterCode
=
threeLevel
.
getString
(
0
);
Map
<
String
,
Long
>
levelControlMap
=
new
HashMap
<>();
Map
<
String
,
Long
>
levelControlMap
=
new
HashMap
<>();
...
@@ -3557,9 +3547,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
...
@@ -3557,9 +3547,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
}
}
return
Collections
.
singletonList
(
result
);
return
Collections
.
singletonList
(
result
);
}
}
return
Collections
.
singletonList
(
result
);
return
null
;
}
}
private
Map
<
String
,
Object
>
getUseAndProductAndFillingStatistics
(
Map
<
String
,
Object
>
datas
)
{
private
Map
<
String
,
Object
>
getUseAndProductAndFillingStatistics
(
Map
<
String
,
Object
>
datas
)
{
...
...
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/JGDPStatisticsServiceImpl.java
View file @
4b03e7bc
...
@@ -458,13 +458,21 @@ public class JGDPStatisticsServiceImpl {
...
@@ -458,13 +458,21 @@ public class JGDPStatisticsServiceImpl {
private
void
staticsCenterMapCountDataForPerson
(
Map
<
String
,
Object
>
result
,
DPFilterParamDto
dpFilterParamDto
,
String
orgCode
)
{
private
void
staticsCenterMapCountDataForPerson
(
Map
<
String
,
Object
>
result
,
DPFilterParamDto
dpFilterParamDto
,
String
orgCode
)
{
if
(
orgCode
==
null
)
{
if
(
orgCode
==
null
)
{
result
.
put
(
DPMapStatisticsItemEnum
.
OPERATORS
.
getCode
(),
0
);
result
.
put
(
DPMapStatisticsItemEnum
.
INSPECTION_PERSON_TOTAL
.
getCode
(),
0
);
result
.
put
(
DPMapStatisticsItemEnum
.
PERSON_TOTAL
.
getCode
(),
0
);
result
.
put
(
DPMapStatisticsItemEnum
.
PERSON_TOTAL
.
getCode
(),
0
);
return
;
return
;
}
}
Long
num
=
userInfoMapper
.
countUserByPostAndAreaCode
(
orgCode
,
"6552"
,
dpFilterParamDto
.
getCityCode
());
BoolQueryBuilder
companyBoolMust
=
QueryBuilders
.
boolQuery
();
result
.
put
(
DPMapStatisticsItemEnum
.
OPERATORS
.
getCode
(),
num
);
companyBoolMust
.
must
(
QueryBuilders
.
prefixQuery
(
"superviseOrgCode"
,
orgCode
));
staticsPersonCountByEs
(
orgCode
,
StatisticalAnalysisEnum
.
person
.
getKey
(),
result
);
statisticalAnalysisService
.
companyBoolMust
(
companyBoolMust
,
"company"
);
Long
companySum
=
statisticalAnalysisService
.
getStatisticCount
(
companyBoolMust
,
StatisticalAnalysisEnum
.
person
.
getKey
());
BoolQueryBuilder
inspectionBoolMust
=
QueryBuilders
.
boolQuery
();
inspectionBoolMust
.
must
(
QueryBuilders
.
prefixQuery
(
"superviseOrgCode"
,
orgCode
));
inspectionBoolMust
.
mustNot
(
QueryBuilders
.
wildcardQuery
(
"unitType.keyword"
,
"*检验检测机构*"
));
statisticalAnalysisService
.
companyBoolMust
(
inspectionBoolMust
,
"inspection"
);
Long
inspectionSum
=
statisticalAnalysisService
.
getStatisticCount
(
inspectionBoolMust
,
StatisticalAnalysisEnum
.
person
.
getKey
());
result
.
put
(
DPMapStatisticsItemEnum
.
PERSON_TOTAL
.
getCode
(),
companySum
);
result
.
put
(
DPMapStatisticsItemEnum
.
INSPECTION_PERSON_TOTAL
.
getCode
(),
inspectionSum
);
}
}
private
void
staticsPersonCountByEs
(
String
orgCode
,
String
key
,
Map
<
String
,
Object
>
result
)
{
private
void
staticsPersonCountByEs
(
String
orgCode
,
String
key
,
Map
<
String
,
Object
>
result
)
{
...
@@ -513,14 +521,25 @@ public class JGDPStatisticsServiceImpl {
...
@@ -513,14 +521,25 @@ public class JGDPStatisticsServiceImpl {
setDefaultCompanyCountData
(
result
);
setDefaultCompanyCountData
(
result
);
return
;
return
;
}
}
List
<
CountDto
>
countDtos
=
enterpriseInfoMapper
.
countByUnitTypeAndOrgCode
(
orgCode
,
cityCode
,
false
);
BoolQueryBuilder
companyBoolMust
=
QueryBuilders
.
boolQuery
();
// 企业根据类型统计
companyBoolMust
.
must
(
QueryBuilders
.
prefixQuery
(
"superviseOrgCode.keyword"
,
orgCode
));
staticsUnitTypeCountByEs
(
orgCode
,
StatisticalAnalysisEnum
.
company
.
getKey
(),
result
);
statisticalAnalysisService
.
companyBoolMust
(
companyBoolMust
,
"company"
);
result
.
put
(
DPMapStatisticsItemEnum
.
CONSTRUCTION_UNITS
.
getCode
(),
countDtos
.
stream
().
filter
(
c
->
c
.
getKeyStr
().
contains
(
COMPANY_TYPE_MAINTENANCE
)).
mapToInt
(
CountDto:
:
getIntValue
).
sum
());
Long
companySum
=
statisticalAnalysisService
.
getStatisticCount
(
companyBoolMust
,
StatisticalAnalysisEnum
.
company
.
getKey
());
result
.
put
(
DPMapStatisticsItemEnum
.
MANUFACTURING_UNITS
.
getCode
(),
countDtos
.
stream
().
filter
(
c
->
c
.
getKeyStr
().
contains
(
COMPANY_TYPE_MANUFACTURE
)).
mapToInt
(
CountDto:
:
getIntValue
).
sum
());
BoolQueryBuilder
inspectionBoolMust
=
QueryBuilders
.
boolQuery
();
result
.
put
(
DPMapStatisticsItemEnum
.
GAS_UNITS
.
getCode
(),
countDtos
.
stream
().
filter
(
c
->
c
.
getKeyStr
().
contains
(
COMPANY_TYPE_FILLING
)).
mapToInt
(
CountDto:
:
getIntValue
).
sum
());
inspectionBoolMust
.
must
(
QueryBuilders
.
prefixQuery
(
"superviseOrgCode.keyword"
,
orgCode
));
result
.
put
(
DPMapStatisticsItemEnum
.
DESIGN_UNITS
.
getCode
(),
countDtos
.
stream
().
filter
(
c
->
c
.
getKeyStr
().
contains
(
COMPANY_TYPE_DESIGN
)).
mapToInt
(
CountDto:
:
getIntValue
).
sum
());
inspectionBoolMust
.
mustNot
(
QueryBuilders
.
wildcardQuery
(
"unitType.keyword"
,
"*检验检测机构*"
));
statisticalAnalysisService
.
companyBoolMust
(
inspectionBoolMust
,
"inspection"
);
Long
inspectionSum
=
statisticalAnalysisService
.
getStatisticCount
(
inspectionBoolMust
,
StatisticalAnalysisEnum
.
company
.
getKey
());
result
.
put
(
DPMapStatisticsItemEnum
.
COMPANY_TOTAL
.
getCode
(),
companySum
);
result
.
put
(
DPMapStatisticsItemEnum
.
INSPECTION_AGENCY_COUNT
.
getCode
(),
inspectionSum
);
// List<CountDto> countDtos = enterpriseInfoMapper.countByUnitTypeAndOrgCode(orgCode, cityCode, false);
// // 企业根据类型统计
// staticsUnitTypeCountByEs(orgCode, StatisticalAnalysisEnum.company.getKey(), result);
// result.put(DPMapStatisticsItemEnum.CONSTRUCTION_UNITS.getCode(), countDtos.stream().filter(c -> c.getKeyStr().contains(COMPANY_TYPE_MAINTENANCE)).mapToInt(CountDto::getIntValue).sum());
// result.put(DPMapStatisticsItemEnum.MANUFACTURING_UNITS.getCode(), countDtos.stream().filter(c -> c.getKeyStr().contains(COMPANY_TYPE_MANUFACTURE)).mapToInt(CountDto::getIntValue).sum());
// result.put(DPMapStatisticsItemEnum.GAS_UNITS.getCode(), countDtos.stream().filter(c -> c.getKeyStr().contains(COMPANY_TYPE_FILLING)).mapToInt(CountDto::getIntValue).sum());
// result.put(DPMapStatisticsItemEnum.DESIGN_UNITS.getCode(), countDtos.stream().filter(c -> c.getKeyStr().contains(COMPANY_TYPE_DESIGN)).mapToInt(CountDto::getIntValue).sum());
}
}
private
void
staticsUnitTypeCountByEs
(
String
orgCode
,
String
index
,
Map
<
String
,
Object
>
result
)
{
private
void
staticsUnitTypeCountByEs
(
String
orgCode
,
String
index
,
Map
<
String
,
Object
>
result
)
{
...
@@ -651,7 +670,7 @@ public class JGDPStatisticsServiceImpl {
...
@@ -651,7 +670,7 @@ public class JGDPStatisticsServiceImpl {
String
orgCode
=
StCommonServiceImpl
.
getRegionCodeOrgCodeMap
().
get
(
cityCode
);
String
orgCode
=
StCommonServiceImpl
.
getRegionCodeOrgCodeMap
().
get
(
cityCode
);
if
(
StringUtils
.
isNotEmpty
(
orgCode
))
{
if
(
StringUtils
.
isNotEmpty
(
orgCode
))
{
// m.put(DPMapStatisticsItemEnum.USERS_UNITS.getCode(), countDtos.stream().filter(c -> c.getKeyStr().contains(COMPANY_TYPE_USE) && c.getLabel().contains(orgCode)).mapToInt(CountDto::getIntValue).sum());
// m.put(DPMapStatisticsItemEnum.USERS_UNITS.getCode(), countDtos.stream().filter(c -> c.getKeyStr().contains(COMPANY_TYPE_USE) && c.getLabel().contains(orgCode)).mapToInt(CountDto::getIntValue).sum());
statics
UnitTypeCountByEs
(
orgCode
,
StatisticalAnalysisEnum
.
company
.
getKey
(),
m
);
statics
CenterMapCountDataForCompany
(
m
,
orgCode
,
cityCode
);
m
.
put
(
DPMapStatisticsItemEnum
.
CONSTRUCTION_UNITS
.
getCode
(),
countDtos
.
stream
().
filter
(
c
->
c
.
getKeyStr
().
contains
(
COMPANY_TYPE_MAINTENANCE
)
&&
c
.
getLabel
().
contains
(
orgCode
)).
mapToInt
(
CountDto:
:
getIntValue
).
sum
());
m
.
put
(
DPMapStatisticsItemEnum
.
CONSTRUCTION_UNITS
.
getCode
(),
countDtos
.
stream
().
filter
(
c
->
c
.
getKeyStr
().
contains
(
COMPANY_TYPE_MAINTENANCE
)
&&
c
.
getLabel
().
contains
(
orgCode
)).
mapToInt
(
CountDto:
:
getIntValue
).
sum
());
m
.
put
(
DPMapStatisticsItemEnum
.
MANUFACTURING_UNITS
.
getCode
(),
countDtos
.
stream
().
filter
(
c
->
c
.
getKeyStr
().
contains
(
COMPANY_TYPE_MANUFACTURE
)
&&
c
.
getLabel
().
contains
(
orgCode
)).
mapToInt
(
CountDto:
:
getIntValue
).
sum
());
m
.
put
(
DPMapStatisticsItemEnum
.
MANUFACTURING_UNITS
.
getCode
(),
countDtos
.
stream
().
filter
(
c
->
c
.
getKeyStr
().
contains
(
COMPANY_TYPE_MANUFACTURE
)
&&
c
.
getLabel
().
contains
(
orgCode
)).
mapToInt
(
CountDto:
:
getIntValue
).
sum
());
m
.
put
(
DPMapStatisticsItemEnum
.
GAS_UNITS
.
getCode
(),
countDtos
.
stream
().
filter
(
c
->
c
.
getKeyStr
().
contains
(
COMPANY_TYPE_FILLING
)
&&
c
.
getLabel
().
contains
(
orgCode
)).
mapToInt
(
CountDto:
:
getIntValue
).
sum
());
m
.
put
(
DPMapStatisticsItemEnum
.
GAS_UNITS
.
getCode
(),
countDtos
.
stream
().
filter
(
c
->
c
.
getKeyStr
().
contains
(
COMPANY_TYPE_FILLING
)
&&
c
.
getLabel
().
contains
(
orgCode
)).
mapToInt
(
CountDto:
:
getIntValue
).
sum
());
...
@@ -665,7 +684,7 @@ public class JGDPStatisticsServiceImpl {
...
@@ -665,7 +684,7 @@ public class JGDPStatisticsServiceImpl {
private
void
setDefaultCompanyCountData
(
Map
<
String
,
Object
>
m
)
{
private
void
setDefaultCompanyCountData
(
Map
<
String
,
Object
>
m
)
{
m
.
put
(
DPMapStatisticsItemEnum
.
USERS_UNITS
.
getCode
(),
0
);
m
.
put
(
DPMapStatisticsItemEnum
.
USERS_UNITS
.
getCode
(),
0
);
m
.
put
(
DPMapStatisticsItemEnum
.
COMPANY_TOTAL
.
getCode
(),
0
);
m
.
put
(
DPMapStatisticsItemEnum
.
COMPANY_TOTAL
.
getCode
(),
0
);
m
.
put
(
DPMapStatisticsItemEnum
.
PERMIT_UNITS
.
getCode
(),
0
);
m
.
put
(
DPMapStatisticsItemEnum
.
INSPECTION_AGENCY_COUNT
.
getCode
(),
0
);
m
.
put
(
DPMapStatisticsItemEnum
.
CONSTRUCTION_UNITS
.
getCode
(),
0
);
m
.
put
(
DPMapStatisticsItemEnum
.
CONSTRUCTION_UNITS
.
getCode
(),
0
);
m
.
put
(
DPMapStatisticsItemEnum
.
MANUFACTURING_UNITS
.
getCode
(),
0
);
m
.
put
(
DPMapStatisticsItemEnum
.
MANUFACTURING_UNITS
.
getCode
(),
0
);
m
.
put
(
DPMapStatisticsItemEnum
.
GAS_UNITS
.
getCode
(),
0
);
m
.
put
(
DPMapStatisticsItemEnum
.
GAS_UNITS
.
getCode
(),
0
);
...
...
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