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
a8d29d1b
Commit
a8d29d1b
authored
Aug 25, 2025
by
tianyiming
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop_tzs_bugfix' into develop_tzs_register
parents
8183b5b6
4b03e7bc
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
412 additions
and
47 deletions
+412
-47
DPMapStatisticsItemEnum.java
...mos/boot/module/jg/api/enums/DPMapStatisticsItemEnum.java
+3
-1
StatisticalAnalysisEnum.java
.../module/statistics/api/enums/StatisticalAnalysisEnum.java
+2
-2
UnitCategoryEnum.java
...os/boot/module/statistics/api/enums/UnitCategoryEnum.java
+7
-2
ZLDPStatisticsController.java
...le/statistcs/biz/controller/ZLDPStatisticsController.java
+7
-1
ComprehensiveStatisticalAnalysisServiceImpl.java
...ice/impl/ComprehensiveStatisticalAnalysisServiceImpl.java
+361
-28
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 @
a8d29d1b
...
@@ -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-api/src/main/java/com/yeejoin/amos/boot/module/statistics/api/enums/StatisticalAnalysisEnum.java
View file @
a8d29d1b
...
@@ -15,9 +15,9 @@ public enum StatisticalAnalysisEnum {
...
@@ -15,9 +15,9 @@ public enum StatisticalAnalysisEnum {
*/
*/
company
(
"企业"
,
"company"
,
"idx_biz_enterprise_info"
),
company
(
"企业"
,
"company"
,
"idx_biz_enterprise_info"
),
inspectionCompany
(
"检验检测机构"
,
"inspectionCompany"
,
"idx_biz_enterprise_info"
),
person
(
"人员"
,
"person"
,
"idx_biz_user_info"
),
person
(
"人员"
,
"person"
,
"idx_biz_user_info"
),
inspectionPerson
(
"检验检测人员"
,
"inspectionPerson"
,
"idx_biz_user_info"
),
equip
(
"设备"
,
"equip"
,
"idx_biz_equipment_info"
);
equip
(
"设备"
,
"equip"
,
"idx_biz_equipment_info"
);
private
String
name
;
private
String
name
;
...
...
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-api/src/main/java/com/yeejoin/amos/boot/module/statistics/api/enums/UnitCategoryEnum.java
View file @
a8d29d1b
...
@@ -6,8 +6,13 @@ import lombok.Getter;
...
@@ -6,8 +6,13 @@ import lombok.Getter;
@AllArgsConstructor
@AllArgsConstructor
@Getter
@Getter
public
enum
UnitCategoryEnum
{
public
enum
UnitCategoryEnum
{
use
(
"使用单位"
,
"use"
),
license
(
"许可单位"
,
"license"
);
use
(
"使用单位"
,
"use"
,
"use"
),
// 企业和个人主体
produce
(
"生产单位"
,
"produce"
,
"license"
),
// 设计单位、制造单位、安装改造维修单位
filling
(
"充装单位"
,
"filling"
,
"license"
),
// 充装单位
inspection
(
"检验机构"
,
"inspection"
,
"license"
),
// 检验机构
detection
(
"检测机构"
,
"detection"
,
"license"
);
// 检测机构
private
final
String
name
;
private
final
String
name
;
private
final
String
code
;
private
final
String
code
;
private
final
String
type
;
}
}
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-biz/src/main/java/com/yeejoin/amos/boot/module/statistcs/biz/controller/ZLDPStatisticsController.java
View file @
a8d29d1b
...
@@ -19,7 +19,7 @@ import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
...
@@ -19,7 +19,7 @@ import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
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.util.
LinkedHashMap
;
import
java.util.
Collections
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -189,4 +189,10 @@ public class ZLDPStatisticsController {
...
@@ -189,4 +189,10 @@ public class ZLDPStatisticsController {
public
ResponseModel
<
Object
>
getRegulatorUnitTree
(){
public
ResponseModel
<
Object
>
getRegulatorUnitTree
(){
return
ResponseHelper
.
buildResponse
(
statisticsService
.
getRegulatorUnitTree
());
return
ResponseHelper
.
buildResponse
(
statisticsService
.
getRegulatorUnitTree
());
}
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/getTree"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查询监管部门树"
,
notes
=
"查询监管部门树"
)
public
ResponseModel
<
Object
>
getTree
(){
return
ResponseHelper
.
buildResponse
(
Collections
.
singletonList
(
statisticsService
.
getRegulatorUnitTree
()));
}
}
}
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 @
a8d29d1b
...
@@ -20,8 +20,8 @@ import com.yeejoin.amos.boot.biz.common.utils.RequestContextWrapper;
...
@@ -20,8 +20,8 @@ import com.yeejoin.amos.boot.biz.common.utils.RequestContextWrapper;
import
com.yeejoin.amos.boot.module.common.api.dao.EsEquipmentDao
;
import
com.yeejoin.amos.boot.module.common.api.dao.EsEquipmentDao
;
import
com.yeejoin.amos.boot.module.common.api.dto.TechParamItem
;
import
com.yeejoin.amos.boot.module.common.api.dto.TechParamItem
;
import
com.yeejoin.amos.boot.module.common.api.entity.ESEquipmentInfo
;
import
com.yeejoin.amos.boot.module.common.api.entity.ESEquipmentInfo
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.TZSCommonServiceImpl
;
import
com.yeejoin.amos.boot.module.common.api.enums.UnitTypeNewEnum
;
import
com.yeejoin.amos.boot.module.common.api.enums.UnitTypeNewEnum
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.TZSCommonServiceImpl
;
import
com.yeejoin.amos.boot.module.common.biz.utils.TechParamUtil
;
import
com.yeejoin.amos.boot.module.common.biz.utils.TechParamUtil
;
import
com.yeejoin.amos.boot.module.statistcs.biz.utils.JsonUtils
;
import
com.yeejoin.amos.boot.module.statistcs.biz.utils.JsonUtils
;
import
com.yeejoin.amos.boot.module.statistcs.biz.utils.MinioUtils
;
import
com.yeejoin.amos.boot.module.statistcs.biz.utils.MinioUtils
;
...
@@ -812,8 +812,8 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
...
@@ -812,8 +812,8 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
private
String
getFilterPermitStatusOrLicensesStatus
(
JSONArray
leftGroup
,
JSONArray
rightGroup
,
String
code
)
{
private
String
getFilterPermitStatusOrLicensesStatus
(
JSONArray
leftGroup
,
JSONArray
rightGroup
,
String
code
)
{
String
filed
=
code
.
equals
(
StatisticalAnalysisEnum
.
company
.
getCode
())
?
"permitStatus"
:
"expiryDate"
;
String
filed
=
code
.
equals
(
StatisticalAnalysisEnum
.
company
.
getCode
())
?
"permitStatus"
:
"expiryDate"
;
List
<
Object
>
LeftNoLicenseList
=
leftGroup
.
stream
().
filter
(
e
->
"certNo"
.
equals
(((
JSONObject
)
e
).
getString
(
"field"
))
&&
((
JSONObject
)
e
).
containsKey
(
"value"
)
&&
((
JSONObject
)
e
).
getString
(
"value"
).
equals
(
"0"
)
&&
((
JSONObject
)
e
).
containsKey
(
"itemCondition"
)
&&
!((
JSONObject
)
e
).
getString
(
"itemCondition"
).
equals
(
"notIn"
)
).
collect
(
Collectors
.
toList
());
List
<
Object
>
LeftNoLicenseList
=
leftGroup
.
stream
().
filter
(
e
->
"certNo"
.
equals
(((
JSONObject
)
e
).
getString
(
"field"
))
&&
((
JSONObject
)
e
).
containsKey
(
"value"
)
&&
((
JSONObject
)
e
).
getString
(
"value"
).
equals
(
"0"
)
&&
((
JSONObject
)
e
).
containsKey
(
"itemCondition"
)
&&
!((
JSONObject
)
e
).
getString
(
"itemCondition"
).
equals
(
"notIn"
)
).
collect
(
Collectors
.
toList
());
List
<
Object
>
rightNoLicenseList
=
rightGroup
.
stream
().
filter
(
e
->
"certNo"
.
equals
(((
JSONObject
)
e
).
getString
(
"field"
))
&&
((
JSONObject
)
e
).
containsKey
(
"value"
)
&&
((
JSONObject
)
e
).
getString
(
"value"
).
equals
(
"0"
)
&&
((
JSONObject
)
e
).
containsKey
(
"itemCondition"
)
&&
!((
JSONObject
)
e
).
getString
(
"itemCondition"
).
equals
(
"notIn"
)
).
collect
(
Collectors
.
toList
());
List
<
Object
>
rightNoLicenseList
=
rightGroup
.
stream
().
filter
(
e
->
"certNo"
.
equals
(((
JSONObject
)
e
).
getString
(
"field"
))
&&
((
JSONObject
)
e
).
containsKey
(
"value"
)
&&
((
JSONObject
)
e
).
getString
(
"value"
).
equals
(
"0"
)
&&
((
JSONObject
)
e
).
containsKey
(
"itemCondition"
)
&&
!((
JSONObject
)
e
).
getString
(
"itemCondition"
).
equals
(
"notIn"
)
).
collect
(
Collectors
.
toList
());
Boolean
noLicense
=
false
;
Boolean
noLicense
=
false
;
if
(
LeftNoLicenseList
.
size
()
>
0
||
rightNoLicenseList
.
size
()
>
0
)
{
if
(
LeftNoLicenseList
.
size
()
>
0
||
rightNoLicenseList
.
size
()
>
0
)
{
noLicense
=
true
;
noLicense
=
true
;
...
@@ -3031,9 +3031,15 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
...
@@ -3031,9 +3031,15 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
}
else
if
(
StatisticalAnalysisEnum
.
company
.
getCode
().
equals
(
businessType
))
{
}
else
if
(
StatisticalAnalysisEnum
.
company
.
getCode
().
equals
(
businessType
))
{
boolMust
.
must
(
QueryBuilders
.
prefixQuery
(
"superviseOrgCode.keyword"
,
orgCode
));
boolMust
.
must
(
QueryBuilders
.
prefixQuery
(
"superviseOrgCode.keyword"
,
orgCode
));
data
=
queryDpCompanyStatistics
(
filter
,
request
,
builder
,
boolMust
,
tabTotalMap
);
data
=
queryDpCompanyStatistics
(
filter
,
request
,
builder
,
boolMust
,
tabTotalMap
);
}
else
{
}
else
if
(
StatisticalAnalysisEnum
.
person
.
getCode
().
equals
(
businessType
))
{
boolMust
.
must
(
QueryBuilders
.
prefixQuery
(
"superviseOrgCode"
,
orgCode
));
boolMust
.
must
(
QueryBuilders
.
prefixQuery
(
"superviseOrgCode"
,
orgCode
));
data
=
queryDpPersonStatistics
(
filter
,
request
,
builder
,
boolMust
,
tabTotalMap
);
data
=
queryDpPersonStatistics
(
filter
,
request
,
builder
,
boolMust
,
tabTotalMap
);
}
else
if
(
StatisticalAnalysisEnum
.
inspectionCompany
.
getCode
().
equals
(
businessType
))
{
boolMust
.
must
(
QueryBuilders
.
prefixQuery
(
"superviseOrgCode.keyword"
,
orgCode
));
data
=
queryDpInspectionCompanyStatistics
(
filter
,
request
,
builder
,
boolMust
,
tabTotalMap
);
}
else
{
boolMust
.
must
(
QueryBuilders
.
prefixQuery
(
"superviseOrgCode"
,
orgCode
));
data
=
queryDpInspectionPersonStatistics
(
filter
,
request
,
builder
,
boolMust
,
tabTotalMap
);
}
}
getTypeCount
(
businessType
,
tabTotalMap
,
orgCode
,
data
);
getTypeCount
(
businessType
,
tabTotalMap
,
orgCode
,
data
);
...
@@ -3043,6 +3049,81 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
...
@@ -3043,6 +3049,81 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
return
result
;
return
result
;
}
}
private
List
<
Map
<
String
,
Object
>>
queryDpInspectionPersonStatistics
(
JSONObject
filter
,
SearchRequest
request
,
SearchSourceBuilder
builder
,
BoolQueryBuilder
boolMust
,
Map
<
String
,
Object
>
tabTotalMap
)
{
request
.
indices
(
StatisticalAnalysisEnum
.
inspectionPerson
.
getKey
());
JSONObject
filterParams
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
filter
.
get
(
"filterParams"
)));
String
filterType
=
"advanced"
;
// 组装人员过滤条件
this
.
getPersonBoolQueryBuilder
(
filterParams
,
boolMust
,
filterType
);
// 通过是否传参 unitType 单位类型 区分一二级查询
boolean
is2LeveFlag
=
Optional
.
of
(
filter
)
.
map
(
obj
->
obj
.
getJSONObject
(
"filterParams"
))
.
map
(
filterParamsObj
->
filterParams
.
getJSONArray
(
"unitType"
))
.
map
(
unitTypeObj
->
!
unitTypeObj
.
isEmpty
())
.
orElse
(
false
);
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
boolMust
.
mustNot
(
QueryBuilders
.
wildcardQuery
(
"unitType.keyword"
,
"*检验检测机构*"
));
// 一级统计
if
(!
is2LeveFlag
)
{
BoolQueryBuilder
companyUnitTypeBoolMust
=
QueryBuilders
.
boolQuery
();
companyBoolMust
(
companyUnitTypeBoolMust
,
"inspection"
);
boolMust
.
must
(
companyUnitTypeBoolMust
);
result
=
getTotalAggMapsByUnitType
(
request
,
builder
,
boolMust
,
tabTotalMap
,
StatisticalAnalysisEnum
.
inspectionPerson
);
}
else
{
tabTotalMap
.
put
(
StatisticalAnalysisEnum
.
inspectionPerson
.
getCode
(),
this
.
queryDpStatisticsTotalByIndex
(
boolMust
,
StatisticalAnalysisEnum
.
inspectionPerson
.
getKey
()));
JSONObject
expiryDateStatus
=
this
.
getExpiryDateStatusGroupStatistics
(
boolMust
);
JSONObject
personType
=
this
.
getPersonTypeGroupStatistics
(
boolMust
);
result
.
put
(
"tabTotalMap"
,
new
JSONObject
()
.
fluentPut
(
"expiryDateStatusTotal"
,
this
.
sumWithJSONObjectValues
(
expiryDateStatus
))
.
fluentPut
(
"personTypeTotal"
,
this
.
sumWithJSONObjectValues
(
personType
)));
result
.
put
(
"datas"
,
new
JSONObject
()
.
fluentPut
(
"expiryDateStatus"
,
expiryDateStatus
)
.
fluentPut
(
"personType"
,
personType
));
}
return
Collections
.
singletonList
(
result
);
}
private
List
<
Map
<
String
,
Object
>>
queryDpInspectionCompanyStatistics
(
JSONObject
filter
,
SearchRequest
request
,
SearchSourceBuilder
builder
,
BoolQueryBuilder
boolMust
,
Map
<
String
,
Object
>
tabTotalMap
)
{
request
.
indices
(
StatisticalAnalysisEnum
.
inspectionCompany
.
getKey
());
JSONObject
filterParams
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
filter
.
get
(
"filterParams"
)));
// 构造企业查询条件
filter
.
put
(
"filterType"
,
"advanced"
);
if
(!
ObjectUtils
.
isEmpty
(
filter
.
get
(
"filterParams"
)))
{
String
filterType
=
filter
.
getString
(
"filterType"
);
getCompanyBoolQueryBuilder
(
filterParams
,
filterType
,
boolMust
);
}
boolean
is2LeveFlag
=
Optional
.
of
(
filter
)
.
map
(
obj
->
obj
.
getJSONObject
(
"filterParams"
))
.
map
(
filterParamsObj
->
filterParamsObj
.
getJSONArray
(
"unitType"
))
.
map
(
unitTypeObj
->
!
unitTypeObj
.
isEmpty
())
.
orElse
(
false
);
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
// 一级统计
boolMust
.
mustNot
(
QueryBuilders
.
wildcardQuery
(
"unitType.keyword"
,
"*检验检测机构*"
));
if
(!
is2LeveFlag
)
{
BoolQueryBuilder
companyUnitTypeBoolMust
=
QueryBuilders
.
boolQuery
();
companyBoolMust
(
companyUnitTypeBoolMust
,
"inspection"
);
boolMust
.
must
(
companyUnitTypeBoolMust
);
result
=
getTotalAggMapsByUnitType
(
request
,
builder
,
boolMust
,
tabTotalMap
,
StatisticalAnalysisEnum
.
inspectionCompany
);
}
else
{
Long
companyCount
=
getStatisticCount
(
boolMust
,
StatisticalAnalysisEnum
.
inspectionCompany
.
getKey
());
getTotalAggMapsByUnitType
(
request
,
builder
,
boolMust
,
tabTotalMap
,
StatisticalAnalysisEnum
.
inspectionCompany
);
JSONObject
permitStatus
=
getPermitStatusGroupStatistics
(
boolMust
);
result
.
put
(
"datas"
,
new
JSONObject
()
.
fluentPut
(
"permitStatus"
,
permitStatus
));
result
.
put
(
"tabTotalMap"
,
new
JSONObject
()
.
fluentPut
(
"permitStatusTotal"
,
companyCount
));
}
return
Collections
.
singletonList
(
result
);
}
private
void
getTypeCount
(
String
businessType
,
Map
<
String
,
Object
>
tabTotalMap
,
String
orgCode
,
List
<
Map
<
String
,
Object
>>
data
)
{
private
void
getTypeCount
(
String
businessType
,
Map
<
String
,
Object
>
tabTotalMap
,
String
orgCode
,
List
<
Map
<
String
,
Object
>>
data
)
{
BoolQueryBuilder
equipBoolMust
=
QueryBuilders
.
boolQuery
();
BoolQueryBuilder
equipBoolMust
=
QueryBuilders
.
boolQuery
();
equipBoolMust
.
must
(
QueryBuilders
.
prefixQuery
(
"ORG_BRANCH_CODE"
,
orgCode
));
equipBoolMust
.
must
(
QueryBuilders
.
prefixQuery
(
"ORG_BRANCH_CODE"
,
orgCode
));
...
@@ -3050,35 +3131,102 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
...
@@ -3050,35 +3131,102 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
equipBoolMust
.
mustNot
(
QueryBuilders
.
termQuery
(
"EQU_CATEGORY_CODE"
,
"2300"
));
equipBoolMust
.
mustNot
(
QueryBuilders
.
termQuery
(
"EQU_CATEGORY_CODE"
,
"2300"
));
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"
)));
BoolQueryBuilder
companyUnitTypeBoolMust
=
QueryBuilders
.
boolQuery
();
companyBoolMust
(
companyUnitTypeBoolMust
,
"company"
);
BoolQueryBuilder
inspectionUnitTypeBoolMust
=
QueryBuilders
.
boolQuery
();
companyBoolMust
(
inspectionUnitTypeBoolMust
,
"inspection"
);
BoolQueryBuilder
companyBoolMust
=
QueryBuilders
.
boolQuery
();
BoolQueryBuilder
companyBoolMust
=
QueryBuilders
.
boolQuery
();
companyBoolMust
.
must
(
QueryBuilders
.
prefixQuery
(
"superviseOrgCode.keyword"
,
orgCode
));
companyBoolMust
.
must
(
QueryBuilders
.
prefixQuery
(
"superviseOrgCode.keyword"
,
orgCode
));
companyBoolMust
.
must
(
companyUnitTypeBoolMust
);
BoolQueryBuilder
personBoolMust
=
QueryBuilders
.
boolQuery
();
BoolQueryBuilder
personBoolMust
=
QueryBuilders
.
boolQuery
();
personBoolMust
.
must
(
QueryBuilders
.
prefixQuery
(
"superviseOrgCode"
,
orgCode
));
personBoolMust
.
must
(
QueryBuilders
.
prefixQuery
(
"superviseOrgCode"
,
orgCode
));
personBoolMust
.
must
(
companyUnitTypeBoolMust
);
BoolQueryBuilder
inspectionCompanyBoolMust
=
QueryBuilders
.
boolQuery
();
inspectionCompanyBoolMust
.
must
(
QueryBuilders
.
prefixQuery
(
"superviseOrgCode.keyword"
,
orgCode
));
inspectionCompanyBoolMust
.
must
(
inspectionUnitTypeBoolMust
);
inspectionCompanyBoolMust
.
mustNot
(
QueryBuilders
.
wildcardQuery
(
"unitType.keyword"
,
"*检验检测机构*"
));
BoolQueryBuilder
inspectionPersonBoolMust
=
QueryBuilders
.
boolQuery
();
inspectionPersonBoolMust
.
must
(
QueryBuilders
.
prefixQuery
(
"superviseOrgCode"
,
orgCode
));
inspectionPersonBoolMust
.
must
(
inspectionUnitTypeBoolMust
);
inspectionPersonBoolMust
.
mustNot
(
QueryBuilders
.
wildcardQuery
(
"unitType.keyword"
,
"*检验检测机构*"
));
String
equipIndex
=
StatisticalAnalysisEnum
.
equip
.
getKey
();
String
equipIndex
=
StatisticalAnalysisEnum
.
equip
.
getKey
();
String
companyIndex
=
StatisticalAnalysisEnum
.
company
.
getKey
();
String
companyIndex
=
StatisticalAnalysisEnum
.
company
.
getKey
();
String
personIndex
=
StatisticalAnalysisEnum
.
person
.
getKey
();
String
personIndex
=
StatisticalAnalysisEnum
.
person
.
getKey
();
if
(
businessType
.
equals
(
StatisticalAnalysisEnum
.
equip
.
getCode
()))
{
if
(
businessType
.
equals
(
StatisticalAnalysisEnum
.
equip
.
getCode
()))
{
// 获取企业总数
// 获取企业总数
Long
companyCount
=
getStatisticCount
(
companyBoolMust
,
companyIndex
);
Long
companyCount
=
getStatisticCount
(
companyBoolMust
,
companyIndex
);
// 获取人员总数
// 获取人员总数
Long
personCount
=
getStatisticCount
(
personBoolMust
,
personIndex
);
Long
personCount
=
getStatisticCount
(
personBoolMust
,
personIndex
);
// 获取检验检测机构总数
Long
inspectionCompanyCount
=
getStatisticCount
(
inspectionCompanyBoolMust
,
companyIndex
);
// 获取检验检测机构人员总数
Long
inspectionPersonCount
=
getStatisticCount
(
inspectionPersonBoolMust
,
personIndex
);
tabTotalMap
.
put
(
StatisticalAnalysisEnum
.
company
.
getCode
(),
companyCount
);
tabTotalMap
.
put
(
StatisticalAnalysisEnum
.
company
.
getCode
(),
companyCount
);
tabTotalMap
.
put
(
StatisticalAnalysisEnum
.
person
.
getCode
(),
personCount
);
tabTotalMap
.
put
(
StatisticalAnalysisEnum
.
person
.
getCode
(),
personCount
);
tabTotalMap
.
put
(
StatisticalAnalysisEnum
.
inspectionCompany
.
getCode
(),
inspectionCompanyCount
);
tabTotalMap
.
put
(
StatisticalAnalysisEnum
.
inspectionPerson
.
getCode
(),
inspectionPersonCount
);
}
else
if
(
businessType
.
equals
(
StatisticalAnalysisEnum
.
company
.
getCode
()))
{
}
else
if
(
businessType
.
equals
(
StatisticalAnalysisEnum
.
company
.
getCode
()))
{
// 获取设备总数
// 获取设备总数
Long
equipCount
=
getStatisticCount
(
equipBoolMust
,
equipIndex
);
Long
equipCount
=
getStatisticCount
(
equipBoolMust
,
equipIndex
);
// 获取人员总数
// 获取人员总数
Long
personCount
=
getStatisticCount
(
personBoolMust
,
personIndex
);
Long
personCount
=
getStatisticCount
(
personBoolMust
,
personIndex
);
// 获取检验检测机构总数
Long
inspectionCompanyCount
=
getStatisticCount
(
inspectionCompanyBoolMust
,
companyIndex
);
// 获取检验检测机构人员总数
Long
inspectionPersonCount
=
getStatisticCount
(
inspectionPersonBoolMust
,
personIndex
);
tabTotalMap
.
put
(
StatisticalAnalysisEnum
.
equip
.
getCode
(),
equipCount
);
tabTotalMap
.
put
(
StatisticalAnalysisEnum
.
equip
.
getCode
(),
equipCount
);
tabTotalMap
.
put
(
StatisticalAnalysisEnum
.
person
.
getCode
(),
personCount
);
tabTotalMap
.
put
(
StatisticalAnalysisEnum
.
person
.
getCode
(),
personCount
);
tabTotalMap
.
put
(
StatisticalAnalysisEnum
.
inspectionCompany
.
getCode
(),
inspectionCompanyCount
);
tabTotalMap
.
put
(
StatisticalAnalysisEnum
.
inspectionPerson
.
getCode
(),
inspectionPersonCount
);
}
else
if
(
businessType
.
equals
(
StatisticalAnalysisEnum
.
person
.
getCode
()))
{
// 获取设备总数
Long
equipCount
=
getStatisticCount
(
equipBoolMust
,
equipIndex
);
// 获取企业总数
Long
companyCount
=
getStatisticCount
(
companyBoolMust
,
companyIndex
);
// 获取检验检测机构总数
Long
inspectionCompanyCount
=
getStatisticCount
(
inspectionCompanyBoolMust
,
companyIndex
);
// 获取检验检测机构人员总数
Long
inspectionPersonCount
=
getStatisticCount
(
inspectionPersonBoolMust
,
personIndex
);
tabTotalMap
.
put
(
StatisticalAnalysisEnum
.
equip
.
getCode
(),
equipCount
);
tabTotalMap
.
put
(
StatisticalAnalysisEnum
.
company
.
getCode
(),
companyCount
);
tabTotalMap
.
put
(
StatisticalAnalysisEnum
.
inspectionCompany
.
getCode
(),
inspectionCompanyCount
);
tabTotalMap
.
put
(
StatisticalAnalysisEnum
.
inspectionPerson
.
getCode
(),
inspectionPersonCount
);
}
else
if
(
businessType
.
equals
(
StatisticalAnalysisEnum
.
inspectionCompany
.
getCode
()))
{
// 获取设备总数
Long
equipCount
=
getStatisticCount
(
equipBoolMust
,
equipIndex
);
// 获取企业总数
Long
companyCount
=
getStatisticCount
(
companyBoolMust
,
companyIndex
);
// 获取人员总数
Long
personCount
=
getStatisticCount
(
personBoolMust
,
personIndex
);
// 获取检验检测机构人员总数
Long
inspectionPersonCount
=
getStatisticCount
(
inspectionPersonBoolMust
,
personIndex
);
tabTotalMap
.
put
(
StatisticalAnalysisEnum
.
equip
.
getCode
(),
equipCount
);
tabTotalMap
.
put
(
StatisticalAnalysisEnum
.
company
.
getCode
(),
companyCount
);
tabTotalMap
.
put
(
StatisticalAnalysisEnum
.
person
.
getCode
(),
personCount
);
tabTotalMap
.
put
(
StatisticalAnalysisEnum
.
inspectionPerson
.
getCode
(),
inspectionPersonCount
);
}
else
{
}
else
{
// 获取设备总数
// 获取设备总数
Long
equipCount
=
getStatisticCount
(
equipBoolMust
,
equipIndex
);
Long
equipCount
=
getStatisticCount
(
equipBoolMust
,
equipIndex
);
// 获取企业总数
// 获取企业总数
Long
companyCount
=
getStatisticCount
(
companyBoolMust
,
companyIndex
);
Long
companyCount
=
getStatisticCount
(
companyBoolMust
,
companyIndex
);
// 获取人员总数
Long
personCount
=
getStatisticCount
(
personBoolMust
,
personIndex
);
// 获取检验检测机构总数
Long
inspectionCompanyCount
=
getStatisticCount
(
inspectionCompanyBoolMust
,
companyIndex
);
tabTotalMap
.
put
(
StatisticalAnalysisEnum
.
equip
.
getCode
(),
equipCount
);
tabTotalMap
.
put
(
StatisticalAnalysisEnum
.
equip
.
getCode
(),
equipCount
);
tabTotalMap
.
put
(
StatisticalAnalysisEnum
.
company
.
getCode
(),
companyCount
);
tabTotalMap
.
put
(
StatisticalAnalysisEnum
.
company
.
getCode
(),
companyCount
);
tabTotalMap
.
put
(
StatisticalAnalysisEnum
.
person
.
getCode
(),
personCount
);
tabTotalMap
.
put
(
StatisticalAnalysisEnum
.
inspectionCompany
.
getCode
(),
inspectionCompanyCount
);
}
}
}
}
...
@@ -3089,6 +3237,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
...
@@ -3089,6 +3237,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
JSONObject
filterParams
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
filter
.
get
(
"filterParams"
)));
JSONObject
filterParams
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
filter
.
get
(
"filterParams"
)));
String
filterType
=
"advanced"
;
String
filterType
=
"advanced"
;
String
unitCategory
=
filterParams
.
getString
(
"unitCategory"
);
// 组装人员过滤条件
// 组装人员过滤条件
this
.
getPersonBoolQueryBuilder
(
filterParams
,
boolMust
,
filterType
);
this
.
getPersonBoolQueryBuilder
(
filterParams
,
boolMust
,
filterType
);
...
@@ -3098,12 +3247,25 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
...
@@ -3098,12 +3247,25 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
.
map
(
filterParamsObj
->
filterParams
.
getJSONArray
(
"unitType"
))
.
map
(
filterParamsObj
->
filterParams
.
getJSONArray
(
"unitType"
))
.
map
(
unitTypeObj
->
!
unitTypeObj
.
isEmpty
())
.
map
(
unitTypeObj
->
!
unitTypeObj
.
isEmpty
())
.
orElse
(
false
);
.
orElse
(
false
);
boolean
is3LeveFlag
=
Optional
.
of
(
filter
)
.
map
(
obj
->
obj
.
getJSONObject
(
"filterParams"
))
.
map
(
filterParamsObj
->
filterParamsObj
.
getJSONArray
(
"threeLevel"
))
.
map
(
threeLevelObj
->
!
threeLevelObj
.
isEmpty
())
.
orElse
(
false
);
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
// 一级统计
// 一级统计
if
(!
is2LeveFlag
)
{
if
(!
is2LeveFlag
)
{
return
getTotalAggMapsByUnitType
(
request
,
builder
,
boolMust
,
tabTotalMap
,
StatisticalAnalysisEnum
.
person
);
companyBoolMust
(
boolMust
,
"company"
);
Map
<
String
,
Object
>
dats
=
getTotalAggMapsByUnitType
(
request
,
builder
,
boolMust
,
tabTotalMap
,
StatisticalAnalysisEnum
.
person
);
result
=
getUseAndProductAndFillingStatistics
(
dats
);
}
else
if
(!
is3LeveFlag
)
{
if
(
unitCategory
.
equals
(
UnitCategoryEnum
.
use
.
getCode
()))
{
companyBoolMust
(
boolMust
,
UnitCategoryEnum
.
use
.
getCode
());
}
else
if
(
unitCategory
.
equals
(
UnitCategoryEnum
.
produce
.
getCode
()))
{
companyBoolMust
(
boolMust
,
UnitCategoryEnum
.
produce
.
getCode
());
}
else
{
}
else
{
// 二级统计
companyBoolMust
(
boolMust
,
UnitCategoryEnum
.
filling
.
getCode
());
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
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
()
...
@@ -3112,13 +3274,57 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
...
@@ -3112,13 +3274,57 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
result
.
put
(
"datas"
,
new
JSONObject
()
result
.
put
(
"datas"
,
new
JSONObject
()
.
fluentPut
(
"expiryDateStatus"
,
expiryDateStatus
)
.
fluentPut
(
"expiryDateStatus"
,
expiryDateStatus
)
.
fluentPut
(
"personType"
,
personType
));
.
fluentPut
(
"personType"
,
personType
));
}
result
=
getTotalAggMapsByUnitType
(
request
,
builder
,
boolMust
,
tabTotalMap
,
StatisticalAnalysisEnum
.
person
);
}
else
{
JSONArray
threeLevel
=
filterParams
.
getJSONArray
(
"threeLevel"
);
String
filterCode
=
threeLevel
.
getString
(
0
);
boolMust
.
must
(
QueryBuilders
.
wildcardQuery
(
"unitType.keyword"
,
"*"
+
filterCode
+
"*"
));
tabTotalMap
.
put
(
StatisticalAnalysisEnum
.
person
.
getCode
(),
this
.
queryDpStatisticsTotalByIndex
(
boolMust
,
StatisticalAnalysisEnum
.
person
.
getKey
()));
JSONObject
expiryDateStatus
=
this
.
getExpiryDateStatusGroupStatistics
(
boolMust
);
JSONObject
personType
=
this
.
getPersonTypeGroupStatistics
(
boolMust
);
result
.
put
(
"tabTotalMap"
,
new
JSONObject
()
.
fluentPut
(
"expiryDateStatusTotal"
,
this
.
sumWithJSONObjectValues
(
expiryDateStatus
))
.
fluentPut
(
"personTypeTotal"
,
this
.
sumWithJSONObjectValues
(
personType
)));
result
.
put
(
"datas"
,
new
JSONObject
()
.
fluentPut
(
"expiryDateStatus"
,
expiryDateStatus
)
.
fluentPut
(
"personType"
,
personType
));
}
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
List
<
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
());
// 汇总总数
tabTotalMap
.
put
(
statisticalAnalysisEnum
.
getCode
(),
total
);
// 聚合查询
// 聚合查询
builder
.
size
(
0
);
// 不返回任何文档,只返回聚合结果
builder
.
size
(
0
);
// 不返回任何文档,只返回聚合结果
String
aggName
=
"unit_types_split"
;
String
aggName
=
"unit_types_split"
;
...
@@ -3135,9 +3341,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
...
@@ -3135,9 +3341,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
e
);
throw
new
RuntimeException
(
e
);
}
}
// 汇总总数
return
result
;
tabTotalMap
.
put
(
statisticalAnalysisEnum
.
getCode
(),
total
);
return
Collections
.
singletonList
(
result
);
}
}
public
void
buildPersonWithCompanyTypeGroupResult
(
Terms
unitTypesTerms
,
Map
<
String
,
Object
>
result
)
{
public
void
buildPersonWithCompanyTypeGroupResult
(
Terms
unitTypesTerms
,
Map
<
String
,
Object
>
result
)
{
...
@@ -3185,6 +3389,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
...
@@ -3185,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"
);
...
@@ -3202,44 +3407,173 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
...
@@ -3202,44 +3407,173 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
.
map
(
filterParamsObj
->
filterParamsObj
.
getJSONArray
(
"unitType"
))
.
map
(
filterParamsObj
->
filterParamsObj
.
getJSONArray
(
"unitType"
))
.
map
(
unitTypeObj
->
!
unitTypeObj
.
isEmpty
())
.
map
(
unitTypeObj
->
!
unitTypeObj
.
isEmpty
())
.
orElse
(
false
);
.
orElse
(
false
);
boolean
is3LeveFlag
=
Optional
.
of
(
filter
)
.
map
(
obj
->
obj
.
getJSONObject
(
"filterParams"
))
.
map
(
filterParamsObj
->
filterParamsObj
.
getJSONArray
(
"threeLevel"
))
.
map
(
threeLevelObj
->
!
threeLevelObj
.
isEmpty
())
.
orElse
(
false
);
// 一级统计
// 一级统计
if
(!
is2LeveFlag
)
{
if
(!
is2LeveFlag
)
{
return
getTotalAggMapsByUnitType
(
request
,
builder
,
boolMust
,
tabTotalMap
,
StatisticalAnalysisEnum
.
company
);
// 计算总数
}
else
{
boolMust
.
should
(
QueryBuilders
.
matchQuery
(
"unitType"
,
UnitTypeEnum
.
sydw
.
getName
()))
// 二级统计
.
should
(
QueryBuilders
.
matchQuery
(
"unitType"
,
UnitTypeEnum
.
grzt
.
getName
()))
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
.
should
(
QueryBuilders
.
matchQuery
(
"unitType"
,
UnitTypeEnum
.
zzdw
.
getName
()))
String
unitType
=
filterParams
.
getJSONArray
(
"unitType"
).
getString
(
0
);
.
should
(
QueryBuilders
.
matchQuery
(
"unitType"
,
UnitTypeEnum
.
sjdw
.
getName
()))
// 使用单位:使用单位 返回管控级别和所属行业;个人主体 前端不下钻
.
should
(
QueryBuilders
.
matchQuery
(
"unitType"
,
UnitTypeEnum
.
azgzwxdw
.
getName
()))
boolMust
.
must
(
QueryBuilders
.
matchQuery
(
"unitType"
,
unitType
));
.
should
(
QueryBuilders
.
matchQuery
(
"unitType"
,
UnitTypeEnum
.
czdw
.
getName
()))
.
minimumShouldMatch
(
1
);
Map
<
String
,
Object
>
datas
=
getTotalAggMapsByUnitType
(
request
,
builder
,
boolMust
,
tabTotalMap
,
StatisticalAnalysisEnum
.
company
);
return
Collections
.
singletonList
(
getUseAndProductAndFillingStatistics
(
datas
));
}
else
if
(!
is3LeveFlag
)
{
Long
companyCount
=
getStatisticCount
(
boolMust
,
StatisticalAnalysisEnum
.
company
.
getKey
());
Long
companyCount
=
getStatisticCount
(
boolMust
,
StatisticalAnalysisEnum
.
company
.
getKey
());
JSONObject
industrySupervisor
=
this
.
getItemGroupStatisticsByItemName
(
boolMust
,
StatisticalAnalysisEnum
.
company
.
getKey
(),
"industrySupervisorAggName"
,
"industrySupervisor"
,
this
::
buildIndustrySupervisorGroupResult
);
if
(
unitCategory
.
equals
(
UnitCategoryEnum
.
use
.
getType
()))
{
getTotalAggMapsByUnitType
(
request
,
builder
,
boolMust
,
tabTotalMap
,
StatisticalAnalysisEnum
.
company
);
JSONObject
regulatoryLabels
=
this
.
getItemGroupStatisticsByItemName
(
boolMust
,
StatisticalAnalysisEnum
.
company
.
getKey
(),
"regulatoryLabelsAggName"
,
"regulatoryLabels"
,
this
::
buildRegulatoryLabelsGroupResult
);
Long
levelControl1
=
0L
;
Long
levelControl2
=
0L
;
Long
levelControl3
=
0L
;
for
(
String
key
:
regulatoryLabels
.
keySet
())
{
if
(
key
.
contains
(
"levelControl1"
))
{
levelControl1
+=
regulatoryLabels
.
getLong
(
key
);
}
else
if
(
key
.
contains
(
"levelControl2"
))
{
levelControl2
+=
regulatoryLabels
.
getLong
(
key
);
}
else
if
(
key
.
contains
(
"levelControl3"
))
{
levelControl3
+=
regulatoryLabels
.
getLong
(
key
);
}
}
Map
<
String
,
Long
>
levelControlMap
=
new
HashMap
<>();
levelControlMap
.
put
(
"levelControl1"
,
levelControl1
);
levelControlMap
.
put
(
"levelControl2"
,
levelControl2
);
levelControlMap
.
put
(
"levelControl3"
,
levelControl3
);
result
.
put
(
"datas"
,
new
JSONObject
()
.
fluentPut
(
"regulatoryLabels"
,
levelControlMap
)
.
fluentPut
(
"industrySupervisor"
,
industrySupervisor
));
result
.
put
(
"tabTotalMap"
,
new
JSONObject
()
.
fluentPut
(
"regulatoryLabelsTotal"
,
companyCount
)
.
fluentPut
(
"industrySupervisorTotal"
,
this
.
sumWithJSONObjectValues
(
industrySupervisor
)));
}
else
if
(
unitCategory
.
equals
(
UnitCategoryEnum
.
produce
.
getCode
()))
{
Map
<
String
,
Object
>
datas
=
getTotalAggMapsByUnitType
(
request
,
builder
,
boolMust
,
tabTotalMap
,
StatisticalAnalysisEnum
.
company
);
Map
<
String
,
Object
>
productMap
=
new
HashMap
<>();
productMap
.
put
(
"design"
,
datas
.
get
(
"sjdw"
));
productMap
.
put
(
"factory"
,
datas
.
get
(
"zzdw"
));
productMap
.
put
(
"construction"
,
datas
.
get
(
"azgzwxdw"
));
result
.
put
(
"datas"
,
new
JSONObject
()
.
fluentPut
(
"companyType"
,
productMap
)
.
fluentPut
(
"industrySupervisor"
,
industrySupervisor
));
result
.
put
(
"tabTotalMap"
,
new
JSONObject
()
.
fluentPut
(
"companyTotal"
,
companyCount
)
.
fluentPut
(
"industrySupervisorTotal"
,
this
.
sumWithJSONObjectValues
(
industrySupervisor
)));
}
else
if
(
unitCategory
.
equals
(
UnitCategoryEnum
.
filling
.
getCode
()))
{
getTotalAggMapsByUnitType
(
request
,
builder
,
boolMust
,
tabTotalMap
,
StatisticalAnalysisEnum
.
company
);
JSONObject
permitStatus
=
getPermitStatusGroupStatistics
(
boolMust
);
result
.
put
(
"datas"
,
new
JSONObject
()
.
fluentPut
(
"permitStatus"
,
permitStatus
)
.
fluentPut
(
"industrySupervisor"
,
industrySupervisor
));
result
.
put
(
"tabTotalMap"
,
new
JSONObject
()
.
fluentPut
(
"permitStatusTotal"
,
companyCount
)
.
fluentPut
(
"industrySupervisorTotal"
,
this
.
sumWithJSONObjectValues
(
industrySupervisor
)));
}
return
Collections
.
singletonList
(
result
);
}
else
if
(
is3LeveFlag
)
{
JSONArray
threeLevel
=
filterParams
.
getJSONArray
(
"threeLevel"
);
String
filterCode
=
threeLevel
.
getString
(
0
);
Map
<
String
,
Long
>
levelControlMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
companyMap
=
new
HashMap
<>();
JSONObject
permitStatus
=
new
JSONObject
();
if
(
unitCategory
.
equals
(
UnitCategoryEnum
.
use
.
getCode
()))
{
if
(
unitCategory
.
equals
(
UnitCategoryEnum
.
use
.
getCode
()))
{
if
(
filterCode
.
equals
(
"levelControl1"
)
||
filterCode
.
equals
(
"levelControl2"
))
{
boolMust
.
must
(
QueryBuilders
.
wildcardQuery
(
"regulatoryLabels.keyword"
,
(
filterCode
.
contains
(
"1"
)
?
"*一级管控*"
:
"*二级管控*"
)));
getTotalAggMapsByUnitType
(
request
,
builder
,
boolMust
,
tabTotalMap
,
StatisticalAnalysisEnum
.
company
);
JSONObject
regulatoryLabels
=
this
.
getItemGroupStatisticsByItemName
(
boolMust
,
JSONObject
regulatoryLabels
=
this
.
getItemGroupStatisticsByItemName
(
boolMust
,
StatisticalAnalysisEnum
.
company
.
getKey
(),
StatisticalAnalysisEnum
.
company
.
getKey
(),
"regulatoryLabelsAggName"
,
"regulatoryLabelsAggName"
,
"regulatoryLabels"
,
"regulatoryLabels"
,
this
::
buildRegulatoryLabelsGroupResult
);
this
::
buildRegulatoryLabelsGroupResult
);
for
(
String
key
:
regulatoryLabels
.
keySet
())
{
if
(
key
.
contains
(
filterCode
))
{
levelControlMap
.
put
(
key
,
regulatoryLabels
.
getLong
(
key
));
}
}
}
else
{
Map
<
String
,
Object
>
datas
=
getTotalAggMapsByUnitType
(
request
,
builder
,
boolMust
,
tabTotalMap
,
StatisticalAnalysisEnum
.
company
);
companyMap
.
put
(
"use"
,
datas
.
get
(
"sydw"
));
companyMap
.
put
(
"grzt"
,
datas
.
get
(
"grzt"
));
}
}
else
if
(
unitCategory
.
equals
(
UnitCategoryEnum
.
produce
.
getCode
()))
{
boolMust
.
must
(
QueryBuilders
.
wildcardQuery
(
"unitType.keyword"
,
"*"
+
filterCode
+
"*"
));
getTotalAggMapsByUnitType
(
request
,
builder
,
boolMust
,
tabTotalMap
,
StatisticalAnalysisEnum
.
company
);
permitStatus
=
getPermitStatusGroupStatistics
(
boolMust
);
}
Long
companyCount
=
getStatisticCount
(
boolMust
,
StatisticalAnalysisEnum
.
company
.
getKey
());
JSONObject
industrySupervisor
=
this
.
getItemGroupStatisticsByItemName
(
boolMust
,
JSONObject
industrySupervisor
=
this
.
getItemGroupStatisticsByItemName
(
boolMust
,
StatisticalAnalysisEnum
.
company
.
getKey
(),
StatisticalAnalysisEnum
.
company
.
getKey
(),
"industrySupervisorAggName"
,
"industrySupervisorAggName"
,
"industrySupervisor"
,
"industrySupervisor"
,
this
::
buildIndustrySupervisorGroupResult
);
this
::
buildIndustrySupervisorGroupResult
);
if
(
unitCategory
.
equals
(
UnitCategoryEnum
.
use
.
getCode
()))
{
if
(
filterCode
.
equals
(
"levelControl1"
)
||
filterCode
.
equals
(
"levelControl2"
))
{
result
.
put
(
"datas"
,
new
JSONObject
()
.
fluentPut
(
"regulatoryLabels"
,
levelControlMap
)
.
fluentPut
(
"industrySupervisor"
,
industrySupervisor
));
result
.
put
(
"tabTotalMap"
,
new
JSONObject
()
result
.
put
(
"tabTotalMap"
,
new
JSONObject
()
.
fluentPut
(
"regulatoryLabelsTotal"
,
companyCount
)
.
fluentPut
(
"regulatoryLabelsTotal"
,
companyCount
)
.
fluentPut
(
"industrySupervisorTotal"
,
this
.
sumWithJSONObjectValues
(
industrySupervisor
)));
.
fluentPut
(
"industrySupervisorTotal"
,
this
.
sumWithJSONObjectValues
(
industrySupervisor
)));
}
else
{
result
.
put
(
"datas"
,
new
JSONObject
()
result
.
put
(
"datas"
,
new
JSONObject
()
.
fluentPut
(
"regulatoryLabels"
,
regulatoryLabels
)
.
fluentPut
(
"company"
,
companyMap
)
.
fluentPut
(
"industrySupervisor"
,
industrySupervisor
));
.
fluentPut
(
"industrySupervisor"
,
industrySupervisor
));
}
else
if
(
unitCategory
.
equals
(
UnitCategoryEnum
.
license
.
getCode
()))
{
// 许可单位:设计单位、制造单位、充装单位、检验机构、检查机构、安装改造维修单位
JSONObject
permitStatus
=
getPermitStatusGroupStatistics
(
boolMust
);
result
.
put
(
"tabTotalMap"
,
new
JSONObject
()
result
.
put
(
"tabTotalMap"
,
new
JSONObject
()
.
fluentPut
(
"permitStatusTotal"
,
companyCount
));
.
fluentPut
(
"regulatoryLabelsTotal"
,
companyCount
)
result
.
put
(
"datas"
,
new
JSONObject
()
.
fluentPut
(
"industrySupervisorTotal"
,
this
.
sumWithJSONObjectValues
(
industrySupervisor
)));
.
fluentPut
(
"permitStatus"
,
permitStatus
));
}
}
}
else
if
(
unitCategory
.
equals
(
UnitCategoryEnum
.
produce
.
getCode
()))
{
result
.
put
(
"datas"
,
new
JSONObject
()
.
fluentPut
(
"permitStatus"
,
permitStatus
)
.
fluentPut
(
"industrySupervisor"
,
industrySupervisor
));
result
.
put
(
"tabTotalMap"
,
new
JSONObject
()
.
fluentPut
(
"permitStatusTotal"
,
companyCount
)
.
fluentPut
(
"industrySupervisorTotal"
,
this
.
sumWithJSONObjectValues
(
industrySupervisor
)));
}
return
Collections
.
singletonList
(
result
);
return
Collections
.
singletonList
(
result
);
}
}
return
Collections
.
singletonList
(
result
);
}
private
Map
<
String
,
Object
>
getUseAndProductAndFillingStatistics
(
Map
<
String
,
Object
>
datas
)
{
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
Long
filling
=
0L
;
Long
use
=
0L
;
Long
produce
=
0L
;
for
(
String
key
:
datas
.
keySet
())
{
if
(
key
.
equals
(
"sydw"
))
{
use
+=
Long
.
valueOf
(
datas
.
get
(
"sydw"
).
toString
());
}
else
if
(
key
.
equals
(
"grzt"
))
{
use
+=
Long
.
valueOf
(
datas
.
get
(
"grzt"
).
toString
());
}
else
if
(
key
.
equals
(
"sjdw"
))
{
produce
+=
Long
.
valueOf
(
datas
.
get
(
"sjdw"
).
toString
());
}
else
if
(
key
.
equals
(
"zzdw"
))
{
produce
+=
Long
.
valueOf
(
datas
.
get
(
"zzdw"
).
toString
());
}
else
if
(
key
.
equals
(
"azgzwxdw"
))
{
produce
+=
Long
.
valueOf
(
datas
.
get
(
"azgzwxdw"
).
toString
());
}
else
if
(
key
.
equals
(
"czdw"
))
{
filling
=
Long
.
valueOf
(
datas
.
get
(
"czdw"
).
toString
());
}
}
result
.
put
(
"use"
,
use
);
result
.
put
(
"produce"
,
produce
);
result
.
put
(
"filling"
,
filling
);
return
result
;
}
}
private
List
<
Map
<
String
,
Object
>>
queryDpEquipStatistics
(
JSONObject
filter
,
SearchRequest
request
,
SearchSourceBuilder
builder
,
BoolQueryBuilder
boolMust
,
Map
<
String
,
Object
>
tabTotalMap
)
{
private
List
<
Map
<
String
,
Object
>>
queryDpEquipStatistics
(
JSONObject
filter
,
SearchRequest
request
,
SearchSourceBuilder
builder
,
BoolQueryBuilder
boolMust
,
Map
<
String
,
Object
>
tabTotalMap
)
{
...
@@ -3343,7 +3677,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
...
@@ -3343,7 +3677,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
SearchSourceBuilder
scoreBuilder
=
new
SearchSourceBuilder
();
SearchSourceBuilder
scoreBuilder
=
new
SearchSourceBuilder
();
Map
<
String
,
Object
>
scoreCountByGroup
=
new
HashMap
<>();
Map
<
String
,
Object
>
scoreCountByGroup
=
new
HashMap
<>();
getStatisticCountByGroup
(
request
,
scoreBuilder
,
scoreQuery
,
"DATA_QUALITY_SCORE"
,
scoreCountByGroup
,
"scoreCount"
);
getStatisticCountByGroup
(
request
,
scoreBuilder
,
scoreQuery
,
"DATA_QUALITY_SCORE"
,
scoreCountByGroup
,
"scoreCount"
);
if
(!
code
.
startsWith
(
"8"
))
{
if
(!
code
.
startsWith
(
"8"
))
{
for
(
String
key
:
scoreCountByGroup
.
keySet
())
{
for
(
String
key
:
scoreCountByGroup
.
keySet
())
{
Long
classCount
=
"1"
.
equals
(
key
)
?
oneClassCount
+=
(
Long
)
scoreCountByGroup
.
get
(
key
)
:
(
"2"
.
equals
(
key
)
?
(
twoClassCount
+=
(
Long
)
scoreCountByGroup
.
get
(
key
))
:
(
threeClassCount
+=
(
Long
)
scoreCountByGroup
.
get
(
key
)));
Long
classCount
=
"1"
.
equals
(
key
)
?
oneClassCount
+=
(
Long
)
scoreCountByGroup
.
get
(
key
)
:
(
"2"
.
equals
(
key
)
?
(
twoClassCount
+=
(
Long
)
scoreCountByGroup
.
get
(
key
))
:
(
threeClassCount
+=
(
Long
)
scoreCountByGroup
.
get
(
key
)));
}
}
...
@@ -3444,7 +3778,6 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
...
@@ -3444,7 +3778,6 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
map
.
put
(
"key"
,
i
);
map
.
put
(
"key"
,
i
);
map
.
put
(
"code"
,
i
);
map
.
put
(
"code"
,
i
);
map
.
put
(
"noChild"
,
Boolean
.
TRUE
);
map
.
put
(
"noChild"
,
Boolean
.
TRUE
);
map
.
put
(
"noDetails"
,
Boolean
.
TRUE
);
map
.
put
(
"noBottom"
,
Boolean
.
TRUE
);
map
.
put
(
"noBottom"
,
Boolean
.
TRUE
);
map
.
put
(
"fieldKey"
,
"DATA_QUALITY_SCORE"
);
map
.
put
(
"fieldKey"
,
"DATA_QUALITY_SCORE"
);
String
imgUrl
=
String
.
format
(
"/upload/tzs/dpscreen/statistic/datalevel%s.png"
,
i
);
String
imgUrl
=
String
.
format
(
"/upload/tzs/dpscreen/statistic/datalevel%s.png"
,
i
);
...
...
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 @
a8d29d1b
...
@@ -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