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
73d48d9f
Commit
73d48d9f
authored
Mar 25, 2021
by
guojuxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
过滤没有观云台应用的商户
parent
f3a8318c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
2 deletions
+20
-2
LoginController.java
...in/java/com/gic/cloud/web/controller/LoginController.java
+20
-2
No files found.
gic-data-cloud-wxapp/src/main/java/com/gic/cloud/web/controller/LoginController.java
View file @
73d48d9f
...
...
@@ -65,8 +65,15 @@ public class LoginController {
String
code
=
"1234"
;
List
<
UserDTO
>
userDTOList
=
this
.
userApiService
.
listUserByPhoneNumber
(
phoneNumber
,
"+"
+
areaCode
).
getResult
();
if
(
CollectionUtils
.
isNotEmpty
(
userDTOList
)){
List
<
Integer
>
enterpriseIdList
=
userDTOList
.
stream
().
map
(
userDTO
->
userDTO
.
getEnterpriseId
()).
collect
(
Collectors
.
toList
());
//过滤没有观云台应用的用户
userDTOList
=
userDTOList
.
stream
().
filter
(
userDTO
->
checkCloudAppExist
(
userDTO
.
getEnterpriseId
())).
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isEmpty
(
userDTOList
))
{
return
RestResponse
.
failure
(
ErrorCode
.
ACCOUNTNOTEXISTS
.
getCode
(),
"观云台账号不存在"
);
}
List
<
Integer
>
enterpriseIdList
=
userDTOList
.
stream
()
.
map
(
userDTO
->
userDTO
.
getEnterpriseId
()).
collect
(
Collectors
.
toList
());
List
<
EnterpriseDTO
>
enterpriseDTOList
=
this
.
enterpriseApiService
.
listEnterpriseByIds
(
enterpriseIdList
).
getResult
();
//随机取一个用户
Integer
enterpriseId
=
userDTOList
.
get
(
0
).
getEnterpriseId
();
ServiceResponse
<
Void
>
smsSendResult
=
ServiceResponse
.
success
();
if
(!
tsPhone
.
equals
(
phoneNumber
)){
...
...
@@ -130,7 +137,9 @@ public class LoginController {
List
<
UserDTO
>
userDTOList
=
this
.
userApiService
.
listUserByPhoneNumber
(
userDTO
.
getPhoneNumber
(),
userDTO
.
getPhoneAreaCode
()).
getResult
();
log
.
info
(
"userDTOList:{}"
,
JSON
.
toJSONString
(
userDTOList
));
if
(
CollectionUtils
.
isNotEmpty
(
userDTOList
)){
List
<
Integer
>
enterpriseIdList
=
userDTOList
.
stream
().
map
(
user
->
user
.
getEnterpriseId
()).
collect
(
Collectors
.
toList
());
List
<
Integer
>
enterpriseIdList
=
userDTOList
.
stream
()
.
filter
(
user
->
checkCloudAppExist
(
user
.
getEnterpriseId
()))
.
map
(
user
->
user
.
getEnterpriseId
()).
collect
(
Collectors
.
toList
());
List
<
EnterpriseDTO
>
enterpriseDTOList
=
this
.
enterpriseApiService
.
listEnterpriseByIds
(
enterpriseIdList
).
getResult
();
List
<
EnterpriseVo
>
result
=
new
ArrayList
<>();
if
(
CollectionUtils
.
isNotEmpty
(
enterpriseDTOList
)){
...
...
@@ -170,4 +179,13 @@ public class LoginController {
.
getServeInfo
(
enterpriseId
,
"cloud-data"
);
return
ResultControllerUtils
.
commonResultOne
(
info
,
CloudDataServiceInfoVO
.
class
);
}
private
boolean
checkCloudAppExist
(
Integer
enterpriseId
)
{
ServiceResponse
<
EnterpriseServeInfoDTO
>
info
=
enterpriseLicenseApiService
.
getServeInfo
(
enterpriseId
,
"cloud-data"
);
if
(
info
.
isSuccess
()
&&
info
.
getResult
()
!=
null
&&
info
.
getResult
().
getServeStatus
()
!=
1
)
{
return
true
;
}
return
false
;
}
}
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