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
c97e8310
Commit
c97e8310
authored
Oct 18, 2019
by
luzhuang
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/meiteng' into meiteng
parents
7b238578
88d4cb10
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
167 additions
and
33 deletions
+167
-33
BChapterRepository.java
...org/rcisoft/business/bchapter/dao/BChapterRepository.java
+14
-0
BChapterServiceImpl.java
...t/business/bchapter/service/impl/BChapterServiceImpl.java
+13
-4
BLessonPersonRepository.java
...rcisoft/business/blesson/dao/BLessonPersonRepository.java
+6
-1
BLessonRepository.java
...a/org/rcisoft/business/blesson/dao/BLessonRepository.java
+3
-0
BLessonPerson.java
...va/org/rcisoft/business/blesson/entity/BLessonPerson.java
+4
-0
BLessonPersonServiceImpl.java
...siness/blesson/service/impl/BLessonPersonServiceImpl.java
+1
-1
BLessonServiceImpl.java
...oft/business/blesson/service/impl/BLessonServiceImpl.java
+77
-17
BRStudentChapterDto.java
...ft/business/brstudentchapter/dto/BRStudentChapterDto.java
+2
-0
BRStudentChapter.java
...ft/business/brstudentchapter/entity/BRStudentChapter.java
+3
-1
BRStudentChapterServiceImpl.java
...dentchapter/service/impl/BRStudentChapterServiceImpl.java
+41
-8
BLessonPersonMapper.xml
...es/mapper/business/blesson/mapper/BLessonPersonMapper.xml
+1
-0
BRStudentChapterMapper.xml
...siness/brstudentChapter/mapper/BRStudentChapterMapper.xml
+2
-1
No files found.
src/main/java/org/rcisoft/business/bchapter/dao/BChapterRepository.java
View file @
c97e8310
...
...
@@ -407,5 +407,19 @@ public interface BChapterRepository extends BaseMapper<BChapter> {
//
//
// int insertBChapter(BChapter model);
@Select
(
"<script>"
+
"SELECT bc.* \n"
+
"FROM\n"
+
"\tb_lesson_person bp\n"
+
"\tLEFT JOIN b_lesson b ON bp.lesson_id = b.business_id\n"
+
"\tLEFT JOIN b_chapter bc ON bc.business_id = bp.chapter_id \n"
+
"WHERE\n"
+
"\tbp.chapter_id IS NOT NULL \n"
+
"\tAND bp.chapter_id != '' \n"
+
"\tAND b.business_id = #{lessonId} "
+
"</script>"
)
@ResultMap
(
value
=
"BaseResultMap"
)
BChapter
getWithCurrentChapterBylessonId
(
@Param
(
"lessonId"
)
String
lessonId
);
}
src/main/java/org/rcisoft/business/bchapter/service/impl/BChapterServiceImpl.java
View file @
c97e8310
...
...
@@ -14,10 +14,12 @@ import org.rcisoft.business.bchapter.service.BChapterService;
import
org.rcisoft.business.bchapter.vo.StudentChapterScoreVO
;
import
org.rcisoft.business.bfile.dto.uploadDTO
;
import
org.rcisoft.business.bfile.util.GetVideoTime
;
import
org.rcisoft.business.blesson.dao.BLessonPersonRepository
;
import
org.rcisoft.business.blesson.dao.BLessonRepository
;
import
org.rcisoft.business.blesson.entity.BLesson
;
import
org.rcisoft.business.bfile.dao.BFileRepository
;
import
org.rcisoft.business.bfile.entity.BFile
;
import
org.rcisoft.business.blesson.entity.BLessonPerson
;
import
org.rcisoft.business.bmaterial.dao.BMaterialRepository
;
import
org.rcisoft.business.bmaterial.entity.BMaterial
;
import
org.rcisoft.business.brstudentchapter.dao.BRStudentChapterRepository
;
...
...
@@ -69,6 +71,8 @@ public class BChapterServiceImpl implements BChapterService {
private
Global
global
;
@Autowired
BRStudentChapterRepository
brStudentChapterRepository
;
@Autowired
BLessonPersonRepository
bLessonPersonRepository
;
@Override
public
BChapter
selectOne
(
String
businessId
)
{
...
...
@@ -103,11 +107,11 @@ public class BChapterServiceImpl implements BChapterService {
int
percent
=
0
;
for
(
QueryChapterListResDTO
queryChapterListResDTO:
queryChapterListResDTOS
){
for
(
QueryChapterListResDTO
childList:
queryChapterListResDTO
.
getChildList
()){
// 遍历学生章节中间表 查询学生观看章节进度
List
<
BRStudentChapter
>
brStudentChapterList
=
brStudentChapterRepository
.
queryByStuIdAndChapter
(
childList
.
getBusinessId
(),
curUser
.
getUserId
());
if
(
null
!=
brStudentChapterList
&&
brStudentChapterList
.
size
()
>
0
)
{
childList
.
setProgress
(
brStudentChapterList
.
get
(
0
).
getProgress
());
String
temp
=
brStudentChapterList
.
get
(
0
).
getProgress
().
substring
(
0
,
brStudentChapterList
.
get
(
0
).
getProgress
().
length
()-
1
);
percent
+=
Float
.
valueOf
(
temp
);
childList
.
setProgress
(
brStudentChapterList
.
get
(
0
).
getProgress
()*
100
+
"%"
);
percent
+=
brStudentChapterList
.
get
(
0
).
getProgress
();
}
i
++;
}
...
...
@@ -124,7 +128,12 @@ public class BChapterServiceImpl implements BChapterService {
DecimalFormat
df
=
new
DecimalFormat
(
"0.00"
);
//设置保留位数
map
.
put
(
"chapterList"
,
queryChapterListResDTOS
);
map
.
put
(
"totalProgress"
,
df
.
format
((
float
)
percent
/
i
)
+
"%"
);
map
.
put
(
"lessonInfo"
,
bLessonRepository
.
selectByPrimaryKey
(
model
.
getLessonId
()));
map
.
put
(
"lessonInfo"
,
bLessonRepository
.
selectByPrimaryKey
(
lessonId
));
// 课程信息
BLessonPerson
bLessonPerson
=
bLessonPersonRepository
.
selectByPrimaryKey
(
lessonId
);
if
(
null
!=
bLessonPerson
){
}
map
.
put
(
"currentChapter"
,
bChapterRepository
.
getWithCurrentChapterBylessonId
(
lessonId
));
return
map
;
}
...
...
src/main/java/org/rcisoft/business/blesson/dao/BLessonPersonRepository.java
View file @
c97e8310
...
...
@@ -39,7 +39,7 @@ public interface BLessonPersonRepository extends BaseMapper<BLessonPerson> {
// 退出课程
@Update
(
"update b_lesson_person set
flag = 0
where business_id = #{id}"
)
@Update
(
"update b_lesson_person set
del_flag = 1
where business_id = #{id}"
)
int
quit
(
String
id
);
//查询线上课程学员追踪图表
...
...
@@ -232,4 +232,9 @@ public interface BLessonPersonRepository extends BaseMapper<BLessonPerson> {
" #{param.isAppoint}) "
+
"</script>"
)
int
insertBLessonPerson
(
@Param
(
"param"
)
BLessonPerson
param
);
@Select
(
"<script>select * from b_lesson_person where 1=1 "
+
"and business_id = #{businessId}</script>"
)
@ResultMap
(
value
=
"BaseResultMap"
)
BLessonPerson
selectById
(
String
businessId
);
}
src/main/java/org/rcisoft/business/blesson/dao/BLessonRepository.java
View file @
c97e8310
package
org
.
rcisoft
.
business
.
blesson
.
dao
;
import
org.apache.ibatis.annotations.*
;
import
org.rcisoft.business.bchapter.entity.BChapter
;
import
org.rcisoft.business.blabel.dto.QueryLabelResDTO
;
import
org.rcisoft.business.blesson.dto.*
;
import
org.rcisoft.business.blesson.entity.BLesson
;
...
...
@@ -843,6 +844,8 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
@Select
(
"<script>"
+
"SELECT * FROM `b_recommend` where type = 0 and corp_id = #{corpId} and lesson_id = #{lessonId} "
+
"</script>"
)
@ResultMap
(
value
=
"BaseResultMap"
)
List
<
BRecommend
>
queryRecommendByLessonId
(
@Param
(
"corpId"
)
String
corpId
,
@Param
(
"lessonId"
)
String
lessonId
);
}
src/main/java/org/rcisoft/business/blesson/entity/BLessonPerson.java
View file @
c97e8310
...
...
@@ -52,6 +52,10 @@ public class BLessonPerson extends IdEntity<BLessonPerson> {
@Length
(
min
=
1
,
max
=
1
,
message
=
"长度最小为1,最大为1"
)
private
String
appointId
;
@ApiModelProperty
(
value
=
"章節id"
)
@Length
(
min
=
1
,
max
=
1
,
message
=
"长度最小为1,最大为1"
)
private
String
chapterId
;
// @ApiModelProperty(value = "是否开始")
// @Length(min = 1,max = 1,message = "长度最小为1,最大为1")
// private String startFlag;
...
...
src/main/java/org/rcisoft/business/blesson/service/impl/BLessonPersonServiceImpl.java
View file @
c97e8310
...
...
@@ -45,7 +45,7 @@ public class BLessonPersonServiceImpl implements BLessonPersonService {
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
readOnly
=
false
)
@Override
public
PersistModel
quit
(
QuitLessonDTO
quitLessonDTO
)
{
BLessonPerson
bLessonPerson
=
bLessonPersonRepository
.
selectBy
PrimaryKey
(
quitLessonDTO
.
getBusinessId
());
BLessonPerson
bLessonPerson
=
bLessonPersonRepository
.
selectBy
Id
(
quitLessonDTO
.
getBusinessId
());
if
(
"1"
.
equals
(
bLessonPerson
.
getIsAppoint
())){
throw
new
ServiceException
(
ResultExceptionEnum
.
APPOINT_NOT_CLOSE
);
}
...
...
src/main/java/org/rcisoft/business/blesson/service/impl/BLessonServiceImpl.java
View file @
c97e8310
...
...
@@ -69,14 +69,14 @@ public class BLessonServiceImpl implements BLessonService {
//获取部门(目前写死)
private
List
<
String
>
getDeparts
(){
List
<
String
>
departs
=
new
ArrayList
<>();
departs
.
add
(
"1"
);
departs
.
add
(
"2"
);
departs
.
add
(
"3"
);
return
departs
;
}
//
//获取部门(目前写死)
//
private List<String> getDeparts(){
//
List<String> departs = new ArrayList<>();
//
departs.add("1");
//
departs.add("2");
//
departs.add("3");
//
return departs;
//
}
...
...
@@ -114,7 +114,19 @@ public class BLessonServiceImpl implements BLessonService {
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
readOnly
=
false
)
public
List
<
BLesson
>
queryPersonMoreByPagination
(
PageUtil
pageUtil
,
CurUser
curUser
)
{
//---------获取部门id------------
List
<
String
>
departs
=
getDeparts
();
// List<String> departs = getDeparts();
List
<
String
>
departs
=
new
ArrayList
<>();
List
<
String
>
ids
=
Arrays
.
asList
(
new
String
[]{
curUser
.
getUserId
()});
MTUserGetsReqDTO
mtUserGetsReqDTO
=
new
MTUserGetsReqDTO
();
mtUserGetsReqDTO
.
setCorpId
(
curUser
.
getCorpId
());
mtUserGetsReqDTO
.
setIds
(
ids
);
List
<
MTUserInfoRspDTO
>
mtUserInfoRspDTOList
=
cotactApiRequestClient
.
userGets
(
mtUserGetsReqDTO
);
mtUserInfoRspDTOList
.
forEach
(
mtUserInfoRspDTO
->
{
List
<
MTUserInfoRspDTO
.
DeptsBean
>
deptsBeans
=
mtUserInfoRspDTO
.
getDepts
();
deptsBeans
.
forEach
(
deptsBean
->
{
departs
.
addAll
(
Arrays
.
asList
(
deptsBean
.
getPid
().
split
(
","
)));
});
});
//------------------------------
return
bLessonRepository
.
queryPersonMore
(
curUser
,
departs
);
}
...
...
@@ -142,7 +154,19 @@ public class BLessonServiceImpl implements BLessonService {
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
readOnly
=
false
)
public
List
<
BLesson
>
queryConcernByPagination
(
PageUtil
pageUtil
,
CurUser
curUser
)
{
//---------获取部门id------------
List
<
String
>
departs
=
getDeparts
();
// List<String> departs = getDeparts();
List
<
String
>
departs
=
new
ArrayList
<>();
List
<
String
>
ids
=
Arrays
.
asList
(
new
String
[]{
curUser
.
getUserId
()});
MTUserGetsReqDTO
mtUserGetsReqDTO
=
new
MTUserGetsReqDTO
();
mtUserGetsReqDTO
.
setCorpId
(
curUser
.
getCorpId
());
mtUserGetsReqDTO
.
setIds
(
ids
);
List
<
MTUserInfoRspDTO
>
mtUserInfoRspDTOList
=
cotactApiRequestClient
.
userGets
(
mtUserGetsReqDTO
);
mtUserInfoRspDTOList
.
forEach
(
mtUserInfoRspDTO
->
{
List
<
MTUserInfoRspDTO
.
DeptsBean
>
deptsBeans
=
mtUserInfoRspDTO
.
getDepts
();
deptsBeans
.
forEach
(
deptsBean
->
{
departs
.
addAll
(
Arrays
.
asList
(
deptsBean
.
getPid
().
split
(
","
)));
});
});
//------------------------------
return
bLessonRepository
.
queryConcern
(
curUser
,
departs
);
}
...
...
@@ -151,7 +175,19 @@ public class BLessonServiceImpl implements BLessonService {
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
readOnly
=
false
)
public
List
<
BLesson
>
queryInterestedByPagination
(
PageUtil
pageUtil
,
CurUser
curUser
)
{
//---------获取部门id------------
List
<
String
>
departs
=
getDeparts
();
// List<String> departs = getDeparts();
List
<
String
>
departs
=
new
ArrayList
<>();
List
<
String
>
ids
=
Arrays
.
asList
(
new
String
[]{
curUser
.
getUserId
()});
MTUserGetsReqDTO
mtUserGetsReqDTO
=
new
MTUserGetsReqDTO
();
mtUserGetsReqDTO
.
setCorpId
(
curUser
.
getCorpId
());
mtUserGetsReqDTO
.
setIds
(
ids
);
List
<
MTUserInfoRspDTO
>
mtUserInfoRspDTOList
=
cotactApiRequestClient
.
userGets
(
mtUserGetsReqDTO
);
mtUserInfoRspDTOList
.
forEach
(
mtUserInfoRspDTO
->
{
List
<
MTUserInfoRspDTO
.
DeptsBean
>
deptsBeans
=
mtUserInfoRspDTO
.
getDepts
();
deptsBeans
.
forEach
(
deptsBean
->
{
departs
.
addAll
(
Arrays
.
asList
(
deptsBean
.
getPid
().
split
(
","
)));
});
});
//------------------------------
return
bLessonRepository
.
queryInterested
(
curUser
,
departs
);
}
...
...
@@ -259,7 +295,19 @@ public class BLessonServiceImpl implements BLessonService {
@Override
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
readOnly
=
false
)
public
List
<
BLesson
>
queryHomeBLessonsByPagination
(
PageUtil
pageUtil
,
FirstPageQueryDTO
firstPageQueryDTO
,
List
<
AllCourseDTO
>
allCourse
)
{
List
<
String
>
departs
=
getDeparts
();
// List<String> departs = getDeparts();
List
<
String
>
departs
=
new
ArrayList
<>();
List
<
String
>
ids
=
Arrays
.
asList
(
new
String
[]{
firstPageQueryDTO
.
getUserId
()});
MTUserGetsReqDTO
mtUserGetsReqDTO
=
new
MTUserGetsReqDTO
();
mtUserGetsReqDTO
.
setCorpId
(
firstPageQueryDTO
.
getCorpId
());
mtUserGetsReqDTO
.
setIds
(
ids
);
List
<
MTUserInfoRspDTO
>
mtUserInfoRspDTOList
=
cotactApiRequestClient
.
userGets
(
mtUserGetsReqDTO
);
mtUserInfoRspDTOList
.
forEach
(
mtUserInfoRspDTO
->
{
List
<
MTUserInfoRspDTO
.
DeptsBean
>
deptsBeans
=
mtUserInfoRspDTO
.
getDepts
();
deptsBeans
.
forEach
(
deptsBean
->
{
departs
.
addAll
(
Arrays
.
asList
(
deptsBean
.
getPid
().
split
(
","
)));
});
});
firstPageQueryDTO
.
setDeparts
(
departs
);
List
<
String
>
courseIds
=
null
;
if
(
allCourse
!=
null
){
...
...
@@ -358,15 +406,15 @@ public class BLessonServiceImpl implements BLessonService {
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
readOnly
=
false
)
public
List
<
FindLessonRecommendRspDTO
>
queryRecommendByLessonId
(
FindLessonRecommendDTO
param
)
{
//按部门名模糊查询部门id(list)------
if
(
StringUtils
.
isEmpty
(
param
.
getViewParam
())){
param
.
setViewParam
(
""
);
}
//
if (StringUtils.isEmpty(param.getViewParam())){
//
param.setViewParam("");
//
}
List
<
DeptGetRspDTO
>
departs
=
cotactApiRequestClient
.
deptListDeptInfoByName
(
param
.
getCorpId
(),
param
.
getViewParam
());
//查询结果放入DTO中
param
.
setDeparts
(
departs
);
//查询该课程推荐的所有人
List
<
FindLessonRecommendRspDTO
>
findLessonPersonRecommend
=
bRecommendRepository
.
queryRecommendPersonByLessonId
(
param
);
//查询该课程推荐的所有部门
List
<
FindLessonRecommendRspDTO
>
findLessonDepartRecommend
=
bRecommendRepository
.
queryRecommendDepartByLessonId
(
param
);
if
(
departs
!=
null
&&
departs
.
size
()
>
0
&&
findLessonDepartRecommend
!=
null
&&
findLessonDepartRecommend
.
size
()
>
0
){
...
...
@@ -473,7 +521,19 @@ public class BLessonServiceImpl implements BLessonService {
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
readOnly
=
false
)
public
List
<
BLesson
>
queryListAllLessonByPagination
(
PageUtil
pageUtil
,
FindListLessonDTO
model
,
List
<
AllCourseDTO
>
allCourse
)
{
//---------获取部门------------
List
<
String
>
departs
=
getDeparts
();
// List<String> departs = getDeparts();
List
<
String
>
departs
=
new
ArrayList
<>();
List
<
String
>
ids
=
Arrays
.
asList
(
new
String
[]{
model
.
getUserId
()});
MTUserGetsReqDTO
mtUserGetsReqDTO
=
new
MTUserGetsReqDTO
();
mtUserGetsReqDTO
.
setCorpId
(
model
.
getCorpId
());
mtUserGetsReqDTO
.
setIds
(
ids
);
List
<
MTUserInfoRspDTO
>
mtUserInfoRspDTOList
=
cotactApiRequestClient
.
userGets
(
mtUserGetsReqDTO
);
mtUserInfoRspDTOList
.
forEach
(
mtUserInfoRspDTO
->
{
List
<
MTUserInfoRspDTO
.
DeptsBean
>
deptsBeans
=
mtUserInfoRspDTO
.
getDepts
();
deptsBeans
.
forEach
(
deptsBean
->
{
departs
.
addAll
(
Arrays
.
asList
(
deptsBean
.
getPid
().
split
(
","
)));
});
});
//----------------------------
model
.
setDeparts
(
departs
);
List
<
String
>
courseIds
;
...
...
src/main/java/org/rcisoft/business/brstudentchapter/dto/BRStudentChapterDto.java
View file @
c97e8310
...
...
@@ -20,6 +20,8 @@ public class BRStudentChapterDto {
private
String
studentId
;
private
String
lessonId
;
private
String
progress
;
private
Integer
current
;
...
...
src/main/java/org/rcisoft/business/brstudentchapter/entity/BRStudentChapter.java
View file @
c97e8310
...
...
@@ -41,7 +41,9 @@ public class BRStudentChapter {
private
String
paperFinish
;
private
String
progress
;
private
double
progress
;
private
int
currentLocation
;
}
...
...
src/main/java/org/rcisoft/business/brstudentchapter/service/impl/BRStudentChapterServiceImpl.java
View file @
c97e8310
package
org
.
rcisoft
.
business
.
brstudentchapter
.
service
.
impl
;
import
org.apache.commons.lang3.StringUtils
;
import
org.rcisoft.business.blesson.dao.BLessonPersonRepository
;
import
org.rcisoft.business.blesson.dto.AddMyLearnLessonDTO
;
import
org.rcisoft.business.blesson.entity.BLesson
;
import
org.rcisoft.business.blesson.entity.BLessonPerson
;
import
org.rcisoft.business.brstudentchapter.dto.BRStudentChapterDto
;
import
org.rcisoft.core.util.IdGen
;
import
org.rcisoft.core.util.UserUtil
;
...
...
@@ -17,6 +22,7 @@ import org.springframework.transaction.annotation.Propagation;
import
org.springframework.transaction.annotation.Transactional
;
import
java.math.BigDecimal
;
import
java.text.BreakIterator
;
import
java.text.DecimalFormat
;
import
java.util.List
;
...
...
@@ -32,7 +38,8 @@ public class BRStudentChapterServiceImpl implements BRStudentChapterService {
@Autowired
private
BRStudentChapterRepository
bRStudentChapterRepository
;
@Autowired
private
BLessonPersonRepository
bLessonPersonRepository
;
/**
* 保存 bRStudentChapter
...
...
@@ -43,30 +50,56 @@ public class BRStudentChapterServiceImpl implements BRStudentChapterService {
@Override
public
PersistModel
save
(
BRStudentChapterDto
brStudentChapterDto
){
int
line
=
0
;
// 查詢是否已經開始觀看此章節的課程
AddMyLearnLessonDTO
addMy
=
new
AddMyLearnLessonDTO
();
addMy
.
setUserId
(
brStudentChapterDto
.
getStudentId
());
addMy
.
setLessonId
(
brStudentChapterDto
.
getLessonId
());
List
<
BLessonPerson
>
bLessonPersonList
=
bLessonPersonRepository
.
selectByPersonAndLesson
(
addMy
);
// 判斷是否已經開始觀看此課程
if
(
null
!=
bLessonPersonList
&&
bLessonPersonList
.
size
()
>
0
){
BLessonPerson
bLessonPerson
=
bLessonPersonList
.
get
(
0
);
bLessonPerson
.
setChapterId
(
brStudentChapterDto
.
getChapterId
());
bLessonPersonRepository
.
updateByPrimaryKeySelective
(
bLessonPerson
);
}
else
{
BLessonPerson
bLessonPerson
=
new
BLessonPerson
();
UserUtil
.
setCurrentPersistOperation
(
bLessonPerson
);
bLessonPerson
.
setChapterId
(
brStudentChapterDto
.
getChapterId
());
bLessonPerson
.
setPersonId
(
brStudentChapterDto
.
getStudentId
());
bLessonPerson
.
setLessonId
(
brStudentChapterDto
.
getLessonId
());
bLessonPersonRepository
.
insertSelective
(
bLessonPerson
);
}
// 查詢是否已經開始觀看此章節
List
<
BRStudentChapter
>
brStudentChapterList
=
bRStudentChapterRepository
.
queryByStuIdAndChapter
(
brStudentChapterDto
.
getChapterId
(),
brStudentChapterDto
.
getStudentId
());
DecimalFormat
df
=
new
DecimalFormat
(
"0.00"
);
//设置保留位数
// 沒有開始看-新增信息
if
(
null
!=
brStudentChapterList
&&
brStudentChapterList
.
size
()
>
0
){
BRStudentChapter
brStudentChapter
=
brStudentChapterList
.
get
(
0
);
brStudentChapter
.
setCurrentLocation
(
brStudentChapterDto
.
getCurrent
());
if
(
brStudentChapterDto
.
getCurrent
()
==
brStudentChapterDto
.
getDuration
()){
// who finish
brStudentChapter
.
setProgress
(
"100%"
);
brStudentChapter
.
setProgress
(
1
);
}
else
{
brStudentChapter
.
setProgress
(
df
.
format
((
float
)
brStudentChapterDto
.
getCurrent
()/
brStudentChapterDto
.
getDuration
()*
100
)+
"%"
);
brStudentChapter
.
setProgress
(
new
BigDecimal
((
float
)
brStudentChapterDto
.
getCurrent
()/
brStudentChapterDto
.
getDuration
()).
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
).
doubleValue
()
);
}
line
=
bRStudentChapterRepository
.
updateById
(
brStudentChapter
);
}
else
{
// 判断进度 是否大于数据库已经存在的进度
double
old
=
brStudentChapterList
.
get
(
0
).
getProgress
();
double
now
=
brStudentChapter
.
getProgress
();
if
(
old
>=
now
){
line
=
bRStudentChapterRepository
.
updateById
(
brStudentChapter
);
}
}
else
{
// 更新
BRStudentChapter
brStudentChapter
=
new
BRStudentChapter
();
brStudentChapter
.
setBusinessId
(
IdGen
.
uuid
());
brStudentChapter
.
setStudentId
(
brStudentChapterDto
.
getStudentId
());
brStudentChapter
.
setChapterId
(
brStudentChapterDto
.
getChapterId
());
brStudentChapter
.
setCurrentLocation
(
brStudentChapterDto
.
getCurrent
());
// 保存當前學習進度
if
(
brStudentChapterDto
.
getCurrent
()
==
brStudentChapterDto
.
getDuration
()){
// 判断是否已经完成
brStudentChapter
.
setIsComplete
(
"1"
);
// brStudentChapter.setAutomatic("1");
brStudentChapter
.
setProgress
(
"100%"
);
brStudentChapter
.
setProgress
(
1
);
}
else
{
brStudentChapter
.
setIsComplete
(
"0"
);
// brStudentChapter.setAutomatic("0");
brStudentChapter
.
setProgress
(
df
.
format
(
brStudentChapterDto
.
getCurrent
()/
brStudentChapterDto
.
getDuration
()*
100
)+
"%"
);
brStudentChapter
.
setProgress
(
new
BigDecimal
((
float
)
brStudentChapterDto
.
getCurrent
()/
brStudentChapterDto
.
getDuration
()).
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
).
doubleValue
()
);
}
line
=
bRStudentChapterRepository
.
insertSelective
(
brStudentChapter
);
}
...
...
src/main/resources/mapper/business/blesson/mapper/BLessonPersonMapper.xml
View file @
c97e8310
...
...
@@ -34,6 +34,7 @@
<result
column=
"is_finish"
jdbcType=
"VARCHAR"
property=
"isFinish"
/>
<result
column=
"is_collect"
jdbcType=
"VARCHAR"
property=
"isCollect"
/>
<result
column=
"appoint_id"
jdbcType=
"VARCHAR"
property=
"appointId"
/>
<result
column=
"chapter_id"
jdbcType=
"VARCHAR"
property=
"chapterId"
/>
<!--<result column="start_flag" jdbcType="VARCHAR" property="startFlag"/>-->
<result
column=
"is_appoint"
jdbcType=
"VARCHAR"
property=
"isAppoint"
/>
</resultMap>
...
...
src/main/resources/mapper/business/brstudentChapter/mapper/BRStudentChapterMapper.xml
View file @
c97e8310
...
...
@@ -12,7 +12,8 @@
<result
column=
"pdf_finish"
jdbcType=
"VARCHAR"
property=
"pdfFinish"
/>
<result
column=
"video_finish"
jdbcType=
"VARCHAR"
property=
"videoFinish"
/>
<result
column=
"paper_finish"
jdbcType=
"VARCHAR"
property=
"paperFinish"
/>
<result
column=
"progress"
jdbcType=
"VARCHAR"
property=
"progress"
/>
<result
column=
"progress"
jdbcType=
"DOUBLE"
property=
"progress"
/>
<result
column=
"current_location"
jdbcType=
"VARCHAR"
property=
"currentLocation"
/>
</resultMap>
<!--<cache type="${corePackag!}.util.RedisCache"/>-->
...
...
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