Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
education
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
李丛阳
education
Commits
2450d510
Commit
2450d510
authored
Sep 25, 2019
by
luzhuang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
userRole
parent
9732b5fa
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
26 additions
and
13 deletions
+26
-13
BChapterRepository.java
...org/rcisoft/business/bchapter/dao/BChapterRepository.java
+5
-0
BChapterServiceImpl.java
...t/business/bchapter/service/impl/BChapterServiceImpl.java
+4
-1
BCourseController.java
...cisoft/business/bcourse/controller/BCourseController.java
+1
-1
SysUserController.java
...va/org/rcisoft/sys/user/controller/SysUserController.java
+4
-4
SysUserMapper.java
src/main/java/org/rcisoft/sys/user/dao/SysUserMapper.java
+4
-2
SysUserServiceImpl.java
...org/rcisoft/sys/user/service/impl/SysUserServiceImpl.java
+8
-5
No files found.
src/main/java/org/rcisoft/business/bchapter/dao/BChapterRepository.java
View file @
2450d510
...
...
@@ -387,5 +387,10 @@ public interface BChapterRepository extends BaseMapper<BChapter> {
"where del_flag = 0 and flag = 1 "
+
"and pid = #{pid} order by state desc</script>"
)
List
<
String
>
queryChapterStateByPid
(
String
pid
);
@Update
(
"update b_lesson set class_hour ="
+
"(select count(*) from b_chapter where lesson_id = #{lessonId} and chapter_level = 2 and del_flag != 1 and flag =1) "
+
"where business_id = #{lessonId}"
)
int
updateClassHourInLesson
(
@Param
(
"lessonId"
)
String
lessonId
);
}
src/main/java/org/rcisoft/business/bchapter/service/impl/BChapterServiceImpl.java
View file @
2450d510
...
...
@@ -82,12 +82,13 @@ public class BChapterServiceImpl implements BChapterService {
/**
* dto查询章节信息
*
* @param model
* @return
*/
public
List
<
QueryChapterListResDTO
>
queryChapterListResDTO
(
QueryChapterListDTO
model
)
{
Map
param
=
new
HashMap
<
String
,
Object
>();
if
(
model
.
getLessonId
()
!=
null
&&
!
""
.
equals
(
model
.
getLessonId
())){
if
(
model
.
getLessonId
()
!=
null
&&
!
""
.
equals
(
model
.
getLessonId
()))
{
param
.
put
(
"lessonId"
,
model
.
getLessonId
());
}
return
bChapterRepository
.
queryBChapters
(
param
);
...
...
@@ -114,7 +115,9 @@ public class BChapterServiceImpl implements BChapterService {
}
int
sort
=
bChapterRepository
.
selectMaxSort
(
model
.
getPid
(),
model
.
getLessonId
());
model
.
setSort
(
sort
);
line
=
bChapterRepository
.
insertSelective
(
model
);
bChapterRepository
.
updateClassHourInLesson
(
model
.
getLessonId
());
//更新b_lesson表中 class_hour
}
else
{
UserUtil
.
setCurrentMergeOperation
(
model
);
line
=
bChapterRepository
.
updateByPrimaryKeySelective
(
model
);
...
...
src/main/java/org/rcisoft/business/bcourse/controller/BCourseController.java
View file @
2450d510
...
...
@@ -53,7 +53,7 @@ public class BCourseController extends PaginationController<BCourse> {
}
@ApiOperation
(
value
=
"根据条件分页查询"
,
notes
=
"根据条件分页查询标签"
)
@ApiImplicitParam
(
name
=
"cName"
,
value
=
"(课程名)模糊查询"
,
required
=
fals
e
,
dataType
=
"varchar"
)
@ApiImplicitParam
(
name
=
"cName"
,
value
=
"(课程名)模糊查询"
,
required
=
tru
e
,
dataType
=
"varchar"
)
@GetMapping
(
value
=
"/queryBCourseByPagination"
)
public
GridModel
queryBCourseByPagination
(
CurUser
curUser
,
@Valid
String
cName
,
BindingResult
br
)
{
BCourse
bCourse
=
new
BCourse
();
...
...
src/main/java/org/rcisoft/sys/user/controller/SysUserController.java
View file @
2450d510
...
...
@@ -56,8 +56,8 @@ public class SysUserController extends PaginationController<SysUser> {
}
@ApiOperation
(
value
=
"分配角色"
,
notes
=
"分配角色"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"id"
,
value
=
"用户id
(可多选 用 ,分开传字符串)
"
,
required
=
true
,
dataType
=
"varchar"
,
paramType
=
"path"
),
@ApiImplicitParam
(
name
=
"roleId"
,
value
=
"角色id
(可多选 用 ,分开传字符串)
"
,
required
=
true
,
dataType
=
"varchar"
,
paramType
=
"path"
)})
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"id"
,
value
=
"用户id
(批量操作时 id用,隔开)
"
,
required
=
true
,
dataType
=
"varchar"
,
paramType
=
"path"
),
@ApiImplicitParam
(
name
=
"roleId"
,
value
=
"角色id
(批量操作时 id用,隔开)
"
,
required
=
true
,
dataType
=
"varchar"
,
paramType
=
"path"
)})
@PostMapping
(
value
=
"/AssignRoles"
)
public
Result
AssignRoles
(
CurUser
curUser
,
@Valid
String
id
,
BindingResult
br
,
String
roleId
)
{
int
line
=
userServiceImpl
.
AssignRoles
(
id
,
roleId
);
...
...
@@ -79,7 +79,7 @@ public class SysUserController extends PaginationController<SysUser> {
}
@ApiOperation
(
value
=
"停用用户"
,
notes
=
"停用用户"
)
@ApiImplicitParam
(
name
=
"businessId"
,
value
=
"
businessId
"
,
required
=
true
,
dataType
=
"varchar"
,
paramType
=
"path"
)
@ApiImplicitParam
(
name
=
"businessId"
,
value
=
"
用户Id(批量操作时 id用,隔开)
"
,
required
=
true
,
dataType
=
"varchar"
,
paramType
=
"path"
)
@PostMapping
(
value
=
"/stop"
)
public
Result
stop
(
CurUser
curUser
,
@Valid
String
businessId
,
BindingResult
br
)
{
int
line
=
userServiceImpl
.
stopUserByUserBusinessId
(
businessId
);
...
...
@@ -90,7 +90,7 @@ public class SysUserController extends PaginationController<SysUser> {
}
@ApiOperation
(
value
=
"启用用户"
,
notes
=
"启用用户"
)
@ApiImplicitParam
(
name
=
"businessId"
,
value
=
"
businessId
"
,
required
=
true
,
dataType
=
"varchar"
,
paramType
=
"path"
)
@ApiImplicitParam
(
name
=
"businessId"
,
value
=
"
用户Id(批量操作时 id用,隔开)
"
,
required
=
true
,
dataType
=
"varchar"
,
paramType
=
"path"
)
@PostMapping
(
value
=
"/start"
)
public
Result
Start
(
CurUser
curUser
,
@Valid
String
businessId
,
BindingResult
br
)
{
int
line
=
userServiceImpl
.
startUserByUserBusinessId
(
businessId
);
...
...
src/main/java/org/rcisoft/sys/user/dao/SysUserMapper.java
View file @
2450d510
...
...
@@ -36,8 +36,10 @@ public interface SysUserMapper extends BaseMapper<SysUser> {
"</script>"
)
int
stopFlag
(
@Param
(
"businessId"
)
List
<
String
>
businessId
);
@Select
(
"select ur.user_id from s_r_user_role ur left JOIN s_role sr on ur.role_id = sr.business_id where sr.role_name=#{roleName}"
)
List
<
String
>
adminId
(
@Param
(
"roleName"
)
String
roleName
);
@Select
(
"<script>select ur.user_id from s_r_user_role ur left JOIN s_role sr on ur.role_id = sr.business_id where sr.role_name in"
+
"<foreach item='item' index='index' collection='roleName' open='(' separator=',' close=')'> #{item} </foreach> "
+
"</script>"
)
List
<
String
>
adminId
(
@Param
(
"roleName"
)
List
<
String
>
roleName
);
@Select
(
"<script> select * from s_r_user_role where user_id in"
+
" <foreach item='item' index='index' collection='userId' open='(' separator=',' close=')'> #{item} </foreach>"
+
...
...
src/main/java/org/rcisoft/sys/user/service/impl/SysUserServiceImpl.java
View file @
2450d510
...
...
@@ -23,6 +23,8 @@ import java.util.ArrayList;
import
java.util.Arrays
;
import
java.util.List
;
import
static
java
.
util
.
Arrays
.
asList
;
@Service
@Transactional
(
readOnly
=
true
,
propagation
=
Propagation
.
NOT_SUPPORTED
)
public
class
SysUserServiceImpl
implements
SysUserService
{
...
...
@@ -52,13 +54,14 @@ public class SysUserServiceImpl implements SysUserService {
@Override
public
int
AssignRoles
(
String
userId
,
String
roleId
)
{
List
<
String
>
adminIds
=
sysUserMapper
.
adminId
(
"主管理员"
);
List
<
String
>
adminRoleName
=
asList
(
"主管理员"
,
"子管理员"
);
List
<
String
>
adminIds
=
sysUserMapper
.
adminId
(
adminRoleName
);
if
(
adminIds
.
size
()
!=
0
)
{
for
(
int
i
=
0
;
i
<
adminIds
.
size
();
i
++)
{
userId
=
userId
.
replace
(
adminIds
.
get
(
i
),
""
);
}
List
<
String
>
userIds
=
Arrays
.
asList
(
StringUtils
.
split
(
userId
,
","
));
List
<
String
>
roleIds
=
Arrays
.
asList
(
StringUtils
.
split
(
roleId
,
","
));
List
<
String
>
userIds
=
asList
(
StringUtils
.
split
(
userId
,
","
));
List
<
String
>
roleIds
=
asList
(
StringUtils
.
split
(
roleId
,
","
));
List
<
UserRole
>
userRoles
=
new
ArrayList
<>();
sysUserMapper
.
delUserRoleById
(
userIds
);
int
result
=
0
;
...
...
@@ -105,13 +108,13 @@ public class SysUserServiceImpl implements SysUserService {
@Override
public
int
stopUserByUserBusinessId
(
String
businessId
)
{
List
<
String
>
ids
=
Arrays
.
asList
(
StringUtils
.
split
(
businessId
,
","
));
List
<
String
>
ids
=
asList
(
StringUtils
.
split
(
businessId
,
","
));
return
sysUserMapper
.
stopFlag
(
ids
);
}
@Override
public
int
startUserByUserBusinessId
(
String
businessId
)
{
List
<
String
>
ids
=
Arrays
.
asList
(
StringUtils
.
split
(
businessId
,
","
));
List
<
String
>
ids
=
asList
(
StringUtils
.
split
(
businessId
,
","
));
return
sysUserMapper
.
startFlag
(
ids
);
}
...
...
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