Commit 254dd350 by 涂亚平

zip下载有问题

1 parent 960449c5
Showing with 2354 additions and 198 deletions
......@@ -5,13 +5,13 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.4.5</version>
<version>2.1.7.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.meishu</groupId>
<artifactId>teachaicms</artifactId>
<groupId>com.subsidy</groupId>
<artifactId>subsidy</artifactId>
<version>0.0.1</version>
<name>teachaicms</name>
<name>subsidy</name>
<description>Demo project for Spring Boot</description>
<properties>
......@@ -186,7 +186,7 @@
</dependencies>
<build>
<finalName>teachcms</finalName>
<finalName>subsidy</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
......
......@@ -12,7 +12,7 @@ import org.springframework.web.bind.annotation.RestController;
@RestController
@SpringBootApplication
@MapperScan(basePackages = {"com.meishu.mapper"})
@MapperScan(basePackages = {"com.subsidy.mapper"})
@EnableScheduling
@EnableAsync
public class MeishuApplication {
......
package com.subsidy.common;
public enum Code {
USERNAMENOTFOUND(10001, "用户不存在"),
BADCREDENTIALS(10002,"账户或者密码错误"),
ACCOUNTEXPIRED(10003,"账户过期"),
LOCKEDEXCEPTION(10004, "账户已锁定"),
DISABLEDEXCEPTION(10005,"账户已禁用"),
ACCESSDENIED(10006,"无权限访问"),
AUTHENTICATION(10007,"身份验证异常"),
NOHANDLERFOUND(10008,"找不到相应的视图处理器"),
PARAM_INVALID(10009, "参数不合法"),
TOKEN_EXCEPTION(10010, "Token不合法"),
TOKEN_EXPIRED(10011, "Token已过期"),
OSS_ERROR(10012, "OSS文件上传异常"),
Network_ERROR(90000, "网络请求失败"),
SERVER_INTERNAL_ERROR(99999, "服务器内部错误"),
;
private Integer code;
private String message;
Code(Integer code, String message) {
this.code = code;
this.message = message;
}
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
}
......@@ -17,10 +17,10 @@ public class SwaggerConfig {
return new Docket(DocumentationType.SWAGGER_2)
.pathMapping("/")
.select()
.apis(RequestHandlerSelectors.basePackage("com.meishu"))
.apis(RequestHandlerSelectors.basePackage("com.subsidy"))
.paths(PathSelectors.any())
.build().apiInfo(new ApiInfoBuilder()
.title("市西cms")
.title("学习壮业")
.description("接口文档规范")
.version("1.0")
// .contact(new Contact("啊啊啊啊","www.youkehulian.com","tcp@meishu.com"))
......
......@@ -4,6 +4,7 @@ import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
import org.springframework.web.context.request.RequestAttributes;
import org.springframework.web.context.request.RequestContextHolder;
......@@ -14,6 +15,7 @@ import java.util.Arrays;
@Aspect
@Component
@Order(1)
public class WebLogAspect {
private final Logger logger = LoggerFactory.getLogger(WebLogAspect.class);
......
......@@ -3,7 +3,11 @@ package com.subsidy.common.interceptor;
import com.auth0.jwt.interfaces.Claim;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.subsidy.common.exception.HttpException;
import com.subsidy.mapper.AdministerMapper;
import com.subsidy.model.AdministerDO;
import com.subsidy.util.JwtUtil;
import com.subsidy.util.Localstorage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.method.HandlerMethod;
import org.springframework.web.servlet.HandlerInterceptor;
......@@ -24,7 +28,8 @@ import java.util.Map;
@Component
public class AuthenticationInterceptor implements HandlerInterceptor {
@Autowired
private AdministerMapper administerMapper;
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) {
......@@ -54,23 +59,23 @@ public class AuthenticationInterceptor implements HandlerInterceptor {
String type = claimMap.get("type").asString();
if (role.length > 0) {
if ("administer".equals(type)) {
//AdministerDO administerDO = administerMapper.selectById(claimMap.get("id").asLong());
//if (administerDO != null) {
// Localstorage.setUser(administerDO);
// return true;
//}
AdministerDO administerDO = administerMapper.selectById(claimMap.get("id").asLong());
if (administerDO != null) {
Localstorage.setUser(administerDO);
return true;
}
} else {
throw new HttpException(1010);
}
} else {
//AdministerDO administerDO = administerMapper.selectById(claimMap.get("id").asLong());
//if (administerDO != null) {
// Localstorage.setUser(administerDO);
// return true;
//}
AdministerDO administerDO = administerMapper.selectById(claimMap.get("id").asLong());
if (administerDO != null) {
Localstorage.setUser(administerDO);
return true;
}
}
}
// return true;
//return true;
}
throw new HttpException(1010);
}
......
......@@ -4,19 +4,27 @@ package com.subsidy.controller;
import com.subsidy.common.ResponseData;
import com.subsidy.common.ResponseVO;
import com.subsidy.common.interceptor.LoginRequired;
import com.subsidy.dto.administer.ClassDetailDTO;
import com.subsidy.dto.administer.OperatorsDTO;
import com.subsidy.model.AdministerDO;
import com.subsidy.model.ClassDictDO;
import com.subsidy.service.AdministerService;
import com.subsidy.util.ConstantUtils;
import com.subsidy.util.excel.ExcelUtil;
import com.subsidy.vo.administer.ExerciseTestVO;
import com.subsidy.vo.classdict.ClassDetailVO;
import com.subsidy.vo.member.ClassSignVO;
import com.subsidy.vo.sign.AnswerRecordVO;
import com.subsidy.vo.sign.ClassSignInfoVO;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.Api;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* <p>
* 管理平台用户 前端控制器
......@@ -34,7 +42,7 @@ public class AdministerController {
private AdministerService administerService;
@PostMapping("/login")
@ApiOperation("登录接口 telephone password")
@ApiOperation("登录接口 accountName password")
public ResponseVO login(@RequestBody AdministerDO administerDO){
return ResponseData.generateCreatedResponse(0,administerService.login(administerDO));
}
......@@ -47,34 +55,105 @@ public class AdministerController {
}
@PostMapping("/administers")
@ApiOperation("运营者/企业查询 {pageNum pageSize accountType 0:运营者管理 1:企业管理}")
@ApiOperation("查询所有运营者 { userName pageNum pageSize }")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO operators(@RequestBody OperatorsDTO operatorsDTO){
return ResponseData.generateCreatedResponse(0,administerService.operators(operatorsDTO));
}
@PostMapping("addAdminister")
@ApiOperation("添加运营者/企业 {telephone:账号 userName:成员名称/企业名称 shortName 简称 banner:标语 field:领域 accountType:账号类型}")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO addOperator(@RequestBody AdministerDO administerDO){
return ResponseData.generateCreatedResponse(0,administerService.addOperator(administerDO));
@ApiOperation("添加运营者 id userName 名称 accountName 账号 ")
public ResponseVO addAdminister(@RequestBody AdministerDO administerDO){
return ResponseData.generateCreatedResponse(0,administerService.addAdminister(administerDO));
}
@PostMapping("deleteAdminister")
@ApiOperation("删除运营者/企业 id")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO deleteAdminister(AdministerDO administerDO){
@ApiOperation("添加运营者 id ")
public ResponseVO deleteAdminister(@RequestBody AdministerDO administerDO){
return ResponseData.generateCreatedResponse(0,administerService.deleteAdminister(administerDO));
}
@PostMapping("updateAdminister")
@ApiOperation("修改运营者,企业 id userName:成员名称/企业名称 shortName 简称 banner:标语 field:领域")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO updateAdminister(AdministerDO administerDO){
@ApiOperation("编辑运营者 id userName 名称 accountName 账号 password")
public ResponseVO updateAdminister(@RequestBody AdministerDO administerDO){
return ResponseData.generateCreatedResponse(0,administerService.updateAdminister(administerDO));
}
@PostMapping("classSummary")
@ApiOperation("课程汇总 id 班级id ")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO classSummary(@RequestBody ClassDetailDTO classDetailDTO){
return ResponseData.generateCreatedResponse(0,administerService.classSummary(classDetailDTO));
}
@PostMapping("classDetail")
@ApiOperation("班级管理--班级成员 id 班级id userName")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO classDetail(@RequestBody ClassDetailDTO classDetailDTO){
return ResponseData.generateCreatedResponse(0,administerService.classDetail(classDetailDTO));
}
@PostMapping("exportClassDetail")
@ApiOperation("班级管理--班级成员--导出 id 班级id userName")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public void exportClassDetail(@RequestBody ClassDetailDTO classDetailDTO){
List<ClassDetailVO> classDetailVOS = administerService.exportClassDetail(classDetailDTO);
ExcelUtil.writeExcel(classDetailVOS,ClassDetailVO.class);
}
@PostMapping("signDetail")
@ApiOperation("班级管理--注册签到 id 班级id userName")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO signDetail(@RequestBody ClassDetailDTO classDetailDTO){
return ResponseData.generateCreatedResponse(0,administerService.signDetail(classDetailDTO));
}
@PostMapping("exportSignDetail")
@ApiOperation("班级管理--注册签到 id 班级id userName")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public void exportSignDetail(@RequestBody ClassDetailDTO classDetailDTO){
List<ClassSignVO> classSignVOS = administerService.exportSignDetail(classDetailDTO);
ExcelUtil.writeExcel(classSignVOS, ClassSignVO.class);
}
@PostMapping("exerciseTest")
@ApiOperation("班级管理--测评成绩 id 班级id userName")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO exerciseTest(@RequestBody ClassDetailDTO classDetailDTO){
return ResponseData.generateCreatedResponse(0,administerService.exerciseTest(classDetailDTO));
}
@PostMapping("exportExerciseTest")
@ApiOperation("班级管理--测评成绩 id 班级id userName")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public void exportExerciseTest(@RequestBody ClassDetailDTO classDetailDTO){
List<ExerciseTestVO> exerciseTestVOS =administerService.exportExerciseTest(classDetailDTO);
ExcelUtil.writeExcel(exerciseTestVOS,ExerciseTestVO.class);
}
@PostMapping("answerRecord")
@ApiOperation("班级管理--答疑 id 班级id userName")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO answerRecord(@RequestBody ClassDetailDTO classDetailDTO){
return ResponseData.generateCreatedResponse(0,administerService.answerRecord(classDetailDTO));
}
@PostMapping("exportAnswerRecord")
@ApiOperation("班级管理--答疑 id 班级id userName")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public void exportAnswerRecord(@RequestBody ClassDetailDTO classDetailDTO){
List<AnswerRecordVO> answerRecordVOS = administerService.exportAnswerRecord(classDetailDTO);
ExcelUtil.writeExcel(answerRecordVOS,AnswerRecordVO.class);
}
@PostMapping("exportZip")
@ApiOperation("下载压缩包 id 班级id")
@CrossOrigin
//@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public void exportZip(@RequestBody ClassDetailDTO classDetailDTO)throws Exception{
administerService.export(classDetailDTO);
}
}
package com.subsidy.controller;
import com.subsidy.common.ResponseData;
import com.subsidy.common.ResponseVO;
import com.subsidy.dto.GetCourseQuestionDTO;
import com.subsidy.model.AnsweringQuestionDO;
import com.subsidy.service.AnsweringQuestionService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import io.swagger.annotations.Api;
/**
* <p>
* 问题答疑表 前端控制器
* </p>
*
* @author DengMin
* @since 2021-10-14
*/
@RestController
@Api(tags = "问题答疑表")
@RequestMapping("/answeringQuestion")
public class AnsweringQuestionController {
@Autowired
private AnsweringQuestionService answeringQuestionService;
@PostMapping("getCourseQuestion")
@ApiOperation("获取某个课程的答疑 {classId pageSize pageNum memberId}")
public ResponseVO getCourseQuestion(@RequestBody GetCourseQuestionDTO getCourseQuestionDTO){
return ResponseData.generateCreatedResponse(0,answeringQuestionService.getCourseQuestion(getCourseQuestionDTO));
}
@PostMapping("addQuestion")
@ApiOperation("新增答疑 {classId askId title}")
public ResponseVO addQuestion(@RequestBody AnsweringQuestionDO answeringQuestionDO){
return ResponseData.generateCreatedResponse(0,answeringQuestionService.addQuestion(answeringQuestionDO));
}
@PostMapping("deleteQuestion")
@ApiOperation("删除答疑 {id}")
public ResponseVO deleteQuestion(@RequestBody AnsweringQuestionDO answeringQuestionDO){
return ResponseData.generateCreatedResponse(0,answeringQuestionService.deleteQuestion(answeringQuestionDO));
}
@PostMapping("updateQuestion")
@ApiOperation("编辑答疑 {id answerId answer}")
public ResponseVO updateQuestion(@RequestBody AnsweringQuestionDO answeringQuestionDO){
return ResponseData.generateCreatedResponse(0, answeringQuestionService.updateQuestion(answeringQuestionDO));
}
}
......@@ -34,20 +34,20 @@ public class CategoryController {
private CategoryService categoryService;
@PostMapping("getCategories")
@ApiOperation("查询类目 name 类目名称 pageSize pageNum")
@ApiOperation("查询类目 ** name 类目名称 companyId pageSize pageNum")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO getCategories(@RequestBody GetCategoriesDTO getCategoriesDTO){
return ResponseData.generateCreatedResponse(0,categoryService.getCategories(getCategoriesDTO));
}
@PostMapping("getAll")
@ApiOperation("查询所有类目")
public ResponseVO getAll(){
return ResponseData.generateCreatedResponse(0,categoryService.getAll());
@ApiOperation("查询所有类目 **companyId")
public ResponseVO getAll(@RequestBody GetCategoriesDTO getCategoriesDTO){
return ResponseData.generateCreatedResponse(0,categoryService.getAll(getCategoriesDTO));
}
@PostMapping("addCategory")
@ApiOperation("新增类目 name")
@ApiOperation("新增类目 **name companyId")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO addCategory(@RequestBody CategoryDO categoryDO){
return ResponseData.generateCreatedResponse(0,categoryService.addCategory(categoryDO));
......@@ -61,7 +61,7 @@ public class CategoryController {
}
@PostMapping("updateCategory")
@ApiOperation("修改类目 id name")
@ApiOperation("修改类目 ** id name companyId")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO updateCategory(@RequestBody CategoryDO categoryDO){
return ResponseData.generateCreatedResponse(0,categoryService.updateCategory(categoryDO));
......
......@@ -4,7 +4,11 @@ package com.subsidy.controller;
import com.subsidy.common.ResponseData;
import com.subsidy.common.ResponseVO;
import com.subsidy.common.interceptor.LoginRequired;
import com.subsidy.dto.classDict.AddMemberToClassDTO;
import com.subsidy.dto.classDict.GetAllClassesDTO;
import com.subsidy.dto.classDict.GetSpareMembersDTO;
import com.subsidy.model.ClassDictDO;
import com.subsidy.model.ClassMemberMappingDO;
import com.subsidy.service.ClassDictService;
import com.subsidy.util.ConstantUtils;
import io.swagger.annotations.ApiOperation;
......@@ -33,7 +37,7 @@ public class ClassDictController {
private ClassDictService classDictService;
@PostMapping("getAllClasses")
@ApiOperation("获取某企业下的所有课程 companyId")
@ApiOperation("获取某老师下的所有课程 ** companyId 所选企业id className 班级名称")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO getAllClasses(@RequestBody ClassDictDO classDictDO){
return ResponseData.generateCreatedResponse(0,classDictService.getAllClasses(classDictDO));
......@@ -47,17 +51,46 @@ public class ClassDictController {
}
@PostMapping("addClass")
@ApiOperation("添加课程 companyId courseId className startDate endDate")
@ApiOperation("添加课程 ** companyId courseId className startDate endDate")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO addClass(@RequestBody ClassDictDO classDictDO){
return ResponseData.generateCreatedResponse(0,classDictService.addClass(classDictDO));
}
@PostMapping("updateClass")
@ApiOperation("添加课程 id companyId courseId className startDate endDate")
@ApiOperation("修改课程 id ** companyId courseId className startDate endDate")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO updateClass(@RequestBody ClassDictDO classDictDO){
return ResponseData.generateCreatedResponse(0,classDictService.updateClass(classDictDO));
}
@PostMapping("classDetail")
@ApiOperation("获取一个班级详情 id")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO classDetail(@RequestBody ClassDictDO classDictDO){
return ResponseData.generateCreatedResponse(0,classDictService.classDetail(classDictDO));
}
@PostMapping("removeMember")
@ApiOperation("移除班级 classId 班级id memberId人员id")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO removeMember(@RequestBody ClassMemberMappingDO classMemberMappingDO){
return ResponseData.generateCreatedResponse(0,classDictService.removeMember(classMemberMappingDO));
}
@PostMapping("getSpareMembers")
@ApiOperation("获取不在某班级的某企业里所有成员 ** companyId 企业id classId 班级id")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO getSpareMembers(@RequestBody GetSpareMembersDTO getSpareMembersDTO){
return ResponseData.generateCreatedResponse(0,classDictService.getSpareMembers(getSpareMembersDTO));
}
@PostMapping("addMemberToClass")
@ApiOperation("将某个成员加入到某个班级里 classId memberIds []")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO addMemberToClass(@RequestBody AddMemberToClassDTO addMemberToClassDTO){
return ResponseData.generateCreatedResponse(0,classDictService.addMemberToClass(addMemberToClassDTO));
}
}
package com.subsidy.controller;
import com.subsidy.common.ResponseData;
import com.subsidy.common.ResponseVO;
import com.subsidy.common.interceptor.LoginRequired;
import com.subsidy.dto.administer.OperatorsDTO;
import com.subsidy.dto.company.AddCompanyDTO;
import com.subsidy.model.AdministerDO;
import com.subsidy.model.CompanyDictDO;
import com.subsidy.service.CompanyDictService;
import com.subsidy.util.ConstantUtils;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.Api;
/**
* <p>
* 企业字典表 前端控制器
* </p>
*
* @author DengMin
* @since 2021-10-25
*/
@RestController
@Api(tags = "企业字典表")
@RequestMapping("/companyDict")
public class CompanyDictController {
@Autowired
private CompanyDictService companyDictService;
@PostMapping("/administers")
@ApiOperation("查询所有企业 { companyName pageNum pageSize }")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO operators(@RequestBody OperatorsDTO operatorsDTO){
return ResponseData.generateCreatedResponse(0,companyDictService.operators(operatorsDTO));
}
@PostMapping("addCompany")
@ApiOperation("添加企业 {accountName:账号 companyName:企业名称 shortName 简称 banner:标语 field:领域 role 1:超级管理员 2:普通成员}")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO addOperator(@RequestBody AddCompanyDTO addCompanyDTO){
return ResponseData.generateCreatedResponse(0,companyDictService.addOperator(addCompanyDTO));
}
@PostMapping("deleteCompany")
@ApiOperation("删除企业 id")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO deleteAdminister(@RequestBody CompanyDictDO companyDictDO){
return ResponseData.generateCreatedResponse(0,companyDictService.deleteAdminister(companyDictDO));
}
@PostMapping("updateCompany")
@ApiOperation("修改企业 id accountName:账号 companyName:企业名称 shortName 简称 banner:标语 field:领域 role 1:超级管理员 2:普通成员")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO updateAdminister(@RequestBody AddCompanyDTO addCompanyDTO){
return ResponseData.generateCreatedResponse(0,companyDictService.updateAdminister(addCompanyDTO));
}
}
......@@ -40,4 +40,26 @@ public class CourseContentController {
return ResponseData.generateCreatedResponse(0,courseContentService.getContents(courseContentDO));
}
@PostMapping("deleteContent")
@ApiOperation("删除一个目录 {id} ")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO deleteContent(@RequestBody CourseContentDO courseContentDO){
return ResponseData.generateCreatedResponse(0,courseContentService.deleteContent(courseContentDO));
}
@PostMapping("addContent")
@ApiOperation("添加一个目录 {courseId content}")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO addContent(@RequestBody CourseContentDO courseContentDO){
return ResponseData.generateCreatedResponse(0,courseContentService.addContent(courseContentDO));
}
@PostMapping("updateContent")
@ApiOperation("更新一个目录 {id courseId content}")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO updateContent(@RequestBody CourseContentDO courseContentDO){
return ResponseData.generateCreatedResponse(0,courseContentService.updateContent(courseContentDO));
}
}
......@@ -10,11 +10,8 @@ import com.subsidy.service.CourseDictService;
import com.subsidy.util.ConstantUtils;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.Api;
/**
......@@ -34,7 +31,7 @@ public class CourseDictController {
private CourseDictService courseDictService;
@PostMapping("addCourse")
@ApiOperation("添加课程 courseName categoryId courseType courseSource")
@ApiOperation("添加课程 **companyId courseName categoryId courseType courseSource")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO addCourse(@RequestBody CourseDictDO courseDictDO){
return ResponseData.generateCreatedResponse(0,courseDictService.addCourse(courseDictDO));
......@@ -48,21 +45,24 @@ public class CourseDictController {
}
@PostMapping("queryCourses")
@ApiOperation("查询课程 courseName categoryId courseType courseSource")
@ApiOperation("平台运营者--查询课程 pageSize pageNum companyId courseName categoryId courseType courseSource")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO queryCourses(@RequestBody QueryCoursesDTO queryCoursesDTO){
return ResponseData.generateCreatedResponse(0,courseDictService.queryCourses(queryCoursesDTO));
}
@PostMapping("updateCourses")
@ApiOperation("编辑课程 id courseName categoryId courseType courseSource")
@ApiOperation("编辑课程 id ** companyId courseName categoryId courseType courseSource")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO updateCourses(@RequestBody CourseDictDO courseDictDO){
return ResponseData.generateCreatedResponse(0,courseDictService.updateCourses(courseDictDO));
}
@PostMapping("queryCompanyCourse")
@ApiOperation("企业内容管理-- { ** companyId 所选企业id}")
public ResponseVO queryCompanyCourse(@RequestBody QueryCoursesDTO queryCoursesDTO){
return ResponseData.generateCreatedResponse(0,courseDictService.queryCompanyCourse(queryCoursesDTO));
}
}
......@@ -33,14 +33,14 @@ public class DepartmentDictController {
private DepartmentDictService departmentDictService;
@PostMapping("getDepartments")
@ApiOperation("获取所有部门 companyId 企业id")
@ApiOperation("获取所有部门 ** companyId 企业id")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO getDepartments(@RequestBody DepartmentDictDO departmentDictDO){
return ResponseData.generateCreatedResponse(0,departmentDictService.getDepartments(departmentDictDO));
}
@PostMapping("addDepartment")
@ApiOperation("添加部门 companyId departmentName leaderName")
@ApiOperation("添加部门 ** companyId departmentName leaderName")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO addDepartment(@RequestBody DepartmentDictDO departmentDictDO){
return ResponseData.generateCreatedResponse(0,departmentDictService.addDepartment(departmentDictDO));
......@@ -54,7 +54,7 @@ public class DepartmentDictController {
}
@PostMapping("updateDepartment")
@ApiOperation("编辑部门 id companyId departmentName leaderName")
@ApiOperation("编辑部门 id ** companyId departmentName leaderName")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO updateDepartment(@RequestBody DepartmentDictDO departmentDictDO){
return ResponseData.generateCreatedResponse(0,departmentDictService.updateDepartment(departmentDictDO));
......
......@@ -5,16 +5,15 @@ import com.subsidy.common.ResponseData;
import com.subsidy.common.ResponseVO;
import com.subsidy.common.interceptor.LoginRequired;
import com.subsidy.dto.exercise.GetAllExercisesDTO;
import com.subsidy.dto.exercise.SubmitDTO;
import com.subsidy.model.CourseDictDO;
import com.subsidy.model.ExerciseDictDO;
import com.subsidy.service.ExerciseDictService;
import com.subsidy.util.ConstantUtils;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.Api;
/**
......@@ -34,7 +33,7 @@ public class ExerciseDictController {
private ExerciseDictService exerciseDictService;
@PostMapping("getAllExercises")
@ApiOperation("查询所有题目 {courseId 课程id exerciseType 题目类型 difficulty 难度 title题目 pageSize pageNum}")
@ApiOperation("查询所有题目 {courseId 课程id exerciseType 题目类型 difficulty 难度 title 题目 pageSize pageNum}")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO getAllExercises(@RequestBody GetAllExercisesDTO getAllExercisesDTO){
return ResponseData.generateCreatedResponse(0,exerciseDictService.getAllExercises(getAllExercisesDTO));
......@@ -60,4 +59,18 @@ public class ExerciseDictController {
public ResponseVO updateExercise(@RequestBody ExerciseDictDO exerciseDictDO){
return ResponseData.generateCreatedResponse(0,exerciseDictService.updateExercise(exerciseDictDO));
}
@PostMapping("getCourseExercises")
@ApiOperation("获取课程的习题 id 课程id")
public ResponseVO getCourseExercises(@RequestBody CourseDictDO courseDictDO){
return ResponseData.generateCreatedResponse(0,exerciseDictService.getCourseExercises(courseDictDO));
}
@PostMapping("submit")
@ApiOperation("提交答案 {memberId 成员id classId课程 courseId 课程id memberExerciseVOS [ id selectAnswer ]} ")
public ResponseVO submit(@RequestBody SubmitDTO submitDTO){
return ResponseData.generateCreatedResponse(0,exerciseDictService.submit(submitDTO));
}
}
package com.subsidy.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.Api;
/**
* <p>
* 学生课程习题完成情况 前端控制器
* </p>
*
* @author DengMin
* @since 2021-10-15
*/
@RestController
@Api(tags = "学生课程习题完成情况")
@RequestMapping("/exerciseDoneResult")
public class ExerciseDoneResultController {
}
......@@ -34,7 +34,7 @@ public class FileDictController {
private FileDictService fileDictService;
@PostMapping("getContendFiles")
@ApiOperation("获取目录下的视频 {contentId vodName}")
@ApiOperation("获取目录下的视频 {contentId fileName}")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO getContendFiles(@RequestBody FileDictDO fileDictDO){
return ResponseData.generateCreatedResponse(0,fileDictService.getContendFiles(fileDictDO));
......@@ -48,14 +48,14 @@ public class FileDictController {
}
@PostMapping("addFile")
@ApiOperation("新增视频 contentId vodName vodLength vodType vodSize vodUrl vodCode")
@ApiOperation("新增视频 contentId fileName fileSize fileType fileUrl")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO addFile(@RequestBody FileDictDO fileDictDO){
return ResponseData.generateCreatedResponse(0,fileDictService.addFile(fileDictDO));
}
@PostMapping("updateFile")
@ApiOperation("新增视频 id contentId vodName vodLength vodType vodSize vodUrl vodCode")
@ApiOperation("新增视频 id contentId fileName fileSize fileType fileUrl")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO updateFile(@RequestBody FileDictDO fileDictDO){
return ResponseData.generateCreatedResponse(0,fileDictService.updateFile(fileDictDO));
......
......@@ -4,10 +4,14 @@ package com.subsidy.controller;
import com.subsidy.common.ResponseData;
import com.subsidy.common.ResponseVO;
import com.subsidy.common.interceptor.LoginRequired;
import com.subsidy.dto.administer.VerifyCodeDTO;
import com.subsidy.dto.member.ContentMemberDTO;
import com.subsidy.dto.member.GetAllDTO;
import com.subsidy.dto.member.StudyHistoryDTO;
import com.subsidy.model.MemberDO;
import com.subsidy.service.MemberService;
import com.subsidy.util.ConstantUtils;
import com.subsidy.vo.member.ContentVodVO;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
......@@ -34,7 +38,7 @@ public class MemberController {
private MemberService memberService;
@PostMapping("getAll")
@ApiOperation("查询某部门成员 pageNum pageSize userName status")
@ApiOperation("查询某部门成员 pageNum pageSize departmentId userName status")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO getAll(@RequestBody GetAllDTO getAllDTO){
return ResponseData.generateCreatedResponse(0,memberService.getAll(getAllDTO));
......@@ -55,11 +59,65 @@ public class MemberController {
}
@PostMapping("updateMember")
@ApiOperation("编辑成员 {id departmentId userName accountName telephone gender image idCard}")
@ApiOperation("编辑成员 {id departmentId userName accountName telephone gender image idCard status}")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO updateMember(@RequestBody MemberDO memberDO){
return ResponseData.generateCreatedResponse(0,memberService.updateMember(memberDO));
}
@PostMapping(value = "/login")
@ApiOperation("手机端:登录:telephone/手机号, verifyCode/验证码")
public ResponseVO login(@RequestBody VerifyCodeDTO verifyCodeDTO) {
return ResponseData.generateCreatedResponse(0, memberService.login(verifyCodeDTO));
}
@PostMapping("passwordLogin")
@ApiOperation("手机端:密码登录 {accountName password}")
public ResponseVO passwordLogin(@RequestBody MemberDO memberDO){
return ResponseData.generateCreatedResponse(0,memberService.passwordLogin(memberDO));
}
@PostMapping("updatePassword")
@ApiOperation("修改密码 {id password}")
public ResponseVO updatePassword(@RequestBody MemberDO memberDO){
return ResponseData.generateCreatedResponse(0,memberService.updatePassword(memberDO));
}
@PostMapping("studyPage")
@ApiOperation("手机端:学习主页 id 学员id")
public ResponseVO studyPage(@RequestBody MemberDO memberDO){
return ResponseData.generateCreatedResponse(0,memberService.studyPage(memberDO));
}
@PostMapping("contentVod")
@ApiOperation("手机端:目录+视频 courseId 课程 memberId 学员id")
public ResponseVO contentVod(@RequestBody ContentMemberDTO contentVodDTO){
return ResponseData.generateCreatedResponse(0,memberService.contentVod(contentVodDTO));
}
@PostMapping("contentFiles")
@ApiOperation("手机端:目录+课件 courseId 课程 memberId 学员id")
public ResponseVO contentFiles(@RequestBody ContentMemberDTO contentMemberDTO){
return ResponseData.generateCreatedResponse(0,memberService.contentFiles(contentMemberDTO));
}
@PostMapping("studyHistory")
@ApiOperation("学习记录 id 成员id pageSize pageNum")
public ResponseVO studyHistory(@RequestBody StudyHistoryDTO studyHistoryDTO){
return ResponseData.generateCreatedResponse(0,memberService.studyHistory(studyHistoryDTO));
}
@PostMapping("getCourseTest")
@ApiOperation("获取课程下的测试情况 {memberId courseId}")
public ResponseVO getCourseTest(@RequestBody ContentMemberDTO contentMemberDTO){
return ResponseData.generateCreatedResponse(0,memberService.getCourseTest(contentMemberDTO));
}
@PostMapping("getStudyInfo")
@ApiOperation("获取学生完成课程情况 id 学员id")
public ResponseVO getStudyInfo(@RequestBody MemberDO memberDO){
return ResponseData.generateCreatedResponse(0,memberService.getStudyInfo(memberDO));
}
}
package com.subsidy.controller;
import com.subsidy.common.ResponseData;
import com.subsidy.common.ResponseVO;
import com.subsidy.common.interceptor.LoginRequired;
import com.subsidy.dto.member.GetMemberSignInfoDTO;
import com.subsidy.dto.sign.ClassSignInfoDTO;
import com.subsidy.dto.sign.SignInDTO;
import com.subsidy.model.MemberDO;
import com.subsidy.model.SignInRecordDO;
import com.subsidy.service.SignInRecordService;
import com.subsidy.util.ConstantUtils;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.Api;
/**
* <p>
* 学生签到表 前端控制器
* </p>
*
* @author DengMin
* @since 2021-10-18
*/
@RestController
@Api(tags = "学生签到表")
@RequestMapping("/signIn")
public class SignInRecordController {
@Autowired
private SignInRecordService signInRecordService;
@PostMapping("getMemberSignInfo")
@ApiOperation("获取某个成员的签到记录 id 成员id pageSize pageNum")
public ResponseVO getMemberSignInfo(@RequestBody GetMemberSignInfoDTO getMemberSignInfoDTO){
return ResponseData.generateCreatedResponse(0,signInRecordService.getMemberSignInfo(getMemberSignInfoDTO));
}
@PostMapping("signIn")
@ApiOperation("签到 classId :班级id memberId")
public ResponseVO signIn(@RequestBody SignInRecordDO signInRecordDO){
return ResponseData.generateCreatedResponse(0,signInRecordService.signIn(signInRecordDO));
}
@PostMapping("classStudyHistory")
@ApiOperation("班级学习记录 ** id 班级id className courseName pageSize pageNum")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO classSignInfo(@RequestBody ClassSignInfoDTO classSignInfoDTO){
return ResponseData.generateCreatedResponse(0,signInRecordService.classSignInfo(classSignInfoDTO));
}
}
package com.subsidy.controller;
import com.subsidy.common.ResponseData;
import com.subsidy.common.ResponseVO;
import com.subsidy.dto.sms.SendVerifyCodeDTO;
import com.subsidy.service.SmsVerifyCodeService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.Api;
/**
* <p>
* 短信验证码记录表 前端控制器
* </p>
*
* @author DengMin
* @since 2021-10-14
*/
@RestController
@Api(tags = "短信验证码记录表")
@RequestMapping("/smsVerify")
public class SmsVerifyCodeController {
@Autowired
private SmsVerifyCodeService smsVerifyCodeService;
@PostMapping(value = "/send")
@ApiOperation("发送短信验证码 {telephone} ")
public ResponseVO sendVerifyCode(@RequestBody SendVerifyCodeDTO sendVerifyCodeDTO ) {
smsVerifyCodeService.sendVerifyCode(sendVerifyCodeDTO);
return ResponseData.generateCreatedResponse(0);
}
}
......@@ -4,6 +4,7 @@ package com.subsidy.controller;
import com.subsidy.common.ResponseData;
import com.subsidy.common.ResponseVO;
import com.subsidy.common.interceptor.LoginRequired;
import com.subsidy.dto.content.GetContendVodsDTO;
import com.subsidy.model.VodDictDO;
import com.subsidy.service.VodDictService;
import com.subsidy.util.ConstantUtils;
......@@ -41,8 +42,8 @@ public class VodDictController {
@PostMapping("getContendVods")
@ApiOperation("获取目录下的视频 {contentId vodName}")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO getContendVods(@RequestBody VodDictDO vodDictDO){
return ResponseData.generateCreatedResponse(0,vodDictService.getContendVods(vodDictDO));
public ResponseVO getContendVods(@RequestBody GetContendVodsDTO getContendVodsDTO){
return ResponseData.generateCreatedResponse(0,vodDictService.getContendVods(getContendVodsDTO));
}
@PostMapping("deleteVod")
......
package com.subsidy.controller;
import com.subsidy.common.ResponseData;
import com.subsidy.common.ResponseVO;
import com.subsidy.model.VodPlayHistoryDO;
import com.subsidy.service.VodPlayHistoryService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.Api;
/**
* <p>
* 视频播放历史记录表 前端控制器
* </p>
*
* @author DengMin
* @since 2021-10-14
*/
@RestController
@Api(tags = "视频播放历史记录表")
@RequestMapping("/vodPlayHistory")
public class VodPlayHistoryController {
@Autowired
private VodPlayHistoryService vodPlayHistoryService;
@PostMapping("insertHistory")
@ApiOperation("记录学生看视频位置 classId班级id vodId 视频id memberId 成员id playLength 播放时长 playRecord 位点")
public ResponseVO insertHistory(@RequestBody VodPlayHistoryDO vodPlayHistoryDO){
return ResponseData.generateCreatedResponse(0,vodPlayHistoryService.insertHistory(vodPlayHistoryDO));
}
}
package com.subsidy.dto;
import lombok.Data;
@Data
public class GetCourseQuestionDTO {
private Integer pageSize;
private Integer pageNum;
private Long classId;
private Long memberId;
}
package com.subsidy.dto.administer;
import lombok.Data;
@Data
public class ClassDetailDTO {
private Long id;
private Integer pageSize;
private Integer pageNum;
private String userName;
}
......@@ -9,6 +9,10 @@ public class OperatorsDTO {
private Integer pageNum;
private String accountType;
private Integer role;
private String companyName;
private String userName;
}
package com.subsidy.dto.administer;
import lombok.Data;
@Data
public class VerifyCodeDTO {
private String telephone;
private String verifyCode;
}
......@@ -11,4 +11,6 @@ public class GetCategoriesDTO {
private String name;
private Long companyId;
}
package com.subsidy.dto.classDict;
import lombok.Data;
import java.util.List;
@Data
public class AddMemberToClassDTO {
private List<Long> memberIds;
private Long classId;
}
package com.subsidy.dto.classDict;
import lombok.Data;
import java.util.List;
@Data
public class GetAllClassesDTO {
private Long administerId;
private String className;
private Long companyId;
private List<Long> teacherIds;
}
package com.subsidy.dto.classDict;
import lombok.Data;
@Data
public class GetSpareMembersDTO {
private Long companyId;
private Long classId;
}
package com.subsidy.dto.company;
import com.subsidy.model.CompanyDictDO;
import lombok.Data;
@Data
public class AddCompanyDTO extends CompanyDictDO {
private String accountName;
//private String accountType;
private String password;
private Integer role;
}
package com.subsidy.dto.content;
import lombok.Data;
@Data
public class GetContendVodsDTO {
private Integer pageSize;
private Integer pageNum;
private Long contentId;
private String vodName;
}
......@@ -2,6 +2,8 @@ package com.subsidy.dto.course;
import lombok.Data;
import java.util.List;
@Data
public class QueryCoursesDTO {
......@@ -17,4 +19,10 @@ public class QueryCoursesDTO {
private String courseSource;
//private Long administerId;
private Long companyId;
private List<Long> teacherIds;
}
......@@ -10,4 +10,6 @@ public class GetAllExercisesDTO extends ExerciseDictDO {
private Integer pageNum;
}
package com.subsidy.dto.exercise;
import com.subsidy.vo.exercise.MemberExerciseVO;
import lombok.Data;
import java.util.List;
@Data
public class SubmitDTO {
private List<MemberExerciseVO> memberExerciseVOS;
private Long memberId;
private Long courseId;
private Long classId;
}
package com.subsidy.dto.member;
import lombok.Data;
@Data
public class ContentMemberDTO {
private Integer memberId;
private Integer courseId;
}
package com.subsidy.dto.member;
import lombok.Data;
@Data
public class GetMemberSignInfoDTO {
private Integer pageSize;
private Integer pageNum;
private Long id;
}
package com.subsidy.dto.member;
import lombok.Data;
@Data
public class StudyHistoryDTO {
private Integer pageSize;
private Integer pageNum;
private Long memberId;
}
package com.subsidy.dto.sign;
import lombok.Data;
@Data
public class ClassSignInfoDTO {
private String className;
private String courseName;
private Integer pageSize;
private Integer pageNum;
private Integer id;
}
package com.subsidy.dto.sign;
import lombok.Data;
@Data
public class SignInDTO {
private Long memberId;
private Long courseId;
}
package com.subsidy.dto.sms;
import lombok.Data;
@Data
public class SendVerifyCodeDTO {
private String telephone;
}
......@@ -4,8 +4,12 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.subsidy.dto.administer.OperatorsDTO;
import com.subsidy.model.AdministerDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.subsidy.vo.administer.ExerciseTestVO;
import com.subsidy.vo.administer.OperatorsVO;
import com.subsidy.vo.administer.PermissionsVO;
import com.subsidy.vo.classdict.ClassDetailVO;
import com.subsidy.vo.member.ClassSignVO;
import com.subsidy.vo.sign.AnswerRecordVO;
import org.springframework.stereotype.Repository;
import java.util.List;
......@@ -23,6 +27,25 @@ public interface AdministerMapper extends BaseMapper<AdministerDO> {
List<PermissionsVO> getPermissions(Long id);
IPage<OperatorsVO> operators(IPage page,String accountType);
/**
* 获取班级成员详情---班级成员
*/
IPage<ClassDetailVO> classMembers(IPage iPage,Long classId,String userName);
/**
* 获取班级成员---注册签到
*/
IPage<ClassSignVO> classSign(IPage iPage,Long classId,String userName);
/**
* 获取班级成员---测试成绩
*/
IPage<ExerciseTestVO> exerciseTest(IPage iPage, Long classId, String userName);
/**
* 获取班级成员---答疑记录
*/
IPage<AnswerRecordVO> answerRecord(IPage iPage, Long classId, String userName);
}
package com.subsidy.mapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.subsidy.model.AnsweringQuestionDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.subsidy.vo.answer.GetCourseQuestionVO;
import com.subsidy.vo.vod.GetContendVodsVO;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* <p>
* 问题答疑表 Mapper 接口
* </p>
*
* @author DengMin
* @since 2021-10-14
*/
@Repository
public interface AnsweringQuestionMapper extends BaseMapper<AnsweringQuestionDO> {
/**
* 获取某个课程的答疑
*/
IPage<GetCourseQuestionVO> getCourseQuestion(IPage page, Long classId,Long memberId);
}
package com.subsidy.mapper;
import com.subsidy.dto.classDict.GetAllClassesDTO;
import com.subsidy.dto.classDict.GetSpareMembersDTO;
import com.subsidy.model.ClassDictDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.subsidy.model.MemberDO;
import com.subsidy.model.VodDictDO;
import com.subsidy.vo.classdict.GetAllClassesVO;
import org.springframework.stereotype.Repository;
......@@ -15,9 +19,24 @@ import java.util.List;
* @author DengMin
* @since 2021-10-12
*/
@Repository
@Repository
public interface ClassDictMapper extends BaseMapper<ClassDictDO> {
List<GetAllClassesVO> getAllClasses(ClassDictDO classDictDO);
/**
* 获取某企业的全部班级
*/
List<GetAllClassesVO> getAllClasses(ClassDictDO classDictDO);
/**
* 获取某班级下的全部视频
*/
List<VodDictDO> getClassVods(Long classId);
/**
* 查看某企业里,不在某班级的成员
* @return
*/
List<MemberDO> getSpareMembers(GetSpareMembersDTO getSpareMembersDTO);
}
package com.subsidy.mapper;
import com.subsidy.dto.classDict.GetSpareMembersDTO;
import com.subsidy.model.ClassMemberMappingDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.subsidy.model.MemberDO;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* <p>
* 班级成员映射表 Mapper 接口
......@@ -12,7 +16,8 @@ import org.springframework.stereotype.Repository;
* @author DengMin
* @since 2021-10-12
*/
@Repository
@Repository
public interface ClassMemberMappingMapper extends BaseMapper<ClassMemberMappingDO> {
}
package com.subsidy.mapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.subsidy.model.AdministerDO;
import com.subsidy.model.CompanyDictDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.subsidy.vo.administer.OperatorsVO;
import org.springframework.stereotype.Repository;
/**
* <p>
* 企业字典表 Mapper 接口
* </p>
*
* @author DengMin
* @since 2021-10-25
*/
@Repository
public interface CompanyDictMapper extends BaseMapper<CompanyDictDO> {
/**
* 查找运营者
*
* @return
*/
IPage<OperatorsVO> operators(IPage page, String companyName, String userName,Integer role);
/**
* 通过企业id查找企业的管理员
*/
AdministerDO getAdministerByCompanyId(Long companyId);
}
......@@ -2,8 +2,12 @@ package com.subsidy.mapper;
import com.subsidy.model.CourseContentDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.subsidy.model.CourseDictDO;
import com.subsidy.model.VodDictDO;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* <p>
* 课程目录表 Mapper 接口
......@@ -12,7 +16,12 @@ import org.springframework.stereotype.Repository;
* @author DengMin
* @since 2021-10-11
*/
@Repository
@Repository
public interface CourseContentMapper extends BaseMapper<CourseContentDO> {
/**
* 查看课程下有多少个视频
*/
List<VodDictDO> getCourseVods(Integer courseId);
}
package com.subsidy.mapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.subsidy.model.ClassMemberMappingDO;
import com.subsidy.model.CourseDictDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.subsidy.model.MemberDO;
import com.subsidy.vo.course.QueryCoursesVO;
import com.subsidy.vo.member.StudyPageVO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
......@@ -18,6 +23,26 @@ import java.util.List;
@Repository
public interface CourseDictMapper extends BaseMapper<CourseDictDO> {
IPage<CourseDictDO> queryCourses(IPage page,String courseName,Long categoryId,String courseType,String courseSource);
/**
* 查询全部课程
* @return
*/
IPage<QueryCoursesVO > queryCourses(IPage page, String courseName, Long categoryId, String courseType, String courseSource,Long companyId);
/**
* 通过课程id查询课程下的学生-----弃用
*/
List<ClassMemberMappingDO > queryCourseMember(StudyPageVO studyPageVO);
/**
* 查询全部公共课程
* @return
*/
IPage<QueryCoursesVO > queryPublicCourses(IPage page, String courseName, Long categoryId, String courseType, String courseSource);
/**
* 查询企业内部课程
*/
IPage<QueryCoursesVO> queryCompanyCourse(IPage page, String courseName, Long categoryId, String courseType, String courseSource,Long companyId);
}
package com.subsidy.mapper;
import com.subsidy.model.ExerciseDoneResultDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
/**
* <p>
* 学生课程习题完成情况 Mapper 接口
* </p>
*
* @author DengMin
* @since 2021-10-15
*/
@Repository
public interface ExerciseDoneResultMapper extends BaseMapper<ExerciseDoneResultDO> {
}
......@@ -2,8 +2,11 @@ package com.subsidy.mapper;
import com.subsidy.model.MemberDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.subsidy.vo.member.StudyPageVO;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* <p>
* 学生表 Mapper 接口
......@@ -12,7 +15,12 @@ import org.springframework.stereotype.Repository;
* @author DengMin
* @since 2021-10-11
*/
@Repository
@Repository
public interface MemberMapper extends BaseMapper<MemberDO> {
/**
* 查看学生的课程
*/
List<StudyPageVO> studyPage(MemberDO memberDO);
}
package com.subsidy.mapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.subsidy.dto.sign.ClassSignInfoDTO;
import com.subsidy.model.SignInRecordDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.subsidy.vo.sign.ClassSignInfoVO;
import org.springframework.stereotype.Repository;
/**
* <p>
* 学生签到表 Mapper 接口
* </p>
*
* @author DengMin
* @since 2021-10-18
*/
@Repository
public interface SignInRecordMapper extends BaseMapper<SignInRecordDO> {
IPage<ClassSignInfoVO> classSignInfo(IPage iPage,String className,String courseName,Integer id);
}
package com.subsidy.mapper;
import com.subsidy.model.SmsVerifyCodeDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
/**
* <p>
* 短信验证码记录表 Mapper 接口
* </p>
*
* @author DengMin
* @since 2021-10-14
*/
@Repository
public interface SmsVerifyCodeMapper extends BaseMapper<SmsVerifyCodeDO> {
}
package com.subsidy.mapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.subsidy.model.VodDictDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.subsidy.vo.vod.GetContendVodsVO;
......@@ -18,5 +19,12 @@ import java.util.List;
@Repository
public interface VodDictMapper extends BaseMapper<VodDictDO> {
List<GetContendVodsVO> getContendVods(VodDictDO vodDictDO);
/**
* 查看某个目录下的视频
* @param page
* @param vodName
* @param contentId
* @return
*/
IPage<GetContendVodsVO> getContendVods(IPage page,String vodName,Long contentId);
}
package com.subsidy.mapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.subsidy.model.VodPlayHistoryDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.subsidy.vo.vod.StudyHistoryVO;
import org.springframework.stereotype.Repository;
/**
* <p>
* 视频播放历史记录表 Mapper 接口
* </p>
*
* @author DengMin
* @since 2021-10-14
*/
@Repository
public interface VodPlayHistoryMapper extends BaseMapper<VodPlayHistoryDO> {
/**
* 查看某成员的学习历史
*/
IPage<StudyHistoryVO> studyHistory(IPage iPage,Long memberId);
}
......@@ -29,6 +29,16 @@ public class AdministerDO extends BaseModel {
private Long id;
/**
* 公司名称
*/
private Long companyId;
/**
* 账号
*/
private String accountName;
/**
* 手机号/企业账号
*/
private String telephone;
......@@ -39,39 +49,29 @@ public class AdministerDO extends BaseModel {
private String password;
/**
* 成员名称/企业名称
* 成员名称
*/
private String userName;
/**
* 简称
*/
private String shortName;
/**
* 头像
*/
private String img;
/**
* 标语
*/
private String banner;
/**
* 1:启用 0:禁用
*/
private String status;
/**
* 领域
*/
private String field;
///**
// * 0:运营者账号 1:企业账号
// */
//private String accountType;
/**
* 账户类型
* role 0:平台运营者 1:超级管理员 2:普通成员
*/
private String accountType;
private Integer role;
}
package com.subsidy.model;
import com.subsidy.util.BaseModel;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* <p>
* 问题答疑表
* </p>
*
* @author DengMin
* @since 2021-10-14
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("answering_question")
public class AnsweringQuestionDO extends BaseModel {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
* 班级id
*/
private Long classId;
/**
* 提问id
*/
private Long askId;
/**
* 回答人id
*/
private Long answerId;
/**
* 问题
*/
private String title;
/**
* 答案
*/
private String answer;
}
......@@ -26,6 +26,11 @@ public class CategoryDO extends BaseModel {
private Long id;
/**
* 企业id
*/
private Long companyId;
/**
* 类目名称
*/
private String name;
......
......@@ -4,7 +4,9 @@ import com.subsidy.util.BaseModel;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import lombok.Data;
import lombok.EqualsAndHashCode;
......@@ -27,7 +29,7 @@ public class ClassDictDO extends BaseModel {
private Long id;
/**
* 企业id
* 老师id
*/
private Long companyId;
......@@ -41,9 +43,9 @@ public class ClassDictDO extends BaseModel {
*/
private Long courseId;
private LocalDateTime startDate;
private String startDate;
private LocalDateTime endDate;
private String endDate;
}
package com.subsidy.model;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.subsidy.util.BaseModel;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
......@@ -20,6 +22,7 @@ public class ClassMemberMappingDO extends BaseModel {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
......
package com.subsidy.model;
import com.subsidy.util.BaseModel;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* <p>
* 企业字典表
* </p>
*
* @author DengMin
* @since 2021-10-25
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("company_dict")
public class CompanyDictDO extends BaseModel {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
* 企业logo
*/
private String logo;
/**
* 公司名称
*/
private String companyName;
/**
* 简称
*/
private String shortName;
/**
* 标语
*/
private String banner;
/**
* 领域
*/
private String field;
}
package com.subsidy.model;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.subsidy.util.BaseModel;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
......@@ -20,6 +22,7 @@ public class CourseContentDO extends BaseModel {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Long id;
private Long courseId;
......
......@@ -7,6 +7,9 @@ import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.time.LocalDateTime;
import java.util.Date;
/**
* <p>
*
......@@ -26,6 +29,11 @@ public class CourseDictDO extends BaseModel {
private Long id;
/**
*
*/
private Long companyId;
/**
* 课程名称
*/
private String courseName;
......@@ -45,5 +53,9 @@ public class CourseDictDO extends BaseModel {
*/
private String courseSource;
/**
* 习题截止时间
*/
private LocalDateTime deadline;
}
......@@ -17,7 +17,7 @@ import lombok.EqualsAndHashCode;
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("departmentDict")
@TableName("department_dict")
public class DepartmentDictDO extends BaseModel {
private static final long serialVersionUID = 1L;
......
package com.subsidy.model;
import com.subsidy.util.BaseModel;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* <p>
* 学生课程习题完成情况
* </p>
*
* @author DengMin
* @since 2021-10-15
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("exercise_done_result")
public class ExerciseDoneResultDO extends BaseModel {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
* 成员id
*/
private Long memberId;
/**
* 班级id
*/
private Long classId;
/**
* 课程id
*/
private Long courseId;
/**
* 正确个数
*/
private Integer rightCounts;
/**
* 总共个数
*/
private Integer totalCounts;
}
......@@ -40,6 +40,10 @@ public class FileDictDO extends BaseModel {
*/
private String fileSize;
private String fileType;
private String fileUrl;
/**
* 排序
*/
......
package com.subsidy.model;
import com.subsidy.util.BaseModel;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* <p>
* 学生签到表
* </p>
*
* @author DengMin
* @since 2021-10-18
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("sign_in_record")
public class SignInRecordDO extends BaseModel {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
* 学生id
*/
private Integer studentId;
/**
* 班级id
*/
private Integer classId;
/**
* 签到时间
*/
private LocalDateTime signInDate;
}
package com.subsidy.model;
import com.subsidy.util.BaseModel;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* <p>
* 短信验证码记录表
* </p>
*
* @author DengMin
* @since 2021-10-14
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("sms_verify_code")
public class SmsVerifyCodeDO extends BaseModel {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
/**
* 手机号
*/
private String telephone;
/**
* 验证码
*/
private String verifyCode;
}
......@@ -60,5 +60,14 @@ public class VodDictDO extends BaseModel {
*/
private String vodCode;
/**
* 讲师名称
*/
private String teacherName;
/**
* 封面
*/
private String coverPage;
}
package com.subsidy.model;
import com.subsidy.util.BaseModel;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* <p>
* 视频播放历史记录表
* </p>
*
* @author DengMin
* @since 2021-10-14
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("vod_play_history")
public class VodPlayHistoryDO extends BaseModel {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
* 班级id
*/
private Long classId;
/**
* 视频id
*/
private Long vodId;
/**
* 学生id
*/
private Long memberId;
/**
* 观看时长
*/
private Integer playLength;
/**
* 播放视频位置
*/
private Integer playRecord;
}
package com.subsidy.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.subsidy.dto.administer.ClassDetailDTO;
import com.subsidy.dto.administer.OperatorsDTO;
import com.subsidy.model.AdministerDO;
import com.baomidou.mybatisplus.extension.service.IService;
import com.subsidy.vo.administer.AdministerPermissionVO;
import com.subsidy.vo.administer.LoginVO;
import com.subsidy.vo.administer.OperatorsVO;
import com.subsidy.model.ClassDictDO;
import com.subsidy.vo.administer.*;
import com.subsidy.vo.classdict.ClassDetailVO;
import com.subsidy.vo.member.ClassSignVO;
import com.subsidy.vo.sign.AnswerRecordVO;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
......@@ -26,10 +30,30 @@ public interface AdministerService extends IService<AdministerDO> {
IPage<OperatorsVO> operators(OperatorsDTO operatorsDTO);
String addOperator(AdministerDO administerDO);
String addAdminister(AdministerDO administerDO);
String deleteAdminister(AdministerDO administerDO);
String updateAdminister(AdministerDO administerDO);
ClassSummaryVO classSummary(ClassDetailDTO classDetailDTO);
IPage classDetail(ClassDetailDTO classDetailDTO);
List<ClassDetailVO> exportClassDetail(ClassDetailDTO classDetailDTO);
IPage signDetail(ClassDetailDTO classDetailDTO);
List<ClassSignVO> exportSignDetail(ClassDetailDTO classDetailDTO);
IPage exerciseTest(ClassDetailDTO classDetailDTO);
List<ExerciseTestVO> exportExerciseTest(ClassDetailDTO classDetailDTO);
IPage answerRecord(ClassDetailDTO classDetailDTO);
List<AnswerRecordVO> exportAnswerRecord(ClassDetailDTO classDetailDTO);
void export(ClassDetailDTO classDetailDTO)throws Exception;
}
package com.subsidy.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.subsidy.dto.GetCourseQuestionDTO;
import com.subsidy.model.AnsweringQuestionDO;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 问题答疑表 服务类
* </p>
*
* @author DengMin
* @since 2021-10-14
*/
public interface AnsweringQuestionService extends IService<AnsweringQuestionDO> {
IPage getCourseQuestion(GetCourseQuestionDTO getCourseQuestionDTO);
String addQuestion(AnsweringQuestionDO answeringQuestionDO);
String deleteQuestion(AnsweringQuestionDO answeringQuestionDO);
String updateQuestion(AnsweringQuestionDO answeringQuestionDO);
}
......@@ -19,7 +19,7 @@ public interface CategoryService extends IService<CategoryDO> {
IPage<CategoryDO> getCategories(GetCategoriesDTO getCategoriesDTO);
List<CategoryDO> getAll();
List<CategoryDO> getAll(GetCategoriesDTO getCategoriesDTO);
String addCategory(CategoryDO categoryDO);
......
package com.subsidy.service;
import com.subsidy.dto.classDict.AddMemberToClassDTO;
import com.subsidy.dto.classDict.GetAllClassesDTO;
import com.subsidy.dto.classDict.GetSpareMembersDTO;
import com.subsidy.model.ClassDictDO;
import com.baomidou.mybatisplus.extension.service.IService;
import com.subsidy.model.ClassMemberMappingDO;
import com.subsidy.model.MemberDO;
import com.subsidy.vo.classdict.GetAllClassesVO;
import java.util.List;
......@@ -24,4 +29,12 @@ public interface ClassDictService extends IService<ClassDictDO> {
String updateClass(ClassDictDO classDictDO);
ClassDictDO classDetail(ClassDictDO classDictDO);
String removeMember(ClassMemberMappingDO classMemberMappingDO);
List<MemberDO> getSpareMembers(GetSpareMembersDTO getSpareMembersDTO);
String addMemberToClass(AddMemberToClassDTO addMemberToClassDTO);
}
package com.subsidy.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.subsidy.dto.administer.OperatorsDTO;
import com.subsidy.dto.company.AddCompanyDTO;
import com.subsidy.model.AdministerDO;
import com.subsidy.model.CompanyDictDO;
import com.baomidou.mybatisplus.extension.service.IService;
import com.subsidy.vo.administer.OperatorsVO;
/**
* <p>
* 企业字典表 服务类
* </p>
*
* @author DengMin
* @since 2021-10-25
*/
public interface CompanyDictService extends IService<CompanyDictDO> {
IPage<OperatorsVO> operators(OperatorsDTO operatorsDTO);
String addOperator(AddCompanyDTO addCompanyDTO);
String deleteAdminister(CompanyDictDO companyDictDO);
String updateAdminister(AddCompanyDTO addCompanyDTO);
}
......@@ -21,5 +21,9 @@ public interface CourseContentService extends IService<CourseContentDO> {
List<CourseContentDO> getContents(CourseContentDO courseContentDO);
String deleteContent(CourseContentDO courseContentDO);
String addContent(CourseContentDO courseContentDO);
String updateContent(CourseContentDO courseContentDO);
}
......@@ -22,4 +22,6 @@ public interface CourseDictService extends IService<CourseDictDO> {
IPage queryCourses(QueryCoursesDTO queryCoursesDTO);
String updateCourses(CourseDictDO courseDictDO);
IPage queryCompanyCourse(QueryCoursesDTO queryCoursesDTO);
}
......@@ -2,8 +2,11 @@ package com.subsidy.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.subsidy.dto.exercise.GetAllExercisesDTO;
import com.subsidy.dto.exercise.SubmitDTO;
import com.subsidy.model.CourseDictDO;
import com.subsidy.model.ExerciseDictDO;
import com.baomidou.mybatisplus.extension.service.IService;
import com.subsidy.vo.course.ExerciseVO;
import java.util.List;
......@@ -24,4 +27,9 @@ public interface ExerciseDictService extends IService<ExerciseDictDO> {
String deleteExercise(ExerciseDictDO exerciseDictDO);
String updateExercise(ExerciseDictDO exerciseDictDO);
List<ExerciseVO> getCourseExercises(CourseDictDO courseDictDO);
String submit(SubmitDTO submitDTO);
}
package com.subsidy.service;
import com.subsidy.model.ExerciseDoneResultDO;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 学生课程习题完成情况 服务类
* </p>
*
* @author DengMin
* @since 2021-10-15
*/
public interface ExerciseDoneResultService extends IService<ExerciseDoneResultDO> {
}
package com.subsidy.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.subsidy.dto.administer.VerifyCodeDTO;
import com.subsidy.dto.member.ContentMemberDTO;
import com.subsidy.dto.member.GetAllDTO;
import com.subsidy.dto.member.StudyHistoryDTO;
import com.subsidy.model.MemberDO;
import com.baomidou.mybatisplus.extension.service.IService;
import com.subsidy.vo.administer.UserRoleVO;
import com.subsidy.vo.member.*;
import java.util.List;
/**
* <p>
......@@ -23,4 +30,23 @@ public interface MemberService extends IService<MemberDO> {
String updateMember(MemberDO memberDO);
UserRoleVO login(VerifyCodeDTO verifyCodeDTO);
UserRoleVO passwordLogin(MemberDO memberDO);
String updatePassword(MemberDO memberDO);
MemberStudyPageVO studyPage(MemberDO memberDO);
List<ContentVodVO> contentVod(ContentMemberDTO contentVodDTO);
List<ContentFilesVO> contentFiles(ContentMemberDTO contentMemberDTO);
IPage studyHistory(StudyHistoryDTO studyHistoryDTO);
GetCourseTestVO getCourseTest(ContentMemberDTO contentMemberDTO);
GetStudyInfoVO getStudyInfo(MemberDO memberDO);
}
package com.subsidy.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.subsidy.dto.member.GetMemberSignInfoDTO;
import com.subsidy.dto.sign.ClassSignInfoDTO;
import com.subsidy.dto.sign.SignInDTO;
import com.subsidy.model.MemberDO;
import com.subsidy.model.SignInRecordDO;
import com.baomidou.mybatisplus.extension.service.IService;
import com.subsidy.vo.member.GetMemberSignInfoVO;
import com.tencentcloudapi.common.Sign;
/**
* <p>
* 学生签到表 服务类
* </p>
*
* @author DengMin
* @since 2021-10-18
*/
public interface SignInRecordService extends IService<SignInRecordDO> {
IPage<GetMemberSignInfoVO> getMemberSignInfo(GetMemberSignInfoDTO getMemberSignInfoDTO);
String signIn(SignInRecordDO signInRecordDO);
IPage classSignInfo(ClassSignInfoDTO classSignInfoDTO);
}
package com.subsidy.service;
import com.subsidy.dto.sms.SendVerifyCodeDTO;
import com.subsidy.model.SmsVerifyCodeDO;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 短信验证码记录表 服务类
* </p>
*
* @author DengMin
* @since 2021-10-14
*/
public interface SmsVerifyCodeService extends IService<SmsVerifyCodeDO> {
void sendVerifyCode(SendVerifyCodeDTO sendVerifyCodeDTO);
}
package com.subsidy.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.subsidy.dto.content.GetContendVodsDTO;
import com.subsidy.model.VodDictDO;
import com.baomidou.mybatisplus.extension.service.IService;
import com.subsidy.vo.vod.GetContendVodsVO;
......@@ -19,7 +21,7 @@ public interface VodDictService extends IService<VodDictDO> {
SignatureVO signature()throws Exception;
List<GetContendVodsVO> getContendVods(VodDictDO vodDictDO);
IPage<GetContendVodsVO> getContendVods(GetContendVodsDTO getContendVodsDTO);
String deleteVod(VodDictDO vodDictDO);
......
package com.subsidy.service;
import com.subsidy.model.VodPlayHistoryDO;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 视频播放历史记录表 服务类
* </p>
*
* @author DengMin
* @since 2021-10-14
*/
public interface VodPlayHistoryService extends IService<VodPlayHistoryDO> {
String insertHistory(VodPlayHistoryDO vodPlayHistoryDO);
}
package com.subsidy.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.subsidy.dto.GetCourseQuestionDTO;
import com.subsidy.model.AnsweringQuestionDO;
import com.subsidy.mapper.AnsweringQuestionMapper;
import com.subsidy.service.AnsweringQuestionService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.subsidy.util.ConstantUtils;
import org.springframework.stereotype.Service;
/**
* <p>
* 问题答疑表 服务实现类
* </p>
*
* @author DengMin
* @since 2021-10-14
*/
@Service
public class AnsweringQuestionServiceImpl extends ServiceImpl<AnsweringQuestionMapper, AnsweringQuestionDO> implements AnsweringQuestionService {
public IPage getCourseQuestion(GetCourseQuestionDTO getCourseQuestionDTO) {
Page pager = new Page(getCourseQuestionDTO.getPageNum(), getCourseQuestionDTO.getPageSize());
return this.baseMapper.getCourseQuestion(pager, getCourseQuestionDTO.getClassId(), getCourseQuestionDTO.getMemberId());
}
public String addQuestion(AnsweringQuestionDO answeringQuestionDO) {
this.baseMapper.insert(answeringQuestionDO);
return ConstantUtils.ADD_SUCCESS;
}
public String deleteQuestion(AnsweringQuestionDO answeringQuestionDO) {
this.baseMapper.deleteById(answeringQuestionDO.getId());
return ConstantUtils.DELETE_SUCCESS;
}
public String updateQuestion(AnsweringQuestionDO answeringQuestionDO) {
this.baseMapper.updateById(answeringQuestionDO);
return ConstantUtils.SET_SUCCESS;
}
}
......@@ -25,25 +25,54 @@ import java.util.List;
@Service
public class CategoryServiceImpl extends ServiceImpl<CategoryMapper, CategoryDO> implements CategoryService {
public IPage<CategoryDO> getCategories(GetCategoriesDTO getCategoriesDTO){
public IPage<CategoryDO> getCategories(GetCategoriesDTO getCategoriesDTO) {
Page pager = new Page(getCategoriesDTO.getPageNum(), getCategoriesDTO.getPageSize());
return this.baseMapper.selectPage(pager,new QueryWrapper<CategoryDO>()
.lambda()
.like(CategoryDO::getName,getCategoriesDTO.getName()));
if (null == getCategoriesDTO.getCompanyId()) {
return this.baseMapper.selectPage(pager, new QueryWrapper<CategoryDO>()
.lambda()
.like(CategoryDO::getName, getCategoriesDTO.getName())
.isNull(CategoryDO::getCompanyId));
} else {
return this.baseMapper.selectPage(pager, new QueryWrapper<CategoryDO>()
.lambda()
.like(CategoryDO::getName, getCategoriesDTO.getName())
.eq(CategoryDO::getCompanyId, getCategoriesDTO.getCompanyId()));
}
}
public List<CategoryDO> getAll(){
return this.baseMapper.selectList(null);
public List<CategoryDO> getAll(GetCategoriesDTO getCategoriesDTO) {
if (null == getCategoriesDTO.getCompanyId()) {
return this.baseMapper.selectList(new QueryWrapper<CategoryDO>()
.lambda()
.isNull(CategoryDO::getCompanyId));
} else {
return this.baseMapper.selectList(new QueryWrapper<CategoryDO>()
.lambda()
.eq(CategoryDO::getCompanyId, getCategoriesDTO.getCompanyId()));
}
}
public String addCategory(CategoryDO categoryDO){
public String addCategory(CategoryDO categoryDO) {
int count = 0;
Integer count = this.baseMapper.selectCount(new QueryWrapper<CategoryDO>()
.lambda()
.eq(CategoryDO::getName,categoryDO.getName()));
if (null == categoryDO.getCompanyId()) {
count = this.baseMapper.selectCount(new QueryWrapper<CategoryDO>()
.lambda()
.like(CategoryDO::getName, categoryDO.getName())
.isNull(CategoryDO::getCompanyId));
} else {
count = this.baseMapper.selectCount(new QueryWrapper<CategoryDO>()
.lambda()
.like(CategoryDO::getName, categoryDO.getName())
.eq(CategoryDO::getCompanyId, categoryDO.getCompanyId()));
}
if (count > 0 ){
if (count > 0) {
throw new HttpException(90001);
}
this.baseMapper.insert(categoryDO);
......@@ -51,18 +80,18 @@ public class CategoryServiceImpl extends ServiceImpl<CategoryMapper, CategoryDO>
return ConstantUtils.ADD_SUCCESS;
}
public String deleteCategory(CategoryDO categoryDO){
public String deleteCategory(CategoryDO categoryDO) {
this.baseMapper.deleteById(categoryDO.getId());
return ConstantUtils.DELETE_SUCCESS;
}
public String updateCategory(CategoryDO categoryDO){
public String updateCategory(CategoryDO categoryDO) {
int count = this.baseMapper.selectCount(new QueryWrapper<CategoryDO>()
.lambda()
.eq(CategoryDO::getName,categoryDO.getName()));
.lambda()
.eq(CategoryDO::getName, categoryDO.getName()));
if (count>2){
if (count > 2) {
throw new HttpException(90001);
}
......
package com.subsidy.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.subsidy.dto.classDict.AddMemberToClassDTO;
import com.subsidy.dto.classDict.GetAllClassesDTO;
import com.subsidy.dto.classDict.GetSpareMembersDTO;
import com.subsidy.mapper.AdministerMapper;
import com.subsidy.mapper.ClassMemberMappingMapper;
import com.subsidy.model.ClassDictDO;
import com.subsidy.mapper.RoleAdministerMappingMapper;
import com.subsidy.model.*;
import com.subsidy.mapper.ClassDictMapper;
import com.subsidy.model.ClassMemberMappingDO;
import com.subsidy.service.ClassDictService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.subsidy.util.ConstantUtils;
......@@ -13,6 +17,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.management.relation.Role;
import java.util.ArrayList;
import java.util.List;
/**
......@@ -29,28 +35,58 @@ public class ClassDictServiceImpl extends ServiceImpl<ClassDictMapper, ClassDict
@Autowired
private ClassMemberMappingMapper classMemberMappingMapper;
public List<GetAllClassesVO> getAllClasses(ClassDictDO classDictDO){
public List<GetAllClassesVO> getAllClasses(ClassDictDO classDictDO) {
return this.baseMapper.getAllClasses(classDictDO);
}
@Transactional
public String deleteClasses(ClassDictDO classDictDO){
public String deleteClasses(ClassDictDO classDictDO) {
this.baseMapper.deleteById(classDictDO.getId());
classMemberMappingMapper.delete(new QueryWrapper<ClassMemberMappingDO>()
.lambda()
.eq(ClassMemberMappingDO::getClassId,classDictDO.getId()));
.lambda()
.eq(ClassMemberMappingDO::getClassId, classDictDO.getId()));
return ConstantUtils.DELETE_SUCCESS;
}
public String addClass(ClassDictDO classDictDO){
public String addClass(ClassDictDO classDictDO) {
this.baseMapper.insert(classDictDO);
return ConstantUtils.ADD_SUCCESS;
}
public String updateClass(ClassDictDO classDictDO){
public String updateClass(ClassDictDO classDictDO) {
this.baseMapper.updateById(classDictDO);
return ConstantUtils.SET_SUCCESS;
}
public ClassDictDO classDetail(ClassDictDO classDictDO) {
return this.baseMapper.selectById(classDictDO.getId());
}
public String removeMember(ClassMemberMappingDO classMemberMappingDO) {
classMemberMappingMapper.delete(new QueryWrapper<ClassMemberMappingDO>()
.lambda()
.eq(ClassMemberMappingDO::getClassId, classMemberMappingDO.getClassId())
.eq(ClassMemberMappingDO::getMemberId, classMemberMappingDO.getMemberId()));
return ConstantUtils.DELETE_SUCCESS;
}
public List<MemberDO> getSpareMembers(GetSpareMembersDTO getSpareMembersDTO){
return this.baseMapper.getSpareMembers(getSpareMembersDTO);
}
public String addMemberToClass(AddMemberToClassDTO addMemberToClassDTO){
List<Long> memberIds = addMemberToClassDTO.getMemberIds();
for (Long lg : memberIds){
ClassMemberMappingDO classMemberMappingDO = new ClassMemberMappingDO();
classMemberMappingDO.setClassId(addMemberToClassDTO.getClassId());
classMemberMappingDO.setMemberId(lg);
classMemberMappingMapper.insert(classMemberMappingDO);
}
return ConstantUtils.ADD_SUCCESS;
}
}
package com.subsidy.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.subsidy.common.exception.HttpException;
import com.subsidy.dto.administer.OperatorsDTO;
import com.subsidy.dto.company.AddCompanyDTO;
import com.subsidy.mapper.AdministerMapper;
import com.subsidy.model.AdministerDO;
import com.subsidy.model.CompanyDictDO;
import com.subsidy.mapper.CompanyDictMapper;
import com.subsidy.service.CompanyDictService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.subsidy.util.ConstantUtils;
import com.subsidy.vo.administer.OperatorsVO;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* <p>
* 企业字典表 服务实现类
* </p>
*
* @author DengMin
* @since 2021-10-25
*/
@Service
public class CompanyDictServiceImpl extends ServiceImpl<CompanyDictMapper, CompanyDictDO> implements CompanyDictService {
@Autowired
private AdministerMapper administerMapper;
public IPage<OperatorsVO> operators(OperatorsDTO operatorsDTO) {
Page pager = new Page(operatorsDTO.getPageNum(), operatorsDTO.getPageSize());
return this.baseMapper.operators(pager, operatorsDTO.getCompanyName(), operatorsDTO.getUserName(),1);
}
public String addOperator(AddCompanyDTO addCompanyDTO) {
Integer count = this.baseMapper.selectCount(new QueryWrapper<CompanyDictDO>()
.lambda()
.eq(CompanyDictDO::getCompanyName, addCompanyDTO.getAccountName()));
Integer count1 = administerMapper.selectCount(new QueryWrapper<AdministerDO>()
.lambda()
.eq(AdministerDO::getAccountName, addCompanyDTO.getAccountName()));
if (count > 0 || count1>0) {
throw new HttpException(20002);
}
CompanyDictDO companyDictDO =new CompanyDictDO();
BeanUtils.copyProperties(addCompanyDTO,companyDictDO);
this.baseMapper.insert(companyDictDO);
AdministerDO administerDO = new AdministerDO();
administerDO.setAccountName(addCompanyDTO.getAccountName());
administerDO.setCompanyId(companyDictDO.getId());
administerDO.setPassword("admin123");
administerDO.setStatus("1");
administerDO.setRole(1);
administerMapper.insert(administerDO);
return ConstantUtils.ADD_SUCCESS;
}
public String deleteAdminister(CompanyDictDO companyDictDO) {
this.baseMapper.deleteById(companyDictDO.getId());
administerMapper.delete(new QueryWrapper<AdministerDO>()
.lambda()
.eq(AdministerDO::getCompanyId,companyDictDO.getId()));
return ConstantUtils.DELETE_SUCCESS;
}
public String updateAdminister(AddCompanyDTO addCompanyDTO) {
CompanyDictDO companyDictDO = new CompanyDictDO();
BeanUtils.copyProperties(addCompanyDTO,companyDictDO);
this.baseMapper.updateById(companyDictDO);
//查找企业管理员
AdministerDO administerDO = administerMapper.selectOne(new QueryWrapper<AdministerDO>()
.lambda()
.eq(AdministerDO::getCompanyId,addCompanyDTO.getId())
.eq(AdministerDO::getRole,1));
if (StringUtils.isNotBlank(addCompanyDTO.getAccountName())){
administerDO.setAccountName(addCompanyDTO.getAccountName());
}
if (StringUtils.isBlank(addCompanyDTO.getPassword())){
addCompanyDTO.setPassword(addCompanyDTO.getPassword());
}
administerMapper.updateById(administerDO);
return ConstantUtils.SET_SUCCESS;
}
}
package com.subsidy.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.subsidy.common.exception.HttpException;
import com.subsidy.controller.CourseContentController;
import com.subsidy.mapper.VodDictMapper;
import com.subsidy.model.CourseContentDO;
......@@ -27,9 +28,6 @@ import java.util.List;
@Service
public class CourseContentServiceImpl extends ServiceImpl<CourseContentMapper, CourseContentDO> implements CourseContentService {
@Autowired
private VodDictMapper vodDictMapper;
public List<CourseContentDO> getContents(CourseContentDO courseContentDO) {
return this.baseMapper.selectList(new QueryWrapper<CourseContentDO>()
.lambda()
......@@ -38,5 +36,40 @@ public class CourseContentServiceImpl extends ServiceImpl<CourseContentMapper, C
.orderByAsc(CourseContentDO::getCreateDate));
}
public String deleteContent(CourseContentDO courseContentDO){
this.baseMapper.deleteById(courseContentDO.getId());
return ConstantUtils.DELETE_SUCCESS;
}
public String addContent(CourseContentDO courseContentDO){
List<CourseContentDO> courseContentDOS = this.baseMapper.selectList(new QueryWrapper<CourseContentDO>()
.lambda()
.eq(CourseContentDO::getCourseId,courseContentDO.getCourseId())
.orderByDesc(CourseContentDO::getOrderNo));
int orderNo = 1 ;
if (courseContentDOS.size()>0){
orderNo = courseContentDOS.get(0).getOrderNo()+1;
}
courseContentDO.setOrderNo(orderNo);
this.baseMapper.insert(courseContentDO);
return ConstantUtils.ADD_SUCCESS;
}
public String updateContent(CourseContentDO courseContentDO){
List<CourseContentDO> courseContentDOS = this.baseMapper.selectList(new QueryWrapper<CourseContentDO>()
.lambda()
.eq(CourseContentDO::getCourseId,courseContentDO.getCourseId())
.eq(CourseContentDO::getContent,courseContentDO.getContent()));
if (courseContentDOS.size()>0){
throw new HttpException(40001);
}
this.baseMapper.updateById(courseContentDO);
return ConstantUtils.SET_SUCCESS;
}
}
......@@ -5,16 +5,27 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.subsidy.common.exception.HttpException;
import com.subsidy.dto.course.QueryCoursesDTO;
import com.subsidy.mapper.AdministerMapper;
import com.subsidy.mapper.CompanyDictMapper;
import com.subsidy.mapper.RoleAdministerMappingMapper;
import com.subsidy.model.AdministerDO;
import com.subsidy.model.CompanyDictDO;
import com.subsidy.model.CourseDictDO;
import com.subsidy.mapper.CourseDictMapper;
import com.subsidy.model.RoleAdministerMappingDO;
import com.subsidy.service.CompanyDictService;
import com.subsidy.service.CourseDictService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.subsidy.util.ConstantUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
/**
* <p>
* 服务实现类
* 服务实现类
* </p>
*
* @author DengMin
......@@ -23,13 +34,33 @@ import org.springframework.stereotype.Service;
@Service
public class CourseDictServiceImpl extends ServiceImpl<CourseDictMapper, CourseDictDO> implements CourseDictService {
public String addCourse(CourseDictDO courseDictDO){
@Autowired
private RoleAdministerMappingMapper roleAdministerMappingMapper;
@Autowired
private AdministerMapper administerMapper;
@Autowired
private CompanyDictMapper companyDictMapper;
public String addCourse(CourseDictDO courseDictDO) {
int count = 0;
int count = this.baseMapper.selectCount(new QueryWrapper<CourseDictDO>()
.lambda()
.eq(CourseDictDO::getCourseName,courseDictDO.getCourseName()));
if (null != courseDictDO.getCompanyId()) {
count = this.baseMapper.selectCount(new QueryWrapper<CourseDictDO>()
.lambda()
.eq(CourseDictDO::getCourseName, courseDictDO.getCourseName())
.isNull(CourseDictDO::getCompanyId));
if (count >0){
} else {
count = this.baseMapper.selectCount(new QueryWrapper<CourseDictDO>()
.lambda()
.eq(CourseDictDO::getCourseName, courseDictDO.getCourseName())
.eq(CourseDictDO::getCompanyId, courseDictDO.getCompanyId()));
}
if (count > 0) {
throw new HttpException(20001);
}
......@@ -37,27 +68,72 @@ public class CourseDictServiceImpl extends ServiceImpl<CourseDictMapper, CourseD
return ConstantUtils.ADD_SUCCESS;
}
public String deleteCourse(CourseDictDO courseDictDO){
public String deleteCourse(CourseDictDO courseDictDO) {
this.baseMapper.deleteById(courseDictDO.getId());
return ConstantUtils.DELETE_SUCCESS;
}
public IPage queryCourses(QueryCoursesDTO queryCoursesDTO){
public IPage queryCourses(QueryCoursesDTO queryCoursesDTO) {
Page pager = new Page(queryCoursesDTO.getPageNum(), queryCoursesDTO.getPageSize());
return this.baseMapper.queryCourses(pager,queryCoursesDTO.getCourseName(),queryCoursesDTO.getCategoryId(),queryCoursesDTO.getCourseType(),queryCoursesDTO.getCourseSource());
return this.baseMapper.queryCourses(pager, queryCoursesDTO.getCourseName(), queryCoursesDTO.getCategoryId(), queryCoursesDTO.getCourseType(), queryCoursesDTO.getCourseSource(), queryCoursesDTO.getCompanyId());
}
public String updateCourses(CourseDictDO courseDictDO){
int count = this.baseMapper.selectCount(new QueryWrapper<CourseDictDO>()
.lambda()
.eq(CourseDictDO::getCourseName,courseDictDO.getCourseName()));
public String updateCourses(CourseDictDO courseDictDO) {
int count = 0;
if (count >1){
throw new HttpException(20001);
if (null != courseDictDO.getCompanyId()) {
count = this.baseMapper.selectCount(new QueryWrapper<CourseDictDO>()
.lambda()
.eq(CourseDictDO::getCourseName, courseDictDO.getCourseName())
.ne(CourseDictDO::getId, courseDictDO.getCompanyId()));
} else {
count = this.baseMapper.selectCount(new QueryWrapper<CourseDictDO>()
.lambda()
.eq(CourseDictDO::getCourseName, courseDictDO.getCourseName())
.isNull(CourseDictDO::getCompanyId));
}
if (count > 0) {
throw new HttpException(20001);
}
this.baseMapper.updateById(courseDictDO);
return ConstantUtils.DELETE_SUCCESS;
}
public IPage queryCompanyCourse(QueryCoursesDTO queryCoursesDTO) {
Page pager = new Page(queryCoursesDTO.getPageNum(), queryCoursesDTO.getPageSize());
////判断角色
//List<RoleAdministerMappingDO> roleAdministerMappingDOS = roleAdministerMappingMapper.selectList(new QueryWrapper<RoleAdministerMappingDO>()
//.lambda()
//.eq(RoleAdministerMappingDO::getAdministerId,roleAdministerMappingMapper));
//
//Boolean flag = false;
//for (RoleAdministerMappingDO roleAdministerMappingDO : roleAdministerMappingDOS){
//
// if (roleAdministerMappingDO.getRoleId() ==3){
// flag= false;
// }else if(roleAdministerMappingDO.getRoleId()==2) {
// flag = true;
// }
//}
//List<Long> longs = new ArrayList<>();
//if (flag){
// //运营者账号 该企业下的所有课程 管理员
// //获取该企业下所有老师的课程
// AdministerDO administerDO = administerMapper.selectById(queryCoursesDTO.getAdministerId());
//
// List<AdministerDO> administerDOS = administerMapper.selectList(new QueryWrapper<AdministerDO>()
// .lambda()
// .eq(AdministerDO::getCompanyId,administerDO.getCompanyId()));
// for (AdministerDO administerDO1 : administerDOS){
// longs.add(administerDO1.getId());
// }
return this.baseMapper.queryCompanyCourse(pager, queryCoursesDTO.getCourseName(), queryCoursesDTO.getCategoryId(), queryCoursesDTO.getCourseType(), queryCoursesDTO.getCourseSource(), queryCoursesDTO.getCompanyId());
//}
}
}
......@@ -4,14 +4,22 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.subsidy.dto.exercise.GetAllExercisesDTO;
import com.subsidy.dto.exercise.SubmitDTO;
import com.subsidy.mapper.ExerciseDoneResultMapper;
import com.subsidy.model.CourseDictDO;
import com.subsidy.model.ExerciseDictDO;
import com.subsidy.mapper.ExerciseDictMapper;
import com.subsidy.model.ExerciseDoneResultDO;
import com.subsidy.service.ExerciseDictService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.subsidy.util.ConstantUtils;
import org.apache.tomcat.util.bcel.Const;
import com.subsidy.vo.course.ExerciseVO;
import com.subsidy.vo.exercise.MemberExerciseVO;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
/**
......@@ -25,6 +33,9 @@ import java.util.List;
@Service
public class ExerciseDictServiceImpl extends ServiceImpl<ExerciseDictMapper, ExerciseDictDO> implements ExerciseDictService {
@Autowired
private ExerciseDoneResultMapper exerciseDoneResultMapper;
public IPage<ExerciseDictDO> getAllExercises(GetAllExercisesDTO getAllExercisesDTO) {
Page pager = new Page(getAllExercisesDTO.getPageNum(), getAllExercisesDTO.getPageSize());
......@@ -34,7 +45,7 @@ public class ExerciseDictServiceImpl extends ServiceImpl<ExerciseDictMapper, Exe
.eq(ExerciseDictDO::getCourseId, getAllExercisesDTO.getCourseId())
.like(ExerciseDictDO::getDifficulty, getAllExercisesDTO.getDifficulty())
.like(ExerciseDictDO::getExerciseType, getAllExercisesDTO.getExerciseType())
.like(ExerciseDictDO::getTitle, getAllExercisesDTO.getExerciseType())
.like(ExerciseDictDO::getTitle, getAllExercisesDTO.getTitle())
.orderByAsc(ExerciseDictDO::getOrderNo));
}
......@@ -65,4 +76,51 @@ public class ExerciseDictServiceImpl extends ServiceImpl<ExerciseDictMapper, Exe
return ConstantUtils.SET_SUCCESS;
}
public List<ExerciseVO> getCourseExercises(CourseDictDO courseDictDO){
List<ExerciseVO> exerciseVOS = new ArrayList<>();
List<ExerciseDictDO> exerciseDictDOS = this.baseMapper.selectList(new QueryWrapper<ExerciseDictDO>()
.lambda()
.eq(ExerciseDictDO::getCourseId,courseDictDO.getId()));
for (ExerciseDictDO exerciseDictDO : exerciseDictDOS){
ExerciseVO exerciseVO = new ExerciseVO();
BeanUtils.copyProperties(exerciseDictDO,exerciseVO);
exerciseVOS.add(exerciseVO);
}
return exerciseVOS;
}
public String submit(SubmitDTO submitDTO){
ExerciseDoneResultDO exerciseDoneResultDO = new ExerciseDoneResultDO();
List<MemberExerciseVO> memberExerciseVOS = submitDTO.getMemberExerciseVOS();
int rightCounts = 0 ;
for (MemberExerciseVO exerciseVO : memberExerciseVOS){
ExerciseDictDO exerciseDictDO = this.baseMapper.selectById(exerciseVO.getId());
if (exerciseDictDO.getRightAnswer().equals(exerciseVO.getSelectAnswer())){
rightCounts++;
}
}
exerciseDoneResultDO.setClassId(submitDTO.getClassId());
exerciseDoneResultDO.setRightCounts(rightCounts);
exerciseDoneResultDO.setTotalCounts(memberExerciseVOS.size());
exerciseDoneResultDO.setCourseId(submitDTO.getCourseId());
exerciseDoneResultDO.setMemberId(submitDTO.getMemberId());
exerciseDoneResultMapper.delete(new QueryWrapper<ExerciseDoneResultDO>()
.lambda()
.eq(ExerciseDoneResultDO::getMemberId,submitDTO.getMemberId())
.eq(ExerciseDoneResultDO::getCourseId,submitDTO.getCourseId()));
exerciseDoneResultMapper.insert(exerciseDoneResultDO);
return ConstantUtils.COMMIT_SUCCESS;
}
}
package com.subsidy.service.impl;
import com.subsidy.model.ExerciseDoneResultDO;
import com.subsidy.mapper.ExerciseDoneResultMapper;
import com.subsidy.service.ExerciseDoneResultService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* <p>
* 学生课程习题完成情况 服务实现类
* </p>
*
* @author DengMin
* @since 2021-10-15
*/
@Service
public class ExerciseDoneResultServiceImpl extends ServiceImpl<ExerciseDoneResultMapper, ExerciseDoneResultDO> implements ExerciseDoneResultService {
}
package com.subsidy.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.subsidy.dto.member.GetMemberSignInfoDTO;
import com.subsidy.dto.sign.ClassSignInfoDTO;
import com.subsidy.dto.sign.SignInDTO;
import com.subsidy.mapper.*;
import com.subsidy.model.*;
import com.subsidy.service.SignInRecordService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.subsidy.util.ConstantUtils;
import com.subsidy.util.MathUtil;
import com.subsidy.vo.member.GetMemberSignInfoVO;
import com.subsidy.vo.sign.ClassSignInfoVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* <p>
* 学生签到表 服务实现类
* </p>
*
* @author DengMin
* @since 2021-10-18
*/
@Service
public class SignInRecordServiceImpl extends ServiceImpl<SignInRecordMapper, SignInRecordDO> implements SignInRecordService {
@Autowired
private ClassMemberMappingMapper classMemberMappingMapper;
@Autowired
private ClassDictMapper classDictMapper;
@Autowired
private VodPlayHistoryMapper vodPlayHistoryMapper;
@Autowired
private ExerciseDoneResultMapper exerciseDoneResultMapper;
@Autowired
private AnsweringQuestionMapper answeringQuestionMapper;
public IPage<GetMemberSignInfoVO> getMemberSignInfo(GetMemberSignInfoDTO getMemberSignInfoDTO) {
Page pager = new Page(getMemberSignInfoDTO.getPageNum(), getMemberSignInfoDTO.getPageSize());
return this.baseMapper.selectPage(pager, new QueryWrapper<SignInRecordDO>()
.lambda()
.eq(SignInRecordDO::getStudentId, getMemberSignInfoDTO.getId())
.orderByDesc(SignInRecordDO::getCreateDate));
}
public String signIn(SignInRecordDO signInRecordDO) {
/**
* 查看学生打卡记录
*/
List<SignInRecordDO> signInRecordDOS = this.baseMapper.selectList(new QueryWrapper<SignInRecordDO>()
.lambda()
.eq(SignInRecordDO::getStudentId, signInRecordDO.getStudentId()));
/**
* 查看学生所有在读班级
*/
if (signInRecordDOS.size() == 0) {
this.baseMapper.insert(signInRecordDO);
return ConstantUtils.ADD_SUCCESS;
} else {
//不用签到
return "";
}
}
public IPage classSignInfo(ClassSignInfoDTO classSignInfoDTO) {
Page pager = new Page(classSignInfoDTO.getPageNum(), classSignInfoDTO.getPageSize());
IPage<ClassSignInfoVO> classSignInfoVOIPage = this.baseMapper.classSignInfo(pager, classSignInfoDTO.getClassName(), classSignInfoDTO.getCourseName(),classSignInfoDTO.getId());
List<ClassSignInfoVO> classSignInfoVOS = classSignInfoVOIPage.getRecords();
for (ClassSignInfoVO classSignInfoVO : classSignInfoVOS){
//班级人数
List<ClassMemberMappingDO> classMemberMappingDOS = classMemberMappingMapper.selectList(new QueryWrapper<ClassMemberMappingDO>()
.lambda()
.eq(ClassMemberMappingDO::getClassId,classSignInfoVO.getClassId()));
classSignInfoVO.setMemberCount(classMemberMappingDOS.size());
//课程总数
List<VodDictDO> vodDictDOS = classDictMapper.getClassVods(classSignInfoVO.getClassId());
classSignInfoVO.setTotalVodCounts(vodDictDOS.size());
int totalStudyVods = 0;
int totalStudyLength = 0 ;
//学生总共学习课时数
for (VodDictDO vodDictDO : vodDictDOS) {
for (ClassMemberMappingDO classMemberMappingDO : classMemberMappingDOS) {
List<VodPlayHistoryDO> vodPlayHistoryDOS = vodPlayHistoryMapper.selectList(new QueryWrapper<VodPlayHistoryDO>()
.lambda()
.eq(VodPlayHistoryDO::getMemberId, classMemberMappingDO.getId())
.eq(VodPlayHistoryDO::getVodId, vodDictDO.getId())
.orderByDesc(VodPlayHistoryDO::getPlayRecord));
for (VodPlayHistoryDO vodPlayHistoryDO : vodPlayHistoryDOS){
totalStudyLength+=vodPlayHistoryDO.getPlayLength();
}
if (vodPlayHistoryDOS.size() > 0) {
if (vodPlayHistoryDOS.get(0).getPlayRecord() > vodDictDO.getVodLength() * 0.8) {
totalStudyVods++;
}
}
}
}
classSignInfoVO.setStudyVodCounts(MathUtil.intDivFloorPercent(totalStudyVods, vodDictDOS.size()));
//平均完成时长 学生观看课程视频的全部时长/总人数
int avg = MathUtil.intDivCeil(totalStudyLength,classMemberMappingDOS.size());
classSignInfoVO.setAvgVodPlayLength(avg);
//测试通过率
List<ExerciseDoneResultDO> exerciseDoneResultDOS = exerciseDoneResultMapper.selectList(new QueryWrapper<ExerciseDoneResultDO>()
.lambda()
.eq(ExerciseDoneResultDO::getClassId, classSignInfoVO.getClassId()));
int passNum = 0;
for (ExerciseDoneResultDO exerciseDoneResultDO : exerciseDoneResultDOS) {
if (exerciseDoneResultDO.getRightCounts() > exerciseDoneResultDO.getTotalCounts()*0.6){
passNum++;
}
}
classSignInfoVO.setPassRate(100* MathUtil.intDivFloorPercent(passNum,classMemberMappingDOS.size()));
//平均签到数 向上取整
//签到总次数
Integer signCount = this.baseMapper.selectCount(new QueryWrapper<SignInRecordDO>()
.lambda()
.eq(SignInRecordDO::getClassId,classSignInfoVO.getClassId()));
classSignInfoVO.setAvgSignCount(MathUtil.intDivCeil(signCount,classMemberMappingDOS.size()));
//答疑数
Integer count = answeringQuestionMapper.selectCount(new QueryWrapper<AnsweringQuestionDO>()
.lambda()
.eq(AnsweringQuestionDO::getClassId, classSignInfoVO.getClassId()));
classSignInfoVO.setAnswerCount(count);
}
classSignInfoVOIPage.setRecords(classSignInfoVOS);
return classSignInfoVOIPage;
}
}
package com.subsidy.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.subsidy.common.exception.HttpException;
import com.subsidy.dto.sms.SendVerifyCodeDTO;
import com.subsidy.mapper.MemberMapper;
import com.subsidy.model.MemberDO;
import com.subsidy.model.SmsVerifyCodeDO;
import com.subsidy.mapper.SmsVerifyCodeMapper;
import com.subsidy.service.MemberService;
import com.subsidy.service.SmsVerifyCodeService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.subsidy.util.RandomUtil;
import com.subsidy.util.SMSUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.lang.reflect.Member;
/**
* <p>
* 短信验证码记录表 服务实现类
* </p>
*
* @author DengMin
* @since 2021-10-14
*/
@Service
public class SmsVerifyCodeServiceImpl extends ServiceImpl<SmsVerifyCodeMapper, SmsVerifyCodeDO> implements SmsVerifyCodeService {
@Autowired
private SMSUtils smsUtils;
@Autowired
private MemberMapper memberMapper;
public void sendVerifyCode(SendVerifyCodeDTO sendVerifyCodeDTO){
MemberDO memberDO =memberMapper.selectOne(new QueryWrapper<MemberDO>()
.lambda()
.eq(MemberDO::getTelephone, sendVerifyCodeDTO.getTelephone()));
if(memberDO == null) {
throw new HttpException(70012);
}
String code = RandomUtil.getRandomCode(6);
smsUtils.send(sendVerifyCodeDTO.getTelephone(), code);
SmsVerifyCodeDO smsCodeDO = new SmsVerifyCodeDO();
smsCodeDO.setVerifyCode(code);
smsCodeDO.setTelephone(sendVerifyCodeDTO.getTelephone());
this.baseMapper.insert(smsCodeDO);
}
}
package com.subsidy.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.subsidy.common.configure.VODConfig;
import com.subsidy.dto.content.GetContendVodsDTO;
import com.subsidy.model.VodDictDO;
import com.subsidy.mapper.VodDictMapper;
import com.subsidy.service.VodDictService;
......@@ -52,8 +55,9 @@ public class VodDictServiceImpl extends ServiceImpl<VodDictMapper, VodDictDO> im
return signatureVO;
}
public List<GetContendVodsVO> getContendVods(VodDictDO vodDictDO) {
return this.baseMapper.getContendVods(vodDictDO);
public IPage<GetContendVodsVO> getContendVods(GetContendVodsDTO getContendVodsDTO) {
Page pager = new Page(getContendVodsDTO.getPageNum(), getContendVodsDTO.getPageSize());
return this.baseMapper.getContendVods(pager,getContendVodsDTO.getVodName(),getContendVodsDTO.getContentId());
}
public String deleteVod(VodDictDO vodDictDO) {
......
package com.subsidy.service.impl;
import com.subsidy.model.VodPlayHistoryDO;
import com.subsidy.mapper.VodPlayHistoryMapper;
import com.subsidy.service.VodPlayHistoryService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.subsidy.util.ConstantUtils;
import org.springframework.stereotype.Service;
/**
* <p>
* 视频播放历史记录表 服务实现类
* </p>
*
* @author DengMin
* @since 2021-10-14
*/
@Service
public class VodPlayHistoryServiceImpl extends ServiceImpl<VodPlayHistoryMapper, VodPlayHistoryDO> implements VodPlayHistoryService {
public String insertHistory(VodPlayHistoryDO vodPlayHistoryDO) {
this.baseMapper.insert(vodPlayHistoryDO);
return ConstantUtils.ADD_SUCCESS;
}
}
......@@ -89,13 +89,21 @@ public class MathUtil {
return counts.multiply(new BigDecimal(100)).divide(total, RoundingMode.CEILING).stripTrailingZeros().toPlainString() + "%";
}
}
//百分比 不带%输出
public static String getPercentAvgIndexWithPercent(BigDecimal counts, BigDecimal total) {
if (BigDecimal.ZERO.equals(total) || BigDecimal.ZERO.equals(counts)) {
return "0";
} else {
return counts.multiply(new BigDecimal(100)).divide(total, RoundingMode.CEILING).stripTrailingZeros().toPlainString();
return counts.multiply(new BigDecimal(100)).divide(total,2,BigDecimal.ROUND_HALF_UP).stripTrailingZeros().toPlainString();
}
}
//百分比 不带%输出
public static String getPercentAvgIndexCeil(BigDecimal counts, BigDecimal total) {
if (BigDecimal.ZERO.equals(total) || BigDecimal.ZERO.equals(counts)) {
return "0";
} else {
return counts.multiply(new BigDecimal(100)).divide(total,2,BigDecimal.ROUND_CEILING).stripTrailingZeros().toPlainString();
}
}
......
......@@ -21,6 +21,8 @@ import org.springframework.stereotype.Component;
@Component
public class SMSUtils {
@Autowired
private AliyunSmsProperties aliyunSmsProperties;
......
package com.subsidy.util;
import lombok.Data;
import java.util.Date;
@Data
public class Student {
private String name;
private int age;
private Date birthday;
private float height;
private double weight;
private boolean sex;
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!