Commit ff702fa7 authored by zhangqingle's avatar zhangqingle

修改接口

parent 6998932c
......@@ -613,7 +613,7 @@ public class BLessonController extends PaginationController<BLesson> {
* @return
* @author: zhangqingle
*/
@ApiOperation(value="637 分页查询我我关注", notes="分页查询我我关注", response = BLessonPerson.class)
@ApiOperation(value="637 分页查询我关注", notes="分页查询我关注", response = BLessonPerson.class)
@ApiImplicitParam(name = "lessonType", value = "课程类型 0 课程 1培训", required = false, dataType = "varchar")
@GetMapping(value = "/queryCollectByPagination")
public Result queryCollectByPagination(CurUser curUser, @Valid String lessonType, BindingResult bindingResult) {
......
......@@ -690,7 +690,8 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
*/
@Update("<script>update b_lesson set hot_number = " +
"(select count(1) from b_hot where 1=1 " +
" and lesson_id = #{lessonId})" +
" and lesson_id = #{lessonId}) where 1=1 " +
" and business_id = #{lessonId} " +
" </script>" )
int hotNumberReCount(String lessonId);
......
......@@ -206,6 +206,13 @@ public class BLessonPersonServiceImpl implements BLessonPersonService {
throw new ServiceException(ResultServiceEnums.NOT_TRAIN_TYPE);
}
//添加至b_hot表 并重新统计热度
int count = bHotRepository.selectCountByPersonId(addMyLearnLessonDTO.getUserId(),addMyLearnLessonDTO.getLessonId());
if (count < 1){
bHotRepository.insertSelective(new BHot(IdGen.uuid(),addMyLearnLessonDTO.getUserId(),addMyLearnLessonDTO.getLessonId()));
bLessonRepository.hotNumberReCount(addMyLearnLessonDTO.getLessonId());
}
List<BLessonPerson> bLessonPersons = bLessonPersonRepository.selectByPersonAndLesson(addMyLearnLessonDTO);
BLessonPerson bLessonPerson;
int line = 0;
......@@ -235,6 +242,8 @@ public class BLessonPersonServiceImpl implements BLessonPersonService {
bLessonPerson = new BLessonPerson();
bLessonPerson.initModel();
bLessonPerson.setIsFinish("1");
//添加报名时间
bLessonPerson.setApplyDate(new Date());
bLessonPerson.setLessonId(addMyLearnLessonDTO.getLessonId());
bLessonPerson.setPersonId(addMyLearnLessonDTO.getUserId());
line = bLessonPersonRepository.insertBLessonPerson(bLessonPerson);
......@@ -246,12 +255,7 @@ public class BLessonPersonServiceImpl implements BLessonPersonService {
// line = 1;
// return new PersistModel(line);
// }
//添加至b_hot表 并重新统计热度
int count = bHotRepository.selectCountByPersonId(addMyLearnLessonDTO.getUserId(),addMyLearnLessonDTO.getLessonId());
if (count < 1){
bHotRepository.insertSelective(new BHot(IdGen.uuid(),addMyLearnLessonDTO.getUserId(),addMyLearnLessonDTO.getLessonId()));
bLessonRepository.hotNumberReCount(addMyLearnLessonDTO.getLessonId());
}
return new PersistModel(1);
}
}
......@@ -1187,6 +1187,12 @@ public class BLessonServiceImpl implements BLessonService {
}
//判断报名、签到是否开始
setDateState(bLesson);
//添加至b_hot表 并重新统计热度
int count = bHotRepository.selectCountByPersonId(curUser.getUserId(),lessonId);
if (count < 1){
bHotRepository.insertSelective(new BHot(IdGen.uuid(),curUser.getUserId(),lessonId));
bLessonRepository.hotNumberReCount(lessonId);
}
return bLesson;
}
......
......@@ -235,7 +235,7 @@ public enum ResultServiceEnums {
CHAPTER_ONLY_ONE(135,"当前课程仅有一节,不能被删除"),
LESSON_NO_CHAPTER(136,"当前课程暂无章节,不能被发布"),
ROLE_IS_NULL(137,"当前未勾选角色,请勾选角色"),
ILLEGAL_URL(138,"网址不合法(http(s)://xxxx.xx)"),
ILLEGAL_URL(138,"网址不合法,需输入:http(s)://xxx.xx"),
PARAM_NOT_NULL(139,"参数不能为空"),
NOT_TRAIN_TYPE(140,"课程类型不正确"),
;
......
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