From c1babcfa8a9cd01dbeb8527a6a95cbcc431957c7 Mon Sep 17 00:00:00 2001
From: liding <756868258@qq.com>
Date: 星期三, 22 四月 2026 10:42:35 +0800
Subject: [PATCH] fix:生产模块
---
src/main/java/com/ruoyi/production/controller/ProductionPlanController.java | 148 ++++++++++++++++++++++++------------------------
1 files changed, 74 insertions(+), 74 deletions(-)
diff --git a/src/main/java/com/ruoyi/production/controller/ProductionPlanController.java b/src/main/java/com/ruoyi/production/controller/ProductionPlanController.java
index bb6b0e8..29ec05b 100644
--- a/src/main/java/com/ruoyi/production/controller/ProductionPlanController.java
+++ b/src/main/java/com/ruoyi/production/controller/ProductionPlanController.java
@@ -12,11 +12,11 @@
import com.ruoyi.production.service.ProductionPlanService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
+import jakarta.servlet.http.HttpServletResponse;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
-import jakarta.servlet.http.HttpServletResponse;
import java.math.BigDecimal;
import java.util.List;
@@ -34,78 +34,78 @@
@Api(tags = "涓荤敓浜ц鍒�")
public class ProductionPlanController {
-// private final ProductionPlanService productionPlanService;
-//
-// @GetMapping("/listPage")
-// @ApiOperation("鑾峰彇鐢熶骇璁″垝鍒楄〃")
-// public R<IPage<ProductionPlanVo>> productionPlanListPage(Page<ProductionPlanDto> page, ProductionPlanDto productionPlanDto) {
-// return R.ok(productionPlanService.listPage(page, productionPlanDto));
-// }
-//
-// @GetMapping("/loadProdData")
-// @ApiOperation("鎷夊彇閿�鍞敓浜ц鍒�")
-// @Log(title = "鎷夊彇閿�鍞敓浜ц鍒�", businessType = BusinessType.INSERT)
-// public R loadProdData() {
-// productionPlanService.loadProdData();
-// return R.ok();
-// }
-//
-// @PostMapping("/combine")
-// @Log(title = "鍚堝苟鐢熶骇璁″垝", businessType = BusinessType.INSERT)
-// @ApiOperation("鍚堝苟鐢熶骇璁″垝")
-// public R combine(@RequestBody ProductionPlanDto productionPlanDto) {
-// if (productionPlanDto.getIds() == null || productionPlanDto.getIds().isEmpty()) {
-// return R.fail("璇烽�夋嫨瑕佷笅鍙戠殑鐢熶骇璁″垝");
-// }
-//
-// if (productionPlanDto.getTotalAssignedQuantity() == null || productionPlanDto.getTotalAssignedQuantity().compareTo(BigDecimal.ZERO) <= 0) {
-// return R.fail("璇疯緭鍏ヤ笅鍙戞暟閲�");
-// }
-// return R.ok(productionPlanService.combine(productionPlanDto));
-// }
-//
-// @PostMapping("")
-// @Log(title = "鍒涘缓鐢熶骇璁″垝", businessType = BusinessType.INSERT)
-// @ApiOperation("鍒涘缓鐢熶骇璁″垝")
-// public R add(@RequestBody ProductionPlanDto productionPlanDto) {
-// return R.ok(productionPlanService.add(productionPlanDto));
-// }
-//
-// @PutMapping("")
-// @Log(title = "鏇存柊鐢熶骇璁″垝", businessType = BusinessType.UPDATE)
-// @ApiOperation("鏇存柊鐢熶骇璁″垝")
-// public R update(@RequestBody ProductionPlanDto productionPlanDto) {
-// return R.ok(productionPlanService.update(productionPlanDto));
-// }
-//
-// @DeleteMapping("")
-// @Log(title = "鍒犻櫎鐢熶骇璁″垝", businessType = BusinessType.DELETE)
-// @ApiOperation("鍒犻櫎鐢熶骇璁″垝")
-// public R delete(@RequestBody List<Long> ids) {
-// return R.ok(productionPlanService.removeByIds(ids));
-// }
-//
-// @PostMapping("/downloadTemplate")
-// @Log(title = "涓嬭浇涓荤敓浜ц鍒掑鍏ユā鏉�", businessType = BusinessType.EXPORT)
-// @ApiOperation("涓嬭浇涓荤敓浜ц鍒掑鍏ユā鏉�")
-// public void importTemplate(HttpServletResponse response) {
-// ExcelUtil<ProductionPlanImportDto> excelUtil = new ExcelUtil<>(ProductionPlanImportDto.class);
-// excelUtil.importTemplateExcel(response, "涓荤敓浜ц鍒掑鍏ユā鏉�");
-// }
-//
-// @PostMapping("/import")
-// @ApiOperation("涓荤敓浜ц鍒掓暟鎹鍏�")
-// @Log(title = "涓荤敓浜ц鍒掓暟鎹鍏�", businessType = BusinessType.IMPORT)
-// public R importProdData(@RequestParam("file") MultipartFile file) {
-// productionPlanService.importProdData(file);
-// return R.ok("瀵煎叆鎴愬姛");
-// }
-//
-// @PostMapping("/export")
-// @ApiOperation("涓荤敓浜ц鍒掓暟鎹鍑�")
-// @Log(title = "涓荤敓浜ц鍒掓暟鎹鍑�", businessType = BusinessType.EXPORT)
-// public void exportProdData(HttpServletResponse response, @RequestBody(required = false) List<Long> ids) {
-// productionPlanService.exportProdData(response, ids);
-// }
+ private final ProductionPlanService productionPlanService;
+
+ @GetMapping("/listPage")
+ @ApiOperation("鑾峰彇鐢熶骇璁″垝鍒楄〃")
+ public R<IPage<ProductionPlanVo>> productionPlanListPage(Page<ProductionPlanDto> page, ProductionPlanDto productionPlanDto) {
+ return R.ok(productionPlanService.listPage(page, productionPlanDto));
+ }
+
+ @GetMapping("/loadProdData")
+ @ApiOperation("鎷夊彇閿�鍞敓浜ц鍒�")
+ @Log(title = "鎷夊彇閿�鍞敓浜ц鍒�", businessType = BusinessType.INSERT)
+ public R loadProdData() {
+ productionPlanService.loadProdData();
+ return R.ok();
+ }
+
+ @PostMapping("/combine")
+ @Log(title = "鍚堝苟鐢熶骇璁″垝", businessType = BusinessType.INSERT)
+ @ApiOperation("鍚堝苟鐢熶骇璁″垝")
+ public R combine(@RequestBody ProductionPlanDto productionPlanDto) {
+ if (productionPlanDto.getIds() == null || productionPlanDto.getIds().isEmpty()) {
+ return R.fail("璇烽�夋嫨瑕佷笅鍙戠殑鐢熶骇璁″垝");
+ }
+
+ if (productionPlanDto.getTotalAssignedQuantity() == null || productionPlanDto.getTotalAssignedQuantity().compareTo(BigDecimal.ZERO) <= 0) {
+ return R.fail("璇疯緭鍏ヤ笅鍙戞暟閲�");
+ }
+ return R.ok(productionPlanService.combine(productionPlanDto));
+ }
+
+ @PostMapping("")
+ @Log(title = "鍒涘缓鐢熶骇璁″垝", businessType = BusinessType.INSERT)
+ @ApiOperation("鍒涘缓鐢熶骇璁″垝")
+ public R add(@RequestBody ProductionPlanDto productionPlanDto) {
+ return R.ok(productionPlanService.add(productionPlanDto));
+ }
+
+ @PutMapping("")
+ @Log(title = "鏇存柊鐢熶骇璁″垝", businessType = BusinessType.UPDATE)
+ @ApiOperation("鏇存柊鐢熶骇璁″垝")
+ public R update(@RequestBody ProductionPlanDto productionPlanDto) {
+ return R.ok(productionPlanService.update(productionPlanDto));
+ }
+
+ @DeleteMapping("")
+ @Log(title = "鍒犻櫎鐢熶骇璁″垝", businessType = BusinessType.DELETE)
+ @ApiOperation("鍒犻櫎鐢熶骇璁″垝")
+ public R delete(@RequestBody List<Long> ids) {
+ return R.ok(productionPlanService.removeByIds(ids));
+ }
+
+ @PostMapping("/downloadTemplate")
+ @Log(title = "涓嬭浇涓荤敓浜ц鍒掑鍏ユā鏉�", businessType = BusinessType.EXPORT)
+ @ApiOperation("涓嬭浇涓荤敓浜ц鍒掑鍏ユā鏉�")
+ public void importTemplate(HttpServletResponse response) {
+ ExcelUtil<ProductionPlanImportDto> excelUtil = new ExcelUtil<>(ProductionPlanImportDto.class);
+ excelUtil.importTemplateExcel(response, "涓荤敓浜ц鍒掑鍏ユā鏉�");
+ }
+
+ @PostMapping("/import")
+ @ApiOperation("涓荤敓浜ц鍒掓暟鎹鍏�")
+ @Log(title = "涓荤敓浜ц鍒掓暟鎹鍏�", businessType = BusinessType.IMPORT)
+ public R importProdData(@RequestParam("file") MultipartFile file) {
+ productionPlanService.importProdData(file);
+ return R.ok("瀵煎叆鎴愬姛");
+ }
+
+ @PostMapping("/export")
+ @ApiOperation("涓荤敓浜ц鍒掓暟鎹鍑�")
+ @Log(title = "涓荤敓浜ц鍒掓暟鎹鍑�", businessType = BusinessType.EXPORT)
+ public void exportProdData(HttpServletResponse response, @RequestBody(required = false) List<Long> ids) {
+ productionPlanService.exportProdData(response, ids);
+ }
}
--
Gitblit v1.9.3