Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sample-form-platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
sample-form-platform
Commits
597cce4f
Commit
597cce4f
authored
Nov 14, 2023
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改部分权限
parent
694557ea
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
153 additions
and
195 deletions
+153
-195
sample-form-manager/src/main/java/com/mortals/xhx/base/system/resource/web/ResourceController.java
...tals/xhx/base/system/resource/web/ResourceController.java
+16
-30
sample-form-manager/src/main/java/com/mortals/xhx/base/system/role/web/RoleAuthController.java
.../mortals/xhx/base/system/role/web/RoleAuthController.java
+34
-44
sample-form-manager/src/main/java/com/mortals/xhx/base/system/role/web/RoleController.java
.../com/mortals/xhx/base/system/role/web/RoleController.java
+22
-29
sample-form-manager/src/main/java/com/mortals/xhx/base/system/role/web/RoleUserController.java
.../mortals/xhx/base/system/role/web/RoleUserController.java
+81
-92
No files found.
sample-form-manager/src/main/java/com/mortals/xhx/base/system/resource/web/ResourceController.java
View file @
597cce4f
/**
* 文件:ResourceController.java
* 版本:1.0.0
* 日期:
* Copyright ®
* All right reserved.
*/
package
com.mortals.xhx.base.system.resource.web
;
package
com.mortals.xhx.base.system.resource.web
;
import
java.util.HashMap
;
import
com.alibaba.fastjson.JSONObject
;
import
java.util.Map
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
com.mortals.framework.common.IBaseEnum
;
import
com.mortals.framework.common.IBaseEnum
;
import
com.mortals.framework.common.code.UserType
;
import
com.mortals.framework.common.code.UserType
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.alibaba.fastjson.JSONObject
;
import
com.mortals.framework.model.Context
;
import
com.mortals.framework.model.Context
;
import
com.mortals.framework.web.BaseCRUDJsonMappingController
;
import
com.mortals.framework.web.BaseCRUDJson
Body
MappingController
;
import
com.mortals.xhx.base.system.resource.model.ResourceEntity
;
import
com.mortals.xhx.base.system.resource.model.ResourceEntity
;
import
com.mortals.xhx.base.system.resource.service.ResourceService
;
import
com.mortals.xhx.base.system.resource.service.ResourceService
;
import
com.mortals.xhx.common.code.AuthType
;
import
com.mortals.xhx.common.code.AuthType
;
import
com.mortals.xhx.common.code.SourceType
;
import
com.mortals.xhx.common.code.SourceType
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.HashMap
;
import
java.util.Map
;
/**
/**
* <p>Title: 资源信息</p>
* 资源信息
* <p>Description: ResourceController </p>
*
* <p>Copyright: Copyright ® </p>
* @author: zxfei
* <p>Company: </p>
* @date: 2022/5/7 15:27
* @author
* @version 1.0.0
*/
*/
@Slf4j
@RestController
@RestController
@RequestMapping
(
"resource"
)
@RequestMapping
(
"resource"
)
public
class
ResourceController
extends
BaseCRUDJson
MappingController
<
ResourceService
,
ResourceForm
,
ResourceEntity
,
Long
>
{
public
class
ResourceController
extends
BaseCRUDJson
BodyMappingController
<
ResourceService
,
ResourceEntity
,
Long
>
{
public
ResourceController
(){
public
ResourceController
(){
super
.
setFormClass
(
ResourceForm
.
class
);
super
.
setModuleDesc
(
"资源信息"
);
super
.
setModuleDesc
(
"资源信息"
);
}
}
@Override
@Override
protected
void
init
(
HttpServletRequest
request
,
HttpServletResponse
response
,
ResourceForm
form
,
protected
void
init
(
Map
<
String
,
Object
>
model
,
Context
context
)
{
Map
<
String
,
Object
>
model
,
Context
context
)
{
Map
<
String
,
Object
>
statsus
=
new
HashMap
<
String
,
Object
>();
Map
<
String
,
Object
>
statsus
=
new
HashMap
<
String
,
Object
>();
statsus
.
put
(
"authType"
,
AuthType
.
getEnumMap
());
statsus
.
put
(
"authType"
,
AuthType
.
getEnumMap
());
statsus
.
put
(
"sourceType"
,
SourceType
.
getEnumMap
());
statsus
.
put
(
"sourceType"
,
SourceType
.
getEnumMap
());
...
@@ -57,7 +44,6 @@ public class ResourceController extends BaseCRUDJsonMappingController<ResourceSe
...
@@ -57,7 +44,6 @@ public class ResourceController extends BaseCRUDJsonMappingController<ResourceSe
statsus
.
put
(
"userType"
,
UserType
.
findByValue
(
getCurUser
().
getUserType
()));
statsus
.
put
(
"userType"
,
UserType
.
findByValue
(
getCurUser
().
getUserType
()));
}
}
model
.
put
(
KEY_RESULT_DICT
,
statsus
);
model
.
put
(
KEY_RESULT_DICT
,
statsus
);
super
.
init
(
request
,
response
,
form
,
model
,
context
);
}
}
/**
/**
...
...
sample-form-manager/src/main/java/com/mortals/xhx/base/system/role/web/RoleAuthController.java
View file @
597cce4f
/**
* 文件:RoleAuthController.java
* 版本:1.0.0
* 日期:
* Copyright ®
* All right reserved.
*/
package
com.mortals.xhx.base.system.role.web
;
package
com.mortals.xhx.base.system.role.web
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.mortals.framework.web.BaseCRUDJsonBodyMappingController
;
import
com.mortals.xhx.base.system.role.model.RoleAuthEntity
;
import
com.mortals.xhx.base.system.role.model.RoleAuthQuery
;
import
com.mortals.xhx.base.system.role.service.RoleAuthService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.web.bind.annotation.PostMapping
;
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.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.mortals.framework.web.BaseCRUDJsonMappingController
;
import
com.mortals.xhx.base.system.role.model.RoleAuthEntity
;
import
com.mortals.xhx.base.system.role.service.RoleAuthService
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
/**
/**
* <p>Title: 角色资源权限</p>
* 角色资源权限
* <p>Description: RoleAuthController </p>
*
* <p>Copyright: Copyright ® </p>
* @author: zxfei
* <p>Company: </p>
* @date: 2022/5/7 15:19
* @author
* @version 1.0.0
*/
*/
@Slf4j
@RestController
@RestController
@RequestMapping
(
"role/auth"
)
@RequestMapping
(
"role/auth"
)
public
class
RoleAuthController
extends
BaseCRUDJsonMappingController
<
RoleAuthService
,
RoleAuthForm
,
RoleAuthEntity
,
Long
>
{
public
class
RoleAuthController
extends
BaseCRUDJsonBodyMappingController
<
RoleAuthService
,
RoleAuthEntity
,
Long
>
{
public
RoleAuthController
()
{
super
.
setModuleDesc
(
"角色资源权限"
);
}
public
RoleAuthController
(){
/**
super
.
setFormClass
(
RoleAuthForm
.
class
);
* 分配资源
super
.
setModuleDesc
(
"角色资源权限"
);
*/
}
@PostMapping
(
value
=
"distributionSource"
)
public
String
distributionUser
(
@RequestBody
RoleAuthQuery
query
)
{
try
{
service
.
doDistributionSource
(
query
);
JSONObject
ret
=
new
JSONObject
();
ret
.
put
(
KEY_RESULT_CODE
,
VALUE_RESULT_SUCCESS
);
return
ret
.
toJSONString
();
}
catch
(
Exception
e
)
{
log
.
error
(
"分配角色资源错误"
,
e
);
JSONObject
ret
=
new
JSONObject
();
ret
.
put
(
KEY_RESULT_CODE
,
VALUE_RESULT_FAILURE
);
ret
.
put
(
KEY_RESULT_MSG
,
super
.
convertException
(
e
));
return
ret
.
toJSONString
();
}
}
/**
* 分配资源
*/
@PostMapping
(
value
=
"distributionSource"
)
public
String
distributionUser
(
HttpServletRequest
request
,
HttpServletResponse
response
,
RoleAuthForm
form
)
{
try
{
service
.
doDistributionSource
(
form
.
getQuery
());
JSONObject
ret
=
new
JSONObject
();
ret
.
put
(
KEY_RESULT_CODE
,
VALUE_RESULT_SUCCESS
);
return
ret
.
toJSONString
();
}
catch
(
Exception
e
)
{
log
.
error
(
"分配角色资源错误"
,
e
);
JSONObject
ret
=
new
JSONObject
();
ret
.
put
(
KEY_RESULT_CODE
,
VALUE_RESULT_FAILURE
);
ret
.
put
(
KEY_RESULT_MSG
,
super
.
convertException
(
e
));
return
ret
.
toJSONString
();
}
}
}
}
\ No newline at end of file
sample-form-manager/src/main/java/com/mortals/xhx/base/system/role/web/RoleController.java
View file @
597cce4f
/**
* 文件:RoleController.java
* 版本:1.0.0
* 日期:
* Copyright ®
* All right reserved.
*/
package
com.mortals.xhx.base.system.role.web
;
package
com.mortals.xhx.base.system.role.web
;
...
@@ -12,34 +5,28 @@ import com.alibaba.fastjson.JSONObject;
...
@@ -12,34 +5,28 @@ import com.alibaba.fastjson.JSONObject;
import
com.mortals.framework.common.IBaseEnum
;
import
com.mortals.framework.common.IBaseEnum
;
import
com.mortals.framework.common.code.UserType
;
import
com.mortals.framework.common.code.UserType
;
import
com.mortals.framework.model.Context
;
import
com.mortals.framework.model.Context
;
import
com.mortals.framework.web.BaseCRUDJsonBodyMappingController
;
import
com.mortals.framework.web.BaseCRUDJsonBodyMappingController
;
import
org.springframework.beans.factory.annotation.Autowired
;
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
com.mortals.framework.web.BaseCRUDJsonMappingController
;
import
com.mortals.xhx.base.system.role.model.RoleEntity
;
import
com.mortals.xhx.base.system.role.model.RoleEntity
;
import
com.mortals.xhx.base.system.role.model.RoleUserEntity
;
import
com.mortals.xhx.base.system.role.model.RoleUserEntity
;
import
com.mortals.xhx.base.system.role.service.RoleService
;
import
com.mortals.xhx.base.system.role.service.RoleService
;
import
com.mortals.xhx.base.system.role.service.RoleUserService
;
import
com.mortals.xhx.base.system.role.service.RoleUserService
;
import
com.mortals.xhx.common.code.RoleType
;
import
com.mortals.xhx.common.code.RoleType
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
/**
/**
* <p>Title: 角色信息</p>
* 角色信息
* <p>Description: RoleController </p>
*
* <p>Copyright: Copyright ® </p>
* @author: zxfei
* <p>Company: </p>
* @date: 2022/5/7 15:15
* @author
* @version 1.0.0
*/
*/
@RestController
@RestController
@RequestMapping
(
"role"
)
@RequestMapping
(
"role"
)
...
@@ -49,23 +36,29 @@ public class RoleController extends BaseCRUDJsonBodyMappingController<RoleServic
...
@@ -49,23 +36,29 @@ public class RoleController extends BaseCRUDJsonBodyMappingController<RoleServic
private
RoleUserService
roleUserService
;
private
RoleUserService
roleUserService
;
public
RoleController
(){
public
RoleController
(){
super
.
setFormClass
(
RoleForm
.
class
);
super
.
setModuleDesc
(
"角色信息"
);
super
.
setModuleDesc
(
"角色信息"
);
}
}
@Override
@Override
protected
void
init
(
Map
<
String
,
Object
>
model
,
Context
context
)
{
protected
void
init
(
Map
<
String
,
Object
>
model
,
Context
context
)
{
this
.
addDict
(
model
,
"userType"
,
IBaseEnum
.
getEnumMap
(
UserType
.
class
));
Map
<
String
,
Object
>
status
=
new
HashMap
<>();
this
.
addDict
(
model
,
"roleType"
,
RoleType
.
getEnumMap
());
status
.
put
(
"userType"
,
IBaseEnum
.
getEnumMap
(
UserType
.
class
));
super
.
init
(
model
,
context
);
status
.
put
(
"roleType"
,
RoleType
.
getEnumMap
());
model
.
put
(
KEY_RESULT_DICT
,
status
);
}
}
/**
* 根据用户id获取角色名称
* @param userId
* @return
*/
@PostMapping
(
"roleNameByUserId"
)
@PostMapping
(
"roleNameByUserId"
)
public
String
getRoleNameByUserId
(
@Request
Body
RoleUserEntity
query
)
{
public
String
getRoleNameByUserId
(
@Request
Param
(
value
=
"userId"
)
Long
userId
)
{
try
{
try
{
JSONObject
ret
=
new
JSONObject
();
JSONObject
ret
=
new
JSONObject
();
RoleUserEntity
roleUserEntity
=
new
RoleUserEntity
();
RoleUserEntity
roleUserEntity
=
new
RoleUserEntity
();
roleUserEntity
.
setUserId
(
query
.
getUserId
()
);
roleUserEntity
.
setUserId
(
userId
);
List
<
RoleUserEntity
>
find
=
roleUserService
.
find
(
roleUserEntity
,
new
Context
());
List
<
RoleUserEntity
>
find
=
roleUserService
.
find
(
roleUserEntity
,
new
Context
());
List
<
RoleEntity
>
model
=
new
ArrayList
<>();
List
<
RoleEntity
>
model
=
new
ArrayList
<>();
if
(
find
.
size
()
>
0
){
if
(
find
.
size
()
>
0
){
...
...
sample-form-manager/src/main/java/com/mortals/xhx/base/system/role/web/RoleUserController.java
View file @
597cce4f
/**
* 文件:RoleUserController.java
* 版本:1.0.0
* 日期:
* Copyright ®
* All right reserved.
*/
package
com.mortals.xhx.base.system.role.web
;
package
com.mortals.xhx.base.system.role.web
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
...
@@ -14,23 +7,22 @@ import com.mortals.framework.ap.SysConstains;
...
@@ -14,23 +7,22 @@ import com.mortals.framework.ap.SysConstains;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.model.BaseEntityLong
;
import
com.mortals.framework.model.BaseEntityLong
;
import
com.mortals.framework.model.Context
;
import
com.mortals.framework.model.Context
;
import
com.mortals.framework.web.BaseCRUDJsonBodyMappingController
;
import
org.apache.commons.beanutils.MethodUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.mortals.framework.web.BaseCRUDJsonMappingController
;
import
com.mortals.xhx.base.system.role.model.RoleEntity
;
import
com.mortals.xhx.base.system.role.model.RoleEntity
;
import
com.mortals.xhx.base.system.role.model.RoleUserEntity
;
import
com.mortals.xhx.base.system.role.model.RoleUserEntity
;
import
com.mortals.xhx.base.system.role.model.RoleUserQuery
;
import
com.mortals.xhx.base.system.role.service.RoleService
;
import
com.mortals.xhx.base.system.role.service.RoleService
;
import
com.mortals.xhx.base.system.role.service.RoleUserService
;
import
com.mortals.xhx.base.system.role.service.RoleUserService
;
import
com.mortals.xhx.base.system.user.model.UserEntity
;
import
com.mortals.xhx.base.system.user.model.UserEntity
;
import
com.mortals.xhx.base.system.user.model.UserQuery
;
import
com.mortals.xhx.base.system.user.model.UserQuery
;
import
com.mortals.xhx.base.system.user.service.UserService
;
import
com.mortals.xhx.base.system.user.service.UserService
;
import
org.apache.commons.beanutils.MethodUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
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
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -38,29 +30,49 @@ import java.util.Set;
...
@@ -38,29 +30,49 @@ import java.util.Set;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
/**
/**
* <p>Title: 角色用户</p>
* 角色用户
* <p>Description: RoleUserController </p>
*
* <p>Copyright: Copyright ® </p>
* @author: zxfei
* <p>Company: </p>
* @date: 2022/5/7 15:15
* @author
* @version 1.0.0
*/
*/
@RestController
@RestController
@RequestMapping
(
"role/user"
)
@RequestMapping
(
"role/user"
)
public
class
RoleUserController
extends
BaseCRUDJsonMappingController
<
RoleUserService
,
RoleUserForm
,
RoleUserEntity
,
Long
>
{
public
class
RoleUserController
extends
BaseCRUDJsonBodyMappingController
<
RoleUserService
,
RoleUserEntity
,
Long
>
{
@Autowired
private
RoleService
roleService
;
@Autowired
private
UserService
userService
;
public
RoleUserController
()
{
super
.
setModuleDesc
(
"角色用户"
);
}
@Autowired
@Override
private
RoleService
roleService
;
protected
void
init
(
Map
<
String
,
Object
>
model
,
Context
context
)
{
@Autowired
Map
<
String
,
Object
>
status
=
new
HashMap
<>(
3
);
private
UserService
userService
;
status
.
put
(
"roleId"
,
roleService
.
find
(
new
RoleEntity
(),
null
).
stream
()
.
collect
(
Collectors
.
toMap
(
e
->
e
.
getId
().
toString
(),
RoleEntity:
:
getName
)));
List
<
RoleUserEntity
>
roleUserList
=
(
List
<
RoleUserEntity
>)
model
.
get
(
SysConstains
.
RESULT_KEY
);
if
(
roleUserList
!=
null
&&
roleUserList
.
size
()
>
0
)
{
List
<
Long
>
userIdsList
=
roleUserList
.
stream
().
map
(
RoleUserEntity:
:
getUserId
).
collect
(
Collectors
.
toList
());
List
<
UserEntity
>
userEntityList
=
userService
.
find
(
getQuery
(
UserQuery
.
class
,
Sets
.
newHashSet
(
"id"
,
"realName"
,
"loginName"
),
userIdsList
.
toArray
(
new
Long
[
userIdsList
.
size
()])),
null
);
if
(
userEntityList
!=
null
)
{
status
.
put
(
"userReNameMap"
,
userEntityList
.
stream
().
collect
(
Collectors
.
toMap
(
e
->
e
.
getId
().
toString
(),
UserEntity:
:
getRealName
)));
status
.
put
(
"userId"
,
userEntityList
.
stream
().
collect
(
Collectors
.
toMap
(
e
->
e
.
getId
().
toString
(),
UserEntity:
:
getLoginName
)));
}
}
model
.
put
(
KEY_RESULT_DICT
,
status
);
}
public
RoleUserController
(){
/**
super
.
setFormClass
(
RoleUserForm
.
class
);
super
.
setModuleDesc
(
"角色用户"
);
}
/**
* 获取查询对象,限制查询返回的结果只包含ID和名称
* 获取查询对象,限制查询返回的结果只包含ID和名称
*
* @param IdList
* @param IdList
* @return
* @return
*/
*/
...
@@ -79,65 +91,42 @@ public class RoleUserController extends BaseCRUDJsonMappingController<RoleUserSe
...
@@ -79,65 +91,42 @@ public class RoleUserController extends BaseCRUDJsonMappingController<RoleUserSe
}
}
}
}
@SuppressWarnings
(
"unchecked"
)
/**
@Override
* 分配用户
protected
void
init
(
HttpServletRequest
request
,
HttpServletResponse
response
,
RoleUserForm
form
,
Map
<
String
,
Object
>
model
,
Context
context
)
{
*/
Map
<
String
,
Object
>
status
=
new
HashMap
<>(
3
);
@PostMapping
(
value
=
"distributionUser"
)
status
.
put
(
"roleId"
,
roleService
.
find
(
new
RoleEntity
(),
null
).
stream
()
public
String
distributionUser
(
@RequestBody
RoleUserQuery
query
)
{
.
collect
(
Collectors
.
toMap
(
e
->
e
.
getId
().
toString
(),
RoleEntity:
:
getName
)));
try
{
List
<
RoleUserEntity
>
roleUserList
=
(
List
<
RoleUserEntity
>)
model
.
get
(
SysConstains
.
RESULT_KEY
);
service
.
doDistributionUser
(
query
);
if
(
roleUserList
!=
null
&&
roleUserList
.
size
()>
0
)
{
JSONObject
ret
=
new
JSONObject
();
List
<
Long
>
userIdsList
=
roleUserList
.
stream
().
map
(
RoleUserEntity:
:
getUserId
).
collect
(
Collectors
.
toList
());
ret
.
put
(
KEY_RESULT_CODE
,
VALUE_RESULT_SUCCESS
);
List
<
UserEntity
>
userEntityList
=
userService
.
find
(
getQuery
(
UserQuery
.
class
,
return
ret
.
toJSONString
();
Sets
.
newHashSet
(
"id"
,
"realName"
,
"loginName"
),
userIdsList
.
toArray
(
new
Long
[
userIdsList
.
size
()])),
null
);
}
catch
(
Exception
e
)
{
if
(
userEntityList
!=
null
)
{
log
.
error
(
"分配用户错误"
,
e
);
status
.
put
(
"userReNameMap"
,
JSONObject
ret
=
new
JSONObject
();
userEntityList
.
stream
().
collect
(
Collectors
.
toMap
(
e
->
e
.
getId
().
toString
(),
UserEntity:
:
getRealName
)));
ret
.
put
(
KEY_RESULT_CODE
,
VALUE_RESULT_FAILURE
);
status
.
put
(
"userId"
,
ret
.
put
(
KEY_RESULT_MSG
,
super
.
convertException
(
e
));
userEntityList
.
stream
().
collect
(
Collectors
.
toMap
(
e
->
e
.
getId
().
toString
(),
UserEntity:
:
getLoginName
)));
return
ret
.
toJSONString
();
}
}
}
}
model
.
put
(
KEY_RESULT_DICT
,
status
);
super
.
init
(
request
,
response
,
form
,
model
,
context
);
}
/**
* 分配用户
*/
@PostMapping
(
value
=
"distributionUser"
)
public
String
distributionUser
(
HttpServletRequest
request
,
HttpServletResponse
response
,
RoleUserForm
form
)
{
try
{
service
.
doDistributionUser
(
form
.
getQuery
());
JSONObject
ret
=
new
JSONObject
();
ret
.
put
(
KEY_RESULT_CODE
,
VALUE_RESULT_SUCCESS
);
return
ret
.
toJSONString
();
}
catch
(
Exception
e
)
{
log
.
error
(
"分配用户错误"
,
e
);
JSONObject
ret
=
new
JSONObject
();
ret
.
put
(
KEY_RESULT_CODE
,
VALUE_RESULT_FAILURE
);
ret
.
put
(
KEY_RESULT_MSG
,
super
.
convertException
(
e
));
return
ret
.
toJSONString
();
}
}
/**
/**
* 分配角色
* 分配角色
*/
*/
@PostMapping
(
value
=
"distributionRole"
)
@PostMapping
(
value
=
"distributionRole"
)
public
String
distributionRole
(
HttpServletRequest
request
,
HttpServletResponse
response
,
RoleUserForm
form
)
{
public
String
distributionRole
(
@RequestBody
RoleUserQuery
query
)
{
try
{
try
{
service
.
doDistributionRole
(
form
.
getQuery
()
);
service
.
doDistributionRole
(
query
);
JSONObject
ret
=
new
JSONObject
();
JSONObject
ret
=
new
JSONObject
();
ret
.
put
(
KEY_RESULT_CODE
,
VALUE_RESULT_SUCCESS
);
ret
.
put
(
KEY_RESULT_CODE
,
VALUE_RESULT_SUCCESS
);
return
ret
.
toJSONString
();
return
ret
.
toJSONString
();
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"分配角色错误"
,
e
);
log
.
error
(
"分配角色错误"
,
e
);
JSONObject
ret
=
new
JSONObject
();
JSONObject
ret
=
new
JSONObject
();
ret
.
put
(
KEY_RESULT_CODE
,
VALUE_RESULT_FAILURE
);
ret
.
put
(
KEY_RESULT_CODE
,
VALUE_RESULT_FAILURE
);
ret
.
put
(
KEY_RESULT_MSG
,
super
.
convertException
(
e
));
ret
.
put
(
KEY_RESULT_MSG
,
super
.
convertException
(
e
));
return
ret
.
toJSONString
();
return
ret
.
toJSONString
();
}
}
}
}
}
}
\ No newline at end of file
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