功能修复和成绩管理

hehai
mzh820631607 4 years ago
parent f466eba1d8
commit 9eff617749
  1. 6
      pom.xml
  2. 55
      src/main/java/com/msdw/tms/api/AchievementManagementApi.java
  3. 2
      src/main/java/com/msdw/tms/api/ClassTeachingApi.java
  4. 22
      src/main/java/com/msdw/tms/api/CommentApi.java
  5. 3
      src/main/java/com/msdw/tms/api/ExperimentalTeachingControllerApi.java
  6. 24
      src/main/java/com/msdw/tms/api/SignatureApi.java
  7. 14
      src/main/java/com/msdw/tms/api/UserInfoControllerApi.java
  8. 13
      src/main/java/com/msdw/tms/common/utils/ExcelImportHelper.java
  9. 54
      src/main/java/com/msdw/tms/config/PageResult.java
  10. 25
      src/main/java/com/msdw/tms/config/QuartzConfig.java
  11. 25
      src/main/java/com/msdw/tms/config/quartz/CheckCodeQuartz.java
  12. 126
      src/main/java/com/msdw/tms/controller/AchievementManagementController.java
  13. 9
      src/main/java/com/msdw/tms/controller/ClassTeachingController.java
  14. 50
      src/main/java/com/msdw/tms/controller/Commentcontroller.java
  15. 6
      src/main/java/com/msdw/tms/controller/ExperimentalTeachingController.java
  16. 13
      src/main/java/com/msdw/tms/controller/ProjectRecordController.java
  17. 69
      src/main/java/com/msdw/tms/controller/SignatureController.java
  18. 66
      src/main/java/com/msdw/tms/controller/UserController.java
  19. 29
      src/main/java/com/msdw/tms/controller/UserInfoController.java
  20. 45
      src/main/java/com/msdw/tms/dao/AchievementManagementDao.java
  21. 9
      src/main/java/com/msdw/tms/dao/CommentDao.java
  22. 3
      src/main/java/com/msdw/tms/dao/ExperimentalReportDao.java
  23. 5
      src/main/java/com/msdw/tms/dao/ExperimentalTeachingDao.java
  24. 7
      src/main/java/com/msdw/tms/dao/ProjectRecordDao.java
  25. 10
      src/main/java/com/msdw/tms/dao/SignatureDao.java
  26. 2
      src/main/java/com/msdw/tms/dao/UserDao.java
  27. 18
      src/main/java/com/msdw/tms/dao/UserInfoDao.java
  28. 14
      src/main/java/com/msdw/tms/entity/AchievementManagementEntity.java
  29. 22
      src/main/java/com/msdw/tms/entity/CommentEntity.java
  30. 10
      src/main/java/com/msdw/tms/entity/ExperimentalReportEntity.java
  31. 6
      src/main/java/com/msdw/tms/entity/ProjectRecordEntity.java
  32. 22
      src/main/java/com/msdw/tms/entity/SignatureEntity.java
  33. 38
      src/main/java/com/msdw/tms/entity/request/AchievementImportRequest.java
  34. 86
      src/main/java/com/msdw/tms/entity/vo/AchievementManagementVo.java
  35. 26
      src/main/java/com/msdw/tms/entity/vo/AchievementVo.java
  36. 2
      src/main/java/com/msdw/tms/entity/vo/CheckVo.java
  37. 14
      src/main/java/com/msdw/tms/entity/vo/EvaluationDataVo.java
  38. 21
      src/main/java/com/msdw/tms/entity/vo/ExperimentalTeachingVO.java
  39. 2
      src/main/java/com/msdw/tms/entity/vo/ProjectRecordVo.java
  40. 74
      src/main/java/com/msdw/tms/entity/vo/RecordVo.java
  41. 18
      src/main/java/com/msdw/tms/entity/vo/SearchAchievementVo.java
  42. 29
      src/main/java/com/msdw/tms/service/AchievementManagementService.java
  43. 7
      src/main/java/com/msdw/tms/service/CommentService.java
  44. 3
      src/main/java/com/msdw/tms/service/ExperimentalTeachingService.java
  45. 2
      src/main/java/com/msdw/tms/service/ProjectRecordService.java
  46. 18
      src/main/java/com/msdw/tms/service/SignatureService.java
  47. 9
      src/main/java/com/msdw/tms/service/UserInfoService.java
  48. 17
      src/main/java/com/msdw/tms/service/UserService.java
  49. 199
      src/main/java/com/msdw/tms/service/impl/AchievementManagementServiceImpl.java
  50. 11
      src/main/java/com/msdw/tms/service/impl/CommentServiceImpl.java
  51. 31
      src/main/java/com/msdw/tms/service/impl/ExperimentalReportServiceImpl.java
  52. 22
      src/main/java/com/msdw/tms/service/impl/ExperimentalTeachingServiceImpl.java
  53. 16
      src/main/java/com/msdw/tms/service/impl/ProjectRecordServiceImpl.java
  54. 74
      src/main/java/com/msdw/tms/service/impl/SignatureServiceImpl.java
  55. 108
      src/main/java/com/msdw/tms/service/impl/UserInfoServiceImpl.java
  56. 78
      src/main/java/com/msdw/tms/service/impl/UserServiceImpl.java
  57. BIN
      src/main/resources/excel-template/川大成绩管理实验记录导出模板.xlsx
  58. 273
      src/main/resources/mapper/tms/AchievementManagementDao.xml
  59. 14
      src/main/resources/mapper/tms/ExperimentalReportDao.xml
  60. 10
      src/main/resources/mapper/tms/ExperimentalTeachingDao.xml
  61. 17
      src/main/resources/mapper/tms/ProjectRecordDao.xml
  62. 20
      src/main/resources/mapper/tms/SignatureDao.xml
  63. 27
      src/main/resources/mapper/tms/UserDao.xml
  64. 18
      src/main/resources/mapper/tms/UserInfoDao.xml
  65. 145
      src/test/java/com/msdw/tms/service/AchievementManagementTest.java

@ -219,6 +219,12 @@
<artifactId>easyexcel</artifactId> <artifactId>easyexcel</artifactId>
<version>2.1.1</version> <version>2.1.1</version>
</dependency> </dependency>
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper</artifactId>
<version>5.1.2</version>
</dependency>
</dependencies> </dependencies>
<build> <build>

@ -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);
}

@ -30,7 +30,7 @@ public interface ClassTeachingApi {
@ApiOperation(value = "查看教学实验报告",notes = "查看教学实验报告") @ApiOperation(value = "查看教学实验报告",notes = "查看教学实验报告")
R queryExperimentalReport(@ApiParam(value = "学生id",required = true) Integer studentId, 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 recordId,
@ApiParam(value = "实验报告主键",required = true) Integer reportId); @ApiParam(value = "实验报告主键",required = true) Integer reportId);

@ -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();
}

@ -22,7 +22,8 @@ public interface ExperimentalTeachingControllerApi {
@ApiParam(name = "status", value = "状态:1、待开始 2、进行中 3、已结束", required = false) Integer status, @ApiParam(name = "status", value = "状态:1、待开始 2、进行中 3、已结束", required = false) Integer status,
@ApiParam(name = "startTime", value = "开始时间", required = false) String startTime, @ApiParam(name = "startTime", value = "开始时间", required = false) String startTime,
@ApiParam(name = "stopTime", value = "结束时间", required = false) String stopTime, @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 = "添加实验教学") @ApiOperation(value = "添加实验教学",notes = "添加实验教学")
R save(ExperimentalTeachingEntity experimentalTeachingEntity) throws ParseException; R save(ExperimentalTeachingEntity experimentalTeachingEntity) throws ParseException;

@ -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);
}

@ -9,6 +9,7 @@ import com.msdw.tms.entity.vo.UserProsonalEntityVo;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; 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.PathVariable;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
@ -28,14 +29,19 @@ public interface UserInfoControllerApi {
@ApiOperation(value = "个人中心-信息修改",notes = "个人中心-信息修改") @ApiOperation(value = "个人中心-信息修改",notes = "个人中心-信息修改")
R updateUser(UserProsonalEntityVo userProsonalEntityVo); R updateUser(UserProsonalEntityVo userProsonalEntityVo);
@ApiOperation(value = "发送验证码",notes = "发送验证码") @ApiOperation(value = "发送手机验证码",notes = "发送手机验证码")
R findPassword(@ApiParam(value = "账号",required = true) String account, R findPasswordByPhone(@ApiParam(value = "手机号",required = true) String email);
@ApiParam(value = "发送类型(1邮箱,2手机)",required = true) Integer type);
@ApiOperation(value = "发送邮箱验证码",notes = "发送邮箱验证码")
R findPasswordByEmail(@ApiParam(value = "邮箱号",required = true) String phone);
@ApiOperation(value = "校验验证码",notes = "校验验证码") @ApiOperation(value = "校验验证码",notes = "校验验证码")
// R checkCode(@ApiParam(value = "用户id和验证码") String code,@ApiParam(value = "用户id和验证码")String opener); // 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 = "设置新密码") @ApiOperation(value = "设置新密码",notes = "设置新密码")
R resetPassword(@ApiParam(value = "用户id和密码") CheckVo checkVo); R resetPassword(@ApiParam(value = "用户id和密码") CheckVo checkVo);
@ApiOperation(value = "专家账号",notes = "根据登录次数和时间从20个账号中循环提取")
R GMAccount();
} }

@ -103,10 +103,15 @@ public class ExcelImportHelper {
if (hssfSheet == null) { if (hssfSheet == null) {
continue; continue;
} }
int lastRowNum = hssfSheet.getLastRowNum();
if (lastRowNum==2){
break;
}
// 循环行Row//开始行2 // 循环行Row//开始行2
for (int rowNum = 2; rowNum <= hssfSheet.getLastRowNum(); rowNum++) { for (int rowNum = 2; rowNum <= hssfSheet.getLastRowNum(); rowNum++) {
Row row = hssfSheet.getRow(rowNum); Row row = hssfSheet.getRow(rowNum);
Cell userName;
Cell phone; Cell phone;
Cell email; Cell email;
Cell staffGradeName; Cell staffGradeName;
@ -115,8 +120,14 @@ public class ExcelImportHelper {
Cell staffProfessionalArchitectureNameTwo; Cell staffProfessionalArchitectureNameTwo;
if (row != null) { if (row != null) {
staff = new StaffVo(); staff = new StaffVo();
if (row.getCell(0)!=null){
row.getCell(0).setCellType(CellType.STRING); row.getCell(0).setCellType(CellType.STRING);
Cell userName = row.getCell(0); userName = row.getCell(0);
}else {
continue;
}
row.getCell(1).setCellType(CellType.STRING); row.getCell(1).setCellType(CellType.STRING);
Cell account = row.getCell(1); Cell account = row.getCell(1);
row.getCell(2).setCellType(CellType.STRING); row.getCell(2).setCellType(CellType.STRING);

@ -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 +
'}';
}
}

@ -1,33 +1,14 @@
package com.msdw.tms.config; 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 com.msdw.tms.config.quartz.TimeOutQuartz;
import org.quartz.*; import org.quartz.*;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
@Configuration @Configuration
public class CheckCodeQuartzConfig { public class QuartzConfig {
//定义任务详情
@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();
}
//定义任务详情 //定义任务详情
@Bean @Bean
public JobDetail timeOutJob() { public JobDetail timeOutJob() {

@ -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("清理过期验证码");
}
}

@ -1,13 +1,131 @@
package com.msdw.tms.controller; 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.AchievementManagementService;
import com.msdw.tms.service.ProjectRecordService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
/**
* 成绩管理
*/
@RestController @RestController
@RequestMapping("/Achievement") @RequestMapping("/Achievement")
public class AchievementManagementController { public class AchievementManagementController implements AchievementManagementApi {
@Autowired
private AchievementManagementService service;
@Autowired @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 (idsrecordId)
* @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();
}
} }

@ -121,10 +121,6 @@ public class ClassTeachingController implements ClassTeachingApi {
return R.error(400,"邀请码格式错误!!!"); return R.error(400,"邀请码格式错误!!!");
} }
} }
// else{
// return R.error("输入有误,无需邀请码");
// }
// }
//查看成绩 //查看成绩
@Override @Override
@ -148,13 +144,12 @@ public class ClassTeachingController implements ClassTeachingApi {
/** /**
* 学生查看实验报告 * 学生查看实验报告
* @param entity * @param
* @return * @return
*/ */
@Override @Override
@GetMapping("/queryExperimentalReport") @GetMapping("/queryExperimentalReport")
public R queryExperimentalReport(@RequestParam Integer studentId,@RequestParam Integer projectId,@RequestParam Integer recordId,@RequestParam Integer reportId){ 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(); ExperimentalReportVo entity = new ExperimentalReportVo();
R result = experimentalReportService.queryReport(studentId,projectId,recordId,reportId); R result = experimentalReportService.queryReport(studentId,projectId,recordId,reportId);
@ -163,7 +158,7 @@ public class ClassTeachingController implements ClassTeachingApi {
/** /**
* 学生查看虚拟实验报告 * 学生查看虚拟实验报告
* @param entity * @param
* @return * @return
*/ */
@Override @Override

@ -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<CommentEntity> result = commentService.list();
return R.ok().put("data",result);
}
}

@ -9,6 +9,7 @@ import com.msdw.tms.common.utils.R;
import com.msdw.tms.entity.ExperimentalTeachingEntity; import com.msdw.tms.entity.ExperimentalTeachingEntity;
import com.msdw.tms.entity.UserEntity; import com.msdw.tms.entity.UserEntity;
import com.msdw.tms.entity.vo.ExperimentalTeachingEntityVO; 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.entity.vo.UserEntityVo;
import com.msdw.tms.service.ExperimentalTeachingService; import com.msdw.tms.service.ExperimentalTeachingService;
import com.msdw.tms.service.UserService; import com.msdw.tms.service.UserService;
@ -51,8 +52,9 @@ public class ExperimentalTeachingController implements ExperimentalTeachingContr
@GetMapping("/list") @GetMapping("/list")
public R list(@RequestParam Integer page, public R list(@RequestParam Integer page,
@RequestParam Integer size, @RequestParam Integer size,
Integer month, Integer type, Integer status, String startTime, String stopTime, String searchContent){ Integer month, Integer type, Integer status, String startTime, String stopTime, String searchContent,@RequestParam Integer schoolId){
ExperimentalTeachingEntityVO vo = new ExperimentalTeachingEntityVO(); ExperimentalTeachingVO vo = new ExperimentalTeachingVO();
vo.setSchoolId(schoolId);
if (month!=null){ if (month!=null){
vo.setMonth(month); vo.setMonth(month);
} }

@ -95,19 +95,6 @@ public class ProjectRecordController implements ProjectRcordControllerApi {
return R.ok().put("data", projectRecord); 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 * @param response

@ -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;
}
}

@ -141,52 +141,34 @@ public class UserController implements UserControllerApi {
/** /**
* 发送邮箱验证码 * 发送邮箱验证码
* @param checkVo * @param checkVo (email)
* @return * @return R 参数 opener
*/ */
@Override @Override
@PostMapping("/sendEmailCode") @PostMapping("/sendEmailCode")
public R sendEmailCode(@RequestBody CheckVo checkVo){ public R sendEmailCode(@RequestBody CheckVo checkVo){
boolean re = userService.queryEmial(checkVo); boolean re = userService.queryEmial(checkVo);//查询新邮箱号是否存在重复
if (re){ if (re){
return R.error(403,"邮箱号不能重复"); return R.error(403,"邮箱号不能重复");
}else{ }else{
boolean save = userService.saveCheckCode(checkVo); R save = userService.saveCheckCode(checkVo);
return save ? R.ok() : R.error(); return save;
} }
} }
/** /**
* 校验邮箱验证码通过则更新邮箱 * 校验邮箱验证码通过则更新邮箱
* @param checkVo * @param checkVo useId email code opener
* @return * @return R
*/ */
@Override @Override
@PutMapping("/bingEmail") @PutMapping("/bingEmail")
public R bindEmail(@RequestBody CheckVo checkVo) { public R bindEmail(@RequestBody CheckVo checkVo) {
R result = userService.bindEmail(checkVo);
String email = checkVo.getEmail(); return result;
Integer types = checkVo.getTypes();
List<String> emailCode = userService.findEmailCode(email,types);//获取最近的验证码
if (emailCode.size()==1){
String checkCode = emailCode.get(0);
List<String> 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,"请发送验证码!!!");
}
} }
/** /**
* 发送手机验证码 * 发送手机验证码
* @param checkVo * @param checkVo
@ -199,37 +181,21 @@ public class UserController implements UserControllerApi {
if (re){ if (re){
return R.error(403,"电话号码不能重复"); return R.error(403,"电话号码不能重复");
}else { }else {
boolean save = userService.sendCheckPhoneCode(checkVo); R result = userService.sendCheckPhoneCode(checkVo);
return save ? R.ok() : R.error(); return result;
} }
} }
/** /**
* 绑定手机 * 绑定手机
* @param checkVo * @param checkVo (userId phonecodeopener)
* @return * @return
*/ */
@Override @Override
@PutMapping("/bindPhone") @PutMapping("/bindPhone")
public R bindPhone(@RequestBody CheckVo checkVo){ public R bindPhone(@RequestBody CheckVo checkVo){
String phone = checkVo.getPhone();
Integer types = checkVo.getTypes(); R result = userService.bindPhone(checkVo);
List<String> phoneCode = userService.findPhoneCode(phone,types);//获取最近的验证码 return result;
if (phoneCode.size()==1){
String checkCode = phoneCode.get(0);
List<String> 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,"请发送验证码!!!");
}
} }
} }

@ -112,7 +112,6 @@ public class UserInfoController implements UserInfoControllerApi {
public R userInfo(@PathVariable("id") Integer id){ public R userInfo(@PathVariable("id") Integer id){
HashMap<String,UserProsonalEntityVo> userEntityVoList = userService.queryUserInfo(id); HashMap<String,UserProsonalEntityVo> userEntityVoList = userService.queryUserInfo(id);
// UserEntityVo userEntityVo = userService.queryUserId(id);
return R.ok().put("data",userEntityVoList); return R.ok().put("data",userEntityVoList);
} }
@ -149,15 +148,25 @@ public class UserInfoController implements UserInfoControllerApi {
} }
/** /**
* 找回密码---发送验证码 * 找回密码---发送验证码---手机
* @param account * @param phone
* @param type
* @return * @return
*/ */
@Override @Override
@GetMapping("/findPassword") @GetMapping("/findPasswordByPhone")
public R findPassword(@RequestParam String account,@RequestParam Integer type){ public R findPasswordByPhone(@RequestParam String phone){
R result = userInfoService.findPassword(account,type); 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; return result;
} }
@ -185,4 +194,10 @@ public class UserInfoController implements UserInfoControllerApi {
return result; return result;
} }
@Override
@GetMapping("/GMAccount")
public R GMAccount(){
R result = userInfoService.queryAccount();
return result;
}
} }

@ -1,7 +1,50 @@
package com.msdw.tms.dao; 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.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.poi.ss.formula.functions.T;
import java.util.List;
@Mapper @Mapper
public interface AchievementManagementDao { public interface AchievementManagementDao extends BaseMapper<ExperimentalReportEntity> {
void addReport(AchievementVo entity);
AchievementManagementVo queryReport(Integer reportId);
void deleteReport(AchievementManagementVo vo);
IPage<AchievementManagementVo> queryEvaluationReport(Page<T> tPage, String searchContant, Integer projectId);
List<AchievementImportRequest> queryAchievement(@Param("ids") List<Integer> ids);
List<AchievementManagementVo> queryFictitiousRecord(Integer systemId,String searchContant, String startingtime, String endtime, Integer month,List<Integer> projectIds);
List<AchievementManagementVo> queryEducationRecord(Integer systemId, String searchContant, String startingtime, String endtime, Integer month,List<Integer> projectIds);
//qiyong
List<AchievementManagementVo> queryFictitiousReport(String searchContant, Integer projectId);
List<Integer> countEducationProjectId();
List<Integer> countFictitiousProjectId();
String queryEvaluationName(Integer projectId);
void updateComment(ExperimentalReportEntity entity);
List<AchievementManagementVo> queryPythonTest(Integer eventId);
void updateSignatrue(Integer isSignature,Integer signatureId,Integer reportId);
} }

@ -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<CommentEntity> {
}

@ -3,6 +3,7 @@ package com.msdw.tms.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.msdw.tms.entity.ExperimentalReportEntity; import com.msdw.tms.entity.ExperimentalReportEntity;
import com.msdw.tms.entity.vo.AchievementManagementVo;
import com.msdw.tms.entity.vo.ExperimentalReportVo; import com.msdw.tms.entity.vo.ExperimentalReportVo;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
@ -12,4 +13,6 @@ public interface ExperimentalReportDao extends BaseMapper<ExperimentalReportEnti
ExperimentalReportVo queryReport(ExperimentalReportVo entity); ExperimentalReportVo queryReport(ExperimentalReportVo entity);
ExperimentalReportVo queryVirtualReport(Integer recordId); ExperimentalReportVo queryVirtualReport(Integer recordId);
Integer querySystemId(Integer recordId);
} }

@ -7,6 +7,7 @@ import com.msdw.tms.common.utils.PageUtils;
import com.msdw.tms.entity.ExperimentalTeachingEntity; import com.msdw.tms.entity.ExperimentalTeachingEntity;
import com.msdw.tms.entity.UserEntity; import com.msdw.tms.entity.UserEntity;
import com.msdw.tms.entity.vo.ExperimentalTeachingEntityVO; 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.entity.vo.UserEntityVo;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
@ -16,5 +17,7 @@ import java.util.List;
@Mapper @Mapper
public interface ExperimentalTeachingDao extends BaseMapper<ExperimentalTeachingEntity> { public interface ExperimentalTeachingDao extends BaseMapper<ExperimentalTeachingEntity> {
IPage<ExperimentalTeachingEntity> queryExperimentalTeaching(Page page1,@Param("exp") ExperimentalTeachingEntityVO request); IPage<ExperimentalTeachingEntity> queryExperimentalTeaching(Page page1,@Param("exp") ExperimentalTeachingVO request);
Integer queryProjectId(Integer evaluationId);
} }

@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.msdw.tms.entity.ProjectRecordEntity; 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.ProjectRecordExportVo;
import com.msdw.tms.entity.vo.ProjectRecordVo; import com.msdw.tms.entity.vo.ProjectRecordVo;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
@ -34,4 +35,10 @@ public interface ProjectRecordDao extends BaseMapper<ProjectRecordEntity> {
boolean updateUserRecord(ProjectRecordEntity projectRecord); boolean updateUserRecord(ProjectRecordEntity projectRecord);
List<ProjectRecordExportVo> getByRecordImport(ProjectRecordEntity projectRecord); List<ProjectRecordExportVo> getByRecordImport(ProjectRecordEntity projectRecord);
void addReport(RecordVo entity);
ProjectRecordEntity queryReport(Integer recordId);
void updateScore(ProjectRecordEntity vo);
} }

@ -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<SignatureEntity> {
String queryRoleIds(Integer userId);
}

@ -13,8 +13,6 @@ import java.util.List;
@Mapper @Mapper
public interface UserDao extends BaseMapper<UserEntity> { public interface UserDao extends BaseMapper<UserEntity> {
boolean cleanUp();
List<Integer> queryEmial(CheckVo checkVo); List<Integer> queryEmial(CheckVo checkVo);
boolean saveCheckCode(CheckVo checkVo); boolean saveCheckCode(CheckVo checkVo);

@ -3,10 +3,7 @@ package com.msdw.tms.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.msdw.tms.entity.StudentEntity; import com.msdw.tms.entity.StudentEntity;
import com.msdw.tms.entity.UserInfoEntity; import com.msdw.tms.entity.UserInfoEntity;
import com.msdw.tms.entity.vo.CheckVo; import com.msdw.tms.entity.vo.*;
import com.msdw.tms.entity.vo.StaffVo;
import com.msdw.tms.entity.vo.StudentVo;
import com.msdw.tms.entity.vo.UserProsonalEntityVo;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import java.util.List; import java.util.List;
@ -56,7 +53,16 @@ public interface UserInfoDao extends BaseMapper<UserInfoEntity> {
List<UserInfoEntity> queryUser(String account); List<UserInfoEntity> queryUser(String account);
String checkCode(CheckVo checkVo);
void resetPassword(CheckVo checkVo); void resetPassword(CheckVo checkVo);
UserInfoEntity queryUserAccount();
void updateUserDetail();
String queryUserReport(Integer userId);
StudentEntity queryStudentId(String userName, Integer userId);
List<String> queryStudentName(Integer userId);
} }

@ -1,14 +0,0 @@
package com.msdw.tms.entity;
import lombok.Data;
import lombok.experimental.Accessors;
/**
* 成绩管理/川大
*/
@Data
@Accessors(chain = true)
public class AchievementManagementEntity {
}

@ -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;
}

@ -33,13 +33,21 @@ public class ExperimentalReportEntity {
//对本实验过程的方法及手段的改进建议 //对本实验过程的方法及手段的改进建议
private String improvement; private String improvement;
//老师评语 //老师评语
private Integer commentId;
//教师评语
private String comment; private String comment;
//绑定学生id //绑定学生id
private Integer studentId; private Integer studentId;
// 绑定老师id // 绑定老师id
private Integer teacherId; // private Integer teacherId;
//学时 //学时
private String period; private String period;
//实验室名称 //实验室名称
private String laboratory; private String laboratory;
//绑定教师签名id
private Integer signatureId;
//是否启用教师签名照
private Integer isSignature;
//绑定项目id
private Integer eventId;
} }

@ -3,8 +3,10 @@ package com.msdw.tms.entity;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic; import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data; import lombok.Data;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; 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; 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; private Date submittime;
/** /**
* 删除(0未删除 1已删除) * 删除(0未删除 1已删除)

@ -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;
}

@ -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;
}

@ -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;
}

@ -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;
}

@ -32,6 +32,6 @@ public class CheckVo implements Serializable {
//密码 //密码
private String password; private String password;
@ApiParam(value = "用户账号") @ApiParam(value = "用户账号")
private String account; private String opener;
} }

@ -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;
}

@ -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;
}

@ -39,7 +39,7 @@ public class ProjectRecordVo extends ProjectRecordEntity implements Serializable
/** /**
* 总耗时 * 总耗时
*/ */
private Integer totalTime; private Double totalTime;
/** /**
* 平均分 * 平均分
*/ */

@ -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;
}

@ -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<Integer> ids;
//项目id
private Integer projectId;
}

@ -1,4 +1,31 @@
package com.msdw.tms.service; 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<ExperimentalReportEntity> {
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);
} }

@ -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<CommentEntity> {
}

@ -5,6 +5,7 @@ import com.msdw.tms.common.utils.PageUtils;
import com.msdw.tms.entity.ExperimentalTeachingEntity; import com.msdw.tms.entity.ExperimentalTeachingEntity;
import com.msdw.tms.entity.UserEntity; import com.msdw.tms.entity.UserEntity;
import com.msdw.tms.entity.vo.ExperimentalTeachingEntityVO; 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.entity.vo.UserEntityVo;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
@ -13,6 +14,6 @@ import java.util.Map;
public interface ExperimentalTeachingService extends IService<ExperimentalTeachingEntity> { public interface ExperimentalTeachingService extends IService<ExperimentalTeachingEntity> {
PageUtils queryExperimentalTeaching(Integer page, Integer size, ExperimentalTeachingEntityVO vo); PageUtils queryExperimentalTeaching(Integer page, Integer size, ExperimentalTeachingVO vo);
} }

@ -30,5 +30,7 @@ public interface ProjectRecordService extends IService<ProjectRecordEntity> {
PageUtils querySchoolRecord(Integer page,Integer size,ProjectRecordVo projectRecord); PageUtils querySchoolRecord(Integer page,Integer size,ProjectRecordVo projectRecord);
boolean updateUserRecord(ProjectRecordEntity projectRecord); boolean updateUserRecord(ProjectRecordEntity projectRecord);
void updateScore(ProjectRecordEntity vo);
} }

@ -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<SignatureEntity> {
R uploadSignature(MultipartFile file, Integer userId) throws IOException;
R querySignature(Integer userId);
R daleteSignature(SignatureEntity entity);
}

@ -36,9 +36,16 @@ public interface UserInfoService extends IService<UserInfoEntity> {
void updateAccount(Integer userId); void updateAccount(Integer userId);
R findPassword(String account,Integer type); // R findPassword(String account,Integer type);
R checkCode(CheckVo checkVo); R checkCode(CheckVo checkVo);
R resetPassword(CheckVo checkVo); R resetPassword(CheckVo checkVo);
R findPasswordByPhone(String phone);
R findPasswordByEmail(String email);
R queryAccount();
} }

@ -28,13 +28,17 @@ public interface UserService extends IService<UserEntity> {
void insertPersonalInfo(UserPersonalFileEntity personalFile); void insertPersonalInfo(UserPersonalFileEntity personalFile);
boolean bindEmail(CheckVo checkVo); // boolean bindEmail(CheckVo checkVo);
R bindEmail(CheckVo checkVo);
List<String> findEmailCode(String email,Integer types); List<String> findEmailCode(String email,Integer types);
List<String> findEmailSetTime(String email,String checkCode,Integer types); List<String> findEmailSetTime(String email,String checkCode,Integer types);
boolean bindPhone(CheckVo checkVo); // boolean bindPhone(CheckVo checkVo);
R bindPhone(CheckVo checkVo);
List<String> findPhoneCode(String phone,Integer types); List<String> findPhoneCode(String phone,Integer types);
@ -44,11 +48,12 @@ public interface UserService extends IService<UserEntity> {
boolean queryPhone(CheckVo checkVo); boolean queryPhone(CheckVo checkVo);
boolean saveCheckCode(CheckVo checkVo); // boolean saveCheckCode(CheckVo checkVo);
R saveCheckCode(CheckVo checkVo);
boolean sendCheckPhoneCode(CheckVo checkVo); // boolean sendCheckPhoneCode(CheckVo checkVo);
//清空过期验证码 R sendCheckPhoneCode(CheckVo checkVo);
boolean cleanUp();
} }

@ -1,14 +1,211 @@
package com.msdw.tms.service.impl; 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.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 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.beans.factory.annotation.Autowired;
import org.springframework.core.io.ClassPathResource;
import org.springframework.stereotype.Service; 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 @Service
public class AchievementManagementServiceImpl implements AchievementManagementService { public class AchievementManagementServiceImpl extends ServiceImpl<AchievementManagementDao, ExperimentalReportEntity> implements AchievementManagementService {
@Autowired @Autowired
private AchievementManagementDao achievementManagementDao; 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<String> 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<String, Object> 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<AchievementManagementVo> 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<T> tPage = new Page<>(page,size);
IPage<AchievementManagementVo> 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<Integer> list = new ArrayList<>();
String[] split = ids.split(",");
for (int i = 0;i<split.length;i++){
list.add(Integer.parseInt(split[i]));
}
List<AchievementImportRequest> 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<AchievementManagementVo> fictitious;
List<AchievementManagementVo> education;
List<AchievementManagementVo> vo = new ArrayList<>();
List<Integer> educationResult = achievementManagementDao.countEducationProjectId();//获取教学实验的主键id
List<Integer> 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<AchievementManagementVo>() {
@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);
}
}
} }

@ -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<CommentDao, CommentEntity> implements CommentService {
}

@ -4,33 +4,60 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.msdw.tms.common.utils.PageUtils; import com.msdw.tms.common.utils.PageUtils;
import com.msdw.tms.common.utils.R; import com.msdw.tms.common.utils.R;
import com.msdw.tms.dao.AchievementManagementDao;
import com.msdw.tms.dao.ExperimentalReportDao; import com.msdw.tms.dao.ExperimentalReportDao;
import com.msdw.tms.dao.ExperimentalTeachingDao; import com.msdw.tms.dao.ExperimentalTeachingDao;
import com.msdw.tms.entity.ExperimentalReportEntity; import com.msdw.tms.entity.ExperimentalReportEntity;
import com.msdw.tms.entity.vo.AchievementManagementVo;
import com.msdw.tms.entity.vo.ExperimentalReportVo; import com.msdw.tms.entity.vo.ExperimentalReportVo;
import com.msdw.tms.service.ExperimentalReportService; import com.msdw.tms.service.ExperimentalReportService;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.List;
@Service @Service
public class ExperimentalReportServiceImpl extends ServiceImpl<ExperimentalReportDao,ExperimentalReportEntity> implements ExperimentalReportService { public class ExperimentalReportServiceImpl extends ServiceImpl<ExperimentalReportDao,ExperimentalReportEntity> implements ExperimentalReportService {
@Autowired @Autowired
private ExperimentalReportDao reportDao; private ExperimentalReportDao reportDao;
@Autowired
private AchievementManagementDao achievementManagementDao;
@Override @Override
public R queryReport(Integer studentId,Integer projectId,Integer recordId,Integer reportId) { public R queryReport(Integer studentId,Integer projectId,Integer recordId,Integer reportId) {
Integer systemId =reportDao.querySystemId(recordId);
ExperimentalReportVo entity = new ExperimentalReportVo(); ExperimentalReportVo entity = new ExperimentalReportVo();
entity.setRecordId(recordId).setStudentId(studentId).setProjectId(projectId).setReportId(reportId); entity.setRecordId(recordId).setStudentId(studentId).setProjectId(projectId).setReportId(reportId);
ExperimentalReportVo result = reportDao.queryReport(entity); ExperimentalReportVo result = reportDao.queryReport(entity);
return R.ok().put("data",result); //python实验
HashMap<String, Object> map = new HashMap<>();
map.put("report",result);
if(systemId==1|systemId==4|systemId==5){
List<AchievementManagementVo> data = achievementManagementDao.queryPythonTest(recordId);
map.put("data",data);
return R.ok().put("data",map);
}
return R.ok().put("data",map);
} }
@Override @Override
public R queryVirtualReport(Integer recordId) { public R queryVirtualReport(Integer recordId) {
ExperimentalReportVo result = reportDao.queryVirtualReport(recordId); ExperimentalReportVo result = reportDao.queryVirtualReport(recordId);
Integer systemId =reportDao.querySystemId(recordId);
//python实验
if(systemId==1|systemId==4|systemId==5){
List<AchievementManagementVo> data = achievementManagementDao.queryPythonTest(recordId);
HashMap<String, Object> map = new HashMap<>();
map.put("data",data);
map.put("report",result);
return R.ok().put("data",map);
}
return R.ok().put("data",result); return R.ok().put("data",result);
} }
} }

@ -13,6 +13,7 @@ import com.msdw.tms.dao.UserDao;
import com.msdw.tms.entity.ExperimentalTeachingEntity; import com.msdw.tms.entity.ExperimentalTeachingEntity;
import com.msdw.tms.entity.UserEntity; import com.msdw.tms.entity.UserEntity;
import com.msdw.tms.entity.vo.ExperimentalTeachingEntityVO; 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.ProjectRecordVo;
import com.msdw.tms.entity.vo.UserEntityVo; import com.msdw.tms.entity.vo.UserEntityVo;
import com.msdw.tms.service.ExperimentalTeachingService; import com.msdw.tms.service.ExperimentalTeachingService;
@ -31,19 +32,9 @@ public class ExperimentalTeachingServiceImpl extends ServiceImpl<ExperimentalTea
@Autowired @Autowired
private ClassTeachingDao classTeachingDao; private ClassTeachingDao classTeachingDao;
// @Override
// public PageUtils queryPage(Map<String, Object> params) {
//
// IPage<ExperimentalTeachingEntity> page = this.page(
// new Query<ExperimentalTeachingEntity>().getPage(params),
// new QueryWrapper<ExperimentalTeachingEntity>()
// );
// return new PageUtils(page);
// }
@Override @Override
@Transactional @Transactional
public PageUtils queryExperimentalTeaching(Integer page, Integer size, ExperimentalTeachingEntityVO vo) { public PageUtils queryExperimentalTeaching(Integer page, Integer size, ExperimentalTeachingVO vo) {
ProjectRecordVo recordVo = new ProjectRecordVo(); ProjectRecordVo recordVo = new ProjectRecordVo();
recordVo.setStartTime(vo.getStartTime()).setEndTime(vo.getStopTime()); recordVo.setStartTime(vo.getStartTime()).setEndTime(vo.getStopTime());
classTeachingDao.updateSurplusTimeNull(recordVo);//将已结束的实验的倒计时重置为0 classTeachingDao.updateSurplusTimeNull(recordVo);//将已结束的实验的倒计时重置为0
@ -59,12 +50,5 @@ public class ExperimentalTeachingServiceImpl extends ServiceImpl<ExperimentalTea
PageUtils pageUtils = new PageUtils(list); PageUtils pageUtils = new PageUtils(list);
return pageUtils; return pageUtils;
} }
// @Override
// public PageUtils queryExperimentalTeaching(Integer page, Integer size, ExperimentalTeachingEntityVO vo) {
// Page<T> page1 = new Page<>(page, size);
// ExperimentalTeachingDao userDao = this.getBaseMapper();
// IPage<ExperimentalTeachingEntity> list = userDao.queryExperimentalTeaching(page1, vo);
// PageUtils pageUtils = new PageUtils(list);
// return pageUtils;
// }
} }

@ -21,6 +21,7 @@ import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.InputStream; import java.io.InputStream;
import java.text.DecimalFormat;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -66,11 +67,18 @@ public class ProjectRecordServiceImpl extends ServiceImpl<ProjectRecordDao, Proj
Integer isdel = Constant.IsDel.NOT_DEL.getType(); Integer isdel = Constant.IsDel.NOT_DEL.getType();
ProjectRecordVo projectRecordVo = this.baseMapper.getByUserScore(userId ,isdel); ProjectRecordVo projectRecordVo = this.baseMapper.getByUserScore(userId ,isdel);
Double totalTime = projectRecordVo.getTotalTime();
if (totalTime!=null) {
DecimalFormat df = new DecimalFormat("0.00");
double time = totalTime / 60;
String format = df.format(time);
projectRecordVo.setTotalTime(Double.parseDouble(format));
}
return projectRecordVo; return projectRecordVo;
} }
//ProjectRecordExportVo
@Override @Override
public void exportProjectRecord(HttpServletResponse response,Integer userId)throws Exception{ public void exportProjectRecord(HttpServletResponse response,Integer userId)throws Exception{
//获取数据 //获取数据
@ -113,7 +121,6 @@ public class ProjectRecordServiceImpl extends ServiceImpl<ProjectRecordDao, Proj
List<ExperimentProjectRecordImportRequest> importRequests = projectRecordVos.stream().map(project -> { List<ExperimentProjectRecordImportRequest> importRequests = projectRecordVos.stream().map(project -> {
ExperimentProjectRecordImportRequest request = new ExperimentProjectRecordImportRequest(); ExperimentProjectRecordImportRequest request = new ExperimentProjectRecordImportRequest();
BeanUtils.copyProperties(project, request); BeanUtils.copyProperties(project, request);
// request.setUserRecordstate(project.getRecordstate().equals(1) ? "已完成":"待评分");
return request; return request;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
@ -143,4 +150,9 @@ public class ProjectRecordServiceImpl extends ServiceImpl<ProjectRecordDao, Proj
boolean result = this.baseMapper.updateUserRecord(projectRecord); boolean result = this.baseMapper.updateUserRecord(projectRecord);
return result; return result;
} }
@Override
public void updateScore(ProjectRecordEntity vo) {
this.baseMapper.updateScore(vo);
}
} }

@ -0,0 +1,74 @@
package com.msdw.tms.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.msdw.tms.common.exception.ExceptionCast;
import com.msdw.tms.common.utils.Constant;
import com.msdw.tms.common.utils.FilesResult;
import com.msdw.tms.common.utils.R;
import com.msdw.tms.dao.SignatureDao;
import com.msdw.tms.dao.UserInfoDao;
import com.msdw.tms.entity.SignatureEntity;
import com.msdw.tms.entity.response.CommonCode;
import com.msdw.tms.entity.vo.StaffVo;
import com.msdw.tms.service.SignatureService;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import java.io.IOException;
import java.util.List;
@Service
public class SignatureServiceImpl extends ServiceImpl<SignatureDao, SignatureEntity> 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<SignatureEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("user_id",userId);
List<SignatureEntity> 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();
}
}

@ -152,69 +152,11 @@ public class UserInfoServiceImpl extends ServiceImpl<UserInfoDao, UserInfoEntity
userInfoDao.setNUM(userId); userInfoDao.setNUM(userId);
} }
@Override
@Transactional
public R findPassword(String account,Integer type) {
try {
List<UserInfoEntity> 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<String, String> 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<String, String> 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 @Override
public R checkCode(CheckVo checkVo) { public R checkCode(CheckVo checkVo) {
// String checkCode = userInfoDao.checkCode(checkVo);
ValueOperations<String, String> ops = stringRedisTemplate.opsForValue(); ValueOperations<String, String> ops = stringRedisTemplate.opsForValue();
String opener = ops.get(checkVo.getAccount()); String opener = ops.get(checkVo.getOpener());
if (opener==null){ if (opener==null){
return R.error("验证码已过期或不存在,请重新发送验证码"); return R.error("验证码已过期或不存在,请重新发送验证码");
}else if (opener.equals(checkVo.getCode())){ }else if (opener.equals(checkVo.getCode())){
@ -231,4 +173,52 @@ public class UserInfoServiceImpl extends ServiceImpl<UserInfoDao, UserInfoEntity
userInfoDao.resetPassword(checkVo); userInfoDao.resetPassword(checkVo);
return R.ok(); return R.ok();
} }
@Override
public R findPasswordByPhone(String phone) {
List<Integer> 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<String, String> 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<Integer> 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<String, String> 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);
}
} }

@ -18,24 +18,22 @@ import com.msdw.tms.entity.vo.UserEntityVo;
import com.msdw.tms.entity.vo.UserProsonalEntityVo; import com.msdw.tms.entity.vo.UserProsonalEntityVo;
import com.msdw.tms.service.UserService; import com.msdw.tms.service.UserService;
import org.springframework.beans.factory.annotation.Autowired; 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.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList; import java.util.*;
import java.util.HashMap; import java.util.concurrent.TimeUnit;
import java.util.List;
import java.util.Map;
@Service("userService") @Service("userService")
public class UserServiceImpl extends ServiceImpl<UserDao, UserEntity> implements UserService { public class UserServiceImpl extends ServiceImpl<UserDao, UserEntity> implements UserService {
@Autowired @Autowired
private UserDao userMapper; private UserDao userMapper;
@Override @Autowired
public boolean cleanUp(){ private StringRedisTemplate stringRedisTemplate;
boolean clean = userMapper.cleanUp();
return clean;
}
@Override @Override
public PageUtils queryPage(Map<String, Object> params) { public PageUtils queryPage(Map<String, Object> params) {
@ -81,12 +79,25 @@ public class UserServiceImpl extends ServiceImpl<UserDao, UserEntity> implements
userMapper.insertPersonalInfo(personalFile); userMapper.insertPersonalInfo(personalFile);
} }
@Transactional
@Override @Override
public boolean bindEmail(CheckVo checkVo) { public R bindEmail(CheckVo checkVo) {
ValueOperations<String, String> 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); boolean bind = userMapper.bindEmail(checkVo);
return bind; if (bind){
return R.ok();
}else {
return R.error("更新失败");
}
}
return R.error("验证失败");
} }
@Transactional @Transactional
@Override @Override
public List<String> findEmailCode(String email,Integer types) { public List<String> findEmailCode(String email,Integer types) {
@ -118,38 +129,53 @@ public class UserServiceImpl extends ServiceImpl<UserDao, UserEntity> implements
return false; return false;
} }
} }
@Override @Override
public boolean saveCheckCode(CheckVo checkVo) { public R saveCheckCode(CheckVo checkVo) {
CheckCodeUtils checkCodeUtils = new CheckCodeUtils(); CheckCodeUtils checkCodeUtils = new CheckCodeUtils();
//获取六位随机数验证码 //获取六位随机数验证码
String code = checkCodeUtils.sendCode(); String code = checkCodeUtils.sendCode();
EmailUtils.sendEmail(checkVo.getEmail(),code);//发送邮箱验证码 EmailUtils.sendEmail(checkVo.getEmail(),code);//邮箱验证码,发送至新邮箱
String opener = UUID.randomUUID().toString().replace("-", "");
ValueOperations<String, String> ops = stringRedisTemplate.opsForValue();
ops.set(opener, code, 5*60, TimeUnit.SECONDS);//5分钟
String letTimes = checkCodeUtils.letTimes(5);//设定验证码5分钟内有效 return R.ok().put("data",opener);
checkVo.setCheckCode(code).setSetTime(letTimes);
boolean save = userMapper.saveCheckCode(checkVo);
return save;
} }
@Override @Override
public boolean sendCheckPhoneCode(CheckVo checkVo) { public R sendCheckPhoneCode(CheckVo checkVo) {
CheckCodeUtils checkCodeUtils = new CheckCodeUtils(); CheckCodeUtils checkCodeUtils = new CheckCodeUtils();
//获取六位随机数验证码 //获取六位随机数验证码
String code = checkCodeUtils.sendCode(); String code = checkCodeUtils.sendCode();
SendSMS.sendCode(checkVo.getPhone(),code);//发送邮箱验证码 SendSMS.sendCode(checkVo.getPhone(),code);//发送邮箱验证码
String letTimes = checkCodeUtils.letTimes(5);//设定验证码5分钟内有效 String opener = UUID.randomUUID().toString().replace("-", "");
checkVo.setCheckCode(code).setSetTime(letTimes); ValueOperations<String, String> ops = stringRedisTemplate.opsForValue();
boolean save = userMapper.saveCheckPhoneCode(checkVo); ops.set(opener, code, 5*60, TimeUnit.SECONDS);//5分钟
return save;
return R.ok().put("data",opener);
} }
@Transactional @Transactional
@Override @Override
public boolean bindPhone(CheckVo checkVo) { public R bindPhone(CheckVo checkVo) {
ValueOperations<String, String> 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); boolean bind = userMapper.bindPhone(checkVo);
return bind; if (bind){
return R.ok();
}else {
return R.error("更新失败");
}
}
return R.error("验证失败");
} }
@Transactional @Transactional
@Override @Override

@ -2,4 +2,277 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.msdw.tms.dao.AchievementManagementDao"> <mapper namespace="com.msdw.tms.dao.AchievementManagementDao">
<resultMap id="achievementMap" type="com.msdw.tms.entity.ExperimentalReportEntity">
<result property="experimentalClassName" column="experimental_class_name"></result>
</resultMap>
<insert id="addReport">
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})
</insert>
<update id="deleteReport">
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>
<update id="updateComment">
UPDATE tms_experimental_report SET `comment` = #{comment} WHERE reportId = #{reportId}
</update>
<update id="updateSignatrue">
UPDATE tms_experimental_report SET isSignature = #{isSignature} , signatureId = #{signatureId} WHERE reportId = #{reportId}
</update>
<select id="queryReport" resultType="com.msdw.tms.entity.vo.AchievementManagementVo">
SELECT
ter.reportId,
IFNULL( ter.`comment`, ( SELECT `comment` FROM tms_comment WHERE id = commentId ) ) AS comment,
ter.projectId,
ter.principle,
ter.content,
ter.step,
ter.`data`,
ter.analysis,
ter.conclusion,
ter.summarize,
ter.improvement,
ter.commentId,
ter.studentId,
ter.teacherName,
ter.period,
ter.laboratory,
ter.eventId,
ter.isSignature,
ter.signatureId,
ter.isdel ,
hpm.projectName,
hpm.systemId,
ts.signature_name AS signatureName,
ts.signature_url AS signatureUrl,
tc.`level`
FROM
tms_experimental_report ter
LEFT JOIN tms_signature ts ON signatureId = ts.id
LEFT JOIN tms_comment tc ON commentId = tc.id
LEFT JOIN tms_project_record AS tpr ON tpr.recordId = ter.eventId
LEFT JOIN hr_project_management AS hpm ON hpm.projectId = tpr.projectId
WHERE
reportId = #{reportId}
</select>
<select id="queryEvaluationReport" resultType="com.msdw.tms.entity.vo.AchievementManagementVo">
SELECT
u.userName,
sch.schoolName,
s.workNumber,
tpr.score,
tpr.submitTime,
tpr.recordId,
tcr.reportId
FROM
hr_project_management hpm,
hr_user_info u,
student s,
tms_project_record tpr,
tms_experimental_report tcr,
school sch
WHERE
hpm.projectId = tpr.projectId
AND tpr.userId = u.userId
AND u.userId = s.userId
AND sch.schoolId = u.schoolId
AND tcr.eventId = tpr.recordId
AND tpr.isdel = 0
AND tcr.isdel = 0
AND u.isdel = 0
AND tpr.projectId = #{projectId}
<if test="searchContant!=null and searchContant!=''"> AND (sch.schoolName LIKE CONCAT('%',#{searchContant},'%') OR u.userName LIKE CONCAT('%',#{searchContant},'%') )</if>
GROUP BY
tcr.reportId
ORDER BY tpr.submitTime DESC
</select>
<select id="queryAchievement" resultType="com.msdw.tms.entity.request.AchievementImportRequest">
SELECT
u.userName,
sch.schoolName,
s.workNumber,
tpr.score,
tpr.submitTime,
tpr.recordId,
tcr.reportId
FROM
hr_project_management hpm,
hr_user_info u,
student s,
tms_project_record tpr,
tms_experimental_report tcr,
school sch
WHERE
hpm.projectId = tpr.projectId
AND tpr.userId = u.userId
AND u.userId = s.userId
AND sch.schoolId = u.schoolId
AND tcr.eventId = tpr.recordId
AND tpr.isdel = 0
AND tcr.isdel = 0
AND u.isdel = 0
<if test="ids.size()>0">
AND recordId IN (
<foreach collection="ids" separator="," item="recordId">
#{recordId}
</foreach>
)
</if>
GROUP BY
tcr.reportId
ORDER BY tpr.submitTime DESC
</select>
<select id="queryFictitiousRecord" resultType="com.msdw.tms.entity.vo.AchievementManagementVo">
SELECT
hpm.projectName,
hpm.creationTime AS creationtime,
hpm.projectPermissions,
count( tcr.reportId ) AS reportNumber,
tcr.projectId,
tcr.reportId,
tpr.recordId
FROM
hr_project_management hpm
LEFT JOIN tms_project_record tpr ON hpm.projectId = tpr.projectId
LEFT JOIN tms_experimental_report tcr ON tpr.recordId = tcr.eventId
WHERE
tpr.isdel = 0
AND tcr.isdel = 0
AND hpm.projectPermissions = 0
<if test="systemId!=null and systemId!=''"> AND hpm.systemId = #{systemId} </if>
<if test="searchContant!=null and searchContant!=''"> and hpm.projectName like concat('%',#{searchContant},'%')</if>
<if test="startingtime!=null and startingtime!='' and endtime!=null and endtime != ''"> and hpm.creationTime between #{endtime} and #{startingtime}</if>
<if test="month!=null and month != ''">and DATE_SUB(CURDATE(), INTERVAL #{month} month ) &lt;= date(hpm.creationTime)</if>
<if test="projectIds.size!=null">
AND tpr.projectId IN (
<foreach collection="projectIds" separator="," item="projectId">
#{projectId}
</foreach>
) </if>
GROUP BY
tcr.reportId
ORDER BY
creationtime DESC,tcr.reportId DESC
</select>
<select id="queryEducationRecord" resultType="com.msdw.tms.entity.vo.AchievementManagementVo">
SELECT
hpm.projectName,
hpm.creationTime AS creationtime,
tet.experimental_class_name,
hpm.projectPermissions,
tcr.projectId,
tcr.reportId,
tpr.recordId,
count( tcr.reportId ) AS reportNumber
FROM
hr_project_management hpm
LEFT JOIN tms_experimental_teaching tet ON tet.project_id = hpm.projectId
LEFT JOIN tms_project_record tpr ON tet.project_id = tpr.projectId
LEFT JOIN tms_experimental_report tcr ON tcr.projectId = tet.id
WHERE
tpr.isdel = 0
AND hpm.projectPermissions = 1
AND tcr.isdel = 0
<if test="systemId!=null and systemId!=''"> AND hpm.systemId = #{systemId} </if>
<if test="searchContant!=null and searchContant!=''"> and hpm.projectName like concat('%',#{searchContant},'%')</if>
<if test="startingtime!=null and startingtime!='' and endtime!=null and endtime != ''"> and hpm.creationTime between #{endtime} and #{startingtime}</if>
<if test="month!=null and month != ''">and DATE_SUB(CURDATE(), INTERVAL #{month} month ) &lt;= date(creation_time)</if>
<if test="projectIds.size!=null">
AND tet.id IN (
<foreach collection="projectIds" separator="," item="projectId">
#{projectId}
</foreach>
) </if>
GROUP BY
tcr.reportId
ORDER BY
creationtime DESC,tcr.reportId DESC
</select>
<select id="queryFictitiousReport" resultType="com.msdw.tms.entity.vo.AchievementManagementVo">
SELECT
u.userName,
sch.schoolName,
s.workNumber,
tpr.score,
tpr.submitTime,
tpr.recordId,
tcr.reportId
FROM
hr_project_management hpm,
hr_user_info u,
student s,
tms_project_record tpr,
tms_experimental_report tcr,
school sch
WHERE
hpm.projectId = tpr.projectId
AND tpr.userId = u.userId
AND u.userId = s.userId
AND sch.schoolId = u.schoolId
AND tcr.eventId = tpr.recordId
AND tpr.isdel = 0
AND tcr.isdel = 0
AND u.isdel = 0
AND tpr.projectId = #{projectId}
<if test="searchContant!=null and searchContant!=''"> AND (sch.schoolName LIKE CONCAT('%',#{searchContant},'%') OR u.userName LIKE CONCAT('%',#{searchContant},'%') )</if>
GROUP BY
tcr.reportId
ORDER BY tpr.submitTime DESC
</select>
<select id="countEducationProjectId" resultType="java.lang.Integer">
SELECT
ter.projectId
FROM
tms_experimental_report ter
LEFT JOIN tms_experimental_teaching tet ON tet.id = ter.projectId
LEFT JOIN hr_project_management hpm ON tet.project_id = hpm.projectId
WHERE
ter.isdel = 0
AND hpm.projectPermissions = 1
AND ter.projectId IS NOT NULL
GROUP BY
ter.projectId
</select>
<select id="countFictitiousProjectId" resultType="java.lang.Integer">
SELECT
tpr.projectId
FROM
tms_project_record tpr
LEFT JOIN hr_project_management hpm ON tpr.projectId = hpm.projectId
WHERE
tpr.isdel = 0
AND hpm.projectPermissions = 0
GROUP BY
tpr.projectId
</select>
<select id="queryEvaluationName" resultType="java.lang.String">
SELECT project_name AS evaluationName FROM tms_experimental_teaching WHERE project_id = #{projectId}
</select>
<select id="queryPythonTest" resultType="com.msdw.tms.entity.vo.AchievementManagementVo">
SELECT
hec.`code` AS userAnswer,
hec.codeId,
if(p.rightAndWrong=0,hsi.score,0) AS codeScore,
hjp.judgmentPointsName,
hjp.experimentcode AS answer
FROM
hr_experiment_code AS hec,
hr_score_index AS hsi,
hr_judgment_points AS hjp,
pointrecord p
WHERE
hjp.judgmentPointsId = hsi.judgmentPointsId
AND hjp.judgmentPointsId = hec.judgmentPointsId
AND p.codeId = hec.codeId
AND hsi.isdel = 0
AND hjp.isdel = 0
AND hec.recordId = #{recordId}
GROUP BY
hec.codeId
ORDER BY
hec.codeId ASC
</select>
</mapper> </mapper>

@ -19,7 +19,7 @@ SELECT
hpm.experimentalGoal AS experiment_goal, hpm.experimentalGoal AS experiment_goal,
tpr.submitTime, tpr.submitTime,
tpr.score, 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.period,
ter.laboratory, ter.laboratory,
ter.principle, ter.principle,
@ -30,7 +30,7 @@ SELECT
ter.conclusion, ter.conclusion,
ter.summarize, ter.summarize,
ter.improvement, ter.improvement,
ter.`comment` IFNULL( ter.`comment`, ( SELECT `comment` FROM tms_comment WHERE id = commentId ) ) AS comment
FROM FROM
hr_user_info u, hr_user_info u,
student stu, student stu,
@ -72,4 +72,14 @@ WHERE
AND tpr.recordId = #{recordId} AND tpr.recordId = #{recordId}
AND tpr.isdel = 0 AND tpr.isdel = 0
</select> </select>
<select id="querySystemId" resultType="java.lang.Integer">
SELECT
systemId
FROM
hr_project_management hpm,
tms_project_record tpr
WHERE
tpr.projectId = hpm.projectId
AND tpr.recordId = #{recordId}
</select>
</mapper> </mapper>

@ -31,15 +31,7 @@
<if test="exp.status!=null"> <if test="exp.status!=null">
AND `status`=#{exp.status,jdbcType=INTEGER} AND `status`=#{exp.status,jdbcType=INTEGER}
</if> </if>
<!-- <if test='exp.month==1'>-->
<!-- AND creation_time>DATE_SUB(CURDATE(), INTERVAL 1 MONTH)-->
<!-- </if>-->
<!-- <if test='exp.month==3'>-->
<!-- AND creation_time>DATE_SUB(CURDATE(), INTERVAL 3 MONTH)-->
<!-- </if>-->
<!-- <if test='exp.month==6'>-->
<!-- AND creation_time>DATE_SUB(CURDATE(), INTERVAL 6 MONTH)-->
<!-- </if>-->
<if test='exp.startTime!=null and exp.stopTime!=null'> <if test='exp.startTime!=null and exp.stopTime!=null'>
AND creation_time between #{exp.startTime} and #{exp.stopTime} AND creation_time between #{exp.startTime} and #{exp.stopTime}
</if> </if>

@ -16,6 +16,11 @@
<result property="isdel" column="isdel"/> <result property="isdel" column="isdel"/>
<result property="experimental_class_name" column="experimentalClassName"/> <result property="experimental_class_name" column="experimentalClassName"/>
</resultMap> </resultMap>
<insert id="addReport" useGeneratedKeys="true" keyProperty="eventId" keyColumn="recordId">
INSERT INTO tms_project_record ( userId, projectId, score, startingTime, endTime, timeSum, submitTime )
VALUES
(#{userid}, #{projectid}, #{score}, #{startingtime}, now(), #{timeSum}, now())
</insert>
<select id="getByUserRecord" resultType="com.msdw.tms.entity.vo.ProjectRecordVo"> <select id="getByUserRecord" resultType="com.msdw.tms.entity.vo.ProjectRecordVo">
SELECT SELECT
@ -63,6 +68,10 @@
tpr.isdel = #{pro.isdel} tpr.isdel = #{pro.isdel}
AND AND
tp.projectPermissions !=0 tp.projectPermissions !=0
AND
ter.eventId = tpr.recordId
ORDER BY
tpr.submitTime DESC
</select> </select>
<select id="getByUserRecordImport" resultType="com.msdw.tms.entity.vo.ProjectRecordExportVo"> <select id="getByUserRecordImport" resultType="com.msdw.tms.entity.vo.ProjectRecordExportVo">
@ -87,6 +96,8 @@
tpr.projectId = tet.project_id tpr.projectId = tet.project_id
AND AND
tp.projectPermissions != 0 tp.projectPermissions != 0
ORDER BY
tpr.submitTime DESC
</select> </select>
<!-- 个人实验预览--> <!-- 个人实验预览-->
@ -156,6 +167,9 @@
AND AND
tp.projectPermissions =0 tp.projectPermissions =0
</select> </select>
<select id="queryReport" resultType="com.msdw.tms.entity.ProjectRecordEntity">
SELECT * FROM tms_project_record WHERE recordId = #{recordId}
</select>
<update id="updateUserRecord" parameterType="com.msdw.tms.entity.ProjectRecordEntity" > <update id="updateUserRecord" parameterType="com.msdw.tms.entity.ProjectRecordEntity" >
update tms_project_record update tms_project_record
@ -164,4 +178,7 @@
where recordId=#{recordid} where recordId=#{recordid}
</update> </update>
<update id="updateScore">
UPDATE tms_project_record SET score = #{score} WHERE recordId = #{recordid}
</update>
</mapper> </mapper>

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.msdw.tms.dao.SignatureDao">
<resultMap id="signatureHashMap" type="com.msdw.tms.entity.SignatureEntity">
<result column="user_id" property="userId"></result>
<result column="signature_name" property="signatureName"></result>
<result column="signature_url" property="signatureUrl"></result>
</resultMap>
<select id="queryRoleIds" resultType="java.lang.String">
SELECT
roleId
FROM
hr_user_info
WHERE
userId = #{userId}
and
isdel = 0
</select>
</mapper>

@ -2,9 +2,6 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.msdw.tms.dao.UserDao"> <mapper namespace="com.msdw.tms.dao.UserDao">
<delete id="cleanUp">
DELETE FROM tms_checkcode WHERE now() > setTime
</delete>
<select id="queryUserInfo" parameterType="com.msdw.tms.entity.UserInfoEntity" resultType="hashMap"> <select id="queryUserInfo" parameterType="com.msdw.tms.entity.UserInfoEntity" resultType="hashMap">
SELECT SELECT
@ -146,10 +143,10 @@
LIMIT 0,1 LIMIT 0,1
</select> </select>
<select id="queryEmial" resultType="java.lang.Integer"> <select id="queryEmial" resultType="java.lang.Integer">
select * from hr_user_info where userId=#{userId} and email = #{email} select * from hr_user_info where email = #{email}
</select> </select>
<select id="queryPhone" resultType="java.lang.Integer"> <select id="queryPhone" resultType="java.lang.Integer">
select * from hr_user_info where userId=#{userId} and phone = #{phone} select * from hr_user_info where phone = #{phone}
</select> </select>
<update id="updateUserPersonal" parameterType="com.msdw.tms.entity.vo.UserProsonalEntityVo"> <update id="updateUserPersonal" parameterType="com.msdw.tms.entity.vo.UserProsonalEntityVo">
@ -203,14 +200,14 @@
VALUES VALUES
(#{userId},#{personalCareerId},#{schoolId},#{schoolName},#{disciplineId},#{disciplineName},#{professionalId},#{professionalName},#{professionalClassId},#{professionalClassName},NOW()) (#{userId},#{personalCareerId},#{schoolId},#{schoolName},#{disciplineId},#{disciplineName},#{professionalId},#{professionalName},#{professionalClassId},#{professionalClassName},NOW())
</insert> </insert>
<insert id="saveCheckCode"> <!-- <insert id="saveCheckCode">-->
INSERT INTO tms_checkcode ( userId, email, types, checkCode, setTime ) <!-- INSERT INTO tms_checkcode ( userId, email, types, checkCode, setTime )-->
VALUES <!-- VALUES-->
(#{userId},#{email},#{types},#{checkCode},#{setTime}) <!-- (#{userId},#{email},#{types},#{checkCode},#{setTime})-->
</insert> <!-- </insert>-->
<insert id="saveCheckPhoneCode"> <!-- <insert id="saveCheckPhoneCode">-->
INSERT INTO tms_checkcode ( userId, phone, types, checkCode, setTime ) <!-- INSERT INTO tms_checkcode ( userId, phone, types, checkCode, setTime )-->
VALUES <!-- VALUES-->
(#{userId},#{phone},#{types},#{checkCode},#{setTime}) <!-- (#{userId},#{phone},#{types},#{checkCode},#{setTime})-->
</insert> <!-- </insert>-->
</mapper> </mapper>

@ -210,6 +210,9 @@
<update id="resetPassword"> <update id="resetPassword">
update hr_user_info set `password` = #{password} WHERE userId = #{userId} AND isdel = 0 update hr_user_info set `password` = #{password} WHERE userId = #{userId} AND isdel = 0
</update> </update>
<update id="updateUserDetail">
UPDATE hr_user_info SET isdel = 0 ,disableAccount = 0 WHERE userId BETWEEN 519 AND 538 AND (isdel = 1 OR disableAccount = 1)
</update>
<select id="queryPersonalFileES" parameterType="com.msdw.tms.entity.UserPersonalFileEntity" <select id="queryPersonalFileES" parameterType="com.msdw.tms.entity.UserPersonalFileEntity"
resultType="hashMap"> resultType="hashMap">
@ -267,13 +270,22 @@
AND s.isdel = 0 AND s.isdel = 0
</select> </select>
<select id="queryEmail" resultType="java.lang.Integer"> <select id="queryEmail" resultType="java.lang.Integer">
select useId from hr_user_info where email = #{email} AND isdel = 0 select userId from hr_user_info where email = #{email} AND isdel = 0
</select> </select>
<select id="queryUser" resultType="com.msdw.tms.entity.UserInfoEntity"> <select id="queryUser" resultType="com.msdw.tms.entity.UserInfoEntity">
select userId,email,phone from hr_user_info where account = #{account} AND isdel = 0 select userId,email,phone from hr_user_info where account = #{account} AND isdel = 0
</select> </select>
<select id="checkCode" resultType="java.lang.String"> <select id="queryUserAccount" resultType="com.msdw.tms.entity.UserInfoEntity">
SELECT checkCode FROM tms_checkcode WHERE userId = #{userId} AND setTime > now() ORDER BY id DESC LIMIT 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
</select>
<select id="queryUserReport" resultType="java.lang.String">
SELECT userName FROM hr_user_info WHERE userId = #{userId}
</select>
<select id="queryStudentId" resultType="com.msdw.tms.entity.StudentEntity">
SELECT u.userId,s.studentId FROM student s,hr_user_info u WHERE u.userId = s.userId AND u.userId = #{userId} AND u.userName = #{userName} AND u.isdel = 0 AND s.isdel = 0
</select>
<select id="queryStudentName" resultType="java.lang.String">
SELECT userName FROM hr_user_info WHERE userId = #{userId} AND isdel = 0
</select> </select>
</mapper> </mapper>

@ -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<Integer> list = achievementManagementDao.countEducationProjectId();
List<AchievementManagementVo> 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<Integer> list = achievementManagementDao.countFictitiousProjectId();
List<AchievementManagementVo> result = achievementManagementDao.queryFictitiousRecord(systemId, searchContent, staingTime, endTime, month, list);
System.out.println(result);
}
@Test
public void testQuery(){
// String str = "184,185";
ArrayList<Integer> integers = new ArrayList<>();
integers.add(184);
integers.add(185);
List<AchievementImportRequest> achievementImportRequests = achievementManagementDao.queryAchievement(integers);
System.out.println(achievementImportRequests);
}
}
Loading…
Cancel
Save