From 9eff6177491cbf0b3fed1bf298fd633d73e1145f Mon Sep 17 00:00:00 2001 From: mzh820631607 Date: Thu, 26 Nov 2020 18:41:48 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=9F=E8=83=BD=E4=BF=AE=E5=A4=8D=E5=92=8C?= =?UTF-8?q?=E6=88=90=E7=BB=A9=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 6 + .../tms/api/AchievementManagementApi.java | 55 ++++ .../com/msdw/tms/api/ClassTeachingApi.java | 2 +- .../java/com/msdw/tms/api/CommentApi.java | 22 ++ .../ExperimentalTeachingControllerApi.java | 3 +- .../java/com/msdw/tms/api/SignatureApi.java | 24 ++ .../msdw/tms/api/UserInfoControllerApi.java | 14 +- .../tms/common/utils/ExcelImportHelper.java | 15 +- .../java/com/msdw/tms/config/PageResult.java | 54 ++++ ...odeQuartzConfig.java => QuartzConfig.java} | 25 +- .../tms/config/quartz/CheckCodeQuartz.java | 25 -- .../AchievementManagementController.java | 126 +++++++- .../controller/ClassTeachingController.java | 9 +- .../tms/controller/Commentcontroller.java | 50 ++++ .../ExperimentalTeachingController.java | 6 +- .../controller/ProjectRecordController.java | 13 - .../tms/controller/SignatureController.java | 69 +++++ .../msdw/tms/controller/UserController.java | 78 ++--- .../tms/controller/UserInfoController.java | 29 +- .../tms/dao/AchievementManagementDao.java | 45 ++- .../java/com/msdw/tms/dao/CommentDao.java | 9 + .../msdw/tms/dao/ExperimentalReportDao.java | 3 + .../msdw/tms/dao/ExperimentalTeachingDao.java | 5 +- .../com/msdw/tms/dao/ProjectRecordDao.java | 7 + .../java/com/msdw/tms/dao/SignatureDao.java | 10 + src/main/java/com/msdw/tms/dao/UserDao.java | 2 - .../java/com/msdw/tms/dao/UserInfoDao.java | 18 +- .../entity/AchievementManagementEntity.java | 14 - .../com/msdw/tms/entity/CommentEntity.java | 22 ++ .../tms/entity/ExperimentalReportEntity.java | 12 +- .../msdw/tms/entity/ProjectRecordEntity.java | 6 + .../com/msdw/tms/entity/SignatureEntity.java | 22 ++ .../request/AchievementImportRequest.java | 38 +++ .../entity/vo/AchievementManagementVo.java | 86 ++++++ .../com/msdw/tms/entity/vo/AchievementVo.java | 26 ++ .../java/com/msdw/tms/entity/vo/CheckVo.java | 2 +- .../msdw/tms/entity/vo/EvaluationDataVo.java | 14 + .../tms/entity/vo/ExperimentalTeachingVO.java | 21 ++ .../msdw/tms/entity/vo/ProjectRecordVo.java | 2 +- .../java/com/msdw/tms/entity/vo/RecordVo.java | 74 +++++ .../tms/entity/vo/SearchAchievementVo.java | 18 ++ .../service/AchievementManagementService.java | 29 +- .../com/msdw/tms/service/CommentService.java | 7 + .../service/ExperimentalTeachingService.java | 3 +- .../tms/service/ProjectRecordService.java | 2 + .../msdw/tms/service/SignatureService.java | 18 ++ .../com/msdw/tms/service/UserInfoService.java | 9 +- .../com/msdw/tms/service/UserService.java | 17 +- .../AchievementManagementServiceImpl.java | 199 ++++++++++++- .../tms/service/impl/CommentServiceImpl.java | 11 + .../impl/ExperimentalReportServiceImpl.java | 31 +- .../impl/ExperimentalTeachingServiceImpl.java | 22 +- .../impl/ProjectRecordServiceImpl.java | 16 +- .../service/impl/SignatureServiceImpl.java | 74 +++++ .../tms/service/impl/UserInfoServiceImpl.java | 108 ++++--- .../tms/service/impl/UserServiceImpl.java | 82 ++++-- ...成绩管理实验记录导出模板.xlsx | Bin 0 -> 8865 bytes .../mapper/tms/AchievementManagementDao.xml | 273 ++++++++++++++++++ .../mapper/tms/ExperimentalReportDao.xml | 14 +- .../mapper/tms/ExperimentalTeachingDao.xml | 10 +- .../resources/mapper/tms/ProjectRecordDao.xml | 17 ++ .../resources/mapper/tms/SignatureDao.xml | 20 ++ src/main/resources/mapper/tms/UserDao.xml | 27 +- src/main/resources/mapper/tms/UserInfoDao.xml | 18 +- .../service/AchievementManagementTest.java | 145 ++++++++++ 65 files changed, 1912 insertions(+), 321 deletions(-) create mode 100644 src/main/java/com/msdw/tms/api/AchievementManagementApi.java create mode 100644 src/main/java/com/msdw/tms/api/CommentApi.java create mode 100644 src/main/java/com/msdw/tms/api/SignatureApi.java create mode 100644 src/main/java/com/msdw/tms/config/PageResult.java rename src/main/java/com/msdw/tms/config/{CheckCodeQuartzConfig.java => QuartzConfig.java} (59%) delete mode 100644 src/main/java/com/msdw/tms/config/quartz/CheckCodeQuartz.java create mode 100644 src/main/java/com/msdw/tms/controller/Commentcontroller.java create mode 100644 src/main/java/com/msdw/tms/controller/SignatureController.java create mode 100644 src/main/java/com/msdw/tms/dao/CommentDao.java create mode 100644 src/main/java/com/msdw/tms/dao/SignatureDao.java delete mode 100644 src/main/java/com/msdw/tms/entity/AchievementManagementEntity.java create mode 100644 src/main/java/com/msdw/tms/entity/CommentEntity.java create mode 100644 src/main/java/com/msdw/tms/entity/SignatureEntity.java create mode 100644 src/main/java/com/msdw/tms/entity/request/AchievementImportRequest.java create mode 100644 src/main/java/com/msdw/tms/entity/vo/AchievementManagementVo.java create mode 100644 src/main/java/com/msdw/tms/entity/vo/AchievementVo.java create mode 100644 src/main/java/com/msdw/tms/entity/vo/EvaluationDataVo.java create mode 100644 src/main/java/com/msdw/tms/entity/vo/ExperimentalTeachingVO.java create mode 100644 src/main/java/com/msdw/tms/entity/vo/RecordVo.java create mode 100644 src/main/java/com/msdw/tms/entity/vo/SearchAchievementVo.java create mode 100644 src/main/java/com/msdw/tms/service/CommentService.java create mode 100644 src/main/java/com/msdw/tms/service/SignatureService.java create mode 100644 src/main/java/com/msdw/tms/service/impl/CommentServiceImpl.java create mode 100644 src/main/java/com/msdw/tms/service/impl/SignatureServiceImpl.java create mode 100644 src/main/resources/excel-template/川大成绩管理实验记录导出模板.xlsx create mode 100644 src/main/resources/mapper/tms/SignatureDao.xml create mode 100644 src/test/java/com/msdw/tms/service/AchievementManagementTest.java diff --git a/pom.xml b/pom.xml index d1e2781..0d3ac1b 100644 --- a/pom.xml +++ b/pom.xml @@ -219,6 +219,12 @@ easyexcel 2.1.1 + + + com.github.pagehelper + pagehelper + 5.1.2 + diff --git a/src/main/java/com/msdw/tms/api/AchievementManagementApi.java b/src/main/java/com/msdw/tms/api/AchievementManagementApi.java new file mode 100644 index 0000000..3375509 --- /dev/null +++ b/src/main/java/com/msdw/tms/api/AchievementManagementApi.java @@ -0,0 +1,55 @@ +package com.msdw.tms.api; + +import com.msdw.tms.common.utils.R; +import com.msdw.tms.entity.ExperimentalReportEntity; +import com.msdw.tms.entity.vo.AchievementManagementVo; +import com.msdw.tms.entity.vo.AchievementVo; +import com.msdw.tms.entity.vo.SearchAchievementVo; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestParam; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; + +@Api(value = "成绩管理",tags = "成绩管理") +public interface AchievementManagementApi { + + @ApiOperation(value = "川大新增实验记录",notes = "川大新增实验记录") + R addReport(AchievementVo vo); + + @ApiOperation(value = "查询实验记录",notes = "查询实验记录") + R queryReport(@ApiParam(value = "实验报告主键id",required = true) Integer reportId); + +// @ApiOperation(value = "直接修改实验记录分数",notes = "直接修改实验记录分数") +// R updateScore(@ApiParam(value = "recordid和score") ProjectRecordEntity entity); + + @ApiOperation(value = "删除实验报告",notes = "根据实验记录主键reportId和实验报告主键recordId删除实验报告") + R deleteReport(@ApiParam(value = "实验记录主键reportId(此处为ids集合)",required = true) AchievementManagementVo vo); + + @ApiOperation(value = "班级实验报告列表查询",notes = "班级实验报告列表查询") + R queryEvaluationReport(@ApiParam(value = "搜索内容(学校名称/学生姓名)",required = false) String searchContant, + @ApiParam(value = "项目",required = true) Integer projectId, + @ApiParam(value = "当前页码",required = true) Integer page, + @ApiParam(value = "每页显示数据量",required = true) Integer size); + + @ApiOperation(value = "班级实验成绩导出",notes = "班级实验成绩导出") + void exportAchievement(HttpServletResponse response, @ApiParam(value = "实验记录集合recordId(此处为ids字符串(1,2,3))")String ids) throws Exception; + + @ApiOperation(value = "成绩管理列表",notes = "成绩管理列表筛选查询") + R queryAchievement(@ApiParam(value = "平台id",required = false) Integer systemId, + @ApiParam(value = "项目类型",required = false) Integer projectPermissions, + @ApiParam(value = "搜索内容",required = false) String searchContant, + @ApiParam(value = "开始时间",required = false) String startingtime, + @ApiParam(value = "结束时间",required = false) String endtime, + @ApiParam(value = "最近几月",required = false) Integer month); + + @ApiOperation(value = "修改教师评语",notes = "修改教师评语:评语comment和实验报告主键reportId") + R updateComment(@ApiParam(value = "评语comment和实验报告主键reportId",required = true) ExperimentalReportEntity entity); + + @ApiOperation(value = "发布成绩",notes = "发布成绩--修改教师签名") + R updateSignatrue(@ApiParam(value = "实验报告主键reportId+是否使用教师签名isSignature+教师签名id signatureId") ExperimentalReportEntity entity); +} diff --git a/src/main/java/com/msdw/tms/api/ClassTeachingApi.java b/src/main/java/com/msdw/tms/api/ClassTeachingApi.java index 4efd927..7ddc02e 100644 --- a/src/main/java/com/msdw/tms/api/ClassTeachingApi.java +++ b/src/main/java/com/msdw/tms/api/ClassTeachingApi.java @@ -30,7 +30,7 @@ public interface ClassTeachingApi { @ApiOperation(value = "查看教学实验报告",notes = "查看教学实验报告") R queryExperimentalReport(@ApiParam(value = "学生id",required = true) Integer studentId, - @ApiParam(value = "项目id",required = true) Integer projectId, + @ApiParam(value = "实验id",required = true) Integer projectId, @ApiParam(value = "实验记录主键",required = true) Integer recordId, @ApiParam(value = "实验报告主键",required = true) Integer reportId); diff --git a/src/main/java/com/msdw/tms/api/CommentApi.java b/src/main/java/com/msdw/tms/api/CommentApi.java new file mode 100644 index 0000000..7508803 --- /dev/null +++ b/src/main/java/com/msdw/tms/api/CommentApi.java @@ -0,0 +1,22 @@ +package com.msdw.tms.api; + +import com.msdw.tms.common.utils.R; +import com.msdw.tms.entity.CommentEntity; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestBody; + +@Api(value = "教师评语",tags = "教师评语") +public interface CommentApi { + @ApiOperation(value = "添加老师评语",notes = "添加老师评语") + R addComment(@ApiParam(value = "老师评语comment和评级level") CommentEntity entity); + + @ApiOperation(value = "修改老师评语",notes = "根据主键id修改评语") + R updateComment(@ApiParam(value = "主键id+老师评语comment+评级level") CommentEntity entity); + + @ApiOperation(value ="查询所有评语",notes = "查询所有评语") + R queryComment(); +} diff --git a/src/main/java/com/msdw/tms/api/ExperimentalTeachingControllerApi.java b/src/main/java/com/msdw/tms/api/ExperimentalTeachingControllerApi.java index 2c9dcec..e5c9351 100644 --- a/src/main/java/com/msdw/tms/api/ExperimentalTeachingControllerApi.java +++ b/src/main/java/com/msdw/tms/api/ExperimentalTeachingControllerApi.java @@ -22,7 +22,8 @@ public interface ExperimentalTeachingControllerApi { @ApiParam(name = "status", value = "状态:1、待开始 2、进行中 3、已结束", required = false) Integer status, @ApiParam(name = "startTime", value = "开始时间", required = false) String startTime, @ApiParam(name = "stopTime", value = "结束时间", required = false) String stopTime, - @ApiParam(name = "searchContent", value = "搜索内容", required = false) String searchContent); + @ApiParam(name = "searchContent", value = "搜索内容", required = false) String searchContent, + @ApiParam(name = "schoolId", value = "学校id", required = true) Integer schoolId); @ApiOperation(value = "添加实验教学",notes = "添加实验教学") R save(ExperimentalTeachingEntity experimentalTeachingEntity) throws ParseException; diff --git a/src/main/java/com/msdw/tms/api/SignatureApi.java b/src/main/java/com/msdw/tms/api/SignatureApi.java new file mode 100644 index 0000000..4ce5d70 --- /dev/null +++ b/src/main/java/com/msdw/tms/api/SignatureApi.java @@ -0,0 +1,24 @@ +package com.msdw.tms.api; + +import com.msdw.tms.common.utils.R; +import com.msdw.tms.entity.SignatureEntity; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.multipart.MultipartFile; + +import java.io.IOException; + +@Api(value = "老师签名照", tags = "老师签名照") +public interface SignatureApi { + + @ApiOperation(value = "上传老师签名照",notes = "上传老师签名照") + R uploadSignature(MultipartFile file,@ApiParam(value = "用户id",required = true) Integer userId) throws IOException; + + @ApiOperation(value = "查询老师签名照",notes = "查询老师签名照") + R querySignature(@ApiParam(value = "用户id",required = true) Integer userId); + + @ApiOperation(value = "删除教师签名照",notes = "根据主键id删除教师签名照") + R daleteSignature(@ApiParam(value = "签名名称signatureName和主键id",required = true) SignatureEntity entity); +} diff --git a/src/main/java/com/msdw/tms/api/UserInfoControllerApi.java b/src/main/java/com/msdw/tms/api/UserInfoControllerApi.java index 9454264..0d6096e 100644 --- a/src/main/java/com/msdw/tms/api/UserInfoControllerApi.java +++ b/src/main/java/com/msdw/tms/api/UserInfoControllerApi.java @@ -9,6 +9,7 @@ import com.msdw.tms.entity.vo.UserProsonalEntityVo; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestParam; @@ -28,14 +29,19 @@ public interface UserInfoControllerApi { @ApiOperation(value = "个人中心-信息修改",notes = "个人中心-信息修改") R updateUser(UserProsonalEntityVo userProsonalEntityVo); - @ApiOperation(value = "发送验证码",notes = "发送验证码") - R findPassword(@ApiParam(value = "账号",required = true) String account, - @ApiParam(value = "发送类型(1邮箱,2手机)",required = true) Integer type); + @ApiOperation(value = "发送手机验证码",notes = "发送手机验证码") + R findPasswordByPhone(@ApiParam(value = "手机号",required = true) String email); + + @ApiOperation(value = "发送邮箱验证码",notes = "发送邮箱验证码") + R findPasswordByEmail(@ApiParam(value = "邮箱号",required = true) String phone); @ApiOperation(value = "校验验证码",notes = "校验验证码") // R checkCode(@ApiParam(value = "用户id和验证码") String code,@ApiParam(value = "用户id和验证码")String opener); - R checkCode(@ApiParam(value = "用户id和验证码") CheckVo checkVo); + R checkCode(@ApiParam(value = "用户id+验证码+取值码") CheckVo checkVo); @ApiOperation(value = "设置新密码",notes = "设置新密码") R resetPassword(@ApiParam(value = "用户id和密码") CheckVo checkVo); + + @ApiOperation(value = "专家账号",notes = "根据登录次数和时间从20个账号中循环提取") + R GMAccount(); } diff --git a/src/main/java/com/msdw/tms/common/utils/ExcelImportHelper.java b/src/main/java/com/msdw/tms/common/utils/ExcelImportHelper.java index 164137b..78dd0b3 100644 --- a/src/main/java/com/msdw/tms/common/utils/ExcelImportHelper.java +++ b/src/main/java/com/msdw/tms/common/utils/ExcelImportHelper.java @@ -103,10 +103,15 @@ public class ExcelImportHelper { if (hssfSheet == null) { continue; } + int lastRowNum = hssfSheet.getLastRowNum(); + if (lastRowNum==2){ + break; + } // 循环行Row//开始行2 for (int rowNum = 2; rowNum <= hssfSheet.getLastRowNum(); rowNum++) { Row row = hssfSheet.getRow(rowNum); + Cell userName; Cell phone; Cell email; Cell staffGradeName; @@ -115,8 +120,14 @@ public class ExcelImportHelper { Cell staffProfessionalArchitectureNameTwo; if (row != null) { staff = new StaffVo(); - row.getCell(0).setCellType(CellType.STRING); - Cell userName = row.getCell(0); + + if (row.getCell(0)!=null){ + row.getCell(0).setCellType(CellType.STRING); + userName = row.getCell(0); + }else { + continue; + } + row.getCell(1).setCellType(CellType.STRING); Cell account = row.getCell(1); row.getCell(2).setCellType(CellType.STRING); diff --git a/src/main/java/com/msdw/tms/config/PageResult.java b/src/main/java/com/msdw/tms/config/PageResult.java new file mode 100644 index 0000000..0c58965 --- /dev/null +++ b/src/main/java/com/msdw/tms/config/PageResult.java @@ -0,0 +1,54 @@ +package com.msdw.tms.config; + +import java.io.Serializable; +import java.util.List; + +public class PageResult implements Serializable { + + // 总记录数 + private Long total; + // 总记录 + private List rows; + private int totalPages; + + public PageResult(Long total, List rows, int totalPages) { + this.total = total; + this.rows = rows; + this.totalPages = totalPages; + } + + public int getTotalPages() { + return totalPages; + } + + + public void setTotalPages(int totalPages) { + this.totalPages = totalPages; + } + + + public Long getTotal() { + return total; + } + + public void setTotal(Long total) { + this.total = total; + } + + public List getRows() { + return rows; + } + + public void setRows(List rows) { + this.rows = rows; + } + + @Override + public String toString() { + return "PageResult{" + + "total=" + total + + ", rows=" + rows + + ", totalPages=" + totalPages + + '}'; + } +} diff --git a/src/main/java/com/msdw/tms/config/CheckCodeQuartzConfig.java b/src/main/java/com/msdw/tms/config/QuartzConfig.java similarity index 59% rename from src/main/java/com/msdw/tms/config/CheckCodeQuartzConfig.java rename to src/main/java/com/msdw/tms/config/QuartzConfig.java index 4ddad00..a5d3c02 100644 --- a/src/main/java/com/msdw/tms/config/CheckCodeQuartzConfig.java +++ b/src/main/java/com/msdw/tms/config/QuartzConfig.java @@ -1,33 +1,14 @@ package com.msdw.tms.config; -import com.msdw.tms.config.quartz.CheckCodeQuartz; +//import com.msdw.tms.config.quartz.CheckCodeQuartz; import com.msdw.tms.config.quartz.TimeOutQuartz; import org.quartz.*; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @Configuration -public class CheckCodeQuartzConfig { - //定义任务详情 - @Bean - public JobDetail orderjobDetail() { - return JobBuilder - .newJob(CheckCodeQuartz.class) - .withIdentity("checkCodeQuartz") - .storeDurably() - .build(); - } - //定义触发器 - @Bean - public Trigger orderTrigger() { - CronScheduleBuilder scheduleBuilder - = CronScheduleBuilder.cronSchedule("0 0 18 * * ? "); //时间表达式,每天的18点执行任务 - return TriggerBuilder - .newTrigger() - .forJob(orderjobDetail()) - .withIdentity("checkCodeQuartz") - .withSchedule(scheduleBuilder).build(); - } +public class QuartzConfig { + //定义任务详情 @Bean public JobDetail timeOutJob() { diff --git a/src/main/java/com/msdw/tms/config/quartz/CheckCodeQuartz.java b/src/main/java/com/msdw/tms/config/quartz/CheckCodeQuartz.java deleted file mode 100644 index eb73365..0000000 --- a/src/main/java/com/msdw/tms/config/quartz/CheckCodeQuartz.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.msdw.tms.config.quartz; - -import com.msdw.tms.service.UserService; -import lombok.extern.slf4j.Slf4j; -import org.quartz.Job; -import org.quartz.JobExecutionContext; -import org.quartz.JobExecutionException; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -@Slf4j -@Component -public class CheckCodeQuartz implements Job { - - @Autowired - private UserService userService; - - @Override - public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException { - boolean clean = userService.cleanUp(); - log.info("清理过期验证码"); - - } - -} diff --git a/src/main/java/com/msdw/tms/controller/AchievementManagementController.java b/src/main/java/com/msdw/tms/controller/AchievementManagementController.java index e35cb28..e5ae595 100644 --- a/src/main/java/com/msdw/tms/controller/AchievementManagementController.java +++ b/src/main/java/com/msdw/tms/controller/AchievementManagementController.java @@ -1,13 +1,131 @@ package com.msdw.tms.controller; +import com.msdw.tms.api.AchievementManagementApi; +import com.msdw.tms.common.utils.R; +import com.msdw.tms.entity.ExperimentalReportEntity; +import com.msdw.tms.entity.ProjectRecordEntity; +import com.msdw.tms.entity.vo.AchievementManagementVo; +import com.msdw.tms.entity.vo.AchievementVo; import com.msdw.tms.service.AchievementManagementService; +import com.msdw.tms.service.ProjectRecordService; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; + +/** + * 成绩管理 + */ @RestController @RequestMapping("/Achievement") -public class AchievementManagementController { +public class AchievementManagementController implements AchievementManagementApi { + + @Autowired + private AchievementManagementService service; @Autowired - private AchievementManagementService achievementManagementService; + private ProjectRecordService projectRecordService; + + /** + * 提交实验结果--川大 + */ + @Override + @PostMapping("/addReport") + public R addReport(@RequestBody AchievementVo vo){ + R result = service.addReport(vo); + return result; + } + + /** + * 查询实验记录 + */ + @Override + @GetMapping("/queryReport") + public R queryReport(@RequestParam(required = true) Integer reportId){ + R result = service.queryReport(reportId); + return result; + } + + //直接修改实验记录分数 +// @Override + @Transactional + @PostMapping("/updateReport") + public R updateScore(@RequestBody ProjectRecordEntity entity){ + ProjectRecordEntity vo = new ProjectRecordEntity() + .setRecordid(entity.getRecordid()).setScore(entity.getScore()); + projectRecordService.updateScore(vo); + return R.ok(); + } + + /** + * 需求:删除实验记录====管理端删除,但是学生端仍需保留 + * 将isdel属性设置为0 + * @param vo (recordid 、reportId) + * @return + */ + @Override + @PostMapping("/deleteReport") + public R deleteReport(@RequestBody AchievementManagementVo vo){ + R result = service.deleteReport(vo); + return result; + } + + /** + * 班级实验报告列表查询 + * @param searchContant + * @return + */ + @Override + @GetMapping("/queryEvaluationReport") + public R queryEvaluationReport(@RequestParam(required = false) String searchContant, + @RequestParam(required = true) Integer projectId, + @RequestParam(required = true) Integer page, + @RequestParam(required = true) Integer size){ + R result = service.queryEvaluationReport(searchContant,projectId,page,size); + return result; + } + + /** + * 班级实验成绩导出 + * @param response + * @param ids (ids:recordId) + * @throws Exception + */ + @Override + @GetMapping("/exportAchievement") + public void exportAchievement(HttpServletResponse response, @RequestParam String ids) throws Exception { + service.exportAchievement(response,ids);//SearchAchievementVo vo + } + + @Override + @GetMapping("/queryAchievement") + public R queryAchievement(@RequestParam(required = false) Integer systemId, + @RequestParam(required = false) Integer projectPermissions, + @RequestParam(required = false) String searchContant, + @RequestParam(required = false) String startingtime, + @RequestParam(required = false) String endtime, + @RequestParam(required = false) Integer month){ + R result = service.queryAchievement(systemId,projectPermissions,searchContant,startingtime,endtime,month); + return result; + } + + /** + * 修改评语 + * @param entity + * @return + */ + @Override + @PostMapping("/updateComment") + public R updateComment(@RequestBody ExperimentalReportEntity entity){ + R result = service.updateComment(entity); + return result; + } + + @Override + @PostMapping("/release") + public R updateSignatrue(@RequestBody ExperimentalReportEntity entity){ + service.updateSignatrue(entity); + return R.ok(); + } } diff --git a/src/main/java/com/msdw/tms/controller/ClassTeachingController.java b/src/main/java/com/msdw/tms/controller/ClassTeachingController.java index fea92d9..a373260 100644 --- a/src/main/java/com/msdw/tms/controller/ClassTeachingController.java +++ b/src/main/java/com/msdw/tms/controller/ClassTeachingController.java @@ -121,10 +121,6 @@ public class ClassTeachingController implements ClassTeachingApi { return R.error(400,"邀请码格式错误!!!"); } } -// else{ -// return R.error("输入有误,无需邀请码"); -// } -// } //查看成绩 @Override @@ -148,13 +144,12 @@ public class ClassTeachingController implements ClassTeachingApi { /** * 学生查看实验报告 - * @param entity + * @param * @return */ @Override @GetMapping("/queryExperimentalReport") public R queryExperimentalReport(@RequestParam Integer studentId,@RequestParam Integer projectId,@RequestParam Integer recordId,@RequestParam Integer reportId){ -// public R queryExperimentalReport(@RequestBody ExperimentalReportVo entity){ ExperimentalReportVo entity = new ExperimentalReportVo(); R result = experimentalReportService.queryReport(studentId,projectId,recordId,reportId); @@ -163,7 +158,7 @@ public class ClassTeachingController implements ClassTeachingApi { /** * 学生查看虚拟实验报告 - * @param entity + * @param * @return */ @Override diff --git a/src/main/java/com/msdw/tms/controller/Commentcontroller.java b/src/main/java/com/msdw/tms/controller/Commentcontroller.java new file mode 100644 index 0000000..dd9b6a7 --- /dev/null +++ b/src/main/java/com/msdw/tms/controller/Commentcontroller.java @@ -0,0 +1,50 @@ +package com.msdw.tms.controller; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.msdw.tms.api.CommentApi; +import com.msdw.tms.common.utils.R; +import com.msdw.tms.entity.CommentEntity; +import com.msdw.tms.service.CommentService; +import com.sun.xml.bind.v2.model.core.ID; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * 此类为老师评语 + */ +@RestController +@RequestMapping("/comment") +public class Commentcontroller implements CommentApi { + + @Autowired + private CommentService commentService; + + @Override + @PostMapping("/addComment") + @Transactional + public R addComment(@RequestBody CommentEntity entity){ + commentService.save(entity); + return R.ok(); + } + + @Override + @Transactional + @PostMapping("/updateComment") + public R updateComment(@RequestBody CommentEntity entity){ + if (entity.getId()==null){ + return R.error("id不能为空!!!"); + } + commentService.updateById(entity); + return R.ok(); + } + + @Override + @GetMapping("/queryComment") + public R queryComment(){ + List result = commentService.list(); + return R.ok().put("data",result); + } +} diff --git a/src/main/java/com/msdw/tms/controller/ExperimentalTeachingController.java b/src/main/java/com/msdw/tms/controller/ExperimentalTeachingController.java index 1f75c9a..7dd84ce 100644 --- a/src/main/java/com/msdw/tms/controller/ExperimentalTeachingController.java +++ b/src/main/java/com/msdw/tms/controller/ExperimentalTeachingController.java @@ -9,6 +9,7 @@ import com.msdw.tms.common.utils.R; import com.msdw.tms.entity.ExperimentalTeachingEntity; import com.msdw.tms.entity.UserEntity; import com.msdw.tms.entity.vo.ExperimentalTeachingEntityVO; +import com.msdw.tms.entity.vo.ExperimentalTeachingVO; import com.msdw.tms.entity.vo.UserEntityVo; import com.msdw.tms.service.ExperimentalTeachingService; import com.msdw.tms.service.UserService; @@ -51,8 +52,9 @@ public class ExperimentalTeachingController implements ExperimentalTeachingContr @GetMapping("/list") public R list(@RequestParam Integer page, @RequestParam Integer size, - Integer month, Integer type, Integer status, String startTime, String stopTime, String searchContent){ - ExperimentalTeachingEntityVO vo = new ExperimentalTeachingEntityVO(); + Integer month, Integer type, Integer status, String startTime, String stopTime, String searchContent,@RequestParam Integer schoolId){ + ExperimentalTeachingVO vo = new ExperimentalTeachingVO(); + vo.setSchoolId(schoolId); if (month!=null){ vo.setMonth(month); } diff --git a/src/main/java/com/msdw/tms/controller/ProjectRecordController.java b/src/main/java/com/msdw/tms/controller/ProjectRecordController.java index e8967c5..cba98ec 100644 --- a/src/main/java/com/msdw/tms/controller/ProjectRecordController.java +++ b/src/main/java/com/msdw/tms/controller/ProjectRecordController.java @@ -95,19 +95,6 @@ public class ProjectRecordController implements ProjectRcordControllerApi { return R.ok().put("data", projectRecord); } - -// /** -// * 导出个人项目记录 -// * @param response -// * @throws Exception -// */ -// @Override -// @PostMapping("/user/exportProjectRecord") -// public void exportProjectRecord(HttpServletResponse response,@RequestBody ProjectRecordVo list)throws Exception{ -// projectRecordService.exportProjectRecord(response,list); -// } - - /** * 导出个人虚拟仿真实验记录 * @param response diff --git a/src/main/java/com/msdw/tms/controller/SignatureController.java b/src/main/java/com/msdw/tms/controller/SignatureController.java new file mode 100644 index 0000000..3d7e462 --- /dev/null +++ b/src/main/java/com/msdw/tms/controller/SignatureController.java @@ -0,0 +1,69 @@ +package com.msdw.tms.controller; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.msdw.tms.api.SignatureApi; +import com.msdw.tms.common.utils.FilesResult; +import com.msdw.tms.common.utils.R; +import com.msdw.tms.entity.SignatureEntity; +import com.msdw.tms.service.AliyunOssService; +import com.msdw.tms.service.SignatureService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import java.io.IOException; +import java.util.List; + +/** + * 此类为老师签名 + */ +@RestController +@RequestMapping("/signature") +public class SignatureController implements SignatureApi { + + @Autowired + private SignatureService signatureService; + + @Autowired + private AliyunOssService ossService; + + /** + * 上传老师签名照 + * @param file 文件 + * @param userId 用户id + * @return + */ + @Override + @PostMapping("/uploadSignature") + public R uploadSignature(@RequestParam MultipartFile file, @RequestParam Integer userId) throws IOException { + R result = signatureService.uploadSignature(file,userId); + return result; + } + + /** + * 查询老师签名照 + * @param userId + * @return + */ + @Override + @GetMapping("/querySignature") + public R querySignature(@RequestParam Integer userId){ + R result = signatureService.querySignature(userId); + return result; + } + + /** + * 删除老师签名照 + * @param entity + * @return + */ + @Override + @Transactional + @PostMapping("/daleteSignature") + public R daleteSignature(@RequestBody SignatureEntity entity){ + R result = signatureService.daleteSignature(entity); + + return result; + } +} diff --git a/src/main/java/com/msdw/tms/controller/UserController.java b/src/main/java/com/msdw/tms/controller/UserController.java index 7c8bf9b..2fac63b 100644 --- a/src/main/java/com/msdw/tms/controller/UserController.java +++ b/src/main/java/com/msdw/tms/controller/UserController.java @@ -141,57 +141,39 @@ public class UserController implements UserControllerApi { /** * 发送邮箱验证码 - * @param checkVo - * @return + * @param checkVo (email) + * @return R (参数 opener) */ @Override @PostMapping("/sendEmailCode") public R sendEmailCode(@RequestBody CheckVo checkVo){ - boolean re = userService.queryEmial(checkVo); + boolean re = userService.queryEmial(checkVo);//查询新邮箱号是否存在重复 if (re){ return R.error(403,"邮箱号不能重复"); }else{ - boolean save = userService.saveCheckCode(checkVo); - return save ? R.ok() : R.error(); + R save = userService.saveCheckCode(checkVo); + return save; } } /** * 校验邮箱验证码,通过则更新邮箱 - * @param checkVo - * @return + * @param checkVo (useId 、email 、code 、opener) + * @return R */ @Override @PutMapping("/bingEmail") - public R bindEmail(@RequestBody CheckVo checkVo){ - - String email = checkVo.getEmail(); - Integer types = checkVo.getTypes(); - List emailCode = userService.findEmailCode(email,types);//获取最近的验证码 - if (emailCode.size()==1){ - String checkCode = emailCode.get(0); - List result = userService.findEmailSetTime(email,checkCode,types);//验证最近验证码是否过期 - if (result.size()==1){ - String code = checkVo.getCode(); - if (code.equals(checkCode)){ - boolean bind = userService.bindEmail(checkVo); - return bind ? R.ok() : R.error(); - }else{ - return R.error(403,"验证失败!!!"); - } - }else{ - return R.error(403,"验证码过期!!!"); - } - }else{ - return R.error(403,"请发送验证码!!!"); - } + public R bindEmail(@RequestBody CheckVo checkVo) { + R result = userService.bindEmail(checkVo); + return result; } - /** - * 发送手机验证码 - * @param checkVo - * @return - */ + + /** + * 发送手机验证码 + * @param checkVo + * @return + */ @Override @PostMapping("/sendPhoneCode") public R sendPhoneCode(@RequestBody CheckVo checkVo){ @@ -199,37 +181,21 @@ public class UserController implements UserControllerApi { if (re){ return R.error(403,"电话号码不能重复"); }else { - boolean save = userService.sendCheckPhoneCode(checkVo); - return save ? R.ok() : R.error(); + R result = userService.sendCheckPhoneCode(checkVo); + return result; } } /** * 绑定手机 - * @param checkVo + * @param checkVo (userId 、phone、code、opener) * @return */ @Override @PutMapping("/bindPhone") public R bindPhone(@RequestBody CheckVo checkVo){ - String phone = checkVo.getPhone(); - Integer types = checkVo.getTypes(); - List phoneCode = userService.findPhoneCode(phone,types);//获取最近的验证码 - if (phoneCode.size()==1){ - String checkCode = phoneCode.get(0); - List result = userService.findPhoneSetTime(phone,checkCode,types);//验证最近验证码是否过期 - if (result.size()==1){ - if (checkVo.getCode().equals(checkCode)){ - boolean bind = userService.bindPhone(checkVo); - return bind ? R.ok() : R.error(); - }else{ - return R.error(403,"验证失败!!!"); - } - }else{ - return R.error(403,"验证码过期!!!"); - } - }else{ - return R.error(403,"请发送验证码!!!"); - } + + R result = userService.bindPhone(checkVo); + return result; } } diff --git a/src/main/java/com/msdw/tms/controller/UserInfoController.java b/src/main/java/com/msdw/tms/controller/UserInfoController.java index 3de55fa..f3efee3 100644 --- a/src/main/java/com/msdw/tms/controller/UserInfoController.java +++ b/src/main/java/com/msdw/tms/controller/UserInfoController.java @@ -112,7 +112,6 @@ public class UserInfoController implements UserInfoControllerApi { public R userInfo(@PathVariable("id") Integer id){ HashMap userEntityVoList = userService.queryUserInfo(id); -// UserEntityVo userEntityVo = userService.queryUserId(id); return R.ok().put("data",userEntityVoList); } @@ -149,15 +148,25 @@ public class UserInfoController implements UserInfoControllerApi { } /** - * 找回密码---发送验证码 - * @param account - * @param type + * 找回密码---发送验证码---手机 + * @param phone * @return */ @Override - @GetMapping("/findPassword") - public R findPassword(@RequestParam String account,@RequestParam Integer type){ - R result = userInfoService.findPassword(account,type); + @GetMapping("/findPasswordByPhone") + public R findPasswordByPhone(@RequestParam String phone){ + R result = userInfoService.findPasswordByPhone(phone); + return result; + } + /** + * 找回密码---发送验证码---手机 + * @param email + * @return + */ + @Override + @GetMapping("/findPasswordByEmail") + public R findPasswordByEmail(@RequestParam String email){ + R result = userInfoService.findPasswordByEmail(email); return result; } @@ -185,4 +194,10 @@ public class UserInfoController implements UserInfoControllerApi { return result; } + @Override + @GetMapping("/GMAccount") + public R GMAccount(){ + R result = userInfoService.queryAccount(); + return result; + } } diff --git a/src/main/java/com/msdw/tms/dao/AchievementManagementDao.java b/src/main/java/com/msdw/tms/dao/AchievementManagementDao.java index 9702e6e..d6bb45b 100644 --- a/src/main/java/com/msdw/tms/dao/AchievementManagementDao.java +++ b/src/main/java/com/msdw/tms/dao/AchievementManagementDao.java @@ -1,7 +1,50 @@ package com.msdw.tms.dao; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.msdw.tms.common.utils.R; +import com.msdw.tms.entity.ExperimentalReportEntity; +import com.msdw.tms.entity.request.AchievementImportRequest; +import com.msdw.tms.entity.vo.AchievementManagementVo; +import com.msdw.tms.entity.vo.AchievementVo; +import com.msdw.tms.entity.vo.SearchAchievementVo; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.apache.poi.ss.formula.functions.T; + +import java.util.List; @Mapper -public interface AchievementManagementDao { +public interface AchievementManagementDao extends BaseMapper { + + void addReport(AchievementVo entity); + + AchievementManagementVo queryReport(Integer reportId); + + void deleteReport(AchievementManagementVo vo); + + IPage queryEvaluationReport(Page tPage, String searchContant, Integer projectId); + + List queryAchievement(@Param("ids") List ids); + + List queryFictitiousRecord(Integer systemId,String searchContant, String startingtime, String endtime, Integer month,List projectIds); + + List queryEducationRecord(Integer systemId, String searchContant, String startingtime, String endtime, Integer month,List projectIds); + + //qiyong + List queryFictitiousReport(String searchContant, Integer projectId); + + List countEducationProjectId(); + + List countFictitiousProjectId(); + + + String queryEvaluationName(Integer projectId); + + void updateComment(ExperimentalReportEntity entity); + + List queryPythonTest(Integer eventId); + + void updateSignatrue(Integer isSignature,Integer signatureId,Integer reportId); } diff --git a/src/main/java/com/msdw/tms/dao/CommentDao.java b/src/main/java/com/msdw/tms/dao/CommentDao.java new file mode 100644 index 0000000..31bf66c --- /dev/null +++ b/src/main/java/com/msdw/tms/dao/CommentDao.java @@ -0,0 +1,9 @@ +package com.msdw.tms.dao; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.msdw.tms.entity.CommentEntity; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface CommentDao extends BaseMapper { +} diff --git a/src/main/java/com/msdw/tms/dao/ExperimentalReportDao.java b/src/main/java/com/msdw/tms/dao/ExperimentalReportDao.java index f30aa92..3e593b4 100644 --- a/src/main/java/com/msdw/tms/dao/ExperimentalReportDao.java +++ b/src/main/java/com/msdw/tms/dao/ExperimentalReportDao.java @@ -3,6 +3,7 @@ package com.msdw.tms.dao; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.msdw.tms.entity.ExperimentalReportEntity; +import com.msdw.tms.entity.vo.AchievementManagementVo; import com.msdw.tms.entity.vo.ExperimentalReportVo; import org.apache.ibatis.annotations.Mapper; @@ -12,4 +13,6 @@ public interface ExperimentalReportDao extends BaseMapper { - IPage queryExperimentalTeaching(Page page1,@Param("exp") ExperimentalTeachingEntityVO request); + IPage queryExperimentalTeaching(Page page1,@Param("exp") ExperimentalTeachingVO request); + + Integer queryProjectId(Integer evaluationId); } diff --git a/src/main/java/com/msdw/tms/dao/ProjectRecordDao.java b/src/main/java/com/msdw/tms/dao/ProjectRecordDao.java index 0473934..387d825 100644 --- a/src/main/java/com/msdw/tms/dao/ProjectRecordDao.java +++ b/src/main/java/com/msdw/tms/dao/ProjectRecordDao.java @@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.msdw.tms.entity.ProjectRecordEntity; +import com.msdw.tms.entity.RecordVo; import com.msdw.tms.entity.vo.ProjectRecordExportVo; import com.msdw.tms.entity.vo.ProjectRecordVo; import org.apache.ibatis.annotations.Mapper; @@ -34,4 +35,10 @@ public interface ProjectRecordDao extends BaseMapper { boolean updateUserRecord(ProjectRecordEntity projectRecord); List getByRecordImport(ProjectRecordEntity projectRecord); + + void addReport(RecordVo entity); + + ProjectRecordEntity queryReport(Integer recordId); + + void updateScore(ProjectRecordEntity vo); } diff --git a/src/main/java/com/msdw/tms/dao/SignatureDao.java b/src/main/java/com/msdw/tms/dao/SignatureDao.java new file mode 100644 index 0000000..a66b85c --- /dev/null +++ b/src/main/java/com/msdw/tms/dao/SignatureDao.java @@ -0,0 +1,10 @@ +package com.msdw.tms.dao; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.msdw.tms.entity.SignatureEntity; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface SignatureDao extends BaseMapper { + String queryRoleIds(Integer userId); +} diff --git a/src/main/java/com/msdw/tms/dao/UserDao.java b/src/main/java/com/msdw/tms/dao/UserDao.java index acae17d..20c28b6 100644 --- a/src/main/java/com/msdw/tms/dao/UserDao.java +++ b/src/main/java/com/msdw/tms/dao/UserDao.java @@ -13,8 +13,6 @@ import java.util.List; @Mapper public interface UserDao extends BaseMapper { - boolean cleanUp(); - List queryEmial(CheckVo checkVo); boolean saveCheckCode(CheckVo checkVo); diff --git a/src/main/java/com/msdw/tms/dao/UserInfoDao.java b/src/main/java/com/msdw/tms/dao/UserInfoDao.java index 5ac2c26..778eb11 100644 --- a/src/main/java/com/msdw/tms/dao/UserInfoDao.java +++ b/src/main/java/com/msdw/tms/dao/UserInfoDao.java @@ -3,10 +3,7 @@ package com.msdw.tms.dao; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.msdw.tms.entity.StudentEntity; import com.msdw.tms.entity.UserInfoEntity; -import com.msdw.tms.entity.vo.CheckVo; -import com.msdw.tms.entity.vo.StaffVo; -import com.msdw.tms.entity.vo.StudentVo; -import com.msdw.tms.entity.vo.UserProsonalEntityVo; +import com.msdw.tms.entity.vo.*; import org.apache.ibatis.annotations.Mapper; import java.util.List; @@ -56,7 +53,16 @@ public interface UserInfoDao extends BaseMapper { List queryUser(String account); - String checkCode(CheckVo checkVo); - void resetPassword(CheckVo checkVo); + + UserInfoEntity queryUserAccount(); + + void updateUserDetail(); + + String queryUserReport(Integer userId); + + StudentEntity queryStudentId(String userName, Integer userId); + + List queryStudentName(Integer userId); + } diff --git a/src/main/java/com/msdw/tms/entity/AchievementManagementEntity.java b/src/main/java/com/msdw/tms/entity/AchievementManagementEntity.java deleted file mode 100644 index 35523c2..0000000 --- a/src/main/java/com/msdw/tms/entity/AchievementManagementEntity.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.msdw.tms.entity; - -import lombok.Data; -import lombok.experimental.Accessors; - -/** - * 成绩管理/川大 - */ -@Data -@Accessors(chain = true) -public class AchievementManagementEntity { - - -} diff --git a/src/main/java/com/msdw/tms/entity/CommentEntity.java b/src/main/java/com/msdw/tms/entity/CommentEntity.java new file mode 100644 index 0000000..93511bc --- /dev/null +++ b/src/main/java/com/msdw/tms/entity/CommentEntity.java @@ -0,0 +1,22 @@ +package com.msdw.tms.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * 老师评语 + */ +@Data +@Accessors(chain = true) +@TableName("tms_comment") +public class CommentEntity { + + //主键id + private Integer id; + //评语 + private String comment; + //评语层级id + private Integer level; +} diff --git a/src/main/java/com/msdw/tms/entity/ExperimentalReportEntity.java b/src/main/java/com/msdw/tms/entity/ExperimentalReportEntity.java index 6c37136..cffea8e 100644 --- a/src/main/java/com/msdw/tms/entity/ExperimentalReportEntity.java +++ b/src/main/java/com/msdw/tms/entity/ExperimentalReportEntity.java @@ -33,13 +33,21 @@ public class ExperimentalReportEntity { //对本实验过程的方法及手段的改进建议 private String improvement; //老师评语 + private Integer commentId; + //教师评语 private String comment; //绑定学生id private Integer studentId; - //绑定老师id - private Integer teacherId; +// 绑定老师id +// private Integer teacherId; //学时 private String period; //实验室名称 private String laboratory; + //绑定教师签名id + private Integer signatureId; + //是否启用教师签名照 + private Integer isSignature; + //绑定项目id + private Integer eventId; } diff --git a/src/main/java/com/msdw/tms/entity/ProjectRecordEntity.java b/src/main/java/com/msdw/tms/entity/ProjectRecordEntity.java index 2ef118b..700d7b0 100644 --- a/src/main/java/com/msdw/tms/entity/ProjectRecordEntity.java +++ b/src/main/java/com/msdw/tms/entity/ProjectRecordEntity.java @@ -3,8 +3,10 @@ package com.msdw.tms.entity; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableLogic; import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import lombok.experimental.Accessors; +import org.springframework.format.annotation.DateTimeFormat; import java.io.Serializable; import java.util.Date; @@ -46,6 +48,8 @@ public class ProjectRecordEntity implements Serializable { /** * 起始时间 */ + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date startingtime; /** * 结束时间 @@ -58,6 +62,8 @@ public class ProjectRecordEntity implements Serializable { /** * 提交时间 */ + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date submittime; /** * 删除(0未删除 1已删除) diff --git a/src/main/java/com/msdw/tms/entity/SignatureEntity.java b/src/main/java/com/msdw/tms/entity/SignatureEntity.java new file mode 100644 index 0000000..1df9cff --- /dev/null +++ b/src/main/java/com/msdw/tms/entity/SignatureEntity.java @@ -0,0 +1,22 @@ +package com.msdw.tms.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * 老师签名 + */ +@Data +@Accessors(chain = true) +@TableName("tms_signature") +public class SignatureEntity { + //主键id + private Integer id; + //老师签名 存放路径 + private String signatureUrl; + //签名名称 + private String signatureName; + //绑定用户id + private Integer userId; +} diff --git a/src/main/java/com/msdw/tms/entity/request/AchievementImportRequest.java b/src/main/java/com/msdw/tms/entity/request/AchievementImportRequest.java new file mode 100644 index 0000000..eb3bf1f --- /dev/null +++ b/src/main/java/com/msdw/tms/entity/request/AchievementImportRequest.java @@ -0,0 +1,38 @@ +package com.msdw.tms.entity.request; + +import com.msdw.tms.common.utils.poi.ExcelAttribute; +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * 班级实验成绩导出模板数据 + */ +@Data +@Accessors(chain = true) +public class AchievementImportRequest { + + //学校 + @ExcelAttribute(sort = 0) + private String schoolName; + + //实验班级 + @ExcelAttribute(sort = 1) + private String experimentalClassName; + + //学生姓名 + @ExcelAttribute(sort = 2) + private String userName; + + //学号 + @ExcelAttribute(sort = 3) + private String workNumber; + + //分数 + @ExcelAttribute(sort = 4) + private String score; + + //提交时间 + @ExcelAttribute(sort = 5) + private String submitTime; + +} diff --git a/src/main/java/com/msdw/tms/entity/vo/AchievementManagementVo.java b/src/main/java/com/msdw/tms/entity/vo/AchievementManagementVo.java new file mode 100644 index 0000000..79132f8 --- /dev/null +++ b/src/main/java/com/msdw/tms/entity/vo/AchievementManagementVo.java @@ -0,0 +1,86 @@ +package com.msdw.tms.entity.vo; + +import com.msdw.tms.common.utils.poi.ExcelAttribute; +import com.msdw.tms.entity.ExperimentalReportEntity; +import com.msdw.tms.entity.ProjectRecordEntity; +import lombok.Data; +import lombok.experimental.Accessors; + +@Data +@Accessors(chain = true) +public class AchievementManagementVo extends ExperimentalReportEntity { + + //=========================================================== 返回参数 + // + private ProjectRecordEntity entity; + + //学校 + private String schoolName; + + //实验班级 + private String experimentalClassName; + + //学生姓名 + private String userName; + + //学号 + private String workNumber; + + //分数 + private String score; + + //提交时间 + private String submitTime; + +//=========================================================== 返回参数 + //项目名称 + private String projectName; + + //分类 + private Integer evaluation; + + //成绩报告数量 + private Integer resportNumber; + + //创建时间 + private String creationTime; + + //类型(1虚拟仿真,2教学实验) + private Integer type; + // + private Integer projectPermissions; + //创建时间 + private String foundTime; + + //实验记录id(tms_experimental_report主键) + private Integer recordId; + + //老师签名 存放路径 + private String signatureUrl; + //签名名称 + private String signatureName; + //评语 + private String comment; + //评语层级id + private Integer level; + //成绩报告数量 + private Integer reportNumber; + //指导老师姓名 + private String teacherName; + //实验名称 + private String evaluationName; + //平台id + private Integer systemId; + +//=========================================================== python实验数据 + //判分点id + private Integer codeId; + //判分点-得分 + private Integer codeScore; + //学生答案 + private String userAnswer; + //参考答案 + private String answer; + //判分点名称 + private String judgmentPointsName; +} diff --git a/src/main/java/com/msdw/tms/entity/vo/AchievementVo.java b/src/main/java/com/msdw/tms/entity/vo/AchievementVo.java new file mode 100644 index 0000000..0a9f371 --- /dev/null +++ b/src/main/java/com/msdw/tms/entity/vo/AchievementVo.java @@ -0,0 +1,26 @@ +package com.msdw.tms.entity.vo; + +import com.msdw.tms.entity.ExperimentalReportEntity; +import com.msdw.tms.entity.ProjectRecordEntity; +import com.msdw.tms.entity.RecordVo; +import lombok.Data; +import lombok.experimental.Accessors; + +@Data +@Accessors(chain = true) +public class AchievementVo extends ExperimentalReportEntity { + + private RecordVo entity; + + //指导老师姓名 + private String teacherName; + + //学生姓名 + private String userName; + + //学号 + private String workNumber; + // + private Integer eventId; + +} diff --git a/src/main/java/com/msdw/tms/entity/vo/CheckVo.java b/src/main/java/com/msdw/tms/entity/vo/CheckVo.java index b695754..9f419f2 100644 --- a/src/main/java/com/msdw/tms/entity/vo/CheckVo.java +++ b/src/main/java/com/msdw/tms/entity/vo/CheckVo.java @@ -32,6 +32,6 @@ public class CheckVo implements Serializable { //密码 private String password; @ApiParam(value = "用户账号") - private String account; + private String opener; } diff --git a/src/main/java/com/msdw/tms/entity/vo/EvaluationDataVo.java b/src/main/java/com/msdw/tms/entity/vo/EvaluationDataVo.java new file mode 100644 index 0000000..7621478 --- /dev/null +++ b/src/main/java/com/msdw/tms/entity/vo/EvaluationDataVo.java @@ -0,0 +1,14 @@ +package com.msdw.tms.entity.vo; + +import lombok.Data; +import lombok.experimental.Accessors; + +@Data +public class EvaluationDataVo { + //分数 + private Integer score; + //判分点名称 + private String judgmentPointsName; + //学生答案 + private String userAnswer; +} diff --git a/src/main/java/com/msdw/tms/entity/vo/ExperimentalTeachingVO.java b/src/main/java/com/msdw/tms/entity/vo/ExperimentalTeachingVO.java new file mode 100644 index 0000000..270246f --- /dev/null +++ b/src/main/java/com/msdw/tms/entity/vo/ExperimentalTeachingVO.java @@ -0,0 +1,21 @@ +package com.msdw.tms.entity.vo; + +import lombok.Data; + +@Data +public class ExperimentalTeachingVO { + //发布类型 + private Integer type; + //启动时间 + private String startTime; + //结束时间 + private String stopTime; + //月份 + private Integer month; + //搜索内容 + private String searchContent; + //状态 + private Integer status; + //学校id + private Integer schoolId; +} diff --git a/src/main/java/com/msdw/tms/entity/vo/ProjectRecordVo.java b/src/main/java/com/msdw/tms/entity/vo/ProjectRecordVo.java index 2ed4e36..09c0fbb 100644 --- a/src/main/java/com/msdw/tms/entity/vo/ProjectRecordVo.java +++ b/src/main/java/com/msdw/tms/entity/vo/ProjectRecordVo.java @@ -39,7 +39,7 @@ public class ProjectRecordVo extends ProjectRecordEntity implements Serializable /** * 总耗时 */ - private Integer totalTime; + private Double totalTime; /** * 平均分 */ diff --git a/src/main/java/com/msdw/tms/entity/vo/RecordVo.java b/src/main/java/com/msdw/tms/entity/vo/RecordVo.java new file mode 100644 index 0000000..d568033 --- /dev/null +++ b/src/main/java/com/msdw/tms/entity/vo/RecordVo.java @@ -0,0 +1,74 @@ +package com.msdw.tms.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableLogic; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import lombok.experimental.Accessors; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; +import java.util.Date; + +/** + * + * + * @author + * @email + * @date 2020-08-19 16:07:02 + */ +@Data +@Accessors(chain = true) +public class RecordVo implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 记录id + */ + private Integer recordid; + /** + * 用户id + */ + private Integer userid; + /** + * 实验项目id + */ + private Integer projectid; + /** + * 得分 + */ + private Integer score; + /** + * 记录状态 + */ + private Integer recordstate; + /** + * 起始时间 + */ + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date startingtime; + /** + * 结束时间 + */ + private Date endtime; + /** + * 耗时 + */ + private Integer timeSum; + /** + * 提交时间 + */ + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date submittime; + /** + * 删除(0未删除 1已删除) + */ + @TableLogic(value = "0",delval = "1") + private Integer isdel; + + private Integer eventId; + +} diff --git a/src/main/java/com/msdw/tms/entity/vo/SearchAchievementVo.java b/src/main/java/com/msdw/tms/entity/vo/SearchAchievementVo.java new file mode 100644 index 0000000..66ae40f --- /dev/null +++ b/src/main/java/com/msdw/tms/entity/vo/SearchAchievementVo.java @@ -0,0 +1,18 @@ +package com.msdw.tms.entity.vo; + +import lombok.Data; +import lombok.experimental.Accessors; + +import java.util.List; + +@Data +@Accessors(chain = true) +public class SearchAchievementVo { + + // + private List ids; + + //项目id + private Integer projectId; + +} diff --git a/src/main/java/com/msdw/tms/service/AchievementManagementService.java b/src/main/java/com/msdw/tms/service/AchievementManagementService.java index 77109c5..f195256 100644 --- a/src/main/java/com/msdw/tms/service/AchievementManagementService.java +++ b/src/main/java/com/msdw/tms/service/AchievementManagementService.java @@ -1,4 +1,31 @@ package com.msdw.tms.service; -public interface AchievementManagementService { +import com.baomidou.mybatisplus.extension.service.IService; +import com.msdw.tms.common.utils.R; +import com.msdw.tms.entity.ExperimentalReportEntity; +import com.msdw.tms.entity.vo.AchievementManagementVo; +import com.msdw.tms.entity.vo.AchievementVo; +import com.msdw.tms.entity.vo.SearchAchievementVo; + +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.List; + +public interface AchievementManagementService extends IService { + + R addReport(AchievementVo entity); + + R queryReport(Integer reportId ); + + R deleteReport(AchievementManagementVo vo); + + R queryEvaluationReport(String searchContant,Integer projectId,Integer page,Integer size); + + void exportAchievement(HttpServletResponse response, String vo) throws Exception; + + R queryAchievement(Integer systemId,Integer projectPermissions, String searchContant, String startingtime, String endtime, Integer month); + + R updateComment(ExperimentalReportEntity entity); + + void updateSignatrue(ExperimentalReportEntity entity); } diff --git a/src/main/java/com/msdw/tms/service/CommentService.java b/src/main/java/com/msdw/tms/service/CommentService.java new file mode 100644 index 0000000..7126fe5 --- /dev/null +++ b/src/main/java/com/msdw/tms/service/CommentService.java @@ -0,0 +1,7 @@ +package com.msdw.tms.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.msdw.tms.entity.CommentEntity; + +public interface CommentService extends IService { +} diff --git a/src/main/java/com/msdw/tms/service/ExperimentalTeachingService.java b/src/main/java/com/msdw/tms/service/ExperimentalTeachingService.java index 9c9777a..3bea116 100644 --- a/src/main/java/com/msdw/tms/service/ExperimentalTeachingService.java +++ b/src/main/java/com/msdw/tms/service/ExperimentalTeachingService.java @@ -5,6 +5,7 @@ import com.msdw.tms.common.utils.PageUtils; import com.msdw.tms.entity.ExperimentalTeachingEntity; import com.msdw.tms.entity.UserEntity; import com.msdw.tms.entity.vo.ExperimentalTeachingEntityVO; +import com.msdw.tms.entity.vo.ExperimentalTeachingVO; import com.msdw.tms.entity.vo.UserEntityVo; import org.springframework.web.bind.annotation.RequestParam; @@ -13,6 +14,6 @@ import java.util.Map; public interface ExperimentalTeachingService extends IService { - PageUtils queryExperimentalTeaching(Integer page, Integer size, ExperimentalTeachingEntityVO vo); + PageUtils queryExperimentalTeaching(Integer page, Integer size, ExperimentalTeachingVO vo); } diff --git a/src/main/java/com/msdw/tms/service/ProjectRecordService.java b/src/main/java/com/msdw/tms/service/ProjectRecordService.java index 957200e..b0588e2 100644 --- a/src/main/java/com/msdw/tms/service/ProjectRecordService.java +++ b/src/main/java/com/msdw/tms/service/ProjectRecordService.java @@ -30,5 +30,7 @@ public interface ProjectRecordService extends IService { PageUtils querySchoolRecord(Integer page,Integer size,ProjectRecordVo projectRecord); boolean updateUserRecord(ProjectRecordEntity projectRecord); + + void updateScore(ProjectRecordEntity vo); } diff --git a/src/main/java/com/msdw/tms/service/SignatureService.java b/src/main/java/com/msdw/tms/service/SignatureService.java new file mode 100644 index 0000000..76c4211 --- /dev/null +++ b/src/main/java/com/msdw/tms/service/SignatureService.java @@ -0,0 +1,18 @@ +package com.msdw.tms.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.msdw.tms.common.utils.FilesResult; +import com.msdw.tms.common.utils.R; +import com.msdw.tms.entity.SignatureEntity; +import org.springframework.web.multipart.MultipartFile; + +import java.io.IOException; + +public interface SignatureService extends IService { + + R uploadSignature(MultipartFile file, Integer userId) throws IOException; + + R querySignature(Integer userId); + + R daleteSignature(SignatureEntity entity); +} diff --git a/src/main/java/com/msdw/tms/service/UserInfoService.java b/src/main/java/com/msdw/tms/service/UserInfoService.java index c4323ff..a0b5def 100644 --- a/src/main/java/com/msdw/tms/service/UserInfoService.java +++ b/src/main/java/com/msdw/tms/service/UserInfoService.java @@ -36,9 +36,16 @@ public interface UserInfoService extends IService { void updateAccount(Integer userId); - R findPassword(String account,Integer type); +// R findPassword(String account,Integer type); R checkCode(CheckVo checkVo); R resetPassword(CheckVo checkVo); + + R findPasswordByPhone(String phone); + + R findPasswordByEmail(String email); + + R queryAccount(); + } diff --git a/src/main/java/com/msdw/tms/service/UserService.java b/src/main/java/com/msdw/tms/service/UserService.java index 4821d31..ff8a84d 100644 --- a/src/main/java/com/msdw/tms/service/UserService.java +++ b/src/main/java/com/msdw/tms/service/UserService.java @@ -28,13 +28,17 @@ public interface UserService extends IService { void insertPersonalInfo(UserPersonalFileEntity personalFile); - boolean bindEmail(CheckVo checkVo); +// boolean bindEmail(CheckVo checkVo); + + R bindEmail(CheckVo checkVo); List findEmailCode(String email,Integer types); List findEmailSetTime(String email,String checkCode,Integer types); - boolean bindPhone(CheckVo checkVo); +// boolean bindPhone(CheckVo checkVo); + + R bindPhone(CheckVo checkVo); List findPhoneCode(String phone,Integer types); @@ -44,11 +48,12 @@ public interface UserService extends IService { boolean queryPhone(CheckVo checkVo); - boolean saveCheckCode(CheckVo checkVo); +// boolean saveCheckCode(CheckVo checkVo); + + R saveCheckCode(CheckVo checkVo); - boolean sendCheckPhoneCode(CheckVo checkVo); +// boolean sendCheckPhoneCode(CheckVo checkVo); - //清空过期验证码 - boolean cleanUp(); + R sendCheckPhoneCode(CheckVo checkVo); } diff --git a/src/main/java/com/msdw/tms/service/impl/AchievementManagementServiceImpl.java b/src/main/java/com/msdw/tms/service/impl/AchievementManagementServiceImpl.java index f699b41..0f70d98 100644 --- a/src/main/java/com/msdw/tms/service/impl/AchievementManagementServiceImpl.java +++ b/src/main/java/com/msdw/tms/service/impl/AchievementManagementServiceImpl.java @@ -1,14 +1,211 @@ package com.msdw.tms.service.impl; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.msdw.tms.common.utils.Constant; +import com.msdw.tms.common.utils.PageUtils; +import com.msdw.tms.common.utils.R; +import com.msdw.tms.common.utils.poi.ExcelExportUtil; import com.msdw.tms.dao.AchievementManagementDao; +import com.msdw.tms.dao.ExperimentalTeachingDao; +import com.msdw.tms.dao.ProjectRecordDao; +import com.msdw.tms.dao.UserInfoDao; +import com.msdw.tms.entity.ExperimentalReportEntity; +import com.msdw.tms.entity.ProjectRecordEntity; +import com.msdw.tms.entity.RecordVo; +import com.msdw.tms.entity.StudentEntity; +import com.msdw.tms.entity.request.AchievementImportRequest; +import com.msdw.tms.entity.vo.AchievementManagementVo; +import com.msdw.tms.entity.vo.AchievementVo; import com.msdw.tms.service.AchievementManagementService; +import lombok.extern.slf4j.Slf4j; +import org.apache.poi.ss.formula.functions.T; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.core.io.ClassPathResource; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import javax.servlet.http.HttpServletResponse; +import java.io.InputStream; +import java.util.*; +@Slf4j @Service -public class AchievementManagementServiceImpl implements AchievementManagementService { +public class AchievementManagementServiceImpl extends ServiceImpl implements AchievementManagementService { @Autowired private AchievementManagementDao achievementManagementDao; + @Autowired + private ProjectRecordDao projectRecordDao; + + @Autowired + private ExperimentalTeachingDao experimentalTeachingDao; + + @Autowired + private UserInfoDao userInfoDao; + + @Override + @Transactional + public R addReport(AchievementVo entity) { + RecordVo record = entity.getEntity(); + //1.信息校验 + String userName = entity.getUserName(); + Integer userid = record.getUserid(); + String teacherName = entity.getTeacherName(); + //获取学生id和用户id + StudentEntity student = userInfoDao.queryStudentId(userName,userid); + //获取学生姓名 + List studentName = userInfoDao.queryStudentName(userid); + if (studentName.size()==0){ + return R.error("不存在的学生姓名"); + }else if (student==null){ + log.info("学生姓名和用户id不匹配!!!"); + return R.error("错误的个人信息!"); + } + + //2.根据实验得分 自动获取评语信息 + + //3.将评语对应的commentId放入entity以便一齐存入实验报告表 + //(无判分系统暂写commentId=4,score=100) + entity.setCommentId(4); + record.setScore(100); + //4.添加实验记录表信息 + + projectRecordDao.addReport(record);//保存至tms_project_record并返回主键 + //5.添加实验报告表信息 + entity.setStudentId(student.getStudentId()).setEventId(record.getEventId()); + achievementManagementDao.addReport(entity); + + return R.ok(); + } + + @Override + public R queryReport(Integer reportId) { + HashMap map = new HashMap<>(); + AchievementManagementVo report = achievementManagementDao.queryReport(reportId); + Integer eventId = report.getEventId(); + ProjectRecordEntity record = projectRecordDao.queryReport(eventId); + String userName = userInfoDao.queryUserReport(record.getUserid()); + if (report.getProjectId()!=null){ + String evaluationName = achievementManagementDao.queryEvaluationName(report.getProjectId()); + report.setEvaluationName(evaluationName); + } + //python实验数据 + Integer systemId = report.getSystemId(); + if (systemId==1|systemId==4|systemId==5) { + List data = achievementManagementDao.queryPythonTest(eventId); + map.put("data", data); + } + report.setUserName(userName); + map.put("report",report); + map.put("record",record); + return R.ok().put("data",map); + } + + @Override + @Transactional + public R deleteReport(AchievementManagementVo vo) { + achievementManagementDao.deleteReport(vo); + return R.ok(); + } + + @Override + public R queryEvaluationReport(String searchContant,Integer projectId,Integer page,Integer size) { + Page tPage = new Page<>(page,size); + IPage data = achievementManagementDao.queryEvaluationReport(tPage,searchContant,projectId); + PageUtils result = new PageUtils(data); + + return R.ok().put("data",result); + } + + @Override + public void exportAchievement(HttpServletResponse response, String ids) throws Exception { + //1.获取数据 + List list = new ArrayList<>(); + + String[] split = ids.split(","); + for (int i = 0;i achievement = achievementManagementDao.queryAchievement(list); + + //2.加载模板流数据 + ClassPathResource resource = new ClassPathResource("excel-template/川大成绩管理实验记录导出模板.xlsx"); + InputStream inputStream = resource.getInputStream(); + + //3、通过工具类下载文件 + new ExcelExportUtil(AchievementImportRequest.class, Constant.ROW_INDEX, Constant.STYLE_INDEX). + export(response, inputStream, achievement, "班级实验成绩.xlsx"); + } + + @Override + public R queryAchievement(Integer systemId,Integer projectPermissions, String searchContant, String startingtime, + String endtime, Integer month) { + try { + List fictitious; + List education; + List vo = new ArrayList<>(); + List educationResult = achievementManagementDao.countEducationProjectId();//获取教学实验的主键id + List fictitiousResult = achievementManagementDao.countFictitiousProjectId();//获取教学实验的主键id + if (projectPermissions==null){projectPermissions=-9999;} + if (projectPermissions==0){//只查询练习项目 + fictitious = achievementManagementDao.queryFictitiousRecord(systemId, searchContant, startingtime, endtime, month, fictitiousResult); + vo = fictitious; + }else if (projectPermissions==1){//只查询考核项目 + education = achievementManagementDao.queryEducationRecord(systemId, searchContant, startingtime, endtime, month, educationResult); + vo = education; + }else {//查询练习+考核项目 + if (educationResult.size() == 0) { + if (fictitiousResult.size() > 0) { + fictitious = achievementManagementDao.queryFictitiousRecord(systemId, searchContant, startingtime, endtime, month, fictitiousResult); + vo = fictitious; + } + } else { + education = achievementManagementDao.queryEducationRecord(systemId, searchContant, startingtime, endtime, month, educationResult); + vo = education; + if (fictitiousResult.size() > 0) { + fictitious = achievementManagementDao.queryFictitiousRecord(systemId, searchContant, startingtime, endtime, month, fictitiousResult); + for (int i = 0; i < fictitious.size(); i++) { + vo.add(fictitious.get(i)); + } + //按创建时间时间排序 + Collections.sort(vo, new Comparator() { + @Override + public int compare(AchievementManagementVo o1, AchievementManagementVo o2) { + int flag = o2.getCreationTime().compareTo(o1.getCreationTime()); + return flag; + } + }); + } + } + } + return R.ok().put("data",vo); + }catch (RuntimeException e){ + log.info(e.getMessage()); + return R.error(500,"系统异常!!!"); + } + } + + @Override + @Transactional + public R updateComment(ExperimentalReportEntity entity) { + + achievementManagementDao.updateComment(entity); + return R.ok(); + } + + @Override + @Transactional + public void updateSignatrue(ExperimentalReportEntity entity) { + Integer isSignature = entity.getIsSignature(); + Integer signatureId = entity.getSignatureId(); + Integer reportId = entity.getReportId(); + if (isSignature==1){ + achievementManagementDao.updateSignatrue(1,signatureId,reportId); + }else { + achievementManagementDao.updateSignatrue(0,null,reportId); + } + } + } diff --git a/src/main/java/com/msdw/tms/service/impl/CommentServiceImpl.java b/src/main/java/com/msdw/tms/service/impl/CommentServiceImpl.java new file mode 100644 index 0000000..cdc2466 --- /dev/null +++ b/src/main/java/com/msdw/tms/service/impl/CommentServiceImpl.java @@ -0,0 +1,11 @@ +package com.msdw.tms.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.msdw.tms.dao.CommentDao; +import com.msdw.tms.entity.CommentEntity; +import com.msdw.tms.service.CommentService; +import org.springframework.stereotype.Service; + +@Service +public class CommentServiceImpl extends ServiceImpl implements CommentService { +} diff --git a/src/main/java/com/msdw/tms/service/impl/ExperimentalReportServiceImpl.java b/src/main/java/com/msdw/tms/service/impl/ExperimentalReportServiceImpl.java index 3ce92b1..ddd5af7 100644 --- a/src/main/java/com/msdw/tms/service/impl/ExperimentalReportServiceImpl.java +++ b/src/main/java/com/msdw/tms/service/impl/ExperimentalReportServiceImpl.java @@ -4,33 +4,60 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.msdw.tms.common.utils.PageUtils; import com.msdw.tms.common.utils.R; +import com.msdw.tms.dao.AchievementManagementDao; import com.msdw.tms.dao.ExperimentalReportDao; import com.msdw.tms.dao.ExperimentalTeachingDao; import com.msdw.tms.entity.ExperimentalReportEntity; +import com.msdw.tms.entity.vo.AchievementManagementVo; import com.msdw.tms.entity.vo.ExperimentalReportVo; import com.msdw.tms.service.ExperimentalReportService; import org.apache.commons.lang.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.HashMap; +import java.util.List; + @Service public class ExperimentalReportServiceImpl extends ServiceImpl implements ExperimentalReportService { @Autowired private ExperimentalReportDao reportDao; + @Autowired + private AchievementManagementDao achievementManagementDao; + @Override public R queryReport(Integer studentId,Integer projectId,Integer recordId,Integer reportId) { + Integer systemId =reportDao.querySystemId(recordId); ExperimentalReportVo entity = new ExperimentalReportVo(); entity.setRecordId(recordId).setStudentId(studentId).setProjectId(projectId).setReportId(reportId); ExperimentalReportVo result = reportDao.queryReport(entity); - return R.ok().put("data",result); - + //python实验 + HashMap map = new HashMap<>(); + map.put("report",result); + if(systemId==1|systemId==4|systemId==5){ + List data = achievementManagementDao.queryPythonTest(recordId); + map.put("data",data); + return R.ok().put("data",map); + } + return R.ok().put("data",map); } @Override public R queryVirtualReport(Integer recordId) { ExperimentalReportVo result = reportDao.queryVirtualReport(recordId); + Integer systemId =reportDao.querySystemId(recordId); + + //python实验 + if(systemId==1|systemId==4|systemId==5){ + List data = achievementManagementDao.queryPythonTest(recordId); + HashMap map = new HashMap<>(); + map.put("data",data); + map.put("report",result); + return R.ok().put("data",map); + } + return R.ok().put("data",result); } } diff --git a/src/main/java/com/msdw/tms/service/impl/ExperimentalTeachingServiceImpl.java b/src/main/java/com/msdw/tms/service/impl/ExperimentalTeachingServiceImpl.java index acaf061..140fa2c 100644 --- a/src/main/java/com/msdw/tms/service/impl/ExperimentalTeachingServiceImpl.java +++ b/src/main/java/com/msdw/tms/service/impl/ExperimentalTeachingServiceImpl.java @@ -13,6 +13,7 @@ import com.msdw.tms.dao.UserDao; import com.msdw.tms.entity.ExperimentalTeachingEntity; import com.msdw.tms.entity.UserEntity; import com.msdw.tms.entity.vo.ExperimentalTeachingEntityVO; +import com.msdw.tms.entity.vo.ExperimentalTeachingVO; import com.msdw.tms.entity.vo.ProjectRecordVo; import com.msdw.tms.entity.vo.UserEntityVo; import com.msdw.tms.service.ExperimentalTeachingService; @@ -31,19 +32,9 @@ public class ExperimentalTeachingServiceImpl extends ServiceImpl params) { -// -// IPage page = this.page( -// new Query().getPage(params), -// new QueryWrapper() -// ); -// return new PageUtils(page); -// } - @Override @Transactional - public PageUtils queryExperimentalTeaching(Integer page, Integer size, ExperimentalTeachingEntityVO vo) { + public PageUtils queryExperimentalTeaching(Integer page, Integer size, ExperimentalTeachingVO vo) { ProjectRecordVo recordVo = new ProjectRecordVo(); recordVo.setStartTime(vo.getStartTime()).setEndTime(vo.getStopTime()); classTeachingDao.updateSurplusTimeNull(recordVo);//将已结束的实验的倒计时重置为0 @@ -59,12 +50,5 @@ public class ExperimentalTeachingServiceImpl extends ServiceImpl page1 = new Page<>(page, size); -// ExperimentalTeachingDao userDao = this.getBaseMapper(); -// IPage list = userDao.queryExperimentalTeaching(page1, vo); -// PageUtils pageUtils = new PageUtils(list); -// return pageUtils; -// } + } diff --git a/src/main/java/com/msdw/tms/service/impl/ProjectRecordServiceImpl.java b/src/main/java/com/msdw/tms/service/impl/ProjectRecordServiceImpl.java index e27ed14..8a92e16 100644 --- a/src/main/java/com/msdw/tms/service/impl/ProjectRecordServiceImpl.java +++ b/src/main/java/com/msdw/tms/service/impl/ProjectRecordServiceImpl.java @@ -21,6 +21,7 @@ import org.springframework.stereotype.Service; import javax.servlet.http.HttpServletResponse; import java.io.InputStream; +import java.text.DecimalFormat; import java.util.List; import java.util.stream.Collectors; @@ -66,11 +67,18 @@ public class ProjectRecordServiceImpl extends ServiceImpl importRequests = projectRecordVos.stream().map(project -> { ExperimentProjectRecordImportRequest request = new ExperimentProjectRecordImportRequest(); BeanUtils.copyProperties(project, request); -// request.setUserRecordstate(project.getRecordstate().equals(1) ? "已完成":"待评分"); return request; }).collect(Collectors.toList()); @@ -143,4 +150,9 @@ public class ProjectRecordServiceImpl extends ServiceImpl implements SignatureService { + + @Autowired + private SignatureDao signatureDao; + + @Autowired + AliyunOssServiceImpl ossService; + + @Override + @Transactional + public R uploadSignature(MultipartFile file, Integer userId) throws IOException { + String roleIds = signatureDao.queryRoleIds(userId); + if (roleIds==null){ + return R.error("不存在的角色"); + }else if (!roleIds.contains("3")){ + return R.error("您的身份不是老师,不能进行此操作!"); + } + //图片格式校验 +// String reg = ".+(.JPEG|.jpeg|.JPG|.jpg|.GIF|.gif|.BMP|.bmp|.PNG|.png)$"; +// if (StringUtils.isBlank(file.getOriginalFilename()) +// || !file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")).matches(reg)) { +// return R.error("图片格式不对!!!"); +// } + FilesResult result = ossService.uploadFiles(file);//上传图片 + SignatureEntity entity = new SignatureEntity().setSignatureUrl(result.getFileUrl()).setSignatureName(result.getFileName()).setUserId(userId); + this.save(entity); + return R.ok(); + } + + @Override + public R querySignature(Integer userId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("user_id",userId); + List entity = signatureDao.selectList(queryWrapper); + return R.ok().put("data",entity); + } + + @Override + @Transactional + public R daleteSignature(SignatureEntity entity) { + Integer id = entity.getId(); + SignatureEntity result = this.getById(id); + if (result==null){ + return R.error("不存在的图片"); + } + ossService.deleteFile(result.getSignatureName()); + this.removeById(id); + return R.ok(); + } +} diff --git a/src/main/java/com/msdw/tms/service/impl/UserInfoServiceImpl.java b/src/main/java/com/msdw/tms/service/impl/UserInfoServiceImpl.java index bf9e347..34f45ed 100644 --- a/src/main/java/com/msdw/tms/service/impl/UserInfoServiceImpl.java +++ b/src/main/java/com/msdw/tms/service/impl/UserInfoServiceImpl.java @@ -152,69 +152,11 @@ public class UserInfoServiceImpl extends ServiceImpl vos = userInfoDao.queryUser(account); - int size = vos.size(); - UserInfoEntity entity = vos.get(0); - if (vos.size()==0){ - return R.error("账号不存在"); - }else if (vos.size()>1){ - log.info("存在多个相同账号"); - return R.error("账号异常,请联系管理员!!!"); - } - CheckCodeUtils utils = new CheckCodeUtils(); - String code = utils.sendCode(); - CheckVo checkVo = new CheckVo(); - String key = account+UUID.randomUUID().toString().replace("-", ""); - - if (type==1){//通过邮箱验证 - EmailUtils.sendEmail(entity.getEmail(),code); - ValueOperations ops = stringRedisTemplate.opsForValue(); - ops.set(account, code, 5*60, TimeUnit.SECONDS);//5分钟 - return R.ok().put("data",entity); - - - -// checkVo.setCheckCode(code).setSetTime(utils.letTimes(5)).setUserId(entity.getUserId()).setTypes(1); -// boolean result = userDao.saveCheckCode(checkVo); -// -// if (result) { -// return R.ok().put("data",entity); -// }else { -// return R.error("保存验证码异常"); -// } - }else if (type==2){//通过手机验证 - SendSMS.sendCode(entity.getPhone(),code); - ValueOperations ops = stringRedisTemplate.opsForValue(); - ops.set(account, code, 5*60, TimeUnit.SECONDS);//5分钟 - return R.ok().put("data",entity); - -// checkVo.setCheckCode(code).setSetTime(utils.letTimes(5)).setUserId(entity.getUserId()).setTypes(2); -// boolean result = userDao.saveCheckPhoneCode(checkVo); -// if (result) { -// return R.ok().put("data",entity); -// }else { -// return R.error("保存验证码异常"); -// } - }else { - return R.error("请求验证类型不对!!!"); - } - }catch (RuntimeException e){ - e.printStackTrace(); - return R.error("请求异常!!!"); - } - - } - @Override public R checkCode(CheckVo checkVo) { -// String checkCode = userInfoDao.checkCode(checkVo); ValueOperations ops = stringRedisTemplate.opsForValue(); - String opener = ops.get(checkVo.getAccount()); + String opener = ops.get(checkVo.getOpener()); if (opener==null){ return R.error("验证码已过期或不存在,请重新发送验证码"); }else if (opener.equals(checkVo.getCode())){ @@ -231,4 +173,52 @@ public class UserInfoServiceImpl extends ServiceImpl list = userInfoDao.queryPhone(phone); + switch (list.size()){ + case 0:return R.error("该手机号未绑定账号!!!"); + case 1: + String code = new CheckCodeUtils().sendCode(); + String opener = UUID.randomUUID().toString().replace("-", ""); + SendSMS.sendCode(phone,code); + ValueOperations ops = stringRedisTemplate.opsForValue(); + ops.set(opener, code, 5*60, TimeUnit.SECONDS);//5分钟 + CheckVo checkVo = new CheckVo(); + checkVo.setUserId(list.get(0)).setOpener(opener); + return R.ok().put("data",checkVo); + default: + log.info("该手机号存在绑定多个账号!!!"); + return R.error("该手机号号绑定异常,请联系管理员!"); + } + } + + @Override + public R findPasswordByEmail(String email) { + List list = userInfoDao.queryEmail(email); + switch (list.size()){ + case 0:return R.error("该邮箱未绑定账号!!!"); + case 1: + String code = new CheckCodeUtils().sendCode(); + String opener = UUID.randomUUID().toString().replace("-", ""); + EmailUtils.sendEmail(email,code); + ValueOperations ops = stringRedisTemplate.opsForValue(); + ops.set(opener, code, 5*60, TimeUnit.SECONDS);//5分钟 + CheckVo checkVo = new CheckVo(); + checkVo.setUserId(list.get(0)).setOpener(opener); + return R.ok().put("data",checkVo); + default: + log.info("该邮箱存在绑定多个账号!!!"); + return R.error("该邮箱号绑定异常,请联系管理员!"); + + } + } + + @Override + public R queryAccount() { + userInfoDao.updateUserDetail();//将已被删除的账号恢复 + UserInfoEntity result = userInfoDao.queryUserAccount();//取一个账号 + return R.ok().put("data",result); + } } diff --git a/src/main/java/com/msdw/tms/service/impl/UserServiceImpl.java b/src/main/java/com/msdw/tms/service/impl/UserServiceImpl.java index 7adf2f7..a4503d1 100644 --- a/src/main/java/com/msdw/tms/service/impl/UserServiceImpl.java +++ b/src/main/java/com/msdw/tms/service/impl/UserServiceImpl.java @@ -18,24 +18,22 @@ import com.msdw.tms.entity.vo.UserEntityVo; import com.msdw.tms.entity.vo.UserProsonalEntityVo; import com.msdw.tms.service.UserService; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.core.StringRedisTemplate; +import org.springframework.data.redis.core.ValueOperations; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; +import java.util.concurrent.TimeUnit; @Service("userService") public class UserServiceImpl extends ServiceImpl implements UserService { @Autowired private UserDao userMapper; - @Override - public boolean cleanUp(){ - boolean clean = userMapper.cleanUp(); - return clean; - } + @Autowired + private StringRedisTemplate stringRedisTemplate; + @Override public PageUtils queryPage(Map params) { @@ -81,12 +79,25 @@ public class UserServiceImpl extends ServiceImpl implements userMapper.insertPersonalInfo(personalFile); } - @Transactional @Override - public boolean bindEmail(CheckVo checkVo) { - boolean bind = userMapper.bindEmail(checkVo); - return bind; + public R bindEmail(CheckVo checkVo) { + + ValueOperations ops = stringRedisTemplate.opsForValue(); + String opener = ops.get(checkVo.getOpener());//获取验证码 + + if (opener==null){ + return R.error("验证码已过期或不存在,请重新发送验证码"); + } else if (opener.equals(checkVo.getCode())){ + boolean bind = userMapper.bindEmail(checkVo); + if (bind){ + return R.ok(); + }else { + return R.error("更新失败"); + } + } + return R.error("验证失败"); } + @Transactional @Override public List findEmailCode(String email,Integer types) { @@ -118,38 +129,53 @@ public class UserServiceImpl extends ServiceImpl implements return false; } } - @Override - public boolean saveCheckCode(CheckVo checkVo) { + public R saveCheckCode(CheckVo checkVo) { CheckCodeUtils checkCodeUtils = new CheckCodeUtils(); //获取六位随机数验证码 String code = checkCodeUtils.sendCode(); - EmailUtils.sendEmail(checkVo.getEmail(),code);//发送邮箱验证码 + EmailUtils.sendEmail(checkVo.getEmail(),code);//邮箱验证码,发送至新邮箱 + + String opener = UUID.randomUUID().toString().replace("-", ""); + ValueOperations ops = stringRedisTemplate.opsForValue(); + ops.set(opener, code, 5*60, TimeUnit.SECONDS);//5分钟 - String letTimes = checkCodeUtils.letTimes(5);//设定验证码5分钟内有效 - checkVo.setCheckCode(code).setSetTime(letTimes); - boolean save = userMapper.saveCheckCode(checkVo); - return save; + return R.ok().put("data",opener); } @Override - public boolean sendCheckPhoneCode(CheckVo checkVo) { + public R sendCheckPhoneCode(CheckVo checkVo) { CheckCodeUtils checkCodeUtils = new CheckCodeUtils(); //获取六位随机数验证码 String code = checkCodeUtils.sendCode(); SendSMS.sendCode(checkVo.getPhone(),code);//发送邮箱验证码 - String letTimes = checkCodeUtils.letTimes(5);//设定验证码5分钟内有效 - checkVo.setCheckCode(code).setSetTime(letTimes); - boolean save = userMapper.saveCheckPhoneCode(checkVo); - return save; + String opener = UUID.randomUUID().toString().replace("-", ""); + ValueOperations ops = stringRedisTemplate.opsForValue(); + ops.set(opener, code, 5*60, TimeUnit.SECONDS);//5分钟 + + return R.ok().put("data",opener); + } @Transactional @Override - public boolean bindPhone(CheckVo checkVo) { - boolean bind = userMapper.bindPhone(checkVo); - return bind; + public R bindPhone(CheckVo checkVo) { + ValueOperations ops = stringRedisTemplate.opsForValue(); + String opener = ops.get(checkVo.getOpener());//获取验证码 + if (opener==null){ + return R.error("验证码已过期或不存在,请重新发送验证码"); + } else if (opener.equals(checkVo.getCode())){ + boolean bind = userMapper.bindPhone(checkVo); + if (bind){ + return R.ok(); + }else { + return R.error("更新失败"); + } + + } + return R.error("验证失败"); + } @Transactional @Override diff --git a/src/main/resources/excel-template/川大成绩管理实验记录导出模板.xlsx b/src/main/resources/excel-template/川大成绩管理实验记录导出模板.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..12f33604164911d61f835273ef6d1d0b5c4bc2eb GIT binary patch literal 8865 zcma)i1yozz(l+ic1&X`7v_Nqw?oiyJcyMWO#oeV)+$ruZ#q|&E_Zs)T zcl~><wHEp=9=T5USWw~wBKe|STcV}Tw zSMIKk_s>{ZmYJ@%OAT$` z_dX@Zzb>E}I&Rq?x-E1?N9v&3I3|#4c7HLYT4#S4p44fmZc*Ukqm7G_%PH)ndiWrw zJVK~&n54$LgzN-IVpgTKS5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z(+=HVGkAa-c8?|1pZ&W3|7Vwk|E2l|JM>QvdCCv{WzqKUYJagsPnZ0(ocU{l2Qc3X zUh>~z`(KNGWO9Fx#~l{=y~B^nfAYHjT=`RG_fhxvuG#*F?q58wk}T}6V8sOg>j54t J2PApa`+t}AIB);} literal 0 HcmV?d00001 diff --git a/src/main/resources/mapper/tms/AchievementManagementDao.xml b/src/main/resources/mapper/tms/AchievementManagementDao.xml index b0fd2f0..bf54fa8 100644 --- a/src/main/resources/mapper/tms/AchievementManagementDao.xml +++ b/src/main/resources/mapper/tms/AchievementManagementDao.xml @@ -2,4 +2,277 @@ + + + + + + INSERT INTO tms_experimental_report ( projectId, content, principle, step, analysis, summarize, improvement, commentId, studentId, teacherName, period, laboratory,eventId ) +VALUES + (#{projectId},#{content}, #{principle}, #{step}, #{analysis}, #{summarize}, #{improvement}, #{commentId}, #{studentId}, #{teacherName}, #{period}, #{laboratory},#{eventId}) + + + UPDATE tms_project_record tpr,tms_experimental_report tcr SET tpr.isdel = 1 , tcr.isdel = 1 WHERE tpr.recordid = tcr.eventId AND tcr.reportId = #{reportId} + + + UPDATE tms_experimental_report SET `comment` = #{comment} WHERE reportId = #{reportId} + + + +UPDATE tms_experimental_report SET isSignature = #{isSignature} , signatureId = #{signatureId} WHERE reportId = #{reportId} + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/mapper/tms/ExperimentalReportDao.xml b/src/main/resources/mapper/tms/ExperimentalReportDao.xml index a46cb80..6052511 100644 --- a/src/main/resources/mapper/tms/ExperimentalReportDao.xml +++ b/src/main/resources/mapper/tms/ExperimentalReportDao.xml @@ -19,7 +19,7 @@ SELECT hpm.experimentalGoal AS experiment_goal, tpr.submitTime, tpr.score, - ( SELECT userName FROM hr_user_info WHERE userId = ( SELECT teacherId FROM tms_experimental_report WHERE studentId = #{studentId} AND reportId = #{reportId} AND isdel=0 GROUP BY teacherId) ) AS teacherName, + ter.teacherName, ter.period, ter.laboratory, ter.principle, @@ -30,7 +30,7 @@ SELECT ter.conclusion, ter.summarize, ter.improvement, - ter.`comment` + IFNULL( ter.`comment`, ( SELECT `comment` FROM tms_comment WHERE id = commentId ) ) AS comment FROM hr_user_info u, student stu, @@ -72,4 +72,14 @@ WHERE AND tpr.recordId = #{recordId} AND tpr.isdel = 0 + \ No newline at end of file diff --git a/src/main/resources/mapper/tms/ExperimentalTeachingDao.xml b/src/main/resources/mapper/tms/ExperimentalTeachingDao.xml index 01907bb..654330e 100644 --- a/src/main/resources/mapper/tms/ExperimentalTeachingDao.xml +++ b/src/main/resources/mapper/tms/ExperimentalTeachingDao.xml @@ -31,15 +31,7 @@ AND `status`=#{exp.status,jdbcType=INTEGER} - - - - - - - - - + AND creation_time between #{exp.startTime} and #{exp.stopTime} diff --git a/src/main/resources/mapper/tms/ProjectRecordDao.xml b/src/main/resources/mapper/tms/ProjectRecordDao.xml index c256b36..8d2a04a 100644 --- a/src/main/resources/mapper/tms/ProjectRecordDao.xml +++ b/src/main/resources/mapper/tms/ProjectRecordDao.xml @@ -16,6 +16,11 @@ + +INSERT INTO tms_project_record ( userId, projectId, score, startingTime, endTime, timeSum, submitTime ) +VALUES + (#{userid}, #{projectid}, #{score}, #{startingtime}, now(), #{timeSum}, now()) + @@ -156,6 +167,9 @@ AND tp.projectPermissions =0 + update tms_project_record @@ -164,4 +178,7 @@ where recordId=#{recordid} + + UPDATE tms_project_record SET score = #{score} WHERE recordId = #{recordid} + \ No newline at end of file diff --git a/src/main/resources/mapper/tms/SignatureDao.xml b/src/main/resources/mapper/tms/SignatureDao.xml new file mode 100644 index 0000000..71be7cb --- /dev/null +++ b/src/main/resources/mapper/tms/SignatureDao.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/mapper/tms/UserDao.xml b/src/main/resources/mapper/tms/UserDao.xml index d969685..ba71046 100644 --- a/src/main/resources/mapper/tms/UserDao.xml +++ b/src/main/resources/mapper/tms/UserDao.xml @@ -2,9 +2,6 @@ - - DELETE FROM tms_checkcode WHERE now() > setTime - @@ -203,14 +200,14 @@ VALUES (#{userId},#{personalCareerId},#{schoolId},#{schoolName},#{disciplineId},#{disciplineName},#{professionalId},#{professionalName},#{professionalClassId},#{professionalClassName},NOW()) - - INSERT INTO tms_checkcode ( userId, email, types, checkCode, setTime ) - VALUES - (#{userId},#{email},#{types},#{checkCode},#{setTime}) - - - INSERT INTO tms_checkcode ( userId, phone, types, checkCode, setTime ) - VALUES - (#{userId},#{phone},#{types},#{checkCode},#{setTime}) - + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/mapper/tms/UserInfoDao.xml b/src/main/resources/mapper/tms/UserInfoDao.xml index d4c1089..d214bfd 100644 --- a/src/main/resources/mapper/tms/UserInfoDao.xml +++ b/src/main/resources/mapper/tms/UserInfoDao.xml @@ -210,6 +210,9 @@ update hr_user_info set `password` = #{password} WHERE userId = #{userId} AND isdel = 0 + + UPDATE hr_user_info SET isdel = 0 ,disableAccount = 0 WHERE userId BETWEEN 519 AND 538 AND (isdel = 1 OR disableAccount = 1) + - + SELECT userId,account,`password` FROM hr_user_info WHERE userId BETWEEN 519 AND 538 AND isdel = 0 AND disableAccount = 0 ORDER BY logInNumber , lastLoginTime LIMIT 1 + + + + \ No newline at end of file diff --git a/src/test/java/com/msdw/tms/service/AchievementManagementTest.java b/src/test/java/com/msdw/tms/service/AchievementManagementTest.java new file mode 100644 index 0000000..be68d00 --- /dev/null +++ b/src/test/java/com/msdw/tms/service/AchievementManagementTest.java @@ -0,0 +1,145 @@ +package com.msdw.tms.service; + +import com.msdw.tms.common.utils.R; +import com.msdw.tms.dao.AchievementManagementDao; +import com.msdw.tms.entity.ProjectEntity; +import com.msdw.tms.entity.ProjectRecordEntity; +import com.msdw.tms.entity.request.AchievementImportRequest; +import com.msdw.tms.entity.vo.AchievementManagementVo; +import com.msdw.tms.entity.vo.SearchAchievementVo; +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +@SpringBootTest +public class AchievementManagementTest { + + @Autowired + private AchievementManagementService achievementManagementService; + + @Autowired + private ProjectRecordService projectRecordService; + + @Autowired + AchievementManagementDao achievementManagementDao; + + //测试新增实验记录 +// @Test +// public void addReport(){ +// AchievementManagementVo vo = new AchievementManagementVo(); +// ProjectRecordEntity entity = new ProjectRecordEntity(); +// Date date = new Date(); +// //用户id +// Integer userId = 385; +// +// entity.setUserid(userId) +// .setProjectid(368) +// .setScore(100) +// .setRecordstate(0) +// .setStartingtime(date) +// .setEndtime(date) +// .setSubmittime(date) +// .setTimeSum(0) +// .setIsdel(0); +// vo.setUserId(userId) +// .setEvaluationId(158) +// .setExperimentalGoal("目标2") +// .setPrinciple("原理2") +// .setStep("步骤2") +// .setAnalysis("实验分析2") +// .setSummarize("实验总结2") +// .setImprovement("实验建议2") +// .setCommentId(3) +// .setTeacherId(178) +// .setPeriod("学时") +// .setLaboratory("实验室名称2") +// .setIsSignature(0) +// .setSignatureId(4) +// .setIsdel(0); +// vo.setEntity(entity); +// R r = achievementManagementService.addReport(vo); +// System.out.println(r); +// } + + @Test + public void queryReport(){ + Integer reportId = 4; + Integer recordId = 100; + R r = achievementManagementService.queryReport(reportId); + System.out.println(r); + } + + @Test + public void updateScore(){ + ProjectRecordEntity vo = new ProjectRecordEntity(); + Integer recordId = 100; + Integer score = 99; + vo.setRecordid(recordId).setScore(score); + projectRecordService.updateScore(vo); + } + + @Test + public void daleteReport(){ + Integer reportId = 4; + Integer recordId = 100; + AchievementManagementVo vo = new AchievementManagementVo(); + ProjectRecordEntity entity = new ProjectRecordEntity(); + entity.setRecordid(recordId); + vo.setReportId(reportId); + vo.setEntity(entity); + R r = achievementManagementService.deleteReport(vo); + System.out.println(r); + } + + //测试查询班级实验成绩列表 + @Test + public void queryEvaluationReport(){ + String searchContant = "michonne"; + // String searchContant = ""; + Integer projectId = 368; + Integer page = 1; + Integer size = 2; + R r = achievementManagementService.queryEvaluationReport(searchContant,projectId,page,size); + System.out.println(r); +} + + //筛选查询-教学实验 + @Test + public void queryEvaluationReportByRecordId(){ + Integer month = 1; + Integer systemId = 1; + String searchContent= ""; + String staingTime = ""; + String endTime = ""; + List list = achievementManagementDao.countEducationProjectId(); + List result = achievementManagementDao.queryEducationRecord(systemId, searchContent, staingTime, endTime, month, list); + System.out.println(result); + } + //筛选查询-虚拟实验 + @Test + public void queryFictitiousReportByRecordId(){ + Integer month = null; + Integer systemId = 1; + String searchContent= ""; + String staingTime = ""; + String endTime = ""; + List list = achievementManagementDao.countFictitiousProjectId(); + List result = achievementManagementDao.queryFictitiousRecord(systemId, searchContent, staingTime, endTime, month, list); + System.out.println(result); + } + + @Test + public void testQuery(){ +// String str = "184,185"; + ArrayList integers = new ArrayList<>(); + integers.add(184); + integers.add(185); + + List achievementImportRequests = achievementManagementDao.queryAchievement(integers); + System.out.println(achievementImportRequests); + } +}