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
06d70205
Commit
06d70205
authored
Jul 22, 2024
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.业务全过程增加单位过滤
parent
998ca368
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
425 additions
and
388 deletions
+425
-388
TZSCommonConstant.java
...os/boot/module/common/api/constant/TZSCommonConstant.java
+11
-0
ReginStepEnum.java
...join/amos/boot/module/common/api/enums/ReginStepEnum.java
+18
-5
DPStatisticsServiceImpl.java
...t/module/jg/biz/service/impl/DPStatisticsServiceImpl.java
+396
-383
No files found.
amos-boot-system-tzs/amos-boot-module-common/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/constant/TZSCommonConstant.java
0 → 100644
View file @
06d70205
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
api
.
constant
;
/**
* @author Administrator
*/
public
class
TZSCommonConstant
{
/**
* 陕西省行政区划编码
*/
public
final
static
String
SHAN_XI_REGION_CODE
=
"61000"
;
}
amos-boot-system-tzs/amos-boot-module-common/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/enums/ReginStepEnum.java
View file @
06d70205
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
api
.
enums
;
import
com.yeejoin.amos.feign.systemctl.model.RegionModel
;
import
lombok.Getter
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
* 需要提级的行政区划
*/
...
...
@@ -11,16 +16,15 @@ public enum ReginStepEnum {
/**
* 杨凌区
*/
YANGLING
(
"610403"
,
"杨陵区"
,
"map"
),
YANGLING
(
"610403"
,
"杨陵区"
,
"map"
),
/**
* 西咸新区
*/
XIXIAN
(
"617000"
,
"西咸新区"
,
"other
"
),
XIXIAN
(
"617000"
,
"西咸新区"
,
"map
"
),
/**
* 韩城市
*/
HANCHENG
(
"610581"
,
"韩城市"
,
"map"
);
HANCHENG
(
"610581"
,
"韩城市"
,
"map"
);
private
final
String
code
;
...
...
@@ -29,9 +33,18 @@ public enum ReginStepEnum {
private
final
String
type
;
ReginStepEnum
(
String
code
,
String
name
,
String
type
)
{
ReginStepEnum
(
String
code
,
String
name
,
String
type
)
{
this
.
code
=
code
;
this
.
name
=
name
;
this
.
type
=
type
;
}
public
static
List
<
RegionModel
>
enum2RegionList
(
String
type
)
{
return
Arrays
.
stream
(
ReginStepEnum
.
values
()).
filter
(
e
->
e
.
getType
().
equals
(
type
)).
map
(
e
->
{
RegionModel
regionModel
=
new
RegionModel
();
regionModel
.
setRegionCode
(
Integer
.
parseInt
(
e
.
getCode
()));
regionModel
.
setRegionName
(
e
.
getName
());
return
regionModel
;
}).
collect
(
Collectors
.
toList
());
}
}
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/DPStatisticsServiceImpl.java
View file @
06d70205
...
...
@@ -2,8 +2,10 @@ package com.yeejoin.amos.boot.module.jg.biz.service.impl;
import
cn.hutool.core.date.DateUtil
;
import
com.yeejoin.amos.boot.biz.common.dto.CountDto
;
import
com.yeejoin.amos.boot.module.common.api.constant.TZSCommonConstant
;
import
com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.LegendDataDto
;
import
com.yeejoin.amos.boot.module.common.api.enums.ReginStepEnum
;
import
com.yeejoin.amos.boot.module.jg.api.dto.EquipBizCountDto
;
import
com.yeejoin.amos.boot.module.jg.api.dto.FourColorCountDataDto
;
import
com.yeejoin.amos.boot.module.jg.api.enums.DPMapStatisticsItemEnum
;
...
...
@@ -393,7 +395,8 @@ public class DPStatisticsServiceImpl {
}
public
List
<
Map
<
String
,
Object
>>
getCenterMapCountDataForOverview
(
DPFilterParamDto
dpFilterParamDto
)
{
List
<
Map
<
String
,
Object
>>
result
=
regionModels
.
parallelStream
().
filter
(
e
->
e
.
getParentRegionCode
()
!=
null
&&
(
e
.
getParentRegionCode
().
toString
()).
equals
(
dpFilterParamDto
.
getCityCode
())).
map
(
r
->
{
List
<
RegionModel
>
regionModels
=
this
.
setRegionIfRootParent
(
dpFilterParamDto
);
List
<
Map
<
String
,
Object
>>
result
=
regionModels
.
parallelStream
().
map
(
r
->
{
DPFilterParamDto
filterParamDto
=
new
DPFilterParamDto
();
filterParamDto
.
setCityCode
(
r
.
getRegionCode
().
toString
());
Map
<
String
,
Object
>
itemResult
=
getCenterMapOverviewData
(
filterParamDto
);
...
...
@@ -407,6 +410,16 @@ public class DPStatisticsServiceImpl {
return
result
;
}
private
List
<
RegionModel
>
setRegionIfRootParent
(
DPFilterParamDto
dpFilterParamDto
)
{
List
<
RegionModel
>
regions
=
regionModels
.
parallelStream
().
filter
(
e
->
e
.
getParentRegionCode
()
!=
null
&&
(
e
.
getParentRegionCode
().
toString
()).
equals
(
dpFilterParamDto
.
getCityCode
())).
collect
(
Collectors
.
toList
());
// 陕西省时需要在地图返回独立的地级市:韩城、杨凌、西咸
if
(
dpFilterParamDto
.
getCityCode
().
equals
(
TZSCommonConstant
.
SHAN_XI_REGION_CODE
))
{
List
<
RegionModel
>
independentRegions
=
ReginStepEnum
.
enum2RegionList
(
"map"
);
regions
.
addAll
(
independentRegions
);
}
return
regions
;
}
private
void
setCompanyDataBatch
(
List
<
Map
<
String
,
Object
>>
result
)
{
List
<
CountDto
>
countDtos
=
enterpriseInfoMapper
.
countByUnitTypeAndOrgCodeNoParam
();
...
...
@@ -636,11 +649,11 @@ public class DPStatisticsServiceImpl {
BigDecimal
finish
=
new
BigDecimal
(
String
.
valueOf
(
allFinishedCount
));
BigDecimal
flowing
=
new
BigDecimal
(
String
.
valueOf
(
allBizDataInFlowingCount
));
BigDecimal
total
=
finish
.
add
(
flowing
);
if
(
total
.
compareTo
(
BigDecimal
.
ZERO
)
>
0
)
{
if
(
total
.
compareTo
(
BigDecimal
.
ZERO
)
>
0
)
{
BigDecimal
result
=
finish
.
divide
(
total
,
2
,
RoundingMode
.
HALF_UP
);
BigDecimal
percentage
=
result
.
multiply
(
new
BigDecimal
(
"100"
)).
setScale
(
0
,
RoundingMode
.
HALF_UP
);
return
percentage
.
toPlainString
();
}
else
{
}
else
{
return
"0"
;
}
}
...
...
@@ -672,8 +685,8 @@ public class DPStatisticsServiceImpl {
return
orgCode
;
}
public
List
<
Map
<
String
,
Object
>>
equStateCount
(
DPFilterParamDto
dpFilterParamDto
)
{
List
<
Map
<
String
,
Object
>>
resultList
=
new
ArrayList
<>();
public
List
<
Map
<
String
,
Object
>>
equStateCount
(
DPFilterParamDto
dpFilterParamDto
)
{
List
<
Map
<
String
,
Object
>>
resultList
=
new
ArrayList
<>();
SearchRequest
request
=
new
SearchRequest
();
request
.
indices
(
"idx_biz_view_jg_all"
);
BoolQueryBuilder
boolMust
=
QueryBuilders
.
boolQuery
();
...
...
@@ -703,17 +716,17 @@ public class DPStatisticsServiceImpl {
* 4 注销
* 0 未登记
*/
for
(
int
i
=
0
;
i
<
5
;
i
++)
{
Map
<
String
,
Object
>
map
=
new
HashMap
();
if
(
i
==
0
)
{
for
(
int
i
=
0
;
i
<
5
;
i
++)
{
Map
<
String
,
Object
>
map
=
new
HashMap
();
if
(
i
==
0
)
{
map
.
put
(
"name"
,
"未登记"
);
}
else
if
(
i
==
1
)
{
}
else
if
(
i
==
1
)
{
map
.
put
(
"name"
,
"在用"
);
}
else
if
(
i
==
2
)
{
}
else
if
(
i
==
2
)
{
map
.
put
(
"name"
,
"停用"
);
}
else
if
(
i
==
3
)
{
}
else
if
(
i
==
3
)
{
map
.
put
(
"name"
,
"报废"
);
}
else
if
(
i
==
4
)
{
}
else
if
(
i
==
4
)
{
map
.
put
(
"name"
,
"注销"
);
}
map
.
put
(
"value"
,
dataMap
.
getOrDefault
(
String
.
valueOf
(
i
),
0L
));
...
...
@@ -726,7 +739,7 @@ public class DPStatisticsServiceImpl {
return
resultList
;
}
public
Map
<
String
,
Object
>
equStopStateCount
(
DPFilterParamDto
dpFilterParamDto
)
{
public
Map
<
String
,
Object
>
equStopStateCount
(
DPFilterParamDto
dpFilterParamDto
)
{
SearchRequest
request
=
new
SearchRequest
();
request
.
indices
(
"idx_biz_view_jg_all"
);
BoolQueryBuilder
boolMust
=
QueryBuilders
.
boolQuery
();
...
...
@@ -742,17 +755,17 @@ public class DPStatisticsServiceImpl {
.
subAggregation
(
AggregationBuilders
.
terms
(
"EQU_LIST_CODE_COUNT"
).
field
(
"EQU_LIST_CODE"
));
builder
.
aggregation
(
aggregationBuilder
);
request
.
source
(
builder
);
try
{
try
{
SearchResponse
response
=
restHighLevelClient
.
search
(
request
,
RequestOptions
.
DEFAULT
);
Terms
terms
=
response
.
getAggregations
().
get
(
"EQU_STATE_COUNT"
);
Map
<
String
,
Long
>
dataMap
=
new
HashMap
<>();
for
(
Terms
.
Bucket
bucket
:
terms
.
getBuckets
())
{
String
category
=
bucket
.
getKeyAsString
();
// 或者使用 bucket.getKey() 对于非字符串类型
Terms
subTerms
=
bucket
.
getAggregations
().
get
(
"EQU_LIST_CODE_COUNT"
);
for
(
Terms
.
Bucket
subBucket
:
subTerms
.
getBuckets
())
{
for
(
Terms
.
Bucket
subBucket
:
subTerms
.
getBuckets
())
{
String
subCategory
=
subBucket
.
getKeyAsString
();
long
docCount
=
subBucket
.
getDocCount
();
dataMap
.
put
(
category
+
"#"
+
subCategory
,
docCount
);
dataMap
.
put
(
category
+
"#"
+
subCategory
,
docCount
);
}
}
/**
...
...
@@ -773,18 +786,18 @@ public class DPStatisticsServiceImpl {
* 4 注销
* 3 报废
*/
List
<
Map
<
String
,
Object
>>
legendDataList
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
3
;
i
++)
{
Map
<
String
,
Object
>
map
=
new
HashMap
();
if
(
i
==
0
)
{
map
.
put
(
"dataKey"
,
"stop"
);
map
.
put
(
"name"
,
"停用"
);
}
else
if
(
i
==
1
)
{
map
.
put
(
"dataKey"
,
"logout"
);
map
.
put
(
"name"
,
"注销"
);
}
else
if
(
i
==
2
)
{
map
.
put
(
"dataKey"
,
"scrap"
);
map
.
put
(
"name"
,
"报废"
);
List
<
Map
<
String
,
Object
>>
legendDataList
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
3
;
i
++)
{
Map
<
String
,
Object
>
map
=
new
HashMap
();
if
(
i
==
0
)
{
map
.
put
(
"dataKey"
,
"stop"
);
map
.
put
(
"name"
,
"停用"
);
}
else
if
(
i
==
1
)
{
map
.
put
(
"dataKey"
,
"logout"
);
map
.
put
(
"name"
,
"注销"
);
}
else
if
(
i
==
2
)
{
map
.
put
(
"dataKey"
,
"scrap"
);
map
.
put
(
"name"
,
"报废"
);
}
legendDataList
.
add
(
map
);
}
...
...
@@ -792,247 +805,247 @@ public class DPStatisticsServiceImpl {
List
<
Object
>
stop
=
new
ArrayList
<>();
List
<
Object
>
logout
=
new
ArrayList
<>();
List
<
Object
>
scrap
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
9
;
i
++)
{
if
(
i
==
0
)
{
for
(
int
i
=
0
;
i
<
9
;
i
++)
{
if
(
i
==
0
)
{
stop
.
add
(
dataMap
.
getOrDefault
(
"2#2300"
,
0L
));
logout
.
add
(
dataMap
.
getOrDefault
(
"4#2300"
,
0L
));
scrap
.
add
(
dataMap
.
getOrDefault
(
"3#2300"
,
0L
));
}
else
if
(
i
==
1
)
{
}
else
if
(
i
==
1
)
{
stop
.
add
(
dataMap
.
getOrDefault
(
"2#3000"
,
0L
));
logout
.
add
(
dataMap
.
getOrDefault
(
"4#3000"
,
0L
));
scrap
.
add
(
dataMap
.
getOrDefault
(
"3#3000"
,
0L
));
}
else
if
(
i
==
2
)
{
stop
.
add
(
dataMap
.
getOrDefault
(
"2#2000"
,
0L
)
-
dataMap
.
getOrDefault
(
"2#2300"
,
0L
));
logout
.
add
(
dataMap
.
getOrDefault
(
"4#2000"
,
0L
)
-
dataMap
.
getOrDefault
(
"4#2300"
,
0L
));
scrap
.
add
(
dataMap
.
getOrDefault
(
"3#2000"
,
0L
)
-
dataMap
.
getOrDefault
(
"3#2300"
,
0L
));
}
else
if
(
i
==
3
)
{
}
else
if
(
i
==
2
)
{
stop
.
add
(
dataMap
.
getOrDefault
(
"2#2000"
,
0L
)
-
dataMap
.
getOrDefault
(
"2#2300"
,
0L
));
logout
.
add
(
dataMap
.
getOrDefault
(
"4#2000"
,
0L
)
-
dataMap
.
getOrDefault
(
"4#2300"
,
0L
));
scrap
.
add
(
dataMap
.
getOrDefault
(
"3#2000"
,
0L
)
-
dataMap
.
getOrDefault
(
"3#2300"
,
0L
));
}
else
if
(
i
==
3
)
{
stop
.
add
(
dataMap
.
getOrDefault
(
"2#1000"
,
0L
));
logout
.
add
(
dataMap
.
getOrDefault
(
"4#1000"
,
0L
));
scrap
.
add
(
dataMap
.
getOrDefault
(
"3#1000"
,
0L
));
}
else
if
(
i
==
4
)
{
}
else
if
(
i
==
4
)
{
stop
.
add
(
dataMap
.
getOrDefault
(
"2#4000"
,
0L
));
logout
.
add
(
dataMap
.
getOrDefault
(
"4#4000"
,
0L
));
scrap
.
add
(
dataMap
.
getOrDefault
(
"3#4000"
,
0L
));
}
else
if
(
i
==
5
)
{
}
else
if
(
i
==
5
)
{
stop
.
add
(
dataMap
.
getOrDefault
(
"2#5000"
,
0L
));
logout
.
add
(
dataMap
.
getOrDefault
(
"4#5000"
,
0L
));
scrap
.
add
(
dataMap
.
getOrDefault
(
"3#5000"
,
0L
));
}
else
if
(
i
==
6
)
{
}
else
if
(
i
==
6
)
{
stop
.
add
(
dataMap
.
getOrDefault
(
"2#6000"
,
0L
));
logout
.
add
(
dataMap
.
getOrDefault
(
"4#6000"
,
0L
));
scrap
.
add
(
dataMap
.
getOrDefault
(
"3#6000"
,
0L
));
}
else
if
(
i
==
7
)
{
}
else
if
(
i
==
7
)
{
stop
.
add
(
dataMap
.
getOrDefault
(
"2#8000"
,
0L
));
logout
.
add
(
dataMap
.
getOrDefault
(
"4#8000"
,
0L
));
scrap
.
add
(
dataMap
.
getOrDefault
(
"3#8000"
,
0L
));
}
else
if
(
i
==
8
)
{
}
else
if
(
i
==
8
)
{
stop
.
add
(
dataMap
.
getOrDefault
(
"2#9000"
,
0L
));
logout
.
add
(
dataMap
.
getOrDefault
(
"4#9000"
,
0L
));
scrap
.
add
(
dataMap
.
getOrDefault
(
"3#9000"
,
0L
));
}
}
Map
<
String
,
Object
>
returnMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
returnMap
=
new
HashMap
<>();
returnMap
.
put
(
"legendData"
,
legendDataList
);
returnMap
.
put
(
"xdata"
,
xDataList
);
returnMap
.
put
(
"stop"
,
stop
);
returnMap
.
put
(
"logout"
,
logout
);
returnMap
.
put
(
"scrap"
,
scrap
);
returnMap
.
put
(
"stop"
,
stop
);
returnMap
.
put
(
"logout"
,
logout
);
returnMap
.
put
(
"scrap"
,
scrap
);
return
returnMap
;
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
e
);
}
}
public
List
<
Map
<
String
,
Object
>>
maintenanceCountTopTen
(
DPFilterParamDto
dpFilterParamDto
)
{
List
<
Map
<
String
,
Object
>>
list
=
dpStatisticsMapper
.
maintenanceCountTopTen
(
dpFilterParamDto
);
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"
,
list
.
get
(
i
).
get
(
"regionName"
));
result
.
put
(
"count"
,
list
.
get
(
i
).
get
(
"count"
));
result
.
put
(
"name"
,
list
.
get
(
i
).
get
(
"companyName"
));
public
List
<
Map
<
String
,
Object
>>
maintenanceCountTopTen
(
DPFilterParamDto
dpFilterParamDto
)
{
List
<
Map
<
String
,
Object
>>
list
=
dpStatisticsMapper
.
maintenanceCountTopTen
(
dpFilterParamDto
);
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"
,
list
.
get
(
i
).
get
(
"regionName"
));
result
.
put
(
"count"
,
list
.
get
(
i
).
get
(
"count"
));
result
.
put
(
"name"
,
list
.
get
(
i
).
get
(
"companyName"
));
resultList
.
add
(
result
);
}
return
resultList
;
}
public
Map
<
String
,
Object
>
maintenanceCount
(
DPFilterParamDto
dpFilterParamDto
)
{
List
<
Map
<
String
,
Object
>>
list
=
dpStatisticsMapper
.
maintenanceCount
(
dpFilterParamDto
);
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
public
Map
<
String
,
Object
>
maintenanceCount
(
DPFilterParamDto
dpFilterParamDto
)
{
List
<
Map
<
String
,
Object
>>
list
=
dpStatisticsMapper
.
maintenanceCount
(
dpFilterParamDto
);
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
List
xList
=
new
ArrayList
();
List
yList
=
new
ArrayList
();
for
(
int
i
=
0
;
i
<
list
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
list
.
size
();
i
++)
{
xList
.
add
(
list
.
get
(
i
).
get
(
"regionName"
));
yList
.
add
(
list
.
get
(
i
).
get
(
"count"
));
}
resultMap
.
put
(
"xdata"
,
xList
);
resultMap
.
put
(
"ydata"
,
yList
);
resultMap
.
put
(
"xdata"
,
xList
);
resultMap
.
put
(
"ydata"
,
yList
);
return
resultMap
;
}
public
Map
<
String
,
Object
>
cityBusinessCount
(
DPFilterParamDto
dpFilterParamDto
)
{
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
public
Map
<
String
,
Object
>
cityBusinessCount
(
DPFilterParamDto
dpFilterParamDto
)
{
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
/**
* 业务类型0告知管理,1使用登记,2变更登记,3停用启用,4注销报废
*/
if
(
"0"
.
equals
(
dpFilterParamDto
.
getBusinessKey
()))
{
resultMap
=
noticeCount
(
resultMap
,
dpFilterParamDto
.
getCityCode
());
}
else
if
(
"1"
.
equals
(
dpFilterParamDto
.
getBusinessKey
()))
{
resultMap
=
useCount
(
resultMap
,
dpFilterParamDto
.
getCityCode
());
}
else
if
(
"2"
.
equals
(
dpFilterParamDto
.
getBusinessKey
()))
{
resultMap
=
changeCount
(
resultMap
,
dpFilterParamDto
.
getCityCode
());
}
else
if
(
"3"
.
equals
(
dpFilterParamDto
.
getBusinessKey
()))
{
resultMap
=
disableCount
(
resultMap
,
dpFilterParamDto
.
getCityCode
());
}
else
if
(
"4"
.
equals
(
dpFilterParamDto
.
getBusinessKey
()))
{
resultMap
=
cancelCount
(
resultMap
,
dpFilterParamDto
.
getCityCode
());
if
(
"0"
.
equals
(
dpFilterParamDto
.
getBusinessKey
()))
{
resultMap
=
noticeCount
(
resultMap
,
dpFilterParamDto
.
getCityCode
());
}
else
if
(
"1"
.
equals
(
dpFilterParamDto
.
getBusinessKey
()))
{
resultMap
=
useCount
(
resultMap
,
dpFilterParamDto
.
getCityCode
());
}
else
if
(
"2"
.
equals
(
dpFilterParamDto
.
getBusinessKey
()))
{
resultMap
=
changeCount
(
resultMap
,
dpFilterParamDto
.
getCityCode
());
}
else
if
(
"3"
.
equals
(
dpFilterParamDto
.
getBusinessKey
()))
{
resultMap
=
disableCount
(
resultMap
,
dpFilterParamDto
.
getCityCode
());
}
else
if
(
"4"
.
equals
(
dpFilterParamDto
.
getBusinessKey
()))
{
resultMap
=
cancelCount
(
resultMap
,
dpFilterParamDto
.
getCityCode
());
}
return
resultMap
;
}
private
Map
<
String
,
Object
>
cancelCount
(
Map
<
String
,
Object
>
resultMap
,
String
cityCode
)
{
Map
<
String
,
Integer
>
countMap
=
new
HashMap
<>();
Map
<
String
,
Integer
>
countMap
=
new
HashMap
<>();
//注销报废
List
<
Map
<
String
,
Object
>>
cancelList
=
dpStatisticsMapper
.
cancelCount
(
cityCode
);
countByMap
(
countMap
,
cancelList
);
List
<
Map
<
String
,
Object
>>
cancelList
=
dpStatisticsMapper
.
cancelCount
(
cityCode
);
countByMap
(
countMap
,
cancelList
);
List
<
Object
>
xDataList
=
new
ArrayList
<>();
List
<
Object
>
yDataList
=
new
ArrayList
<>();
countMap
.
forEach
((
k
,
v
)->
{
countMap
.
forEach
((
k
,
v
)
->
{
xDataList
.
add
(
k
);
yDataList
.
add
(
v
);
});
resultMap
.
put
(
"xdata"
,
xDataList
);
resultMap
.
put
(
"ydata"
,
yDataList
);
resultMap
.
put
(
"xdata"
,
xDataList
);
resultMap
.
put
(
"ydata"
,
yDataList
);
return
resultMap
;
}
private
Map
<
String
,
Object
>
disableCount
(
Map
<
String
,
Object
>
resultMap
,
String
cityCode
)
{
Map
<
String
,
Integer
>
countMap
=
new
HashMap
<>();
Map
<
String
,
Integer
>
countMap
=
new
HashMap
<>();
//启用停用
List
<
Map
<
String
,
Object
>>
disableList
=
dpStatisticsMapper
.
disableCount
(
cityCode
);
countByMap
(
countMap
,
disableList
);
List
<
Map
<
String
,
Object
>>
disableList
=
dpStatisticsMapper
.
disableCount
(
cityCode
);
countByMap
(
countMap
,
disableList
);
List
<
Object
>
xDataList
=
new
ArrayList
<>();
List
<
Object
>
yDataList
=
new
ArrayList
<>();
countMap
.
forEach
((
k
,
v
)->
{
countMap
.
forEach
((
k
,
v
)
->
{
xDataList
.
add
(
k
);
yDataList
.
add
(
v
);
});
resultMap
.
put
(
"xdata"
,
xDataList
);
resultMap
.
put
(
"ydata"
,
yDataList
);
resultMap
.
put
(
"xdata"
,
xDataList
);
resultMap
.
put
(
"ydata"
,
yDataList
);
return
resultMap
;
}
private
Map
<
String
,
Object
>
changeCount
(
Map
<
String
,
Object
>
resultMap
,
String
cityCode
)
{
Map
<
String
,
Integer
>
countMap
=
new
HashMap
<>();
Map
<
String
,
Integer
>
countMap
=
new
HashMap
<>();
//更名变更登记
List
<
Map
<
String
,
Object
>>
changeNameList
=
dpStatisticsMapper
.
changeNameCount
(
cityCode
);
countByMap
(
countMap
,
changeNameList
);
List
<
Map
<
String
,
Object
>>
changeNameList
=
dpStatisticsMapper
.
changeNameCount
(
cityCode
);
countByMap
(
countMap
,
changeNameList
);
//改造变更登记
List
<
Map
<
String
,
Object
>>
reformList
=
dpStatisticsMapper
.
changeReformCount
(
cityCode
);
countByMap
(
countMap
,
reformList
);
List
<
Map
<
String
,
Object
>>
reformList
=
dpStatisticsMapper
.
changeReformCount
(
cityCode
);
countByMap
(
countMap
,
reformList
);
//移装变更登记
List
<
Map
<
String
,
Object
>>
transferList
=
dpStatisticsMapper
.
changeTransferCount
(
cityCode
);
countByMap
(
countMap
,
transferList
);
List
<
Map
<
String
,
Object
>>
transferList
=
dpStatisticsMapper
.
changeTransferCount
(
cityCode
);
countByMap
(
countMap
,
transferList
);
//单位变更登记
List
<
Map
<
String
,
Object
>>
unitList
=
dpStatisticsMapper
.
changeUnitCount
(
cityCode
);
countByMap
(
countMap
,
unitList
);
List
<
Map
<
String
,
Object
>>
unitList
=
dpStatisticsMapper
.
changeUnitCount
(
cityCode
);
countByMap
(
countMap
,
unitList
);
//单位变更登记
List
<
Map
<
String
,
Object
>>
vehicleList
=
dpStatisticsMapper
.
changeVehicleCount
(
cityCode
);
countByMap
(
countMap
,
vehicleList
);
List
<
Map
<
String
,
Object
>>
vehicleList
=
dpStatisticsMapper
.
changeVehicleCount
(
cityCode
);
countByMap
(
countMap
,
vehicleList
);
List
<
Object
>
xDataList
=
new
ArrayList
<>();
List
<
Object
>
yDataList
=
new
ArrayList
<>();
countMap
.
forEach
((
k
,
v
)->
{
countMap
.
forEach
((
k
,
v
)
->
{
xDataList
.
add
(
k
);
yDataList
.
add
(
v
);
});
resultMap
.
put
(
"xdata"
,
xDataList
);
resultMap
.
put
(
"ydata"
,
yDataList
);
resultMap
.
put
(
"xdata"
,
xDataList
);
resultMap
.
put
(
"ydata"
,
yDataList
);
return
resultMap
;
}
private
Map
<
String
,
Object
>
useCount
(
Map
<
String
,
Object
>
resultMap
,
String
cityCode
)
{
Map
<
String
,
Integer
>
countMap
=
new
HashMap
<>();
Map
<
String
,
Integer
>
countMap
=
new
HashMap
<>();
//使用登记
List
<
Map
<
String
,
Object
>>
useList
=
dpStatisticsMapper
.
useCount
(
cityCode
);
countByMap
(
countMap
,
useList
);
List
<
Map
<
String
,
Object
>>
useList
=
dpStatisticsMapper
.
useCount
(
cityCode
);
countByMap
(
countMap
,
useList
);
//气瓶登记
List
<
Map
<
String
,
Object
>>
vehicleList
=
dpStatisticsMapper
.
vehicleCount
(
cityCode
);
countByMap
(
countMap
,
vehicleList
);
List
<
Map
<
String
,
Object
>>
vehicleList
=
dpStatisticsMapper
.
vehicleCount
(
cityCode
);
countByMap
(
countMap
,
vehicleList
);
List
<
Object
>
xDataList
=
new
ArrayList
<>();
List
<
Object
>
yDataList
=
new
ArrayList
<>();
countMap
.
forEach
((
k
,
v
)->
{
countMap
.
forEach
((
k
,
v
)
->
{
xDataList
.
add
(
k
);
yDataList
.
add
(
v
);
});
resultMap
.
put
(
"xdata"
,
xDataList
);
resultMap
.
put
(
"ydata"
,
yDataList
);
resultMap
.
put
(
"xdata"
,
xDataList
);
resultMap
.
put
(
"ydata"
,
yDataList
);
return
resultMap
;
}
private
Map
<
String
,
Object
>
noticeCount
(
Map
<
String
,
Object
>
resultMap
,
String
cityCode
)
{
Map
<
String
,
Integer
>
countMap
=
new
HashMap
<>();
Map
<
String
,
Integer
>
countMap
=
new
HashMap
<>();
//安装告知
List
<
Map
<
String
,
Object
>>
installlist
=
dpStatisticsMapper
.
installCount
(
cityCode
);
countByMap
(
countMap
,
installlist
);
List
<
Map
<
String
,
Object
>>
installlist
=
dpStatisticsMapper
.
installCount
(
cityCode
);
countByMap
(
countMap
,
installlist
);
//维修告知
List
<
Map
<
String
,
Object
>>
maintenancelist
=
dpStatisticsMapper
.
maintenanceNoticeCount
(
cityCode
);
countByMap
(
countMap
,
maintenancelist
);
List
<
Map
<
String
,
Object
>>
maintenancelist
=
dpStatisticsMapper
.
maintenanceNoticeCount
(
cityCode
);
countByMap
(
countMap
,
maintenancelist
);
//改造告知
List
<
Map
<
String
,
Object
>>
reformlist
=
dpStatisticsMapper
.
reformCount
(
cityCode
);
countByMap
(
countMap
,
reformlist
);
List
<
Map
<
String
,
Object
>>
reformlist
=
dpStatisticsMapper
.
reformCount
(
cityCode
);
countByMap
(
countMap
,
reformlist
);
//移装告知
List
<
Map
<
String
,
Object
>>
transferlist
=
dpStatisticsMapper
.
transferCount
(
cityCode
);
countByMap
(
countMap
,
transferlist
);
List
<
Map
<
String
,
Object
>>
transferlist
=
dpStatisticsMapper
.
transferCount
(
cityCode
);
countByMap
(
countMap
,
transferlist
);
List
<
Object
>
xDataList
=
new
ArrayList
<>();
List
<
Object
>
yDataList
=
new
ArrayList
<>();
countMap
.
forEach
((
k
,
v
)->
{
countMap
.
forEach
((
k
,
v
)
->
{
xDataList
.
add
(
k
);
yDataList
.
add
(
v
);
});
resultMap
.
put
(
"xdata"
,
xDataList
);
resultMap
.
put
(
"ydata"
,
yDataList
);
resultMap
.
put
(
"xdata"
,
xDataList
);
resultMap
.
put
(
"ydata"
,
yDataList
);
return
resultMap
;
}
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
(
"regionName"
)))
{
countMap
.
put
(
list
.
get
(
i
).
get
(
"regionName"
).
toString
(),
Integer
.
valueOf
(
list
.
get
(
i
).
get
(
"count"
)+
""
));
}
else
{
countMap
.
put
(
list
.
get
(
i
).
get
(
"regionName"
).
toString
(),
countMap
.
get
(
list
.
get
(
i
).
get
(
"regionName"
).
toString
())+
Integer
.
valueOf
(
list
.
get
(
i
).
get
(
"count"
)+
""
));
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
(
"regionName"
)))
{
countMap
.
put
(
list
.
get
(
i
).
get
(
"regionName"
).
toString
(),
Integer
.
valueOf
(
list
.
get
(
i
).
get
(
"count"
)
+
""
));
}
else
{
countMap
.
put
(
list
.
get
(
i
).
get
(
"regionName"
).
toString
(),
countMap
.
get
(
list
.
get
(
i
).
get
(
"regionName"
).
toString
())
+
Integer
.
valueOf
(
list
.
get
(
i
).
get
(
"count"
)
+
""
));
}
}
}
public
List
<
Map
<
String
,
Object
>>
getBusinessKey
(
DPFilterParamDto
dpFilterParamDto
)
{
List
<
Map
<
String
,
Object
>>
resultList
=
new
ArrayList
<>();
public
List
<
Map
<
String
,
Object
>>
getBusinessKey
(
DPFilterParamDto
dpFilterParamDto
)
{
List
<
Map
<
String
,
Object
>>
resultList
=
new
ArrayList
<>();
/**
* 告知管理、使用登记、变更登记、停用启用、注销报废
*/
for
(
int
i
=
0
;
i
<
5
;
i
++)
{
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
if
(
i
==
0
)
{
result
.
put
(
"key"
,
i
+
""
);
result
.
put
(
"name"
,
"告知管理"
);
}
else
if
(
i
==
1
)
{
result
.
put
(
"key"
,
i
+
""
);
result
.
put
(
"name"
,
"使用登记"
);
}
else
if
(
i
==
2
)
{
result
.
put
(
"key"
,
i
+
""
);
result
.
put
(
"name"
,
"变更登记"
);
}
else
if
(
i
==
3
)
{
result
.
put
(
"key"
,
i
+
""
);
result
.
put
(
"name"
,
"停用启用"
);
}
else
if
(
i
==
4
)
{
result
.
put
(
"key"
,
i
+
""
);
result
.
put
(
"name"
,
"注销报废"
);
for
(
int
i
=
0
;
i
<
5
;
i
++)
{
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
if
(
i
==
0
)
{
result
.
put
(
"key"
,
i
+
""
);
result
.
put
(
"name"
,
"告知管理"
);
}
else
if
(
i
==
1
)
{
result
.
put
(
"key"
,
i
+
""
);
result
.
put
(
"name"
,
"使用登记"
);
}
else
if
(
i
==
2
)
{
result
.
put
(
"key"
,
i
+
""
);
result
.
put
(
"name"
,
"变更登记"
);
}
else
if
(
i
==
3
)
{
result
.
put
(
"key"
,
i
+
""
);
result
.
put
(
"name"
,
"停用启用"
);
}
else
if
(
i
==
4
)
{
result
.
put
(
"key"
,
i
+
""
);
result
.
put
(
"name"
,
"注销报废"
);
}
resultList
.
add
(
result
);
...
...
@@ -1041,47 +1054,47 @@ public class DPStatisticsServiceImpl {
return
resultList
;
}
public
Map
<
String
,
Object
>
getNoticeEquCount
(
DPFilterParamDto
dpFilterParamDto
)
{
public
Map
<
String
,
Object
>
getNoticeEquCount
(
DPFilterParamDto
dpFilterParamDto
)
{
String
startTime
=
LocalDate
.
now
().
minusDays
(
29
).
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
));
//安装告知
List
<
Map
<
String
,
Object
>>
installlist
=
dpStatisticsMapper
.
installEquCount
(
dpFilterParamDto
.
getCityCode
(),
startTime
);
Map
<
String
,
Integer
>
installCountMap
=
new
HashMap
<>();
countNoticEquList
(
installCountMap
,
installlist
);
List
<
Map
<
String
,
Object
>>
installlist
=
dpStatisticsMapper
.
installEquCount
(
dpFilterParamDto
.
getCityCode
(),
startTime
);
Map
<
String
,
Integer
>
installCountMap
=
new
HashMap
<>();
countNoticEquList
(
installCountMap
,
installlist
);
//维修告知
List
<
Map
<
String
,
Object
>>
maintenancelist
=
dpStatisticsMapper
.
maintenanceEquCount
(
dpFilterParamDto
.
getCityCode
(),
startTime
);
Map
<
String
,
Integer
>
maintenanceCountMap
=
new
HashMap
<>();
countNoticEquList
(
maintenanceCountMap
,
maintenancelist
);
List
<
Map
<
String
,
Object
>>
maintenancelist
=
dpStatisticsMapper
.
maintenanceEquCount
(
dpFilterParamDto
.
getCityCode
(),
startTime
);
Map
<
String
,
Integer
>
maintenanceCountMap
=
new
HashMap
<>();
countNoticEquList
(
maintenanceCountMap
,
maintenancelist
);
//改造告知
List
<
Map
<
String
,
Object
>>
reformlist
=
dpStatisticsMapper
.
reformEquCount
(
dpFilterParamDto
.
getCityCode
(),
startTime
);
Map
<
String
,
Integer
>
reformCountMap
=
new
HashMap
<>();
countNoticEquList
(
reformCountMap
,
reformlist
);
List
<
Map
<
String
,
Object
>>
reformlist
=
dpStatisticsMapper
.
reformEquCount
(
dpFilterParamDto
.
getCityCode
(),
startTime
);
Map
<
String
,
Integer
>
reformCountMap
=
new
HashMap
<>();
countNoticEquList
(
reformCountMap
,
reformlist
);
//移装告知
List
<
Map
<
String
,
Object
>>
transferlist
=
dpStatisticsMapper
.
transferEquCount
(
dpFilterParamDto
.
getCityCode
(),
startTime
);
Map
<
String
,
Integer
>
transferCountMap
=
new
HashMap
<>();
countNoticEquList
(
transferCountMap
,
transferlist
);
List
<
Map
<
String
,
Object
>>
transferlist
=
dpStatisticsMapper
.
transferEquCount
(
dpFilterParamDto
.
getCityCode
(),
startTime
);
Map
<
String
,
Integer
>
transferCountMap
=
new
HashMap
<>();
countNoticEquList
(
transferCountMap
,
transferlist
);
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
List
legendData
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
4
;
i
++)
{
Map
<
String
,
String
>
map
=
new
HashMap
<>();
if
(
i
==
0
)
{
map
.
put
(
"dataKey"
,
"installNotify"
);
map
.
put
(
"value"
,
"安装告知"
);
}
else
if
(
i
==
1
)
{
map
.
put
(
"dataKey"
,
"transformNotify"
);
map
.
put
(
"value"
,
"改造告知"
);
}
else
if
(
i
==
2
)
{
map
.
put
(
"dataKey"
,
"maintainNotify"
);
map
.
put
(
"value"
,
"维修告知"
);
}
else
if
(
i
==
3
)
{
map
.
put
(
"dataKey"
,
"transloadingNotify"
);
map
.
put
(
"value"
,
"移装告知"
);
for
(
int
i
=
0
;
i
<
4
;
i
++)
{
Map
<
String
,
String
>
map
=
new
HashMap
<>();
if
(
i
==
0
)
{
map
.
put
(
"dataKey"
,
"installNotify"
);
map
.
put
(
"value"
,
"安装告知"
);
}
else
if
(
i
==
1
)
{
map
.
put
(
"dataKey"
,
"transformNotify"
);
map
.
put
(
"value"
,
"改造告知"
);
}
else
if
(
i
==
2
)
{
map
.
put
(
"dataKey"
,
"maintainNotify"
);
map
.
put
(
"value"
,
"维修告知"
);
}
else
if
(
i
==
3
)
{
map
.
put
(
"dataKey"
,
"transloadingNotify"
);
map
.
put
(
"value"
,
"移装告知"
);
}
legendData
.
add
(
map
);
}
resultMap
.
put
(
"legendData"
,
legendData
);
resultMap
.
put
(
"legendData"
,
legendData
);
List
<
String
>
xDataList
=
Arrays
.
asList
(
"气瓶"
,
"电梯"
,
"压力容器"
,
"锅炉"
,
"起重机械"
,
"场(厂)内专用"
,
"大型游乐设施"
,
"压力管道"
,
"客运索道"
);
resultMap
.
put
(
"xdata"
,
xDataList
);
resultMap
.
put
(
"xdata"
,
xDataList
);
List
installNotify
=
new
ArrayList
<>();
List
transformNotify
=
new
ArrayList
<>();
List
maintainNotify
=
new
ArrayList
<>();
...
...
@@ -1097,180 +1110,180 @@ public class DPStatisticsServiceImpl {
* 8000 压力管道
* 9000 客运索道
*/
for
(
int
i
=
0
;
i
<
xDataList
.
size
();
i
++)
{
if
(
i
==
0
)
{
installNotify
.
add
(
installCountMap
.
getOrDefault
(
"2300"
,
0
));
transformNotify
.
add
(
reformCountMap
.
getOrDefault
(
"2300"
,
0
));
maintainNotify
.
add
(
maintenanceCountMap
.
getOrDefault
(
"2300"
,
0
));
transloadingNotify
.
add
(
transferCountMap
.
getOrDefault
(
"2300"
,
0
));
}
else
if
(
i
==
1
)
{
installNotify
.
add
(
installCountMap
.
getOrDefault
(
"3000"
,
0
));
transformNotify
.
add
(
reformCountMap
.
getOrDefault
(
"3000"
,
0
));
maintainNotify
.
add
(
maintenanceCountMap
.
getOrDefault
(
"3000"
,
0
));
transloadingNotify
.
add
(
transferCountMap
.
getOrDefault
(
"3000"
,
0
));
}
else
if
(
i
==
2
)
{
installNotify
.
add
(
installCountMap
.
getOrDefault
(
"2000"
,
0
));
transformNotify
.
add
(
reformCountMap
.
getOrDefault
(
"2000"
,
0
));
maintainNotify
.
add
(
maintenanceCountMap
.
getOrDefault
(
"2000"
,
0
));
transloadingNotify
.
add
(
transferCountMap
.
getOrDefault
(
"2000"
,
0
));
}
else
if
(
i
==
3
)
{
installNotify
.
add
(
installCountMap
.
getOrDefault
(
"1000"
,
0
));
transformNotify
.
add
(
reformCountMap
.
getOrDefault
(
"1000"
,
0
));
maintainNotify
.
add
(
maintenanceCountMap
.
getOrDefault
(
"1000"
,
0
));
transloadingNotify
.
add
(
transferCountMap
.
getOrDefault
(
"1000"
,
0
));
}
else
if
(
i
==
4
)
{
installNotify
.
add
(
installCountMap
.
getOrDefault
(
"4000"
,
0
));
transformNotify
.
add
(
reformCountMap
.
getOrDefault
(
"4000"
,
0
));
maintainNotify
.
add
(
maintenanceCountMap
.
getOrDefault
(
"4000"
,
0
));
transloadingNotify
.
add
(
transferCountMap
.
getOrDefault
(
"4000"
,
0
));
}
else
if
(
i
==
5
)
{
installNotify
.
add
(
installCountMap
.
getOrDefault
(
"5000"
,
0
));
transformNotify
.
add
(
reformCountMap
.
getOrDefault
(
"5000"
,
0
));
maintainNotify
.
add
(
maintenanceCountMap
.
getOrDefault
(
"5000"
,
0
));
transloadingNotify
.
add
(
transferCountMap
.
getOrDefault
(
"5000"
,
0
));
}
else
if
(
i
==
6
)
{
installNotify
.
add
(
installCountMap
.
getOrDefault
(
"6000"
,
0
));
transformNotify
.
add
(
reformCountMap
.
getOrDefault
(
"6000"
,
0
));
maintainNotify
.
add
(
maintenanceCountMap
.
getOrDefault
(
"6000"
,
0
));
transloadingNotify
.
add
(
transferCountMap
.
getOrDefault
(
"6000"
,
0
));
}
else
if
(
i
==
7
)
{
installNotify
.
add
(
installCountMap
.
getOrDefault
(
"8000"
,
0
));
transformNotify
.
add
(
reformCountMap
.
getOrDefault
(
"8000"
,
0
));
maintainNotify
.
add
(
maintenanceCountMap
.
getOrDefault
(
"8000"
,
0
));
transloadingNotify
.
add
(
transferCountMap
.
getOrDefault
(
"8000"
,
0
));
}
else
if
(
i
==
8
)
{
installNotify
.
add
(
installCountMap
.
getOrDefault
(
"9000"
,
0
));
transformNotify
.
add
(
reformCountMap
.
getOrDefault
(
"9000"
,
0
));
maintainNotify
.
add
(
maintenanceCountMap
.
getOrDefault
(
"9000"
,
0
));
transloadingNotify
.
add
(
transferCountMap
.
getOrDefault
(
"9000"
,
0
));
for
(
int
i
=
0
;
i
<
xDataList
.
size
();
i
++)
{
if
(
i
==
0
)
{
installNotify
.
add
(
installCountMap
.
getOrDefault
(
"2300"
,
0
));
transformNotify
.
add
(
reformCountMap
.
getOrDefault
(
"2300"
,
0
));
maintainNotify
.
add
(
maintenanceCountMap
.
getOrDefault
(
"2300"
,
0
));
transloadingNotify
.
add
(
transferCountMap
.
getOrDefault
(
"2300"
,
0
));
}
else
if
(
i
==
1
)
{
installNotify
.
add
(
installCountMap
.
getOrDefault
(
"3000"
,
0
));
transformNotify
.
add
(
reformCountMap
.
getOrDefault
(
"3000"
,
0
));
maintainNotify
.
add
(
maintenanceCountMap
.
getOrDefault
(
"3000"
,
0
));
transloadingNotify
.
add
(
transferCountMap
.
getOrDefault
(
"3000"
,
0
));
}
else
if
(
i
==
2
)
{
installNotify
.
add
(
installCountMap
.
getOrDefault
(
"2000"
,
0
));
transformNotify
.
add
(
reformCountMap
.
getOrDefault
(
"2000"
,
0
));
maintainNotify
.
add
(
maintenanceCountMap
.
getOrDefault
(
"2000"
,
0
));
transloadingNotify
.
add
(
transferCountMap
.
getOrDefault
(
"2000"
,
0
));
}
else
if
(
i
==
3
)
{
installNotify
.
add
(
installCountMap
.
getOrDefault
(
"1000"
,
0
));
transformNotify
.
add
(
reformCountMap
.
getOrDefault
(
"1000"
,
0
));
maintainNotify
.
add
(
maintenanceCountMap
.
getOrDefault
(
"1000"
,
0
));
transloadingNotify
.
add
(
transferCountMap
.
getOrDefault
(
"1000"
,
0
));
}
else
if
(
i
==
4
)
{
installNotify
.
add
(
installCountMap
.
getOrDefault
(
"4000"
,
0
));
transformNotify
.
add
(
reformCountMap
.
getOrDefault
(
"4000"
,
0
));
maintainNotify
.
add
(
maintenanceCountMap
.
getOrDefault
(
"4000"
,
0
));
transloadingNotify
.
add
(
transferCountMap
.
getOrDefault
(
"4000"
,
0
));
}
else
if
(
i
==
5
)
{
installNotify
.
add
(
installCountMap
.
getOrDefault
(
"5000"
,
0
));
transformNotify
.
add
(
reformCountMap
.
getOrDefault
(
"5000"
,
0
));
maintainNotify
.
add
(
maintenanceCountMap
.
getOrDefault
(
"5000"
,
0
));
transloadingNotify
.
add
(
transferCountMap
.
getOrDefault
(
"5000"
,
0
));
}
else
if
(
i
==
6
)
{
installNotify
.
add
(
installCountMap
.
getOrDefault
(
"6000"
,
0
));
transformNotify
.
add
(
reformCountMap
.
getOrDefault
(
"6000"
,
0
));
maintainNotify
.
add
(
maintenanceCountMap
.
getOrDefault
(
"6000"
,
0
));
transloadingNotify
.
add
(
transferCountMap
.
getOrDefault
(
"6000"
,
0
));
}
else
if
(
i
==
7
)
{
installNotify
.
add
(
installCountMap
.
getOrDefault
(
"8000"
,
0
));
transformNotify
.
add
(
reformCountMap
.
getOrDefault
(
"8000"
,
0
));
maintainNotify
.
add
(
maintenanceCountMap
.
getOrDefault
(
"8000"
,
0
));
transloadingNotify
.
add
(
transferCountMap
.
getOrDefault
(
"8000"
,
0
));
}
else
if
(
i
==
8
)
{
installNotify
.
add
(
installCountMap
.
getOrDefault
(
"9000"
,
0
));
transformNotify
.
add
(
reformCountMap
.
getOrDefault
(
"9000"
,
0
));
maintainNotify
.
add
(
maintenanceCountMap
.
getOrDefault
(
"9000"
,
0
));
transloadingNotify
.
add
(
transferCountMap
.
getOrDefault
(
"9000"
,
0
));
}
}
resultMap
.
put
(
"installNotify"
,
installNotify
);
resultMap
.
put
(
"transformNotify"
,
transformNotify
);
resultMap
.
put
(
"maintainNotify"
,
maintainNotify
);
resultMap
.
put
(
"transloadingNotify"
,
transloadingNotify
);
resultMap
.
put
(
"installNotify"
,
installNotify
);
resultMap
.
put
(
"transformNotify"
,
transformNotify
);
resultMap
.
put
(
"maintainNotify"
,
maintainNotify
);
resultMap
.
put
(
"transloadingNotify"
,
transloadingNotify
);
return
resultMap
;
}
private
void
countNoticEquList
(
Map
<
String
,
Integer
>
countMap
,
List
<
Map
<
String
,
Object
>>
list
)
{
for
(
int
i
=
0
;
i
<
list
.
size
();
i
++)
{
if
(
"2300"
.
equals
(
list
.
get
(
i
).
get
(
"equCategory"
)))
{
if
(
null
==
countMap
.
get
(
"2300"
))
{
countMap
.
put
(
"2300"
,
Integer
.
valueOf
(
list
.
get
(
i
).
get
(
"count"
)+
""
));
}
else
{
countMap
.
put
(
"2300"
,
countMap
.
get
(
"2300"
)+
Integer
.
valueOf
(
list
.
get
(
i
).
get
(
"count"
)+
""
));
for
(
int
i
=
0
;
i
<
list
.
size
();
i
++)
{
if
(
"2300"
.
equals
(
list
.
get
(
i
).
get
(
"equCategory"
)))
{
if
(
null
==
countMap
.
get
(
"2300"
))
{
countMap
.
put
(
"2300"
,
Integer
.
valueOf
(
list
.
get
(
i
).
get
(
"count"
)
+
""
));
}
else
{
countMap
.
put
(
"2300"
,
countMap
.
get
(
"2300"
)
+
Integer
.
valueOf
(
list
.
get
(
i
).
get
(
"count"
)
+
""
));
}
}
else
{
if
(
null
==
countMap
.
get
(
list
.
get
(
i
).
get
(
"equList"
).
toString
()))
{
countMap
.
put
(
list
.
get
(
i
).
get
(
"equList"
).
toString
(),
Integer
.
valueOf
(
list
.
get
(
i
).
get
(
"count"
)+
""
));
}
else
{
countMap
.
put
(
list
.
get
(
i
).
get
(
"equList"
).
toString
(),
countMap
.
get
(
list
.
get
(
i
).
get
(
"equList"
).
toString
())+
Integer
.
valueOf
(
list
.
get
(
i
).
get
(
"count"
)+
""
));
}
else
{
if
(
null
==
countMap
.
get
(
list
.
get
(
i
).
get
(
"equList"
).
toString
()))
{
countMap
.
put
(
list
.
get
(
i
).
get
(
"equList"
).
toString
(),
Integer
.
valueOf
(
list
.
get
(
i
).
get
(
"count"
)
+
""
));
}
else
{
countMap
.
put
(
list
.
get
(
i
).
get
(
"equList"
).
toString
(),
countMap
.
get
(
list
.
get
(
i
).
get
(
"equList"
).
toString
())
+
Integer
.
valueOf
(
list
.
get
(
i
).
get
(
"count"
)
+
""
));
}
}
}
}
public
Map
<
String
,
Object
>
getRegEquCount
(
DPFilterParamDto
dpFilterParamDto
)
{
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
public
Map
<
String
,
Object
>
getRegEquCount
(
DPFilterParamDto
dpFilterParamDto
)
{
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
String
startTime
=
LocalDate
.
now
().
minusDays
(
29
).
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
));
//使用登记
List
<
Map
<
String
,
Object
>>
uselist
=
dpStatisticsMapper
.
useEquCount
(
dpFilterParamDto
.
getCityCode
(),
startTime
);
Map
<
String
,
Integer
>
useCountMap
=
new
HashMap
<>();
countNoticEquList
(
useCountMap
,
uselist
);
List
<
Map
<
String
,
Object
>>
uselist
=
dpStatisticsMapper
.
useEquCount
(
dpFilterParamDto
.
getCityCode
(),
startTime
);
Map
<
String
,
Integer
>
useCountMap
=
new
HashMap
<>();
countNoticEquList
(
useCountMap
,
uselist
);
//气瓶使用登记
List
<
Map
<
String
,
Object
>>
vehicleList
=
dpStatisticsMapper
.
vehicleEquCount
(
dpFilterParamDto
.
getCityCode
(),
startTime
);
Map
<
String
,
Integer
>
vehicleCountMap
=
new
HashMap
<>();
countNoticEquList
(
vehicleCountMap
,
vehicleList
);
List
<
Map
<
String
,
Object
>>
vehicleList
=
dpStatisticsMapper
.
vehicleEquCount
(
dpFilterParamDto
.
getCityCode
(),
startTime
);
Map
<
String
,
Integer
>
vehicleCountMap
=
new
HashMap
<>();
countNoticEquList
(
vehicleCountMap
,
vehicleList
);
//改造变更登记
List
<
Map
<
String
,
Object
>>
changeReformList
=
dpStatisticsMapper
.
changeReformEquCount
(
dpFilterParamDto
.
getCityCode
(),
startTime
);
Map
<
String
,
Integer
>
changeReformCountMap
=
new
HashMap
<>();
countNoticEquList
(
changeReformCountMap
,
changeReformList
);
List
<
Map
<
String
,
Object
>>
changeReformList
=
dpStatisticsMapper
.
changeReformEquCount
(
dpFilterParamDto
.
getCityCode
(),
startTime
);
Map
<
String
,
Integer
>
changeReformCountMap
=
new
HashMap
<>();
countNoticEquList
(
changeReformCountMap
,
changeReformList
);
//移装变更登记
List
<
Map
<
String
,
Object
>>
changeTransferList
=
dpStatisticsMapper
.
changeTransferEquCount
(
dpFilterParamDto
.
getCityCode
(),
startTime
);
Map
<
String
,
Integer
>
changeTransferCountMap
=
new
HashMap
<>();
countNoticEquList
(
changeTransferCountMap
,
changeTransferList
);
List
<
Map
<
String
,
Object
>>
changeTransferList
=
dpStatisticsMapper
.
changeTransferEquCount
(
dpFilterParamDto
.
getCityCode
(),
startTime
);
Map
<
String
,
Integer
>
changeTransferCountMap
=
new
HashMap
<>();
countNoticEquList
(
changeTransferCountMap
,
changeTransferList
);
//单位变更登记
List
<
Map
<
String
,
Object
>>
changeUnitList
=
dpStatisticsMapper
.
changeUnitEquCount
(
dpFilterParamDto
.
getCityCode
(),
startTime
);
Map
<
String
,
Integer
>
changeUnitCountMap
=
new
HashMap
<>();
countNoticEquList
(
changeUnitCountMap
,
changeUnitList
);
List
<
Map
<
String
,
Object
>>
changeUnitList
=
dpStatisticsMapper
.
changeUnitEquCount
(
dpFilterParamDto
.
getCityCode
(),
startTime
);
Map
<
String
,
Integer
>
changeUnitCountMap
=
new
HashMap
<>();
countNoticEquList
(
changeUnitCountMap
,
changeUnitList
);
List
legendData
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
4
;
i
++)
{
Map
<
String
,
String
>
map
=
new
HashMap
<>();
if
(
i
==
0
)
{
map
.
put
(
"dataKey"
,
"useRegistration"
);
map
.
put
(
"value"
,
"使用登记"
);
}
else
if
(
i
==
1
)
{
map
.
put
(
"dataKey"
,
"modificateModifyRegistration"
);
map
.
put
(
"value"
,
"改造变更登记"
);
}
else
if
(
i
==
2
)
{
map
.
put
(
"dataKey"
,
"transloadingModifyRegistration"
);
map
.
put
(
"value"
,
"移装变更登记"
);
}
else
if
(
i
==
3
)
{
map
.
put
(
"dataKey"
,
"unitModifyRegistration"
);
map
.
put
(
"value"
,
"单位变更登记"
);
for
(
int
i
=
0
;
i
<
4
;
i
++)
{
Map
<
String
,
String
>
map
=
new
HashMap
<>();
if
(
i
==
0
)
{
map
.
put
(
"dataKey"
,
"useRegistration"
);
map
.
put
(
"value"
,
"使用登记"
);
}
else
if
(
i
==
1
)
{
map
.
put
(
"dataKey"
,
"modificateModifyRegistration"
);
map
.
put
(
"value"
,
"改造变更登记"
);
}
else
if
(
i
==
2
)
{
map
.
put
(
"dataKey"
,
"transloadingModifyRegistration"
);
map
.
put
(
"value"
,
"移装变更登记"
);
}
else
if
(
i
==
3
)
{
map
.
put
(
"dataKey"
,
"unitModifyRegistration"
);
map
.
put
(
"value"
,
"单位变更登记"
);
}
legendData
.
add
(
map
);
}
resultMap
.
put
(
"legendData"
,
legendData
);
resultMap
.
put
(
"legendData"
,
legendData
);
List
<
String
>
xDataList
=
Arrays
.
asList
(
"气瓶"
,
"电梯"
,
"压力容器"
,
"锅炉"
,
"起重机械"
,
"场(厂)内专用"
,
"大型游乐设施"
,
"压力管道"
,
"客运索道"
);
resultMap
.
put
(
"xdata"
,
xDataList
);
resultMap
.
put
(
"xdata"
,
xDataList
);
List
useRegistration
=
new
ArrayList
<>();
List
modificateModifyRegistration
=
new
ArrayList
<>();
List
transloadingModifyRegistration
=
new
ArrayList
<>();
List
unitModifyRegistration
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
xDataList
.
size
();
i
++)
{
if
(
i
==
0
)
{
useRegistration
.
add
(
vehicleCountMap
.
getOrDefault
(
"2300"
,
0
));
modificateModifyRegistration
.
add
(
changeReformCountMap
.
getOrDefault
(
"2300"
,
0
));
transloadingModifyRegistration
.
add
(
changeTransferCountMap
.
getOrDefault
(
"2300"
,
0
));
unitModifyRegistration
.
add
(
changeUnitCountMap
.
getOrDefault
(
"2300"
,
0
));
}
else
if
(
i
==
1
)
{
useRegistration
.
add
(
useCountMap
.
getOrDefault
(
"3000"
,
0
));
modificateModifyRegistration
.
add
(
changeTransferCountMap
.
getOrDefault
(
"3000"
,
0
));
transloadingModifyRegistration
.
add
(
changeTransferCountMap
.
getOrDefault
(
"3000"
,
0
));
unitModifyRegistration
.
add
(
changeUnitCountMap
.
getOrDefault
(
"3000"
,
0
));
}
else
if
(
i
==
2
)
{
useRegistration
.
add
(
useCountMap
.
getOrDefault
(
"2000"
,
0
));
modificateModifyRegistration
.
add
(
changeTransferCountMap
.
getOrDefault
(
"2000"
,
0
));
transloadingModifyRegistration
.
add
(
changeTransferCountMap
.
getOrDefault
(
"2000"
,
0
));
unitModifyRegistration
.
add
(
changeUnitCountMap
.
getOrDefault
(
"2000"
,
0
));
}
else
if
(
i
==
3
)
{
useRegistration
.
add
(
useCountMap
.
getOrDefault
(
"1000"
,
0
));
modificateModifyRegistration
.
add
(
changeTransferCountMap
.
getOrDefault
(
"1000"
,
0
));
transloadingModifyRegistration
.
add
(
changeTransferCountMap
.
getOrDefault
(
"1000"
,
0
));
unitModifyRegistration
.
add
(
changeUnitCountMap
.
getOrDefault
(
"1000"
,
0
));
}
else
if
(
i
==
4
)
{
useRegistration
.
add
(
useCountMap
.
getOrDefault
(
"4000"
,
0
));
modificateModifyRegistration
.
add
(
changeTransferCountMap
.
getOrDefault
(
"4000"
,
0
));
transloadingModifyRegistration
.
add
(
changeTransferCountMap
.
getOrDefault
(
"4000"
,
0
));
unitModifyRegistration
.
add
(
changeUnitCountMap
.
getOrDefault
(
"4000"
,
0
));
}
else
if
(
i
==
5
)
{
useRegistration
.
add
(
useCountMap
.
getOrDefault
(
"5000"
,
0
));
modificateModifyRegistration
.
add
(
changeTransferCountMap
.
getOrDefault
(
"5000"
,
0
));
transloadingModifyRegistration
.
add
(
changeTransferCountMap
.
getOrDefault
(
"5000"
,
0
));
unitModifyRegistration
.
add
(
changeUnitCountMap
.
getOrDefault
(
"5000"
,
0
));
}
else
if
(
i
==
6
)
{
useRegistration
.
add
(
useCountMap
.
getOrDefault
(
"6000"
,
0
));
modificateModifyRegistration
.
add
(
changeTransferCountMap
.
getOrDefault
(
"6000"
,
0
));
transloadingModifyRegistration
.
add
(
changeTransferCountMap
.
getOrDefault
(
"6000"
,
0
));
unitModifyRegistration
.
add
(
changeUnitCountMap
.
getOrDefault
(
"6000"
,
0
));
}
else
if
(
i
==
7
)
{
useRegistration
.
add
(
useCountMap
.
getOrDefault
(
"8000"
,
0
));
modificateModifyRegistration
.
add
(
changeTransferCountMap
.
getOrDefault
(
"8000"
,
0
));
transloadingModifyRegistration
.
add
(
changeTransferCountMap
.
getOrDefault
(
"8000"
,
0
));
unitModifyRegistration
.
add
(
changeUnitCountMap
.
getOrDefault
(
"8000"
,
0
));
}
else
if
(
i
==
8
)
{
useRegistration
.
add
(
useCountMap
.
getOrDefault
(
"9000"
,
0
));
modificateModifyRegistration
.
add
(
changeTransferCountMap
.
getOrDefault
(
"9000"
,
0
));
transloadingModifyRegistration
.
add
(
changeTransferCountMap
.
getOrDefault
(
"9000"
,
0
));
unitModifyRegistration
.
add
(
changeUnitCountMap
.
getOrDefault
(
"9000"
,
0
));
for
(
int
i
=
0
;
i
<
xDataList
.
size
();
i
++)
{
if
(
i
==
0
)
{
useRegistration
.
add
(
vehicleCountMap
.
getOrDefault
(
"2300"
,
0
));
modificateModifyRegistration
.
add
(
changeReformCountMap
.
getOrDefault
(
"2300"
,
0
));
transloadingModifyRegistration
.
add
(
changeTransferCountMap
.
getOrDefault
(
"2300"
,
0
));
unitModifyRegistration
.
add
(
changeUnitCountMap
.
getOrDefault
(
"2300"
,
0
));
}
else
if
(
i
==
1
)
{
useRegistration
.
add
(
useCountMap
.
getOrDefault
(
"3000"
,
0
));
modificateModifyRegistration
.
add
(
changeTransferCountMap
.
getOrDefault
(
"3000"
,
0
));
transloadingModifyRegistration
.
add
(
changeTransferCountMap
.
getOrDefault
(
"3000"
,
0
));
unitModifyRegistration
.
add
(
changeUnitCountMap
.
getOrDefault
(
"3000"
,
0
));
}
else
if
(
i
==
2
)
{
useRegistration
.
add
(
useCountMap
.
getOrDefault
(
"2000"
,
0
));
modificateModifyRegistration
.
add
(
changeTransferCountMap
.
getOrDefault
(
"2000"
,
0
));
transloadingModifyRegistration
.
add
(
changeTransferCountMap
.
getOrDefault
(
"2000"
,
0
));
unitModifyRegistration
.
add
(
changeUnitCountMap
.
getOrDefault
(
"2000"
,
0
));
}
else
if
(
i
==
3
)
{
useRegistration
.
add
(
useCountMap
.
getOrDefault
(
"1000"
,
0
));
modificateModifyRegistration
.
add
(
changeTransferCountMap
.
getOrDefault
(
"1000"
,
0
));
transloadingModifyRegistration
.
add
(
changeTransferCountMap
.
getOrDefault
(
"1000"
,
0
));
unitModifyRegistration
.
add
(
changeUnitCountMap
.
getOrDefault
(
"1000"
,
0
));
}
else
if
(
i
==
4
)
{
useRegistration
.
add
(
useCountMap
.
getOrDefault
(
"4000"
,
0
));
modificateModifyRegistration
.
add
(
changeTransferCountMap
.
getOrDefault
(
"4000"
,
0
));
transloadingModifyRegistration
.
add
(
changeTransferCountMap
.
getOrDefault
(
"4000"
,
0
));
unitModifyRegistration
.
add
(
changeUnitCountMap
.
getOrDefault
(
"4000"
,
0
));
}
else
if
(
i
==
5
)
{
useRegistration
.
add
(
useCountMap
.
getOrDefault
(
"5000"
,
0
));
modificateModifyRegistration
.
add
(
changeTransferCountMap
.
getOrDefault
(
"5000"
,
0
));
transloadingModifyRegistration
.
add
(
changeTransferCountMap
.
getOrDefault
(
"5000"
,
0
));
unitModifyRegistration
.
add
(
changeUnitCountMap
.
getOrDefault
(
"5000"
,
0
));
}
else
if
(
i
==
6
)
{
useRegistration
.
add
(
useCountMap
.
getOrDefault
(
"6000"
,
0
));
modificateModifyRegistration
.
add
(
changeTransferCountMap
.
getOrDefault
(
"6000"
,
0
));
transloadingModifyRegistration
.
add
(
changeTransferCountMap
.
getOrDefault
(
"6000"
,
0
));
unitModifyRegistration
.
add
(
changeUnitCountMap
.
getOrDefault
(
"6000"
,
0
));
}
else
if
(
i
==
7
)
{
useRegistration
.
add
(
useCountMap
.
getOrDefault
(
"8000"
,
0
));
modificateModifyRegistration
.
add
(
changeTransferCountMap
.
getOrDefault
(
"8000"
,
0
));
transloadingModifyRegistration
.
add
(
changeTransferCountMap
.
getOrDefault
(
"8000"
,
0
));
unitModifyRegistration
.
add
(
changeUnitCountMap
.
getOrDefault
(
"8000"
,
0
));
}
else
if
(
i
==
8
)
{
useRegistration
.
add
(
useCountMap
.
getOrDefault
(
"9000"
,
0
));
modificateModifyRegistration
.
add
(
changeTransferCountMap
.
getOrDefault
(
"9000"
,
0
));
transloadingModifyRegistration
.
add
(
changeTransferCountMap
.
getOrDefault
(
"9000"
,
0
));
unitModifyRegistration
.
add
(
changeUnitCountMap
.
getOrDefault
(
"9000"
,
0
));
}
}
resultMap
.
put
(
"useRegistration"
,
useRegistration
);
resultMap
.
put
(
"modificateModifyRegistration"
,
modificateModifyRegistration
);
resultMap
.
put
(
"transloadingModifyRegistration"
,
transloadingModifyRegistration
);
resultMap
.
put
(
"unitModifyRegistration"
,
unitModifyRegistration
);
resultMap
.
put
(
"useRegistration"
,
useRegistration
);
resultMap
.
put
(
"modificateModifyRegistration"
,
modificateModifyRegistration
);
resultMap
.
put
(
"transloadingModifyRegistration"
,
transloadingModifyRegistration
);
resultMap
.
put
(
"unitModifyRegistration"
,
unitModifyRegistration
);
return
resultMap
;
...
...
@@ -1311,9 +1324,9 @@ public class DPStatisticsServiceImpl {
}
public
Map
<
String
,
Object
>
dataStatisticCountByReginCode
(
DPFilterParamDto
dpFilterParamDto
)
{
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
List
<
Map
<
String
,
Object
>>
mapList
=
this
.
dataStatisticByReginCode
(
dpFilterParamDto
);
if
(
ObjectUtils
.
isEmpty
(
mapList
))
{
if
(
ObjectUtils
.
isEmpty
(
mapList
))
{
resultMap
.
put
(
DPMapStatisticsItemEnum
.
CERTIFICATE_COUNT
.
getCode
(),
0
);
resultMap
.
put
(
DPMapStatisticsItemEnum
.
DEVICE_COUNT
.
getCode
(),
0
);
return
resultMap
;
...
...
@@ -1325,66 +1338,66 @@ public class DPStatisticsServiceImpl {
return
resultMap
;
}
public
Map
<
String
,
Object
>
newRegEquCount
(
DPFilterParamDto
dpFilterParamDto
)
{
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"dataKey"
,
"newRegisterEq"
);
map
.
put
(
"value"
,
"新增登记设备"
);
List
<
Map
<
String
,
Object
>>
legendData
=
new
ArrayList
<>();
public
Map
<
String
,
Object
>
newRegEquCount
(
DPFilterParamDto
dpFilterParamDto
)
{
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"dataKey"
,
"newRegisterEq"
);
map
.
put
(
"value"
,
"新增登记设备"
);
List
<
Map
<
String
,
Object
>>
legendData
=
new
ArrayList
<>();
legendData
.
add
(
map
);
resultMap
.
put
(
"legendData"
,
legendData
);
resultMap
.
put
(
"legendData"
,
legendData
);
List
xDataList
=
new
ArrayList
<>();
List
newRegisterEq
=
new
ArrayList
<>();
Map
<
String
,
Object
>
useCountMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
vehicleCountMap
=
new
HashMap
<>();
if
(
"month"
.
equals
(
dpFilterParamDto
.
getSearchType
()))
{
List
<
Map
<
String
,
Object
>>
useCountList
=
dpStatisticsMapper
.
newRegEquCountByMonth
(
dpFilterParamDto
.
getCityCode
());
List
<
Map
<
String
,
Object
>>
vehicleCountList
=
dpStatisticsMapper
.
newVehicleEquCountByMonth
(
dpFilterParamDto
.
getCityCode
());
for
(
int
i
=
0
;
i
<
useCountList
.
size
();
i
++)
{
useCountMap
.
put
(
useCountList
.
get
(
i
).
getOrDefault
(
"date_format"
,
""
)+
""
,
Integer
.
valueOf
(
useCountList
.
get
(
i
).
getOrDefault
(
"count"
,
0
)+
""
));
Map
<
String
,
Object
>
useCountMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
vehicleCountMap
=
new
HashMap
<>();
if
(
"month"
.
equals
(
dpFilterParamDto
.
getSearchType
()))
{
List
<
Map
<
String
,
Object
>>
useCountList
=
dpStatisticsMapper
.
newRegEquCountByMonth
(
dpFilterParamDto
.
getCityCode
());
List
<
Map
<
String
,
Object
>>
vehicleCountList
=
dpStatisticsMapper
.
newVehicleEquCountByMonth
(
dpFilterParamDto
.
getCityCode
());
for
(
int
i
=
0
;
i
<
useCountList
.
size
();
i
++)
{
useCountMap
.
put
(
useCountList
.
get
(
i
).
getOrDefault
(
"date_format"
,
""
)
+
""
,
Integer
.
valueOf
(
useCountList
.
get
(
i
).
getOrDefault
(
"count"
,
0
)
+
""
));
}
for
(
int
i
=
0
;
i
<
vehicleCountList
.
size
();
i
++)
{
vehicleCountMap
.
put
(
vehicleCountList
.
get
(
i
).
getOrDefault
(
"date_format"
,
""
)+
""
,
Integer
.
valueOf
(
vehicleCountList
.
get
(
i
).
getOrDefault
(
"count"
,
0
)+
""
));
for
(
int
i
=
0
;
i
<
vehicleCountList
.
size
();
i
++)
{
vehicleCountMap
.
put
(
vehicleCountList
.
get
(
i
).
getOrDefault
(
"date_format"
,
""
)
+
""
,
Integer
.
valueOf
(
vehicleCountList
.
get
(
i
).
getOrDefault
(
"count"
,
0
)
+
""
));
}
for
(
int
i
=
0
;
i
<
LocalDate
.
now
().
getDayOfMonth
();
i
++)
{
for
(
int
i
=
0
;
i
<
LocalDate
.
now
().
getDayOfMonth
();
i
++)
{
xDataList
.
add
(
LocalDate
.
now
().
minusDays
(
i
).
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
)));
newRegisterEq
.
add
(
Integer
.
valueOf
(
useCountMap
.
getOrDefault
(
LocalDate
.
now
().
minusDays
(
i
).
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
)),
0
)+
""
)
+
Integer
.
valueOf
(
vehicleCountMap
.
getOrDefault
(
LocalDate
.
now
().
minusDays
(
i
).
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
)),
0
)+
""
));
newRegisterEq
.
add
(
Integer
.
valueOf
(
useCountMap
.
getOrDefault
(
LocalDate
.
now
().
minusDays
(
i
).
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
)),
0
)
+
""
)
+
Integer
.
valueOf
(
vehicleCountMap
.
getOrDefault
(
LocalDate
.
now
().
minusDays
(
i
).
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
)),
0
)
+
""
));
}
}
else
if
(
"year"
.
equals
(
dpFilterParamDto
.
getSearchType
()))
{
List
<
Map
<
String
,
Object
>>
useCountList
=
dpStatisticsMapper
.
newRegEquCountByYear
(
dpFilterParamDto
.
getCityCode
());
List
<
Map
<
String
,
Object
>>
vehicleCountList
=
dpStatisticsMapper
.
newVehicleEquCountByYear
(
dpFilterParamDto
.
getCityCode
());
for
(
int
i
=
0
;
i
<
useCountList
.
size
();
i
++)
{
useCountMap
.
put
(
useCountList
.
get
(
i
).
getOrDefault
(
"date_format"
,
""
)+
""
,
Integer
.
valueOf
(
useCountList
.
get
(
i
).
getOrDefault
(
"count"
,
0
)+
""
));
}
else
if
(
"year"
.
equals
(
dpFilterParamDto
.
getSearchType
()))
{
List
<
Map
<
String
,
Object
>>
useCountList
=
dpStatisticsMapper
.
newRegEquCountByYear
(
dpFilterParamDto
.
getCityCode
());
List
<
Map
<
String
,
Object
>>
vehicleCountList
=
dpStatisticsMapper
.
newVehicleEquCountByYear
(
dpFilterParamDto
.
getCityCode
());
for
(
int
i
=
0
;
i
<
useCountList
.
size
();
i
++)
{
useCountMap
.
put
(
useCountList
.
get
(
i
).
getOrDefault
(
"date_format"
,
""
)
+
""
,
Integer
.
valueOf
(
useCountList
.
get
(
i
).
getOrDefault
(
"count"
,
0
)
+
""
));
}
for
(
int
i
=
0
;
i
<
vehicleCountList
.
size
();
i
++)
{
vehicleCountMap
.
put
(
vehicleCountList
.
get
(
i
).
getOrDefault
(
"date_format"
,
""
)+
""
,
Integer
.
valueOf
(
vehicleCountList
.
get
(
i
).
getOrDefault
(
"count"
,
0
)+
""
));
for
(
int
i
=
0
;
i
<
vehicleCountList
.
size
();
i
++)
{
vehicleCountMap
.
put
(
vehicleCountList
.
get
(
i
).
getOrDefault
(
"date_format"
,
""
)
+
""
,
Integer
.
valueOf
(
vehicleCountList
.
get
(
i
).
getOrDefault
(
"count"
,
0
)
+
""
));
}
for
(
int
i
=
0
;
i
<
LocalDate
.
now
().
getMonth
().
getValue
();
i
++){
for
(
int
i
=
0
;
i
<
LocalDate
.
now
().
getMonth
().
getValue
();
i
++)
{
xDataList
.
add
(
LocalDate
.
now
().
minusMonths
(
i
).
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM"
)));
newRegisterEq
.
add
(
Integer
.
valueOf
(
useCountMap
.
getOrDefault
(
LocalDate
.
now
().
minusMonths
(
i
).
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM"
)),
0
)+
""
)
+
Integer
.
valueOf
(
vehicleCountMap
.
getOrDefault
(
LocalDate
.
now
().
minusMonths
(
i
).
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM"
)),
0
)+
""
));
newRegisterEq
.
add
(
Integer
.
valueOf
(
useCountMap
.
getOrDefault
(
LocalDate
.
now
().
minusMonths
(
i
).
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM"
)),
0
)
+
""
)
+
Integer
.
valueOf
(
vehicleCountMap
.
getOrDefault
(
LocalDate
.
now
().
minusMonths
(
i
).
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM"
)),
0
)
+
""
));
}
}
Collections
.
reverse
(
xDataList
);
Collections
.
reverse
(
newRegisterEq
);
resultMap
.
put
(
"xdata"
,
xDataList
);
resultMap
.
put
(
"newRegisterEq"
,
newRegisterEq
);
resultMap
.
put
(
"xdata"
,
xDataList
);
resultMap
.
put
(
"newRegisterEq"
,
newRegisterEq
);
return
resultMap
;
}
public
List
<
Map
<
String
,
Object
>>
newRegCount
(
DPFilterParamDto
dpFilterParamDto
)
{
List
<
Map
<
String
,
Object
>>
resultList
=
new
ArrayList
<>();
public
List
<
Map
<
String
,
Object
>>
newRegCount
(
DPFilterParamDto
dpFilterParamDto
)
{
List
<
Map
<
String
,
Object
>>
resultList
=
new
ArrayList
<>();
//年使用登记设备
List
<
Map
<
String
,
Object
>>
useEquCountListYear
=
dpStatisticsMapper
.
newRegEquCountByYear
(
dpFilterParamDto
.
getCityCode
());
List
<
Map
<
String
,
Object
>>
useEquCountListYear
=
dpStatisticsMapper
.
newRegEquCountByYear
(
dpFilterParamDto
.
getCityCode
());
//年气瓶使用登记设备
List
<
Map
<
String
,
Object
>>
vehicleEquCountListYear
=
dpStatisticsMapper
.
newVehicleEquCountByYear
(
dpFilterParamDto
.
getCityCode
());
List
<
Map
<
String
,
Object
>>
vehicleEquCountListYear
=
dpStatisticsMapper
.
newVehicleEquCountByYear
(
dpFilterParamDto
.
getCityCode
());
//月使用登记设备
List
<
Map
<
String
,
Object
>>
useEquCountListMonth
=
dpStatisticsMapper
.
newRegEquCountByMonth
(
dpFilterParamDto
.
getCityCode
());
List
<
Map
<
String
,
Object
>>
useEquCountListMonth
=
dpStatisticsMapper
.
newRegEquCountByMonth
(
dpFilterParamDto
.
getCityCode
());
//月气瓶使用登记设备
List
<
Map
<
String
,
Object
>>
vehicleEquCountListMonth
=
dpStatisticsMapper
.
newVehicleEquCountByMonth
(
dpFilterParamDto
.
getCityCode
());
List
<
Map
<
String
,
Object
>>
vehicleEquCountListMonth
=
dpStatisticsMapper
.
newVehicleEquCountByMonth
(
dpFilterParamDto
.
getCityCode
());
//年气瓶使用登记
String
vehicleCountYear
=
dpStatisticsMapper
.
newVehicleCountByYear
(
dpFilterParamDto
.
getCityCode
());
//月气瓶使用登记
...
...
@@ -1398,43 +1411,43 @@ public class DPStatisticsServiceImpl {
int
usrEqYear
=
0
;
int
usrEqMonth
=
0
;
//本年新增登记
for
(
int
i
=
0
;
i
<
useEquCountListYear
.
size
()
;
i
++)
{
useYear
+=
Integer
.
valueOf
(
useEquCountListYear
.
get
(
i
).
getOrDefault
(
"count"
,
0
)+
""
);
usrEqYear
+=
Integer
.
valueOf
(
useEquCountListYear
.
get
(
i
).
getOrDefault
(
"count"
,
0
)+
""
);
for
(
int
i
=
0
;
i
<
useEquCountListYear
.
size
();
i
++)
{
useYear
+=
Integer
.
valueOf
(
useEquCountListYear
.
get
(
i
).
getOrDefault
(
"count"
,
0
)
+
""
);
usrEqYear
+=
Integer
.
valueOf
(
useEquCountListYear
.
get
(
i
).
getOrDefault
(
"count"
,
0
)
+
""
);
}
useYear
+=
StringUtils
.
isBlank
(
vehicleCountYear
)
?
0
:
Integer
.
valueOf
(
vehicleCountYear
);
useYear
+=
StringUtils
.
isBlank
(
vehicleCountYear
)
?
0
:
Integer
.
valueOf
(
vehicleCountYear
);
//本年新增设备
for
(
int
i
=
0
;
i
<
vehicleEquCountListYear
.
size
()
;
i
++)
{
usrEqYear
+=
Integer
.
valueOf
(
vehicleEquCountListYear
.
get
(
i
).
getOrDefault
(
"count"
,
0
)+
""
);
for
(
int
i
=
0
;
i
<
vehicleEquCountListYear
.
size
();
i
++)
{
usrEqYear
+=
Integer
.
valueOf
(
vehicleEquCountListYear
.
get
(
i
).
getOrDefault
(
"count"
,
0
)
+
""
);
}
//本月新增登记
for
(
int
i
=
0
;
i
<
useEquCountListMonth
.
size
()
;
i
++)
{
useMonth
+=
Integer
.
valueOf
(
useEquCountListMonth
.
get
(
i
).
getOrDefault
(
"count"
,
0
)+
""
);
usrEqMonth
+=
Integer
.
valueOf
(
useEquCountListMonth
.
get
(
i
).
getOrDefault
(
"count"
,
0
)+
""
);
for
(
int
i
=
0
;
i
<
useEquCountListMonth
.
size
();
i
++)
{
useMonth
+=
Integer
.
valueOf
(
useEquCountListMonth
.
get
(
i
).
getOrDefault
(
"count"
,
0
)
+
""
);
usrEqMonth
+=
Integer
.
valueOf
(
useEquCountListMonth
.
get
(
i
).
getOrDefault
(
"count"
,
0
)
+
""
);
}
useMonth
+=
StringUtils
.
isBlank
(
vehicleCountListMonth
)
?
0
:
Integer
.
valueOf
(
vehicleCountListMonth
);
useMonth
+=
StringUtils
.
isBlank
(
vehicleCountListMonth
)
?
0
:
Integer
.
valueOf
(
vehicleCountListMonth
);
//本月新增设备
for
(
int
i
=
0
;
i
<
vehicleEquCountListMonth
.
size
()
;
i
++)
{
usrEqMonth
+=
Integer
.
valueOf
(
vehicleEquCountListMonth
.
get
(
i
).
getOrDefault
(
"count"
,
0
)+
""
);
for
(
int
i
=
0
;
i
<
vehicleEquCountListMonth
.
size
();
i
++)
{
usrEqMonth
+=
Integer
.
valueOf
(
vehicleEquCountListMonth
.
get
(
i
).
getOrDefault
(
"count"
,
0
)
+
""
);
}
for
(
int
i
=
0
;
i
<
4
;
i
++)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
if
(
i
==
0
)
{
map
.
put
(
"name"
,
"本年新增登记"
);
map
.
put
(
"value"
,
useYear
);
}
else
if
(
i
==
1
)
{
map
.
put
(
"name"
,
"本年新增设备"
);
map
.
put
(
"value"
,
usrEqYear
);
}
else
if
(
i
==
2
)
{
map
.
put
(
"name"
,
"本月新增登记"
);
map
.
put
(
"value"
,
useMonth
);
}
else
if
(
i
==
3
)
{
map
.
put
(
"name"
,
"本月新增设备"
);
map
.
put
(
"value"
,
usrEqMonth
);
for
(
int
i
=
0
;
i
<
4
;
i
++)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
if
(
i
==
0
)
{
map
.
put
(
"name"
,
"本年新增登记"
);
map
.
put
(
"value"
,
useYear
);
}
else
if
(
i
==
1
)
{
map
.
put
(
"name"
,
"本年新增设备"
);
map
.
put
(
"value"
,
usrEqYear
);
}
else
if
(
i
==
2
)
{
map
.
put
(
"name"
,
"本月新增登记"
);
map
.
put
(
"value"
,
useMonth
);
}
else
if
(
i
==
3
)
{
map
.
put
(
"name"
,
"本月新增设备"
);
map
.
put
(
"value"
,
usrEqMonth
);
}
resultList
.
add
(
map
);
}
...
...
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