小班相关
This commit is contained in:
@@ -233,6 +233,18 @@ public class CourseController {
|
||||
return courseService.getCourseLableLinkList(param);
|
||||
}
|
||||
|
||||
//查询课程主任
|
||||
@RequestMapping("/getCourseDirector")
|
||||
public R getCourseDirector(@RequestBody Map<String,Object> param){
|
||||
return courseService.getCourseDirector(param);
|
||||
}
|
||||
|
||||
//编辑课程主任
|
||||
@RequestMapping("/editCourseDirector")
|
||||
public R editCourseDirector(@RequestBody Map<String,Object> param){
|
||||
return courseService.editCourseDirector(param);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -31,6 +31,10 @@ public interface CourseService extends IService<CourseEntity> {
|
||||
|
||||
R getCourseLableLinkList(Map<String,Object> param);
|
||||
|
||||
R getCourseDirector(Map<String,Object> param);
|
||||
|
||||
R editCourseDirector(Map<String,Object> param);
|
||||
|
||||
Page<ShopProduct> getProductListForCourse(Map<String,Object> param);
|
||||
|
||||
List<CourseCatalogueEntity> catalogueListByCourse(Map<String, Object> params);
|
||||
|
||||
@@ -11,6 +11,7 @@ import com.peanut.modules.common.dao.*;
|
||||
import com.peanut.modules.common.entity.*;
|
||||
import com.peanut.modules.common.to.ParamTo;
|
||||
import com.peanut.modules.master.service.CourseService;
|
||||
import io.swagger.models.auth.In;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -42,6 +43,8 @@ public class CourseServiceImpl extends ServiceImpl<CourseDao, CourseEntity> impl
|
||||
private ShopProductCourseDao shopProductCourseDao;
|
||||
@Autowired
|
||||
private UserCourseBuyDao userCourseBuyDao;
|
||||
@Autowired
|
||||
private MyUserDao userDao;
|
||||
|
||||
@Override
|
||||
public Page getCourseList(Map<String,Object> map) {
|
||||
@@ -279,6 +282,36 @@ public class CourseServiceImpl extends ServiceImpl<CourseDao, CourseEntity> impl
|
||||
return R.ok().put("resList",resList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public R getCourseDirector(Map<String, Object> param) {
|
||||
CourseEntity course = this.getById((Integer)param.get("courseId"));
|
||||
MyUserEntity director = userDao.selectById(course.getDirector());
|
||||
MyUserEntity ddirector = userDao.selectById(course.getDdirector());
|
||||
return R.ok().put("director",director).put("ddirector",ddirector);
|
||||
}
|
||||
|
||||
@Override
|
||||
public R editCourseDirector(Map<String, Object> param) {
|
||||
int director = (Integer)param.get("director");
|
||||
int ddirector = (Integer)param.get("ddirector");
|
||||
if ((director==0&&ddirector==0)||director!=ddirector){
|
||||
CourseEntity course = this.getById((Integer)param.get("courseId"));
|
||||
if (course != null) {
|
||||
course.setDirector(director);
|
||||
course.setDdirector(ddirector);
|
||||
if (this.saveOrUpdate(course)){
|
||||
return R.ok();
|
||||
}else {
|
||||
return R.error("编辑失败!");
|
||||
}
|
||||
}else {
|
||||
return R.error("未查询到课程!");
|
||||
}
|
||||
}else {
|
||||
return R.error("不能是同一人!");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<ShopProduct> getProductListForCourse(Map<String, Object> param) {
|
||||
Integer limit = Integer.valueOf(param.get("limit").toString());
|
||||
|
||||
Reference in New Issue
Block a user