Commit 5098fe46 authored by luzhuang's avatar luzhuang

更新代码

parent bd0ceaed
...@@ -31,8 +31,8 @@ import java.util.List; ...@@ -31,8 +31,8 @@ import java.util.List;
/** /**
* Created by CodeGenerator on 2017/07/12. * Created by CodeGenerator on 2017/07/12.
*/ */
@Api(tags = "06 课程") @Api(tags = "06 课程")
@Slf4j @Slf4j
@RestController @RestController
...@@ -55,11 +55,11 @@ public class BLessonController extends PaginationController<BLesson> { ...@@ -55,11 +55,11 @@ public class BLessonController extends PaginationController<BLesson> {
/** /**
* @author: zhangqingle
* @param * @param
* @return * @return
* @author: zhangqingle
*/ */
@ApiOperation(value="601 添加/编辑课程", notes="businessId为空时是添加方法,不为空时是修改方法") @ApiOperation(value = "601 添加/编辑课程", notes = "businessId为空时是添加方法,不为空时是修改方法")
@PostMapping(value = "/add") @PostMapping(value = "/add")
public Result add(CurUser curUser, @Valid AddLessonDTO addLessonDTO, BindingResult bindingResult) { public Result add(CurUser curUser, @Valid AddLessonDTO addLessonDTO, BindingResult bindingResult) {
// if(addLessonDTO.getCode().length()> // if(addLessonDTO.getCode().length()>
...@@ -73,14 +73,14 @@ public class BLessonController extends PaginationController<BLesson> { ...@@ -73,14 +73,14 @@ public class BLessonController extends PaginationController<BLesson> {
} }
/** /**
* @author: zhangqingle
* @param * @param
* @return * @return
* @author: zhangqingle
*/ */
@ApiOperation(value="602 删除课程", notes="根据ID删除一条记录") @ApiOperation(value = "602 删除课程", notes = "根据ID删除一条记录")
@ApiImplicitParam(name = "businessId", value = "businessId", required = true, dataType = "varchar") @ApiImplicitParam(name = "businessId", value = "businessId", required = true, dataType = "varchar")
@PostMapping(value = "/remove") @PostMapping(value = "/remove")
public Result remove(CurUser curUser,String businessId,BindingResult bindingResult) { public Result remove(CurUser curUser, String businessId, BindingResult bindingResult) {
PersistModel data = bLessonService.removeBLesson(businessId); PersistModel data = bLessonService.removeBLesson(businessId);
return Result.builder(data, return Result.builder(data,
MessageConstant.MESSAGE_ALERT_SUCCESS, MessageConstant.MESSAGE_ALERT_SUCCESS,
...@@ -89,98 +89,98 @@ public class BLessonController extends PaginationController<BLesson> { ...@@ -89,98 +89,98 @@ public class BLessonController extends PaginationController<BLesson> {
} }
/** /**
* @author: zhangqingle
* @param * @param
* @return * @return
* @author: zhangqingle
*/ */
@ApiOperation(value="603 唯一查找", notes="根据ID查找一条记录", response = BLesson.class) @ApiOperation(value = "603 唯一查找", notes = "根据ID查找一条记录", response = BLesson.class)
@ApiImplicitParam(name = "businessId", value = "businessId", required = true, dataType = "varchar") @ApiImplicitParam(name = "businessId", value = "businessId", required = true, dataType = "varchar")
@GetMapping(value = "/one") @GetMapping(value = "/one")
public Result queryOne(CurUser curUser, String businessId, BindingResult bindingResult) { public Result queryOne(CurUser curUser, String businessId, BindingResult bindingResult) {
return Result.builder(new PersistModel(1), return Result.builder(new PersistModel(1),
MessageConstant.MESSAGE_ALERT_SUCCESS, MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR, MessageConstant.MESSAGE_ALERT_ERROR,
bLessonService.selectOne(curUser,businessId)); bLessonService.selectOne(curUser, businessId));
} }
/** /**
* @author: zhangqingle
* @param * @param
* @return * @return
* @author: zhangqingle
*/ */
@ApiOperation(value="604 分页查询我发布的课程(我主讲的)", notes="分页查询我发布的课程", response = BLesson.class) @ApiOperation(value = "604 分页查询我发布的课程(我主讲的)", notes = "分页查询我发布的课程", response = BLesson.class)
@ApiImplicitParam(name = "releaseState", value = "发布状态(0:待发布 1:审核中 2:已发布 3:已驳回 4:已关闭)", required = false, dataType = "varchar") @ApiImplicitParam(name = "releaseState", value = "发布状态(0:待发布 1:审核中 2:已发布 3:已驳回 4:已关闭)", required = false, dataType = "varchar")
@GetMapping(value = "/queryBLessonsByPagination") @GetMapping(value = "/queryBLessonsByPagination")
public Result queryBLessonsByPagination(CurUser curUser, MyReleaseDTO myReleaseDTO, BindingResult bindingResult) { public Result queryBLessonsByPagination(CurUser curUser, MyReleaseDTO myReleaseDTO, BindingResult bindingResult) {
String userId = curUser.getUserId(); String userId = curUser.getUserId();
bLessonService.queryBLessonsByPagination(getPaginationUtility(),myReleaseDTO,curUser); bLessonService.queryBLessonsByPagination(getPaginationUtility(), myReleaseDTO, curUser);
GridModel gridModel = getGridModelResponse(); GridModel gridModel = getGridModelResponse();
return Result.builder(new PersistModel(1), return Result.builder(new PersistModel(1),
MessageConstant.MESSAGE_ALERT_SUCCESS, MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR, MessageConstant.MESSAGE_ALERT_ERROR,
gridModel); gridModel);
} }
/** /**
* @author: zhangqingle
* @param * @param
* @return * @return
* @author: zhangqingle
*/ */
@ApiOperation(value="605 根据条件分页查询全部课程", notes="根据条件分页查询全部课程", response = BLesson.class) @ApiOperation(value = "605 根据条件分页查询全部课程", notes = "根据条件分页查询全部课程", response = BLesson.class)
@GetMapping(value = "/queryAllBLessonsByPagination") @GetMapping(value = "/queryAllBLessonsByPagination")
public Result queryAllBLessonsByPagination(CurUser curUser, @Valid FindAllLessonDTO findAllLessonDTO, BindingResult bindingResult) { public Result queryAllBLessonsByPagination(CurUser curUser, @Valid FindAllLessonDTO findAllLessonDTO, BindingResult bindingResult) {
findAllLessonDTO.setCropId(curUser.getCorpId()); findAllLessonDTO.setCropId(curUser.getCorpId());
bLessonService.queryAllBLessonsByPagination(getPaginationUtility(),findAllLessonDTO); bLessonService.queryAllBLessonsByPagination(getPaginationUtility(), findAllLessonDTO);
GridModel gridModel = getGridModelResponse(); GridModel gridModel = getGridModelResponse();
return Result.builder(new PersistModel(1), return Result.builder(new PersistModel(1),
MessageConstant.MESSAGE_ALERT_SUCCESS, MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR, MessageConstant.MESSAGE_ALERT_ERROR,
gridModel); gridModel);
} }
/** /**
* @author: zhangqingle
* @param * @param
* @return * @return
* @author: zhangqingle
*/ */
@ApiOperation(value="606 分页查询大家都在学", notes="分页查询大家都在学", response = BLesson.class) @ApiOperation(value = "606 分页查询大家都在学", notes = "分页查询大家都在学", response = BLesson.class)
@GetMapping(value = "/queryPersonMoreByPagination") @GetMapping(value = "/queryPersonMoreByPagination")
public Result queryPersonMoreByPagination(CurUser curUser, BindingResult bindingResult) { public Result queryPersonMoreByPagination(CurUser curUser, BindingResult bindingResult) {
bLessonService.queryPersonMoreByPagination(getPaginationUtility(),curUser); bLessonService.queryPersonMoreByPagination(getPaginationUtility(), curUser);
GridModel gridModel = getGridModelResponse(); GridModel gridModel = getGridModelResponse();
return Result.builder(new PersistModel(1), return Result.builder(new PersistModel(1),
MessageConstant.MESSAGE_ALERT_SUCCESS, MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR, MessageConstant.MESSAGE_ALERT_ERROR,
gridModel); gridModel);
} }
/** /**
* @author: zhangqingle
* @param * @param
* @return * @return
* @author: zhangqingle
*/ */
@ApiOperation(value="607 分页查询企业推荐", notes="分页查询企业推荐", response = BLesson.class) @ApiOperation(value = "607 分页查询企业推荐", notes = "分页查询企业推荐", response = BLesson.class)
@GetMapping(value = "/queryRecommendByPagination") @GetMapping(value = "/queryRecommendByPagination")
public Result queryRecommendByPagination(CurUser curUser, BindingResult bindingResult) { public Result queryRecommendByPagination(CurUser curUser, BindingResult bindingResult) {
bLessonService.queryRecommendByPagination(getPaginationUtility(),curUser); bLessonService.queryRecommendByPagination(getPaginationUtility(), curUser);
GridModel gridModel = getGridModelResponse(); GridModel gridModel = getGridModelResponse();
return Result.builder(new PersistModel(1), return Result.builder(new PersistModel(1),
MessageConstant.MESSAGE_ALERT_SUCCESS, MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR, MessageConstant.MESSAGE_ALERT_ERROR,
gridModel); gridModel);
} }
/** /**
* @author: zhangqingle
* @param * @param
* @return * @return
* @author: zhangqingle
*/ */
@ApiOperation(value="608 分页查询最受关注", notes="分页查询最受关注", response = BLesson.class) @ApiOperation(value = "608 分页查询最受关注", notes = "分页查询最受关注", response = BLesson.class)
@GetMapping(value = "/queryConcernByPagination") @GetMapping(value = "/queryConcernByPagination")
public Result queryConcernByPagination(CurUser curUser, BindingResult bindingResult) { public Result queryConcernByPagination(CurUser curUser, BindingResult bindingResult) {
bLessonService.queryConcernByPagination(getPaginationUtility(),curUser); bLessonService.queryConcernByPagination(getPaginationUtility(), curUser);
GridModel gridModel = getGridModelResponse(); GridModel gridModel = getGridModelResponse();
return Result.builder(new PersistModel(1), return Result.builder(new PersistModel(1),
MessageConstant.MESSAGE_ALERT_SUCCESS, MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR, MessageConstant.MESSAGE_ALERT_ERROR,
gridModel); gridModel);
...@@ -188,50 +188,50 @@ public class BLessonController extends PaginationController<BLesson> { ...@@ -188,50 +188,50 @@ public class BLessonController extends PaginationController<BLesson> {
/** /**
* @author: zhangqingle
* @param * @param
* @return * @return
* @author: zhangqingle
*/ */
@ApiOperation(value="609 分页查询可能感兴趣", notes="分页查询可能感兴趣", response = BLesson.class) @ApiOperation(value = "609 分页查询可能感兴趣", notes = "分页查询可能感兴趣", response = BLesson.class)
@GetMapping(value = "/queryInterestedByPagination") @GetMapping(value = "/queryInterestedByPagination")
public Result queryInterestedByPagination(CurUser curUser, BindingResult bindingResult) { public Result queryInterestedByPagination(CurUser curUser, BindingResult bindingResult) {
bLessonService.queryInterestedByPagination(getPaginationUtility(),curUser); bLessonService.queryInterestedByPagination(getPaginationUtility(), curUser);
GridModel gridModel = getGridModelResponse(); GridModel gridModel = getGridModelResponse();
return Result.builder(new PersistModel(1), return Result.builder(new PersistModel(1),
MessageConstant.MESSAGE_ALERT_SUCCESS, MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR, MessageConstant.MESSAGE_ALERT_ERROR,
gridModel); gridModel);
} }
/** /**
* @author: zhangqingle
* @param * @param
* @return * @return
* @author: zhangqingle
*/ */
@ApiOperation(value="610 首页分页查询全部课程", notes="根据条件分页查询全部课程", response = BLesson.class) @ApiOperation(value = "610 首页分页查询全部课程", notes = "根据条件分页查询全部课程", response = BLesson.class)
@GetMapping(value = "/queryHomeBLessonsByPagination") @GetMapping(value = "/queryHomeBLessonsByPagination")
public Result queryHomeBLessonsByPagination(CurUser curUser, @Valid FirstPageQueryDTO firstPageQueryDTO, BindingResult bindingResult) { public Result queryHomeBLessonsByPagination(CurUser curUser, @Valid FirstPageQueryDTO firstPageQueryDTO, BindingResult bindingResult) {
List<AllCourseDTO> allCourse = null; List<AllCourseDTO> allCourse = null;
if (StringUtils.isNotEmpty(firstPageQueryDTO.getCourseLevelOne())){ if (StringUtils.isNotEmpty(firstPageQueryDTO.getCourseLevelOne())) {
allCourse = bCourseService.findAllCourse(curUser.getCorpId()); allCourse = bCourseService.findAllCourse(curUser.getCorpId());
} }
bLessonService.queryHomeBLessonsByPagination(getPaginationUtility(),firstPageQueryDTO,allCourse); bLessonService.queryHomeBLessonsByPagination(getPaginationUtility(), firstPageQueryDTO, allCourse);
GridModel gridModel = getGridModelResponse(); GridModel gridModel = getGridModelResponse();
return Result.builder(new PersistModel(1), return Result.builder(new PersistModel(1),
MessageConstant.MESSAGE_ALERT_SUCCESS, MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR, MessageConstant.MESSAGE_ALERT_ERROR,
gridModel); gridModel);
} }
/** /**
* @author: zhangqingle
* @param * @param
* @return * @return
* @author: zhangqingle
*/ */
@ApiOperation(value="611 关闭课程", notes="根据ID关闭一个课程") @ApiOperation(value = "611 关闭课程", notes = "根据ID关闭一个课程")
@ApiImplicitParam(name = "businessId", value = "businessId", required = true, dataType = "varchar") @ApiImplicitParam(name = "businessId", value = "businessId", required = true, dataType = "varchar")
@PostMapping(value = "/close") @PostMapping(value = "/close")
public Result close(CurUser curUser,String businessId,BindingResult bindingResult) { public Result close(CurUser curUser, String businessId, BindingResult bindingResult) {
PersistModel data = bLessonService.closeBLesson(businessId); PersistModel data = bLessonService.closeBLesson(businessId);
return Result.builder(data, return Result.builder(data,
MessageConstant.MESSAGE_ALERT_SUCCESS, MessageConstant.MESSAGE_ALERT_SUCCESS,
...@@ -240,30 +240,30 @@ public class BLessonController extends PaginationController<BLesson> { ...@@ -240,30 +240,30 @@ public class BLessonController extends PaginationController<BLesson> {
} }
/** /**
* @author: zhangqingle
* @param * @param
* @return * @return
* @author: zhangqingle
*/ */
@ApiOperation(value="612 课程培训条件查询", notes="课程培训条件查询(Banner内部资源)", response = BLesson.class) @ApiOperation(value = "612 课程培训条件查询", notes = "课程培训条件查询(Banner内部资源)", response = BLesson.class)
@ApiImplicitParam(name = "businessId", value = "businessId", required = true, dataType = "varchar") @ApiImplicitParam(name = "businessId", value = "businessId", required = true, dataType = "varchar")
@GetMapping(value = "/findLessonAtBanner") @GetMapping(value = "/findLessonAtBanner")
public Result findLessonAtBanner(CurUser curUser, @Valid LessonTrainAtBannerDTO lessonTrainDTO, BindingResult bindingResult) { public Result findLessonAtBanner(CurUser curUser, @Valid LessonTrainAtBannerDTO lessonTrainDTO, BindingResult bindingResult) {
// bLessonService.findLessonAtBannerByPagination(getPaginationUtility(),lessonTrainDTO); // bLessonService.findLessonAtBannerByPagination(getPaginationUtility(),lessonTrainDTO);
// GridModel gridModel = getGridModelResponse(); // GridModel gridModel = getGridModelResponse();
return Result.builder(new PersistModel(1), return Result.builder(new PersistModel(1),
MessageConstant.MESSAGE_ALERT_SUCCESS, MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR, MessageConstant.MESSAGE_ALERT_ERROR,
bLessonService.findLessonAtBanner(lessonTrainDTO)); bLessonService.findLessonAtBanner(lessonTrainDTO));
} }
/** /**
* @author: zhangqingle
* @param * @param
* @return * @return
* @author: zhangqingle
*/ */
@ApiOperation(value="613 我的课程总数(学习和发布)", notes="我的课程总数") @ApiOperation(value = "613 我的课程总数(学习和发布)", notes = "我的课程总数")
@GetMapping(value = "/iLessonCount") @GetMapping(value = "/iLessonCount")
public Result ILessonCountDTO(CurUser curUser, BindingResult bindingResult ) { public Result ILessonCountDTO(CurUser curUser, BindingResult bindingResult) {
String userId = curUser.getUserId(); String userId = curUser.getUserId();
return Result.builder(new PersistModel(1), return Result.builder(new PersistModel(1),
MessageConstant.MESSAGE_ALERT_SUCCESS, MessageConstant.MESSAGE_ALERT_SUCCESS,
...@@ -272,11 +272,11 @@ public class BLessonController extends PaginationController<BLesson> { ...@@ -272,11 +272,11 @@ public class BLessonController extends PaginationController<BLesson> {
} }
/** /**
* @author: zhangqingle
* @param * @param
* @return * @return
* @author: zhangqingle
*/ */
@ApiOperation(value="614 退出课程", notes="根据ID停用一条记录") @ApiOperation(value = "614 退出课程", notes = "根据ID停用一条记录")
@ApiImplicitParam(name = "businessId", value = "退出课程的选课id", required = true, dataType = "varchar") @ApiImplicitParam(name = "businessId", value = "退出课程的选课id", required = true, dataType = "varchar")
@PostMapping(value = "/quit") @PostMapping(value = "/quit")
public Result quit(CurUser curUser, @Valid QuitLessonDTO quitLessonDTO, BindingResult bindingResult) { public Result quit(CurUser curUser, @Valid QuitLessonDTO quitLessonDTO, BindingResult bindingResult) {
...@@ -288,15 +288,15 @@ public class BLessonController extends PaginationController<BLesson> { ...@@ -288,15 +288,15 @@ public class BLessonController extends PaginationController<BLesson> {
} }
/** /**
* @author: zhangqingle
* @param * @param
* @return * @return
* @author: zhangqingle
*/ */
@ApiOperation(value="615 分页查询我学习", notes="分页查询我学习", response = BLesson.class) @ApiOperation(value = "615 分页查询我学习", notes = "分页查询我学习", response = BLesson.class)
@GetMapping(value = "/queryLearnBLessonsByPagination") @GetMapping(value = "/queryLearnBLessonsByPagination")
public Result queryLearnBLessonsByPagination(CurUser curUser, @Valid ILearnLessonDTO param, BindingResult bindingResult) { public Result queryLearnBLessonsByPagination(CurUser curUser, @Valid ILearnLessonDTO param, BindingResult bindingResult) {
String userId = curUser.getUserId(); String userId = curUser.getUserId();
bLessonPersonService.queryLearnBLessonsByPagination(getPaginationUtility(),param,userId); bLessonPersonService.queryLearnBLessonsByPagination(getPaginationUtility(), param, userId);
GridModel gridModel = getGridModelResponse(); GridModel gridModel = getGridModelResponse();
return Result.builder(new PersistModel(1), return Result.builder(new PersistModel(1),
MessageConstant.MESSAGE_ALERT_SUCCESS, MessageConstant.MESSAGE_ALERT_SUCCESS,
...@@ -305,18 +305,18 @@ public class BLessonController extends PaginationController<BLesson> { ...@@ -305,18 +305,18 @@ public class BLessonController extends PaginationController<BLesson> {
} }
/** /**
* @author: zhangqingle
* @param * @param
* @return * @return
* @author: zhangqingle
*/ */
@ApiOperation(value="616 列表页分页查询课程", notes="分页查询列表页全部", response = BLesson.class) @ApiOperation(value = "616 列表页分页查询课程", notes = "分页查询列表页全部", response = BLesson.class)
@GetMapping(value = "/queryListAllLessonByPagination") @GetMapping(value = "/queryListAllLessonByPagination")
public Result queryListAllLessonByPagination(CurUser curUser, @Valid FindListLessonDTO param, BindingResult bindingResult) { public Result queryListAllLessonByPagination(CurUser curUser, @Valid FindListLessonDTO param, BindingResult bindingResult) {
List<AllCourseDTO> allCourse = null; List<AllCourseDTO> allCourse = null;
if (StringUtils.isNotEmpty(param.getCourse())){ if (StringUtils.isNotEmpty(param.getCourse())) {
allCourse = bCourseService.findAllCourse(curUser.getCorpId()); allCourse = bCourseService.findAllCourse(curUser.getCorpId());
} }
bLessonService.queryListAllLessonByPagination(getPaginationUtility(),param,allCourse); bLessonService.queryListAllLessonByPagination(getPaginationUtility(), param, allCourse);
GridModel gridModel = getGridModelResponse(); GridModel gridModel = getGridModelResponse();
return Result.builder(new PersistModel(1), return Result.builder(new PersistModel(1),
MessageConstant.MESSAGE_ALERT_SUCCESS, MessageConstant.MESSAGE_ALERT_SUCCESS,
...@@ -325,19 +325,18 @@ public class BLessonController extends PaginationController<BLesson> { ...@@ -325,19 +325,18 @@ public class BLessonController extends PaginationController<BLesson> {
} }
/** /**
* @param
* @return
* @author: jiangpengpeng * @author: jiangpengpeng
* @description: TODO * @description: TODO
* @date: 2019/9/27 14:37 * @date: 2019/9/27 14:37
* @param
* @return
*/ */
@ApiOperation(value = "617课程管理显示的全部课程", notes="课程管理显示的全部课程", response = BLesson.class) @ApiOperation(value = "617课程管理显示的全部课程", notes = "课程管理显示的全部课程", response = BLesson.class)
@GetMapping(value = "theLessonManage") @GetMapping(value = "theLessonManage")
public Result theLessonManage(CurUser curUser, @Valid BLesson bLesson, BindingResult bindingResult){ public Result theLessonManage(CurUser curUser, @Valid BLesson bLesson, BindingResult bindingResult) {
List<RoleTypeDepartDTO> roleList = sysRoleService.queryRoleTypeByUserId(curUser); List<RoleTypeDepartDTO> roleList = sysRoleService.queryRoleTypeByUserId(curUser);
List<BLesson> bLessons = bLessonService.theLessonMangageByPagination(getPaginationUtility(), curUser, bLesson ,roleList); List<BLesson> bLessons = bLessonService.theLessonMangageByPagination(getPaginationUtility(), curUser, bLesson, roleList);
GridModel gridModel = getGridModelResponse(); GridModel gridModel = getGridModelResponse();
return Result.builder(new PersistModel(1), return Result.builder(new PersistModel(1),
MessageConstant.MESSAGE_ALERT_SUCCESS, MessageConstant.MESSAGE_ALERT_SUCCESS,
...@@ -346,14 +345,14 @@ public class BLessonController extends PaginationController<BLesson> { ...@@ -346,14 +345,14 @@ public class BLessonController extends PaginationController<BLesson> {
} }
/** /**
* @author: zhangqingle
* @param * @param
* @return * @return
* @author: zhangqingle
*/ */
@ApiOperation(value="618 发布课程", notes="根据ID发布一个课程") @ApiOperation(value = "618 发布课程", notes = "根据ID发布一个课程")
@ApiImplicitParam(name = "businessId", value = "businessId", required = true, dataType = "varchar") @ApiImplicitParam(name = "businessId", value = "businessId", required = true, dataType = "varchar")
@PostMapping(value = "/release") @PostMapping(value = "/release")
public Result release(CurUser curUser,String businessId,BindingResult bindingResult) { public Result release(CurUser curUser, String businessId, BindingResult bindingResult) {
PersistModel data = bLessonService.releaseBLesson(businessId); PersistModel data = bLessonService.releaseBLesson(businessId);
return Result.builder(data, return Result.builder(data,
MessageConstant.MESSAGE_ALERT_SUCCESS, MessageConstant.MESSAGE_ALERT_SUCCESS,
...@@ -362,11 +361,11 @@ public class BLessonController extends PaginationController<BLesson> { ...@@ -362,11 +361,11 @@ public class BLessonController extends PaginationController<BLesson> {
} }
/** /**
* @author: zhangqingle
* @param * @param
* @return * @return
* @author: zhangqingle
*/ */
@ApiOperation(value="619 线上课程学员跟踪图表", notes="线上课程学员跟踪图表") @ApiOperation(value = "619 线上课程学员跟踪图表", notes = "线上课程学员跟踪图表")
@GetMapping(value = "/studentTrackingChart") @GetMapping(value = "/studentTrackingChart")
public Result studentTrackingChart(CurUser curUser, @Valid StudentTrackingChartDTO studentTrackingChartDTO, BindingResult bindingResult) { public Result studentTrackingChart(CurUser curUser, @Valid StudentTrackingChartDTO studentTrackingChartDTO, BindingResult bindingResult) {
StudentTrackingChartRspDTO model = bLessonPersonService.studentTrackingChart(studentTrackingChartDTO); StudentTrackingChartRspDTO model = bLessonPersonService.studentTrackingChart(studentTrackingChartDTO);
...@@ -378,13 +377,13 @@ public class BLessonController extends PaginationController<BLesson> { ...@@ -378,13 +377,13 @@ public class BLessonController extends PaginationController<BLesson> {
} }
/** /**
* @author: zhangqingle
* @param * @param
* @return * @return
* @author: zhangqingle
*/ */
@ApiOperation(value="620 学员跟踪", notes="线上课程级线下培训学员跟踪" ,response = StudentTrackingRspDTO.class) @ApiOperation(value = "620 学员跟踪", notes = "线上课程级线下培训学员跟踪", response = StudentTrackingRspDTO.class)
@GetMapping(value = "/studentTrackingByPagination") @GetMapping(value = "/studentTrackingByPagination")
public Result studentTrackingByPagination(CurUser curUser, @Valid StudentTrackingDTO studentTrackingDTO, BindingResult bindingResult) { public Result studentTrackingByPagination(CurUser curUser, @Valid StudentTrackingDTO studentTrackingDTO, BindingResult bindingResult) {
bLessonPersonService.studentTrackingByPagination(getPaginationUtility(), studentTrackingDTO); bLessonPersonService.studentTrackingByPagination(getPaginationUtility(), studentTrackingDTO);
GridModel gridModel = getGridModelResponse(); GridModel gridModel = getGridModelResponse();
return Result.builder(new PersistModel(1), return Result.builder(new PersistModel(1),
...@@ -394,11 +393,11 @@ public class BLessonController extends PaginationController<BLesson> { ...@@ -394,11 +393,11 @@ public class BLessonController extends PaginationController<BLesson> {
} }
/** /**
* @author: zhangqingle
* @param * @param
* @return * @return
* @author: zhangqingle
*/ */
@ApiOperation(value="621 取消指派", notes="取消指派") @ApiOperation(value = "621 取消指派", notes = "取消指派")
@PostMapping(value = "/cancelAppoint") @PostMapping(value = "/cancelAppoint")
public Result cancelAppoint(CurUser curUser, @Valid CancelAppointDTO cancelAppointDTO, BindingResult bindingResult) { public Result cancelAppoint(CurUser curUser, @Valid CancelAppointDTO cancelAppointDTO, BindingResult bindingResult) {
PersistModel data = bLessonPersonService.cancelAppoint(cancelAppointDTO); PersistModel data = bLessonPersonService.cancelAppoint(cancelAppointDTO);
...@@ -410,13 +409,13 @@ public class BLessonController extends PaginationController<BLesson> { ...@@ -410,13 +409,13 @@ public class BLessonController extends PaginationController<BLesson> {
/** /**
* @author: zhangqingle
* @param * @param
* @return * @return
* @author: zhangqingle
*/ */
@ApiOperation(value="622 推荐课程", notes="根据ID推荐课程") @ApiOperation(value = "622 推荐课程", notes = "根据ID推荐课程")
@PostMapping(value = "/recommend") @PostMapping(value = "/recommend")
public Result recommend(CurUser curUser,@Valid RecommendLessonDTO recommendLessonDTO,BindingResult bindingResult) { public Result recommend(CurUser curUser, @Valid RecommendLessonDTO recommendLessonDTO, BindingResult bindingResult) {
PersistModel data = bLessonService.recommendBLesson(recommendLessonDTO); PersistModel data = bLessonService.recommendBLesson(recommendLessonDTO);
return Result.builder(data, return Result.builder(data,
MessageConstant.MESSAGE_ALERT_SUCCESS, MessageConstant.MESSAGE_ALERT_SUCCESS,
...@@ -425,11 +424,11 @@ public class BLessonController extends PaginationController<BLesson> { ...@@ -425,11 +424,11 @@ public class BLessonController extends PaginationController<BLesson> {
} }
/** /**
* @author: zhangqingle
* @param * @param
* @return * @return
* @author: zhangqingle
*/ */
@ApiOperation(value="623 根据课程Id 查询该课程推荐范围", notes="根据课程id 查询课程推荐范围(人和部门)", response = FindLessonRecommendRspDTO.class) @ApiOperation(value = "623 根据课程Id 查询该课程推荐范围", notes = "根据课程id 查询课程推荐范围(人和部门)", response = FindLessonRecommendRspDTO.class)
@GetMapping(value = "/queryRecommendByLessonId") @GetMapping(value = "/queryRecommendByLessonId")
public Result queryRecommendByLessonId(CurUser curUser, @Valid FindLessonRecommendDTO param, BindingResult bindingResult) { public Result queryRecommendByLessonId(CurUser curUser, @Valid FindLessonRecommendDTO param, BindingResult bindingResult) {
return Result.builder(new PersistModel(1), return Result.builder(new PersistModel(1),
...@@ -438,9 +437,9 @@ public class BLessonController extends PaginationController<BLesson> { ...@@ -438,9 +437,9 @@ public class BLessonController extends PaginationController<BLesson> {
bLessonService.queryRecommendByLessonId(param)); bLessonService.queryRecommendByLessonId(param));
} }
@ApiOperation(value="624 指派课程", notes="根据ID指派课程") @ApiOperation(value = "624 指派课程", notes = "根据ID指派课程")
@PostMapping(value = "/appointLessonToPerson") @PostMapping(value = "/appointLessonToPerson")
public Result appointLessonToPerson(CurUser curUser,@Valid AppointLessonDTO appointLessonDTO,BindingResult bindingResult) { public Result appointLessonToPerson(CurUser curUser, @Valid AppointLessonDTO appointLessonDTO, BindingResult bindingResult) {
PersistModel data = bLessonService.appointLessonToPerson(appointLessonDTO); PersistModel data = bLessonService.appointLessonToPerson(appointLessonDTO);
return Result.builder(data, return Result.builder(data,
MessageConstant.MESSAGE_ALERT_SUCCESS, MessageConstant.MESSAGE_ALERT_SUCCESS,
...@@ -448,9 +447,9 @@ public class BLessonController extends PaginationController<BLesson> { ...@@ -448,9 +447,9 @@ public class BLessonController extends PaginationController<BLesson> {
appointLessonDTO); appointLessonDTO);
} }
@ApiOperation(value="625 添加我学习的课程", notes="添加我学习的课程") @ApiOperation(value = "625 添加我学习的课程", notes = "添加我学习的课程")
@PostMapping(value = "/addMyLearnLesson") @PostMapping(value = "/addMyLearnLesson")
public Result addMyLearnLesson(CurUser curUser,@Valid AddMyLearnLessonDTO addMyLearnLessonDTO,BindingResult bindingResult) { public Result addMyLearnLesson(CurUser curUser, @Valid AddMyLearnLessonDTO addMyLearnLessonDTO, BindingResult bindingResult) {
PersistModel data = bLessonPersonService.addMyLearnLesson(addMyLearnLessonDTO); PersistModel data = bLessonPersonService.addMyLearnLesson(addMyLearnLessonDTO);
return Result.builder(data, return Result.builder(data,
MessageConstant.MESSAGE_ALERT_SUCCESS, MessageConstant.MESSAGE_ALERT_SUCCESS,
...@@ -459,11 +458,11 @@ public class BLessonController extends PaginationController<BLesson> { ...@@ -459,11 +458,11 @@ public class BLessonController extends PaginationController<BLesson> {
} }
/** /**
* @author: zhangqingle
* @param * @param
* @return * @return
* @author: zhangqingle
*/ */
@ApiOperation(value="626 删除推荐", notes="删除推荐") @ApiOperation(value = "626 删除推荐", notes = "删除推荐")
@ApiImplicitParam(name = "businessId", value = "businessId", required = true, dataType = "varchar") @ApiImplicitParam(name = "businessId", value = "businessId", required = true, dataType = "varchar")
@PostMapping(value = "/deleteRecommend") @PostMapping(value = "/deleteRecommend")
public Result deleteRecommend(CurUser curUser, @Valid String lessonId, BindingResult bindingResult) { public Result deleteRecommend(CurUser curUser, @Valid String lessonId, BindingResult bindingResult) {
...@@ -473,12 +472,13 @@ public class BLessonController extends PaginationController<BLesson> { ...@@ -473,12 +472,13 @@ public class BLessonController extends PaginationController<BLesson> {
MessageConstant.MESSAGE_ALERT_ERROR, MessageConstant.MESSAGE_ALERT_ERROR,
lessonId); lessonId);
} }
/** /**
* @author: zhangqingle
* @param * @param
* @return * @return
* @author: zhangqingle
*/ */
@ApiOperation(value="627 设置为出席/缺席", notes="设置为出席/缺席") @ApiOperation(value = "627 设置为出席/缺席", notes = "设置为出席/缺席")
@PostMapping(value = "/setTrainIsSign") @PostMapping(value = "/setTrainIsSign")
public Result setTrainIsSign(CurUser curUser, @Valid SetTrainIsSignDTO setTrainIsSignDTO, BindingResult bindingResult) { public Result setTrainIsSign(CurUser curUser, @Valid SetTrainIsSignDTO setTrainIsSignDTO, BindingResult bindingResult) {
PersistModel data = bLessonService.setTrainIsSign(setTrainIsSignDTO); PersistModel data = bLessonService.setTrainIsSign(setTrainIsSignDTO);
...@@ -489,13 +489,13 @@ public class BLessonController extends PaginationController<BLesson> { ...@@ -489,13 +489,13 @@ public class BLessonController extends PaginationController<BLesson> {
} }
/** /**
* @author: zhangqingle
* @param * @param
* @return * @return
* @author: zhangqingle
*/ */
@ApiOperation(value="628 我的培训总数(学习和教学)", notes="我的培训总数") @ApiOperation(value = "628 我的培训总数(学习和教学)", notes = "我的培训总数")
@GetMapping(value = "/iTrainCount") @GetMapping(value = "/iTrainCount")
public Result iTrainCount(CurUser curUser, BindingResult bindingResult ) { public Result iTrainCount(CurUser curUser, BindingResult bindingResult) {
String userId = curUser.getUserId(); String userId = curUser.getUserId();
return Result.builder(new PersistModel(1), return Result.builder(new PersistModel(1),
MessageConstant.MESSAGE_ALERT_SUCCESS, MessageConstant.MESSAGE_ALERT_SUCCESS,
...@@ -505,13 +505,13 @@ public class BLessonController extends PaginationController<BLesson> { ...@@ -505,13 +505,13 @@ public class BLessonController extends PaginationController<BLesson> {
/** /**
* @author: zhangqingle
* @param * @param
* @return * @return
* @author: zhangqingle
*/ */
@ApiOperation(value="629 培训学员总数(已报名 已到场 未到场)", notes="培训学员总数(已报名 已到场 未到场)") @ApiOperation(value = "629 培训学员总数(已报名 已到场 未到场)", notes = "培训学员总数(已报名 已到场 未到场)")
@GetMapping(value = "/trainPersonCount") @GetMapping(value = "/trainPersonCount")
public Result trainPersonCount(CurUser curUser,String lessonId ,BindingResult bindingResult ) { public Result trainPersonCount(CurUser curUser, String lessonId, BindingResult bindingResult) {
String userId = curUser.getUserId(); String userId = curUser.getUserId();
return Result.builder(new PersistModel(1), return Result.builder(new PersistModel(1),
MessageConstant.MESSAGE_ALERT_SUCCESS, MessageConstant.MESSAGE_ALERT_SUCCESS,
...@@ -520,13 +520,13 @@ public class BLessonController extends PaginationController<BLesson> { ...@@ -520,13 +520,13 @@ public class BLessonController extends PaginationController<BLesson> {
} }
/** /**
* @author: zhangqingle
* @param * @param
* @return * @return
* @author: zhangqingle
*/ */
@ApiOperation(value="630 培训学员", notes="培训学员") @ApiOperation(value = "630 培训学员", notes = "培训学员")
@GetMapping(value = "/trainPersons") @GetMapping(value = "/trainPersons")
public Result trainPersons(CurUser curUser,@Valid FindTrainPersonDTO param,BindingResult bindingResult ) { public Result trainPersons(CurUser curUser, @Valid FindTrainPersonDTO param, BindingResult bindingResult) {
return Result.builder(new PersistModel(1), return Result.builder(new PersistModel(1),
MessageConstant.MESSAGE_ALERT_SUCCESS, MessageConstant.MESSAGE_ALERT_SUCCESS,
...@@ -550,35 +550,53 @@ public class BLessonController extends PaginationController<BLesson> { ...@@ -550,35 +550,53 @@ public class BLessonController extends PaginationController<BLesson> {
// lessonId); // lessonId);
// } // }
@ApiOperation(value="631 报名培训", notes="报名培训") @ApiOperation(value = "631 报名培训", notes = "报名培训")
@ApiImplicitParam(name = "lessonId", value = "培训课id", required = true, dataType = "varchar") @ApiImplicitParam(name = "lessonId", value = "培训课id", required = true, dataType = "varchar")
@GetMapping(value = "/toTraining") @GetMapping(value = "/toTraining")
public Result toTraining(CurUser curUser,String lessonId) { public Result toTraining(CurUser curUser, String lessonId) {
return Result.builder(new PersistModel(bLessonService.toTraining(curUser,lessonId)), return Result.builder(new PersistModel(bLessonService.toTraining(curUser, lessonId)),
MessageConstant.MESSAGE_ALERT_SUCCESS, MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR, MessageConstant.MESSAGE_ALERT_ERROR,
lessonId); lessonId);
} }
@ApiOperation(value="632 单一查询我参加培训的信息", notes="单一查询我参加培训的信息",response = BLesson.class) @ApiOperation(value = "632 单一查询我参加培训的信息", notes = "单一查询我参加培训的信息", response = BLesson.class)
@ApiImplicitParam(name = "businessId", value = "培训课id", required = true, dataType = "varchar") @ApiImplicitParam(name = "businessId", value = "培训课id", required = true, dataType = "varchar")
@GetMapping(value = "/findOneMyTrain") @GetMapping(value = "/findOneMyTrain")
public Result findOneMyTrain(CurUser curUser,String businessId) { public Result findOneMyTrain(CurUser curUser, String businessId) {
return Result.builder(new PersistModel(1), return Result.builder(new PersistModel(1),
MessageConstant.MESSAGE_ALERT_SUCCESS, MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR, MessageConstant.MESSAGE_ALERT_ERROR,
bLessonService.findOneMyTrain(curUser,businessId)); bLessonService.findOneMyTrain(curUser, businessId));
} }
@ApiOperation(value="633 单一查询我主讲培训的信息", notes="单一查询我主讲培训的信息",response = BLesson.class) @ApiOperation(value = "633 单一查询我主讲培训的信息", notes = "单一查询我主讲培训的信息", response = BLesson.class)
@ApiImplicitParam(name = "lessonId", value = "培训课id", required = true, dataType = "varchar") @ApiImplicitParam(name = "lessonId", value = "培训课id", required = true, dataType = "varchar")
@GetMapping(value = "/findOneMyTeachTrain") @GetMapping(value = "/findOneMyTeachTrain")
public Result findOneMyTeachTrain(CurUser curUser,String lessonId) { public Result findOneMyTeachTrain(CurUser curUser, String lessonId) {
return Result.builder(new PersistModel(1), return Result.builder(new PersistModel(1),
MessageConstant.MESSAGE_ALERT_SUCCESS, MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR, MessageConstant.MESSAGE_ALERT_ERROR,
bLessonService.findOneMyTeachTrain(curUser,lessonId)); bLessonService.findOneMyTeachTrain(curUser, lessonId));
}
@ApiOperation(value = "634 收藏课程或培训", notes = "收藏课程或培训")
@GetMapping(value = "/collectLesson")
public Result collectLesson(CurUser curUser, String lessonId) {
return Result.builder(bLessonService.colletLesson(curUser, lessonId),
MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR,
curUser.getUserId());
}
@ApiOperation(value = "635 取消收藏课程或培训", notes = "取消收藏课程或培训")
@GetMapping(value = "/notCollectLesson")
public Result notCollectLesson(CurUser curUser, String lessonId) {
return Result.builder(bLessonService.notColletLesson(curUser, lessonId),
MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR,
curUser.getUserId());
} }
} }
package org.rcisoft.business.blesson.dao; package org.rcisoft.business.blesson.dao;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap; import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
import org.rcisoft.business.blesson.dto.AddMyLearnLessonDTO; import org.rcisoft.business.blesson.dto.AddMyLearnLessonDTO;
...@@ -38,6 +40,24 @@ public interface BCollectRepository extends BaseMapper<BCollect> { ...@@ -38,6 +40,24 @@ public interface BCollectRepository extends BaseMapper<BCollect> {
@ResultMap(value = "BaseResultMap") @ResultMap(value = "BaseResultMap")
List<BCollect> selectByPersonAndLesson(AddMyLearnLessonDTO param); List<BCollect> selectByPersonAndLesson(AddMyLearnLessonDTO param);
/**
* 查询关系表中是否已存在此关系
* @param personId
* @param lessonId
* @return
*/
@Select("select * from b_collect where person_id =#{personId} and lesson_id =#{lessonId} ")
List<BCollect> selectOneData(@Param("personId") String personId,@Param("lessonId") String lessonId);
/**
* 取消收藏课程或培训
* @param personId
* @param lessonId
* @return
*/
@Delete("delete from b_collect where person_id =#{personId} and lesson_id =#{lessonId} ")
int notColletLesson(@Param("personId") String personId,@Param("lessonId") String lessonId);
} }
...@@ -11,6 +11,7 @@ import org.springframework.stereotype.Repository; ...@@ -11,6 +11,7 @@ import org.springframework.stereotype.Repository;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map;
@Repository @Repository
public interface BLessonPersonRepository extends BaseMapper<BLessonPerson> { public interface BLessonPersonRepository extends BaseMapper<BLessonPerson> {
...@@ -278,7 +279,10 @@ public interface BLessonPersonRepository extends BaseMapper<BLessonPerson> { ...@@ -278,7 +279,10 @@ public interface BLessonPersonRepository extends BaseMapper<BLessonPerson> {
"where lesson_id= #{lessonId} and person_id=#{personId} and del_flag != 1 ") "where lesson_id= #{lessonId} and person_id=#{personId} and del_flag != 1 ")
int updateLessonPersonByUserId(BLessonPerson lessonPerson); int updateLessonPersonByUserId(BLessonPerson lessonPerson);
// @Insert("")
// int insertLessonPerson(BLessonPerson lessonPerson); @Select("select count(0) x ,(select max_apply_person from b_lesson where business_id = #{lessonId} ) y " +
"from b_lesson_person where lesson_id = #{lessonId} ")
Map<String,Object> selecTraningNum(@Param("lessonId") String lessonId);
} }
...@@ -18,10 +18,12 @@ import java.util.List; ...@@ -18,10 +18,12 @@ import java.util.List;
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
@Table(name = "b_collect") @Table(name = "b_collect")
public class BCollect extends IdEntity<BCollect> { public class BCollect{
protected String businessId;
private String personId; private String personId;
private String lessonId; private String lessonId;
......
...@@ -235,6 +235,17 @@ public interface BLessonService{ ...@@ -235,6 +235,17 @@ public interface BLessonService{
*/ */
int toTraining(CurUser curUser,String lessonId); int toTraining(CurUser curUser,String lessonId);
/**
* 收藏课程或课程
* @param curUser
* @param lessonId
* @return
*/
PersistModel colletLesson(CurUser curUser,String lessonId);
PersistModel notColletLesson(CurUser curUser,String lessonId);
/** /**
* 单一查询我参加培训的信息 * 单一查询我参加培训的信息
......
...@@ -2,9 +2,11 @@ package org.rcisoft.business.blesson.service.impl; ...@@ -2,9 +2,11 @@ package org.rcisoft.business.blesson.service.impl;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import io.swagger.models.auth.In;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import net.sf.json.JSONArray; import net.sf.json.JSONArray;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.SystemUtils;
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.bfile.dao.BTrainFileRepository; import org.rcisoft.business.bfile.dao.BTrainFileRepository;
...@@ -803,7 +805,6 @@ public class BLessonServiceImpl implements BLessonService { ...@@ -803,7 +805,6 @@ public class BLessonServiceImpl implements BLessonService {
// } // }
//插入收藏表 //插入收藏表
BCollect bCollect = new BCollect(); BCollect bCollect = new BCollect();
UserUtil.setCurrentPersistOperation(bCollect);
bCollect.setLessonId(lessonId); bCollect.setLessonId(lessonId);
bCollect.setPersonId(curUser.getUserId()); bCollect.setPersonId(curUser.getUserId());
int line = bCollectRepository.insertSelective(bCollect); int line = bCollectRepository.insertSelective(bCollect);
...@@ -817,7 +818,14 @@ public class BLessonServiceImpl implements BLessonService { ...@@ -817,7 +818,14 @@ public class BLessonServiceImpl implements BLessonService {
public int toTraining(CurUser curUser, String lessonId) { public int toTraining(CurUser curUser, String lessonId) {
BLessonPerson person = new BLessonPerson(); BLessonPerson person = new BLessonPerson();
BLessonPerson bLessonPerson = new BLessonPerson(); BLessonPerson bLessonPerson = new BLessonPerson();
//tep1 判断该用户是否被指派该培训或已经报名 Map<String,Object> xy = bLessonPersonRepository.selecTraningNum(lessonId);
int x = Integer.parseInt(String.valueOf(xy.get("x")));
int y = Integer.parseInt(String.valueOf(xy.get("y")));
if( x >= y){
throw new ServiceException(ResultServiceEnums.PERSON_MAX);
}
//tep2 判断该用户是否被指派该培训或已经报名
person = bLessonPersonRepository.getAppointInTraining(lessonId, curUser.getUserId()); person = bLessonPersonRepository.getAppointInTraining(lessonId, curUser.getUserId());
if (person != null) { if (person != null) {
...@@ -844,6 +852,29 @@ public class BLessonServiceImpl implements BLessonService { ...@@ -844,6 +852,29 @@ public class BLessonServiceImpl implements BLessonService {
} }
@Override
public PersistModel colletLesson(CurUser curUser, String lessonId) {
//先判断是否收藏该课程或培训
List<BCollect> one = bCollectRepository.selectOneData(curUser.getUserId(),lessonId);
if(one.size() > 0 ){
return new PersistModel(1);
}
BCollect bCollect = new BCollect();
bCollect.setBusinessId(IdGen.uuid());
bCollect.setLessonId(lessonId);
bCollect.setPersonId(curUser.getUserId());
int line = bCollectRepository.insert(bCollect);
return new PersistModel(line);
}
@Override
public PersistModel notColletLesson(CurUser curUser, String lessonId) {
return new PersistModel(bCollectRepository.notColletLesson(curUser.getUserId(),lessonId));
}
@Override @Override
@Transactional(propagation = Propagation.REQUIRED, readOnly = false) @Transactional(propagation = Propagation.REQUIRED, readOnly = false)
public BLesson findOneMyTrain(CurUser curUser, String businessId) { public BLesson findOneMyTrain(CurUser curUser, String businessId) {
......
...@@ -222,6 +222,7 @@ public enum ResultServiceEnums { ...@@ -222,6 +222,7 @@ public enum ResultServiceEnums {
CHANGE_FILE_ERROR(120,"文件转换失败"), CHANGE_FILE_ERROR(120,"文件转换失败"),
NOT_LESSON_ERROR(121,"该课程不存在"), NOT_LESSON_ERROR(121,"该课程不存在"),
JSON_ERROR(122,"JSON格式不正确"), JSON_ERROR(122,"JSON格式不正确"),
PERSON_MAX(123,"报名人数已满"),
; ;
......
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