Commit d61e4eb1 authored by root's avatar root

修改接口

parent 159b1932
...@@ -86,27 +86,6 @@ public class BBannerController extends PaginationController<BBanner> { ...@@ -86,27 +86,6 @@ public class BBannerController extends PaginationController<BBanner> {
gridModel); gridModel);
} }
/*
@ApiOperation(value="105 Banner向上调顺序", notes="Banner向上调顺序")
@PostMapping(value = "/updateTopBanner")
public Result updateTopBanner(CurUser curUser, @Valid TopDownDTO topDownDTO, BindingResult bindingResult){
int data = bBannerService.updateTopChapter(topDownDTO);
return Result.builder(new PersistModel(data),
MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR,
topDownDTO);
}*/
/*@ApiOperation(value="106 Banner向下调顺序", notes="Banner向下调顺序")
@PostMapping(value = "/updateDownBanner")
public Result updateDownBanner( CurUser curUser, @Valid TopDownDTO topDownDTO, BindingResult bindingResult){
int data = bBannerService.updateDownChapter(topDownDTO);
return Result.builder(new PersistModel(data),
MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR,
topDownDTO);
}*/
@ApiOperation(value = "105 Banner重新排序", notes = "Banner重新排序") @ApiOperation(value = "105 Banner重新排序", notes = "Banner重新排序")
@PostMapping(value = "/updateBannerOrder") @PostMapping(value = "/updateBannerOrder")
public Result updateBannerOrder(CurUser curUser, @Param("bannerOrderMap") String bannerOrderMap,BindingResult bindingResult){ public Result updateBannerOrder(CurUser curUser, @Param("bannerOrderMap") String bannerOrderMap,BindingResult bindingResult){
......
...@@ -18,6 +18,7 @@ public interface BBannerService { ...@@ -18,6 +18,7 @@ public interface BBannerService {
/** /**
* 插入/修改 * 插入/修改
* @author: zhangqingle
* @param addOrUpdateDTO * @param addOrUpdateDTO
* @return * @return
*/ */
...@@ -25,6 +26,7 @@ public interface BBannerService { ...@@ -25,6 +26,7 @@ public interface BBannerService {
/** /**
* 逻辑删除 * 逻辑删除
* @author: zhangqingle
* @param id * @param id
* @return * @return
*/ */
...@@ -32,13 +34,15 @@ public interface BBannerService { ...@@ -32,13 +34,15 @@ public interface BBannerService {
/** /**
* 唯一查找 * 唯一查找
* @author: zhangqingle
* @param businessId * @param businessId
* @return * @return
*/ */
BannerInfoRspDTO selectOne(String businessId); BannerInfoRspDTO selectOne(String businessId);
/** /**
* 获取图片分页 * 获取Banner分页
* @author: zhangqingle
* @param pageUtil * @param pageUtil
* @param model * @param model
* @return * @return
...@@ -46,22 +50,6 @@ public interface BBannerService { ...@@ -46,22 +50,6 @@ public interface BBannerService {
List<BBanner> queryBannerByPagination(PageUtil pageUtil, FindBannerPaginDTO model); List<BBanner> queryBannerByPagination(PageUtil pageUtil, FindBannerPaginDTO model);
/**
* Banner向上调顺序
* @param topDownDTO
* @return
*/
int updateTopChapter(TopDownDTO topDownDTO);
/**
* Banner向下调顺序
* @param topDownDTO
* @return
*/
int updateDownChapter(TopDownDTO topDownDTO);
/** /**
* @author: jiangpengpeng * @author: jiangpengpeng
* @description: TODO * @description: TODO
......
...@@ -96,35 +96,6 @@ public class BBannerServiceImpl implements BBannerService { ...@@ -96,35 +96,6 @@ public class BBannerServiceImpl implements BBannerService {
return bBannerRepository.queryBanners(model); return bBannerRepository.queryBanners(model);
} }
@Transactional(propagation = Propagation.REQUIRED, readOnly = false)
@Override
public int updateTopChapter(TopDownDTO topDownDTO) {
int result = 0;
BBanner lessBanner = bBannerRepository.getlessChapter(topDownDTO);
int sort = topDownDTO.getBannerSort();
int lessSort = lessBanner.getBannerSort();
int data = bBannerRepository.updateSortById(topDownDTO.getBusinessId(), lessSort);
int data2 = bBannerRepository.updateSortById(lessBanner.getBusinessId(), sort);
if (data == data2) {
result = 1;
}
return result;
}
@Transactional(propagation = Propagation.REQUIRED, readOnly = false)
@Override
public int updateDownChapter(TopDownDTO topDownDTO) {
int result = 0;
BBanner bigBanner = bBannerRepository.getBigChapter(topDownDTO);
int sort = topDownDTO.getBannerSort();
int bigSort = bigBanner.getBannerSort();
int data = bBannerRepository.updateSortById(topDownDTO.getBusinessId(), bigSort);
int data2 = bBannerRepository.updateSortById(bigBanner.getBusinessId(), sort);
if (data == data2) {
result = 1;
}
return result;
}
/** /**
* @param bannerOrderMap * @param bannerOrderMap
......
...@@ -117,4 +117,13 @@ public interface BLessonPersonRepository extends BaseMapper<BLessonPerson> { ...@@ -117,4 +117,13 @@ public interface BLessonPersonRepository extends BaseMapper<BLessonPerson> {
*/ */
@Select("<script>select is_finish from b_lesson_person where business_id = #{businessId}</script>") @Select("<script>select is_finish from b_lesson_person where business_id = #{businessId}</script>")
String selectIsFinish(CancelAppointDTO param); String selectIsFinish(CancelAppointDTO param);
/**
* 根据课程id查询学生id
* @param LessonId
* @return
*/
@Select("<script>select business_id,person_id from b_lesson_person where lesson_id = #{LessonId}</script>")
@ResultMap(value = "BaseResultMap")
List<BLessonPerson> selectPersonIdByLessonId(String LessonId);
} }
...@@ -74,11 +74,11 @@ public interface BLessonRepository extends BaseMapper<BLesson> { ...@@ -74,11 +74,11 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
" ,bc.c_name courseName " + " ,bc.c_name courseName " +
" from b_lesson bl " + " from b_lesson bl " +
" left join s_user su on su.business_id = bl.lecturer_id " + " left join s_user su on su.business_id = bl.lecturer_id " +
" and su.del_flag != 1 and su.flag = 1 " +
" left join s_user suc on suc.business_id = bl.create_by " + " left join s_user suc on suc.business_id = bl.create_by " +
" and suc.del_flag != 1 and suc.flag = 1 " +
" left join b_course bc on bc.business_id = bl.course_id " + " left join b_course bc on bc.business_id = bl.course_id " +
" where bl.del_flag != 1 and bl.flag = 1 " + " 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.business_id = #{businessId} " + " and bl.business_id = #{businessId} " +
"</script>") "</script>")
@ResultMap(value = "BaseResultMap") @ResultMap(value = "BaseResultMap")
......
...@@ -8,6 +8,7 @@ import lombok.NoArgsConstructor; ...@@ -8,6 +8,7 @@ import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length; import org.hibernate.validator.constraints.Length;
import org.rcisoft.core.entity.IdEntity; import org.rcisoft.core.entity.IdEntity;
import org.rcisoft.core.util.UserUtil;
import javax.persistence.Entity; import javax.persistence.Entity;
import javax.persistence.Table; import javax.persistence.Table;
...@@ -99,6 +100,17 @@ public class BLessonPerson extends IdEntity<BLessonPerson> { ...@@ -99,6 +100,17 @@ public class BLessonPerson extends IdEntity<BLessonPerson> {
@Transient @Transient
private String lessonType; private String lessonType;
//初始化
public void initModel(){
UserUtil.setCurrentPersistOperation(this);
//学习进度为0
this.setLearnProgress("0");
//设置正在学
this.setIsFinish("1");
//设置不收藏
this.setIsCollect("0");
//设置不指派
this.setIsAppoint("0");
}
} }
...@@ -15,10 +15,11 @@ import java.util.List; ...@@ -15,10 +15,11 @@ import java.util.List;
public interface BLessonService{ public interface BLessonService{
/** /**
* 根据主键唯一查找 * 根据主键唯一查找
* @param businessId * @author: zhangqingle
* @return * @param businessId
*/ * @return
*/
BLesson selectOne(String businessId); BLesson selectOne(String businessId);
/** /**
...@@ -30,61 +31,69 @@ public interface BLessonService{ ...@@ -30,61 +31,69 @@ public interface BLessonService{
*/ */
int updateByPrimaryKeySelective(BLesson bLesson); int updateByPrimaryKeySelective(BLesson bLesson);
/** /**
* 根据条件分页查找 * 根据条件分页查找
* @param pageUtil * @author: zhangqingle
* @param releaseState * @param pageUtil
* @return * @param releaseState
*/ * @return
*/
List<BLesson> queryBLessonsByPagination(PageUtil pageUtil, String releaseState, CurUser curUser); List<BLesson> queryBLessonsByPagination(PageUtil pageUtil, String releaseState, CurUser curUser);
/** /**
* 根据条件分页查找 * 根据条件分页查找
* @param pageUtil * @author: zhangqingle
* @param findAllLessonDTO * @param pageUtil
* @return * @param findAllLessonDTO
*/ * @return
*/
List<BLesson> queryAllBLessonsByPagination(PageUtil pageUtil, FindAllLessonDTO findAllLessonDTO); List<BLesson> queryAllBLessonsByPagination(PageUtil pageUtil, FindAllLessonDTO findAllLessonDTO);
/** /**
* 分页查找大家都在学 * 分页查找大家都在学
* @param pageUtil * @author: zhangqingle
* @param * @param pageUtil
* @return * @param
*/ * @return
*/
List<BLesson> queryPersonMoreByPagination(PageUtil pageUtil,CurUser curUser); List<BLesson> queryPersonMoreByPagination(PageUtil pageUtil,CurUser curUser);
/** /**
* 分页查找推荐 * 分页查找推荐
* @param pageUtil * @author: zhangqingle
* @param * @param pageUtil
* @return * @param
*/ * @return
*/
List<BLesson> queryRecommendByPagination(PageUtil pageUtil,CurUser curUser); List<BLesson> queryRecommendByPagination(PageUtil pageUtil,CurUser curUser);
/** /**
* 分页查找最受关注 * 分页查找最受关注
* @param pageUtil * @author: zhangqingle
* @param * @param pageUtil
* @return * @param
*/ * @return
*/
List<BLesson> queryConcernByPagination(PageUtil pageUtil,CurUser curUser); List<BLesson> queryConcernByPagination(PageUtil pageUtil,CurUser curUser);
/** /**
* 分页查找可能感兴趣的 * 分页查找可能感兴趣的
* @param pageUtil * @author: zhangqingle
* @param * @param pageUtil
* @return * @param
*/ * @return
*/
List<BLesson> queryInterestedByPagination(PageUtil pageUtil,CurUser curUser); List<BLesson> queryInterestedByPagination(PageUtil pageUtil,CurUser curUser);
/** /**
* 插入 * 插入/更新课程
* @param model * @author: zhangqingle
* @return * @param model
*/ * @return
*/
PersistModel persist(AddLessonDTO model); PersistModel persist(AddLessonDTO model);
/** /**
* @author: zhangqingle
* 逻辑删除 * 逻辑删除
* @param id * @param id
* @return * @return
...@@ -92,6 +101,7 @@ public interface BLessonService{ ...@@ -92,6 +101,7 @@ public interface BLessonService{
PersistModel removeBLesson(String id); PersistModel removeBLesson(String id);
/** /**
* @author: zhangqingle
* 首页条件查询全部课程 * 首页条件查询全部课程
* @return * @return
*/ */
...@@ -99,6 +109,7 @@ public interface BLessonService{ ...@@ -99,6 +109,7 @@ public interface BLessonService{
/** /**
* 关闭课程 * 关闭课程
* @author: zhangqingle
* @param id * @param id
* @return * @return
*/ */
...@@ -106,6 +117,7 @@ public interface BLessonService{ ...@@ -106,6 +117,7 @@ public interface BLessonService{
/** /**
* 发布课程 * 发布课程
* @author: zhangqingle
* @param id * @param id
* @return * @return
*/ */
...@@ -113,20 +125,16 @@ public interface BLessonService{ ...@@ -113,20 +125,16 @@ public interface BLessonService{
/** /**
* 推荐课程 * 推荐课程
* @author: zhangqingle
* @param recommendLessonDTO * @param recommendLessonDTO
* @return * @return
*/ */
PersistModel recommendBLesson(RecommendLessonDTO recommendLessonDTO); PersistModel recommendBLesson(RecommendLessonDTO recommendLessonDTO);
/**
* 指派课程
* @param appointLessonDTO
* @return
*/
PersistModel appointLessonToPerson(AppointLessonDTO appointLessonDTO);
/** /**
* 课程培训条件查询 * 课程培训条件查询
* @author: zhangqingle
* @param lessonTrainDTO * @param lessonTrainDTO
* @return * @return
*/ */
...@@ -134,6 +142,7 @@ public interface BLessonService{ ...@@ -134,6 +142,7 @@ public interface BLessonService{
/** /**
* 我发布的总数 * 我发布的总数
* @author: zhangqingle
* @param userId * @param userId
* @return * @return
*/ */
...@@ -141,6 +150,7 @@ public interface BLessonService{ ...@@ -141,6 +150,7 @@ public interface BLessonService{
/** /**
* 分页查询列表页全部 * 分页查询列表页全部
* @author: zhangqingle
* @param pageUtil * @param pageUtil
* @param model * @param model
* @return * @return
...@@ -156,27 +166,4 @@ public interface BLessonService{ ...@@ -156,27 +166,4 @@ public interface BLessonService{
*/ */
List<BLesson> theLessonMangageByPagination(PageUtil pageUtil,CurUser curUser,BLesson bLesson); List<BLesson> theLessonMangageByPagination(PageUtil pageUtil,CurUser curUser,BLesson bLesson);
// /**
// * 分页查询列表页推荐
// * @param pageUtil
// * @param model
// * @return
// */
// List<BLesson> queryRecommendListByPagination(PageUtil pageUtil, FindListLessonDTO model, List<AllCourseDTO> allCourse);
//
// /**
// * 分页查询列表页在学
// * @param pageUtil
// * @param model
// * @return
// */
// List<BLesson> queryLearnListByPagination(PageUtil pageUtil, FindListLessonDTO model);
//
// /**
// * 分页查询列表页收藏
// * @param pageUtil
// * @param model
// * @return
// */
// List<BLesson> queryCollectListByPagination(PageUtil pageUtil, FindListLessonDTO model);
} }
...@@ -6,14 +6,11 @@ import lombok.extern.slf4j.Slf4j; ...@@ -6,14 +6,11 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.rcisoft.business.bcourse.dao.BCourseRepository; import org.rcisoft.business.bcourse.dao.BCourseRepository;
import org.rcisoft.business.bcourse.dto.AllCourseDTO; import org.rcisoft.business.bcourse.dto.AllCourseDTO;
import org.rcisoft.business.blesson.dao.BAppointRepository; import org.rcisoft.business.blesson.dao.*;
import org.rcisoft.business.blesson.dao.BLessonRepository;
import org.rcisoft.business.blesson.dao.BRecommendRepository;
import org.rcisoft.business.blesson.dto.*; import org.rcisoft.business.blesson.dto.*;
import org.rcisoft.business.blesson.entity.*; import org.rcisoft.business.blesson.entity.*;
import org.rcisoft.business.blesson.service.BLessonService; import org.rcisoft.business.blesson.service.BLessonService;
import org.rcisoft.business.blesson.util.recursion; import org.rcisoft.business.blesson.util.recursion;
import org.rcisoft.business.blesson.dao.BViewrangeRepository;
import org.rcisoft.core.aop.PageUtil; import org.rcisoft.core.aop.PageUtil;
import org.rcisoft.core.constant.MessageConstant; import org.rcisoft.core.constant.MessageConstant;
import org.rcisoft.core.exception.ServiceException; import org.rcisoft.core.exception.ServiceException;
...@@ -36,6 +33,8 @@ import java.util.List; ...@@ -36,6 +33,8 @@ import java.util.List;
import java.lang.reflect.Array; import java.lang.reflect.Array;
import java.util.*; import java.util.*;
import static java.util.Arrays.asList;
/** /**
* Created by CodeGenerator on 2017/07/12. * Created by CodeGenerator on 2017/07/12.
...@@ -47,6 +46,9 @@ public class BLessonServiceImpl implements BLessonService { ...@@ -47,6 +46,9 @@ public class BLessonServiceImpl implements BLessonService {
@Autowired @Autowired
private BLessonRepository bLessonRepository; private BLessonRepository bLessonRepository;
@Autowired
private BLessonPersonRepository bLessonPersonRepository;
@Autowired @Autowired
private BCourseRepository bCourseRepository; private BCourseRepository bCourseRepository;
...@@ -294,7 +296,7 @@ public class BLessonServiceImpl implements BLessonService { ...@@ -294,7 +296,7 @@ public class BLessonServiceImpl implements BLessonService {
//查询是否存在该课程推荐 //查询是否存在该课程推荐
List<String> recommendIds = bRecommendRepository.selectIdByLessonId(bRecommend.getLessonId()); List<String> recommendIds = bRecommendRepository.selectIdByLessonId(bRecommend.getLessonId());
if (recommendIds == null || recommendIds.size()<1){ if (recommendIds == null || recommendIds.size()<1){
//课程表----
//插入推荐表 //插入推荐表
UserUtil.setCurrentPersistOperation(bRecommend); UserUtil.setCurrentPersistOperation(bRecommend);
...@@ -326,35 +328,6 @@ public class BLessonServiceImpl implements BLessonService { ...@@ -326,35 +328,6 @@ public class BLessonServiceImpl implements BLessonService {
} }
} }
@Override
@Transactional(propagation = Propagation.REQUIRED,readOnly = false)
public PersistModel appointLessonToPerson(AppointLessonDTO appointLessonDTO) {
if (StringUtils.isEmpty(appointLessonDTO.getAppointPerson())){
throw new ServiceException(ResultExceptionEnum.INVALID_PARAMETER_VALUE);
}
//按课程查询指派表是否为空
//插入指派表
BAppoint bAppoint = new BAppoint();
bAppoint.setLessonId(appointLessonDTO.getLessonId());
bAppoint.setAppointerId(appointLessonDTO.getUserId());
bAppoint.setDesignatedId(appointLessonDTO.getAppointPerson());
UserUtil.setCurrentPersistOperation(bAppoint);
// bAppointRepository.insertSelective(bAppoint);
//插入b_lesson_person表
//查询已学该课程的学习business_id
//更新b_lesson_person表
//从学生Id中删除已更新的学生id
//剩余学生添加至b_lesson_person表
return null;
}
@Override @Override
@Transactional(propagation = Propagation.REQUIRED,readOnly = false) @Transactional(propagation = Propagation.REQUIRED,readOnly = false)
......
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