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
855110fb
Commit
855110fb
authored
Jul 25, 2024
by
刘林
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/develop_tzs_register_to_0715' into…
Merge remote-tracking branch 'origin/develop_tzs_register_to_0715' into develop_tzs_register_to_0715
parents
a16e6129
160307e9
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
104 additions
and
95 deletions
+104
-95
IdxBizJgRegisterInfoServiceImpl.java
.../jg/biz/service/impl/IdxBizJgRegisterInfoServiceImpl.java
+3
-3
JgInstallationNoticeServiceImpl.java
.../jg/biz/service/impl/JgInstallationNoticeServiceImpl.java
+4
-3
JgTransferNoticeServiceImpl.java
...dule/jg/biz/service/impl/JgTransferNoticeServiceImpl.java
+1
-1
StCommonController.java
...t/module/statistcs/biz/controller/StCommonController.java
+5
-1
YJDPStatisticsController.java
...le/statistcs/biz/controller/YJDPStatisticsController.java
+1
-1
JGDPStatisticsServiceImpl.java
...statistcs/biz/service/impl/JGDPStatisticsServiceImpl.java
+83
-80
ZLDPStatisticsServiceImpl.java
...statistcs/biz/service/impl/ZLDPStatisticsServiceImpl.java
+7
-6
No files found.
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/impl/IdxBizJgRegisterInfoServiceImpl.java
View file @
855110fb
...
...
@@ -1374,7 +1374,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
// 安装告知设备选择 - 业务限制
// 根据设备类别(EQU_CATEGORY)、安装单位过滤设备(USC_UNIT_CREDIT_CODE) 下面过滤条件已有
// 设备类别为工业管道(8300)时,用工程装置名称过滤
if
(!
ValidationUtil
.
isEmpty
(
EQU_CATEGORY_CODE
)
&&
ValidationUtil
.
equals
(
EQU_CATEGORY_CODE
,
"8300"
))
{
if
(!
ValidationUtil
.
isEmpty
(
map
.
get
(
EQU_CATEGORY_CODE
))
&&
ValidationUtil
.
equals
(
map
.
get
(
EQU_CATEGORY_CODE
)
,
"8300"
))
{
if
(
ValidationUtil
.
isEmpty
(
map
.
get
(
"projectContraption"
)))
{
throw
new
BadRequest
(
"请先选择工程装置信息!"
);
}
...
...
@@ -1405,7 +1405,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
syBuilder
.
must
(
QueryBuilders
.
wildcardQuery
(
"USE_ORG_CODE"
,
"*"
));
boolMust
.
must
(
syBuilder
);
// 设备类别为工业管道(8300)时,用工程装置名称过滤
if
(!
ValidationUtil
.
isEmpty
(
EQU_CATEGORY_CODE
)
&&
ValidationUtil
.
equals
(
EQU_CATEGORY_CODE
,
"8300"
))
{
if
(!
ValidationUtil
.
isEmpty
(
map
.
get
(
EQU_CATEGORY_CODE
))
&&
ValidationUtil
.
equals
(
map
.
get
(
EQU_CATEGORY_CODE
)
,
"8300"
))
{
if
(
ValidationUtil
.
isEmpty
(
map
.
get
(
"projectContraption"
)))
{
throw
new
BadRequest
(
"请先选择工程装置信息!"
);
}
...
...
@@ -1596,7 +1596,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
if
(!
ObjectUtils
.
isEmpty
(
map
.
getString
(
PROJECT_CONTRAPTION
)))
{
BoolQueryBuilder
pBuilder
=
QueryBuilders
.
boolQuery
();
String
test
=
QueryParser
.
escape
(
map
.
getString
(
PROJECT_CONTRAPTION
));
pBuilder
.
must
(
QueryBuilders
.
wildcardQuery
(
PROJECT_CONTRAPTION
,
"*"
+
QueryParser
.
escape
(
test
.
toLowerCase
())
+
"*"
));
pBuilder
.
must
(
QueryBuilders
.
matchQuery
(
PROJECT_CONTRAPTION
,
test
.
toLowerCase
()
));
boolMust
.
must
(
pBuilder
);
}
builder
.
query
(
boolMust
);
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/impl/JgInstallationNoticeServiceImpl.java
View file @
855110fb
...
...
@@ -765,7 +765,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
BeanUtils
.
copyProperties
(
obj
,
taskMessageDto
);
dto
.
setModel
(
taskMessageDto
);
// 摘要 按原有规则组装
dto
.
setTaskContent
(
String
.
format
(
"
来自%s【%s】的业务办理"
,
obj
.
getEquList
(),
StringUtils
.
isEmpty
(
obj
.
getFactoryNum
())
?
""
:
obj
.
getFactoryNum
()));
dto
.
setTaskContent
(
String
.
format
(
"
发起了【安装告知】的业务办理,【申请单号:%s】"
,
obj
.
getApplyNo
()));
// 申请单号
dto
.
setTaskCode
(
obj
.
getApplyNo
());
// 业务类型枚举code值
...
...
@@ -798,7 +798,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
taskModelDto
.
setStartUserCompanyName
(
item
.
getCreateUserCompanyName
());
// 任务发起人所在单位
taskModelDto
.
setStartDate
(
item
.
getCreateDate
());
taskModelDto
.
setNextExecuteUser
(
item
.
getNextExecuteIds
());
taskModelDto
.
setTaskContent
(
String
.
format
(
"
来自%s【%s】的业务办理,【申请单号:%s】"
,
item
.
getEquList
(),
StringUtils
.
isEmpty
(
item
.
getFactoryNum
())
?
""
:
item
.
getFactoryNum
(),
item
.
getApplyNo
()));
taskModelDto
.
setTaskContent
(
String
.
format
(
"
发起了【安装告知】的业务办理,【申请单号:%s】"
,
item
.
getApplyNo
()));
TaskMessageDto
taskMessageDto
=
new
TaskMessageDto
();
BeanUtils
.
copyProperties
(
item
,
taskMessageDto
);
taskModelDto
.
setModel
(
taskMessageDto
);
...
...
@@ -821,6 +821,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
dto
.
setNoticeDate
(
new
Date
());
// 统计使用
dto
.
setReceiveCompanyOrgCode
(
companyBo
.
getOrgCode
());
dto
.
setEquList
(
String
.
valueOf
(
deviceList
.
get
(
0
).
get
(
"EQU_LIST"
)));
if
(
SUBMIT_TYPE_FLOW
.
equals
(
submitType
))
{
dto
.
setNextExecuteIds
(
workflowResultList
.
get
(
0
).
getNextExecutorRoleIds
());
dto
.
setNextExecuteUserIds
(
workflowResultList
.
get
(
0
).
getNextExecutorUserIds
());
...
...
@@ -1622,7 +1623,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
if
(!
ObjectUtils
.
isEmpty
(
registerInfo
)
&&
!
ObjectUtils
.
isEmpty
(
registerInfo
.
getEquList
())
&&
!
ObjectUtils
.
isEmpty
(
registerInfo
.
getEquCategory
())){
equ
.
setEquListCode
(
registerInfo
.
getEquList
());
equ
.
setEquCategoryCode
(
registerInfo
.
getEquCategory
());
if
(
ObjectUtils
.
isEmpty
(
item
.
getEquList
())
||
ObjectUtils
.
isEmpty
(
item
.
getEquCategoryCode
())){
if
(
ObjectUtils
.
isEmpty
(
item
.
getEquList
Code
())
||
ObjectUtils
.
isEmpty
(
item
.
getEquCategoryCode
())){
item
.
setEquListCode
(
registerInfo
.
getEquList
());
item
.
setEquCategoryCode
(
registerInfo
.
getEquCategory
());
if
(
"8300"
.
equals
(
item
.
getEquCategoryCode
())){
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/impl/JgTransferNoticeServiceImpl.java
View file @
855110fb
...
...
@@ -637,7 +637,7 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
taskModelDto
.
setStartUserCompanyName
(
item
.
getCreateUserCompanyName
());
// 任务发起人所在单位
taskModelDto
.
setStartDate
(
item
.
getCreateDate
());
taskModelDto
.
setNextExecuteUser
(
item
.
getNextExecuteIds
());
taskModelDto
.
setStartDate
(
new
Date
());
taskModelDto
.
setTaskContent
(
String
.
format
(
"来自%s的业务办理,【申请单号:%s】"
,
item
.
getEquList
(),
item
.
getApplyNo
()));
TaskMessageDto
taskMessageDto
=
new
TaskMessageDto
();
BeanUtils
.
copyProperties
(
item
,
taskMessageDto
);
...
...
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-biz/src/main/java/com/yeejoin/amos/boot/module/statistcs/biz/controller/StCommonController.java
View file @
855110fb
...
...
@@ -18,7 +18,11 @@ import java.util.List;
@RequestMapping
(
value
=
"/st-common"
)
public
class
StCommonController
{
StCommonServiceImpl
commonService
;
private
StCommonServiceImpl
commonService
;
public
StCommonController
(
StCommonServiceImpl
commonService
)
{
this
.
commonService
=
commonService
;
}
/**
* 获取用户regionCode
...
...
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-biz/src/main/java/com/yeejoin/amos/boot/module/statistcs/biz/controller/YJDPStatisticsController.java
View file @
855110fb
...
...
@@ -30,7 +30,7 @@ import java.util.Map;
*/
@RestController
@Api
(
tags
=
"大屏-应急-统计API"
)
@RequestMapping
(
"/d
b
/yj"
)
@RequestMapping
(
"/d
p
/yj"
)
public
class
YJDPStatisticsController
{
...
...
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 @
855110fb
...
...
@@ -242,6 +242,9 @@ public class JGDPStatisticsServiceImpl {
public
Map
<
String
,
Object
>
getCenterMapCountDataForGlobal
(
DPFilterParamDto
dpFilterParamDto
)
{
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
String
orgCode
=
this
.
getAndSetOrgCode
(
dpFilterParamDto
.
getCityCode
());
if
(
StringUtils
.
isEmpty
(
orgCode
))
{
return
new
HashMap
<>();
}
// 1.气瓶数量统计
long
cylinderNum
=
this
.
staticsCenterMapCountDataForCylinder
(
result
,
orgCode
);
//1.8大类设备数量统计,压力容器里包括气瓶所以需要特殊处理,在统计压力容器时去掉气瓶的数量
...
...
@@ -258,6 +261,9 @@ public class JGDPStatisticsServiceImpl {
private
Map
<
String
,
Object
>
getCenterMapOverviewData
(
DPFilterParamDto
dpFilterParamDto
)
{
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
String
orgCode
=
this
.
getAndSetOrgCode
(
dpFilterParamDto
.
getCityCode
());
if
(
StringUtils
.
isEmpty
(
orgCode
)){
return
new
HashMap
<>();
}
// 0. 气瓶数量统计
long
cylinderNum
=
this
.
staticsCenterMapCountDataForCylinder
(
result
,
orgCode
);
// 1. 8大类设备数量统计,压力容器里包括气瓶所以需要特殊处理,在统计压力容器时去掉气瓶的数量
...
...
@@ -859,13 +865,13 @@ public class JGDPStatisticsServiceImpl {
public
List
<
Map
<
String
,
Object
>>
maintenanceCountTopTen
(
DPFilterParamDto
dpFilterParamDto
)
{
List
<
RegionModel
>
regionModels
=
setRegionIfRootParent
(
dpFilterParamDto
);
List
<
Integer
>
regionCodeList
=
regionModels
.
stream
().
map
(
m
->
m
.
getRegionCode
()).
collect
(
Collectors
.
toList
());
Map
<
Integer
,
RegionModel
>
regionMap
=
regionModels
.
stream
().
collect
(
Collectors
.
toMap
(
RegionModel:
:
getRegionCode
,
Function
.
identity
()));
List
<
Map
<
String
,
Object
>>
list
=
dpStatisticsMapper
.
maintenanceCountTopTen
(
dpFilterParamDto
,
regionCodeList
);
Map
<
Integer
,
RegionModel
>
regionMap
=
regionModels
.
stream
().
collect
(
Collectors
.
toMap
(
RegionModel:
:
getRegionCode
,
Function
.
identity
()));
List
<
Map
<
String
,
Object
>>
list
=
dpStatisticsMapper
.
maintenanceCountTopTen
(
dpFilterParamDto
,
regionCodeList
);
List
<
Map
<
String
,
Object
>>
resultList
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
list
.
size
();
i
++)
{
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
result
.
put
(
"key"
,
i
);
result
.
put
(
"city"
,
regionMap
.
get
(
Integer
.
valueOf
(
list
.
get
(
i
).
get
(
"companyCode"
)
+
""
)).
getRegionName
());
result
.
put
(
"city"
,
regionMap
.
get
(
Integer
.
valueOf
(
list
.
get
(
i
).
get
(
"companyCode"
)
+
""
)).
getRegionName
());
result
.
put
(
"count"
,
list
.
get
(
i
).
get
(
"count"
));
result
.
put
(
"name"
,
list
.
get
(
i
).
get
(
"companyName"
));
resultList
.
add
(
result
);
...
...
@@ -876,13 +882,13 @@ public class JGDPStatisticsServiceImpl {
public
Map
<
String
,
Object
>
maintenanceCount
(
DPFilterParamDto
dpFilterParamDto
)
{
List
<
RegionModel
>
regionModels
=
setRegionIfRootParent
(
dpFilterParamDto
);
List
<
Integer
>
regionCodeList
=
regionModels
.
stream
().
map
(
m
->
m
.
getRegionCode
()).
collect
(
Collectors
.
toList
());
Map
<
Integer
,
RegionModel
>
regionMap
=
regionModels
.
stream
().
collect
(
Collectors
.
toMap
(
RegionModel:
:
getRegionCode
,
Function
.
identity
()));
List
<
Map
<
String
,
Object
>>
list
=
dpStatisticsMapper
.
maintenanceCount
(
dpFilterParamDto
,
regionCodeList
);
Map
<
Integer
,
RegionModel
>
regionMap
=
regionModels
.
stream
().
collect
(
Collectors
.
toMap
(
RegionModel:
:
getRegionCode
,
Function
.
identity
()));
List
<
Map
<
String
,
Object
>>
list
=
dpStatisticsMapper
.
maintenanceCount
(
dpFilterParamDto
,
regionCodeList
);
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
List
xList
=
new
ArrayList
();
List
yList
=
new
ArrayList
();
for
(
int
i
=
0
;
i
<
list
.
size
();
i
++)
{
xList
.
add
(
regionMap
.
get
(
Integer
.
valueOf
(
list
.
get
(
i
).
get
(
"companyCode"
)
+
""
)).
getRegionName
());
xList
.
add
(
regionMap
.
get
(
Integer
.
valueOf
(
list
.
get
(
i
).
get
(
"companyCode"
)
+
""
)).
getRegionName
());
yList
.
add
(
list
.
get
(
i
).
get
(
"count"
));
}
resultMap
.
put
(
"xdata"
,
xList
);
...
...
@@ -913,31 +919,31 @@ public class JGDPStatisticsServiceImpl {
private
Map
<
String
,
Object
>
cancelCount
(
Map
<
String
,
Object
>
resultMap
,
List
<
RegionModel
>
regionModelList
)
{
Map
<
String
,
Integer
>
countMap
=
new
HashMap
<>();
Map
<
String
,
Integer
>
countMap
=
new
HashMap
<>();
List
<
Object
>
xDataList
=
new
ArrayList
<>();
List
<
Object
>
yDataList
=
new
ArrayList
<>();
List
<
Integer
>
regionCodeList
=
regionModelList
.
stream
().
map
(
m
->
m
.
getRegionCode
()).
collect
(
Collectors
.
toList
());
List
<
Map
<
String
,
String
>>
orgCodeByCompanyCodes
=
commonMapper
.
getOrgCodesByCompanyCodes
(
regionCodeList
);
Map
<
String
,
String
>
companyMap
=
new
HashMap
<>();
List
<
String
>
orgCodes
=
new
ArrayList
<>();
orgCodeByCompanyCodes
.
stream
().
forEach
(
t
->
{
companyMap
.
put
(
t
.
get
(
"companyCode"
)
+
""
,
t
.
get
(
"orgCode"
));
if
(
StringUtils
.
isNotBlank
(
t
.
get
(
"orgCode"
)))
{
orgCodeByCompanyCodes
.
stream
().
forEach
(
t
->
{
companyMap
.
put
(
t
.
get
(
"companyCode"
)
+
""
,
t
.
get
(
"orgCode"
));
if
(
StringUtils
.
isNotBlank
(
t
.
get
(
"orgCode"
)))
{
orgCodes
.
add
(
t
.
get
(
"orgCode"
));
}
});
//注销报废
List
<
Map
<
String
,
Object
>>
cancelCoountList
=
dpStatisticsMapper
.
cancelCountByOrgCodes
(
orgCodes
);
countByMap
(
countMap
,
cancelCoountList
);
List
<
Map
<
String
,
Object
>>
cancelCoountList
=
dpStatisticsMapper
.
cancelCountByOrgCodes
(
orgCodes
);
countByMap
(
countMap
,
cancelCoountList
);
for
(
int
i
=
0
;
i
<
regionModelList
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
regionModelList
.
size
();
i
++)
{
AtomicInteger
count
=
new
AtomicInteger
();
xDataList
.
add
(
regionModelList
.
get
(
i
).
getRegionName
());
if
(
StringUtils
.
isNotEmpty
(
companyMap
.
get
(
regionModelList
.
get
(
i
).
getRegionCode
()+
""
)))
{
if
(
StringUtils
.
isNotEmpty
(
companyMap
.
get
(
regionModelList
.
get
(
i
).
getRegionCode
()
+
""
)))
{
int
finalI
=
i
;
countMap
.
forEach
((
k
,
v
)
->
{
if
(
k
.
startsWith
(
companyMap
.
get
(
regionModelList
.
get
(
finalI
).
getRegionCode
()+
""
)))
{
if
(
null
!=
v
)
{
countMap
.
forEach
((
k
,
v
)
->
{
if
(
k
.
startsWith
(
companyMap
.
get
(
regionModelList
.
get
(
finalI
).
getRegionCode
()
+
""
)))
{
if
(
null
!=
v
)
{
count
.
addAndGet
(
v
);
}
}
...
...
@@ -953,31 +959,31 @@ public class JGDPStatisticsServiceImpl {
private
Map
<
String
,
Object
>
disableCount
(
Map
<
String
,
Object
>
resultMap
,
List
<
RegionModel
>
regionModelList
)
{
Map
<
String
,
Integer
>
countMap
=
new
HashMap
<>();
Map
<
String
,
Integer
>
countMap
=
new
HashMap
<>();
List
<
Object
>
xDataList
=
new
ArrayList
<>();
List
<
Object
>
yDataList
=
new
ArrayList
<>();
List
<
Integer
>
regionCodeList
=
regionModelList
.
stream
().
map
(
m
->
m
.
getRegionCode
()).
collect
(
Collectors
.
toList
());
List
<
Map
<
String
,
String
>>
orgCodeByCompanyCodes
=
commonMapper
.
getOrgCodesByCompanyCodes
(
regionCodeList
);
Map
<
String
,
String
>
companyMap
=
new
HashMap
<>();
List
<
String
>
orgCodes
=
new
ArrayList
<>();
orgCodeByCompanyCodes
.
stream
().
forEach
(
t
->
{
companyMap
.
put
(
t
.
get
(
"companyCode"
)
+
""
,
t
.
get
(
"orgCode"
));
if
(
StringUtils
.
isNotBlank
(
t
.
get
(
"orgCode"
)))
{
orgCodeByCompanyCodes
.
stream
().
forEach
(
t
->
{
companyMap
.
put
(
t
.
get
(
"companyCode"
)
+
""
,
t
.
get
(
"orgCode"
));
if
(
StringUtils
.
isNotBlank
(
t
.
get
(
"orgCode"
)))
{
orgCodes
.
add
(
t
.
get
(
"orgCode"
));
}
});
//启用停用
List
<
Map
<
String
,
Object
>>
disableCountList
=
dpStatisticsMapper
.
disableCountByOrgCodes
(
orgCodes
);
countByMap
(
countMap
,
disableCountList
);
List
<
Map
<
String
,
Object
>>
disableCountList
=
dpStatisticsMapper
.
disableCountByOrgCodes
(
orgCodes
);
countByMap
(
countMap
,
disableCountList
);
for
(
int
i
=
0
;
i
<
regionModelList
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
regionModelList
.
size
();
i
++)
{
AtomicInteger
count
=
new
AtomicInteger
();
xDataList
.
add
(
regionModelList
.
get
(
i
).
getRegionName
());
if
(
StringUtils
.
isNotEmpty
(
companyMap
.
get
(
regionModelList
.
get
(
i
).
getRegionCode
()+
""
)))
{
if
(
StringUtils
.
isNotEmpty
(
companyMap
.
get
(
regionModelList
.
get
(
i
).
getRegionCode
()
+
""
)))
{
int
finalI
=
i
;
countMap
.
forEach
((
k
,
v
)
->
{
if
(
k
.
startsWith
(
companyMap
.
get
(
regionModelList
.
get
(
finalI
).
getRegionCode
()+
""
)))
{
if
(
null
!=
v
)
{
countMap
.
forEach
((
k
,
v
)
->
{
if
(
k
.
startsWith
(
companyMap
.
get
(
regionModelList
.
get
(
finalI
).
getRegionCode
()
+
""
)))
{
if
(
null
!=
v
)
{
count
.
addAndGet
(
v
);
}
}
...
...
@@ -993,44 +999,44 @@ public class JGDPStatisticsServiceImpl {
private
Map
<
String
,
Object
>
changeCount
(
Map
<
String
,
Object
>
resultMap
,
List
<
RegionModel
>
regionModelList
)
{
Map
<
String
,
Integer
>
countMap
=
new
HashMap
<>();
Map
<
String
,
Integer
>
countMap
=
new
HashMap
<>();
List
<
Object
>
xDataList
=
new
ArrayList
<>();
List
<
Object
>
yDataList
=
new
ArrayList
<>();
List
<
Integer
>
regionCodeList
=
regionModelList
.
stream
().
map
(
m
->
m
.
getRegionCode
()).
collect
(
Collectors
.
toList
());
List
<
Map
<
String
,
String
>>
orgCodeByCompanyCodes
=
commonMapper
.
getOrgCodesByCompanyCodes
(
regionCodeList
);
Map
<
String
,
String
>
companyMap
=
new
HashMap
<>();
List
<
String
>
orgCodes
=
new
ArrayList
<>();
orgCodeByCompanyCodes
.
stream
().
forEach
(
t
->
{
companyMap
.
put
(
t
.
get
(
"companyCode"
)
+
""
,
t
.
get
(
"orgCode"
));
if
(
StringUtils
.
isNotBlank
(
t
.
get
(
"orgCode"
)))
{
orgCodeByCompanyCodes
.
stream
().
forEach
(
t
->
{
companyMap
.
put
(
t
.
get
(
"companyCode"
)
+
""
,
t
.
get
(
"orgCode"
));
if
(
StringUtils
.
isNotBlank
(
t
.
get
(
"orgCode"
)))
{
orgCodes
.
add
(
t
.
get
(
"orgCode"
));
}
});
//更名变更登记
List
<
Map
<
String
,
Object
>>
changeNameList
=
dpStatisticsMapper
.
changeNameCountByOrgCodes
(
orgCodes
);
countByMap
(
countMap
,
changeNameList
);
List
<
Map
<
String
,
Object
>>
changeNameList
=
dpStatisticsMapper
.
changeNameCountByOrgCodes
(
orgCodes
);
countByMap
(
countMap
,
changeNameList
);
//改造变更登记
List
<
Map
<
String
,
Object
>>
reformList
=
dpStatisticsMapper
.
changeReformCountByOrgCodes
(
orgCodes
);
countByMap
(
countMap
,
reformList
);
List
<
Map
<
String
,
Object
>>
reformList
=
dpStatisticsMapper
.
changeReformCountByOrgCodes
(
orgCodes
);
countByMap
(
countMap
,
reformList
);
//移装变更登记
List
<
Map
<
String
,
Object
>>
transferList
=
dpStatisticsMapper
.
changeTransferCountByOrgCodes
(
orgCodes
);
countByMap
(
countMap
,
transferList
);
List
<
Map
<
String
,
Object
>>
transferList
=
dpStatisticsMapper
.
changeTransferCountByOrgCodes
(
orgCodes
);
countByMap
(
countMap
,
transferList
);
//单位变更登记
List
<
Map
<
String
,
Object
>>
unitList
=
dpStatisticsMapper
.
changeUnitCountByOrgCodes
(
orgCodes
);
countByMap
(
countMap
,
unitList
);
List
<
Map
<
String
,
Object
>>
unitList
=
dpStatisticsMapper
.
changeUnitCountByOrgCodes
(
orgCodes
);
countByMap
(
countMap
,
unitList
);
//单位变更登记
List
<
Map
<
String
,
Object
>>
vehicleList
=
dpStatisticsMapper
.
changeVehicleCountByOrgCodes
(
orgCodes
);
countByMap
(
countMap
,
vehicleList
);
List
<
Map
<
String
,
Object
>>
vehicleList
=
dpStatisticsMapper
.
changeVehicleCountByOrgCodes
(
orgCodes
);
countByMap
(
countMap
,
vehicleList
);
for
(
int
i
=
0
;
i
<
regionModelList
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
regionModelList
.
size
();
i
++)
{
AtomicInteger
count
=
new
AtomicInteger
();
xDataList
.
add
(
regionModelList
.
get
(
i
).
getRegionName
());
if
(
StringUtils
.
isNotEmpty
(
companyMap
.
get
(
regionModelList
.
get
(
i
).
getRegionCode
()+
""
)))
{
if
(
StringUtils
.
isNotEmpty
(
companyMap
.
get
(
regionModelList
.
get
(
i
).
getRegionCode
()
+
""
)))
{
int
finalI
=
i
;
countMap
.
forEach
((
k
,
v
)
->
{
if
(
k
.
startsWith
(
companyMap
.
get
(
regionModelList
.
get
(
finalI
).
getRegionCode
()+
""
)))
{
if
(
null
!=
v
)
{
countMap
.
forEach
((
k
,
v
)
->
{
if
(
k
.
startsWith
(
companyMap
.
get
(
regionModelList
.
get
(
finalI
).
getRegionCode
()
+
""
)))
{
if
(
null
!=
v
)
{
count
.
addAndGet
(
v
);
}
}
...
...
@@ -1047,33 +1053,33 @@ public class JGDPStatisticsServiceImpl {
private
Map
<
String
,
Object
>
useCount
(
Map
<
String
,
Object
>
resultMap
,
List
<
RegionModel
>
regionModelList
)
{
Map
<
String
,
Integer
>
countMap
=
new
HashMap
<>();
Map
<
String
,
Integer
>
countMap
=
new
HashMap
<>();
List
<
Object
>
xDataList
=
new
ArrayList
<>();
List
<
Object
>
yDataList
=
new
ArrayList
<>();
List
<
Integer
>
regionCodeList
=
regionModelList
.
stream
().
map
(
m
->
m
.
getRegionCode
()).
collect
(
Collectors
.
toList
());
List
<
Map
<
String
,
String
>>
orgCodeByCompanyCodes
=
commonMapper
.
getOrgCodesByCompanyCodes
(
regionCodeList
);
Map
<
String
,
String
>
companyMap
=
new
HashMap
<>();
List
<
String
>
orgCodes
=
new
ArrayList
<>();
orgCodeByCompanyCodes
.
stream
().
forEach
(
t
->
{
companyMap
.
put
(
t
.
get
(
"companyCode"
)
+
""
,
t
.
get
(
"orgCode"
));
if
(
StringUtils
.
isNotBlank
(
t
.
get
(
"orgCode"
)))
{
orgCodeByCompanyCodes
.
stream
().
forEach
(
t
->
{
companyMap
.
put
(
t
.
get
(
"companyCode"
)
+
""
,
t
.
get
(
"orgCode"
));
if
(
StringUtils
.
isNotBlank
(
t
.
get
(
"orgCode"
)))
{
orgCodes
.
add
(
t
.
get
(
"orgCode"
));
}
});
//使用告知
List
<
Map
<
String
,
Object
>>
useCountList
=
dpStatisticsMapper
.
useCountByOrgCodes
(
orgCodes
);
countByMap
(
countMap
,
useCountList
);
List
<
Map
<
String
,
Object
>>
useCountList
=
dpStatisticsMapper
.
useCountByOrgCodes
(
orgCodes
);
countByMap
(
countMap
,
useCountList
);
//车用气瓶使用告知
List
<
Map
<
String
,
Object
>>
vehicleCountList
=
dpStatisticsMapper
.
vehicleCountByOrgCodes
(
orgCodes
);
countByMap
(
countMap
,
vehicleCountList
);
for
(
int
i
=
0
;
i
<
regionModelList
.
size
();
i
++)
{
countByMap
(
countMap
,
vehicleCountList
);
for
(
int
i
=
0
;
i
<
regionModelList
.
size
();
i
++)
{
AtomicInteger
count
=
new
AtomicInteger
();
xDataList
.
add
(
regionModelList
.
get
(
i
).
getRegionName
());
if
(
StringUtils
.
isNotEmpty
(
companyMap
.
get
(
regionModelList
.
get
(
i
).
getRegionCode
()+
""
)))
{
if
(
StringUtils
.
isNotEmpty
(
companyMap
.
get
(
regionModelList
.
get
(
i
).
getRegionCode
()
+
""
)))
{
int
finalI
=
i
;
countMap
.
forEach
((
k
,
v
)
->
{
if
(
k
.
startsWith
(
companyMap
.
get
(
regionModelList
.
get
(
finalI
).
getRegionCode
()+
""
)))
{
if
(
null
!=
v
)
{
countMap
.
forEach
((
k
,
v
)
->
{
if
(
k
.
startsWith
(
companyMap
.
get
(
regionModelList
.
get
(
finalI
).
getRegionCode
()
+
""
)))
{
if
(
null
!=
v
)
{
count
.
addAndGet
(
v
);
}
}
...
...
@@ -1089,39 +1095,39 @@ public class JGDPStatisticsServiceImpl {
}
private
Map
<
String
,
Object
>
noticeCount
(
Map
<
String
,
Object
>
resultMap
,
List
<
RegionModel
>
regionModelList
)
{
Map
<
String
,
Integer
>
countMap
=
new
HashMap
<>();
Map
<
String
,
Integer
>
countMap
=
new
HashMap
<>();
List
<
Object
>
xDataList
=
new
ArrayList
<>();
List
<
Object
>
yDataList
=
new
ArrayList
<>();
List
<
Integer
>
regionCodeList
=
regionModelList
.
stream
().
map
(
m
->
m
.
getRegionCode
()).
collect
(
Collectors
.
toList
());
List
<
Map
<
String
,
String
>>
orgCodeByCompanyCodes
=
commonMapper
.
getOrgCodesByCompanyCodes
(
regionCodeList
);
Map
<
String
,
String
>
companyMap
=
new
HashMap
<>();
List
<
String
>
orgCodes
=
new
ArrayList
<>();
orgCodeByCompanyCodes
.
stream
().
forEach
(
t
->
{
companyMap
.
put
(
t
.
get
(
"companyCode"
)
+
""
,
t
.
get
(
"orgCode"
));
if
(
StringUtils
.
isNotBlank
(
t
.
get
(
"orgCode"
)))
{
orgCodeByCompanyCodes
.
stream
().
forEach
(
t
->
{
companyMap
.
put
(
t
.
get
(
"companyCode"
)
+
""
,
t
.
get
(
"orgCode"
));
if
(
StringUtils
.
isNotBlank
(
t
.
get
(
"orgCode"
)))
{
orgCodes
.
add
(
t
.
get
(
"orgCode"
));
}
});
//安装告知
List
<
Map
<
String
,
Object
>>
installCountList
=
dpStatisticsMapper
.
installCountByOrgCodes
(
orgCodes
);
countByMap
(
countMap
,
installCountList
);
List
<
Map
<
String
,
Object
>>
installCountList
=
dpStatisticsMapper
.
installCountByOrgCodes
(
orgCodes
);
countByMap
(
countMap
,
installCountList
);
//维修告知
List
<
Map
<
String
,
Object
>>
maintenanceCountList
=
dpStatisticsMapper
.
maintenanceNoticeCountByOrgCodes
(
orgCodes
);
countByMap
(
countMap
,
maintenanceCountList
);
countByMap
(
countMap
,
maintenanceCountList
);
//改造告知
List
<
Map
<
String
,
Object
>>
reformCountList
=
dpStatisticsMapper
.
reformCountByOrgCodes
(
orgCodes
);
countByMap
(
countMap
,
reformCountList
);
countByMap
(
countMap
,
reformCountList
);
//移装告知
List
<
Map
<
String
,
Object
>>
transferCountList
=
dpStatisticsMapper
.
transferCountByOrgCodes
(
orgCodes
);
countByMap
(
countMap
,
transferCountList
);
for
(
int
i
=
0
;
i
<
regionModelList
.
size
();
i
++)
{
countByMap
(
countMap
,
transferCountList
);
for
(
int
i
=
0
;
i
<
regionModelList
.
size
();
i
++)
{
AtomicInteger
count
=
new
AtomicInteger
();
xDataList
.
add
(
regionModelList
.
get
(
i
).
getRegionName
());
if
(
StringUtils
.
isNotEmpty
(
companyMap
.
get
(
regionModelList
.
get
(
i
).
getRegionCode
()+
""
)))
{
if
(
StringUtils
.
isNotEmpty
(
companyMap
.
get
(
regionModelList
.
get
(
i
).
getRegionCode
()
+
""
)))
{
int
finalI
=
i
;
countMap
.
forEach
((
k
,
v
)
->
{
if
(
k
.
startsWith
(
companyMap
.
get
(
regionModelList
.
get
(
finalI
).
getRegionCode
()+
""
)))
{
if
(
null
!=
v
)
{
countMap
.
forEach
((
k
,
v
)
->
{
if
(
k
.
startsWith
(
companyMap
.
get
(
regionModelList
.
get
(
finalI
).
getRegionCode
()
+
""
)))
{
if
(
null
!=
v
)
{
count
.
addAndGet
(
v
);
}
}
...
...
@@ -1138,9 +1144,9 @@ public class JGDPStatisticsServiceImpl {
private
void
countByMap
(
Map
<
String
,
Integer
>
countMap
,
List
<
Map
<
String
,
Object
>>
list
)
{
for
(
int
i
=
0
;
i
<
list
.
size
();
i
++)
{
if
(
null
==
countMap
.
get
(
list
.
get
(
i
).
get
(
"orgCode"
)))
{
countMap
.
put
(
list
.
get
(
i
).
get
(
"orgCode"
).
toString
(),
Integer
.
valueOf
(
list
.
get
(
i
).
get
(
"count"
)
+
""
));
countMap
.
put
(
list
.
get
(
i
).
get
(
"orgCode"
).
toString
(),
Integer
.
valueOf
(
list
.
get
(
i
).
get
(
"count"
)
+
""
));
}
else
{
countMap
.
put
(
list
.
get
(
i
).
get
(
"orgCode"
).
toString
(),
countMap
.
get
(
list
.
get
(
i
).
get
(
"orgCode"
))
+
Integer
.
valueOf
(
list
.
get
(
i
).
get
(
"count"
)
+
""
));
countMap
.
put
(
list
.
get
(
i
).
get
(
"orgCode"
).
toString
(),
countMap
.
get
(
list
.
get
(
i
).
get
(
"orgCode"
))
+
Integer
.
valueOf
(
list
.
get
(
i
).
get
(
"count"
)
+
""
));
}
}
}
...
...
@@ -1416,9 +1422,6 @@ public class JGDPStatisticsServiceImpl {
DPFilterParamDto
filterParamDto
=
new
DPFilterParamDto
();
filterParamDto
.
setCityCode
(
r
.
getRegionCode
().
toString
());
Map
<
String
,
Object
>
itemResult
=
staticsCenterMapCountDataForRegin
(
filterParamDto
);
if
(
itemResult
==
null
)
{
itemResult
=
new
HashMap
<>();
}
itemResult
.
put
(
REGION_CODE
,
r
.
getRegionCode
());
itemResult
.
put
(
REGION_NAME
,
r
.
getRegionName
());
return
itemResult
;
...
...
@@ -1433,8 +1436,8 @@ public class JGDPStatisticsServiceImpl {
if
(
orgCode
==
null
)
{
orgCode
=
getAndSetOrgCode
(
dpFilterParamDto
.
getCityCode
());
if
(
orgCode
==
null
)
{
result
.
put
(
DPMapStatisticsItemEnum
.
DEVICE_COUNT
.
getCode
(),
0
);
result
.
put
(
DPMapStatisticsItemEnum
.
CERTIFICATE_COUNT
.
getCode
(),
0
);
result
.
put
(
DPMapStatisticsItemEnum
.
DEVICE_COUNT
.
getCode
(),
0
L
);
result
.
put
(
DPMapStatisticsItemEnum
.
CERTIFICATE_COUNT
.
getCode
(),
0
L
);
return
result
;
}
regionCodeOrgCodeMap
.
put
(
dpFilterParamDto
.
getCityCode
(),
orgCode
);
...
...
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/ZLDPStatisticsServiceImpl.java
View file @
855110fb
...
...
@@ -465,9 +465,7 @@ public class ZLDPStatisticsServiceImpl {
String
orgCode
=
getAndSetOrgCode
(
screenDto
.
getCityCode
());
searchSourceBuilder
.
query
(
QueryBuilders
.
boolQuery
()
.
must
(
QueryBuilders
.
wildcardQuery
(
"ORG_BRANCH_CODE.keyword"
,
QueryParser
.
escape
(
orgCode
)
+
"*"
)));
searchSourceBuilder
.
aggregation
(
AggregationBuilders
.
terms
(
"USE_SITE_CODE"
).
field
(
"USE_SITE_CODE"
)
);
searchSourceBuilder
.
aggregation
(
AggregationBuilders
.
terms
(
"count_by_use_site_code"
).
field
(
"USE_SITE_CODE"
).
size
(
500
));
searchRequest
.
source
(
searchSourceBuilder
);
Map
<
String
,
Integer
>
dataMap
=
new
HashMap
<>();
List
<
Map
<
String
,
Object
>>
returnList
=
new
ArrayList
<>();
...
...
@@ -476,7 +474,7 @@ public class ZLDPStatisticsServiceImpl {
SearchResponse
searchResponse
=
restHighLevelClient
.
search
(
searchRequest
,
RequestOptions
.
DEFAULT
);
// 获取所有聚合结果
Aggregations
aggregations
=
searchResponse
.
getAggregations
();
Terms
termsResult
=
aggregations
.
get
(
"
USE_SITE_CODE
"
);
Terms
termsResult
=
aggregations
.
get
(
"
count_by_use_site_code
"
);
for
(
Terms
.
Bucket
bucket
:
termsResult
.
getBuckets
())
{
String
category
=
bucket
.
getKeyAsString
();
// 或者使用 bucket.getKey() 对于非字符串类型
...
...
@@ -486,11 +484,14 @@ public class ZLDPStatisticsServiceImpl {
List
<
DataDictionary
>
dataDictionaryList
=
iDataDictionaryService
.
getByType
(
"ADDRESS"
);
dataDictionaryList
.
stream
().
forEach
(
x
->
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
x
.
getName
(),
dataMap
.
getOrDefault
(
x
.
getCode
(),
0
));
map
.
put
(
"name"
,
x
.
getName
());
map
.
put
(
"value"
,
dataMap
.
getOrDefault
(
x
.
getCode
(),
0
));
dataMap
.
remove
(
x
.
getCode
());
returnList
.
add
(
map
);
});
Map
<
String
,
Object
>
otherMap
=
new
HashMap
<>();
otherMap
.
put
(
"其他"
,
dataMap
.
getOrDefault
(
"其他"
,
0
)
+
dataMap
.
getOrDefault
(
""
,
0
));
otherMap
.
put
(
"name"
,
"其他"
);
otherMap
.
put
(
"value"
,
dataMap
.
values
().
stream
().
mapToLong
(
e
->
e
).
sum
());
returnList
.
add
(
otherMap
);
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
...
...
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