From d85a6a57890eaa207c7d30deccfaecb1bd8d72f3 Mon Sep 17 00:00:00 2001 From: "jiakun.lin" Date: Thu, 4 Mar 2021 11:16:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=99=E5=AD=A6=E5=AE=9E=E9=AA=8C=E6=88=90?= =?UTF-8?q?=E7=BB=A9=E7=AE=A1=E7=90=86=E6=8E=A5=E5=8F=A3=E6=8D=A2=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=20=E6=95=99=E5=B8=88=E7=AB=AF=E6=88=90=E7=BB=A9?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=88=A0=E9=99=A4=E6=8E=A5=E5=8F=A3=20?= =?UTF-8?q?=E5=AD=A6=E7=94=9F=E7=AB=AF=E6=9B=B4=E6=94=B9=E5=AE=9E=E9=AA=8C?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E4=B8=8D=E5=88=A4=E6=96=ADisdel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tms/api/AchievementManagementApi.java | 4 +++ .../AchievementManagementController.java | 10 +++++++ .../tms/dao/AchievementManagementDao.java | 2 ++ .../service/AchievementManagementService.java | 2 ++ .../AchievementManagementServiceImpl.java | 5 ++++ .../mapper/tms/AchievementManagementDao.xml | 26 ++++++++++++++++--- .../resources/mapper/tms/ProjectRecordDao.xml | 6 +++-- 7 files changed, 49 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/msdw/tms/api/AchievementManagementApi.java b/src/main/java/com/msdw/tms/api/AchievementManagementApi.java index 3a43f0e..92d05d4 100644 --- a/src/main/java/com/msdw/tms/api/AchievementManagementApi.java +++ b/src/main/java/com/msdw/tms/api/AchievementManagementApi.java @@ -85,4 +85,8 @@ public interface AchievementManagementApi { @ApiOperation(value = "成绩管理:虚拟仿真实验成绩管理", notes = "成绩管理:虚拟仿真实验成绩管理") R getImitationAchievement(@ApiParam(value = "projectId", required = false) Integer projectId); + + @ApiOperation(value = "成绩管理:实验教学成绩管理", notes = "成绩管理:实验教学成绩管理") + R getTeachAchievement(@RequestParam(required = true) Integer id); + } diff --git a/src/main/java/com/msdw/tms/controller/AchievementManagementController.java b/src/main/java/com/msdw/tms/controller/AchievementManagementController.java index 1d4e48f..05a12ef 100644 --- a/src/main/java/com/msdw/tms/controller/AchievementManagementController.java +++ b/src/main/java/com/msdw/tms/controller/AchievementManagementController.java @@ -287,4 +287,14 @@ public class AchievementManagementController implements AchievementManagementApi List result = service.getImitationAchievement(projectId); return R.ok().put("data", result); } + + /** + * 成绩管理:实验教学成绩管理 + */ + @Override + @GetMapping("/getTeachAchievement") + public R getTeachAchievement(@RequestParam(required = true) Integer id) { + List result = service.getTeachAchievement(id); + return R.ok().put("data", result); + } } diff --git a/src/main/java/com/msdw/tms/dao/AchievementManagementDao.java b/src/main/java/com/msdw/tms/dao/AchievementManagementDao.java index 959ce8a..27286ba 100644 --- a/src/main/java/com/msdw/tms/dao/AchievementManagementDao.java +++ b/src/main/java/com/msdw/tms/dao/AchievementManagementDao.java @@ -77,4 +77,6 @@ public interface AchievementManagementDao extends BaseMapper getImitationAchievement(Integer projectId); + + List getTeachAchievement(Integer id); } diff --git a/src/main/java/com/msdw/tms/service/AchievementManagementService.java b/src/main/java/com/msdw/tms/service/AchievementManagementService.java index 2aad068..b3a8ea7 100644 --- a/src/main/java/com/msdw/tms/service/AchievementManagementService.java +++ b/src/main/java/com/msdw/tms/service/AchievementManagementService.java @@ -47,4 +47,6 @@ public interface AchievementManagementService extends IService getImitationAchievement(Integer projectId); + + List getTeachAchievement(Integer id); } 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 5b51925..a51cf8c 100644 --- a/src/main/java/com/msdw/tms/service/impl/AchievementManagementServiceImpl.java +++ b/src/main/java/com/msdw/tms/service/impl/AchievementManagementServiceImpl.java @@ -299,4 +299,9 @@ public class AchievementManagementServiceImpl extends ServiceImpl getTeachAchievement(Integer id) { + return achievementManagementDao.getTeachAchievement(id); + } + } diff --git a/src/main/resources/mapper/tms/AchievementManagementDao.xml b/src/main/resources/mapper/tms/AchievementManagementDao.xml index b629038..669e2a1 100644 --- a/src/main/resources/mapper/tms/AchievementManagementDao.xml +++ b/src/main/resources/mapper/tms/AchievementManagementDao.xml @@ -82,10 +82,9 @@ - UPDATE tms_project_record tpr,hr_experimental_report tcr - SET tpr.isdel = 1, tcr.isdel = 1 - WHERE tpr.recordId = #{recordId} - AND tcr.reportId = #{reportId} + UPDATE tms_project_record tpr,tms_experimental_report ter + SET tpr.isdel = 1, ter.isdel = 1 + WHERE tpr.recordId = #{recordId} AND ter.reportId = #{reportId} UPDATE tms_experimental_report @@ -504,4 +503,23 @@ AND re.isdel = 0; + + \ 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 07900c6..b45954e 100644 --- a/src/main/resources/mapper/tms/ProjectRecordDao.xml +++ b/src/main/resources/mapper/tms/ProjectRecordDao.xml @@ -58,7 +58,8 @@ INNER JOIN hr_project_management t ON t.projectId = c.projectId INNER JOIN tms_project_record r ON r.recordId = c.recordId WHERE c.userId = #{userId} - and r.isdel = 0 +-- 教师端逻辑删除,学生端不做判断 +-- and r.isdel = 0 and projectPermissions = #{projectPermissions} and t.systemId = #{systemId} GROUP BY c.recordId desc @@ -82,7 +83,8 @@ 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 tpr.isdel = #{pro.isdel} +-- 教师端逻辑删除,学生端不做判断(下面这行删掉报错,用>=来表示不管0,1都让通过) + AND tpr.isdel >= #{pro.isdel} AND tp.projectPermissions !=0 AND ter.eventId = tpr.recordId