成绩管理增加批量删除

hehai
jiakun.lin 4 years ago
parent b534515490
commit 7ebfb8b578
  1. 2
      src/main/java/com/msdw/tms/TmsApplication.java
  2. 2
      src/main/java/com/msdw/tms/api/AchievementManagementApi.java
  3. 11
      src/main/java/com/msdw/tms/controller/AchievementManagementController.java
  4. 2
      src/main/java/com/msdw/tms/service/AchievementManagementService.java
  5. 6
      src/main/java/com/msdw/tms/service/impl/AchievementManagementServiceImpl.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 {

@ -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<Integer> reportId, @ApiParam(value = "实验报告主键", required = true) @RequestParam List<Integer> recordId);
@ApiOperation(value = "班级实验报告列表查询", notes = "班级实验报告列表查询")
R queryEvaluationReport(@ApiParam(value = "搜索内容(学校名称/学生姓名)", required = false) String searchContant,

@ -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<Integer> reportId, @RequestParam List<Integer> 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;
}

@ -31,7 +31,7 @@ public interface AchievementManagementService extends IService<ExperimentalRepor
R queryReport(Integer reportId);
R deleteReport(Integer reportId, Integer recordId);
R deleteReport(List<Integer> reportId,List<Integer> recordId);
R queryEvaluationReport(String searchContant, Integer projectId, Integer page, Integer size);

@ -222,8 +222,10 @@ public class AchievementManagementServiceImpl extends ServiceImpl<AchievementMan
@Override
@Transactional
public R deleteReport(Integer reportId, Integer recordId) {
achievementManagementDao.deleteReport(reportId, recordId);
public R deleteReport(List<Integer> reportId,List<Integer> recordId) {
for (int i = 0; i < reportId.size(); i++) {
achievementManagementDao.deleteReport(reportId.get(i), recordId.get(i));
}
return R.ok();
}

Loading…
Cancel
Save