小班相关
This commit is contained in:
@@ -0,0 +1,21 @@
|
|||||||
|
package com.peanut.modules.common.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@TableName("class_course")
|
||||||
|
public class ClassCourse {
|
||||||
|
|
||||||
|
@TableId
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
private Integer classId;
|
||||||
|
|
||||||
|
private Integer courseId;
|
||||||
|
|
||||||
|
@TableLogic
|
||||||
|
private Integer delFlag;
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
package com.peanut.modules.common.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@TableName("class")
|
||||||
|
public class ClassEntity {
|
||||||
|
|
||||||
|
@TableId
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
//小班状态 0待开班1进行中2完成
|
||||||
|
private String state;
|
||||||
|
|
||||||
|
private String icon;
|
||||||
|
|
||||||
|
private String content;
|
||||||
|
|
||||||
|
private Integer create_user;
|
||||||
|
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
private Date start_time;
|
||||||
|
|
||||||
|
private Date end_time;
|
||||||
|
|
||||||
|
@TableLogic
|
||||||
|
private Integer delFlag;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
package com.peanut.modules.common.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@TableName("class_user")
|
||||||
|
public class ClassUser {
|
||||||
|
|
||||||
|
@TableId
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
private Integer classId;
|
||||||
|
|
||||||
|
private Integer userId;
|
||||||
|
|
||||||
|
private String role;
|
||||||
|
|
||||||
|
@TableLogic
|
||||||
|
private Integer delFlag;
|
||||||
|
}
|
||||||
@@ -21,6 +21,10 @@ public class CourseEntity {
|
|||||||
|
|
||||||
private String title;
|
private String title;
|
||||||
|
|
||||||
|
private Integer director;
|
||||||
|
|
||||||
|
private Integer ddirector;
|
||||||
|
|
||||||
private Integer sort;
|
private Integer sort;
|
||||||
|
|
||||||
private String image;
|
private String image;
|
||||||
|
|||||||
@@ -233,6 +233,18 @@ public class CourseController {
|
|||||||
return courseService.getCourseLableLinkList(param);
|
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 getCourseLableLinkList(Map<String,Object> param);
|
||||||
|
|
||||||
|
R getCourseDirector(Map<String,Object> param);
|
||||||
|
|
||||||
|
R editCourseDirector(Map<String,Object> param);
|
||||||
|
|
||||||
Page<ShopProduct> getProductListForCourse(Map<String,Object> param);
|
Page<ShopProduct> getProductListForCourse(Map<String,Object> param);
|
||||||
|
|
||||||
List<CourseCatalogueEntity> catalogueListByCourse(Map<String, Object> params);
|
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.entity.*;
|
||||||
import com.peanut.modules.common.to.ParamTo;
|
import com.peanut.modules.common.to.ParamTo;
|
||||||
import com.peanut.modules.master.service.CourseService;
|
import com.peanut.modules.master.service.CourseService;
|
||||||
|
import io.swagger.models.auth.In;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@@ -42,6 +43,8 @@ public class CourseServiceImpl extends ServiceImpl<CourseDao, CourseEntity> impl
|
|||||||
private ShopProductCourseDao shopProductCourseDao;
|
private ShopProductCourseDao shopProductCourseDao;
|
||||||
@Autowired
|
@Autowired
|
||||||
private UserCourseBuyDao userCourseBuyDao;
|
private UserCourseBuyDao userCourseBuyDao;
|
||||||
|
@Autowired
|
||||||
|
private MyUserDao userDao;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Page getCourseList(Map<String,Object> map) {
|
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);
|
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
|
@Override
|
||||||
public Page<ShopProduct> getProductListForCourse(Map<String, Object> param) {
|
public Page<ShopProduct> getProductListForCourse(Map<String, Object> param) {
|
||||||
Integer limit = Integer.valueOf(param.get("limit").toString());
|
Integer limit = Integer.valueOf(param.get("limit").toString());
|
||||||
|
|||||||
Reference in New Issue
Block a user