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
b6c166dc
Commit
b6c166dc
authored
Oct 26, 2019
by
zhangqingle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改接口
parent
8bfce930
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
74 additions
and
31 deletions
+74
-31
BTrainFileRepository.java
.../org/rcisoft/business/bfile/dao/BTrainFileRepository.java
+2
-2
BHotRepository.java
...java/org/rcisoft/business/blesson/dao/BHotRepository.java
+5
-1
BViewrangeRepository.java
...rg/rcisoft/business/blesson/dao/BViewrangeRepository.java
+7
-0
BLessonPersonServiceImpl.java
...siness/blesson/service/impl/BLessonPersonServiceImpl.java
+5
-2
BLessonServiceImpl.java
...oft/business/blesson/service/impl/BLessonServiceImpl.java
+55
-26
No files found.
src/main/java/org/rcisoft/business/bfile/dao/BTrainFileRepository.java
View file @
b6c166dc
...
...
@@ -42,12 +42,12 @@ public interface BTrainFileRepository extends BaseMapper<BTrainFile> {
@Insert
(
"<script>INSERT INTO b_train_file "
+
"(create_date,create_by,update_date,update_by,"
+
"del_flag,flag,business_id,remarks, "
+
"lesson_id,file_name,video_url,file_url,file_size,type)VALUES"
+
"lesson_id,file_name,video_url,file_url,file_size,type
,sort
)VALUES"
+
"<foreach collection=\"param\" item=\"item\" separator=\",\">"
+
"(#{item.createDate},#{item.createBy},#{item.updateDate},#{item.updateBy},"
+
"#{item.delFlag},#{item.flag},#{item.businessId},#{item.remarks},"
+
"#{item.lessonId},#{item.fileName},#{item.videoUrl},#{item.fileUrl},"
+
"#{item.fileSize},#{item.type})"
+
"#{item.fileSize},#{item.type}
,#{item.sort}
)"
+
"</foreach></script>"
)
int
insertTrainFileList
(
@Param
(
"param"
)
List
<
BTrainFile
>
param
);
...
...
src/main/java/org/rcisoft/business/blesson/dao/BHotRepository.java
View file @
b6c166dc
package
org
.
rcisoft
.
business
.
blesson
.
dao
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Select
;
import
org.rcisoft.business.blesson.entity.BHot
;
import
org.rcisoft.core.base.BaseMapper
;
import
org.springframework.stereotype.Repository
;
...
...
@@ -12,7 +14,9 @@ import org.springframework.stereotype.Repository;
@Repository
public
interface
BHotRepository
extends
BaseMapper
<
BHot
>
{
@Select
(
"<script>select count(1) from b_hot where person_id=#{userId} and lesson_id = #{lessonId} "
+
"</script>"
)
int
selectCountByPersonId
(
@Param
(
"userId"
)
String
userId
,
@Param
(
"lessonId"
)
String
lessonId
);
}
src/main/java/org/rcisoft/business/blesson/dao/BViewrangeRepository.java
View file @
b6c166dc
...
...
@@ -82,5 +82,12 @@ public interface BViewrangeRepository extends BaseMapper<BViewrange> {
"</script>"
)
List
<
BViewRangeSonDTO
>
selectPersonByLessonId
(
@Param
(
"corpId"
)
String
corpId
,
@Param
(
"lessonId"
)
String
lessonId
);
@Select
(
"<script>select * from b_viewrange "
+
" where 1=1 "
+
" and lesson_id = #{lessonId} "
+
"</script>"
)
@ResultMap
(
value
=
"BaseResultMap"
)
List
<
BViewrange
>
selectByLessonId
(
String
lessonId
);
}
src/main/java/org/rcisoft/business/blesson/service/impl/BLessonPersonServiceImpl.java
View file @
b6c166dc
...
...
@@ -201,8 +201,11 @@ public class BLessonPersonServiceImpl implements BLessonPersonService {
// return new PersistModel(line);
// }
//添加至b_hot表 并重新同级热度
bHotRepository
.
insertSelective
(
new
BHot
(
IdGen
.
uuid
(),
addMyLearnLessonDTO
.
getUserId
(),
addMyLearnLessonDTO
.
getLessonId
()));
bLessonRepository
.
hotNumberReCount
(
addMyLearnLessonDTO
.
getLessonId
());
int
count
=
bHotRepository
.
selectCountByPersonId
(
addMyLearnLessonDTO
.
getUserId
(),
addMyLearnLessonDTO
.
getLessonId
());
if
(
count
<
1
){
bHotRepository
.
insertSelective
(
new
BHot
(
IdGen
.
uuid
(),
addMyLearnLessonDTO
.
getUserId
(),
addMyLearnLessonDTO
.
getLessonId
()));
bLessonRepository
.
hotNumberReCount
(
addMyLearnLessonDTO
.
getLessonId
());
}
return
new
PersistModel
(
1
);
}
}
src/main/java/org/rcisoft/business/blesson/service/impl/BLessonServiceImpl.java
View file @
b6c166dc
...
...
@@ -120,12 +120,13 @@ public class BLessonServiceImpl implements BLessonService {
bLesson
.
setViewRangeDepartList
(
selectDepartByLessonIds
);
}
//客户端 手机端 每次点击插入热度表 并重新统计课程热度
// if ("1".equals(bLesson.getIsCollect())){
bHotRepository
.
insertSelective
(
new
BHot
(
IdGen
.
uuid
(),
curUser
.
getUserId
(),
bLesson
.
getBusinessId
()));
bLessonRepository
.
hotNumberReCount
(
bLesson
.
getBusinessId
());
// }
// 每次点击插入热度表 并重新统计课程热度
int
count
=
bHotRepository
.
selectCountByPersonId
(
curUser
.
getUserId
(),
lessonId
);
if
(
count
<
1
){
bHotRepository
.
insertSelective
(
new
BHot
(
IdGen
.
uuid
(),
curUser
.
getUserId
(),
bLesson
.
getBusinessId
()));
bLessonRepository
.
hotNumberReCount
(
bLesson
.
getBusinessId
());
}
return
bLesson
;
}
...
...
@@ -267,7 +268,7 @@ public class BLessonServiceImpl implements BLessonService {
line
=
bLessonRepository
.
insertSelective
(
model
);
//添加可见范围
if
(
StringUtils
.
isNotEmpty
(
model
.
getViewRangePerson
())
||
StringUtils
.
isNotEmpty
(
model
.
getViewRangeDepart
()))
{
BViewrange
bViewrange
=
setBViewrangeInfo
(
model
);
BViewrange
bViewrange
=
setBViewrangeInfo
(
model
,
null
);
//插入可见范围表
bViewrangeRepository
.
insertSelective
(
bViewrange
);
//插入可见范围子表
...
...
@@ -282,7 +283,9 @@ public class BLessonServiceImpl implements BLessonService {
bViewrangeSons
=
addBViewrangeSon
(
bViewrangeSons
,
viewRangeDepart
,
"1"
,
bViewrange
.
getBusinessId
());
}
//插入子表
bViewrangeRepository
.
insertBViewrangeSons
(
bViewrangeSons
);
if
(
bViewrangeSons
!=
null
&&
bViewrangeSons
.
size
()>
0
){
bViewrangeRepository
.
insertBViewrangeSons
(
bViewrangeSons
);
}
}
//添加课程标签表
...
...
@@ -296,12 +299,21 @@ public class BLessonServiceImpl implements BLessonService {
line
=
bLessonRepository
.
updateByPrimaryKeySelective
(
model
);
if
(
StringUtils
.
isNotEmpty
(
model
.
getViewRangePerson
())
||
StringUtils
.
isNotEmpty
(
model
.
getViewRangeDepart
()))
{
BViewrange
bViewrange
=
setBViewrangeInfo
(
model
);
//更新可见范围表
bViewrangeRepository
.
updateByLessonId
(
bViewrange
);
//删除可见范围子表
bViewrangeRepository
.
deleteViewrangeSon
(
bViewrange
);
BViewrange
bViewrange
=
new
BViewrange
();
List
<
BViewrange
>
bViewranges
=
bViewrangeRepository
.
selectByLessonId
(
model
.
getBusinessId
());
if
(
bViewranges
!=
null
&&
bViewranges
.
size
()
>
0
){
bViewrange
=
bViewranges
.
get
(
0
);
bViewrange
=
setBViewrangeInfo
(
model
,
bViewrange
);
//更新可见范围表
bViewrangeRepository
.
updateByLessonId
(
bViewrange
);
//删除可见范围子表
bViewrangeRepository
.
deleteViewrangeSon
(
bViewrange
);
}
if
(
bViewranges
==
null
||
bViewranges
.
size
()
<
1
){
bViewrange
=
setBViewrangeInfo
(
model
,
null
);
//添加可见范围表
bViewrangeRepository
.
insertSelective
(
bViewrange
);
}
//获取所有可见人员和部门
List
<
BViewrangeSon
>
bViewrangeSons
=
new
ArrayList
<>();
...
...
@@ -311,12 +323,22 @@ public class BLessonServiceImpl implements BLessonService {
String
[]
viewRangePerson
=
model
.
getViewRangePerson
().
split
(
","
);
bViewrangeSons
=
addBViewrangeSon
(
bViewrangeSons
,
viewRangePerson
,
"0"
,
bViewrange
.
getBusinessId
());
}
if
(
StringUtils
.
isNotEmpty
(
model
.
getViewRange
Person
()))
{
if
(
StringUtils
.
isNotEmpty
(
model
.
getViewRange
Depart
()))
{
String
[]
viewRangeDepart
=
model
.
getViewRangeDepart
().
split
(
","
);
bViewrangeSons
=
addBViewrangeSon
(
bViewrangeSons
,
viewRangeDepart
,
"1"
,
bViewrange
.
getBusinessId
());
}
//插入子表
bViewrangeRepository
.
insertBViewrangeSons
(
bViewrangeSons
);
if
(
bViewrangeSons
!=
null
&&
bViewrangeSons
.
size
()>
0
){
bViewrangeRepository
.
insertBViewrangeSons
(
bViewrangeSons
);
}
}
else
{
//可见范围设为空 所有人员均可见
List
<
BViewrange
>
bViewranges
=
bViewrangeRepository
.
selectByLessonId
(
model
.
getBusinessId
());
//删除可见范围子表
if
(
bViewranges
!=
null
&&
bViewranges
.
size
()>
0
){
bViewrangeRepository
.
deleteByPrimaryKey
(
bViewranges
.
get
(
0
));
bViewrangeRepository
.
deleteViewrangeSon
(
bViewranges
.
get
(
0
));
}
}
bLessonRepository
.
removeLabelByLessonId
(
model
);
...
...
@@ -823,14 +845,16 @@ public class BLessonServiceImpl implements BLessonService {
if
(
recommendIds
==
null
||
recommendIds
.
size
()
<
1
)
{
throw
new
ServiceException
(
ResultServiceEnums
.
NOT_RECOMMEND
);
}
//
修改
推荐表
//
删除
推荐表
BRecommend
bRecommend
=
new
BRecommend
();
bRecommend
.
setLessonId
(
lessonId
);
UserUtil
.
setCurrentMergeOperation
(
bRecommend
);
//
bRecommend.setLessonId(lessonId);
//
UserUtil.setCurrentMergeOperation(bRecommend);
bRecommend
.
setBusinessId
(
recommendIds
.
get
(
0
));
bRecommend
.
setDelFlag
(
"1"
);
int
line
=
bRecommendRepository
.
updateByPrimaryKeySelective
(
bRecommend
);
int
line
=
bRecommendRepository
.
deleteByPrimaryKey
(
bRecommend
);
// bRecommend.setDelFlag("1");
// int line = bRecommendRepository.updateByPrimaryKeySelective(bRecommend);
//删除推荐子表内容
bRecommendRepository
.
deleteRecommendSon
(
bRecommend
);
return
new
PersistModel
(
line
);
}
...
...
@@ -1031,11 +1055,16 @@ public class BLessonServiceImpl implements BLessonService {
}
//设置BViewrange信息
BViewrange
setBViewrangeInfo
(
BLesson
model
)
{
BViewrange
bViewrange
=
new
BViewrange
();
UserUtil
.
setCurrentPersistOperation
(
bViewrange
);
//设置课程id
bViewrange
.
setLessonId
(
model
.
getBusinessId
());
BViewrange
setBViewrangeInfo
(
BLesson
model
,
BViewrange
bViewrange
)
{
if
(
bViewrange
==
null
){
bViewrange
=
new
BViewrange
();
UserUtil
.
setCurrentPersistOperation
(
bViewrange
);
//设置课程id
bViewrange
.
setLessonId
(
model
.
getBusinessId
());
}
else
{
UserUtil
.
setCurrentMergeOperation
(
bViewrange
);
}
//设置可见范围类型(0仅人 1仅部门 2人和部门)
if
(
StringUtils
.
isNotEmpty
(
model
.
getViewRangePerson
())
&&
StringUtils
.
isEmpty
(
model
.
getViewRangeDepart
()))
{
...
...
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