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
9a8653df
Commit
9a8653df
authored
Jul 25, 2024
by
刘凡
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
*)修改查询数据字典获取数据
parent
6ff47bb4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
121 deletions
+26
-121
ScreenImpl.java
...ot/module/tcm/biz/service/impl/statistics/ScreenImpl.java
+26
-121
No files found.
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-biz/src/main/java/com/yeejoin/amos/boot/module/tcm/biz/service/impl/statistics/ScreenImpl.java
View file @
9a8653df
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tcm
.
biz
.
service
.
impl
.
statistics
;
import
com.alibaba.fastjson.JSONArray
;
import
com.yeejoin.amos.boot.biz.common.entity.DataDictionary
;
import
com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl
;
import
com.yeejoin.amos.boot.module.tcm.api.dto.ScreenDto
;
import
com.yeejoin.amos.boot.module.tcm.api.mapper.ScreenMapper
;
import
com.yeejoin.amos.boot.module.tcm.api.service.statistics.IScreenService
;
...
...
@@ -19,11 +21,9 @@ import org.springframework.stereotype.Service;
import
javax.annotation.Resource
;
import
java.io.IOException
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.*
;
import
java.util.concurrent.ConcurrentHashMap
;
import
java.util.stream.Collectors
;
@Service
public
class
ScreenImpl
implements
IScreenService
{
...
...
@@ -32,6 +32,9 @@ public class ScreenImpl implements IScreenService {
private
ScreenMapper
screenMapper
;
@Autowired
DataDictionaryServiceImpl
iDataDictionaryService
;
@Autowired
RestHighLevelClient
restHighLevelClient
;
private
static
Map
<
String
,
String
>
regionCodeOrgCodeMap
=
new
ConcurrentHashMap
<>();
@Override
...
...
@@ -367,19 +370,11 @@ public class ScreenImpl implements IScreenService {
}
}
}
List
<
String
>
xlist
=
new
ArrayList
();
xlist
.
add
(
"制造单位"
);
xlist
.
add
(
"安改维单位"
);
xlist
.
add
(
"使用单位"
);
xlist
.
add
(
"设计单位"
);
xlist
.
add
(
"充装单位"
);
List
<
String
>
xlist
=
Arrays
.
asList
(
"制造单位"
,
"安改维单位"
,
"使用单位"
,
"设计单位"
,
"充装单位"
);
List
<
Integer
>
ylist
=
new
ArrayList
();
ylist
.
add
(
dataMap
.
getOrDefault
(
"制造单位"
,
0
));
ylist
.
add
(
dataMap
.
getOrDefault
(
"安装改造维修单位"
,
0
));
ylist
.
add
(
dataMap
.
getOrDefault
(
"使用单位"
,
0
));
ylist
.
add
(
dataMap
.
getOrDefault
(
"设计单位"
,
0
));
ylist
.
add
(
dataMap
.
getOrDefault
(
"充装单位"
,
0
));
xlist
.
stream
().
forEach
(
x
->
{
ylist
.
add
(
dataMap
.
getOrDefault
(
x
,
0
));
});
Map
<
String
,
Object
>
returnMap
=
new
HashMap
<>();
returnMap
.
put
(
"xdata"
,
xlist
);
returnMap
.
put
(
"ydata"
,
ylist
);
...
...
@@ -393,55 +388,13 @@ public class ScreenImpl implements IScreenService {
for
(
Map
<
String
,
Object
>
map
:
list
){
dataMap
.
put
((
String
)
map
.
get
(
"industrySupervisor"
),
Integer
.
valueOf
(
map
.
get
(
"count"
).
toString
()));
}
/**
* 6513 公安
* 6515 能源电力
* 6516 商务
* 6517 应急管理(危化品)
* 6519 文化和旅游
* 6520 卫健
* 6521 教育
* 6522 住建
* 6523 工信
* 6524 交通运输
* 6526 国资
* 6527 其他
* 6525 农业
* 6514 林业
* 6518 消防
*/
List
<
String
>
xlist
=
new
ArrayList
();
xlist
.
add
(
"公安"
);
xlist
.
add
(
"能源电力"
);
xlist
.
add
(
"商务"
);
xlist
.
add
(
"应急管理(危化品)"
);
xlist
.
add
(
"文化和旅游"
);
xlist
.
add
(
"卫健"
);
xlist
.
add
(
"教育"
);
xlist
.
add
(
"住建"
);
xlist
.
add
(
"工信"
);
xlist
.
add
(
"交通运输"
);
xlist
.
add
(
"国资"
);
xlist
.
add
(
"其他"
);
xlist
.
add
(
"农业"
);
xlist
.
add
(
"林业"
);
xlist
.
add
(
"消防"
);
List
<
DataDictionary
>
dataDictionaryList
=
iDataDictionaryService
.
getByType
(
"HYZGBM"
);
List
<
String
>
xlist
=
dataDictionaryList
.
stream
().
map
(
DataDictionary:
:
getName
).
collect
(
Collectors
.
toList
());
List
<
Object
>
ylist
=
new
ArrayList
();
ylist
.
add
(
dataMap
.
getOrDefault
(
"6513"
,
0
));
ylist
.
add
(
dataMap
.
getOrDefault
(
"6515"
,
0
));
ylist
.
add
(
dataMap
.
getOrDefault
(
"6516"
,
0
));
ylist
.
add
(
dataMap
.
getOrDefault
(
"6517"
,
0
));
ylist
.
add
(
dataMap
.
getOrDefault
(
"6519"
,
0
));
ylist
.
add
(
dataMap
.
getOrDefault
(
"6520"
,
0
));
ylist
.
add
(
dataMap
.
getOrDefault
(
"6521"
,
0
));
ylist
.
add
(
dataMap
.
getOrDefault
(
"6522"
,
0
));
ylist
.
add
(
dataMap
.
getOrDefault
(
"6523"
,
0
));
ylist
.
add
(
dataMap
.
getOrDefault
(
"6524"
,
0
));
ylist
.
add
(
dataMap
.
getOrDefault
(
"6526"
,
0
));
ylist
.
add
(
dataMap
.
getOrDefault
(
"6527"
,
0
));
ylist
.
add
(
dataMap
.
getOrDefault
(
"6525"
,
0
));
ylist
.
add
(
dataMap
.
getOrDefault
(
"6514"
,
0
));
ylist
.
add
(
dataMap
.
getOrDefault
(
"6518"
,
0
));
dataDictionaryList
.
stream
().
forEach
(
x
->
{
ylist
.
add
(
dataMap
.
getOrDefault
(
x
.
getCode
(),
0
));
});
Map
<
String
,
Object
>
returnMap
=
new
HashMap
<>();
returnMap
.
put
(
"xdata"
,
xlist
);
returnMap
.
put
(
"ydata"
,
ylist
);
...
...
@@ -474,63 +427,15 @@ public class ScreenImpl implements IScreenService {
long
docCount
=
bucket
.
getDocCount
();
dataMap
.
put
(
category
,
(
int
)
docCount
);
}
/**
* 6008 住宅小区
* 6009 商业单位
* 6010 学校
* 6012 政府机关
* 6011 医疗机构
* 6013 公共场所
* 6528 工业场所
* 6529 工业场所(户外)
* 6530 养老机构
* 6531 旅游景区
* 6532 游乐场所
*/
Map
<
String
,
Object
>
zhuzhaiMap
=
new
HashMap
<>();
zhuzhaiMap
.
put
(
"name"
,
"住宅小区"
);
zhuzhaiMap
.
put
(
"value"
,
dataMap
.
getOrDefault
(
"6008"
,
0
));
returnList
.
add
(
zhuzhaiMap
);
Map
<
String
,
Object
>
shangyeMap
=
new
HashMap
<>();
shangyeMap
.
put
(
"name"
,
"商业单位"
);
shangyeMap
.
put
(
"value"
,
dataMap
.
getOrDefault
(
"6009"
,
0
));
returnList
.
add
(
shangyeMap
);
Map
<
String
,
Object
>
xuexiaoMap
=
new
HashMap
<>();
xuexiaoMap
.
put
(
"name"
,
"学校"
);
xuexiaoMap
.
put
(
"value"
,
dataMap
.
getOrDefault
(
"6010"
,
0
));
returnList
.
add
(
xuexiaoMap
);
Map
<
String
,
Object
>
zhengfuMap
=
new
HashMap
<>();
zhengfuMap
.
put
(
"name"
,
"政府机关"
);
zhengfuMap
.
put
(
"value"
,
dataMap
.
getOrDefault
(
"6012"
,
0
));
returnList
.
add
(
zhengfuMap
);
Map
<
String
,
Object
>
yiliaoMap
=
new
HashMap
<>();
yiliaoMap
.
put
(
"name"
,
"医疗机构"
);
yiliaoMap
.
put
(
"value"
,
dataMap
.
getOrDefault
(
"6011"
,
0
));
returnList
.
add
(
yiliaoMap
);
Map
<
String
,
Object
>
gonggongMap
=
new
HashMap
<>();
gonggongMap
.
put
(
"name"
,
"公共场所"
);
gonggongMap
.
put
(
"value"
,
dataMap
.
getOrDefault
(
"6013"
,
0
));
returnList
.
add
(
gonggongMap
);
Map
<
String
,
Object
>
gongyeMap
=
new
HashMap
<>();
gongyeMap
.
put
(
"name"
,
"工业场所"
);
gongyeMap
.
put
(
"value"
,
dataMap
.
getOrDefault
(
"6528"
,
0
));
returnList
.
add
(
gongyeMap
);
Map
<
String
,
Object
>
gongyeMap1
=
new
HashMap
<>();
gongyeMap1
.
put
(
"name"
,
"工业场所(户外)"
);
gongyeMap1
.
put
(
"value"
,
dataMap
.
getOrDefault
(
"6529"
,
0
));
returnList
.
add
(
gongyeMap1
);
Map
<
String
,
Object
>
yanglaoMap
=
new
HashMap
<>();
yanglaoMap
.
put
(
"name"
,
"养老机构"
);
yanglaoMap
.
put
(
"value"
,
dataMap
.
getOrDefault
(
"6530"
,
0
));
returnList
.
add
(
yanglaoMap
);
Map
<
String
,
Object
>
lvyouMap
=
new
HashMap
<>();
lvyouMap
.
put
(
"name"
,
"旅游景区"
);
lvyouMap
.
put
(
"value"
,
dataMap
.
getOrDefault
(
"6531"
,
0
));
returnList
.
add
(
lvyouMap
);
Map
<
String
,
Object
>
yuleMap
=
new
HashMap
<>();
yuleMap
.
put
(
"name"
,
"游乐场所"
);
yuleMap
.
put
(
"value"
,
dataMap
.
getOrDefault
(
"6532"
,
0
));
returnList
.
add
(
yuleMap
);
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
));
returnList
.
add
(
map
);
});
Map
<
String
,
Object
>
otherMap
=
new
HashMap
<>();
otherMap
.
put
(
"其他"
,
dataMap
.
getOrDefault
(
"其他"
,
0
)
+
dataMap
.
getOrDefault
(
""
,
0
));
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