org.springframework.boot
diff --git a/src/main/java/com/subsidy/MeishuApplication.java b/src/main/java/com/subsidy/MeishuApplication.java
index 768f41b..d863709 100644
--- a/src/main/java/com/subsidy/MeishuApplication.java
+++ b/src/main/java/com/subsidy/MeishuApplication.java
@@ -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 {
diff --git a/src/main/java/com/subsidy/common/Code.java b/src/main/java/com/subsidy/common/Code.java
deleted file mode 100644
index 91afe9e..0000000
--- a/src/main/java/com/subsidy/common/Code.java
+++ /dev/null
@@ -1,45 +0,0 @@
-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;
- }
-}
diff --git a/src/main/java/com/subsidy/common/configure/SwaggerConfig.java b/src/main/java/com/subsidy/common/configure/SwaggerConfig.java
index 68dc808..01b41bd 100644
--- a/src/main/java/com/subsidy/common/configure/SwaggerConfig.java
+++ b/src/main/java/com/subsidy/common/configure/SwaggerConfig.java
@@ -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"))
diff --git a/src/main/java/com/subsidy/common/configure/WebLogAspect.java b/src/main/java/com/subsidy/common/configure/WebLogAspect.java
index 1732de8..0f193cd 100644
--- a/src/main/java/com/subsidy/common/configure/WebLogAspect.java
+++ b/src/main/java/com/subsidy/common/configure/WebLogAspect.java
@@ -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);
diff --git a/src/main/java/com/subsidy/common/interceptor/AuthenticationInterceptor.java b/src/main/java/com/subsidy/common/interceptor/AuthenticationInterceptor.java
index a3b12c9..94f2eeb 100644
--- a/src/main/java/com/subsidy/common/interceptor/AuthenticationInterceptor.java
+++ b/src/main/java/com/subsidy/common/interceptor/AuthenticationInterceptor.java
@@ -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);
}
diff --git a/src/main/java/com/subsidy/controller/AdministerController.java b/src/main/java/com/subsidy/controller/AdministerController.java
index 3ac0588..e25f118 100644
--- a/src/main/java/com/subsidy/controller/AdministerController.java
+++ b/src/main/java/com/subsidy/controller/AdministerController.java
@@ -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;
+
/**
*
* 管理平台用户 前端控制器
@@ -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 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 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 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 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);
+ }
}
diff --git a/src/main/java/com/subsidy/controller/AnsweringQuestionController.java b/src/main/java/com/subsidy/controller/AnsweringQuestionController.java
new file mode 100644
index 0000000..79f70ef
--- /dev/null
+++ b/src/main/java/com/subsidy/controller/AnsweringQuestionController.java
@@ -0,0 +1,57 @@
+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;
+
+/**
+ *
+ * 问题答疑表 前端控制器
+ *
+ *
+ * @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));
+ }
+
+
+
+}
diff --git a/src/main/java/com/subsidy/controller/CategoryController.java b/src/main/java/com/subsidy/controller/CategoryController.java
index 374dca7..494576a 100644
--- a/src/main/java/com/subsidy/controller/CategoryController.java
+++ b/src/main/java/com/subsidy/controller/CategoryController.java
@@ -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));
diff --git a/src/main/java/com/subsidy/controller/ClassDictController.java b/src/main/java/com/subsidy/controller/ClassDictController.java
index fd0b3ec..48ed80d 100644
--- a/src/main/java/com/subsidy/controller/ClassDictController.java
+++ b/src/main/java/com/subsidy/controller/ClassDictController.java
@@ -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));
+ }
+
+
}
diff --git a/src/main/java/com/subsidy/controller/CompanyDictController.java b/src/main/java/com/subsidy/controller/CompanyDictController.java
new file mode 100644
index 0000000..61badba
--- /dev/null
+++ b/src/main/java/com/subsidy/controller/CompanyDictController.java
@@ -0,0 +1,66 @@
+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;
+
+/**
+ *
+ * 企业字典表 前端控制器
+ *
+ *
+ * @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));
+ }
+
+}
diff --git a/src/main/java/com/subsidy/controller/CourseContentController.java b/src/main/java/com/subsidy/controller/CourseContentController.java
index 9d75906..6fc1c10 100644
--- a/src/main/java/com/subsidy/controller/CourseContentController.java
+++ b/src/main/java/com/subsidy/controller/CourseContentController.java
@@ -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));
+ }
+
+
}
diff --git a/src/main/java/com/subsidy/controller/CourseDictController.java b/src/main/java/com/subsidy/controller/CourseDictController.java
index cbd229a..93b2728 100644
--- a/src/main/java/com/subsidy/controller/CourseDictController.java
+++ b/src/main/java/com/subsidy/controller/CourseDictController.java
@@ -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));
+ }
}
diff --git a/src/main/java/com/subsidy/controller/DepartmentDictController.java b/src/main/java/com/subsidy/controller/DepartmentDictController.java
index bbd4199..2d4ade9 100644
--- a/src/main/java/com/subsidy/controller/DepartmentDictController.java
+++ b/src/main/java/com/subsidy/controller/DepartmentDictController.java
@@ -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));
diff --git a/src/main/java/com/subsidy/controller/ExerciseDictController.java b/src/main/java/com/subsidy/controller/ExerciseDictController.java
index 91341e7..192755e 100644
--- a/src/main/java/com/subsidy/controller/ExerciseDictController.java
+++ b/src/main/java/com/subsidy/controller/ExerciseDictController.java
@@ -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));
+ }
+
+
}
diff --git a/src/main/java/com/subsidy/controller/ExerciseDoneResultController.java b/src/main/java/com/subsidy/controller/ExerciseDoneResultController.java
new file mode 100644
index 0000000..8c7191f
--- /dev/null
+++ b/src/main/java/com/subsidy/controller/ExerciseDoneResultController.java
@@ -0,0 +1,22 @@
+package com.subsidy.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+import io.swagger.annotations.Api;
+
+/**
+ *
+ * 学生课程习题完成情况 前端控制器
+ *
+ *
+ * @author DengMin
+ * @since 2021-10-15
+ */
+@RestController
+@Api(tags = "学生课程习题完成情况")
+@RequestMapping("/exerciseDoneResult")
+public class ExerciseDoneResultController {
+
+}
diff --git a/src/main/java/com/subsidy/controller/FileDictController.java b/src/main/java/com/subsidy/controller/FileDictController.java
index aafca9f..61f84ba 100644
--- a/src/main/java/com/subsidy/controller/FileDictController.java
+++ b/src/main/java/com/subsidy/controller/FileDictController.java
@@ -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));
diff --git a/src/main/java/com/subsidy/controller/MemberController.java b/src/main/java/com/subsidy/controller/MemberController.java
index 8d47d47..71f8e93 100644
--- a/src/main/java/com/subsidy/controller/MemberController.java
+++ b/src/main/java/com/subsidy/controller/MemberController.java
@@ -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));
+ }
+
}
diff --git a/src/main/java/com/subsidy/controller/SignInRecordController.java b/src/main/java/com/subsidy/controller/SignInRecordController.java
new file mode 100644
index 0000000..e9bdad9
--- /dev/null
+++ b/src/main/java/com/subsidy/controller/SignInRecordController.java
@@ -0,0 +1,59 @@
+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;
+
+/**
+ *
+ * 学生签到表 前端控制器
+ *
+ *
+ * @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));
+ }
+
+
+}
diff --git a/src/main/java/com/subsidy/controller/SmsVerifyCodeController.java b/src/main/java/com/subsidy/controller/SmsVerifyCodeController.java
new file mode 100644
index 0000000..e8f1d91
--- /dev/null
+++ b/src/main/java/com/subsidy/controller/SmsVerifyCodeController.java
@@ -0,0 +1,41 @@
+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;
+
+/**
+ *
+ * 短信验证码记录表 前端控制器
+ *
+ *
+ * @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);
+ }
+
+}
+
diff --git a/src/main/java/com/subsidy/controller/VodDictController.java b/src/main/java/com/subsidy/controller/VodDictController.java
index 7041430..f797c41 100644
--- a/src/main/java/com/subsidy/controller/VodDictController.java
+++ b/src/main/java/com/subsidy/controller/VodDictController.java
@@ -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")
diff --git a/src/main/java/com/subsidy/controller/VodPlayHistoryController.java b/src/main/java/com/subsidy/controller/VodPlayHistoryController.java
new file mode 100644
index 0000000..9d9b44d
--- /dev/null
+++ b/src/main/java/com/subsidy/controller/VodPlayHistoryController.java
@@ -0,0 +1,40 @@
+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;
+
+/**
+ *
+ * 视频播放历史记录表 前端控制器
+ *
+ *
+ * @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));
+ }
+
+
+}
diff --git a/src/main/java/com/subsidy/dto/GetCourseQuestionDTO.java b/src/main/java/com/subsidy/dto/GetCourseQuestionDTO.java
new file mode 100644
index 0000000..e544f88
--- /dev/null
+++ b/src/main/java/com/subsidy/dto/GetCourseQuestionDTO.java
@@ -0,0 +1,16 @@
+package com.subsidy.dto;
+
+import lombok.Data;
+
+@Data
+public class GetCourseQuestionDTO {
+
+ private Integer pageSize;
+
+ private Integer pageNum;
+
+ private Long classId;
+
+ private Long memberId;
+
+}
diff --git a/src/main/java/com/subsidy/dto/administer/ClassDetailDTO.java b/src/main/java/com/subsidy/dto/administer/ClassDetailDTO.java
new file mode 100644
index 0000000..79c89db
--- /dev/null
+++ b/src/main/java/com/subsidy/dto/administer/ClassDetailDTO.java
@@ -0,0 +1,16 @@
+package com.subsidy.dto.administer;
+
+import lombok.Data;
+
+@Data
+public class ClassDetailDTO {
+
+ private Long id;
+
+ private Integer pageSize;
+
+ private Integer pageNum;
+
+ private String userName;
+
+}
diff --git a/src/main/java/com/subsidy/dto/administer/OperatorsDTO.java b/src/main/java/com/subsidy/dto/administer/OperatorsDTO.java
index 89f3b0d..597bc22 100644
--- a/src/main/java/com/subsidy/dto/administer/OperatorsDTO.java
+++ b/src/main/java/com/subsidy/dto/administer/OperatorsDTO.java
@@ -9,6 +9,10 @@ public class OperatorsDTO {
private Integer pageNum;
- private String accountType;
+ private Integer role;
+
+ private String companyName;
+
+ private String userName;
}
diff --git a/src/main/java/com/subsidy/dto/administer/VerifyCodeDTO.java b/src/main/java/com/subsidy/dto/administer/VerifyCodeDTO.java
new file mode 100644
index 0000000..2d3dd68
--- /dev/null
+++ b/src/main/java/com/subsidy/dto/administer/VerifyCodeDTO.java
@@ -0,0 +1,11 @@
+package com.subsidy.dto.administer;
+
+import lombok.Data;
+
+@Data
+public class VerifyCodeDTO {
+
+ private String telephone;
+
+ private String verifyCode;
+}
diff --git a/src/main/java/com/subsidy/dto/category/GetCategoriesDTO.java b/src/main/java/com/subsidy/dto/category/GetCategoriesDTO.java
index 91640ab..f7fee2e 100644
--- a/src/main/java/com/subsidy/dto/category/GetCategoriesDTO.java
+++ b/src/main/java/com/subsidy/dto/category/GetCategoriesDTO.java
@@ -11,4 +11,6 @@ public class GetCategoriesDTO {
private String name;
+ private Long companyId;
+
}
diff --git a/src/main/java/com/subsidy/dto/classDict/AddMemberToClassDTO.java b/src/main/java/com/subsidy/dto/classDict/AddMemberToClassDTO.java
new file mode 100644
index 0000000..6794de0
--- /dev/null
+++ b/src/main/java/com/subsidy/dto/classDict/AddMemberToClassDTO.java
@@ -0,0 +1,14 @@
+package com.subsidy.dto.classDict;
+
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class AddMemberToClassDTO {
+
+ private List memberIds;
+
+ private Long classId;
+
+}
diff --git a/src/main/java/com/subsidy/dto/classDict/GetAllClassesDTO.java b/src/main/java/com/subsidy/dto/classDict/GetAllClassesDTO.java
new file mode 100644
index 0000000..a060723
--- /dev/null
+++ b/src/main/java/com/subsidy/dto/classDict/GetAllClassesDTO.java
@@ -0,0 +1,18 @@
+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 teacherIds;
+
+}
diff --git a/src/main/java/com/subsidy/dto/classDict/GetSpareMembersDTO.java b/src/main/java/com/subsidy/dto/classDict/GetSpareMembersDTO.java
new file mode 100644
index 0000000..2e81412
--- /dev/null
+++ b/src/main/java/com/subsidy/dto/classDict/GetSpareMembersDTO.java
@@ -0,0 +1,13 @@
+package com.subsidy.dto.classDict;
+
+
+import lombok.Data;
+
+@Data
+public class GetSpareMembersDTO {
+
+ private Long companyId;
+
+ private Long classId;
+
+}
diff --git a/src/main/java/com/subsidy/dto/company/AddCompanyDTO.java b/src/main/java/com/subsidy/dto/company/AddCompanyDTO.java
new file mode 100644
index 0000000..ef03529
--- /dev/null
+++ b/src/main/java/com/subsidy/dto/company/AddCompanyDTO.java
@@ -0,0 +1,17 @@
+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;
+
+}
diff --git a/src/main/java/com/subsidy/dto/content/GetContendVodsDTO.java b/src/main/java/com/subsidy/dto/content/GetContendVodsDTO.java
new file mode 100644
index 0000000..b9ca9a9
--- /dev/null
+++ b/src/main/java/com/subsidy/dto/content/GetContendVodsDTO.java
@@ -0,0 +1,16 @@
+package com.subsidy.dto.content;
+
+import lombok.Data;
+
+@Data
+public class GetContendVodsDTO {
+
+ private Integer pageSize;
+
+ private Integer pageNum;
+
+ private Long contentId;
+
+ private String vodName;
+
+}
diff --git a/src/main/java/com/subsidy/dto/course/QueryCoursesDTO.java b/src/main/java/com/subsidy/dto/course/QueryCoursesDTO.java
index 80e315d..74a7907 100644
--- a/src/main/java/com/subsidy/dto/course/QueryCoursesDTO.java
+++ b/src/main/java/com/subsidy/dto/course/QueryCoursesDTO.java
@@ -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 teacherIds;
+
}
diff --git a/src/main/java/com/subsidy/dto/exercise/GetAllExercisesDTO.java b/src/main/java/com/subsidy/dto/exercise/GetAllExercisesDTO.java
index cd38971..7ad85bb 100644
--- a/src/main/java/com/subsidy/dto/exercise/GetAllExercisesDTO.java
+++ b/src/main/java/com/subsidy/dto/exercise/GetAllExercisesDTO.java
@@ -10,4 +10,6 @@ public class GetAllExercisesDTO extends ExerciseDictDO {
private Integer pageNum;
+
+
}
diff --git a/src/main/java/com/subsidy/dto/exercise/SubmitDTO.java b/src/main/java/com/subsidy/dto/exercise/SubmitDTO.java
new file mode 100644
index 0000000..2550af2
--- /dev/null
+++ b/src/main/java/com/subsidy/dto/exercise/SubmitDTO.java
@@ -0,0 +1,18 @@
+package com.subsidy.dto.exercise;
+
+import com.subsidy.vo.exercise.MemberExerciseVO;
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class SubmitDTO {
+
+ private List memberExerciseVOS;
+
+ private Long memberId;
+
+ private Long courseId;
+
+ private Long classId;
+}
diff --git a/src/main/java/com/subsidy/dto/member/ContentMemberDTO.java b/src/main/java/com/subsidy/dto/member/ContentMemberDTO.java
new file mode 100644
index 0000000..f616e51
--- /dev/null
+++ b/src/main/java/com/subsidy/dto/member/ContentMemberDTO.java
@@ -0,0 +1,12 @@
+package com.subsidy.dto.member;
+
+import lombok.Data;
+
+@Data
+public class ContentMemberDTO {
+
+ private Integer memberId;
+
+ private Integer courseId;
+
+}
diff --git a/src/main/java/com/subsidy/dto/member/GetMemberSignInfoDTO.java b/src/main/java/com/subsidy/dto/member/GetMemberSignInfoDTO.java
new file mode 100644
index 0000000..571466a
--- /dev/null
+++ b/src/main/java/com/subsidy/dto/member/GetMemberSignInfoDTO.java
@@ -0,0 +1,14 @@
+package com.subsidy.dto.member;
+
+import lombok.Data;
+
+@Data
+public class GetMemberSignInfoDTO {
+
+ private Integer pageSize;
+
+ private Integer pageNum;
+
+ private Long id;
+
+}
diff --git a/src/main/java/com/subsidy/dto/member/StudyHistoryDTO.java b/src/main/java/com/subsidy/dto/member/StudyHistoryDTO.java
new file mode 100644
index 0000000..09053b8
--- /dev/null
+++ b/src/main/java/com/subsidy/dto/member/StudyHistoryDTO.java
@@ -0,0 +1,14 @@
+package com.subsidy.dto.member;
+
+import lombok.Data;
+
+@Data
+public class StudyHistoryDTO {
+
+ private Integer pageSize;
+
+ private Integer pageNum;
+
+ private Long memberId;
+
+}
diff --git a/src/main/java/com/subsidy/dto/sign/ClassSignInfoDTO.java b/src/main/java/com/subsidy/dto/sign/ClassSignInfoDTO.java
new file mode 100644
index 0000000..bced7dc
--- /dev/null
+++ b/src/main/java/com/subsidy/dto/sign/ClassSignInfoDTO.java
@@ -0,0 +1,19 @@
+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;
+
+}
diff --git a/src/main/java/com/subsidy/dto/sign/SignInDTO.java b/src/main/java/com/subsidy/dto/sign/SignInDTO.java
new file mode 100644
index 0000000..6691299
--- /dev/null
+++ b/src/main/java/com/subsidy/dto/sign/SignInDTO.java
@@ -0,0 +1,12 @@
+package com.subsidy.dto.sign;
+
+import lombok.Data;
+
+@Data
+public class SignInDTO {
+
+ private Long memberId;
+
+ private Long courseId;
+
+}
diff --git a/src/main/java/com/subsidy/dto/sms/SendVerifyCodeDTO.java b/src/main/java/com/subsidy/dto/sms/SendVerifyCodeDTO.java
new file mode 100644
index 0000000..6eaf8dd
--- /dev/null
+++ b/src/main/java/com/subsidy/dto/sms/SendVerifyCodeDTO.java
@@ -0,0 +1,9 @@
+package com.subsidy.dto.sms;
+
+import lombok.Data;
+
+@Data
+public class SendVerifyCodeDTO {
+
+ private String telephone;
+}
diff --git a/src/main/java/com/subsidy/mapper/AdministerMapper.java b/src/main/java/com/subsidy/mapper/AdministerMapper.java
index 97c91cb..313c9c5 100644
--- a/src/main/java/com/subsidy/mapper/AdministerMapper.java
+++ b/src/main/java/com/subsidy/mapper/AdministerMapper.java
@@ -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 {
List getPermissions(Long id);
- IPage operators(IPage page,String accountType);
+ /**
+ * 获取班级成员详情---班级成员
+ */
+ IPage classMembers(IPage iPage,Long classId,String userName);
+
+ /**
+ * 获取班级成员---注册签到
+ */
+ IPage classSign(IPage iPage,Long classId,String userName);
+
+ /**
+ * 获取班级成员---测试成绩
+ */
+ IPage exerciseTest(IPage iPage, Long classId, String userName);
+
+ /**
+ * 获取班级成员---答疑记录
+ */
+ IPage answerRecord(IPage iPage, Long classId, String userName);
+
}
diff --git a/src/main/java/com/subsidy/mapper/AnsweringQuestionMapper.java b/src/main/java/com/subsidy/mapper/AnsweringQuestionMapper.java
new file mode 100644
index 0000000..7fa17a8
--- /dev/null
+++ b/src/main/java/com/subsidy/mapper/AnsweringQuestionMapper.java
@@ -0,0 +1,27 @@
+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;
+
+/**
+ *
+ * 问题答疑表 Mapper 接口
+ *
+ *
+ * @author DengMin
+ * @since 2021-10-14
+ */
+@Repository
+public interface AnsweringQuestionMapper extends BaseMapper {
+
+ /**
+ * 获取某个课程的答疑
+ */
+ IPage getCourseQuestion(IPage page, Long classId,Long memberId);
+}
diff --git a/src/main/java/com/subsidy/mapper/ClassDictMapper.java b/src/main/java/com/subsidy/mapper/ClassDictMapper.java
index 3f23005..bf30e6f 100644
--- a/src/main/java/com/subsidy/mapper/ClassDictMapper.java
+++ b/src/main/java/com/subsidy/mapper/ClassDictMapper.java
@@ -1,7 +1,11 @@
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 {
- List getAllClasses(ClassDictDO classDictDO);
+ /**
+ * 获取某企业的全部班级
+ */
+ List getAllClasses(ClassDictDO classDictDO);
+
+ /**
+ * 获取某班级下的全部视频
+ */
+ List getClassVods(Long classId);
+
+ /**
+ * 查看某企业里,不在某班级的成员
+ * @return
+ */
+ List getSpareMembers(GetSpareMembersDTO getSpareMembersDTO);
+
}
diff --git a/src/main/java/com/subsidy/mapper/ClassMemberMappingMapper.java b/src/main/java/com/subsidy/mapper/ClassMemberMappingMapper.java
index fa258cb..7a2665d 100644
--- a/src/main/java/com/subsidy/mapper/ClassMemberMappingMapper.java
+++ b/src/main/java/com/subsidy/mapper/ClassMemberMappingMapper.java
@@ -1,9 +1,13 @@
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;
+
/**
*
* 班级成员映射表 Mapper 接口
@@ -12,7 +16,8 @@ import org.springframework.stereotype.Repository;
* @author DengMin
* @since 2021-10-12
*/
- @Repository
+@Repository
public interface ClassMemberMappingMapper extends BaseMapper {
+
}
diff --git a/src/main/java/com/subsidy/mapper/CompanyDictMapper.java b/src/main/java/com/subsidy/mapper/CompanyDictMapper.java
new file mode 100644
index 0000000..7e86199
--- /dev/null
+++ b/src/main/java/com/subsidy/mapper/CompanyDictMapper.java
@@ -0,0 +1,33 @@
+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;
+
+/**
+ *
+ * 企业字典表 Mapper 接口
+ *
+ *
+ * @author DengMin
+ * @since 2021-10-25
+ */
+@Repository
+public interface CompanyDictMapper extends BaseMapper {
+
+ /**
+ * 查找运营者
+ *
+ * @return
+ */
+ IPage operators(IPage page, String companyName, String userName,Integer role);
+
+ /**
+ * 通过企业id查找企业的管理员
+ */
+ AdministerDO getAdministerByCompanyId(Long companyId);
+
+}
diff --git a/src/main/java/com/subsidy/mapper/CourseContentMapper.java b/src/main/java/com/subsidy/mapper/CourseContentMapper.java
index 66db80e..c16dd53 100644
--- a/src/main/java/com/subsidy/mapper/CourseContentMapper.java
+++ b/src/main/java/com/subsidy/mapper/CourseContentMapper.java
@@ -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;
+
/**
*
* 课程目录表 Mapper 接口
@@ -12,7 +16,12 @@ import org.springframework.stereotype.Repository;
* @author DengMin
* @since 2021-10-11
*/
- @Repository
+@Repository
public interface CourseContentMapper extends BaseMapper {
+ /**
+ * 查看课程下有多少个视频
+ */
+ List getCourseVods(Integer courseId);
+
}
diff --git a/src/main/java/com/subsidy/mapper/CourseDictMapper.java b/src/main/java/com/subsidy/mapper/CourseDictMapper.java
index e83ae3f..0aa8478 100644
--- a/src/main/java/com/subsidy/mapper/CourseDictMapper.java
+++ b/src/main/java/com/subsidy/mapper/CourseDictMapper.java
@@ -1,8 +1,13 @@
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 {
- IPage queryCourses(IPage page,String courseName,Long categoryId,String courseType,String courseSource);
+ /**
+ * 查询全部课程
+ * @return
+ */
+ IPage queryCourses(IPage page, String courseName, Long categoryId, String courseType, String courseSource,Long companyId);
+
+ /**
+ * 通过课程id查询课程下的学生-----弃用
+ */
+ List queryCourseMember(StudyPageVO studyPageVO);
+
+ /**
+ * 查询全部公共课程
+ * @return
+ */
+ IPage queryPublicCourses(IPage page, String courseName, Long categoryId, String courseType, String courseSource);
+
+ /**
+ * 查询企业内部课程
+ */
+ IPage queryCompanyCourse(IPage page, String courseName, Long categoryId, String courseType, String courseSource,Long companyId);
}
diff --git a/src/main/java/com/subsidy/mapper/ExerciseDoneResultMapper.java b/src/main/java/com/subsidy/mapper/ExerciseDoneResultMapper.java
new file mode 100644
index 0000000..788d86d
--- /dev/null
+++ b/src/main/java/com/subsidy/mapper/ExerciseDoneResultMapper.java
@@ -0,0 +1,18 @@
+package com.subsidy.mapper;
+
+import com.subsidy.model.ExerciseDoneResultDO;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.springframework.stereotype.Repository;
+
+/**
+ *
+ * 学生课程习题完成情况 Mapper 接口
+ *
+ *
+ * @author DengMin
+ * @since 2021-10-15
+ */
+ @Repository
+public interface ExerciseDoneResultMapper extends BaseMapper {
+
+}
diff --git a/src/main/java/com/subsidy/mapper/MemberMapper.java b/src/main/java/com/subsidy/mapper/MemberMapper.java
index eedc04c..efaed52 100644
--- a/src/main/java/com/subsidy/mapper/MemberMapper.java
+++ b/src/main/java/com/subsidy/mapper/MemberMapper.java
@@ -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;
+
/**
*
* 学生表 Mapper 接口
@@ -12,7 +15,12 @@ import org.springframework.stereotype.Repository;
* @author DengMin
* @since 2021-10-11
*/
- @Repository
+@Repository
public interface MemberMapper extends BaseMapper {
+ /**
+ * 查看学生的课程
+ */
+ List studyPage(MemberDO memberDO);
+
}
diff --git a/src/main/java/com/subsidy/mapper/SignInRecordMapper.java b/src/main/java/com/subsidy/mapper/SignInRecordMapper.java
new file mode 100644
index 0000000..89a32c0
--- /dev/null
+++ b/src/main/java/com/subsidy/mapper/SignInRecordMapper.java
@@ -0,0 +1,24 @@
+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;
+
+/**
+ *
+ * 学生签到表 Mapper 接口
+ *
+ *
+ * @author DengMin
+ * @since 2021-10-18
+ */
+ @Repository
+public interface SignInRecordMapper extends BaseMapper {
+
+ IPage classSignInfo(IPage iPage,String className,String courseName,Integer id);
+
+
+}
diff --git a/src/main/java/com/subsidy/mapper/SmsVerifyCodeMapper.java b/src/main/java/com/subsidy/mapper/SmsVerifyCodeMapper.java
new file mode 100644
index 0000000..77d2613
--- /dev/null
+++ b/src/main/java/com/subsidy/mapper/SmsVerifyCodeMapper.java
@@ -0,0 +1,18 @@
+package com.subsidy.mapper;
+
+import com.subsidy.model.SmsVerifyCodeDO;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.springframework.stereotype.Repository;
+
+/**
+ *
+ * 短信验证码记录表 Mapper 接口
+ *
+ *
+ * @author DengMin
+ * @since 2021-10-14
+ */
+ @Repository
+public interface SmsVerifyCodeMapper extends BaseMapper {
+
+}
diff --git a/src/main/java/com/subsidy/mapper/VodDictMapper.java b/src/main/java/com/subsidy/mapper/VodDictMapper.java
index fdd5e00..71dd0e3 100644
--- a/src/main/java/com/subsidy/mapper/VodDictMapper.java
+++ b/src/main/java/com/subsidy/mapper/VodDictMapper.java
@@ -1,5 +1,6 @@
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 {
- List getContendVods(VodDictDO vodDictDO);
+ /**
+ * 查看某个目录下的视频
+ * @param page
+ * @param vodName
+ * @param contentId
+ * @return
+ */
+ IPage getContendVods(IPage page,String vodName,Long contentId);
}
diff --git a/src/main/java/com/subsidy/mapper/VodPlayHistoryMapper.java b/src/main/java/com/subsidy/mapper/VodPlayHistoryMapper.java
new file mode 100644
index 0000000..acae106
--- /dev/null
+++ b/src/main/java/com/subsidy/mapper/VodPlayHistoryMapper.java
@@ -0,0 +1,26 @@
+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;
+
+/**
+ *
+ * 视频播放历史记录表 Mapper 接口
+ *
+ *
+ * @author DengMin
+ * @since 2021-10-14
+ */
+@Repository
+public interface VodPlayHistoryMapper extends BaseMapper {
+
+ /**
+ * 查看某成员的学习历史
+ */
+ IPage studyHistory(IPage iPage,Long memberId);
+
+
+}
diff --git a/src/main/java/com/subsidy/model/AdministerDO.java b/src/main/java/com/subsidy/model/AdministerDO.java
index 6cf32d7..d76b33c 100644
--- a/src/main/java/com/subsidy/model/AdministerDO.java
+++ b/src/main/java/com/subsidy/model/AdministerDO.java
@@ -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;
}
diff --git a/src/main/java/com/subsidy/model/AnsweringQuestionDO.java b/src/main/java/com/subsidy/model/AnsweringQuestionDO.java
new file mode 100644
index 0000000..f844713
--- /dev/null
+++ b/src/main/java/com/subsidy/model/AnsweringQuestionDO.java
@@ -0,0 +1,54 @@
+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;
+
+/**
+ *
+ * 问题答疑表
+ *
+ *
+ * @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;
+
+
+}
diff --git a/src/main/java/com/subsidy/model/CategoryDO.java b/src/main/java/com/subsidy/model/CategoryDO.java
index c8bec80..c82ebcb 100644
--- a/src/main/java/com/subsidy/model/CategoryDO.java
+++ b/src/main/java/com/subsidy/model/CategoryDO.java
@@ -26,6 +26,11 @@ public class CategoryDO extends BaseModel {
private Long id;
/**
+ * 企业id
+ */
+ private Long companyId;
+
+ /**
* 类目名称
*/
private String name;
diff --git a/src/main/java/com/subsidy/model/ClassDictDO.java b/src/main/java/com/subsidy/model/ClassDictDO.java
index 573e509..a89a813 100644
--- a/src/main/java/com/subsidy/model/ClassDictDO.java
+++ b/src/main/java/com/subsidy/model/ClassDictDO.java
@@ -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;
}
diff --git a/src/main/java/com/subsidy/model/ClassMemberMappingDO.java b/src/main/java/com/subsidy/model/ClassMemberMappingDO.java
index db0dec8..614000d 100644
--- a/src/main/java/com/subsidy/model/ClassMemberMappingDO.java
+++ b/src/main/java/com/subsidy/model/ClassMemberMappingDO.java
@@ -1,5 +1,7 @@
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;
/**
diff --git a/src/main/java/com/subsidy/model/CompanyDictDO.java b/src/main/java/com/subsidy/model/CompanyDictDO.java
new file mode 100644
index 0000000..3e1700a
--- /dev/null
+++ b/src/main/java/com/subsidy/model/CompanyDictDO.java
@@ -0,0 +1,55 @@
+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;
+
+/**
+ *
+ * 企业字典表
+ *
+ *
+ * @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;
+
+
+
+}
diff --git a/src/main/java/com/subsidy/model/CourseContentDO.java b/src/main/java/com/subsidy/model/CourseContentDO.java
index e07f57b..f1e64a7 100644
--- a/src/main/java/com/subsidy/model/CourseContentDO.java
+++ b/src/main/java/com/subsidy/model/CourseContentDO.java
@@ -1,5 +1,7 @@
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;
diff --git a/src/main/java/com/subsidy/model/CourseDictDO.java b/src/main/java/com/subsidy/model/CourseDictDO.java
index de5fe9f..e1626af 100644
--- a/src/main/java/com/subsidy/model/CourseDictDO.java
+++ b/src/main/java/com/subsidy/model/CourseDictDO.java
@@ -7,6 +7,9 @@ import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import lombok.EqualsAndHashCode;
+import java.time.LocalDateTime;
+import java.util.Date;
+
/**
*
*
@@ -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;
}
diff --git a/src/main/java/com/subsidy/model/DepartmentDictDO.java b/src/main/java/com/subsidy/model/DepartmentDictDO.java
index 2f34ede..469e635 100644
--- a/src/main/java/com/subsidy/model/DepartmentDictDO.java
+++ b/src/main/java/com/subsidy/model/DepartmentDictDO.java
@@ -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;
diff --git a/src/main/java/com/subsidy/model/ExerciseDoneResultDO.java b/src/main/java/com/subsidy/model/ExerciseDoneResultDO.java
new file mode 100644
index 0000000..3398bf1
--- /dev/null
+++ b/src/main/java/com/subsidy/model/ExerciseDoneResultDO.java
@@ -0,0 +1,54 @@
+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;
+
+/**
+ *
+ * 学生课程习题完成情况
+ *
+ *
+ * @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;
+
+
+}
diff --git a/src/main/java/com/subsidy/model/FileDictDO.java b/src/main/java/com/subsidy/model/FileDictDO.java
index 1b75394..7143b28 100644
--- a/src/main/java/com/subsidy/model/FileDictDO.java
+++ b/src/main/java/com/subsidy/model/FileDictDO.java
@@ -40,6 +40,10 @@ public class FileDictDO extends BaseModel {
*/
private String fileSize;
+ private String fileType;
+
+ private String fileUrl;
+
/**
* 排序
*/
diff --git a/src/main/java/com/subsidy/model/SignInRecordDO.java b/src/main/java/com/subsidy/model/SignInRecordDO.java
new file mode 100644
index 0000000..ed14d50
--- /dev/null
+++ b/src/main/java/com/subsidy/model/SignInRecordDO.java
@@ -0,0 +1,45 @@
+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;
+
+/**
+ *
+ * 学生签到表
+ *
+ *
+ * @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;
+
+
+}
diff --git a/src/main/java/com/subsidy/model/SmsVerifyCodeDO.java b/src/main/java/com/subsidy/model/SmsVerifyCodeDO.java
new file mode 100644
index 0000000..67ad9e3
--- /dev/null
+++ b/src/main/java/com/subsidy/model/SmsVerifyCodeDO.java
@@ -0,0 +1,39 @@
+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;
+
+/**
+ *
+ * 短信验证码记录表
+ *
+ *
+ * @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;
+
+
+}
diff --git a/src/main/java/com/subsidy/model/VodDictDO.java b/src/main/java/com/subsidy/model/VodDictDO.java
index d684161..3661321 100644
--- a/src/main/java/com/subsidy/model/VodDictDO.java
+++ b/src/main/java/com/subsidy/model/VodDictDO.java
@@ -60,5 +60,14 @@ public class VodDictDO extends BaseModel {
*/
private String vodCode;
+ /**
+ * 讲师名称
+ */
+ private String teacherName;
+
+ /**
+ * 封面
+ */
+ private String coverPage;
}
diff --git a/src/main/java/com/subsidy/model/VodPlayHistoryDO.java b/src/main/java/com/subsidy/model/VodPlayHistoryDO.java
new file mode 100644
index 0000000..1635b64
--- /dev/null
+++ b/src/main/java/com/subsidy/model/VodPlayHistoryDO.java
@@ -0,0 +1,54 @@
+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;
+
+/**
+ *
+ * 视频播放历史记录表
+ *
+ *
+ * @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;
+
+
+}
diff --git a/src/main/java/com/subsidy/service/AdministerService.java b/src/main/java/com/subsidy/service/AdministerService.java
index 938d30f..8908a89 100644
--- a/src/main/java/com/subsidy/service/AdministerService.java
+++ b/src/main/java/com/subsidy/service/AdministerService.java
@@ -1,13 +1,17 @@
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 {
IPage 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 exportClassDetail(ClassDetailDTO classDetailDTO);
+
+ IPage signDetail(ClassDetailDTO classDetailDTO);
+
+ List exportSignDetail(ClassDetailDTO classDetailDTO);
+
+ IPage exerciseTest(ClassDetailDTO classDetailDTO);
+
+ List exportExerciseTest(ClassDetailDTO classDetailDTO);
+
+ IPage answerRecord(ClassDetailDTO classDetailDTO);
+
+ List exportAnswerRecord(ClassDetailDTO classDetailDTO);
+
+ void export(ClassDetailDTO classDetailDTO)throws Exception;
+
}
diff --git a/src/main/java/com/subsidy/service/AnsweringQuestionService.java b/src/main/java/com/subsidy/service/AnsweringQuestionService.java
new file mode 100644
index 0000000..7af3159
--- /dev/null
+++ b/src/main/java/com/subsidy/service/AnsweringQuestionService.java
@@ -0,0 +1,25 @@
+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;
+
+/**
+ *
+ * 问题答疑表 服务类
+ *
+ *
+ * @author DengMin
+ * @since 2021-10-14
+ */
+public interface AnsweringQuestionService extends IService {
+
+ IPage getCourseQuestion(GetCourseQuestionDTO getCourseQuestionDTO);
+
+ String addQuestion(AnsweringQuestionDO answeringQuestionDO);
+
+ String deleteQuestion(AnsweringQuestionDO answeringQuestionDO);
+
+ String updateQuestion(AnsweringQuestionDO answeringQuestionDO);
+}
diff --git a/src/main/java/com/subsidy/service/CategoryService.java b/src/main/java/com/subsidy/service/CategoryService.java
index 034a526..8647c82 100644
--- a/src/main/java/com/subsidy/service/CategoryService.java
+++ b/src/main/java/com/subsidy/service/CategoryService.java
@@ -19,7 +19,7 @@ public interface CategoryService extends IService {
IPage getCategories(GetCategoriesDTO getCategoriesDTO);
- List getAll();
+ List getAll(GetCategoriesDTO getCategoriesDTO);
String addCategory(CategoryDO categoryDO);
diff --git a/src/main/java/com/subsidy/service/ClassDictService.java b/src/main/java/com/subsidy/service/ClassDictService.java
index b701ab6..7719ead 100644
--- a/src/main/java/com/subsidy/service/ClassDictService.java
+++ b/src/main/java/com/subsidy/service/ClassDictService.java
@@ -1,7 +1,12 @@
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 {
String updateClass(ClassDictDO classDictDO);
+ ClassDictDO classDetail(ClassDictDO classDictDO);
+
+ String removeMember(ClassMemberMappingDO classMemberMappingDO);
+
+ List getSpareMembers(GetSpareMembersDTO getSpareMembersDTO);
+
+ String addMemberToClass(AddMemberToClassDTO addMemberToClassDTO);
+
}
diff --git a/src/main/java/com/subsidy/service/CompanyDictService.java b/src/main/java/com/subsidy/service/CompanyDictService.java
new file mode 100644
index 0000000..7d4fa7f
--- /dev/null
+++ b/src/main/java/com/subsidy/service/CompanyDictService.java
@@ -0,0 +1,29 @@
+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;
+
+/**
+ *
+ * 企业字典表 服务类
+ *
+ *
+ * @author DengMin
+ * @since 2021-10-25
+ */
+public interface CompanyDictService extends IService {
+
+ IPage operators(OperatorsDTO operatorsDTO);
+
+ String addOperator(AddCompanyDTO addCompanyDTO);
+
+ String deleteAdminister(CompanyDictDO companyDictDO);
+
+ String updateAdminister(AddCompanyDTO addCompanyDTO);
+
+}
diff --git a/src/main/java/com/subsidy/service/CourseContentService.java b/src/main/java/com/subsidy/service/CourseContentService.java
index 2ccc299..128b5c8 100644
--- a/src/main/java/com/subsidy/service/CourseContentService.java
+++ b/src/main/java/com/subsidy/service/CourseContentService.java
@@ -21,5 +21,9 @@ public interface CourseContentService extends IService {
List getContents(CourseContentDO courseContentDO);
+ String deleteContent(CourseContentDO courseContentDO);
+ String addContent(CourseContentDO courseContentDO);
+
+ String updateContent(CourseContentDO courseContentDO);
}
diff --git a/src/main/java/com/subsidy/service/CourseDictService.java b/src/main/java/com/subsidy/service/CourseDictService.java
index ddb7f61..59f9db7 100644
--- a/src/main/java/com/subsidy/service/CourseDictService.java
+++ b/src/main/java/com/subsidy/service/CourseDictService.java
@@ -22,4 +22,6 @@ public interface CourseDictService extends IService {
IPage queryCourses(QueryCoursesDTO queryCoursesDTO);
String updateCourses(CourseDictDO courseDictDO);
+
+ IPage queryCompanyCourse(QueryCoursesDTO queryCoursesDTO);
}
diff --git a/src/main/java/com/subsidy/service/ExerciseDictService.java b/src/main/java/com/subsidy/service/ExerciseDictService.java
index f0346d5..8f9782d 100644
--- a/src/main/java/com/subsidy/service/ExerciseDictService.java
+++ b/src/main/java/com/subsidy/service/ExerciseDictService.java
@@ -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 {
String deleteExercise(ExerciseDictDO exerciseDictDO);
String updateExercise(ExerciseDictDO exerciseDictDO);
+
+ List getCourseExercises(CourseDictDO courseDictDO);
+
+ String submit(SubmitDTO submitDTO);
+
}
diff --git a/src/main/java/com/subsidy/service/ExerciseDoneResultService.java b/src/main/java/com/subsidy/service/ExerciseDoneResultService.java
new file mode 100644
index 0000000..5628acb
--- /dev/null
+++ b/src/main/java/com/subsidy/service/ExerciseDoneResultService.java
@@ -0,0 +1,16 @@
+package com.subsidy.service;
+
+import com.subsidy.model.ExerciseDoneResultDO;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ *
+ * 学生课程习题完成情况 服务类
+ *
+ *
+ * @author DengMin
+ * @since 2021-10-15
+ */
+public interface ExerciseDoneResultService extends IService {
+
+}
diff --git a/src/main/java/com/subsidy/service/MemberService.java b/src/main/java/com/subsidy/service/MemberService.java
index d6982f5..0edc0e3 100644
--- a/src/main/java/com/subsidy/service/MemberService.java
+++ b/src/main/java/com/subsidy/service/MemberService.java
@@ -1,9 +1,16 @@
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;
/**
*
@@ -23,4 +30,23 @@ public interface MemberService extends IService {
String updateMember(MemberDO memberDO);
+ UserRoleVO login(VerifyCodeDTO verifyCodeDTO);
+
+ UserRoleVO passwordLogin(MemberDO memberDO);
+
+ String updatePassword(MemberDO memberDO);
+
+ MemberStudyPageVO studyPage(MemberDO memberDO);
+
+ List contentVod(ContentMemberDTO contentVodDTO);
+
+ List contentFiles(ContentMemberDTO contentMemberDTO);
+
+ IPage studyHistory(StudyHistoryDTO studyHistoryDTO);
+
+ GetCourseTestVO getCourseTest(ContentMemberDTO contentMemberDTO);
+
+ GetStudyInfoVO getStudyInfo(MemberDO memberDO);
+
+
}
diff --git a/src/main/java/com/subsidy/service/SignInRecordService.java b/src/main/java/com/subsidy/service/SignInRecordService.java
new file mode 100644
index 0000000..dd6746b
--- /dev/null
+++ b/src/main/java/com/subsidy/service/SignInRecordService.java
@@ -0,0 +1,28 @@
+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;
+
+/**
+ *
+ * 学生签到表 服务类
+ *
+ *
+ * @author DengMin
+ * @since 2021-10-18
+ */
+public interface SignInRecordService extends IService {
+
+ IPage getMemberSignInfo(GetMemberSignInfoDTO getMemberSignInfoDTO);
+
+ String signIn(SignInRecordDO signInRecordDO);
+
+ IPage classSignInfo(ClassSignInfoDTO classSignInfoDTO);
+}
diff --git a/src/main/java/com/subsidy/service/SmsVerifyCodeService.java b/src/main/java/com/subsidy/service/SmsVerifyCodeService.java
new file mode 100644
index 0000000..706fa89
--- /dev/null
+++ b/src/main/java/com/subsidy/service/SmsVerifyCodeService.java
@@ -0,0 +1,19 @@
+package com.subsidy.service;
+
+import com.subsidy.dto.sms.SendVerifyCodeDTO;
+import com.subsidy.model.SmsVerifyCodeDO;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ *
+ * 短信验证码记录表 服务类
+ *
+ *
+ * @author DengMin
+ * @since 2021-10-14
+ */
+public interface SmsVerifyCodeService extends IService {
+
+ void sendVerifyCode(SendVerifyCodeDTO sendVerifyCodeDTO);
+
+}
diff --git a/src/main/java/com/subsidy/service/VodDictService.java b/src/main/java/com/subsidy/service/VodDictService.java
index ac16676..1d5183a 100644
--- a/src/main/java/com/subsidy/service/VodDictService.java
+++ b/src/main/java/com/subsidy/service/VodDictService.java
@@ -1,5 +1,7 @@
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 {
SignatureVO signature()throws Exception;
- List getContendVods(VodDictDO vodDictDO);
+ IPage getContendVods(GetContendVodsDTO getContendVodsDTO);
String deleteVod(VodDictDO vodDictDO);
diff --git a/src/main/java/com/subsidy/service/VodPlayHistoryService.java b/src/main/java/com/subsidy/service/VodPlayHistoryService.java
new file mode 100644
index 0000000..3b850e3
--- /dev/null
+++ b/src/main/java/com/subsidy/service/VodPlayHistoryService.java
@@ -0,0 +1,18 @@
+package com.subsidy.service;
+
+import com.subsidy.model.VodPlayHistoryDO;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ *
+ * 视频播放历史记录表 服务类
+ *
+ *
+ * @author DengMin
+ * @since 2021-10-14
+ */
+public interface VodPlayHistoryService extends IService {
+
+ String insertHistory(VodPlayHistoryDO vodPlayHistoryDO);
+
+}
diff --git a/src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java b/src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java
index 4f6ee3a..30ccae7 100644
--- a/src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java
+++ b/src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java
@@ -4,26 +4,45 @@ 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.common.exception.HttpException;
+import com.subsidy.dto.administer.ClassDetailDTO;
import com.subsidy.dto.administer.OperatorsDTO;
-import com.subsidy.model.AdministerDO;
-import com.subsidy.mapper.AdministerMapper;
-import com.subsidy.model.RoleAdministerMappingDO;
+import com.subsidy.mapper.*;
+import com.subsidy.model.*;
import com.subsidy.service.AdministerService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.subsidy.util.ConstantUtils;
-import com.subsidy.util.JwtUtil;
-import com.subsidy.util.Localstorage;
-import com.subsidy.vo.administer.AdministerPermissionVO;
-import com.subsidy.vo.administer.LoginVO;
-import com.subsidy.vo.administer.OperatorsVO;
-import com.subsidy.vo.administer.PermissionsVO;
+import com.subsidy.util.*;
+import com.subsidy.vo.administer.*;
+import com.subsidy.vo.classdict.ClassDetailVO;
+import com.subsidy.vo.member.ClassSignVO;
+import com.subsidy.vo.sign.AnswerRecordVO;
+import org.apache.poi.hssf.usermodel.HSSFCellStyle;
+import org.apache.poi.hssf.usermodel.HSSFFont;
+import org.apache.poi.hssf.util.CellRangeAddress;
+import org.apache.poi.ss.usermodel.CellStyle;
+import org.apache.poi.ss.usermodel.Font;
+import org.apache.poi.xssf.streaming.SXSSFCell;
+import org.apache.poi.xssf.streaming.SXSSFRow;
+import org.apache.poi.xssf.streaming.SXSSFSheet;
+import org.apache.poi.xssf.streaming.SXSSFWorkbook;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.MediaType;
import org.springframework.stereotype.Service;
+import org.springframework.web.context.request.RequestContextHolder;
+import org.springframework.web.context.request.ServletRequestAttributes;
-import java.time.LocalDateTime;
+import javax.servlet.ServletOutputStream;
+import javax.servlet.http.HttpServletResponse;
+import java.io.*;
+import java.math.BigDecimal;
+import java.text.SimpleDateFormat;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.List;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipOutputStream;
+
+import static org.springframework.http.MediaType.*;
/**
*
@@ -36,6 +55,29 @@ import java.util.List;
@Service
public class AdministerServiceImpl extends ServiceImpl implements AdministerService {
+ @Autowired
+ private ClassDictMapper classDictMapper;
+
+ @Autowired
+ private VodPlayHistoryMapper vodPlayHistoryMapper;
+
+ @Autowired
+ private ExerciseDoneResultMapper exerciseDoneResultMapper;
+
+ @Autowired
+ private AnsweringQuestionMapper answeringQuestionMapper;
+
+ @Autowired
+ private ClassMemberMappingMapper classMemberMappingMapper;
+
+ @Autowired
+ private CourseDictMapper courseDictMapper;
+
+ @Autowired
+ private SignInRecordMapper signInRecordMapper;
+
+ @Autowired
+ private CompanyDictMapper companyDictMapper;
public LoginVO login(AdministerDO administerDO) {
@@ -43,14 +85,14 @@ public class AdministerServiceImpl extends ServiceImpl()
.lambda()
- .eq(AdministerDO::getTelephone, administerDO.getTelephone()));
+ .eq(AdministerDO::getAccountName, administerDO.getAccountName()));
if (null != administerDO1) {
if (administerDO.getPassword().equals(administerDO1.getPassword())) {
- String token = JwtUtil.generateToken(administerDO.getId(), ConstantUtils.ADMINISTER_TERMINATE);
+ String token = JwtUtil.generateToken(administerDO1.getId(), ConstantUtils.ADMINISTER_TERMINATE);
loginVO.setToken(token);
return loginVO;
- }else {
+ } else {
throw new HttpException(10004);
}
} else {
@@ -89,38 +131,989 @@ public class AdministerServiceImpl extends ServiceImpl operators(OperatorsDTO operatorsDTO){
+ public IPage operators(OperatorsDTO operatorsDTO) {
Page pager = new Page(operatorsDTO.getPageNum(), operatorsDTO.getPageSize());
- return this.baseMapper.operators(pager,operatorsDTO.getAccountType());
+ return companyDictMapper.operators(pager, operatorsDTO.getCompanyName(), operatorsDTO.getUserName(), 0);
}
- public String addOperator(AdministerDO administerDO){
+ public String addAdminister(AdministerDO administerDO) {
- Integer count = this.baseMapper.selectCount(new QueryWrapper()
- .lambda()
- .eq(AdministerDO::getAccountType,administerDO.getAccountType())
- .eq(AdministerDO::getTelephone,administerDO.getTelephone()));
+ int count = this.baseMapper.selectCount(new QueryWrapper()
+ .lambda()
+ .eq(AdministerDO::getAccountName, administerDO.getAccountName()));
- if (count>0){
- throw new HttpException(10014);
+ if (count > 0) {
+ throw new HttpException(20002);
}
+ administerDO.setRole(0);
administerDO.setPassword("admin123");
administerDO.setStatus("1");
this.baseMapper.insert(administerDO);
-
return ConstantUtils.ADD_SUCCESS;
}
- public String deleteAdminister(AdministerDO administerDO){
+ public String deleteAdminister(AdministerDO administerDO) {
this.baseMapper.deleteById(administerDO.getId());
return ConstantUtils.DELETE_SUCCESS;
}
- public String updateAdminister(AdministerDO administerDO){
+ public String updateAdminister(AdministerDO administerDO) {
+
+ int count = this.baseMapper.selectCount(new QueryWrapper()
+ .lambda()
+ .eq(AdministerDO::getAccountName, administerDO.getAccountName())
+ .ne(AdministerDO::getId, administerDO.getId()));
+
+ if (count > 0) {
+ throw new HttpException(20002);
+ }
this.baseMapper.updateById(administerDO);
return ConstantUtils.SET_SUCCESS;
}
+ public ClassSummaryVO classSummary(ClassDetailDTO classDetailDTO) {
+
+ ClassSummaryVO classSummaryVO = new ClassSummaryVO();
+
+ ClassDictDO classDictDO = classDictMapper.selectById(classDetailDTO.getId());
+ classSummaryVO.setClassId(classDetailDTO.getId());
+ classSummaryVO.setClassName(classDictDO.getClassName());
+ classSummaryVO.setStartDate(classDictDO.getStartDate());
+ classSummaryVO.setEndDate(classDictDO.getEndDate());
+
+ CourseDictDO courseDictDO = courseDictMapper.selectById(classDictDO.getCourseId());
+ classSummaryVO.setCourseName(courseDictDO.getCourseName());
+
+ //班级人数
+ List classMemberMappingDOS = classMemberMappingMapper.selectList(new QueryWrapper()
+ .lambda()
+ .eq(ClassMemberMappingDO::getClassId, classDetailDTO.getId()));
+ classSummaryVO.setMemberCount(classMemberMappingDOS.size());
+
+ //课程总数
+ List vodDictDOS = classDictMapper.getClassVods(classDetailDTO.getId());
+ classSummaryVO.setTotalVodCounts(vodDictDOS.size());
+
+
+ int totalStudyVods = 0;
+ int totalStudyLength = 0;
+ //学生总共学习课时数
+ for (VodDictDO vodDictDO : vodDictDOS) {
+ for (ClassMemberMappingDO classMemberMappingDO : classMemberMappingDOS) {
+ List vodPlayHistoryDOS = vodPlayHistoryMapper.selectList(new QueryWrapper()
+ .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++;
+ }
+ }
+ }
+ }
+ classSummaryVO.setStudyVodCounts(MathUtil.intDivFloorPercent(totalStudyVods, vodDictDOS.size()));
+
+ //平均完成时长 学生观看课程视频的全部时长/总人数
+ int avg = MathUtil.intDivCeil(totalStudyLength, classMemberMappingDOS.size());
+ classSummaryVO.setAvgVodPlayLength(avg);
+
+ //测试通过率
+ List exerciseDoneResultDOS = exerciseDoneResultMapper.selectList(new QueryWrapper()
+ .lambda()
+ .eq(ExerciseDoneResultDO::getClassId, classDetailDTO.getId()));
+
+ int passNum = 0;
+
+ for (ExerciseDoneResultDO exerciseDoneResultDO : exerciseDoneResultDOS) {
+ if (exerciseDoneResultDO.getRightCounts() > exerciseDoneResultDO.getTotalCounts() * 0.6) {
+ passNum++;
+ }
+ }
+ classSummaryVO.setPassRate(100 * MathUtil.intDivFloorPercent(passNum, classMemberMappingDOS.size()));
+
+
+ //平均签到数 向上取整
+ //签到总次数
+ Integer signCount = signInRecordMapper.selectCount(new QueryWrapper()
+ .lambda()
+ .eq(SignInRecordDO::getClassId, classDetailDTO.getId()));
+ classSummaryVO.setAvgSignCount(MathUtil.intDivCeil(signCount, classMemberMappingDOS.size()));
+
+ //答疑数
+ Integer count = answeringQuestionMapper.selectCount(new QueryWrapper()
+ .lambda()
+ .eq(AnsweringQuestionDO::getClassId, classDetailDTO.getId()));
+ classSummaryVO.setAnswerCount(count);
+
+ return classSummaryVO;
+ }
+
+ public IPage classDetail(ClassDetailDTO classDetailDTO) {
+
+ Page pager = new Page(classDetailDTO.getPageNum(), classDetailDTO.getPageSize());
+
+
+ IPage classDetailVOIPage = this.baseMapper.classMembers(pager, classDetailDTO.getId(), classDetailDTO.getUserName());
+ List classDetailVOS = classDetailVOIPage.getRecords();
+
+ //课程由多少个视频
+ List vodDictDOS = classDictMapper.getClassVods(classDetailDTO.getId());
+
+ //课程详情
+ ClassDictDO classDictDO = classDictMapper.selectById(classDetailDTO.getId());
+
+ for (ClassDetailVO classDetailVO : classDetailVOS) {
+ //全部视频数
+ classDetailVO.setAllVodCounts(vodDictDOS.size());
+
+ //该学生完成了多少个
+ int i = 0;
+
+ //该成员完成了几个视频
+ for (VodDictDO vodDictDO : vodDictDOS) {
+ List vodPlayHistoryDOS = vodPlayHistoryMapper.selectList(new QueryWrapper()
+ .lambda()
+ .eq(VodPlayHistoryDO::getMemberId, classDetailVO.getId())
+ .eq(VodPlayHistoryDO::getVodId, vodDictDO.getId())
+ .orderByDesc(VodPlayHistoryDO::getPlayRecord));
+
+ if (vodPlayHistoryDOS.size() > 0) {
+ if (vodPlayHistoryDOS.get(0).getPlayRecord() > vodDictDO.getVodLength() * 0.8) {
+ i++;
+ }
+ }
+ }
+ classDetailVO.setStudyVodCounts(i);
+
+ //学生测试完成情况
+ ExerciseDoneResultDO exerciseDoneResultDO = exerciseDoneResultMapper.selectOne(new QueryWrapper()
+ .lambda()
+ .eq(ExerciseDoneResultDO::getCourseId, classDictDO.getCourseId())
+ .eq(ExerciseDoneResultDO::getMemberId, classDetailVO.getId()));
+
+ if (null != exerciseDoneResultDO) {
+ classDetailVO.setRightCounts(exerciseDoneResultDO.getRightCounts());
+ classDetailVO.setTotalExeCounts(exerciseDoneResultDO.getTotalCounts());
+ classDetailVO.setScore(MathUtil.intDivCeil(exerciseDoneResultDO.getRightCounts(), exerciseDoneResultDO.getTotalCounts()));
+ }
+
+ //答疑
+ Integer count = answeringQuestionMapper.selectCount(new QueryWrapper()
+ .lambda()
+ .eq(AnsweringQuestionDO::getAskId, classDetailVO.getId())
+ .eq(AnsweringQuestionDO::getClassId, classDetailDTO.getId()));
+ classDetailVO.setAskCounts(count);
+
+ //签到次数
+ Integer signCount = signInRecordMapper.selectCount(new QueryWrapper()
+ .lambda()
+ .eq(SignInRecordDO::getStudentId, classDetailVO.getId())
+ .eq(SignInRecordDO::getClassId, classDetailDTO.getId()));
+ classDetailVO.setSignCounts(signCount);
+
+ //培训时长
+ classDetailVO.setTrainingLength(i);
+ }
+ classDetailVOIPage.setRecords(classDetailVOS);
+ return classDetailVOIPage;
+ }
+
+ public List exportClassDetail(ClassDetailDTO classDetailDTO) {
+ Page pager = new Page(1, 10000000);
+
+
+ IPage classDetailVOIPage = this.baseMapper.classMembers(pager, classDetailDTO.getId(), classDetailDTO.getUserName());
+ List classDetailVOS = classDetailVOIPage.getRecords();
+
+ //课程由多少个视频
+ List vodDictDOS = classDictMapper.getClassVods(classDetailDTO.getId());
+
+ //课程详情
+ ClassDictDO classDictDO = classDictMapper.selectById(classDetailDTO.getId());
+
+ for (ClassDetailVO classDetailVO : classDetailVOS) {
+ //全部视频数
+ //classDetailVO.setAllVodCounts(vodDictDOS.size());
+
+ //该学生完成了多少个
+ int i = 0;
+
+ //该成员完成了几个视频
+ for (VodDictDO vodDictDO : vodDictDOS) {
+ List vodPlayHistoryDOS = vodPlayHistoryMapper.selectList(new QueryWrapper()
+ .lambda()
+ .eq(VodPlayHistoryDO::getMemberId, classDetailVO.getId())
+ .eq(VodPlayHistoryDO::getVodId, vodDictDO.getId())
+ .orderByDesc(VodPlayHistoryDO::getPlayRecord));
+
+ if (vodPlayHistoryDOS.size() > 0) {
+ if (vodPlayHistoryDOS.get(0).getPlayRecord() > vodDictDO.getVodLength() * 0.8) {
+ i++;
+ }
+ }
+ }
+ //classDetailVO.setStudyVodCounts(i);
+ classDetailVO.setClassProcess(i + "/" + vodDictDOS.size());
+ //学生测试完成情况
+ ExerciseDoneResultDO exerciseDoneResultDO = exerciseDoneResultMapper.selectOne(new QueryWrapper()
+ .lambda()
+ .eq(ExerciseDoneResultDO::getCourseId, classDictDO.getCourseId())
+ .eq(ExerciseDoneResultDO::getMemberId, classDetailVO.getId()));
+
+ if (null != exerciseDoneResultDO) {
+ classDetailVO.setScore(MathUtil.intDivCeil(exerciseDoneResultDO.getRightCounts(), exerciseDoneResultDO.getTotalCounts()));
+ } else {
+ classDetailVO.setScore(0);
+ }
+
+ //答疑
+ Integer count = answeringQuestionMapper.selectCount(new QueryWrapper()
+ .lambda()
+ .eq(AnsweringQuestionDO::getAskId, classDetailVO.getId())
+ .eq(AnsweringQuestionDO::getClassId, classDetailDTO.getId()));
+ classDetailVO.setAskCounts(count);
+
+ //签到次数
+ Integer signCount = signInRecordMapper.selectCount(new QueryWrapper()
+ .lambda()
+ .eq(SignInRecordDO::getStudentId, classDetailVO.getId())
+ .eq(SignInRecordDO::getClassId, classDetailDTO.getId()));
+ classDetailVO.setSignCounts(signCount);
+
+ //培训时长
+ classDetailVO.setTrainingLength(i);
+ }
+ return classDetailVOS;
+ }
+
+
+ public IPage signDetail(ClassDetailDTO classDetailDTO) {
+
+ Page pager = new Page(classDetailDTO.getPageNum(), classDetailDTO.getPageSize());
+
+ IPage classSignVOIPage = this.baseMapper.classSign(pager, classDetailDTO.getId(), classDetailDTO.getUserName());
+ List classSignVOS = classSignVOIPage.getRecords();
+
+ //课程由多少个视频
+ List vodDictDOS = classDictMapper.getClassVods(classDetailDTO.getId());
+
+ for (ClassSignVO classSignVO : classSignVOS) {
+
+ //全部视频数
+ classSignVO.setAllVodCounts(vodDictDOS.size());
+
+ //该学生完成了多少个
+ int i = 0;
+
+ //该成员完成了几个视频
+ for (VodDictDO vodDictDO : vodDictDOS) {
+ List vodPlayHistoryDOS = vodPlayHistoryMapper.selectList(new QueryWrapper()
+ .lambda()
+ .eq(VodPlayHistoryDO::getMemberId, classSignVO.getId())
+ .eq(VodPlayHistoryDO::getVodId, vodDictDO.getId())
+ .orderByDesc(VodPlayHistoryDO::getPlayRecord));
+
+ if (vodPlayHistoryDOS.size() > 0) {
+ if (vodPlayHistoryDOS.get(0).getPlayRecord() > vodDictDO.getVodLength() * 0.8) {
+ i++;
+ }
+ }
+ }
+ classSignVO.setStudyVodCounts(i);
+
+ //完成率
+ String percent = MathUtil.getPercentAvgIndexWithPercent(new BigDecimal(i), new BigDecimal(vodDictDOS.size()));
+ classSignVO.setPercent(percent);
+
+ //签到次数
+ Integer count = signInRecordMapper.selectCount(new QueryWrapper()
+ .lambda()
+ .eq(SignInRecordDO::getStudentId, classSignVO.getId())
+ .eq(SignInRecordDO::getClassId, classDetailDTO.getId()));
+ classSignVO.setSignCounts(count);
+
+ //培训时长
+ classSignVO.setTrainingLength(i);
+ }
+ classSignVOIPage.setRecords(classSignVOS);
+ return classSignVOIPage;
+ }
+
+ public List exportSignDetail(ClassDetailDTO classDetailDTO) {
+ Page pager = new Page(1, 1000000);
+
+ IPage classSignVOIPage = this.baseMapper.classSign(pager, classDetailDTO.getId(), classDetailDTO.getUserName());
+ List classSignVOS = classSignVOIPage.getRecords();
+
+ //课程由多少个视频
+ List vodDictDOS = classDictMapper.getClassVods(classDetailDTO.getId());
+
+ for (ClassSignVO classSignVO : classSignVOS) {
+
+ //全部视频数
+ //classSignVO.setAllVodCounts(vodDictDOS.size());
+
+ //该学生完成了多少个
+ int i = 0;
+
+ //该成员完成了几个视频
+ for (VodDictDO vodDictDO : vodDictDOS) {
+ List vodPlayHistoryDOS = vodPlayHistoryMapper.selectList(new QueryWrapper()
+ .lambda()
+ .eq(VodPlayHistoryDO::getMemberId, classSignVO.getId())
+ .eq(VodPlayHistoryDO::getVodId, vodDictDO.getId())
+ .orderByDesc(VodPlayHistoryDO::getPlayRecord));
+
+ if (vodPlayHistoryDOS.size() > 0) {
+ if (vodPlayHistoryDOS.get(0).getPlayRecord() > vodDictDO.getVodLength() * 0.8) {
+ i++;
+ }
+ }
+ }
+ //classSignVO.setStudyVodCounts(i);
+ classSignVO.setClassProcess(i + "/" + vodDictDOS.size());
+
+ //完成率
+ String percent = MathUtil.getPercentAvgIndexWithPercent(new BigDecimal(i), new BigDecimal(vodDictDOS.size()));
+ classSignVO.setPercent(percent);
+
+ //签到次数
+ Integer count = signInRecordMapper.selectCount(new QueryWrapper()
+ .lambda()
+ .eq(SignInRecordDO::getStudentId, classSignVO.getId())
+ .eq(SignInRecordDO::getClassId, classDetailDTO.getId()));
+ classSignVO.setSignCounts(count);
+
+ //培训时长
+ classSignVO.setTrainingLength(i);
+ }
+ return classSignVOS;
+ }
+
+
+ public IPage exerciseTest(ClassDetailDTO classDetailDTO) {
+
+ Page pager = new Page(classDetailDTO.getPageNum(), classDetailDTO.getPageSize());
+
+ IPage exerciseTestVOIPage = this.baseMapper.exerciseTest(pager, classDetailDTO.getId(), classDetailDTO.getUserName());
+ List classSignVOS = exerciseTestVOIPage.getRecords();
+
+ //课程详情
+ ClassDictDO classDictDO = classDictMapper.selectById(classDetailDTO.getId());
+
+ for (ExerciseTestVO exerciseTestVO : classSignVOS) {
+
+ //学生测试完成情况
+ ExerciseDoneResultDO exerciseDoneResultDO = exerciseDoneResultMapper.selectOne(new QueryWrapper()
+ .lambda()
+ .eq(ExerciseDoneResultDO::getCourseId, classDictDO.getCourseId())
+ .eq(ExerciseDoneResultDO::getMemberId, exerciseTestVO.getId()));
+
+ if (null != exerciseDoneResultDO) {
+ int rights = exerciseDoneResultDO.getRightCounts();
+ int total = exerciseDoneResultDO.getTotalCounts();
+ int score = MathUtil.intDivCeil(rights, total);
+ exerciseTestVO.setScore(score);
+ if (score >= 60) {
+ exerciseTestVO.setResult("通过");
+ } else {
+ exerciseTestVO.setResult("未通过");
+ }
+ } else {
+ exerciseTestVO.setScore(0);
+ exerciseTestVO.setResult("未通过");
+ }
+ }
+ exerciseTestVOIPage.setRecords(classSignVOS);
+ return exerciseTestVOIPage;
+ }
+
+ public List exportExerciseTest(ClassDetailDTO classDetailDTO) {
+ Page pager = new Page(0, 1000000);
+
+ IPage exerciseTestVOIPage = this.baseMapper.exerciseTest(pager, classDetailDTO.getId(), classDetailDTO.getUserName());
+ List exerciseTestVOS = exerciseTestVOIPage.getRecords();
+
+ //课程详情
+ ClassDictDO classDictDO = classDictMapper.selectById(classDetailDTO.getId());
+
+ for (ExerciseTestVO exerciseTestVO : exerciseTestVOS) {
+
+ //学生测试完成情况
+ ExerciseDoneResultDO exerciseDoneResultDO = exerciseDoneResultMapper.selectOne(new QueryWrapper()
+ .lambda()
+ .eq(ExerciseDoneResultDO::getCourseId, classDictDO.getCourseId())
+ .eq(ExerciseDoneResultDO::getMemberId, exerciseTestVO.getId()));
+
+ if (null != exerciseDoneResultDO) {
+ int rights = exerciseDoneResultDO.getRightCounts();
+ int total = exerciseDoneResultDO.getTotalCounts();
+ int score = MathUtil.intDivCeil(rights, total);
+ exerciseTestVO.setScore(score);
+ if (score >= 60) {
+ exerciseTestVO.setResult("通过");
+ } else {
+ exerciseTestVO.setResult("未通过");
+ }
+ } else {
+ exerciseTestVO.setScore(0);
+ exerciseTestVO.setResult("未通过");
+ }
+ }
+
+ return exerciseTestVOS;
+ }
+
+ public IPage answerRecord(ClassDetailDTO classDetailDTO) {
+ Page pager = new Page(classDetailDTO.getPageNum(), classDetailDTO.getPageSize());
+ return this.baseMapper.answerRecord(pager, classDetailDTO.getId(), classDetailDTO.getUserName());
+ }
+
+ public List exportAnswerRecord(ClassDetailDTO classDetailDTO) {
+ Page pager = new Page(1, 1000000);
+ IPage iPage = this.baseMapper.answerRecord(pager, classDetailDTO.getId(), classDetailDTO.getUserName());
+ return iPage.getRecords();
+ }
+
+ public void export(ClassDetailDTO classDetailDTO) throws Exception {
+
+ ServletRequestAttributes servletRequestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
+ HttpServletResponse response = servletRequestAttributes.getResponse();
+ ServletOutputStream sos = response.getOutputStream();
+ ZipOutputStream zipOutputStream = new ZipOutputStream(sos);
+ String zipname = "summary.zip";
+ response.reset();
+ response.setContentType(ALL_VALUE);
+ response.setHeader("Content-Disposition", "attachment;filename=" + new String((zipname).getBytes(), "iso-8859-1"));
+
+ /**
+ * 班级成员
+ */
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ List memberList = Arrays.asList(new String[]{"成员名称", "账号", "联系方式", "签到次数", "课程进度", "培训时长", "评级测试", "答疑"});
+ List classDetailVOS = exportClassDetail(classDetailDTO);
+ membersListExcel("班级成员", memberList, classDetailVOS, null, 0, baos);
+ compressFileToZipStream(zipOutputStream, baos, "member.xlsx");
+
+ /**
+ * 注册签到
+ */
+ ByteArrayOutputStream baos1 = new ByteArrayOutputStream();
+ List signList = Arrays.asList(new String[]{"成员名称", "签到次数", "培训时长", "课程进度", "完成率"});
+ List classSignVOS = exportSignDetail(classDetailDTO);
+ signListExcel("注册签到", signList, classSignVOS, null, 0, baos1);
+ compressFileToZipStream(zipOutputStream, baos1, "sign.xlsx");
+
+ /**
+ * 测试成绩
+ */
+ ByteArrayOutputStream baos2 = new ByteArrayOutputStream();
+ List scoreList = Arrays.asList(new String[]{"成员名称", "测试结果", "最高分"});
+ List exerciseTestVOS = exportExerciseTest(classDetailDTO);
+ testListExcel("测试成绩", scoreList, exerciseTestVOS, null, 0, baos2);
+ compressFileToZipStream(zipOutputStream, baos2, "test.xlsx");
+
+ /**
+ * 答疑记录
+ */
+ ByteArrayOutputStream baos3 = new ByteArrayOutputStream();
+ List answerList = Arrays.asList(new String[]{"提问", "答疑", "提问时间", "提问成员", "答疑时间"});
+ List answerRecordVOS = exportAnswerRecord(classDetailDTO);
+ askListExcel("答疑记录", answerList, answerRecordVOS, null, 0, baos3);
+ compressFileToZipStream(zipOutputStream, baos3, "answer.xlsx");
+
+ zipOutputStream.flush();
+ zipOutputStream.closeEntry();
+
+ baos.close();
+ baos1.close();
+ baos2.close();
+ baos3.close();
+
+ zipOutputStream.flush();
+ zipOutputStream.close();
+
+ sos.close();
+
+ }
+
+ public static void membersListExcel(String title, List headList, List classDetailVOS, String datePattern, int colWidth, OutputStream out) {
+ if (datePattern == null) {
+ datePattern = "yyyy年MM月dd日";
+ }
+ // 声明一个工作薄
+ SXSSFWorkbook workbook = new SXSSFWorkbook(1000);//缓存
+ workbook.setCompressTempFiles(true);
+ //表头样式
+ CellStyle titleStyle = workbook.createCellStyle();
+ titleStyle.setAlignment(HSSFCellStyle.ALIGN_CENTER);
+ Font titleFont = workbook.createFont();
+ titleFont.setFontHeightInPoints((short) 20);
+ titleFont.setBoldweight((short) 700);
+ titleStyle.setFont(titleFont);
+ // 列头样式
+ CellStyle headerStyle = workbook.createCellStyle();
+ headerStyle.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND);
+ headerStyle.setBorderBottom(HSSFCellStyle.BORDER_THIN);
+ headerStyle.setBorderLeft(HSSFCellStyle.BORDER_THIN);
+ headerStyle.setBorderRight(HSSFCellStyle.BORDER_THIN);
+ headerStyle.setBorderTop(HSSFCellStyle.BORDER_THIN);
+ headerStyle.setAlignment(HSSFCellStyle.ALIGN_CENTER);
+ Font headerFont = workbook.createFont();
+ headerFont.setFontHeightInPoints((short) 12);
+ headerFont.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
+ headerStyle.setFont(headerFont);
+ // 单元格样式
+ CellStyle cellStyle = workbook.createCellStyle();
+ cellStyle.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND);
+ cellStyle.setBorderBottom(HSSFCellStyle.BORDER_THIN);
+ cellStyle.setBorderLeft(HSSFCellStyle.BORDER_THIN);
+ cellStyle.setBorderRight(HSSFCellStyle.BORDER_THIN);
+ cellStyle.setBorderTop(HSSFCellStyle.BORDER_THIN);
+ cellStyle.setAlignment(HSSFCellStyle.ALIGN_CENTER);
+ cellStyle.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);
+ Font cellFont = workbook.createFont();
+ cellFont.setBoldweight(HSSFFont.BOLDWEIGHT_NORMAL);
+ cellStyle.setFont(cellFont);
+ // 生成一个(带标题)表格
+ SXSSFSheet sheet = workbook.createSheet();
+ //设置列宽
+ int minBytes = colWidth < 17 ? 17 : colWidth;//至少字节数
+ int[] arrColWidth = new int[headList.size()];
+ // 产生表格标题行,以及设置列宽
+ String[] headers = new String[headList.size()];
+ int ii = 0;
+ for (int i = 0; i < headList.size(); i++) {
+
+ headers[ii] = headList.get(i);
+
+ int bytes = headList.get(i).getBytes().length;
+ arrColWidth[ii] = bytes < minBytes ? minBytes : bytes;
+ sheet.setColumnWidth(ii, arrColWidth[ii] * 256);
+ ii++;
+ }
+ // 遍历集合数据,产生数据行
+ int rowIndex = 0;
+ for (ClassDetailVO classDetailVO : classDetailVOS) {
+ if (rowIndex == 65535 || rowIndex == 0) {
+ if (rowIndex != 0) {
+ sheet = workbook.createSheet();//如果数据超过了,则在第二页显示
+ }
+ SXSSFRow titleRow = sheet.createRow(0);//表头 rowIndex=0
+ titleRow.createCell(0).setCellValue(title);
+ titleRow.getCell(0).setCellStyle(titleStyle);
+ sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, headList.size() - 1));
+
+ SXSSFRow headerRow = sheet.createRow(1); //列头 rowIndex =1
+ for (int i = 0; i < headers.length; i++) {
+ headerRow.createCell(i).setCellValue(headers[i]);
+ headerRow.getCell(i).setCellStyle(headerStyle);
+
+ }
+ rowIndex = 2;//数据内容从 rowIndex=2开始
+ }
+
+ SXSSFRow dataRow = sheet.createRow(rowIndex);
+
+ SXSSFCell newCell = dataRow.createCell(0);
+ newCell.setCellStyle(cellStyle);
+ newCell.setCellValue(classDetailVO.getUserName());
+
+ newCell = dataRow.createCell(1);
+ newCell.setCellValue(classDetailVO.getAccountName());
+
+ newCell = dataRow.createCell(2);
+ newCell.setCellValue(classDetailVO.getTelephone());
+
+ newCell = dataRow.createCell(3);
+ newCell.setCellValue(classDetailVO.getSignCounts());
+
+ newCell = dataRow.createCell(4);
+ newCell.setCellValue(classDetailVO.getClassProcess());
+
+ newCell = dataRow.createCell(5);
+ newCell.setCellValue(classDetailVO.getTrainingLength());
+
+ newCell = dataRow.createCell(6);
+ newCell.setCellValue(classDetailVO.getScore());
+
+ newCell = dataRow.createCell(7);
+ newCell.setCellValue(classDetailVO.getAskCounts());
+
+ rowIndex++;
+ }
+ // 自动调整宽度
+ /*for (int i = 0; i < headers.length; i++) {
+ sheet.autoSizeColumn(i);
+ }*/
+ try {
+ workbook.write(out);
+ workbook.close();
+ workbook.dispose();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+
+ public static void signListExcel(String title, List headList, List classSignVOS, String datePattern, int colWidth, OutputStream out) {
+ if (datePattern == null) {
+ datePattern = "yyyy年MM月dd日";
+ }
+ // 声明一个工作薄
+ SXSSFWorkbook workbook = new SXSSFWorkbook(1000);//缓存
+ workbook.setCompressTempFiles(true);
+ //表头样式
+ CellStyle titleStyle = workbook.createCellStyle();
+ titleStyle.setAlignment(HSSFCellStyle.ALIGN_CENTER);
+ Font titleFont = workbook.createFont();
+ titleFont.setFontHeightInPoints((short) 20);
+ titleFont.setBoldweight((short) 700);
+ titleStyle.setFont(titleFont);
+ // 列头样式
+ CellStyle headerStyle = workbook.createCellStyle();
+ headerStyle.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND);
+ headerStyle.setBorderBottom(HSSFCellStyle.BORDER_THIN);
+ headerStyle.setBorderLeft(HSSFCellStyle.BORDER_THIN);
+ headerStyle.setBorderRight(HSSFCellStyle.BORDER_THIN);
+ headerStyle.setBorderTop(HSSFCellStyle.BORDER_THIN);
+ headerStyle.setAlignment(HSSFCellStyle.ALIGN_CENTER);
+ Font headerFont = workbook.createFont();
+ headerFont.setFontHeightInPoints((short) 12);
+ headerFont.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
+ headerStyle.setFont(headerFont);
+ // 单元格样式
+ CellStyle cellStyle = workbook.createCellStyle();
+ cellStyle.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND);
+ cellStyle.setBorderBottom(HSSFCellStyle.BORDER_THIN);
+ cellStyle.setBorderLeft(HSSFCellStyle.BORDER_THIN);
+ cellStyle.setBorderRight(HSSFCellStyle.BORDER_THIN);
+ cellStyle.setBorderTop(HSSFCellStyle.BORDER_THIN);
+ cellStyle.setAlignment(HSSFCellStyle.ALIGN_CENTER);
+ cellStyle.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);
+ Font cellFont = workbook.createFont();
+ cellFont.setBoldweight(HSSFFont.BOLDWEIGHT_NORMAL);
+ cellStyle.setFont(cellFont);
+ // 生成一个(带标题)表格
+ SXSSFSheet sheet = workbook.createSheet();
+ //设置列宽
+ int minBytes = colWidth < 17 ? 17 : colWidth;//至少字节数
+ int[] arrColWidth = new int[headList.size()];
+ // 产生表格标题行,以及设置列宽
+ String[] headers = new String[headList.size()];
+ int ii = 0;
+ for (int i = 0; i < headList.size(); i++) {
+
+ headers[ii] = headList.get(i);
+
+ int bytes = headList.get(i).getBytes().length;
+ arrColWidth[ii] = bytes < minBytes ? minBytes : bytes;
+ sheet.setColumnWidth(ii, arrColWidth[ii] * 256);
+ ii++;
+ }
+ // 遍历集合数据,产生数据行
+ int rowIndex = 0;
+ for (ClassSignVO classSignVO : classSignVOS) {
+ if (rowIndex == 65535 || rowIndex == 0) {
+ if (rowIndex != 0) {
+ sheet = workbook.createSheet();//如果数据超过了,则在第二页显示
+ }
+ SXSSFRow titleRow = sheet.createRow(0);//表头 rowIndex=0
+ titleRow.createCell(0).setCellValue(title);
+ titleRow.getCell(0).setCellStyle(titleStyle);
+ sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, headList.size() - 1));
+
+ SXSSFRow headerRow = sheet.createRow(1); //列头 rowIndex =1
+ for (int i = 0; i < headers.length; i++) {
+ headerRow.createCell(i).setCellValue(headers[i]);
+ headerRow.getCell(i).setCellStyle(headerStyle);
+
+ }
+ rowIndex = 2;//数据内容从 rowIndex=2开始
+ }
+
+ SXSSFRow dataRow = sheet.createRow(rowIndex);
+
+ SXSSFCell newCell = dataRow.createCell(0);
+ newCell.setCellStyle(cellStyle);
+ newCell.setCellValue(classSignVO.getUserName());
+
+ newCell = dataRow.createCell(1);
+ newCell.setCellValue(classSignVO.getSignCounts());
+
+ newCell = dataRow.createCell(2);
+ newCell.setCellValue(classSignVO.getTrainingLength());
+
+ newCell = dataRow.createCell(3);
+ newCell.setCellValue(classSignVO.getClassProcess());
+
+ newCell = dataRow.createCell(4);
+ newCell.setCellValue(classSignVO.getPercent());
+
+ rowIndex++;
+ }
+ // 自动调整宽度
+ /*for (int i = 0; i < headers.length; i++) {
+ sheet.autoSizeColumn(i);
+ }*/
+ try {
+ workbook.write(out);
+ workbook.close();
+ workbook.dispose();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+
+ public static void testListExcel(String title, List headList, List exerciseTestVOS, String datePattern, int colWidth, OutputStream out) {
+ if (datePattern == null) {
+ datePattern = "yyyy年MM月dd日";
+ }
+ // 声明一个工作薄
+ SXSSFWorkbook workbook = new SXSSFWorkbook(1000);//缓存
+ workbook.setCompressTempFiles(true);
+ //表头样式
+ CellStyle titleStyle = workbook.createCellStyle();
+ titleStyle.setAlignment(HSSFCellStyle.ALIGN_CENTER);
+ Font titleFont = workbook.createFont();
+ titleFont.setFontHeightInPoints((short) 20);
+ titleFont.setBoldweight((short) 700);
+ titleStyle.setFont(titleFont);
+ // 列头样式
+ CellStyle headerStyle = workbook.createCellStyle();
+ headerStyle.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND);
+ headerStyle.setBorderBottom(HSSFCellStyle.BORDER_THIN);
+ headerStyle.setBorderLeft(HSSFCellStyle.BORDER_THIN);
+ headerStyle.setBorderRight(HSSFCellStyle.BORDER_THIN);
+ headerStyle.setBorderTop(HSSFCellStyle.BORDER_THIN);
+ headerStyle.setAlignment(HSSFCellStyle.ALIGN_CENTER);
+ Font headerFont = workbook.createFont();
+ headerFont.setFontHeightInPoints((short) 12);
+ headerFont.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
+ headerStyle.setFont(headerFont);
+ // 单元格样式
+ CellStyle cellStyle = workbook.createCellStyle();
+ cellStyle.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND);
+ cellStyle.setBorderBottom(HSSFCellStyle.BORDER_THIN);
+ cellStyle.setBorderLeft(HSSFCellStyle.BORDER_THIN);
+ cellStyle.setBorderRight(HSSFCellStyle.BORDER_THIN);
+ cellStyle.setBorderTop(HSSFCellStyle.BORDER_THIN);
+ cellStyle.setAlignment(HSSFCellStyle.ALIGN_CENTER);
+ cellStyle.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);
+ Font cellFont = workbook.createFont();
+ cellFont.setBoldweight(HSSFFont.BOLDWEIGHT_NORMAL);
+ cellStyle.setFont(cellFont);
+ // 生成一个(带标题)表格
+ SXSSFSheet sheet = workbook.createSheet();
+ //设置列宽
+ int minBytes = colWidth < 17 ? 17 : colWidth;//至少字节数
+ int[] arrColWidth = new int[headList.size()];
+ // 产生表格标题行,以及设置列宽
+ String[] headers = new String[headList.size()];
+ int ii = 0;
+ for (int i = 0; i < headList.size(); i++) {
+
+ headers[ii] = headList.get(i);
+
+ int bytes = headList.get(i).getBytes().length;
+ arrColWidth[ii] = bytes < minBytes ? minBytes : bytes;
+ sheet.setColumnWidth(ii, arrColWidth[ii] * 256);
+ ii++;
+ }
+ // 遍历集合数据,产生数据行
+ int rowIndex = 0;
+ for (ExerciseTestVO exerciseTestVO : exerciseTestVOS) {
+ if (rowIndex == 65535 || rowIndex == 0) {
+ if (rowIndex != 0) {
+ sheet = workbook.createSheet();//如果数据超过了,则在第二页显示
+ }
+ SXSSFRow titleRow = sheet.createRow(0);//表头 rowIndex=0
+ titleRow.createCell(0).setCellValue(title);
+ titleRow.getCell(0).setCellStyle(titleStyle);
+ sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, headList.size() - 1));
+
+ SXSSFRow headerRow = sheet.createRow(1); //列头 rowIndex =1
+ for (int i = 0; i < headers.length; i++) {
+ headerRow.createCell(i).setCellValue(headers[i]);
+ headerRow.getCell(i).setCellStyle(headerStyle);
+
+ }
+ rowIndex = 2;//数据内容从 rowIndex=2开始
+ }
+
+ SXSSFRow dataRow = sheet.createRow(rowIndex);
+
+ SXSSFCell newCell = dataRow.createCell(0);
+ newCell.setCellStyle(cellStyle);
+ newCell.setCellValue(exerciseTestVO.getUserName());
+
+ newCell = dataRow.createCell(1);
+ newCell.setCellValue(exerciseTestVO.getResult());
+
+ newCell = dataRow.createCell(2);
+ newCell.setCellValue(exerciseTestVO.getScore());
+
+ rowIndex++;
+ }
+ // 自动调整宽度
+ /*for (int i = 0; i < headers.length; i++) {
+ sheet.autoSizeColumn(i);
+ }*/
+ try {
+ workbook.write(out);
+ workbook.close();
+ workbook.dispose();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+
+ public static void askListExcel(String title, List headList, List answerRecordVOS, String datePattern, int colWidth, OutputStream out) {
+ if (datePattern == null) {
+ datePattern = "yyyy年MM月dd日";
+ }
+ // 声明一个工作薄
+ SXSSFWorkbook workbook = new SXSSFWorkbook(1000);//缓存
+ workbook.setCompressTempFiles(true);
+ //表头样式
+ CellStyle titleStyle = workbook.createCellStyle();
+ titleStyle.setAlignment(HSSFCellStyle.ALIGN_CENTER);
+ Font titleFont = workbook.createFont();
+ titleFont.setFontHeightInPoints((short) 20);
+ titleFont.setBoldweight((short) 700);
+ titleStyle.setFont(titleFont);
+ // 列头样式
+ CellStyle headerStyle = workbook.createCellStyle();
+ headerStyle.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND);
+ headerStyle.setBorderBottom(HSSFCellStyle.BORDER_THIN);
+ headerStyle.setBorderLeft(HSSFCellStyle.BORDER_THIN);
+ headerStyle.setBorderRight(HSSFCellStyle.BORDER_THIN);
+ headerStyle.setBorderTop(HSSFCellStyle.BORDER_THIN);
+ headerStyle.setAlignment(HSSFCellStyle.ALIGN_CENTER);
+ Font headerFont = workbook.createFont();
+ headerFont.setFontHeightInPoints((short) 12);
+ headerFont.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
+ headerStyle.setFont(headerFont);
+ // 单元格样式
+ CellStyle cellStyle = workbook.createCellStyle();
+ cellStyle.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND);
+ cellStyle.setBorderBottom(HSSFCellStyle.BORDER_THIN);
+ cellStyle.setBorderLeft(HSSFCellStyle.BORDER_THIN);
+ cellStyle.setBorderRight(HSSFCellStyle.BORDER_THIN);
+ cellStyle.setBorderTop(HSSFCellStyle.BORDER_THIN);
+ cellStyle.setAlignment(HSSFCellStyle.ALIGN_CENTER);
+ cellStyle.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);
+ Font cellFont = workbook.createFont();
+ cellFont.setBoldweight(HSSFFont.BOLDWEIGHT_NORMAL);
+ cellStyle.setFont(cellFont);
+ // 生成一个(带标题)表格
+ SXSSFSheet sheet = workbook.createSheet();
+ //设置列宽
+ int minBytes = colWidth < 17 ? 17 : colWidth;//至少字节数
+ int[] arrColWidth = new int[headList.size()];
+ // 产生表格标题行,以及设置列宽
+ String[] headers = new String[headList.size()];
+ int ii = 0;
+ for (int i = 0; i < headList.size(); i++) {
+
+ headers[ii] = headList.get(i);
+
+ int bytes = headList.get(i).getBytes().length;
+ arrColWidth[ii] = bytes < minBytes ? minBytes : bytes;
+ sheet.setColumnWidth(ii, arrColWidth[ii] * 256);
+ ii++;
+ }
+ // 遍历集合数据,产生数据行
+ int rowIndex = 0;
+ for (AnswerRecordVO answerRecordVO : answerRecordVOS) {
+ if (rowIndex == 65535 || rowIndex == 0) {
+ if (rowIndex != 0) {
+ sheet = workbook.createSheet();//如果数据超过了,则在第二页显示
+ }
+ SXSSFRow titleRow = sheet.createRow(0);//表头 rowIndex=0
+ titleRow.createCell(0).setCellValue(title);
+ titleRow.getCell(0).setCellStyle(titleStyle);
+ sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, headList.size() - 1));
+
+ SXSSFRow headerRow = sheet.createRow(1); //列头 rowIndex =1
+ for (int i = 0; i < headers.length; i++) {
+ headerRow.createCell(i).setCellValue(headers[i]);
+ headerRow.getCell(i).setCellStyle(headerStyle);
+
+ }
+ rowIndex = 2;//数据内容从 rowIndex=2开始
+ }
+
+ SXSSFRow dataRow = sheet.createRow(rowIndex);
+
+ SXSSFCell newCell = dataRow.createCell(0);
+ newCell.setCellStyle(cellStyle);
+ newCell.setCellValue(answerRecordVO.getTitle());
+
+ newCell = dataRow.createCell(1);
+ newCell.setCellValue(answerRecordVO.getAnswer());
+
+ newCell = dataRow.createCell(2);
+ newCell.setCellValue(answerRecordVO.getCreateDate());
+
+ newCell = dataRow.createCell(3);
+ newCell.setCellValue(answerRecordVO.getUserName());
+
+ newCell = dataRow.createCell(4);
+ newCell.setCellValue(answerRecordVO.getUpdateDate());
+
+ rowIndex++;
+ }
+ // 自动调整宽度
+ /*for (int i = 0; i < headers.length; i++) {
+ sheet.autoSizeColumn(i);
+ }*/
+ try {
+ workbook.write(out);
+ workbook.close();
+ workbook.dispose();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+
+
+ /**
+ * 压缩单个excel文件的输出流 到zip输出流,注意zipOutputStream未关闭,需要交由调用者关闭之
+ *
+ * @param zipOutputStream zip文件的输出流
+ * @param excelOutputStream excel文件的输出流
+ * @param excelFilename 文件名可以带目录,例如 TestDir/test1.xlsx
+ */
+ public static void compressFileToZipStream(ZipOutputStream zipOutputStream,
+ ByteArrayOutputStream excelOutputStream, String excelFilename) {
+ byte[] buf = new byte[1024];
+ try {
+ // Compress the files
+ byte[] content = excelOutputStream.toByteArray();
+ ByteArrayInputStream is = new ByteArrayInputStream(content);
+ BufferedInputStream bis = new BufferedInputStream(is);
+ // Add ZIP entry to output stream.
+ zipOutputStream.putNextEntry(new ZipEntry(excelFilename));
+ // Transfer bytes from the file to the ZIP file
+ int len;
+ while ((len = bis.read(buf)) > 0) {
+ zipOutputStream.write(buf, 0, len);
+ }
+ // Complete the entry
+ //excelOutputStream.close();//关闭excel输出流
+ //zipOutputStream.closeEntry();
+ bis.close();
+ is.close();
+ // Complete the ZIP file
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+
}
diff --git a/src/main/java/com/subsidy/service/impl/AnsweringQuestionServiceImpl.java b/src/main/java/com/subsidy/service/impl/AnsweringQuestionServiceImpl.java
new file mode 100644
index 0000000..fe91fc8
--- /dev/null
+++ b/src/main/java/com/subsidy/service/impl/AnsweringQuestionServiceImpl.java
@@ -0,0 +1,46 @@
+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;
+
+/**
+ *
+ * 问题答疑表 服务实现类
+ *
+ *
+ * @author DengMin
+ * @since 2021-10-14
+ */
+@Service
+public class AnsweringQuestionServiceImpl extends ServiceImpl 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;
+ }
+
+
+}
diff --git a/src/main/java/com/subsidy/service/impl/CategoryServiceImpl.java b/src/main/java/com/subsidy/service/impl/CategoryServiceImpl.java
index 97604dd..dbb014b 100644
--- a/src/main/java/com/subsidy/service/impl/CategoryServiceImpl.java
+++ b/src/main/java/com/subsidy/service/impl/CategoryServiceImpl.java
@@ -25,25 +25,54 @@ import java.util.List;
@Service
public class CategoryServiceImpl extends ServiceImpl implements CategoryService {
- public IPage getCategories(GetCategoriesDTO getCategoriesDTO){
+ public IPage getCategories(GetCategoriesDTO getCategoriesDTO) {
Page pager = new Page(getCategoriesDTO.getPageNum(), getCategoriesDTO.getPageSize());
- return this.baseMapper.selectPage(pager,new QueryWrapper()
- .lambda()
- .like(CategoryDO::getName,getCategoriesDTO.getName()));
+
+ if (null == getCategoriesDTO.getCompanyId()) {
+ return this.baseMapper.selectPage(pager, new QueryWrapper()
+ .lambda()
+ .like(CategoryDO::getName, getCategoriesDTO.getName())
+ .isNull(CategoryDO::getCompanyId));
+ } else {
+ return this.baseMapper.selectPage(pager, new QueryWrapper()
+ .lambda()
+ .like(CategoryDO::getName, getCategoriesDTO.getName())
+ .eq(CategoryDO::getCompanyId, getCategoriesDTO.getCompanyId()));
+ }
+
}
- public List getAll(){
- return this.baseMapper.selectList(null);
+ public List getAll(GetCategoriesDTO getCategoriesDTO) {
+
+ if (null == getCategoriesDTO.getCompanyId()) {
+ return this.baseMapper.selectList(new QueryWrapper()
+ .lambda()
+ .isNull(CategoryDO::getCompanyId));
+ } else {
+ return this.baseMapper.selectList(new QueryWrapper()
+ .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()
- .lambda()
- .eq(CategoryDO::getName,categoryDO.getName()));
+ if (null == categoryDO.getCompanyId()) {
+ count = this.baseMapper.selectCount(new QueryWrapper()
+ .lambda()
+ .like(CategoryDO::getName, categoryDO.getName())
+ .isNull(CategoryDO::getCompanyId));
+ } else {
+ count = this.baseMapper.selectCount(new QueryWrapper()
+ .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
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()
- .lambda()
- .eq(CategoryDO::getName,categoryDO.getName()));
+ .lambda()
+ .eq(CategoryDO::getName, categoryDO.getName()));
- if (count>2){
+ if (count > 2) {
throw new HttpException(90001);
}
diff --git a/src/main/java/com/subsidy/service/impl/ClassDictServiceImpl.java b/src/main/java/com/subsidy/service/impl/ClassDictServiceImpl.java
index c07ef76..aab829f 100644
--- a/src/main/java/com/subsidy/service/impl/ClassDictServiceImpl.java
+++ b/src/main/java/com/subsidy/service/impl/ClassDictServiceImpl.java
@@ -1,10 +1,14 @@
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 getAllClasses(ClassDictDO classDictDO){
+
+ public List 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()
- .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()
+ .lambda()
+ .eq(ClassMemberMappingDO::getClassId, classMemberMappingDO.getClassId())
+ .eq(ClassMemberMappingDO::getMemberId, classMemberMappingDO.getMemberId()));
+ return ConstantUtils.DELETE_SUCCESS;
+ }
+
+ public List getSpareMembers(GetSpareMembersDTO getSpareMembersDTO){
+ return this.baseMapper.getSpareMembers(getSpareMembersDTO);
+ }
+
+ public String addMemberToClass(AddMemberToClassDTO addMemberToClassDTO){
+
+ List 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;
+ }
+
}
diff --git a/src/main/java/com/subsidy/service/impl/CompanyDictServiceImpl.java b/src/main/java/com/subsidy/service/impl/CompanyDictServiceImpl.java
new file mode 100644
index 0000000..6ceb03d
--- /dev/null
+++ b/src/main/java/com/subsidy/service/impl/CompanyDictServiceImpl.java
@@ -0,0 +1,102 @@
+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;
+
+/**
+ *
+ * 企业字典表 服务实现类
+ *
+ *
+ * @author DengMin
+ * @since 2021-10-25
+ */
+@Service
+public class CompanyDictServiceImpl extends ServiceImpl implements CompanyDictService {
+
+
+ @Autowired
+ private AdministerMapper administerMapper;
+
+ public IPage 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()
+ .lambda()
+ .eq(CompanyDictDO::getCompanyName, addCompanyDTO.getAccountName()));
+
+ Integer count1 = administerMapper.selectCount(new QueryWrapper()
+ .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()
+ .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()
+ .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;
+ }
+
+}
diff --git a/src/main/java/com/subsidy/service/impl/CourseContentServiceImpl.java b/src/main/java/com/subsidy/service/impl/CourseContentServiceImpl.java
index 8008bc9..4ce8553 100644
--- a/src/main/java/com/subsidy/service/impl/CourseContentServiceImpl.java
+++ b/src/main/java/com/subsidy/service/impl/CourseContentServiceImpl.java
@@ -1,6 +1,7 @@
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 implements CourseContentService {
- @Autowired
- private VodDictMapper vodDictMapper;
-
public List getContents(CourseContentDO courseContentDO) {
return this.baseMapper.selectList(new QueryWrapper()
.lambda()
@@ -38,5 +36,40 @@ public class CourseContentServiceImpl extends ServiceImpl courseContentDOS = this.baseMapper.selectList(new QueryWrapper()
+ .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 courseContentDOS = this.baseMapper.selectList(new QueryWrapper()
+ .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;
+ }
}
diff --git a/src/main/java/com/subsidy/service/impl/CourseDictServiceImpl.java b/src/main/java/com/subsidy/service/impl/CourseDictServiceImpl.java
index 073d3f7..58cfff2 100644
--- a/src/main/java/com/subsidy/service/impl/CourseDictServiceImpl.java
+++ b/src/main/java/com/subsidy/service/impl/CourseDictServiceImpl.java
@@ -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;
+
/**
*
- * 服务实现类
+ * 服务实现类
*
*
* @author DengMin
@@ -23,13 +34,33 @@ import org.springframework.stereotype.Service;
@Service
public class CourseDictServiceImpl extends ServiceImpl 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()
- .lambda()
- .eq(CourseDictDO::getCourseName,courseDictDO.getCourseName()));
+ if (null != courseDictDO.getCompanyId()) {
+ count = this.baseMapper.selectCount(new QueryWrapper()
+ .lambda()
+ .eq(CourseDictDO::getCourseName, courseDictDO.getCourseName())
+ .isNull(CourseDictDO::getCompanyId));
- if (count >0){
+ } else {
+ count = this.baseMapper.selectCount(new QueryWrapper()
+ .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()
- .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()
+ .lambda()
+ .eq(CourseDictDO::getCourseName, courseDictDO.getCourseName())
+ .ne(CourseDictDO::getId, courseDictDO.getCompanyId()));
+
+ } else {
+ count = this.baseMapper.selectCount(new QueryWrapper()
+ .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 roleAdministerMappingDOS = roleAdministerMappingMapper.selectList(new QueryWrapper()
+ //.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 longs = new ArrayList<>();
+ //if (flag){
+ // //运营者账号 该企业下的所有课程 管理员
+ // //获取该企业下所有老师的课程
+ // AdministerDO administerDO = administerMapper.selectById(queryCoursesDTO.getAdministerId());
+ //
+ // List administerDOS = administerMapper.selectList(new QueryWrapper()
+ // .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());
+ //}
+
+ }
+
}
diff --git a/src/main/java/com/subsidy/service/impl/ExerciseDictServiceImpl.java b/src/main/java/com/subsidy/service/impl/ExerciseDictServiceImpl.java
index 6473d47..ffd3268 100644
--- a/src/main/java/com/subsidy/service/impl/ExerciseDictServiceImpl.java
+++ b/src/main/java/com/subsidy/service/impl/ExerciseDictServiceImpl.java
@@ -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 implements ExerciseDictService {
+ @Autowired
+ private ExerciseDoneResultMapper exerciseDoneResultMapper;
+
public IPage getAllExercises(GetAllExercisesDTO getAllExercisesDTO) {
Page pager = new Page(getAllExercisesDTO.getPageNum(), getAllExercisesDTO.getPageSize());
@@ -34,7 +45,7 @@ public class ExerciseDictServiceImpl extends ServiceImpl getCourseExercises(CourseDictDO courseDictDO){
+
+ List exerciseVOS = new ArrayList<>();
+
+ List exerciseDictDOS = this.baseMapper.selectList(new QueryWrapper()
+ .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 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()
+ .lambda()
+ .eq(ExerciseDoneResultDO::getMemberId,submitDTO.getMemberId())
+ .eq(ExerciseDoneResultDO::getCourseId,submitDTO.getCourseId()));
+
+ exerciseDoneResultMapper.insert(exerciseDoneResultDO);
+
+ return ConstantUtils.COMMIT_SUCCESS;
+ }
+
}
diff --git a/src/main/java/com/subsidy/service/impl/ExerciseDoneResultServiceImpl.java b/src/main/java/com/subsidy/service/impl/ExerciseDoneResultServiceImpl.java
new file mode 100644
index 0000000..3575d56
--- /dev/null
+++ b/src/main/java/com/subsidy/service/impl/ExerciseDoneResultServiceImpl.java
@@ -0,0 +1,20 @@
+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;
+
+/**
+ *
+ * 学生课程习题完成情况 服务实现类
+ *
+ *
+ * @author DengMin
+ * @since 2021-10-15
+ */
+@Service
+public class ExerciseDoneResultServiceImpl extends ServiceImpl implements ExerciseDoneResultService {
+
+}
diff --git a/src/main/java/com/subsidy/service/impl/MemberServiceImpl.java b/src/main/java/com/subsidy/service/impl/MemberServiceImpl.java
index 2ec38f9..ef51d11 100644
--- a/src/main/java/com/subsidy/service/impl/MemberServiceImpl.java
+++ b/src/main/java/com/subsidy/service/impl/MemberServiceImpl.java
@@ -4,13 +4,28 @@ 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.common.exception.HttpException;
+import com.subsidy.dto.administer.VerifyCodeDTO;
+import com.subsidy.dto.member.ContentMemberDTO;
import com.subsidy.dto.member.GetAllDTO;
-import com.subsidy.model.MemberDO;
-import com.subsidy.mapper.MemberMapper;
+import com.subsidy.dto.member.StudyHistoryDTO;
+import com.subsidy.mapper.*;
+import com.subsidy.model.*;
import com.subsidy.service.MemberService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.subsidy.util.ConstantUtils;
+import com.subsidy.util.MathUtil;
+import com.subsidy.vo.administer.UserRoleVO;
+import com.subsidy.vo.member.*;
+import com.subsidy.vo.vod.StudyHistoryVO;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.time.Duration;
+import java.time.LocalDateTime;
+import java.util.ArrayList;
+import java.util.List;
/**
*
@@ -23,10 +38,50 @@ import org.springframework.stereotype.Service;
@Service
public class MemberServiceImpl extends ServiceImpl implements MemberService {
+ @Autowired
+ private SmsVerifyCodeMapper smsVerifyCodeMapper;
+
+ @Autowired
+ private CourseContentMapper courseContentMapper;
+
+ @Autowired
+ private VodPlayHistoryMapper vodPlayHistoryMapper;
+
+ @Autowired
+ private CourseDictMapper courseDictMapper;
+
+ @Autowired
+ private VodDictMapper vodDictMapper;
+
+ @Autowired
+ private FileDictMapper fileDictMapper;
+
+ @Autowired
+ private ExerciseDoneResultMapper exerciseDoneResultMapper;
+
+ @Autowired
+ private ExerciseDictMapper exerciseDictMapper;
+
+ @Autowired
+ private DepartmentDictMapper departmentDictMapper;
+
+ @Autowired
+ private AdministerMapper administerMapper;
+
+ @Autowired
+ private ClassMemberMappingMapper classMemberMappingMapper;
+
+ @Autowired
+ private ClassDictMapper classDictMapper;
+
+ @Autowired
+ private CompanyDictMapper companyDictMapper;
+
public IPage getAll(GetAllDTO getAllDTO) {
Page pager = new Page(getAllDTO.getPageNum(), getAllDTO.getPageSize());
return this.baseMapper.selectPage(pager, new QueryWrapper()
.lambda()
+ .eq(MemberDO::getDepartmentId,getAllDTO.getDepartmentId())
.like(MemberDO::getUserName, getAllDTO.getUserName())
.like(MemberDO::getStatus, getAllDTO.getStatus()));
}
@@ -49,7 +104,7 @@ public class MemberServiceImpl extends ServiceImpl imple
Integer count1 = this.baseMapper.selectCount(new QueryWrapper()
.lambda()
- .eq(MemberDO::getIdCard, memberDO.getIdCard())
+ .eq(MemberDO::getAccountName, memberDO.getAccountName())
.eq(MemberDO::getDepartmentId, memberDO.getDepartmentId()));
if (count1 > 0) {
@@ -76,7 +131,7 @@ public class MemberServiceImpl extends ServiceImpl imple
Integer count1 = this.baseMapper.selectCount(new QueryWrapper()
.lambda()
- .eq(MemberDO::getIdCard, memberDO.getIdCard())
+ .eq(MemberDO::getAccountName, memberDO.getAccountName())
.eq(MemberDO::getDepartmentId, memberDO.getDepartmentId())
.ne(MemberDO::getId, memberDO.getId()));
@@ -87,4 +142,297 @@ public class MemberServiceImpl extends ServiceImpl imple
return ConstantUtils.SET_SUCCESS;
}
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public UserRoleVO login(VerifyCodeDTO verifyCodeDTO) {
+ UserRoleVO userRoleVO = new UserRoleVO();
+ MemberDO userRoleDO = this.baseMapper.selectOne(new QueryWrapper()
+ .lambda()
+ .eq(MemberDO::getTelephone, verifyCodeDTO.getTelephone()));
+ if (userRoleDO == null) {
+ throw new HttpException(10010);
+ }
+ BeanUtils.copyProperties(userRoleDO, userRoleVO);
+
+ SmsVerifyCodeDO smsCodeDO = smsVerifyCodeMapper.selectOne(new QueryWrapper()
+ .lambda()
+ .eq(SmsVerifyCodeDO::getTelephone, verifyCodeDTO.getTelephone())
+ .eq(SmsVerifyCodeDO::getVerifyCode, verifyCodeDTO.getVerifyCode()));
+ if (smsCodeDO == null) {
+ throw new HttpException(70010);
+ }
+ return userRoleVO;
+ }
+
+ public UserRoleVO passwordLogin(MemberDO memberDO) {
+ UserRoleVO userRoleVO = new UserRoleVO();
+ MemberDO memberDO1 = this.baseMapper.selectOne(new QueryWrapper()
+ .lambda()
+ .eq(MemberDO::getPassword, memberDO.getPassword())
+ .eq(MemberDO::getAccountName, memberDO.getAccountName()));
+ if (memberDO1 == null) {
+ throw new HttpException(10004);
+ }
+ BeanUtils.copyProperties(memberDO1, userRoleVO);
+ return userRoleVO;
+ }
+
+ public String updatePassword(MemberDO memberDO){
+ this.baseMapper.updateById(memberDO);
+ return ConstantUtils.SET_SUCCESS;
+ }
+
+ public MemberStudyPageVO studyPage(MemberDO memberDO) {
+
+ MemberStudyPageVO memberStudyPageVO = new MemberStudyPageVO();
+
+ List studyPageVOS = this.baseMapper.studyPage(memberDO);
+
+ for (StudyPageVO studyPageVO : studyPageVOS) {
+
+ //查看课程下有几节课
+ List vodDictDOS = courseContentMapper.getCourseVods(studyPageVO.getId());
+ studyPageVO.setTotalVods(vodDictDOS.size());
+
+ int i = 0;
+
+ //该成员完成了几个视频
+ for (VodDictDO vodDictDO : vodDictDOS) {
+ List vodPlayHistoryDOS = vodPlayHistoryMapper.selectList(new QueryWrapper()
+ .lambda()
+ .eq(VodPlayHistoryDO::getMemberId, memberDO.getId())
+ .eq(VodPlayHistoryDO::getVodId, vodDictDO.getId())
+ .orderByDesc(VodPlayHistoryDO::getPlayRecord));
+
+ if (vodPlayHistoryDOS.size() > 0) {
+ if (vodPlayHistoryDOS.get(0).getPlayRecord() > vodDictDO.getVodLength() * 0.8) {
+ i++;
+ }
+ }
+ }
+ studyPageVO.setDoneVods(i);
+
+ //该班级课程下有多少人
+ List classMemberMappingDOS = classMemberMappingMapper.selectList(new QueryWrapper()
+ .lambda()
+ .eq(ClassMemberMappingDO::getClassId,studyPageVO.getClassId()));
+ studyPageVO.setTotalMember(classMemberMappingDOS.size());
+
+ //多少人完成
+ int completedCnt = 0;
+ for (ClassMemberMappingDO cmmd : classMemberMappingDOS) {
+
+ Boolean flag = true;
+
+ for (VodDictDO vodDictDO : vodDictDOS) {
+ List vodPlayHistoryDOS = vodPlayHistoryMapper.selectList(new QueryWrapper()
+ .lambda()
+ .eq(VodPlayHistoryDO::getVodId, vodDictDO.getId())
+ .eq(VodPlayHistoryDO::getMemberId, cmmd.getMemberId())
+ .orderByDesc(VodPlayHistoryDO::getPlayRecord));
+ if (vodPlayHistoryDOS.size() > 0) {
+ if (vodPlayHistoryDOS.get(0).getPlayRecord() < vodDictDO.getVodLength()) {
+ flag = false;
+ break;
+ }
+ }
+ }
+ if (flag) {
+ completedCnt++;
+ }
+ }
+ studyPageVO.setDoneMember(completedCnt);
+ }
+
+ memberStudyPageVO.setStudyPageVOS(studyPageVOS);
+
+ MemberDO memberDO1 = this.baseMapper.selectById(memberDO.getId());
+ DepartmentDictDO departmentDictDO = departmentDictMapper.selectById(memberDO1.getDepartmentId());
+ CompanyDictDO companyDictDO = companyDictMapper.selectById(departmentDictDO.getCompanyId());
+ if (null!=companyDictDO){
+ BeanUtils.copyProperties(companyDictDO,memberStudyPageVO);
+ }
+
+ return memberStudyPageVO;
+ }
+
+ public List contentVod(ContentMemberDTO contentVodDTO) {
+
+ List contentVodVOS = new ArrayList<>();
+ List courseContentDOS = courseContentMapper.selectList(new QueryWrapper()
+ .lambda()
+ .eq(CourseContentDO::getCourseId, contentVodDTO.getCourseId())
+ .orderByAsc(CourseContentDO::getOrderNo));
+
+ for (CourseContentDO courseContentDO : courseContentDOS) {
+ ContentVodVO contentVodVO = new ContentVodVO();
+ contentVodVO.setContent(courseContentDO.getContent());
+
+ List memberVodVOS = new ArrayList<>();
+
+ //目录下的视频
+ List vodDictDOS = vodDictMapper.selectList(new QueryWrapper()
+ .lambda()
+ .eq(VodDictDO::getContentId,courseContentDO.getId()));
+ for (VodDictDO vodDictDO : vodDictDOS){
+ MemberVodVO memberVodVO = new MemberVodVO();
+ List vodPlayHistoryDOS = vodPlayHistoryMapper.selectList(new QueryWrapper()
+ .lambda()
+ .eq(VodPlayHistoryDO::getMemberId,contentVodDTO.getMemberId())
+ .eq(VodPlayHistoryDO::getVodId,vodDictDO.getId())
+ .orderByDesc(VodPlayHistoryDO::getPlayRecord));
+
+ memberVodVO.setStatus(false);
+ if (vodPlayHistoryDOS.size()>0){
+ memberVodVO.setPercent(MathUtil.intDivCeil(100*vodPlayHistoryDOS.get(0).getPlayRecord(),vodDictDO.getVodLength()));
+ if (memberVodVO.getPercent()>=80){
+ memberVodVO.setStatus(true);
+ }
+ }else {
+ memberVodVO.setPercent(0);
+ }
+ List vodPlayHistoryDOS1 = vodPlayHistoryMapper.selectList(new QueryWrapper()
+ .lambda()
+ .eq(VodPlayHistoryDO::getMemberId,contentVodDTO.getMemberId())
+ .eq(VodPlayHistoryDO::getVodId,vodDictDO.getId())
+ .orderByDesc(VodPlayHistoryDO::getCreateDate));
+ if (vodPlayHistoryDOS1.size()>0){
+ memberVodVO.setPlayRecord(vodPlayHistoryDOS1.get(0).getPlayRecord());
+ }
+ memberVodVO.setId(vodDictDO.getId());
+ memberVodVO.setVodUrl(vodDictDO.getVodUrl());
+ memberVodVO.setTeacherName(vodDictDO.getTeacherName());
+ memberVodVO.setVodLength(vodDictDO.getVodLength());
+ memberVodVO.setVodName(vodDictDO.getVodName());
+ memberVodVOS.add(memberVodVO);
+ }
+ contentVodVO.setMemberVodVOS(memberVodVOS);
+ contentVodVOS.add(contentVodVO);
+ }
+
+ return contentVodVOS;
+ }
+
+ public List contentFiles(ContentMemberDTO contentMemberDTO){
+
+ List contentFilesVOS = new ArrayList<>();
+
+ List courseContentDOS = courseContentMapper.selectList(new QueryWrapper()
+ .lambda()
+ .eq(CourseContentDO::getCourseId, contentMemberDTO.getCourseId())
+ .orderByAsc(CourseContentDO::getOrderNo));
+
+ for (CourseContentDO courseContentDO : courseContentDOS) {
+
+ ContentFilesVO contentFilesVO = new ContentFilesVO();
+ contentFilesVO.setContent(courseContentDO.getContent());
+
+ List fileDictDOS = fileDictMapper.selectList(new QueryWrapper()
+ .lambda()
+ .eq(FileDictDO::getContentId,courseContentDO.getId()));
+ contentFilesVO.setFileDictDOS(fileDictDOS);
+
+ contentFilesVOS.add(contentFilesVO);
+ }
+
+ return contentFilesVOS;
+ }
+
+ public IPage studyHistory(StudyHistoryDTO studyHistoryDTO){
+ Page pager = new Page(studyHistoryDTO.getPageNum(), studyHistoryDTO.getPageSize());
+
+ IPage iPage = vodPlayHistoryMapper.studyHistory(pager,studyHistoryDTO.getMemberId());
+
+ List studyHistoryVOS = iPage.getRecords();
+
+ for (StudyHistoryVO studyHistoryVO : studyHistoryVOS){
+ if (studyHistoryVO.getPercent()>=80){
+ studyHistoryVO.setStatus(true);
+ }else {
+ studyHistoryVO.setStatus(false);
+ }
+ }
+ iPage.setRecords(studyHistoryVOS);
+
+ return iPage;
+ }
+
+ public GetCourseTestVO getCourseTest(ContentMemberDTO contentMemberDTO){
+
+ GetCourseTestVO getCourseTestVO = new GetCourseTestVO();
+
+ CourseDictDO courseDictDO = courseDictMapper.selectById(contentMemberDTO.getCourseId());
+ getCourseTestVO.setCourseId(courseDictDO.getId());
+ getCourseTestVO.setCourseName(courseDictDO.getCourseName());
+ getCourseTestVO.setDeadline(courseDictDO.getDeadline().toString().replace("T"," "));
+
+ ExerciseDoneResultDO exerciseDoneResultDO = exerciseDoneResultMapper.selectOne(new QueryWrapper()
+ .lambda()
+ .eq(ExerciseDoneResultDO::getCourseId,contentMemberDTO.getCourseId())
+ .eq(ExerciseDoneResultDO::getMemberId,contentMemberDTO.getMemberId()));
+
+ if (null != exerciseDoneResultDO){
+ getCourseTestVO.setRightCount(String.valueOf(exerciseDoneResultDO.getRightCounts()));
+ getCourseTestVO.setTotalCount(String.valueOf(exerciseDoneResultDO.getTotalCounts()));
+ }else {
+ getCourseTestVO.setRightCount("-");
+ //该课程下有多少习题
+ Integer count = exerciseDictMapper.selectCount(new QueryWrapper()
+ .lambda()
+ .eq(ExerciseDictDO::getCourseId,contentMemberDTO.getCourseId()));
+ getCourseTestVO.setTotalCount(String.valueOf(count));
+ }
+ return getCourseTestVO;
+ }
+
+ public GetStudyInfoVO getStudyInfo(MemberDO memberDO){
+
+ GetStudyInfoVO getStudyInfoVO = new GetStudyInfoVO();
+
+ MemberDO memberDO1 = this.baseMapper.selectById(memberDO.getId());
+
+ //第几天
+ long diff = Duration.between(LocalDateTime.now(),memberDO1.getCreateDate()).toDays();
+ getStudyInfoVO.setDiff(diff);
+
+ //已学课程
+ List classMemberMappingDOS = classMemberMappingMapper.selectList(new QueryWrapper