From 201b6f5b35abfc0697614e363c9a05e1dd151fd5 Mon Sep 17 00:00:00 2001 From: "rong.liu" Date: Tue, 23 Mar 2021 11:53:25 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AD=A6=E7=94=9F=E7=AB=AF=E5=AE=9E=E9=AA=8C?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E8=80=83=E6=A0=B8=E5=88=97=E8=A1=A8=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E7=B3=BB=E7=BB=9F=E7=AD=9B=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tms/api/ProjectRcordControllerApi.java | 2 +- .../controller/ProjectRecordController.java | 73 +++++++++++-------- .../com/msdw/tms/dao/ProjectRecordDao.java | 6 +- .../msdw/tms/entity/vo/ProjectRecordVo.java | 13 +++- .../tms/service/ProjectRecordService.java | 2 +- .../impl/ProjectRecordServiceImpl.java | 12 +-- .../resources/mapper/tms/ProjectRecordDao.xml | 39 +++++----- 7 files changed, 80 insertions(+), 67 deletions(-) diff --git a/src/main/java/com/msdw/tms/api/ProjectRcordControllerApi.java b/src/main/java/com/msdw/tms/api/ProjectRcordControllerApi.java index 06eb889..655e53c 100644 --- a/src/main/java/com/msdw/tms/api/ProjectRcordControllerApi.java +++ b/src/main/java/com/msdw/tms/api/ProjectRcordControllerApi.java @@ -25,7 +25,7 @@ public interface ProjectRcordControllerApi { R queryUserRecord(Integer page,Integer size,Integer userId,Integer projectPermissions,Integer systemId); @ApiOperation(value = "用户端教学实验记录",notes = "用户端教学实验记录") - R getUserExperimentscore(Integer page,Integer size,Integer userid); + R getUserExperimentscore(Integer page,Integer size,Integer userid, Integer systemId); @ApiOperation(value = "个人实验概览",notes = "个人实验概览") R queryScore(Integer userId); diff --git a/src/main/java/com/msdw/tms/controller/ProjectRecordController.java b/src/main/java/com/msdw/tms/controller/ProjectRecordController.java index 55374c2..1f8ecdf 100644 --- a/src/main/java/com/msdw/tms/controller/ProjectRecordController.java +++ b/src/main/java/com/msdw/tms/controller/ProjectRecordController.java @@ -18,10 +18,8 @@ import java.util.HashMap; import java.util.List; /** - * - * - * @author - * @email + * @author + * @email * @date 2020-08-19 16:07:02 */ @RestController @@ -35,27 +33,32 @@ 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 ){ + public R list(@RequestParam Integer page, @RequestParam Integer size, @RequestParam Integer month, @RequestParam String startTime, @RequestParam String endTime, + @RequestParam Integer recordState, @RequestParam String condition) { ProjectRecordVo recordVo = new ProjectRecordVo(); - if(!StringUtils.isEmpty(month)) { + if (!StringUtils.isEmpty(month)) { recordVo.setMonth(month); - }if(!StringUtils.isEmpty(startTime)) { + } + if (!StringUtils.isEmpty(startTime)) { recordVo.setStartTime(startTime); - }if(!StringUtils.isEmpty(endTime)) { + } + if (!StringUtils.isEmpty(endTime)) { recordVo.setEndTime(endTime); - }if(!StringUtils.isEmpty(recordState)) { + } + if (!StringUtils.isEmpty(recordState)) { recordVo.setRecordstate(recordState); - }if(!StringUtils.isEmpty(condition)){ + } + if (!StringUtils.isEmpty(condition)) { recordVo.setCondition(condition); } - PageUtils page1 = projectRecordService.querySchoolRecord(page,size,recordVo); + PageUtils page1 = projectRecordService.querySchoolRecord(page, size, recordVo); return R.ok().put("page", page1); } /** * 用户端虚拟仿真实验记录 + * * @param page * @param size * @param @@ -63,13 +66,14 @@ public class ProjectRecordController implements ProjectRcordControllerApi { */ @Override @GetMapping("/user/record") - public R queryUserRecord(@RequestParam Integer page,@RequestParam Integer size,@RequestParam Integer userId,@RequestParam Integer projectPermissions,@RequestParam Integer systemId){ - PageUtils page1 = projectRecordService.queryPage(page,size,userId,projectPermissions,systemId); + public R queryUserRecord(@RequestParam Integer page, @RequestParam Integer size, @RequestParam Integer userId, @RequestParam Integer projectPermissions, @RequestParam Integer systemId) { + PageUtils page1 = projectRecordService.queryPage(page, size, userId, projectPermissions, systemId); return R.ok().put("data", page1); } /** * 科大用户端虚拟仿真实验记录 + * * @param page * @param size * @param @@ -77,13 +81,14 @@ public class ProjectRecordController implements ProjectRcordControllerApi { */ @Override @GetMapping("/user/kdRecord") - public R kdRecord(@RequestParam Integer page,@RequestParam Integer size,@RequestParam Integer userId,@RequestParam Integer projectPermissions,@RequestParam Integer systemId){ - PageUtils page1 = projectRecordService.getByKDUserRecord(page,size,userId,projectPermissions,systemId); + public R kdRecord(@RequestParam Integer page, @RequestParam Integer size, @RequestParam Integer userId, @RequestParam Integer projectPermissions, @RequestParam Integer systemId) { + PageUtils page1 = projectRecordService.getByKDUserRecord(page, size, userId, projectPermissions, systemId); return R.ok().put("data", page1); } /** * 用户端教学实验记录 + * * @param page * @param size * @param userid @@ -91,20 +96,21 @@ public class ProjectRecordController implements ProjectRcordControllerApi { */ @Override @GetMapping("/user/experimentRecord") - public R getUserExperimentscore(@RequestParam Integer page,@RequestParam Integer size,@RequestParam Integer userid){ - PageUtils page1 = projectRecordService.queryExperimentPage(page,size,userid); + public R getUserExperimentscore(@RequestParam Integer page, @RequestParam Integer size, @RequestParam Integer userid, @RequestParam Integer systemId) { + PageUtils page1 = projectRecordService.queryExperimentPage(page, size, userid, systemId); return R.ok().put("data", page1); } /** * 个人实验预览 + * * @param userId * @return */ @Override @GetMapping("/user/queryScore/{userId}") - public R queryScore(@PathVariable("userId") Integer userId){ + public R queryScore(@PathVariable("userId") Integer userId) { ProjectRecordVo projectRecord = projectRecordService.queryScore(userId); return R.ok().put("data", projectRecord); @@ -112,12 +118,13 @@ public class ProjectRecordController implements ProjectRcordControllerApi { /** * 个人实验预览 + * * @param userid * @return */ @Override @GetMapping("/user/score/{userId}") - public R getUserScore(@PathVariable("userId") Integer userid){ + public R getUserScore(@PathVariable("userId") Integer userid) { ProjectRecordVo projectRecord = projectRecordService.queryUserScore(userid); return R.ok().put("data", projectRecord); @@ -125,35 +132,37 @@ public class ProjectRecordController implements ProjectRcordControllerApi { /** * 导出个人虚拟仿真实验记录 + * * @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); + public void exportProjectRecord(HttpServletResponse response, @RequestParam("userId") Integer userId) throws Exception { + projectRecordService.exportProjectRecord(response, userId); } /** * 导出个人教学实验记录 + * * @param response * @param userId * @throws Exception */ @Override @GetMapping("/user/exportExperimentProjectRecord") - public void exportExperimentProjectRecord(HttpServletResponse response,@RequestParam("userId") Integer userId)throws Exception{ - projectRecordService.exportExperimentProjectRecord(response,userId); + public void exportExperimentProjectRecord(HttpServletResponse response, @RequestParam("userId") Integer userId) throws Exception { + projectRecordService.exportExperimentProjectRecord(response, userId); } /** * 信息 */ @GetMapping("/info/{recordid}") - public R info(@PathVariable("recordid") Integer recordid){ - ProjectRecordEntity projectRecord = projectRecordService.getById(recordid); + public R info(@PathVariable("recordid") Integer recordid) { + ProjectRecordEntity projectRecord = projectRecordService.getById(recordid); return R.ok().put("projectRecord", projectRecord); } @@ -162,8 +171,8 @@ public class ProjectRecordController implements ProjectRcordControllerApi { * 保存 */ @RequestMapping("/save") - public R save(@RequestBody ProjectRecordEntity projectRecord){ - projectRecordService.save(projectRecord); + public R save(@RequestBody ProjectRecordEntity projectRecord) { + projectRecordService.save(projectRecord); return R.ok(); } @@ -173,10 +182,10 @@ public class ProjectRecordController implements ProjectRcordControllerApi { */ @Override @PutMapping("/update") - public R update(@RequestBody ProjectRecordEntity projectRecord){ + public R update(@RequestBody ProjectRecordEntity projectRecord) { boolean result = projectRecordService.updateUserRecord(projectRecord); - return R.ok().put("data",result); + return R.ok().put("data", result); } /** @@ -184,8 +193,8 @@ public class ProjectRecordController implements ProjectRcordControllerApi { */ @Override @DeleteMapping("/delete") - public R delete(@RequestBody Integer[] recordids){ - projectRecordService.removeByIds(Arrays.asList(recordids)); + public R delete(@RequestBody Integer[] recordids) { + projectRecordService.removeByIds(Arrays.asList(recordids)); return R.ok(); } diff --git a/src/main/java/com/msdw/tms/dao/ProjectRecordDao.java b/src/main/java/com/msdw/tms/dao/ProjectRecordDao.java index ef3a655..c1a5785 100644 --- a/src/main/java/com/msdw/tms/dao/ProjectRecordDao.java +++ b/src/main/java/com/msdw/tms/dao/ProjectRecordDao.java @@ -23,11 +23,11 @@ import java.util.List; @Mapper public interface ProjectRecordDao extends BaseMapper { - IPage getByKDUserRecord(Page page,@Param("pro") ProjectRecordEntity projectRecordEntity,Integer projectPermissions); + IPage getByKDUserRecord(Page page, @Param("pro") ProjectRecordEntity projectRecordEntity, Integer projectPermissions); - IPage getByUserRecord(Page page, @Param("userId") Integer userId, @Param("projectPermissions") Integer projectPermissions,@Param("systemId") Integer systemId); + IPage getByUserRecord(Page page, @Param("userId") Integer userId, @Param("projectPermissions") Integer projectPermissions, @Param("systemId") Integer systemId); - IPage getByUserExperimentRecord(Page page, @Param("pro") ProjectRecordEntity projectRecordEntity); + IPage getByUserExperimentRecord(Page page, @Param("pro") ProjectRecordEntity projectRecordEntity, Integer systemId); List getByUserRecordImport(ProjectRecordEntity projectRecordEntity); 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 adb3cfc..fc7884a 100644 --- a/src/main/java/com/msdw/tms/entity/vo/ProjectRecordVo.java +++ b/src/main/java/com/msdw/tms/entity/vo/ProjectRecordVo.java @@ -51,7 +51,7 @@ public class ProjectRecordVo extends ProjectRecordEntity implements Serializable /** * 平均分 */ - private double avgScore; + private double avgScore; /** * 几个月 */ @@ -59,7 +59,7 @@ public class ProjectRecordVo extends ProjectRecordEntity implements Serializable /** * 查询条件 */ - private String condition; + private String condition; /** * 开始时间 */ @@ -76,7 +76,9 @@ public class ProjectRecordVo extends ProjectRecordEntity implements Serializable * 待评分 */ private Integer tobescored; - /** 记录状态(0 未修改,1 已修改)*/ + /** + * 记录状态(0 未修改,1 已修改) + */ private Integer recordState; // =====================================记录实验项目信息 /** @@ -109,4 +111,9 @@ public class ProjectRecordVo extends ProjectRecordEntity implements Serializable */ private Integer schoolId; + /** + * 系统id + */ + private Integer systemId; + } diff --git a/src/main/java/com/msdw/tms/service/ProjectRecordService.java b/src/main/java/com/msdw/tms/service/ProjectRecordService.java index 5da29f2..d031075 100644 --- a/src/main/java/com/msdw/tms/service/ProjectRecordService.java +++ b/src/main/java/com/msdw/tms/service/ProjectRecordService.java @@ -20,7 +20,7 @@ public interface ProjectRecordService extends IService { PageUtils queryPage(Integer page, Integer size, Integer userId, Integer projectPermissions,Integer systemId); - PageUtils queryExperimentPage(Integer page, Integer size, Integer userid); + PageUtils queryExperimentPage(Integer page, Integer size, Integer userid,Integer systemId); ProjectRecordVo queryUserScore(Integer userId); 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 89c6c31..972a7fa 100644 --- a/src/main/java/com/msdw/tms/service/impl/ProjectRecordServiceImpl.java +++ b/src/main/java/com/msdw/tms/service/impl/ProjectRecordServiceImpl.java @@ -38,14 +38,14 @@ public class ProjectRecordServiceImpl extends ServiceImpl page1 = new Page<>(page, size); - IPage projectRecordVos = this.baseMapper.getByKDUserRecord(page1,projectRecord,projectPermissions); + IPage projectRecordVos = this.baseMapper.getByKDUserRecord(page1, projectRecord, projectPermissions); PageUtils questionsPage = new PageUtils(projectRecordVos); @@ -53,7 +53,7 @@ public class ProjectRecordServiceImpl extends ServiceImpl page1 = new Page<>(page, size); - IPage projectRecordVos = this.baseMapper.getByUserRecord(page1, userId, projectPermissions,systemId); + IPage projectRecordVos = this.baseMapper.getByUserRecord(page1, userId, projectPermissions, systemId); PageUtils questionsPage = new PageUtils(projectRecordVos); @@ -69,14 +69,14 @@ public class ProjectRecordServiceImpl extends ServiceImpl page1 = new Page<>(page, size); - IPage projectRecordVos = this.baseMapper.getByUserExperimentRecord(page1, projectRecord); + IPage projectRecordVos = this.baseMapper.getByUserExperimentRecord(page1, projectRecord, systemId); PageUtils questionsPage = new PageUtils(projectRecordVos); diff --git a/src/main/resources/mapper/tms/ProjectRecordDao.xml b/src/main/resources/mapper/tms/ProjectRecordDao.xml index fd6d0cd..94c092d 100644 --- a/src/main/resources/mapper/tms/ProjectRecordDao.xml +++ b/src/main/resources/mapper/tms/ProjectRecordDao.xml @@ -22,26 +22,21 @@ - + SELECT her.reportId as reportId, + her.projectId, + projectName, + her.score, + her.timeConsuming, + her.startTime, + her.creationTime as endTime, + her.className + FROM hr_experimental_report her + LEFT JOIN hr_project_management tp ON her.projectId = tp.projectId + WHERE her.studentId = #{pro.userid} + AND her.isdel = 0 + AND tp.projectPermissions = #{projectPermissions} + order by her.creationTime desc @@ -81,12 +76,14 @@ startingTime as startTime, endTime, recordState, - tet.experimental_class_name as experimentalClassName + tet.experimental_class_name as experimentalClassName, + systemId FROM tms_project_record tpr LEFT JOIN hr_project_management tp ON tpr.projectId = tp.projectId LEFT JOIN tms_experimental_teaching tet ON tet.project_id = tpr.projectId LEFT JOIN tms_experimental_report ter ON ter.projectId = tet.id WHERE tpr.userId = #{pro.userid} + and systemId = #{systemId} AND tpr.isdel >= #{pro.isdel} AND tp.projectPermissions !=0 AND