From 7ebfb8b5787a81c2f1eb1ebb431e1ad9823c0fbf Mon Sep 17 00:00:00 2001 From: "jiakun.lin" Date: Wed, 7 Apr 2021 11:21:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=88=90=E7=BB=A9=E7=AE=A1=E7=90=86=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E6=89=B9=E9=87=8F=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/msdw/tms/TmsApplication.java | 2 +- .../com/msdw/tms/api/AchievementManagementApi.java | 2 +- .../controller/AchievementManagementController.java | 11 ++++++++++- .../tms/service/AchievementManagementService.java | 2 +- .../impl/AchievementManagementServiceImpl.java | 6 ++++-- 5 files changed, 17 insertions(+), 6 deletions(-) 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(); }