From cdf31a09f875d362d22227f168b26f603d50a138 Mon Sep 17 00:00:00 2001 From: "jiakun.lin" Date: Fri, 5 Mar 2021 15:08:29 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=8E=A5=E5=8F=A3=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=EF=BC=8C=E6=95=99=E5=AD=A6=E5=AE=9E=E9=AA=8C=E6=94=B9?= =?UTF-8?q?=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 @@