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
815e2d91
Commit
815e2d91
authored
Oct 16, 2019
by
root
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改接口
parent
f753c01b
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
193 additions
and
130 deletions
+193
-130
BLessonController.java
...cisoft/business/blesson/controller/BLessonController.java
+19
-19
BAppointRepository.java
.../org/rcisoft/business/blesson/dao/BAppointRepository.java
+15
-0
BLessonPersonRepository.java
...rcisoft/business/blesson/dao/BLessonPersonRepository.java
+12
-12
BLessonRepository.java
...a/org/rcisoft/business/blesson/dao/BLessonRepository.java
+130
-87
BLessonServiceImpl.java
...oft/business/blesson/service/impl/BLessonServiceImpl.java
+17
-12
No files found.
src/main/java/org/rcisoft/business/blesson/controller/BLessonController.java
View file @
815e2d91
...
...
@@ -433,24 +433,24 @@ public class BLessonController extends PaginationController<BLesson> {
bLessonService
.
queryRecommendByLessonId
(
param
));
}
//
@ApiOperation(value="624 指派课程", notes="根据ID指派课程")
//
@PostMapping(value = "/appointLessonToPerson")
//
public Result appointLessonToPerson(CurUser curUser,@Valid AppointLessonDTO appointLessonDTO,BindingResult bindingResult) {
//
PersistModel data = bLessonService.appointLessonToPerson(appointLessonDTO);
//
return Result.builder(data,
//
MessageConstant.MESSAGE_ALERT_SUCCESS,
//
MessageConstant.MESSAGE_ALERT_ERROR,
//
appointLessonDTO);
//
}
//
//
@ApiOperation(value="625 添加我学习的课程", notes="添加我学习的课程")
//
@PostMapping(value = "/addMyLearnLesson")
//
public Result addMyLearnLesson(CurUser curUser,@Valid AddMyLearnLessonDTO addMyLearnLessonDTO,BindingResult bindingResult) {
//
PersistModel data = bLessonPersonService.addMyLearnLesson(addMyLearnLessonDTO);
//
return Result.builder(data,
//
MessageConstant.MESSAGE_ALERT_SUCCESS,
//
MessageConstant.MESSAGE_ALERT_ERROR,
//
addMyLearnLessonDTO);
//
}
@ApiOperation
(
value
=
"624 指派课程"
,
notes
=
"根据ID指派课程"
)
@PostMapping
(
value
=
"/appointLessonToPerson"
)
public
Result
appointLessonToPerson
(
CurUser
curUser
,
@Valid
AppointLessonDTO
appointLessonDTO
,
BindingResult
bindingResult
)
{
PersistModel
data
=
bLessonService
.
appointLessonToPerson
(
appointLessonDTO
);
return
Result
.
builder
(
data
,
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
appointLessonDTO
);
}
@ApiOperation
(
value
=
"625 添加我学习的课程"
,
notes
=
"添加我学习的课程"
)
@PostMapping
(
value
=
"/addMyLearnLesson"
)
public
Result
addMyLearnLesson
(
CurUser
curUser
,
@Valid
AddMyLearnLessonDTO
addMyLearnLessonDTO
,
BindingResult
bindingResult
)
{
PersistModel
data
=
bLessonPersonService
.
addMyLearnLesson
(
addMyLearnLessonDTO
);
return
Result
.
builder
(
data
,
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
addMyLearnLessonDTO
);
}
}
src/main/java/org/rcisoft/business/blesson/dao/BAppointRepository.java
View file @
815e2d91
package
org
.
rcisoft
.
business
.
blesson
.
dao
;
import
org.apache.ibatis.annotations.Insert
;
import
org.apache.ibatis.annotations.Param
;
import
org.rcisoft.business.blesson.dto.AppointLessonDTO
;
import
org.rcisoft.business.blesson.dto.CancelAppointDTO
;
import
org.rcisoft.business.blesson.entity.BAppoint
;
...
...
@@ -42,5 +44,18 @@ public interface BAppointRepository extends BaseMapper<BAppoint> {
+
"</script>"
)
@ResultMap
(
value
=
"BaseResultMap"
)
List
<
BAppoint
>
selectByLessonId
(
AppointLessonDTO
param
);
@Insert
(
"<script>"
+
" insert into b_appoint("
+
" business_id,create_by,create_date,update_by,update_date, "
+
" del_flag,flag,remarks,lesson_id,appointer_id, "
+
" designated_id) "
+
" values "
+
" (#{param.businessId}, #{param.createBy},#{param.createDate},#{param.updateBy},#{param.updateDate}, "
+
" #{param.delFlag}, #{param.flag},#{param.remarks},#{param.lessonId},#{param.appointerId}, "
+
" #{param.designatedId}) "
+
"</script>"
)
int
insertAppoint
(
@Param
(
"param"
)
BAppoint
param
);
}
src/main/java/org/rcisoft/business/blesson/dao/BLessonPersonRepository.java
View file @
815e2d91
...
...
@@ -8,6 +8,7 @@ import org.rcisoft.business.blesson.entity.BLessonPerson;
import
org.rcisoft.core.base.BaseMapper
;
import
org.springframework.stereotype.Repository
;
import
java.util.Date
;
import
java.util.List
;
@Repository
...
...
@@ -179,30 +180,29 @@ public interface BLessonPersonRepository extends BaseMapper<BLessonPerson> {
* @return
*/
@Update
(
"<script>"
+
" <foreach collection='param' item='item' index='index' separator=';'> "
+
" update b_lesson_person "
+
" <set> "
+
" <if test=\"
item.updateBy != null and item.updateBy != ''\">update_by=#{ite
m.updateBy},</if>"
+
" <if test=\"
item.updateDate != null and item.updateDate != ''\">update_date=#{ite
m.updateDate},</if>"
+
" appoint_id=#{
ite
m.appointId}, "
+
" is_appoint=#{
item.isAppoint},
"
+
" <if test=\"
param.updateBy != null and param.updateBy != ''\">update_by=#{para
m.updateBy},</if>"
+
" <if test=\"
param.updateDate != null \">update_date=#{para
m.updateDate},</if>"
+
" appoint_id=#{
para
m.appointId}, "
+
" is_appoint=#{
param.isAppoint}
"
+
" </set> "
+
" where business_id
=#{item.businessId}
"
+
" <
/foreach>"
+
" where business_id
in
"
+
" <
foreach item='item' index='index' collection='ids' open='(' separator=',' close=')'> #{item} </foreach>"
+
"</script>"
)
int
updateList
(
@Param
(
"param"
)
List
<
BLessonPerson
>
param
);
int
updateList
(
@Param
(
"param"
)
BLessonPerson
param
,
@Param
(
"ids"
)
List
<
String
>
ids
);
@Insert
(
"<script>"
+
" insert into b_lesson_person("
+
" business_id,create_by,create_date,update_by,update_date, "
+
" del_flag,flag,remarks,person_id,lesson_id "
+
" learn_progress,is_finish,
finish_date,
is_collect,appoint_id, "
+
" del_flag,flag,remarks,person_id,lesson_id
,
"
+
" learn_progress,is_finish,is_collect,appoint_id, "
+
" is_appoint) "
+
" values "
+
" <foreach collection='
list' index='index' item='item' separator=','>
"
+
" <foreach collection='
param' index='index' item='item' separator=','>(
"
+
" #{item.businessId}, #{item.createBy},#{item.createDate},#{item.updateBy},#{item.updateDate}, "
+
" #{item.delFlag}, #{item.flag},#{item.remarks},#{item.personId},#{item.lessonId}, "
+
" #{item.learnProgress}, #{item.isFinish},#{item.
finishDate},#{item.
isCollect},#{item.appointId}, "
+
" #{item.learnProgress}, #{item.isFinish},#{item.isCollect},#{item.appointId}, "
+
" #{item.isAppoint}) "
+
" </foreach>"
+
"</script>"
)
...
...
src/main/java/org/rcisoft/business/blesson/dao/BLessonRepository.java
View file @
815e2d91
...
...
@@ -98,15 +98,19 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
" ,suc.name createByName "
+
" from b_lesson bl "
+
" left join s_user su on su.business_id = bl.lecturer_id "
+
" left join s_user suc on suc.business_id = bl.create_by "
+
" where bl.del_flag != 1 and bl.flag = 1 "
+
" and su.del_flag != 1 and su.flag = 1 "
+
" and suc.del_flag != 1 and suc.flag = 1 "
+
" and bl.corp_id = #{cropId} "
+
" and su.corp_id = #{cropId} "
+
" left join s_user suc on suc.business_id = bl.create_by "
+
" and suc.del_flag != 1 and suc.flag = 1 "
+
" and suc.corp_id = #{cropId} "
+
" where bl.del_flag != 1 and bl.flag = 1 "
+
" and bl.corp_id = #{cropId} "
+
" <if test= \" code != null and code != ''\">and bl.code like CONCAT('%',#{code},'%') </if> "
+
" <if test= \" lessonName != null and lessonName != ''\">and bl.lesson_name like CONCAT('%',#{lessonName},'%') </if> "
+
" <if test= \" releaseState !=null and releaseState != ''\">and bl.release_state = #{releaseState} </if> "
+
...
...
@@ -132,29 +136,35 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
" ,suc.name createByName "
+
" from b_lesson bl "
+
" left join s_user su on su.business_id = bl.lecturer_id "
+
" and su.del_flag != 1 and su.flag = 1 "
+
" and su.corp_id = #{curUser.corpId} "
+
" left join s_user suc on suc.business_id = bl.create_by "
+
" and suc.del_flag != 1 and suc.flag = 1 "
+
" and suc.corp_id = #{curUser.corpId} "
+
" left join b_viewrange bv on bl.business_id = bv.lesson_id "
+
" and bv.del_flag != 1 and bv.flag = 1 "
+
" and bv.corp_id = #{curUser.corpId} "
+
" left join b_viewrange_son bvs on bv.business_id = bvs.viewrange_id "
+
// " left join b_course bc on bc.business_id = bl.course_id " +
" where bl.del_flag != 1 and bl.flag = 1 "
+
" and su.del_flag != 1 and su.flag = 1 "
+
" and
suc.del_flag != 1 and suc.flag = 1 "
+
" and bv.del_flag != 1 and bv.flag = 1 "
+
" and
bl.corp_id = #{curUser.corpId} "
+
" and bl.release_state = 2 "
+
" and ((bvs.type = 0 and bvs.target_id = #{
model
.userId}) "
+
" or (bl.lecturer_id = #{
model
.userId}) "
+
" <if test=\"
model.departs != null and model.
departs.size() > 0 \"> "
+
" and ((bvs.type = 0 and bvs.target_id = #{
curUser
.userId}) "
+
" or (bl.lecturer_id = #{
curUser
.userId}) "
+
" <if test=\"
departs != null and
departs.size() > 0 \"> "
+
" or (bvs.type = 1 and bvs.target_id in "
+
" <foreach item='item' index='index' collection='
model.
departs' open='(' separator=',' close=')'> #{item} </foreach>)"
+
" <foreach item='item' index='index' collection='departs' open='(' separator=',' close=')'> #{item} </foreach>)"
+
" </if> "
+
" or (bl.business_id not in (select lesson_id from b_viewrange where del_flag != 1 and flag = 1 ))) "
+
" and bl.person_number > (select `value` from b_dictionary where type = 'ZXRS') "
+
//ZXRS 在学人数
" and bl.corp_id = #{curUser.corpId} "
+
" and su.corp_id = #{curUser.corpId} "
+
" and suc.corp_id = #{curUser.corpId} "
+
" and bv.corp_id = #{curUser.corpId} "
+
" order by bl.person_number,bl.release_date desc "
+
"</script>"
)
@ResultMap
(
value
=
"BaseResultMap"
)
...
...
@@ -171,26 +181,32 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
" ,suc.name createByName "
+
" from b_lesson bl "
+
" left join s_user su on su.business_id = bl.lecturer_id "
+
" and su.del_flag != 1 and su.flag = 1 "
+
" and su.corp_id = #{curUser.corpId} "
+
" left join s_user suc on suc.business_id = bl.create_by "
+
" and suc.del_flag != 1 and suc.flag = 1 "
+
" and suc.corp_id = #{curUser.corpId} "
+
" left join b_recommend br on bl.business_id = br.lesson_id "
+
" and br.del_flag != 1 and br.flag = 1 "
+
" and br.corp_id = #{curUser.corpId} "
+
" left join b_recommend_son brs on br.business_id = brs.recommend_id "
+
// " left join b_course bc on bc.business_id = bl.course_id " +
" where bl.del_flag != 1 and bl.flag = 1 "
+
" and su.del_flag != 1 and su.flag = 1 "
+
" and
suc.del_flag != 1 and suc.flag = 1 "
+
" and br.del_flag != 1 and br.flag = 1 "
+
" and
bl.corp_id = #{curUser.corpId} "
+
" and bl.release_state = 2 "
+
" and ((brs.type = 0 and brs.target_id = #{curUser.userId}) "
+
" <if test=\"departs != null and departs.size() > 0 \"> "
+
" or (brs.type = 1 and brs.target_id in "
+
" <foreach item='item' index='index' collection='departs' open='(' separator=',' close=')'> #{item} </foreach>) "
+
" </if>) "
+
" and bl.corp_id = #{curUser.corpId} "
+
" and su.corp_id = #{curUser.corpId} "
+
" and suc.corp_id = #{curUser.corpId} "
+
" and br.corp_id = #{curUser.corpId} "
+
" order by br.update_date "
+
"</script>"
)
@ResultMap
(
value
=
"BaseResultMap"
)
...
...
@@ -207,29 +223,36 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
" ,suc.name createByName "
+
" from b_lesson bl "
+
" left join s_user su on su.business_id = bl.lecturer_id "
+
" and su.del_flag != 1 and su.flag = 1 "
+
" and su.corp_id = #{curUser.corpId} "
+
" left join s_user suc on suc.business_id = bl.create_by "
+
" and suc.del_flag != 1 and suc.flag = 1 "
+
" and suc.corp_id = #{curUser.corpId} "
+
" left join b_viewrange bv on bl.business_id = bv.lesson_id "
+
" and bv.del_flag != 1 and bv.flag = 1 "
+
" and bv.corp_id = #{curUser.corpId} "
+
" left join b_viewrange_son bvs on bv.business_id = bvs.viewrange_id "
+
// " left join b_course bc on bc.business_id = bl.course_id " +
" where bl.del_flag != 1 and bl.flag = 1 "
+
" and su.del_flag != 1 and su.flag = 1 "
+
" and
suc.del_flag != 1 and suc.flag = 1 "
+
" and bv.del_flag != 1 and bv.flag = 1 "
+
" and
bl.corp_id = #{curUser.corpId} "
+
" and bl.release_state = 2 "
+
" and ((bvs.type = 0 and bvs.target_id = #{
model
.userId}) "
+
" or (bl.lecturer_id = #{
model
.userId}) "
+
" <if test=\"
model.departs != null and model.
departs.size() > 0 \"> "
+
" and ((bvs.type = 0 and bvs.target_id = #{
curUser
.userId}) "
+
" or (bl.lecturer_id = #{
curUser
.userId}) "
+
" <if test=\"
departs != null and
departs.size() > 0 \"> "
+
" or (bvs.type = 1 and bvs.target_id in "
+
" <foreach item='item' index='index' collection='
model.
departs' open='(' separator=',' close=')'> #{item} </foreach>)"
+
" <foreach item='item' index='index' collection='departs' open='(' separator=',' close=')'> #{item} </foreach>)"
+
" </if> "
+
" or (bl.business_id not in (select lesson_id from b_viewrange where del_flag != 1 and flag = 1 ))) "
+
" and bl.person_number > (select `value` from b_dictionary where type = 'GZRS') "
+
//ZXRS 关注人数
" and bl.corp_id = #{curUser.corpId} "
+
" and su.corp_id = #{curUser.corpId} "
+
" and suc.corp_id = #{curUser.corpId} "
+
" and bv.corp_id = #{curUser.corpId} "
+
" order by bl.collect_number,bl.release_date desc "
+
"</script>"
)
@ResultMap
(
value
=
"BaseResultMap"
)
...
...
@@ -263,32 +286,35 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
" bla.business_id "
+
" ) T ON T.bussinessId = bl.label_id "
+
" left join s_user su on su.business_id = b.lecturer_id "
+
" and su.del_flag != 1 and su.flag = 1 "
+
" and su.corp_id = #{curUser.corpId} "
+
" left join s_user suc on suc.business_id = b.create_by "
+
" and suc.del_flag != 1 and suc.flag = 1 "
+
" and suc.corp_id = #{curUser.corpId} "
+
" left join b_viewrange bv on b.business_id = bv.lesson_id "
+
" and bv.del_flag != 1 and bv.flag = 1 "
+
" and bv.corp_id = #{curUser.corpId} "
+
" left join b_viewrange_son bvs on bv.business_id = bvs.viewrange_id "
+
" where b.del_flag != 1 and b.flag = 1 "
+
" and su.del_flag != 1 and su.flag = 1 "
+
" and suc.del_flag != 1 and suc.flag = 1 "
+
" and bv.del_flag != 1 and bv.flag = 1 "
+
" and b.corp_id = #{curUser.corpId} "
+
" and su.corp_id = #{curUser.corpId} "
+
" and suc.corp_id = #{curUser.corpId} "
+
" and bv.corp_id = #{curUser.corpId} "
+
" and b.business_id not in (SELECT DISTINCT b.business_id from "
+
" b_lesson b left join b_lesson_person blp on b.business_id = blp.lesson_id "
+
" where blp.del_flag != 1 and blp.flag = 1 "
+
// " and blp.corp_id = #{curUser.corpId} "+
" and blp.person_id = #{curUser.userId} ) "
+
" and b.release_state = 2 "
+
" and ((bvs.type = 0 and bvs.target_id = #{
model
.userId}) "
+
" or (b.lecturer_id = #{
model
.userId}) "
+
" <if test=\"
model.departs != null and model.
departs.size() > 0 \"> "
+
" and ((bvs.type = 0 and bvs.target_id = #{
curUser
.userId}) "
+
" or (b.lecturer_id = #{
curUser
.userId}) "
+
" <if test=\"
departs != null and
departs.size() > 0 \"> "
+
" or (bvs.type = 1 and bvs.target_id in "
+
" <foreach item='item' index='index' collection='
model.
departs' open='(' separator=',' close=')'> #{item} </foreach>)"
+
" <foreach item='item' index='index' collection='departs' open='(' separator=',' close=')'> #{item} </foreach>)"
+
" </if> "
+
" or (bl.business_id not in (select lesson_id from b_viewrange where del_flag != 1 and flag = 1 ))) "
+
" order by T.bsum , b.collect_number desc"
+
...
...
@@ -318,26 +344,31 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
" ,suc.name createByName "
+
" from b_lesson bl "
+
" left join s_user su on su.business_id = bl.lecturer_id "
+
" and su.del_flag != 1 and su.flag = 1 "
+
" and su.corp_id = #{param.corpId} "
+
" left join s_user suc on suc.business_id = bl.create_by "
+
" and suc.del_flag != 1 and suc.flag = 1 "
+
" and suc.corp_id = #{param.corpId} "
+
" left join b_viewrange bv on bl.business_id = bv.lesson_id "
+
" and bv.del_flag != 1 and bv.flag = 1 "
+
" and bv.corp_id = #{param.corpId} "
+
" left join b_viewrange_son bvs on bv.business_id = bvs.viewrange_id "
+
// " left join b_course bc on bc.business_id = bl.course_id " +
" where bl.del_flag != 1 and bl.flag = 1 "
+
" and su.del_flag != 1 and su.flag = 1 "
+
" and suc.del_flag != 1 and suc.flag = 1 "
+
" and bv.del_flag != 1 and bv.flag = 1 "
+
" and bl.corp_id = #{param.corpId} "
+
" and su.corp_id = #{param.corpId} "
+
" and suc.corp_id = #{param.corpId} "
+
" and bv.corp_id = #{param.corpId} "
+
" and bl.release_state = 2 "
+
" and ((bvs.type = 0 and bvs.target_id = #{
model
.userId}) "
+
" or (bl.lecturer_id = #{
model
.userId}) "
+
" <if test=\"
model.departs != null and model
.departs.size() > 0 \"> "
+
" and ((bvs.type = 0 and bvs.target_id = #{
param
.userId}) "
+
" or (bl.lecturer_id = #{
curUser
.userId}) "
+
" <if test=\"
param.departs != null and param
.departs.size() > 0 \"> "
+
" or (bvs.type = 1 and bvs.target_id in "
+
" <foreach item='item' index='index' collection='
model
.departs' open='(' separator=',' close=')'> #{item} </foreach>)"
+
" <foreach item='item' index='index' collection='
param
.departs' open='(' separator=',' close=')'> #{item} </foreach>)"
+
" </if> "
+
" or (bl.business_id not in (select lesson_id from b_viewrange where del_flag != 1 and flag = 1 ))) "
+
" <if test= \" param.viewParam !=null and param.viewParam != ''\">and (bl.lesson_name like CONCAT('%',#{param.viewParam},'%') "
+
...
...
@@ -518,7 +549,6 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
" left join b_viewrange_son bvs on bv.business_id = bvs.viewrange_id "
+
" left join b_lesson_label bll on bl.business_id = bll.lesson_id "
+
" where bl.del_flag != 1 and bl.flag = 1 "
+
" and bl.corp_id = #{model.corpId} "
+
...
...
@@ -555,23 +585,25 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
" ,suc.name createByName "
+
" from b_lesson bl "
+
" left join s_user su on su.business_id = bl.lecturer_id "
+
" and su.del_flag != 1 and su.flag = 1 "
+
" and su.corp_id = #{model.corpId} "
+
" left join s_user suc on suc.business_id = bl.create_by "
+
" and suc.del_flag != 1 and suc.flag = 1 "
+
" and suc.corp_id = #{model.corpId} "
+
" left join b_recommend br on bl.business_id = br.lesson_id "
+
" and br.del_flag != 1 and br.flag = 1 "
+
" and br.corp_id = #{model.corpId} "
+
" left join b_recommend_son brs on br.business_id = brs.recommend_id "
+
" left join b_lesson_label bll on bl.business_id = bll.lesson_id "
+
// " left join b_label bla on bla.business_id = bll.label_id " +
" where bl.del_flag != 1 and bl.flag = 1 "
+
" and su.del_flag != 1 and su.flag = 1 "
+
" and br.del_flag != 1 and br.flag = 1 "
+
// " and bla.del_flag != 1 and bla.flag = 1 " +
" and bl.corp_id = #{model.corpId} "
+
" and su.corp_id = #{model.corpId} "
+
" and br.corp_id = #{model.corpId} "
+
" <if test=\"model.labelId !=null and model.labelId != ''\">and bll.label_id = #{model.labelId}</if>"
+
" <if test=\"model.lessonType !=null and model.lessonType != ''\">and bl.lesson_type = #{model.lessonType}</if>"
+
...
...
@@ -606,23 +638,26 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
" ,suc.name createByName "
+
" from b_lesson bl "
+
" left join s_user su on su.business_id = bl.lecturer_id "
+
" and su.del_flag != 1 and su.flag = 1 "
+
" and su.corp_id = #{model.corpId} "
+
" left join s_user suc on suc.business_id = bl.create_by "
+
" and suc.del_flag != 1 and suc.flag = 1 "
+
" and suc.corp_id = #{model.corpId} "
+
" left join b_viewrange bv on bl.business_id = bv.lesson_id "
+
" and bv.del_flag != 1 and bv.flag = 1 "
+
" and bv.corp_id = #{model.corpId} "
+
" left join b_viewrange_son bvs on bv.business_id = bvs.viewrange_id "
+
" left join b_lesson_label bll on bl.business_id = bll.lesson_id "
+
// " left join b_course bc on bc.business_id = bl.course_id " +
" where bl.del_flag != 1 and bl.flag = 1 "
+
" and su.del_flag != 1 and su.flag = 1 "
+
" and bv.del_flag != 1 and bv.flag = 1 "
+
" and bl.corp_id = #{model.corpId} "
+
" and su.corp_id = #{model.corpId} "
+
" and bv.corp_id = #{model.corpId} "
+
" and bl.release_state = 2 "
+
" and ((bvs.type = 0 and bvs.target_id = #{model.userId}) "
+
...
...
@@ -656,23 +691,25 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
" ,suc.name createByName "
+
" from b_lesson bl "
+
" left join s_user su on su.business_id = bl.lecturer_id "
+
" and su.del_flag != 1 and su.flag = 1 "
+
" and su.corp_id = #{model.corpId} "
+
" left join s_user suc on suc.business_id = bl.create_by "
+
" and suc.del_flag != 1 and suc.flag = 1 "
+
" and suc.corp_id = #{model.corpId} "
+
" left join b_viewrange bv on bl.business_id = bv.lesson_id "
+
" and bv.del_flag != 1 and bv.flag = 1 "
+
" and bv.corp_id = #{model.corpId} "
+
" left join b_viewrange_son bvs on bv.business_id = bvs.viewrange_id "
+
" left join b_lesson_label bll on bl.business_id = bll.lesson_id "
+
// " left join b_label bla on bla.business_id = bll.label_id " +
" where bl.del_flag != 1 and bl.flag = 1 "
+
" and su.del_flag != 1 and su.flag = 1 "
+
" and bv.del_flag != 1 and bv.flag = 1 "
+
// " and bla.del_flag != 1 and bla.flag = 1 " +
" and bl.corp_id = #{model.corpId} "
+
" and su.corp_id = #{model.corpId} "
+
" and bv.corp_id = #{model.corpId} "
+
" <if test=\"model.labelId !=null and model.labelId != ''\">and bll.label_id = #{model.labelId}</if>"
+
" <if test=\"model.lessonType !=null and model.lessonType != ''\">and bl.lesson_type = #{model.lessonType}</if>"
+
...
...
@@ -725,19 +762,25 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
" bla.business_id "
+
" ) T ON T.bussinessId = bl.label_id "
+
" left join s_user su on su.business_id = b.lecturer_id "
+
" and su.del_flag != 1 and su.flag = 1 "
+
" and su.corp_id = #{model.corpId} "
+
" left join s_user suc on suc.business_id = b.create_by "
+
" and suc.del_flag != 1 and suc.flag = 1 "
+
" and suc.corp_id = #{model.corpId} "
+
" left join b_viewrange bv on b.business_id = bv.lesson_id "
+
" and bv.del_flag != 1 and bv.flag = 1 "
+
" and bv.corp_id = #{model.corpId} "
+
" left join b_viewrange_son bvs on bv.business_id = bvs.viewrange_id "
+
" left join b_lesson_label bll on bl.business_id = bll.lesson_id "
+
" where b.del_flag != 1 and b.flag = 1 "
+
" and su.del_flag != 1 and su.flag = 1 "
+
" and suc.del_flag != 1 and suc.flag = 1 "
+
" and bv.del_flag != 1 and bv.flag = 1 "
+
" and b.corp_id = #{model.corpId} "
+
" and su.corp_id = #{model.corpId} "
+
" and suc.corp_id = #{model.corpId} "
+
" and bv.corp_id = #{model.corpId} "
+
" and b.business_id not in (SELECT DISTINCT b.business_id from "
+
" b_lesson b left join b_lesson_person blp on b.business_id = blp.lesson_id "
+
...
...
src/main/java/org/rcisoft/business/blesson/service/impl/BLessonServiceImpl.java
View file @
815e2d91
...
...
@@ -395,7 +395,7 @@ public class BLessonServiceImpl implements BLessonService {
bAppoint
.
setAppointerId
(
appointLessonDTO
.
getUserId
());
bAppoint
.
setDesignatedId
(
appointLessonDTO
.
getAppointPerson
());
UserUtil
.
setCurrentPersistOperation
(
bAppoint
);
bAppointRepository
.
insert
Selective
(
bAppoint
);
bAppointRepository
.
insert
Appoint
(
bAppoint
);
}
else
{
bAppoint
=
bAppoints
.
get
(
0
);
bAppoint
.
setAppointerId
(
appointLessonDTO
.
getUserId
());
...
...
@@ -416,18 +416,23 @@ public class BLessonServiceImpl implements BLessonService {
appointLessonDTO
.
setAppointPersonList
(
userIds
);
//查询已学该课程的学习business_id
List
<
BLessonPerson
>
inLessonPersons
=
bLessonPersonRepository
.
selectPersonIdByLessonId
(
appointLessonDTO
);
List
<
String
>
inLessonIds
=
new
ArrayList
<>();
for
(
BLessonPerson
inLessonPerson
:
inLessonPersons
)
{
UserUtil
.
setCurrentMergeOperation
(
inLessonPerson
);
inLessonPerson
.
setIsAppoint
(
"1"
);
inLessonPerson
.
setAppointId
(
bAppoint
.
getBusinessId
());
inLessonIds
.
add
(
inLessonPerson
.
getPersonId
());
if
(
inLessonPersons
!=
null
&&
inLessonPersons
.
size
()
>
0
){
List
<
String
>
inLessonIds
=
new
ArrayList
<>();
for
(
BLessonPerson
inLessonPerson
:
inLessonPersons
)
{
inLessonIds
.
add
(
inLessonPerson
.
getPersonId
());
}
//创建对象用于更新
BLessonPerson
updateBLessonPerson
=
new
BLessonPerson
();
updateBLessonPerson
.
setIsAppoint
(
"1"
);
updateBLessonPerson
.
setAppointId
(
bAppoint
.
getBusinessId
());
UserUtil
.
setCurrentMergeOperation
(
updateBLessonPerson
);
//更新b_lesson_person表
bLessonPersonRepository
.
updateList
(
updateBLessonPerson
,
inLessonIds
);
//从学生Id中删除已更新的学生id
userIds
.
removeAll
(
inLessonIds
);
}
//更新b_lesson_person表
bLessonPersonRepository
.
updateList
(
inLessonPersons
);
//从学生Id中删除已更新的学生id
userIds
.
removeAll
(
inLessonIds
);
//剩余学生添加至b_lesson_person表
List
<
BLessonPerson
>
bLessonPersonOthers
=
new
ArrayList
<>();
userIds
.
forEach
(
userId
->{
...
...
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