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
cd4a11f2
Commit
cd4a11f2
authored
Jul 02, 2020
by
luzhuang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 新平台标签显示
parent
0991bb04
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
46 deletions
+50
-46
BLessonRepository.java
...a/org/rcisoft/business/blesson/dao/BLessonRepository.java
+18
-24
BLesson.java
...ain/java/org/rcisoft/business/blesson/entity/BLesson.java
+3
-0
BLessonServiceImpl.java
...oft/business/blesson/service/impl/BLessonServiceImpl.java
+29
-22
No files found.
src/main/java/org/rcisoft/business/blesson/dao/BLessonRepository.java
View file @
cd4a11f2
...
...
@@ -354,39 +354,33 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
/**
* 查询平台推荐课程中的标签
* @param
lessonId
* @param
* @return
*/
@Select
(
"
select * from (
"
+
@Select
(
"
<script>
"
+
"select business_id businessId,l_name lName from b_label "
+
"where business_id in (${pushLable}) "
+
"and corp_id = '###' ) a "
+
"UNION "
+
"select * from ( "
+
"SELECT blb.business_id businessId,blb.l_name lName "
+
"FROM "
+
" b_lesson_label bll "
+
" LEFT JOIN b_label blb ON bll.label_id = blb.business_id "
+
" LEFT JOIN b_lesson bls ON bls.business_id = bll.lesson_id "
+
"WHERE "
+
" blb.del_flag != 1 "
+
" AND blb.flag = 1 "
+
" AND bls.del_flag != 1 "
+
" AND bls.flag = 1 "
+
" AND bls.business_id = #{lessonId} "
+
"ORDER BY "
+
" CAST( bll.sort AS UNSIGNED ) ASC) b "
)
List
<
QueryLabelResDTO
>
queryPushLabelByLessonId
(
@Param
(
"pushLable"
)
String
pushLable
,
@Param
(
"lessonId"
)
String
lessonId
);
"where business_id in "
+
" <foreach item='item' index='index' collection='list' open='(' separator=',' close=')'> #{item} </foreach> "
+
" </script>"
)
List
<
QueryLabelResDTO
>
queryPushLabelByLessonId
(
List
<
String
>
list
);
@Select
(
"select push_lable from b_lesson where business_id = #{lessonId}"
)
String
getPushLable
(
String
lesson
);
/**
* 查询 lableIds(企业自增的)
* @param lessonId
* @return
*/
@Select
(
"select blc.lables "
+
"from b_lesson_corp blc "
+
"left join b_lesson bl on bl.business_id = blc.lesson_id and bl.corp_id = '###' "
+
"where 1=1 "
+
"and bl.del_flag !=1 "
+
"and bl.flag = 1 "
+
"and blc.
corp
_id = #{lessonId}"
)
String
get
Push
Lable
(
String
lessonId
);
"and blc.
lesson
_id = #{lessonId}"
)
String
get
Corp
Lable
(
String
lessonId
);
/**
* 首页分页查询全部课程
...
...
@@ -1350,10 +1344,10 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
" <if test=\"model.valueGainSort !=null and model.valueGainSort !='' and model.valueGainSort =='1'.toString()\"> , CAST(bl.value_gain AS UNSIGNED) ASC </if> "
+
" <if test=\"model.releaseDateSort !=null and model.releaseDateSort !='' and model.releaseDateSort =='0'.toString()\"> , bl.release_date DESC </if> "
+
" <if test=\"model.releaseDateSort !=null and model.releaseDateSort !='' and model.releaseDateSort =='1'.toString()\">, bl.release_date ASC </if>"
+
" ,
CAST
bl.release_date desc"
+
" ,bl.release_date desc"
+
"</script>"
)
@ResultMap
(
value
=
"BasePushResultMap"
)
List
<
BLesson
>
queryPushMore
(
FindListLessonDTO
model
);
List
<
BLesson
>
queryPushMore
(
@Param
(
"model"
)
FindListLessonDTO
model
);
/**
* 查询 企业下 lessons
...
...
src/main/java/org/rcisoft/business/blesson/entity/BLesson.java
View file @
cd4a11f2
...
...
@@ -292,6 +292,9 @@ public class BLesson extends IdEntity<BLesson> {
@ApiModelProperty
(
value
=
"数据来源企业"
)
private
String
fromCorp
;
@ApiModelProperty
(
value
=
"平台推荐自带标签"
)
private
String
pushLable
;
public
void
initModel
(){
// this.setDefaultUrl(global.getDEFAULT_COURSE_LOCATION());
...
...
src/main/java/org/rcisoft/business/blesson/service/impl/BLessonServiceImpl.java
View file @
cd4a11f2
...
...
@@ -10,6 +10,7 @@ import org.rcisoft.business.bcourse.dao.BCourseRepository;
import
org.rcisoft.business.bcourse.dto.AllCourseDTO
;
import
org.rcisoft.business.bfile.dao.BTrainFileRepository
;
import
org.rcisoft.business.bfile.entity.BTrainFile
;
import
org.rcisoft.business.blabel.dto.QueryLabelResDTO
;
import
org.rcisoft.business.blesson.dao.*
;
import
org.rcisoft.business.blesson.dto.*
;
import
org.rcisoft.business.blesson.entity.*
;
...
...
@@ -267,12 +268,15 @@ public class BLessonServiceImpl implements BLessonService {
}
List
<
BLesson
>
result
=
bLessonRepository
.
queryPush
(
curUser
,
departs
);
result
.
forEach
(
lesson
->{
List
<
String
>
list
=
new
ArrayList
<>();
String
pushLable
=
bLessonRepository
.
getPushLable
(
lesson
.
getBusinessId
());
if
(
StringUtils
.
isEmpty
(
pushLable
)){
lesson
.
setLabelList
(
bLessonRepository
.
queryLabelByLessonId
(
lesson
.
getBusinessId
()));
}
else
{
lesson
.
setLabelList
(
bLessonRepository
.
queryPushLabelByLessonId
(
pushLable
,
lesson
.
getBusinessId
()));
}
String
corpLable
=
bLessonRepository
.
getCorpLable
(
lesson
.
getBusinessId
());
if
(
StringUtils
.
isEmpty
(
pushLable
))
list
.
addAll
(
asList
(
pushLable
.
split
(
","
)));
if
(
StringUtils
.
isEmpty
(
corpLable
))
list
.
addAll
(
asList
(
corpLable
.
split
(
","
)));
if
(
list
.
size
()<=
0
||
list
==
null
)
lesson
.
setLabelList
(
bLessonRepository
.
queryPushLabelByLessonId
(
list
));
});
return
addNew
(
result
);
...
...
@@ -285,14 +289,17 @@ public class BLessonServiceImpl implements BLessonService {
*/
public
List
<
BLesson
>
queryPush
(
FindListLessonDTO
model
)
{
List
<
BLesson
>
result
=
bLessonRepository
.
queryPushMore
(
model
);
for
(
BLesson
b
:
result
){
String
pushLable
=
bLessonRepository
.
getPushLable
(
b
.
getBusinessId
());
if
(
StringUtils
.
isEmpty
(
pushLable
)){
b
.
setLabelList
(
bLessonRepository
.
queryLabelByLessonId
(
b
.
getBusinessId
()));
}
else
{
b
.
setLabelList
(
bLessonRepository
.
queryPushLabelByLessonId
(
pushLable
,
b
.
getBusinessId
()));
}
}
result
.
forEach
(
lesson
->{
List
<
String
>
list
=
new
ArrayList
<>();
String
pushLable
=
bLessonRepository
.
getPushLable
(
lesson
.
getBusinessId
());
String
corpLable
=
bLessonRepository
.
getCorpLable
(
lesson
.
getBusinessId
());
if
(
StringUtils
.
isNotEmpty
(
pushLable
))
list
.
addAll
(
asList
(
pushLable
.
split
(
","
)));
if
(
StringUtils
.
isNotEmpty
(
corpLable
))
list
.
addAll
(
asList
(
corpLable
.
split
(
","
)));
if
(
list
!=
null
&&
list
.
size
()
>
0
)
lesson
.
setLabelList
(
bLessonRepository
.
queryPushLabelByLessonId
(
list
));
});
return
addNew
(
result
);
}
...
...
@@ -1911,16 +1918,16 @@ public class BLessonServiceImpl implements BLessonService {
mtUserGetsReqDTO
.
setCorpId
(
curUser
.
getCorpId
());
mtUserGetsReqDTO
.
setIds
(
ids
);
log
.
info
(
"------------mtUserGetsReqDTO--------"
+
mtUserGetsReqDTO
);
//
List<MTUserInfoRspDTO> mtUserInfoRspDTOList = cotactApiRequestClient.userGets(mtUserGetsReqDTO);
//
log.info("------------mtUserInfoRspDTOList--------"+(mtUserInfoRspDTOList==null?"null":mtUserInfoRspDTOList.toString()));
//
List<String> departs = new ArrayList<>();
//
if (mtUserInfoRspDTOList != null && mtUserInfoRspDTOList.size() > 0) {
//
departs = QueryDepart.queryDepart(mtUserInfoRspDTOList);
//
departs.removeAll(Collections.singleton(null));
//
departs.removeAll(Collections.singleton(""));
//
}
List
<
MTUserInfoRspDTO
>
mtUserInfoRspDTOList
=
cotactApiRequestClient
.
userGets
(
mtUserGetsReqDTO
);
log
.
info
(
"------------mtUserInfoRspDTOList--------"
+(
mtUserInfoRspDTOList
==
null
?
"null"
:
mtUserInfoRspDTOList
.
toString
()));
List
<
String
>
departs
=
new
ArrayList
<>();
if
(
mtUserInfoRspDTOList
!=
null
&&
mtUserInfoRspDTOList
.
size
()
>
0
)
{
departs
=
QueryDepart
.
queryDepart
(
mtUserInfoRspDTOList
);
departs
.
removeAll
(
Collections
.
singleton
(
null
));
departs
.
removeAll
(
Collections
.
singleton
(
""
));
}
FirstPageQueryDTO
firstPageQueryDTO
=
new
FirstPageQueryDTO
();
firstPageQueryDTO
.
setDeparts
(
null
);
firstPageQueryDTO
.
setDeparts
(
departs
);
firstPageQueryDTO
.
setCorpId
(
curUser
.
getCorpId
());
firstPageQueryDTO
.
setUserId
(
curUser
.
getUserId
());
List
<
String
>
courseIds
=
null
;
...
...
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