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 2de76c0..3d2fa02 100644 --- a/src/main/java/com/msdw/tms/service/impl/AchievementManagementServiceImpl.java +++ b/src/main/java/com/msdw/tms/service/impl/AchievementManagementServiceImpl.java @@ -301,9 +301,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 ea8babc..5db3b8f 100644 --- a/src/main/resources/mapper/tms/AchievementManagementDao.xml +++ b/src/main/resources/mapper/tms/AchievementManagementDao.xml @@ -413,7 +413,8 @@ hpm.projectName, hpm.projectPermissions, hpm.systemId, - hpm.creationTime + hpm.creationTime, + hpm.isdel FROM hr_project_management hpm WHERE systemId = #{systemId} @@ -440,7 +441,8 @@ pm.projectName, pm.projectPermissions, et.creation_time AS creationTime, - ( SELECT count( * ) FROM tms_experimental_report her WHERE et.id = her.projectId AND her.isdel = 0 ) AS number + ( SELECT count( * ) FROM tms_experimental_report her WHERE et.id = her.projectId AND her.isdel = 0 ) AS number, + et.is_del FROM tms_experimental_teaching et, hr_project_management pm diff --git a/src/main/resources/mapper/tms/ClassTeachingDao.xml b/src/main/resources/mapper/tms/ClassTeachingDao.xml index 3265d03..6a54760 100644 --- a/src/main/resources/mapper/tms/ClassTeachingDao.xml +++ b/src/main/resources/mapper/tms/ClassTeachingDao.xml @@ -117,4 +117,11 @@ WHERE id = #{id} + + + UPDATE tms_experimental_teaching + SET is_del = 1 + WHERE + id = #{id} + \ No newline at end of file diff --git a/src/main/resources/mapper/tms/ExperimentalTeachingDao.xml b/src/main/resources/mapper/tms/ExperimentalTeachingDao.xml index 84d123d..bc84843 100644 --- a/src/main/resources/mapper/tms/ExperimentalTeachingDao.xml +++ b/src/main/resources/mapper/tms/ExperimentalTeachingDao.xml @@ -11,7 +11,7 @@ project_id, project_name, (select count(*) - from tms_project_record WHERE projectId = project_id) as experimental_number, + from tms_project_record WHERE projectId = project_id AND tms_project_record.isdel = 0) as experimental_number, experiment_duration, type, start_time,