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
fcd49c43
Commit
fcd49c43
authored
Mar 13, 2023
by
tangwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改扫描错误
parent
2065552c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
19 deletions
+23
-19
DataSourcesImpl.java
...mos/boot/module/jcs/biz/service/impl/DataSourcesImpl.java
+23
-19
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/service/impl/DataSourcesImpl.java
View file @
fcd49c43
...
@@ -88,6 +88,14 @@ public class DataSourcesImpl implements DataSources {
...
@@ -88,6 +88,14 @@ public class DataSourcesImpl implements DataSources {
private
static
final
String
SEQUENCENBR
=
"sequenceNbr"
;
private
static
final
String
SEQUENCENBR
=
"sequenceNbr"
;
private
static
final
String
BIZORGNAME
=
"bizOrgName"
;
private
static
final
String
BIZORGNAME
=
"bizOrgName"
;
private
static
final
String
FIRE_WATER_INFO
=
"fire_water_info"
;
private
static
final
String
FIRE_WATER_INFO
=
"fire_water_info"
;
private
static
final
String
BIZORGCODE
=
"bizOrgCode"
;
private
static
final
String
CHILDREN
=
"children"
;
private
static
final
String
FIRE_TEAM_INFO
=
"fire_team_info"
;
private
static
final
String
ORGCODE
=
"OrgCode"
;
@Value
(
"${security.systemctl.name}"
)
@Value
(
"${security.systemctl.name}"
)
private
String
systemctl
;
private
String
systemctl
;
...
@@ -110,7 +118,7 @@ public class DataSourcesImpl implements DataSources {
...
@@ -110,7 +118,7 @@ public class DataSourcesImpl implements DataSources {
headers
.
setContentType
(
MediaType
.
valueOf
(
"application/json; charset=utf-8"
));
headers
.
setContentType
(
MediaType
.
valueOf
(
"application/json; charset=utf-8"
));
// 用HttpEntity封装整个请求报文
// 用HttpEntity封装整个请求报文
HttpEntity
<
Object
>
httpEntity
=
new
HttpEntity
<>(
null
,
headers
);
HttpEntity
<
Object
>
httpEntity
=
new
HttpEntity
<>(
null
,
headers
);
ResponseEntity
<
String
>
responseEntity
=
restTemplate
.
exchange
(
restTemplate
.
exchange
(
"http://"
+
systemctl
+
"/systemctl"
+
"/v1"
+
"/region/tree/parent"
,
HttpMethod
.
GET
,
"http://"
+
systemctl
+
"/systemctl"
+
"/v1"
+
"/region/tree/parent"
,
HttpMethod
.
GET
,
httpEntity
,
String
.
class
);
httpEntity
,
String
.
class
);
break
;
break
;
...
@@ -221,7 +229,7 @@ public class DataSourcesImpl implements DataSources {
...
@@ -221,7 +229,7 @@ public class DataSourcesImpl implements DataSources {
PermissionInterceptorContext
.
setDataAuthRule
(
FIRE_WATER_INFO
);
PermissionInterceptorContext
.
setDataAuthRule
(
FIRE_WATER_INFO
);
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"OrgCode"
,
reginParams
.
getPersonIdentity
().
getBizOrgCode
());
map
.
put
(
ORGCODE
,
reginParams
.
getPersonIdentity
().
getBizOrgCode
());
IPage
<
Map
<
String
,
Object
>>
mapIPage
=
iOrgUsrService
.
pagePerson
(
null
,
null
,
map
);
IPage
<
Map
<
String
,
Object
>>
mapIPage
=
iOrgUsrService
.
pagePerson
(
null
,
null
,
map
);
List
<
Map
<
String
,
Object
>>
records
=
mapIPage
.
getRecords
();
List
<
Map
<
String
,
Object
>>
records
=
mapIPage
.
getRecords
();
List
<
String
>
carNameList
=
Lists
.
newArrayList
();
List
<
String
>
carNameList
=
Lists
.
newArrayList
();
...
@@ -238,7 +246,7 @@ public class DataSourcesImpl implements DataSources {
...
@@ -238,7 +246,7 @@ public class DataSourcesImpl implements DataSources {
PermissionInterceptorContext
.
setDataAuthRule
(
"fire_station_info"
);
PermissionInterceptorContext
.
setDataAuthRule
(
"fire_station_info"
);
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"OrgCode"
,
reginParams
.
getPersonIdentity
().
getBizOrgCode
());
map
.
put
(
ORGCODE
,
reginParams
.
getPersonIdentity
().
getBizOrgCode
());
IPage
<
Map
<
String
,
Object
>>
mapIPage
=
iOrgUsrService
.
pagePerson
(
null
,
null
,
map
);
IPage
<
Map
<
String
,
Object
>>
mapIPage
=
iOrgUsrService
.
pagePerson
(
null
,
null
,
map
);
List
<
Map
<
String
,
Object
>>
records
=
mapIPage
.
getRecords
();
List
<
Map
<
String
,
Object
>>
records
=
mapIPage
.
getRecords
();
List
<
String
>
carNameList
=
Lists
.
newArrayList
();
List
<
String
>
carNameList
=
Lists
.
newArrayList
();
...
@@ -252,10 +260,10 @@ public class DataSourcesImpl implements DataSources {
...
@@ -252,10 +260,10 @@ public class DataSourcesImpl implements DataSources {
private
String
[]
getFireTeamContactUser
()
{
private
String
[]
getFireTeamContactUser
()
{
ReginParams
reginParams
=
JSON
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
ReginParams
reginParams
=
JSON
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
// 权限处理
// 权限处理
PermissionInterceptorContext
.
setDataAuthRule
(
"fire_team_info"
);
PermissionInterceptorContext
.
setDataAuthRule
(
FIRE_TEAM_INFO
);
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"OrgCode"
,
reginParams
.
getPersonIdentity
().
getBizOrgCode
());
map
.
put
(
ORGCODE
,
reginParams
.
getPersonIdentity
().
getBizOrgCode
());
IPage
<
Map
<
String
,
Object
>>
mapIPage
=
iOrgUsrService
.
pagePerson
(
null
,
null
,
map
);
IPage
<
Map
<
String
,
Object
>>
mapIPage
=
iOrgUsrService
.
pagePerson
(
null
,
null
,
map
);
List
<
Map
<
String
,
Object
>>
records
=
mapIPage
.
getRecords
();
List
<
Map
<
String
,
Object
>>
records
=
mapIPage
.
getRecords
();
List
<
String
>
carNameList
=
Lists
.
newArrayList
();
List
<
String
>
carNameList
=
Lists
.
newArrayList
();
...
@@ -286,7 +294,7 @@ public class DataSourcesImpl implements DataSources {
...
@@ -286,7 +294,7 @@ public class DataSourcesImpl implements DataSources {
// 导出模板增加权限
// 导出模板增加权限
ReginParams
reginParams
=
JSON
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
ReginParams
reginParams
=
JSON
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
// 权限处理
// 权限处理
PermissionInterceptorContext
.
setDataAuthRule
(
"fire_team_info"
);
PermissionInterceptorContext
.
setDataAuthRule
(
FIRE_TEAM_INFO
);
List
<
FireTeam
>
records
=
fireTeamService
.
getExcelFireTeamList
(
reginParams
.
getPersonIdentity
().
getBizOrgCode
());
List
<
FireTeam
>
records
=
fireTeamService
.
getExcelFireTeamList
(
reginParams
.
getPersonIdentity
().
getBizOrgCode
());
List
<
String
>
names
=
records
.
stream
().
map
(
item
->
{
List
<
String
>
names
=
records
.
stream
().
map
(
item
->
{
return
item
.
getName
()
+
"@"
+
item
.
getSequenceNbr
();
return
item
.
getName
()
+
"@"
+
item
.
getSequenceNbr
();
...
@@ -296,10 +304,6 @@ public class DataSourcesImpl implements DataSources {
...
@@ -296,10 +304,6 @@ public class DataSourcesImpl implements DataSources {
}
}
private
String
[]
getEquipFireTeam
()
{
private
String
[]
getEquipFireTeam
()
{
// Page<FireTeamCardDto> pageBean = new Page<>(0, Integer.MAX_VALUE);
// IPage<FireTeamCardDto> fireTeamCardDtoIPage = fireTeamService.listFireTeamByPage(pageBean,
// new FireTeamListDto());
// List<FireTeamCardDto> records = fireTeamCardDtoIPage.getRecords();
ResponseModel
<
ReginParams
>
result
=
equipFeignClient
.
getPermissions
();
ResponseModel
<
ReginParams
>
result
=
equipFeignClient
.
getPermissions
();
ReginParams
reginParams
=
result
.
getResult
();
ReginParams
reginParams
=
result
.
getResult
();
...
@@ -397,8 +401,8 @@ public class DataSourcesImpl implements DataSources {
...
@@ -397,8 +401,8 @@ public class DataSourcesImpl implements DataSources {
String
bizOrgCode
=
reginParams
.
getPersonIdentity
().
getBizOrgCode
();
String
bizOrgCode
=
reginParams
.
getPersonIdentity
().
getBizOrgCode
();
ResponseModel
<
Object
>
response
=
equipFeignClient
.
getBuildingTree
();
ResponseModel
<
Object
>
response
=
equipFeignClient
.
getBuildingTree
();
List
<
Map
<
String
,
Object
>>
buildingMapList
=
(
List
<
Map
<
String
,
Object
>>)
response
.
getResult
();
List
<
Map
<
String
,
Object
>>
buildingMapList
=
(
List
<
Map
<
String
,
Object
>>)
response
.
getResult
();
List
<
Map
<
String
,
Object
>>
children
=
(
List
<
Map
<
String
,
Object
>>)
buildingMapList
.
get
(
0
).
get
(
"children"
);
List
<
Map
<
String
,
Object
>>
children
=
(
List
<
Map
<
String
,
Object
>>)
buildingMapList
.
get
(
0
).
get
(
CHILDREN
);
List
<
String
>
collect
=
children
.
stream
().
filter
(
result
->
result
.
get
(
"bizOrgCode"
).
toString
().
startsWith
(
bizOrgCode
)).
map
(
itme
->
{
List
<
String
>
collect
=
children
.
stream
().
filter
(
result
->
result
.
get
(
BIZORGCODE
).
toString
().
startsWith
(
bizOrgCode
)).
map
(
itme
->
{
return
itme
.
get
(
"name"
)
+
"@"
+
itme
.
get
(
"id"
);
return
itme
.
get
(
"name"
)
+
"@"
+
itme
.
get
(
"id"
);
}).
collect
(
Collectors
.
toList
());
}).
collect
(
Collectors
.
toList
());
String
[]
str
=
collect
.
toArray
(
new
String
[
collect
.
size
()]);
String
[]
str
=
collect
.
toArray
(
new
String
[
collect
.
size
()]);
...
@@ -410,7 +414,7 @@ public class DataSourcesImpl implements DataSources {
...
@@ -410,7 +414,7 @@ public class DataSourcesImpl implements DataSources {
ResponseModel
<
Object
>
response
=
equipFeignClient
.
getBuildingTree
();
ResponseModel
<
Object
>
response
=
equipFeignClient
.
getBuildingTree
();
List
<
Map
<
String
,
Object
>>
buildingMapList
=
(
List
<
Map
<
String
,
Object
>>)
response
.
getResult
();
List
<
Map
<
String
,
Object
>>
buildingMapList
=
(
List
<
Map
<
String
,
Object
>>)
response
.
getResult
();
List
<
Map
<
String
,
Object
>>
children
=
(
List
<
Map
<
String
,
Object
>>)
buildingMapList
.
get
(
0
).
get
(
"children"
);
List
<
Map
<
String
,
Object
>>
children
=
(
List
<
Map
<
String
,
Object
>>)
buildingMapList
.
get
(
0
).
get
(
CHILDREN
);
List
<
String
>
collect
=
children
.
stream
().
map
(
itme
->
{
List
<
String
>
collect
=
children
.
stream
().
map
(
itme
->
{
return
itme
.
get
(
"name"
)
+
"@"
+
itme
.
get
(
"id"
);
return
itme
.
get
(
"name"
)
+
"@"
+
itme
.
get
(
"id"
);
}).
collect
(
Collectors
.
toList
());
}).
collect
(
Collectors
.
toList
());
...
@@ -456,10 +460,10 @@ public class DataSourcesImpl implements DataSources {
...
@@ -456,10 +460,10 @@ public class DataSourcesImpl implements DataSources {
private
void
initBuildTreeList
(
List
<
Object
>
menus
,
List
<
String
>
stringList
,
String
bizOrgCode
)
{
private
void
initBuildTreeList
(
List
<
Object
>
menus
,
List
<
String
>
stringList
,
String
bizOrgCode
)
{
for
(
Object
orgMenuDto
:
menus
)
{
for
(
Object
orgMenuDto
:
menus
)
{
JSONObject
detailObject
=
JSON
.
parseObject
(
orgMenuDto
.
toString
());
JSONObject
detailObject
=
JSON
.
parseObject
(
orgMenuDto
.
toString
());
if
(
detailObject
.
containsKey
(
"id"
)
&&
detailObject
.
get
(
"bizOrgCode"
)
!=
null
&&
detailObject
.
get
(
"bizOrgCode"
).
toString
().
startsWith
(
bizOrgCode
))
{
if
(
detailObject
.
containsKey
(
"id"
)
&&
detailObject
.
get
(
BIZORGCODE
)
!=
null
&&
detailObject
.
get
(
BIZORGCODE
).
toString
().
startsWith
(
bizOrgCode
))
{
stringList
.
add
(
detailObject
.
getString
(
"name"
)
+
"@"
+
detailObject
.
getString
(
"id"
));
// 任务3527 重点部位导出模板 id name 未正常配置 by kongfm
stringList
.
add
(
detailObject
.
getString
(
"name"
)
+
"@"
+
detailObject
.
getString
(
"id"
));
// 任务3527 重点部位导出模板 id name 未正常配置 by kongfm
}
}
JSONArray
children
=
detailObject
.
getJSONArray
(
"children"
);
JSONArray
children
=
detailObject
.
getJSONArray
(
CHILDREN
);
if
(
children
!=
null
&&
children
.
size
()
>
0
)
{
if
(
children
!=
null
&&
children
.
size
()
>
0
)
{
initBuildTreeList
(
children
,
stringList
,
bizOrgCode
);
initBuildTreeList
(
children
,
stringList
,
bizOrgCode
);
}
}
...
@@ -470,7 +474,7 @@ public class DataSourcesImpl implements DataSources {
...
@@ -470,7 +474,7 @@ public class DataSourcesImpl implements DataSources {
// 导出模板增加权限
// 导出模板增加权限
ReginParams
reginParams
=
JSON
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
ReginParams
reginParams
=
JSON
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
// 权限处理
// 权限处理
PermissionInterceptorContext
.
setDataAuthRule
(
"fire_team_info"
);
PermissionInterceptorContext
.
setDataAuthRule
(
FIRE_TEAM_INFO
);
List
<
OrgMenuDto
>
orgUsrTree
=
iOrgUsrService
.
companyTreeByUserAndType
(
reginParams
,
OrgPersonEnum
.
公司
.
getKey
(),
null
);
List
<
OrgMenuDto
>
orgUsrTree
=
iOrgUsrService
.
companyTreeByUserAndType
(
reginParams
,
OrgPersonEnum
.
公司
.
getKey
(),
null
);
...
@@ -640,19 +644,19 @@ public class DataSourcesImpl implements DataSources {
...
@@ -640,19 +644,19 @@ public class DataSourcesImpl implements DataSources {
List
<
String
>
resultList
=
Lists
.
newArrayList
();
List
<
String
>
resultList
=
Lists
.
newArrayList
();
for
(
LinkedHashMap
<
String
,
Object
>
t
:
categoryList
)
{
for
(
LinkedHashMap
<
String
,
Object
>
t
:
categoryList
)
{
if
(
categoryCode
.
equals
(
t
.
get
(
"code"
).
toString
()))
{
if
(
categoryCode
.
equals
(
t
.
get
(
"code"
).
toString
()))
{
fireList
=
(
List
<
LinkedHashMap
<
String
,
Object
>>)
t
.
get
(
"children"
);
fireList
=
(
List
<
LinkedHashMap
<
String
,
Object
>>)
t
.
get
(
CHILDREN
);
}
}
}
}
// 筛选第二层
// 筛选第二层
for
(
LinkedHashMap
<
String
,
Object
>
t
:
fireList
)
{
for
(
LinkedHashMap
<
String
,
Object
>
t
:
fireList
)
{
if
(
fireCode
.
equals
(
t
.
get
(
"code"
).
toString
()))
{
if
(
fireCode
.
equals
(
t
.
get
(
"code"
).
toString
()))
{
waterList
=
(
List
<
LinkedHashMap
<
String
,
Object
>>)
t
.
get
(
"children"
);
waterList
=
(
List
<
LinkedHashMap
<
String
,
Object
>>)
t
.
get
(
CHILDREN
);
}
}
}
}
// 筛选第三层
// 筛选第三层
for
(
LinkedHashMap
<
String
,
Object
>
t
:
waterList
)
{
for
(
LinkedHashMap
<
String
,
Object
>
t
:
waterList
)
{
if
(
waterCode
.
equals
(
t
.
get
(
"code"
).
toString
()))
{
if
(
waterCode
.
equals
(
t
.
get
(
"code"
).
toString
()))
{
category
=
(
List
<
LinkedHashMap
<
String
,
Object
>>)
t
.
get
(
"children"
);
category
=
(
List
<
LinkedHashMap
<
String
,
Object
>>)
t
.
get
(
CHILDREN
);
}
}
}
}
category
.
forEach
(
t
->
{
category
.
forEach
(
t
->
{
...
...
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