Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
H
hxwza
Project
Project
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
Graph
比较
统计图
议题
0
议题
0
列表
看板
标记
Milestones
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
注册表
注册表
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
svn
hxwza
Commits
7f2732eb
提交
7f2732eb
authored
7月 17, 2020
作者:
liupengfei
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
--no commit message
上级
e20a55e0
显示空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
30 行增加
和
17 行删除
+30
-17
CommentController.java
...zrqx/sysuser/bg/controller/comment/CommentController.java
+1
-1
DepartmentController.java
...zrqx/sysuser/bg/controller/dept/DepartmentController.java
+6
-4
ModulepowerController.java
...user/bg/controller/modulepower/ModulepowerController.java
+13
-2
UserController.java
...a/com/zrqx/sysuser/bg/controller/user/UserController.java
+3
-3
UserServiceImpl.java
...ava/com/zrqx/sysuser/bg/service/user/UserServiceImpl.java
+7
-7
没有找到文件。
app/sysuser/src/main/java/com/zrqx/sysuser/bg/controller/comment/CommentController.java
浏览文件 @
7f2732eb
...
...
@@ -139,7 +139,7 @@ public class CommentController {
comment
.
setReleaseTime
(
new
Date
());
comment
.
setUserClass
(
UserTypeEnum
.
STATUS_1
.
getCode
());
comment
.
setStatus
(
CommentEnum
.
NOT_REVIEW
.
getCode
());
comment
.
setUserId
(
redis
.
getUser
().
getId
());
comment
.
setUserId
(
redis
.
getUser
().
get
User
Id
());
if
(!
service
.
insert
(
comment
))
{
throw
new
BaseException
(
"操作失败"
);
}
...
...
app/sysuser/src/main/java/com/zrqx/sysuser/bg/controller/dept/DepartmentController.java
浏览文件 @
7f2732eb
...
...
@@ -97,17 +97,19 @@ public class DepartmentController {
return
CallBack
.
success
();
}
@ApiOperation
(
value
=
"删除部门"
,
notes
=
"根据部门
ID
删除一个部门"
)
@ApiOperation
(
value
=
"删除部门"
,
notes
=
"根据部门
code
删除一个部门"
)
@PostMapping
(
value
=
"/delete"
)
public
CallBack
<
Boolean
>
delete
(
@RequestBody
Integer
[]
ids
){
if
(
ids
.
length
==
0
){
public
CallBack
<
Boolean
>
delete
(
@RequestBody
String
[]
codeList
){
if
(
codeList
.
length
==
0
){
throw
new
BaseException
(
"没有选中任何数据,请重新选择"
);
}
Arrays
.
asList
(
codeList
).
stream
().
forEach
(
code
->
{
Example
example
=
departmentSerivce
.
createExample
();
example
.
createCriteria
().
andIn
(
"departmentId"
,
Arrays
.
asList
(
ids
)
);
example
.
createCriteria
().
andLike
(
"departmentCode"
,
code
+
"%"
);
if
(!
departmentSerivce
.
deleteByExample
(
example
))
{
throw
new
BaseException
(
"操作失败"
);
}
});
return
CallBack
.
success
(
true
);
}
...
...
app/sysuser/src/main/java/com/zrqx/sysuser/bg/controller/modulepower/ModulepowerController.java
浏览文件 @
7f2732eb
package
com
.
zrqx
.
sysuser
.
bg
.
controller
.
modulepower
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
...
...
@@ -13,6 +16,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.zrqx.core.exception.BaseException
;
import
com.zrqx.core.util.bean.BeanUtils
;
import
com.zrqx.core.util.datatype.ArrayUtils
;
import
com.zrqx.core.util.datatype.UUIDUtil
;
...
...
@@ -98,10 +102,17 @@ public class ModulepowerController {
@ApiOperation
(
value
=
"批量删除"
,
notes
=
"批量删除"
)
@PostMapping
(
value
=
"/batch/delete"
)
public
CallBack
<
Boolean
>
batchDelete
(
@RequestBody
List
<
Integer
>
ids
){
if
(
ArrayUtils
.
empty
(
ids
)){
public
CallBack
<
Boolean
>
batchDelete
(
@RequestBody
List
<
String
>
codeList
){
if
(
ArrayUtils
.
empty
(
codeList
)){
return
CallBack
.
success
();
}
List
<
Integer
>
ids
=
new
ArrayList
<
Integer
>();
codeList
.
stream
().
forEach
(
code
->
{
Example
example
=
modulepowerSerivce
.
createExample
();
example
.
createCriteria
().
andLike
(
"departmentCode"
,
code
+
"%"
);
List
<
Modulepower
>
mpList
=
modulepowerSerivce
.
selectByExample
(
example
);
ids
.
addAll
(
mpList
.
stream
().
map
(
Modulepower
::
getId
).
distinct
().
collect
(
Collectors
.
toList
()));
});
return
modulepowerSerivce
.
batchDelete
(
ids
)
?
CallBack
.
success
(
true
)
:
CallBack
.
fail
();
}
...
...
app/sysuser/src/main/java/com/zrqx/sysuser/bg/controller/user/UserController.java
浏览文件 @
7f2732eb
...
...
@@ -64,7 +64,7 @@ public class UserController {
@PostMapping
(
value
=
"/save"
)
public
CallBack
<
String
>
saveUser
(
@RequestBody
SaveUserForm
user
)
throws
Exception
{
userSerivce
.
save
(
user
);
return
CallBack
.
success
(
user
.
getId
());
return
CallBack
.
success
(
user
.
get
User
Id
());
}
// @ApiOperation(value = "修改密码", notes = "0:成功;")
// @PostMapping(value = "/update")
...
...
@@ -167,7 +167,7 @@ public class UserController {
if
(
user
.
getIsAdmin
().
equals
(
BooleanStatusEnum
.
YES
.
getCode
())){
btnIds
=
operatepowerService
.
getListByUserIdAndCode
(
null
,
modulePower
.
getCode
());
}
else
{
btnIds
=
operatepowerService
.
getListByUserIdAndCode
(
user
.
getId
(),
modulePower
.
getCode
());
btnIds
=
operatepowerService
.
getListByUserIdAndCode
(
user
.
get
User
Id
(),
modulePower
.
getCode
());
}
return
CallBack
.
success
(
btnIds
);
}
...
...
@@ -186,7 +186,7 @@ public class UserController {
if
(
user
.
getIsAdmin
().
equals
(
BooleanStatusEnum
.
YES
.
getCode
())){
mCode
=
modulepowerService
.
getCode
();
}
else
{
mCode
=
modulepowerService
.
getCodeByUserId
(
user
.
getId
());
mCode
=
modulepowerService
.
getCodeByUserId
(
user
.
get
User
Id
());
}
map
.
put
(
"user"
,
user
);
map
.
put
(
"mList"
,
mCode
);
...
...
app/sysuser/src/main/java/com/zrqx/sysuser/bg/service/user/UserServiceImpl.java
浏览文件 @
7f2732eb
...
...
@@ -71,7 +71,7 @@ public class UserServiceImpl extends BaseServiceImpl<User,String> implements Use
List
<
UserDepartmentRelation
>
udList
=
new
ArrayList
<
UserDepartmentRelation
>();
for
(
Integer
deptId
:
form
.
getDeptId
())
{
UserDepartmentRelation
ud
=
new
UserDepartmentRelation
();
ud
.
setUserId
(
user
.
getId
());
ud
.
setUserId
(
user
.
get
User
Id
());
ud
.
setDepartmentId
(
deptId
);
udList
.
add
(
ud
);
}
...
...
@@ -81,7 +81,7 @@ public class UserServiceImpl extends BaseServiceImpl<User,String> implements Use
List
<
UserRoleRelation
>
urList
=
new
ArrayList
<
UserRoleRelation
>();
for
(
Integer
roleId
:
form
.
getRoleId
())
{
UserRoleRelation
ur
=
new
UserRoleRelation
();
ur
.
setUserId
(
user
.
getId
());
ur
.
setUserId
(
user
.
get
User
Id
());
ur
.
setRoleId
(
roleId
);
urList
.
add
(
ur
);
}
...
...
@@ -162,11 +162,11 @@ public class UserServiceImpl extends BaseServiceImpl<User,String> implements Use
form
.
getRoleId
().
forEach
(
id
->{
//往用户-角色关联表里插入数据
UserRoleRelation
rr
=
new
UserRoleRelation
();
rr
.
setUserId
(
form
.
getId
());
rr
.
setUserId
(
form
.
get
User
Id
());
rr
.
setRoleId
(
id
);
urMapper
.
insert
(
rr
);
});
User
member
=
super
.
notNull
(
form
.
getId
());
User
member
=
super
.
notNull
(
form
.
get
User
Id
());
member
.
setIsAdmin
(
form
.
getIsAdmin
());
super
.
updateByPrimaryKey
(
member
);
return
true
;
...
...
@@ -175,7 +175,7 @@ public class UserServiceImpl extends BaseServiceImpl<User,String> implements Use
@Override
public
boolean
update
(
SaveUserForm
form
)
throws
Exception
{
User
entity
=
userMapper
.
selectByPrimaryKey
(
form
.
getId
());
User
entity
=
userMapper
.
selectByPrimaryKey
(
form
.
get
User
Id
());
// md5密码加密
if
(
StringUtils
.
isNotEmpty
(
form
.
getPassword
()))
{
if
(
form
.
getPassword
().
equals
(
"******"
)){
...
...
@@ -188,13 +188,13 @@ public class UserServiceImpl extends BaseServiceImpl<User,String> implements Use
userMapper
.
updateByPrimaryKeySelective
(
entity
);
// 根据用户id 删除用户与角色关系
UserRoleRelation
rr
=
new
UserRoleRelation
();
rr
.
setUserId
(
form
.
getId
());
rr
.
setUserId
(
form
.
get
User
Id
());
urMapper
.
delete
(
rr
);
// 添加用户与角色关系
if
(
ArrayUtils
.
isNotEmpty
(
form
.
getRoleId
())){
form
.
getRoleId
().
forEach
(
v
->
{
UserRoleRelation
t
=
new
UserRoleRelation
();
t
.
setUserId
(
form
.
getId
());
t
.
setUserId
(
form
.
get
User
Id
());
t
.
setRoleId
(
v
);
urMapper
.
insertSelective
(
t
);
});
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论