diff --git a/src/main/java/com/msdw/tms/api/AchievementManagementApi.java b/src/main/java/com/msdw/tms/api/AchievementManagementApi.java index 4d36616..42ff62a 100644 --- a/src/main/java/com/msdw/tms/api/AchievementManagementApi.java +++ b/src/main/java/com/msdw/tms/api/AchievementManagementApi.java @@ -8,6 +8,7 @@ import io.swagger.annotations.ApiParam; import org.springframework.web.bind.annotation.RequestParam; import javax.servlet.http.HttpServletResponse; +import java.util.List; @Api(value = "成绩管理", tags = "成绩管理") public interface AchievementManagementApi { @@ -79,10 +80,10 @@ public interface AchievementManagementApi { @ApiOperation(value = "发布成绩", notes = "发布成绩--修改教师签名") R updateSignatrue(@ApiParam(value = "实验报告主键reportId + 是否使用教师签名isSignature + 教师签名id signatureId + 教师评语comment") ExperimentalReportEntity entity); - @ApiOperation(value = "成绩管理删除项目", notes = "将项目管理下的成绩管理删除") - R deleteReportById(@ApiParam(value = "项目id", required = true) Integer projectId, + @ApiOperation(value = "成绩管理批量删除项目", notes = "将项目管理下的成绩管理批量删除") + R deleteReportByIds(@ApiParam(value = "项目id", required = true) List projectIds, @ApiParam(value = "项目类型(0练习,1考核)", required = true) Integer projectPermissions, - @ApiParam(value = "教学实验id",required = false) Integer id); + @ApiParam(value = "教学实验id",required = false) List ids); @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 d34e9bc..3b2f903 100644 --- a/src/main/java/com/msdw/tms/controller/AchievementManagementController.java +++ b/src/main/java/com/msdw/tms/controller/AchievementManagementController.java @@ -275,16 +275,15 @@ public class AchievementManagementController implements AchievementManagementApi /** - * 删除成绩管理中的项目 + * 批量删除成绩管理中的项目 * - * @param projectId * @return */ @Override @PostMapping("/deleteReportById") - public R deleteReportById(@RequestParam Integer projectId,@RequestParam Integer projectPermissions, - @RequestParam(required = false) Integer id) { - return service.deleteReportById(projectId,projectPermissions,id); + public R deleteReportByIds(@RequestParam List projectIds,@RequestParam Integer projectPermissions, + @RequestParam(required = false) List ids) { + return service.deleteReportById(projectIds,projectPermissions,ids); } /** diff --git a/src/main/java/com/msdw/tms/service/AchievementManagementService.java b/src/main/java/com/msdw/tms/service/AchievementManagementService.java index b72c3d8..b142c80 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 projectId,Integer projectPermissions, List id); List getImitationAchievement(Integer projectId); 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 cae8f16..40089a4 100644 --- a/src/main/java/com/msdw/tms/service/impl/AchievementManagementServiceImpl.java +++ b/src/main/java/com/msdw/tms/service/impl/AchievementManagementServiceImpl.java @@ -305,20 +305,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); + public R deleteReportById(List projectIds,Integer projectPermissions, List ids) { + if (projectPermissions == 1){//实验教学 + for (Integer id: ids) { + List 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); + for (Integer projectId: projectIds) {//虚仿实验 + List imitationAchievements = achievementManagementDao.getImitationAchievement(projectId); + for (AchievementManagementVO imitationAchievement: imitationAchievements) { + Integer reportId = imitationAchievement.getReportId(); + Integer recordId = imitationAchievement.getRecordId(); + achievementManagementDao.deleteReport(reportId,recordId); + } } }