From 8ba68c306c604b2523a38fba9e096b570175a49e Mon Sep 17 00:00:00 2001 From: mzh820631607 Date: Wed, 23 Sep 2020 17:09:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E6=95=99=E5=AD=A6=E5=AE=9E?= =?UTF-8?q?=E9=AA=8C=E8=AE=B0=E5=BD=95=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tms/api/ProjectRcordControllerApi.java | 8 +++++- .../tms/controller/ProjectController.java | 1 + .../controller/ProjectRecordController.java | 24 +++++++++++++++++- .../com/msdw/tms/dao/ProjectRecordDao.java | 2 ++ .../msdw/tms/entity/vo/ProjectRecordVo.java | 4 +++ .../tms/service/ProjectRecordService.java | 2 ++ .../impl/ProjectRecordServiceImpl.java | 15 +++++++++++ .../resources/mapper/tms/ProjectRecordDao.xml | 25 ++++++++++++++++--- 8 files changed, 76 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/msdw/tms/api/ProjectRcordControllerApi.java b/src/main/java/com/msdw/tms/api/ProjectRcordControllerApi.java index 81a66dc..70f2b68 100644 --- a/src/main/java/com/msdw/tms/api/ProjectRcordControllerApi.java +++ b/src/main/java/com/msdw/tms/api/ProjectRcordControllerApi.java @@ -2,10 +2,13 @@ package com.msdw.tms.api; import com.msdw.tms.common.utils.R; import com.msdw.tms.entity.ProjectRecordEntity; +import com.msdw.tms.entity.vo.ProjectRecordVo; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.RequestParam; import javax.servlet.http.HttpServletResponse; +import java.util.List; @Api(value = "实验报告",tags = "实验报告") public interface ProjectRcordControllerApi { @@ -14,9 +17,12 @@ public interface ProjectRcordControllerApi { R list( Integer page, Integer size,Integer month,String startTime,String endTime, Integer recordState,String condition); - @ApiOperation(value = "用户端实验记录",notes = "用户端实验记录") + @ApiOperation(value = "用户端虚拟仿真实验记录",notes = "用户端虚拟仿真实验记录") R queryUserRecord(Integer page,Integer size,Integer userid); + @ApiOperation(value = "用户端教学实验记录",notes = "用户端教学实验记录") + R getUserExperimentscore(Integer page,Integer size,Integer userid); + @ApiOperation(value = "个人实验概览",notes = "个人实验概览") R getUserScore(Integer userid); diff --git a/src/main/java/com/msdw/tms/controller/ProjectController.java b/src/main/java/com/msdw/tms/controller/ProjectController.java index 406952e..20c752c 100644 --- a/src/main/java/com/msdw/tms/controller/ProjectController.java +++ b/src/main/java/com/msdw/tms/controller/ProjectController.java @@ -41,6 +41,7 @@ public class ProjectController implements ProjectControllerApi { * @param userId * @return */ + @Override @GetMapping("/projects/info/{userid}") public R list(@PathVariable("userid") Integer userId){ HashMap result = projectService.list(userId); diff --git a/src/main/java/com/msdw/tms/controller/ProjectRecordController.java b/src/main/java/com/msdw/tms/controller/ProjectRecordController.java index f840f79..94d38fa 100644 --- a/src/main/java/com/msdw/tms/controller/ProjectRecordController.java +++ b/src/main/java/com/msdw/tms/controller/ProjectRecordController.java @@ -30,6 +30,7 @@ public class ProjectRecordController implements ProjectRcordControllerApi { /** * 服务端实验报告 */ + @Override @GetMapping("/schoolRecord") public R list(@RequestParam Integer page, @RequestParam Integer size, @RequestParam Integer month,@RequestParam String startTime,@RequestParam String endTime, @RequestParam Integer recordState,@RequestParam String condition ){ @@ -51,12 +52,13 @@ public class ProjectRecordController implements ProjectRcordControllerApi { } /** - * 用户实验记录 + * 用户端虚拟仿真实验记录 * @param page * @param size * @param userid * @return */ + @Override @GetMapping("/user/record") public R queryUserRecord(@RequestParam Integer page,@RequestParam Integer size,@RequestParam Integer userid){ PageUtils page1 = projectRecordService.queryPage(page,size,userid); @@ -64,11 +66,27 @@ public class ProjectRecordController implements ProjectRcordControllerApi { return R.ok().put("data", page1); } + /** + * 用户端教学实验记录 + * @param page + * @param size + * @param userid + * @return + */ + @Override + @GetMapping("/user/experimentRecord") + public R getUserExperimentscore(@RequestParam Integer page,@RequestParam Integer size,@RequestParam Integer userid){ + PageUtils page1 = projectRecordService.queryExperimentPage(page,size,userid); + + return R.ok().put("data", page1); + } + /** * 个人实验预览 * @param userid * @return */ + @Override @GetMapping("/user/score/{userId}") public R getUserScore(@PathVariable("userId") Integer userid){ ProjectRecordVo projectRecord = projectRecordService.queryUserScore(userid); @@ -76,12 +94,14 @@ public class ProjectRecordController implements ProjectRcordControllerApi { return R.ok().put("data", projectRecord); } + /** * 导出个人项目记录 * @param response * @param userId * @throws Exception */ + @Override @GetMapping("/user/exportProjectRecord") public void exportProjectRecord(HttpServletResponse response,@RequestParam("userId") Integer userId)throws Exception{ projectRecordService.exportProjectRecord(response,userId); @@ -110,6 +130,7 @@ public class ProjectRecordController implements ProjectRcordControllerApi { /** * 修改实验分数 */ + @Override @PutMapping("/update") public R update(@RequestBody ProjectRecordEntity projectRecord){ boolean result = projectRecordService.updateUserRecord(projectRecord); @@ -120,6 +141,7 @@ public class ProjectRecordController implements ProjectRcordControllerApi { /** * 删除实验报告 */ + @Override @DeleteMapping("/delete") public R delete(@RequestBody Integer[] recordids){ projectRecordService.removeByIds(Arrays.asList(recordids)); diff --git a/src/main/java/com/msdw/tms/dao/ProjectRecordDao.java b/src/main/java/com/msdw/tms/dao/ProjectRecordDao.java index ee3d742..abbf531 100644 --- a/src/main/java/com/msdw/tms/dao/ProjectRecordDao.java +++ b/src/main/java/com/msdw/tms/dao/ProjectRecordDao.java @@ -22,6 +22,8 @@ public interface ProjectRecordDao extends BaseMapper { IPage getByUserRecord(Page page,@Param("pro") ProjectRecordEntity projectRecordEntity); + IPage getByUserExperimentRecord(Page page,@Param("pro") ProjectRecordEntity projectRecordEntity); + List getByUserRecordImport(ProjectRecordEntity projectRecordEntity); ProjectRecordVo getByUserScore(@Param("userid") Integer userId,@Param("isdel") Integer isdel); 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 4130590..ad66a0c 100644 --- a/src/main/java/com/msdw/tms/entity/vo/ProjectRecordVo.java +++ b/src/main/java/com/msdw/tms/entity/vo/ProjectRecordVo.java @@ -75,6 +75,10 @@ public class ProjectRecordVo extends ProjectRecordEntity implements Serializable * 绑定用户id */ private Integer userId; + /** + * 实验班级名 + */ + private String experimentalClassName; // /** // * 班级实验状态,0 不限,1 未发布,2 进行中,3 已完成 diff --git a/src/main/java/com/msdw/tms/service/ProjectRecordService.java b/src/main/java/com/msdw/tms/service/ProjectRecordService.java index eedcfbb..4927e80 100644 --- a/src/main/java/com/msdw/tms/service/ProjectRecordService.java +++ b/src/main/java/com/msdw/tms/service/ProjectRecordService.java @@ -18,6 +18,8 @@ public interface ProjectRecordService extends IService { PageUtils queryPage(Integer page,Integer size,Integer userid); + PageUtils queryExperimentPage(Integer page,Integer size,Integer userid); + ProjectRecordVo queryUserScore(Integer userId); void exportProjectRecord(HttpServletResponse response,Integer userId)throws Exception; 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 ca6ac75..29c2f6c 100644 --- a/src/main/java/com/msdw/tms/service/impl/ProjectRecordServiceImpl.java +++ b/src/main/java/com/msdw/tms/service/impl/ProjectRecordServiceImpl.java @@ -45,6 +45,21 @@ public class ProjectRecordServiceImpl extends ServiceImpl page1 = new Page<>(page, size); + + IPage projectRecordVos = this.baseMapper.getByUserExperimentRecord(page1,projectRecord); + + PageUtils questionsPage = new PageUtils(projectRecordVos); + + return questionsPage; + } + @Override public ProjectRecordVo queryUserScore(Integer userId) { diff --git a/src/main/resources/mapper/tms/ProjectRecordDao.xml b/src/main/resources/mapper/tms/ProjectRecordDao.xml index d875883..685f02c 100644 --- a/src/main/resources/mapper/tms/ProjectRecordDao.xml +++ b/src/main/resources/mapper/tms/ProjectRecordDao.xml @@ -14,6 +14,7 @@ + - - - + + +