Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-zx-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
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
Jobs
Commits
Open sidebar
项目统一框架
一体化_户用光伏项目代码
amos-boot-zx-biz
Commits
90a43e0e
Commit
90a43e0e
authored
Aug 04, 2021
by
chenhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改獲取單位的信息樹 by chenhao
parent
bb8d29d6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
228 additions
and
201 deletions
+228
-201
KeySiteExcleDto.java
...join/amos/boot/module/common/api/dto/KeySiteExcleDto.java
+1
-1
OrgUsrServiceImpl.java
...oot/module/common/biz/service/impl/OrgUsrServiceImpl.java
+13
-0
DataSourcesImpl.java
...mos/boot/module/jcs/biz/service/impl/DataSourcesImpl.java
+214
-200
No files found.
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/dto/KeySiteExcleDto.java
View file @
90a43e0e
...
@@ -29,7 +29,7 @@ public class KeySiteExcleDto implements Serializable {
...
@@ -29,7 +29,7 @@ public class KeySiteExcleDto implements Serializable {
private
String
name
;
private
String
name
;
@ExcelProperty
(
value
=
"所属单位/部门id"
,
index
=
1
)
@ExcelProperty
(
value
=
"所属单位/部门id"
,
index
=
1
)
@ExplicitConstraint
(
indexNum
=
1
,
sourceClass
=
RoleNameExplicitConstraint
.
class
,
method
=
"getCompany
List
"
)
//固定下拉内容
@ExplicitConstraint
(
indexNum
=
1
,
sourceClass
=
RoleNameExplicitConstraint
.
class
,
method
=
"getCompany
DetailTree
"
)
//固定下拉内容
@ApiModelProperty
(
value
=
"所属单位/部门id"
)
@ApiModelProperty
(
value
=
"所属单位/部门id"
)
private
String
belongName
;
private
String
belongName
;
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/service/impl/OrgUsrServiceImpl.java
View file @
90a43e0e
...
@@ -974,4 +974,16 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
...
@@ -974,4 +974,16 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
});
});
return
lidataDtos
;
return
lidataDtos
;
}
}
public
List
<
OrgUsr
>
getCompanyDetailTree
()
{
LambdaQueryWrapper
<
OrgUsr
>
wrapper
=
new
LambdaQueryWrapper
<
OrgUsr
>();
wrapper
.
eq
(
OrgUsr:
:
getBizOrgType
,
"COMPANY"
);
wrapper
.
eq
(
OrgUsr:
:
getIsDelete
,
false
);
return
this
.
baseMapper
.
selectList
(
wrapper
);
}
}
}
\ No newline at end of file
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 @
90a43e0e
...
@@ -46,219 +46,233 @@ import com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl;
...
@@ -46,219 +46,233 @@ import com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl;
@Service
@Service
public
class
DataSourcesImpl
implements
DataSources
{
public
class
DataSourcesImpl
implements
DataSources
{
@Resource
@Resource
DataDictionaryMapper
dataDictionaryMapper
;
DataDictionaryMapper
dataDictionaryMapper
;
@Autowired
@Autowired
EquipmentServiceImpl
equipmentService
;
EquipmentServiceImpl
equipmentService
;
@Autowired
@Autowired
OrgUsrServiceImpl
orgUsrService
;
OrgUsrServiceImpl
orgUsrService
;
@Autowired
@Autowired
FirefightersServiceImpl
firefightersService
;
FirefightersServiceImpl
firefightersService
;
@Autowired
@Autowired
FireTeamServiceImpl
fireTeamService
;
FireTeamServiceImpl
fireTeamService
;
@Autowired
@Autowired
EquipFeignClient
equipFeignClient
;
EquipFeignClient
equipFeignClient
;
@Autowired
@Autowired
IMaintenanceCompanyService
maintenanceCompanyService
;
IMaintenanceCompanyService
maintenanceCompanyService
;
@Autowired
IKeySiteService
keySiteService
;
@Autowired
private
RestTemplate
restTemplate
;
@Value
(
"${security.systemctl.name}"
)
@Autowired
private
String
systemctl
;
IKeySiteService
keySiteService
;
@Autowired
private
RestTemplate
restTemplate
;
@Override
@Value
(
"${security.systemctl.name}"
)
public
String
[]
selectList
(
String
type
,
String
method
)
throws
Exception
{
private
String
systemctl
;
String
[]
str
=
{};
if
(
StringUtils
.
isNotEmpty
(
type
))
{
str
=
getDataDictionary
(
type
);
}
else
{
switch
(
method
)
{
case
"getNations"
:
str
=
ExcelSelectData
.
NATION
;
break
;
case
"getPoliticalOutlook"
:
str
=
ExcelSelectData
.
POLITICAL_OUTLOOK
;
break
;
case
"getAdministrativeDivisions"
:
// 设置请求头
HttpHeaders
headers
=
new
HttpHeaders
();
headers
.
setContentType
(
MediaType
.
valueOf
(
"application/json; charset=utf-8"
));
// 用HttpEntity封装整个请求报文
HttpEntity
<
Object
>
httpEntity
=
new
HttpEntity
<>(
null
,
headers
);
ResponseEntity
<
String
>
responseEntity
=
restTemplate
.
exchange
(
"http://"
+
systemctl
+
"/systemctl"
+
"/v1"
+
"/region/tree/parent"
,
HttpMethod
.
GET
,
httpEntity
,
String
.
class
);
String
body
=
responseEntity
.
getBody
();
break
;
case
"getBuildingList"
:
str
=
getBuildingList
();
break
;
case
"getFireSystemList"
:
str
=
getFireSystemList
();
break
;
case
"getCompanyList"
:
str
=
getCompanyList
();
break
;
case
"getFirefighters"
:
str
=
getFirefighters
();
break
;
case
"getBizCompanyList"
:
str
=
getBizCompanyList
();
break
;
case
"getFireTeam"
:
str
=
getFireTeam
();
break
;
case
"getMaritalStatus"
:
str
=
ExcelSelectData
.
MARITAL_STATUS
;
break
;
case
"getCarList"
:
str
=
getCarList
();
break
;
case
"getCompanyAndDeparementTree"
:
str
=
getCompanyAndDeparementTree
();
break
;
case
"getBuildTree"
:
str
=
getBuildTree
();
break
;
}
}
return
str
;
}
private
String
[]
getCarList
()
{
@Override
ResponseModel
<
Object
>
response
=
equipFeignClient
.
getFireCarListAll
();
public
String
[]
selectList
(
String
type
,
String
method
)
throws
Exception
{
List
<
Map
<
String
,
Object
>>
carList
=
(
List
<
Map
<
String
,
Object
>>)
response
.
getResult
();
String
[]
str
=
{};
List
<
String
>
carNameList
=
Lists
.
newArrayList
();
if
(
StringUtils
.
isNotEmpty
(
type
))
{
carList
.
forEach
(
car
->
{
str
=
getDataDictionary
(
type
);
carNameList
.
add
(
car
.
get
(
"name"
)
+
"("
+
car
.
get
(
"carNum"
)
+
")"
+
"@"
+
car
.
get
(
"id"
));
}
else
{
});
switch
(
method
)
{
String
[]
str
=
carNameList
.
toArray
(
new
String
[
carNameList
.
size
()]);
case
"getNations"
:
return
str
;
str
=
ExcelSelectData
.
NATION
;
}
break
;
case
"getPoliticalOutlook"
:
str
=
ExcelSelectData
.
POLITICAL_OUTLOOK
;
break
;
case
"getAdministrativeDivisions"
:
// 设置请求头
HttpHeaders
headers
=
new
HttpHeaders
();
headers
.
setContentType
(
MediaType
.
valueOf
(
"application/json; charset=utf-8"
));
// 用HttpEntity封装整个请求报文
HttpEntity
<
Object
>
httpEntity
=
new
HttpEntity
<>(
null
,
headers
);
ResponseEntity
<
String
>
responseEntity
=
restTemplate
.
exchange
(
"http://"
+
systemctl
+
"/systemctl"
+
"/v1"
+
"/region/tree/parent"
,
HttpMethod
.
GET
,
httpEntity
,
String
.
class
);
String
body
=
responseEntity
.
getBody
();
break
;
case
"getBuildingList"
:
str
=
getBuildingList
();
break
;
case
"getFireSystemList"
:
str
=
getFireSystemList
();
break
;
case
"getCompanyList"
:
str
=
getCompanyList
();
break
;
case
"getFirefighters"
:
str
=
getFirefighters
();
break
;
case
"getBizCompanyList"
:
str
=
getBizCompanyList
();
break
;
case
"getFireTeam"
:
str
=
getFireTeam
();
break
;
case
"getMaritalStatus"
:
str
=
ExcelSelectData
.
MARITAL_STATUS
;
break
;
case
"getCarList"
:
str
=
getCarList
();
break
;
case
"getCompanyAndDeparementTree"
:
str
=
getCompanyAndDeparementTree
();
break
;
case
"getBuildTree"
:
str
=
getBuildTree
();
break
;
case
"getCompanyDetailTree"
:
str
=
getCompanyDetailTree
();
break
;
}
}
return
str
;
}
private
String
[]
getFireTeam
()
{
private
String
[]
getCarList
()
{
Page
<
FireTeamCardDto
>
pageBean
=
new
Page
<>(
1
,
Integer
.
MAX_VALUE
);
ResponseModel
<
Object
>
response
=
equipFeignClient
.
getFireCarListAll
();
IPage
<
FireTeamCardDto
>
fireTeamCardDtoIPage
=
fireTeamService
.
listFireTeamByPage
(
pageBean
,
List
<
Map
<
String
,
Object
>>
carList
=
(
List
<
Map
<
String
,
Object
>>)
response
.
getResult
();
new
FireTeamListDto
());
List
<
String
>
carNameList
=
Lists
.
newArrayList
();
List
<
FireTeamCardDto
>
records
=
fireTeamCardDtoIPage
.
getRecords
();
carList
.
forEach
(
car
->
{
List
<
String
>
names
=
records
.
stream
().
map
(
item
->
{
carNameList
.
add
(
car
.
get
(
"name"
)
+
"("
+
car
.
get
(
"carNum"
)
+
")"
+
"@"
+
car
.
get
(
"id"
));
return
item
.
getName
()
+
"@"
+
item
.
getSequenceNbr
();
});
}).
collect
(
Collectors
.
toList
());
String
[]
str
=
carNameList
.
toArray
(
new
String
[
carNameList
.
size
()]);
String
[]
str
=
names
.
toArray
(
new
String
[
names
.
size
()]);
return
str
;
return
str
;
}
}
private
String
[]
getBizCompanyList
()
throws
Exception
{
private
String
[]
getFireTeam
()
{
List
<
OrgMenuDto
>
orgUsrTree
=
orgUsrService
.
getTree
(
null
,
orgUsrService
.
selectCompanyDepartmentMsg
(),
Page
<
FireTeamCardDto
>
pageBean
=
new
Page
<>(
1
,
Integer
.
MAX_VALUE
);
OrgUsr
.
class
.
getName
(),
"getSequenceNbr"
,
2
,
"getBizOrgName"
,
"getParentId"
,
"getBizOrgType"
);
IPage
<
FireTeamCardDto
>
fireTeamCardDtoIPage
=
fireTeamService
.
listFireTeamByPage
(
pageBean
,
List
<
String
>
stringList
=
new
ArrayList
<
String
>();
new
FireTeamListDto
());
initBizCompanyList
(
orgUsrTree
,
stringList
);
List
<
FireTeamCardDto
>
records
=
fireTeamCardDtoIPage
.
getRecords
();
String
[]
str
=
stringList
.
toArray
(
new
String
[
stringList
.
size
()]);
List
<
String
>
names
=
records
.
stream
().
map
(
item
->
{
return
str
;
return
item
.
getName
()
+
"@"
+
item
.
getSequenceNbr
();
}
}).
collect
(
Collectors
.
toList
());
String
[]
str
=
names
.
toArray
(
new
String
[
names
.
size
()]);
return
str
;
}
private
void
initBizCompanyList
(
List
<
OrgMenuDto
>
orgUsrTree
,
List
<
String
>
stringList
)
{
private
String
[]
getBizCompanyList
()
throws
Exception
{
for
(
OrgMenuDto
orgMenuDto
:
orgUsrTree
)
{
List
<
OrgMenuDto
>
orgUsrTree
=
orgUsrService
.
getTree
(
null
,
orgUsrService
.
selectCompanyDepartmentMsg
(),
stringList
.
add
(
orgMenuDto
.
getName
()
+
"@"
+
orgMenuDto
.
getKey
()
+
"@"
+
orgMenuDto
.
getBizOrgCode
());
OrgUsr
.
class
.
getName
(),
"getSequenceNbr"
,
2
,
"getBizOrgName"
,
"getParentId"
,
"getBizOrgType"
);
List
<
OrgMenuDto
>
children
=
orgMenuDto
.
getChildren
();
List
<
String
>
stringList
=
new
ArrayList
<
String
>();
if
(
children
!=
null
&&
children
.
size
()
>
0
)
{
initBizCompanyList
(
orgUsrTree
,
stringList
);
initCompanyList
(
children
,
stringList
);
String
[]
str
=
stringList
.
toArray
(
new
String
[
stringList
.
size
()]);
}
return
str
;
}
}
}
private
String
[]
getFirefighters
(
)
{
private
void
initBizCompanyList
(
List
<
OrgMenuDto
>
orgUsrTree
,
List
<
String
>
stringList
)
{
List
<
FirefightersZhDto
>
firefighters
=
firefightersService
.
getFirefighters
(
1
,
Integer
.
MAX_VALUE
,
for
(
OrgMenuDto
orgMenuDto
:
orgUsrTree
)
{
new
FirefightersDto
());
stringList
.
add
(
orgMenuDto
.
getName
()
+
"@"
+
orgMenuDto
.
getKey
()
+
"@"
+
orgMenuDto
.
getBizOrgCode
());
List
<
String
>
names
=
firefighters
.
stream
().
map
(
item
->
{
List
<
OrgMenuDto
>
children
=
orgMenuDto
.
getChildren
();
return
item
.
getName
()
+
"@"
+
item
.
getSequenceNbr
();
if
(
children
!=
null
&&
children
.
size
()
>
0
)
{
}).
collect
(
Collectors
.
toList
()
);
initCompanyList
(
children
,
stringList
);
String
[]
str
=
names
.
toArray
(
new
String
[
names
.
size
()]);
}
return
str
;
}
}
}
private
String
[]
getCompanyList
()
throws
Exception
{
private
String
[]
getFirefighters
()
{
List
<
OrgMenuDto
>
orgUsrTree
=
orgUsrService
.
getTree
(
null
,
orgUsrService
.
selectCompanyDepartmentMsg
(),
List
<
FirefightersZhDto
>
firefighters
=
firefightersService
.
getFirefighters
(
1
,
Integer
.
MAX_VALUE
,
OrgUsr
.
class
.
getName
(),
"getSequenceNbr"
,
2
,
"getBizOrgName"
,
"getParentId"
,
"getBizOrgType"
);
new
FirefightersDto
());
List
<
String
>
stringList
=
new
ArrayList
<
String
>();
List
<
String
>
names
=
firefighters
.
stream
().
map
(
item
->
{
initCompanyList
(
orgUsrTree
,
stringList
);
return
item
.
getName
()
+
"@"
+
item
.
getSequenceNbr
();
String
[]
str
=
stringList
.
toArray
(
new
String
[
stringList
.
size
()]);
}).
collect
(
Collectors
.
toList
());
return
str
;
String
[]
str
=
names
.
toArray
(
new
String
[
names
.
size
()]);
}
return
str
;
}
private
void
initCompanyList
(
List
<
OrgMenuDto
>
orgUsrTree
,
List
<
String
>
stringList
)
{
private
String
[]
getCompanyList
()
throws
Exception
{
for
(
OrgMenuDto
orgMenuDto
:
orgUsrTree
)
{
List
<
OrgMenuDto
>
orgUsrTree
=
orgUsrService
.
getTree
(
null
,
orgUsrService
.
selectCompanyDepartmentMsg
(),
stringList
.
add
(
orgMenuDto
.
getName
()
+
"@"
+
orgMenuDto
.
getKey
());
OrgUsr
.
class
.
getName
(),
"getSequenceNbr"
,
2
,
"getBizOrgName"
,
"getParentId"
,
"getBizOrgType"
);
List
<
OrgMenuDto
>
children
=
orgMenuDto
.
getChildren
();
List
<
String
>
stringList
=
new
ArrayList
<
String
>();
if
(
children
!=
null
&&
children
.
size
()
>
0
)
{
initCompanyList
(
orgUsrTree
,
stringList
);
initCompanyList
(
children
,
stringList
);
String
[]
str
=
stringList
.
toArray
(
new
String
[
stringList
.
size
()]);
}
return
str
;
}
}
}
private
String
[]
getFireSystemList
()
{
private
void
initCompanyList
(
List
<
OrgMenuDto
>
orgUsrTree
,
List
<
String
>
stringList
)
{
List
<
MenuFrom
>
fireSystemList
=
equipmentService
.
getFireSystemList
();
for
(
OrgMenuDto
orgMenuDto
:
orgUsrTree
)
{
List
<
String
>
names
=
fireSystemList
.
stream
().
map
(
item
->
{
stringList
.
add
(
orgMenuDto
.
getName
()
+
"@"
+
orgMenuDto
.
getKey
());
return
item
.
getName
()
+
"@"
+
item
.
getKey
();
List
<
OrgMenuDto
>
children
=
orgMenuDto
.
getChildren
();
}).
collect
(
Collectors
.
toList
());
if
(
children
!=
null
&&
children
.
size
()
>
0
)
{
String
[]
str
=
names
.
toArray
(
new
String
[
names
.
size
()]);
initCompanyList
(
children
,
stringList
);
return
str
;
}
}
}
}
private
String
[]
getBuildingList
()
{
private
String
[]
getFireSystemList
()
{
List
<
MenuFrom
>
buildingList
=
equipmentService
.
getBuildingList
();
List
<
MenuFrom
>
fireSystemList
=
equipmentService
.
getFireSystemList
();
List
<
String
>
buildingNames
=
buildingList
.
stream
().
map
(
item
->
{
List
<
String
>
names
=
fireSystemList
.
stream
().
map
(
item
->
{
return
item
.
getName
()
+
"@"
+
item
.
getKey
();
return
item
.
getName
()
+
"@"
+
item
.
getKey
();
}).
collect
(
Collectors
.
toList
());
}).
collect
(
Collectors
.
toList
());
String
[]
str
=
buildingNames
.
toArray
(
new
String
[
buildingNames
.
size
()]);
String
[]
str
=
names
.
toArray
(
new
String
[
names
.
size
()]);
return
str
;
return
str
;
}
}
private
String
[]
getBuildingList
()
{
List
<
MenuFrom
>
buildingList
=
equipmentService
.
getBuildingList
();
List
<
String
>
buildingNames
=
buildingList
.
stream
().
map
(
item
->
{
return
item
.
getName
()
+
"@"
+
item
.
getKey
();
}).
collect
(
Collectors
.
toList
());
String
[]
str
=
buildingNames
.
toArray
(
new
String
[
buildingNames
.
size
()]);
return
str
;
}
private
String
[]
getDataDictionary
(
String
type
)
{
QueryWrapper
<
DataDictionary
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"type"
,
type
);
queryWrapper
.
orderByAsc
(
"sort_num"
);
List
<
DataDictionary
>
list
=
dataDictionaryMapper
.
selectList
(
queryWrapper
);
List
<
String
>
names
=
list
.
stream
().
map
(
dataDictionary
->
{
return
dataDictionary
.
getName
()
+
"@"
+
dataDictionary
.
getCode
();
}).
collect
(
Collectors
.
toList
());
String
[]
str
=
names
.
toArray
(
new
String
[
names
.
size
()]);
return
str
;
}
private
String
[]
getCompanyAndDeparementTree
()
throws
Exception
{
List
<
OrgMenuDto
>
menus
=
orgUsrService
.
getTree
(
null
,
maintenanceCompanyService
.
getCompanyAndDepartmentTree
(),
MaintenanceCompany
.
class
.
getName
(),
"getSequenceNbr"
,
2
,
"getName"
,
"getParentId"
,
"getType"
);
List
<
String
>
stringList
=
new
ArrayList
<
String
>();
initCompanyList
(
menus
,
stringList
);
String
[]
str
=
stringList
.
toArray
(
new
String
[
stringList
.
size
()]);
return
str
;
}
private
String
[]
getBuildTree
()
throws
Exception
{
List
<
Object
>
menus
=
keySiteService
.
getBuildTree
();
List
<
String
>
stringList
=
new
ArrayList
<
String
>();
initBuildTreeList
(
menus
,
stringList
);
String
[]
str
=
stringList
.
toArray
(
new
String
[
stringList
.
size
()]);
return
str
;
}
private
void
initBuildTreeList
(
List
<
Object
>
menus
,
List
<
String
>
stringList
)
{
for
(
Object
orgMenuDto
:
menus
)
{
JSONObject
detailObject
=
JSONObject
.
parseObject
(
orgMenuDto
.
toString
());
if
(
detailObject
.
containsKey
(
"id"
))
{
stringList
.
add
(
detailObject
.
getString
(
"id"
)
+
"@"
+
detailObject
.
getString
(
"name"
));
}
JSONArray
children
=
detailObject
.
getJSONArray
(
"children"
);
if
(
children
!=
null
&&
children
.
size
()
>
0
)
{
initBuildTreeList
(
children
,
stringList
);
}
}
}
private
String
[]
getCompanyDetailTree
()
throws
Exception
{
List
<
OrgMenuDto
>
orgUsrTree
=
orgUsrService
.
getTree
(
null
,
orgUsrService
.
getCompanyDetailTree
(),
OrgUsr
.
class
.
getName
(),
"getSequenceNbr"
,
2
,
"getBizOrgName"
,
"getParentId"
,
"getBizOrgType"
);
List
<
String
>
stringList
=
new
ArrayList
<
String
>();
initCompanyList
(
orgUsrTree
,
stringList
);
String
[]
str
=
stringList
.
toArray
(
new
String
[
stringList
.
size
()]);
return
str
;
}
private
String
[]
getDataDictionary
(
String
type
)
{
QueryWrapper
<
DataDictionary
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"type"
,
type
);
queryWrapper
.
orderByAsc
(
"sort_num"
);
List
<
DataDictionary
>
list
=
dataDictionaryMapper
.
selectList
(
queryWrapper
);
List
<
String
>
names
=
list
.
stream
().
map
(
dataDictionary
->
{
return
dataDictionary
.
getName
()
+
"@"
+
dataDictionary
.
getCode
();
}).
collect
(
Collectors
.
toList
());
String
[]
str
=
names
.
toArray
(
new
String
[
names
.
size
()]);
return
str
;
}
private
String
[]
getCompanyAndDeparementTree
()
throws
Exception
{
List
<
OrgMenuDto
>
menus
=
orgUsrService
.
getTree
(
null
,
maintenanceCompanyService
.
getCompanyAndDepartmentTree
(),
MaintenanceCompany
.
class
.
getName
(),
"getSequenceNbr"
,
2
,
"getName"
,
"getParentId"
,
"getType"
);
List
<
String
>
stringList
=
new
ArrayList
<
String
>();
initCompanyList
(
menus
,
stringList
);
String
[]
str
=
stringList
.
toArray
(
new
String
[
stringList
.
size
()]);
return
str
;
}
private
String
[]
getBuildTree
()
throws
Exception
{
List
<
Object
>
menus
=
keySiteService
.
getBuildTree
();
List
<
String
>
stringList
=
new
ArrayList
<
String
>();
initBuildTreeList
(
menus
,
stringList
);
String
[]
str
=
stringList
.
toArray
(
new
String
[
stringList
.
size
()]);
return
str
;
}
private
void
initBuildTreeList
(
List
<
Object
>
menus
,
List
<
String
>
stringList
)
{
for
(
Object
orgMenuDto
:
menus
)
{
JSONObject
detailObject
=
JSONObject
.
parseObject
(
orgMenuDto
.
toString
());
if
(
detailObject
.
containsKey
(
"id"
))
{
stringList
.
add
(
detailObject
.
getString
(
"id"
)
+
"@"
+
detailObject
.
getString
(
"name"
));
}
JSONArray
children
=
detailObject
.
getJSONArray
(
"children"
);
if
(
children
!=
null
&&
children
.
size
()
>
0
)
{
initBuildTreeList
(
children
,
stringList
);
}
}
}
}
}
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