Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
黄嘉阳
/
iot-platform-server
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
ac05440f
authored
Sep 20, 2023
by
杨伟程
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge branch 'dev' of
http://git.xmmakeit.com/huangjiay/iot-platform-server
into dev
parents
84a967d3
8009f19e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
60 additions
and
3 deletions
server-module/src/main/java/com/makeit/module/controller/children/tenant/PlatTenantChildrenController.java
server-service/src/main/java/com/makeit/service/saas/PlatTenantService.java
server-service/src/main/java/com/makeit/service/saas/impl/PlatTenantServiceImpl.java
server-web/src/main/resources/application.yml
server-module/src/main/java/com/makeit/module/controller/children/tenant/PlatTenantChildrenController.java
View file @
ac05440f
...
...
@@ -7,6 +7,7 @@ import com.makeit.common.page.PageVO;
import
com.makeit.common.response.ApiResponseEntity
;
import
com.makeit.common.response.ApiResponseUtils
;
import
com.makeit.entity.saas.PlatTenant
;
import
com.makeit.global.annotation.AuthIgnore
;
import
com.makeit.module.admin.dto.plat.PlatTenantDTOVO
;
import
com.makeit.module.admin.vo.plat.PlatTenantVO
;
import
com.makeit.service.saas.PlatTenantService
;
...
...
@@ -53,14 +54,16 @@ public class PlatTenantChildrenController {
@ApiOperation
(
"分页列表(AuthIgnore)"
)
@PostMapping
(
"pageAuthIgnore"
)
@AuthIgnore
public
ApiResponseEntity
<
PageVO
<
PlatTenantVO
>>
pageAuthIgnore
(
@RequestBody
PageReqDTO
<
PlatTenantVO
>
page
){
return
ApiResponseUtils
.
success
(
platTenantService
.
page
(
page
));
return
ApiResponseUtils
.
success
(
platTenantService
.
page
AuthIgnore
(
page
));
}
@ApiOperation
(
"列表(AuthIgnore)"
)
@PostMapping
(
"listAuthIgnore"
)
@AuthIgnore
public
ApiResponseEntity
<
List
<
PlatTenant
>>
listAuthIgnore
(
@RequestBody
PlatTenantVO
dto
){
return
ApiResponseUtils
.
success
(
platTenantService
.
list
(
dto
));
return
ApiResponseUtils
.
success
(
platTenantService
.
list
AuthIgnore
(
dto
));
}
@ApiOperation
(
"列表 根据账号精确查询"
)
...
...
server-service/src/main/java/com/makeit/service/saas/PlatTenantService.java
View file @
ac05440f
...
...
@@ -21,6 +21,10 @@ public interface PlatTenantService extends IService<PlatTenant> {
List
<
PlatTenant
>
list
(
PlatTenantVO
dto
);
PageVO
<
PlatTenantVO
>
pageAuthIgnore
(
PageReqDTO
<
PlatTenantVO
>
page
);
List
<
PlatTenant
>
listAuthIgnore
(
PlatTenantVO
dto
);
List
<
PlatTenant
>
listByUserIdAndAccount
(
PlatTenantVO
dto
);
String
add
(
PlatTenantDTOVO
dto
);
...
...
server-service/src/main/java/com/makeit/service/saas/impl/PlatTenantServiceImpl.java
View file @
ac05440f
...
...
@@ -106,6 +106,27 @@ public class PlatTenantServiceImpl extends ServiceImpl<PlatTenantMapper, PlatTen
return
lambdaQueryWrapper
;
}
private
LambdaQueryWrapper
<
PlatTenant
>
listLambdaQueryWrapperAuthIgnore
(
PlatTenantVO
dto
,
boolean
userAccountLike
)
{
List
<
String
>
tenantUserIdList
=
new
ArrayList
<>(
10
);
tenantUserIdList
.
add
(-
1
+
""
);
if
(
StringUtils
.
isNotBlank
(
dto
.
getUserAccount
()))
{
List
<
PlatUser
>
tntUserList
=
platUserService
.
list
(
new
QueryWrapper
<
PlatUser
>().
lambda
()
.
like
(
userAccountLike
,
PlatUser:
:
getAccount
,
dto
.
getUserAccount
())
.
eq
(!
userAccountLike
,
PlatUser:
:
getAccount
,
dto
.
getUserAccount
())
.
eq
(
PlatUser:
:
getIsTenant
,
IsTenantAccountEnum
.
YES
.
getValue
())
);
tenantUserIdList
.
addAll
(
StreamUtil
.
map
(
tntUserList
,
PlatUser:
:
getId
));
}
LambdaQueryWrapper
<
PlatTenant
>
lambdaQueryWrapper
=
new
QueryWrapper
<
PlatTenant
>().
lambda
()
.
like
(
StringUtils
.
isNotBlank
(
dto
.
getName
()),
PlatTenant:
:
getName
,
dto
.
getName
())
.
eq
(
StringUtils
.
isNotBlank
(
dto
.
getStatus
()),
PlatTenant:
:
getStatus
,
dto
.
getStatus
())
.
in
(
StringUtils
.
isNotBlank
(
dto
.
getUserAccount
()),
PlatTenant:
:
getPlatUserId
,
tenantUserIdList
)
;
lambdaQueryWrapper
.
orderByDesc
(
PlatTenant:
:
getCreateDate
);
return
lambdaQueryWrapper
;
}
@Override
public
List
<
PlatTenant
>
list
(
PlatTenantVO
dto
)
{
LambdaQueryWrapper
<
PlatTenant
>
lambdaQueryWrapper
=
listLambdaQueryWrapper
(
dto
,
true
);
...
...
@@ -114,6 +135,13 @@ public class PlatTenantServiceImpl extends ServiceImpl<PlatTenantMapper, PlatTen
}
@Override
public
List
<
PlatTenant
>
listAuthIgnore
(
PlatTenantVO
dto
)
{
LambdaQueryWrapper
<
PlatTenant
>
lambdaQueryWrapper
=
listLambdaQueryWrapperAuthIgnore
(
dto
,
true
);
List
<
PlatTenant
>
tntTenantList
=
list
(
lambdaQueryWrapper
);
return
tntTenantList
;
}
@Override
public
List
<
PlatTenant
>
listByUserIdAndAccount
(
PlatTenantVO
dto
)
{
LambdaQueryWrapper
<
PlatTenant
>
lambdaQueryWrapper
=
listLambdaQueryWrapper
(
dto
,
false
);
List
<
PlatTenant
>
tntTenantList
=
list
(
lambdaQueryWrapper
);
...
...
@@ -142,6 +170,28 @@ public class PlatTenantServiceImpl extends ServiceImpl<PlatTenantMapper, PlatTen
return
PageUtil
.
toPageVO
(
voList
,
pageList
);
}
@Override
public
PageVO
<
PlatTenantVO
>
pageAuthIgnore
(
PageReqDTO
<
PlatTenantVO
>
page
)
{
PlatTenantVO
dto
=
page
.
getData
();
Page
<
PlatTenant
>
p
=
PageUtil
.
toMpPage
(
page
);
LambdaQueryWrapper
<
PlatTenant
>
lambdaQueryWrapper
=
listLambdaQueryWrapperAuthIgnore
(
dto
,
true
);
Page
<
PlatTenant
>
pageList
=
page
(
p
,
lambdaQueryWrapper
);
List
<
PlatTenantVO
>
voList
=
BeanDtoVoUtils
.
listVo
(
pageList
.
getRecords
(),
PlatTenantVO
.
class
);
TntUserJoinUtil
.
join
(
platUserService
,
voList
,
qw
->
qw
.
eq
(
PlatUser:
:
getIsTenant
,
IsTenantAccountEnum
.
YES
.
getValue
()),
PlatTenantVO:
:
getPlatUserId
,
(
t
,
u
)
->
{
t
.
setUserAccount
(
u
.
getAccount
());
t
.
setUserName
(
u
.
getUsername
());
},
BaseEntity:
:
getId
);
return
PageUtil
.
toPageVO
(
voList
,
pageList
);
}
private
void
checkName
(
PlatTenantDTOVO
dto
)
{
PlatTenant
tntTenant
=
getOne
(
new
QueryWrapper
<
PlatTenant
>().
lambda
()
...
...
server-web/src/main/resources/application.yml
View file @
ac05440f
...
...
@@ -125,7 +125,7 @@ interceptor:
authorizationSaasPathIgnore
:
/saas/login/login
authenticationWechatPath
:
/children/**,/wechat/**
authenticationWechatPathIgnore
:
/children/login/login,/wechat/plat/login/login
authenticationWechatPathIgnore
:
/children/login/login,/wechat/plat/login/login
,/children/tenant/pageAuthIgnore,/children/tenant/listAuthIgnore
sign
:
flag
:
true
...
...
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