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
bdab4573
Commit
bdab4573
authored
Dec 12, 2019
by
luzhuang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改
parent
2426ac2a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
10 deletions
+19
-10
edu_modify_lesson_value.sql
sql/edu_modify_lesson_value.sql
+5
-2
BRStudentChapterController.java
...studentchapter/controller/BRStudentChapterController.java
+4
-3
BRStudentChapterService.java
...ess/brstudentchapter/service/BRStudentChapterService.java
+2
-1
BRStudentChapterServiceImpl.java
...dentchapter/service/impl/BRStudentChapterServiceImpl.java
+8
-4
No files found.
sql/edu_modify_lesson_value.sql
View file @
bdab4573
#
修改
blesson
value
19
-
12
-
10
ALTER
table
b_lesson
modify
column
value_consume
VARCHAR
(
16
);
ALTER
table
b_lesson
modify
column
value_gain
VARCHAR
(
16
);
#
修改
b_
lesson_person
value
19
-
12
-
10
ALTER
table
b_
lesson_person
modify
column
`value`
VARCHAR
(
16
);
#
修改
b_
person_value
value
19
-
12
-
10
ALTER
table
b_
person_value
modify
column
`value`
VARCHAR
(
16
);
#
修改
b_release_value
value
19
-
12
-
10
ALTER
table
b_release_value
modify
column
lesson_value
VARCHAR
(
16
);
ALTER
table
b_release_value
modify
column
train_value
VARCHAR
(
16
);
#
添加
b_person_value
中
lessonId
字段
19
-
12
-
11
alter
table
b_person_value
add
lesson_id
varchar
(
64
)
COMMENT
'课程或培训id'
after
type
;
#
-------------测试环境已更新--------------
src/main/java/org/rcisoft/business/brstudentchapter/controller/BRStudentChapterController.java
View file @
bdab4573
...
...
@@ -6,6 +6,7 @@ import io.swagger.annotations.Api;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
org.rcisoft.business.blesson.entity.BLessonPerson
;
import
org.rcisoft.business.brstudentchapter.dto.BRStudentChapterDto
;
import
org.rcisoft.common.controller.PaginationController
;
import
org.rcisoft.sys.user.bean.CurUser
;
...
...
@@ -44,11 +45,11 @@ public class BRStudentChapterController extends PaginationController<BRStudentCh
@PostMapping
(
value
=
"/add"
)
public
Result
addOrUpdate
(
CurUser
curUser
,
@Valid
BRStudentChapterDto
brStudentChapterDto
,
BindingResult
bindingResult
)
{
brStudentChapterDto
.
setStudentId
(
curUser
.
getUserId
());
PersistModel
data
=
bRStudentChapterServiceImpl
.
save
(
brStudentChapterDto
,
curUser
);
return
Result
.
builder
(
data
,
// String currentProgress
= bRStudentChapterServiceImpl.save(brStudentChapterDto, curUser);
return
Result
.
builder
(
new
PersistModel
(
1
)
,
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
brStudentChapterDto
);
bRStudentChapterServiceImpl
.
save
(
brStudentChapterDto
,
curUser
)
);
}
}
src/main/java/org/rcisoft/business/brstudentchapter/service/BRStudentChapterService.java
View file @
bdab4573
package
org
.
rcisoft
.
business
.
brstudentchapter
.
service
;
import
org.rcisoft.business.blesson.entity.BLessonPerson
;
import
org.rcisoft.business.brstudentchapter.dto.BRStudentChapterDto
;
import
org.rcisoft.business.brstudentchapter.entity.BRStudentChapter
;
import
org.rcisoft.core.model.PersistModel
;
...
...
@@ -18,7 +19,7 @@ public interface BRStudentChapterService {
* @param bRStudentChapter
* @return
*/
PersistModel
save
(
BRStudentChapterDto
bRStudentChapter
,
CurUser
curUser
);
String
save
(
BRStudentChapterDto
bRStudentChapter
,
CurUser
curUser
);
/**
* 根据id查询
...
...
src/main/java/org/rcisoft/business/brstudentchapter/service/impl/BRStudentChapterServiceImpl.java
View file @
bdab4573
...
...
@@ -65,8 +65,9 @@ public class BRStudentChapterServiceImpl implements BRStudentChapterService {
*/
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
isolation
=
Isolation
.
DEFAULT
)
@Override
public
PersistModel
save
(
BRStudentChapterDto
brStudentChapterDto
,
CurUser
curUser
){
public
String
save
(
BRStudentChapterDto
brStudentChapterDto
,
CurUser
curUser
){
int
line
=
0
;
String
currentProgress
=
""
;
NumberFormat
numberFormat
=
NumberFormat
.
getInstance
();
numberFormat
.
setMaximumFractionDigits
(
0
);
// 查詢是否已經開始觀看此章節
...
...
@@ -78,12 +79,14 @@ public class BRStudentChapterServiceImpl implements BRStudentChapterService {
// 判断进度 是否大于数据库已经存在的进度
double
now
=
brStudentChapter
.
getProgress
();
if
(
now
>=
old
){
// 进度大于以前的进度
currentProgress
=
(
now
*
100
)+
"%"
;
if
(
brStudentChapterDto
.
getMaxPosition
()
!=
null
){
brStudentChapter
.
setMaxPosition
(
brStudentChapterDto
.
getMaxPosition
());
}
line
=
bRStudentChapterRepository
.
updateById
(
brStudentChapter
);
}
else
{
// 反之,只需更新最近看的时间
brStudentChapter
.
setProgress
(
old
);
currentProgress
=
(
old
*
100
)+
"%"
;
line
=
bRStudentChapterRepository
.
updateById
(
brStudentChapter
);
}
}
else
{
// 更新
...
...
@@ -128,9 +131,10 @@ public class BRStudentChapterServiceImpl implements BRStudentChapterService {
totalProgress
=
tempTotalProgress
>
100
?
"100%"
:
tempTotalProgress
<
0
?
"0%"
:
tempTotalProgress
+
"%"
;
// totalProgress = tempTotalProgress + "%";
};
BLessonPerson
bLessonPerson
=
new
BLessonPerson
();
// 判斷是否已經開始觀看此課程
if
(
null
!=
bLessonPersonList
&&
bLessonPersonList
.
size
()
>
0
&&
bLessonPersonList
.
get
(
0
)
!=
null
){
BLessonPerson
bLessonPerson
=
this
.
dealBLessonPerson
(
bLessonPersonList
.
get
(
0
),
brStudentChapterDto
,
totalProgress
);
bLessonPerson
=
this
.
dealBLessonPerson
(
bLessonPersonList
.
get
(
0
),
brStudentChapterDto
,
totalProgress
);
//TODO 判断是否为已学完 曾经是否学完过 奖励积分
BLesson
bLesson
=
bLessonRepository
.
selectByPrimaryKey
(
brStudentChapterDto
.
getLessonId
());
if
(
bLesson
!=
null
&&
"2"
.
equals
(
bLessonPerson
.
getIsFinish
())
&&
!(
"1"
.
equals
(
bLessonPerson
.
getEverFinished
()))){
...
...
@@ -141,7 +145,7 @@ public class BRStudentChapterServiceImpl implements BRStudentChapterService {
}
bLessonPersonRepository
.
updateByPrimaryKeySelective
(
bLessonPerson
);
}
else
{
BLessonPerson
bLessonPerson
=
new
BLessonPerson
();
bLessonPerson
.
initModel
();
bLessonPerson
=
this
.
dealBLessonPerson
(
bLessonPerson
,
brStudentChapterDto
,
totalProgress
);
bLessonPerson
.
setPersonId
(
brStudentChapterDto
.
getStudentId
());
...
...
@@ -163,7 +167,7 @@ public class BRStudentChapterServiceImpl implements BRStudentChapterService {
bChapter
.
setCourseTime
(
brStudentChapterDto
.
getDuration
().
toString
());
line
=
bChapterRepository
.
updateByPrimaryKeySelective
(
bChapter
)
>
line
?
bChapterRepository
.
updateByPrimaryKeySelective
(
bChapter
):
line
;
}
return
new
PersistModel
(
line
)
;
return
currentProgress
;
}
// b_r_student_chapter
...
...
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