From cd9da476d311294a1bcb40995b56922f2bdedd5a Mon Sep 17 00:00:00 2001 From: "jiakun.lin" Date: Thu, 4 Mar 2021 14:08:45 +0800 Subject: [PATCH 01/23] =?UTF-8?q?=E8=A1=A8=E5=88=97=E5=90=8D=E5=86=B2?= =?UTF-8?q?=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/mapper/tms/ProjectRecordDao.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/resources/mapper/tms/ProjectRecordDao.xml b/src/main/resources/mapper/tms/ProjectRecordDao.xml index b45954e..bb906fe 100644 --- a/src/main/resources/mapper/tms/ProjectRecordDao.xml +++ b/src/main/resources/mapper/tms/ProjectRecordDao.xml @@ -71,7 +71,7 @@ ter.reportId, tpr.recordId, tpr.projectId, - projectName, + tp.projectName, score, timeSum, startingTime as startTime, @@ -83,7 +83,6 @@ 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} --- 教师端逻辑删除,学生端不做判断(下面这行删掉报错,用>=来表示不管0,1都让通过) AND tpr.isdel >= #{pro.isdel} AND tp.projectPermissions !=0 AND From 7f587b2710228047288b4e97be47ca3dc7235e2e Mon Sep 17 00:00:00 2001 From: "rong.liu" Date: Thu, 4 Mar 2021 14:32:37 +0800 Subject: [PATCH 02/23] =?UTF-8?q?=E5=A2=9E=E5=8A=A0sql=E9=80=BB=E8=BE=91?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/mapper/tms/AchievementManagementDao.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/mapper/tms/AchievementManagementDao.xml b/src/main/resources/mapper/tms/AchievementManagementDao.xml index b629038..e2740a6 100644 --- a/src/main/resources/mapper/tms/AchievementManagementDao.xml +++ b/src/main/resources/mapper/tms/AchievementManagementDao.xml @@ -372,7 +372,7 @@ WHERE project_id = #{projectId} + + From bf633ab7dcb6a7edfd38ed662aeffb9fd3979f51 Mon Sep 17 00:00:00 2001 From: "rong.liu" Date: Thu, 4 Mar 2021 15:29:12 +0800 Subject: [PATCH 04/23] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/tms/AchievementManagementDao.xml | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/main/resources/mapper/tms/AchievementManagementDao.xml b/src/main/resources/mapper/tms/AchievementManagementDao.xml index 56f8fb7..ed47f85 100644 --- a/src/main/resources/mapper/tms/AchievementManagementDao.xml +++ b/src/main/resources/mapper/tms/AchievementManagementDao.xml @@ -412,12 +412,20 @@ + + UPDATE tms_experimental_report + + + instructor=#{instructor, jdbcType=VARCHAR}, + + + + period=#{period, jdbcType=INTEGER}, + + + proName=#{proName, jdbcType=VARCHAR}, + + + purpose=#{purpose, jdbcType=VARCHAR}, + + + summarize=#{summarize, jdbcType=VARCHAR}, + + + + WHERE reportId = #{reportId} + + + \ No newline at end of file From f54c577673ed17d2cf8d8b8354024dc22f31bfe7 Mon Sep 17 00:00:00 2001 From: "rong.liu" Date: Thu, 4 Mar 2021 16:44:38 +0800 Subject: [PATCH 07/23] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/msdw/tms/entity/resp/GetByUserRecordResp.java | 9 +++++++++ src/main/resources/mapper/tms/ProjectRecordDao.xml | 6 ++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/msdw/tms/entity/resp/GetByUserRecordResp.java b/src/main/java/com/msdw/tms/entity/resp/GetByUserRecordResp.java index 386b14b..74a4be1 100644 --- a/src/main/java/com/msdw/tms/entity/resp/GetByUserRecordResp.java +++ b/src/main/java/com/msdw/tms/entity/resp/GetByUserRecordResp.java @@ -23,6 +23,7 @@ public class GetByUserRecordResp { private Integer timeSum; private Integer userId; private Integer systemId; + private Integer reportId; public Integer getSystemId() { return systemId; @@ -95,4 +96,12 @@ public class GetByUserRecordResp { public void setUserId(Integer userId) { this.userId = userId; } + + public Integer getReportId() { + return reportId; + } + + public void setReportId(Integer reportId) { + this.reportId = reportId; + } } diff --git a/src/main/resources/mapper/tms/ProjectRecordDao.xml b/src/main/resources/mapper/tms/ProjectRecordDao.xml index bb906fe..7695449 100644 --- a/src/main/resources/mapper/tms/ProjectRecordDao.xml +++ b/src/main/resources/mapper/tms/ProjectRecordDao.xml @@ -45,7 +45,8 @@ --> From cdf31a09f875d362d22227f168b26f603d50a138 Mon Sep 17 00:00:00 2001 From: "jiakun.lin" Date: Fri, 5 Mar 2021 15:08:29 +0800 Subject: [PATCH 13/23] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=EF=BC=8C=E6=95=99=E5=AD=A6=E5=AE=9E=E9=AA=8C?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=E5=81=87=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tms/api/AchievementManagementApi.java | 6 ++++-- .../AchievementManagementController.java | 5 +++-- .../ExperimentalTeachingController.java | 3 ++- .../com/msdw/tms/dao/ClassTeachingDao.java | 2 ++ .../com/msdw/tms/entity/ResultsEntity.java | 2 ++ .../com/msdw/tms/entity/vo/ResultsVo.java | 2 ++ .../service/AchievementManagementService.java | 2 +- .../service/ExperimentalTeachingService.java | 1 + .../AchievementManagementServiceImpl.java | 19 +++++++++++++++++-- .../impl/ExperimentalTeachingServiceImpl.java | 10 ++++++++++ .../mapper/tms/AchievementManagementDao.xml | 14 ++++++-------- .../resources/mapper/tms/ClassTeachingDao.xml | 7 +++++++ .../mapper/tms/ExperimentalTeachingDao.xml | 2 +- 13 files changed, 58 insertions(+), 17 deletions(-) diff --git a/src/main/java/com/msdw/tms/api/AchievementManagementApi.java b/src/main/java/com/msdw/tms/api/AchievementManagementApi.java index b6a7e74..4d36616 100644 --- a/src/main/java/com/msdw/tms/api/AchievementManagementApi.java +++ b/src/main/java/com/msdw/tms/api/AchievementManagementApi.java @@ -79,8 +79,10 @@ public interface AchievementManagementApi { @ApiOperation(value = "发布成绩", notes = "发布成绩--修改教师签名") R updateSignatrue(@ApiParam(value = "实验报告主键reportId + 是否使用教师签名isSignature + 教师签名id signatureId + 教师评语comment") ExperimentalReportEntity entity); - @ApiOperation(value = "成绩管理删除项目", notes = "将项目管理表isdel置1") - R deleteReportByProjectId(@ApiParam(value = "项目id", required = true) Integer projectId); + @ApiOperation(value = "成绩管理删除项目", notes = "将项目管理下的成绩管理删除") + R deleteReportById(@ApiParam(value = "项目id", required = true) Integer projectId, + @ApiParam(value = "项目类型(0练习,1考核)", required = true) Integer projectPermissions, + @ApiParam(value = "教学实验id",required = false) Integer id); @ApiOperation(value = "成绩管理:虚拟仿真实验成绩管理", notes = "成绩管理:虚拟仿真实验成绩管理") diff --git a/src/main/java/com/msdw/tms/controller/AchievementManagementController.java b/src/main/java/com/msdw/tms/controller/AchievementManagementController.java index 4b027b8..d34e9bc 100644 --- a/src/main/java/com/msdw/tms/controller/AchievementManagementController.java +++ b/src/main/java/com/msdw/tms/controller/AchievementManagementController.java @@ -282,8 +282,9 @@ public class AchievementManagementController implements AchievementManagementApi */ @Override @PostMapping("/deleteReportById") - public R deleteReportByProjectId(@RequestParam Integer projectId) { - return service.deleteReportByProjectId(projectId); + public R deleteReportById(@RequestParam Integer projectId,@RequestParam Integer projectPermissions, + @RequestParam(required = false) Integer id) { + return service.deleteReportById(projectId,projectPermissions,id); } /** diff --git a/src/main/java/com/msdw/tms/controller/ExperimentalTeachingController.java b/src/main/java/com/msdw/tms/controller/ExperimentalTeachingController.java index f070234..9b0d5ac 100644 --- a/src/main/java/com/msdw/tms/controller/ExperimentalTeachingController.java +++ b/src/main/java/com/msdw/tms/controller/ExperimentalTeachingController.java @@ -124,7 +124,8 @@ public class ExperimentalTeachingController implements ExperimentalTeachingContr @Override @PostMapping("/delete") public R delete(@RequestBody Integer[] ids){ - experimentalTeachingService.removeByIds(Arrays.asList(ids)); + //改为假删除tms_experimental_teaching + experimentalTeachingService.deleteTeachByIds(Arrays.asList(ids)); return R.ok(); } diff --git a/src/main/java/com/msdw/tms/dao/ClassTeachingDao.java b/src/main/java/com/msdw/tms/dao/ClassTeachingDao.java index 5cbc435..3ad2f27 100644 --- a/src/main/java/com/msdw/tms/dao/ClassTeachingDao.java +++ b/src/main/java/com/msdw/tms/dao/ClassTeachingDao.java @@ -26,4 +26,6 @@ public interface ClassTeachingDao { int updateExperimentalNumber(Integer number, Integer id); + + void updateIsDel(Integer id); } diff --git a/src/main/java/com/msdw/tms/entity/ResultsEntity.java b/src/main/java/com/msdw/tms/entity/ResultsEntity.java index 715cd3a..4ec085d 100644 --- a/src/main/java/com/msdw/tms/entity/ResultsEntity.java +++ b/src/main/java/com/msdw/tms/entity/ResultsEntity.java @@ -48,6 +48,8 @@ public class ResultsEntity{ //实验名称 private String experimentalName; + private Integer isdel; + } diff --git a/src/main/java/com/msdw/tms/entity/vo/ResultsVo.java b/src/main/java/com/msdw/tms/entity/vo/ResultsVo.java index 791c06e..cb68385 100644 --- a/src/main/java/com/msdw/tms/entity/vo/ResultsVo.java +++ b/src/main/java/com/msdw/tms/entity/vo/ResultsVo.java @@ -40,4 +40,6 @@ public class ResultsVo { //用户id private Integer userId; + private Integer isdel; + } diff --git a/src/main/java/com/msdw/tms/service/AchievementManagementService.java b/src/main/java/com/msdw/tms/service/AchievementManagementService.java index 4b78743..b72c3d8 100644 --- a/src/main/java/com/msdw/tms/service/AchievementManagementService.java +++ b/src/main/java/com/msdw/tms/service/AchievementManagementService.java @@ -44,7 +44,7 @@ public interface AchievementManagementService extends IService getImitationAchievement(Integer projectId); diff --git a/src/main/java/com/msdw/tms/service/ExperimentalTeachingService.java b/src/main/java/com/msdw/tms/service/ExperimentalTeachingService.java index 3bea116..491c511 100644 --- a/src/main/java/com/msdw/tms/service/ExperimentalTeachingService.java +++ b/src/main/java/com/msdw/tms/service/ExperimentalTeachingService.java @@ -16,4 +16,5 @@ public interface ExperimentalTeachingService extends IService asList); } 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 7eae17b..545112a 100644 --- a/src/main/java/com/msdw/tms/service/impl/AchievementManagementServiceImpl.java +++ b/src/main/java/com/msdw/tms/service/impl/AchievementManagementServiceImpl.java @@ -284,9 +284,24 @@ public class AchievementManagementServiceImpl extends ServiceImpl teachAchievements = achievementManagementDao.getTeachAchievement(id); + for (AchievementManagementVO teachAchievement :teachAchievements) { + Integer reportId = teachAchievement.getReportId(); + Integer recordId = teachAchievement.getRecordId(); + achievementManagementDao.deleteReport(reportId,recordId); + } + }else { + List imitationAchievements = achievementManagementDao.getImitationAchievement(projectId); + for (AchievementManagementVO imitationAchievement: imitationAchievements) { + Integer reportId = imitationAchievement.getReportId(); + Integer recordId = imitationAchievement.getRecordId(); + achievementManagementDao.deleteReport(reportId,recordId); + } + } + - achievementManagementDao.deleteReportById(projectId); return R.ok(); } diff --git a/src/main/java/com/msdw/tms/service/impl/ExperimentalTeachingServiceImpl.java b/src/main/java/com/msdw/tms/service/impl/ExperimentalTeachingServiceImpl.java index 0e6843f..73df989 100644 --- a/src/main/java/com/msdw/tms/service/impl/ExperimentalTeachingServiceImpl.java +++ b/src/main/java/com/msdw/tms/service/impl/ExperimentalTeachingServiceImpl.java @@ -15,6 +15,8 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.util.List; + @Service("experimentalTeachingService") public class ExperimentalTeachingServiceImpl extends ServiceImpl implements ExperimentalTeachingService { @@ -50,4 +52,12 @@ public class ExperimentalTeachingServiceImpl extends ServiceImpl asList) { + int size = asList.size(); + for (int i = 0; i < size; i++) { + classTeachingDao.updateIsDel(asList.get(i)); + } + } + } diff --git a/src/main/resources/mapper/tms/AchievementManagementDao.xml b/src/main/resources/mapper/tms/AchievementManagementDao.xml index 719e3cf..09d7a0f 100644 --- a/src/main/resources/mapper/tms/AchievementManagementDao.xml +++ b/src/main/resources/mapper/tms/AchievementManagementDao.xml @@ -393,13 +393,11 @@ + SELECT - id, - experimental_class_name, - experimental_name, - project_id, - project_name, - (select count(*) - from tms_project_record WHERE projectId = project_id AND tms_project_record.isdel = 0) as experimental_number, - experiment_duration, - type, - start_time, - stop_time, - status, - invitation_code, - is_code, - user_id, - creation_time, - surplus_time + id, + experimental_class_name, + experimental_name, + project_id, + project_name, + ( SELECT count( * ) FROM tms_project_record WHERE projectId = project_id AND tms_project_record.isdel = 0 ) AS experimental_number, + experiment_duration, + type, + start_time, + stop_time, + STATUS, + invitation_code, + is_code, + user_id, + creation_time, + surplus_time , + systemId FROM - tms_experimental_teaching + tms_experimental_teaching t + inner join hr_project_management m on m.projectId = t.project_id WHERE - is_del = 0 + t.is_del = 0 AND `type`=#{exp.type,jdbcType=INTEGER} From da395c66d796bc224e5eaedb706f6752e116d1cd Mon Sep 17 00:00:00 2001 From: "jiakun.lin" Date: Fri, 5 Mar 2021 16:19:29 +0800 Subject: [PATCH 16/23] =?UTF-8?q?=E6=95=99=E5=AD=A6=E5=AE=9E=E9=AA=8C?= =?UTF-8?q?=E6=88=90=E7=BB=A9=E6=8A=A5=E5=91=8A=E6=95=B0=E9=87=8F=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AchievementManagementServiceImpl.java | 4 ++ .../mapper/tms/AchievementManagementDao.xml | 57 ++++++++++++++++++- 2 files changed, 58 insertions(+), 3 deletions(-) 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 3d2fa02..cae8f16 100644 --- a/src/main/java/com/msdw/tms/service/impl/AchievementManagementServiceImpl.java +++ b/src/main/java/com/msdw/tms/service/impl/AchievementManagementServiceImpl.java @@ -110,6 +110,10 @@ public class AchievementManagementServiceImpl extends ServiceImpl newList(ResultsVo vo, Integer page, Integer size) { List newList = achievementManagementDao.newList(vo); + for (ResultsEntity entity : newList) { + Integer number = achievementManagementDao.getTeachAchievement(entity.getId()).size(); + entity.setNumber(number); + } return newList; } diff --git a/src/main/resources/mapper/tms/AchievementManagementDao.xml b/src/main/resources/mapper/tms/AchievementManagementDao.xml index 5db3b8f..6be9400 100644 --- a/src/main/resources/mapper/tms/AchievementManagementDao.xml +++ b/src/main/resources/mapper/tms/AchievementManagementDao.xml @@ -432,6 +432,37 @@ ORDER BY hpm.creationTime DESC + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - SELECT schoolName, experimental_class_name, @@ -568,7 +620,6 @@ INNER JOIN school s ON s.schoolId = u.schoolId INNER JOIN student stu ON stu.userId = u.userId WHERE t.id = #{id} - AND t.is_del = 0 AND report.isdel = 0 From c8e8056c217863e0cbc6338897f3f9fca1e59abf Mon Sep 17 00:00:00 2001 From: "rong.liu" Date: Fri, 5 Mar 2021 16:32:31 +0800 Subject: [PATCH 17/23] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AD=A6=E7=94=9F?= =?UTF-8?q?=E7=AB=AF=E5=AE=9E=E9=AA=8C=E6=80=BB=E6=97=B6=E9=95=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/mapper/tms/ProjectRecordDao.xml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/main/resources/mapper/tms/ProjectRecordDao.xml b/src/main/resources/mapper/tms/ProjectRecordDao.xml index 7695449..faa324a 100644 --- a/src/main/resources/mapper/tms/ProjectRecordDao.xml +++ b/src/main/resources/mapper/tms/ProjectRecordDao.xml @@ -113,6 +113,15 @@ tpr.submitTime DESC + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + SELECT schoolName, @@ -612,7 +612,8 @@ report.reportId, r.submitTime, stu.studentId, - t.id as projectId + t.id as projectId, + experimental_name as experimentalName FROM tms_experimental_teaching t INNER JOIN tms_experimental_report report ON report.projectId = t.id INNER JOIN tms_project_record r ON r.recordId = report.eventId