From 0c436f31a751b56482959815c98cf143cc1b7839 Mon Sep 17 00:00:00 2001 From: Administrator <tuyaping@ykhl.com> Date: Thu, 11 Nov 2021 14:55:54 +0800 Subject: [PATCH] start --- .gitignore | 34 ++++++++++++++++++++++++++++++++++ mvnw | 310 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ mvnw.cmd | 182 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ pom.xml | 206 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/MeishuApplication.java | 39 +++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/common/Code.java | 45 +++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/common/ResponseData.java | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/common/ResponseVO.java | 21 +++++++++++++++++++++ src/main/java/com/meishu/common/configure/AliyunSmsProperties.java | 19 +++++++++++++++++++ src/main/java/com/meishu/common/configure/MybatisPlusConfig.java | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/common/configure/RemoteProperties.java | 36 ++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/common/configure/RestTemplateConfig.java | 31 +++++++++++++++++++++++++++++++ src/main/java/com/meishu/common/configure/SwaggerConfig.java | 31 +++++++++++++++++++++++++++++++ src/main/java/com/meishu/common/configure/VODConfig.java | 25 +++++++++++++++++++++++++ src/main/java/com/meishu/common/configure/WebConfig.java | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/common/configure/WebLogAspect.java | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/common/configure/WechatConfig.java | 24 ++++++++++++++++++++++++ src/main/java/com/meishu/common/constant/AttendanceConstant.java | 29 +++++++++++++++++++++++++++++ src/main/java/com/meishu/common/constant/Code.java | 33 +++++++++++++++++++++++++++++++++ src/main/java/com/meishu/common/constant/WxConstant.java | 35 +++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/common/exception/GlobalExceptionHandler.java | 118 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/common/exception/HttpException.java | 45 +++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/common/handler/MetaHandler.java | 26 ++++++++++++++++++++++++++ src/main/java/com/meishu/common/interceptor/AuthenticationInterceptor.java | 85 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/common/interceptor/LoginRequired.java | 20 ++++++++++++++++++++ src/main/java/com/meishu/common/schedule/ChangeStudentStatus.java | 20 ++++++++++++++++++++ src/main/java/com/meishu/controller/AccessTokenController.java | 45 +++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/controller/AdministerController.java | 109 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/controller/AdministerDepartmentMappingController.java | 22 ++++++++++++++++++++++ src/main/java/com/meishu/controller/AdministerPermissionController.java | 22 ++++++++++++++++++++++ src/main/java/com/meishu/controller/AdministerSubjectMappingController.java | 22 ++++++++++++++++++++++ src/main/java/com/meishu/controller/AnsweringQuestionController.java | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/controller/ClassSubjectTaskController.java | 165 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/controller/ClassesDictController.java | 97 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/controller/ClassesDictHistoryController.java | 22 ++++++++++++++++++++++ src/main/java/com/meishu/controller/ClassesUserMappingController.java | 22 ++++++++++++++++++++++ src/main/java/com/meishu/controller/CourseAdministerMappingController.java | 22 ++++++++++++++++++++++ src/main/java/com/meishu/controller/CourseStudentStatusHistoryController.java | 22 ++++++++++++++++++++++ src/main/java/com/meishu/controller/CourseTreeExerciseStudentResultController.java | 22 ++++++++++++++++++++++ src/main/java/com/meishu/controller/CourseTreeVodStudentResultController.java | 22 ++++++++++++++++++++++ src/main/java/com/meishu/controller/DepartmentDictController.java | 87 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/controller/ExerciseCourseTreeMappingController.java | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/controller/ExerciseDictController.java | 121 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/controller/ExerciseDoneHistoryController.java | 22 ++++++++++++++++++++++ src/main/java/com/meishu/controller/ExerciseExpandMappingController.java | 22 ++++++++++++++++++++++ src/main/java/com/meishu/controller/ExerciseRelatedMappingController.java | 22 ++++++++++++++++++++++ src/main/java/com/meishu/controller/ExerciseTreeMappingController.java | 22 ++++++++++++++++++++++ src/main/java/com/meishu/controller/ExerciseUserInfoController.java | 22 ++++++++++++++++++++++ src/main/java/com/meishu/controller/KnowledgeSubjectDictController.java | 93 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/controller/LaboratoryAttendanceMappingController.java | 20 ++++++++++++++++++++ src/main/java/com/meishu/controller/LaboratoryDictController.java | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/controller/LaboratoryDictMappingController.java | 22 ++++++++++++++++++++++ src/main/java/com/meishu/controller/LaboratorySessionMappingController.java | 101 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/controller/LaboratoryUserMappingController.java | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/controller/PermissionsDictController.java | 24 ++++++++++++++++++++++++ src/main/java/com/meishu/controller/RoleAdministerMappingController.java | 22 ++++++++++++++++++++++ src/main/java/com/meishu/controller/RoleDictController.java | 83 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/controller/RolePermissionMappingController.java | 22 ++++++++++++++++++++++ src/main/java/com/meishu/controller/SessionsDictController.java | 79 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/controller/SignInRecordController.java | 42 ++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/controller/SmsCodeController.java | 36 ++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/controller/StudentController.java | 88 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/controller/StuentCourseMappingController.java | 22 ++++++++++++++++++++++ src/main/java/com/meishu/controller/SubjectDictController.java | 31 +++++++++++++++++++++++++++++++ src/main/java/com/meishu/controller/SubjectDimensionDictController.java | 69 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/controller/SubjectDimensionStarDictController.java | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/controller/SubjectRuleController.java | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/controller/SubjectSemesterController.java | 79 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/controller/SubjectStarTreeMappingController.java | 22 ++++++++++++++++++++++ src/main/java/com/meishu/controller/SubjectStudentAnswerStarController.java | 22 ++++++++++++++++++++++ src/main/java/com/meishu/controller/SubjectTestDictController.java | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/controller/SubjectTestGradeExampleMappingController.java | 22 ++++++++++++++++++++++ src/main/java/com/meishu/controller/SubjectTestGradeStarMappingController.java | 22 ++++++++++++++++++++++ src/main/java/com/meishu/controller/SubjectTestPublishGradeController.java | 78 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/controller/SubjectTestPublishHistoryController.java | 90 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/controller/SubjectTestStudentAnswerController.java | 22 ++++++++++++++++++++++ src/main/java/com/meishu/controller/SubjectTreeController.java | 78 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/controller/TaskCompletionStatusController.java | 22 ++++++++++++++++++++++ src/main/java/com/meishu/controller/TaskContentController.java | 22 ++++++++++++++++++++++ src/main/java/com/meishu/controller/TaskContentDoneInfoController.java | 22 ++++++++++++++++++++++ src/main/java/com/meishu/controller/TaskDoneHistoryController.java | 22 ++++++++++++++++++++++ src/main/java/com/meishu/controller/UserRoleController.java | 91 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/controller/UserSubjectMappingController.java | 22 ++++++++++++++++++++++ src/main/java/com/meishu/controller/UserSubjectPermissionDictController.java | 22 ++++++++++++++++++++++ src/main/java/com/meishu/controller/UuidHistoryController.java | 22 ++++++++++++++++++++++ src/main/java/com/meishu/controller/VodDictController.java | 147 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/controller/VodPlayHistoryController.java | 22 ++++++++++++++++++++++ src/main/java/com/meishu/controller/VodSubjectTreeMappingController.java | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/controller/WechatController.java | 138 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/controller/WrittenHomeworkController.java | 22 ++++++++++++++++++++++ src/main/java/com/meishu/dto/administer/AddAdministerDTO.java | 18 ++++++++++++++++++ src/main/java/com/meishu/dto/administer/ChangeStatusDTO.java | 14 ++++++++++++++ src/main/java/com/meishu/dto/administer/GetClassesRequestVO.java | 20 ++++++++++++++++++++ src/main/java/com/meishu/dto/administer/PublishExpandingVO.java | 19 +++++++++++++++++++ src/main/java/com/meishu/dto/administer/PublishHomeworkVO.java | 25 +++++++++++++++++++++++++ src/main/java/com/meishu/dto/administer/PublishTasksDTO.java | 38 ++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/dto/administer/PushMsgPO.java | 24 ++++++++++++++++++++++++ src/main/java/com/meishu/dto/administer/UpdateAdministerDTO.java | 18 ++++++++++++++++++ src/main/java/com/meishu/dto/campus/BatchUpdateStatusDTO.java | 14 ++++++++++++++ src/main/java/com/meishu/dto/campus/CampusStudentDTO.java | 16 ++++++++++++++++ src/main/java/com/meishu/dto/chapter/AddTreeToChapterDTO.java | 14 ++++++++++++++ src/main/java/com/meishu/dto/chapter/ChapterExerciseVO.java | 21 +++++++++++++++++++++ src/main/java/com/meishu/dto/chapter/ChapterVodsVO.java | 25 +++++++++++++++++++++++++ src/main/java/com/meishu/dto/chapter/GetChapterCourseDetailVO.java | 27 +++++++++++++++++++++++++++ src/main/java/com/meishu/dto/chapter/StudentChapterDTO.java | 14 ++++++++++++++ src/main/java/com/meishu/dto/chapter/UpdateChapterOrderDTO.java | 12 ++++++++++++ src/main/java/com/meishu/dto/classes/AddClassDTO.java | 13 +++++++++++++ src/main/java/com/meishu/dto/classes/AddSubjectTeacherDTO.java | 14 ++++++++++++++ src/main/java/com/meishu/dto/classes/AddSubjectTeacherMappingDTO.java | 15 +++++++++++++++ src/main/java/com/meishu/dto/classes/BatchAddStudentToClassDTO.java | 14 ++++++++++++++ src/main/java/com/meishu/dto/classes/BatchUpGradeDTO.java | 15 +++++++++++++++ src/main/java/com/meishu/dto/classes/GetClassStudentsDTO.java | 16 ++++++++++++++++ src/main/java/com/meishu/dto/classes/GetClassesDTO.java | 20 ++++++++++++++++++++ src/main/java/com/meishu/dto/classes/QueryNoClassStudentsDTO.java | 14 ++++++++++++++ src/main/java/com/meishu/dto/course/AddCourseDTO.java | 13 +++++++++++++ src/main/java/com/meishu/dto/course/AddCourseTreeNodeDTO.java | 16 ++++++++++++++++ src/main/java/com/meishu/dto/course/AddStudentAuthenDTO.java | 20 ++++++++++++++++++++ src/main/java/com/meishu/dto/course/BatchVodOprDTO.java | 14 ++++++++++++++ src/main/java/com/meishu/dto/course/CourseProgressDTO.java | 18 ++++++++++++++++++ src/main/java/com/meishu/dto/course/CourseVodDTO.java | 12 ++++++++++++ src/main/java/com/meishu/dto/course/GetAllUnAuthenStudentsDTO.java | 18 ++++++++++++++++++ src/main/java/com/meishu/dto/course/GetCourseStudentsDTO.java | 16 ++++++++++++++++ src/main/java/com/meishu/dto/course/GetExercisesByTreeDTO.java | 14 ++++++++++++++ src/main/java/com/meishu/dto/department/BatchOprDTO.java | 16 ++++++++++++++++ src/main/java/com/meishu/dto/department/GetAllDepartmentVO.java | 38 ++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/dto/department/GetTeachersDTO.java | 20 ++++++++++++++++++++ src/main/java/com/meishu/dto/dimension/AddStarDTO.java | 13 +++++++++++++ src/main/java/com/meishu/dto/dimension/DeleteStarByIdDTO.java | 12 ++++++++++++ src/main/java/com/meishu/dto/exercise/AddExerciseDTO.java | 13 +++++++++++++ src/main/java/com/meishu/dto/exercise/CheckExerciseDTO.java | 13 +++++++++++++ src/main/java/com/meishu/dto/exercise/ExeLatexExpressDTO.java | 14 ++++++++++++++ src/main/java/com/meishu/dto/exercise/GetExerciseRequestDTO.java | 21 +++++++++++++++++++++ src/main/java/com/meishu/dto/exercise/GetStatusVodsDTO.java | 16 ++++++++++++++++ src/main/java/com/meishu/dto/exercise/GetTreeExercisesDTO.java | 31 +++++++++++++++++++++++++++++++ src/main/java/com/meishu/dto/exercise/QueryCourseTreeExerciseDTO.java | 22 ++++++++++++++++++++++ src/main/java/com/meishu/dto/exercise/UpdateStatusDTO.java | 20 ++++++++++++++++++++ src/main/java/com/meishu/dto/grade/AddGradeDTO.java | 24 ++++++++++++++++++++++++ src/main/java/com/meishu/dto/laboratory/LaboratoryDictDTO.java | 18 ++++++++++++++++++ src/main/java/com/meishu/dto/laboratory/LaboratoryPageDTO.java | 15 +++++++++++++++ src/main/java/com/meishu/dto/laboratorySession/CalendarStatusDTO.java | 9 +++++++++ src/main/java/com/meishu/dto/laboratorySession/GetLaboratorySessionDTO.java | 17 +++++++++++++++++ src/main/java/com/meishu/dto/laboratorySession/LaboratorySessionListDTO.java | 9 +++++++++ src/main/java/com/meishu/dto/laboratorySession/SetLaboratorySessionDTO.java | 23 +++++++++++++++++++++++ src/main/java/com/meishu/dto/laboratoryUser/ApplyDTO.java | 11 +++++++++++ src/main/java/com/meishu/dto/laboratoryUser/LaboratoryUserPageDTO.java | 15 +++++++++++++++ src/main/java/com/meishu/dto/question/QueryQuestionsDTO.java | 26 ++++++++++++++++++++++++++ src/main/java/com/meishu/dto/role/AddPermissionDTO.java | 14 ++++++++++++++ src/main/java/com/meishu/dto/role/DeletePermissionDTO.java | 15 +++++++++++++++ src/main/java/com/meishu/dto/role/GetRoleTeachersDTO.java | 16 ++++++++++++++++ src/main/java/com/meishu/dto/role/RoleTeacherDTO.java | 14 ++++++++++++++ src/main/java/com/meishu/dto/rule/GetAllRulesDTO.java | 12 ++++++++++++ src/main/java/com/meishu/dto/rule/GetRuleReportDTO.java | 14 ++++++++++++++ src/main/java/com/meishu/dto/semester/GetSemesterScoreDTO.java | 24 ++++++++++++++++++++++++ src/main/java/com/meishu/dto/semester/GetStudentDetailDTO.java | 16 ++++++++++++++++ src/main/java/com/meishu/dto/semester/GetStudentRecordDTO.java | 12 ++++++++++++ src/main/java/com/meishu/dto/sessions/SessionsDictPageDTO.java | 11 +++++++++++ src/main/java/com/meishu/dto/sign/ClassSignInDTO.java | 22 ++++++++++++++++++++++ src/main/java/com/meishu/dto/sms/SendVerifyCodeDTO.java | 9 +++++++++ src/main/java/com/meishu/dto/sms/VerifyCodeDTO.java | 11 +++++++++++ src/main/java/com/meishu/dto/student/DeleteStudentDTO.java | 13 +++++++++++++ src/main/java/com/meishu/dto/student/GetChildTreesDTO.java | 12 ++++++++++++ src/main/java/com/meishu/dto/student/GetStudentRulesDTO.java | 12 ++++++++++++ src/main/java/com/meishu/dto/student/GetStudyProgressDTO.java | 12 ++++++++++++ src/main/java/com/meishu/dto/student/GetVodIndexDTO.java | 14 ++++++++++++++ src/main/java/com/meishu/dto/student/SearchVodsDTO.java | 13 +++++++++++++ src/main/java/com/meishu/dto/student/SubmitTestDTO.java | 17 +++++++++++++++++ src/main/java/com/meishu/dto/subject/BatchStatusOprDTO.java | 16 ++++++++++++++++ src/main/java/com/meishu/dto/subject/GetAllVodsStatusDTO.java | 19 +++++++++++++++++++ src/main/java/com/meishu/dto/subject/GetSubjectAdministerDTO.java | 12 ++++++++++++ src/main/java/com/meishu/dto/subject/GetSubjectTreeDTO.java | 14 ++++++++++++++ src/main/java/com/meishu/dto/subject/GetSubjectsDTO.java | 17 +++++++++++++++++ src/main/java/com/meishu/dto/subject/UpdateTreeOrderDTO.java | 16 ++++++++++++++++ src/main/java/com/meishu/dto/task/ClassDoneInfoDTO.java | 16 ++++++++++++++++ src/main/java/com/meishu/dto/task/ExeRightRatioDTO.java | 18 ++++++++++++++++++ src/main/java/com/meishu/dto/task/ExesDoneInfoPO.java | 14 ++++++++++++++ src/main/java/com/meishu/dto/task/GetClassStudentsDTO.java | 12 ++++++++++++ src/main/java/com/meishu/dto/task/GetClassesRequestVO.java | 20 ++++++++++++++++++++ src/main/java/com/meishu/dto/task/GetRecommendExeByTreeIdVO.java | 16 ++++++++++++++++ src/main/java/com/meishu/dto/task/GetRecommendVodByTreeIdVO.java | 20 ++++++++++++++++++++ src/main/java/com/meishu/dto/task/GetTaskByIdRequestDTO.java | 39 +++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/dto/task/GetUserVodPlayDTO.java | 28 ++++++++++++++++++++++++++++ src/main/java/com/meishu/dto/task/PerStudentExesDTO.java | 26 ++++++++++++++++++++++++++ src/main/java/com/meishu/dto/task/PerStudentExesRequestVO.java | 26 ++++++++++++++++++++++++++ src/main/java/com/meishu/dto/task/QueryTaskDetailDTO.java | 17 +++++++++++++++++ src/main/java/com/meishu/dto/task/StudentDoneInfoRequestVO.java | 22 ++++++++++++++++++++++ src/main/java/com/meishu/dto/test/CommentDTO.java | 13 +++++++++++++ src/main/java/com/meishu/dto/test/GetAllTestDTO.java | 18 ++++++++++++++++++ src/main/java/com/meishu/dto/test/GetOnePublishDTO.java | 18 ++++++++++++++++++ src/main/java/com/meishu/dto/test/GetPublishHistoryDTO.java | 18 ++++++++++++++++++ src/main/java/com/meishu/dto/test/GetTestReportDTO.java | 16 ++++++++++++++++ src/main/java/com/meishu/dto/test/PublishTestDTO.java | 26 ++++++++++++++++++++++++++ src/main/java/com/meishu/dto/token/GetAllStudentsDTO.java | 13 +++++++++++++ src/main/java/com/meishu/dto/token/GetAllTeachersDTO.java | 15 +++++++++++++++ src/main/java/com/meishu/dto/userrole/AccountLoginDTO.java | 11 +++++++++++ src/main/java/com/meishu/dto/userrole/AddStudentsDTO.java | 22 ++++++++++++++++++++++ src/main/java/com/meishu/dto/userrole/QueryStudentsDTO.java | 20 ++++++++++++++++++++ src/main/java/com/meishu/dto/voddict/CheckVodDTO.java | 13 +++++++++++++ src/main/java/com/meishu/dto/voddict/DeleteOriginVodDTO.java | 17 +++++++++++++++++ src/main/java/com/meishu/dto/voddict/GetToCheckVodCountsDTO.java | 12 ++++++++++++ src/main/java/com/meishu/dto/voddict/GetTreeVodsDTO.java | 28 ++++++++++++++++++++++++++++ src/main/java/com/meishu/dto/voddict/MediaProcessResultSet.java | 12 ++++++++++++ src/main/java/com/meishu/dto/voddict/Output.java | 12 ++++++++++++ src/main/java/com/meishu/dto/voddict/ProcedureStateChangeEvent.java | 16 ++++++++++++++++ src/main/java/com/meishu/dto/voddict/PublicCheckingDTO.java | 18 ++++++++++++++++++ src/main/java/com/meishu/dto/voddict/TranscodeTask.java | 12 ++++++++++++ src/main/java/com/meishu/dto/voddict/UploadVodsDTO.java | 14 ++++++++++++++ src/main/java/com/meishu/dto/wechat/AuthenRequestDTO.java | 15 +++++++++++++++ src/main/java/com/meishu/dto/wechat/InviteDTO.java | 10 ++++++++++ src/main/java/com/meishu/dto/wechat/JsSdkDTO.java | 17 +++++++++++++++++ src/main/java/com/meishu/dto/wechat/PushMsgVO.java | 15 +++++++++++++++ src/main/java/com/meishu/dto/wechat/SignDTO.java | 26 ++++++++++++++++++++++++++ src/main/java/com/meishu/dto/wechat/WechatInviteDTO.java | 16 ++++++++++++++++ src/main/java/com/meishu/job/UpgradeClassJob.java | 117 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/mapper/AccessTokenMapper.java | 30 ++++++++++++++++++++++++++++++ src/main/java/com/meishu/mapper/AdministerDepartmentMappingMapper.java | 18 ++++++++++++++++++ src/main/java/com/meishu/mapper/AdministerMapper.java | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/mapper/AdministerPermissionMapper.java | 24 ++++++++++++++++++++++++ src/main/java/com/meishu/mapper/AdministerSubjectMappingMapper.java | 18 ++++++++++++++++++ src/main/java/com/meishu/mapper/AnsweringQuestionMapper.java | 25 +++++++++++++++++++++++++ src/main/java/com/meishu/mapper/ClassSubjectTaskMapper.java | 31 +++++++++++++++++++++++++++++++ src/main/java/com/meishu/mapper/ClassesDictHistoryMapper.java | 22 ++++++++++++++++++++++ src/main/java/com/meishu/mapper/ClassesDictMapper.java | 35 +++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/mapper/ClassesUserMappingMapper.java | 18 ++++++++++++++++++ src/main/java/com/meishu/mapper/CourseAdministerMappingMapper.java | 28 ++++++++++++++++++++++++++++ src/main/java/com/meishu/mapper/CourseStudentStatusHistoryMapper.java | 28 ++++++++++++++++++++++++++++ src/main/java/com/meishu/mapper/CourseTreeExerciseStudentResultMapper.java | 40 ++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/mapper/CourseTreeVodStudentResultMapper.java | 18 ++++++++++++++++++ src/main/java/com/meishu/mapper/CourseVodTressStudentResultMapper.java | 18 ++++++++++++++++++ src/main/java/com/meishu/mapper/DepartmentDictMapper.java | 21 +++++++++++++++++++++ src/main/java/com/meishu/mapper/ExerciseCourseTreeMappingMapper.java | 46 ++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/mapper/ExerciseDictMapper.java | 35 +++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/mapper/ExerciseDoneHistoryMapper.java | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/mapper/ExerciseExpandMappingMapper.java | 18 ++++++++++++++++++ src/main/java/com/meishu/mapper/ExerciseRelatedMappingMapper.java | 18 ++++++++++++++++++ src/main/java/com/meishu/mapper/ExerciseTreeMappingMapper.java | 33 +++++++++++++++++++++++++++++++++ src/main/java/com/meishu/mapper/ExerciseUserInfoMapper.java | 18 ++++++++++++++++++ src/main/java/com/meishu/mapper/KnowledgeSubjectDictMapper.java | 33 +++++++++++++++++++++++++++++++++ src/main/java/com/meishu/mapper/LaboratoryAttendanceMappingMapper.java | 18 ++++++++++++++++++ src/main/java/com/meishu/mapper/LaboratoryDictMapper.java | 25 +++++++++++++++++++++++++ src/main/java/com/meishu/mapper/LaboratoryDictMappingMapper.java | 21 +++++++++++++++++++++ src/main/java/com/meishu/mapper/LaboratorySessionMappingMapper.java | 29 +++++++++++++++++++++++++++++ src/main/java/com/meishu/mapper/LaboratoryUserMappingMapper.java | 29 +++++++++++++++++++++++++++++ src/main/java/com/meishu/mapper/PermissionsDictMapper.java | 18 ++++++++++++++++++ src/main/java/com/meishu/mapper/RoleAdministerMappingMapper.java | 18 ++++++++++++++++++ src/main/java/com/meishu/mapper/RoleDictMapper.java | 26 ++++++++++++++++++++++++++ src/main/java/com/meishu/mapper/RolePermissionMappingMapper.java | 26 ++++++++++++++++++++++++++ src/main/java/com/meishu/mapper/SessionsDictMapper.java | 24 ++++++++++++++++++++++++ src/main/java/com/meishu/mapper/SignInRecordMapper.java | 25 +++++++++++++++++++++++++ src/main/java/com/meishu/mapper/SmsCodeMapper.java | 18 ++++++++++++++++++ src/main/java/com/meishu/mapper/StudentMapper.java | 42 ++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/mapper/SubjectDictMapper.java | 23 +++++++++++++++++++++++ src/main/java/com/meishu/mapper/SubjectDimensionDictMapper.java | 18 ++++++++++++++++++ src/main/java/com/meishu/mapper/SubjectDimensionStarDictMapper.java | 28 ++++++++++++++++++++++++++++ src/main/java/com/meishu/mapper/SubjectRuleMapper.java | 26 ++++++++++++++++++++++++++ src/main/java/com/meishu/mapper/SubjectSemesterMapper.java | 34 ++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/mapper/SubjectStarTreeMappingMapper.java | 27 +++++++++++++++++++++++++++ src/main/java/com/meishu/mapper/SubjectStudentAnswerStarMapper.java | 18 ++++++++++++++++++ src/main/java/com/meishu/mapper/SubjectTestDictMapper.java | 28 ++++++++++++++++++++++++++++ src/main/java/com/meishu/mapper/SubjectTestGradeExampleMappingMapper.java | 18 ++++++++++++++++++ src/main/java/com/meishu/mapper/SubjectTestGradeStarMappingMapper.java | 34 ++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/mapper/SubjectTestPublishGradeMapper.java | 18 ++++++++++++++++++ src/main/java/com/meishu/mapper/SubjectTestPublishHistoryMapper.java | 75 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/mapper/SubjectTestStudentAnswerMapper.java | 24 ++++++++++++++++++++++++ src/main/java/com/meishu/mapper/SubjectTreeMapper.java | 23 +++++++++++++++++++++++ src/main/java/com/meishu/mapper/TaskCompletionStatusMapper.java | 18 ++++++++++++++++++ src/main/java/com/meishu/mapper/TaskContentDoneInfoMapper.java | 18 ++++++++++++++++++ src/main/java/com/meishu/mapper/TaskContentMapper.java | 18 ++++++++++++++++++ src/main/java/com/meishu/mapper/TaskDoneHistoryMapper.java | 18 ++++++++++++++++++ src/main/java/com/meishu/mapper/UserRoleCopy1Mapper.java | 18 ++++++++++++++++++ src/main/java/com/meishu/mapper/UserRoleMapper.java | 38 ++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/mapper/UserSubjectMappingMapper.java | 27 +++++++++++++++++++++++++++ src/main/java/com/meishu/mapper/UserSubjectPermissionDictMapper.java | 23 +++++++++++++++++++++++ src/main/java/com/meishu/mapper/UuidHistoryMapper.java | 18 ++++++++++++++++++ src/main/java/com/meishu/mapper/VodDictMapper.java | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/mapper/VodPlayHistoryMapper.java | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/mapper/VodSubjectTreeMappingMapper.java | 33 +++++++++++++++++++++++++++++++++ src/main/java/com/meishu/mapper/WrittenHomeworkMapper.java | 18 ++++++++++++++++++ src/main/java/com/meishu/model/AccessTokenDO.java | 31 +++++++++++++++++++++++++++++++ src/main/java/com/meishu/model/AdministerDO.java | 77 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/model/AdministerDepartmentMappingDO.java | 39 +++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/model/AdministerPermissionDO.java | 39 +++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/model/AdministerSubjectMappingDO.java | 39 +++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/model/AnsweringQuestionDO.java | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/model/CampusAdministerMappingDO.java | 33 +++++++++++++++++++++++++++++++++ src/main/java/com/meishu/model/CampusDictDO.java | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/model/ClassSubjectTaskDO.java | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/model/ClassesDictDO.java | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/model/ClassesDictHistoryDO.java | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/model/ClassesUserMappingDO.java | 44 ++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/model/CourseAdministerMappingDO.java | 39 +++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/model/CourseChapterDO.java | 44 ++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/model/CourseDictDO.java | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/model/CourseStudentStatusHistoryDO.java | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/model/CourseTreeDO.java | 85 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/model/CourseTreeExerciseStudentResultDO.java | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/model/CourseTreeVodStudentResultDO.java | 39 +++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/model/DepartmentDictDO.java | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/model/ExerciseCourseTreeMappingDO.java | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/model/ExerciseDictDO.java | 99 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/model/ExerciseDoneHistoryDO.java | 69 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/model/ExerciseExpandMappingDO.java | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/model/ExerciseRelatedMappingDO.java | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/model/ExerciseTreeMappingDO.java | 36 ++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/model/ExerciseUserInfoDO.java | 44 ++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/model/KnowledgeSubjectDictDO.java | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/model/LaboratoryAttendanceMappingDO.java | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/model/LaboratoryDictDO.java | 44 ++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/model/LaboratoryDictMappingDO.java | 39 +++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/model/LaboratorySessionMappingDO.java | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/model/LaboratoryUserMappingDO.java | 39 +++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/model/PermissionsDictDO.java | 45 +++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/model/PtStudentScoreDO.java | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/model/RoleAdministerMappingDO.java | 33 +++++++++++++++++++++++++++++++++ src/main/java/com/meishu/model/RoleDictDO.java | 34 ++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/model/RolePermissionMappingDO.java | 39 +++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/model/SessionsDictDO.java | 34 ++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/model/SignInRecordDO.java | 45 +++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/model/SmsCodeDO.java | 41 +++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/model/StudentCourseMappingDO.java | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/model/StudentDO.java | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/model/SubjectDictDO.java | 86 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/model/SubjectDimensionDictDO.java | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/model/SubjectDimensionStarDictDO.java | 44 ++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/model/SubjectRuleDO.java | 44 ++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/model/SubjectSemesterDO.java | 47 +++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/model/SubjectStarTreeMappingDO.java | 39 +++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/model/SubjectStudentAnswerStarDO.java | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/model/SubjectTestDictDO.java | 46 ++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/model/SubjectTestGradeExampleMappingDO.java | 39 +++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/model/SubjectTestGradeStarMappingDO.java | 33 +++++++++++++++++++++++++++++++++ src/main/java/com/meishu/model/SubjectTestPublishGradeDO.java | 41 +++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/model/SubjectTestPublishHistoryDO.java | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/model/SubjectTestStudentAnswerDO.java | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/model/SubjectTreeDO.java | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/model/TaskCompletionStatusDO.java | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/model/TaskContentDO.java | 44 ++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/model/TaskContentDoneInfoDO.java | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/model/TaskDoneHistoryDO.java | 39 +++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/model/UserRoleCopy1DO.java | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/model/UserRoleDO.java | 112 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/model/UserSubjectMappingDO.java | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/model/UserSubjectPermissionDictDO.java | 39 +++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/model/UuidHistoryDO.java | 31 +++++++++++++++++++++++++++++++ src/main/java/com/meishu/model/VodDictDO.java | 102 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/model/VodPlayHistoryDO.java | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/model/VodSubjectTreeMappingDO.java | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/model/WrittenHomeworkDO.java | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/service/AccessTokenService.java | 27 +++++++++++++++++++++++++++ src/main/java/com/meishu/service/AdministerDepartmentMappingService.java | 16 ++++++++++++++++ src/main/java/com/meishu/service/AdministerPermissionService.java | 16 ++++++++++++++++ src/main/java/com/meishu/service/AdministerService.java | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/service/AdministerSubjectMappingService.java | 16 ++++++++++++++++ src/main/java/com/meishu/service/AnsweringQuestionService.java | 34 ++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/service/ClassSubjectTaskService.java | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/service/ClassesDictHistoryService.java | 16 ++++++++++++++++ src/main/java/com/meishu/service/ClassesDictService.java | 45 +++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/service/ClassesUserMappingService.java | 16 ++++++++++++++++ src/main/java/com/meishu/service/CourseAdministerMappingService.java | 16 ++++++++++++++++ src/main/java/com/meishu/service/CourseStudentStatusHistoryService.java | 16 ++++++++++++++++ src/main/java/com/meishu/service/CourseTreeExerciseStudentResultService.java | 16 ++++++++++++++++ src/main/java/com/meishu/service/CourseTreeVodStudentResultService.java | 16 ++++++++++++++++ src/main/java/com/meishu/service/DepartmentDictService.java | 40 ++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/service/ExerciseCourseTreeMappingService.java | 22 ++++++++++++++++++++++ src/main/java/com/meishu/service/ExerciseDictService.java | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/service/ExerciseDoneHistoryService.java | 16 ++++++++++++++++ src/main/java/com/meishu/service/ExerciseExpandMappingService.java | 16 ++++++++++++++++ src/main/java/com/meishu/service/ExerciseRelatedMappingService.java | 16 ++++++++++++++++ src/main/java/com/meishu/service/ExerciseTreeMappingService.java | 16 ++++++++++++++++ src/main/java/com/meishu/service/ExerciseUserInfoService.java | 16 ++++++++++++++++ src/main/java/com/meishu/service/KnowledgeSubjectDictService.java | 41 +++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/service/LaboratoryAttendanceMappingService.java | 16 ++++++++++++++++ src/main/java/com/meishu/service/LaboratoryDictMappingService.java | 18 ++++++++++++++++++ src/main/java/com/meishu/service/LaboratoryDictService.java | 29 +++++++++++++++++++++++++++++ src/main/java/com/meishu/service/LaboratorySessionMappingService.java | 40 ++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/service/LaboratoryUserMappingService.java | 29 +++++++++++++++++++++++++++++ src/main/java/com/meishu/service/PermissionsDictService.java | 16 ++++++++++++++++ src/main/java/com/meishu/service/RoleAdministerMappingService.java | 16 ++++++++++++++++ src/main/java/com/meishu/service/RoleDictService.java | 37 +++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/service/RolePermissionMappingService.java | 16 ++++++++++++++++ src/main/java/com/meishu/service/SessionsDictService.java | 21 +++++++++++++++++++++ src/main/java/com/meishu/service/SignInRecordService.java | 21 +++++++++++++++++++++ src/main/java/com/meishu/service/SmsCodeService.java | 18 ++++++++++++++++++ src/main/java/com/meishu/service/StudentService.java | 41 +++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/service/SubjectDictService.java | 16 ++++++++++++++++ src/main/java/com/meishu/service/SubjectDimensionDictService.java | 33 +++++++++++++++++++++++++++++++++ src/main/java/com/meishu/service/SubjectDimensionStarDictService.java | 28 ++++++++++++++++++++++++++++ src/main/java/com/meishu/service/SubjectRuleService.java | 33 +++++++++++++++++++++++++++++++++ src/main/java/com/meishu/service/SubjectSemesterService.java | 35 +++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/service/SubjectStarTreeMappingService.java | 16 ++++++++++++++++ src/main/java/com/meishu/service/SubjectStudentAnswerStarService.java | 16 ++++++++++++++++ src/main/java/com/meishu/service/SubjectTestDictService.java | 32 ++++++++++++++++++++++++++++++++ src/main/java/com/meishu/service/SubjectTestGradeExampleMappingService.java | 16 ++++++++++++++++ src/main/java/com/meishu/service/SubjectTestGradeStarMappingService.java | 16 ++++++++++++++++ src/main/java/com/meishu/service/SubjectTestPublishGradeService.java | 33 +++++++++++++++++++++++++++++++++ src/main/java/com/meishu/service/SubjectTestPublishHistoryService.java | 37 +++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/service/SubjectTestStudentAnswerService.java | 16 ++++++++++++++++ src/main/java/com/meishu/service/SubjectTreeService.java | 32 ++++++++++++++++++++++++++++++++ src/main/java/com/meishu/service/TaskCompletionStatusService.java | 16 ++++++++++++++++ src/main/java/com/meishu/service/TaskContentDoneInfoService.java | 16 ++++++++++++++++ src/main/java/com/meishu/service/TaskContentService.java | 16 ++++++++++++++++ src/main/java/com/meishu/service/TaskDoneHistoryService.java | 16 ++++++++++++++++ src/main/java/com/meishu/service/UserRoleCopy1Service.java | 16 ++++++++++++++++ src/main/java/com/meishu/service/UserRoleService.java | 41 +++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/service/UserSubjectMappingService.java | 16 ++++++++++++++++ src/main/java/com/meishu/service/UserSubjectPermissionDictService.java | 16 ++++++++++++++++ src/main/java/com/meishu/service/UuidHistoryService.java | 16 ++++++++++++++++ src/main/java/com/meishu/service/VodDictService.java | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/service/VodPlayHistoryService.java | 16 ++++++++++++++++ src/main/java/com/meishu/service/VodSubjectTreeMappingService.java | 23 +++++++++++++++++++++++ src/main/java/com/meishu/service/WrittenHomeworkService.java | 16 ++++++++++++++++ src/main/java/com/meishu/service/impl/AccessTokenServiceImpl.java | 89 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/service/impl/AdministerDepartmentMappingServiceImpl.java | 20 ++++++++++++++++++++ src/main/java/com/meishu/service/impl/AdministerPermissionServiceImpl.java | 20 ++++++++++++++++++++ src/main/java/com/meishu/service/impl/AdministerServiceImpl.java | 352 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/service/impl/AdministerSubjectMappingServiceImpl.java | 20 ++++++++++++++++++++ src/main/java/com/meishu/service/impl/AnsweringQuestionServiceImpl.java | 103 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/service/impl/ClassSubjectTaskServiceImpl.java | 1280 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/service/impl/ClassesDictHistoryServiceImpl.java | 20 ++++++++++++++++++++ src/main/java/com/meishu/service/impl/ClassesDictServiceImpl.java | 373 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/service/impl/ClassesUserMappingServiceImpl.java | 20 ++++++++++++++++++++ src/main/java/com/meishu/service/impl/CourseAdministerMappingServiceImpl.java | 20 ++++++++++++++++++++ src/main/java/com/meishu/service/impl/CourseStudentStatusHistoryServiceImpl.java | 20 ++++++++++++++++++++ src/main/java/com/meishu/service/impl/CourseTreeExerciseStudentResultServiceImpl.java | 20 ++++++++++++++++++++ src/main/java/com/meishu/service/impl/CourseTreeVodStudentResultServiceImpl.java | 20 ++++++++++++++++++++ src/main/java/com/meishu/service/impl/CourseVodTreeStudentResultServiceImpl.java | 20 ++++++++++++++++++++ src/main/java/com/meishu/service/impl/DepartmentDictServiceImpl.java | 285 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/service/impl/ExerciseCourseTreeMappingServiceImpl.java | 45 +++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/service/impl/ExerciseDictServiceImpl.java | 291 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/service/impl/ExerciseDoneHistoryServiceImpl.java | 20 ++++++++++++++++++++ src/main/java/com/meishu/service/impl/ExerciseExpandMappingServiceImpl.java | 20 ++++++++++++++++++++ src/main/java/com/meishu/service/impl/ExerciseRelatedMappingServiceImpl.java | 20 ++++++++++++++++++++ src/main/java/com/meishu/service/impl/ExerciseTreeMappingServiceImpl.java | 20 ++++++++++++++++++++ src/main/java/com/meishu/service/impl/ExerciseUserInfoServiceImpl.java | 20 ++++++++++++++++++++ src/main/java/com/meishu/service/impl/KnowledgeSubjectDictServiceImpl.java | 171 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/service/impl/LaboratoryAttendanceMappingServiceImpl.java | 20 ++++++++++++++++++++ src/main/java/com/meishu/service/impl/LaboratoryDictMappingServiceImpl.java | 22 ++++++++++++++++++++++ src/main/java/com/meishu/service/impl/LaboratoryDictServiceImpl.java | 115 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/service/impl/LaboratorySessionMappingServiceImpl.java | 263 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/service/impl/LaboratoryUserMappingServiceImpl.java | 162 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/service/impl/PermissionsDictServiceImpl.java | 20 ++++++++++++++++++++ src/main/java/com/meishu/service/impl/RoleAdministerMappingServiceImpl.java | 20 ++++++++++++++++++++ src/main/java/com/meishu/service/impl/RoleDictServiceImpl.java | 148 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/service/impl/RolePermissionMappingServiceImpl.java | 20 ++++++++++++++++++++ src/main/java/com/meishu/service/impl/SessionsDictServiceImpl.java | 31 +++++++++++++++++++++++++++++++ src/main/java/com/meishu/service/impl/SignInRecordServiceImpl.java | 29 +++++++++++++++++++++++++++++ src/main/java/com/meishu/service/impl/SmsCodeServiceImpl.java | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/service/impl/StudentServiceImpl.java | 172 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/service/impl/SubjectDictServiceImpl.java | 20 ++++++++++++++++++++ src/main/java/com/meishu/service/impl/SubjectDimensionDictServiceImpl.java | 96 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/service/impl/SubjectDimensionStarDictServiceImpl.java | 99 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/service/impl/SubjectRuleServiceImpl.java | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/service/impl/SubjectSemesterServiceImpl.java | 89 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/service/impl/SubjectStarTreeMappingServiceImpl.java | 20 ++++++++++++++++++++ src/main/java/com/meishu/service/impl/SubjectStudentAnswerStarServiceImpl.java | 20 ++++++++++++++++++++ src/main/java/com/meishu/service/impl/SubjectTestDictServiceImpl.java | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/service/impl/SubjectTestGradeExampleMappingServiceImpl.java | 20 ++++++++++++++++++++ src/main/java/com/meishu/service/impl/SubjectTestGradeStarMappingServiceImpl.java | 20 ++++++++++++++++++++ src/main/java/com/meishu/service/impl/SubjectTestPublishGradeServiceImpl.java | 188 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/service/impl/SubjectTestPublishHistoryServiceImpl.java | 153 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/service/impl/SubjectTestStudentAnswerServiceImpl.java | 20 ++++++++++++++++++++ src/main/java/com/meishu/service/impl/SubjectTreeServiceImpl.java | 439 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/service/impl/TaskCompletionStatusServiceImpl.java | 20 ++++++++++++++++++++ src/main/java/com/meishu/service/impl/TaskContentDoneInfoServiceImpl.java | 20 ++++++++++++++++++++ src/main/java/com/meishu/service/impl/TaskContentServiceImpl.java | 20 ++++++++++++++++++++ src/main/java/com/meishu/service/impl/TaskDoneHistoryServiceImpl.java | 20 ++++++++++++++++++++ src/main/java/com/meishu/service/impl/UserRoleCopy1ServiceImpl.java | 20 ++++++++++++++++++++ src/main/java/com/meishu/service/impl/UserRoleServiceImpl.java | 154 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/service/impl/UserSubjectMappingServiceImpl.java | 20 ++++++++++++++++++++ src/main/java/com/meishu/service/impl/UserSubjectPermissionDictServiceImpl.java | 20 ++++++++++++++++++++ src/main/java/com/meishu/service/impl/UuidHistoryServiceImpl.java | 20 ++++++++++++++++++++ src/main/java/com/meishu/service/impl/VodDictServiceImpl.java | 507 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/service/impl/VodPlayHistoryServiceImpl.java | 20 ++++++++++++++++++++ src/main/java/com/meishu/service/impl/VodSubjectTreeMappingServiceImpl.java | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/service/impl/WrittenHomeworkServiceImpl.java | 20 ++++++++++++++++++++ src/main/java/com/meishu/util/BaseModel.java | 35 +++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/util/CodeGenerator.java | 124 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/util/CodeTrans.java | 31 +++++++++++++++++++++++++++++++ src/main/java/com/meishu/util/ConstantUtils.java | 89 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/util/DateFormatUtil.java | 82 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/util/EncryptUtil.java | 35 +++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/util/HttpUtil.java | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/util/JwtUtil.java | 96 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/util/LatexUtils.java | 124 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/util/Localstorage.java | 21 +++++++++++++++++++++ src/main/java/com/meishu/util/MathUtil.java | 129 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/util/RandomUtil.java | 19 +++++++++++++++++++ src/main/java/com/meishu/util/SMSUtils.java | 137 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/util/SecretUtils.java | 119 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/util/Signature.java | 79 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/util/TestMain.java | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/util/WechatUtil.java | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/util/excel/ExcelColumn.java | 13 +++++++++++++ src/main/java/com/meishu/util/excel/ExcelColumnUtil.java | 21 +++++++++++++++++++++ src/main/java/com/meishu/util/excel/ExcelUtil.java | 347 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/util/tree/Node.java | 42 ++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/util/tree/NumberTree.java | 212 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/util/tree/SerialNumber.java | 28 ++++++++++++++++++++++++++++ src/main/java/com/meishu/vo/PerStudentComplicationVO.java | 20 ++++++++++++++++++++ src/main/java/com/meishu/vo/accesstoken/GetAllStudentsVO.java | 32 ++++++++++++++++++++++++++++++++ src/main/java/com/meishu/vo/accesstoken/GetAllTeachersVO.java | 22 ++++++++++++++++++++++ src/main/java/com/meishu/vo/administer/AdministerPermissionVO.java | 21 +++++++++++++++++++++ src/main/java/com/meishu/vo/administer/GetClassesDetailResponseVO.java | 38 ++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/vo/administer/GetTeacherClassVO.java | 7 +++++++ src/main/java/com/meishu/vo/administer/GetTeacherSubjectVO.java | 12 ++++++++++++ src/main/java/com/meishu/vo/administer/GetTeachersVO.java | 38 ++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/vo/administer/LoginVO.java | 10 ++++++++++ src/main/java/com/meishu/vo/administer/PermissionsVO.java | 17 +++++++++++++++++ src/main/java/com/meishu/vo/campus/CampusListVO.java | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/vo/campus/CampusStudentVO.java | 11 +++++++++++ src/main/java/com/meishu/vo/classes/GetClassStudentsVO.java | 12 ++++++++++++ src/main/java/com/meishu/vo/classes/GetClassesVO.java | 30 ++++++++++++++++++++++++++++++ src/main/java/com/meishu/vo/classes/SubjectDictVO.java | 14 ++++++++++++++ src/main/java/com/meishu/vo/course/CourseAdministerVO.java | 16 ++++++++++++++++ src/main/java/com/meishu/vo/course/CourseProgressVO.java | 41 +++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/vo/course/CourseVodVO.java | 22 ++++++++++++++++++++++ src/main/java/com/meishu/vo/course/GetAllCourseVO.java | 15 +++++++++++++++ src/main/java/com/meishu/vo/course/GetCourseStudentsVO.java | 34 ++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/vo/course/GetCourseTreeVodsVO.java | 34 ++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/vo/course/GetExerciseDetailVO.java | 38 ++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/vo/course/GetStudentHistoryVO.java | 23 +++++++++++++++++++++++ src/main/java/com/meishu/vo/course/GetVodIndexVO.java | 15 +++++++++++++++ src/main/java/com/meishu/vo/course/QueryCourseInfoVO.java | 15 +++++++++++++++ src/main/java/com/meishu/vo/course/QueryCoursesVO.java | 16 ++++++++++++++++ src/main/java/com/meishu/vo/course/StudentDetailVO.java | 35 +++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/vo/dimension/GetAllDimensionStarVO.java | 17 +++++++++++++++++ src/main/java/com/meishu/vo/dimension/GetAllDimensionStarsVO.java | 14 ++++++++++++++ src/main/java/com/meishu/vo/dimension/StarVO.java | 4 ++++ src/main/java/com/meishu/vo/exercise/GetExerciseDetailResponseVO.java | 21 +++++++++++++++++++++ src/main/java/com/meishu/vo/exercise/GetExerciseDetailVO.java | 14 ++++++++++++++ src/main/java/com/meishu/vo/exercise/GetTreeExercisesVO.java | 45 +++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/vo/exercise/QueryCourseTreeExerciseVO.java | 39 +++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/vo/grade/DimensionStarVO.java | 18 ++++++++++++++++++ src/main/java/com/meishu/vo/grade/QueryOneGradeVO.java | 21 +++++++++++++++++++++ src/main/java/com/meishu/vo/laboratorySession/CalendarStatusVO.java | 11 +++++++++++ src/main/java/com/meishu/vo/laboratorySession/GetLaboratorySessionVO.java | 21 +++++++++++++++++++++ src/main/java/com/meishu/vo/laboratorySession/LaboratoryDictPageVO.java | 17 +++++++++++++++++ src/main/java/com/meishu/vo/laboratorySession/LaboratorySessionMappingVO.java | 23 +++++++++++++++++++++++ src/main/java/com/meishu/vo/laboratorySession/LaboratorySessionVO.java | 12 ++++++++++++ src/main/java/com/meishu/vo/laboratorySession/StatisticsVO.java | 13 +++++++++++++ src/main/java/com/meishu/vo/laboratoryUser/LaboratoryUserPageVO.java | 38 ++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/vo/question/GetClassQuestionsVO.java | 12 ++++++++++++ src/main/java/com/meishu/vo/question/QueryOneQuestionVO.java | 11 +++++++++++ src/main/java/com/meishu/vo/question/QueryQuestionsVO.java | 20 ++++++++++++++++++++ src/main/java/com/meishu/vo/role/GetAllRolesVO.java | 14 ++++++++++++++ src/main/java/com/meishu/vo/role/GetRoleTeachersVO.java | 22 ++++++++++++++++++++++ src/main/java/com/meishu/vo/rule/GetAllRulesVO.java | 18 ++++++++++++++++++ src/main/java/com/meishu/vo/rule/GetOneExaminationDetailVO.java | 41 +++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/vo/rule/GetRuleReportVO.java | 7 +++++++ src/main/java/com/meishu/vo/rule/GetStudentRulesVO.java | 28 ++++++++++++++++++++++++++++ src/main/java/com/meishu/vo/rule/StudentStarVO.java | 17 +++++++++++++++++ src/main/java/com/meishu/vo/semester/GetAllPastSemesterVO.java | 16 ++++++++++++++++ src/main/java/com/meishu/vo/semester/GetAllStudyingSemesterVO.java | 15 +++++++++++++++ src/main/java/com/meishu/vo/semester/GetSemesterScoreVO.java | 25 +++++++++++++++++++++++++ src/main/java/com/meishu/vo/semester/GetStudentDetailVO.java | 20 ++++++++++++++++++++ src/main/java/com/meishu/vo/semester/GetStudentRecordVO.java | 30 ++++++++++++++++++++++++++++++ src/main/java/com/meishu/vo/sign/ClassSignInVO.java | 20 ++++++++++++++++++++ src/main/java/com/meishu/vo/student/ChapterTestVO.java | 15 +++++++++++++++ src/main/java/com/meishu/vo/student/ClassVO.java | 18 ++++++++++++++++++ src/main/java/com/meishu/vo/student/GetChildTreesVO.java | 14 ++++++++++++++ src/main/java/com/meishu/vo/student/GetStudyProgressVO.java | 31 +++++++++++++++++++++++++++++++ src/main/java/com/meishu/vo/student/LoginVO.java | 18 ++++++++++++++++++ src/main/java/com/meishu/vo/student/ParentReportVO.java | 30 ++++++++++++++++++++++++++++++ src/main/java/com/meishu/vo/student/QueryChapterTestVO.java | 30 ++++++++++++++++++++++++++++++ src/main/java/com/meishu/vo/student/QueryClassVO.java | 14 ++++++++++++++ src/main/java/com/meishu/vo/student/QueryStudentVO.java | 11 +++++++++++ src/main/java/com/meishu/vo/student/SearchVodsVO.java | 27 +++++++++++++++++++++++++++ src/main/java/com/meishu/vo/student/StudentCampusVO.java | 24 ++++++++++++++++++++++++ src/main/java/com/meishu/vo/student/StudentCourseVO.java | 17 +++++++++++++++++ src/main/java/com/meishu/vo/student/StudentTreeVodDoneVO.java | 16 ++++++++++++++++ src/main/java/com/meishu/vo/student/StudentVO.java | 18 ++++++++++++++++++ src/main/java/com/meishu/vo/student/StudentVodVO.java | 18 ++++++++++++++++++ src/main/java/com/meishu/vo/student/StudyReportVO.java | 31 +++++++++++++++++++++++++++++++ src/main/java/com/meishu/vo/student/SubjectReportVO.java | 17 +++++++++++++++++ src/main/java/com/meishu/vo/subject/GetAllNoAuthenVodsVO.java | 24 ++++++++++++++++++++++++ src/main/java/com/meishu/vo/subject/GetNextNodeVO.java | 14 ++++++++++++++ src/main/java/com/meishu/vo/subject/GetSubjectTreeVO.java | 119 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/vo/subject/SubjectTreeOrder.java | 212 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/vo/task/ClassDoneInfoVO.java | 16 ++++++++++++++++ src/main/java/com/meishu/vo/task/ExeRightRatioVO.java | 15 +++++++++++++++ src/main/java/com/meishu/vo/task/ExerciseDoneInfoVO.java | 18 ++++++++++++++++++ src/main/java/com/meishu/vo/task/ExerciseUserInfoVO.java | 14 ++++++++++++++ src/main/java/com/meishu/vo/task/GetClassExeDoneInfoRequestVO.java | 27 +++++++++++++++++++++++++++ src/main/java/com/meishu/vo/task/GetClassExeDoneInfoResponseVO.java | 37 +++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/vo/task/GetExeByIdResponseVO.java | 36 ++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/vo/task/GetExercisesInfoByIdsResponseVO.java | 21 +++++++++++++++++++++ src/main/java/com/meishu/vo/task/GetExpandingsPO.java | 12 ++++++++++++ src/main/java/com/meishu/vo/task/GetPreTaskContentVO.java | 32 ++++++++++++++++++++++++++++++++ src/main/java/com/meishu/vo/task/GetTaskByIdVO.java | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/vo/task/GetVodDetailResponseVO.java | 30 ++++++++++++++++++++++++++++++ src/main/java/com/meishu/vo/task/PerStuExeDoneResponseVO.java | 32 ++++++++++++++++++++++++++++++++ src/main/java/com/meishu/vo/task/PerStudentExesResponseVO.java | 25 +++++++++++++++++++++++++ src/main/java/com/meishu/vo/task/PreExpandExerciseVO.java | 24 ++++++++++++++++++++++++ src/main/java/com/meishu/vo/task/PreHomeWorkInfoVO.java | 27 +++++++++++++++++++++++++++ src/main/java/com/meishu/vo/task/PreRelateExeVO.java | 22 ++++++++++++++++++++++ src/main/java/com/meishu/vo/task/PreVodInfoVO.java | 28 ++++++++++++++++++++++++++++ src/main/java/com/meishu/vo/task/QueryTaskDetailResponseVO.java | 26 ++++++++++++++++++++++++++ src/main/java/com/meishu/vo/task/StudentDoneInfoResponseVO.java | 31 +++++++++++++++++++++++++++++++ src/main/java/com/meishu/vo/task/TeacherClassVO.java | 17 +++++++++++++++++ src/main/java/com/meishu/vo/test/CommentVO.java | 16 ++++++++++++++++ src/main/java/com/meishu/vo/test/GetAllTestVO.java | 19 +++++++++++++++++++ src/main/java/com/meishu/vo/test/GetOnePublishVO.java | 26 ++++++++++++++++++++++++++ src/main/java/com/meishu/vo/test/GetPublishHistoryVO.java | 32 ++++++++++++++++++++++++++++++++ src/main/java/com/meishu/vo/test/GetTestReportVO.java | 26 ++++++++++++++++++++++++++ src/main/java/com/meishu/vo/userrole/QueryStudentsVO.java | 41 +++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/vo/userrole/UserInfoVO.java | 15 +++++++++++++++ src/main/java/com/meishu/vo/userrole/UserRoleVO.java | 12 ++++++++++++ src/main/java/com/meishu/vo/voddict/GetCourseTreesVodsVO.java | 40 ++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/vo/voddict/GetStatusVodsVO.java | 9 +++++++++ src/main/java/com/meishu/vo/voddict/GetToCheckCountsVO.java | 12 ++++++++++++ src/main/java/com/meishu/vo/voddict/GetTreeVodsVO.java | 43 +++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/meishu/vo/voddict/GetVodDetailVO.java | 14 ++++++++++++++ src/main/java/com/meishu/vo/voddict/SignatureVO.java | 10 ++++++++++ src/main/java/com/meishu/vo/wechat/AccessTokenVO.java | 16 ++++++++++++++++ src/main/java/com/meishu/vo/wechat/AuthenTokenVO.java | 30 ++++++++++++++++++++++++++++++ src/main/java/com/meishu/vo/wechat/MemberVO.java | 23 +++++++++++++++++++++++ src/main/java/com/meishu/vo/wechat/QrConnectVO.java | 17 +++++++++++++++++ src/main/java/com/meishu/vo/wechat/WXUserInfoVO.java | 16 ++++++++++++++++ src/main/java/com/meishu/vo/wechat/WechatInviteVO.java | 20 ++++++++++++++++++++ src/main/java/com/subsidy/MeishuApplication.java | 39 +++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/common/Code.java | 45 +++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/common/ResponseData.java | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/common/ResponseVO.java | 21 +++++++++++++++++++++ src/main/java/com/subsidy/common/configure/AliyunSmsProperties.java | 19 +++++++++++++++++++ src/main/java/com/subsidy/common/configure/MybatisPlusConfig.java | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/common/configure/RemoteProperties.java | 36 ++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/common/configure/RestTemplateConfig.java | 31 +++++++++++++++++++++++++++++++ src/main/java/com/subsidy/common/configure/SwaggerConfig.java | 31 +++++++++++++++++++++++++++++++ src/main/java/com/subsidy/common/configure/VODConfig.java | 25 +++++++++++++++++++++++++ src/main/java/com/subsidy/common/configure/WebConfig.java | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/common/configure/WebLogAspect.java | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/common/configure/WechatConfig.java | 24 ++++++++++++++++++++++++ src/main/java/com/subsidy/common/constant/AttendanceConstant.java | 29 +++++++++++++++++++++++++++++ src/main/java/com/subsidy/common/constant/Code.java | 33 +++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/common/constant/WxConstant.java | 35 +++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/common/exception/GlobalExceptionHandler.java | 118 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/common/exception/HttpException.java | 45 +++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/common/handler/MetaHandler.java | 26 ++++++++++++++++++++++++++ src/main/java/com/subsidy/common/interceptor/AuthenticationInterceptor.java | 84 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/common/interceptor/LoginRequired.java | 20 ++++++++++++++++++++ src/main/java/com/subsidy/controller/AdministerController.java | 166 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/controller/AnsweringQuestionController.java | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/controller/CategoryController.java | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/controller/ClassDictController.java | 97 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/controller/ClassMemberMappingController.java | 22 ++++++++++++++++++++++ src/main/java/com/subsidy/controller/CompanyDictController.java | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/controller/CourseContentController.java | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/controller/CourseDictController.java | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/controller/DepartmentDictController.java | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/controller/ExerciseDictController.java | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/controller/ExerciseDoneResultController.java | 22 ++++++++++++++++++++++ src/main/java/com/subsidy/controller/FileDictController.java | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/controller/MemberController.java | 124 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/controller/MemberDepartmentMappingController.java | 22 ++++++++++++++++++++++ src/main/java/com/subsidy/controller/PermissionsDictController.java | 22 ++++++++++++++++++++++ src/main/java/com/subsidy/controller/RoleAdministerMappingController.java | 22 ++++++++++++++++++++++ src/main/java/com/subsidy/controller/RoleDictController.java | 22 ++++++++++++++++++++++ src/main/java/com/subsidy/controller/RolePermissionMappingController.java | 22 ++++++++++++++++++++++ src/main/java/com/subsidy/controller/SignInRecordController.java | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/controller/SmsVerifyCodeController.java | 41 +++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/controller/VodDictController.java | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/controller/VodPlayHistoryController.java | 40 ++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/dto/GetCourseQuestionDTO.java | 16 ++++++++++++++++ src/main/java/com/subsidy/dto/administer/ClassDetailDTO.java | 18 ++++++++++++++++++ src/main/java/com/subsidy/dto/administer/OperatorsDTO.java | 20 ++++++++++++++++++++ src/main/java/com/subsidy/dto/administer/VerifyCodeDTO.java | 11 +++++++++++ src/main/java/com/subsidy/dto/category/GetCategoriesDTO.java | 16 ++++++++++++++++ src/main/java/com/subsidy/dto/classDict/AddClassDTO.java | 11 +++++++++++ src/main/java/com/subsidy/dto/classDict/AddMemberToClassDTO.java | 14 ++++++++++++++ src/main/java/com/subsidy/dto/classDict/GetAllClassesDTO.java | 18 ++++++++++++++++++ src/main/java/com/subsidy/dto/classDict/GetSpareMembersDTO.java | 13 +++++++++++++ src/main/java/com/subsidy/dto/company/AddCompanyDTO.java | 17 +++++++++++++++++ src/main/java/com/subsidy/dto/content/GetContendVodsDTO.java | 16 ++++++++++++++++ src/main/java/com/subsidy/dto/course/QueryCoursesDTO.java | 28 ++++++++++++++++++++++++++++ src/main/java/com/subsidy/dto/department/GetDepartmentsVO.java | 24 ++++++++++++++++++++++++ src/main/java/com/subsidy/dto/exercise/GetAllExercisesDTO.java | 15 +++++++++++++++ src/main/java/com/subsidy/dto/exercise/SubmitDTO.java | 18 ++++++++++++++++++ src/main/java/com/subsidy/dto/member/AddMemberDTO.java | 14 ++++++++++++++ src/main/java/com/subsidy/dto/member/ContentMemberDTO.java | 14 ++++++++++++++ src/main/java/com/subsidy/dto/member/GetAllDTO.java | 13 +++++++++++++ src/main/java/com/subsidy/dto/member/GetMemberSignInfoDTO.java | 14 ++++++++++++++ src/main/java/com/subsidy/dto/member/ImportMemberDTO.java | 28 ++++++++++++++++++++++++++++ src/main/java/com/subsidy/dto/member/StudyHistoryDTO.java | 14 ++++++++++++++ src/main/java/com/subsidy/dto/sign/ClassSignInfoDTO.java | 19 +++++++++++++++++++ src/main/java/com/subsidy/dto/sign/SignInDTO.java | 12 ++++++++++++ src/main/java/com/subsidy/dto/sms/SendVerifyCodeDTO.java | 9 +++++++++ src/main/java/com/subsidy/mapper/AdministerMapper.java | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/mapper/AnsweringQuestionMapper.java | 27 +++++++++++++++++++++++++++ src/main/java/com/subsidy/mapper/CategoryMapper.java | 18 ++++++++++++++++++ src/main/java/com/subsidy/mapper/ClassDictMapper.java | 42 ++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/mapper/ClassMemberMappingMapper.java | 28 ++++++++++++++++++++++++++++ src/main/java/com/subsidy/mapper/CompanyDictMapper.java | 33 +++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/mapper/CourseContentMapper.java | 27 +++++++++++++++++++++++++++ src/main/java/com/subsidy/mapper/CourseDictMapper.java | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/mapper/DepartmentDictMapper.java | 24 ++++++++++++++++++++++++ src/main/java/com/subsidy/mapper/ExerciseDictMapper.java | 18 ++++++++++++++++++ src/main/java/com/subsidy/mapper/ExerciseDoneResultMapper.java | 18 ++++++++++++++++++ src/main/java/com/subsidy/mapper/FileDictMapper.java | 18 ++++++++++++++++++ src/main/java/com/subsidy/mapper/MemberDepartmentMappingMapper.java | 18 ++++++++++++++++++ src/main/java/com/subsidy/mapper/MemberMapper.java | 40 ++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/mapper/PermissionsDictMapper.java | 18 ++++++++++++++++++ src/main/java/com/subsidy/mapper/RoleAdministerMappingMapper.java | 18 ++++++++++++++++++ src/main/java/com/subsidy/mapper/RoleDictMapper.java | 18 ++++++++++++++++++ src/main/java/com/subsidy/mapper/RolePermissionMappingMapper.java | 18 ++++++++++++++++++ src/main/java/com/subsidy/mapper/SignInRecordMapper.java | 28 ++++++++++++++++++++++++++++ src/main/java/com/subsidy/mapper/SmsVerifyCodeMapper.java | 18 ++++++++++++++++++ src/main/java/com/subsidy/mapper/VodDictMapper.java | 30 ++++++++++++++++++++++++++++++ src/main/java/com/subsidy/mapper/VodPlayHistoryMapper.java | 26 ++++++++++++++++++++++++++ src/main/java/com/subsidy/model/AdministerDO.java | 77 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/model/AnsweringQuestionDO.java | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/model/CategoryDO.java | 39 +++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/model/ClassDictDO.java | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/model/ClassMemberMappingDO.java | 39 +++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/model/CompanyDictDO.java | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/model/CourseContentDO.java | 41 +++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/model/CourseDictDO.java | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/model/DepartmentDictDO.java | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/model/ExerciseDictDO.java | 69 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/model/ExerciseDoneResultDO.java | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/model/FileDictDO.java | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/model/MemberDO.java | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/model/MemberDepartmentMappingDO.java | 46 ++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/model/PermissionsDictDO.java | 41 +++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/model/RoleAdministerMappingDO.java | 33 +++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/model/RoleDictDO.java | 34 ++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/model/RolePermissionMappingDO.java | 39 +++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/model/SignInRecordDO.java | 45 +++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/model/SmsVerifyCodeDO.java | 39 +++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/model/VodDictDO.java | 73 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/model/VodPlayHistoryDO.java | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/service/AdministerService.java | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/service/AnsweringQuestionService.java | 25 +++++++++++++++++++++++++ src/main/java/com/subsidy/service/CategoryService.java | 29 +++++++++++++++++++++++++++++ src/main/java/com/subsidy/service/ClassDictService.java | 41 +++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/service/ClassMemberMappingService.java | 16 ++++++++++++++++ src/main/java/com/subsidy/service/CompanyDictService.java | 29 +++++++++++++++++++++++++++++ src/main/java/com/subsidy/service/CourseContentService.java | 29 +++++++++++++++++++++++++++++ src/main/java/com/subsidy/service/CourseDictService.java | 27 +++++++++++++++++++++++++++ src/main/java/com/subsidy/service/DepartmentDictService.java | 26 ++++++++++++++++++++++++++ src/main/java/com/subsidy/service/ExerciseDictService.java | 35 +++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/service/ExerciseDoneResultService.java | 16 ++++++++++++++++ src/main/java/com/subsidy/service/FileDictService.java | 26 ++++++++++++++++++++++++++ src/main/java/com/subsidy/service/MemberDepartmentMappingService.java | 16 ++++++++++++++++ src/main/java/com/subsidy/service/MemberService.java | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/service/PermissionsDictService.java | 16 ++++++++++++++++ src/main/java/com/subsidy/service/RoleAdministerMappingService.java | 16 ++++++++++++++++ src/main/java/com/subsidy/service/RoleDictService.java | 16 ++++++++++++++++ src/main/java/com/subsidy/service/RolePermissionMappingService.java | 16 ++++++++++++++++ src/main/java/com/subsidy/service/SignInRecordService.java | 31 +++++++++++++++++++++++++++++++ src/main/java/com/subsidy/service/SmsVerifyCodeService.java | 19 +++++++++++++++++++ src/main/java/com/subsidy/service/VodDictService.java | 31 +++++++++++++++++++++++++++++++ src/main/java/com/subsidy/service/VodPlayHistoryService.java | 18 ++++++++++++++++++ src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java | 1710 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/service/impl/AnsweringQuestionServiceImpl.java | 46 ++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/service/impl/CategoryServiceImpl.java | 103 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/service/impl/ClassDictServiceImpl.java | 114 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/service/impl/ClassMemberMappingServiceImpl.java | 20 ++++++++++++++++++++ src/main/java/com/subsidy/service/impl/CompanyDictServiceImpl.java | 134 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/service/impl/CourseContentServiceImpl.java | 75 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/service/impl/CourseDictServiceImpl.java | 150 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/service/impl/DepartmentDictServiceImpl.java | 159 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/service/impl/ExerciseDictServiceImpl.java | 126 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/service/impl/ExerciseDoneResultServiceImpl.java | 20 ++++++++++++++++++++ src/main/java/com/subsidy/service/impl/FileDictServiceImpl.java | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/service/impl/MemberDepartmentMappingServiceImpl.java | 20 ++++++++++++++++++++ src/main/java/com/subsidy/service/impl/MemberServiceImpl.java | 518 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/service/impl/PermissionsDictServiceImpl.java | 20 ++++++++++++++++++++ src/main/java/com/subsidy/service/impl/RoleAdministerMappingServiceImpl.java | 20 ++++++++++++++++++++ src/main/java/com/subsidy/service/impl/RoleDictServiceImpl.java | 20 ++++++++++++++++++++ src/main/java/com/subsidy/service/impl/RolePermissionMappingServiceImpl.java | 20 ++++++++++++++++++++ src/main/java/com/subsidy/service/impl/SignInRecordServiceImpl.java | 192 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/service/impl/SmsVerifyCodeServiceImpl.java | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/service/impl/VodDictServiceImpl.java | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/service/impl/VodPlayHistoryServiceImpl.java | 26 ++++++++++++++++++++++++++ src/main/java/com/subsidy/util/BaseModel.java | 35 +++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/util/CodeGenerator.java | 124 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/util/ConstantUtils.java | 89 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/util/DateFormatUtil.java | 79 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/util/EncryptUtil.java | 35 +++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/util/ExcelFormatUtils.java | 17 +++++++++++++++++ src/main/java/com/subsidy/util/HttpUtil.java | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/util/JwtUtil.java | 96 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/util/LatexUtils.java | 124 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/util/Localstorage.java | 21 +++++++++++++++++++++ src/main/java/com/subsidy/util/MathUtil.java | 137 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/util/RandomUtil.java | 19 +++++++++++++++++++ src/main/java/com/subsidy/util/SMSUtils.java | 139 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/util/SecretUtils.java | 116 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/util/Signature.java | 79 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/util/Student.java | 17 +++++++++++++++++ src/main/java/com/subsidy/util/TestMain.java | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/util/ZipTestUtils.java | 299 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/util/ZipUtils.java | 259 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/util/excel/ExcelColumn.java | 13 +++++++++++++ src/main/java/com/subsidy/util/excel/ExcelColumnUtil.java | 21 +++++++++++++++++++++ src/main/java/com/subsidy/util/excel/ExcelUtil.java | 1244 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/util/tree/Node.java | 42 ++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/util/tree/NumberTree.java | 212 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/util/tree/SerialNumber.java | 28 ++++++++++++++++++++++++++++ src/main/java/com/subsidy/vo/administer/AdministerPermissionVO.java | 21 +++++++++++++++++++++ src/main/java/com/subsidy/vo/administer/ClassSummaryVO.java | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/vo/administer/ExerciseTestVO.java | 28 ++++++++++++++++++++++++++++ src/main/java/com/subsidy/vo/administer/LoginVO.java | 11 +++++++++++ src/main/java/com/subsidy/vo/administer/OperatorsVO.java | 29 +++++++++++++++++++++++++++++ src/main/java/com/subsidy/vo/administer/PermissionsVO.java | 17 +++++++++++++++++ src/main/java/com/subsidy/vo/administer/UserRoleVO.java | 17 +++++++++++++++++ src/main/java/com/subsidy/vo/answer/GetCourseQuestionVO.java | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/vo/classdict/ClassDetailVO.java | 73 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/vo/classdict/GetAllClassesVO.java | 24 ++++++++++++++++++++++++ src/main/java/com/subsidy/vo/course/ExerciseVO.java | 31 +++++++++++++++++++++++++++++++ src/main/java/com/subsidy/vo/course/QueryCoursesVO.java | 11 +++++++++++ src/main/java/com/subsidy/vo/exercise/MemberExerciseVO.java | 12 ++++++++++++ src/main/java/com/subsidy/vo/member/ClassSignVO.java | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/vo/member/ContentFilesVO.java | 15 +++++++++++++++ src/main/java/com/subsidy/vo/member/ContentVodNewVO.java | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/vo/member/ContentVodVO.java | 14 ++++++++++++++ src/main/java/com/subsidy/vo/member/GetAllVO.java | 14 ++++++++++++++ src/main/java/com/subsidy/vo/member/GetCourseTestVO.java | 22 ++++++++++++++++++++++ src/main/java/com/subsidy/vo/member/GetMemberSignInfoVO.java | 7 +++++++ src/main/java/com/subsidy/vo/member/GetStudyInfoVO.java | 14 ++++++++++++++ src/main/java/com/subsidy/vo/member/MemberStudyPageVO.java | 21 +++++++++++++++++++++ src/main/java/com/subsidy/vo/member/MemberVodVO.java | 24 ++++++++++++++++++++++++ src/main/java/com/subsidy/vo/member/StudyPageVO.java | 26 ++++++++++++++++++++++++++ src/main/java/com/subsidy/vo/sign/AnswerRecordVO.java | 26 ++++++++++++++++++++++++++ src/main/java/com/subsidy/vo/sign/ClassSignInfoVO.java | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/vo/sign/SignInStatusVO.java | 10 ++++++++++ src/main/java/com/subsidy/vo/vod/GetContendVodsVO.java | 11 +++++++++++ src/main/java/com/subsidy/vo/vod/SignatureVO.java | 10 ++++++++++ src/main/java/com/subsidy/vo/vod/StudyHistoryVO.java | 17 +++++++++++++++++ src/main/resources/application-dev.properties | 28 ++++++++++++++++++++++++++++ src/main/resources/application-prod.properties | 36 ++++++++++++++++++++++++++++++++++++ src/main/resources/application.properties | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/resources/code.properties | 32 ++++++++++++++++++++++++++++++++ src/main/resources/logback-spring.xml | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/resources/mapper/AccessTokenMapper.xml | 81 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/resources/mapper/AdministerDepartmentMappingMapper.xml | 23 +++++++++++++++++++++++ src/main/resources/mapper/AdministerMapper.xml | 122 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/resources/mapper/AdministerPermissionMapper.xml | 43 +++++++++++++++++++++++++++++++++++++++++++ src/main/resources/mapper/AdministerSubjectMappingMapper.xml | 23 +++++++++++++++++++++++ src/main/resources/mapper/AnsweringQuestionMapper.xml | 47 +++++++++++++++++++++++++++++++++++++++++++++++ src/main/resources/mapper/CategoryMapper.xml | 22 ++++++++++++++++++++++ src/main/resources/mapper/ClassDictMapper.xml | 88 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/resources/mapper/ClassMemberMappingMapper.xml | 37 +++++++++++++++++++++++++++++++++++++ src/main/resources/mapper/ClassSubjectTaskMapper.xml | 69 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/resources/mapper/ClassesDictHistoryMapper.xml | 40 ++++++++++++++++++++++++++++++++++++++++ src/main/resources/mapper/ClassesDictMapper.xml | 123 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/resources/mapper/ClassesUserMappingMapper.xml | 22 ++++++++++++++++++++++ src/main/resources/mapper/CompanyDictMapper.xml | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/resources/mapper/CourseAdministerMappingMapper.xml | 35 +++++++++++++++++++++++++++++++++++ src/main/resources/mapper/CourseContentMapper.xml | 37 +++++++++++++++++++++++++++++++++++++ src/main/resources/mapper/CourseDictMapper.xml | 118 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/resources/mapper/CourseStudentStatusHistoryMapper.xml | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/resources/mapper/CourseTreeExerciseStudentResultMapper.xml | 110 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/resources/mapper/CourseTreeVodStudentResultMapper.xml | 23 +++++++++++++++++++++++ src/main/resources/mapper/CourseVodTressStudentResultMapper.xml | 23 +++++++++++++++++++++++ src/main/resources/mapper/DepartmentDictMapper.xml | 36 ++++++++++++++++++++++++++++++++++++ src/main/resources/mapper/ExerciseCourseTreeMappingMapper.xml | 133 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/resources/mapper/ExerciseDictMapper.xml | 28 ++++++++++++++++++++++++++++ src/main/resources/mapper/ExerciseDoneHistoryMapper.xml | 269 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/resources/mapper/ExerciseDoneResultMapper.xml | 25 +++++++++++++++++++++++++ src/main/resources/mapper/ExerciseExpandMappingMapper.xml | 23 +++++++++++++++++++++++ src/main/resources/mapper/ExerciseRelatedMappingMapper.xml | 24 ++++++++++++++++++++++++ src/main/resources/mapper/ExerciseTreeMappingMapper.xml | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/resources/mapper/ExerciseUserInfoMapper.xml | 22 ++++++++++++++++++++++ src/main/resources/mapper/FileDictMapper.xml | 25 +++++++++++++++++++++++++ src/main/resources/mapper/KnowledgeSubjectDictMapper.xml | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/resources/mapper/LaboratoryAttendanceMappingMapper.xml | 25 +++++++++++++++++++++++++ src/main/resources/mapper/LaboratoryDictMapper.xml | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ src/main/resources/mapper/LaboratoryDictMappingMapper.xml | 23 +++++++++++++++++++++++ src/main/resources/mapper/LaboratorySessionMappingMapper.xml | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/resources/mapper/LaboratoryUserMappingMapper.xml | 84 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/resources/mapper/MemberDepartmentMappingMapper.xml | 20 ++++++++++++++++++++ src/main/resources/mapper/MemberMapper.xml | 77 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/resources/mapper/PermissionsDictMapper.xml | 24 ++++++++++++++++++++++++ src/main/resources/mapper/RoleAdministerMappingMapper.xml | 23 +++++++++++++++++++++++ src/main/resources/mapper/RoleDictMapper.xml | 22 ++++++++++++++++++++++ src/main/resources/mapper/RolePermissionMappingMapper.xml | 23 +++++++++++++++++++++++ src/main/resources/mapper/SessionsDictMapper.xml | 43 +++++++++++++++++++++++++++++++++++++++++++ src/main/resources/mapper/SignInRecordMapper.xml | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ src/main/resources/mapper/SmsCodeMapper.xml | 23 +++++++++++++++++++++++ src/main/resources/mapper/SmsVerifyCodeMapper.xml | 23 +++++++++++++++++++++++ src/main/resources/mapper/SubjectDictMapper.xml | 43 +++++++++++++++++++++++++++++++++++++++++++ src/main/resources/mapper/SubjectDimensionDictMapper.xml | 24 ++++++++++++++++++++++++ src/main/resources/mapper/SubjectDimensionStarDictMapper.xml | 37 +++++++++++++++++++++++++++++++++++++ src/main/resources/mapper/SubjectRuleMapper.xml | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/resources/mapper/SubjectSemesterMapper.xml | 129 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/resources/mapper/SubjectStarTreeMappingMapper.xml | 37 +++++++++++++++++++++++++++++++++++++ src/main/resources/mapper/SubjectStudentAnswerStarMapper.xml | 23 +++++++++++++++++++++++ src/main/resources/mapper/SubjectTestDictMapper.xml | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/resources/mapper/SubjectTestGradeExampleMappingMapper.xml | 23 +++++++++++++++++++++++ src/main/resources/mapper/SubjectTestGradeStarMappingMapper.xml | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/resources/mapper/SubjectTestPublishGradeMapper.xml | 22 ++++++++++++++++++++++ src/main/resources/mapper/SubjectTestPublishHistoryMapper.xml | 199 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/resources/mapper/SubjectTestStudentAnswerMapper.xml | 41 +++++++++++++++++++++++++++++++++++++++++ src/main/resources/mapper/SubjectTreeMapper.xml | 42 ++++++++++++++++++++++++++++++++++++++++++ src/main/resources/mapper/TaskCompletionStatusMapper.xml | 24 ++++++++++++++++++++++++ src/main/resources/mapper/TaskContentDoneInfoMapper.xml | 23 +++++++++++++++++++++++ src/main/resources/mapper/TaskContentMapper.xml | 22 ++++++++++++++++++++++ src/main/resources/mapper/TaskDoneHistoryMapper.xml | 21 +++++++++++++++++++++ src/main/resources/mapper/UserRoleCopy1Mapper.xml | 25 +++++++++++++++++++++++++ src/main/resources/mapper/UserRoleMapper.xml | 113 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/resources/mapper/UserSubjectMappingMapper.xml | 35 +++++++++++++++++++++++++++++++++++ src/main/resources/mapper/UserSubjectPermissionDictMapper.xml | 33 +++++++++++++++++++++++++++++++++ src/main/resources/mapper/UuidHistoryMapper.xml | 22 ++++++++++++++++++++++ src/main/resources/mapper/VodDictMapper.xml | 44 ++++++++++++++++++++++++++++++++++++++++++++ src/main/resources/mapper/VodPlayHistoryMapper.xml | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/resources/mapper/VodSubjectTreeMappingMapper.xml | 73 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/resources/mapper/WrittenHomeworkMapper.xml | 25 +++++++++++++++++++++++++ src/main/resources/mybatis-plus.properties | 12 ++++++++++++ src/main/resources/mybatis.xml | 9 +++++++++ src/main/resources/templates/controller.java.ftl | 41 +++++++++++++++++++++++++++++++++++++++++ src/main/resources/templates/entity.java.ftl | 156 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/resources/templates/mapper.java.ftl | 22 ++++++++++++++++++++++ src/main/resources/templates/mapper.xml.ftl | 39 +++++++++++++++++++++++++++++++++++++++ src/main/resources/templates/service.java.ftl | 20 ++++++++++++++++++++ src/main/resources/templates/serviceImpl.java.ftl | 26 ++++++++++++++++++++++++++ 915 files changed, 42667 insertions(+) create mode 100644 .gitignore create mode 100644 mvnw create mode 100644 mvnw.cmd create mode 100644 pom.xml create mode 100644 src/main/java/com/meishu/MeishuApplication.java create mode 100644 src/main/java/com/meishu/common/Code.java create mode 100644 src/main/java/com/meishu/common/ResponseData.java create mode 100644 src/main/java/com/meishu/common/ResponseVO.java create mode 100644 src/main/java/com/meishu/common/configure/AliyunSmsProperties.java create mode 100644 src/main/java/com/meishu/common/configure/MybatisPlusConfig.java create mode 100644 src/main/java/com/meishu/common/configure/RemoteProperties.java create mode 100644 src/main/java/com/meishu/common/configure/RestTemplateConfig.java create mode 100644 src/main/java/com/meishu/common/configure/SwaggerConfig.java create mode 100644 src/main/java/com/meishu/common/configure/VODConfig.java create mode 100644 src/main/java/com/meishu/common/configure/WebConfig.java create mode 100644 src/main/java/com/meishu/common/configure/WebLogAspect.java create mode 100644 src/main/java/com/meishu/common/configure/WechatConfig.java create mode 100644 src/main/java/com/meishu/common/constant/AttendanceConstant.java create mode 100644 src/main/java/com/meishu/common/constant/Code.java create mode 100644 src/main/java/com/meishu/common/constant/WxConstant.java create mode 100644 src/main/java/com/meishu/common/exception/GlobalExceptionHandler.java create mode 100644 src/main/java/com/meishu/common/exception/HttpException.java create mode 100644 src/main/java/com/meishu/common/handler/MetaHandler.java create mode 100644 src/main/java/com/meishu/common/interceptor/AuthenticationInterceptor.java create mode 100644 src/main/java/com/meishu/common/interceptor/LoginRequired.java create mode 100644 src/main/java/com/meishu/common/schedule/ChangeStudentStatus.java create mode 100644 src/main/java/com/meishu/controller/AccessTokenController.java create mode 100644 src/main/java/com/meishu/controller/AdministerController.java create mode 100644 src/main/java/com/meishu/controller/AdministerDepartmentMappingController.java create mode 100644 src/main/java/com/meishu/controller/AdministerPermissionController.java create mode 100644 src/main/java/com/meishu/controller/AdministerSubjectMappingController.java create mode 100644 src/main/java/com/meishu/controller/AnsweringQuestionController.java create mode 100644 src/main/java/com/meishu/controller/ClassSubjectTaskController.java create mode 100644 src/main/java/com/meishu/controller/ClassesDictController.java create mode 100644 src/main/java/com/meishu/controller/ClassesDictHistoryController.java create mode 100644 src/main/java/com/meishu/controller/ClassesUserMappingController.java create mode 100644 src/main/java/com/meishu/controller/CourseAdministerMappingController.java create mode 100644 src/main/java/com/meishu/controller/CourseStudentStatusHistoryController.java create mode 100644 src/main/java/com/meishu/controller/CourseTreeExerciseStudentResultController.java create mode 100644 src/main/java/com/meishu/controller/CourseTreeVodStudentResultController.java create mode 100644 src/main/java/com/meishu/controller/DepartmentDictController.java create mode 100644 src/main/java/com/meishu/controller/ExerciseCourseTreeMappingController.java create mode 100644 src/main/java/com/meishu/controller/ExerciseDictController.java create mode 100644 src/main/java/com/meishu/controller/ExerciseDoneHistoryController.java create mode 100644 src/main/java/com/meishu/controller/ExerciseExpandMappingController.java create mode 100644 src/main/java/com/meishu/controller/ExerciseRelatedMappingController.java create mode 100644 src/main/java/com/meishu/controller/ExerciseTreeMappingController.java create mode 100644 src/main/java/com/meishu/controller/ExerciseUserInfoController.java create mode 100644 src/main/java/com/meishu/controller/KnowledgeSubjectDictController.java create mode 100644 src/main/java/com/meishu/controller/LaboratoryAttendanceMappingController.java create mode 100644 src/main/java/com/meishu/controller/LaboratoryDictController.java create mode 100644 src/main/java/com/meishu/controller/LaboratoryDictMappingController.java create mode 100644 src/main/java/com/meishu/controller/LaboratorySessionMappingController.java create mode 100644 src/main/java/com/meishu/controller/LaboratoryUserMappingController.java create mode 100644 src/main/java/com/meishu/controller/PermissionsDictController.java create mode 100644 src/main/java/com/meishu/controller/RoleAdministerMappingController.java create mode 100644 src/main/java/com/meishu/controller/RoleDictController.java create mode 100644 src/main/java/com/meishu/controller/RolePermissionMappingController.java create mode 100644 src/main/java/com/meishu/controller/SessionsDictController.java create mode 100644 src/main/java/com/meishu/controller/SignInRecordController.java create mode 100644 src/main/java/com/meishu/controller/SmsCodeController.java create mode 100644 src/main/java/com/meishu/controller/StudentController.java create mode 100644 src/main/java/com/meishu/controller/StuentCourseMappingController.java create mode 100644 src/main/java/com/meishu/controller/SubjectDictController.java create mode 100644 src/main/java/com/meishu/controller/SubjectDimensionDictController.java create mode 100644 src/main/java/com/meishu/controller/SubjectDimensionStarDictController.java create mode 100644 src/main/java/com/meishu/controller/SubjectRuleController.java create mode 100644 src/main/java/com/meishu/controller/SubjectSemesterController.java create mode 100644 src/main/java/com/meishu/controller/SubjectStarTreeMappingController.java create mode 100644 src/main/java/com/meishu/controller/SubjectStudentAnswerStarController.java create mode 100644 src/main/java/com/meishu/controller/SubjectTestDictController.java create mode 100644 src/main/java/com/meishu/controller/SubjectTestGradeExampleMappingController.java create mode 100644 src/main/java/com/meishu/controller/SubjectTestGradeStarMappingController.java create mode 100644 src/main/java/com/meishu/controller/SubjectTestPublishGradeController.java create mode 100644 src/main/java/com/meishu/controller/SubjectTestPublishHistoryController.java create mode 100644 src/main/java/com/meishu/controller/SubjectTestStudentAnswerController.java create mode 100644 src/main/java/com/meishu/controller/SubjectTreeController.java create mode 100644 src/main/java/com/meishu/controller/TaskCompletionStatusController.java create mode 100644 src/main/java/com/meishu/controller/TaskContentController.java create mode 100644 src/main/java/com/meishu/controller/TaskContentDoneInfoController.java create mode 100644 src/main/java/com/meishu/controller/TaskDoneHistoryController.java create mode 100644 src/main/java/com/meishu/controller/UserRoleController.java create mode 100644 src/main/java/com/meishu/controller/UserSubjectMappingController.java create mode 100644 src/main/java/com/meishu/controller/UserSubjectPermissionDictController.java create mode 100644 src/main/java/com/meishu/controller/UuidHistoryController.java create mode 100644 src/main/java/com/meishu/controller/VodDictController.java create mode 100644 src/main/java/com/meishu/controller/VodPlayHistoryController.java create mode 100644 src/main/java/com/meishu/controller/VodSubjectTreeMappingController.java create mode 100644 src/main/java/com/meishu/controller/WechatController.java create mode 100644 src/main/java/com/meishu/controller/WrittenHomeworkController.java create mode 100644 src/main/java/com/meishu/dto/administer/AddAdministerDTO.java create mode 100644 src/main/java/com/meishu/dto/administer/ChangeStatusDTO.java create mode 100644 src/main/java/com/meishu/dto/administer/GetClassesRequestVO.java create mode 100644 src/main/java/com/meishu/dto/administer/PublishExpandingVO.java create mode 100644 src/main/java/com/meishu/dto/administer/PublishHomeworkVO.java create mode 100644 src/main/java/com/meishu/dto/administer/PublishTasksDTO.java create mode 100644 src/main/java/com/meishu/dto/administer/PushMsgPO.java create mode 100644 src/main/java/com/meishu/dto/administer/UpdateAdministerDTO.java create mode 100644 src/main/java/com/meishu/dto/campus/BatchUpdateStatusDTO.java create mode 100644 src/main/java/com/meishu/dto/campus/CampusStudentDTO.java create mode 100644 src/main/java/com/meishu/dto/chapter/AddTreeToChapterDTO.java create mode 100644 src/main/java/com/meishu/dto/chapter/ChapterExerciseVO.java create mode 100644 src/main/java/com/meishu/dto/chapter/ChapterVodsVO.java create mode 100644 src/main/java/com/meishu/dto/chapter/GetChapterCourseDetailVO.java create mode 100644 src/main/java/com/meishu/dto/chapter/StudentChapterDTO.java create mode 100644 src/main/java/com/meishu/dto/chapter/UpdateChapterOrderDTO.java create mode 100644 src/main/java/com/meishu/dto/classes/AddClassDTO.java create mode 100644 src/main/java/com/meishu/dto/classes/AddSubjectTeacherDTO.java create mode 100644 src/main/java/com/meishu/dto/classes/AddSubjectTeacherMappingDTO.java create mode 100644 src/main/java/com/meishu/dto/classes/BatchAddStudentToClassDTO.java create mode 100644 src/main/java/com/meishu/dto/classes/BatchUpGradeDTO.java create mode 100644 src/main/java/com/meishu/dto/classes/GetClassStudentsDTO.java create mode 100644 src/main/java/com/meishu/dto/classes/GetClassesDTO.java create mode 100644 src/main/java/com/meishu/dto/classes/QueryNoClassStudentsDTO.java create mode 100644 src/main/java/com/meishu/dto/course/AddCourseDTO.java create mode 100644 src/main/java/com/meishu/dto/course/AddCourseTreeNodeDTO.java create mode 100644 src/main/java/com/meishu/dto/course/AddStudentAuthenDTO.java create mode 100644 src/main/java/com/meishu/dto/course/BatchVodOprDTO.java create mode 100644 src/main/java/com/meishu/dto/course/CourseProgressDTO.java create mode 100644 src/main/java/com/meishu/dto/course/CourseVodDTO.java create mode 100644 src/main/java/com/meishu/dto/course/GetAllUnAuthenStudentsDTO.java create mode 100644 src/main/java/com/meishu/dto/course/GetCourseStudentsDTO.java create mode 100644 src/main/java/com/meishu/dto/course/GetExercisesByTreeDTO.java create mode 100644 src/main/java/com/meishu/dto/department/BatchOprDTO.java create mode 100644 src/main/java/com/meishu/dto/department/GetAllDepartmentVO.java create mode 100644 src/main/java/com/meishu/dto/department/GetTeachersDTO.java create mode 100644 src/main/java/com/meishu/dto/dimension/AddStarDTO.java create mode 100644 src/main/java/com/meishu/dto/dimension/DeleteStarByIdDTO.java create mode 100644 src/main/java/com/meishu/dto/exercise/AddExerciseDTO.java create mode 100644 src/main/java/com/meishu/dto/exercise/CheckExerciseDTO.java create mode 100644 src/main/java/com/meishu/dto/exercise/ExeLatexExpressDTO.java create mode 100644 src/main/java/com/meishu/dto/exercise/GetExerciseRequestDTO.java create mode 100644 src/main/java/com/meishu/dto/exercise/GetStatusVodsDTO.java create mode 100644 src/main/java/com/meishu/dto/exercise/GetTreeExercisesDTO.java create mode 100644 src/main/java/com/meishu/dto/exercise/QueryCourseTreeExerciseDTO.java create mode 100644 src/main/java/com/meishu/dto/exercise/UpdateStatusDTO.java create mode 100644 src/main/java/com/meishu/dto/grade/AddGradeDTO.java create mode 100644 src/main/java/com/meishu/dto/laboratory/LaboratoryDictDTO.java create mode 100644 src/main/java/com/meishu/dto/laboratory/LaboratoryPageDTO.java create mode 100644 src/main/java/com/meishu/dto/laboratorySession/CalendarStatusDTO.java create mode 100644 src/main/java/com/meishu/dto/laboratorySession/GetLaboratorySessionDTO.java create mode 100644 src/main/java/com/meishu/dto/laboratorySession/LaboratorySessionListDTO.java create mode 100644 src/main/java/com/meishu/dto/laboratorySession/SetLaboratorySessionDTO.java create mode 100644 src/main/java/com/meishu/dto/laboratoryUser/ApplyDTO.java create mode 100644 src/main/java/com/meishu/dto/laboratoryUser/LaboratoryUserPageDTO.java create mode 100644 src/main/java/com/meishu/dto/question/QueryQuestionsDTO.java create mode 100644 src/main/java/com/meishu/dto/role/AddPermissionDTO.java create mode 100644 src/main/java/com/meishu/dto/role/DeletePermissionDTO.java create mode 100644 src/main/java/com/meishu/dto/role/GetRoleTeachersDTO.java create mode 100644 src/main/java/com/meishu/dto/role/RoleTeacherDTO.java create mode 100644 src/main/java/com/meishu/dto/rule/GetAllRulesDTO.java create mode 100644 src/main/java/com/meishu/dto/rule/GetRuleReportDTO.java create mode 100644 src/main/java/com/meishu/dto/semester/GetSemesterScoreDTO.java create mode 100644 src/main/java/com/meishu/dto/semester/GetStudentDetailDTO.java create mode 100644 src/main/java/com/meishu/dto/semester/GetStudentRecordDTO.java create mode 100644 src/main/java/com/meishu/dto/sessions/SessionsDictPageDTO.java create mode 100644 src/main/java/com/meishu/dto/sign/ClassSignInDTO.java create mode 100644 src/main/java/com/meishu/dto/sms/SendVerifyCodeDTO.java create mode 100644 src/main/java/com/meishu/dto/sms/VerifyCodeDTO.java create mode 100644 src/main/java/com/meishu/dto/student/DeleteStudentDTO.java create mode 100644 src/main/java/com/meishu/dto/student/GetChildTreesDTO.java create mode 100644 src/main/java/com/meishu/dto/student/GetStudentRulesDTO.java create mode 100644 src/main/java/com/meishu/dto/student/GetStudyProgressDTO.java create mode 100644 src/main/java/com/meishu/dto/student/GetVodIndexDTO.java create mode 100644 src/main/java/com/meishu/dto/student/SearchVodsDTO.java create mode 100644 src/main/java/com/meishu/dto/student/SubmitTestDTO.java create mode 100644 src/main/java/com/meishu/dto/subject/BatchStatusOprDTO.java create mode 100644 src/main/java/com/meishu/dto/subject/GetAllVodsStatusDTO.java create mode 100644 src/main/java/com/meishu/dto/subject/GetSubjectAdministerDTO.java create mode 100644 src/main/java/com/meishu/dto/subject/GetSubjectTreeDTO.java create mode 100644 src/main/java/com/meishu/dto/subject/GetSubjectsDTO.java create mode 100644 src/main/java/com/meishu/dto/subject/UpdateTreeOrderDTO.java create mode 100644 src/main/java/com/meishu/dto/task/ClassDoneInfoDTO.java create mode 100644 src/main/java/com/meishu/dto/task/ExeRightRatioDTO.java create mode 100644 src/main/java/com/meishu/dto/task/ExesDoneInfoPO.java create mode 100644 src/main/java/com/meishu/dto/task/GetClassStudentsDTO.java create mode 100644 src/main/java/com/meishu/dto/task/GetClassesRequestVO.java create mode 100644 src/main/java/com/meishu/dto/task/GetRecommendExeByTreeIdVO.java create mode 100644 src/main/java/com/meishu/dto/task/GetRecommendVodByTreeIdVO.java create mode 100644 src/main/java/com/meishu/dto/task/GetTaskByIdRequestDTO.java create mode 100644 src/main/java/com/meishu/dto/task/GetUserVodPlayDTO.java create mode 100644 src/main/java/com/meishu/dto/task/PerStudentExesDTO.java create mode 100644 src/main/java/com/meishu/dto/task/PerStudentExesRequestVO.java create mode 100644 src/main/java/com/meishu/dto/task/QueryTaskDetailDTO.java create mode 100644 src/main/java/com/meishu/dto/task/StudentDoneInfoRequestVO.java create mode 100644 src/main/java/com/meishu/dto/test/CommentDTO.java create mode 100644 src/main/java/com/meishu/dto/test/GetAllTestDTO.java create mode 100644 src/main/java/com/meishu/dto/test/GetOnePublishDTO.java create mode 100644 src/main/java/com/meishu/dto/test/GetPublishHistoryDTO.java create mode 100644 src/main/java/com/meishu/dto/test/GetTestReportDTO.java create mode 100644 src/main/java/com/meishu/dto/test/PublishTestDTO.java create mode 100644 src/main/java/com/meishu/dto/token/GetAllStudentsDTO.java create mode 100644 src/main/java/com/meishu/dto/token/GetAllTeachersDTO.java create mode 100644 src/main/java/com/meishu/dto/userrole/AccountLoginDTO.java create mode 100644 src/main/java/com/meishu/dto/userrole/AddStudentsDTO.java create mode 100644 src/main/java/com/meishu/dto/userrole/QueryStudentsDTO.java create mode 100644 src/main/java/com/meishu/dto/voddict/CheckVodDTO.java create mode 100644 src/main/java/com/meishu/dto/voddict/DeleteOriginVodDTO.java create mode 100644 src/main/java/com/meishu/dto/voddict/GetToCheckVodCountsDTO.java create mode 100644 src/main/java/com/meishu/dto/voddict/GetTreeVodsDTO.java create mode 100644 src/main/java/com/meishu/dto/voddict/MediaProcessResultSet.java create mode 100644 src/main/java/com/meishu/dto/voddict/Output.java create mode 100644 src/main/java/com/meishu/dto/voddict/ProcedureStateChangeEvent.java create mode 100644 src/main/java/com/meishu/dto/voddict/PublicCheckingDTO.java create mode 100644 src/main/java/com/meishu/dto/voddict/TranscodeTask.java create mode 100644 src/main/java/com/meishu/dto/voddict/UploadVodsDTO.java create mode 100644 src/main/java/com/meishu/dto/wechat/AuthenRequestDTO.java create mode 100644 src/main/java/com/meishu/dto/wechat/InviteDTO.java create mode 100644 src/main/java/com/meishu/dto/wechat/JsSdkDTO.java create mode 100644 src/main/java/com/meishu/dto/wechat/PushMsgVO.java create mode 100644 src/main/java/com/meishu/dto/wechat/SignDTO.java create mode 100644 src/main/java/com/meishu/dto/wechat/WechatInviteDTO.java create mode 100644 src/main/java/com/meishu/job/UpgradeClassJob.java create mode 100644 src/main/java/com/meishu/mapper/AccessTokenMapper.java create mode 100644 src/main/java/com/meishu/mapper/AdministerDepartmentMappingMapper.java create mode 100644 src/main/java/com/meishu/mapper/AdministerMapper.java create mode 100644 src/main/java/com/meishu/mapper/AdministerPermissionMapper.java create mode 100644 src/main/java/com/meishu/mapper/AdministerSubjectMappingMapper.java create mode 100644 src/main/java/com/meishu/mapper/AnsweringQuestionMapper.java create mode 100644 src/main/java/com/meishu/mapper/ClassSubjectTaskMapper.java create mode 100644 src/main/java/com/meishu/mapper/ClassesDictHistoryMapper.java create mode 100644 src/main/java/com/meishu/mapper/ClassesDictMapper.java create mode 100644 src/main/java/com/meishu/mapper/ClassesUserMappingMapper.java create mode 100644 src/main/java/com/meishu/mapper/CourseAdministerMappingMapper.java create mode 100644 src/main/java/com/meishu/mapper/CourseStudentStatusHistoryMapper.java create mode 100644 src/main/java/com/meishu/mapper/CourseTreeExerciseStudentResultMapper.java create mode 100644 src/main/java/com/meishu/mapper/CourseTreeVodStudentResultMapper.java create mode 100644 src/main/java/com/meishu/mapper/CourseVodTressStudentResultMapper.java create mode 100644 src/main/java/com/meishu/mapper/DepartmentDictMapper.java create mode 100644 src/main/java/com/meishu/mapper/ExerciseCourseTreeMappingMapper.java create mode 100644 src/main/java/com/meishu/mapper/ExerciseDictMapper.java create mode 100644 src/main/java/com/meishu/mapper/ExerciseDoneHistoryMapper.java create mode 100644 src/main/java/com/meishu/mapper/ExerciseExpandMappingMapper.java create mode 100644 src/main/java/com/meishu/mapper/ExerciseRelatedMappingMapper.java create mode 100644 src/main/java/com/meishu/mapper/ExerciseTreeMappingMapper.java create mode 100644 src/main/java/com/meishu/mapper/ExerciseUserInfoMapper.java create mode 100644 src/main/java/com/meishu/mapper/KnowledgeSubjectDictMapper.java create mode 100644 src/main/java/com/meishu/mapper/LaboratoryAttendanceMappingMapper.java create mode 100644 src/main/java/com/meishu/mapper/LaboratoryDictMapper.java create mode 100644 src/main/java/com/meishu/mapper/LaboratoryDictMappingMapper.java create mode 100644 src/main/java/com/meishu/mapper/LaboratorySessionMappingMapper.java create mode 100644 src/main/java/com/meishu/mapper/LaboratoryUserMappingMapper.java create mode 100644 src/main/java/com/meishu/mapper/PermissionsDictMapper.java create mode 100644 src/main/java/com/meishu/mapper/RoleAdministerMappingMapper.java create mode 100644 src/main/java/com/meishu/mapper/RoleDictMapper.java create mode 100644 src/main/java/com/meishu/mapper/RolePermissionMappingMapper.java create mode 100644 src/main/java/com/meishu/mapper/SessionsDictMapper.java create mode 100644 src/main/java/com/meishu/mapper/SignInRecordMapper.java create mode 100644 src/main/java/com/meishu/mapper/SmsCodeMapper.java create mode 100644 src/main/java/com/meishu/mapper/StudentMapper.java create mode 100644 src/main/java/com/meishu/mapper/SubjectDictMapper.java create mode 100644 src/main/java/com/meishu/mapper/SubjectDimensionDictMapper.java create mode 100644 src/main/java/com/meishu/mapper/SubjectDimensionStarDictMapper.java create mode 100644 src/main/java/com/meishu/mapper/SubjectRuleMapper.java create mode 100644 src/main/java/com/meishu/mapper/SubjectSemesterMapper.java create mode 100644 src/main/java/com/meishu/mapper/SubjectStarTreeMappingMapper.java create mode 100644 src/main/java/com/meishu/mapper/SubjectStudentAnswerStarMapper.java create mode 100644 src/main/java/com/meishu/mapper/SubjectTestDictMapper.java create mode 100644 src/main/java/com/meishu/mapper/SubjectTestGradeExampleMappingMapper.java create mode 100644 src/main/java/com/meishu/mapper/SubjectTestGradeStarMappingMapper.java create mode 100644 src/main/java/com/meishu/mapper/SubjectTestPublishGradeMapper.java create mode 100644 src/main/java/com/meishu/mapper/SubjectTestPublishHistoryMapper.java create mode 100644 src/main/java/com/meishu/mapper/SubjectTestStudentAnswerMapper.java create mode 100644 src/main/java/com/meishu/mapper/SubjectTreeMapper.java create mode 100644 src/main/java/com/meishu/mapper/TaskCompletionStatusMapper.java create mode 100644 src/main/java/com/meishu/mapper/TaskContentDoneInfoMapper.java create mode 100644 src/main/java/com/meishu/mapper/TaskContentMapper.java create mode 100644 src/main/java/com/meishu/mapper/TaskDoneHistoryMapper.java create mode 100644 src/main/java/com/meishu/mapper/UserRoleCopy1Mapper.java create mode 100644 src/main/java/com/meishu/mapper/UserRoleMapper.java create mode 100644 src/main/java/com/meishu/mapper/UserSubjectMappingMapper.java create mode 100644 src/main/java/com/meishu/mapper/UserSubjectPermissionDictMapper.java create mode 100644 src/main/java/com/meishu/mapper/UuidHistoryMapper.java create mode 100644 src/main/java/com/meishu/mapper/VodDictMapper.java create mode 100644 src/main/java/com/meishu/mapper/VodPlayHistoryMapper.java create mode 100644 src/main/java/com/meishu/mapper/VodSubjectTreeMappingMapper.java create mode 100644 src/main/java/com/meishu/mapper/WrittenHomeworkMapper.java create mode 100644 src/main/java/com/meishu/model/AccessTokenDO.java create mode 100644 src/main/java/com/meishu/model/AdministerDO.java create mode 100644 src/main/java/com/meishu/model/AdministerDepartmentMappingDO.java create mode 100644 src/main/java/com/meishu/model/AdministerPermissionDO.java create mode 100644 src/main/java/com/meishu/model/AdministerSubjectMappingDO.java create mode 100644 src/main/java/com/meishu/model/AnsweringQuestionDO.java create mode 100644 src/main/java/com/meishu/model/CampusAdministerMappingDO.java create mode 100644 src/main/java/com/meishu/model/CampusDictDO.java create mode 100644 src/main/java/com/meishu/model/ClassSubjectTaskDO.java create mode 100644 src/main/java/com/meishu/model/ClassesDictDO.java create mode 100644 src/main/java/com/meishu/model/ClassesDictHistoryDO.java create mode 100644 src/main/java/com/meishu/model/ClassesUserMappingDO.java create mode 100644 src/main/java/com/meishu/model/CourseAdministerMappingDO.java create mode 100644 src/main/java/com/meishu/model/CourseChapterDO.java create mode 100644 src/main/java/com/meishu/model/CourseDictDO.java create mode 100644 src/main/java/com/meishu/model/CourseStudentStatusHistoryDO.java create mode 100644 src/main/java/com/meishu/model/CourseTreeDO.java create mode 100644 src/main/java/com/meishu/model/CourseTreeExerciseStudentResultDO.java create mode 100644 src/main/java/com/meishu/model/CourseTreeVodStudentResultDO.java create mode 100644 src/main/java/com/meishu/model/DepartmentDictDO.java create mode 100644 src/main/java/com/meishu/model/ExerciseCourseTreeMappingDO.java create mode 100644 src/main/java/com/meishu/model/ExerciseDictDO.java create mode 100644 src/main/java/com/meishu/model/ExerciseDoneHistoryDO.java create mode 100644 src/main/java/com/meishu/model/ExerciseExpandMappingDO.java create mode 100644 src/main/java/com/meishu/model/ExerciseRelatedMappingDO.java create mode 100644 src/main/java/com/meishu/model/ExerciseTreeMappingDO.java create mode 100644 src/main/java/com/meishu/model/ExerciseUserInfoDO.java create mode 100644 src/main/java/com/meishu/model/KnowledgeSubjectDictDO.java create mode 100644 src/main/java/com/meishu/model/LaboratoryAttendanceMappingDO.java create mode 100644 src/main/java/com/meishu/model/LaboratoryDictDO.java create mode 100644 src/main/java/com/meishu/model/LaboratoryDictMappingDO.java create mode 100644 src/main/java/com/meishu/model/LaboratorySessionMappingDO.java create mode 100644 src/main/java/com/meishu/model/LaboratoryUserMappingDO.java create mode 100644 src/main/java/com/meishu/model/PermissionsDictDO.java create mode 100644 src/main/java/com/meishu/model/PtStudentScoreDO.java create mode 100644 src/main/java/com/meishu/model/RoleAdministerMappingDO.java create mode 100644 src/main/java/com/meishu/model/RoleDictDO.java create mode 100644 src/main/java/com/meishu/model/RolePermissionMappingDO.java create mode 100644 src/main/java/com/meishu/model/SessionsDictDO.java create mode 100644 src/main/java/com/meishu/model/SignInRecordDO.java create mode 100644 src/main/java/com/meishu/model/SmsCodeDO.java create mode 100644 src/main/java/com/meishu/model/StudentCourseMappingDO.java create mode 100644 src/main/java/com/meishu/model/StudentDO.java create mode 100644 src/main/java/com/meishu/model/SubjectDictDO.java create mode 100644 src/main/java/com/meishu/model/SubjectDimensionDictDO.java create mode 100644 src/main/java/com/meishu/model/SubjectDimensionStarDictDO.java create mode 100644 src/main/java/com/meishu/model/SubjectRuleDO.java create mode 100644 src/main/java/com/meishu/model/SubjectSemesterDO.java create mode 100644 src/main/java/com/meishu/model/SubjectStarTreeMappingDO.java create mode 100644 src/main/java/com/meishu/model/SubjectStudentAnswerStarDO.java create mode 100644 src/main/java/com/meishu/model/SubjectTestDictDO.java create mode 100644 src/main/java/com/meishu/model/SubjectTestGradeExampleMappingDO.java create mode 100644 src/main/java/com/meishu/model/SubjectTestGradeStarMappingDO.java create mode 100644 src/main/java/com/meishu/model/SubjectTestPublishGradeDO.java create mode 100644 src/main/java/com/meishu/model/SubjectTestPublishHistoryDO.java create mode 100644 src/main/java/com/meishu/model/SubjectTestStudentAnswerDO.java create mode 100644 src/main/java/com/meishu/model/SubjectTreeDO.java create mode 100644 src/main/java/com/meishu/model/TaskCompletionStatusDO.java create mode 100644 src/main/java/com/meishu/model/TaskContentDO.java create mode 100644 src/main/java/com/meishu/model/TaskContentDoneInfoDO.java create mode 100644 src/main/java/com/meishu/model/TaskDoneHistoryDO.java create mode 100644 src/main/java/com/meishu/model/UserRoleCopy1DO.java create mode 100644 src/main/java/com/meishu/model/UserRoleDO.java create mode 100644 src/main/java/com/meishu/model/UserSubjectMappingDO.java create mode 100644 src/main/java/com/meishu/model/UserSubjectPermissionDictDO.java create mode 100644 src/main/java/com/meishu/model/UuidHistoryDO.java create mode 100644 src/main/java/com/meishu/model/VodDictDO.java create mode 100644 src/main/java/com/meishu/model/VodPlayHistoryDO.java create mode 100644 src/main/java/com/meishu/model/VodSubjectTreeMappingDO.java create mode 100644 src/main/java/com/meishu/model/WrittenHomeworkDO.java create mode 100644 src/main/java/com/meishu/service/AccessTokenService.java create mode 100644 src/main/java/com/meishu/service/AdministerDepartmentMappingService.java create mode 100644 src/main/java/com/meishu/service/AdministerPermissionService.java create mode 100644 src/main/java/com/meishu/service/AdministerService.java create mode 100644 src/main/java/com/meishu/service/AdministerSubjectMappingService.java create mode 100644 src/main/java/com/meishu/service/AnsweringQuestionService.java create mode 100644 src/main/java/com/meishu/service/ClassSubjectTaskService.java create mode 100644 src/main/java/com/meishu/service/ClassesDictHistoryService.java create mode 100644 src/main/java/com/meishu/service/ClassesDictService.java create mode 100644 src/main/java/com/meishu/service/ClassesUserMappingService.java create mode 100644 src/main/java/com/meishu/service/CourseAdministerMappingService.java create mode 100644 src/main/java/com/meishu/service/CourseStudentStatusHistoryService.java create mode 100644 src/main/java/com/meishu/service/CourseTreeExerciseStudentResultService.java create mode 100644 src/main/java/com/meishu/service/CourseTreeVodStudentResultService.java create mode 100644 src/main/java/com/meishu/service/DepartmentDictService.java create mode 100644 src/main/java/com/meishu/service/ExerciseCourseTreeMappingService.java create mode 100644 src/main/java/com/meishu/service/ExerciseDictService.java create mode 100644 src/main/java/com/meishu/service/ExerciseDoneHistoryService.java create mode 100644 src/main/java/com/meishu/service/ExerciseExpandMappingService.java create mode 100644 src/main/java/com/meishu/service/ExerciseRelatedMappingService.java create mode 100644 src/main/java/com/meishu/service/ExerciseTreeMappingService.java create mode 100644 src/main/java/com/meishu/service/ExerciseUserInfoService.java create mode 100644 src/main/java/com/meishu/service/KnowledgeSubjectDictService.java create mode 100644 src/main/java/com/meishu/service/LaboratoryAttendanceMappingService.java create mode 100644 src/main/java/com/meishu/service/LaboratoryDictMappingService.java create mode 100644 src/main/java/com/meishu/service/LaboratoryDictService.java create mode 100644 src/main/java/com/meishu/service/LaboratorySessionMappingService.java create mode 100644 src/main/java/com/meishu/service/LaboratoryUserMappingService.java create mode 100644 src/main/java/com/meishu/service/PermissionsDictService.java create mode 100644 src/main/java/com/meishu/service/RoleAdministerMappingService.java create mode 100644 src/main/java/com/meishu/service/RoleDictService.java create mode 100644 src/main/java/com/meishu/service/RolePermissionMappingService.java create mode 100644 src/main/java/com/meishu/service/SessionsDictService.java create mode 100644 src/main/java/com/meishu/service/SignInRecordService.java create mode 100644 src/main/java/com/meishu/service/SmsCodeService.java create mode 100644 src/main/java/com/meishu/service/StudentService.java create mode 100644 src/main/java/com/meishu/service/SubjectDictService.java create mode 100644 src/main/java/com/meishu/service/SubjectDimensionDictService.java create mode 100644 src/main/java/com/meishu/service/SubjectDimensionStarDictService.java create mode 100644 src/main/java/com/meishu/service/SubjectRuleService.java create mode 100644 src/main/java/com/meishu/service/SubjectSemesterService.java create mode 100644 src/main/java/com/meishu/service/SubjectStarTreeMappingService.java create mode 100644 src/main/java/com/meishu/service/SubjectStudentAnswerStarService.java create mode 100644 src/main/java/com/meishu/service/SubjectTestDictService.java create mode 100644 src/main/java/com/meishu/service/SubjectTestGradeExampleMappingService.java create mode 100644 src/main/java/com/meishu/service/SubjectTestGradeStarMappingService.java create mode 100644 src/main/java/com/meishu/service/SubjectTestPublishGradeService.java create mode 100644 src/main/java/com/meishu/service/SubjectTestPublishHistoryService.java create mode 100644 src/main/java/com/meishu/service/SubjectTestStudentAnswerService.java create mode 100644 src/main/java/com/meishu/service/SubjectTreeService.java create mode 100644 src/main/java/com/meishu/service/TaskCompletionStatusService.java create mode 100644 src/main/java/com/meishu/service/TaskContentDoneInfoService.java create mode 100644 src/main/java/com/meishu/service/TaskContentService.java create mode 100644 src/main/java/com/meishu/service/TaskDoneHistoryService.java create mode 100644 src/main/java/com/meishu/service/UserRoleCopy1Service.java create mode 100644 src/main/java/com/meishu/service/UserRoleService.java create mode 100644 src/main/java/com/meishu/service/UserSubjectMappingService.java create mode 100644 src/main/java/com/meishu/service/UserSubjectPermissionDictService.java create mode 100644 src/main/java/com/meishu/service/UuidHistoryService.java create mode 100644 src/main/java/com/meishu/service/VodDictService.java create mode 100644 src/main/java/com/meishu/service/VodPlayHistoryService.java create mode 100644 src/main/java/com/meishu/service/VodSubjectTreeMappingService.java create mode 100644 src/main/java/com/meishu/service/WrittenHomeworkService.java create mode 100644 src/main/java/com/meishu/service/impl/AccessTokenServiceImpl.java create mode 100644 src/main/java/com/meishu/service/impl/AdministerDepartmentMappingServiceImpl.java create mode 100644 src/main/java/com/meishu/service/impl/AdministerPermissionServiceImpl.java create mode 100644 src/main/java/com/meishu/service/impl/AdministerServiceImpl.java create mode 100644 src/main/java/com/meishu/service/impl/AdministerSubjectMappingServiceImpl.java create mode 100644 src/main/java/com/meishu/service/impl/AnsweringQuestionServiceImpl.java create mode 100644 src/main/java/com/meishu/service/impl/ClassSubjectTaskServiceImpl.java create mode 100644 src/main/java/com/meishu/service/impl/ClassesDictHistoryServiceImpl.java create mode 100644 src/main/java/com/meishu/service/impl/ClassesDictServiceImpl.java create mode 100644 src/main/java/com/meishu/service/impl/ClassesUserMappingServiceImpl.java create mode 100644 src/main/java/com/meishu/service/impl/CourseAdministerMappingServiceImpl.java create mode 100644 src/main/java/com/meishu/service/impl/CourseStudentStatusHistoryServiceImpl.java create mode 100644 src/main/java/com/meishu/service/impl/CourseTreeExerciseStudentResultServiceImpl.java create mode 100644 src/main/java/com/meishu/service/impl/CourseTreeVodStudentResultServiceImpl.java create mode 100644 src/main/java/com/meishu/service/impl/CourseVodTreeStudentResultServiceImpl.java create mode 100644 src/main/java/com/meishu/service/impl/DepartmentDictServiceImpl.java create mode 100644 src/main/java/com/meishu/service/impl/ExerciseCourseTreeMappingServiceImpl.java create mode 100644 src/main/java/com/meishu/service/impl/ExerciseDictServiceImpl.java create mode 100644 src/main/java/com/meishu/service/impl/ExerciseDoneHistoryServiceImpl.java create mode 100644 src/main/java/com/meishu/service/impl/ExerciseExpandMappingServiceImpl.java create mode 100644 src/main/java/com/meishu/service/impl/ExerciseRelatedMappingServiceImpl.java create mode 100644 src/main/java/com/meishu/service/impl/ExerciseTreeMappingServiceImpl.java create mode 100644 src/main/java/com/meishu/service/impl/ExerciseUserInfoServiceImpl.java create mode 100644 src/main/java/com/meishu/service/impl/KnowledgeSubjectDictServiceImpl.java create mode 100644 src/main/java/com/meishu/service/impl/LaboratoryAttendanceMappingServiceImpl.java create mode 100644 src/main/java/com/meishu/service/impl/LaboratoryDictMappingServiceImpl.java create mode 100644 src/main/java/com/meishu/service/impl/LaboratoryDictServiceImpl.java create mode 100644 src/main/java/com/meishu/service/impl/LaboratorySessionMappingServiceImpl.java create mode 100644 src/main/java/com/meishu/service/impl/LaboratoryUserMappingServiceImpl.java create mode 100644 src/main/java/com/meishu/service/impl/PermissionsDictServiceImpl.java create mode 100644 src/main/java/com/meishu/service/impl/RoleAdministerMappingServiceImpl.java create mode 100644 src/main/java/com/meishu/service/impl/RoleDictServiceImpl.java create mode 100644 src/main/java/com/meishu/service/impl/RolePermissionMappingServiceImpl.java create mode 100644 src/main/java/com/meishu/service/impl/SessionsDictServiceImpl.java create mode 100644 src/main/java/com/meishu/service/impl/SignInRecordServiceImpl.java create mode 100644 src/main/java/com/meishu/service/impl/SmsCodeServiceImpl.java create mode 100644 src/main/java/com/meishu/service/impl/StudentServiceImpl.java create mode 100644 src/main/java/com/meishu/service/impl/SubjectDictServiceImpl.java create mode 100644 src/main/java/com/meishu/service/impl/SubjectDimensionDictServiceImpl.java create mode 100644 src/main/java/com/meishu/service/impl/SubjectDimensionStarDictServiceImpl.java create mode 100644 src/main/java/com/meishu/service/impl/SubjectRuleServiceImpl.java create mode 100644 src/main/java/com/meishu/service/impl/SubjectSemesterServiceImpl.java create mode 100644 src/main/java/com/meishu/service/impl/SubjectStarTreeMappingServiceImpl.java create mode 100644 src/main/java/com/meishu/service/impl/SubjectStudentAnswerStarServiceImpl.java create mode 100644 src/main/java/com/meishu/service/impl/SubjectTestDictServiceImpl.java create mode 100644 src/main/java/com/meishu/service/impl/SubjectTestGradeExampleMappingServiceImpl.java create mode 100644 src/main/java/com/meishu/service/impl/SubjectTestGradeStarMappingServiceImpl.java create mode 100644 src/main/java/com/meishu/service/impl/SubjectTestPublishGradeServiceImpl.java create mode 100644 src/main/java/com/meishu/service/impl/SubjectTestPublishHistoryServiceImpl.java create mode 100644 src/main/java/com/meishu/service/impl/SubjectTestStudentAnswerServiceImpl.java create mode 100644 src/main/java/com/meishu/service/impl/SubjectTreeServiceImpl.java create mode 100644 src/main/java/com/meishu/service/impl/TaskCompletionStatusServiceImpl.java create mode 100644 src/main/java/com/meishu/service/impl/TaskContentDoneInfoServiceImpl.java create mode 100644 src/main/java/com/meishu/service/impl/TaskContentServiceImpl.java create mode 100644 src/main/java/com/meishu/service/impl/TaskDoneHistoryServiceImpl.java create mode 100644 src/main/java/com/meishu/service/impl/UserRoleCopy1ServiceImpl.java create mode 100644 src/main/java/com/meishu/service/impl/UserRoleServiceImpl.java create mode 100644 src/main/java/com/meishu/service/impl/UserSubjectMappingServiceImpl.java create mode 100644 src/main/java/com/meishu/service/impl/UserSubjectPermissionDictServiceImpl.java create mode 100644 src/main/java/com/meishu/service/impl/UuidHistoryServiceImpl.java create mode 100644 src/main/java/com/meishu/service/impl/VodDictServiceImpl.java create mode 100644 src/main/java/com/meishu/service/impl/VodPlayHistoryServiceImpl.java create mode 100644 src/main/java/com/meishu/service/impl/VodSubjectTreeMappingServiceImpl.java create mode 100644 src/main/java/com/meishu/service/impl/WrittenHomeworkServiceImpl.java create mode 100644 src/main/java/com/meishu/util/BaseModel.java create mode 100644 src/main/java/com/meishu/util/CodeGenerator.java create mode 100644 src/main/java/com/meishu/util/CodeTrans.java create mode 100644 src/main/java/com/meishu/util/ConstantUtils.java create mode 100644 src/main/java/com/meishu/util/DateFormatUtil.java create mode 100644 src/main/java/com/meishu/util/EncryptUtil.java create mode 100644 src/main/java/com/meishu/util/HttpUtil.java create mode 100644 src/main/java/com/meishu/util/JwtUtil.java create mode 100644 src/main/java/com/meishu/util/LatexUtils.java create mode 100644 src/main/java/com/meishu/util/Localstorage.java create mode 100644 src/main/java/com/meishu/util/MathUtil.java create mode 100644 src/main/java/com/meishu/util/RandomUtil.java create mode 100644 src/main/java/com/meishu/util/SMSUtils.java create mode 100644 src/main/java/com/meishu/util/SecretUtils.java create mode 100644 src/main/java/com/meishu/util/Signature.java create mode 100644 src/main/java/com/meishu/util/TestMain.java create mode 100644 src/main/java/com/meishu/util/WechatUtil.java create mode 100644 src/main/java/com/meishu/util/excel/ExcelColumn.java create mode 100644 src/main/java/com/meishu/util/excel/ExcelColumnUtil.java create mode 100644 src/main/java/com/meishu/util/excel/ExcelUtil.java create mode 100644 src/main/java/com/meishu/util/tree/Node.java create mode 100644 src/main/java/com/meishu/util/tree/NumberTree.java create mode 100644 src/main/java/com/meishu/util/tree/SerialNumber.java create mode 100644 src/main/java/com/meishu/vo/PerStudentComplicationVO.java create mode 100644 src/main/java/com/meishu/vo/accesstoken/GetAllStudentsVO.java create mode 100644 src/main/java/com/meishu/vo/accesstoken/GetAllTeachersVO.java create mode 100644 src/main/java/com/meishu/vo/administer/AdministerPermissionVO.java create mode 100644 src/main/java/com/meishu/vo/administer/GetClassesDetailResponseVO.java create mode 100644 src/main/java/com/meishu/vo/administer/GetTeacherClassVO.java create mode 100644 src/main/java/com/meishu/vo/administer/GetTeacherSubjectVO.java create mode 100644 src/main/java/com/meishu/vo/administer/GetTeachersVO.java create mode 100644 src/main/java/com/meishu/vo/administer/LoginVO.java create mode 100644 src/main/java/com/meishu/vo/administer/PermissionsVO.java create mode 100644 src/main/java/com/meishu/vo/campus/CampusListVO.java create mode 100644 src/main/java/com/meishu/vo/campus/CampusStudentVO.java create mode 100644 src/main/java/com/meishu/vo/classes/GetClassStudentsVO.java create mode 100644 src/main/java/com/meishu/vo/classes/GetClassesVO.java create mode 100644 src/main/java/com/meishu/vo/classes/SubjectDictVO.java create mode 100644 src/main/java/com/meishu/vo/course/CourseAdministerVO.java create mode 100644 src/main/java/com/meishu/vo/course/CourseProgressVO.java create mode 100644 src/main/java/com/meishu/vo/course/CourseVodVO.java create mode 100644 src/main/java/com/meishu/vo/course/GetAllCourseVO.java create mode 100644 src/main/java/com/meishu/vo/course/GetCourseStudentsVO.java create mode 100644 src/main/java/com/meishu/vo/course/GetCourseTreeVodsVO.java create mode 100644 src/main/java/com/meishu/vo/course/GetExerciseDetailVO.java create mode 100644 src/main/java/com/meishu/vo/course/GetStudentHistoryVO.java create mode 100644 src/main/java/com/meishu/vo/course/GetVodIndexVO.java create mode 100644 src/main/java/com/meishu/vo/course/QueryCourseInfoVO.java create mode 100644 src/main/java/com/meishu/vo/course/QueryCoursesVO.java create mode 100644 src/main/java/com/meishu/vo/course/StudentDetailVO.java create mode 100644 src/main/java/com/meishu/vo/dimension/GetAllDimensionStarVO.java create mode 100644 src/main/java/com/meishu/vo/dimension/GetAllDimensionStarsVO.java create mode 100644 src/main/java/com/meishu/vo/dimension/StarVO.java create mode 100644 src/main/java/com/meishu/vo/exercise/GetExerciseDetailResponseVO.java create mode 100644 src/main/java/com/meishu/vo/exercise/GetExerciseDetailVO.java create mode 100644 src/main/java/com/meishu/vo/exercise/GetTreeExercisesVO.java create mode 100644 src/main/java/com/meishu/vo/exercise/QueryCourseTreeExerciseVO.java create mode 100644 src/main/java/com/meishu/vo/grade/DimensionStarVO.java create mode 100644 src/main/java/com/meishu/vo/grade/QueryOneGradeVO.java create mode 100644 src/main/java/com/meishu/vo/laboratorySession/CalendarStatusVO.java create mode 100644 src/main/java/com/meishu/vo/laboratorySession/GetLaboratorySessionVO.java create mode 100644 src/main/java/com/meishu/vo/laboratorySession/LaboratoryDictPageVO.java create mode 100644 src/main/java/com/meishu/vo/laboratorySession/LaboratorySessionMappingVO.java create mode 100644 src/main/java/com/meishu/vo/laboratorySession/LaboratorySessionVO.java create mode 100644 src/main/java/com/meishu/vo/laboratorySession/StatisticsVO.java create mode 100644 src/main/java/com/meishu/vo/laboratoryUser/LaboratoryUserPageVO.java create mode 100644 src/main/java/com/meishu/vo/question/GetClassQuestionsVO.java create mode 100644 src/main/java/com/meishu/vo/question/QueryOneQuestionVO.java create mode 100644 src/main/java/com/meishu/vo/question/QueryQuestionsVO.java create mode 100644 src/main/java/com/meishu/vo/role/GetAllRolesVO.java create mode 100644 src/main/java/com/meishu/vo/role/GetRoleTeachersVO.java create mode 100644 src/main/java/com/meishu/vo/rule/GetAllRulesVO.java create mode 100644 src/main/java/com/meishu/vo/rule/GetOneExaminationDetailVO.java create mode 100644 src/main/java/com/meishu/vo/rule/GetRuleReportVO.java create mode 100644 src/main/java/com/meishu/vo/rule/GetStudentRulesVO.java create mode 100644 src/main/java/com/meishu/vo/rule/StudentStarVO.java create mode 100644 src/main/java/com/meishu/vo/semester/GetAllPastSemesterVO.java create mode 100644 src/main/java/com/meishu/vo/semester/GetAllStudyingSemesterVO.java create mode 100644 src/main/java/com/meishu/vo/semester/GetSemesterScoreVO.java create mode 100644 src/main/java/com/meishu/vo/semester/GetStudentDetailVO.java create mode 100644 src/main/java/com/meishu/vo/semester/GetStudentRecordVO.java create mode 100644 src/main/java/com/meishu/vo/sign/ClassSignInVO.java create mode 100644 src/main/java/com/meishu/vo/student/ChapterTestVO.java create mode 100644 src/main/java/com/meishu/vo/student/ClassVO.java create mode 100644 src/main/java/com/meishu/vo/student/GetChildTreesVO.java create mode 100644 src/main/java/com/meishu/vo/student/GetStudyProgressVO.java create mode 100644 src/main/java/com/meishu/vo/student/LoginVO.java create mode 100644 src/main/java/com/meishu/vo/student/ParentReportVO.java create mode 100644 src/main/java/com/meishu/vo/student/QueryChapterTestVO.java create mode 100644 src/main/java/com/meishu/vo/student/QueryClassVO.java create mode 100644 src/main/java/com/meishu/vo/student/QueryStudentVO.java create mode 100644 src/main/java/com/meishu/vo/student/SearchVodsVO.java create mode 100644 src/main/java/com/meishu/vo/student/StudentCampusVO.java create mode 100644 src/main/java/com/meishu/vo/student/StudentCourseVO.java create mode 100644 src/main/java/com/meishu/vo/student/StudentTreeVodDoneVO.java create mode 100644 src/main/java/com/meishu/vo/student/StudentVO.java create mode 100644 src/main/java/com/meishu/vo/student/StudentVodVO.java create mode 100644 src/main/java/com/meishu/vo/student/StudyReportVO.java create mode 100644 src/main/java/com/meishu/vo/student/SubjectReportVO.java create mode 100644 src/main/java/com/meishu/vo/subject/GetAllNoAuthenVodsVO.java create mode 100644 src/main/java/com/meishu/vo/subject/GetNextNodeVO.java create mode 100644 src/main/java/com/meishu/vo/subject/GetSubjectTreeVO.java create mode 100644 src/main/java/com/meishu/vo/subject/SubjectTreeOrder.java create mode 100644 src/main/java/com/meishu/vo/task/ClassDoneInfoVO.java create mode 100644 src/main/java/com/meishu/vo/task/ExeRightRatioVO.java create mode 100644 src/main/java/com/meishu/vo/task/ExerciseDoneInfoVO.java create mode 100644 src/main/java/com/meishu/vo/task/ExerciseUserInfoVO.java create mode 100644 src/main/java/com/meishu/vo/task/GetClassExeDoneInfoRequestVO.java create mode 100644 src/main/java/com/meishu/vo/task/GetClassExeDoneInfoResponseVO.java create mode 100644 src/main/java/com/meishu/vo/task/GetExeByIdResponseVO.java create mode 100644 src/main/java/com/meishu/vo/task/GetExercisesInfoByIdsResponseVO.java create mode 100644 src/main/java/com/meishu/vo/task/GetExpandingsPO.java create mode 100644 src/main/java/com/meishu/vo/task/GetPreTaskContentVO.java create mode 100644 src/main/java/com/meishu/vo/task/GetTaskByIdVO.java create mode 100644 src/main/java/com/meishu/vo/task/GetVodDetailResponseVO.java create mode 100644 src/main/java/com/meishu/vo/task/PerStuExeDoneResponseVO.java create mode 100644 src/main/java/com/meishu/vo/task/PerStudentExesResponseVO.java create mode 100644 src/main/java/com/meishu/vo/task/PreExpandExerciseVO.java create mode 100644 src/main/java/com/meishu/vo/task/PreHomeWorkInfoVO.java create mode 100644 src/main/java/com/meishu/vo/task/PreRelateExeVO.java create mode 100644 src/main/java/com/meishu/vo/task/PreVodInfoVO.java create mode 100644 src/main/java/com/meishu/vo/task/QueryTaskDetailResponseVO.java create mode 100644 src/main/java/com/meishu/vo/task/StudentDoneInfoResponseVO.java create mode 100644 src/main/java/com/meishu/vo/task/TeacherClassVO.java create mode 100644 src/main/java/com/meishu/vo/test/CommentVO.java create mode 100644 src/main/java/com/meishu/vo/test/GetAllTestVO.java create mode 100644 src/main/java/com/meishu/vo/test/GetOnePublishVO.java create mode 100644 src/main/java/com/meishu/vo/test/GetPublishHistoryVO.java create mode 100644 src/main/java/com/meishu/vo/test/GetTestReportVO.java create mode 100644 src/main/java/com/meishu/vo/userrole/QueryStudentsVO.java create mode 100644 src/main/java/com/meishu/vo/userrole/UserInfoVO.java create mode 100644 src/main/java/com/meishu/vo/userrole/UserRoleVO.java create mode 100644 src/main/java/com/meishu/vo/voddict/GetCourseTreesVodsVO.java create mode 100644 src/main/java/com/meishu/vo/voddict/GetStatusVodsVO.java create mode 100644 src/main/java/com/meishu/vo/voddict/GetToCheckCountsVO.java create mode 100644 src/main/java/com/meishu/vo/voddict/GetTreeVodsVO.java create mode 100644 src/main/java/com/meishu/vo/voddict/GetVodDetailVO.java create mode 100644 src/main/java/com/meishu/vo/voddict/SignatureVO.java create mode 100644 src/main/java/com/meishu/vo/wechat/AccessTokenVO.java create mode 100644 src/main/java/com/meishu/vo/wechat/AuthenTokenVO.java create mode 100644 src/main/java/com/meishu/vo/wechat/MemberVO.java create mode 100644 src/main/java/com/meishu/vo/wechat/QrConnectVO.java create mode 100644 src/main/java/com/meishu/vo/wechat/WXUserInfoVO.java create mode 100644 src/main/java/com/meishu/vo/wechat/WechatInviteVO.java create mode 100644 src/main/java/com/subsidy/MeishuApplication.java create mode 100644 src/main/java/com/subsidy/common/Code.java create mode 100644 src/main/java/com/subsidy/common/ResponseData.java create mode 100644 src/main/java/com/subsidy/common/ResponseVO.java create mode 100644 src/main/java/com/subsidy/common/configure/AliyunSmsProperties.java create mode 100644 src/main/java/com/subsidy/common/configure/MybatisPlusConfig.java create mode 100644 src/main/java/com/subsidy/common/configure/RemoteProperties.java create mode 100644 src/main/java/com/subsidy/common/configure/RestTemplateConfig.java create mode 100644 src/main/java/com/subsidy/common/configure/SwaggerConfig.java create mode 100644 src/main/java/com/subsidy/common/configure/VODConfig.java create mode 100644 src/main/java/com/subsidy/common/configure/WebConfig.java create mode 100644 src/main/java/com/subsidy/common/configure/WebLogAspect.java create mode 100644 src/main/java/com/subsidy/common/configure/WechatConfig.java create mode 100644 src/main/java/com/subsidy/common/constant/AttendanceConstant.java create mode 100644 src/main/java/com/subsidy/common/constant/Code.java create mode 100644 src/main/java/com/subsidy/common/constant/WxConstant.java create mode 100644 src/main/java/com/subsidy/common/exception/GlobalExceptionHandler.java create mode 100644 src/main/java/com/subsidy/common/exception/HttpException.java create mode 100644 src/main/java/com/subsidy/common/handler/MetaHandler.java create mode 100644 src/main/java/com/subsidy/common/interceptor/AuthenticationInterceptor.java create mode 100644 src/main/java/com/subsidy/common/interceptor/LoginRequired.java create mode 100644 src/main/java/com/subsidy/controller/AdministerController.java create mode 100644 src/main/java/com/subsidy/controller/AnsweringQuestionController.java create mode 100644 src/main/java/com/subsidy/controller/CategoryController.java create mode 100644 src/main/java/com/subsidy/controller/ClassDictController.java create mode 100644 src/main/java/com/subsidy/controller/ClassMemberMappingController.java create mode 100644 src/main/java/com/subsidy/controller/CompanyDictController.java create mode 100644 src/main/java/com/subsidy/controller/CourseContentController.java create mode 100644 src/main/java/com/subsidy/controller/CourseDictController.java create mode 100644 src/main/java/com/subsidy/controller/DepartmentDictController.java create mode 100644 src/main/java/com/subsidy/controller/ExerciseDictController.java create mode 100644 src/main/java/com/subsidy/controller/ExerciseDoneResultController.java create mode 100644 src/main/java/com/subsidy/controller/FileDictController.java create mode 100644 src/main/java/com/subsidy/controller/MemberController.java create mode 100644 src/main/java/com/subsidy/controller/MemberDepartmentMappingController.java create mode 100644 src/main/java/com/subsidy/controller/PermissionsDictController.java create mode 100644 src/main/java/com/subsidy/controller/RoleAdministerMappingController.java create mode 100644 src/main/java/com/subsidy/controller/RoleDictController.java create mode 100644 src/main/java/com/subsidy/controller/RolePermissionMappingController.java create mode 100644 src/main/java/com/subsidy/controller/SignInRecordController.java create mode 100644 src/main/java/com/subsidy/controller/SmsVerifyCodeController.java create mode 100644 src/main/java/com/subsidy/controller/VodDictController.java create mode 100644 src/main/java/com/subsidy/controller/VodPlayHistoryController.java create mode 100644 src/main/java/com/subsidy/dto/GetCourseQuestionDTO.java create mode 100644 src/main/java/com/subsidy/dto/administer/ClassDetailDTO.java create mode 100644 src/main/java/com/subsidy/dto/administer/OperatorsDTO.java create mode 100644 src/main/java/com/subsidy/dto/administer/VerifyCodeDTO.java create mode 100644 src/main/java/com/subsidy/dto/category/GetCategoriesDTO.java create mode 100644 src/main/java/com/subsidy/dto/classDict/AddClassDTO.java create mode 100644 src/main/java/com/subsidy/dto/classDict/AddMemberToClassDTO.java create mode 100644 src/main/java/com/subsidy/dto/classDict/GetAllClassesDTO.java create mode 100644 src/main/java/com/subsidy/dto/classDict/GetSpareMembersDTO.java create mode 100644 src/main/java/com/subsidy/dto/company/AddCompanyDTO.java create mode 100644 src/main/java/com/subsidy/dto/content/GetContendVodsDTO.java create mode 100644 src/main/java/com/subsidy/dto/course/QueryCoursesDTO.java create mode 100644 src/main/java/com/subsidy/dto/department/GetDepartmentsVO.java create mode 100644 src/main/java/com/subsidy/dto/exercise/GetAllExercisesDTO.java create mode 100644 src/main/java/com/subsidy/dto/exercise/SubmitDTO.java create mode 100644 src/main/java/com/subsidy/dto/member/AddMemberDTO.java create mode 100644 src/main/java/com/subsidy/dto/member/ContentMemberDTO.java create mode 100644 src/main/java/com/subsidy/dto/member/GetAllDTO.java create mode 100644 src/main/java/com/subsidy/dto/member/GetMemberSignInfoDTO.java create mode 100644 src/main/java/com/subsidy/dto/member/ImportMemberDTO.java create mode 100644 src/main/java/com/subsidy/dto/member/StudyHistoryDTO.java create mode 100644 src/main/java/com/subsidy/dto/sign/ClassSignInfoDTO.java create mode 100644 src/main/java/com/subsidy/dto/sign/SignInDTO.java create mode 100644 src/main/java/com/subsidy/dto/sms/SendVerifyCodeDTO.java create mode 100644 src/main/java/com/subsidy/mapper/AdministerMapper.java create mode 100644 src/main/java/com/subsidy/mapper/AnsweringQuestionMapper.java create mode 100644 src/main/java/com/subsidy/mapper/CategoryMapper.java create mode 100644 src/main/java/com/subsidy/mapper/ClassDictMapper.java create mode 100644 src/main/java/com/subsidy/mapper/ClassMemberMappingMapper.java create mode 100644 src/main/java/com/subsidy/mapper/CompanyDictMapper.java create mode 100644 src/main/java/com/subsidy/mapper/CourseContentMapper.java create mode 100644 src/main/java/com/subsidy/mapper/CourseDictMapper.java create mode 100644 src/main/java/com/subsidy/mapper/DepartmentDictMapper.java create mode 100644 src/main/java/com/subsidy/mapper/ExerciseDictMapper.java create mode 100644 src/main/java/com/subsidy/mapper/ExerciseDoneResultMapper.java create mode 100644 src/main/java/com/subsidy/mapper/FileDictMapper.java create mode 100644 src/main/java/com/subsidy/mapper/MemberDepartmentMappingMapper.java create mode 100644 src/main/java/com/subsidy/mapper/MemberMapper.java create mode 100644 src/main/java/com/subsidy/mapper/PermissionsDictMapper.java create mode 100644 src/main/java/com/subsidy/mapper/RoleAdministerMappingMapper.java create mode 100644 src/main/java/com/subsidy/mapper/RoleDictMapper.java create mode 100644 src/main/java/com/subsidy/mapper/RolePermissionMappingMapper.java create mode 100644 src/main/java/com/subsidy/mapper/SignInRecordMapper.java create mode 100644 src/main/java/com/subsidy/mapper/SmsVerifyCodeMapper.java create mode 100644 src/main/java/com/subsidy/mapper/VodDictMapper.java create mode 100644 src/main/java/com/subsidy/mapper/VodPlayHistoryMapper.java create mode 100644 src/main/java/com/subsidy/model/AdministerDO.java create mode 100644 src/main/java/com/subsidy/model/AnsweringQuestionDO.java create mode 100644 src/main/java/com/subsidy/model/CategoryDO.java create mode 100644 src/main/java/com/subsidy/model/ClassDictDO.java create mode 100644 src/main/java/com/subsidy/model/ClassMemberMappingDO.java create mode 100644 src/main/java/com/subsidy/model/CompanyDictDO.java create mode 100644 src/main/java/com/subsidy/model/CourseContentDO.java create mode 100644 src/main/java/com/subsidy/model/CourseDictDO.java create mode 100644 src/main/java/com/subsidy/model/DepartmentDictDO.java create mode 100644 src/main/java/com/subsidy/model/ExerciseDictDO.java create mode 100644 src/main/java/com/subsidy/model/ExerciseDoneResultDO.java create mode 100644 src/main/java/com/subsidy/model/FileDictDO.java create mode 100644 src/main/java/com/subsidy/model/MemberDO.java create mode 100644 src/main/java/com/subsidy/model/MemberDepartmentMappingDO.java create mode 100644 src/main/java/com/subsidy/model/PermissionsDictDO.java create mode 100644 src/main/java/com/subsidy/model/RoleAdministerMappingDO.java create mode 100644 src/main/java/com/subsidy/model/RoleDictDO.java create mode 100644 src/main/java/com/subsidy/model/RolePermissionMappingDO.java create mode 100644 src/main/java/com/subsidy/model/SignInRecordDO.java create mode 100644 src/main/java/com/subsidy/model/SmsVerifyCodeDO.java create mode 100644 src/main/java/com/subsidy/model/VodDictDO.java create mode 100644 src/main/java/com/subsidy/model/VodPlayHistoryDO.java create mode 100644 src/main/java/com/subsidy/service/AdministerService.java create mode 100644 src/main/java/com/subsidy/service/AnsweringQuestionService.java create mode 100644 src/main/java/com/subsidy/service/CategoryService.java create mode 100644 src/main/java/com/subsidy/service/ClassDictService.java create mode 100644 src/main/java/com/subsidy/service/ClassMemberMappingService.java create mode 100644 src/main/java/com/subsidy/service/CompanyDictService.java create mode 100644 src/main/java/com/subsidy/service/CourseContentService.java create mode 100644 src/main/java/com/subsidy/service/CourseDictService.java create mode 100644 src/main/java/com/subsidy/service/DepartmentDictService.java create mode 100644 src/main/java/com/subsidy/service/ExerciseDictService.java create mode 100644 src/main/java/com/subsidy/service/ExerciseDoneResultService.java create mode 100644 src/main/java/com/subsidy/service/FileDictService.java create mode 100644 src/main/java/com/subsidy/service/MemberDepartmentMappingService.java create mode 100644 src/main/java/com/subsidy/service/MemberService.java create mode 100644 src/main/java/com/subsidy/service/PermissionsDictService.java create mode 100644 src/main/java/com/subsidy/service/RoleAdministerMappingService.java create mode 100644 src/main/java/com/subsidy/service/RoleDictService.java create mode 100644 src/main/java/com/subsidy/service/RolePermissionMappingService.java create mode 100644 src/main/java/com/subsidy/service/SignInRecordService.java create mode 100644 src/main/java/com/subsidy/service/SmsVerifyCodeService.java create mode 100644 src/main/java/com/subsidy/service/VodDictService.java create mode 100644 src/main/java/com/subsidy/service/VodPlayHistoryService.java create mode 100644 src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java create mode 100644 src/main/java/com/subsidy/service/impl/AnsweringQuestionServiceImpl.java create mode 100644 src/main/java/com/subsidy/service/impl/CategoryServiceImpl.java create mode 100644 src/main/java/com/subsidy/service/impl/ClassDictServiceImpl.java create mode 100644 src/main/java/com/subsidy/service/impl/ClassMemberMappingServiceImpl.java create mode 100644 src/main/java/com/subsidy/service/impl/CompanyDictServiceImpl.java create mode 100644 src/main/java/com/subsidy/service/impl/CourseContentServiceImpl.java create mode 100644 src/main/java/com/subsidy/service/impl/CourseDictServiceImpl.java create mode 100644 src/main/java/com/subsidy/service/impl/DepartmentDictServiceImpl.java create mode 100644 src/main/java/com/subsidy/service/impl/ExerciseDictServiceImpl.java create mode 100644 src/main/java/com/subsidy/service/impl/ExerciseDoneResultServiceImpl.java create mode 100644 src/main/java/com/subsidy/service/impl/FileDictServiceImpl.java create mode 100644 src/main/java/com/subsidy/service/impl/MemberDepartmentMappingServiceImpl.java create mode 100644 src/main/java/com/subsidy/service/impl/MemberServiceImpl.java create mode 100644 src/main/java/com/subsidy/service/impl/PermissionsDictServiceImpl.java create mode 100644 src/main/java/com/subsidy/service/impl/RoleAdministerMappingServiceImpl.java create mode 100644 src/main/java/com/subsidy/service/impl/RoleDictServiceImpl.java create mode 100644 src/main/java/com/subsidy/service/impl/RolePermissionMappingServiceImpl.java create mode 100644 src/main/java/com/subsidy/service/impl/SignInRecordServiceImpl.java create mode 100644 src/main/java/com/subsidy/service/impl/SmsVerifyCodeServiceImpl.java create mode 100644 src/main/java/com/subsidy/service/impl/VodDictServiceImpl.java create mode 100644 src/main/java/com/subsidy/service/impl/VodPlayHistoryServiceImpl.java create mode 100644 src/main/java/com/subsidy/util/BaseModel.java create mode 100644 src/main/java/com/subsidy/util/CodeGenerator.java create mode 100644 src/main/java/com/subsidy/util/ConstantUtils.java create mode 100644 src/main/java/com/subsidy/util/DateFormatUtil.java create mode 100644 src/main/java/com/subsidy/util/EncryptUtil.java create mode 100644 src/main/java/com/subsidy/util/ExcelFormatUtils.java create mode 100644 src/main/java/com/subsidy/util/HttpUtil.java create mode 100644 src/main/java/com/subsidy/util/JwtUtil.java create mode 100644 src/main/java/com/subsidy/util/LatexUtils.java create mode 100644 src/main/java/com/subsidy/util/Localstorage.java create mode 100644 src/main/java/com/subsidy/util/MathUtil.java create mode 100644 src/main/java/com/subsidy/util/RandomUtil.java create mode 100644 src/main/java/com/subsidy/util/SMSUtils.java create mode 100644 src/main/java/com/subsidy/util/SecretUtils.java create mode 100644 src/main/java/com/subsidy/util/Signature.java create mode 100644 src/main/java/com/subsidy/util/Student.java create mode 100644 src/main/java/com/subsidy/util/TestMain.java create mode 100644 src/main/java/com/subsidy/util/ZipTestUtils.java create mode 100644 src/main/java/com/subsidy/util/ZipUtils.java create mode 100644 src/main/java/com/subsidy/util/excel/ExcelColumn.java create mode 100644 src/main/java/com/subsidy/util/excel/ExcelColumnUtil.java create mode 100644 src/main/java/com/subsidy/util/excel/ExcelUtil.java create mode 100644 src/main/java/com/subsidy/util/tree/Node.java create mode 100644 src/main/java/com/subsidy/util/tree/NumberTree.java create mode 100644 src/main/java/com/subsidy/util/tree/SerialNumber.java create mode 100644 src/main/java/com/subsidy/vo/administer/AdministerPermissionVO.java create mode 100644 src/main/java/com/subsidy/vo/administer/ClassSummaryVO.java create mode 100644 src/main/java/com/subsidy/vo/administer/ExerciseTestVO.java create mode 100644 src/main/java/com/subsidy/vo/administer/LoginVO.java create mode 100644 src/main/java/com/subsidy/vo/administer/OperatorsVO.java create mode 100644 src/main/java/com/subsidy/vo/administer/PermissionsVO.java create mode 100644 src/main/java/com/subsidy/vo/administer/UserRoleVO.java create mode 100644 src/main/java/com/subsidy/vo/answer/GetCourseQuestionVO.java create mode 100644 src/main/java/com/subsidy/vo/classdict/ClassDetailVO.java create mode 100644 src/main/java/com/subsidy/vo/classdict/GetAllClassesVO.java create mode 100644 src/main/java/com/subsidy/vo/course/ExerciseVO.java create mode 100644 src/main/java/com/subsidy/vo/course/QueryCoursesVO.java create mode 100644 src/main/java/com/subsidy/vo/exercise/MemberExerciseVO.java create mode 100644 src/main/java/com/subsidy/vo/member/ClassSignVO.java create mode 100644 src/main/java/com/subsidy/vo/member/ContentFilesVO.java create mode 100644 src/main/java/com/subsidy/vo/member/ContentVodNewVO.java create mode 100644 src/main/java/com/subsidy/vo/member/ContentVodVO.java create mode 100644 src/main/java/com/subsidy/vo/member/GetAllVO.java create mode 100644 src/main/java/com/subsidy/vo/member/GetCourseTestVO.java create mode 100644 src/main/java/com/subsidy/vo/member/GetMemberSignInfoVO.java create mode 100644 src/main/java/com/subsidy/vo/member/GetStudyInfoVO.java create mode 100644 src/main/java/com/subsidy/vo/member/MemberStudyPageVO.java create mode 100644 src/main/java/com/subsidy/vo/member/MemberVodVO.java create mode 100644 src/main/java/com/subsidy/vo/member/StudyPageVO.java create mode 100644 src/main/java/com/subsidy/vo/sign/AnswerRecordVO.java create mode 100644 src/main/java/com/subsidy/vo/sign/ClassSignInfoVO.java create mode 100644 src/main/java/com/subsidy/vo/sign/SignInStatusVO.java create mode 100644 src/main/java/com/subsidy/vo/vod/GetContendVodsVO.java create mode 100644 src/main/java/com/subsidy/vo/vod/SignatureVO.java create mode 100644 src/main/java/com/subsidy/vo/vod/StudyHistoryVO.java create mode 100644 src/main/resources/application-dev.properties create mode 100644 src/main/resources/application-prod.properties create mode 100644 src/main/resources/application.properties create mode 100644 src/main/resources/code.properties create mode 100644 src/main/resources/logback-spring.xml create mode 100644 src/main/resources/mapper/AccessTokenMapper.xml create mode 100644 src/main/resources/mapper/AdministerDepartmentMappingMapper.xml create mode 100644 src/main/resources/mapper/AdministerMapper.xml create mode 100644 src/main/resources/mapper/AdministerPermissionMapper.xml create mode 100644 src/main/resources/mapper/AdministerSubjectMappingMapper.xml create mode 100644 src/main/resources/mapper/AnsweringQuestionMapper.xml create mode 100644 src/main/resources/mapper/CategoryMapper.xml create mode 100644 src/main/resources/mapper/ClassDictMapper.xml create mode 100644 src/main/resources/mapper/ClassMemberMappingMapper.xml create mode 100644 src/main/resources/mapper/ClassSubjectTaskMapper.xml create mode 100644 src/main/resources/mapper/ClassesDictHistoryMapper.xml create mode 100644 src/main/resources/mapper/ClassesDictMapper.xml create mode 100644 src/main/resources/mapper/ClassesUserMappingMapper.xml create mode 100644 src/main/resources/mapper/CompanyDictMapper.xml create mode 100644 src/main/resources/mapper/CourseAdministerMappingMapper.xml create mode 100644 src/main/resources/mapper/CourseContentMapper.xml create mode 100644 src/main/resources/mapper/CourseDictMapper.xml create mode 100644 src/main/resources/mapper/CourseStudentStatusHistoryMapper.xml create mode 100644 src/main/resources/mapper/CourseTreeExerciseStudentResultMapper.xml create mode 100644 src/main/resources/mapper/CourseTreeVodStudentResultMapper.xml create mode 100644 src/main/resources/mapper/CourseVodTressStudentResultMapper.xml create mode 100644 src/main/resources/mapper/DepartmentDictMapper.xml create mode 100644 src/main/resources/mapper/ExerciseCourseTreeMappingMapper.xml create mode 100644 src/main/resources/mapper/ExerciseDictMapper.xml create mode 100644 src/main/resources/mapper/ExerciseDoneHistoryMapper.xml create mode 100644 src/main/resources/mapper/ExerciseDoneResultMapper.xml create mode 100644 src/main/resources/mapper/ExerciseExpandMappingMapper.xml create mode 100644 src/main/resources/mapper/ExerciseRelatedMappingMapper.xml create mode 100644 src/main/resources/mapper/ExerciseTreeMappingMapper.xml create mode 100644 src/main/resources/mapper/ExerciseUserInfoMapper.xml create mode 100644 src/main/resources/mapper/FileDictMapper.xml create mode 100644 src/main/resources/mapper/KnowledgeSubjectDictMapper.xml create mode 100644 src/main/resources/mapper/LaboratoryAttendanceMappingMapper.xml create mode 100644 src/main/resources/mapper/LaboratoryDictMapper.xml create mode 100644 src/main/resources/mapper/LaboratoryDictMappingMapper.xml create mode 100644 src/main/resources/mapper/LaboratorySessionMappingMapper.xml create mode 100644 src/main/resources/mapper/LaboratoryUserMappingMapper.xml create mode 100644 src/main/resources/mapper/MemberDepartmentMappingMapper.xml create mode 100644 src/main/resources/mapper/MemberMapper.xml create mode 100644 src/main/resources/mapper/PermissionsDictMapper.xml create mode 100644 src/main/resources/mapper/RoleAdministerMappingMapper.xml create mode 100644 src/main/resources/mapper/RoleDictMapper.xml create mode 100644 src/main/resources/mapper/RolePermissionMappingMapper.xml create mode 100644 src/main/resources/mapper/SessionsDictMapper.xml create mode 100644 src/main/resources/mapper/SignInRecordMapper.xml create mode 100644 src/main/resources/mapper/SmsCodeMapper.xml create mode 100644 src/main/resources/mapper/SmsVerifyCodeMapper.xml create mode 100644 src/main/resources/mapper/SubjectDictMapper.xml create mode 100644 src/main/resources/mapper/SubjectDimensionDictMapper.xml create mode 100644 src/main/resources/mapper/SubjectDimensionStarDictMapper.xml create mode 100644 src/main/resources/mapper/SubjectRuleMapper.xml create mode 100644 src/main/resources/mapper/SubjectSemesterMapper.xml create mode 100644 src/main/resources/mapper/SubjectStarTreeMappingMapper.xml create mode 100644 src/main/resources/mapper/SubjectStudentAnswerStarMapper.xml create mode 100644 src/main/resources/mapper/SubjectTestDictMapper.xml create mode 100644 src/main/resources/mapper/SubjectTestGradeExampleMappingMapper.xml create mode 100644 src/main/resources/mapper/SubjectTestGradeStarMappingMapper.xml create mode 100644 src/main/resources/mapper/SubjectTestPublishGradeMapper.xml create mode 100644 src/main/resources/mapper/SubjectTestPublishHistoryMapper.xml create mode 100644 src/main/resources/mapper/SubjectTestStudentAnswerMapper.xml create mode 100644 src/main/resources/mapper/SubjectTreeMapper.xml create mode 100644 src/main/resources/mapper/TaskCompletionStatusMapper.xml create mode 100644 src/main/resources/mapper/TaskContentDoneInfoMapper.xml create mode 100644 src/main/resources/mapper/TaskContentMapper.xml create mode 100644 src/main/resources/mapper/TaskDoneHistoryMapper.xml create mode 100644 src/main/resources/mapper/UserRoleCopy1Mapper.xml create mode 100644 src/main/resources/mapper/UserRoleMapper.xml create mode 100644 src/main/resources/mapper/UserSubjectMappingMapper.xml create mode 100644 src/main/resources/mapper/UserSubjectPermissionDictMapper.xml create mode 100644 src/main/resources/mapper/UuidHistoryMapper.xml create mode 100644 src/main/resources/mapper/VodDictMapper.xml create mode 100644 src/main/resources/mapper/VodPlayHistoryMapper.xml create mode 100644 src/main/resources/mapper/VodSubjectTreeMappingMapper.xml create mode 100644 src/main/resources/mapper/WrittenHomeworkMapper.xml create mode 100644 src/main/resources/mybatis-plus.properties create mode 100644 src/main/resources/mybatis.xml create mode 100644 src/main/resources/templates/controller.java.ftl create mode 100644 src/main/resources/templates/entity.java.ftl create mode 100644 src/main/resources/templates/mapper.java.ftl create mode 100644 src/main/resources/templates/mapper.xml.ftl create mode 100644 src/main/resources/templates/service.java.ftl create mode 100644 src/main/resources/templates/serviceImpl.java.ftl diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7763800 --- /dev/null +++ b/.gitignore @@ -0,0 +1,34 @@ +HELP.md +target/ +!.mvn/wrapper/maven-wrapper.jar +!**/src/main/** +!**/src/test/** +**/target/ + +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + +### IntelliJ IDEA ### +.idea +*.iws +*.iml +*.ipr + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ +build/ + +### VS Code ### +.vscode/ +assets/ +logs/ \ No newline at end of file diff --git a/mvnw b/mvnw new file mode 100644 index 0000000..a16b543 --- /dev/null +++ b/mvnw @@ -0,0 +1,310 @@ +#!/bin/sh +# ---------------------------------------------------------------------------- +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# ---------------------------------------------------------------------------- + +# ---------------------------------------------------------------------------- +# Maven Start Up Batch script +# +# Required ENV vars: +# ------------------ +# JAVA_HOME - location of a JDK home dir +# +# Optional ENV vars +# ----------------- +# M2_HOME - location of maven2's installed home dir +# MAVEN_OPTS - parameters passed to the Java VM when running Maven +# e.g. to debug Maven itself, use +# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +# MAVEN_SKIP_RC - flag to disable loading of mavenrc files +# ---------------------------------------------------------------------------- + +if [ -z "$MAVEN_SKIP_RC" ] ; then + + if [ -f /etc/mavenrc ] ; then + . /etc/mavenrc + fi + + if [ -f "$HOME/.mavenrc" ] ; then + . "$HOME/.mavenrc" + fi + +fi + +# OS specific support. $var _must_ be set to either true or false. +cygwin=false; +darwin=false; +mingw=false +case "`uname`" in + CYGWIN*) cygwin=true ;; + MINGW*) mingw=true;; + Darwin*) darwin=true + # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home + # See https://developer.apple.com/library/mac/qa/qa1170/_index.html + if [ -z "$JAVA_HOME" ]; then + if [ -x "/usr/libexec/java_home" ]; then + export JAVA_HOME="`/usr/libexec/java_home`" + else + export JAVA_HOME="/Library/Java/Home" + fi + fi + ;; +esac + +if [ -z "$JAVA_HOME" ] ; then + if [ -r /etc/gentoo-release ] ; then + JAVA_HOME=`java-config --jre-home` + fi +fi + +if [ -z "$M2_HOME" ] ; then + ## resolve links - $0 may be a link to maven's home + PRG="$0" + + # need this for relative symlinks + while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG="`dirname "$PRG"`/$link" + fi + done + + saveddir=`pwd` + + M2_HOME=`dirname "$PRG"`/.. + + # make it fully qualified + M2_HOME=`cd "$M2_HOME" && pwd` + + cd "$saveddir" + # echo Using m2 at $M2_HOME +fi + +# For Cygwin, ensure paths are in UNIX format before anything is touched +if $cygwin ; then + [ -n "$M2_HOME" ] && + M2_HOME=`cygpath --unix "$M2_HOME"` + [ -n "$JAVA_HOME" ] && + JAVA_HOME=`cygpath --unix "$JAVA_HOME"` + [ -n "$CLASSPATH" ] && + CLASSPATH=`cygpath --path --unix "$CLASSPATH"` +fi + +# For Mingw, ensure paths are in UNIX format before anything is touched +if $mingw ; then + [ -n "$M2_HOME" ] && + M2_HOME="`(cd "$M2_HOME"; pwd)`" + [ -n "$JAVA_HOME" ] && + JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" +fi + +if [ -z "$JAVA_HOME" ]; then + javaExecutable="`which javac`" + if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then + # readlink(1) is not available as standard on Solaris 10. + readLink=`which readlink` + if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then + if $darwin ; then + javaHome="`dirname \"$javaExecutable\"`" + javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" + else + javaExecutable="`readlink -f \"$javaExecutable\"`" + fi + javaHome="`dirname \"$javaExecutable\"`" + javaHome=`expr "$javaHome" : '\(.*\)/bin'` + JAVA_HOME="$javaHome" + export JAVA_HOME + fi + fi +fi + +if [ -z "$JAVACMD" ] ; then + if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + else + JAVACMD="`which java`" + fi +fi + +if [ ! -x "$JAVACMD" ] ; then + echo "Error: JAVA_HOME is not defined correctly." >&2 + echo " We cannot execute $JAVACMD" >&2 + exit 1 +fi + +if [ -z "$JAVA_HOME" ] ; then + echo "Warning: JAVA_HOME environment variable is not set." +fi + +CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher + +# traverses directory structure from process work directory to filesystem root +# first directory with .mvn subdirectory is considered project base directory +find_maven_basedir() { + + if [ -z "$1" ] + then + echo "Path not specified to find_maven_basedir" + return 1 + fi + + basedir="$1" + wdir="$1" + while [ "$wdir" != '/' ] ; do + if [ -d "$wdir"/.mvn ] ; then + basedir=$wdir + break + fi + # workaround for JBEAP-8937 (on Solaris 10/Sparc) + if [ -d "${wdir}" ]; then + wdir=`cd "$wdir/.."; pwd` + fi + # end of workaround + done + echo "${basedir}" +} + +# concatenates all lines of a file +concat_lines() { + if [ -f "$1" ]; then + echo "$(tr -s '\n' ' ' < "$1")" + fi +} + +BASE_DIR=`find_maven_basedir "$(pwd)"` +if [ -z "$BASE_DIR" ]; then + exit 1; +fi + +########################################################################################## +# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +# This allows using the maven wrapper in projects that prohibit checking in binary data. +########################################################################################## +if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found .mvn/wrapper/maven-wrapper.jar" + fi +else + if [ "$MVNW_VERBOSE" = true ]; then + echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..." + fi + if [ -n "$MVNW_REPOURL" ]; then + jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + else + jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + fi + while IFS="=" read key value; do + case "$key" in (wrapperUrl) jarUrl="$value"; break ;; + esac + done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties" + if [ "$MVNW_VERBOSE" = true ]; then + echo "Downloading from: $jarUrl" + fi + wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" + if $cygwin; then + wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"` + fi + + if command -v wget > /dev/null; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found wget ... using wget" + fi + if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then + wget "$jarUrl" -O "$wrapperJarPath" + else + wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" + fi + elif command -v curl > /dev/null; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found curl ... using curl" + fi + if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then + curl -o "$wrapperJarPath" "$jarUrl" -f + else + curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f + fi + + else + if [ "$MVNW_VERBOSE" = true ]; then + echo "Falling back to using Java to download" + fi + javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" + # For Cygwin, switch paths to Windows format before running javac + if $cygwin; then + javaClass=`cygpath --path --windows "$javaClass"` + fi + if [ -e "$javaClass" ]; then + if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then + if [ "$MVNW_VERBOSE" = true ]; then + echo " - Compiling MavenWrapperDownloader.java ..." + fi + # Compiling the Java class + ("$JAVA_HOME/bin/javac" "$javaClass") + fi + if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then + # Running the downloader + if [ "$MVNW_VERBOSE" = true ]; then + echo " - Running MavenWrapperDownloader.java ..." + fi + ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR") + fi + fi + fi +fi +########################################################################################## +# End of extension +########################################################################################## + +export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} +if [ "$MVNW_VERBOSE" = true ]; then + echo $MAVEN_PROJECTBASEDIR +fi +MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" + +# For Cygwin, switch paths to Windows format before running java +if $cygwin; then + [ -n "$M2_HOME" ] && + M2_HOME=`cygpath --path --windows "$M2_HOME"` + [ -n "$JAVA_HOME" ] && + JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` + [ -n "$CLASSPATH" ] && + CLASSPATH=`cygpath --path --windows "$CLASSPATH"` + [ -n "$MAVEN_PROJECTBASEDIR" ] && + MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` +fi + +# Provide a "standardized" way to retrieve the CLI args that will +# work with both Windows and non-Windows executions. +MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@" +export MAVEN_CMD_LINE_ARGS + +WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +exec "$JAVACMD" \ + $MAVEN_OPTS \ + -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ + "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ + ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" diff --git a/mvnw.cmd b/mvnw.cmd new file mode 100644 index 0000000..c8d4337 --- /dev/null +++ b/mvnw.cmd @@ -0,0 +1,182 @@ +@REM ---------------------------------------------------------------------------- +@REM Licensed to the Apache Software Foundation (ASF) under one +@REM or more contributor license agreements. See the NOTICE file +@REM distributed with this work for additional information +@REM regarding copyright ownership. The ASF licenses this file +@REM to you under the Apache License, Version 2.0 (the +@REM "License"); you may not use this file except in compliance +@REM with the License. You may obtain a copy of the License at +@REM +@REM https://www.apache.org/licenses/LICENSE-2.0 +@REM +@REM Unless required by applicable law or agreed to in writing, +@REM software distributed under the License is distributed on an +@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +@REM KIND, either express or implied. See the License for the +@REM specific language governing permissions and limitations +@REM under the License. +@REM ---------------------------------------------------------------------------- + +@REM ---------------------------------------------------------------------------- +@REM Maven Start Up Batch script +@REM +@REM Required ENV vars: +@REM JAVA_HOME - location of a JDK home dir +@REM +@REM Optional ENV vars +@REM M2_HOME - location of maven2's installed home dir +@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands +@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending +@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven +@REM e.g. to debug Maven itself, use +@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files +@REM ---------------------------------------------------------------------------- + +@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' +@echo off +@REM set title of command window +title %0 +@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' +@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% + +@REM set %HOME% to equivalent of $HOME +if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") + +@REM Execute a user defined script before this one +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre +@REM check for pre script, once with legacy .bat ending and once with .cmd ending +if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" +if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" +:skipRcPre + +@setlocal + +set ERROR_CODE=0 + +@REM To isolate internal variables from possible post scripts, we use another setlocal +@setlocal + +@REM ==== START VALIDATION ==== +if not "%JAVA_HOME%" == "" goto OkJHome + +echo. +echo Error: JAVA_HOME not found in your environment. >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +:OkJHome +if exist "%JAVA_HOME%\bin\java.exe" goto init + +echo. +echo Error: JAVA_HOME is set to an invalid directory. >&2 +echo JAVA_HOME = "%JAVA_HOME%" >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +@REM ==== END VALIDATION ==== + +:init + +@REM Find the project base dir, i.e. the directory that contains the folder ".mvn". +@REM Fallback to current working directory if not found. + +set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% +IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir + +set EXEC_DIR=%CD% +set WDIR=%EXEC_DIR% +:findBaseDir +IF EXIST "%WDIR%"\.mvn goto baseDirFound +cd .. +IF "%WDIR%"=="%CD%" goto baseDirNotFound +set WDIR=%CD% +goto findBaseDir + +:baseDirFound +set MAVEN_PROJECTBASEDIR=%WDIR% +cd "%EXEC_DIR%" +goto endDetectBaseDir + +:baseDirNotFound +set MAVEN_PROJECTBASEDIR=%EXEC_DIR% +cd "%EXEC_DIR%" + +:endDetectBaseDir + +IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig + +@setlocal EnableExtensions EnableDelayedExpansion +for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a +@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% + +:endReadAdditionalConfig + +SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" +set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" +set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + +FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( + IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B +) + +@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +@REM This allows using the maven wrapper in projects that prohibit checking in binary data. +if exist %WRAPPER_JAR% ( + if "%MVNW_VERBOSE%" == "true" ( + echo Found %WRAPPER_JAR% + ) +) else ( + if not "%MVNW_REPOURL%" == "" ( + SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + ) + if "%MVNW_VERBOSE%" == "true" ( + echo Couldn't find %WRAPPER_JAR%, downloading it ... + echo Downloading from: %DOWNLOAD_URL% + ) + + powershell -Command "&{"^ + "$webclient = new-object System.Net.WebClient;"^ + "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ + "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ + "}"^ + "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^ + "}" + if "%MVNW_VERBOSE%" == "true" ( + echo Finished downloading %WRAPPER_JAR% + ) +) +@REM End of extension + +@REM Provide a "standardized" way to retrieve the CLI args that will +@REM work with both Windows and non-Windows executions. +set MAVEN_CMD_LINE_ARGS=%* + +%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* +if ERRORLEVEL 1 goto error +goto end + +:error +set ERROR_CODE=1 + +:end +@endlocal & set ERROR_CODE=%ERROR_CODE% + +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost +@REM check for post script, once with legacy .bat ending and once with .cmd ending +if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" +if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" +:skipRcPost + +@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' +if "%MAVEN_BATCH_PAUSE%" == "on" pause + +if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% + +exit /B %ERROR_CODE% diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..6e083c4 --- /dev/null +++ b/pom.xml @@ -0,0 +1,206 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-parent</artifactId> + <version>2.1.7.RELEASE</version> + <relativePath/> <!-- lookup parent from repository --> + </parent> + <groupId>com.subsidy</groupId> + <artifactId>subsidy</artifactId> + <version>0.0.1</version> + <name>subsidy</name> + <description>Demo project for Spring Boot</description> + + <properties> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + <maven.compiler.encoding>UTF-8</maven.compiler.encoding> + <java.version>1.8</java.version> + <mybatis-plus.version>3.3.0</mybatis-plus.version> + <generator.version>3.3.2</generator.version> + <swagger2.version>2.9.2</swagger2.version> + <fastjson.version>1.2.58</fastjson.version> + <jhash.version>2.0.0</jhash.version> + <poi-ooxml.version>3.13</poi-ooxml.version> + <dysmsapi.version>1.1.0</dysmsapi.version> + <sdk-core.version>4.4.6</sdk-core.version> + <lang3.version>3.9</lang3.version> + <druid.version>1.1.22</druid.version> + <itext-asian.version>5.2.0</itext-asian.version> + <itextpdf.version>5.4.1</itextpdf.version> + <java-jwt.version>3.10.3</java-jwt.version> + </properties> + + <dependencies> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter</artifactId> + </dependency> + + <dependency> + <groupId>org.freemarker</groupId> + <artifactId>freemarker</artifactId> + </dependency> + + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-web</artifactId> + </dependency> + + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-aop</artifactId> + </dependency> + + <dependency> + <groupId>com.tencentcloudapi</groupId> + <artifactId>tencentcloud-sdk-java</artifactId> + <version>3.1.64</version> + </dependency> + + <dependency> + <groupId>com.qcloud</groupId> + <artifactId>vod_api</artifactId> + <version>2.1.2</version> + </dependency> + + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-configuration-processor</artifactId> + <optional>true</optional> + </dependency> + + <dependency> + <groupId>mysql</groupId> + <artifactId>mysql-connector-java</artifactId> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>com.alibaba</groupId> + <artifactId>druid-spring-boot-starter</artifactId> + <version>${druid.version}</version> + </dependency> + + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-jdbc</artifactId> + </dependency> + + <dependency> + <groupId>org.projectlombok</groupId> + <artifactId>lombok</artifactId> + <!-- <optional>true</optional>--> + </dependency> + + <dependency> + <groupId>com.baomidou</groupId> + <artifactId>mybatis-plus-boot-starter</artifactId> + <version>${mybatis-plus.version}</version> + </dependency> + + <dependency> + <groupId>com.baomidou</groupId> + <artifactId>mybatis-plus-generator</artifactId> + <version>${generator.version}</version> + </dependency> + + <dependency> + <groupId>com.alibaba</groupId> + <artifactId>fastjson</artifactId> + <version>${fastjson.version}</version> + </dependency> + + <dependency> + <groupId>io.springfox</groupId> + <artifactId>springfox-swagger2</artifactId> + <version>${swagger2.version}</version> + </dependency> + + <dependency> + <groupId>io.springfox</groupId> + <artifactId>springfox-swagger-ui</artifactId> + <version>${swagger2.version}</version> + </dependency> + + <dependency> + <groupId>com.amdelamar</groupId> + <artifactId>jhash</artifactId> + <version>${jhash.version}</version> + </dependency> + + <dependency> + <groupId>org.apache.poi</groupId> + <artifactId>poi-ooxml</artifactId> + <version>${poi-ooxml.version}</version> + </dependency> + + <dependency> + <groupId>com.aliyun</groupId> + <artifactId>aliyun-java-sdk-dysmsapi</artifactId> + <version>${dysmsapi.version}</version> + </dependency> + <dependency> + <groupId>com.aliyun</groupId> + <artifactId>aliyun-java-sdk-core</artifactId> + <version>${sdk-core.version}</version> + </dependency> + <dependency> + <groupId>org.apache.commons</groupId> + <artifactId>commons-lang3</artifactId> + <version>${lang3.version}</version> + </dependency> + + <dependency> + <groupId>com.itextpdf</groupId> + <artifactId>itext-asian</artifactId> + <version>${itext-asian.version}</version> + </dependency> + + <dependency> + <groupId>com.itextpdf</groupId> + <artifactId>itextpdf</artifactId> + <version>${itextpdf.version}</version> + </dependency> + + <dependency> + <groupId>com.auth0</groupId> + <artifactId>java-jwt</artifactId> + <version>${java-jwt.version}</version> + </dependency> + + <dependency> + <groupId>net.sf.json-lib</groupId> + <artifactId>json-lib</artifactId> + <version>2.4</version> + <classifier>jdk15</classifier> + </dependency> + + <dependency> + <groupId>org.scilab.forge</groupId> + <artifactId>jlatexmath</artifactId> + <version>1.0.7</version> + </dependency> + </dependencies> + + <build> + <finalName>subsidy</finalName> + <plugins> + <plugin> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-maven-plugin</artifactId> + <configuration> + <excludes> + <exclude> + <groupId>org.projectlombok</groupId> + <artifactId>lombok</artifactId> + </exclude> + </excludes> + </configuration> + </plugin> + </plugins> + </build> + +</project> diff --git a/src/main/java/com/meishu/MeishuApplication.java b/src/main/java/com/meishu/MeishuApplication.java new file mode 100644 index 0000000..986f2e8 --- /dev/null +++ b/src/main/java/com/meishu/MeishuApplication.java @@ -0,0 +1,39 @@ +package com.meishu; + +import com.alibaba.druid.support.http.StatViewServlet; +import org.mybatis.spring.annotation.MapperScan; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.web.servlet.ServletRegistrationBean; +import org.springframework.context.annotation.Bean; +import org.springframework.scheduling.annotation.EnableAsync; +import org.springframework.scheduling.annotation.EnableScheduling; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@SpringBootApplication +@MapperScan(basePackages = {"com.meishu.mapper"}) +@EnableScheduling +@EnableAsync +public class MeishuApplication { + + public static void main(String[] args) { + SpringApplication.run(MeishuApplication.class, args); + } + + @Bean + public ServletRegistrationBean druidStatViewServlet() { + //先配置管理后台的servLet,访问的入口为/druid/ + ServletRegistrationBean servletRegistrationBean = new ServletRegistrationBean( + new StatViewServlet(), "/druid/*"); + // IP白名单 (没有配置或者为空,则允许所有访问) + servletRegistrationBean.addInitParameter("allow", "127.0.0.1"); + // IP黑名单 (存在共同时,deny优先于allow) + servletRegistrationBean.addInitParameter("deny", ""); + servletRegistrationBean.addInitParameter("loginUsername", "admin"); + servletRegistrationBean.addInitParameter("loginPassword", "yhkl1234"); + servletRegistrationBean.addInitParameter("resetEnable", "false"); + return servletRegistrationBean; + } + +} diff --git a/src/main/java/com/meishu/common/Code.java b/src/main/java/com/meishu/common/Code.java new file mode 100644 index 0000000..8aa1868 --- /dev/null +++ b/src/main/java/com/meishu/common/Code.java @@ -0,0 +1,45 @@ +package com.meishu.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/meishu/common/ResponseData.java b/src/main/java/com/meishu/common/ResponseData.java new file mode 100644 index 0000000..c80c3a8 --- /dev/null +++ b/src/main/java/com/meishu/common/ResponseData.java @@ -0,0 +1,54 @@ +package com.meishu.common; + +import com.meishu.common.configure.RemoteProperties; +import lombok.Data; +import org.springframework.boot.context.properties.EnableConfigurationProperties; + +/** + * 返回数据 + * + * @author DengMin + * @date 2019/08/27 13:57 + **/ +@Data +@EnableConfigurationProperties(RemoteProperties.class) +public class ResponseData { + + public static <T> ResponseVO<T> generateCreatedResponse(int code) { + return (ResponseVO<T>) ResponseVO.builder() + .code(code) + .message(RemoteProperties.getMessage(code)) + .build(); + } + + public static <T> ResponseVO<T> generateCreatedResponse(int code, String message) { + return (ResponseVO<T>) ResponseVO.builder() + .code(code) + .message(message) + .build(); + } + + public static <T> ResponseVO<T> generateCreatedResponse(int code, T data) { + return (ResponseVO<T>) ResponseVO.builder() + .code(code) + .message(RemoteProperties.getMessage(code)) + .data(data) + .build(); + } + + public static <T> ResponseVO<T> generateCreatedResponse(int code, String message, T data) { + return (ResponseVO<T>) ResponseVO.builder() + .code(code) + .message(message) + .data(data) + .build(); + } + + public static <T> ResponseVO<T> generateCreatedResponse(int code, String message, String path) { + return (ResponseVO<T>) ResponseVO.builder() + .code(code) + .message(message) + .path(path) + .build(); + } +} \ No newline at end of file diff --git a/src/main/java/com/meishu/common/ResponseVO.java b/src/main/java/com/meishu/common/ResponseVO.java new file mode 100644 index 0000000..7cc4173 --- /dev/null +++ b/src/main/java/com/meishu/common/ResponseVO.java @@ -0,0 +1,21 @@ +package com.meishu.common; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class ResponseVO<T> { + + private Integer code; + + private String message; + + private T data; + + private String path; +} \ No newline at end of file diff --git a/src/main/java/com/meishu/common/configure/AliyunSmsProperties.java b/src/main/java/com/meishu/common/configure/AliyunSmsProperties.java new file mode 100644 index 0000000..d47f388 --- /dev/null +++ b/src/main/java/com/meishu/common/configure/AliyunSmsProperties.java @@ -0,0 +1,19 @@ +package com.meishu.common.configure; + +import lombok.Data; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.stereotype.Component; + +@Data +@Component +@ConfigurationProperties(prefix = "sms") +public class AliyunSmsProperties { + + private String product; + + private String domain; + + private String accessKeyId; + + private String accessKeySecret; +} diff --git a/src/main/java/com/meishu/common/configure/MybatisPlusConfig.java b/src/main/java/com/meishu/common/configure/MybatisPlusConfig.java new file mode 100644 index 0000000..a95a738 --- /dev/null +++ b/src/main/java/com/meishu/common/configure/MybatisPlusConfig.java @@ -0,0 +1,54 @@ +package com.meishu.common.configure; + +import com.baomidou.mybatisplus.annotation.DbType; +import com.baomidou.mybatisplus.core.config.GlobalConfig; +import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor; +import com.meishu.common.handler.MetaHandler; +import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * @author: tuyp + * @create: 2020-08-12 12:01 + */ +@Configuration +@ConditionalOnClass(value = {PaginationInterceptor.class}) +public class MybatisPlusConfig { + + /** + * 分页 + * @return + */ + @Bean + public PaginationInterceptor paginationInterceptor(){ + PaginationInterceptor paginationInterceptor = new PaginationInterceptor(); + paginationInterceptor.setDialectType(DbType.MYSQL.getDb()); + return paginationInterceptor; + } +// +// /** +// * 打印 sql +// */ +// @Bean +// public PerformanceInterceptor performanceInterceptor() { +// PerformanceInterceptor performanceInterceptor = new PerformanceInterceptor(); +// //格式化sql语句 +// Properties properties = new Properties(); +// properties.setProperty("format", "false"); +// performanceInterceptor.setProperties(properties); +// return performanceInterceptor; +// } + + /** + * 自动填充功能 + * @return + */ + @Bean + public GlobalConfig globalConfig() { + GlobalConfig globalConfig = new GlobalConfig(); + globalConfig.setMetaObjectHandler(new MetaHandler()); + return globalConfig; + } + +} diff --git a/src/main/java/com/meishu/common/configure/RemoteProperties.java b/src/main/java/com/meishu/common/configure/RemoteProperties.java new file mode 100644 index 0000000..043c5e9 --- /dev/null +++ b/src/main/java/com/meishu/common/configure/RemoteProperties.java @@ -0,0 +1,36 @@ +package com.meishu.common.configure; + +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.context.annotation.PropertySource; +import org.springframework.stereotype.Component; + +import java.util.HashMap; +import java.util.Map; + +/** + * <p> + * 读取状态码 + * </p> + * + * @author DengMin + * @date Created in 2020/08/24 + */ +@Component +@ConfigurationProperties(prefix = "meishu") +@PropertySource(value = "classpath:code.properties", encoding = "UTF-8") +public class RemoteProperties { + + private static Map<Integer, String> codeMessage = new HashMap<>(); + + public static String getMessage(Integer code) { + return codeMessage.get(code); + } + + public Map<Integer, String> getCodeMessage() { + return codeMessage; + } + + public void setCodeMessage(Map<Integer, String> codeMessage) { + RemoteProperties.codeMessage = codeMessage; + } +} \ No newline at end of file diff --git a/src/main/java/com/meishu/common/configure/RestTemplateConfig.java b/src/main/java/com/meishu/common/configure/RestTemplateConfig.java new file mode 100644 index 0000000..5f9887c --- /dev/null +++ b/src/main/java/com/meishu/common/configure/RestTemplateConfig.java @@ -0,0 +1,31 @@ +package com.meishu.common.configure; + +import org.springframework.context.annotation.Bean; +import org.springframework.http.MediaType; +import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; +import org.springframework.stereotype.Component; +import org.springframework.web.client.RestTemplate; + +import java.util.ArrayList; +import java.util.List; + +@Component +public class RestTemplateConfig { + + @Bean + public RestTemplate restTemplate() { + RestTemplate restTemplate = new RestTemplate(); + restTemplate.getMessageConverters().add(new WxMappingJackson2HttpMessageConverter()); + return restTemplate; + } + + public class WxMappingJackson2HttpMessageConverter extends MappingJackson2HttpMessageConverter { + public WxMappingJackson2HttpMessageConverter(){ + List<MediaType> mediaTypes = new ArrayList<>(); + mediaTypes.add(MediaType.TEXT_PLAIN); + mediaTypes.add(MediaType.TEXT_HTML); + setSupportedMediaTypes(mediaTypes); + } + } + +} diff --git a/src/main/java/com/meishu/common/configure/SwaggerConfig.java b/src/main/java/com/meishu/common/configure/SwaggerConfig.java new file mode 100644 index 0000000..ae3f471 --- /dev/null +++ b/src/main/java/com/meishu/common/configure/SwaggerConfig.java @@ -0,0 +1,31 @@ +package com.meishu.common.configure; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import springfox.documentation.builders.ApiInfoBuilder; +import springfox.documentation.builders.PathSelectors; +import springfox.documentation.builders.RequestHandlerSelectors; +import springfox.documentation.spi.DocumentationType; +import springfox.documentation.spring.web.plugins.Docket; +import springfox.documentation.swagger2.annotations.EnableSwagger2; + +@Configuration +@EnableSwagger2 +public class SwaggerConfig { + @Bean + public Docket createRestApi() { + return new Docket(DocumentationType.SWAGGER_2) + .pathMapping("/") + .select() + .apis(RequestHandlerSelectors.basePackage("com.meishu")) + .paths(PathSelectors.any()) + .build().apiInfo(new ApiInfoBuilder() + .title("市西cms") + .description("接口文档规范") + .version("1.0") +// .contact(new Contact("啊啊啊啊","www.youkehulian.com","tcp@meishu.com")) +// .license("The Apache License") +// .licenseUrl("http://www.baidu.com") + .build()); + } +} diff --git a/src/main/java/com/meishu/common/configure/VODConfig.java b/src/main/java/com/meishu/common/configure/VODConfig.java new file mode 100644 index 0000000..0b42810 --- /dev/null +++ b/src/main/java/com/meishu/common/configure/VODConfig.java @@ -0,0 +1,25 @@ +package com.meishu.common.configure; + +import lombok.Data; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.stereotype.Component; + +/** + * @author: tuyp + * @create: 2020-06-01 16:46 + */ +@Component +@Data +@ConfigurationProperties(prefix = "vod") +public class VODConfig { + + private String appId; + + private String secretId; + + private String secretKey; + + private String api; + + private String region; +} diff --git a/src/main/java/com/meishu/common/configure/WebConfig.java b/src/main/java/com/meishu/common/configure/WebConfig.java new file mode 100644 index 0000000..a8b746a --- /dev/null +++ b/src/main/java/com/meishu/common/configure/WebConfig.java @@ -0,0 +1,61 @@ +package com.meishu.common.configure; + +import com.meishu.common.interceptor.AuthenticationInterceptor; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.servlet.config.annotation.CorsRegistry; +import org.springframework.web.servlet.config.annotation.InterceptorRegistry; +import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; + +/** + * @author DengMin + * @date 2020/07/06 + **/ +@Configuration +public class WebConfig implements WebMvcConfigurer { + + @Autowired + private AuthenticationInterceptor authenticationInterceptor; + + /** + * 跨域支持 + * + * @param registry + */ + @Override + public void addCorsMappings(CorsRegistry registry) { + registry.addMapping("/**") +// .allowCredentials(true) + .allowedOrigins("*") + .allowedMethods("GET", "HEAD", "POST", "PUT", "DELETE", "OPTIONS") + .maxAge(3600); + } + + /** + * Swagger + * @param registry + */ + @Override + public void addResourceHandlers(ResourceHandlerRegistry registry) { + registry.addResourceHandler("/**").addResourceLocations("classpath:/static/"); + registry.addResourceHandler("swagger-ui.html") + .addResourceLocations("classpath:/META-INF/resources/"); + registry.addResourceHandler("/webjars/**") + .addResourceLocations("classpath:/META-INF/resources/webjars/"); + } + + /** + * 鉴权 + * @param registry + */ + @Override + public void addInterceptors(InterceptorRegistry registry) { + registry.addInterceptor(authenticationInterceptor) + .excludePathPatterns("/static/*") + .addPathPatterns("/**"); + } + + + +} \ No newline at end of file diff --git a/src/main/java/com/meishu/common/configure/WebLogAspect.java b/src/main/java/com/meishu/common/configure/WebLogAspect.java new file mode 100644 index 0000000..c4deaf1 --- /dev/null +++ b/src/main/java/com/meishu/common/configure/WebLogAspect.java @@ -0,0 +1,56 @@ +package com.meishu.common.configure; + +import org.aspectj.lang.JoinPoint; +import org.aspectj.lang.annotation.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Component; +import org.springframework.web.context.request.RequestAttributes; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.servlet.http.HttpServletRequest; +import java.util.Arrays; + +@Aspect +@Component +public class WebLogAspect { + + private final Logger logger = LoggerFactory.getLogger(WebLogAspect.class); + + @Pointcut("execution(public * com.meishu.controller.*.*(..))")//切入点描述 这个是controller包的切入点 + public void controllerLog(){}//签名,可以理解成这个切入点的一个名称 + + @Pointcut("execution(public * com.meishu.controller.*.*(..))") + public void serviceImplLog(){} + + @Before("controllerLog()") //在切入点的方法run之前要干的 + public void logBeforeController(JoinPoint joinPoint) { + + + RequestAttributes requestAttributes = RequestContextHolder.getRequestAttributes(); + //这个RequestContextHolder是Springmvc提供来获得请求的东西 + HttpServletRequest request = ((ServletRequestAttributes)requestAttributes).getRequest(); + + // 记录下请求内容 + logger.info("####requestUrl : " + request.getRequestURL().toString()); + logger.info("####requestParam : " + Arrays.toString(joinPoint.getArgs())); + + } + +// @Around("serviceImplLog()") +// public Object afterController(ProceedingJoinPoint proceedingJoinPoint) { +// +// Object result = null; +// +// try{ +// result = proceedingJoinPoint.proceed(); +// logger.info("====reulst"+result); +// }catch (Throwable e){ +// MyException myException =(MyException)e; +// throw myException; +// } +// return result; +// } + +} \ No newline at end of file diff --git a/src/main/java/com/meishu/common/configure/WechatConfig.java b/src/main/java/com/meishu/common/configure/WechatConfig.java new file mode 100644 index 0000000..042038f --- /dev/null +++ b/src/main/java/com/meishu/common/configure/WechatConfig.java @@ -0,0 +1,24 @@ +package com.meishu.common.configure; + + +import lombok.Data; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.context.annotation.Configuration; + +@Data +@Configuration +@ConfigurationProperties(prefix = "wechat") +public class WechatConfig { + + private String appId; + + private String appSecret; + + private String msgUrl; + + private String templateId; + + private String agentId; + + +} diff --git a/src/main/java/com/meishu/common/constant/AttendanceConstant.java b/src/main/java/com/meishu/common/constant/AttendanceConstant.java new file mode 100644 index 0000000..33b119d --- /dev/null +++ b/src/main/java/com/meishu/common/constant/AttendanceConstant.java @@ -0,0 +1,29 @@ +package com.meishu.common.constant; + +public class AttendanceConstant { + + /** + * 创建预约api + */ + public static final String CREATE_TOPIC_URL = "https://open.api.roomis.com.cn/api/my/booking/spaces/{spaceId}/events"; + + /** + * 考勤api + */ + public static final String GET_ATTENDANCE_URL = "https://open.api.roomis.com.cn/api/attendance/{id}"; + + /** + * 创建人ID + */ + public static Long organizerId = 200000222L; + + /** + * 开始时间 + */ + public static String startTime = "07:00:00"; + + /** + * 结束时间 + */ + public static String endTime = "21:00:00"; +} diff --git a/src/main/java/com/meishu/common/constant/Code.java b/src/main/java/com/meishu/common/constant/Code.java new file mode 100644 index 0000000..58388c5 --- /dev/null +++ b/src/main/java/com/meishu/common/constant/Code.java @@ -0,0 +1,33 @@ +package com.meishu.common.constant; + +import lombok.Getter; + +@Getter +public enum Code { + + USERNAMENOTFOUND(1001, "用户不存在"), + BADCREDENTIALS(1002,"账户或者密码错误"), + ACCOUNTEXPIRED(1003,"账户过期"), + LOCKEDEXCEPTION(1004, "账户已锁定"), + DISABLEDEXCEPTION(1005,"账户已禁用"), + ACCESSDENIED(1006,"无权限访问"), + AUTHENTICATION(1007,"身份验证异常"), + NOHANDLERFOUND(1008,"找不到相应的视图处理器"), + PARAM_INVALID(1009, "参数不合法"), + TOKEN_EXCEPTION(1010, "无效的令牌"), + TOKEN_EXPIRED(1011, "令牌已过期"), + TOKEN_VERIFICATION_FAILED(1013, "令牌验证失败"), + OSS_ERROR(1012, "OSS文件上传异常"), + Network_ERROR(9000, "网络请求失败"), + SERVER_INTERNAL_ERROR(99999, "服务器内部错误"), + ; + + private Integer code; + + private String message; + + Code(Integer code, String message) { + this.code = code; + this.message = message; + } +} diff --git a/src/main/java/com/meishu/common/constant/WxConstant.java b/src/main/java/com/meishu/common/constant/WxConstant.java new file mode 100644 index 0000000..b9ad76d --- /dev/null +++ b/src/main/java/com/meishu/common/constant/WxConstant.java @@ -0,0 +1,35 @@ +package com.meishu.common.constant; + +public class WxConstant { + + /** + * app id + */ + public static final String APPID = "wx75ec06e9ce50ef73"; + + /** + * 秘钥 + */ + public static final String SECRENT = "c039d32804278503474dfcf7cb3944b9"; + + /** + * 获取访问用户身份 + */ + public static final String GETUSERINFO = "https://qyapi.weixin.qq.com/cgi-bin/user/getuserinfo?access_token={access_token}&code={code}"; + + /** + * 读取成员 + */ + public static final String GET = "https://qyapi.weixin.qq.com/cgi-bin/user/get?access_token={access_token}&userid={userid}"; + + /** + * 获取access_token + */ + public static final String GET_SUITE_TOKEN = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid={appid}&secret={secret}"; + + + /** + * 扫码登陆回调地址 + */ + public static final String QR_REDIRECT_URL = "http://massadmin.youkehulian.com"; +} diff --git a/src/main/java/com/meishu/common/exception/GlobalExceptionHandler.java b/src/main/java/com/meishu/common/exception/GlobalExceptionHandler.java new file mode 100644 index 0000000..f20187c --- /dev/null +++ b/src/main/java/com/meishu/common/exception/GlobalExceptionHandler.java @@ -0,0 +1,118 @@ +package com.meishu.common.exception; + +import com.baomidou.mybatisplus.core.toolkit.StringUtils; +import com.meishu.common.ResponseData; +import com.meishu.common.ResponseVO; +import com.meishu.common.configure.RemoteProperties; +import com.meishu.common.constant.Code; +import lombok.extern.slf4j.Slf4j; +import org.apache.poi.ss.formula.functions.T; +import org.springframework.http.converter.HttpMessageNotReadableException; +import org.springframework.validation.BindException; +import org.springframework.web.HttpRequestMethodNotSupportedException; +import org.springframework.web.bind.MethodArgumentNotValidException; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.RestControllerAdvice; +import org.springframework.web.servlet.NoHandlerFoundException; + +import javax.servlet.http.HttpServletRequest; +import java.util.ArrayList; +import java.util.List; + +/** + * 异常处理 + * @author DengMin + * @date 2020/07/14 + **/ +@Slf4j +@RestControllerAdvice +public class GlobalExceptionHandler { + + /** + * 自定义异常 + * @param e + * @return + */ + @ExceptionHandler(value = HttpException.class) + public ResponseVO<T> handlerException(HttpServletRequest request, HttpException e) { + String message = RemoteProperties.getMessage(e.getCode()); + if(StringUtils.isBlank(message)) { + message = e.getMessage(); + } + String url = request.getRequestURI(); + return ResponseData.generateCreatedResponse(e.getCode(), message, url); + } + + /** + * 404 + * @param request + * @return + */ + @ExceptionHandler(value = NoHandlerFoundException.class) + public ResponseVO<T> NoHandlerFoundException(HttpServletRequest request) { + String url = request.getRequestURI(); + return ResponseData.generateCreatedResponse(Code.NOHANDLERFOUND.getCode(), Code.NOHANDLERFOUND.getMessage(), url); + } + + /** + * 请求方式错误 + * @param request + * @return + */ + @ExceptionHandler(value = HttpRequestMethodNotSupportedException.class) + public ResponseVO<T> HttpRequestMethodNotSupportedException(HttpServletRequest request) { + String url = request.getRequestURI(); + return ResponseData.generateCreatedResponse(Code.NOHANDLERFOUND.getCode(), Code.NOHANDLERFOUND.getMessage(), url); + } + + /** + * 参数不合法 + * @param e + * @return + */ + @ExceptionHandler(MethodArgumentNotValidException.class) + public ResponseVO<T> validateException(MethodArgumentNotValidException e){ + final List<String> errList = new ArrayList<>(); + e.getBindingResult().getAllErrors().stream().forEach(x -> { + errList.add(x.getDefaultMessage()); + }); + return ResponseData.generateCreatedResponse(Code.PARAM_INVALID.getCode(), Code.PARAM_INVALID.getMessage(), errList.toString()); + } + + /** + * JSON 序列化异常 + * @param e + * @return + */ + @ExceptionHandler(HttpMessageNotReadableException.class) + public ResponseVO<T> exceptionHandler(HttpMessageNotReadableException e) { + log.error(e.getMessage()); + return ResponseData.generateCreatedResponse(Code.PARAM_INVALID.getCode(), Code.PARAM_INVALID.getMessage()+":{"+e.getMessage()+"}"); + } + + /** + * 校验异常 + * @param e + * @return + */ + @ExceptionHandler(BindException.class) + public ResponseVO<T> BindException(BindException e){ + final List<String> errList = new ArrayList<>(); + e.getBindingResult().getAllErrors().stream().forEach(x -> { + errList.add(x.getDefaultMessage()); + }); + return ResponseData.generateCreatedResponse(Code.PARAM_INVALID.getCode(), Code.PARAM_INVALID.getMessage(), errList.toString()); + } + + /** + * 服务器内部错误 + * @return + */ + @ExceptionHandler(value = Exception.class) + public ResponseVO<T> serverInternalError(Exception e, HttpServletRequest request) { + String url = request.getRequestURI(); + log.error("path:"+url); + log.error("---- error message: ---"+e.toString()); + return ResponseData.generateCreatedResponse(Code.SERVER_INTERNAL_ERROR.getCode(), Code.SERVER_INTERNAL_ERROR.getMessage(), url); + } +} \ No newline at end of file diff --git a/src/main/java/com/meishu/common/exception/HttpException.java b/src/main/java/com/meishu/common/exception/HttpException.java new file mode 100644 index 0000000..d38b63a --- /dev/null +++ b/src/main/java/com/meishu/common/exception/HttpException.java @@ -0,0 +1,45 @@ +package com.meishu.common.exception; + + +import com.meishu.common.configure.RemoteProperties; + +/** + * 异常处理 + * @author DengMin + * @date 2020/08/12 + **/ +public class HttpException extends RuntimeException{ + + private Integer code; + + private String message; + + public Integer getCode() { + return code; + } + + public void setCode(Integer code) { + this.code = code; + } + + @Override + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public HttpException(Integer code) { + super(RemoteProperties.getMessage(code)); + String message = RemoteProperties.getMessage(code); + this.message = message; + this.code = code; + } + + public HttpException(Integer code, String message) { + this.message = message; + this.code = code; + } +} diff --git a/src/main/java/com/meishu/common/handler/MetaHandler.java b/src/main/java/com/meishu/common/handler/MetaHandler.java new file mode 100644 index 0000000..3d42a8f --- /dev/null +++ b/src/main/java/com/meishu/common/handler/MetaHandler.java @@ -0,0 +1,26 @@ +package com.meishu.common.handler; + +import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler; +import org.apache.ibatis.reflection.MetaObject; +import org.springframework.stereotype.Component; + +import java.time.LocalDateTime; + +/** + * 填充配置 + * @author DengMin + * @date 2020/07/21 + **/ +@Component +public class MetaHandler implements MetaObjectHandler { + + @Override + public void insertFill(MetaObject metaObject) { + this.setFieldValByName("createDate", LocalDateTime.now(), metaObject); + } + + @Override + public void updateFill(MetaObject metaObject) { + this.setFieldValByName("updateDate", LocalDateTime.now(), metaObject); + } +} diff --git a/src/main/java/com/meishu/common/interceptor/AuthenticationInterceptor.java b/src/main/java/com/meishu/common/interceptor/AuthenticationInterceptor.java new file mode 100644 index 0000000..a3dc6e7 --- /dev/null +++ b/src/main/java/com/meishu/common/interceptor/AuthenticationInterceptor.java @@ -0,0 +1,85 @@ +package com.meishu.common.interceptor; + +import com.auth0.jwt.interfaces.Claim; +import com.baomidou.mybatisplus.core.toolkit.StringUtils; +import com.meishu.common.exception.HttpException; +import com.meishu.mapper.AdministerMapper; +import com.meishu.model.AdministerDO; +import com.meishu.util.JwtUtil; +import com.meishu.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; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.lang.reflect.Method; +import java.util.Map; + +/** + * <p> + * 鉴权拦截器 + * </p> + * + * @author DengMin + * @since 2021/4/14 + */ +@Component +public class AuthenticationInterceptor implements HandlerInterceptor { + + + @Autowired + private AdministerMapper administerMapper; + + @Override + public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) { + // 不需要进行拦截 + if (!(handler instanceof HandlerMethod)) { + return true; + } + + HandlerMethod handlerMethod = (HandlerMethod) handler; + Method method = handlerMethod.getMethod(); + LoginRequired methodAnnotation = method.getAnnotation(LoginRequired.class); + if (methodAnnotation != null) { + String authorization = request.getHeader("Authorization"); + if (!StringUtils.isBlank(authorization)) { + String token = authorization; + if (authorization.startsWith("Bearer")) { + token = authorization.replace("Bearer ", ""); + } + /*Token不存在*/ + if (token == null || JwtUtil.isExpired(token) || !JwtUtil.verifyToken(token)) { + throw new HttpException(1010); + } + + Map<String, Claim> claimMap = JwtUtil.getClaims(token); + if (claimMap != null) { + String[] role = methodAnnotation.value(); + 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; + } + } else { + throw new HttpException(1010); + } + } else { + AdministerDO administerDO = administerMapper.selectById(claimMap.get("id").asLong()); + if (administerDO != null) { + Localstorage.setUser(administerDO); + return true; + } + } + } +// return true; + } + throw new HttpException(1010); + } + return true; + } +} diff --git a/src/main/java/com/meishu/common/interceptor/LoginRequired.java b/src/main/java/com/meishu/common/interceptor/LoginRequired.java new file mode 100644 index 0000000..0dab707 --- /dev/null +++ b/src/main/java/com/meishu/common/interceptor/LoginRequired.java @@ -0,0 +1,20 @@ +package com.meishu.common.interceptor; + +import java.lang.annotation.*; + +/** + * <p> + * 自定义验证登陆注解 + * </p> + * + * @author DengMin + * @since 2020/12/18 + */ +@Target({ElementType.METHOD}) +@Retention(RetentionPolicy.RUNTIME) +@Documented +@Inherited +public @interface LoginRequired { + + String[] value(); +} \ No newline at end of file diff --git a/src/main/java/com/meishu/common/schedule/ChangeStudentStatus.java b/src/main/java/com/meishu/common/schedule/ChangeStudentStatus.java new file mode 100644 index 0000000..5b16f0a --- /dev/null +++ b/src/main/java/com/meishu/common/schedule/ChangeStudentStatus.java @@ -0,0 +1,20 @@ +package com.meishu.common.schedule; + +import com.meishu.mapper.StudentMapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Component; + +@Component +public class ChangeStudentStatus { + + @Autowired + private StudentMapper studentMapper; + + @Scheduled(cron = "0 30 20 * * ?") + public void changeStudentStatus(){ + System.out.println("========="); + studentMapper.changeStudentStatus(); + } + +} diff --git a/src/main/java/com/meishu/controller/AccessTokenController.java b/src/main/java/com/meishu/controller/AccessTokenController.java new file mode 100644 index 0000000..186f3a7 --- /dev/null +++ b/src/main/java/com/meishu/controller/AccessTokenController.java @@ -0,0 +1,45 @@ +package com.meishu.controller; + + +import com.meishu.common.ResponseData; +import com.meishu.common.ResponseVO; +import com.meishu.dto.token.GetAllStudentsDTO; +import com.meishu.dto.token.GetAllTeachersDTO; +import com.meishu.model.AdministerDO; +import com.meishu.model.UserRoleDO; +import com.meishu.service.AccessTokenService; +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 Tuyp + * @since 2021-05-10 + */ +@RestController +@Api(tags = "公共接口") +@RequestMapping("/public") +public class AccessTokenController { + + @Autowired + private AccessTokenService accessTokenService; + + @PostMapping("getAllTeachers") + public ResponseVO getAllTeachers(@RequestBody GetAllTeachersDTO getAllTeachersDTO){ + return ResponseData.generateCreatedResponse(0,accessTokenService.getAllTeachers(getAllTeachersDTO)); + } + + @PostMapping("getAllStudents") + public ResponseVO getAllStudents(@RequestBody GetAllStudentsDTO getAllStudentsDTO){ + return ResponseData.generateCreatedResponse(0,accessTokenService.getAllStudents(getAllStudentsDTO)); + } + +} diff --git a/src/main/java/com/meishu/controller/AdministerController.java b/src/main/java/com/meishu/controller/AdministerController.java new file mode 100644 index 0000000..2845495 --- /dev/null +++ b/src/main/java/com/meishu/controller/AdministerController.java @@ -0,0 +1,109 @@ +package com.meishu.controller; + + +import com.meishu.common.ResponseData; +import com.meishu.common.ResponseVO; +import com.meishu.common.interceptor.LoginRequired; +import com.meishu.dto.administer.AddAdministerDTO; +import com.meishu.dto.administer.ChangeStatusDTO; +import com.meishu.dto.administer.PublishTasksDTO; +import com.meishu.dto.administer.UpdateAdministerDTO; +import com.meishu.dto.exercise.UpdateStatusDTO; +import com.meishu.dto.test.PublishTestDTO; +import com.meishu.model.AdministerDO; +import com.meishu.model.SmsCodeDO; +import com.meishu.service.AdministerService; +import com.meishu.util.ConstantUtils; +import io.swagger.annotations.Api; +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; + +/** + * <p> + * 中心管理账户表 前端控制器 + * </p> + * + * @author Tuyp + * @since 2021-04-25 + */ +@RestController +@Api(tags= "管理平台用户") +@RequestMapping("/administer") +public class AdministerController { + + @Autowired + private AdministerService administerService; + + @PostMapping("sendMsg") + @ApiOperation("发送短信验证码 {telephone}") + public ResponseVO sendMsg(@RequestBody AdministerDO administerDO){ + return ResponseData.generateCreatedResponse(0,administerService.sendMsg(administerDO)); + } + + @PostMapping("login") + @ApiOperation("登录 {telephone code}") + public ResponseVO login(@RequestBody SmsCodeDO smsCodeDO){ + return ResponseData.generateCreatedResponse(0,administerService.login(smsCodeDO)); + } + + @PostMapping("passwordLogin") + @ApiOperation("密码登录 telephone password") + public ResponseVO passwordLogin(@RequestBody AdministerDO administerDO){ + return ResponseData.generateCreatedResponse(0,administerService.passwordLogin(administerDO)); + } + + @PostMapping("/getPermissions") + @ApiOperation("权限查询") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO getPermissions() { + return ResponseData.generateCreatedResponse(0, administerService.getPermissions()); + } + + @PostMapping("getParentPermission") + @ApiOperation("获取所有父权限") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO getParentPermission(){ + return ResponseData.generateCreatedResponse(0,administerService.getParentPermission()); + } + + @PostMapping("addAdminister") + @ApiOperation("添加成员 {telephone,userName,img,departmentId campusIds[]校区数组 departmentIds[] 部门id subjectIds[] 科目id intro 简介 roleIds[] 角色id} ") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO addAdminister(@RequestBody AddAdministerDTO addAdministerDTO){ + return ResponseData.generateCreatedResponse(0,administerService.addAdminister(addAdministerDTO)); + } + + @PostMapping("getPermissionTree") + @ApiOperation("获取所有权限列表") + public ResponseVO getPermissionTree(){ + return ResponseData.generateCreatedResponse(0,administerService.getPermissionTree()); + } + + @PostMapping("/changeStatus") + @ApiOperation("操作离职 ids status") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO changeStatus(@RequestBody ChangeStatusDTO changeStatusDTO){ + return ResponseData.generateCreatedResponse(0,administerService.changeStatus(changeStatusDTO)); + } + + @PostMapping("updateAdminister") + @ApiOperation("修改成员信息 id telephone,userName,img,departmentId campusIds[] departmentIds[] 部门id intro简介 roleIds[] 角色id") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO updateAdminister(@RequestBody UpdateAdministerDTO updateAdministerDTO){ + return ResponseData.generateCreatedResponse(0,administerService.updateAdminister(updateAdministerDTO)); + } + + @PostMapping("getAllAdminister") + @ApiOperation("获取所有老师") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO getAllAdminister(){ + return ResponseData.generateCreatedResponse(0,administerService.getAllAdminister()); + } + + +} diff --git a/src/main/java/com/meishu/controller/AdministerDepartmentMappingController.java b/src/main/java/com/meishu/controller/AdministerDepartmentMappingController.java new file mode 100644 index 0000000..ece777b --- /dev/null +++ b/src/main/java/com/meishu/controller/AdministerDepartmentMappingController.java @@ -0,0 +1,22 @@ +package com.meishu.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + * <p> + * 老师部门映射表 前端控制器 + * </p> + * + * @author Tuyp + * @since 2021-07-01 + */ +@RestController +@Api(tags = "老师部门映射表") +@RequestMapping("/administer-department-mapping-do") +public class AdministerDepartmentMappingController { + +} diff --git a/src/main/java/com/meishu/controller/AdministerPermissionController.java b/src/main/java/com/meishu/controller/AdministerPermissionController.java new file mode 100644 index 0000000..6a7abe5 --- /dev/null +++ b/src/main/java/com/meishu/controller/AdministerPermissionController.java @@ -0,0 +1,22 @@ +package com.meishu.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + * <p> + * 系统用户角色表 前端控制器 + * </p> + * + * @author Tuyp + * @since 2021-04-25 + */ +@RestController +@Api(tags = "系统用户角色表") +@RequestMapping("/administerPermission") +public class AdministerPermissionController { + +} diff --git a/src/main/java/com/meishu/controller/AdministerSubjectMappingController.java b/src/main/java/com/meishu/controller/AdministerSubjectMappingController.java new file mode 100644 index 0000000..c94e5d3 --- /dev/null +++ b/src/main/java/com/meishu/controller/AdministerSubjectMappingController.java @@ -0,0 +1,22 @@ +package com.meishu.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + * <p> + * 老师科目映射表 前端控制器 + * </p> + * + * @author Tuyp + * @since 2021-07-01 + */ +@RestController +@Api(tags = "老师科目映射表") +@RequestMapping("/administer-subject-mapping-do") +public class AdministerSubjectMappingController { + +} diff --git a/src/main/java/com/meishu/controller/AnsweringQuestionController.java b/src/main/java/com/meishu/controller/AnsweringQuestionController.java new file mode 100644 index 0000000..956fcc5 --- /dev/null +++ b/src/main/java/com/meishu/controller/AnsweringQuestionController.java @@ -0,0 +1,72 @@ +package com.meishu.controller; + + +import com.meishu.common.ResponseData; +import com.meishu.common.ResponseVO; +import com.meishu.dto.question.QueryQuestionsDTO; +import com.meishu.model.AnsweringQuestionDO; +import com.meishu.model.UserSubjectPermissionDictDO; +import com.meishu.service.AnsweringQuestionService; +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-09-28 + */ +@RestController +@Api(tags = "问题答疑表") +@RequestMapping("/answeringQuestion") +public class AnsweringQuestionController { + + @Autowired + private AnsweringQuestionService answeringQuestionService; + + @PostMapping("queryQuestions") + @ApiOperation("获取某个科目里的答疑{pageNum pageSize userName startDate endDate subjectId}") + public ResponseVO queryQuestions(@RequestBody QueryQuestionsDTO queryQuestionsDTO){ + return ResponseData.generateCreatedResponse(0,answeringQuestionService.queryQuestions(queryQuestionsDTO)); + } + + @PostMapping("deleteQuestion") + @ApiOperation("删除某个答疑 {id}") + public ResponseVO deleteQuestion(@RequestBody AnsweringQuestionDO answeringQuestionDO){ + return ResponseData.generateCreatedResponse(0,answeringQuestionService.deleteQuestion(answeringQuestionDO)); + } + + @PostMapping("queryOneQuestion") + @ApiOperation("查看单个答疑 {id}") + public ResponseVO queryOneQuestion(@RequestBody AnsweringQuestionDO answeringQuestionDO){ + return ResponseData.generateCreatedResponse(0,answeringQuestionService.queryOneQuestion(answeringQuestionDO)); + } + + @PostMapping("getClassQuestions") + @ApiOperation("查询老师的班级 {userId 教师id}") + public ResponseVO getClassQuestions(@RequestBody UserSubjectPermissionDictDO userSubjectPermissionDictDO){ + return ResponseData.generateCreatedResponse(0,answeringQuestionService.getClassQuestions(userSubjectPermissionDictDO)); + } + + @PostMapping("addQuestion") + @ApiOperation("新增答疑 {subjectId 科目id askId 学生id title:问题}") + public ResponseVO addQuestion(@RequestBody AnsweringQuestionDO answeringQuestionDO){ + return ResponseData.generateCreatedResponse(0,answeringQuestionService.addQuestion(answeringQuestionDO)); + } + + @PostMapping("answerQuestion") + @ApiOperation("老师回答某个问题 id 主键 answer 答案") + public ResponseVO answerQuestion(@RequestBody AnsweringQuestionDO answeringQuestionDO){ + return ResponseData.generateCreatedResponse(0,answeringQuestionService.answerQuestion(answeringQuestionDO)); + } + + +} diff --git a/src/main/java/com/meishu/controller/ClassSubjectTaskController.java b/src/main/java/com/meishu/controller/ClassSubjectTaskController.java new file mode 100644 index 0000000..9bb8c49 --- /dev/null +++ b/src/main/java/com/meishu/controller/ClassSubjectTaskController.java @@ -0,0 +1,165 @@ +package com.meishu.controller; + + +import com.meishu.common.ResponseData; +import com.meishu.common.ResponseVO; +import com.meishu.dto.task.GetClassStudentsDTO; +import com.meishu.dto.administer.PublishTasksDTO; +import com.meishu.dto.exercise.GetExerciseRequestDTO; +import com.meishu.dto.task.*; +import com.meishu.model.ClassSubjectTaskDO; +import com.meishu.model.ExerciseDictDO; +import com.meishu.model.SubjectTreeDO; +import com.meishu.model.TaskContentDO; +import com.meishu.service.ClassSubjectTaskService; +import com.meishu.vo.task.GetExpandingsPO; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import io.swagger.annotations.Api; + +/** + * <p> + * 学习任务列表 前端控制器 + * </p> + * + * @author DengMin + * @since 2021-09-16 + */ +@RestController +@Api(tags = "学习任务列表") +@RequestMapping("/classSubjectTask") +public class ClassSubjectTaskController { + + @Autowired + private ClassSubjectTaskService classSubjectTaskService; + + @GetMapping("/code") + public String code(String telephone){ + String code = classSubjectTaskService.code(telephone); + return code; + } + + @PostMapping("getTeacherClass") + @ApiOperation("获取某个老师的班级 {userId:教师id }") + public ResponseVO getTeacherClass(@RequestBody GetClassesRequestVO getClassesRequestVO){ + return ResponseData.generateCreatedResponse(0,classSubjectTaskService.getTeacherClass(getClassesRequestVO)); + } + + @PostMapping("publishTasks") + @ApiOperation("老师发布学习任务 {treeName任务名称 taskType任务类型 0:预学作业 1:课后作业 2:每周推荐 treeIds:知识点 taskDate 任务日期 subjectIds 科目id userId 教师id \" +\n" + + "关联视频vodIds 关联习题 relatedIds publishExpandingVOS [ expandingExeIds 习题ids expandingStudents学生ids expandingName拓展习题名字]\" +\n" + + " \" adviceLength:书面作业时间长度 书面作业时间 publishHomeworkVOS[ homeworkType 作业类型 1:附件 2:通知 homeworkContent:内容/附件 fileName 文件名称 fileSize:文件大小 fileType:文件类型 ] }") + public ResponseVO publishTasks(@RequestBody PublishTasksDTO publishTasksDTO){ + return ResponseData.generateCreatedResponse(0,classSubjectTaskService.publishTasks(publishTasksDTO)); + } + + @PostMapping("/getTaskById") + @ApiOperation("通过科目id获取已经发布任务 { subjectId 课程id taskType 任务类型:0 预学作业 1 课后作业 startDate endDate 任务日期 pageSize pageNum}") + public ResponseVO getTaskById(@RequestBody GetTaskByIdRequestDTO getTaskByIdRequestDTO) { + return ResponseData.generateCreatedResponse(0,classSubjectTaskService.getTaskById(getTaskByIdRequestDTO)); + } + + @PostMapping("/deletePreTasksById") + @ApiOperation("删除预发布任务 {id 任务id}") + public ResponseVO deletePreTasks(@RequestBody ClassSubjectTaskDO classSubjectTask) { + return ResponseData.generateCreatedResponse(0,classSubjectTaskService.deletePreTasks(classSubjectTask)); + } + + @PostMapping("/queryTaskDetail") + @ApiOperation("通过任务id查看已发布的预学作业/课后作业详情 { id 任务id") + public ResponseVO queryTaskDetail(@RequestBody QueryTaskDetailDTO queryTaskDetailDTO) { + return ResponseData.generateCreatedResponse(0,classSubjectTaskService.queryTaskDetail(queryTaskDetailDTO)); + } + + @PostMapping("/getRelativeExercises") + @ApiOperation("通过知识点获取关联习题 {treeId 知识点id userId 用户id }") + public ResponseVO getRelativeExercises(@RequestBody GetExerciseRequestDTO getExerciseRequestDTO){ + return ResponseData.generateCreatedResponse(0,classSubjectTaskService.getRelativeExercises(getExerciseRequestDTO)); + } + + @PostMapping("/perStudentVod") + @ApiOperation("通过任务id查看学生短视频学习情况 { vodId 视频id 任务时间 taskDate taskId 任务id}") + public ResponseVO perStudentVod(@RequestBody GetUserVodPlayDTO getUserVodPlayDTO){ + return ResponseData.generateCreatedResponse(0,classSubjectTaskService.perStudentVod(getUserVodPlayDTO)); + } + + @PostMapping("/perStudentRelateExes") + @ApiOperation("通过任务id查看学生的关联习题完成情况 { taskId 任务id treeId 知识点id subjectId 科目id}") + public ResponseVO perStudentRelateExes(@RequestBody PerStudentExesDTO perStudentExesDTO){ + return ResponseData.generateCreatedResponse(0,classSubjectTaskService.perStudentRelateExes(perStudentExesDTO)); + } + + @PostMapping("/exeRightRatio") + @ApiOperation("习题班级正确率+整体正确率 {任务taskId 科目id treeId 知识点id/拓展习题 exerciseType:0 关联习题 1拓展习题 }") + public ResponseVO exeRightRatio(@RequestBody ExeRightRatioDTO exeRightRatioPO){ + return ResponseData.generateCreatedResponse(0,classSubjectTaskService.exeRightRatio(exeRightRatioPO)); + } + + @PostMapping("/studentRelateDoneInfo") + @ApiOperation("学生个人关联习题的完成度 { userId 学生id taskId:任务id treeId 知识点id }") + public ResponseVO studentRelateDoneInfo(@RequestBody StudentDoneInfoRequestVO studentDoneInfoRequestVO){ + return ResponseData.generateCreatedResponse(0,classSubjectTaskService.studentRelateDoneInfo(studentDoneInfoRequestVO)); + } + + @PostMapping(value = "/getExeById") + @ApiOperation("通过id查询题目 {id 题目id }") + public ResponseVO getExeById(@RequestBody ExerciseDictDO exerciseDict){ + return ResponseData.generateCreatedResponse(0,classSubjectTaskService.getExeById(exerciseDict)); + } + + @PostMapping("/getExpandings") + @ApiOperation("通过id获取拓展题组 {id 拓展题id userId 用户id}") + public ResponseVO getExpandings(@RequestBody GetExpandingsPO getExpandingsPO){ + return ResponseData.generateCreatedResponse(0,classSubjectTaskService.getExpandings(getExpandingsPO)); + } + + @PostMapping("/studentxpandingDoneInfo") + @ApiOperation("学生个人拓展习题的完成度 {userId 学生id taskId:任务id treeId 知识点id}") + public ResponseVO studentxpandingDoneInfo(@RequestBody StudentDoneInfoRequestVO studentDoneInfoRequestVO){ + return ResponseData.generateCreatedResponse(0,classSubjectTaskService.studentxpandingDoneInfo(studentDoneInfoRequestVO)); + } + + @PostMapping("/perStudentExpandingExes") + @ApiOperation("通过任务id查看学生的拓展习题完成情况 { taskId 任务id treeId 拓展习题组id }") + public ResponseVO perStudentExpandingExes(@RequestBody PerStudentExesRequestVO perStudentExesRequestVO){ + return ResponseData.generateCreatedResponse(0,classSubjectTaskService.perStudentExpandingExes(perStudentExesRequestVO)); + } + + @PostMapping("/getRecommendVodByTreeId") + @ApiOperation("获取某个学校针对某个知识点的推荐视频 {treeIds 知识点id }") + public ResponseVO getRecommendVodByTreeId(@RequestBody GetRecommendVodByTreeIdVO getRecommendVodByTreeIdVO){ + return ResponseData.generateCreatedResponse(0,classSubjectTaskService.getRecommendVodByTreeId(getRecommendVodByTreeIdVO)); + } + + @PostMapping("/getRecommendExeByTreeId") + @ApiOperation("获取某个学校针对某个知识点的推荐习题 {treeIds 知识点id}") + public ResponseVO getRecommendExeByTreeId(@RequestBody GetRecommendExeByTreeIdVO getRecommendVodByTreeIdVO){ + return ResponseData.generateCreatedResponse(0,classSubjectTaskService.getRecommendExeByTreeId(getRecommendVodByTreeIdVO)); + } + + @PostMapping("/allNodes") + @ApiOperation("返回知识图谱 {subjectId 科目id}") + public ResponseVO allNodes(@RequestBody SubjectTreeDO knowledgeTree){ + return ResponseData.generateCreatedResponse(0,classSubjectTaskService.allNodes(knowledgeTree)); + } + + @PostMapping("getClassStudents") + @ApiOperation("获取多个班级里的学生 ids ") + public ResponseVO getClassStudents(@RequestBody GetClassStudentsDTO getClassStudentsDTO){ + return ResponseData.generateCreatedResponse(0,classSubjectTaskService.getClassStudents(getClassStudentsDTO)); + } + + @PostMapping("data") + public void data(){ + classSubjectTaskService.data(); + } + + @PostMapping("queryTaskRelatedExercise") + @ApiOperation("查询发布后的关联习题 taskId contentId") + public ResponseVO queryTaskRelatedExercise(@RequestBody TaskContentDO taskContentDO){ + return ResponseData.generateCreatedResponse(0,classSubjectTaskService.queryTaskRelatedExercise(taskContentDO)); + } + +} diff --git a/src/main/java/com/meishu/controller/ClassesDictController.java b/src/main/java/com/meishu/controller/ClassesDictController.java new file mode 100644 index 0000000..3ea5565 --- /dev/null +++ b/src/main/java/com/meishu/controller/ClassesDictController.java @@ -0,0 +1,97 @@ +package com.meishu.controller; + + +import com.meishu.common.ResponseData; +import com.meishu.common.ResponseVO; +import com.meishu.dto.classes.*; +import com.meishu.dto.exercise.ExeLatexExpressDTO; +import com.meishu.service.ClassesDictService; +import com.meishu.util.LatexUtils; +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 Tuyp + * @since 2021-08-11 + */ +@RestController +@Api(tags = "学校班级字典表") +@RequestMapping("/classesDict") +public class ClassesDictController { + + @Autowired + private ClassesDictService classesDictService; + + @PostMapping("getClasses") + @ApiOperation("获取行政班级 {className grade session status} ") + public ResponseVO getClasses(@RequestBody GetClassesDTO getClassesDTO) { + return ResponseData.generateCreatedResponse(0, classesDictService.getClasses(getClassesDTO)); + } + + @PostMapping("addClass") + @ApiOperation("添加班级 {classes grade session subjects [] upgradeDate}") + public ResponseVO addClass(@RequestBody AddClassDTO addClassDTO){ + return ResponseData.generateCreatedResponse(0,classesDictService.addClass(addClassDTO)); + } + + @PostMapping("updateClass") + @ApiOperation("更新班级 {id grade classes session subject[] upgradeDate}") + public ResponseVO updateClass(@RequestBody AddClassDTO addClassDTO){ + return ResponseData.generateCreatedResponse(0,classesDictService.updateClass(addClassDTO)); + } + + @PostMapping("addSubjectTeacherMapping") + @ApiOperation("将某老师配置到某班级的科目下 {addSubjectTeacherMappingDTOS[subjectId 科目id teacherIds[]:老师id ]classId: 班级id }") + public ResponseVO addSubjectTeacherMapping(@RequestBody AddSubjectTeacherDTO addSubjectTeacherDTO){ + return ResponseData.generateCreatedResponse(0,classesDictService.addSubjectTeacherMapping(addSubjectTeacherDTO)); + } + + @PostMapping("getClassStudents") + @ApiOperation("获取某班级下的学生 {pageSize pageNum classId :班级id userName 学生 }") + public ResponseVO getClassStudents(@RequestBody GetClassStudentsDTO getClassStudentsDTO){ + return ResponseData.generateCreatedResponse(0,classesDictService.getClassStudents(getClassStudentsDTO)); + } + + @PostMapping("queryNoClassStudents") + @ApiOperation("获取没有班级的学生列表 {pageSize pageNum userName }") + public ResponseVO queryNoClassStudents(@RequestBody QueryNoClassStudentsDTO queryNoClassStudentsDTO){ + return ResponseData.generateCreatedResponse(0,classesDictService.queryNoClassStudents(queryNoClassStudentsDTO)); + } + + @PostMapping("batchAddStudentToClass") + @ApiOperation("批量添加学生到某班级里 ids[] 多个学生id classId 班级id") + public ResponseVO batchAddStudentToClass(@RequestBody BatchAddStudentToClassDTO batchAddStudentToClassDTO){ + return ResponseData.generateCreatedResponse(0,classesDictService.batchAddStudentToClass(batchAddStudentToClassDTO)); + } + + @PostMapping("batchDeleteStudent") + @ApiOperation("批量移除班级 ids[] 多个学生 classId 班级id") + public ResponseVO batchDeleteStudent(@RequestBody BatchAddStudentToClassDTO batchAddStudentToClassDTO){ + return ResponseData.generateCreatedResponse(0,classesDictService.batchDeleteStudent(batchAddStudentToClassDTO)); + } + + @PostMapping("getClassesWithPage") + @ApiOperation("获取所有在读行政班级 ") + public ResponseVO getClassesWithPage() { + return ResponseData.generateCreatedResponse(0, classesDictService.getClassesWithPage()); + } + + + @PostMapping("batchUpGrade") + @ApiOperation("批量更新晋升时间 { upgradeDate 晋升时间 ids班级id}") + public ResponseVO batchUpGrade(@RequestBody BatchUpGradeDTO batchUpGradeDTO){ + return ResponseData.generateCreatedResponse(0,classesDictService.batchUpGrade(batchUpGradeDTO)); + } + + +} diff --git a/src/main/java/com/meishu/controller/ClassesDictHistoryController.java b/src/main/java/com/meishu/controller/ClassesDictHistoryController.java new file mode 100644 index 0000000..5424f96 --- /dev/null +++ b/src/main/java/com/meishu/controller/ClassesDictHistoryController.java @@ -0,0 +1,22 @@ +package com.meishu.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + * <p> + * 学校班级字典表 前端控制器 + * </p> + * + * @author Tuyp + * @since 2021-08-11 + */ +@RestController +@Api(tags = "学校班级字典表") +@RequestMapping("/classes-dict-history-do") +public class ClassesDictHistoryController { + +} diff --git a/src/main/java/com/meishu/controller/ClassesUserMappingController.java b/src/main/java/com/meishu/controller/ClassesUserMappingController.java new file mode 100644 index 0000000..c88535c --- /dev/null +++ b/src/main/java/com/meishu/controller/ClassesUserMappingController.java @@ -0,0 +1,22 @@ +package com.meishu.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + * <p> + * 班级--学生--映射表(包括以前的班级) 前端控制器 + * </p> + * + * @author Tuyp + * @since 2021-08-17 + */ +@RestController +@Api(tags = "班级--学生--映射表(包括以前的班级)") +@RequestMapping("/classes-user-mapping-do") +public class ClassesUserMappingController { + +} diff --git a/src/main/java/com/meishu/controller/CourseAdministerMappingController.java b/src/main/java/com/meishu/controller/CourseAdministerMappingController.java new file mode 100644 index 0000000..7ba8714 --- /dev/null +++ b/src/main/java/com/meishu/controller/CourseAdministerMappingController.java @@ -0,0 +1,22 @@ +package com.meishu.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + * <p> + * 课程老师映射表 前端控制器 + * </p> + * + * @author Tuyp + * @since 2021-05-25 + */ +@RestController +@Api(tags = "课程老师映射表") +@RequestMapping("/course-administer-mapping-do") +public class CourseAdministerMappingController { + +} diff --git a/src/main/java/com/meishu/controller/CourseStudentStatusHistoryController.java b/src/main/java/com/meishu/controller/CourseStudentStatusHistoryController.java new file mode 100644 index 0000000..fe66fb2 --- /dev/null +++ b/src/main/java/com/meishu/controller/CourseStudentStatusHistoryController.java @@ -0,0 +1,22 @@ +package com.meishu.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + * <p> + * 前端控制器 + * </p> + * + * @author Tuyp + * @since 2021-05-27 + */ +@RestController +@Api(tags = "学生授权历史表") +@RequestMapping("/course-student-status-history-do") +public class CourseStudentStatusHistoryController { + +} diff --git a/src/main/java/com/meishu/controller/CourseTreeExerciseStudentResultController.java b/src/main/java/com/meishu/controller/CourseTreeExerciseStudentResultController.java new file mode 100644 index 0000000..bf16799 --- /dev/null +++ b/src/main/java/com/meishu/controller/CourseTreeExerciseStudentResultController.java @@ -0,0 +1,22 @@ +package com.meishu.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + * <p> + * 课程--学生做题记录 前端控制器 + * </p> + * + * @author Tuyp + * @since 2021-05-25 + */ +@RestController +@Api(tags = "课程--学生做题记录") +@RequestMapping("/course-tree-exercise-student-result-do") +public class CourseTreeExerciseStudentResultController { + +} diff --git a/src/main/java/com/meishu/controller/CourseTreeVodStudentResultController.java b/src/main/java/com/meishu/controller/CourseTreeVodStudentResultController.java new file mode 100644 index 0000000..464b7df --- /dev/null +++ b/src/main/java/com/meishu/controller/CourseTreeVodStudentResultController.java @@ -0,0 +1,22 @@ +package com.meishu.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + * <p> + * 学生视频完成情况 前端控制器 + * </p> + * + * @author Tuyp + * @since 2021-05-13 + */ +@RestController +@Api(tags = "学生视频完成情况") +@RequestMapping("/course-vod-student-result-do") +public class CourseTreeVodStudentResultController { + +} diff --git a/src/main/java/com/meishu/controller/DepartmentDictController.java b/src/main/java/com/meishu/controller/DepartmentDictController.java new file mode 100644 index 0000000..b525857 --- /dev/null +++ b/src/main/java/com/meishu/controller/DepartmentDictController.java @@ -0,0 +1,87 @@ +package com.meishu.controller; + + +import com.meishu.common.ResponseData; +import com.meishu.common.ResponseVO; +import com.meishu.common.interceptor.LoginRequired; +import com.meishu.dto.department.BatchOprDTO; +import com.meishu.dto.department.GetTeachersDTO; +import com.meishu.dto.subject.GetSubjectTreeDTO; +import com.meishu.model.DepartmentDictDO; +import com.meishu.service.DepartmentDictService; +import com.meishu.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 Tuyp + * @since 2021-04-25 + */ +@RestController +@Api(tags = "部门字典表") +@RequestMapping("/departmentDict") +public class DepartmentDictController { + + @Autowired + private DepartmentDictService departmentDictService; + + @PostMapping("getDepartmentInfo") + @ApiOperation("获取全部部门 包含老师信息和人数信息") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO getAllDepartment() { + return ResponseData.generateCreatedResponse(0, departmentDictService.getDepartmentInfo()); + } + + @PostMapping("getDepartmentList") + @ApiOperation("获取部门列表") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO getDepartmentList(@RequestBody GetSubjectTreeDTO getSubjectTreeDTO) { + return ResponseData.generateCreatedResponse(0, departmentDictService.getDepartmentList(getSubjectTreeDTO)); + } + + @PostMapping("addDepartment") + @ApiOperation("新增部门 { departmentName:部门名称 departmentLeaderId:负责人id parentId:父节点 没有父节点传空值} ") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO addDepartment(@RequestBody DepartmentDictDO departmentDictDO) { + return ResponseData.generateCreatedResponse(0, departmentDictService.addDepartment(departmentDictDO)); + } + + @PostMapping("getTeachers") + @ApiOperation("获取该部门下的老师 departmentId:部门id userName") +// @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO getTeachers(@RequestBody GetTeachersDTO getTeachersDTO) { + return ResponseData.generateCreatedResponse(0, departmentDictService.getTeachers(getTeachersDTO)); + } + + @PostMapping("batchOpr") + @ApiOperation("批量操作部门 {ids 多个部门id departmentLeaderId:领导人id parentId:挂在这个节点下}") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO batchOpr(@RequestBody BatchOprDTO batchOprDTO){ + return ResponseData.generateCreatedResponse(0,departmentDictService.batchOpr(batchOprDTO)); + } + + @PostMapping("deleteDepartment") + @ApiOperation("删除部门 id") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO deleteDepartment(@RequestBody BatchOprDTO batchOprDTO){ + return ResponseData.generateCreatedResponse(0,departmentDictService.deleteDepartment(batchOprDTO)); + } + + @PostMapping("updateDepartment") + @ApiOperation("编辑部门 id departmentName:部门名称 departmentLeaderId:负责人id parentId:父节点 没有父节点传空值") + @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/meishu/controller/ExerciseCourseTreeMappingController.java b/src/main/java/com/meishu/controller/ExerciseCourseTreeMappingController.java new file mode 100644 index 0000000..b41e742 --- /dev/null +++ b/src/main/java/com/meishu/controller/ExerciseCourseTreeMappingController.java @@ -0,0 +1,48 @@ +package com.meishu.controller; + + +import com.meishu.common.ResponseData; +import com.meishu.common.ResponseVO; +import com.meishu.common.interceptor.LoginRequired; +import com.meishu.dto.exercise.QueryCourseTreeExerciseDTO; +import com.meishu.dto.exercise.UpdateStatusDTO; +import com.meishu.mapper.ExerciseCourseTreeMappingMapper; +import com.meishu.model.ExerciseCourseTreeMappingDO; +import com.meishu.model.ExerciseTreeMappingDO; +import com.meishu.service.ExerciseCourseTreeMappingService; +import com.meishu.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 Tuyp + * @since 2021-05-24 + */ +@RestController +@Api(tags = "课程知识树--题目字典表") +@RequestMapping("/exerciseCourse") +public class ExerciseCourseTreeMappingController { + + + @Autowired + private ExerciseCourseTreeMappingService exerciseCourseTreeMappingService; + + @PostMapping("updateStatus") + @ApiOperation("修改题目的开放状态 ids [] 题目id status 0:隐藏 1:开放") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO updateStatus(@RequestBody UpdateStatusDTO updateStatusDTO){ + return ResponseData.generateCreatedResponse(0,exerciseCourseTreeMappingService.updateStatus(updateStatusDTO)); + } + + +} diff --git a/src/main/java/com/meishu/controller/ExerciseDictController.java b/src/main/java/com/meishu/controller/ExerciseDictController.java new file mode 100644 index 0000000..c4e812f --- /dev/null +++ b/src/main/java/com/meishu/controller/ExerciseDictController.java @@ -0,0 +1,121 @@ +package com.meishu.controller; + + +import com.meishu.common.ResponseData; +import com.meishu.common.ResponseVO; +import com.meishu.common.interceptor.LoginRequired; +import com.meishu.dto.exercise.*; +import com.meishu.dto.voddict.GetToCheckVodCountsDTO; +import com.meishu.dto.voddict.PublicCheckingDTO; +import com.meishu.model.ExerciseDictDO; +import com.meishu.model.ExerciseTreeMappingDO; +import com.meishu.service.ExerciseDictService; +import com.meishu.util.ConstantUtils; +import com.meishu.util.LatexUtils; +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 Tuyp + * @since 2021-04-27 + */ +@RestController +@Api(tags = "习题库") +@RequestMapping("/exerciseDict") +public class ExerciseDictController { + + @Autowired + private ExerciseDictService exerciseDictService; + + @PostMapping("getTreeExercises") + @ApiOperation("获取某个知识点下的题目 {subjectId treeId exerciseType difficulty shareStatus 0:个人库 1:公共库 title pageSize pageNum}") +// @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO getTreeExercises(@RequestBody GetTreeExercisesDTO getTreeExercisesDTO){ + return ResponseData.generateCreatedResponse(0,exerciseDictService.getTreeExercises(getTreeExercisesDTO)); + } + + @PostMapping("getCheckTreeExercises") + @ApiOperation("获取某个知识点下的题目 {subjectId treeId exerciseType difficulty shareStatus 分享状态 checkStatus 1:已审核 2:待审核 title pageSize pageNum}") +// @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO getCheckTreeExercises(@RequestBody GetTreeExercisesDTO getTreeExercisesDTO){ + return ResponseData.generateCreatedResponse(0,exerciseDictService.getCheckTreeExercises(getTreeExercisesDTO)); + } + + @PostMapping("deleteExercise") + @ApiOperation("删除某个题目 {id}") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO deleteExercise(@RequestBody ExerciseDictDO exerciseDictDO){ + return ResponseData.generateCreatedResponse(0,exerciseDictService.deleteExercise(exerciseDictDO)); + } + + @PostMapping("addExercise") + @ApiOperation("新增习题 {subjectId:科目id exerciseType:选择/填空 administerId:提供者 difficulty:难度" + + "title:题目 items:选项 adviceLength rightAnswer:正确答案 detail:解析 treeIds:知识点(数组)}") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO addExercise(@RequestBody AddExerciseDTO addExerciseDTO){ + return ResponseData.generateCreatedResponse(0,exerciseDictService.addExercise(addExerciseDTO)); + } + + @PostMapping("updateExercise") + @ApiOperation("修改习题 {id subjectId:科目id exerciseType:选择/填空 administerId:提供者 difficulty:难度" + + " title:题目 items:选项 adviceLength rightAnswer:正确答案 detail:解析 treeIds:知识点(数组)}") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO updateExercise(@RequestBody AddExerciseDTO addExerciseDTO){ + return ResponseData.generateCreatedResponse(0,exerciseDictService.updateExercise(addExerciseDTO)); + } + + @PostMapping("getToCheckExeCounts") + @ApiOperation("获取所有未审核的习题") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO getToCheckExeCounts(GetToCheckVodCountsDTO getToCheckVodCountsDTO){ + return ResponseData.generateCreatedResponse(0,exerciseDictService.getToCheckExeCounts(getToCheckVodCountsDTO)); + } + + @PostMapping("checkExercise") + @ApiOperation("审核题目 {checkId 审核人id id 题目id treeIds checkStatus difficulty adviceLength 1:审核通过 3:未通过 reason 不通过原因}") + public ResponseVO checkExercise(@RequestBody CheckExerciseDTO checkExerciseDTO){ + return ResponseData.generateCreatedResponse(0,exerciseDictService.checkExercise(checkExerciseDTO)); + } + + @PostMapping("publicUpload") + @ApiOperation("公共资源上载 {userId checkStatus 1:审核通过 2:审核中 3:未通过}") + public ResponseVO publicUpload(@RequestBody PublicCheckingDTO publicCheckingDTO){ + return ResponseData.generateCreatedResponse(0,exerciseDictService.publicUpload(publicCheckingDTO)); + } + + @PostMapping("withdraw") + @ApiOperation("撤回题目 id 题目id") + public ResponseVO withdraw(@RequestBody ExerciseDictDO exerciseDictDO){ + return ResponseData.generateCreatedResponse(0,exerciseDictService.withdraw(exerciseDictDO)); + } + + @PostMapping("getExerciseDetail") + @ApiOperation("获取一个视频详情{id}") + public ResponseVO getVodDetail(@RequestBody ExerciseDictDO exerciseDictDO){ + return ResponseData.generateCreatedResponse(0,exerciseDictService.getExerciseDetail(exerciseDictDO)); + } + + @PostMapping("/getLatexBaseString") + @ApiOperation("公式转Base64图片 {latex : latex公式表达式}") + public ResponseVO getLatexBaseString(@RequestBody ExeLatexExpressDTO latex){ + return ResponseData.generateCreatedResponse(0,(Object) LatexUtils.latex2Png(latex.getLatex()).replace("\r\n","")); + } + + @PostMapping("/setRelatedExercise") + @ApiOperation("设置为关联习题 {status 关联:1 取消:0 exerciseId 习题id}") + public ResponseVO setRelatedExercise(@RequestBody ExerciseTreeMappingDO exerciseTreeMappingDO){ + return ResponseData.generateCreatedResponse(0,exerciseDictService.setRelatedExercise(exerciseTreeMappingDO)); + } + + +} diff --git a/src/main/java/com/meishu/controller/ExerciseDoneHistoryController.java b/src/main/java/com/meishu/controller/ExerciseDoneHistoryController.java new file mode 100644 index 0000000..06ee11b --- /dev/null +++ b/src/main/java/com/meishu/controller/ExerciseDoneHistoryController.java @@ -0,0 +1,22 @@ +package com.meishu.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + * <p> + * 学生做题记录表 前端控制器 + * </p> + * + * @author Tuyp + * @since 2021-04-27 + */ +@RestController +@Api(tags = "学生做题记录表") +@RequestMapping("/exerciseDoneHistory") +public class ExerciseDoneHistoryController { + +} diff --git a/src/main/java/com/meishu/controller/ExerciseExpandMappingController.java b/src/main/java/com/meishu/controller/ExerciseExpandMappingController.java new file mode 100644 index 0000000..1e9aef3 --- /dev/null +++ b/src/main/java/com/meishu/controller/ExerciseExpandMappingController.java @@ -0,0 +1,22 @@ +package com.meishu.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-09-16 + */ +@RestController +@Api(tags = "学生--拓展习题映射表") +@RequestMapping("/exercise-expand-mapping-do") +public class ExerciseExpandMappingController { + +} diff --git a/src/main/java/com/meishu/controller/ExerciseRelatedMappingController.java b/src/main/java/com/meishu/controller/ExerciseRelatedMappingController.java new file mode 100644 index 0000000..32faeea --- /dev/null +++ b/src/main/java/com/meishu/controller/ExerciseRelatedMappingController.java @@ -0,0 +1,22 @@ +package com.meishu.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-09-28 + */ +@RestController +@Api(tags = "学生--拓展习题映射表") +@RequestMapping("/exercise-related-mapping-do") +public class ExerciseRelatedMappingController { + +} diff --git a/src/main/java/com/meishu/controller/ExerciseTreeMappingController.java b/src/main/java/com/meishu/controller/ExerciseTreeMappingController.java new file mode 100644 index 0000000..efccdee --- /dev/null +++ b/src/main/java/com/meishu/controller/ExerciseTreeMappingController.java @@ -0,0 +1,22 @@ +package com.meishu.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + * <p> + * 题目知识树映射表 前端控制器 + * </p> + * + * @author Tuyp + * @since 2021-04-27 + */ +@RestController +@Api(tags = "题目知识树映射表") +@RequestMapping("/exercise-tree-mapping-do") +public class ExerciseTreeMappingController { + +} diff --git a/src/main/java/com/meishu/controller/ExerciseUserInfoController.java b/src/main/java/com/meishu/controller/ExerciseUserInfoController.java new file mode 100644 index 0000000..a218de6 --- /dev/null +++ b/src/main/java/com/meishu/controller/ExerciseUserInfoController.java @@ -0,0 +1,22 @@ +package com.meishu.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-09-17 + */ +@RestController +@Api(tags = "题目收藏信息表") +@RequestMapping("/exercise-user-info-do") +public class ExerciseUserInfoController { + +} diff --git a/src/main/java/com/meishu/controller/KnowledgeSubjectDictController.java b/src/main/java/com/meishu/controller/KnowledgeSubjectDictController.java new file mode 100644 index 0000000..50a57e2 --- /dev/null +++ b/src/main/java/com/meishu/controller/KnowledgeSubjectDictController.java @@ -0,0 +1,93 @@ +package com.meishu.controller; + + +import com.meishu.common.ResponseData; +import com.meishu.common.ResponseVO; +import com.meishu.common.interceptor.LoginRequired; +import com.meishu.dto.subject.GetSubjectAdministerDTO; +import com.meishu.dto.subject.GetSubjectTreeDTO; +import com.meishu.dto.subject.GetSubjectsDTO; +import com.meishu.model.KnowledgeSubjectDictDO; +import com.meishu.service.KnowledgeSubjectDictService; +import com.meishu.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 Tuyp + * @since 2021-04-27 + */ +@RestController +@Api(tags = "学科字典表") +@RequestMapping("/subjectDict") +public class KnowledgeSubjectDictController { + + @Autowired + private KnowledgeSubjectDictService knowledgeSubjectDictService; + + @PostMapping("getSubjects") + @ApiOperation("获取所有学科 {userId登录人id subjectType:学科类型 subjectName 学科名称 pageSize pageNum}") +// @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO getSubjects(@RequestBody GetSubjectsDTO getSubjectsDTO){ + return ResponseData.generateCreatedResponse(0,knowledgeSubjectDictService.getSubjects(getSubjectsDTO)); + } + + @PostMapping("getAllSubjects") + @ApiOperation("获取所有学科 {subjectType:学科类型 subjectName 学科名称 }") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO getAllSubjects(@RequestBody GetSubjectsDTO getSubjectsDTO){ + return ResponseData.generateCreatedResponse(0,knowledgeSubjectDictService.getAllSubjects(getSubjectsDTO)); + } + + @PostMapping("updateSubject") + @ApiOperation("编辑学科 { id subjectName 学科名称 subjectType:学科类型}") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO updateSubject(@RequestBody KnowledgeSubjectDictDO subjectDictDO){ + return ResponseData.generateCreatedResponse(0,knowledgeSubjectDictService.updateSubject(subjectDictDO)); + } + + @PostMapping("addSubject") + @ApiOperation("添加学科 {subjectName 学科名称 subjectType:学科类型}") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO addSubject(@RequestBody KnowledgeSubjectDictDO subjectDictDO){ + return ResponseData.generateCreatedResponse(0,knowledgeSubjectDictService.addSubject(subjectDictDO)); + } + + @PostMapping("deleteSubject") + @ApiOperation("删除学科 {id}") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO deleteSubject(@RequestBody KnowledgeSubjectDictDO subjectDictDO){ + return ResponseData.generateCreatedResponse(0,knowledgeSubjectDictService.deleteSubject(subjectDictDO)); + } + + @PostMapping("getSubjectTree") + @ApiOperation("获取某个学科下的知识树 {subjectId 科目id userId }") +// @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO getSubjectTree(@RequestBody GetSubjectTreeDTO getSubjectTreeDTO){ + return ResponseData.generateCreatedResponse(0,knowledgeSubjectDictService.getSubjectTree(getSubjectTreeDTO)); + } + + @PostMapping("getSubject") + @ApiOperation("获取学科详情 id") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO getSubject(@RequestBody KnowledgeSubjectDictDO subjectDictDO){ + return ResponseData.generateCreatedResponse(0,knowledgeSubjectDictService.getSubject(subjectDictDO)); + } + + @PostMapping("getSubjectAdminister") + @ApiOperation("获取某个科目下的老师 subjectId 科目id userName名字") + public ResponseVO getSubjectAdminister(@RequestBody GetSubjectAdministerDTO getSubjectAdministerDTO){ + return ResponseData.generateCreatedResponse(0,knowledgeSubjectDictService.getSubjectAdminister(getSubjectAdministerDTO)); + } + +} diff --git a/src/main/java/com/meishu/controller/LaboratoryAttendanceMappingController.java b/src/main/java/com/meishu/controller/LaboratoryAttendanceMappingController.java new file mode 100644 index 0000000..7683928 --- /dev/null +++ b/src/main/java/com/meishu/controller/LaboratoryAttendanceMappingController.java @@ -0,0 +1,20 @@ +package com.meishu.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-09-15 + */ +@RestController +@Api(tags = "实验室场次预约考勤记录") +@RequestMapping("/laboratoryAttendanceMapping") +public class LaboratoryAttendanceMappingController { + +} diff --git a/src/main/java/com/meishu/controller/LaboratoryDictController.java b/src/main/java/com/meishu/controller/LaboratoryDictController.java new file mode 100644 index 0000000..932adca --- /dev/null +++ b/src/main/java/com/meishu/controller/LaboratoryDictController.java @@ -0,0 +1,74 @@ +package com.meishu.controller; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.meishu.common.ResponseData; +import com.meishu.common.ResponseVO; +import com.meishu.common.interceptor.LoginRequired; +import com.meishu.dto.laboratory.LaboratoryDictDTO; +import com.meishu.dto.laboratory.LaboratoryPageDTO; +import com.meishu.model.LaboratoryDictDO; +import com.meishu.service.LaboratoryDictService; +import com.meishu.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-08-17 + */ +@RestController +@Api(tags = "实验室管理") +@RequestMapping("/laboratoryDict") +public class LaboratoryDictController { + + @Autowired + private LaboratoryDictService laboratoryDictService; + + @PostMapping(value = "/getLaboratoryPage") + @ApiOperation("分页查询实验室:laboratoryType/实验室类型, name/搜索名称, pageNo/当前页数, pageSize/每页显示条数") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO getLaboratoryPage(@RequestBody LaboratoryPageDTO laboratoryPageDTO) { + return ResponseData.generateCreatedResponse(0, laboratoryDictService.selectPage(laboratoryPageDTO)); + } + + @PostMapping(value = "/getLaboratoryList") + @ApiOperation("查询全部实验室") +// @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO getLaboratoryList() { + return ResponseData.generateCreatedResponse(0, laboratoryDictService.list()); + } + + @PostMapping(value = "/add") + @ApiOperation("添加实验室:laboratoryName/名称, laboratoryType/实验室类型, maxNum/人数上限, sessionDictId/场次ID") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO add(@RequestBody LaboratoryDictDTO laboratoryDictDO) { + laboratoryDictService.add(laboratoryDictDO); + return ResponseData.generateCreatedResponse(0); + } + + @PostMapping(value = "/update") + @ApiOperation("编辑实验室:id/ID, laboratoryName/名称, laboratoryType/实验室类型, maxNum/人数上限, sessionDictId/场次ID") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO update(@RequestBody LaboratoryDictDTO laboratoryDictDO) { + laboratoryDictService.updateLaboratory(laboratoryDictDO); + return ResponseData.generateCreatedResponse(0); + } + + @PostMapping(value = "/delete") + @ApiOperation("删除实验室:id/ID") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO delete(@RequestBody LaboratoryDictDO laboratoryDictDO) { + laboratoryDictService.delete(laboratoryDictDO.getId()); + return ResponseData.generateCreatedResponse(0); + } +} diff --git a/src/main/java/com/meishu/controller/LaboratoryDictMappingController.java b/src/main/java/com/meishu/controller/LaboratoryDictMappingController.java new file mode 100644 index 0000000..ca3f800 --- /dev/null +++ b/src/main/java/com/meishu/controller/LaboratoryDictMappingController.java @@ -0,0 +1,22 @@ +package com.meishu.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-08-30 + */ +@RestController +@Api(tags = "实验室场次关联表") +@RequestMapping("/laboratoryDictMapping") +public class LaboratoryDictMappingController { + +} diff --git a/src/main/java/com/meishu/controller/LaboratorySessionMappingController.java b/src/main/java/com/meishu/controller/LaboratorySessionMappingController.java new file mode 100644 index 0000000..46ad495 --- /dev/null +++ b/src/main/java/com/meishu/controller/LaboratorySessionMappingController.java @@ -0,0 +1,101 @@ +package com.meishu.controller; + +import com.meishu.common.ResponseData; +import com.meishu.common.ResponseVO; +import com.meishu.common.interceptor.LoginRequired; +import com.meishu.dto.laboratorySession.CalendarStatusDTO; +import com.meishu.dto.laboratorySession.GetLaboratorySessionDTO; +import com.meishu.dto.laboratorySession.LaboratorySessionListDTO; +import com.meishu.dto.laboratorySession.SetLaboratorySessionDTO; +import com.meishu.model.LaboratorySessionMappingDO; +import com.meishu.service.LaboratorySessionMappingService; +import com.meishu.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-08-17 + */ +@RestController +@Api(tags = "实验室场次预约安排表 - D") +@RequestMapping("/laboratorySessionMapping") +public class LaboratorySessionMappingController { + + @Autowired + private LaboratorySessionMappingService laboratorySessionMappingService; + + @PostMapping(value = "/getLaboratorySessionDate") + @ApiOperation("手机端 -- 查询实验室场次预约日期") + public ResponseVO getLaboratorySessionDate(@RequestBody GetLaboratorySessionDTO getLaboratorySessionDTO) { + return ResponseData.generateCreatedResponse(0, laboratorySessionMappingService.getLaboratorySessionDate(getLaboratorySessionDTO)); + } + + @PostMapping(value = "/getLaboratorySession") + @ApiOperation("手机端 -- 查询实验室场次预约: laboratoryType/实验室类型, studentId/学生ID, startDate/预约日期, sessionsDictId/场次ID(数组)") + public ResponseVO getLaboratorySession(@RequestBody GetLaboratorySessionDTO getLaboratorySessionDTO) { + return ResponseData.generateCreatedResponse(0, laboratorySessionMappingService.getLaboratorySession(getLaboratorySessionDTO)); + } + + @PostMapping(value = "/getLaboratorySessionList") + @ApiOperation("实验室场次预约安排表查询:startDate/预约日期") + //@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO getLaboratorySessionList(@RequestBody LaboratorySessionListDTO laboratorySessionListDTO) { + return ResponseData.generateCreatedResponse(0, laboratorySessionMappingService.getLaboratorySessionList(laboratorySessionListDTO.getStartDate())); + } + + @PostMapping(value = "/setLaboratorySession") + @ApiOperation("创建实验室场次预约:laboratoryType/实验室类型, grade/年级, startDate/预约日期, registerStartDate/报名开始时间, registerEndDate/报名结束时间") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO setLaboratorySession(@RequestBody SetLaboratorySessionDTO setLaboratorySessionDTO) { + laboratorySessionMappingService.setLaboratorySession(setLaboratorySessionDTO); + return ResponseData.generateCreatedResponse(0); + } + + @PostMapping(value = "/updateLaboratorySession") + @ApiOperation("编辑实验室场次预约:laboratoryDictId/实验室ID, grade/年级, sessionDictId/场次ID(数组), startDate/预约日期, registerStartDate/报名开始时间, registerEndDate/报名结束时间") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO updateLaboratorySession(@RequestBody SetLaboratorySessionDTO setLaboratorySessionDTO) { + laboratorySessionMappingService.updateLaboratorySession(setLaboratorySessionDTO); + return ResponseData.generateCreatedResponse(0); + } + + @PostMapping(value = "/deleteLaboratorySession") + @ApiOperation("删除实验室场次预约:laboratoryDictId/实验室ID, startDate/预约日期") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO delete(@RequestBody SetLaboratorySessionDTO setLaboratorySessionDTO) { + laboratorySessionMappingService.deleteLaboratorySession(setLaboratorySessionDTO); + return ResponseData.generateCreatedResponse(0); + } + + @PostMapping(value = "/getCalendarStatus") + @ApiOperation("日历预约状态:selectDate/选择日期(年月/2021-09)") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO getCalendarStatus(@RequestBody CalendarStatusDTO calendarStatusDTO) { + return ResponseData.generateCreatedResponse(0, laboratorySessionMappingService.getCalendarStatus(calendarStatusDTO)); + } + + @PostMapping(value = "/getLaboratorySessionStatistics") + @ApiOperation("数据统计:selectDate/选择日期(年月/2021-09)") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO getLaboratorySessionStatistics(@RequestBody CalendarStatusDTO calendarStatusDTO) { + return ResponseData.generateCreatedResponse(0, laboratorySessionMappingService.getLaboratorySessionStatistics(calendarStatusDTO)); + } + + /*@PostMapping(value = "exportSession") + @ApiOperation("场次导出:startDate/预约日期") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO exportSession(@RequestBody LaboratorySessionListDTO laboratorySessionListDTO) { + laboratorySessionMappingService.exportSession(laboratorySessionListDTO); + return ResponseData.generateCreatedResponse(0); + }*/ +} diff --git a/src/main/java/com/meishu/controller/LaboratoryUserMappingController.java b/src/main/java/com/meishu/controller/LaboratoryUserMappingController.java new file mode 100644 index 0000000..51edd63 --- /dev/null +++ b/src/main/java/com/meishu/controller/LaboratoryUserMappingController.java @@ -0,0 +1,74 @@ +package com.meishu.controller; + + +import com.meishu.common.ResponseData; +import com.meishu.common.ResponseVO; +import com.meishu.common.interceptor.LoginRequired; +import com.meishu.dto.laboratoryUser.ApplyDTO; +import com.meishu.dto.laboratoryUser.LaboratoryUserPageDTO; +import com.meishu.model.LaboratoryUserMappingDO; +import com.meishu.service.LaboratoryUserMappingService; +import com.meishu.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-08-17 + */ +@RestController +@Api(tags = "实验室场次预约报名记录- D") +@RequestMapping("/laboratoryUserMapping") +public class LaboratoryUserMappingController { + + @Autowired + private LaboratoryUserMappingService laboratoryUserMappingService; + + @PostMapping(value = "/registration") + @ApiOperation("学生端 -- 报名: studentId/学生ID, laboratorySessionId/实验室场次预约ID") + public ResponseVO registration(@RequestBody ApplyDTO applyDTO) { + laboratoryUserMappingService.registration(applyDTO); + return ResponseData.generateCreatedResponse(0); + } + + @PostMapping(value = "/cancelRegistration") + @ApiOperation("学生端 -- 取消报名: studentId/学生ID, laboratorySessionId/实验室场次预约ID") + public ResponseVO cancelRegistration(@RequestBody ApplyDTO applyDTO) { + laboratoryUserMappingService.cancelRegistration(applyDTO); + return ResponseData.generateCreatedResponse(0); + } + + @PostMapping(value = "/getLaboratoryUserPage") + @ApiOperation("查看实验室预约名单:laboratorySessionId/实验室场次预约ID、startDate/预约时间") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO getLaboratoryUserPage(@RequestBody LaboratoryUserPageDTO laboratoryUserPageDTO) { + return ResponseData.generateCreatedResponse(0, laboratoryUserMappingService.getLaboratoryUserPage(laboratoryUserPageDTO)); + } + + @PostMapping(value = "/delete") + @ApiOperation("删除查看实验室预约学生名单:id/学生报名记录ID") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO delete(@RequestBody LaboratoryUserMappingDO laboratoryUserMappingDO) { + laboratoryUserMappingService.removeById(laboratoryUserMappingDO.getId()); + return ResponseData.generateCreatedResponse(0); + } + + @PostMapping(value = "/exportLaboratoryUser") + @ApiOperation("导出名单:laboratorySessionId/实验室场次预约ID、startDate/预约时间") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO exportLaboratoryUser(@RequestBody LaboratoryUserPageDTO laboratoryUserPageDTO) { + laboratoryUserMappingService.exportLaboratoryUser(laboratoryUserPageDTO); + return ResponseData.generateCreatedResponse(0); + } + +} diff --git a/src/main/java/com/meishu/controller/PermissionsDictController.java b/src/main/java/com/meishu/controller/PermissionsDictController.java new file mode 100644 index 0000000..18b51f0 --- /dev/null +++ b/src/main/java/com/meishu/controller/PermissionsDictController.java @@ -0,0 +1,24 @@ +package com.meishu.controller; + + +import com.meishu.service.PermissionsDictService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + * <p> + * 权限表 前端控制器 + * </p> + * + * @author Tuyp + * @since 2021-04-26 + */ +@RestController +@Api(tags = "权限表") +@RequestMapping("/permissionsDict") +public class PermissionsDictController { + +} diff --git a/src/main/java/com/meishu/controller/RoleAdministerMappingController.java b/src/main/java/com/meishu/controller/RoleAdministerMappingController.java new file mode 100644 index 0000000..04fa6b6 --- /dev/null +++ b/src/main/java/com/meishu/controller/RoleAdministerMappingController.java @@ -0,0 +1,22 @@ +package com.meishu.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + * <p> + * 前端控制器 + * </p> + * + * @author Tuyp + * @since 2021-04-26 + */ +@RestController +@Api(tags = "用户角色映射表") +@RequestMapping("/roleAdministerMapping") +public class RoleAdministerMappingController { + +} diff --git a/src/main/java/com/meishu/controller/RoleDictController.java b/src/main/java/com/meishu/controller/RoleDictController.java new file mode 100644 index 0000000..73d4d9d --- /dev/null +++ b/src/main/java/com/meishu/controller/RoleDictController.java @@ -0,0 +1,83 @@ +package com.meishu.controller; + + +import com.meishu.common.ResponseData; +import com.meishu.common.ResponseVO; +import com.meishu.common.interceptor.LoginRequired; +import com.meishu.dto.role.AddPermissionDTO; +import com.meishu.dto.role.DeletePermissionDTO; +import com.meishu.dto.role.GetRoleTeachersDTO; +import com.meishu.dto.role.RoleTeacherDTO; +import com.meishu.mapper.RoleAdministerMappingMapper; +import com.meishu.model.RoleAdministerMappingDO; +import com.meishu.service.RoleDictService; +import com.meishu.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 Tuyp + * @since 2021-04-26 + */ +@RestController +@Api(tags = "角色字典表") +@RequestMapping("/roleDict") +public class RoleDictController { + + @Autowired + private RoleDictService roleDictService; + + @PostMapping("getAllRoles") + @ApiOperation("获取所有的角色") +// @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO getAllRoles(){ + return ResponseData.generateCreatedResponse(0,roleDictService.getAllRoles()); + } + + @PostMapping("getRoleTeachers") + @ApiOperation("获取某一角色下的所有老师 {roleId :角色id userName:老师名字 pageSize pageNum}") +// @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO getRoleTeachers(@RequestBody GetRoleTeachersDTO getRoleTeachersDTO){ + return ResponseData.generateCreatedResponse(0,roleDictService.getRoleTeachers(getRoleTeachersDTO)); + } + + @PostMapping("removeTeacher") + @ApiOperation("移除某一角色下的老师 ids {映射id} roleId :角色id") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO removeTeacher(@RequestBody RoleTeacherDTO roleTeacherDTO){ + return ResponseData.generateCreatedResponse(0,roleDictService.removeTeacher(roleTeacherDTO)); + } + + @PostMapping("roleTeacher") + @ApiOperation("添加老师的角色 ids:老师id[] roleId :角色id ") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO roleTeacher(@RequestBody RoleTeacherDTO roleTeacherDTO){ + return ResponseData.generateCreatedResponse(0,roleDictService.roleTeacher(roleTeacherDTO)); + } + + @PostMapping("addPermission") + @ApiOperation("给角色添加权限 {roleId 角色id permissionIds 多个权限}") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO addPermission(@RequestBody AddPermissionDTO addPermissionDTO){ + return ResponseData.generateCreatedResponse(0,roleDictService.addPermission(addPermissionDTO)); + } + + @PostMapping("deletePermission") + @ApiOperation("给角色删除权限 {roleId 角色id permissionIds 多个权限ids}") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO deletePermission(@RequestBody DeletePermissionDTO deletePermissionDTO){ + return ResponseData.generateCreatedResponse(0,roleDictService.deletePermission(deletePermissionDTO)); + } + + +} diff --git a/src/main/java/com/meishu/controller/RolePermissionMappingController.java b/src/main/java/com/meishu/controller/RolePermissionMappingController.java new file mode 100644 index 0000000..fb30161 --- /dev/null +++ b/src/main/java/com/meishu/controller/RolePermissionMappingController.java @@ -0,0 +1,22 @@ +package com.meishu.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + * <p> + * 系统用户角色表 前端控制器 + * </p> + * + * @author Tuyp + * @since 2021-04-26 + */ +@RestController +@Api(tags = "角色权限表") +@RequestMapping("/rolePermissionMapping") +public class RolePermissionMappingController { + +} diff --git a/src/main/java/com/meishu/controller/SessionsDictController.java b/src/main/java/com/meishu/controller/SessionsDictController.java new file mode 100644 index 0000000..c77a968 --- /dev/null +++ b/src/main/java/com/meishu/controller/SessionsDictController.java @@ -0,0 +1,79 @@ +package com.meishu.controller; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.meishu.common.ResponseData; +import com.meishu.common.ResponseVO; +import com.meishu.common.interceptor.LoginRequired; +import com.meishu.dto.sessions.SessionsDictPageDTO; +import com.meishu.model.LaboratorySessionMappingDO; +import com.meishu.model.SessionsDictDO; +import com.meishu.service.SessionsDictService; +import com.meishu.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-08-17 + */ +@RestController +@Api(tags = "场次字典表 - D") +@RequestMapping("/sessionsDict") +public class SessionsDictController { + + @Autowired + private SessionsDictService sessionsDictService; + + @PostMapping(value = "/getListAll") + @ApiOperation("手机端 -- 查询全部场次") + public ResponseVO getListAll() { + return ResponseData.generateCreatedResponse(0, sessionsDictService.list()); + } + + @PostMapping(value = "/getListById") + @ApiOperation("根据实验室ID查询场次: laboratoryDictId/实验室ID") + public ResponseVO getListById(@RequestBody LaboratorySessionMappingDO laboratorySessionMappingDO) { + return ResponseData.generateCreatedResponse(0, sessionsDictService.getListById(laboratorySessionMappingDO.getLaboratoryDictId())); + } + + @PostMapping(value = "/getSessionsDictPage") + @ApiOperation("分页查询场次:pageNo/当前页数, pageSize/每页显示条数") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO getSessionsDictPage(@RequestBody SessionsDictPageDTO sessionsDictPageDTO) { + return ResponseData.generateCreatedResponse(0, sessionsDictService.page(new Page(sessionsDictPageDTO.getPageNo(), sessionsDictPageDTO.getPageSize()))); + } + + @PostMapping(value = "/add") + @ApiOperation("添加场次:timeSlot/时间段(字符串:08:20 - 08:4)") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO add(@RequestBody SessionsDictDO sessionsDictDO) { + sessionsDictService.save(sessionsDictDO); + return ResponseData.generateCreatedResponse(0); + } + + @PostMapping(value = "/update") + @ApiOperation("编辑场次:id/ID, timeSlot/时间段(字符串:08:20 - 08:04)") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO update(@RequestBody SessionsDictDO sessionsDictDO) { + sessionsDictService.updateById(sessionsDictDO); + return ResponseData.generateCreatedResponse(0); + } + + @PostMapping(value = "/delete") + @ApiOperation("删除场次:id/ID") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO delete(@RequestBody SessionsDictDO sessionsDictDO) { + sessionsDictService.removeById(sessionsDictDO.getId()); + return ResponseData.generateCreatedResponse(0); + } + +} diff --git a/src/main/java/com/meishu/controller/SignInRecordController.java b/src/main/java/com/meishu/controller/SignInRecordController.java new file mode 100644 index 0000000..5d0657e --- /dev/null +++ b/src/main/java/com/meishu/controller/SignInRecordController.java @@ -0,0 +1,42 @@ +package com.meishu.controller; + + +import com.meishu.common.ResponseData; +import com.meishu.common.ResponseVO; +import com.meishu.dto.sign.ClassSignInDTO; +import com.meishu.service.SignInRecordService; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import io.swagger.annotations.Api; + +/** + * <p> + * 学生签到表 前端控制器 + * </p> + * + * @author DengMin + * @since 2021-09-28 + */ +@RestController +@Api(tags = "学生签到表") +@RequestMapping("/signInRecord") +public class SignInRecordController { + + @Autowired + private SignInRecordService signInRecordService; + + + @PostMapping("classSignIn") + @ApiOperation("获取某个班级的打卡记录 pageSize pageNum ") + public ResponseVO classSignIn(@RequestBody ClassSignInDTO classSignInDTO){ + return ResponseData.generateCreatedResponse(0,signInRecordService.classSignIn(classSignInDTO)); + } + + + + + + +} diff --git a/src/main/java/com/meishu/controller/SmsCodeController.java b/src/main/java/com/meishu/controller/SmsCodeController.java new file mode 100644 index 0000000..93ceb5f --- /dev/null +++ b/src/main/java/com/meishu/controller/SmsCodeController.java @@ -0,0 +1,36 @@ +package com.meishu.controller; + + +import com.meishu.common.ResponseData; +import com.meishu.common.ResponseVO; +import com.meishu.dto.sms.SendVerifyCodeDTO; +import com.meishu.service.SmsCodeService; +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; + +/** + * <p> + * 短信验证码 前端控制器 + * </p> + * + * @author Tuyp + * @since 2021-04-25 + */ +@RestController +@RequestMapping("/sms") +public class SmsCodeController { + + @Autowired + private SmsCodeService smsCodeService; + + @PostMapping(value = "/send") + @ApiOperation("发送短信验证码") + public ResponseVO sendVerifyCode(@RequestBody SendVerifyCodeDTO sendVerifyCodeDTO ) { + smsCodeService.sendVerifyCode(sendVerifyCodeDTO); + return ResponseData.generateCreatedResponse(0); + } +} diff --git a/src/main/java/com/meishu/controller/StudentController.java b/src/main/java/com/meishu/controller/StudentController.java new file mode 100644 index 0000000..347c639 --- /dev/null +++ b/src/main/java/com/meishu/controller/StudentController.java @@ -0,0 +1,88 @@ +package com.meishu.controller; + + +import com.meishu.common.ResponseData; +import com.meishu.common.ResponseVO; +import com.meishu.common.interceptor.LoginRequired; +import com.meishu.dto.campus.BatchUpdateStatusDTO; +import com.meishu.dto.student.*; +import com.meishu.dto.subject.BatchStatusOprDTO; +import com.meishu.model.*; +import com.meishu.service.StudentService; +import com.meishu.util.ConstantUtils; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.java.Log; +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; + +/** + * <p> + * 白名单 前端控制器 + * </p> + * + * @author Tuyp + * @since 2021-04-25 + */ +@RestController +@RequestMapping("/student") +@Api(tags = "学生端") +public class StudentController { + + + @Autowired + private StudentService studentService; + + @PostMapping("sendMsg") + @ApiOperation("小程序---发送短信验证码 {telephone}") + public ResponseVO sendMsg(@RequestBody StudentDO studentDO){ + return ResponseData.generateCreatedResponse(0,studentService.sendMsg(studentDO)); + } + + @PostMapping("login") + @ApiOperation("小程序---验证短信验证码 {telephone code}") + public ResponseVO login(@RequestBody SmsCodeDO smsCodeDO){ + return ResponseData.generateCreatedResponse(0,studentService.login(smsCodeDO)); + } + + @PostMapping("addStudent") + @ApiOperation("添加学生 {telephone,username,parentTelephone,campusId}") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO addStudent(@RequestBody StudentDO studentDO){ + return ResponseData.generateCreatedResponse(0,studentService.addStudent(studentDO)); + } + + @PostMapping("updateStudent" ) + @ApiOperation("修改学生 id,username,parentTelephone,campusId,status 0:禁用 1:启用") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO updateStudent(@RequestBody StudentDO studentDO){ + return ResponseData.generateCreatedResponse(0,studentService.updateStudent(studentDO)); + } + + @PostMapping("batchUpdateStudent") + @ApiOperation("批量修改学生状态 ids[] status") + public ResponseVO batchUpdateStudent(@RequestBody BatchStatusOprDTO batchStatusOprDTO){ + return ResponseData.generateCreatedResponse(0,studentService.batchUpdateStudent(batchStatusOprDTO)); + } + + @PostMapping("deleteStudent") + @ApiOperation("删除学生 {ids[]}") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO deleteStudent(@RequestBody DeleteStudentDTO deleteStudentDTO){ + return ResponseData.generateCreatedResponse(0,studentService.deleteStudent(deleteStudentDTO)); + } + + @PostMapping("queryStudent") + @ApiOperation("查询单个学生 id") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO queryStudent(@RequestBody StudentDO studentDO){ + return ResponseData.generateCreatedResponse(0,studentService.queryStudent(studentDO)); + } + + + +} diff --git a/src/main/java/com/meishu/controller/StuentCourseMappingController.java b/src/main/java/com/meishu/controller/StuentCourseMappingController.java new file mode 100644 index 0000000..5e6406f --- /dev/null +++ b/src/main/java/com/meishu/controller/StuentCourseMappingController.java @@ -0,0 +1,22 @@ +package com.meishu.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + * <p> + * 前端控制器 + * </p> + * + * @author Tuyp + * @since 2021-05-17 + */ +@RestController +@Api(tags = "") +@RequestMapping("/stuent-course-mapping-do") +public class StuentCourseMappingController { + +} diff --git a/src/main/java/com/meishu/controller/SubjectDictController.java b/src/main/java/com/meishu/controller/SubjectDictController.java new file mode 100644 index 0000000..d87ac75 --- /dev/null +++ b/src/main/java/com/meishu/controller/SubjectDictController.java @@ -0,0 +1,31 @@ +package com.meishu.controller; + + +import com.meishu.service.SubjectDictService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + * <p> + * 学校科目字典表 前端控制器 + * </p> + * + * @author Tuyp + * @since 2021-08-17 + */ +@RestController +@Api(tags = "学校科目字典表") +@RequestMapping("/subject") +public class SubjectDictController { + + @Autowired + private SubjectDictService subjectDictService; + + + + + +} diff --git a/src/main/java/com/meishu/controller/SubjectDimensionDictController.java b/src/main/java/com/meishu/controller/SubjectDimensionDictController.java new file mode 100644 index 0000000..21ff10a --- /dev/null +++ b/src/main/java/com/meishu/controller/SubjectDimensionDictController.java @@ -0,0 +1,69 @@ +package com.meishu.controller; + + +import com.meishu.common.ResponseData; +import com.meishu.common.ResponseVO; +import com.meishu.common.interceptor.LoginRequired; +import com.meishu.model.SubjectDimensionDictDO; +import com.meishu.model.SubjectTestPublishGradeDO; +import com.meishu.service.SubjectDimensionDictService; +import com.meishu.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 Tuyp + * @since 2021-05-06 + */ +@RestController +@Api(tags = "测评表") +@RequestMapping("/subjectDimensionDict") +public class SubjectDimensionDictController { + + @Autowired + private SubjectDimensionDictService subjectDimensionDictService; + + @PostMapping("getAllDimensions") + @ApiOperation("获取所有的维度 {ruleId 规则id}") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO getAllDimensions(@RequestBody SubjectDimensionDictDO subjectDimensionDictDO){ + return ResponseData.generateCreatedResponse(0,subjectDimensionDictService.getAllDimensions(subjectDimensionDictDO)); + } + + @PostMapping("deleteDimensionById") + @ApiOperation("删除某个维度 {id}") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO deleteDimensionById(@RequestBody SubjectDimensionDictDO subjectDimensionDictDO){ + return ResponseData.generateCreatedResponse(0,subjectDimensionDictService.deleteDimensionById(subjectDimensionDictDO)); + } + + @PostMapping("updateDimension") + @ApiOperation("编辑维度 {id dimension:维度名称 }") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO updateDimension(@RequestBody SubjectDimensionDictDO subjectDimensionDictDO){ + return ResponseData.generateCreatedResponse(0,subjectDimensionDictService.updateDimension(subjectDimensionDictDO)); + } + + @PostMapping("addDimension") + @ApiOperation("新增维度 {id ruleId: }") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO addDimension(@RequestBody SubjectDimensionDictDO subjectDimensionDictDO){ + return ResponseData.generateCreatedResponse(0,subjectDimensionDictService.addDimension(subjectDimensionDictDO)); + } + + @PostMapping("getAllDimensionStar") + @ApiOperation("获取某个【规则】下的全部权限星级 publishId 规则id") + public ResponseVO getAllDimensionStar(@RequestBody SubjectTestPublishGradeDO subjectTestPublishGradeDO){ + return ResponseData.generateCreatedResponse(0,subjectDimensionDictService.getAllDimensionStar(subjectTestPublishGradeDO)); + } +} diff --git a/src/main/java/com/meishu/controller/SubjectDimensionStarDictController.java b/src/main/java/com/meishu/controller/SubjectDimensionStarDictController.java new file mode 100644 index 0000000..d81dc71 --- /dev/null +++ b/src/main/java/com/meishu/controller/SubjectDimensionStarDictController.java @@ -0,0 +1,65 @@ +package com.meishu.controller; + + +import com.meishu.common.ResponseData; +import com.meishu.common.ResponseVO; +import com.meishu.common.interceptor.LoginRequired; +import com.meishu.dto.dimension.AddStarDTO; +import com.meishu.dto.dimension.DeleteStarByIdDTO; +import com.meishu.model.SubjectDimensionStarDictDO; +import com.meishu.service.SubjectDimensionStarDictService; +import com.meishu.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 Tuyp + * @since 2021-05-06 + */ +@RestController +@Api(tags = "维度星级字典表") +@RequestMapping("/subjectDimensionStartDict") +public class SubjectDimensionStarDictController { + + @Autowired + private SubjectDimensionStarDictService subjectDimensionStartDictService; + + @PostMapping("getAllDimensionStars") + @ApiOperation("获取某个维度下所有的星级 {dimensionId:维度id star星级 }") +// @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO getAllDimensionStars(@RequestBody SubjectDimensionStarDictDO subjectDimensionStartDictDO){ + return ResponseData.generateCreatedResponse(0,subjectDimensionStartDictService.getAllDimensionStars(subjectDimensionStartDictDO)); + } + + @PostMapping("deleteStarById") + @ApiOperation("删除某个星级 ids:id数组") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO deleteStarById(@RequestBody DeleteStarByIdDTO deleteDimensionByIdDTO){ + return ResponseData.generateCreatedResponse(0,subjectDimensionStartDictService.deleteStarById(deleteDimensionByIdDTO)); + } + + @PostMapping("addStar") + @ApiOperation("新建星级 treeIds:多个知识点的数组 dimensionId:维度i1111d star:星级 description:评析") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO addStar(@RequestBody AddStarDTO addStarDTO){ + return ResponseData.generateCreatedResponse(0,subjectDimensionStartDictService.addStar(addStarDTO)); + } + + @PostMapping("updateStar") + @ApiOperation("修改星级 id treeIds:多个知识点的数组 dimensionId:维度id star:星级 description:评析") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO updateStar(@RequestBody AddStarDTO addStarDTO){ + return ResponseData.generateCreatedResponse(0,subjectDimensionStartDictService.updateStar(addStarDTO)); + } + +} diff --git a/src/main/java/com/meishu/controller/SubjectRuleController.java b/src/main/java/com/meishu/controller/SubjectRuleController.java new file mode 100644 index 0000000..edc8ecb --- /dev/null +++ b/src/main/java/com/meishu/controller/SubjectRuleController.java @@ -0,0 +1,72 @@ +package com.meishu.controller; + + +import com.meishu.common.ResponseData; +import com.meishu.common.ResponseVO; +import com.meishu.common.interceptor.LoginRequired; +import com.meishu.dto.rule.GetAllRulesDTO; +import com.meishu.dto.rule.GetRuleReportDTO; +import com.meishu.model.SubjectRuleDO; +import com.meishu.service.SubjectRuleService; +import com.meishu.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 Tuyp + * @since 2021-05-08 + */ +@RestController +@Api(tags = "规则字典表") +@RequestMapping("/subjectRule") +public class SubjectRuleController { + + @Autowired + private SubjectRuleService subjectRuleService; + + @PostMapping("getAllRules") + @ApiOperation("获取所有规则 ") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO getAllRules(@RequestBody GetAllRulesDTO getAllRulesDTO){ + return ResponseData.generateCreatedResponse(0,subjectRuleService.getAllRules(getAllRulesDTO)); + } + + @PostMapping("getRules") + @ApiOperation("获取所有规则 ") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO getRules(){ + return ResponseData.generateCreatedResponse(0,subjectRuleService.getRules()); + } + + @PostMapping("addRule") + @ApiOperation("新建规则 {subjectId:科目id ruleName规则名称}") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO addRule(@RequestBody SubjectRuleDO subjectRuleDO){ + return ResponseData.generateCreatedResponse(0,subjectRuleService.addRule(subjectRuleDO)); + } + + @PostMapping("updateRule") + @ApiOperation("更新规则 {id subjectId:科目id ruleName规则名称 status }") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO updateRule(@RequestBody SubjectRuleDO subjectRuleDO){ + return ResponseData.generateCreatedResponse(0,subjectRuleService.updateRule(subjectRuleDO)); + } + + @PostMapping("deleteRule") + @ApiOperation("删除规则 {id}") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO deleteRule(@RequestBody SubjectRuleDO subjectRuleDO){ + return ResponseData.generateCreatedResponse(0,subjectRuleService.deleteRule(subjectRuleDO)); + } + +} diff --git a/src/main/java/com/meishu/controller/SubjectSemesterController.java b/src/main/java/com/meishu/controller/SubjectSemesterController.java new file mode 100644 index 0000000..24d2012 --- /dev/null +++ b/src/main/java/com/meishu/controller/SubjectSemesterController.java @@ -0,0 +1,79 @@ +package com.meishu.controller; + + +import com.meishu.common.ResponseData; +import com.meishu.common.ResponseVO; +import com.meishu.dto.semester.GetSemesterScoreDTO; +import com.meishu.dto.semester.GetStudentDetailDTO; +import com.meishu.dto.semester.GetStudentRecordDTO; +import com.meishu.service.SubjectSemesterService; +import com.meishu.util.excel.ExcelUtil; +import com.meishu.vo.semester.GetSemesterScoreVO; +import com.meishu.vo.semester.GetStudentRecordVO; +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; + +import java.util.List; + +/** + * <p> + * 前端控制器 + * </p> + * + * @author Tuyp + * @since 2021-08-11 + */ +@RestController +@Api(tags = "学期表") +@RequestMapping("/semester") +public class SubjectSemesterController { + + @Autowired + private SubjectSemesterService subjectSemesterService; + + @PostMapping("getAllStudyingSemester") + @ApiOperation("获取所有在读班级") + public ResponseVO getAllStudyingSemester(){ + return ResponseData.generateCreatedResponse(0,subjectSemesterService.getAllStudyingSemester()); + } + + @PostMapping("getAllPastSemester") + @ApiOperation("获取所有归档班级") + public ResponseVO getAllPastSemester(){ + return ResponseData.generateCreatedResponse(0,subjectSemesterService.getAllPastSemester()); + } + + + @PostMapping("getSemesterScore") + @ApiOperation("查看某个学期下的成绩 {pageSize pageNum grade classes session userName semester 上/下 subject 语文/数学....") + public ResponseVO getSemesterScore(@RequestBody GetSemesterScoreDTO getSemesterScoreDTO){ + return ResponseData.generateCreatedResponse(0,subjectSemesterService.getSemesterScore(getSemesterScoreDTO)); + } + + @PostMapping("exportScore") + @ApiOperation("导出筛选后的数据 { grade classes session userName semester 上/下 subject 语文/数学....}") + public void exportScore(@RequestBody GetSemesterScoreDTO getSemesterScoreDTO){ + List<GetSemesterScoreVO> getSemesterScoreVOS = subjectSemesterService.exportScore(getSemesterScoreDTO); + ExcelUtil.writeExcel(getSemesterScoreVOS,GetSemesterScoreVO.class); + } + + @PostMapping("getStudentDetail") + @ApiOperation("获取学生分数详情 {pageSize pageNum id 学科+学期id userId 学生id}") + public ResponseVO getStudentDetail(@RequestBody GetStudentDetailDTO getStudentDetailDTO){ + return ResponseData.generateCreatedResponse(0,subjectSemesterService.getStudentDetail(getStudentDetailDTO)); + } + + @PostMapping("getStudentRecord") + @ApiOperation("获取学生扣分记录 {startDate endDate}") + public void getStudentRecord(@RequestBody GetStudentRecordDTO getStudentRecordDTO){ + List<GetStudentRecordVO> getStudentRecordVOS = subjectSemesterService.getStudentRecord(getStudentRecordDTO); + ExcelUtil.writeExcel(getStudentRecordVOS,GetStudentRecordVO.class); + } + +} diff --git a/src/main/java/com/meishu/controller/SubjectStarTreeMappingController.java b/src/main/java/com/meishu/controller/SubjectStarTreeMappingController.java new file mode 100644 index 0000000..f3a78e8 --- /dev/null +++ b/src/main/java/com/meishu/controller/SubjectStarTreeMappingController.java @@ -0,0 +1,22 @@ +package com.meishu.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + * <p> + * 测评-知识点关联表 前端控制器 + * </p> + * + * @author Tuyp + * @since 2021-05-06 + */ +@RestController +@Api(tags = "测评-知识点关联表") +@RequestMapping("/subject-star-tree-mapping-do") +public class SubjectStarTreeMappingController { + +} diff --git a/src/main/java/com/meishu/controller/SubjectStudentAnswerStarController.java b/src/main/java/com/meishu/controller/SubjectStudentAnswerStarController.java new file mode 100644 index 0000000..76e21c7 --- /dev/null +++ b/src/main/java/com/meishu/controller/SubjectStudentAnswerStarController.java @@ -0,0 +1,22 @@ +package com.meishu.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + * <p> + * 学生答卷星级表 前端控制器 + * </p> + * + * @author Tuyp + * @since 2021-05-13 + */ +@RestController +@Api(tags = "学生答卷星级表") +@RequestMapping("/subject-student-answer-star-do") +public class SubjectStudentAnswerStarController { + +} diff --git a/src/main/java/com/meishu/controller/SubjectTestDictController.java b/src/main/java/com/meishu/controller/SubjectTestDictController.java new file mode 100644 index 0000000..4bae51c --- /dev/null +++ b/src/main/java/com/meishu/controller/SubjectTestDictController.java @@ -0,0 +1,74 @@ +package com.meishu.controller; + + +import com.meishu.common.ResponseData; +import com.meishu.common.ResponseVO; +import com.meishu.common.interceptor.LoginRequired; +import com.meishu.dto.test.GetAllTestDTO; +import com.meishu.model.SubjectTestDictDO; +import com.meishu.service.SubjectTestDictService; +import com.meishu.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 Tuyp + * @since 2021-05-20 + */ +@RestController +@Api(tags = "测评字典表") +@RequestMapping("/subjectTest") +public class SubjectTestDictController { + + @Autowired + private SubjectTestDictService subjectTestService; + + @PostMapping("getAllTest") + @ApiOperation("获取全部测评字典数据 分页 {ruleId testName pageSize pageNum}") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO getAllTest(@RequestBody GetAllTestDTO getAllTestDTO){ + return ResponseData.generateCreatedResponse(0,subjectTestService.getAllTest(getAllTestDTO)); + } + + @PostMapping("getTest") + @ApiOperation("获取全不对测评 不分页 {ruleId testName}") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO getTest(@RequestBody GetAllTestDTO getAllTestDTO){ + return ResponseData.generateCreatedResponse(0,subjectTestService.getTest(getAllTestDTO)); + } + + + @PostMapping("insertTest") + @ApiOperation("新增一个测评 {ruleId 规则id testName:测评名称 examination:卷面}") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO insertTest(@RequestBody SubjectTestDictDO subjectTestDictDO){ + return ResponseData.generateCreatedResponse(0,subjectTestService.insertTest(subjectTestDictDO)); + } + + @PostMapping("updateTest") + @ApiOperation("修改一个测评 {id ruleId 规则id testName:测评名称 examination:卷面} ") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO updateTest(@RequestBody SubjectTestDictDO subjectTestDictDO){ + return ResponseData.generateCreatedResponse(0,subjectTestService.updateTest(subjectTestDictDO)); + } + + @PostMapping("deleteByTestId") + @ApiOperation("删除一个测评 {id}") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO deleteByTestId(@RequestBody SubjectTestDictDO subjectTestDictDO){ + return ResponseData.generateCreatedResponse(0,subjectTestService.deleteByTestId(subjectTestDictDO)); + } + + + +} diff --git a/src/main/java/com/meishu/controller/SubjectTestGradeExampleMappingController.java b/src/main/java/com/meishu/controller/SubjectTestGradeExampleMappingController.java new file mode 100644 index 0000000..f93b650 --- /dev/null +++ b/src/main/java/com/meishu/controller/SubjectTestGradeExampleMappingController.java @@ -0,0 +1,22 @@ +package com.meishu.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + * <p> + * 样卷映射表 前端控制器 + * </p> + * + * @author Tuyp + * @since 2021-06-21 + */ +@RestController +@Api(tags = "样卷映射表") +@RequestMapping("/subject-test-grede-example-mapping-do") +public class SubjectTestGradeExampleMappingController { + +} diff --git a/src/main/java/com/meishu/controller/SubjectTestGradeStarMappingController.java b/src/main/java/com/meishu/controller/SubjectTestGradeStarMappingController.java new file mode 100644 index 0000000..031b520 --- /dev/null +++ b/src/main/java/com/meishu/controller/SubjectTestGradeStarMappingController.java @@ -0,0 +1,22 @@ +package com.meishu.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + * <p> + * 档次星级映射表 前端控制器 + * </p> + * + * @author Tuyp + * @since 2021-06-21 + */ +@RestController +@Api(tags = "档次星级映射表") +@RequestMapping("/subject-test-grede-star-mapping-do") +public class SubjectTestGradeStarMappingController { + +} diff --git a/src/main/java/com/meishu/controller/SubjectTestPublishGradeController.java b/src/main/java/com/meishu/controller/SubjectTestPublishGradeController.java new file mode 100644 index 0000000..fb622a1 --- /dev/null +++ b/src/main/java/com/meishu/controller/SubjectTestPublishGradeController.java @@ -0,0 +1,78 @@ +package com.meishu.controller; + + +import com.meishu.common.ResponseData; +import com.meishu.common.ResponseVO; +import com.meishu.common.interceptor.LoginRequired; +import com.meishu.dto.grade.AddGradeDTO; +import com.meishu.model.SubjectTestPublishGradeDO; +import com.meishu.service.SubjectTestPublishGradeService; +import com.meishu.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 Tuyp + * @since 2021-06-21 + */ +@RestController +@Api(tags = "档次表") +@RequestMapping("/subjectGrade") +public class SubjectTestPublishGradeController { + + @Autowired + private SubjectTestPublishGradeService subjectTestPublishGradeService; + + @PostMapping("addGrade") + @ApiOperation("添加一个档次 gradeName档次名称 publishId 发布id content 综合评价 subjectTestGradeExampleMappingDOS [exampleView 样卷地址] subjectTestGradeStarMappingDOS [starId 星级id]") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO addGrade(@RequestBody AddGradeDTO addGradeDTO){ + return ResponseData.generateCreatedResponse(0,subjectTestPublishGradeService.addGrade(addGradeDTO)); + } + + @PostMapping("deleteGrade") + @ApiOperation("删除一个档次 id 档次id") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO deleteGrade(@RequestBody SubjectTestPublishGradeDO subjectTestPublishGradeDO){ + return ResponseData.generateCreatedResponse(0,subjectTestPublishGradeService.deleteGrade(subjectTestPublishGradeDO)); + } + + @PostMapping("queryGrade") + @ApiOperation("查询档次全部档次") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO queryGrade(@RequestBody SubjectTestPublishGradeDO subjectTestPublishGradeDO){ + return ResponseData.generateCreatedResponse(0,subjectTestPublishGradeService.queryGrade(subjectTestPublishGradeDO)); + } + + @PostMapping("queryOneGrade") + @ApiOperation("查询单个档次 id") +// @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO queryOneGrade(@RequestBody SubjectTestPublishGradeDO subjectTestPublishGradeDO){ + return ResponseData.generateCreatedResponse(0,subjectTestPublishGradeService.queryOneGrade(subjectTestPublishGradeDO)); + } + + @PostMapping("updateGrade") + @ApiOperation("编辑某个档次 id gradeName档次名称 publishId 发布id subjectTestGradeExampleMappingDOS [exampleView 样卷地址] subjectTestGradeStarMappingDOS [starId 星级id] ") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO updateGrade(@RequestBody AddGradeDTO addGradeDTO){ + return ResponseData.generateCreatedResponse(0,subjectTestPublishGradeService.updateGrade(addGradeDTO)); + } + + @PostMapping("getRuleIdByPublishId") + @ApiOperation("通过publishId查询ruleId {publishId 发布id}") + public ResponseVO getRuleIdByPublishId(@RequestBody SubjectTestPublishGradeDO subjectTestPublishGradeDO){ + return ResponseData.generateCreatedResponse(0,subjectTestPublishGradeService.getRuleIdByPublishId(subjectTestPublishGradeDO)); + } + + +} diff --git a/src/main/java/com/meishu/controller/SubjectTestPublishHistoryController.java b/src/main/java/com/meishu/controller/SubjectTestPublishHistoryController.java new file mode 100644 index 0000000..b78b54a --- /dev/null +++ b/src/main/java/com/meishu/controller/SubjectTestPublishHistoryController.java @@ -0,0 +1,90 @@ +package com.meishu.controller; + + +import com.meishu.common.ResponseData; +import com.meishu.common.ResponseVO; +import com.meishu.common.interceptor.LoginRequired; +import com.meishu.dto.test.*; +import com.meishu.model.SubjectTestDictDO; +import com.meishu.model.SubjectTestPublishHistoryDO; +import com.meishu.service.SubjectTestPublishHistoryService; +import com.meishu.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 Tuyp + * @since 2021-05-08 + */ +@RestController +@Api(tags = "测评发布记录表") +@RequestMapping("/subjectTestPublishHistory") +public class SubjectTestPublishHistoryController { + + @Autowired + private SubjectTestPublishHistoryService subjectTestPublishHistoryService; + + + @PostMapping("publishTest") + @ApiOperation("发布一条测评 {testId 测评id outline studentIds coverPage 多个学生id testTime 测评时间}") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO publishTest(@RequestBody PublishTestDTO publishTestDTO){ + return ResponseData.generateCreatedResponse(0,subjectTestPublishHistoryService.publishTest(publishTestDTO)); + } + + + @PostMapping("updatePublish") + @ApiOperation("修改一个测评 {publishId 发布id testId 测评id outline studentIds 多个学生id testTime 测评时间}") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO updatePublish(@RequestBody PublishTestDTO publishTestDTO){ + return ResponseData.generateCreatedResponse(0,subjectTestPublishHistoryService.updatePublish(publishTestDTO)); + } + + + @PostMapping("getPublishHistory") + @ApiOperation("获取所有的测评发布历史 {ruleId 规则id publishName测评名称 pageSize pageNum}") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO getPublishHistory(@RequestBody GetPublishHistoryDTO getPublishHistoryDTO){ + return ResponseData.generateCreatedResponse(0,subjectTestPublishHistoryService.getPublishHistory(getPublishHistoryDTO)); + } + + @PostMapping("getTestReport") + @ApiOperation("测评报告 {ruleId 规则id publishName测评名称 pageSize pageNum}") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO getTestReport(@RequestBody GetTestReportDTO getTestReportDTO){ + return ResponseData.generateCreatedResponse(0,subjectTestPublishHistoryService.getTestReport(getTestReportDTO)); + } + + @PostMapping("getOnePublish") + @ApiOperation("查看某个测评的报告 {id 发布的id}") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO getOnePublish(@RequestBody GetOnePublishDTO getOnePublishDTO){ + return ResponseData.generateCreatedResponse(0,subjectTestPublishHistoryService.getOnePublish(getOnePublishDTO)); + } + + @PostMapping("comment") + @ApiOperation("评析卷子 {studentId 学生id publishId 发布id dimensionId 维度id starId 星级id administerId:评卷人id}") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO comment(@RequestBody CommentDTO commentDTO){ + return ResponseData.generateCreatedResponse(0,subjectTestPublishHistoryService.comment(commentDTO)); + } + + @PostMapping("deletePublish") + @ApiOperation("删除一条发布测评 id") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO deletePublish(@RequestBody SubjectTestPublishHistoryDO subjectTestPublishHistoryDO){ + return ResponseData.generateCreatedResponse(0,subjectTestPublishHistoryService.deletePublish(subjectTestPublishHistoryDO)); + } + + +} diff --git a/src/main/java/com/meishu/controller/SubjectTestStudentAnswerController.java b/src/main/java/com/meishu/controller/SubjectTestStudentAnswerController.java new file mode 100644 index 0000000..32445a9 --- /dev/null +++ b/src/main/java/com/meishu/controller/SubjectTestStudentAnswerController.java @@ -0,0 +1,22 @@ +package com.meishu.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + * <p> + * 学生月考答卷 前端控制器 + * </p> + * + * @author Tuyp + * @since 2021-05-13 + */ +@RestController +@Api(tags = "学生月考答卷") +@RequestMapping("/subject-test-student-answer-do") +public class SubjectTestStudentAnswerController { + +} diff --git a/src/main/java/com/meishu/controller/SubjectTreeController.java b/src/main/java/com/meishu/controller/SubjectTreeController.java new file mode 100644 index 0000000..951e4e1 --- /dev/null +++ b/src/main/java/com/meishu/controller/SubjectTreeController.java @@ -0,0 +1,78 @@ +package com.meishu.controller; + + +import com.meishu.common.ResponseData; +import com.meishu.common.ResponseVO; +import com.meishu.common.interceptor.LoginRequired; +import com.meishu.dto.subject.GetSubjectTreeDTO; +import com.meishu.dto.subject.UpdateTreeOrderDTO; +import com.meishu.model.SubjectTreeDO; +import com.meishu.service.SubjectTreeService; +import com.meishu.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 Tuyp + * @since 2021-04-27 + */ +@RestController +@Api(tags = "知识树") +@RequestMapping("/subjectTree") +public class SubjectTreeController { + + @Autowired + private SubjectTreeService subjectTreeService; + + @PostMapping("updateSubjectTree") + @ApiOperation("更新知识树子节点 id treeName:知识点名称 parentId父节点id treeNode 编号") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO updateSubjectTree(@RequestBody SubjectTreeDO subjectTreeDO){ + return ResponseData.generateCreatedResponse(0,subjectTreeService.updateSubjectTree(subjectTreeDO)); + } + + @PostMapping("addSubjectTree") + @ApiOperation("添加知识树节点 subjectId 科目id parentId:父节点 treeName:知识点名称 " + + "treeNode 编号 ") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO addSubjectTree(@RequestBody SubjectTreeDO subjectTreeDO){ + return ResponseData.generateCreatedResponse(0,subjectTreeService.addSubjectTree(subjectTreeDO)); + } + + @PostMapping("deleteSubjectTree") + @ApiOperation("删除子节点(递归删除) {id}") + //@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO deleteSubjectTree(@RequestBody SubjectTreeDO subjectTreeDO){ + return ResponseData.generateCreatedResponse(0,subjectTreeService.deleteSubjectTree(subjectTreeDO)); + } + + @PostMapping("updateTreeOrder") + @ApiOperation("知识点排序 {ids[]知识树id parentId }") + public ResponseVO updateTreeOrder(@RequestBody UpdateTreeOrderDTO updateTreeOrderDTO){ + return ResponseData.generateCreatedResponse(0,subjectTreeService.updateTreeOrder(updateTreeOrderDTO)); + } + + @PostMapping("getTreesCnt") + @ApiOperation("获取知识树+ 题目视频数 subjectId userId") + public ResponseVO getTreesCnt(@RequestBody GetSubjectTreeDTO getSubjectTreeDTO){ + return ResponseData.generateCreatedResponse(0,subjectTreeService.getTreesCnt(getSubjectTreeDTO)); + } + + @PostMapping("getTreesCheckCnt") + @ApiOperation("获取知识树+ 视频题目审核数 subjectId userId shareStatus 2:待审核 1已审核") + public ResponseVO getTreesCheckCnt(@RequestBody GetSubjectTreeDTO getSubjectTreeDTO){ + return ResponseData.generateCreatedResponse(0,subjectTreeService.getTreesCheckCnt(getSubjectTreeDTO)); + } + + +} diff --git a/src/main/java/com/meishu/controller/TaskCompletionStatusController.java b/src/main/java/com/meishu/controller/TaskCompletionStatusController.java new file mode 100644 index 0000000..7a5175b --- /dev/null +++ b/src/main/java/com/meishu/controller/TaskCompletionStatusController.java @@ -0,0 +1,22 @@ +package com.meishu.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-09-16 + */ +@RestController +@Api(tags = "作业任务完成状态") +@RequestMapping("/task-completion-status-do") +public class TaskCompletionStatusController { + +} diff --git a/src/main/java/com/meishu/controller/TaskContentController.java b/src/main/java/com/meishu/controller/TaskContentController.java new file mode 100644 index 0000000..8ab4d30 --- /dev/null +++ b/src/main/java/com/meishu/controller/TaskContentController.java @@ -0,0 +1,22 @@ +package com.meishu.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-09-16 + */ +@RestController +@Api(tags = "作业内容表(取题目,视频,书面作业)") +@RequestMapping("/task-content-do") +public class TaskContentController { + +} diff --git a/src/main/java/com/meishu/controller/TaskContentDoneInfoController.java b/src/main/java/com/meishu/controller/TaskContentDoneInfoController.java new file mode 100644 index 0000000..cc4813f --- /dev/null +++ b/src/main/java/com/meishu/controller/TaskContentDoneInfoController.java @@ -0,0 +1,22 @@ +package com.meishu.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-09-30 + */ +@RestController +@Api(tags = "") +@RequestMapping("/task-content-done-info-do") +public class TaskContentDoneInfoController { + +} diff --git a/src/main/java/com/meishu/controller/TaskDoneHistoryController.java b/src/main/java/com/meishu/controller/TaskDoneHistoryController.java new file mode 100644 index 0000000..4f0945a --- /dev/null +++ b/src/main/java/com/meishu/controller/TaskDoneHistoryController.java @@ -0,0 +1,22 @@ +package com.meishu.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-09-16 + */ +@RestController +@Api(tags = "") +@RequestMapping("/task-done-history-do") +public class TaskDoneHistoryController { + +} diff --git a/src/main/java/com/meishu/controller/UserRoleController.java b/src/main/java/com/meishu/controller/UserRoleController.java new file mode 100644 index 0000000..ec535bb --- /dev/null +++ b/src/main/java/com/meishu/controller/UserRoleController.java @@ -0,0 +1,91 @@ +package com.meishu.controller; + + +import com.meishu.common.ResponseData; +import com.meishu.common.ResponseVO; +import com.meishu.dto.sms.VerifyCodeDTO; +import com.meishu.dto.userrole.AccountLoginDTO; +import com.meishu.dto.userrole.AddStudentsDTO; +import com.meishu.dto.userrole.QueryStudentsDTO; +import com.meishu.model.UserRoleDO; +import com.meishu.service.UserRoleService; +import com.meishu.util.excel.ExcelUtil; +import com.meishu.vo.semester.GetSemesterScoreVO; +import com.meishu.vo.student.QueryStudentVO; +import com.meishu.vo.userrole.QueryStudentsVO; +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; + +import java.util.List; + +/** + * <p> + * 学生表 前端控制器 + * </p> + * + * @author Tuyp + * @since 2021-08-16 + */ +@RestController +@Api(tags = "学生表") +@RequestMapping("/userRole") +public class UserRoleController { + + @Autowired + private UserRoleService userRoleService; + + @PostMapping(value = "/login") + @ApiOperation("手机端:实验室预约登录:phone/手机号, verifyCode/验证码") + public ResponseVO login(@RequestBody VerifyCodeDTO verifyCodeDTO) { + return ResponseData.generateCreatedResponse(0, userRoleService.login(verifyCodeDTO)); + } + + @PostMapping(value = "/accountLogin") + @ApiOperation("手机端:实验室预约账户登录:idCard/身份证, password/密码") + public ResponseVO accountLogin(@RequestBody AccountLoginDTO accountLoginDTO) { + return ResponseData.generateCreatedResponse(0, userRoleService.accountLogin(accountLoginDTO)); + } + + @PostMapping(value = "/userInfo") + @ApiOperation("获取用户信息:id/学生ID") + public ResponseVO userInfo(@RequestBody UserRoleDO userRoleDO) { + return ResponseData.generateCreatedResponse(0, userRoleService.userInfo(userRoleDO.getUserId())); + } + + @PostMapping("queryStudents") + @ApiOperation("学生管理--查询所有学生 {pageSize pageNum userName 学生名称 grade 年级 session 入读时间 userStatus 状态 }") + public ResponseVO queryStudents(@RequestBody QueryStudentsDTO queryStudentsDTO){ + return ResponseData.generateCreatedResponse(0,userRoleService.queryStudents(queryStudentsDTO)); + } + + @PostMapping("addStudents") + @ApiOperation("学生管理--添加学生 {userName:学生姓名 studyCode:学籍号 phone:手机号 idCard:身份证号 session:入学年份 gender:性别 email:邮箱 }") + public ResponseVO addStudents(@RequestBody UserRoleDO userRoleDO){ + return ResponseData.generateCreatedResponse(0,userRoleService.addStudents(userRoleDO)); + } + + @PostMapping("updateStudent") + @ApiOperation("学生管理--编辑学生 {id userName:学生姓名 studyCode:学籍号 phone:手机号 idCard:身份证号 session:入学年份 gender:性别 email:邮箱}") + public ResponseVO updateStudent(@RequestBody UserRoleDO userRoleDO){ + return ResponseData.generateCreatedResponse(0,userRoleService.updateStudent(userRoleDO)); + } + + @PostMapping("exportStudents") + @ApiOperation("学生管理--导出 { userName 学生名称 grade 年级 session 入读时间 userStatus 状态 0:归档 1:在读 2:休学}") + public void exportStudents(@RequestBody QueryStudentsDTO queryStudentsDTO){ + List<QueryStudentsVO> queryStudentsVOS = userRoleService.exportStudents(queryStudentsDTO); + ExcelUtil.writeExcel(queryStudentsVOS, QueryStudentsVO.class); + } + + @PostMapping("studycode") + public void studycode(){ + userRoleService.studycode(); + } + +} diff --git a/src/main/java/com/meishu/controller/UserSubjectMappingController.java b/src/main/java/com/meishu/controller/UserSubjectMappingController.java new file mode 100644 index 0000000..b5a1507 --- /dev/null +++ b/src/main/java/com/meishu/controller/UserSubjectMappingController.java @@ -0,0 +1,22 @@ +package com.meishu.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + * <p> + * 老师-科目映射表 前端控制器 + * </p> + * + * @author Tuyp + * @since 2021-08-17 + */ +@RestController +@Api(tags = "老师-科目映射表") +@RequestMapping("/user-subject-mapping-do") +public class UserSubjectMappingController { + +} diff --git a/src/main/java/com/meishu/controller/UserSubjectPermissionDictController.java b/src/main/java/com/meishu/controller/UserSubjectPermissionDictController.java new file mode 100644 index 0000000..c4572b0 --- /dev/null +++ b/src/main/java/com/meishu/controller/UserSubjectPermissionDictController.java @@ -0,0 +1,22 @@ +package com.meishu.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + * <p> + * 平时成绩---老师班级权限 前端控制器 + * </p> + * + * @author Tuyp + * @since 2021-08-18 + */ +@RestController +@Api(tags = "平时成绩---老师班级权限") +@RequestMapping("/user-subject-permission-dict-do") +public class UserSubjectPermissionDictController { + +} diff --git a/src/main/java/com/meishu/controller/UuidHistoryController.java b/src/main/java/com/meishu/controller/UuidHistoryController.java new file mode 100644 index 0000000..9a02c83 --- /dev/null +++ b/src/main/java/com/meishu/controller/UuidHistoryController.java @@ -0,0 +1,22 @@ +package com.meishu.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-09-29 + */ +@RestController +@Api(tags = "") +@RequestMapping("/uuid-history-do") +public class UuidHistoryController { + +} diff --git a/src/main/java/com/meishu/controller/VodDictController.java b/src/main/java/com/meishu/controller/VodDictController.java new file mode 100644 index 0000000..5e14208 --- /dev/null +++ b/src/main/java/com/meishu/controller/VodDictController.java @@ -0,0 +1,147 @@ +package com.meishu.controller; + + +import com.meishu.common.ResponseData; +import com.meishu.common.ResponseVO; +import com.meishu.common.interceptor.LoginRequired; +import com.meishu.dto.voddict.*; +import com.meishu.model.VodDictDO; +import com.meishu.model.VodPlayHistoryDO; +import com.meishu.model.VodSubjectTreeMappingDO; +import com.meishu.service.VodDictService; +import com.meishu.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 Tuyp + * @since 2021-04-27 + */ +@RestController +@Api(tags = "视频字典表") +@RequestMapping("/vodDict") +public class VodDictController { + + @Autowired + private VodDictService vodDictService; + + @PostMapping("/signature") + @ApiOperation("获取签名") + public ResponseVO signature()throws Exception{ + return ResponseData.generateCreatedResponse(0,vodDictService.signature()); + } + + @PostMapping("getTreeVods") + @ApiOperation("(个人库/公共库)获取某个知识树下的视频 subjectId 科目id vodType:课型 vodName:视频名称 shareStatus 0:个人库 1:公共库 treeId:知识树id userId 用户id pageSize pageNum") +// @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO getTreeVods (@RequestBody GetTreeVodsDTO getTreeVodsDTO){ + return ResponseData.generateCreatedResponse(0,vodDictService.getTreeVods(getTreeVodsDTO)); + } + + @PostMapping("getCheckTreeVods") + @ApiOperation("(审核)获取某个知识树下的视频 subjectId 科目id vodType:课型 vodName:视频名称 checkStatus 1:已审核 2:待审核 treeId:知识树id userId 用户id pageSize pageNum") +// @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO getCheckTreeVods (@RequestBody GetTreeVodsDTO getTreeVodsDTO){ + return ResponseData.generateCreatedResponse(0,vodDictService.getCheckTreeVods(getTreeVodsDTO)); + } + + @PostMapping("deleteVod") + @ApiOperation("删除某个视频(从腾讯云中也删除) id ") +// @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO deleteVod(@RequestBody VodDictDO vodDictDO){ + return ResponseData.generateCreatedResponse(0,vodDictService.deleteVod(vodDictDO)); + } + + @PostMapping("uploadVods") + @ApiOperation("上传某个视频 {subjectId 科目id vodName视频名称 vodUrl 视频地址 vodType课型" + + "vodIntro 视频介绍 vodLength视频长度 vodCode:腾讯云上视频code administerId 视频提供者" + + "treeIds 多个知识点(数组)}") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO uploadVods(@RequestBody UploadVodsDTO uploadVodsDTO){ + return ResponseData.generateCreatedResponse(0,vodDictService.uploadVods(uploadVodsDTO)); + } + + @PostMapping("updateVod") + @ApiOperation("修改某个视频 {id 视频名称 subjectId 科目id vodName视频名称 vodUrl 视频地址 vodType课型" + + " vodIntro 视频介绍 vodLength视频长度 vodCode:腾讯云上视频code administerId 视频提供者" + + "treeIds 多个知识点(数组)}") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO updateVod(@RequestBody UploadVodsDTO uploadVodsDTO){ + return ResponseData.generateCreatedResponse(0,vodDictService.updateVod(uploadVodsDTO)); + } + + @PostMapping("getVodInfo") + @ApiOperation("小程序---获取视频详情 id:视频id") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO getVodInfo(@RequestBody VodDictDO vodDictDO){ + return ResponseData.generateCreatedResponse(0,vodDictService.getVodInfo(vodDictDO)); + } + + @PostMapping("insertPlayHistory") + @ApiOperation("小程序--记录播放记录 {vodId 视频id treeId知识点 studentId 学生id playLength 观看时长 playRecord 播放位点}") +// @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO insertPlayHistory(@RequestBody VodPlayHistoryDO vodPlayHistoryDO){ + return ResponseData.generateCreatedResponse(0,vodDictService.insertPlayHistory(vodPlayHistoryDO)); + } + + @PostMapping("getToCheckVodCounts") + @ApiOperation("获取所有未审核/已审核的视频个数 {subjectId 科目 checkStatus 审核状态 1:已审核 2:待审核}") +// @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO getToCheckVodCounts(@RequestBody GetToCheckVodCountsDTO getToCheckVodCountsDTO){ + return ResponseData.generateCreatedResponse(0,vodDictService.getToCheckVodCounts(getToCheckVodCountsDTO)); + } + + @PostMapping("compressVodByCode") + @ApiOperation("通过code压缩视频并删除原视频 {id 视频id }") + public ResponseVO compressVodByCode(@RequestBody VodDictDO vodDictDO){ + return ResponseData.generateCreatedResponse(0,vodDictService.compressVodByCode(vodDictDO)); + } + + @PostMapping("deleteOriginVod") + @ApiOperation("删除原视频") + public ResponseVO deleteOriginVod(@RequestBody DeleteOriginVodDTO deleteOriginVodDTO){ + return ResponseData.generateCreatedResponse(0,vodDictService.deleteOriginVod(deleteOriginVodDTO)); + } + + @PostMapping("checkVod") + @ApiOperation("审核视频 {checkId 审核人id id 视频id vodType:课型 vodName:视频名称 treeIds:多个知识点id checkStatus 1:审核通过 3:未通过 reason:原因}") + public ResponseVO checkVod(@RequestBody CheckVodDTO checkVodDTO){ + return ResponseData.generateCreatedResponse(0,vodDictService.checkVod(checkVodDTO)); + } + + @PostMapping("publicUpload") + @ApiOperation("公共资源上载 {userId checkStatus 1:审核通过 2:审核中 3:未通过}") + public ResponseVO publicUpload(@RequestBody PublicCheckingDTO publicCheckingDTO){ + return ResponseData.generateCreatedResponse(0,vodDictService.publicUpload(publicCheckingDTO)); + } + + @PostMapping("withdraw") + @ApiOperation("撤回视频 id 视频id") + public ResponseVO withdraw(@RequestBody VodDictDO vodDictDO){ + return ResponseData.generateCreatedResponse(0,vodDictService.withdraw(vodDictDO)); + } + + @PostMapping("getVodDetail") + @ApiOperation("获取一个视频详情{id}") + public ResponseVO getVodDetail(@RequestBody VodDictDO vodDictDO){ + return ResponseData.generateCreatedResponse(0,vodDictService.getVodDetail(vodDictDO)); + } + + @PostMapping("setRelatedVod") + @ApiOperation("设置关联题目 {vodId 视频id status 1:关联 0:取消关联}") + public ResponseVO setRelatedVod(@RequestBody VodSubjectTreeMappingDO vodSubjectTreeMappingDO){ + return ResponseData.generateCreatedResponse(0,vodDictService.setRelatedVod(vodSubjectTreeMappingDO)); + } + + +} diff --git a/src/main/java/com/meishu/controller/VodPlayHistoryController.java b/src/main/java/com/meishu/controller/VodPlayHistoryController.java new file mode 100644 index 0000000..ce74c11 --- /dev/null +++ b/src/main/java/com/meishu/controller/VodPlayHistoryController.java @@ -0,0 +1,22 @@ +package com.meishu.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + * <p> + * 视频播放历史记录表 前端控制器 + * </p> + * + * @author Tuyp + * @since 2021-04-27 + */ +@RestController +@Api(tags = "视频播放历史记录表") +@RequestMapping("/vod-play-history-do") +public class VodPlayHistoryController { + +} diff --git a/src/main/java/com/meishu/controller/VodSubjectTreeMappingController.java b/src/main/java/com/meishu/controller/VodSubjectTreeMappingController.java new file mode 100644 index 0000000..60f3926 --- /dev/null +++ b/src/main/java/com/meishu/controller/VodSubjectTreeMappingController.java @@ -0,0 +1,52 @@ +package com.meishu.controller; + + +import com.meishu.common.ResponseData; +import com.meishu.common.ResponseVO; +import com.meishu.common.interceptor.LoginRequired; +import com.meishu.dto.subject.BatchStatusOprDTO; +import com.meishu.dto.subject.GetAllVodsStatusDTO; +import com.meishu.service.VodSubjectTreeMappingService; +import com.meishu.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 Tuyp + * @since 2021-04-27 + */ +@RestController +@Api(tags = "视频知识点映射表") +@RequestMapping("/vodTreeMapping") +public class VodSubjectTreeMappingController { + + + @Autowired + private VodSubjectTreeMappingService vodSubjectTreeMappingService; + + @PostMapping("getAllVodsStatus") + @ApiOperation("获取所有未授权的视频 subjectId status 0:未授权 1:已授权") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO getAllVodsStatus(@RequestBody GetAllVodsStatusDTO getAllNoAuthenVodsDTO){ + return ResponseData.generateCreatedResponse(0,vodSubjectTreeMappingService.getAllNoAuthenVods(getAllNoAuthenVodsDTO)); + } + + @PostMapping("batchStatusOpr") + @ApiOperation("批量操作视频审核状态 {ids 多个视频id[] status 1:通过 0:驳回}") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO batchStatusOpr(@RequestBody BatchStatusOprDTO batchStatusOprDTO){ + return ResponseData.generateCreatedResponse(0,vodSubjectTreeMappingService.batchStatusOpr(batchStatusOprDTO)); + } + + +} diff --git a/src/main/java/com/meishu/controller/WechatController.java b/src/main/java/com/meishu/controller/WechatController.java new file mode 100644 index 0000000..9778e37 --- /dev/null +++ b/src/main/java/com/meishu/controller/WechatController.java @@ -0,0 +1,138 @@ +package com.meishu.controller; + + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.meishu.common.ResponseData; +import com.meishu.common.ResponseVO; +import com.meishu.common.configure.RestTemplateConfig; +import com.meishu.common.configure.WechatConfig; +import com.meishu.dto.wechat.AuthenRequestDTO; +import com.meishu.dto.wechat.JsSdkDTO; +import com.meishu.dto.wechat.SignDTO; +import com.meishu.mapper.AccessTokenMapper; +import com.meishu.mapper.StudentMapper; +import com.meishu.model.AccessTokenDO; +import com.meishu.model.StudentDO; +import com.meishu.util.SecretUtils; +import com.meishu.util.WechatUtil; +import com.meishu.vo.wechat.AuthenTokenVO; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpMethod; +import org.springframework.http.ResponseEntity; +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 java.time.LocalDateTime; +import java.util.List; + +@RestController +@RequestMapping("/wechat") +@Api(tags = "微信授权") +public class WechatController { + + @Autowired + private RestTemplateConfig restTemplateConfig; + + @Autowired + private WechatConfig wechatConfig; + + @Autowired + private AccessTokenMapper accessTokenMapper; + + @Autowired + private StudentMapper studentMapper; + + @PostMapping(value = "/getJsapiTicket") + @ApiOperation("通过token请求获得jsapi_ticket {url}") + public ResponseVO getJsapiTicket(@RequestBody SignDTO signVO) { + + List<AccessTokenDO> accessTokens = accessTokenMapper.selectList(null); + + String accessToken = ""; + if (accessTokens.size() == 0) { + accessToken = WechatUtil.getAccessToken().getAccess_token(); + AccessTokenDO accessToken1 = new AccessTokenDO(); + accessToken1.setAccessToken(accessToken); + accessToken1.setUpdateDate(LocalDateTime.now()); + accessTokenMapper.insert(accessToken1); + } else { + AccessTokenDO accessToken1 = accessTokens.get(0); + int diff = LocalDateTime.now().getNano() - accessToken1.getUpdateDate().getNano(); + if (diff >= 2 * 60 * 60*1000000000 - 5*1000000000) { + accessToken = WechatUtil.getAccessToken().getAccess_token(); + accessToken1.setAccessToken(accessToken); + accessToken1.setUpdateDate(LocalDateTime.now()); + accessTokenMapper.updateById(accessToken1); + } else { + accessToken = accessToken1.getAccessToken(); + } + } + signVO.setAccess_token(accessToken); + String url1 = "https://api.weixin.qq.com/cgi-bin/ticket/getticket?access_token=" + accessToken + "&type=jsapi"; + ResponseEntity<JsSdkDTO> response1 = restTemplateConfig.restTemplate() + .exchange(url1, HttpMethod.GET, null, JsSdkDTO.class); + + String ticket = response1.getBody().getTicket(); + signVO.setJsapi_ticket(ticket); + signVO.setNoncestr("Wm3WZYTPz0wzccnW"); + signVO.setTimestamp(String.valueOf(System.currentTimeMillis())); + String signStr = "jsapi_ticket=" + signVO.getJsapi_ticket() + "&noncestr=" + signVO.getNoncestr() + "×tamp=" + signVO.getTimestamp() + + "&url=" + signVO.getUrl(); + + signVO.setSign(SecretUtils.getSHAString(signStr)); + signVO.setAppId(wechatConfig.getAppId()); + signVO.setAgentId(wechatConfig.getAgentId()); + return ResponseData.generateCreatedResponse(0, signVO); + } + + + @PostMapping("/webAuthen") + @ApiOperation("网页授权 通过code换取身份信息 {code phone 手机号}") + public ResponseVO webAuthen(@RequestBody AuthenRequestDTO authenRequestDTO) { + + String url = "https://api.weixin.qq.com/sns/oauth2/access_token?appid=" + wechatConfig.getAppId() + "&secret=" + + wechatConfig.getAppSecret() + "&code=" + authenRequestDTO.getCode() + "&grant_type=authorization_code"; + ResponseEntity<AuthenTokenVO> response = restTemplateConfig.restTemplate() + .exchange(url, HttpMethod.GET, null, AuthenTokenVO.class); + AuthenTokenVO authenTokenVO = response.getBody(); + + + //通过openId从库里查询 + StudentDO user = studentMapper.selectOne(new QueryWrapper<StudentDO>() + .lambda() + .eq(StudentDO::getOpenid,authenTokenVO.getOpenid())); + + if (null==user){ + String url1 = "https://api.weixin.qq.com/sns/userinfo?access_token=" + authenTokenVO.getAccess_token() + "&openid=" + authenTokenVO.getOpenid() + "&lang=zh_CN"; + + ResponseEntity<AuthenTokenVO> response1 = restTemplateConfig.restTemplate() + .exchange(url1, HttpMethod.GET, null, AuthenTokenVO.class); + return ResponseData.generateCreatedResponse(0,response1.getBody()); + }else { +// //该openId已存在,查出该用户的角色信息 +// +// List<UserInfoVO> userInfoVOS = new ArrayList<>(); +// QueryWrapper queryWrapper = new QueryWrapper(); +// queryWrapper.eq("user_id",user.getId()); +// queryWrapper.eq("role_type","学生"); +// List<UserRole> userRoles = userRoleMapper.selectList(queryWrapper); +// for (UserRole userRole : userRoles){ +// UserInfoVO userInfoVO = new UserInfoVO(); +// BeanUtils.copyProperties(userRole,userInfoVO); +// ClassesDict classesDict = classesDictMapper.selectById(userRole.getClassesId()); +// userInfoVO.setSchool(classesDict.getSchool()); +// userInfoVO.setGrade(classesDict.getGrade()); +// userInfoVO.setClasses(classesDict.getClasses()); +// userInfoVO.setSession(classesDict.getSession()); +// userInfoVO.setSubjectType(classesDict.getSubjectType()); +// userInfoVOS.add(userInfoVO); +// } + return null; + } + } + +} diff --git a/src/main/java/com/meishu/controller/WrittenHomeworkController.java b/src/main/java/com/meishu/controller/WrittenHomeworkController.java new file mode 100644 index 0000000..3e3955c --- /dev/null +++ b/src/main/java/com/meishu/controller/WrittenHomeworkController.java @@ -0,0 +1,22 @@ +package com.meishu.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-09-16 + */ +@RestController +@Api(tags = "通知/附件作业表") +@RequestMapping("/written-homework-do") +public class WrittenHomeworkController { + +} diff --git a/src/main/java/com/meishu/dto/administer/AddAdministerDTO.java b/src/main/java/com/meishu/dto/administer/AddAdministerDTO.java new file mode 100644 index 0000000..5bbab30 --- /dev/null +++ b/src/main/java/com/meishu/dto/administer/AddAdministerDTO.java @@ -0,0 +1,18 @@ +package com.meishu.dto.administer; + +import com.meishu.model.AdministerDO; +import lombok.Data; + +import java.util.List; + +@Data +public class AddAdministerDTO extends AdministerDO { + + private List<Long> campusIds; + + private List<Long> departmentIds; + + private List<Long> subjectIds; + + private List<Long> roleIds; +} diff --git a/src/main/java/com/meishu/dto/administer/ChangeStatusDTO.java b/src/main/java/com/meishu/dto/administer/ChangeStatusDTO.java new file mode 100644 index 0000000..915d7bb --- /dev/null +++ b/src/main/java/com/meishu/dto/administer/ChangeStatusDTO.java @@ -0,0 +1,14 @@ +package com.meishu.dto.administer; + +import lombok.Data; + +import java.util.List; + +@Data +public class ChangeStatusDTO { + + private List<Long> ids; + + private String status; + +} diff --git a/src/main/java/com/meishu/dto/administer/GetClassesRequestVO.java b/src/main/java/com/meishu/dto/administer/GetClassesRequestVO.java new file mode 100644 index 0000000..f19585f --- /dev/null +++ b/src/main/java/com/meishu/dto/administer/GetClassesRequestVO.java @@ -0,0 +1,20 @@ +package com.meishu.dto.administer; + +import lombok.Data; + +/** + * @author: tuyp + * @create: 2020-06-22 18:18 + */ +@Data +public class GetClassesRequestVO { + + private Integer userId; + + private String status; + + private String subject; + + private String subjectType; + +} diff --git a/src/main/java/com/meishu/dto/administer/PublishExpandingVO.java b/src/main/java/com/meishu/dto/administer/PublishExpandingVO.java new file mode 100644 index 0000000..ce9b14e --- /dev/null +++ b/src/main/java/com/meishu/dto/administer/PublishExpandingVO.java @@ -0,0 +1,19 @@ +package com.meishu.dto.administer; + +import lombok.Data; + +/** + * @author: tuyp + * @create: 2020-07-21 14:48 + */ +@Data +public class PublishExpandingVO { + + private String expandingExeIds; + + private String expandingStudents; + + private String expandingName; + + +} diff --git a/src/main/java/com/meishu/dto/administer/PublishHomeworkVO.java b/src/main/java/com/meishu/dto/administer/PublishHomeworkVO.java new file mode 100644 index 0000000..6eaf4c7 --- /dev/null +++ b/src/main/java/com/meishu/dto/administer/PublishHomeworkVO.java @@ -0,0 +1,25 @@ +package com.meishu.dto.administer; + +import lombok.Data; + +/** + * @author: tuyp + * @create: 2020-07-21 14:52 + */ +@Data +public class PublishHomeworkVO { + + private Integer homeworkType; + + private String homeworkContent; + + private Integer adviceLength; + + private String fileSize; + + private String fileType; + + private String fileName; + + +} diff --git a/src/main/java/com/meishu/dto/administer/PublishTasksDTO.java b/src/main/java/com/meishu/dto/administer/PublishTasksDTO.java new file mode 100644 index 0000000..a00033c --- /dev/null +++ b/src/main/java/com/meishu/dto/administer/PublishTasksDTO.java @@ -0,0 +1,38 @@ +package com.meishu.dto.administer; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.util.Date; +import java.util.List; + +@Data +public class PublishTasksDTO { + + + private Integer id; + + private String treeName; + + private Integer taskType; + + private String treeIds; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + private Date taskDate; + + private List<String> subjectIds; + + private Integer userId; + + private String vodIds; + + private String relatedIds; + + private Integer adviceLength; + + private List<PublishExpandingVO> publishExpandingVOS; + + private List<PublishHomeworkVO> publishHomeworkVOS; + +} diff --git a/src/main/java/com/meishu/dto/administer/PushMsgPO.java b/src/main/java/com/meishu/dto/administer/PushMsgPO.java new file mode 100644 index 0000000..c3b6972 --- /dev/null +++ b/src/main/java/com/meishu/dto/administer/PushMsgPO.java @@ -0,0 +1,24 @@ +package com.meishu.dto.administer; + +import lombok.Data; + +@Data +public class PushMsgPO { + + + private String title; + + private String school; + + private String teacherName; + + private String taskName; + + private String DateTime; + + private String remark; + + private String openId; + + +} diff --git a/src/main/java/com/meishu/dto/administer/UpdateAdministerDTO.java b/src/main/java/com/meishu/dto/administer/UpdateAdministerDTO.java new file mode 100644 index 0000000..f238456 --- /dev/null +++ b/src/main/java/com/meishu/dto/administer/UpdateAdministerDTO.java @@ -0,0 +1,18 @@ +package com.meishu.dto.administer; + +import com.meishu.model.AdministerDO; +import lombok.Data; + +import java.util.List; + +@Data +public class UpdateAdministerDTO extends AdministerDO { + + private List<Long> campusIds; + + private List<Long> departmentIds; + + private List<Long> subjectIds; + + private List<Long> roleIds; +} diff --git a/src/main/java/com/meishu/dto/campus/BatchUpdateStatusDTO.java b/src/main/java/com/meishu/dto/campus/BatchUpdateStatusDTO.java new file mode 100644 index 0000000..7b92d79 --- /dev/null +++ b/src/main/java/com/meishu/dto/campus/BatchUpdateStatusDTO.java @@ -0,0 +1,14 @@ +package com.meishu.dto.campus; + +import lombok.Data; + +import java.util.List; + +@Data +public class BatchUpdateStatusDTO { + + private List<Long> id; + + private String status; + +} diff --git a/src/main/java/com/meishu/dto/campus/CampusStudentDTO.java b/src/main/java/com/meishu/dto/campus/CampusStudentDTO.java new file mode 100644 index 0000000..b2868b9 --- /dev/null +++ b/src/main/java/com/meishu/dto/campus/CampusStudentDTO.java @@ -0,0 +1,16 @@ +package com.meishu.dto.campus; + +import lombok.Data; + +@Data +public class CampusStudentDTO { + + private Long campusId; + + private String username; + + private Integer pageSize; + + private Integer pageNum; + +} diff --git a/src/main/java/com/meishu/dto/chapter/AddTreeToChapterDTO.java b/src/main/java/com/meishu/dto/chapter/AddTreeToChapterDTO.java new file mode 100644 index 0000000..7418f04 --- /dev/null +++ b/src/main/java/com/meishu/dto/chapter/AddTreeToChapterDTO.java @@ -0,0 +1,14 @@ +package com.meishu.dto.chapter; + +import lombok.Data; + +import java.util.List; + +@Data +public class AddTreeToChapterDTO { + + private List<Long> ids; + + private Long chapterId; + +} diff --git a/src/main/java/com/meishu/dto/chapter/ChapterExerciseVO.java b/src/main/java/com/meishu/dto/chapter/ChapterExerciseVO.java new file mode 100644 index 0000000..e3c31eb --- /dev/null +++ b/src/main/java/com/meishu/dto/chapter/ChapterExerciseVO.java @@ -0,0 +1,21 @@ +package com.meishu.dto.chapter; + +import com.meishu.model.CourseTreeDO; +import lombok.Data; + +import java.util.List; + +@Data +public class ChapterExerciseVO { + + private String createTime; + + private Integer rightCounts; + + private Integer totalCounts; + + private String chapter; + + private List<CourseTreeDO> courseTreeDOS; + +} diff --git a/src/main/java/com/meishu/dto/chapter/ChapterVodsVO.java b/src/main/java/com/meishu/dto/chapter/ChapterVodsVO.java new file mode 100644 index 0000000..d99b4ae --- /dev/null +++ b/src/main/java/com/meishu/dto/chapter/ChapterVodsVO.java @@ -0,0 +1,25 @@ +package com.meishu.dto.chapter; + +import lombok.Data; + +@Data +public class ChapterVodsVO { + + private Long vodId; + + private String vodName; + + private String treeName; + + private Integer vodLength; + + private Integer playRecord; + + private String lengthPercent; + + private String createTime; + + private Integer playCounts; + + private Long id; +} diff --git a/src/main/java/com/meishu/dto/chapter/GetChapterCourseDetailVO.java b/src/main/java/com/meishu/dto/chapter/GetChapterCourseDetailVO.java new file mode 100644 index 0000000..5f06535 --- /dev/null +++ b/src/main/java/com/meishu/dto/chapter/GetChapterCourseDetailVO.java @@ -0,0 +1,27 @@ +package com.meishu.dto.chapter; + +import com.meishu.vo.course.GetExerciseDetailVO; +import lombok.Data; + +import java.util.List; + +@Data +public class GetChapterCourseDetailVO { + + private String chapter; + + private String createTime; + + private Integer rightCounts; + + private Integer totalCounts; + + private String avgRightPercent; + + private Integer useLength; + + private Integer avgLength; + + private List<GetExerciseDetailVO> getExerciseDetailVOS; + +} diff --git a/src/main/java/com/meishu/dto/chapter/StudentChapterDTO.java b/src/main/java/com/meishu/dto/chapter/StudentChapterDTO.java new file mode 100644 index 0000000..8934eae --- /dev/null +++ b/src/main/java/com/meishu/dto/chapter/StudentChapterDTO.java @@ -0,0 +1,14 @@ +package com.meishu.dto.chapter; + +import lombok.Data; + +@Data +public class StudentChapterDTO { + + private Long studentId; + + private Long chapterId; + + private Long courseId; + +} diff --git a/src/main/java/com/meishu/dto/chapter/UpdateChapterOrderDTO.java b/src/main/java/com/meishu/dto/chapter/UpdateChapterOrderDTO.java new file mode 100644 index 0000000..351e705 --- /dev/null +++ b/src/main/java/com/meishu/dto/chapter/UpdateChapterOrderDTO.java @@ -0,0 +1,12 @@ +package com.meishu.dto.chapter; + +import lombok.Data; + +import java.util.List; + +@Data +public class UpdateChapterOrderDTO { + + private List<Long> ids; + +} diff --git a/src/main/java/com/meishu/dto/classes/AddClassDTO.java b/src/main/java/com/meishu/dto/classes/AddClassDTO.java new file mode 100644 index 0000000..e66e509 --- /dev/null +++ b/src/main/java/com/meishu/dto/classes/AddClassDTO.java @@ -0,0 +1,13 @@ +package com.meishu.dto.classes; + +import com.meishu.model.ClassesDictDO; +import lombok.Data; + +import java.util.List; + +@Data +public class AddClassDTO extends ClassesDictDO { + + List<String> subjects; + +} diff --git a/src/main/java/com/meishu/dto/classes/AddSubjectTeacherDTO.java b/src/main/java/com/meishu/dto/classes/AddSubjectTeacherDTO.java new file mode 100644 index 0000000..390debb --- /dev/null +++ b/src/main/java/com/meishu/dto/classes/AddSubjectTeacherDTO.java @@ -0,0 +1,14 @@ +package com.meishu.dto.classes; + +import lombok.Data; + +import java.util.List; + +@Data +public class AddSubjectTeacherDTO { + + private List<AddSubjectTeacherMappingDTO> addSubjectTeacherMappingDTOS; + + private Integer classId; + +} diff --git a/src/main/java/com/meishu/dto/classes/AddSubjectTeacherMappingDTO.java b/src/main/java/com/meishu/dto/classes/AddSubjectTeacherMappingDTO.java new file mode 100644 index 0000000..f563e18 --- /dev/null +++ b/src/main/java/com/meishu/dto/classes/AddSubjectTeacherMappingDTO.java @@ -0,0 +1,15 @@ +package com.meishu.dto.classes; + +import lombok.Data; + +import java.util.List; + +@Data +public class AddSubjectTeacherMappingDTO { + + private String subjectId; + + private List<Integer> teacherIds; + + +} diff --git a/src/main/java/com/meishu/dto/classes/BatchAddStudentToClassDTO.java b/src/main/java/com/meishu/dto/classes/BatchAddStudentToClassDTO.java new file mode 100644 index 0000000..f8b3ba1 --- /dev/null +++ b/src/main/java/com/meishu/dto/classes/BatchAddStudentToClassDTO.java @@ -0,0 +1,14 @@ +package com.meishu.dto.classes; + +import lombok.Data; + +import java.util.List; + +@Data +public class BatchAddStudentToClassDTO { + + private List<Integer> ids; + + private Integer classId; + +} diff --git a/src/main/java/com/meishu/dto/classes/BatchUpGradeDTO.java b/src/main/java/com/meishu/dto/classes/BatchUpGradeDTO.java new file mode 100644 index 0000000..253ee6e --- /dev/null +++ b/src/main/java/com/meishu/dto/classes/BatchUpGradeDTO.java @@ -0,0 +1,15 @@ +package com.meishu.dto.classes; + +import lombok.Data; + +import java.util.Date; +import java.util.List; + +@Data +public class BatchUpGradeDTO { + + private List<Integer> ids; + + private Date upgradeDate; + +} diff --git a/src/main/java/com/meishu/dto/classes/GetClassStudentsDTO.java b/src/main/java/com/meishu/dto/classes/GetClassStudentsDTO.java new file mode 100644 index 0000000..9a9ee98 --- /dev/null +++ b/src/main/java/com/meishu/dto/classes/GetClassStudentsDTO.java @@ -0,0 +1,16 @@ +package com.meishu.dto.classes; + +import lombok.Data; + +@Data +public class GetClassStudentsDTO { + + private Integer pageSize; + + private Integer pageNum; + + private Integer classId; + + private String userName; + +} diff --git a/src/main/java/com/meishu/dto/classes/GetClassesDTO.java b/src/main/java/com/meishu/dto/classes/GetClassesDTO.java new file mode 100644 index 0000000..d6d11e8 --- /dev/null +++ b/src/main/java/com/meishu/dto/classes/GetClassesDTO.java @@ -0,0 +1,20 @@ +package com.meishu.dto.classes; + +import lombok.Data; + +@Data +public class GetClassesDTO { + + private Integer pageNum; + + private Integer pageSize; + + private String className; + + private String grade; + + private String session; + + private String status; + +} diff --git a/src/main/java/com/meishu/dto/classes/QueryNoClassStudentsDTO.java b/src/main/java/com/meishu/dto/classes/QueryNoClassStudentsDTO.java new file mode 100644 index 0000000..7c7cf5b --- /dev/null +++ b/src/main/java/com/meishu/dto/classes/QueryNoClassStudentsDTO.java @@ -0,0 +1,14 @@ +package com.meishu.dto.classes; + +import lombok.Data; + +@Data +public class QueryNoClassStudentsDTO { + + private Integer pageSize; + + private Integer pageNum; + + private String userName; + +} diff --git a/src/main/java/com/meishu/dto/course/AddCourseDTO.java b/src/main/java/com/meishu/dto/course/AddCourseDTO.java new file mode 100644 index 0000000..5ed8383 --- /dev/null +++ b/src/main/java/com/meishu/dto/course/AddCourseDTO.java @@ -0,0 +1,13 @@ +package com.meishu.dto.course; + +import com.meishu.model.CourseDictDO; +import lombok.Data; + +import java.util.List; + +@Data +public class AddCourseDTO extends CourseDictDO { + + private List<Long> administerIds; + +} diff --git a/src/main/java/com/meishu/dto/course/AddCourseTreeNodeDTO.java b/src/main/java/com/meishu/dto/course/AddCourseTreeNodeDTO.java new file mode 100644 index 0000000..362925b --- /dev/null +++ b/src/main/java/com/meishu/dto/course/AddCourseTreeNodeDTO.java @@ -0,0 +1,16 @@ +package com.meishu.dto.course; + + +import com.meishu.model.CourseTreeDO; +import lombok.Data; + +import java.util.List; + +@Data +public class AddCourseTreeNodeDTO { + + private Long courseId; + + private List<Long> courseTreeDOS; + +} diff --git a/src/main/java/com/meishu/dto/course/AddStudentAuthenDTO.java b/src/main/java/com/meishu/dto/course/AddStudentAuthenDTO.java new file mode 100644 index 0000000..2caf633 --- /dev/null +++ b/src/main/java/com/meishu/dto/course/AddStudentAuthenDTO.java @@ -0,0 +1,20 @@ +package com.meishu.dto.course; + +import lombok.Data; + +import java.util.List; + +@Data +public class AddStudentAuthenDTO { + + private List<Long> ids; + + private String startDate; + + private String endDate; + + private Long courseId; + + private Long administerId; + +} diff --git a/src/main/java/com/meishu/dto/course/BatchVodOprDTO.java b/src/main/java/com/meishu/dto/course/BatchVodOprDTO.java new file mode 100644 index 0000000..d7b2953 --- /dev/null +++ b/src/main/java/com/meishu/dto/course/BatchVodOprDTO.java @@ -0,0 +1,14 @@ +package com.meishu.dto.course; + +import lombok.Data; + +import java.util.List; + +@Data +public class BatchVodOprDTO { + + private List<CourseVodDTO> ids; + + private String status; + +} diff --git a/src/main/java/com/meishu/dto/course/CourseProgressDTO.java b/src/main/java/com/meishu/dto/course/CourseProgressDTO.java new file mode 100644 index 0000000..a390de4 --- /dev/null +++ b/src/main/java/com/meishu/dto/course/CourseProgressDTO.java @@ -0,0 +1,18 @@ +package com.meishu.dto.course; + +import lombok.Data; + +@Data +public class CourseProgressDTO { + + private Long courseId; + + private Integer pageSize; + + private Integer pageNum; + + private Long campusId; + + private String username; + +} diff --git a/src/main/java/com/meishu/dto/course/CourseVodDTO.java b/src/main/java/com/meishu/dto/course/CourseVodDTO.java new file mode 100644 index 0000000..d32825d --- /dev/null +++ b/src/main/java/com/meishu/dto/course/CourseVodDTO.java @@ -0,0 +1,12 @@ +package com.meishu.dto.course; + +import lombok.Data; + +@Data +public class CourseVodDTO { + + private Long courseTreeId; + + private Long vodId; + +} diff --git a/src/main/java/com/meishu/dto/course/GetAllUnAuthenStudentsDTO.java b/src/main/java/com/meishu/dto/course/GetAllUnAuthenStudentsDTO.java new file mode 100644 index 0000000..ffca948 --- /dev/null +++ b/src/main/java/com/meishu/dto/course/GetAllUnAuthenStudentsDTO.java @@ -0,0 +1,18 @@ +package com.meishu.dto.course; + +import lombok.Data; + +@Data +public class GetAllUnAuthenStudentsDTO { + + private Integer pageSize; + + private Integer pageNum; + + private Long courseId; + + private String username; + + private String campus; + +} diff --git a/src/main/java/com/meishu/dto/course/GetCourseStudentsDTO.java b/src/main/java/com/meishu/dto/course/GetCourseStudentsDTO.java new file mode 100644 index 0000000..539d600 --- /dev/null +++ b/src/main/java/com/meishu/dto/course/GetCourseStudentsDTO.java @@ -0,0 +1,16 @@ +package com.meishu.dto.course; + +import lombok.Data; + +@Data +public class GetCourseStudentsDTO { + + private Integer pageSize; + + private Integer pageNum; + + private Long courseId; + + private String username; + +} diff --git a/src/main/java/com/meishu/dto/course/GetExercisesByTreeDTO.java b/src/main/java/com/meishu/dto/course/GetExercisesByTreeDTO.java new file mode 100644 index 0000000..d8507ce --- /dev/null +++ b/src/main/java/com/meishu/dto/course/GetExercisesByTreeDTO.java @@ -0,0 +1,14 @@ +package com.meishu.dto.course; + +import lombok.Data; + +import java.util.List; + +@Data +public class GetExercisesByTreeDTO { + + private Long treeId; + + private List<Long> exerciseIds; + +} diff --git a/src/main/java/com/meishu/dto/department/BatchOprDTO.java b/src/main/java/com/meishu/dto/department/BatchOprDTO.java new file mode 100644 index 0000000..1eba2b0 --- /dev/null +++ b/src/main/java/com/meishu/dto/department/BatchOprDTO.java @@ -0,0 +1,16 @@ +package com.meishu.dto.department; + +import lombok.Data; + +import java.util.List; + +@Data +public class BatchOprDTO { + + private List<Long> ids; + + private Long parentId; + + private Long departmentLeaderId; + +} diff --git a/src/main/java/com/meishu/dto/department/GetAllDepartmentVO.java b/src/main/java/com/meishu/dto/department/GetAllDepartmentVO.java new file mode 100644 index 0000000..93e39d5 --- /dev/null +++ b/src/main/java/com/meishu/dto/department/GetAllDepartmentVO.java @@ -0,0 +1,38 @@ +package com.meishu.dto.department; + +import com.meishu.model.AdministerDO; +import com.meishu.model.AdministerDepartmentMappingDO; +import lombok.Data; + +import java.util.List; + +@Data +public class GetAllDepartmentVO { + + private Long id; + + private String departmentName; + + private Long departmentLeaderId; + + private Long parentId; + + private String parentDepartmentName; + + private Long administerId; + + private String userName; + + private String img; + + private Integer count; + +// private Long administerDepartmentId; + + private List<AdministerDO> administerDOS; + + private List<AdministerDepartmentMappingDO> administerDepartmentMappingDOS; + + private List<GetAllDepartmentVO> children; + +} diff --git a/src/main/java/com/meishu/dto/department/GetTeachersDTO.java b/src/main/java/com/meishu/dto/department/GetTeachersDTO.java new file mode 100644 index 0000000..755e67b --- /dev/null +++ b/src/main/java/com/meishu/dto/department/GetTeachersDTO.java @@ -0,0 +1,20 @@ +package com.meishu.dto.department; + +import lombok.Data; + +@Data +public class GetTeachersDTO { + + private Integer pageSize; + + private Integer pageNum; + + private Long departmentId; + + private String userName; + + private Long campusId; + + private Long userId; + +} diff --git a/src/main/java/com/meishu/dto/dimension/AddStarDTO.java b/src/main/java/com/meishu/dto/dimension/AddStarDTO.java new file mode 100644 index 0000000..f6bdda5 --- /dev/null +++ b/src/main/java/com/meishu/dto/dimension/AddStarDTO.java @@ -0,0 +1,13 @@ +package com.meishu.dto.dimension; + +import com.meishu.model.SubjectDimensionStarDictDO; +import lombok.Data; + +import java.util.List; + +@Data +public class AddStarDTO extends SubjectDimensionStarDictDO { + + private List<Long> treeIds; + +} diff --git a/src/main/java/com/meishu/dto/dimension/DeleteStarByIdDTO.java b/src/main/java/com/meishu/dto/dimension/DeleteStarByIdDTO.java new file mode 100644 index 0000000..b51f994 --- /dev/null +++ b/src/main/java/com/meishu/dto/dimension/DeleteStarByIdDTO.java @@ -0,0 +1,12 @@ +package com.meishu.dto.dimension; + +import lombok.Data; + +import java.util.List; + +@Data +public class DeleteStarByIdDTO { + + private List<Long> ids; + +} diff --git a/src/main/java/com/meishu/dto/exercise/AddExerciseDTO.java b/src/main/java/com/meishu/dto/exercise/AddExerciseDTO.java new file mode 100644 index 0000000..f2dd668 --- /dev/null +++ b/src/main/java/com/meishu/dto/exercise/AddExerciseDTO.java @@ -0,0 +1,13 @@ +package com.meishu.dto.exercise; + +import com.meishu.model.ExerciseDictDO; +import lombok.Data; + +import java.util.List; + +@Data +public class AddExerciseDTO extends ExerciseDictDO { + + private List<Long> treeIds; + +} diff --git a/src/main/java/com/meishu/dto/exercise/CheckExerciseDTO.java b/src/main/java/com/meishu/dto/exercise/CheckExerciseDTO.java new file mode 100644 index 0000000..1efb139 --- /dev/null +++ b/src/main/java/com/meishu/dto/exercise/CheckExerciseDTO.java @@ -0,0 +1,13 @@ +package com.meishu.dto.exercise; + +import com.meishu.model.ExerciseDictDO; +import lombok.Data; + +import java.util.List; + +@Data +public class CheckExerciseDTO extends ExerciseDictDO { + + private List<Long> treeIds; + +} diff --git a/src/main/java/com/meishu/dto/exercise/ExeLatexExpressDTO.java b/src/main/java/com/meishu/dto/exercise/ExeLatexExpressDTO.java new file mode 100644 index 0000000..f877753 --- /dev/null +++ b/src/main/java/com/meishu/dto/exercise/ExeLatexExpressDTO.java @@ -0,0 +1,14 @@ +package com.meishu.dto.exercise; + +import lombok.Data; + +/** + * @author: tuyp + * @create: 2020-08-08 23:20 + */ +@Data +public class ExeLatexExpressDTO { + + private String latex; + +} diff --git a/src/main/java/com/meishu/dto/exercise/GetExerciseRequestDTO.java b/src/main/java/com/meishu/dto/exercise/GetExerciseRequestDTO.java new file mode 100644 index 0000000..5e903dc --- /dev/null +++ b/src/main/java/com/meishu/dto/exercise/GetExerciseRequestDTO.java @@ -0,0 +1,21 @@ +package com.meishu.dto.exercise; + +import com.meishu.model.ExerciseDictDO; +import lombok.Data; + +/** + * @author: tuyp + * @create: 2020-07-19 17:07 + */ +@Data +public class GetExerciseRequestDTO extends ExerciseDictDO { + + private Integer collectionStatus; + + private String school; + + private Integer userId; + + private Integer treeId; + +} diff --git a/src/main/java/com/meishu/dto/exercise/GetStatusVodsDTO.java b/src/main/java/com/meishu/dto/exercise/GetStatusVodsDTO.java new file mode 100644 index 0000000..dba1d2b --- /dev/null +++ b/src/main/java/com/meishu/dto/exercise/GetStatusVodsDTO.java @@ -0,0 +1,16 @@ +package com.meishu.dto.exercise; + +import lombok.Data; + +@Data +public class GetStatusVodsDTO { + + private Integer pageSize; + + private Integer pageNum; + + private String status; + + private Long treeId; + +} diff --git a/src/main/java/com/meishu/dto/exercise/GetTreeExercisesDTO.java b/src/main/java/com/meishu/dto/exercise/GetTreeExercisesDTO.java new file mode 100644 index 0000000..f1d0012 --- /dev/null +++ b/src/main/java/com/meishu/dto/exercise/GetTreeExercisesDTO.java @@ -0,0 +1,31 @@ +package com.meishu.dto.exercise; + +import lombok.Data; + +@Data +public class GetTreeExercisesDTO { + + private Integer pageSize; + + private Integer pageNum; + + private Long treeId; + + private String exerciseType; + + private Integer difficulty; + + private String title; + + private Long subjectId; + + private String status; + + private String shareStatus; + + private String checkStatus; + + private Long userId; + + +} diff --git a/src/main/java/com/meishu/dto/exercise/QueryCourseTreeExerciseDTO.java b/src/main/java/com/meishu/dto/exercise/QueryCourseTreeExerciseDTO.java new file mode 100644 index 0000000..451c629 --- /dev/null +++ b/src/main/java/com/meishu/dto/exercise/QueryCourseTreeExerciseDTO.java @@ -0,0 +1,22 @@ +package com.meishu.dto.exercise; + +import lombok.Data; + +@Data +public class QueryCourseTreeExerciseDTO { + + private Integer pageSize; + + private Integer pageNum; + + private String title; + + private Integer difficulty; + + private String exerciseType; + + private Long courseId; + + private Long courseTreeId; + +} diff --git a/src/main/java/com/meishu/dto/exercise/UpdateStatusDTO.java b/src/main/java/com/meishu/dto/exercise/UpdateStatusDTO.java new file mode 100644 index 0000000..0242cbd --- /dev/null +++ b/src/main/java/com/meishu/dto/exercise/UpdateStatusDTO.java @@ -0,0 +1,20 @@ +package com.meishu.dto.exercise; + +import lombok.Data; + +import java.util.List; + +@Data +public class UpdateStatusDTO { + + private List<Long> ids; + + private String status; + + private String startDate; + + private String endDate; + + private Long administerId; + +} diff --git a/src/main/java/com/meishu/dto/grade/AddGradeDTO.java b/src/main/java/com/meishu/dto/grade/AddGradeDTO.java new file mode 100644 index 0000000..0b63cca --- /dev/null +++ b/src/main/java/com/meishu/dto/grade/AddGradeDTO.java @@ -0,0 +1,24 @@ +package com.meishu.dto.grade; + +import com.meishu.model.SubjectTestGradeExampleMappingDO; +import com.meishu.model.SubjectTestGradeStarMappingDO; +import lombok.Data; + +import java.util.List; + +@Data +public class AddGradeDTO { + + private Long id; + + private String gradeName; + + private Long publishId; + + private String content; + + private List<String> subjectTestGradeExampleMappingDOS; + + private List<Long> subjectTestGradeStarMappingDOS; + +} diff --git a/src/main/java/com/meishu/dto/laboratory/LaboratoryDictDTO.java b/src/main/java/com/meishu/dto/laboratory/LaboratoryDictDTO.java new file mode 100644 index 0000000..dbb0070 --- /dev/null +++ b/src/main/java/com/meishu/dto/laboratory/LaboratoryDictDTO.java @@ -0,0 +1,18 @@ +package com.meishu.dto.laboratory; + +import lombok.Data; +import java.util.List; + +@Data +public class LaboratoryDictDTO { + + private Long id; + + private String laboratoryName; + + private String laboratoryType; + + private Integer maxNum; + + private List<Long> sessionDictId; +} diff --git a/src/main/java/com/meishu/dto/laboratory/LaboratoryPageDTO.java b/src/main/java/com/meishu/dto/laboratory/LaboratoryPageDTO.java new file mode 100644 index 0000000..11c9de9 --- /dev/null +++ b/src/main/java/com/meishu/dto/laboratory/LaboratoryPageDTO.java @@ -0,0 +1,15 @@ +package com.meishu.dto.laboratory; + +import lombok.Data; + +@Data +public class LaboratoryPageDTO { + + private String name; + + private String laboratoryType; + + private Integer pageNo; + + private Integer pageSize; +} diff --git a/src/main/java/com/meishu/dto/laboratorySession/CalendarStatusDTO.java b/src/main/java/com/meishu/dto/laboratorySession/CalendarStatusDTO.java new file mode 100644 index 0000000..d8d8e24 --- /dev/null +++ b/src/main/java/com/meishu/dto/laboratorySession/CalendarStatusDTO.java @@ -0,0 +1,9 @@ +package com.meishu.dto.laboratorySession; + +import lombok.Data; + +@Data +public class CalendarStatusDTO { + + private String selectDate; +} diff --git a/src/main/java/com/meishu/dto/laboratorySession/GetLaboratorySessionDTO.java b/src/main/java/com/meishu/dto/laboratorySession/GetLaboratorySessionDTO.java new file mode 100644 index 0000000..09b879b --- /dev/null +++ b/src/main/java/com/meishu/dto/laboratorySession/GetLaboratorySessionDTO.java @@ -0,0 +1,17 @@ +package com.meishu.dto.laboratorySession; + +import lombok.Data; + +import java.util.List; + +@Data +public class GetLaboratorySessionDTO { + + private Long studentId; + + private String startDate; + + private String laboratoryType; + + private List<Long> sessionsDictId; +} diff --git a/src/main/java/com/meishu/dto/laboratorySession/LaboratorySessionListDTO.java b/src/main/java/com/meishu/dto/laboratorySession/LaboratorySessionListDTO.java new file mode 100644 index 0000000..0021402 --- /dev/null +++ b/src/main/java/com/meishu/dto/laboratorySession/LaboratorySessionListDTO.java @@ -0,0 +1,9 @@ +package com.meishu.dto.laboratorySession; + +import lombok.Data; + +@Data +public class LaboratorySessionListDTO { + + private String startDate; +} \ No newline at end of file diff --git a/src/main/java/com/meishu/dto/laboratorySession/SetLaboratorySessionDTO.java b/src/main/java/com/meishu/dto/laboratorySession/SetLaboratorySessionDTO.java new file mode 100644 index 0000000..ed3ca68 --- /dev/null +++ b/src/main/java/com/meishu/dto/laboratorySession/SetLaboratorySessionDTO.java @@ -0,0 +1,23 @@ +package com.meishu.dto.laboratorySession; + +import lombok.Data; + +import java.util.List; + +@Data +public class SetLaboratorySessionDTO { + + private Long laboratoryDictId; + + private String laboratoryType; + + private String grade; + + private String startDate; + + private String registerStartDate; + + private String registerEndDate; + + private List<Long> sessionDictId; +} diff --git a/src/main/java/com/meishu/dto/laboratoryUser/ApplyDTO.java b/src/main/java/com/meishu/dto/laboratoryUser/ApplyDTO.java new file mode 100644 index 0000000..ef6b98a --- /dev/null +++ b/src/main/java/com/meishu/dto/laboratoryUser/ApplyDTO.java @@ -0,0 +1,11 @@ +package com.meishu.dto.laboratoryUser; + +import lombok.Data; + +@Data +public class ApplyDTO { + + private Long studentId; + + private Long laboratorySessionId; +} diff --git a/src/main/java/com/meishu/dto/laboratoryUser/LaboratoryUserPageDTO.java b/src/main/java/com/meishu/dto/laboratoryUser/LaboratoryUserPageDTO.java new file mode 100644 index 0000000..8459516 --- /dev/null +++ b/src/main/java/com/meishu/dto/laboratoryUser/LaboratoryUserPageDTO.java @@ -0,0 +1,15 @@ +package com.meishu.dto.laboratoryUser; + +import lombok.Data; + +@Data +public class LaboratoryUserPageDTO { + + private Long laboratorySessionId; + + private String startDate; + + private Integer pageNo; + + private Integer pageSize; +} diff --git a/src/main/java/com/meishu/dto/question/QueryQuestionsDTO.java b/src/main/java/com/meishu/dto/question/QueryQuestionsDTO.java new file mode 100644 index 0000000..0192166 --- /dev/null +++ b/src/main/java/com/meishu/dto/question/QueryQuestionsDTO.java @@ -0,0 +1,26 @@ +package com.meishu.dto.question; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.util.Date; + +@Data +public class QueryQuestionsDTO { + + private Integer pageSize; + + private Integer pageNum; + + + private String userName; + + @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") + private Date startDate; + + @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") + private Date endDate; + + private Integer subjectId; + +} diff --git a/src/main/java/com/meishu/dto/role/AddPermissionDTO.java b/src/main/java/com/meishu/dto/role/AddPermissionDTO.java new file mode 100644 index 0000000..334b699 --- /dev/null +++ b/src/main/java/com/meishu/dto/role/AddPermissionDTO.java @@ -0,0 +1,14 @@ +package com.meishu.dto.role; + +import lombok.Data; + +import java.util.List; + +@Data +public class AddPermissionDTO { + + private Long roleId; + + private List<Long> permissionIds; + +} diff --git a/src/main/java/com/meishu/dto/role/DeletePermissionDTO.java b/src/main/java/com/meishu/dto/role/DeletePermissionDTO.java new file mode 100644 index 0000000..e3abffc --- /dev/null +++ b/src/main/java/com/meishu/dto/role/DeletePermissionDTO.java @@ -0,0 +1,15 @@ +package com.meishu.dto.role; + + +import lombok.Data; + +import java.util.List; + +@Data +public class DeletePermissionDTO { + + private List<Long> roleIds; + + private Long permissionId; + +} diff --git a/src/main/java/com/meishu/dto/role/GetRoleTeachersDTO.java b/src/main/java/com/meishu/dto/role/GetRoleTeachersDTO.java new file mode 100644 index 0000000..89b869a --- /dev/null +++ b/src/main/java/com/meishu/dto/role/GetRoleTeachersDTO.java @@ -0,0 +1,16 @@ +package com.meishu.dto.role; + +import lombok.Data; + +@Data +public class GetRoleTeachersDTO { + + private String userName; + + private Long roleId; + + private Integer pageSize; + + private Integer pageNum; + +} diff --git a/src/main/java/com/meishu/dto/role/RoleTeacherDTO.java b/src/main/java/com/meishu/dto/role/RoleTeacherDTO.java new file mode 100644 index 0000000..5c0239f --- /dev/null +++ b/src/main/java/com/meishu/dto/role/RoleTeacherDTO.java @@ -0,0 +1,14 @@ +package com.meishu.dto.role; + +import lombok.Data; + +import java.util.List; + +@Data +public class RoleTeacherDTO { + + private List<Long> ids; + + private Long roleId; + +} diff --git a/src/main/java/com/meishu/dto/rule/GetAllRulesDTO.java b/src/main/java/com/meishu/dto/rule/GetAllRulesDTO.java new file mode 100644 index 0000000..21ca3ca --- /dev/null +++ b/src/main/java/com/meishu/dto/rule/GetAllRulesDTO.java @@ -0,0 +1,12 @@ +package com.meishu.dto.rule; + +import lombok.Data; + +@Data +public class GetAllRulesDTO { + + private Integer pageSize; + + private Integer pageNum; + +} diff --git a/src/main/java/com/meishu/dto/rule/GetRuleReportDTO.java b/src/main/java/com/meishu/dto/rule/GetRuleReportDTO.java new file mode 100644 index 0000000..c29ae0f --- /dev/null +++ b/src/main/java/com/meishu/dto/rule/GetRuleReportDTO.java @@ -0,0 +1,14 @@ +package com.meishu.dto.rule; + +import lombok.Data; + +@Data +public class GetRuleReportDTO { + + private Long ruleId; + + private Long campusId; + + private String ruleName; + +} diff --git a/src/main/java/com/meishu/dto/semester/GetSemesterScoreDTO.java b/src/main/java/com/meishu/dto/semester/GetSemesterScoreDTO.java new file mode 100644 index 0000000..7459c06 --- /dev/null +++ b/src/main/java/com/meishu/dto/semester/GetSemesterScoreDTO.java @@ -0,0 +1,24 @@ +package com.meishu.dto.semester; + +import lombok.Data; + +@Data +public class GetSemesterScoreDTO { + + private Integer pageSize; + + private Integer pageNum; + + private String userName; + + private String semester; + + private String subject; + + private String grade; + + private String classes; + + private String session; + +} diff --git a/src/main/java/com/meishu/dto/semester/GetStudentDetailDTO.java b/src/main/java/com/meishu/dto/semester/GetStudentDetailDTO.java new file mode 100644 index 0000000..74e1a4a --- /dev/null +++ b/src/main/java/com/meishu/dto/semester/GetStudentDetailDTO.java @@ -0,0 +1,16 @@ +package com.meishu.dto.semester; + +import lombok.Data; + +@Data +public class GetStudentDetailDTO { + + private Integer pageNum; + + private Integer pageSize; + + private Integer id; + + private Integer userId; + +} diff --git a/src/main/java/com/meishu/dto/semester/GetStudentRecordDTO.java b/src/main/java/com/meishu/dto/semester/GetStudentRecordDTO.java new file mode 100644 index 0000000..3f6c0ee --- /dev/null +++ b/src/main/java/com/meishu/dto/semester/GetStudentRecordDTO.java @@ -0,0 +1,12 @@ +package com.meishu.dto.semester; + +import lombok.Data; + +@Data +public class GetStudentRecordDTO { + + private String startDate; + + private String endDate; + +} diff --git a/src/main/java/com/meishu/dto/sessions/SessionsDictPageDTO.java b/src/main/java/com/meishu/dto/sessions/SessionsDictPageDTO.java new file mode 100644 index 0000000..e74af48 --- /dev/null +++ b/src/main/java/com/meishu/dto/sessions/SessionsDictPageDTO.java @@ -0,0 +1,11 @@ +package com.meishu.dto.sessions; + +import lombok.Data; + +@Data +public class SessionsDictPageDTO { + + private Integer pageNo; + + private Integer pageSize; +} diff --git a/src/main/java/com/meishu/dto/sign/ClassSignInDTO.java b/src/main/java/com/meishu/dto/sign/ClassSignInDTO.java new file mode 100644 index 0000000..5760c01 --- /dev/null +++ b/src/main/java/com/meishu/dto/sign/ClassSignInDTO.java @@ -0,0 +1,22 @@ +package com.meishu.dto.sign; + +import lombok.Data; + +import java.util.Date; + +@Data +public class ClassSignInDTO { + + private Integer pageSize; + + private Integer pageNum; + + private Integer classId; + + private String userName; + + private Date startDate; + + private Date endDate; + +} diff --git a/src/main/java/com/meishu/dto/sms/SendVerifyCodeDTO.java b/src/main/java/com/meishu/dto/sms/SendVerifyCodeDTO.java new file mode 100644 index 0000000..47f80d0 --- /dev/null +++ b/src/main/java/com/meishu/dto/sms/SendVerifyCodeDTO.java @@ -0,0 +1,9 @@ +package com.meishu.dto.sms; + +import lombok.Data; + +@Data +public class SendVerifyCodeDTO { + + private String phone; +} diff --git a/src/main/java/com/meishu/dto/sms/VerifyCodeDTO.java b/src/main/java/com/meishu/dto/sms/VerifyCodeDTO.java new file mode 100644 index 0000000..d65a2e5 --- /dev/null +++ b/src/main/java/com/meishu/dto/sms/VerifyCodeDTO.java @@ -0,0 +1,11 @@ +package com.meishu.dto.sms; + +import lombok.Data; + +@Data +public class VerifyCodeDTO { + + private String phone; + + private String verifyCode; +} diff --git a/src/main/java/com/meishu/dto/student/DeleteStudentDTO.java b/src/main/java/com/meishu/dto/student/DeleteStudentDTO.java new file mode 100644 index 0000000..4fce943 --- /dev/null +++ b/src/main/java/com/meishu/dto/student/DeleteStudentDTO.java @@ -0,0 +1,13 @@ +package com.meishu.dto.student; + + +import lombok.Data; + +import java.util.List; + +@Data +public class DeleteStudentDTO { + + private List<Long> ids; + +} diff --git a/src/main/java/com/meishu/dto/student/GetChildTreesDTO.java b/src/main/java/com/meishu/dto/student/GetChildTreesDTO.java new file mode 100644 index 0000000..0e2e9e3 --- /dev/null +++ b/src/main/java/com/meishu/dto/student/GetChildTreesDTO.java @@ -0,0 +1,12 @@ +package com.meishu.dto.student; + +import lombok.Data; + +@Data +public class GetChildTreesDTO { + + private Long studentId; + + private Long courseTreeId; + +} diff --git a/src/main/java/com/meishu/dto/student/GetStudentRulesDTO.java b/src/main/java/com/meishu/dto/student/GetStudentRulesDTO.java new file mode 100644 index 0000000..ffd48f2 --- /dev/null +++ b/src/main/java/com/meishu/dto/student/GetStudentRulesDTO.java @@ -0,0 +1,12 @@ +package com.meishu.dto.student; + +import lombok.Data; + +@Data +public class GetStudentRulesDTO { + + private Long id; + + private Long subjectId; + +} diff --git a/src/main/java/com/meishu/dto/student/GetStudyProgressDTO.java b/src/main/java/com/meishu/dto/student/GetStudyProgressDTO.java new file mode 100644 index 0000000..051a189 --- /dev/null +++ b/src/main/java/com/meishu/dto/student/GetStudyProgressDTO.java @@ -0,0 +1,12 @@ +package com.meishu.dto.student; + +import lombok.Data; + +@Data +public class GetStudyProgressDTO { + + private Long studentId; + + private Long chapterId; + +} diff --git a/src/main/java/com/meishu/dto/student/GetVodIndexDTO.java b/src/main/java/com/meishu/dto/student/GetVodIndexDTO.java new file mode 100644 index 0000000..e72eac0 --- /dev/null +++ b/src/main/java/com/meishu/dto/student/GetVodIndexDTO.java @@ -0,0 +1,14 @@ +package com.meishu.dto.student; + +import lombok.Data; + +@Data +public class GetVodIndexDTO { + + private Long studentId; + + private Long treeId; + + private Long chapterId; + +} diff --git a/src/main/java/com/meishu/dto/student/SearchVodsDTO.java b/src/main/java/com/meishu/dto/student/SearchVodsDTO.java new file mode 100644 index 0000000..2245124 --- /dev/null +++ b/src/main/java/com/meishu/dto/student/SearchVodsDTO.java @@ -0,0 +1,13 @@ +package com.meishu.dto.student; + +import lombok.Data; + +@Data +public class SearchVodsDTO { + + private String treeName; + + private Long courseId; + + private Long studentId; +} diff --git a/src/main/java/com/meishu/dto/student/SubmitTestDTO.java b/src/main/java/com/meishu/dto/student/SubmitTestDTO.java new file mode 100644 index 0000000..d5db469 --- /dev/null +++ b/src/main/java/com/meishu/dto/student/SubmitTestDTO.java @@ -0,0 +1,17 @@ +package com.meishu.dto.student; + +import com.meishu.model.CourseTreeExerciseStudentResultDO; +import lombok.Data; + +import java.util.List; + +@Data +public class SubmitTestDTO { + + private Long studentId; + + private Long chapterId; + + private List<CourseTreeExerciseStudentResultDO> courseTreeExerciseStudentResultDOS; + +} diff --git a/src/main/java/com/meishu/dto/subject/BatchStatusOprDTO.java b/src/main/java/com/meishu/dto/subject/BatchStatusOprDTO.java new file mode 100644 index 0000000..138729e --- /dev/null +++ b/src/main/java/com/meishu/dto/subject/BatchStatusOprDTO.java @@ -0,0 +1,16 @@ +package com.meishu.dto.subject; + +import lombok.Data; + +import java.util.List; + +@Data +public class BatchStatusOprDTO { + + private List<Long> ids; + + private String status; + + private String isShow; + +} diff --git a/src/main/java/com/meishu/dto/subject/GetAllVodsStatusDTO.java b/src/main/java/com/meishu/dto/subject/GetAllVodsStatusDTO.java new file mode 100644 index 0000000..970abd7 --- /dev/null +++ b/src/main/java/com/meishu/dto/subject/GetAllVodsStatusDTO.java @@ -0,0 +1,19 @@ +package com.meishu.dto.subject; + +import lombok.Data; + +@Data +public class GetAllVodsStatusDTO { + + private Integer pageSize; + + private Integer pageNum; + + private String vodType; + + private Long treeId; + + private String status; + + +} diff --git a/src/main/java/com/meishu/dto/subject/GetSubjectAdministerDTO.java b/src/main/java/com/meishu/dto/subject/GetSubjectAdministerDTO.java new file mode 100644 index 0000000..53adae5 --- /dev/null +++ b/src/main/java/com/meishu/dto/subject/GetSubjectAdministerDTO.java @@ -0,0 +1,12 @@ +package com.meishu.dto.subject; + +import lombok.Data; + +@Data +public class GetSubjectAdministerDTO { + + private Long subjectId; + + private String userName; + +} diff --git a/src/main/java/com/meishu/dto/subject/GetSubjectTreeDTO.java b/src/main/java/com/meishu/dto/subject/GetSubjectTreeDTO.java new file mode 100644 index 0000000..9c5186c --- /dev/null +++ b/src/main/java/com/meishu/dto/subject/GetSubjectTreeDTO.java @@ -0,0 +1,14 @@ +package com.meishu.dto.subject; + +import lombok.Data; + +@Data +public class GetSubjectTreeDTO { + + private Long userId; + + private Long subjectId; + + private String shareStatus; + +} diff --git a/src/main/java/com/meishu/dto/subject/GetSubjectsDTO.java b/src/main/java/com/meishu/dto/subject/GetSubjectsDTO.java new file mode 100644 index 0000000..036cb97 --- /dev/null +++ b/src/main/java/com/meishu/dto/subject/GetSubjectsDTO.java @@ -0,0 +1,17 @@ +package com.meishu.dto.subject; + +import lombok.Data; + +@Data +public class GetSubjectsDTO { + + private Integer pageSize; + + private Integer pageNum; + + private String subjectName; + + private String subjectType; + + private Long userId; +} diff --git a/src/main/java/com/meishu/dto/subject/UpdateTreeOrderDTO.java b/src/main/java/com/meishu/dto/subject/UpdateTreeOrderDTO.java new file mode 100644 index 0000000..0da8c10 --- /dev/null +++ b/src/main/java/com/meishu/dto/subject/UpdateTreeOrderDTO.java @@ -0,0 +1,16 @@ +package com.meishu.dto.subject; + +import lombok.Data; + +import java.util.List; + +@Data +public class UpdateTreeOrderDTO { + + private List<Long> ids; + + private Long parentId; + + private String treeName; + +} diff --git a/src/main/java/com/meishu/dto/task/ClassDoneInfoDTO.java b/src/main/java/com/meishu/dto/task/ClassDoneInfoDTO.java new file mode 100644 index 0000000..ea321d1 --- /dev/null +++ b/src/main/java/com/meishu/dto/task/ClassDoneInfoDTO.java @@ -0,0 +1,16 @@ +package com.meishu.dto.task; + +import lombok.Data; + +@Data +public class ClassDoneInfoDTO { + + private Integer taskId; + + private Integer treeId; + + private String subject; + + private Integer exerciseType; + +} diff --git a/src/main/java/com/meishu/dto/task/ExeRightRatioDTO.java b/src/main/java/com/meishu/dto/task/ExeRightRatioDTO.java new file mode 100644 index 0000000..fbd7ceb --- /dev/null +++ b/src/main/java/com/meishu/dto/task/ExeRightRatioDTO.java @@ -0,0 +1,18 @@ +package com.meishu.dto.task; + +import lombok.Data; + +@Data +public class ExeRightRatioDTO { + + //private Integer subjectId; + + private Integer taskId; + + private Integer treeId; + + private Integer userId; + + private Integer exerciseType; + +} diff --git a/src/main/java/com/meishu/dto/task/ExesDoneInfoPO.java b/src/main/java/com/meishu/dto/task/ExesDoneInfoPO.java new file mode 100644 index 0000000..fe940f6 --- /dev/null +++ b/src/main/java/com/meishu/dto/task/ExesDoneInfoPO.java @@ -0,0 +1,14 @@ +package com.meishu.dto.task; + +import lombok.Data; + +import java.util.List; + +@Data +public class ExesDoneInfoPO { + + private List<String> exeIds; + + private String subject; + +} diff --git a/src/main/java/com/meishu/dto/task/GetClassStudentsDTO.java b/src/main/java/com/meishu/dto/task/GetClassStudentsDTO.java new file mode 100644 index 0000000..e4d6747 --- /dev/null +++ b/src/main/java/com/meishu/dto/task/GetClassStudentsDTO.java @@ -0,0 +1,12 @@ +package com.meishu.dto.task; + +import lombok.Data; + +import java.util.List; + +@Data +public class GetClassStudentsDTO { + + private List<Integer> ids; + +} diff --git a/src/main/java/com/meishu/dto/task/GetClassesRequestVO.java b/src/main/java/com/meishu/dto/task/GetClassesRequestVO.java new file mode 100644 index 0000000..a5a7cfe --- /dev/null +++ b/src/main/java/com/meishu/dto/task/GetClassesRequestVO.java @@ -0,0 +1,20 @@ +package com.meishu.dto.task; + +import lombok.Data; + +/** + * @author: tuyp + * @create: 2020-06-22 18:18 + */ +@Data +public class GetClassesRequestVO { + + private Integer userId; + + private String status; + + private String subject; + + private String subjectType; + +} diff --git a/src/main/java/com/meishu/dto/task/GetRecommendExeByTreeIdVO.java b/src/main/java/com/meishu/dto/task/GetRecommendExeByTreeIdVO.java new file mode 100644 index 0000000..886d0b2 --- /dev/null +++ b/src/main/java/com/meishu/dto/task/GetRecommendExeByTreeIdVO.java @@ -0,0 +1,16 @@ +package com.meishu.dto.task; + +import lombok.Data; + +/** + * @author: tuyp + * @create: 2020-07-23 17:50 + */ +@Data +public class GetRecommendExeByTreeIdVO { + + private String treeIds; + + private String school; + +} diff --git a/src/main/java/com/meishu/dto/task/GetRecommendVodByTreeIdVO.java b/src/main/java/com/meishu/dto/task/GetRecommendVodByTreeIdVO.java new file mode 100644 index 0000000..ac0bfe0 --- /dev/null +++ b/src/main/java/com/meishu/dto/task/GetRecommendVodByTreeIdVO.java @@ -0,0 +1,20 @@ +package com.meishu.dto.task; + +import lombok.Data; + +import java.util.List; + +/** + * @author: tuyp + * @create: 2020-07-23 14:13 + */ +@Data +public class GetRecommendVodByTreeIdVO { + + private String treeIds; + + private String school; + + private List<Integer> treeIdInteger; + +} diff --git a/src/main/java/com/meishu/dto/task/GetTaskByIdRequestDTO.java b/src/main/java/com/meishu/dto/task/GetTaskByIdRequestDTO.java new file mode 100644 index 0000000..d281d31 --- /dev/null +++ b/src/main/java/com/meishu/dto/task/GetTaskByIdRequestDTO.java @@ -0,0 +1,39 @@ +package com.meishu.dto.task; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.util.Date; + +/** + * @author: tuyp + * @create: 2020-07-21 11:45 + */ +@Data +public class GetTaskByIdRequestDTO { + + private Integer pageSize; + + private Integer pageNum; + + private Integer subjectId; + + private Integer classId; + + private String treeId; + + @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") + private Date startDate; + + @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") + private Date endDate; + + private Integer teacherId; + + private Integer taskType; + + private Date currentDate; + + private String subjectEn; + +} diff --git a/src/main/java/com/meishu/dto/task/GetUserVodPlayDTO.java b/src/main/java/com/meishu/dto/task/GetUserVodPlayDTO.java new file mode 100644 index 0000000..6f040f8 --- /dev/null +++ b/src/main/java/com/meishu/dto/task/GetUserVodPlayDTO.java @@ -0,0 +1,28 @@ +package com.meishu.dto.task; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.util.Date; + +/** + * @author: tuyp + * @create: 2020-07-23 11:50 + */ +@Data +public class GetUserVodPlayDTO { + + private Integer treeId; + + @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") + private Date taskDate; + + private Integer classesId; + + private String subject; + + private Integer vodId; + + private Integer taskId; + +} diff --git a/src/main/java/com/meishu/dto/task/PerStudentExesDTO.java b/src/main/java/com/meishu/dto/task/PerStudentExesDTO.java new file mode 100644 index 0000000..8c312a4 --- /dev/null +++ b/src/main/java/com/meishu/dto/task/PerStudentExesDTO.java @@ -0,0 +1,26 @@ +package com.meishu.dto.task; + +import lombok.Data; + +import java.util.List; + +/** + * @author: tuyp + * @create: 2020-07-23 15:41 + */ +@Data +public class PerStudentExesDTO { + + private Integer taskId; + + private Integer treeId; + + private Integer subjectId; + + private List<String> userIds; + + private Integer classesId; + + private String subject; + +} diff --git a/src/main/java/com/meishu/dto/task/PerStudentExesRequestVO.java b/src/main/java/com/meishu/dto/task/PerStudentExesRequestVO.java new file mode 100644 index 0000000..ed727d3 --- /dev/null +++ b/src/main/java/com/meishu/dto/task/PerStudentExesRequestVO.java @@ -0,0 +1,26 @@ +package com.meishu.dto.task; + +import lombok.Data; + +import java.util.List; + +/** + * @author: tuyp + * @create: 2020-07-23 15:41 + */ +@Data +public class PerStudentExesRequestVO { + + private Integer taskId; + + private Integer treeId; + + private Integer subjectId; + + private List<String> userIds; + + private Integer classesId; + + private String subject; + +} diff --git a/src/main/java/com/meishu/dto/task/QueryTaskDetailDTO.java b/src/main/java/com/meishu/dto/task/QueryTaskDetailDTO.java new file mode 100644 index 0000000..b81f30b --- /dev/null +++ b/src/main/java/com/meishu/dto/task/QueryTaskDetailDTO.java @@ -0,0 +1,17 @@ +package com.meishu.dto.task; + +import lombok.Data; + + +/** + * @author: tuyp + * @create: 2020-06-28 10:53 + */ +@Data +public class QueryTaskDetailDTO { + + private Integer id; + + private String subject; + +} diff --git a/src/main/java/com/meishu/dto/task/StudentDoneInfoRequestVO.java b/src/main/java/com/meishu/dto/task/StudentDoneInfoRequestVO.java new file mode 100644 index 0000000..cfdb23d --- /dev/null +++ b/src/main/java/com/meishu/dto/task/StudentDoneInfoRequestVO.java @@ -0,0 +1,22 @@ +package com.meishu.dto.task; + +import lombok.Data; + +/** + * @author: tuyp + * @create: 2020-07-23 18:37 + */ +@Data +public class StudentDoneInfoRequestVO { + + private Integer userId; + + private Integer taskId; + + private String treeId; + + //private Integer subjectId; + + //private String subject; + +} diff --git a/src/main/java/com/meishu/dto/test/CommentDTO.java b/src/main/java/com/meishu/dto/test/CommentDTO.java new file mode 100644 index 0000000..9b42292 --- /dev/null +++ b/src/main/java/com/meishu/dto/test/CommentDTO.java @@ -0,0 +1,13 @@ +package com.meishu.dto.test; + +import com.meishu.model.SubjectStudentAnswerStarDO; +import lombok.Data; + +import java.util.List; + +@Data +public class CommentDTO { + + List<SubjectStudentAnswerStarDO> subjectStudentAnswerStarDOS; + +} diff --git a/src/main/java/com/meishu/dto/test/GetAllTestDTO.java b/src/main/java/com/meishu/dto/test/GetAllTestDTO.java new file mode 100644 index 0000000..9f34d03 --- /dev/null +++ b/src/main/java/com/meishu/dto/test/GetAllTestDTO.java @@ -0,0 +1,18 @@ +package com.meishu.dto.test; + +import lombok.Data; + +@Data +public class GetAllTestDTO { + + private Integer pageSize; + + private Integer pageNum; + + private Long ruleId; + + private Long campusId; + + private String testName; + +} diff --git a/src/main/java/com/meishu/dto/test/GetOnePublishDTO.java b/src/main/java/com/meishu/dto/test/GetOnePublishDTO.java new file mode 100644 index 0000000..087fc6c --- /dev/null +++ b/src/main/java/com/meishu/dto/test/GetOnePublishDTO.java @@ -0,0 +1,18 @@ +package com.meishu.dto.test; + +import lombok.Data; + +@Data +public class GetOnePublishDTO { + + private Integer pageSize; + + private Integer pageNum; + + private String commentStatus; + + private String userName; + + private Long id; + +} diff --git a/src/main/java/com/meishu/dto/test/GetPublishHistoryDTO.java b/src/main/java/com/meishu/dto/test/GetPublishHistoryDTO.java new file mode 100644 index 0000000..6ff7009 --- /dev/null +++ b/src/main/java/com/meishu/dto/test/GetPublishHistoryDTO.java @@ -0,0 +1,18 @@ +package com.meishu.dto.test; + +import lombok.Data; + +@Data +public class GetPublishHistoryDTO { + + private Long ruleId; + + private Long campusId; + + private String publishName; + + private Integer pageSize; + + private Integer pageNum; + +} diff --git a/src/main/java/com/meishu/dto/test/GetTestReportDTO.java b/src/main/java/com/meishu/dto/test/GetTestReportDTO.java new file mode 100644 index 0000000..bf5bb29 --- /dev/null +++ b/src/main/java/com/meishu/dto/test/GetTestReportDTO.java @@ -0,0 +1,16 @@ +package com.meishu.dto.test; + +import lombok.Data; + +@Data +public class GetTestReportDTO { + + private Integer pageSize; + + private Integer pageNum; + + private String publishName; + + private Long ruleId; + +} diff --git a/src/main/java/com/meishu/dto/test/PublishTestDTO.java b/src/main/java/com/meishu/dto/test/PublishTestDTO.java new file mode 100644 index 0000000..3786a7f --- /dev/null +++ b/src/main/java/com/meishu/dto/test/PublishTestDTO.java @@ -0,0 +1,26 @@ +package com.meishu.dto.test; + +import lombok.Data; + +import java.util.List; + +@Data +public class PublishTestDTO { + + private Long publishId; + + private Long testId; + + private String testTime; + + private String publishName; + + private String outline; + + private String coverPage; + + private List<Long> studentIds; + + + +} diff --git a/src/main/java/com/meishu/dto/token/GetAllStudentsDTO.java b/src/main/java/com/meishu/dto/token/GetAllStudentsDTO.java new file mode 100644 index 0000000..ca099bf --- /dev/null +++ b/src/main/java/com/meishu/dto/token/GetAllStudentsDTO.java @@ -0,0 +1,13 @@ +package com.meishu.dto.token; + +import com.meishu.model.UserRoleDO; +import lombok.Data; + +@Data +public class GetAllStudentsDTO extends UserRoleDO { + + private String uuid; + + private String uuidSecret; + +} diff --git a/src/main/java/com/meishu/dto/token/GetAllTeachersDTO.java b/src/main/java/com/meishu/dto/token/GetAllTeachersDTO.java new file mode 100644 index 0000000..29614e6 --- /dev/null +++ b/src/main/java/com/meishu/dto/token/GetAllTeachersDTO.java @@ -0,0 +1,15 @@ +package com.meishu.dto.token; + +import com.meishu.model.AdministerDO; +import com.meishu.model.UserRoleDO; +import lombok.Data; + +@Data +public class GetAllTeachersDTO extends AdministerDO { + + private String uuid; + + private String uuidSecret; + + +} diff --git a/src/main/java/com/meishu/dto/userrole/AccountLoginDTO.java b/src/main/java/com/meishu/dto/userrole/AccountLoginDTO.java new file mode 100644 index 0000000..1327125 --- /dev/null +++ b/src/main/java/com/meishu/dto/userrole/AccountLoginDTO.java @@ -0,0 +1,11 @@ +package com.meishu.dto.userrole; + +import lombok.Data; + +@Data +public class AccountLoginDTO { + + private String idCard; + + private String password; +} diff --git a/src/main/java/com/meishu/dto/userrole/AddStudentsDTO.java b/src/main/java/com/meishu/dto/userrole/AddStudentsDTO.java new file mode 100644 index 0000000..b5b0ecd --- /dev/null +++ b/src/main/java/com/meishu/dto/userrole/AddStudentsDTO.java @@ -0,0 +1,22 @@ +package com.meishu.dto.userrole; + +import lombok.Data; + +@Data +public class AddStudentsDTO { + + private String userName; + + private String studyCode; + + private String phone; + + private String idCard; + + private String session; + + private String gender; + + private String email; + +} diff --git a/src/main/java/com/meishu/dto/userrole/QueryStudentsDTO.java b/src/main/java/com/meishu/dto/userrole/QueryStudentsDTO.java new file mode 100644 index 0000000..909b6fc --- /dev/null +++ b/src/main/java/com/meishu/dto/userrole/QueryStudentsDTO.java @@ -0,0 +1,20 @@ +package com.meishu.dto.userrole; + +import lombok.Data; + +@Data +public class QueryStudentsDTO { + + private Integer pageSize; + + private Integer pageNum; + + private String userName; + + private String session; + + private String grade; + + private String userStatus; + +} diff --git a/src/main/java/com/meishu/dto/voddict/CheckVodDTO.java b/src/main/java/com/meishu/dto/voddict/CheckVodDTO.java new file mode 100644 index 0000000..646cddf --- /dev/null +++ b/src/main/java/com/meishu/dto/voddict/CheckVodDTO.java @@ -0,0 +1,13 @@ +package com.meishu.dto.voddict; + +import com.meishu.model.VodDictDO; +import lombok.Data; + +import java.util.List; + +@Data +public class CheckVodDTO extends VodDictDO { + + private List<Long> treeIds; + +} diff --git a/src/main/java/com/meishu/dto/voddict/DeleteOriginVodDTO.java b/src/main/java/com/meishu/dto/voddict/DeleteOriginVodDTO.java new file mode 100644 index 0000000..f77c5e1 --- /dev/null +++ b/src/main/java/com/meishu/dto/voddict/DeleteOriginVodDTO.java @@ -0,0 +1,17 @@ +package com.meishu.dto.voddict; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; + +import java.util.List; + +@Data +public class DeleteOriginVodDTO { + + @JsonProperty + private String EventType; + + @JsonProperty + private ProcedureStateChangeEvent ProcedureStateChangeEvent; + +} diff --git a/src/main/java/com/meishu/dto/voddict/GetToCheckVodCountsDTO.java b/src/main/java/com/meishu/dto/voddict/GetToCheckVodCountsDTO.java new file mode 100644 index 0000000..709e64d --- /dev/null +++ b/src/main/java/com/meishu/dto/voddict/GetToCheckVodCountsDTO.java @@ -0,0 +1,12 @@ +package com.meishu.dto.voddict; + +import lombok.Data; + +@Data +public class GetToCheckVodCountsDTO { + + private Long subjectId; + +// private String checkStatus; + +} diff --git a/src/main/java/com/meishu/dto/voddict/GetTreeVodsDTO.java b/src/main/java/com/meishu/dto/voddict/GetTreeVodsDTO.java new file mode 100644 index 0000000..6b6263c --- /dev/null +++ b/src/main/java/com/meishu/dto/voddict/GetTreeVodsDTO.java @@ -0,0 +1,28 @@ +package com.meishu.dto.voddict; + +import lombok.Data; + +@Data +public class GetTreeVodsDTO { + + private Integer pageSize; + + private Integer pageNum; + + private String vodType; + + private String vodName; + + private Long treeId; + + private Long subjectId; + + private String status; + + private String shareStatus; + + private Long userId; + + private String checkStatus; + +} diff --git a/src/main/java/com/meishu/dto/voddict/MediaProcessResultSet.java b/src/main/java/com/meishu/dto/voddict/MediaProcessResultSet.java new file mode 100644 index 0000000..fb0ec06 --- /dev/null +++ b/src/main/java/com/meishu/dto/voddict/MediaProcessResultSet.java @@ -0,0 +1,12 @@ +package com.meishu.dto.voddict; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; + +@Data +public class MediaProcessResultSet { + + @JsonProperty + private TranscodeTask TranscodeTask; + +} diff --git a/src/main/java/com/meishu/dto/voddict/Output.java b/src/main/java/com/meishu/dto/voddict/Output.java new file mode 100644 index 0000000..6100af7 --- /dev/null +++ b/src/main/java/com/meishu/dto/voddict/Output.java @@ -0,0 +1,12 @@ +package com.meishu.dto.voddict; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; + +@Data +public class Output { + + @JsonProperty + private String Url; + +} diff --git a/src/main/java/com/meishu/dto/voddict/ProcedureStateChangeEvent.java b/src/main/java/com/meishu/dto/voddict/ProcedureStateChangeEvent.java new file mode 100644 index 0000000..06112e1 --- /dev/null +++ b/src/main/java/com/meishu/dto/voddict/ProcedureStateChangeEvent.java @@ -0,0 +1,16 @@ +package com.meishu.dto.voddict; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; + +import java.util.List; + +@Data +public class ProcedureStateChangeEvent { + + @JsonProperty + private String FileId; + + @JsonProperty + private List<MediaProcessResultSet> MediaProcessResultSet; +} diff --git a/src/main/java/com/meishu/dto/voddict/PublicCheckingDTO.java b/src/main/java/com/meishu/dto/voddict/PublicCheckingDTO.java new file mode 100644 index 0000000..f9f72b7 --- /dev/null +++ b/src/main/java/com/meishu/dto/voddict/PublicCheckingDTO.java @@ -0,0 +1,18 @@ +package com.meishu.dto.voddict; + +import lombok.Data; + +@Data +public class PublicCheckingDTO { + + private Long userId; + + private String shareStatus; + + private Integer pageSize; + + private Integer pageNum; + + private Integer checkStatus; + +} diff --git a/src/main/java/com/meishu/dto/voddict/TranscodeTask.java b/src/main/java/com/meishu/dto/voddict/TranscodeTask.java new file mode 100644 index 0000000..46ff3ed --- /dev/null +++ b/src/main/java/com/meishu/dto/voddict/TranscodeTask.java @@ -0,0 +1,12 @@ +package com.meishu.dto.voddict; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; + +@Data +public class TranscodeTask { + + @JsonProperty + private Output Output; + +} diff --git a/src/main/java/com/meishu/dto/voddict/UploadVodsDTO.java b/src/main/java/com/meishu/dto/voddict/UploadVodsDTO.java new file mode 100644 index 0000000..1b9c21e --- /dev/null +++ b/src/main/java/com/meishu/dto/voddict/UploadVodsDTO.java @@ -0,0 +1,14 @@ +package com.meishu.dto.voddict; + +import com.meishu.model.VodDictDO; +import lombok.Data; + +import java.util.List; + +@Data +public class UploadVodsDTO extends VodDictDO { + + private List<Long> treeIds; + + +} diff --git a/src/main/java/com/meishu/dto/wechat/AuthenRequestDTO.java b/src/main/java/com/meishu/dto/wechat/AuthenRequestDTO.java new file mode 100644 index 0000000..3ac523e --- /dev/null +++ b/src/main/java/com/meishu/dto/wechat/AuthenRequestDTO.java @@ -0,0 +1,15 @@ +package com.meishu.dto.wechat; + +import lombok.Data; + +@Data +public class AuthenRequestDTO { + + private String code; + + private String phone; + + private String openId; + + +} diff --git a/src/main/java/com/meishu/dto/wechat/InviteDTO.java b/src/main/java/com/meishu/dto/wechat/InviteDTO.java new file mode 100644 index 0000000..02fafda --- /dev/null +++ b/src/main/java/com/meishu/dto/wechat/InviteDTO.java @@ -0,0 +1,10 @@ +package com.meishu.dto.wechat; + +import lombok.Data; + +@Data +public class InviteDTO { + + private String userId; + +} diff --git a/src/main/java/com/meishu/dto/wechat/JsSdkDTO.java b/src/main/java/com/meishu/dto/wechat/JsSdkDTO.java new file mode 100644 index 0000000..5312889 --- /dev/null +++ b/src/main/java/com/meishu/dto/wechat/JsSdkDTO.java @@ -0,0 +1,17 @@ +package com.meishu.dto.wechat; + +import lombok.Data; + +@Data +public class JsSdkDTO { + + private String errcode; + + private String errmsg; + + private String ticket; + + private String expires_in; + + +} diff --git a/src/main/java/com/meishu/dto/wechat/PushMsgVO.java b/src/main/java/com/meishu/dto/wechat/PushMsgVO.java new file mode 100644 index 0000000..eb0732c --- /dev/null +++ b/src/main/java/com/meishu/dto/wechat/PushMsgVO.java @@ -0,0 +1,15 @@ +package com.meishu.dto.wechat; + +import lombok.Data; + +@Data +public class PushMsgVO { + + private Integer errcode; + + private String errmsg; + + private Integer msgId; + + +} diff --git a/src/main/java/com/meishu/dto/wechat/SignDTO.java b/src/main/java/com/meishu/dto/wechat/SignDTO.java new file mode 100644 index 0000000..400c785 --- /dev/null +++ b/src/main/java/com/meishu/dto/wechat/SignDTO.java @@ -0,0 +1,26 @@ +package com.meishu.dto.wechat; + + +import lombok.Data; + +@Data +public class SignDTO { + + private String access_token; + + private String noncestr; + + private String jsapi_ticket; + + private String timestamp; + + private String url; + + private String sign; + + private String code; + + private String appId; + + private String agentId; +} diff --git a/src/main/java/com/meishu/dto/wechat/WechatInviteDTO.java b/src/main/java/com/meishu/dto/wechat/WechatInviteDTO.java new file mode 100644 index 0000000..c89a483 --- /dev/null +++ b/src/main/java/com/meishu/dto/wechat/WechatInviteDTO.java @@ -0,0 +1,16 @@ +package com.meishu.dto.wechat; + +import lombok.Data; + +import java.util.List; + +@Data +public class WechatInviteDTO { + + private List<String> user; + + private List<String> party; + + private List<String> tag; + +} diff --git a/src/main/java/com/meishu/job/UpgradeClassJob.java b/src/main/java/com/meishu/job/UpgradeClassJob.java new file mode 100644 index 0000000..9613934 --- /dev/null +++ b/src/main/java/com/meishu/job/UpgradeClassJob.java @@ -0,0 +1,117 @@ +package com.meishu.job; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.meishu.mapper.ClassesDictHistoryMapper; +import com.meishu.mapper.ClassesDictMapper; +import com.meishu.model.ClassesDictDO; +import com.meishu.model.ClassesDictHistoryDO; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Component; + +import java.util.Calendar; +import java.util.Date; +import java.util.List; + +/** + * 定时任务 每天凌晨查看班级里是否有需要晋升的 + */ + +@Component +public class UpgradeClassJob { + + @Autowired + private ClassesDictMapper classesDictMapper; + + @Autowired + private ClassesDictHistoryMapper classesDictHistoryMapper; + + @Scheduled(cron = "0 10 0 * * ?") + public void updateGrade(){ + + List<ClassesDictDO> classesDictDOS = classesDictMapper.selectList(new QueryWrapper<ClassesDictDO>() + .lambda() + .eq(ClassesDictDO::getStatus,"在读")); + + for (ClassesDictDO classesDictDO : classesDictDOS){ + + //获取班级的晋升时间 + Date date = classesDictDO.getUpgradeDate(); + Date current = new Date(); + + if (null!=date && date.getYear() == current.getYear() && date.getMonth() == current.getMonth() && date.getDate() == current.getDate()){ + + //将history表里该班级的记录置为归档 + ClassesDictHistoryDO classesDictHistoryDO = classesDictHistoryMapper.selectOne(new QueryWrapper<ClassesDictHistoryDO>() + .lambda() + .eq(ClassesDictHistoryDO::getStatus,"在读") + .eq(ClassesDictHistoryDO::getClassDictId,classesDictDO.getId())); + + if (null != classesDictHistoryDO){ + classesDictHistoryDO.setStatus("归档"); + classesDictHistoryMapper.updateById(classesDictHistoryDO); + } + + //将classdict表里的grade修改为新的年级 + if ("高三".equals(classesDictDO.getGrade())){ + classesDictDO.setStatus("归档"); + classesDictMapper.updateById(classesDictDO); + }else { + Calendar cal = Calendar.getInstance(); + int year = cal.get(Calendar.YEAR); + int month = cal.get(Calendar.MONTH)+1;//获取月份 + + if (month>=7){ + date.setYear(year-1899); + date.setMonth(7); + date.setDate(1); + date.setHours(0); + date.setMinutes(0); + date.setSeconds(0); + }else { + date.setYear(year-1900); + date.setMonth(7); + date.setDate(1); + date.setHours(0); + date.setMinutes(0); + date.setSeconds(0); + } + classesDictDO.setUpgradeDate(date); + classesDictDO.setGrade(changeGrade(classesDictDO.getGrade())); + classesDictDO.setClassName(changeClassName(classesDictDO.getClassName())); + classesDictMapper.updateById(classesDictDO); + + //在history中插入新的记录 + ClassesDictHistoryDO classesDictHistoryDO1 = new ClassesDictHistoryDO(); + BeanUtils.copyProperties(classesDictDO,classesDictHistoryDO1); + classesDictHistoryDO1.setClassDictId(classesDictDO.getId()); + classesDictHistoryMapper.insert(classesDictHistoryDO1); + } + } + } + } + + + public String changeGrade(String grade){ + + if("高一".equals(grade)){ + return "高二"; + }else { + return "高三"; + } + } + + public String changeClassName(String className){ + + String newName = ""; + if (className.contains("高一")){ + newName = className.replace("高一","高二"); + }else { + newName = className.replace("高二","高三"); + } + return newName; + } + + +} diff --git a/src/main/java/com/meishu/mapper/AccessTokenMapper.java b/src/main/java/com/meishu/mapper/AccessTokenMapper.java new file mode 100644 index 0000000..f6e7219 --- /dev/null +++ b/src/main/java/com/meishu/mapper/AccessTokenMapper.java @@ -0,0 +1,30 @@ +package com.meishu.mapper; + +import com.meishu.dto.token.GetAllStudentsDTO; +import com.meishu.dto.token.GetAllTeachersDTO; +import com.meishu.model.AccessTokenDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.meishu.model.AdministerDO; +import com.meishu.model.UserRoleDO; +import com.meishu.vo.accesstoken.GetAllStudentsVO; +import com.meishu.vo.accesstoken.GetAllTeachersVO; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * <p> + * Mapper 接口 + * </p> + * + * @author Tuyp + * @since 2021-05-10 + */ +@Repository +public interface AccessTokenMapper extends BaseMapper<AccessTokenDO> { + + List<GetAllTeachersVO> getAllTeachers(GetAllTeachersDTO getAllTeachersDTO); + + List<GetAllStudentsVO> getAllStudents(GetAllStudentsDTO getAllStudentsDTO); + +} diff --git a/src/main/java/com/meishu/mapper/AdministerDepartmentMappingMapper.java b/src/main/java/com/meishu/mapper/AdministerDepartmentMappingMapper.java new file mode 100644 index 0000000..14ae9a1 --- /dev/null +++ b/src/main/java/com/meishu/mapper/AdministerDepartmentMappingMapper.java @@ -0,0 +1,18 @@ +package com.meishu.mapper; + +import com.meishu.model.AdministerDepartmentMappingDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + * <p> + * 老师部门映射表 Mapper 接口 + * </p> + * + * @author Tuyp + * @since 2021-07-01 + */ + @Repository +public interface AdministerDepartmentMappingMapper extends BaseMapper<AdministerDepartmentMappingDO> { + +} diff --git a/src/main/java/com/meishu/mapper/AdministerMapper.java b/src/main/java/com/meishu/mapper/AdministerMapper.java new file mode 100644 index 0000000..ad9efd5 --- /dev/null +++ b/src/main/java/com/meishu/mapper/AdministerMapper.java @@ -0,0 +1,74 @@ +package com.meishu.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.meishu.dto.task.GetClassesRequestVO; +import com.meishu.model.*; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.meishu.vo.administer.GetClassesDetailResponseVO; +import com.meishu.vo.administer.GetTeacherSubjectVO; +import com.meishu.vo.administer.GetTeachersVO; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * <p> + * 中心管理账户表 Mapper 接口 + * </p> + * + * @author Tuyp + * @since 2021-04-25 + */ +@Repository +public interface AdministerMapper extends BaseMapper<AdministerDO> { + + + /** + * 获取某部门成员 + */ + IPage<GetTeachersVO> getDepartmentTeachers(IPage iPage, Long departmentId, Long campusId, String teacherName,List<Long> userIds); + + /** + * 查看某个老师在几个校区 + */ + List<CampusDictDO> getTeacherCampus(Long id); + + /** + * 通过部门id获取部门人员 + */ + + List<AdministerDO> getAdministerByDepartmentId(Long departmentId); + + /** + * 通过成员id获取其所在的部门 + */ + List<DepartmentDictDO> getDepartmentByAdministerId(Long administerId); + + /** + * 通过成员id获取其所有学科 + */ + List<KnowledgeSubjectDictDO> getTeacherSubjects(Long administerId); + + /** + * 通过成员id返回角色信息 + */ + List<RoleDictDO> getTeacherRoles(Long administerId); + + /** + * 通过成员id返回其所有班级 + */ + List<SubjectDictDO> getTeacherClasses(Long administerId); + + /** + * 查看老师下的班级+科目 + * @param getClassesRequestVO + * @return + */ + List<GetClassesDetailResponseVO> getClasses(GetClassesRequestVO getClassesRequestVO); + + + /** + * 查看老师具体的班级+科目 + */ + List<GetTeacherSubjectVO> getTeacherSubject(Integer userId); +} diff --git a/src/main/java/com/meishu/mapper/AdministerPermissionMapper.java b/src/main/java/com/meishu/mapper/AdministerPermissionMapper.java new file mode 100644 index 0000000..1fb31e3 --- /dev/null +++ b/src/main/java/com/meishu/mapper/AdministerPermissionMapper.java @@ -0,0 +1,24 @@ +package com.meishu.mapper; + +import com.meishu.model.AdministerPermissionDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.meishu.vo.administer.PermissionsVO; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * <p> + * 系统用户角色表 Mapper 接口 + * </p> + * + * @author Tuyp + * @since 2021-04-25 + */ + @Repository +public interface AdministerPermissionMapper extends BaseMapper<AdministerPermissionDO> { + + List<PermissionsVO> getPermissions(Long id); + + +} diff --git a/src/main/java/com/meishu/mapper/AdministerSubjectMappingMapper.java b/src/main/java/com/meishu/mapper/AdministerSubjectMappingMapper.java new file mode 100644 index 0000000..b13d159 --- /dev/null +++ b/src/main/java/com/meishu/mapper/AdministerSubjectMappingMapper.java @@ -0,0 +1,18 @@ +package com.meishu.mapper; + +import com.meishu.model.AdministerSubjectMappingDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + * <p> + * 老师科目映射表 Mapper 接口 + * </p> + * + * @author Tuyp + * @since 2021-07-01 + */ + @Repository +public interface AdministerSubjectMappingMapper extends BaseMapper<AdministerSubjectMappingDO> { + +} diff --git a/src/main/java/com/meishu/mapper/AnsweringQuestionMapper.java b/src/main/java/com/meishu/mapper/AnsweringQuestionMapper.java new file mode 100644 index 0000000..d85970a --- /dev/null +++ b/src/main/java/com/meishu/mapper/AnsweringQuestionMapper.java @@ -0,0 +1,25 @@ +package com.meishu.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.meishu.dto.question.QueryQuestionsDTO; +import com.meishu.model.AnsweringQuestionDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.meishu.vo.question.QueryQuestionsVO; +import org.springframework.stereotype.Repository; + +import java.util.Date; + +/** + * <p> + * 问题答疑表 Mapper 接口 + * </p> + * + * @author DengMin + * @since 2021-09-28 + */ +@Repository +public interface AnsweringQuestionMapper extends BaseMapper<AnsweringQuestionDO> { + + IPage<QueryQuestionsVO> queryQuestions(IPage page, Integer subjectId, Date startDate,Date endDate,String userName); + +} diff --git a/src/main/java/com/meishu/mapper/ClassSubjectTaskMapper.java b/src/main/java/com/meishu/mapper/ClassSubjectTaskMapper.java new file mode 100644 index 0000000..81d465c --- /dev/null +++ b/src/main/java/com/meishu/mapper/ClassSubjectTaskMapper.java @@ -0,0 +1,31 @@ +package com.meishu.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.meishu.dto.task.GetClassStudentsDTO; +import com.meishu.dto.task.GetTaskByIdRequestDTO; +import com.meishu.model.ClassSubjectTaskDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.meishu.model.UserRoleDO; +import com.meishu.vo.task.GetTaskByIdVO; +import org.springframework.stereotype.Repository; + +import java.util.Date; +import java.util.List; + +/** + * <p> + * 学习任务列表 Mapper 接口 + * </p> + * + * @author DengMin + * @since 2021-09-16 + */ +@Repository +public interface ClassSubjectTaskMapper extends BaseMapper<ClassSubjectTaskDO> { + + + IPage<GetTaskByIdVO> queryAlreadyTasks(IPage iPage, Integer classId, Integer subjectId, Date startDate, Date endDate, Integer taskType); + + List<UserRoleDO> getClassStudents(GetClassStudentsDTO getClassStudentsDTO); + +} diff --git a/src/main/java/com/meishu/mapper/ClassesDictHistoryMapper.java b/src/main/java/com/meishu/mapper/ClassesDictHistoryMapper.java new file mode 100644 index 0000000..678b9c0 --- /dev/null +++ b/src/main/java/com/meishu/mapper/ClassesDictHistoryMapper.java @@ -0,0 +1,22 @@ +package com.meishu.mapper; + +import com.meishu.model.ClassesDictHistoryDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * <p> + * 学校班级字典表 Mapper 接口 + * </p> + * + * @author Tuyp + * @since 2021-08-11 + */ +@Repository +public interface ClassesDictHistoryMapper extends BaseMapper<ClassesDictHistoryDO> { + + List<ClassesDictHistoryDO> getAllPastSemester(String grade); + +} diff --git a/src/main/java/com/meishu/mapper/ClassesDictMapper.java b/src/main/java/com/meishu/mapper/ClassesDictMapper.java new file mode 100644 index 0000000..9f7e582 --- /dev/null +++ b/src/main/java/com/meishu/mapper/ClassesDictMapper.java @@ -0,0 +1,35 @@ +package com.meishu.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.meishu.model.ClassesDictDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.meishu.model.UserRoleDO; +import com.meishu.vo.classes.GetClassStudentsVO; +import com.meishu.vo.classes.GetClassesVO; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * <p> + * 学校班级字典表 Mapper 接口 + * </p> + * + * @author Tuyp + * @since 2021-08-11 + */ +@Repository +public interface ClassesDictMapper extends BaseMapper<ClassesDictDO> { + + IPage<GetClassesVO> getClasses(IPage page, String className, String grade, String session, String status); + + List<GetClassStudentsVO> getClassStudents(Integer classId,String userName); + + IPage<UserRoleDO> queryNoClassStudents(IPage iPage,String userName); + + ClassesDictDO getClassesById(@Param("studentId") Long studentId); + + List<ClassesDictDO> getGradeClasses(String grade); + +} diff --git a/src/main/java/com/meishu/mapper/ClassesUserMappingMapper.java b/src/main/java/com/meishu/mapper/ClassesUserMappingMapper.java new file mode 100644 index 0000000..6f6e81b --- /dev/null +++ b/src/main/java/com/meishu/mapper/ClassesUserMappingMapper.java @@ -0,0 +1,18 @@ +package com.meishu.mapper; + +import com.meishu.model.ClassesUserMappingDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + * <p> + * 班级--学生--映射表(包括以前的班级) Mapper 接口 + * </p> + * + * @author Tuyp + * @since 2021-08-17 + */ + @Repository +public interface ClassesUserMappingMapper extends BaseMapper<ClassesUserMappingDO> { + +} diff --git a/src/main/java/com/meishu/mapper/CourseAdministerMappingMapper.java b/src/main/java/com/meishu/mapper/CourseAdministerMappingMapper.java new file mode 100644 index 0000000..7b7e439 --- /dev/null +++ b/src/main/java/com/meishu/mapper/CourseAdministerMappingMapper.java @@ -0,0 +1,28 @@ +package com.meishu.mapper; + +import com.meishu.model.AdministerDO; +import com.meishu.model.CourseAdministerMappingDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * <p> + * 课程老师映射表 Mapper 接口 + * </p> + * + * @author Tuyp + * @since 2021-05-25 + */ + @Repository +public interface CourseAdministerMappingMapper extends BaseMapper<CourseAdministerMappingDO> { + + + /** + * 通过课程id查询老师 + */ + + List<AdministerDO> getAdminister(Long courseId); + +} diff --git a/src/main/java/com/meishu/mapper/CourseStudentStatusHistoryMapper.java b/src/main/java/com/meishu/mapper/CourseStudentStatusHistoryMapper.java new file mode 100644 index 0000000..6e8f201 --- /dev/null +++ b/src/main/java/com/meishu/mapper/CourseStudentStatusHistoryMapper.java @@ -0,0 +1,28 @@ +package com.meishu.mapper; + +import com.meishu.model.CourseStudentStatusHistoryDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.meishu.vo.course.GetStudentHistoryVO; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * <p> + * Mapper 接口 + * </p> + * + * @author Tuyp + * @since 2021-05-27 + */ +@Repository +public interface CourseStudentStatusHistoryMapper extends BaseMapper<CourseStudentStatusHistoryDO> { + + /** + * 获取某个课程某个学生的授权记录 + */ + List<GetStudentHistoryVO> getStudentHistory(CourseStudentStatusHistoryDO courseStudentStatusHistoryDO); + + + +} diff --git a/src/main/java/com/meishu/mapper/CourseTreeExerciseStudentResultMapper.java b/src/main/java/com/meishu/mapper/CourseTreeExerciseStudentResultMapper.java new file mode 100644 index 0000000..12d99b7 --- /dev/null +++ b/src/main/java/com/meishu/mapper/CourseTreeExerciseStudentResultMapper.java @@ -0,0 +1,40 @@ +package com.meishu.mapper; + +import com.meishu.model.CourseTreeDO; +import com.meishu.model.CourseTreeExerciseStudentResultDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.meishu.model.SubjectTreeDO; +import com.meishu.vo.course.GetExerciseDetailVO; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * <p> + * 课程--学生做题记录 Mapper 接口 + * </p> + * + * @author Tuyp + * @since 2021-05-25 + */ +@Repository +public interface CourseTreeExerciseStudentResultMapper extends BaseMapper<CourseTreeExerciseStudentResultDO> { + + + /** + * 查看某个学生某个章节的做题记录 + */ + List<CourseTreeExerciseStudentResultDO> studentExercise(Long studentId, Long chapterId); + + /** + * 根据多个题目id查询这些题目关联的知识点 + */ + List<CourseTreeDO> getTreesByExerciseIds(@Param("longs") List<Long> longs); + + /** + * 查询吗,每个题目的做题详情 正确率用时 + */ + List<GetExerciseDetailVO> getExerciseDetail(Long studentId, Long chapterId); + +} diff --git a/src/main/java/com/meishu/mapper/CourseTreeVodStudentResultMapper.java b/src/main/java/com/meishu/mapper/CourseTreeVodStudentResultMapper.java new file mode 100644 index 0000000..fbeda54 --- /dev/null +++ b/src/main/java/com/meishu/mapper/CourseTreeVodStudentResultMapper.java @@ -0,0 +1,18 @@ +package com.meishu.mapper; + +import com.meishu.model.CourseTreeVodStudentResultDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + * <p> + * 学生视频完成情况 Mapper 接口 + * </p> + * + * @author Tuyp + * @since 2021-05-20 + */ + @Repository +public interface CourseTreeVodStudentResultMapper extends BaseMapper<CourseTreeVodStudentResultDO> { + +} diff --git a/src/main/java/com/meishu/mapper/CourseVodTressStudentResultMapper.java b/src/main/java/com/meishu/mapper/CourseVodTressStudentResultMapper.java new file mode 100644 index 0000000..8a1645f --- /dev/null +++ b/src/main/java/com/meishu/mapper/CourseVodTressStudentResultMapper.java @@ -0,0 +1,18 @@ +package com.meishu.mapper; + +import com.meishu.model.CourseTreeVodStudentResultDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + * <p> + * 学生视频完成情况 Mapper 接口 + * </p> + * + * @author Tuyp + * @since 2021-05-13 + */ + @Repository +public interface CourseVodTressStudentResultMapper extends BaseMapper<CourseTreeVodStudentResultDO> { + +} diff --git a/src/main/java/com/meishu/mapper/DepartmentDictMapper.java b/src/main/java/com/meishu/mapper/DepartmentDictMapper.java new file mode 100644 index 0000000..b1e249a --- /dev/null +++ b/src/main/java/com/meishu/mapper/DepartmentDictMapper.java @@ -0,0 +1,21 @@ +package com.meishu.mapper; + +import com.meishu.model.AdministerDO; +import com.meishu.model.DepartmentDictDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * <p> + * 部门字典表 Mapper 接口 + * </p> + * + * @author Tuyp + * @since 2021-04-25 + */ + @Repository +public interface DepartmentDictMapper extends BaseMapper<DepartmentDictDO> { + +} diff --git a/src/main/java/com/meishu/mapper/ExerciseCourseTreeMappingMapper.java b/src/main/java/com/meishu/mapper/ExerciseCourseTreeMappingMapper.java new file mode 100644 index 0000000..e4c9eed --- /dev/null +++ b/src/main/java/com/meishu/mapper/ExerciseCourseTreeMappingMapper.java @@ -0,0 +1,46 @@ +package com.meishu.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.meishu.dto.course.GetExercisesByTreeDTO; +import com.meishu.dto.exercise.QueryCourseTreeExerciseDTO; +import com.meishu.dto.student.GetStudyProgressDTO; +import com.meishu.model.CourseTreeDO; +import com.meishu.model.ExerciseCourseTreeMappingDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.meishu.model.ExerciseDictDO; +import com.meishu.service.ExerciseCourseTreeMappingService; +import com.meishu.vo.exercise.QueryCourseTreeExerciseVO; +import com.meishu.vo.student.QueryChapterTestVO; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * <p> + * 课程知识树--题目字典表 Mapper 接口 + * </p> + * + * @author Tuyp + * @since 2021-05-24 + */ + @Repository +public interface ExerciseCourseTreeMappingMapper extends BaseMapper<ExerciseCourseTreeMappingDO> { + + IPage<QueryCourseTreeExerciseVO> queryCourseTreeExercise(IPage iPage,Long courseId,Long courseTreeId,String title,Integer difficulty,String exerciseType); + + /** + * 根据映射id去课程知识树id + */ + CourseTreeDO getParentTreeId(Long id); + + /** + * 通过知识点查询该课程下的所有题目 + */ + List<ExerciseDictDO> getExercisesByTree(GetExercisesByTreeDTO getExercisesByTreeDTO); + + /** + * 查看某个同学 某个章节的做题记录 + */ + List<QueryChapterTestVO> queryChapterTest(Long studentId,Long chapterId); +} diff --git a/src/main/java/com/meishu/mapper/ExerciseDictMapper.java b/src/main/java/com/meishu/mapper/ExerciseDictMapper.java new file mode 100644 index 0000000..42c2ffa --- /dev/null +++ b/src/main/java/com/meishu/mapper/ExerciseDictMapper.java @@ -0,0 +1,35 @@ +package com.meishu.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.meishu.dto.exercise.GetExerciseRequestDTO; +import com.meishu.model.ExerciseDictDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.meishu.model.SubjectTreeDO; +import com.meishu.vo.exercise.GetExerciseDetailResponseVO; +import com.meishu.vo.exercise.GetTreeExercisesVO; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * <p> + * 习题库 Mapper 接口 + * </p> + * + * @author Tuyp + * @since 2021-04-27 + */ +@Repository +public interface ExerciseDictMapper extends BaseMapper<ExerciseDictDO> { + + IPage<GetTreeExercisesVO> getTreeExercises(IPage iPage,Long userId,String subjectEn, Long treeId, String exerciseType, Integer difficulty, String title,String shareStatus,String checkStatus,List<String> strings); + + List<SubjectTreeDO> getTrees(Long id); + + /** + * 通过知识点和学校查看关联习题+用户收藏状态 + * @param getExerciseRequestVO + * @return + */ + List<GetExerciseDetailResponseVO> getRelativeExercises(GetExerciseRequestDTO getExerciseRequestVO); +} diff --git a/src/main/java/com/meishu/mapper/ExerciseDoneHistoryMapper.java b/src/main/java/com/meishu/mapper/ExerciseDoneHistoryMapper.java new file mode 100644 index 0000000..5a5dbe1 --- /dev/null +++ b/src/main/java/com/meishu/mapper/ExerciseDoneHistoryMapper.java @@ -0,0 +1,61 @@ +package com.meishu.mapper; + +import com.meishu.dto.task.ClassDoneInfoDTO; +import com.meishu.dto.task.ExesDoneInfoPO; +import com.meishu.dto.task.PerStudentExesDTO; +import com.meishu.dto.task.PerStudentExesRequestVO; +import com.meishu.model.ExerciseDoneHistoryDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.meishu.vo.task.ClassDoneInfoVO; +import com.meishu.vo.task.GetClassExeDoneInfoRequestVO; +import com.meishu.vo.task.GetClassExeDoneInfoResponseVO; +import com.meishu.vo.task.PerStuExeDoneResponseVO; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * <p> + * 学生做题记录表 Mapper 接口 + * </p> + * + * @author Tuyp + * @since 2021-04-27 + */ + @Repository +public interface ExerciseDoneHistoryMapper extends BaseMapper<ExerciseDoneHistoryDO> { + + /** + * 获取班级某个关联习题做题情况 + * @return + */ + List<PerStuExeDoneResponseVO> perStudentRelateExes(PerStudentExesDTO perStudentExesRequestVO); + + /** + * 获取关联/拓展题组做题情况 + */ + List<ClassDoneInfoVO> classDoneInfo(ClassDoneInfoDTO classDoneInfoPO); + + /** + * 获取某题目组做题情况 + */ + List<ClassDoneInfoVO> exesDoneInfo(ExesDoneInfoPO exesDoneInfoPO); + + /** + * 个人关联习题完成度明细 + * @param getClassExeDoneInfoVO + * @return + */ + List<GetClassExeDoneInfoResponseVO> getRelateExeDoneInfo(GetClassExeDoneInfoRequestVO getClassExeDoneInfoVO); + + /** + * 个人拓展习题完成度明细 + */ + List<GetClassExeDoneInfoResponseVO> getExpandingExeDoneInfo(GetClassExeDoneInfoRequestVO getClassExeDoneInfoRequestVO); + + + /** + * 获取班级某个拓展习题组做题情况 + */ + List<PerStuExeDoneResponseVO> perStudentExpandingExes(PerStudentExesRequestVO perStudentExesRequestVO); +} diff --git a/src/main/java/com/meishu/mapper/ExerciseExpandMappingMapper.java b/src/main/java/com/meishu/mapper/ExerciseExpandMappingMapper.java new file mode 100644 index 0000000..0638cd6 --- /dev/null +++ b/src/main/java/com/meishu/mapper/ExerciseExpandMappingMapper.java @@ -0,0 +1,18 @@ +package com.meishu.mapper; + +import com.meishu.model.ExerciseExpandMappingDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + * <p> + * 学生--拓展习题映射表 Mapper 接口 + * </p> + * + * @author DengMin + * @since 2021-09-16 + */ + @Repository +public interface ExerciseExpandMappingMapper extends BaseMapper<ExerciseExpandMappingDO> { + +} diff --git a/src/main/java/com/meishu/mapper/ExerciseRelatedMappingMapper.java b/src/main/java/com/meishu/mapper/ExerciseRelatedMappingMapper.java new file mode 100644 index 0000000..9713ce0 --- /dev/null +++ b/src/main/java/com/meishu/mapper/ExerciseRelatedMappingMapper.java @@ -0,0 +1,18 @@ +package com.meishu.mapper; + +import com.meishu.model.ExerciseRelatedMappingDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + * <p> + * 学生--拓展习题映射表 Mapper 接口 + * </p> + * + * @author DengMin + * @since 2021-09-28 + */ + @Repository +public interface ExerciseRelatedMappingMapper extends BaseMapper<ExerciseRelatedMappingDO> { + +} diff --git a/src/main/java/com/meishu/mapper/ExerciseTreeMappingMapper.java b/src/main/java/com/meishu/mapper/ExerciseTreeMappingMapper.java new file mode 100644 index 0000000..7e24470 --- /dev/null +++ b/src/main/java/com/meishu/mapper/ExerciseTreeMappingMapper.java @@ -0,0 +1,33 @@ +package com.meishu.mapper; + +import com.baomidou.mybatisplus.core.toolkit.StringUtils; +import com.meishu.model.ExerciseDictDO; +import com.meishu.model.ExerciseTreeMappingDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * <p> + * 题目知识树映射表 Mapper 接口 + * </p> + * + * @author Tuyp + * @since 2021-04-27 + */ +@Repository +public interface ExerciseTreeMappingMapper extends BaseMapper<ExerciseTreeMappingDO> { + + /** + * 查看挂在知识点上的视频数 + */ + Integer getTreeExerciseCount(Long userId, Long treeId, String shareStatus, String subject,String checkStatus); + + + /** + * 获取某学校某知识点的关联习题 + * @return 审核通过的视频 + */ + List<ExerciseDictDO> getRelatedExercise(Integer treeId); +} diff --git a/src/main/java/com/meishu/mapper/ExerciseUserInfoMapper.java b/src/main/java/com/meishu/mapper/ExerciseUserInfoMapper.java new file mode 100644 index 0000000..235ab2c --- /dev/null +++ b/src/main/java/com/meishu/mapper/ExerciseUserInfoMapper.java @@ -0,0 +1,18 @@ +package com.meishu.mapper; + +import com.meishu.model.ExerciseUserInfoDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + * <p> + * 题目收藏信息表 Mapper 接口 + * </p> + * + * @author DengMin + * @since 2021-09-17 + */ + @Repository +public interface ExerciseUserInfoMapper extends BaseMapper<ExerciseUserInfoDO> { + +} diff --git a/src/main/java/com/meishu/mapper/KnowledgeSubjectDictMapper.java b/src/main/java/com/meishu/mapper/KnowledgeSubjectDictMapper.java new file mode 100644 index 0000000..b51dbfc --- /dev/null +++ b/src/main/java/com/meishu/mapper/KnowledgeSubjectDictMapper.java @@ -0,0 +1,33 @@ +package com.meishu.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.meishu.model.AdministerDO; +import com.meishu.model.KnowledgeSubjectDictDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * <p> + * 学科字典表 Mapper 接口 + * </p> + * + * @author Tuyp + * @since 2021-04-27 + */ +@Repository +public interface KnowledgeSubjectDictMapper extends BaseMapper<KnowledgeSubjectDictDO> { + + + /** + * 查看某个科目下的老师 + */ + List<AdministerDO> getSubjectAdminister(Long subjectId,String userName); + + /** + * 查看某个老师下的所有科目 分页 模糊搜索 subjectType subjectName + */ + IPage<KnowledgeSubjectDictDO> getAdministerSubjects(IPage page, Long userId, String subjectType, String subjectName); + +} diff --git a/src/main/java/com/meishu/mapper/LaboratoryAttendanceMappingMapper.java b/src/main/java/com/meishu/mapper/LaboratoryAttendanceMappingMapper.java new file mode 100644 index 0000000..142f3bb --- /dev/null +++ b/src/main/java/com/meishu/mapper/LaboratoryAttendanceMappingMapper.java @@ -0,0 +1,18 @@ +package com.meishu.mapper; + +import com.meishu.model.LaboratoryAttendanceMappingDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + * <p> + * 实验室场次预约考勤记录 Mapper 接口 + * </p> + * + * @author DengMin + * @since 2021-09-15 + */ + @Repository +public interface LaboratoryAttendanceMappingMapper extends BaseMapper<LaboratoryAttendanceMappingDO> { + +} diff --git a/src/main/java/com/meishu/mapper/LaboratoryDictMapper.java b/src/main/java/com/meishu/mapper/LaboratoryDictMapper.java new file mode 100644 index 0000000..5eb791b --- /dev/null +++ b/src/main/java/com/meishu/mapper/LaboratoryDictMapper.java @@ -0,0 +1,25 @@ +package com.meishu.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.meishu.model.LaboratoryDictDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.meishu.vo.laboratorySession.LaboratoryDictPageVO; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +/** + * <p> + * 实验室 Mapper 接口 + * </p> + * + * @author DengMin + * @since 2021-08-17 + */ + @Repository +public interface LaboratoryDictMapper extends BaseMapper<LaboratoryDictDO> { + + IPage<LaboratoryDictPageVO> getLaboratoryPage(Page page, String laboratoryName, String laboratoryType); + + LaboratoryDictDO getLaboratoryDicOne(String laboratoryType, @Param("startDate") String startDate); +} diff --git a/src/main/java/com/meishu/mapper/LaboratoryDictMappingMapper.java b/src/main/java/com/meishu/mapper/LaboratoryDictMappingMapper.java new file mode 100644 index 0000000..5ea4961 --- /dev/null +++ b/src/main/java/com/meishu/mapper/LaboratoryDictMappingMapper.java @@ -0,0 +1,21 @@ +package com.meishu.mapper; + +import com.meishu.model.LaboratoryDictMappingDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * <p> + * 实验室场次关联表 Mapper 接口 + * </p> + * + * @author DengMin + * @since 2021-08-30 + */ + @Repository +public interface LaboratoryDictMappingMapper extends BaseMapper<LaboratoryDictMappingDO> { + + List<String> getList(Long laboratoryDictId); +} diff --git a/src/main/java/com/meishu/mapper/LaboratorySessionMappingMapper.java b/src/main/java/com/meishu/mapper/LaboratorySessionMappingMapper.java new file mode 100644 index 0000000..b0d2ed4 --- /dev/null +++ b/src/main/java/com/meishu/mapper/LaboratorySessionMappingMapper.java @@ -0,0 +1,29 @@ +package com.meishu.mapper; + +import com.meishu.model.LaboratorySessionMappingDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.meishu.vo.laboratorySession.LaboratorySessionMappingVO; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * <p> + * 实验室场次预约安排表 Mapper 接口 + * </p> + * + * @author DengMin + * @since 2021-08-17 + */ + @Repository +public interface LaboratorySessionMappingMapper extends BaseMapper<LaboratorySessionMappingDO> { + + List<LaboratorySessionMappingVO> getLaboratorySessionList(String startDate); + + LaboratorySessionMappingVO getOneById(Long id); + + List<LaboratorySessionMappingDO> getLaboratorySessionDate(@Param("laboratoryType") String laboratoryType); + + List<LaboratorySessionMappingDO> getList(@Param("studentId") Long studentId, String startDate, Long sessionsDictId); +} diff --git a/src/main/java/com/meishu/mapper/LaboratoryUserMappingMapper.java b/src/main/java/com/meishu/mapper/LaboratoryUserMappingMapper.java new file mode 100644 index 0000000..56f1a86 --- /dev/null +++ b/src/main/java/com/meishu/mapper/LaboratoryUserMappingMapper.java @@ -0,0 +1,29 @@ +package com.meishu.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.meishu.model.LaboratoryUserMappingDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.meishu.vo.laboratoryUser.LaboratoryUserPageVO; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * <p> + * 实验室场次预约报名记录 Mapper 接口 + * </p> + * + * @author DengMin + * @since 2021-08-17 + */ + @Repository +public interface LaboratoryUserMappingMapper extends BaseMapper<LaboratoryUserMappingDO> { + + List<LaboratoryUserPageVO> getLaboratoryUserPage(Long laboratorySessionId, @Param("startDate") String startDate); + + List<LaboratoryUserPageVO> getLaboratoryUserList(Long laboratorySessionId, @Param("startDate") String startDate); + + LaboratoryUserMappingDO getLaboratoryUserMapping(Long userRoleId, String startDate, Long sessionsDictId); +} diff --git a/src/main/java/com/meishu/mapper/PermissionsDictMapper.java b/src/main/java/com/meishu/mapper/PermissionsDictMapper.java new file mode 100644 index 0000000..b555720 --- /dev/null +++ b/src/main/java/com/meishu/mapper/PermissionsDictMapper.java @@ -0,0 +1,18 @@ +package com.meishu.mapper; + +import com.meishu.model.PermissionsDictDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + * <p> + * 权限表 Mapper 接口 + * </p> + * + * @author Tuyp + * @since 2021-04-26 + */ + @Repository +public interface PermissionsDictMapper extends BaseMapper<PermissionsDictDO> { + +} diff --git a/src/main/java/com/meishu/mapper/RoleAdministerMappingMapper.java b/src/main/java/com/meishu/mapper/RoleAdministerMappingMapper.java new file mode 100644 index 0000000..03488ea --- /dev/null +++ b/src/main/java/com/meishu/mapper/RoleAdministerMappingMapper.java @@ -0,0 +1,18 @@ +package com.meishu.mapper; + +import com.meishu.model.RoleAdministerMappingDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + * <p> + * Mapper 接口 + * </p> + * + * @author Tuyp + * @since 2021-04-26 + */ + @Repository +public interface RoleAdministerMappingMapper extends BaseMapper<RoleAdministerMappingDO> { + +} diff --git a/src/main/java/com/meishu/mapper/RoleDictMapper.java b/src/main/java/com/meishu/mapper/RoleDictMapper.java new file mode 100644 index 0000000..a914a2b --- /dev/null +++ b/src/main/java/com/meishu/mapper/RoleDictMapper.java @@ -0,0 +1,26 @@ +package com.meishu.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.meishu.dto.role.GetRoleTeachersDTO; +import com.meishu.model.AdministerDO; +import com.meishu.model.RoleDictDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.meishu.vo.role.GetRoleTeachersVO; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * <p> + * 角色表 Mapper 接口 + * </p> + * + * @author Tuyp + * @since 2021-04-26 + */ + @Repository +public interface RoleDictMapper extends BaseMapper<RoleDictDO> { + + IPage<GetRoleTeachersVO > getRoleTeachers(IPage page,Long roleId,String userName); + +} diff --git a/src/main/java/com/meishu/mapper/RolePermissionMappingMapper.java b/src/main/java/com/meishu/mapper/RolePermissionMappingMapper.java new file mode 100644 index 0000000..c51510d --- /dev/null +++ b/src/main/java/com/meishu/mapper/RolePermissionMappingMapper.java @@ -0,0 +1,26 @@ +package com.meishu.mapper; + +import com.meishu.model.PermissionsDictDO; +import com.meishu.model.RolePermissionMappingDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * <p> + * 系统用户角色表 Mapper 接口 + * </p> + * + * @author Tuyp + * @since 2021-04-26 + */ + @Repository +public interface RolePermissionMappingMapper extends BaseMapper<RolePermissionMappingDO> { + + /** + * 获取某个角色下的全部权限 + */ + List<PermissionsDictDO> getRolePermission(Long roleId); + +} diff --git a/src/main/java/com/meishu/mapper/SessionsDictMapper.java b/src/main/java/com/meishu/mapper/SessionsDictMapper.java new file mode 100644 index 0000000..6b634d7 --- /dev/null +++ b/src/main/java/com/meishu/mapper/SessionsDictMapper.java @@ -0,0 +1,24 @@ +package com.meishu.mapper; + +import com.meishu.model.SessionsDictDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * <p> + * 场次字典表 Mapper 接口 + * </p> + * + * @author DengMin + * @since 2021-08-17 + */ + @Repository +public interface SessionsDictMapper extends BaseMapper<SessionsDictDO> { + + List<SessionsDictDO> getListById(@Param("laboratoryDictId") Long laboratoryDictId); + + List<SessionsDictDO> getListSessionDictById(@Param("laboratoryDictId") Long laboratoryDictId, String startDate); +} diff --git a/src/main/java/com/meishu/mapper/SignInRecordMapper.java b/src/main/java/com/meishu/mapper/SignInRecordMapper.java new file mode 100644 index 0000000..a61c5fa --- /dev/null +++ b/src/main/java/com/meishu/mapper/SignInRecordMapper.java @@ -0,0 +1,25 @@ +package com.meishu.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.meishu.model.SignInRecordDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.meishu.vo.sign.ClassSignInVO; +import org.springframework.stereotype.Repository; + +import javax.xml.crypto.Data; +import java.util.Date; + +/** + * <p> + * 学生签到表 Mapper 接口 + * </p> + * + * @author DengMin + * @since 2021-09-28 + */ + @Repository +public interface SignInRecordMapper extends BaseMapper<SignInRecordDO> { + + IPage<ClassSignInVO> classSignIn(IPage page, Integer classId, Date startDate, Date endDate,String userName); + +} diff --git a/src/main/java/com/meishu/mapper/SmsCodeMapper.java b/src/main/java/com/meishu/mapper/SmsCodeMapper.java new file mode 100644 index 0000000..cb0baed --- /dev/null +++ b/src/main/java/com/meishu/mapper/SmsCodeMapper.java @@ -0,0 +1,18 @@ +package com.meishu.mapper; + +import com.meishu.model.SmsCodeDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + * <p> + * 短信验证码 Mapper 接口 + * </p> + * + * @author Tuyp + * @since 2021-04-25 + */ + @Repository +public interface SmsCodeMapper extends BaseMapper<SmsCodeDO> { + +} diff --git a/src/main/java/com/meishu/mapper/StudentMapper.java b/src/main/java/com/meishu/mapper/StudentMapper.java new file mode 100644 index 0000000..c1bd826 --- /dev/null +++ b/src/main/java/com/meishu/mapper/StudentMapper.java @@ -0,0 +1,42 @@ +package com.meishu.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.meishu.model.StudentDO; +import com.meishu.vo.student.ClassVO; +import com.meishu.vo.student.SubjectReportVO; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * <p> + * 白名单 Mapper 接口 + * </p> + * + * @author Tuyp + * @since 2021-04-25 + */ +@Repository +public interface StudentMapper extends BaseMapper<StudentDO> { + + /** + * 小程序 --- 学习 我的课程/拓展课程 + */ + List<ClassVO> getStudentClass(Long id); + + /** + * 通过父母手机号获取学生信息 + */ + StudentDO getStudentInfo(String telephone); + + /** + * 通过学生id查询该学生学过的科目、课程 + */ + List<SubjectReportVO> getSubjectReport(Long studentId); + + /** + * 将所有学生的状态置为0 + */ + void changeStudentStatus(); + +} diff --git a/src/main/java/com/meishu/mapper/SubjectDictMapper.java b/src/main/java/com/meishu/mapper/SubjectDictMapper.java new file mode 100644 index 0000000..34772e8 --- /dev/null +++ b/src/main/java/com/meishu/mapper/SubjectDictMapper.java @@ -0,0 +1,23 @@ +package com.meishu.mapper; + +import com.meishu.model.SubjectDictDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * <p> + * 学校科目字典表 Mapper 接口 + * </p> + * + * @author Tuyp + * @since 2021-08-17 + */ + @Repository +public interface SubjectDictMapper extends BaseMapper<SubjectDictDO> { + + + List<String> getClassSubjectName(String grade,String classes,String session); + +} diff --git a/src/main/java/com/meishu/mapper/SubjectDimensionDictMapper.java b/src/main/java/com/meishu/mapper/SubjectDimensionDictMapper.java new file mode 100644 index 0000000..3913ea3 --- /dev/null +++ b/src/main/java/com/meishu/mapper/SubjectDimensionDictMapper.java @@ -0,0 +1,18 @@ +package com.meishu.mapper; + +import com.meishu.model.SubjectDimensionDictDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + * <p> + * 测评表 Mapper 接口 + * </p> + * + * @author Tuyp + * @since 2021-05-06 + */ + @Repository +public interface SubjectDimensionDictMapper extends BaseMapper<SubjectDimensionDictDO> { + +} diff --git a/src/main/java/com/meishu/mapper/SubjectDimensionStarDictMapper.java b/src/main/java/com/meishu/mapper/SubjectDimensionStarDictMapper.java new file mode 100644 index 0000000..2f8e2c3 --- /dev/null +++ b/src/main/java/com/meishu/mapper/SubjectDimensionStarDictMapper.java @@ -0,0 +1,28 @@ +package com.meishu.mapper; + +import com.meishu.model.SubjectDimensionStarDictDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * <p> + * 维度星级字典表 Mapper 接口 + * </p> + * + * @author Tuyp + * @since 2021-05-06 + */ +@Repository +public interface SubjectDimensionStarDictMapper extends BaseMapper<SubjectDimensionStarDictDO> { + + /** + * 通过维度星级 + * @param dimensionId + * @param star + * @return + */ + List<SubjectDimensionStarDictDO> getStar(Long dimensionId, Long star); + +} diff --git a/src/main/java/com/meishu/mapper/SubjectRuleMapper.java b/src/main/java/com/meishu/mapper/SubjectRuleMapper.java new file mode 100644 index 0000000..609b1a5 --- /dev/null +++ b/src/main/java/com/meishu/mapper/SubjectRuleMapper.java @@ -0,0 +1,26 @@ +package com.meishu.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.meishu.model.SubjectRuleDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.meishu.vo.rule.GetAllRulesVO; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * <p> + * 规则字典表 Mapper 接口 + * </p> + * + * @author Tuyp + * @since 2021-05-08 + */ + @Repository +public interface SubjectRuleMapper extends BaseMapper<SubjectRuleDO> { + + IPage<GetAllRulesVO> getAllRules(IPage iPage); + + List<GetAllRulesVO> getRules(); + +} diff --git a/src/main/java/com/meishu/mapper/SubjectSemesterMapper.java b/src/main/java/com/meishu/mapper/SubjectSemesterMapper.java new file mode 100644 index 0000000..525d90f --- /dev/null +++ b/src/main/java/com/meishu/mapper/SubjectSemesterMapper.java @@ -0,0 +1,34 @@ +package com.meishu.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.meishu.dto.semester.GetStudentDetailDTO; +import com.meishu.dto.semester.GetStudentRecordDTO; +import com.meishu.model.SubjectSemesterDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.meishu.vo.semester.GetSemesterScoreVO; +import com.meishu.vo.semester.GetStudentDetailVO; +import com.meishu.vo.semester.GetStudentRecordVO; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * <p> + * Mapper 接口 + * </p> + * + * @author Tuyp + * @since 2021-08-11 + */ +@Repository +public interface SubjectSemesterMapper extends BaseMapper<SubjectSemesterDO> { + + IPage<GetSemesterScoreVO> getSemesterScore(IPage page, String semester, String grade,String classes,String session, String subject, String userName); + + List<GetSemesterScoreVO> exportScore(String semester,String grade,String classes,String session, String subject, String userName); + + IPage<GetStudentDetailVO> getStudentDetail(IPage page, Integer id, Integer userId); + + List<GetStudentRecordVO> getStudentRecord(GetStudentRecordDTO getStudentRecordDTO); + +} diff --git a/src/main/java/com/meishu/mapper/SubjectStarTreeMappingMapper.java b/src/main/java/com/meishu/mapper/SubjectStarTreeMappingMapper.java new file mode 100644 index 0000000..427b2ff --- /dev/null +++ b/src/main/java/com/meishu/mapper/SubjectStarTreeMappingMapper.java @@ -0,0 +1,27 @@ +package com.meishu.mapper; + +import com.meishu.model.SubjectStarTreeMappingDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.meishu.model.SubjectTreeDO; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * <p> + * 测评-知识点关联表 Mapper 接口 + * </p> + * + * @author Tuyp + * @since 2021-05-06 + */ +@Repository +public interface SubjectStarTreeMappingMapper extends BaseMapper<SubjectStarTreeMappingDO> { + + /** + * 通过星级获取知识点数组 + */ + List<SubjectTreeDO> getSubjectTrees(Long id); + + +} diff --git a/src/main/java/com/meishu/mapper/SubjectStudentAnswerStarMapper.java b/src/main/java/com/meishu/mapper/SubjectStudentAnswerStarMapper.java new file mode 100644 index 0000000..fcab92a --- /dev/null +++ b/src/main/java/com/meishu/mapper/SubjectStudentAnswerStarMapper.java @@ -0,0 +1,18 @@ +package com.meishu.mapper; + +import com.meishu.model.SubjectStudentAnswerStarDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + * <p> + * 学生答卷星级表 Mapper 接口 + * </p> + * + * @author Tuyp + * @since 2021-05-13 + */ + @Repository +public interface SubjectStudentAnswerStarMapper extends BaseMapper<SubjectStudentAnswerStarDO> { + +} diff --git a/src/main/java/com/meishu/mapper/SubjectTestDictMapper.java b/src/main/java/com/meishu/mapper/SubjectTestDictMapper.java new file mode 100644 index 0000000..38166cb --- /dev/null +++ b/src/main/java/com/meishu/mapper/SubjectTestDictMapper.java @@ -0,0 +1,28 @@ +package com.meishu.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.meishu.dto.test.GetAllTestDTO; +import com.meishu.model.SubjectTestDictDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.meishu.vo.test.GetAllTestVO; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * <p> + * 测评表 Mapper 接口 + * </p> + * + * @author Tuyp + * @since 2021-05-20 + */ +@Repository +public interface SubjectTestDictMapper extends BaseMapper<SubjectTestDictDO> { + + IPage<GetAllTestVO> getAllTest(IPage page,Long ruleId,String testName); + + List<GetAllTestVO> getTest(Long ruleId, String testName); + + +} diff --git a/src/main/java/com/meishu/mapper/SubjectTestGradeExampleMappingMapper.java b/src/main/java/com/meishu/mapper/SubjectTestGradeExampleMappingMapper.java new file mode 100644 index 0000000..8468d72 --- /dev/null +++ b/src/main/java/com/meishu/mapper/SubjectTestGradeExampleMappingMapper.java @@ -0,0 +1,18 @@ +package com.meishu.mapper; + +import com.meishu.model.SubjectTestGradeExampleMappingDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + * <p> + * 样卷映射表 Mapper 接口 + * </p> + * + * @author Tuyp + * @since 2021-06-21 + */ + @Repository +public interface SubjectTestGradeExampleMappingMapper extends BaseMapper<SubjectTestGradeExampleMappingDO> { + +} diff --git a/src/main/java/com/meishu/mapper/SubjectTestGradeStarMappingMapper.java b/src/main/java/com/meishu/mapper/SubjectTestGradeStarMappingMapper.java new file mode 100644 index 0000000..ec83eb2 --- /dev/null +++ b/src/main/java/com/meishu/mapper/SubjectTestGradeStarMappingMapper.java @@ -0,0 +1,34 @@ +package com.meishu.mapper; + +import com.meishu.model.SubjectRuleDO; +import com.meishu.model.SubjectTestGradeStarMappingDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.meishu.model.SubjectTestPublishGradeDO; +import com.meishu.vo.grade.DimensionStarVO; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * <p> + * 档次星级映射表 Mapper 接口 + * </p> + * + * @author Tuyp + * @since 2021-06-21 + */ +@Repository +public interface SubjectTestGradeStarMappingMapper extends BaseMapper<SubjectTestGradeStarMappingDO> { + + + /** + * 星级 + */ + List<DimensionStarVO> getGradeStar(Long gradeId); + + /** + * 通过发布id找规则id + */ + SubjectRuleDO getRuleIdByPublishId(Long id); + +} diff --git a/src/main/java/com/meishu/mapper/SubjectTestPublishGradeMapper.java b/src/main/java/com/meishu/mapper/SubjectTestPublishGradeMapper.java new file mode 100644 index 0000000..7296642 --- /dev/null +++ b/src/main/java/com/meishu/mapper/SubjectTestPublishGradeMapper.java @@ -0,0 +1,18 @@ +package com.meishu.mapper; + +import com.meishu.model.SubjectTestPublishGradeDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + * <p> + * 档次表 Mapper 接口 + * </p> + * + * @author Tuyp + * @since 2021-06-21 + */ + @Repository +public interface SubjectTestPublishGradeMapper extends BaseMapper<SubjectTestPublishGradeDO> { + +} diff --git a/src/main/java/com/meishu/mapper/SubjectTestPublishHistoryMapper.java b/src/main/java/com/meishu/mapper/SubjectTestPublishHistoryMapper.java new file mode 100644 index 0000000..53019a6 --- /dev/null +++ b/src/main/java/com/meishu/mapper/SubjectTestPublishHistoryMapper.java @@ -0,0 +1,75 @@ +package com.meishu.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.meishu.dto.test.GetPublishHistoryDTO; +import com.meishu.model.StudentDO; +import com.meishu.model.SubjectStudentAnswerStarDO; +import com.meishu.model.SubjectTestPublishHistoryDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.meishu.model.SubjectTestStudentAnswerDO; +import com.meishu.vo.rule.GetOneExaminationDetailVO; +import com.meishu.vo.rule.GetStudentRulesVO; +import com.meishu.vo.rule.StudentStarVO; +import com.meishu.vo.test.CommentVO; +import com.meishu.vo.test.GetOnePublishVO; +import com.meishu.vo.test.GetPublishHistoryVO; +import com.meishu.vo.test.GetTestReportVO; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * <p> + * 测评发布记录表 Mapper 接口 + * </p> + * + * @author Tuyp + * @since 2021-05-08 + */ +@Repository +public interface SubjectTestPublishHistoryMapper extends BaseMapper<SubjectTestPublishHistoryDO> { + + /** + * 获取学生的月考列表 + * + * @param + * @return + */ + List<GetStudentRulesVO> getStudentExamination(Long id,Long subjectId); + + /** + * 获取学生某个月考的卷面 + * + * @param subjectTestStudentAnswerDO + * @return + */ + GetOneExaminationDetailVO getOneExaminationDetail(SubjectTestStudentAnswerDO subjectTestStudentAnswerDO); + + + /** + * 获取某个学生的星级评测 + */ + List<StudentStarVO> studentStar(SubjectTestStudentAnswerDO subjectTestStudentAnswerDO); + + /** + * 获取发布历史 + */ + IPage<GetPublishHistoryVO> getPublishHistory(IPage page, Long ruleId, String publishName); + + /** + * 测评报告列表 + */ + IPage<GetTestReportVO> getTestReport(IPage iPage, Long ruleId, String publishName); + + /** + * 某个测评报告的详情 + */ + IPage<GetOnePublishVO> getOnePublish(IPage iPage, Long id, String userName,String commentStatus); + + /** + * 查看评析里的维度名称,老师名字 + */ + List<CommentVO> getCommentDetail(GetOnePublishVO getOnePublishVO); + + +} diff --git a/src/main/java/com/meishu/mapper/SubjectTestStudentAnswerMapper.java b/src/main/java/com/meishu/mapper/SubjectTestStudentAnswerMapper.java new file mode 100644 index 0000000..36bbda0 --- /dev/null +++ b/src/main/java/com/meishu/mapper/SubjectTestStudentAnswerMapper.java @@ -0,0 +1,24 @@ +package com.meishu.mapper; + +import com.meishu.model.SubjectTestStudentAnswerDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.meishu.vo.student.StudentVO; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * <p> + * 学生月考答卷 Mapper 接口 + * </p> + * + * @author Tuyp + * @since 2021-05-13 + */ +@Repository +public interface SubjectTestStudentAnswerMapper extends BaseMapper<SubjectTestStudentAnswerDO> { + + + List<StudentVO> getPublishStudents(Long publishId); + +} diff --git a/src/main/java/com/meishu/mapper/SubjectTreeMapper.java b/src/main/java/com/meishu/mapper/SubjectTreeMapper.java new file mode 100644 index 0000000..7d39e13 --- /dev/null +++ b/src/main/java/com/meishu/mapper/SubjectTreeMapper.java @@ -0,0 +1,23 @@ +package com.meishu.mapper; + +import com.meishu.model.CourseDictDO; +import com.meishu.model.SubjectTreeDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * <p> + * Mapper 接口 + * </p> + * + * @author Tuyp + * @since 2021-04-27 + */ +@Repository +public interface SubjectTreeMapper extends BaseMapper<SubjectTreeDO> { + + void updateSubjectTree(SubjectTreeDO subjectTreeDO); + +} diff --git a/src/main/java/com/meishu/mapper/TaskCompletionStatusMapper.java b/src/main/java/com/meishu/mapper/TaskCompletionStatusMapper.java new file mode 100644 index 0000000..17b7ed1 --- /dev/null +++ b/src/main/java/com/meishu/mapper/TaskCompletionStatusMapper.java @@ -0,0 +1,18 @@ +package com.meishu.mapper; + +import com.meishu.model.TaskCompletionStatusDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + * <p> + * 作业任务完成状态 Mapper 接口 + * </p> + * + * @author DengMin + * @since 2021-09-16 + */ + @Repository +public interface TaskCompletionStatusMapper extends BaseMapper<TaskCompletionStatusDO> { + +} diff --git a/src/main/java/com/meishu/mapper/TaskContentDoneInfoMapper.java b/src/main/java/com/meishu/mapper/TaskContentDoneInfoMapper.java new file mode 100644 index 0000000..0540a52 --- /dev/null +++ b/src/main/java/com/meishu/mapper/TaskContentDoneInfoMapper.java @@ -0,0 +1,18 @@ +package com.meishu.mapper; + +import com.meishu.model.TaskContentDoneInfoDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + * <p> + * Mapper 接口 + * </p> + * + * @author DengMin + * @since 2021-09-30 + */ + @Repository +public interface TaskContentDoneInfoMapper extends BaseMapper<TaskContentDoneInfoDO> { + +} diff --git a/src/main/java/com/meishu/mapper/TaskContentMapper.java b/src/main/java/com/meishu/mapper/TaskContentMapper.java new file mode 100644 index 0000000..7b4df2f --- /dev/null +++ b/src/main/java/com/meishu/mapper/TaskContentMapper.java @@ -0,0 +1,18 @@ +package com.meishu.mapper; + +import com.meishu.model.TaskContentDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + * <p> + * 作业内容表(取题目,视频,书面作业) Mapper 接口 + * </p> + * + * @author DengMin + * @since 2021-09-16 + */ + @Repository +public interface TaskContentMapper extends BaseMapper<TaskContentDO> { + +} diff --git a/src/main/java/com/meishu/mapper/TaskDoneHistoryMapper.java b/src/main/java/com/meishu/mapper/TaskDoneHistoryMapper.java new file mode 100644 index 0000000..978a246 --- /dev/null +++ b/src/main/java/com/meishu/mapper/TaskDoneHistoryMapper.java @@ -0,0 +1,18 @@ +package com.meishu.mapper; + +import com.meishu.model.TaskDoneHistoryDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + * <p> + * Mapper 接口 + * </p> + * + * @author DengMin + * @since 2021-09-16 + */ + @Repository +public interface TaskDoneHistoryMapper extends BaseMapper<TaskDoneHistoryDO> { + +} diff --git a/src/main/java/com/meishu/mapper/UserRoleCopy1Mapper.java b/src/main/java/com/meishu/mapper/UserRoleCopy1Mapper.java new file mode 100644 index 0000000..c438468 --- /dev/null +++ b/src/main/java/com/meishu/mapper/UserRoleCopy1Mapper.java @@ -0,0 +1,18 @@ +package com.meishu.mapper; + +import com.meishu.model.UserRoleCopy1DO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + * <p> + * 学生表 Mapper 接口 + * </p> + * + * @author DengMin + * @since 2021-09-23 + */ + @Repository +public interface UserRoleCopy1Mapper extends BaseMapper<UserRoleCopy1DO> { + +} diff --git a/src/main/java/com/meishu/mapper/UserRoleMapper.java b/src/main/java/com/meishu/mapper/UserRoleMapper.java new file mode 100644 index 0000000..e66349f --- /dev/null +++ b/src/main/java/com/meishu/mapper/UserRoleMapper.java @@ -0,0 +1,38 @@ +package com.meishu.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.meishu.dto.userrole.QueryStudentsDTO; +import com.meishu.model.ClassesDictDO; +import com.meishu.model.UserRoleDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.meishu.vo.userrole.QueryStudentsVO; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * <p> + * 学生表 Mapper 接口 + * </p> + * + * @author Tuyp + * @since 2021-08-16 + */ +@Repository +public interface UserRoleMapper extends BaseMapper<UserRoleDO> { + + /** + * 分页查询学生 + */ + IPage<QueryStudentsVO> queryStudents(IPage iPage, String userName, String grade, String session, String userStatus); + + /** + * 不分页 + */ + List<QueryStudentsVO> exportStudents(String userName, String grade, String session, String userStatus); + + /** + * 通过班级id查找这个班级里所有人的openId + */ + List<UserRoleDO> findOpenIdByClassId(Integer id); +} diff --git a/src/main/java/com/meishu/mapper/UserSubjectMappingMapper.java b/src/main/java/com/meishu/mapper/UserSubjectMappingMapper.java new file mode 100644 index 0000000..412ccca --- /dev/null +++ b/src/main/java/com/meishu/mapper/UserSubjectMappingMapper.java @@ -0,0 +1,27 @@ +package com.meishu.mapper; + +import com.meishu.model.AdministerDO; +import com.meishu.model.UserSubjectMappingDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * <p> + * 老师-科目映射表 Mapper 接口 + * </p> + * + * @author Tuyp + * @since 2021-08-17 + */ + @Repository +public interface UserSubjectMappingMapper extends BaseMapper<UserSubjectMappingDO> { + + /** + * 查询某个科目下的授课老师 + */ + List<AdministerDO> querySubjectTeachers(Integer subjectId); + + +} diff --git a/src/main/java/com/meishu/mapper/UserSubjectPermissionDictMapper.java b/src/main/java/com/meishu/mapper/UserSubjectPermissionDictMapper.java new file mode 100644 index 0000000..cd2906f --- /dev/null +++ b/src/main/java/com/meishu/mapper/UserSubjectPermissionDictMapper.java @@ -0,0 +1,23 @@ +package com.meishu.mapper; + +import com.meishu.model.SubjectDictDO; +import com.meishu.model.UserSubjectPermissionDictDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * <p> + * 平时成绩---老师班级权限 Mapper 接口 + * </p> + * + * @author Tuyp + * @since 2021-08-18 + */ + @Repository +public interface UserSubjectPermissionDictMapper extends BaseMapper<UserSubjectPermissionDictDO> { + + List<SubjectDictDO> getSubjects(Integer id); + +} diff --git a/src/main/java/com/meishu/mapper/UuidHistoryMapper.java b/src/main/java/com/meishu/mapper/UuidHistoryMapper.java new file mode 100644 index 0000000..0b92547 --- /dev/null +++ b/src/main/java/com/meishu/mapper/UuidHistoryMapper.java @@ -0,0 +1,18 @@ +package com.meishu.mapper; + +import com.meishu.model.UuidHistoryDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + * <p> + * Mapper 接口 + * </p> + * + * @author DengMin + * @since 2021-09-29 + */ + @Repository +public interface UuidHistoryMapper extends BaseMapper<UuidHistoryDO> { + +} diff --git a/src/main/java/com/meishu/mapper/VodDictMapper.java b/src/main/java/com/meishu/mapper/VodDictMapper.java new file mode 100644 index 0000000..8190b97 --- /dev/null +++ b/src/main/java/com/meishu/mapper/VodDictMapper.java @@ -0,0 +1,53 @@ +package com.meishu.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.meishu.dto.student.SearchVodsDTO; +import com.meishu.dto.task.GetRecommendVodByTreeIdVO; +import com.meishu.model.SubjectTreeDO; +import com.meishu.model.VodDictDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.meishu.vo.student.SearchVodsVO; +import com.meishu.vo.voddict.GetTreeVodsVO; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * <p> + * 视频字典表 Mapper 接口 + * </p> + * + * @author Tuyp + * @since 2021-04-27 + */ +@Repository +public interface VodDictMapper extends BaseMapper<VodDictDO> { + + IPage<GetTreeVodsVO> getTreeVods(IPage iPage, Long treeId,String subjectEn, String vodName, String vodType,String shareStatus,Long userId,List<String> longs,String checkStatus); + + /** + * 查找科目下某个视频的知识点 + * @param id + * @return + */ + List<SubjectTreeDO> getTrees(Long id); + + /** + * 小程序搜索视频 + */ + List<SearchVodsVO> searchVods(SearchVodsDTO searchVodsDTO); + + /** + * 课程查找视频锁关联的知识点 + */ + List<SubjectTreeDO> getVodTrees(Long vodId); + + /** + * 修改视频的审核状态 + */ + void updateStatus(Long id,String status); + + List<VodDictDO> getRecommendVodByTreeId(GetRecommendVodByTreeIdVO getRecommendVodByTreeIdVO); + + +} diff --git a/src/main/java/com/meishu/mapper/VodPlayHistoryMapper.java b/src/main/java/com/meishu/mapper/VodPlayHistoryMapper.java new file mode 100644 index 0000000..16f4f9e --- /dev/null +++ b/src/main/java/com/meishu/mapper/VodPlayHistoryMapper.java @@ -0,0 +1,57 @@ +package com.meishu.mapper; + +import com.meishu.dto.task.GetUserVodPlayDTO; +import com.meishu.model.VodDictDO; +import com.meishu.model.VodPlayHistoryDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.meishu.vo.PerStudentComplicationVO; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * <p> + * 视频播放历史记录表 Mapper 接口 + * </p> + * + * @author Tuyp + * @since 2021-04-27 + */ + @Repository +public interface VodPlayHistoryMapper extends BaseMapper<VodPlayHistoryDO> { + + /** + * 获取某个学生某个视频看到的最大位点 + * @param studentId + * @param vodId + * @return + */ + int getMaxPlayRecord(Long studentId,Long vodId); + + + /** + * 获取学生完成某课程所有视频中的多少个视频 + * @param studentId + * @param vodIds + * @return + */ + List<Long> getStudyVod(@Param("studentId") Long studentId,@Param("vodIds") List<Long> vodIds); + + /** + * 获取学生某个课程学习的总时长 + */ + Integer totalLength(Long studentId,List<Long> vodIds); + + /** + * 获取学生最近一次看视频的时间 + */ + String getMaxPlayTime(Long studentId,Long vodId); + + /** + * 查看视频的播放量 + */ + Integer queryPlayCounts(Long id); + + List<PerStudentComplicationVO> getCurrentUserVodPlayVO(GetUserVodPlayDTO getUserVodPlayRequestVO); +} diff --git a/src/main/java/com/meishu/mapper/VodSubjectTreeMappingMapper.java b/src/main/java/com/meishu/mapper/VodSubjectTreeMappingMapper.java new file mode 100644 index 0000000..ca5cc2c --- /dev/null +++ b/src/main/java/com/meishu/mapper/VodSubjectTreeMappingMapper.java @@ -0,0 +1,33 @@ +package com.meishu.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.meishu.model.VodSubjectTreeMappingDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.meishu.vo.subject.GetAllNoAuthenVodsVO; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * <p> + * 视频知识点映射表 Mapper 接口 + * </p> + * + * @author Tuyp + * @since 2021-04-27 + */ +@Repository +public interface VodSubjectTreeMappingMapper extends BaseMapper<VodSubjectTreeMappingDO> { + + + /** + * 获取已审核/未审核的视频列表 + */ + IPage<GetAllNoAuthenVodsVO> getAllNoAuthenVods(IPage page, Long treeId, String status, String vodType); + + /** + * 查看挂在知识点上的视频数 + */ + Integer getTreeVodCount(Long userId,Long treeId,String shareStatus,String subject,String checkStatus); + +} diff --git a/src/main/java/com/meishu/mapper/WrittenHomeworkMapper.java b/src/main/java/com/meishu/mapper/WrittenHomeworkMapper.java new file mode 100644 index 0000000..1c13c89 --- /dev/null +++ b/src/main/java/com/meishu/mapper/WrittenHomeworkMapper.java @@ -0,0 +1,18 @@ +package com.meishu.mapper; + +import com.meishu.model.WrittenHomeworkDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + * <p> + * 通知/附件作业表 Mapper 接口 + * </p> + * + * @author DengMin + * @since 2021-09-16 + */ + @Repository +public interface WrittenHomeworkMapper extends BaseMapper<WrittenHomeworkDO> { + +} diff --git a/src/main/java/com/meishu/model/AccessTokenDO.java b/src/main/java/com/meishu/model/AccessTokenDO.java new file mode 100644 index 0000000..9d44bec --- /dev/null +++ b/src/main/java/com/meishu/model/AccessTokenDO.java @@ -0,0 +1,31 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * <p> + * + * </p> + * + * @author Tuyp + * @since 2021-05-10 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("access_token") +public class AccessTokenDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + private String accessToken; + + +} diff --git a/src/main/java/com/meishu/model/AdministerDO.java b/src/main/java/com/meishu/model/AdministerDO.java new file mode 100644 index 0000000..9d0f212 --- /dev/null +++ b/src/main/java/com/meishu/model/AdministerDO.java @@ -0,0 +1,77 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * <p> + * 中心管理账户表 + * </p> + * + * @author Tuyp + * @since 2021-04-25 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("administer") +public class AdministerDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 手机号 + */ + private String telephone; + + /** + * 密码 + */ + private String password; + + /** + * 成员名称 + */ + private String userName; + + /** + * 头像 + */ + private String img; + + /** + * 管理员/超级管理员 + */ + private String role; + + /** + * 启用状态 0:禁用 1:启用 + */ + private String status; + + /** + * 介绍 + */ + private String intro; + + /** + * 部门id 废弃 + */ + private Long departmentId; + + /** + * openId + */ + private String openId; + + +} diff --git a/src/main/java/com/meishu/model/AdministerDepartmentMappingDO.java b/src/main/java/com/meishu/model/AdministerDepartmentMappingDO.java new file mode 100644 index 0000000..0a45278 --- /dev/null +++ b/src/main/java/com/meishu/model/AdministerDepartmentMappingDO.java @@ -0,0 +1,39 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * <p> + * 老师部门映射表 + * </p> + * + * @author Tuyp + * @since 2021-07-01 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("administer_department_mapping") +public class AdministerDepartmentMappingDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 老师id + */ + private Long administerId; + + /** + * 部门id + */ + private Long departmentId; + + +} diff --git a/src/main/java/com/meishu/model/AdministerPermissionDO.java b/src/main/java/com/meishu/model/AdministerPermissionDO.java new file mode 100644 index 0000000..80fa20d --- /dev/null +++ b/src/main/java/com/meishu/model/AdministerPermissionDO.java @@ -0,0 +1,39 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * <p> + * 系统用户角色表 + * </p> + * + * @author Tuyp + * @since 2021-04-25 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("administer_permission") +public class AdministerPermissionDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 用户账户ID + */ + private Long administerId; + + /** + * 角色ID + */ + private Long permissionId; + + +} diff --git a/src/main/java/com/meishu/model/AdministerSubjectMappingDO.java b/src/main/java/com/meishu/model/AdministerSubjectMappingDO.java new file mode 100644 index 0000000..47ee52f --- /dev/null +++ b/src/main/java/com/meishu/model/AdministerSubjectMappingDO.java @@ -0,0 +1,39 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * <p> + * 老师科目映射表 + * </p> + * + * @author Tuyp + * @since 2021-07-01 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("administer_subject_mapping") +public class AdministerSubjectMappingDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 科目id + */ + private Long subjectId; + + /** + * 老师id + */ + private Long administerId; + + +} diff --git a/src/main/java/com/meishu/model/AnsweringQuestionDO.java b/src/main/java/com/meishu/model/AnsweringQuestionDO.java new file mode 100644 index 0000000..6f51acd --- /dev/null +++ b/src/main/java/com/meishu/model/AnsweringQuestionDO.java @@ -0,0 +1,49 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * <p> + * 问题答疑表 + * </p> + * + * @author DengMin + * @since 2021-09-28 + */ +@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 Integer subjectId; + + /** + * 提问id + */ + private Integer askId; + + /** + * 问题 + */ + private String title; + + /** + * 答案 + */ + private String answer; + + +} diff --git a/src/main/java/com/meishu/model/CampusAdministerMappingDO.java b/src/main/java/com/meishu/model/CampusAdministerMappingDO.java new file mode 100644 index 0000000..5481f50 --- /dev/null +++ b/src/main/java/com/meishu/model/CampusAdministerMappingDO.java @@ -0,0 +1,33 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * <p> + * + * </p> + * + * @author Tuyp + * @since 2021-04-25 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("campus_administer_mapping") +public class CampusAdministerMappingDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + private Long administerId; + + private Long campusId; + + +} diff --git a/src/main/java/com/meishu/model/CampusDictDO.java b/src/main/java/com/meishu/model/CampusDictDO.java new file mode 100644 index 0000000..5a5cff7 --- /dev/null +++ b/src/main/java/com/meishu/model/CampusDictDO.java @@ -0,0 +1,52 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import com.meishu.vo.campus.CampusListVO; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.List; + +/** + * <p> + * 校区字典表 + * </p> + * + * @author Tuyp + * @since 2021-04-25 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("campus_dict") +public class CampusDictDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 校区 + */ + private String campus; + + /** + * 父节点id + */ + private Long parentId; + + /** + * 负责人 + */ + private Long administerId; + + /** + * 子类 + */ + private List<CampusDictDO> children; + + +} diff --git a/src/main/java/com/meishu/model/ClassSubjectTaskDO.java b/src/main/java/com/meishu/model/ClassSubjectTaskDO.java new file mode 100644 index 0000000..df7a579 --- /dev/null +++ b/src/main/java/com/meishu/model/ClassSubjectTaskDO.java @@ -0,0 +1,61 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.util.Date; +import java.util.List; + +/** + * @author: tuyp + * @create: 2020-06-03 14:28 + */ +@Data +@TableName("class_subject_task") +public class ClassSubjectTaskDO { + + + @TableId(type = IdType.AUTO) + private Integer id; + + private Integer subjectId; + + private String treeId; + + private String treeName; + + private Date taskDate; + + private Integer teacherId; + + /** + * 作业类型 0:预习作业 1课后作业 + */ + private Integer taskType; + + private String subjectEn; + + private Integer classId; + + private String grade; + + private String classes; + + private String session; + + private String subjectType; + + private String className; + + private String semester; + + private Date createDate; + + private Date updateDate; + + private Date deleteDate; + + +} diff --git a/src/main/java/com/meishu/model/ClassesDictDO.java b/src/main/java/com/meishu/model/ClassesDictDO.java new file mode 100644 index 0000000..ad2cd6f --- /dev/null +++ b/src/main/java/com/meishu/model/ClassesDictDO.java @@ -0,0 +1,76 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * <p> + * 学校班级字典表 + * </p> + * + * @author Tuyp + * @since 2021-08-11 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("classes_dict") +public class ClassesDictDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + /** + * 学校 + */ + private String school; + + /** + * 年级 + */ + private String grade; + + /** + * 班级 + */ + private String classes; + + /** + * 级 + */ + private String session; + + /** + * 小学/初中/高中 + */ + private String subjectType; + + /** + * 班级名称 + */ + private String className; + + /** + * 学期 --弃用 + */ + private String semester; + + /** + * 1:在读/0:往届 + */ + private String status; + + /** + * 晋升时间 + */ + private Date upgradeDate; + + +} diff --git a/src/main/java/com/meishu/model/ClassesDictHistoryDO.java b/src/main/java/com/meishu/model/ClassesDictHistoryDO.java new file mode 100644 index 0000000..56d54b9 --- /dev/null +++ b/src/main/java/com/meishu/model/ClassesDictHistoryDO.java @@ -0,0 +1,74 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * <p> + * 学校班级字典表 + * </p> + * + * @author Tuyp + * @since 2021-08-11 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("classes_dict_history") +public class ClassesDictHistoryDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + /** + * class_dict表的主键 + */ + private Integer classDictId; + + /** + * 学校 + */ + private String school; + + /** + * 年级 + */ + private String grade; + + /** + * 班级 + */ + private String classes; + + /** + * 级 + */ + private String session; + + /** + * 小学/初中/高中 + */ + private String subjectType; + + /** + * 班级名称 + */ + private String className; + + /** + * 学期 + */ + private String semester; + + /** + * 1:在读/0:往届 + */ + private String status; + + +} diff --git a/src/main/java/com/meishu/model/ClassesUserMappingDO.java b/src/main/java/com/meishu/model/ClassesUserMappingDO.java new file mode 100644 index 0000000..0cff2e5 --- /dev/null +++ b/src/main/java/com/meishu/model/ClassesUserMappingDO.java @@ -0,0 +1,44 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * <p> + * 班级--学生--映射表(包括以前的班级) + * </p> + * + * @author Tuyp + * @since 2021-08-17 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("classes_user_mapping") +public class ClassesUserMappingDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + /** + * 班级id + */ + private Integer classesId; + + /** + * 学生id + */ + private Integer userId; + + /** + * 1 应届班级 0 以往班级 + */ + private Integer status; + + +} diff --git a/src/main/java/com/meishu/model/CourseAdministerMappingDO.java b/src/main/java/com/meishu/model/CourseAdministerMappingDO.java new file mode 100644 index 0000000..c53b9d2 --- /dev/null +++ b/src/main/java/com/meishu/model/CourseAdministerMappingDO.java @@ -0,0 +1,39 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * <p> + * 课程老师映射表 + * </p> + * + * @author Tuyp + * @since 2021-05-25 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("course_administer_mapping") +public class CourseAdministerMappingDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 课程id + */ + private Long courseId; + + /** + * 老师id + */ + private Long administerId; + + +} diff --git a/src/main/java/com/meishu/model/CourseChapterDO.java b/src/main/java/com/meishu/model/CourseChapterDO.java new file mode 100644 index 0000000..8c80965 --- /dev/null +++ b/src/main/java/com/meishu/model/CourseChapterDO.java @@ -0,0 +1,44 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * <p> + * 科目章节字典表 + * </p> + * + * @author Tuyp + * @since 2021-05-13 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("course_chapter") +public class CourseChapterDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 科目id + */ + private Long courseId; + + /** + * 章节 + */ + private String chapter; + + /** + * 排序 + */ + private Integer orderNo; + + +} diff --git a/src/main/java/com/meishu/model/CourseDictDO.java b/src/main/java/com/meishu/model/CourseDictDO.java new file mode 100644 index 0000000..75328e1 --- /dev/null +++ b/src/main/java/com/meishu/model/CourseDictDO.java @@ -0,0 +1,59 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * <p> + * 课程字典表 + * </p> + * + * @author Tuyp + * @since 2021-05-12 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("course_dict") +public class CourseDictDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 科目id + */ + private Long subjectId; + + /** + * 课程名称 + */ + private String courseName; + + /** + * 必修课程 拓展课程 + */ + private String courseType; + + /** + * courseIntro + */ + private String courseIntro; + + /** + * 课程封面 + */ + private String coverPage; + + /** + * 主页色值 + */ + private String pageColor; + + +} diff --git a/src/main/java/com/meishu/model/CourseStudentStatusHistoryDO.java b/src/main/java/com/meishu/model/CourseStudentStatusHistoryDO.java new file mode 100644 index 0000000..7bc781a --- /dev/null +++ b/src/main/java/com/meishu/model/CourseStudentStatusHistoryDO.java @@ -0,0 +1,60 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * <p> + * + * </p> + * + * @author Tuyp + * @since 2021-05-27 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("course_student_status_history") +public class CourseStudentStatusHistoryDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 课程id + */ + private Long courseId; + + /** + * 学生id + */ + private Long studentId; + + /** + * 状态 + */ + private String status; + + /** + * 开始时间 + */ + private String startDate; + + /** + * 结束时间 + */ + private String endDate; + + /** + * 授权人 + */ + private Long administerId; + + + +} diff --git a/src/main/java/com/meishu/model/CourseTreeDO.java b/src/main/java/com/meishu/model/CourseTreeDO.java new file mode 100644 index 0000000..32126f6 --- /dev/null +++ b/src/main/java/com/meishu/model/CourseTreeDO.java @@ -0,0 +1,85 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.List; + +/** + * <p> + * + * </p> + * + * @author Tuyp + * @since 2021-05-12 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("course_tree") +public class CourseTreeDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 知识树id,对应subject_tree的主键 + */ + private Long treeId; + + /** + * 课程id + */ + private Long courseId; + + /** + * 状态 0:禁用 1:启用 + */ + private String status; + + /** + * 父节点(tree_id的父节点) + */ + private Long parentId; + + /** + * 0:在学生端不展示 1:在学生端展示 + */ + private String isShow; + + /** + * 章节 + */ + private Integer chapterId; + + /** + * 知识点节点 + */ + private String treeNode; + + /** + * 知识点名称 + */ + private String treeName; + + /** + * 写程序使用,数据库不存值 + */ + private List<CourseTreeDO> children; + + /** + * 子节点个数 + */ + private Integer childNodeCounts; + + /** + * 课程顺序 + */ + private Integer treeOrder; + +} diff --git a/src/main/java/com/meishu/model/CourseTreeExerciseStudentResultDO.java b/src/main/java/com/meishu/model/CourseTreeExerciseStudentResultDO.java new file mode 100644 index 0000000..b6d7375 --- /dev/null +++ b/src/main/java/com/meishu/model/CourseTreeExerciseStudentResultDO.java @@ -0,0 +1,63 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * <p> + * 课程--学生做题记录 + * </p> + * + * @author Tuyp + * @since 2021-05-25 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("course_tree_exercise_student_result") +public class CourseTreeExerciseStudentResultDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 学生id + */ + private Long studentId; + + /** + * 课程id + */ + private Long courseId; + + /** + * 章节id + */ + private Long chapterId; + + /** + * 题目id + */ + private Long exerciseId; + + /** + * 答案 + */ + private String answer; + + /** + * 花费时间 + */ + private Integer length; + + /** + * 0:错误 1:正确 + */ + private String result; + +} diff --git a/src/main/java/com/meishu/model/CourseTreeVodStudentResultDO.java b/src/main/java/com/meishu/model/CourseTreeVodStudentResultDO.java new file mode 100644 index 0000000..3e36524 --- /dev/null +++ b/src/main/java/com/meishu/model/CourseTreeVodStudentResultDO.java @@ -0,0 +1,39 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * <p> + * 学生视频完成情况 + * </p> + * + * @author Tuyp + * @since 2021-05-13 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("course_tree_vod_student_result") +public class CourseTreeVodStudentResultDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 学生id + */ + private Long studentId; + + /** + * 课程知识树id + */ + private Long courseTreeId; + + +} diff --git a/src/main/java/com/meishu/model/DepartmentDictDO.java b/src/main/java/com/meishu/model/DepartmentDictDO.java new file mode 100644 index 0000000..4458b6d --- /dev/null +++ b/src/main/java/com/meishu/model/DepartmentDictDO.java @@ -0,0 +1,53 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.List; + +/** + * <p> + * 部门字典表 + * </p> + * + * @author Tuyp + * @since 2021-04-25 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("department_dict") +public class DepartmentDictDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 部门名称 + */ + private String departmentName; + + /** + * 部门负责人id + */ + private Long departmentLeaderId; + + /** + * 父节点id + */ + private Long parentId; + + /** + * 子节点 字段在数据库里没有值 + */ + private List<DepartmentDictDO> children; + +} diff --git a/src/main/java/com/meishu/model/ExerciseCourseTreeMappingDO.java b/src/main/java/com/meishu/model/ExerciseCourseTreeMappingDO.java new file mode 100644 index 0000000..bcaa1f1 --- /dev/null +++ b/src/main/java/com/meishu/model/ExerciseCourseTreeMappingDO.java @@ -0,0 +1,51 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * <p> + * 课程知识树--题目字典表 + * </p> + * + * @author Tuyp + * @since 2021-05-24 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("exercise_course_tree_mapping") +public class ExerciseCourseTreeMappingDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 题目id + */ + private Long exerciseId; + + /** + * 课程id + */ + private Long courseId; + + /** + * 课程知识点course_treed的主键id + */ + private Long courseTreeId; + + /** + * 状态 + */ + private String status; + + + + +} diff --git a/src/main/java/com/meishu/model/ExerciseDictDO.java b/src/main/java/com/meishu/model/ExerciseDictDO.java new file mode 100644 index 0000000..69637c9 --- /dev/null +++ b/src/main/java/com/meishu/model/ExerciseDictDO.java @@ -0,0 +1,99 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.springframework.beans.factory.annotation.Autowired; + +/** + * <p> + * 习题库 + * </p> + * + * @author Tuyp + * @since 2021-04-27 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("exercise_dict") +public class ExerciseDictDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 科目id + */ + @TableField("subject") + private String subjectId; + + /** + * 题目类型 选择/填空 + */ + private String exerciseType; + + /** + * 提供者 + */ + @TableField("user_id") + private Long administerId; + + /** + * 难度 + */ + private Integer difficulty; + + /** + * 题目 + */ + private String title; + + /** + * 选项 + */ + private String items; + + /** + * 正确答案 + */ + private String rightAnswer; + + /** + * 解析 + */ + private String detail; + + /** + * 审核状态 + */ + private String status; + + /** + * 共享状态 + */ + private String shareStatus; + + /** + * 审核状态 + */ + private String checkStatus; + + /** + * 建议时长 + */ + private Integer adviceLength; + + /** + * 不通过原因 + */ + private String reason; + + + +} diff --git a/src/main/java/com/meishu/model/ExerciseDoneHistoryDO.java b/src/main/java/com/meishu/model/ExerciseDoneHistoryDO.java new file mode 100644 index 0000000..c3e6fc3 --- /dev/null +++ b/src/main/java/com/meishu/model/ExerciseDoneHistoryDO.java @@ -0,0 +1,69 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * <p> + * 学生做题记录表 + * </p> + * + * @author Tuyp + * @since 2021-04-27 + */ +@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 exerciseId; + + /** + * 做题答案 /已读 + */ + private String answer; + + /** + * 结果 0:错误 1:正确 + */ + private Integer result; + + /** + * 做题时长 + */ + private Integer length; + + private Integer userId; + + //班级类型 0:行政班 1:进阶班 + private Integer classType; + + // 0:关联习题 1:拓展习题 + private Integer exerciseType; + + private Integer taskSubjectId; + + //作业内容id + private Integer contentId; + + private Integer completeId; + + private String doneType; + + +} diff --git a/src/main/java/com/meishu/model/ExerciseExpandMappingDO.java b/src/main/java/com/meishu/model/ExerciseExpandMappingDO.java new file mode 100644 index 0000000..7b668ce --- /dev/null +++ b/src/main/java/com/meishu/model/ExerciseExpandMappingDO.java @@ -0,0 +1,49 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * <p> + * 学生--拓展习题映射表 + * </p> + * + * @author DengMin + * @since 2021-09-16 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("exercise_expand_mapping") +public class ExerciseExpandMappingDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + /** + * 任务id + */ + private Integer taskId; + + /** + * 拓展习题ids + */ + private String exerciseIds; + + /** + * 学生ids + */ + private String studentIds; + + /** + * 拓展习题名称 + */ + private String exerciseName; + + +} diff --git a/src/main/java/com/meishu/model/ExerciseRelatedMappingDO.java b/src/main/java/com/meishu/model/ExerciseRelatedMappingDO.java new file mode 100644 index 0000000..a7687cc --- /dev/null +++ b/src/main/java/com/meishu/model/ExerciseRelatedMappingDO.java @@ -0,0 +1,53 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * <p> + * 学生--拓展习题映射表 + * </p> + * + * @author DengMin + * @since 2021-09-28 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("exercise_related_mapping") +public class ExerciseRelatedMappingDO extends BaseModel { + + + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + /** + * 任务id + */ + private Integer taskId; + + /** + * 知识点id + */ + private Integer treeId; + + /** + * 拓展习题ids + */ + private String exerciseIds; + + /** + * 学生ids + */ + private String studentIds; + + /** + * 拓展习题名称 + */ + private String exerciseName; + + +} diff --git a/src/main/java/com/meishu/model/ExerciseTreeMappingDO.java b/src/main/java/com/meishu/model/ExerciseTreeMappingDO.java new file mode 100644 index 0000000..e53ad36 --- /dev/null +++ b/src/main/java/com/meishu/model/ExerciseTreeMappingDO.java @@ -0,0 +1,36 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * <p> + * 科目下题目知识树映射表 + * </p> + * + * @author Tuyp + * @since 2021-04-27 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("exercise_related") +public class ExerciseTreeMappingDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + private Long exerciseId; + + private Long treeId; + + //private Long subjectId; + + private String status; + +} diff --git a/src/main/java/com/meishu/model/ExerciseUserInfoDO.java b/src/main/java/com/meishu/model/ExerciseUserInfoDO.java new file mode 100644 index 0000000..ab2f21d --- /dev/null +++ b/src/main/java/com/meishu/model/ExerciseUserInfoDO.java @@ -0,0 +1,44 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * <p> + * 题目收藏信息表 + * </p> + * + * @author DengMin + * @since 2021-09-17 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("exercise_user_info") +public class ExerciseUserInfoDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + /** + * 练习题id + */ + private Integer exerciseId; + + /** + * 学员id + */ + private Integer userId; + + /** + * 收藏状态 + */ + private Integer collectionStatus; + + +} diff --git a/src/main/java/com/meishu/model/KnowledgeSubjectDictDO.java b/src/main/java/com/meishu/model/KnowledgeSubjectDictDO.java new file mode 100644 index 0000000..e72a940 --- /dev/null +++ b/src/main/java/com/meishu/model/KnowledgeSubjectDictDO.java @@ -0,0 +1,49 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * <p> + * 学科字典表 + * </p> + * + * @author Tuyp + * @since 2021-04-27 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("knowledge_subject_dict") +public class KnowledgeSubjectDictDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 学科名称 + */ + private String subjectName; + + + /** + * 科目缩写 + */ + private String subjectEn; + + /** + * 封面 + */ + private String coverPage; + + /** + * 学科类型 + */ + private String subjectType; + +} diff --git a/src/main/java/com/meishu/model/LaboratoryAttendanceMappingDO.java b/src/main/java/com/meishu/model/LaboratoryAttendanceMappingDO.java new file mode 100644 index 0000000..38dcdce --- /dev/null +++ b/src/main/java/com/meishu/model/LaboratoryAttendanceMappingDO.java @@ -0,0 +1,50 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import java.time.LocalDateTime; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * <p> + * 实验室场次预约考勤记录 + * </p> + * + * @author DengMin + * @since 2021-09-15 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("laboratory_attendance_mapping") +public class LaboratoryAttendanceMappingDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 学生ID + */ + private Long userRoleId; + + /** + * 实验室场次预约安排表ID + */ + private Long laboratorySessionId; + + /** + * 考勤时间 + */ + private LocalDateTime attendanceTime; + + /** + * 考勤方式 + */ + private String channel; + + +} diff --git a/src/main/java/com/meishu/model/LaboratoryDictDO.java b/src/main/java/com/meishu/model/LaboratoryDictDO.java new file mode 100644 index 0000000..f28922a --- /dev/null +++ b/src/main/java/com/meishu/model/LaboratoryDictDO.java @@ -0,0 +1,44 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * <p> + * 实验室 + * </p> + * + * @author DengMin + * @since 2021-08-17 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("laboratory_dict") +public class LaboratoryDictDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 实验室名称 + */ + private String laboratoryName; + + /** + * 实验室类型 + */ + private String laboratoryType; + + /** + * 人数上限 + */ + private Integer maxNum; + + +} diff --git a/src/main/java/com/meishu/model/LaboratoryDictMappingDO.java b/src/main/java/com/meishu/model/LaboratoryDictMappingDO.java new file mode 100644 index 0000000..825e73f --- /dev/null +++ b/src/main/java/com/meishu/model/LaboratoryDictMappingDO.java @@ -0,0 +1,39 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * <p> + * 实验室场次关联表 + * </p> + * + * @author DengMin + * @since 2021-08-30 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("laboratory_dict_mapping") +public class LaboratoryDictMappingDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 实验室ID + */ + private Long laboratoryDictId; + + /** + * 场次ID + */ + private Long sessionsDictId; + + +} diff --git a/src/main/java/com/meishu/model/LaboratorySessionMappingDO.java b/src/main/java/com/meishu/model/LaboratorySessionMappingDO.java new file mode 100644 index 0000000..a375033 --- /dev/null +++ b/src/main/java/com/meishu/model/LaboratorySessionMappingDO.java @@ -0,0 +1,59 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * <p> + * 实验室场次预约安排表 + * </p> + * + * @author DengMin + * @since 2021-08-17 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("laboratory_session_mapping") +public class LaboratorySessionMappingDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 场次ID + */ + private Long sessionsDictId; + + /** + * 实验室ID + */ + private Long laboratoryDictId; + + /** + * 开始时间 + */ + private String startDate; + + /** + * 报名开始时间 + */ + private String registerStartDate; + + /** + * 报名结束时间 + */ + private String registerEndDate; + + /** + * 年级 + */ + private String grade; + + +} diff --git a/src/main/java/com/meishu/model/LaboratoryUserMappingDO.java b/src/main/java/com/meishu/model/LaboratoryUserMappingDO.java new file mode 100644 index 0000000..bc59c52 --- /dev/null +++ b/src/main/java/com/meishu/model/LaboratoryUserMappingDO.java @@ -0,0 +1,39 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * <p> + * 实验室场次预约报名记录 + * </p> + * + * @author DengMin + * @since 2021-08-17 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("laboratory_user_mapping") +public class LaboratoryUserMappingDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 实验室场次预约安排表ID + */ + private Long laboratorySessionId; + + /** + * 学生ID + */ + private Long userRoleId; + + +} diff --git a/src/main/java/com/meishu/model/PermissionsDictDO.java b/src/main/java/com/meishu/model/PermissionsDictDO.java new file mode 100644 index 0000000..254132d --- /dev/null +++ b/src/main/java/com/meishu/model/PermissionsDictDO.java @@ -0,0 +1,45 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.List; + +/** + * <p> + * 权限表 + * </p> + * + * @author Tuyp + * @since 2021-04-26 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("permissions_dict") +public class PermissionsDictDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 父级ID + */ + private Long parentId; + + /** + * 名称 + */ + private String name; + + /** + * 子节点 代码使用 无实际意义 + */ + private List<PermissionsDictDO> children; + +} diff --git a/src/main/java/com/meishu/model/PtStudentScoreDO.java b/src/main/java/com/meishu/model/PtStudentScoreDO.java new file mode 100644 index 0000000..4ab62b8 --- /dev/null +++ b/src/main/java/com/meishu/model/PtStudentScoreDO.java @@ -0,0 +1,54 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * <p> + * + * </p> + * + * @author DengMin + * @since 2021-09-02 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("pt_student_score") +public class PtStudentScoreDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + /** + * 学生id + */ + private Integer studentId; + + /** + * 科目id + */ + private Integer subjectId; + + /** + * 学科+学期id + */ + private Integer semesterId; + + /** + * 分数 + */ + private Double score; + + /** + * 和record表对应的分数 + */ + private Double scoreRecord; + + +} diff --git a/src/main/java/com/meishu/model/RoleAdministerMappingDO.java b/src/main/java/com/meishu/model/RoleAdministerMappingDO.java new file mode 100644 index 0000000..16a87fe --- /dev/null +++ b/src/main/java/com/meishu/model/RoleAdministerMappingDO.java @@ -0,0 +1,33 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * <p> + * + * </p> + * + * @author Tuyp + * @since 2021-04-26 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("role_administer_mapping") +public class RoleAdministerMappingDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + private Long administerId; + + private Long roleId; + + +} diff --git a/src/main/java/com/meishu/model/RoleDictDO.java b/src/main/java/com/meishu/model/RoleDictDO.java new file mode 100644 index 0000000..2010693 --- /dev/null +++ b/src/main/java/com/meishu/model/RoleDictDO.java @@ -0,0 +1,34 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * <p> + * 角色表 + * </p> + * + * @author Tuyp + * @since 2021-04-26 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("role_dict") +public class RoleDictDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 角色 + */ + private String role; + + +} diff --git a/src/main/java/com/meishu/model/RolePermissionMappingDO.java b/src/main/java/com/meishu/model/RolePermissionMappingDO.java new file mode 100644 index 0000000..1303c8b --- /dev/null +++ b/src/main/java/com/meishu/model/RolePermissionMappingDO.java @@ -0,0 +1,39 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * <p> + * 系统用户角色表 + * </p> + * + * @author Tuyp + * @since 2021-04-26 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("role_permission_mapping") +public class RolePermissionMappingDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 权限ID + */ + private Long roleId; + + /** + * 角色ID + */ + private Long permissionId; + + +} diff --git a/src/main/java/com/meishu/model/SessionsDictDO.java b/src/main/java/com/meishu/model/SessionsDictDO.java new file mode 100644 index 0000000..af34282 --- /dev/null +++ b/src/main/java/com/meishu/model/SessionsDictDO.java @@ -0,0 +1,34 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * <p> + * 场次字典表 + * </p> + * + * @author DengMin + * @since 2021-08-17 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("sessions_dict") +public class SessionsDictDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 场次 + */ + private String timeSlot; + + +} diff --git a/src/main/java/com/meishu/model/SignInRecordDO.java b/src/main/java/com/meishu/model/SignInRecordDO.java new file mode 100644 index 0000000..65f6edf --- /dev/null +++ b/src/main/java/com/meishu/model/SignInRecordDO.java @@ -0,0 +1,45 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import java.time.LocalDateTime; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * <p> + * 学生签到表 + * </p> + * + * @author DengMin + * @since 2021-09-28 + */ +@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/meishu/model/SmsCodeDO.java b/src/main/java/com/meishu/model/SmsCodeDO.java new file mode 100644 index 0000000..f77d95a --- /dev/null +++ b/src/main/java/com/meishu/model/SmsCodeDO.java @@ -0,0 +1,41 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * <p> + * 短信验证码 + * </p> + * + * @author Tuyp + * @since 2021-04-25 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("sms_verify_code") +public class SmsCodeDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 手机号 + */ + private String telephone; + + /** + * 验证码 + */ + @TableField("verify_code") + private String code; + + +} diff --git a/src/main/java/com/meishu/model/StudentCourseMappingDO.java b/src/main/java/com/meishu/model/StudentCourseMappingDO.java new file mode 100644 index 0000000..d7ab67c --- /dev/null +++ b/src/main/java/com/meishu/model/StudentCourseMappingDO.java @@ -0,0 +1,59 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * <p> + * + * </p> + * + * @author Tuyp + * @since 2021-05-17 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("student_course_mapping") +public class StudentCourseMappingDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 学生id + */ + private Long studentId; + + /** + * 课程id + */ + private Long courseId; + + /** + * 起始时间 + */ + private String startDate; + + /** + * 截止时间 + */ + private String endDate; + + /** + * 0:已暂停 1:已启用 + */ + private String status; + + /** + * 授权人 + */ + private Long administerId; + + +} diff --git a/src/main/java/com/meishu/model/StudentDO.java b/src/main/java/com/meishu/model/StudentDO.java new file mode 100644 index 0000000..52720aa --- /dev/null +++ b/src/main/java/com/meishu/model/StudentDO.java @@ -0,0 +1,66 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * <p> + * 白名单 + * </p> + * + * @author Tuyp + * @since 2021-05-08 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("student") +public class StudentDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + private String wechatImg; + + /** + * openid + */ + private String openid; + + /** + * 手机号 + */ + private String telephone; + + /** + * 姓名 + */ + private String username; + + /** + * 0:禁用 1:弃用 + */ + private String status; + + /** + * 家长手机1 + */ + private String parentTelephone1; + + /** + * 家长电话2 + */ + private String parentTelephone2; + + /** + * 校区id + */ + private Long campusId; + + +} diff --git a/src/main/java/com/meishu/model/SubjectDictDO.java b/src/main/java/com/meishu/model/SubjectDictDO.java new file mode 100644 index 0000000..c7893df --- /dev/null +++ b/src/main/java/com/meishu/model/SubjectDictDO.java @@ -0,0 +1,86 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * <p> + * 学校科目字典表 + * </p> + * + * @author Tuyp + * @since 2021-08-17 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("subject_dict") +public class SubjectDictDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + /** + * 学校 + */ + private String school; + + /** + * 年级(可为空) + */ + private String grade; + + /** + * 班级 + */ + private String classes; + + /** + * 班级名称 + */ + private String className; + + private String subject; + + /** + * 科目en + */ + private String subjectEn; + + /** + * 类型: 小学/初中/高中 + */ + private String subjectType; + + /** + * 届 + */ + private String session; + + /** + * 学期--弃用 + */ + private String semester; + + /** + * 状态:在读/结课 + */ + private String status; + + /** + * 班级-科目-封面 + */ + private String coverPageUrl; + + /** + * 班级-科目-首页 + */ + private String frontPageUrl; + + +} diff --git a/src/main/java/com/meishu/model/SubjectDimensionDictDO.java b/src/main/java/com/meishu/model/SubjectDimensionDictDO.java new file mode 100644 index 0000000..d103adb --- /dev/null +++ b/src/main/java/com/meishu/model/SubjectDimensionDictDO.java @@ -0,0 +1,48 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * <p> + * 测评表 + * </p> + * + * @author Tuyp + * @since 2021-05-06 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("subject_dimension_dict") +public class SubjectDimensionDictDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 规则id + */ + private Long ruleId; + + /** + * 维度 + */ + private String dimension; + + /** + * 维度顺序 + */ + private Long dimensionOrder; + + /** + * 0:禁用 1:启用 + */ + private String status; + +} diff --git a/src/main/java/com/meishu/model/SubjectDimensionStarDictDO.java b/src/main/java/com/meishu/model/SubjectDimensionStarDictDO.java new file mode 100644 index 0000000..60043a8 --- /dev/null +++ b/src/main/java/com/meishu/model/SubjectDimensionStarDictDO.java @@ -0,0 +1,44 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * <p> + * 维度星级字典表 + * </p> + * + * @author Tuyp + * @since 2021-05-06 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("subject_dimension_star_dict") +public class SubjectDimensionStarDictDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 维度id + */ + private Long dimensionId; + + /** + * 星级 + */ + private Long star; + + /** + * 评析 + */ + private String description; + + +} diff --git a/src/main/java/com/meishu/model/SubjectRuleDO.java b/src/main/java/com/meishu/model/SubjectRuleDO.java new file mode 100644 index 0000000..974def8 --- /dev/null +++ b/src/main/java/com/meishu/model/SubjectRuleDO.java @@ -0,0 +1,44 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * <p> + * 规则字典表 + * </p> + * + * @author Tuyp + * @since 2021-05-08 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("subject_rule") +public class SubjectRuleDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 科目id + */ + private Long subjectId; + + /** + * 规则名称 + */ + private String ruleName; + + /** + * 0:禁用 1:启用 + */ + private String status; + + +} diff --git a/src/main/java/com/meishu/model/SubjectSemesterDO.java b/src/main/java/com/meishu/model/SubjectSemesterDO.java new file mode 100644 index 0000000..132c966 --- /dev/null +++ b/src/main/java/com/meishu/model/SubjectSemesterDO.java @@ -0,0 +1,47 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * <p> + * + * </p> + * + * @author Tuyp + * @since 2021-08-11 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("subject_semester") +public class SubjectSemesterDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + /** + * 科目id + */ + private Integer subjectId; + + /** + * 学期 上/下 + */ + private String semester; + + /** + * 1 :在读 + */ + private Integer status; + + +} diff --git a/src/main/java/com/meishu/model/SubjectStarTreeMappingDO.java b/src/main/java/com/meishu/model/SubjectStarTreeMappingDO.java new file mode 100644 index 0000000..fdabdf3 --- /dev/null +++ b/src/main/java/com/meishu/model/SubjectStarTreeMappingDO.java @@ -0,0 +1,39 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * <p> + * 测评-知识点关联表 + * </p> + * + * @author Tuyp + * @since 2021-05-06 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("subject_star_tree_mapping") +public class SubjectStarTreeMappingDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 测评星级id + */ + private Long subjectStarId; + + /** + * 知识点id + */ + private Long subjectTreeId; + + +} diff --git a/src/main/java/com/meishu/model/SubjectStudentAnswerStarDO.java b/src/main/java/com/meishu/model/SubjectStudentAnswerStarDO.java new file mode 100644 index 0000000..02de581 --- /dev/null +++ b/src/main/java/com/meishu/model/SubjectStudentAnswerStarDO.java @@ -0,0 +1,53 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * <p> + * 学生答卷星级表 + * </p> + * + * @author Tuyp + * @since 2021-05-13 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("subject_student_answer_star") +public class SubjectStudentAnswerStarDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 学生id + */ + private Long studentId; + + /** + * 星级id + */ + private Long starId; + + /** + * 布置id + */ + private Long publishId; + + /** + * 评卷人id + */ + private Long administerId; + + /** + * 维度id + */ + private Long dimensionId; + +} diff --git a/src/main/java/com/meishu/model/SubjectTestDictDO.java b/src/main/java/com/meishu/model/SubjectTestDictDO.java new file mode 100644 index 0000000..33d6cf1 --- /dev/null +++ b/src/main/java/com/meishu/model/SubjectTestDictDO.java @@ -0,0 +1,46 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * <p> + * 测评表 + * </p> + * + * @author Tuyp + * @since 2021-05-20 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("subject_test_dict") +public class SubjectTestDictDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + private Long ruleId; + + /** + * 考试名称 + */ + private String testName; + + + /** + * 卷面 + */ + private String examination; + + /** + * 状态 + */ + private String status; + +} diff --git a/src/main/java/com/meishu/model/SubjectTestGradeExampleMappingDO.java b/src/main/java/com/meishu/model/SubjectTestGradeExampleMappingDO.java new file mode 100644 index 0000000..02cba95 --- /dev/null +++ b/src/main/java/com/meishu/model/SubjectTestGradeExampleMappingDO.java @@ -0,0 +1,39 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * <p> + * 样卷映射表 + * </p> + * + * @author Tuyp + * @since 2021-06-21 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("subject_test_grade_example_mapping") +public class SubjectTestGradeExampleMappingDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 年级id + */ + private Long gradeId; + + /** + * 样卷 + */ + private String exampleView; + + +} diff --git a/src/main/java/com/meishu/model/SubjectTestGradeStarMappingDO.java b/src/main/java/com/meishu/model/SubjectTestGradeStarMappingDO.java new file mode 100644 index 0000000..6a91a6b --- /dev/null +++ b/src/main/java/com/meishu/model/SubjectTestGradeStarMappingDO.java @@ -0,0 +1,33 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * <p> + * 档次星级映射表 + * </p> + * + * @author Tuyp + * @since 2021-06-21 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("subject_test_grade_star_mapping") +public class SubjectTestGradeStarMappingDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + private Long gradeId; + + private Long starId; + + +} diff --git a/src/main/java/com/meishu/model/SubjectTestPublishGradeDO.java b/src/main/java/com/meishu/model/SubjectTestPublishGradeDO.java new file mode 100644 index 0000000..75472f0 --- /dev/null +++ b/src/main/java/com/meishu/model/SubjectTestPublishGradeDO.java @@ -0,0 +1,41 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * <p> + * 档次表 + * </p> + * + * @author Tuyp + * @since 2021-06-21 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("subject_test_publish_grade") +public class SubjectTestPublishGradeDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + private Long publishId; + + /** + * 档次名称 + */ + private String gradeName; + + /** + * 综合评价 + */ + private String content; + + +} diff --git a/src/main/java/com/meishu/model/SubjectTestPublishHistoryDO.java b/src/main/java/com/meishu/model/SubjectTestPublishHistoryDO.java new file mode 100644 index 0000000..e7bb696 --- /dev/null +++ b/src/main/java/com/meishu/model/SubjectTestPublishHistoryDO.java @@ -0,0 +1,59 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * <p> + * 测评发布记录表 + * </p> + * + * @author Tuyp + * @since 2021-05-08 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("subject_test_publish_history") +public class SubjectTestPublishHistoryDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 测评id + */ + private Long testId; + + /** + * 测评时间 + */ + private String testTime; + + /** + * 发布名称 + */ + private String publishName; + + /** + * 概要 + */ + private String outline; + + /** + * 测评分类 + */ + private String testType; + + /** + * 封面 + */ + private String coverPage; + + +} diff --git a/src/main/java/com/meishu/model/SubjectTestStudentAnswerDO.java b/src/main/java/com/meishu/model/SubjectTestStudentAnswerDO.java new file mode 100644 index 0000000..88cfe3e --- /dev/null +++ b/src/main/java/com/meishu/model/SubjectTestStudentAnswerDO.java @@ -0,0 +1,53 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * <p> + * 学生月考答卷 + * </p> + * + * @author Tuyp + * @since 2021-05-13 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("subject_test_student_answer") +public class SubjectTestStudentAnswerDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 学生id + */ + private Long studentId; + + /** + * 发布id + */ + private Long publishId; + + /** + * 答卷 + */ + private String answer; + + /** + * 提交状态 0:未提交 1:已提交 + */ + private String commitStatus; + + /** + * 评析状态 + */ + private String commentStatus; + +} diff --git a/src/main/java/com/meishu/model/SubjectTreeDO.java b/src/main/java/com/meishu/model/SubjectTreeDO.java new file mode 100644 index 0000000..9cecf9d --- /dev/null +++ b/src/main/java/com/meishu/model/SubjectTreeDO.java @@ -0,0 +1,71 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.List; + +/** + * <p> + * + * </p> + * + * @author Tuyp + * @since 2021-04-27 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("knowledge_tree") +public class SubjectTreeDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + private String school; + + private Long subjectId; + + private String subjectType; + + private String subjectEn; + + private String subject; + + private String label; + + @TableField("chapter") + private String treeNode; + + @TableField("node_name") + private String treeName; + + private String contentIntroduction; + + /** + * 父节点 + */ + private Long parentId; + + /** + * 写程序使用,数据库不存值 + */ + private List<SubjectTreeDO> children; + + /** + * 子节点个数 + */ + private Integer childNodeCounts; + + + @TableField("chapter_order") + private Integer treeOrder; + + +} diff --git a/src/main/java/com/meishu/model/TaskCompletionStatusDO.java b/src/main/java/com/meishu/model/TaskCompletionStatusDO.java new file mode 100644 index 0000000..6bfca31 --- /dev/null +++ b/src/main/java/com/meishu/model/TaskCompletionStatusDO.java @@ -0,0 +1,54 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * <p> + * 作业任务完成状态 + * </p> + * + * @author DengMin + * @since 2021-09-16 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("task_completion_status") +public class TaskCompletionStatusDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + /** + * 用户id + */ + private Integer userId; + + /** + * 作业类型 0:关联习题 1:拓展习题 + */ + private Integer exeType; + + /** + * 任务id + */ + private Integer subjectTaskId; + + /** + * 知识点id/拓展习题id + */ + private Integer treeId; + + /** + * 完成状态 + */ + private String status; + + +} diff --git a/src/main/java/com/meishu/model/TaskContentDO.java b/src/main/java/com/meishu/model/TaskContentDO.java new file mode 100644 index 0000000..dc7596f --- /dev/null +++ b/src/main/java/com/meishu/model/TaskContentDO.java @@ -0,0 +1,44 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * <p> + * 作业内容表(取题目,视频,书面作业) + * </p> + * + * @author DengMin + * @since 2021-09-16 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("task_content") +public class TaskContentDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + /** + * 任务id + */ + private Integer taskId; + + /** + * 作业类型 0:短视频 1:关联习题 2:拓展习题 3:书面作业 + */ + private Integer contentType; + + /** + * 内容id/知识点id + */ + private Integer contentId; + + +} diff --git a/src/main/java/com/meishu/model/TaskContentDoneInfoDO.java b/src/main/java/com/meishu/model/TaskContentDoneInfoDO.java new file mode 100644 index 0000000..b332b37 --- /dev/null +++ b/src/main/java/com/meishu/model/TaskContentDoneInfoDO.java @@ -0,0 +1,49 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * <p> + * + * </p> + * + * @author DengMin + * @since 2021-09-30 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("task_content_done_info") +public class TaskContentDoneInfoDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + /** + * 任务id + */ + private Integer taskId; + + /** + * 任务类型 + */ + private Integer contentType; + + /** + * 知识点id + */ + private Integer contentId; + + /** + * 用户ID + */ + private Integer userId; + + +} diff --git a/src/main/java/com/meishu/model/TaskDoneHistoryDO.java b/src/main/java/com/meishu/model/TaskDoneHistoryDO.java new file mode 100644 index 0000000..b7b4655 --- /dev/null +++ b/src/main/java/com/meishu/model/TaskDoneHistoryDO.java @@ -0,0 +1,39 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * <p> + * + * </p> + * + * @author DengMin + * @since 2021-09-16 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("task_done_history") +public class TaskDoneHistoryDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + /** + * 任务id + */ + private Integer taskId; + + /** + * 用户id + */ + private Integer userId; + + +} diff --git a/src/main/java/com/meishu/model/UserRoleCopy1DO.java b/src/main/java/com/meishu/model/UserRoleCopy1DO.java new file mode 100644 index 0000000..66894a3 --- /dev/null +++ b/src/main/java/com/meishu/model/UserRoleCopy1DO.java @@ -0,0 +1,52 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * <p> + * 学生表 + * </p> + * + * @author DengMin + * @since 2021-09-23 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("user_role_copy1") +public class UserRoleCopy1DO extends BaseModel { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + /** + * 用户名 + */ + private String userName; + + /** + * 性别 + */ + private String gender; + + /** + * 届 + */ + private String session; + + /** + * 学号 + */ + private String studyCode; + + +} diff --git a/src/main/java/com/meishu/model/UserRoleDO.java b/src/main/java/com/meishu/model/UserRoleDO.java new file mode 100644 index 0000000..eb0599e --- /dev/null +++ b/src/main/java/com/meishu/model/UserRoleDO.java @@ -0,0 +1,112 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import java.time.LocalDateTime; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * <p> + * 学生表 + * </p> + * + * @author Tuyp + * @since 2021-08-16 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("user_role") +public class UserRoleDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + /** + * 用户id + */ + private Integer userId; + + /** + * 用户名 + */ + private String userName; + + /** + * 性别 + */ + private String gender; + + /** + * 生日 + */ + private LocalDateTime birthday; + + /** + * 邮箱 + */ + private String email; + + /** + * 图片 + */ + private String imgUrl; + + /** + * 账户状态 0禁用 1 启用 + */ + private String userStatus; + + /** + * 注册方式 + */ + private String registerMethod; + + /** + * 账户类型 0 学生/1:老师/2家长 + */ + private String roleType; + + /** + * 届 + */ + private String session; + + /** + * classes_id 主键 + */ + private Integer classesId; + + /** + * 手机号 + */ + private String phone; + + /** + * 密码 + */ + private String password; + + /** + * 身份证号 + */ + private String idCard; + + /** + * 微信openid + */ + private String openId; + + /** + * 学籍号 + */ + private String studyCode; + +} diff --git a/src/main/java/com/meishu/model/UserSubjectMappingDO.java b/src/main/java/com/meishu/model/UserSubjectMappingDO.java new file mode 100644 index 0000000..d37b447 --- /dev/null +++ b/src/main/java/com/meishu/model/UserSubjectMappingDO.java @@ -0,0 +1,49 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * <p> + * 老师-科目映射表 + * </p> + * + * @author Tuyp + * @since 2021-08-17 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("user_subject_mapping") +public class UserSubjectMappingDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + /** + * 用户(老师) user_role id + */ + private Integer userId; + + /** + * 班级类型 0:行政班 1:进阶班 + */ + private Integer classType; + + /** + * 行政班:关联科目id + */ + private Integer subjectId; + + /** + * 进阶班:频道名称 + */ + private String subjectName; + + +} diff --git a/src/main/java/com/meishu/model/UserSubjectPermissionDictDO.java b/src/main/java/com/meishu/model/UserSubjectPermissionDictDO.java new file mode 100644 index 0000000..7d89fd5 --- /dev/null +++ b/src/main/java/com/meishu/model/UserSubjectPermissionDictDO.java @@ -0,0 +1,39 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * <p> + * 平时成绩---老师班级权限 + * </p> + * + * @author Tuyp + * @since 2021-08-18 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("user_subject_permission_dict") +public class UserSubjectPermissionDictDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + /** + * 老师id + */ + private Integer userId; + + /** + * 科目id + */ + private Integer subjectId; + + +} diff --git a/src/main/java/com/meishu/model/UuidHistoryDO.java b/src/main/java/com/meishu/model/UuidHistoryDO.java new file mode 100644 index 0000000..23d652b --- /dev/null +++ b/src/main/java/com/meishu/model/UuidHistoryDO.java @@ -0,0 +1,31 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * <p> + * + * </p> + * + * @author DengMin + * @since 2021-09-29 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("uuid_history") +public class UuidHistoryDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + private String uuid; + + +} diff --git a/src/main/java/com/meishu/model/VodDictDO.java b/src/main/java/com/meishu/model/VodDictDO.java new file mode 100644 index 0000000..d48b57f --- /dev/null +++ b/src/main/java/com/meishu/model/VodDictDO.java @@ -0,0 +1,102 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * <p> + * 视频字典表 + * </p> + * + * @author Tuyp + * @since 2021-04-27 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("vod_dict") +public class VodDictDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 科目id + */ + @TableField("subject") + private String subjectId; + + /** + * 视频名称 + */ + private String vodName; + + /** + * 视频地址 + */ + private String vodUrl; + + /** + * 课型 + */ + private String vodType; + + /** + * 视频介绍 + */ + private String vodIntro; + + /** + * 视频时长 + */ + private Integer vodLength; + + /** + * 视频在腾讯云上的code + */ + private String vodCode; + + /** + * 视频提供者 + */ + @TableField("teacher_id") + private Long administerId; + + /** + * 封面 + */ + private String coverPage; + + /** + * 0:待审核 1:已审核 + */ + private String status; + + /** + * 审核人 + */ + private Integer checkId; + + /** + * 分享状态 + */ + private String shareStatus; + + /** + * 审核状态 1:审核通过 3:未通过 2: 审核中 + */ + private String checkStatus; + + /** + * 通过/不通过原因 + */ + private String reason; + + +} diff --git a/src/main/java/com/meishu/model/VodPlayHistoryDO.java b/src/main/java/com/meishu/model/VodPlayHistoryDO.java new file mode 100644 index 0000000..6e53417 --- /dev/null +++ b/src/main/java/com/meishu/model/VodPlayHistoryDO.java @@ -0,0 +1,54 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * <p> + * 视频播放历史记录表 + * </p> + * + * @author Tuyp + * @since 2021-04-27 + */ +@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 vodId; + + /** + * 学生id + */ + private Long studentId; + + /** + * 观看时长 + */ + private Integer playLength; + + /** + * 播放视频位置 + */ + private Integer playRecord; + + /** + * course_tree课程知识树的主键 + */ + private Long treeId; + + +} diff --git a/src/main/java/com/meishu/model/VodSubjectTreeMappingDO.java b/src/main/java/com/meishu/model/VodSubjectTreeMappingDO.java new file mode 100644 index 0000000..afbbd82 --- /dev/null +++ b/src/main/java/com/meishu/model/VodSubjectTreeMappingDO.java @@ -0,0 +1,49 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * <p> + * 视频知识点映射表 + * </p> + * + * @author Tuyp + * @since 2021-05-13 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("vod_related") +public class VodSubjectTreeMappingDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 视频id + */ + private Long vodId; + + /** + * 科目知识树id + */ + private Long treeId; + + /** + * 状态 0:隐藏 1:启用 + */ + private String status; + + /** + * 关联学校 -- 同步用 + */ + private String isRelated; + + +} diff --git a/src/main/java/com/meishu/model/WrittenHomeworkDO.java b/src/main/java/com/meishu/model/WrittenHomeworkDO.java new file mode 100644 index 0000000..e78b0b7 --- /dev/null +++ b/src/main/java/com/meishu/model/WrittenHomeworkDO.java @@ -0,0 +1,59 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * <p> + * 通知/附件作业表 + * </p> + * + * @author DengMin + * @since 2021-09-16 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("written_homework") +public class WrittenHomeworkDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + /** + * 书面作业类型 2 通知 1 附件 + */ + private Integer homeworkType; + + /** + * 内容/附件地址 + */ + private String homeworkContent; + + /** + * 建议时长 + */ + private Integer adviceLength; + + /** + * 附件大小 + */ + private String fileSize; + + /** + * 文件类型 + */ + private String fileType; + + /** + * 文件名称 + */ + private String fileName; + + +} diff --git a/src/main/java/com/meishu/service/AccessTokenService.java b/src/main/java/com/meishu/service/AccessTokenService.java new file mode 100644 index 0000000..d1a96d5 --- /dev/null +++ b/src/main/java/com/meishu/service/AccessTokenService.java @@ -0,0 +1,27 @@ +package com.meishu.service; + +import com.meishu.dto.token.GetAllStudentsDTO; +import com.meishu.dto.token.GetAllTeachersDTO; +import com.meishu.model.AccessTokenDO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.meishu.model.AdministerDO; +import com.meishu.model.UserRoleDO; +import com.meishu.vo.accesstoken.GetAllStudentsVO; +import com.meishu.vo.accesstoken.GetAllTeachersVO; + +import java.util.List; + +/** + * <p> + * 服务类 + * </p> + * + * @author Tuyp + * @since 2021-05-10 + */ +public interface AccessTokenService extends IService<AccessTokenDO> { + + List<GetAllTeachersVO> getAllTeachers(GetAllTeachersDTO getAllTeachersDTO); + + List<GetAllStudentsVO> getAllStudents(GetAllStudentsDTO getAllStudentsDTO); +} diff --git a/src/main/java/com/meishu/service/AdministerDepartmentMappingService.java b/src/main/java/com/meishu/service/AdministerDepartmentMappingService.java new file mode 100644 index 0000000..0b23955 --- /dev/null +++ b/src/main/java/com/meishu/service/AdministerDepartmentMappingService.java @@ -0,0 +1,16 @@ +package com.meishu.service; + +import com.meishu.model.AdministerDepartmentMappingDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * <p> + * 老师部门映射表 服务类 + * </p> + * + * @author Tuyp + * @since 2021-07-01 + */ +public interface AdministerDepartmentMappingService extends IService<AdministerDepartmentMappingDO> { + +} diff --git a/src/main/java/com/meishu/service/AdministerPermissionService.java b/src/main/java/com/meishu/service/AdministerPermissionService.java new file mode 100644 index 0000000..80936e1 --- /dev/null +++ b/src/main/java/com/meishu/service/AdministerPermissionService.java @@ -0,0 +1,16 @@ +package com.meishu.service; + +import com.meishu.model.AdministerPermissionDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * <p> + * 系统用户角色表 服务类 + * </p> + * + * @author Tuyp + * @since 2021-04-25 + */ +public interface AdministerPermissionService extends IService<AdministerPermissionDO> { + +} diff --git a/src/main/java/com/meishu/service/AdministerService.java b/src/main/java/com/meishu/service/AdministerService.java new file mode 100644 index 0000000..4fc5397 --- /dev/null +++ b/src/main/java/com/meishu/service/AdministerService.java @@ -0,0 +1,48 @@ +package com.meishu.service; + +import com.meishu.dto.administer.AddAdministerDTO; +import com.meishu.dto.administer.ChangeStatusDTO; +import com.meishu.dto.administer.PublishTasksDTO; +import com.meishu.dto.administer.UpdateAdministerDTO; +import com.meishu.dto.exercise.UpdateStatusDTO; +import com.meishu.model.AdministerDO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.meishu.model.PermissionsDictDO; +import com.meishu.model.SmsCodeDO; +import com.meishu.vo.administer.AdministerPermissionVO; +import com.meishu.vo.administer.LoginVO; +import com.meishu.vo.administer.PermissionsVO; + +import java.util.List; + +/** + * <p> + * 中心管理账户表 服务类 + * </p> + * + * @author Tuyp + * @since 2021-04-25 + */ +public interface AdministerService extends IService<AdministerDO> { + + String sendMsg(AdministerDO administerDO); + + LoginVO login(SmsCodeDO smsCodeDO); + + LoginVO passwordLogin(AdministerDO administerDO); + + AdministerPermissionVO getPermissions(); + + List<PermissionsDictDO> getParentPermission(); + + String addAdminister(AddAdministerDTO addAdministerDTO); + + List<PermissionsDictDO> getPermissionTree(); + + String changeStatus(ChangeStatusDTO changeStatusDTO); + + String updateAdminister(UpdateAdministerDTO updateAdministerDTO); + + List<AdministerDO> getAllAdminister(); + +} diff --git a/src/main/java/com/meishu/service/AdministerSubjectMappingService.java b/src/main/java/com/meishu/service/AdministerSubjectMappingService.java new file mode 100644 index 0000000..fd95956 --- /dev/null +++ b/src/main/java/com/meishu/service/AdministerSubjectMappingService.java @@ -0,0 +1,16 @@ +package com.meishu.service; + +import com.meishu.model.AdministerSubjectMappingDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * <p> + * 老师科目映射表 服务类 + * </p> + * + * @author Tuyp + * @since 2021-07-01 + */ +public interface AdministerSubjectMappingService extends IService<AdministerSubjectMappingDO> { + +} diff --git a/src/main/java/com/meishu/service/AnsweringQuestionService.java b/src/main/java/com/meishu/service/AnsweringQuestionService.java new file mode 100644 index 0000000..b2e5a86 --- /dev/null +++ b/src/main/java/com/meishu/service/AnsweringQuestionService.java @@ -0,0 +1,34 @@ +package com.meishu.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.meishu.dto.question.QueryQuestionsDTO; +import com.meishu.model.AnsweringQuestionDO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.meishu.model.UserSubjectPermissionDictDO; +import com.meishu.vo.question.GetClassQuestionsVO; +import com.meishu.vo.question.QueryOneQuestionVO; + +import java.util.List; + +/** + * <p> + * 问题答疑表 服务类 + * </p> + * + * @author DengMin + * @since 2021-09-28 + */ +public interface AnsweringQuestionService extends IService<AnsweringQuestionDO> { + + IPage queryQuestions(QueryQuestionsDTO queryQuestionsDTO); + + String deleteQuestion(AnsweringQuestionDO answeringQuestionDO); + + QueryOneQuestionVO queryOneQuestion(AnsweringQuestionDO answeringQuestionDO); + + List<GetClassQuestionsVO> getClassQuestions(UserSubjectPermissionDictDO userSubjectPermissionDictDO); + + String addQuestion(AnsweringQuestionDO answeringQuestionDO); + + String answerQuestion(AnsweringQuestionDO answeringQuestionDO); +} diff --git a/src/main/java/com/meishu/service/ClassSubjectTaskService.java b/src/main/java/com/meishu/service/ClassSubjectTaskService.java new file mode 100644 index 0000000..78470da --- /dev/null +++ b/src/main/java/com/meishu/service/ClassSubjectTaskService.java @@ -0,0 +1,71 @@ +package com.meishu.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.meishu.dto.administer.PublishTasksDTO; +import com.meishu.dto.classes.GetClassesDTO; +import com.meishu.dto.exercise.GetExerciseRequestDTO; +import com.meishu.dto.task.*; +import com.meishu.model.*; +import com.baomidou.mybatisplus.extension.service.IService; +import com.meishu.vo.PerStudentComplicationVO; +import com.meishu.vo.administer.GetClassesDetailResponseVO; +import com.meishu.vo.administer.GetTeacherClassVO; +import com.meishu.vo.exercise.GetExerciseDetailResponseVO; +import com.meishu.vo.task.*; + +import java.util.HashMap; +import java.util.List; + +/** + * <p> + * 学习任务列表 服务类 + * </p> + * + * @author DengMin + * @since 2021-09-16 + */ +public interface ClassSubjectTaskService extends IService<ClassSubjectTaskDO> { + + String code(String telephone); + + List<TeacherClassVO> getTeacherClass(GetClassesRequestVO getClassesRequestVO); + + String publishTasks(PublishTasksDTO publishTasksDTO); + + IPage<GetTaskByIdVO> getTaskById(GetTaskByIdRequestDTO getTaskByIdRequestDTO); + + String deletePreTasks(ClassSubjectTaskDO classSubjectTaskDO); + + QueryTaskDetailResponseVO queryTaskDetail(QueryTaskDetailDTO queryTaskDetailDTO); + + List<GetExerciseDetailResponseVO> getRelativeExercises(GetExerciseRequestDTO getExerciseRequestVO); + + List<PerStudentComplicationVO> perStudentVod(GetUserVodPlayDTO getUserVodPlayRequestVO); + + PerStudentExesResponseVO perStudentRelateExes(PerStudentExesDTO perStudentExesRequestVO); + + List<ExeRightRatioVO> exeRightRatio(ExeRightRatioDTO exeRightRatioPO); + + StudentDoneInfoResponseVO studentRelateDoneInfo(StudentDoneInfoRequestVO studentDoneInfoRequestVO); + + GetExeByIdResponseVO getExeById(ExerciseDictDO exerciseDict); + + List<ExerciseUserInfoVO> getExpandings(GetExpandingsPO getExpandingsPO); + + StudentDoneInfoResponseVO studentxpandingDoneInfo(StudentDoneInfoRequestVO studentDoneInfoRequestVO); + + PerStudentExesResponseVO perStudentExpandingExes(PerStudentExesRequestVO perStudentExesRequestVO); + + List<GetVodDetailResponseVO> getRecommendVodByTreeId(GetRecommendVodByTreeIdVO getRecommendVodByTreeIdVO); + + List<GetExercisesInfoByIdsResponseVO> getRecommendExeByTreeId(GetRecommendExeByTreeIdVO getRecommendExeByTreeIdVO); + + List<SubjectTreeDO> allNodes(SubjectTreeDO knowledgeTree); + + List<UserRoleDO> getClassStudents(GetClassStudentsDTO getClassStudentsDTO); + + List<ExerciseDictDO> queryTaskRelatedExercise(TaskContentDO taskContentDO); + + void data(); + +} diff --git a/src/main/java/com/meishu/service/ClassesDictHistoryService.java b/src/main/java/com/meishu/service/ClassesDictHistoryService.java new file mode 100644 index 0000000..f3341a5 --- /dev/null +++ b/src/main/java/com/meishu/service/ClassesDictHistoryService.java @@ -0,0 +1,16 @@ +package com.meishu.service; + +import com.meishu.model.ClassesDictHistoryDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * <p> + * 学校班级字典表 服务类 + * </p> + * + * @author Tuyp + * @since 2021-08-11 + */ +public interface ClassesDictHistoryService extends IService<ClassesDictHistoryDO> { + +} diff --git a/src/main/java/com/meishu/service/ClassesDictService.java b/src/main/java/com/meishu/service/ClassesDictService.java new file mode 100644 index 0000000..ce34780 --- /dev/null +++ b/src/main/java/com/meishu/service/ClassesDictService.java @@ -0,0 +1,45 @@ +package com.meishu.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.meishu.dto.classes.*; +import com.meishu.model.ClassesDictDO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.meishu.model.ClassesDictHistoryDO; +import com.meishu.model.UserRoleDO; +import com.meishu.vo.classes.GetClassStudentsVO; +import com.meishu.vo.classes.GetClassesVO; + +import java.util.List; + +/** + * <p> + * 学校班级字典表 服务类 + * </p> + * + * @author Tuyp + * @since 2021-08-11 + */ +public interface ClassesDictService extends IService<ClassesDictDO> { + + IPage<GetClassesVO> getClasses(GetClassesDTO getClassesDTO); + + String addClass(AddClassDTO addClassDTO); + + String updateClass(AddClassDTO addClassDTO); + + String addSubjectTeacherMapping(AddSubjectTeacherDTO addSubjectTeacherDTO); + + List<GetClassStudentsVO> getClassStudents(GetClassStudentsDTO getClassStudentsDTO); + + IPage<UserRoleDO> queryNoClassStudents(QueryNoClassStudentsDTO queryNoClassStudentsDTO); + + String batchAddStudentToClass(BatchAddStudentToClassDTO batchAddStudentToClassDTO); + + String batchDeleteStudent(BatchAddStudentToClassDTO batchAddStudentToClassDTO); + + List<ClassesDictDO> getClassesWithPage(); + + ClassesDictDO getClassesById(Long studentId); + + String batchUpGrade(BatchUpGradeDTO batchUpGradeDTO); +} diff --git a/src/main/java/com/meishu/service/ClassesUserMappingService.java b/src/main/java/com/meishu/service/ClassesUserMappingService.java new file mode 100644 index 0000000..4d437d9 --- /dev/null +++ b/src/main/java/com/meishu/service/ClassesUserMappingService.java @@ -0,0 +1,16 @@ +package com.meishu.service; + +import com.meishu.model.ClassesUserMappingDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * <p> + * 班级--学生--映射表(包括以前的班级) 服务类 + * </p> + * + * @author Tuyp + * @since 2021-08-17 + */ +public interface ClassesUserMappingService extends IService<ClassesUserMappingDO> { + +} diff --git a/src/main/java/com/meishu/service/CourseAdministerMappingService.java b/src/main/java/com/meishu/service/CourseAdministerMappingService.java new file mode 100644 index 0000000..3724d08 --- /dev/null +++ b/src/main/java/com/meishu/service/CourseAdministerMappingService.java @@ -0,0 +1,16 @@ +package com.meishu.service; + +import com.meishu.model.CourseAdministerMappingDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * <p> + * 课程老师映射表 服务类 + * </p> + * + * @author Tuyp + * @since 2021-05-25 + */ +public interface CourseAdministerMappingService extends IService<CourseAdministerMappingDO> { + +} diff --git a/src/main/java/com/meishu/service/CourseStudentStatusHistoryService.java b/src/main/java/com/meishu/service/CourseStudentStatusHistoryService.java new file mode 100644 index 0000000..8a7c6c6 --- /dev/null +++ b/src/main/java/com/meishu/service/CourseStudentStatusHistoryService.java @@ -0,0 +1,16 @@ +package com.meishu.service; + +import com.meishu.model.CourseStudentStatusHistoryDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * <p> + * 服务类 + * </p> + * + * @author Tuyp + * @since 2021-05-27 + */ +public interface CourseStudentStatusHistoryService extends IService<CourseStudentStatusHistoryDO> { + +} diff --git a/src/main/java/com/meishu/service/CourseTreeExerciseStudentResultService.java b/src/main/java/com/meishu/service/CourseTreeExerciseStudentResultService.java new file mode 100644 index 0000000..3d101a3 --- /dev/null +++ b/src/main/java/com/meishu/service/CourseTreeExerciseStudentResultService.java @@ -0,0 +1,16 @@ +package com.meishu.service; + +import com.meishu.model.CourseTreeExerciseStudentResultDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * <p> + * 课程--学生做题记录 服务类 + * </p> + * + * @author Tuyp + * @since 2021-05-25 + */ +public interface CourseTreeExerciseStudentResultService extends IService<CourseTreeExerciseStudentResultDO> { + +} diff --git a/src/main/java/com/meishu/service/CourseTreeVodStudentResultService.java b/src/main/java/com/meishu/service/CourseTreeVodStudentResultService.java new file mode 100644 index 0000000..a046276 --- /dev/null +++ b/src/main/java/com/meishu/service/CourseTreeVodStudentResultService.java @@ -0,0 +1,16 @@ +package com.meishu.service; + +import com.meishu.model.CourseTreeVodStudentResultDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * <p> + * 学生视频完成情况 服务类 + * </p> + * + * @author Tuyp + * @since 2021-05-13 + */ +public interface CourseTreeVodStudentResultService extends IService<CourseTreeVodStudentResultDO> { + +} diff --git a/src/main/java/com/meishu/service/DepartmentDictService.java b/src/main/java/com/meishu/service/DepartmentDictService.java new file mode 100644 index 0000000..757df3d --- /dev/null +++ b/src/main/java/com/meishu/service/DepartmentDictService.java @@ -0,0 +1,40 @@ +package com.meishu.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.meishu.dto.department.BatchOprDTO; +import com.meishu.dto.department.GetAllDepartmentVO; +import com.meishu.dto.department.GetTeachersDTO; +import com.meishu.dto.subject.GetSubjectTreeDTO; +import com.meishu.model.AdministerDO; +import com.meishu.model.DepartmentDictDO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.meishu.vo.administer.GetTeachersVO; + +import java.util.List; + +/** + * <p> + * 部门字典表 服务类 + * </p> + * + * @author Tuyp + * @since 2021-04-25 + */ +public interface DepartmentDictService extends IService<DepartmentDictDO> { + + + List<GetAllDepartmentVO> getDepartmentInfo(); + + List<DepartmentDictDO> getDepartmentList(GetSubjectTreeDTO getSubjectTreeDTO); + + String addDepartment(DepartmentDictDO departmentDictDO); + + IPage<GetTeachersVO> getTeachers(GetTeachersDTO getTeachersDTO); + + String batchOpr(BatchOprDTO batchOprDTO); + + String deleteDepartment(BatchOprDTO batchOprDTO); + + String updateDepartment(DepartmentDictDO departmentDictDO); + +} diff --git a/src/main/java/com/meishu/service/ExerciseCourseTreeMappingService.java b/src/main/java/com/meishu/service/ExerciseCourseTreeMappingService.java new file mode 100644 index 0000000..22dd70a --- /dev/null +++ b/src/main/java/com/meishu/service/ExerciseCourseTreeMappingService.java @@ -0,0 +1,22 @@ +package com.meishu.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.meishu.dto.exercise.QueryCourseTreeExerciseDTO; +import com.meishu.dto.exercise.UpdateStatusDTO; +import com.meishu.model.ExerciseCourseTreeMappingDO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.meishu.model.ExerciseTreeMappingDO; +import com.meishu.vo.exercise.QueryCourseTreeExerciseVO; + +/** + * <p> + * 课程知识树--题目字典表 服务类 + * </p> + * + * @author Tuyp + * @since 2021-05-24 + */ +public interface ExerciseCourseTreeMappingService extends IService<ExerciseCourseTreeMappingDO> { + + String updateStatus(UpdateStatusDTO updateStatusDTO); +} diff --git a/src/main/java/com/meishu/service/ExerciseDictService.java b/src/main/java/com/meishu/service/ExerciseDictService.java new file mode 100644 index 0000000..cadd6ba --- /dev/null +++ b/src/main/java/com/meishu/service/ExerciseDictService.java @@ -0,0 +1,48 @@ +package com.meishu.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.meishu.dto.exercise.AddExerciseDTO; +import com.meishu.dto.exercise.CheckExerciseDTO; +import com.meishu.dto.exercise.GetTreeExercisesDTO; +import com.meishu.dto.voddict.GetToCheckVodCountsDTO; +import com.meishu.dto.voddict.PublicCheckingDTO; +import com.meishu.model.ExerciseDictDO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.meishu.model.ExerciseTreeMappingDO; +import com.meishu.vo.exercise.GetExerciseDetailVO; +import com.meishu.vo.exercise.GetTreeExercisesVO; +import com.meishu.vo.voddict.GetToCheckCountsVO; + +/** + * <p> + * 习题库 服务类 + * </p> + * + * @author Tuyp + * @since 2021-04-27 + */ +public interface ExerciseDictService extends IService<ExerciseDictDO> { + + IPage<GetTreeExercisesVO> getTreeExercises(GetTreeExercisesDTO getTreeExercisesDTO); + + IPage<GetTreeExercisesVO> getCheckTreeExercises(GetTreeExercisesDTO getTreeExercisesDTO); + + String deleteExercise(ExerciseDictDO exerciseDictDO); + + String addExercise(AddExerciseDTO addExerciseDTO); + + String updateExercise(AddExerciseDTO addExerciseDTO); + + GetToCheckCountsVO getToCheckExeCounts(GetToCheckVodCountsDTO getToCheckVodCountsDTO); + + String checkExercise(CheckExerciseDTO checkExerciseDTO); + + IPage<ExerciseDictDO> publicUpload(PublicCheckingDTO publicCheckingDTO); + + String withdraw(ExerciseDictDO exerciseDictDO); + + GetExerciseDetailVO getExerciseDetail(ExerciseDictDO exerciseDictDO); + + String setRelatedExercise(ExerciseTreeMappingDO exerciseTreeMappingDO); + +} diff --git a/src/main/java/com/meishu/service/ExerciseDoneHistoryService.java b/src/main/java/com/meishu/service/ExerciseDoneHistoryService.java new file mode 100644 index 0000000..f0e7883 --- /dev/null +++ b/src/main/java/com/meishu/service/ExerciseDoneHistoryService.java @@ -0,0 +1,16 @@ +package com.meishu.service; + +import com.meishu.model.ExerciseDoneHistoryDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * <p> + * 学生做题记录表 服务类 + * </p> + * + * @author Tuyp + * @since 2021-04-27 + */ +public interface ExerciseDoneHistoryService extends IService<ExerciseDoneHistoryDO> { + +} diff --git a/src/main/java/com/meishu/service/ExerciseExpandMappingService.java b/src/main/java/com/meishu/service/ExerciseExpandMappingService.java new file mode 100644 index 0000000..c7ca723 --- /dev/null +++ b/src/main/java/com/meishu/service/ExerciseExpandMappingService.java @@ -0,0 +1,16 @@ +package com.meishu.service; + +import com.meishu.model.ExerciseExpandMappingDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * <p> + * 学生--拓展习题映射表 服务类 + * </p> + * + * @author DengMin + * @since 2021-09-16 + */ +public interface ExerciseExpandMappingService extends IService<ExerciseExpandMappingDO> { + +} diff --git a/src/main/java/com/meishu/service/ExerciseRelatedMappingService.java b/src/main/java/com/meishu/service/ExerciseRelatedMappingService.java new file mode 100644 index 0000000..7372453 --- /dev/null +++ b/src/main/java/com/meishu/service/ExerciseRelatedMappingService.java @@ -0,0 +1,16 @@ +package com.meishu.service; + +import com.meishu.model.ExerciseRelatedMappingDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * <p> + * 学生--拓展习题映射表 服务类 + * </p> + * + * @author DengMin + * @since 2021-09-28 + */ +public interface ExerciseRelatedMappingService extends IService<ExerciseRelatedMappingDO> { + +} diff --git a/src/main/java/com/meishu/service/ExerciseTreeMappingService.java b/src/main/java/com/meishu/service/ExerciseTreeMappingService.java new file mode 100644 index 0000000..dcc3c17 --- /dev/null +++ b/src/main/java/com/meishu/service/ExerciseTreeMappingService.java @@ -0,0 +1,16 @@ +package com.meishu.service; + +import com.meishu.model.ExerciseTreeMappingDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * <p> + * 题目知识树映射表 服务类 + * </p> + * + * @author Tuyp + * @since 2021-04-27 + */ +public interface ExerciseTreeMappingService extends IService<ExerciseTreeMappingDO> { + +} diff --git a/src/main/java/com/meishu/service/ExerciseUserInfoService.java b/src/main/java/com/meishu/service/ExerciseUserInfoService.java new file mode 100644 index 0000000..b703b88 --- /dev/null +++ b/src/main/java/com/meishu/service/ExerciseUserInfoService.java @@ -0,0 +1,16 @@ +package com.meishu.service; + +import com.meishu.model.ExerciseUserInfoDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * <p> + * 题目收藏信息表 服务类 + * </p> + * + * @author DengMin + * @since 2021-09-17 + */ +public interface ExerciseUserInfoService extends IService<ExerciseUserInfoDO> { + +} diff --git a/src/main/java/com/meishu/service/KnowledgeSubjectDictService.java b/src/main/java/com/meishu/service/KnowledgeSubjectDictService.java new file mode 100644 index 0000000..c985a20 --- /dev/null +++ b/src/main/java/com/meishu/service/KnowledgeSubjectDictService.java @@ -0,0 +1,41 @@ +package com.meishu.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.meishu.dto.subject.GetSubjectAdministerDTO; +import com.meishu.dto.subject.GetSubjectTreeDTO; +import com.meishu.dto.subject.GetSubjectsDTO; +import com.meishu.model.AdministerDO; +import com.meishu.model.KnowledgeSubjectDictDO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.meishu.vo.subject.GetSubjectTreeVO; + +import java.util.List; + +/** + * <p> + * 学科字典表 服务类 + * </p> + * + * @author Tuyp + * @since 2021-04-27 + */ +public interface KnowledgeSubjectDictService extends IService<KnowledgeSubjectDictDO> { + + + IPage<KnowledgeSubjectDictDO> getSubjects(GetSubjectsDTO getSubjectsDTO); + + List<KnowledgeSubjectDictDO> getAllSubjects(GetSubjectsDTO getSubjectsDTO); + + String updateSubject(KnowledgeSubjectDictDO subjectDictDO); + + String addSubject(KnowledgeSubjectDictDO subjectDictDO); + + String deleteSubject(KnowledgeSubjectDictDO subjectDictDO); + + List<GetSubjectTreeVO> getSubjectTree(GetSubjectTreeDTO getSubjectTreeDTO); + + KnowledgeSubjectDictDO getSubject(KnowledgeSubjectDictDO subjectDictDO); + + List<AdministerDO> getSubjectAdminister(GetSubjectAdministerDTO getSubjectAdministerDTO); + +} diff --git a/src/main/java/com/meishu/service/LaboratoryAttendanceMappingService.java b/src/main/java/com/meishu/service/LaboratoryAttendanceMappingService.java new file mode 100644 index 0000000..7faf77c --- /dev/null +++ b/src/main/java/com/meishu/service/LaboratoryAttendanceMappingService.java @@ -0,0 +1,16 @@ +package com.meishu.service; + +import com.meishu.model.LaboratoryAttendanceMappingDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * <p> + * 实验室场次预约考勤记录 服务类 + * </p> + * + * @author DengMin + * @since 2021-09-15 + */ +public interface LaboratoryAttendanceMappingService extends IService<LaboratoryAttendanceMappingDO> { + +} diff --git a/src/main/java/com/meishu/service/LaboratoryDictMappingService.java b/src/main/java/com/meishu/service/LaboratoryDictMappingService.java new file mode 100644 index 0000000..8d4524d --- /dev/null +++ b/src/main/java/com/meishu/service/LaboratoryDictMappingService.java @@ -0,0 +1,18 @@ +package com.meishu.service; + +import com.meishu.model.LaboratoryDictMappingDO; +import com.baomidou.mybatisplus.extension.service.IService; + +import java.util.List; + +/** + * <p> + * 实验室场次关联表 服务类 + * </p> + * + * @author DengMin + * @since 2021-08-30 + */ +public interface LaboratoryDictMappingService extends IService<LaboratoryDictMappingDO> { + +} diff --git a/src/main/java/com/meishu/service/LaboratoryDictService.java b/src/main/java/com/meishu/service/LaboratoryDictService.java new file mode 100644 index 0000000..b6530ee --- /dev/null +++ b/src/main/java/com/meishu/service/LaboratoryDictService.java @@ -0,0 +1,29 @@ +package com.meishu.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.meishu.dto.laboratory.LaboratoryDictDTO; +import com.meishu.dto.laboratory.LaboratoryPageDTO; +import com.meishu.model.LaboratoryDictDO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.meishu.vo.laboratorySession.LaboratoryDictPageVO; + +/** + * <p> + * 实验室 服务类 + * </p> + * + * @author DengMin + * @since 2021-08-17 + */ +public interface LaboratoryDictService extends IService<LaboratoryDictDO> { + + IPage selectPage(LaboratoryPageDTO laboratoryPageDTO); + + void add(LaboratoryDictDTO laboratoryDictDO); + + void updateLaboratory(LaboratoryDictDTO laboratoryDictDO); + + void delete(Long id); + + LaboratoryDictDO getLaboratoryDicOne(String laboratoryType, String startDate); +} diff --git a/src/main/java/com/meishu/service/LaboratorySessionMappingService.java b/src/main/java/com/meishu/service/LaboratorySessionMappingService.java new file mode 100644 index 0000000..86525bb --- /dev/null +++ b/src/main/java/com/meishu/service/LaboratorySessionMappingService.java @@ -0,0 +1,40 @@ +package com.meishu.service; + +import com.meishu.dto.laboratorySession.CalendarStatusDTO; +import com.meishu.dto.laboratorySession.GetLaboratorySessionDTO; +import com.meishu.dto.laboratorySession.LaboratorySessionListDTO; +import com.meishu.dto.laboratorySession.SetLaboratorySessionDTO; +import com.meishu.model.LaboratorySessionMappingDO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.meishu.vo.laboratorySession.*; + +import java.util.List; + +/** + * <p> + * 实验室场次预约安排表 服务类 + * </p> + * + * @author DengMin + * @since 2021-08-17 + */ +public interface LaboratorySessionMappingService extends IService<LaboratorySessionMappingDO> { + + List<LaboratorySessionMappingVO> getLaboratorySessionList(String startDate); + + void setLaboratorySession(SetLaboratorySessionDTO setLaboratorySessionDTO); + + void updateLaboratorySession(SetLaboratorySessionDTO setLaboratorySessionDTO); + + LaboratorySessionMappingVO getOneById(Long laboratorySessionId); + + List<CalendarStatusVO> getCalendarStatus(CalendarStatusDTO calendarStatusDTO); + + StatisticsVO getLaboratorySessionStatistics(CalendarStatusDTO calendarStatusDTO); + + List<String> getLaboratorySessionDate(GetLaboratorySessionDTO getLaboratorySessionDTO); + + List<GetLaboratorySessionVO> getLaboratorySession(GetLaboratorySessionDTO getLaboratorySessionDTO); + + void deleteLaboratorySession(SetLaboratorySessionDTO setLaboratorySessionDTO); +} diff --git a/src/main/java/com/meishu/service/LaboratoryUserMappingService.java b/src/main/java/com/meishu/service/LaboratoryUserMappingService.java new file mode 100644 index 0000000..f1a1f53 --- /dev/null +++ b/src/main/java/com/meishu/service/LaboratoryUserMappingService.java @@ -0,0 +1,29 @@ +package com.meishu.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.meishu.dto.laboratoryUser.ApplyDTO; +import com.meishu.dto.laboratoryUser.LaboratoryUserPageDTO; +import com.meishu.model.LaboratoryUserMappingDO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.meishu.vo.laboratoryUser.LaboratoryUserPageVO; + +import java.util.List; + +/** + * <p> + * 实验室场次预约报名记录 服务类 + * </p> + * + * @author DengMin + * @since 2021-08-17 + */ +public interface LaboratoryUserMappingService extends IService<LaboratoryUserMappingDO> { + + List<LaboratoryUserPageVO> getLaboratoryUserPage(LaboratoryUserPageDTO laboratoryUserPageDTO); + + void exportLaboratoryUser(LaboratoryUserPageDTO laboratoryUserPageDTO); + + void registration(ApplyDTO applyDTO); + + void cancelRegistration(ApplyDTO applyDTO); +} diff --git a/src/main/java/com/meishu/service/PermissionsDictService.java b/src/main/java/com/meishu/service/PermissionsDictService.java new file mode 100644 index 0000000..89edce0 --- /dev/null +++ b/src/main/java/com/meishu/service/PermissionsDictService.java @@ -0,0 +1,16 @@ +package com.meishu.service; + +import com.meishu.model.PermissionsDictDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * <p> + * 权限表 服务类 + * </p> + * + * @author Tuyp + * @since 2021-04-26 + */ +public interface PermissionsDictService extends IService<PermissionsDictDO> { + +} diff --git a/src/main/java/com/meishu/service/RoleAdministerMappingService.java b/src/main/java/com/meishu/service/RoleAdministerMappingService.java new file mode 100644 index 0000000..8c93cb8 --- /dev/null +++ b/src/main/java/com/meishu/service/RoleAdministerMappingService.java @@ -0,0 +1,16 @@ +package com.meishu.service; + +import com.meishu.model.RoleAdministerMappingDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * <p> + * 服务类 + * </p> + * + * @author Tuyp + * @since 2021-04-26 + */ +public interface RoleAdministerMappingService extends IService<RoleAdministerMappingDO> { + +} diff --git a/src/main/java/com/meishu/service/RoleDictService.java b/src/main/java/com/meishu/service/RoleDictService.java new file mode 100644 index 0000000..a029a7b --- /dev/null +++ b/src/main/java/com/meishu/service/RoleDictService.java @@ -0,0 +1,37 @@ +package com.meishu.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.meishu.dto.role.AddPermissionDTO; +import com.meishu.dto.role.DeletePermissionDTO; +import com.meishu.dto.role.GetRoleTeachersDTO; +import com.meishu.dto.role.RoleTeacherDTO; +import com.meishu.model.RoleDictDO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.meishu.vo.role.GetAllRolesVO; +import com.meishu.vo.role.GetRoleTeachersVO; + +import java.util.List; + +/** + * <p> + * 角色表 服务类 + * </p> + * + * @author Tuyp + * @since 2021-04-26 + */ +public interface RoleDictService extends IService<RoleDictDO> { + + List<GetAllRolesVO> getAllRoles(); + + IPage<GetRoleTeachersVO> getRoleTeachers(GetRoleTeachersDTO getRoleTeachersDTO); + + String removeTeacher(RoleTeacherDTO roleTeacherDTO); + + String roleTeacher(RoleTeacherDTO roleTeacherDTO); + + String addPermission(AddPermissionDTO addPermissionDTO); + + String deletePermission(DeletePermissionDTO deletePermissionDTO); + +} diff --git a/src/main/java/com/meishu/service/RolePermissionMappingService.java b/src/main/java/com/meishu/service/RolePermissionMappingService.java new file mode 100644 index 0000000..92c5281 --- /dev/null +++ b/src/main/java/com/meishu/service/RolePermissionMappingService.java @@ -0,0 +1,16 @@ +package com.meishu.service; + +import com.meishu.model.RolePermissionMappingDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * <p> + * 系统用户角色表 服务类 + * </p> + * + * @author Tuyp + * @since 2021-04-26 + */ +public interface RolePermissionMappingService extends IService<RolePermissionMappingDO> { + +} diff --git a/src/main/java/com/meishu/service/SessionsDictService.java b/src/main/java/com/meishu/service/SessionsDictService.java new file mode 100644 index 0000000..e88a544 --- /dev/null +++ b/src/main/java/com/meishu/service/SessionsDictService.java @@ -0,0 +1,21 @@ +package com.meishu.service; + +import com.meishu.model.SessionsDictDO; +import com.baomidou.mybatisplus.extension.service.IService; + +import java.util.List; + +/** + * <p> + * 场次字典表 服务类 + * </p> + * + * @author DengMin + * @since 2021-08-17 + */ +public interface SessionsDictService extends IService<SessionsDictDO> { + + List<SessionsDictDO> getListById(Long laboratoryDictId); + + List<SessionsDictDO> getListSessionDictById(Long laboratoryDictId, String startDate); +} diff --git a/src/main/java/com/meishu/service/SignInRecordService.java b/src/main/java/com/meishu/service/SignInRecordService.java new file mode 100644 index 0000000..573e06f --- /dev/null +++ b/src/main/java/com/meishu/service/SignInRecordService.java @@ -0,0 +1,21 @@ +package com.meishu.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.meishu.dto.sign.ClassSignInDTO; +import com.meishu.model.SignInRecordDO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.meishu.vo.sign.ClassSignInVO; + +/** + * <p> + * 学生签到表 服务类 + * </p> + * + * @author DengMin + * @since 2021-09-28 + */ +public interface SignInRecordService extends IService<SignInRecordDO> { + + IPage<ClassSignInVO> classSignIn(ClassSignInDTO classSignInDTO); + +} diff --git a/src/main/java/com/meishu/service/SmsCodeService.java b/src/main/java/com/meishu/service/SmsCodeService.java new file mode 100644 index 0000000..2e053d3 --- /dev/null +++ b/src/main/java/com/meishu/service/SmsCodeService.java @@ -0,0 +1,18 @@ +package com.meishu.service; + +import com.meishu.dto.sms.SendVerifyCodeDTO; +import com.meishu.model.SmsCodeDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * <p> + * 短信验证码 服务类 + * </p> + * + * @author Tuyp + * @since 2021-04-25 + */ +public interface SmsCodeService extends IService<SmsCodeDO> { + + void sendVerifyCode(SendVerifyCodeDTO sendVerifyCodeDTO); +} diff --git a/src/main/java/com/meishu/service/StudentService.java b/src/main/java/com/meishu/service/StudentService.java new file mode 100644 index 0000000..184e9c9 --- /dev/null +++ b/src/main/java/com/meishu/service/StudentService.java @@ -0,0 +1,41 @@ +package com.meishu.service; + +import com.meishu.dto.campus.BatchUpdateStatusDTO; +import com.meishu.dto.student.*; +import com.meishu.dto.subject.BatchStatusOprDTO; +import com.meishu.model.*; +import com.baomidou.mybatisplus.extension.service.IService; +import com.meishu.util.SMSUtils; +import com.meishu.vo.course.GetVodIndexVO; +import com.meishu.vo.course.QueryCourseInfoVO; +import com.meishu.vo.rule.GetOneExaminationDetailVO; +import com.meishu.vo.rule.GetStudentRulesVO; +import com.meishu.vo.student.*; + +import java.util.List; + +/** + * <p> + * 白名单 服务类 + * </p> + * + * @author Tuyp + * @since 2021-04-25 + */ +public interface StudentService extends IService<StudentDO> { + + String sendMsg(StudentDO studentDO); + + LoginVO login(SmsCodeDO smsCodeDO); + + String addStudent(StudentDO studentDO); + + String updateStudent(StudentDO studentDO); + + String batchUpdateStudent(BatchStatusOprDTO batchStatusOprDTO); + + String deleteStudent(DeleteStudentDTO deleteStudentDTO); + + QueryStudentVO queryStudent(StudentDO studentDO); + +} diff --git a/src/main/java/com/meishu/service/SubjectDictService.java b/src/main/java/com/meishu/service/SubjectDictService.java new file mode 100644 index 0000000..bb9717a --- /dev/null +++ b/src/main/java/com/meishu/service/SubjectDictService.java @@ -0,0 +1,16 @@ +package com.meishu.service; + +import com.meishu.model.SubjectDictDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * <p> + * 学校科目字典表 服务类 + * </p> + * + * @author Tuyp + * @since 2021-08-17 + */ +public interface SubjectDictService extends IService<SubjectDictDO> { + +} diff --git a/src/main/java/com/meishu/service/SubjectDimensionDictService.java b/src/main/java/com/meishu/service/SubjectDimensionDictService.java new file mode 100644 index 0000000..adf7c0c --- /dev/null +++ b/src/main/java/com/meishu/service/SubjectDimensionDictService.java @@ -0,0 +1,33 @@ +package com.meishu.service; + +import com.meishu.model.SubjectDimensionDictDO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.meishu.model.SubjectDimensionStarDictDO; +import com.meishu.model.SubjectTestDictDO; +import com.meishu.model.SubjectTestPublishGradeDO; +import com.meishu.vo.dimension.GetAllDimensionStarVO; + +import java.util.HashMap; +import java.util.List; + +/** + * <p> + * 测评表 服务类 + * </p> + * + * @author Tuyp + * @since 2021-05-06 + */ +public interface SubjectDimensionDictService extends IService<SubjectDimensionDictDO> { + + List<SubjectDimensionDictDO> getAllDimensions(SubjectDimensionDictDO subjectDimensionDictDO); + + String deleteDimensionById(SubjectDimensionDictDO subjectDimensionDictDO); + + String updateDimension(SubjectDimensionDictDO subjectDimensionDictDO); + + String addDimension(SubjectDimensionDictDO subjectDimensionDictDO); + + List<GetAllDimensionStarVO> getAllDimensionStar(SubjectTestPublishGradeDO subjectTestPublishGradeDO); + +} diff --git a/src/main/java/com/meishu/service/SubjectDimensionStarDictService.java b/src/main/java/com/meishu/service/SubjectDimensionStarDictService.java new file mode 100644 index 0000000..f297ad8 --- /dev/null +++ b/src/main/java/com/meishu/service/SubjectDimensionStarDictService.java @@ -0,0 +1,28 @@ +package com.meishu.service; + +import com.meishu.dto.dimension.AddStarDTO; +import com.meishu.dto.dimension.DeleteStarByIdDTO; +import com.meishu.model.SubjectDimensionStarDictDO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.meishu.vo.dimension.GetAllDimensionStarsVO; + +import java.util.List; + +/** + * <p> + * 维度星级字典表 服务类 + * </p> + * + * @author Tuyp + * @since 2021-05-06 + */ +public interface SubjectDimensionStarDictService extends IService<SubjectDimensionStarDictDO> { + + List<GetAllDimensionStarsVO> getAllDimensionStars(SubjectDimensionStarDictDO subjectDimensionStartDictDO); + + String deleteStarById(DeleteStarByIdDTO deleteDimensionByIdDTO); + + String addStar(AddStarDTO addStarDTO); + + String updateStar(AddStarDTO addStarDTO); +} diff --git a/src/main/java/com/meishu/service/SubjectRuleService.java b/src/main/java/com/meishu/service/SubjectRuleService.java new file mode 100644 index 0000000..832972b --- /dev/null +++ b/src/main/java/com/meishu/service/SubjectRuleService.java @@ -0,0 +1,33 @@ +package com.meishu.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.meishu.dto.rule.GetAllRulesDTO; +import com.meishu.dto.rule.GetRuleReportDTO; +import com.meishu.model.SubjectRuleDO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.meishu.vo.rule.GetAllRulesVO; +import com.meishu.vo.rule.GetRuleReportVO; + +import java.util.List; + +/** + * <p> + * 规则字典表 服务类 + * </p> + * + * @author Tuyp + * @since 2021-05-08 + */ +public interface SubjectRuleService extends IService<SubjectRuleDO> { + + IPage<GetAllRulesVO> getAllRules(GetAllRulesDTO getAllRulesDTO); + + List<GetAllRulesVO> getRules(); + + String addRule(SubjectRuleDO subjectRuleDO); + + String updateRule(SubjectRuleDO subjectRuleDO); + + String deleteRule(SubjectRuleDO subjectRuleDO); + +} diff --git a/src/main/java/com/meishu/service/SubjectSemesterService.java b/src/main/java/com/meishu/service/SubjectSemesterService.java new file mode 100644 index 0000000..9fb0c17 --- /dev/null +++ b/src/main/java/com/meishu/service/SubjectSemesterService.java @@ -0,0 +1,35 @@ +package com.meishu.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.meishu.dto.semester.GetSemesterScoreDTO; +import com.meishu.dto.semester.GetStudentDetailDTO; +import com.meishu.dto.semester.GetStudentRecordDTO; +import com.meishu.model.SubjectSemesterDO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.meishu.vo.semester.*; + +import java.util.List; + +/** + * <p> + * 服务类 + * </p> + * + * @author Tuyp + * @since 2021-08-11 + */ +public interface SubjectSemesterService extends IService<SubjectSemesterDO> { + + List<GetAllStudyingSemesterVO> getAllStudyingSemester(); + + List<GetAllPastSemesterVO> getAllPastSemester(); + + IPage<GetSemesterScoreVO> getSemesterScore(GetSemesterScoreDTO getSemesterScoreDTO); + + List<GetSemesterScoreVO> exportScore(GetSemesterScoreDTO getSemesterScoreDTO); + + IPage<GetStudentDetailVO> getStudentDetail(GetStudentDetailDTO getStudentDetailDTO); + + List<GetStudentRecordVO> getStudentRecord(GetStudentRecordDTO getStudentRecordDTO); + +} diff --git a/src/main/java/com/meishu/service/SubjectStarTreeMappingService.java b/src/main/java/com/meishu/service/SubjectStarTreeMappingService.java new file mode 100644 index 0000000..400228c --- /dev/null +++ b/src/main/java/com/meishu/service/SubjectStarTreeMappingService.java @@ -0,0 +1,16 @@ +package com.meishu.service; + +import com.meishu.model.SubjectStarTreeMappingDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * <p> + * 测评-知识点关联表 服务类 + * </p> + * + * @author Tuyp + * @since 2021-05-06 + */ +public interface SubjectStarTreeMappingService extends IService<SubjectStarTreeMappingDO> { + +} diff --git a/src/main/java/com/meishu/service/SubjectStudentAnswerStarService.java b/src/main/java/com/meishu/service/SubjectStudentAnswerStarService.java new file mode 100644 index 0000000..499d4eb --- /dev/null +++ b/src/main/java/com/meishu/service/SubjectStudentAnswerStarService.java @@ -0,0 +1,16 @@ +package com.meishu.service; + +import com.meishu.model.SubjectStudentAnswerStarDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * <p> + * 学生答卷星级表 服务类 + * </p> + * + * @author Tuyp + * @since 2021-05-13 + */ +public interface SubjectStudentAnswerStarService extends IService<SubjectStudentAnswerStarDO> { + +} diff --git a/src/main/java/com/meishu/service/SubjectTestDictService.java b/src/main/java/com/meishu/service/SubjectTestDictService.java new file mode 100644 index 0000000..97edfba --- /dev/null +++ b/src/main/java/com/meishu/service/SubjectTestDictService.java @@ -0,0 +1,32 @@ +package com.meishu.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.IService; +import com.meishu.dto.test.GetAllTestDTO; +import com.meishu.model.SubjectTestDictDO; +import com.meishu.vo.test.GetAllTestVO; +import com.meishu.vo.test.GetTestReportVO; + +import java.util.List; + +/** + * <p> + * 测评表 服务类 + * </p> + * + * @author Tuyp + * @since 2021-05-20 + */ +public interface SubjectTestDictService extends IService<SubjectTestDictDO> { + + IPage<GetAllTestVO> getAllTest(GetAllTestDTO getAllTestDTO); + + List<GetAllTestVO> getTest(GetAllTestDTO getAllTestDTO); + + String insertTest(SubjectTestDictDO subjectTestDictDO); + + String updateTest(SubjectTestDictDO subjectTestDictDO); + + String deleteByTestId(SubjectTestDictDO subjectTestDictDO); + +} diff --git a/src/main/java/com/meishu/service/SubjectTestGradeExampleMappingService.java b/src/main/java/com/meishu/service/SubjectTestGradeExampleMappingService.java new file mode 100644 index 0000000..f4d1f48 --- /dev/null +++ b/src/main/java/com/meishu/service/SubjectTestGradeExampleMappingService.java @@ -0,0 +1,16 @@ +package com.meishu.service; + +import com.meishu.model.SubjectTestGradeExampleMappingDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * <p> + * 样卷映射表 服务类 + * </p> + * + * @author Tuyp + * @since 2021-06-21 + */ +public interface SubjectTestGradeExampleMappingService extends IService<SubjectTestGradeExampleMappingDO> { + +} diff --git a/src/main/java/com/meishu/service/SubjectTestGradeStarMappingService.java b/src/main/java/com/meishu/service/SubjectTestGradeStarMappingService.java new file mode 100644 index 0000000..b0bda0f --- /dev/null +++ b/src/main/java/com/meishu/service/SubjectTestGradeStarMappingService.java @@ -0,0 +1,16 @@ +package com.meishu.service; + +import com.meishu.model.SubjectTestGradeStarMappingDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * <p> + * 档次星级映射表 服务类 + * </p> + * + * @author Tuyp + * @since 2021-06-21 + */ +public interface SubjectTestGradeStarMappingService extends IService<SubjectTestGradeStarMappingDO> { + +} diff --git a/src/main/java/com/meishu/service/SubjectTestPublishGradeService.java b/src/main/java/com/meishu/service/SubjectTestPublishGradeService.java new file mode 100644 index 0000000..b89d876 --- /dev/null +++ b/src/main/java/com/meishu/service/SubjectTestPublishGradeService.java @@ -0,0 +1,33 @@ +package com.meishu.service; + +import com.meishu.dto.grade.AddGradeDTO; +import com.meishu.model.SubjectRuleDO; +import com.meishu.model.SubjectTestPublishGradeDO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.meishu.vo.grade.QueryOneGradeVO; + +import java.util.List; + +/** + * <p> + * 档次表 服务类 + * </p> + * + * @author Tuyp + * @since 2021-06-21 + */ +public interface SubjectTestPublishGradeService extends IService<SubjectTestPublishGradeDO> { + + String addGrade(AddGradeDTO addGradeDTO); + + String deleteGrade(SubjectTestPublishGradeDO subjectTestPublishGradeDO); + + List<QueryOneGradeVO> queryGrade(SubjectTestPublishGradeDO subjectTestPublishGradeDO); + + QueryOneGradeVO queryOneGrade(SubjectTestPublishGradeDO subjectTestPublishGradeDO); + + String updateGrade(AddGradeDTO addGradeDTO); + + SubjectRuleDO getRuleIdByPublishId(SubjectTestPublishGradeDO subjectTestPublishGradeDO); + +} diff --git a/src/main/java/com/meishu/service/SubjectTestPublishHistoryService.java b/src/main/java/com/meishu/service/SubjectTestPublishHistoryService.java new file mode 100644 index 0000000..282d2e5 --- /dev/null +++ b/src/main/java/com/meishu/service/SubjectTestPublishHistoryService.java @@ -0,0 +1,37 @@ +package com.meishu.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.meishu.dto.test.*; +import com.meishu.model.SubjectTestDictDO; +import com.meishu.model.SubjectTestPublishHistoryDO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.meishu.vo.test.GetOnePublishVO; +import com.meishu.vo.test.GetPublishHistoryVO; +import com.meishu.vo.test.GetTestReportVO; + +import java.util.List; + +/** + * <p> + * 测评发布记录表 服务类 + * </p> + * + * @author Tuyp + * @since 2021-05-08 + */ +public interface SubjectTestPublishHistoryService extends IService<SubjectTestPublishHistoryDO> { + + String publishTest(PublishTestDTO publishTestDTO); + + String updatePublish(PublishTestDTO publishTestDTO); + + IPage<GetPublishHistoryVO> getPublishHistory(GetPublishHistoryDTO getPublishHistoryDTO); + + IPage<GetTestReportVO> getTestReport(GetTestReportDTO getTestReportDTO); + + IPage<GetOnePublishVO> getOnePublish(GetOnePublishDTO getOnePublishDTO); + + String comment(CommentDTO commentDTO); + + String deletePublish(SubjectTestPublishHistoryDO subjectTestPublishHistoryDO); +} diff --git a/src/main/java/com/meishu/service/SubjectTestStudentAnswerService.java b/src/main/java/com/meishu/service/SubjectTestStudentAnswerService.java new file mode 100644 index 0000000..5d06a3e --- /dev/null +++ b/src/main/java/com/meishu/service/SubjectTestStudentAnswerService.java @@ -0,0 +1,16 @@ +package com.meishu.service; + +import com.meishu.model.SubjectTestStudentAnswerDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * <p> + * 学生月考答卷 服务类 + * </p> + * + * @author Tuyp + * @since 2021-05-13 + */ +public interface SubjectTestStudentAnswerService extends IService<SubjectTestStudentAnswerDO> { + +} diff --git a/src/main/java/com/meishu/service/SubjectTreeService.java b/src/main/java/com/meishu/service/SubjectTreeService.java new file mode 100644 index 0000000..6427b2e --- /dev/null +++ b/src/main/java/com/meishu/service/SubjectTreeService.java @@ -0,0 +1,32 @@ +package com.meishu.service; + +import com.meishu.dto.subject.GetSubjectTreeDTO; +import com.meishu.dto.subject.UpdateTreeOrderDTO; +import com.meishu.model.SubjectTreeDO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.meishu.vo.subject.GetSubjectTreeVO; + +import java.util.List; + +/** + * <p> + * 服务类 + * </p> + * + * @author Tuyp + * @since 2021-04-27 + */ +public interface SubjectTreeService extends IService<SubjectTreeDO> { + + String updateSubjectTree(SubjectTreeDO subjectTreeDO); + + String addSubjectTree(SubjectTreeDO subjectTreeDO); + + String deleteSubjectTree(SubjectTreeDO subjectTreeDO); + + String updateTreeOrder(UpdateTreeOrderDTO updateTreeOrderDTO); + + List<GetSubjectTreeVO> getTreesCnt(GetSubjectTreeDTO getSubjectTreeDTO); + + List<GetSubjectTreeVO> getTreesCheckCnt(GetSubjectTreeDTO getSubjectTreeDTO); +} diff --git a/src/main/java/com/meishu/service/TaskCompletionStatusService.java b/src/main/java/com/meishu/service/TaskCompletionStatusService.java new file mode 100644 index 0000000..46d158d --- /dev/null +++ b/src/main/java/com/meishu/service/TaskCompletionStatusService.java @@ -0,0 +1,16 @@ +package com.meishu.service; + +import com.meishu.model.TaskCompletionStatusDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * <p> + * 作业任务完成状态 服务类 + * </p> + * + * @author DengMin + * @since 2021-09-16 + */ +public interface TaskCompletionStatusService extends IService<TaskCompletionStatusDO> { + +} diff --git a/src/main/java/com/meishu/service/TaskContentDoneInfoService.java b/src/main/java/com/meishu/service/TaskContentDoneInfoService.java new file mode 100644 index 0000000..db1e545 --- /dev/null +++ b/src/main/java/com/meishu/service/TaskContentDoneInfoService.java @@ -0,0 +1,16 @@ +package com.meishu.service; + +import com.meishu.model.TaskContentDoneInfoDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * <p> + * 服务类 + * </p> + * + * @author DengMin + * @since 2021-09-30 + */ +public interface TaskContentDoneInfoService extends IService<TaskContentDoneInfoDO> { + +} diff --git a/src/main/java/com/meishu/service/TaskContentService.java b/src/main/java/com/meishu/service/TaskContentService.java new file mode 100644 index 0000000..9af7ae9 --- /dev/null +++ b/src/main/java/com/meishu/service/TaskContentService.java @@ -0,0 +1,16 @@ +package com.meishu.service; + +import com.meishu.model.TaskContentDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * <p> + * 作业内容表(取题目,视频,书面作业) 服务类 + * </p> + * + * @author DengMin + * @since 2021-09-16 + */ +public interface TaskContentService extends IService<TaskContentDO> { + +} diff --git a/src/main/java/com/meishu/service/TaskDoneHistoryService.java b/src/main/java/com/meishu/service/TaskDoneHistoryService.java new file mode 100644 index 0000000..b423e88 --- /dev/null +++ b/src/main/java/com/meishu/service/TaskDoneHistoryService.java @@ -0,0 +1,16 @@ +package com.meishu.service; + +import com.meishu.model.TaskDoneHistoryDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * <p> + * 服务类 + * </p> + * + * @author DengMin + * @since 2021-09-16 + */ +public interface TaskDoneHistoryService extends IService<TaskDoneHistoryDO> { + +} diff --git a/src/main/java/com/meishu/service/UserRoleCopy1Service.java b/src/main/java/com/meishu/service/UserRoleCopy1Service.java new file mode 100644 index 0000000..c082a40 --- /dev/null +++ b/src/main/java/com/meishu/service/UserRoleCopy1Service.java @@ -0,0 +1,16 @@ +package com.meishu.service; + +import com.meishu.model.UserRoleCopy1DO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * <p> + * 学生表 服务类 + * </p> + * + * @author DengMin + * @since 2021-09-23 + */ +public interface UserRoleCopy1Service extends IService<UserRoleCopy1DO> { + +} diff --git a/src/main/java/com/meishu/service/UserRoleService.java b/src/main/java/com/meishu/service/UserRoleService.java new file mode 100644 index 0000000..a215605 --- /dev/null +++ b/src/main/java/com/meishu/service/UserRoleService.java @@ -0,0 +1,41 @@ +package com.meishu.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.meishu.dto.sms.VerifyCodeDTO; +import com.meishu.dto.userrole.AccountLoginDTO; +import com.meishu.dto.userrole.AddStudentsDTO; +import com.meishu.dto.userrole.QueryStudentsDTO; +import com.meishu.model.UserRoleDO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.meishu.vo.userrole.QueryStudentsVO; +import com.meishu.vo.userrole.UserInfoVO; +import com.meishu.vo.userrole.UserRoleVO; + +import java.util.List; + +/** + * <p> + * 学生表 服务类 + * </p> + * + * @author Tuyp + * @since 2021-08-16 + */ +public interface UserRoleService extends IService<UserRoleDO> { + + IPage<QueryStudentsVO> queryStudents(QueryStudentsDTO queryStudentsDTO); + + String addStudents(UserRoleDO userRoleDO); + + String updateStudent(UserRoleDO userRoleDO); + + List<QueryStudentsVO> exportStudents(QueryStudentsDTO queryStudentsDTO); + + UserRoleVO login(VerifyCodeDTO verifyCodeDTO); + + UserInfoVO userInfo(Integer id); + + UserRoleVO accountLogin(AccountLoginDTO accountLoginDTO); + + void studycode(); +} diff --git a/src/main/java/com/meishu/service/UserSubjectMappingService.java b/src/main/java/com/meishu/service/UserSubjectMappingService.java new file mode 100644 index 0000000..7f57236 --- /dev/null +++ b/src/main/java/com/meishu/service/UserSubjectMappingService.java @@ -0,0 +1,16 @@ +package com.meishu.service; + +import com.meishu.model.UserSubjectMappingDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * <p> + * 老师-科目映射表 服务类 + * </p> + * + * @author Tuyp + * @since 2021-08-17 + */ +public interface UserSubjectMappingService extends IService<UserSubjectMappingDO> { + +} diff --git a/src/main/java/com/meishu/service/UserSubjectPermissionDictService.java b/src/main/java/com/meishu/service/UserSubjectPermissionDictService.java new file mode 100644 index 0000000..f5a0b06 --- /dev/null +++ b/src/main/java/com/meishu/service/UserSubjectPermissionDictService.java @@ -0,0 +1,16 @@ +package com.meishu.service; + +import com.meishu.model.UserSubjectPermissionDictDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * <p> + * 平时成绩---老师班级权限 服务类 + * </p> + * + * @author Tuyp + * @since 2021-08-18 + */ +public interface UserSubjectPermissionDictService extends IService<UserSubjectPermissionDictDO> { + +} diff --git a/src/main/java/com/meishu/service/UuidHistoryService.java b/src/main/java/com/meishu/service/UuidHistoryService.java new file mode 100644 index 0000000..40b980c --- /dev/null +++ b/src/main/java/com/meishu/service/UuidHistoryService.java @@ -0,0 +1,16 @@ +package com.meishu.service; + +import com.meishu.model.UuidHistoryDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * <p> + * 服务类 + * </p> + * + * @author DengMin + * @since 2021-09-29 + */ +public interface UuidHistoryService extends IService<UuidHistoryDO> { + +} diff --git a/src/main/java/com/meishu/service/VodDictService.java b/src/main/java/com/meishu/service/VodDictService.java new file mode 100644 index 0000000..a92a9f1 --- /dev/null +++ b/src/main/java/com/meishu/service/VodDictService.java @@ -0,0 +1,53 @@ +package com.meishu.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.meishu.dto.voddict.*; +import com.meishu.model.VodDictDO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.meishu.model.VodPlayHistoryDO; +import com.meishu.model.VodSubjectTreeMappingDO; +import com.meishu.vo.voddict.*; + +/** + * <p> + * 视频字典表 服务类 + * </p> + * + * @author Tuyp + * @since 2021-04-27 + */ +public interface VodDictService extends IService<VodDictDO> { + + SignatureVO signature()throws Exception; + + IPage<GetTreeVodsVO> getTreeVods(GetTreeVodsDTO getTreeVodsDTO); + + IPage<GetTreeVodsVO> getCheckTreeVods(GetTreeVodsDTO getTreeVodsDTO); + + String deleteVod(VodDictDO vodDictDO); + + VodDictDO uploadVods(UploadVodsDTO uploadVodsDTO); + + String updateVod(UploadVodsDTO uploadVodsDTO); + + VodDictDO getVodInfo(VodDictDO vodDictDO); + + String insertPlayHistory(VodPlayHistoryDO vodPlayHistoryDO); + + GetToCheckCountsVO getToCheckVodCounts(GetToCheckVodCountsDTO getToCheckVodCountsDTO); + + String compressVodByCode(VodDictDO vodDictDO); + + String deleteOriginVod(DeleteOriginVodDTO deleteOriginVodDTO); + + String checkVod(CheckVodDTO checkVodDTO); + + IPage<VodDictDO> publicUpload(PublicCheckingDTO publicCheckingDTO); + + String withdraw(VodDictDO vodDictDO); + + GetVodDetailVO getVodDetail(VodDictDO vodDictDO); + + String setRelatedVod(VodSubjectTreeMappingDO vodSubjectTreeMappingDO); + +} diff --git a/src/main/java/com/meishu/service/VodPlayHistoryService.java b/src/main/java/com/meishu/service/VodPlayHistoryService.java new file mode 100644 index 0000000..69cd8c3 --- /dev/null +++ b/src/main/java/com/meishu/service/VodPlayHistoryService.java @@ -0,0 +1,16 @@ +package com.meishu.service; + +import com.meishu.model.VodPlayHistoryDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * <p> + * 视频播放历史记录表 服务类 + * </p> + * + * @author Tuyp + * @since 2021-04-27 + */ +public interface VodPlayHistoryService extends IService<VodPlayHistoryDO> { + +} diff --git a/src/main/java/com/meishu/service/VodSubjectTreeMappingService.java b/src/main/java/com/meishu/service/VodSubjectTreeMappingService.java new file mode 100644 index 0000000..7c9c461 --- /dev/null +++ b/src/main/java/com/meishu/service/VodSubjectTreeMappingService.java @@ -0,0 +1,23 @@ +package com.meishu.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.meishu.dto.subject.BatchStatusOprDTO; +import com.meishu.dto.subject.GetAllVodsStatusDTO; +import com.meishu.model.VodSubjectTreeMappingDO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.meishu.vo.subject.GetAllNoAuthenVodsVO; + +/** + * <p> + * 视频知识点映射表 服务类 + * </p> + * + * @author Tuyp + * @since 2021-04-27 + */ +public interface VodSubjectTreeMappingService extends IService<VodSubjectTreeMappingDO> { + + IPage<GetAllNoAuthenVodsVO> getAllNoAuthenVods(GetAllVodsStatusDTO getAllNoAuthenVodsDTO); + + String batchStatusOpr(BatchStatusOprDTO batchStatusOprDTO); +} diff --git a/src/main/java/com/meishu/service/WrittenHomeworkService.java b/src/main/java/com/meishu/service/WrittenHomeworkService.java new file mode 100644 index 0000000..428feff --- /dev/null +++ b/src/main/java/com/meishu/service/WrittenHomeworkService.java @@ -0,0 +1,16 @@ +package com.meishu.service; + +import com.meishu.model.WrittenHomeworkDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * <p> + * 通知/附件作业表 服务类 + * </p> + * + * @author DengMin + * @since 2021-09-16 + */ +public interface WrittenHomeworkService extends IService<WrittenHomeworkDO> { + +} diff --git a/src/main/java/com/meishu/service/impl/AccessTokenServiceImpl.java b/src/main/java/com/meishu/service/impl/AccessTokenServiceImpl.java new file mode 100644 index 0000000..fe0c34f --- /dev/null +++ b/src/main/java/com/meishu/service/impl/AccessTokenServiceImpl.java @@ -0,0 +1,89 @@ +package com.meishu.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.meishu.common.exception.HttpException; +import com.meishu.dto.token.GetAllStudentsDTO; +import com.meishu.dto.token.GetAllTeachersDTO; +import com.meishu.mapper.AdministerMapper; +import com.meishu.mapper.UuidHistoryMapper; +import com.meishu.model.AccessTokenDO; +import com.meishu.mapper.AccessTokenMapper; +import com.meishu.model.AdministerDO; +import com.meishu.model.UserRoleDO; +import com.meishu.model.UuidHistoryDO; +import com.meishu.service.AccessTokenService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.meishu.util.SecretUtils; +import com.meishu.vo.accesstoken.GetAllStudentsVO; +import com.meishu.vo.accesstoken.GetAllTeachersVO; +import com.meishu.vo.administer.GetTeacherSubjectVO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * <p> + * 服务实现类 + * </p> + * + * @author Tuyp + * @since 2021-05-10 + */ +@Service +public class AccessTokenServiceImpl extends ServiceImpl<AccessTokenMapper, AccessTokenDO> implements AccessTokenService { + + @Autowired + private AdministerMapper administerMapper; + + @Autowired + private UuidHistoryMapper uuidHistoryMapper; + + public List<GetAllTeachersVO> getAllTeachers(GetAllTeachersDTO getAllTeachersDTO){ + + int count = uuidHistoryMapper.selectCount(new QueryWrapper<UuidHistoryDO>() + .lambda() + .eq(UuidHistoryDO::getUuid,getAllTeachersDTO.getUuid())); + + if (count>0){ + throw new HttpException(80001); + } + + String uuidSec = SecretUtils.hash(getAllTeachersDTO.getUuid()+"ixihs"); + if (!uuidSec.equals(getAllTeachersDTO.getUuidSecret())){ + throw new HttpException(80002); + } + + //查找所有老师 + List<GetAllTeachersVO> administerDOS = this.baseMapper.getAllTeachers(getAllTeachersDTO); + administerDOS.stream().forEach(x->{ + List<GetTeacherSubjectVO> getTeacherSubjectVOS = administerMapper.getTeacherSubject(x.getId()); + x.setSubjectDictDOS(getTeacherSubjectVOS); + }); + UuidHistoryDO uuidHistoryDO = new UuidHistoryDO(); + uuidHistoryDO.setUuid(getAllTeachersDTO.getUuid()); + uuidHistoryMapper.insert(uuidHistoryDO); + return administerDOS; + } + + public List<GetAllStudentsVO> getAllStudents(GetAllStudentsDTO getAllStudentsDTO){ + int count = uuidHistoryMapper.selectCount(new QueryWrapper<UuidHistoryDO>() + .lambda() + .eq(UuidHistoryDO::getUuid,getAllStudentsDTO.getUuid())); + + if (count>0){ + throw new HttpException(80001); + } + + String uuidSec = SecretUtils.hash(getAllStudentsDTO.getUuid()+"ixihs"); + if (!uuidSec.equals(getAllStudentsDTO.getUuidSecret())){ + throw new HttpException(80002); + } + UuidHistoryDO uuidHistoryDO = new UuidHistoryDO(); + uuidHistoryDO.setUuid(getAllStudentsDTO.getUuid()); + uuidHistoryMapper.insert(uuidHistoryDO); + return this.baseMapper.getAllStudents(getAllStudentsDTO); + } + + +} diff --git a/src/main/java/com/meishu/service/impl/AdministerDepartmentMappingServiceImpl.java b/src/main/java/com/meishu/service/impl/AdministerDepartmentMappingServiceImpl.java new file mode 100644 index 0000000..6c8d30a --- /dev/null +++ b/src/main/java/com/meishu/service/impl/AdministerDepartmentMappingServiceImpl.java @@ -0,0 +1,20 @@ +package com.meishu.service.impl; + +import com.meishu.model.AdministerDepartmentMappingDO; +import com.meishu.mapper.AdministerDepartmentMappingMapper; +import com.meishu.service.AdministerDepartmentMappingService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + * <p> + * 老师部门映射表 服务实现类 + * </p> + * + * @author Tuyp + * @since 2021-07-01 + */ +@Service +public class AdministerDepartmentMappingServiceImpl extends ServiceImpl<AdministerDepartmentMappingMapper, AdministerDepartmentMappingDO> implements AdministerDepartmentMappingService { + +} diff --git a/src/main/java/com/meishu/service/impl/AdministerPermissionServiceImpl.java b/src/main/java/com/meishu/service/impl/AdministerPermissionServiceImpl.java new file mode 100644 index 0000000..a49c212 --- /dev/null +++ b/src/main/java/com/meishu/service/impl/AdministerPermissionServiceImpl.java @@ -0,0 +1,20 @@ +package com.meishu.service.impl; + +import com.meishu.model.AdministerPermissionDO; +import com.meishu.mapper.AdministerPermissionMapper; +import com.meishu.service.AdministerPermissionService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + * <p> + * 系统用户角色表 服务实现类 + * </p> + * + * @author Tuyp + * @since 2021-04-25 + */ +@Service +public class AdministerPermissionServiceImpl extends ServiceImpl<AdministerPermissionMapper, AdministerPermissionDO> implements AdministerPermissionService { + +} diff --git a/src/main/java/com/meishu/service/impl/AdministerServiceImpl.java b/src/main/java/com/meishu/service/impl/AdministerServiceImpl.java new file mode 100644 index 0000000..2b5a112 --- /dev/null +++ b/src/main/java/com/meishu/service/impl/AdministerServiceImpl.java @@ -0,0 +1,352 @@ +package com.meishu.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.meishu.common.exception.HttpException; +import com.meishu.dto.administer.*; +import com.meishu.mapper.*; +import com.meishu.model.*; +import com.meishu.service.AdministerService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.meishu.util.*; +import com.meishu.vo.administer.AdministerPermissionVO; +import com.meishu.vo.administer.LoginVO; +import com.meishu.vo.administer.PermissionsVO; +import com.meishu.vo.wechat.AccessTokenVO; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpMethod; +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.StringUtils; + +import java.text.SimpleDateFormat; +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Date; +import java.util.List; + +/** + * <p> + * 中心管理账户表 服务实现类 + * </p> + * + * @author Tuyp + * @since 2021-04-25 + */ +@Service +public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, AdministerDO> implements AdministerService { + + @Autowired + private SmsCodeMapper smsCodeMapper; + + @Autowired + private AdministerPermissionMapper administerPermissionMapper; + + @Autowired + private PermissionsDictMapper permissionsDictMapper; + + @Autowired + private AdministerDepartmentMappingMapper administerDepartmentMappingMapper; + + @Autowired + private AdministerSubjectMappingMapper administerSubjectMappingMapper; + + @Autowired + private RoleAdministerMappingMapper roleAdministerMappingMapper; + + @Autowired + private SubjectTreeMapper subjectTreeMapper; + + @Autowired + private SubjectDictMapper subjectDictMapper; + + @Autowired + private ClassesDictMapper classesDictMapper; + + public String sendMsg(AdministerDO administerDO){ + + + //验证是否是白名单用户 + Integer count = this.baseMapper.selectCount(new QueryWrapper<AdministerDO>() + .lambda() + .eq(AdministerDO::getTelephone, administerDO.getTelephone())); + if (count == 0) { + throw new HttpException(10011); + } + + String verifyCode = RandomUtil.getRandomCode(6); + String param = "{ \"code\":\"" + verifyCode + "\"}"; + + //插入短信验证码 + smsCodeMapper.delete(new QueryWrapper<SmsCodeDO>() + .lambda() + .eq(SmsCodeDO::getTelephone,administerDO.getTelephone())); + + SmsCodeDO smsCodeDO = new SmsCodeDO(); + smsCodeDO.setTelephone(administerDO.getTelephone()); + smsCodeDO.setCode(verifyCode); + smsCodeDO.setCreateDate(LocalDateTime.now()); + smsCodeMapper.insert(smsCodeDO); + return SMSUtils.sendVerifySMS(ConstantUtils.TEMPLATE_CODE, smsCodeDO.getTelephone(), param); + + } + + public LoginVO login(SmsCodeDO smsCodeDO){ + + LoginVO loginVO = new LoginVO(); + Integer count = smsCodeMapper.selectCount(new QueryWrapper<SmsCodeDO>() + .lambda() + .eq(SmsCodeDO::getTelephone, smsCodeDO.getTelephone()) + .eq(SmsCodeDO::getCode, smsCodeDO.getCode()) + .gt(SmsCodeDO::getCreateDate, LocalDateTime.now().minusMinutes(10L)) + ); + + List<String> admin = Arrays.asList("18111111111","18122222222","18133333333","18144444444","18155555555","18166666666","18177777777","18188888888","18199999999","18100000000"); + if (admin.contains(smsCodeDO.getTelephone())){ + if ("123456".equals(smsCodeDO.getCode())){ + AdministerDO administerDO = this.baseMapper.selectOne(new QueryWrapper<AdministerDO>() + .lambda() + .eq(AdministerDO::getTelephone, smsCodeDO.getTelephone())); + if (administerDO == null) { + throw new HttpException(10013); + } + String token = JwtUtil.generateToken(administerDO.getId(), ConstantUtils.ADMINISTER_TERMINATE); + loginVO.setToken(token); + return loginVO; + }else { + throw new HttpException(10003); + } + } + + if (count > 0) { + AdministerDO administerDO = this.baseMapper.selectOne(new QueryWrapper<AdministerDO>() + .lambda() + .eq(AdministerDO::getTelephone, smsCodeDO.getTelephone())); + if (administerDO == null) { + throw new HttpException(10013); + } + + String token = JwtUtil.generateToken(administerDO.getId(), ConstantUtils.ADMINISTER_TERMINATE); + loginVO.setToken(token); + return loginVO; + } else { + throw new HttpException(10003); + } + } + + public LoginVO passwordLogin(AdministerDO administerDO){ + + LoginVO loginVO = new LoginVO(); + AdministerDO administerDO1 = this.baseMapper.selectOne(new QueryWrapper<AdministerDO>() + .lambda() + .eq(AdministerDO::getTelephone, administerDO.getTelephone()) + .eq(AdministerDO::getPassword,administerDO.getPassword())); + if (administerDO1 == null) { + throw new HttpException(10004); + } + + String token = JwtUtil.generateToken(administerDO1.getId(), ConstantUtils.ADMINISTER_TERMINATE); + loginVO.setToken(token); + return loginVO; + + } + + public AdministerPermissionVO getPermissions() { + + AdministerPermissionVO administerPermissionVO = new AdministerPermissionVO(); + AdministerDO administerDO = (AdministerDO) Localstorage.getUser(); +// AdministerDO administerDO = this.baseMapper.selectById(41); + if (administerDO == null) { + throw new HttpException(10012); + } + BeanUtils.copyProperties(administerDO, administerPermissionVO); + + //判断是否是超级管理员 + List<RoleAdministerMappingDO> roleAdministerMappingDOS = roleAdministerMappingMapper.selectList(new QueryWrapper<RoleAdministerMappingDO>() + .lambda() + .eq(RoleAdministerMappingDO::getAdministerId,administerDO.getId())); + + Boolean flag = false; + + for (RoleAdministerMappingDO roleAdministerMappingDO : roleAdministerMappingDOS){ + if (roleAdministerMappingDO.getRoleId()==1L){ + flag = true; + } + } + administerPermissionVO.setIsRole(flag); + List<PermissionsVO> list = administerPermissionMapper.getPermissions(administerDO.getId()); + List<PermissionsVO> treeList = new ArrayList(); + if (list != null) { + list.forEach(permission -> { + if (permission.getParentId() == null) { + treeList.add(permission); + } + + list.forEach(p -> { + if (null != p.getParentId() && p.getParentId().equals(permission.getId())) { + if (permission.getChildren() == null) { + permission.setChildren(new ArrayList<>()); + } + permission.getChildren().add(p); + } + }); + }); + } + administerPermissionVO.setPermissions(treeList); + return administerPermissionVO; + } + + public List<PermissionsDictDO> getParentPermission(){ + return permissionsDictMapper.selectList(new QueryWrapper<PermissionsDictDO>() + .lambda() + .isNull(PermissionsDictDO::getParentId)); + } + + @Transactional(rollbackFor = Exception.class) + public String addAdminister(AddAdministerDTO addAdministerDTO){ + + //老师手机号不能重复 + Integer count = this.baseMapper.selectCount(new QueryWrapper<AdministerDO>() + .lambda() + .eq(AdministerDO::getTelephone,addAdministerDTO.getTelephone())); + + if (count>0){ + throw new HttpException(60001); + } + + AdministerDO administerDO = new AdministerDO(); + BeanUtils.copyProperties(addAdministerDTO,administerDO); + administerDO.setStatus("1"); + this.baseMapper.insert(administerDO); + +// //多个校区 +// List<Long> campusIds = addAdministerDTO.getCampusIds(); +// for (Long lg : campusIds){ +// CampusAdministerMappingDO campusAdministerMappingDO = new CampusAdministerMappingDO(); +// campusAdministerMappingDO.setAdministerId(administerDO.getId()); +// campusAdministerMappingDO.setCampusId(lg); +// campusAdministerMappingMapper.insert(campusAdministerMappingDO); +// } + + //多个部门 + List<Long> departmentIds = addAdministerDTO.getDepartmentIds(); + for (Long lg : departmentIds){ + AdministerDepartmentMappingDO administerDepartmentMappingDO = new AdministerDepartmentMappingDO(); + administerDepartmentMappingDO.setAdministerId(administerDO.getId()); + administerDepartmentMappingDO.setDepartmentId(lg); + administerDepartmentMappingMapper.insert(administerDepartmentMappingDO); + } + + //多个科目 + List<Long> subjectIds = addAdministerDTO.getSubjectIds(); + for (Long lg : subjectIds){ + AdministerSubjectMappingDO administerSubjectMappingDO = new AdministerSubjectMappingDO(); + administerSubjectMappingDO.setAdministerId(administerDO.getId()); + administerSubjectMappingDO.setSubjectId(lg); + administerSubjectMappingMapper.insert(administerSubjectMappingDO); + } + + //角色 + List<Long> roleIds = addAdministerDTO.getRoleIds(); + for (Long lg : roleIds){ + RoleAdministerMappingDO roleAdministerMappingDO = new RoleAdministerMappingDO(); + roleAdministerMappingDO.setAdministerId(administerDO.getId()); + roleAdministerMappingDO.setRoleId(lg); + roleAdministerMappingMapper.insert(roleAdministerMappingDO); + } + + return ConstantUtils.ADD_SUCCESS; + } + + public List<PermissionsDictDO> getPermissionTree(){ + List<PermissionsDictDO> list = permissionsDictMapper.selectList(null); + List<PermissionsDictDO> treeList = new ArrayList(); + if (list != null) { + list.forEach(permission -> { + if (permission.getParentId() == null) { + treeList.add(permission); + } + + list.forEach(p -> { + if (null != p.getParentId() && p.getParentId().equals(permission.getId())) { + if (permission.getChildren() == null) { + permission.setChildren(new ArrayList<>()); + } + permission.getChildren().add(p); + } + }); + }); + } + return treeList; + } + + public String changeStatus(ChangeStatusDTO changeStatusDTO){ + AdministerDO administerDO = new AdministerDO(); + administerDO.setStatus(changeStatusDTO.getStatus()); + this.baseMapper.update(administerDO,new QueryWrapper<AdministerDO>() + .lambda() + .in(AdministerDO::getId,changeStatusDTO.getIds())); +// this.baseMapper.updateById(administerDO); + return ConstantUtils.SUCCESS_UPDATE; + } + + @Transactional(rollbackFor = Exception.class) + public String updateAdminister(UpdateAdministerDTO updateAdministerDTO){ + + AdministerDO administerDO = new AdministerDO(); + BeanUtils.copyProperties(updateAdministerDTO,administerDO); + this.baseMapper.updateById(administerDO); + + if (null!=updateAdministerDTO.getDepartmentIds()){ + administerDepartmentMappingMapper.delete(new QueryWrapper<AdministerDepartmentMappingDO>() + .lambda() + .eq(AdministerDepartmentMappingDO::getAdministerId,updateAdministerDTO.getId())); + + List<Long> departmentIds = updateAdministerDTO.getDepartmentIds(); + for (Long lg : departmentIds){ + AdministerDepartmentMappingDO administerDepartmentMappingDO = new AdministerDepartmentMappingDO(); + administerDepartmentMappingDO.setDepartmentId(lg); + administerDepartmentMappingDO.setAdministerId(updateAdministerDTO.getId()); + administerDepartmentMappingMapper.insert(administerDepartmentMappingDO); + } + } + + if (null!=updateAdministerDTO.getSubjectIds()){ + + administerSubjectMappingMapper.delete(new QueryWrapper<AdministerSubjectMappingDO>() + .lambda() + .eq(AdministerSubjectMappingDO::getAdministerId,updateAdministerDTO.getId())); + //多个科目 + List<Long> subjectIds = updateAdministerDTO.getSubjectIds(); + for (Long lg : subjectIds){ + AdministerSubjectMappingDO administerSubjectMappingDO = new AdministerSubjectMappingDO(); + administerSubjectMappingDO.setAdministerId(administerDO.getId()); + administerSubjectMappingDO.setSubjectId(lg); + administerSubjectMappingMapper.insert(administerSubjectMappingDO); + } + } + + if (null!=updateAdministerDTO.getRoleIds()){ + roleAdministerMappingMapper.delete(new QueryWrapper<RoleAdministerMappingDO>() + .lambda() + .eq(RoleAdministerMappingDO::getAdministerId,updateAdministerDTO.getId())); + List<Long> roleIds = updateAdministerDTO.getRoleIds(); + for (Long lg : roleIds){ + RoleAdministerMappingDO roleAdministerMappingDO = new RoleAdministerMappingDO(); + roleAdministerMappingDO.setAdministerId(updateAdministerDTO.getId()); + roleAdministerMappingDO.setRoleId(lg); + roleAdministerMappingMapper.insert(roleAdministerMappingDO); + } + + } + return ConstantUtils.SUCCESS_UPDATE; + } + + public List<AdministerDO> getAllAdminister(){ + return this.baseMapper.selectList(null); + } + + +} diff --git a/src/main/java/com/meishu/service/impl/AdministerSubjectMappingServiceImpl.java b/src/main/java/com/meishu/service/impl/AdministerSubjectMappingServiceImpl.java new file mode 100644 index 0000000..e2f2f63 --- /dev/null +++ b/src/main/java/com/meishu/service/impl/AdministerSubjectMappingServiceImpl.java @@ -0,0 +1,20 @@ +package com.meishu.service.impl; + +import com.meishu.model.AdministerSubjectMappingDO; +import com.meishu.mapper.AdministerSubjectMappingMapper; +import com.meishu.service.AdministerSubjectMappingService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + * <p> + * 老师科目映射表 服务实现类 + * </p> + * + * @author Tuyp + * @since 2021-07-01 + */ +@Service +public class AdministerSubjectMappingServiceImpl extends ServiceImpl<AdministerSubjectMappingMapper, AdministerSubjectMappingDO> implements AdministerSubjectMappingService { + +} diff --git a/src/main/java/com/meishu/service/impl/AnsweringQuestionServiceImpl.java b/src/main/java/com/meishu/service/impl/AnsweringQuestionServiceImpl.java new file mode 100644 index 0000000..3b7b803 --- /dev/null +++ b/src/main/java/com/meishu/service/impl/AnsweringQuestionServiceImpl.java @@ -0,0 +1,103 @@ +package com.meishu.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.meishu.dto.question.QueryQuestionsDTO; +import com.meishu.mapper.SubjectDictMapper; +import com.meishu.mapper.UserRoleMapper; +import com.meishu.mapper.UserSubjectPermissionDictMapper; +import com.meishu.model.AnsweringQuestionDO; +import com.meishu.mapper.AnsweringQuestionMapper; +import com.meishu.model.SubjectDictDO; +import com.meishu.model.UserRoleDO; +import com.meishu.model.UserSubjectPermissionDictDO; +import com.meishu.service.AnsweringQuestionService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.meishu.util.ConstantUtils; +import com.meishu.vo.question.GetClassQuestionsVO; +import com.meishu.vo.question.QueryOneQuestionVO; +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; +import java.util.Queue; + +/** + * <p> + * 问题答疑表 服务实现类 + * </p> + * + * @author DengMin + * @since 2021-09-28 + */ +@Service +public class AnsweringQuestionServiceImpl extends ServiceImpl<AnsweringQuestionMapper, AnsweringQuestionDO> implements AnsweringQuestionService { + + @Autowired + private UserRoleMapper userRoleMapper; + + @Autowired + private SubjectDictMapper subjectDictMapper; + + @Autowired + private UserSubjectPermissionDictMapper userSubjectPermissionDictMapper; + + public IPage queryQuestions(QueryQuestionsDTO queryQuestionsDTO){ + Page pager = new Page(queryQuestionsDTO.getPageNum(), queryQuestionsDTO.getPageSize()); + return this.baseMapper.queryQuestions(pager,queryQuestionsDTO.getSubjectId(),queryQuestionsDTO.getStartDate(),queryQuestionsDTO.getEndDate(),queryQuestionsDTO.getUserName()); + } + + public String deleteQuestion(AnsweringQuestionDO answeringQuestionDO){ + this.baseMapper.deleteById(answeringQuestionDO.getId()); + return ConstantUtils.DELETE_SUCCESS; + } + + public QueryOneQuestionVO queryOneQuestion(AnsweringQuestionDO answeringQuestionDO){ + + QueryOneQuestionVO queryOneQuestionVO = new QueryOneQuestionVO(); + + AnsweringQuestionDO answeringQuestionDO1 = this.baseMapper.selectById(answeringQuestionDO.getId()); + BeanUtils.copyProperties(answeringQuestionDO1,queryOneQuestionVO); + + UserRoleDO userRoleDO = userRoleMapper.selectById(answeringQuestionDO1.getAskId()); + queryOneQuestionVO.setUserName(userRoleDO.getUserName()); + + return queryOneQuestionVO; + } + + public List<GetClassQuestionsVO> getClassQuestions(UserSubjectPermissionDictDO userSubjectPermissionDictDO){ + + List<SubjectDictDO> userSubjectPermissionDictDOS = userSubjectPermissionDictMapper.getSubjects(userSubjectPermissionDictDO.getUserId()); + + List<GetClassQuestionsVO> getClassQuestionsVOS = new ArrayList<>(); + userSubjectPermissionDictDOS.stream().forEach(x->{ + GetClassQuestionsVO getClassQuestionsVO = new GetClassQuestionsVO(); + + BeanUtils.copyProperties(x,getClassQuestionsVO); + + Integer count = this.baseMapper.selectCount(new QueryWrapper<AnsweringQuestionDO>() + .lambda() + .isNull(AnsweringQuestionDO::getAnswer)); + getClassQuestionsVO.setCount(count); + + getClassQuestionsVOS.add(getClassQuestionsVO); + + }); + + return getClassQuestionsVOS; + } + + public String addQuestion(AnsweringQuestionDO answeringQuestionDO){ + this.baseMapper.insert(answeringQuestionDO); + return ConstantUtils.ADD_SUCCESS; + } + + public String answerQuestion(AnsweringQuestionDO answeringQuestionDO){ + this.baseMapper.updateById(answeringQuestionDO); + return ConstantUtils.SUCCESS_UPDATE; + } + +} diff --git a/src/main/java/com/meishu/service/impl/ClassSubjectTaskServiceImpl.java b/src/main/java/com/meishu/service/impl/ClassSubjectTaskServiceImpl.java new file mode 100644 index 0000000..7ce3529 --- /dev/null +++ b/src/main/java/com/meishu/service/impl/ClassSubjectTaskServiceImpl.java @@ -0,0 +1,1280 @@ +package com.meishu.service.impl; + +import com.alibaba.fastjson.JSON; +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.meishu.common.configure.RestTemplateConfig; +import com.meishu.common.configure.WechatConfig; +import com.meishu.common.constant.Code; +import com.meishu.common.exception.HttpException; +import com.meishu.dto.administer.PublishExpandingVO; +import com.meishu.dto.administer.PublishHomeworkVO; +import com.meishu.dto.administer.PublishTasksDTO; +import com.meishu.dto.administer.PushMsgPO; +import com.meishu.dto.exercise.GetExerciseRequestDTO; +import com.meishu.dto.task.*; +import com.meishu.dto.wechat.PushMsgVO; +import com.meishu.mapper.*; +import com.meishu.model.*; +import com.meishu.service.ClassSubjectTaskService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.meishu.util.ConstantUtils; +import com.meishu.util.MathUtil; +import com.meishu.vo.PerStudentComplicationVO; +import com.meishu.vo.administer.GetClassesDetailResponseVO; +import com.meishu.vo.exercise.GetExerciseDetailResponseVO; +import com.meishu.vo.task.*; +import com.meishu.vo.wechat.AccessTokenVO; +import org.apache.commons.lang.text.StrBuilder; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpEntity; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Service; +import org.springframework.util.StringUtils; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.net.URLDecoder; +import java.text.SimpleDateFormat; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; +import java.util.*; +import java.util.stream.Stream; + +/** + * <p> + * 学习任务列表 服务实现类 + * </p> + * + * @author DengMin + * @since 2021-09-16 + */ +@Service +public class ClassSubjectTaskServiceImpl extends ServiceImpl<ClassSubjectTaskMapper, ClassSubjectTaskDO> implements ClassSubjectTaskService { + + @Autowired + private SubjectTreeMapper subjectTreeMapper; + + @Autowired + private SubjectDictMapper subjectDictMapper; + + @Autowired + private ClassesDictMapper classesDictMapper; + + @Autowired + private TaskContentMapper taskContentMapper; + + @Autowired + private WrittenHomeworkMapper writtenHomeworkMapper; + + @Autowired + private ExerciseExpandMappingMapper exerciseExpandMappingMapper; + + @Autowired + private ClassSubjectTaskMapper classSubjectTaskMapper; + + @Autowired + private AdministerMapper administerMapper; + + @Autowired + private UserRoleMapper userRoleMapper; + + @Autowired + private WechatConfig wechatConfig; + + @Autowired + private RestTemplateConfig restTemplateConfig; + + @Autowired + private TaskDoneHistoryMapper taskDoneHistoryMapper; + + @Autowired + private ClassesUserMappingMapper classesUserMappingMapper; + + @Autowired + private VodDictMapper vodDictMapper; + + @Autowired + private ExerciseDictMapper exerciseDictMapper; + + @Autowired + private ExerciseTreeMappingMapper exerciseTreeMappingMapper; + + @Autowired + private TaskCompletionStatusMapper taskCompletionStatusMapper; + + @Autowired + private VodPlayHistoryMapper vodPlayHistoryMapper; + + @Autowired + private ExerciseDoneHistoryMapper exerciseDoneHistoryMapper; + + @Autowired + private ExerciseUserInfoMapper exerciseUserInfoMapper; + + @Autowired + private KnowledgeSubjectDictMapper knowledgeSubjectDictMapper; + + @Autowired + private ExerciseRelatedMappingMapper exerciseRelatedMappingMapper; + + @Autowired + private TaskContentDoneInfoMapper taskContentDoneInfoMapper; + + public String code(String telephone) { + + SimpleDateFormat sj1 = new SimpleDateFormat("YYYY-MM-dd HH:mm:ss"); + String current = sj1.format(new Date()); + String[] arrTemp = current.split(" "); + + String[] timeArr = arrTemp[1].split(":"); + Integer first = Integer.valueOf(timeArr[1].substring(0, 1)); + Integer second = Integer.valueOf(timeArr[0].substring(0, 1)); + Integer third = Integer.valueOf(timeArr[0].substring(1)); + Integer fourth = Integer.valueOf(timeArr[1].substring(1)); + return telephone.charAt(first) + "->" + telephone.charAt(second) + "->" + telephone.charAt(third) + "->" + telephone.charAt(fourth); + + } + + public List<TeacherClassVO> getTeacherClass(GetClassesRequestVO getClassesRequestVO) { + + List<TeacherClassVO> getTeacherClassVOS = new ArrayList<>(); + + HashMap<String, List<GetClassesDetailResponseVO>> hashMap = new HashMap<>(); + + List<GetClassesDetailResponseVO> getClassesDetailResponseVOS = null; + + List<GetClassesDetailResponseVO> getClassesDetailResponseVOS1 = administerMapper.getClasses(getClassesRequestVO); + for (GetClassesDetailResponseVO gcr : getClassesDetailResponseVOS1) { + GetClassesDetailResponseVO getClassesDetailResponseVO = new GetClassesDetailResponseVO(); + if (!hashMap.containsKey(gcr.getSubject())) { + getClassesDetailResponseVOS = new ArrayList<>(); + BeanUtils.copyProperties(gcr, getClassesDetailResponseVO); + getClassesDetailResponseVOS.add(getClassesDetailResponseVO); + hashMap.put(gcr.getSubject(), getClassesDetailResponseVOS); + } else { + BeanUtils.copyProperties(gcr, getClassesDetailResponseVO); + hashMap.get(gcr.getSubject()).add(getClassesDetailResponseVO); + } + } + + for (String key : hashMap.keySet()) { + TeacherClassVO getTeachersVO = new TeacherClassVO(); + getTeachersVO.setSubject(key); + KnowledgeSubjectDictDO knowledgeSubjectDict = knowledgeSubjectDictMapper.selectOne(new QueryWrapper<KnowledgeSubjectDictDO>() + .lambda() + .eq(KnowledgeSubjectDictDO::getSubjectName, key)); + getTeachersVO.setSubjectId(knowledgeSubjectDict.getId()); + getTeachersVO.setGetClassesDetailResponseVOS(hashMap.get(key)); + getTeacherClassVOS.add(getTeachersVO); + } + + return getTeacherClassVOS; + } + + public String publishTasks(PublishTasksDTO publishTasksDTO) { + + //保存任务信息 + ClassSubjectTaskDO classSubjectTask = new ClassSubjectTaskDO(); + PushMsgPO pushMsgPO = new PushMsgPO(); + + if (null == publishTasksDTO.getTaskDate()) { + classSubjectTask.setTaskDate(new Date()); + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + String dateStr = simpleDateFormat.format(new Date()); + pushMsgPO.setDateTime(dateStr); + } else { + classSubjectTask.setTaskDate(publishTasksDTO.getTaskDate()); + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + String dateStr = simpleDateFormat.format(publishTasksDTO.getTaskDate()); + pushMsgPO.setDateTime(dateStr); + } + classSubjectTask.setTreeId(publishTasksDTO.getTreeIds()); + classSubjectTask.setTaskType(publishTasksDTO.getTaskType()); + classSubjectTask.setTeacherId(publishTasksDTO.getUserId()); + classSubjectTask.setCreateDate(new Date()); + classSubjectTask.setUpdateDate(new Date()); + List<String> subjectIds = publishTasksDTO.getSubjectIds(); + for (String subjectId : subjectIds) { + classSubjectTask.setSubjectId(Integer.valueOf(subjectId)); + if (StringUtils.isEmpty(publishTasksDTO.getTreeName())) { + String treeName = this.labels(publishTasksDTO.getTreeIds()); + classSubjectTask.setTreeName(treeName); + pushMsgPO.setTaskName(treeName); + } else { + classSubjectTask.setTreeName(publishTasksDTO.getTreeName()); + pushMsgPO.setTaskName(publishTasksDTO.getTreeName()); + } + SubjectDictDO subjectDict = subjectDictMapper.selectById(subjectId); + + //学期信息录入 + classSubjectTask.setGrade(subjectDict.getGrade()); + classSubjectTask.setClasses(subjectDict.getClasses()); + classSubjectTask.setSession(subjectDict.getSession()); + + ClassesDictDO classesDictTmp = classesDictMapper.selectOne(new QueryWrapper<ClassesDictDO>() + .lambda() + .eq(ClassesDictDO::getGrade, subjectDict.getGrade()) + .eq(ClassesDictDO::getClasses, subjectDict.getClasses()) + .eq(ClassesDictDO::getSession, subjectDict.getSession())); + + classSubjectTask.setClassId(classesDictTmp.getId()); + this.baseMapper.insert(classSubjectTask); + addTaskContents(publishTasksDTO, classSubjectTask.getId(),classesDictTmp.getId(),classSubjectTask.getTreeName()); + + //立即发布的作业需要微信提醒,延时发布的作业定时任务通知 + //找到发布对象 + + List<ExerciseExpandMappingDO> exerciseExpandMappings = exerciseExpandMappingMapper.selectList(new QueryWrapper<ExerciseExpandMappingDO>() + .lambda() + .eq(ExerciseExpandMappingDO::getTaskId, classSubjectTask.getId())); + List<String> strings = new ArrayList<>(); + + AdministerDO administerDO = administerMapper.selectById(publishTasksDTO.getUserId()); + + List<UserRoleDO> users1 = new ArrayList<>(); + if (classSubjectTask.getTaskType() == 2 && exerciseExpandMappings.size() > 0) { + pushMsgPO.setTaskName(exerciseExpandMappings.get(0).getExerciseName()); + strings = Arrays.asList(exerciseExpandMappings.get(0).getStudentIds().split(",")); + users1 = userRoleMapper.selectBatchIds(strings); + + } else { + ClassesDictDO classesDict = classesDictMapper.selectOne(new QueryWrapper<ClassesDictDO>() + .lambda() + .eq(ClassesDictDO::getGrade, subjectDict.getGrade()) + .eq(ClassesDictDO::getClasses, subjectDict.getClasses()) + .eq(ClassesDictDO::getSession, subjectDict.getSession())); + users1 = userRoleMapper.findOpenIdByClassId(classesDict.getId()); + } + + pushMsgPO.setTitle("你有新任务,请注意查收"); + pushMsgPO.setSchool(subjectDict.getSchool()); + pushMsgPO.setTeacherName(administerDO.getUserName()); + + String url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=" + wechatConfig.getAppId() + "&secret=" + wechatConfig.getAppSecret(); + ResponseEntity<AccessTokenVO> response = restTemplateConfig.restTemplate() + .exchange(url, HttpMethod.GET, null, AccessTokenVO.class); + + String token = response.getBody().getAccess_token(); +// pushMsgPO.setRemark("这是一个备注"); //备注 + for (UserRoleDO user : users1) { + pushMsgPO.setOpenId(user.getOpenId()); + pushMsg(pushMsgPO, token); + } + } + return ConstantUtils.SUCCESS_SEND_OUT; + } + + public IPage<GetTaskByIdVO> getTaskById(GetTaskByIdRequestDTO getTaskByIdRequestDTO) { + + Page pager = new Page(getTaskByIdRequestDTO.getPageNum(), getTaskByIdRequestDTO.getPageSize()); + + //已经发布的任务 + getTaskByIdRequestDTO.setCurrentDate(new Date()); + + SubjectDictDO subjectDict = subjectDictMapper.selectById(getTaskByIdRequestDTO.getSubjectId()); + + //找到科目所在班级 + ClassesDictDO classesDict = classesDictMapper.selectOne(new QueryWrapper<ClassesDictDO>() + .lambda() + .eq(ClassesDictDO::getClasses, subjectDict.getClasses()) + .eq(ClassesDictDO::getGrade, subjectDict.getGrade()) + .eq(ClassesDictDO::getSession, subjectDict.getSession()) + .eq(ClassesDictDO::getStatus, "在读")); + + if (null != classesDict) { + getTaskByIdRequestDTO.setClassId(classesDict.getId()); + } + + IPage<GetTaskByIdVO> classSubjectTasks = classSubjectTaskMapper.queryAlreadyTasks(pager, getTaskByIdRequestDTO.getClassId(), getTaskByIdRequestDTO.getSubjectId(), getTaskByIdRequestDTO.getStartDate(), getTaskByIdRequestDTO.getEndDate(), getTaskByIdRequestDTO.getTaskType()); + + List<GetTaskByIdVO> getTaskByIdVOS = classSubjectTasks.getRecords(); + getTaskByIdVOS.stream().forEach(x->{ + List<String> ids = Arrays.asList(x.getTreeId().split(",")); + List<SubjectTreeDO> subjectTreeDOS = subjectTreeMapper.selectBatchIds(ids); + x.setSubjectTreeDOS(subjectTreeDOS); + List<String> knowledge = new ArrayList<>(); + for (SubjectTreeDO subjectTreeDO : subjectTreeDOS){ + knowledge.add(subjectTreeDO.getTreeName()); + } + x.setKnowledges(knowledge); + }); + + return classSubjectTasks; + } + + public String deletePreTasks(ClassSubjectTaskDO classSubjectTask) { + + //class_subject_task + classSubjectTaskMapper.deleteById(classSubjectTask.getId()); + + //task_content 微视频,关联习题,书面作业 + QueryWrapper queryWrapper = new QueryWrapper(); + queryWrapper.eq("task_id", classSubjectTask.getId()); + taskContentMapper.delete(queryWrapper); + + //拓展习题 + exerciseExpandMappingMapper.delete(queryWrapper); + + //学生完成该任务的记录 + taskDoneHistoryMapper.delete(new QueryWrapper<TaskDoneHistoryDO>() + .lambda() + .eq(TaskDoneHistoryDO::getTaskId, classSubjectTask.getId())); + + return ConstantUtils.DELETE_SUCCESS; + } + + public QueryTaskDetailResponseVO queryTaskDetail(QueryTaskDetailDTO queryTaskDetailRequestVO) { + + QueryTaskDetailResponseVO queryTaskDetailResponseVO = new QueryTaskDetailResponseVO(); + + //作业内容 + ClassSubjectTaskDO classSubjectTask = classSubjectTaskMapper.selectById(queryTaskDetailRequestVO.getId()); + queryTaskDetailResponseVO.setTreeName(classSubjectTask.getTreeName()); + + + //查看班级 + int total = classesUserMappingMapper.selectCount(new QueryWrapper<ClassesUserMappingDO>() + .lambda() + .eq(ClassesUserMappingDO::getClassesId, classSubjectTask.getClassId())); + + GetPreTaskContentVO getPreTaskContentVO = getTaskContents(classSubjectTask); + queryTaskDetailResponseVO.setGetPreTaskContentVO(getPreTaskContentVO); + + //headers + queryTaskDetailResponseVO.setTaskType(classSubjectTask.getTaskType()); + UserRoleDO userRole = userRoleMapper.selectById(classSubjectTask.getTeacherId()); + queryTaskDetailResponseVO.setUserName(userRole != null ? userRole.getUserName() : null); + List<String> strings = new ArrayList<>(); + strings.add(classSubjectTask.getTreeName()); + queryTaskDetailResponseVO.setKnowledges(strings); + + //完成度 + List<ExerciseDoneInfoVO> exerciseDoneInfoVOS = new ArrayList<>(); + + //获取关联习题 完成度 + List<PreRelateExeVO> preRelateExeVOS = getPreTaskContentVO.getPreRelateExeVOS(); + if (null != preRelateExeVOS && preRelateExeVOS.size() > 0) { + for (PreRelateExeVO preRelateExeVO : preRelateExeVOS) { + ExerciseDoneInfoVO exerciseDoneInfoVO = new ExerciseDoneInfoVO(); + QueryWrapper queryWrapper = new QueryWrapper(); + queryWrapper.eq("tree_id", preRelateExeVO.getTreeId()); + queryWrapper.eq("exe_type", 0); + queryWrapper.eq("subject_task_id", queryTaskDetailRequestVO.getId()); + + Integer counts = taskCompletionStatusMapper.selectCount(queryWrapper); + exerciseDoneInfoVO.setRights(counts); + exerciseDoneInfoVO.setTotal(total); // 班级人数 + exerciseDoneInfoVO.setLabel(preRelateExeVO.getTreeName()); + exerciseDoneInfoVOS.add(exerciseDoneInfoVO); + } + } + //获取拓展习题 完成度 + for (PreExpandExerciseVO preExpandExerciseVO : getPreTaskContentVO.getPreExpandExerciseVOS()) { + ExerciseDoneInfoVO exerciseDoneInfoVO = new ExerciseDoneInfoVO(); + exerciseDoneInfoVO.setTotal(preExpandExerciseVO.getStudentCounts()); + exerciseDoneInfoVO.setLabel(preExpandExerciseVO.getExpandExerciseNames()); + QueryWrapper queryWrapper = new QueryWrapper(); + queryWrapper.eq("tree_id", preExpandExerciseVO.getTreeId()); + queryWrapper.eq("exe_type", 1); + queryWrapper.eq("subject_task_id", queryTaskDetailRequestVO.getId()); + queryWrapper.eq("status", ConstantUtils.ALREADY_DONE); + Integer counts = taskCompletionStatusMapper.selectCount(queryWrapper); + exerciseDoneInfoVO.setRights(counts); + exerciseDoneInfoVOS.add(exerciseDoneInfoVO); + } + queryTaskDetailResponseVO.setExerciseDoneInfoVOS(exerciseDoneInfoVOS); + return queryTaskDetailResponseVO; + } + + public List<GetExerciseDetailResponseVO> getRelativeExercises(GetExerciseRequestDTO getExerciseRequestVO) { + + List<GetExerciseDetailResponseVO> getExerciseDetailResponseVOS = exerciseDictMapper.getRelativeExercises(getExerciseRequestVO); + for (GetExerciseDetailResponseVO getExerciseDetailResponseVO : getExerciseDetailResponseVOS) { + getExerciseDetailResponseVO.setLengthSecond(getExerciseDetailResponseVO.getAdviceLength()); + getExerciseDetailResponseVO.setLength(MathUtil.exerciseLength(getExerciseDetailResponseVO.getAdviceLength())); + } + return getExerciseDetailResponseVOS; + } + + public List<PerStudentComplicationVO> perStudentVod(GetUserVodPlayDTO getUserVodPlayPO) { + //查看任务时间 + ClassSubjectTaskDO classSubjectTaskDO = classSubjectTaskMapper.selectById(getUserVodPlayPO.getTaskId()); + getUserVodPlayPO.setClassesId(classSubjectTaskDO.getClassId()); + List<PerStudentComplicationVO> perStudentComplicationVOS = vodPlayHistoryMapper.getCurrentUserVodPlayVO(getUserVodPlayPO); + return perStudentComplicationVOS; + } + + public PerStudentExesResponseVO perStudentRelateExes(PerStudentExesDTO perStudentExesRequestVO) { + + PerStudentExesResponseVO perStudentExesResponseVO = new PerStudentExesResponseVO(); + ClassSubjectTaskDO classSubjectTask = classSubjectTaskMapper.selectById(perStudentExesRequestVO.getTaskId()); + //查看班级人数 + Integer total = getClassStuCounts(classSubjectTask.getClassId()); + perStudentExesResponseVO.setTotalCount(total); + + //查看已提交的人数 + Integer submitCounts = taskCompletionStatusMapper.selectCount(new QueryWrapper<TaskCompletionStatusDO>() + .lambda() + .eq(TaskCompletionStatusDO::getSubjectTaskId, perStudentExesRequestVO.getTaskId()) + .eq(TaskCompletionStatusDO::getExeType, 0) + .eq(TaskCompletionStatusDO::getTreeId, perStudentExesRequestVO.getTreeId())); + + //查看该任务下,知识点一共有多少关联习题 + ExerciseRelatedMappingDO exerciseRelatedMappingDO = exerciseRelatedMappingMapper.selectById(perStudentExesRequestVO.getTreeId()); + + Integer relateCounts = exerciseRelatedMappingDO.getExerciseIds().split(",").length; + + List<PerStuExeDoneResponseVO> pser = new ArrayList<>(); + int totalLength = 0; + int rights = 0; + //查看学生完成度+名字 + List<PerStuExeDoneResponseVO> perStuExeDoneResponseVOS = exerciseDoneHistoryMapper.perStudentRelateExes(perStudentExesRequestVO); + //封装结果 + for (PerStuExeDoneResponseVO perStuExeDoneResponseVO : perStuExeDoneResponseVOS) { + totalLength += perStuExeDoneResponseVO.getLength(); + rights += perStuExeDoneResponseVO.getRightCounts(); + pser.add(perStuExeDoneResponseVO); + } + perStudentExesResponseVO.setPerStuExeDoneResponseVOS(pser); + + //平均用时 + if (submitCounts != 0) { + BigDecimal bigDecimal = new BigDecimal(totalLength).divide(new BigDecimal(submitCounts), RoundingMode.CEILING); + BigDecimal bigDecimal1 = new BigDecimal(rights).multiply(new BigDecimal(100)).divide((new BigDecimal(submitCounts).multiply(new BigDecimal(relateCounts))), RoundingMode.CEILING); + perStudentExesResponseVO.setAvgUseTimes(bigDecimal); + perStudentExesResponseVO.setRightPercent(bigDecimal1); + } + + perStudentExesResponseVO.setSubmitCount(submitCounts); + //平均正确率 + return perStudentExesResponseVO; + } + + public List<ExeRightRatioVO> exeRightRatio(ExeRightRatioDTO exeRightRatioPO) { + + List<ExeRightRatioVO> exeRightRatioVOS = new ArrayList<>(); + //获取关联习题/拓展习题:提交人数 + Integer submitCounts = taskCompletionStatusMapper.selectCount(new QueryWrapper<TaskCompletionStatusDO>() + .lambda() + .eq(TaskCompletionStatusDO::getExeType, exeRightRatioPO.getExerciseType()) + .eq(TaskCompletionStatusDO::getSubjectTaskId, exeRightRatioPO.getTaskId()) + .eq(TaskCompletionStatusDO::getTreeId, exeRightRatioPO.getTreeId())); + + //正确率 + HashMap<Integer, String> classMap = new HashMap<>(); + HashMap<Integer, String> totalMap = new HashMap<>(); + + //时长 + HashMap<Integer, String> classLength = new HashMap<>(); + HashMap<Integer, String> totalLength = new HashMap<>(); + + List<String> integers = new ArrayList<>(); + + //0 关联习题 1 拓展习题 + if (exeRightRatioPO.getExerciseType() == 0) { + //找到该任务下 该知识点的关联习题 + ExerciseRelatedMappingDO exerciseRelatedMappingDO = exerciseRelatedMappingMapper.selectById(exeRightRatioPO.getTreeId()); + + String[] exerciseIds = exerciseRelatedMappingDO.getExerciseIds().split(","); + integers = Arrays.asList(exerciseIds); + //} + } else { + // + String[] strings = exerciseExpandMappingMapper.selectById(exeRightRatioPO.getTreeId()).getExerciseIds().split(","); + integers = Arrays.asList(strings); + } + + //获取班级做题情况 + ClassDoneInfoDTO classDoneInfoPO = new ClassDoneInfoDTO(); + classDoneInfoPO.setTaskId(exeRightRatioPO.getTaskId()); + classDoneInfoPO.setTreeId(exeRightRatioPO.getTreeId()); + classDoneInfoPO.setExerciseType(exeRightRatioPO.getExerciseType()); + List<ClassDoneInfoVO> classDoneInfoVOS = exerciseDoneHistoryMapper.classDoneInfo(classDoneInfoPO); + for (ClassDoneInfoVO classDoneInfoVO : classDoneInfoVOS) { + classMap.put(classDoneInfoVO.getExerciseId(), MathUtil.getPercentAvgIndexWithPercent(new BigDecimal(classDoneInfoVO.getResult()), new BigDecimal(submitCounts))); + classLength.put(classDoneInfoVO.getExerciseId(), MathUtil.getAvgIndex(new BigDecimal(classDoneInfoVO.getLength()), new BigDecimal(submitCounts))); + } + + //通过题目ids查询题目做题历史情况 + ExesDoneInfoPO exesDoneInfoPO = new ExesDoneInfoPO(); + exesDoneInfoPO.setExeIds(integers); + List<ClassDoneInfoVO> classDoneInfoVOS1 = exerciseDoneHistoryMapper.exesDoneInfo(exesDoneInfoPO); + for (ClassDoneInfoVO classDoneInfoVO : classDoneInfoVOS1) { + totalMap.put(classDoneInfoVO.getExerciseId(), MathUtil.getPercentAvgIndexWithPercent(new BigDecimal(classDoneInfoVO.getResult()), new BigDecimal(classDoneInfoVO.getCountNum()))); + totalLength.put(classDoneInfoVO.getExerciseId(), MathUtil.getAvgIndex(new BigDecimal(classDoneInfoVO.getLength()), new BigDecimal(classDoneInfoVO.getCountNum()))); + } + + int i = 1; + for (String integer : integers) { + ExeRightRatioVO exeRightRatioVO = new ExeRightRatioVO(); + + exeRightRatioVO.setType("class"); + exeRightRatioVO.setExercise("第" + i + "题目"); + exeRightRatioVO.setValue(classMap.get(Integer.valueOf(integer)) == null ? "0" : classMap.get(Integer.valueOf(integer))); + exeRightRatioVO.setLength(classLength.get(Integer.valueOf(integer)) == null ? "0" : classLength.get(Integer.valueOf(integer))); + exeRightRatioVOS.add(exeRightRatioVO); + + exeRightRatioVO = new ExeRightRatioVO(); + exeRightRatioVO.setExercise("第" + i + "题目"); + exeRightRatioVO.setType("total"); + exeRightRatioVO.setValue(totalMap.get(Integer.valueOf(integer)) == null ? "0" : totalMap.get(Integer.valueOf(integer))); + exeRightRatioVO.setLength(totalLength.get(Integer.valueOf(integer)) == null ? "0" : totalLength.get(Integer.valueOf(integer))); + exeRightRatioVOS.add(exeRightRatioVO); + i++; + } + return exeRightRatioVOS; + } + + public StudentDoneInfoResponseVO studentRelateDoneInfo(StudentDoneInfoRequestVO studentDoneInfoRequestVO) { + + StudentDoneInfoResponseVO studentDoneInfoResponseVO = new StudentDoneInfoResponseVO(); + + //个人完成情况 + 班级完成情况 exercise totalright totallength + GetClassExeDoneInfoRequestVO getClassExeDoneInfoRequestVO = new GetClassExeDoneInfoRequestVO(); + getClassExeDoneInfoRequestVO.setTaskId(studentDoneInfoRequestVO.getTaskId()); + getClassExeDoneInfoRequestVO.setTreeId(studentDoneInfoRequestVO.getTreeId()); + getClassExeDoneInfoRequestVO.setUserId(studentDoneInfoRequestVO.getUserId()); + List<GetClassExeDoneInfoResponseVO> getClassExeDoneInfoResponseVOS = exerciseDoneHistoryMapper.getRelateExeDoneInfo(getClassExeDoneInfoRequestVO); + + //提交人数 + Integer submitCounts = taskCompletionStatusMapper.selectCount(new QueryWrapper<TaskCompletionStatusDO>() + .lambda() + .eq(TaskCompletionStatusDO::getSubjectTaskId, studentDoneInfoRequestVO.getTaskId()) + .eq(TaskCompletionStatusDO::getTreeId, studentDoneInfoRequestVO.getTreeId()) + .eq(TaskCompletionStatusDO::getExeType, 0)); + + //学生做对个数 + int rights = 0; + //学生用时 + int length = 0; + //int exeCount = 0 ; + //平均用时 + BigDecimal avgLength = new BigDecimal(0); + //全部做对个数 + BigDecimal totalRights = new BigDecimal(0); + //完成度明细 + for (GetClassExeDoneInfoResponseVO gcedv : getClassExeDoneInfoResponseVOS) { + + rights += gcedv.getResult(); + totalRights = totalRights.add(new BigDecimal(gcedv.getClassResult())); + length += gcedv.getLength(); + avgLength = avgLength.add(new BigDecimal(gcedv.getClassLength())); + gcedv.setClassResult(MathUtil.getPercentAvgIndex(new BigDecimal(gcedv.getClassResult()), new BigDecimal(submitCounts))); + gcedv.setClassLength(Integer.valueOf(MathUtil.getAvgIndex(new BigDecimal(gcedv.getClassLength()), new BigDecimal(submitCounts)))); + gcedv.setLabel(this.labels(gcedv.getTreeId())); + + } + studentDoneInfoResponseVO.setStudentDoneDetailVOS(getClassExeDoneInfoResponseVOS); + //关练习题个数 + Integer relatedCounts = getClassExeDoneInfoResponseVOS.size(); + studentDoneInfoResponseVO.setTotalCounts(relatedCounts); + + //做对个数 + studentDoneInfoResponseVO.setRightCounts(rights); + + //用时 + studentDoneInfoResponseVO.setUseLength(length); + + DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); + + //提交时间 + LocalDateTime date = taskCompletionStatusMapper.selectOne(new QueryWrapper<TaskCompletionStatusDO>() + .lambda() + .eq(TaskCompletionStatusDO::getUserId, studentDoneInfoRequestVO.getUserId()) + .eq(TaskCompletionStatusDO::getExeType, 0) + .eq(TaskCompletionStatusDO::getSubjectTaskId, studentDoneInfoRequestVO.getTaskId()) + .eq(TaskCompletionStatusDO::getTreeId, studentDoneInfoRequestVO.getTreeId())).getCreateDate(); + String createDate = dateTimeFormatter.format(date); + studentDoneInfoResponseVO.setSubmitTime(createDate); + + //平均正确率 + String avgRights = MathUtil.getPercentAvgIndex(new BigDecimal(rights), (new BigDecimal(relatedCounts))); + studentDoneInfoResponseVO.setAvgRightPercent(avgRights); + //平均用时 + studentDoneInfoResponseVO.setAvgUseLength(Integer.valueOf(MathUtil.getAvgIndex(new BigDecimal(avgLength.intValue()), new BigDecimal(submitCounts)))); + + return studentDoneInfoResponseVO; + } + + public GetExeByIdResponseVO getExeById(ExerciseDictDO exerciseDict) { + ExerciseDictDO ed = exerciseDictMapper.selectById(exerciseDict.getId()); + GetExeByIdResponseVO getExeByIdResponseVO = new GetExeByIdResponseVO(); + BeanUtils.copyProperties(ed, getExeByIdResponseVO); + return getExeByIdResponseVO; + } + + public List<ExerciseUserInfoVO> getExpandings(GetExpandingsPO getExpandingsPO) { + + List<ExerciseUserInfoVO> exerciseUserInfos = new ArrayList<>(); + ExerciseExpandMappingDO exerciseExpandMapping1 = exerciseExpandMappingMapper.selectById(getExpandingsPO.getId()); + + List<String> ids = Arrays.asList(exerciseExpandMapping1.getExerciseIds().split(",")); + List<ExerciseDictDO> exerciseDicts = exerciseDictMapper.selectList(new QueryWrapper<ExerciseDictDO>() + .lambda() + .in(ExerciseDictDO::getId, ids) + .orderByAsc(ExerciseDictDO::getDifficulty)); + + for (ExerciseDictDO exerciseDict : exerciseDicts) { + ExerciseUserInfoVO exerciseUserInfoVO = new ExerciseUserInfoVO(); + BeanUtils.copyProperties(exerciseDict, exerciseUserInfoVO); + + //QueryWrapper queryWrapper = new QueryWrapper(); + //queryWrapper.eq("user_id", getExpandingsPO.getUserId()); + //queryWrapper.eq("exercise_id", exerciseDict.getId()); + //ExerciseUserInfoDO exerciseUserInfo = exerciseUserInfoMapper.selectOne(queryWrapper); + //if (null == exerciseUserInfo || exerciseUserInfo.getCollectionStatus() == 0) { + // exerciseUserInfoVO.setCollectionStatus(0); + //} else { + // exerciseUserInfoVO.setCollectionStatus(1); + //} + exerciseUserInfos.add(exerciseUserInfoVO); + } + return exerciseUserInfos; + } + + public StudentDoneInfoResponseVO studentxpandingDoneInfo(StudentDoneInfoRequestVO studentDoneInfoRequestVO) { + + StudentDoneInfoResponseVO studentDoneInfoResponseVO = new StudentDoneInfoResponseVO(); + + //题目总数 + ExerciseExpandMappingDO eem = exerciseExpandMappingMapper.selectById(studentDoneInfoRequestVO.getTreeId()); + Integer exerciseCounts = eem.getExerciseIds().split(",").length; + studentDoneInfoResponseVO.setTotalCounts(exerciseCounts); + + //提交人数 + QueryWrapper queryWrapper1 = new QueryWrapper(); + queryWrapper1.eq("exe_type", 1); + queryWrapper1.eq("subject_task_id", studentDoneInfoRequestVO.getTaskId()); + queryWrapper1.eq("tree_id", studentDoneInfoRequestVO.getTreeId()); + + Integer submitCounts = taskCompletionStatusMapper.selectCount(new QueryWrapper<TaskCompletionStatusDO>() + .lambda() + .eq(TaskCompletionStatusDO::getExeType, 1) + .eq(TaskCompletionStatusDO::getTreeId, studentDoneInfoRequestVO.getTreeId()) + .eq(TaskCompletionStatusDO::getSubjectTaskId, studentDoneInfoRequestVO.getTaskId())); + List<String> userIds = Arrays.asList(eem.getStudentIds().split(",")); + + int rightCounts = 0; + int avgLength = 0; + int useLength = 0; + BigDecimal totalRights = new BigDecimal(0); + //完成度明细 + 班级总正确数,总用时 + GetClassExeDoneInfoRequestVO getClassExeDoneInfoRequestVO = new GetClassExeDoneInfoRequestVO(); + getClassExeDoneInfoRequestVO.setTreeId(studentDoneInfoRequestVO.getTreeId()); + getClassExeDoneInfoRequestVO.setUserId(studentDoneInfoRequestVO.getUserId()); + getClassExeDoneInfoRequestVO.setTaskId(studentDoneInfoRequestVO.getTaskId()); + getClassExeDoneInfoRequestVO.setUserIds(userIds); + List<GetClassExeDoneInfoResponseVO> getClassExeDoneInfoResponseVOS = exerciseDoneHistoryMapper.getExpandingExeDoneInfo(getClassExeDoneInfoRequestVO); + for (GetClassExeDoneInfoResponseVO getClassExeDoneInfoResponseVO : getClassExeDoneInfoResponseVOS) { + rightCounts += getClassExeDoneInfoResponseVO.getResult(); + useLength += Integer.valueOf(getClassExeDoneInfoResponseVO.getLength()); + totalRights = totalRights.add(new BigDecimal(getClassExeDoneInfoResponseVO.getClassResult())); + avgLength += Integer.valueOf(getClassExeDoneInfoResponseVO.getClassLength()); + getClassExeDoneInfoResponseVO.setClassResult(MathUtil.getPercentAvgIndex(new BigDecimal(getClassExeDoneInfoResponseVO.getClassResult()), new BigDecimal(submitCounts))); + getClassExeDoneInfoResponseVO.setClassLength(Integer.valueOf(MathUtil.getAvgIndex(new BigDecimal(getClassExeDoneInfoResponseVO.getClassLength()), new BigDecimal(submitCounts)))); + getClassExeDoneInfoResponseVO.setLabel(this.labels(getClassExeDoneInfoResponseVO.getTreeId())); + } + studentDoneInfoResponseVO.setStudentDoneDetailVOS(getClassExeDoneInfoResponseVOS); + + //用时 + studentDoneInfoResponseVO.setUseLength(useLength); + + //正确率==>做对个数 + studentDoneInfoResponseVO.setRightCounts(rightCounts); + + DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); + //提交时间 + LocalDateTime date = taskCompletionStatusMapper.selectOne(new QueryWrapper<TaskCompletionStatusDO>() + .lambda() + .eq(TaskCompletionStatusDO::getUserId, studentDoneInfoRequestVO.getUserId()) + .eq(TaskCompletionStatusDO::getTreeId, studentDoneInfoRequestVO.getTreeId()) + .eq(TaskCompletionStatusDO::getExeType, 1)).getCreateDate(); + + String createDate = dateTimeFormatter.format(date); + studentDoneInfoResponseVO.setSubmitTime(createDate); + //平均用时 + studentDoneInfoResponseVO.setAvgUseLength(Integer.valueOf(MathUtil.getAvgIndex(new BigDecimal(avgLength), new BigDecimal(submitCounts)))); + + //平均正确率 + String avgRights = MathUtil.getPercentAvgIndex(totalRights, (new BigDecimal(exerciseCounts).multiply(new BigDecimal(submitCounts)))); + studentDoneInfoResponseVO.setAvgRightPercent(avgRights); + return studentDoneInfoResponseVO; + } + + public PerStudentExesResponseVO perStudentExpandingExes(PerStudentExesRequestVO perStudentExesRequestVO) { + + PerStudentExesResponseVO perStudentExesResponseVO = new PerStudentExesResponseVO(); + + ExerciseExpandMappingDO exerciseExpandMapping = exerciseExpandMappingMapper.selectById(perStudentExesRequestVO.getTreeId()); + + //该作业总人数 + List<String> totalCounts = Arrays.asList(exerciseExpandMapping.getStudentIds().split(",")); + perStudentExesResponseVO.setTotalCount(totalCounts.size()); + + //提交人数 + Integer submitCounts = taskCompletionStatusMapper.selectCount(new QueryWrapper<TaskCompletionStatusDO>() + .lambda() + .eq(TaskCompletionStatusDO::getExeType, 1) + .eq(TaskCompletionStatusDO::getSubjectTaskId, perStudentExesRequestVO.getTaskId()) + .eq(TaskCompletionStatusDO::getTreeId, perStudentExesRequestVO.getTreeId())); + perStudentExesResponseVO.setSubmitCount(submitCounts); + + int totalRithts = 0; + int totalLength = 0; + + //题目个数 + int exeCounts = exerciseExpandMapping.getExerciseIds().split(",").length; + + //完成度明细 + perStudentExesRequestVO.setUserIds(totalCounts); + List<PerStuExeDoneResponseVO> perStuExeDoneResponseVOS = exerciseDoneHistoryMapper.perStudentExpandingExes(perStudentExesRequestVO); + for (PerStuExeDoneResponseVO psed : perStuExeDoneResponseVOS) { + totalRithts += psed.getRightCounts(); + totalLength += psed.getLength(); + psed.setTotalCounts(exeCounts); + } + perStudentExesResponseVO.setPerStuExeDoneResponseVOS(perStuExeDoneResponseVOS); + + //正确率 + 平均用时 + if (submitCounts != 0) { + BigDecimal bigDecimal1 = new BigDecimal(totalRithts).multiply(new BigDecimal(100)).divide((new BigDecimal(submitCounts).multiply(new BigDecimal(exeCounts))), RoundingMode.CEILING); + perStudentExesResponseVO.setRightPercent(bigDecimal1); + BigDecimal bigDecimal = new BigDecimal(totalLength).divide(new BigDecimal(submitCounts), RoundingMode.CEILING); + perStudentExesResponseVO.setAvgUseTimes(bigDecimal); + } + + + return perStudentExesResponseVO; + } + + public List<GetVodDetailResponseVO> getRecommendVodByTreeId(GetRecommendVodByTreeIdVO getRecommendVodByTreeIdVO) { + List<GetVodDetailResponseVO> getVodDetailResponseVOS = new ArrayList<>(); + List<Integer> relatedVods = JSON.parseArray(getRecommendVodByTreeIdVO.getTreeIds(), Integer.class); + + getRecommendVodByTreeIdVO.setTreeIdInteger(relatedVods); + + List<VodDictDO> vodDicts = vodDictMapper.getRecommendVodByTreeId(getRecommendVodByTreeIdVO); + for (VodDictDO vodDict : vodDicts) { + GetVodDetailResponseVO getVodDetailResponseVO = new GetVodDetailResponseVO(); + BeanUtils.copyProperties(vodDict, getVodDetailResponseVO); + getVodDetailResponseVO.setLengthSecond(vodDict.getVodLength()); + AdministerDO vodUserAlias = administerMapper.selectById(vodDict.getAdministerId()); + if (vodUserAlias != null) { + getVodDetailResponseVO.setUserName(vodUserAlias.getUserName()); + } + getVodDetailResponseVOS.add(getVodDetailResponseVO); + } + return getVodDetailResponseVOS; + } + + public List<GetExercisesInfoByIdsResponseVO> getRecommendExeByTreeId(GetRecommendExeByTreeIdVO getRecommendExeByTreeIdVO) { + + List<GetExercisesInfoByIdsResponseVO> getExercisesInfoByIdsResponseVOS = new ArrayList<>(); + List<Integer> relatedExes = JSON.parseArray(getRecommendExeByTreeIdVO.getTreeIds(), Integer.class); + + for (Integer integer : relatedExes) { + GetExercisesInfoByIdsResponseVO getExercisesInfoByIdsResponseVO = new GetExercisesInfoByIdsResponseVO(); + + List<ExerciseDictDO> exerciseDicts = exerciseTreeMappingMapper.getRelatedExercise(integer); + if (exerciseDicts.size() == 0) { + continue; + } + getExercisesInfoByIdsResponseVO.setExeCounts(exerciseDicts.size()); + int len = 0; + for (ExerciseDictDO ed : exerciseDicts) { + len += ed.getAdviceLength(); + } + getExercisesInfoByIdsResponseVO.setTreeId(integer); + getExercisesInfoByIdsResponseVO.setLength(MathUtil.exerciseLength(len)); + getExercisesInfoByIdsResponseVO.setLengthSecond(len); + SubjectTreeDO knowledgeTree = subjectTreeMapper.selectById(integer); + if (knowledgeTree != null) { + getExercisesInfoByIdsResponseVO.setLabel(knowledgeTree.getTreeName()); + } + getExercisesInfoByIdsResponseVOS.add(getExercisesInfoByIdsResponseVO); + } + return getExercisesInfoByIdsResponseVOS; + } + + public List<SubjectTreeDO> allNodes(SubjectTreeDO knowledgeTree) { + + //SubjectTreeDO subjectTreeDO1 = subjectTreeMapper.selectById(knowledgeTree.getId()); + + //获取某科目下的所有父节点 + List<SubjectTreeDO> knowledgeTrees = subjectTreeMapper.selectList(new QueryWrapper<SubjectTreeDO>() + .lambda() + .eq(SubjectTreeDO::getSubjectId, knowledgeTree.getSubjectId()) + .isNull(SubjectTreeDO::getParentId)); + + //只展示三级节点 + + for (SubjectTreeDO kn : knowledgeTrees) { + //二级节点 + List<SubjectTreeDO> subjectTreeDOS = subjectTreeMapper.selectList(new QueryWrapper<SubjectTreeDO>() + .lambda() + .eq(SubjectTreeDO::getParentId, kn.getId())); + kn.setChildren(subjectTreeDOS); + + for (SubjectTreeDO subjectTreeDO : subjectTreeDOS) { + List<SubjectTreeDO> subjectTreeDOS1 = subjectTreeMapper.selectList(new QueryWrapper<SubjectTreeDO>() + .lambda() + .eq(SubjectTreeDO::getParentId, subjectTreeDO.getId())); + subjectTreeDO.setChildren(subjectTreeDOS1); + } + //kn.setChildren(getChildNodes(kn)); + } + + return knowledgeTrees; + } + + public List<UserRoleDO> getClassStudents(GetClassStudentsDTO getClassStudentsDTO) { + return this.baseMapper.getClassStudents(getClassStudentsDTO); + } + + public List<ExerciseDictDO> queryTaskRelatedExercise(TaskContentDO taskContentDO){ + ExerciseRelatedMappingDO exerciseRelatedMappingDO =exerciseRelatedMappingMapper.selectById(taskContentDO.getContentId()); + return exerciseDictMapper.selectBatchIds(Arrays.asList(exerciseRelatedMappingDO.getExerciseIds().split(","))); + } + + + /** + * 关联习题处理 + */ + public void data(){ + + List<TaskContentDO> taskContentDOS = taskContentMapper.selectList(new QueryWrapper<TaskContentDO>() + .lambda() + .eq(TaskContentDO::getContentType,"1") + .isNull(TaskContentDO::getDeleteDate)); + + for (TaskContentDO taskContentDO : taskContentDOS){ + + ExerciseRelatedMappingDO exerciseRelatedMappingDO = new ExerciseRelatedMappingDO(); + + exerciseRelatedMappingDO.setTaskId(taskContentDO.getTaskId()); + exerciseRelatedMappingDO.setTreeId(taskContentDO.getContentId()); + + ClassSubjectTaskDO classSubjectTaskDO = classSubjectTaskMapper.selectById(taskContentDO.getTaskId()); + if (null != classSubjectTaskDO){ + //exerciseRelatedMappingDO.setExerciseName(classSubjectTaskDO.getTreeName()); + SubjectTreeDO subjectTreeDO = subjectTreeMapper.selectById(taskContentDO.getContentId()); + exerciseRelatedMappingDO.setExerciseName(subjectTreeDO.getTreeName()); + + //班级里的人 + List<ClassesUserMappingDO> classesUserMappingDOS = classesUserMappingMapper.selectList(new QueryWrapper<ClassesUserMappingDO>() + .lambda() + .eq(ClassesUserMappingDO::getClassesId,classSubjectTaskDO.getClassId())); + + if (classesUserMappingDOS.size()>0){ + StringBuilder temp = new StringBuilder(); + + for (ClassesUserMappingDO classesUserMappingDO : classesUserMappingDOS){ + temp.append(classesUserMappingDO.getUserId()); + temp.append(","); + } + + String stuentIds = temp.toString().substring(0,temp.length()-1); + exerciseRelatedMappingDO.setStudentIds(stuentIds); + } + + //题目去重 + Set<String> sets = new HashSet<>(); + List<ExerciseDoneHistoryDO> exerciseDoneHistoryDOS = exerciseDoneHistoryMapper.selectList(new QueryWrapper<ExerciseDoneHistoryDO>() + .lambda() + .eq(ExerciseDoneHistoryDO::getTaskSubjectId,taskContentDO.getTaskId()) + .eq(ExerciseDoneHistoryDO::getContentId,taskContentDO.getContentId())); + if (exerciseDoneHistoryDOS.size()>0){ + for (ExerciseDoneHistoryDO exerciseDoneHistoryDO : exerciseDoneHistoryDOS){ + sets.add(String.valueOf(exerciseDoneHistoryDO.getExerciseId())); + } + + StringBuilder stringBuilder = new StringBuilder(); + for (String str : sets){ + stringBuilder.append(str); + stringBuilder.append(","); + } + String exerciseids = stringBuilder.toString().substring(0,stringBuilder.length()-1); + exerciseRelatedMappingDO.setExerciseIds(exerciseids); + } + exerciseRelatedMappingMapper.insert(exerciseRelatedMappingDO); + + //更新history的contentId + ExerciseDoneHistoryDO exerciseDoneHistoryDO = new ExerciseDoneHistoryDO(); + exerciseDoneHistoryDO.setContentId(exerciseRelatedMappingDO.getId()); + exerciseDoneHistoryMapper.update(exerciseDoneHistoryDO,new QueryWrapper<ExerciseDoneHistoryDO>() + .lambda() + .eq(ExerciseDoneHistoryDO::getContentId,taskContentDO.getContentId()) + .eq(ExerciseDoneHistoryDO::getTaskSubjectId,taskContentDO.getTaskId())); + + //task_completion_status + TaskCompletionStatusDO taskCompletionStatusDO = new TaskCompletionStatusDO(); + taskCompletionStatusDO.setTreeId(exerciseRelatedMappingDO.getId()); + taskCompletionStatusMapper.update(taskCompletionStatusDO,new QueryWrapper<TaskCompletionStatusDO>() + .lambda() + .eq(TaskCompletionStatusDO::getSubjectTaskId,taskContentDO.getTaskId()) + .eq(TaskCompletionStatusDO::getExeType,0) + .eq(TaskCompletionStatusDO::getTreeId,taskContentDO.getContentId())); + + //task_content_done_info + TaskContentDoneInfoDO taskContentDoneInfoDO = new TaskContentDoneInfoDO(); + taskContentDoneInfoDO.setContentId(exerciseRelatedMappingDO.getId()); + taskContentDoneInfoMapper.update(taskContentDoneInfoDO,new QueryWrapper<TaskContentDoneInfoDO>() + .lambda() + .eq(TaskContentDoneInfoDO::getTaskId,taskContentDO.getTaskId()) + .eq(TaskContentDoneInfoDO::getContentType,1) + .eq(TaskContentDoneInfoDO::getContentId,taskContentDO.getContentId())); + + //更新taskContent的contentId + taskContentDO.setContentId(exerciseRelatedMappingDO.getId()); + taskContentMapper.updateById(taskContentDO); + } + + } + } + + + ///** + // * 遍历子节点并赋值 + // */ + //public List<SubjectTreeDO> getChildNodes(SubjectTreeDO knowledgeTree) { + // + // //查找该父节点下的子节点 + // List<SubjectTreeDO> knowledgeTrees = subjectTreeMapper.selectList(new QueryWrapper<SubjectTreeDO>() + // .lambda() + // .eq(SubjectTreeDO::getParentId, knowledgeTree.getId()) + // .orderByAsc(SubjectTreeDO::getTreeOrder)); + // + // for (SubjectTreeDO kn : knowledgeTrees) { + // kn.setChildren(getChildNodes(kn)); + // } + // if (knowledgeTrees.size() == 0) { + // return null; + // } + // return knowledgeTrees; + //} + + /** + * 获取某个班级的学生人数 + * + * @return + */ + public Integer getClassStuCounts(Integer classId) { + return classesUserMappingMapper.selectCount(new QueryWrapper<ClassesUserMappingDO>() + .lambda() + .eq(ClassesUserMappingDO::getClassesId, classId)); + } + + private GetPreTaskContentVO getTaskContents(ClassSubjectTaskDO cst) { + GetPreTaskContentVO getPreTaskIdResponseVO = new GetPreTaskContentVO(); + + List<TaskContentDO> taskContents = taskContentMapper.selectList(new QueryWrapper<TaskContentDO>() + .lambda() + .eq(TaskContentDO::getTaskId, cst.getId())); + if (taskContents.size() > 0) { + //微视频 + List<Integer> vodIntegers = new ArrayList<>(); + //关联习题 + List<Integer> relateIds = new ArrayList<>(); + //书面作业 + List<Integer> homeIntegers = new ArrayList<>(); + for (TaskContentDO tc : taskContents) { + if (tc.getContentType() == 0) { + vodIntegers.add(tc.getContentId()); + } + if (tc.getContentType() == 1) { + relateIds.add(tc.getContentId()); + } + if (tc.getContentType() == 3) { + homeIntegers.add(tc.getContentId()); + } + } + //微视频列表 + if (vodIntegers.size() > 0) { + List<PreVodInfoVO> preVodInfoVOS = new ArrayList<>(); + List<VodDictDO> vodDicts = vodDictMapper.selectBatchIds(vodIntegers); + for (VodDictDO vodDict : vodDicts) { + PreVodInfoVO preVodInfoVO = new PreVodInfoVO(); + BeanUtils.copyProperties(vodDict, preVodInfoVO); + AdministerDO administerDO = administerMapper.selectById(vodDict.getAdministerId()); + + if (null != administerDO) { + preVodInfoVO.setTeacherName(administerDO.getUserName()); + } + //preVodInfoVO.setTreeId(vodDict.getTreeId()); + preVodInfoVO.setLength(MathUtil.vodLength(vodDict.getVodLength())); + preVodInfoVO.setLengthSecond(vodDict.getVodLength()); + preVodInfoVO.setVodId(vodDict.getId()); + preVodInfoVOS.add(preVodInfoVO); + } + getPreTaskIdResponseVO.setPreVodInfoVOS(preVodInfoVOS); + } + + + //关联习题 +// String ids[] = cst.getTreeId().split(","); + List<PreRelateExeVO> preRelateExeVOS = new ArrayList<>(); + for (Integer str : relateIds) { + ExerciseRelatedMappingDO exerciseRelatedMappingDO = exerciseRelatedMappingMapper.selectById(str); + List<ExerciseDictDO> relatedExes = exerciseDictMapper.selectBatchIds(Arrays.asList(exerciseRelatedMappingDO.getExerciseIds().split(","))); + PreRelateExeVO preRelateExeVO = new PreRelateExeVO(); + preRelateExeVO.setExeCounts(relatedExes.size()); + preRelateExeVO.setTreeName(subjectTreeMapper.selectById(exerciseRelatedMappingDO.getTreeId()).getTreeName()); + int length = 0; + for (ExerciseDictDO ed : relatedExes) { + length += ed.getAdviceLength(); + } + preRelateExeVO.setTreeId(Integer.valueOf(str)); + preRelateExeVO.setLength(MathUtil.exerciseLength(length)); + preRelateExeVO.setLengthSecond(length); + preRelateExeVOS.add(preRelateExeVO); + } + getPreTaskIdResponseVO.setPreRelateExeVOS(preRelateExeVOS); + + //书面作业 + PreHomeWorkInfoVO preHomeWorkInfoVO = new PreHomeWorkInfoVO(); + if (homeIntegers.size() > 0) { + List<WrittenHomeworkDO> writtenHomeworks = writtenHomeworkMapper.selectBatchIds(homeIntegers); + List<WrittenHomeworkDO> whs = new ArrayList<>(); + for (WrittenHomeworkDO writtenHomework : writtenHomeworks) { + if (writtenHomework.getHomeworkType() == 2) { + preHomeWorkInfoVO.setNotice(writtenHomework.getHomeworkContent()); + } else { + writtenHomework.setHomeworkContent(URLDecoder.decode(writtenHomework.getHomeworkContent())); + whs.add(writtenHomework); + } + preHomeWorkInfoVO.setLengthSecond(writtenHomework.getAdviceLength()); + preHomeWorkInfoVO.setFileName(writtenHomework.getFileName()); + } + preHomeWorkInfoVO.setWrittenHomeworks(whs); + preHomeWorkInfoVO.setLength(MathUtil.exerciseLength(writtenHomeworks.get(0).getAdviceLength())); + + preHomeWorkInfoVO.setHomeworksCounts(writtenHomeworks.size()); + getPreTaskIdResponseVO.setPreHomeWorkInfoVO(preHomeWorkInfoVO); + } + //知识点 +// List<String> treeIds = Arrays.asList(cst.getTreeId().split(",")); +// List<KnowledgeTree> knowledgeTrees = knowledgeTreeMapper.selectBatchIds(treeIds); +// getPreTaskIdResponseVO.setKnowledgeTrees(knowledgeTrees); + } + + //拓展习题 + List<PreExpandExerciseVO> preExpandExerciseVOS = new ArrayList<>(); + QueryWrapper queryWrapper1 = new QueryWrapper(); + queryWrapper1.eq("task_id", cst.getId()); + List<ExerciseExpandMappingDO> exerciseExpandMappings = exerciseExpandMappingMapper.selectList(queryWrapper1); + for (ExerciseExpandMappingDO eem : exerciseExpandMappings) { + PreExpandExerciseVO preExpandExerciseVO = new PreExpandExerciseVO(); + int length = 0; + String[] exerciseIds = eem.getExerciseIds().split(","); + for (String str : exerciseIds) { + length += exerciseDictMapper.selectById(str).getAdviceLength(); + } + preExpandExerciseVO.setExerciseCounts(exerciseIds.length); + preExpandExerciseVO.setLength(MathUtil.exerciseLength(length)); + String[] studentIds = eem.getStudentIds().split(","); + preExpandExerciseVO.setTreeId(eem.getId()); + preExpandExerciseVO.setExpandExerciseNames(eem.getExerciseName()); + preExpandExerciseVO.setStudentCounts(studentIds.length); + preExpandExerciseVO.setLengthSecond(length); + preExpandExerciseVOS.add(preExpandExerciseVO); + } + getPreTaskIdResponseVO.setPreExpandExerciseVOS(preExpandExerciseVOS); + + getPreTaskIdResponseVO.setTaskType(cst.getTaskType()); + UserRoleDO userRole = userRoleMapper.selectById(cst.getTeacherId()); + getPreTaskIdResponseVO.setTeacherName(userRole != null ? userRole.getUserName() : null); + getPreTaskIdResponseVO.setTaskId(cst.getId()); + return getPreTaskIdResponseVO; + } + + + public void pushMsg(PushMsgPO pushMsgPO, String token) { + + String msgUrl = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token=" + token; + + String input = "{\n" + + " \"touser\":\"" + pushMsgPO.getOpenId() + "\",\n" + + " \"template_id\":\"" + wechatConfig.getTemplateId() + "\",\n" + + " \"url\":\"" + wechatConfig.getMsgUrl() + "\",\n" + + " \"data\":{\n" + + " \"first\":{\n" + + " \"value\":\"" + pushMsgPO.getTitle() + "\",\n" + + " \"color\":\"#173177\"\n" + + " },\n" + + " \"keyword1\":{\n" + + " \"value\":\"" + pushMsgPO.getSchool() + "\",\n" + + " \"color\":\"#173177\"\n" + + " },\n" + + " \"keyword2\":{\n" + + " \"value\":\"" + pushMsgPO.getTeacherName() + "\",\n" + + " \"color\":\"#173177\"\n" + + " },\n" + + " \"keyword3\":{\n" + + " \"value\":\"" + pushMsgPO.getTaskName() + "\",\n" + + " \"color\":\"#173177\"\n" + + " },\n" + + " \"keyword4\":{\n" + + " \"value\":\"" + pushMsgPO.getDateTime() + "\",\n" + + " \"color\":\"#173177\"\n" + +// " },\n" + +// " \"remark\":{\n" + +// " \"value\":\""+pushMsgPO.getRemark()+"\",\n" + +// " \"color\":\"#173177\"\n" + + " }\n" + + " }\n" + + "}"; + + + HttpHeaders headers = new HttpHeaders(); + + ResponseEntity<PushMsgVO> responseEntity = restTemplateConfig.restTemplate() + .exchange(msgUrl, HttpMethod.POST, new HttpEntity<>(input.getBytes(), headers), PushMsgVO.class); + } + + //新增微视频 书面作业 关联习题 拓展习题 + public void addTaskContents(PublishTasksDTO publishTasksDTO, Integer taskId,Integer classId,String taskName) { + + //保存微视频作业 + String[] vodIds = publishTasksDTO.getVodIds().split(","); + if (!StringUtils.isEmpty(publishTasksDTO.getVodIds()) && vodIds.length > 0) { + for (String integer : vodIds) { + TaskContentDO tc = new TaskContentDO(); + tc.setTaskId(taskId); + tc.setContentType(0); + tc.setContentId(Integer.valueOf(integer)); + tc.setCreateDate(LocalDateTime.now()); + tc.setUpdateDate(LocalDateTime.now()); + taskContentMapper.insert(tc); + } + } + + //保存关联习题 + //关联知识点 +// String[] treeIds = publishTasksRequestVO.getTreeIds().split(","); + //老师布置的关联习题 + List<String> relatedIds = Arrays.asList(publishTasksDTO.getRelatedIds().split(",")); + if (!StringUtils.isEmpty(publishTasksDTO.getRelatedIds()) && relatedIds.size() > 0) { + for (String integer : relatedIds) { + //布置关联习题 + ExerciseRelatedMappingDO exerciseRelatedMappingDO = new ExerciseRelatedMappingDO(); + exerciseRelatedMappingDO.setTaskId(taskId); + exerciseRelatedMappingDO.setTreeId(Integer.valueOf(integer)); + exerciseRelatedMappingDO.setExerciseName(taskName); + + List<ExerciseTreeMappingDO> exerciseTreeMappingDOS = exerciseTreeMappingMapper.selectList(new QueryWrapper<ExerciseTreeMappingDO>() + .lambda() + .eq(ExerciseTreeMappingDO::getTreeId,integer) + .eq(ExerciseTreeMappingDO::getStatus,1)); + + StringBuilder stringBuilder = new StringBuilder(); + + for (ExerciseTreeMappingDO exerciseTreeMappingDO : exerciseTreeMappingDOS){ + stringBuilder.append(exerciseTreeMappingDO.getExerciseId()); + stringBuilder.append(","); + } + String exerciseIds = stringBuilder.toString().substring(0,stringBuilder.length()-1); + exerciseRelatedMappingDO.setExerciseIds(exerciseIds); + + + List<ClassesUserMappingDO> classesUserMappingDOS = classesUserMappingMapper.selectList(new QueryWrapper<ClassesUserMappingDO>() + .lambda() + .eq(ClassesUserMappingDO::getClassesId,classId)); + StrBuilder strBuilder = new StrBuilder(); + for (ClassesUserMappingDO classesUserMappingDO : classesUserMappingDOS){ + strBuilder.append(classesUserMappingDO.getUserId()); + strBuilder.append(","); + } + String userIds = strBuilder.toString().substring(0,strBuilder.length()-1); + exerciseRelatedMappingDO.setStudentIds(userIds); + exerciseRelatedMappingMapper.insert(exerciseRelatedMappingDO); + + TaskContentDO tc = new TaskContentDO(); + tc.setTaskId(taskId); + tc.setContentType(1); + tc.setContentId(exerciseRelatedMappingDO.getId()); + tc.setCreateDate(LocalDateTime.now()); + tc.setUpdateDate(LocalDateTime.now()); + taskContentMapper.insert(tc); + + } + } + + + + + //拓展习题 + List<PublishExpandingVO> publishExpandingVOS = publishTasksDTO.getPublishExpandingVOS(); + if (publishExpandingVOS.size() > 0) { + for (PublishExpandingVO pev : publishExpandingVOS) { + ExerciseExpandMappingDO eem = new ExerciseExpandMappingDO(); + eem.setTaskId(taskId); + eem.setExerciseIds(pev.getExpandingExeIds()); + eem.setStudentIds(pev.getExpandingStudents()); + eem.setExerciseName(pev.getExpandingName()); + eem.setCreateDate(LocalDateTime.now()); + eem.setUpdateDate(LocalDateTime.now()); + exerciseExpandMappingMapper.insert(eem); + TaskContentDO taskContent = new TaskContentDO(); + taskContent.setTaskId(taskId); + taskContent.setContentType(2); + taskContent.setContentId(eem.getId()); + taskContent.setCreateDate(LocalDateTime.now()); + taskContent.setUpdateDate(LocalDateTime.now()); + taskContentMapper.insert(taskContent); + } + + } + + //附件作业 + List<PublishHomeworkVO> publishHomeworkVOS = publishTasksDTO.getPublishHomeworkVOS(); + if (publishHomeworkVOS.size() > 0) { + for (PublishHomeworkVO phk : publishHomeworkVOS) { + WrittenHomeworkDO writtenHomework = new WrittenHomeworkDO(); + writtenHomework.setHomeworkType(phk.getHomeworkType()); + writtenHomework.setHomeworkContent(phk.getHomeworkContent()); + writtenHomework.setFileName(phk.getFileName()); + writtenHomework.setAdviceLength(publishTasksDTO.getAdviceLength()); + writtenHomework.setFileSize(phk.getFileSize()); + writtenHomework.setFileType(phk.getFileType()); + writtenHomework.setCreateDate(LocalDateTime.now()); + writtenHomework.setUpdateDate(LocalDateTime.now()); + writtenHomeworkMapper.insert(writtenHomework); + TaskContentDO taskContent = new TaskContentDO(); + taskContent.setContentType(3); + taskContent.setTaskId(taskId); + taskContent.setContentId(writtenHomework.getId()); + taskContent.setUpdateDate(LocalDateTime.now()); + taskContent.setCreateDate(LocalDateTime.now()); + taskContentMapper.insert(taskContent); + } + } + + } + + public String labels(String ids) { + StringBuilder sb = new StringBuilder(); + if (!StringUtils.isEmpty(ids)) { + String[] arr = ids.split(","); + if (arr.length > 0) { + for (String str : arr) { + SubjectTreeDO knowledgeTree = subjectTreeMapper.selectById(str); + if (null != knowledgeTree) { + sb.append(knowledgeTree.getTreeName()).append(";"); + } + } + return sb.substring(0, sb.length() - 1); + } else { + return ""; + } + } else { + return ""; + } + + } + +} diff --git a/src/main/java/com/meishu/service/impl/ClassesDictHistoryServiceImpl.java b/src/main/java/com/meishu/service/impl/ClassesDictHistoryServiceImpl.java new file mode 100644 index 0000000..f14f4b9 --- /dev/null +++ b/src/main/java/com/meishu/service/impl/ClassesDictHistoryServiceImpl.java @@ -0,0 +1,20 @@ +package com.meishu.service.impl; + +import com.meishu.model.ClassesDictHistoryDO; +import com.meishu.mapper.ClassesDictHistoryMapper; +import com.meishu.service.ClassesDictHistoryService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + * <p> + * 学校班级字典表 服务实现类 + * </p> + * + * @author Tuyp + * @since 2021-08-11 + */ +@Service +public class ClassesDictHistoryServiceImpl extends ServiceImpl<ClassesDictHistoryMapper, ClassesDictHistoryDO> implements ClassesDictHistoryService { + +} diff --git a/src/main/java/com/meishu/service/impl/ClassesDictServiceImpl.java b/src/main/java/com/meishu/service/impl/ClassesDictServiceImpl.java new file mode 100644 index 0000000..3665003 --- /dev/null +++ b/src/main/java/com/meishu/service/impl/ClassesDictServiceImpl.java @@ -0,0 +1,373 @@ +package com.meishu.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.meishu.dto.classes.*; +import com.meishu.mapper.*; +import com.meishu.model.*; +import com.meishu.service.ClassesDictService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.meishu.util.ConstantUtils; +import com.meishu.vo.classes.GetClassStudentsVO; +import com.meishu.vo.classes.GetClassesVO; +import com.meishu.vo.classes.SubjectDictVO; +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.util.*; + +/** + * <p> + * 学校班级字典表 服务实现类 + * </p> + * + * @author Tuyp + * @since 2021-08-11 + */ +@Service +public class ClassesDictServiceImpl extends ServiceImpl<ClassesDictMapper, ClassesDictDO> implements ClassesDictService { + + @Autowired + private SubjectDictMapper subjectDictMapper; + + @Autowired + private SubjectSemesterMapper subjectSemesterMapper; + + @Autowired + private UserSubjectMappingMapper userSubjectMappingMapper; + + @Autowired + private ClassesUserMappingMapper classesUserMappingMapper; + + @Autowired + private ClassesDictHistoryMapper classesDictHistoryMapper; + + @Autowired + private UserSubjectPermissionDictMapper userSubjectPermissionDictMapper; + + @Autowired + private KnowledgeSubjectDictMapper knowledgeSubjectDictMapper; + + public IPage<GetClassesVO> getClasses(GetClassesDTO getClassesDTO) { + + Page pager = new Page(getClassesDTO.getPageNum(), getClassesDTO.getPageSize()); + + IPage<GetClassesVO> getClassesVOIPage = this.baseMapper.getClasses(pager, getClassesDTO.getClassName(), getClassesDTO.getGrade(), getClassesDTO.getSession(), getClassesDTO.getStatus()); + + List<GetClassesVO> getClassesVOS = getClassesVOIPage.getRecords(); + //找出班级所有的科目 + for (GetClassesVO getClassesVO : getClassesVOS) { + List<SubjectDictDO> subjectDictDOS = subjectDictMapper.selectList(new QueryWrapper<SubjectDictDO>() + .lambda() + .eq(SubjectDictDO::getGrade, getClassesVO.getGrade()) + .eq(SubjectDictDO::getClasses, getClassesVO.getClasses()) + .eq(SubjectDictDO::getSession, getClassesVO.getSession())); + + List<SubjectDictVO> subjectDictVOS = new ArrayList<>(); + for (SubjectDictDO subjectDictDO : subjectDictDOS) { + SubjectDictVO subjectDictVO = new SubjectDictVO(); + BeanUtils.copyProperties(subjectDictDO, subjectDictVO); + //查询该科目下的授课老师 + List<AdministerDO> administerDOS = userSubjectMappingMapper.querySubjectTeachers(subjectDictDO.getId()); + subjectDictVO.setAdministerDOS(administerDOS); + + KnowledgeSubjectDictDO knowledgeSubjectDict = knowledgeSubjectDictMapper.selectOne(new QueryWrapper<KnowledgeSubjectDictDO>() + .lambda() + .eq(KnowledgeSubjectDictDO::getSubjectName, subjectDictDO.getSubject())); + if (null != knowledgeSubjectDict) { + subjectDictVO.setId(knowledgeSubjectDict.getId().intValue()); + } else { + subjectDictVO.setId(null); + } + subjectDictVOS.add(subjectDictVO); + } + getClassesVO.setSubjectDictDOS(subjectDictVOS); + } + getClassesVOIPage.setRecords(getClassesVOS); + return getClassesVOIPage; + } + + @Transactional(rollbackFor = Exception.class) + public String addClass(AddClassDTO addClassDTO) { + + ClassesDictDO classesDictDO = new ClassesDictDO(); + BeanUtils.copyProperties(addClassDTO, classesDictDO); + classesDictDO.setClassName(classesDictDO.getGrade() + "(" + classesDictDO.getClasses() + ")班"); + classesDictDO.setSchool(ConstantUtils.SCHOOL); + classesDictDO.setSubjectType("高中"); + classesDictDO.setStatus("在读"); + + + Calendar cal = Calendar.getInstance(); + int year = cal.get(Calendar.YEAR); + int month = cal.get(Calendar.MONTH)+1;//获取月份 + + Date date = new Date(); + if (month>=7){ + date.setYear(year-1899); + date.setMonth(7); + date.setDate(1); + date.setHours(0); + date.setMinutes(0); + date.setSeconds(0); + }else { + date.setYear(year-1900); + date.setMonth(7); + date.setDate(1); + date.setHours(0); + date.setMinutes(0); + date.setSeconds(0); + } + classesDictDO.setUpgradeDate(date); + this.baseMapper.insert(classesDictDO); + + ClassesDictHistoryDO classesDictHistoryDO = new ClassesDictHistoryDO(); + BeanUtils.copyProperties(addClassDTO, classesDictHistoryDO); + classesDictHistoryDO.setClassName(classesDictDO.getClassName()); + classesDictHistoryDO.setSchool(classesDictDO.getSchool()); + classesDictHistoryDO.setSubjectType(classesDictDO.getSubjectType()); + classesDictHistoryDO.setStatus("在读"); + classesDictHistoryDO.setClassDictId(classesDictDO.getId()); + classesDictHistoryMapper.insert(classesDictHistoryDO); + + //找到班级所有学生 + List<ClassesUserMappingDO> classesUserMappingDOS = classesUserMappingMapper.selectList(new QueryWrapper<ClassesUserMappingDO>() + .lambda() + .eq(ClassesUserMappingDO::getClassesId,addClassDTO.getId())); + + + //添加 班级里的科目信息 + List<String> subjects = addClassDTO.getSubjects(); + for (String str : subjects) { + SubjectDictDO subjectDictDO = new SubjectDictDO(); + subjectDictDO.setSchool(ConstantUtils.SCHOOL); + subjectDictDO.setGrade(addClassDTO.getGrade()); + subjectDictDO.setClasses(addClassDTO.getClasses()); + subjectDictDO.setClassName(classesDictDO.getClassName()); + subjectDictDO.setSubject(knowledgeSubjectDictMapper.selectById(str).getSubjectName()); + subjectDictDO.setSubjectType("高中"); + subjectDictDO.setSession(classesDictDO.getSession()); + subjectDictDO.setStatus("在读"); + subjectDictMapper.insert(subjectDictDO); + + SubjectSemesterDO subjectSemesterDO = new SubjectSemesterDO(); + subjectSemesterDO.setSubjectId(subjectDictDO.getId()); + subjectSemesterDO.setSemester("上"); + subjectSemesterMapper.insert(subjectSemesterDO); + +// for (ClassesUserMappingDO classesUserMappingDO : classesUserMappingDOS){ +// PtStudentScoreDO ptStudentScoreDO = new PtStudentScoreDO(); +// ptStudentScoreDO.setScore(30.0); +// ptStudentScoreDO.setScoreRecord(30.0); +// ptStudentScoreDO.setSemesterId(subjectSemesterDO.getId()); +// ptStudentScoreDO.setStudentId(classesUserMappingDO.getUserId()); +// ptStudentScoreDO.setSubjectId(subjectDictDO.getId()); +// } + + subjectSemesterDO.setSemester("下"); + subjectSemesterMapper.insert(subjectSemesterDO); + +// for (ClassesUserMappingDO classesUserMappingDO : classesUserMappingDOS){ +// PtStudentScoreDO ptStudentScoreDO = new PtStudentScoreDO(); +// ptStudentScoreDO.setScore(30.0); +// ptStudentScoreDO.setScoreRecord(30.0); +// ptStudentScoreDO.setSemesterId(subjectSemesterDO.getId()); +// ptStudentScoreDO.setStudentId(classesUserMappingDO.getUserId()); +// ptStudentScoreDO.setSubjectId(subjectDictDO.getId()); +// } + + } + + return ConstantUtils.ADD_SUCCESS; + } + + public String updateClass(AddClassDTO addClassDTO) { + + ClassesDictHistoryDO classesDictHistoryDO = classesDictHistoryMapper.selectOne(new QueryWrapper<ClassesDictHistoryDO>() + .lambda() + .eq(ClassesDictHistoryDO::getStatus,"在读") + .eq(ClassesDictHistoryDO::getClassDictId,addClassDTO.getId())); + + classesDictHistoryDO.setGrade(addClassDTO.getGrade()); + classesDictHistoryDO.setClasses(addClassDTO.getClasses()); + classesDictHistoryDO.setSession(addClassDTO.getSession()); + classesDictHistoryDO.setClassName(classesDictHistoryDO.getGrade() + "(" + classesDictHistoryDO.getClasses() + ")班"); + classesDictHistoryMapper.updateById(classesDictHistoryDO); + + ClassesDictDO classesDictDO = new ClassesDictDO(); + BeanUtils.copyProperties(classesDictHistoryDO, classesDictDO); + classesDictDO.setId(addClassDTO.getId()); + classesDictDO.setClassName(classesDictDO.getGrade() + "(" + classesDictDO.getClasses() + ")班"); + this.baseMapper.updateById(classesDictDO); + + //查找该班级下已经有的科目 + List<String> existSubject = subjectDictMapper.getClassSubjectName(classesDictHistoryDO.getGrade(),classesDictHistoryDO.getClasses(),classesDictHistoryDO.getSession()); + + //找到班级所有学生 + List<ClassesUserMappingDO> classesUserMappingDOS = classesUserMappingMapper.selectList(new QueryWrapper<ClassesUserMappingDO>() + .lambda() + .eq(ClassesUserMappingDO::getClassesId,addClassDTO.getId())); + + List<String> subjects = addClassDTO.getSubjects(); + for (String str : subjects) { + KnowledgeSubjectDictDO knowledgeSubjectDictDO = knowledgeSubjectDictMapper.selectById(str); + if (!existSubject.contains(knowledgeSubjectDictDO.getSubjectName())){ + SubjectDictDO subjectDictDO = new SubjectDictDO(); + subjectDictDO.setSchool(ConstantUtils.SCHOOL); + subjectDictDO.setGrade(addClassDTO.getGrade()); + subjectDictDO.setClasses(addClassDTO.getClasses()); + subjectDictDO.setClassName(classesDictDO.getClassName()); + subjectDictDO.setSubject(knowledgeSubjectDictMapper.selectById(str).getSubjectName()); + subjectDictDO.setSubjectType("高中"); + subjectDictDO.setSession(classesDictDO.getSession()); + subjectDictDO.setStatus("1"); + subjectDictMapper.insert(subjectDictDO); + + SubjectSemesterDO subjectSemesterDO = new SubjectSemesterDO(); + subjectSemesterDO.setSubjectId(subjectDictDO.getId()); + subjectSemesterDO.setSemester("上"); + subjectSemesterMapper.insert(subjectSemesterDO); + + for (ClassesUserMappingDO classesUserMappingDO : classesUserMappingDOS){ + PtStudentScoreDO ptStudentScoreDO = new PtStudentScoreDO(); + ptStudentScoreDO.setScore(30.0); + ptStudentScoreDO.setScoreRecord(30.0); + ptStudentScoreDO.setSemesterId(subjectSemesterDO.getId()); + ptStudentScoreDO.setStudentId(classesUserMappingDO.getUserId()); + ptStudentScoreDO.setSubjectId(subjectDictDO.getId()); + } + + subjectSemesterDO.setSemester("下"); + subjectSemesterMapper.insert(subjectSemesterDO); + for (ClassesUserMappingDO classesUserMappingDO : classesUserMappingDOS){ + PtStudentScoreDO ptStudentScoreDO = new PtStudentScoreDO(); + ptStudentScoreDO.setScore(30.0); + ptStudentScoreDO.setScoreRecord(30.0); + ptStudentScoreDO.setSemesterId(subjectSemesterDO.getId()); + ptStudentScoreDO.setStudentId(classesUserMappingDO.getUserId()); + ptStudentScoreDO.setSubjectId(subjectDictDO.getId()); + } + } + } + + return ConstantUtils.SUCCESS_UPDATE; + } + + @Transactional(rollbackFor = Exception.class) + public String addSubjectTeacherMapping(AddSubjectTeacherDTO addSubjectTeacherDTO) { + + ClassesDictDO classesDictDO = this.baseMapper.selectById(addSubjectTeacherDTO.getClassId()); + List<AddSubjectTeacherMappingDTO> addSubjectTeacherMappingDTOS = addSubjectTeacherDTO.getAddSubjectTeacherMappingDTOS(); + + for (AddSubjectTeacherMappingDTO addSubjectTeacherMappingDTO :addSubjectTeacherMappingDTOS){ + KnowledgeSubjectDictDO knowledgeSubjectDict = knowledgeSubjectDictMapper.selectById(addSubjectTeacherMappingDTO.getSubjectId()); + + List<Integer> integers = addSubjectTeacherMappingDTO.getTeacherIds(); + + SubjectDictDO subjectDictDO = subjectDictMapper.selectOne(new QueryWrapper<SubjectDictDO>() + .lambda() + .eq(SubjectDictDO::getGrade, classesDictDO.getGrade()) + .eq(SubjectDictDO::getSession, classesDictDO.getSession()) + .eq(SubjectDictDO::getClasses, classesDictDO.getClasses()) + .eq(SubjectDictDO::getSubject, knowledgeSubjectDict.getSubjectName())); + + userSubjectMappingMapper.delete(new QueryWrapper<UserSubjectMappingDO>() + .lambda() + .eq(UserSubjectMappingDO::getSubjectId,subjectDictDO.getId())); + + userSubjectPermissionDictMapper.delete(new QueryWrapper<UserSubjectPermissionDictDO>() + .lambda() + .eq(UserSubjectPermissionDictDO::getSubjectId,subjectDictDO.getId())); + + if (null != subjectDictDO) { + + for (Integer integer : integers) { + + UserSubjectMappingDO userSubjectMappingDO = new UserSubjectMappingDO(); + userSubjectMappingDO.setSubjectId(subjectDictDO.getId()); + userSubjectMappingDO.setUserId(integer); + userSubjectMappingDO.setClassType(0); + userSubjectMappingMapper.insert(userSubjectMappingDO); + + UserSubjectPermissionDictDO userSubjectPermissionDictDO = new UserSubjectPermissionDictDO(); + userSubjectPermissionDictDO.setSubjectId(subjectDictDO.getId()); + userSubjectPermissionDictDO.setUserId(integer); + userSubjectPermissionDictMapper.insert(userSubjectPermissionDictDO); + } + } + } + return ConstantUtils.ADD_SUCCESS; + } + + public List<GetClassStudentsVO> getClassStudents(GetClassStudentsDTO getClassStudentsDTO) { + +// Page pager = new Page(getClassStudentsDTO.getPageNum(), getClassStudentsDTO.getPageSize()); + return this.baseMapper.getClassStudents(getClassStudentsDTO.getClassId(), getClassStudentsDTO.getUserName()); + } + + public IPage<UserRoleDO> queryNoClassStudents(QueryNoClassStudentsDTO queryNoClassStudentsDTO) { + Page pager = new Page(queryNoClassStudentsDTO.getPageNum(), queryNoClassStudentsDTO.getPageSize()); + return this.baseMapper.queryNoClassStudents(pager, queryNoClassStudentsDTO.getUserName()); + } + + @Transactional(rollbackFor = Exception.class) + public String batchAddStudentToClass(BatchAddStudentToClassDTO batchAddStudentToClassDTO) { + + List<Integer> integers = batchAddStudentToClassDTO.getIds(); + + for (Integer integer : integers) { + classesUserMappingMapper.delete(new QueryWrapper<ClassesUserMappingDO>() + .lambda() + .eq(ClassesUserMappingDO::getUserId, integer)); + + ClassesUserMappingDO classesUserMappingDO = new ClassesUserMappingDO(); + classesUserMappingDO.setClassesId(batchAddStudentToClassDTO.getClassId()); + classesUserMappingDO.setUserId(integer); + classesUserMappingDO.setStatus(1); + classesUserMappingMapper.insert(classesUserMappingDO); + } + return ConstantUtils.ADD_SUCCESS; + } + + public String batchDeleteStudent(BatchAddStudentToClassDTO batchAddStudentToClassDTO) { + + List<Integer> integers = batchAddStudentToClassDTO.getIds(); + + for (Integer integer : integers) { + classesUserMappingMapper.delete(new QueryWrapper<ClassesUserMappingDO>() + .lambda() + .eq(ClassesUserMappingDO::getClassesId, batchAddStudentToClassDTO.getClassId()) + .eq(ClassesUserMappingDO::getUserId, integer)); + } + + return ConstantUtils.DELETE_SUCCESS; + } + + public List<ClassesDictDO> getClassesWithPage() { + return this.baseMapper.selectList(new QueryWrapper<ClassesDictDO>() + .lambda() + .eq(ClassesDictDO::getStatus, "在读")); + } + + @Override + public ClassesDictDO getClassesById(Long studentId) { + return this.baseMapper.getClassesById(studentId); + } + + public String batchUpGrade(BatchUpGradeDTO batchUpGradeDTO){ + + List<Integer> ids = batchUpGradeDTO.getIds(); + + for (Integer id : ids){ + ClassesDictDO classesDictDO = new ClassesDictDO(); + classesDictDO.setId(id); + classesDictDO.setUpgradeDate(batchUpGradeDTO.getUpgradeDate()); + this.baseMapper.updateById(classesDictDO); + } + return ConstantUtils.SUCCESS_UPDATE; + } + +} diff --git a/src/main/java/com/meishu/service/impl/ClassesUserMappingServiceImpl.java b/src/main/java/com/meishu/service/impl/ClassesUserMappingServiceImpl.java new file mode 100644 index 0000000..cb8a79c --- /dev/null +++ b/src/main/java/com/meishu/service/impl/ClassesUserMappingServiceImpl.java @@ -0,0 +1,20 @@ +package com.meishu.service.impl; + +import com.meishu.model.ClassesUserMappingDO; +import com.meishu.mapper.ClassesUserMappingMapper; +import com.meishu.service.ClassesUserMappingService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + * <p> + * 班级--学生--映射表(包括以前的班级) 服务实现类 + * </p> + * + * @author Tuyp + * @since 2021-08-17 + */ +@Service +public class ClassesUserMappingServiceImpl extends ServiceImpl<ClassesUserMappingMapper, ClassesUserMappingDO> implements ClassesUserMappingService { + +} diff --git a/src/main/java/com/meishu/service/impl/CourseAdministerMappingServiceImpl.java b/src/main/java/com/meishu/service/impl/CourseAdministerMappingServiceImpl.java new file mode 100644 index 0000000..944831f --- /dev/null +++ b/src/main/java/com/meishu/service/impl/CourseAdministerMappingServiceImpl.java @@ -0,0 +1,20 @@ +package com.meishu.service.impl; + +import com.meishu.model.CourseAdministerMappingDO; +import com.meishu.mapper.CourseAdministerMappingMapper; +import com.meishu.service.CourseAdministerMappingService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + * <p> + * 课程老师映射表 服务实现类 + * </p> + * + * @author Tuyp + * @since 2021-05-25 + */ +@Service +public class CourseAdministerMappingServiceImpl extends ServiceImpl<CourseAdministerMappingMapper, CourseAdministerMappingDO> implements CourseAdministerMappingService { + +} diff --git a/src/main/java/com/meishu/service/impl/CourseStudentStatusHistoryServiceImpl.java b/src/main/java/com/meishu/service/impl/CourseStudentStatusHistoryServiceImpl.java new file mode 100644 index 0000000..28da90c --- /dev/null +++ b/src/main/java/com/meishu/service/impl/CourseStudentStatusHistoryServiceImpl.java @@ -0,0 +1,20 @@ +package com.meishu.service.impl; + +import com.meishu.model.CourseStudentStatusHistoryDO; +import com.meishu.mapper.CourseStudentStatusHistoryMapper; +import com.meishu.service.CourseStudentStatusHistoryService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + * <p> + * 服务实现类 + * </p> + * + * @author Tuyp + * @since 2021-05-27 + */ +@Service +public class CourseStudentStatusHistoryServiceImpl extends ServiceImpl<CourseStudentStatusHistoryMapper, CourseStudentStatusHistoryDO> implements CourseStudentStatusHistoryService { + +} diff --git a/src/main/java/com/meishu/service/impl/CourseTreeExerciseStudentResultServiceImpl.java b/src/main/java/com/meishu/service/impl/CourseTreeExerciseStudentResultServiceImpl.java new file mode 100644 index 0000000..814b904 --- /dev/null +++ b/src/main/java/com/meishu/service/impl/CourseTreeExerciseStudentResultServiceImpl.java @@ -0,0 +1,20 @@ +package com.meishu.service.impl; + +import com.meishu.model.CourseTreeExerciseStudentResultDO; +import com.meishu.mapper.CourseTreeExerciseStudentResultMapper; +import com.meishu.service.CourseTreeExerciseStudentResultService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + * <p> + * 课程--学生做题记录 服务实现类 + * </p> + * + * @author Tuyp + * @since 2021-05-25 + */ +@Service +public class CourseTreeExerciseStudentResultServiceImpl extends ServiceImpl<CourseTreeExerciseStudentResultMapper, CourseTreeExerciseStudentResultDO> implements CourseTreeExerciseStudentResultService { + +} diff --git a/src/main/java/com/meishu/service/impl/CourseTreeVodStudentResultServiceImpl.java b/src/main/java/com/meishu/service/impl/CourseTreeVodStudentResultServiceImpl.java new file mode 100644 index 0000000..8a62727 --- /dev/null +++ b/src/main/java/com/meishu/service/impl/CourseTreeVodStudentResultServiceImpl.java @@ -0,0 +1,20 @@ +package com.meishu.service.impl; + +import com.meishu.model.CourseTreeVodStudentResultDO; +import com.meishu.mapper.CourseTreeVodStudentResultMapper; +import com.meishu.service.CourseTreeVodStudentResultService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + * <p> + * 学生视频完成情况 服务实现类 + * </p> + * + * @author Tuyp + * @since 2021-05-20 + */ +@Service +public class CourseTreeVodStudentResultServiceImpl extends ServiceImpl<CourseTreeVodStudentResultMapper, CourseTreeVodStudentResultDO> implements CourseTreeVodStudentResultService { + +} diff --git a/src/main/java/com/meishu/service/impl/CourseVodTreeStudentResultServiceImpl.java b/src/main/java/com/meishu/service/impl/CourseVodTreeStudentResultServiceImpl.java new file mode 100644 index 0000000..6c18a64 --- /dev/null +++ b/src/main/java/com/meishu/service/impl/CourseVodTreeStudentResultServiceImpl.java @@ -0,0 +1,20 @@ +package com.meishu.service.impl; + +import com.meishu.model.CourseTreeVodStudentResultDO; +import com.meishu.mapper.CourseVodTressStudentResultMapper; +import com.meishu.service.CourseTreeVodStudentResultService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + * <p> + * 学生视频完成情况 服务实现类 + * </p> + * + * @author Tuyp + * @since 2021-05-13 + */ +@Service +public class CourseVodTreeStudentResultServiceImpl extends ServiceImpl<CourseVodTressStudentResultMapper, CourseTreeVodStudentResultDO> implements CourseTreeVodStudentResultService { + +} diff --git a/src/main/java/com/meishu/service/impl/DepartmentDictServiceImpl.java b/src/main/java/com/meishu/service/impl/DepartmentDictServiceImpl.java new file mode 100644 index 0000000..7b0dc6c --- /dev/null +++ b/src/main/java/com/meishu/service/impl/DepartmentDictServiceImpl.java @@ -0,0 +1,285 @@ +package com.meishu.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.meishu.common.exception.HttpException; +import com.meishu.dto.department.BatchOprDTO; +import com.meishu.dto.department.GetAllDepartmentVO; +import com.meishu.dto.department.GetTeachersDTO; +import com.meishu.dto.subject.GetSubjectTreeDTO; +import com.meishu.mapper.AdministerDepartmentMappingMapper; +import com.meishu.mapper.AdministerMapper; +import com.meishu.model.*; +import com.meishu.mapper.DepartmentDictMapper; +import com.meishu.service.DepartmentDictService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.meishu.util.ConstantUtils; +import com.meishu.vo.administer.GetTeachersVO; +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; + +/** + * <p> + * 部门字典表 服务实现类 + * </p> + * + * @author Tuyp + * @since 2021-04-25 + */ +@Service +public class DepartmentDictServiceImpl extends ServiceImpl<DepartmentDictMapper, DepartmentDictDO> implements DepartmentDictService { + + @Autowired + private AdministerMapper administerMapper; + + @Autowired + private AdministerDepartmentMappingMapper administerDepartmentMappingMapper; + + public List<GetAllDepartmentVO> getDepartmentInfo() { + + //返回结果 + List<GetAllDepartmentVO> getAllDepartmentVOS = new ArrayList<>(); + + //获取所有的父节点 + List<DepartmentDictDO> parentNodes = this.baseMapper.selectList(new QueryWrapper<DepartmentDictDO>() + .lambda() + .isNull(DepartmentDictDO::getParentId)); + + //遍历父节点 + for (DepartmentDictDO departmentDictDO : parentNodes) { + GetAllDepartmentVO getAllDepartmentVO = new GetAllDepartmentVO(); + BeanUtils.copyProperties(departmentDictDO, getAllDepartmentVO); + if (null != departmentDictDO.getParentId()) { + DepartmentDictDO departmentDictDO1 = this.baseMapper.selectById(departmentDictDO.getParentId()); + getAllDepartmentVO.setParentDepartmentName(departmentDictDO1.getDepartmentName()); + } + getAllDepartmentVO.setChildren(getChildNodes(getAllDepartmentVO)); + AdministerDO administerDO = administerMapper.selectById(getAllDepartmentVO.getDepartmentLeaderId()); + if (null != administerDO) { + List<AdministerDepartmentMappingDO> administerDepartmentMappingDOS = administerDepartmentMappingMapper.selectList(new QueryWrapper<AdministerDepartmentMappingDO>() + .lambda() + .eq(AdministerDepartmentMappingDO::getAdministerId, administerDO.getId())); + getAllDepartmentVO.setAdministerDepartmentMappingDOS(administerDepartmentMappingDOS); + getAllDepartmentVO.setAdministerId(administerDO.getId()); + getAllDepartmentVO.setUserName(administerDO.getUserName()); + getAllDepartmentVO.setImg(administerDO.getImg()); + } + Integer count = administerDepartmentMappingMapper.selectCount(new QueryWrapper<AdministerDepartmentMappingDO>() + .lambda() + .eq(AdministerDepartmentMappingDO::getDepartmentId, departmentDictDO.getId())); + getAllDepartmentVO.setCount(count); + //部门人员 + List<AdministerDO> administerDOS = administerMapper.getAdministerByDepartmentId(departmentDictDO.getId()); + getAllDepartmentVO.setAdministerDOS(administerDOS); + + getAllDepartmentVOS.add(getAllDepartmentVO); + } + return getAllDepartmentVOS; + } + + public List<DepartmentDictDO> getDepartmentList(GetSubjectTreeDTO getSubjectTreeDTO) { + + //查看角色所在部门 + List<DepartmentDictDO> departmentDictDOS = administerMapper.getDepartmentByAdministerId(getSubjectTreeDTO.getUserId()); + + List<Long> ids = new ArrayList<>(); + for (DepartmentDictDO departmentDictDO : departmentDictDOS) { + ids.add(departmentDictDO.getId()); + } + + List<DepartmentDictDO> parentNodes = this.baseMapper.selectList(new QueryWrapper<DepartmentDictDO>() + .lambda() + .eq(DepartmentDictDO::getParentId, 1) + .in(DepartmentDictDO::getId, ids)); + + for (DepartmentDictDO departmentDictDO : parentNodes) { + departmentDictDO.setChildren(getChildNodes(departmentDictDO)); + } + return parentNodes; + } + + public String addDepartment(DepartmentDictDO departmentDictDO) { + Integer count = this.baseMapper.selectCount(new QueryWrapper<DepartmentDictDO>() + .lambda() + .eq(DepartmentDictDO::getDepartmentName, departmentDictDO.getDepartmentName())); + + if (count > 0) { + throw new HttpException(20001); + } + + this.baseMapper.insert(departmentDictDO); + return ConstantUtils.ADD_SUCCESS; + } + + public IPage<GetTeachersVO> getTeachers(GetTeachersDTO getTeachersDTO) { + + Page pager = new Page(getTeachersDTO.getPageNum(), getTeachersDTO.getPageSize()); + + List<Long> userIds = new ArrayList<>(); + + //查看该角色所在部门 + if (null == getTeachersDTO.getDepartmentId()){ + List<DepartmentDictDO> departmentDictDOS = administerMapper.getDepartmentByAdministerId(getTeachersDTO.getUserId()); + for (DepartmentDictDO departmentDictDO : departmentDictDOS){ + userIds.add(departmentDictDO.getId()); + } + } + + IPage<GetTeachersVO> getTeachersVOIPage = administerMapper.getDepartmentTeachers(pager, getTeachersDTO.getDepartmentId(), getTeachersDTO.getCampusId(), getTeachersDTO.getUserName(),userIds); + List<GetTeachersVO> getTeachersVOS = getTeachersVOIPage.getRecords(); + for (GetTeachersVO getTeachersVO : getTeachersVOS) { +// List<CampusDictDO> campusDictDOS = administerMapper.getTeacherCampus(getTeachersVO.getId()); +// getTeachersVO.setCampusDictDOS(campusDictDOS); + //部门 + List<DepartmentDictDO> departmentDictDOS = administerMapper.getDepartmentByAdministerId(getTeachersVO.getId()); + getTeachersVO.setDepartmentDictDOS(departmentDictDOS); + + //科目 + List<KnowledgeSubjectDictDO> knowledgeSubjectDicts = administerMapper.getTeacherSubjects(getTeachersVO.getId()); + getTeachersVO.setKnowledgeSubjectDicts(knowledgeSubjectDicts); + + //角色 + List<RoleDictDO> roleDictDOS = administerMapper.getTeacherRoles(getTeachersVO.getId()); + getTeachersVO.setRoleDictDOS(roleDictDOS); + + //多个在读班级 + List<SubjectDictDO> subjectDictDOS = administerMapper.getTeacherClasses(getTeachersVO.getId()); + getTeachersVO.setSubjectDictDOS(subjectDictDOS); + + } + return getTeachersVOIPage; + } + + public String batchOpr(BatchOprDTO batchOprDTO) { + + List<Long> longs = batchOprDTO.getIds(); + for (Long lg : longs) { + DepartmentDictDO departmentDictDO = this.baseMapper.selectById(lg); + if (null != batchOprDTO.getDepartmentLeaderId()) { + departmentDictDO.setDepartmentLeaderId(batchOprDTO.getDepartmentLeaderId()); + } + if (null != batchOprDTO.getParentId()) { + departmentDictDO.setParentId(batchOprDTO.getParentId()); + } + this.baseMapper.updateById(departmentDictDO); + } + return ConstantUtils.SUCCESS_UPDATE; + } + + + public String deleteDepartment(BatchOprDTO batchOprDTO) { + + List<Long> longs = batchOprDTO.getIds(); + + for (Long lg : longs) { + List<DepartmentDictDO> departmentDictDOS = this.baseMapper.selectList(new QueryWrapper<DepartmentDictDO>() + .lambda() + .eq(DepartmentDictDO::getParentId, lg) + ); + + for (DepartmentDictDO departmentDictDO1 : departmentDictDOS) { + deleteChildNode(departmentDictDO1); + } + this.baseMapper.deleteById(lg); + } + + return ConstantUtils.DELETE_SUCCESS; + } + + public String updateDepartment(DepartmentDictDO departmentDictDO) { + this.baseMapper.updateById(departmentDictDO); + return ConstantUtils.SUCCESS_UPDATE; + } + + void deleteChildNode(DepartmentDictDO departmentDictDO) { + + List<DepartmentDictDO> departmentDictDOS = this.baseMapper.selectList(new QueryWrapper<DepartmentDictDO>() + .lambda() + .eq(DepartmentDictDO::getParentId, departmentDictDO.getId())); + + for (DepartmentDictDO departmentDictDO1 : departmentDictDOS) { + deleteChildNode(departmentDictDO1); + } + this.baseMapper.deleteById(departmentDictDO.getId()); + } + + + /** + * 递归 带上部门总数,部门负责人等参数 + * + * @param getAllDepartmentVO 父节点查找该节点的children + * @return 子节点 + */ + public List<GetAllDepartmentVO> getChildNodes(GetAllDepartmentVO getAllDepartmentVO) { + + List<GetAllDepartmentVO> getAllDepartmentVOS = new ArrayList<>(); + + //查询该节点的子节点 + List<DepartmentDictDO> departmentDictDOS = this.baseMapper.selectList(new QueryWrapper<DepartmentDictDO>() + .lambda() + .eq(DepartmentDictDO::getParentId, getAllDepartmentVO.getId())); + + //递归 + for (DepartmentDictDO dd : departmentDictDOS) { + GetAllDepartmentVO getAllDepartmentVO1 = new GetAllDepartmentVO(); + BeanUtils.copyProperties(dd, getAllDepartmentVO1); + if (null != dd.getParentId()) { + DepartmentDictDO departmentDictDO = this.baseMapper.selectById(dd.getParentId()); + getAllDepartmentVO1.setParentDepartmentName(departmentDictDO.getDepartmentName()); + } + getAllDepartmentVO1.setChildren(getChildNodes(getAllDepartmentVO1)); + AdministerDO administerDO = administerMapper.selectById(getAllDepartmentVO1.getDepartmentLeaderId()); + if (null != administerDO) { + List<AdministerDepartmentMappingDO> administerDepartmentMappingDOS = administerDepartmentMappingMapper.selectList(new QueryWrapper<AdministerDepartmentMappingDO>() + .lambda() + .eq(AdministerDepartmentMappingDO::getAdministerId, administerDO.getId())); + getAllDepartmentVO1.setAdministerDepartmentMappingDOS(administerDepartmentMappingDOS); + getAllDepartmentVO1.setUserName(administerDO.getUserName()); + getAllDepartmentVO1.setImg(administerDO.getImg()); + getAllDepartmentVO1.setAdministerId(administerDO.getId()); + } + Integer count = administerDepartmentMappingMapper.selectCount(new QueryWrapper<AdministerDepartmentMappingDO>() + .lambda() + .eq(AdministerDepartmentMappingDO::getDepartmentId, dd.getId())); + getAllDepartmentVO1.setCount(count); + //部门人员 + List<AdministerDO> administerDOS = administerMapper.getAdministerByDepartmentId(dd.getId()); + getAllDepartmentVO1.setAdministerDOS(administerDOS); + getAllDepartmentVOS.add(getAllDepartmentVO1); + } + if (departmentDictDOS.size() == 0) { + return null; + } + + return getAllDepartmentVOS; + } + + /** + * 递归部门列表 不包含老师信息和人数信息 + * + * @param departmentDictDO + * @return + */ + public List<DepartmentDictDO> getChildNodes(DepartmentDictDO departmentDictDO) { + + List<DepartmentDictDO> departmentDictDOS = this.baseMapper.selectList(new QueryWrapper<DepartmentDictDO>() + .lambda() + .eq(DepartmentDictDO::getParentId, departmentDictDO.getId())); + + for (DepartmentDictDO departmentDictDO1 : departmentDictDOS) { + departmentDictDO1.setChildren(getChildNodes(departmentDictDO1)); + } + + if (departmentDictDOS.size() == 0) { + return null; + } + return departmentDictDOS; + } + + +} diff --git a/src/main/java/com/meishu/service/impl/ExerciseCourseTreeMappingServiceImpl.java b/src/main/java/com/meishu/service/impl/ExerciseCourseTreeMappingServiceImpl.java new file mode 100644 index 0000000..e5112eb --- /dev/null +++ b/src/main/java/com/meishu/service/impl/ExerciseCourseTreeMappingServiceImpl.java @@ -0,0 +1,45 @@ +package com.meishu.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.meishu.dto.exercise.QueryCourseTreeExerciseDTO; +import com.meishu.dto.exercise.UpdateStatusDTO; +import com.meishu.model.CourseTreeDO; +import com.meishu.model.ExerciseCourseTreeMappingDO; +import com.meishu.mapper.ExerciseCourseTreeMappingMapper; +import com.meishu.service.ExerciseCourseTreeMappingService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.meishu.util.ConstantUtils; +import com.meishu.vo.exercise.QueryCourseTreeExerciseVO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * <p> + * 课程知识树--题目字典表 服务实现类 + * </p> + * + * @author Tuyp + * @since 2021-05-24 + */ +@Service +public class ExerciseCourseTreeMappingServiceImpl extends ServiceImpl<ExerciseCourseTreeMappingMapper, ExerciseCourseTreeMappingDO> implements ExerciseCourseTreeMappingService { + + @Autowired + private ExerciseCourseTreeMappingMapper exerciseCourseTreeMappingMapper; + + public String updateStatus(UpdateStatusDTO updateStatusDTO){ + + List<Long> ids = updateStatusDTO.getIds(); + for (Long lg : ids){ + ExerciseCourseTreeMappingDO exerciseCourseTreeMappingDO = this.baseMapper.selectById(lg); + exerciseCourseTreeMappingDO.setStatus(updateStatusDTO.getStatus()); + this.baseMapper.updateById(exerciseCourseTreeMappingDO); + } + return ConstantUtils.SET_SUCCESS; + } + +} diff --git a/src/main/java/com/meishu/service/impl/ExerciseDictServiceImpl.java b/src/main/java/com/meishu/service/impl/ExerciseDictServiceImpl.java new file mode 100644 index 0000000..4af7b0b --- /dev/null +++ b/src/main/java/com/meishu/service/impl/ExerciseDictServiceImpl.java @@ -0,0 +1,291 @@ +package com.meishu.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.meishu.dto.exercise.AddExerciseDTO; +import com.meishu.dto.exercise.CheckExerciseDTO; +import com.meishu.dto.exercise.GetTreeExercisesDTO; +import com.meishu.dto.voddict.GetToCheckVodCountsDTO; +import com.meishu.dto.voddict.PublicCheckingDTO; +import com.meishu.mapper.*; +import com.meishu.model.*; +import com.meishu.service.ExerciseDictService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.meishu.util.ConstantUtils; +import com.meishu.vo.exercise.GetExerciseDetailVO; +import com.meishu.vo.exercise.GetTreeExercisesVO; +import com.meishu.vo.voddict.GetToCheckCountsVO; +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.LocalDateTime; +import java.util.ArrayList; +import java.util.List; + +/** + * <p> + * 习题库 服务实现类 + * </p> + * + * @author Tuyp + * @since 2021-04-27 + */ +@Service +public class ExerciseDictServiceImpl extends ServiceImpl<ExerciseDictMapper, ExerciseDictDO> implements ExerciseDictService { + + @Autowired + private ExerciseTreeMappingMapper exerciseTreeMappingMapper; + + @Autowired + private KnowledgeSubjectDictMapper knowledgeSubjectDictMapper; + + @Autowired + private AdministerMapper administerMapper; + + public IPage<GetTreeExercisesVO> getTreeExercises(GetTreeExercisesDTO getTreeExercisesDTO) { + + Page pager = new Page(getTreeExercisesDTO.getPageNum(), getTreeExercisesDTO.getPageSize()); + + KnowledgeSubjectDictDO subjectDictDO = knowledgeSubjectDictMapper.selectById(getTreeExercisesDTO.getSubjectId()); + + if ("1".equals(getTreeExercisesDTO.getShareStatus())) { + getTreeExercisesDTO.setUserId(null); + } + + //查看该老师的科目信息 + List<KnowledgeSubjectDictDO> subjectDictDOS = administerMapper.getTeacherSubjects(getTreeExercisesDTO.getUserId()); + + List<String> strings = new ArrayList<>(); + for (KnowledgeSubjectDictDO subjectDictDO1 : subjectDictDOS) { + strings.add(subjectDictDO1.getSubjectEn()); + } + + IPage<GetTreeExercisesVO> getTreeExercisesVOIPage = this.baseMapper.getTreeExercises(pager, getTreeExercisesDTO.getUserId(), subjectDictDO.getSubjectEn(), getTreeExercisesDTO.getTreeId(), getTreeExercisesDTO.getExerciseType(), getTreeExercisesDTO.getDifficulty(), getTreeExercisesDTO.getTitle(), getTreeExercisesDTO.getShareStatus(),getTreeExercisesDTO.getCheckStatus(),strings); + + List<GetTreeExercisesVO> getTreeExercisesVOS = getTreeExercisesVOIPage.getRecords(); + for (GetTreeExercisesVO getTreeExercisesVO : getTreeExercisesVOS) { + //找知识树 + List<SubjectTreeDO> subjectTreeDOS = this.baseMapper.getTrees(getTreeExercisesVO.getId()); + getTreeExercisesVO.setSubjectTreeDOS(subjectTreeDOS); + } + getTreeExercisesVOIPage.setRecords(getTreeExercisesVOS); + return getTreeExercisesVOIPage; + } + + public IPage<GetTreeExercisesVO> getCheckTreeExercises(GetTreeExercisesDTO getTreeExercisesDTO){ + + Page pager = new Page(getTreeExercisesDTO.getPageNum(), getTreeExercisesDTO.getPageSize()); + + KnowledgeSubjectDictDO subjectDictDO = knowledgeSubjectDictMapper.selectById(getTreeExercisesDTO.getSubjectId()); + + //查看该老师的科目信息 + List<KnowledgeSubjectDictDO> subjectDictDOS = administerMapper.getTeacherSubjects(getTreeExercisesDTO.getUserId()); + + List<String> strings = new ArrayList<>(); + for (KnowledgeSubjectDictDO subjectDictDO1 : subjectDictDOS) { + strings.add(subjectDictDO1.getSubjectEn()); + } + + IPage<GetTreeExercisesVO> getTreeExercisesVOIPage = this.baseMapper.getTreeExercises(pager, null, subjectDictDO.getSubjectEn(), getTreeExercisesDTO.getTreeId(), getTreeExercisesDTO.getExerciseType(), getTreeExercisesDTO.getDifficulty(), getTreeExercisesDTO.getTitle(), getTreeExercisesDTO.getShareStatus(),getTreeExercisesDTO.getCheckStatus(),strings); + + List<GetTreeExercisesVO> getTreeExercisesVOS = getTreeExercisesVOIPage.getRecords(); + for (GetTreeExercisesVO getTreeExercisesVO : getTreeExercisesVOS) { + //找知识树 + List<SubjectTreeDO> subjectTreeDOS = this.baseMapper.getTrees(getTreeExercisesVO.getId()); + getTreeExercisesVO.setSubjectTreeDOS(subjectTreeDOS); + } + getTreeExercisesVOIPage.setRecords(getTreeExercisesVOS); + return getTreeExercisesVOIPage; + + } + + @Transactional(rollbackFor = Exception.class) + public String deleteExercise(ExerciseDictDO exerciseDictDO) { + +// Integer count = exerciseCourseTreeMappingMapper.selectCount(new QueryWrapper<ExerciseCourseTreeMappingDO>() +// .lambda() +// .eq(ExerciseCourseTreeMappingDO::getExerciseId, exerciseDictDO.getId())); +// +// if (count > 0) { +// throw new HttpException(30003); +// } +// + this.baseMapper.deleteById(exerciseDictDO.getId()); + + //删相关树 + exerciseTreeMappingMapper.delete(new QueryWrapper<ExerciseTreeMappingDO>() + .lambda() + .eq(ExerciseTreeMappingDO::getExerciseId, exerciseDictDO.getId())); + +// //删相关做题记录 +// exerciseDoneHistoryMapper.delete(new QueryWrapper<ExerciseDoneHistoryDO>() +// .lambda() +// .eq(ExerciseDoneHistoryDO::getExerciseId, exerciseDictDO.getId())); + + return ConstantUtils.DELETE_SUCCESS; + } + + @Transactional(rollbackFor = Exception.class) + public String addExercise(AddExerciseDTO addExerciseDTO) { + ExerciseDictDO exerciseDictDO = new ExerciseDictDO(); + KnowledgeSubjectDictDO subjectDictDO = knowledgeSubjectDictMapper.selectById(addExerciseDTO.getSubjectId()); + BeanUtils.copyProperties(addExerciseDTO, exerciseDictDO); + exerciseDictDO.setShareStatus("0"); + exerciseDictDO.setCheckStatus("0"); + exerciseDictDO.setSubjectId(subjectDictDO.getSubjectEn()); + this.baseMapper.insert(exerciseDictDO); + + List<Long> longs = addExerciseDTO.getTreeIds(); + for (Long lg : longs) { + ExerciseTreeMappingDO exerciseTreeMappingDO = new ExerciseTreeMappingDO(); + exerciseTreeMappingDO.setTreeId(lg); + exerciseTreeMappingDO.setExerciseId(exerciseDictDO.getId()); + exerciseTreeMappingMapper.insert(exerciseTreeMappingDO); + +// //新增的题目也要加到courseTree里去 +// List<CourseTreeDO> courseTreeDOS = courseTreeMapper.selectList(new QueryWrapper<CourseTreeDO>() +// .lambda() +// .eq(CourseTreeDO::getTreeId, lg)); +// +// for (CourseTreeDO courseTreeDO : courseTreeDOS) { +// ExerciseCourseTreeMappingDO exerciseCourseTreeMappingDO = new ExerciseCourseTreeMappingDO(); +// exerciseCourseTreeMappingDO.setExerciseId(exerciseDictDO.getId()); +// exerciseCourseTreeMappingDO.setStatus("0"); +// exerciseCourseTreeMappingDO.setCourseTreeId(courseTreeDO.getId()); +// exerciseCourseTreeMappingDO.setCourseId(lg); +// exerciseCourseTreeMappingMapper.insert(exerciseCourseTreeMappingDO); +// } + } + return ConstantUtils.ADD_SUCCESS; + } + + @Transactional(rollbackFor = Exception.class) + public String updateExercise(AddExerciseDTO addExerciseDTO) { + ExerciseDictDO exerciseDictDO = new ExerciseDictDO(); + BeanUtils.copyProperties(addExerciseDTO, exerciseDictDO); + KnowledgeSubjectDictDO subjectDictDO = knowledgeSubjectDictMapper.selectById(addExerciseDTO.getSubjectId()); + if (null!=subjectDictDO){ + exerciseDictDO.setSubjectId(subjectDictDO.getSubjectEn()); + } + this.baseMapper.updateById(exerciseDictDO); + + exerciseTreeMappingMapper.delete(new QueryWrapper<ExerciseTreeMappingDO>() + .lambda() + .in(ExerciseTreeMappingDO::getExerciseId, addExerciseDTO.getId())); + + List<Long> longs = addExerciseDTO.getTreeIds(); + for (Long lg : longs) { + ExerciseTreeMappingDO exerciseTreeMappingDO = new ExerciseTreeMappingDO(); + exerciseTreeMappingDO.setTreeId(lg); + exerciseTreeMappingDO.setExerciseId(exerciseDictDO.getId()); + exerciseTreeMappingMapper.insert(exerciseTreeMappingDO); + } + return ConstantUtils.SUCCESS_UPDATE; + } + + public GetToCheckCountsVO getToCheckExeCounts(GetToCheckVodCountsDTO getToCheckVodCountsDTO) { + + GetToCheckCountsVO getToCheckCountsVO = new GetToCheckCountsVO(); + + KnowledgeSubjectDictDO subjectDictDO = knowledgeSubjectDictMapper.selectById(getToCheckVodCountsDTO.getSubjectId()); + + Integer count = this.baseMapper.selectCount(new QueryWrapper<ExerciseDictDO>() + .lambda() + .eq(ExerciseDictDO::getCheckStatus, "2") + .eq(ExerciseDictDO::getSubjectId, subjectDictDO.getSubjectEn())); + getToCheckCountsVO.setToCheckCounts(count); + + //已审核 包括已通过 未通过 + Integer counts1 = this.baseMapper.selectCount(new QueryWrapper<ExerciseDictDO>() + .lambda() + .eq(ExerciseDictDO::getSubjectId, subjectDictDO.getSubjectEn()) + .in(ExerciseDictDO::getCheckStatus, new String[]{"1", "3"})); + getToCheckCountsVO.setCheckCounts(counts1); + + return getToCheckCountsVO; + } + + public String checkExercise(CheckExerciseDTO checkExerciseDTO) { + + //审核通过 + if ("1".equals(checkExerciseDTO.getCheckStatus())) { + ExerciseDictDO exerciseDictDO = this.baseMapper.selectById(checkExerciseDTO.getId()); + + exerciseDictDO.setCheckStatus("1");// 已通过审核 + this.baseMapper.updateById(exerciseDictDO); + + exerciseDictDO.setShareStatus("1"); //已共享 + exerciseDictDO.setDifficulty(checkExerciseDTO.getDifficulty()); + exerciseDictDO.setAdviceLength(checkExerciseDTO.getAdviceLength()); + exerciseDictDO.setCreateDate(LocalDateTime.now()); + exerciseDictDO.setUpdateDate(LocalDateTime.now()); + this.baseMapper.insert(exerciseDictDO); + + List<Long> ids = checkExerciseDTO.getTreeIds(); + +// //取消之前的关联 +// exerciseTreeMappingMapper.delete(new QueryWrapper<ExerciseTreeMappingDO>() +// .lambda() +// .eq(ExerciseTreeMappingDO::getExerciseId, checkExerciseDTO.getId())); + + for (Long lg : ids) { + //知识点关联 + ExerciseTreeMappingDO exerciseTreeMappingDO = new ExerciseTreeMappingDO(); + exerciseTreeMappingDO.setExerciseId(exerciseDictDO.getId()); + exerciseTreeMappingDO.setTreeId(lg); + exerciseDictDO.setStatus("0"); //不是关联习题 + exerciseTreeMappingMapper.insert(exerciseTreeMappingDO); + } + } else { + //不通过 + ExerciseDictDO exerciseDictDO = new ExerciseDictDO(); + BeanUtils.copyProperties(checkExerciseDTO, exerciseDictDO); + this.baseMapper.updateById(exerciseDictDO); + } + + return ConstantUtils.CHECK_STATUS; + } + + public IPage<ExerciseDictDO> publicUpload(PublicCheckingDTO publicCheckingDTO) { + + Page pager = new Page(publicCheckingDTO.getPageNum(), publicCheckingDTO.getPageSize()); + return this.baseMapper.selectPage(pager, new QueryWrapper<ExerciseDictDO>() + .lambda() + .eq(ExerciseDictDO::getAdministerId, publicCheckingDTO.getUserId()) + .eq(ExerciseDictDO::getCheckStatus, publicCheckingDTO.getCheckStatus())); + } + + public String withdraw(ExerciseDictDO exerciseDictDO) { + exerciseDictDO.setShareStatus("0"); + exerciseDictDO.setCheckStatus("0"); + this.baseMapper.updateById(exerciseDictDO); + return ConstantUtils.SET_SUCCESS; + } + + public GetExerciseDetailVO getExerciseDetail(ExerciseDictDO exerciseDictDO) { + + GetExerciseDetailVO getExerciseDetailVO = new GetExerciseDetailVO(); + ExerciseDictDO exerciseDictDO1 = this.baseMapper.selectById(exerciseDictDO.getId()); + BeanUtils.copyProperties(exerciseDictDO1, getExerciseDetailVO); + + List<SubjectTreeDO> subjectTreeDOS = this.baseMapper.getTrees(exerciseDictDO.getId()); + getExerciseDetailVO.setSubjectTreeDOS(subjectTreeDOS); + return getExerciseDetailVO; + } + + public String setRelatedExercise(ExerciseTreeMappingDO exerciseTreeMappingDO){ + + ExerciseTreeMappingDO exerciseTreeMappingDO1 = new ExerciseTreeMappingDO(); + exerciseTreeMappingDO1.setStatus(exerciseTreeMappingDO.getStatus()); + + exerciseTreeMappingMapper.update(exerciseTreeMappingDO1,new QueryWrapper<ExerciseTreeMappingDO>() + .lambda() + .eq(ExerciseTreeMappingDO::getExerciseId,exerciseTreeMappingDO.getExerciseId())); + + return ConstantUtils.SUCCESS_UPDATE; + } + +} diff --git a/src/main/java/com/meishu/service/impl/ExerciseDoneHistoryServiceImpl.java b/src/main/java/com/meishu/service/impl/ExerciseDoneHistoryServiceImpl.java new file mode 100644 index 0000000..930ea54 --- /dev/null +++ b/src/main/java/com/meishu/service/impl/ExerciseDoneHistoryServiceImpl.java @@ -0,0 +1,20 @@ +package com.meishu.service.impl; + +import com.meishu.model.ExerciseDoneHistoryDO; +import com.meishu.mapper.ExerciseDoneHistoryMapper; +import com.meishu.service.ExerciseDoneHistoryService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + * <p> + * 学生做题记录表 服务实现类 + * </p> + * + * @author Tuyp + * @since 2021-04-27 + */ +@Service +public class ExerciseDoneHistoryServiceImpl extends ServiceImpl<ExerciseDoneHistoryMapper, ExerciseDoneHistoryDO> implements ExerciseDoneHistoryService { + +} diff --git a/src/main/java/com/meishu/service/impl/ExerciseExpandMappingServiceImpl.java b/src/main/java/com/meishu/service/impl/ExerciseExpandMappingServiceImpl.java new file mode 100644 index 0000000..ee7e1b6 --- /dev/null +++ b/src/main/java/com/meishu/service/impl/ExerciseExpandMappingServiceImpl.java @@ -0,0 +1,20 @@ +package com.meishu.service.impl; + +import com.meishu.model.ExerciseExpandMappingDO; +import com.meishu.mapper.ExerciseExpandMappingMapper; +import com.meishu.service.ExerciseExpandMappingService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + * <p> + * 学生--拓展习题映射表 服务实现类 + * </p> + * + * @author DengMin + * @since 2021-09-16 + */ +@Service +public class ExerciseExpandMappingServiceImpl extends ServiceImpl<ExerciseExpandMappingMapper, ExerciseExpandMappingDO> implements ExerciseExpandMappingService { + +} diff --git a/src/main/java/com/meishu/service/impl/ExerciseRelatedMappingServiceImpl.java b/src/main/java/com/meishu/service/impl/ExerciseRelatedMappingServiceImpl.java new file mode 100644 index 0000000..3867fec --- /dev/null +++ b/src/main/java/com/meishu/service/impl/ExerciseRelatedMappingServiceImpl.java @@ -0,0 +1,20 @@ +package com.meishu.service.impl; + +import com.meishu.model.ExerciseRelatedMappingDO; +import com.meishu.mapper.ExerciseRelatedMappingMapper; +import com.meishu.service.ExerciseRelatedMappingService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + * <p> + * 学生--拓展习题映射表 服务实现类 + * </p> + * + * @author DengMin + * @since 2021-09-28 + */ +@Service +public class ExerciseRelatedMappingServiceImpl extends ServiceImpl<ExerciseRelatedMappingMapper, ExerciseRelatedMappingDO> implements ExerciseRelatedMappingService { + +} diff --git a/src/main/java/com/meishu/service/impl/ExerciseTreeMappingServiceImpl.java b/src/main/java/com/meishu/service/impl/ExerciseTreeMappingServiceImpl.java new file mode 100644 index 0000000..08c5df0 --- /dev/null +++ b/src/main/java/com/meishu/service/impl/ExerciseTreeMappingServiceImpl.java @@ -0,0 +1,20 @@ +package com.meishu.service.impl; + +import com.meishu.model.ExerciseTreeMappingDO; +import com.meishu.mapper.ExerciseTreeMappingMapper; +import com.meishu.service.ExerciseTreeMappingService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + * <p> + * 题目知识树映射表 服务实现类 + * </p> + * + * @author Tuyp + * @since 2021-04-27 + */ +@Service +public class ExerciseTreeMappingServiceImpl extends ServiceImpl<ExerciseTreeMappingMapper, ExerciseTreeMappingDO> implements ExerciseTreeMappingService { + +} diff --git a/src/main/java/com/meishu/service/impl/ExerciseUserInfoServiceImpl.java b/src/main/java/com/meishu/service/impl/ExerciseUserInfoServiceImpl.java new file mode 100644 index 0000000..0c4af34 --- /dev/null +++ b/src/main/java/com/meishu/service/impl/ExerciseUserInfoServiceImpl.java @@ -0,0 +1,20 @@ +package com.meishu.service.impl; + +import com.meishu.model.ExerciseUserInfoDO; +import com.meishu.mapper.ExerciseUserInfoMapper; +import com.meishu.service.ExerciseUserInfoService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + * <p> + * 题目收藏信息表 服务实现类 + * </p> + * + * @author DengMin + * @since 2021-09-17 + */ +@Service +public class ExerciseUserInfoServiceImpl extends ServiceImpl<ExerciseUserInfoMapper, ExerciseUserInfoDO> implements ExerciseUserInfoService { + +} diff --git a/src/main/java/com/meishu/service/impl/KnowledgeSubjectDictServiceImpl.java b/src/main/java/com/meishu/service/impl/KnowledgeSubjectDictServiceImpl.java new file mode 100644 index 0000000..6d2a387 --- /dev/null +++ b/src/main/java/com/meishu/service/impl/KnowledgeSubjectDictServiceImpl.java @@ -0,0 +1,171 @@ +package com.meishu.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.meishu.dto.subject.GetSubjectAdministerDTO; +import com.meishu.dto.subject.GetSubjectTreeDTO; +import com.meishu.dto.subject.GetSubjectsDTO; +import com.meishu.mapper.AdministerMapper; +import com.meishu.mapper.SubjectTreeMapper; +import com.meishu.model.*; +import com.meishu.mapper.KnowledgeSubjectDictMapper; +import com.meishu.service.KnowledgeSubjectDictService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.meishu.util.ConstantUtils; +import com.meishu.util.tree.SerialNumber; +import com.meishu.vo.subject.GetSubjectTreeVO; +import com.meishu.vo.subject.SubjectTreeOrder; +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; + +/** + * <p> + * 学科字典表 服务实现类 + * </p> + * + * @author Tuyp + * @since 2021-04-27 + */ +@Service +public class KnowledgeSubjectDictServiceImpl extends ServiceImpl<KnowledgeSubjectDictMapper, KnowledgeSubjectDictDO> implements KnowledgeSubjectDictService { + + @Autowired + private SubjectTreeMapper subjectTreeMapper; + + @Autowired + private AdministerMapper administerMapper; + + public IPage<KnowledgeSubjectDictDO> getSubjects(GetSubjectsDTO getSubjectsDTO) { + Page pager = new Page(getSubjectsDTO.getPageNum(), getSubjectsDTO.getPageSize()); + return this.baseMapper.getAdministerSubjects(pager, getSubjectsDTO.getUserId(), getSubjectsDTO.getSubjectType(), getSubjectsDTO.getSubjectName()); + } + + public List<KnowledgeSubjectDictDO> getAllSubjects(GetSubjectsDTO getSubjectsDTO) { + return this.baseMapper.selectList(new QueryWrapper<KnowledgeSubjectDictDO>() + .lambda() + .eq(false, KnowledgeSubjectDictDO::getSubjectName, getSubjectsDTO.getSubjectName()) + .eq(false, KnowledgeSubjectDictDO::getSubjectType, getSubjectsDTO.getSubjectType())); + } + + public String updateSubject(KnowledgeSubjectDictDO subjectDictDO) { + this.baseMapper.updateById(subjectDictDO); + return ConstantUtils.SUCCESS_UPDATE; + } + + public String addSubject(KnowledgeSubjectDictDO subjectDictDO) { + this.baseMapper.insert(subjectDictDO); + return ConstantUtils.ADD_SUCCESS; + } + + public String deleteSubject(KnowledgeSubjectDictDO subjectDictDO) { + this.baseMapper.deleteById(subjectDictDO.getId()); + return ConstantUtils.DELETE_SUCCESS; + } + + + public KnowledgeSubjectDictDO getSubject(KnowledgeSubjectDictDO subjectDictDO) { + return this.baseMapper.selectById(subjectDictDO.getId()); + } + + + public List<AdministerDO> getSubjectAdminister(GetSubjectAdministerDTO getSubjectAdministerDTO) { + return this.baseMapper.getSubjectAdminister(getSubjectAdministerDTO.getSubjectId(), getSubjectAdministerDTO.getUserName()); + } + + /** + * 递归遍历子节点 + * + * @param getSubjectTreeVO 父节点填充子节点 + * @return + */ + public List<GetSubjectTreeVO> getChildNodes(GetSubjectTreeVO getSubjectTreeVO, SubjectTreeOrder treeNode,Integer i,boolean flag,List<GetSubjectTreeVO> nodeList,Integer chapterId) { + + List<GetSubjectTreeVO> getSubjectTreeVOS = new ArrayList<>(); + + i++; + + if (i==4 && !flag){ //只看前三层 + return null; + } + getSubjectTreeVO.setLayer(chapterId+""); + if (!"10.1".equals(getSubjectTreeVO.getText()) && !"20.1".equals(getSubjectTreeVO.getText()) && !"30.1".equals(getSubjectTreeVO.getText()) && !"40.1".equals(getSubjectTreeVO.getText()) && !"50.1".equals(getSubjectTreeVO.getText())){ + getSubjectTreeVO.setText(getSubjectTreeVO.getText().replace("0.1",getSubjectTreeVO.getLayer())); + } + getSubjectTreeVO.setTreeNode(getSubjectTreeVO.getText()); + + //查找该父节点下的子节点 + List<SubjectTreeDO> subjectTreeDOS = subjectTreeMapper.selectList(new QueryWrapper<SubjectTreeDO>() + .lambda() + .eq(SubjectTreeDO::getParentId, getSubjectTreeVO.getId()) + .orderByAsc(SubjectTreeDO::getTreeOrder)); + + getSubjectTreeVO.setChildNodeCounts(subjectTreeDOS.size()); + + for (SubjectTreeDO subjectTreeDO1 : subjectTreeDOS) { +// GetSubjectTreeVO getSubjectTreeVO1 = new GetSubjectTreeVO(); + GetSubjectTreeVO getSubjectTreeVO1 =SubjectTreeOrder.getNextNode(treeNode,getSubjectTreeVO,nodeList); + BeanUtils.copyProperties(subjectTreeDO1, getSubjectTreeVO1); + getSubjectTreeVO1.setParentTreeName(getSubjectTreeVO.getTreeName()); + getSubjectTreeVOS.add(getSubjectTreeVO1); + getSubjectTreeVO1.setChildren(getChildNodes(getSubjectTreeVO1, treeNode,i,flag,nodeList,chapterId)); + } + if (subjectTreeDOS.size() == 0) { + return null; + } + return getSubjectTreeVOS; + } + + public List<GetSubjectTreeVO> getSubjectTree(GetSubjectTreeDTO getSubjectTreeDTO) { + + List<GetSubjectTreeVO> getSubjectTreeVOS = new ArrayList<>(); + + SerialNumber number = new SerialNumber(); + SubjectTreeOrder treeNode = new SubjectTreeOrder(".", number); + + //判断老师角色 + List<RoleDictDO> roleDictDOS = administerMapper.getTeacherRoles(getSubjectTreeDTO.getUserId()); + + boolean flag = false; //true 可以看全部的 false 没权限或者是授课老师 只能看三级 + + for (RoleDictDO roleDictDO : roleDictDOS) { + if (roleDictDO.getId() == 1 || roleDictDO.getId() == 2 || roleDictDO.getId() == 4) { + flag = true; + } + } + + //获取科目的父节点 + List<SubjectTreeDO> subjectTreeDOS = subjectTreeMapper.selectList(new QueryWrapper<SubjectTreeDO>() + .lambda() + .eq(SubjectTreeDO::getSubjectId, getSubjectTreeDTO.getSubjectId()) + .isNull(SubjectTreeDO::getParentId) + .orderByAsc(SubjectTreeDO::getTreeOrder)); + + GetSubjectTreeVO root = treeNode.getRoot(treeNode.getNodeList()); + + List<GetSubjectTreeVO> nodeList = new ArrayList<>(); + + //章节id + int chapterId = 1; + + for (SubjectTreeDO std : subjectTreeDOS) { + GetSubjectTreeVO getSubjectTreeVO = SubjectTreeOrder.getNextNode(treeNode,root,nodeList); + BeanUtils.copyProperties(std, getSubjectTreeVO); + int i = 1 ; //第几层 + + + getSubjectTreeVO.setChildren(getChildNodes(getSubjectTreeVO, treeNode,i,flag,nodeList,chapterId)); + getSubjectTreeVO.setLayer(chapterId+""); + chapterId++; + getSubjectTreeVO.setText(getSubjectTreeVO.getText().replace("0.1",getSubjectTreeVO.getLayer())); + getSubjectTreeVO.setTreeNode(getSubjectTreeVO.getText()); + getSubjectTreeVOS.add(getSubjectTreeVO); + } + return getSubjectTreeVOS; + } + +} diff --git a/src/main/java/com/meishu/service/impl/LaboratoryAttendanceMappingServiceImpl.java b/src/main/java/com/meishu/service/impl/LaboratoryAttendanceMappingServiceImpl.java new file mode 100644 index 0000000..476d1aa --- /dev/null +++ b/src/main/java/com/meishu/service/impl/LaboratoryAttendanceMappingServiceImpl.java @@ -0,0 +1,20 @@ +package com.meishu.service.impl; + +import com.meishu.model.LaboratoryAttendanceMappingDO; +import com.meishu.mapper.LaboratoryAttendanceMappingMapper; +import com.meishu.service.LaboratoryAttendanceMappingService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + * <p> + * 实验室场次预约考勤记录 服务实现类 + * </p> + * + * @author DengMin + * @since 2021-09-15 + */ +@Service +public class LaboratoryAttendanceMappingServiceImpl extends ServiceImpl<LaboratoryAttendanceMappingMapper, LaboratoryAttendanceMappingDO> implements LaboratoryAttendanceMappingService { + +} diff --git a/src/main/java/com/meishu/service/impl/LaboratoryDictMappingServiceImpl.java b/src/main/java/com/meishu/service/impl/LaboratoryDictMappingServiceImpl.java new file mode 100644 index 0000000..9b9449a --- /dev/null +++ b/src/main/java/com/meishu/service/impl/LaboratoryDictMappingServiceImpl.java @@ -0,0 +1,22 @@ +package com.meishu.service.impl; + +import com.meishu.model.LaboratoryDictMappingDO; +import com.meishu.mapper.LaboratoryDictMappingMapper; +import com.meishu.service.LaboratoryDictMappingService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * <p> + * 实验室场次关联表 服务实现类 + * </p> + * + * @author DengMin + * @since 2021-08-30 + */ +@Service +public class LaboratoryDictMappingServiceImpl extends ServiceImpl<LaboratoryDictMappingMapper, LaboratoryDictMappingDO> implements LaboratoryDictMappingService { + +} diff --git a/src/main/java/com/meishu/service/impl/LaboratoryDictServiceImpl.java b/src/main/java/com/meishu/service/impl/LaboratoryDictServiceImpl.java new file mode 100644 index 0000000..77def4b --- /dev/null +++ b/src/main/java/com/meishu/service/impl/LaboratoryDictServiceImpl.java @@ -0,0 +1,115 @@ +package com.meishu.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.meishu.dto.laboratory.LaboratoryDictDTO; +import com.meishu.dto.laboratory.LaboratoryPageDTO; +import com.meishu.model.LaboratoryDictDO; +import com.meishu.mapper.LaboratoryDictMapper; +import com.meishu.model.LaboratoryDictMappingDO; +import com.meishu.model.SessionsDictDO; +import com.meishu.service.LaboratoryDictMappingService; +import com.meishu.service.LaboratoryDictService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.meishu.service.SessionsDictService; +import com.meishu.vo.laboratorySession.LaboratoryDictPageVO; +import org.apache.commons.lang3.StringUtils; +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.util.List; + +/** + * <p> + * 实验室 服务实现类 + * </p> + * + * @author DengMin + * @since 2021-08-17 + */ +@Service +public class LaboratoryDictServiceImpl extends ServiceImpl<LaboratoryDictMapper, LaboratoryDictDO> implements LaboratoryDictService { + + @Autowired + private SessionsDictService sessionsDictService; + + @Autowired + private LaboratoryDictMappingService laboratoryDictMappingService; + + @Override + public IPage<LaboratoryDictPageVO> selectPage(LaboratoryPageDTO laboratoryPageDTO) { + IPage<LaboratoryDictPageVO> iPage = this.baseMapper.getLaboratoryPage(new Page(laboratoryPageDTO.getPageNo(), laboratoryPageDTO.getPageSize()), laboratoryPageDTO.getName(), laboratoryPageDTO.getLaboratoryType()); + for (LaboratoryDictPageVO record : iPage.getRecords()) { + List<SessionsDictDO> list = sessionsDictService.getListById(record.getId()); + record.setSessions(list); + } + return iPage; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void add(LaboratoryDictDTO laboratoryDictDTO) { + LaboratoryDictDO laboratoryDictDO = new LaboratoryDictDO(); + BeanUtils.copyProperties(laboratoryDictDTO, laboratoryDictDO); + this.baseMapper.insert(laboratoryDictDO); + + for (Long id : laboratoryDictDTO.getSessionDictId()) { + LaboratoryDictMappingDO laboratoryDictMappingDO = new LaboratoryDictMappingDO(); + laboratoryDictMappingDO.setLaboratoryDictId(laboratoryDictDO.getId()); + laboratoryDictMappingDO.setSessionsDictId(id); + laboratoryDictMappingService.save(laboratoryDictMappingDO); + } + } + + @Override + public void updateLaboratory(LaboratoryDictDTO laboratoryDictDTO) { + LaboratoryDictDO laboratoryDictDO = new LaboratoryDictDO(); + BeanUtils.copyProperties(laboratoryDictDTO, laboratoryDictDO); + this.baseMapper.updateById(laboratoryDictDO); + + List<LaboratoryDictMappingDO> list = laboratoryDictMappingService.list(new QueryWrapper<LaboratoryDictMappingDO>() + .lambda() + .eq(LaboratoryDictMappingDO::getLaboratoryDictId, laboratoryDictDTO.getId())); + for (LaboratoryDictMappingDO laboratoryDictMappingDO : list) { + if(laboratoryDictDTO.getSessionDictId().stream().filter(id -> id.equals(laboratoryDictMappingDO.getSessionsDictId())).findAny().isPresent()) { + continue; + } else { + laboratoryDictMappingService.removeById(laboratoryDictMappingDO.getId()); + } + } + + for (Long id : laboratoryDictDTO.getSessionDictId()) { + if(list.stream().filter(ldm -> ldm.getSessionsDictId().equals(id)).findAny().isPresent()) { + continue; + } else { + LaboratoryDictMappingDO laboratoryDictMappingDO = new LaboratoryDictMappingDO(); + laboratoryDictMappingDO.setLaboratoryDictId(laboratoryDictDO.getId()); + laboratoryDictMappingDO.setSessionsDictId(id); + laboratoryDictMappingService.save(laboratoryDictMappingDO); + } + } + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(Long id) { + List<LaboratoryDictMappingDO> list = laboratoryDictMappingService.list(new QueryWrapper<LaboratoryDictMappingDO>() + .lambda() + .eq(LaboratoryDictMappingDO::getLaboratoryDictId, id)); + if(list != null) { + for (LaboratoryDictMappingDO laboratoryDictMappingDO : list) { + laboratoryDictMappingService.removeById(laboratoryDictMappingDO.getId()); + } + } + + this.baseMapper.deleteById(id); + } + + @Override + public LaboratoryDictDO getLaboratoryDicOne(String laboratoryType, String startDate) { + return this.baseMapper.getLaboratoryDicOne(laboratoryType, startDate); + } +} diff --git a/src/main/java/com/meishu/service/impl/LaboratorySessionMappingServiceImpl.java b/src/main/java/com/meishu/service/impl/LaboratorySessionMappingServiceImpl.java new file mode 100644 index 0000000..e9d0d59 --- /dev/null +++ b/src/main/java/com/meishu/service/impl/LaboratorySessionMappingServiceImpl.java @@ -0,0 +1,263 @@ +package com.meishu.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.meishu.common.constant.AttendanceConstant; +import com.meishu.common.exception.HttpException; +import com.meishu.dto.laboratorySession.CalendarStatusDTO; +import com.meishu.dto.laboratorySession.GetLaboratorySessionDTO; +import com.meishu.dto.laboratorySession.SetLaboratorySessionDTO; +import com.meishu.model.*; +import com.meishu.mapper.LaboratorySessionMappingMapper; +import com.meishu.service.*; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.meishu.util.DateFormatUtil; +import com.meishu.util.HttpUtil; +import com.meishu.vo.laboratorySession.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.Async; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * <p> + * 实验室场次预约安排表 服务实现类 + * </p> + * + * @author DengMin + * @since 2021-08-17 + */ +@Service +public class LaboratorySessionMappingServiceImpl extends ServiceImpl<LaboratorySessionMappingMapper, LaboratorySessionMappingDO> implements LaboratorySessionMappingService { + + @Autowired + private SessionsDictService sessionsDictService; + + @Autowired + private LaboratoryDictService laboratoryDictService; + + @Autowired + private LaboratoryDictMappingService laboratoryDictMappingService; + + @Autowired + private LaboratoryUserMappingService laboratoryUserMappingService; + + @Autowired + private ClassesDictService classesDictService; + + @Override + public List<LaboratorySessionMappingVO> getLaboratorySessionList(String startDate) { + List<LaboratorySessionMappingVO> list = this.baseMapper.getLaboratorySessionList(startDate); + for (LaboratorySessionMappingVO laboratorySessionMappingVO : list) { + List<SessionsDictDO> sessionDictList = sessionsDictService.getListSessionDictById(laboratorySessionMappingVO.getLaboratoryDictId(), startDate); + laboratorySessionMappingVO.setTimeSlot(sessionDictList); + } + return list; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void deleteLaboratorySession(SetLaboratorySessionDTO setLaboratorySessionDTO) { + List<LaboratorySessionMappingDO> list = this.baseMapper.selectList(new QueryWrapper<LaboratorySessionMappingDO>() + .lambda() + .eq(LaboratorySessionMappingDO::getLaboratoryDictId, setLaboratorySessionDTO.getLaboratoryDictId()) + .eq(LaboratorySessionMappingDO::getStartDate, setLaboratorySessionDTO.getStartDate())); + if(list != null) { + for (LaboratorySessionMappingDO laboratorySessionMappingDO : list) { + this.baseMapper.deleteById(laboratorySessionMappingDO.getId()); + } + } + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void setLaboratorySession(SetLaboratorySessionDTO setLaboratorySessionDTO) { + LaboratoryDictDO laboratoryDict = laboratoryDictService.getLaboratoryDicOne(setLaboratorySessionDTO.getLaboratoryType(), setLaboratorySessionDTO.getStartDate()); + if(laboratoryDict != null) { + throw new HttpException(70009); + } + + List<LaboratoryDictDO> laboratoryDictList = laboratoryDictService.list(new QueryWrapper<LaboratoryDictDO>() + .lambda() + .eq(LaboratoryDictDO::getLaboratoryType, setLaboratorySessionDTO.getLaboratoryType())); + if(laboratoryDictList == null) { + throw new HttpException(70001); + } + + /* 根据实验室类型查询关联数据 */ + for (LaboratoryDictDO laboratoryDictDO : laboratoryDictList) { + List<LaboratoryDictMappingDO> list = laboratoryDictMappingService.list(new QueryWrapper<LaboratoryDictMappingDO>() + .lambda() + .eq(LaboratoryDictMappingDO::getLaboratoryDictId, laboratoryDictDO.getId())); + /* 实验室场次关系 */ + for (LaboratoryDictMappingDO laboratoryDictMappingDO : list) { + SessionsDictDO sessionsDictDO = sessionsDictService.getById(laboratoryDictMappingDO.getSessionsDictId()); + if(sessionsDictDO == null) { + throw new HttpException(70002); + } + + /*Map<String, Object> params = new HashMap(); + params.put("organizerId", AttendanceConstant.organizerId); + params.put("date", setLaboratorySessionDTO.getStartDate()); + params.put("topic", setLaboratorySessionDTO.getStartDate() +"-"+ setLaboratorySessionDTO.getStartDate() + "-" + sessionsDictDO.getTimeSlot()); + params.put("startTime", AttendanceConstant.startTime); + params.put("endTime", AttendanceConstant.endTime); + HttpUtil.sendPost(params, "", AttendanceConstant.CREATE_TOPIC_URL, 1);*/ + + LaboratorySessionMappingDO laboratorySessionMappingDO = new LaboratorySessionMappingDO(); + laboratorySessionMappingDO.setSessionsDictId(laboratoryDictMappingDO.getSessionsDictId()); + laboratorySessionMappingDO.setLaboratoryDictId(laboratoryDictDO.getId()); + laboratorySessionMappingDO.setGrade(setLaboratorySessionDTO.getGrade()); + laboratorySessionMappingDO.setStartDate(setLaboratorySessionDTO.getStartDate()); + laboratorySessionMappingDO.setRegisterStartDate(setLaboratorySessionDTO.getRegisterStartDate()); + laboratorySessionMappingDO.setRegisterEndDate(setLaboratorySessionDTO.getRegisterEndDate()); + this.baseMapper.insert(laboratorySessionMappingDO); + } + } + } + + @Override + public void updateLaboratorySession(SetLaboratorySessionDTO setLaboratorySessionDTO) { + List<LaboratorySessionMappingDO> list = this.baseMapper.selectList(new QueryWrapper<LaboratorySessionMappingDO>() + .lambda() + .eq(LaboratorySessionMappingDO::getLaboratoryDictId, setLaboratorySessionDTO.getLaboratoryDictId()) + .eq(LaboratorySessionMappingDO::getStartDate, setLaboratorySessionDTO.getStartDate())); + if(list != null) { + for (LaboratorySessionMappingDO laboratorySessionMappingDO : list) { + if(setLaboratorySessionDTO.getSessionDictId().stream().filter(id -> id.equals(laboratorySessionMappingDO.getSessionsDictId())).findAny().isPresent()) { + continue; + } else { + this.baseMapper.deleteById(laboratorySessionMappingDO.getId()); + } + } + + if(setLaboratorySessionDTO.getSessionDictId() != null) { + for (Long id : setLaboratorySessionDTO.getSessionDictId()) { + LaboratorySessionMappingDO sessionMappingDO = new LaboratorySessionMappingDO(); + sessionMappingDO.setSessionsDictId(id); + sessionMappingDO.setLaboratoryDictId(setLaboratorySessionDTO.getLaboratoryDictId()); + sessionMappingDO.setGrade(setLaboratorySessionDTO.getGrade()); + sessionMappingDO.setStartDate(setLaboratorySessionDTO.getStartDate()); + sessionMappingDO.setRegisterStartDate(setLaboratorySessionDTO.getRegisterStartDate()); + sessionMappingDO.setRegisterEndDate(setLaboratorySessionDTO.getRegisterEndDate()); + if(list.stream().filter(ldm -> ldm.getSessionsDictId().equals(id)).findAny().isPresent()) { + LaboratorySessionMappingDO laboratorySessionMappingDO = this.baseMapper.selectOne(new QueryWrapper<LaboratorySessionMappingDO>() + .lambda() + .eq(LaboratorySessionMappingDO::getStartDate, setLaboratorySessionDTO.getStartDate()) + .eq(LaboratorySessionMappingDO::getSessionsDictId, id) + .eq(LaboratorySessionMappingDO::getLaboratoryDictId, setLaboratorySessionDTO.getLaboratoryDictId())); + if(laboratorySessionMappingDO != null) { + sessionMappingDO.setId(laboratorySessionMappingDO.getId()); + this.baseMapper.updateById(sessionMappingDO); + } + } else { + this.baseMapper.insert(sessionMappingDO); + } + } + } + } + } + + @Override + public LaboratorySessionMappingVO getOneById(Long laboratorySessionId) { + return this.baseMapper.getOneById(laboratorySessionId); + } + + @Override + public List<CalendarStatusVO> getCalendarStatus(CalendarStatusDTO calendarStatusDTO) { + List<CalendarStatusVO> data = new ArrayList<>(); + List<LaboratorySessionMappingDO> list = this.baseMapper.selectList(new QueryWrapper<LaboratorySessionMappingDO>() + .lambda() + .like(LaboratorySessionMappingDO::getStartDate, calendarStatusDTO.getSelectDate()) + .groupBy(LaboratorySessionMappingDO::getStartDate)); + if(list != null) { + for (LaboratorySessionMappingDO laboratorySessionMappingDO : list) { + CalendarStatusVO calendarStatusVO = new CalendarStatusVO(); + calendarStatusVO.setStartDate(laboratorySessionMappingDO.getStartDate()); + calendarStatusVO.setStatus(1); + data.add(calendarStatusVO); + } + } + return data; + } + + @Override + public StatisticsVO getLaboratorySessionStatistics(CalendarStatusDTO calendarStatusDTO) { + StatisticsVO statisticsVO = new StatisticsVO(); + List<LaboratorySessionMappingDO> list = this.baseMapper.selectList(new QueryWrapper<LaboratorySessionMappingDO>() + .lambda() + .like(LaboratorySessionMappingDO::getStartDate, calendarStatusDTO.getSelectDate())); + // 创建数量 + statisticsVO.setCreateNum(list.size()); + + // 占用场次数量 + Long sessionNum = list.stream().map(ls -> ls.getSessionsDictId()).distinct().count(); + statisticsVO.setSessionNum(Math.toIntExact(sessionNum)); + + // 占用实验室数量 + Long laboratoryNum = list.stream().map(ls -> ls.getLaboratoryDictId()).distinct().count(); + statisticsVO.setLaboratoryNum(Math.toIntExact(laboratoryNum)); + return statisticsVO; + } + + @Override + public List<String> getLaboratorySessionDate(GetLaboratorySessionDTO getLaboratorySessionDTO) { + List<LaboratorySessionMappingDO> list = this.baseMapper.getLaboratorySessionDate(getLaboratorySessionDTO.getLaboratoryType()); + + Calendar cal = Calendar.getInstance(); + cal.add(Calendar.DATE, -1); + return list.stream().filter(ls -> DateFormatUtil.parse(ls.getStartDate(), DateFormatUtil.FMT_sdf_yMd).after(cal.getTime())) + .map(ls -> ls.getStartDate()).collect(Collectors.toList()); + } + + @Override + @Async + public List<GetLaboratorySessionVO> getLaboratorySession(GetLaboratorySessionDTO getLaboratorySessionDTO) { + List<GetLaboratorySessionVO> data = new ArrayList<>(); + List<LaboratorySessionMappingDO> list = this.baseMapper.getList(getLaboratorySessionDTO.getStudentId(), + getLaboratorySessionDTO.getStartDate(), + null); + if(list != null) { + for (LaboratorySessionMappingDO laboratorySessionMappingDO : list) { + LaboratoryDictDO laboratoryDict = laboratoryDictService.getById(laboratorySessionMappingDO.getLaboratoryDictId()); + if(laboratoryDict != null && laboratoryDict.getLaboratoryType().equals(getLaboratorySessionDTO.getLaboratoryType())) { + GetLaboratorySessionVO getLaboratorySessionVO = new GetLaboratorySessionVO(); + LaboratoryUserMappingDO laboratoryUserMappingDO = laboratoryUserMappingService.getOne(new QueryWrapper<LaboratoryUserMappingDO>().lambda() + .eq(LaboratoryUserMappingDO::getUserRoleId, getLaboratorySessionDTO.getStudentId()) + .eq(LaboratoryUserMappingDO::getLaboratorySessionId, laboratorySessionMappingDO.getId())); + getLaboratorySessionVO.setId(laboratorySessionMappingDO.getId()); + if(laboratoryUserMappingDO != null) { + getLaboratorySessionVO.setStatus(1); + } else { + getLaboratorySessionVO.setStatus(0); + } + + getLaboratorySessionVO.setRegisterStartDate(laboratorySessionMappingDO.getRegisterStartDate()); + getLaboratorySessionVO.setRegisterEndDate(laboratorySessionMappingDO.getRegisterEndDate()); + + LaboratoryDictDO laboratoryDictDO = laboratoryDictService.getById(laboratorySessionMappingDO.getLaboratoryDictId()); + if(laboratoryDictDO != null) { + getLaboratorySessionVO.setLaboratoryName(laboratoryDictDO.getLaboratoryName()); + } + + SessionsDictDO sessionsDictDO = sessionsDictService.getById(laboratorySessionMappingDO.getSessionsDictId()); + if(sessionsDictDO != null) { + getLaboratorySessionVO.setTimeSlot(sessionsDictDO.getTimeSlot()); + } + + int count = laboratoryUserMappingService.count(new QueryWrapper<LaboratoryUserMappingDO>().lambda() + .eq(LaboratoryUserMappingDO::getLaboratorySessionId, laboratorySessionMappingDO.getId())); + if(laboratoryDict.getMaxNum() >= count) { + getLaboratorySessionVO.setSurplus(laboratoryDict.getMaxNum() - count); + } else { + getLaboratorySessionVO.setSurplus(0); + } + data.add(getLaboratorySessionVO); + } + } + } + return data; + } +} \ No newline at end of file diff --git a/src/main/java/com/meishu/service/impl/LaboratoryUserMappingServiceImpl.java b/src/main/java/com/meishu/service/impl/LaboratoryUserMappingServiceImpl.java new file mode 100644 index 0000000..b222591 --- /dev/null +++ b/src/main/java/com/meishu/service/impl/LaboratoryUserMappingServiceImpl.java @@ -0,0 +1,162 @@ +package com.meishu.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.meishu.common.exception.HttpException; +import com.meishu.dto.laboratoryUser.ApplyDTO; +import com.meishu.dto.laboratoryUser.LaboratoryUserPageDTO; +import com.meishu.mapper.LaboratorySessionMappingMapper; +import com.meishu.model.LaboratoryDictDO; +import com.meishu.model.LaboratorySessionMappingDO; +import com.meishu.model.LaboratoryUserMappingDO; +import com.meishu.mapper.LaboratoryUserMappingMapper; +import com.meishu.model.SessionsDictDO; +import com.meishu.service.LaboratoryDictService; +import com.meishu.service.LaboratorySessionMappingService; +import com.meishu.service.LaboratoryUserMappingService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.meishu.service.SessionsDictService; +import com.meishu.util.DateFormatUtil; +import com.meishu.util.excel.ExcelUtil; +import com.meishu.vo.laboratorySession.LaboratorySessionMappingVO; +import com.meishu.vo.laboratoryUser.LaboratoryUserPageVO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.Async; +import org.springframework.stereotype.Service; + +import javax.xml.crypto.Data; +import java.util.Calendar; +import java.util.Date; +import java.util.List; + +/** + * <p> + * 实验室场次预约报名记录 服务实现类 + * </p> + * + * @author DengMin + * @since 2021-08-17 + */ +@Service +public class LaboratoryUserMappingServiceImpl extends ServiceImpl<LaboratoryUserMappingMapper, LaboratoryUserMappingDO> implements LaboratoryUserMappingService { + + @Autowired + private LaboratorySessionMappingMapper laboratorySessionMappingService; + + @Autowired + private SessionsDictService sessionsDictService; + + @Autowired + private LaboratoryDictService laboratoryDictService; + + @Override + public List<LaboratoryUserPageVO> getLaboratoryUserPage(LaboratoryUserPageDTO laboratoryUserPageDTO) { + return this.baseMapper.getLaboratoryUserPage(laboratoryUserPageDTO.getLaboratorySessionId(), laboratoryUserPageDTO.getStartDate()); + } + + @Override + public void exportLaboratoryUser(LaboratoryUserPageDTO laboratoryUserPageDTO) { + List<LaboratoryUserPageVO> list = this.baseMapper.getLaboratoryUserList(laboratoryUserPageDTO.getLaboratorySessionId(), laboratoryUserPageDTO.getStartDate()); + if(list != null) { + for (LaboratoryUserPageVO laboratoryUserPageVO : list) { + LaboratorySessionMappingVO laboratorySessionMappingVO = laboratorySessionMappingService.getOneById(laboratoryUserPageVO.getLaboratorySessionId()); + if(laboratorySessionMappingVO != null) { + laboratoryUserPageVO.setLaboratoryName(laboratorySessionMappingVO.getLaboratoryName()); + } + + SessionsDictDO sessionsDictDO = sessionsDictService.getById(laboratoryUserPageVO.getSessionsDictId()); + if(sessionsDictDO != null) { + laboratoryUserPageVO.setTimeSlot(sessionsDictDO.getTimeSlot()); + } + } + } + ExcelUtil.writeExcel(list, LaboratoryUserPageVO.class); + } + + @Override + public void registration(ApplyDTO applyDTO) { + LaboratorySessionMappingDO laboratorySessionMappingDO = laboratorySessionMappingService.selectById(applyDTO.getLaboratorySessionId()); + if(laboratorySessionMappingDO == null) { + throw new HttpException(70003); + } + + // 未到达报名时间 + if(new Date().before(DateFormatUtil.parse(laboratorySessionMappingDO.getRegisterStartDate(), DateFormatUtil.FMT_sdf_yMd))) { + throw new HttpException(70004); + } + + String date = DateFormatUtil.format(new Date(), DateFormatUtil.FMT_sdf_yMd); + if(new Date().before(DateFormatUtil.parse(date+" 12:00:00", DateFormatUtil.FMT_sdf14_L))) { + throw new HttpException(70004); + } + + if(new Date().after(DateFormatUtil.parse(date+" 21:00:00", DateFormatUtil.FMT_sdf14_L))) { + throw new HttpException(70004); + } + + // 结束报名 + Calendar calendar = Calendar.getInstance(); + calendar.setTime(DateFormatUtil.parse(laboratorySessionMappingDO.getRegisterEndDate(), DateFormatUtil.FMT_sdf_yMd)); + calendar.add(Calendar.DATE, 1); + if(new Date().after(calendar.getTime())) { + throw new HttpException(70005); + } + + LaboratoryDictDO laboratoryDictDO = laboratoryDictService.getById(laboratorySessionMappingDO.getLaboratoryDictId()); + + // 人数上限 + List<LaboratoryUserMappingDO> list = this.baseMapper.selectList(new QueryWrapper<LaboratoryUserMappingDO>() + .lambda() + .eq(LaboratoryUserMappingDO::getLaboratorySessionId, applyDTO.getLaboratorySessionId())); + if(laboratoryDictDO.getMaxNum() <= list.size()) { + throw new HttpException(70006); + } + + // 同类型的实验室相同的时间内场次相同不能进行报名 + LaboratoryUserMappingDO laboratoryUserMapping = this.baseMapper.getLaboratoryUserMapping(applyDTO.getStudentId(), laboratorySessionMappingDO.getStartDate(), laboratorySessionMappingDO.getSessionsDictId()); + if(laboratoryUserMapping != null) { + throw new HttpException(70013); + } + + // 已报名 + if(list != null && list.size() > 0 ) { + if(list.stream().filter(ls -> ls.getUserRoleId().equals(applyDTO.getStudentId()) + && ls.getLaboratorySessionId().equals(applyDTO.getLaboratorySessionId())).findAny().isPresent()) { + throw new HttpException(70007); + } + } + + LaboratoryUserMappingDO laboratoryUserMappingDO = new LaboratoryUserMappingDO(); + laboratoryUserMappingDO.setLaboratorySessionId(applyDTO.getLaboratorySessionId()); + laboratoryUserMappingDO.setUserRoleId(applyDTO.getStudentId()); + this.baseMapper.insert(laboratoryUserMappingDO); + } + + @Override + public void cancelRegistration(ApplyDTO applyDTO) { + LaboratorySessionMappingDO laboratorySessionMappingDO = laboratorySessionMappingService.selectById(applyDTO.getLaboratorySessionId()); + if(laboratorySessionMappingDO == null) { + throw new HttpException(70003); + } + + // 结束报名 + Calendar calendar = Calendar.getInstance(); + calendar.setTime(DateFormatUtil.parse(laboratorySessionMappingDO.getRegisterEndDate(), DateFormatUtil.FMT_sdf_yMd)); + calendar.add(Calendar.DATE, 1); + if(new Date().after(calendar.getTime())) { + throw new HttpException(70014); + } + + // 已报名 + LaboratoryUserMappingDO laboratoryUserMappingDO = this.baseMapper.selectOne(new QueryWrapper<LaboratoryUserMappingDO>() + .lambda() + .eq(LaboratoryUserMappingDO::getUserRoleId, applyDTO.getStudentId()) + .eq(LaboratoryUserMappingDO::getLaboratorySessionId, applyDTO.getLaboratorySessionId())); + if(laboratoryUserMappingDO == null) { + throw new HttpException(70008); + } + + this.baseMapper.deleteById(laboratoryUserMappingDO.getId()); + } +} diff --git a/src/main/java/com/meishu/service/impl/PermissionsDictServiceImpl.java b/src/main/java/com/meishu/service/impl/PermissionsDictServiceImpl.java new file mode 100644 index 0000000..ec16689 --- /dev/null +++ b/src/main/java/com/meishu/service/impl/PermissionsDictServiceImpl.java @@ -0,0 +1,20 @@ +package com.meishu.service.impl; + +import com.meishu.model.PermissionsDictDO; +import com.meishu.mapper.PermissionsDictMapper; +import com.meishu.service.PermissionsDictService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + * <p> + * 权限表 服务实现类 + * </p> + * + * @author Tuyp + * @since 2021-04-26 + */ +@Service +public class PermissionsDictServiceImpl extends ServiceImpl<PermissionsDictMapper, PermissionsDictDO> implements PermissionsDictService { + +} diff --git a/src/main/java/com/meishu/service/impl/RoleAdministerMappingServiceImpl.java b/src/main/java/com/meishu/service/impl/RoleAdministerMappingServiceImpl.java new file mode 100644 index 0000000..49c834c --- /dev/null +++ b/src/main/java/com/meishu/service/impl/RoleAdministerMappingServiceImpl.java @@ -0,0 +1,20 @@ +package com.meishu.service.impl; + +import com.meishu.model.RoleAdministerMappingDO; +import com.meishu.mapper.RoleAdministerMappingMapper; +import com.meishu.service.RoleAdministerMappingService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + * <p> + * 服务实现类 + * </p> + * + * @author Tuyp + * @since 2021-04-26 + */ +@Service +public class RoleAdministerMappingServiceImpl extends ServiceImpl<RoleAdministerMappingMapper, RoleAdministerMappingDO> implements RoleAdministerMappingService { + +} diff --git a/src/main/java/com/meishu/service/impl/RoleDictServiceImpl.java b/src/main/java/com/meishu/service/impl/RoleDictServiceImpl.java new file mode 100644 index 0000000..78de1bf --- /dev/null +++ b/src/main/java/com/meishu/service/impl/RoleDictServiceImpl.java @@ -0,0 +1,148 @@ +package com.meishu.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.meishu.dto.role.AddPermissionDTO; +import com.meishu.dto.role.DeletePermissionDTO; +import com.meishu.dto.role.GetRoleTeachersDTO; +import com.meishu.dto.role.RoleTeacherDTO; +import com.meishu.dto.rule.GetRuleReportDTO; +import com.meishu.mapper.*; +import com.meishu.model.*; +import com.meishu.service.RoleDictService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.meishu.util.ConstantUtils; +import com.meishu.vo.role.GetAllRolesVO; +import com.meishu.vo.role.GetRoleTeachersVO; +import org.springframework.beans.BeanUtils; +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; + +/** + * <p> + * 角色表 服务实现类 + * </p> + * + * @author Tuyp + * @since 2021-04-26 + */ +@Service +public class RoleDictServiceImpl extends ServiceImpl<RoleDictMapper, RoleDictDO> implements RoleDictService { + + @Autowired + private RoleAdministerMappingMapper roleAdministerMappingMapper; + + @Autowired + private RolePermissionMappingMapper rolePermissionMappingMapper; + + @Autowired + private AdministerMapper administerMapper; + + public List<GetAllRolesVO> getAllRoles(){ + + List<GetAllRolesVO> getAllRolesVOS = new ArrayList<>(); + + List<RoleDictDO> roleDictDOS = this.baseMapper.selectList(null); + for (RoleDictDO roleDictDO : roleDictDOS){ + GetAllRolesVO getAllRolesVO = new GetAllRolesVO(); + List<PermissionsDictDO> list = rolePermissionMappingMapper.getRolePermission(roleDictDO.getId()); + //树形结构 + List<PermissionsDictDO> treeList = new ArrayList(); + if (list != null) { + list.forEach(permission -> { + if (permission.getParentId() == null) { + treeList.add(permission); + } + + list.forEach(p -> { + if (null != p.getParentId() && p.getParentId().equals(permission.getId())) { + if (permission.getChildren() == null) { + permission.setChildren(new ArrayList<>()); + } + permission.getChildren().add(p); + } + }); + }); + } + + BeanUtils.copyProperties(roleDictDO,getAllRolesVO); + getAllRolesVO.setPermissionsDictDOS(treeList); + getAllRolesVOS.add(getAllRolesVO); + } + return getAllRolesVOS; + } + + public IPage<GetRoleTeachersVO> getRoleTeachers(GetRoleTeachersDTO getRoleTeachersDTO){ + Page pager = new Page(getRoleTeachersDTO.getPageNum(), getRoleTeachersDTO.getPageSize()); + IPage<GetRoleTeachersVO> getRoleTeachersVOIPage = this.baseMapper.getRoleTeachers(pager,getRoleTeachersDTO.getRoleId(),getRoleTeachersDTO.getUserName()); + List<GetRoleTeachersVO> getRoleTeachersVOS = getRoleTeachersVOIPage.getRecords(); + for (GetRoleTeachersVO getRoleTeachersVO : getRoleTeachersVOS){ + List<DepartmentDictDO> departmentDictDOS = administerMapper.getDepartmentByAdministerId(getRoleTeachersVO.getAdministerId()); + getRoleTeachersVO.setDepartmentDictDOS(departmentDictDOS); + } + return getRoleTeachersVOIPage; + } + + public String removeTeacher(RoleTeacherDTO roleTeacherDTO){ + + roleAdministerMappingMapper.delete(new QueryWrapper<RoleAdministerMappingDO>() + .lambda() + .eq(RoleAdministerMappingDO::getRoleId,roleTeacherDTO.getRoleId()) + .in(RoleAdministerMappingDO::getId,roleTeacherDTO.getIds())); + + return ConstantUtils.DELETE_SUCCESS; + } + + public String roleTeacher(RoleTeacherDTO roleTeacherDTO){ + + roleAdministerMappingMapper.delete(new QueryWrapper<RoleAdministerMappingDO>() + .lambda() + .eq(RoleAdministerMappingDO::getRoleId,roleTeacherDTO.getRoleId())); + + List<Long> longs = roleTeacherDTO.getIds(); + for (Long lg : longs){ + RoleAdministerMappingDO roleAdministerMappingDO = new RoleAdministerMappingDO(); + roleAdministerMappingDO.setAdministerId(lg); + roleAdministerMappingDO.setRoleId(roleTeacherDTO.getRoleId()); + roleAdministerMappingMapper.insert(roleAdministerMappingDO); + } + return ConstantUtils.ADD_SUCCESS; + } + + @Transactional(rollbackFor = Exception.class) + public String addPermission(AddPermissionDTO addPermissionDTO){ + List<Long> longs = addPermissionDTO.getPermissionIds(); + + rolePermissionMappingMapper.delete(new QueryWrapper<RolePermissionMappingDO>() + .lambda() + .eq(RolePermissionMappingDO::getRoleId,addPermissionDTO.getRoleId())); + + for (Long lg : longs){ + RolePermissionMappingDO rolePermissionMappingDO = new RolePermissionMappingDO(); + rolePermissionMappingDO.setRoleId(addPermissionDTO.getRoleId()); + rolePermissionMappingDO.setPermissionId(lg); + rolePermissionMappingMapper.insert(rolePermissionMappingDO); + } + return ConstantUtils.ADD_SUCCESS; + } + + @Transactional(rollbackFor = Exception.class) + public String deletePermission(DeletePermissionDTO deletePermissionDTO){ + + List<Long> longs = deletePermissionDTO.getRoleIds(); + for (Long lg : longs){ + rolePermissionMappingMapper.delete(new QueryWrapper<RolePermissionMappingDO>() + .lambda() + .eq(RolePermissionMappingDO::getPermissionId,deletePermissionDTO.getPermissionId()) + .eq(RolePermissionMappingDO::getRoleId,lg)); + } + return ConstantUtils.DELETE_SUCCESS; + } + +} diff --git a/src/main/java/com/meishu/service/impl/RolePermissionMappingServiceImpl.java b/src/main/java/com/meishu/service/impl/RolePermissionMappingServiceImpl.java new file mode 100644 index 0000000..831027e --- /dev/null +++ b/src/main/java/com/meishu/service/impl/RolePermissionMappingServiceImpl.java @@ -0,0 +1,20 @@ +package com.meishu.service.impl; + +import com.meishu.model.RolePermissionMappingDO; +import com.meishu.mapper.RolePermissionMappingMapper; +import com.meishu.service.RolePermissionMappingService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + * <p> + * 系统用户角色表 服务实现类 + * </p> + * + * @author Tuyp + * @since 2021-04-26 + */ +@Service +public class RolePermissionMappingServiceImpl extends ServiceImpl<RolePermissionMappingMapper, RolePermissionMappingDO> implements RolePermissionMappingService { + +} diff --git a/src/main/java/com/meishu/service/impl/SessionsDictServiceImpl.java b/src/main/java/com/meishu/service/impl/SessionsDictServiceImpl.java new file mode 100644 index 0000000..5a13783 --- /dev/null +++ b/src/main/java/com/meishu/service/impl/SessionsDictServiceImpl.java @@ -0,0 +1,31 @@ +package com.meishu.service.impl; + +import com.meishu.model.SessionsDictDO; +import com.meishu.mapper.SessionsDictMapper; +import com.meishu.service.SessionsDictService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * <p> + * 场次字典表 服务实现类 + * </p> + * + * @author DengMin + * @since 2021-08-17 + */ +@Service +public class SessionsDictServiceImpl extends ServiceImpl<SessionsDictMapper, SessionsDictDO> implements SessionsDictService { + + @Override + public List<SessionsDictDO> getListById(Long laboratoryDictId) { + return this.baseMapper.getListById(laboratoryDictId); + } + + @Override + public List<SessionsDictDO> getListSessionDictById(Long laboratoryDictId, String startDate) { + return this.baseMapper.getListSessionDictById(laboratoryDictId, startDate); + } +} diff --git a/src/main/java/com/meishu/service/impl/SignInRecordServiceImpl.java b/src/main/java/com/meishu/service/impl/SignInRecordServiceImpl.java new file mode 100644 index 0000000..505d3fa --- /dev/null +++ b/src/main/java/com/meishu/service/impl/SignInRecordServiceImpl.java @@ -0,0 +1,29 @@ +package com.meishu.service.impl; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.meishu.dto.sign.ClassSignInDTO; +import com.meishu.model.SignInRecordDO; +import com.meishu.mapper.SignInRecordMapper; +import com.meishu.service.SignInRecordService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.meishu.vo.sign.ClassSignInVO; +import org.springframework.stereotype.Service; + +/** + * <p> + * 学生签到表 服务实现类 + * </p> + * + * @author DengMin + * @since 2021-09-28 + */ +@Service +public class SignInRecordServiceImpl extends ServiceImpl<SignInRecordMapper, SignInRecordDO> implements SignInRecordService { + + public IPage<ClassSignInVO> classSignIn(ClassSignInDTO classSignInDTO){ + Page pager = new Page(classSignInDTO.getPageNum(), classSignInDTO.getPageSize()); + return this.baseMapper.classSignIn(pager,classSignInDTO.getClassId(),classSignInDTO.getStartDate(),classSignInDTO.getEndDate(),classSignInDTO.getUserName()); + } + +} diff --git a/src/main/java/com/meishu/service/impl/SmsCodeServiceImpl.java b/src/main/java/com/meishu/service/impl/SmsCodeServiceImpl.java new file mode 100644 index 0000000..8393980 --- /dev/null +++ b/src/main/java/com/meishu/service/impl/SmsCodeServiceImpl.java @@ -0,0 +1,52 @@ +package com.meishu.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.meishu.common.exception.HttpException; +import com.meishu.dto.sms.SendVerifyCodeDTO; +import com.meishu.model.SmsCodeDO; +import com.meishu.mapper.SmsCodeMapper; +import com.meishu.model.UserRoleDO; +import com.meishu.service.SmsCodeService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.meishu.service.UserRoleService; +import com.meishu.util.ConstantUtils; +import com.meishu.util.RandomUtil; +import com.meishu.util.SMSUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * <p> + * 短信验证码 服务实现类 + * </p> + * + * @author Tuyp + * @since 2021-04-25 + */ +@Service +public class SmsCodeServiceImpl extends ServiceImpl<SmsCodeMapper, SmsCodeDO> implements SmsCodeService { + + @Autowired + private SMSUtils smsUtils; + + @Autowired + private UserRoleService userRoleService; + + @Override + public void sendVerifyCode(SendVerifyCodeDTO sendVerifyCodeDTO) { + UserRoleDO userRoleDO =userRoleService.getOne(new QueryWrapper<UserRoleDO>() + .lambda() + .eq(UserRoleDO::getPhone, sendVerifyCodeDTO.getPhone())); + if(userRoleDO == null) { + throw new HttpException(70012); + } + + String code = RandomUtil.getRandomCode(6); + smsUtils.send(sendVerifyCodeDTO.getPhone(), code); + + SmsCodeDO smsCodeDO = new SmsCodeDO(); + smsCodeDO.setCode(code); + smsCodeDO.setTelephone(sendVerifyCodeDTO.getPhone()); + this.baseMapper.insert(smsCodeDO); + } +} diff --git a/src/main/java/com/meishu/service/impl/StudentServiceImpl.java b/src/main/java/com/meishu/service/impl/StudentServiceImpl.java new file mode 100644 index 0000000..fc30174 --- /dev/null +++ b/src/main/java/com/meishu/service/impl/StudentServiceImpl.java @@ -0,0 +1,172 @@ +package com.meishu.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.meishu.common.exception.HttpException; +import com.meishu.dto.course.GetExercisesByTreeDTO; +import com.meishu.dto.student.*; +import com.meishu.dto.subject.BatchStatusOprDTO; +import com.meishu.mapper.*; +import com.meishu.model.*; +import com.meishu.service.StudentService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.meishu.util.ConstantUtils; +import com.meishu.util.MathUtil; +import com.meishu.util.RandomUtil; +import com.meishu.util.SMSUtils; +import com.meishu.vo.course.*; +import com.meishu.vo.grade.DimensionStarVO; +import com.meishu.vo.grade.QueryOneGradeVO; +import com.meishu.vo.rule.GetOneExaminationDetailVO; +import com.meishu.vo.rule.GetStudentRulesVO; +import com.meishu.vo.rule.StudentStarVO; +import com.meishu.vo.student.*; +import com.meishu.vo.voddict.GetCourseTreesVodsVO; +import net.sf.json.JSONArray; +import org.apache.commons.lang.StringUtils; +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.text.DateFormat; +import java.text.SimpleDateFormat; +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +/** + * <p> + * 白名单 服务实现类 + * </p> + * + * @author Tuyp + * @since 2021-04-25 + */ +@Service +public class StudentServiceImpl extends ServiceImpl<StudentMapper, StudentDO> implements StudentService { + + @Autowired + private SmsCodeMapper smsCodeMapper; + + + public String sendMsg(StudentDO studentDO) { + + //验证是否是白名单用户 + Integer count = this.baseMapper.selectCount(new QueryWrapper<StudentDO>() + .lambda() + .eq(StudentDO::getTelephone, studentDO.getTelephone())); + + StudentDO studentDO1 = this.baseMapper.getStudentInfo(studentDO.getTelephone()); + + if (count == 0 && null == studentDO1) { + throw new HttpException(10010); + } + + String verifyCode = RandomUtil.getRandomCode(6); + String param = "{ \"code\":\"" + verifyCode + "\"}"; + + //插入短信验证码 + smsCodeMapper.delete(new QueryWrapper<SmsCodeDO>() + .lambda() + .eq(SmsCodeDO::getTelephone, studentDO.getTelephone())); + + SmsCodeDO smsCodeDO = new SmsCodeDO(); + smsCodeDO.setTelephone(studentDO.getTelephone()); + smsCodeDO.setCode(verifyCode); + smsCodeMapper.insert(smsCodeDO); + return SMSUtils.sendVerifySMS(ConstantUtils.TEMPLATE_CODE, smsCodeDO.getTelephone(), param); + } + + public LoginVO login(SmsCodeDO smsCodeDO) { + + LoginVO loginVO = new LoginVO(); + + Integer count = smsCodeMapper.selectCount(new QueryWrapper<SmsCodeDO>() + .lambda() + .eq(SmsCodeDO::getTelephone, smsCodeDO.getTelephone()) + .eq(SmsCodeDO::getCode, smsCodeDO.getCode()) + .gt(SmsCodeDO::getCreateDate, LocalDateTime.now().minusMinutes(10L)) + ); + + //提交小程序,验证专用 + if ("15666666666".equals(smsCodeDO.getTelephone())) { + count = 1; + } + + if (count > 0) { + StudentDO studentDO = this.baseMapper.selectOne(new QueryWrapper<StudentDO>() + .lambda() + .eq(StudentDO::getTelephone, smsCodeDO.getTelephone())); + if (smsCodeDO == null) { + throw new HttpException(10013); + } + //该手机号是学生账号 + if (null != studentDO) { + BeanUtils.copyProperties(studentDO, loginVO); + + loginVO.setIsStudent("1"); + } else { + StudentDO studentDO2 = this.baseMapper.getStudentInfo(smsCodeDO.getTelephone()); + loginVO.setUsername(studentDO2.getUsername()); + List<SubjectReportVO> subjectReportVOS = this.baseMapper.getSubjectReport(studentDO2.getId()); + loginVO.setSubjectReportVOS(subjectReportVOS); + loginVO.setId(studentDO2.getId()); + loginVO.setIsStudent("0"); + } + return loginVO; + } else { + throw new HttpException(10003); + } + } + + public String addStudent(StudentDO studentDO) { + + Integer count = this.baseMapper.selectCount(new QueryWrapper<StudentDO>() + .lambda() + .eq(StudentDO::getTelephone,studentDO.getTelephone())); + + if (count>0){ + throw new HttpException(10014); + } + + studentDO.setStatus("1"); + this.baseMapper.insert(studentDO); + return ConstantUtils.ADD_SUCCESS; + } + + public String updateStudent(StudentDO studentDO) { + this.baseMapper.updateById(studentDO); + return ConstantUtils.SUCCESS_UPDATE; + } + + @Transactional(rollbackFor = Exception.class) + public String batchUpdateStudent(BatchStatusOprDTO batchStatusOprDTO) { + List<Long> longs = batchStatusOprDTO.getIds(); + for (Long lg : longs) { + StudentDO studentDO = new StudentDO(); + studentDO.setStatus(batchStatusOprDTO.getStatus()); + studentDO.setId(lg); + this.baseMapper.updateById(studentDO); + } + return ConstantUtils.SUCCESS_UPDATE; + } + + public String deleteStudent(DeleteStudentDTO deleteStudentDTO) { + + List<Long> ids = deleteStudentDTO.getIds(); + for (Long id : ids) { + this.baseMapper.deleteById(id); + } + return ConstantUtils.DELETE_SUCCESS; + } + + public QueryStudentVO queryStudent(StudentDO studentDO) { + QueryStudentVO queryStudentVO = new QueryStudentVO(); + StudentDO studentDO1 = this.baseMapper.selectById(studentDO.getId()); + BeanUtils.copyProperties(studentDO1, queryStudentVO); + return queryStudentVO; + } + + +} diff --git a/src/main/java/com/meishu/service/impl/SubjectDictServiceImpl.java b/src/main/java/com/meishu/service/impl/SubjectDictServiceImpl.java new file mode 100644 index 0000000..d08e778 --- /dev/null +++ b/src/main/java/com/meishu/service/impl/SubjectDictServiceImpl.java @@ -0,0 +1,20 @@ +package com.meishu.service.impl; + +import com.meishu.model.SubjectDictDO; +import com.meishu.mapper.SubjectDictMapper; +import com.meishu.service.SubjectDictService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + * <p> + * 学校科目字典表 服务实现类 + * </p> + * + * @author Tuyp + * @since 2021-08-17 + */ +@Service +public class SubjectDictServiceImpl extends ServiceImpl<SubjectDictMapper, SubjectDictDO> implements SubjectDictService { + +} diff --git a/src/main/java/com/meishu/service/impl/SubjectDimensionDictServiceImpl.java b/src/main/java/com/meishu/service/impl/SubjectDimensionDictServiceImpl.java new file mode 100644 index 0000000..fa06aed --- /dev/null +++ b/src/main/java/com/meishu/service/impl/SubjectDimensionDictServiceImpl.java @@ -0,0 +1,96 @@ +package com.meishu.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.meishu.mapper.SubjectDimensionStarDictMapper; +import com.meishu.mapper.SubjectTestGradeStarMappingMapper; +import com.meishu.model.*; +import com.meishu.mapper.SubjectDimensionDictMapper; +import com.meishu.service.SubjectDimensionDictService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.meishu.util.ConstantUtils; +import com.meishu.vo.dimension.GetAllDimensionStarVO; +import com.meishu.vo.dimension.GetAllDimensionStarsVO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; + +/** + * <p> + * 测评表 服务实现类 + * </p> + * + * @author Tuyp + * @since 2021-05-06 + */ +@Service +public class SubjectDimensionDictServiceImpl extends ServiceImpl<SubjectDimensionDictMapper, SubjectDimensionDictDO> implements SubjectDimensionDictService { + + @Autowired + private SubjectDimensionStarDictMapper subjectDimensionStarDictMapper; + + @Autowired + private SubjectDimensionDictMapper subjectDimensionDictMapper; + + @Autowired + private SubjectTestGradeStarMappingMapper subjectTestGradeStarMappingMapper; + + public List<SubjectDimensionDictDO> getAllDimensions(SubjectDimensionDictDO subjectDimensionDictDO){ + return this.baseMapper.selectList(new QueryWrapper<SubjectDimensionDictDO>() + .lambda() + .eq(SubjectDimensionDictDO::getRuleId,subjectDimensionDictDO.getRuleId())); + } + + public String deleteDimensionById(SubjectDimensionDictDO subjectDimensionDictDO){ + this.baseMapper.deleteById(subjectDimensionDictDO.getId()); + + //删除下面的星级 + subjectDimensionStarDictMapper.delete(new QueryWrapper<SubjectDimensionStarDictDO>() + .lambda() + .eq(SubjectDimensionStarDictDO::getDimensionId,subjectDimensionDictDO.getId())); + + return ConstantUtils.DELETE_SUCCESS; + } + + public String updateDimension(SubjectDimensionDictDO subjectDimensionDictDO){ + this.baseMapper.updateById(subjectDimensionDictDO); + return ConstantUtils.SUCCESS_UPDATE; + } + + public String addDimension(SubjectDimensionDictDO subjectDimensionDictDO){ + this.baseMapper.insert(subjectDimensionDictDO); + return ConstantUtils.ADD_SUCCESS; + } + + public List<GetAllDimensionStarVO> getAllDimensionStar(SubjectTestPublishGradeDO subjectTestPublishGradeDO){ + + //通过发布id查询规则 + SubjectRuleDO subjectRuleDO = subjectTestGradeStarMappingMapper.getRuleIdByPublishId(subjectTestPublishGradeDO.getPublishId()); + + List<GetAllDimensionStarVO> getAllDimensionStarVOS = new ArrayList<>(); + + //获取所有的维度 + List<SubjectDimensionDictDO> subjectDimensionDictDOS = subjectDimensionDictMapper.selectList(new QueryWrapper<SubjectDimensionDictDO>() + .lambda() + .eq(SubjectDimensionDictDO::getRuleId,subjectRuleDO.getId())); + + for (SubjectDimensionDictDO subjectDimensionDictDO: subjectDimensionDictDOS){ + + GetAllDimensionStarVO getAllDimensionStarsVO = new GetAllDimensionStarVO(); + //维度获取星级 + List<SubjectDimensionStarDictDO> subjectDimensionStarDictDOS = subjectDimensionStarDictMapper.selectList(new QueryWrapper<SubjectDimensionStarDictDO>() + .lambda() + .eq(SubjectDimensionStarDictDO::getDimensionId,subjectDimensionDictDO.getId())); + + getAllDimensionStarsVO.setDimensionId(subjectDimensionDictDO.getId()); + getAllDimensionStarsVO.setDimension(subjectDimensionDictDO.getDimension()); + getAllDimensionStarsVO.setSubjectDimensionStarDictDOS(subjectDimensionStarDictDOS); + + getAllDimensionStarVOS.add(getAllDimensionStarsVO); + } + return getAllDimensionStarVOS; + } + +} diff --git a/src/main/java/com/meishu/service/impl/SubjectDimensionStarDictServiceImpl.java b/src/main/java/com/meishu/service/impl/SubjectDimensionStarDictServiceImpl.java new file mode 100644 index 0000000..cdfe15c --- /dev/null +++ b/src/main/java/com/meishu/service/impl/SubjectDimensionStarDictServiceImpl.java @@ -0,0 +1,99 @@ +package com.meishu.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.meishu.dto.dimension.AddStarDTO; +import com.meishu.mapper.SubjectStarTreeMappingMapper; +import com.meishu.dto.dimension.DeleteStarByIdDTO; +import com.meishu.model.SubjectDimensionStarDictDO; +import com.meishu.mapper.SubjectDimensionStarDictMapper; +import com.meishu.model.SubjectStarTreeMappingDO; +import com.meishu.model.SubjectTreeDO; +import com.meishu.service.SubjectDimensionStarDictService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.meishu.util.ConstantUtils; +import com.meishu.vo.dimension.GetAllDimensionStarsVO; +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; + +/** + * <p> + * 维度星级字典表 服务实现类 + * </p> + * + * @author Tuyp + * @since 2021-05-06 + */ +@Service +public class SubjectDimensionStarDictServiceImpl extends ServiceImpl<SubjectDimensionStarDictMapper, SubjectDimensionStarDictDO> implements SubjectDimensionStarDictService { + + @Autowired + private SubjectStarTreeMappingMapper subjectStarTreeMappingMapper; + + + public List<GetAllDimensionStarsVO> getAllDimensionStars(SubjectDimensionStarDictDO subjectDimensionStartDictDO) { + + List<GetAllDimensionStarsVO> getAllDimensionStarsVOS = new ArrayList<>(); + + List<SubjectDimensionStarDictDO> subjectDimensionStartDictDOS = this.baseMapper.getStar(subjectDimensionStartDictDO.getDimensionId(),subjectDimensionStartDictDO.getStar()); + for (SubjectDimensionStarDictDO subjectDimensionStartDictDO1 : subjectDimensionStartDictDOS) { + GetAllDimensionStarsVO getAllDimensionStarsVO = new GetAllDimensionStarsVO(); + BeanUtils.copyProperties(subjectDimensionStartDictDO1, getAllDimensionStarsVO); + List<SubjectTreeDO> subjectTreeDOS = subjectStarTreeMappingMapper.getSubjectTrees(subjectDimensionStartDictDO1.getId()); + getAllDimensionStarsVO.setSubjectTreeDOS(subjectTreeDOS); + getAllDimensionStarsVOS.add(getAllDimensionStarsVO); + } + return getAllDimensionStarsVOS; + } + + public String deleteStarById(DeleteStarByIdDTO deleteDimensionByIdDTO) { + + List<Long> longs = deleteDimensionByIdDTO.getIds(); + for (Long lg : longs) { + this.baseMapper.deleteById(lg); + } + return ConstantUtils.DELETE_SUCCESS; + } + + public String addStar(AddStarDTO addStarDTO) { + + SubjectDimensionStarDictDO subjectDimensionStartDictDO = new SubjectDimensionStarDictDO(); + BeanUtils.copyProperties(addStarDTO, subjectDimensionStartDictDO); + this.baseMapper.insert(subjectDimensionStartDictDO); + + List<Long> treeIds = addStarDTO.getTreeIds(); + for (Long lg : treeIds) { + SubjectStarTreeMappingDO subjectStarTreeMappingDO = new SubjectStarTreeMappingDO(); + subjectStarTreeMappingDO.setSubjectTreeId(lg); + subjectStarTreeMappingDO.setSubjectStarId(subjectDimensionStartDictDO.getId()); + subjectStarTreeMappingMapper.insert(subjectStarTreeMappingDO); + } + return ConstantUtils.ADD_SUCCESS; + } + + public String updateStar(AddStarDTO addStarDTO) { + + SubjectDimensionStarDictDO subjectDimensionStartDictDO = new SubjectDimensionStarDictDO(); + BeanUtils.copyProperties(addStarDTO, subjectDimensionStartDictDO); + this.baseMapper.updateById(subjectDimensionStartDictDO); + + //删除之前的知识树映射 + subjectStarTreeMappingMapper.delete(new QueryWrapper<SubjectStarTreeMappingDO>() + .lambda() + .eq(SubjectStarTreeMappingDO::getSubjectStarId, addStarDTO.getId())); + + List<Long> treeIds = addStarDTO.getTreeIds(); + for (Long lg : treeIds) { + SubjectStarTreeMappingDO subjectStarTreeMappingDO = new SubjectStarTreeMappingDO(); + subjectStarTreeMappingDO.setSubjectTreeId(lg); + subjectStarTreeMappingDO.setSubjectStarId(subjectDimensionStartDictDO.getId()); + subjectStarTreeMappingMapper.insert(subjectStarTreeMappingDO); + } + + return ConstantUtils.SUCCESS_UPDATE; + } + +} diff --git a/src/main/java/com/meishu/service/impl/SubjectRuleServiceImpl.java b/src/main/java/com/meishu/service/impl/SubjectRuleServiceImpl.java new file mode 100644 index 0000000..33d998f --- /dev/null +++ b/src/main/java/com/meishu/service/impl/SubjectRuleServiceImpl.java @@ -0,0 +1,68 @@ +package com.meishu.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.meishu.dto.rule.GetAllRulesDTO; +import com.meishu.mapper.SubjectTestDictMapper; +import com.meishu.model.SubjectRuleDO; +import com.meishu.mapper.SubjectRuleMapper; +import com.meishu.model.SubjectTestDictDO; +import com.meishu.service.SubjectRuleService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.meishu.util.ConstantUtils; +import com.meishu.vo.rule.GetAllRulesVO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; + +/** + * <p> + * 规则字典表 服务实现类 + * </p> + * + * @author Tuyp + * @since 2021-05-08 + */ +@Service +public class SubjectRuleServiceImpl extends ServiceImpl<SubjectRuleMapper, SubjectRuleDO> implements SubjectRuleService { + + @Autowired + private SubjectTestDictMapper subjectTestDictMapper; + + public IPage<GetAllRulesVO> getAllRules(GetAllRulesDTO getAllRulesDTO) { + Page pager = new Page(getAllRulesDTO.getPageNum(), getAllRulesDTO.getPageSize()); + return this.baseMapper.getAllRules(pager); + } + + public List<GetAllRulesVO> getRules(){ + return this.baseMapper.getRules(); + } + + public String addRule(SubjectRuleDO subjectRuleDO) { + subjectRuleDO.setStatus("1"); + this.baseMapper.insert(subjectRuleDO); + return ConstantUtils.ADD_SUCCESS; + } + + @Transactional(rollbackFor = Exception.class) + public String updateRule(SubjectRuleDO subjectRuleDO) { + this.baseMapper.updateById(subjectRuleDO); + List<SubjectTestDictDO> subjectTestDictDOS = subjectTestDictMapper.selectList(new QueryWrapper<SubjectTestDictDO>() + .lambda() + .eq(SubjectTestDictDO::getRuleId,subjectRuleDO.getId())); + for (SubjectTestDictDO subjectTestDictDO : subjectTestDictDOS){ + subjectTestDictDO.setStatus(subjectRuleDO.getStatus()); + subjectTestDictMapper.updateById(subjectTestDictDO); + } + return ConstantUtils.SUCCESS_UPDATE; + } + + public String deleteRule(SubjectRuleDO subjectRuleDO){ + this.baseMapper.deleteById(subjectRuleDO.getId()); + return ConstantUtils.DELETE_SUCCESS; + } + +} diff --git a/src/main/java/com/meishu/service/impl/SubjectSemesterServiceImpl.java b/src/main/java/com/meishu/service/impl/SubjectSemesterServiceImpl.java new file mode 100644 index 0000000..96b6b7f --- /dev/null +++ b/src/main/java/com/meishu/service/impl/SubjectSemesterServiceImpl.java @@ -0,0 +1,89 @@ +package com.meishu.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.meishu.dto.semester.GetSemesterScoreDTO; +import com.meishu.dto.semester.GetStudentDetailDTO; +import com.meishu.dto.semester.GetStudentRecordDTO; +import com.meishu.mapper.ClassesDictHistoryMapper; +import com.meishu.mapper.ClassesDictMapper; +import com.meishu.model.ClassesDictDO; +import com.meishu.model.ClassesDictHistoryDO; +import com.meishu.model.SubjectSemesterDO; +import com.meishu.mapper.SubjectSemesterMapper; +import com.meishu.service.SubjectSemesterService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.meishu.vo.semester.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * <p> + * 服务实现类 + * </p> + * + * @author Tuyp + * @since 2021-08-11 + */ +@Service +public class SubjectSemesterServiceImpl extends ServiceImpl<SubjectSemesterMapper, SubjectSemesterDO> implements SubjectSemesterService { + + @Autowired + private ClassesDictMapper classesDictMapper; + + @Autowired + private ClassesDictHistoryMapper classesDictHistoryMapper; + + public List<GetAllStudyingSemesterVO> getAllStudyingSemester() { + + List<GetAllStudyingSemesterVO> result = new ArrayList<>(); + + String[] array = new String[]{"高一", "高二", "高三"}; + + for (String str : array) { + GetAllStudyingSemesterVO subjectSemesterServiceVO = new GetAllStudyingSemesterVO(); + subjectSemesterServiceVO.setGradeType(str); + subjectSemesterServiceVO.setClassesDictDOS(classesDictMapper.getGradeClasses(str)); + result.add(subjectSemesterServiceVO); + } + return result; + } + + public List<GetAllPastSemesterVO> getAllPastSemester(){ + + List<GetAllPastSemesterVO> result = new ArrayList<>(); + + String[] array = new String[]{"高一", "高二", "高三"}; + + for (String str : array) { + GetAllPastSemesterVO getAllPastSemesterVO = new GetAllPastSemesterVO(); + getAllPastSemesterVO.setGradeType(str); + getAllPastSemesterVO.setClassesDictDOS(classesDictHistoryMapper.getAllPastSemester(str)); + result.add(getAllPastSemesterVO); + } + return result; + } + + public IPage<GetSemesterScoreVO> getSemesterScore(GetSemesterScoreDTO getSemesterScoreDTO) { + Page pager = new Page(getSemesterScoreDTO.getPageNum(), getSemesterScoreDTO.getPageSize()); + return this.baseMapper.getSemesterScore(pager, getSemesterScoreDTO.getSemester(), getSemesterScoreDTO.getGrade(), getSemesterScoreDTO.getClasses(), getSemesterScoreDTO.getSession(), getSemesterScoreDTO.getSubject(), getSemesterScoreDTO.getUserName()); + } + + public List<GetSemesterScoreVO> exportScore(GetSemesterScoreDTO getSemesterScoreDTO) { + return this.baseMapper.exportScore(getSemesterScoreDTO.getSemester(), getSemesterScoreDTO.getGrade(),getSemesterScoreDTO.getClasses(),getSemesterScoreDTO.getSession(), getSemesterScoreDTO.getSubject(), getSemesterScoreDTO.getUserName()); + } + + public IPage<GetStudentDetailVO> getStudentDetail(GetStudentDetailDTO getStudentDetailDTO) { + Page pager = new Page(getStudentDetailDTO.getPageNum(), getStudentDetailDTO.getPageSize()); + return this.baseMapper.getStudentDetail(pager, getStudentDetailDTO.getId(), getStudentDetailDTO.getUserId()); + } + + public List<GetStudentRecordVO> getStudentRecord(GetStudentRecordDTO getStudentRecordDTO){ + return this.baseMapper.getStudentRecord(getStudentRecordDTO); + } + +} diff --git a/src/main/java/com/meishu/service/impl/SubjectStarTreeMappingServiceImpl.java b/src/main/java/com/meishu/service/impl/SubjectStarTreeMappingServiceImpl.java new file mode 100644 index 0000000..565b9f7 --- /dev/null +++ b/src/main/java/com/meishu/service/impl/SubjectStarTreeMappingServiceImpl.java @@ -0,0 +1,20 @@ +package com.meishu.service.impl; + +import com.meishu.model.SubjectStarTreeMappingDO; +import com.meishu.mapper.SubjectStarTreeMappingMapper; +import com.meishu.service.SubjectStarTreeMappingService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + * <p> + * 测评-知识点关联表 服务实现类 + * </p> + * + * @author Tuyp + * @since 2021-05-06 + */ +@Service +public class SubjectStarTreeMappingServiceImpl extends ServiceImpl<SubjectStarTreeMappingMapper, SubjectStarTreeMappingDO> implements SubjectStarTreeMappingService { + +} diff --git a/src/main/java/com/meishu/service/impl/SubjectStudentAnswerStarServiceImpl.java b/src/main/java/com/meishu/service/impl/SubjectStudentAnswerStarServiceImpl.java new file mode 100644 index 0000000..8eefa5b --- /dev/null +++ b/src/main/java/com/meishu/service/impl/SubjectStudentAnswerStarServiceImpl.java @@ -0,0 +1,20 @@ +package com.meishu.service.impl; + +import com.meishu.model.SubjectStudentAnswerStarDO; +import com.meishu.mapper.SubjectStudentAnswerStarMapper; +import com.meishu.service.SubjectStudentAnswerStarService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + * <p> + * 学生答卷星级表 服务实现类 + * </p> + * + * @author Tuyp + * @since 2021-05-13 + */ +@Service +public class SubjectStudentAnswerStarServiceImpl extends ServiceImpl<SubjectStudentAnswerStarMapper, SubjectStudentAnswerStarDO> implements SubjectStudentAnswerStarService { + +} diff --git a/src/main/java/com/meishu/service/impl/SubjectTestDictServiceImpl.java b/src/main/java/com/meishu/service/impl/SubjectTestDictServiceImpl.java new file mode 100644 index 0000000..20e8732 --- /dev/null +++ b/src/main/java/com/meishu/service/impl/SubjectTestDictServiceImpl.java @@ -0,0 +1,53 @@ +package com.meishu.service.impl; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.meishu.dto.test.GetAllTestDTO; +import com.meishu.model.SubjectTestDictDO; +import com.meishu.mapper.SubjectTestDictMapper; +import com.meishu.service.SubjectTestDictService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.meishu.util.ConstantUtils; +import com.meishu.vo.test.GetAllTestVO; +import com.meishu.vo.test.GetTestReportVO; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * <p> + * 测评表 服务实现类 + * </p> + * + * @author Tuyp + * @since 2021-05-20 + */ +@Service +public class SubjectTestDictServiceImpl extends ServiceImpl<SubjectTestDictMapper, SubjectTestDictDO> implements SubjectTestDictService { + + + public IPage<GetAllTestVO> getAllTest(GetAllTestDTO getAllTestDTO){ + Page pager = new Page(getAllTestDTO.getPageNum(), getAllTestDTO.getPageSize()); + return this.baseMapper.getAllTest(pager,getAllTestDTO.getRuleId(),getAllTestDTO.getTestName()); + } + + public List<GetAllTestVO> getTest(GetAllTestDTO getAllTestDTO){ + return this.baseMapper.getTest(getAllTestDTO.getRuleId(),getAllTestDTO.getTestName()); + } + + public String insertTest(SubjectTestDictDO subjectTestDictDO){ + this.baseMapper.insert(subjectTestDictDO); + return ConstantUtils.ADD_SUCCESS; + } + + public String updateTest(SubjectTestDictDO subjectTestDictDO){ + this.baseMapper.updateById(subjectTestDictDO); + return ConstantUtils.SUCCESS_UPDATE; + } + + public String deleteByTestId(SubjectTestDictDO subjectTestDictDO){ + this.baseMapper.deleteById(subjectTestDictDO.getId()); + return ConstantUtils.DELETE_SUCCESS; + } + +} diff --git a/src/main/java/com/meishu/service/impl/SubjectTestGradeExampleMappingServiceImpl.java b/src/main/java/com/meishu/service/impl/SubjectTestGradeExampleMappingServiceImpl.java new file mode 100644 index 0000000..52a1504 --- /dev/null +++ b/src/main/java/com/meishu/service/impl/SubjectTestGradeExampleMappingServiceImpl.java @@ -0,0 +1,20 @@ +package com.meishu.service.impl; + +import com.meishu.model.SubjectTestGradeExampleMappingDO; +import com.meishu.mapper.SubjectTestGradeExampleMappingMapper; +import com.meishu.service.SubjectTestGradeExampleMappingService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + * <p> + * 样卷映射表 服务实现类 + * </p> + * + * @author Tuyp + * @since 2021-06-21 + */ +@Service +public class SubjectTestGradeExampleMappingServiceImpl extends ServiceImpl<SubjectTestGradeExampleMappingMapper, SubjectTestGradeExampleMappingDO> implements SubjectTestGradeExampleMappingService { + +} diff --git a/src/main/java/com/meishu/service/impl/SubjectTestGradeStarMappingServiceImpl.java b/src/main/java/com/meishu/service/impl/SubjectTestGradeStarMappingServiceImpl.java new file mode 100644 index 0000000..741b7eb --- /dev/null +++ b/src/main/java/com/meishu/service/impl/SubjectTestGradeStarMappingServiceImpl.java @@ -0,0 +1,20 @@ +package com.meishu.service.impl; + +import com.meishu.model.SubjectTestGradeStarMappingDO; +import com.meishu.mapper.SubjectTestGradeStarMappingMapper; +import com.meishu.service.SubjectTestGradeStarMappingService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + * <p> + * 档次星级映射表 服务实现类 + * </p> + * + * @author Tuyp + * @since 2021-06-21 + */ +@Service +public class SubjectTestGradeStarMappingServiceImpl extends ServiceImpl<SubjectTestGradeStarMappingMapper, SubjectTestGradeStarMappingDO> implements SubjectTestGradeStarMappingService { + +} diff --git a/src/main/java/com/meishu/service/impl/SubjectTestPublishGradeServiceImpl.java b/src/main/java/com/meishu/service/impl/SubjectTestPublishGradeServiceImpl.java new file mode 100644 index 0000000..e8bd2f3 --- /dev/null +++ b/src/main/java/com/meishu/service/impl/SubjectTestPublishGradeServiceImpl.java @@ -0,0 +1,188 @@ +package com.meishu.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.meishu.dto.grade.AddGradeDTO; +import com.meishu.mapper.SubjectTestGradeExampleMappingMapper; +import com.meishu.mapper.SubjectTestGradeStarMappingMapper; +import com.meishu.model.SubjectRuleDO; +import com.meishu.model.SubjectTestGradeExampleMappingDO; +import com.meishu.model.SubjectTestGradeStarMappingDO; +import com.meishu.model.SubjectTestPublishGradeDO; +import com.meishu.mapper.SubjectTestPublishGradeMapper; +import com.meishu.service.SubjectTestPublishGradeService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.meishu.util.ConstantUtils; +import com.meishu.vo.grade.DimensionStarVO; +import com.meishu.vo.grade.QueryOneGradeVO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.ExecutionException; + +/** + * <p> + * 档次表 服务实现类 + * </p> + * + * @author Tuyp + * @since 2021-06-21 + */ +@Service +public class SubjectTestPublishGradeServiceImpl extends ServiceImpl<SubjectTestPublishGradeMapper, SubjectTestPublishGradeDO> implements SubjectTestPublishGradeService { + + + @Autowired + private SubjectTestGradeExampleMappingMapper subjectTestGradeExampleMappingMapper; + + @Autowired + private SubjectTestGradeStarMappingMapper subjectTestGradeStarMappingMapper; + + + @Transactional(rollbackFor = Exception.class) + public String addGrade(AddGradeDTO addGradeDTO){ + + String gradeName = addGradeDTO.getGradeName(); + + SubjectTestPublishGradeDO subjectTestPublishGradeDO = new SubjectTestPublishGradeDO(); + subjectTestPublishGradeDO.setGradeName(gradeName); + subjectTestPublishGradeDO.setPublishId(addGradeDTO.getPublishId()); + subjectTestPublishGradeDO.setContent(addGradeDTO.getContent()); + this.baseMapper.insert(subjectTestPublishGradeDO); + + //样卷 + List<String> subjectTestGradeExampleMappingDOS = addGradeDTO.getSubjectTestGradeExampleMappingDOS(); + for (String str : subjectTestGradeExampleMappingDOS){ + SubjectTestGradeExampleMappingDO subjectTestGradeExampleMappingDO = new SubjectTestGradeExampleMappingDO(); + subjectTestGradeExampleMappingDO.setExampleView(str); + subjectTestGradeExampleMappingDO.setGradeId(subjectTestPublishGradeDO.getId()); + subjectTestGradeExampleMappingMapper.insert(subjectTestGradeExampleMappingDO); + } + + //星级映射 + List<Long> subjectTestGradeStarMappingDOS = addGradeDTO.getSubjectTestGradeStarMappingDOS(); + for (Long lg : subjectTestGradeStarMappingDOS){ + SubjectTestGradeStarMappingDO subjectTestGradeStarMappingDO = new SubjectTestGradeStarMappingDO(); + subjectTestGradeStarMappingDO.setStarId(lg); + subjectTestGradeStarMappingDO.setGradeId(subjectTestPublishGradeDO.getId()); + subjectTestGradeStarMappingMapper.insert(subjectTestGradeStarMappingDO); + } + + return ConstantUtils.ADD_SUCCESS; + } + + @Transactional(rollbackFor = Exception.class) + public String deleteGrade(SubjectTestPublishGradeDO subjectTestPublishGradeDO){ + + this.baseMapper.deleteById(subjectTestPublishGradeDO.getId()); + + subjectTestGradeStarMappingMapper.delete(new QueryWrapper<SubjectTestGradeStarMappingDO>() + .lambda() + .eq(SubjectTestGradeStarMappingDO::getGradeId,subjectTestPublishGradeDO.getId())); + + subjectTestGradeExampleMappingMapper.delete(new QueryWrapper<SubjectTestGradeExampleMappingDO>() + .lambda() + .eq(SubjectTestGradeExampleMappingDO::getGradeId,subjectTestPublishGradeDO.getId())); + + return ConstantUtils.DELETE_SUCCESS; + } + + public List<QueryOneGradeVO> queryGrade(SubjectTestPublishGradeDO subjectTestPublishGradeDO){ + + List<QueryOneGradeVO> queryOneGradeVOS = new ArrayList<>(); + + List<SubjectTestPublishGradeDO> subjectTestPublishGradeDOS = this.baseMapper.selectList(new QueryWrapper<SubjectTestPublishGradeDO>() + .lambda() + .eq(SubjectTestPublishGradeDO::getPublishId,subjectTestPublishGradeDO.getId())); + + for (SubjectTestPublishGradeDO subjectTestPublishGradeDO1 : subjectTestPublishGradeDOS){ + + QueryOneGradeVO queryOneGradeVO = new QueryOneGradeVO(); + queryOneGradeVO.setGradeName(subjectTestPublishGradeDO1.getGradeName()); + queryOneGradeVO.setId(subjectTestPublishGradeDO1.getId()); + queryOneGradeVO.setContent(subjectTestPublishGradeDO1.getContent()); + + //样卷 + List<SubjectTestGradeExampleMappingDO> subjectTestGradeExampleMappingDOS = subjectTestGradeExampleMappingMapper.selectList(new QueryWrapper<SubjectTestGradeExampleMappingDO>() + .lambda() + .eq(SubjectTestGradeExampleMappingDO::getGradeId,subjectTestPublishGradeDO1.getId())); + queryOneGradeVO.setSubjectTestGradeExampleMappingDOS(subjectTestGradeExampleMappingDOS); + + //星级 + List<DimensionStarVO> dimensionStarVOS = subjectTestGradeStarMappingMapper.getGradeStar(subjectTestPublishGradeDO1.getId()); + queryOneGradeVO.setDimensionStarVOS(dimensionStarVOS); + + queryOneGradeVOS.add(queryOneGradeVO); + } + + return queryOneGradeVOS; + } + + public QueryOneGradeVO queryOneGrade(SubjectTestPublishGradeDO subjectTestPublishGradeDO){ + + QueryOneGradeVO queryOneGradeVO = new QueryOneGradeVO(); + + //档次 + SubjectTestPublishGradeDO subjectTestPublishGradeDO1 = this.baseMapper.selectById(subjectTestPublishGradeDO.getId()); + queryOneGradeVO.setGradeName(subjectTestPublishGradeDO1.getGradeName()); + + //样卷 + List<SubjectTestGradeExampleMappingDO> subjectTestGradeExampleMappingDOS = subjectTestGradeExampleMappingMapper.selectList(new QueryWrapper<SubjectTestGradeExampleMappingDO>() + .lambda() + .eq(SubjectTestGradeExampleMappingDO::getGradeId,subjectTestPublishGradeDO.getId())); + queryOneGradeVO.setSubjectTestGradeExampleMappingDOS(subjectTestGradeExampleMappingDOS); + + //星级 + List<DimensionStarVO> dimensionStarVOS = subjectTestGradeStarMappingMapper.getGradeStar(subjectTestPublishGradeDO.getId()); + queryOneGradeVO.setDimensionStarVOS(dimensionStarVOS); + + return queryOneGradeVO; + } + + public String updateGrade(AddGradeDTO addGradeDTO){ + + SubjectTestPublishGradeDO subjectTestPublishGradeDO = this.baseMapper.selectById(addGradeDTO.getId()); + subjectTestPublishGradeDO.setGradeName(addGradeDTO.getGradeName()); + subjectTestPublishGradeDO.setPublishId(addGradeDTO.getPublishId()); + subjectTestPublishGradeDO.setContent(addGradeDTO.getContent()); + this.baseMapper.updateById(subjectTestPublishGradeDO); + + //样卷 + subjectTestGradeExampleMappingMapper.delete(new QueryWrapper<SubjectTestGradeExampleMappingDO>() + .lambda() + .eq(SubjectTestGradeExampleMappingDO::getGradeId,addGradeDTO.getId())); + //样卷 + List<String> subjectTestGradeExampleMappingDOS = addGradeDTO.getSubjectTestGradeExampleMappingDOS(); + for (String str : subjectTestGradeExampleMappingDOS){ + SubjectTestGradeExampleMappingDO subjectTestGradeExampleMappingDO = new SubjectTestGradeExampleMappingDO(); + subjectTestGradeExampleMappingDO.setExampleView(str); + subjectTestGradeExampleMappingDO.setGradeId(subjectTestPublishGradeDO.getId()); + subjectTestGradeExampleMappingMapper.insert(subjectTestGradeExampleMappingDO); + } + + //星级映射 + subjectTestGradeStarMappingMapper.delete(new QueryWrapper<SubjectTestGradeStarMappingDO>() + .lambda() + .eq(SubjectTestGradeStarMappingDO::getGradeId,addGradeDTO.getId())); + + //星级映射 + List<Long> subjectTestGradeStarMappingDOS = addGradeDTO.getSubjectTestGradeStarMappingDOS(); + for (Long lg : subjectTestGradeStarMappingDOS){ + SubjectTestGradeStarMappingDO subjectTestGradeStarMappingDO = new SubjectTestGradeStarMappingDO(); + subjectTestGradeStarMappingDO.setStarId(lg); + subjectTestGradeStarMappingDO.setGradeId(subjectTestPublishGradeDO.getId()); + subjectTestGradeStarMappingMapper.insert(subjectTestGradeStarMappingDO); + } + + + return ConstantUtils.SUCCESS_UPDATE; + } + + public SubjectRuleDO getRuleIdByPublishId(SubjectTestPublishGradeDO subjectTestPublishGradeDO){ + return subjectTestGradeStarMappingMapper.getRuleIdByPublishId(subjectTestPublishGradeDO.getPublishId()); + } + + +} diff --git a/src/main/java/com/meishu/service/impl/SubjectTestPublishHistoryServiceImpl.java b/src/main/java/com/meishu/service/impl/SubjectTestPublishHistoryServiceImpl.java new file mode 100644 index 0000000..5afdf33 --- /dev/null +++ b/src/main/java/com/meishu/service/impl/SubjectTestPublishHistoryServiceImpl.java @@ -0,0 +1,153 @@ +package com.meishu.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.meishu.dto.test.*; +import com.meishu.mapper.SubjectStudentAnswerStarMapper; +import com.meishu.mapper.SubjectTestStudentAnswerMapper; +import com.meishu.model.SubjectStudentAnswerStarDO; +import com.meishu.model.SubjectTestDictDO; +import com.meishu.model.SubjectTestPublishHistoryDO; +import com.meishu.mapper.SubjectTestPublishHistoryMapper; +import com.meishu.model.SubjectTestStudentAnswerDO; +import com.meishu.service.SubjectTestPublishHistoryService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.meishu.util.ConstantUtils; +import com.meishu.util.MathUtil; +import com.meishu.vo.student.StudentVO; +import com.meishu.vo.test.CommentVO; +import com.meishu.vo.test.GetOnePublishVO; +import com.meishu.vo.test.GetPublishHistoryVO; +import com.meishu.vo.test.GetTestReportVO; +import io.swagger.annotations.ApiOperation; +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.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** + * <p> + * 测评发布记录表 服务实现类 + * </p> + * + * @author Tuyp + * @since 2021-05-08 + */ +@Service +public class SubjectTestPublishHistoryServiceImpl extends ServiceImpl<SubjectTestPublishHistoryMapper, SubjectTestPublishHistoryDO> implements SubjectTestPublishHistoryService { + + @Autowired + private SubjectTestStudentAnswerMapper subjectTestStudentAnswerMapper; + + @Autowired + private SubjectStudentAnswerStarMapper subjectStudentAnswerStarMapper; + + @Transactional(rollbackFor = Exception.class) + public String publishTest(PublishTestDTO publishTestDTO) { + + SubjectTestPublishHistoryDO subjectTestPublishHistoryDO = new SubjectTestPublishHistoryDO(); + BeanUtils.copyProperties(publishTestDTO, subjectTestPublishHistoryDO); + this.baseMapper.insert(subjectTestPublishHistoryDO); + + List<Long> longs = publishTestDTO.getStudentIds(); + for (Long lg : longs) { + SubjectTestStudentAnswerDO subjectTestStudentAnswerDO = new SubjectTestStudentAnswerDO(); + subjectTestStudentAnswerDO.setAnswer(""); + subjectTestStudentAnswerDO.setStudentId(lg); + subjectTestStudentAnswerDO.setPublishId(subjectTestPublishHistoryDO.getId()); + subjectTestStudentAnswerDO.setCommitStatus("0"); + subjectTestStudentAnswerDO.setCommentStatus("0"); + subjectTestStudentAnswerMapper.insert(subjectTestStudentAnswerDO); + } + return ConstantUtils.ADD_SUCCESS; + } + + public String updatePublish(PublishTestDTO publishTestDTO){ + + SubjectTestPublishHistoryDO subjectTestPublishHistoryDO = new SubjectTestPublishHistoryDO(); + BeanUtils.copyProperties(publishTestDTO,subjectTestPublishHistoryDO); + subjectTestPublishHistoryDO.setId(publishTestDTO.getPublishId()); + this.baseMapper.updateById(subjectTestPublishHistoryDO); + + // + subjectTestStudentAnswerMapper.delete(new QueryWrapper<SubjectTestStudentAnswerDO>() + .lambda() + .eq(SubjectTestStudentAnswerDO::getPublishId,publishTestDTO.getPublishId())); + + List<Long> longs = publishTestDTO.getStudentIds(); + for (Long lg : longs) { + SubjectTestStudentAnswerDO subjectTestStudentAnswerDO = new SubjectTestStudentAnswerDO(); + subjectTestStudentAnswerDO.setAnswer(""); + subjectTestStudentAnswerDO.setStudentId(lg); + subjectTestStudentAnswerDO.setPublishId(subjectTestPublishHistoryDO.getId()); + subjectTestStudentAnswerDO.setCommitStatus("0"); + subjectTestStudentAnswerDO.setCommentStatus("0"); + subjectTestStudentAnswerMapper.insert(subjectTestStudentAnswerDO); + } + return ConstantUtils.SUCCESS_UPDATE; + } + + public IPage<GetPublishHistoryVO> getPublishHistory(GetPublishHistoryDTO getPublishHistoryDTO) { + Page pager = new Page(getPublishHistoryDTO.getPageNum(), getPublishHistoryDTO.getPageSize()); + + IPage<GetPublishHistoryVO> getPublishHistoryVOIPage = this.baseMapper.getPublishHistory(pager,getPublishHistoryDTO.getRuleId(),getPublishHistoryDTO.getPublishName()); + + List<GetPublishHistoryVO> getPublishHistoryVOS = getPublishHistoryVOIPage.getRecords(); + + for (GetPublishHistoryVO getPublishHistoryVO : getPublishHistoryVOS){ + List<StudentVO> studentVOS = subjectTestStudentAnswerMapper.getPublishStudents(getPublishHistoryVO.getId()); + getPublishHistoryVO.setStudentVOS(studentVOS); + } + return getPublishHistoryVOIPage; + } + + + public IPage<GetTestReportVO> getTestReport(GetTestReportDTO getTestReportDTO){ + Page pager = new Page(getTestReportDTO.getPageNum(), getTestReportDTO.getPageSize()); + IPage<GetTestReportVO> getTestReportVOIPage = this.baseMapper.getTestReport(pager,getTestReportDTO.getRuleId(),getTestReportDTO.getPublishName()); + List<GetTestReportVO> getTestReportVOS = getTestReportVOIPage.getRecords(); + for (GetTestReportVO getTestReportVO : getTestReportVOS){ + List<StudentVO> studentVOS = subjectTestStudentAnswerMapper.getPublishStudents(getTestReportVO.getId()); + getTestReportVO.setStudentVOS(studentVOS); + } + return getTestReportVOIPage; + } + + public IPage<GetOnePublishVO> getOnePublish(GetOnePublishDTO getOnePublishDTO){ + Page pager = new Page(getOnePublishDTO.getPageNum(), getOnePublishDTO.getPageSize()); + IPage<GetOnePublishVO> getOnePublishVOIPage = this.baseMapper.getOnePublish(pager,getOnePublishDTO.getId(),getOnePublishDTO.getUserName(),getOnePublishDTO.getCommentStatus()); + List<GetOnePublishVO> getOnePublishVOS = getOnePublishVOIPage.getRecords(); + for (GetOnePublishVO getOnePublishVO : getOnePublishVOS){ + List<CommentVO> commentVOS = this.baseMapper.getCommentDetail(getOnePublishVO); + getOnePublishVO.setCommentVOS(commentVOS); + int count = 0 ; + int sum = 0; + for (CommentVO cv : commentVOS){ + sum += cv.getStar(); + } + double score = MathUtil.intDivFloorPercent(sum,count); + getOnePublishVO.setTotalStar(score); + } + return this.baseMapper.getOnePublish(pager,getOnePublishDTO.getId(),getOnePublishDTO.getUserName(),getOnePublishDTO.getCommentStatus()); + } + + public String comment(CommentDTO commentDTO){ + + List<SubjectStudentAnswerStarDO> subjectStudentAnswerStarDOS = commentDTO.getSubjectStudentAnswerStarDOS(); + + for (SubjectStudentAnswerStarDO subjectStudentAnswerStarDO : subjectStudentAnswerStarDOS){ + subjectStudentAnswerStarMapper.insert(subjectStudentAnswerStarDO); + } + return ConstantUtils.ADD_SUCCESS; + } + + public String deletePublish(SubjectTestPublishHistoryDO subjectTestPublishHistoryDO){ + this.baseMapper.deleteById(subjectTestPublishHistoryDO.getId()); + return ConstantUtils.DELETE_SUCCESS; + } +} diff --git a/src/main/java/com/meishu/service/impl/SubjectTestStudentAnswerServiceImpl.java b/src/main/java/com/meishu/service/impl/SubjectTestStudentAnswerServiceImpl.java new file mode 100644 index 0000000..1a8ca19 --- /dev/null +++ b/src/main/java/com/meishu/service/impl/SubjectTestStudentAnswerServiceImpl.java @@ -0,0 +1,20 @@ +package com.meishu.service.impl; + +import com.meishu.model.SubjectTestStudentAnswerDO; +import com.meishu.mapper.SubjectTestStudentAnswerMapper; +import com.meishu.service.SubjectTestStudentAnswerService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + * <p> + * 学生月考答卷 服务实现类 + * </p> + * + * @author Tuyp + * @since 2021-05-13 + */ +@Service +public class SubjectTestStudentAnswerServiceImpl extends ServiceImpl<SubjectTestStudentAnswerMapper, SubjectTestStudentAnswerDO> implements SubjectTestStudentAnswerService { + +} diff --git a/src/main/java/com/meishu/service/impl/SubjectTreeServiceImpl.java b/src/main/java/com/meishu/service/impl/SubjectTreeServiceImpl.java new file mode 100644 index 0000000..2d2261f --- /dev/null +++ b/src/main/java/com/meishu/service/impl/SubjectTreeServiceImpl.java @@ -0,0 +1,439 @@ +package com.meishu.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.meishu.dto.subject.GetSubjectTreeDTO; +import com.meishu.dto.subject.UpdateTreeOrderDTO; +import com.meishu.mapper.*; +import com.meishu.model.*; +import com.meishu.service.SubjectTreeService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.meishu.util.ConstantUtils; +import com.meishu.util.tree.SerialNumber; +import com.meishu.vo.subject.GetSubjectTreeVO; +import com.meishu.vo.subject.SubjectTreeOrder; +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.util.ArrayList; +import java.util.List; + +/** + * <p> + * 服务实现类 + * </p> + * + * @author Tuyp + * @since 2021-04-27 + */ +@Service +public class SubjectTreeServiceImpl extends ServiceImpl<SubjectTreeMapper, SubjectTreeDO> implements SubjectTreeService { + + @Autowired + private KnowledgeSubjectDictMapper knowledgeSubjectDictMapper; + + @Autowired + private SubjectTreeMapper subjectTreeMapper; + + @Autowired + private VodSubjectTreeMappingMapper vodSubjectTreeMappingMapper; + + @Autowired + private ExerciseTreeMappingMapper exerciseTreeMappingMapper; + + @Autowired + private AdministerMapper administerMapper; + + @Autowired + private VodDictMapper vodDictMapper; + + @Autowired + private ExerciseDictMapper exerciseDictMapper; + + public String updateSubjectTree(SubjectTreeDO subjectTreeDO) { + this.baseMapper.updateSubjectTree(subjectTreeDO); + return ConstantUtils.SUCCESS_UPDATE; + } + + @Transactional(rollbackFor = Exception.class) + public String addSubjectTree(SubjectTreeDO subjectTreeDO) { + + KnowledgeSubjectDictDO subjectDict = knowledgeSubjectDictMapper.selectById(subjectTreeDO.getSubjectId()); + + + subjectTreeDO.setSchool(ConstantUtils.SCHOOL); + subjectTreeDO.setSubjectType("高中"); + subjectTreeDO.setSubject(subjectDict.getSubjectName()); + subjectTreeDO.setSubjectEn(subjectDict.getSubjectEn()); + + List<SubjectTreeDO> subjectTreeDOS = new ArrayList<>(); + //编号 + if (null != subjectTreeDO.getParentId()) { + subjectTreeDOS = this.baseMapper.selectList(new QueryWrapper<SubjectTreeDO>() + .lambda() + .eq(SubjectTreeDO::getParentId, subjectTreeDO.getParentId()) + .eq(SubjectTreeDO::getSubjectEn, subjectDict.getSubjectEn()) + .orderByDesc(SubjectTreeDO::getTreeOrder)); + } else { + subjectTreeDOS = this.baseMapper.selectList(new QueryWrapper<SubjectTreeDO>() + .lambda() + .isNull(SubjectTreeDO::getParentId) + .eq(SubjectTreeDO::getSubjectEn, subjectDict.getSubjectEn()) + .orderByDesc(SubjectTreeDO::getTreeOrder)); + } + + if (subjectTreeDOS.size() == 0) { + subjectTreeDO.setTreeOrder(0); + } else { + subjectTreeDO.setTreeOrder(subjectTreeDOS.get(0).getTreeOrder() + 1); + } + + this.baseMapper.insert(subjectTreeDO); + + return ConstantUtils.ADD_SUCCESS; + } + + @Transactional(rollbackFor = Exception.class) + public String deleteSubjectTree(SubjectTreeDO subjectTreeDO) { + + List<SubjectTreeDO> subjectTreeDOS = this.baseMapper.selectList(new QueryWrapper<SubjectTreeDO>() + .lambda() + .eq(SubjectTreeDO::getParentId, subjectTreeDO.getId())); + + for (SubjectTreeDO subjectTreeDO1 : subjectTreeDOS) { + deleteChildNode(subjectTreeDO1); + } + + this.baseMapper.deleteById(subjectTreeDO.getId()); + + return ConstantUtils.DELETE_SUCCESS; + } + + public String updateTreeOrder(UpdateTreeOrderDTO updateTreeOrderDTO) { + + List<Long> longs = updateTreeOrderDTO.getIds(); + for (int i = 0; i < longs.size(); i++) { + SubjectTreeDO subjectTreeDO = this.baseMapper.selectById(longs.get(i)); + subjectTreeDO.setTreeOrder(i); + subjectTreeDO.setParentId(updateTreeOrderDTO.getParentId()); + this.baseMapper.updateSubjectTree(subjectTreeDO); + +// //课程下的知识点的顺序也要跟着变 +// List<CourseTreeDO> courseDictDOS = courseTreeMapper.selectList(new QueryWrapper<CourseTreeDO>() +// .lambda() +// .eq(CourseTreeDO::getTreeId, longs.get(i))); +// +// for (CourseTreeDO courseTreeDO : courseDictDOS) { +// courseTreeDO.setTreeOrder(i); +// courseTreeDO.setParentId(updateTreeOrderDTO.getParentId()); +// courseTreeDO.setChapterId(null); +// courseTreeMapper.updateTreeOrderNo(courseTreeDO); +// } + } + return ConstantUtils.SUCCESS_UPDATE; + } + + + //科目递归删除 + public void deleteChildNode(SubjectTreeDO subjectTreeDO) { + + List<SubjectTreeDO> subjectTreeDOS = this.baseMapper.selectList(new QueryWrapper<SubjectTreeDO>() + .lambda() + .eq(SubjectTreeDO::getParentId, subjectTreeDO.getId())); + + for (SubjectTreeDO subjectTreeDO1 : subjectTreeDOS) { + deleteChildNode(subjectTreeDO1); + } + this.baseMapper.deleteById(subjectTreeDO.getId()); + + } + + public List<GetSubjectTreeVO> getTreesCnt(GetSubjectTreeDTO getSubjectTreeDTO) { + + List<GetSubjectTreeVO> getSubjectTreeVOS = new ArrayList<>(); + + //判断老师角色 + List<RoleDictDO> roleDictDOS = administerMapper.getTeacherRoles(getSubjectTreeDTO.getUserId()); + + SerialNumber number = new SerialNumber(); + SubjectTreeOrder treeNode = new SubjectTreeOrder(".", number); + + boolean flag = false; //true 可以看全部的 false 没权限或者是授课老师 只能看三级 + + for (RoleDictDO roleDictDO : roleDictDOS) { + if (roleDictDO.getId() == 1 || roleDictDO.getId() == 2 || roleDictDO.getId() == 4) { + flag = true; + } + } + + GetSubjectTreeVO root = treeNode.getRoot(treeNode.getNodeList()); + + List<GetSubjectTreeVO> nodeList = new ArrayList<>(); + + int chapterId = 1; + + //获取科目的父节点 + List<SubjectTreeDO> subjectTreeDOS = subjectTreeMapper.selectList(new QueryWrapper<SubjectTreeDO>() + .lambda() + .eq(SubjectTreeDO::getSubjectId, getSubjectTreeDTO.getSubjectId()) + .isNull(SubjectTreeDO::getParentId) + .orderByAsc(SubjectTreeDO::getTreeOrder)); + + for (SubjectTreeDO std : subjectTreeDOS) { + GetSubjectTreeVO getSubjectTreeVO = SubjectTreeOrder.getNextNode(treeNode,root,nodeList); + List<Integer> vodCnt = new ArrayList<>(); + List<Integer> publicVodCnt = new ArrayList<>(); + List<Integer> exerciseCnt = new ArrayList<>(); + List<Integer> publicExerciseCnt = new ArrayList<>(); + BeanUtils.copyProperties(std, getSubjectTreeVO); + + int k = 0; //第k层 + + getSubjectTreeVO.setChildren(getChildNodes(chapterId,getSubjectTreeDTO.getUserId(),getSubjectTreeVO,publicVodCnt,publicExerciseCnt, vodCnt, exerciseCnt, k, flag, getSubjectTreeDTO.getShareStatus(),treeNode,nodeList)); + int i = 0; + for (Integer integer : vodCnt) { + i += integer; + } + getSubjectTreeVO.setVodCounts(i); + int j = 0; + for (Integer integer : exerciseCnt) { + j += integer; + } + getSubjectTreeVO.setExerciseCounts(j); + int m =0; + for (Integer integer : publicVodCnt) { + m += integer; + } + getSubjectTreeVO.setPublicVodCounts(m); + int n =0; + for (Integer integer : publicExerciseCnt) { + n += integer; + } + getSubjectTreeVO.setPublicExerciseVodCounts(n); + getSubjectTreeVO.setLayer(chapterId+""); + chapterId++; + getSubjectTreeVO.setText(getSubjectTreeVO.getText().replace("0.1",getSubjectTreeVO.getLayer())); + getSubjectTreeVO.setTreeNode(getSubjectTreeVO.getText()); + + getSubjectTreeVOS.add(getSubjectTreeVO); + } + return getSubjectTreeVOS; + + } + + public List<GetSubjectTreeVO> getTreesCheckCnt(GetSubjectTreeDTO getSubjectTreeDTO) { + + List<GetSubjectTreeVO> getSubjectTreeVOS = new ArrayList<>(); + + //判断老师角色 + List<RoleDictDO> roleDictDOS = administerMapper.getTeacherRoles(getSubjectTreeDTO.getUserId()); + + boolean flag = false; //true 可以看全部的 false 没权限或者是授课老师 只能看三级 + + for (RoleDictDO roleDictDO : roleDictDOS) { + if (roleDictDO.getId() == 1 || roleDictDO.getId() == 2 || roleDictDO.getId() == 4) { + flag = true; + } + } + + SerialNumber number = new SerialNumber(); + SubjectTreeOrder treeNode = new SubjectTreeOrder(".", number); + + + GetSubjectTreeVO root = treeNode.getRoot(treeNode.getNodeList()); + + List<GetSubjectTreeVO> nodeList = new ArrayList<>(); + + //获取科目的父节点 + List<SubjectTreeDO> subjectTreeDOS = subjectTreeMapper.selectList(new QueryWrapper<SubjectTreeDO>() + .lambda() + .eq(SubjectTreeDO::getSubjectId, getSubjectTreeDTO.getSubjectId()) + .isNull(SubjectTreeDO::getParentId) + .orderByAsc(SubjectTreeDO::getTreeOrder)); + + int chapterId = 1 ; + + for (SubjectTreeDO std : subjectTreeDOS) { + GetSubjectTreeVO getSubjectTreeVO = SubjectTreeOrder.getNextNode(treeNode,root,nodeList); + List<Integer> toCheckVodCnt = new ArrayList<>(); + List<Integer> checkVodCnt = new ArrayList<>(); + List<Integer> toCheckExerciseCnt = new ArrayList<>(); + List<Integer> checkExerciseCnt = new ArrayList<>(); + BeanUtils.copyProperties(std, getSubjectTreeVO); + + int k = 0; + + + getSubjectTreeVO.setLayer(chapterId+""); + chapterId++; + getSubjectTreeVO.setText(getSubjectTreeVO.getText().replace("0.1",getSubjectTreeVO.getLayer())); + getSubjectTreeVO.setTreeNode(getSubjectTreeVO.getText()); + + getSubjectTreeVO.setChildren(getCheckChildNodes(chapterId,getSubjectTreeVO, toCheckVodCnt, checkVodCnt,toCheckExerciseCnt,checkExerciseCnt, k, flag, getSubjectTreeDTO.getShareStatus(),treeNode,nodeList)); + int i = 0; + for (Integer integer : toCheckExerciseCnt) { + i += integer; + } + getSubjectTreeVO.setToCheckExerciseCounts(i); + int j = 0; + for (Integer integer : toCheckVodCnt) { + j += integer; + } + getSubjectTreeVO.setToCheckVodCounts(j); + int m = 0; + for (Integer integer : checkExerciseCnt) { + m += integer; + } + getSubjectTreeVO.setCheckExerciseCounts(m); + int l = 0; + for (Integer integer : checkVodCnt) { + l += integer; + } + getSubjectTreeVO.setCheckVodCounts(l); + + getSubjectTreeVOS.add(getSubjectTreeVO); + } + return getSubjectTreeVOS; + + } + + + /** + * 递归遍历子节点 + * + * @param getSubjectTreeVO 父节点填充子节点 + * @return + */ + public List<GetSubjectTreeVO> getChildNodes(Integer chapterId,Long userId,GetSubjectTreeVO getSubjectTreeVO, List<Integer> publicVodCnt, List<Integer> publicExerciseCnt,List<Integer> vodCnt, List<Integer> exerciseCnt, Integer k, boolean flag, String shareStatus,SubjectTreeOrder treeNode,List<GetSubjectTreeVO> nodeList ) { + + List<GetSubjectTreeVO> getSubjectTreeVOS = new ArrayList<>(); + + KnowledgeSubjectDictDO subjectDictDO = knowledgeSubjectDictMapper.selectById(getSubjectTreeVO.getSubjectId()); + + //查找该父节点下的子节点 + List<SubjectTreeDO> subjectTreeDOS = subjectTreeMapper.selectList(new QueryWrapper<SubjectTreeDO>() + .lambda() + .eq(SubjectTreeDO::getParentId, getSubjectTreeVO.getId()) + .orderByAsc(SubjectTreeDO::getTreeOrder)); + + getSubjectTreeVO.setChildNodeCounts(subjectTreeDOS.size()); + + getSubjectTreeVO.setLayer(chapterId+""); + getSubjectTreeVO.setText(getSubjectTreeVO.getText().replace("0.1",getSubjectTreeVO.getLayer())); + getSubjectTreeVO.setTreeNode(getSubjectTreeVO.getText()); + + //查找该节点下的视频数 个人库 + Integer vodCntTmp = vodSubjectTreeMappingMapper.getTreeVodCount(userId,getSubjectTreeVO.getId(),"0",subjectDictDO.getSubjectEn(),null); + getSubjectTreeVO.setVodCounts(vodCntTmp); + vodCnt.add(vodCntTmp); + + //查找该节点下的视频数 公共库 + Integer publicVodCntTmp = vodSubjectTreeMappingMapper.getTreeVodCount(null,getSubjectTreeVO.getId(),"1",subjectDictDO.getSubjectEn(),null); + getSubjectTreeVO.setPublicVodCounts(publicVodCntTmp); + publicVodCnt.add(publicVodCntTmp); + + //查找该节点下的题目数 个人库 + Integer exerciseTmp = exerciseTreeMappingMapper.getTreeExerciseCount(userId,getSubjectTreeVO.getId(),"0",subjectDictDO.getSubjectEn(),null); + getSubjectTreeVO.setExerciseCounts(exerciseTmp); + exerciseCnt.add(exerciseTmp); + + //查找该节点下的题目数 公共库 + Integer publicExerciseTmp = exerciseTreeMappingMapper.getTreeExerciseCount(null,getSubjectTreeVO.getId(),"1",subjectDictDO.getSubjectEn(),null); + getSubjectTreeVO.setPublicExerciseVodCounts(publicExerciseTmp); + publicExerciseCnt.add(publicExerciseTmp); + + getSubjectTreeVO.setCheckVodCounts(vodCntTmp); + getSubjectTreeVO.setCheckExerciseCounts(exerciseTmp); + + k++; + + if (k == 3 && !flag) { + return null; + } + + for (SubjectTreeDO subjectTreeDO1 : subjectTreeDOS) { + GetSubjectTreeVO getSubjectTreeVO1 = SubjectTreeOrder.getNextNode(treeNode,getSubjectTreeVO,nodeList); + BeanUtils.copyProperties(subjectTreeDO1, getSubjectTreeVO1); + getSubjectTreeVO1.setParentTreeName(getSubjectTreeVO.getTreeName()); + getSubjectTreeVOS.add(getSubjectTreeVO1); + getSubjectTreeVO1.setChildren(getChildNodes(chapterId,userId,getSubjectTreeVO1, publicVodCnt,publicExerciseCnt,vodCnt, exerciseCnt, k, flag, shareStatus,treeNode,nodeList)); + } + if (subjectTreeDOS.size() == 0) { + return null; + } + return getSubjectTreeVOS; + } + + /** + * 递归遍历子节点 + * + * @param getSubjectTreeVO 父节点填充子节点 + * @return + */ + public List<GetSubjectTreeVO> getCheckChildNodes(Integer chapterId,GetSubjectTreeVO getSubjectTreeVO, List<Integer> toCheckVodCnt, List<Integer> checkVodCnt,List<Integer> toCheckExerciseCnt, List<Integer> checkExerciseCnt, Integer k, boolean flag, String shareStatus,SubjectTreeOrder treeNode,List<GetSubjectTreeVO> nodeList ) { + + List<GetSubjectTreeVO> getSubjectTreeVOS = new ArrayList<>(); + + //查找该父节点下的子节点 + List<SubjectTreeDO> subjectTreeDOS = subjectTreeMapper.selectList(new QueryWrapper<SubjectTreeDO>() + .lambda() + .eq(SubjectTreeDO::getParentId, getSubjectTreeVO.getId()) + .orderByAsc(SubjectTreeDO::getTreeOrder)); + + getSubjectTreeVO.setChildNodeCounts(subjectTreeDOS.size()); + + //查找该节点下的视频数 已审核的视频 + Integer checkVod = 0; + + //查找该节点下的题目数 已审核的题目 + Integer checkExercise = 0; + + //待审核的视频数 + Integer toCheckVod = 0; + + //待审核的题目数 + Integer toCheckExercise = 0; + + KnowledgeSubjectDictDO subjectDictDO = knowledgeSubjectDictMapper.selectById(getSubjectTreeVO.getSubjectId()); + + //待审核 + toCheckVod = vodSubjectTreeMappingMapper.getTreeVodCount(null,getSubjectTreeVO.getId(),null,subjectDictDO.getSubjectEn(),"2"); + toCheckVodCnt.add(toCheckVod); + toCheckExercise = exerciseTreeMappingMapper.getTreeExerciseCount(null,getSubjectTreeVO.getId(),"0",subjectDictDO.getSubjectEn(),"2"); + getSubjectTreeVO.setToCheckExerciseCounts(toCheckExercise); + toCheckExerciseCnt.add(toCheckExercise); + //已审核 包括已通过 未通过 + checkVod = vodSubjectTreeMappingMapper.getTreeVodCount(null,getSubjectTreeVO.getId(),null,subjectDictDO.getSubjectEn(),"1"); + getSubjectTreeVO.setCheckVodCounts(checkVod); + checkVodCnt.add(checkVod); + checkExercise = exerciseTreeMappingMapper.getTreeExerciseCount(null,getSubjectTreeVO.getId(),"1",subjectDictDO.getSubjectEn(),"1"); + getSubjectTreeVO.setCheckExerciseCounts(checkExercise); + checkExerciseCnt.add(checkExercise); + getSubjectTreeVO.setToCheckVodCounts(toCheckVod); + + getSubjectTreeVO.setLayer(chapterId+""); + getSubjectTreeVO.setText(getSubjectTreeVO.getText().replace("0.1",getSubjectTreeVO.getLayer())); + getSubjectTreeVO.setTreeNode(getSubjectTreeVO.getText()); + + k++; + + if (k == 3 && !flag) { + return null; + } + + for (SubjectTreeDO subjectTreeDO1 : subjectTreeDOS) { + GetSubjectTreeVO getSubjectTreeVO1 = SubjectTreeOrder.getNextNode(treeNode,getSubjectTreeVO,nodeList); + BeanUtils.copyProperties(subjectTreeDO1, getSubjectTreeVO1); + getSubjectTreeVO1.setParentTreeName(getSubjectTreeVO.getTreeName()); + getSubjectTreeVOS.add(getSubjectTreeVO1); + getSubjectTreeVO1.setChildren(getCheckChildNodes(chapterId,getSubjectTreeVO1, toCheckVodCnt, checkVodCnt,toCheckExerciseCnt,checkExerciseCnt, k, flag, shareStatus,treeNode,nodeList)); + } + if (subjectTreeDOS.size() == 0) { + return null; + } + return getSubjectTreeVOS; + } + + +} diff --git a/src/main/java/com/meishu/service/impl/TaskCompletionStatusServiceImpl.java b/src/main/java/com/meishu/service/impl/TaskCompletionStatusServiceImpl.java new file mode 100644 index 0000000..e86c3c5 --- /dev/null +++ b/src/main/java/com/meishu/service/impl/TaskCompletionStatusServiceImpl.java @@ -0,0 +1,20 @@ +package com.meishu.service.impl; + +import com.meishu.model.TaskCompletionStatusDO; +import com.meishu.mapper.TaskCompletionStatusMapper; +import com.meishu.service.TaskCompletionStatusService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + * <p> + * 作业任务完成状态 服务实现类 + * </p> + * + * @author DengMin + * @since 2021-09-16 + */ +@Service +public class TaskCompletionStatusServiceImpl extends ServiceImpl<TaskCompletionStatusMapper, TaskCompletionStatusDO> implements TaskCompletionStatusService { + +} diff --git a/src/main/java/com/meishu/service/impl/TaskContentDoneInfoServiceImpl.java b/src/main/java/com/meishu/service/impl/TaskContentDoneInfoServiceImpl.java new file mode 100644 index 0000000..6cfbffc --- /dev/null +++ b/src/main/java/com/meishu/service/impl/TaskContentDoneInfoServiceImpl.java @@ -0,0 +1,20 @@ +package com.meishu.service.impl; + +import com.meishu.model.TaskContentDoneInfoDO; +import com.meishu.mapper.TaskContentDoneInfoMapper; +import com.meishu.service.TaskContentDoneInfoService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + * <p> + * 服务实现类 + * </p> + * + * @author DengMin + * @since 2021-09-30 + */ +@Service +public class TaskContentDoneInfoServiceImpl extends ServiceImpl<TaskContentDoneInfoMapper, TaskContentDoneInfoDO> implements TaskContentDoneInfoService { + +} diff --git a/src/main/java/com/meishu/service/impl/TaskContentServiceImpl.java b/src/main/java/com/meishu/service/impl/TaskContentServiceImpl.java new file mode 100644 index 0000000..8773e07 --- /dev/null +++ b/src/main/java/com/meishu/service/impl/TaskContentServiceImpl.java @@ -0,0 +1,20 @@ +package com.meishu.service.impl; + +import com.meishu.model.TaskContentDO; +import com.meishu.mapper.TaskContentMapper; +import com.meishu.service.TaskContentService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + * <p> + * 作业内容表(取题目,视频,书面作业) 服务实现类 + * </p> + * + * @author DengMin + * @since 2021-09-16 + */ +@Service +public class TaskContentServiceImpl extends ServiceImpl<TaskContentMapper, TaskContentDO> implements TaskContentService { + +} diff --git a/src/main/java/com/meishu/service/impl/TaskDoneHistoryServiceImpl.java b/src/main/java/com/meishu/service/impl/TaskDoneHistoryServiceImpl.java new file mode 100644 index 0000000..2fc243e --- /dev/null +++ b/src/main/java/com/meishu/service/impl/TaskDoneHistoryServiceImpl.java @@ -0,0 +1,20 @@ +package com.meishu.service.impl; + +import com.meishu.model.TaskDoneHistoryDO; +import com.meishu.mapper.TaskDoneHistoryMapper; +import com.meishu.service.TaskDoneHistoryService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + * <p> + * 服务实现类 + * </p> + * + * @author DengMin + * @since 2021-09-16 + */ +@Service +public class TaskDoneHistoryServiceImpl extends ServiceImpl<TaskDoneHistoryMapper, TaskDoneHistoryDO> implements TaskDoneHistoryService { + +} diff --git a/src/main/java/com/meishu/service/impl/UserRoleCopy1ServiceImpl.java b/src/main/java/com/meishu/service/impl/UserRoleCopy1ServiceImpl.java new file mode 100644 index 0000000..0d0fae8 --- /dev/null +++ b/src/main/java/com/meishu/service/impl/UserRoleCopy1ServiceImpl.java @@ -0,0 +1,20 @@ +package com.meishu.service.impl; + +import com.meishu.model.UserRoleCopy1DO; +import com.meishu.mapper.UserRoleCopy1Mapper; +import com.meishu.service.UserRoleCopy1Service; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + * <p> + * 学生表 服务实现类 + * </p> + * + * @author DengMin + * @since 2021-09-23 + */ +@Service +public class UserRoleCopy1ServiceImpl extends ServiceImpl<UserRoleCopy1Mapper, UserRoleCopy1DO> implements UserRoleCopy1Service { + +} diff --git a/src/main/java/com/meishu/service/impl/UserRoleServiceImpl.java b/src/main/java/com/meishu/service/impl/UserRoleServiceImpl.java new file mode 100644 index 0000000..0a4957c --- /dev/null +++ b/src/main/java/com/meishu/service/impl/UserRoleServiceImpl.java @@ -0,0 +1,154 @@ +package com.meishu.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.meishu.common.exception.HttpException; +import com.meishu.dto.sms.VerifyCodeDTO; +import com.meishu.dto.userrole.AccountLoginDTO; +import com.meishu.dto.userrole.AddStudentsDTO; +import com.meishu.dto.userrole.QueryStudentsDTO; +import com.meishu.mapper.UserRoleCopy1Mapper; +import com.meishu.model.*; +import com.meishu.mapper.UserRoleMapper; +import com.meishu.service.ClassesDictService; +import com.meishu.service.ClassesUserMappingService; +import com.meishu.service.SmsCodeService; +import com.meishu.service.UserRoleService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.meishu.util.ConstantUtils; +import com.meishu.util.excel.ExcelUtil; +import com.meishu.vo.userrole.QueryStudentsVO; +import com.meishu.vo.userrole.UserInfoVO; +import com.meishu.vo.userrole.UserRoleVO; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.Async; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; + +/** + * <p> + * 学生表 服务实现类 + * </p> + * + * @author Tuyp + * @since 2021-08-16 + */ +@Service +public class UserRoleServiceImpl extends ServiceImpl<UserRoleMapper, UserRoleDO> implements UserRoleService { + + @Autowired + private SmsCodeService smsCodeService; + + @Autowired + private ClassesDictService classesDictService; + + @Autowired + private UserRoleCopy1Mapper userRoleCopy1Mapper; + + public IPage<QueryStudentsVO> queryStudents(QueryStudentsDTO queryStudentsDTO){ + Page pager = new Page(queryStudentsDTO.getPageNum(), queryStudentsDTO.getPageSize()); + return this.baseMapper.queryStudents(pager,queryStudentsDTO.getUserName(),queryStudentsDTO.getGrade(),queryStudentsDTO.getSession(),queryStudentsDTO.getUserStatus()); + } + + public String addStudents(UserRoleDO userRoleDO){ + userRoleDO.setUserStatus("在读"); + userRoleDO.setRoleType("学生"); + this.baseMapper.insert(userRoleDO); + return ConstantUtils.ADD_SUCCESS; + } + + public String updateStudent(UserRoleDO userRoleDO){ + this.baseMapper.updateById(userRoleDO); + return ConstantUtils.SUCCESS_UPDATE; + } + + public List<QueryStudentsVO> exportStudents(QueryStudentsDTO queryStudentsDTO){ + return this.baseMapper.exportStudents(queryStudentsDTO.getUserName(),queryStudentsDTO.getGrade(),queryStudentsDTO.getSession(),queryStudentsDTO.getUserStatus()); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public UserRoleVO login(VerifyCodeDTO verifyCodeDTO) { + UserRoleVO userRoleVO = new UserRoleVO(); + UserRoleDO userRoleDO = this.baseMapper.selectOne(new QueryWrapper<UserRoleDO>() + .lambda() + .eq(UserRoleDO::getPhone, verifyCodeDTO.getPhone())); + if(userRoleDO == null) { + throw new HttpException(10010); + } + BeanUtils.copyProperties(userRoleDO, userRoleVO); + + SmsCodeDO smsCodeDO = smsCodeService.getOne(new QueryWrapper<SmsCodeDO>() + .lambda() + .eq(SmsCodeDO::getTelephone, verifyCodeDTO.getPhone()) + .eq(SmsCodeDO::getCode, verifyCodeDTO.getVerifyCode())); + if(smsCodeDO == null) { + throw new HttpException(70010); + } + + smsCodeService.removeById(smsCodeDO.getId()); + return userRoleVO; + } + + @Override + public UserInfoVO userInfo(Integer id) { + UserInfoVO userInfoVO = new UserInfoVO(); + UserRoleDO userRoleDO = this.baseMapper.selectById(id); + if(userRoleDO != null) { + BeanUtils.copyProperties(userRoleDO, userInfoVO); + ClassesDictDO classesDictDO = classesDictService.getClassesById((long)id); + if(classesDictDO != null) { + userInfoVO.setClasses(classesDictDO.getClassName()); + } + } + return userInfoVO; + } + + @Override + public UserRoleVO accountLogin(AccountLoginDTO accountLoginDTO) { + UserRoleVO userRoleVO = new UserRoleVO(); + UserRoleDO userRoleDO = this.baseMapper.selectOne(new QueryWrapper<UserRoleDO>() + .lambda() + .eq(UserRoleDO::getPassword, accountLoginDTO.getPassword()) + .eq(UserRoleDO::getIdCard, accountLoginDTO.getIdCard())); + if(userRoleDO == null) { + throw new HttpException(10004); + } + + BeanUtils.copyProperties(userRoleDO, userRoleVO); + return userRoleVO; + } + + public void studycode(){ + + List<UserRoleDO> userRoleDOS = this.baseMapper.selectList(null); + + for (UserRoleDO userRoleDO : userRoleDOS){ + + try { + + List<UserRoleCopy1DO> userRoleCopy1DO = userRoleCopy1Mapper.selectList(new QueryWrapper<UserRoleCopy1DO>() + .lambda() + .eq(UserRoleCopy1DO::getUserName,userRoleDO.getUserName()) + .eq(UserRoleCopy1DO::getGender,userRoleDO.getGender()) + .eq(UserRoleCopy1DO::getSession,userRoleDO.getSession())); + + if (userRoleCopy1DO.size()>0){ + userRoleDO.setStudyCode(userRoleCopy1DO.get(0).getStudyCode()); + this.baseMapper.updateById(userRoleDO); + } + }catch (Exception e){ + System.out.println("==========="+userRoleDO.getId()+"==="+userRoleDO.getUserName()); + } + + + } + + + } + +} diff --git a/src/main/java/com/meishu/service/impl/UserSubjectMappingServiceImpl.java b/src/main/java/com/meishu/service/impl/UserSubjectMappingServiceImpl.java new file mode 100644 index 0000000..8e17a7b --- /dev/null +++ b/src/main/java/com/meishu/service/impl/UserSubjectMappingServiceImpl.java @@ -0,0 +1,20 @@ +package com.meishu.service.impl; + +import com.meishu.model.UserSubjectMappingDO; +import com.meishu.mapper.UserSubjectMappingMapper; +import com.meishu.service.UserSubjectMappingService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + * <p> + * 老师-科目映射表 服务实现类 + * </p> + * + * @author Tuyp + * @since 2021-08-17 + */ +@Service +public class UserSubjectMappingServiceImpl extends ServiceImpl<UserSubjectMappingMapper, UserSubjectMappingDO> implements UserSubjectMappingService { + +} diff --git a/src/main/java/com/meishu/service/impl/UserSubjectPermissionDictServiceImpl.java b/src/main/java/com/meishu/service/impl/UserSubjectPermissionDictServiceImpl.java new file mode 100644 index 0000000..bf998b3 --- /dev/null +++ b/src/main/java/com/meishu/service/impl/UserSubjectPermissionDictServiceImpl.java @@ -0,0 +1,20 @@ +package com.meishu.service.impl; + +import com.meishu.model.UserSubjectPermissionDictDO; +import com.meishu.mapper.UserSubjectPermissionDictMapper; +import com.meishu.service.UserSubjectPermissionDictService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + * <p> + * 平时成绩---老师班级权限 服务实现类 + * </p> + * + * @author Tuyp + * @since 2021-08-18 + */ +@Service +public class UserSubjectPermissionDictServiceImpl extends ServiceImpl<UserSubjectPermissionDictMapper, UserSubjectPermissionDictDO> implements UserSubjectPermissionDictService { + +} diff --git a/src/main/java/com/meishu/service/impl/UuidHistoryServiceImpl.java b/src/main/java/com/meishu/service/impl/UuidHistoryServiceImpl.java new file mode 100644 index 0000000..3386a34 --- /dev/null +++ b/src/main/java/com/meishu/service/impl/UuidHistoryServiceImpl.java @@ -0,0 +1,20 @@ +package com.meishu.service.impl; + +import com.meishu.model.UuidHistoryDO; +import com.meishu.mapper.UuidHistoryMapper; +import com.meishu.service.UuidHistoryService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + * <p> + * 服务实现类 + * </p> + * + * @author DengMin + * @since 2021-09-29 + */ +@Service +public class UuidHistoryServiceImpl extends ServiceImpl<UuidHistoryMapper, UuidHistoryDO> implements UuidHistoryService { + +} diff --git a/src/main/java/com/meishu/service/impl/VodDictServiceImpl.java b/src/main/java/com/meishu/service/impl/VodDictServiceImpl.java new file mode 100644 index 0000000..204a415 --- /dev/null +++ b/src/main/java/com/meishu/service/impl/VodDictServiceImpl.java @@ -0,0 +1,507 @@ +package com.meishu.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.meishu.common.configure.VODConfig; +import com.meishu.common.exception.HttpException; +import com.meishu.dto.voddict.*; +import com.meishu.mapper.*; +import com.meishu.model.*; +import com.meishu.service.VodDictService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.meishu.util.ConstantUtils; +import com.meishu.util.Signature; +import com.meishu.vo.voddict.*; +import com.tencentcloudapi.common.Credential; +import com.tencentcloudapi.common.exception.TencentCloudSDKException; +import com.tencentcloudapi.common.profile.ClientProfile; +import com.tencentcloudapi.common.profile.HttpProfile; +import com.tencentcloudapi.vod.v20180717.VodClient; +import com.tencentcloudapi.vod.v20180717.models.*; +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.LocalDateTime; +import java.util.ArrayList; +import java.util.List; +import java.util.Random; + +/** + * <p> + * 视频字典表 服务实现类 + * </p> + * + * @author Tuyp + * @since 2021-04-27 + */ +@Service +public class VodDictServiceImpl extends ServiceImpl<VodDictMapper, VodDictDO> implements VodDictService { + + @Autowired + private VODConfig vodConfig; + + @Autowired + private VodPlayHistoryMapper vodPlayHistoryMapper; + + @Autowired + private VodSubjectTreeMappingMapper vodSubjectTreeMappingMapper; + + @Autowired + private KnowledgeSubjectDictMapper knowledgeSubjectDictMapper; + + @Autowired + private VodDictMapper vodDictMapper; + + @Autowired + private AdministerMapper administerMapper; + + + public SignatureVO signature() throws Exception { +// + SignatureVO signatureVO = new SignatureVO(); + + Signature signature = new Signature(); + signature.setSecretId(vodConfig.getSecretId()); + signature.setSecretKey(vodConfig.getSecretKey()); + signature.setCurrentTime(System.currentTimeMillis()); + signature.setRandom(new Random().nextInt(Integer.MAX_VALUE)); + signature.setSignValidDuration(3600 * 24 * 2); + + String sign = ""; + try { + sign = signature.getUploadSignature(); + signatureVO.setSign(sign); + } catch (Exception ex) { + ex.printStackTrace(); +// throw new MyException(ResultEnum.UNKNOWN_ERROR); + } + return signatureVO; + } + + public IPage<GetTreeVodsVO> getTreeVods(GetTreeVodsDTO getTreeVodsDTO) { + + Page pager = new Page(getTreeVodsDTO.getPageNum(), getTreeVodsDTO.getPageSize()); + + KnowledgeSubjectDictDO subjectDictDO = knowledgeSubjectDictMapper.selectById(getTreeVodsDTO.getSubjectId()); + + //查看该老师的科目信息 + List<KnowledgeSubjectDictDO> subjectDictDOS = administerMapper.getTeacherSubjects(getTreeVodsDTO.getUserId()); + + if ("1".equals(getTreeVodsDTO.getShareStatus())) { + getTreeVodsDTO.setUserId(null); //查看所有公共库的视频 + } + + List<String> strings = new ArrayList<>(); + for (KnowledgeSubjectDictDO subjectDictDO1 : subjectDictDOS) { + strings.add(subjectDictDO1.getSubjectEn()); + } + + IPage<GetTreeVodsVO> getTreeVodsVOIPage = this.baseMapper.getTreeVods(pager, getTreeVodsDTO.getTreeId(), subjectDictDO.getSubjectEn(), getTreeVodsDTO.getVodName(), getTreeVodsDTO.getVodType(), getTreeVodsDTO.getShareStatus(), getTreeVodsDTO.getUserId(), strings, getTreeVodsDTO.getCheckStatus()); + + List<GetTreeVodsVO> getTreeVodsVOS = getTreeVodsVOIPage.getRecords(); + for (GetTreeVodsVO getTreeVodsVO : getTreeVodsVOS) { + //获取视频播放量 + Integer count = vodPlayHistoryMapper.queryPlayCounts( getTreeVodsVO.getId()); + getTreeVodsVO.setPlayCounts(count); + + //视频知识点 + List<SubjectTreeDO> vodTreeMappingDOS = this.baseMapper.getTrees(getTreeVodsVO.getId()); + getTreeVodsVO.setTrees(vodTreeMappingDOS); + } + getTreeVodsVOIPage.setRecords(getTreeVodsVOS); + + return getTreeVodsVOIPage; + } + + public IPage<GetTreeVodsVO> getCheckTreeVods(GetTreeVodsDTO getTreeVodsDTO) { + + Page pager = new Page(getTreeVodsDTO.getPageNum(), getTreeVodsDTO.getPageSize()); + + KnowledgeSubjectDictDO subjectDictDO = knowledgeSubjectDictMapper.selectById(getTreeVodsDTO.getSubjectId()); + + //查看该老师的科目信息 + List<KnowledgeSubjectDictDO> subjectDictDOS = administerMapper.getTeacherSubjects(getTreeVodsDTO.getUserId()); + + List<String> strings = new ArrayList<>(); + for (KnowledgeSubjectDictDO subjectDictDO1 : subjectDictDOS) { + strings.add(subjectDictDO1.getSubjectEn()); + } + + IPage<GetTreeVodsVO> getTreeVodsVOIPage = this.baseMapper.getTreeVods(pager, getTreeVodsDTO.getTreeId(), subjectDictDO.getSubjectEn(), getTreeVodsDTO.getVodName(), getTreeVodsDTO.getVodType(), getTreeVodsDTO.getShareStatus(), null, strings, getTreeVodsDTO.getCheckStatus()); + + List<GetTreeVodsVO> getTreeVodsVOS = getTreeVodsVOIPage.getRecords(); + + for (GetTreeVodsVO getTreeVodsVO : getTreeVodsVOS) { + //获取视频播放量 + Integer count = vodPlayHistoryMapper.queryPlayCounts(getTreeVodsVO.getId()); + getTreeVodsVO.setPlayCounts(count); + + //视频知识点 + List<SubjectTreeDO> vodTreeMappingDOS = this.baseMapper.getTrees(getTreeVodsVO.getId()); + getTreeVodsVO.setTrees(vodTreeMappingDOS); + } + getTreeVodsVOIPage.setRecords(getTreeVodsVOS); + + return getTreeVodsVOIPage; + } + + @Transactional(rollbackFor = Exception.class) + public String deleteVod(VodDictDO vodDictDO) { + + VodDictDO vodDictDO1 = this.baseMapper.selectById(vodDictDO.getId()); + + this.baseMapper.deleteById(vodDictDO.getId()); + + vodSubjectTreeMappingMapper.delete(new QueryWrapper<VodSubjectTreeMappingDO>() + .lambda() + .eq(VodSubjectTreeMappingDO::getVodId, vodDictDO.getId())); + + try{ + + //上传后直接转码 + Credential cred = new Credential(vodConfig.getSecretId(), vodConfig.getSecretKey()); + + HttpProfile httpProfile = new HttpProfile(); + httpProfile.setEndpoint("vod.tencentcloudapi.com"); + + ClientProfile clientProfile = new ClientProfile(); + clientProfile.setHttpProfile(httpProfile); + + VodClient client = new VodClient(cred, "", clientProfile); + + // 实例化一个请求对象,每个接口都会对应一个request对象 + DeleteMediaRequest req = new DeleteMediaRequest(); + req.setFileId(vodDictDO1.getVodCode()); + // 返回的resp是一个DeleteMediaResponse的实例,与请求对象对应 + client.DeleteMedia(req); + } catch (TencentCloudSDKException e) { + System.out.println(e.toString()); + } + + return ConstantUtils.DELETE_SUCCESS; + } + + @Transactional(rollbackFor = Exception.class) + public VodDictDO uploadVods(UploadVodsDTO uploadVodsDTO) { + + KnowledgeSubjectDictDO subjectDictDO = knowledgeSubjectDictMapper.selectById(uploadVodsDTO.getSubjectId()); + + VodDictDO vodDictDO = new VodDictDO(); + BeanUtils.copyProperties(uploadVodsDTO, vodDictDO); + vodDictDO.setStatus("0"); + vodDictDO.setShareStatus("0"); //刚上传的视频属于个人库 + vodDictDO.setCheckStatus("0"); //刚上传的视频,没有审核状态 + vodDictDO.setSubjectId(subjectDictDO.getSubjectEn()); + vodDictDO.setCreateDate(LocalDateTime.now()); + vodDictDO.setUpdateDate(LocalDateTime.now()); + this.baseMapper.insert(vodDictDO); + + List<Long> longs = uploadVodsDTO.getTreeIds(); + for (Long lg : longs) { + VodSubjectTreeMappingDO vodTreeMappingDO = new VodSubjectTreeMappingDO(); + vodTreeMappingDO.setTreeId(lg); + vodTreeMappingDO.setVodId(vodDictDO.getId()); + vodTreeMappingDO.setStatus("1"); + vodSubjectTreeMappingMapper.insert(vodTreeMappingDO); + +// //包含知识点的课程,也会传上该视频 +// //找到包含 该知识点的courseTree +// List<CourseTreeDO> courseTreeDOS = courseTreeMapper.selectList(new QueryWrapper<CourseTreeDO>() +// .lambda() +// .eq(CourseTreeDO::getTreeId, lg)); +// +// for (CourseTreeDO courseTreeDO : courseTreeDOS) { +// //新增记录 +// VodCourseTreeMappingDO vodCourseTreeMappingDO = new VodCourseTreeMappingDO(); +// vodCourseTreeMappingDO.setVodId(vodDictDO.getId()); +// vodCourseTreeMappingDO.setTreeId(courseTreeDO.getId()); +// vodCourseTreeMappingDO.setStatus("0"); +// vodCourseTreeMappingMapper.insert(vodCourseTreeMappingDO); +// } + } + + //上传后直接转码 + Credential cred = new Credential(vodConfig.getSecretId(), vodConfig.getSecretKey()); + + HttpProfile httpProfile = new HttpProfile(); + httpProfile.setEndpoint("vod.tencentcloudapi.com"); + + ClientProfile clientProfile = new ClientProfile(); + clientProfile.setHttpProfile(httpProfile); + + VodClient client = new VodClient(cred, "", clientProfile); + + ProcessMediaRequest processMediaRequest = new ProcessMediaRequest(); + MediaProcessTaskInput mediaProcessTaskInput1 = new MediaProcessTaskInput(); + TranscodeTaskInput[] transcodeTaskInputs1 = new TranscodeTaskInput[1]; + TranscodeTaskInput transcodeTaskInput1 = new TranscodeTaskInput(); + transcodeTaskInput1.setDefinition(ConstantUtils.TEMPLATE_VOD); + transcodeTaskInputs1[0] = transcodeTaskInput1; + mediaProcessTaskInput1.setTranscodeTaskSet(transcodeTaskInputs1); + processMediaRequest.setMediaProcessTask(mediaProcessTaskInput1); + processMediaRequest.setFileId(uploadVodsDTO.getVodCode()); + + ProcessMediaResponse processMediaResponse = null; + try { + processMediaResponse = client.ProcessMedia(processMediaRequest); + System.out.println(processMediaResponse); + } catch (Exception ex) { + throw new HttpException(50001); + } + + return vodDictDO; + } + + public String updateVod(UploadVodsDTO uploadVodsDTO) { + + VodDictDO vodDictDO = new VodDictDO(); + BeanUtils.copyProperties(uploadVodsDTO, vodDictDO); + this.baseMapper.updateById(vodDictDO); + + vodSubjectTreeMappingMapper.delete(new QueryWrapper<VodSubjectTreeMappingDO>() + .lambda() + .in(VodSubjectTreeMappingDO::getVodId, uploadVodsDTO.getId())); + +// //从新传了新视频,需要转码 +// if (!uploadVodsDTO.getVodUrl().contains("100030")){ +// //上传后直接转码 +// Credential cred = new Credential(vodConfig.getSecretId(), vodConfig.getSecretKey()); +// +// HttpProfile httpProfile = new HttpProfile(); +// httpProfile.setEndpoint("vod.tencentcloudapi.com"); +// +// ClientProfile clientProfile = new ClientProfile(); +// clientProfile.setHttpProfile(httpProfile); +// +// VodClient client = new VodClient(cred, "", clientProfile); +// +// ProcessMediaRequest processMediaRequest = new ProcessMediaRequest(); +// MediaProcessTaskInput mediaProcessTaskInput1 = new MediaProcessTaskInput(); +// TranscodeTaskInput[] transcodeTaskInputs1 = new TranscodeTaskInput[1]; +// TranscodeTaskInput transcodeTaskInput1 = new TranscodeTaskInput(); +// transcodeTaskInput1.setDefinition(ConstantUtils.TEMPLATE_VOD); +// transcodeTaskInputs1[0] = transcodeTaskInput1; +// mediaProcessTaskInput1.setTranscodeTaskSet(transcodeTaskInputs1); +// processMediaRequest.setMediaProcessTask(mediaProcessTaskInput1); +// processMediaRequest.setFileId(uploadVodsDTO.getVodCode()); +// +// ProcessMediaResponse processMediaResponse = null; +// try { +// processMediaResponse = client.ProcessMedia(processMediaRequest); +// System.out.println(processMediaResponse); +// +// //删除原视频 TODO +// } catch (Exception ex) { +// throw new HttpException(50001); +// } +// } + + List<Long> longs = uploadVodsDTO.getTreeIds(); + for (Long lg : longs) { + VodSubjectTreeMappingDO vodTreeMappingDO = new VodSubjectTreeMappingDO(); + vodTreeMappingDO.setTreeId(lg); + vodTreeMappingDO.setVodId(vodDictDO.getId()); + vodSubjectTreeMappingMapper.insert(vodTreeMappingDO); + } + return ConstantUtils.SUCCESS_UPDATE; + } + + public VodDictDO getVodInfo(VodDictDO vodDictDO) { + return this.baseMapper.selectById(vodDictDO.getId()); + } + + public String insertPlayHistory(VodPlayHistoryDO vodPlayHistoryDO) { + vodPlayHistoryMapper.insert(vodPlayHistoryDO); + return ConstantUtils.ADD_SUCCESS; + } + + public GetToCheckCountsVO getToCheckVodCounts(GetToCheckVodCountsDTO getToCheckVodCountsDTO) { + + GetToCheckCountsVO getToCheckVodCountsVO = new GetToCheckCountsVO(); + + KnowledgeSubjectDictDO subjectDictDO = knowledgeSubjectDictMapper.selectById(getToCheckVodCountsDTO.getSubjectId()); + + + Integer counts = this.baseMapper.selectCount(new QueryWrapper<VodDictDO>() + .lambda() + .eq(VodDictDO::getSubjectId, subjectDictDO.getSubjectEn()) + .eq(VodDictDO::getCheckStatus, "2")); + + getToCheckVodCountsVO.setToCheckCounts(counts); + //已审核 包括已通过 未通过 + Integer counts1 = this.baseMapper.selectCount(new QueryWrapper<VodDictDO>() + .lambda() + .eq(VodDictDO::getSubjectId, subjectDictDO.getSubjectEn()) + .in(VodDictDO::getCheckStatus, new String[]{"1", "3"})); + + + getToCheckVodCountsVO.setCheckCounts(counts1); + + return getToCheckVodCountsVO; + } + + @Transactional(rollbackFor = Exception.class) + public String compressVodByCode(VodDictDO vodDictDO) { + + VodDictDO vodDictDO1 = this.baseMapper.selectById(vodDictDO.getId()); + + //转码 + Credential cred = new Credential(vodConfig.getSecretId(), vodConfig.getSecretKey()); + + HttpProfile httpProfile = new HttpProfile(); + httpProfile.setEndpoint("vod.tencentcloudapi.com"); + + ClientProfile clientProfile = new ClientProfile(); + clientProfile.setHttpProfile(httpProfile); + + VodClient client = new VodClient(cred, "", clientProfile); + + ProcessMediaRequest processMediaRequest = new ProcessMediaRequest(); + MediaProcessTaskInput mediaProcessTaskInput1 = new MediaProcessTaskInput(); + TranscodeTaskInput[] transcodeTaskInputs1 = new TranscodeTaskInput[1]; + TranscodeTaskInput transcodeTaskInput1 = new TranscodeTaskInput(); + transcodeTaskInput1.setDefinition(ConstantUtils.TEMPLATE_VOD); + transcodeTaskInputs1[0] = transcodeTaskInput1; + mediaProcessTaskInput1.setTranscodeTaskSet(transcodeTaskInputs1); + processMediaRequest.setMediaProcessTask(mediaProcessTaskInput1); + processMediaRequest.setFileId(vodDictDO1.getVodCode()); + + ProcessMediaResponse processMediaResponse = null; + try { + processMediaResponse = client.ProcessMedia(processMediaRequest); + System.out.println(processMediaResponse); + } catch (Exception ex) { + throw new HttpException(50001); + } + + + return ConstantUtils.COMPRESS_SUCCESS; + } + + public String deleteOriginVod(DeleteOriginVodDTO deleteOriginVodDTO) { + //转码 + Credential cred = new Credential(vodConfig.getSecretId(), vodConfig.getSecretKey()); + + HttpProfile httpProfile = new HttpProfile(); + httpProfile.setEndpoint("vod.tencentcloudapi.com"); + + ClientProfile clientProfile = new ClientProfile(); + clientProfile.setHttpProfile(httpProfile); + + VodClient client = new VodClient(cred, "", clientProfile); + + //删除原视频 + try { + + //替换原视频的地址 + List<MediaProcessResultSet> mediaProcessResultSets = deleteOriginVodDTO.getProcedureStateChangeEvent() + .getMediaProcessResultSet(); + + VodDictDO vodDictDO = vodDictMapper.selectOne(new QueryWrapper<VodDictDO>() + .lambda() + .eq(VodDictDO::getVodCode, deleteOriginVodDTO.getProcedureStateChangeEvent().getFileId())); + + vodDictDO.setVodUrl(mediaProcessResultSets.get(0).getTranscodeTask().getOutput().getUrl()); + vodDictMapper.updateById(vodDictDO); + + DeleteMediaRequest req = new DeleteMediaRequest(); + req.setFileId(deleteOriginVodDTO.getProcedureStateChangeEvent().getFileId()); + + MediaDeleteItem[] mediaDeleteItems1 = new MediaDeleteItem[1]; + MediaDeleteItem mediaDeleteItem1 = new MediaDeleteItem(); + mediaDeleteItem1.setType("OriginFiles"); + mediaDeleteItems1[0] = mediaDeleteItem1; + + req.setDeleteParts(mediaDeleteItems1); + + client.DeleteMedia(req); + + } catch (Exception e) { + System.out.println(e.toString()); + } + + return ConstantUtils.DELETE_SUCCESS; + } + + public String checkVod(CheckVodDTO checkVodDTO) { + + //审核通过 + if ("1".equals(checkVodDTO.getCheckStatus())) { + VodDictDO vodDictDO1 = vodDictMapper.selectById(checkVodDTO.getId()); + + vodDictDO1.setVodName(checkVodDTO.getVodName()); + vodDictDO1.setVodType(checkVodDTO.getVodType()); + vodDictDO1.setShareStatus("1"); //已共享 + vodDictDO1.setCheckStatus("1");// 已通过审核 + vodDictMapper.updateById(vodDictDO1); + + List<Long> ids = checkVodDTO.getTreeIds(); + + //删除之前原视频的关联知识点 + vodSubjectTreeMappingMapper.delete(new QueryWrapper<VodSubjectTreeMappingDO>() + .lambda() + .eq(VodSubjectTreeMappingDO::getVodId, vodDictDO1.getId())); + + for (Long lg : ids) { + //知识点关联 + VodSubjectTreeMappingDO vodSubjectTreeMappingDO = new VodSubjectTreeMappingDO(); + vodSubjectTreeMappingDO.setVodId(vodDictDO1.getId()); + vodSubjectTreeMappingDO.setTreeId(lg); + vodSubjectTreeMappingDO.setStatus("0"); //不是关联视频 + vodSubjectTreeMappingMapper.insert(vodSubjectTreeMappingDO); + } + } else { + //不通过 + VodDictDO vodDictDO = new VodDictDO(); + BeanUtils.copyProperties(checkVodDTO, vodDictDO); + this.baseMapper.updateById(vodDictDO); + } + return ConstantUtils.CHECK_STATUS; + } + + public IPage<VodDictDO> publicUpload(PublicCheckingDTO publicCheckingDTO) { + + Page pager = new Page(publicCheckingDTO.getPageNum(), publicCheckingDTO.getPageSize()); + return this.baseMapper.selectPage(pager, new QueryWrapper<VodDictDO>() + .lambda() + .eq(VodDictDO::getAdministerId, publicCheckingDTO.getUserId()) + .eq(VodDictDO::getCheckStatus, publicCheckingDTO.getCheckStatus()) + .orderByDesc(VodDictDO::getUpdateDate)); + } + + public String withdraw(VodDictDO vodDictDO) { + vodDictDO.setCheckStatus("0"); + vodDictDO.setShareStatus("0"); + this.baseMapper.updateById(vodDictDO); + return ConstantUtils.SET_SUCCESS; + } + + public GetVodDetailVO getVodDetail(VodDictDO vodDictDO) { + + GetVodDetailVO getVodDetailVO = new GetVodDetailVO(); + + VodDictDO vodDictDO1 = this.baseMapper.selectById(vodDictDO.getId()); + BeanUtils.copyProperties(vodDictDO1, getVodDetailVO); + + List<SubjectTreeDO> subjectTreeDOS = this.baseMapper.getTrees(vodDictDO.getId()); + + getVodDetailVO.setSubjectTreeDOS(subjectTreeDOS); + return getVodDetailVO; + } + + public String setRelatedVod(VodSubjectTreeMappingDO vodSubjectTreeMappingDO){ + + VodSubjectTreeMappingDO vodSubjectTreeMappingDO1 = new VodSubjectTreeMappingDO(); + vodSubjectTreeMappingDO1.setStatus(vodSubjectTreeMappingDO.getStatus()); + + vodSubjectTreeMappingMapper.update(vodSubjectTreeMappingDO1,new QueryWrapper<VodSubjectTreeMappingDO>() + .lambda() + .eq(VodSubjectTreeMappingDO::getVodId,vodSubjectTreeMappingDO.getVodId())); + + return ConstantUtils.SUCCESS_UPDATE; + } + +} diff --git a/src/main/java/com/meishu/service/impl/VodPlayHistoryServiceImpl.java b/src/main/java/com/meishu/service/impl/VodPlayHistoryServiceImpl.java new file mode 100644 index 0000000..9b0c9a0 --- /dev/null +++ b/src/main/java/com/meishu/service/impl/VodPlayHistoryServiceImpl.java @@ -0,0 +1,20 @@ +package com.meishu.service.impl; + +import com.meishu.model.VodPlayHistoryDO; +import com.meishu.mapper.VodPlayHistoryMapper; +import com.meishu.service.VodPlayHistoryService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + * <p> + * 视频播放历史记录表 服务实现类 + * </p> + * + * @author Tuyp + * @since 2021-04-27 + */ +@Service +public class VodPlayHistoryServiceImpl extends ServiceImpl<VodPlayHistoryMapper, VodPlayHistoryDO> implements VodPlayHistoryService { + +} diff --git a/src/main/java/com/meishu/service/impl/VodSubjectTreeMappingServiceImpl.java b/src/main/java/com/meishu/service/impl/VodSubjectTreeMappingServiceImpl.java new file mode 100644 index 0000000..12d179d --- /dev/null +++ b/src/main/java/com/meishu/service/impl/VodSubjectTreeMappingServiceImpl.java @@ -0,0 +1,51 @@ +package com.meishu.service.impl; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.meishu.dto.subject.BatchStatusOprDTO; +import com.meishu.dto.subject.GetAllVodsStatusDTO; +import com.meishu.mapper.VodDictMapper; +import com.meishu.model.VodSubjectTreeMappingDO; +import com.meishu.mapper.VodSubjectTreeMappingMapper; +import com.meishu.service.VodSubjectTreeMappingService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.meishu.util.ConstantUtils; +import com.meishu.vo.subject.GetAllNoAuthenVodsVO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * <p> + * 视频知识点映射表 服务实现类 + * </p> + * + * @author Tuyp + * @since 2021-04-27 + */ +@Service +public class VodSubjectTreeMappingServiceImpl extends ServiceImpl<VodSubjectTreeMappingMapper, VodSubjectTreeMappingDO> implements VodSubjectTreeMappingService { + + @Autowired + private VodDictMapper vodDictMapper; + + public IPage<GetAllNoAuthenVodsVO> getAllNoAuthenVods(GetAllVodsStatusDTO getAllNoAuthenVodsDTO){ + Page pager = new Page(getAllNoAuthenVodsDTO.getPageNum(), getAllNoAuthenVodsDTO.getPageSize()); + IPage<GetAllNoAuthenVodsVO> getAllNoAuthenVodsVOIPage = this.baseMapper.getAllNoAuthenVods(pager,getAllNoAuthenVodsDTO.getTreeId(),getAllNoAuthenVodsDTO.getStatus(),getAllNoAuthenVodsDTO.getVodType()); + List<GetAllNoAuthenVodsVO> getAllNoAuthenVodsVOS = getAllNoAuthenVodsVOIPage.getRecords(); + for (GetAllNoAuthenVodsVO getAllNoAuthenVodsVO : getAllNoAuthenVodsVOS){ + getAllNoAuthenVodsVO.setSubjectTreeDOS(vodDictMapper.getVodTrees(getAllNoAuthenVodsVO.getId())); + } + return getAllNoAuthenVodsVOIPage; + } + + public String batchStatusOpr(BatchStatusOprDTO batchStatusOprDTO){ + + List<Long> ids = batchStatusOprDTO.getIds(); + for (Long lg : ids){ + vodDictMapper.updateStatus(lg,batchStatusOprDTO.getStatus()); + } + return ConstantUtils.SET_SUCCESS; + } +} diff --git a/src/main/java/com/meishu/service/impl/WrittenHomeworkServiceImpl.java b/src/main/java/com/meishu/service/impl/WrittenHomeworkServiceImpl.java new file mode 100644 index 0000000..fd1b7b6 --- /dev/null +++ b/src/main/java/com/meishu/service/impl/WrittenHomeworkServiceImpl.java @@ -0,0 +1,20 @@ +package com.meishu.service.impl; + +import com.meishu.model.WrittenHomeworkDO; +import com.meishu.mapper.WrittenHomeworkMapper; +import com.meishu.service.WrittenHomeworkService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + * <p> + * 通知/附件作业表 服务实现类 + * </p> + * + * @author DengMin + * @since 2021-09-16 + */ +@Service +public class WrittenHomeworkServiceImpl extends ServiceImpl<WrittenHomeworkMapper, WrittenHomeworkDO> implements WrittenHomeworkService { + +} diff --git a/src/main/java/com/meishu/util/BaseModel.java b/src/main/java/com/meishu/util/BaseModel.java new file mode 100644 index 0000000..8017603 --- /dev/null +++ b/src/main/java/com/meishu/util/BaseModel.java @@ -0,0 +1,35 @@ +package com.meishu.util; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.FieldStrategy; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableLogic; +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.time.LocalDateTime; + +@Data +public abstract class BaseModel { + + /** + * 创建时间 + */ + @JsonIgnore + @TableField(insertStrategy = FieldStrategy.NEVER, updateStrategy = FieldStrategy.NEVER, value = "create_date", fill = FieldFill.INSERT) + private LocalDateTime createDate; + + /** + * 更新时间 + */ + @JsonIgnore + @TableField(insertStrategy = FieldStrategy.NEVER, updateStrategy = FieldStrategy.NEVER, value = "update_date", fill = FieldFill.UPDATE) + private LocalDateTime updateDate; + + /** + * 删除时间 + */ + @JsonIgnore + @TableLogic + private LocalDateTime deleteDate; +} diff --git a/src/main/java/com/meishu/util/CodeGenerator.java b/src/main/java/com/meishu/util/CodeGenerator.java new file mode 100644 index 0000000..64203ae --- /dev/null +++ b/src/main/java/com/meishu/util/CodeGenerator.java @@ -0,0 +1,124 @@ +package com.meishu.util; + +import com.baomidou.mybatisplus.annotation.DbType; +import com.baomidou.mybatisplus.core.exceptions.MybatisPlusException; +import com.baomidou.mybatisplus.core.toolkit.StringPool; +import com.baomidou.mybatisplus.core.toolkit.StringUtils; +import com.baomidou.mybatisplus.generator.AutoGenerator; +import com.baomidou.mybatisplus.generator.InjectionConfig; +import com.baomidou.mybatisplus.generator.config.*; +import com.baomidou.mybatisplus.generator.config.po.TableInfo; +import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy; +import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine; + +import java.util.ArrayList; +import java.util.List; +import java.util.ResourceBundle; +import java.util.Scanner; + +/** + * Mybatis-Plus CodeGenerator + * + * @author DengMin + * @date 2020/07/02 + **/ +public class CodeGenerator { + + public static String scanner(String tip) { + StringBuilder help = new StringBuilder(); + help.append("1.生成全部表 2.输入需要生成表名"); + System.out.println(help.toString()); + Scanner scanner = new Scanner(System.in); + Integer ipt = Integer.valueOf(scanner.next()); + if(ipt == 1) { + return ""; + } else if(ipt == 2) { + StringBuilder help1 = new StringBuilder(); + help1.append("请输入" + tip + ":"); + System.out.println(help1.toString()); + Scanner scanner1 = new Scanner(System.in); + if (scanner1.hasNext()) { + String name = scanner1.next(); + if (StringUtils.isNotEmpty(name)) { + return name; + } + } + throw new MybatisPlusException("请输入正确的" + tip + "!"); + } + return scanner(tip); + } + + public static void main(String[] args) { + final ResourceBundle rb = ResourceBundle.getBundle("mybatis-plus"); + // 代码生成器 + AutoGenerator mpg = new AutoGenerator(); + + // 全局配置 + GlobalConfig gc = new GlobalConfig(); + gc.setOutputDir(System.getProperty("user.dir") + rb.getString("outputDir")); + gc.setOpen(false); + gc.setBaseResultMap(true); + gc.setBaseColumnList(true); + gc.setAuthor(rb.getString("author")); + gc.setMapperName("%sMapper"); + gc.setEntityName("%sDO"); + gc.setServiceName("%sService"); + gc.setServiceImplName("%sServiceImpl"); + gc.setControllerName("%sController"); + mpg.setGlobalConfig(gc); + + // 数据源配置 + DataSourceConfig dsc = new DataSourceConfig(); + dsc.setDbType(DbType.MYSQL); + dsc.setUrl(rb.getString("url")); + dsc.setDriverName(rb.getString("driverName")); + dsc.setUsername(rb.getString("userName")); + dsc.setPassword(rb.getString("password")); + mpg.setDataSource(dsc); + + // 包配置 + PackageConfig pc = new PackageConfig(); + pc.setParent(rb.getString("setParent")); + pc.setController("controller"); + pc.setService("service"); + pc.setServiceImpl("service.impl"); + pc.setEntity("model"); + pc.setMapper("mapper"); + mpg.setPackageInfo(pc); + + // 自定义配置 + InjectionConfig cfg = new InjectionConfig() { + @Override + public void initMap() { + // to do nothing + } + }; + List<FileOutConfig> focList = new ArrayList<>(); + focList.add(new FileOutConfig("/templates/mapper.xml.ftl") { + @Override + public String outputFile(TableInfo tableInfo) { + // 自定义输入文件名称 + return System.getProperty("user.dir")+ rb.getString("mapperPath") + tableInfo.getMapperName() + StringPool.DOT_XML; + } + }); + cfg.setFileOutConfigList(focList); + mpg.setCfg(cfg); + mpg.setTemplate(new TemplateConfig().setXml(null)); + + // 策略配置 + StrategyConfig strategy = new StrategyConfig(); + strategy.setNaming(NamingStrategy.underline_to_camel); + strategy.setColumnNaming(NamingStrategy.underline_to_camel); + strategy.setSuperEntityClass(BaseModel.class); + strategy.setEntityLombokModel(true); + strategy.setRestControllerStyle(true); + String [] tables = scanner("表名,多个英文逗号分割").split(","); + if(StringUtils.isNotBlank(tables[0])) { + strategy.setInclude(tables); + } + strategy.setControllerMappingHyphenStyle(true); + mpg.setStrategy(strategy); + mpg.setTemplateEngine(new FreemarkerTemplateEngine()); + mpg.execute(); + } +} \ No newline at end of file diff --git a/src/main/java/com/meishu/util/CodeTrans.java b/src/main/java/com/meishu/util/CodeTrans.java new file mode 100644 index 0000000..e3835ba --- /dev/null +++ b/src/main/java/com/meishu/util/CodeTrans.java @@ -0,0 +1,31 @@ +package com.meishu.util; + +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.Scanner; + +public class CodeTrans { + + public static void main(String[] args) { + + System.out.println("请输入手机号:"); + Scanner scanner = new Scanner(System.in); + String telephone = scanner.nextLine(); + //String telephone = "15201936167"; + SimpleDateFormat sj1 = new SimpleDateFormat("YYYY-MM-dd HH:mm:ss"); + String current = sj1.format(new Date()); + //System.out.println(current); + String[] arrTemp = current.split(" "); + + String[] timeArr = arrTemp[1].split(":"); + Integer first = Integer.valueOf(timeArr[1].substring(0,1)); + Integer second = Integer.valueOf(timeArr[0].substring(0,1)); + Integer third = Integer.valueOf(timeArr[0].substring(1)); + Integer fourth = Integer.valueOf(timeArr[1].substring(1)); + //System.out.println(first +"===" + second +"===" +third+"===="+fourth); + System.err.println("验证码是:"+telephone.charAt(first)+"->"+telephone.charAt(second)+"->"+telephone.charAt(third)+"->"+telephone.charAt(fourth)); + System.exit(0); + + } + +} diff --git a/src/main/java/com/meishu/util/ConstantUtils.java b/src/main/java/com/meishu/util/ConstantUtils.java new file mode 100644 index 0000000..47e6ca9 --- /dev/null +++ b/src/main/java/com/meishu/util/ConstantUtils.java @@ -0,0 +1,89 @@ +package com.meishu.util; + + +/** + * 枚举类 + */ +public class ConstantUtils { + + public static final String DELETE_SUCCESS = "删除成功"; + + public static final String UPLOAD_FAIL = "上传失败"; + + public static final String ADD_SUCCESS = "新增成功"; + + public static final String COMMIT_SUCCESS = "提交成功"; + + public static final String SUCCESS_SEND_OUT = "发送成功"; + + public static final String FAIL_SEND_OUT = "发送失败"; + + public static final String SAVE_SUCCESS = "保存成功"; + + public static final String SHARE_SUCCESS = "共享成功"; + + public static final String SUBMIT_SUCCESS = "提交成功"; + + public static final String SUCCESS_UPDATE = "更新成功"; + + public static final String FAIL_UPDATE = "更新失败"; + + public static final String SET_SUCCESS = "设置成功"; + + public static final String SUCCESS_VERIFY = "验证成功"; + + public static final String FAIL_VERIFY = "验证失败"; + + public static final String COMPANY_NAME = "TeachAI"; + + public static final String ALREADY_DONE = "已完成"; + + public static final String ALREADY_RECOMMEND = "已推荐"; + + public static final String VERIFY_NAME = "有课互联"; + + public static final String NOTICE_NAME = "有课进度通知"; + + public static final String PUBLISH_SUCCESS = "发布成功"; + + public static final String LOGIN_OUT ="登出成功"; + + public static final String COMPRESS_SUCCESS = "压缩成功"; + + public static final String SCHOOL = "上海市市西中学"; + + public static final String CHECK_STATUS = "审核通过"; + + /** + * 短信模板---验证模板 + */ + public static final String TEMPLATE_CODE = "SMS_190945394"; + + /** + * 短信 地域ID + */ + public static final String REGION_ID = "cn-hangzhou"; + + /** + * 短信 RAM账号AccessKey ID + */ + public static final String ACCESS_KEY_ID = "LTAIOrpFKrDqsQ2c"; + + /** + * 短信 RAM账号AccessKey Secret + */ + public static final String SECRET = "1Qp8huLETbWiBBJvHXJ7MOIhtKuA1G"; + + /** + * 腾讯云点播视频转码模板 + */ + public static final Long TEMPLATE_VOD = 100030L; + + /** + * 手机端token + */ + public static final String MOBILE_TERMINATE = "mobile"; + + public static final String ADMINISTER_TERMINATE = "administer"; + +} diff --git a/src/main/java/com/meishu/util/DateFormatUtil.java b/src/main/java/com/meishu/util/DateFormatUtil.java new file mode 100644 index 0000000..b63f146 --- /dev/null +++ b/src/main/java/com/meishu/util/DateFormatUtil.java @@ -0,0 +1,82 @@ +package com.meishu.util; + +import java.text.SimpleDateFormat; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Date; +import java.util.Locale; + +/** + * 处理时间工具 + * + * @author DengMin + * @date 2019/08/27 13:56 + **/ +public class DateFormatUtil { + + public final static String YEAR = "yyyy"; + public final static String FMT_sdf14_L = "yyyy-MM-dd HH:mm:ss"; + public final static String FMT_sdf_yMd = "yyyy-MM-dd"; + public final static String FMT_sdf_yM = "yyyy-M"; + public final static String FMT_sdf_yMM = "yyyy-MM"; + public final static String FMT_sdf_Hm = "H:mm"; + public final static String FMT_sdf_HHmm = "HH:mm"; + public final static String cron = "s m H d M ? yyyy"; + + /** + * Date转String,自定义格式 + * @param date + * @param pattern + * @return + */ + public static String format(Date date, String pattern) { + try { + SimpleDateFormat sdf = new SimpleDateFormat(pattern); + return sdf.format(date); + } catch (Exception e) { + e.printStackTrace(); + return null; + } + } + + /** + * String转Date,自定义格式 + * @param date + * @param pattern + * @return + */ + public static Date parse(String date, String pattern) { + try { + SimpleDateFormat sdf = new SimpleDateFormat(pattern); + return sdf.parse(date); + } catch (Exception e) { + e.printStackTrace(); + return null; + } + } + + /** + * 比较两个时间 + * .after 大于 + * .before 小于 + * @param d1 + * @param d2 + * @return + */ + public static boolean compare(Date d1, Date d2 ) { + if(d1.after(d2)) { + return false; + } + return true; + } + + /** + * Data转Cron + * @param date + * @return + */ + public static String getCron(Date date) { + SimpleDateFormat sdf = new SimpleDateFormat("s m H d M ? yyyy"); + return sdf.format(date); + } +} diff --git a/src/main/java/com/meishu/util/EncryptUtil.java b/src/main/java/com/meishu/util/EncryptUtil.java new file mode 100644 index 0000000..2416450 --- /dev/null +++ b/src/main/java/com/meishu/util/EncryptUtil.java @@ -0,0 +1,35 @@ +package com.meishu.util; + +import com.amdelamar.jhash.Hash; +import com.amdelamar.jhash.algorithms.Type; +import com.amdelamar.jhash.exception.InvalidHashException; + +public class EncryptUtil { + + /** + * 设置密文密码 + * + * @param password 原始密码 + * @return 加密密码 + */ + public static String encrypt(String password) { + char[] chars = password.toCharArray(); + return Hash.password(chars).algorithm(Type.PBKDF2_SHA256).create(); + } + + /** + * 验证加密密码 + * + * @param encryptedPassword 密文密码 + * @param plainPassword 明文密码 + * @return 验证是否成功 + */ + public static boolean verify(String encryptedPassword, String plainPassword) { + char[] chars = plainPassword.toCharArray(); + try { + return Hash.password(chars).algorithm(Type.PBKDF2_SHA256).verify(encryptedPassword); + } catch (InvalidHashException e) { + return false; + } + } +} diff --git a/src/main/java/com/meishu/util/HttpUtil.java b/src/main/java/com/meishu/util/HttpUtil.java new file mode 100644 index 0000000..e91b7c3 --- /dev/null +++ b/src/main/java/com/meishu/util/HttpUtil.java @@ -0,0 +1,64 @@ +package com.meishu.util; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import org.springframework.http.*; +import org.springframework.web.client.RestTemplate; + +import java.util.HashMap; +import java.util.Map; + +/** + * http请求 + */ +public class HttpUtil { + + /** + * GET 请求 + * @param params + * @param url + * @return + */ + public static JSONObject get(Map<String, Object> params, String url) { + RestTemplate restTemplate = new RestTemplate(); + ResponseEntity<String> responseEntity = restTemplate.getForEntity(url, String.class, params); + String body = responseEntity.getBody(); + JSONObject object = JSON.parseObject(body); + return object; + } + + /** + * POST 请求 + * @param params + * @param url + * @return + */ + public static JSONObject post(Map<String, Object> params, String url) { + RestTemplate restTemplate = new RestTemplate(); + ResponseEntity<String> responseEntity = restTemplate.postForEntity(url, params, String.class); + String body = responseEntity.getBody(); + JSONObject object = JSON.parseObject(body); + return object; + } + + /** + * POST 请求 带Token + * + * @param param + * @param token + * @param url + * @return + */ + public static JSONObject sendPost(Map<String, Object> param, String token, String url, Object obj) { + RestTemplate restTemplate = new RestTemplate(); + HttpHeaders headers = new HttpHeaders(); + headers.setContentType(MediaType.APPLICATION_JSON); + headers.add("Accept", MediaType.ALL_VALUE); + headers.add("Authorization", "Bearer " + token); + HttpEntity<String> formEntity = new HttpEntity<String>(param.toString(), headers); + ResponseEntity<String> responseEntity = restTemplate.exchange(url, HttpMethod.POST, formEntity, String.class, obj); + String body = responseEntity.getBody(); + JSONObject object = JSON.parseObject(body); + return object; + } +} diff --git a/src/main/java/com/meishu/util/JwtUtil.java b/src/main/java/com/meishu/util/JwtUtil.java new file mode 100644 index 0000000..e4a4cfe --- /dev/null +++ b/src/main/java/com/meishu/util/JwtUtil.java @@ -0,0 +1,96 @@ +package com.meishu.util; + +import com.auth0.jwt.JWT; +import com.auth0.jwt.JWTVerifier; +import com.auth0.jwt.algorithms.Algorithm; +import com.auth0.jwt.interfaces.Claim; + +import java.util.Date; +import java.util.Map; + +/** + * <p> + * Token工具 + * </p> + * + * @author DengMin + * @since 2021/4/14 + */ +public class JwtUtil { + + private static Long EXPIRE_TIME = 24 * 60 * 60 * 1000L; + + private static String SECRET = "PBKDF2SHA256:64000:18:24:N:GFHZ6Y0PTEUDYCJI3K6SOOXWYEKPOZED:WBWFJMX5DF252E0HR3BF3P/D"; + + /** + * 生成Token + * @param id + * @return + */ + public static String generateToken(Long id, String type) { + Date expireDate = new Date(System.currentTimeMillis() + EXPIRE_TIME); + return JWT.create() + .withClaim("id", id) + .withClaim("type", type) + .withAudience() + .withExpiresAt(expireDate) + .withIssuedAt(new Date()) + .sign(Algorithm.HMAC256(SECRET)); + } + + /** + * 检验token是否正确 + * @param token + * @return + */ + public static boolean verifyToken(String token) { + try { + Algorithm algorithm = Algorithm.HMAC256(SECRET); + JWTVerifier verifier = JWT.require(algorithm).build(); + verifier.verify(token); + return true; + } catch (Exception e) { + return false; + } + } + + /** + * 获取用户自定义Claim集合 + * @param token + * @return + */ + public static Map<String, Claim> getClaims(String token) { + Algorithm algorithm = Algorithm.HMAC256(SECRET); + JWTVerifier verifier = JWT.require(algorithm).build(); + Map<String, Claim> claims = verifier.verify(token).getClaims(); + return claims; + } + + /** + * 获取过期时间 + * @param token + * @return + */ + public static Date getExpiresAt(String token) { + Algorithm algorithm = Algorithm.HMAC256(SECRET); + return JWT + .require(algorithm) + .build() + .verify(token) + .getExpiresAt(); + } + + /** + * 验证token是否失效 + * @param token + * @return true: 过期, false: 没过期 + */ + public static boolean isExpired(String token) { + try { + final Date expiration = getExpiresAt(token); + return expiration.before(new Date()); + } catch (Exception e) { + return true; + } + } +} diff --git a/src/main/java/com/meishu/util/LatexUtils.java b/src/main/java/com/meishu/util/LatexUtils.java new file mode 100644 index 0000000..dac38fc --- /dev/null +++ b/src/main/java/com/meishu/util/LatexUtils.java @@ -0,0 +1,124 @@ +package com.meishu.util; + +import org.scilab.forge.jlatexmath.TeXConstants; +import org.scilab.forge.jlatexmath.TeXFormula; +import org.scilab.forge.jlatexmath.TeXIcon; + +import javax.imageio.ImageIO; +import javax.swing.*; +import java.awt.*; +import java.awt.image.BufferedImage; +import java.io.*; + +/** + * @author: tuyp + * @create: 2020-08-08 21:19 + */ +public class LatexUtils { + + /** + * @Description: 将base64编码字符串转换为图片 + * @Author: + * @CreateTime: + * @param imgStr + * base64编码字符串 + * @param path + * 图片路径-具体到文件 + * @return + */ + public static boolean generateImage(String imgStr, String path) { + if (imgStr == null) { + return false; + } +// BASE64Decoder decoder = new BASE64Decoder(); + try { +// byte[] b = decoder.decodeBuffer(imgStr); +// for (int i = 0; i < b.length; i++) { +// if (b[i] < 0) { +// b[i] += 256; +// } +// } +// OutputStream out = new FileOutputStream(path); +// out.write(b); +// out.flush(); +// out.close(); + return true; + } catch (Exception e) { + // TODO: handle exception + return false; + } + } + + /** + * @Description: 根据图片地址转换为base64编码字符串 + * @Author: + * @CreateTime: + * @return + */ +// public static String getImageStr(String imgFile) { +// InputStream inputStream = null; +// byte[] data = null; +// try { +// inputStream = new FileInputStream(imgFile); +// data = new byte[inputStream.available()]; +// inputStream.read(data); +// inputStream.close(); +// } catch (IOException e) { +// e.printStackTrace(); +// } +// // 加密 +// BASE64Encoder encoder = new BASE64Encoder(); +// return encoder.encode(data); +// } + + // latex 转 imgbase64 + public static String latex2Png(String latex) { + try { + TeXFormula formula = new TeXFormula(latex); + // render the formla to an icon of the same size as the formula. + TeXIcon icon = formula.createTeXIcon(TeXConstants.STYLE_DISPLAY, 20); + // insert a border + icon.setInsets(new Insets(1, 1, 1, 1)); + // now create an actual image of the rendered equation + BufferedImage image = new BufferedImage(icon.getIconWidth(), icon.getIconHeight(), BufferedImage.TYPE_BYTE_GRAY); + Graphics2D g2 = image.createGraphics(); + g2.setColor(Color.white); + g2.fillRect(0, 0, icon.getIconWidth(), icon.getIconHeight()); + JLabel jl = new JLabel(); + jl.setForeground(new Color(0, 0, 0)); + icon.paintIcon(jl, g2, 0, 0); + // at this point the image is created, you could also save it with ImageIO + // saveImage(image, "png", "F:\\b.png"); +// ImageIO.write(image, "png", new File("F:\\c.png")); + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + try { + ImageIO.write(image, "png", outputStream); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + return null; + } + byte[] buffer = outputStream.toByteArray(); +// BASE64Encoder encoder = new BASE64Encoder(); + return ("data:image/png;base64,"); + } catch (Exception e) { + // e.printStackTrace(); + // ExceptionUtil.log(log, e); + System.err.println("公式解析有误:\n" + latex); + // e.printStackTrace(); + return null; + } + } + + public static void main(String[] args) { + String str = latex2Png("\\(\\sqrt[3]{2+x}\\)"); + System.out.println(str); + + + + +// String omml =Latex_Word.latexToWord(str); +// System.out.println(omml); + } + +} diff --git a/src/main/java/com/meishu/util/Localstorage.java b/src/main/java/com/meishu/util/Localstorage.java new file mode 100644 index 0000000..926b833 --- /dev/null +++ b/src/main/java/com/meishu/util/Localstorage.java @@ -0,0 +1,21 @@ +package com.meishu.util; + +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class Localstorage { + + private static final ThreadLocal<Object> local = ThreadLocal.withInitial(() -> null); + + public static void setUser(Object admin) { + Localstorage.local.set(admin); + } + + public static Object getUser() { + return Localstorage.local.get(); + } + + public static void remove() { + Localstorage.local.remove(); + } +} diff --git a/src/main/java/com/meishu/util/MathUtil.java b/src/main/java/com/meishu/util/MathUtil.java new file mode 100644 index 0000000..086c4f0 --- /dev/null +++ b/src/main/java/com/meishu/util/MathUtil.java @@ -0,0 +1,129 @@ +package com.meishu.util; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.util.Random; + +public class MathUtil { + + public static String getRandomCode(int randomLength) { + StringBuilder str = new StringBuilder(); + Random random = new Random(); + for (int i = 0; i < randomLength; i++) { + str.append(random.nextInt(10)); + } + return str.toString(); + } + + public static String getRandomString(int length) { + StringBuilder val = new StringBuilder(); + Random random = new Random(); + for (int i = 0; i < length; ++i) { + String charOrNum = random.nextInt(3) % 3 == 0 ? "num" : "char"; + if ("char".equalsIgnoreCase(charOrNum)) { + int temp = random.nextInt(2) % 2 == 0 ? 65 : 97; + val.append((char) (random.nextInt(26) + temp)); + } else { + val.append(random.nextInt(10)); + } + } + return val.toString(); + } + + //习题/视频 ==> 秒钟向上取整 + public static String ceilSecond(int length) { + return String.valueOf((int) Math.ceil((double) length / 60)); + } + + //视频秒数处理 + public static String vodLength(int i) { + if (i > 60) { + if (i % 60 >= 10) { + return i / 60 + ":" + i % 60; + } else { + return i / 60 + ":0" + i % 60; + } + } else { + if (i % 60 >= 10) { + return "00:" + i; + } else { + return "00:0" + i; + } + } + } + + //文件大小处理 + public static String fileUnit(int i) { + if (i / 1024 > 1024) { + return String.format("%.2f", (double) i / 1024 / 1024) + "M"; + } else { + return String.format("%.2f", (double) i / 1024) + "K"; + } + } + + //单个题目秒数处理 + public static String exerciseLength(int i) { + if (i >= 60 * 60) { + return i / 60 / 60 + "时" + (i - 60 * 60) / 60 + "分" + i % 60 + "秒"; + } else if (i >= 60) { + return i / 60 + "分" + i % 60 + "秒"; + } else { + return i % 60 + "秒"; + } + } + + // 除法取整 + public static String getAvgIndex(BigDecimal counts, BigDecimal total) { + if (BigDecimal.ZERO.equals(total)) { + return "0"; + } else { + return counts.divide(total, RoundingMode.CEILING).stripTrailingZeros().toPlainString(); + } + } + + //百分比 取整 返回字符串 + public static String getPercentAvgIndex(BigDecimal counts, BigDecimal total) { + if (BigDecimal.ZERO.equals(total) || BigDecimal.ZERO.equals(counts)) { + return "0%"; + } else { + return counts.multiply(new BigDecimal(100)).divide(total, RoundingMode.CEILING).stripTrailingZeros().toPlainString() + "%"; + } + } + + //百分比 不带%输出 + public static String getPercentAvgIndexWithPercent(BigDecimal counts, BigDecimal total) { + if (BigDecimal.ZERO.equals(total) || BigDecimal.ZERO.equals(counts)) { + return "0"; + } else { + return counts.multiply(new BigDecimal(100)).divide(total, RoundingMode.CEILING).stripTrailingZeros().toPlainString(); + } + } + + + //习题序号生成规则 sid 从数据取出某科目某知识点的最大的序号 + public static String getExeCode(String sid) { + Integer integer = Integer.valueOf(sid.substring(9)); + return sid.substring(0, 9) + (++integer); + } + + // 整型a 整型b a/b 向上取整 + public static Integer intDivCeil(long a, int b) { + return (int) Math.ceil((double) a / b); + } + + // 整型a 整型b a/b 向下取整 + public static Integer intDivFloorPercent(long a, int b) { + return (int) Math.floor((double) a * 100 / b); + } + + public static Integer getRandomNum(Integer i){ + Random random = new Random(); + return random.nextInt(i); + } + +// public static void main(String[] args) { +// for (int i= 1;i<100;i++){ +// System.out.println(getRandomNum(2)); +// } +// } +} diff --git a/src/main/java/com/meishu/util/RandomUtil.java b/src/main/java/com/meishu/util/RandomUtil.java new file mode 100644 index 0000000..63e1af6 --- /dev/null +++ b/src/main/java/com/meishu/util/RandomUtil.java @@ -0,0 +1,19 @@ +package com.meishu.util; + +import java.util.Random; + +public class RandomUtil { + + public static int getCode() { + return (int)((Math.random() * 9 + 1) * 100000); + } + + public static String getRandomCode(int randomLength) { + StringBuilder str = new StringBuilder(); + Random random = new Random(); + for (int i = 0; i < randomLength; i++) { + str.append(random.nextInt(10)); + } + return str.toString(); + } +} diff --git a/src/main/java/com/meishu/util/SMSUtils.java b/src/main/java/com/meishu/util/SMSUtils.java new file mode 100644 index 0000000..be412dc --- /dev/null +++ b/src/main/java/com/meishu/util/SMSUtils.java @@ -0,0 +1,137 @@ +package com.meishu.util; + +import com.aliyuncs.CommonRequest; +import com.aliyuncs.CommonResponse; +import com.aliyuncs.DefaultAcsClient; +import com.aliyuncs.IAcsClient; +import com.aliyuncs.dysmsapi.model.v20170525.SendSmsRequest; +import com.aliyuncs.dysmsapi.model.v20170525.SendSmsResponse; +import com.aliyuncs.http.MethodType; +import com.aliyuncs.profile.DefaultProfile; +import com.aliyuncs.profile.IClientProfile; +import com.meishu.common.configure.AliyunSmsProperties; +import com.meishu.common.exception.HttpException; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 短信发送工具类 + */ + +@Component +public class SMSUtils { + + @Autowired + private AliyunSmsProperties aliyunSmsProperties; + + public SendSmsResponse send(String phone, String code) { + try { + System.setProperty("sun.net.client.defaultConnectTimeout", "10000"); + System.setProperty("sun.net.client.defaultReadTimeout", "10000"); + + //初始化acsClient,暂不支持region化 + IClientProfile profile = DefaultProfile.getProfile("cn-hangzhou", aliyunSmsProperties.getAccessKeyId(), aliyunSmsProperties.getAccessKeySecret()); + DefaultProfile.addEndpoint("cn-hangzhou", "cn-hangzhou", aliyunSmsProperties.getProduct(), aliyunSmsProperties.getDomain()); + IAcsClient acsClient = new DefaultAcsClient(profile); + + //组装请求对象-具体描述见控制台-文档部分内容 + SendSmsRequest request = new SendSmsRequest(); + //必填:待发送手机号 + request.setPhoneNumbers(phone); + //必填:短信签名-可在短信控制台中找到 + request.setSignName("有课互联"); + //必填:短信模板-可在短信控制台中找到 + request.setTemplateCode("SMS_190945394"); + //可选:模板中的变量替换JSON串,如模板内容为"亲爱的${name},您的验证码为${code}"时,此处的值为 + request.setTemplateParam("{\"code\":\""+ code +"\"}"); + + //hint 此处可能会抛出异常,注意catch + SendSmsResponse sendSmsResponse = acsClient.getAcsResponse(request); + if(sendSmsResponse != null && sendSmsResponse.getCode().equals("OK")) { + return sendSmsResponse; + } + + throw new Exception(sendSmsResponse.getMessage()); + } catch (Exception e) { + throw new HttpException(70011); + } + } + + + /** + * 发送验证码短信 + * @param templateId 短信模板id + * @param telephone 手机号 + * @return + */ + public static String sendVerifySMS(String templateId,String telephone,String param){ + DefaultProfile profile = DefaultProfile.getProfile(ConstantUtils.REGION_ID, ConstantUtils.ACCESS_KEY_ID, ConstantUtils.SECRET); + IAcsClient client = new DefaultAcsClient(profile); + + CommonRequest request = new CommonRequest(); + request.setSysMethod(MethodType.POST); + request.setSysDomain("dysmsapi.aliyuncs.com"); + request.setSysVersion("2017-05-25"); + request.setSysAction("SendSms"); + request.putQueryParameter("RegionId",ConstantUtils.REGION_ID); + request.putQueryParameter("PhoneNumbers",telephone); + request.putQueryParameter("SignName",ConstantUtils.VERIFY_NAME); + request.putQueryParameter("TemplateCode",templateId); +// if (StringUtils.isEmpty(param)){ +// request.putQueryParameter("TemplateParam","{ \"code\":\""+verifyCode +"\"}"); +// } + request.putQueryParameter("TemplateParam",param); + CommonResponse response = null; + try { + response = client.getCommonResponse(request); + return ConstantUtils.SUCCESS_SEND_OUT; + } catch(Exception e) { + e.printStackTrace(); + return ConstantUtils.FAIL_SEND_OUT; + } + } + + /** + * 发送通知短信 + * @param templateId 短信模板id + * @param telephone 手机号 + * @return + */ + public static String sendNoticeSMS(String templateId,String telephone,String param){ + DefaultProfile profile = DefaultProfile.getProfile(ConstantUtils.REGION_ID, ConstantUtils.ACCESS_KEY_ID, ConstantUtils.SECRET); + IAcsClient client = new DefaultAcsClient(profile); + + CommonRequest request = new CommonRequest(); + request.setSysMethod(MethodType.POST); + request.setSysDomain("dysmsapi.aliyuncs.com"); + request.setSysVersion("2017-05-25"); + request.setSysAction("SendSms"); + request.putQueryParameter("RegionId",ConstantUtils.REGION_ID); + request.putQueryParameter("PhoneNumbers",telephone); + request.putQueryParameter("SignName",ConstantUtils.NOTICE_NAME); + request.putQueryParameter("TemplateCode",templateId); +// if (StringUtils.isEmpty(param)){ +// request.putQueryParameter("TemplateParam","{ \"code\":\""+verifyCode +"\"}"); +// } + request.putQueryParameter("TemplateParam",param); + CommonResponse response = null; + try + + { + response = client.getCommonResponse(request); + return ConstantUtils.SUCCESS_SEND_OUT; + } catch( + Exception e) + + { + e.printStackTrace(); + return ConstantUtils.FAIL_SEND_OUT; + } + } + + public static void main(String[] args) { + String param = "{ \"company\":\""+"基金会"+ "\",\"time\":\""+"2020-01-02" +"\",\"address\":\""+"上海市" +"\"}"; + sendNoticeSMS("SMS_215336604","15201936167",param); + } + +} diff --git a/src/main/java/com/meishu/util/SecretUtils.java b/src/main/java/com/meishu/util/SecretUtils.java new file mode 100644 index 0000000..f6a3e1e --- /dev/null +++ b/src/main/java/com/meishu/util/SecretUtils.java @@ -0,0 +1,119 @@ +package com.meishu.util; + +import org.apache.commons.codec.binary.Hex; + +import java.math.BigInteger; +import java.nio.charset.StandardCharsets; +import java.security.MessageDigest; +import java.util.Random; +import java.util.UUID; + +public class SecretUtils { + + /** + * 对用户登录密码进行MD5加密 + * + * @param str + * @return + */ + + public static String getMD5String(String str) { + try { + // 生成一个MD5加密计算摘要 + MessageDigest md = MessageDigest.getInstance("MD5"); + // 计算md5函数 + md.update(str.getBytes()); + // digest()最后确定返回md5 hash值,返回值为8位字符串。因为md5 hash值是16位的hex值,实际上就是8位的字符 + // BigInteger函数则将8位的字符串转换成16位hex值,用字符串来表示;得到字符串形式的hash值 + //一个byte是八位二进制,也就是2位十六进制字符(2的8次方等于16的2次方) + return new BigInteger(1, md.digest()).toString(16); + } catch (Exception e) { + e.printStackTrace(); + return null; + } + } + + /** + * 对字符串进行SHA加密 + * + * @param + */ + public static String getSHAString(String str) { + try { + MessageDigest sha = MessageDigest.getInstance("SHA-1"); + + byte[] byteArray = str.getBytes(StandardCharsets.UTF_8); + byte[] md5Bytes = sha.digest(byteArray); + StringBuffer hexValue = new StringBuffer(); + for (int i = 0; i < md5Bytes.length; i++) { + int val = ((int) md5Bytes[i]) & 0xff; + if (val < 16) { + hexValue.append("0"); + } + hexValue.append(Integer.toHexString(val)); + } + + return hexValue.toString(); + } catch (Exception e) { + return null; + } + + } + + + private static byte[] md5(String s) + { + MessageDigest algorithm; + try + { + algorithm = MessageDigest.getInstance("MD5"); + algorithm.reset(); + algorithm.update(s.getBytes("UTF-8")); + byte[] messageDigest = algorithm.digest(); + return messageDigest; + } + catch (Exception e) + { + + } + return null; + } + + private static final String toHex(byte hash[]) + { + if (hash == null) + { + return null; + } + StringBuffer buf = new StringBuffer(hash.length * 2); + int i; + + for (i = 0; i < hash.length; i++) + { + if ((hash[i] & 0xff) < 0x10) + { + buf.append("0"); + } + buf.append(Long.toString(hash[i] & 0xff, 16)); + } + return buf.toString(); + } + + public static String hash(String s) + { + try + { + return new String(toHex(md5(s)).getBytes("UTF-8"), "UTF-8"); + } + catch (Exception e) + { + return s; + } + } + + public static void main(String[] args) { + String uuid = UUID.randomUUID().toString(); + System.out.println(uuid); + System.out.println(hash(uuid+"ixihs")); + } +} \ No newline at end of file diff --git a/src/main/java/com/meishu/util/Signature.java b/src/main/java/com/meishu/util/Signature.java new file mode 100644 index 0000000..94e99d2 --- /dev/null +++ b/src/main/java/com/meishu/util/Signature.java @@ -0,0 +1,79 @@ +package com.meishu.util; + +import sun.misc.BASE64Encoder; + +import javax.crypto.Mac; +import javax.crypto.spec.SecretKeySpec; +import java.nio.charset.StandardCharsets; + +/** + * @author: tuyp + * @create: 2020-07-29 12:42 + */ +public class Signature { + private String secretId; + private String secretKey; + private long currentTime; + private int random; + private int signValidDuration; + + private static final String HMAC_ALGORITHM = "HmacSHA1"; + private static final String CONTENT_CHARSET = "UTF-8"; + + public static byte[] byteMerger(byte[] byte1, byte[] byte2) { + byte[] byte3 = new byte[byte1.length + byte2.length]; + System.arraycopy(byte1, 0, byte3, 0, byte1.length); + System.arraycopy(byte2, 0, byte3, byte1.length, byte2.length); + return byte3; + } + + public String getUploadSignature() throws Exception { + String strSign = ""; + String contextStr = ""; + + long endTime = (currentTime + signValidDuration); + contextStr += "secretId=" + java.net.URLEncoder.encode(secretId, "utf8"); + contextStr += "¤tTimeStamp=" + currentTime; + contextStr += "&expireTime=" + endTime; + contextStr += "&random=" + random; + + try { + Mac mac = Mac.getInstance(HMAC_ALGORITHM); + SecretKeySpec secretKey = new SecretKeySpec(this.secretKey.getBytes(CONTENT_CHARSET), mac.getAlgorithm()); + mac.init(secretKey); + + byte[] hash = mac.doFinal(contextStr.getBytes(CONTENT_CHARSET)); + byte[] sigBuf = byteMerger(hash, contextStr.getBytes(StandardCharsets.UTF_8)); + strSign = base64Encode(sigBuf); + strSign = strSign.replace(" ", "").replace("\n", "").replace("\r", ""); + } catch (Exception e) { + throw e; + } + return strSign; + } + + private String base64Encode(byte[] buffer) { + BASE64Encoder encoder = new BASE64Encoder(); + return encoder.encode(buffer); + } + + public void setSecretId(String secretId) { + this.secretId = secretId; + } + + public void setSecretKey(String secretKey) { + this.secretKey = secretKey; + } + + public void setCurrentTime(long currentTime) { + this.currentTime = currentTime; + } + + public void setRandom(int random) { + this.random = random; + } + + public void setSignValidDuration(int signValidDuration) { + this.signValidDuration = signValidDuration; + } +} diff --git a/src/main/java/com/meishu/util/TestMain.java b/src/main/java/com/meishu/util/TestMain.java new file mode 100644 index 0000000..588dabe --- /dev/null +++ b/src/main/java/com/meishu/util/TestMain.java @@ -0,0 +1,61 @@ +package com.meishu.util; + +import java.security.MessageDigest; +import java.util.Random; + +public class TestMain { + + public static void main(String[] args) { + String password = "123456"; + String saltCode = getRandomCharAndNumr(5); + String encryptString = encrypt("91ebn" + password); + System.out.println(encryptString); + } + + public static String encrypt(String string) { + + String encryptedString = string; + char[] hexDigits = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' }; + try { + byte[] btInput = string.getBytes(); + MessageDigest mdInst = MessageDigest.getInstance("MD5"); + mdInst.update(btInput); + byte[] md = mdInst.digest(); + int j = md.length; + char[] str = new char[j * 2]; + int k = 0; + for (int i = 0; i < j; i++) { + byte byte0 = md[i]; + str[k++] = hexDigits[byte0 >>> 4 & 0xf]; + str[k++] = hexDigits[byte0 & 0xf]; + } + encryptedString = new String(str); + return encryptedString; + } catch (Exception e) { + e.printStackTrace(); + return encryptedString; + } + } + + /** + * 获取随机字母数字组合 + * + * @param length + * 字符串长度 + * @return + */ + public static String getRandomCharAndNumr(Integer length) { + String str = ""; + Random random = new Random(); + for (int i = 0; i < length; i++) { + boolean b = random.nextBoolean(); + if (b) { // 字符串 + // int choice = random.nextBoolean() ? 65 : 97; 取得65大写字母还是97小写字母 + str += (char) (97 + random.nextInt(26));// 取得大写字母 + } else { // 数字 + str += String.valueOf(random.nextInt(10)); + } + } + return str; + } +} diff --git a/src/main/java/com/meishu/util/WechatUtil.java b/src/main/java/com/meishu/util/WechatUtil.java new file mode 100644 index 0000000..93e7f5d --- /dev/null +++ b/src/main/java/com/meishu/util/WechatUtil.java @@ -0,0 +1,68 @@ +package com.meishu.util; + +import com.alibaba.fastjson.JSONObject; +import com.meishu.common.constant.WxConstant; +import com.meishu.vo.wechat.AccessTokenVO; +import com.meishu.vo.wechat.MemberVO; +import com.meishu.vo.wechat.QrConnectVO; +import com.meishu.vo.wechat.WXUserInfoVO; + +import java.util.HashMap; +import java.util.Map; + +public class WechatUtil { + + /** + * Access Token + * @return + */ + public static AccessTokenVO getAccessToken() { + Map<String, Object> param = new HashMap<>(); + param.put("appid", WxConstant.APPID); + param.put("secret", WxConstant.SECRENT); + JSONObject object = HttpUtil.get(param, WxConstant.GET_SUITE_TOKEN); + return JSONObject.toJavaObject(object, AccessTokenVO.class); + } + + /** + * 获取访问用户身份 + * @param accessToken + * @param code + * @return + */ + public static WXUserInfoVO getUserInfo(String accessToken, String code) { + Map<String, Object> param = new HashMap<>(); + param.put("access_token", accessToken); + param.put("code", code); + JSONObject object = HttpUtil.get(param, WxConstant.GETUSERINFO); + return JSONObject.toJavaObject(object, WXUserInfoVO.class); + } + + /** + * 读取成员 + * @param accessToken + * @param userId + * @return + */ + public static MemberVO getMember(String accessToken, String userId) { + Map<String, Object> param = new HashMap<>(); + param.put("access_token", accessToken); + param.put("userid", userId); + JSONObject object = HttpUtil.get(param, WxConstant.GET); + return JSONObject.toJavaObject(object, MemberVO.class); + } + + /** + * 扫码登陆参数 + * @return + */ + public static QrConnectVO getQRConnectParams() { + QrConnectVO qrConnectVO = new QrConnectVO(); + qrConnectVO.setId("双创系统"); + qrConnectVO.setAppId(WxConstant.APPID); +// qrConnectVO.setAgentId(WxConstant.AGENTID); + qrConnectVO.setRedirectUri(WxConstant.QR_REDIRECT_URL); + qrConnectVO.setState("MASS"); + return qrConnectVO; + } +} diff --git a/src/main/java/com/meishu/util/excel/ExcelColumn.java b/src/main/java/com/meishu/util/excel/ExcelColumn.java new file mode 100644 index 0000000..82d7e1c --- /dev/null +++ b/src/main/java/com/meishu/util/excel/ExcelColumn.java @@ -0,0 +1,13 @@ +package com.meishu.util.excel; + +import java.lang.annotation.*; + +@Target(ElementType.FIELD) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface ExcelColumn { + + String value() default ""; + + int col() default 1; +} diff --git a/src/main/java/com/meishu/util/excel/ExcelColumnUtil.java b/src/main/java/com/meishu/util/excel/ExcelColumnUtil.java new file mode 100644 index 0000000..256820b --- /dev/null +++ b/src/main/java/com/meishu/util/excel/ExcelColumnUtil.java @@ -0,0 +1,21 @@ +package com.meishu.util.excel; + +import java.lang.annotation.*; + +/** + * <p> + * excel 字段 + * </p> + * + * @author DengMin + * @date Created in 2020/08/28 + */ +@Target({ElementType.FIELD}) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface ExcelColumnUtil { + + String value() default ""; + + int col() default 0; +} diff --git a/src/main/java/com/meishu/util/excel/ExcelUtil.java b/src/main/java/com/meishu/util/excel/ExcelUtil.java new file mode 100644 index 0000000..4807cb8 --- /dev/null +++ b/src/main/java/com/meishu/util/excel/ExcelUtil.java @@ -0,0 +1,347 @@ +package com.meishu.util.excel; + +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.BooleanUtils; +import org.apache.commons.lang3.CharUtils; +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.math.NumberUtils; +import org.apache.poi.hssf.usermodel.HSSFDateUtil; +import org.apache.poi.hssf.usermodel.HSSFWorkbook; +import org.apache.poi.ss.usermodel.*; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; +import org.springframework.http.MediaType; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; +import org.springframework.web.multipart.MultipartFile; + +import javax.servlet.http.HttpServletResponse; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.lang.reflect.Constructor; +import java.lang.reflect.Field; +import java.math.BigDecimal; +import java.net.URLEncoder; +import java.util.*; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +/** + * Excel工具 + * + * @author DengMin + * @date 2019/08/27 13:57 + **/ +@Slf4j +public class ExcelUtil { + + private final static String EXCEL2003 = "xls"; + + private final static String EXCEL2007 = "xlsx"; + + /** + * 导入excel文件 + * @param path + * @param cls + * @param file + * @param <T> + * @return + */ + public static <T> List<T> readExcel(String path, Class<T> cls, MultipartFile file) { + String fileName = file.getOriginalFilename(); + if(!fileName.matches("^.+\\.(?i)(xls)$") && !fileName.matches("^.+\\.(?i)(xlsx)$")) { + log.info("上传文件格式不正确"); +// throw new HTTPException(10022); + } + + List<T> dataList = new ArrayList<>(); + Workbook workbook = null; + try { + InputStream is = file.getInputStream(); + if (fileName.endsWith(EXCEL2007)) { + // FileInputStream is = new FileInputStream(new File(path)); + workbook = new XSSFWorkbook(is); + } + + if(fileName.endsWith(EXCEL2003)) { + // FileInputStream is = new FileInputStream(new File(path)); + workbook = new HSSFWorkbook(is); + } + + if (workbook != null) { + Map<String, List<Field>> classMap = new HashMap<>(); + List<Field> fields = Stream.of(cls.getDeclaredFields()).collect(Collectors.toList()); + fields.forEach(field -> { + ExcelColumnUtil annotation = field.getAnnotation(ExcelColumnUtil.class); + if (annotation != null) { + String value = annotation.value(); + if(StringUtils.isBlank(value)) { + return; + } + + if(!classMap.containsKey(value)) { + classMap.put(value, new ArrayList<>()); + } + + field.setAccessible(true); + classMap.get(value).add(field); + } + }); + //索引-->columns + Map<Integer, List<Field>> reflectionMap = new HashMap<>(); + //默认读取第一个sheet + Sheet sheet = workbook.getSheetAt(0); + + boolean firstRow = true; + for (int i = 0; i <= sheet.getLastRowNum(); i++) { + Row row = sheet.getRow(i); + //提取标题 + if (firstRow) { + for (int j = 0; j <= row.getLastCellNum(); j++) { + Cell cell = row.getCell(j); + String cellValue = getCellValue(cell); + if (classMap.containsKey(cellValue)) { + reflectionMap.put(j, classMap.get(cellValue)); + } + } + + firstRow = false; + } else { + //忽略空白行 + if (row == null) { + continue; + } + + try { + T t = cls.newInstance(); + //判断是否为空白行 + boolean allBlank = true; + for (int j = 0; j <= row.getLastCellNum(); j++) { + if (reflectionMap.containsKey(j)) { + Cell cell = row.getCell(j); + String cellValue = getCellValue(cell); + if (StringUtils.isNotBlank(cellValue)) { + allBlank = false; + } + List<Field> fieldList = reflectionMap.get(j); + fieldList.forEach(x -> { + try { + handleField(t, cellValue, x); + } catch (Exception e) { + e.printStackTrace(); + log.error(String.format("reflect field:%s value:%s exception!", x.getName(), cellValue), e); + } + }); + } + } + + if(!allBlank) { + dataList.add(t); + } + } catch (Exception e) { + e.printStackTrace(); + log.error(String.format("parse row:%s exception!", i), e); + } + } + } + } + } catch (Exception e) { + e.printStackTrace(); + log.error(String.format("parse excel exception!"), e); + } finally { + if (workbook != null) { + try { + workbook.close(); + } catch (Exception e) { + e.printStackTrace(); + log.error(String.format("parse excel exception!"), e); + } + } + } + return dataList; + } + + /** + * 导出excel文件 + * @param list + * @param cls + * @param <T> + */ + public static <T> void writeExcel(List<T> list, Class cls) { + ServletRequestAttributes servletRequestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); + HttpServletResponse response = servletRequestAttributes.getResponse(); + Field[] fields = cls.getDeclaredFields(); + List<Field> fieldList = Arrays.stream(fields).filter(field -> { + ExcelColumn annotation = field.getAnnotation(ExcelColumn.class); + if(annotation != null) { + field.setAccessible(true); + return true; + } + return false; + }).sorted(Comparator.comparing(field -> { + int col = 0; + ExcelColumn annotation = field.getAnnotation(ExcelColumn.class); + if(annotation != null) { + col = annotation.col(); + } + return col; + })).collect(Collectors.toList()); + + Workbook wb = new XSSFWorkbook(); + Sheet sheet = wb.createSheet(); + AtomicInteger ai = new AtomicInteger(); + { + Row row = sheet.createRow(ai.getAndIncrement()); + AtomicInteger at = new AtomicInteger(); + fieldList.forEach(field -> { + ExcelColumn annotation = field.getAnnotation(ExcelColumn.class); + String columnName = ""; + if (annotation != null) { + columnName = annotation.value(); + } + Cell cell = row.createCell(at.getAndIncrement()); + CellStyle cellStyle = wb.createCellStyle(); + cellStyle.setFillForegroundColor(IndexedColors.PALE_BLUE.getIndex()); + Font font = wb.createFont(); + font.setBoldweight(Font.BOLDWEIGHT_BOLD); + cellStyle.setFont(font); + cell.setCellStyle(cellStyle); + cell.setCellValue(columnName); + }); + + if (list != null) { + list.forEach(data -> { + Row r = sheet.createRow(ai.getAndIncrement()); + AtomicInteger a = new AtomicInteger(); + fieldList.forEach(field -> { + try { + Class<?> type = field.getType(); + Object value = field.get(data); + Cell cell = r.createCell(a.getAndIncrement()); + if (value != null) { + cell.setCellValue(value.toString()); + } + } catch (IllegalAccessException e) { + e.printStackTrace(); + } + }); + }); + for (int i = 0; i < list.size(); i++) { + sheet.autoSizeColumn(i); + } + } + String fileName = String.valueOf(new Date().getTime()); + buildExcelDocument(fileName + "." + EXCEL2007, wb, response); + } + } + + + private static void setStyle(CellStyle cellStyle) { + // 水平居中 + cellStyle.setAlignment(CellStyle.ALIGN_CENTER); + // 垂直居中 + cellStyle.setVerticalAlignment(CellStyle.ALIGN_CENTER); + // 边框 + cellStyle.setBorderTop(CellStyle.BORDER_THIN); + // 边框 + cellStyle.setBorderLeft(CellStyle.BORDER_THIN); + // 边框 + cellStyle.setBorderRight(CellStyle.BORDER_THIN); + // 边框 + cellStyle.setBorderBottom(CellStyle.BORDER_THIN); + } + + private static <T> void handleField(T t, String value, Field field) throws Exception { + Class<?> type = field.getType(); + if (type == null || type == void.class || StringUtils.isBlank(value)) { + return; + } + if (type == Object.class) { + field.set(t, value); + //数字类型 + } else if (type.getSuperclass() == null || type.getSuperclass() == Number.class) { + if (type == int.class || type == Integer.class) { + field.set(t, NumberUtils.toInt(value)); + } else if (type == long.class || type == Long.class) { + field.set(t, NumberUtils.toLong(value)); + } else if (type == byte.class || type == Byte.class) { + field.set(t, NumberUtils.toByte(value)); + } else if (type == short.class || type == Short.class) { + field.set(t, NumberUtils.toShort(value)); + } else if (type == double.class || type == Double.class) { + field.set(t, NumberUtils.toDouble(value)); + } else if (type == float.class || type == Float.class) { + field.set(t, NumberUtils.toFloat(value)); + } else if (type == char.class || type == Character.class) { + field.set(t, CharUtils.toChar(value)); + } else if (type == boolean.class) { + field.set(t, BooleanUtils.toBoolean(value)); + } else if (type == BigDecimal.class) { + field.set(t, new BigDecimal(value)); + } + } else if (type == Boolean.class) { + field.set(t, BooleanUtils.toBoolean(value)); + } else if (type == Date.class) { + // + field.set(t, value); + } else if (type == String.class) { + field.set(t, value); + } else { + Constructor<?> constructor = type.getConstructor(String.class); + field.set(t, constructor.newInstance(value)); + } + } + + private static String getCellValue(Cell cell) { + if (cell == null) { + return ""; + } + + if (cell.getCellType() == Cell.CELL_TYPE_NUMERIC) { + if (DateUtil.isCellDateFormatted(cell)) { + return HSSFDateUtil.getJavaDate(cell.getNumericCellValue()).toString(); + } else { + return new BigDecimal(cell.getNumericCellValue()).toString(); + } + } else if (cell.getCellType() == Cell.CELL_TYPE_STRING) { + return StringUtils.trimToEmpty(cell.getStringCellValue()); + } else if (cell.getCellType() == Cell.CELL_TYPE_FORMULA) { + return StringUtils.trimToEmpty(cell.getCellFormula()); + } else if (cell.getCellType() == Cell.CELL_TYPE_BLANK) { + return ""; + } else if (cell.getCellType() == Cell.CELL_TYPE_BOOLEAN) { + return String.valueOf(cell.getBooleanCellValue()); + } else if (cell.getCellType() == Cell.CELL_TYPE_ERROR) { + return "ERROR"; + } else { + return cell.toString().trim(); + } + } + + private static void buildExcelDocument(String fileName, Workbook wb, HttpServletResponse response){ + try { + response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); + response.setHeader("Content-Disposition", "attachment;filename="+ URLEncoder.encode(fileName, "utf-8")); + response.flushBuffer(); + wb.write(response.getOutputStream()); + } catch (IOException e) { + log.error(String.format("downLoad excel exception"), e); + } + } + + private static void buildExcelFile(String path, Workbook wb){ + File file = new File(path); + if (file.exists()) { + file.delete(); + } + + try { + wb.write(new FileOutputStream(file)); + } catch (Exception e) { + log.error(String.format("downLoad excel exception"), e); + } + } +} diff --git a/src/main/java/com/meishu/util/tree/Node.java b/src/main/java/com/meishu/util/tree/Node.java new file mode 100644 index 0000000..fc443b5 --- /dev/null +++ b/src/main/java/com/meishu/util/tree/Node.java @@ -0,0 +1,42 @@ +package com.meishu.util.tree; + +import lombok.Data; + +@Data +public class Node implements Comparable<Node> { + + //主键 + private String id; + + //同级节点第几个元素 + private String number; + + //1.1 + private String text; + + //父节点 + private String parentId; + + private int level; + + public Node(String id, String number, String parentId, int level) { + this.id = id; + this.number = number; + this.parentId = parentId; + this.level = level; + } + + @Override + public int compareTo(Node o) { + if (this.level != o.level) { + return o.level - this.level; + } else { + if(this.number==null){ + return -1; + } + return this.number.compareTo(o.number); + } + } + + +} diff --git a/src/main/java/com/meishu/util/tree/NumberTree.java b/src/main/java/com/meishu/util/tree/NumberTree.java new file mode 100644 index 0000000..1f0d662 --- /dev/null +++ b/src/main/java/com/meishu/util/tree/NumberTree.java @@ -0,0 +1,212 @@ +package com.meishu.util.tree; + +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +@Data +public class NumberTree { + + private String id; + + private List<Node> nodeList; + + private String separator; + + private int idSeq; + + private SerialNumber number; + + public NumberTree(String separator, SerialNumber number) { + init(); + this.separator = separator; + this.number = number; + + } + + public void init() { + idSeq = 1; + this.separator = "."; + if (this.nodeList == null) { + nodeList = new ArrayList<Node>(); + } + } + + + /** + * <p>功能描述:根据父节点获取所有子节点。</p> + */ + public List<Node> getChildNodes(Node pNode) { + String pId = pNode.getId(); + return getChildNodes(pId); + } + + /** + * <p>功能描述:根据父节点获取所有子节点。</p> + */ + public List<Node> getChildNodes(String pId) { + List<Node> childNodes = new ArrayList<Node>(); + for (Node n : nodeList) { + if (pId.equals(n.getParentId())) { + childNodes.add(n); + } + } + + return childNodes; + } + + /** + * <p>功能描述:获取本级值最大的节点。</p> + */ + public Node getMaxNodeForThisLevel(Node pNode) { + List<Node> childList = getChildNodes(pNode); + Node root = getRoot(nodeList); + if (childList.size() <= 0) { + return null; + } + Node maxNode = root; + for (Node node : childList) { + if (maxNode.getNumber().compareTo(node.getNumber()) < 0) { + maxNode = node; + } + } + return maxNode; + } + + /** + * <p>功能描述:生成下一个子节点。</p> + */ + public Node generateNextChildNode(Node node) { + Node newNode = null; + Node maxNode = getMaxNodeForThisLevel(node); + String nextNumber = number.firstNumber(); + int level = node.getLevel(); + if (maxNode != null && !"0".equals(maxNode.getId())) {//本级存在子节点,且非根节点 + nextNumber = number.produceNext(maxNode.getNumber()); + level = maxNode.getLevel(); + } + newNode = new Node(String.valueOf(++idSeq), nextNumber, node.getId(), level); + + generateNodeText(newNode, nextNumber); + + return newNode; + } + + + /** + * + * <p>功能描述:获取父节点。</p> + */ + public Node getParentNode(Node node) { + for (Node n : nodeList) { + if (node.getParentId() == n.getId()) { + return n; + } + } + return node; + } + + /** + * <p>功能描述:生成节点路径。</p> + */ + public void generateNodeText(Node node, String text) { + + if (node == null || "0".equals(node.getId())) { + return; + } + + Node pNode = getParentNode(node); + + if (!"0".equals(pNode.getId())) { + text = pNode.getText() + separator + text; + } + + node.setText(text); + } + + /** + * <p>功能描述:遍历所有树节点。</p> + */ + public void traverseNodeList(Node node) { + if(node==null){ + node = getRoot(nodeList); + } + List<Node> childNodes = getChildNodes(node); + System.out.println(node.getText()); + if (childNodes.size() > 0) { + for (Node n : childNodes) { + traverseNodeList(n); + } + } + } + public static void main(String[] args) { + SerialNumber number = new SerialNumber(); + NumberTree treeNode = new NumberTree(".", number); + + addSomeNodes(treeNode); + treeNode.traverseNodeList(null); + } + + /** + * <p>功能描述:获取根节点。</p> + */ + public Node getRoot(List<Node> nodeList) { + Node root = null; + if (nodeList.size() <= 0 || (root = getNodeById(nodeList, "0")) == null) { + root = createRoot(); + nodeList.add(root); + } + return root; + } + + private Node getNodeById(List<Node> nodeList, String id) { + Node node = null; + if(id!=null){ + for (Node n : nodeList) { + if (id.equals(n.getId())) { + node = n; + break; + } + } + } + return node; + } + + private Node createRoot() { + Node root = new Node("0", number.rootNumber(), "-1", 0); + root.setText("0"); + return root; + } + + /** + * <p>功能描述:测试添加节点。</p> + */ + private static Node addSomeNodes(NumberTree tree) { + Node root = tree.getRoot(tree.nodeList); + Node node1 = getNextNode(tree, root);//1 + Node node2 = getNextNode(tree, root);//2 + Node node3 = getNextNode(tree, root);//3 + Node node11 = getNextNode(tree, node1);//1.1 + Node node12 = getNextNode(tree, node1);//1.2 + Node node21 = getNextNode(tree, node2);//2.1 + Node node211 = getNextNode(tree, node21);//2.1.1 + Node node212 = getNextNode(tree, node21);//2.1.2 + Node node22 = getNextNode(tree, node2);//2.2 + Node node221 = getNextNode(tree, node22);//2.2.1 + Node node31 = getNextNode(tree, node3); + Node node32 = getNextNode(tree, node3); + Node node311 = getNextNode(tree, node31); + Node node3111 = getNextNode(tree, node311); + return root; + } + + public static Node getNextNode(NumberTree tree, Node pNode) { + Node node = tree.generateNextChildNode(pNode); + if (node != null) { + tree.nodeList.add(node); + } + return node; + } + +} diff --git a/src/main/java/com/meishu/util/tree/SerialNumber.java b/src/main/java/com/meishu/util/tree/SerialNumber.java new file mode 100644 index 0000000..767a0bb --- /dev/null +++ b/src/main/java/com/meishu/util/tree/SerialNumber.java @@ -0,0 +1,28 @@ +package com.meishu.util.tree; + +public class SerialNumber{ + + public String produceNext(String crrnt) { + + String next = "0"; + if (crrnt != null) { + try { + int crrntNum = Integer.parseInt(crrnt); + next = String.valueOf(crrntNum + 1); + } catch (Exception e) { + System.err.println("非数字类型的字符串!"); + } + } + return next; + } + + public String rootNumber() { + return "0"; + } + + public String firstNumber() { + return "1"; + } + + +} diff --git a/src/main/java/com/meishu/vo/PerStudentComplicationVO.java b/src/main/java/com/meishu/vo/PerStudentComplicationVO.java new file mode 100644 index 0000000..45527fd --- /dev/null +++ b/src/main/java/com/meishu/vo/PerStudentComplicationVO.java @@ -0,0 +1,20 @@ +package com.meishu.vo; + +import lombok.Data; + +/** + * @author: tuyp + * @create: 2020-07-22 18:20 + */ +@Data +public class PerStudentComplicationVO { + + private String studyCode; + + private String userName; + + private Integer studyLengthSecond; + + private Integer historyStudyLengthSecond; + +} diff --git a/src/main/java/com/meishu/vo/accesstoken/GetAllStudentsVO.java b/src/main/java/com/meishu/vo/accesstoken/GetAllStudentsVO.java new file mode 100644 index 0000000..d2c80da --- /dev/null +++ b/src/main/java/com/meishu/vo/accesstoken/GetAllStudentsVO.java @@ -0,0 +1,32 @@ +package com.meishu.vo.accesstoken; + +import lombok.Data; + +@Data +public class GetAllStudentsVO { + + private Integer id; + + private String userName; + + private String gender; + + private String imgUrl; + + private String userStatus; + + //private String roleType; + + private String session; + + private String phone; + + private String idCard; + + private String studyCode; + + private String className; + + private String password; + +} diff --git a/src/main/java/com/meishu/vo/accesstoken/GetAllTeachersVO.java b/src/main/java/com/meishu/vo/accesstoken/GetAllTeachersVO.java new file mode 100644 index 0000000..7e2114f --- /dev/null +++ b/src/main/java/com/meishu/vo/accesstoken/GetAllTeachersVO.java @@ -0,0 +1,22 @@ +package com.meishu.vo.accesstoken; + +import com.meishu.model.SubjectDictDO; +import com.meishu.vo.administer.GetTeacherSubjectVO; +import lombok.Data; + +import java.util.List; + +@Data +public class GetAllTeachersVO { + + private Integer id; + + private String telephone; + + private String userName; + + private String intro; + + private List<GetTeacherSubjectVO> subjectDictDOS; + +} diff --git a/src/main/java/com/meishu/vo/administer/AdministerPermissionVO.java b/src/main/java/com/meishu/vo/administer/AdministerPermissionVO.java new file mode 100644 index 0000000..4fce222 --- /dev/null +++ b/src/main/java/com/meishu/vo/administer/AdministerPermissionVO.java @@ -0,0 +1,21 @@ +package com.meishu.vo.administer; + +import lombok.Data; + +import java.util.List; + +@Data +public class AdministerPermissionVO { + + private Long id; + + private String userName; + + private String role; + + private String img; + + private Boolean isRole; + + private List<PermissionsVO> permissions; +} diff --git a/src/main/java/com/meishu/vo/administer/GetClassesDetailResponseVO.java b/src/main/java/com/meishu/vo/administer/GetClassesDetailResponseVO.java new file mode 100644 index 0000000..d466fd7 --- /dev/null +++ b/src/main/java/com/meishu/vo/administer/GetClassesDetailResponseVO.java @@ -0,0 +1,38 @@ +package com.meishu.vo.administer; + +import lombok.Data; + +/** + * @author: tuyp + * @create: 2020-07-20 22:32 + */ +@Data +public class GetClassesDetailResponseVO { + + private Integer subjectId; + + private String className; + + private String school; + + private String grade; + + private String classes; + + private String subjectType; + + private String session; + + private String status; + + private String subject; + + private String subjectEn; + + private String classId; + + private Integer userId; + + private String semester; + +} diff --git a/src/main/java/com/meishu/vo/administer/GetTeacherClassVO.java b/src/main/java/com/meishu/vo/administer/GetTeacherClassVO.java new file mode 100644 index 0000000..9752165 --- /dev/null +++ b/src/main/java/com/meishu/vo/administer/GetTeacherClassVO.java @@ -0,0 +1,7 @@ +package com.meishu.vo.administer; + +import lombok.Data; + +@Data +public class GetTeacherClassVO { +} diff --git a/src/main/java/com/meishu/vo/administer/GetTeacherSubjectVO.java b/src/main/java/com/meishu/vo/administer/GetTeacherSubjectVO.java new file mode 100644 index 0000000..b23eaad --- /dev/null +++ b/src/main/java/com/meishu/vo/administer/GetTeacherSubjectVO.java @@ -0,0 +1,12 @@ +package com.meishu.vo.administer; + +import lombok.Data; + +@Data +public class GetTeacherSubjectVO { + + private String ClassName; + + private String subject; + +} diff --git a/src/main/java/com/meishu/vo/administer/GetTeachersVO.java b/src/main/java/com/meishu/vo/administer/GetTeachersVO.java new file mode 100644 index 0000000..d0607d0 --- /dev/null +++ b/src/main/java/com/meishu/vo/administer/GetTeachersVO.java @@ -0,0 +1,38 @@ +package com.meishu.vo.administer; + +import com.meishu.model.*; +import lombok.Data; + +import java.util.List; + +@Data +public class GetTeachersVO { + + private Long id; + + private Long depId; + + private Long depParentId; + + private String userName; + + private String status; + + private String intro; + + private String img; + + private String telephone; + + private String departmentName; + + private List<CampusDictDO> campusDictDOS; + + private List<DepartmentDictDO> departmentDictDOS; + + private List<KnowledgeSubjectDictDO> knowledgeSubjectDicts; + + private List<RoleDictDO> roleDictDOS; + + private List<SubjectDictDO> subjectDictDOS; +} diff --git a/src/main/java/com/meishu/vo/administer/LoginVO.java b/src/main/java/com/meishu/vo/administer/LoginVO.java new file mode 100644 index 0000000..caaef45 --- /dev/null +++ b/src/main/java/com/meishu/vo/administer/LoginVO.java @@ -0,0 +1,10 @@ +package com.meishu.vo.administer; + +import lombok.Data; + +@Data +public class LoginVO { + + private String token; + +} diff --git a/src/main/java/com/meishu/vo/administer/PermissionsVO.java b/src/main/java/com/meishu/vo/administer/PermissionsVO.java new file mode 100644 index 0000000..4b81abb --- /dev/null +++ b/src/main/java/com/meishu/vo/administer/PermissionsVO.java @@ -0,0 +1,17 @@ +package com.meishu.vo.administer; + +import lombok.Data; + +import java.util.List; + +@Data +public class PermissionsVO { + + private Long id; + + private Long parentId; + + private String name; + + private List<PermissionsVO> children; +} diff --git a/src/main/java/com/meishu/vo/campus/CampusListVO.java b/src/main/java/com/meishu/vo/campus/CampusListVO.java new file mode 100644 index 0000000..2161576 --- /dev/null +++ b/src/main/java/com/meishu/vo/campus/CampusListVO.java @@ -0,0 +1,57 @@ +package com.meishu.vo.campus; + +import com.meishu.model.AdministerDepartmentMappingDO; +import com.meishu.model.CampusDictDO; +import lombok.Data; + +import java.util.List; + +@Data +public class CampusListVO { + + private String administerName; + + private Long id; + + /** + * 校区 + */ + private String campus; + + /** + * 负责人所在部门 + */ + private List<AdministerDepartmentMappingDO> administerDepartments; + + /** + * 父节点id + */ + private Long parentId; + + /** + * 上级校区名称 + */ + private String parentCampusName; + + /** + * 负责人 + */ + private Long administerId; + + /** + * 学生人数 + */ + private Integer studentCounts; + + /** + * 老师人数 + */ + private Integer teacherCounts; + + + + /** + * 子类 + */ + private List<CampusListVO> children; +} diff --git a/src/main/java/com/meishu/vo/campus/CampusStudentVO.java b/src/main/java/com/meishu/vo/campus/CampusStudentVO.java new file mode 100644 index 0000000..f93fa17 --- /dev/null +++ b/src/main/java/com/meishu/vo/campus/CampusStudentVO.java @@ -0,0 +1,11 @@ +package com.meishu.vo.campus; + +import com.meishu.model.StudentDO; +import lombok.Data; + +@Data +public class CampusStudentVO extends StudentDO { + + private String campus; + +} diff --git a/src/main/java/com/meishu/vo/classes/GetClassStudentsVO.java b/src/main/java/com/meishu/vo/classes/GetClassStudentsVO.java new file mode 100644 index 0000000..a868a99 --- /dev/null +++ b/src/main/java/com/meishu/vo/classes/GetClassStudentsVO.java @@ -0,0 +1,12 @@ +package com.meishu.vo.classes; + +import com.meishu.model.UserRoleDO; +import lombok.Data; + +@Data +public class GetClassStudentsVO extends UserRoleDO { + + + private String grade; + +} diff --git a/src/main/java/com/meishu/vo/classes/GetClassesVO.java b/src/main/java/com/meishu/vo/classes/GetClassesVO.java new file mode 100644 index 0000000..440ec20 --- /dev/null +++ b/src/main/java/com/meishu/vo/classes/GetClassesVO.java @@ -0,0 +1,30 @@ +package com.meishu.vo.classes; + +import lombok.Data; + +import java.util.List; + +@Data +public class GetClassesVO { + + private String id; + + private String classId; + + private String className; + + private String grade; + + private Integer cnt; + + private String session; + + private String status; + + private String classes; + + private String upgradeDate; + + private List<SubjectDictVO> subjectDictDOS; + +} diff --git a/src/main/java/com/meishu/vo/classes/SubjectDictVO.java b/src/main/java/com/meishu/vo/classes/SubjectDictVO.java new file mode 100644 index 0000000..6408bf4 --- /dev/null +++ b/src/main/java/com/meishu/vo/classes/SubjectDictVO.java @@ -0,0 +1,14 @@ +package com.meishu.vo.classes; + +import com.meishu.model.AdministerDO; +import com.meishu.model.SubjectDictDO; +import lombok.Data; + +import java.util.List; + +@Data +public class SubjectDictVO extends SubjectDictDO { + + private List<AdministerDO> administerDOS; + +} diff --git a/src/main/java/com/meishu/vo/course/CourseAdministerVO.java b/src/main/java/com/meishu/vo/course/CourseAdministerVO.java new file mode 100644 index 0000000..e3d7676 --- /dev/null +++ b/src/main/java/com/meishu/vo/course/CourseAdministerVO.java @@ -0,0 +1,16 @@ +package com.meishu.vo.course; + +import lombok.Data; + +@Data +public class CourseAdministerVO { + + private String img; + + private String intro; + + private String userName; + +// private String subjectName; + +} diff --git a/src/main/java/com/meishu/vo/course/CourseProgressVO.java b/src/main/java/com/meishu/vo/course/CourseProgressVO.java new file mode 100644 index 0000000..6e9b6b0 --- /dev/null +++ b/src/main/java/com/meishu/vo/course/CourseProgressVO.java @@ -0,0 +1,41 @@ +package com.meishu.vo.course; + +import lombok.Data; + +@Data +public class CourseProgressVO { + + private String username; + + private String campus; + + private Integer totalCounts; + + private Integer studyCounts; + + private String studyPercent; + + private Long courseId; + + private Long studentId; + + private Long treeId; + + private Integer totalPlayLength; + + /** + * 最近学到的知识点 + */ + private String recentTreeName; + + /** + * 最近学习时间 + */ + private String recentTreeTime; + + /** + * 学习进度的知识点 + */ + private String treeNameProgress; + +} diff --git a/src/main/java/com/meishu/vo/course/CourseVodVO.java b/src/main/java/com/meishu/vo/course/CourseVodVO.java new file mode 100644 index 0000000..fd87c51 --- /dev/null +++ b/src/main/java/com/meishu/vo/course/CourseVodVO.java @@ -0,0 +1,22 @@ +package com.meishu.vo.course; + +import lombok.Data; + +@Data +public class CourseVodVO { + + private Long id; + + private Long vodId; + + private String vodName; + + private String vodUrl; + + private Integer vodLength; + + private String coverPage; + + private String vodType; + +} diff --git a/src/main/java/com/meishu/vo/course/GetAllCourseVO.java b/src/main/java/com/meishu/vo/course/GetAllCourseVO.java new file mode 100644 index 0000000..84a70d2 --- /dev/null +++ b/src/main/java/com/meishu/vo/course/GetAllCourseVO.java @@ -0,0 +1,15 @@ +package com.meishu.vo.course; + +import com.meishu.model.CourseDictDO; +import lombok.Data; + +import java.util.List; + +@Data +public class GetAllCourseVO { + + private List<CourseDictDO> innerCourse; + + private List<CourseDictDO> outerCourse; + +} diff --git a/src/main/java/com/meishu/vo/course/GetCourseStudentsVO.java b/src/main/java/com/meishu/vo/course/GetCourseStudentsVO.java new file mode 100644 index 0000000..edf2d3a --- /dev/null +++ b/src/main/java/com/meishu/vo/course/GetCourseStudentsVO.java @@ -0,0 +1,34 @@ +package com.meishu.vo.course; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.util.Date; + +@Data +public class GetCourseStudentsVO { + + private Long id; + + private Long studentId; + + private Long courseId; + + private String username; + + private String campus; + + private String status; + + @JsonFormat(pattern = "yyyy-MM-dd") + private Date startDate; + + @JsonFormat(pattern = "yyyy-MM-dd") + private Date endDate; + + private Integer diff; + + private String courseName; + +} diff --git a/src/main/java/com/meishu/vo/course/GetCourseTreeVodsVO.java b/src/main/java/com/meishu/vo/course/GetCourseTreeVodsVO.java new file mode 100644 index 0000000..fbf3276 --- /dev/null +++ b/src/main/java/com/meishu/vo/course/GetCourseTreeVodsVO.java @@ -0,0 +1,34 @@ +package com.meishu.vo.course; + +import lombok.Data; + +@Data +public class GetCourseTreeVodsVO { + + private Long id; + + private Long treeId; + + private Long parentId; + + private Long courseTreeId; + + private Long vodId; + + private String parentTreeName; + + private String vodName; + + private String treeName; + + private String vodType; + + private String status; + + private String userName; + + private String updateTime; + + private Integer total; + +} diff --git a/src/main/java/com/meishu/vo/course/GetExerciseDetailVO.java b/src/main/java/com/meishu/vo/course/GetExerciseDetailVO.java new file mode 100644 index 0000000..71ead50 --- /dev/null +++ b/src/main/java/com/meishu/vo/course/GetExerciseDetailVO.java @@ -0,0 +1,38 @@ +package com.meishu.vo.course; + +import com.meishu.model.CourseTreeDO; +import lombok.Data; + +import java.util.List; + +@Data +public class GetExerciseDetailVO { + + private Long id; + + private String exerciseType; + + private String title; + + private String rightAnswer; + + private Integer difficulty; + + private String items; + + private Integer adviceLength; + + private String answer; + + private String result; + + private Integer length; + + private String rightPercent; + + private String avgLength; + + private String createTime; + + private List<CourseTreeDO> courseTreeDOS; +} diff --git a/src/main/java/com/meishu/vo/course/GetStudentHistoryVO.java b/src/main/java/com/meishu/vo/course/GetStudentHistoryVO.java new file mode 100644 index 0000000..2b5332c --- /dev/null +++ b/src/main/java/com/meishu/vo/course/GetStudentHistoryVO.java @@ -0,0 +1,23 @@ +package com.meishu.vo.course; + +import lombok.Data; + +@Data +public class GetStudentHistoryVO { + + private String username; + + private String courseName; + + private String createTime; + + private String administer; + + private String startDate; + + private String endDate; + + private String campus; + + +} diff --git a/src/main/java/com/meishu/vo/course/GetVodIndexVO.java b/src/main/java/com/meishu/vo/course/GetVodIndexVO.java new file mode 100644 index 0000000..a675c2e --- /dev/null +++ b/src/main/java/com/meishu/vo/course/GetVodIndexVO.java @@ -0,0 +1,15 @@ +package com.meishu.vo.course; + +import com.meishu.vo.voddict.GetCourseTreesVodsVO; +import lombok.Data; + +import java.util.List; + +@Data +public class GetVodIndexVO { + + private List<GetCourseTreesVodsVO > mappingIds; + + private Long mappingId; + +} diff --git a/src/main/java/com/meishu/vo/course/QueryCourseInfoVO.java b/src/main/java/com/meishu/vo/course/QueryCourseInfoVO.java new file mode 100644 index 0000000..9d6c511 --- /dev/null +++ b/src/main/java/com/meishu/vo/course/QueryCourseInfoVO.java @@ -0,0 +1,15 @@ +package com.meishu.vo.course; + +import com.meishu.model.AdministerDO; +import com.meishu.model.CourseDictDO; +import lombok.Data; + +import java.util.List; + +@Data +public class QueryCourseInfoVO { + + private CourseDictDO courseDictDO; + + private List<CourseAdministerVO> courseAdministerVOS; +} diff --git a/src/main/java/com/meishu/vo/course/QueryCoursesVO.java b/src/main/java/com/meishu/vo/course/QueryCoursesVO.java new file mode 100644 index 0000000..0b7e733 --- /dev/null +++ b/src/main/java/com/meishu/vo/course/QueryCoursesVO.java @@ -0,0 +1,16 @@ +package com.meishu.vo.course; + +import com.meishu.model.AdministerDO; +import com.meishu.model.CourseDictDO; +import lombok.Data; + +import java.util.List; + +@Data +public class QueryCoursesVO extends CourseDictDO { + + private String subjectName; + + private List<AdministerDO> administerDOS; + +} diff --git a/src/main/java/com/meishu/vo/course/StudentDetailVO.java b/src/main/java/com/meishu/vo/course/StudentDetailVO.java new file mode 100644 index 0000000..10dd5de --- /dev/null +++ b/src/main/java/com/meishu/vo/course/StudentDetailVO.java @@ -0,0 +1,35 @@ +package com.meishu.vo.course; + +import com.meishu.model.CourseChapterDO; +import lombok.Data; + +import java.util.List; + +@Data +public class StudentDetailVO { + + private String wechatImg; + + private String status; + + private String username; + + private String campus; + + private String courseName; + + private Integer totalCounts; + + private Integer studyCounts; + + private String studyPercent; + + private String recentTreeTime; + + private String recentTreeName; + + private Integer totalPlayLength; + + private List<CourseChapterDO> courseChapterDOS; + +} diff --git a/src/main/java/com/meishu/vo/dimension/GetAllDimensionStarVO.java b/src/main/java/com/meishu/vo/dimension/GetAllDimensionStarVO.java new file mode 100644 index 0000000..9a58a91 --- /dev/null +++ b/src/main/java/com/meishu/vo/dimension/GetAllDimensionStarVO.java @@ -0,0 +1,17 @@ +package com.meishu.vo.dimension; + +import com.meishu.model.SubjectDimensionStarDictDO; +import lombok.Data; + +import java.util.List; + +@Data +public class GetAllDimensionStarVO { + + private Long dimensionId; + + private String dimension; + + private List<SubjectDimensionStarDictDO> subjectDimensionStarDictDOS; + +} diff --git a/src/main/java/com/meishu/vo/dimension/GetAllDimensionStarsVO.java b/src/main/java/com/meishu/vo/dimension/GetAllDimensionStarsVO.java new file mode 100644 index 0000000..0ec7adc --- /dev/null +++ b/src/main/java/com/meishu/vo/dimension/GetAllDimensionStarsVO.java @@ -0,0 +1,14 @@ +package com.meishu.vo.dimension; + +import com.meishu.model.SubjectDimensionStarDictDO; +import com.meishu.model.SubjectTreeDO; +import lombok.Data; + +import java.util.List; + +@Data +public class GetAllDimensionStarsVO extends SubjectDimensionStarDictDO { + + private List<SubjectTreeDO> subjectTreeDOS; + +} diff --git a/src/main/java/com/meishu/vo/dimension/StarVO.java b/src/main/java/com/meishu/vo/dimension/StarVO.java new file mode 100644 index 0000000..4e404ae --- /dev/null +++ b/src/main/java/com/meishu/vo/dimension/StarVO.java @@ -0,0 +1,4 @@ +package com.meishu.vo.dimension; + +public class StarVO { +} diff --git a/src/main/java/com/meishu/vo/exercise/GetExerciseDetailResponseVO.java b/src/main/java/com/meishu/vo/exercise/GetExerciseDetailResponseVO.java new file mode 100644 index 0000000..37f0f2e --- /dev/null +++ b/src/main/java/com/meishu/vo/exercise/GetExerciseDetailResponseVO.java @@ -0,0 +1,21 @@ +package com.meishu.vo.exercise; + +import com.meishu.model.ExerciseDictDO; +import lombok.Data; + +/** + * @author: tuyp + * @create: 2020-07-19 16:27 + */ +@Data +public class GetExerciseDetailResponseVO extends ExerciseDictDO { + + private String collectionStatus; + + private String length; + + private String label; + + private Integer lengthSecond; + +} diff --git a/src/main/java/com/meishu/vo/exercise/GetExerciseDetailVO.java b/src/main/java/com/meishu/vo/exercise/GetExerciseDetailVO.java new file mode 100644 index 0000000..83e86cd --- /dev/null +++ b/src/main/java/com/meishu/vo/exercise/GetExerciseDetailVO.java @@ -0,0 +1,14 @@ +package com.meishu.vo.exercise; + +import com.meishu.model.ExerciseDictDO; +import com.meishu.model.SubjectTreeDO; +import lombok.Data; + +import java.util.List; + +@Data +public class GetExerciseDetailVO extends ExerciseDictDO { + + private List<SubjectTreeDO> subjectTreeDOS; + +} diff --git a/src/main/java/com/meishu/vo/exercise/GetTreeExercisesVO.java b/src/main/java/com/meishu/vo/exercise/GetTreeExercisesVO.java new file mode 100644 index 0000000..5ef8c9b --- /dev/null +++ b/src/main/java/com/meishu/vo/exercise/GetTreeExercisesVO.java @@ -0,0 +1,45 @@ +package com.meishu.vo.exercise; + +import com.meishu.model.SubjectTreeDO; +import lombok.Data; + +import java.util.List; + +@Data +public class GetTreeExercisesVO { + + private Long id; + + private String title; + + private String items; + + private String rightAnswer; + + private String detail; + + private String difficulty; + + private Integer total; + + private Integer rights; + + private Integer adviceLength; + + private String userName; + + private String exerciseType; + + private String updateTime; + + private String percent; + + private String shareStatus; + + private String checkStatus; + + private String status; + + private List<SubjectTreeDO> subjectTreeDOS; + +} diff --git a/src/main/java/com/meishu/vo/exercise/QueryCourseTreeExerciseVO.java b/src/main/java/com/meishu/vo/exercise/QueryCourseTreeExerciseVO.java new file mode 100644 index 0000000..10746b0 --- /dev/null +++ b/src/main/java/com/meishu/vo/exercise/QueryCourseTreeExerciseVO.java @@ -0,0 +1,39 @@ +package com.meishu.vo.exercise; + +import lombok.Data; + +@Data +public class QueryCourseTreeExerciseVO { + + private Long id; + + private String treeName; + + private String parentTreeName; + + private String exerciseType; + + private String title; + + private String items; + + private String detail; + + private String rightAnswer; + + private String difficulty; + + private String userName; + + private String updateTime; + + private String rightCnt; + + private String totalCnt; + + private String rightPercent; + + private String status; + + +} diff --git a/src/main/java/com/meishu/vo/grade/DimensionStarVO.java b/src/main/java/com/meishu/vo/grade/DimensionStarVO.java new file mode 100644 index 0000000..750d640 --- /dev/null +++ b/src/main/java/com/meishu/vo/grade/DimensionStarVO.java @@ -0,0 +1,18 @@ +package com.meishu.vo.grade; + +import lombok.Data; + +@Data +public class DimensionStarVO { + + private Long dimensionId; + + private String dimension; + + private Long starId; + + private Integer star; + + private String description; + +} diff --git a/src/main/java/com/meishu/vo/grade/QueryOneGradeVO.java b/src/main/java/com/meishu/vo/grade/QueryOneGradeVO.java new file mode 100644 index 0000000..013aea5 --- /dev/null +++ b/src/main/java/com/meishu/vo/grade/QueryOneGradeVO.java @@ -0,0 +1,21 @@ +package com.meishu.vo.grade; + +import com.meishu.model.SubjectTestGradeExampleMappingDO; +import lombok.Data; + +import java.util.List; + +@Data +public class QueryOneGradeVO { + + private Long id; + + private String gradeName; + + private String content; + + private List<SubjectTestGradeExampleMappingDO> subjectTestGradeExampleMappingDOS; + + private List<DimensionStarVO> dimensionStarVOS; + +} diff --git a/src/main/java/com/meishu/vo/laboratorySession/CalendarStatusVO.java b/src/main/java/com/meishu/vo/laboratorySession/CalendarStatusVO.java new file mode 100644 index 0000000..f141de1 --- /dev/null +++ b/src/main/java/com/meishu/vo/laboratorySession/CalendarStatusVO.java @@ -0,0 +1,11 @@ +package com.meishu.vo.laboratorySession; + +import lombok.Data; + +@Data +public class CalendarStatusVO { + + private String startDate; + + private Integer status; +} diff --git a/src/main/java/com/meishu/vo/laboratorySession/GetLaboratorySessionVO.java b/src/main/java/com/meishu/vo/laboratorySession/GetLaboratorySessionVO.java new file mode 100644 index 0000000..8425e41 --- /dev/null +++ b/src/main/java/com/meishu/vo/laboratorySession/GetLaboratorySessionVO.java @@ -0,0 +1,21 @@ +package com.meishu.vo.laboratorySession; + +import lombok.Data; + +@Data +public class GetLaboratorySessionVO { + + private Long id; + + private String laboratoryName; + + private String timeSlot; + + private String registerStartDate; + + private String registerEndDate; + + private Integer surplus; + + private Integer status; +} diff --git a/src/main/java/com/meishu/vo/laboratorySession/LaboratoryDictPageVO.java b/src/main/java/com/meishu/vo/laboratorySession/LaboratoryDictPageVO.java new file mode 100644 index 0000000..abe0126 --- /dev/null +++ b/src/main/java/com/meishu/vo/laboratorySession/LaboratoryDictPageVO.java @@ -0,0 +1,17 @@ +package com.meishu.vo.laboratorySession; + +import com.meishu.model.SessionsDictDO; +import lombok.Data; +import java.util.List; + +@Data +public class LaboratoryDictPageVO { + + private Long id; + + private String laboratoryName; + + private Integer maxNum; + + private List<SessionsDictDO> sessions; +} diff --git a/src/main/java/com/meishu/vo/laboratorySession/LaboratorySessionMappingVO.java b/src/main/java/com/meishu/vo/laboratorySession/LaboratorySessionMappingVO.java new file mode 100644 index 0000000..4e76165 --- /dev/null +++ b/src/main/java/com/meishu/vo/laboratorySession/LaboratorySessionMappingVO.java @@ -0,0 +1,23 @@ +package com.meishu.vo.laboratorySession; + +import com.meishu.model.SessionsDictDO; +import lombok.Data; +import java.util.List; + +@Data +public class LaboratorySessionMappingVO { + + private Long laboratoryDictId; + + private String laboratoryName; + + private String registerStartDate; + + private String registerEndDate; + + private Integer maxNum; + + private String grade; + + private List<SessionsDictDO> timeSlot; +} diff --git a/src/main/java/com/meishu/vo/laboratorySession/LaboratorySessionVO.java b/src/main/java/com/meishu/vo/laboratorySession/LaboratorySessionVO.java new file mode 100644 index 0000000..5a97a66 --- /dev/null +++ b/src/main/java/com/meishu/vo/laboratorySession/LaboratorySessionVO.java @@ -0,0 +1,12 @@ +package com.meishu.vo.laboratorySession; + +import lombok.Data; +import java.util.List; + +@Data +public class LaboratorySessionVO { + + private List<String> timeSlot; + + private List<LaboratorySessionMappingVO> laboratoryList; +} diff --git a/src/main/java/com/meishu/vo/laboratorySession/StatisticsVO.java b/src/main/java/com/meishu/vo/laboratorySession/StatisticsVO.java new file mode 100644 index 0000000..f1323f2 --- /dev/null +++ b/src/main/java/com/meishu/vo/laboratorySession/StatisticsVO.java @@ -0,0 +1,13 @@ +package com.meishu.vo.laboratorySession; + +import lombok.Data; + +@Data +public class StatisticsVO { + + private Integer createNum; + + private Integer sessionNum; + + private Integer laboratoryNum; +} diff --git a/src/main/java/com/meishu/vo/laboratoryUser/LaboratoryUserPageVO.java b/src/main/java/com/meishu/vo/laboratoryUser/LaboratoryUserPageVO.java new file mode 100644 index 0000000..94c6e75 --- /dev/null +++ b/src/main/java/com/meishu/vo/laboratoryUser/LaboratoryUserPageVO.java @@ -0,0 +1,38 @@ +package com.meishu.vo.laboratoryUser; + +import com.meishu.util.excel.ExcelColumn; +import lombok.Data; + +@Data +public class LaboratoryUserPageVO { + + /** + * 用户表报名记录ID + */ + private Long id; + + /** + * 安排表ID + */ + private Long laboratorySessionId; + + /** + * 场次ID + */ + private Long sessionsDictId; + + @ExcelColumn(col = 1, value = "实验室名称") + private String laboratoryName; + + @ExcelColumn(col = 2, value = "场次") + private String timeSlot; + + @ExcelColumn(col = 3, value = "姓名") + private String userName; + + @ExcelColumn(col = 4, value = "学号") + private String studyCode; + + @ExcelColumn(col = 5, value = "班级") + private String classes; +} diff --git a/src/main/java/com/meishu/vo/question/GetClassQuestionsVO.java b/src/main/java/com/meishu/vo/question/GetClassQuestionsVO.java new file mode 100644 index 0000000..7aaac89 --- /dev/null +++ b/src/main/java/com/meishu/vo/question/GetClassQuestionsVO.java @@ -0,0 +1,12 @@ +package com.meishu.vo.question; + +import com.meishu.model.SubjectDictDO; +import com.meishu.model.SubjectTreeDO; +import lombok.Data; + +@Data +public class GetClassQuestionsVO extends SubjectDictDO { + + private Integer count; + +} diff --git a/src/main/java/com/meishu/vo/question/QueryOneQuestionVO.java b/src/main/java/com/meishu/vo/question/QueryOneQuestionVO.java new file mode 100644 index 0000000..5c333e8 --- /dev/null +++ b/src/main/java/com/meishu/vo/question/QueryOneQuestionVO.java @@ -0,0 +1,11 @@ +package com.meishu.vo.question; + +import com.meishu.model.AnsweringQuestionDO; +import lombok.Data; + +@Data +public class QueryOneQuestionVO extends AnsweringQuestionDO { + + private String userName; + +} diff --git a/src/main/java/com/meishu/vo/question/QueryQuestionsVO.java b/src/main/java/com/meishu/vo/question/QueryQuestionsVO.java new file mode 100644 index 0000000..387350a --- /dev/null +++ b/src/main/java/com/meishu/vo/question/QueryQuestionsVO.java @@ -0,0 +1,20 @@ +package com.meishu.vo.question; + +import lombok.Data; + +@Data +public class QueryQuestionsVO { + + private Integer id; + + private String userName; + + private String createDate; + + private String title; + + private String answer; + + private String updateDate; + +} diff --git a/src/main/java/com/meishu/vo/role/GetAllRolesVO.java b/src/main/java/com/meishu/vo/role/GetAllRolesVO.java new file mode 100644 index 0000000..79b3c0f --- /dev/null +++ b/src/main/java/com/meishu/vo/role/GetAllRolesVO.java @@ -0,0 +1,14 @@ +package com.meishu.vo.role; + +import com.meishu.model.PermissionsDictDO; +import com.meishu.model.RoleDictDO; +import lombok.Data; + +import java.util.List; + +@Data +public class GetAllRolesVO extends RoleDictDO { + + private List<PermissionsDictDO> permissionsDictDOS; + +} diff --git a/src/main/java/com/meishu/vo/role/GetRoleTeachersVO.java b/src/main/java/com/meishu/vo/role/GetRoleTeachersVO.java new file mode 100644 index 0000000..a81c905 --- /dev/null +++ b/src/main/java/com/meishu/vo/role/GetRoleTeachersVO.java @@ -0,0 +1,22 @@ +package com.meishu.vo.role; + +import com.meishu.model.DepartmentDictDO; +import lombok.Data; + +import java.util.List; + +@Data +public class GetRoleTeachersVO { + + private Long id; + + private Long administerId; + + private String userName; + + private String telephone; + + private String departmentName; + + private List<DepartmentDictDO> departmentDictDOS; +} diff --git a/src/main/java/com/meishu/vo/rule/GetAllRulesVO.java b/src/main/java/com/meishu/vo/rule/GetAllRulesVO.java new file mode 100644 index 0000000..1ddfbe0 --- /dev/null +++ b/src/main/java/com/meishu/vo/rule/GetAllRulesVO.java @@ -0,0 +1,18 @@ +package com.meishu.vo.rule; + +import lombok.Data; + +@Data +public class GetAllRulesVO { + + private Long id; + + private String subjectName; + + private Long subjectId; + + private String ruleName; + + private String status; + +} diff --git a/src/main/java/com/meishu/vo/rule/GetOneExaminationDetailVO.java b/src/main/java/com/meishu/vo/rule/GetOneExaminationDetailVO.java new file mode 100644 index 0000000..60d1396 --- /dev/null +++ b/src/main/java/com/meishu/vo/rule/GetOneExaminationDetailVO.java @@ -0,0 +1,41 @@ +package com.meishu.vo.rule; + +import com.meishu.vo.grade.QueryOneGradeVO; +import lombok.Data; + +import java.util.List; + +@Data +public class GetOneExaminationDetailVO { + + private Long id; + + private String subjectName; + + private String ruleName; + + private String publishName; + + private String examination; + + private String outline; + + private String deadline; + + private String answer; + + private String testTime; + + private String userName; + + private List<StudentStarVO> studentStarVOS; + + private Double total; + + private String commitTime; + + private String testType; + + private List<QueryOneGradeVO> queryOneGradeVOS; + +} diff --git a/src/main/java/com/meishu/vo/rule/GetRuleReportVO.java b/src/main/java/com/meishu/vo/rule/GetRuleReportVO.java new file mode 100644 index 0000000..67701d0 --- /dev/null +++ b/src/main/java/com/meishu/vo/rule/GetRuleReportVO.java @@ -0,0 +1,7 @@ +package com.meishu.vo.rule; + +import lombok.Data; + +@Data +public class GetRuleReportVO { +} diff --git a/src/main/java/com/meishu/vo/rule/GetStudentRulesVO.java b/src/main/java/com/meishu/vo/rule/GetStudentRulesVO.java new file mode 100644 index 0000000..90568fb --- /dev/null +++ b/src/main/java/com/meishu/vo/rule/GetStudentRulesVO.java @@ -0,0 +1,28 @@ +package com.meishu.vo.rule; + +import lombok.Data; + +@Data +public class GetStudentRulesVO { + + private Long id; + + private String subjectName; + + private String ruleName; + + private String examination; + + private String outline; + + private String testTime; + + private String createTime; + + private String coverPage; + + private String testType; + + private String publishName; + +} diff --git a/src/main/java/com/meishu/vo/rule/StudentStarVO.java b/src/main/java/com/meishu/vo/rule/StudentStarVO.java new file mode 100644 index 0000000..f29e57b --- /dev/null +++ b/src/main/java/com/meishu/vo/rule/StudentStarVO.java @@ -0,0 +1,17 @@ +package com.meishu.vo.rule; + +import com.baomidou.mybatisplus.core.toolkit.StringUtils; +import lombok.Data; + +@Data +public class StudentStarVO { + + private String dimension; + + private Integer star; + + private String description; + + private String userName; + +} diff --git a/src/main/java/com/meishu/vo/semester/GetAllPastSemesterVO.java b/src/main/java/com/meishu/vo/semester/GetAllPastSemesterVO.java new file mode 100644 index 0000000..f73cbfc --- /dev/null +++ b/src/main/java/com/meishu/vo/semester/GetAllPastSemesterVO.java @@ -0,0 +1,16 @@ +package com.meishu.vo.semester; + +import com.meishu.model.ClassesDictHistoryDO; +import lombok.Data; + +import java.util.List; + +@Data +public class GetAllPastSemesterVO { + + + private String gradeType; + + private List<ClassesDictHistoryDO> classesDictDOS; + +} diff --git a/src/main/java/com/meishu/vo/semester/GetAllStudyingSemesterVO.java b/src/main/java/com/meishu/vo/semester/GetAllStudyingSemesterVO.java new file mode 100644 index 0000000..e46e04e --- /dev/null +++ b/src/main/java/com/meishu/vo/semester/GetAllStudyingSemesterVO.java @@ -0,0 +1,15 @@ +package com.meishu.vo.semester; + +import com.meishu.model.ClassesDictDO; +import lombok.Data; + +import java.util.List; + +@Data +public class GetAllStudyingSemesterVO { + + private String gradeType; + + private List<ClassesDictDO> classesDictDOS; + +} diff --git a/src/main/java/com/meishu/vo/semester/GetSemesterScoreVO.java b/src/main/java/com/meishu/vo/semester/GetSemesterScoreVO.java new file mode 100644 index 0000000..69660b5 --- /dev/null +++ b/src/main/java/com/meishu/vo/semester/GetSemesterScoreVO.java @@ -0,0 +1,25 @@ +package com.meishu.vo.semester; + +import com.meishu.util.excel.ExcelColumn; +import lombok.Data; + +@Data +public class GetSemesterScoreVO { + + private Integer id; + + private Integer userId; + + @ExcelColumn(col = 1,value = "姓名") + private String userName; + + @ExcelColumn(col = 2,value = "学号") + private String studyCode; + + @ExcelColumn(col = 3,value = "科目") + private String subject; + + @ExcelColumn(col = 4,value = "当前分数") + private String score; + +} diff --git a/src/main/java/com/meishu/vo/semester/GetStudentDetailVO.java b/src/main/java/com/meishu/vo/semester/GetStudentDetailVO.java new file mode 100644 index 0000000..e46205d --- /dev/null +++ b/src/main/java/com/meishu/vo/semester/GetStudentDetailVO.java @@ -0,0 +1,20 @@ +package com.meishu.vo.semester; + +import lombok.Data; + +@Data +public class GetStudentDetailVO { + + private String teacherName; + + private String itemDesc; + + private Double score; + + private Integer itemType; + + private Integer scoreType; + + private String createDate; + +} diff --git a/src/main/java/com/meishu/vo/semester/GetStudentRecordVO.java b/src/main/java/com/meishu/vo/semester/GetStudentRecordVO.java new file mode 100644 index 0000000..bc91864 --- /dev/null +++ b/src/main/java/com/meishu/vo/semester/GetStudentRecordVO.java @@ -0,0 +1,30 @@ +package com.meishu.vo.semester; + +import com.meishu.util.excel.ExcelColumn; +import lombok.Data; + +@Data +public class GetStudentRecordVO { + + @ExcelColumn(col = 1,value = "班级") + private String className; + + @ExcelColumn(col = 2,value = "学生名") + private String userName; + + @ExcelColumn(col = 3,value = "扣分项") + private String itemDesc; + + @ExcelColumn(col = 4,value = "分数") + private String score; + + @ExcelColumn(col = 5,value = "老师名") + private String teacherName; + + @ExcelColumn(col = 6,value = "科目") + private String subject; + + @ExcelColumn(col = 7,value = "时间") + private String createDate; + +} diff --git a/src/main/java/com/meishu/vo/sign/ClassSignInVO.java b/src/main/java/com/meishu/vo/sign/ClassSignInVO.java new file mode 100644 index 0000000..bcd85b4 --- /dev/null +++ b/src/main/java/com/meishu/vo/sign/ClassSignInVO.java @@ -0,0 +1,20 @@ +package com.meishu.vo.sign; + +import lombok.Data; + +@Data +public class ClassSignInVO { + + private Integer id; + + private String userName; + + private String studyCode; + + private String gender; + + private String phone; + + private String signInDate; + +} diff --git a/src/main/java/com/meishu/vo/student/ChapterTestVO.java b/src/main/java/com/meishu/vo/student/ChapterTestVO.java new file mode 100644 index 0000000..167f402 --- /dev/null +++ b/src/main/java/com/meishu/vo/student/ChapterTestVO.java @@ -0,0 +1,15 @@ +package com.meishu.vo.student; + +import com.meishu.model.ExerciseDictDO; +import lombok.Data; + +import java.util.List; + +@Data +public class ChapterTestVO { + + private List<ExerciseDictDO> exerciseDictDOS; + + private Integer exerciseSize; + +} diff --git a/src/main/java/com/meishu/vo/student/ClassVO.java b/src/main/java/com/meishu/vo/student/ClassVO.java new file mode 100644 index 0000000..10c73df --- /dev/null +++ b/src/main/java/com/meishu/vo/student/ClassVO.java @@ -0,0 +1,18 @@ +package com.meishu.vo.student; + +import com.meishu.model.CourseDictDO; +import com.meishu.vo.course.CourseAdministerVO; +import lombok.Data; + +import java.util.List; + +@Data +public class ClassVO extends CourseDictDO { + + private List<CourseAdministerVO> courseAdministerVOS; + + private String subjectName; + + private String publishTime; + +} diff --git a/src/main/java/com/meishu/vo/student/GetChildTreesVO.java b/src/main/java/com/meishu/vo/student/GetChildTreesVO.java new file mode 100644 index 0000000..0b4da2a --- /dev/null +++ b/src/main/java/com/meishu/vo/student/GetChildTreesVO.java @@ -0,0 +1,14 @@ +package com.meishu.vo.student; + +import lombok.Data; + +import java.util.List; + +@Data +public class GetChildTreesVO { + + private StudentVodVO studentVodVO; + + private List<StudentTreeVodDoneVO> studentTreeVodDoneVOS; + +} diff --git a/src/main/java/com/meishu/vo/student/GetStudyProgressVO.java b/src/main/java/com/meishu/vo/student/GetStudyProgressVO.java new file mode 100644 index 0000000..bfc96ae --- /dev/null +++ b/src/main/java/com/meishu/vo/student/GetStudyProgressVO.java @@ -0,0 +1,31 @@ +package com.meishu.vo.student; + +import lombok.Data; + +import java.util.List; + +@Data +public class GetStudyProgressVO { + + private List<StudentCourseVO> treeVods; + + private Integer totalCounts; + + private Integer watchCounts; + + private Integer percent; + + private Integer toStudyTreeNodes; + + /** + * 是否做过习题 + */ + private String exerciseStatus; + + /** + * 是否能做习题 + */ + private String doExerciseStatus; + + +} diff --git a/src/main/java/com/meishu/vo/student/LoginVO.java b/src/main/java/com/meishu/vo/student/LoginVO.java new file mode 100644 index 0000000..c2480ec --- /dev/null +++ b/src/main/java/com/meishu/vo/student/LoginVO.java @@ -0,0 +1,18 @@ +package com.meishu.vo.student; + +import com.meishu.model.StudentDO; +import lombok.Data; + +import java.util.List; + +@Data +public class LoginVO extends StudentDO { + + private String campus; + + private String username; + + private List<SubjectReportVO> subjectReportVOS; + + private String isStudent; +} diff --git a/src/main/java/com/meishu/vo/student/ParentReportVO.java b/src/main/java/com/meishu/vo/student/ParentReportVO.java new file mode 100644 index 0000000..9466319 --- /dev/null +++ b/src/main/java/com/meishu/vo/student/ParentReportVO.java @@ -0,0 +1,30 @@ +package com.meishu.vo.student; + +import com.meishu.model.CourseTreeDO; +import lombok.Data; + +import java.util.List; + +@Data +public class ParentReportVO { + + private Integer rightCount; + + private Integer exerciseCounts; + + private Integer rightPercent; + + private Integer totalVodCounts; + + private Integer watchCounts; + + private Integer watchPercent; + + private String treeName; + + private String subjectName; + + private List<CourseTreeDO> rightTree; + + private List<CourseTreeDO> wrongTree; +} diff --git a/src/main/java/com/meishu/vo/student/QueryChapterTestVO.java b/src/main/java/com/meishu/vo/student/QueryChapterTestVO.java new file mode 100644 index 0000000..07bd9b1 --- /dev/null +++ b/src/main/java/com/meishu/vo/student/QueryChapterTestVO.java @@ -0,0 +1,30 @@ +package com.meishu.vo.student; + +import lombok.Data; + +@Data +public class QueryChapterTestVO { + + private Long id; + + private String title; + + private String rightAnswer; + + private String items; + + private Integer difficulty; + + private String exerciseType; + + private String detail; + + private Integer adviceLength; + + private Integer length; + + private String result; + + private String answer; + +} diff --git a/src/main/java/com/meishu/vo/student/QueryClassVO.java b/src/main/java/com/meishu/vo/student/QueryClassVO.java new file mode 100644 index 0000000..d410619 --- /dev/null +++ b/src/main/java/com/meishu/vo/student/QueryClassVO.java @@ -0,0 +1,14 @@ +package com.meishu.vo.student; + +import lombok.Data; + +import java.util.List; + +@Data +public class QueryClassVO { + + private List<ClassVO> innerSubjects; + + private List<ClassVO> outerSubjects; + +} diff --git a/src/main/java/com/meishu/vo/student/QueryStudentVO.java b/src/main/java/com/meishu/vo/student/QueryStudentVO.java new file mode 100644 index 0000000..51bb202 --- /dev/null +++ b/src/main/java/com/meishu/vo/student/QueryStudentVO.java @@ -0,0 +1,11 @@ +package com.meishu.vo.student; + +import com.meishu.model.StudentDO; +import lombok.Data; + +@Data +public class QueryStudentVO extends StudentDO { + + private String campus; + +} diff --git a/src/main/java/com/meishu/vo/student/SearchVodsVO.java b/src/main/java/com/meishu/vo/student/SearchVodsVO.java new file mode 100644 index 0000000..aba8f4a --- /dev/null +++ b/src/main/java/com/meishu/vo/student/SearchVodsVO.java @@ -0,0 +1,27 @@ +package com.meishu.vo.student; + +import com.meishu.model.SubjectTreeDO; +import lombok.Data; + +import java.util.List; + +@Data +public class SearchVodsVO { + + private List<SubjectTreeDO> subjectTreeDOS; + + private Integer vodLength; + + private Long id; + + private String vodType; + + private String coverPage; + + private String vodName; + + private String vodUrl; + + private String status; + +} diff --git a/src/main/java/com/meishu/vo/student/StudentCampusVO.java b/src/main/java/com/meishu/vo/student/StudentCampusVO.java new file mode 100644 index 0000000..b81c0e6 --- /dev/null +++ b/src/main/java/com/meishu/vo/student/StudentCampusVO.java @@ -0,0 +1,24 @@ +package com.meishu.vo.student; + +import lombok.Data; + +@Data +public class StudentCampusVO { + + private Long studentId; + + private String username; + + private String campus; + + private String status; + + private String startDate; + + private String endDate; + + private Integer diff; + + private Long id; + +} diff --git a/src/main/java/com/meishu/vo/student/StudentCourseVO.java b/src/main/java/com/meishu/vo/student/StudentCourseVO.java new file mode 100644 index 0000000..604d8b7 --- /dev/null +++ b/src/main/java/com/meishu/vo/student/StudentCourseVO.java @@ -0,0 +1,17 @@ +package com.meishu.vo.student; + +import com.meishu.vo.voddict.GetCourseTreesVodsVO; +import lombok.Data; + +import java.util.List; + +@Data +public class StudentCourseVO { + + private String treeName; + + private List<GetCourseTreesVodsVO> vodDictDOS; + + private List<StudentCourseVO> studentCourseVO; + +} diff --git a/src/main/java/com/meishu/vo/student/StudentTreeVodDoneVO.java b/src/main/java/com/meishu/vo/student/StudentTreeVodDoneVO.java new file mode 100644 index 0000000..354d965 --- /dev/null +++ b/src/main/java/com/meishu/vo/student/StudentTreeVodDoneVO.java @@ -0,0 +1,16 @@ +package com.meishu.vo.student; + +import lombok.Data; + +@Data +public class StudentTreeVodDoneVO { + + private Long id; // courseId + + private Long treeId; //知识点id + + private String treeName; + + private Boolean completeStatus; + +} diff --git a/src/main/java/com/meishu/vo/student/StudentVO.java b/src/main/java/com/meishu/vo/student/StudentVO.java new file mode 100644 index 0000000..80e334a --- /dev/null +++ b/src/main/java/com/meishu/vo/student/StudentVO.java @@ -0,0 +1,18 @@ +package com.meishu.vo.student; + +import lombok.Data; + +@Data +public class StudentVO { + + private Long id; + + private String username; + + private String telephone; + + private String campus; + + private String campusId; + +} diff --git a/src/main/java/com/meishu/vo/student/StudentVodVO.java b/src/main/java/com/meishu/vo/student/StudentVodVO.java new file mode 100644 index 0000000..8862183 --- /dev/null +++ b/src/main/java/com/meishu/vo/student/StudentVodVO.java @@ -0,0 +1,18 @@ +package com.meishu.vo.student; + +import com.meishu.vo.course.CourseVodVO; +import lombok.Data; + +import java.util.List; + +@Data +public class StudentVodVO { + + private List<CourseVodVO> courseVodVOS; + + private Integer completePercent; + + private Boolean completeStatus; + + +} diff --git a/src/main/java/com/meishu/vo/student/StudyReportVO.java b/src/main/java/com/meishu/vo/student/StudyReportVO.java new file mode 100644 index 0000000..dee1d5f --- /dev/null +++ b/src/main/java/com/meishu/vo/student/StudyReportVO.java @@ -0,0 +1,31 @@ +package com.meishu.vo.student; + +import com.meishu.model.CourseTreeDO; +import lombok.Data; + +import java.util.List; + +@Data +public class StudyReportVO { + + private Integer totalCounts; + + private Integer watchCounts; + + private String treeName; + + private Integer rightCount; + + private Integer exerciseCounts; + + private Integer rightPercent; + + private String subjectName; + + private Integer watchPercent; + + private List<CourseTreeDO> rightTree; + + private List<CourseTreeDO> wrongTree; + +} diff --git a/src/main/java/com/meishu/vo/student/SubjectReportVO.java b/src/main/java/com/meishu/vo/student/SubjectReportVO.java new file mode 100644 index 0000000..0d96dd6 --- /dev/null +++ b/src/main/java/com/meishu/vo/student/SubjectReportVO.java @@ -0,0 +1,17 @@ +package com.meishu.vo.student; + +import lombok.Data; + +@Data +public class SubjectReportVO { + + private Long courseId; + + private String subjectName; + + private String courseName; + + private String createTime; + + +} diff --git a/src/main/java/com/meishu/vo/subject/GetAllNoAuthenVodsVO.java b/src/main/java/com/meishu/vo/subject/GetAllNoAuthenVodsVO.java new file mode 100644 index 0000000..678ca97 --- /dev/null +++ b/src/main/java/com/meishu/vo/subject/GetAllNoAuthenVodsVO.java @@ -0,0 +1,24 @@ +package com.meishu.vo.subject; + +import com.meishu.model.SubjectTreeDO; +import lombok.Data; + +import java.util.List; + +@Data +public class GetAllNoAuthenVodsVO { + + private Long id; + + private String vodName; + + private String vodType; + + private List<SubjectTreeDO> subjectTreeDOS; + + private String userName; + + private String updateTime; + + +} diff --git a/src/main/java/com/meishu/vo/subject/GetNextNodeVO.java b/src/main/java/com/meishu/vo/subject/GetNextNodeVO.java new file mode 100644 index 0000000..3dd08eb --- /dev/null +++ b/src/main/java/com/meishu/vo/subject/GetNextNodeVO.java @@ -0,0 +1,14 @@ +package com.meishu.vo.subject; + +import lombok.Data; + +import java.util.List; + +@Data +public class GetNextNodeVO { + + private GetSubjectTreeVO getSubjectTreeVO; + + private List<GetSubjectTreeVO> getSubjectTreeVOS; + +} diff --git a/src/main/java/com/meishu/vo/subject/GetSubjectTreeVO.java b/src/main/java/com/meishu/vo/subject/GetSubjectTreeVO.java new file mode 100644 index 0000000..bcc452a --- /dev/null +++ b/src/main/java/com/meishu/vo/subject/GetSubjectTreeVO.java @@ -0,0 +1,119 @@ +package com.meishu.vo.subject; + +import lombok.Data; + +import java.util.List; + +@Data +public class GetSubjectTreeVO implements Comparable<GetSubjectTreeVO> { + + + private Long id; + + private Long subjectId; + + /** + * 章节 + */ + private Integer chapterId; + + /** + * 知识点名称 + */ + private String treeName; + + /** + * 写程序使用,数据库不存值 + */ + private List<GetSubjectTreeVO> children; + + /** + * 父节点 + */ + private Long parentId; + + /** + * 子节点个数 + */ + private Integer childNodeCounts; + + private String parentTreeName; + + private String treeNode; + + /** + * 视频个数 个人库数量 + */ + private Integer vodCounts; + + /** + * 视频个数 公共库数量 + */ + private Integer publicVodCounts; + + /** + * 题目个数 + */ + private Integer exerciseCounts; + + /** + *视频个数 公共库数量 + */ + private Integer publicExerciseVodCounts; + + /** + * 视频审核个数 + */ + private Integer checkVodCounts; + + /** + * 题目审核个数 + */ + private Integer checkExerciseCounts; + + /** + * 视频待审核个数 + */ + private Integer toCheckVodCounts; + + /** + * 题目待审核个数 + */ + private Integer toCheckExerciseCounts; + + /** + * 子节点集合 + */ + private List<Integer> childTreeIds; + + private String number; + + private String text; + + private String layer; + + private int level; + + public GetSubjectTreeVO(Long id, String number, Long parentId, int level) { + this.id = id; + this.number = number; + this.parentId = parentId; + this.level = level; + } + + @Override + public int compareTo(GetSubjectTreeVO o) { + if (this.level != o.level) { + return o.level - this.level; + } else { + if(this.number==null){ + return -1; + } + return this.number.compareTo(o.number); + } + } + + public GetSubjectTreeVO(){ + + } +} diff --git a/src/main/java/com/meishu/vo/subject/SubjectTreeOrder.java b/src/main/java/com/meishu/vo/subject/SubjectTreeOrder.java new file mode 100644 index 0000000..402eb14 --- /dev/null +++ b/src/main/java/com/meishu/vo/subject/SubjectTreeOrder.java @@ -0,0 +1,212 @@ +package com.meishu.vo.subject; + +import com.meishu.util.tree.SerialNumber; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +@Data +public class SubjectTreeOrder { + + private String id; + + public List<GetSubjectTreeVO> nodeList; + + private String separator; + + private Long idSeq; + + private SerialNumber number; + + public SubjectTreeOrder(String separator, SerialNumber number) { + init(); + this.separator = separator; + this.number = number; + + } + + public void init() { + idSeq = 0L; + this.separator = "."; + if (this.nodeList == null) { + nodeList = new ArrayList<>(); + } + } + + + /** + * <p>功能描述:根据父节点获取所有子节点。</p> + */ + public List<GetSubjectTreeVO> getChildNodes(GetSubjectTreeVO pNode,List<GetSubjectTreeVO> nodeList) { + Long pId = pNode.getId(); + return getChildNodes(pId,nodeList); + } + + /** + * <p>功能描述:根据父节点获取所有子节点。</p> + */ + public List<GetSubjectTreeVO> getChildNodes(Long pId,List<GetSubjectTreeVO> nodeList) { + List<GetSubjectTreeVO> childNodes = new ArrayList<>(); + for (GetSubjectTreeVO n : nodeList) { + if (pId.equals(n.getParentId())) { + childNodes.add(n); + } + } + + return childNodes; + } + + /** + * <p>功能描述:获取本级值最大的节点。</p> + */ + public GetSubjectTreeVO getMaxNodeForThisLevel(GetSubjectTreeVO pNode,List<GetSubjectTreeVO> nodeList) { + List<GetSubjectTreeVO> childList = getChildNodes(pNode,nodeList); + GetSubjectTreeVO root = getRoot(nodeList); + if (childList.size() <= 0) { + return null; + } + GetSubjectTreeVO maxNode = root; + for (GetSubjectTreeVO node : childList) { + if (maxNode.getNumber().compareTo(node.getNumber()) <= 0) { + maxNode = node; + } + } + return maxNode; + } + + /** + * <p>功能描述:生成下一个子节点。</p> + */ + public GetSubjectTreeVO generateNextChildNode(GetSubjectTreeVO node,List<GetSubjectTreeVO> nodeList) { + GetSubjectTreeVO newNode = null; + GetSubjectTreeVO maxNode = getMaxNodeForThisLevel(node,nodeList); + String nextNumber = number.firstNumber(); + int level = node.getLevel(); + if (maxNode != null && !"0".equals(maxNode.getId())) {//本级存在子节点,且非根节点 + nextNumber = number.produceNext(maxNode.getNumber()); + level = maxNode.getLevel(); + } + newNode = new GetSubjectTreeVO(++idSeq, nextNumber, node.getId(), level); + + generateNodeText(newNode, nextNumber,nodeList); + + return newNode; + } + + + /** + * + * <p>功能描述:获取父节点。</p> + */ + public GetSubjectTreeVO getParentNode(GetSubjectTreeVO node,List<GetSubjectTreeVO> nodeList) { + for (GetSubjectTreeVO n : nodeList) { + if (node.getParentId().equals(n.getId())) { + return n; + } + } + return node; + } + + /** + * <p>功能描述:生成节点路径。</p> + */ + public void generateNodeText(GetSubjectTreeVO node, String text,List<GetSubjectTreeVO> nodeList) { + + if (node == null || "0".equals(node.getId())) { + return; + } + + GetSubjectTreeVO pNode = getParentNode(node,nodeList); + + if (!"0".equals(pNode.getId())) { + text = pNode.getText() + separator + text; + } + node.setText(text); + } + +// /** +// * <p>功能描述:遍历所有树节点。</p> +// */ +// public void traverseNodeList(GetSubjectTreeVO node) { +// if(node==null){ +// node = getRoot(nodeList); +// } +// List<GetSubjectTreeVO> childNodes = getChildNodes(node); +// System.out.println(node.getText()); +// if (childNodes.size() > 0) { +// for (GetSubjectTreeVO n : childNodes) { +// traverseNodeList(n); +// } +// } +// } + public static void main(String[] args) { + SerialNumber number = new SerialNumber(); + SubjectTreeOrder treeNode = new SubjectTreeOrder(".", number); + +// addSomeNodes(treeNode); +// treeNode.traverseNodeList(null); + } + + /** + * <p>功能描述:获取根节点。</p> + */ + public GetSubjectTreeVO getRoot(List<GetSubjectTreeVO> nodeList) { + GetSubjectTreeVO root = null; + if (nodeList.size() <= 0 || (root = getNodeById(nodeList, "0")) == null) { + root = createRoot(); + nodeList.add(root); + } + return root; + } + + private GetSubjectTreeVO getNodeById(List<GetSubjectTreeVO> nodeList, String id) { + GetSubjectTreeVO node = null; + if(id!=null){ + for (GetSubjectTreeVO n : nodeList) { + if (id.equals(n.getId())) { + node = n; + break; + } + } + } + return node; + } + + private GetSubjectTreeVO createRoot() { + GetSubjectTreeVO root = new GetSubjectTreeVO(0L, number.rootNumber(), -1L, 0); + root.setText("0"); + return root; + } + + /** + * <p>功能描述:测试添加节点。</p> + */ +// private static GetSubjectTreeVO addSomeNodes(SubjectTreeOrder tree) { +// GetSubjectTreeVO root = tree.getRoot(tree.nodeList); +// GetSubjectTreeVO node1 = getNextNode(tree, root);//1 +// GetSubjectTreeVO node2 = getNextNode(tree, root);//2 +// GetSubjectTreeVO node3 = getNextNode(tree, root);//3 +// GetSubjectTreeVO node11 = getNextNode(tree, node1);//1.1 +// GetSubjectTreeVO node12 = getNextNode(tree, node1);//1.2 +// GetSubjectTreeVO node21 = getNextNode(tree, node2);//2.1 +// GetSubjectTreeVO node211 = getNextNode(tree, node21);//2.1.1 +// GetSubjectTreeVO node212 = getNextNode(tree, node21);//2.1.2 +// GetSubjectTreeVO node22 = getNextNode(tree, node2);//2.2 +// GetSubjectTreeVO node221 = getNextNode(tree, node22);//2.2.1 +// GetSubjectTreeVO node31 = getNextNode(tree, node3); +// GetSubjectTreeVO node32 = getNextNode(tree, node3); +// GetSubjectTreeVO node311 = getNextNode(tree, node31); +// GetSubjectTreeVO node3111 = getNextNode(tree, node311); +// return root; +// } + + public static GetSubjectTreeVO getNextNode(SubjectTreeOrder tree, GetSubjectTreeVO pNode,List<GetSubjectTreeVO> nodeList) { + GetSubjectTreeVO node = tree.generateNextChildNode(pNode,nodeList); + if (node != null) { + nodeList.add(node); + } + return node; + } + +} diff --git a/src/main/java/com/meishu/vo/task/ClassDoneInfoVO.java b/src/main/java/com/meishu/vo/task/ClassDoneInfoVO.java new file mode 100644 index 0000000..3e78061 --- /dev/null +++ b/src/main/java/com/meishu/vo/task/ClassDoneInfoVO.java @@ -0,0 +1,16 @@ +package com.meishu.vo.task; + +import lombok.Data; + +@Data +public class ClassDoneInfoVO { + + private Integer exerciseId; + + private Integer length; + + private Integer result; + + private Integer countNum; + +} diff --git a/src/main/java/com/meishu/vo/task/ExeRightRatioVO.java b/src/main/java/com/meishu/vo/task/ExeRightRatioVO.java new file mode 100644 index 0000000..f41cd93 --- /dev/null +++ b/src/main/java/com/meishu/vo/task/ExeRightRatioVO.java @@ -0,0 +1,15 @@ +package com.meishu.vo.task; + +import lombok.Data; + +@Data +public class ExeRightRatioVO { + + private String exercise; + + private String type; + + private String value; + + private String length; +} diff --git a/src/main/java/com/meishu/vo/task/ExerciseDoneInfoVO.java b/src/main/java/com/meishu/vo/task/ExerciseDoneInfoVO.java new file mode 100644 index 0000000..3681a7f --- /dev/null +++ b/src/main/java/com/meishu/vo/task/ExerciseDoneInfoVO.java @@ -0,0 +1,18 @@ +package com.meishu.vo.task; + +import lombok.Data; + +/** + * @author: tuyp + * @create: 2020-07-20 09:40 + */ +@Data +public class ExerciseDoneInfoVO { + + private Integer rights; + + private Integer total; + + private String label; + +} diff --git a/src/main/java/com/meishu/vo/task/ExerciseUserInfoVO.java b/src/main/java/com/meishu/vo/task/ExerciseUserInfoVO.java new file mode 100644 index 0000000..b17f355 --- /dev/null +++ b/src/main/java/com/meishu/vo/task/ExerciseUserInfoVO.java @@ -0,0 +1,14 @@ +package com.meishu.vo.task; + + +import com.meishu.model.ExerciseDictDO; +import lombok.Data; + +@Data +public class ExerciseUserInfoVO extends ExerciseDictDO { + + private Integer collectionStatus; + + private Integer recommendStatus; + +} diff --git a/src/main/java/com/meishu/vo/task/GetClassExeDoneInfoRequestVO.java b/src/main/java/com/meishu/vo/task/GetClassExeDoneInfoRequestVO.java new file mode 100644 index 0000000..6e3d8d4 --- /dev/null +++ b/src/main/java/com/meishu/vo/task/GetClassExeDoneInfoRequestVO.java @@ -0,0 +1,27 @@ +package com.meishu.vo.task; + +import lombok.Data; + +import java.util.List; + +/** + * 获取班级某个关联习题做题情况 入参 + * @author: tuyp + * @create: 2020-07-24 10:41 + */ +@Data +public class GetClassExeDoneInfoRequestVO { + + private Integer subjectId; + + private Integer taskId; + + private String treeId; + + private Integer userId; + + private String subject; + + private List<String> userIds; + +} diff --git a/src/main/java/com/meishu/vo/task/GetClassExeDoneInfoResponseVO.java b/src/main/java/com/meishu/vo/task/GetClassExeDoneInfoResponseVO.java new file mode 100644 index 0000000..d795418 --- /dev/null +++ b/src/main/java/com/meishu/vo/task/GetClassExeDoneInfoResponseVO.java @@ -0,0 +1,37 @@ +package com.meishu.vo.task; + +import lombok.Data; + +/** + * 获取班级某个关联习题做题情况 出参 + * @author: tuyp + * @create: 2020-07-24 10:57 + */ +@Data +public class GetClassExeDoneInfoResponseVO { + + private Integer exerciseId; + + private String exerciseType; + + private String label; + + private String treeId; + + private String title; + + private String answer; + + private String rightAnswer; + + private String exeType; + + private Integer result; + + private Integer length; + + private String classResult; + + private Integer classLength; + +} diff --git a/src/main/java/com/meishu/vo/task/GetExeByIdResponseVO.java b/src/main/java/com/meishu/vo/task/GetExeByIdResponseVO.java new file mode 100644 index 0000000..8f66b04 --- /dev/null +++ b/src/main/java/com/meishu/vo/task/GetExeByIdResponseVO.java @@ -0,0 +1,36 @@ +package com.meishu.vo.task; + +import lombok.Data; + +/** + * @author: tuyp + * @create: 2020-06-17 17:33 + */ +@Data +public class GetExeByIdResponseVO { + + private Integer id; + + private Integer adviceLength; + + private String treeId; + + private String exerciseType; + + private String title; + + private String rightAnswer; + + private String detail; + + private Integer status; + + private Integer userId; + + private Integer difficulty; + + private String items; + + private Integer collectionStatus; + +} diff --git a/src/main/java/com/meishu/vo/task/GetExercisesInfoByIdsResponseVO.java b/src/main/java/com/meishu/vo/task/GetExercisesInfoByIdsResponseVO.java new file mode 100644 index 0000000..1315a9a --- /dev/null +++ b/src/main/java/com/meishu/vo/task/GetExercisesInfoByIdsResponseVO.java @@ -0,0 +1,21 @@ +package com.meishu.vo.task; + +import lombok.Data; + +/** + * @author: tuyp + * @create: 2020-07-21 16:09 + */ +@Data +public class GetExercisesInfoByIdsResponseVO { + + private Integer exeCounts; + + private String length; + + private Integer lengthSecond; + + private Integer treeId; + + private String label; +} diff --git a/src/main/java/com/meishu/vo/task/GetExpandingsPO.java b/src/main/java/com/meishu/vo/task/GetExpandingsPO.java new file mode 100644 index 0000000..921ce4b --- /dev/null +++ b/src/main/java/com/meishu/vo/task/GetExpandingsPO.java @@ -0,0 +1,12 @@ +package com.meishu.vo.task; + +import lombok.Data; + +@Data +public class GetExpandingsPO { + + private Integer id; + + private Integer userId; + +} diff --git a/src/main/java/com/meishu/vo/task/GetPreTaskContentVO.java b/src/main/java/com/meishu/vo/task/GetPreTaskContentVO.java new file mode 100644 index 0000000..c8b48c4 --- /dev/null +++ b/src/main/java/com/meishu/vo/task/GetPreTaskContentVO.java @@ -0,0 +1,32 @@ +package com.meishu.vo.task; + +import lombok.Data; + +import java.util.List; + +/** + * @author: tuyp + * @create: 2020-07-17 11:10 + */ +@Data +public class GetPreTaskContentVO { + + private List<PreVodInfoVO> preVodInfoVOS; + + private List<PreRelateExeVO> preRelateExeVOS; + + private List<PreExpandExerciseVO> preExpandExerciseVOS; + + private PreHomeWorkInfoVO preHomeWorkInfoVO; + +// private List<KnowledgeTree> knowledgeTrees; + + private String teacherName; + + private Integer taskType; + + private Integer taskId; + + private String treeName; + +} diff --git a/src/main/java/com/meishu/vo/task/GetTaskByIdVO.java b/src/main/java/com/meishu/vo/task/GetTaskByIdVO.java new file mode 100644 index 0000000..3c7af49 --- /dev/null +++ b/src/main/java/com/meishu/vo/task/GetTaskByIdVO.java @@ -0,0 +1,65 @@ +package com.meishu.vo.task; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.model.ClassSubjectTaskDO; +import com.meishu.model.SubjectTreeDO; +import lombok.Data; + +import java.util.Date; +import java.util.List; + +/** + * @author: tuyp + * @create: 2020-07-17 10:06 + */ +@Data +public class GetTaskByIdVO { + + @TableId(type = IdType.AUTO) + private Integer id; + + private Integer subjectId; + + private String treeId; + + private String treeName; + + private Integer teacherId; + + /** + * 作业类型 0:预习作业 1课后作业 + */ + private Integer taskType; + + private String subjectEn; + + private Integer classId; + + private String grade; + + private String classes; + + private String session; + + private String subjectType; + + private String className; + + private String semester; + + private Date createDate; + + private Date updateDate; + + private Date deleteDate; + + private List<String> knowledges; + + private Integer taskId; + + private List<SubjectTreeDO> subjectTreeDOS; + + private String taskDate; + +} diff --git a/src/main/java/com/meishu/vo/task/GetVodDetailResponseVO.java b/src/main/java/com/meishu/vo/task/GetVodDetailResponseVO.java new file mode 100644 index 0000000..3cad4da --- /dev/null +++ b/src/main/java/com/meishu/vo/task/GetVodDetailResponseVO.java @@ -0,0 +1,30 @@ +package com.meishu.vo.task; + +import lombok.Data; + +/** + * @author: tuyp + * @create: 2020-07-19 13:51 + */ +@Data +public class GetVodDetailResponseVO { + + private Long id; + + private String vodName; + + private String vodUrl; + + private String vodType; + + private String userName; + + private Integer treeId; + +// private String length; + + private Integer lengthSecond; + + private String collectionStatus; + +} diff --git a/src/main/java/com/meishu/vo/task/PerStuExeDoneResponseVO.java b/src/main/java/com/meishu/vo/task/PerStuExeDoneResponseVO.java new file mode 100644 index 0000000..5d864fe --- /dev/null +++ b/src/main/java/com/meishu/vo/task/PerStuExeDoneResponseVO.java @@ -0,0 +1,32 @@ +package com.meishu.vo.task; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.util.Date; + +/** + * @author: tuyp + * @create: 2020-07-23 15:43 + */ +@Data +public class PerStuExeDoneResponseVO { + + private String userId; + + private String studyCode; + + private String userName; + + private Integer rightCounts; + + private Integer totalCounts; + + private Integer length; + + @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") + private String submitDate; + + private String status; + +} diff --git a/src/main/java/com/meishu/vo/task/PerStudentExesResponseVO.java b/src/main/java/com/meishu/vo/task/PerStudentExesResponseVO.java new file mode 100644 index 0000000..99c0510 --- /dev/null +++ b/src/main/java/com/meishu/vo/task/PerStudentExesResponseVO.java @@ -0,0 +1,25 @@ +package com.meishu.vo.task; + +import lombok.Data; + +import java.math.BigDecimal; +import java.util.List; + +/** + * @author: tuyp + * @create: 2020-07-22 18:41 + */ +@Data +public class PerStudentExesResponseVO { + + private Integer submitCount; + + private Integer totalCount; + + private BigDecimal rightPercent; + + private BigDecimal avgUseTimes; + + private List<PerStuExeDoneResponseVO> perStuExeDoneResponseVOS; + +} diff --git a/src/main/java/com/meishu/vo/task/PreExpandExerciseVO.java b/src/main/java/com/meishu/vo/task/PreExpandExerciseVO.java new file mode 100644 index 0000000..814441a --- /dev/null +++ b/src/main/java/com/meishu/vo/task/PreExpandExerciseVO.java @@ -0,0 +1,24 @@ +package com.meishu.vo.task; + +import lombok.Data; + +/** + * @author: tuyp + * @create: 2020-07-18 19:49 + */ +@Data +public class PreExpandExerciseVO { + + private Integer treeId; + + private String expandExerciseNames; + + private Integer exerciseCounts; + + private Integer studentCounts; + + private String length; + + private Integer lengthSecond; + +} diff --git a/src/main/java/com/meishu/vo/task/PreHomeWorkInfoVO.java b/src/main/java/com/meishu/vo/task/PreHomeWorkInfoVO.java new file mode 100644 index 0000000..0103cab --- /dev/null +++ b/src/main/java/com/meishu/vo/task/PreHomeWorkInfoVO.java @@ -0,0 +1,27 @@ +package com.meishu.vo.task; + +import com.meishu.model.WrittenHomeworkDO; +import lombok.Data; + +import java.util.List; + +/** + * @author: tuyp + * @create: 2020-07-17 14:21 + */ +@Data +public class PreHomeWorkInfoVO { + + private String length; + + private List<WrittenHomeworkDO> writtenHomeworks; + + private Integer homeworksCounts; + + private String notice; + + private String fileName; + + private Integer lengthSecond; + +} diff --git a/src/main/java/com/meishu/vo/task/PreRelateExeVO.java b/src/main/java/com/meishu/vo/task/PreRelateExeVO.java new file mode 100644 index 0000000..5959352 --- /dev/null +++ b/src/main/java/com/meishu/vo/task/PreRelateExeVO.java @@ -0,0 +1,22 @@ +package com.meishu.vo.task; + +import lombok.Data; + +/** + * @author: tuyp + * @create: 2020-07-17 14:29 + */ +@Data +public class PreRelateExeVO { + + private Integer treeId; + + private String treeName; + + private Integer exeCounts; + + private String length; + + private Integer lengthSecond; + +} diff --git a/src/main/java/com/meishu/vo/task/PreVodInfoVO.java b/src/main/java/com/meishu/vo/task/PreVodInfoVO.java new file mode 100644 index 0000000..e69374d --- /dev/null +++ b/src/main/java/com/meishu/vo/task/PreVodInfoVO.java @@ -0,0 +1,28 @@ +package com.meishu.vo.task; + +import lombok.Data; + +/** + * @author: tuyp + * @create: 2020-07-17 11:26 + */ +@Data +public class PreVodInfoVO { + + private Long vodId; + + private String vodName; + + private String teacherName; + + private Integer treeId; + + private String length; + + private String vodType; + + private String vodUrl; + + private Integer lengthSecond; + +} diff --git a/src/main/java/com/meishu/vo/task/QueryTaskDetailResponseVO.java b/src/main/java/com/meishu/vo/task/QueryTaskDetailResponseVO.java new file mode 100644 index 0000000..8876f1d --- /dev/null +++ b/src/main/java/com/meishu/vo/task/QueryTaskDetailResponseVO.java @@ -0,0 +1,26 @@ +package com.meishu.vo.task; + +import lombok.Data; + +import java.util.List; + +/** + * @author: tuyp + * @create: 2020-06-28 10:40 + */ +@Data +public class QueryTaskDetailResponseVO { + + private Integer taskType; + + private List<String> knowledges; + + private String userName; + + private String treeName; + + private GetPreTaskContentVO getPreTaskContentVO; + + private List<ExerciseDoneInfoVO> exerciseDoneInfoVOS; + +} diff --git a/src/main/java/com/meishu/vo/task/StudentDoneInfoResponseVO.java b/src/main/java/com/meishu/vo/task/StudentDoneInfoResponseVO.java new file mode 100644 index 0000000..224232a --- /dev/null +++ b/src/main/java/com/meishu/vo/task/StudentDoneInfoResponseVO.java @@ -0,0 +1,31 @@ +package com.meishu.vo.task; + +import lombok.Data; + +import java.util.Date; +import java.util.List; + +/** + * @author: tuyp + * @create: 2020-07-23 09:23 + */ +@Data +public class StudentDoneInfoResponseVO { + + private Integer rightCounts; + + private Integer totalCounts; + + private Integer useLength; + + private String avgRightPercent; + + private Integer avgUseLength; + + private String submitTime; + + private List<GetClassExeDoneInfoResponseVO> studentDoneDetailVOS; + + + +} diff --git a/src/main/java/com/meishu/vo/task/TeacherClassVO.java b/src/main/java/com/meishu/vo/task/TeacherClassVO.java new file mode 100644 index 0000000..6607340 --- /dev/null +++ b/src/main/java/com/meishu/vo/task/TeacherClassVO.java @@ -0,0 +1,17 @@ +package com.meishu.vo.task; + +import com.meishu.vo.administer.GetClassesDetailResponseVO; +import lombok.Data; + +import java.util.List; + +@Data +public class TeacherClassVO { + + private Long subjectId; + + private String subject; + + private List<GetClassesDetailResponseVO> getClassesDetailResponseVOS; + +} diff --git a/src/main/java/com/meishu/vo/test/CommentVO.java b/src/main/java/com/meishu/vo/test/CommentVO.java new file mode 100644 index 0000000..3ed5bf8 --- /dev/null +++ b/src/main/java/com/meishu/vo/test/CommentVO.java @@ -0,0 +1,16 @@ +package com.meishu.vo.test; + +import lombok.Data; + +@Data +public class CommentVO { + + private Long id; + + private String dimension; + + private Integer star; + + private String userName; + +} diff --git a/src/main/java/com/meishu/vo/test/GetAllTestVO.java b/src/main/java/com/meishu/vo/test/GetAllTestVO.java new file mode 100644 index 0000000..d4ffc28 --- /dev/null +++ b/src/main/java/com/meishu/vo/test/GetAllTestVO.java @@ -0,0 +1,19 @@ +package com.meishu.vo.test; + +import lombok.Data; + +@Data +public class GetAllTestVO { + + private Long id; + + private Long ruleId; + + private String ruleName; + + private String testName; + + private String examination; + + private String status; +} diff --git a/src/main/java/com/meishu/vo/test/GetOnePublishVO.java b/src/main/java/com/meishu/vo/test/GetOnePublishVO.java new file mode 100644 index 0000000..ad8dd75 --- /dev/null +++ b/src/main/java/com/meishu/vo/test/GetOnePublishVO.java @@ -0,0 +1,26 @@ +package com.meishu.vo.test; + +import lombok.Data; + +import java.util.List; + +@Data +public class GetOnePublishVO { + + private Long id; + + private Long studentId; + + private Long publishId; + + private String username; + + private String answer; + + private String commentStatus; + + private Double totalStar; + + private List<CommentVO> commentVOS; + +} diff --git a/src/main/java/com/meishu/vo/test/GetPublishHistoryVO.java b/src/main/java/com/meishu/vo/test/GetPublishHistoryVO.java new file mode 100644 index 0000000..519f206 --- /dev/null +++ b/src/main/java/com/meishu/vo/test/GetPublishHistoryVO.java @@ -0,0 +1,32 @@ +package com.meishu.vo.test; + + +import com.meishu.vo.student.StudentVO; +import lombok.Data; + +import java.util.List; + +@Data +public class GetPublishHistoryVO { + + private Long id; + + private Long testId; + + private String testName; + + private String publishName; + + private String ruleName; + + private String testTime; + + private String outline; + + private String examination; + + private String coverPage; + + private List<StudentVO> studentVOS; + +} diff --git a/src/main/java/com/meishu/vo/test/GetTestReportVO.java b/src/main/java/com/meishu/vo/test/GetTestReportVO.java new file mode 100644 index 0000000..ad48a45 --- /dev/null +++ b/src/main/java/com/meishu/vo/test/GetTestReportVO.java @@ -0,0 +1,26 @@ +package com.meishu.vo.test; + +import com.meishu.vo.student.StudentVO; +import lombok.Data; + +import java.util.List; + +@Data +public class GetTestReportVO { + + private Long id; + + private String publishName; + + private String ruleName; + + private String testTime; + + private String testName; + + private Integer toCnt; + + private Integer doneCnt; + + private List<StudentVO> studentVOS; +} diff --git a/src/main/java/com/meishu/vo/userrole/QueryStudentsVO.java b/src/main/java/com/meishu/vo/userrole/QueryStudentsVO.java new file mode 100644 index 0000000..0352105 --- /dev/null +++ b/src/main/java/com/meishu/vo/userrole/QueryStudentsVO.java @@ -0,0 +1,41 @@ +package com.meishu.vo.userrole; + +import com.meishu.util.excel.ExcelColumn; +import lombok.Data; + +@Data +public class QueryStudentsVO { + + private Integer id; + + @ExcelColumn(col = 1,value = "姓名") + private String userName; + + @ExcelColumn(col = 2,value = "学号") + private String studyCode; + + @ExcelColumn(col = 3,value = "手机号") + private String phone; + + @ExcelColumn(col = 4,value = "身份证号") + private String idCard; + + @ExcelColumn(col = 5,value = "年级") + private String grade; + + @ExcelColumn(col = 6,value = "入学年份") + private String session; + + @ExcelColumn(col = 7,value = "性别") + private String gender; + + @ExcelColumn(col = 8,value = "邮箱") + private String email; + + @ExcelColumn(col = 9,value = "所在行政班级") + private String className; + + @ExcelColumn(col = 10,value = "状态") + private String userStatus; + +} diff --git a/src/main/java/com/meishu/vo/userrole/UserInfoVO.java b/src/main/java/com/meishu/vo/userrole/UserInfoVO.java new file mode 100644 index 0000000..b48e683 --- /dev/null +++ b/src/main/java/com/meishu/vo/userrole/UserInfoVO.java @@ -0,0 +1,15 @@ +package com.meishu.vo.userrole; + +import lombok.Data; + +@Data +public class UserInfoVO { + + private Integer id; + + private String userName; + + private String classes; + + private String session; +} diff --git a/src/main/java/com/meishu/vo/userrole/UserRoleVO.java b/src/main/java/com/meishu/vo/userrole/UserRoleVO.java new file mode 100644 index 0000000..2c34e45 --- /dev/null +++ b/src/main/java/com/meishu/vo/userrole/UserRoleVO.java @@ -0,0 +1,12 @@ +package com.meishu.vo.userrole; + +import lombok.Data; + +@Data +public class UserRoleVO { + + private Integer id; + + private String phone; + +} diff --git a/src/main/java/com/meishu/vo/voddict/GetCourseTreesVodsVO.java b/src/main/java/com/meishu/vo/voddict/GetCourseTreesVodsVO.java new file mode 100644 index 0000000..efbe271 --- /dev/null +++ b/src/main/java/com/meishu/vo/voddict/GetCourseTreesVodsVO.java @@ -0,0 +1,40 @@ +package com.meishu.vo.voddict; + +import lombok.Data; + +@Data +public class GetCourseTreesVodsVO { + + private Long id; + + private Long vodId; + + private String vodUrl; + + private String vodName; + + private String vodType; + + private String vodIntro; + + private String coverPage; + + private Integer playRecord; + + private Integer vodLength; + + /** + * 没用字段 + */ + private String watchStatus; + + /** + * 1:带锁 0:没有锁 + */ + private String lockStatus; + + private Long treeId; + + private Long mappingId; + +} diff --git a/src/main/java/com/meishu/vo/voddict/GetStatusVodsVO.java b/src/main/java/com/meishu/vo/voddict/GetStatusVodsVO.java new file mode 100644 index 0000000..52c4fe5 --- /dev/null +++ b/src/main/java/com/meishu/vo/voddict/GetStatusVodsVO.java @@ -0,0 +1,9 @@ +package com.meishu.vo.voddict; + +import lombok.Data; + +@Data +public class GetStatusVodsVO { + + +} diff --git a/src/main/java/com/meishu/vo/voddict/GetToCheckCountsVO.java b/src/main/java/com/meishu/vo/voddict/GetToCheckCountsVO.java new file mode 100644 index 0000000..9fd5364 --- /dev/null +++ b/src/main/java/com/meishu/vo/voddict/GetToCheckCountsVO.java @@ -0,0 +1,12 @@ +package com.meishu.vo.voddict; + +import lombok.Data; + +@Data +public class GetToCheckCountsVO { + + private Integer toCheckCounts; + + private Integer checkCounts; + +} diff --git a/src/main/java/com/meishu/vo/voddict/GetTreeVodsVO.java b/src/main/java/com/meishu/vo/voddict/GetTreeVodsVO.java new file mode 100644 index 0000000..ead95dc --- /dev/null +++ b/src/main/java/com/meishu/vo/voddict/GetTreeVodsVO.java @@ -0,0 +1,43 @@ +package com.meishu.vo.voddict; + +import com.meishu.model.SubjectTreeDO; +import lombok.Data; + +import java.util.List; + +@Data +public class GetTreeVodsVO { + + private Long id; + + private String vodName; + + private List<SubjectTreeDO> trees; + + private String vodUrl; + + private String vodType; + + private String userName; + + private String updateTime; + + private Integer playCounts; + + private String vodSize; + + private Integer vodLength; + + private String vodIntro; + + private String vodCode; + + private String shareStatus; + + private String checkStatus; + + private String coverPage; + + private String status; + +} diff --git a/src/main/java/com/meishu/vo/voddict/GetVodDetailVO.java b/src/main/java/com/meishu/vo/voddict/GetVodDetailVO.java new file mode 100644 index 0000000..3088f43 --- /dev/null +++ b/src/main/java/com/meishu/vo/voddict/GetVodDetailVO.java @@ -0,0 +1,14 @@ +package com.meishu.vo.voddict; + +import com.meishu.model.SubjectTreeDO; +import com.meishu.model.VodDictDO; +import lombok.Data; + +import java.util.List; + +@Data +public class GetVodDetailVO extends VodDictDO { + + private List<SubjectTreeDO> subjectTreeDOS; + +} diff --git a/src/main/java/com/meishu/vo/voddict/SignatureVO.java b/src/main/java/com/meishu/vo/voddict/SignatureVO.java new file mode 100644 index 0000000..4da6082 --- /dev/null +++ b/src/main/java/com/meishu/vo/voddict/SignatureVO.java @@ -0,0 +1,10 @@ +package com.meishu.vo.voddict; + +import lombok.Data; + +@Data +public class SignatureVO { + + private String sign; + +} diff --git a/src/main/java/com/meishu/vo/wechat/AccessTokenVO.java b/src/main/java/com/meishu/vo/wechat/AccessTokenVO.java new file mode 100644 index 0000000..4c93d2d --- /dev/null +++ b/src/main/java/com/meishu/vo/wechat/AccessTokenVO.java @@ -0,0 +1,16 @@ +package com.meishu.vo.wechat; + +import lombok.Data; + +/** + * Access_Token + */ +@Data +public class AccessTokenVO { + + private Integer errcode; + + private String errmsg; + + private String access_token; +} diff --git a/src/main/java/com/meishu/vo/wechat/AuthenTokenVO.java b/src/main/java/com/meishu/vo/wechat/AuthenTokenVO.java new file mode 100644 index 0000000..8d34406 --- /dev/null +++ b/src/main/java/com/meishu/vo/wechat/AuthenTokenVO.java @@ -0,0 +1,30 @@ +package com.meishu.vo.wechat; + + +import lombok.Data; + +@Data +public class AuthenTokenVO { + + private String access_token; + + private String openid; + + private String nickname; + + private String sex; + + private String province; + + private String city; + + private String country; + + private String headimgurl; + + private Object privilege; + + private String unionid; + + +} diff --git a/src/main/java/com/meishu/vo/wechat/MemberVO.java b/src/main/java/com/meishu/vo/wechat/MemberVO.java new file mode 100644 index 0000000..da1929c --- /dev/null +++ b/src/main/java/com/meishu/vo/wechat/MemberVO.java @@ -0,0 +1,23 @@ +package com.meishu.vo.wechat; + +import lombok.Data; + +/** + * Member + */ + +@Data +public class MemberVO { + + private Integer errcode; + + private String errmsg; + + private String userid; + + private String name; + + private String mobile; + + private String avatar; +} diff --git a/src/main/java/com/meishu/vo/wechat/QrConnectVO.java b/src/main/java/com/meishu/vo/wechat/QrConnectVO.java new file mode 100644 index 0000000..b1a1659 --- /dev/null +++ b/src/main/java/com/meishu/vo/wechat/QrConnectVO.java @@ -0,0 +1,17 @@ +package com.meishu.vo.wechat; + +import lombok.Data; + +@Data +public class QrConnectVO { + + private String id; + + private String appId; + + private String agentId; + + private String redirectUri; + + private String state; +} diff --git a/src/main/java/com/meishu/vo/wechat/WXUserInfoVO.java b/src/main/java/com/meishu/vo/wechat/WXUserInfoVO.java new file mode 100644 index 0000000..2a81e96 --- /dev/null +++ b/src/main/java/com/meishu/vo/wechat/WXUserInfoVO.java @@ -0,0 +1,16 @@ +package com.meishu.vo.wechat; + +import lombok.Data; + +/** + * UserInfo + */ +@Data +public class WXUserInfoVO { + + private Integer errcode; + + private String errmsg; + + private String UserId; +} \ No newline at end of file diff --git a/src/main/java/com/meishu/vo/wechat/WechatInviteVO.java b/src/main/java/com/meishu/vo/wechat/WechatInviteVO.java new file mode 100644 index 0000000..62035c2 --- /dev/null +++ b/src/main/java/com/meishu/vo/wechat/WechatInviteVO.java @@ -0,0 +1,20 @@ +package com.meishu.vo.wechat; + +import lombok.Data; + +import java.util.List; + +@Data +public class WechatInviteVO { + + private String errcode; + + private String errmsg; + + private List<String> invaliduser; + + private List<String> invalidparty; + + private List<String> invalidtag; + +} diff --git a/src/main/java/com/subsidy/MeishuApplication.java b/src/main/java/com/subsidy/MeishuApplication.java new file mode 100644 index 0000000..d863709 --- /dev/null +++ b/src/main/java/com/subsidy/MeishuApplication.java @@ -0,0 +1,39 @@ +package com.subsidy; + +import com.alibaba.druid.support.http.StatViewServlet; +import org.mybatis.spring.annotation.MapperScan; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.web.servlet.ServletRegistrationBean; +import org.springframework.context.annotation.Bean; +import org.springframework.scheduling.annotation.EnableAsync; +import org.springframework.scheduling.annotation.EnableScheduling; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@SpringBootApplication +@MapperScan(basePackages = {"com.subsidy.mapper"}) +@EnableScheduling +@EnableAsync +public class MeishuApplication { + + public static void main(String[] args) { + SpringApplication.run(MeishuApplication.class, args); + } + + @Bean + public ServletRegistrationBean druidStatViewServlet() { + //先配置管理后台的servLet,访问的入口为/druid/ + ServletRegistrationBean servletRegistrationBean = new ServletRegistrationBean( + new StatViewServlet(), "/druid/*"); + // IP白名单 (没有配置或者为空,则允许所有访问) + servletRegistrationBean.addInitParameter("allow", "127.0.0.1"); + // IP黑名单 (存在共同时,deny优先于allow) + servletRegistrationBean.addInitParameter("deny", ""); + servletRegistrationBean.addInitParameter("loginUsername", "admin"); + servletRegistrationBean.addInitParameter("loginPassword", "yhkl1234"); + servletRegistrationBean.addInitParameter("resetEnable", "false"); + return servletRegistrationBean; + } + +} diff --git a/src/main/java/com/subsidy/common/Code.java b/src/main/java/com/subsidy/common/Code.java new file mode 100644 index 0000000..91afe9e --- /dev/null +++ b/src/main/java/com/subsidy/common/Code.java @@ -0,0 +1,45 @@ +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/ResponseData.java b/src/main/java/com/subsidy/common/ResponseData.java new file mode 100644 index 0000000..fd45218 --- /dev/null +++ b/src/main/java/com/subsidy/common/ResponseData.java @@ -0,0 +1,54 @@ +package com.subsidy.common; + +import com.subsidy.common.configure.RemoteProperties; +import lombok.Data; +import org.springframework.boot.context.properties.EnableConfigurationProperties; + +/** + * 返回数据 + * + * @author DengMin + * @date 2019/08/27 13:57 + **/ +@Data +@EnableConfigurationProperties(RemoteProperties.class) +public class ResponseData { + + public static <T> ResponseVO<T> generateCreatedResponse(int code) { + return (ResponseVO<T>) ResponseVO.builder() + .code(code) + .message(RemoteProperties.getMessage(code)) + .build(); + } + + public static <T> ResponseVO<T> generateCreatedResponse(int code, String message) { + return (ResponseVO<T>) ResponseVO.builder() + .code(code) + .message(message) + .build(); + } + + public static <T> ResponseVO<T> generateCreatedResponse(int code, T data) { + return (ResponseVO<T>) ResponseVO.builder() + .code(code) + .message(RemoteProperties.getMessage(code)) + .data(data) + .build(); + } + + public static <T> ResponseVO<T> generateCreatedResponse(int code, String message, T data) { + return (ResponseVO<T>) ResponseVO.builder() + .code(code) + .message(message) + .data(data) + .build(); + } + + public static <T> ResponseVO<T> generateCreatedResponse(int code, String message, String path) { + return (ResponseVO<T>) ResponseVO.builder() + .code(code) + .message(message) + .path(path) + .build(); + } +} \ No newline at end of file diff --git a/src/main/java/com/subsidy/common/ResponseVO.java b/src/main/java/com/subsidy/common/ResponseVO.java new file mode 100644 index 0000000..afaa676 --- /dev/null +++ b/src/main/java/com/subsidy/common/ResponseVO.java @@ -0,0 +1,21 @@ +package com.subsidy.common; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class ResponseVO<T> { + + private Integer code; + + private String message; + + private T data; + + private String path; +} \ No newline at end of file diff --git a/src/main/java/com/subsidy/common/configure/AliyunSmsProperties.java b/src/main/java/com/subsidy/common/configure/AliyunSmsProperties.java new file mode 100644 index 0000000..bb827e2 --- /dev/null +++ b/src/main/java/com/subsidy/common/configure/AliyunSmsProperties.java @@ -0,0 +1,19 @@ +package com.subsidy.common.configure; + +import lombok.Data; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.stereotype.Component; + +@Data +@Component +@ConfigurationProperties(prefix = "sms") +public class AliyunSmsProperties { + + private String product; + + private String domain; + + private String accessKeyId; + + private String accessKeySecret; +} diff --git a/src/main/java/com/subsidy/common/configure/MybatisPlusConfig.java b/src/main/java/com/subsidy/common/configure/MybatisPlusConfig.java new file mode 100644 index 0000000..c02a5b2 --- /dev/null +++ b/src/main/java/com/subsidy/common/configure/MybatisPlusConfig.java @@ -0,0 +1,54 @@ +package com.subsidy.common.configure; + +import com.baomidou.mybatisplus.annotation.DbType; +import com.baomidou.mybatisplus.core.config.GlobalConfig; +import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor; +import com.subsidy.common.handler.MetaHandler; +import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * @author: tuyp + * @create: 2020-08-12 12:01 + */ +@Configuration +@ConditionalOnClass(value = {PaginationInterceptor.class}) +public class MybatisPlusConfig { + + /** + * 分页 + * @return + */ + @Bean + public PaginationInterceptor paginationInterceptor(){ + PaginationInterceptor paginationInterceptor = new PaginationInterceptor(); + paginationInterceptor.setDialectType(DbType.MYSQL.getDb()); + return paginationInterceptor; + } +// +// /** +// * 打印 sql +// */ +// @Bean +// public PerformanceInterceptor performanceInterceptor() { +// PerformanceInterceptor performanceInterceptor = new PerformanceInterceptor(); +// //格式化sql语句 +// Properties properties = new Properties(); +// properties.setProperty("format", "false"); +// performanceInterceptor.setProperties(properties); +// return performanceInterceptor; +// } + + /** + * 自动填充功能 + * @return + */ + @Bean + public GlobalConfig globalConfig() { + GlobalConfig globalConfig = new GlobalConfig(); + globalConfig.setMetaObjectHandler(new MetaHandler()); + return globalConfig; + } + +} diff --git a/src/main/java/com/subsidy/common/configure/RemoteProperties.java b/src/main/java/com/subsidy/common/configure/RemoteProperties.java new file mode 100644 index 0000000..23a42de --- /dev/null +++ b/src/main/java/com/subsidy/common/configure/RemoteProperties.java @@ -0,0 +1,36 @@ +package com.subsidy.common.configure; + +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.context.annotation.PropertySource; +import org.springframework.stereotype.Component; + +import java.util.HashMap; +import java.util.Map; + +/** + * <p> + * 读取状态码 + * </p> + * + * @author DengMin + * @date Created in 2020/08/24 + */ +@Component +@ConfigurationProperties(prefix = "meishu") +@PropertySource(value = "classpath:code.properties", encoding = "UTF-8") +public class RemoteProperties { + + private static Map<Integer, String> codeMessage = new HashMap<>(); + + public static String getMessage(Integer code) { + return codeMessage.get(code); + } + + public Map<Integer, String> getCodeMessage() { + return codeMessage; + } + + public void setCodeMessage(Map<Integer, String> codeMessage) { + RemoteProperties.codeMessage = codeMessage; + } +} \ No newline at end of file diff --git a/src/main/java/com/subsidy/common/configure/RestTemplateConfig.java b/src/main/java/com/subsidy/common/configure/RestTemplateConfig.java new file mode 100644 index 0000000..c4f692f --- /dev/null +++ b/src/main/java/com/subsidy/common/configure/RestTemplateConfig.java @@ -0,0 +1,31 @@ +package com.subsidy.common.configure; + +import org.springframework.context.annotation.Bean; +import org.springframework.http.MediaType; +import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; +import org.springframework.stereotype.Component; +import org.springframework.web.client.RestTemplate; + +import java.util.ArrayList; +import java.util.List; + +@Component +public class RestTemplateConfig { + + @Bean + public RestTemplate restTemplate() { + RestTemplate restTemplate = new RestTemplate(); + restTemplate.getMessageConverters().add(new WxMappingJackson2HttpMessageConverter()); + return restTemplate; + } + + public class WxMappingJackson2HttpMessageConverter extends MappingJackson2HttpMessageConverter { + public WxMappingJackson2HttpMessageConverter(){ + List<MediaType> mediaTypes = new ArrayList<>(); + mediaTypes.add(MediaType.TEXT_PLAIN); + mediaTypes.add(MediaType.TEXT_HTML); + setSupportedMediaTypes(mediaTypes); + } + } + +} diff --git a/src/main/java/com/subsidy/common/configure/SwaggerConfig.java b/src/main/java/com/subsidy/common/configure/SwaggerConfig.java new file mode 100644 index 0000000..01b41bd --- /dev/null +++ b/src/main/java/com/subsidy/common/configure/SwaggerConfig.java @@ -0,0 +1,31 @@ +package com.subsidy.common.configure; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import springfox.documentation.builders.ApiInfoBuilder; +import springfox.documentation.builders.PathSelectors; +import springfox.documentation.builders.RequestHandlerSelectors; +import springfox.documentation.spi.DocumentationType; +import springfox.documentation.spring.web.plugins.Docket; +import springfox.documentation.swagger2.annotations.EnableSwagger2; + +@Configuration +@EnableSwagger2 +public class SwaggerConfig { + @Bean + public Docket createRestApi() { + return new Docket(DocumentationType.SWAGGER_2) + .pathMapping("/") + .select() + .apis(RequestHandlerSelectors.basePackage("com.subsidy")) + .paths(PathSelectors.any()) + .build().apiInfo(new ApiInfoBuilder() + .title("学习壮业") + .description("接口文档规范") + .version("1.0") +// .contact(new Contact("啊啊啊啊","www.youkehulian.com","tcp@meishu.com")) +// .license("The Apache License") +// .licenseUrl("http://www.baidu.com") + .build()); + } +} diff --git a/src/main/java/com/subsidy/common/configure/VODConfig.java b/src/main/java/com/subsidy/common/configure/VODConfig.java new file mode 100644 index 0000000..699cad7 --- /dev/null +++ b/src/main/java/com/subsidy/common/configure/VODConfig.java @@ -0,0 +1,25 @@ +package com.subsidy.common.configure; + +import lombok.Data; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.stereotype.Component; + +/** + * @author: tuyp + * @create: 2020-06-01 16:46 + */ +@Component +@Data +@ConfigurationProperties(prefix = "vod") +public class VODConfig { + + private String appId; + + private String secretId; + + private String secretKey; + + private String api; + + private String region; +} diff --git a/src/main/java/com/subsidy/common/configure/WebConfig.java b/src/main/java/com/subsidy/common/configure/WebConfig.java new file mode 100644 index 0000000..dc0d39f --- /dev/null +++ b/src/main/java/com/subsidy/common/configure/WebConfig.java @@ -0,0 +1,63 @@ +package com.subsidy.common.configure; + +import com.subsidy.common.interceptor.AuthenticationInterceptor; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.servlet.config.annotation.CorsRegistry; +import org.springframework.web.servlet.config.annotation.InterceptorRegistry; +import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; + +/** + * @author DengMin + * @date 2020/07/06 + **/ +@Configuration +public class WebConfig implements WebMvcConfigurer { + + @Autowired + private AuthenticationInterceptor authenticationInterceptor; + + /** + * 跨域支持 + * + * @param registry + */ + @Override + public void addCorsMappings(CorsRegistry registry) { + registry.addMapping("/**") +// .allowCredentials(true) + .allowedOrigins("*") + .allowedMethods("GET", "HEAD", "POST", "PUT", "DELETE", "OPTIONS") + .allowedHeaders("*") + .maxAge(3600); + } + + /** + * Swagger + * + * @param registry + */ + @Override + public void addResourceHandlers(ResourceHandlerRegistry registry) { + registry.addResourceHandler("/**").addResourceLocations("classpath:/static/"); + registry.addResourceHandler("swagger-ui.html") + .addResourceLocations("classpath:/META-INF/resources/"); + registry.addResourceHandler("/webjars/**") + .addResourceLocations("classpath:/META-INF/resources/webjars/"); + } + + /** + * 鉴权 + * + * @param registry + */ + @Override + public void addInterceptors(InterceptorRegistry registry) { + registry.addInterceptor(authenticationInterceptor) + .excludePathPatterns("/static/*") + .addPathPatterns("/**"); + } + + +} \ No newline at end of file diff --git a/src/main/java/com/subsidy/common/configure/WebLogAspect.java b/src/main/java/com/subsidy/common/configure/WebLogAspect.java new file mode 100644 index 0000000..0f193cd --- /dev/null +++ b/src/main/java/com/subsidy/common/configure/WebLogAspect.java @@ -0,0 +1,58 @@ +package com.subsidy.common.configure; + +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; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.servlet.http.HttpServletRequest; +import java.util.Arrays; + +@Aspect +@Component +@Order(1) +public class WebLogAspect { + + private final Logger logger = LoggerFactory.getLogger(WebLogAspect.class); + + @Pointcut("execution(public * com.subsidy.controller.*.*(..))")//切入点描述 这个是controller包的切入点 + public void controllerLog(){}//签名,可以理解成这个切入点的一个名称 + + @Pointcut("execution(public * com.subsidy.controller.*.*(..))") + public void serviceImplLog(){} + + @Before("controllerLog()") //在切入点的方法run之前要干的 + public void logBeforeController(JoinPoint joinPoint) { + + + RequestAttributes requestAttributes = RequestContextHolder.getRequestAttributes(); + //这个RequestContextHolder是Springmvc提供来获得请求的东西 + HttpServletRequest request = ((ServletRequestAttributes)requestAttributes).getRequest(); + + // 记录下请求内容 + logger.info("####requestUrl : " + request.getRequestURL().toString()); + logger.info("####requestParam : " + Arrays.toString(joinPoint.getArgs())); + + } + +// @Around("serviceImplLog()") +// public Object afterController(ProceedingJoinPoint proceedingJoinPoint) { +// +// Object result = null; +// +// try{ +// result = proceedingJoinPoint.proceed(); +// logger.info("====reulst"+result); +// }catch (Throwable e){ +// MyException myException =(MyException)e; +// throw myException; +// } +// return result; +// } + +} \ No newline at end of file diff --git a/src/main/java/com/subsidy/common/configure/WechatConfig.java b/src/main/java/com/subsidy/common/configure/WechatConfig.java new file mode 100644 index 0000000..46e2034 --- /dev/null +++ b/src/main/java/com/subsidy/common/configure/WechatConfig.java @@ -0,0 +1,24 @@ +package com.subsidy.common.configure; + + +import lombok.Data; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.context.annotation.Configuration; + +@Data +@Configuration +@ConfigurationProperties(prefix = "wechat") +public class WechatConfig { + + private String appId; + + private String appSecret; + + private String msgUrl; + + private String templateId; + + private String agentId; + + +} diff --git a/src/main/java/com/subsidy/common/constant/AttendanceConstant.java b/src/main/java/com/subsidy/common/constant/AttendanceConstant.java new file mode 100644 index 0000000..1305fc9 --- /dev/null +++ b/src/main/java/com/subsidy/common/constant/AttendanceConstant.java @@ -0,0 +1,29 @@ +package com.subsidy.common.constant; + +public class AttendanceConstant { + + /** + * 创建预约api + */ + public static final String CREATE_TOPIC_URL = "https://open.api.roomis.com.cn/api/my/booking/spaces/{spaceId}/events"; + + /** + * 考勤api + */ + public static final String GET_ATTENDANCE_URL = "https://open.api.roomis.com.cn/api/attendance/{id}"; + + /** + * 创建人ID + */ + public static Long organizerId = 200000222L; + + /** + * 开始时间 + */ + public static String startTime = "07:00:00"; + + /** + * 结束时间 + */ + public static String endTime = "21:00:00"; +} diff --git a/src/main/java/com/subsidy/common/constant/Code.java b/src/main/java/com/subsidy/common/constant/Code.java new file mode 100644 index 0000000..d4a02f9 --- /dev/null +++ b/src/main/java/com/subsidy/common/constant/Code.java @@ -0,0 +1,33 @@ +package com.subsidy.common.constant; + +import lombok.Getter; + +@Getter +public enum Code { + + USERNAMENOTFOUND(1001, "用户不存在"), + BADCREDENTIALS(1002,"账户或者密码错误"), + ACCOUNTEXPIRED(1003,"账户过期"), + LOCKEDEXCEPTION(1004, "账户已锁定"), + DISABLEDEXCEPTION(1005,"账户已禁用"), + ACCESSDENIED(1006,"无权限访问"), + AUTHENTICATION(1007,"身份验证异常"), + NOHANDLERFOUND(1008,"找不到相应的视图处理器"), + PARAM_INVALID(1009, "参数不合法"), + TOKEN_EXCEPTION(1010, "无效的令牌"), + TOKEN_EXPIRED(1011, "令牌已过期"), + TOKEN_VERIFICATION_FAILED(1013, "令牌验证失败"), + OSS_ERROR(1012, "OSS文件上传异常"), + Network_ERROR(9000, "网络请求失败"), + SERVER_INTERNAL_ERROR(99999, "服务器内部错误"), + ; + + private Integer code; + + private String message; + + Code(Integer code, String message) { + this.code = code; + this.message = message; + } +} diff --git a/src/main/java/com/subsidy/common/constant/WxConstant.java b/src/main/java/com/subsidy/common/constant/WxConstant.java new file mode 100644 index 0000000..41ed23a --- /dev/null +++ b/src/main/java/com/subsidy/common/constant/WxConstant.java @@ -0,0 +1,35 @@ +package com.subsidy.common.constant; + +public class WxConstant { + + /** + * app id + */ + public static final String APPID = "wx75ec06e9ce50ef73"; + + /** + * 秘钥 + */ + public static final String SECRENT = "c039d32804278503474dfcf7cb3944b9"; + + /** + * 获取访问用户身份 + */ + public static final String GETUSERINFO = "https://qyapi.weixin.qq.com/cgi-bin/user/getuserinfo?access_token={access_token}&code={code}"; + + /** + * 读取成员 + */ + public static final String GET = "https://qyapi.weixin.qq.com/cgi-bin/user/get?access_token={access_token}&userid={userid}"; + + /** + * 获取access_token + */ + public static final String GET_SUITE_TOKEN = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid={appid}&secret={secret}"; + + + /** + * 扫码登陆回调地址 + */ + public static final String QR_REDIRECT_URL = "http://massadmin.youkehulian.com"; +} diff --git a/src/main/java/com/subsidy/common/exception/GlobalExceptionHandler.java b/src/main/java/com/subsidy/common/exception/GlobalExceptionHandler.java new file mode 100644 index 0000000..5f8117b --- /dev/null +++ b/src/main/java/com/subsidy/common/exception/GlobalExceptionHandler.java @@ -0,0 +1,118 @@ +package com.subsidy.common.exception; + +import com.baomidou.mybatisplus.core.toolkit.StringUtils; +import com.subsidy.common.ResponseData; +import com.subsidy.common.ResponseVO; +import com.subsidy.common.configure.RemoteProperties; +import com.subsidy.common.constant.Code; +import lombok.extern.slf4j.Slf4j; +import org.apache.poi.ss.formula.functions.T; +import org.springframework.http.converter.HttpMessageNotReadableException; +import org.springframework.validation.BindException; +import org.springframework.web.HttpRequestMethodNotSupportedException; +import org.springframework.web.bind.MethodArgumentNotValidException; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.RestControllerAdvice; +import org.springframework.web.servlet.NoHandlerFoundException; + +import javax.servlet.http.HttpServletRequest; +import java.util.ArrayList; +import java.util.List; + +/** + * 异常处理 + * @author DengMin + * @date 2020/07/14 + **/ +@Slf4j +@RestControllerAdvice +public class GlobalExceptionHandler { + + /** + * 自定义异常 + * @param e + * @return + */ + @ExceptionHandler(value = HttpException.class) + public ResponseVO<T> handlerException(HttpServletRequest request, HttpException e) { + String message = RemoteProperties.getMessage(e.getCode()); + if(StringUtils.isBlank(message)) { + message = e.getMessage(); + } + String url = request.getRequestURI(); + return ResponseData.generateCreatedResponse(e.getCode(), message, url); + } + + /** + * 404 + * @param request + * @return + */ + @ExceptionHandler(value = NoHandlerFoundException.class) + public ResponseVO<T> NoHandlerFoundException(HttpServletRequest request) { + String url = request.getRequestURI(); + return ResponseData.generateCreatedResponse(Code.NOHANDLERFOUND.getCode(), Code.NOHANDLERFOUND.getMessage(), url); + } + + /** + * 请求方式错误 + * @param request + * @return + */ + @ExceptionHandler(value = HttpRequestMethodNotSupportedException.class) + public ResponseVO<T> HttpRequestMethodNotSupportedException(HttpServletRequest request) { + String url = request.getRequestURI(); + return ResponseData.generateCreatedResponse(Code.NOHANDLERFOUND.getCode(), Code.NOHANDLERFOUND.getMessage(), url); + } + + /** + * 参数不合法 + * @param e + * @return + */ + @ExceptionHandler(MethodArgumentNotValidException.class) + public ResponseVO<T> validateException(MethodArgumentNotValidException e){ + final List<String> errList = new ArrayList<>(); + e.getBindingResult().getAllErrors().stream().forEach(x -> { + errList.add(x.getDefaultMessage()); + }); + return ResponseData.generateCreatedResponse(Code.PARAM_INVALID.getCode(), Code.PARAM_INVALID.getMessage(), errList.toString()); + } + + /** + * JSON 序列化异常 + * @param e + * @return + */ + @ExceptionHandler(HttpMessageNotReadableException.class) + public ResponseVO<T> exceptionHandler(HttpMessageNotReadableException e) { + log.error(e.getMessage()); + return ResponseData.generateCreatedResponse(Code.PARAM_INVALID.getCode(), Code.PARAM_INVALID.getMessage()+":{"+e.getMessage()+"}"); + } + + /** + * 校验异常 + * @param e + * @return + */ + @ExceptionHandler(BindException.class) + public ResponseVO<T> BindException(BindException e){ + final List<String> errList = new ArrayList<>(); + e.getBindingResult().getAllErrors().stream().forEach(x -> { + errList.add(x.getDefaultMessage()); + }); + return ResponseData.generateCreatedResponse(Code.PARAM_INVALID.getCode(), Code.PARAM_INVALID.getMessage(), errList.toString()); + } + + /** + * 服务器内部错误 + * @return + */ + @ExceptionHandler(value = Exception.class) + public ResponseVO<T> serverInternalError(Exception e, HttpServletRequest request) { + String url = request.getRequestURI(); + log.error("path:"+url); + log.error("---- error message: ---"+e.toString()); + return ResponseData.generateCreatedResponse(Code.SERVER_INTERNAL_ERROR.getCode(), Code.SERVER_INTERNAL_ERROR.getMessage(), url); + } +} \ No newline at end of file diff --git a/src/main/java/com/subsidy/common/exception/HttpException.java b/src/main/java/com/subsidy/common/exception/HttpException.java new file mode 100644 index 0000000..291188b --- /dev/null +++ b/src/main/java/com/subsidy/common/exception/HttpException.java @@ -0,0 +1,45 @@ +package com.subsidy.common.exception; + + +import com.subsidy.common.configure.RemoteProperties; + +/** + * 异常处理 + * @author DengMin + * @date 2020/08/12 + **/ +public class HttpException extends RuntimeException{ + + private Integer code; + + private String message; + + public Integer getCode() { + return code; + } + + public void setCode(Integer code) { + this.code = code; + } + + @Override + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public HttpException(Integer code) { + super(RemoteProperties.getMessage(code)); + String message = RemoteProperties.getMessage(code); + this.message = message; + this.code = code; + } + + public HttpException(Integer code, String message) { + this.message = message; + this.code = code; + } +} diff --git a/src/main/java/com/subsidy/common/handler/MetaHandler.java b/src/main/java/com/subsidy/common/handler/MetaHandler.java new file mode 100644 index 0000000..9e83fcd --- /dev/null +++ b/src/main/java/com/subsidy/common/handler/MetaHandler.java @@ -0,0 +1,26 @@ +package com.subsidy.common.handler; + +import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler; +import org.apache.ibatis.reflection.MetaObject; +import org.springframework.stereotype.Component; + +import java.time.LocalDateTime; + +/** + * 填充配置 + * @author DengMin + * @date 2020/07/21 + **/ +@Component +public class MetaHandler implements MetaObjectHandler { + + @Override + public void insertFill(MetaObject metaObject) { + this.setFieldValByName("createDate", LocalDateTime.now(), metaObject); + } + + @Override + public void updateFill(MetaObject metaObject) { + this.setFieldValByName("updateDate", LocalDateTime.now(), metaObject); + } +} diff --git a/src/main/java/com/subsidy/common/interceptor/AuthenticationInterceptor.java b/src/main/java/com/subsidy/common/interceptor/AuthenticationInterceptor.java new file mode 100644 index 0000000..94f2eeb --- /dev/null +++ b/src/main/java/com/subsidy/common/interceptor/AuthenticationInterceptor.java @@ -0,0 +1,84 @@ +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; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.lang.reflect.Method; +import java.util.Map; + +/** + * <p> + * 鉴权拦截器 + * </p> + * + * @author DengMin + * @since 2021/4/14 + */ +@Component +public class AuthenticationInterceptor implements HandlerInterceptor { + + @Autowired + private AdministerMapper administerMapper; + + @Override + public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) { + // 不需要进行拦截 + if (!(handler instanceof HandlerMethod)) { + return true; + } + + HandlerMethod handlerMethod = (HandlerMethod) handler; + Method method = handlerMethod.getMethod(); + LoginRequired methodAnnotation = method.getAnnotation(LoginRequired.class); + if (methodAnnotation != null) { + String authorization = request.getHeader("Authorization"); + if (!StringUtils.isBlank(authorization)) { + String token = authorization; + if (authorization.startsWith("Bearer")) { + token = authorization.replace("Bearer ", ""); + } + /*Token不存在*/ + if (token == null || JwtUtil.isExpired(token) || !JwtUtil.verifyToken(token)) { + throw new HttpException(1010); + } + + Map<String, Claim> claimMap = JwtUtil.getClaims(token); + if (claimMap != null) { + String[] role = methodAnnotation.value(); + 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; + } + } else { + throw new HttpException(1010); + } + } else { + AdministerDO administerDO = administerMapper.selectById(claimMap.get("id").asLong()); + if (administerDO != null) { + Localstorage.setUser(administerDO); + return true; + } + } + } + //return true; + } + throw new HttpException(1010); + } + return true; + } +} diff --git a/src/main/java/com/subsidy/common/interceptor/LoginRequired.java b/src/main/java/com/subsidy/common/interceptor/LoginRequired.java new file mode 100644 index 0000000..19e2615 --- /dev/null +++ b/src/main/java/com/subsidy/common/interceptor/LoginRequired.java @@ -0,0 +1,20 @@ +package com.subsidy.common.interceptor; + +import java.lang.annotation.*; + +/** + * <p> + * 自定义验证登陆注解 + * </p> + * + * @author DengMin + * @since 2020/12/18 + */ +@Target({ElementType.METHOD}) +@Retention(RetentionPolicy.RUNTIME) +@Documented +@Inherited +public @interface LoginRequired { + + String[] value(); +} \ No newline at end of file diff --git a/src/main/java/com/subsidy/controller/AdministerController.java b/src/main/java/com/subsidy/controller/AdministerController.java new file mode 100644 index 0000000..6725359 --- /dev/null +++ b/src/main/java/com/subsidy/controller/AdministerController.java @@ -0,0 +1,166 @@ +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.*; + +import io.swagger.annotations.Api; +import org.springframework.web.multipart.MultipartFile; + +import javax.servlet.http.HttpServletResponse; +import java.util.Arrays; +import java.util.List; + +/** + * <p> + * 管理平台用户 前端控制器 + * </p> + * + * @author DengMin + * @since 2021-10-11 + */ +@RestController +@Api(tags = "管理平台用户") +@RequestMapping("/administer") +public class AdministerController { + + @Autowired + private AdministerService administerService; + + @PostMapping("/login") + @ApiOperation("登录接口 accountName password") + public ResponseVO login(@RequestBody AdministerDO administerDO){ + return ResponseData.generateCreatedResponse(0,administerService.login(administerDO)); + } + + @PostMapping("/getPermissions") + @ApiOperation("权限查询") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO getPermissions() { + return ResponseData.generateCreatedResponse(0, administerService.getPermissions()); + } + + @PostMapping("/administers") + @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 账号 ") + public ResponseVO addAdminister(@RequestBody AdministerDO administerDO){ + return ResponseData.generateCreatedResponse(0,administerService.addAdminister(administerDO)); + } + + @PostMapping("deleteAdminister") + @ApiOperation("添加运营者 id ") + public ResponseVO deleteAdminister(@RequestBody AdministerDO administerDO){ + return ResponseData.generateCreatedResponse(0,administerService.deleteAdminister(administerDO)); + } + + @PostMapping("updateAdminister") + @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)throws Exception{ + classDetailDTO.setFlag(true); + administerService.exportClassDetail(classDetailDTO); + } + + @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)throws Exception{ + classDetailDTO.setFlag(true); + administerService.exportSignDetail(classDetailDTO); + } + + @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)throws Exception{ + classDetailDTO.setFlag(true); + administerService.exportExerciseTest(classDetailDTO); + } + + @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)throws Exception{ + classDetailDTO.setFlag(true); + administerService.exportAnswerRecord(classDetailDTO); + } + + @PostMapping("exportZip") + @ApiOperation("下载压缩包 id 班级id") + @CrossOrigin + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public void exportZip(@RequestBody ClassDetailDTO classDetailDTO)throws Exception{ + administerService.export(classDetailDTO); + } + + @PostMapping("importMember") + @ApiOperation("导入学生 {companyId 公司id file}") + public ResponseVO importMember(Long companyId,@RequestParam("file") MultipartFile file){ + return ResponseData.generateCreatedResponse(0,administerService.importMember(companyId,file)); + } + +} 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; + +/** + * <p> + * 问题答疑表 前端控制器 + * </p> + * + * @author DengMin + * @since 2021-10-14 + */ +@RestController +@Api(tags = "问题答疑表") +@RequestMapping("/answeringQuestion") +public class AnsweringQuestionController { + + @Autowired + private AnsweringQuestionService answeringQuestionService; + + @PostMapping("getCourseQuestion") + @ApiOperation("获取某个课程的答疑 {classId pageSize pageNum memberId}") + public ResponseVO getCourseQuestion(@RequestBody GetCourseQuestionDTO getCourseQuestionDTO){ + return ResponseData.generateCreatedResponse(0,answeringQuestionService.getCourseQuestion(getCourseQuestionDTO)); + } + + @PostMapping("addQuestion") + @ApiOperation("新增答疑 {classId askId title}") + public ResponseVO addQuestion(@RequestBody AnsweringQuestionDO answeringQuestionDO){ + return ResponseData.generateCreatedResponse(0,answeringQuestionService.addQuestion(answeringQuestionDO)); + } + + @PostMapping("deleteQuestion") + @ApiOperation("删除答疑 {id}") + public ResponseVO deleteQuestion(@RequestBody AnsweringQuestionDO answeringQuestionDO){ + return ResponseData.generateCreatedResponse(0,answeringQuestionService.deleteQuestion(answeringQuestionDO)); + } + + @PostMapping("updateQuestion") + @ApiOperation("编辑答疑 {id answerId answer}") + public ResponseVO updateQuestion(@RequestBody AnsweringQuestionDO answeringQuestionDO){ + return ResponseData.generateCreatedResponse(0, answeringQuestionService.updateQuestion(answeringQuestionDO)); + } + + + +} diff --git a/src/main/java/com/subsidy/controller/CategoryController.java b/src/main/java/com/subsidy/controller/CategoryController.java new file mode 100644 index 0000000..494576a --- /dev/null +++ b/src/main/java/com/subsidy/controller/CategoryController.java @@ -0,0 +1,71 @@ +package com.subsidy.controller; + + +import com.subsidy.common.ResponseData; +import com.subsidy.common.ResponseVO; +import com.subsidy.common.interceptor.LoginRequired; +import com.subsidy.dto.category.GetCategoriesDTO; +import com.subsidy.model.CategoryDO; +import com.subsidy.service.CategoryService; +import com.subsidy.util.ConstantUtils; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + * <p> + * 类目名称 前端控制器 + * </p> + * + * @author DengMin + * @since 2021-10-11 + */ +@RestController +@Api(tags = "类目") +@RequestMapping("/category") +public class CategoryController { + + @Autowired + private CategoryService categoryService; + + @PostMapping("getCategories") + @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("查询所有类目 **companyId") + public ResponseVO getAll(@RequestBody GetCategoriesDTO getCategoriesDTO){ + return ResponseData.generateCreatedResponse(0,categoryService.getAll(getCategoriesDTO)); + } + + @PostMapping("addCategory") + @ApiOperation("新增类目 **name companyId") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO addCategory(@RequestBody CategoryDO categoryDO){ + return ResponseData.generateCreatedResponse(0,categoryService.addCategory(categoryDO)); + } + + @PostMapping("deleteCategory") + @ApiOperation("删除类目 id") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO deleteCategory(@RequestBody CategoryDO categoryDO){ + return ResponseData.generateCreatedResponse(0,categoryService.deleteCategory(categoryDO)); + } + + @PostMapping("updateCategory") + @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 new file mode 100644 index 0000000..3c73ada --- /dev/null +++ b/src/main/java/com/subsidy/controller/ClassDictController.java @@ -0,0 +1,97 @@ +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.AddClassDTO; +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; +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> + * 班级id 前端控制器 + * </p> + * + * @author DengMin + * @since 2021-10-12 + */ +@RestController +@Api(tags = "班级") +@RequestMapping("/classDict") +public class ClassDictController { + + @Autowired + private ClassDictService classDictService; + + @PostMapping("getAllClasses") + @ApiOperation("获取某老师下的所有课程 ** companyId 所选企业id className 班级名称") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO getAllClasses(@RequestBody ClassDictDO classDictDO){ + return ResponseData.generateCreatedResponse(0,classDictService.getAllClasses(classDictDO)); + } + + @PostMapping("deleteClasses") + @ApiOperation("删除课程 id") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO deleteClasses(@RequestBody ClassDictDO classDictDO){ + return ResponseData.generateCreatedResponse(0,classDictService.deleteClasses(classDictDO)); + } + + @PostMapping("addClass") + @ApiOperation("添加课程 ** userId:登录人id companyId courseId className startDate endDate") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO addClass(@RequestBody AddClassDTO addClassDTO){ + return ResponseData.generateCreatedResponse(0,classDictService.addClass(addClassDTO)); + } + + @PostMapping("updateClass") + @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/ClassMemberMappingController.java b/src/main/java/com/subsidy/controller/ClassMemberMappingController.java new file mode 100644 index 0000000..ec9096f --- /dev/null +++ b/src/main/java/com/subsidy/controller/ClassMemberMappingController.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; + +/** + * <p> + * 班级成员映射表 前端控制器 + * </p> + * + * @author DengMin + * @since 2021-10-12 + */ +@RestController +@Api(tags = "班级成员映射表") +@RequestMapping("/class-member-mapping-do") +public class ClassMemberMappingController { + +} 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..49e7a97 --- /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; + +/** + * <p> + * 企业字典表 前端控制器 + * </p> + * + * @author DengMin + * @since 2021-10-25 + */ +@RestController +@Api(tags = "企业字典表") +@RequestMapping("/companyDict") +public class CompanyDictController { + + @Autowired + private CompanyDictService companyDictService; + + @PostMapping("/administers") + @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:普通成员}") + @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 new file mode 100644 index 0000000..6fc1c10 --- /dev/null +++ b/src/main/java/com/subsidy/controller/CourseContentController.java @@ -0,0 +1,65 @@ +package com.subsidy.controller; + + +import com.subsidy.common.ResponseData; +import com.subsidy.common.ResponseVO; +import com.subsidy.common.interceptor.LoginRequired; +import com.subsidy.model.CourseContentDO; +import com.subsidy.model.VodDictDO; +import com.subsidy.service.CourseContentService; +import com.subsidy.util.ConstantUtils; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + * <p> + * 课程目录表 前端控制器 + * </p> + * + * @author DengMin + * @since 2021-10-11 + */ +@RestController +@Api(tags = "课程目录表") +@RequestMapping("/courseContent") +public class CourseContentController { + + @Autowired + private CourseContentService courseContentService; + + @PostMapping("getContents") + @ApiOperation("获取课程目录 {courseId}") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO getContents(@RequestBody CourseContentDO courseContentDO){ + 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 new file mode 100644 index 0000000..570cd58 --- /dev/null +++ b/src/main/java/com/subsidy/controller/CourseDictController.java @@ -0,0 +1,68 @@ +package com.subsidy.controller; + + +import com.subsidy.common.ResponseData; +import com.subsidy.common.ResponseVO; +import com.subsidy.common.interceptor.LoginRequired; +import com.subsidy.dto.course.QueryCoursesDTO; +import com.subsidy.model.CourseDictDO; +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.*; + +import io.swagger.annotations.Api; + +/** + * <p> + * 前端控制器 + * </p> + * + * @author DengMin + * @since 2021-10-11 + */ +@RestController +@Api(tags = "课程表") +@RequestMapping("/courseDict") +public class CourseDictController { + + @Autowired + private CourseDictService courseDictService; + + @PostMapping("addCourse") + @ApiOperation("添加课程 **companyId courseName categoryId courseType courseSource") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO addCourse(@RequestBody CourseDictDO courseDictDO){ + return ResponseData.generateCreatedResponse(0,courseDictService.addCourse(courseDictDO)); + } + + @PostMapping("deleteCourse") + @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") + //@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO queryCourses(@RequestBody QueryCoursesDTO queryCoursesDTO){ + return ResponseData.generateCreatedResponse(0,courseDictService.queryCourses(queryCoursesDTO)); + } + + @PostMapping("updateCourses") + @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 new file mode 100644 index 0000000..3958245 --- /dev/null +++ b/src/main/java/com/subsidy/controller/DepartmentDictController.java @@ -0,0 +1,65 @@ +package com.subsidy.controller; + + +import com.subsidy.common.ResponseData; +import com.subsidy.common.ResponseVO; +import com.subsidy.common.interceptor.LoginRequired; +import com.subsidy.model.DepartmentDictDO; +import com.subsidy.service.DepartmentDictService; +import com.subsidy.util.ConstantUtils; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + * <p> + * 部门字典表 前端控制器 + * </p> + * + * @author DengMin + * @since 2021-10-11 + */ +@RestController +@Api(tags = "部门字典表") +@RequestMapping("/departmentDict") +public class DepartmentDictController { + + @Autowired + private DepartmentDictService departmentDictService; + + @PostMapping("getDepartments") + @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 parentId 父节点") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO addDepartment(@RequestBody DepartmentDictDO departmentDictDO){ + return ResponseData.generateCreatedResponse(0,departmentDictService.addDepartment(departmentDictDO)); + } + + @PostMapping("deleteDepartment") + @ApiOperation("删除部门 id") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO deleteDepartment(@RequestBody DepartmentDictDO departmentDictDO){ + return ResponseData.generateCreatedResponse(0,departmentDictService.deleteDepartment(departmentDictDO)); + } + + @PostMapping("updateDepartment") + @ApiOperation("编辑部门 id ** companyId departmentName leaderName parentId") + @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 new file mode 100644 index 0000000..192755e --- /dev/null +++ b/src/main/java/com/subsidy/controller/ExerciseDictController.java @@ -0,0 +1,76 @@ +package com.subsidy.controller; + + +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.*; + +import io.swagger.annotations.Api; + +/** + * <p> + * 习题库 前端控制器 + * </p> + * + * @author DengMin + * @since 2021-10-12 + */ +@RestController +@Api(tags = "习题库") +@RequestMapping("/exerciseDict") +public class ExerciseDictController { + + @Autowired + private ExerciseDictService exerciseDictService; + + @PostMapping("getAllExercises") + @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 正确答案 }") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO addExercise(@RequestBody ExerciseDictDO exerciseDictDO){ + return ResponseData.generateCreatedResponse(0,exerciseDictService.addExercise(exerciseDictDO)); + } + + @PostMapping("deleteExercise") + @ApiOperation("删除题目 id") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO deleteExercise(@RequestBody ExerciseDictDO exerciseDictDO){ + return ResponseData.generateCreatedResponse(0,exerciseDictService.deleteExercise(exerciseDictDO)); + } + + @PostMapping("updateExercise") + @ApiOperation("修改题目 id exerciseType 题目类型 difficulty 难度 title题目 items 选项 rightAnswer 正确答案") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + 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; + +/** + * <p> + * 学生课程习题完成情况 前端控制器 + * </p> + * + * @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 new file mode 100644 index 0000000..61f84ba --- /dev/null +++ b/src/main/java/com/subsidy/controller/FileDictController.java @@ -0,0 +1,64 @@ +package com.subsidy.controller; + + +import com.subsidy.common.ResponseData; +import com.subsidy.common.ResponseVO; +import com.subsidy.common.interceptor.LoginRequired; +import com.subsidy.model.FileDictDO; +import com.subsidy.model.VodDictDO; +import com.subsidy.service.FileDictService; +import com.subsidy.util.ConstantUtils; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + * <p> + * 课件表 前端控制器 + * </p> + * + * @author DengMin + * @since 2021-10-11 + */ +@RestController +@Api(tags = "课件表") +@RequestMapping("/fileDict") +public class FileDictController { + + @Autowired + private FileDictService fileDictService; + + @PostMapping("getContendFiles") + @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 ") + @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") + @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") + @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 new file mode 100644 index 0000000..1a3d061 --- /dev/null +++ b/src/main/java/com/subsidy/controller/MemberController.java @@ -0,0 +1,124 @@ +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.AddMemberDTO; +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; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + * <p> + * 学生表 前端控制器 + * </p> + * + * @author DengMin + * @since 2021-10-11 + */ +@RestController +@Api(tags = "学生表") +@RequestMapping("/member") +public class MemberController { + + @Autowired + private MemberService memberService; + + @PostMapping("getAll") + @ApiOperation("查询某部门成员 pageNum pageSize departmentId userName status") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO getAll(@RequestBody GetAllDTO getAllDTO){ + return ResponseData.generateCreatedResponse(0,memberService.getAll(getAllDTO)); + } + + @PostMapping("deleteMember") + @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") + @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}) + public ResponseVO updateMember(@RequestBody AddMemberDTO addMemberDTO){ + return ResponseData.generateCreatedResponse(0,memberService.updateMember(addMemberDTO)); + } + + @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 成员id courseId 课程id classId}") + 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/MemberDepartmentMappingController.java b/src/main/java/com/subsidy/controller/MemberDepartmentMappingController.java new file mode 100644 index 0000000..640c491 --- /dev/null +++ b/src/main/java/com/subsidy/controller/MemberDepartmentMappingController.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; + +/** + * <p> + * 老师部门映射表 前端控制器 + * </p> + * + * @author DengMin + * @since 2021-11-01 + */ +@RestController +@Api(tags = "老师部门映射表") +@RequestMapping("/member-department-mapping-do") +public class MemberDepartmentMappingController { + +} diff --git a/src/main/java/com/subsidy/controller/PermissionsDictController.java b/src/main/java/com/subsidy/controller/PermissionsDictController.java new file mode 100644 index 0000000..c257813 --- /dev/null +++ b/src/main/java/com/subsidy/controller/PermissionsDictController.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; + +/** + * <p> + * 权限表 前端控制器 + * </p> + * + * @author DengMin + * @since 2021-10-11 + */ +@RestController +@Api(tags = "权限表") +@RequestMapping("/permissions-dict-do") +public class PermissionsDictController { + +} diff --git a/src/main/java/com/subsidy/controller/RoleAdministerMappingController.java b/src/main/java/com/subsidy/controller/RoleAdministerMappingController.java new file mode 100644 index 0000000..bfc1119 --- /dev/null +++ b/src/main/java/com/subsidy/controller/RoleAdministerMappingController.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; + +/** + * <p> + * 前端控制器 + * </p> + * + * @author DengMin + * @since 2021-10-11 + */ +@RestController +@Api(tags = "") +@RequestMapping("/role-administer-mapping-do") +public class RoleAdministerMappingController { + +} diff --git a/src/main/java/com/subsidy/controller/RoleDictController.java b/src/main/java/com/subsidy/controller/RoleDictController.java new file mode 100644 index 0000000..76b225c --- /dev/null +++ b/src/main/java/com/subsidy/controller/RoleDictController.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; + +/** + * <p> + * 角色表 前端控制器 + * </p> + * + * @author DengMin + * @since 2021-10-11 + */ +@RestController +@Api(tags = "角色表") +@RequestMapping("/role-dict-do") +public class RoleDictController { + +} diff --git a/src/main/java/com/subsidy/controller/RolePermissionMappingController.java b/src/main/java/com/subsidy/controller/RolePermissionMappingController.java new file mode 100644 index 0000000..a17f192 --- /dev/null +++ b/src/main/java/com/subsidy/controller/RolePermissionMappingController.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; + +/** + * <p> + * 系统用户角色表 前端控制器 + * </p> + * + * @author DengMin + * @since 2021-10-11 + */ +@RestController +@Api(tags = "系统用户角色表") +@RequestMapping("/role-permission-mapping-do") +public class RolePermissionMappingController { + +} 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..d2036b5 --- /dev/null +++ b/src/main/java/com/subsidy/controller/SignInRecordController.java @@ -0,0 +1,64 @@ +package com.subsidy.controller; + + +import com.subsidy.common.ResponseData; +import com.subsidy.common.ResponseVO; +import com.subsidy.common.interceptor.LoginRequired; +import com.subsidy.dto.member.GetMemberSignInfoDTO; +import com.subsidy.dto.sign.ClassSignInfoDTO; +import com.subsidy.dto.sign.SignInDTO; +import com.subsidy.model.MemberDO; +import com.subsidy.model.SignInRecordDO; +import com.subsidy.service.SignInRecordService; +import com.subsidy.util.ConstantUtils; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + * <p> + * 学生签到表 前端控制器 + * </p> + * + * @author DengMin + * @since 2021-10-18 + */ +@RestController +@Api(tags = "学生签到表") +@RequestMapping("/signIn") +public class SignInRecordController { + + @Autowired + private SignInRecordService signInRecordService; + + @PostMapping("getMemberSignInfo") + @ApiOperation("获取某个成员的签到记录 id 成员id pageSize pageNum") + public ResponseVO getMemberSignInfo(@RequestBody GetMemberSignInfoDTO getMemberSignInfoDTO){ + return ResponseData.generateCreatedResponse(0,signInRecordService.getMemberSignInfo(getMemberSignInfoDTO)); + } + + @PostMapping("signIn") + @ApiOperation("签到 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)); + } + + @PostMapping("signInStatus") + @ApiOperation("判断学生当天有没有打卡 {memberId 学生id}") + public ResponseVO signInStatus(@RequestBody SignInRecordDO signInRecordDO){ + return ResponseData.generateCreatedResponse(0,signInRecordService.signInStatus(signInRecordDO)); + } + +} 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; + +/** + * <p> + * 短信验证码记录表 前端控制器 + * </p> + * + * @author DengMin + * @since 2021-10-14 + */ +@RestController +@Api(tags = "短信验证码记录表") +@RequestMapping("/smsVerify") +public class SmsVerifyCodeController { + + @Autowired + private SmsVerifyCodeService smsVerifyCodeService; + + @PostMapping(value = "/send") + @ApiOperation("发送短信验证码 {telephone} ") + public ResponseVO sendVerifyCode(@RequestBody SendVerifyCodeDTO sendVerifyCodeDTO ) { + smsVerifyCodeService.sendVerifyCode(sendVerifyCodeDTO); + return ResponseData.generateCreatedResponse(0); + } + +} + diff --git a/src/main/java/com/subsidy/controller/VodDictController.java b/src/main/java/com/subsidy/controller/VodDictController.java new file mode 100644 index 0000000..f797c41 --- /dev/null +++ b/src/main/java/com/subsidy/controller/VodDictController.java @@ -0,0 +1,71 @@ +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; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + * <p> + * 视频表 前端控制器 + * </p> + * + * @author DengMin + * @since 2021-10-11 + */ +@RestController +@Api(tags = "视频表") +@RequestMapping("/vodDict") +public class VodDictController { + + @Autowired + private VodDictService vodDictService; + + @PostMapping("/signature") + @ApiOperation("获取签名") + public ResponseVO signature()throws Exception{ + return ResponseData.generateCreatedResponse(0,vodDictService.signature()); + } + + @PostMapping("getContendVods") + @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 ") + @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") + @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") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO updateVod(@RequestBody VodDictDO vodDictDO){ + return ResponseData.generateCreatedResponse(0,vodDictService.updateVod(vodDictDO)); + } + + +} 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; + +/** + * <p> + * 视频播放历史记录表 前端控制器 + * </p> + * + * @author DengMin + * @since 2021-10-14 + */ +@RestController +@Api(tags = "视频播放历史记录表") +@RequestMapping("/vodPlayHistory") +public class VodPlayHistoryController { + + @Autowired + private VodPlayHistoryService vodPlayHistoryService; + + @PostMapping("insertHistory") + @ApiOperation("记录学生看视频位置 classId班级id vodId 视频id memberId 成员id playLength 播放时长 playRecord 位点") + public ResponseVO insertHistory(@RequestBody VodPlayHistoryDO vodPlayHistoryDO){ + return ResponseData.generateCreatedResponse(0,vodPlayHistoryService.insertHistory(vodPlayHistoryDO)); + } + + +} 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..4615d99 --- /dev/null +++ b/src/main/java/com/subsidy/dto/administer/ClassDetailDTO.java @@ -0,0 +1,18 @@ +package com.subsidy.dto.administer; + +import lombok.Data; + +@Data +public class ClassDetailDTO { + + private Long id; + + private Integer pageSize; + + private Integer pageNum; + + private String userName; + + Boolean flag; + +} diff --git a/src/main/java/com/subsidy/dto/administer/OperatorsDTO.java b/src/main/java/com/subsidy/dto/administer/OperatorsDTO.java new file mode 100644 index 0000000..4e3ecbc --- /dev/null +++ b/src/main/java/com/subsidy/dto/administer/OperatorsDTO.java @@ -0,0 +1,20 @@ +package com.subsidy.dto.administer; + +import lombok.Data; + +@Data +public class OperatorsDTO { + + private Integer pageSize; + + private Integer pageNum; + + private Integer role; + + private String companyName; + + private String userName; + + private Integer id; + +} 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 new file mode 100644 index 0000000..f7fee2e --- /dev/null +++ b/src/main/java/com/subsidy/dto/category/GetCategoriesDTO.java @@ -0,0 +1,16 @@ +package com.subsidy.dto.category; + +import lombok.Data; + +@Data +public class GetCategoriesDTO { + + private Integer pageSize; + + private Integer pageNum; + + private String name; + + private Long companyId; + +} diff --git a/src/main/java/com/subsidy/dto/classDict/AddClassDTO.java b/src/main/java/com/subsidy/dto/classDict/AddClassDTO.java new file mode 100644 index 0000000..4736d2c --- /dev/null +++ b/src/main/java/com/subsidy/dto/classDict/AddClassDTO.java @@ -0,0 +1,11 @@ +package com.subsidy.dto.classDict; + +import com.subsidy.model.ClassDictDO; +import lombok.Data; + +@Data +public class AddClassDTO extends ClassDictDO { + + private Long userId; + +} 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<Long> 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<Long> 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 new file mode 100644 index 0000000..4e424a0 --- /dev/null +++ b/src/main/java/com/subsidy/dto/course/QueryCoursesDTO.java @@ -0,0 +1,28 @@ +package com.subsidy.dto.course; + +import lombok.Data; + +import java.util.List; + +@Data +public class QueryCoursesDTO { + + private Integer pageSize; + + private Integer pageNum; + + private String courseName; + + private Long categoryId; + + private String courseType; + + private String courseSource; + + private Long administerId; + + private Long companyId; + + private List<Long> teacherIds; + +} diff --git a/src/main/java/com/subsidy/dto/department/GetDepartmentsVO.java b/src/main/java/com/subsidy/dto/department/GetDepartmentsVO.java new file mode 100644 index 0000000..5e92e23 --- /dev/null +++ b/src/main/java/com/subsidy/dto/department/GetDepartmentsVO.java @@ -0,0 +1,24 @@ +package com.subsidy.dto.department; + +import lombok.Data; + +import java.util.List; + +@Data +public class GetDepartmentsVO { + + private Long id; + + private String departmentName; + + private String leaderName; + + private Integer cnt; + + private Long parentId; + + private List<GetDepartmentsVO> children; + + private String parentDepartmentName; + +} diff --git a/src/main/java/com/subsidy/dto/exercise/GetAllExercisesDTO.java b/src/main/java/com/subsidy/dto/exercise/GetAllExercisesDTO.java new file mode 100644 index 0000000..7ad85bb --- /dev/null +++ b/src/main/java/com/subsidy/dto/exercise/GetAllExercisesDTO.java @@ -0,0 +1,15 @@ +package com.subsidy.dto.exercise; + +import com.subsidy.model.ExerciseDictDO; +import lombok.Data; + +@Data +public class GetAllExercisesDTO extends ExerciseDictDO { + + private Integer pageSize; + + 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<MemberExerciseVO> memberExerciseVOS; + + private Long memberId; + + private Long courseId; + + private Long classId; +} diff --git a/src/main/java/com/subsidy/dto/member/AddMemberDTO.java b/src/main/java/com/subsidy/dto/member/AddMemberDTO.java new file mode 100644 index 0000000..8511410 --- /dev/null +++ b/src/main/java/com/subsidy/dto/member/AddMemberDTO.java @@ -0,0 +1,14 @@ +package com.subsidy.dto.member; + +import com.subsidy.model.DepartmentDictDO; +import com.subsidy.model.MemberDO; +import lombok.Data; + +import java.util.List; + +@Data +public class AddMemberDTO extends MemberDO { + + private List<Long> departmentIds; + +} 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..452b39b --- /dev/null +++ b/src/main/java/com/subsidy/dto/member/ContentMemberDTO.java @@ -0,0 +1,14 @@ +package com.subsidy.dto.member; + +import lombok.Data; + +@Data +public class ContentMemberDTO { + + private Integer memberId; + + private Integer courseId; + + private Integer classId; + +} diff --git a/src/main/java/com/subsidy/dto/member/GetAllDTO.java b/src/main/java/com/subsidy/dto/member/GetAllDTO.java new file mode 100644 index 0000000..8dae9dd --- /dev/null +++ b/src/main/java/com/subsidy/dto/member/GetAllDTO.java @@ -0,0 +1,13 @@ +package com.subsidy.dto.member; + +import com.subsidy.model.MemberDO; +import lombok.Data; + +@Data +public class GetAllDTO extends MemberDO { + + private Integer pageNum; + + private Integer pageSize; + +} 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/ImportMemberDTO.java b/src/main/java/com/subsidy/dto/member/ImportMemberDTO.java new file mode 100644 index 0000000..4ba1069 --- /dev/null +++ b/src/main/java/com/subsidy/dto/member/ImportMemberDTO.java @@ -0,0 +1,28 @@ +package com.subsidy.dto.member; + +import com.subsidy.util.excel.ExcelColumn; +import com.subsidy.util.excel.ExcelColumnUtil; +import lombok.Data; + +@Data +public class ImportMemberDTO { + + + @ExcelColumnUtil(value = "姓名", col = 1) + private String userName; + + @ExcelColumnUtil(value = "性别", col = 2) + private String gender; + + @ExcelColumnUtil(value = "账号", col = 3) + private String accountName; + + @ExcelColumnUtil(value = "手机", col = 4) + private String telephone; + + @ExcelColumnUtil(value = "身份证号", col = 5) + private String idCard; + + + +} 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..57f6571 --- /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 companyId; + +} 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 new file mode 100644 index 0000000..313c9c5 --- /dev/null +++ b/src/main/java/com/subsidy/mapper/AdministerMapper.java @@ -0,0 +1,51 @@ +package com.subsidy.mapper; + +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; + +/** + * <p> + * 管理平台用户 Mapper 接口 + * </p> + * + * @author DengMin + * @since 2021-10-11 + */ +@Repository +public interface AdministerMapper extends BaseMapper<AdministerDO> { + + List<PermissionsVO> getPermissions(Long id); + + /** + * 获取班级成员详情---班级成员 + */ + IPage<ClassDetailVO> classMembers(IPage iPage,Long classId,String userName); + + /** + * 获取班级成员---注册签到 + */ + IPage<ClassSignVO> classSign(IPage iPage,Long classId,String userName); + + /** + * 获取班级成员---测试成绩 + */ + IPage<ExerciseTestVO> exerciseTest(IPage iPage, Long classId, String userName); + + /** + * 获取班级成员---答疑记录 + */ + IPage<AnswerRecordVO> answerRecord(IPage iPage, Long classId, String userName); + + +} 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; + +/** + * <p> + * 问题答疑表 Mapper 接口 + * </p> + * + * @author DengMin + * @since 2021-10-14 + */ +@Repository +public interface AnsweringQuestionMapper extends BaseMapper<AnsweringQuestionDO> { + + /** + * 获取某个课程的答疑 + */ + IPage<GetCourseQuestionVO> getCourseQuestion(IPage page, Long classId,Long memberId); +} diff --git a/src/main/java/com/subsidy/mapper/CategoryMapper.java b/src/main/java/com/subsidy/mapper/CategoryMapper.java new file mode 100644 index 0000000..8835bd5 --- /dev/null +++ b/src/main/java/com/subsidy/mapper/CategoryMapper.java @@ -0,0 +1,18 @@ +package com.subsidy.mapper; + +import com.subsidy.model.CategoryDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + * <p> + * 类目名称 Mapper 接口 + * </p> + * + * @author DengMin + * @since 2021-10-11 + */ + @Repository +public interface CategoryMapper extends BaseMapper<CategoryDO> { + +} diff --git a/src/main/java/com/subsidy/mapper/ClassDictMapper.java b/src/main/java/com/subsidy/mapper/ClassDictMapper.java new file mode 100644 index 0000000..bf30e6f --- /dev/null +++ b/src/main/java/com/subsidy/mapper/ClassDictMapper.java @@ -0,0 +1,42 @@ +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; + +import java.util.List; + +/** + * <p> + * 班级id Mapper 接口 + * </p> + * + * @author DengMin + * @since 2021-10-12 + */ +@Repository +public interface ClassDictMapper extends BaseMapper<ClassDictDO> { + + /** + * 获取某企业的全部班级 + */ + List<GetAllClassesVO> getAllClasses(ClassDictDO classDictDO); + + /** + * 获取某班级下的全部视频 + */ + List<VodDictDO> getClassVods(Long classId); + + /** + * 查看某企业里,不在某班级的成员 + * @return + */ + List<MemberDO> getSpareMembers(GetSpareMembersDTO getSpareMembersDTO); + + +} diff --git a/src/main/java/com/subsidy/mapper/ClassMemberMappingMapper.java b/src/main/java/com/subsidy/mapper/ClassMemberMappingMapper.java new file mode 100644 index 0000000..c979186 --- /dev/null +++ b/src/main/java/com/subsidy/mapper/ClassMemberMappingMapper.java @@ -0,0 +1,28 @@ +package com.subsidy.mapper; + +import com.subsidy.dto.classDict.GetSpareMembersDTO; +import com.subsidy.model.ClassDictDO; +import com.subsidy.model.ClassMemberMappingDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.subsidy.model.MemberDO; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * <p> + * 班级成员映射表 Mapper 接口 + * </p> + * + * @author DengMin + * @since 2021-10-12 + */ +@Repository +public interface ClassMemberMappingMapper extends BaseMapper<ClassMemberMappingDO> { + + /** + * 获取学生当前有效班级 + */ + List<ClassDictDO> getMemberClass(Long memberId); + +} 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..fea1d20 --- /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; + +/** + * <p> + * 企业字典表 Mapper 接口 + * </p> + * + * @author DengMin + * @since 2021-10-25 + */ +@Repository +public interface CompanyDictMapper extends BaseMapper<CompanyDictDO> { + + /** + * 查找运营者 + * + * @return + */ + IPage<OperatorsVO> operators(IPage page, String companyName,Integer id, 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 new file mode 100644 index 0000000..c16dd53 --- /dev/null +++ b/src/main/java/com/subsidy/mapper/CourseContentMapper.java @@ -0,0 +1,27 @@ +package com.subsidy.mapper; + +import com.subsidy.model.CourseContentDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.subsidy.model.CourseDictDO; +import com.subsidy.model.VodDictDO; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * <p> + * 课程目录表 Mapper 接口 + * </p> + * + * @author DengMin + * @since 2021-10-11 + */ +@Repository +public interface CourseContentMapper extends BaseMapper<CourseContentDO> { + + /** + * 查看课程下有多少个视频 + */ + List<VodDictDO> getCourseVods(Integer courseId); + +} diff --git a/src/main/java/com/subsidy/mapper/CourseDictMapper.java b/src/main/java/com/subsidy/mapper/CourseDictMapper.java new file mode 100644 index 0000000..0aa8478 --- /dev/null +++ b/src/main/java/com/subsidy/mapper/CourseDictMapper.java @@ -0,0 +1,48 @@ +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; + +/** + * <p> + * Mapper 接口 + * </p> + * + * @author DengMin + * @since 2021-10-11 + */ +@Repository +public interface CourseDictMapper extends BaseMapper<CourseDictDO> { + + /** + * 查询全部课程 + * @return + */ + IPage<QueryCoursesVO > queryCourses(IPage page, String courseName, Long categoryId, String courseType, String courseSource,Long companyId); + + /** + * 通过课程id查询课程下的学生-----弃用 + */ + List<ClassMemberMappingDO > queryCourseMember(StudyPageVO studyPageVO); + + /** + * 查询全部公共课程 + * @return + */ + IPage<QueryCoursesVO > queryPublicCourses(IPage page, String courseName, Long categoryId, String courseType, String courseSource); + + /** + * 查询企业内部课程 + */ + IPage<QueryCoursesVO> queryCompanyCourse(IPage page, String courseName, Long categoryId, String courseType, String courseSource,Long companyId); + +} diff --git a/src/main/java/com/subsidy/mapper/DepartmentDictMapper.java b/src/main/java/com/subsidy/mapper/DepartmentDictMapper.java new file mode 100644 index 0000000..0d71522 --- /dev/null +++ b/src/main/java/com/subsidy/mapper/DepartmentDictMapper.java @@ -0,0 +1,24 @@ +package com.subsidy.mapper; + +import com.subsidy.dto.department.GetDepartmentsVO; +import com.subsidy.model.DepartmentDictDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * <p> + * 部门字典表 Mapper 接口 + * </p> + * + * @author DengMin + * @since 2021-10-11 + */ +@Repository +public interface DepartmentDictMapper extends BaseMapper<DepartmentDictDO> { + + //List<GetDepartmentsVO> getDepartments(DepartmentDictDO departmentDictDO); + + +} diff --git a/src/main/java/com/subsidy/mapper/ExerciseDictMapper.java b/src/main/java/com/subsidy/mapper/ExerciseDictMapper.java new file mode 100644 index 0000000..8fa63fa --- /dev/null +++ b/src/main/java/com/subsidy/mapper/ExerciseDictMapper.java @@ -0,0 +1,18 @@ +package com.subsidy.mapper; + +import com.subsidy.model.ExerciseDictDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + * <p> + * 习题库 Mapper 接口 + * </p> + * + * @author DengMin + * @since 2021-10-12 + */ + @Repository +public interface ExerciseDictMapper extends BaseMapper<ExerciseDictDO> { + +} 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; + +/** + * <p> + * 学生课程习题完成情况 Mapper 接口 + * </p> + * + * @author DengMin + * @since 2021-10-15 + */ + @Repository +public interface ExerciseDoneResultMapper extends BaseMapper<ExerciseDoneResultDO> { + +} diff --git a/src/main/java/com/subsidy/mapper/FileDictMapper.java b/src/main/java/com/subsidy/mapper/FileDictMapper.java new file mode 100644 index 0000000..4ee1912 --- /dev/null +++ b/src/main/java/com/subsidy/mapper/FileDictMapper.java @@ -0,0 +1,18 @@ +package com.subsidy.mapper; + +import com.subsidy.model.FileDictDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + * <p> + * 课件表 Mapper 接口 + * </p> + * + * @author DengMin + * @since 2021-10-11 + */ + @Repository +public interface FileDictMapper extends BaseMapper<FileDictDO> { + +} diff --git a/src/main/java/com/subsidy/mapper/MemberDepartmentMappingMapper.java b/src/main/java/com/subsidy/mapper/MemberDepartmentMappingMapper.java new file mode 100644 index 0000000..0dc8413 --- /dev/null +++ b/src/main/java/com/subsidy/mapper/MemberDepartmentMappingMapper.java @@ -0,0 +1,18 @@ +package com.subsidy.mapper; + +import com.subsidy.model.MemberDepartmentMappingDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + * <p> + * 老师部门映射表 Mapper 接口 + * </p> + * + * @author DengMin + * @since 2021-11-01 + */ + @Repository +public interface MemberDepartmentMappingMapper extends BaseMapper<MemberDepartmentMappingDO> { + +} diff --git a/src/main/java/com/subsidy/mapper/MemberMapper.java b/src/main/java/com/subsidy/mapper/MemberMapper.java new file mode 100644 index 0000000..ffc118b --- /dev/null +++ b/src/main/java/com/subsidy/mapper/MemberMapper.java @@ -0,0 +1,40 @@ +package com.subsidy.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.subsidy.model.DepartmentDictDO; +import com.subsidy.model.MemberDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.subsidy.vo.member.GetAllVO; +import com.subsidy.vo.member.StudyPageVO; +import io.swagger.models.auth.In; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * <p> + * 学生表 Mapper 接口 + * </p> + * + * @author DengMin + * @since 2021-10-11 + */ +@Repository +public interface MemberMapper extends BaseMapper<MemberDO> { + + /** + * 查看学生的课程 + */ + List<StudyPageVO> studyPage(MemberDO memberDO); + + /** + * 查询学生所在部门 + */ + List<DepartmentDictDO> getDepartments(Long memberId); + + /** + * 查询部门所有的学生 + */ + IPage<GetAllVO > getMembers(IPage iPage,Long departmentId,String userName,String status); + +} diff --git a/src/main/java/com/subsidy/mapper/PermissionsDictMapper.java b/src/main/java/com/subsidy/mapper/PermissionsDictMapper.java new file mode 100644 index 0000000..2febf3c --- /dev/null +++ b/src/main/java/com/subsidy/mapper/PermissionsDictMapper.java @@ -0,0 +1,18 @@ +package com.subsidy.mapper; + +import com.subsidy.model.PermissionsDictDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + * <p> + * 权限表 Mapper 接口 + * </p> + * + * @author DengMin + * @since 2021-10-11 + */ + @Repository +public interface PermissionsDictMapper extends BaseMapper<PermissionsDictDO> { + +} diff --git a/src/main/java/com/subsidy/mapper/RoleAdministerMappingMapper.java b/src/main/java/com/subsidy/mapper/RoleAdministerMappingMapper.java new file mode 100644 index 0000000..f1c3259 --- /dev/null +++ b/src/main/java/com/subsidy/mapper/RoleAdministerMappingMapper.java @@ -0,0 +1,18 @@ +package com.subsidy.mapper; + +import com.subsidy.model.RoleAdministerMappingDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + * <p> + * Mapper 接口 + * </p> + * + * @author DengMin + * @since 2021-10-11 + */ + @Repository +public interface RoleAdministerMappingMapper extends BaseMapper<RoleAdministerMappingDO> { + +} diff --git a/src/main/java/com/subsidy/mapper/RoleDictMapper.java b/src/main/java/com/subsidy/mapper/RoleDictMapper.java new file mode 100644 index 0000000..931c13e --- /dev/null +++ b/src/main/java/com/subsidy/mapper/RoleDictMapper.java @@ -0,0 +1,18 @@ +package com.subsidy.mapper; + +import com.subsidy.model.RoleDictDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + * <p> + * 角色表 Mapper 接口 + * </p> + * + * @author DengMin + * @since 2021-10-11 + */ + @Repository +public interface RoleDictMapper extends BaseMapper<RoleDictDO> { + +} diff --git a/src/main/java/com/subsidy/mapper/RolePermissionMappingMapper.java b/src/main/java/com/subsidy/mapper/RolePermissionMappingMapper.java new file mode 100644 index 0000000..c39ed50 --- /dev/null +++ b/src/main/java/com/subsidy/mapper/RolePermissionMappingMapper.java @@ -0,0 +1,18 @@ +package com.subsidy.mapper; + +import com.subsidy.model.RolePermissionMappingDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + * <p> + * 系统用户角色表 Mapper 接口 + * </p> + * + * @author DengMin + * @since 2021-10-11 + */ + @Repository +public interface RolePermissionMappingMapper extends BaseMapper<RolePermissionMappingDO> { + +} 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..2e96e16 --- /dev/null +++ b/src/main/java/com/subsidy/mapper/SignInRecordMapper.java @@ -0,0 +1,28 @@ +package com.subsidy.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.subsidy.dto.sign.ClassSignInfoDTO; +import com.subsidy.model.SignInRecordDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.subsidy.vo.sign.ClassSignInfoVO; +import org.springframework.stereotype.Repository; + +/** + * <p> + * 学生签到表 Mapper 接口 + * </p> + * + * @author DengMin + * @since 2021-10-18 + */ + @Repository +public interface SignInRecordMapper extends BaseMapper<SignInRecordDO> { + + /** + * 公司学习记录 + */ + + IPage<ClassSignInfoVO> classSignInfo(IPage iPage,String className,String courseName,Integer id); + + +} 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; + +/** + * <p> + * 短信验证码记录表 Mapper 接口 + * </p> + * + * @author DengMin + * @since 2021-10-14 + */ + @Repository +public interface SmsVerifyCodeMapper extends BaseMapper<SmsVerifyCodeDO> { + +} diff --git a/src/main/java/com/subsidy/mapper/VodDictMapper.java b/src/main/java/com/subsidy/mapper/VodDictMapper.java new file mode 100644 index 0000000..71dd0e3 --- /dev/null +++ b/src/main/java/com/subsidy/mapper/VodDictMapper.java @@ -0,0 +1,30 @@ +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; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * <p> + * 视频表 Mapper 接口 + * </p> + * + * @author DengMin + * @since 2021-10-11 + */ +@Repository +public interface VodDictMapper extends BaseMapper<VodDictDO> { + + /** + * 查看某个目录下的视频 + * @param page + * @param vodName + * @param contentId + * @return + */ + IPage<GetContendVodsVO> 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; + +/** + * <p> + * 视频播放历史记录表 Mapper 接口 + * </p> + * + * @author DengMin + * @since 2021-10-14 + */ +@Repository +public interface VodPlayHistoryMapper extends BaseMapper<VodPlayHistoryDO> { + + /** + * 查看某成员的学习历史 + */ + IPage<StudyHistoryVO> 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 new file mode 100644 index 0000000..d76b33c --- /dev/null +++ b/src/main/java/com/subsidy/model/AdministerDO.java @@ -0,0 +1,77 @@ +package com.subsidy.model; + +import com.subsidy.util.BaseModel; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * <p> + * 管理平台用户 + * </p> + * + * @author DengMin + * @since 2021-10-11 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("administer") +public class AdministerDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 公司名称 + */ + private Long companyId; + + /** + * 账号 + */ + private String accountName; + + /** + * 手机号/企业账号 + */ + private String telephone; + + /** + * 密码 + */ + private String password; + + /** + * 成员名称 + */ + private String userName; + + /** + * 头像 + */ + private String img; + + /** + * 1:启用 0:禁用 + */ + private String status; + + ///** + // * 0:运营者账号 1:企业账号 + // */ + //private String accountType; + + /** + * role 0:平台运营者 1:超级管理员 2:普通成员 + */ + 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; + +/** + * <p> + * 问题答疑表 + * </p> + * + * @author DengMin + * @since 2021-10-14 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("answering_question") +public class AnsweringQuestionDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 班级id + */ + private Long classId; + + /** + * 提问id + */ + private Long askId; + + /** + * 回答人id + */ + private Long answerId; + + /** + * 问题 + */ + private String title; + + /** + * 答案 + */ + private String answer; + + +} diff --git a/src/main/java/com/subsidy/model/CategoryDO.java b/src/main/java/com/subsidy/model/CategoryDO.java new file mode 100644 index 0000000..c82ebcb --- /dev/null +++ b/src/main/java/com/subsidy/model/CategoryDO.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; + +/** + * <p> + * 类目名称 + * </p> + * + * @author DengMin + * @since 2021-10-11 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("category") +public class CategoryDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + 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 new file mode 100644 index 0000000..ec59e43 --- /dev/null +++ b/src/main/java/com/subsidy/model/ClassDictDO.java @@ -0,0 +1,56 @@ +package com.subsidy.model; + +import com.subsidy.util.BaseModel; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; + +import java.time.LocalDateTime; + +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * <p> + * 班级id + * </p> + * + * @author DengMin + * @since 2021-10-12 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("class_dict") +public class ClassDictDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 老师id + */ + private Long companyId; + + /** + * 班级名称 + */ + private String className; + + /** + * 班级类型 + */ + private String classType; + + /** + * 课程id + */ + private Long courseId; + + private String startDate; + + private String endDate; + + +} diff --git a/src/main/java/com/subsidy/model/ClassMemberMappingDO.java b/src/main/java/com/subsidy/model/ClassMemberMappingDO.java new file mode 100644 index 0000000..614000d --- /dev/null +++ b/src/main/java/com/subsidy/model/ClassMemberMappingDO.java @@ -0,0 +1,39 @@ +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; +import lombok.EqualsAndHashCode; + +/** + * <p> + * 班级成员映射表 + * </p> + * + * @author DengMin + * @since 2021-10-12 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("class_member_mapping") +public class ClassMemberMappingDO 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; + + +} 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; + +/** + * <p> + * 企业字典表 + * </p> + * + * @author DengMin + * @since 2021-10-25 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("company_dict") +public class CompanyDictDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 企业logo + */ + private String logo; + + /** + * 公司名称 + */ + private String companyName; + + /** + * 简称 + */ + private String shortName; + + /** + * 标语 + */ + private String banner; + + /** + * 领域 + */ + private String field; + + + +} diff --git a/src/main/java/com/subsidy/model/CourseContentDO.java b/src/main/java/com/subsidy/model/CourseContentDO.java new file mode 100644 index 0000000..f1e64a7 --- /dev/null +++ b/src/main/java/com/subsidy/model/CourseContentDO.java @@ -0,0 +1,41 @@ +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; +import lombok.EqualsAndHashCode; + +/** + * <p> + * 课程目录表 + * </p> + * + * @author DengMin + * @since 2021-10-11 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("course_content") +public class CourseContentDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + private Long courseId; + + /** + * 目录 + */ + private String content; + + /** + * 排序 + */ + private Integer orderNo; + + +} diff --git a/src/main/java/com/subsidy/model/CourseDictDO.java b/src/main/java/com/subsidy/model/CourseDictDO.java new file mode 100644 index 0000000..a79f975 --- /dev/null +++ b/src/main/java/com/subsidy/model/CourseDictDO.java @@ -0,0 +1,61 @@ +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; + +import java.time.LocalDateTime; +import java.util.Date; + +/** + * <p> + * + * </p> + * + * @author DengMin + * @since 2021-10-11 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("course_dict") +public class CourseDictDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * + */ + private Long companyId; + + /** + * 课程名称 + */ + private String courseName; + + /** + * 类目id + */ + private Long categoryId; + + /** + * 课程类型 + */ + private String courseType; + + /** + * 课程来源 + */ + 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 new file mode 100644 index 0000000..f2215ed --- /dev/null +++ b/src/main/java/com/subsidy/model/DepartmentDictDO.java @@ -0,0 +1,60 @@ +package com.subsidy.model; + +import com.subsidy.dto.department.GetDepartmentsVO; +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; + +import java.util.List; + +/** + * <p> + * 部门字典表 + * </p> + * + * @author DengMin + * @since 2021-10-11 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("department_dict") +public class DepartmentDictDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 企业id + */ + private Long companyId; + + /** + * 部门名称 + */ + private String departmentName; + + /** + * 部门负责人id + */ + private String leaderName; + + /** + * 父节点id + */ + private Long parentId; + + /** + * 为写程序方便,数据库里为null + */ + private List<GetDepartmentsVO> children; + + +} diff --git a/src/main/java/com/subsidy/model/ExerciseDictDO.java b/src/main/java/com/subsidy/model/ExerciseDictDO.java new file mode 100644 index 0000000..05347d8 --- /dev/null +++ b/src/main/java/com/subsidy/model/ExerciseDictDO.java @@ -0,0 +1,69 @@ +package com.subsidy.model; + +import com.subsidy.util.BaseModel; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * <p> + * 习题库 + * </p> + * + * @author DengMin + * @since 2021-10-12 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("exercise_dict") +public class ExerciseDictDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 题目类型:单选/多选/是非 + */ + private String exerciseType; + + /** + * 课程id + */ + private Long courseId; + + /** + * 难度:容易/适中/困难 + */ + private String difficulty; + + /** + * 题目 + */ + private String title; + + /** + * 选项 + */ + private String items; + + /** + * 正确答案 + */ + private String rightAnswer; + + /** + * 解析 + */ + private String detail; + + /** + * 排序 + */ + private Integer orderNo; + + +} 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; + +/** + * <p> + * 学生课程习题完成情况 + * </p> + * + * @author DengMin + * @since 2021-10-15 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("exercise_done_result") +public class ExerciseDoneResultDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 成员id + */ + private Long memberId; + + /** + * 班级id + */ + private Long classId; + + /** + * 课程id + */ + private Long courseId; + + /** + * 正确个数 + */ + private Integer rightCounts; + + /** + * 总共个数 + */ + private Integer totalCounts; + + +} diff --git a/src/main/java/com/subsidy/model/FileDictDO.java b/src/main/java/com/subsidy/model/FileDictDO.java new file mode 100644 index 0000000..7143b28 --- /dev/null +++ b/src/main/java/com/subsidy/model/FileDictDO.java @@ -0,0 +1,53 @@ +package com.subsidy.model; + +import com.subsidy.util.BaseModel; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * <p> + * 课件表 + * </p> + * + * @author DengMin + * @since 2021-10-11 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("file_dict") +public class FileDictDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 目录id + */ + private Long contentId; + + /** + * 文件名称 + */ + private String fileName; + + /** + * 文件大小 + */ + private String fileSize; + + private String fileType; + + private String fileUrl; + + /** + * 排序 + */ + private Integer orderNo; + + +} diff --git a/src/main/java/com/subsidy/model/MemberDO.java b/src/main/java/com/subsidy/model/MemberDO.java new file mode 100644 index 0000000..6212c79 --- /dev/null +++ b/src/main/java/com/subsidy/model/MemberDO.java @@ -0,0 +1,74 @@ +package com.subsidy.model; + +import com.subsidy.util.BaseModel; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * <p> + * 学生表 + * </p> + * + * @author DengMin + * @since 2021-10-11 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("member") +public class MemberDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 部门id + */ + private Long departmentId; + + /** + * 账号 + */ + private String accountName; + + /** + * 姓名 + */ + private String userName; + + /** + * 手机号 + */ + private String telephone; + + /** + * 密码 + */ + private String password; + + /** + * 性别 + */ + private String gender; + + /** + * 头像 + */ + private String image; + + /** + * 身份证号 + */ + private String idCard; + + /** + * 状态 + */ + private String status; + + +} diff --git a/src/main/java/com/subsidy/model/MemberDepartmentMappingDO.java b/src/main/java/com/subsidy/model/MemberDepartmentMappingDO.java new file mode 100644 index 0000000..9d74c5f --- /dev/null +++ b/src/main/java/com/subsidy/model/MemberDepartmentMappingDO.java @@ -0,0 +1,46 @@ +package com.subsidy.model; + +import com.subsidy.util.BaseModel; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import java.time.LocalDateTime; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * <p> + * 老师部门映射表 + * </p> + * + * @author DengMin + * @since 2021-11-01 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("member_department_mapping") +public class MemberDepartmentMappingDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 老师id + */ + private Long memberId; + + /** + * 部门id + */ + private Long departmentId; + + private LocalDateTime createTime; + + private LocalDateTime updateTime; + + private LocalDateTime deleteTime; + + +} diff --git a/src/main/java/com/subsidy/model/PermissionsDictDO.java b/src/main/java/com/subsidy/model/PermissionsDictDO.java new file mode 100644 index 0000000..7bcbbd3 --- /dev/null +++ b/src/main/java/com/subsidy/model/PermissionsDictDO.java @@ -0,0 +1,41 @@ +package com.subsidy.model; + +import com.subsidy.util.BaseModel; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * <p> + * 权限表 + * </p> + * + * @author DengMin + * @since 2021-10-11 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("permissions_dict") +public class PermissionsDictDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 父级ID + */ + private Long parentId; + + /** + * 名称 + */ + private String name; + + private String children; + + +} diff --git a/src/main/java/com/subsidy/model/RoleAdministerMappingDO.java b/src/main/java/com/subsidy/model/RoleAdministerMappingDO.java new file mode 100644 index 0000000..34e957b --- /dev/null +++ b/src/main/java/com/subsidy/model/RoleAdministerMappingDO.java @@ -0,0 +1,33 @@ +package com.subsidy.model; + +import com.subsidy.util.BaseModel; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * <p> + * + * </p> + * + * @author DengMin + * @since 2021-10-11 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("role_administer_mapping") +public class RoleAdministerMappingDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + private Long administerId; + + private Long roleId; + + +} diff --git a/src/main/java/com/subsidy/model/RoleDictDO.java b/src/main/java/com/subsidy/model/RoleDictDO.java new file mode 100644 index 0000000..6246c5d --- /dev/null +++ b/src/main/java/com/subsidy/model/RoleDictDO.java @@ -0,0 +1,34 @@ +package com.subsidy.model; + +import com.subsidy.util.BaseModel; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * <p> + * 角色表 + * </p> + * + * @author DengMin + * @since 2021-10-11 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("role_dict") +public class RoleDictDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 角色 + */ + private String role; + + +} diff --git a/src/main/java/com/subsidy/model/RolePermissionMappingDO.java b/src/main/java/com/subsidy/model/RolePermissionMappingDO.java new file mode 100644 index 0000000..24d494a --- /dev/null +++ b/src/main/java/com/subsidy/model/RolePermissionMappingDO.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; + +/** + * <p> + * 系统用户角色表 + * </p> + * + * @author DengMin + * @since 2021-10-11 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("role_permission_mapping") +public class RolePermissionMappingDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 权限ID + */ + private Long roleId; + + /** + * 角色ID + */ + private Long permissionId; + + +} 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..ce9fd79 --- /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; + +/** + * <p> + * 学生签到表 + * </p> + * + * @author DengMin + * @since 2021-10-18 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("sign_in_record") +public class SignInRecordDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 学生id + */ + private Long memberId; + + /** + * 班级id + */ + private Long 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; + +/** + * <p> + * 短信验证码记录表 + * </p> + * + * @author DengMin + * @since 2021-10-14 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("sms_verify_code") +public class SmsVerifyCodeDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + /** + * 手机号 + */ + private String telephone; + + /** + * 验证码 + */ + private String verifyCode; + + +} diff --git a/src/main/java/com/subsidy/model/VodDictDO.java b/src/main/java/com/subsidy/model/VodDictDO.java new file mode 100644 index 0000000..3661321 --- /dev/null +++ b/src/main/java/com/subsidy/model/VodDictDO.java @@ -0,0 +1,73 @@ +package com.subsidy.model; + +import com.subsidy.util.BaseModel; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * <p> + * 视频表 + * </p> + * + * @author DengMin + * @since 2021-10-11 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("vod_dict") +public class VodDictDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 目录id + */ + private Long contentId; + + /** + * 视频名称 + */ + private String vodName; + + /** + * 视频时长 + */ + private Integer vodLength; + + /** + * 视频格式 + */ + private String vodType; + + /** + * 视频大小 + */ + private String vodSize; + + /** + * 视频地址 + */ + private String vodUrl; + + /** + * 视频编码 + */ + 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; + +/** + * <p> + * 视频播放历史记录表 + * </p> + * + * @author DengMin + * @since 2021-10-14 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("vod_play_history") +public class VodPlayHistoryDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 班级id + */ + private Long classId; + + /** + * 视频id + */ + private Long vodId; + + /** + * 学生id + */ + private Long memberId; + + /** + * 观看时长 + */ + private Integer playLength; + + /** + * 播放视频位置 + */ + private Integer playRecord; + + +} diff --git a/src/main/java/com/subsidy/service/AdministerService.java b/src/main/java/com/subsidy/service/AdministerService.java new file mode 100644 index 0000000..ead20d2 --- /dev/null +++ b/src/main/java/com/subsidy/service/AdministerService.java @@ -0,0 +1,63 @@ +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.model.ClassDictDO; +import com.subsidy.model.MemberDO; +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.springframework.web.multipart.MultipartFile; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; + +/** + * <p> + * 管理平台用户 服务类 + * </p> + * + * @author DengMin + * @since 2021-10-11 + */ +public interface AdministerService extends IService<AdministerDO> { + + LoginVO login(AdministerDO administerDO); + + AdministerPermissionVO getPermissions(); + + IPage<OperatorsVO> operators(OperatorsDTO operatorsDTO); + + String addAdminister(AdministerDO administerDO); + + String deleteAdminister(AdministerDO administerDO); + + String updateAdminister(AdministerDO administerDO); + + ClassSummaryVO classSummary(ClassDetailDTO classDetailDTO); + + IPage classDetail(ClassDetailDTO classDetailDTO); + + List<ClassDetailVO> exportClassDetail(ClassDetailDTO classDetailDTO)throws Exception; + + IPage signDetail(ClassDetailDTO classDetailDTO); + + List<ClassSignVO> exportSignDetail(ClassDetailDTO classDetailDTO)throws Exception; + + IPage exerciseTest(ClassDetailDTO classDetailDTO); + + List<ExerciseTestVO> exportExerciseTest(ClassDetailDTO classDetailDTO)throws Exception; + + IPage answerRecord(ClassDetailDTO classDetailDTO); + + List<AnswerRecordVO> exportAnswerRecord(ClassDetailDTO classDetailDTO)throws Exception; + + void export(ClassDetailDTO classDetailDTO)throws Exception; + + String importMember(Long companyId, MultipartFile multipartFile); + +} 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; + +/** + * <p> + * 问题答疑表 服务类 + * </p> + * + * @author DengMin + * @since 2021-10-14 + */ +public interface AnsweringQuestionService extends IService<AnsweringQuestionDO> { + + IPage getCourseQuestion(GetCourseQuestionDTO getCourseQuestionDTO); + + String addQuestion(AnsweringQuestionDO answeringQuestionDO); + + String deleteQuestion(AnsweringQuestionDO answeringQuestionDO); + + String updateQuestion(AnsweringQuestionDO answeringQuestionDO); +} diff --git a/src/main/java/com/subsidy/service/CategoryService.java b/src/main/java/com/subsidy/service/CategoryService.java new file mode 100644 index 0000000..8647c82 --- /dev/null +++ b/src/main/java/com/subsidy/service/CategoryService.java @@ -0,0 +1,29 @@ +package com.subsidy.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.subsidy.dto.category.GetCategoriesDTO; +import com.subsidy.model.CategoryDO; +import com.baomidou.mybatisplus.extension.service.IService; + +import java.util.List; + +/** + * <p> + * 类目名称 服务类 + * </p> + * + * @author DengMin + * @since 2021-10-11 + */ +public interface CategoryService extends IService<CategoryDO> { + + IPage<CategoryDO> getCategories(GetCategoriesDTO getCategoriesDTO); + + List<CategoryDO> getAll(GetCategoriesDTO getCategoriesDTO); + + String addCategory(CategoryDO categoryDO); + + String deleteCategory(CategoryDO categoryDO); + + String updateCategory(CategoryDO categoryDO); +} diff --git a/src/main/java/com/subsidy/service/ClassDictService.java b/src/main/java/com/subsidy/service/ClassDictService.java new file mode 100644 index 0000000..6b3e03e --- /dev/null +++ b/src/main/java/com/subsidy/service/ClassDictService.java @@ -0,0 +1,41 @@ +package com.subsidy.service; + +import com.subsidy.dto.classDict.AddClassDTO; +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; + +/** + * <p> + * 班级id 服务类 + * </p> + * + * @author DengMin + * @since 2021-10-12 + */ +public interface ClassDictService extends IService<ClassDictDO> { + + List<GetAllClassesVO> getAllClasses(ClassDictDO classDictDO); + + String deleteClasses(ClassDictDO classDictDO); + + String addClass(AddClassDTO addClassDTO); + + String updateClass(ClassDictDO classDictDO); + + ClassDictDO classDetail(ClassDictDO classDictDO); + + String removeMember(ClassMemberMappingDO classMemberMappingDO); + + List<MemberDO> getSpareMembers(GetSpareMembersDTO getSpareMembersDTO); + + String addMemberToClass(AddMemberToClassDTO addMemberToClassDTO); + +} diff --git a/src/main/java/com/subsidy/service/ClassMemberMappingService.java b/src/main/java/com/subsidy/service/ClassMemberMappingService.java new file mode 100644 index 0000000..e5e7430 --- /dev/null +++ b/src/main/java/com/subsidy/service/ClassMemberMappingService.java @@ -0,0 +1,16 @@ +package com.subsidy.service; + +import com.subsidy.model.ClassMemberMappingDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * <p> + * 班级成员映射表 服务类 + * </p> + * + * @author DengMin + * @since 2021-10-12 + */ +public interface ClassMemberMappingService extends IService<ClassMemberMappingDO> { + +} 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; + +/** + * <p> + * 企业字典表 服务类 + * </p> + * + * @author DengMin + * @since 2021-10-25 + */ +public interface CompanyDictService extends IService<CompanyDictDO> { + + IPage<OperatorsVO> operators(OperatorsDTO operatorsDTO); + + String addOperator(AddCompanyDTO addCompanyDTO); + + String deleteAdminister(CompanyDictDO companyDictDO); + + String updateAdminister(AddCompanyDTO addCompanyDTO); + +} diff --git a/src/main/java/com/subsidy/service/CourseContentService.java b/src/main/java/com/subsidy/service/CourseContentService.java new file mode 100644 index 0000000..128b5c8 --- /dev/null +++ b/src/main/java/com/subsidy/service/CourseContentService.java @@ -0,0 +1,29 @@ +package com.subsidy.service; + +import com.subsidy.controller.CourseDictController; +import com.subsidy.model.CourseContentDO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.subsidy.model.CourseDictDO; +import com.subsidy.model.VodDictDO; +import com.subsidy.vo.vod.GetContendVodsVO; + +import java.util.List; + +/** + * <p> + * 课程目录表 服务类 + * </p> + * + * @author DengMin + * @since 2021-10-11 + */ +public interface CourseContentService extends IService<CourseContentDO> { + + List<CourseContentDO> 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 new file mode 100644 index 0000000..59f9db7 --- /dev/null +++ b/src/main/java/com/subsidy/service/CourseDictService.java @@ -0,0 +1,27 @@ +package com.subsidy.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.subsidy.dto.course.QueryCoursesDTO; +import com.subsidy.model.CourseDictDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * <p> + * 服务类 + * </p> + * + * @author DengMin + * @since 2021-10-11 + */ +public interface CourseDictService extends IService<CourseDictDO> { + + String addCourse(CourseDictDO courseDictDO); + + String deleteCourse(CourseDictDO courseDictDO); + + IPage queryCourses(QueryCoursesDTO queryCoursesDTO); + + String updateCourses(CourseDictDO courseDictDO); + + IPage queryCompanyCourse(QueryCoursesDTO queryCoursesDTO); +} diff --git a/src/main/java/com/subsidy/service/DepartmentDictService.java b/src/main/java/com/subsidy/service/DepartmentDictService.java new file mode 100644 index 0000000..be78168 --- /dev/null +++ b/src/main/java/com/subsidy/service/DepartmentDictService.java @@ -0,0 +1,26 @@ +package com.subsidy.service; + +import com.subsidy.dto.department.GetDepartmentsVO; +import com.subsidy.model.DepartmentDictDO; +import com.baomidou.mybatisplus.extension.service.IService; + +import java.util.List; + +/** + * <p> + * 部门字典表 服务类 + * </p> + * + * @author DengMin + * @since 2021-10-11 + */ +public interface DepartmentDictService extends IService<DepartmentDictDO> { + + List<GetDepartmentsVO> getDepartments(DepartmentDictDO departmentDictDO); + + String addDepartment(DepartmentDictDO departmentDictDO); + + String deleteDepartment(DepartmentDictDO departmentDictDO); + + String updateDepartment(DepartmentDictDO departmentDictDO); +} diff --git a/src/main/java/com/subsidy/service/ExerciseDictService.java b/src/main/java/com/subsidy/service/ExerciseDictService.java new file mode 100644 index 0000000..8f9782d --- /dev/null +++ b/src/main/java/com/subsidy/service/ExerciseDictService.java @@ -0,0 +1,35 @@ +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; + +/** + * <p> + * 习题库 服务类 + * </p> + * + * @author DengMin + * @since 2021-10-12 + */ +public interface ExerciseDictService extends IService<ExerciseDictDO> { + + IPage<ExerciseDictDO> getAllExercises(GetAllExercisesDTO getAllExercisesDTO); + + String addExercise(ExerciseDictDO exerciseDictDO); + + String deleteExercise(ExerciseDictDO exerciseDictDO); + + String updateExercise(ExerciseDictDO exerciseDictDO); + + List<ExerciseVO> 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; + +/** + * <p> + * 学生课程习题完成情况 服务类 + * </p> + * + * @author DengMin + * @since 2021-10-15 + */ +public interface ExerciseDoneResultService extends IService<ExerciseDoneResultDO> { + +} diff --git a/src/main/java/com/subsidy/service/FileDictService.java b/src/main/java/com/subsidy/service/FileDictService.java new file mode 100644 index 0000000..29a8f71 --- /dev/null +++ b/src/main/java/com/subsidy/service/FileDictService.java @@ -0,0 +1,26 @@ +package com.subsidy.service; + +import com.subsidy.model.FileDictDO; +import com.baomidou.mybatisplus.extension.service.IService; + +import java.util.List; + +/** + * <p> + * 课件表 服务类 + * </p> + * + * @author DengMin + * @since 2021-10-11 + */ +public interface FileDictService extends IService<FileDictDO> { + + List<FileDictDO> getContendFiles(FileDictDO fileDictDO); + + String deleteFile(FileDictDO fileDictDO); + + String addFile(FileDictDO fileDictDO); + + String updateFile(FileDictDO fileDictDO); + +} diff --git a/src/main/java/com/subsidy/service/MemberDepartmentMappingService.java b/src/main/java/com/subsidy/service/MemberDepartmentMappingService.java new file mode 100644 index 0000000..ebe5990 --- /dev/null +++ b/src/main/java/com/subsidy/service/MemberDepartmentMappingService.java @@ -0,0 +1,16 @@ +package com.subsidy.service; + +import com.subsidy.model.MemberDepartmentMappingDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * <p> + * 老师部门映射表 服务类 + * </p> + * + * @author DengMin + * @since 2021-11-01 + */ +public interface MemberDepartmentMappingService extends IService<MemberDepartmentMappingDO> { + +} diff --git a/src/main/java/com/subsidy/service/MemberService.java b/src/main/java/com/subsidy/service/MemberService.java new file mode 100644 index 0000000..d501328 --- /dev/null +++ b/src/main/java/com/subsidy/service/MemberService.java @@ -0,0 +1,53 @@ +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.model.MemberDO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.subsidy.vo.administer.UserRoleVO; +import com.subsidy.vo.member.*; + +import java.util.List; + +/** + * <p> + * 学生表 服务类 + * </p> + * + * @author DengMin + * @since 2021-10-11 + */ +public interface MemberService extends IService<MemberDO> { + + IPage<GetAllVO> getAll(GetAllDTO getAllDTO); + + String deleteMember(MemberDO memberDO); + + String addMember(AddMemberDTO addMemberDTO); + + String updateMember(AddMemberDTO addMemberDTO); + + UserRoleVO login(VerifyCodeDTO verifyCodeDTO); + + UserRoleVO passwordLogin(MemberDO memberDO); + + String updatePassword(MemberDO memberDO); + + MemberStudyPageVO studyPage(MemberDO memberDO); + + ContentVodNewVO contentVod(ContentMemberDTO contentVodDTO); + + List<ContentFilesVO> contentFiles(ContentMemberDTO contentMemberDTO); + + IPage studyHistory(StudyHistoryDTO studyHistoryDTO); + + GetCourseTestVO getCourseTest(ContentMemberDTO contentMemberDTO); + + GetStudyInfoVO getStudyInfo(MemberDO memberDO); + + +} diff --git a/src/main/java/com/subsidy/service/PermissionsDictService.java b/src/main/java/com/subsidy/service/PermissionsDictService.java new file mode 100644 index 0000000..5599332 --- /dev/null +++ b/src/main/java/com/subsidy/service/PermissionsDictService.java @@ -0,0 +1,16 @@ +package com.subsidy.service; + +import com.subsidy.model.PermissionsDictDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * <p> + * 权限表 服务类 + * </p> + * + * @author DengMin + * @since 2021-10-11 + */ +public interface PermissionsDictService extends IService<PermissionsDictDO> { + +} diff --git a/src/main/java/com/subsidy/service/RoleAdministerMappingService.java b/src/main/java/com/subsidy/service/RoleAdministerMappingService.java new file mode 100644 index 0000000..22089da --- /dev/null +++ b/src/main/java/com/subsidy/service/RoleAdministerMappingService.java @@ -0,0 +1,16 @@ +package com.subsidy.service; + +import com.subsidy.model.RoleAdministerMappingDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * <p> + * 服务类 + * </p> + * + * @author DengMin + * @since 2021-10-11 + */ +public interface RoleAdministerMappingService extends IService<RoleAdministerMappingDO> { + +} diff --git a/src/main/java/com/subsidy/service/RoleDictService.java b/src/main/java/com/subsidy/service/RoleDictService.java new file mode 100644 index 0000000..757a2d8 --- /dev/null +++ b/src/main/java/com/subsidy/service/RoleDictService.java @@ -0,0 +1,16 @@ +package com.subsidy.service; + +import com.subsidy.model.RoleDictDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * <p> + * 角色表 服务类 + * </p> + * + * @author DengMin + * @since 2021-10-11 + */ +public interface RoleDictService extends IService<RoleDictDO> { + +} diff --git a/src/main/java/com/subsidy/service/RolePermissionMappingService.java b/src/main/java/com/subsidy/service/RolePermissionMappingService.java new file mode 100644 index 0000000..dfedd54 --- /dev/null +++ b/src/main/java/com/subsidy/service/RolePermissionMappingService.java @@ -0,0 +1,16 @@ +package com.subsidy.service; + +import com.subsidy.model.RolePermissionMappingDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * <p> + * 系统用户角色表 服务类 + * </p> + * + * @author DengMin + * @since 2021-10-11 + */ +public interface RolePermissionMappingService extends IService<RolePermissionMappingDO> { + +} 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..f285364 --- /dev/null +++ b/src/main/java/com/subsidy/service/SignInRecordService.java @@ -0,0 +1,31 @@ +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.subsidy.vo.sign.SignInStatusVO; +import com.tencentcloudapi.common.Sign; + +/** + * <p> + * 学生签到表 服务类 + * </p> + * + * @author DengMin + * @since 2021-10-18 + */ +public interface SignInRecordService extends IService<SignInRecordDO> { + + IPage<GetMemberSignInfoVO> getMemberSignInfo(GetMemberSignInfoDTO getMemberSignInfoDTO); + + String signIn(SignInRecordDO signInRecordDO); + + IPage classSignInfo(ClassSignInfoDTO classSignInfoDTO); + + SignInStatusVO signInStatus(SignInRecordDO signInRecordDO); +} 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; + +/** + * <p> + * 短信验证码记录表 服务类 + * </p> + * + * @author DengMin + * @since 2021-10-14 + */ +public interface SmsVerifyCodeService extends IService<SmsVerifyCodeDO> { + + void sendVerifyCode(SendVerifyCodeDTO sendVerifyCodeDTO); + +} diff --git a/src/main/java/com/subsidy/service/VodDictService.java b/src/main/java/com/subsidy/service/VodDictService.java new file mode 100644 index 0000000..1d5183a --- /dev/null +++ b/src/main/java/com/subsidy/service/VodDictService.java @@ -0,0 +1,31 @@ +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; +import com.subsidy.vo.vod.SignatureVO; + +import java.util.List; + +/** + * <p> + * 视频表 服务类 + * </p> + * + * @author DengMin + * @since 2021-10-11 + */ +public interface VodDictService extends IService<VodDictDO> { + + SignatureVO signature()throws Exception; + + IPage<GetContendVodsVO> getContendVods(GetContendVodsDTO getContendVodsDTO); + + String deleteVod(VodDictDO vodDictDO); + + String addVod(VodDictDO vodDictDO); + + String updateVod(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; + +/** + * <p> + * 视频播放历史记录表 服务类 + * </p> + * + * @author DengMin + * @since 2021-10-14 + */ +public interface VodPlayHistoryService extends IService<VodPlayHistoryDO> { + + 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 new file mode 100644 index 0000000..4f84195 --- /dev/null +++ b/src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java @@ -0,0 +1,1710 @@ +package com.subsidy.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.subsidy.common.exception.HttpException; +import com.subsidy.dto.administer.ClassDetailDTO; +import com.subsidy.dto.administer.OperatorsDTO; +import com.subsidy.dto.member.ImportMemberDTO; +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.*; +import com.subsidy.util.excel.ExcelColumn; +import com.subsidy.util.excel.ExcelUtil; +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.commons.lang3.StringUtils; +import org.apache.poi.hssf.usermodel.*; +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.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; +import org.springframework.web.multipart.MultipartFile; + +import javax.servlet.ServletOutputStream; +import javax.servlet.http.HttpServletResponse; +import java.io.*; +import java.math.BigDecimal; +import java.util.*; +import java.util.zip.ZipEntry; +import java.util.zip.ZipOutputStream; + + +/** + * <p> + * 管理平台用户 服务实现类 + * </p> + * + * @author DengMin + * @since 2021-10-11 + */ +@Service +public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, AdministerDO> 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; + + @Autowired + private RoleAdministerMappingMapper roleAdministerMappingMapper; + + @Autowired + private MemberMapper memberMapper; + + @Autowired + private DepartmentDictMapper departmentDictMapper; + + @Autowired + private MemberDepartmentMappingMapper memberDepartmentMappingMapper; + + public LoginVO login(AdministerDO administerDO) { + + LoginVO loginVO = new LoginVO(); + + AdministerDO administerDO1 = this.baseMapper.selectOne(new QueryWrapper<AdministerDO>() + .lambda() + .eq(AdministerDO::getAccountName, administerDO.getAccountName())); + + if (null != administerDO1) { + if (administerDO.getPassword().equals(administerDO1.getPassword())) { + String token = JwtUtil.generateToken(administerDO1.getId(), ConstantUtils.ADMINISTER_TERMINATE); + loginVO.setToken(token); + return loginVO; + } else { + throw new HttpException(10004); + } + } else { + throw new HttpException(10011); + } + } + + public AdministerPermissionVO getPermissions() { + + AdministerPermissionVO administerPermissionVO = new AdministerPermissionVO(); + AdministerDO administerDO = (AdministerDO) Localstorage.getUser(); + if (administerDO == null) { + throw new HttpException(10012); + } + BeanUtils.copyProperties(administerDO, administerPermissionVO); + + List<PermissionsVO> list = this.baseMapper.getPermissions(administerDO.getId()); + List<PermissionsVO> treeList = new ArrayList(); + if (list != null) { + list.forEach(permission -> { + if (permission.getParentId() == null) { + treeList.add(permission); + } + + list.forEach(p -> { + if (null != p.getParentId() && p.getParentId().equals(permission.getId())) { + if (permission.getChildren() == null) { + permission.setChildren(new ArrayList<>()); + } + permission.getChildren().add(p); + } + }); + }); + } + administerPermissionVO.setPermissions(treeList); + return administerPermissionVO; + } + + public IPage<OperatorsVO> operators(OperatorsDTO operatorsDTO) { + Page pager = new Page(operatorsDTO.getPageNum(), operatorsDTO.getPageSize()); + + //判断该用户的角色 + Integer count = roleAdministerMappingMapper.selectCount(new QueryWrapper<RoleAdministerMappingDO>() + .lambda() + .eq(RoleAdministerMappingDO::getAdministerId, operatorsDTO.getId()) + .eq(RoleAdministerMappingDO::getRoleId, 1)); + + if (count > 0) { + operatorsDTO.setId(null); + } + + return companyDictMapper.operators(pager, operatorsDTO.getCompanyName(), operatorsDTO.getId(), operatorsDTO.getUserName(), 0); + } + + public String addAdminister(AdministerDO administerDO) { + + int count = this.baseMapper.selectCount(new QueryWrapper<AdministerDO>() + .lambda() + .eq(AdministerDO::getAccountName, administerDO.getAccountName())); + + if (count > 0) { + throw new HttpException(20002); + } + + administerDO.setRole(0); + administerDO.setPassword("admin123"); + administerDO.setStatus("1"); + this.baseMapper.insert(administerDO); + + RoleAdministerMappingDO roleAdministerMappingDO = new RoleAdministerMappingDO(); + roleAdministerMappingDO.setAdministerId(administerDO.getId()); + roleAdministerMappingDO.setRoleId(1L); + roleAdministerMappingMapper.insert(roleAdministerMappingDO); + + return ConstantUtils.ADD_SUCCESS; + } + + public String deleteAdminister(AdministerDO administerDO) { + this.baseMapper.deleteById(administerDO.getId()); + return ConstantUtils.DELETE_SUCCESS; + } + + public String updateAdminister(AdministerDO administerDO) { + + int count = this.baseMapper.selectCount(new QueryWrapper<AdministerDO>() + .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<ClassMemberMappingDO> classMemberMappingDOS = classMemberMappingMapper.selectList(new QueryWrapper<ClassMemberMappingDO>() + .lambda() + .eq(ClassMemberMappingDO::getClassId, classDetailDTO.getId())); + classSummaryVO.setMemberCount(classMemberMappingDOS.size()); + + //课程总数 + List<VodDictDO> vodDictDOS = classDictMapper.getClassVods(classDetailDTO.getId()); + classSummaryVO.setTotalVodCounts(vodDictDOS.size()); + + + int totalStudyVods = 0; + int totalStudyLength = 0; + //学生总共学习课时数 + for (VodDictDO vodDictDO : vodDictDOS) { + for (ClassMemberMappingDO classMemberMappingDO : classMemberMappingDOS) { + List<VodPlayHistoryDO> vodPlayHistoryDOS = vodPlayHistoryMapper.selectList(new QueryWrapper<VodPlayHistoryDO>() + .lambda() + .eq(VodPlayHistoryDO::getMemberId, classMemberMappingDO.getMemberId()) + .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.intDivCeil(totalStudyVods,classMemberMappingDOS.size())); + + //平均完成时长 学生观看课程视频的全部时长/总人数 + int avg = MathUtil.intDivCeil(totalStudyLength, classMemberMappingDOS.size()); + classSummaryVO.setAvgVodPlayLength(avg); + + //测试通过率 + List<ExerciseDoneResultDO> exerciseDoneResultDOS = exerciseDoneResultMapper.selectList(new QueryWrapper<ExerciseDoneResultDO>() + .lambda() + .eq(ExerciseDoneResultDO::getClassId, classDetailDTO.getId())); + + int passNum = 0; + + for (ExerciseDoneResultDO exerciseDoneResultDO : exerciseDoneResultDOS) { + if (exerciseDoneResultDO.getRightCounts() > exerciseDoneResultDO.getTotalCounts() * 0.6) { + passNum++; + } + } + classSummaryVO.setPassRate(MathUtil.intDivFloorPercent(passNum, classMemberMappingDOS.size())); + + + //平均签到数 向上取整 + //签到总次数 + Integer signCount = signInRecordMapper.selectCount(new QueryWrapper<SignInRecordDO>() + .lambda() + .eq(SignInRecordDO::getClassId, classDetailDTO.getId())); + classSummaryVO.setAvgSignCount(MathUtil.intDivCeil(signCount, classMemberMappingDOS.size())); + + //答疑数 + Integer count = answeringQuestionMapper.selectCount(new QueryWrapper<AnsweringQuestionDO>() + .lambda() + .eq(AnsweringQuestionDO::getClassId, classDetailDTO.getId())); + classSummaryVO.setAnswerCount(count); + + return classSummaryVO; + } + + public IPage<ClassDetailVO> classDetail(ClassDetailDTO classDetailDTO) { + + Page pager = new Page(classDetailDTO.getPageNum(), classDetailDTO.getPageSize()); + + + IPage<ClassDetailVO> classDetailVOIPage = this.baseMapper.classMembers(pager, classDetailDTO.getId(), classDetailDTO.getUserName()); + List<ClassDetailVO> classDetailVOS = classDetailVOIPage.getRecords(); + + //课程由多少个视频 + List<VodDictDO> 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<VodPlayHistoryDO> vodPlayHistoryDOS = vodPlayHistoryMapper.selectList(new QueryWrapper<VodPlayHistoryDO>() + .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<ExerciseDoneResultDO>() + .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.intDivFloorPercent(exerciseDoneResultDO.getRightCounts(), exerciseDoneResultDO.getTotalCounts())); + + if (classDetailVO.getScore()>=60){ + classDetailVO.setResult("合格"); + }else { + classDetailVO.setResult("不合格"); + } + + } + + classDetailVO.setClassProcess(i+"/"+vodDictDOS.size()); + //答疑 + Integer count = answeringQuestionMapper.selectCount(new QueryWrapper<AnsweringQuestionDO>() + .lambda() + .eq(AnsweringQuestionDO::getAskId, classDetailVO.getId()) + .eq(AnsweringQuestionDO::getClassId, classDetailDTO.getId())); + classDetailVO.setAskCounts(count); + + //签到次数 + Integer signCount = signInRecordMapper.selectCount(new QueryWrapper<SignInRecordDO>() + .lambda() + .eq(SignInRecordDO::getMemberId, classDetailVO.getId()) + .eq(SignInRecordDO::getClassId, classDetailDTO.getId())); + classDetailVO.setSignCounts(signCount); + + //培训时长 + classDetailVO.setTrainingLength(i); + } + classDetailVOIPage.setRecords(classDetailVOS); + return classDetailVOIPage; + } + + public List<ClassDetailVO> exportClassDetail(ClassDetailDTO classDetailDTO) throws Exception { + Page pager = new Page(1, 10000000); + + IPage<ClassDetailVO> classDetailVOIPage = this.baseMapper.classMembers(pager, classDetailDTO.getId(), classDetailDTO.getUserName()); + List<ClassDetailVO> classDetailVOS = classDetailVOIPage.getRecords(); + + //课程由多少个视频 + List<VodDictDO> vodDictDOS = classDictMapper.getClassVods(classDetailDTO.getId()); + + //课程详情 + ClassDictDO classDictDO = classDictMapper.selectById(classDetailDTO.getId()); + + CompanyDictDO companyDictDO = companyDictMapper.selectById(classDictDO.getCompanyId()); + for (ClassDetailVO classDetailVO : classDetailVOS) { + //全部视频数 + //classDetailVO.setAllVodCounts(vodDictDOS.size()); + + //该学生完成了多少个 + int i = 0; + + //该成员完成了几个视频 + for (VodDictDO vodDictDO : vodDictDOS) { + List<VodPlayHistoryDO> vodPlayHistoryDOS = vodPlayHistoryMapper.selectList(new QueryWrapper<VodPlayHistoryDO>() + .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<ExerciseDoneResultDO>() + .lambda() + .eq(ExerciseDoneResultDO::getCourseId, classDictDO.getCourseId()) + .eq(ExerciseDoneResultDO::getMemberId, classDetailVO.getId())); + + if (null != exerciseDoneResultDO) { + classDetailVO.setScore(MathUtil.intDivFloorPercent(exerciseDoneResultDO.getRightCounts(), exerciseDoneResultDO.getTotalCounts())); + } else { + classDetailVO.setScore(0); + } + + //答疑 + Integer count = answeringQuestionMapper.selectCount(new QueryWrapper<AnsweringQuestionDO>() + .lambda() + .eq(AnsweringQuestionDO::getAskId, classDetailVO.getId()) + .eq(AnsweringQuestionDO::getClassId, classDetailDTO.getId())); + classDetailVO.setAskCounts(count); + + //签到次数 + Integer signCount = signInRecordMapper.selectCount(new QueryWrapper<SignInRecordDO>() + .lambda() + .eq(SignInRecordDO::getMemberId, classDetailVO.getId()) + .eq(SignInRecordDO::getClassId, classDetailDTO.getId())); + classDetailVO.setSignCounts(signCount); + + //培训时长 + classDetailVO.setTrainingLength(i); + } + + if (classDetailDTO.getFlag()) { + CourseDictDO courseDictDO = courseDictMapper.selectById(classDictDO.getCourseId()); + String studyDate = classDictDO.getStartDate() + " 至 " + classDictDO.getEndDate(); + ExcelUtil.writeMemberExcel(companyDictDO.getCompanyName(), studyDate, courseDictDO.getCourseName(), "授课记录汇总表", classDetailVOS, ExcelFormatUtils.memberList); + } + return classDetailVOS; + } + + + public IPage<ClassSignVO> signDetail(ClassDetailDTO classDetailDTO) { + + Page pager = new Page(classDetailDTO.getPageNum(), classDetailDTO.getPageSize()); + + IPage<ClassSignVO> classSignVOIPage = this.baseMapper.classSign(pager, classDetailDTO.getId(), classDetailDTO.getUserName()); + List<ClassSignVO> classSignVOS = classSignVOIPage.getRecords(); + + //课程由多少个视频 + List<VodDictDO> vodDictDOS = classDictMapper.getClassVods(classDetailDTO.getId()); + + for (ClassSignVO classSignVO : classSignVOS) { + + //全部视频数 + classSignVO.setAllVodCounts(vodDictDOS.size()); + + //该学生完成了多少个 + int i = 0; + + //该成员完成了几个视频 + for (VodDictDO vodDictDO : vodDictDOS) { + List<VodPlayHistoryDO> vodPlayHistoryDOS = vodPlayHistoryMapper.selectList(new QueryWrapper<VodPlayHistoryDO>() + .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); + + //签到 + List<SignInRecordDO> signInRecordDOS = signInRecordMapper.selectList(new QueryWrapper<SignInRecordDO>() + .lambda() + .eq(SignInRecordDO::getMemberId, classSignVO.getId()) + .eq(SignInRecordDO::getClassId, classDetailDTO.getId())); + classSignVO.setSignCounts(signInRecordDOS.size()); + + StringBuilder stringBuilder = new StringBuilder(); + //签到时间 + for (SignInRecordDO signInRecordDO : signInRecordDOS) { + stringBuilder.append(signInRecordDO.getSignInDate().toString().replace("T", " ")).append(";"); + } + if (StringUtils.isNotBlank(stringBuilder.toString())) { + String signInDate = stringBuilder.toString().substring(0, stringBuilder.length() - 1); + classSignVO.setSignInDateList(signInDate); + } + + //培训时长 + classSignVO.setTrainingLength(i); + } + classSignVOIPage.setRecords(classSignVOS); + return classSignVOIPage; + } + + public List<ClassSignVO> exportSignDetail(ClassDetailDTO classDetailDTO) throws Exception { + Page pager = new Page(1, 1000000); + + IPage<ClassSignVO> classSignVOIPage = this.baseMapper.classSign(pager, classDetailDTO.getId(), classDetailDTO.getUserName()); + List<ClassSignVO> classSignVOS = classSignVOIPage.getRecords(); + + //课程由多少个视频 + List<VodDictDO> vodDictDOS = classDictMapper.getClassVods(classDetailDTO.getId()); + + for (ClassSignVO classSignVO : classSignVOS) { + + //全部视频数 + //classSignVO.setAllVodCounts(vodDictDOS.size()); + + //该学生完成了多少个 + int i = 0; + + //该成员完成了几个视频 + for (VodDictDO vodDictDO : vodDictDOS) { + List<VodPlayHistoryDO> vodPlayHistoryDOS = vodPlayHistoryMapper.selectList(new QueryWrapper<VodPlayHistoryDO>() + .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); + + //签到 + List<SignInRecordDO> signInRecordDOS = signInRecordMapper.selectList(new QueryWrapper<SignInRecordDO>() + .lambda() + .eq(SignInRecordDO::getMemberId, classSignVO.getId()) + .eq(SignInRecordDO::getClassId, classDetailDTO.getId())); + classSignVO.setSignCounts(signInRecordDOS.size()); + + StringBuilder stringBuilder = new StringBuilder(); + //签到时间 + for (SignInRecordDO signInRecordDO : signInRecordDOS) { + stringBuilder.append(signInRecordDO.getSignInDate().toString().replace("T", " ")).append(";"); + } + if (StringUtils.isNotBlank(stringBuilder.toString())) { + String signInDate = stringBuilder.toString().substring(0, stringBuilder.length() - 1); + classSignVO.setSignInDateList(signInDate); + } + + //培训时长 + classSignVO.setTrainingLength(i); + } + + if (classDetailDTO.getFlag()) { + ClassDictDO classDictDO = classDictMapper.selectById(classDetailDTO.getId()); + CompanyDictDO companyDictDO = companyDictMapper.selectById(classDictDO.getCompanyId()); + CourseDictDO courseDictDO = courseDictMapper.selectById(classDictDO.getCourseId()); + String studyDate = classDictDO.getStartDate() + " 至 " + classDictDO.getEndDate(); + ExcelUtil.writeSignExcel(companyDictDO.getCompanyName(), studyDate, courseDictDO.getCourseName(), "注册签到表", classSignVOS, ExcelFormatUtils.signList); + } + + return classSignVOS; + } + + + public IPage exerciseTest(ClassDetailDTO classDetailDTO) { + + Page pager = new Page(classDetailDTO.getPageNum(), classDetailDTO.getPageSize()); + + IPage<ExerciseTestVO> exerciseTestVOIPage = this.baseMapper.exerciseTest(pager, classDetailDTO.getId(), classDetailDTO.getUserName()); + List<ExerciseTestVO> classSignVOS = exerciseTestVOIPage.getRecords(); + + //课程详情 + ClassDictDO classDictDO = classDictMapper.selectById(classDetailDTO.getId()); + + for (ExerciseTestVO exerciseTestVO : classSignVOS) { + + //学生测试完成情况 + ExerciseDoneResultDO exerciseDoneResultDO = exerciseDoneResultMapper.selectOne(new QueryWrapper<ExerciseDoneResultDO>() + .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.intDivFloorPercent(rights, total); + exerciseTestVO.setScore(score); + if (score >= 60) { + exerciseTestVO.setResult("合格"); + } else { + exerciseTestVO.setResult("不合格"); + } + exerciseTestVO.setCount(1); + + } else { + exerciseTestVO.setScore(0); + exerciseTestVO.setResult("不合格"); + exerciseTestVO.setCount(0); + } + } + exerciseTestVOIPage.setRecords(classSignVOS); + return exerciseTestVOIPage; + } + + public List<ExerciseTestVO> exportExerciseTest(ClassDetailDTO classDetailDTO) throws Exception { + Page pager = new Page(0, 1000000); + + IPage<ExerciseTestVO> exerciseTestVOIPage = this.baseMapper.exerciseTest(pager, classDetailDTO.getId(), classDetailDTO.getUserName()); + List<ExerciseTestVO> exerciseTestVOS = exerciseTestVOIPage.getRecords(); + + //课程详情 + ClassDictDO classDictDO = classDictMapper.selectById(classDetailDTO.getId()); + + for (ExerciseTestVO exerciseTestVO : exerciseTestVOS) { + + //学生测试完成情况 + ExerciseDoneResultDO exerciseDoneResultDO = exerciseDoneResultMapper.selectOne(new QueryWrapper<ExerciseDoneResultDO>() + .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.intDivFloorPercent(rights, total); + exerciseTestVO.setScore(score); + if (score >= 60) { + exerciseTestVO.setResult("合格"); + } else { + exerciseTestVO.setResult("不合格"); + } + } else { + exerciseTestVO.setScore(0); + exerciseTestVO.setResult("不合格"); + } + } + + if (classDetailDTO.getFlag()) { + CompanyDictDO companyDictDO = companyDictMapper.selectById(classDictDO.getCompanyId()); + CourseDictDO courseDictDO = courseDictMapper.selectById(classDictDO.getCourseId()); + String studyDate = classDictDO.getStartDate() + " 至 " + classDictDO.getEndDate(); + ExcelUtil.writeTestExcel(companyDictDO.getCompanyName(), studyDate, courseDictDO.getCourseName(), "测试成绩表", exerciseTestVOS, ExcelFormatUtils.scoreList); + } + + 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<AnswerRecordVO> exportAnswerRecord(ClassDetailDTO classDetailDTO) throws Exception { + Page pager = new Page(1, 1000000); + IPage iPage = this.baseMapper.answerRecord(pager, classDetailDTO.getId(), classDetailDTO.getUserName()); + List<AnswerRecordVO> answerRecordVOS = iPage.getRecords(); + + if (classDetailDTO.getFlag()){ + ClassDictDO classDictDO = classDictMapper.selectById(classDetailDTO.getId()); + CompanyDictDO companyDictDO = companyDictMapper.selectById(classDictDO.getCompanyId()); + CourseDictDO courseDictDO = courseDictMapper.selectById(classDictDO.getCourseId()); + String studyDate = classDictDO.getStartDate() + " 至 " + classDictDO.getEndDate(); + ExcelUtil.writeAnswerExcel(companyDictDO.getCompanyName(), studyDate, courseDictDO.getCourseName(), "答疑记录表", answerRecordVOS, ExcelFormatUtils.answersList); + } + return answerRecordVOS; + } + + 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.setHeader("Access-Control-Allow-Origin", "*"); + response.setContentType("application/zip;charset=utf-8"); + response.setHeader("Content-Disposition", "attachment;filename=" + new String((zipname).getBytes("UTF-8"), "ISO8859-1")); + + ClassDictDO classDictDO = classDictMapper.selectById(classDetailDTO.getId()); + CompanyDictDO companyDictDO = companyDictMapper.selectById(classDictDO.getCompanyId()); + CourseDictDO courseDictDO = courseDictMapper.selectById(classDictDO.getCourseId()); + + /** + * 班级成员 + */ + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + classDetailDTO.setFlag(false); + List<ClassDetailVO> classDetailVOS = exportClassDetail(classDetailDTO); + String studyDate = classDictDO.getStartDate() + " 至 " + classDictDO.getEndDate(); + membersListExcel(companyDictDO.getCompanyName(), studyDate, courseDictDO.getCourseName(), "授课记录汇总表", ExcelFormatUtils.memberList, classDetailVOS, null, 0, baos); + compressFileToZipStream(zipOutputStream, baos, "member.xlsx"); + + /** + * 注册签到 + */ + ByteArrayOutputStream baos1 = new ByteArrayOutputStream(); + classDetailDTO.setFlag(false); + List<ClassSignVO> classSignVOS = exportSignDetail(classDetailDTO); + signListExcel(companyDictDO.getCompanyName(), studyDate, courseDictDO.getCourseName(), "注册签到", ExcelFormatUtils.signList, classSignVOS, null, 0, baos1); + compressFileToZipStream(zipOutputStream, baos1, "sign.xlsx"); + + + ///** + // * 测试成绩 + // */ + ByteArrayOutputStream baos2 = new ByteArrayOutputStream(); + classDetailDTO.setFlag(false); + List<ExerciseTestVO> exerciseTestVOS = exportExerciseTest(classDetailDTO); + testListExcel(companyDictDO.getCompanyName(), studyDate, courseDictDO.getCourseName(), "测试成绩", ExcelFormatUtils.scoreList, exerciseTestVOS, null, 0, baos2); + compressFileToZipStream(zipOutputStream, baos2, "test.xlsx"); + + + /** + * 答疑记录 + */ + ByteArrayOutputStream baos3 = new ByteArrayOutputStream(); + List<AnswerRecordVO> answerRecordVOS = exportAnswerRecord(classDetailDTO); + askListExcel(companyDictDO.getCompanyName(), studyDate, courseDictDO.getCourseName(), "答疑记录", ExcelFormatUtils.answersList, 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(); + + } + + + @Transactional(rollbackFor = Exception.class) + public String importMember(Long companyId, MultipartFile multipartFile) { + + try { + + List<MemberDO> memberDOS = new ArrayList<>(); + + ExcelUtil.readExcel(null, ImportMemberDTO.class, multipartFile).forEach(s -> { + + MemberDO memberDO = memberMapper.selectOne(new QueryWrapper<MemberDO>() + .lambda() + .eq(MemberDO::getTelephone, s.getTelephone())); + + if (null != memberDO) { + memberDOS.add(memberDO); + } else { + MemberDO memberDO1 = new MemberDO(); + memberDO1.setUserName(s.getUserName()); + memberDO1.setGender(s.getGender()); + memberDO1.setAccountName(s.getAccountName()); + memberDO1.setTelephone(s.getTelephone()); + memberDO1.setIdCard(s.getIdCard()); + memberDO1.setStatus("启用"); + memberDO1.setPassword("123456"); + memberMapper.insert(memberDO1); + + //找到该公司最大的部门 + DepartmentDictDO departmentDictDO = departmentDictMapper.selectOne(new QueryWrapper<DepartmentDictDO>() + .lambda() + .isNull(DepartmentDictDO::getParentId) + .eq(DepartmentDictDO::getCompanyId, companyId)); + + MemberDepartmentMappingDO memberDepartmentMappingDO = new MemberDepartmentMappingDO(); + memberDepartmentMappingDO.setDepartmentId(departmentDictDO.getId()); + memberDepartmentMappingDO.setMemberId(memberDO1.getId()); + memberDepartmentMappingMapper.insert(memberDepartmentMappingDO); + } + }); + } catch (Exception e) { + throw new HttpException(10001); + } + return ConstantUtils.ADD_SUCCESS; + } + + + public static void membersListExcel(String companyName, String studyDate, String courseName, String title, List<String> headerList, List<ClassDetailVO> classDetailVOS, String datePattern, int colWidth, OutputStream out) { + + // 声明一个工作薄 + SXSSFWorkbook workbook = new SXSSFWorkbook(1000);//缓存 + workbook.setCompressTempFiles(true); + //表头样式 + CellStyle titleStyle = workbook.createCellStyle(); + setStyle(titleStyle); + Font titleFont = workbook.createFont(); + titleFont.setFontHeightInPoints((short) 20); + titleFont.setBoldweight((short) 700); + titleStyle.setFont(titleFont); + + //第二行 + CellStyle secondStyle = workbook.createCellStyle(); + secondStyle.setBorderBottom(HSSFCellStyle.BORDER_THIN); //下边框 + secondStyle.setBorderLeft(HSSFCellStyle.BORDER_THIN);//左边框 + secondStyle.setBorderTop(HSSFCellStyle.BORDER_THIN);//上边框 + secondStyle.setBorderRight(HSSFCellStyle.BORDER_THIN);//右边框 + secondStyle.setAlignment(HSSFCellStyle.ALIGN_LEFT); + Font secondFont = workbook.createFont(); + secondStyle.setFont(secondFont); + + //第三行 + CellStyle thirdStyle = workbook.createCellStyle(); + thirdStyle.setBorderBottom(HSSFCellStyle.BORDER_THIN); //下边框 + thirdStyle.setBorderLeft(HSSFCellStyle.BORDER_THIN);//左边框 + thirdStyle.setBorderTop(HSSFCellStyle.BORDER_THIN);//上边框 + thirdStyle.setBorderRight(HSSFCellStyle.BORDER_THIN);//右边框 + secondStyle.setAlignment(HSSFCellStyle.ALIGN_LEFT); + Font thirdFont = workbook.createFont(); + thirdStyle.setFont(thirdFont); + + // 列头样式 + CellStyle headerStyle = workbook.createCellStyle(); + setStyle(headerStyle); + Font headerFont = workbook.createFont(); + headerFont.setFontHeightInPoints((short) 12); + headerFont.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);//粗体显示 + headerStyle.setFont(headerFont); + + // 数据单元格样式 + CellStyle cellStyle = workbook.createCellStyle(); + setStyle(cellStyle); + Font cellFont = workbook.createFont(); + cellFont.setBoldweight(HSSFFont.BOLDWEIGHT_NORMAL); + cellStyle.setFont(cellFont); + // 生成一个(带标题)表格 + SXSSFSheet sheet = workbook.createSheet(); + //设置列宽 + int minBytes = 17;//至少字节数 + int[] arrColWidth = new int[headerList.size()]; + // 产生表格标题行,以及设置列宽 + String[] headers = new String[headerList.size()]; + int ii = 0; + for (int i = 0; i < headerList.size(); i++) { + + headers[ii] = headerList.get(i); + + int bytes = headerList.get(i).getBytes().length; + arrColWidth[ii] = bytes < minBytes ? minBytes : bytes; + sheet.setColumnWidth(ii, arrColWidth[ii] * 256); + ii++; + } + + //第二行 + int[] secondWidth = new int[2]; + // 产生表格标题行,以及设置列宽 + String[] secondHead = new String[2]; + List<String> secondList = Arrays.asList(new String[]{"培训实施单位:" + companyName, "培训时间:" + studyDate}); + + //第三行 + int[] thirdWidth = new int[2]; + // 产生表格标题行,以及设置列宽 + String[] thirdHead = new String[2]; + List<String> thirdList = Arrays.asList(new String[]{"培训项目:" + courseName, "培训平台:有课互联系统"}); + + + ii = 0; + for (int i = 0; i < 2; i++) { + secondHead[ii] = secondList.get(i); + int bytes = secondList.get(i).getBytes().length; + secondWidth[ii] = bytes < minBytes ? minBytes : bytes; + sheet.setColumnWidth(ii, secondWidth[ii] * 256); + ii++; + } + + ii = 0; + for (int i = 0; i < 2; i++) { + thirdHead[ii] = thirdList.get(i); + int bytes = thirdList.get(i).getBytes().length; + thirdWidth[ii] = bytes < minBytes ? minBytes : bytes; + sheet.setColumnWidth(ii, thirdWidth[ii] * 256); + ii++; + } + + // 遍历集合数据,产生数据行 + //标题 0 + SXSSFRow titleRow = sheet.createRow(0);//表头 rowIndex=0 + titleRow.createCell(0).setCellValue(title); + setBorderStyle(HSSFCellStyle.BORDER_THIN, new CellRangeAddress(0, 0, 0, 0), sheet, workbook); //给合并过的单元格加边框 + titleRow.getCell(0).setCellStyle(titleStyle); + sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, headerList.size() - 1)); + + //第二行 1 + SXSSFRow secondRow = sheet.createRow(1); //第二行 rowIndex =1 + CellRangeAddress cellRangeAddress21 = new CellRangeAddress(1, 1, 0, 4); + sheet.addMergedRegion(cellRangeAddress21); + setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress21, sheet, workbook); //给合并过的单元格加边框 + + CellRangeAddress cellRangeAddress22 = new CellRangeAddress(1, 1, 5, 10); + sheet.addMergedRegion(cellRangeAddress22); + setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress22, sheet, workbook); //给合并过的单元格加边框 + + secondRow.createCell(0).setCellValue(secondHead[0]); + secondRow.getCell(0).setCellStyle(secondStyle); + + secondRow.createCell(5).setCellValue(secondHead[1]); + secondRow.getCell(5).setCellStyle(secondStyle); + + //第三行 2 + SXSSFRow thirdRow = sheet.createRow(2); //第二行 rowIndex =1 + CellRangeAddress cellRangeAddress31 = new CellRangeAddress(2, 2, 0, 4); + sheet.addMergedRegion(cellRangeAddress31); + setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress31, sheet, workbook); //给合并过的单元格加边框 + + CellRangeAddress cellRangeAddress32 = new CellRangeAddress(2, 2, 5, 10); + sheet.addMergedRegion(cellRangeAddress32); + setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress32, sheet, workbook); //给合并过的单元格加边框 + thirdRow.createCell(0).setCellValue(thirdHead[0]); + thirdRow.getCell(0).setCellStyle(thirdStyle); + + thirdRow.createCell(5).setCellValue(thirdHead[1]); + thirdRow.getCell(5).setCellStyle(thirdStyle); + + //标题 3 + SXSSFRow headerRow = sheet.createRow(3); //列头 rowIndex =1 + for (int i = 0; i < headers.length; i++) { + headerRow.createCell(i).setCellValue(headers[i]); + headerRow.getCell(i).setCellStyle(headerStyle); + } + + int seq = 1; + + //内容 + int rowIndex = 0; + for (ClassDetailVO classDetailVO : classDetailVOS) { + if (rowIndex == 65535 || rowIndex == 0) { + if (rowIndex != 0) { + sheet = workbook.createSheet();//如果数据超过了,则在第二页显示 + } + rowIndex = 4;//数据内容从 rowIndex=2开始 + } + + SXSSFRow dataRow = sheet.createRow(rowIndex); + + SXSSFCell newCell = dataRow.createCell(0); + cellStyle.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(seq); + + + newCell = dataRow.createCell(1); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(classDetailVO.getUserName()); + + + newCell = dataRow.createCell(2); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(classDetailVO.getIdCard()); + + + newCell = dataRow.createCell(3); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(classDetailVO.getAccountName()); + + newCell = dataRow.createCell(4); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(classDetailVO.getTelephone()); + + newCell = dataRow.createCell(5); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(classDetailVO.getSignCounts()); + + newCell = dataRow.createCell(6); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(classDetailVO.getClassProcess()); + + newCell = dataRow.createCell(7); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(classDetailVO.getTrainingLength()); + + newCell = dataRow.createCell(8); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(classDetailVO.getAskCounts()); + + newCell = dataRow.createCell(9); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(classDetailVO.getScore()); + + newCell = dataRow.createCell(10); + newCell.setCellStyle(cellStyle); + if (classDetailVO.getScore() >= 60) { + newCell.setCellValue("合格"); + } else { + newCell.setCellValue("不合格"); + } + rowIndex++; + seq++; + } + + try { + workbook.write(out); + workbook.close(); + workbook.dispose(); + } catch (IOException e) { + e.printStackTrace(); + } + } + + + public static void signListExcel(String companyName, String studyDate, String courseName, String title, List<String> headerList, List<ClassSignVO> classSignVOS, String datePattern, int colWidth, OutputStream out) { + + // 声明一个工作薄 + SXSSFWorkbook workbook = new SXSSFWorkbook(1000);//缓存 + workbook.setCompressTempFiles(true); + //表头样式 + CellStyle titleStyle = workbook.createCellStyle(); + setStyle(titleStyle); + Font titleFont = workbook.createFont(); + titleFont.setFontHeightInPoints((short) 20); + titleFont.setBoldweight((short) 700); + titleStyle.setFont(titleFont); + + //第二行 + CellStyle secondStyle = workbook.createCellStyle(); + secondStyle.setBorderBottom(HSSFCellStyle.BORDER_THIN); //下边框 + secondStyle.setBorderLeft(HSSFCellStyle.BORDER_THIN);//左边框 + secondStyle.setBorderTop(HSSFCellStyle.BORDER_THIN);//上边框 + secondStyle.setBorderRight(HSSFCellStyle.BORDER_THIN);//右边框 + secondStyle.setAlignment(HSSFCellStyle.ALIGN_LEFT); + Font secondFont = workbook.createFont(); + secondStyle.setFont(secondFont); + + //第三行 + CellStyle thirdStyle = workbook.createCellStyle(); + thirdStyle.setBorderBottom(HSSFCellStyle.BORDER_THIN); //下边框 + thirdStyle.setBorderLeft(HSSFCellStyle.BORDER_THIN);//左边框 + thirdStyle.setBorderTop(HSSFCellStyle.BORDER_THIN);//上边框 + thirdStyle.setBorderRight(HSSFCellStyle.BORDER_THIN);//右边框 + secondStyle.setAlignment(HSSFCellStyle.ALIGN_LEFT); + Font thirdFont = workbook.createFont(); + thirdStyle.setFont(thirdFont); + + // 列头样式 + CellStyle headerStyle = workbook.createCellStyle(); + setStyle(headerStyle); + Font headerFont = workbook.createFont(); + headerFont.setFontHeightInPoints((short) 12); + headerFont.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);//粗体显示 + headerStyle.setFont(headerFont); + + // 数据单元格样式 + CellStyle cellStyle = workbook.createCellStyle(); + setStyle(cellStyle); + Font cellFont = workbook.createFont(); + cellFont.setBoldweight(HSSFFont.BOLDWEIGHT_NORMAL); + cellStyle.setFont(cellFont); + // 生成一个(带标题)表格 + SXSSFSheet sheet = workbook.createSheet(); + //设置列宽 + int minBytes = 17;//至少字节数 + int[] arrColWidth = new int[headerList.size()]; + // 产生表格标题行,以及设置列宽 + String[] headers = new String[headerList.size()]; + int ii = 0; + for (int i = 0; i < headerList.size(); i++) { + + headers[ii] = headerList.get(i); + + int bytes = headerList.get(i).getBytes().length; + arrColWidth[ii] = bytes < minBytes ? minBytes : bytes; + sheet.setColumnWidth(ii, arrColWidth[ii] * 256); + ii++; + } + + //第二行 + int[] secondWidth = new int[2]; + // 产生表格标题行,以及设置列宽 + String[] secondHead = new String[2]; + List<String> secondList = Arrays.asList(new String[]{"培训实施单位:" + companyName, "培训时间:" + studyDate}); + + //第三行 + int[] thirdWidth = new int[2]; + // 产生表格标题行,以及设置列宽 + String[] thirdHead = new String[2]; + List<String> thirdList = Arrays.asList(new String[]{"培训项目:" + courseName, "培训平台:有课互联系统"}); + + + ii = 0; + for (int i = 0; i < 2; i++) { + secondHead[ii] = secondList.get(i); + int bytes = secondList.get(i).getBytes().length; + secondWidth[ii] = bytes < minBytes ? minBytes : bytes; + sheet.setColumnWidth(ii, secondWidth[ii] * 256); + ii++; + } + + ii = 0; + for (int i = 0; i < 2; i++) { + thirdHead[ii] = thirdList.get(i); + int bytes = thirdList.get(i).getBytes().length; + thirdWidth[ii] = bytes < minBytes ? minBytes : bytes; + sheet.setColumnWidth(ii, thirdWidth[ii] * 256); + ii++; + } + + // 遍历集合数据,产生数据行 + //标题 0 + SXSSFRow titleRow = sheet.createRow(0);//表头 rowIndex=0 + titleRow.createCell(0).setCellValue(title); + setBorderStyle(HSSFCellStyle.BORDER_THIN, new CellRangeAddress(0, 0, 0, 0), sheet, workbook); //给合并过的单元格加边框 + titleRow.getCell(0).setCellStyle(titleStyle); + sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, headerList.size() - 1)); + + //第二行 1 + SXSSFRow secondRow = sheet.createRow(1); //第二行 rowIndex =1 + CellRangeAddress cellRangeAddress21 = new CellRangeAddress(1, 1, 0, 3); + sheet.addMergedRegion(cellRangeAddress21); + setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress21, sheet, workbook); //给合并过的单元格加边框 + + CellRangeAddress cellRangeAddress22 = new CellRangeAddress(1, 1, 4, 8); + sheet.addMergedRegion(cellRangeAddress22); + setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress22, sheet, workbook); //给合并过的单元格加边框 + + secondRow.createCell(0).setCellValue(secondHead[0]); + secondRow.getCell(0).setCellStyle(secondStyle); + + secondRow.createCell(4).setCellValue(secondHead[1]); + secondRow.getCell(4).setCellStyle(secondStyle); + + //第三行 2 + SXSSFRow thirdRow = sheet.createRow(2); //第二行 rowIndex =1 + CellRangeAddress cellRangeAddress31 = new CellRangeAddress(2, 2, 0, 3); + sheet.addMergedRegion(cellRangeAddress31); + setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress31, sheet, workbook); //给合并过的单元格加边框 + + CellRangeAddress cellRangeAddress32 = new CellRangeAddress(2, 2, 4, 8); + sheet.addMergedRegion(cellRangeAddress32); + setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress32, sheet, workbook); //给合并过的单元格加边框 + thirdRow.createCell(0).setCellValue(thirdHead[0]); + thirdRow.getCell(0).setCellStyle(thirdStyle); + + thirdRow.createCell(4).setCellValue(thirdHead[1]); + thirdRow.getCell(4).setCellStyle(thirdStyle); + + //标题 3 + SXSSFRow headerRow = sheet.createRow(3); //列头 rowIndex =1 + for (int i = 0; i < headers.length; i++) { + headerRow.createCell(i).setCellValue(headers[i]); + headerRow.getCell(i).setCellStyle(headerStyle); + } + + int seq = 1; + + //内容 + int rowIndex = 0; + for (ClassSignVO classSignVO : classSignVOS) { + if (rowIndex == 65535 || rowIndex == 0) { + if (rowIndex != 0) { + sheet = workbook.createSheet();//如果数据超过了,则在第二页显示 + } + rowIndex = 4;//数据内容从 rowIndex=2开始 + } + + SXSSFRow dataRow = sheet.createRow(rowIndex); + + SXSSFCell newCell = dataRow.createCell(0); + cellStyle.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(seq); + + + newCell = dataRow.createCell(1); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(classSignVO.getUserName()); + + + newCell = dataRow.createCell(2); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(classSignVO.getIdCard()); + + + newCell = dataRow.createCell(3); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(classSignVO.getTelephone()); + + newCell = dataRow.createCell(4); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(classSignVO.getTrainingLength()); + + newCell = dataRow.createCell(5); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(classSignVO.getClassProcess()); + + newCell = dataRow.createCell(6); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(classSignVO.getPercent()); + + newCell = dataRow.createCell(7); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(classSignVO.getSignCounts()); + + newCell = dataRow.createCell(8); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(classSignVO.getSignInDateList()); + + rowIndex++; + seq++; + + } + + try { + workbook.write(out); + workbook.close(); + workbook.dispose(); + } catch (IOException e) { + e.printStackTrace(); + } + } + + public static void testListExcel(String companyName, String studyDate, String courseName, String title, List<String> headerList, List<ExerciseTestVO> exerciseTestVOS, String datePattern, int colWidth, OutputStream out) { + + // 声明一个工作薄 + SXSSFWorkbook workbook = new SXSSFWorkbook(1000);//缓存 + workbook.setCompressTempFiles(true); + //表头样式 + CellStyle titleStyle = workbook.createCellStyle(); + setStyle(titleStyle); + Font titleFont = workbook.createFont(); + titleFont.setFontHeightInPoints((short) 20); + titleFont.setBoldweight((short) 700); + titleStyle.setFont(titleFont); + + //第二行 + CellStyle secondStyle = workbook.createCellStyle(); + secondStyle.setBorderBottom(HSSFCellStyle.BORDER_THIN); //下边框 + secondStyle.setBorderLeft(HSSFCellStyle.BORDER_THIN);//左边框 + secondStyle.setBorderTop(HSSFCellStyle.BORDER_THIN);//上边框 + secondStyle.setBorderRight(HSSFCellStyle.BORDER_THIN);//右边框 + secondStyle.setAlignment(HSSFCellStyle.ALIGN_LEFT); + Font secondFont = workbook.createFont(); + secondStyle.setFont(secondFont); + + //第三行 + CellStyle thirdStyle = workbook.createCellStyle(); + thirdStyle.setBorderBottom(HSSFCellStyle.BORDER_THIN); //下边框 + thirdStyle.setBorderLeft(HSSFCellStyle.BORDER_THIN);//左边框 + thirdStyle.setBorderTop(HSSFCellStyle.BORDER_THIN);//上边框 + thirdStyle.setBorderRight(HSSFCellStyle.BORDER_THIN);//右边框 + secondStyle.setAlignment(HSSFCellStyle.ALIGN_LEFT); + Font thirdFont = workbook.createFont(); + thirdStyle.setFont(thirdFont); + + // 列头样式 + CellStyle headerStyle = workbook.createCellStyle(); + setStyle(headerStyle); + Font headerFont = workbook.createFont(); + headerFont.setFontHeightInPoints((short) 12); + headerFont.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);//粗体显示 + headerStyle.setFont(headerFont); + + // 数据单元格样式 + CellStyle cellStyle = workbook.createCellStyle(); + setStyle(cellStyle); + Font cellFont = workbook.createFont(); + cellFont.setBoldweight(HSSFFont.BOLDWEIGHT_NORMAL); + cellStyle.setFont(cellFont); + // 生成一个(带标题)表格 + SXSSFSheet sheet = workbook.createSheet(); + //设置列宽 + int minBytes = 17;//至少字节数 + int[] arrColWidth = new int[headerList.size()]; + // 产生表格标题行,以及设置列宽 + String[] headers = new String[headerList.size()]; + int ii = 0; + for (int i = 0; i < headerList.size(); i++) { + + headers[ii] = headerList.get(i); + + int bytes = headerList.get(i).getBytes().length; + arrColWidth[ii] = bytes < minBytes ? minBytes : bytes; + sheet.setColumnWidth(ii, arrColWidth[ii] * 256); + ii++; + } + + //第二行 + int[] secondWidth = new int[2]; + // 产生表格标题行,以及设置列宽 + String[] secondHead = new String[2]; + List<String> secondList = Arrays.asList(new String[]{"培训实施单位:" + companyName, "培训时间:" + studyDate}); + + //第三行 + int[] thirdWidth = new int[2]; + // 产生表格标题行,以及设置列宽 + String[] thirdHead = new String[2]; + List<String> thirdList = Arrays.asList(new String[]{"培训项目:" + courseName, "培训平台:有课互联系统"}); + + + ii = 0; + for (int i = 0; i < 2; i++) { + secondHead[ii] = secondList.get(i); + int bytes = secondList.get(i).getBytes().length; + secondWidth[ii] = bytes < minBytes ? minBytes : bytes; + sheet.setColumnWidth(ii, secondWidth[ii] * 256); + ii++; + } + + ii = 0; + for (int i = 0; i < 2; i++) { + thirdHead[ii] = thirdList.get(i); + int bytes = thirdList.get(i).getBytes().length; + thirdWidth[ii] = bytes < minBytes ? minBytes : bytes; + sheet.setColumnWidth(ii, thirdWidth[ii] * 256); + ii++; + } + + // 遍历集合数据,产生数据行 + //标题 0 + SXSSFRow titleRow = sheet.createRow(0);//表头 rowIndex=0 + titleRow.createCell(0).setCellValue(title); + setBorderStyle(HSSFCellStyle.BORDER_THIN, new CellRangeAddress(0, 0, 0, 0), sheet, workbook); //给合并过的单元格加边框 + titleRow.getCell(0).setCellStyle(titleStyle); + sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, headerList.size() - 1)); + + //第二行 1 + SXSSFRow secondRow = sheet.createRow(1); //第二行 rowIndex =1 + CellRangeAddress cellRangeAddress21 = new CellRangeAddress(1, 1, 0, 3); + sheet.addMergedRegion(cellRangeAddress21); + setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress21, sheet, workbook); //给合并过的单元格加边框 + + CellRangeAddress cellRangeAddress22 = new CellRangeAddress(1, 1, 4, 6); + sheet.addMergedRegion(cellRangeAddress22); + setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress22, sheet, workbook); //给合并过的单元格加边框 + + secondRow.createCell(0).setCellValue(secondHead[0]); + secondRow.getCell(0).setCellStyle(secondStyle); + + secondRow.createCell(4).setCellValue(secondHead[1]); + secondRow.getCell(4).setCellStyle(secondStyle); + + //第三行 2 + SXSSFRow thirdRow = sheet.createRow(2); //第二行 rowIndex =1 + CellRangeAddress cellRangeAddress31 = new CellRangeAddress(2, 2, 0, 3); + sheet.addMergedRegion(cellRangeAddress31); + setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress31, sheet, workbook); //给合并过的单元格加边框 + + CellRangeAddress cellRangeAddress32 = new CellRangeAddress(2, 2, 4, 6); + sheet.addMergedRegion(cellRangeAddress32); + setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress32, sheet, workbook); //给合并过的单元格加边框 + thirdRow.createCell(0).setCellValue(thirdHead[0]); + thirdRow.getCell(0).setCellStyle(thirdStyle); + + thirdRow.createCell(4).setCellValue(thirdHead[1]); + thirdRow.getCell(4).setCellStyle(thirdStyle); + + //标题 3 + SXSSFRow headerRow = sheet.createRow(3); //列头 rowIndex =1 + for (int i = 0; i < headers.length; i++) { + headerRow.createCell(i).setCellValue(headers[i]); + headerRow.getCell(i).setCellStyle(headerStyle); + } + + int seq = 1; + + //内容 + int rowIndex = 0; + for (ExerciseTestVO exerciseTestVO : exerciseTestVOS) { + if (rowIndex == 65535 || rowIndex == 0) { + if (rowIndex != 0) { + sheet = workbook.createSheet();//如果数据超过了,则在第二页显示 + } + rowIndex = 4;//数据内容从 rowIndex=2开始 + } + + SXSSFRow dataRow = sheet.createRow(rowIndex); + + SXSSFCell newCell = dataRow.createCell(0); + cellStyle.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(seq); + + + newCell = dataRow.createCell(1); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(exerciseTestVO.getUserName()); + + + newCell = dataRow.createCell(2); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(exerciseTestVO.getIdCard()); + + + newCell = dataRow.createCell(3); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(exerciseTestVO.getTelephone()); + + newCell = dataRow.createCell(4); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(exerciseTestVO.getScore()); + + //次数 + newCell = dataRow.createCell(5); + newCell.setCellStyle(cellStyle); + if (exerciseTestVO.getScore()!=0){ + newCell.setCellValue(1); + }else { + newCell.setCellValue(0); + } + + newCell = dataRow.createCell(6); + newCell.setCellStyle(cellStyle); + if (exerciseTestVO.getScore()>=60){ + newCell.setCellValue("合格"); + }else { + newCell.setCellValue("不合格"); + } + + rowIndex++; + seq++; + + } + try { + workbook.write(out); + workbook.close(); + workbook.dispose(); + } catch (IOException e) { + e.printStackTrace(); + } + } + + public static void askListExcel(String companyName, String studyDate, String courseName,String title, List<String> headerList, List<AnswerRecordVO> answerRecordVOS, String datePattern, int colWidth, OutputStream out) { + // 声明一个工作薄 + SXSSFWorkbook workbook = new SXSSFWorkbook(1000);//缓存 + workbook.setCompressTempFiles(true); + //表头样式 + CellStyle titleStyle = workbook.createCellStyle(); + setStyle(titleStyle); + Font titleFont = workbook.createFont(); + titleFont.setFontHeightInPoints((short) 20); + titleFont.setBoldweight((short) 700); + titleStyle.setFont(titleFont); + + //第二行 + CellStyle secondStyle = workbook.createCellStyle(); + secondStyle.setBorderBottom(HSSFCellStyle.BORDER_THIN); //下边框 + secondStyle.setBorderLeft(HSSFCellStyle.BORDER_THIN);//左边框 + secondStyle.setBorderTop(HSSFCellStyle.BORDER_THIN);//上边框 + secondStyle.setBorderRight(HSSFCellStyle.BORDER_THIN);//右边框 + secondStyle.setAlignment(HSSFCellStyle.ALIGN_LEFT); + Font secondFont = workbook.createFont(); + secondStyle.setFont(secondFont); + + //第三行 + CellStyle thirdStyle = workbook.createCellStyle(); + thirdStyle.setBorderBottom(HSSFCellStyle.BORDER_THIN); //下边框 + thirdStyle.setBorderLeft(HSSFCellStyle.BORDER_THIN);//左边框 + thirdStyle.setBorderTop(HSSFCellStyle.BORDER_THIN);//上边框 + thirdStyle.setBorderRight(HSSFCellStyle.BORDER_THIN);//右边框 + secondStyle.setAlignment(HSSFCellStyle.ALIGN_LEFT); + Font thirdFont = workbook.createFont(); + thirdStyle.setFont(thirdFont); + + // 列头样式 + CellStyle headerStyle = workbook.createCellStyle(); + setStyle(headerStyle); + Font headerFont = workbook.createFont(); + headerFont.setFontHeightInPoints((short) 12); + headerFont.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);//粗体显示 + headerStyle.setFont(headerFont); + + // 数据单元格样式 + CellStyle cellStyle = workbook.createCellStyle(); + setStyle(cellStyle); + Font cellFont = workbook.createFont(); + cellFont.setBoldweight(HSSFFont.BOLDWEIGHT_NORMAL); + cellStyle.setFont(cellFont); + // 生成一个(带标题)表格 + SXSSFSheet sheet = workbook.createSheet(); + //设置列宽 + int minBytes = 17;//至少字节数 + int[] arrColWidth = new int[headerList.size()]; + // 产生表格标题行,以及设置列宽 + String[] headers = new String[headerList.size()]; + int ii = 0; + for (int i = 0; i < headerList.size(); i++) { + + headers[ii] = headerList.get(i); + + int bytes = headerList.get(i).getBytes().length; + arrColWidth[ii] = bytes < minBytes ? minBytes : bytes; + sheet.setColumnWidth(ii, arrColWidth[ii] * 256); + ii++; + } + + //第二行 + int[] secondWidth = new int[2]; + // 产生表格标题行,以及设置列宽 + String[] secondHead = new String[2]; + List<String> secondList = Arrays.asList(new String[]{"培训实施单位:" + companyName, "培训时间:" + studyDate}); + + //第三行 + int[] thirdWidth = new int[2]; + // 产生表格标题行,以及设置列宽 + String[] thirdHead = new String[2]; + List<String> thirdList = Arrays.asList(new String[]{"培训项目:" + courseName, "培训平台:有课互联系统"}); + + + ii = 0; + for (int i = 0; i < 2; i++) { + secondHead[ii] = secondList.get(i); + int bytes = secondList.get(i).getBytes().length; + secondWidth[ii] = bytes < minBytes ? minBytes : bytes; + sheet.setColumnWidth(ii, secondWidth[ii] * 256); + ii++; + } + + ii = 0; + for (int i = 0; i < 2; i++) { + thirdHead[ii] = thirdList.get(i); + int bytes = thirdList.get(i).getBytes().length; + thirdWidth[ii] = bytes < minBytes ? minBytes : bytes; + sheet.setColumnWidth(ii, thirdWidth[ii] * 256); + ii++; + } + + // 遍历集合数据,产生数据行 + //标题 0 + SXSSFRow titleRow = sheet.createRow(0);//表头 rowIndex=0 + titleRow.createCell(0).setCellValue(title); + setBorderStyle(HSSFCellStyle.BORDER_THIN, new CellRangeAddress(0, 0, 0, 0), sheet, workbook); //给合并过的单元格加边框 + titleRow.getCell(0).setCellStyle(titleStyle); + sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, headerList.size() - 1)); + + //第二行 1 + SXSSFRow secondRow = sheet.createRow(1); //第二行 rowIndex =1 + CellRangeAddress cellRangeAddress21 = new CellRangeAddress(1, 1, 0, 2); + sheet.addMergedRegion(cellRangeAddress21); + setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress21, sheet, workbook); //给合并过的单元格加边框 + + CellRangeAddress cellRangeAddress22 = new CellRangeAddress(1, 1, 3, 5); + sheet.addMergedRegion(cellRangeAddress22); + setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress22, sheet, workbook); //给合并过的单元格加边框 + + secondRow.createCell(0).setCellValue(secondHead[0]); + secondRow.getCell(0).setCellStyle(secondStyle); + + secondRow.createCell(3).setCellValue(secondHead[1]); + secondRow.getCell(3).setCellStyle(secondStyle); + + //第三行 2 + SXSSFRow thirdRow = sheet.createRow(2); //第二行 rowIndex =1 + CellRangeAddress cellRangeAddress31 = new CellRangeAddress(2, 2, 0, 2); + sheet.addMergedRegion(cellRangeAddress31); + setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress31, sheet, workbook); //给合并过的单元格加边框 + + CellRangeAddress cellRangeAddress32 = new CellRangeAddress(2, 2, 3,5); + sheet.addMergedRegion(cellRangeAddress32); + setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress32, sheet, workbook); //给合并过的单元格加边框 + thirdRow.createCell(0).setCellValue(thirdHead[0]); + thirdRow.getCell(0).setCellStyle(thirdStyle); + + thirdRow.createCell(3).setCellValue(thirdHead[1]); + thirdRow.getCell(3).setCellStyle(thirdStyle); + + //标题 3 + SXSSFRow headerRow = sheet.createRow(3); //列头 rowIndex =1 + for (int i = 0; i < headers.length; i++) { + headerRow.createCell(i).setCellValue(headers[i]); + headerRow.getCell(i).setCellStyle(headerStyle); + } + + int seq = 1; + + //内容 + int rowIndex = 0; + for (AnswerRecordVO answerRecordVO : answerRecordVOS) { + if (rowIndex == 65535 || rowIndex == 0) { + if (rowIndex != 0) { + sheet = workbook.createSheet();//如果数据超过了,则在第二页显示 + } + rowIndex = 4;//数据内容从 rowIndex=2开始 + } + + SXSSFRow dataRow = sheet.createRow(rowIndex); + + SXSSFCell newCell = dataRow.createCell(0); + cellStyle.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(seq); + + + newCell = dataRow.createCell(1); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(answerRecordVO.getTitle()); + + + newCell = dataRow.createCell(2); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(answerRecordVO.getAnswer()); + + + newCell = dataRow.createCell(3); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(answerRecordVO.getCreateDate()); + + newCell = dataRow.createCell(4); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(answerRecordVO.getUserName()); + + //次数 + newCell = dataRow.createCell(5); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(answerRecordVO.getUpdateDate()); + + rowIndex++; + seq++; + + } + 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(); + } + } + + + //也可用以下方法 + public static void setBorderStyle(int border, CellRangeAddress region, SXSSFSheet sheet, SXSSFWorkbook wb) { + CellStyle cs = wb.createCellStyle(); // 样式对象 + cs.setBorderBottom((short) border); + cs.setBorderTop((short) border); + cs.setBorderLeft((short) border); + cs.setBorderRight((short) border); + + setRegionStyle(cs, region, sheet); + } + + private static void setRegionStyle(CellStyle cs, CellRangeAddress region, SXSSFSheet sheet) { + for (int i = region.getFirstRow(); i <= region.getLastRow(); i++) { + SXSSFRow row = sheet.getRow(i); + if (row == null) { + row = sheet.createRow(i); + } + for (int j = region.getFirstColumn(); j <= region.getLastColumn(); j++) { + SXSSFCell cell = row.getCell(j); + if (cell == null) { + cell = row.createCell(j); + cell.setCellValue(""); + } + cell.setCellStyle(cs); + } + } + } + + + private static void setStyle(CellStyle cellStyle) { + // 水平居中 + cellStyle.setAlignment(CellStyle.ALIGN_CENTER); + // 垂直居中 + cellStyle.setVerticalAlignment(CellStyle.ALIGN_CENTER); + // 边框 + cellStyle.setBorderTop(CellStyle.BORDER_THIN); + // 边框 + cellStyle.setBorderLeft(CellStyle.BORDER_THIN); + // 边框 + cellStyle.setBorderRight(CellStyle.BORDER_THIN); + // 边框 + cellStyle.setBorderBottom(CellStyle.BORDER_THIN); + } + +} 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; + +/** + * <p> + * 问题答疑表 服务实现类 + * </p> + * + * @author DengMin + * @since 2021-10-14 + */ +@Service +public class AnsweringQuestionServiceImpl extends ServiceImpl<AnsweringQuestionMapper, AnsweringQuestionDO> implements AnsweringQuestionService { + + + public IPage getCourseQuestion(GetCourseQuestionDTO getCourseQuestionDTO) { + Page pager = new Page(getCourseQuestionDTO.getPageNum(), getCourseQuestionDTO.getPageSize()); + return this.baseMapper.getCourseQuestion(pager, getCourseQuestionDTO.getClassId(), getCourseQuestionDTO.getMemberId()); + } + + public String addQuestion(AnsweringQuestionDO answeringQuestionDO) { + this.baseMapper.insert(answeringQuestionDO); + return ConstantUtils.ADD_SUCCESS; + } + + public String deleteQuestion(AnsweringQuestionDO answeringQuestionDO) { + this.baseMapper.deleteById(answeringQuestionDO.getId()); + return ConstantUtils.DELETE_SUCCESS; + } + + public String updateQuestion(AnsweringQuestionDO answeringQuestionDO) { + this.baseMapper.updateById(answeringQuestionDO); + return ConstantUtils.SET_SUCCESS; + } + + +} diff --git a/src/main/java/com/subsidy/service/impl/CategoryServiceImpl.java b/src/main/java/com/subsidy/service/impl/CategoryServiceImpl.java new file mode 100644 index 0000000..dbb014b --- /dev/null +++ b/src/main/java/com/subsidy/service/impl/CategoryServiceImpl.java @@ -0,0 +1,103 @@ +package com.subsidy.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.subsidy.common.exception.HttpException; +import com.subsidy.dto.category.GetCategoriesDTO; +import com.subsidy.model.CategoryDO; +import com.subsidy.mapper.CategoryMapper; +import com.subsidy.service.CategoryService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.subsidy.util.ConstantUtils; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * <p> + * 类目名称 服务实现类 + * </p> + * + * @author DengMin + * @since 2021-10-11 + */ +@Service +public class CategoryServiceImpl extends ServiceImpl<CategoryMapper, CategoryDO> implements CategoryService { + + public IPage<CategoryDO> getCategories(GetCategoriesDTO getCategoriesDTO) { + Page pager = new Page(getCategoriesDTO.getPageNum(), getCategoriesDTO.getPageSize()); + + if (null == getCategoriesDTO.getCompanyId()) { + return this.baseMapper.selectPage(pager, new QueryWrapper<CategoryDO>() + .lambda() + .like(CategoryDO::getName, getCategoriesDTO.getName()) + .isNull(CategoryDO::getCompanyId)); + } else { + return this.baseMapper.selectPage(pager, new QueryWrapper<CategoryDO>() + .lambda() + .like(CategoryDO::getName, getCategoriesDTO.getName()) + .eq(CategoryDO::getCompanyId, getCategoriesDTO.getCompanyId())); + } + + } + + public List<CategoryDO> getAll(GetCategoriesDTO getCategoriesDTO) { + + if (null == getCategoriesDTO.getCompanyId()) { + return this.baseMapper.selectList(new QueryWrapper<CategoryDO>() + .lambda() + .isNull(CategoryDO::getCompanyId)); + } else { + return this.baseMapper.selectList(new QueryWrapper<CategoryDO>() + .lambda() + .eq(CategoryDO::getCompanyId, getCategoriesDTO.getCompanyId())); + } + } + + + public String addCategory(CategoryDO categoryDO) { + + int count = 0; + + if (null == categoryDO.getCompanyId()) { + count = this.baseMapper.selectCount(new QueryWrapper<CategoryDO>() + .lambda() + .like(CategoryDO::getName, categoryDO.getName()) + .isNull(CategoryDO::getCompanyId)); + } else { + count = this.baseMapper.selectCount(new QueryWrapper<CategoryDO>() + .lambda() + .like(CategoryDO::getName, categoryDO.getName()) + .eq(CategoryDO::getCompanyId, categoryDO.getCompanyId())); + } + + if (count > 0) { + throw new HttpException(90001); + } + this.baseMapper.insert(categoryDO); + + return ConstantUtils.ADD_SUCCESS; + } + + public String deleteCategory(CategoryDO categoryDO) { + this.baseMapper.deleteById(categoryDO.getId()); + return ConstantUtils.DELETE_SUCCESS; + } + + public String updateCategory(CategoryDO categoryDO) { + + int count = this.baseMapper.selectCount(new QueryWrapper<CategoryDO>() + .lambda() + .eq(CategoryDO::getName, categoryDO.getName())); + + if (count > 2) { + throw new HttpException(90001); + } + + this.baseMapper.updateById(categoryDO); + return ConstantUtils.SET_SUCCESS; + } + + +} diff --git a/src/main/java/com/subsidy/service/impl/ClassDictServiceImpl.java b/src/main/java/com/subsidy/service/impl/ClassDictServiceImpl.java new file mode 100644 index 0000000..b9bf4be --- /dev/null +++ b/src/main/java/com/subsidy/service/impl/ClassDictServiceImpl.java @@ -0,0 +1,114 @@ +package com.subsidy.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.subsidy.dto.classDict.AddClassDTO; +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.mapper.RoleAdministerMappingMapper; +import com.subsidy.model.*; +import com.subsidy.mapper.ClassDictMapper; +import com.subsidy.service.ClassDictService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.subsidy.util.ConstantUtils; +import com.subsidy.vo.classdict.GetAllClassesVO; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.BeanFactory; +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; + +/** + * <p> + * 班级id 服务实现类 + * </p> + * + * @author DengMin + * @since 2021-10-12 + */ +@Service +public class ClassDictServiceImpl extends ServiceImpl<ClassDictMapper, ClassDictDO> implements ClassDictService { + + @Autowired + private ClassMemberMappingMapper classMemberMappingMapper; + + @Autowired + private RoleAdministerMappingMapper roleAdministerMappingMapper; + + + public List<GetAllClassesVO> getAllClasses(ClassDictDO classDictDO) { + return this.baseMapper.getAllClasses(classDictDO); + } + + @Transactional + public String deleteClasses(ClassDictDO classDictDO) { + this.baseMapper.deleteById(classDictDO.getId()); + + classMemberMappingMapper.delete(new QueryWrapper<ClassMemberMappingDO>() + .lambda() + .eq(ClassMemberMappingDO::getClassId, classDictDO.getId())); + return ConstantUtils.DELETE_SUCCESS; + } + + public String addClass(AddClassDTO addClassDTO) { + + //查看当前登录人的角色 + int count = roleAdministerMappingMapper.selectCount(new QueryWrapper<RoleAdministerMappingDO>() + .lambda() + .eq(RoleAdministerMappingDO::getAdministerId,addClassDTO.getUserId()) + .eq(RoleAdministerMappingDO::getRoleId,1)); + + ClassDictDO classDictDO = new ClassDictDO(); + BeanUtils.copyProperties(addClassDTO,classDictDO); + + if (count>0){ + classDictDO.setClassType("平台支持"); + }else{ + classDictDO.setClassType("企业自荐"); + } + + this.baseMapper.insert(classDictDO); + return ConstantUtils.ADD_SUCCESS; + } + + public String updateClass(ClassDictDO classDictDO) { + this.baseMapper.updateById(classDictDO); + return ConstantUtils.SET_SUCCESS; + } + + public ClassDictDO classDetail(ClassDictDO classDictDO) { + return this.baseMapper.selectById(classDictDO.getId()); + } + + public String removeMember(ClassMemberMappingDO classMemberMappingDO) { + classMemberMappingMapper.delete(new QueryWrapper<ClassMemberMappingDO>() + .lambda() + .eq(ClassMemberMappingDO::getClassId, classMemberMappingDO.getClassId()) + .eq(ClassMemberMappingDO::getMemberId, classMemberMappingDO.getMemberId())); + return ConstantUtils.DELETE_SUCCESS; + } + + public List<MemberDO> getSpareMembers(GetSpareMembersDTO getSpareMembersDTO){ + return this.baseMapper.getSpareMembers(getSpareMembersDTO); + } + + public String addMemberToClass(AddMemberToClassDTO addMemberToClassDTO){ + + List<Long> memberIds = addMemberToClassDTO.getMemberIds(); + + for (Long lg : memberIds){ + ClassMemberMappingDO classMemberMappingDO = new ClassMemberMappingDO(); + classMemberMappingDO.setClassId(addMemberToClassDTO.getClassId()); + classMemberMappingDO.setMemberId(lg); + classMemberMappingMapper.insert(classMemberMappingDO); + } + return ConstantUtils.ADD_SUCCESS; + } + +} diff --git a/src/main/java/com/subsidy/service/impl/ClassMemberMappingServiceImpl.java b/src/main/java/com/subsidy/service/impl/ClassMemberMappingServiceImpl.java new file mode 100644 index 0000000..e0947c6 --- /dev/null +++ b/src/main/java/com/subsidy/service/impl/ClassMemberMappingServiceImpl.java @@ -0,0 +1,20 @@ +package com.subsidy.service.impl; + +import com.subsidy.model.ClassMemberMappingDO; +import com.subsidy.mapper.ClassMemberMappingMapper; +import com.subsidy.service.ClassMemberMappingService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + * <p> + * 班级成员映射表 服务实现类 + * </p> + * + * @author DengMin + * @since 2021-10-12 + */ +@Service +public class ClassMemberMappingServiceImpl extends ServiceImpl<ClassMemberMappingMapper, ClassMemberMappingDO> implements ClassMemberMappingService { + +} 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..b0980ce --- /dev/null +++ b/src/main/java/com/subsidy/service/impl/CompanyDictServiceImpl.java @@ -0,0 +1,134 @@ +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.mapper.DepartmentDictMapper; +import com.subsidy.mapper.RoleAdministerMappingMapper; +import com.subsidy.model.AdministerDO; +import com.subsidy.model.CompanyDictDO; +import com.subsidy.mapper.CompanyDictMapper; +import com.subsidy.model.DepartmentDictDO; +import com.subsidy.model.RoleAdministerMappingDO; +import com.subsidy.service.CompanyDictService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.subsidy.util.ConstantUtils; +import com.subsidy.vo.administer.OperatorsVO; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * <p> + * 企业字典表 服务实现类 + * </p> + * + * @author DengMin + * @since 2021-10-25 + */ +@Service +public class CompanyDictServiceImpl extends ServiceImpl<CompanyDictMapper, CompanyDictDO> implements CompanyDictService { + + + @Autowired + private AdministerMapper administerMapper; + + @Autowired + private RoleAdministerMappingMapper roleAdministerMappingMapper; + + @Autowired + private DepartmentDictMapper departmentDictMapper; + + public IPage<OperatorsVO> operators(OperatorsDTO operatorsDTO) { + Page pager = new Page(operatorsDTO.getPageNum(), operatorsDTO.getPageSize()); + //判断该用户的角色 + Integer count = roleAdministerMappingMapper.selectCount(new QueryWrapper<RoleAdministerMappingDO>() + .lambda() + .eq(RoleAdministerMappingDO::getAdministerId,operatorsDTO.getId()) + .eq(RoleAdministerMappingDO::getRoleId,1)); + + if (count > 0){ + operatorsDTO.setId(null); + } + + return this.baseMapper.operators(pager, operatorsDTO.getCompanyName(), operatorsDTO.getId(),operatorsDTO.getUserName(),1); + } + + public String addOperator(AddCompanyDTO addCompanyDTO) { + + Integer count = this.baseMapper.selectCount(new QueryWrapper<CompanyDictDO>() + .lambda() + .eq(CompanyDictDO::getCompanyName, addCompanyDTO.getAccountName())); + + Integer count1 = administerMapper.selectCount(new QueryWrapper<AdministerDO>() + .lambda() + .eq(AdministerDO::getAccountName, addCompanyDTO.getAccountName())); + + if (count > 0 || count1>0) { + throw new HttpException(20002); + } + + CompanyDictDO companyDictDO =new CompanyDictDO(); + BeanUtils.copyProperties(addCompanyDTO,companyDictDO); + this.baseMapper.insert(companyDictDO); + + AdministerDO administerDO = new AdministerDO(); + administerDO.setAccountName(addCompanyDTO.getAccountName()); + administerDO.setCompanyId(companyDictDO.getId()); + administerDO.setPassword("admin123"); + administerDO.setStatus("1"); + administerDO.setRole(1); + administerMapper.insert(administerDO); + + RoleAdministerMappingDO roleAdministerMappingDO = new RoleAdministerMappingDO(); + roleAdministerMappingDO.setAdministerId(administerDO.getId()); + roleAdministerMappingDO.setRoleId(2L); + roleAdministerMappingMapper.insert(roleAdministerMappingDO); + + //添加默认部门 名称为公司名称 + DepartmentDictDO departmentDictDO = new DepartmentDictDO(); + departmentDictDO.setCompanyId(companyDictDO.getId()); + departmentDictDO.setDepartmentName(companyDictDO.getCompanyName()); + //departmentDictDO.setParentId(1L); + departmentDictMapper.insert(departmentDictDO); + + return ConstantUtils.ADD_SUCCESS; + } + + public String deleteAdminister(CompanyDictDO companyDictDO) { + this.baseMapper.deleteById(companyDictDO.getId()); + + administerMapper.delete(new QueryWrapper<AdministerDO>() + .lambda() + .eq(AdministerDO::getCompanyId,companyDictDO.getId())); + + return ConstantUtils.DELETE_SUCCESS; + } + + public String updateAdminister(AddCompanyDTO addCompanyDTO) { + + CompanyDictDO companyDictDO = new CompanyDictDO(); + BeanUtils.copyProperties(addCompanyDTO,companyDictDO); + this.baseMapper.updateById(companyDictDO); + + //查找企业管理员 + AdministerDO administerDO = administerMapper.selectOne(new QueryWrapper<AdministerDO>() + .lambda() + .eq(AdministerDO::getCompanyId,addCompanyDTO.getId()) + .eq(AdministerDO::getRole,1)); + if (StringUtils.isNotBlank(addCompanyDTO.getAccountName())){ + administerDO.setAccountName(addCompanyDTO.getAccountName()); + } + if (StringUtils.isBlank(addCompanyDTO.getPassword())){ + addCompanyDTO.setPassword(addCompanyDTO.getPassword()); + } + administerMapper.updateById(administerDO); + return ConstantUtils.SET_SUCCESS; + } + +} diff --git a/src/main/java/com/subsidy/service/impl/CourseContentServiceImpl.java b/src/main/java/com/subsidy/service/impl/CourseContentServiceImpl.java new file mode 100644 index 0000000..4ce8553 --- /dev/null +++ b/src/main/java/com/subsidy/service/impl/CourseContentServiceImpl.java @@ -0,0 +1,75 @@ +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; +import com.subsidy.mapper.CourseContentMapper; +import com.subsidy.model.CourseDictDO; +import com.subsidy.model.VodDictDO; +import com.subsidy.service.CourseContentService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.subsidy.util.ConstantUtils; +import com.subsidy.vo.vod.GetContendVodsVO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * <p> + * 课程目录表 服务实现类 + * </p> + * + * @author DengMin + * @since 2021-10-11 + */ +@Service +public class CourseContentServiceImpl extends ServiceImpl<CourseContentMapper, CourseContentDO> implements CourseContentService { + + public List<CourseContentDO> getContents(CourseContentDO courseContentDO) { + return this.baseMapper.selectList(new QueryWrapper<CourseContentDO>() + .lambda() + .eq(CourseContentDO::getCourseId, courseContentDO.getCourseId()) + .orderByAsc(CourseContentDO::getOrderNo) + .orderByAsc(CourseContentDO::getCreateDate)); + } + + public String deleteContent(CourseContentDO courseContentDO){ + this.baseMapper.deleteById(courseContentDO.getId()); + return ConstantUtils.DELETE_SUCCESS; + } + + public String addContent(CourseContentDO courseContentDO){ + + List<CourseContentDO> courseContentDOS = this.baseMapper.selectList(new QueryWrapper<CourseContentDO>() + .lambda() + .eq(CourseContentDO::getCourseId,courseContentDO.getCourseId()) + .orderByDesc(CourseContentDO::getOrderNo)); + + int orderNo = 1 ; + + if (courseContentDOS.size()>0){ + orderNo = courseContentDOS.get(0).getOrderNo()+1; + } + courseContentDO.setOrderNo(orderNo); + this.baseMapper.insert(courseContentDO); + return ConstantUtils.ADD_SUCCESS; + } + + public String updateContent(CourseContentDO courseContentDO){ + + List<CourseContentDO> courseContentDOS = this.baseMapper.selectList(new QueryWrapper<CourseContentDO>() + .lambda() + .eq(CourseContentDO::getCourseId,courseContentDO.getCourseId()) + .eq(CourseContentDO::getContent,courseContentDO.getContent())); + + if (courseContentDOS.size()>0){ + throw new HttpException(40001); + } + this.baseMapper.updateById(courseContentDO); + return ConstantUtils.SET_SUCCESS; + } + +} diff --git a/src/main/java/com/subsidy/service/impl/CourseDictServiceImpl.java b/src/main/java/com/subsidy/service/impl/CourseDictServiceImpl.java new file mode 100644 index 0000000..091446c --- /dev/null +++ b/src/main/java/com/subsidy/service/impl/CourseDictServiceImpl.java @@ -0,0 +1,150 @@ +package com.subsidy.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.subsidy.common.exception.HttpException; +import com.subsidy.dto.course.QueryCoursesDTO; +import com.subsidy.mapper.AdministerMapper; +import com.subsidy.mapper.CompanyDictMapper; +import com.subsidy.mapper.RoleAdministerMappingMapper; +import com.subsidy.model.AdministerDO; +import com.subsidy.model.CompanyDictDO; +import com.subsidy.model.CourseDictDO; +import com.subsidy.mapper.CourseDictMapper; +import com.subsidy.model.RoleAdministerMappingDO; +import com.subsidy.service.CompanyDictService; +import com.subsidy.service.CourseDictService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.subsidy.util.ConstantUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * <p> + * 服务实现类 + * </p> + * + * @author DengMin + * @since 2021-10-11 + */ +@Service +public class CourseDictServiceImpl extends ServiceImpl<CourseDictMapper, CourseDictDO> implements CourseDictService { + + @Autowired + private RoleAdministerMappingMapper roleAdministerMappingMapper; + + @Autowired + private AdministerMapper administerMapper; + + @Autowired + private CompanyDictMapper companyDictMapper; + + public String addCourse(CourseDictDO courseDictDO) { + + int count = 0; + + if (null != courseDictDO.getCompanyId()) { + count = this.baseMapper.selectCount(new QueryWrapper<CourseDictDO>() + .lambda() + .eq(CourseDictDO::getCourseName, courseDictDO.getCourseName()) + .isNull(CourseDictDO::getCompanyId)); + + } else { + count = this.baseMapper.selectCount(new QueryWrapper<CourseDictDO>() + .lambda() + .eq(CourseDictDO::getCourseName, courseDictDO.getCourseName()) + .eq(CourseDictDO::getCompanyId, courseDictDO.getCompanyId())); + } + + if (count > 0) { + throw new HttpException(20001); + } + + this.baseMapper.insert(courseDictDO); + return ConstantUtils.ADD_SUCCESS; + } + + public String deleteCourse(CourseDictDO courseDictDO) { + this.baseMapper.deleteById(courseDictDO.getId()); + return ConstantUtils.DELETE_SUCCESS; + } + + public IPage queryCourses(QueryCoursesDTO queryCoursesDTO) { + Page pager = new Page(queryCoursesDTO.getPageNum(), queryCoursesDTO.getPageSize()); + + //判断当前用户是运营者还是企业者 + Integer count = roleAdministerMappingMapper.selectCount(new QueryWrapper<RoleAdministerMappingDO>() + .lambda() + .eq(RoleAdministerMappingDO::getAdministerId,queryCoursesDTO.getAdministerId()) + .eq(RoleAdministerMappingDO::getRoleId,1)); + + if (count > 0){ + queryCoursesDTO.setCompanyId(null); + } + + return this.baseMapper.queryCourses(pager, queryCoursesDTO.getCourseName(), queryCoursesDTO.getCategoryId(), queryCoursesDTO.getCourseType(), queryCoursesDTO.getCourseSource(), queryCoursesDTO.getCompanyId()); + } + + public String updateCourses(CourseDictDO courseDictDO) { + int count = 0; + + if (null != courseDictDO.getCompanyId()) { + count = this.baseMapper.selectCount(new QueryWrapper<CourseDictDO>() + .lambda() + .eq(CourseDictDO::getCourseName, courseDictDO.getCourseName()) + .ne(CourseDictDO::getId, courseDictDO.getCompanyId())); + + } else { + count = this.baseMapper.selectCount(new QueryWrapper<CourseDictDO>() + .lambda() + .eq(CourseDictDO::getCourseName, courseDictDO.getCourseName()) + .isNull(CourseDictDO::getCompanyId)); + } + + if (count > 0) { + throw new HttpException(20001); + } + this.baseMapper.updateById(courseDictDO); + return ConstantUtils.DELETE_SUCCESS; + } + + public IPage queryCompanyCourse(QueryCoursesDTO queryCoursesDTO) { + Page pager = new Page(queryCoursesDTO.getPageNum(), queryCoursesDTO.getPageSize()); + + ////判断角色 + //List<RoleAdministerMappingDO> roleAdministerMappingDOS = roleAdministerMappingMapper.selectList(new QueryWrapper<RoleAdministerMappingDO>() + //.lambda() + //.eq(RoleAdministerMappingDO::getAdministerId,roleAdministerMappingMapper)); + // + //Boolean flag = false; + //for (RoleAdministerMappingDO roleAdministerMappingDO : roleAdministerMappingDOS){ + // + // if (roleAdministerMappingDO.getRoleId() ==3){ + // flag= false; + // }else if(roleAdministerMappingDO.getRoleId()==2) { + // flag = true; + // } + //} + + //List<Long> longs = new ArrayList<>(); + //if (flag){ + // //运营者账号 该企业下的所有课程 管理员 + // //获取该企业下所有老师的课程 + // AdministerDO administerDO = administerMapper.selectById(queryCoursesDTO.getAdministerId()); + // + // List<AdministerDO> administerDOS = administerMapper.selectList(new QueryWrapper<AdministerDO>() + // .lambda() + // .eq(AdministerDO::getCompanyId,administerDO.getCompanyId())); + // for (AdministerDO administerDO1 : administerDOS){ + // longs.add(administerDO1.getId()); + // } + return this.baseMapper.queryCompanyCourse(pager, queryCoursesDTO.getCourseName(), queryCoursesDTO.getCategoryId(), queryCoursesDTO.getCourseType(), queryCoursesDTO.getCourseSource(), queryCoursesDTO.getCompanyId()); + //} + + } + +} diff --git a/src/main/java/com/subsidy/service/impl/DepartmentDictServiceImpl.java b/src/main/java/com/subsidy/service/impl/DepartmentDictServiceImpl.java new file mode 100644 index 0000000..21378f0 --- /dev/null +++ b/src/main/java/com/subsidy/service/impl/DepartmentDictServiceImpl.java @@ -0,0 +1,159 @@ +package com.subsidy.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.subsidy.common.exception.HttpException; +import com.subsidy.dto.department.GetDepartmentsVO; +import com.subsidy.mapper.MemberDepartmentMappingMapper; +import com.subsidy.model.DepartmentDictDO; +import com.subsidy.mapper.DepartmentDictMapper; +import com.subsidy.model.MemberDepartmentMappingDO; +import com.subsidy.service.DepartmentDictService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.subsidy.util.ConstantUtils; +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; + +/** + * <p> + * 部门字典表 服务实现类 + * </p> + * + * @author DengMin + * @since 2021-10-11 + */ +@Service +public class DepartmentDictServiceImpl extends ServiceImpl<DepartmentDictMapper, DepartmentDictDO> implements DepartmentDictService { + + @Autowired + private MemberDepartmentMappingMapper memberDepartmentMappingMapper; + + public List<GetDepartmentsVO> getDepartments(DepartmentDictDO departmentDictDO) { + + //返回结果 + List<GetDepartmentsVO> getDepartmentsVOS = new ArrayList<>(); + + List<DepartmentDictDO> parentNodes = this.baseMapper.selectList(new QueryWrapper<DepartmentDictDO>() + .lambda() + .isNull(DepartmentDictDO::getParentId) + .eq(DepartmentDictDO::getCompanyId, departmentDictDO.getCompanyId())); + + for (DepartmentDictDO dd : parentNodes) { + + GetDepartmentsVO getDepartmentsVO = new GetDepartmentsVO(); + BeanUtils.copyProperties(dd,getDepartmentsVO); + Integer count = memberDepartmentMappingMapper.selectCount(new QueryWrapper<MemberDepartmentMappingDO>() + .lambda() + .eq(MemberDepartmentMappingDO::getDepartmentId,dd.getId())); + getDepartmentsVO.setCnt(count); + getDepartmentsVO.setChildren(getChildNodes(getDepartmentsVO)); + DepartmentDictDO departmentDictDO1 = this.baseMapper.selectById(dd.getParentId()); + if (null != departmentDictDO1){ + getDepartmentsVO.setParentDepartmentName(departmentDictDO1.getDepartmentName()); + } + getDepartmentsVOS.add(getDepartmentsVO); + } + + return getDepartmentsVOS; + } + + /** + * 递归部门列表 不包含老师信息和人数信息 + * + * @param departmentDictDO + * @return + */ + public List<GetDepartmentsVO> getChildNodes(GetDepartmentsVO departmentDictDO) { + + List<GetDepartmentsVO> getDepartmentsVOS = new ArrayList<>(); + + List<DepartmentDictDO> departmentDictDOS = this.baseMapper.selectList(new QueryWrapper<DepartmentDictDO>() + .lambda() + .eq(DepartmentDictDO::getParentId, departmentDictDO.getId())); + + for (DepartmentDictDO departmentDictDO1 : departmentDictDOS) { + + GetDepartmentsVO getDepartmentsVO = new GetDepartmentsVO(); + BeanUtils.copyProperties(departmentDictDO1,getDepartmentsVO); + getDepartmentsVO.setChildren(getChildNodes(getDepartmentsVO)); + + Integer count = memberDepartmentMappingMapper.selectCount(new QueryWrapper<MemberDepartmentMappingDO>() + .lambda() + .eq(MemberDepartmentMappingDO::getDepartmentId,getDepartmentsVO.getId())); + getDepartmentsVO.setCnt(count); + DepartmentDictDO departmentDictDO2 = this.baseMapper.selectById(departmentDictDO1.getParentId()); + if (null != departmentDictDO2){ + getDepartmentsVO.setParentDepartmentName(departmentDictDO2.getDepartmentName()); + } + getDepartmentsVOS.add(getDepartmentsVO); + } + + if (getDepartmentsVOS.size() == 0) { + return null; + } + return getDepartmentsVOS; + } + + public String addDepartment(DepartmentDictDO departmentDictDO) { + + Integer counter = this.baseMapper.selectCount(new QueryWrapper<DepartmentDictDO>() + .lambda() + .eq(DepartmentDictDO::getCompanyId, departmentDictDO.getCompanyId()) + .eq(DepartmentDictDO::getDepartmentName, departmentDictDO.getDepartmentName())); + + if (counter > 0) { + throw new HttpException(30001); + } + + this.baseMapper.insert(departmentDictDO); + + return ConstantUtils.ADD_SUCCESS; + } + + public String deleteDepartment(DepartmentDictDO departmentDictDO) { + this.baseMapper.deleteById(departmentDictDO.getId()); + + List<DepartmentDictDO> departmentDictDOS = this.baseMapper.selectList(new QueryWrapper<DepartmentDictDO>() + .lambda() + .eq(DepartmentDictDO::getParentId, departmentDictDO.getId()) + ); + + for (DepartmentDictDO departmentDictDO1:departmentDictDOS){ + deleteChildNode(departmentDictDO1); + } + + return ConstantUtils.DELETE_SUCCESS; + } + + void deleteChildNode(DepartmentDictDO departmentDictDO) { + + List<DepartmentDictDO> departmentDictDOS = this.baseMapper.selectList(new QueryWrapper<DepartmentDictDO>() + .lambda() + .eq(DepartmentDictDO::getParentId, departmentDictDO.getId())); + + for (DepartmentDictDO departmentDictDO1 : departmentDictDOS) { + deleteChildNode(departmentDictDO1); + } + this.baseMapper.deleteById(departmentDictDO.getId()); + } + + public String updateDepartment(DepartmentDictDO departmentDictDO) { + + Integer counter = this.baseMapper.selectCount(new QueryWrapper<DepartmentDictDO>() + .lambda() + .eq(DepartmentDictDO::getCompanyId, departmentDictDO.getCompanyId()) + .eq(DepartmentDictDO::getDepartmentName, departmentDictDO.getDepartmentName()) + .ne(DepartmentDictDO::getId, departmentDictDO.getId())); + + if (counter > 0) { + throw new HttpException(30001); + } + + this.baseMapper.updateById(departmentDictDO); + return ConstantUtils.SET_SUCCESS; + } + +} diff --git a/src/main/java/com/subsidy/service/impl/ExerciseDictServiceImpl.java b/src/main/java/com/subsidy/service/impl/ExerciseDictServiceImpl.java new file mode 100644 index 0000000..ffd3268 --- /dev/null +++ b/src/main/java/com/subsidy/service/impl/ExerciseDictServiceImpl.java @@ -0,0 +1,126 @@ +package com.subsidy.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.subsidy.dto.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 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; + +/** + * <p> + * 习题库 服务实现类 + * </p> + * + * @author DengMin + * @since 2021-10-12 + */ +@Service +public class ExerciseDictServiceImpl extends ServiceImpl<ExerciseDictMapper, ExerciseDictDO> implements ExerciseDictService { + + @Autowired + private ExerciseDoneResultMapper exerciseDoneResultMapper; + + public IPage<ExerciseDictDO> getAllExercises(GetAllExercisesDTO getAllExercisesDTO) { + + Page pager = new Page(getAllExercisesDTO.getPageNum(), getAllExercisesDTO.getPageSize()); + + return this.baseMapper.selectPage(pager, new QueryWrapper<ExerciseDictDO>() + .lambda() + .eq(ExerciseDictDO::getCourseId, getAllExercisesDTO.getCourseId()) + .like(ExerciseDictDO::getDifficulty, getAllExercisesDTO.getDifficulty()) + .like(ExerciseDictDO::getExerciseType, getAllExercisesDTO.getExerciseType()) + .like(ExerciseDictDO::getTitle, getAllExercisesDTO.getTitle()) + .orderByAsc(ExerciseDictDO::getOrderNo)); + } + + public String addExercise(ExerciseDictDO exerciseDictDO){ + + List<ExerciseDictDO> exerciseDictDOS = this.baseMapper.selectList(new QueryWrapper<ExerciseDictDO>() + .lambda() + .eq(ExerciseDictDO::getCourseId,exerciseDictDO.getCourseId()) + .orderByDesc(ExerciseDictDO::getOrderNo)); + + int orderNo = 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){ + this.baseMapper.deleteById(exerciseDictDO.getId()); + return ConstantUtils.DELETE_SUCCESS; + } + + public String updateExercise(ExerciseDictDO exerciseDictDO){ + this.baseMapper.updateById(exerciseDictDO); + return ConstantUtils.SET_SUCCESS; + } + + public List<ExerciseVO> getCourseExercises(CourseDictDO courseDictDO){ + + List<ExerciseVO> exerciseVOS = new ArrayList<>(); + + List<ExerciseDictDO> exerciseDictDOS = this.baseMapper.selectList(new QueryWrapper<ExerciseDictDO>() + .lambda() + .eq(ExerciseDictDO::getCourseId,courseDictDO.getId())); + + for (ExerciseDictDO exerciseDictDO : exerciseDictDOS){ + ExerciseVO exerciseVO = new ExerciseVO(); + BeanUtils.copyProperties(exerciseDictDO,exerciseVO); + exerciseVOS.add(exerciseVO); + } + return exerciseVOS; + } + + public String submit(SubmitDTO submitDTO){ + + ExerciseDoneResultDO exerciseDoneResultDO = new ExerciseDoneResultDO(); + + List<MemberExerciseVO> memberExerciseVOS = submitDTO.getMemberExerciseVOS(); + + int rightCounts = 0 ; + + for (MemberExerciseVO exerciseVO : memberExerciseVOS){ + ExerciseDictDO exerciseDictDO = this.baseMapper.selectById(exerciseVO.getId()); + if (exerciseDictDO.getRightAnswer().equals(exerciseVO.getSelectAnswer())){ + rightCounts++; + } + } + + exerciseDoneResultDO.setClassId(submitDTO.getClassId()); + exerciseDoneResultDO.setRightCounts(rightCounts); + exerciseDoneResultDO.setTotalCounts(memberExerciseVOS.size()); + exerciseDoneResultDO.setCourseId(submitDTO.getCourseId()); + exerciseDoneResultDO.setMemberId(submitDTO.getMemberId()); + + exerciseDoneResultMapper.delete(new QueryWrapper<ExerciseDoneResultDO>() + .lambda() + .eq(ExerciseDoneResultDO::getMemberId,submitDTO.getMemberId()) + .eq(ExerciseDoneResultDO::getCourseId,submitDTO.getCourseId())); + + exerciseDoneResultMapper.insert(exerciseDoneResultDO); + + return ConstantUtils.COMMIT_SUCCESS; + } + +} 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; + +/** + * <p> + * 学生课程习题完成情况 服务实现类 + * </p> + * + * @author DengMin + * @since 2021-10-15 + */ +@Service +public class ExerciseDoneResultServiceImpl extends ServiceImpl<ExerciseDoneResultMapper, ExerciseDoneResultDO> implements ExerciseDoneResultService { + +} diff --git a/src/main/java/com/subsidy/service/impl/FileDictServiceImpl.java b/src/main/java/com/subsidy/service/impl/FileDictServiceImpl.java new file mode 100644 index 0000000..7619ebf --- /dev/null +++ b/src/main/java/com/subsidy/service/impl/FileDictServiceImpl.java @@ -0,0 +1,48 @@ +package com.subsidy.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.subsidy.model.FileDictDO; +import com.subsidy.mapper.FileDictMapper; +import com.subsidy.model.VodDictDO; +import com.subsidy.service.FileDictService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.subsidy.util.ConstantUtils; +import com.subsidy.vo.vod.GetContendVodsVO; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * <p> + * 课件表 服务实现类 + * </p> + * + * @author DengMin + * @since 2021-10-11 + */ +@Service +public class FileDictServiceImpl extends ServiceImpl<FileDictMapper, FileDictDO> implements FileDictService { + + public List<FileDictDO> getContendFiles(FileDictDO fileDictDO) { + return this.baseMapper.selectList(new QueryWrapper<FileDictDO>() + .lambda() + .eq(FileDictDO::getContentId,fileDictDO.getContentId()) + .like(FileDictDO::getFileName,fileDictDO.getFileName())); + } + + public String deleteFile(FileDictDO fileDictDO) { + this.baseMapper.deleteById(fileDictDO.getId()); + return ConstantUtils.DELETE_SUCCESS; + } + + public String addFile(FileDictDO fileDictDO) { + this.baseMapper.insert(fileDictDO); + return ConstantUtils.ADD_SUCCESS; + } + + public String updateFile(FileDictDO fileDictDO) { + this.baseMapper.updateById(fileDictDO); + return ConstantUtils.SET_SUCCESS; + } + +} diff --git a/src/main/java/com/subsidy/service/impl/MemberDepartmentMappingServiceImpl.java b/src/main/java/com/subsidy/service/impl/MemberDepartmentMappingServiceImpl.java new file mode 100644 index 0000000..6e191e5 --- /dev/null +++ b/src/main/java/com/subsidy/service/impl/MemberDepartmentMappingServiceImpl.java @@ -0,0 +1,20 @@ +package com.subsidy.service.impl; + +import com.subsidy.model.MemberDepartmentMappingDO; +import com.subsidy.mapper.MemberDepartmentMappingMapper; +import com.subsidy.service.MemberDepartmentMappingService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + * <p> + * 老师部门映射表 服务实现类 + * </p> + * + * @author DengMin + * @since 2021-11-01 + */ +@Service +public class MemberDepartmentMappingServiceImpl extends ServiceImpl<MemberDepartmentMappingMapper, MemberDepartmentMappingDO> implements MemberDepartmentMappingService { + +} diff --git a/src/main/java/com/subsidy/service/impl/MemberServiceImpl.java b/src/main/java/com/subsidy/service/impl/MemberServiceImpl.java new file mode 100644 index 0000000..d5669e1 --- /dev/null +++ b/src/main/java/com/subsidy/service/impl/MemberServiceImpl.java @@ -0,0 +1,518 @@ +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.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.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.lang.reflect.Member; +import java.time.Duration; +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.List; + +/** + * <p> + * 学生表 服务实现类 + * </p> + * + * @author DengMin + * @since 2021-10-11 + */ +@Service +public class MemberServiceImpl extends ServiceImpl<MemberMapper, MemberDO> 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 ClassMemberMappingMapper classMemberMappingMapper; + + @Autowired + private ClassDictMapper classDictMapper; + + @Autowired + private CompanyDictMapper companyDictMapper; + + @Autowired + private MemberDepartmentMappingMapper memberDepartmentMappingMapper; + + public IPage<GetAllVO> getAll(GetAllDTO getAllDTO) { + Page pager = new Page(getAllDTO.getPageNum(), getAllDTO.getPageSize()); + IPage iPage = this.baseMapper.getMembers(pager, getAllDTO.getDepartmentId(), getAllDTO.getUserName(), getAllDTO.getStatus()); + + List<GetAllVO> getAllVOS = iPage.getRecords(); + for (GetAllVO getAllVO : getAllVOS) { + List<DepartmentDictDO> departmentDictDOS = this.baseMapper.getDepartments(getAllVO.getId()); + getAllVO.setDepartmentDictDOS(departmentDictDOS); + } + return iPage; + } + + public String deleteMember(MemberDO memberDO) { + this.baseMapper.deleteById(memberDO.getId()); + return ConstantUtils.DELETE_SUCCESS; + } + + public String addMember(AddMemberDTO addMemberDTO) { + + Integer count = this.baseMapper.selectCount(new QueryWrapper<MemberDO>() + .lambda() + .eq(MemberDO::getTelephone, addMemberDTO.getTelephone())); + + if (count > 0) { + throw new HttpException(20002); + } + + Integer count1 = this.baseMapper.selectCount(new QueryWrapper<MemberDO>() + .lambda() + .eq(MemberDO::getAccountName, addMemberDTO.getAccountName()) + .eq(MemberDO::getDepartmentId, addMemberDTO.getDepartmentId())); + + if (count1 > 0) { + throw new HttpException(20002); + } + + MemberDO memberDO = new MemberDO(); + BeanUtils.copyProperties(addMemberDTO, memberDO); + memberDO.setPassword("123456"); + memberDO.setStatus("启用"); + this.baseMapper.insert(memberDO); + + //部门 + List<Long> longs = addMemberDTO.getDepartmentIds(); + for (Long lg : longs) { + MemberDepartmentMappingDO memberDepartmentMappingDO = new MemberDepartmentMappingDO(); + memberDepartmentMappingDO.setMemberId(memberDO.getId()); + memberDepartmentMappingDO.setDepartmentId(lg); + memberDepartmentMappingMapper.insert(memberDepartmentMappingDO); + } + + return ConstantUtils.ADD_SUCCESS; + } + + public String updateMember(AddMemberDTO addMemberDTO) { + + if (null!= addMemberDTO.getDepartmentIds()){ + Integer count = this.baseMapper.selectCount(new QueryWrapper<MemberDO>() + .lambda() + .eq(MemberDO::getTelephone, addMemberDTO.getTelephone()) + .eq(MemberDO::getDepartmentId, addMemberDTO.getDepartmentId()) + .ne(MemberDO::getId, addMemberDTO.getId())); + + if (count > 0) { + throw new HttpException(20002); + } + Integer count1 = this.baseMapper.selectCount(new QueryWrapper<MemberDO>() + .lambda() + .eq(MemberDO::getAccountName, addMemberDTO.getAccountName()) + .eq(MemberDO::getDepartmentId, addMemberDTO.getDepartmentId()) + .ne(MemberDO::getId, addMemberDTO.getId())); + + if (count1 > 0) { + throw new HttpException(20002); + } + } + + MemberDO memberDO = new MemberDO(); + BeanUtils.copyProperties(addMemberDTO, memberDO); + this.baseMapper.updateById(memberDO); + + if (null != addMemberDTO.getDepartmentIds()){ + memberDepartmentMappingMapper.delete(new QueryWrapper<MemberDepartmentMappingDO>() + .lambda() + .eq(MemberDepartmentMappingDO::getMemberId, addMemberDTO.getId())); + + //部门 + List<Long> longs = addMemberDTO.getDepartmentIds(); + for (Long lg : longs) { + MemberDepartmentMappingDO memberDepartmentMappingDO = new MemberDepartmentMappingDO(); + memberDepartmentMappingDO.setMemberId(memberDO.getId()); + memberDepartmentMappingDO.setDepartmentId(lg); + memberDepartmentMappingMapper.insert(memberDepartmentMappingDO); + } + } + + 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<MemberDO>() + .lambda() + .eq(MemberDO::getTelephone, verifyCodeDTO.getTelephone())); + if (userRoleDO == null) { + throw new HttpException(10010); + } + + if ("冻结".equals(userRoleDO.getStatus())){ + throw new HttpException(10013); + } + + BeanUtils.copyProperties(userRoleDO, userRoleVO); + + SmsVerifyCodeDO smsCodeDO = smsVerifyCodeMapper.selectOne(new QueryWrapper<SmsVerifyCodeDO>() + .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<MemberDO>() + .lambda() + .eq(MemberDO::getPassword, memberDO.getPassword()) + .eq(MemberDO::getAccountName, memberDO.getAccountName())); + if (memberDO1 == null) { + throw new HttpException(10004); + } + + if ("冻结".equals(memberDO1.getStatus())){ + throw new HttpException(10014); + } + + 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<StudyPageVO> studyPageVOS = this.baseMapper.studyPage(memberDO); + + for (StudyPageVO studyPageVO : studyPageVOS) { + + //查看课程下有几节课 + List<VodDictDO> vodDictDOS = courseContentMapper.getCourseVods(studyPageVO.getId()); + studyPageVO.setTotalVods(vodDictDOS.size()); + + int i = 0; + + //该成员完成了几个视频 + for (VodDictDO vodDictDO : vodDictDOS) { + List<VodPlayHistoryDO> vodPlayHistoryDOS = vodPlayHistoryMapper.selectList(new QueryWrapper<VodPlayHistoryDO>() + .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<ClassMemberMappingDO> classMemberMappingDOS = classMemberMappingMapper.selectList(new QueryWrapper<ClassMemberMappingDO>() + .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<VodPlayHistoryDO> vodPlayHistoryDOS = vodPlayHistoryMapper.selectList(new QueryWrapper<VodPlayHistoryDO>() + .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; + } + } else { + flag = false; + } + } + if (flag) { + completedCnt++; + } + } + studyPageVO.setDoneMember(completedCnt); + } + + memberStudyPageVO.setStudyPageVOS(studyPageVOS); + + List<DepartmentDictDO> departmentDictDOS = this.baseMapper.getDepartments(memberDO.getId()); + + if (departmentDictDOS.size() > 0) { + CompanyDictDO companyDictDO = companyDictMapper.selectById(departmentDictDOS.get(0).getId()); + if (null != companyDictDO) { + BeanUtils.copyProperties(companyDictDO, memberStudyPageVO); + } + } + return memberStudyPageVO; + } + + public ContentVodNewVO contentVod(ContentMemberDTO contentVodDTO) { + + ContentVodNewVO contentVodNewVO = new ContentVodNewVO(); + + List<ContentVodVO> contentVodVOS = new ArrayList<>(); + List<CourseContentDO> courseContentDOS = courseContentMapper.selectList(new QueryWrapper<CourseContentDO>() + .lambda() + .eq(CourseContentDO::getCourseId, contentVodDTO.getCourseId()) + .orderByAsc(CourseContentDO::getOrderNo)); + + for (CourseContentDO courseContentDO : courseContentDOS) { + ContentVodVO contentVodVO = new ContentVodVO(); + contentVodVO.setContent(courseContentDO.getContent()); + + List<MemberVodVO> memberVodVOS = new ArrayList<>(); + + //目录下的视频 + List<VodDictDO> vodDictDOS = vodDictMapper.selectList(new QueryWrapper<VodDictDO>() + .lambda() + .eq(VodDictDO::getContentId, courseContentDO.getId())); + for (VodDictDO vodDictDO : vodDictDOS) { + MemberVodVO memberVodVO = new MemberVodVO(); + List<VodPlayHistoryDO> vodPlayHistoryDOS = vodPlayHistoryMapper.selectList(new QueryWrapper<VodPlayHistoryDO>() + .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<VodPlayHistoryDO> vodPlayHistoryDOS1 = vodPlayHistoryMapper.selectList(new QueryWrapper<VodPlayHistoryDO>() + .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); + } + + 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){ + VodPlayHistoryDO vodPlayHistoryDO = vodPlayHistoryDOS.get(0); + VodDictDO vodDictDO = vodDictMapper.selectById(vodPlayHistoryDO.getVodId()); + if (null!=vodDictDO){ + BeanUtils.copyProperties(vodDictDO,contentVodNewVO); + contentVodNewVO.setPlayRecord(vodPlayHistoryDO.getPlayRecord()); + } + } + return contentVodNewVO; + } + + public List<ContentFilesVO> contentFiles(ContentMemberDTO contentMemberDTO) { + + List<ContentFilesVO> contentFilesVOS = new ArrayList<>(); + + List<CourseContentDO> courseContentDOS = courseContentMapper.selectList(new QueryWrapper<CourseContentDO>() + .lambda() + .eq(CourseContentDO::getCourseId, contentMemberDTO.getCourseId()) + .orderByAsc(CourseContentDO::getOrderNo)); + + for (CourseContentDO courseContentDO : courseContentDOS) { + + ContentFilesVO contentFilesVO = new ContentFilesVO(); + contentFilesVO.setContent(courseContentDO.getContent()); + + List<FileDictDO> fileDictDOS = fileDictMapper.selectList(new QueryWrapper<FileDictDO>() + .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<StudyHistoryVO> 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(); + + ClassDictDO classDictDO = classDictMapper.selectById(contentMemberDTO.getClassId()); + + CourseDictDO courseDictDO = courseDictMapper.selectById(classDictDO.getCourseId()); + getCourseTestVO.setCourseId(courseDictDO.getId()); + getCourseTestVO.setCourseName(courseDictDO.getCourseName()); + getCourseTestVO.setDeadline(classDictDO.getEndDate()); + + ExerciseDoneResultDO exerciseDoneResultDO = exerciseDoneResultMapper.selectOne(new QueryWrapper<ExerciseDoneResultDO>() + .lambda() + .eq(ExerciseDoneResultDO::getCourseId, courseDictDO.getId()) + .eq(ExerciseDoneResultDO::getMemberId, contentMemberDTO.getMemberId())); + + if (null != exerciseDoneResultDO) { + getCourseTestVO.setRightCount(String.valueOf(exerciseDoneResultDO.getRightCounts())); + getCourseTestVO.setTotalCount(String.valueOf(exerciseDoneResultDO.getTotalCounts())); + + //正确率 + Integer percent = MathUtil.intDivFloorPercent(exerciseDoneResultDO.getRightCounts(),exerciseDoneResultDO.getTotalCounts()); + if(percent>=60){ + getCourseTestVO.setResult("合格"); + }else { + getCourseTestVO.setResult("不合格"); + } + getCourseTestVO.setPercent(String.valueOf(percent)); + } else { + getCourseTestVO.setRightCount("-"); + //该课程下有多少习题 + Integer count = exerciseDictMapper.selectCount(new QueryWrapper<ExerciseDictDO>() + .lambda() + .eq(ExerciseDictDO::getCourseId, courseDictDO.getId())); + getCourseTestVO.setTotalCount(String.valueOf(count)); + getCourseTestVO.setPercent("-"); + getCourseTestVO.setResult("不合格"); + } + 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<ClassMemberMappingDO> classMemberMappingDOS = classMemberMappingMapper.selectList(new QueryWrapper<ClassMemberMappingDO>() + .lambda() + .eq(ClassMemberMappingDO::getMemberId, memberDO.getId())); + /** + * 遍历课程,里面的视频都看过80% 则表示已学完 + */ + int i = 0; //已学课程 + for (ClassMemberMappingDO classMemberMappingDO : classMemberMappingDOS) { + List<VodDictDO> vodDictDOS = classDictMapper.getClassVods(classMemberMappingDO.getClassId()); + for (VodDictDO vodDictDO : vodDictDOS) { + List<VodPlayHistoryDO> vodPlayHistoryDOS = vodPlayHistoryMapper.selectList(new QueryWrapper<VodPlayHistoryDO>() + .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) { + break; + } + } + } + i++; + } + getStudyInfoVO.setStudyCourse(i); + + //累计学习时长 + int studyLength = 0; + List<VodPlayHistoryDO> vodPlayHistoryDOS = vodPlayHistoryMapper.selectList(new QueryWrapper<VodPlayHistoryDO>() + .lambda() + .eq(VodPlayHistoryDO::getMemberId, memberDO.getId())); + + for (VodPlayHistoryDO vodPlayHistoryDO : vodPlayHistoryDOS) { + studyLength += vodPlayHistoryDO.getPlayLength(); + } + getStudyInfoVO.setStudyLength(studyLength); + + return getStudyInfoVO; + } + +} diff --git a/src/main/java/com/subsidy/service/impl/PermissionsDictServiceImpl.java b/src/main/java/com/subsidy/service/impl/PermissionsDictServiceImpl.java new file mode 100644 index 0000000..42f5f20 --- /dev/null +++ b/src/main/java/com/subsidy/service/impl/PermissionsDictServiceImpl.java @@ -0,0 +1,20 @@ +package com.subsidy.service.impl; + +import com.subsidy.model.PermissionsDictDO; +import com.subsidy.mapper.PermissionsDictMapper; +import com.subsidy.service.PermissionsDictService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + * <p> + * 权限表 服务实现类 + * </p> + * + * @author DengMin + * @since 2021-10-11 + */ +@Service +public class PermissionsDictServiceImpl extends ServiceImpl<PermissionsDictMapper, PermissionsDictDO> implements PermissionsDictService { + +} diff --git a/src/main/java/com/subsidy/service/impl/RoleAdministerMappingServiceImpl.java b/src/main/java/com/subsidy/service/impl/RoleAdministerMappingServiceImpl.java new file mode 100644 index 0000000..8c3ba95 --- /dev/null +++ b/src/main/java/com/subsidy/service/impl/RoleAdministerMappingServiceImpl.java @@ -0,0 +1,20 @@ +package com.subsidy.service.impl; + +import com.subsidy.model.RoleAdministerMappingDO; +import com.subsidy.mapper.RoleAdministerMappingMapper; +import com.subsidy.service.RoleAdministerMappingService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + * <p> + * 服务实现类 + * </p> + * + * @author DengMin + * @since 2021-10-11 + */ +@Service +public class RoleAdministerMappingServiceImpl extends ServiceImpl<RoleAdministerMappingMapper, RoleAdministerMappingDO> implements RoleAdministerMappingService { + +} diff --git a/src/main/java/com/subsidy/service/impl/RoleDictServiceImpl.java b/src/main/java/com/subsidy/service/impl/RoleDictServiceImpl.java new file mode 100644 index 0000000..772bff8 --- /dev/null +++ b/src/main/java/com/subsidy/service/impl/RoleDictServiceImpl.java @@ -0,0 +1,20 @@ +package com.subsidy.service.impl; + +import com.subsidy.model.RoleDictDO; +import com.subsidy.mapper.RoleDictMapper; +import com.subsidy.service.RoleDictService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + * <p> + * 角色表 服务实现类 + * </p> + * + * @author DengMin + * @since 2021-10-11 + */ +@Service +public class RoleDictServiceImpl extends ServiceImpl<RoleDictMapper, RoleDictDO> implements RoleDictService { + +} diff --git a/src/main/java/com/subsidy/service/impl/RolePermissionMappingServiceImpl.java b/src/main/java/com/subsidy/service/impl/RolePermissionMappingServiceImpl.java new file mode 100644 index 0000000..6c33b85 --- /dev/null +++ b/src/main/java/com/subsidy/service/impl/RolePermissionMappingServiceImpl.java @@ -0,0 +1,20 @@ +package com.subsidy.service.impl; + +import com.subsidy.model.RolePermissionMappingDO; +import com.subsidy.mapper.RolePermissionMappingMapper; +import com.subsidy.service.RolePermissionMappingService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + * <p> + * 系统用户角色表 服务实现类 + * </p> + * + * @author DengMin + * @since 2021-10-11 + */ +@Service +public class RolePermissionMappingServiceImpl extends ServiceImpl<RolePermissionMappingMapper, RolePermissionMappingDO> implements RolePermissionMappingService { + +} diff --git a/src/main/java/com/subsidy/service/impl/SignInRecordServiceImpl.java b/src/main/java/com/subsidy/service/impl/SignInRecordServiceImpl.java new file mode 100644 index 0000000..8459e40 --- /dev/null +++ b/src/main/java/com/subsidy/service/impl/SignInRecordServiceImpl.java @@ -0,0 +1,192 @@ +package com.subsidy.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.subsidy.dto.member.GetMemberSignInfoDTO; +import com.subsidy.dto.sign.ClassSignInfoDTO; +import com.subsidy.dto.sign.SignInDTO; +import com.subsidy.mapper.*; +import com.subsidy.model.*; +import com.subsidy.service.SignInRecordService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.subsidy.util.ConstantUtils; +import com.subsidy.util.MathUtil; +import com.subsidy.vo.member.GetMemberSignInfoVO; +import com.subsidy.vo.sign.ClassSignInfoVO; +import com.subsidy.vo.sign.SignInStatusVO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.util.List; + +/** + * <p> + * 学生签到表 服务实现类 + * </p> + * + * @author DengMin + * @since 2021-10-18 + */ +@Service +public class SignInRecordServiceImpl extends ServiceImpl<SignInRecordMapper, SignInRecordDO> implements SignInRecordService { + + @Autowired + private ClassMemberMappingMapper classMemberMappingMapper; + + @Autowired + private ClassDictMapper classDictMapper; + + @Autowired + private VodPlayHistoryMapper vodPlayHistoryMapper; + + @Autowired + private ExerciseDoneResultMapper exerciseDoneResultMapper; + + @Autowired + private AnsweringQuestionMapper answeringQuestionMapper; + + public IPage<GetMemberSignInfoVO> getMemberSignInfo(GetMemberSignInfoDTO getMemberSignInfoDTO) { + Page pager = new Page(getMemberSignInfoDTO.getPageNum(), getMemberSignInfoDTO.getPageSize()); + + return this.baseMapper.selectPage(pager, new QueryWrapper<SignInRecordDO>() + .lambda() + .eq(SignInRecordDO::getMemberId, getMemberSignInfoDTO.getId()) + .orderByDesc(SignInRecordDO::getCreateDate)); + } + + public String signIn(SignInRecordDO signInRecordDO) { + + /** + * 查看学生所有在读班级 + */ + List<ClassDictDO> classDictDOS = classMemberMappingMapper.getMemberClass(signInRecordDO.getMemberId()); + + this.baseMapper.delete(new QueryWrapper<SignInRecordDO>() + .lambda() + .eq(SignInRecordDO::getMemberId, signInRecordDO.getMemberId()) + .gt(SignInRecordDO::getSignInDate, LocalDate.now())); + + for (ClassDictDO classDictDO : classDictDOS) { + SignInRecordDO signInRecordDO1 = new SignInRecordDO(); + signInRecordDO1.setClassId(classDictDO.getId()); + signInRecordDO1.setMemberId(signInRecordDO.getMemberId()); + signInRecordDO1.setSignInDate(LocalDateTime.now()); + this.baseMapper.insert(signInRecordDO1); + } + + return ConstantUtils.ADD_SUCCESS; + } + + public IPage classSignInfo(ClassSignInfoDTO classSignInfoDTO) { + + Page pager = new Page(classSignInfoDTO.getPageNum(), classSignInfoDTO.getPageSize()); + + IPage<ClassSignInfoVO> classSignInfoVOIPage = this.baseMapper.classSignInfo(pager, classSignInfoDTO.getClassName(), classSignInfoDTO.getCourseName(), classSignInfoDTO.getCompanyId()); + List<ClassSignInfoVO> classSignInfoVOS = classSignInfoVOIPage.getRecords(); + + for (ClassSignInfoVO classSignInfoVO : classSignInfoVOS) { + + //班级人数 + List<ClassMemberMappingDO> classMemberMappingDOS = classMemberMappingMapper.selectList(new QueryWrapper<ClassMemberMappingDO>() + .lambda() + .eq(ClassMemberMappingDO::getClassId, classSignInfoVO.getClassId())); + + classSignInfoVO.setMemberCount(classMemberMappingDOS.size()); + + + //课程总数 + List<VodDictDO> vodDictDOS = classDictMapper.getClassVods(classSignInfoVO.getClassId()); + classSignInfoVO.setTotalVodCounts(vodDictDOS.size()); + + + int totalStudyVods = 0; + int totalStudyLength = 0; + //学生总共学习课时数 + for (VodDictDO vodDictDO : vodDictDOS) { + for (ClassMemberMappingDO classMemberMappingDO : classMemberMappingDOS) { + List<VodPlayHistoryDO> vodPlayHistoryDOS = vodPlayHistoryMapper.selectList(new QueryWrapper<VodPlayHistoryDO>() + .lambda() + .eq(VodPlayHistoryDO::getMemberId, classMemberMappingDO.getMemberId()) + .eq(VodPlayHistoryDO::getVodId, vodDictDO.getId()) + .orderByDesc(VodPlayHistoryDO::getPlayRecord)); + for (VodPlayHistoryDO vodPlayHistoryDO : vodPlayHistoryDOS) { + totalStudyLength += vodPlayHistoryDO.getPlayLength(); + } + if (vodPlayHistoryDOS.size() > 0) { + if (vodPlayHistoryDOS.get(0).getPlayRecord() >= vodDictDO.getVodLength() * 0.8) { + totalStudyVods++; + } + } + } + } + classSignInfoVO.setStudyVodCounts(MathUtil.intDivCeil(totalStudyVods, classMemberMappingDOS.size() )); + + //平均完成时长 学生观看课程视频的全部时长/总人数 + int avg = MathUtil.intDivCeil(totalStudyLength, classMemberMappingDOS.size()); + classSignInfoVO.setAvgVodPlayLength(avg); + + //测试通过率 + List<ExerciseDoneResultDO> exerciseDoneResultDOS = exerciseDoneResultMapper.selectList(new QueryWrapper<ExerciseDoneResultDO>() + .lambda() + .eq(ExerciseDoneResultDO::getClassId, classSignInfoVO.getClassId())); + + int passNum = 0; + + for (ExerciseDoneResultDO exerciseDoneResultDO : exerciseDoneResultDOS) { + if (exerciseDoneResultDO.getRightCounts() > exerciseDoneResultDO.getTotalCounts() * 0.6) { + passNum++; + } + } + classSignInfoVO.setPassRate(MathUtil.intDivFloorPercent(passNum, classMemberMappingDOS.size())); + + + //平均签到数 向上取整 + //签到总次数 + Integer signCount = this.baseMapper.selectCount(new QueryWrapper<SignInRecordDO>() + .lambda() + .eq(SignInRecordDO::getClassId, classSignInfoVO.getClassId())); + classSignInfoVO.setAvgSignCount(MathUtil.intDivCeil(signCount, classMemberMappingDOS.size())); + + //答疑数 + Integer count = answeringQuestionMapper.selectCount(new QueryWrapper<AnsweringQuestionDO>() + .lambda() + .eq(AnsweringQuestionDO::getClassId, classSignInfoVO.getClassId())); + classSignInfoVO.setAnswerCount(count); + } + + classSignInfoVOIPage.setRecords(classSignInfoVOS); + return classSignInfoVOIPage; + } + + + public SignInStatusVO signInStatus(SignInRecordDO signInRecordDO) { + + SignInStatusVO signInStatusVO = new SignInStatusVO(); + + Boolean flag = true; + + //获取有效课程 + List<ClassDictDO> classDictDOS = classMemberMappingMapper.getMemberClass(signInRecordDO.getMemberId()); + + + for (ClassDictDO classDictDO : classDictDOS) { + Integer count = this.baseMapper.selectCount(new QueryWrapper<SignInRecordDO>() + .lambda() + .eq(SignInRecordDO::getClassId, classDictDO.getId()) + .eq(SignInRecordDO::getMemberId, signInRecordDO.getMemberId()) + .gt(SignInRecordDO::getSignInDate, LocalDate.now())); + + if (count == 0) { + flag = false; + } + + } + + signInStatusVO.setStatus(flag); + return signInStatusVO; + } + +} diff --git a/src/main/java/com/subsidy/service/impl/SmsVerifyCodeServiceImpl.java b/src/main/java/com/subsidy/service/impl/SmsVerifyCodeServiceImpl.java new file mode 100644 index 0000000..c135d69 --- /dev/null +++ b/src/main/java/com/subsidy/service/impl/SmsVerifyCodeServiceImpl.java @@ -0,0 +1,55 @@ +package com.subsidy.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.subsidy.common.exception.HttpException; +import com.subsidy.dto.sms.SendVerifyCodeDTO; +import com.subsidy.mapper.MemberMapper; +import com.subsidy.model.MemberDO; +import com.subsidy.model.SmsVerifyCodeDO; +import com.subsidy.mapper.SmsVerifyCodeMapper; +import com.subsidy.service.MemberService; +import com.subsidy.service.SmsVerifyCodeService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.subsidy.util.RandomUtil; +import com.subsidy.util.SMSUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.lang.reflect.Member; + +/** + * <p> + * 短信验证码记录表 服务实现类 + * </p> + * + * @author DengMin + * @since 2021-10-14 + */ +@Service +public class SmsVerifyCodeServiceImpl extends ServiceImpl<SmsVerifyCodeMapper, SmsVerifyCodeDO> implements SmsVerifyCodeService { + + @Autowired + private SMSUtils smsUtils; + + @Autowired + private MemberMapper memberMapper; + + public void sendVerifyCode(SendVerifyCodeDTO sendVerifyCodeDTO){ + MemberDO memberDO =memberMapper.selectOne(new QueryWrapper<MemberDO>() + .lambda() + .eq(MemberDO::getTelephone, sendVerifyCodeDTO.getTelephone())); + if(memberDO == null) { + throw new HttpException(70012); + } + + String code = RandomUtil.getRandomCode(6); + smsUtils.send(sendVerifyCodeDTO.getTelephone(), code); + + SmsVerifyCodeDO smsCodeDO = new SmsVerifyCodeDO(); + smsCodeDO.setVerifyCode(code); + smsCodeDO.setTelephone(sendVerifyCodeDTO.getTelephone()); + this.baseMapper.insert(smsCodeDO); + + } + +} diff --git a/src/main/java/com/subsidy/service/impl/VodDictServiceImpl.java b/src/main/java/com/subsidy/service/impl/VodDictServiceImpl.java new file mode 100644 index 0000000..d3bc1a3 --- /dev/null +++ b/src/main/java/com/subsidy/service/impl/VodDictServiceImpl.java @@ -0,0 +1,80 @@ +package com.subsidy.service.impl; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.subsidy.common.configure.VODConfig; +import com.subsidy.dto.content.GetContendVodsDTO; +import com.subsidy.model.VodDictDO; +import com.subsidy.mapper.VodDictMapper; +import com.subsidy.service.VodDictService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.subsidy.util.ConstantUtils; +import com.subsidy.util.Signature; +import com.subsidy.vo.vod.GetContendVodsVO; +import com.subsidy.vo.vod.SignatureVO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.Random; + +/** + * <p> + * 视频表 服务实现类 + * </p> + * + * @author DengMin + * @since 2021-10-11 + */ +@Service +public class VodDictServiceImpl extends ServiceImpl<VodDictMapper, VodDictDO> implements VodDictService { + + @Autowired + private VODConfig vodConfig; + + + public SignatureVO signature() throws Exception { +// + SignatureVO signatureVO = new SignatureVO(); + + Signature signature = new Signature(); + signature.setSecretId(vodConfig.getSecretId()); + signature.setSecretKey(vodConfig.getSecretKey()); + signature.setCurrentTime(System.currentTimeMillis()); + signature.setRandom(new Random().nextInt(Integer.MAX_VALUE)); + signature.setSignValidDuration(3600 * 24 * 2); + + String sign = ""; + try { + sign = signature.getUploadSignature(); + signatureVO.setSign(sign); + } catch (Exception ex) { + ex.printStackTrace(); +// throw new MyException(ResultEnum.UNKNOWN_ERROR); + } + return signatureVO; + } + + public IPage<GetContendVodsVO> getContendVods(GetContendVodsDTO getContendVodsDTO) { + Page pager = new Page(getContendVodsDTO.getPageNum(), getContendVodsDTO.getPageSize()); + return this.baseMapper.getContendVods(pager,getContendVodsDTO.getVodName(),getContendVodsDTO.getContentId()); + } + + public String deleteVod(VodDictDO vodDictDO) { + this.baseMapper.deleteById(vodDictDO.getId()); + return ConstantUtils.DELETE_SUCCESS; + } + + public String addVod(VodDictDO vodDictDO) { + this.baseMapper.insert(vodDictDO); + return ConstantUtils.ADD_SUCCESS; + } + + public String updateVod(VodDictDO vodDictDO) { + this.baseMapper.updateById(vodDictDO); + return ConstantUtils.SET_SUCCESS; + } + + + +} diff --git a/src/main/java/com/subsidy/service/impl/VodPlayHistoryServiceImpl.java b/src/main/java/com/subsidy/service/impl/VodPlayHistoryServiceImpl.java new file mode 100644 index 0000000..b29fe46 --- /dev/null +++ b/src/main/java/com/subsidy/service/impl/VodPlayHistoryServiceImpl.java @@ -0,0 +1,26 @@ +package com.subsidy.service.impl; + +import com.subsidy.model.VodPlayHistoryDO; +import com.subsidy.mapper.VodPlayHistoryMapper; +import com.subsidy.service.VodPlayHistoryService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.subsidy.util.ConstantUtils; +import org.springframework.stereotype.Service; + +/** + * <p> + * 视频播放历史记录表 服务实现类 + * </p> + * + * @author DengMin + * @since 2021-10-14 + */ +@Service +public class VodPlayHistoryServiceImpl extends ServiceImpl<VodPlayHistoryMapper, VodPlayHistoryDO> implements VodPlayHistoryService { + + public String insertHistory(VodPlayHistoryDO vodPlayHistoryDO) { + this.baseMapper.insert(vodPlayHistoryDO); + return ConstantUtils.ADD_SUCCESS; + } + +} diff --git a/src/main/java/com/subsidy/util/BaseModel.java b/src/main/java/com/subsidy/util/BaseModel.java new file mode 100644 index 0000000..7504dd0 --- /dev/null +++ b/src/main/java/com/subsidy/util/BaseModel.java @@ -0,0 +1,35 @@ +package com.subsidy.util; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.FieldStrategy; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableLogic; +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.time.LocalDateTime; + +@Data +public abstract class BaseModel { + + /** + * 创建时间 + */ + @JsonIgnore + @TableField(insertStrategy = FieldStrategy.NEVER, updateStrategy = FieldStrategy.NEVER, value = "create_date", fill = FieldFill.INSERT) + private LocalDateTime createDate; + + /** + * 更新时间 + */ + @JsonIgnore + @TableField(insertStrategy = FieldStrategy.NEVER, updateStrategy = FieldStrategy.NEVER, value = "update_date", fill = FieldFill.UPDATE) + private LocalDateTime updateDate; + + /** + * 删除时间 + */ + @JsonIgnore + @TableLogic + private LocalDateTime deleteDate; +} diff --git a/src/main/java/com/subsidy/util/CodeGenerator.java b/src/main/java/com/subsidy/util/CodeGenerator.java new file mode 100644 index 0000000..ae1381a --- /dev/null +++ b/src/main/java/com/subsidy/util/CodeGenerator.java @@ -0,0 +1,124 @@ +package com.subsidy.util; + +import com.baomidou.mybatisplus.annotation.DbType; +import com.baomidou.mybatisplus.core.exceptions.MybatisPlusException; +import com.baomidou.mybatisplus.core.toolkit.StringPool; +import com.baomidou.mybatisplus.core.toolkit.StringUtils; +import com.baomidou.mybatisplus.generator.AutoGenerator; +import com.baomidou.mybatisplus.generator.InjectionConfig; +import com.baomidou.mybatisplus.generator.config.*; +import com.baomidou.mybatisplus.generator.config.po.TableInfo; +import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy; +import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine; + +import java.util.ArrayList; +import java.util.List; +import java.util.ResourceBundle; +import java.util.Scanner; + +/** + * Mybatis-Plus CodeGenerator + * + * @author DengMin + * @date 2020/07/02 + **/ +public class CodeGenerator { + + public static String scanner(String tip) { + StringBuilder help = new StringBuilder(); + help.append("1.生成全部表 2.输入需要生成表名"); + System.out.println(help.toString()); + Scanner scanner = new Scanner(System.in); + Integer ipt = Integer.valueOf(scanner.next()); + if(ipt == 1) { + return ""; + } else if(ipt == 2) { + StringBuilder help1 = new StringBuilder(); + help1.append("请输入" + tip + ":"); + System.out.println(help1.toString()); + Scanner scanner1 = new Scanner(System.in); + if (scanner1.hasNext()) { + String name = scanner1.next(); + if (StringUtils.isNotEmpty(name)) { + return name; + } + } + throw new MybatisPlusException("请输入正确的" + tip + "!"); + } + return scanner(tip); + } + + public static void main(String[] args) { + final ResourceBundle rb = ResourceBundle.getBundle("mybatis-plus"); + // 代码生成器 + AutoGenerator mpg = new AutoGenerator(); + + // 全局配置 + GlobalConfig gc = new GlobalConfig(); + gc.setOutputDir(System.getProperty("user.dir") + rb.getString("outputDir")); + gc.setOpen(false); + gc.setBaseResultMap(true); + gc.setBaseColumnList(true); + gc.setAuthor(rb.getString("author")); + gc.setMapperName("%sMapper"); + gc.setEntityName("%sDO"); + gc.setServiceName("%sService"); + gc.setServiceImplName("%sServiceImpl"); + gc.setControllerName("%sController"); + mpg.setGlobalConfig(gc); + + // 数据源配置 + DataSourceConfig dsc = new DataSourceConfig(); + dsc.setDbType(DbType.MYSQL); + dsc.setUrl(rb.getString("url")); + dsc.setDriverName(rb.getString("driverName")); + dsc.setUsername(rb.getString("userName")); + dsc.setPassword(rb.getString("password")); + mpg.setDataSource(dsc); + + // 包配置 + PackageConfig pc = new PackageConfig(); + pc.setParent(rb.getString("setParent")); + pc.setController("controller"); + pc.setService("service"); + pc.setServiceImpl("service.impl"); + pc.setEntity("model"); + pc.setMapper("mapper"); + mpg.setPackageInfo(pc); + + // 自定义配置 + InjectionConfig cfg = new InjectionConfig() { + @Override + public void initMap() { + // to do nothing + } + }; + List<FileOutConfig> focList = new ArrayList<>(); + focList.add(new FileOutConfig("/templates/mapper.xml.ftl") { + @Override + public String outputFile(TableInfo tableInfo) { + // 自定义输入文件名称 + return System.getProperty("user.dir")+ rb.getString("mapperPath") + tableInfo.getMapperName() + StringPool.DOT_XML; + } + }); + cfg.setFileOutConfigList(focList); + mpg.setCfg(cfg); + mpg.setTemplate(new TemplateConfig().setXml(null)); + + // 策略配置 + StrategyConfig strategy = new StrategyConfig(); + strategy.setNaming(NamingStrategy.underline_to_camel); + strategy.setColumnNaming(NamingStrategy.underline_to_camel); + strategy.setSuperEntityClass(BaseModel.class); + strategy.setEntityLombokModel(true); + strategy.setRestControllerStyle(true); + String [] tables = scanner("表名,多个英文逗号分割").split(","); + if(StringUtils.isNotBlank(tables[0])) { + strategy.setInclude(tables); + } + strategy.setControllerMappingHyphenStyle(true); + mpg.setStrategy(strategy); + mpg.setTemplateEngine(new FreemarkerTemplateEngine()); + mpg.execute(); + } +} \ No newline at end of file diff --git a/src/main/java/com/subsidy/util/ConstantUtils.java b/src/main/java/com/subsidy/util/ConstantUtils.java new file mode 100644 index 0000000..72603a6 --- /dev/null +++ b/src/main/java/com/subsidy/util/ConstantUtils.java @@ -0,0 +1,89 @@ +package com.subsidy.util; + + +/** + * 枚举类 + */ +public class ConstantUtils { + + public static final String DELETE_SUCCESS = "删除成功"; + + public static final String UPLOAD_FAIL = "上传失败"; + + public static final String ADD_SUCCESS = "新增成功"; + + public static final String COMMIT_SUCCESS = "提交成功"; + + public static final String SUCCESS_SEND_OUT = "发送成功"; + + public static final String FAIL_SEND_OUT = "发送失败"; + + public static final String SAVE_SUCCESS = "保存成功"; + + public static final String SHARE_SUCCESS = "共享成功"; + + public static final String SUBMIT_SUCCESS = "提交成功"; + + public static final String SUCCESS_UPDATE = "更新成功"; + + public static final String FAIL_UPDATE = "更新失败"; + + public static final String SET_SUCCESS = "设置成功"; + + public static final String SUCCESS_VERIFY = "验证成功"; + + public static final String FAIL_VERIFY = "验证失败"; + + public static final String COMPANY_NAME = "TeachAI"; + + public static final String ALREADY_DONE = "已完成"; + + public static final String ALREADY_RECOMMEND = "已推荐"; + + public static final String VERIFY_NAME = "有课互联"; + + public static final String NOTICE_NAME = "有课进度通知"; + + public static final String PUBLISH_SUCCESS = "发布成功"; + + public static final String LOGIN_OUT ="登出成功"; + + public static final String COMPRESS_SUCCESS = "压缩成功"; + + public static final String SCHOOL = "上海市市西中学"; + + public static final String CHECK_STATUS = "审核通过"; + + /** + * 短信模板---验证模板 + */ + public static final String TEMPLATE_CODE = "SMS_190945394"; + + /** + * 短信 地域ID + */ + public static final String REGION_ID = "cn-hangzhou"; + + /** + * 短信 RAM账号AccessKey ID + */ + public static final String ACCESS_KEY_ID = "LTAIOrpFKrDqsQ2c"; + + /** + * 短信 RAM账号AccessKey Secret + */ + public static final String SECRET = "1Qp8huLETbWiBBJvHXJ7MOIhtKuA1G"; + + /** + * 腾讯云点播视频转码模板 + */ + public static final Long TEMPLATE_VOD = 100030L; + + /** + * 手机端token + */ + public static final String MOBILE_TERMINATE = "mobile"; + + public static final String ADMINISTER_TERMINATE = "administer"; + +} diff --git a/src/main/java/com/subsidy/util/DateFormatUtil.java b/src/main/java/com/subsidy/util/DateFormatUtil.java new file mode 100644 index 0000000..4ae1409 --- /dev/null +++ b/src/main/java/com/subsidy/util/DateFormatUtil.java @@ -0,0 +1,79 @@ +package com.subsidy.util; + +import java.text.SimpleDateFormat; +import java.util.Date; + +/** + * 处理时间工具 + * + * @author DengMin + * @date 2019/08/27 13:56 + **/ +public class DateFormatUtil { + + public final static String YEAR = "yyyy"; + public final static String FMT_sdf14_L = "yyyy-MM-dd HH:mm:ss"; + public final static String FMT_sdf_yMd = "yyyy-MM-dd"; + public final static String FMT_sdf_yM = "yyyy-M"; + public final static String FMT_sdf_yMM = "yyyy-MM"; + public final static String FMT_sdf_Hm = "H:mm"; + public final static String FMT_sdf_HHmm = "HH:mm"; + public final static String cron = "s m H d M ? yyyy"; + + /** + * Date转String,自定义格式 + * @param date + * @param pattern + * @return + */ + public static String format(Date date, String pattern) { + try { + SimpleDateFormat sdf = new SimpleDateFormat(pattern); + return sdf.format(date); + } catch (Exception e) { + e.printStackTrace(); + return null; + } + } + + /** + * String转Date,自定义格式 + * @param date + * @param pattern + * @return + */ + public static Date parse(String date, String pattern) { + try { + SimpleDateFormat sdf = new SimpleDateFormat(pattern); + return sdf.parse(date); + } catch (Exception e) { + e.printStackTrace(); + return null; + } + } + + /** + * 比较两个时间 + * .after 大于 + * .before 小于 + * @param d1 + * @param d2 + * @return + */ + public static boolean compare(Date d1, Date d2 ) { + if(d1.after(d2)) { + return false; + } + return true; + } + + /** + * Data转Cron + * @param date + * @return + */ + public static String getCron(Date date) { + SimpleDateFormat sdf = new SimpleDateFormat("s m H d M ? yyyy"); + return sdf.format(date); + } +} diff --git a/src/main/java/com/subsidy/util/EncryptUtil.java b/src/main/java/com/subsidy/util/EncryptUtil.java new file mode 100644 index 0000000..7055849 --- /dev/null +++ b/src/main/java/com/subsidy/util/EncryptUtil.java @@ -0,0 +1,35 @@ +package com.subsidy.util; + +import com.amdelamar.jhash.Hash; +import com.amdelamar.jhash.algorithms.Type; +import com.amdelamar.jhash.exception.InvalidHashException; + +public class EncryptUtil { + + /** + * 设置密文密码 + * + * @param password 原始密码 + * @return 加密密码 + */ + public static String encrypt(String password) { + char[] chars = password.toCharArray(); + return Hash.password(chars).algorithm(Type.PBKDF2_SHA256).create(); + } + + /** + * 验证加密密码 + * + * @param encryptedPassword 密文密码 + * @param plainPassword 明文密码 + * @return 验证是否成功 + */ + public static boolean verify(String encryptedPassword, String plainPassword) { + char[] chars = plainPassword.toCharArray(); + try { + return Hash.password(chars).algorithm(Type.PBKDF2_SHA256).verify(encryptedPassword); + } catch (InvalidHashException e) { + return false; + } + } +} diff --git a/src/main/java/com/subsidy/util/ExcelFormatUtils.java b/src/main/java/com/subsidy/util/ExcelFormatUtils.java new file mode 100644 index 0000000..4c8a077 --- /dev/null +++ b/src/main/java/com/subsidy/util/ExcelFormatUtils.java @@ -0,0 +1,17 @@ +package com.subsidy.util; + +import java.util.Arrays; +import java.util.List; + +public class ExcelFormatUtils { + + + public static final List<String> memberList = Arrays.asList(new String[]{"序号", "成员名称", "身份证号码", "账号", "联系方式", "签到次数", "课程进度", "培训时长", "答疑数", "测试成绩", "总评价"}); + + public static final List<String> signList = Arrays.asList(new String[]{"序号", "成员名称", "身份证号码", "手机号码", "培训时长", "课程进度", "完成率", "签到次数", "签到日期"}); + + public static final List<String> scoreList = Arrays.asList(new String[]{"序号", "成员名称", "身份证号码", "手机号码", "测试最高成绩", "测试次数", "总评价"}); + + public static final List<String> answersList = Arrays.asList(new String[]{"序号", "提问", "答疑", "提问时间", "提问成员", "答疑时间"}); + +} diff --git a/src/main/java/com/subsidy/util/HttpUtil.java b/src/main/java/com/subsidy/util/HttpUtil.java new file mode 100644 index 0000000..669745a --- /dev/null +++ b/src/main/java/com/subsidy/util/HttpUtil.java @@ -0,0 +1,63 @@ +package com.subsidy.util; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import org.springframework.http.*; +import org.springframework.web.client.RestTemplate; + +import java.util.Map; + +/** + * http请求 + */ +public class HttpUtil { + + /** + * GET 请求 + * @param params + * @param url + * @return + */ + public static JSONObject get(Map<String, Object> params, String url) { + RestTemplate restTemplate = new RestTemplate(); + ResponseEntity<String> responseEntity = restTemplate.getForEntity(url, String.class, params); + String body = responseEntity.getBody(); + JSONObject object = JSON.parseObject(body); + return object; + } + + /** + * POST 请求 + * @param params + * @param url + * @return + */ + public static JSONObject post(Map<String, Object> params, String url) { + RestTemplate restTemplate = new RestTemplate(); + ResponseEntity<String> responseEntity = restTemplate.postForEntity(url, params, String.class); + String body = responseEntity.getBody(); + JSONObject object = JSON.parseObject(body); + return object; + } + + /** + * POST 请求 带Token + * + * @param param + * @param token + * @param url + * @return + */ + public static JSONObject sendPost(Map<String, Object> param, String token, String url, Object obj) { + RestTemplate restTemplate = new RestTemplate(); + HttpHeaders headers = new HttpHeaders(); + headers.setContentType(MediaType.APPLICATION_JSON); + headers.add("Accept", MediaType.ALL_VALUE); + headers.add("Authorization", "Bearer " + token); + HttpEntity<String> formEntity = new HttpEntity<String>(param.toString(), headers); + ResponseEntity<String> responseEntity = restTemplate.exchange(url, HttpMethod.POST, formEntity, String.class, obj); + String body = responseEntity.getBody(); + JSONObject object = JSON.parseObject(body); + return object; + } +} diff --git a/src/main/java/com/subsidy/util/JwtUtil.java b/src/main/java/com/subsidy/util/JwtUtil.java new file mode 100644 index 0000000..972185b --- /dev/null +++ b/src/main/java/com/subsidy/util/JwtUtil.java @@ -0,0 +1,96 @@ +package com.subsidy.util; + +import com.auth0.jwt.JWT; +import com.auth0.jwt.JWTVerifier; +import com.auth0.jwt.algorithms.Algorithm; +import com.auth0.jwt.interfaces.Claim; + +import java.util.Date; +import java.util.Map; + +/** + * <p> + * Token工具 + * </p> + * + * @author DengMin + * @since 2021/4/14 + */ +public class JwtUtil { + + private static Long EXPIRE_TIME = 24 * 60 * 60 * 1000L; + + private static String SECRET = "PBKDF2SHA256:64000:18:24:N:GFHZ6Y0PTEUDYCJI3K6SOOXWYEKPOZED:WBWFJMX5DF252E0HR3BF3P/D"; + + /** + * 生成Token + * @param id + * @return + */ + public static String generateToken(Long id, String type) { + Date expireDate = new Date(System.currentTimeMillis() + EXPIRE_TIME); + return JWT.create() + .withClaim("id", id) + .withClaim("type", type) + .withAudience() + .withExpiresAt(expireDate) + .withIssuedAt(new Date()) + .sign(Algorithm.HMAC256(SECRET)); + } + + /** + * 检验token是否正确 + * @param token + * @return + */ + public static boolean verifyToken(String token) { + try { + Algorithm algorithm = Algorithm.HMAC256(SECRET); + JWTVerifier verifier = JWT.require(algorithm).build(); + verifier.verify(token); + return true; + } catch (Exception e) { + return false; + } + } + + /** + * 获取用户自定义Claim集合 + * @param token + * @return + */ + public static Map<String, Claim> getClaims(String token) { + Algorithm algorithm = Algorithm.HMAC256(SECRET); + JWTVerifier verifier = JWT.require(algorithm).build(); + Map<String, Claim> claims = verifier.verify(token).getClaims(); + return claims; + } + + /** + * 获取过期时间 + * @param token + * @return + */ + public static Date getExpiresAt(String token) { + Algorithm algorithm = Algorithm.HMAC256(SECRET); + return JWT + .require(algorithm) + .build() + .verify(token) + .getExpiresAt(); + } + + /** + * 验证token是否失效 + * @param token + * @return true: 过期, false: 没过期 + */ + public static boolean isExpired(String token) { + try { + final Date expiration = getExpiresAt(token); + return expiration.before(new Date()); + } catch (Exception e) { + return true; + } + } +} diff --git a/src/main/java/com/subsidy/util/LatexUtils.java b/src/main/java/com/subsidy/util/LatexUtils.java new file mode 100644 index 0000000..ac6fddb --- /dev/null +++ b/src/main/java/com/subsidy/util/LatexUtils.java @@ -0,0 +1,124 @@ +package com.subsidy.util; + +import org.scilab.forge.jlatexmath.TeXConstants; +import org.scilab.forge.jlatexmath.TeXFormula; +import org.scilab.forge.jlatexmath.TeXIcon; + +import javax.imageio.ImageIO; +import javax.swing.*; +import java.awt.*; +import java.awt.image.BufferedImage; +import java.io.*; + +/** + * @author: tuyp + * @create: 2020-08-08 21:19 + */ +public class LatexUtils { + + /** + * @Description: 将base64编码字符串转换为图片 + * @Author: + * @CreateTime: + * @param imgStr + * base64编码字符串 + * @param path + * 图片路径-具体到文件 + * @return + */ + public static boolean generateImage(String imgStr, String path) { + if (imgStr == null) { + return false; + } +// BASE64Decoder decoder = new BASE64Decoder(); + try { +// byte[] b = decoder.decodeBuffer(imgStr); +// for (int i = 0; i < b.length; i++) { +// if (b[i] < 0) { +// b[i] += 256; +// } +// } +// OutputStream out = new FileOutputStream(path); +// out.write(b); +// out.flush(); +// out.close(); + return true; + } catch (Exception e) { + // TODO: handle exception + return false; + } + } + + /** + * @Description: 根据图片地址转换为base64编码字符串 + * @Author: + * @CreateTime: + * @return + */ +// public static String getImageStr(String imgFile) { +// InputStream inputStream = null; +// byte[] data = null; +// try { +// inputStream = new FileInputStream(imgFile); +// data = new byte[inputStream.available()]; +// inputStream.read(data); +// inputStream.close(); +// } catch (IOException e) { +// e.printStackTrace(); +// } +// // 加密 +// BASE64Encoder encoder = new BASE64Encoder(); +// return encoder.encode(data); +// } + + // latex 转 imgbase64 + public static String latex2Png(String latex) { + try { + TeXFormula formula = new TeXFormula(latex); + // render the formla to an icon of the same size as the formula. + TeXIcon icon = formula.createTeXIcon(TeXConstants.STYLE_DISPLAY, 20); + // insert a border + icon.setInsets(new Insets(1, 1, 1, 1)); + // now create an actual image of the rendered equation + BufferedImage image = new BufferedImage(icon.getIconWidth(), icon.getIconHeight(), BufferedImage.TYPE_BYTE_GRAY); + Graphics2D g2 = image.createGraphics(); + g2.setColor(Color.white); + g2.fillRect(0, 0, icon.getIconWidth(), icon.getIconHeight()); + JLabel jl = new JLabel(); + jl.setForeground(new Color(0, 0, 0)); + icon.paintIcon(jl, g2, 0, 0); + // at this point the image is created, you could also save it with ImageIO + // saveImage(image, "png", "F:\\b.png"); +// ImageIO.write(image, "png", new File("F:\\c.png")); + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + try { + ImageIO.write(image, "png", outputStream); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + return null; + } + byte[] buffer = outputStream.toByteArray(); +// BASE64Encoder encoder = new BASE64Encoder(); + return ("data:image/png;base64,"); + } catch (Exception e) { + // e.printStackTrace(); + // ExceptionUtil.log(log, e); + System.err.println("公式解析有误:\n" + latex); + // e.printStackTrace(); + return null; + } + } + + public static void main(String[] args) { + String str = latex2Png("\\(\\sqrt[3]{2+x}\\)"); + System.out.println(str); + + + + +// String omml =Latex_Word.latexToWord(str); +// System.out.println(omml); + } + +} diff --git a/src/main/java/com/subsidy/util/Localstorage.java b/src/main/java/com/subsidy/util/Localstorage.java new file mode 100644 index 0000000..4cc65bd --- /dev/null +++ b/src/main/java/com/subsidy/util/Localstorage.java @@ -0,0 +1,21 @@ +package com.subsidy.util; + +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class Localstorage { + + private static final ThreadLocal<Object> local = ThreadLocal.withInitial(() -> null); + + public static void setUser(Object admin) { + Localstorage.local.set(admin); + } + + public static Object getUser() { + return Localstorage.local.get(); + } + + public static void remove() { + Localstorage.local.remove(); + } +} diff --git a/src/main/java/com/subsidy/util/MathUtil.java b/src/main/java/com/subsidy/util/MathUtil.java new file mode 100644 index 0000000..30f4816 --- /dev/null +++ b/src/main/java/com/subsidy/util/MathUtil.java @@ -0,0 +1,137 @@ +package com.subsidy.util; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.util.Random; + +public class MathUtil { + + public static String getRandomCode(int randomLength) { + StringBuilder str = new StringBuilder(); + Random random = new Random(); + for (int i = 0; i < randomLength; i++) { + str.append(random.nextInt(10)); + } + return str.toString(); + } + + public static String getRandomString(int length) { + StringBuilder val = new StringBuilder(); + Random random = new Random(); + for (int i = 0; i < length; ++i) { + String charOrNum = random.nextInt(3) % 3 == 0 ? "num" : "char"; + if ("char".equalsIgnoreCase(charOrNum)) { + int temp = random.nextInt(2) % 2 == 0 ? 65 : 97; + val.append((char) (random.nextInt(26) + temp)); + } else { + val.append(random.nextInt(10)); + } + } + return val.toString(); + } + + //习题/视频 ==> 秒钟向上取整 + public static String ceilSecond(int length) { + return String.valueOf((int) Math.ceil((double) length / 60)); + } + + //视频秒数处理 + public static String vodLength(int i) { + if (i > 60) { + if (i % 60 >= 10) { + return i / 60 + ":" + i % 60; + } else { + return i / 60 + ":0" + i % 60; + } + } else { + if (i % 60 >= 10) { + return "00:" + i; + } else { + return "00:0" + i; + } + } + } + + //文件大小处理 + public static String fileUnit(int i) { + if (i / 1024 > 1024) { + return String.format("%.2f", (double) i / 1024 / 1024) + "M"; + } else { + return String.format("%.2f", (double) i / 1024) + "K"; + } + } + + //单个题目秒数处理 + public static String exerciseLength(int i) { + if (i >= 60 * 60) { + return i / 60 / 60 + "时" + (i - 60 * 60) / 60 + "分" + i % 60 + "秒"; + } else if (i >= 60) { + return i / 60 + "分" + i % 60 + "秒"; + } else { + return i % 60 + "秒"; + } + } + + // 除法取整 + public static String getAvgIndex(BigDecimal counts, BigDecimal total) { + if (BigDecimal.ZERO.equals(total)) { + return "0"; + } else { + return counts.divide(total, RoundingMode.CEILING).stripTrailingZeros().toPlainString(); + } + } + + //百分比 取整 返回字符串 + public static String getPercentAvgIndex(BigDecimal counts, BigDecimal total) { + if (BigDecimal.ZERO.equals(total) || BigDecimal.ZERO.equals(counts)) { + return "0%"; + } else { + return counts.multiply(new BigDecimal(100)).divide(total, RoundingMode.CEILING).stripTrailingZeros().toPlainString() + "%"; + } + } + //百分比 不带%输出 + public static String getPercentAvgIndexWithPercent(BigDecimal counts, BigDecimal total) { + if (BigDecimal.ZERO.equals(total) || BigDecimal.ZERO.equals(counts)) { + return "0"; + } else { + return counts.multiply(new BigDecimal(100)).divide(total,2,BigDecimal.ROUND_HALF_UP).stripTrailingZeros().toPlainString(); + } + } + + //百分比 不带%输出 + public static String getPercentAvgIndexCeil(BigDecimal counts, BigDecimal total) { + if (BigDecimal.ZERO.equals(total) || BigDecimal.ZERO.equals(counts)) { + return "0"; + } else { + return counts.multiply(new BigDecimal(100)).divide(total,2,BigDecimal.ROUND_CEILING).stripTrailingZeros().toPlainString(); + } + } + + + //习题序号生成规则 sid 从数据取出某科目某知识点的最大的序号 + public static String getExeCode(String sid) { + Integer integer = Integer.valueOf(sid.substring(9)); + return sid.substring(0, 9) + (++integer); + } + + // 整型a 整型b a/b 向上取整 + public static Integer intDivCeil(long a, int b) { + return (int) Math.ceil((double) a / b); + } + + // 整型a 整型b a/b 向下取整 + public static Integer intDivFloorPercent(long a, int b) { + return (int) Math.floor((double) a * 100 / b); + } + + public static Integer getRandomNum(Integer i){ + Random random = new Random(); + return random.nextInt(i); + } + +// public static void main(String[] args) { +// for (int i= 1;i<100;i++){ +// System.out.println(getRandomNum(2)); +// } +// } +} diff --git a/src/main/java/com/subsidy/util/RandomUtil.java b/src/main/java/com/subsidy/util/RandomUtil.java new file mode 100644 index 0000000..da3a872 --- /dev/null +++ b/src/main/java/com/subsidy/util/RandomUtil.java @@ -0,0 +1,19 @@ +package com.subsidy.util; + +import java.util.Random; + +public class RandomUtil { + + public static int getCode() { + return (int)((Math.random() * 9 + 1) * 100000); + } + + public static String getRandomCode(int randomLength) { + StringBuilder str = new StringBuilder(); + Random random = new Random(); + for (int i = 0; i < randomLength; i++) { + str.append(random.nextInt(10)); + } + return str.toString(); + } +} diff --git a/src/main/java/com/subsidy/util/SMSUtils.java b/src/main/java/com/subsidy/util/SMSUtils.java new file mode 100644 index 0000000..7772f13 --- /dev/null +++ b/src/main/java/com/subsidy/util/SMSUtils.java @@ -0,0 +1,139 @@ +package com.subsidy.util; + +import com.aliyuncs.CommonRequest; +import com.aliyuncs.CommonResponse; +import com.aliyuncs.DefaultAcsClient; +import com.aliyuncs.IAcsClient; +import com.aliyuncs.dysmsapi.model.v20170525.SendSmsRequest; +import com.aliyuncs.dysmsapi.model.v20170525.SendSmsResponse; +import com.aliyuncs.http.MethodType; +import com.aliyuncs.profile.DefaultProfile; +import com.aliyuncs.profile.IClientProfile; +import com.subsidy.common.configure.AliyunSmsProperties; +import com.subsidy.common.exception.HttpException; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 短信发送工具类 + */ + +@Component +public class SMSUtils { + + + + @Autowired + private AliyunSmsProperties aliyunSmsProperties; + + public SendSmsResponse send(String phone, String code) { + try { + System.setProperty("sun.net.client.defaultConnectTimeout", "10000"); + System.setProperty("sun.net.client.defaultReadTimeout", "10000"); + + //初始化acsClient,暂不支持region化 + IClientProfile profile = DefaultProfile.getProfile("cn-hangzhou", aliyunSmsProperties.getAccessKeyId(), aliyunSmsProperties.getAccessKeySecret()); + DefaultProfile.addEndpoint("cn-hangzhou", "cn-hangzhou", aliyunSmsProperties.getProduct(), aliyunSmsProperties.getDomain()); + IAcsClient acsClient = new DefaultAcsClient(profile); + + //组装请求对象-具体描述见控制台-文档部分内容 + SendSmsRequest request = new SendSmsRequest(); + //必填:待发送手机号 + request.setPhoneNumbers(phone); + //必填:短信签名-可在短信控制台中找到 + request.setSignName("有课互联"); + //必填:短信模板-可在短信控制台中找到 + request.setTemplateCode("SMS_190945394"); + //可选:模板中的变量替换JSON串,如模板内容为"亲爱的${name},您的验证码为${code}"时,此处的值为 + request.setTemplateParam("{\"code\":\""+ code +"\"}"); + + //hint 此处可能会抛出异常,注意catch + SendSmsResponse sendSmsResponse = acsClient.getAcsResponse(request); + if(sendSmsResponse != null && sendSmsResponse.getCode().equals("OK")) { + return sendSmsResponse; + } + + throw new Exception(sendSmsResponse.getMessage()); + } catch (Exception e) { + throw new HttpException(70011); + } + } + + + /** + * 发送验证码短信 + * @param templateId 短信模板id + * @param telephone 手机号 + * @return + */ + public static String sendVerifySMS(String templateId,String telephone,String param){ + DefaultProfile profile = DefaultProfile.getProfile(ConstantUtils.REGION_ID, ConstantUtils.ACCESS_KEY_ID, ConstantUtils.SECRET); + IAcsClient client = new DefaultAcsClient(profile); + + CommonRequest request = new CommonRequest(); + request.setSysMethod(MethodType.POST); + request.setSysDomain("dysmsapi.aliyuncs.com"); + request.setSysVersion("2017-05-25"); + request.setSysAction("SendSms"); + request.putQueryParameter("RegionId",ConstantUtils.REGION_ID); + request.putQueryParameter("PhoneNumbers",telephone); + request.putQueryParameter("SignName",ConstantUtils.VERIFY_NAME); + request.putQueryParameter("TemplateCode",templateId); +// if (StringUtils.isEmpty(param)){ +// request.putQueryParameter("TemplateParam","{ \"code\":\""+verifyCode +"\"}"); +// } + request.putQueryParameter("TemplateParam",param); + CommonResponse response = null; + try { + response = client.getCommonResponse(request); + return ConstantUtils.SUCCESS_SEND_OUT; + } catch(Exception e) { + e.printStackTrace(); + return ConstantUtils.FAIL_SEND_OUT; + } + } + + /** + * 发送通知短信 + * @param templateId 短信模板id + * @param telephone 手机号 + * @return + */ + public static String sendNoticeSMS(String templateId,String telephone,String param){ + DefaultProfile profile = DefaultProfile.getProfile(ConstantUtils.REGION_ID, ConstantUtils.ACCESS_KEY_ID, ConstantUtils.SECRET); + IAcsClient client = new DefaultAcsClient(profile); + + CommonRequest request = new CommonRequest(); + request.setSysMethod(MethodType.POST); + request.setSysDomain("dysmsapi.aliyuncs.com"); + request.setSysVersion("2017-05-25"); + request.setSysAction("SendSms"); + request.putQueryParameter("RegionId",ConstantUtils.REGION_ID); + request.putQueryParameter("PhoneNumbers",telephone); + request.putQueryParameter("SignName",ConstantUtils.NOTICE_NAME); + request.putQueryParameter("TemplateCode",templateId); +// if (StringUtils.isEmpty(param)){ +// request.putQueryParameter("TemplateParam","{ \"code\":\""+verifyCode +"\"}"); +// } + request.putQueryParameter("TemplateParam",param); + CommonResponse response = null; + try + + { + response = client.getCommonResponse(request); + return ConstantUtils.SUCCESS_SEND_OUT; + } catch( + Exception e) + + { + e.printStackTrace(); + return ConstantUtils.FAIL_SEND_OUT; + } + } + + public static void main(String[] args) { + String param = "{ \"company\":\""+"基金会"+ "\",\"time\":\""+"2020-01-02" +"\",\"address\":\""+"上海市" +"\"}"; + sendNoticeSMS("SMS_215336604","15201936167",param); + } + +} diff --git a/src/main/java/com/subsidy/util/SecretUtils.java b/src/main/java/com/subsidy/util/SecretUtils.java new file mode 100644 index 0000000..f0c15c9 --- /dev/null +++ b/src/main/java/com/subsidy/util/SecretUtils.java @@ -0,0 +1,116 @@ +package com.subsidy.util; + +import java.math.BigInteger; +import java.nio.charset.StandardCharsets; +import java.security.MessageDigest; +import java.util.UUID; + +public class SecretUtils { + + /** + * 对用户登录密码进行MD5加密 + * + * @param str + * @return + */ + + public static String getMD5String(String str) { + try { + // 生成一个MD5加密计算摘要 + MessageDigest md = MessageDigest.getInstance("MD5"); + // 计算md5函数 + md.update(str.getBytes()); + // digest()最后确定返回md5 hash值,返回值为8位字符串。因为md5 hash值是16位的hex值,实际上就是8位的字符 + // BigInteger函数则将8位的字符串转换成16位hex值,用字符串来表示;得到字符串形式的hash值 + //一个byte是八位二进制,也就是2位十六进制字符(2的8次方等于16的2次方) + return new BigInteger(1, md.digest()).toString(16); + } catch (Exception e) { + e.printStackTrace(); + return null; + } + } + + /** + * 对字符串进行SHA加密 + * + * @param + */ + public static String getSHAString(String str) { + try { + MessageDigest sha = MessageDigest.getInstance("SHA-1"); + + byte[] byteArray = str.getBytes(StandardCharsets.UTF_8); + byte[] md5Bytes = sha.digest(byteArray); + StringBuffer hexValue = new StringBuffer(); + for (int i = 0; i < md5Bytes.length; i++) { + int val = ((int) md5Bytes[i]) & 0xff; + if (val < 16) { + hexValue.append("0"); + } + hexValue.append(Integer.toHexString(val)); + } + + return hexValue.toString(); + } catch (Exception e) { + return null; + } + + } + + + private static byte[] md5(String s) + { + MessageDigest algorithm; + try + { + algorithm = MessageDigest.getInstance("MD5"); + algorithm.reset(); + algorithm.update(s.getBytes("UTF-8")); + byte[] messageDigest = algorithm.digest(); + return messageDigest; + } + catch (Exception e) + { + + } + return null; + } + + private static final String toHex(byte hash[]) + { + if (hash == null) + { + return null; + } + StringBuffer buf = new StringBuffer(hash.length * 2); + int i; + + for (i = 0; i < hash.length; i++) + { + if ((hash[i] & 0xff) < 0x10) + { + buf.append("0"); + } + buf.append(Long.toString(hash[i] & 0xff, 16)); + } + return buf.toString(); + } + + public static String hash(String s) + { + try + { + return new String(toHex(md5(s)).getBytes("UTF-8"), "UTF-8"); + } + catch (Exception e) + { + return s; + } + } + + public static void main(String[] args) { + String uuid = UUID.randomUUID().toString(); + System.out.println(uuid); + System.out.println(hash(uuid+"ixihs")); + } +} \ No newline at end of file diff --git a/src/main/java/com/subsidy/util/Signature.java b/src/main/java/com/subsidy/util/Signature.java new file mode 100644 index 0000000..87f4c62 --- /dev/null +++ b/src/main/java/com/subsidy/util/Signature.java @@ -0,0 +1,79 @@ +package com.subsidy.util; + +import sun.misc.BASE64Encoder; + +import javax.crypto.Mac; +import javax.crypto.spec.SecretKeySpec; +import java.nio.charset.StandardCharsets; + +/** + * @author: tuyp + * @create: 2020-07-29 12:42 + */ +public class Signature { + private String secretId; + private String secretKey; + private long currentTime; + private int random; + private int signValidDuration; + + private static final String HMAC_ALGORITHM = "HmacSHA1"; + private static final String CONTENT_CHARSET = "UTF-8"; + + public static byte[] byteMerger(byte[] byte1, byte[] byte2) { + byte[] byte3 = new byte[byte1.length + byte2.length]; + System.arraycopy(byte1, 0, byte3, 0, byte1.length); + System.arraycopy(byte2, 0, byte3, byte1.length, byte2.length); + return byte3; + } + + public String getUploadSignature() throws Exception { + String strSign = ""; + String contextStr = ""; + + long endTime = (currentTime + signValidDuration); + contextStr += "secretId=" + java.net.URLEncoder.encode(secretId, "utf8"); + contextStr += "¤tTimeStamp=" + currentTime; + contextStr += "&expireTime=" + endTime; + contextStr += "&random=" + random; + + try { + Mac mac = Mac.getInstance(HMAC_ALGORITHM); + SecretKeySpec secretKey = new SecretKeySpec(this.secretKey.getBytes(CONTENT_CHARSET), mac.getAlgorithm()); + mac.init(secretKey); + + byte[] hash = mac.doFinal(contextStr.getBytes(CONTENT_CHARSET)); + byte[] sigBuf = byteMerger(hash, contextStr.getBytes(StandardCharsets.UTF_8)); + strSign = base64Encode(sigBuf); + strSign = strSign.replace(" ", "").replace("\n", "").replace("\r", ""); + } catch (Exception e) { + throw e; + } + return strSign; + } + + private String base64Encode(byte[] buffer) { + BASE64Encoder encoder = new BASE64Encoder(); + return encoder.encode(buffer); + } + + public void setSecretId(String secretId) { + this.secretId = secretId; + } + + public void setSecretKey(String secretKey) { + this.secretKey = secretKey; + } + + public void setCurrentTime(long currentTime) { + this.currentTime = currentTime; + } + + public void setRandom(int random) { + this.random = random; + } + + public void setSignValidDuration(int signValidDuration) { + this.signValidDuration = signValidDuration; + } +} diff --git a/src/main/java/com/subsidy/util/Student.java b/src/main/java/com/subsidy/util/Student.java new file mode 100644 index 0000000..77f6c1c --- /dev/null +++ b/src/main/java/com/subsidy/util/Student.java @@ -0,0 +1,17 @@ +package com.subsidy.util; + +import lombok.Data; + +import java.util.Date; + +@Data +public class Student { + + private String name; + private int age; + private Date birthday; + private float height; + private double weight; + private boolean sex; + +} diff --git a/src/main/java/com/subsidy/util/TestMain.java b/src/main/java/com/subsidy/util/TestMain.java new file mode 100644 index 0000000..547881b --- /dev/null +++ b/src/main/java/com/subsidy/util/TestMain.java @@ -0,0 +1,61 @@ +package com.subsidy.util; + +import java.security.MessageDigest; +import java.util.Random; + +public class TestMain { + + public static void main(String[] args) { + String password = "123456"; + String saltCode = getRandomCharAndNumr(5); + String encryptString = encrypt("91ebn" + password); + System.out.println(encryptString); + } + + public static String encrypt(String string) { + + String encryptedString = string; + char[] hexDigits = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' }; + try { + byte[] btInput = string.getBytes(); + MessageDigest mdInst = MessageDigest.getInstance("MD5"); + mdInst.update(btInput); + byte[] md = mdInst.digest(); + int j = md.length; + char[] str = new char[j * 2]; + int k = 0; + for (int i = 0; i < j; i++) { + byte byte0 = md[i]; + str[k++] = hexDigits[byte0 >>> 4 & 0xf]; + str[k++] = hexDigits[byte0 & 0xf]; + } + encryptedString = new String(str); + return encryptedString; + } catch (Exception e) { + e.printStackTrace(); + return encryptedString; + } + } + + /** + * 获取随机字母数字组合 + * + * @param length + * 字符串长度 + * @return + */ + public static String getRandomCharAndNumr(Integer length) { + String str = ""; + Random random = new Random(); + for (int i = 0; i < length; i++) { + boolean b = random.nextBoolean(); + if (b) { // 字符串 + // int choice = random.nextBoolean() ? 65 : 97; 取得65大写字母还是97小写字母 + str += (char) (97 + random.nextInt(26));// 取得大写字母 + } else { // 数字 + str += String.valueOf(random.nextInt(10)); + } + } + return str; + } +} diff --git a/src/main/java/com/subsidy/util/ZipTestUtils.java b/src/main/java/com/subsidy/util/ZipTestUtils.java new file mode 100644 index 0000000..925652e --- /dev/null +++ b/src/main/java/com/subsidy/util/ZipTestUtils.java @@ -0,0 +1,299 @@ +package com.subsidy.util; + +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 javax.servlet.ServletOutputStream; +import javax.servlet.http.HttpServletResponse; +import java.io.*; +import java.text.SimpleDateFormat; +import java.util.*; +import java.util.zip.ZipEntry; +import java.util.zip.ZipOutputStream; + +public class ZipTestUtils { + + /* + 原链接:https://blog.csdn.net/houxuehan/article/details/89189820 + */ + + public static String NO_DEFINE = "no_define";//未定义的字段 + public static String DEFAULT_DATE_PATTERN = "yyyy年MM月dd日";//默认日期格式 + public static int DEFAULT_COLOUMN_WIDTH = 17; + + /** + * 导出Excel 2007 OOXML (.xlsx)格式 + * + * @param title 标题行 + * @param headList 属性-列头 + * @param students 数据集 + * @param datePattern 日期格式,传null值则默认 年月日 + * @param colWidth 列宽 默认 至少17个字节 + * @param out 输出流 + */ + public static void exportExcelX(String title, List<String> headList, List<Student> students, String datePattern, int colWidth, OutputStream out) { + if (datePattern == null) { + datePattern = DEFAULT_DATE_PATTERN; + } + // 声明一个工作薄 + 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 < DEFAULT_COLOUMN_WIDTH ? DEFAULT_COLOUMN_WIDTH : colWidth;//至少字节数 + int[] arrColWidth = new int[headList.size()]; + // 产生表格标题行,以及设置列宽 + String[] properties = new String[headList.size()]; + String[] headers = new String[headList.size()]; + int ii = 0; + for (int i = 0 ;i < headList.size(); i++) { + + //properties[ii] = fieldName; + 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 (Student student : students) { + 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(student.getName()); + + newCell = dataRow.createCell(1); + //newCell.setCellStyle(cellStyle); + newCell.setCellValue(student.getAge()); + + newCell = dataRow.createCell(2); + newCell.setCellValue(new SimpleDateFormat(datePattern).format(student.getBirthday())); + + newCell = dataRow.createCell(3); + newCell.setCellValue(student.getHeight()); + + newCell = dataRow.createCell(4); + newCell.setCellValue(student.getWeight()); + + newCell = dataRow.createCell(5); + newCell.setCellValue(student.isSex()); + + // + //for (int i = 0; i < properties.length; i++) { + // + // Object o = jo.get(properties[i]); + // String cellValue = ""; + // if (o == null) { + // cellValue = ""; + // } else if (o instanceof Date) { + // cellValue = new SimpleDateFormat(datePattern).format(o); + // } + // /*else if(o instanceof Float || o instanceof Double) { + // double d = (double) o; + // if(d%1==0) cellValue=o.toString(); + // else cellValue= new BigDecimal(o.toString()).setScale(2,BigDecimal.ROUND_HALF_UP).toString(); + // }*/ + // else { + // cellValue = o.toString(); + // } + // newCell.setCellValue(cellValue); + // newCell.setCellStyle(cellStyle); + //} + 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(); + } + } + + public static void main(String[] args) throws IOException { + int count = 100; + List<Student> list = new ArrayList<>(); + for (int i = 0; i < count; i++) { + Student s = new Student(); + s.setName("POI" + i); + s.setAge(i); + s.setBirthday(new Date()); + s.setHeight(i); + s.setWeight(i); + s.setSex(i / 2 == 0 ? false : true); + list.add(s); + } + //Map<String, String> headMap = new LinkedHashMap<String, String>(); + //headMap.put("name", "姓名"); + //headMap.put("age", "年龄"); + //headMap.put("birthday", "生日"); + //headMap.put("height", "身高"); + //headMap.put("weight", "体重"); + //headMap.put("sex", "性别"); + + List<String> memberList = Arrays.asList(new String[]{"成员名称","账号","联系方式","签到次数","课程进度","培训时长","评级测试","答疑"}); + + + //导出zip + OutputStream outXlsx = new FileOutputStream("E://test.zip"); + ZipOutputStream zipOutputStream = new ZipOutputStream(outXlsx); + + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + exportExcelX("testExcel", memberList, list, null, 0, baos); + compressFileToZipStream(zipOutputStream, baos, "/test/aaa.xlsx"); + baos.close(); + + zipOutputStream.flush(); + zipOutputStream.close(); + outXlsx.close(); + + System.out.println("导出zip完成"); + } + + + public void exportZip(HttpServletResponse response, List<Student> students) throws Exception { + + ServletOutputStream sos = response.getOutputStream(); + ZipOutputStream zipOutputStream = new ZipOutputStream(sos); + String zipname = "test.zip"; + response.reset(); + response.setContentType("application/x-download"); + response.setHeader("Content-Disposition", "attachment;filename=" + new String((zipname).getBytes(), "iso-8859-1")); + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + + /** + * 班级成员 + */ + List<String> memberList = Arrays.asList(new String[]{"成员名称","账号","联系方式","签到次数","课程进度","培训时长","评级测试","答疑"}); + + /** + * 注册签到 + */ + List<String> signList = Arrays.asList(new String[]{"成员名称","培训时长","课程进度","完成率"}); + + /** + * 测试成绩 + */ + List<String> scoreList = Arrays.asList(new String[]{"成员名称","测试结果","最高分"}); + + /** + * 答疑记录 + */ + List<String> answerList = Arrays.asList(new String[]{"提问","答疑","提问时间","提问成员","答疑时间"}); + + //Map<String, String> headMap = new LinkedHashMap<String, String>(); + //headMap.put("name", "成员名称"); + //headMap.put("age", "年龄"); + //headMap.put("birthday", "生日"); + //headMap.put("height", "身高"); + //headMap.put("weight", "体重"); + //headMap.put("sex", "性别"); + + exportExcelX("title", memberList, students, null, 0, baos); + compressFileToZipStream(zipOutputStream, baos, "/test/aaa.xlsx"); + baos.close(); + + zipOutputStream.flush(); + zipOutputStream.close(); + sos.close(); + System.out.println("导出zip完成"); + } + +} diff --git a/src/main/java/com/subsidy/util/ZipUtils.java b/src/main/java/com/subsidy/util/ZipUtils.java new file mode 100644 index 0000000..8cc27e3 --- /dev/null +++ b/src/main/java/com/subsidy/util/ZipUtils.java @@ -0,0 +1,259 @@ +package com.subsidy.util; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +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 javax.servlet.ServletOutputStream; +import javax.servlet.http.HttpServletResponse; +import java.io.*; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.zip.ZipEntry; +import java.util.zip.ZipOutputStream; + +public class ZipUtils { + + /* + 原链接:https://blog.csdn.net/houxuehan/article/details/89189820 + */ + + public static String NO_DEFINE = "no_define";//未定义的字段 + public static String DEFAULT_DATE_PATTERN = "yyyy年MM月dd日";//默认日期格式 + public static int DEFAULT_COLOUMN_WIDTH = 17; + + /** + * 导出Excel 2007 OOXML (.xlsx)格式 + * + * @param title 标题行 + * @param headMap 属性-列头 + * @param jsonArray 数据集 + * @param datePattern 日期格式,传null值则默认 年月日 + * @param colWidth 列宽 默认 至少17个字节 + * @param out 输出流 + */ + public static void exportExcelX(String title, Map<String, String> headMap, JSONArray jsonArray, String datePattern, int colWidth, OutputStream out) { + if (datePattern == null) { + datePattern = DEFAULT_DATE_PATTERN; + } + // 声明一个工作薄 + 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 < DEFAULT_COLOUMN_WIDTH ? DEFAULT_COLOUMN_WIDTH : colWidth;//至少字节数 + int[] arrColWidth = new int[headMap.size()]; + // 产生表格标题行,以及设置列宽 + String[] properties = new String[headMap.size()]; + String[] headers = new String[headMap.size()]; + int ii = 0; + for (Iterator<String> iter = headMap.keySet().iterator(); iter + .hasNext(); ) { + String fieldName = iter.next(); + + properties[ii] = fieldName; + headers[ii] = headMap.get(fieldName); + + int bytes = fieldName.getBytes().length; + arrColWidth[ii] = bytes < minBytes ? minBytes : bytes; + sheet.setColumnWidth(ii, arrColWidth[ii] * 256); + ii++; + } + // 遍历集合数据,产生数据行 + int rowIndex = 0; + for (Object obj : jsonArray) { + 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, headMap.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开始 + } + JSONObject jo = (JSONObject) JSONObject.toJSON(obj); + SXSSFRow dataRow = sheet.createRow(rowIndex); + for (int i = 0; i < properties.length; i++) { + SXSSFCell newCell = dataRow.createCell(i); + + Object o = jo.get(properties[i]); + String cellValue = ""; + if (o == null) { + cellValue = ""; + } else if (o instanceof Date) { + cellValue = new SimpleDateFormat(datePattern).format(o); + } + /*else if(o instanceof Float || o instanceof Double) { + double d = (double) o; + if(d%1==0) cellValue=o.toString(); + else cellValue= new BigDecimal(o.toString()).setScale(2,BigDecimal.ROUND_HALF_UP).toString(); + }*/ + else { + cellValue = o.toString(); + } + newCell.setCellValue(cellValue); + newCell.setCellStyle(cellStyle); + } + 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(); + } + } + + public static void main(String[] args) throws IOException { + int count = 100; + JSONArray ja = new JSONArray(); + for (int i = 0; i < count; i++) { + Student s = new Student(); + s.setName("POI" + i); + s.setAge(i); + s.setBirthday(new Date()); + s.setHeight(i); + s.setWeight(i); + s.setSex(i / 2 == 0 ? false : true); + ja.add(s); + } + Map<String, String> headMap = new LinkedHashMap<String, String>(); + headMap.put("name", "姓名"); + headMap.put("age", "年龄"); + headMap.put("birthday", "生日"); + headMap.put("height", "身高"); + headMap.put("weight", "体重"); + headMap.put("sex", "性别"); + //导出zip + OutputStream outXlsx = new FileOutputStream("E://test.zip"); + ZipOutputStream zipOutputStream = new ZipOutputStream(outXlsx); + + for (int i = 1; i < 6; i++) { + String dir = i % 2 == 0 ? "dirA" : "dirB"; + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + exportExcelX("testExcel", headMap, ja, null, 0, baos); + compressFileToZipStream(zipOutputStream, baos, dir + "/test" + i + ".xlsx"); + baos.close(); + } + zipOutputStream.flush(); + zipOutputStream.close(); + outXlsx.close(); + + System.out.println("导出zip完成"); + } + + + public void exportZip(HttpServletResponse response) throws Exception { + + ServletOutputStream sos = response.getOutputStream(); + ZipOutputStream zipOutputStream = new ZipOutputStream(sos); + String zipname = "test.zip"; + response.reset(); + response.setContentType("application/x-download"); + response.setHeader("Content-Disposition", "attachment;filename=" + new + + String((zipname). + + getBytes(), "iso-8859-1")); + for (int i = 1; i < 6; i++) { + String dir = i % 2 == 0 ? "dirA" : "dirB"; + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + //exportExcelX(title, headMap, ja, null, 0, baos); + compressFileToZipStream(zipOutputStream, baos, dir + "/test" + i + ".xlsx"); + baos.close(); + } + zipOutputStream.flush(); + zipOutputStream.close(); + sos.close(); + System.out.println("导出zip完成"); + } +} diff --git a/src/main/java/com/subsidy/util/excel/ExcelColumn.java b/src/main/java/com/subsidy/util/excel/ExcelColumn.java new file mode 100644 index 0000000..ca1690d --- /dev/null +++ b/src/main/java/com/subsidy/util/excel/ExcelColumn.java @@ -0,0 +1,13 @@ +package com.subsidy.util.excel; + +import java.lang.annotation.*; + +@Target(ElementType.FIELD) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface ExcelColumn { + + String value() default ""; + + int col() default 1; +} diff --git a/src/main/java/com/subsidy/util/excel/ExcelColumnUtil.java b/src/main/java/com/subsidy/util/excel/ExcelColumnUtil.java new file mode 100644 index 0000000..873ab06 --- /dev/null +++ b/src/main/java/com/subsidy/util/excel/ExcelColumnUtil.java @@ -0,0 +1,21 @@ +package com.subsidy.util.excel; + +import java.lang.annotation.*; + +/** + * <p> + * excel 字段 + * </p> + * + * @author DengMin + * @date Created in 2020/08/28 + */ +@Target({ElementType.FIELD}) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface ExcelColumnUtil { + + String value() default ""; + + int col() default 0; +} diff --git a/src/main/java/com/subsidy/util/excel/ExcelUtil.java b/src/main/java/com/subsidy/util/excel/ExcelUtil.java new file mode 100644 index 0000000..ecf09ad --- /dev/null +++ b/src/main/java/com/subsidy/util/excel/ExcelUtil.java @@ -0,0 +1,1244 @@ +package com.subsidy.util.excel; + +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 lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.BooleanUtils; +import org.apache.commons.lang3.CharUtils; +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.math.NumberUtils; +import org.apache.poi.hssf.usermodel.HSSFCellStyle; +import org.apache.poi.hssf.usermodel.HSSFDateUtil; +import org.apache.poi.hssf.usermodel.HSSFFont; +import org.apache.poi.hssf.usermodel.HSSFWorkbook; +import org.apache.poi.hssf.util.CellRangeAddress; +import org.apache.poi.ss.usermodel.*; +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.apache.poi.xssf.usermodel.XSSFWorkbook; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; +import org.springframework.web.multipart.MultipartFile; + +import javax.servlet.ServletOutputStream; +import javax.servlet.http.HttpServletResponse; +import java.io.*; +import java.lang.reflect.Constructor; +import java.lang.reflect.Field; +import java.math.BigDecimal; +import java.net.URLEncoder; +import java.util.*; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import java.util.zip.ZipOutputStream; + +/** + * Excel工具 + * + * @author DengMin + * @date 2019/08/27 13:57 + **/ +@Slf4j +public class ExcelUtil { + + private final static String EXCEL2003 = "xls"; + + private final static String EXCEL2007 = "xlsx"; + + /** + * 导入excel文件 + * + * @param path + * @param cls + * @param file + * @param <T> + * @return + */ + public static <T> List<T> readExcel(String path, Class<T> cls, MultipartFile file) { + String fileName = file.getOriginalFilename(); + if (!fileName.matches("^.+\\.(?i)(xls)$") && !fileName.matches("^.+\\.(?i)(xlsx)$")) { + log.info("上传文件格式不正确"); +// throw new HTTPException(10022); + } + + List<T> dataList = new ArrayList<>(); + Workbook workbook = null; + try { + InputStream is = file.getInputStream(); + if (fileName.endsWith(EXCEL2007)) { + // FileInputStream is = new FileInputStream(new File(path)); + workbook = new XSSFWorkbook(is); + } + + if (fileName.endsWith(EXCEL2003)) { + // FileInputStream is = new FileInputStream(new File(path)); + workbook = new HSSFWorkbook(is); + } + + if (workbook != null) { + Map<String, List<Field>> classMap = new HashMap<>(); + List<Field> fields = Stream.of(cls.getDeclaredFields()).collect(Collectors.toList()); + fields.forEach(field -> { + ExcelColumnUtil annotation = field.getAnnotation(ExcelColumnUtil.class); + if (annotation != null) { + String value = annotation.value(); + if (StringUtils.isBlank(value)) { + return; + } + + if (!classMap.containsKey(value)) { + classMap.put(value, new ArrayList<>()); + } + + field.setAccessible(true); + classMap.get(value).add(field); + } + }); + //索引-->columns + Map<Integer, List<Field>> reflectionMap = new HashMap<>(); + //默认读取第一个sheet + Sheet sheet = workbook.getSheetAt(0); + + boolean firstRow = true; + for (int i = 0; i <= sheet.getLastRowNum(); i++) { + Row row = sheet.getRow(i); + //提取标题 + if (firstRow) { + for (int j = 0; j <= row.getLastCellNum(); j++) { + Cell cell = row.getCell(j); + String cellValue = getCellValue(cell); + if (classMap.containsKey(cellValue)) { + reflectionMap.put(j, classMap.get(cellValue)); + } + } + + firstRow = false; + } else { + //忽略空白行 + if (row == null) { + continue; + } + + try { + T t = cls.newInstance(); + //判断是否为空白行 + boolean allBlank = true; + for (int j = 0; j <= row.getLastCellNum(); j++) { + if (reflectionMap.containsKey(j)) { + Cell cell = row.getCell(j); + String cellValue = getCellValue(cell); + if (StringUtils.isNotBlank(cellValue)) { + allBlank = false; + } + List<Field> fieldList = reflectionMap.get(j); + fieldList.forEach(x -> { + try { + handleField(t, cellValue, x); + } catch (Exception e) { + e.printStackTrace(); + log.error(String.format("reflect field:%s value:%s exception!", x.getName(), cellValue), e); + } + }); + } + } + + if (!allBlank) { + dataList.add(t); + } + } catch (Exception e) { + e.printStackTrace(); + log.error(String.format("parse row:%s exception!", i), e); + } + } + } + } + } catch (Exception e) { + e.printStackTrace(); + log.error(String.format("parse excel exception!"), e); + } finally { + if (workbook != null) { + try { + workbook.close(); + } catch (Exception e) { + e.printStackTrace(); + log.error(String.format("parse excel exception!"), e); + } + } + } + return dataList; + } + + /** + * 导出excel文件 + * + * @param list + * @param cls + * @param <T> + */ + public static <T> void writeExcel(List<T> list, Class cls) { + ServletRequestAttributes servletRequestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); + HttpServletResponse response = servletRequestAttributes.getResponse(); + Field[] fields = cls.getDeclaredFields(); + List<Field> fieldList = Arrays.stream(fields).filter(field -> { + ExcelColumn annotation = field.getAnnotation(ExcelColumn.class); + if (annotation != null) { + field.setAccessible(true); + return true; + } + return false; + }).sorted(Comparator.comparing(field -> { + int col = 0; + ExcelColumn annotation = field.getAnnotation(ExcelColumn.class); + if (annotation != null) { + col = annotation.col(); + } + return col; + })).collect(Collectors.toList()); + + Workbook wb = new XSSFWorkbook(); + Sheet sheet = wb.createSheet(); + AtomicInteger ai = new AtomicInteger(); + { + Row row = sheet.createRow(ai.getAndIncrement()); + AtomicInteger at = new AtomicInteger(); + fieldList.forEach(field -> { + ExcelColumn annotation = field.getAnnotation(ExcelColumn.class); + String columnName = ""; + if (annotation != null) { + columnName = annotation.value(); + } + Cell cell = row.createCell(at.getAndIncrement()); + CellStyle cellStyle = wb.createCellStyle(); + cellStyle.setFillForegroundColor(IndexedColors.PALE_BLUE.getIndex()); + Font font = wb.createFont(); + font.setBoldweight(Font.BOLDWEIGHT_BOLD); + cellStyle.setFont(font); + cell.setCellStyle(cellStyle); + cell.setCellValue(columnName); + }); + + if (list != null) { + list.forEach(data -> { + Row r = sheet.createRow(ai.getAndIncrement()); + AtomicInteger a = new AtomicInteger(); + fieldList.forEach(field -> { + try { + Class<?> type = field.getType(); + Object value = field.get(data); + Cell cell = r.createCell(a.getAndIncrement()); + if (value != null) { + cell.setCellValue(value.toString()); + } + } catch (IllegalAccessException e) { + e.printStackTrace(); + } + }); + }); + for (int i = 0; i < list.size(); i++) { + sheet.autoSizeColumn(i); + } + } + String fileName = String.valueOf(new Date().getTime()); + buildExcelDocument(fileName + "." + EXCEL2007, wb, response); + } + } + + public static <T> void writeMemberExcel(String companyName, String studyDate, String courseName, String title, List<ClassDetailVO> list, List<String> headerList) throws Exception { + + ServletRequestAttributes requestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); + HttpServletResponse response = requestAttributes.getResponse(); + response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); + response.addHeader("content-disposition", "attachment;filename=" + + java.net.URLEncoder.encode("member.xlsx", "utf-8")); + + // 声明一个工作薄 + SXSSFWorkbook workbook = new SXSSFWorkbook(1000);//缓存 + workbook.setCompressTempFiles(true); + //表头样式 + CellStyle titleStyle = workbook.createCellStyle(); + setStyle(titleStyle); + Font titleFont = workbook.createFont(); + titleFont.setFontHeightInPoints((short) 20); + titleFont.setBoldweight((short) 700); + titleStyle.setFont(titleFont); + + //第二行/第三行样式 + CellStyle secondStyle = workbook.createCellStyle(); + secondStyle.setBorderBottom(HSSFCellStyle.BORDER_THIN); //下边框 + secondStyle.setBorderLeft(HSSFCellStyle.BORDER_THIN);//左边框 + secondStyle.setBorderTop(HSSFCellStyle.BORDER_THIN);//上边框 + secondStyle.setBorderRight(HSSFCellStyle.BORDER_THIN);//右边框 + secondStyle.setAlignment(HSSFCellStyle.ALIGN_LEFT); + Font secondFont = workbook.createFont(); + secondStyle.setFont(secondFont); + + // 列头样式 + CellStyle headerStyle = workbook.createCellStyle(); + setStyle(headerStyle); + Font headerFont = workbook.createFont(); + headerFont.setFontHeightInPoints((short) 12); + headerFont.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);//粗体显示 + headerStyle.setFont(headerFont); + + // 数据单元格样式 + CellStyle cellStyle = workbook.createCellStyle(); + setStyle(cellStyle); + Font cellFont = workbook.createFont(); + cellFont.setBoldweight(HSSFFont.BOLDWEIGHT_NORMAL); + cellStyle.setFont(cellFont); + // 生成一个(带标题)表格 + SXSSFSheet sheet = workbook.createSheet(); + //设置列宽 + int minBytes = 17;//至少字节数 + int[] arrColWidth = new int[headerList.size()]; + // 产生表格标题行,以及设置列宽 + String[] headers = new String[headerList.size()]; + int ii = 0; + for (int i = 0; i < headerList.size(); i++) { + + headers[ii] = headerList.get(i); + + int bytes = headerList.get(i).getBytes().length; + arrColWidth[ii] = bytes < minBytes ? minBytes : bytes; + sheet.setColumnWidth(ii, arrColWidth[ii] * 256); + ii++; + } + + //第二行 + int[] secondWidth = new int[2]; + // 产生表格标题行,以及设置列宽 + String[] secondHead = new String[2]; + List<String> secondList = Arrays.asList(new String[]{"培训实施单位:" + companyName, "培训时间:" + studyDate}); + + //第三行 + int[] thirdWidth = new int[2]; + // 产生表格标题行,以及设置列宽 + String[] thirdHead = new String[2]; + List<String> thirdList = Arrays.asList(new String[]{"培训项目:" + courseName, "培训平台:有课互联系统"}); + + + ii = 0; + for (int i = 0; i < 2; i++) { + secondHead[ii] = secondList.get(i); + int bytes = secondList.get(i).getBytes().length; + secondWidth[ii] = bytes < minBytes ? minBytes : bytes; + sheet.setColumnWidth(ii, secondWidth[ii] * 256); + ii++; + } + + ii = 0; + for (int i = 0; i < 2; i++) { + thirdHead[ii] = thirdList.get(i); + int bytes = thirdList.get(i).getBytes().length; + thirdWidth[ii] = bytes < minBytes ? minBytes : bytes; + sheet.setColumnWidth(ii, thirdWidth[ii] * 256); + ii++; + } + + // 遍历集合数据,产生数据行 + //标题 0 + SXSSFRow titleRow = sheet.createRow(0);//表头 rowIndex=0 + titleRow.createCell(0).setCellValue(title); + setBorderStyle(HSSFCellStyle.BORDER_THIN, new CellRangeAddress(0, 0, 0, 0), sheet, workbook); //给合并过的单元格加边框 + titleRow.getCell(0).setCellStyle(titleStyle); + sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, headerList.size() - 1)); + + //第二行 1 + SXSSFRow secondRow = sheet.createRow(1); //第二行 rowIndex =1 + CellRangeAddress cellRangeAddress21 = new CellRangeAddress(1, 1, 0, 4); + sheet.addMergedRegion(cellRangeAddress21); + setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress21, sheet, workbook); //给合并过的单元格加边框 + + CellRangeAddress cellRangeAddress22 = new CellRangeAddress(1, 1, 5, 10); + sheet.addMergedRegion(cellRangeAddress22); + setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress22, sheet, workbook); //给合并过的单元格加边框 + + secondRow.createCell(0).setCellValue(secondHead[0]); + secondRow.getCell(0).setCellStyle(secondStyle); + + secondRow.createCell(5).setCellValue(secondHead[1]); + secondRow.getCell(5).setCellStyle(secondStyle); + + //第三行 2 + SXSSFRow thirdRow = sheet.createRow(2); //第二行 rowIndex =1 + CellRangeAddress cellRangeAddress31 = new CellRangeAddress(2, 2, 0, 4); + sheet.addMergedRegion(cellRangeAddress31); + setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress31, sheet, workbook); //给合并过的单元格加边框 + + CellRangeAddress cellRangeAddress32 = new CellRangeAddress(2, 2, 5, 10); + sheet.addMergedRegion(cellRangeAddress32); + setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress32, sheet, workbook); //给合并过的单元格加边框 + thirdRow.createCell(0).setCellValue(thirdHead[0]); + thirdRow.getCell(0).setCellStyle(secondStyle); + + thirdRow.createCell(5).setCellValue(thirdHead[1]); + thirdRow.getCell(5).setCellStyle(secondStyle); + + //标题 3 + SXSSFRow headerRow = sheet.createRow(3); //列头 rowIndex =1 + for (int i = 0; i < headers.length; i++) { + headerRow.createCell(i).setCellValue(headers[i]); + headerRow.getCell(i).setCellStyle(headerStyle); + } + + int seq = 1; + + //内容 + int rowIndex = 0; + for (ClassDetailVO classDetailVO : list) { + if (rowIndex == 65535 || rowIndex == 0) { + if (rowIndex != 0) { + sheet = workbook.createSheet();//如果数据超过了,则在第二页显示 + } + rowIndex = 4;//数据内容从 rowIndex=2开始 + } + + SXSSFRow dataRow = sheet.createRow(rowIndex); + + SXSSFCell newCell = dataRow.createCell(0); + cellStyle.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(seq); + + + newCell = dataRow.createCell(1); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(classDetailVO.getUserName()); + + + newCell = dataRow.createCell(2); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(classDetailVO.getIdCard()); + + + newCell = dataRow.createCell(3); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(classDetailVO.getAccountName()); + + newCell = dataRow.createCell(4); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(classDetailVO.getTelephone()); + + newCell = dataRow.createCell(5); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(classDetailVO.getSignCounts()); + + newCell = dataRow.createCell(6); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(classDetailVO.getClassProcess()); + + newCell = dataRow.createCell(7); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(classDetailVO.getTrainingLength()); + + newCell = dataRow.createCell(8); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(classDetailVO.getAskCounts()); + + newCell = dataRow.createCell(9); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(classDetailVO.getScore()); + + newCell = dataRow.createCell(10); + newCell.setCellStyle(cellStyle); + if (classDetailVO.getScore() >= 60) { + newCell.setCellValue("合格"); + } else { + newCell.setCellValue("不合格"); + } + rowIndex++; + seq++; + + } + + try { + OutputStream outputStream = response.getOutputStream(); + workbook.write(outputStream); + workbook.close(); + workbook.dispose(); + } catch (IOException e) { + e.printStackTrace(); + } + } + + public static <T> void writeSignExcel(String companyName, String studyDate, String courseName, String title, List<ClassSignVO>list, List<String> headerList) throws Exception { + + ServletRequestAttributes requestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); + HttpServletResponse response = requestAttributes.getResponse(); + response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); + response.addHeader("content-disposition", "attachment;filename=" + + java.net.URLEncoder.encode("sign.xlsx", "utf-8")); + + // 声明一个工作薄 + SXSSFWorkbook workbook = new SXSSFWorkbook(1000);//缓存 + workbook.setCompressTempFiles(true); + //表头样式 + CellStyle titleStyle = workbook.createCellStyle(); + setStyle(titleStyle); + Font titleFont = workbook.createFont(); + titleFont.setFontHeightInPoints((short) 20); + titleFont.setBoldweight((short) 700); + titleStyle.setFont(titleFont); + + //第二行 + CellStyle secondStyle = workbook.createCellStyle(); + secondStyle.setBorderBottom(HSSFCellStyle.BORDER_THIN); //下边框 + secondStyle.setBorderLeft(HSSFCellStyle.BORDER_THIN);//左边框 + secondStyle.setBorderTop(HSSFCellStyle.BORDER_THIN);//上边框 + secondStyle.setBorderRight(HSSFCellStyle.BORDER_THIN);//右边框 + secondStyle.setAlignment(HSSFCellStyle.ALIGN_LEFT); + Font secondFont = workbook.createFont(); + secondStyle.setFont(secondFont); + + //第三行 + CellStyle thirdStyle = workbook.createCellStyle(); + thirdStyle.setBorderBottom(HSSFCellStyle.BORDER_THIN); //下边框 + thirdStyle.setBorderLeft(HSSFCellStyle.BORDER_THIN);//左边框 + thirdStyle.setBorderTop(HSSFCellStyle.BORDER_THIN);//上边框 + thirdStyle.setBorderRight(HSSFCellStyle.BORDER_THIN);//右边框 + secondStyle.setAlignment(HSSFCellStyle.ALIGN_LEFT); + Font thirdFont = workbook.createFont(); + thirdStyle.setFont(thirdFont); + + // 列头样式 + CellStyle headerStyle = workbook.createCellStyle(); + setStyle(headerStyle); + Font headerFont = workbook.createFont(); + headerFont.setFontHeightInPoints((short) 12); + headerFont.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);//粗体显示 + headerStyle.setFont(headerFont); + + // 数据单元格样式 + CellStyle cellStyle = workbook.createCellStyle(); + setStyle(cellStyle); + Font cellFont = workbook.createFont(); + cellFont.setBoldweight(HSSFFont.BOLDWEIGHT_NORMAL); + cellStyle.setFont(cellFont); + // 生成一个(带标题)表格 + SXSSFSheet sheet = workbook.createSheet(); + //设置列宽 + int minBytes = 17;//至少字节数 + int[] arrColWidth = new int[headerList.size()]; + // 产生表格标题行,以及设置列宽 + String[] headers = new String[headerList.size()]; + int ii = 0; + for (int i = 0; i < headerList.size(); i++) { + + headers[ii] = headerList.get(i); + + int bytes = headerList.get(i).getBytes().length; + arrColWidth[ii] = bytes < minBytes ? minBytes : bytes; + sheet.setColumnWidth(ii, arrColWidth[ii] * 256); + ii++; + } + + //第二行 + int[] secondWidth = new int[2]; + // 产生表格标题行,以及设置列宽 + String[] secondHead = new String[2]; + List<String> secondList = Arrays.asList(new String[]{"培训实施单位:" + companyName, "培训时间:" + studyDate}); + + //第三行 + int[] thirdWidth = new int[2]; + // 产生表格标题行,以及设置列宽 + String[] thirdHead = new String[2]; + List<String> thirdList = Arrays.asList(new String[]{"培训项目:" + courseName, "培训平台:有课互联系统"}); + + + ii = 0; + for (int i = 0; i < 2; i++) { + secondHead[ii] = secondList.get(i); + int bytes = secondList.get(i).getBytes().length; + secondWidth[ii] = bytes < minBytes ? minBytes : bytes; + sheet.setColumnWidth(ii, secondWidth[ii] * 256); + ii++; + } + + ii = 0; + for (int i = 0; i < 2; i++) { + thirdHead[ii] = thirdList.get(i); + int bytes = thirdList.get(i).getBytes().length; + thirdWidth[ii] = bytes < minBytes ? minBytes : bytes; + sheet.setColumnWidth(ii, thirdWidth[ii] * 256); + ii++; + } + + // 遍历集合数据,产生数据行 + //标题 0 + SXSSFRow titleRow = sheet.createRow(0);//表头 rowIndex=0 + titleRow.createCell(0).setCellValue(title); + setBorderStyle(HSSFCellStyle.BORDER_THIN, new CellRangeAddress(0, 0, 0, 0), sheet, workbook); //给合并过的单元格加边框 + titleRow.getCell(0).setCellStyle(titleStyle); + sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, headerList.size() - 1)); + + //第二行 1 + SXSSFRow secondRow = sheet.createRow(1); //第二行 rowIndex =1 + CellRangeAddress cellRangeAddress21 = new CellRangeAddress(1, 1, 0, 3); + sheet.addMergedRegion(cellRangeAddress21); + setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress21, sheet, workbook); //给合并过的单元格加边框 + + CellRangeAddress cellRangeAddress22 = new CellRangeAddress(1, 1, 4, 8); + sheet.addMergedRegion(cellRangeAddress22); + setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress22, sheet, workbook); //给合并过的单元格加边框 + + secondRow.createCell(0).setCellValue(secondHead[0]); + secondRow.getCell(0).setCellStyle(secondStyle); + + secondRow.createCell(4).setCellValue(secondHead[1]); + secondRow.getCell(4).setCellStyle(secondStyle); + + //第三行 2 + SXSSFRow thirdRow = sheet.createRow(2); //第二行 rowIndex =1 + CellRangeAddress cellRangeAddress31 = new CellRangeAddress(2, 2, 0, 3); + sheet.addMergedRegion(cellRangeAddress31); + setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress31, sheet, workbook); //给合并过的单元格加边框 + + CellRangeAddress cellRangeAddress32 = new CellRangeAddress(2, 2, 4, 8); + sheet.addMergedRegion(cellRangeAddress32); + setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress32, sheet, workbook); //给合并过的单元格加边框 + thirdRow.createCell(0).setCellValue(thirdHead[0]); + thirdRow.getCell(0).setCellStyle(thirdStyle); + + thirdRow.createCell(4).setCellValue(thirdHead[1]); + thirdRow.getCell(4).setCellStyle(thirdStyle); + + //标题 3 + SXSSFRow headerRow = sheet.createRow(3); //列头 rowIndex =1 + for (int i = 0; i < headers.length; i++) { + headerRow.createCell(i).setCellValue(headers[i]); + headerRow.getCell(i).setCellStyle(headerStyle); + } + + int seq = 1; + + //内容 + int rowIndex = 0; + for (ClassSignVO classSignVO : list) { + if (rowIndex == 65535 || rowIndex == 0) { + if (rowIndex != 0) { + sheet = workbook.createSheet();//如果数据超过了,则在第二页显示 + } + rowIndex = 4;//数据内容从 rowIndex=2开始 + } + + SXSSFRow dataRow = sheet.createRow(rowIndex); + + SXSSFCell newCell = dataRow.createCell(0); + cellStyle.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(seq); + + + newCell = dataRow.createCell(1); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(classSignVO.getUserName()); + + + newCell = dataRow.createCell(2); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(classSignVO.getIdCard()); + + + newCell = dataRow.createCell(3); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(classSignVO.getTelephone()); + + newCell = dataRow.createCell(4); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(classSignVO.getTrainingLength()); + + newCell = dataRow.createCell(5); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(classSignVO.getClassProcess()); + + newCell = dataRow.createCell(6); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(classSignVO.getPercent()); + + newCell = dataRow.createCell(7); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(classSignVO.getSignCounts()); + + newCell = dataRow.createCell(8); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(classSignVO.getSignInDateList()); + + rowIndex++; + seq++; + + } + + try { + OutputStream outputStream = response.getOutputStream(); + workbook.write(outputStream); + workbook.close(); + workbook.dispose(); + } catch (IOException e) { + e.printStackTrace(); + } + } + + public static <T> void writeTestExcel(String companyName, String studyDate, String courseName, String title, List<ExerciseTestVO> list, List<String> headerList) throws Exception { + + ServletRequestAttributes requestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); + HttpServletResponse response = requestAttributes.getResponse(); + response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); + response.addHeader("content-disposition", "attachment;filename=" + + java.net.URLEncoder.encode("test.xlsx", "utf-8")); + + // 声明一个工作薄 + SXSSFWorkbook workbook = new SXSSFWorkbook(1000);//缓存 + workbook.setCompressTempFiles(true); + //表头样式 + CellStyle titleStyle = workbook.createCellStyle(); + setStyle(titleStyle); + Font titleFont = workbook.createFont(); + titleFont.setFontHeightInPoints((short) 20); + titleFont.setBoldweight((short) 700); + titleStyle.setFont(titleFont); + + //第二行 + CellStyle secondStyle = workbook.createCellStyle(); + secondStyle.setBorderBottom(HSSFCellStyle.BORDER_THIN); //下边框 + secondStyle.setBorderLeft(HSSFCellStyle.BORDER_THIN);//左边框 + secondStyle.setBorderTop(HSSFCellStyle.BORDER_THIN);//上边框 + secondStyle.setBorderRight(HSSFCellStyle.BORDER_THIN);//右边框 + secondStyle.setAlignment(HSSFCellStyle.ALIGN_LEFT); + Font secondFont = workbook.createFont(); + secondStyle.setFont(secondFont); + + //第三行 + CellStyle thirdStyle = workbook.createCellStyle(); + thirdStyle.setBorderBottom(HSSFCellStyle.BORDER_THIN); //下边框 + thirdStyle.setBorderLeft(HSSFCellStyle.BORDER_THIN);//左边框 + thirdStyle.setBorderTop(HSSFCellStyle.BORDER_THIN);//上边框 + thirdStyle.setBorderRight(HSSFCellStyle.BORDER_THIN);//右边框 + secondStyle.setAlignment(HSSFCellStyle.ALIGN_LEFT); + Font thirdFont = workbook.createFont(); + thirdStyle.setFont(thirdFont); + + // 列头样式 + CellStyle headerStyle = workbook.createCellStyle(); + setStyle(headerStyle); + Font headerFont = workbook.createFont(); + headerFont.setFontHeightInPoints((short) 12); + headerFont.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);//粗体显示 + headerStyle.setFont(headerFont); + + // 数据单元格样式 + CellStyle cellStyle = workbook.createCellStyle(); + setStyle(cellStyle); + Font cellFont = workbook.createFont(); + cellFont.setBoldweight(HSSFFont.BOLDWEIGHT_NORMAL); + cellStyle.setFont(cellFont); + // 生成一个(带标题)表格 + SXSSFSheet sheet = workbook.createSheet(); + //设置列宽 + int minBytes = 17;//至少字节数 + int[] arrColWidth = new int[headerList.size()]; + // 产生表格标题行,以及设置列宽 + String[] headers = new String[headerList.size()]; + int ii = 0; + for (int i = 0; i < headerList.size(); i++) { + + headers[ii] = headerList.get(i); + + int bytes = headerList.get(i).getBytes().length; + arrColWidth[ii] = bytes < minBytes ? minBytes : bytes; + sheet.setColumnWidth(ii, arrColWidth[ii] * 256); + ii++; + } + + //第二行 + int[] secondWidth = new int[2]; + // 产生表格标题行,以及设置列宽 + String[] secondHead = new String[2]; + List<String> secondList = Arrays.asList(new String[]{"培训实施单位:" + companyName, "培训时间:" + studyDate}); + + //第三行 + int[] thirdWidth = new int[2]; + // 产生表格标题行,以及设置列宽 + String[] thirdHead = new String[2]; + List<String> thirdList = Arrays.asList(new String[]{"培训项目:" + courseName, "培训平台:有课互联系统"}); + + + ii = 0; + for (int i = 0; i < 2; i++) { + secondHead[ii] = secondList.get(i); + int bytes = secondList.get(i).getBytes().length; + secondWidth[ii] = bytes < minBytes ? minBytes : bytes; + sheet.setColumnWidth(ii, secondWidth[ii] * 256); + ii++; + } + + ii = 0; + for (int i = 0; i < 2; i++) { + thirdHead[ii] = thirdList.get(i); + int bytes = thirdList.get(i).getBytes().length; + thirdWidth[ii] = bytes < minBytes ? minBytes : bytes; + sheet.setColumnWidth(ii, thirdWidth[ii] * 256); + ii++; + } + + // 遍历集合数据,产生数据行 + //标题 0 + SXSSFRow titleRow = sheet.createRow(0);//表头 rowIndex=0 + titleRow.createCell(0).setCellValue(title); + setBorderStyle(HSSFCellStyle.BORDER_THIN, new CellRangeAddress(0, 0, 0, 0), sheet, workbook); //给合并过的单元格加边框 + titleRow.getCell(0).setCellStyle(titleStyle); + sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, headerList.size() - 1)); + + //第二行 1 + SXSSFRow secondRow = sheet.createRow(1); //第二行 rowIndex =1 + CellRangeAddress cellRangeAddress21 = new CellRangeAddress(1, 1, 0, 3); + sheet.addMergedRegion(cellRangeAddress21); + setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress21, sheet, workbook); //给合并过的单元格加边框 + + CellRangeAddress cellRangeAddress22 = new CellRangeAddress(1, 1, 4, 6); + sheet.addMergedRegion(cellRangeAddress22); + setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress22, sheet, workbook); //给合并过的单元格加边框 + + secondRow.createCell(0).setCellValue(secondHead[0]); + secondRow.getCell(0).setCellStyle(secondStyle); + + secondRow.createCell(4).setCellValue(secondHead[1]); + secondRow.getCell(4).setCellStyle(secondStyle); + + //第三行 2 + SXSSFRow thirdRow = sheet.createRow(2); //第二行 rowIndex =1 + CellRangeAddress cellRangeAddress31 = new CellRangeAddress(2, 2, 0, 3); + sheet.addMergedRegion(cellRangeAddress31); + setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress31, sheet, workbook); //给合并过的单元格加边框 + + CellRangeAddress cellRangeAddress32 = new CellRangeAddress(2, 2, 4, 6); + sheet.addMergedRegion(cellRangeAddress32); + setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress32, sheet, workbook); //给合并过的单元格加边框 + thirdRow.createCell(0).setCellValue(thirdHead[0]); + thirdRow.getCell(0).setCellStyle(thirdStyle); + + thirdRow.createCell(4).setCellValue(thirdHead[1]); + thirdRow.getCell(4).setCellStyle(thirdStyle); + + //标题 3 + SXSSFRow headerRow = sheet.createRow(3); //列头 rowIndex =1 + for (int i = 0; i < headers.length; i++) { + headerRow.createCell(i).setCellValue(headers[i]); + headerRow.getCell(i).setCellStyle(headerStyle); + } + + int seq = 1; + + //内容 + int rowIndex = 0; + for (ExerciseTestVO exerciseTestVO : list) { + if (rowIndex == 65535 || rowIndex == 0) { + if (rowIndex != 0) { + sheet = workbook.createSheet();//如果数据超过了,则在第二页显示 + } + rowIndex = 4;//数据内容从 rowIndex=2开始 + } + + SXSSFRow dataRow = sheet.createRow(rowIndex); + + SXSSFCell newCell = dataRow.createCell(0); + cellStyle.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(seq); + + + newCell = dataRow.createCell(1); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(exerciseTestVO.getUserName()); + + + newCell = dataRow.createCell(2); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(exerciseTestVO.getIdCard()); + + + newCell = dataRow.createCell(3); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(exerciseTestVO.getTelephone()); + + newCell = dataRow.createCell(4); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(exerciseTestVO.getScore()); + + //次数 + newCell = dataRow.createCell(5); + newCell.setCellStyle(cellStyle); + if (exerciseTestVO.getScore()!=0){ + newCell.setCellValue(1); + }else { + newCell.setCellValue(0); + } + + newCell = dataRow.createCell(6); + newCell.setCellStyle(cellStyle); + if (exerciseTestVO.getScore()>=60){ + newCell.setCellValue("合格"); + }else { + newCell.setCellValue("不合格"); + } + + rowIndex++; + seq++; + + } + + try { + OutputStream outputStream = response.getOutputStream(); + workbook.write(outputStream); + workbook.close(); + workbook.dispose(); + } catch (IOException e) { + e.printStackTrace(); + } + } + + public static <T> void writeAnswerExcel(String companyName, String studyDate, String courseName, String title, List<AnswerRecordVO> list, List<String> headerList) throws Exception { + + ServletRequestAttributes requestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); + HttpServletResponse response = requestAttributes.getResponse(); + response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); + response.addHeader("content-disposition", "attachment;filename=" + + java.net.URLEncoder.encode("answer.xlsx", "utf-8")); + + // 声明一个工作薄 + SXSSFWorkbook workbook = new SXSSFWorkbook(1000);//缓存 + workbook.setCompressTempFiles(true); + //表头样式 + CellStyle titleStyle = workbook.createCellStyle(); + setStyle(titleStyle); + Font titleFont = workbook.createFont(); + titleFont.setFontHeightInPoints((short) 20); + titleFont.setBoldweight((short) 700); + titleStyle.setFont(titleFont); + + //第二行 + CellStyle secondStyle = workbook.createCellStyle(); + secondStyle.setBorderBottom(HSSFCellStyle.BORDER_THIN); //下边框 + secondStyle.setBorderLeft(HSSFCellStyle.BORDER_THIN);//左边框 + secondStyle.setBorderTop(HSSFCellStyle.BORDER_THIN);//上边框 + secondStyle.setBorderRight(HSSFCellStyle.BORDER_THIN);//右边框 + secondStyle.setAlignment(HSSFCellStyle.ALIGN_LEFT); + Font secondFont = workbook.createFont(); + secondStyle.setFont(secondFont); + + //第三行 + CellStyle thirdStyle = workbook.createCellStyle(); + thirdStyle.setBorderBottom(HSSFCellStyle.BORDER_THIN); //下边框 + thirdStyle.setBorderLeft(HSSFCellStyle.BORDER_THIN);//左边框 + thirdStyle.setBorderTop(HSSFCellStyle.BORDER_THIN);//上边框 + thirdStyle.setBorderRight(HSSFCellStyle.BORDER_THIN);//右边框 + secondStyle.setAlignment(HSSFCellStyle.ALIGN_LEFT); + Font thirdFont = workbook.createFont(); + thirdStyle.setFont(thirdFont); + + // 列头样式 + CellStyle headerStyle = workbook.createCellStyle(); + setStyle(headerStyle); + Font headerFont = workbook.createFont(); + headerFont.setFontHeightInPoints((short) 12); + headerFont.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);//粗体显示 + headerStyle.setFont(headerFont); + + // 数据单元格样式 + CellStyle cellStyle = workbook.createCellStyle(); + setStyle(cellStyle); + Font cellFont = workbook.createFont(); + cellFont.setBoldweight(HSSFFont.BOLDWEIGHT_NORMAL); + cellStyle.setFont(cellFont); + // 生成一个(带标题)表格 + SXSSFSheet sheet = workbook.createSheet(); + //设置列宽 + int minBytes = 17;//至少字节数 + int[] arrColWidth = new int[headerList.size()]; + // 产生表格标题行,以及设置列宽 + String[] headers = new String[headerList.size()]; + int ii = 0; + for (int i = 0; i < headerList.size(); i++) { + + headers[ii] = headerList.get(i); + + int bytes = headerList.get(i).getBytes().length; + arrColWidth[ii] = bytes < minBytes ? minBytes : bytes; + sheet.setColumnWidth(ii, arrColWidth[ii] * 256); + ii++; + } + + //第二行 + int[] secondWidth = new int[2]; + // 产生表格标题行,以及设置列宽 + String[] secondHead = new String[2]; + List<String> secondList = Arrays.asList(new String[]{"培训实施单位:" + companyName, "培训时间:" + studyDate}); + + //第三行 + int[] thirdWidth = new int[2]; + // 产生表格标题行,以及设置列宽 + String[] thirdHead = new String[2]; + List<String> thirdList = Arrays.asList(new String[]{"培训项目:" + courseName, "培训平台:有课互联系统"}); + + + ii = 0; + for (int i = 0; i < 2; i++) { + secondHead[ii] = secondList.get(i); + int bytes = secondList.get(i).getBytes().length; + secondWidth[ii] = bytes < minBytes ? minBytes : bytes; + sheet.setColumnWidth(ii, secondWidth[ii] * 256); + ii++; + } + + ii = 0; + for (int i = 0; i < 2; i++) { + thirdHead[ii] = thirdList.get(i); + int bytes = thirdList.get(i).getBytes().length; + thirdWidth[ii] = bytes < minBytes ? minBytes : bytes; + sheet.setColumnWidth(ii, thirdWidth[ii] * 256); + ii++; + } + + // 遍历集合数据,产生数据行 + //标题 0 + SXSSFRow titleRow = sheet.createRow(0);//表头 rowIndex=0 + titleRow.createCell(0).setCellValue(title); + setBorderStyle(HSSFCellStyle.BORDER_THIN, new CellRangeAddress(0, 0, 0, 0), sheet, workbook); //给合并过的单元格加边框 + titleRow.getCell(0).setCellStyle(titleStyle); + sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, headerList.size() - 1)); + + //第二行 1 + SXSSFRow secondRow = sheet.createRow(1); //第二行 rowIndex =1 + CellRangeAddress cellRangeAddress21 = new CellRangeAddress(1, 1, 0, 2); + sheet.addMergedRegion(cellRangeAddress21); + setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress21, sheet, workbook); //给合并过的单元格加边框 + + CellRangeAddress cellRangeAddress22 = new CellRangeAddress(1, 1, 3, 5); + sheet.addMergedRegion(cellRangeAddress22); + setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress22, sheet, workbook); //给合并过的单元格加边框 + + secondRow.createCell(0).setCellValue(secondHead[0]); + secondRow.getCell(0).setCellStyle(secondStyle); + + secondRow.createCell(3).setCellValue(secondHead[1]); + secondRow.getCell(3).setCellStyle(secondStyle); + + //第三行 2 + SXSSFRow thirdRow = sheet.createRow(2); //第二行 rowIndex =1 + CellRangeAddress cellRangeAddress31 = new CellRangeAddress(2, 2, 0, 2); + sheet.addMergedRegion(cellRangeAddress31); + setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress31, sheet, workbook); //给合并过的单元格加边框 + + CellRangeAddress cellRangeAddress32 = new CellRangeAddress(2, 2, 3,5); + sheet.addMergedRegion(cellRangeAddress32); + setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress32, sheet, workbook); //给合并过的单元格加边框 + thirdRow.createCell(0).setCellValue(thirdHead[0]); + thirdRow.getCell(0).setCellStyle(thirdStyle); + + thirdRow.createCell(3).setCellValue(thirdHead[1]); + thirdRow.getCell(3).setCellStyle(thirdStyle); + + //标题 3 + SXSSFRow headerRow = sheet.createRow(3); //列头 rowIndex =1 + for (int i = 0; i < headers.length; i++) { + headerRow.createCell(i).setCellValue(headers[i]); + headerRow.getCell(i).setCellStyle(headerStyle); + } + + int seq = 1; + + //内容 + int rowIndex = 0; + for (AnswerRecordVO answerRecordVO : list) { + if (rowIndex == 65535 || rowIndex == 0) { + if (rowIndex != 0) { + sheet = workbook.createSheet();//如果数据超过了,则在第二页显示 + } + rowIndex = 4;//数据内容从 rowIndex=2开始 + } + + SXSSFRow dataRow = sheet.createRow(rowIndex); + + SXSSFCell newCell = dataRow.createCell(0); + cellStyle.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(seq); + + + newCell = dataRow.createCell(1); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(answerRecordVO.getTitle()); + + + newCell = dataRow.createCell(2); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(answerRecordVO.getAnswer()); + + + newCell = dataRow.createCell(3); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(answerRecordVO.getCreateDate()); + + newCell = dataRow.createCell(4); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(answerRecordVO.getUserName()); + + //次数 + newCell = dataRow.createCell(5); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(answerRecordVO.getUpdateDate()); + + rowIndex++; + seq++; + + } + + try { + OutputStream outputStream = response.getOutputStream(); + workbook.write(outputStream); + workbook.close(); + workbook.dispose(); + } catch (IOException e) { + e.printStackTrace(); + } + } + + private static void setStyle(CellStyle cellStyle) { + // 水平居中 + cellStyle.setAlignment(CellStyle.ALIGN_CENTER); + // 垂直居中 + cellStyle.setVerticalAlignment(CellStyle.ALIGN_CENTER); + // 边框 + cellStyle.setBorderTop(CellStyle.BORDER_THIN); + // 边框 + cellStyle.setBorderLeft(CellStyle.BORDER_THIN); + // 边框 + cellStyle.setBorderRight(CellStyle.BORDER_THIN); + // 边框 + cellStyle.setBorderBottom(CellStyle.BORDER_THIN); + } + + //也可用以下方法 + public static void setBorderStyle(int border, CellRangeAddress region, SXSSFSheet sheet, SXSSFWorkbook wb) { + CellStyle cs = wb.createCellStyle(); // 样式对象 + cs.setBorderBottom((short) border); + cs.setBorderTop((short) border); + cs.setBorderLeft((short) border); + cs.setBorderRight((short) border); + + setRegionStyle(cs, region, sheet); + } + + private static void setRegionStyle(CellStyle cs, CellRangeAddress region, SXSSFSheet sheet) { + for (int i = region.getFirstRow(); i <= region.getLastRow(); i++) { + SXSSFRow row = sheet.getRow(i); + if (row == null) { + row = sheet.createRow(i); + } + for (int j = region.getFirstColumn(); j <= region.getLastColumn(); j++) { + SXSSFCell cell = row.getCell(j); + if (cell == null) { + cell = row.createCell(j); + cell.setCellValue(""); + } + cell.setCellStyle(cs); + } + } + } + + + private static <T> void handleField(T t, String value, Field field) throws Exception { + Class<?> type = field.getType(); + if (type == null || type == void.class || StringUtils.isBlank(value)) { + return; + } + if (type == Object.class) { + field.set(t, value); + //数字类型 + } else if (type.getSuperclass() == null || type.getSuperclass() == Number.class) { + if (type == int.class || type == Integer.class) { + field.set(t, NumberUtils.toInt(value)); + } else if (type == long.class || type == Long.class) { + field.set(t, NumberUtils.toLong(value)); + } else if (type == byte.class || type == Byte.class) { + field.set(t, NumberUtils.toByte(value)); + } else if (type == short.class || type == Short.class) { + field.set(t, NumberUtils.toShort(value)); + } else if (type == double.class || type == Double.class) { + field.set(t, NumberUtils.toDouble(value)); + } else if (type == float.class || type == Float.class) { + field.set(t, NumberUtils.toFloat(value)); + } else if (type == char.class || type == Character.class) { + field.set(t, CharUtils.toChar(value)); + } else if (type == boolean.class) { + field.set(t, BooleanUtils.toBoolean(value)); + } else if (type == BigDecimal.class) { + field.set(t, new BigDecimal(value)); + } + } else if (type == Boolean.class) { + field.set(t, BooleanUtils.toBoolean(value)); + } else if (type == Date.class) { + // + field.set(t, value); + } else if (type == String.class) { + field.set(t, value); + } else { + Constructor<?> constructor = type.getConstructor(String.class); + field.set(t, constructor.newInstance(value)); + } + } + + private static String getCellValue(Cell cell) { + if (cell == null) { + return ""; + } + + if (cell.getCellType() == Cell.CELL_TYPE_NUMERIC) { + if (DateUtil.isCellDateFormatted(cell)) { + return HSSFDateUtil.getJavaDate(cell.getNumericCellValue()).toString(); + } else { + return new BigDecimal(cell.getNumericCellValue()).toString(); + } + } else if (cell.getCellType() == Cell.CELL_TYPE_STRING) { + return StringUtils.trimToEmpty(cell.getStringCellValue()); + } else if (cell.getCellType() == Cell.CELL_TYPE_FORMULA) { + return StringUtils.trimToEmpty(cell.getCellFormula()); + } else if (cell.getCellType() == Cell.CELL_TYPE_BLANK) { + return ""; + } else if (cell.getCellType() == Cell.CELL_TYPE_BOOLEAN) { + return String.valueOf(cell.getBooleanCellValue()); + } else if (cell.getCellType() == Cell.CELL_TYPE_ERROR) { + return "ERROR"; + } else { + return cell.toString().trim(); + } + } + + private static void buildExcelDocument(String fileName, Workbook wb, HttpServletResponse response) { + try { + response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); + response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName, "utf-8")); + response.flushBuffer(); + wb.write(response.getOutputStream()); + } catch (IOException e) { + log.error(String.format("downLoad excel exception"), e); + } + } + + private static void buildExcelFile(String path, Workbook wb) { + File file = new File(path); + if (file.exists()) { + file.delete(); + } + + try { + wb.write(new FileOutputStream(file)); + } catch (Exception e) { + log.error(String.format("downLoad excel exception"), e); + } + } +} diff --git a/src/main/java/com/subsidy/util/tree/Node.java b/src/main/java/com/subsidy/util/tree/Node.java new file mode 100644 index 0000000..bf53d6e --- /dev/null +++ b/src/main/java/com/subsidy/util/tree/Node.java @@ -0,0 +1,42 @@ +package com.subsidy.util.tree; + +import lombok.Data; + +@Data +public class Node implements Comparable<Node> { + + //主键 + private String id; + + //同级节点第几个元素 + private String number; + + //1.1 + private String text; + + //父节点 + private String parentId; + + private int level; + + public Node(String id, String number, String parentId, int level) { + this.id = id; + this.number = number; + this.parentId = parentId; + this.level = level; + } + + @Override + public int compareTo(Node o) { + if (this.level != o.level) { + return o.level - this.level; + } else { + if(this.number==null){ + return -1; + } + return this.number.compareTo(o.number); + } + } + + +} diff --git a/src/main/java/com/subsidy/util/tree/NumberTree.java b/src/main/java/com/subsidy/util/tree/NumberTree.java new file mode 100644 index 0000000..d051a9f --- /dev/null +++ b/src/main/java/com/subsidy/util/tree/NumberTree.java @@ -0,0 +1,212 @@ +package com.subsidy.util.tree; + +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +@Data +public class NumberTree { + + private String id; + + private List<Node> nodeList; + + private String separator; + + private int idSeq; + + private SerialNumber number; + + public NumberTree(String separator, SerialNumber number) { + init(); + this.separator = separator; + this.number = number; + + } + + public void init() { + idSeq = 1; + this.separator = "."; + if (this.nodeList == null) { + nodeList = new ArrayList<Node>(); + } + } + + + /** + * <p>功能描述:根据父节点获取所有子节点。</p> + */ + public List<Node> getChildNodes(Node pNode) { + String pId = pNode.getId(); + return getChildNodes(pId); + } + + /** + * <p>功能描述:根据父节点获取所有子节点。</p> + */ + public List<Node> getChildNodes(String pId) { + List<Node> childNodes = new ArrayList<Node>(); + for (Node n : nodeList) { + if (pId.equals(n.getParentId())) { + childNodes.add(n); + } + } + + return childNodes; + } + + /** + * <p>功能描述:获取本级值最大的节点。</p> + */ + public Node getMaxNodeForThisLevel(Node pNode) { + List<Node> childList = getChildNodes(pNode); + Node root = getRoot(nodeList); + if (childList.size() <= 0) { + return null; + } + Node maxNode = root; + for (Node node : childList) { + if (maxNode.getNumber().compareTo(node.getNumber()) < 0) { + maxNode = node; + } + } + return maxNode; + } + + /** + * <p>功能描述:生成下一个子节点。</p> + */ + public Node generateNextChildNode(Node node) { + Node newNode = null; + Node maxNode = getMaxNodeForThisLevel(node); + String nextNumber = number.firstNumber(); + int level = node.getLevel(); + if (maxNode != null && !"0".equals(maxNode.getId())) {//本级存在子节点,且非根节点 + nextNumber = number.produceNext(maxNode.getNumber()); + level = maxNode.getLevel(); + } + newNode = new Node(String.valueOf(++idSeq), nextNumber, node.getId(), level); + + generateNodeText(newNode, nextNumber); + + return newNode; + } + + + /** + * + * <p>功能描述:获取父节点。</p> + */ + public Node getParentNode(Node node) { + for (Node n : nodeList) { + if (node.getParentId() == n.getId()) { + return n; + } + } + return node; + } + + /** + * <p>功能描述:生成节点路径。</p> + */ + public void generateNodeText(Node node, String text) { + + if (node == null || "0".equals(node.getId())) { + return; + } + + Node pNode = getParentNode(node); + + if (!"0".equals(pNode.getId())) { + text = pNode.getText() + separator + text; + } + + node.setText(text); + } + + /** + * <p>功能描述:遍历所有树节点。</p> + */ + public void traverseNodeList(Node node) { + if(node==null){ + node = getRoot(nodeList); + } + List<Node> childNodes = getChildNodes(node); + System.out.println(node.getText()); + if (childNodes.size() > 0) { + for (Node n : childNodes) { + traverseNodeList(n); + } + } + } + public static void main(String[] args) { + SerialNumber number = new SerialNumber(); + NumberTree treeNode = new NumberTree(".", number); + + addSomeNodes(treeNode); + treeNode.traverseNodeList(null); + } + + /** + * <p>功能描述:获取根节点。</p> + */ + public Node getRoot(List<Node> nodeList) { + Node root = null; + if (nodeList.size() <= 0 || (root = getNodeById(nodeList, "0")) == null) { + root = createRoot(); + nodeList.add(root); + } + return root; + } + + private Node getNodeById(List<Node> nodeList, String id) { + Node node = null; + if(id!=null){ + for (Node n : nodeList) { + if (id.equals(n.getId())) { + node = n; + break; + } + } + } + return node; + } + + private Node createRoot() { + Node root = new Node("0", number.rootNumber(), "-1", 0); + root.setText("0"); + return root; + } + + /** + * <p>功能描述:测试添加节点。</p> + */ + private static Node addSomeNodes(NumberTree tree) { + Node root = tree.getRoot(tree.nodeList); + Node node1 = getNextNode(tree, root);//1 + Node node2 = getNextNode(tree, root);//2 + Node node3 = getNextNode(tree, root);//3 + Node node11 = getNextNode(tree, node1);//1.1 + Node node12 = getNextNode(tree, node1);//1.2 + Node node21 = getNextNode(tree, node2);//2.1 + Node node211 = getNextNode(tree, node21);//2.1.1 + Node node212 = getNextNode(tree, node21);//2.1.2 + Node node22 = getNextNode(tree, node2);//2.2 + Node node221 = getNextNode(tree, node22);//2.2.1 + Node node31 = getNextNode(tree, node3); + Node node32 = getNextNode(tree, node3); + Node node311 = getNextNode(tree, node31); + Node node3111 = getNextNode(tree, node311); + return root; + } + + public static Node getNextNode(NumberTree tree, Node pNode) { + Node node = tree.generateNextChildNode(pNode); + if (node != null) { + tree.nodeList.add(node); + } + return node; + } + +} diff --git a/src/main/java/com/subsidy/util/tree/SerialNumber.java b/src/main/java/com/subsidy/util/tree/SerialNumber.java new file mode 100644 index 0000000..02a5e31 --- /dev/null +++ b/src/main/java/com/subsidy/util/tree/SerialNumber.java @@ -0,0 +1,28 @@ +package com.subsidy.util.tree; + +public class SerialNumber{ + + public String produceNext(String crrnt) { + + String next = "0"; + if (crrnt != null) { + try { + int crrntNum = Integer.parseInt(crrnt); + next = String.valueOf(crrntNum + 1); + } catch (Exception e) { + System.err.println("非数字类型的字符串!"); + } + } + return next; + } + + public String rootNumber() { + return "0"; + } + + public String firstNumber() { + return "1"; + } + + +} diff --git a/src/main/java/com/subsidy/vo/administer/AdministerPermissionVO.java b/src/main/java/com/subsidy/vo/administer/AdministerPermissionVO.java new file mode 100644 index 0000000..d60b7f1 --- /dev/null +++ b/src/main/java/com/subsidy/vo/administer/AdministerPermissionVO.java @@ -0,0 +1,21 @@ +package com.subsidy.vo.administer; + +import lombok.Data; + +import java.util.List; + +@Data +public class AdministerPermissionVO { + + private Long id; + + private String userName; + + private String role; + + private String img; + + private Boolean isRole; + + private List<PermissionsVO> permissions; +} diff --git a/src/main/java/com/subsidy/vo/administer/ClassSummaryVO.java b/src/main/java/com/subsidy/vo/administer/ClassSummaryVO.java new file mode 100644 index 0000000..a85c1e3 --- /dev/null +++ b/src/main/java/com/subsidy/vo/administer/ClassSummaryVO.java @@ -0,0 +1,54 @@ +package com.subsidy.vo.administer; + +import lombok.Data; + +@Data +public class ClassSummaryVO { + + private Long classId; + + private String className; + + private String courseName; + + private String startDate; + + private String endDate; + + /** + * 学员总数 + */ + private Integer memberCount; + + /** + * 课程进度 + */ + private Integer studyVodCounts; + + /** + * 总课时 + */ + private Integer totalVodCounts; + + + /** + * 平均时长 + */ + private Integer avgVodPlayLength; + + /** + * 测试通过率 + */ + private Integer passRate; + + /** + * 平均签到数 + */ + private Integer avgSignCount; + + /** + * 答疑数 + */ + private Integer answerCount; + +} diff --git a/src/main/java/com/subsidy/vo/administer/ExerciseTestVO.java b/src/main/java/com/subsidy/vo/administer/ExerciseTestVO.java new file mode 100644 index 0000000..24114d9 --- /dev/null +++ b/src/main/java/com/subsidy/vo/administer/ExerciseTestVO.java @@ -0,0 +1,28 @@ +package com.subsidy.vo.administer; + +import com.subsidy.util.excel.ExcelColumn; +import lombok.Data; + +@Data +public class ExerciseTestVO { + + private Long id; + + @ExcelColumn(col = 1,value = "成员名称") + private String userName; + + /** + * 分数 向上取整 + */ + @ExcelColumn(col = 2,value = "测试结果") + private Integer score; + + @ExcelColumn(col = 3,value = "最高分") + private String result; + + private String idCard; + + private String telephone; + + private Integer count; +} diff --git a/src/main/java/com/subsidy/vo/administer/LoginVO.java b/src/main/java/com/subsidy/vo/administer/LoginVO.java new file mode 100644 index 0000000..d97ab86 --- /dev/null +++ b/src/main/java/com/subsidy/vo/administer/LoginVO.java @@ -0,0 +1,11 @@ +package com.subsidy.vo.administer; + +import lombok.Data; + +@Data +public class LoginVO { + + private String token; + + +} diff --git a/src/main/java/com/subsidy/vo/administer/OperatorsVO.java b/src/main/java/com/subsidy/vo/administer/OperatorsVO.java new file mode 100644 index 0000000..8b3d2f3 --- /dev/null +++ b/src/main/java/com/subsidy/vo/administer/OperatorsVO.java @@ -0,0 +1,29 @@ +package com.subsidy.vo.administer; + +import lombok.Data; + +@Data +public class OperatorsVO { + + private Long id; + + private String userName; + + private String telephone; + + private String field; + + private String banner; + + private String shortName; + + private String img; + + private String companyName; + + private String accountName; + + private Integer companyId; + + private String logo; +} diff --git a/src/main/java/com/subsidy/vo/administer/PermissionsVO.java b/src/main/java/com/subsidy/vo/administer/PermissionsVO.java new file mode 100644 index 0000000..bda1237 --- /dev/null +++ b/src/main/java/com/subsidy/vo/administer/PermissionsVO.java @@ -0,0 +1,17 @@ +package com.subsidy.vo.administer; + +import lombok.Data; + +import java.util.List; + +@Data +public class PermissionsVO { + + private Long id; + + private Long parentId; + + private String name; + + private List<PermissionsVO> children; +} diff --git a/src/main/java/com/subsidy/vo/administer/UserRoleVO.java b/src/main/java/com/subsidy/vo/administer/UserRoleVO.java new file mode 100644 index 0000000..c9fb0fa --- /dev/null +++ b/src/main/java/com/subsidy/vo/administer/UserRoleVO.java @@ -0,0 +1,17 @@ +package com.subsidy.vo.administer; + +import lombok.Data; + +@Data +public class UserRoleVO { + + private Long id; + + private String telephone; + + private String userName; + + private String img; + + +} diff --git a/src/main/java/com/subsidy/vo/answer/GetCourseQuestionVO.java b/src/main/java/com/subsidy/vo/answer/GetCourseQuestionVO.java new file mode 100644 index 0000000..c9db152 --- /dev/null +++ b/src/main/java/com/subsidy/vo/answer/GetCourseQuestionVO.java @@ -0,0 +1,49 @@ +package com.subsidy.vo.answer; + +import lombok.Data; + +@Data +public class GetCourseQuestionVO { + + + + private String memberName; + + private String administerName; + + private String companyName; + + private Long id; + + /** + * 科目id + */ + private Long courseId; + + /** + * 提问id + */ + private Long askId; + + /** + * 回答人id + */ + private Long answerId; + + /** + * 问题 + */ + private String title; + + /** + * 答案 + */ + private String answer; + + private String createDate; + + private String updateDate; + + private String deleteDate; + +} diff --git a/src/main/java/com/subsidy/vo/classdict/ClassDetailVO.java b/src/main/java/com/subsidy/vo/classdict/ClassDetailVO.java new file mode 100644 index 0000000..bbb7f93 --- /dev/null +++ b/src/main/java/com/subsidy/vo/classdict/ClassDetailVO.java @@ -0,0 +1,73 @@ +package com.subsidy.vo.classdict; + +import com.subsidy.util.excel.ExcelColumn; +import lombok.Data; + +@Data +public class ClassDetailVO{ + + + private Long id; + + @ExcelColumn(col = 1,value = "成员名称") + private String userName; + + @ExcelColumn(col = 2,value = "账号") + private String accountName; + + @ExcelColumn(col = 3,value = "身份证号") + private String idCard; + + @ExcelColumn(col = 4,value = "联系方式") + private String telephone; + + /** + * 签到次数 + */ + @ExcelColumn(col = 5,value = "签到次数") + private Integer signCounts; + + /** + * 已看视频 + */ + private Integer studyVodCounts; + + /** + * 全部视频 + */ + private Integer allVodCounts; + + @ExcelColumn(col = 6,value = "课程进度") + private String classProcess; + + @ExcelColumn(col = 7,value = "培训时长") + private Integer trainingLength; + + /** + * 作对个数 + */ + private Integer rightCounts; + + /** + * 总题数 + */ + private Integer totalExeCounts; + + /** + * 评价测试 + */ + @ExcelColumn(col = 8,value = "评价测试") + private Integer score; + + /** + * 答疑个数 + */ + @ExcelColumn(col = 9,value = "答题数") + private Integer askCounts; + + + private String result; + + + +} diff --git a/src/main/java/com/subsidy/vo/classdict/GetAllClassesVO.java b/src/main/java/com/subsidy/vo/classdict/GetAllClassesVO.java new file mode 100644 index 0000000..29cd7a5 --- /dev/null +++ b/src/main/java/com/subsidy/vo/classdict/GetAllClassesVO.java @@ -0,0 +1,24 @@ +package com.subsidy.vo.classdict; + +import lombok.Data; + +@Data +public class GetAllClassesVO { + + private Integer id; + + private Integer courseId; + + private String className; + + private String courseName; + + private String startDate; + + private String endDate; + + private Integer cnt; + + private String classType; + +} diff --git a/src/main/java/com/subsidy/vo/course/ExerciseVO.java b/src/main/java/com/subsidy/vo/course/ExerciseVO.java new file mode 100644 index 0000000..8e34e7a --- /dev/null +++ b/src/main/java/com/subsidy/vo/course/ExerciseVO.java @@ -0,0 +1,31 @@ +package com.subsidy.vo.course; + +import lombok.Data; + +@Data +public class ExerciseVO { + + + private Long id; + + /** + * 题目类型:单选/多选/是非 + */ + private String exerciseType; + + /** + * 难度:容易/适中/困难 + */ + private String difficulty; + + /** + * 题目 + */ + private String title; + + /** + * 选项 + */ + private String items; + +} diff --git a/src/main/java/com/subsidy/vo/course/QueryCoursesVO.java b/src/main/java/com/subsidy/vo/course/QueryCoursesVO.java new file mode 100644 index 0000000..ba7ead4 --- /dev/null +++ b/src/main/java/com/subsidy/vo/course/QueryCoursesVO.java @@ -0,0 +1,11 @@ +package com.subsidy.vo.course; + +import com.subsidy.model.CourseDictDO; +import lombok.Data; + +@Data +public class QueryCoursesVO extends CourseDictDO { + + private String name; + +} diff --git a/src/main/java/com/subsidy/vo/exercise/MemberExerciseVO.java b/src/main/java/com/subsidy/vo/exercise/MemberExerciseVO.java new file mode 100644 index 0000000..9417ae1 --- /dev/null +++ b/src/main/java/com/subsidy/vo/exercise/MemberExerciseVO.java @@ -0,0 +1,12 @@ +package com.subsidy.vo.exercise; + +import lombok.Data; + +@Data +public class MemberExerciseVO { + + private Long id; + + private String selectAnswer; + +} diff --git a/src/main/java/com/subsidy/vo/member/ClassSignVO.java b/src/main/java/com/subsidy/vo/member/ClassSignVO.java new file mode 100644 index 0000000..cbc8204 --- /dev/null +++ b/src/main/java/com/subsidy/vo/member/ClassSignVO.java @@ -0,0 +1,58 @@ +package com.subsidy.vo.member; + +import com.subsidy.util.excel.ExcelColumn; +import lombok.Data; + +import java.util.List; + +@Data +public class ClassSignVO { + + private Long id; + + @ExcelColumn(col = 1,value = "成员名称") + private String userName; + + private String idCard; + + private String telephone; + + /** + * 签到次数 + */ + @ExcelColumn(col = 2,value = "签到次数") + private Integer signCounts; + + @ExcelColumn(col =3,value = "签到日期") + private String signInDateList; + + /** + * 培训时长 + */ + @ExcelColumn(col = 4,value = "培训时长") + private Integer trainingLength; + + /** + * 已看视频 + */ + private Integer studyVodCounts; + + /** + * 全部视频 + */ + private Integer allVodCounts; + + @ExcelColumn(col = 5,value = "课程进度") + private String classProcess; + + /** + * 完成率 + */ + @ExcelColumn(col = 6,value = "完成率") + private String percent; + + + + + +} diff --git a/src/main/java/com/subsidy/vo/member/ContentFilesVO.java b/src/main/java/com/subsidy/vo/member/ContentFilesVO.java new file mode 100644 index 0000000..dc313c0 --- /dev/null +++ b/src/main/java/com/subsidy/vo/member/ContentFilesVO.java @@ -0,0 +1,15 @@ +package com.subsidy.vo.member; + +import com.subsidy.model.FileDictDO; +import lombok.Data; + +import java.util.List; + +@Data +public class ContentFilesVO { + + private String content; + + private List<FileDictDO> fileDictDOS; + +} diff --git a/src/main/java/com/subsidy/vo/member/ContentVodNewVO.java b/src/main/java/com/subsidy/vo/member/ContentVodNewVO.java new file mode 100644 index 0000000..c4ec7a3 --- /dev/null +++ b/src/main/java/com/subsidy/vo/member/ContentVodNewVO.java @@ -0,0 +1,64 @@ +package com.subsidy.vo.member; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.subsidy.model.VodDictDO; +import lombok.Data; + +import java.util.List; + +@Data +public class ContentVodNewVO { + + private Integer playRecord; + + private Long id; + + /** + * 目录id + */ + private Long contentId; + + /** + * 视频名称 + */ + private String vodName; + + /** + * 视频时长 + */ + private Integer vodLength; + + /** + * 视频格式 + */ + private String vodType; + + /** + * 视频大小 + */ + private String vodSize; + + /** + * 视频地址 + */ + private String vodUrl; + + /** + * 视频编码 + */ + private String vodCode; + + /** + * 讲师名称 + */ + private String teacherName; + + /** + * 封面 + */ + private String coverPage; + + private List<ContentVodVO> contentVodVOS; + +} diff --git a/src/main/java/com/subsidy/vo/member/ContentVodVO.java b/src/main/java/com/subsidy/vo/member/ContentVodVO.java new file mode 100644 index 0000000..09d7c8e --- /dev/null +++ b/src/main/java/com/subsidy/vo/member/ContentVodVO.java @@ -0,0 +1,14 @@ +package com.subsidy.vo.member; + +import lombok.Data; + +import java.util.List; + +@Data +public class ContentVodVO { + + private String content; + + private List<MemberVodVO> memberVodVOS; + +} diff --git a/src/main/java/com/subsidy/vo/member/GetAllVO.java b/src/main/java/com/subsidy/vo/member/GetAllVO.java new file mode 100644 index 0000000..18a4e21 --- /dev/null +++ b/src/main/java/com/subsidy/vo/member/GetAllVO.java @@ -0,0 +1,14 @@ +package com.subsidy.vo.member; + +import com.subsidy.model.DepartmentDictDO; +import com.subsidy.model.MemberDO; +import lombok.Data; + +import java.util.List; + +@Data +public class GetAllVO extends MemberDO { + + private List<DepartmentDictDO> departmentDictDOS; + +} diff --git a/src/main/java/com/subsidy/vo/member/GetCourseTestVO.java b/src/main/java/com/subsidy/vo/member/GetCourseTestVO.java new file mode 100644 index 0000000..05d6c00 --- /dev/null +++ b/src/main/java/com/subsidy/vo/member/GetCourseTestVO.java @@ -0,0 +1,22 @@ +package com.subsidy.vo.member; + +import lombok.Data; + +@Data +public class GetCourseTestVO { + + private Long courseId; + + private String courseName; + + private String rightCount; + + private String totalCount; + + private String deadline; + + private String result; + + private String percent; + +} diff --git a/src/main/java/com/subsidy/vo/member/GetMemberSignInfoVO.java b/src/main/java/com/subsidy/vo/member/GetMemberSignInfoVO.java new file mode 100644 index 0000000..42b51a0 --- /dev/null +++ b/src/main/java/com/subsidy/vo/member/GetMemberSignInfoVO.java @@ -0,0 +1,7 @@ +package com.subsidy.vo.member; + +import lombok.Data; + +@Data +public class GetMemberSignInfoVO { +} diff --git a/src/main/java/com/subsidy/vo/member/GetStudyInfoVO.java b/src/main/java/com/subsidy/vo/member/GetStudyInfoVO.java new file mode 100644 index 0000000..47e5353 --- /dev/null +++ b/src/main/java/com/subsidy/vo/member/GetStudyInfoVO.java @@ -0,0 +1,14 @@ +package com.subsidy.vo.member; + +import lombok.Data; + +@Data +public class GetStudyInfoVO { + + private Long diff; + + private Integer studyCourse; + + private Integer studyLength; + +} diff --git a/src/main/java/com/subsidy/vo/member/MemberStudyPageVO.java b/src/main/java/com/subsidy/vo/member/MemberStudyPageVO.java new file mode 100644 index 0000000..f9730e3 --- /dev/null +++ b/src/main/java/com/subsidy/vo/member/MemberStudyPageVO.java @@ -0,0 +1,21 @@ +package com.subsidy.vo.member; + +import lombok.Data; + +import java.util.List; + +@Data +public class MemberStudyPageVO { + + private List<StudyPageVO> studyPageVOS; + + private String companyName; + + private String shortName; + + private String banner; + + private String img; + + private String logo; +} diff --git a/src/main/java/com/subsidy/vo/member/MemberVodVO.java b/src/main/java/com/subsidy/vo/member/MemberVodVO.java new file mode 100644 index 0000000..0abb10b --- /dev/null +++ b/src/main/java/com/subsidy/vo/member/MemberVodVO.java @@ -0,0 +1,24 @@ +package com.subsidy.vo.member; + +import lombok.Data; + +@Data +public class MemberVodVO { + + private String vodName; + + private Integer vodLength; + + private String teacherName; + + private Integer percent; + + private Boolean status; + + private String vodUrl; + + private Long id; + + private Integer playRecord; + +} diff --git a/src/main/java/com/subsidy/vo/member/StudyPageVO.java b/src/main/java/com/subsidy/vo/member/StudyPageVO.java new file mode 100644 index 0000000..dc234c6 --- /dev/null +++ b/src/main/java/com/subsidy/vo/member/StudyPageVO.java @@ -0,0 +1,26 @@ +package com.subsidy.vo.member; + +import lombok.Data; + +@Data +public class StudyPageVO { + + private Integer id; + + private Integer classId; + + private String courseName; + + private String endDate; + + private Integer totalVods; + + private Integer doneVods; + + private Integer totalMember; + + private Integer doneMember; + + private String className; + +} diff --git a/src/main/java/com/subsidy/vo/sign/AnswerRecordVO.java b/src/main/java/com/subsidy/vo/sign/AnswerRecordVO.java new file mode 100644 index 0000000..b43f3cf --- /dev/null +++ b/src/main/java/com/subsidy/vo/sign/AnswerRecordVO.java @@ -0,0 +1,26 @@ +package com.subsidy.vo.sign; + +import com.subsidy.util.excel.ExcelColumn; +import lombok.Data; + +@Data +public class AnswerRecordVO { + + private Long id; + + @ExcelColumn(col = 1,value = "提问") + private String title; + + @ExcelColumn(col = 2,value = "答疑") + private String answer; + + @ExcelColumn(col = 3,value = "提问时间") + private String createDate; + + @ExcelColumn(col = 4,value = "提问成员") + private String userName; + + @ExcelColumn(col = 5,value = "答疑时间") + private String updateDate; + +} diff --git a/src/main/java/com/subsidy/vo/sign/ClassSignInfoVO.java b/src/main/java/com/subsidy/vo/sign/ClassSignInfoVO.java new file mode 100644 index 0000000..91a0d04 --- /dev/null +++ b/src/main/java/com/subsidy/vo/sign/ClassSignInfoVO.java @@ -0,0 +1,60 @@ +package com.subsidy.vo.sign; + +import lombok.Data; + +@Data +public class ClassSignInfoVO { + + private Long classId; + + private Long courseId; + + private String className; + + private String courseName; + + private String startDate; + + private String endDate; + + /** + * 班级人数 + */ + private Integer memberCount; + + /** + * 课程进度 + */ + private Integer studyVodCounts; + + /** + * 总课时 + */ + private Integer totalVodCounts; + + + /** + * 平均时长 + */ + private Integer avgVodPlayLength; + + /** + * 测试通过率 + */ + private Integer passRate; + + /** + * 平均签到数 + */ + private Integer avgSignCount; + + /** + * 答疑数 + */ + private Integer answerCount; + + private String classType; + + + +} diff --git a/src/main/java/com/subsidy/vo/sign/SignInStatusVO.java b/src/main/java/com/subsidy/vo/sign/SignInStatusVO.java new file mode 100644 index 0000000..fdb162f --- /dev/null +++ b/src/main/java/com/subsidy/vo/sign/SignInStatusVO.java @@ -0,0 +1,10 @@ +package com.subsidy.vo.sign; + +import lombok.Data; + +@Data +public class SignInStatusVO { + + private Boolean status; + +} diff --git a/src/main/java/com/subsidy/vo/vod/GetContendVodsVO.java b/src/main/java/com/subsidy/vo/vod/GetContendVodsVO.java new file mode 100644 index 0000000..e60f7b6 --- /dev/null +++ b/src/main/java/com/subsidy/vo/vod/GetContendVodsVO.java @@ -0,0 +1,11 @@ +package com.subsidy.vo.vod; + +import com.subsidy.model.VodDictDO; +import lombok.Data; + +@Data +public class GetContendVodsVO extends VodDictDO { + + private String content; + +} diff --git a/src/main/java/com/subsidy/vo/vod/SignatureVO.java b/src/main/java/com/subsidy/vo/vod/SignatureVO.java new file mode 100644 index 0000000..591a90b --- /dev/null +++ b/src/main/java/com/subsidy/vo/vod/SignatureVO.java @@ -0,0 +1,10 @@ +package com.subsidy.vo.vod; + +import lombok.Data; + +@Data +public class SignatureVO { + + private String sign; + +} diff --git a/src/main/java/com/subsidy/vo/vod/StudyHistoryVO.java b/src/main/java/com/subsidy/vo/vod/StudyHistoryVO.java new file mode 100644 index 0000000..9a0220b --- /dev/null +++ b/src/main/java/com/subsidy/vo/vod/StudyHistoryVO.java @@ -0,0 +1,17 @@ +package com.subsidy.vo.vod; + +import lombok.Data; + +@Data +public class StudyHistoryVO { + + private String vodName; + + private String teacherName; + + private Integer percent; + + private String vodLength; + + private Boolean status; +} diff --git a/src/main/resources/application-dev.properties b/src/main/resources/application-dev.properties new file mode 100644 index 0000000..119200b --- /dev/null +++ b/src/main/resources/application-dev.properties @@ -0,0 +1,28 @@ +# 本地环境配置 + +# 端口号 +server.port=23454 + +# 数据源配置 +spring.datasource.url=jdbc:mysql://116.62.57.92:3306/subsidy?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=devloper +spring.datasource.password=dev@1553$ + +spring.datasource.druid.initialSize=5 +spring.datasource.druid.minIdle=5 +spring.datasource.druid.maxActive=20 +spring.datasource.druid.maxWait=60000 +spring.datasource.druid.timeBetweenEvictionRunsMillis=60000 +spring.datasource.druid.minEvictableIdleTimeMillis=300000 +spring.datasource.druid.validationQuery=SELECT 1 FROM DUAL +spring.datasource.druid.testWhileIdle=true +spring.datasource.druid.testOnBorrow=false +spring.datasource.druid.testOnReturn=false +spring.datasource.druid.poolPreparedStatements=true +spring.datasource.druid.maxPoolPreparedStatementPerConnectionSize=20 +spring.datasource.druid.useGlobalDataSourceStat=true + +# 控制台日志打印 +mybatis-plus.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl \ No newline at end of file diff --git a/src/main/resources/application-prod.properties b/src/main/resources/application-prod.properties new file mode 100644 index 0000000..b4a20a5 --- /dev/null +++ b/src/main/resources/application-prod.properties @@ -0,0 +1,36 @@ +# 生产环境配置 + +# 端口号 +server.port=23454 + +# 数据源配置 +spring.datasource.url=jdbc:mysql://rm-uf69w46mo6agw0ahao.mysql.rds.aliyuncs.com:3306/subsidy?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.datasource.password=youkedb608@good + +spring.datasource.druid.initialSize=5 +spring.datasource.druid.minIdle=5 +spring.datasource.druid.maxActive=20 +spring.datasource.druid.maxWait=60000 +spring.datasource.druid.timeBetweenEvictionRunsMillis=60000 +spring.datasource.druid.minEvictableIdleTimeMillis=300000 +spring.datasource.druid.validationQuery=SELECT 1 FROM DUAL +spring.datasource.druid.testWhileIdle=true +spring.datasource.druid.testOnBorrow=false +spring.datasource.druid.testOnReturn=false +spring.datasource.druid.poolPreparedStatements=true +spring.datasource.druid.maxPoolPreparedStatementPerConnectionSize=20 +spring.datasource.druid.useGlobalDataSourceStat=true + +# 控制台日志打印 +mybatis-plus.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl + +spring.servlet.multipart.max-file-size=2048KB +spring.servlet.multipart.max-request-size=4098KB + +wechat.appId: wx7785293ff5e31f14 +wechat.appSecret: 25d57cad61fc1b45b3afa46d4c35e8f6 +wechat.msgUrl: https://teachai.youkehulian.com/login +wechat.templateId: Z1HNPLOrKiHEjfR1KMP-cC-uH3BWqDJIHv365Ev20yQ diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties new file mode 100644 index 0000000..81ef4bb --- /dev/null +++ b/src/main/resources/application.properties @@ -0,0 +1,57 @@ +# 环境配置 +spring.profiles.active=prod + +# 文件编码 UTF8 +spring.mandatory-file-encoding=UTF-8 +spring.jackson.time-zone=GMT+8 + +# 404 交给异常处理器处理 +spring.mvc.throw-exception-if-no-handler-found=true +# 关闭静态资源的映射 +spring.resources.add-mappings=false + +# 关闭banner打印 +mybatis-plus.global-config.banner=false + +# mybatis-plus相关配置 +mybatis-plus.m/classSubjectTask/queryTaskDetailapper-locations=classpath:mapper/*.xml +# 是否开启自动驼峰命名规则映射 +mybatis-plus.configuration.map-underscore-to-camel-case=true +# 如果查询结果中包含空值的列,则 MyBatis 在映射的时候,不会映射这个字段 +mybatis-plus.configuration.call-setters-on-nulls=true + +# 逻辑删除 +mybatis-plus.global-config.db-config.logic-delete-value=NOW() +mybatis-plus.global-config.db-config.logic-not-delete-value=NULL + +#日志配置 +logging.config=classpath:logback-spring.xml + +# 阿里云短信 +sms.product=Dysmsapi +sms.domain=dysmsapi.aliyuncs.com +sms.accessKeyId=LTAIOrpFKrDqsQ2c +sms.accessKeySecret=1Qp8huLETbWiBBJvHXJ7MOIhtKuA1G + +#wechat.app-id=wx7785293ff5e31f14 +#wechat.app-secret=25d57cad61fc1b45b3afa46d4c35e8f6 +#wechat.agentId=1000008 + +vod.appId= 1302252447 +vod.secretId= AKIDOcePHvZ2C5VeYHQGSO5aqtlNxJQLqfz2 +vod.secretKey= vjHYRmrfDbw0rWxA7oFcj7F8lDPKCm8E +vod.api= vod.tencentcloudapi.com +vod.region= ap-shanghai + +# quartz +# 数据持久化方式 +spring.quartz.job-store-type=jdbc +# 初始化后是否自动启动计划程序 +spring.quartz.auto-startup=true +# 初始化完成后启动计划程序的延迟时间 +spring.quartz.startup-delay=10s +# 配置的作业是否应覆盖现有的作业定义 +spring.quartz.overwrite-existing-jobs=false +# 自动建表,如果已经存在表请勿使用,会覆盖数据表 +#spring.quartz.jdbc.initialize-schema=always +#spring.datasource.initialization-mode=embedded diff --git a/src/main/resources/code.properties b/src/main/resources/code.properties new file mode 100644 index 0000000..1e16acb --- /dev/null +++ b/src/main/resources/code.properties @@ -0,0 +1,32 @@ +meishu.code-message[0]=成功 + +meishu.code-message[1010]=无效的令牌 + +meishu.code-message[10003]=验证码错误 +meishu.code-message[10004]=账号或密码错误 +meishu.code-message[10010]=学生信息不存在 +meishu.code-message[10011]=成员信息不存在 +meishu.code-message[10013]=账户已冻结,请联系账户管理员 +meishu.code-message[10014]=该成员已存在,请勿重复添加 + + +meishu.code-message[20001]=该课程已存在 +meishu.code-message[20002]=该成员已存在 + +meishu.code-message[30001]=该部门已存在 + +meishu.code-message[40001]=该目录已存在 + +meishu.code-message[70010]=验证码错误 +meishu.code-message[70011]=验证码发送频繁 +meishu.code-message[70012]=手机号未注册 +meishu.code-message[70013]=您今天已报名了同类型的场次 +meishu.code-message[70014]=取消报名失败 + +meishu.code-message[80001]=uuid已过期 +meishu.code-message[80002]=uuid验证失败 + +meishu.code-message[90001]=该类目已存在 + +meishu.code-message[10001]=导入失败 + diff --git a/src/main/resources/logback-spring.xml b/src/main/resources/logback-spring.xml new file mode 100644 index 0000000..dfd4cbb --- /dev/null +++ b/src/main/resources/logback-spring.xml @@ -0,0 +1,72 @@ +<?xml version="1.0" encoding="UTF-8"?> +<configuration scan="true" scanPeriod="60 seconds" debug="false"> + <property name="LOG_PATH" value="logs/" /> + <property name="APP_NAME" value="springboot-logback" /> + <contextName>${APP_NAME}</contextName> + <jmxConfigurator /> + + <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender"> + <filter class="ch.qos.logback.classic.filter.ThresholdFilter"> + <level>debug</level> + </filter> + <encoder> + <pattern>%d [%t] %5p %c:%L - %m%n</pattern> + <charset>UTF-8</charset> + </encoder> + </appender> + <appender name="INFO_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> + <File>${LOG_PATH}${APP_NAME}-info.log</File> + <encoder> + <pattern>%d [%t] %5p %c:%L - %m%n</pattern> + </encoder> + <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> + <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> + <maxFileSize>100MB</maxFileSize> + </timeBasedFileNamingAndTriggeringPolicy> + <FileNamePattern>${LOG_PATH}${APP_NAME}/info/%d{yyyy-MM-dd}-%i.log.gz + </FileNamePattern> + <MaxHistory>30</MaxHistory> + </rollingPolicy> + </appender> + <appender name="ERROR_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> + <File>${LOG_PATH}${APP_NAME}-error.log</File> + <filter class="ch.qos.logback.classic.filter.ThresholdFilter"> + <level>error</level> + </filter> + <encoder> + <pattern>%d [%t] %5p %c:%L - %m%n</pattern> + </encoder> + <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> + <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> + <maxFileSize>256MB</maxFileSize> + </timeBasedFileNamingAndTriggeringPolicy> + <FileNamePattern>${LOG_PATH}${APP_NAME}/error/%d{yyyy-MM-dd}-%i.log.gz + </FileNamePattern> + <MaxHistory>30</MaxHistory> + </rollingPolicy> + </appender> + + <springProfile name="dev"> + <logger name="com.juequn" level="error" /> + <root level="INFO"> + <appender-ref ref="CONSOLE" /> + <appender-ref ref="INFO_FILE" /> + <appender-ref ref="ERROR_FILE" /> + </root> + </springProfile> + + <springProfile name="pre"> + <logger name="com.juequn" level="error" /> + <root level="INFO"> + <appender-ref ref="ERROR_FILE" /> + </root> + </springProfile> + + <springProfile name="prod"> + <logger name="com.juequn" level="error" /> + <root level="INFO"> + <appender-ref ref="ERROR_FILE" /> + </root> + </springProfile> + +</configuration> \ No newline at end of file diff --git a/src/main/resources/mapper/AccessTokenMapper.xml b/src/main/resources/mapper/AccessTokenMapper.xml new file mode 100644 index 0000000..fc6d71c --- /dev/null +++ b/src/main/resources/mapper/AccessTokenMapper.xml @@ -0,0 +1,81 @@ +<?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.meishu.mapper.AccessTokenMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.meishu.model.AccessTokenDO"> + <id column="id" property="id" /> + <result column="create_date" property="createTime" /> + <result column="update_date" property="updateTime" /> + <result column="delete_date" property="deleteTime" /> + <result column="access_token" property="accessToken" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + create_date, + update_date, + delete_date, + id, access_token + </sql> + + <select id="getAllTeachers" parameterType="com.meishu.dto.token.GetAllTeachersDTO" resultType="com.meishu.vo.accesstoken.GetAllTeachersVO"> + SELECT + id, + telephone, + user_name, + intro + FROM + administer t + where t.delete_date is null + <if test="telephone != null and telephone != ''"> + and t.telephone = #{telephone} + </if> + <if test="userName != null and userName != ''"> + and t.user_name like concat('%', #{userName} ,'%') + </if> + </select> + + <select id="getAllStudents" parameterType="com.meishu.dto.token.GetAllStudentsDTO" resultType="com.meishu.vo.accesstoken.GetAllStudentsVO"> + SELECT + t.id, + t.user_name, + t.gender, + t.img_url, + t.user_status, + t.role_type, + t.SESSION, + t.phone, + t.id_card, + t.study_code, + t3.class_name, + t.password + FROM + user_role t + LEFT JOIN classes_user_mapping t2 ON t.id = t2.user_id + LEFT JOIN classes_dict t3 ON t2.classes_id = t3.id + WHERE + t.delete_date IS NULL +-- AND t2.`status` = 1 + AND t2.delete_date IS NULL + AND t3.delete_date IS NULL + <if test="userName != null and userName !=''"> + and t.user_name like concat('%',#{userName} ,'%') + </if> + <if test="idCard != null and idCard != ''"> + and t.id_card like concat('%',#{idCard} ,'%') + </if> + <if test="phone != null and phone !=''"> + and t.phone like concat('%',#{phone} ,'%') + </if> + <if test="gender != null and gender != ''"> + and t.gender = #{gender} + </if> + <if test="studyCode != null and studyCode !='' "> + and t.study_code like concat('%',#{studyCode} ,'%') + </if> +<!-- <if test="className != null and className !=''">--> +<!-- and t.class_name like concat('%',#{className} ,'%')--> +<!-- </if>--> + </select> +</mapper> diff --git a/src/main/resources/mapper/AdministerDepartmentMappingMapper.xml b/src/main/resources/mapper/AdministerDepartmentMappingMapper.xml new file mode 100644 index 0000000..5a5175b --- /dev/null +++ b/src/main/resources/mapper/AdministerDepartmentMappingMapper.xml @@ -0,0 +1,23 @@ +<?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.meishu.mapper.AdministerDepartmentMappingMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.meishu.model.AdministerDepartmentMappingDO"> + <id column="id" property="id" /> + <result column="create_date" property="createTime" /> + <result column="update_date" property="updateTime" /> + <result column="create_date" property="deleteTime" /> + <result column="administer_id" property="administerId" /> + <result column="department_id" property="departmentId" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + create_date, + update_date, + create_date, + id, administer_id, department_id + </sql> + +</mapper> diff --git a/src/main/resources/mapper/AdministerMapper.xml b/src/main/resources/mapper/AdministerMapper.xml new file mode 100644 index 0000000..f88f415 --- /dev/null +++ b/src/main/resources/mapper/AdministerMapper.xml @@ -0,0 +1,122 @@ +<?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.AdministerMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.subsidy.model.AdministerDO"> + <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="telephone" property="telephone" /> + <result column="password" property="password" /> + <result column="user_name" property="userName" /> + <result column="short_name" property="shortName" /> + <result column="img" property="img" /> + <result column="status" property="status" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + create_date, + update_date, + delete_date, + id, telephone, password, user_name, short_name, img, banner, status, field + </sql> + + <select id="getPermissions" resultType="com.subsidy.vo.administer.PermissionsVO"> + SELECT DISTINCT + t4.* + FROM + role_administer_mapping t + LEFT JOIN role_dict t2 ON t.role_id = t2.id + LEFT JOIN role_permission_mapping t3 ON t2.id = t3.role_id + LEFT JOIN permissions_dict t4 ON t3.permission_id = t4.id + WHERE + t.delete_date IS NULL + AND t2.delete_date IS NULL + AND t3.delete_date IS NULL + AND t4.delete_date IS NULL + <if test="id !=null and id !=''"> + and t.administer_id = #{id} + </if> + + </select> + + <select id="classMembers" resultType="com.subsidy.vo.classdict.ClassDetailVO"> + SELECT + t2.id, + t2.user_name, + t2.id_card, + t2.account_name, + t2.telephone + FROM + class_member_mapping t + LEFT JOIN member t2 ON t.member_id = t2.id + where t.delete_date IS NULL + AND t2.delete_date IS NULL + AND t.class_id = #{classId} + <if test="userName != null and userName !=''"> + and t2.user_name like concat('%',#{userName} ,'%') + </if> + order by t2.id + </select> + + <select id="classSign" resultType="com.subsidy.vo.member.ClassSignVO"> + SELECT + t2.id, + t2.user_name, + t2.account_name, + t2.telephone, + t2.id_card + FROM + class_member_mapping t + LEFT JOIN member t2 ON t.member_id = t2.id + where t.delete_date IS NULL + AND t2.delete_date IS NULL + AND t.class_id = #{classId} + <if test="userName != null and userName !=''"> + and t2.user_name like concat('%',#{userName} ,'%') + </if> + order by t2.id + </select> + + <select id="exerciseTest" resultType="com.subsidy.vo.administer.ExerciseTestVO"> + SELECT + t2.id, + t2.user_name, + t2.account_name, + t2.telephone, + t2.id_card + FROM + class_member_mapping t + LEFT JOIN member t2 ON t.member_id = t2.id + where t.delete_date IS NULL + AND t2.delete_date IS NULL + AND t.class_id = #{classId} + <if test="userName != null and userName !=''"> + and t2.user_name like concat('%',#{userName} ,'%') + </if> + order by t2.id + </select> + + <select id="answerRecord" resultType="com.subsidy.vo.sign.AnswerRecordVO"> + SELECT + t.id, + t.title, + t.answer, + t2.user_name, + t.create_date, + t.update_date + FROM + answering_question t + LEFT JOIN member t2 ON t.ask_id = t2.id + WHERE + t.delete_date IS NULL + AND t.class_id = #{classId} + <if test="userName !=null and userName !=''"> + AND t2.user_name LIKE concat('%',#{userName} ,'%') + </if> + </select> + +</mapper> diff --git a/src/main/resources/mapper/AdministerPermissionMapper.xml b/src/main/resources/mapper/AdministerPermissionMapper.xml new file mode 100644 index 0000000..c7e8f15 --- /dev/null +++ b/src/main/resources/mapper/AdministerPermissionMapper.xml @@ -0,0 +1,43 @@ +<?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.meishu.mapper.AdministerPermissionMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.meishu.model.AdministerPermissionDO"> + <id column="id" property="id"/> + <result column="create_date" property="createTime"/> + <result column="update_date" property="updateTime"/> + <result column="delete_date" property="deleteTime"/> + <result column="administer_id" property="administerId"/> + <result column="permission_id" property="permissionId"/> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + create_date, + update_date, + delete_date, + id, administer_id, permission_id + </sql> + + <select id="getPermissions" resultType="com.meishu.vo.administer.PermissionsVO"> + SELECT DISTINCT + t4.* + FROM + role_administer_mapping t + LEFT JOIN role_dict t2 ON t.role_id = t2.id + LEFT JOIN role_permission_mapping t3 ON t2.id = t3.role_id + LEFT JOIN permissions_dict t4 ON t3.permission_id = t4.id + WHERE + t.delete_date IS NULL + AND t2.delete_date IS NULL + AND t3.delete_date IS NULL + AND t4.delete_date IS NULL + <if test="id !=null and id !=''"> + and t.administer_id = #{id} + </if> + + </select> + + +</mapper> diff --git a/src/main/resources/mapper/AdministerSubjectMappingMapper.xml b/src/main/resources/mapper/AdministerSubjectMappingMapper.xml new file mode 100644 index 0000000..e1e62ac --- /dev/null +++ b/src/main/resources/mapper/AdministerSubjectMappingMapper.xml @@ -0,0 +1,23 @@ +<?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.meishu.mapper.AdministerSubjectMappingMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.meishu.model.AdministerSubjectMappingDO"> + <id column="id" property="id" /> + <result column="create_date" property="createTime" /> + <result column="update_date" property="updateTime" /> + <result column="delete_date" property="deleteTime" /> + <result column="subject_id" property="subjectId" /> + <result column="administer_id" property="administerId" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + create_date, + update_date, + delete_date, + id, subject_id, administer_id + </sql> + +</mapper> diff --git a/src/main/resources/mapper/AnsweringQuestionMapper.xml b/src/main/resources/mapper/AnsweringQuestionMapper.xml new file mode 100644 index 0000000..7e11dfa --- /dev/null +++ b/src/main/resources/mapper/AnsweringQuestionMapper.xml @@ -0,0 +1,47 @@ +<?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.AnsweringQuestionMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.subsidy.model.AnsweringQuestionDO"> + <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="ask_id" property="askId" /> + <result column="answer_id" property="answerId" /> + <result column="title" property="title" /> + <result column="answer" property="answer" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + create_date, + update_date, + delete_date, + id, course_id, ask_id, answer_id, title, answer + </sql> + + <select id="getCourseQuestion" resultType="com.subsidy.vo.answer.GetCourseQuestionVO"> + SELECT + t.*, + t2.user_name as memberName, + t3.user_name as administerName, + t4.company_name + FROM + answering_question t + LEFT JOIN member t2 ON t.ask_id = t2.id + left join administer t3 on t.answer_id = t3.id + left join company_dict t4 on t3.company_id = t4.id + WHERE + t.delete_date IS NULL + AND t2.delete_date IS NULL + AND t.class_id = #{classId} + <if test="memberId != null "> + and t.ask_id = #{memberId} + </if> + order by t.create_date + </select> + +</mapper> diff --git a/src/main/resources/mapper/CategoryMapper.xml b/src/main/resources/mapper/CategoryMapper.xml new file mode 100644 index 0000000..d896583 --- /dev/null +++ b/src/main/resources/mapper/CategoryMapper.xml @@ -0,0 +1,22 @@ +<?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.CategoryMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.subsidy.model.CategoryDO"> + <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="name" property="name" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + create_date, + update_date, + delete_date, + id, name + </sql> + +</mapper> diff --git a/src/main/resources/mapper/ClassDictMapper.xml b/src/main/resources/mapper/ClassDictMapper.xml new file mode 100644 index 0000000..b0a8ac4 --- /dev/null +++ b/src/main/resources/mapper/ClassDictMapper.xml @@ -0,0 +1,88 @@ +<?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.ClassDictMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.subsidy.model.ClassDictDO"> + <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="class_name" property="className"/> + <result column="course_id" property="courseId"/> + <result column="start_date" property="startDate"/> + <result column="end_date" property="endDate"/> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + create_date, + update_date, + delete_date, + id, class_name, course_id, start_date, end_date + </sql> + + <select id="getAllClasses" resultType="com.subsidy.vo.classdict.GetAllClassesVO"> + SELECT + t.id, + t2.id as courseId, + t.class_name, + t2.course_name, + t.start_date, + t.end_date, + t4.cnt, + t.class_type + FROM + class_dict t + LEFT JOIN course_dict t2 ON t.course_id = t2.id + LEFT JOIN ( SELECT t3.class_id, sum( 1 ) AS cnt FROM class_member_mapping t3 WHERE t3.delete_date IS NULL GROUP + BY t3.class_id ) t4 ON t.id = t4.class_id + WHERE + t.delete_date IS NULL + AND t2.delete_date IS NULL + and t.company_id = #{companyId} + <if test="className != null and className !=''"> + and t.class_name like concat('%',#{className} ,'%') + </if> + order by t.create_date desc + </select> + + <select id="getClassVods" parameterType="long" resultType="com.subsidy.model.VodDictDO"> + SELECT + t3.* + FROM + class_dict t + LEFT JOIN course_content t2 ON t.course_id = t2.course_id + LEFT JOIN vod_dict t3 ON t2.id = t3.content_id + WHERE + t.delete_date IS NULL + AND t2.delete_date IS NULL + AND t3.delete_date IS NULL + and t3.id is not null + and t.id = #{classId} + </select> + + <select id="getSpareMembers" parameterType="com.subsidy.dto.classDict.GetSpareMembersDTO" + resultType="com.subsidy.model.MemberDO"> + SELECT + distinct t2.* + FROM + member t2 + LEFT JOIN member_department_mapping t ON t.member_id = t2.id + left join department_dict t3 on t.department_id = t3.id + left join company_dict t4 on t3.company_id = t4.id + WHERE + t.delete_date IS NULL + AND t2.delete_date IS NULL + AND t3.company_id = #{companyId} + AND t2.id NOT IN ( + SELECT + t3.member_id + FROM + class_member_mapping t3 + WHERE + t3.delete_date IS NULL + AND t3.class_id = #{classId}) + </select> + +</mapper> diff --git a/src/main/resources/mapper/ClassMemberMappingMapper.xml b/src/main/resources/mapper/ClassMemberMappingMapper.xml new file mode 100644 index 0000000..712a3c4 --- /dev/null +++ b/src/main/resources/mapper/ClassMemberMappingMapper.xml @@ -0,0 +1,37 @@ +<?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.ClassMemberMappingMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.subsidy.model.ClassMemberMappingDO"> + <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="member_id" property="memberId" /> + <result column="class_id" property="classId" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + create_date, + update_date, + delete_date, + id, member_id, class_id + </sql> + + <select id="getMemberClass" parameterType="long" resultType="com.subsidy.model.ClassDictDO"> + SELECT + t2.* + FROM + class_member_mapping t + LEFT JOIN class_dict t2 ON t.class_id = t2.id + WHERE + t.delete_date IS NULL + AND t2.delete_date IS NULL + and t2.start_date <= now() + and t2.end_date >= now() + and t.member_id = #{memberId} + </select> + +</mapper> diff --git a/src/main/resources/mapper/ClassSubjectTaskMapper.xml b/src/main/resources/mapper/ClassSubjectTaskMapper.xml new file mode 100644 index 0000000..88b70ed --- /dev/null +++ b/src/main/resources/mapper/ClassSubjectTaskMapper.xml @@ -0,0 +1,69 @@ +<?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.meishu.mapper.ClassSubjectTaskMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.meishu.model.ClassSubjectTaskDO"> + <id column="id" property="id" /> + <result column="create_date" property="createDate" /> + <result column="update_date" property="updateDate" /> + <result column="subject_id" property="subjectId" /> + <result column="tree_id" property="treeId" /> + <result column="tree_name" property="treeName" /> + <result column="task_date" property="taskDate" /> + <result column="teacher_id" property="teacherId" /> + <result column="task_type" property="taskType" /> + <result column="class_id" property="classId" /> + <result column="subject_en" property="subjectEn" /> + <result column="grade" property="grade" /> + <result column="classes" property="classes" /> + <result column="session" property="session" /> + <result column="subject_type" property="subjectType" /> + <result column="class_name" property="className" /> + <result column="semester" property="semester" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + create_date, + update_date, + id, subject_id, tree_id, tree_name, task_date, teacher_id, task_type, class_id, subject_en, grade, classes, session, subject_type, class_name, semester + </sql> + + + <select id="queryAlreadyTasks" + resultType="com.meishu.vo.task.GetTaskByIdVO"> + SELECT + * + FROM + class_subject_task t + WHERE + class_id = #{classId} + and subject_Id = #{subjectId} + <if test="endDate!=null"> + AND DATE_FORMAT(task_date,'%Y-%m-%d %H:%i:%s')<= DATE_FORMAT(#{endDate},'%Y-%m-%d %H:%i:%s') + </if> + <if test="startDate!=null"> + AND DATE_FORMAT(task_date,'%Y-%m-%d %H:%i:%s') >= DATE_FORMAT(#{startDate},'%Y-%m-%d %H:%i:%s') + </if> + + <if test="taskType!=null and taskType!=''"> + and t.task_type = #{taskType} + </if> + order by task_date desc + </select> + + <select id="getClassStudents" parameterType="com.meishu.dto.task.GetClassStudentsDTO" resultType="com.meishu.model.UserRoleDO"> + SELECT + t2.* + FROM + classes_user_mapping t + LEFT JOIN user_role t2 ON t.user_id = t2.id + where t.classes_id in + <foreach collection="ids" item="id" index="index" open="(" close=")" separator=","> + #{id} + </foreach> + and t.delete_date is null and t2.delete_date is null + </select> + +</mapper> diff --git a/src/main/resources/mapper/ClassesDictHistoryMapper.xml b/src/main/resources/mapper/ClassesDictHistoryMapper.xml new file mode 100644 index 0000000..d8755f6 --- /dev/null +++ b/src/main/resources/mapper/ClassesDictHistoryMapper.xml @@ -0,0 +1,40 @@ +<?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.meishu.mapper.ClassesDictHistoryMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.meishu.model.ClassesDictHistoryDO"> + <id column="id" property="id" /> + <result column="create_date" property="createDate" /> + <result column="update_date" property="updateDate" /> + <result column="class_dict_id" property="classDictId" /> + <result column="school" property="school" /> + <result column="grade" property="grade" /> + <result column="classes" property="classes" /> + <result column="session" property="session" /> + <result column="subject_type" property="subjectType" /> + <result column="class_name" property="className" /> + <result column="semester" property="semester" /> + <result column="status" property="status" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + create_date, + update_date, + id, class_dict_id, school, grade, classes, session, subject_type, class_name, semester, status + </sql> + + <select id="getAllPastSemester" parameterType="string" resultType="com.meishu.model.ClassesDictHistoryDO"> + SELECT + * + FROM + classes_dict_history t + WHERE + t.grade = #{grade} + AND t.status = '归档' + ORDER BY + t.classes *1 + </select> + +</mapper> diff --git a/src/main/resources/mapper/ClassesDictMapper.xml b/src/main/resources/mapper/ClassesDictMapper.xml new file mode 100644 index 0000000..54462bc --- /dev/null +++ b/src/main/resources/mapper/ClassesDictMapper.xml @@ -0,0 +1,123 @@ +<?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.meishu.mapper.ClassesDictMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.meishu.model.ClassesDictDO"> + <id column="id" property="id" /> + <result column="create_date" property="createDate" /> + <result column="update_date" property="updateDate" /> + <result column="school" property="school" /> + <result column="grade" property="grade" /> + <result column="classes" property="classes" /> + <result column="session" property="session" /> + <result column="subject_type" property="subjectType" /> + <result column="class_name" property="className" /> + <result column="semester" property="semester" /> + <result column="status" property="status" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + create_date, + update_date, + id, school, grade, classes, session, subject_type, class_name, semester, status + </sql> + + <select id="getClasses" resultType="com.meishu.vo.classes.GetClassesVO"> + SELECT + t.id, + t.class_name, + t.grade, + t3.cnt, + t.`session`, + t.`status`, + t.classes, + t.upgrade_date + FROM + classes_dict t + LEFT JOIN ( SELECT t2.classes_id, count( 1 ) AS cnt FROM classes_user_mapping t2 where t2.delete_date is null GROUP BY t2.classes_id ) t3 ON t.id = t3.classes_id +-- left join classes_dict t4 on t.class_dict_id = t4.id + WHERE + 1=1 + <if test="session != null and session !=''"> + and t.SESSION = #{session} + </if> + <if test="className != null and className != ''"> + and t.class_name like concat('%',#{className} ,'%') + </if> + <if test="grade != null and grade != ''"> + and t.grade = #{grade} + </if> + <if test="status != null and status != ''"> + and t.status = #{status} + </if> + order by t.grade_order,t.classes*1 + </select> + + <select id="getClassStudents" resultType="com.meishu.vo.classes.GetClassStudentsVO"> + SELECT + t.id, + t2.id as userId, + t2.user_name, + t2.study_code, + t2.phone, + t3.grade, + t2.`session`, + t2.id_card, + t2.gender, + t2.email, + t2.user_status + FROM + classes_user_mapping t + LEFT JOIN user_role t2 ON t.user_id = t2.id + LEFT JOIN classes_dict t3 ON t.classes_id = t3.id + where t.classes_id = #{classId} + and t.delete_date is null + <if test="userName != null and userName != ''"> + and user_name like concat('%',#{userName} ,'%') + </if> + </select> + + <select id="queryNoClassStudents" resultType="com.meishu.model.UserRoleDO"> + SELECT + *, + t.id as userId + FROM + user_role t + WHERE + t.id NOT IN ( + SELECT + user_id + FROM + classes_user_mapping where delete_date is null) + <if test="userName != null and userName != ''"> + and user_name like concat('%',#{userName} ,'%') + </if> + and t.delete_date is null + </select> + + + <select id="getClassesById" resultType="com.meishu.model.ClassesDictDO"> + select + c.* + from classes_dict c + left join classes_user_mapping cum on cum.classes_id = c.id + where cum.user_id = #{studentId} + and c.delete_date is null + and cum.delete_date is null + </select> + + <select id="getGradeClasses" parameterType="com.meishu.model.ClassesDictDO" resultType="com.meishu.model.ClassesDictDO"> + SELECT + * + FROM + classes_dict t + WHERE + t.grade = #{grade} + AND t.STATUS = '在读' + and t.delete_date is null + order by t.classes*1 + </select> + +</mapper> diff --git a/src/main/resources/mapper/ClassesUserMappingMapper.xml b/src/main/resources/mapper/ClassesUserMappingMapper.xml new file mode 100644 index 0000000..82b6458 --- /dev/null +++ b/src/main/resources/mapper/ClassesUserMappingMapper.xml @@ -0,0 +1,22 @@ +<?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.meishu.mapper.ClassesUserMappingMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.meishu.model.ClassesUserMappingDO"> + <id column="id" property="id" /> + <result column="create_date" property="createDate" /> + <result column="update_date" property="updateDate" /> + <result column="classes_id" property="classesId" /> + <result column="user_id" property="userId" /> + <result column="status" property="status" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + create_date, + update_date, + id, classes_id, user_id, status + </sql> + +</mapper> diff --git a/src/main/resources/mapper/CompanyDictMapper.xml b/src/main/resources/mapper/CompanyDictMapper.xml new file mode 100644 index 0000000..6dc792b --- /dev/null +++ b/src/main/resources/mapper/CompanyDictMapper.xml @@ -0,0 +1,65 @@ +<?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.CompanyDictMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.subsidy.model.CompanyDictDO"> + <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="company_name" property="companyName" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + create_date, + update_date, + delete_date, + id, company_name + </sql> + + <select id="operators" resultType="com.subsidy.vo.administer.OperatorsVO"> + SELECT + t.id, + t2.id as companyId, + t.telephone, + t.user_name, + t2.field, + t2.banner, + t2.short_name, + t.account_name, + t.img, + t2.company_name, + t2.logo + FROM + administer t + left join company_dict t2 on t.company_id = t2.id + WHERE + t.delete_date IS NULL + AND t.role = #{role} + <if test="companyName != null and companyName != ''"> + and t2.company_name like concat('%',#{companyName} ,'%') + </if> + <if test="userName != null and userName != ''"> + and t.user_name like concat('%',#{userName} ,'%') + </if> + <if test="id != null and id !=''"> + and t.id = #{id} + </if> + </select> + + <select id="getAdministerByCompanyId" parameterType="long" resultType="com.subsidy.model.AdministerDO"> + SELECT + * + 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 + </select> + +</mapper> diff --git a/src/main/resources/mapper/CourseAdministerMappingMapper.xml b/src/main/resources/mapper/CourseAdministerMappingMapper.xml new file mode 100644 index 0000000..26adf76 --- /dev/null +++ b/src/main/resources/mapper/CourseAdministerMappingMapper.xml @@ -0,0 +1,35 @@ +<?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.meishu.mapper.CourseAdministerMappingMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.meishu.model.CourseAdministerMappingDO"> + <id column="id" property="id" /> + <result column="create_date" property="createTime" /> + <result column="update_date" property="updateTime" /> + <result column="delete_date" property="deleteTime" /> + <result column="course_id" property="courseId" /> + <result column="administer_id" property="administerId" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + create_date, + update_date, + delete_date, + id, course_id, administer_id + </sql> + + + <select id="getAdminister" resultType="com.meishu.model.AdministerDO"> + SELECT + t2.* + FROM + course_administer_mapping t + LEFT JOIN administer t2 ON t.administer_id = t2.id + where t.delete_date is null + and t2.delete_date is null + and t.course_id = #{courseId} + </select> + +</mapper> diff --git a/src/main/resources/mapper/CourseContentMapper.xml b/src/main/resources/mapper/CourseContentMapper.xml new file mode 100644 index 0000000..2b17ffb --- /dev/null +++ b/src/main/resources/mapper/CourseContentMapper.xml @@ -0,0 +1,37 @@ +<?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.CourseContentMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.subsidy.model.CourseContentDO"> + <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="content" property="content" /> + <result column="order_no" property="orderNo" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + create_date, + update_date, + delete_date, + id, course_id, content, order_no + </sql> + + <select id="getCourseVods" parameterType="integer" resultType="com.subsidy.model.VodDictDO"> + SELECT + t2.* + FROM + course_content t + LEFT JOIN vod_dict t2 ON t.id = t2.content_id + WHERE + t.delete_date IS NULL + AND t2.delete_date IS NULL + and t.course_id = #{courseId} + and t2.id is not null + </select> + +</mapper> diff --git a/src/main/resources/mapper/CourseDictMapper.xml b/src/main/resources/mapper/CourseDictMapper.xml new file mode 100644 index 0000000..77a179b --- /dev/null +++ b/src/main/resources/mapper/CourseDictMapper.xml @@ -0,0 +1,118 @@ +<?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.CourseDictMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.subsidy.model.CourseDictDO"> + <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_name" property="courseName" /> + <result column="category_id" property="categoryId" /> + <result column="course_type" property="courseType" /> + <result column="course_source" property="courseSource" /> + </resultMap> + + <!-- 通用查询结果列 --> + <select id="queryCourses" resultType="com.subsidy.vo.course.QueryCoursesVO"> + SELECT + t.*, + t2.name + FROM + course_dict t + left join category t2 on t.category_id = t2.id + WHERE + t.delete_date IS NULL + <if test="companyId != null and companyId !=''" > + and t.company_id = #{companyId} + </if> + <if test="companyId ==null"> + and t.company_id is null + </if> + <if test="categoryId != null"> + AND t.category_id = #{categoryId} + </if> + <if test="courseName != null and courseName !=''"> + AND t.course_name like concat('%',#{courseName} ,'%') + </if> + <if test="courseSource != null and courseSource != ''"> + AND t.course_source = #{courseSource} + </if> + <if test="courseType != null and courseType !=''"> + AND t.course_type = #{courseType} + </if> + + </select> + + <sql id="Base_Column_List"> + create_date, + update_date, + delete_date, + id, course_name, category_id, course_type, course_source + </sql> + + <select id="queryCourseMember" parameterType="com.subsidy.vo.member.StudyPageVO" resultType="com.subsidy.model.ClassMemberMappingDO"> + SELECT + t3.* + FROM + course_dict t + LEFT JOIN class_dict t2 ON t.id = t2.course_id + LEFT JOIN class_member_mapping t3 ON t2.id = t3.member_id + WHERE + t.delete_date IS NULL + AND t2.delete_date IS NULL + AND t3.delete_date IS NULL + AND t.id = {classId} + </select> + + <select id="queryPublicCourses" resultType="com.subsidy.vo.course.QueryCoursesVO"> + SELECT + t.*, + t2.name + FROM + course_dict t + left join category t2 on t.category_id = t2.id + WHERE + t.delete_date IS NULL + <if test="categoryId != null"> + AND t.category_id = #{categoryId} + </if> + <if test="courseName != null and courseName !=''"> + AND t.course_name like concat('%',#{courseName} ,'%') + </if> + <if test="courseSource != null and courseSource != ''"> + AND t.course_source = #{courseSource} + </if> + <if test="courseType != null and courseType !=''"> + AND t.course_type = #{courseType} + </if> + AND t.administer_id is null + </select> + + <select id="queryCompanyCourse" resultType="com.subsidy.vo.course.QueryCoursesVO"> + SELECT + t.*, + t2.name + FROM + course_dict t + left join category t2 on t.category_id = t2.id + WHERE + t.delete_date IS NULL + <if test="categoryId != null"> + AND t.category_id = #{categoryId} + </if> + <if test="courseName != null and courseName !=''"> + AND t.course_name like concat('%',#{courseName} ,'%') + </if> + <if test="courseSource != null and courseSource != ''"> + AND t.course_source = #{courseSource} + </if> + <if test="courseType != null and courseType !=''"> + AND t.course_type = #{courseType} + </if> + <if test="companyId !=null and companyId !='' "> + AND t.company_id = #{companyId} + </if> + </select> +</mapper> diff --git a/src/main/resources/mapper/CourseStudentStatusHistoryMapper.xml b/src/main/resources/mapper/CourseStudentStatusHistoryMapper.xml new file mode 100644 index 0000000..1f7c85d --- /dev/null +++ b/src/main/resources/mapper/CourseStudentStatusHistoryMapper.xml @@ -0,0 +1,50 @@ +<?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.meishu.mapper.CourseStudentStatusHistoryMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.meishu.model.CourseStudentStatusHistoryDO"> + <id column="id" property="id" /> + <result column="create_date" property="createTime" /> + <result column="update_date" property="updateTime" /> + <result column="delete_date" property="deleteTime" /> + <result column="course_id" property="courseId" /> + <result column="student_id" property="studentId" /> + <result column="status" property="status" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + create_date, + update_date, + delete_date, + id, course_id, student_id, status + </sql> + + <select id="getStudentHistory" parameterType="com.meishu.model.CourseStudentStatusHistoryDO" resultType="com.meishu.vo.course.GetStudentHistoryVO"> + SELECT + t.id, + t2.username, + t3.course_name, + t.create_date, + t.start_date, + t.end_date, + t4.user_name as administer, + t5.campus + FROM + course_student_status_history t + LEFT join student t2 ON t.student_id = t2.id + LEFT JOIN course_dict t3 ON t.course_id = t3.id + left join administer t4 on t.administer_id = t4.id + left join campus_dict t5 on t2.campus_id = t5.id + WHERE + t.delete_date IS NULL + AND t2.delete_date IS NULL + AND t3.delete_date IS NULL + AND t.course_id = #{courseId} + AND t.student_id = #{studentId} + + </select> + + +</mapper> diff --git a/src/main/resources/mapper/CourseTreeExerciseStudentResultMapper.xml b/src/main/resources/mapper/CourseTreeExerciseStudentResultMapper.xml new file mode 100644 index 0000000..98d1a61 --- /dev/null +++ b/src/main/resources/mapper/CourseTreeExerciseStudentResultMapper.xml @@ -0,0 +1,110 @@ +<?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.meishu.mapper.CourseTreeExerciseStudentResultMapper"> + +<!-- <!– 通用查询映射结果 –>--> +<!-- <resultMap id="BaseResultMap" type="com.meishu.model.CourseTreeExerciseStudentResultDO">--> +<!-- <id column="id" property="id" />--> +<!-- <result column="create_date" property="createTime" />--> +<!-- <result column="update_date" property="updateTime" />--> +<!-- <result column="create_date" property="deleteTime" />--> +<!-- <result column="student_id" property="studentId" />--> +<!-- <result column="course_id" property="courseId" />--> +<!-- <result column="exercise_id" property="exerciseId" />--> +<!-- <result column="answer" property="answer" />--> +<!-- <result column="length" property="length" />--> +<!-- <result column="result" property="result" />--> +<!-- </resultMap>--> + + <!-- 通用查询结果列 --> +<!-- <sql id="Base_Column_List">--> +<!-- create_date,--> +<!-- update_date,--> +<!-- create_date,--> +<!-- id, student_id, course_id, exercise_id, answer, length, result--> +<!-- </sql>--> + + <select id="studentExercise" resultType="com.meishu.model.CourseTreeExerciseStudentResultDO"> + SELECT + * + FROM + course_tree_exercise_student_result t + WHERE + t.delete_date IS NULL + AND t.student_id = #{studentId} + AND t.chapter_id = #{chapterId} + </select> + + <select id="getTreesByExerciseIds" parameterType="long" resultType="com.meishu.model.CourseTreeDO"> + SELECT DISTINCT + t3.* + FROM + exercise_dict t + LEFT JOIN exercise_related t2 ON t.id = t2.exercise_id + LEFT JOIN course_tree t3 ON t2.tree_id = t3.id + WHERE + t.delete_date IS NULL + AND t2.delete_date IS NULL + AND t3.delete_date IS NULL + and t3.id is not null + <if test="longs!=null"> + AND t.id IN + <foreach collection="longs" item="id" index="index" open="(" close=")" separator=","> + #{id} + </foreach> + </if> + </select> + + <select id="getExerciseDetail" resultType="com.meishu.vo.course.GetExerciseDetailVO"> + SELECT + t2.id, + t2.exercise_type, + t2.title, + t2.right_answer, + t2.difficulty, + t2.items, + t2.advice_length, + t.answer, + t.length, + t.result, + t3.rightCounts, + t4.totalCounts, + round( t3.rightCounts / t4.totalCounts, 2 ) AS rightPercent, + round( t5.totalLength / t4.totalCounts, 2 ) AS avgLength, + t.create_date + FROM + course_tree_exercise_student_result t + LEFT JOIN exercise_dict t2 ON t.exercise_id = t2.id + LEFT JOIN ( + SELECT + t.exercise_id, + sum( 1 ) AS rightCounts + FROM + course_tree_exercise_student_result t + WHERE + t.result = 1 + AND t.delete_date IS NULL + GROUP BY + t.exercise_id + ) t3 ON t.exercise_id = t3.exercise_id + LEFT JOIN ( SELECT t.exercise_id, sum( 1 ) AS totalCounts FROM course_tree_exercise_student_result t WHERE t.delete_date IS NULL GROUP BY t.exercise_id ) t4 ON t.exercise_id = t4.exercise_id + LEFT JOIN ( + SELECT + t.exercise_id, + sum( t.length ) AS totalLength + FROM + course_tree_exercise_student_result t + WHERE + t.delete_date IS NULL + GROUP BY + t.exercise_id + ) t5 ON t.exercise_id = t3.exercise_id + WHERE + t.delete_date IS NULL + AND t2.delete_date IS NULL + AND t.student_id = #{studentId} + AND t.chapter_id = #{chapterId} + </select> + + +</mapper> diff --git a/src/main/resources/mapper/CourseTreeVodStudentResultMapper.xml b/src/main/resources/mapper/CourseTreeVodStudentResultMapper.xml new file mode 100644 index 0000000..99bc778 --- /dev/null +++ b/src/main/resources/mapper/CourseTreeVodStudentResultMapper.xml @@ -0,0 +1,23 @@ +<?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.meishu.mapper.CourseTreeVodStudentResultMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.meishu.model.CourseTreeVodStudentResultDO"> + <id column="id" property="id" /> + <result column="create_date" property="createTime" /> + <result column="update_date" property="updateTime" /> + <result column="create_date" property="deleteTime" /> + <result column="student_id" property="studentId" /> + <result column="course_tree_id" property="courseTreeId" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + create_date, + update_date, + create_date, + id, student_id, course_tree_id + </sql> + +</mapper> diff --git a/src/main/resources/mapper/CourseVodTressStudentResultMapper.xml b/src/main/resources/mapper/CourseVodTressStudentResultMapper.xml new file mode 100644 index 0000000..2f4b645 --- /dev/null +++ b/src/main/resources/mapper/CourseVodTressStudentResultMapper.xml @@ -0,0 +1,23 @@ +<?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.meishu.mapper.CourseVodTressStudentResultMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.meishu.model.CourseTreeVodStudentResultDO"> + <id column="id" property="id" /> + <result column="create_date" property="createTime" /> + <result column="update_date" property="updateTime" /> + <result column="delete_date" property="deleteTime" /> + <result column="student_id" property="studentId" /> + <result column="course_tree_id" property="courseTreeId" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + create_date, + update_date, + delete_date, + id, student_id, course_tree_id + </sql> + +</mapper> diff --git a/src/main/resources/mapper/DepartmentDictMapper.xml b/src/main/resources/mapper/DepartmentDictMapper.xml new file mode 100644 index 0000000..bb55b2c --- /dev/null +++ b/src/main/resources/mapper/DepartmentDictMapper.xml @@ -0,0 +1,36 @@ +<?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.DepartmentDictMapper"> + +<!-- <!– 通用查询映射结果 –>--> +<!-- <resultMap id="BaseResultMap" type="com.subsidy.model.DepartmentDictDO">--> +<!-- <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="department_name" property="departmentName" />--> +<!-- <result column="parent_id" property="parentId" />--> +<!-- <result column="children" property="children" />--> +<!-- </resultMap>--> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + create_date, + update_date, + delete_date, + id, department_name, department_leader_id, parent_id, children + </sql> + +<!-- <select id="getDepartments" parameterType="long" resultType="com.subsidy.dto.department.GetDepartmentsVO">--> +<!-- SELECT--> +<!-- t.*,--> +<!-- t2.cnt--> +<!-- FROM--> +<!-- department_dict t--> +<!-- LEFT JOIN ( SELECT id, sum( 1 ) AS cnt FROM member t WHERE t.delete_date IS NULL GROUP BY t.department_id ) t2 ON t.id = t2.id--> +<!-- WHERE--> +<!-- t.delete_date IS NULL--> +<!-- AND t.company_id =#{companyId}--> +<!-- </select>--> + +</mapper> diff --git a/src/main/resources/mapper/ExerciseCourseTreeMappingMapper.xml b/src/main/resources/mapper/ExerciseCourseTreeMappingMapper.xml new file mode 100644 index 0000000..522f561 --- /dev/null +++ b/src/main/resources/mapper/ExerciseCourseTreeMappingMapper.xml @@ -0,0 +1,133 @@ +<?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.meishu.mapper.ExerciseCourseTreeMappingMapper"> + +<!-- <!– 通用查询映射结果 –>--> +<!-- <resultMap id="BaseResultMap" type="com.meishu.model.ExerciseCourseTreeMappingDO">--> +<!-- <id column="id" property="id" />--> +<!-- <result column="create_date" property="createTime" />--> +<!-- <result column="update_date" property="updateTime" />--> +<!-- <result column="delete_date" property="deleteTime" />--> +<!-- <result column="exercise_id" property="exerciseId" />--> +<!-- <result column="status" property="status" />--> +<!-- </resultMap>--> + + <!-- 通用查询结果列 --> + <select id="queryCourseTreeExercise" parameterType="com.meishu.dto.exercise.QueryCourseTreeExerciseDTO" resultType="com.meishu.vo.exercise.QueryCourseTreeExerciseVO"> + SELECT + t.id, + t2.exercise_type, + t2.title, + t2.items, + t2.detail, + t2.right_answer, + t2.difficulty, + t3.user_name, + t.status, + t2.create_date as update_date, + t4.right_cnt , + t5.total_cnt, + ROUND(t4.right_cnt/t5.total_cnt,0) as right_percent + FROM + exercise_course_tree_mapping t + LEFT JOIN exercise_dict t2 ON t.exercise_id = t2.id + LEFT JOIN administer t3 ON t2.administer_id = t3.id + LEFT JOIN ( + SELECT + t.course_id, + t.exercise_id, + sum( t.result ) AS right_cnt + FROM + course_tree_exercise_student_result t + GROUP BY + t.course_id, + t.exercise_id + ) t4 ON t.exercise_id = t4.exercise_id + left join (SELECT + t.course_id, + t.exercise_id, + count( t.result ) AS total_cnt + FROM + course_tree_exercise_student_result t + GROUP BY + t.course_id, + t.exercise_id) t5 ON t.exercise_id = t5.exercise_id + WHERE + t.delete_date IS NULL + AND t2.delete_date IS NULL + <if test="title!=null and title !=''"> + AND t2.title like concat('%',#{title} ,'%') + </if> + <if test="exerciseType!=null and exerciseType!=''"> + and exercise_type = #{exerciseType} + </if> + <if test="difficulty !=null and difficulty!=''"> + and difficulty = #{difficulty} + </if> + <if test="courseTreeId!=null and courseTreeId !=''"> + AND t.course_tree_id = #{courseTreeId} + </if> + AND t.course_id = #{courseId} + </select> + + <sql id="Base_Column_List"> + create_date, + update_date, + delete_date, + id, exercise_id, tree_id, status + </sql> + + <select id="getParentTreeId" parameterType="long" resultType="com.meishu.model.CourseTreeDO"> + SELECT + t2.* + FROM + exercise_course_tree_mapping t + LEFT JOIN course_tree t2 ON t.course_tree_id = t2.id + WHERE + t.id = #{id} + and t.delete_date is null + and t2.delete_date is null + </select> + + <select id="getExercisesByTree" parameterType="com.meishu.dto.course.GetExercisesByTreeDTO" resultType="com.meishu.model.ExerciseDictDO"> + SELECT + t3.* + FROM + exercise_course_tree_mapping t + LEFT JOIN course_tree t2 ON t.course_tree_id = t2.id + LEFT JOIN exercise_dict t3 ON t.exercise_id = t3.id + WHERE + t.delete_date IS NULL + AND t2.delete_date IS NULL + AND t3.delete_date IS NULL + AND t2.id = #{treeId} +<!-- AND t3.id not IN--> +<!-- <foreach collection="exerciseIds" item="id" index="index" open="(" close=")" separator=",">--> +<!-- #{id}--> +<!-- </foreach>--> + </select> + + <select id="queryChapterTest" resultType="com.meishu.vo.student.QueryChapterTestVO"> + SELECT + t2.id, + t2.title, + t2.right_answer, + t2.items, + t2.difficulty, + t2.exercise_type, + t2.detail, + t2.advice_length, + t.length, + t.result, + t.answer + FROM + course_tree_exercise_student_result t + LEFT JOIN exercise_dict t2 ON t.exercise_id = t2.id + WHERE + t.delete_date IS NULL + AND t2.delete_date IS NULL + AND t.student_id = #{studentId} + AND t.chapter_id = #{chapterId} + </select> + +</mapper> diff --git a/src/main/resources/mapper/ExerciseDictMapper.xml b/src/main/resources/mapper/ExerciseDictMapper.xml new file mode 100644 index 0000000..7c0cd4f --- /dev/null +++ b/src/main/resources/mapper/ExerciseDictMapper.xml @@ -0,0 +1,28 @@ +<?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.ExerciseDictMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.subsidy.model.ExerciseDictDO"> + <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="exercise_type" property="exerciseType" /> + <result column="course_id" property="courseId" /> + <result column="difficulty" property="difficulty" /> + <result column="title" property="title" /> + <result column="items" property="items" /> + <result column="right_answer" property="rightAnswer" /> + <result column="detail" property="detail" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + create_date, + update_date, + delete_date, + id, exercise_type, course_id, difficulty, title, items, right_answer, detail + </sql> + +</mapper> diff --git a/src/main/resources/mapper/ExerciseDoneHistoryMapper.xml b/src/main/resources/mapper/ExerciseDoneHistoryMapper.xml new file mode 100644 index 0000000..277becd --- /dev/null +++ b/src/main/resources/mapper/ExerciseDoneHistoryMapper.xml @@ -0,0 +1,269 @@ +<?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.meishu.mapper.ExerciseDoneHistoryMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.meishu.model.ExerciseDoneHistoryDO"> + <id column="id" property="id" /> + <result column="create_date" property="createTime" /> + <result column="update_date" property="updateTime" /> + <result column="create_date" property="deleteTime" /> + <result column="student_id" property="studentId" /> + <result column="subject_id" property="subjectId" /> + <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, + create_date, + id, student_id, subject_id, exercise_type, exercise_id, answer, result, length + </sql> + + <select id="perStudentRelateExes" parameterType="com.meishu.dto.task.PerStudentExesDTO" resultType="com.meishu.vo.task.PerStuExeDoneResponseVO"> + SELECT + t.id as userId, + t.study_code, + t.user_name, + ifnull(t5.rights,0) as rightCounts, + ifnull(t5.length,0) as length, + ifnull(t5.totalCounts,0) as totalCounts, + t5.submit_date + FROM + user_role t + left join classes_user_mapping t4 on t4.user_id = t.id + left join classes_dict t3 on t4.classes_id = t3.id + LEFT JOIN subject_dict t2 ON t3.grade = t2.grade + AND t3.classes = t2.classes + AND t3.`session` = t2.`session` + LEFT JOIN ( + SELECT + t.user_id, + t2.user_name, + sum( result ) AS rights, + sum( length ) AS length, + sum(1) as totalCounts, + max(t.create_date) submit_date + FROM + exercise_done_history t + left join user_role t2 + on t.user_id = t2.id + WHERE + task_subject_id = #{taskId} + AND exercise_type = 0 + AND content_id = #{treeId} + and class_type = 0 + GROUP BY + t.user_id + ) t5 ON t.id = t5.user_id + where + t2.id = #{subjectId} + order by t.study_code + </select> + + + <select id="classDoneInfo" parameterType="com.meishu.dto.task.ClassDoneInfoDTO" resultType="com.meishu.vo.task.ClassDoneInfoVO"> + SELECT + t.exercise_id, + sum( length ) AS length, + sum( result ) AS result + FROM + exercise_done_history t + WHERE + t.class_type = 0 + AND task_subject_id = #{taskId} + AND exercise_type = #{exerciseType} + AND content_id = #{treeId} + and done_type = '已完成' + GROUP BY + exercise_id + </select> + + <select id="exesDoneInfo" parameterType="com.meishu.dto.task.ExesDoneInfoPO" resultType="com.meishu.vo.task.ClassDoneInfoVO"> + SELECT + t.exercise_id, + sum( length ) AS length, + sum( result ) AS result, + count(1) as countNum + FROM + exercise_done_history t + WHERE 1=1 and t.exercise_id in + <foreach collection="exeIds" item="id" index="index" open="(" close=")" separator=","> + #{id} + </foreach> + GROUP BY + exercise_id + </select> + + <select id="getRelateExeDoneInfo" parameterType="com.meishu.vo.task.GetClassExeDoneInfoRequestVO" resultType="com.meishu.vo.task.GetClassExeDoneInfoResponseVO"> + SELECT + t.exercise_id, + t.exercise_type, + t.tree_id, + t.title, + t.answer, + t.right_answer, + t.result, + t.length, + t.exeType, + ifnull( t3.result, 0 ) AS classResult, + ifnull( t3.length, 0 ) AS classLength + FROM + ( + SELECT + t.*, + t4.title, + t4.right_answer, + t4.tree_id, + t4.exercise_type as exeType + FROM + exercise_done_history t + LEFT JOIN exercise_dict t4 ON t.exercise_id = t4.id + WHERE + t.user_id = #{userId} + AND t.class_type = 0 + AND task_subject_id = #{taskId} + AND t.exercise_type = 0 + and t.done_type = '已完成' + AND content_id = #{treeId} + ) t + LEFT JOIN ( + SELECT + t.exercise_id, + sum( length ) AS length, + sum( result ) AS result + FROM + exercise_done_history t + WHERE + t.class_type = 0 + AND task_subject_id = #{taskId} + AND exercise_type = 0 + and done_type = '已完成' + AND content_id = #{treeId} + GROUP BY + exercise_id + ) t3 ON t.exercise_id = t3.exercise_id + </select> + + <select id="getExpandingExeDoneInfo" parameterType="com.meishu.vo.task.GetClassExeDoneInfoRequestVO" resultType="com.meishu.vo.task.GetClassExeDoneInfoResponseVO"> + SELECT + t1.exercise_id, + t1.exeType, + t1.tree_id, + t1.title, + t1.right_answer, + t1.result, + t1.answer, + t1.length, + ifnull(t2.length,0) AS classLength, + ifnull(t2.result,0) AS class_result + FROM + ( + SELECT + exercise_id, + t2.exercise_type as exeType, + t2.tree_id, + t2.title, + t2.right_answer, + t.result, + t.answer, + t.length + FROM + exercise_done_history t + LEFT JOIN exercise_dict t2 ON t.exercise_id = t2.id + WHERE + t.content_id = #{treeId} + AND t.user_id = #{userId} + and t.task_subject_id = #{taskId} + and t.done_type = '已完成' + and class_type = 0 + ) t1 + LEFT JOIN ( + SELECT + t.exercise_id, + sum( t.result ) AS result, + sum( t.length ) AS length + FROM + exercise_done_history t + WHERE + t.content_id = #{treeId} + and t.task_subject_id = #{taskId} + and t.class_type = 0 + and t.done_type = '已完成' + AND t.user_id IN + <foreach collection="userIds" item="id" index="index" open="(" close=")" separator=","> + #{id} + </foreach> + GROUP BY + exercise_id + ) t2 ON t1.exercise_id = t2.exercise_id + </select> + + <select id="perStudentExpandingExes" parameterType="com.meishu.dto.task.PerStudentExesRequestVO" resultType="com.meishu.vo.task.PerStuExeDoneResponseVO"> + SELECT + t3.id as user_id, + t3.study_code, + t3.user_name, + t2.classes_id, + ifnull(t2.rightCounts,0) as rightCounts, + ifnull(t2.length,0) as length, + t2.submit_date + FROM + ( + SELECT + * + FROM + classes_user_mapping t + WHERE t.delete_date is null and + t.user_id IN + <foreach collection="userIds" item="id" index="index" open="(" close=")" separator=","> + #{id} + </foreach> + <if test="classesId!=null"> + AND classes_id = #{classesId} + </if> + ) t + left join user_role t3 on t.user_id = t3.id + LEFT JOIN ( + SELECT + t1.user_id, + t2.study_code, + t2.user_name, + classes_id, + ifnull( t1.rights, 0 ) AS rightCounts, + ifnull( t1.length, 0 ) AS length, + t1.submit_date + FROM + ( + SELECT + t.user_id, + sum( result ) AS rights, + sum( length ) AS length, + max( update_date ) AS submit_date + FROM + exercise_done_history t + WHERE + t.task_subject_id = #{taskId} +-- and t.done_type = '已完成' + AND t.content_id = #{treeId} + GROUP BY + t.user_id + ) t1 + LEFT JOIN ( + SELECT + t4.study_code, + t3.user_id as user_role_id, + t3.classes_id, + t4.user_name + FROM + classes_user_mapping t3 + LEFT JOIN user_role t4 ON t3.user_id = t4.id + ) t2 ON t1.user_id = t2.user_role_id + ) t2 ON t.user_id = t2.user_id + AND t.classes_id = t2.classes_id + </select> +</mapper> diff --git a/src/main/resources/mapper/ExerciseDoneResultMapper.xml b/src/main/resources/mapper/ExerciseDoneResultMapper.xml new file mode 100644 index 0000000..4b35529 --- /dev/null +++ b/src/main/resources/mapper/ExerciseDoneResultMapper.xml @@ -0,0 +1,25 @@ +<?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.ExerciseDoneResultMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.subsidy.model.ExerciseDoneResultDO"> + <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="member_id" property="memberId" /> + <result column="course_id" property="courseId" /> + <result column="right_counts" property="rightCounts" /> + <result column="total_counts" property="totalCounts" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + create_date, + update_date, + delete_date, + id, member_id, course_id, right_counts, total_counts + </sql> + +</mapper> diff --git a/src/main/resources/mapper/ExerciseExpandMappingMapper.xml b/src/main/resources/mapper/ExerciseExpandMappingMapper.xml new file mode 100644 index 0000000..9be917a --- /dev/null +++ b/src/main/resources/mapper/ExerciseExpandMappingMapper.xml @@ -0,0 +1,23 @@ +<?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.meishu.mapper.ExerciseExpandMappingMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.meishu.model.ExerciseExpandMappingDO"> + <id column="id" property="id" /> + <result column="create_date" property="createDate" /> + <result column="update_date" property="updateDate" /> + <result column="task_id" property="taskId" /> + <result column="exercise_ids" property="exerciseIds" /> + <result column="student_ids" property="studentIds" /> + <result column="exercise_name" property="exerciseName" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + create_date, + update_date, + id, task_id, exercise_ids, student_ids, exercise_name + </sql> + +</mapper> diff --git a/src/main/resources/mapper/ExerciseRelatedMappingMapper.xml b/src/main/resources/mapper/ExerciseRelatedMappingMapper.xml new file mode 100644 index 0000000..2aeab4a --- /dev/null +++ b/src/main/resources/mapper/ExerciseRelatedMappingMapper.xml @@ -0,0 +1,24 @@ +<?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.meishu.mapper.ExerciseRelatedMappingMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.meishu.model.ExerciseRelatedMappingDO"> + <id column="id" property="id" /> + <result column="create_date" property="createDate" /> + <result column="update_date" property="updateDate" /> + <result column="task_id" property="taskId" /> + <result column="tree_id" property="treeId" /> + <result column="exercise_ids" property="exerciseIds" /> + <result column="student_ids" property="studentIds" /> + <result column="exercise_name" property="exerciseName" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + create_date, + update_date, + id, task_id, tree_id, exercise_ids, student_ids, exercise_name + </sql> + +</mapper> diff --git a/src/main/resources/mapper/ExerciseTreeMappingMapper.xml b/src/main/resources/mapper/ExerciseTreeMappingMapper.xml new file mode 100644 index 0000000..80f1a17 --- /dev/null +++ b/src/main/resources/mapper/ExerciseTreeMappingMapper.xml @@ -0,0 +1,67 @@ +<?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.meishu.mapper.ExerciseTreeMappingMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.meishu.model.ExerciseTreeMappingDO"> + <id column="id" property="id" /> + <result column="exercise_id" property="exerciseId" /> + <result column="tree_id" property="treeId" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + create_date, + update_date, + delete_date, + id, exercise_id, tree_id + </sql> + + <select id="getTreeExerciseCount" resultType="integer"> + SELECT + count(1) + FROM + exercise_related t + LEFT JOIN exercise_dict t2 ON t.exercise_id = t2.id + WHERE + t.delete_date IS NULL + AND t2.delete_date IS NULL + <if test="treeId !=null and treeId !=''"> + AND t.tree_id = #{treeId} + </if> + <if test="userId !=null and userId !=''"> + AND t2.user_id = #{userId} + </if> + <if test="shareStatus !=null and shareStatus !=''"> + AND t2.share_status = #{shareStatus} + </if> + <if test="subject!=null and subject !=''"> + AND t2.subject = #{subject} + </if> + <if test="checkStatus==2"> + AND t2.check_status = 2 + </if> + <if test="checkStatus==1"> + AND (t2.check_status = 1 or t2.check_status = 3 ) + </if> + </select> + + <select id="getRelatedExercise" resultType="com.meishu.model.ExerciseDictDO"> + SELECT + t2.id, + t2.advice_length, + t2.tree_id, + t2.exercise_type, + t2.difficulty, + t2.title, + t2.items, + t2.right_answer, + t2.detail + FROM + (SELECT t.exercise_id FROM exercise_related t WHERE t.tree_id = #{treeId} and t.status = 1)t + LEFT JOIN exercise_dict t2 + ON t.exercise_id = t2.id + where t2.check_status = 1 + </select> + +</mapper> diff --git a/src/main/resources/mapper/ExerciseUserInfoMapper.xml b/src/main/resources/mapper/ExerciseUserInfoMapper.xml new file mode 100644 index 0000000..646486b --- /dev/null +++ b/src/main/resources/mapper/ExerciseUserInfoMapper.xml @@ -0,0 +1,22 @@ +<?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.meishu.mapper.ExerciseUserInfoMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.meishu.model.ExerciseUserInfoDO"> + <id column="id" property="id" /> + <result column="create_date" property="createDate" /> + <result column="update_date" property="updateDate" /> + <result column="exercise_id" property="exerciseId" /> + <result column="user_id" property="userId" /> + <result column="collection_status" property="collectionStatus" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + create_date, + update_date, + id, exercise_id, user_id, collection_status + </sql> + +</mapper> diff --git a/src/main/resources/mapper/FileDictMapper.xml b/src/main/resources/mapper/FileDictMapper.xml new file mode 100644 index 0000000..8ef3647 --- /dev/null +++ b/src/main/resources/mapper/FileDictMapper.xml @@ -0,0 +1,25 @@ +<?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.FileDictMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.subsidy.model.FileDictDO"> + <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="content_id" property="contentId" /> + <result column="file_name" property="fileName" /> + <result column="file_size" property="fileSize" /> + <result column="order_no" property="orderNo" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + create_date, + update_date, + delete_date, + id, content_id, file_name, file_size, order_no + </sql> + +</mapper> diff --git a/src/main/resources/mapper/KnowledgeSubjectDictMapper.xml b/src/main/resources/mapper/KnowledgeSubjectDictMapper.xml new file mode 100644 index 0000000..202b1f2 --- /dev/null +++ b/src/main/resources/mapper/KnowledgeSubjectDictMapper.xml @@ -0,0 +1,58 @@ +<?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.meishu.mapper.KnowledgeSubjectDictMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.meishu.model.KnowledgeSubjectDictDO"> + <id column="id" property="id" /> + <result column="create_date" property="createTime" /> + <result column="update_date" property="updateTime" /> + <result column="create_date" property="deleteTime" /> + <result column="subject_name" property="subjectName" /> + <result column="subject_type" property="subjectType" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + create_date, + update_date, + create_date, + id, subject_name, subject_type + </sql> + + <select id="getSubjectAdminister" resultType="com.meishu.model.AdministerDO"> + SELECT + t2.* + FROM + administer_subject_mapping t + LEFT JOIN administer t2 ON t.administer_id = t2.id + WHERE + t.delete_date IS NULL + AND t2.delete_date IS NULL + <if test="subjectId!=null and subjectId !=''"> + AND t.subject_id = #{subjectId} + </if> + <if test="userName !=null and userName !=''"> + and t2.user_name like concat('%',#{userName} ,'%') + </if> + </select> + + <select id="getAdministerSubjects" resultType="com.meishu.model.KnowledgeSubjectDictDO"> + SELECT + t2.* + FROM + administer_subject_mapping t + LEFT JOIN knowledge_subject_dict t2 ON t.subject_id = t2.id + WHERE + t.delete_date IS NULL + AND t2.delete_date IS NULL + AND t.administer_id = #{userId} + <if test="subjectName!=null and subjectName !=''"> + and t2.subject_name like concat('%',#{subjectName} ,'%') + </if> + <if test="subjectType!=null and subjectType!=''"> + and t2.subject_type = #{subjectType} + </if> + </select> + +</mapper> diff --git a/src/main/resources/mapper/LaboratoryAttendanceMappingMapper.xml b/src/main/resources/mapper/LaboratoryAttendanceMappingMapper.xml new file mode 100644 index 0000000..39f18f8 --- /dev/null +++ b/src/main/resources/mapper/LaboratoryAttendanceMappingMapper.xml @@ -0,0 +1,25 @@ +<?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.meishu.mapper.LaboratoryAttendanceMappingMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.meishu.model.LaboratoryAttendanceMappingDO"> + <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="user_role_id" property="userRoleId" /> + <result column="laboratory_session_id" property="laboratorySessionId" /> + <result column="attendance_time" property="attendanceTime" /> + <result column="channel" property="channel" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + create_date, + update_date, + delete_date, + id, user_role_id, laboratory_session_id, attendance_time, channel + </sql> + +</mapper> diff --git a/src/main/resources/mapper/LaboratoryDictMapper.xml b/src/main/resources/mapper/LaboratoryDictMapper.xml new file mode 100644 index 0000000..8f1e882 --- /dev/null +++ b/src/main/resources/mapper/LaboratoryDictMapper.xml @@ -0,0 +1,49 @@ +<?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.meishu.mapper.LaboratoryDictMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.meishu.model.LaboratoryDictDO"> + <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="laboratory_name" property="laboratoryName" /> + <result column="laboratory_type" property="laboratoryType" /> + <result column="max_num" property="maxNum" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + create_date, + update_date, + delete_date, + id, laboratory_name, laboratory_type, max_num + </sql> + + <select id="getLaboratoryPage" resultType="com.meishu.vo.laboratorySession.LaboratoryDictPageVO"> + select * from laboratory_dict + <where> + <if test="laboratoryName != null and laboratoryName != ''"> + and laboratory_name like concat('%', #{laboratoryName} ,'%') + </if> + <if test="laboratoryType != null and laboratoryType != ''"> + and laboratory_type = #{laboratoryType} + </if> + and delete_date is null + </where> + </select> + + <select id="getLaboratoryDicOne" resultType="com.meishu.model.LaboratoryDictDO"> + select + ld.* + from laboratory_dict ld + left join laboratory_session_mapping lsm on lsm.laboratory_dict_id = ld.id + where lsm.start_date = #{startDate} + and ld.laboratory_type = #{laboratoryType} + and lsm.delete_date is null + and ld.delete_date is null + GROUP BY ld.laboratory_type + </select> + +</mapper> diff --git a/src/main/resources/mapper/LaboratoryDictMappingMapper.xml b/src/main/resources/mapper/LaboratoryDictMappingMapper.xml new file mode 100644 index 0000000..a8f7051 --- /dev/null +++ b/src/main/resources/mapper/LaboratoryDictMappingMapper.xml @@ -0,0 +1,23 @@ +<?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.meishu.mapper.LaboratoryDictMappingMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.meishu.model.LaboratoryDictMappingDO"> + <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="laboratory_dict_id" property="laboratoryDictId" /> + <result column="sessions_dict_id" property="sessionsDictId" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + create_date, + update_date, + delete_date, + id, laboratory_dict_id, sessions_dict_id + </sql> + +</mapper> diff --git a/src/main/resources/mapper/LaboratorySessionMappingMapper.xml b/src/main/resources/mapper/LaboratorySessionMappingMapper.xml new file mode 100644 index 0000000..e10d743 --- /dev/null +++ b/src/main/resources/mapper/LaboratorySessionMappingMapper.xml @@ -0,0 +1,80 @@ +<?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.meishu.mapper.LaboratorySessionMappingMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.meishu.model.LaboratorySessionMappingDO"> + <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="sessions_dict_id" property="sessionsDictId" /> + <result column="laboratory_dict_id" property="laboratoryDictId" /> + <result column="start_date" property="startDate" /> + <result column="register_start_date" property="registerStartDate" /> + <result column="register_end_date" property="registerEndDate" /> + <result column="grade" property="grade" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + create_date, + update_date, + delete_date, + id, sessions_dict_id, laboratory_dict_id, start_date, register_start_date, register_end_date, grade + </sql> + + <select id="getLaboratorySessionList" + resultType="com.meishu.vo.laboratorySession.LaboratorySessionMappingVO"> + select + lsm.*, + ld.laboratory_name as laboratoryName, + ld.max_num as maxNum + from laboratory_session_mapping lsm + left join laboratory_dict ld on ld.id = lsm.laboratory_dict_id + where lsm.start_date = #{startDate} + and lsm.delete_date is null + and ld.delete_date is null + GROUP BY lsm.laboratory_dict_id + </select> + + <select id="getOneById" resultType="com.meishu.vo.laboratorySession.LaboratorySessionMappingVO"> + select + lsm.*, + ld.laboratory_name as laboratoryName + from laboratory_session_mapping lsm + left join laboratory_dict ld on ld.id = lsm.laboratory_dict_id + left join sessions_dict sd on sd.id = lsm.sessions_dict_id + where lsm.id = #{id} + and lsm.delete_date is null + and ld.delete_date is null + and sd.delete_date is null + </select> + + <select id="getLaboratorySessionDate" resultType="com.meishu.model.LaboratorySessionMappingDO"> + select + lsm.* + from laboratory_session_mapping lsm + left join laboratory_dict ld on ld.id = lsm.laboratory_dict_id + where ld.laboratory_type = #{laboratoryType} + and lsm.delete_date is null + and ld.delete_date is null + group by lsm.start_date + </select> + + <select id="getList" resultType="com.meishu.model.LaboratorySessionMappingDO"> + SELECT + lsm.* + FROM + laboratory_session_mapping lsm + LEFT JOIN classes_dict cd ON cd.grade = lsm.grade + LEFT JOIN classes_user_mapping cum ON cum.classes_id = cd.id + WHERE + cum.user_id = #{studentId} + AND start_date = #{startDate} + and sessions_dict_id = #{sessionsDictId} + AND cd.delete_date IS NULL + AND cum.delete_date IS NULL + AND lsm.delete_date IS NULL + </select> +</mapper> diff --git a/src/main/resources/mapper/LaboratoryUserMappingMapper.xml b/src/main/resources/mapper/LaboratoryUserMappingMapper.xml new file mode 100644 index 0000000..de5a88e --- /dev/null +++ b/src/main/resources/mapper/LaboratoryUserMappingMapper.xml @@ -0,0 +1,84 @@ +<?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.meishu.mapper.LaboratoryUserMappingMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.meishu.model.LaboratoryUserMappingDO"> + <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="laboratory_session_id" property="laboratorySessionId" /> + <result column="user_role_id" property="userRoleId" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + create_date, + update_date, + delete_date, + id, laboratory_session_id, user_role_id + </sql> + + <select id="getLaboratoryUserPage" resultType="com.meishu.vo.laboratoryUser.LaboratoryUserPageVO"> + select + lum.*, + ur.user_name as userName, + ur.study_code as studyCode, + cd.class_name as classes, + sd.time_slot as timeSlot + from laboratory_user_mapping lum + left join laboratory_session_mapping lsm on lsm.id = lum.laboratory_session_id + left join user_role ur on ur.id = lum.user_role_id + left join sessions_dict sd on sd.id = lsm.sessions_dict_id + left join classes_user_mapping cum on cum.user_id = ur.id + left join classes_dict cd on cd.id = cum.classes_id + where lsm.laboratory_dict_id = #{laboratorySessionId} + and lsm.start_date = #{startDate} + and lum.delete_date is null + and lsm.delete_date is null + and ur.delete_date is null + and cum.delete_date is null + and cd.delete_date is NULL + and sd.delete_date is null + group by lum.user_role_id + order by sd.id asc + </select> + + <select id="getLaboratoryUserList" resultType="com.meishu.vo.laboratoryUser.LaboratoryUserPageVO"> + select + lum.*, + lsm.sessions_dict_id as sessionsDictId, + ur.user_name as userName, + ur.study_code as studyCode, + cd.class_name as classes + from laboratory_user_mapping lum + left join laboratory_session_mapping lsm on lsm.id = lum.laboratory_session_id + left join user_role ur on ur.id = lum.user_role_id + left join classes_user_mapping cum on cum.user_id = ur.id + left join classes_dict cd on cd.id = cum.classes_id + where lsm.laboratory_dict_id = #{laboratorySessionId} + and lsm.start_date = #{startDate} + and lum.delete_date is null + and lsm.delete_date is null + and ur.delete_date is null + and cd.delete_date is NULL + and cum.delete_date is NULL + group by lum.user_role_id,lum.laboratory_session_id + </select> + + <select id="getLaboratoryUserMapping" resultType="com.meishu.model.LaboratoryUserMappingDO"> + select + lum.* + from laboratory_user_mapping lum + left join laboratory_session_mapping lsm on lsm.id = lum.laboratory_session_id + left join laboratory_dict ld on ld.id = lsm.laboratory_dict_id + where lum.user_role_id = #{userRoleId} + and lsm.start_date = #{startDate} + and lsm.sessions_dict_id = #{sessionsDictId} + and lum.delete_date is null + and ld.delete_date is null + and lsm.delete_date is null + </select> + +</mapper> diff --git a/src/main/resources/mapper/MemberDepartmentMappingMapper.xml b/src/main/resources/mapper/MemberDepartmentMappingMapper.xml new file mode 100644 index 0000000..48fd063 --- /dev/null +++ b/src/main/resources/mapper/MemberDepartmentMappingMapper.xml @@ -0,0 +1,20 @@ +<?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.MemberDepartmentMappingMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.subsidy.model.MemberDepartmentMappingDO"> + <id column="id" property="id" /> + <result column="administer_id" property="administerId" /> + <result column="department_id" property="departmentId" /> + <result column="create_time" property="createTime" /> + <result column="update_time" property="updateTime" /> + <result column="delete_time" property="deleteTime" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + id, administer_id, department_id, create_time, update_time, delete_time + </sql> + +</mapper> diff --git a/src/main/resources/mapper/MemberMapper.xml b/src/main/resources/mapper/MemberMapper.xml new file mode 100644 index 0000000..21c7c26 --- /dev/null +++ b/src/main/resources/mapper/MemberMapper.xml @@ -0,0 +1,77 @@ +<?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.MemberMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.subsidy.model.MemberDO"> + <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="user_name" property="userName"/> + <result column="telephone" property="telephone"/> + <result column="password" property="password"/> + <result column="gender" property="gender"/> + <result column="image" property="image"/> + <result column="id_card" property="idCard"/> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + create_date, + update_date, + delete_date, + id, user_name, telephone, password, gender, image, id_card + </sql> + + <select id="studyPage" parameterType="com.subsidy.model.MemberDO" resultType="com.subsidy.vo.member.StudyPageVO"> + SELECT + t3.id, + t2.id as classId, + t3.course_name, + t2.end_date, + t2.class_name + FROM + class_member_mapping t + LEFT JOIN class_dict t2 ON t.class_id = t2.id + left join course_dict t3 on t2.course_id = t3.id + WHERE + t.delete_date IS NULL + AND t2.delete_date IS NULL + AND t.member_id = #{id} + </select> + + + <select id="getDepartments" parameterType="long" resultType="com.subsidy.model.DepartmentDictDO"> + SELECT + t2.id, + t2.department_name, + t2.parent_id + FROM + member_department_mapping t + LEFT JOIN department_dict t2 ON t.department_id = t2.id + WHERE + t.delete_date IS NULL + AND t2.delete_date IS NULL + AND t.member_id = #{memberId} + </select> + + <select id="getMembers" resultType="com.subsidy.vo.member.GetAllVO"> + SELECT + t2.* + FROM + member_department_mapping t + LEFT JOIN member t2 ON t.member_id = t2.id + WHERE + t.delete_date IS NULL + AND t2.delete_date IS NULL + and t.department_id = #{departmentId} + <if test="userName = null and userName !=''"> + and t2.user_name like concat('%',#{userName} ,'%') + </if> + <if test="status != null and status !=''"> + and t2.status = #{status} + </if> + </select> + +</mapper> diff --git a/src/main/resources/mapper/PermissionsDictMapper.xml b/src/main/resources/mapper/PermissionsDictMapper.xml new file mode 100644 index 0000000..9968c9a --- /dev/null +++ b/src/main/resources/mapper/PermissionsDictMapper.xml @@ -0,0 +1,24 @@ +<?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.PermissionsDictMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.subsidy.model.PermissionsDictDO"> + <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="parent_id" property="parentId" /> + <result column="name" property="name" /> + <result column="children" property="children" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + create_date, + update_date, + delete_date, + id, parent_id, name, children + </sql> + +</mapper> diff --git a/src/main/resources/mapper/RoleAdministerMappingMapper.xml b/src/main/resources/mapper/RoleAdministerMappingMapper.xml new file mode 100644 index 0000000..be38418 --- /dev/null +++ b/src/main/resources/mapper/RoleAdministerMappingMapper.xml @@ -0,0 +1,23 @@ +<?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.RoleAdministerMappingMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.subsidy.model.RoleAdministerMappingDO"> + <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="administer_id" property="administerId" /> + <result column="role_id" property="roleId" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + create_date, + update_date, + delete_date, + id, administer_id, role_id + </sql> + +</mapper> diff --git a/src/main/resources/mapper/RoleDictMapper.xml b/src/main/resources/mapper/RoleDictMapper.xml new file mode 100644 index 0000000..4339e33 --- /dev/null +++ b/src/main/resources/mapper/RoleDictMapper.xml @@ -0,0 +1,22 @@ +<?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.RoleDictMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.subsidy.model.RoleDictDO"> + <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="role" property="role" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + create_date, + update_date, + delete_date, + id, role + </sql> + +</mapper> diff --git a/src/main/resources/mapper/RolePermissionMappingMapper.xml b/src/main/resources/mapper/RolePermissionMappingMapper.xml new file mode 100644 index 0000000..65fa02d --- /dev/null +++ b/src/main/resources/mapper/RolePermissionMappingMapper.xml @@ -0,0 +1,23 @@ +<?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.RolePermissionMappingMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.subsidy.model.RolePermissionMappingDO"> + <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="role_id" property="roleId" /> + <result column="permission_id" property="permissionId" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + create_date, + update_date, + delete_date, + id, role_id, permission_id + </sql> + +</mapper> diff --git a/src/main/resources/mapper/SessionsDictMapper.xml b/src/main/resources/mapper/SessionsDictMapper.xml new file mode 100644 index 0000000..f3cde02 --- /dev/null +++ b/src/main/resources/mapper/SessionsDictMapper.xml @@ -0,0 +1,43 @@ +<?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.meishu.mapper.SessionsDictMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.meishu.model.SessionsDictDO"> + <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="time_slot" property="timeSlot" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + create_date, + update_date, + delete_date, + id, time_slot + </sql> + + <select id="getListById" resultType="com.meishu.model.SessionsDictDO"> + select + sd.* + from sessions_dict sd + left join laboratory_dict_mapping ldm on sd.id = ldm.sessions_dict_id + where ldm.laboratory_dict_id = #{laboratoryDictId} + and sd.delete_date is null + and ldm.delete_date is null + </select> + + <select id="getListSessionDictById" resultType="com.meishu.model.SessionsDictDO"> + select + sd.* + from sessions_dict sd + left join laboratory_session_mapping lsm on sd.id = lsm.sessions_dict_id + where lsm.laboratory_dict_id = #{laboratoryDictId} + and lsm.start_date = #{startDate} + and sd.delete_date is null + and lsm.delete_date is null + </select> + +</mapper> diff --git a/src/main/resources/mapper/SignInRecordMapper.xml b/src/main/resources/mapper/SignInRecordMapper.xml new file mode 100644 index 0000000..59b954b --- /dev/null +++ b/src/main/resources/mapper/SignInRecordMapper.xml @@ -0,0 +1,49 @@ +<?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.SignInRecordMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.subsidy.model.SignInRecordDO"> + <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="student_id" property="memberId" /> + <result column="class_id" property="classId" /> + <result column="sign_in_date" property="signInDate" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + create_date, + update_date, + delete_date, + id, student_id, class_id, sign_in_date + </sql> + + <select id="classSignInfo" resultType="com.subsidy.vo.sign.ClassSignInfoVO"> + SELECT + t.id AS classId, + t2.id AS courseId, + t.class_name, + t2.course_name, + t.start_date, + t.end_date, + t.class_type + FROM + class_dict t + LEFT JOIN company_dict t3 ON t3.id = t.company_id + LEFT JOIN course_dict t2 ON t.course_id = t2.id + WHERE + t.delete_date IS NULL + AND t2.delete_date IS NULL + and t3.id = #{id} + <if test="courseName != null and courseName !=''"> + AND t.course_name like concat('%',#{courseName} ,'%') + </if> + <if test="className != null and className !=''"> + and t.class_name like concat('%',#{className} ,'%') + </if> + </select> + +</mapper> diff --git a/src/main/resources/mapper/SmsCodeMapper.xml b/src/main/resources/mapper/SmsCodeMapper.xml new file mode 100644 index 0000000..22cfdf6 --- /dev/null +++ b/src/main/resources/mapper/SmsCodeMapper.xml @@ -0,0 +1,23 @@ +<?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.meishu.mapper.SmsCodeMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.meishu.model.SmsCodeDO"> + <id column="id" property="id" /> + <result column="create_date" property="createTime" /> + <result column="update_date" property="updateTime" /> + <result column="delete_date" property="deleteTime" /> + <result column="telephone" property="telephone" /> + <result column="code" property="code" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + create_date, + update_date, + delete_date, + id, telephone, code + </sql> + +</mapper> diff --git a/src/main/resources/mapper/SmsVerifyCodeMapper.xml b/src/main/resources/mapper/SmsVerifyCodeMapper.xml new file mode 100644 index 0000000..1333675 --- /dev/null +++ b/src/main/resources/mapper/SmsVerifyCodeMapper.xml @@ -0,0 +1,23 @@ +<?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.SmsVerifyCodeMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.subsidy.model.SmsVerifyCodeDO"> + <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="telephone" property="telephone" /> + <result column="verify_code" property="verifyCode" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + create_date, + update_date, + delete_date, + id, telephone, verify_code + </sql> + +</mapper> diff --git a/src/main/resources/mapper/SubjectDictMapper.xml b/src/main/resources/mapper/SubjectDictMapper.xml new file mode 100644 index 0000000..885c0c4 --- /dev/null +++ b/src/main/resources/mapper/SubjectDictMapper.xml @@ -0,0 +1,43 @@ +<?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.meishu.mapper.SubjectDictMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.meishu.model.SubjectDictDO"> + <id column="id" property="id" /> + <result column="create_date" property="createDate" /> + <result column="update_date" property="updateDate" /> + <result column="school" property="school" /> + <result column="grade" property="grade" /> + <result column="classes" property="classes" /> + <result column="class_name" property="className" /> + <result column="subject" property="subject" /> + <result column="subject_en" property="subjectEn" /> + <result column="subject_type" property="subjectType" /> + <result column="session" property="session" /> + <result column="semester" property="semester" /> + <result column="status" property="status" /> + <result column="cover_page_url" property="coverPageUrl" /> + <result column="front_page_url" property="frontPageUrl" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + create_date, + update_date, + id, school, grade, classes, class_name, subject, subject_en, subject_type, session, semester, status, cover_page_url, front_page_url + </sql> + + <select id="getClassSubjectName" resultType="string"> + SELECT + t.`subject` + FROM + subject_dict t + WHERE + t.delete_date IS NULL + AND t.grade = #{grade} + AND t.classes = #{classes} + AND t.`session` = #{session} + </select> + +</mapper> diff --git a/src/main/resources/mapper/SubjectDimensionDictMapper.xml b/src/main/resources/mapper/SubjectDimensionDictMapper.xml new file mode 100644 index 0000000..a448fff --- /dev/null +++ b/src/main/resources/mapper/SubjectDimensionDictMapper.xml @@ -0,0 +1,24 @@ +<?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.meishu.mapper.SubjectDimensionDictMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.meishu.model.SubjectDimensionDictDO"> + <id column="id" property="id" /> + <result column="create_date" property="createTime" /> + <result column="update_date" property="updateTime" /> + <result column="delete_date" property="deleteTime" /> + <result column="subject_id" property="subjectId" /> + <result column="dimension" property="dimension" /> + <result column="dimension_order" property="dimensionOrder" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + create_date, + update_date, + delete_date, + id, subject_id, dimension, dimension_order + </sql> + +</mapper> diff --git a/src/main/resources/mapper/SubjectDimensionStarDictMapper.xml b/src/main/resources/mapper/SubjectDimensionStarDictMapper.xml new file mode 100644 index 0000000..4c63807 --- /dev/null +++ b/src/main/resources/mapper/SubjectDimensionStarDictMapper.xml @@ -0,0 +1,37 @@ +<?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.meishu.mapper.SubjectDimensionStarDictMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.meishu.model.SubjectDimensionStarDictDO"> + <id column="id" property="id" /> + <result column="create_date" property="createTime" /> + <result column="update_date" property="updateTime" /> + <result column="create_date" property="deleteTime" /> + <result column="dimension_id" property="dimensionId" /> + <result column="star" property="star" /> + <result column="description" property="description" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + create_date, + update_date, + create_date, + id, dimension_id, star, description + </sql> + + <select id="getStar" resultType="com.meishu.model.SubjectDimensionStarDictDO"> + SELECT + * + FROM + subject_dimension_star_dict t + WHERE + t.delete_date IS NULL + AND t.dimension_id = #{dimensionId} + <if test="star !=null and star !=''"> + AND star = #{star} + </if> + </select> + +</mapper> diff --git a/src/main/resources/mapper/SubjectRuleMapper.xml b/src/main/resources/mapper/SubjectRuleMapper.xml new file mode 100644 index 0000000..3d23d50 --- /dev/null +++ b/src/main/resources/mapper/SubjectRuleMapper.xml @@ -0,0 +1,52 @@ +<?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.meishu.mapper.SubjectRuleMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.meishu.model.SubjectRuleDO"> + <id column="id" property="id" /> + <result column="create_date" property="createTime" /> + <result column="update_date" property="updateTime" /> + <result column="create_date" property="deleteTime" /> + <result column="subject_id" property="subjectId" /> + <result column="rule_name" property="ruleName" /> + <result column="status" property="status" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + create_date, + update_date, + create_date, + id, subject_id, rule_name, status + </sql> + + <select id="getAllRules" resultType="com.meishu.vo.rule.GetAllRulesVO"> + SELECT + t.id, + t2.subject_name, + t.subject_id, + t.rule_name, + t.`status` + FROM + subject_rule t + LEFT JOIN knowledge_subject_dict t2 ON t.subject_id = t2.id + where t.delete_date IS null + and t2.delete_date IS null + </select> + + <select id="getRules" resultType="com.meishu.vo.rule.GetAllRulesVO"> + SELECT + t.id, + t2.subject_name, + t.subject_id, + t.rule_name, + t.`status` + FROM + subject_rule t + LEFT JOIN knowledge_subject_dict t2 ON t.subject_id = t2.id + where t.delete_date IS null + and t2.delete_date IS null + and t.status = 1 + </select> +</mapper> diff --git a/src/main/resources/mapper/SubjectSemesterMapper.xml b/src/main/resources/mapper/SubjectSemesterMapper.xml new file mode 100644 index 0000000..9e9e21e --- /dev/null +++ b/src/main/resources/mapper/SubjectSemesterMapper.xml @@ -0,0 +1,129 @@ +<?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.meishu.mapper.SubjectSemesterMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.meishu.model.SubjectSemesterDO"> + <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="subject_id" property="subjectId" /> + <result column="semester" property="semester" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + create_date, + update_date, + delete_date, + id, subject_id, semester + </sql> + + <select id="getSemesterScore" resultType="com.meishu.vo.semester.GetSemesterScoreVO"> + SELECT + t3.id, + t5.id as userId, + t5.user_name, + t6.study_code, + t2.`subject`, + t4.score + FROM + subject_dict t2 + LEFT JOIN subject_semester t3 ON t2.id = t3.subject_id + LEFT JOIN pt_student_score t4 ON t3.id = t4.semester_id + LEFT JOIN user_role t5 ON t4.student_id = t5.id + LEFT JOIN user_studycode t6 ON t5.id = t6.user_role_id + where + t2.grade = #{grade} + and t3.delete_date is null + and t2.delete_date is null + and t2.classes = #{classes} + and t2.session = #{session} + and t3.delete_date is null + and t2.delete_date is null + <if test="semester != null and semester !=''"> + and t3.semester = #{semester} + </if> + <if test="userName != null and userName !=''"> + and t5.user_name like concat('%',#{userName} ,'%') + </if> + <if test="subject != null and subject !=''"> + and t2.subject = #{subject} + </if> + </select> + + <select id="exportScore" resultType="com.meishu.vo.semester.GetSemesterScoreVO"> + SELECT + t3.id, + t5.user_name, + t6.study_code, + t2.`subject`, + t4.score + FROM + subject_dict t2 + LEFT JOIN subject_semester t3 ON t2.id = t3.subject_id + LEFT JOIN pt_student_score t4 ON t3.id = t4.semester_id + LEFT JOIN user_role t5 ON t4.student_id = t5.id + LEFT JOIN user_studycode t6 ON t5.id = t6.user_role_id + where + t2.grade = #{grade} + and t2.classes = #{classes} + and t2.session = #{session} + <if test="semester != null and semester != '' "> + and t3.semester = #{semester} + </if> + <if test="userName != null and userName !=''"> + and t5.user_name = #{userName} + </if> + <if test="subject != null and subject !=''"> + and t2.subject = #{subject} + </if> + </select> + + <select id="getStudentDetail" resultType="com.meishu.vo.semester.GetStudentDetailVO"> + SELECT + t3.user_name as teacherName, + t2.item_desc, + t2.score, + t2.item_type, + t.create_date + FROM + pt_student_score_record t + LEFT JOIN pt_score_item_dict t2 ON t.score_item_id = t2.id + LEFT JOIN administer t3 ON t.create_by = t3.id + WHERE + t.semester_id = #{id} + AND t.student_id = #{userId} + </select> + + <select id="getStudentRecord" parameterType="com.meishu.dto.semester.GetStudentRecordDTO" resultType="com.meishu.vo.semester.GetStudentRecordVO"> + SELECT + t5.class_name, + t3.user_name, + t2.item_desc, + t2.score, + t6.user_name AS teacherName, + t8.`subject`, + t.create_date + FROM + pt_student_score_record t + LEFT JOIN pt_score_item_dict t2 ON t.score_item_id = t2.id + LEFT JOIN user_role t3 ON t.student_id = t3.id + LEFT JOIN classes_user_mapping t4 ON t3.id = t4.user_id + LEFT JOIN classes_dict t5 ON t4.classes_id = t5.id + LEFT JOIN administer t6 ON t.create_by = t6.id + left join subject_semester t7 on t.semester_id = t7.id + left join subject_dict t8 on t7.subject_id = t8.id + WHERE + t2.item_type = 0 + and t4.delete_date is null + <if test="startDate != null and startDate != ''"> + and DATE_FORMAT(t.create_date, '%Y-%m-%d') >= DATE_FORMAT(#{startDate}, '%Y-%m-%d') + </if> + <if test="endDate != null and endDate !=''"> + and DATE_FORMAT(t.create_date, '%Y-%m-%d') <= DATE_FORMAT(#{endDate}, '%Y-%m-%d') + </if> + </select> + +</mapper> diff --git a/src/main/resources/mapper/SubjectStarTreeMappingMapper.xml b/src/main/resources/mapper/SubjectStarTreeMappingMapper.xml new file mode 100644 index 0000000..3dc79f9 --- /dev/null +++ b/src/main/resources/mapper/SubjectStarTreeMappingMapper.xml @@ -0,0 +1,37 @@ +<?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.meishu.mapper.SubjectStarTreeMappingMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.meishu.model.SubjectStarTreeMappingDO"> + <id column="id" property="id" /> + <result column="create_date" property="createTime" /> + <result column="update_date" property="updateTime" /> + <result column="delete_date" property="deleteTime" /> + <result column="subject_star_id" property="subjectStarId" /> + <result column="knowledge_tree_id" property="subjectTreeId" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + create_date, + update_date, + delete_date, + id, subject_star_id, knowledge_tree_id + </sql> + + <select id="getSubjectTrees" parameterType="com.meishu.model.SubjectDimensionStarDictDO" resultType="com.meishu.model.SubjectTreeDO"> + SELECT + t2.* + FROM + subject_star_tree_mapping t + LEFT JOIN knowledge_tree t2 ON t.knowledge_tree_id = t2.id + WHERE + t.subject_star_id = #{id} + AND t.delete_date IS NULL + AND t2.delete_date IS NULL + </select> + + + +</mapper> diff --git a/src/main/resources/mapper/SubjectStudentAnswerStarMapper.xml b/src/main/resources/mapper/SubjectStudentAnswerStarMapper.xml new file mode 100644 index 0000000..711b688 --- /dev/null +++ b/src/main/resources/mapper/SubjectStudentAnswerStarMapper.xml @@ -0,0 +1,23 @@ +<?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.meishu.mapper.SubjectStudentAnswerStarMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.meishu.model.SubjectStudentAnswerStarDO"> + <id column="id" property="id" /> + <result column="create_date" property="createTime" /> + <result column="update_date" property="updateTime" /> + <result column="create_date" property="deleteTime" /> + <result column="student_id" property="studentId" /> + <result column="star_id" property="starId" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + create_date, + update_date, + create_date, + id, student_id, star_id + </sql> + +</mapper> diff --git a/src/main/resources/mapper/SubjectTestDictMapper.xml b/src/main/resources/mapper/SubjectTestDictMapper.xml new file mode 100644 index 0000000..f475404 --- /dev/null +++ b/src/main/resources/mapper/SubjectTestDictMapper.xml @@ -0,0 +1,67 @@ +<?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.meishu.mapper.SubjectTestDictMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.meishu.model.SubjectTestDictDO"> + <id column="id" property="id" /> + <result column="create_date" property="createTime" /> + <result column="update_date" property="updateTime" /> + <result column="create_date" property="deleteTime" /> + <result column="test_name" property="testName" /> +<!-- <result column="out_line" property="outline" />--> +<!-- <result column="test_time" property="testTime" />--> + </resultMap> + + <sql id="Base_Column_List"> + create_date, + update_date, + create_date, + id, test_name, out_line, test_time + </sql> + + + <!-- 通用查询结果列 --> + <select id="getAllTest" parameterType="com.meishu.dto.test.GetAllTestDTO" resultType="com.meishu.vo.test.GetAllTestVO"> + SELECT + t.id, + t.test_name, + t.examination, + t2.id as rule_id, + t2.rule_name, + t2.status + FROM + subject_test_dict t + LEFT JOIN subject_rule t2 ON t.rule_id = t2.id + WHERE + t.delete_date IS NULL + AND t2.delete_date IS NULL + <if test="ruleId!=null and ruleId !=''"> + AND t2.id = #{ruleId} + </if> + <if test="testName!=null and testName !=''"> + AND t.test_name LIKE concat('%',#{testName} ,'%') + </if> + </select> + + <select id="getTest" parameterType="com.meishu.dto.test.GetAllTestDTO" resultType="com.meishu.vo.test.GetAllTestVO"> + SELECT + t.id, + t.test_name, + t.examination, + t2.id as rule_id, + t2.rule_name + FROM + subject_test_dict t + LEFT JOIN subject_rule t2 ON t.rule_id = t2.id + WHERE + t.delete_date IS NULL + AND t2.delete_date IS NULL + <if test="ruleId!=null and ruleId !=''"> + AND t2.id = #{ruleId} + </if> + <if test="testName!=null and testName !=''"> + AND t.test_name LIKE concat('%',#{testName} ,'%') + </if> + </select> +</mapper> diff --git a/src/main/resources/mapper/SubjectTestGradeExampleMappingMapper.xml b/src/main/resources/mapper/SubjectTestGradeExampleMappingMapper.xml new file mode 100644 index 0000000..aa30b79 --- /dev/null +++ b/src/main/resources/mapper/SubjectTestGradeExampleMappingMapper.xml @@ -0,0 +1,23 @@ +<?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.meishu.mapper.SubjectTestGradeExampleMappingMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.meishu.model.SubjectTestGradeExampleMappingDO"> + <id column="id" property="id" /> + <result column="create_date" property="createTime" /> + <result column="update_date" property="updateTime" /> + <result column="delete_date" property="deleteTime" /> + <result column="grade_id" property="gradeId" /> + <result column="example_view" property="exampleView" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + create_date, + update_date, + delete_date, + id, grade_id, example_view + </sql> + +</mapper> diff --git a/src/main/resources/mapper/SubjectTestGradeStarMappingMapper.xml b/src/main/resources/mapper/SubjectTestGradeStarMappingMapper.xml new file mode 100644 index 0000000..4e23b0b --- /dev/null +++ b/src/main/resources/mapper/SubjectTestGradeStarMappingMapper.xml @@ -0,0 +1,54 @@ +<?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.meishu.mapper.SubjectTestGradeStarMappingMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.meishu.model.SubjectTestGradeStarMappingDO"> + <id column="id" property="id" /> + <result column="create_date" property="createTime" /> + <result column="update_date" property="updateTime" /> + <result column="delete_date" property="deleteTime" /> + <result column="grade_id" property="gradeId" /> + <result column="star_id" property="starId" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + create_date, + update_date, + delete_date, + id, grade_id, star_id + </sql> + + <select id="getGradeStar" parameterType="long" resultType="com.meishu.vo.grade.DimensionStarVO"> + SELECT + t2.dimension_id, + t3.dimension, + t.star_id, + t2.star, + t2.description + FROM + subject_test_grade_star_mapping t + LEFT JOIN subject_dimension_star_dict t2 ON t.star_id = t2.id + LEFT JOIN subject_dimension_dict t3 ON t2.dimension_id = t3.id + WHERE + t.delete_date IS NULL + AND t2.delete_date IS NULL + AND t3.delete_date IS NULL + AND t.grade_id = #{gradeId} + </select> + + <select id="getRuleIdByPublishId" parameterType="long" resultType="com.meishu.model.SubjectRuleDO"> + SELECT + t4.id + FROM + subject_test_publish_history t2 + LEFT JOIN subject_test_dict t3 ON t2.test_id = t3.id + LEFT JOIN subject_rule t4 ON t3.rule_id = t4.id + WHERE + t2.delete_date IS NULL + AND t3.delete_date IS NULL + AND t4.delete_date IS NULL + AND t2.id = #{id} + </select> +</mapper> diff --git a/src/main/resources/mapper/SubjectTestPublishGradeMapper.xml b/src/main/resources/mapper/SubjectTestPublishGradeMapper.xml new file mode 100644 index 0000000..2ef7e9f --- /dev/null +++ b/src/main/resources/mapper/SubjectTestPublishGradeMapper.xml @@ -0,0 +1,22 @@ +<?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.meishu.mapper.SubjectTestPublishGradeMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.meishu.model.SubjectTestPublishGradeDO"> + <id column="id" property="id" /> + <result column="create_date" property="createTime" /> + <result column="update_date" property="updateTime" /> + <result column="delete_date" property="deleteTime" /> + <result column="grade_name" property="gradeName" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + create_date, + update_date, + delete_date, + id, grade_name + </sql> + +</mapper> diff --git a/src/main/resources/mapper/SubjectTestPublishHistoryMapper.xml b/src/main/resources/mapper/SubjectTestPublishHistoryMapper.xml new file mode 100644 index 0000000..a059ee8 --- /dev/null +++ b/src/main/resources/mapper/SubjectTestPublishHistoryMapper.xml @@ -0,0 +1,199 @@ +<?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.meishu.mapper.SubjectTestPublishHistoryMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.meishu.model.SubjectTestPublishHistoryDO"> + <id column="id" property="id"/> + <result column="create_date" property="createTime"/> + <result column="update_date" property="updateTime"/> + <result column="delete_date" property="deleteTime"/> + <!-- <result column="rule_id" property="ruleId" />--> + <!-- <result column="deadline" property="deadline" />--> + <!-- <result column="outline" property="outline" />--> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + create_date, + update_date, + delete_date, + id, rule_id, deadline, outline + </sql> + + + <select id="getStudentExamination" + resultType="com.meishu.vo.rule.GetStudentRulesVO"> + SELECT + t.id, + t2.rule_name, + t.outline, + t5.create_date, + t.test_time, + t4.examination, + t3.subject_name, + t.cover_page, + t.test_type, + t.publish_name + FROM + subject_test_student_answer t5 + LEFT JOIN subject_test_publish_history t ON t5.publish_id = t.id + LEFT JOIN subject_test_dict t4 ON t.test_id = t4.id + LEFT JOIN subject_rule t2 ON t4.rule_id = t2.id + LEFT JOIN knowledge_subject_dict t3 ON t2.subject_id = t3.id + left join student t6 on t5.student_id = t6.id + WHERE + t5.student_id = #{id} + <if test="subjectId!=null and subjectId!=''"> + and t2.subject_id = #{subjectId} + </if> + and t6.status = 1 + AND t.delete_date IS NULL + AND t4.delete_date IS NULL + AND t5.delete_date IS NULL + </select> + + <select id="getOneExaminationDetail" parameterType="com.meishu.model.SubjectTestStudentAnswerDO" + resultType="com.meishu.vo.rule.GetOneExaminationDetailVO"> + SELECT + t2.id, + t4.subject_name, + t3.rule_name, + t5.examination, + t2.answer, + t1.test_time , + t1.publish_name, + t1.test_type, + t2.create_date as commitTime + FROM + subject_test_publish_history t1 + LEFT JOIN subject_test_student_answer t2 ON t1.id = t2.publish_id + left join subject_test_dict t5 on t1.test_id = t5.id + LEFT JOIN subject_rule t3 ON t5.rule_id = t3.id + LEFT JOIN knowledge_subject_dict t4 ON t3.subject_id = t4.id + WHERE + t2.student_id = #{studentId} and t1.id = #{publishId} + AND t1.delete_date IS NULL + AND t2.delete_date IS NULL + AND t3.delete_date IS NULL + AND t4.delete_date IS NULL + and t5.delete_date is null + </select> + + <select id="studentStar" parameterType="com.meishu.model.SubjectTestStudentAnswerDO" + resultType="com.meishu.vo.rule.StudentStarVO"> + SELECT + t3.dimension, + t2.star, + t2.description, + t4.user_name + FROM + subject_student_answer_star t + LEFT JOIN subject_dimension_star_dict t2 ON t.star_id = t2.id + LEFT JOIN subject_dimension_dict t3 ON t2.dimension_id = t3.id + LEFT JOIN administer t4 ON t.administer_id = t4.id + WHERE + t.publish_id = #{publishId} + AND t.delete_date IS NULL + AND t2.delete_date IS NULL + AND t3.delete_date IS NULL + AND t4.delete_date IS NULL + </select> + + <select id="getTestReport" resultType="com.meishu.vo.test.GetTestReportVO"> + SELECT + t.id, + t.publish_name, + t3.rule_name, + t2.test_name, + t.test_time, + t4.to_cnt, + t5.done_cnt + FROM + subject_test_publish_history t + LEFT JOIN subject_test_dict t2 ON t.test_id = t2.id + LEFT JOIN subject_rule t3 ON t2.rule_id = t3.id + LEFT JOIN ( SELECT t.publish_id, count( 1 ) AS to_cnt FROM subject_test_student_answer t WHERE t.`commit_status` = 1 GROUP BY t.publish_id ) t4 ON t.id = t4.publish_id + LEFT JOIN ( SELECT t.publish_id, count( 1 ) AS done_cnt FROM subject_test_student_answer t WHERE t.`commit_status` = 0 GROUP BY t.publish_id ) t5 ON t.id = t5.publish_id + WHERE + t.delete_date IS NULL + AND t2.delete_date IS NULL + AND t3.delete_date IS NULL + <if test="ruleId !=null and ruleId != ''"> + AND t3.id = #{ruleId} + </if> + <if test="publishName!=null and publishName!=''"> + and t.publish_name = #{publishName} + </if> + </select> + + <select id="getPublishHistory" resultType="com.meishu.vo.test.GetPublishHistoryVO"> + SELECT + t.id, + t2.id as testId, + t.publish_name, + t3.rule_name, + t.test_time, + t2.test_name, + t2.examination, + t.outline, + t.cover_page + FROM + subject_test_publish_history t + LEFT JOIN subject_test_dict t2 ON t.test_id = t2.id + LEFT JOIN subject_rule t3 ON t2.rule_id = t3.id + WHERE + t.delete_date IS NULL + <if test="ruleId != null and ruleId !=''"> + and t3.id = #{ruleId} + </if> + <if test="publishName!=null and publishName !=''"> + and t.publish_name = #{publishName} + </if> + </select> + + <select id="getOnePublish" resultType="com.meishu.vo.test.GetOnePublishVO"> + SELECT + t.id, + t.student_id, + t.publish_id, + t2.username, + t.answer, + t.comment_status + FROM + subject_test_student_answer t + LEFT JOIN student t2 ON t.student_id = t2.id + LEFT JOIN campus_dict t3 ON t2.campus_id = t3.id + WHERE + t.delete_date IS NULL + AND t2.delete_date IS NULL + <if test="id !=null and id !=''"> + AND t.publish_id = #{id} + </if> + <if test="commentStatus!=null and commentStatus!=''"> + AND t.comment_status = #{commentStatus} + </if> + <if test="userName!=null and userName!=''"> + and t2.user_name = #{userName} + </if> + </select> + + <select id="getCommentDetail" parameterType="com.meishu.vo.test.GetOnePublishVO" resultType="com.meishu.vo.test.CommentVO"> + SELECT + t2.user_name, + t3.dimension, + t4.star + FROM + subject_student_answer_star t + LEFT JOIN administer t2 ON t.administer_id = t2.id + LEFT JOIN subject_dimension_dict t3 ON t.administer_id = t3.id + LEFT JOIN subject_dimension_star_dict t4 ON t.star_id = t4.id + WHERE + t.delete_date IS NULL + AND t2.delete_date IS NULL + AND t3.delete_date IS NULL + AND t4.delete_date IS NULL + and t.publish_id = #{publishId} + and t.student_id = #{studentId} + </select> +</mapper> diff --git a/src/main/resources/mapper/SubjectTestStudentAnswerMapper.xml b/src/main/resources/mapper/SubjectTestStudentAnswerMapper.xml new file mode 100644 index 0000000..005f2c4 --- /dev/null +++ b/src/main/resources/mapper/SubjectTestStudentAnswerMapper.xml @@ -0,0 +1,41 @@ +<?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.meishu.mapper.SubjectTestStudentAnswerMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.meishu.model.SubjectTestStudentAnswerDO"> + <id column="id" property="id" /> + <result column="create_date" property="createTime" /> + <result column="update_date" property="updateTime" /> + <result column="delete_date" property="deleteTime" /> + <result column="student_id" property="studentId" /> + <result column="publish_id" property="publishId" /> + <result column="answer" property="answer" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + create_date, + update_date, + delete_date, + id, student_id, publish_id, answer + </sql> + + <select id="getPublishStudents" parameterType="long" resultType="com.meishu.vo.student.StudentVO"> + SELECT + t2.id, + t2.username, + t2.telephone, + t2.campus_id, + t3.campus + FROM + subject_test_student_answer t + LEFT JOIN student t2 ON t.student_id = t2.id + LEFT JOIN campus_dict t3 ON t2.campus_id = t3.id + where t.delete_date is null + and t2.delete_date is null + and t3.delete_date is null + and t.publish_id = #{publishId} + </select> + +</mapper> diff --git a/src/main/resources/mapper/SubjectTreeMapper.xml b/src/main/resources/mapper/SubjectTreeMapper.xml new file mode 100644 index 0000000..f790874 --- /dev/null +++ b/src/main/resources/mapper/SubjectTreeMapper.xml @@ -0,0 +1,42 @@ +<?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.meishu.mapper.SubjectTreeMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.meishu.model.SubjectTreeDO"> + <id column="id" property="id" /> + <result column="create_date" property="createTime" /> + <result column="update_date" property="updateTime" /> + <result column="delete_date" property="deleteTime" /> + <result column="subject_id" property="subjectId" /> + <result column="chapter_id" property="chapterId" /> + <result column="tree_name" property="treeName" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + create_date, + update_date, + delete_date, + id, subject_id, chapter, tree_name, children + </sql> + + <update id="updateSubjectTree" parameterType="com.meishu.model.SubjectTreeDO"> + UPDATE knowledge_tree + SET + <trim suffixOverrides=","> + parent_id = #{parentId}, + update_date = now(), + <if test="treeName !=null and treeName !=''"> + node_name = #{treeName}, + </if> + <if test="treeOrder!=null"> + chapter_order = #{treeOrder}, + </if> + + </trim> + where id = #{id} + </update> + + +</mapper> diff --git a/src/main/resources/mapper/TaskCompletionStatusMapper.xml b/src/main/resources/mapper/TaskCompletionStatusMapper.xml new file mode 100644 index 0000000..de4043c --- /dev/null +++ b/src/main/resources/mapper/TaskCompletionStatusMapper.xml @@ -0,0 +1,24 @@ +<?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.meishu.mapper.TaskCompletionStatusMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.meishu.model.TaskCompletionStatusDO"> + <id column="id" property="id" /> + <result column="create_date" property="createDate" /> + <result column="update_date" property="updateDate" /> + <result column="user_id" property="userId" /> + <result column="exe_type" property="exeType" /> + <result column="subject_task_id" property="subjectTaskId" /> + <result column="tree_id" property="treeId" /> + <result column="status" property="status" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + create_date, + update_date, + id, user_id, exe_type, subject_task_id, tree_id, status + </sql> + +</mapper> diff --git a/src/main/resources/mapper/TaskContentDoneInfoMapper.xml b/src/main/resources/mapper/TaskContentDoneInfoMapper.xml new file mode 100644 index 0000000..7551f51 --- /dev/null +++ b/src/main/resources/mapper/TaskContentDoneInfoMapper.xml @@ -0,0 +1,23 @@ +<?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.meishu.mapper.TaskContentDoneInfoMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.meishu.model.TaskContentDoneInfoDO"> + <id column="id" property="id" /> + <result column="create_date" property="createDate" /> + <result column="update_date" property="updateDate" /> + <result column="task_id" property="taskId" /> + <result column="content_type" property="contentType" /> + <result column="content_id" property="contentId" /> + <result column="user_id" property="userId" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + create_date, + update_date, + id, task_id, content_type, content_id, user_id + </sql> + +</mapper> diff --git a/src/main/resources/mapper/TaskContentMapper.xml b/src/main/resources/mapper/TaskContentMapper.xml new file mode 100644 index 0000000..5f5e2e9 --- /dev/null +++ b/src/main/resources/mapper/TaskContentMapper.xml @@ -0,0 +1,22 @@ +<?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.meishu.mapper.TaskContentMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.meishu.model.TaskContentDO"> + <id column="id" property="id" /> + <result column="create_date" property="createDate" /> + <result column="update_date" property="updateDate" /> + <result column="task_id" property="taskId" /> + <result column="content_type" property="contentType" /> + <result column="content_id" property="contentId" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + create_date, + update_date, + id, task_id, content_type, content_id + </sql> + +</mapper> diff --git a/src/main/resources/mapper/TaskDoneHistoryMapper.xml b/src/main/resources/mapper/TaskDoneHistoryMapper.xml new file mode 100644 index 0000000..b95dd7e --- /dev/null +++ b/src/main/resources/mapper/TaskDoneHistoryMapper.xml @@ -0,0 +1,21 @@ +<?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.meishu.mapper.TaskDoneHistoryMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.meishu.model.TaskDoneHistoryDO"> + <id column="id" property="id" /> + <result column="create_date" property="createDate" /> + <result column="update_date" property="updateDate" /> + <result column="task_id" property="taskId" /> + <result column="user_id" property="userId" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + create_date, + update_date, + id, task_id, user_id + </sql> + +</mapper> diff --git a/src/main/resources/mapper/UserRoleCopy1Mapper.xml b/src/main/resources/mapper/UserRoleCopy1Mapper.xml new file mode 100644 index 0000000..6882ae7 --- /dev/null +++ b/src/main/resources/mapper/UserRoleCopy1Mapper.xml @@ -0,0 +1,25 @@ +<?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.meishu.mapper.UserRoleCopy1Mapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.meishu.model.UserRoleCopy1DO"> + <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="user_name" property="userName" /> + <result column="gender" property="gender" /> + <result column="session" property="session" /> + <result column="study_code" property="studyCode" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + create_date, + update_date, + delete_date, + id, user_name, gender, session, study_code + </sql> + +</mapper> diff --git a/src/main/resources/mapper/UserRoleMapper.xml b/src/main/resources/mapper/UserRoleMapper.xml new file mode 100644 index 0000000..d3e99c4 --- /dev/null +++ b/src/main/resources/mapper/UserRoleMapper.xml @@ -0,0 +1,113 @@ +<?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.meishu.mapper.UserRoleMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.meishu.model.UserRoleDO"> + <id column="id" property="id" /> + <result column="create_date" property="createDate" /> + <result column="update_date" property="updateDate" /> + <result column="user_id" property="userId" /> + <result column="user_name" property="userName" /> + <result column="gender" property="gender" /> + <result column="birthday" property="birthday" /> + <result column="email" property="email" /> + <result column="img_url" property="imgUrl" /> + <result column="user_status" property="userStatus" /> + <result column="register_method" property="registerMethod" /> + <result column="role_type" property="roleType" /> + <result column="session" property="session" /> + <result column="classes_id" property="classesId" /> + <result column="phone" property="phone" /> + <result column="password" property="password" /> + <result column="id_card" property="idCard" /> + <result column="open_id" property="openId" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + create_date, + update_date, + id, user_id, user_name, gender, birthday, email, img_url, user_status, register_method, role_type, session, classes_id, phone, password, id_card, open_id + </sql> + + <select id="queryStudents" resultType="com.meishu.vo.userrole.QueryStudentsVO"> + SELECT + t.id, + t.user_name, + t.study_code, + t.phone, + t.id_card, + t3.grade, + t.`session`, + t.gender, + t.email, + t3.class_name, + t.user_status + FROM + user_role t + LEFT JOIN classes_user_mapping t2 ON t.id = t2.user_id + LEFT JOIN classes_dict t3 ON t2.classes_id = t3.id + WHERE + 1=1 and t.delete_date is null and t2.delete_date is null + <if test="userName != null and userName !=''"> + and t.user_name like concat('%',#{userName} ,'%') + </if> + <if test="grade != null and userName !=''"> + and t3.grade = #{grade} + </if> + <if test="session != null and session != ''"> + and t.session = #{session} + </if> + <if test="userStatus != null and userStatus !=''"> + and t.user_status = #{userStatus} + </if> + </select> + + <select id="exportStudents" resultType="com.meishu.vo.userrole.QueryStudentsVO"> + SELECT + t.user_name, + t.study_code, + t.phone, + t.id_card, + t3.grade, + t.`session`, + t.gender, + t.email, + t3.class_name, + t.user_status + FROM + user_role t + LEFT JOIN classes_user_mapping t2 ON t.id = t2.user_id + LEFT JOIN classes_dict t3 ON t2.classes_id = t3.id + WHERE + t2.`status` = 1 + <if test="userName != null and userName !=''"> + and t.user_name like concat('%',#{userName} ,'%') + </if> + <if test="grade != null and userName !=''"> + and t3.grade = #{grade} + </if> + <if test="session != null and session != ''"> + and t.session = #{session} + </if> + <if test="userStatus != null and userStatus !=''"> + and t.user_status = #{userStatus} + </if> + </select> + + + <select id="findOpenIdByClassId" parameterType="integer" resultType="com.meishu.model.UserRoleDO"> + SELECT + t2.user_name, + t2.open_id + FROM + classes_user_mapping t + LEFT JOIN user_role t2 ON t.user_id = t2.id + WHERE + t.classes_id = #{id} + and open_id is not NULL + </select> + + +</mapper> diff --git a/src/main/resources/mapper/UserSubjectMappingMapper.xml b/src/main/resources/mapper/UserSubjectMappingMapper.xml new file mode 100644 index 0000000..d0619c6 --- /dev/null +++ b/src/main/resources/mapper/UserSubjectMappingMapper.xml @@ -0,0 +1,35 @@ +<?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.meishu.mapper.UserSubjectMappingMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.meishu.model.UserSubjectMappingDO"> + <id column="id" property="id" /> + <result column="create_date" property="createDate" /> + <result column="update_date" property="updateDate" /> + <result column="user_id" property="userId" /> + <result column="class_type" property="classType" /> + <result column="subject_id" property="subjectId" /> + <result column="subject_name" property="subjectName" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + create_date, + update_date, + id, user_id, class_type, subject_id, subject_name + </sql> + + <select id="querySubjectTeachers" parameterType="integer" resultType="com.meishu.model.AdministerDO"> + SELECT + t2.* + FROM + user_subject_mapping t + LEFT JOIN administer t2 ON t.user_id = t2.id + WHERE + t.delete_date is null + and t2.delete_date IS NULL + AND t.subject_id = #{subjectId} + </select> + +</mapper> diff --git a/src/main/resources/mapper/UserSubjectPermissionDictMapper.xml b/src/main/resources/mapper/UserSubjectPermissionDictMapper.xml new file mode 100644 index 0000000..056aca7 --- /dev/null +++ b/src/main/resources/mapper/UserSubjectPermissionDictMapper.xml @@ -0,0 +1,33 @@ +<?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.meishu.mapper.UserSubjectPermissionDictMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.meishu.model.UserSubjectPermissionDictDO"> + <id column="id" property="id" /> + <result column="create_date" property="createDate" /> + <result column="update_date" property="updateDate" /> + <result column="user_id" property="userId" /> + <result column="subject_id" property="subjectId" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + create_date, + update_date, + id, user_id, subject_id + </sql> + + <select id="getSubjects" parameterType="integer" resultType="com.meishu.model.SubjectDictDO"> + SELECT + t2.* + FROM + user_subject_permission_dict t + LEFT JOIN subject_dict t2 ON t.subject_id = t2.id + WHERE + t.delete_date IS NULL + AND t2.delete_date IS NULL + AND t.user_id = #{userId} + </select> + +</mapper> diff --git a/src/main/resources/mapper/UuidHistoryMapper.xml b/src/main/resources/mapper/UuidHistoryMapper.xml new file mode 100644 index 0000000..e291711 --- /dev/null +++ b/src/main/resources/mapper/UuidHistoryMapper.xml @@ -0,0 +1,22 @@ +<?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.meishu.mapper.UuidHistoryMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.meishu.model.UuidHistoryDO"> + <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="uuid" property="uuid" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + create_date, + update_date, + delete_date, + id, uuid + </sql> + +</mapper> diff --git a/src/main/resources/mapper/VodDictMapper.xml b/src/main/resources/mapper/VodDictMapper.xml new file mode 100644 index 0000000..a7efd42 --- /dev/null +++ b/src/main/resources/mapper/VodDictMapper.xml @@ -0,0 +1,44 @@ +<?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.VodDictMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.subsidy.model.VodDictDO"> + <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="content_id" property="contentId" /> + <result column="vod_name" property="vodName" /> + <result column="vod_length" property="vodLength" /> + <result column="vod_type" property="vodType" /> + <result column="vod_size" property="vodSize" /> + <result column="vod_url" property="vodUrl" /> + <result column="vod_code" property="vodCode" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + create_date, + update_date, + delete_date, + id, content_id, vod_name, vod_length, vod_type, vod_size, vod_url, vod_code + </sql> + + <select id="getContendVods" resultType="com.subsidy.vo.vod.GetContendVodsVO"> + SELECT + t.*, + t2.content + FROM + vod_dict t + LEFT JOIN course_content t2 ON t.content_id = t2.id + WHERE + t.delete_date IS NULL + AND t2.delete_date IS NULL + AND t.content_id = #{contentId} + <if test="vodName != null and vodName !=''"> + and vod_name like concat('%',#{vodName} ,'%') + </if> + </select> + +</mapper> diff --git a/src/main/resources/mapper/VodPlayHistoryMapper.xml b/src/main/resources/mapper/VodPlayHistoryMapper.xml new file mode 100644 index 0000000..5b71efc --- /dev/null +++ b/src/main/resources/mapper/VodPlayHistoryMapper.xml @@ -0,0 +1,60 @@ +<?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.VodPlayHistoryMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.subsidy.model.VodPlayHistoryDO"> + <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="class_id" property="classId" /> + <result column="vod_id" property="vodId" /> + <result column="member_id" property="memberId" /> + <result column="play_length" property="playLength" /> + <result column="play_record" property="playRecord" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + create_date, + update_date, + delete_date, + id, class_id, vod_id, member_id, play_length, play_record + </sql> + + <select id="studyHistory" parameterType="long" resultType="com.subsidy.vo.vod.StudyHistoryVO"> + SELECT + t2.id, + t2.vod_length, + t2.teacher_name, + t2.vod_url, + t2.vod_name, + t3.play_record, + round( t3.play_record * 100 / t2.vod_length, 0 ) AS percent, + t.playDate + FROM + ( + SELECT + t.vod_id, + t.member_id, + max( t.create_date ) AS playDate + FROM + vod_play_history t + WHERE + t.delete_date IS NULL + AND t.member_id = #{memberId} + GROUP BY + t.vod_id, + t.member_id + ) t + LEFT JOIN vod_play_history t3 ON t.playDate = t3.create_date + AND t.vod_id = t3.vod_id + AND t.member_id = t3.member_id + LEFT JOIN vod_dict t2 ON t.vod_id = t2.id + WHERE + t2.delete_date IS NULL + order by t.playDate desc + </select> + +</mapper> diff --git a/src/main/resources/mapper/VodSubjectTreeMappingMapper.xml b/src/main/resources/mapper/VodSubjectTreeMappingMapper.xml new file mode 100644 index 0000000..e234c64 --- /dev/null +++ b/src/main/resources/mapper/VodSubjectTreeMappingMapper.xml @@ -0,0 +1,73 @@ +<?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.meishu.mapper.VodSubjectTreeMappingMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.meishu.model.VodSubjectTreeMappingDO"> + <id column="id" property="id" /> + <result column="create_date" property="createTime" /> + <result column="update_date" property="updateTime" /> + <result column="delete_date" property="deleteTime" /> + <result column="vod_id" property="vodId" /> + <result column="tree_id" property="treeId" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + create_date, + update_date, + delete_date, + id, vod_id, tree_id + </sql> + + <select id="getAllNoAuthenVods" resultType="com.meishu.vo.subject.GetAllNoAuthenVodsVO"> + SELECT + t2.id, + t2.vod_name, + t2.vod_type, + t3.user_name, + t2.update_date + FROM + vod_subject_tree_mapping t + LEFT JOIN vod_dict t2 ON t.vod_id = t2.id + LEFT JOIN administer t3 ON t2.administer_id = t3.id + WHERE + t.delete_date IS NULL + AND t2.delete_date IS NULL + AND t.tree_id = #{treeId} + <if test="vodType!=null amd vodType =''"> + AND t2.vod_type = #{vodType} + </if> + AND t2.STATUS = #{status} + </select> + + <select id="getTreeVodCount" resultType="integer"> + SELECT + count(1) + FROM + vod_related t + LEFT JOIN vod_dict t2 ON t.vod_id = t2.id + WHERE + t.delete_date IS NULL + AND t2.delete_date IS NULL + <if test="treeId !=null and treeId !=''"> + AND t.tree_id = #{treeId} + </if> + <if test="userId !=null and userId !=''"> + AND t2.teacher_id = #{userId} + </if> + <if test="shareStatus !=null and shareStatus !=''"> + AND t2.share_status = #{shareStatus} + </if> + <if test="subject!=null and subject !=''"> + AND t2.subject = #{subject} + </if> + <if test="checkStatus==2"> + AND t2.check_status = 2 + </if> + <if test="checkStatus==1"> + AND (t2.check_status = 1 or t2.check_status = 3 ) + </if> + </select> + +</mapper> diff --git a/src/main/resources/mapper/WrittenHomeworkMapper.xml b/src/main/resources/mapper/WrittenHomeworkMapper.xml new file mode 100644 index 0000000..2670207 --- /dev/null +++ b/src/main/resources/mapper/WrittenHomeworkMapper.xml @@ -0,0 +1,25 @@ +<?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.meishu.mapper.WrittenHomeworkMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.meishu.model.WrittenHomeworkDO"> + <id column="id" property="id" /> + <result column="create_date" property="createDate" /> + <result column="update_date" property="updateDate" /> + <result column="homework_type" property="homeworkType" /> + <result column="homework_content" property="homeworkContent" /> + <result column="advice_length" property="adviceLength" /> + <result column="file_size" property="fileSize" /> + <result column="file_type" property="fileType" /> + <result column="file_name" property="fileName" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + create_date, + update_date, + id, homework_type, homework_content, advice_length, file_size, file_type, file_name + </sql> + +</mapper> diff --git a/src/main/resources/mybatis-plus.properties b/src/main/resources/mybatis-plus.properties new file mode 100644 index 0000000..2e774c5 --- /dev/null +++ b/src/main/resources/mybatis-plus.properties @@ -0,0 +1,12 @@ +# 此处为本项目src所在路径(代码生成器输出路径) +outputDir=/src/main/java +author=DengMin +# 父的包名 +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 +driverName=com.mysql.cj.jdbc.Driver +userName=devloper +password=dev@1553$ \ No newline at end of file diff --git a/src/main/resources/mybatis.xml b/src/main/resources/mybatis.xml new file mode 100644 index 0000000..f4495b4 --- /dev/null +++ b/src/main/resources/mybatis.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-config.dtd"> +<configuration> + <settings> + <setting name="logImpl" value="SLF4J"/> + <!-- 开启驼峰命名转换 Table(create_date) -> Entity(createTime) --> + <setting name="mapUnderscoreToCamelCase" value="true" /> + </settings> +</configuration> diff --git a/src/main/resources/templates/controller.java.ftl b/src/main/resources/templates/controller.java.ftl new file mode 100644 index 0000000..28e7070 --- /dev/null +++ b/src/main/resources/templates/controller.java.ftl @@ -0,0 +1,41 @@ +package ${package.Controller}; + + +import org.springframework.web.bind.annotation.RequestMapping; + +<#if restControllerStyle> +import org.springframework.web.bind.annotation.RestController; +<#else> +import org.springframework.stereotype.Controller; +</#if> +<#if superControllerClassPackage??> +import ${superControllerClassPackage}; +</#if> +import io.swagger.annotations.Api; + +/** + * <p> + * ${table.comment!} 前端控制器 + * </p> + * + * @author ${author} + * @since ${date} + */ +<#if restControllerStyle> +@RestController +@Api(tags = "${table.comment!}") +<#else> +@Controller +</#if> +@RequestMapping("<#if package.ModuleName?? && package.ModuleName != "">/${package.ModuleName}</#if>/<#if controllerMappingHyphenStyle??>${controllerMappingHyphen}<#else>${table.entityPath}</#if>") +<#if kotlin> +class ${table.controllerName}<#if superControllerClass??> : ${superControllerClass}()</#if> +<#else> +<#if superControllerClass??> +public class ${table.controllerName} extends ${superControllerClass} { +<#else> +public class ${table.controllerName} { +</#if> + +} +</#if> diff --git a/src/main/resources/templates/entity.java.ftl b/src/main/resources/templates/entity.java.ftl new file mode 100644 index 0000000..c63bcc4 --- /dev/null +++ b/src/main/resources/templates/entity.java.ftl @@ -0,0 +1,156 @@ +package ${package.Entity}; + +<#list table.importPackages as pkg> +import ${pkg}; +</#list> +<#if swagger2> +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +</#if> +<#if entityLombokModel> +import lombok.Data; +import lombok.EqualsAndHashCode; + <#if chainModel> +import lombok.experimental.Accessors; + </#if> +</#if> + +/** + * <p> + * ${table.comment!} + * </p> + * + * @author ${author} + * @since ${date} + */ +<#if entityLombokModel> +@Data + <#if superEntityClass??> +@EqualsAndHashCode(callSuper = true) + <#else> +@EqualsAndHashCode(callSuper = false) + </#if> + <#if chainModel> +@Accessors(chain = true) + </#if> +</#if> +<#if table.convert> +@TableName("${table.name}") +</#if> +<#if swagger2> +@ApiModel(value="${entity}对象", description="${table.comment!}") +</#if> +<#if superEntityClass??> +public class ${entity} extends ${superEntityClass}<#if activeRecord><${entity}></#if> { +<#elseif activeRecord> +public class ${entity} extends Model<${entity}> { +<#else> +public class ${entity} implements Serializable { +</#if> + +<#if entitySerialVersionUID> + private static final long serialVersionUID = 1L; +</#if> +<#-- ---------- BEGIN 字段循环遍历 ----------> +<#list table.fields as field> + <#if field.keyFlag> + <#assign keyPropertyName="${field.propertyName}"/> + </#if> + + <#if field.comment!?length gt 0> + <#if swagger2> + @ApiModelProperty(value = "${field.comment}") + <#else> + /** + * ${field.comment} + */ + </#if> + </#if> + <#if field.keyFlag> + <#-- 主键 --> + <#if field.keyIdentityFlag> + @TableId(value = "${field.annotationColumnName}", type = IdType.AUTO) + <#elseif idType??> + @TableId(value = "${field.annotationColumnName}", type = IdType.${idType}) + <#elseif field.convert> + @TableId("${field.annotationColumnName}") + </#if> + <#-- 普通字段 --> + <#elseif field.fill??> + <#-- ----- 存在字段填充设置 -----> + <#if field.convert> + @TableField(value = "${field.annotationColumnName}", fill = FieldFill.${field.fill}) + <#else> + @TableField(fill = FieldFill.${field.fill}) + </#if> + <#elseif field.convert> + @TableField("${field.annotationColumnName}") + </#if> + <#-- 乐观锁注解 --> + <#if (versionFieldName!"") == field.name> + @Version + </#if> + <#-- 逻辑删除注解 --> + <#if (logicDeleteFieldName!"") == field.name> + @TableLogic + </#if> + private ${field.propertyType} ${field.propertyName}; +</#list> +<#------------ END 字段循环遍历 ----------> + +<#if !entityLombokModel> + <#list table.fields as field> + <#if field.propertyType == "boolean"> + <#assign getprefix="is"/> + <#else> + <#assign getprefix="get"/> + </#if> + public ${field.propertyType} ${getprefix}${field.capitalName}() { + return ${field.propertyName}; + } + + <#if chainModel> + public ${entity} set${field.capitalName}(${field.propertyType} ${field.propertyName}) { + <#else> + public void set${field.capitalName}(${field.propertyType} ${field.propertyName}) { + </#if> + this.${field.propertyName} = ${field.propertyName}; + <#if chainModel> + return this; + </#if> + } + </#list> +</#if> + +<#if entityColumnConstant> + <#list table.fields as field> + public static final String ${field.name?upper_case} = "${field.name}"; + + </#list> +</#if> +<#if activeRecord> + @Override + protected Serializable pkVal() { + <#if keyPropertyName??> + return this.${keyPropertyName}; + <#else> + return null; + </#if> + } + +</#if> +<#if !entityLombokModel> + @Override + public String toString() { + return "${entity}{" + + <#list table.fields as field> + <#if field_index==0> + "${field.propertyName}=" + ${field.propertyName} + + <#else> + ", ${field.propertyName}=" + ${field.propertyName} + + </#if> + </#list> + "}"; + } +</#if> +} diff --git a/src/main/resources/templates/mapper.java.ftl b/src/main/resources/templates/mapper.java.ftl new file mode 100644 index 0000000..be08c59 --- /dev/null +++ b/src/main/resources/templates/mapper.java.ftl @@ -0,0 +1,22 @@ +package ${package.Mapper}; + +import ${package.Entity}.${entity}; +import ${superMapperClassPackage}; +import org.springframework.stereotype.Repository; + +/** + * <p> + * ${table.comment!} Mapper 接口 + * </p> + * + * @author ${author} + * @since ${date} + */ +<#if kotlin> +interface ${table.mapperName} : ${superMapperClass}<${entity}> +<#else> + @Repository +public interface ${table.mapperName} extends ${superMapperClass}<${entity}> { + +} +</#if> diff --git a/src/main/resources/templates/mapper.xml.ftl b/src/main/resources/templates/mapper.xml.ftl new file mode 100644 index 0000000..04c2359 --- /dev/null +++ b/src/main/resources/templates/mapper.xml.ftl @@ -0,0 +1,39 @@ +<?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="${package.Mapper}.${table.mapperName}"> + +<#if enableCache> + <!-- 开启二级缓存 --> + <cache type="org.mybatis.caches.ehcache.LoggingEhcache"/> + +</#if> +<#if baseResultMap> + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="${package.Entity}.${entity}"> +<#list table.fields as field> +<#if field.keyFlag><#--生成主键排在第一位--> + <id column="${field.name}" property="${field.propertyName}" /> +</#if> +</#list> +<#list table.commonFields as field><#--生成公共字段 --> + <result column="${field.name}" property="${field.propertyName}" /> +</#list> +<#list table.fields as field> +<#if !field.keyFlag><#--生成普通字段 --> + <result column="${field.name}" property="${field.propertyName}" /> +</#if> +</#list> + </resultMap> + +</#if> +<#if baseColumnList> + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> +<#list table.commonFields as field> + ${field.columnName}, +</#list> + ${table.fieldNames} + </sql> + +</#if> +</mapper> diff --git a/src/main/resources/templates/service.java.ftl b/src/main/resources/templates/service.java.ftl new file mode 100644 index 0000000..e3232f3 --- /dev/null +++ b/src/main/resources/templates/service.java.ftl @@ -0,0 +1,20 @@ +package ${package.Service}; + +import ${package.Entity}.${entity}; +import ${superServiceClassPackage}; + +/** + * <p> + * ${table.comment!} 服务类 + * </p> + * + * @author ${author} + * @since ${date} + */ +<#if kotlin> +interface ${table.serviceName} : ${superServiceClass}<${entity}> +<#else> +public interface ${table.serviceName} extends ${superServiceClass}<${entity}> { + +} +</#if> diff --git a/src/main/resources/templates/serviceImpl.java.ftl b/src/main/resources/templates/serviceImpl.java.ftl new file mode 100644 index 0000000..aeebd14 --- /dev/null +++ b/src/main/resources/templates/serviceImpl.java.ftl @@ -0,0 +1,26 @@ +package ${package.ServiceImpl}; + +import ${package.Entity}.${entity}; +import ${package.Mapper}.${table.mapperName}; +import ${package.Service}.${table.serviceName}; +import ${superServiceImplClassPackage}; +import org.springframework.stereotype.Service; + +/** + * <p> + * ${table.comment!} 服务实现类 + * </p> + * + * @author ${author} + * @since ${date} + */ +@Service +<#if kotlin> +open class ${table.serviceImplName} : ${superServiceImplClass}<${table.mapperName}, ${entity}>(), ${table.serviceName} { + +} +<#else> +public class ${table.serviceImplName} extends ${superServiceImplClass}<${table.mapperName}, ${entity}> implements ${table.serviceName} { + +} +</#if> -- libgit2 0.25.0