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
9ecd5f44
Commit
9ecd5f44
authored
Apr 23, 2018
by
YangZhaoJun1
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'V2.0.3' of
http://103.249.252.28:90/lcy/education
into V2.0.3
parents
7b27afb5
399049b7
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
59 additions
and
38 deletions
+59
-38
BCourseCodeController.java
...usiness/bcoursecode/controller/BCourseCodeController.java
+4
-17
BCourseCodeRepository.java
...isoft/business/bcoursecode/dao/BCourseCodeRepository.java
+28
-0
BCourseCodeService.java
...soft/business/bcoursecode/service/BCourseCodeService.java
+10
-3
BCourseCodeServiceImpl.java
...ness/bcoursecode/service/impl/BCourseCodeServiceImpl.java
+17
-18
No files found.
src/main/java/org/rcisoft/business/bcoursecode/controller/BCourseCodeController.java
View file @
9ecd5f44
...
...
@@ -72,31 +72,18 @@ public class BCourseCodeController extends PaginationController<BCourseCode> {
bCourseCodeServiceImpl
.
findAll
(
bCourseCode
));
}
@ApiOperation
(
value
=
"启用
课程节点"
,
notes
=
"启
用课程节点"
)
@ApiOperation
(
value
=
"启用
/停用课程节点"
,
notes
=
"启用/停
用课程节点"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"businessId"
,
value
=
"businessId,拼在地址栏中"
,
required
=
true
,
dataType
=
"varchar"
)})
@PostMapping
(
"/
start
Flag"
)
@PostMapping
(
"/
change
Flag"
)
@PreAuthorize
(
"hasRole('ROLE_1001')"
)
public
Result
start
Flag
(
@ApiIgnore
String
businessId
)
{
public
Result
change
Flag
(
@ApiIgnore
String
businessId
)
{
BCourseCode
bCourseCode
=
new
BCourseCode
();
bCourseCode
.
setToken
(
getToken
());
PersistModel
data
=
bCourseCodeServiceImpl
.
start
Flag
(
businessId
);
PersistModel
data
=
bCourseCodeServiceImpl
.
change
Flag
(
businessId
);
return
Result
.
builder
(
data
,
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
bCourseCode
);
}
@ApiOperation
(
value
=
"停用课程节点"
,
notes
=
"停用课程节点"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"businessId"
,
value
=
"businessId,拼在地址栏中"
,
required
=
true
,
dataType
=
"varchar"
)})
@PostMapping
(
"/stopFlag"
)
@PreAuthorize
(
"hasRole('ROLE_1001')"
)
public
Result
stopFlag
(
@ApiIgnore
String
businessId
)
{
BCourseCode
bCourseCode
=
new
BCourseCode
();
bCourseCode
.
setToken
(
getToken
());
PersistModel
data
=
bCourseCodeServiceImpl
.
stopFlag
(
businessId
);
return
Result
.
builder
(
data
,
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
bCourseCode
);
}
}
src/main/java/org/rcisoft/business/bcoursecode/dao/BCourseCodeRepository.java
View file @
9ecd5f44
...
...
@@ -28,17 +28,45 @@ public interface BCourseCodeRepository extends BaseMapper<BCourseCode> {
@ResultMap
(
value
=
"BaseResultMap"
)
List
<
BCourseCode
>
queryBCourseCodes
(
BCourseCode
bCourseCode
);
/**
* 启用标志位
* @param businessId
* @return
*/
@Update
(
"update b_course_code set flag = 1 where business_id = #{0}"
)
int
startFlag
(
String
businessId
);
/**
* 停用标志位
* @param businessId
* @return
*/
@Update
(
"update b_course_code set flag = 0 where business_id = #{0}"
)
int
stopFlag
(
String
businessId
);
/**
* 查询停用条数
* @param id
* @return
*/
@Select
(
"select count(*) from b_course_code where business_id > #{id} and flag=1 and del_flag = 0 "
)
int
select_flag_stop
(
int
id
);
/**
* 查询启用条数
* @param id
* @return
*/
@Select
(
"select count(*) from b_course_code where business_id < #{id} and flag=0 and del_flag = 0 "
)
int
select_flag_start
(
int
id
);
/**
* 查询节点当前启用/停用状态
* @param businessId
* @return
*/
@Select
(
"select flag from b_course_code where business_id = #{0} and del_flag = 0"
)
String
querystatus
(
String
businessId
);
}
src/main/java/org/rcisoft/business/bcoursecode/service/BCourseCodeService.java
View file @
9ecd5f44
...
...
@@ -27,18 +27,25 @@ public interface BCourseCodeService {
*/
List
<
BCourseCode
>
findAll
(
BCourseCode
bCourseCode
);
/**
* 启用课程节点
* @param businessId
* @return
*/
PersistModel
startFlag
(
String
businessId
);
//
PersistModel startFlag(String businessId);
/**
* 停用课程节点
* @param businessId
* @return
*/
PersistModel
stopFlag
(
String
businessId
);
// PersistModel stopFlag(String businessId);
/**
* 变动课程节点
* @param businessId
* @return
*/
PersistModel
changeFlag
(
String
businessId
);
}
src/main/java/org/rcisoft/business/bcoursecode/service/impl/BCourseCodeServiceImpl.java
View file @
9ecd5f44
...
...
@@ -52,6 +52,7 @@ public class BCourseCodeServiceImpl implements BCourseCodeService {
* @param bCourseCode
* @return
*/
@Override
public
List
<
BCourseCode
>
findAll
(
BCourseCode
bCourseCode
){
bCourseCode
.
setStart
();
bCourseCode
.
setNotDeleted
();
...
...
@@ -60,29 +61,27 @@ public class BCourseCodeServiceImpl implements BCourseCodeService {
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
isolation
=
Isolation
.
DEFAULT
)
@Override
public
PersistModel
start
Flag
(
String
businessId
){
public
PersistModel
change
Flag
(
String
businessId
){
BCourseCode
bCourseCode
=
new
BCourseCode
();
UserUtil
.
setCurrentMergeOperation
(
bCourseCode
);
int
id
=
Integer
.
parseInt
(
businessId
);
int
num
=
bCourseCodeRepository
.
select_flag_start
(
id
);
if
(
num
!=
0
){
throw
new
ServiceException
(
ResultServiceEnums
.
PERVIOUS_NOT_ENABLED
);
// 节点启用
if
(
bCourseCodeRepository
.
querystatus
(
businessId
).
equals
(
"0"
)){
int
num
=
bCourseCodeRepository
.
select_flag_start
(
id
);
if
(
num
!=
0
){
throw
new
ServiceException
(
ResultServiceEnums
.
PERVIOUS_NOT_ENABLED
);
}
bCourseCodeRepository
.
startFlag
(
String
.
valueOf
(
id
));
}
bCourseCodeRepository
.
startFlag
(
String
.
valueOf
(
id
));
return
new
PersistModel
(
1
);
}
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
isolation
=
Isolation
.
DEFAULT
)
@Override
public
PersistModel
stopFlag
(
String
businessId
){
BCourseCode
bCourseCode
=
new
BCourseCode
();
UserUtil
.
setCurrentMergeOperation
(
bCourseCode
);
int
id
=
Integer
.
parseInt
(
businessId
);
int
num
=
bCourseCodeRepository
.
select_flag_stop
(
id
);
if
(
num
!=
0
){
throw
new
ServiceException
(
ResultServiceEnums
.
NEXT_NOT_DISABLED
);
// 节点停用
else
{
int
num
=
bCourseCodeRepository
.
select_flag_stop
(
id
);
if
(
num
!=
0
){
throw
new
ServiceException
(
ResultServiceEnums
.
NEXT_NOT_DISABLED
);
}
bCourseCodeRepository
.
stopFlag
(
String
.
valueOf
(
id
));
}
bCourseCodeRepository
.
stopFlag
(
String
.
valueOf
(
id
));
return
new
PersistModel
(
1
);
}
}
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