Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-data-cloud
Overview
Overview
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
base_platform_enterprise
gic-data-cloud
Commits
7fdd1964
Commit
7fdd1964
authored
Aug 26, 2020
by
guojuxing
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/developer' into developer
parents
987764c5
6e83d7c0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
1 deletions
+19
-1
LoginController.java
...in/java/com/gic/cloud/web/controller/LoginController.java
+10
-1
EnterpriseVo.java
...xapp/src/main/java/com/gic/cloud/web/vo/EnterpriseVo.java
+9
-0
No files found.
gic-data-cloud-wxapp/src/main/java/com/gic/cloud/web/controller/LoginController.java
View file @
7fdd1964
...
...
@@ -103,13 +103,22 @@ public class LoginController {
public
RestResponse
allEnterprise
(
Integer
userId
){
Object
cache
=
RedisUtil
.
getCache
(
"userEnterpriseList:"
+
userId
);
UserDTO
userDTO
=
this
.
userApiService
.
getUser
(
userId
).
getResult
();
List
<
UserDTO
>
userDTOList
=
this
.
userApiService
.
listUserByPhone
(
userDTO
.
getNationCode
(),
userDTO
.
getPhone
()).
getResult
();
List
<
EnterpriseDTO
>
enterpriseDTOList
=
(
List
<
EnterpriseDTO
>)
cache
;
List
<
EnterpriseVo
>
result
=
new
ArrayList
<>();
if
(
CollectionUtils
.
isNotEmpty
(
enterpriseDTOList
)){
result
=
enterpriseDTOList
.
stream
().
map
(
enterpriseDTO
->
{
EnterpriseVo
vo
=
EntityUtil
.
changeEntityByJSON
(
EnterpriseVo
.
class
,
enterpriseDTO
);
vo
.
setIsAdmin
((
userDTO
!=
null
&&
userDTO
.
getPhone
().
equals
(
enterpriseDTO
.
getPhoneNumber
()))
?
1
:
0
);
vo
.
setIsSingle
(
"basic"
.
equals
(
enterpriseDTO
.
getVersionCode
())
?
1
:
0
);
if
(
CollectionUtils
.
isNotEmpty
(
userDTOList
)){
userDTOList
.
stream
().
forEach
(
user
->
{
if
(
user
.
getEnterpriseId
().
intValue
()
==
enterpriseDTO
.
getEnterpriseId
().
intValue
()){
vo
.
setIsAdmin
((
user
.
getPhone
().
equals
(
enterpriseDTO
.
getPhoneNumber
()))
?
1
:
0
);
vo
.
setUserName
(
user
.
getUserName
());
vo
.
setUserId
(
user
.
getUserId
());
}
});
}
return
vo
;
}).
collect
(
Collectors
.
toList
());
}
...
...
gic-data-cloud-wxapp/src/main/java/com/gic/cloud/web/vo/EnterpriseVo.java
View file @
7fdd1964
...
...
@@ -7,6 +7,7 @@ public class EnterpriseVo {
private
String
companyName
;
private
String
logo
;
private
String
address
;
private
Integer
userId
;
private
String
userName
;
private
String
phoneNumber
;
private
String
phoneAreaCode
;
...
...
@@ -93,4 +94,12 @@ public class EnterpriseVo {
public
void
setIsSingle
(
Integer
isSingle
)
{
this
.
isSingle
=
isSingle
;
}
public
Integer
getUserId
()
{
return
userId
;
}
public
void
setUserId
(
Integer
userId
)
{
this
.
userId
=
userId
;
}
}
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