diff --git a/src/main/java/com/msdw/tms/TmsApplication.java b/src/main/java/com/msdw/tms/TmsApplication.java index e2715d0..1e5e101 100644 --- a/src/main/java/com/msdw/tms/TmsApplication.java +++ b/src/main/java/com/msdw/tms/TmsApplication.java @@ -6,7 +6,7 @@ import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; import org.springframework.scheduling.annotation.EnableScheduling; -@EnableScheduling//定时任务 +//@EnableScheduling//定时任务 @SpringBootApplication public class TmsApplication extends SpringBootServletInitializer { diff --git a/src/main/java/com/msdw/tms/api/AchievementManagementApi.java b/src/main/java/com/msdw/tms/api/AchievementManagementApi.java index 61eb7ed..b6b2635 100644 --- a/src/main/java/com/msdw/tms/api/AchievementManagementApi.java +++ b/src/main/java/com/msdw/tms/api/AchievementManagementApi.java @@ -55,7 +55,7 @@ public interface AchievementManagementApi { // R updateScore(@ApiParam(value = "recordid和score") ProjectRecordEntity entity); @ApiOperation(value = "删除实验报告", notes = "根据实验记录主键reportId和实验报告主键recordId删除实验报告") - R deleteReport(@ApiParam(value = "实验记录主键", required = true) Integer reportId, @ApiParam(value = "实验报告主键", required = true) @RequestParam Integer recordId); + R deleteReport(@ApiParam(value = "实验记录主键", required = true) List reportId, @ApiParam(value = "实验报告主键", required = true) @RequestParam List recordId); @ApiOperation(value = "班级实验报告列表查询", notes = "班级实验报告列表查询") R queryEvaluationReport(@ApiParam(value = "搜索内容(学校名称/学生姓名)", required = false) String searchContant, diff --git a/src/main/java/com/msdw/tms/controller/AchievementManagementController.java b/src/main/java/com/msdw/tms/controller/AchievementManagementController.java index 990ffb3..38fbcb4 100644 --- a/src/main/java/com/msdw/tms/controller/AchievementManagementController.java +++ b/src/main/java/com/msdw/tms/controller/AchievementManagementController.java @@ -203,7 +203,16 @@ public class AchievementManagementController implements AchievementManagementApi */ @Override @PostMapping("/deleteReport") - public R deleteReport(@RequestParam Integer reportId, @RequestParam Integer recordId) { + public R deleteReport(@RequestParam List reportId, @RequestParam List recordId) { + if (reportId == null || reportId.size() == 0){ + return R.error(400,"参数错误!"); + } + if (recordId == null || recordId.size() == 0){ + return R.error(400,"参数错误!"); + } + if (reportId.size() != recordId.size()){ + return R.error(400,"参数错误!"); + } R result = service.deleteReport(reportId, recordId); return result; } diff --git a/src/main/java/com/msdw/tms/service/AchievementManagementService.java b/src/main/java/com/msdw/tms/service/AchievementManagementService.java index 275b341..df44ed6 100644 --- a/src/main/java/com/msdw/tms/service/AchievementManagementService.java +++ b/src/main/java/com/msdw/tms/service/AchievementManagementService.java @@ -31,7 +31,7 @@ public interface AchievementManagementService extends IService reportId,List recordId); R queryEvaluationReport(String searchContant, Integer projectId, Integer page, Integer size); 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 7dbd78c..393fc74 100644 --- a/src/main/java/com/msdw/tms/service/impl/AchievementManagementServiceImpl.java +++ b/src/main/java/com/msdw/tms/service/impl/AchievementManagementServiceImpl.java @@ -222,8 +222,10 @@ public class AchievementManagementServiceImpl extends ServiceImpl reportId,List recordId) { + for (int i = 0; i < reportId.size(); i++) { + achievementManagementDao.deleteReport(reportId.get(i), recordId.get(i)); + } return R.ok(); }