Commit 11d1cd87 authored by luzhuang's avatar luzhuang

Merge remote-tracking branch 'origin/meiteng' into meiteng

parents 647a82d3 475e349c
......@@ -62,7 +62,7 @@ public interface BBannerRepository extends BaseMapper<BBanner> {
*/
@Select("<script>select count(1) from b_banner where " +
" del_flag = 0 and flag = 1 " +
" and corp_id = corpId " +
" and corp_id = #{corpId} " +
"</script>")
int selectCountBanner(AddOrUpdateDTO param);
......
......@@ -115,7 +115,7 @@ public class BLessonController extends PaginationController<BLesson> {
@ApiOperation(value="606 分页查询大家都在学", notes="分页查询大家都在学", response = BLesson.class)
@GetMapping(value = "/queryPersonMoreByPagination")
public Result queryPersonMoreByPagination(CurUser curUser) {
public Result queryPersonMoreByPagination(CurUser curUser, BindingResult bindingResult) {
bLessonService.queryPersonMoreByPagination(getPaginationUtility(),curUser);
GridModel gridModel = getGridModelResponse();
return Result.builder(new PersistModel(1),
......@@ -126,7 +126,7 @@ public class BLessonController extends PaginationController<BLesson> {
@ApiOperation(value="607 分页查询企业推荐", notes="分页查询企业推荐", response = BLesson.class)
@GetMapping(value = "/queryRecommendByPagination")
public Result queryRecommendByPagination(CurUser curUser) {
public Result queryRecommendByPagination(CurUser curUser, BindingResult bindingResult) {
bLessonService.queryRecommendByPagination(getPaginationUtility(),curUser);
GridModel gridModel = getGridModelResponse();
return Result.builder(new PersistModel(1),
......@@ -149,7 +149,7 @@ public class BLessonController extends PaginationController<BLesson> {
@ApiOperation(value="609 分页查询可能感兴趣", notes="分页查询可能感兴趣", response = BLesson.class)
@GetMapping(value = "/queryInterestedByPagination")
public Result queryInterestedByPagination(CurUser curUser) {
public Result queryInterestedByPagination(CurUser curUser, BindingResult bindingResult) {
bLessonService.queryInterestedByPagination(getPaginationUtility(),curUser);
GridModel gridModel = getGridModelResponse();
return Result.builder(new PersistModel(1),
......@@ -198,7 +198,7 @@ public class BLessonController extends PaginationController<BLesson> {
@ApiOperation(value="613 我的课程总数(学习和发布)", notes="我的课程总数")
@GetMapping(value = "/iLessonCount")
public Result ILessonCountDTO(CurUser curUser) {
public Result ILessonCountDTO(CurUser curUser, BindingResult bindingResult ) {
String userId = curUser.getUserId();
return Result.builder(new PersistModel(1),
MessageConstant.MESSAGE_ALERT_SUCCESS,
......@@ -307,44 +307,8 @@ public class BLessonController extends PaginationController<BLesson> {
cancelAppointDTO);
}
// @ApiOperation(value="622 分页查询列表页推荐", notes="分页查询列表页推荐", response = BLesson.class)
// @GetMapping(value = "/queryRecommendListByPagination")
// public Result queryRecommendListByPagination(CurUser curUser, @Valid FindListLessonDTO param, BindingResult bindingResult) {
// List<AllCourseDTO> allCourse = null;
// if (StringUtils.isNotEmpty(param.getCourse())){
// allCourse = bCourseService.findAllCourse(curUser.getCorpId());
// }
// bLessonService.queryRecommendListByPagination(getPaginationUtility(),param,allCourse);
// GridModel gridModel = getGridModelResponse();
// return Result.builder(new PersistModel(1),
// MessageConstant.MESSAGE_ALERT_SUCCESS,
// MessageConstant.MESSAGE_ALERT_ERROR,
// gridModel);
// }
//
// @ApiOperation(value="623 分页查询列表页在学", notes="分页查询列表页推荐", response = BLesson.class)
// @GetMapping(value = "/queryLearnListByPagination")
// public Result queryLearnListByPagination(CurUser curUser, @Valid FindListLessonDTO param, BindingResult bindingResult) {
// bLessonService.queryLearnListByPagination(getPaginationUtility(),param);
// GridModel gridModel = getGridModelResponse();
// return Result.builder(new PersistModel(1),
// MessageConstant.MESSAGE_ALERT_SUCCESS,
// MessageConstant.MESSAGE_ALERT_ERROR,
// gridModel);
// }
//
// @ApiOperation(value="624 分页查询列表页收藏", notes="分页查询列表页收藏", response = BLesson.class)
// @GetMapping(value = "/queryCollectListByPagination")
// public Result queryCollectListByPagination(CurUser curUser, @Valid FindListLessonDTO param, BindingResult bindingResult) {
// bLessonService.queryCollectListByPagination(getPaginationUtility(),param);
// GridModel gridModel = getGridModelResponse();
// return Result.builder(new PersistModel(1),
// MessageConstant.MESSAGE_ALERT_SUCCESS,
// MessageConstant.MESSAGE_ALERT_ERROR,
// gridModel);
// }
// @ApiOperation(value="619 推荐课程", notes="根据ID推荐课程")
// @ApiOperation(value="622 推荐课程", notes="根据ID推荐课程")
// @PostMapping(value = "/recommend")
// public Result recommend(CurUser curUser,@Valid RecommendLessonDTO recommendLessonDTO,BindingResult bindingResult) {
// PersistModel data = bLessonService.recommendBLesson(curUser,recommendLessonDTO);
......
......@@ -44,36 +44,28 @@ public interface BLessonPersonRepository extends BaseMapper<BLessonPerson> {
//查询线上课程学员追踪图表
@Select("<script> select " +
"(select lesson_name from b_lesson where business_id = #{param.lessonId}) LessonTitle, " +
"(select count(*) from b_lesson_person where " +
" del_flag != 1 and flag = 1 " +
" <if test= \" param.isAppoint != null and param.isAppoint != ''\">and is_appoint = #{param.isAppoint} </if> " +
" and corp_id = #{param.corpId} " +
" and lesson_id = #{param.lessonId}) countAll, " +
"(select count(*) from b_lesson_person where " +
" del_flag != 1 and flag = 1 " +
" and is_finish = 0 " +
" <if test= \" param.isAppoint != null and param.isAppoint != ''\">and is_appoint = #{param.isAppoint} </if> " +
" and corp_id = #{param.corpId} " +
" and lesson_id = #{param.lessonId}) countNotStart, " +
"(select count(*) from b_lesson_person where " +
" del_flag != 1 and flag = 1 " +
" and is_finish = 1 " +
" <if test= \" param.isAppoint != null and param.isAppoint != ''\">and is_appoint = #{param.isAppoint} </if> " +
" and corp_id = #{param.corpId} " +
" and lesson_id = #{param.lessonId}) countOngoing, " +
"(select count(*) from b_lesson_person where " +
" del_flag != 1 and flag = 1 " +
" and is_finish = 2 " +
" <if test= \" param.isAppoint != null and param.isAppoint != ''\">and is_appoint = #{param.isAppoint} </if> " +
" and corp_id = #{param.corpId} " +
" and lesson_id = #{param.lessonId}) countFinish" +
" </script>")
StudentTrackingChartRspDTO studentTrackingChart(@Param("param") StudentTrackingChartDTO param);
......@@ -95,7 +87,7 @@ public interface BLessonPersonRepository extends BaseMapper<BLessonPerson> {
"and ba.del_flag != 1 and ba.flag = 1 " +
"and bl.corp_id = #{param.corpId} "+
"and blp.corp_id = #{param.corpId} "+
// "and blp.corp_id = #{param.corpId} "+
"and su.corp_id = #{param.corpId} "+
"and bl.business_id = #{param.lessonId} "+
......
......@@ -31,6 +31,7 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
" and su.del_flag != 1 and su.flag = 1 and b.lecturer_id = #{curUser.userId}" +
// " and b.corp_id = #{curUser.corpId} "+
// " and su.corp_id = #{curUser.corpId} "+
" <if test=\"releaseState!=null and releaseState != ''\">and release_state = #{releaseState} </if>" +
"order by update_date desc</script>")
......@@ -100,6 +101,11 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
" 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} "+
" and suc.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> " +
......@@ -246,7 +252,7 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
" and bp.del_flag != 1 and bp.flag = 1 " +
" and b.corp_id = #{curUser.corpId} "+
" and bp.corp_id = #{curUser.corpId} "+
// " and bp.corp_id = #{curUser.corpId} "+
" GROUP BY " +
" bla.business_id " +
......@@ -269,7 +275,7 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
" 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.corp_id = #{curUser.corpId} "+
" and blp.person_id = #{curUser.userId} ) " +
" and b.release_state = 2 " +
......@@ -523,51 +529,6 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
@ResultMap(value = "BaseResultMap")
List<BLesson> queryListAllLessonByPagination(@Param("model") FindListLessonDTO model);
//查询管理的全部课程
//isAdmin <if test= " !isAdmin ">
// teacher in (uid)
// </IF>
@Select("<script>" +
"SELECT " +
"les.*, " +
"CONCAT( " +
"IFNULL(CONCAT(b3.c_name,\".\"),\"\"), " +
"IFNULL(CONCAT(b2.c_name,\".\"),\"\"), " +
" IFNULL(b1.c_name,\"\") " +
") AS courseName ," +
"u1.name AS createByName " +
"FROM " +
"b_lesson les " +
"LEFT JOIN b_course b1 ON b1.business_id = les.course_id " +
"AND b1.corp_id = #{corpId} " +
"and b1.del_flag != 1 and b1.flag = 1 "+
"LEFT JOIN b_course b2 ON b2.business_id = b1.pid " +
"AND b2.corp_id = #{corpId} " +
"and b2.del_flag != 1 and b2.flag = 1 "+
"LEFT JOIN b_course b3 ON b3.business_id = b2.pid " +
"AND b3.corp_id = #{corpId} " +
"and b3.del_flag != 1 and b3.flag = 1 "+
"LEFT JOIN s_user u1 ON u1.business_id = les.lecturer_id " +
"AND u1.corp_id = #{corpId}" +
"and u1.del_flag != 1 and u1.flag = 1 "+
"WHERE 1=1 " +
"and les.del_flag != 1 and les.flag = 1 "+
"AND les.corp_id = #{corpId}" +
"<if test='!isAdmin'>" +
"AND les.lecturer_id IN" +
"<foreach item='item' index='index' collection='CurUserSet' open='(' close=')' separator=','> " +
"#{item.userId} " +
"</foreach>" +
"</if> " +
"<if test=\"bLesson.lessonName!=null and bLesson.lessonName!=''\">AND les.lesson_name like '%${bLesson.lessonName}%' </if>" +
"<if test=\"bLesson.lecturerId!=null and bLesson.lecturerId!=''\">AND u1.name like '%${bLesson.lecturerId}%' </if>" +
"<if test=\"bLesson.releaseState!=null and bLesson.releaseState!=''\">AND les.release_state = #{bLesson.releaseState} </if>" +
" order by les.release_date desc </script>")
@ResultMap(value = "BaseResultMap")
List<BLesson> selectAllManageLesson(@Param("C" +
"urUserSet") Set<CurUser> CurUserSet, @Param("bLesson") BLesson bLesson, @Param("isAdmin") boolean isAdmin, @Param("corpId") String corpId) ;
/**
* 列表页分页查询推荐课程
* @param model
......@@ -607,9 +568,10 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
" <if test= \" model.courseIds !=null and model.courseIds.size() > 0 \">and course_id in " +
" <foreach item='item' index='index' collection='model.courseIds' open='(' separator=',' close=')'> #{item} </foreach> " +
" </if> " +
" <if test=\"model.releaseDateSort !=null and model.releaseDateSort !='' and model.releaseDateSort =='0'.toString()\"> ORDER BY bl.release_date DESC </if> "+
" <if test=\"model.releaseDateSort !=null and model.releaseDateSort !='' and model.releaseDateSort =='1'.toString()\"> ORDER BY bl.release_date ASC "+
" </if> "+
// " <if test=\"model.releaseDateSort !=null and model.releaseDateSort !='' and model.releaseDateSort =='0'.toString()\"> ORDER BY bl.release_date DESC </if> "+
// " <if test=\"model.releaseDateSort !=null and model.releaseDateSort !='' and model.releaseDateSort =='1'.toString()\"> ORDER BY bl.release_date ASC "+
// " </if> "+
" order by br.update_date " +
"</script>")
@ResultMap(value = "BaseResultMap")
List<BLesson> queryRecommendListByPagination(@Param("model") FindListLessonDTO model);
......@@ -621,48 +583,42 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
* @param model
* @return
*/
@Select(" <script> select distinct bl.* " +
@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 " +
// " 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_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 " +
// " 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 blp.del_flag != 1 and blp.flag = 1 " +
// " and br.del_flag != 1 and br.flag = 1 " +
// " and bla.del_flag != 1 and bla.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 br.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.person_id = #{model.userId} " +
// " 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 " +
// " <foreach item='item' index='index' collection='model.departs' open='(' separator=',' close=')'> #{item} </foreach>)" +
// " </if>) " +
" and ((bvs.type = 0 and bvs.target_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>) " +
" 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> " +
" <if test= \" model.courseIds !=null and model.courseIds.size() > 0 \">and course_id in " +
" <foreach item='item' index='index' collection='model.courseIds' open='(' separator=',' close=')'> #{item} </foreach> " +
" </if> " +
" <if test=\"model.releaseDateSort !=null and model.releaseDateSort !='' and model.releaseDateSort =='0'.toString()\"> ORDER BY bl.release_date DESC </if> "+
" <if test=\"model.releaseDateSort !=null and model.releaseDateSort !='' and model.releaseDateSort =='1'.toString()\"> ORDER BY bl.release_date ASC "+
" </if> "+
// " <if test=\"model.releaseDateSort !=null and model.releaseDateSort !='' and model.releaseDateSort =='0'.toString()\"> ORDER BY bl.release_date DESC </if> "+
// " <if test=\"model.releaseDateSort !=null and model.releaseDateSort !='' and model.releaseDateSort =='1'.toString()\"> ORDER BY bl.release_date ASC "+
// " </if> "+
" order by bl.person_number,bl.release_date desc " +
"</script>")
@ResultMap(value = "BaseResultMap")
List<BLesson> queryLearnListByPagination(@Param("model") FindListLessonDTO model);
......@@ -680,43 +636,153 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
" left join s_user su on su.business_id = bl.lecturer_id " +
" left join s_user suc on suc.business_id = bl.create_by " +
// " 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_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 br.del_flag != 1 and br.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 br.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 ((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 " +
// " <foreach item='item' index='index' collection='model.departs' open='(' separator=',' close=')'> #{item} </foreach>)" +
// " </if>) " +
" and ((bvs.type = 0 and bvs.target_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 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 " +
" <foreach item='item' index='index' collection='model.courseIds' open='(' separator=',' close=')'> #{item} </foreach> " +
" </if> " +
" <if test=\"model.releaseDateSort !=null and model.releaseDateSort !='' and model.releaseDateSort =='0'.toString()\"> ORDER BY bl.release_date DESC </if> "+
" <if test=\"model.releaseDateSort !=null and model.releaseDateSort !='' and model.releaseDateSort =='1'.toString()\"> ORDER BY bl.release_date ASC "+
" </if> "+
// " <if test=\"model.releaseDateSort !=null and model.releaseDateSort !='' and model.releaseDateSort =='0'.toString()\"> ORDER BY bl.release_date DESC </if> "+
// " <if test=\"model.releaseDateSort !=null and model.releaseDateSort !='' and model.releaseDateSort =='1'.toString()\"> ORDER BY bl.release_date ASC "+
// " </if> "+
" order by bl.collect_number,bl.release_date desc " +
"</script>")
@ResultMap(value = "BaseResultMap")
List<BLesson> queryCollectListByPagination(@Param("model") FindListLessonDTO model);
@Select(" <script> SELECT DISTINCT b.* " +
" ,su.name lecturerName " +
" ,suc.name createByName " +
" FROM " +
" b_lesson b " +
" LEFT JOIN b_lesson_label bl ON b.business_id = bl.lesson_id" +
" inner JOIN ( " +
" SELECT " +
" bla.business_id AS bussinessId, " +
" count( 1 ) AS bsum " +
" FROM " +
" b_label bla " +
" LEFT JOIN b_lesson_label bl ON bla.business_id = bl.label_id " +
" LEFT JOIN b_lesson b ON bl.lesson_id = b.business_id " +
" LEFT JOIN b_lesson_person bp ON b.business_id = bp.lesson_id " +
" WHERE " +
" bp.person_id = #{model.userId} " +
" and b.del_flag != 1 and b.flag = 1 " +
" and bp.del_flag != 1 and bp.flag = 1 " +
" and b.corp_id = #{model.corpId} "+
" GROUP BY " +
" bla.business_id " +
" ) T ON T.bussinessId = bl.label_id " +
" left join s_user su on su.business_id = b.lecturer_id " +
" left join s_user suc on suc.business_id = b.create_by " +
" left join b_viewrange bv on b.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 " +
" 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 " +
" where blp.del_flag != 1 and blp.flag = 1 " +
" and blp.person_id = #{model.userId} ) " +
" and b.release_state = 2 " +
" and ((bvs.type = 0 and bvs.target_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 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 " +
" <foreach item='item' index='index' collection='model.courseIds' open='(' separator=',' close=')'> #{item} </foreach> " +
" </if> " +
// " <if test=\"model.releaseDateSort !=null and model.releaseDateSort !='' and model.releaseDateSort =='0'.toString()\"> ORDER BY bl.release_date DESC </if> "+
// " <if test=\"model.releaseDateSort !=null and model.releaseDateSort !='' and model.releaseDateSort =='1'.toString()\"> ORDER BY bl.release_date ASC "+
// " </if> "+
" order by T.bsum , b.collect_number desc" +
"</script>")
@ResultMap(value = "BaseResultMap")
List<BLesson> queryInterestedListByPagination(@Param("model") FindListLessonDTO model);
//查询管理的全部课程
//isAdmin <if test= " !isAdmin ">
// teacher in (uid)
// </IF>
@Select("<script>" +
"SELECT " +
"les.*, " +
"CONCAT( " +
"IFNULL(CONCAT(b3.c_name,\".\"),\"\"), " +
"IFNULL(CONCAT(b2.c_name,\".\"),\"\"), " +
" IFNULL(b1.c_name,\"\") " +
") AS courseName ," +
"u1.name AS createByName " +
"FROM " +
"b_lesson les " +
"LEFT JOIN b_course b1 ON b1.business_id = les.course_id " +
"AND b1.corp_id = #{corpId} " +
"and b1.del_flag != 1 and b1.flag = 1 "+
"LEFT JOIN b_course b2 ON b2.business_id = b1.pid " +
"AND b2.corp_id = #{corpId} " +
"and b2.del_flag != 1 and b2.flag = 1 "+
"LEFT JOIN b_course b3 ON b3.business_id = b2.pid " +
"AND b3.corp_id = #{corpId} " +
"and b3.del_flag != 1 and b3.flag = 1 "+
"LEFT JOIN s_user u1 ON u1.business_id = les.lecturer_id " +
"AND u1.corp_id = #{corpId}" +
"and u1.del_flag != 1 and u1.flag = 1 "+
"WHERE 1=1 " +
"and les.del_flag != 1 and les.flag = 1 "+
"AND les.corp_id = #{corpId}" +
"<if test='!isAdmin'>" +
"AND les.lecturer_id IN" +
"<foreach item='item' index='index' collection='CurUserSet' open='(' close=')' separator=','> " +
"#{item.userId} " +
"</foreach>" +
"</if> " +
"<if test=\"bLesson.lessonName!=null and bLesson.lessonName!=''\">AND les.lesson_name like '%${bLesson.lessonName}%' </if>" +
"<if test=\"bLesson.lecturerId!=null and bLesson.lecturerId!=''\">AND u1.name like '%${bLesson.lecturerId}%' </if>" +
"<if test=\"bLesson.releaseState!=null and bLesson.releaseState!=''\">AND les.release_state = #{bLesson.releaseState} </if>" +
" order by les.release_date desc </script>")
@ResultMap(value = "BaseResultMap")
List<BLesson> selectAllManageLesson(@Param("C" +
"urUserSet") Set<CurUser> CurUserSet, @Param("bLesson") BLesson bLesson, @Param("isAdmin") boolean isAdmin, @Param("corpId") String corpId) ;
}
......@@ -20,6 +20,7 @@ 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;
......@@ -169,8 +170,10 @@ public class BLessonServiceImpl implements BLessonService {
bViewrangeRepository.updateByLessonId(bViewrange);
//删除可见范围子表
bViewrangeRepository.deleteViewrangeSon(bViewrange);
//获取所有可见人员和部门
List<BViewrangeSon> bViewrangeSons = new ArrayList<>();
//model.getViewRangePerson()不为空 新建bViewrangeSon对象放入bViewrangeSons中 type:0人员 1部门
if (StringUtils.isNotEmpty(model.getViewRangePerson())){
String[] viewRangePerson = model.getViewRangePerson().split(",");
......@@ -258,8 +261,9 @@ public class BLessonServiceImpl implements BLessonService {
@Override
public PersistModel recommendBLesson(CurUser curUser, RecommendLessonDTO recommendLessonDTO) {
////
//
// if (StringUtils.isNotEmpty(recommendLessonDTO.getRecommendPerson()) || StringUtils.isNotEmpty(recommendLessonDTO.getRecommendDepart())){
// BLesson bLesson = new BLesson();
// BViewrange bViewrange = setBViewrangeInfo(model);
// //插入可见范围表
// bViewrangeRepository.insertSelective(bViewrange);
......@@ -317,6 +321,9 @@ public class BLessonServiceImpl implements BLessonService {
case "3":
ListAllLesson = bLessonRepository.queryCollectListByPagination(model);
break;
case "4":
ListAllLesson = bLessonRepository.queryInterestedListByPagination(model);
break;
default:
throw new ServiceException(ResultExceptionEnum.INVALID_PARAMETER_VALUE);
}
......@@ -370,6 +377,23 @@ public class BLessonServiceImpl implements BLessonService {
}
return bViewrange;
}
// //设置BRecommend信息
// BRecommend setBRecommendInfo(RecommendLessonDTO model){
// BViewrange bViewrange = new BViewrange();
// UserUtil.setCurrentPersistOperation(bViewrange);
// //设置课程id
// bViewrange.setLessonId(model.getBusinessId());
//
// //设置可见范围类型(0仅人 1仅部门 2人和部门)
// if (StringUtils.isNotEmpty(model.getViewRangePerson()) && StringUtils.isEmpty(model.getViewRangeDepart())){
// bViewrange.setType("0");
// }else if (StringUtils.isEmpty(model.getViewRangePerson()) && StringUtils.isNotEmpty(model.getViewRangeDepart())){
// bViewrange.setType("1");
// }else if (StringUtils.isNotEmpty(model.getViewRangePerson()) && StringUtils.isNotEmpty(model.getViewRangeDepart())){
// bViewrange.setType("2");
// }
// return bViewrange;
// }
@Override
public List<BLesson> theLessonMangageByPagination(PageUtil pageUtil, CurUser curUser, BLesson bLesson) {
......@@ -396,34 +420,4 @@ public class BLessonServiceImpl implements BLessonService {
return bLessons;
}
// @Override
// public List<BLesson> queryRecommendListByPagination(PageUtil pageUtil, FindListLessonDTO model, List<AllCourseDTO> allCourse) {
// List<String> departs = getDeparts();
// model.setDeparts(departs);
// List<String> courseIds;
// if (allCourse != null){
// //查询出所有子分类
// courseIds = recursion.FindSons(model.getCourse(),allCourse);
// //将一级分类放入分类集合中
// courseIds.add(model.getCourse());
// model.setCourseIds(courseIds);
// }
// List<BLesson> ListAllLesson = bLessonRepository.queryRecommendListByPagination(model);
// return ListAllLesson;
// }
//
//
// @Override
// public List<BLesson> queryLearnListByPagination(PageUtil pageUtil, FindListLessonDTO model) {
//
// List<BLesson> ListAllLesson = bLessonRepository.queryLearnListByPagination(model);
// return ListAllLesson;
// }
//
// @Override
// public List<BLesson> queryCollectListByPagination(PageUtil pageUtil, FindListLessonDTO model) {
//
// List<BLesson> ListAllLesson = bLessonRepository.queryCollectListByPagination(model);
// return ListAllLesson;
// }
}
......@@ -33,7 +33,6 @@ import java.util.List;
*/
@Slf4j
@Aspect
@Transactional(propagation = Propagation.REQUIRED,readOnly = false)
public class CurUserAspect {
@Autowired
private SysRoleService sysRoleService;
......@@ -41,7 +40,6 @@ public class CurUserAspect {
* 获取当前登陆人
* @param joinPoint
*/
@Transactional(propagation = Propagation.REQUIRED,readOnly = false)
@Before("execution(* org.rcisoft..*.controller.*.*(..))")
public void beforeInsert(JoinPoint joinPoint) {
if (joinPoint.getArgs().length < 2)
......@@ -70,7 +68,8 @@ public class CurUserAspect {
if (countAdmin==0){
//随机生成角色Id
String rId = IdGen.uuid();
log.info("----------该企业正在初始化----------");
log.info("--------------------该企业正在初始化--------------------");
//初始化角色(新加公司超级管理员)
InitAddAdminDTO initAddAdminDTO = new InitAddAdminDTO();
initAddAdminDTO.setRId(rId);
initAddAdminDTO.setRName("超级管理员");
......@@ -80,26 +79,24 @@ public class CurUserAspect {
initAddAdminDTO.setType("1");
initAddAdminDTO.setCorpId(curUser.getCorpId());
initAddAdminDTO.setRType("0");
//插入tm_admin_role表
int tmAdminRoleResult = sysRoleService.addAdminRole(initAddAdminDTO);
//设置s_role_menu表插入参数值
List<String> menuIds = new ArrayList<String>(MenuMap.menuMap.values());
//插入s_role_menu表
List<RoleMenuDTO> roleMenuDTOS = new ArrayList<>();
List<RoleMenuDTO> roleMenuDTOs = new ArrayList<>();
menuIds.forEach(menuId->{
RoleMenuDTO roleMenuDTO = new RoleMenuDTO();
roleMenuDTO.setBusinessId(IdGen.uuid());
roleMenuDTO.setRoleId(rId);
roleMenuDTO.setMenuId(IdGen.uuid());
roleMenuDTOS.add(roleMenuDTO);
roleMenuDTOs.add(roleMenuDTO);
});
int roleMenuResult = sysRoleService.addRoleMenu(roleMenuDTOS);
//插入s_r_user_role表
//设置s_r_user_role表插入参数值
UserRoleDTO userRoleDTO = new UserRoleDTO();
userRoleDTO.setBusinessId(IdGen.uuid());
userRoleDTO.setRoleId(rId);
userRoleDTO.setUserId(curUser.getUserId());
int userRoleResult = sysRoleService.addUserRole(userRoleDTO);
log.info("----------初始化完成----------");
//插入tm_admin_role、s_role_menu、s_r_user_role表
int userRoleResult = sysRoleService.addAdminRoleMenuUser(initAddAdminDTO,roleMenuDTOs,userRoleDTO);
log.info("--------------------初始化完成--------------------");
}
}
......
......@@ -77,10 +77,6 @@ public interface SysRoleService {
int queryAdminInCorp(String corpId);
int addAdminRole(InitAddAdminDTO initAddAdminDTO);
int addRoleMenu(List<RoleMenuDTO> roleMenuDTOS);
int addUserRole(UserRoleDTO userRoleDTO);
int addAdminRoleMenuUser(InitAddAdminDTO initAddAdminDTO,List<RoleMenuDTO> roleMenuDTOs,UserRoleDTO userRoleDTO);
}
......@@ -168,19 +168,10 @@ public class SysRoleServiceImpl implements SysRoleService {
}
@Override
public int addAdminRole(InitAddAdminDTO initAddAdminDTO) {
return sysRoleRepository.addAdminRole(initAddAdminDTO);
}
@Override
public int addRoleMenu(List<RoleMenuDTO> roleMenuDTOS) {
return sysRoleRepository.addRoleMenu(roleMenuDTOS);
}
@Override
public int addUserRole(UserRoleDTO userRoleDTO) {
@Transactional(propagation = Propagation.REQUIRED,isolation = Isolation.DEFAULT)
public int addAdminRoleMenuUser(InitAddAdminDTO initAddAdminDTO,List<RoleMenuDTO> roleMenuDTOs,UserRoleDTO userRoleDTO) {
sysRoleRepository.addAdminRole(initAddAdminDTO);
sysRoleRepository.addRoleMenu(roleMenuDTOs);
return sysRoleRepository.addUserRole(userRoleDTO);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment