Commit d61e4eb1 authored by root's avatar root

修改接口

parent 159b1932
......@@ -86,27 +86,6 @@ public class BBannerController extends PaginationController<BBanner> {
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重新排序")
@PostMapping(value = "/updateBannerOrder")
public Result updateBannerOrder(CurUser curUser, @Param("bannerOrderMap") String bannerOrderMap,BindingResult bindingResult){
......
......@@ -18,6 +18,7 @@ public interface BBannerService {
/**
* 插入/修改
* @author: zhangqingle
* @param addOrUpdateDTO
* @return
*/
......@@ -25,6 +26,7 @@ public interface BBannerService {
/**
* 逻辑删除
* @author: zhangqingle
* @param id
* @return
*/
......@@ -32,13 +34,15 @@ public interface BBannerService {
/**
* 唯一查找
* @author: zhangqingle
* @param businessId
* @return
*/
BannerInfoRspDTO selectOne(String businessId);
/**
* 获取图片分页
* 获取Banner分页
* @author: zhangqingle
* @param pageUtil
* @param model
* @return
......@@ -46,22 +50,6 @@ public interface BBannerService {
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
* @description: TODO
......
......@@ -96,35 +96,6 @@ public class BBannerServiceImpl implements BBannerService {
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
......
......@@ -117,4 +117,13 @@ public interface BLessonPersonRepository extends BaseMapper<BLessonPerson> {
*/
@Select("<script>select is_finish from b_lesson_person where business_id = #{businessId}</script>")
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> {
" ,bc.c_name courseName " +
" from b_lesson bl " +
" left join s_user su on su.business_id = bl.lecturer_id " +
" and su.del_flag != 1 and su.flag = 1 " +
" 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 " +
" 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} " +
"</script>")
@ResultMap(value = "BaseResultMap")
......
......@@ -8,6 +8,7 @@ import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;
import org.rcisoft.core.entity.IdEntity;
import org.rcisoft.core.util.UserUtil;
import javax.persistence.Entity;
import javax.persistence.Table;
......@@ -99,6 +100,17 @@ public class BLessonPerson extends IdEntity<BLessonPerson> {
@Transient
private String lessonType;
//初始化
public void initModel(){
UserUtil.setCurrentPersistOperation(this);
//学习进度为0
this.setLearnProgress("0");
//设置正在学
this.setIsFinish("1");
//设置不收藏
this.setIsCollect("0");
//设置不指派
this.setIsAppoint("0");
}
}
......@@ -16,6 +16,7 @@ public interface BLessonService{
/**
* 根据主键唯一查找
* @author: zhangqingle
* @param businessId
* @return
*/
......@@ -31,6 +32,7 @@ public interface BLessonService{
int updateByPrimaryKeySelective(BLesson bLesson);
/**
* 根据条件分页查找
* @author: zhangqingle
* @param pageUtil
* @param releaseState
* @return
......@@ -39,6 +41,7 @@ public interface BLessonService{
/**
* 根据条件分页查找
* @author: zhangqingle
* @param pageUtil
* @param findAllLessonDTO
* @return
......@@ -47,6 +50,7 @@ public interface BLessonService{
/**
* 分页查找大家都在学
* @author: zhangqingle
* @param pageUtil
* @param
* @return
......@@ -55,6 +59,7 @@ public interface BLessonService{
/**
* 分页查找推荐
* @author: zhangqingle
* @param pageUtil
* @param
* @return
......@@ -63,6 +68,7 @@ public interface BLessonService{
/**
* 分页查找最受关注
* @author: zhangqingle
* @param pageUtil
* @param
* @return
......@@ -71,6 +77,7 @@ public interface BLessonService{
/**
* 分页查找可能感兴趣的
* @author: zhangqingle
* @param pageUtil
* @param
* @return
......@@ -78,13 +85,15 @@ public interface BLessonService{
List<BLesson> queryInterestedByPagination(PageUtil pageUtil,CurUser curUser);
/**
* 插入
* 插入/更新课程
* @author: zhangqingle
* @param model
* @return
*/
PersistModel persist(AddLessonDTO model);
/**
* @author: zhangqingle
* 逻辑删除
* @param id
* @return
......@@ -92,6 +101,7 @@ public interface BLessonService{
PersistModel removeBLesson(String id);
/**
* @author: zhangqingle
* 首页条件查询全部课程
* @return
*/
......@@ -99,6 +109,7 @@ public interface BLessonService{
/**
* 关闭课程
* @author: zhangqingle
* @param id
* @return
*/
......@@ -106,6 +117,7 @@ public interface BLessonService{
/**
* 发布课程
* @author: zhangqingle
* @param id
* @return
*/
......@@ -113,20 +125,16 @@ public interface BLessonService{
/**
* 推荐课程
* @author: zhangqingle
* @param recommendLessonDTO
* @return
*/
PersistModel recommendBLesson(RecommendLessonDTO recommendLessonDTO);
/**
* 指派课程
* @param appointLessonDTO
* @return
*/
PersistModel appointLessonToPerson(AppointLessonDTO appointLessonDTO);
/**
* 课程培训条件查询
* @author: zhangqingle
* @param lessonTrainDTO
* @return
*/
......@@ -134,6 +142,7 @@ public interface BLessonService{
/**
* 我发布的总数
* @author: zhangqingle
* @param userId
* @return
*/
......@@ -141,6 +150,7 @@ public interface BLessonService{
/**
* 分页查询列表页全部
* @author: zhangqingle
* @param pageUtil
* @param model
* @return
......@@ -156,27 +166,4 @@ public interface BLessonService{
*/
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;
import org.apache.commons.lang3.StringUtils;
import org.rcisoft.business.bcourse.dao.BCourseRepository;
import org.rcisoft.business.bcourse.dto.AllCourseDTO;
import org.rcisoft.business.blesson.dao.BAppointRepository;
import org.rcisoft.business.blesson.dao.BLessonRepository;
import org.rcisoft.business.blesson.dao.BRecommendRepository;
import org.rcisoft.business.blesson.dao.*;
import org.rcisoft.business.blesson.dto.*;
import org.rcisoft.business.blesson.entity.*;
import org.rcisoft.business.blesson.service.BLessonService;
import org.rcisoft.business.blesson.util.recursion;
import org.rcisoft.business.blesson.dao.BViewrangeRepository;
import org.rcisoft.core.aop.PageUtil;
import org.rcisoft.core.constant.MessageConstant;
import org.rcisoft.core.exception.ServiceException;
......@@ -36,6 +33,8 @@ import java.util.List;
import java.lang.reflect.Array;
import java.util.*;
import static java.util.Arrays.asList;
/**
* Created by CodeGenerator on 2017/07/12.
......@@ -47,6 +46,9 @@ public class BLessonServiceImpl implements BLessonService {
@Autowired
private BLessonRepository bLessonRepository;
@Autowired
private BLessonPersonRepository bLessonPersonRepository;
@Autowired
private BCourseRepository bCourseRepository;
......@@ -294,7 +296,7 @@ public class BLessonServiceImpl implements BLessonService {
//查询是否存在该课程推荐
List<String> recommendIds = bRecommendRepository.selectIdByLessonId(bRecommend.getLessonId());
if (recommendIds == null || recommendIds.size()<1){
//课程表----
//插入推荐表
UserUtil.setCurrentPersistOperation(bRecommend);
......@@ -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
@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