From 2737e108612c3ea013e8bcd0ee0f71a4969205bb Mon Sep 17 00:00:00 2001
From: maven <2163098428@qq.com>
Date: 星期四, 04 十二月 2025 15:14:01 +0800
Subject: [PATCH] yys

---
 src/main/java/com/ruoyi/production/controller/ProductionLineController.java |   71 +++++++++++++++++++++++++++++++++++
 1 files changed, 71 insertions(+), 0 deletions(-)

diff --git a/src/main/java/com/ruoyi/production/controller/ProductionLineController.java b/src/main/java/com/ruoyi/production/controller/ProductionLineController.java
new file mode 100644
index 0000000..060ca09
--- /dev/null
+++ b/src/main/java/com/ruoyi/production/controller/ProductionLineController.java
@@ -0,0 +1,71 @@
+package com.ruoyi.production.controller;
+
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ruoyi.framework.aspectj.lang.annotation.Log;
+import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
+import com.ruoyi.framework.web.controller.BaseController;
+import com.ruoyi.framework.web.domain.AjaxResult;
+import com.ruoyi.production.pojo.ProductionLine;
+import com.ruoyi.production.service.ProductionLineService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * @author :yys
+ * @date : 2025/12/4 11:19
+ */
+@RestController
+@Api(tags = "浜х嚎绠$悊")
+@RequestMapping("/productionLine")
+public class ProductionLineController extends BaseController {
+
+    @Autowired
+    private ProductionLineService productionLineService;
+
+    /**
+     * 閫掑綊鏌ヨ浜х嚎鏍�
+     */
+    @GetMapping("/listTree")
+    @ApiOperation(value = "閫掑綊鏌ヨ浜х嚎鏍�")
+    public AjaxResult listTree() {
+        List<ProductionLine> productionLines = productionLineService.listTree();
+        return AjaxResult.success(productionLines);
+    }
+
+    /**
+     * 鍒嗛〉-鏍规嵁鐖惰妭鐐笽D鏌ヨ瀛愭爲锛堝鏌ヨID=1鐨勪骇绾夸笅鐨勬墍鏈夊伐搴忥級
+     */
+    @GetMapping("/pageList")
+    @ApiOperation(value = "鍒嗛〉-鏍规嵁鐖惰妭鐐笽D鏌ヨ瀛愭爲")
+    public AjaxResult getSubTree(Page page, ProductionLine productionLine) {
+        return AjaxResult.success(productionLineService.getSubTreeByParentId(page ,productionLine));
+    }
+
+    @PostMapping("/add")
+    @ApiOperation(value = "娣诲姞浜х嚎")
+    @Log(title = "浜х嚎绠$悊", businessType = BusinessType.INSERT)
+    public AjaxResult add(@RequestBody ProductionLine productionLine) {
+        return AjaxResult.success(productionLineService.save(productionLine));
+    }
+
+    @PostMapping("/update")
+    @ApiOperation(value = "淇敼浜х嚎")
+    @Log(title = "浜х嚎绠$悊", businessType = BusinessType.UPDATE)
+    public AjaxResult update(@RequestBody ProductionLine productionLine) {
+        return AjaxResult.success(productionLineService.updateById(productionLine));
+    }
+
+    @DeleteMapping("/delete")
+    @ApiOperation(value = "鍒犻櫎浜х嚎")
+    @Log(title = "浜х嚎绠$悊", businessType = BusinessType.DELETE)
+    public AjaxResult delete(@RequestBody List<Long> ids) {
+        if(CollectionUtils.isEmpty(ids)) return AjaxResult.error("璇蜂紶鍏ヨ鍒犻櫎鐨処D");
+        return AjaxResult.success(productionLineService.removeBatchByIds(ids));
+    }
+
+}

--
Gitblit v1.9.3