From 2f4a5627eae9a698e3806b925e50b16096711b57 Mon Sep 17 00:00:00 2001 From: "zhiyong.ning" <354350178@qq.com> Date: Mon, 25 Jan 2021 14:39:56 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tms/api/AchievementManagementApi.java | 40 ++++- .../com/msdw/tms/api/ClassTeachingApi.java | 3 - .../tms/api/ProjectRcordControllerApi.java | 5 +- .../msdw/tms/api/StudentControllerApi.java | 3 + .../msdw/tms/api/UserInfoControllerApi.java | 3 + .../java/com/msdw/tms/config/SendSMS.java | 2 +- .../AchievementManagementController.java | 143 ++++++++++++++++- .../controller/ClassTeachingController.java | 7 - .../controller/ProjectRecordController.java | 21 ++- .../tms/controller/StudentController.java | 13 +- .../msdw/tms/controller/UserController.java | 2 +- .../tms/controller/UserInfoController.java | 10 ++ .../tms/dao/AchievementManagementDao.java | 47 ++++-- .../msdw/tms/dao/ExperimentalReportDao.java | 2 - .../com/msdw/tms/dao/ProjectRecordDao.java | 8 +- .../java/com/msdw/tms/dao/StudentDao.java | 2 + .../java/com/msdw/tms/dao/UserInfoDao.java | 1 + .../tms/entity/ExperimentalReportEntity.java | 83 +++++++++- .../msdw/tms/entity/ProjectRecordEntity.java | 2 +- .../com/msdw/tms/entity/ReportEntity.java | 39 +++++ .../com/msdw/tms/entity/ResultsEntity.java | 53 +++++++ ...ntVo.java => AchievementManagementVO.java} | 4 +- .../com/msdw/tms/entity/vo/AchievementVO.java | 30 ++++ .../com/msdw/tms/entity/vo/AchievementVo.java | 26 ---- .../tms/entity/vo/ExperimentalReportVo.java | 2 +- .../tms/entity/vo/JudgmentPointsRuleVO.java | 25 +++ .../msdw/tms/entity/vo/ProjectRecordVo.java | 8 + .../java/com/msdw/tms/entity/vo/RecordVo.java | 23 ++- .../com/msdw/tms/entity/vo/ResultsVo.java | 43 ++++++ .../com/msdw/tms/entity/vo/UserScoreVO.java | 23 +++ .../service/AchievementManagementService.java | 23 ++- .../tms/service/ProjectRecordService.java | 6 +- .../com/msdw/tms/service/StudentService.java | 2 + .../com/msdw/tms/service/UserInfoService.java | 2 + .../AchievementManagementServiceImpl.java | 145 ++++++++++++------ .../impl/ExperimentalReportServiceImpl.java | 10 +- .../impl/ProjectRecordServiceImpl.java | 16 +- .../service/impl/SignatureServiceImpl.java | 12 +- .../tms/service/impl/StudentServiceImpl.java | 10 ++ .../tms/service/impl/UserInfoServiceImpl.java | 6 + .../mapper/tms/AchievementManagementDao.xml | 127 +++++++++++++-- .../resources/mapper/tms/ProjectRecordDao.xml | 31 ++-- src/main/resources/mapper/tms/StudentDao.xml | 18 ++- src/main/resources/mapper/tms/UserInfoDao.xml | 3 + 44 files changed, 899 insertions(+), 185 deletions(-) create mode 100644 src/main/java/com/msdw/tms/entity/ReportEntity.java create mode 100644 src/main/java/com/msdw/tms/entity/ResultsEntity.java rename src/main/java/com/msdw/tms/entity/vo/{AchievementManagementVo.java => AchievementManagementVO.java} (95%) create mode 100644 src/main/java/com/msdw/tms/entity/vo/AchievementVO.java delete mode 100644 src/main/java/com/msdw/tms/entity/vo/AchievementVo.java create mode 100644 src/main/java/com/msdw/tms/entity/vo/JudgmentPointsRuleVO.java create mode 100644 src/main/java/com/msdw/tms/entity/vo/ResultsVo.java create mode 100644 src/main/java/com/msdw/tms/entity/vo/UserScoreVO.java diff --git a/src/main/java/com/msdw/tms/api/AchievementManagementApi.java b/src/main/java/com/msdw/tms/api/AchievementManagementApi.java index 0d76854..ac17681 100644 --- a/src/main/java/com/msdw/tms/api/AchievementManagementApi.java +++ b/src/main/java/com/msdw/tms/api/AchievementManagementApi.java @@ -2,24 +2,50 @@ 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 getTeacher(Integer projectId); + + @ApiOperation(value = "查询用户实验报告",notes = "查询用户实验报告") + R getReport(Integer userId,Integer reportId); + + @ApiOperation(value = "成绩管理列表",notes = "查询成绩管理列表") + R list(@RequestParam(value = "系统id",required = true) Integer systemId, + @RequestParam(value = "分类",required = false) Integer projectPermissions, + @RequestParam(value = "搜索内容",required = false) String searchContant, + @RequestParam(value = "开始时间",required = false) String startTime, + @RequestParam(value = "结束时间",required = false) String endTime, + @RequestParam(value = "月份",required = false) Integer month, + @RequestParam(value = "页码",required = true) Integer page, + @RequestParam(value = "页数大小",required = true) Integer size); + + @ApiOperation(value = "查询实验教学列表",notes = "查询实验教学列表") + R newList(@RequestParam(value = "用户id",required = true) Integer userId, + @RequestParam(value = "搜索内容",required = false) String searchContant, + @RequestParam(value = "开始时间",required = false) String startTime, + @RequestParam(value = "结束时间",required = false) String endTime, + @RequestParam(value = "月份",required = false) Integer month, + @RequestParam(value = "页码",required = true) Integer page, + @RequestParam(value = "页数大小",required = true) Integer size); + + @ApiOperation(value = "成绩管理列表",notes = "查询成绩管理列表") + R reportList(@RequestParam(value = "系统id",required = true) Integer systemId, + @RequestParam(value = "项目id",required = true) Integer projectId, + @RequestParam(value = "搜索内容",required = false) String searchContant, + @RequestParam(value = "页码",required = true) Integer page, + @RequestParam(value = "页数大小",required = true) Integer size); + @ApiOperation(value = "川大新增实验记录",notes = "川大新增实验记录") - R addReport(AchievementVo vo); + R addReport(ExperimentalReportEntity entity); @ApiOperation(value = "查询实验记录",notes = "查询实验记录") R queryReport(@ApiParam(value = "实验报告主键id",required = true) Integer reportId); diff --git a/src/main/java/com/msdw/tms/api/ClassTeachingApi.java b/src/main/java/com/msdw/tms/api/ClassTeachingApi.java index 728604c..711dcac 100644 --- a/src/main/java/com/msdw/tms/api/ClassTeachingApi.java +++ b/src/main/java/com/msdw/tms/api/ClassTeachingApi.java @@ -19,9 +19,6 @@ public interface ClassTeachingApi { R queryTestRecord(Integer page, Integer size, Integer month, String startTime, String endTime, String condition, Integer status,Integer schoolId); - @ApiOperation(value = "查看成绩",notes = "查看成绩") - R queryAchievement(); - @ApiOperation(value = "查看虚拟仿真课程列表",notes = "查看虚拟仿真课程列表") R querySimulationPlayList(Integer page,Integer size); diff --git a/src/main/java/com/msdw/tms/api/ProjectRcordControllerApi.java b/src/main/java/com/msdw/tms/api/ProjectRcordControllerApi.java index 0413b24..44f3b3a 100644 --- a/src/main/java/com/msdw/tms/api/ProjectRcordControllerApi.java +++ b/src/main/java/com/msdw/tms/api/ProjectRcordControllerApi.java @@ -18,11 +18,14 @@ public interface ProjectRcordControllerApi { Integer recordState,String condition); @ApiOperation(value = "用户端虚拟仿真实验记录",notes = "用户端虚拟仿真实验记录") - R queryUserRecord(Integer page,Integer size,Integer userid); + R queryUserRecord(Integer page,Integer size,Integer userId,Integer projectPermissions); @ApiOperation(value = "用户端教学实验记录",notes = "用户端教学实验记录") R getUserExperimentscore(Integer page,Integer size,Integer userid); + @ApiOperation(value = "个人实验概览",notes = "个人实验概览") + R queryScore(Integer userId); + @ApiOperation(value = "个人实验概览",notes = "个人实验概览") R getUserScore(Integer userid); diff --git a/src/main/java/com/msdw/tms/api/StudentControllerApi.java b/src/main/java/com/msdw/tms/api/StudentControllerApi.java index 8289ad3..d4bd3da 100644 --- a/src/main/java/com/msdw/tms/api/StudentControllerApi.java +++ b/src/main/java/com/msdw/tms/api/StudentControllerApi.java @@ -21,6 +21,9 @@ public interface StudentControllerApi { @ApiOperation(value = "学生列表信息",notes = "学生列表信息") public R queryStudent(Integer schoolId, String seachContent, Integer page, Integer size); + @ApiOperation(value = "查询学生详情",notes = "查询学生详情") + public R queryStudentDetails(Integer userId); + @ApiOperation(value = "删除学生",notes = "删除学生") public R daleteStudent(List studentId); diff --git a/src/main/java/com/msdw/tms/api/UserInfoControllerApi.java b/src/main/java/com/msdw/tms/api/UserInfoControllerApi.java index 0d6096e..51edcf5 100644 --- a/src/main/java/com/msdw/tms/api/UserInfoControllerApi.java +++ b/src/main/java/com/msdw/tms/api/UserInfoControllerApi.java @@ -20,6 +20,9 @@ public interface UserInfoControllerApi { // @ApiOperation(value = "个人中心信息修改",notes = "个人中心信息修改") // R update(UserInfoEntity userEntity); + @ApiOperation(value = "根据token获取用户id",notes = "根据token获取用户id") + R getUserId(String token); + @ApiOperation(value = "注册",notes = "注册") R save(UserInfoEntity entity); diff --git a/src/main/java/com/msdw/tms/config/SendSMS.java b/src/main/java/com/msdw/tms/config/SendSMS.java index c0a51f8..f34eb41 100644 --- a/src/main/java/com/msdw/tms/config/SendSMS.java +++ b/src/main/java/com/msdw/tms/config/SendSMS.java @@ -16,7 +16,7 @@ public class SendSMS { private static final String PHONSMSTEMPLATE = "SMS_204155294"; public static void main(String[] args){ - String mobile="17376370737";//需要接受短信验证码的手机号 + String mobile="17722612183";//需要接受短信验证码的手机号 // String sendTemplate="SMS_204155294";//短信模板ID,需要去阿里云平台申请,审核通过后方能使用,通常是以"SMS_"开头字符串 String code = (int)((Math.random() * 9 + 1) * 100000)+ "";//要发送给用户的短信验证码,行业通常使用六位纯数字 diff --git a/src/main/java/com/msdw/tms/controller/AchievementManagementController.java b/src/main/java/com/msdw/tms/controller/AchievementManagementController.java index 9a48af1..066e934 100644 --- a/src/main/java/com/msdw/tms/controller/AchievementManagementController.java +++ b/src/main/java/com/msdw/tms/controller/AchievementManagementController.java @@ -2,10 +2,8 @@ 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.entity.*; +import com.msdw.tms.entity.vo.ResultsVo; import com.msdw.tms.service.AchievementManagementService; import com.msdw.tms.service.ProjectRecordService; import org.springframework.beans.factory.annotation.Autowired; @@ -13,6 +11,7 @@ import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; +import java.util.List; /** * 成绩管理 @@ -26,17 +25,145 @@ public class AchievementManagementController implements AchievementManagementApi @Autowired private ProjectRecordService projectRecordService; + /** + * 查询用户实验报告 + * @param projectId + * @param + * @return + */ + @Override + @GetMapping("/getTeacher") + public R getTeacher(@RequestParam Integer projectId){ + R data = service.getTeacher(projectId); + return data; + } + + /** + * 查询用户实验报告 + * @param userId + * @param reportId + * @param + * @return + */ + @Override + @GetMapping("/getReport") + public R getReport(@RequestParam Integer reportId,@RequestParam Integer userId){ + R data = service.getReport(userId,reportId); + return data; + } + + + + /** + * 查询实验记录 + */ + @Override + @GetMapping("/list") + public R list(@RequestParam(required = true) Integer systemId, + @RequestParam(required = false) Integer projectPermissions, + @RequestParam(required = false) String searchContant, + @RequestParam(required = false) String startTime, + @RequestParam(required = false) String endTime, + @RequestParam(required = false) Integer month, + @RequestParam(required = true) Integer page, + @RequestParam(required = true) Integer size){ + ResultsVo vo = new ResultsVo(); + if (systemId==null){ + return R.error("系统id不能为空!"); + }else{ + vo.setSystemId(systemId); + } + if (projectPermissions!=null){ + vo.setProjectPermissions(projectPermissions); + } + if (searchContant!=null){ + vo.setSearchContant(searchContant); + } + if (startTime!=null){ + vo.setStartTime(startTime); + } + if (endTime!=null){ + vo.setEndTime(endTime); + } + List result = service.list(vo,page,size); + return R.ok().put("data",result); + } + + /** + * 查询实验教学记录 + */ + @Override + @GetMapping("/newList") + public R newList(@RequestParam(required = true) Integer userId, + @RequestParam(required = false) String searchContant, + @RequestParam(required = false) String startTime, + @RequestParam(required = false) String endTime, + @RequestParam(required = false) Integer month, + @RequestParam(required = true) Integer page, + @RequestParam(required = true) Integer size){ + ResultsVo vo = new ResultsVo(); + if (userId==null){ + return R.error("用户id不能为空!"); + }else{ + vo.setUserId(userId); + } + if (searchContant!=null){ + vo.setSearchContant(searchContant); + } + if (startTime!=null){ + vo.setStartTime(startTime); + } + if (endTime!=null){ + vo.setEndTime(endTime); + } + List result = service.newList(vo,page,size); + return R.ok().put("data",result); + } + + /** + * 查询实验记录 + */ + @Override + @GetMapping("/reportList") + public R reportList(@RequestParam(required = true) Integer systemId, + @RequestParam(required = true) Integer projectId, + @RequestParam(required = false) String searchContant, + @RequestParam(required = true) Integer page, + @RequestParam(required = true) Integer size){ + ResultsVo vo = new ResultsVo(); + if (systemId==null||projectId==null){ + return R.error("系统或项目数据不能为空!"); + }else{ + vo.setSystemId(systemId); + vo.setProjectId(projectId); + } + if (searchContant!=null){ + vo.setSearchContant(searchContant); + } + List result = service.reportList(vo,page,size); + return R.ok().put("data",result); + } /** * 提交实验结果--川大 */ @Override @PostMapping("/addReport") - public R addReport(@RequestBody AchievementVo vo){ - R result = service.addReport(vo); - return result; + public R addReport(@RequestBody ExperimentalReportEntity entity){ + R result = service.addReport(entity); + return R.ok().put("reportId",entity.getReportId()); } +// /** +// * 提交实验报告 +// */ +// @Override +// @PostMapping("/add") +// public R add(@RequestBody ExperimentalProjectEntity vo){ +// R result = service.addReport(vo); +// return result; +// } + /** * 查询实验记录 */ @@ -61,7 +188,7 @@ public class AchievementManagementController implements AchievementManagementApi /** * 需求:删除实验记录====管理端删除,但是学生端仍需保留 * 将isdel属性设置为0 - * @param vo (recordid 、reportId) + * @param reportId * @return */ @Override diff --git a/src/main/java/com/msdw/tms/controller/ClassTeachingController.java b/src/main/java/com/msdw/tms/controller/ClassTeachingController.java index a4dcd2a..64d7282 100644 --- a/src/main/java/com/msdw/tms/controller/ClassTeachingController.java +++ b/src/main/java/com/msdw/tms/controller/ClassTeachingController.java @@ -123,13 +123,6 @@ public class ClassTeachingController implements ClassTeachingApi { } } - //查看成绩 - @Override - @GetMapping("/queryAchievement") - public R queryAchievement(){ - return R.ok(); - } - /** * 查看虚拟仿真课程列表信息 * @param page diff --git a/src/main/java/com/msdw/tms/controller/ProjectRecordController.java b/src/main/java/com/msdw/tms/controller/ProjectRecordController.java index cba98ec..0235cb4 100644 --- a/src/main/java/com/msdw/tms/controller/ProjectRecordController.java +++ b/src/main/java/com/msdw/tms/controller/ProjectRecordController.java @@ -3,6 +3,7 @@ package com.msdw.tms.controller; import com.msdw.tms.api.ProjectRcordControllerApi; import com.msdw.tms.common.utils.PageUtils; import com.msdw.tms.common.utils.R; +import com.msdw.tms.entity.ExperimentalReportEntity; import com.msdw.tms.entity.ProjectEntity; import com.msdw.tms.entity.ProjectRecordEntity; import com.msdw.tms.entity.vo.ProjectRecordVo; @@ -13,6 +14,7 @@ import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; import java.util.Arrays; +import java.util.HashMap; import java.util.List; /** @@ -61,9 +63,8 @@ public class ProjectRecordController implements ProjectRcordControllerApi { */ @Override @GetMapping("/user/record") - public R queryUserRecord(@RequestParam Integer page,@RequestParam Integer size,@RequestParam Integer userId){ - PageUtils page1 = projectRecordService.queryPage(page,size,userId); - + public R queryUserRecord(@RequestParam Integer page,@RequestParam Integer size,@RequestParam Integer userId,@RequestParam Integer projectPermissions){ + PageUtils page1 = projectRecordService.queryPage(page,size,userId,projectPermissions); return R.ok().put("data", page1); } @@ -82,6 +83,19 @@ public class ProjectRecordController implements ProjectRcordControllerApi { return R.ok().put("data", page1); } + /** + * 个人实验预览 + * @param userId + * @return + */ + @Override + @GetMapping("/user/queryScore/{userId}") + public R queryScore(@PathVariable("userId") Integer userId){ + ProjectRecordVo projectRecord = projectRecordService.queryScore(userId); + + return R.ok().put("data", projectRecord); + } + /** * 个人实验预览 * @param userid @@ -158,7 +172,6 @@ public class ProjectRecordController implements ProjectRcordControllerApi { @DeleteMapping("/delete") public R delete(@RequestBody Integer[] recordids){ projectRecordService.removeByIds(Arrays.asList(recordids)); - return R.ok(); } diff --git a/src/main/java/com/msdw/tms/controller/StudentController.java b/src/main/java/com/msdw/tms/controller/StudentController.java index 2a457ea..148f6c7 100644 --- a/src/main/java/com/msdw/tms/controller/StudentController.java +++ b/src/main/java/com/msdw/tms/controller/StudentController.java @@ -97,6 +97,18 @@ public class StudentController implements StudentControllerApi{ return R.ok().put("data",query); } + /** + * 学生列表 + * @param userId + * @return + */ + @Override + @GetMapping("/queryStudentDetails") + public R queryStudentDetails(@RequestParam Integer userId){ + R query = studentService.queryStudentDetails(userId); + return query; + } + /** * 批量删除学生 * @param studentId @@ -230,7 +242,6 @@ public class StudentController implements StudentControllerApi{ @Override @GetMapping("/queryAccount") public R queryAccount(String account,Integer schoolId){ - R result = studentService.queryAccount(account,schoolId); return result; } diff --git a/src/main/java/com/msdw/tms/controller/UserController.java b/src/main/java/com/msdw/tms/controller/UserController.java index 2fac63b..7bb6846 100644 --- a/src/main/java/com/msdw/tms/controller/UserController.java +++ b/src/main/java/com/msdw/tms/controller/UserController.java @@ -11,7 +11,7 @@ import com.msdw.tms.entity.vo.UserEntityVo; import com.msdw.tms.entity.vo.UserProsonalEntityVo; import com.msdw.tms.service.UserInfoService; import com.msdw.tms.service.UserService; -import com.sun.org.apache.bcel.internal.generic.CHECKCAST; +//import com.sun.org.apache.bcel.internal.generic.CHECKCAST; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.*; diff --git a/src/main/java/com/msdw/tms/controller/UserInfoController.java b/src/main/java/com/msdw/tms/controller/UserInfoController.java index f3efee3..5f9586a 100644 --- a/src/main/java/com/msdw/tms/controller/UserInfoController.java +++ b/src/main/java/com/msdw/tms/controller/UserInfoController.java @@ -200,4 +200,14 @@ public class UserInfoController implements UserInfoControllerApi { R result = userInfoService.queryAccount(); return result; } + + /** + * 根据token获取用户id + */ + @Override + @GetMapping("/getUserId") + public R getUserId(@RequestParam String token){ + Integer userId = userInfoService.getUserId(token); + return R.ok().put("userId", userId); + } } diff --git a/src/main/java/com/msdw/tms/dao/AchievementManagementDao.java b/src/main/java/com/msdw/tms/dao/AchievementManagementDao.java index b85d7b8..08ff0f9 100644 --- a/src/main/java/com/msdw/tms/dao/AchievementManagementDao.java +++ b/src/main/java/com/msdw/tms/dao/AchievementManagementDao.java @@ -3,12 +3,15 @@ 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.ExperimentalTeachingEntity; +import com.msdw.tms.entity.ReportEntity; +import com.msdw.tms.entity.ResultsEntity; 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 com.msdw.tms.entity.vo.AchievementManagementVO; +import com.msdw.tms.entity.vo.JudgmentPointsRuleVO; +import com.msdw.tms.entity.vo.ResultsVo; +import com.msdw.tms.entity.vo.UserScoreVO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import org.apache.poi.ss.formula.functions.T; @@ -17,23 +20,45 @@ import java.util.List; @Mapper public interface AchievementManagementDao extends BaseMapper { + //查询用户答案 + List getUserAnswers(Integer tradingJudgmentPointsId); - void addReport(AchievementVo entity); + //查询实验报告 + ExperimentalReportEntity getReport(ExperimentalReportEntity experimentalReportEntity); - AchievementManagementVo queryReport(Integer reportId); + List queryTradingJudgmentPointsId(Integer reportId); + + //查询实验报告 + String getTeacher(Integer projectId); + + //查询实验报告 + List getScore(UserScoreVO userScoreVO); + + //成绩管理列表 + List list(ResultsVo vo); + + //成绩管理实验教学列表 + List newList(ResultsVo vo); + + //成绩管理列表 + List reportList(ResultsVo vo); + + void addReport(ExperimentalReportEntity entity); + + AchievementManagementVO queryReport(Integer reportId); void deleteReport(Integer reportId); - IPage queryEvaluationReport(Page tPage, String searchContant, Integer projectId); + IPage queryEvaluationReport(Page tPage, String searchContant, Integer projectId); List queryAchievement(@Param("ids") List ids); - List queryFictitiousRecord(Integer systemId,String searchContant, String startingtime, String endtime, Integer month,List projectIds); + List queryFictitiousRecord(Integer systemId, String searchContant, String startingtime, String endtime, Integer month, List projectIds); - List queryEducationRecord(Integer systemId, String searchContant, String startingtime, String endtime, Integer month,List projectIds); + List queryEducationRecord(Integer systemId, String searchContant, String startingtime, String endtime, Integer month, List projectIds); //qiyong - List queryFictitiousReport(String searchContant, Integer projectId); + List queryFictitiousReport(String searchContant, Integer projectId); List countEducationProjectId(); @@ -44,7 +69,7 @@ public interface AchievementManagementDao extends BaseMapper queryPythonTest(Integer eventId); + List queryPythonTest(Integer eventId); void updateSignatrue(Integer isSignature,Integer signatureId,Integer reportId,String comment); } diff --git a/src/main/java/com/msdw/tms/dao/ExperimentalReportDao.java b/src/main/java/com/msdw/tms/dao/ExperimentalReportDao.java index 3e593b4..5d1682b 100644 --- a/src/main/java/com/msdw/tms/dao/ExperimentalReportDao.java +++ b/src/main/java/com/msdw/tms/dao/ExperimentalReportDao.java @@ -1,9 +1,7 @@ package com.msdw.tms.dao; import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; import com.msdw.tms.entity.ExperimentalReportEntity; -import com.msdw.tms.entity.vo.AchievementManagementVo; import com.msdw.tms.entity.vo.ExperimentalReportVo; import org.apache.ibatis.annotations.Mapper; diff --git a/src/main/java/com/msdw/tms/dao/ProjectRecordDao.java b/src/main/java/com/msdw/tms/dao/ProjectRecordDao.java index 387d825..e1f10c7 100644 --- a/src/main/java/com/msdw/tms/dao/ProjectRecordDao.java +++ b/src/main/java/com/msdw/tms/dao/ProjectRecordDao.java @@ -3,10 +3,12 @@ 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.entity.ExperimentalProjectEntity; +import com.msdw.tms.entity.ExperimentalReportEntity; import com.msdw.tms.entity.ProjectRecordEntity; -import com.msdw.tms.entity.RecordVo; import com.msdw.tms.entity.vo.ProjectRecordExportVo; import com.msdw.tms.entity.vo.ProjectRecordVo; +import com.msdw.tms.entity.vo.RecordVo; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -22,7 +24,7 @@ import java.util.List; @Mapper public interface ProjectRecordDao extends BaseMapper { - IPage getByUserRecord(Page page,@Param("pro") ProjectRecordEntity projectRecordEntity); + IPage getByUserRecord(Page page,@Param("pro") ProjectRecordEntity projectRecordEntity,Integer projectPermissions); IPage getByUserExperimentRecord(Page page,@Param("pro") ProjectRecordEntity projectRecordEntity); @@ -30,6 +32,8 @@ public interface ProjectRecordDao extends BaseMapper { ProjectRecordVo getByUserScore(@Param("userid") Integer userId,@Param("isdel") Integer isdel); + ProjectRecordVo queryScore(@Param("userId") Integer userId); + IPage getBySchoolRecord(Page page,@Param("pro") ProjectRecordVo projectRecord); boolean updateUserRecord(ProjectRecordEntity projectRecord); diff --git a/src/main/java/com/msdw/tms/dao/StudentDao.java b/src/main/java/com/msdw/tms/dao/StudentDao.java index 5964c93..b426e78 100644 --- a/src/main/java/com/msdw/tms/dao/StudentDao.java +++ b/src/main/java/com/msdw/tms/dao/StudentDao.java @@ -20,6 +20,8 @@ public interface StudentDao extends BaseMapper { IPage queryStudent(Page tpage,String searchContent,Integer schoolId); + StudentVo queryStudentDetails(Integer userId); + Integer deleteStudent(List studentId); Integer updateStudent(StudentVo studentVo); diff --git a/src/main/java/com/msdw/tms/dao/UserInfoDao.java b/src/main/java/com/msdw/tms/dao/UserInfoDao.java index 778eb11..b1a3cfc 100644 --- a/src/main/java/com/msdw/tms/dao/UserInfoDao.java +++ b/src/main/java/com/msdw/tms/dao/UserInfoDao.java @@ -65,4 +65,5 @@ public interface UserInfoDao extends BaseMapper { List queryStudentName(Integer userId); + Integer getUserId(String token); } diff --git a/src/main/java/com/msdw/tms/entity/ExperimentalReportEntity.java b/src/main/java/com/msdw/tms/entity/ExperimentalReportEntity.java index cffea8e..ae5e261 100644 --- a/src/main/java/com/msdw/tms/entity/ExperimentalReportEntity.java +++ b/src/main/java/com/msdw/tms/entity/ExperimentalReportEntity.java @@ -3,6 +3,7 @@ package com.msdw.tms.entity; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.experimental.Accessors; @@ -10,44 +11,120 @@ import lombok.experimental.Accessors; @Data @Accessors(chain = true) public class ExperimentalReportEntity { - //实验报告主键 @TableId(type = IdType.AUTO) + @ApiModelProperty(value = "实验报告主键",name = "reportId",required = false) private Integer reportId; //绑定实验id + @ApiModelProperty(value = "绑定实验id",name = "projectId",required = false) private Integer projectId; //实验原理 + @ApiModelProperty(value = "实验原理",name = "principle",required = false) private String principle; //实验内容 + @ApiModelProperty(value = "实验内容",name = "content",required = false) private String content; //实验步骤 + @ApiModelProperty(value = "实验步骤",name = "step",required = false) private String step; //实验数据 + @ApiModelProperty(value = "实验数据",name = "data",required = false) private String data; //实验分析 + @ApiModelProperty(value = "实验分析",name = "analysis",required = false) private String analysis; //实验结论 + @ApiModelProperty(value = "实验结论",name = "conclusion",required = false) private String conclusion; //实验总结 + @ApiModelProperty(value = "实验总结",name = "summarize",required = false) private String summarize; + //实验目的 + @ApiModelProperty(value = "实验目的",name = "purpose",required = false) + private String purpose; //对本实验过程的方法及手段的改进建议 + @ApiModelProperty(value = "对本实验过程的方法及手段的改进建议",name = "improvement",required = false) private String improvement; //老师评语 + @ApiModelProperty(value = "老师评语",name = "commentId",required = false) private Integer commentId; //教师评语 + @ApiModelProperty(value = "教师评语",name = "comment",required = false) private String comment; //绑定学生id + @ApiModelProperty(value = "绑定学生id",name = "studentId",required = false) private Integer studentId; -// 绑定老师id -// private Integer teacherId; + //绑定老师id + @ApiModelProperty(value = "绑定老师id",name = "teacherId",required = false) + private Integer teacherId; + //指导老师 + @ApiModelProperty(value = "指导老师",name = "teacherName",required = false) + private String teacherName; //学时 + @ApiModelProperty(value = "学时",name = "period",required = false) private String period; //实验室名称 + @ApiModelProperty(value = "实验室名称",name = "laboratory",required = false) private String laboratory; //绑定教师签名id + @ApiModelProperty(value = "绑定教师签名id",name = "signatureId",required = false) private Integer signatureId; //是否启用教师签名照 + @ApiModelProperty(value = "是否启用教师签名照",name = "isSignature",required = false) private Integer isSignature; //绑定项目id + @ApiModelProperty(value = "绑定项目id",name = "eventId",required = false) private Integer eventId; + //实验器材 + @ApiModelProperty(value = "实验器材",name = "equipment",required = false) + private String equipment; + @ApiModelProperty(value = "最终得分",name = "score",required = false) + private Integer score; + @ApiModelProperty(value = "耗时/小时",name = "timeConsuming",required = false) + private Integer timeConsuming; + @ApiModelProperty(value = "开始时间",name = "startTime",required = false) + private String startTime; + @ApiModelProperty(value = "创建时间",name = "creationTime",required = false) + private String creationTime; + @ApiModelProperty(value = "班级名称",name = "className",required = false) + private String className; + //步骤1 + @ApiModelProperty(value = "步骤1",name = "steps1",required = false) + private String steps1; + //步骤2 + @ApiModelProperty(value = "步骤2",name = "steps2",required = false) + private String steps2; + //步骤3 + @ApiModelProperty(value = "步骤3",name = "steps3",required = false) + private String steps3; + //步骤4 + @ApiModelProperty(value = "步骤4",name = "steps4",required = false) + private String steps4; + //步骤5 + @ApiModelProperty(value = "步骤5",name = "steps5",required = false) + private String steps5; + //步骤6 + @ApiModelProperty(value = "步骤6",name = "steps6",required = false) + private String steps6; + //步骤7 + @ApiModelProperty(value = "步骤7",name = "steps7",required = false) + private String steps7; + //步骤8 + @ApiModelProperty(value = "步骤8",name = "steps8",required = false) + private String steps8; + //步骤9 + @ApiModelProperty(value = "步骤9",name = "steps9",required = false) + private String steps9; + //步骤10 + @ApiModelProperty(value = "步骤10",name = "steps10",required = false) + private String steps10; + + private transient String projectName; + + private transient String workNumber; + + //绑定用户id + private transient Integer userId; + + } diff --git a/src/main/java/com/msdw/tms/entity/ProjectRecordEntity.java b/src/main/java/com/msdw/tms/entity/ProjectRecordEntity.java index 700d7b0..8115fe1 100644 --- a/src/main/java/com/msdw/tms/entity/ProjectRecordEntity.java +++ b/src/main/java/com/msdw/tms/entity/ProjectRecordEntity.java @@ -64,7 +64,7 @@ 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已删除) */ diff --git a/src/main/java/com/msdw/tms/entity/ReportEntity.java b/src/main/java/com/msdw/tms/entity/ReportEntity.java new file mode 100644 index 0000000..0a4108a --- /dev/null +++ b/src/main/java/com/msdw/tms/entity/ReportEntity.java @@ -0,0 +1,39 @@ +package com.msdw.tms.entity; + +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * + * + * @author + * @email + * @date 2020-08-19 16:07:02 + */ +@Accessors(chain = true) +@Data +public class ReportEntity { + + private static final long serialVersionUID = 1L; + + //学校名称 + private String schoolName; + + //学生名称 + private String studentName; + + //学号 + private String workNumber; + + //创建时间 + private String creationTime; + + //分数 + private Integer score; + + //报告id + private Integer reportId; + + //用户id + private Integer userId; +} diff --git a/src/main/java/com/msdw/tms/entity/ResultsEntity.java b/src/main/java/com/msdw/tms/entity/ResultsEntity.java new file mode 100644 index 0000000..715cd3a --- /dev/null +++ b/src/main/java/com/msdw/tms/entity/ResultsEntity.java @@ -0,0 +1,53 @@ +package com.msdw.tms.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.experimental.Accessors; + +import java.io.Serializable; +import java.util.Date; + +/** + * + * + * @author + * @email + * @date 2020-08-19 16:07:02 + */ +@Accessors(chain = true) +@Data +public class ResultsEntity{ + + private static final long serialVersionUID = 1L; + + //实验教学id + private Integer id; + + //项目名称 + private String projectName; + + //分类(0、虚拟仿真实验(练习) 1、实验教学(考核)) + private Integer projectPermissions; + + //成绩报告数量 + private Integer number; + + //创建时间 + private String creationTime; + + //绑定系统id + private Integer systemId; + + //绑定系统id + private Integer projectId; + + //实验班级名称 + private String experimentalClassName; + + //实验名称 + private String experimentalName; + + + +} diff --git a/src/main/java/com/msdw/tms/entity/vo/AchievementManagementVo.java b/src/main/java/com/msdw/tms/entity/vo/AchievementManagementVO.java similarity index 95% rename from src/main/java/com/msdw/tms/entity/vo/AchievementManagementVo.java rename to src/main/java/com/msdw/tms/entity/vo/AchievementManagementVO.java index 79132f8..91bc8bd 100644 --- a/src/main/java/com/msdw/tms/entity/vo/AchievementManagementVo.java +++ b/src/main/java/com/msdw/tms/entity/vo/AchievementManagementVO.java @@ -8,7 +8,7 @@ import lombok.experimental.Accessors; @Data @Accessors(chain = true) -public class AchievementManagementVo extends ExperimentalReportEntity { +public class AchievementManagementVO extends ExperimentalReportEntity { //=========================================================== 返回参数 // @@ -27,7 +27,7 @@ public class AchievementManagementVo extends ExperimentalReportEntity { private String workNumber; //分数 - private String score; + private Integer score; //提交时间 private String submitTime; diff --git a/src/main/java/com/msdw/tms/entity/vo/AchievementVO.java b/src/main/java/com/msdw/tms/entity/vo/AchievementVO.java new file mode 100644 index 0000000..0c957f4 --- /dev/null +++ b/src/main/java/com/msdw/tms/entity/vo/AchievementVO.java @@ -0,0 +1,30 @@ +package com.msdw.tms.entity.vo; + +import com.msdw.tms.entity.ExperimentalReportEntity; +import com.msdw.tms.entity.ProjectRecordEntity; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.experimental.Accessors; + +@Data +@Accessors(chain = true) +public class AchievementVO extends ExperimentalReportEntity { + + private RecordVo entity; + + //指导老师姓名 + @ApiModelProperty(value = "指导老师姓名",name = "teacherName",required = false) + private String teacherName; + + //学生姓名 + @ApiModelProperty(value = "学生姓名",name = "userName",required = false) + private String userName; + + //学号 + @ApiModelProperty(value = "学号",name = "workNumber",required = false) + private String workNumber; + //项目id + @ApiModelProperty(value = "项目id",name = "eventId",required = false) + private Integer eventId; + +} diff --git a/src/main/java/com/msdw/tms/entity/vo/AchievementVo.java b/src/main/java/com/msdw/tms/entity/vo/AchievementVo.java deleted file mode 100644 index 0a9f371..0000000 --- a/src/main/java/com/msdw/tms/entity/vo/AchievementVo.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.msdw.tms.entity.vo; - -import com.msdw.tms.entity.ExperimentalReportEntity; -import com.msdw.tms.entity.ProjectRecordEntity; -import com.msdw.tms.entity.RecordVo; -import lombok.Data; -import lombok.experimental.Accessors; - -@Data -@Accessors(chain = true) -public class AchievementVo extends ExperimentalReportEntity { - - private RecordVo entity; - - //指导老师姓名 - private String teacherName; - - //学生姓名 - private String userName; - - //学号 - private String workNumber; - // - private Integer eventId; - -} diff --git a/src/main/java/com/msdw/tms/entity/vo/ExperimentalReportVo.java b/src/main/java/com/msdw/tms/entity/vo/ExperimentalReportVo.java index 1ad85b2..67dd8d9 100644 --- a/src/main/java/com/msdw/tms/entity/vo/ExperimentalReportVo.java +++ b/src/main/java/com/msdw/tms/entity/vo/ExperimentalReportVo.java @@ -9,7 +9,7 @@ import lombok.experimental.Accessors; public class ExperimentalReportVo extends ExperimentalReportEntity { //学生用户id - private int userId; + private Integer userId; //学生姓名 private String userName; //学号 diff --git a/src/main/java/com/msdw/tms/entity/vo/JudgmentPointsRuleVO.java b/src/main/java/com/msdw/tms/entity/vo/JudgmentPointsRuleVO.java new file mode 100644 index 0000000..0a4ab53 --- /dev/null +++ b/src/main/java/com/msdw/tms/entity/vo/JudgmentPointsRuleVO.java @@ -0,0 +1,25 @@ +package com.msdw.tms.entity.vo; + +import lombok.Data; + +/** + * 交易类判分点规则实体类 + * + * @author Ning + * + */ +@Data +public class JudgmentPointsRuleVO { + + private Integer id; // 交易类判分点规则主键id + private Integer type;//类型(1.选择题2.填空题3.问答题4.指标结果) + private String levelOne;// 一级栏目 + private String levelTwo;// 二级栏目 + private String levelThree;// 三级栏目 + private String levelFour;// 四级栏目 + private Integer tradingJudgmentPointsId;//绑定交易类判分点id + private String judgmentPointsName;//绑定交易类判分点id + private Integer operatorOne;//一级运算符 1为且 2为或 + private Integer operatorTwo;//二级运算符 1为且 2为或 + +} diff --git a/src/main/java/com/msdw/tms/entity/vo/ProjectRecordVo.java b/src/main/java/com/msdw/tms/entity/vo/ProjectRecordVo.java index 411279e..adb3cfc 100644 --- a/src/main/java/com/msdw/tms/entity/vo/ProjectRecordVo.java +++ b/src/main/java/com/msdw/tms/entity/vo/ProjectRecordVo.java @@ -28,6 +28,10 @@ public class ProjectRecordVo extends ProjectRecordEntity implements Serializable * 学校名称 */ private String SchoolName; + /** + * 学校名称 + */ + private String className; /** * 用户名称 */ @@ -40,6 +44,10 @@ public class ProjectRecordVo extends ProjectRecordEntity implements Serializable * 总耗时 */ private Double totalTime; + /** + * 总耗时 + */ + private Integer timeConsuming; /** * 平均分 */ diff --git a/src/main/java/com/msdw/tms/entity/vo/RecordVo.java b/src/main/java/com/msdw/tms/entity/vo/RecordVo.java index d568033..c825fb4 100644 --- a/src/main/java/com/msdw/tms/entity/vo/RecordVo.java +++ b/src/main/java/com/msdw/tms/entity/vo/RecordVo.java @@ -1,9 +1,10 @@ -package com.msdw.tms.entity; +package com.msdw.tms.entity.vo; 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 io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.experimental.Accessors; import org.springframework.format.annotation.DateTimeFormat; @@ -26,49 +27,55 @@ public class RecordVo implements Serializable { /** * 记录id */ + @ApiModelProperty(value = "记录id",name = "recordid",required = false) private Integer recordid; /** * 用户id */ + @ApiModelProperty(value = "用户id",name = "userid",required = false) private Integer userid; /** * 实验项目id */ + @ApiModelProperty(value = "实验项目id",name = "projectid",required = false) private Integer projectid; /** * 得分 */ + @ApiModelProperty(value = "得分",name = "score",required = false) private Integer score; /** * 记录状态 */ + @ApiModelProperty(value = "记录状态",name = "recordstate",required = false) private Integer recordstate; /** * 起始时间 */ - @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private Date startingtime; + @ApiModelProperty(value = "起始时间",name = "startingtime",required = false) + private String startingtime; /** * 结束时间 */ - private Date endtime; + @ApiModelProperty(value = "结束时间",name = "endtime",required = false) + private String endtime; /** * 耗时 */ + @ApiModelProperty(value = "耗时",name = "timeSum",required = false) private Integer timeSum; /** * 提交时间 */ - @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private Date submittime; + @ApiModelProperty(value = "提交时间",name = "submittime",required = false) + private String submittime; /** * 删除(0未删除 1已删除) */ @TableLogic(value = "0",delval = "1") private Integer isdel; + @ApiModelProperty(value = "项目id",name = "eventId",required = false) private Integer eventId; } diff --git a/src/main/java/com/msdw/tms/entity/vo/ResultsVo.java b/src/main/java/com/msdw/tms/entity/vo/ResultsVo.java new file mode 100644 index 0000000..791c06e --- /dev/null +++ b/src/main/java/com/msdw/tms/entity/vo/ResultsVo.java @@ -0,0 +1,43 @@ +package com.msdw.tms.entity.vo; + +import com.msdw.tms.entity.ExperimentalReportEntity; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.experimental.Accessors; + +@Data +@Accessors(chain = true) +public class ResultsVo { + + //搜索内容 + @ApiModelProperty(value = "搜索内容",name = "searchContant",required = false) + private String searchContant; + + //结束时间 + @ApiModelProperty(value = "结束时间",name = "endTime",required = false) + private String endTime; + + //开始时间 + @ApiModelProperty(value = "开始时间",name = "startTime",required = false) + private String startTime; + + //月份 + @ApiModelProperty(value = "月份",name = "month",required = false) + private Integer month; + + //项目权限(0、练习 1、考核 2、竞赛) + @ApiModelProperty(value = "项目权限(0、练习 1、考核 2、竞赛)",name = "projectPermissions",required = false) + private Integer projectPermissions; + + //系统id + @ApiModelProperty(value = "系统id",name = "systemId",required = true) + private Integer systemId; + + //项目id + @ApiModelProperty(value = "项目id",name = "projectId",required = true) + private Integer projectId; + + //用户id + private Integer userId; + +} diff --git a/src/main/java/com/msdw/tms/entity/vo/UserScoreVO.java b/src/main/java/com/msdw/tms/entity/vo/UserScoreVO.java new file mode 100644 index 0000000..69f8f0b --- /dev/null +++ b/src/main/java/com/msdw/tms/entity/vo/UserScoreVO.java @@ -0,0 +1,23 @@ +package com.msdw.tms.entity.vo; + +import lombok.Data; + +/** + * 交易类判分点实体类 + * + * @author Ning + * + */ +@Data +public class UserScoreVO { + + private Integer id; // 判分点主键Id + private Integer score; // 分数 + private Integer tradingJudgmentPointsId;// 判分点id + private Integer projectId;// 绑定项目管理Id + private Integer systemId;//绑定系统id + private Integer userId;//绑定用户id + private Integer isCorrect;//是否正确(0、未作答 1、正确 2、不正确) + private Integer reportId;//实验报告id + private String userAnswers;//用户答案 +} diff --git a/src/main/java/com/msdw/tms/service/AchievementManagementService.java b/src/main/java/com/msdw/tms/service/AchievementManagementService.java index 67d3bd0..761809e 100644 --- a/src/main/java/com/msdw/tms/service/AchievementManagementService.java +++ b/src/main/java/com/msdw/tms/service/AchievementManagementService.java @@ -3,17 +3,30 @@ package com.msdw.tms.service; 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 com.msdw.tms.entity.ExperimentalTeachingEntity; +import com.msdw.tms.entity.ReportEntity; +import com.msdw.tms.entity.ResultsEntity; +import com.msdw.tms.entity.vo.ResultsVo; import javax.servlet.http.HttpServletResponse; -import java.io.IOException; import java.util.List; public interface AchievementManagementService extends IService { - R addReport(AchievementVo entity); + //查询实验报告 + R getReport(Integer userId, Integer reportId); + + //查询知道老师 + R getTeacher(Integer projectId); + + List list(ResultsVo vo, Integer page, Integer size); + + //查询实验教学列表 + List newList(ResultsVo vo, Integer page, Integer size); + + List reportList(ResultsVo vo, Integer page, Integer size); + + R addReport(ExperimentalReportEntity entity); R queryReport(Integer reportId ); diff --git a/src/main/java/com/msdw/tms/service/ProjectRecordService.java b/src/main/java/com/msdw/tms/service/ProjectRecordService.java index b0588e2..74edc2a 100644 --- a/src/main/java/com/msdw/tms/service/ProjectRecordService.java +++ b/src/main/java/com/msdw/tms/service/ProjectRecordService.java @@ -2,10 +2,12 @@ package com.msdw.tms.service; import com.baomidou.mybatisplus.extension.service.IService; import com.msdw.tms.common.utils.PageUtils; +import com.msdw.tms.common.utils.R; import com.msdw.tms.entity.ProjectRecordEntity; import com.msdw.tms.entity.vo.ProjectRecordVo; import javax.servlet.http.HttpServletResponse; +import java.util.HashMap; import java.util.List; /** @@ -17,12 +19,14 @@ import java.util.List; */ public interface ProjectRecordService extends IService { - PageUtils queryPage(Integer page,Integer size,Integer userid); + PageUtils queryPage(Integer page,Integer size,Integer userId,Integer projectPermissions); PageUtils queryExperimentPage(Integer page,Integer size,Integer userid); ProjectRecordVo queryUserScore(Integer userId); + ProjectRecordVo queryScore(Integer userId); + void exportProjectRecord(HttpServletResponse response, Integer userId)throws Exception; void exportExperimentProjectRecord(HttpServletResponse response, Integer userId)throws Exception; diff --git a/src/main/java/com/msdw/tms/service/StudentService.java b/src/main/java/com/msdw/tms/service/StudentService.java index c9f1a46..05d99e9 100644 --- a/src/main/java/com/msdw/tms/service/StudentService.java +++ b/src/main/java/com/msdw/tms/service/StudentService.java @@ -22,6 +22,8 @@ public interface StudentService extends IService{ PageUtils queryStudent(Integer schoolId,String searchContent, Integer page, Integer size); + R queryStudentDetails(Integer userId); + boolean deleteStudent(List studentId); boolean updateStudent(StudentVo studentVo); diff --git a/src/main/java/com/msdw/tms/service/UserInfoService.java b/src/main/java/com/msdw/tms/service/UserInfoService.java index a0b5def..b6b52dd 100644 --- a/src/main/java/com/msdw/tms/service/UserInfoService.java +++ b/src/main/java/com/msdw/tms/service/UserInfoService.java @@ -48,4 +48,6 @@ public interface UserInfoService extends IService { R queryAccount(); + Integer getUserId(String token); + } diff --git a/src/main/java/com/msdw/tms/service/impl/AchievementManagementServiceImpl.java b/src/main/java/com/msdw/tms/service/impl/AchievementManagementServiceImpl.java index 4afac1d..97bd1e8 100644 --- a/src/main/java/com/msdw/tms/service/impl/AchievementManagementServiceImpl.java +++ b/src/main/java/com/msdw/tms/service/impl/AchievementManagementServiceImpl.java @@ -11,13 +11,12 @@ 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.*; 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.AchievementManagementVO; +import com.msdw.tms.entity.vo.JudgmentPointsRuleVO; +import com.msdw.tms.entity.vo.ResultsVo; +import com.msdw.tms.entity.vo.UserScoreVO; import com.msdw.tms.service.AchievementManagementService; import lombok.extern.slf4j.Slf4j; import org.apache.poi.ss.formula.functions.T; @@ -45,50 +44,102 @@ public class AchievementManagementServiceImpl extends ServiceImpl studentName = userInfoDao.queryStudentName(userid); - if (studentName.size()==0){ - return R.error("不存在的学生姓名"); - }else if (student==null){ - log.info("学生姓名和用户id不匹配!!!"); - return R.error("错误的个人信息!"); + public R getReport(Integer userId, Integer reportId) { + HashMap obj = new HashMap(); + HashMap map = new HashMap(); + UserScoreVO userScoreVO = new UserScoreVO(); + userScoreVO.setUserId(userId); + userScoreVO.setReportId(reportId); + ExperimentalReportEntity experimentalReportEntity = new ExperimentalReportEntity(); + experimentalReportEntity.setStudentId(userId); + experimentalReportEntity.setReportId(reportId); + ExperimentalReportEntity experimentalReportEntity1 = baseMapper.getReport(experimentalReportEntity); + List score = baseMapper.getScore(userScoreVO); + obj.put("score",score); + obj.put("experimentalReportEntity",experimentalReportEntity1); + List tradingJudgmentPointsIds = baseMapper.queryTradingJudgmentPointsId(reportId); + Integer size = tradingJudgmentPointsIds.size(); + for (int i = 0;i judgmentPointsRuleList = baseMapper.getUserAnswers(tradingJudgmentPointsId); + map.put("judgmentPointsRuleList"+i,judgmentPointsRuleList); } + obj.put("userAnswersList",map); + return R.ok().put("data",obj); + } + + @Override + public R getTeacher(Integer projectId) { + String name = baseMapper.getTeacher(projectId); + return R.ok().put("name",name); + } + + @Override + public List list(ResultsVo vo,Integer page,Integer size) { + List list = achievementManagementDao.list(vo); + return list; + } + + @Override + public List reportList(ResultsVo vo,Integer page,Integer size) { + List reportList = achievementManagementDao.reportList(vo); + return reportList; + } + + @Override + public List newList(ResultsVo vo,Integer page,Integer size) { + List newList = achievementManagementDao.newList(vo); + return newList; + } + + + @Override + @Transactional + public R addReport(ExperimentalReportEntity entity) { +// RecordVo record = entity.getEntity(); +// //1.信息校验 +// String userName = entity.getUserName(); +// Integer userid = record.getUserid(); +// String teacherName = entity.getTeacherName(); +// //获取学生id和用户id +// StudentEntity student = userInfoDao.queryStudentId(userName,userid); +// //获取学生姓名 +// List studentName = userInfoDao.queryStudentName(userid); +// if (studentName.size()==0){ +// return R.error("不存在的学生姓名"); +// }else if (student==null){ +// log.info("学生姓名和用户id不匹配!!!"); +// return R.error("错误的个人信息!"); +// } //2.根据实验得分 自动获取评语信息 //3.将评语对应的commentId放入entity以便一齐存入实验报告表 //(无判分系统暂写score=100) - record.setScore(100); - //根据成绩取出对应的评语和评语id - Integer score = record.getScore(); - if (score!=null) { - if (score<60){ - entity.setCommentId(1);//成绩不合格 - }else if (score>=60&&score<70){ - entity.setCommentId(2);//合格 - }else if (score>=70&&score<90){ - entity.setCommentId(3);//良好 - }else { - entity.setCommentId(4);//优秀 - } - }else { - return R.error("系统异常,成绩为空!"); - } +// record.setScore(100); +// //根据成绩取出对应的评语和评语id +// Integer score = record.getScore(); +// if (score!=null) { +// if (score<60){ +// entity.setCommentId(1);//成绩不合格 +// }else if (score>=60&&score<70){ +// entity.setCommentId(2);//合格 +// }else if (score>=70&&score<90){ +// entity.setCommentId(3);//良好 +// }else { +// entity.setCommentId(4);//优秀 +// } +// }else { +// return R.error("系统异常,成绩为空!"); +// } //4.添加实验记录表信息 - projectRecordDao.addReport(record);//保存至tms_project_record并返回主键 +// projectRecordDao.addReport(record);//保存至tms_project_record并返回主键 //5.添加实验报告表信息 - entity.setStudentId(student.getStudentId()).setEventId(record.getEventId()); +// entity.setStudentId(student.getStudentId()).setEventId(record.getEventId()); achievementManagementDao.addReport(entity); return R.ok(); @@ -97,7 +148,7 @@ public class AchievementManagementServiceImpl extends ServiceImpl map = new HashMap<>(); - AchievementManagementVo report = achievementManagementDao.queryReport(reportId); + AchievementManagementVO report = achievementManagementDao.queryReport(reportId); Integer eventId = report.getEventId(); ProjectRecordEntity record = projectRecordDao.queryReport(eventId); String userName = userInfoDao.queryUserReport(record.getUserid()); @@ -108,7 +159,7 @@ public class AchievementManagementServiceImpl extends ServiceImpl data = achievementManagementDao.queryPythonTest(eventId); + List data = achievementManagementDao.queryPythonTest(eventId); map.put("data", data); } report.setUserName(userName); @@ -127,7 +178,7 @@ public class AchievementManagementServiceImpl extends ServiceImpl tPage = new Page<>(page,size); - IPage data = achievementManagementDao.queryEvaluationReport(tPage,searchContant,projectId); + IPage data = achievementManagementDao.queryEvaluationReport(tPage,searchContant,projectId); PageUtils result = new PageUtils(data); return R.ok().put("data",result); @@ -157,9 +208,9 @@ public class AchievementManagementServiceImpl extends ServiceImpl fictitious; - List education; - List vo = new ArrayList<>(); + List fictitious; + List education; + List vo = new ArrayList<>(); List educationResult = achievementManagementDao.countEducationProjectId();//获取教学实验的主键id List fictitiousResult = achievementManagementDao.countFictitiousProjectId();//获取教学实验的主键id if (projectPermissions==null){projectPermissions=-9999;} @@ -184,9 +235,9 @@ public class AchievementManagementServiceImpl extends ServiceImpl() { + Collections.sort(vo, new Comparator() { @Override - public int compare(AchievementManagementVo o1, AchievementManagementVo o2) { + public int compare(AchievementManagementVO o1, AchievementManagementVO o2) { int flag = o2.getCreationTime().compareTo(o1.getCreationTime()); return flag; } diff --git a/src/main/java/com/msdw/tms/service/impl/ExperimentalReportServiceImpl.java b/src/main/java/com/msdw/tms/service/impl/ExperimentalReportServiceImpl.java index ddd5af7..b419d62 100644 --- a/src/main/java/com/msdw/tms/service/impl/ExperimentalReportServiceImpl.java +++ b/src/main/java/com/msdw/tms/service/impl/ExperimentalReportServiceImpl.java @@ -1,17 +1,13 @@ package com.msdw.tms.service.impl; -import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.msdw.tms.common.utils.PageUtils; import com.msdw.tms.common.utils.R; import com.msdw.tms.dao.AchievementManagementDao; import com.msdw.tms.dao.ExperimentalReportDao; -import com.msdw.tms.dao.ExperimentalTeachingDao; import com.msdw.tms.entity.ExperimentalReportEntity; -import com.msdw.tms.entity.vo.AchievementManagementVo; +import com.msdw.tms.entity.vo.AchievementManagementVO; import com.msdw.tms.entity.vo.ExperimentalReportVo; import com.msdw.tms.service.ExperimentalReportService; -import org.apache.commons.lang.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -37,7 +33,7 @@ public class ExperimentalReportServiceImpl extends ServiceImpl map = new HashMap<>(); map.put("report",result); if(systemId==1|systemId==4|systemId==5){ - List data = achievementManagementDao.queryPythonTest(recordId); + List data = achievementManagementDao.queryPythonTest(recordId); map.put("data",data); return R.ok().put("data",map); } @@ -51,7 +47,7 @@ public class ExperimentalReportServiceImpl extends ServiceImpl data = achievementManagementDao.queryPythonTest(recordId); + List data = achievementManagementDao.queryPythonTest(recordId); HashMap map = new HashMap<>(); map.put("data",data); map.put("report",result); diff --git a/src/main/java/com/msdw/tms/service/impl/ProjectRecordServiceImpl.java b/src/main/java/com/msdw/tms/service/impl/ProjectRecordServiceImpl.java index 8a92e16..020f208 100644 --- a/src/main/java/com/msdw/tms/service/impl/ProjectRecordServiceImpl.java +++ b/src/main/java/com/msdw/tms/service/impl/ProjectRecordServiceImpl.java @@ -5,8 +5,10 @@ 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.ProjectRecordDao; +import com.msdw.tms.entity.ExperimentalReportEntity; import com.msdw.tms.entity.ProjectRecordEntity; import com.msdw.tms.entity.request.ExperimentProjectRecordImportRequest; import com.msdw.tms.entity.request.ProjectRecordImportRequest; @@ -22,6 +24,7 @@ import org.springframework.stereotype.Service; import javax.servlet.http.HttpServletResponse; import java.io.InputStream; import java.text.DecimalFormat; +import java.util.HashMap; import java.util.List; import java.util.stream.Collectors; @@ -32,15 +35,16 @@ public class ProjectRecordServiceImpl extends ServiceImpl page1 = new Page<>(page, size); - IPage projectRecordVos = this.baseMapper.getByUserRecord(page1,projectRecord); + IPage projectRecordVos = this.baseMapper.getByUserRecord(page1,projectRecord,projectPermissions); PageUtils questionsPage = new PageUtils(projectRecordVos); @@ -79,6 +83,12 @@ public class ProjectRecordServiceImpl extends ServiceImpl im return pageUtils; } + @Override + public R queryStudentDetails(Integer userId) { + StudentVo saveStudent = studentDao.queryStudentDetails(userId); + if (saveStudent!=null){ + return R.ok().put("data",saveStudent); + }else { + return R.error(300,"用户不存在!"); + } + } + @Transactional @Override public boolean deleteStudent(List studentId) { diff --git a/src/main/java/com/msdw/tms/service/impl/UserInfoServiceImpl.java b/src/main/java/com/msdw/tms/service/impl/UserInfoServiceImpl.java index 34f45ed..392b2aa 100644 --- a/src/main/java/com/msdw/tms/service/impl/UserInfoServiceImpl.java +++ b/src/main/java/com/msdw/tms/service/impl/UserInfoServiceImpl.java @@ -221,4 +221,10 @@ public class UserInfoServiceImpl extends ServiceImpl - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - 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 INTO hr_experimental_report( projectId, content, principle, step, analysis, summarize, improvement, + commentId, studentId, period,laboratory,className,steps1,steps2,steps3,steps4,steps5,steps6,steps7,steps8,steps9,steps10,timeConsuming,startTime,creationTime,purpose,teacherName) + VALUES + (#{projectId},#{content}, #{principle}, #{step}, #{analysis}, #{summarize}, #{improvement}, #{commentId}, #{studentId}, + #{period}, #{laboratory},#{className},#{steps1},#{steps2},#{steps3},#{steps4},#{steps5},#{steps6},#{steps7},#{steps8},#{steps9},#{steps10},#{timeConsuming},#{startTime},#{creationTime},#{purpose},#{teacherName}) + - UPDATE tms_project_record tpr,tms_experimental_report tcr SET tpr.isdel = 1 , tcr.isdel = 1 WHERE tpr.recordid = tcr.eventId AND tcr.reportId = #{reportId} + UPDATE tms_project_record tpr,hr_experimental_report tcr SET tpr.isdel = 1 , tcr.isdel = 1 WHERE tpr.recordId = tcr.eventId AND tcr.reportId = #{reportId} UPDATE tms_experimental_report SET `comment` = #{comment} WHERE reportId = #{reportId} @@ -21,7 +71,7 @@ VALUES UPDATE tms_experimental_report SET isSignature = #{isSignature} , signatureId = #{signatureId}, `comment` = #{comment} WHERE reportId = #{reportId} - SELECT ter.reportId, IFNULL( ter.`comment`, ( SELECT `comment` FROM tms_comment WHERE id = commentId ) ) AS comment, @@ -57,7 +107,7 @@ FROM WHERE reportId = #{reportId} - SELECT u.userName, sch.schoolName, @@ -125,7 +175,7 @@ WHERE tcr.reportId ORDER BY tpr.submitTime DESC - SELECT hpm.projectName, hpm.creationTime AS creationtime, @@ -157,7 +207,7 @@ WHERE ORDER BY creationtime DESC,tcr.reportId DESC - SELECT hpm.projectName, hpm.creationTime AS creationtime, @@ -191,7 +241,7 @@ WHERE ORDER BY creationtime DESC,tcr.reportId DESC - SELECT u.userName, sch.schoolName, @@ -251,7 +301,7 @@ GROUP BY - SELECT hec.`code` AS userAnswer, hec.codeId, @@ -275,4 +325,55 @@ GROUP BY ORDER BY hec.codeId ASC + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/mapper/tms/ProjectRecordDao.xml b/src/main/resources/mapper/tms/ProjectRecordDao.xml index 8d2a04a..3fa668a 100644 --- a/src/main/resources/mapper/tms/ProjectRecordDao.xml +++ b/src/main/resources/mapper/tms/ProjectRecordDao.xml @@ -14,7 +14,7 @@ - + INSERT INTO tms_project_record ( userId, projectId, score, startingTime, endTime, timeSum, submitTime ) @@ -24,23 +24,24 @@ VALUES @@ -117,6 +118,10 @@ VALUES and u.isdel = #{isdel} + + + SELECT + u.userId, + u.userName, + s.workNumber + FROM + hr_user_info u, + student s + WHERE + u.userId = #{userId} + AND u.userId = s.userId + AND u.isdel = 0 + AND s.isdel = 0 + + - + + INSERT INTO student ( schoolId, userId, workNumber, roleId, isdel,platformId ) VALUES ( #{schoolId},#{userId},#{workNumber},#{roleId},#{isdel},#{platformId} diff --git a/src/main/resources/mapper/tms/UserInfoDao.xml b/src/main/resources/mapper/tms/UserInfoDao.xml index d214bfd..fa949fc 100644 --- a/src/main/resources/mapper/tms/UserInfoDao.xml +++ b/src/main/resources/mapper/tms/UserInfoDao.xml @@ -287,5 +287,8 @@ + \ No newline at end of file