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
b1bbc90d
authored
Aug 30, 2023
by
李小龙
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
saas角色
parent
195e200c
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
27 changed files
with
527 additions
and
90 deletions
db/saas.sql
saas-module/src/main/java/com/makeit/controller/saas/SaasLoginController.java
saas-module/src/main/java/com/makeit/controller/saas/SaasRoleController.java
saas-module/src/main/java/com/makeit/controller/saas/SaasUserController.java
server-common/src/main/java/com/makeit/common/entity/BaseEntity.java
server-common/src/main/java/com/makeit/config/mybatis/objecthandler/LocalDateTimeObjectHandler.java
server-common/src/main/java/com/makeit/enums/redis/RedisConst.java
server-common/src/main/java/com/makeit/module/admin/saas/PlatMenuDTOVO.java
server-common/src/main/java/com/makeit/module/admin/saas/PlatRoleDTOVO.java → server-common/src/main/java/com/makeit/module/admin/saas/SaasRoleDTOVO.java
server-common/src/main/java/com/makeit/module/admin/saas/PlatUserDTOVO.java → server-common/src/main/java/com/makeit/module/admin/saas/SaasUserDTOVO.java
server-common/src/main/java/com/makeit/module/admin/service/impl/SysDeptServiceImpl.java
server-common/src/main/java/com/makeit/module/admin/service/impl/SysFactoryServiceImpl.java
server-common/src/main/java/com/makeit/module/admin/service/impl/SysMenuServiceImpl.java
server-common/src/main/java/com/makeit/module/admin/service/impl/SysRoleServiceImpl.java
server-common/src/main/java/com/makeit/module/admin/service/impl/SysUserServiceImpl.java
server-common/src/main/java/com/makeit/module/system/service/impl/SysConfigCategoryServiceImpl.java
server-common/src/main/java/com/makeit/module/system/service/impl/SysDictionaryCategoryServiceImpl.java
server-common/src/main/java/com/makeit/utils/user/PlatUserUtil.java
server-common/src/main/java/com/makeit/utils/user/UserLoginVO.java → server-common/src/main/java/com/makeit/utils/user/SaasUserLoginVO.java
server-common/src/main/java/com/makeit/utils/user/ThreadLocalUserUtil.java
server-common/src/main/java/com/makeit/utils/user/TokenUtil.java
server-common/src/main/java/com/makeit/utils/user/common/CommonUserUtil.java
server-service/src/main/java/com/makeit/service/saas/SaasRoleService.java
server-service/src/main/java/com/makeit/service/saas/SaasUserService.java
server-service/src/main/java/com/makeit/service/saas/impl/SaasMenuServiceImpl.java
server-service/src/main/java/com/makeit/service/saas/impl/SaasRoleServiceImpl.java
server-service/src/main/java/com/makeit/service/saas/impl/SaasUserServiceImpl.java
db/saas.sql
0 → 100644
View file @
b1bbc90d
This diff is collapsed.
Click to expand it.
saas-module/src/main/java/com/makeit/controller/saas/SaasLoginController.java
View file @
b1bbc90d
...
@@ -4,7 +4,7 @@ import com.makeit.common.dto.LoginDTO;
...
@@ -4,7 +4,7 @@ import com.makeit.common.dto.LoginDTO;
import
com.makeit.common.response.ApiResponseEntity
;
import
com.makeit.common.response.ApiResponseEntity
;
import
com.makeit.common.response.ApiResponseUtils
;
import
com.makeit.common.response.ApiResponseUtils
;
import
com.makeit.service.saas.SaasUserService
;
import
com.makeit.service.saas.SaasUserService
;
import
com.makeit.utils.user.UserLoginVO
;
import
com.makeit.utils.user.
Saas
UserLoginVO
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -23,7 +23,7 @@ public class SaasLoginController {
...
@@ -23,7 +23,7 @@ public class SaasLoginController {
@ApiOperation
(
"登录"
)
@ApiOperation
(
"登录"
)
@PostMapping
(
"login"
)
@PostMapping
(
"login"
)
public
ApiResponseEntity
<
UserLoginVO
>
login
(
@RequestBody
LoginDTO
loginDTO
)
{
public
ApiResponseEntity
<
Saas
UserLoginVO
>
login
(
@RequestBody
LoginDTO
loginDTO
)
{
return
ApiResponseUtils
.
success
(
saasUserService
.
login
(
loginDTO
));
return
ApiResponseUtils
.
success
(
saasUserService
.
login
(
loginDTO
));
}
}
...
...
saas-module/src/main/java/com/makeit/controller/saas/SaasRoleController.java
0 → 100644
View file @
b1bbc90d
package
com
.
makeit
.
controller
.
saas
;
import
com.makeit.common.dto.BaseIdDTO
;
import
com.makeit.common.dto.StatusDTO
;
import
com.makeit.common.response.ApiResponseEntity
;
import
com.makeit.common.response.ApiResponseUtils
;
import
com.makeit.global.annotation.Action
;
import
com.makeit.module.admin.saas.SaasRoleDTOVO
;
import
com.makeit.module.admin.saas.PlatRoleMenuDTO
;
import
com.makeit.module.admin.saas.PlatUserRoleDTO
;
import
com.makeit.service.saas.SaasRoleService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.List
;
/**
* <p>
* saas端角色 前端控制器
* </p>
*
* @author eugene young
* @since 2022-05-10
*/
@Api
(
tags
=
"saas端-角色"
)
@RestController
@RequestMapping
(
"/saas/role"
)
public
class
SaasRoleController
{
@Autowired
private
SaasRoleService
saasRoleService
;
@Action
(
module
=
"saas端-角色"
,
name
=
"列表"
,
code
=
"saas:role:list"
)
@ApiOperation
(
"列表"
)
@PostMapping
(
"list"
)
public
ApiResponseEntity
<
List
<
SaasRoleDTOVO
>>
list
(
@RequestBody
SaasRoleDTOVO
dto
){
return
ApiResponseUtils
.
success
(
saasRoleService
.
list
(
dto
));
}
@ApiOperation
(
"列表(AuthIgnore)"
)
@PostMapping
(
"listAuthIgnore"
)
public
ApiResponseEntity
<
List
<
SaasRoleDTOVO
>>
listAuthIgnore
(
@RequestBody
SaasRoleDTOVO
dto
){
return
ApiResponseUtils
.
success
(
saasRoleService
.
list
(
dto
));
}
@Action
(
module
=
"saas端-角色"
,
name
=
"新增"
,
code
=
"saas:role:add"
)
@ApiOperation
(
"新增"
)
@PostMapping
(
"add"
)
public
ApiResponseEntity
<?>
add
(
@Validated
@RequestBody
SaasRoleDTOVO
dto
){
saasRoleService
.
add
(
dto
);
return
ApiResponseUtils
.
success
();
}
@Action
(
module
=
"saas端-角色"
,
name
=
"编辑"
,
code
=
"saas:role:edit"
)
@ApiOperation
(
"编辑"
)
@PostMapping
(
"edit"
)
public
ApiResponseEntity
<?>
edit
(
@Validated
@RequestBody
SaasRoleDTOVO
dto
){
saasRoleService
.
edit
(
dto
);
return
ApiResponseUtils
.
success
();
}
@Action
(
module
=
"saas端-角色"
,
name
=
"详情"
,
code
=
"saas:role:view"
)
@ApiOperation
(
"详情"
)
@PostMapping
(
"view"
)
public
ApiResponseEntity
<
SaasRoleDTOVO
>
view
(
@RequestBody
BaseIdDTO
dto
){
return
ApiResponseUtils
.
success
(
saasRoleService
.
view
(
dto
.
getId
()));
}
@Action
(
module
=
"saas端-角色"
,
name
=
"删除"
,
code
=
"saas:role:del"
)
@ApiOperation
(
"删除"
)
@PostMapping
(
"del"
)
public
ApiResponseEntity
<?>
del
(
@RequestBody
BaseIdDTO
dto
){
saasRoleService
.
del
(
dto
.
getId
());
return
ApiResponseUtils
.
success
();
}
@Action
(
module
=
"saas端-角色"
,
name
=
"改变状态"
,
code
=
"saas:role:changeStatus"
)
@ApiOperation
(
"改变状态"
)
@PostMapping
(
"changeStatus"
)
public
ApiResponseEntity
<?>
changeStatus
(
@RequestBody
StatusDTO
dto
){
saasRoleService
.
changeStatus
(
dto
);
return
ApiResponseUtils
.
success
();
}
@Action
(
module
=
"saas端-角色"
,
name
=
"分配用户"
,
code
=
"saas:role:assignUserList"
)
@ApiOperation
(
"分配用户"
)
@PostMapping
(
"assignUserList"
)
public
ApiResponseEntity
<?>
assignUserList
(
@RequestBody
List
<
PlatUserRoleDTO
>
userRoleDTOList
){
//参数要不要是一个对象里 有一个数组
saasRoleService
.
assignUserList
(
userRoleDTOList
);
return
ApiResponseUtils
.
success
();
}
@Action
(
module
=
"saas端-角色"
,
name
=
"删除分配用户"
,
code
=
"saas:role:removeAssignUserList"
)
@ApiOperation
(
"删除分配用户"
)
@PostMapping
(
"removeAssignUserList"
)
public
ApiResponseEntity
<?>
removeAssignUserList
(
@RequestBody
List
<
PlatUserRoleDTO
>
userRoleDTOList
){
saasRoleService
.
removeAssignUserList
(
userRoleDTOList
);
return
ApiResponseUtils
.
success
();
}
@Action
(
module
=
"saas端-角色"
,
name
=
"分配菜单"
,
code
=
"saas:role:assignMenuList"
)
@ApiOperation
(
"分配菜单"
)
@PostMapping
(
"assignMenuList"
)
public
ApiResponseEntity
<?>
assignMenuList
(
@RequestBody
PlatRoleMenuDTO
roleMenuDTO
){
saasRoleService
.
assignMenuList
(
roleMenuDTO
);
return
ApiResponseUtils
.
success
();
}
}
saas-module/src/main/java/com/makeit/controller/saas/SaasUserController.java
0 → 100644
View file @
b1bbc90d
package
com
.
makeit
.
controller
.
saas
;
import
com.makeit.common.dto.BaseIdDTO
;
import
com.makeit.common.dto.StatusDTO
;
import
com.makeit.common.page.PageReqDTO
;
import
com.makeit.common.page.PageVO
;
import
com.makeit.common.response.ApiResponseEntity
;
import
com.makeit.common.response.ApiResponseUtils
;
import
com.makeit.global.annotation.Action
;
import
com.makeit.module.admin.saas.SaasUserDTOVO
;
import
com.makeit.module.admin.saas.PlatUserQueryDTO
;
import
com.makeit.service.saas.SaasUserService
;
import
com.makeit.utils.user.SaasUserLoginVO
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.List
;
/**
* <p>
* SAAS端用户 前端控制器
* </p>
*
* @author eugene young
* @since 2022-05-10
*/
@Api
(
tags
=
"SAAS端-用户"
)
@RestController
@RequestMapping
(
"/saas/user"
)
public
class
SaasUserController
{
@Autowired
private
SaasUserService
saasUserService
;
@Action
(
module
=
"SAAS端-用户"
,
name
=
"分页列表"
,
code
=
"saas:user:page"
)
@ApiOperation
(
"分页列表"
)
@PostMapping
(
"page"
)
public
ApiResponseEntity
<
PageVO
<
SaasUserDTOVO
>>
page
(
@RequestBody
PageReqDTO
<
PlatUserQueryDTO
>
page
){
return
ApiResponseUtils
.
success
(
saasUserService
.
page
(
page
));
}
@ApiOperation
(
"分页列表"
)
@PostMapping
(
"pageAuthIgnore"
)
public
ApiResponseEntity
<
PageVO
<
SaasUserDTOVO
>>
pageAuthIgnore
(
@RequestBody
PageReqDTO
<
PlatUserQueryDTO
>
page
){
return
ApiResponseUtils
.
success
(
saasUserService
.
page
(
page
));
}
//@Action(module = "SAAS端-用户", name = "分页列表-排除超级管理员", code = "plat:user:pageNotSuperAdmin")
@ApiOperation
(
"分页列表-排除超级管理员"
)
@PostMapping
(
"pageNotSuperAdmin"
)
public
ApiResponseEntity
<
PageVO
<
SaasUserDTOVO
>>
pageNotSuperAdmin
(
@RequestBody
PageReqDTO
<
PlatUserQueryDTO
>
page
){
return
ApiResponseUtils
.
success
(
saasUserService
.
pageNoSuperAdmin
(
page
));
}
@ApiOperation
(
"分页列表(AuthIgnore)"
)
@PostMapping
(
"listAuthIgnore"
)
public
ApiResponseEntity
<
List
<
SaasUserDTOVO
>>
listAuthIgnore
(
@RequestBody
PlatUserQueryDTO
dto
){
return
ApiResponseUtils
.
success
(
saasUserService
.
list
(
dto
));
}
@ApiOperation
(
"分页列表-排除超级管理员(AuthIgnore)"
)
@PostMapping
(
"listNotSuperAdminAuthIgnore"
)
public
ApiResponseEntity
<
List
<
SaasUserDTOVO
>>
listNotSuperAdminAuthIgnore
(
@RequestBody
PlatUserQueryDTO
dto
){
return
ApiResponseUtils
.
success
(
saasUserService
.
listNoSuperAdmin
(
dto
));
}
@Action
(
module
=
"SAAS端-用户"
,
name
=
"新增"
,
code
=
"saas:user:add"
)
@ApiOperation
(
"新增"
)
@PostMapping
(
"add"
)
public
ApiResponseEntity
<?>
add
(
@Validated
@RequestBody
SaasUserDTOVO
dto
){
saasUserService
.
add
(
dto
);
return
ApiResponseUtils
.
success
();
}
@Action
(
module
=
"SAAS端-用户"
,
name
=
"编辑"
,
code
=
"saas:user:edit"
)
@ApiOperation
(
"编辑"
)
@PostMapping
(
"edit"
)
public
ApiResponseEntity
<?>
edit
(
@Validated
@RequestBody
SaasUserDTOVO
dto
){
saasUserService
.
edit
(
dto
);
return
ApiResponseUtils
.
success
();
}
@Action
(
module
=
"SAAS端-用户"
,
name
=
"改变密码"
,
code
=
"saas:user:changePassword"
)
@ApiOperation
(
"改变密码"
)
@PostMapping
(
"changePassword"
)
public
ApiResponseEntity
<?>
changePassword
(
@RequestBody
SaasUserDTOVO
dto
){
saasUserService
.
changePassword
(
dto
);
return
ApiResponseUtils
.
success
();
}
@Action
(
module
=
"SAAS端-用户"
,
name
=
"详情"
,
code
=
"saas:user:view"
)
@ApiOperation
(
"详情"
)
@PostMapping
(
"view"
)
public
ApiResponseEntity
<
SaasUserDTOVO
>
view
(
@RequestBody
BaseIdDTO
dto
){;
return
ApiResponseUtils
.
success
(
saasUserService
.
view
(
dto
.
getId
()));
}
@Action
(
module
=
"SAAS端-用户"
,
name
=
"删除"
,
code
=
"saas:user:del"
)
@ApiOperation
(
"删除"
)
@PostMapping
(
"del"
)
public
ApiResponseEntity
<?>
del
(
@RequestBody
BaseIdDTO
dto
){
saasUserService
.
del
(
dto
.
getId
());
return
ApiResponseUtils
.
success
();
}
@Action
(
module
=
"SAAS端-用户"
,
name
=
"改变状态"
,
code
=
"saas:user:changeStatus"
)
@ApiOperation
(
"改变状态"
)
@PostMapping
(
"changeStatus"
)
public
ApiResponseEntity
<?>
changeStatus
(
@RequestBody
StatusDTO
dto
){
saasUserService
.
changeStatus
(
dto
);
return
ApiResponseUtils
.
success
();
}
@ApiOperation
(
"获取当前登录用户的角色菜单"
)
@PostMapping
(
"getRoleMenu"
)
public
ApiResponseEntity
<
SaasUserLoginVO
>
getRoleAndMenuList
(){
return
ApiResponseUtils
.
success
(
saasUserService
.
getRoleAndMenuList
());
}
@ApiOperation
(
"获取当前登录用户的用户信息"
)
@PostMapping
(
"getUserVO"
)
public
ApiResponseEntity
<
SaasUserLoginVO
>
getUserInfo
(){
return
ApiResponseUtils
.
success
(
saasUserService
.
getUserVO
());
}
}
server-common/src/main/java/com/makeit/common/entity/BaseEntity.java
View file @
b1bbc90d
...
@@ -37,7 +37,7 @@ public class BaseEntity implements Serializable {
...
@@ -37,7 +37,7 @@ public class BaseEntity implements Serializable {
@ApiModelProperty
(
value
=
"创建时间"
,
required
=
false
)
@ApiModelProperty
(
value
=
"创建时间"
,
required
=
false
)
@TableField
(
value
=
"create_date"
,
fill
=
FieldFill
.
INSERT
,
typeHandler
=
LocalDateTimeTypeHandler
.
class
)
@TableField
(
value
=
"create_date"
,
fill
=
FieldFill
.
INSERT
,
typeHandler
=
LocalDateTimeTypeHandler
.
class
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
LocalDateTime
create
dAt
;
private
LocalDateTime
create
Date
;
/**
/**
* 更新时间
* 更新时间
...
@@ -45,7 +45,7 @@ public class BaseEntity implements Serializable {
...
@@ -45,7 +45,7 @@ public class BaseEntity implements Serializable {
@ApiModelProperty
(
value
=
"更新时间"
,
required
=
false
)
@ApiModelProperty
(
value
=
"更新时间"
,
required
=
false
)
@TableField
(
value
=
"update_date"
,
fill
=
FieldFill
.
INSERT_UPDATE
,
typeHandler
=
LocalDateTimeTypeHandler
.
class
)
@TableField
(
value
=
"update_date"
,
fill
=
FieldFill
.
INSERT_UPDATE
,
typeHandler
=
LocalDateTimeTypeHandler
.
class
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
LocalDateTime
update
dAt
;
private
LocalDateTime
update
Date
;
@TableLogic
@TableLogic
...
...
server-common/src/main/java/com/makeit/config/mybatis/objecthandler/LocalDateTimeObjectHandler.java
View file @
b1bbc90d
...
@@ -19,12 +19,12 @@ public class LocalDateTimeObjectHandler implements MetaObjectHandlerInternal{
...
@@ -19,12 +19,12 @@ public class LocalDateTimeObjectHandler implements MetaObjectHandlerInternal{
@Override
@Override
public
void
insertFill
(
MetaObject
metaObject
,
MetaObjectHandler
handler
)
{
public
void
insertFill
(
MetaObject
metaObject
,
MetaObjectHandler
handler
)
{
handler
.
setFieldValByName
(
BaseEntity
.
Fields
.
create
dAt
,
LocalDateTime
.
now
(),
metaObject
);
handler
.
setFieldValByName
(
BaseEntity
.
Fields
.
create
Date
,
LocalDateTime
.
now
(),
metaObject
);
handler
.
setFieldValByName
(
BaseEntity
.
Fields
.
update
dAt
,
LocalDateTime
.
now
(),
metaObject
);
handler
.
setFieldValByName
(
BaseEntity
.
Fields
.
update
Date
,
LocalDateTime
.
now
(),
metaObject
);
}
}
@Override
@Override
public
void
updateFill
(
MetaObject
metaObject
,
MetaObjectHandler
handler
)
{
public
void
updateFill
(
MetaObject
metaObject
,
MetaObjectHandler
handler
)
{
handler
.
setFieldValByName
(
BaseEntity
.
Fields
.
update
dAt
,
LocalDateTime
.
now
(),
metaObject
);
handler
.
setFieldValByName
(
BaseEntity
.
Fields
.
update
Date
,
LocalDateTime
.
now
(),
metaObject
);
}
}
}
}
server-common/src/main/java/com/makeit/enums/redis/RedisConst.java
View file @
b1bbc90d
...
@@ -48,12 +48,16 @@ public class RedisConst {
...
@@ -48,12 +48,16 @@ public class RedisConst {
//public static final String PLATFORM_TOKEN_PREFIX = "plat:token:";
//public static final String PLATFORM_TOKEN_PREFIX = "plat:token:";
//public static final String PLATFORM_TOKEN_ROLE_MENU_PREFIX = "plat:role:menu:token:";//TODO ywc 这里可能有大key问题
//public static final String PLATFORM_TOKEN_ROLE_MENU_PREFIX = "plat:role:menu:token:";//TODO ywc 这里可能有大key问题
//todo 为啥要区分?
public
static
final
String
TOKEN_PREFIX
=
"token:"
;
public
static
final
String
TOKEN_PREFIX
=
"token:"
;
public
static
final
String
TOKEN_ROLE_MENU_PREFIX
=
"role:menu:token:"
;
//TODO ywc 这里可能有大key问题 改成list存?
public
static
final
String
TOKEN_ROLE_MENU_PREFIX
=
"role:menu:token:"
;
//TODO ywc 这里可能有大key问题 改成list存?
public
static
final
String
WECHAT_TOKEN_PREFIX
=
"wechat:token:"
;
public
static
final
String
WECHAT_TOKEN_PREFIX
=
"wechat:token:"
;
public
static
final
String
WECHAT_TOKEN_ROLE_MENU_PREFIX
=
"wechat:role:menu:token:"
;
//TODO ywc 这里可能有大key问题
public
static
final
String
WECHAT_TOKEN_ROLE_MENU_PREFIX
=
"wechat:role:menu:token:"
;
//TODO ywc 这里可能有大key问题
public
static
final
String
PLATFORM_TOKEN_PREFIX
=
"plat:token:"
;
public
static
final
String
PLATFORM_TOKEN_ROLE_MENU_PREFIX
=
"plat:role:menu:token:"
;
//public static final String CUS_TOKEN_PREFIX = "cus:token:";
//public static final String CUS_TOKEN_PREFIX = "cus:token:";
public
static
final
int
PLATFORM_EXPIRE_MINUTES
=
120
;
public
static
final
int
PLATFORM_EXPIRE_MINUTES
=
120
;
...
@@ -86,8 +90,7 @@ public class RedisConst {
...
@@ -86,8 +90,7 @@ public class RedisConst {
public
static
final
String
TOPIC_TNT_CONFIG_REFRESH
=
"topic:tnt:config:refresh"
;
public
static
final
String
TOPIC_TNT_CONFIG_REFRESH
=
"topic:tnt:config:refresh"
;
public
static
final
String
TOPIC_I18N_DIC_REFRESH
=
"topic:i18n:dict:refresh"
;
public
static
final
String
TOPIC_I18N_DIC_REFRESH
=
"topic:i18n:dict:refresh"
;
public
static
final
String
PLATFORM_TOKEN_PREFIX
=
"plat:token:"
;
public
static
final
String
PLATFORM_TOKEN_ROLE_MENU_PREFIX
=
"plat:role:menu:token:"
;
...
...
server-common/src/main/java/com/makeit/module/admin/saas/PlatMenuDTOVO.java
View file @
b1bbc90d
...
@@ -67,7 +67,7 @@ public class PlatMenuDTOVO extends BaseIdDTO implements Serializable {
...
@@ -67,7 +67,7 @@ public class PlatMenuDTOVO extends BaseIdDTO implements Serializable {
*/
*/
@ApiModelProperty
(
value
=
"创建时间"
,
required
=
false
)
@ApiModelProperty
(
value
=
"创建时间"
,
required
=
false
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
LocalDateTime
create
dAt
;
private
LocalDateTime
create
Date
;
@TableField
(
exist
=
false
)
@TableField
(
exist
=
false
)
@ApiModelProperty
(
value
=
"子集"
)
@ApiModelProperty
(
value
=
"子集"
)
...
...
server-common/src/main/java/com/makeit/module/admin/saas/
Plat
RoleDTOVO.java
→
server-common/src/main/java/com/makeit/module/admin/saas/
Saas
RoleDTOVO.java
View file @
b1bbc90d
...
@@ -12,9 +12,9 @@ import javax.validation.constraints.Size;
...
@@ -12,9 +12,9 @@ import javax.validation.constraints.Size;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.time.LocalDateTime
;
import
java.time.LocalDateTime
;
@ApiModel
(
"
平台
端角色 列表 新增 编辑 详情"
)
@ApiModel
(
"
SAAS
端角色 列表 新增 编辑 详情"
)
@Data
@Data
public
class
Plat
RoleDTOVO
extends
BaseIdDTO
implements
Serializable
{
public
class
Saas
RoleDTOVO
extends
BaseIdDTO
implements
Serializable
{
@NotBlank
(
message
=
"名称不能为空"
)
@NotBlank
(
message
=
"名称不能为空"
)
@Size
(
max
=
64
,
message
=
"名称最长为64字符"
)
@Size
(
max
=
64
,
message
=
"名称最长为64字符"
)
...
@@ -47,7 +47,7 @@ public class PlatRoleDTOVO extends BaseIdDTO implements Serializable {
...
@@ -47,7 +47,7 @@ public class PlatRoleDTOVO extends BaseIdDTO implements Serializable {
*/
*/
@ApiModelProperty
(
value
=
"创建时间"
,
required
=
false
)
@ApiModelProperty
(
value
=
"创建时间"
,
required
=
false
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
LocalDateTime
create
dAt
;
private
LocalDateTime
create
Date
;
@ApiModelProperty
(
value
=
"关键词 查询用"
)
@ApiModelProperty
(
value
=
"关键词 查询用"
)
private
String
keyword
;
private
String
keyword
;
...
...
server-common/src/main/java/com/makeit/module/admin/saas/
Plat
UserDTOVO.java
→
server-common/src/main/java/com/makeit/module/admin/saas/
Saas
UserDTOVO.java
View file @
b1bbc90d
...
@@ -17,7 +17,7 @@ import java.util.List;
...
@@ -17,7 +17,7 @@ import java.util.List;
@ApiModel
(
"平台端用户 新增 编辑 详情"
)
@ApiModel
(
"平台端用户 新增 编辑 详情"
)
@Data
@Data
public
class
Plat
UserDTOVO
extends
BaseIdDTO
implements
Serializable
{
public
class
Saas
UserDTOVO
extends
BaseIdDTO
implements
Serializable
{
// @ApiModelProperty(value = "用户名")
// @ApiModelProperty(value = "用户名")
...
@@ -60,9 +60,9 @@ public class PlatUserDTOVO extends BaseIdDTO implements Serializable {
...
@@ -60,9 +60,9 @@ public class PlatUserDTOVO extends BaseIdDTO implements Serializable {
*/
*/
@ApiModelProperty
(
value
=
"创建时间"
,
required
=
false
)
@ApiModelProperty
(
value
=
"创建时间"
,
required
=
false
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
LocalDateTime
create
dAt
;
private
LocalDateTime
create
Date
;
@TableField
(
exist
=
false
)
@TableField
(
exist
=
false
)
@ApiModelProperty
(
value
=
"角色集合"
)
@ApiModelProperty
(
value
=
"角色集合"
)
private
List
<
Plat
RoleDTOVO
>
roleList
;
private
List
<
Saas
RoleDTOVO
>
roleList
;
}
}
server-common/src/main/java/com/makeit/module/admin/service/impl/SysDeptServiceImpl.java
View file @
b1bbc90d
...
@@ -64,7 +64,7 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
...
@@ -64,7 +64,7 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
.
eq
(
StringUtils
.
isNotBlank
(
dto
.
getTag
()),
SysDept:
:
getTag
,
dto
.
getTag
())
.
eq
(
StringUtils
.
isNotBlank
(
dto
.
getTag
()),
SysDept:
:
getTag
,
dto
.
getTag
())
.
orderByAsc
(
SysDept:
:
getTag
)
.
orderByAsc
(
SysDept:
:
getTag
)
.
orderByAsc
(
SysDept:
:
getCreate
dAt
);
.
orderByAsc
(
SysDept:
:
getCreate
Date
);
return
lambdaQueryWrapper
;
return
lambdaQueryWrapper
;
}
}
...
...
server-common/src/main/java/com/makeit/module/admin/service/impl/SysFactoryServiceImpl.java
View file @
b1bbc90d
...
@@ -71,7 +71,7 @@ public class SysFactoryServiceImpl extends ServiceImpl<SysFactoryMapper, SysFact
...
@@ -71,7 +71,7 @@ public class SysFactoryServiceImpl extends ServiceImpl<SysFactoryMapper, SysFact
LambdaQueryWrapper
<
SysFactory
>
lambdaQueryWrapper
=
new
QueryWrapper
<
SysFactory
>().
lambda
()
LambdaQueryWrapper
<
SysFactory
>
lambdaQueryWrapper
=
new
QueryWrapper
<
SysFactory
>().
lambda
()
.
like
(
StringUtils
.
isNotBlank
(
dto
.
getName
()),
SysFactory:
:
getName
,
dto
.
getName
());
.
like
(
StringUtils
.
isNotBlank
(
dto
.
getName
()),
SysFactory:
:
getName
,
dto
.
getName
());
lambdaQueryWrapper
.
orderByDesc
(
SysFactory:
:
getCreate
dAt
);
lambdaQueryWrapper
.
orderByDesc
(
SysFactory:
:
getCreate
Date
);
return
lambdaQueryWrapper
;
return
lambdaQueryWrapper
;
}
}
...
@@ -157,7 +157,7 @@ public class SysFactoryServiceImpl extends ServiceImpl<SysFactoryMapper, SysFact
...
@@ -157,7 +157,7 @@ public class SysFactoryServiceImpl extends ServiceImpl<SysFactoryMapper, SysFact
if
(
SysUserUtil
.
isSuper
())
{
if
(
SysUserUtil
.
isSuper
())
{
List
<
SysFactory
>
factoryList
=
list
(
new
QueryWrapper
<
SysFactory
>().
lambda
()
List
<
SysFactory
>
factoryList
=
list
(
new
QueryWrapper
<
SysFactory
>().
lambda
()
.
orderByAsc
(
SysFactory:
:
getCreate
dAt
)
.
orderByAsc
(
SysFactory:
:
getCreate
Date
)
);
);
return
factoryList
;
return
factoryList
;
}
}
...
@@ -171,7 +171,7 @@ public class SysFactoryServiceImpl extends ServiceImpl<SysFactoryMapper, SysFact
...
@@ -171,7 +171,7 @@ public class SysFactoryServiceImpl extends ServiceImpl<SysFactoryMapper, SysFact
List
<
SysFactory
>
factoryList
=
list
(
new
QueryWrapper
<
SysFactory
>().
lambda
()
List
<
SysFactory
>
factoryList
=
list
(
new
QueryWrapper
<
SysFactory
>().
lambda
()
.
in
(
SysFactory:
:
getId
,
factoryIdList
)
.
in
(
SysFactory:
:
getId
,
factoryIdList
)
.
orderByAsc
(
SysFactory:
:
getCreate
dAt
)
.
orderByAsc
(
SysFactory:
:
getCreate
Date
)
);
);
return
factoryList
;
return
factoryList
;
...
@@ -200,7 +200,7 @@ public class SysFactoryServiceImpl extends ServiceImpl<SysFactoryMapper, SysFact
...
@@ -200,7 +200,7 @@ public class SysFactoryServiceImpl extends ServiceImpl<SysFactoryMapper, SysFact
userIdList
=
new
ArrayList
<>(
userIdList
);
userIdList
=
new
ArrayList
<>(
userIdList
);
userIdList
.
add
(-
1
+
""
);
userIdList
.
add
(-
1
+
""
);
List
<
SysFactory
>
tenantList
=
list
(
new
QueryWrapper
<
SysFactory
>().
lambda
()
List
<
SysFactory
>
tenantList
=
list
(
new
QueryWrapper
<
SysFactory
>().
lambda
()
.
orderByAsc
(
SysFactory:
:
getCreate
dAt
)
.
orderByAsc
(
SysFactory:
:
getCreate
Date
)
);
);
return
BeanDtoVoUtils
.
listVo
(
tenantList
,
SysFactoryDTOVO
.
class
);
return
BeanDtoVoUtils
.
listVo
(
tenantList
,
SysFactoryDTOVO
.
class
);
}
}
...
...
server-common/src/main/java/com/makeit/module/admin/service/impl/SysMenuServiceImpl.java
View file @
b1bbc90d
...
@@ -68,7 +68,7 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
...
@@ -68,7 +68,7 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
.
in
(
StringUtils
.
isNotBlank
(
dto
.
getRoleId
()),
SysMenu:
:
getId
,
menuIdList
)
.
in
(
StringUtils
.
isNotBlank
(
dto
.
getRoleId
()),
SysMenu:
:
getId
,
menuIdList
)
//.orderByAsc(TntMenu::getParentId)
//.orderByAsc(TntMenu::getParentId)
.
orderByAsc
(
SysMenu:
:
getSort
)
.
orderByAsc
(
SysMenu:
:
getSort
)
.
orderByAsc
(
SysMenu:
:
getCreate
dAt
)
.
orderByAsc
(
SysMenu:
:
getCreate
By
)
);
);
return
BeanDtoVoUtils
.
listVo
(
sysMenuList
,
SysMenuDTOVO
.
class
);
return
BeanDtoVoUtils
.
listVo
(
sysMenuList
,
SysMenuDTOVO
.
class
);
...
...
server-common/src/main/java/com/makeit/module/admin/service/impl/SysRoleServiceImpl.java
View file @
b1bbc90d
...
@@ -86,7 +86,7 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl
...
@@ -86,7 +86,7 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl
.
like
(
StringUtils
.
isNotBlank
(
dto
.
getKeyword
()),
SysRole:
:
getName
,
dto
.
getKeyword
());
.
like
(
StringUtils
.
isNotBlank
(
dto
.
getKeyword
()),
SysRole:
:
getName
,
dto
.
getKeyword
());
})
})
.
eq
(
StringUtils
.
isNotBlank
(
dto
.
getStatus
()),
SysRole:
:
getStatus
,
dto
.
getStatus
())
.
eq
(
StringUtils
.
isNotBlank
(
dto
.
getStatus
()),
SysRole:
:
getStatus
,
dto
.
getStatus
())
.
orderByDesc
(
SysRole:
:
getCreate
dAt
);
.
orderByDesc
(
SysRole:
:
getCreate
Date
);
menuFilter
(
dto
,
lambdaQueryWrapper
);
menuFilter
(
dto
,
lambdaQueryWrapper
);
...
...
server-common/src/main/java/com/makeit/module/admin/service/impl/SysUserServiceImpl.java
View file @
b1bbc90d
...
@@ -271,7 +271,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
...
@@ -271,7 +271,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
List
<
SysMenu
>
menuList
=
sysMenuService
.
list
(
new
QueryWrapper
<
SysMenu
>().
lambda
()
List
<
SysMenu
>
menuList
=
sysMenuService
.
list
(
new
QueryWrapper
<
SysMenu
>().
lambda
()
.
eq
(
SysMenu:
:
getStatus
,
CommonEnum
.
YES
.
getValue
())
.
eq
(
SysMenu:
:
getStatus
,
CommonEnum
.
YES
.
getValue
())
.
orderByAsc
(
SysMenu:
:
getSort
)
.
orderByAsc
(
SysMenu:
:
getSort
)
.
orderByAsc
(
SysMenu:
:
getCreate
dAt
)
.
orderByAsc
(
SysMenu:
:
getCreate
Date
)
);
);
return
menuList
;
return
menuList
;
...
@@ -385,7 +385,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
...
@@ -385,7 +385,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
.
in
(
SysMenu:
:
getId
,
menuIdList
)
.
in
(
SysMenu:
:
getId
,
menuIdList
)
.
eq
(
SysMenu:
:
getStatus
,
CommonEnum
.
YES
.
getValue
())
.
eq
(
SysMenu:
:
getStatus
,
CommonEnum
.
YES
.
getValue
())
.
orderByAsc
(
SysMenu:
:
getSort
)
.
orderByAsc
(
SysMenu:
:
getSort
)
.
orderByAsc
(
SysMenu:
:
getCreate
dAt
)
.
orderByAsc
(
SysMenu:
:
getCreate
Date
)
);
);
userLoginVO
.
setRoleList
(
BeanDtoVoUtils
.
listVo
(
roleList
,
SysRoleDTOVO
.
class
));
userLoginVO
.
setRoleList
(
BeanDtoVoUtils
.
listVo
(
roleList
,
SysRoleDTOVO
.
class
));
...
@@ -560,7 +560,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
...
@@ -560,7 +560,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
roleIdList
(
lambdaQueryWrapper
,
dto
);
roleIdList
(
lambdaQueryWrapper
,
dto
);
lambdaQueryWrapper
.
orderByDesc
(
SysUser:
:
getCreate
dAt
);
lambdaQueryWrapper
.
orderByDesc
(
SysUser:
:
getCreate
Date
);
lambdaQueryWrapper
.
orderByDesc
(
SysUser:
:
getId
);
lambdaQueryWrapper
.
orderByDesc
(
SysUser:
:
getId
);
//TODO ywc 要不要改成全查出来 内存过滤
//TODO ywc 要不要改成全查出来 内存过滤
...
...
server-common/src/main/java/com/makeit/module/system/service/impl/SysConfigCategoryServiceImpl.java
View file @
b1bbc90d
...
@@ -35,7 +35,7 @@ public class SysConfigCategoryServiceImpl extends ServiceImpl<SysConfigCategoryM
...
@@ -35,7 +35,7 @@ public class SysConfigCategoryServiceImpl extends ServiceImpl<SysConfigCategoryM
.
like
(
StringUtils
.
isNotBlank
(
tntConfigCategory
.
getName
()),
SysConfigCategory:
:
getName
,
tntConfigCategory
.
getName
())
.
like
(
StringUtils
.
isNotBlank
(
tntConfigCategory
.
getName
()),
SysConfigCategory:
:
getName
,
tntConfigCategory
.
getName
())
.
like
(
StringUtils
.
isNotBlank
(
tntConfigCategory
.
getCode
()),
SysConfigCategory:
:
getCode
,
tntConfigCategory
.
getCode
())
.
like
(
StringUtils
.
isNotBlank
(
tntConfigCategory
.
getCode
()),
SysConfigCategory:
:
getCode
,
tntConfigCategory
.
getCode
())
.
eq
(
SysConfigCategory:
:
getTenantId
,
tntConfigCategory
.
getTenantId
())
.
eq
(
SysConfigCategory:
:
getTenantId
,
tntConfigCategory
.
getTenantId
())
.
orderByAsc
(
SysConfigCategory:
:
getCreate
dAt
)
.
orderByAsc
(
SysConfigCategory:
:
getCreate
Date
)
);
);
return
BeanDtoVoUtils
.
listVo
(
configCategoryList
,
SysConfigCategoryDTOVO
.
class
);
return
BeanDtoVoUtils
.
listVo
(
configCategoryList
,
SysConfigCategoryDTOVO
.
class
);
}
}
...
...
server-common/src/main/java/com/makeit/module/system/service/impl/SysDictionaryCategoryServiceImpl.java
View file @
b1bbc90d
...
@@ -36,10 +36,10 @@ public class SysDictionaryCategoryServiceImpl extends ServiceImpl<SysDictionaryC
...
@@ -36,10 +36,10 @@ public class SysDictionaryCategoryServiceImpl extends ServiceImpl<SysDictionaryC
public
List
<
SysDictionaryCategory
>
getEpDictionaryCategoryByList
()
{
public
List
<
SysDictionaryCategory
>
getEpDictionaryCategoryByList
()
{
List
<
SysDictionaryCategory
>
sysDictionaryCategoryList
=
list
(
new
QueryWrapper
<
SysDictionaryCategory
>().
lambda
()
List
<
SysDictionaryCategory
>
sysDictionaryCategoryList
=
list
(
new
QueryWrapper
<
SysDictionaryCategory
>().
lambda
()
/*.orderByAsc(PlatDictionaryCategory::getSort)*/
.
orderByAsc
(
SysDictionaryCategory:
:
getCreate
dAt
));
/*.orderByAsc(PlatDictionaryCategory::getSort)*/
.
orderByAsc
(
SysDictionaryCategory:
:
getCreate
Date
));
List
<
SysDictionary
>
sysDictionaryList
=
sysDictionaryService
.
list
(
new
QueryWrapper
<
SysDictionary
>().
lambda
()
List
<
SysDictionary
>
sysDictionaryList
=
sysDictionaryService
.
list
(
new
QueryWrapper
<
SysDictionary
>().
lambda
()
.
orderByAsc
(
SysDictionary:
:
getSort
).
orderByAsc
(
SysDictionary:
:
getCreate
dAt
));
.
orderByAsc
(
SysDictionary:
:
getSort
).
orderByAsc
(
SysDictionary:
:
getCreate
Date
));
Map
<
String
,
List
<
SysDictionary
>>
sysDictionaryMap
=
sysDictionaryList
.
stream
().
collect
(
Collectors
.
groupingBy
(
item
->
item
.
getCategoryId
()));
Map
<
String
,
List
<
SysDictionary
>>
sysDictionaryMap
=
sysDictionaryList
.
stream
().
collect
(
Collectors
.
groupingBy
(
item
->
item
.
getCategoryId
()));
for
(
SysDictionaryCategory
sysDictionaryCategory
:
sysDictionaryCategoryList
)
{
for
(
SysDictionaryCategory
sysDictionaryCategory
:
sysDictionaryCategoryList
)
{
...
@@ -55,13 +55,13 @@ public class SysDictionaryCategoryServiceImpl extends ServiceImpl<SysDictionaryC
...
@@ -55,13 +55,13 @@ public class SysDictionaryCategoryServiceImpl extends ServiceImpl<SysDictionaryC
List
<
SysDictionaryCategory
>
sysDictionaryCategoryList
=
list
(
new
QueryWrapper
<
SysDictionaryCategory
>().
lambda
()
List
<
SysDictionaryCategory
>
sysDictionaryCategoryList
=
list
(
new
QueryWrapper
<
SysDictionaryCategory
>().
lambda
()
.
like
(
SysDictionaryCategory:
:
getCode
,
prefix
)
.
like
(
SysDictionaryCategory:
:
getCode
,
prefix
)
.
orderByAsc
(
SysDictionaryCategory:
:
getCreate
dAt
));
.
orderByAsc
(
SysDictionaryCategory:
:
getCreate
Date
));
List
<
String
>
idList
=
StreamUtil
.
mapId
(
sysDictionaryCategoryList
,
SysDictionaryCategory:
:
getId
);
List
<
String
>
idList
=
StreamUtil
.
mapId
(
sysDictionaryCategoryList
,
SysDictionaryCategory:
:
getId
);
List
<
SysDictionary
>
sysDictionaryList
=
sysDictionaryService
.
list
(
new
QueryWrapper
<
SysDictionary
>().
lambda
()
List
<
SysDictionary
>
sysDictionaryList
=
sysDictionaryService
.
list
(
new
QueryWrapper
<
SysDictionary
>().
lambda
()
.
in
(
SysDictionary:
:
getCategoryId
,
idList
)
.
in
(
SysDictionary:
:
getCategoryId
,
idList
)
.
orderByAsc
(
SysDictionary:
:
getSort
).
orderByAsc
(
SysDictionary:
:
getCreate
dAt
));
.
orderByAsc
(
SysDictionary:
:
getSort
).
orderByAsc
(
SysDictionary:
:
getCreate
Date
));
Map
<
String
,
List
<
SysDictionary
>>
sysDictionaryMap
=
sysDictionaryList
.
stream
().
collect
(
Collectors
.
groupingBy
(
item
->
item
.
getCategoryId
()));
Map
<
String
,
List
<
SysDictionary
>>
sysDictionaryMap
=
sysDictionaryList
.
stream
().
collect
(
Collectors
.
groupingBy
(
item
->
item
.
getCategoryId
()));
for
(
SysDictionaryCategory
sysDictionaryCategory
:
sysDictionaryCategoryList
)
{
for
(
SysDictionaryCategory
sysDictionaryCategory
:
sysDictionaryCategoryList
)
{
...
@@ -124,7 +124,7 @@ public class SysDictionaryCategoryServiceImpl extends ServiceImpl<SysDictionaryC
...
@@ -124,7 +124,7 @@ public class SysDictionaryCategoryServiceImpl extends ServiceImpl<SysDictionaryC
public
List
<
SysDictionaryCategory
>
list
(
SysDictionaryCategory
sysDictionaryCategory
)
{
public
List
<
SysDictionaryCategory
>
list
(
SysDictionaryCategory
sysDictionaryCategory
)
{
List
<
SysDictionaryCategory
>
configCategoryList
=
list
(
new
QueryWrapper
<
SysDictionaryCategory
>().
lambda
()
List
<
SysDictionaryCategory
>
configCategoryList
=
list
(
new
QueryWrapper
<
SysDictionaryCategory
>().
lambda
()
.
like
(
StringUtils
.
isNotBlank
(
sysDictionaryCategory
.
getName
()),
SysDictionaryCategory:
:
getName
,
sysDictionaryCategory
.
getName
())
.
like
(
StringUtils
.
isNotBlank
(
sysDictionaryCategory
.
getName
()),
SysDictionaryCategory:
:
getName
,
sysDictionaryCategory
.
getName
())
.
orderByAsc
(
SysDictionaryCategory:
:
getCreate
dAt
)
.
orderByAsc
(
SysDictionaryCategory:
:
getCreate
Date
)
);
);
return
configCategoryList
;
return
configCategoryList
;
}
}
...
...
server-common/src/main/java/com/makeit/utils/user/PlatUserUtil.java
View file @
b1bbc90d
...
@@ -15,7 +15,7 @@ public class PlatUserUtil {
...
@@ -15,7 +15,7 @@ public class PlatUserUtil {
return
BeanDtoVoUtils
.
convert
(
TokenUtil
.
getPlatUserDetail
(),
PlatUserVO
.
class
);
return
BeanDtoVoUtils
.
convert
(
TokenUtil
.
getPlatUserDetail
(),
PlatUserVO
.
class
);
}
}
public
static
UserLoginVO
getUserVODetail
()
{
public
static
Saas
UserLoginVO
getUserVODetail
()
{
TokenUtil
.
platGetToken
();
TokenUtil
.
platGetToken
();
return
TokenUtil
.
getPlatUserDetail
();
return
TokenUtil
.
getPlatUserDetail
();
}
}
...
...
server-common/src/main/java/com/makeit/utils/user/UserLoginVO.java
→
server-common/src/main/java/com/makeit/utils/user/
Saas
UserLoginVO.java
View file @
b1bbc90d
...
@@ -2,7 +2,7 @@ package com.makeit.utils.user;
...
@@ -2,7 +2,7 @@ package com.makeit.utils.user;
import
com.makeit.module.admin.saas.PlatMenuDTOVO
;
import
com.makeit.module.admin.saas.PlatMenuDTOVO
;
import
com.makeit.module.admin.saas.
Plat
RoleDTOVO
;
import
com.makeit.module.admin.saas.
Saas
RoleDTOVO
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
...
@@ -10,7 +10,7 @@ import java.io.Serializable;
...
@@ -10,7 +10,7 @@ import java.io.Serializable;
import
java.util.List
;
import
java.util.List
;
@Data
@Data
public
class
UserLoginVO
implements
Serializable
{
public
class
Saas
UserLoginVO
implements
Serializable
{
@ApiModelProperty
(
"id"
)
@ApiModelProperty
(
"id"
)
private
String
id
;
private
String
id
;
...
@@ -19,7 +19,7 @@ public class UserLoginVO implements Serializable {
...
@@ -19,7 +19,7 @@ public class UserLoginVO implements Serializable {
private
String
account
;
private
String
account
;
@ApiModelProperty
(
"姓名"
)
@ApiModelProperty
(
"姓名"
)
private
String
name
;
private
String
user
name
;
// @ApiModelProperty("用户名")
// @ApiModelProperty("用户名")
// private String username;
// private String username;
...
@@ -28,7 +28,7 @@ public class UserLoginVO implements Serializable {
...
@@ -28,7 +28,7 @@ public class UserLoginVO implements Serializable {
private
String
token
;
private
String
token
;
@ApiModelProperty
(
"角色列表"
)
@ApiModelProperty
(
"角色列表"
)
private
List
<
Plat
RoleDTOVO
>
roleList
;
private
List
<
Saas
RoleDTOVO
>
roleList
;
@ApiModelProperty
(
"菜单树形列表"
)
@ApiModelProperty
(
"菜单树形列表"
)
private
List
<
PlatMenuDTOVO
>
menuList
;
private
List
<
PlatMenuDTOVO
>
menuList
;
...
...
server-common/src/main/java/com/makeit/utils/user/ThreadLocalUserUtil.java
View file @
b1bbc90d
...
@@ -13,7 +13,7 @@ public class ThreadLocalUserUtil {
...
@@ -13,7 +13,7 @@ public class ThreadLocalUserUtil {
private
static
final
ThreadLocal
<
String
>
THREAD_LOCAL_TNT_TOKEN
=
new
BizThreadLocal
<>();
private
static
final
ThreadLocal
<
String
>
THREAD_LOCAL_TNT_TOKEN
=
new
BizThreadLocal
<>();
private
static
final
ThreadLocal
<
String
>
THREAD_LOCAL_WECHAT_TOKEN
=
new
BizThreadLocal
<>();
private
static
final
ThreadLocal
<
String
>
THREAD_LOCAL_WECHAT_TOKEN
=
new
BizThreadLocal
<>();
private
static
final
ThreadLocal
<
UserLoginVO
>
THREAD_LOCAL_TNT_USER
=
new
BizThreadLocal
<>();
private
static
final
ThreadLocal
<
Saas
UserLoginVO
>
THREAD_LOCAL_TNT_USER
=
new
BizThreadLocal
<>();
private
static
final
ThreadLocal
<
WechatUserInfo
>
THREAD_LOCAL_WECHAT_USER
=
new
BizThreadLocal
<>();
private
static
final
ThreadLocal
<
WechatUserInfo
>
THREAD_LOCAL_WECHAT_USER
=
new
BizThreadLocal
<>();
private
static
final
ThreadLocal
<
SysUserRoleMenuRedisVO
>
THREAD_LOCAL_TNT_USER_ROLE_MENU
=
new
BizThreadLocal
<>();
private
static
final
ThreadLocal
<
SysUserRoleMenuRedisVO
>
THREAD_LOCAL_TNT_USER_ROLE_MENU
=
new
BizThreadLocal
<>();
...
@@ -68,6 +68,11 @@ public class ThreadLocalUserUtil {
...
@@ -68,6 +68,11 @@ public class ThreadLocalUserUtil {
}
}
public
static
SaasUserLoginVO
getSaasUser
(){
SaasUserLoginVO
saasUserDetail
=
TokenUtil
.
getSaasUserDetail
();
return
saasUserDetail
;
}
public
static
WechatUserInfo
getWechatUser
()
{
public
static
WechatUserInfo
getWechatUser
()
{
WechatUserInfo
wechatUserInfo
=
THREAD_LOCAL_WECHAT_USER
.
get
();
WechatUserInfo
wechatUserInfo
=
THREAD_LOCAL_WECHAT_USER
.
get
();
if
(
wechatUserInfo
==
null
)
{
if
(
wechatUserInfo
==
null
)
{
...
...
server-common/src/main/java/com/makeit/utils/user/TokenUtil.java
View file @
b1bbc90d
...
@@ -37,10 +37,10 @@ public class TokenUtil {
...
@@ -37,10 +37,10 @@ public class TokenUtil {
return
getToken
(
RedisConst
.
PLATFORM_TOKEN_PREFIX
,
RequestUtil
.
getHeader
(
HeaderConst
.
PLATFORM_TOKEN
));
return
getToken
(
RedisConst
.
PLATFORM_TOKEN_PREFIX
,
RequestUtil
.
getHeader
(
HeaderConst
.
PLATFORM_TOKEN
));
}
}
public
static
UserLoginVO
getPlatUserDetail
()
{
public
static
Saas
UserLoginVO
getPlatUserDetail
()
{
String
token
=
RequestUtil
.
getHeader
(
HeaderConst
.
PLATFORM_TOKEN
);
String
token
=
RequestUtil
.
getHeader
(
HeaderConst
.
PLATFORM_TOKEN
);
if
(
StringUtils
.
isNotBlank
(
token
))
{
if
(
StringUtils
.
isNotBlank
(
token
))
{
UserLoginVO
userLoginVO
=
RedisUtil
.
get
(
RedisConst
.
PLATFORM_TOKEN_PREFIX
+
token
);
Saas
UserLoginVO
userLoginVO
=
RedisUtil
.
get
(
RedisConst
.
PLATFORM_TOKEN_PREFIX
+
token
);
return
userLoginVO
;
return
userLoginVO
;
}
}
return
null
;
return
null
;
...
@@ -66,9 +66,9 @@ public class TokenUtil {
...
@@ -66,9 +66,9 @@ public class TokenUtil {
RedisTemplateUtil
.
expire
(
prefix
+
token
,
RedisConst
.
PLATFORM_EXPIRE_MINUTES
,
TimeUnit
.
MINUTES
);
RedisTemplateUtil
.
expire
(
prefix
+
token
,
RedisConst
.
PLATFORM_EXPIRE_MINUTES
,
TimeUnit
.
MINUTES
);
}
}
public
static
UserLoginVO
getTntUserDetail
(
String
token
)
{
public
static
Saas
UserLoginVO
getTntUserDetail
(
String
token
)
{
if
(
StringUtils
.
isNotBlank
(
token
))
{
if
(
StringUtils
.
isNotBlank
(
token
))
{
UserLoginVO
userLoginVO
=
RedisTemplateUtil
.
get
(
RedisConst
.
TOKEN_PREFIX
+
token
,
UserLoginVO
.
class
);
SaasUserLoginVO
userLoginVO
=
RedisTemplateUtil
.
get
(
RedisConst
.
TOKEN_PREFIX
+
token
,
Saas
UserLoginVO
.
class
);
return
userLoginVO
;
return
userLoginVO
;
}
}
return
null
;
return
null
;
...
@@ -217,6 +217,15 @@ public class TokenUtil {
...
@@ -217,6 +217,15 @@ public class TokenUtil {
return
null
;
return
null
;
}
}
public
static
SaasUserLoginVO
getSaasUserDetail
()
{
String
token
=
RequestUtil
.
getHeader
(
HeaderConst
.
PLATFORM_TOKEN
);
if
(
StringUtils
.
isNotBlank
(
token
))
{
SaasUserLoginVO
userLoginVO
=
RedisTemplateUtil
.
get
(
RedisConst
.
PLATFORM_TOKEN_PREFIX
+
token
,
SaasUserLoginVO
.
class
);
return
userLoginVO
;
}
return
null
;
}
public
static
void
setMobileCode
(
String
phone
,
String
token
,
Integer
t
,
int
minutes
)
{
public
static
void
setMobileCode
(
String
phone
,
String
token
,
Integer
t
,
int
minutes
)
{
RedisTemplateUtil
.
set
(
RedisConst
.
TOKEN_MOBILE_CODE_PREFIX
+
":"
+
phone
+
":"
+
token
,
t
,
minutes
);
RedisTemplateUtil
.
set
(
RedisConst
.
TOKEN_MOBILE_CODE_PREFIX
+
":"
+
phone
+
":"
+
token
,
t
,
minutes
);
...
...
server-common/src/main/java/com/makeit/utils/user/common/CommonUserUtil.java
View file @
b1bbc90d
...
@@ -3,7 +3,7 @@ package com.makeit.utils.user.common;
...
@@ -3,7 +3,7 @@ package com.makeit.utils.user.common;
import
com.makeit.enums.HeaderConst
;
import
com.makeit.enums.HeaderConst
;
import
com.makeit.utils.user.ThreadLocalUserUtil
;
import
com.makeit.utils.user.ThreadLocalUserUtil
;
import
com.makeit.utils.user.TokenUtil
;
import
com.makeit.utils.user.TokenUtil
;
import
com.makeit.utils.user.UserLoginVO
;
import
com.makeit.utils.user.
Saas
UserLoginVO
;
import
com.makeit.utils.user.tenant.SysUserLoginVO
;
import
com.makeit.utils.user.tenant.SysUserLoginVO
;
import
com.makeit.utils.user.wechat.WechatUserInfo
;
import
com.makeit.utils.user.wechat.WechatUserInfo
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
...
@@ -13,6 +13,7 @@ public class CommonUserUtil {
...
@@ -13,6 +13,7 @@ public class CommonUserUtil {
public
static
CommonUserVO
getUser
()
{
public
static
CommonUserVO
getUser
()
{
SysUserLoginVO
sysUserLoginVO
=
ThreadLocalUserUtil
.
getTntUser
();
SysUserLoginVO
sysUserLoginVO
=
ThreadLocalUserUtil
.
getTntUser
();
if
(
sysUserLoginVO
!=
null
)
{
if
(
sysUserLoginVO
!=
null
)
{
return
new
CommonUserVO
(
sysUserLoginVO
.
getId
(),
sysUserLoginVO
.
getName
());
return
new
CommonUserVO
(
sysUserLoginVO
.
getId
(),
sysUserLoginVO
.
getName
());
...
@@ -23,6 +24,11 @@ public class CommonUserUtil {
...
@@ -23,6 +24,11 @@ public class CommonUserUtil {
return
new
CommonUserVO
(
wechatUserInfo
.
getId
(),
wechatUserInfo
.
getName
());
return
new
CommonUserVO
(
wechatUserInfo
.
getId
(),
wechatUserInfo
.
getName
());
}
}
SaasUserLoginVO
saasUser
=
ThreadLocalUserUtil
.
getSaasUser
();
if
(
saasUser
!=
null
){
return
new
CommonUserVO
(
saasUser
.
getId
(),
saasUser
.
getUsername
());
}
return
null
;
return
null
;
}
}
...
@@ -39,9 +45,9 @@ public class CommonUserUtil {
...
@@ -39,9 +45,9 @@ public class CommonUserUtil {
String
wechatToken
=
httpHeaders
.
getFirst
(
HeaderConst
.
WECHAT_TOKEN
);
String
wechatToken
=
httpHeaders
.
getFirst
(
HeaderConst
.
WECHAT_TOKEN
);
if
(
StringUtils
.
isNotBlank
(
tenantToken
))
{
if
(
StringUtils
.
isNotBlank
(
tenantToken
))
{
UserLoginVO
sysUserLoginVO
=
TokenUtil
.
getTntUserDetail
(
tenantToken
);
Saas
UserLoginVO
sysUserLoginVO
=
TokenUtil
.
getTntUserDetail
(
tenantToken
);
if
(
sysUserLoginVO
!=
null
)
{
if
(
sysUserLoginVO
!=
null
)
{
return
new
CommonUserVO
(
sysUserLoginVO
.
getId
(),
sysUserLoginVO
.
get
N
ame
());
return
new
CommonUserVO
(
sysUserLoginVO
.
getId
(),
sysUserLoginVO
.
get
Usern
ame
());
}
}
}
}
...
...
server-service/src/main/java/com/makeit/service/saas/SaasRoleService.java
View file @
b1bbc90d
package
com
.
makeit
.
service
.
saas
;
package
com
.
makeit
.
service
.
saas
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.makeit.common.dto.StatusDTO
;
import
com.makeit.entity.saas.SaasRole
;
import
com.makeit.entity.saas.SaasRole
;
import
com.makeit.module.admin.saas.SaasRoleDTOVO
;
import
com.makeit.module.admin.saas.PlatRoleMenuDTO
;
import
com.makeit.module.admin.saas.PlatUserRoleDTO
;
import
java.util.List
;
/**
/**
* @author lixl
* @author lixl
...
@@ -10,4 +16,22 @@ import com.makeit.entity.saas.SaasRole;
...
@@ -10,4 +16,22 @@ import com.makeit.entity.saas.SaasRole;
*/
*/
public
interface
SaasRoleService
extends
IService
<
SaasRole
>
{
public
interface
SaasRoleService
extends
IService
<
SaasRole
>
{
List
<
SaasRoleDTOVO
>
list
(
SaasRoleDTOVO
dto
);
void
add
(
SaasRoleDTOVO
dto
);
void
edit
(
SaasRoleDTOVO
dto
);
SaasRoleDTOVO
view
(
String
id
);
void
del
(
String
id
);
void
changeStatus
(
StatusDTO
dto
);
void
assignUserList
(
List
<
PlatUserRoleDTO
>
userRoleDTOList
);
void
removeAssignUserList
(
List
<
PlatUserRoleDTO
>
userRoleDTOList
);
void
assignMenuList
(
PlatRoleMenuDTO
roleMenuDTO
);
}
}
server-service/src/main/java/com/makeit/service/saas/SaasUserService.java
View file @
b1bbc90d
...
@@ -5,10 +5,10 @@ import com.makeit.common.dto.LoginDTO;
...
@@ -5,10 +5,10 @@ import com.makeit.common.dto.LoginDTO;
import
com.makeit.common.dto.StatusDTO
;
import
com.makeit.common.dto.StatusDTO
;
import
com.makeit.common.page.PageReqDTO
;
import
com.makeit.common.page.PageReqDTO
;
import
com.makeit.common.page.PageVO
;
import
com.makeit.common.page.PageVO
;
import
com.makeit.module.admin.saas.
Plat
UserDTOVO
;
import
com.makeit.module.admin.saas.
Saas
UserDTOVO
;
import
com.makeit.module.admin.saas.PlatUserQueryDTO
;
import
com.makeit.module.admin.saas.PlatUserQueryDTO
;
import
com.makeit.entity.saas.SaasUser
;
import
com.makeit.entity.saas.SaasUser
;
import
com.makeit.utils.user.UserLoginVO
;
import
com.makeit.utils.user.
Saas
UserLoginVO
;
import
java.util.List
;
import
java.util.List
;
...
@@ -18,31 +18,31 @@ import java.util.List;
...
@@ -18,31 +18,31 @@ import java.util.List;
* @createDate 2023-08-29 11:14:07
* @createDate 2023-08-29 11:14:07
*/
*/
public
interface
SaasUserService
extends
IService
<
SaasUser
>
{
public
interface
SaasUserService
extends
IService
<
SaasUser
>
{
PageVO
<
Plat
UserDTOVO
>
page
(
PageReqDTO
<
PlatUserQueryDTO
>
page
);
PageVO
<
Saas
UserDTOVO
>
page
(
PageReqDTO
<
PlatUserQueryDTO
>
page
);
PageVO
<
Plat
UserDTOVO
>
pageNoSuperAdmin
(
PageReqDTO
<
PlatUserQueryDTO
>
page
);
PageVO
<
Saas
UserDTOVO
>
pageNoSuperAdmin
(
PageReqDTO
<
PlatUserQueryDTO
>
page
);
List
<
Plat
UserDTOVO
>
list
(
PlatUserQueryDTO
dto
);
List
<
Saas
UserDTOVO
>
list
(
PlatUserQueryDTO
dto
);
List
<
Plat
UserDTOVO
>
listNoSuperAdmin
(
PlatUserQueryDTO
dto
);
List
<
Saas
UserDTOVO
>
listNoSuperAdmin
(
PlatUserQueryDTO
dto
);
void
add
(
Plat
UserDTOVO
dto
);
void
add
(
Saas
UserDTOVO
dto
);
void
edit
(
Plat
UserDTOVO
dto
);
void
edit
(
Saas
UserDTOVO
dto
);
void
changePassword
(
Plat
UserDTOVO
dto
);
void
changePassword
(
Saas
UserDTOVO
dto
);
Plat
UserDTOVO
view
(
String
id
);
Saas
UserDTOVO
view
(
String
id
);
void
del
(
String
id
);
void
del
(
String
id
);
void
changeStatus
(
StatusDTO
dto
);
void
changeStatus
(
StatusDTO
dto
);
UserLoginVO
login
(
LoginDTO
loginDTO
);
Saas
UserLoginVO
login
(
LoginDTO
loginDTO
);
UserLoginVO
getRoleAndMenuList
();
Saas
UserLoginVO
getRoleAndMenuList
();
UserLoginVO
getUserVO
();
Saas
UserLoginVO
getUserVO
();
void
logout
();
void
logout
();
...
...
server-service/src/main/java/com/makeit/service/saas/impl/SaasMenuServiceImpl.java
View file @
b1bbc90d
...
@@ -84,7 +84,7 @@ public class SaasMenuServiceImpl extends ServiceImpl<SaasMenuMapper, SaasMenu> i
...
@@ -84,7 +84,7 @@ public class SaasMenuServiceImpl extends ServiceImpl<SaasMenuMapper, SaasMenu> i
.
in
(
StringUtils
.
isNotBlank
(
dto
.
getRoleId
()),
SaasMenu:
:
getId
,
menuIdList
)
.
in
(
StringUtils
.
isNotBlank
(
dto
.
getRoleId
()),
SaasMenu:
:
getId
,
menuIdList
)
//.orderByAsc(PlatMenu::getParentId)
//.orderByAsc(PlatMenu::getParentId)
.
orderByAsc
(
SaasMenu:
:
getSort
)
.
orderByAsc
(
SaasMenu:
:
getSort
)
.
orderByAsc
(
SaasMenu:
:
getCreate
dAt
)
.
orderByAsc
(
SaasMenu:
:
getCreate
Date
)
);
);
return
BeanDtoVoUtils
.
listVo
(
platMenuList
,
PlatMenuDTOVO
.
class
);
return
BeanDtoVoUtils
.
listVo
(
platMenuList
,
PlatMenuDTOVO
.
class
);
...
@@ -178,7 +178,7 @@ public class SaasMenuServiceImpl extends ServiceImpl<SaasMenuMapper, SaasMenu> i
...
@@ -178,7 +178,7 @@ public class SaasMenuServiceImpl extends ServiceImpl<SaasMenuMapper, SaasMenu> i
List
<
SaasMenu
>
exitList
=
list
(
new
QueryWrapper
<
SaasMenu
>().
lambda
()
List
<
SaasMenu
>
exitList
=
list
(
new
QueryWrapper
<
SaasMenu
>().
lambda
()
.
isNotNull
(
SaasMenu:
:
getCode
)
.
isNotNull
(
SaasMenu:
:
getCode
)
.
in
(
SaasMenu:
:
getCategory
,
SysEnum
.
MenuTypeEnum
.
MENU
.
getValue
(),
SysEnum
.
MenuTypeEnum
.
BUTTON
.
getValue
())
.
in
(
SaasMenu:
:
getCategory
,
SysEnum
.
MenuTypeEnum
.
MENU
.
getValue
(),
SysEnum
.
MenuTypeEnum
.
BUTTON
.
getValue
())
.
orderByDesc
(
SaasMenu:
:
getCreate
dAt
)
.
orderByDesc
(
SaasMenu:
:
getCreate
Date
)
);
);
Map
<
String
,
SaasMenu
>
exitCodeMap
=
StreamUtil
.
toMapDep
(
exitList
,
SaasMenu:
:
getCode
);
Map
<
String
,
SaasMenu
>
exitCodeMap
=
StreamUtil
.
toMapDep
(
exitList
,
SaasMenu:
:
getCode
);
...
...
server-service/src/main/java/com/makeit/service/saas/impl/SaasRoleServiceImpl.java
View file @
b1bbc90d
package
com
.
makeit
.
service
.
saas
.
impl
;
package
com
.
makeit
.
service
.
saas
.
impl
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.makeit.common.dto.StatusDTO
;
import
com.makeit.entity.saas.SaasRole
;
import
com.makeit.entity.saas.SaasRole
;
import
com.makeit.entity.saas.SaasRoleMenu
;
import
com.makeit.entity.saas.SaasUserRole
;
import
com.makeit.enums.CodeMessageEnum
;
import
com.makeit.enums.CommonEnum
;
import
com.makeit.exception.BusinessException
;
import
com.makeit.mapper.saas.SaasRoleMapper
;
import
com.makeit.mapper.saas.SaasRoleMapper
;
import
com.makeit.module.admin.saas.SaasRoleDTOVO
;
import
com.makeit.module.admin.saas.PlatRoleMenuDTO
;
import
com.makeit.module.admin.saas.PlatUserRoleDTO
;
import
com.makeit.service.saas.SaasRoleMenuService
;
import
com.makeit.service.saas.SaasRoleService
;
import
com.makeit.service.saas.SaasRoleService
;
import
com.makeit.service.saas.SaasUserRoleService
;
import
com.makeit.utils.data.convert.BeanDtoVoUtils
;
import
com.makeit.utils.data.convert.StreamUtil
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.Map
;
/**
/**
* @author lixl
* @author lixl
...
@@ -15,4 +36,120 @@ import org.springframework.stereotype.Service;
...
@@ -15,4 +36,120 @@ import org.springframework.stereotype.Service;
public
class
SaasRoleServiceImpl
extends
ServiceImpl
<
SaasRoleMapper
,
SaasRole
>
public
class
SaasRoleServiceImpl
extends
ServiceImpl
<
SaasRoleMapper
,
SaasRole
>
implements
SaasRoleService
{
implements
SaasRoleService
{
@Autowired
private
SaasUserRoleService
saasUserRoleService
;
@Autowired
private
SaasRoleMenuService
saasRoleMenuService
;
@Override
public
List
<
SaasRoleDTOVO
>
list
(
SaasRoleDTOVO
dto
)
{
List
<
SaasRole
>
platRoleList
=
list
(
new
QueryWrapper
<
SaasRole
>().
lambda
()
.
like
(
StringUtils
.
isNotBlank
(
dto
.
getName
()),
SaasRole:
:
getName
,
dto
.
getName
())
.
like
(
StringUtils
.
isNotBlank
(
dto
.
getCode
()),
SaasRole:
:
getCode
,
dto
.
getCode
())
.
and
(
StringUtils
.
isNotBlank
(
dto
.
getKeyword
()),
qw
->
{
qw
.
like
(
StringUtils
.
isNotBlank
(
dto
.
getKeyword
()),
SaasRole:
:
getName
,
dto
.
getKeyword
())
.
or
()
.
like
(
StringUtils
.
isNotBlank
(
dto
.
getKeyword
()),
SaasRole:
:
getCode
,
dto
.
getKeyword
());
})
.
eq
(
StringUtils
.
isNotBlank
(
dto
.
getStatus
()),
SaasRole:
:
getStatus
,
dto
.
getStatus
())
.
orderByDesc
(
SaasRole:
:
getCreateDate
)
);
return
BeanDtoVoUtils
.
listVo
(
platRoleList
,
SaasRoleDTOVO
.
class
);
}
private
void
check
(
SaasRoleDTOVO
dto
)
{
SaasRole
old
=
getOne
(
new
QueryWrapper
<
SaasRole
>().
lambda
()
.
eq
(
SaasRole:
:
getName
,
dto
.
getName
()));
if
(
old
!=
null
&&
!
old
.
getId
().
equals
(
dto
.
getId
()))
{
throw
new
BusinessException
(
CodeMessageEnum
.
SYSTEM_ERROR_NAME_DUPLICATE
);
}
old
=
getOne
(
new
QueryWrapper
<
SaasRole
>().
lambda
()
.
eq
(
SaasRole:
:
getCode
,
dto
.
getCode
()));
if
(
old
!=
null
&&
!
old
.
getId
().
equals
(
dto
.
getId
()))
{
throw
new
BusinessException
(
CodeMessageEnum
.
SYSTEM_ERROR_CODE_DUPLICATE
);
}
}
@Transactional
@Override
public
void
add
(
SaasRoleDTOVO
dto
)
{
check
(
dto
);
save
(
BeanDtoVoUtils
.
convert
(
dto
,
SaasRole
.
class
));
}
@Transactional
@Override
public
void
edit
(
SaasRoleDTOVO
dto
)
{
check
(
dto
);
updateById
(
BeanDtoVoUtils
.
convert
(
dto
,
SaasRole
.
class
));
}
@Override
public
SaasRoleDTOVO
view
(
String
id
)
{
return
BeanDtoVoUtils
.
convert
(
getById
(
id
),
SaasRoleDTOVO
.
class
);
}
@Transactional
@Override
public
void
del
(
String
id
)
{
removeById
(
id
);
}
@Transactional
@Override
public
void
changeStatus
(
StatusDTO
dto
)
{
if
(
Arrays
.
stream
(
CommonEnum
.
values
()).
noneMatch
(
e
->
e
.
getValue
().
equals
(
dto
.
getStatus
())))
{
throw
new
BusinessException
(
CodeMessageEnum
.
SYSTEM_ERROR
);
}
SaasRole
role
=
getById
(
dto
.
getId
());
if
(
role
.
getStatus
().
equals
(
dto
.
getStatus
()))
{
throw
new
BusinessException
(
CodeMessageEnum
.
SYSTEM_ERROR
);
}
role
.
setStatus
(
dto
.
getStatus
());
updateById
(
role
);
}
@Transactional
@Override
public
void
assignUserList
(
List
<
PlatUserRoleDTO
>
userRoleDTOList
)
{
removeAssignUserList
(
userRoleDTOList
);
List
<
SaasUserRole
>
userRoleList
=
BeanDtoVoUtils
.
listVo
(
userRoleDTOList
,
SaasUserRole
.
class
);
saasUserRoleService
.
saveBatch
(
userRoleList
);
}
@Transactional
@Override
public
void
removeAssignUserList
(
List
<
PlatUserRoleDTO
>
userRoleDTOList
)
{
Map
<
String
,
List
<
PlatUserRoleDTO
>>
roleUserMap
=
StreamUtil
.
groupBy
(
userRoleDTOList
,
PlatUserRoleDTO:
:
getRoleId
);
roleUserMap
.
forEach
((
k
,
v
)
->
{
List
<
String
>
userIdList
=
StreamUtil
.
map
(
v
,
PlatUserRoleDTO:
:
getUserId
);
userIdList
.
add
(-
1
+
""
);
saasUserRoleService
.
remove
(
new
QueryWrapper
<
SaasUserRole
>().
lambda
()
.
eq
(
SaasUserRole:
:
getRoleId
,
k
)
.
in
(
SaasUserRole:
:
getUserId
,
userIdList
));
});
}
@Transactional
@Override
public
void
assignMenuList
(
PlatRoleMenuDTO
roleMenuDTO
)
{
//removeAssignMenuList(roleMenuDTOList);
saasRoleMenuService
.
remove
(
new
QueryWrapper
<
SaasRoleMenu
>().
lambda
().
eq
(
SaasRoleMenu:
:
getRoleId
,
roleMenuDTO
.
getRoleId
()));
List
<
SaasRoleMenu
>
roleMenuList
=
StreamUtil
.
map
(
roleMenuDTO
.
getMenuIdList
(),
e
->
{
SaasRoleMenu
platRoleMenu
=
new
SaasRoleMenu
();
platRoleMenu
.
setRoleId
(
roleMenuDTO
.
getRoleId
());
platRoleMenu
.
setMenuId
(
e
);
return
platRoleMenu
;
});
saasRoleMenuService
.
saveBatch
(
roleMenuList
);
}
}
}
server-service/src/main/java/com/makeit/service/saas/impl/SaasUserServiceImpl.java
View file @
b1bbc90d
...
@@ -22,8 +22,8 @@ import com.makeit.enums.id.IdConst;
...
@@ -22,8 +22,8 @@ import com.makeit.enums.id.IdConst;
import
com.makeit.exception.BusinessException
;
import
com.makeit.exception.BusinessException
;
import
com.makeit.mapper.saas.SaasUserMapper
;
import
com.makeit.mapper.saas.SaasUserMapper
;
import
com.makeit.module.admin.saas.PlatMenuDTOVO
;
import
com.makeit.module.admin.saas.PlatMenuDTOVO
;
import
com.makeit.module.admin.saas.
Plat
RoleDTOVO
;
import
com.makeit.module.admin.saas.
Saas
RoleDTOVO
;
import
com.makeit.module.admin.saas.
Plat
UserDTOVO
;
import
com.makeit.module.admin.saas.
Saas
UserDTOVO
;
import
com.makeit.module.admin.saas.PlatUserQueryDTO
;
import
com.makeit.module.admin.saas.PlatUserQueryDTO
;
import
com.makeit.module.admin.saas.SaasUserRoleMenuRedisVO
;
import
com.makeit.module.admin.saas.SaasUserRoleMenuRedisVO
;
import
com.makeit.service.saas.SaasMenuService
;
import
com.makeit.service.saas.SaasMenuService
;
...
@@ -37,7 +37,7 @@ import com.makeit.utils.data.convert.PageUtil;
...
@@ -37,7 +37,7 @@ import com.makeit.utils.data.convert.PageUtil;
import
com.makeit.utils.data.convert.StreamUtil
;
import
com.makeit.utils.data.convert.StreamUtil
;
import
com.makeit.utils.data.id.IdGen
;
import
com.makeit.utils.data.id.IdGen
;
import
com.makeit.utils.user.PasswordUtils
;
import
com.makeit.utils.user.PasswordUtils
;
import
com.makeit.utils.user.UserLoginVO
;
import
com.makeit.utils.user.
Saas
UserLoginVO
;
import
com.makeit.utils.user.PlatUserUtil
;
import
com.makeit.utils.user.PlatUserUtil
;
import
com.makeit.utils.user.PlatUserVO
;
import
com.makeit.utils.user.PlatUserVO
;
import
com.makeit.utils.user.TokenUtil
;
import
com.makeit.utils.user.TokenUtil
;
...
@@ -85,7 +85,7 @@ implements SaasUserService{
...
@@ -85,7 +85,7 @@ implements SaasUserService{
//还是mybatis plus notin 查询
//还是mybatis plus notin 查询
//现在是重复添加中间表 没有效果
//现在是重复添加中间表 没有效果
public
PageVO
<
Plat
UserDTOVO
>
pageInternal
(
PageReqDTO
<
PlatUserQueryDTO
>
page
,
Consumer
<
LambdaQueryWrapper
<
SaasUser
>>
consumer
)
{
public
PageVO
<
Saas
UserDTOVO
>
pageInternal
(
PageReqDTO
<
PlatUserQueryDTO
>
page
,
Consumer
<
LambdaQueryWrapper
<
SaasUser
>>
consumer
)
{
PlatUserQueryDTO
dto
=
page
.
getData
();
PlatUserQueryDTO
dto
=
page
.
getData
();
...
@@ -126,21 +126,21 @@ implements SaasUserService{
...
@@ -126,21 +126,21 @@ implements SaasUserService{
Page
<
SaasUser
>
pageList
=
page
(
p
,
lambdaQueryWrapper
);
Page
<
SaasUser
>
pageList
=
page
(
p
,
lambdaQueryWrapper
);
return
PageUtil
.
toPageVO
(
BeanDtoVoUtils
.
listVo
(
pageList
.
getRecords
(),
Plat
UserDTOVO
.
class
),
pageList
);
return
PageUtil
.
toPageVO
(
BeanDtoVoUtils
.
listVo
(
pageList
.
getRecords
(),
Saas
UserDTOVO
.
class
),
pageList
);
}
}
@Override
@Override
public
PageVO
<
Plat
UserDTOVO
>
page
(
PageReqDTO
<
PlatUserQueryDTO
>
page
)
{
public
PageVO
<
Saas
UserDTOVO
>
page
(
PageReqDTO
<
PlatUserQueryDTO
>
page
)
{
return
pageInternal
(
page
,
null
);
return
pageInternal
(
page
,
null
);
}
}
@Override
@Override
public
PageVO
<
Plat
UserDTOVO
>
pageNoSuperAdmin
(
PageReqDTO
<
PlatUserQueryDTO
>
page
)
{
public
PageVO
<
Saas
UserDTOVO
>
pageNoSuperAdmin
(
PageReqDTO
<
PlatUserQueryDTO
>
page
)
{
return
pageInternal
(
page
,
qw
->
qw
.
ne
(
SaasUser:
:
getId
,
IdConst
.
SUPER_ADMIN_ID
));
return
pageInternal
(
page
,
qw
->
qw
.
ne
(
SaasUser:
:
getId
,
IdConst
.
SUPER_ADMIN_ID
));
}
}
@Override
@Override
public
List
<
Plat
UserDTOVO
>
list
(
PlatUserQueryDTO
dto
)
{
public
List
<
Saas
UserDTOVO
>
list
(
PlatUserQueryDTO
dto
)
{
PageReqDTO
<
PlatUserQueryDTO
>
page
=
new
PageReqDTO
<>();
PageReqDTO
<
PlatUserQueryDTO
>
page
=
new
PageReqDTO
<>();
page
.
setPage
(
1
);
page
.
setPage
(
1
);
page
.
setLimit
(-
1
);
page
.
setLimit
(-
1
);
...
@@ -149,7 +149,7 @@ implements SaasUserService{
...
@@ -149,7 +149,7 @@ implements SaasUserService{
}
}
@Override
@Override
public
List
<
Plat
UserDTOVO
>
listNoSuperAdmin
(
PlatUserQueryDTO
dto
)
{
public
List
<
Saas
UserDTOVO
>
listNoSuperAdmin
(
PlatUserQueryDTO
dto
)
{
PageReqDTO
<
PlatUserQueryDTO
>
page
=
new
PageReqDTO
<>();
PageReqDTO
<
PlatUserQueryDTO
>
page
=
new
PageReqDTO
<>();
page
.
setPage
(
1
);
page
.
setPage
(
1
);
page
.
setLimit
(-
1
);
page
.
setLimit
(-
1
);
...
@@ -157,7 +157,7 @@ implements SaasUserService{
...
@@ -157,7 +157,7 @@ implements SaasUserService{
return
pageInternal
(
page
,
qw
->
qw
.
ne
(
SaasUser:
:
getId
,
IdConst
.
SUPER_ADMIN_ID
)).
getList
();
return
pageInternal
(
page
,
qw
->
qw
.
ne
(
SaasUser:
:
getId
,
IdConst
.
SUPER_ADMIN_ID
)).
getList
();
}
}
private
void
check
(
Plat
UserDTOVO
dto
)
{
private
void
check
(
Saas
UserDTOVO
dto
)
{
List
<
SaasUser
>
userList
=
list
(
List
<
SaasUser
>
userList
=
list
(
new
QueryWrapper
<
SaasUser
>().
lambda
()
new
QueryWrapper
<
SaasUser
>().
lambda
()
.
eq
(
SaasUser:
:
getAccount
,
dto
.
getAccount
())
.
eq
(
SaasUser:
:
getAccount
,
dto
.
getAccount
())
...
@@ -182,7 +182,7 @@ implements SaasUserService{
...
@@ -182,7 +182,7 @@ implements SaasUserService{
}
}
private
void
setRoleList
(
Plat
UserDTOVO
dto
)
{
private
void
setRoleList
(
Saas
UserDTOVO
dto
)
{
saasUserRoleService
.
remove
(
new
QueryWrapper
<
SaasUserRole
>().
lambda
()
saasUserRoleService
.
remove
(
new
QueryWrapper
<
SaasUserRole
>().
lambda
()
.
eq
(
SaasUserRole:
:
getUserId
,
dto
.
getId
()));
.
eq
(
SaasUserRole:
:
getUserId
,
dto
.
getId
()));
if
(
dto
.
getRoleList
()
!=
null
)
{
if
(
dto
.
getRoleList
()
!=
null
)
{
...
@@ -198,7 +198,7 @@ implements SaasUserService{
...
@@ -198,7 +198,7 @@ implements SaasUserService{
}
}
}
}
private
void
getRoleList
(
Plat
UserDTOVO
userVO
)
{
private
void
getRoleList
(
Saas
UserDTOVO
userVO
)
{
List
<
SaasUserRole
>
userRoleList
=
saasUserRoleService
.
list
(
new
QueryWrapper
<
SaasUserRole
>().
lambda
()
List
<
SaasUserRole
>
userRoleList
=
saasUserRoleService
.
list
(
new
QueryWrapper
<
SaasUserRole
>().
lambda
()
.
eq
(
SaasUserRole:
:
getUserId
,
userVO
.
getId
())
.
eq
(
SaasUserRole:
:
getUserId
,
userVO
.
getId
())
.
orderByAsc
(
SaasUserRole:
:
getId
)
.
orderByAsc
(
SaasUserRole:
:
getId
)
...
@@ -217,7 +217,7 @@ implements SaasUserService{
...
@@ -217,7 +217,7 @@ implements SaasUserService{
newList
.
add
(
role
);
newList
.
add
(
role
);
}
}
});
});
userVO
.
setRoleList
(
BeanDtoVoUtils
.
listVo
(
new
ArrayList
<>(
newList
),
Plat
RoleDTOVO
.
class
));
userVO
.
setRoleList
(
BeanDtoVoUtils
.
listVo
(
new
ArrayList
<>(
newList
),
Saas
RoleDTOVO
.
class
));
}
}
private
void
setPassword
(
SaasUser
user
)
{
private
void
setPassword
(
SaasUser
user
)
{
...
@@ -229,7 +229,7 @@ implements SaasUserService{
...
@@ -229,7 +229,7 @@ implements SaasUserService{
@Transactional
@Transactional
@Override
@Override
public
void
add
(
Plat
UserDTOVO
dto
)
{
public
void
add
(
Saas
UserDTOVO
dto
)
{
check
(
dto
);
check
(
dto
);
SaasUser
user
=
BeanDtoVoUtils
.
convert
(
dto
,
SaasUser
.
class
);
SaasUser
user
=
BeanDtoVoUtils
.
convert
(
dto
,
SaasUser
.
class
);
...
@@ -245,7 +245,7 @@ implements SaasUserService{
...
@@ -245,7 +245,7 @@ implements SaasUserService{
@Transactional
@Transactional
@Override
@Override
public
void
edit
(
Plat
UserDTOVO
dto
)
{
public
void
edit
(
Saas
UserDTOVO
dto
)
{
dto
.
setAccount
(
null
);
dto
.
setAccount
(
null
);
superCantEdit
(
dto
);
superCantEdit
(
dto
);
check
(
dto
);
check
(
dto
);
...
@@ -260,7 +260,7 @@ implements SaasUserService{
...
@@ -260,7 +260,7 @@ implements SaasUserService{
@Transactional
@Transactional
@Override
@Override
public
void
changePassword
(
Plat
UserDTOVO
dto
)
{
public
void
changePassword
(
Saas
UserDTOVO
dto
)
{
SaasUser
user
=
getById
(
dto
.
getId
());
SaasUser
user
=
getById
(
dto
.
getId
());
user
.
setPassword
(
dto
.
getPassword
());
user
.
setPassword
(
dto
.
getPassword
());
setPassword
(
user
);
setPassword
(
user
);
...
@@ -268,8 +268,8 @@ implements SaasUserService{
...
@@ -268,8 +268,8 @@ implements SaasUserService{
}
}
@Override
@Override
public
Plat
UserDTOVO
view
(
String
id
)
{
public
Saas
UserDTOVO
view
(
String
id
)
{
PlatUserDTOVO
userVO
=
BeanDtoVoUtils
.
convert
(
getById
(
id
),
Plat
UserDTOVO
.
class
);
SaasUserDTOVO
userVO
=
BeanDtoVoUtils
.
convert
(
getById
(
id
),
Saas
UserDTOVO
.
class
);
getRoleList
(
userVO
);
getRoleList
(
userVO
);
return
userVO
;
return
userVO
;
}
}
...
@@ -307,7 +307,7 @@ implements SaasUserService{
...
@@ -307,7 +307,7 @@ implements SaasUserService{
}
}
}
}
private
void
superCantEdit
(
Plat
UserDTOVO
dto
)
{
private
void
superCantEdit
(
Saas
UserDTOVO
dto
)
{
if
(
IdConst
.
SUPER_ADMIN_ID
.
equals
(
dto
.
getId
()))
{
if
(
IdConst
.
SUPER_ADMIN_ID
.
equals
(
dto
.
getId
()))
{
if
(
dto
.
getRoleList
()
!=
null
&&
!
dto
.
getRoleList
().
isEmpty
())
{
if
(
dto
.
getRoleList
()
!=
null
&&
!
dto
.
getRoleList
().
isEmpty
())
{
...
@@ -325,7 +325,7 @@ implements SaasUserService{
...
@@ -325,7 +325,7 @@ implements SaasUserService{
}
}
}
}
private
void
fillMenuList
(
List
<
SaasMenu
>
menuList
,
UserLoginVO
userLoginVO
)
{
private
void
fillMenuList
(
List
<
SaasMenu
>
menuList
,
Saas
UserLoginVO
userLoginVO
)
{
List
<
SaasMenu
>
buttonList
=
StreamUtil
.
filter
(
menuList
,
e
->
SysEnum
.
MenuTypeEnum
.
MENU
.
getValue
().
equals
(
e
.
getCategory
())
||
SysEnum
.
MenuTypeEnum
.
BUTTON
.
getValue
().
equals
(
e
.
getCategory
()));
List
<
SaasMenu
>
buttonList
=
StreamUtil
.
filter
(
menuList
,
e
->
SysEnum
.
MenuTypeEnum
.
MENU
.
getValue
().
equals
(
e
.
getCategory
())
||
SysEnum
.
MenuTypeEnum
.
BUTTON
.
getValue
().
equals
(
e
.
getCategory
()));
List
<
SaasMenu
>
nonButtonList
=
StreamUtil
.
filter
(
menuList
,
e
->
SysEnum
.
MenuTypeEnum
.
CATALOGUE
.
getValue
().
equals
(
e
.
getCategory
())
||
SysEnum
.
MenuTypeEnum
.
MENU
.
getValue
().
equals
(
e
.
getCategory
()));
List
<
SaasMenu
>
nonButtonList
=
StreamUtil
.
filter
(
menuList
,
e
->
SysEnum
.
MenuTypeEnum
.
CATALOGUE
.
getValue
().
equals
(
e
.
getCategory
())
||
SysEnum
.
MenuTypeEnum
.
MENU
.
getValue
().
equals
(
e
.
getCategory
()));
List
<
PlatMenuDTOVO
>
menuVOList
=
saasMenuService
.
tree
(
BeanDtoVoUtils
.
listVo
(
nonButtonList
,
PlatMenuDTOVO
.
class
));
List
<
PlatMenuDTOVO
>
menuVOList
=
saasMenuService
.
tree
(
BeanDtoVoUtils
.
listVo
(
nonButtonList
,
PlatMenuDTOVO
.
class
));
...
@@ -334,7 +334,7 @@ implements SaasUserService{
...
@@ -334,7 +334,7 @@ implements SaasUserService{
userLoginVO
.
setMenuList
(
menuVOList
);
userLoginVO
.
setMenuList
(
menuVOList
);
}
}
private
void
supperRoleMenuList
(
UserLoginVO
userLoginVO
)
{
private
void
supperRoleMenuList
(
Saas
UserLoginVO
userLoginVO
)
{
List
<
SaasMenu
>
menuList
=
saasMenuService
.
list
(
new
QueryWrapper
<
SaasMenu
>().
lambda
()
List
<
SaasMenu
>
menuList
=
saasMenuService
.
list
(
new
QueryWrapper
<
SaasMenu
>().
lambda
()
.
eq
(
SaasMenu:
:
getStatus
,
CommonEnum
.
YES
.
getValue
())
.
eq
(
SaasMenu:
:
getStatus
,
CommonEnum
.
YES
.
getValue
())
...
@@ -343,11 +343,11 @@ implements SaasUserService{
...
@@ -343,11 +343,11 @@ implements SaasUserService{
fillMenuList
(
menuList
,
userLoginVO
);
fillMenuList
(
menuList
,
userLoginVO
);
}
}
private
void
setRoleMenuToRedis
(
UserLoginVO
userLoginVO
)
{
private
void
setRoleMenuToRedis
(
Saas
UserLoginVO
userLoginVO
)
{
SaasUserRoleMenuRedisVO
platUserRoleMenuRedisVO
=
new
SaasUserRoleMenuRedisVO
();
SaasUserRoleMenuRedisVO
platUserRoleMenuRedisVO
=
new
SaasUserRoleMenuRedisVO
();
platUserRoleMenuRedisVO
.
setId
(
userLoginVO
.
getId
());
platUserRoleMenuRedisVO
.
setId
(
userLoginVO
.
getId
());
if
(
userLoginVO
.
getRoleList
()
!=
null
)
{
if
(
userLoginVO
.
getRoleList
()
!=
null
)
{
platUserRoleMenuRedisVO
.
setRoleCodeList
(
StreamUtil
.
map
(
userLoginVO
.
getRoleList
(),
Plat
RoleDTOVO:
:
getCode
));
platUserRoleMenuRedisVO
.
setRoleCodeList
(
StreamUtil
.
map
(
userLoginVO
.
getRoleList
(),
Saas
RoleDTOVO:
:
getCode
));
}
}
if
(
userLoginVO
.
getButtonList
()
!=
null
)
{
if
(
userLoginVO
.
getButtonList
()
!=
null
)
{
platUserRoleMenuRedisVO
.
setButtonCodeList
(
StreamUtil
.
map
(
userLoginVO
.
getButtonList
(),
PlatMenuDTOVO:
:
getCode
));
platUserRoleMenuRedisVO
.
setButtonCodeList
(
StreamUtil
.
map
(
userLoginVO
.
getButtonList
(),
PlatMenuDTOVO:
:
getCode
));
...
@@ -356,7 +356,7 @@ implements SaasUserService{
...
@@ -356,7 +356,7 @@ implements SaasUserService{
}
}
private
UserLoginVO
getRoleAndMenuList
(
UserLoginVO
userLoginVO
)
{
private
SaasUserLoginVO
getRoleAndMenuList
(
Saas
UserLoginVO
userLoginVO
)
{
//TODO 用join做
//TODO 用join做
//TODO 只返回必要字段 菜单和角色
//TODO 只返回必要字段 菜单和角色
...
@@ -390,7 +390,7 @@ implements SaasUserService{
...
@@ -390,7 +390,7 @@ implements SaasUserService{
);
);
userLoginVO
.
setRoleList
(
BeanDtoVoUtils
.
listVo
(
roleList
,
Plat
RoleDTOVO
.
class
));
userLoginVO
.
setRoleList
(
BeanDtoVoUtils
.
listVo
(
roleList
,
Saas
RoleDTOVO
.
class
));
fillMenuList
(
menuList
,
userLoginVO
);
fillMenuList
(
menuList
,
userLoginVO
);
...
@@ -400,9 +400,9 @@ implements SaasUserService{
...
@@ -400,9 +400,9 @@ implements SaasUserService{
}
}
@Override
@Override
public
UserLoginVO
getRoleAndMenuList
()
{
public
Saas
UserLoginVO
getRoleAndMenuList
()
{
PlatUserVO
platUser
=
PlatUserUtil
.
getUserVO
();
PlatUserVO
platUser
=
PlatUserUtil
.
getUserVO
();
UserLoginVO
platUserLoginVO
=
new
UserLoginVO
();
SaasUserLoginVO
platUserLoginVO
=
new
Saas
UserLoginVO
();
platUserLoginVO
.
setId
(
platUser
.
getId
());
platUserLoginVO
.
setId
(
platUser
.
getId
());
getRoleAndMenuList
(
platUserLoginVO
);
getRoleAndMenuList
(
platUserLoginVO
);
return
platUserLoginVO
;
return
platUserLoginVO
;
...
@@ -410,12 +410,12 @@ implements SaasUserService{
...
@@ -410,12 +410,12 @@ implements SaasUserService{
@Override
@Override
public
UserLoginVO
getUserVO
()
{
public
Saas
UserLoginVO
getUserVO
()
{
return
PlatUserUtil
.
getUserVODetail
();
return
PlatUserUtil
.
getUserVODetail
();
}
}
@Override
@Override
public
UserLoginVO
login
(
LoginDTO
loginDTO
)
{
public
Saas
UserLoginVO
login
(
LoginDTO
loginDTO
)
{
if
(
StringUtils
.
isBlank
(
loginDTO
.
getAccount
()))
{
if
(
StringUtils
.
isBlank
(
loginDTO
.
getAccount
()))
{
throw
new
BusinessException
(
CodeMessageEnum
.
SYSTEM_ERROR
);
throw
new
BusinessException
(
CodeMessageEnum
.
SYSTEM_ERROR
);
}
}
...
@@ -439,7 +439,7 @@ implements SaasUserService{
...
@@ -439,7 +439,7 @@ implements SaasUserService{
throw
new
BusinessException
(
CodeMessageEnum
.
SYSTEM_ERROR_AUTH_USER_PASSWORD
);
throw
new
BusinessException
(
CodeMessageEnum
.
SYSTEM_ERROR_AUTH_USER_PASSWORD
);
}
}
UserLoginVO
userLoginVO
=
BeanDtoVoUtils
.
convert
(
platUser
,
UserLoginVO
.
class
);
SaasUserLoginVO
userLoginVO
=
BeanDtoVoUtils
.
convert
(
platUser
,
Saas
UserLoginVO
.
class
);
String
token
=
IdGen
.
getUUID
();
String
token
=
IdGen
.
getUUID
();
userLoginVO
.
setToken
(
token
);
userLoginVO
.
setToken
(
token
);
...
...
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