From 41ab7abd0b0ec0fefb03b60bbaf42c02fbda666b Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期四, 23 四月 2026 15:53:16 +0800
Subject: [PATCH] feat(production): 添加生产订单与销售台账关联功能

---
 src/main/java/com/ruoyi/production/controller/ProductionPlanController.java |  146 +++++++++++++++++++++++-------------------------
 1 files changed, 69 insertions(+), 77 deletions(-)

diff --git a/src/main/java/com/ruoyi/production/controller/ProductionPlanController.java b/src/main/java/com/ruoyi/production/controller/ProductionPlanController.java
index 5e73c4f..6190a47 100644
--- a/src/main/java/com/ruoyi/production/controller/ProductionPlanController.java
+++ b/src/main/java/com/ruoyi/production/controller/ProductionPlanController.java
@@ -10,13 +10,13 @@
 import com.ruoyi.production.bean.dto.ProductionPlanImportDto;
 import com.ruoyi.production.bean.vo.ProductionPlanVo;
 import com.ruoyi.production.service.ProductionPlanService;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.Operation;
+import jakarta.servlet.http.HttpServletResponse;
 import lombok.RequiredArgsConstructor;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
 
-import javax.servlet.http.HttpServletResponse;
 import java.math.BigDecimal;
 import java.util.List;
 
@@ -31,81 +31,73 @@
 @RestController
 @RequestMapping("/productionPlan")
 @RequiredArgsConstructor
-@Api(tags = "涓荤敓浜ц鍒�")
+@Tag(name = "涓荤敓浜ц鍒�")
 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")
+    @Operation(summary = "鑾峰彇鐢熶骇璁″垝鍒楄〃")
+    public R<IPage<ProductionPlanVo>> productionPlanListPage(Page<ProductionPlanDto> page, ProductionPlanDto productionPlanDto) {
+        return R.ok(productionPlanService.listPage(page, productionPlanDto));
+    }
+
+    @PostMapping("/combine")
+    @Log(title = "鍚堝苟鐢熶骇璁″垝", businessType = BusinessType.INSERT)
+    @Operation(summary = "鍚堝苟鐢熶骇璁″垝")
+    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("addProductionPlan")
+    @Log(title = "鍒涘缓鐢熶骇璁″垝", businessType = BusinessType.INSERT)
+    @Operation(summary = "鍒涘缓鐢熶骇璁″垝")
+    public R add(@RequestBody ProductionPlanDto productionPlanDto) {
+        return R.ok(productionPlanService.add(productionPlanDto));
+    }
+
+    @PutMapping("updateProductionPlan")
+    @Log(title = "鏇存柊鐢熶骇璁″垝", businessType = BusinessType.UPDATE)
+    @Operation(summary = "鏇存柊鐢熶骇璁″垝")
+    public R update(@RequestBody ProductionPlanDto productionPlanDto) {
+        return R.ok(productionPlanService.update(productionPlanDto));
+    }
+
+    @DeleteMapping("deleteProductionPlan")
+    @Log(title = "鍒犻櫎鐢熶骇璁″垝", businessType = BusinessType.DELETE)
+    @Operation(summary = "鍒犻櫎鐢熶骇璁″垝")
+    public R delete(@RequestBody List<Long> ids) {
+        return R.ok(productionPlanService.delete(ids));
+    }
+
+    @PostMapping("/downloadTemplate")
+    @Log(title = "涓嬭浇涓荤敓浜ц鍒掑鍏ユā鏉�", businessType = BusinessType.EXPORT)
+    @Operation(summary = "涓嬭浇涓荤敓浜ц鍒掑鍏ユā鏉�")
+    public void importTemplate(HttpServletResponse response) {
+        ExcelUtil<ProductionPlanImportDto> excelUtil = new ExcelUtil<>(ProductionPlanImportDto.class);
+        excelUtil.importTemplateExcel(response, "涓荤敓浜ц鍒掑鍏ユā鏉�");
+    }
+
+    @PostMapping("/import")
+    @Operation(summary = "涓荤敓浜ц鍒掓暟鎹鍏�")
+    @Log(title = "涓荤敓浜ц鍒掓暟鎹鍏�", businessType = BusinessType.IMPORT)
+    public R importProdData(@RequestParam("file") MultipartFile file) {
+        productionPlanService.importProdData(file);
+        return R.ok("瀵煎叆鎴愬姛");
+    }
+
+    @PostMapping("/export")
+    @Operation(summary = "涓荤敓浜ц鍒掓暟鎹鍑�")
+    @Log(title = "涓荤敓浜ц鍒掓暟鎹鍑�", businessType = BusinessType.EXPORT)
+    public void exportProdData(HttpServletResponse response, @RequestBody(required = false) List<Long> ids) {
+        productionPlanService.exportProdData(response, ids);
+    }
 
 }

--
Gitblit v1.9.3