From be153de6203cf3c1f3b8bb3a38d8d23baea797fb Mon Sep 17 00:00:00 2001
From: liyong <18434998025@163.com>
Date: 星期三, 15 七月 2026 13:59:17 +0800
Subject: [PATCH] 物料删除修改

---
 yudao-module-mdm/src/main/java/cn/iocoder/yudao/module/mdm/controller/admin/brand/MdmBrandController.java |   95 +++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 95 insertions(+), 0 deletions(-)

diff --git a/yudao-module-mdm/src/main/java/cn/iocoder/yudao/module/mdm/controller/admin/brand/MdmBrandController.java b/yudao-module-mdm/src/main/java/cn/iocoder/yudao/module/mdm/controller/admin/brand/MdmBrandController.java
new file mode 100644
index 0000000..790b91d
--- /dev/null
+++ b/yudao-module-mdm/src/main/java/cn/iocoder/yudao/module/mdm/controller/admin/brand/MdmBrandController.java
@@ -0,0 +1,95 @@
+package cn.iocoder.yudao.module.mdm.controller.admin.brand;
+
+import cn.iocoder.yudao.framework.common.pojo.CommonResult;
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.module.mdm.controller.admin.brand.vo.MdmBrandPageReqVO;
+import cn.iocoder.yudao.module.mdm.controller.admin.brand.vo.MdmBrandSaveReqVO;
+import cn.iocoder.yudao.module.mdm.dal.dataobject.brand.MdmBrandDO;
+import cn.iocoder.yudao.module.mdm.service.brand.MdmBrandService;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import jakarta.annotation.Resource;
+import jakarta.validation.Valid;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
+
+@Tag(name = "绠$悊鍚庡彴 - MDM 鍝佺墝")
+@RestController
+@RequestMapping("/mdm/brand")
+@Validated
+public class MdmBrandController {
+
+    @Resource
+    private MdmBrandService brandService;
+
+    @PostMapping("/create")
+    @Operation(summary = "鍒涘缓鍝佺墝")
+    @PreAuthorize("@ss.hasPermission('mdm:brand:create')")
+    public CommonResult<Long> createBrand(@Valid @RequestBody MdmBrandSaveReqVO createReqVO) {
+        return success(brandService.createBrand(createReqVO));
+    }
+
+    @PutMapping("/update")
+    @Operation(summary = "鏇存柊鍝佺墝")
+    @PreAuthorize("@ss.hasPermission('mdm:brand:update')")
+    public CommonResult<Boolean> updateBrand(@Valid @RequestBody MdmBrandSaveReqVO updateReqVO) {
+        brandService.updateBrand(updateReqVO);
+        return success(true);
+    }
+
+    @PutMapping("/update-status")
+    @Operation(summary = "鏇存柊鍝佺墝鐘舵��")
+    @Parameter(name = "id", description = "缂栧彿", required = true, example = "1")
+    @Parameter(name = "status", description = "鐘舵��", required = true, example = "0")
+    @PreAuthorize("@ss.hasPermission('mdm:brand:update')")
+    public CommonResult<Boolean> updateBrandStatus(@RequestParam("id") Long id, @RequestParam("status") Integer status) {
+        brandService.updateBrandStatus(id, status);
+        return success(true);
+    }
+
+    @DeleteMapping("/delete")
+    @Operation(summary = "鍒犻櫎鍝佺墝")
+    @Parameter(name = "id", description = "缂栧彿", required = true, example = "1")
+    @PreAuthorize("@ss.hasPermission('mdm:brand:delete')")
+    public CommonResult<Boolean> deleteBrand(@RequestParam("id") Long id) {
+        brandService.deleteBrand(id);
+        return success(true);
+    }
+
+    @GetMapping("/get")
+    @Operation(summary = "鑾峰緱鍝佺墝")
+    @Parameter(name = "id", description = "缂栧彿", required = true, example = "1")
+    @PreAuthorize("@ss.hasPermission('mdm:brand:query')")
+    public CommonResult<MdmBrandDO> getBrand(@RequestParam("id") Long id) {
+        return success(brandService.getBrand(id));
+    }
+
+    @GetMapping("/page")
+    @Operation(summary = "鑾峰緱鍝佺墝鍒嗛〉")
+    @PreAuthorize("@ss.hasPermission('mdm:brand:query')")
+    public CommonResult<PageResult<MdmBrandDO>> getBrandPage(@Valid MdmBrandPageReqVO pageReqVO) {
+        return success(brandService.getBrandPage(pageReqVO));
+    }
+
+    @GetMapping("/list")
+    @Operation(summary = "鑾峰緱鍝佺墝鍒楄〃")
+    @PreAuthorize("@ss.hasPermission('mdm:brand:query')")
+    public CommonResult<List<MdmBrandDO>> getBrandList() {
+        return success(brandService.getBrandList(null));
+    }
+
+    @GetMapping("/list-by-ids")
+    @Operation(summary = "鑾峰緱鍝佺墝鍒楄〃")
+    @Parameter(name = "ids", description = "缂栧彿鍒楄〃", required = true, example = "1,2,3")
+    @PreAuthorize("@ss.hasPermission('mdm:brand:query')")
+    public CommonResult<List<MdmBrandDO>> getBrandListByIds(@RequestParam("ids") List<Long> ids) {
+        return success(brandService.getBrandList(ids));
+    }
+
+}
\ No newline at end of file

--
Gitblit v1.9.3