Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
eshiled-new
/
ne-shield-miniappserver
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 bbae63d8
authored
Jul 28, 2022
by
levphon
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
返回分享用户信息
1 parent
b941491f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
2 deletions
src/main/java/cn/com/glsx/app/modules/model/view/VehicleSharedDTO.java
src/main/java/cn/com/glsx/app/modules/service/VehicleService.java
src/main/java/cn/com/glsx/app/modules/model/view/VehicleSharedDTO.java
View file @
bbae63d
package
cn
.
com
.
glsx
.
app
.
modules
.
model
.
view
;
package
cn
.
com
.
glsx
.
app
.
modules
.
model
.
view
;
import
cn.com.glsx.app.modules.model.CTerminalUserModel
;
import
com.fasterxml.jackson.annotation.JsonIgnore
;
import
com.fasterxml.jackson.annotation.JsonIgnore
;
import
lombok.Data
;
import
lombok.Data
;
...
@@ -18,7 +19,7 @@ public class VehicleSharedDTO {
...
@@ -18,7 +19,7 @@ public class VehicleSharedDTO {
private
String
sources
;
private
String
sources
;
private
Integer
sharedStatus
;
private
Integer
sharedStatus
;
private
String
permitType
;
private
String
permitType
;
private
List
<
String
>
sharedUserId
s
;
private
List
<
CTerminalUserModel
>
sharedUser
s
;
@JsonIgnore
@JsonIgnore
private
String
receiverIds
;
private
String
receiverIds
;
...
...
src/main/java/cn/com/glsx/app/modules/service/VehicleService.java
View file @
bbae63d
...
@@ -16,6 +16,8 @@ import com.github.pagehelper.PageInfo;
...
@@ -16,6 +16,8 @@ import com.github.pagehelper.PageInfo;
import
com.glsx.plat.common.utils.StringUtils
;
import
com.glsx.plat.common.utils.StringUtils
;
import
com.glsx.plat.core.enums.SysConstants
;
import
com.glsx.plat.core.enums.SysConstants
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Maps
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -45,10 +47,19 @@ public class VehicleService {
...
@@ -45,10 +47,19 @@ public class VehicleService {
Page
page
=
PageHelper
.
startPage
(
search
.
getPageNumber
(),
search
.
getPageSize
());
Page
page
=
PageHelper
.
startPage
(
search
.
getPageNumber
(),
search
.
getPageSize
());
List
<
VehicleSharedDTO
>
list
=
vehicleMapper
.
manageSearch
(
search
);
List
<
VehicleSharedDTO
>
list
=
vehicleMapper
.
manageSearch
(
search
);
Map
<
Long
,
CTerminalUserModel
>
finalWechatUserMap
=
getWechatUserInfos
(
list
);
list
.
forEach
(
vdd
->
{
list
.
forEach
(
vdd
->
{
//设置被分享人
//设置被分享人
if
(
StringUtils
.
isNotEmpty
(
vdd
.
getReceiverIds
()))
{
if
(
StringUtils
.
isNotEmpty
(
vdd
.
getReceiverIds
()))
{
vdd
.
setSharedUserIds
(
Arrays
.
asList
(
vdd
.
getReceiverIds
().
split
(
","
)));
List
<
CTerminalUserModel
>
sharedUsers
=
Lists
.
newArrayList
();
Arrays
.
asList
(
vdd
.
getReceiverIds
().
split
(
","
)).
forEach
(
receiverId
->
{
CTerminalUserModel
cUserModel
=
finalWechatUserMap
.
get
(
Long
.
parseLong
(
receiverId
));
if
(
cUserModel
!=
null
)
{
sharedUsers
.
add
(
cUserModel
);
}
});
vdd
.
setSharedUsers
(
sharedUsers
);
}
}
//被分享用户设为只读权限
//被分享用户设为只读权限
if
(
UserConstants
.
RolePermitCastType
.
wxShared
.
getCode
().
equals
(
ShieldContextHolder
.
getRolePermissionType
()))
{
if
(
UserConstants
.
RolePermitCastType
.
wxShared
.
getCode
().
equals
(
ShieldContextHolder
.
getRolePermissionType
()))
{
...
@@ -62,6 +73,25 @@ public class VehicleService {
...
@@ -62,6 +73,25 @@ public class VehicleService {
return
new
PageInfo
<>(
list
);
return
new
PageInfo
<>(
list
);
}
}
public
Map
<
Long
,
CTerminalUserModel
>
getWechatUserInfos
(
List
<
VehicleSharedDTO
>
list
)
{
List
<
String
>
receiverIdsList
=
list
.
stream
().
map
(
VehicleSharedDTO:
:
getReceiverIds
).
filter
(
StringUtils:
:
isNotEmpty
).
collect
(
Collectors
.
toList
());
String
receiverIdsStr
=
StringUtils
.
join
(
receiverIdsList
,
','
);
if
(
StringUtils
.
isNullOrEmpty
(
receiverIdsStr
))
{
return
Maps
.
newHashMap
();
}
List
<
Long
>
receiverIds
=
Lists
.
newArrayList
();
Arrays
.
asList
(
receiverIdsStr
.
split
(
","
)).
forEach
(
receiverId
->
receiverIds
.
add
(
Long
.
valueOf
(
receiverId
)));
if
(
CollectionUtils
.
isNotEmpty
(
receiverIds
))
{
return
userService
.
getWechatUserMap
(
receiverIds
);
}
return
Maps
.
newHashMap
();
}
public
VehicleSharedDetailVO
getSharedDetailInfo
(
Long
shareId
)
{
public
VehicleSharedDetailVO
getSharedDetailInfo
(
Long
shareId
)
{
UserSharedData
sharedData
=
userSharedDataMapper
.
selectById
(
shareId
);
UserSharedData
sharedData
=
userSharedDataMapper
.
selectById
(
shareId
);
if
(
sharedData
!=
null
)
{
if
(
sharedData
!=
null
)
{
...
...
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