Commit 38d84421 authored by luzhuang's avatar luzhuang

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

parents dba8e837 ba4be424
......@@ -113,15 +113,14 @@ public class BChapterController extends PaginationController<BChapter> {
MessageConstant.MESSAGE_ALERT_ERROR,
map);
}
@ApiOperation(value = "查询章节带进度", notes = "根据lessonId查询章节带进度")
@ApiOperation(value = "205 查询章节带进度", notes = "根据lessonId查询章节带进度")
@GetMapping(value = "/queryBChaptersWithProgress")
public Result queryBChaptersWithProgress(CurUser curUser,@Valid QueryChapterListDTO param,BindingResult br) {
Map<String, Object> map = new HashedMap();
map.put("chapterList", bChapterService.queryBChaptersWithProgress(param));
return Result.builder(new PersistModel(1),
MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR,
map);
bChapterService.queryBChaptersWithProgress(param));
}
//
// @ApiOperation(value = "更改章节状态", notes = "根据章节ID更改章节状态")
......
......@@ -8,6 +8,7 @@ import org.rcisoft.core.aop.PageUtil;
import org.rcisoft.core.model.PersistModel;
import java.util.List;
import java.util.Map;
/**
* Created by gwf on 2017-7-21 15:08:47.
......@@ -47,7 +48,7 @@ public interface BChapterService{
* @param model
* @return
*/
List<QueryChapterListResDTO> queryBChaptersWithProgress(QueryChapterListDTO model);
Map queryBChaptersWithProgress(QueryChapterListDTO model);
/**
* 插入
......
......@@ -84,7 +84,7 @@ public class BChapterServiceImpl implements BChapterService {
return queryChapterListResDTO(model);
}
@Override
public List<QueryChapterListResDTO> queryBChaptersWithProgress(QueryChapterListDTO model) {
public Map queryBChaptersWithProgress(QueryChapterListDTO model) {
List<QueryChapterListResDTO> queryChapterListResDTOS = queryChapterListResDTO(model);
queryChapterListResDTOS.stream().forEach(queryChapterListResDTO -> {
queryChapterListResDTO.getChildList().stream().forEach(childList -> {
......@@ -94,7 +94,10 @@ public class BChapterServiceImpl implements BChapterService {
}
});
});
return queryChapterListResDTOS;
Map map = new HashMap();
map.put("chapterList",queryChapterListResDTOS);
map.put("lessonInfo",bLessonRepository.selectByPrimaryKey(model.getLessonId()));
return map;
}
/**
......
package org.rcisoft.business.bcourse.dao;
import org.apache.ibatis.annotations.*;
import org.rcisoft.business.bcourse.dto.AllCourseDTO;
import org.rcisoft.business.bcourse.dto.QueryCourseResDTO;
import org.rcisoft.business.bcourse.entity.BCourse;
import org.rcisoft.core.base.BaseMapper;
......@@ -39,4 +40,8 @@ public interface BCourseRepository extends BaseMapper<BCourse> {
@Select("select * from b_course where course_level = 1 and del_flag != '1' and flag ='1'")
@ResultMap(value = "BaseResultMapDTO")
List<QueryCourseResDTO> queryFirstLevel();
@Select("select * from b_course where del_flag != '1' and flag ='1'")
@ResultMap(value = "AllCourseResultMap")
List<AllCourseDTO> findAllCourse();
}
package org.rcisoft.business.bcourse.dto;
import lombok.Data;
@Data
public class AllCourseDTO {
private String businessId;
private String cName;
private String pid;
private String courseLevel;
}
package org.rcisoft.business.bcourse.service;
import org.rcisoft.business.bcourse.dto.AllCourseDTO;
import org.rcisoft.business.bcourse.dto.QueryCourseResDTO;
import org.rcisoft.business.bcourse.entity.BCourse;
import org.rcisoft.core.aop.PageUtil;
......@@ -21,5 +22,11 @@ public interface BCourseService {
PersistModel updateCourse(BCourse bCoursee);
/**
* 查询所有分类放入List中
* @return
*/
List<AllCourseDTO> findAllCourse();
}
package org.rcisoft.business.bcourse.service.impl;
import org.rcisoft.business.bcourse.dao.BCourseRepository;
import org.rcisoft.business.bcourse.dto.AllCourseDTO;
import org.rcisoft.business.bcourse.dto.QueryCourseResDTO;
import org.rcisoft.business.bcourse.entity.BCourse;
import org.rcisoft.business.bcourse.service.BCourseService;
......@@ -81,4 +82,9 @@ public class BCourseServiceImpl implements BCourseService {
return new PersistModel(bCourseRepository.updateByPrimaryKeySelective(bCourse), MessageConstant.MESSAGE_ALERT_SUCCESS);
}
@Override
public List<AllCourseDTO> findAllCourse() {
return bCourseRepository.findAllCourse();
}
}
......@@ -36,8 +36,12 @@ public class BDiscussController extends PaginationController<BDiscuss> {
private BDiscussService bDiscussServiceImpl;
@ApiOperation(value="添加", notes="添加")
//@ApiImplicitParams({@ApiImplicitParam(name = "businessId", value = "businessId", required = false, dataType = "varchar")})
@ApiOperation(value="801 添加", notes="添加")
@ApiImplicitParams({@ApiImplicitParam(name = "businessId", value = "课程id 修改章节时传入", required = true, dataType = "varchar"),
@ApiImplicitParam(name = "lessonId", value = "课程ID", required = true, dataType = "varchar"),
@ApiImplicitParam(name = "content", value = "评论内容", required = true, dataType = "varchar"),
@ApiImplicitParam(name = "pid", value = "上一级(评论别人的评论需要)", required = true, dataType = "varchar"),
@ApiImplicitParam(name = "studentId", value = "评论人id", required = true, dataType = "varchar")})
@PostMapping(value = "/add")
public Result add(@Valid BDiscuss bDiscuss, BindingResult bindingResult) {
// bDiscuss.setToken(getToken());
......@@ -48,6 +52,15 @@ public class BDiscussController extends PaginationController<BDiscuss> {
bDiscuss);
}
@ApiOperation(value="802 根据课程id查询评论集合", notes="根据课程id查询评论")
@GetMapping("{lessonId:\\w+}")
public Result getDiscussByLessonId(@PathVariable String lessonId) {
return Result.builder(new PersistModel(1),
MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR,
bDiscussServiceImpl.getDiscussByLessonId(lessonId));
}
@ApiOperation(value="逻辑删除", notes="逻辑删除")
@ApiImplicitParams({@ApiImplicitParam(name = "id", value = "id", required = false, dataType = "varchar")})
@DeleteMapping("/delete/{id:\\w+}")
......@@ -83,11 +96,5 @@ public class BDiscussController extends PaginationController<BDiscuss> {
bDiscussServiceImpl.findById(id));
}
@ApiOperation(value="查看 集合", notes="查看 集合")
@GetMapping(value = "/queryBDiscussByPagination")
public GridModel listByPagination(BDiscuss bDiscuss) {
// bDiscuss.setCreateBy(UserUtil.getUserInfoProp(getToken(),UserUtil.USER_ID));
bDiscussServiceImpl.findAllByPagination(getPaginationUtility(), bDiscuss);
return getGridModelResponse();
}
}
package org.rcisoft.business.bdiscuss.dao;
import org.apache.ibatis.annotations.Param;
import org.rcisoft.business.bdiscuss.dto.BDiscussDto;
import org.rcisoft.core.base.BaseMapper;
import org.rcisoft.business.bdiscuss.entity.BDiscuss;
import org.apache.ibatis.annotations.ResultMap;
......@@ -25,5 +27,24 @@ public interface BDiscussRepository extends BaseMapper<BDiscuss> {
+ "</script>")
@ResultMap(value = "BaseResultMap" )
List<BDiscuss> queryBDiscusss(BDiscuss bDiscuss);
@Select("<script> SELECT " +
" bd.*, " +
" su.NAME AS studentName " +
"FROM " +
" b_discuss bd " +
" LEFT JOIN s_user su ON su.business_id = bd.student_id " +
"WHERE " +
" 1 = 1 " +
" AND bd.del_flag = '0' " +
" AND bd.flag = '1' "
+ "<if test=\"lessonId !=null and lessonId != '' \">and bd.lesson_id = #{lessonId} </if> "
+ "<if test=\"pid !=null and pid != '' \">and bd.pid = #{pid} </if> "
+ "<if test=\"pid ==null or pid == '' \">and bd.pid = '-1' </if> "
+ "</script>")
@ResultMap(value = "BaseResultMapDto" )
List<BDiscussDto> getDiscussByLessonId(@Param("lessonId") String lessonId, @Param("pid") String pid);
}
package org.rcisoft.business.bdiscuss.dto;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.rcisoft.business.bdiscuss.entity.BDiscuss;
import org.rcisoft.core.entity.IdEntity;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.List;
/**
* Created with on 2019-9-25 9:03:08.
*/
@Data
public class BDiscussDto extends BDiscuss {
private List<BDiscussDto> bDiscussChildList;
private String studentName;
}
......@@ -21,7 +21,6 @@ import java.util.List;
public class BDiscuss extends IdEntity<BDiscuss> {
private String lessonId;
private String pid;
......@@ -30,6 +29,8 @@ public class BDiscuss extends IdEntity<BDiscuss> {
private String level;
private String studentId;
}
package org.rcisoft.business.bdiscuss.service;
import org.rcisoft.business.bdiscuss.dto.BDiscussDto;
import org.rcisoft.business.bdiscuss.entity.BDiscuss;
import org.rcisoft.core.model.PersistModel;
import org.rcisoft.core.aop.PageUtil;
......@@ -48,6 +49,8 @@ public interface BDiscussService {
BDiscuss bDiscuss);
List<BDiscussDto> getDiscussByLessonId(String lessonId);
}
package org.rcisoft.business.bdiscuss.service.impl;
import org.rcisoft.business.bdiscuss.dto.BDiscussDto;
import org.rcisoft.core.util.UserUtil;
import org.rcisoft.core.aop.PageUtil;
import org.rcisoft.core.model.PersistModel;
......@@ -46,6 +47,7 @@ public class BDiscussServiceImpl implements BDiscussService {
return new PersistModel(line);
}
/**
* 逻辑删除
* @param bDiscuss
......@@ -98,4 +100,13 @@ public class BDiscussServiceImpl implements BDiscussService {
return bDiscussRepository.queryBDiscusss(bDiscuss);
}
@Override
public List<BDiscussDto> getDiscussByLessonId(String lessonId) {
List<BDiscussDto> bDiscussList = bDiscussRepository.getDiscussByLessonId(lessonId,"");
bDiscussList.stream().forEach(bDiscuss -> {
bDiscuss.setBDiscussChildList(bDiscussRepository.getDiscussByLessonId(lessonId,bDiscuss.getBusinessId()));
});
return bDiscussList;
}
}
......@@ -4,6 +4,9 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.rcisoft.business.bcourse.dto.AllCourseDTO;
import org.rcisoft.business.bcourse.service.BCourseService;
import org.rcisoft.business.blesson.dto.AddLessonDTO;
import org.rcisoft.business.blesson.dto.FindAllLessonDTO;
import org.rcisoft.business.blesson.dto.FirstPageQueryDTO;
......@@ -26,6 +29,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.validation.Valid;
import java.util.List;
/**
......@@ -39,6 +43,9 @@ public class BLessonController extends PaginationController<BLesson> {
@Autowired
private BLessonService bLessonService;
@Autowired
private BCourseService bCourseService;
@Autowired
private Global global;
......@@ -105,7 +112,11 @@ public class BLessonController extends PaginationController<BLesson> {
@ApiOperation(value="606 分页查询大家都在学", notes="分页查询大家都在学")
@GetMapping(value = "/queryPersonMoreByPagination")
public Result queryPersonMoreByPagination(CurUser curUser,@Valid FirstPageQueryDTO firstPageQueryDTO, BindingResult bindingResult) {
bLessonService.queryPersonMoreByPagination(getPaginationUtility());
List<AllCourseDTO> allCourse = null;
if (StringUtils.isNotEmpty(firstPageQueryDTO.getCourseLevelOne())){
allCourse = bCourseService.findAllCourse();
}
bLessonService.queryPersonMoreByPagination(getPaginationUtility(),firstPageQueryDTO,allCourse);
GridModel gridModel = getGridModelResponse();
return Result.builder(new PersistModel(1),
MessageConstant.MESSAGE_ALERT_SUCCESS,
......@@ -116,8 +127,12 @@ public class BLessonController extends PaginationController<BLesson> {
@ApiOperation(value="607 分页查询推荐", notes="分页查询推荐")
@GetMapping(value = "/queryRecommendByPagination")
public Result queryRecommendByPagination(CurUser curUser,@Valid FirstPageQueryDTO firstPageQueryDTO, BindingResult bindingResult) {
List<AllCourseDTO> allCourse = null;
if (StringUtils.isNotEmpty(firstPageQueryDTO.getCourseLevelOne())){
allCourse = bCourseService.findAllCourse();
}
String userId = curUser.getUserId();
bLessonService.queryRecommendByPagination(getPaginationUtility(),userId);
bLessonService.queryRecommendByPagination(getPaginationUtility(),userId, firstPageQueryDTO,allCourse);
GridModel gridModel = getGridModelResponse();
return Result.builder(new PersistModel(1),
MessageConstant.MESSAGE_ALERT_SUCCESS,
......@@ -128,8 +143,11 @@ public class BLessonController extends PaginationController<BLesson> {
@ApiOperation(value="608 分页查询最受关注", notes="分页查询最受关注")
@GetMapping(value = "/queryConcernByPagination")
public Result queryConcernByPagination(CurUser curUser,@Valid FirstPageQueryDTO firstPageQueryDTO, BindingResult bindingResult) {
// String userId = curUser.getUserId();
bLessonService.queryConcernByPagination(getPaginationUtility());
List<AllCourseDTO> allCourse = null;
if (StringUtils.isNotEmpty(firstPageQueryDTO.getCourseLevelOne())){
allCourse = bCourseService.findAllCourse();
}
bLessonService.queryConcernByPagination(getPaginationUtility(), firstPageQueryDTO,allCourse);
GridModel gridModel = getGridModelResponse();
return Result.builder(new PersistModel(1),
MessageConstant.MESSAGE_ALERT_SUCCESS,
......@@ -141,8 +159,11 @@ public class BLessonController extends PaginationController<BLesson> {
@ApiOperation(value="609 分页查询可能感兴趣", notes="分页查询可能感兴趣")
@GetMapping(value = "/queryInterestedByPagination")
public Result queryInterestedByPagination(CurUser curUser, @Valid FirstPageQueryDTO firstPageQueryDTO, BindingResult bindingResult) {
// String userId = curUser.getUserId();
bLessonService.queryInterestedByPagination(getPaginationUtility());
List<AllCourseDTO> allCourse = null;
if (StringUtils.isNotEmpty(firstPageQueryDTO.getCourseLevelOne())){
allCourse = bCourseService.findAllCourse();
}
bLessonService.queryInterestedByPagination(getPaginationUtility(), firstPageQueryDTO,allCourse);
GridModel gridModel = getGridModelResponse();
return Result.builder(new PersistModel(1),
MessageConstant.MESSAGE_ALERT_SUCCESS,
......
......@@ -5,6 +5,7 @@ import org.rcisoft.business.blabel.dto.QueryLabelResDTO;
import org.rcisoft.business.blabel.entity.BLabel;
import org.rcisoft.business.blesson.dto.BLessonIPublishDTO;
import org.rcisoft.business.blesson.dto.FindAllLessonDTO;
import org.rcisoft.business.blesson.dto.FirstPageQueryDTO;
import org.rcisoft.business.blesson.entity.BLesson;
import org.rcisoft.business.blesson.entity.BLessonLabel;
import org.rcisoft.core.base.BaseMapper;
......@@ -94,15 +95,15 @@ 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 " +
" <if test= \" code != null and code != ''\">and bl.code = CONCAT('%',#{code},'%') </if> " +
" <if test= \" lessonName != null and lessonName != ''\">and bl.lesson_name = CONCAT('%',#{lessonName},'%') </if> " +
" <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> " +
" <if test= \" createByName != null and createByName != ''\">and suc.name = CONCAT('%',#{createByName},'%') </if> " +
" <if test= \" createByName != null and createByName != ''\">and suc.name like CONCAT('%',#{createByName},'%') </if> " +
" <if test= \" courseType !=null and courseType != ''\">and bl.course_type = #{courseType} </if> " +
" <if test= \" viewRange !=null and viewRange != ''\">and bl.view_range = #{viewRange} </if> " +
" <if test= \" lessonType !=null and lessonType != ''\">and bl.lesson_type = #{lessonType} </if> " +
" <if test= \" recommend !=null and recommend != ''\">and bl.recommend = #{recommend} </if> " +
" <if test= \" lecturerName !=null and lecturerName != ''\">and bl.lesson_name = CONCAT('%',#{lecturerName},'%') </if> " +
" <if test= \" lecturerName !=null and lecturerName != ''\">and bl.lesson_name like CONCAT('%',#{lecturerName},'%') </if> " +
" order by bl.release_date desc" +
"</script>")
@ResultMap(value = "BaseResultMap")
......@@ -124,10 +125,15 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
" and su.del_flag != 1 and su.flag = 1 " +
" and suc.del_flag != 1 and suc.flag = 1 " +
" and bl.release_state = 2 " +
" <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_type in " +
" <foreach item='item' index='index' collection='courseIds' open='(' separator=',' close=')'> #{item} </foreach> " +
" </if> " +
" order by bl.person_number desc " +
"</script>")
@ResultMap(value = "BaseResultMap")
List<BLesson> queryPersonMore();
List<BLesson> queryPersonMore(@Param("param") FirstPageQueryDTO firstPageQueryDTO,@Param("courseIds") List<String> sonCourseIds);
/**
* 按学习人数降序查询推荐
......@@ -147,10 +153,14 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
" and suc.del_flag != 1 and suc.flag = 1 " +
" and bl.release_state = 2 " +
" and br.person_id = #{userId} " +
" order by bl.person_number desc " +
" <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_type in " +
" <foreach item='item' index='index' collection='courseIds' open='(' separator=',' close=')'> #{item} </foreach> " +
" </if> " +
"</script>")
@ResultMap(value = "BaseResultMap")
List<BLesson> queryRecommend(String userId);
List<BLesson> queryRecommend(@Param("userId") String userId, @Param("param") FirstPageQueryDTO param,@Param("courseIds") List<String> sonCourseIds);
/**
* 按学习人数降序查询
......@@ -168,10 +178,15 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
" and su.del_flag != 1 and su.flag = 1 " +
" and suc.del_flag != 1 and suc.flag = 1 " +
" and bl.release_state = 2 " +
" <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_type in " +
" <foreach item='item' index='index' collection='courseIds' open='(' separator=',' close=')'> #{item} </foreach> " +
" </if> " +
" order by bl.collect_number desc " +
"</script>")
@ResultMap(value = "BaseResultMap")
List<BLesson> queryConcern();
List<BLesson> queryConcern(@Param("param") FirstPageQueryDTO firstPageQueryDTO,@Param("courseIds") List<String> sonCourseIds);
@Select(" <script> select bl.* " +
" ,su.name lecturerName " +
......@@ -184,10 +199,15 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
" and su.del_flag != 1 and su.flag = 1 " +
" and suc.del_flag != 1 and suc.flag = 1 " +
" and bl.release_state = 2 " +
" <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_type in " +
" <foreach item='item' index='index' collection='courseIds' open='(' separator=',' close=')'> #{item} </foreach> " +
" </if> " +
" order by bl.hot_number desc " +
"</script>")
@ResultMap(value = "BaseResultMap")
List<BLesson> queryInterested();
List<BLesson> queryInterested(@Param("param") FirstPageQueryDTO firstPageQueryDTO,@Param("courseIds") List<String> sonCourseIds);
//查询课程中的标签
@Select(" <script> select blb.business_id businessId,blb.l_name lName" +
......
......@@ -2,9 +2,11 @@ package org.rcisoft.business.blesson.service;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.rcisoft.business.bcourse.dto.AllCourseDTO;
import org.rcisoft.business.blesson.dto.AddLessonDTO;
import org.rcisoft.business.blesson.dto.BLessonIPublishDTO;
import org.rcisoft.business.blesson.dto.FindAllLessonDTO;
import org.rcisoft.business.blesson.dto.FirstPageQueryDTO;
import org.rcisoft.business.blesson.entity.BLesson;
import org.rcisoft.core.aop.PageUtil;
import org.rcisoft.core.model.PersistModel;
......@@ -54,7 +56,7 @@ public interface BLessonService{
* @param
* @return
*/
List<BLesson> queryPersonMoreByPagination(PageUtil pageUtil);
List<BLesson> queryPersonMoreByPagination(PageUtil pageUtil,FirstPageQueryDTO firstPageQueryDTO,List<AllCourseDTO> allCourse);
/**
* 分页查找推荐
......@@ -62,7 +64,7 @@ public interface BLessonService{
* @param
* @return
*/
List<BLesson> queryRecommendByPagination(PageUtil pageUtil,String userId);
List<BLesson> queryRecommendByPagination(PageUtil pageUtil,String userId,FirstPageQueryDTO firstPageQueryDTO,List<AllCourseDTO> allCourse);
/**
* 分页查找最受关注
......@@ -70,7 +72,7 @@ public interface BLessonService{
* @param
* @return
*/
List<BLesson> queryConcernByPagination(PageUtil pageUtil);
List<BLesson> queryConcernByPagination(PageUtil pageUtil,FirstPageQueryDTO firstPageQueryDTO,List<AllCourseDTO> allCourse);
/**
* 分页查找可能感兴趣的
......@@ -78,7 +80,7 @@ public interface BLessonService{
* @param
* @return
*/
List<BLesson> queryInterestedByPagination(PageUtil pageUtil);
List<BLesson> queryInterestedByPagination(PageUtil pageUtil,FirstPageQueryDTO firstPageQueryDTO,List<AllCourseDTO> allCourse);
/**
* 插入
......
......@@ -4,13 +4,17 @@ import com.alibaba.fastjson.JSON;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.rcisoft.business.bcourse.dao.BCourseRepository;
import org.rcisoft.business.bcourse.dto.AllCourseDTO;
import org.rcisoft.business.blesson.dao.BLessonRepository;
import org.rcisoft.business.blesson.dto.AddLessonDTO;
import org.rcisoft.business.blesson.dto.BLessonIPublishDTO;
import org.rcisoft.business.blesson.dto.FindAllLessonDTO;
import org.rcisoft.business.blesson.dto.FirstPageQueryDTO;
import org.rcisoft.business.blesson.entity.BLesson;
import org.rcisoft.business.blesson.service.BLessonService;
import org.rcisoft.business.blesson.entity.BLessonLabel;
import org.rcisoft.business.blesson.util.recursion;
import org.rcisoft.common.component.Global;
import org.rcisoft.core.aop.PageUtil;
import org.rcisoft.core.constant.MessageConstant;
......@@ -42,6 +46,9 @@ public class BLessonServiceImpl implements BLessonService {
@Autowired
private BLessonRepository bLessonRepository;
@Autowired
private BCourseRepository bCourseRepository;
@Autowired
private Global global;
......@@ -73,21 +80,38 @@ public class BLessonServiceImpl implements BLessonService {
}
@Override
public List<BLesson> queryPersonMoreByPagination(PageUtil pageUtil) {
return bLessonRepository.queryPersonMore();
public List<BLesson> queryPersonMoreByPagination(PageUtil pageUtil,FirstPageQueryDTO firstPageQueryDTO,List<AllCourseDTO> allCourse) {
List<String> sonCourseIds = null;
if (allCourse != null){
sonCourseIds = recursion.FindSons(firstPageQueryDTO.getCourseLevelOne(),allCourse);
}
return bLessonRepository.queryPersonMore(firstPageQueryDTO,sonCourseIds);
}
@Override
public List<BLesson> queryRecommendByPagination(PageUtil pageUtil,String userId) {
return bLessonRepository.queryRecommend(userId);
public List<BLesson> queryRecommendByPagination(PageUtil pageUtil,String userId,FirstPageQueryDTO firstPageQueryDTO,List<AllCourseDTO> allCourse) {
List<String> sonCourseIds = null;
if (allCourse != null){
sonCourseIds = recursion.FindSons(firstPageQueryDTO.getCourseLevelOne(),allCourse);
}
return bLessonRepository.queryRecommend(userId,firstPageQueryDTO,sonCourseIds);
}
@Override
public List<BLesson> queryConcernByPagination(PageUtil pageUtil) {
return bLessonRepository.queryConcern();
public List<BLesson> queryConcernByPagination(PageUtil pageUtil,FirstPageQueryDTO firstPageQueryDTO,List<AllCourseDTO> allCourse) {
List<String> sonCourseIds = null;
if (allCourse != null){
sonCourseIds = recursion.FindSons(firstPageQueryDTO.getCourseLevelOne(),allCourse);
}
return bLessonRepository.queryConcern(firstPageQueryDTO,sonCourseIds);
}
@Override
public List<BLesson> queryInterestedByPagination(PageUtil pageUtil) {
return bLessonRepository.queryInterested();
public List<BLesson> queryInterestedByPagination(PageUtil pageUtil,FirstPageQueryDTO firstPageQueryDTO,List<AllCourseDTO> allCourse) {
List<String> sonCourseIds = null;
if (allCourse != null){
sonCourseIds = recursion.FindSons(firstPageQueryDTO.getCourseLevelOne(),allCourse);
}
return bLessonRepository.queryInterested(firstPageQueryDTO,sonCourseIds);
}
......
package org.rcisoft.business.blesson.util;
import lombok.extern.slf4j.Slf4j;
import org.rcisoft.business.bcourse.dto.AllCourseDTO;
import java.util.ArrayList;
import java.util.List;
@Slf4j
public class recursion {
/**
* 查找当前分类下 多级子分类
* @param fatherId
* @param allCourse
* @return
*/
public static List<String> FindSons(String fatherId, List<AllCourseDTO> allCourse){
List<String> sonList = new ArrayList<>();
for(AllCourseDTO course:allCourse){
if(course.getPid() != null && !("00000000".equals(course.getPid())) && course.getPid().equals(fatherId)){
sonList.add(course.getBusinessId());
sonList.addAll(recursion.FindSons(course.getBusinessId(),allCourse));
}
}
return sonList;
}
}
......@@ -42,10 +42,15 @@ public class SysRoleController extends PaginationController<SysRole> {
@ApiOperation(value="查询全部角色", notes="查询全部角色")
@GetMapping(value = "/queryRolesAll")
public GridModel queryRolesAll(CurUser curUser, @Valid FindRolePaginDTO findRolePaginDTO, BindingResult bindingResult){
public Result queryRolesAll(CurUser curUser, @Valid FindRolePaginDTO findRolePaginDTO, BindingResult bindingResult){
sysRoleServiceImpl.queryRolesAll(findRolePaginDTO);
GridModel gridModel = getGridModelResponse();
return gridModel;
// return gridModel;
return Result.builder(new PersistModel(1),
MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR,
sysRoleServiceImpl.queryRolesAll(findRolePaginDTO));
}
@ApiOperation(value="增加/修改角色", notes="增加/修改角色")
......
......@@ -24,4 +24,12 @@
<resultMap id="ChildListResultMap" type="org.rcisoft.business.bcourse.dto.QueryCourseResDTO" extends="BaseResultMapDTO">
<association column="business_id" property="childList" select="org.rcisoft.business.bcourse.dao.BCourseRepository.queryCoursesByPid"></association>
</resultMap>
<resultMap id="AllCourseResultMap" type="org.rcisoft.business.bcourse.dto.AllCourseDTO">
<id column="business_id" jdbcType="VARCHAR" property="businessId"/>
<result column="c_name" jdbcType="VARCHAR" property="cName"/>
<result column="pid" jdbcType="VARCHAR" property="pid"/>
<result column="course_level" jdbcType="VARCHAR" property="courseLevel"/>
</resultMap>
</mapper>
\ No newline at end of file
......@@ -14,6 +14,23 @@
<result column="pid" jdbcType="VARCHAR" property="pid"/>
<result column="content" jdbcType="LONGVARCHAR" property="content"/>
<result column="level" jdbcType="VARCHAR" property="level"/>
<result column="student_id" jdbcType="VARCHAR" property="studentId"/>
</resultMap>
<resultMap id="BaseResultMapDto" type="org.rcisoft.business.bdiscuss.dto.BDiscussDto">
<id column="business_id" jdbcType="VARCHAR" property="businessId"/>
<result column="create_by" jdbcType="VARCHAR" property="createBy"/>
<result column="create_date" jdbcType="TIMESTAMP" property="createDate"/>
<result column="update_by" jdbcType="VARCHAR" property="updateBy"/>
<result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/>
<result column="del_flag" jdbcType="VARCHAR" property="delFlag"/>
<result column="flag" jdbcType="VARCHAR" property="flag"/>
<result column="remarks" jdbcType="VARCHAR" property="remarks"/>
<result column="lesson_id" jdbcType="VARCHAR" property="lessonId"/>
<result column="pid" jdbcType="VARCHAR" property="pid"/>
<result column="content" jdbcType="LONGVARCHAR" property="content"/>
<result column="level" jdbcType="VARCHAR" property="level"/>
<result column="student_id" jdbcType="VARCHAR" property="studentId"/>
</resultMap>
<!--<cache type="${corePackag!}.util.RedisCache"/>-->
......
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