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
deac2c4f
Commit
deac2c4f
authored
Apr 18, 2018
by
hanshuai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hanshuai stop/start
parent
d2872de4
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
94 additions
and
6 deletions
+94
-6
pom.xml
pom.xml
+1
-0
BClassController.java
.../rcisoft/business/bclass/controller/BClassController.java
+0
-1
BCourseCodeController.java
...usiness/bcoursecode/controller/BCourseCodeController.java
+28
-0
BCourseCodeRepository.java
...isoft/business/bcoursecode/dao/BCourseCodeRepository.java
+15
-0
BCourseCode.java
.../org/rcisoft/business/bcoursecode/entity/BCourseCode.java
+2
-2
BCourseCodeService.java
...soft/business/bcoursecode/service/BCourseCodeService.java
+12
-1
BCourseCodeServiceImpl.java
...ness/bcoursecode/service/impl/BCourseCodeServiceImpl.java
+29
-0
BSlRepository.java
...main/java/org/rcisoft/business/bsl/dao/BSlRepository.java
+2
-0
ResultServiceEnums.java
...main/java/org/rcisoft/core/result/ResultServiceEnums.java
+5
-2
No files found.
pom.xml
View file @
deac2c4f
...
@@ -389,6 +389,7 @@
...
@@ -389,6 +389,7 @@
<artifactId>
eduLk
</artifactId>
<artifactId>
eduLk
</artifactId>
<version>
1.0-SNAPSHOT
</version>
<version>
1.0-SNAPSHOT
</version>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
mysql
</groupId>
<groupId>
mysql
</groupId>
<artifactId>
mysql-connector-java
</artifactId>
<artifactId>
mysql-connector-java
</artifactId>
...
...
src/main/java/org/rcisoft/business/bclass/controller/BClassController.java
View file @
deac2c4f
package
org
.
rcisoft
.
business
.
bclass
.
controller
;
package
org
.
rcisoft
.
business
.
bclass
.
controller
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
...
...
src/main/java/org/rcisoft/business/bcoursecode/controller/BCourseCodeController.java
View file @
deac2c4f
...
@@ -71,4 +71,32 @@ public class BCourseCodeController extends PaginationController<BCourseCode> {
...
@@ -71,4 +71,32 @@ public class BCourseCodeController extends PaginationController<BCourseCode> {
MessageConstant
.
MESSAGE_ALERT_ERROR
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
bCourseCodeServiceImpl
.
findAll
(
bCourseCode
));
bCourseCodeServiceImpl
.
findAll
(
bCourseCode
));
}
}
@ApiOperation
(
value
=
"启用课程节点"
,
notes
=
"启用课程节点"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"businessId"
,
value
=
"businessId,拼在地址栏中"
,
required
=
true
,
dataType
=
"varchar"
)})
@PostMapping
(
"/startFlag"
)
@PreAuthorize
(
"hasRole('ROLE_1001')"
)
public
Result
startFlag
(
@ApiIgnore
String
businessId
)
{
BCourseCode
bCourseCode
=
new
BCourseCode
();
bCourseCode
.
setToken
(
getToken
());
PersistModel
data
=
bCourseCodeServiceImpl
.
startFlag
(
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 @
deac2c4f
package
org
.
rcisoft
.
business
.
bcoursecode
.
dao
;
package
org
.
rcisoft
.
business
.
bcoursecode
.
dao
;
import
org.apache.ibatis.annotations.Update
;
import
org.rcisoft.core.base.BaseMapper
;
import
org.rcisoft.core.base.BaseMapper
;
import
org.rcisoft.business.bcoursecode.entity.BCourseCode
;
import
org.rcisoft.business.bcoursecode.entity.BCourseCode
;
import
org.apache.ibatis.annotations.ResultMap
;
import
org.apache.ibatis.annotations.ResultMap
;
import
org.apache.ibatis.annotations.Select
;
import
org.apache.ibatis.annotations.Select
;
import
org.rcisoft.core.model.PersistModel
;
import
org.springframework.stereotype.Repository
;
import
org.springframework.stereotype.Repository
;
...
@@ -25,5 +27,18 @@ public interface BCourseCodeRepository extends BaseMapper<BCourseCode> {
...
@@ -25,5 +27,18 @@ public interface BCourseCodeRepository extends BaseMapper<BCourseCode> {
+
"</script>"
)
+
"</script>"
)
@ResultMap
(
value
=
"BaseResultMap"
)
@ResultMap
(
value
=
"BaseResultMap"
)
List
<
BCourseCode
>
queryBCourseCodes
(
BCourseCode
bCourseCode
);
List
<
BCourseCode
>
queryBCourseCodes
(
BCourseCode
bCourseCode
);
@Update
(
"update b_course_code set flag = 1 where business_id = #{0}"
)
int
startFlag
(
String
businessId
);
@Update
(
"update b_course_code set flag = 0 where business_id = #{0}"
)
int
stopFlag
(
String
businessId
);
@Select
(
"select count(*) from b_course_code where business_id > #{id} and flag=1 and del_flag = 0 "
)
int
select_flag_stop
(
int
id
);
@Select
(
"select count(*) from b_course_code where business_id < #{id} and flag=0 and del_flag = 0 "
)
int
select_flag_start
(
int
id
);
}
}
src/main/java/org/rcisoft/business/bcoursecode/entity/BCourseCode.java
View file @
deac2c4f
...
@@ -45,7 +45,7 @@ public class BCourseCode extends IdEntity<BCourseCode> {
...
@@ -45,7 +45,7 @@ public class BCourseCode extends IdEntity<BCourseCode> {
@NotBlank
@NotBlank
private
String
dateDesc
;
private
String
dateDesc
;
public
String
getDateDesc
(){
/*
public String getDateDesc(){
switch (this.dateDesc) {
switch (this.dateDesc) {
case "0":
case "0":
return "上午";
return "上午";
...
@@ -54,7 +54,7 @@ public class BCourseCode extends IdEntity<BCourseCode> {
...
@@ -54,7 +54,7 @@ public class BCourseCode extends IdEntity<BCourseCode> {
default:
default:
return "晚上";
return "晚上";
}
}
}
}
*/
}
}
src/main/java/org/rcisoft/business/bcoursecode/service/BCourseCodeService.java
View file @
deac2c4f
...
@@ -28,6 +28,17 @@ public interface BCourseCodeService {
...
@@ -28,6 +28,17 @@ public interface BCourseCodeService {
List
<
BCourseCode
>
findAll
(
BCourseCode
bCourseCode
);
List
<
BCourseCode
>
findAll
(
BCourseCode
bCourseCode
);
/**
* 启用课程节点
* @param businessId
* @return
*/
PersistModel
startFlag
(
String
businessId
);
/**
* 停用课程节点
* @param businessId
* @return
*/
PersistModel
stopFlag
(
String
businessId
);
}
}
src/main/java/org/rcisoft/business/bcoursecode/service/impl/BCourseCodeServiceImpl.java
View file @
deac2c4f
package
org
.
rcisoft
.
business
.
bcoursecode
.
service
.
impl
;
package
org
.
rcisoft
.
business
.
bcoursecode
.
service
.
impl
;
import
org.rcisoft.core.exception.ServiceException
;
import
org.rcisoft.core.result.ResultServiceEnums
;
import
org.rcisoft.core.util.UserUtil
;
import
org.rcisoft.core.util.UserUtil
;
import
org.rcisoft.core.aop.PageUtil
;
import
org.rcisoft.core.aop.PageUtil
;
import
org.rcisoft.core.model.PersistModel
;
import
org.rcisoft.core.model.PersistModel
;
...
@@ -56,4 +58,31 @@ public class BCourseCodeServiceImpl implements BCourseCodeService {
...
@@ -56,4 +58,31 @@ public class BCourseCodeServiceImpl implements BCourseCodeService {
return
bCourseCodeRepository
.
queryBCourseCodes
(
bCourseCode
);
return
bCourseCodeRepository
.
queryBCourseCodes
(
bCourseCode
);
}
}
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
isolation
=
Isolation
.
DEFAULT
)
@Override
public
PersistModel
startFlag
(
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
);
}
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
);
}
bCourseCodeRepository
.
stopFlag
(
String
.
valueOf
(
id
));
return
new
PersistModel
(
1
);
}
}
}
src/main/java/org/rcisoft/business/bsl/dao/BSlRepository.java
View file @
deac2c4f
...
@@ -3,6 +3,8 @@ package org.rcisoft.business.bsl.dao;
...
@@ -3,6 +3,8 @@ package org.rcisoft.business.bsl.dao;
import
org.apache.ibatis.annotations.*
;
import
org.apache.ibatis.annotations.*
;
import
org.rcisoft.business.bsl.dto.SlDTO
;
import
org.rcisoft.business.bsl.dto.SlDTO
;
import
org.rcisoft.business.bsl.dto.SlDetailDTO
;
import
org.rcisoft.business.bsl.dto.SlDetailDTO
;
import
org.rcisoft.business.bsl.entity.BSl
;
import
org.rcisoft.core.base.BaseMapper
;
import
org.springframework.stereotype.Repository
;
import
org.springframework.stereotype.Repository
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
...
src/main/java/org/rcisoft/core/result/ResultServiceEnums.java
View file @
deac2c4f
...
@@ -150,8 +150,11 @@ public enum ResultServiceEnums {
...
@@ -150,8 +150,11 @@ public enum ResultServiceEnums {
CLASSHOUR_ERROR
(
81
,
"学时不能小于当前已添加的学时"
),
CLASSHOUR_ERROR
(
81
,
"学时不能小于当前已添加的学时"
),
THIS_IS_FILE
(
82
,
"该目录下不能新建文件"
)
THIS_IS_FILE
(
82
,
"该目录下不能新建文件"
),
;
PERVIOUS_NOT_ENABLED
(
83
,
"启用失败,在此之前存在未启用的课程节点"
),
NEXT_NOT_DISABLED
(
84
,
"停用失败,在此之后存在未停用的课程节点"
);
private
Integer
code
;
private
Integer
code
;
private
String
message
;
private
String
message
;
...
...
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