From 9a6cff1514d484e11fc6db0f4f31b41902496d46 Mon Sep 17 00:00:00 2001 From: weitang Date: Fri, 6 Jun 2025 18:29:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=88=A0=E9=99=A4=E6=96=B9?= =?UTF-8?q?=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AlgorithmArrangeController.java | 37 +++++++++++++++---- 1 file changed, 29 insertions(+), 8 deletions(-) diff --git a/riis-system/src/main/java/com/yfd/platform/modules/algorithm/controller/AlgorithmArrangeController.java b/riis-system/src/main/java/com/yfd/platform/modules/algorithm/controller/AlgorithmArrangeController.java index f0ada01..f8e0bd6 100644 --- a/riis-system/src/main/java/com/yfd/platform/modules/algorithm/controller/AlgorithmArrangeController.java +++ b/riis-system/src/main/java/com/yfd/platform/modules/algorithm/controller/AlgorithmArrangeController.java @@ -10,14 +10,12 @@ import com.yfd.platform.modules.algorithm.service.IAlgorithmArrangeService; import com.yfd.platform.utils.SecurityUtils; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; import javax.annotation.Resource; import java.time.LocalDateTime; +import java.util.List; /** *

@@ -49,9 +47,10 @@ public class AlgorithmArrangeController { Page arrangePage = algorithmArrangeService.page(page, queryWrapper); return ResponseResult.successData(arrangePage); } + @GetMapping("/getAlgorithmArrangeById") @ApiOperation("根据Id查询算法布点") - public ResponseResult getAlgorithmArrangeById (String id){ + public ResponseResult getAlgorithmArrangeById(String id) { AlgorithmArrange algorithmArrange = algorithmArrangeService.getById(id); return ResponseResult.successData(algorithmArrange); } @@ -94,7 +93,8 @@ public class AlgorithmArrangeController { public ResponseResult updateAlgorithmArrange(AlgorithmArrange algorithmArrange, MultipartFile file) { // 判断是否存在相同的方案 LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); - queryWrapper.ne(AlgorithmArrange::getId, algorithmArrange.getId()).eq(AlgorithmArrange::getArrangeName, algorithmArrange.getArrangeName()); + queryWrapper.ne(AlgorithmArrange::getId, algorithmArrange.getId()).eq(AlgorithmArrange::getArrangeName, + algorithmArrange.getArrangeName()); if (algorithmArrangeService.getOne(queryWrapper) != null) { return ResponseResult.error("方案名称已存在"); } @@ -118,12 +118,33 @@ public class AlgorithmArrangeController { return ResponseResult.success(); } + @PostMapping("/deleteAlgorithmArrange") + @ApiOperation("删除布点数据") + public ResponseResult deleteAlgorithmArrange(String id) { + boolean b = algorithmArrangeService.removeById(id); + if (b) { + return ResponseResult.success(); + } else { + return ResponseResult.error(); + } + } + + @PostMapping("/deleteAlgorithmArrange") + @ApiOperation("删除布点数据") + public ResponseResult deleteAlgorithmArrange(@RequestBody List ids) { + boolean b = algorithmArrangeService.removeByIds(ids); + if (b) { + return ResponseResult.success(); + } else { + return ResponseResult.error(); + } + } + @PostMapping("/callAlgorithmArrange") @ApiOperation("调用算法布点API") public ResponseResult callAlgorithmArrange(String id) { - AlgorithmArrange algorithmArrange=algorithmArrangeService.callAlgorithmArrange(id); + AlgorithmArrange algorithmArrange = algorithmArrangeService.callAlgorithmArrange(id); return ResponseResult.successData(algorithmArrange); } - }