Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
eshiled-new
/
ne-shield-trialdrive-admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit da48e1de
authored
Oct 08, 2021
by
杨林龙
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
优化分批获取省市区的方法
1 parent
d9e666ab
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
11 deletions
src/main/java/cn/com/glsx/admin/modules/service/OrganizationApiService.java
src/main/java/cn/com/glsx/admin/modules/service/UserApiService.java
src/test/java/cn/com/glsx/admin/modules/service/VehicleServiceTest.java
src/main/java/cn/com/glsx/admin/modules/service/OrganizationApiService.java
View file @
da48e1d
...
@@ -5,7 +5,6 @@ import cn.com.glsx.admin.modules.model.OrgVehicleTree;
...
@@ -5,7 +5,6 @@ import cn.com.glsx.admin.modules.model.OrgVehicleTree;
import
cn.com.glsx.admin.modules.model.ReportOrgDto
;
import
cn.com.glsx.admin.modules.model.ReportOrgDto
;
import
cn.com.glsx.admin.modules.model.param.VehicleTreeSearch
;
import
cn.com.glsx.admin.modules.model.param.VehicleTreeSearch
;
import
cn.com.glsx.usercenter.api.dto.request.FindOrgRequest
;
import
cn.com.glsx.usercenter.api.dto.request.FindOrgRequest
;
import
cn.com.glsx.usercenter.api.dto.request.OrganizationSearch
;
import
cn.com.glsx.usercenter.api.dto.response.Organization
;
import
cn.com.glsx.usercenter.api.dto.response.Organization
;
import
cn.com.glsx.usercenter.api.dto.response.User
;
import
cn.com.glsx.usercenter.api.dto.response.User
;
import
cn.com.glsx.usercenter.api.dto.tree.OrgTreeModel
;
import
cn.com.glsx.usercenter.api.dto.tree.OrgTreeModel
;
...
@@ -42,9 +41,7 @@ public class OrganizationApiService {
...
@@ -42,9 +41,7 @@ public class OrganizationApiService {
}
}
List
<
Long
>
userIds
=
list
.
stream
().
map
(
BaseOrgDto:
:
getCreatedBy
).
collect
(
Collectors
.
toList
());
List
<
Long
>
userIds
=
list
.
stream
().
map
(
BaseOrgDto:
:
getCreatedBy
).
collect
(
Collectors
.
toList
());
OrganizationSearch
organizationSearch
=
new
OrganizationSearch
();
R
<
List
<
Organization
>>
orgsR
=
organizationService
.
getTenantPathsByUserIds
(
userIds
);
organizationSearch
.
setUserIds
(
userIds
);
R
<
List
<
Organization
>>
orgsR
=
organizationService
.
getTenantPathsByUserIds
(
organizationSearch
);
List
<
Organization
>
orgList
=
orgsR
.
getDataList
(
new
TypeToken
<
List
<
Organization
>>()
{
List
<
Organization
>
orgList
=
orgsR
.
getDataList
(
new
TypeToken
<
List
<
Organization
>>()
{
}.
getType
());
}.
getType
());
if
(
CollectionUtils
.
isNotEmpty
(
orgList
))
{
if
(
CollectionUtils
.
isNotEmpty
(
orgList
))
{
...
@@ -127,9 +124,7 @@ public class OrganizationApiService {
...
@@ -127,9 +124,7 @@ public class OrganizationApiService {
}
}
Set
<
Long
>
userIds
=
list
.
stream
().
map
(
ReportOrgDto:
:
getCreatedBy
).
collect
(
Collectors
.
toSet
());
Set
<
Long
>
userIds
=
list
.
stream
().
map
(
ReportOrgDto:
:
getCreatedBy
).
collect
(
Collectors
.
toSet
());
OrganizationSearch
organizationSearch
=
new
OrganizationSearch
();
R
<
List
<
Organization
>>
orgsR
=
organizationService
.
getTenantPathsByUserIds
(
userIds
);
organizationSearch
.
setUserIds
(
userIds
);
R
<
List
<
Organization
>>
orgsR
=
organizationService
.
getTenantPathsByUserIds
(
organizationSearch
);
List
<
Organization
>
orgList
=
orgsR
.
getDataList
(
new
TypeToken
<
List
<
Organization
>>()
{
List
<
Organization
>
orgList
=
orgsR
.
getDataList
(
new
TypeToken
<
List
<
Organization
>>()
{
}.
getType
());
}.
getType
());
...
...
src/main/java/cn/com/glsx/admin/modules/service/UserApiService.java
View file @
da48e1d
package
cn
.
com
.
glsx
.
admin
.
modules
.
service
;
package
cn
.
com
.
glsx
.
admin
.
modules
.
service
;
import
cn.com.glsx.usercenter.api.dto.request.FindUserRequest
;
import
cn.com.glsx.usercenter.api.dto.request.FindUserRequest
;
import
cn.com.glsx.usercenter.api.dto.request.UserSearch
;
import
cn.com.glsx.usercenter.api.dto.response.User
;
import
cn.com.glsx.usercenter.api.dto.response.User
;
import
cn.com.glsx.usercenter.api.feign.ApiUserService
;
import
cn.com.glsx.usercenter.api.feign.ApiUserService
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
...
@@ -74,9 +73,7 @@ public class UserApiService {
...
@@ -74,9 +73,7 @@ public class UserApiService {
* @return
* @return
*/
*/
public
Map
<
Long
,
User
>
getSuperiorUserMapByIds
(
Collection
<
Long
>
userIds
)
{
public
Map
<
Long
,
User
>
getSuperiorUserMapByIds
(
Collection
<
Long
>
userIds
)
{
UserSearch
userSearch
=
new
UserSearch
();
R
<
List
<
User
>>
listR
=
userService
.
getSuperiorUserByIds
(
userIds
);
userSearch
.
setUserIds
(
userIds
);
R
<
List
<
User
>>
listR
=
userService
.
getSuperiorUserByIds
(
userSearch
);
if
(
listR
==
null
)
{
if
(
listR
==
null
)
{
return
null
;
return
null
;
}
}
...
...
src/test/java/cn/com/glsx/admin/modules/service/VehicleServiceTest.java
View file @
da48e1d
...
@@ -2189,4 +2189,12 @@ public class VehicleServiceTest {
...
@@ -2189,4 +2189,12 @@ public class VehicleServiceTest {
int
length1
=
1590
/
500
;
int
length1
=
1590
/
500
;
System
.
out
.
println
(
"length = "
+
length1
);
System
.
out
.
println
(
"length = "
+
length1
);
}
}
@Test
public
void
test19
()
{
List
<
Long
>
userIds
=
Lists
.
newArrayList
();
userIds
.
add
(
8102L
);
Map
<
Long
,
User
>
superiorUserMap
=
userApiService
.
getSuperiorUserMapByIds
(
userIds
);
System
.
out
.
println
(
"superiorUserMap === "
+
JSON
.
toJSONString
(
superiorUserMap
));
}
}
}
Write
Preview
Markdown
is supported
Attach a file
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 post a comment