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
27880130
Commit
27880130
authored
Oct 15, 2019
by
root
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改接口、添加新接口
parent
03acb059
Changes
15
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
483 additions
and
94 deletions
+483
-94
BChapterServiceImpl.java
...t/business/bchapter/service/impl/BChapterServiceImpl.java
+15
-14
BLessonController.java
...cisoft/business/blesson/controller/BLessonController.java
+21
-1
BAppointRepository.java
.../org/rcisoft/business/blesson/dao/BAppointRepository.java
+14
-1
BLessonPersonRepository.java
...rcisoft/business/blesson/dao/BLessonPersonRepository.java
+109
-3
BLessonRepository.java
...a/org/rcisoft/business/blesson/dao/BLessonRepository.java
+61
-40
AddMyLearnLessonDTO.java
...org/rcisoft/business/blesson/dto/AddMyLearnLessonDTO.java
+15
-0
AppointLessonDTO.java
...va/org/rcisoft/business/blesson/dto/AppointLessonDTO.java
+6
-1
BLessonPerson.java
...va/org/rcisoft/business/blesson/entity/BLessonPerson.java
+3
-0
BLessonPersonService.java
...cisoft/business/blesson/service/BLessonPersonService.java
+9
-0
BLessonService.java
.../org/rcisoft/business/blesson/service/BLessonService.java
+6
-1
BLessonPersonServiceImpl.java
...siness/blesson/service/impl/BLessonPersonServiceImpl.java
+18
-0
BLessonServiceImpl.java
...oft/business/blesson/service/impl/BLessonServiceImpl.java
+94
-32
BMaterialController.java
...ft/business/bmaterial/controller/BMaterialController.java
+1
-1
application-mt.yml
src/main/resources/application-mt.yml
+103
-0
logback-spring.xml
src/main/resources/logback-spring.xml
+8
-0
No files found.
src/main/java/org/rcisoft/business/bchapter/service/impl/BChapterServiceImpl.java
View file @
27880130
...
...
@@ -166,7 +166,8 @@ public class BChapterServiceImpl implements BChapterService {
line
=
bChapterRepository
.
updateByPrimaryKeySelective
(
model
);
}
//插入资料表
//不是为添加章时插入资料表
if
(
StringUtils
.
isNotEmpty
(
model
.
getIsTest
())){
BMaterial
bMaterial
=
new
BMaterial
();
UserUtil
.
setCurrentPersistOperation
(
bMaterial
);
bMaterial
.
setChapterId
(
model
.
getBusinessId
());
...
...
@@ -179,8 +180,8 @@ public class BChapterServiceImpl implements BChapterService {
bMaterial
.
setType
(
model
.
getIsTest
());
bMaterial
.
setUploadType
(
"1"
);
bMaterial
.
setFileSize
(
dto
.
getFileSize
());
bMaterialRepository
.
insertMaterial
(
bMaterial
);
}
return
new
PersistModel
(
line
);
}
...
...
src/main/java/org/rcisoft/business/blesson/controller/BLessonController.java
View file @
27880130
...
...
@@ -65,7 +65,7 @@ public class BLessonController extends PaginationController<BLesson> {
return
Result
.
builder
(
data
,
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
addLessonDTO
);
data
.
getResult
()
);
}
/**
...
...
@@ -433,4 +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);
// }
}
src/main/java/org/rcisoft/business/blesson/dao/BAppointRepository.java
View file @
27880130
package
org
.
rcisoft
.
business
.
blesson
.
dao
;
import
org.rcisoft.business.blesson.dto.AppointLessonDTO
;
import
org.rcisoft.business.blesson.dto.CancelAppointDTO
;
import
org.rcisoft.business.blesson.entity.BAppoint
;
import
org.rcisoft.business.blesson.entity.BLessonPerson
;
...
...
@@ -19,7 +20,7 @@ public interface BAppointRepository extends BaseMapper<BAppoint> {
/**
*
按课程
Id 查询 bAppoint
* Id 查询 bAppoint
*
*/
@Select
(
"<script>select * from b_appoint where 1=1 "
...
...
@@ -29,5 +30,17 @@ public interface BAppointRepository extends BaseMapper<BAppoint> {
+
"</script>"
)
@ResultMap
(
value
=
"BaseResultMap"
)
BAppoint
selectById
(
String
bAppointId
);
/**
* 按课程Id 查询 bAppoint
*
*/
@Select
(
"<script>select * from b_appoint where 1=1 "
+
"and del_flag != 1 "
+
"and flag = 1 "
+
"and lesson_id = #{lessonId} "
+
"</script>"
)
@ResultMap
(
value
=
"BaseResultMap"
)
List
<
BAppoint
>
selectByLessonId
(
AppointLessonDTO
param
);
}
src/main/java/org/rcisoft/business/blesson/dao/BLessonPersonRepository.java
View file @
27880130
...
...
@@ -120,10 +120,116 @@ public interface BLessonPersonRepository extends BaseMapper<BLessonPerson> {
/**
* 根据课程id查询学生id
* @param LessonId
* @param param
* @return
*/
@Select
(
"<script>select business_id,person_id from b_lesson_person where 1=1 "
+
"and del_flag = 0 and flag = 1 "
+
"AND person_id IN"
+
"<foreach item='item' index='index' collection='appointPersonList' open='(' close=')' separator=','> "
+
"#{item} "
+
"</foreach>"
+
"and lesson_id = #{lessonId}</script>"
)
@ResultMap
(
value
=
"BaseResultMap"
)
List
<
BLessonPerson
>
selectPersonIdByLessonId
(
AppointLessonDTO
param
);
/**
* 按课程id删除指派未开始
* @param param
* @return
*/
@Update
(
"<script> update b_lesson_person blp left join b_appoint ba"
+
" on blp.appoint_id = ba.business_id "
+
" and ba.del_flag != 1 and ba.flag = 1 "
+
" set blp.flag = '0' "
+
" where 1=1 "
+
" and blp.is_finish = '0' "
+
" and ba.lesson_id = #{lessonId} "
+
"</script>"
)
int
deleteNotStartByLessonId
(
AppointLessonDTO
param
);
/**
* 已学习的取消指派
* @param param
* @return
*/
@Select
(
"<script>select business_id,person_id from b_lesson_person where lesson_id = #{LessonId}</script>"
)
@Update
(
"<script> update b_lesson_person blp left join b_appoint ba"
+
" on blp.appoint_id = ba.business_id "
+
" and ba.del_flag != 1 and ba.flag = 1 "
+
" set blp.flag = '0' "
+
" <set>"
+
" <if test=\"updateBy != null and updateBy != ''\">update_by=#{updateBy},</if>"
+
" <if test=\"updateDate != null and updateDate != ''\">update_date=#{updateDate},</if>"
+
" <if test=\"delFlag != null and delFlag != ''\">del_flag=#{delFlag},</if>"
+
" <if test=\"flag != null and flag != ''\">flag=#{flag},</if>"
+
" <if test=\"remarks != null and remarks != ''\">remarks=#{remarks},</if>"
+
" <if test=\"isAppoint != null and isAppoint != ''\">is_appoint=#{isAppoint},</if>"
+
" appoint_id=#{appointId},"
+
" </set>"
+
" where 1=1 "
+
" and blp.is_finish != '0' "
+
" and ba.lesson_id = #{lessonId} "
+
"</script>"
)
int
cancelAppointByPersons
(
BLessonPerson
param
);
/**
* 按Id批量更新
* @param param
* @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=#{item.updateBy},</if>"
+
" <if test=\"item.updateDate != null and item.updateDate != ''\">update_date=#{item.updateDate},</if>"
+
" appoint_id=#{item.appointId}, "
+
" is_appoint=#{item.isAppoint}, "
+
" </set> "
+
" where business_id=#{item.businessId} "
+
" </foreach>"
+
"</script>"
)
int
updateList
(
@Param
(
"param"
)
List
<
BLessonPerson
>
param
);
@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, "
+
" is_appoint) "
+
" values "
+
" <foreach collection='list' 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.isAppoint}) "
+
" </foreach>"
+
"</script>"
)
int
insertList
(
@Param
(
"param"
)
List
<
BLessonPerson
>
param
);
/**
* 根据课程id PersonId查询
*/
@Select
(
"<script>select * from b_lesson_person where 1=1 "
+
"and del_flag = 0 and flag = 1 "
+
"AND person_id = #{userId} "
+
"and lesson_id = #{lessonId}</script>"
)
@ResultMap
(
value
=
"BaseResultMap"
)
List
<
BLessonPerson
>
selectPersonIdByLessonId
(
String
LessonId
);
List
<
BLessonPerson
>
selectByPersonAndLesson
(
AddMyLearnLessonDTO
param
);
@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,is_collect, "
+
" is_appoint) "
+
" values "
+
" (#{param.businessId}, #{param.createBy},#{param.createDate},#{param.updateBy},#{param.updateDate}, "
+
" #{param.delFlag}, #{param.flag},#{param.remarks},#{param.personId},#{param.lessonId}, "
+
" #{param.learnProgress}, #{param.isFinish},#{param.isCollect},"
+
" #{param.isAppoint}) "
+
"</script>"
)
int
insertBlessonPerson
(
@Param
(
"param"
)
BLessonPerson
param
);
}
src/main/java/org/rcisoft/business/blesson/dao/BLessonRepository.java
View file @
27880130
...
...
@@ -141,11 +141,13 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
" and suc.del_flag != 1 and suc.flag = 1 "
+
" and bv.del_flag != 1 and bv.flag = 1 "
+
" and bl.release_state = 2 "
+
" and ((bvs.type = 0 and bvs.target_id = #{curUser.userId}) "
+
" <if test=\"departs != null and departs.size() > 0 \"> "
+
" 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 \"> "
+
" or (bvs.type = 1 and bvs.target_id in "
+
" <foreach item='item' index='index' collection='departs' open='(' separator=',' close=')'> #{item} </foreach>) "
+
" </if>) "
+
" <foreach item='item' index='index' collection='model.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} "
+
...
...
@@ -214,11 +216,13 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
" and suc.del_flag != 1 and suc.flag = 1 "
+
" and bv.del_flag != 1 and bv.flag = 1 "
+
" and bl.release_state = 2 "
+
" and ((bvs.type = 0 and bvs.target_id = #{curUser.userId}) "
+
" <if test=\"departs != null and departs.size() > 0 \"> "
+
" 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 \"> "
+
" or (bvs.type = 1 and bvs.target_id in "
+
" <foreach item='item' index='index' collection='departs' open='(' separator=',' close=')'> #{item} </foreach>) "
+
" </if>) "
+
" <foreach item='item' index='index' collection='model.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} "
+
...
...
@@ -280,11 +284,13 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
" and blp.person_id = #{curUser.userId} ) "
+
" and b.release_state = 2 "
+
" and ((bvs.type = 0 and bvs.target_id = #{curUser.userId}) "
+
" <if test=\"departs != null and departs.size() > 0 \"> "
+
" 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 \"> "
+
" or (bvs.type = 1 and bvs.target_id in "
+
" <foreach item='item' index='index' collection='departs' open='(' separator=',' close=')'> #{item} </foreach>) "
+
" </if>) "
+
" <foreach item='item' index='index' collection='model.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"
+
"</script>"
)
@ResultMap
(
value
=
"BaseResultMap"
)
...
...
@@ -327,11 +333,13 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
" and bv.corp_id = #{param.corpId} "
+
" and bl.release_state = 2 "
+
" and ((bvs.type = 0 and bvs.target_id = #{param.userId}) "
+
" <if test=\"param.departs != null and param.departs.size() > 0 \"> "
+
" 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 \"> "
+
" or (bvs.type = 1 and bvs.target_id in "
+
" <foreach item='item' index='index' collection='param.departs' open='(' separator=',' close=')'> #{item} </foreach>)"
+
" </if>) "
+
" <foreach item='item' index='index' collection='model.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},'%') "
+
" or su.name like CONCAT('%',#{param.viewParam},'%'))</if> "
+
" <if test= \" courseIds !=null and courseIds.size() > 0 \">and course_id in "
+
...
...
@@ -495,29 +503,33 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
" 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 "
+
" 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 "
+
" 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 suc.del_flag != 1 and suc.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 suc.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>"
+
" 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 \"> "
+
" or (bvs.type = 1 and bvs.target_id in "
+
" <foreach item='item' index='index' collection='model.departs' open='(' separator=',' close=')'> #{item} </foreach>)"
+
" </if>) "
+
" </if> "
+
" or (bl.business_id not in (select lesson_id from b_viewrange where del_flag != 1 and flag = 1 ))) "
+
" <if test= \" model.viewParam !=null and model.viewParam != ''\">and (bl.lesson_name like CONCAT('%',#{model.viewParam},'%') "
+
" or su.name like CONCAT('%',#{model.viewParam},'%'))</if> "
+
" <if test= \" model.courseIds !=null and model.courseIds.size() > 0 \">and course_id in "
+
...
...
@@ -541,27 +553,29 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
" 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 "
+
" 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 "
+
" 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 suc.del_flag != 1 and suc.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 suc.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>"
+
" and bl.release_state = 2 "
+
" and ((brs.type = 0 and brs.target_id = #{model.userId}) "
+
" <if test=\"model.departs != null and model.departs.size() > 0 \"> "
+
" or (brs.type = 1 and brs.target_id in "
+
" <if test=\"model.departs != null and model.departs.size() > 0 \"> "
+
" <foreach item='item' index='index' collection='model.departs' open='(' separator=',' close=')'> #{item} </foreach>)"
+
" </if>) "
+
" <if test= \" model.viewParam !=null and model.viewParam != ''\">and (bl.lesson_name like CONCAT('%',#{model.viewParam},'%') "
+
...
...
@@ -590,26 +604,31 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
" 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 "
+
" 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 "
+
" 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 suc.del_flag != 1 and suc.flag = 1 "
+
" and bv.del_flag != 1 and bv.flag = 1 "
+
" and bl.corp_id = #{model.corpId} "
+
" and su.corp_id = #{model.corpId} "
+
" and suc.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}) "
+
" or (bl.lecturer_id = #{model.userId}) "
+
" <if test=\"model.departs != null and model.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>) "
+
" </if>) "
+
" <foreach item='item' index='index' collection='model.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 在学人数
" <if test= \" model.viewParam !=null and model.viewParam != ''\">and (bl.lesson_name like CONCAT('%',#{model.viewParam},'%') "
+
" or su.name like CONCAT('%',#{model.viewParam},'%'))</if> "
+
...
...
@@ -632,37 +651,37 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
@Select
(
" <script> select distinct bl.* "
+
" ,su.name lecturerName "
+
" ,suc.name createByName "
+
" from b_lesson_person blp "
+
" left join b_lesson bl on blp.lesson_id = bl.business_id "
+
" 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 "
+
" 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 "
+
" 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 suc.del_flag != 1 and suc.flag = 1 "
+
" and blp.del_flag != 1 and blp.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 suc.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>"
+
" and bl.release_state = 2 "
+
" and blp.is_collect = 1 "
+
" and blp.person_id = #{model.userId} "
+
" 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 \"> "
+
" or (bvs.type = 1 and bvs.target_id in "
+
" <foreach item='item' index='index' collection='model.departs' open='(' separator=',' close=')'> #{item} </foreach>)"
+
" </if>) "
+
" </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 关注人数
" <if test= \" model.viewParam !=null and model.viewParam != ''\">and (bl.lesson_name like CONCAT('%',#{model.viewParam},'%') "
+
" or su.name like CONCAT('%',#{model.viewParam},'%'))</if> "
+
" <if test= \" model.courseIds !=null and model.courseIds.size() > 0 \">and course_id in "
+
...
...
@@ -723,10 +742,12 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
" and blp.person_id = #{model.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 \"> "
+
" or (bvs.type = 1 and bvs.target_id in "
+
" <foreach item='item' index='index' collection='model.departs' open='(' separator=',' close=')'> #{item} </foreach>) "
+
" </if>) "
+
" <foreach item='item' index='index' collection='model.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= \" model.viewParam !=null and model.viewParam != ''\">and (bl.lesson_name like CONCAT('%',#{model.viewParam},'%') "
+
" or su.name like CONCAT('%',#{model.viewParam},'%'))</if> "
+
" <if test= \" model.courseIds !=null and model.courseIds.size() > 0 \">and course_id in "
+
...
...
src/main/java/org/rcisoft/business/blesson/dto/AddMyLearnLessonDTO.java
0 → 100644
View file @
27880130
package
org
.
rcisoft
.
business
.
blesson
.
dto
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
@Data
public
class
AddMyLearnLessonDTO
{
@ApiModelProperty
(
value
=
"课程Id"
,
required
=
true
)
private
String
lessonId
;
private
String
corpId
;
private
String
userId
;
}
src/main/java/org/rcisoft/business/blesson/dto/AppointLessonDTO.java
View file @
27880130
...
...
@@ -3,15 +3,20 @@ package org.rcisoft.business.blesson.dto;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.List
;
@Data
public
class
AppointLessonDTO
{
@ApiModelProperty
(
value
=
"课程Id"
,
required
=
true
)
private
String
lessonId
;
@ApiModelProperty
(
value
=
"
推荐范围(人
)多人之间用','隔开"
,
required
=
true
)
@ApiModelProperty
(
value
=
"
指派范围(人id
)多人之间用','隔开"
,
required
=
true
)
private
String
appointPerson
;
//指派人id集合
private
List
<
String
>
appointPersonList
;
private
String
userId
;
private
String
corpId
;
...
...
src/main/java/org/rcisoft/business/blesson/entity/BLessonPerson.java
View file @
27880130
...
...
@@ -100,6 +100,9 @@ public class BLessonPerson extends IdEntity<BLessonPerson> {
@Transient
private
String
lessonType
;
@Transient
private
String
corpId
;
//初始化
public
void
initModel
(){
UserUtil
.
setCurrentPersistOperation
(
this
);
...
...
src/main/java/org/rcisoft/business/blesson/service/BLessonPersonService.java
View file @
27880130
...
...
@@ -47,4 +47,13 @@ public interface BLessonPersonService {
* @return
*/
PersistModel
cancelAppoint
(
CancelAppointDTO
cancelAppointDTO
);
/**
* 添加我学习课程
* @author: zhangqingle
* @param addMyLearnLessonDTO
* @return
*/
PersistModel
addMyLearnLesson
(
AddMyLearnLessonDTO
addMyLearnLessonDTO
);
}
src/main/java/org/rcisoft/business/blesson/service/BLessonService.java
View file @
27880130
...
...
@@ -6,7 +6,6 @@ import org.rcisoft.business.blesson.entity.BLesson;
import
org.rcisoft.core.aop.PageUtil
;
import
org.rcisoft.core.model.PersistModel
;
import
org.rcisoft.sys.user.bean.CurUser
;
import
org.rcisoft.sys.user.entity.SysUser
;
import
java.util.List
;
...
...
@@ -141,6 +140,12 @@ public interface BLessonService{
*/
List
<
FindLessonRecommendRspDTO
>
queryRecommendByLessonId
(
FindLessonRecommendDTO
param
);
/**
* 指派课程
* @param appointLessonDTO
* @return
*/
PersistModel
appointLessonToPerson
(
AppointLessonDTO
appointLessonDTO
);
/**
* 课程培训条件查询
...
...
src/main/java/org/rcisoft/business/blesson/service/impl/BLessonPersonServiceImpl.java
View file @
27880130
...
...
@@ -115,4 +115,22 @@ public class BLessonPersonServiceImpl implements BLessonPersonService {
return
new
PersistModel
(
1
,
result
);
}
@Override
public
PersistModel
addMyLearnLesson
(
AddMyLearnLessonDTO
addMyLearnLessonDTO
)
{
List
<
BLessonPerson
>
bLessonPersons
=
bLessonPersonRepository
.
selectByPersonAndLesson
(
addMyLearnLessonDTO
);
BLessonPerson
bLessonPerson
;
if
(
bLessonPersons
!=
null
&&
bLessonPersons
.
size
()>
0
){
bLessonPerson
=
bLessonPersons
.
get
(
0
);
bLessonPerson
.
setIsFinish
(
"1"
);
bLessonPersonRepository
.
updateByPrimaryKeySelective
(
bLessonPerson
);
}
else
{
bLessonPerson
=
new
BLessonPerson
();
bLessonPerson
.
initModel
();
bLessonPerson
.
setLessonId
(
addMyLearnLessonDTO
.
getLessonId
());
bLessonPersonRepository
.
insertBlessonPerson
(
bLessonPerson
);
}
bLessonRepository
.
personNumberPlusOne
(
addMyLearnLessonDTO
.
getLessonId
());
return
null
;
}
}
src/main/java/org/rcisoft/business/blesson/service/impl/BLessonServiceImpl.java
View file @
27880130
package
org
.
rcisoft
.
business
.
blesson
.
service
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.sun.org.apache.regexp.internal.RE
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.rcisoft.business.bcourse.dao.BCourseRepository
;
...
...
@@ -20,13 +18,10 @@ import org.rcisoft.core.constant.MessageConstant;
import
org.rcisoft.core.exception.ServiceException
;
import
org.rcisoft.core.model.PersistModel
;
import
org.rcisoft.core.result.ResultExceptionEnum
;
import
org.rcisoft.core.result.ResultServiceEnums
;
import
org.rcisoft.core.util.IdGen
;
import
org.rcisoft.core.util.UserUtil
;
import
org.rcisoft.sys.user.bean.CurUser
;
import
org.rcisoft.sys.user.bean.CurUser
;
import
org.rcisoft.sys.user.dao.SysUserMapper
;
import
org.rcisoft.sys.user.entity.SysUser
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -35,7 +30,6 @@ import org.springframework.transaction.annotation.Transactional;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.lang.reflect.Array
;
import
java.util.*
;
import
static
java
.
util
.
Arrays
.
asList
;
...
...
@@ -232,7 +226,7 @@ public class BLessonServiceImpl implements BLessonService {
bLessonRepository
.
insertLessonLabel
(
bLessonLabels
);
}
}
return
new
PersistModel
(
line
);
return
new
PersistModel
(
line
,
model
);
}
...
...
@@ -383,6 +377,73 @@ public class BLessonServiceImpl implements BLessonService {
return
findLessonPersonRecommend
;
}
@Override
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
readOnly
=
false
)
public
PersistModel
appointLessonToPerson
(
AppointLessonDTO
appointLessonDTO
)
{
if
(
StringUtils
.
isEmpty
(
appointLessonDTO
.
getAppointPerson
())){
throw
new
ServiceException
(
ResultExceptionEnum
.
INVALID_PARAMETER_VALUE
);
}
//按课程查询指派表是否为空
List
<
BAppoint
>
bAppoints
=
bAppointRepository
.
selectByLessonId
(
appointLessonDTO
);
//将指派人截取翻入List中
List
<
String
>
userIds
=
asList
(
StringUtils
.
split
(
appointLessonDTO
.
getAppointPerson
(),
","
));
BAppoint
bAppoint
;
if
(
bAppoints
==
null
||
bAppoints
.
size
()
==
0
){
//插入指派表
bAppoint
=
new
BAppoint
();
bAppoint
.
setLessonId
(
appointLessonDTO
.
getLessonId
());
bAppoint
.
setAppointerId
(
appointLessonDTO
.
getUserId
());
bAppoint
.
setDesignatedId
(
appointLessonDTO
.
getAppointPerson
());
UserUtil
.
setCurrentPersistOperation
(
bAppoint
);
bAppointRepository
.
insertSelective
(
bAppoint
);
}
else
{
bAppoint
=
bAppoints
.
get
(
0
);
bAppoint
.
setAppointerId
(
appointLessonDTO
.
getUserId
());
bAppoint
.
setDesignatedId
(
appointLessonDTO
.
getAppointPerson
());
UserUtil
.
setCurrentMergeOperation
(
bAppoint
);
bAppointRepository
.
updateByPrimaryKeySelective
(
bAppoint
);
//删除指派未开始
bLessonPersonRepository
.
deleteNotStartByLessonId
(
appointLessonDTO
);
//指派已开始更新为不指派
BLessonPerson
bLessonPerson
=
new
BLessonPerson
();
bLessonPerson
.
setIsAppoint
(
"0"
);
bLessonPerson
.
setAppointId
(
""
);
bLessonPerson
.
setLessonId
(
appointLessonDTO
.
getLessonId
());
UserUtil
.
setCurrentMergeOperation
(
bLessonPerson
);
bLessonPersonRepository
.
cancelAppointByPersons
(
bLessonPerson
);
}
//插入b_lesson_person表
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
());
}
//更新b_lesson_person表
bLessonPersonRepository
.
updateList
(
inLessonPersons
);
//从学生Id中删除已更新的学生id
userIds
.
removeAll
(
inLessonIds
);
//剩余学生添加至b_lesson_person表
List
<
BLessonPerson
>
bLessonPersonOthers
=
new
ArrayList
<>();
userIds
.
forEach
(
userId
->{
BLessonPerson
bLessonPerson
=
new
BLessonPerson
();
bLessonPerson
.
initModel
();
bLessonPerson
.
setAppointId
(
bAppoint
.
getBusinessId
());
bLessonPerson
.
setIsAppoint
(
"1"
);
bLessonPerson
.
setIsFinish
(
"0"
);
bLessonPerson
.
setLessonId
(
appointLessonDTO
.
getLessonId
());
bLessonPerson
.
setPersonId
(
userId
);
bLessonPersonOthers
.
add
(
bLessonPerson
);
});
int
line
=
bLessonPersonRepository
.
insertList
(
bLessonPersonOthers
);
return
new
PersistModel
(
line
,
MessageConstant
.
MESSAGE_ALERT_SUCCESS
);
}
@Override
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
readOnly
=
false
)
...
...
@@ -434,6 +495,31 @@ public class BLessonServiceImpl implements BLessonService {
return
ListAllLesson
;
}
@Override
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
readOnly
=
false
)
public
List
<
BLesson
>
theLessonMangageByPagination
(
PageUtil
pageUtil
,
CurUser
curUser
,
BLesson
bLesson
)
{
//查询当前登录人所在的企业
String
corpId
=
curUser
.
getCorpId
();
String
userId
=
curUser
.
getUserId
();
//查询当前登录人有什么角色
List
<
String
>
roleList
=
sysUserMapper
.
queryRoleTypeByUserId
(
userId
);
boolean
isAdmin
=
false
;
Set
<
CurUser
>
uids
=
new
HashSet
<>();
for
(
String
role
:
roleList
)
{
if
(
"1"
.
equals
(
role
))
{
isAdmin
=
true
;
break
;
}
else
if
(
"2"
.
equals
(
role
))
{
// 调用 feign 获取当前部门及子部门 --->所有人
uids
.
addAll
(
Arrays
.
asList
(
new
CurUser
(),
new
CurUser
()));
}
}
//自己
uids
.
add
(
curUser
);
//查讯课程的语句
List
<
BLesson
>
bLessons
=
bLessonRepository
.
selectAllManageLesson
(
uids
,
bLesson
,
isAdmin
,
corpId
);
return
bLessons
;
}
//遍历标签放入List中
List
<
BLessonLabel
>
addLabel
(
BLesson
model
){
...
...
@@ -493,30 +579,6 @@ public class BLessonServiceImpl implements BLessonService {
return
bViewrange
;
}
@Override
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
readOnly
=
false
)
public
List
<
BLesson
>
theLessonMangageByPagination
(
PageUtil
pageUtil
,
CurUser
curUser
,
BLesson
bLesson
)
{
//查询当前登录人所在的企业
String
corpId
=
curUser
.
getCorpId
();
String
userId
=
curUser
.
getUserId
();
//查询当前登录人有什么角色
List
<
String
>
roleList
=
sysUserMapper
.
queryRoleTypeByUserId
(
userId
);
boolean
isAdmin
=
false
;
Set
<
CurUser
>
uids
=
new
HashSet
<>();
for
(
String
role
:
roleList
)
{
if
(
"1"
.
equals
(
role
))
{
isAdmin
=
true
;
break
;
}
else
if
(
"2"
.
equals
(
role
))
{
// 调用 feign 获取当前部门及子部门 --->所有人
uids
.
addAll
(
Arrays
.
asList
(
new
CurUser
(),
new
CurUser
()));
}
}
//自己
uids
.
add
(
curUser
);
//查讯课程的语句
List
<
BLesson
>
bLessons
=
bLessonRepository
.
selectAllManageLesson
(
uids
,
bLesson
,
isAdmin
,
corpId
);
return
bLessons
;
}
}
src/main/java/org/rcisoft/business/bmaterial/controller/BMaterialController.java
View file @
27880130
...
...
@@ -35,7 +35,7 @@ public class BMaterialController extends PaginationController<BMaterial> {
private
BMaterialService
bMaterialServiceImpl
;
@ApiOperation
(
value
=
"1301 添加
"
,
notes
=
"添加
"
)
@ApiOperation
(
value
=
"1301 添加
保存资料"
,
notes
=
"保存资料
"
)
@PostMapping
(
value
=
"/add"
)
public
Result
add
(
CurUser
curUser
,
@Valid
BMaterial
bMaterial
,
BindingResult
bindingResult
)
{
PersistModel
data
=
bMaterialServiceImpl
.
save
(
bMaterial
);
...
...
src/main/resources/application-mt.yml
0 → 100644
View file @
27880130
server
:
port
:
8081
tomcat
:
max-threads
:
300
servlet
:
context-path
:
/
#uri-encoding: UTF-8
type
:
dev1
maxHttpHeaderSize
:
102400
#logging:
# level:
# root: INFO
# org.springframework.web: DEBUG
druid
:
url
:
jdbc:mysql://mt_mysql:3306/edu_db?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=false
username
:
root
password
:
91isoft
initial-size
:
1
min-idle
:
1
max-active
:
20
test-on-borrow
:
true
initial-size
:
1
min-idle
:
1
max-active
:
20
test-on-borrow
:
true
mybatis
:
mapper-locations
:
classpath:mapper/**/**/*.xml
mapper
:
mappers
:
-
org.rcisoft.core.base.BaseMapper
not-empty
:
false
identity
:
MYSQL
pagehelper
:
helperDialect
:
mysql
reasonable
:
true
supportMethodsArguments
:
true
params
:
count=countSql
spring
:
jackson
:
default-property-inclusion
:
non_null
date-format
:
yyyy-MM-dd
time-zone
:
GMT+8
mvc
:
throw-exception-if-no-handler-found
:
true
resources
:
add-mappings
:
false
freemarker
:
charset
:
UTF-8
suffix
:
.ftl
template-loader-path
:
classpath:/templates/
servlet
:
multipart
:
max-file-size
:
100MB
max-request-size
:
100MB
global
:
lk
:
publicalias
:
publiccert
storePwd
:
rcrtcyedu2
subject
:
edu2
licPath
:
/lk/license.lic
pubPath
:
/lk/publicCerts.store
path
:
base_upload_server_location
:
/working/resource/eduServer/
course_location
:
course
lesson_location
:
lesson
sl_location
:
sl
image_location
:
/upload
video_location
:
video
audio_location
:
audio
temp_location
:
temp
file_location
:
file
ppt_location
:
ppt
pdf_location
:
pdf
cut_pdf_location
:
cutPdf
cource_logo_location
:
/course/logo
other
:
is_server_linux
:
5
cut_pdf_num
:
30
libreoffice
:
ip
:
192.168.1.125
port
:
10188
mt
:
api
:
http://221.239.114.20:6789/api/
eureka
:
instance
:
hostname
:
localhost
client
:
register-with-eureka
:
false
fetch-registry
:
false
\ No newline at end of file
src/main/resources/logback-spring.xml
View file @
27880130
...
...
@@ -72,4 +72,12 @@
</root>
</springProfile>
<springProfile
name=
"mt"
>
<root
level=
"info"
>
<appender-ref
ref=
"consoleLog"
/>
<appender-ref
ref=
"fileInfoLog"
/>
<appender-ref
ref=
"fileErrorLog"
/>
</root>
</springProfile>
</configuration>
\ No newline at end of file
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