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
2e8593ae
Commit
2e8593ae
authored
May 15, 2024
by
李秀明
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pref: 消防建筑建筑左侧公司建筑树查询接口性能优化
parent
4c68fcc1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
7 deletions
+24
-7
BuildingServiceImpl.java
...yeejoin/equipmanage/service/impl/BuildingServiceImpl.java
+20
-4
FireFightingSystemServiceImpl.java
...uipmanage/service/impl/FireFightingSystemServiceImpl.java
+2
-2
JCSRemoteService.java
...om/yeejoin/equipmanage/service/impl/JCSRemoteService.java
+2
-1
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/BuildingServiceImpl.java
View file @
2e8593ae
...
@@ -54,6 +54,7 @@ import org.springframework.transaction.annotation.Transactional;
...
@@ -54,6 +54,7 @@ import org.springframework.transaction.annotation.Transactional;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.exception.BaseException
;
import
org.typroject.tyboot.core.foundation.exception.BaseException
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
...
@@ -1429,13 +1430,13 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
...
@@ -1429,13 +1430,13 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
//2.list to tree
//2.list to tree
List
<
BuildingTreeVo
>
buildingTreeVos
=
companyBuildingList
.
parallelStream
()
List
<
BuildingTreeVo
>
buildingTreeVos
=
companyBuildingList
.
parallelStream
()
.
filter
(
.
filter
(
a
->
companyBuildingList
.
s
tream
().
noneMatch
(
c
->
c
.
getId
().
toString
().
equals
(
a
.
getParentId
()))
a
->
companyBuildingList
.
parallelS
tream
().
noneMatch
(
c
->
c
.
getId
().
toString
().
equals
(
a
.
getParentId
()))
).
peek
(
).
peek
(
b
->
b
.
setChildren
(
getCompanyBuildingChildrenTree
(
b
.
getId
().
toString
(),
companyBuildingList
))
b
->
b
.
setChildren
(
getCompanyBuildingChildrenTree
(
b
.
getId
().
toString
(),
companyBuildingList
))
).
collect
(
Collectors
.
toList
());
).
collect
(
Collectors
.
toList
());
// 任务 7481
// 任务 7481
if
(
buildingTreeVos
.
size
()
==
1
&&
!
CollectionUtils
.
isEmpty
(
buildingTreeVos
.
get
(
0
).
getChildren
()))
{
if
(
buildingTreeVos
.
size
()
==
1
&&
!
CollectionUtils
.
isEmpty
(
buildingTreeVos
.
get
(
0
).
getChildren
()))
{
List
<
BuildingTreeVo
>
buildingTreeVosNew
=
buildingTreeVos
.
get
(
0
).
getChildren
().
s
tream
().
sorted
((
o1
,
o2
)
->
{
List
<
BuildingTreeVo
>
buildingTreeVosNew
=
buildingTreeVos
.
get
(
0
).
getChildren
().
parallelS
tream
().
sorted
((
o1
,
o2
)
->
{
if
(
o1
.
getGroupType
().
equals
(
o2
.
getGroupType
()))
{
if
(
o1
.
getGroupType
().
equals
(
o2
.
getGroupType
()))
{
return
0
;
return
0
;
}
}
...
@@ -1491,9 +1492,24 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
...
@@ -1491,9 +1492,24 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
if
(
StringUtils
.
isEmpty
(
authKey
))
{
if
(
StringUtils
.
isEmpty
(
authKey
))
{
authKey
=
this
.
authKey
;
authKey
=
this
.
authKey
;
}
}
List
<
BuildingTreeVo
>
buildingTreeVos
=
getBuildingTreeVos
(
false
,
null
);
//
List<BuildingTreeVo> buildingTreeVos = getBuildingTreeVos(false, null);
// 1.获取公司list
// 1.获取公司list
List
<
OrgUsrDto
>
orgUsrLists
=
jcsRemoteService
.
getCompanyDeptListWithAuth
(
authKey
,
"COMPANY"
,
type
);
// List<OrgUsrDto> orgUsrLists = jcsRemoteService.getCompanyDeptListWithAuth(authKey, "COMPANY", type);
CompletableFuture
<
List
<
BuildingTreeVo
>>
companyListFuture
=
CompletableFuture
.
supplyAsync
(()
->
getBuildingTreeVos
(
false
,
null
));
String
finalAuthKey
=
authKey
;
String
appKey
=
RequestContext
.
getAppKey
();
String
product
=
RequestContext
.
getProduct
();
String
token
=
RequestContext
.
getToken
();
CompletableFuture
<
List
<
OrgUsrDto
>>
orgUsrListFuture
=
CompletableFuture
.
supplyAsync
(()
->
{
RequestContext
.
setAppKey
(
appKey
);
RequestContext
.
setProduct
(
product
);
RequestContext
.
setToken
(
token
);
return
jcsRemoteService
.
getCompanyDeptListWithAuth
(
finalAuthKey
,
"COMPANY"
,
type
);
});
CompletableFuture
.
allOf
(
companyListFuture
,
orgUsrListFuture
).
join
();
List
<
BuildingTreeVo
>
buildingTreeVos
=
companyListFuture
.
join
();
List
<
OrgUsrDto
>
orgUsrLists
=
orgUsrListFuture
.
join
();
if
(
orgUsrLists
.
isEmpty
()){
if
(
orgUsrLists
.
isEmpty
()){
return
new
ArrayList
<>();
return
new
ArrayList
<>();
}
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/FireFightingSystemServiceImpl.java
View file @
2e8593ae
...
@@ -451,7 +451,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
...
@@ -451,7 +451,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
// });
// });
// List<PointTreeVo> regionList = responses.stream().filter(r -> "TRUE".equals(r.getIsRegion())).collect(Collectors.toList());
// List<PointTreeVo> regionList = responses.stream().filter(r -> "TRUE".equals(r.getIsRegion())).collect(Collectors.toList());
if
(
"dl"
.
equals
(
type
))
{
if
(
"dl"
.
equals
(
type
))
{
FeignClientResult
<
List
<
OrgUsrDto
>>
feignClientResult
=
jcsFeignClient
.
getCompanyDeptListWithAuth
(
authKey
,
"COMPANY"
,
"dl"
);
FeignClientResult
<
List
<
OrgUsrDto
>>
feignClientResult
=
jcsFeignClient
.
getCompanyDeptListWithAuth
(
RequestContext
.
getAppKey
(),
RequestContext
.
getProduct
(),
RequestContext
.
getToken
(),
authKey
,
"COMPANY"
,
"dl"
);
orgCode
=
feignClientResult
.
getResult
().
get
(
0
).
getBizOrgCode
();
orgCode
=
feignClientResult
.
getResult
().
get
(
0
).
getBizOrgCode
();
}
}
List
<
PointTreeVo
>
buildList
=
buildingMapper
.
getBuildList
(
orgCode
,
null
);
List
<
PointTreeVo
>
buildList
=
buildingMapper
.
getBuildList
(
orgCode
,
null
);
...
@@ -2412,7 +2412,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
...
@@ -2412,7 +2412,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
@Override
@Override
public
List
<
OrgMenuDto
>
systemAndEquipmentTreeByBziOrgCode
()
{
public
List
<
OrgMenuDto
>
systemAndEquipmentTreeByBziOrgCode
()
{
FeignClientResult
<
List
<
OrgUsrDto
>>
feignClientResult
=
jcsFeignClient
.
getCompanyDeptListWithAuth
(
authKey
,
"COMPANY"
,
"dl"
);
FeignClientResult
<
List
<
OrgUsrDto
>>
feignClientResult
=
jcsFeignClient
.
getCompanyDeptListWithAuth
(
RequestContext
.
getAppKey
(),
RequestContext
.
getProduct
(),
RequestContext
.
getToken
(),
authKey
,
"COMPANY"
,
"dl"
);
String
bizOrgCode
=
feignClientResult
.
getResult
().
get
(
0
).
getBizOrgCode
();
String
bizOrgCode
=
feignClientResult
.
getResult
().
get
(
0
).
getBizOrgCode
();
List
<
Map
<
String
,
Object
>>
list
=
fireFightingSystemMapper
.
systemAndEquipment
(
bizOrgCode
);
List
<
Map
<
String
,
Object
>>
list
=
fireFightingSystemMapper
.
systemAndEquipment
(
bizOrgCode
);
return
systemAndEquipmentTree
(
list
);
return
systemAndEquipmentTree
(
list
);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/JCSRemoteService.java
View file @
2e8593ae
...
@@ -6,6 +6,7 @@ import com.yeejoin.equipmanage.common.dto.OrgUsrDto;
...
@@ -6,6 +6,7 @@ import com.yeejoin.equipmanage.common.dto.OrgUsrDto;
import
com.yeejoin.equipmanage.fegin.JcsFeign
;
import
com.yeejoin.equipmanage.fegin.JcsFeign
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
java.util.List
;
import
java.util.List
;
...
@@ -37,7 +38,7 @@ public class JCSRemoteService {
...
@@ -37,7 +38,7 @@ public class JCSRemoteService {
* @return List<OrgUsrDto>
* @return List<OrgUsrDto>
*/
*/
public
List
<
OrgUsrDto
>
getCompanyDeptListWithAuth
(
String
authKey
,
String
orgTypes
,
String
type
)
{
public
List
<
OrgUsrDto
>
getCompanyDeptListWithAuth
(
String
authKey
,
String
orgTypes
,
String
type
)
{
FeignClientResult
<
List
<
OrgUsrDto
>>
feignClientResult
=
jcsFeignClient
.
getCompanyDeptListWithAuth
(
authKey
,
orgTypes
,
type
);
FeignClientResult
<
List
<
OrgUsrDto
>>
feignClientResult
=
jcsFeignClient
.
getCompanyDeptListWithAuth
(
RequestContext
.
getAppKey
(),
RequestContext
.
getProduct
(),
RequestContext
.
getToken
(),
authKey
,
orgTypes
,
type
);
return
feignClientResult
.
getResult
();
return
feignClientResult
.
getResult
();
}
}
...
...
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