Commit 7697e95a by 涂亚平

测评升级

1 parent 03ff6ba5
Showing with 814 additions and 208 deletions
......@@ -52,60 +52,60 @@ public class AdministerController {
}
@PostMapping("/login")
@ApiOperation("登录接口 accountName password")
@ApiOperation("** 登录接口 accountName password")
public ResponseVO login(@RequestBody AdministerDO administerDO){
return ResponseData.generateCreatedResponse(0,administerService.login(administerDO));
}
@PostMapping("/getPermissions")
@ApiOperation("权限查询")
@ApiOperation("** 权限查询")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO getPermissions() {
return ResponseData.generateCreatedResponse(0, administerService.getPermissions());
}
@PostMapping("/administers")
@ApiOperation("查询所有运营者 { userName pageNum pageSize }")
@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("添加运营者 id userName 名称 accountName 账号 ")
@ApiOperation("** 添加运营者 id userName 名称 accountName 账号 ")
public ResponseVO addAdminister(@RequestBody AdministerDO administerDO){
return ResponseData.generateCreatedResponse(0,administerService.addAdminister(administerDO));
}
@PostMapping("deleteAdminister")
@ApiOperation("添加运营者 id ")
@ApiOperation("** 添加运营者 id ")
public ResponseVO deleteAdminister(@RequestBody AdministerDO administerDO){
return ResponseData.generateCreatedResponse(0,administerService.deleteAdminister(administerDO));
}
@PostMapping("updateAdminister")
@ApiOperation("编辑运营者 id userName 名称 accountName 账号 password")
@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})
@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")
@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")
@ApiOperation("** 班级管理--班级成员--导出 id 班级id userName")
//@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public void exportClassDetail(@RequestBody ClassDetailDTO classDetailDTO)throws Exception{
classDetailDTO.setFlag(true);
......@@ -113,14 +113,14 @@ public class AdministerController {
}
@PostMapping("signDetail")
@ApiOperation("班级管理--注册签到 id 班级id userName")
@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")
@ApiOperation("** 班级管理--注册签到 id 班级id userName")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public void exportSignDetail(@RequestBody ClassDetailDTO classDetailDTO)throws Exception{
classDetailDTO.setFlag(true);
......@@ -128,14 +128,14 @@ public class AdministerController {
}
@PostMapping("exerciseTest")
@ApiOperation("班级管理--测评成绩 id 班级id userName")
@ApiOperation("** 班级管理--测评成绩 id 班级id userName paperId")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO exerciseTest(@RequestBody ClassDetailDTO classDetailDTO){
return ResponseData.generateCreatedResponse(0,administerService.exerciseTest(classDetailDTO));
}
@PostMapping("exportExerciseTest")
@ApiOperation("班级管理--测评成绩 id 班级id userName")
@ApiOperation("** 班级管理--测评成绩 id 班级id userName paperId")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public void exportExerciseTest(@RequestBody ClassDetailDTO classDetailDTO)throws Exception{
classDetailDTO.setFlag(true);
......@@ -143,14 +143,14 @@ public class AdministerController {
}
@PostMapping("answerRecord")
@ApiOperation("班级管理--答疑 id 班级id userName")
@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")
@ApiOperation("** 班级管理--答疑 id 班级id userName")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public void exportAnswerRecord(@RequestBody ClassDetailDTO classDetailDTO)throws Exception{
classDetailDTO.setFlag(true);
......@@ -158,7 +158,7 @@ public class AdministerController {
}
@PostMapping("exportZip")
@ApiOperation("下载压缩包 id 班级id")
@ApiOperation("** 下载压缩包 id 班级id")
@CrossOrigin
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public void exportZip(@RequestBody ClassDetailDTO classDetailDTO)throws Exception{
......@@ -166,7 +166,7 @@ public class AdministerController {
}
@PostMapping("importMember")
@ApiOperation("导入学生 {companyId 公司id file}")
@ApiOperation("** 导入学生 {companyId 公司id file}")
public ResponseVO importMember(Long companyId,@RequestParam("file") MultipartFile file){
return ResponseData.generateCreatedResponse(0,administerService.importMember(companyId,file));
}
......
......@@ -29,25 +29,25 @@ public class AnsweringQuestionController {
private AnsweringQuestionService answeringQuestionService;
@PostMapping("getCourseQuestion")
@ApiOperation("获取某个课程的答疑 {classId pageSize pageNum memberId}")
@ApiOperation("** 获取某个课程的答疑 {classId pageSize pageNum memberId}")
public ResponseVO getCourseQuestion(@RequestBody GetCourseQuestionDTO getCourseQuestionDTO){
return ResponseData.generateCreatedResponse(0,answeringQuestionService.getCourseQuestion(getCourseQuestionDTO));
}
@PostMapping("addQuestion")
@ApiOperation("新增答疑 {classId askId title}")
@ApiOperation("** 新增答疑 {classId askId title}")
public ResponseVO addQuestion(@RequestBody AnsweringQuestionDO answeringQuestionDO){
return ResponseData.generateCreatedResponse(0,answeringQuestionService.addQuestion(answeringQuestionDO));
}
@PostMapping("deleteQuestion")
@ApiOperation("删除答疑 {id}")
@ApiOperation("** 删除答疑 {id}")
public ResponseVO deleteQuestion(@RequestBody AnsweringQuestionDO answeringQuestionDO){
return ResponseData.generateCreatedResponse(0,answeringQuestionService.deleteQuestion(answeringQuestionDO));
}
@PostMapping("updateQuestion")
@ApiOperation("编辑答疑 {id answerId answer}")
@ApiOperation("** 编辑答疑 {id answerId answer}")
public ResponseVO updateQuestion(@RequestBody AnsweringQuestionDO answeringQuestionDO){
return ResponseData.generateCreatedResponse(0, answeringQuestionService.updateQuestion(answeringQuestionDO));
}
......
......@@ -54,7 +54,7 @@ public class CategoryController {
}
@PostMapping("deleteCategory")
@ApiOperation("删除类目 id")
@ApiOperation("删除类目 ** id")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO deleteCategory(@RequestBody CategoryDO categoryDO){
return ResponseData.generateCreatedResponse(0,categoryService.deleteCategory(categoryDO));
......
......@@ -46,7 +46,7 @@ public class ClassDictController {
}
@PostMapping("deleteClasses")
@ApiOperation("删除课程 id")
@ApiOperation("** 删除课程 id")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO deleteClasses(@RequestBody ClassDictDO classDictDO){
return ResponseData.generateCreatedResponse(0,classDictService.deleteClasses(classDictDO));
......@@ -67,14 +67,14 @@ public class ClassDictController {
}
@PostMapping("classDetail")
@ApiOperation("获取一个班级详情 id")
@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")
@ApiOperation("** 移除班级 classId 班级id memberId人员id")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO removeMember(@RequestBody ClassMemberMappingDO classMemberMappingDO){
return ResponseData.generateCreatedResponse(0,classDictService.removeMember(classMemberMappingDO));
......@@ -88,7 +88,7 @@ public class ClassDictController {
}
@PostMapping("addMemberToClass")
@ApiOperation("将某个成员加入到某个班级里 classId memberIds []")
@ApiOperation("** 将某个成员加入到某个班级里 classId memberIds []")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO addMemberToClass(@RequestBody AddMemberToClassDTO addMemberToClassDTO){
return ResponseData.generateCreatedResponse(0,classDictService.addMemberToClass(addMemberToClassDTO));
......@@ -96,7 +96,7 @@ public class ClassDictController {
@PostMapping("batchSms")
@ApiOperation("批量发送班级短信 {id 班级id}")
@ApiOperation("** 批量发送班级短信 {id 班级id}")
public ResponseVO batchSms(@RequestBody ClassDictDO classDictDO){
return ResponseData.generateCreatedResponse(0,classDictService.batchSms(classDictDO));
}
......
......@@ -31,21 +31,21 @@ public class ClassHourDictController {
private ClassHourDictService classHourDictService;
@PostMapping("getSetting")
@ApiOperation("查看当天设置的最大学习时长 companyId")
@ApiOperation("** 查看当天设置的最大学习时长 companyId")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO getSetting(@RequestBody ClassHourDictDO classHourDictDO){
return ResponseData.generateCreatedResponse(0,classHourDictService.getSetting(classHourDictDO));
}
@PostMapping("updateSetting")
@ApiOperation("修改当天设置时长 id 主键 classHour status")
@ApiOperation("** 修改当天设置时长 id 主键 classHour status")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO updateSetting(@RequestBody ClassHourDictDO classHourDictDO){
return ResponseData.generateCreatedResponse(0,classHourDictService.updateSetting(classHourDictDO));
}
@PostMapping("pollingGet")
@ApiOperation("轮询查询当前这个人当天有没有超过最长时长 memberId playLength")
@ApiOperation("** 轮询查询当前这个人当天有没有超过最长时长 memberId playLength")
public ResponseVO pollingGet(@RequestBody VodPlayHistoryDO vodPlayHistoryDO){
return ResponseData.generateCreatedResponse(0,classHourDictService.pollingGet(vodPlayHistoryDO));
}
......
......@@ -6,6 +6,7 @@ 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.mapper.CompanyDictMapper;
import com.subsidy.model.AdministerDO;
import com.subsidy.model.CompanyDictDO;
import com.subsidy.service.CompanyDictService;
......@@ -36,31 +37,37 @@ public class CompanyDictController {
private CompanyDictService companyDictService;
@PostMapping("/administers")
@ApiOperation("查询所有企业 {id companyName pageNum pageSize }")
@ApiOperation("** 查询所有企业 {id 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:普通成员}")
@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")
@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:普通成员")
@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));
}
@PostMapping("getAllCompany")
@ApiOperation("获取全部企业 {companyName}")
public ResponseVO getAllCompany(@RequestBody CompanyDictDO companyDictDO){
return ResponseData.generateCreatedResponse(0,companyDictService.getAllCompany(companyDictDO));
}
}
......@@ -34,28 +34,28 @@ public class CourseContentController {
private CourseContentService courseContentService;
@PostMapping("getContents")
@ApiOperation("获取课程目录 {courseId}")
@ApiOperation("** 获取课程目录 {courseId}")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO getContents(@RequestBody CourseContentDO courseContentDO){
return ResponseData.generateCreatedResponse(0,courseContentService.getContents(courseContentDO));
}
@PostMapping("deleteContent")
@ApiOperation("删除一个目录 {id} ")
@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}")
@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}")
@ApiOperation("** 更新一个目录 {id courseId content}")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO updateContent(@RequestBody CourseContentDO courseContentDO){
return ResponseData.generateCreatedResponse(0,courseContentService.updateContent(courseContentDO));
......
......@@ -38,14 +38,14 @@ public class CourseDictController {
}
@PostMapping("deleteCourse")
@ApiOperation("删除课程 id")
@ApiOperation("** 删除课程 id")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO deleteCourse(@RequestBody CourseDictDO courseDictDO){
return ResponseData.generateCreatedResponse(0,courseDictService.deleteCourse(courseDictDO));
}
@PostMapping("queryCourses")
@ApiOperation("平台运营者--查询课程 pageSize pageNum administerId companyId courseName categoryId courseType courseSource")
@ApiOperation("** 平台运营者--查询课程 pageSize pageNum administerId companyId courseName categoryId courseType courseSource")
//@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO queryCourses(@RequestBody QueryCoursesDTO queryCoursesDTO){
return ResponseData.generateCreatedResponse(0,courseDictService.queryCourses(queryCoursesDTO));
......
......@@ -33,7 +33,7 @@ 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));
......@@ -47,7 +47,7 @@ public class DepartmentDictController {
}
@PostMapping("deleteDepartment")
@ApiOperation("删除部门 id")
@ApiOperation("** 删除部门 id")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO deleteDepartment(@RequestBody DepartmentDictDO departmentDictDO){
return ResponseData.generateCreatedResponse(0,departmentDictService.deleteDepartment(departmentDictDO));
......
......@@ -5,7 +5,9 @@ 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.GetPaperExerciseDTO;
import com.subsidy.dto.exercise.SubmitDTO;
import com.subsidy.mapper.ExerciseDictMapper;
import com.subsidy.model.CourseDictDO;
import com.subsidy.model.ExerciseDictDO;
import com.subsidy.service.ExerciseDictService;
......@@ -33,14 +35,14 @@ 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));
}
@PostMapping("addExercise")
@ApiOperation("添加题目 {courseId 课程id exerciseType 题目类型 difficulty 难度 title题目 items 选项 rightAnswer 正确答案 }")
@ApiOperation("添加题目 {paperId 试卷id courseId 课程id exerciseType 题目类型 difficulty 难度 title题目 items 选项 rightAnswer 正确答案 }")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO addExercise(@RequestBody ExerciseDictDO exerciseDictDO){
return ResponseData.generateCreatedResponse(0,exerciseDictService.addExercise(exerciseDictDO));
......@@ -61,16 +63,21 @@ public class ExerciseDictController {
}
@PostMapping("getCourseExercises")
@ApiOperation("获取课程的习题 id 课程id")
@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 ]} ")
@ApiOperation("** 提交答案 {memberId 成员id classId课程 courseId 课程id memberExerciseVOS [ id selectAnswer ]} ")
public ResponseVO submit(@RequestBody SubmitDTO submitDTO){
return ResponseData.generateCreatedResponse(0,exerciseDictService.submit(submitDTO));
}
@PostMapping("getPaperExercise")
@ApiOperation("获取某个卷子的所有题目 paperId 卷子id exerciseType 类型 difficulty难度 title题目名称")
public ResponseVO getPaperExercise(@RequestBody GetPaperExerciseDTO getPaperExerciseDTO){
return ResponseData.generateCreatedResponse(0,exerciseDictService.getPaperExercise(getPaperExerciseDTO));
}
}
package com.subsidy.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.Api;
/**
* <p>
* 做题历史记录表 前端控制器
* </p>
*
* @author DengMin
* @since 2021-12-03
*/
@RestController
@Api(tags = "做题历史记录表")
@RequestMapping("/exercise-done-history-do")
public class ExerciseDoneHistoryController {
}
......@@ -34,28 +34,28 @@ public class FileDictController {
private FileDictService fileDictService;
@PostMapping("getContendFiles")
@ApiOperation("获取目录下的视频 {contentId fileName}")
@ApiOperation("** 获取目录下的视频 {contentId fileName}")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO getContendFiles(@RequestBody FileDictDO fileDictDO){
return ResponseData.generateCreatedResponse(0,fileDictService.getContendFiles(fileDictDO));
}
@PostMapping("deleteFile")
@ApiOperation("删除视频 id ")
@ApiOperation("** 删除视频 id ")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO deleteFile(@RequestBody FileDictDO fileDictDO){
return ResponseData.generateCreatedResponse(0,fileDictService.deleteFile(fileDictDO));
}
@PostMapping("addFile")
@ApiOperation("新增视频 contentId fileName fileSize fileType fileUrl")
@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 fileName fileSize fileType fileUrl")
@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));
......
......@@ -5,10 +5,7 @@ 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.AddMemberDTO;
import com.subsidy.dto.member.ContentMemberDTO;
import com.subsidy.dto.member.GetAllDTO;
import com.subsidy.dto.member.StudyHistoryDTO;
import com.subsidy.dto.member.*;
import com.subsidy.model.MemberDO;
import com.subsidy.service.MemberService;
import com.subsidy.util.ConstantUtils;
......@@ -46,22 +43,22 @@ public class MemberController {
}
@PostMapping("deleteMember")
@ApiOperation("删除成员 id ")
@ApiOperation("** 删除成员 id ")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO deleteMember(@RequestBody MemberDO memberDO){
return ResponseData.generateCreatedResponse(0,memberService.deleteMember(memberDO));
}
@PostMapping("addMember")
@ApiOperation("新增成员 departmentId userName accountName telephone gender image idCard")
@ApiOperation("** 新增成员 companyId departmentId userName accountName telephone gender image idCard")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO addMember(@RequestBody AddMemberDTO addMemberDTO){
return ResponseData.generateCreatedResponse(0,memberService.addMember(addMemberDTO));
}
@PostMapping("updateMember")
@ApiOperation("编辑成员 {id departmentId userName accountName telephone gender image idCard status}")
//@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
@ApiOperation("** 编辑成员 {id companyId departmentId userName accountName telephone gender image idCard status}")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO updateMember(@RequestBody AddMemberDTO addMemberDTO){
return ResponseData.generateCreatedResponse(0,memberService.updateMember(addMemberDTO));
}
......@@ -73,49 +70,49 @@ public class MemberController {
}
@PostMapping("passwordLogin")
@ApiOperation("手机端:密码登录 {accountName password}")
public ResponseVO passwordLogin(@RequestBody MemberDO memberDO){
return ResponseData.generateCreatedResponse(0,memberService.passwordLogin(memberDO));
@ApiOperation("手机端:密码登录 { companyId accountName password}")
public ResponseVO passwordLogin(@RequestBody PasswordLoginDTO passwordLoginDTO){
return ResponseData.generateCreatedResponse(0,memberService.passwordLogin(passwordLoginDTO));
}
@PostMapping("updatePassword")
@ApiOperation("修改密码 {id password}")
@ApiOperation("** 修改密码 {id password}")
public ResponseVO updatePassword(@RequestBody MemberDO memberDO){
return ResponseData.generateCreatedResponse(0,memberService.updatePassword(memberDO));
}
@PostMapping("studyPage")
@ApiOperation("手机端:学习主页 id 学员id")
@ApiOperation("** 手机端:学习主页 id 学员id")
public ResponseVO studyPage(@RequestBody MemberDO memberDO){
return ResponseData.generateCreatedResponse(0,memberService.studyPage(memberDO));
}
@PostMapping("contentVod")
@ApiOperation("手机端:目录+视频 courseId 课程 memberId 学员id")
@ApiOperation("** 手机端:目录+视频 courseId 课程 memberId 学员id")
public ResponseVO contentVod(@RequestBody ContentMemberDTO contentVodDTO){
return ResponseData.generateCreatedResponse(0,memberService.contentVod(contentVodDTO));
}
@PostMapping("contentFiles")
@ApiOperation("手机端:目录+课件 courseId 课程 memberId 学员id")
@ApiOperation("** 手机端:目录+课件 courseId 课程 memberId 学员id")
public ResponseVO contentFiles(@RequestBody ContentMemberDTO contentMemberDTO){
return ResponseData.generateCreatedResponse(0,memberService.contentFiles(contentMemberDTO));
}
@PostMapping("studyHistory")
@ApiOperation("学习记录 id 成员id pageSize pageNum")
@ApiOperation("** 学习记录 id 成员id pageSize pageNum")
public ResponseVO studyHistory(@RequestBody StudyHistoryDTO studyHistoryDTO){
return ResponseData.generateCreatedResponse(0,memberService.studyHistory(studyHistoryDTO));
}
@PostMapping("getCourseTest")
@ApiOperation("获取课程下的测试情况 {memberId 成员id courseId 课程id classId}")
@ApiOperation("** 获取课程下的测试情况 {memberId 成员id courseId 课程id classId}")
public ResponseVO getCourseTest(@RequestBody ContentMemberDTO contentMemberDTO){
return ResponseData.generateCreatedResponse(0,memberService.getCourseTest(contentMemberDTO));
}
@PostMapping("getStudyInfo")
@ApiOperation("获取学生完成课程情况 id 学员id")
@ApiOperation("** 获取学生完成课程情况 id 学员id")
public ResponseVO getStudyInfo(@RequestBody MemberDO memberDO){
return ResponseData.generateCreatedResponse(0,memberService.getStudyInfo(memberDO));
}
......
package com.subsidy.controller;
import com.subsidy.common.ResponseData;
import com.subsidy.common.ResponseVO;
import com.subsidy.model.PaperDictDO;
import com.subsidy.service.PaperDictService;
import com.subsidy.util.ConstantUtils;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.Api;
/**
* <p>
* 试卷字典表 前端控制器
* </p>
*
* @author DengMin
* @since 2021-12-03
*/
@RestController
@Api(tags = "试卷字典表")
@RequestMapping("/paper")
public class PaperDictController {
@Autowired
private PaperDictService paperDictService;
@PostMapping("queryPapers")
@ApiOperation("查看课程下的测试 {courseId paperName}")
public ResponseVO queryPapers(@RequestBody PaperDictDO paperDictDO){
return ResponseData.generateCreatedResponse(0,paperDictService.queryPapers(paperDictDO));
}
@PostMapping("deletePaper")
@ApiOperation("删除卷子 {id}")
public ResponseVO deletePaper(@RequestBody PaperDictDO paperDictDO){
return ResponseData.generateCreatedResponse(0,paperDictService.deletePaper(paperDictDO));
}
@PostMapping("update")
@ApiOperation("启用/禁用 {id paperStatus}")
public ResponseVO updateStatus(@RequestBody PaperDictDO paperDictDO){
return ResponseData.generateCreatedResponse(0,paperDictService.updateStatus(paperDictDO));
}
@PostMapping("addPaper")
@ApiOperation("添加卷子 {courseId paperName}")
public ResponseVO addPaper(@RequestBody PaperDictDO paperDictDO){
return ResponseData.generateCreatedResponse(0,paperDictService.addPaper(paperDictDO));
}
}
......@@ -37,26 +37,26 @@ public class SignInRecordController {
private SignInRecordService signInRecordService;
@PostMapping("getMemberSignInfo")
@ApiOperation("获取某个成员的签到记录 id 成员id pageSize pageNum")
@ApiOperation("** 获取某个成员的签到记录 id 成员id pageSize pageNum")
public ResponseVO getMemberSignInfo(@RequestBody GetMemberSignInfoDTO getMemberSignInfoDTO){
return ResponseData.generateCreatedResponse(0,signInRecordService.getMemberSignInfo(getMemberSignInfoDTO));
}
@PostMapping("signIn")
@ApiOperation("签到 memberId")
@ApiOperation("** 签到 memberId")
public ResponseVO signIn(@RequestBody SignInRecordDO signInRecordDO){
return ResponseData.generateCreatedResponse(0,signInRecordService.signIn(signInRecordDO));
}
@PostMapping("classStudyHistory")
@ApiOperation("校区学习记录 id 校区id className courseName pageSize pageNum")
@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));
}
@PostMapping("signInStatus")
@ApiOperation("判断学生当天有没有打卡 {memberId 学生id}")
@ApiOperation("** 判断学生当天有没有打卡 {memberId 学生id}")
public ResponseVO signInStatus(@RequestBody SignInRecordDO signInRecordDO){
return ResponseData.generateCreatedResponse(0,signInRecordService.signInStatus(signInRecordDO));
}
......
......@@ -31,7 +31,7 @@ public class SmsVerifyCodeController {
private SmsVerifyCodeService smsVerifyCodeService;
@PostMapping(value = "/send")
@ApiOperation("发送短信验证码 {telephone} ")
@ApiOperation("** 发送短信验证码 {telephone} ")
public ResponseVO sendVerifyCode(@RequestBody SendVerifyCodeDTO sendVerifyCodeDTO ) {
smsVerifyCodeService.sendVerifyCode(sendVerifyCodeDTO);
return ResponseData.generateCreatedResponse(0);
......
......@@ -34,34 +34,34 @@ public class VodDictController {
private VodDictService vodDictService;
@PostMapping("/signature")
@ApiOperation("获取签名")
@ApiOperation("** 获取签名")
public ResponseVO signature()throws Exception{
return ResponseData.generateCreatedResponse(0,vodDictService.signature());
}
@PostMapping("getContendVods")
@ApiOperation("获取目录下的视频 {contentId vodName}")
@ApiOperation("** 获取目录下的视频 {contentId vodName}")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO getContendVods(@RequestBody GetContendVodsDTO getContendVodsDTO){
return ResponseData.generateCreatedResponse(0,vodDictService.getContendVods(getContendVodsDTO));
}
@PostMapping("deleteVod")
@ApiOperation("删除视频 id ")
@ApiOperation("** 删除视频 id ")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO deleteVod(@RequestBody VodDictDO vodDictDO){
return ResponseData.generateCreatedResponse(0,vodDictService.deleteVod(vodDictDO));
}
@PostMapping("addVod")
@ApiOperation("新增视频 contentId vodName vodLength vodType vodSize vodUrl vodCode")
@ApiOperation("** 新增视频 contentId vodName vodLength vodType vodSize vodUrl vodCode")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO addVod(@RequestBody VodDictDO vodDictDO){
return ResponseData.generateCreatedResponse(0,vodDictService.addVod(vodDictDO));
}
@PostMapping("updateVod")
@ApiOperation("新增视频 id contentId vodName vodLength vodType vodSize vodUrl vodCode")
@ApiOperation("** 新增视频 id contentId vodName vodLength vodType vodSize vodUrl vodCode")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO updateVod(@RequestBody VodDictDO vodDictDO){
return ResponseData.generateCreatedResponse(0,vodDictService.updateVod(vodDictDO));
......
......@@ -32,13 +32,13 @@ public class VodPlayHistoryController {
private VodPlayHistoryService vodPlayHistoryService;
@PostMapping("insertHistory")
@ApiOperation("记录学生看视频位置 ajax请求 classId班级id vodId 视频id memberId 成员id playLength 播放时长 playRecord 位点")
@ApiOperation("** 记录学生看视频位置 ajax请求 classId班级id vodId 视频id memberId 成员id playLength 播放时长 playRecord 位点")
public ResponseVO insertHistory(@RequestBody VodPlayHistoryDO vodPlayHistoryDO){
return ResponseData.generateCreatedResponse(0,vodPlayHistoryService.insertHistory(vodPlayHistoryDO));
}
@RequestMapping("insertHistoryNew")
@ApiOperation("记录学生看视频位置 classId班级id vodId 视频id memberId 成员id playLength 播放时长 playRecord 位点")
@ApiOperation("** 记录学生看视频位置 classId班级id vodId 视频id memberId 成员id playLength 播放时长 playRecord 位点")
public ResponseVO insertHistoryNew(@RequestBody String param){
VodPlayHistoryDO vodPlayHistoryDO = JSON.parseObject(param,VodPlayHistoryDO.class);
return ResponseData.generateCreatedResponse(0,vodPlayHistoryService.insertHistoryNew(vodPlayHistoryDO));
......
......@@ -15,4 +15,6 @@ public class ClassDetailDTO {
Boolean flag;
private Long paperId;
}
package com.subsidy.dto.exercise;
import lombok.Data;
@Data
public class GetPaperExerciseDTO {
private Integer pageSize;
private Integer pageNum;
private Integer difficulty;
private String exerciseType;
private Long paperId;
private String title;
}
package com.subsidy.dto.member;
import com.subsidy.model.MemberDO;
import lombok.Data;
@Data
public class GetAllDTO extends MemberDO {
public class GetAllDTO{
private String userName;
private String status;
private Long departmentId;
private Integer pageNum;
......
package com.subsidy.dto.member;
import lombok.Data;
@Data
public class PasswordLoginDTO {
private Long companyId;
private String accountName;
private String password;
}
......@@ -5,8 +5,11 @@ import com.subsidy.model.AdministerDO;
import com.subsidy.model.CompanyDictDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.subsidy.vo.administer.OperatorsVO;
import com.subsidy.vo.company.GetAllCompanyVO;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* <p>
* 企业字典表 Mapper 接口
......@@ -26,8 +29,8 @@ public interface CompanyDictMapper extends BaseMapper<CompanyDictDO> {
IPage<OperatorsVO> operators(IPage page, String companyName,Integer id, String userName,Integer role);
/**
* 通过企业id查找企业的管理员
* 查找所有的公司名称
*/
AdministerDO getAdministerByCompanyId(Long companyId);
List<GetAllCompanyVO> getAllCompany(CompanyDictDO companyDictDO);
}
package com.subsidy.mapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.subsidy.model.ExerciseDictDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.subsidy.vo.exercise.GetPaperExerciseVO;
import org.springframework.stereotype.Repository;
/**
......@@ -15,4 +17,11 @@ import org.springframework.stereotype.Repository;
@Repository
public interface ExerciseDictMapper extends BaseMapper<ExerciseDictDO> {
/**
* 获取某一套卷子的题目
*/
IPage<GetPaperExerciseVO> getPaperExercise(IPage page,Long paperId,Integer difficulty,String exerciseType,String title);
}
package com.subsidy.mapper;
import com.subsidy.model.ExerciseDoneHistoryDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
/**
* <p>
* 做题历史记录表 Mapper 接口
* </p>
*
* @author DengMin
* @since 2021-12-03
*/
@Repository
public interface ExerciseDoneHistoryMapper extends BaseMapper<ExerciseDoneHistoryDO> {
}
package com.subsidy.mapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.subsidy.dto.member.PasswordLoginDTO;
import com.subsidy.model.DepartmentDictDO;
import com.subsidy.model.MemberDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.subsidy.vo.administer.UserRoleVO;
import com.subsidy.vo.member.GetAllVO;
import com.subsidy.vo.member.StudyPageVO;
import io.swagger.models.auth.In;
......@@ -23,6 +25,12 @@ import java.util.List;
public interface MemberMapper extends BaseMapper<MemberDO> {
/**
* 账号密码登录
*/
UserRoleVO passwordLogin(PasswordLoginDTO passwordLoginDTO);
/**
* 查看学生的课程
*/
List<StudyPageVO> studyPage(MemberDO memberDO);
......
package com.subsidy.mapper;
import com.subsidy.model.PaperDictDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.subsidy.vo.paper.QueryPapersVO;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* <p>
* 试卷字典表 Mapper 接口
* </p>
*
* @author DengMin
* @since 2021-12-03
*/
@Repository
public interface PaperDictMapper extends BaseMapper<PaperDictDO> {
List<QueryPapersVO> queryPapers(PaperDictDO paperDictDO);
}
......@@ -25,6 +25,11 @@ public class ExerciseDictDO extends BaseModel {
@TableId(value = "id", type = IdType.AUTO)
private Long id;
///**
// * 试卷id
// */
//private Long paperId;
/**
* 题目类型:单选/多选/是非
*/
......
package com.subsidy.model;
import com.subsidy.util.BaseModel;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* <p>
* 做题历史记录表
* </p>
*
* @author DengMin
* @since 2021-12-03
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("exercise_done_history")
public class ExerciseDoneHistoryDO extends BaseModel {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
* 卷子id
*/
private Long paperId;
/**
* 学生id
*/
private Long memberId;
/**
* 学习任务id
*/
private Long classId;
/**
* 习题id
*/
private Long exerciseId;
/**
* 做题答案 /已读
*/
private String answer;
/**
* 结果 0:错误 1:正确
*/
private Integer result;
/**
* 看视频/做题时长
*/
private Integer length;
}
......@@ -25,6 +25,11 @@ public class ExerciseDoneResultDO extends BaseModel {
@TableId(value = "id", type = IdType.AUTO)
private Long id;
///**
// * 卷子id
// */
//private Long paperId;
/**
* 成员id
*/
......
......@@ -26,9 +26,9 @@ public class MemberDO extends BaseModel {
private Long id;
/**
* 部门id
* 公司id
*/
private Long departmentId;
private Long companyId;
/**
* 账号
......@@ -66,6 +66,11 @@ public class MemberDO extends BaseModel {
private String idCard;
/**
* 第一次登录
*/
private Integer firstLogin;
/**
* 状态
*/
private String status;
......
package com.subsidy.model;
import com.subsidy.util.BaseModel;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* <p>
* 试卷字典表
* </p>
*
* @author DengMin
* @since 2021-12-03
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("paper_dict")
public class PaperDictDO extends BaseModel {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
* 课程id
*/
private String courseId;
/**
* 卷子名称
*/
private String paperName;
/**
* 启用状态 0 :未启用 1:启用
*/
private Integer paperStatus;
}
......@@ -7,6 +7,10 @@ import com.subsidy.model.AdministerDO;
import com.subsidy.model.CompanyDictDO;
import com.baomidou.mybatisplus.extension.service.IService;
import com.subsidy.vo.administer.OperatorsVO;
import com.subsidy.vo.company.GetAllCompanyVO;
import com.subsidy.vo.member.GetAllVO;
import java.util.List;
/**
* <p>
......@@ -26,4 +30,6 @@ public interface CompanyDictService extends IService<CompanyDictDO> {
String updateAdminister(AddCompanyDTO addCompanyDTO);
List<GetAllCompanyVO> getAllCompany(CompanyDictDO companyDictDO);
}
......@@ -2,6 +2,7 @@ package com.subsidy.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.subsidy.dto.exercise.GetAllExercisesDTO;
import com.subsidy.dto.exercise.GetPaperExerciseDTO;
import com.subsidy.dto.exercise.SubmitDTO;
import com.subsidy.model.CourseDictDO;
import com.subsidy.model.ExerciseDictDO;
......@@ -32,4 +33,5 @@ public interface ExerciseDictService extends IService<ExerciseDictDO> {
String submit(SubmitDTO submitDTO);
IPage getPaperExercise(GetPaperExerciseDTO getPaperExerciseDTO);
}
package com.subsidy.service;
import com.subsidy.model.ExerciseDoneHistoryDO;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 做题历史记录表 服务类
* </p>
*
* @author DengMin
* @since 2021-12-03
*/
public interface ExerciseDoneHistoryService extends IService<ExerciseDoneHistoryDO> {
}
......@@ -2,10 +2,7 @@ package com.subsidy.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.subsidy.dto.administer.VerifyCodeDTO;
import com.subsidy.dto.member.AddMemberDTO;
import com.subsidy.dto.member.ContentMemberDTO;
import com.subsidy.dto.member.GetAllDTO;
import com.subsidy.dto.member.StudyHistoryDTO;
import com.subsidy.dto.member.*;
import com.subsidy.model.MemberDO;
import com.baomidou.mybatisplus.extension.service.IService;
import com.subsidy.vo.administer.UserRoleVO;
......@@ -33,7 +30,7 @@ public interface MemberService extends IService<MemberDO> {
UserRoleVO login(VerifyCodeDTO verifyCodeDTO);
UserRoleVO passwordLogin(MemberDO memberDO);
UserRoleVO passwordLogin(PasswordLoginDTO passwordLoginDTO);
String updatePassword(MemberDO memberDO);
......
package com.subsidy.service;
import com.subsidy.model.PaperDictDO;
import com.baomidou.mybatisplus.extension.service.IService;
import com.subsidy.vo.paper.QueryPapersVO;
import java.util.List;
/**
* <p>
* 试卷字典表 服务类
* </p>
*
* @author DengMin
* @since 2021-12-03
*/
public interface PaperDictService extends IService<PaperDictDO> {
List<QueryPapersVO> queryPapers(PaperDictDO paperDictDO);
String deletePaper(PaperDictDO paperDictDO);
String updateStatus(PaperDictDO paperDictDO);
String addPaper(PaperDictDO paperDictDO);
}
......@@ -269,7 +269,7 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
int passNum = 0;
for (ExerciseDoneResultDO exerciseDoneResultDO : exerciseDoneResultDOS) {
if (exerciseDoneResultDO.getRightCounts() > exerciseDoneResultDO.getTotalCounts() * 0.6) {
if (exerciseDoneResultDO.getRightCounts() >= exerciseDoneResultDO.getTotalCounts() * 0.6) {
passNum++;
}
}
......@@ -798,9 +798,10 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
String accountName = PinyinHelper.toHanYuPinyinString(s.getUserName(), format, "", true);
List<MemberDO> memberDOS = memberMapper.selectList(new QueryWrapper<MemberDO>()
.lambda()
.eq(MemberDO::getAccountName, accountName));
.eq(MemberDO::getAccountName, accountName)
.eq(MemberDO::getCompanyId, companyId));
if (memberDOS.size() > 0) {
String usernames = userName(accountName, 0);
String usernames = userName(accountName, 0, companyId);
memberDO1.setAccountName(usernames);
} else {
memberDO1.setAccountName(accountName);
......@@ -808,6 +809,8 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
} catch (BadHanyuPinyinOutputFormatCombination ex) {
}
memberDO1.setCompanyId(companyId);
memberDO1.setFirstLogin(0);
memberDO1.setTelephone(s.getTelephone());
memberDO1.setIdCard(s.getIdCard());
memberDO1.setStatus("启用");
......@@ -832,13 +835,14 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
return ConstantUtils.ADD_SUCCESS;
}
public String userName(String originName, int i) {
public String userName(String originName, int i, Long companyId) {
i++;
List<MemberDO> memberDOS = memberMapper.selectList(new QueryWrapper<MemberDO>()
.lambda()
.eq(MemberDO::getAccountName, originName + i));
.eq(MemberDO::getAccountName, originName + i)
.eq(MemberDO::getCompanyId, companyId));
if (memberDOS.size() > 0) {
return userName(originName, i);
return userName(originName, i, companyId);
} else {
return originName + i;
}
......
......@@ -19,10 +19,13 @@ 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 com.subsidy.vo.company.GetAllCompanyVO;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* <p>
* 企业字典表 服务实现类
......@@ -131,4 +134,8 @@ public class CompanyDictServiceImpl extends ServiceImpl<CompanyDictMapper, Compa
return ConstantUtils.SET_SUCCESS;
}
public List<GetAllCompanyVO> getAllCompany(CompanyDictDO companyDictDO){
return this.baseMapper.getAllCompany(companyDictDO);
}
}
......@@ -106,37 +106,7 @@ public class CourseDictServiceImpl extends ServiceImpl<CourseDictMapper, CourseD
public IPage queryCompanyCourse(QueryCoursesDTO queryCoursesDTO) {
Page pager = new Page(queryCoursesDTO.getPageNum(), queryCoursesDTO.getPageSize());
////判断角色
//List<RoleAdministerMappingDO> roleAdministerMappingDOS = roleAdministerMappingMapper.selectList(new QueryWrapper<RoleAdministerMappingDO>()
//.lambda()
//.eq(RoleAdministerMappingDO::getAdministerId,roleAdministerMappingMapper));
//
//Boolean flag = false;
//for (RoleAdministerMappingDO roleAdministerMappingDO : roleAdministerMappingDOS){
//
// if (roleAdministerMappingDO.getRoleId() ==3){
// flag= false;
// }else if(roleAdministerMappingDO.getRoleId()==2) {
// flag = true;
// }
//}
//List<Long> longs = new ArrayList<>();
//if (flag){
// //运营者账号 该企业下的所有课程 管理员
// //获取该企业下所有老师的课程
// AdministerDO administerDO = administerMapper.selectById(queryCoursesDTO.getAdministerId());
//
// List<AdministerDO> administerDOS = administerMapper.selectList(new QueryWrapper<AdministerDO>()
// .lambda()
// .eq(AdministerDO::getCompanyId,administerDO.getCompanyId()));
// for (AdministerDO administerDO1 : administerDOS){
// longs.add(administerDO1.getId());
// }
return this.baseMapper.queryCompanyCourse(pager, queryCoursesDTO.getCourseName(), queryCoursesDTO.getCategoryId(), queryCoursesDTO.getCourseType(), queryCoursesDTO.getCourseSource(), queryCoursesDTO.getCompanyId());
//}
}
......
......@@ -3,15 +3,16 @@ package com.subsidy.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.subsidy.dto.exercise.GetAllExercisesDTO;
import com.subsidy.dto.exercise.GetPaperExerciseDTO;
import com.subsidy.dto.exercise.SubmitDTO;
import com.subsidy.mapper.ExerciseDictMapper;
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 com.subsidy.vo.course.ExerciseVO;
import com.subsidy.vo.exercise.MemberExerciseVO;
......@@ -58,51 +59,51 @@ public class ExerciseDictServiceImpl extends ServiceImpl<ExerciseDictMapper, Exe
int orderNo = 1;
if (exerciseDictDOS.size() >0){
orderNo = exerciseDictDOS.get(0).getOrderNo()+1;
if (exerciseDictDOS.size() > 0) {
orderNo = exerciseDictDOS.get(0).getOrderNo() + 1;
}
exerciseDictDO.setOrderNo(orderNo);
this.baseMapper.insert(exerciseDictDO);
return ConstantUtils.ADD_SUCCESS;
}
public String deleteExercise(ExerciseDictDO exerciseDictDO){
public String deleteExercise(ExerciseDictDO exerciseDictDO) {
this.baseMapper.deleteById(exerciseDictDO.getId());
return ConstantUtils.DELETE_SUCCESS;
}
public String updateExercise(ExerciseDictDO exerciseDictDO){
public String updateExercise(ExerciseDictDO exerciseDictDO) {
this.baseMapper.updateById(exerciseDictDO);
return ConstantUtils.SET_SUCCESS;
}
public List<ExerciseVO> getCourseExercises(CourseDictDO courseDictDO){
public List<ExerciseVO> getCourseExercises(CourseDictDO courseDictDO) {
List<ExerciseVO> exerciseVOS = new ArrayList<>();
List<ExerciseDictDO> exerciseDictDOS = this.baseMapper.selectList(new QueryWrapper<ExerciseDictDO>()
.lambda()
.eq(ExerciseDictDO::getCourseId,courseDictDO.getId()));
.lambda()
.eq(ExerciseDictDO::getCourseId, courseDictDO.getId()));
for (ExerciseDictDO exerciseDictDO : exerciseDictDOS){
for (ExerciseDictDO exerciseDictDO : exerciseDictDOS) {
ExerciseVO exerciseVO = new ExerciseVO();
BeanUtils.copyProperties(exerciseDictDO,exerciseVO);
BeanUtils.copyProperties(exerciseDictDO, exerciseVO);
exerciseVOS.add(exerciseVO);
}
return exerciseVOS;
}
public String submit(SubmitDTO submitDTO){
public String submit(SubmitDTO submitDTO) {
ExerciseDoneResultDO exerciseDoneResultDO = new ExerciseDoneResultDO();
List<MemberExerciseVO> memberExerciseVOS = submitDTO.getMemberExerciseVOS();
int rightCounts = 0 ;
int rightCounts = 0;
for (MemberExerciseVO exerciseVO : memberExerciseVOS){
for (MemberExerciseVO exerciseVO : memberExerciseVOS) {
ExerciseDictDO exerciseDictDO = this.baseMapper.selectById(exerciseVO.getId());
if (exerciseDictDO.getRightAnswer().equals(exerciseVO.getSelectAnswer())){
if (exerciseDictDO.getRightAnswer().equals(exerciseVO.getSelectAnswer())) {
rightCounts++;
}
}
......@@ -114,13 +115,18 @@ public class ExerciseDictServiceImpl extends ServiceImpl<ExerciseDictMapper, Exe
exerciseDoneResultDO.setMemberId(submitDTO.getMemberId());
exerciseDoneResultMapper.delete(new QueryWrapper<ExerciseDoneResultDO>()
.lambda()
.eq(ExerciseDoneResultDO::getMemberId,submitDTO.getMemberId())
.eq(ExerciseDoneResultDO::getCourseId,submitDTO.getCourseId()));
.lambda()
.eq(ExerciseDoneResultDO::getMemberId, submitDTO.getMemberId())
.eq(ExerciseDoneResultDO::getCourseId, submitDTO.getCourseId()));
exerciseDoneResultMapper.insert(exerciseDoneResultDO);
return ConstantUtils.COMMIT_SUCCESS;
}
public IPage getPaperExercise(GetPaperExerciseDTO getPaperExerciseDTO) {
Page pager = new Page(getPaperExerciseDTO.getPageNum(), getPaperExerciseDTO.getPageSize());
return this.baseMapper.getPaperExercise(pager,getPaperExerciseDTO.getPaperId(),getPaperExerciseDTO.getDifficulty(),getPaperExerciseDTO.getExerciseType(),getPaperExerciseDTO.getTitle());
}
}
package com.subsidy.service.impl;
import com.subsidy.model.ExerciseDoneHistoryDO;
import com.subsidy.mapper.ExerciseDoneHistoryMapper;
import com.subsidy.service.ExerciseDoneHistoryService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* <p>
* 做题历史记录表 服务实现类
* </p>
*
* @author DengMin
* @since 2021-12-03
*/
@Service
public class ExerciseDoneHistoryServiceImpl extends ServiceImpl<ExerciseDoneHistoryMapper, ExerciseDoneHistoryDO> implements ExerciseDoneHistoryService {
}
......@@ -6,10 +6,7 @@ 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.VerifyCodeDTO;
import com.subsidy.dto.member.AddMemberDTO;
import com.subsidy.dto.member.ContentMemberDTO;
import com.subsidy.dto.member.GetAllDTO;
import com.subsidy.dto.member.StudyHistoryDTO;
import com.subsidy.dto.member.*;
import com.subsidy.mapper.*;
import com.subsidy.model.*;
import com.subsidy.service.MemberService;
......@@ -96,12 +93,12 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, MemberDO> imple
this.baseMapper.deleteById(memberDO.getId());
classMemberMappingMapper.delete(new QueryWrapper<ClassMemberMappingDO>()
.lambda()
.eq(ClassMemberMappingDO::getMemberId,memberDO.getId()));
.lambda()
.eq(ClassMemberMappingDO::getMemberId, memberDO.getId()));
memberDepartmentMappingMapper.delete(new QueryWrapper<MemberDepartmentMappingDO>()
.lambda()
.eq(MemberDepartmentMappingDO::getMemberId,memberDO.getId()));
.lambda()
.eq(MemberDepartmentMappingDO::getMemberId, memberDO.getId()));
return ConstantUtils.DELETE_SUCCESS;
}
......@@ -116,22 +113,29 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, MemberDO> imple
throw new HttpException(20002);
}
//部门
List<Long> longs = addMemberDTO.getDepartmentIds();
Integer count1 = this.baseMapper.selectCount(new QueryWrapper<MemberDO>()
.lambda()
.eq(MemberDO::getAccountName, addMemberDTO.getAccountName()));
.eq(MemberDO::getAccountName, addMemberDTO.getAccountName())
.eq(MemberDO::getCompanyId, addMemberDTO.getCompanyId()));
if (count1 > 0) {
throw new HttpException(20002);
}
MemberDO memberDO = new MemberDO();
BeanUtils.copyProperties(addMemberDTO, memberDO);
memberDO.setPassword("123456");
memberDO.setStatus("启用");
memberDO.setFirstLogin(0);
//公司赋值
memberDO.setCompanyId(addMemberDTO.getCompanyId());
this.baseMapper.insert(memberDO);
//部门
List<Long> longs = addMemberDTO.getDepartmentIds();
for (Long lg : longs) {
MemberDepartmentMappingDO memberDepartmentMappingDO = new MemberDepartmentMappingDO();
memberDepartmentMappingDO.setMemberId(memberDO.getId());
......@@ -144,7 +148,7 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, MemberDO> imple
public String updateMember(AddMemberDTO addMemberDTO) {
if (null!= addMemberDTO.getDepartmentIds()){
if (null != addMemberDTO.getDepartmentIds()) {
Integer count = this.baseMapper.selectCount(new QueryWrapper<MemberDO>()
.lambda()
.eq(MemberDO::getTelephone, addMemberDTO.getTelephone())
......@@ -156,6 +160,7 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, MemberDO> imple
Integer count1 = this.baseMapper.selectCount(new QueryWrapper<MemberDO>()
.lambda()
.eq(MemberDO::getAccountName, addMemberDTO.getAccountName())
.eq(MemberDO::getCompanyId,addMemberDTO.getCompanyId())
.ne(MemberDO::getId, addMemberDTO.getId()));
if (count1 > 0) {
......@@ -167,7 +172,7 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, MemberDO> imple
BeanUtils.copyProperties(addMemberDTO, memberDO);
this.baseMapper.updateById(memberDO);
if (null != addMemberDTO.getDepartmentIds()){
if (null != addMemberDTO.getDepartmentIds()) {
memberDepartmentMappingMapper.delete(new QueryWrapper<MemberDepartmentMappingDO>()
.lambda()
.eq(MemberDepartmentMappingDO::getMemberId, addMemberDTO.getId()));
......@@ -189,18 +194,23 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, MemberDO> imple
@Transactional(rollbackFor = Exception.class)
public UserRoleVO login(VerifyCodeDTO verifyCodeDTO) {
UserRoleVO userRoleVO = new UserRoleVO();
MemberDO userRoleDO = this.baseMapper.selectOne(new QueryWrapper<MemberDO>()
MemberDO memberDO = this.baseMapper.selectOne(new QueryWrapper<MemberDO>()
.lambda()
.eq(MemberDO::getTelephone, verifyCodeDTO.getTelephone()));
if (userRoleDO == null) {
if (memberDO == null) {
throw new HttpException(10010);
}
if ("冻结".equals(userRoleDO.getStatus())){
if ("冻结".equals(memberDO.getStatus())) {
throw new HttpException(10013);
}
BeanUtils.copyProperties(userRoleDO, userRoleVO);
//是否登陆过 1:是 0:否
if (0 == memberDO.getFirstLogin()) {
memberDO.setFirstLogin(1);
this.baseMapper.updateById(memberDO);
}
BeanUtils.copyProperties(memberDO, userRoleVO);
SmsVerifyCodeDO smsCodeDO = smsVerifyCodeMapper.selectOne(new QueryWrapper<SmsVerifyCodeDO>()
.lambda()
......@@ -212,21 +222,17 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, MemberDO> imple
return userRoleVO;
}
public UserRoleVO passwordLogin(MemberDO memberDO) {
UserRoleVO userRoleVO = new UserRoleVO();
MemberDO memberDO1 = this.baseMapper.selectOne(new QueryWrapper<MemberDO>()
.lambda()
.eq(MemberDO::getPassword, memberDO.getPassword())
.eq(MemberDO::getAccountName, memberDO.getAccountName()));
if (memberDO1 == null) {
public UserRoleVO passwordLogin(PasswordLoginDTO passwordLoginDTO) {
UserRoleVO userRoleVO = this.baseMapper.passwordLogin(passwordLoginDTO);
if (userRoleVO == null) {
throw new HttpException(10004);
}
if ("冻结".equals(memberDO1.getStatus())){
if ("冻结".equals(userRoleVO.getStatus())) {
throw new HttpException(10014);
}
BeanUtils.copyProperties(memberDO1, userRoleVO);
if (0 == userRoleVO.getFirstLogin()) {
throw new HttpException(10015);
}
return userRoleVO;
}
......@@ -343,9 +349,9 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, MemberDO> imple
memberVodVO.setStatus(false);
if (vodPlayHistoryDOS.size() > 0) {
int length = MathUtil.intDivCeil(100 * vodPlayHistoryDOS.get(0).getPlayRecord(), vodDictDO.getVodLength());
if (length>=100){
if (length >= 100) {
memberVodVO.setPercent(100);
}else {
} else {
memberVodVO.setPercent(length);
}
if (memberVodVO.getPercent() >= 80) {
......@@ -376,15 +382,15 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, MemberDO> imple
contentVodNewVO.setContentVodVOS(contentVodVOS);
List<VodPlayHistoryDO> vodPlayHistoryDOS = vodPlayHistoryMapper.selectList(new QueryWrapper<VodPlayHistoryDO>()
.lambda()
.eq(VodPlayHistoryDO::getClassId,contentVodDTO.getClassId())
.eq(VodPlayHistoryDO::getMemberId,contentVodDTO.getMemberId())
.orderByDesc(VodPlayHistoryDO::getCreateDate));
if (vodPlayHistoryDOS.size()>0){
.lambda()
.eq(VodPlayHistoryDO::getClassId, contentVodDTO.getClassId())
.eq(VodPlayHistoryDO::getMemberId, contentVodDTO.getMemberId())
.orderByDesc(VodPlayHistoryDO::getCreateDate));
if (vodPlayHistoryDOS.size() > 0) {
VodPlayHistoryDO vodPlayHistoryDO = vodPlayHistoryDOS.get(0);
VodDictDO vodDictDO = vodDictMapper.selectById(vodPlayHistoryDO.getVodId());
if (null!=vodDictDO){
BeanUtils.copyProperties(vodDictDO,contentVodNewVO);
if (null != vodDictDO) {
BeanUtils.copyProperties(vodDictDO, contentVodNewVO);
contentVodNewVO.setPlayRecord(vodPlayHistoryDO.getPlayRecord());
}
}
......@@ -456,10 +462,10 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, MemberDO> imple
getCourseTestVO.setTotalCount(String.valueOf(exerciseDoneResultDO.getTotalCounts()));
//正确率
Integer percent = MathUtil.intDivFloorPercent(exerciseDoneResultDO.getRightCounts(),exerciseDoneResultDO.getTotalCounts());
if(percent>=60){
Integer percent = MathUtil.intDivFloorPercent(exerciseDoneResultDO.getRightCounts(), exerciseDoneResultDO.getTotalCounts());
if (percent >= 60) {
getCourseTestVO.setResult("合格");
}else {
} else {
getCourseTestVO.setResult("不合格");
}
getCourseTestVO.setPercent(String.valueOf(percent));
......@@ -483,7 +489,7 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, MemberDO> imple
MemberDO memberDO1 = this.baseMapper.selectById(memberDO.getId());
//第几天
long diff = Duration.between(memberDO1.getCreateDate(),LocalDateTime.now()).toDays();
long diff = Duration.between(memberDO1.getCreateDate(), LocalDateTime.now()).toDays();
getStudyInfoVO.setDiff(diff);
//已学课程
......
package com.subsidy.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.subsidy.common.exception.HttpException;
import com.subsidy.model.PaperDictDO;
import com.subsidy.mapper.PaperDictMapper;
import com.subsidy.service.PaperDictService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.subsidy.util.ConstantUtils;
import com.subsidy.vo.paper.QueryPapersVO;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* <p>
* 试卷字典表 服务实现类
* </p>
*
* @author DengMin
* @since 2021-12-03
*/
@Service
public class PaperDictServiceImpl extends ServiceImpl<PaperDictMapper, PaperDictDO> implements PaperDictService {
public List<QueryPapersVO> queryPapers(PaperDictDO paperDictDO){
return this.baseMapper.queryPapers(paperDictDO);
}
public String deletePaper(PaperDictDO paperDictDO){
this.baseMapper.deleteById(paperDictDO.getId());
return ConstantUtils.DELETE_SUCCESS;
}
public String updateStatus(PaperDictDO paperDictDO){
this.baseMapper.updateById(paperDictDO);
return ConstantUtils.SET_SUCCESS;
}
public String addPaper(PaperDictDO paperDictDO){
Integer count = this.baseMapper.selectCount(new QueryWrapper<PaperDictDO>()
.lambda()
.eq(PaperDictDO::getCourseId,paperDictDO.getCourseId())
.eq(PaperDictDO::getPaperName,paperDictDO.getPaperName()));
if (count>0){
throw new HttpException(50001);
}
paperDictDO.setPaperStatus(0);
this.baseMapper.insert(paperDictDO);
return ConstantUtils.ADD_SUCCESS;
}
}
......@@ -166,12 +166,11 @@ public class SignInRecordServiceImpl extends ServiceImpl<SignInRecordMapper, Sig
SignInStatusVO signInStatusVO = new SignInStatusVO();
Boolean flag = true;
Boolean flag = true; // 已经签过到了
//获取有效课程
List<ClassDictDO> classDictDOS = classMemberMappingMapper.getMemberClass(signInRecordDO.getMemberId());
for (ClassDictDO classDictDO : classDictDOS) {
Integer count = this.baseMapper.selectCount(new QueryWrapper<SignInRecordDO>()
.lambda()
......@@ -180,13 +179,17 @@ public class SignInRecordServiceImpl extends ServiceImpl<SignInRecordMapper, Sig
.gt(SignInRecordDO::getSignInDate, LocalDate.now()));
if (count == 0) {
flag = false;
flag = false; //没有签到
}
}
signInStatusVO.setStatus(flag);
return signInStatusVO;
}
//public static void main(String[] args) {
// System.out.println(LocalDate.now().plusDays(1));
//}
}
......@@ -11,7 +11,11 @@ public class UserRoleVO {
private String userName;
private String img;
private String image;
private String status;
private Integer firstLogin;
}
package com.subsidy.vo.company;
import lombok.Data;
@Data
public class GetAllCompanyVO {
private Long id;
private String companyName;
}
package com.subsidy.vo.exercise;
import lombok.Data;
@Data
public class GetPaperExerciseVO {
}
package com.subsidy.vo.member;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.subsidy.model.DepartmentDictDO;
import com.subsidy.model.MemberDO;
import lombok.Data;
......@@ -7,7 +9,21 @@ import lombok.Data;
import java.util.List;
@Data
public class GetAllVO extends MemberDO {
public class GetAllVO {
private Long id;
private String accountName;
private String userName;
private String telephone;
private String gender;
private String idCard;
private String status;
private List<DepartmentDictDO> departmentDictDOS;
......
package com.subsidy.vo.paper;
import lombok.Data;
@Data
public class QueryPapersVO {
private Long id;
private String paperName;
private String paperStatus;
}
# 本地环境配置
# 数据源配置
#spring.datasource.url=jdbc:mysql://rm-uf6n0xuw1x835h2f7ro.mysql.rds.aliyuncs.com:3306/subsidy?autoReconnect=true&useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8
spring.datasource.url=jdbc:mysql://116.62.57.92:3306/subsidy?autoReconnect=true&useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8
spring.datasource.url=jdbc:mysql://116.62.57.92:3306/subsidy_test?autoReconnect=true&useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8
spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
#spring.datasource.username=ykadmin_new
......
# 环境配置
spring.profiles.active=dev
spring.profiles.active=prod
# 端口号
spring.server.port=23454
#嵌入tomcat配置
......
......@@ -8,6 +8,7 @@ meishu.code-message[10010]=学生信息不存在
meishu.code-message[10011]=成员信息不存在
meishu.code-message[10013]=账户已冻结,请联系账户管理员
meishu.code-message[10014]=该成员已存在,请勿重复添加
meishu.code-message[10015]=首次登录请使用验证码登录
meishu.code-message[20001]=该课程已存在
......@@ -17,6 +18,10 @@ meishu.code-message[30001]=该部门已存在
meishu.code-message[40001]=该目录已存在
meishu.code-message[50001]=该试卷已存在
meishu.code-message[70010]=验证码错误
meishu.code-message[70011]=验证码发送频繁
meishu.code-message[70012]=手机号未注册
......
......@@ -29,8 +29,7 @@
WHERE
t.delete_date IS NULL
AND t2.delete_date IS NULL
and t2.start_date &lt;= now()
and t2.end_date >= now()
and t2.end_date >=DATE_FORMAT(now(), '%Y-%m-%d')
and t.member_id = #{memberId}
</select>
......
......@@ -49,17 +49,17 @@
</if>
</select>
<select id="getAdministerByCompanyId" parameterType="long" resultType="com.subsidy.model.AdministerDO">
<select id="getAllCompany" parameterType="com.subsidy.model.CompanyDictDO" resultType="com.subsidy.vo.company.GetAllCompanyVO">
SELECT
*
t.id,
t.company_name
FROM
administer t
LEFT JOIN role_administer_mapping t2 ON t.id = t2.administer_id
WHERE
t.delete_date IS NOT NULL
AND t2.delete_date IS NOT NULL
AND t.company_id = #{companyId}
AND t2.role_id = 2
company_dict t
where t.delete_date is null
<if test="companyName != null and companyName != ''">
and t.company_name like concat('%',#{companyName} ,'%')
</if>
</select>
</mapper>
......@@ -25,4 +25,33 @@
id, exercise_type, course_id, difficulty, title, items, right_answer, detail
</sql>
<select id="getPaperExercise" resultType="com.subsidy.vo.exercise.GetPaperExerciseVO">
SELECT
id,
exercise_type,
course_id,
difficulty,
title,
items,
right_answer,
detail,
order_no
FROM
exercise_dict t
WHERE
t.delete_date IS NULL
AND t.paper_id = #{paperId}
<if test="difficulty!=null and difficulty !=''">
AND t.difficulty = #{difficulty}
</if>
<if test="exerciseType!=null and exerciseType !=''">
AND t.exercise_type = #{exerciseType}
</if>
<if test="title !=null and title !=''">
and t.title like concat('%',#{title} ,'%')
</if>
order by t.order_no
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.subsidy.mapper.ExerciseDoneHistoryMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.subsidy.model.ExerciseDoneHistoryDO">
<id column="id" property="id" />
<result column="create_date" property="createDate" />
<result column="update_date" property="updateDate" />
<result column="delete_date" property="deleteDate" />
<result column="paper_id" property="paperId" />
<result column="member_id" property="memberId" />
<result column="class_id" property="classId" />
<result column="exercise_id" property="exerciseId" />
<result column="answer" property="answer" />
<result column="result" property="result" />
<result column="length" property="length" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
create_date,
update_date,
delete_date,
id, paper_id, member_id, class_id, exercise_id, answer, result, length
</sql>
</mapper>
......@@ -24,6 +24,23 @@
id, user_name, telephone, password, gender, image, id_card
</sql>
<select id="passwordLogin" parameterType="com.subsidy.dto.member.PasswordLoginDTO" resultType="com.subsidy.vo.administer.UserRoleVO">
SELECT
t.id,
t.telephone,
t.user_name,
t.image,
t.status,
t.first_login
FROM
member t
WHERE
t.delete_date IS NULL
AND t.account_name = #{accountName}
AND t.PASSWORD = #{password}
AND t.company_id =#{companyId}
</select>
<select id="studyPage" parameterType="com.subsidy.model.MemberDO" resultType="com.subsidy.vo.member.StudyPageVO">
SELECT
t3.id,
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.subsidy.mapper.PaperDictMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.subsidy.model.PaperDictDO">
<id column="id" property="id" />
<result column="create_date" property="createDate" />
<result column="update_date" property="updateDate" />
<result column="delete_date" property="deleteDate" />
<result column="course_id" property="courseId" />
<result column="paper_name" property="paperName" />
<result column="paper_status" property="paperStatus" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
create_date,
update_date,
delete_date,
id, course_id, paper_name, paper_status
</sql>
<select id="queryPapers" parameterType="com.subsidy.model.PaperDictDO" resultType="com.subsidy.vo.paper.QueryPapersVO">
SELECT
id,
paper_name,
paper_status
FROM
paper_dict t
WHERE
t.delete_date is null
and t.course_id = #{courseId}
<if test="paperName != null and paperName !=''">
AND t.paper_name LIKE concat('%',#{paperName} ,'%')
</if>
</select>
</mapper>
......@@ -6,7 +6,7 @@ setParent=com.subsidy
# mapper.xml文件生成路径
mapperPath=/src/main/resources/mapper/
# 数据库地址
url=jdbc:mysql://116.62.57.92:3306/subsidy?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai&useSSL=false&allowMultiQueries=true&useAffectedRows=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
url=jdbc:mysql://116.62.57.92:3306/subsidy_test?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai&useSSL=false&allowMultiQueries=true&useAffectedRows=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
driverName=com.mysql.cj.jdbc.Driver
userName=devloper
password=dev@1553$
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!