From a274b897e58c958903c3e00da6c1ccb16646a979 Mon Sep 17 00:00:00 2001
From: gongchunyi <deslre0381@gmail.com>
Date: 星期四, 12 三月 2026 11:54:13 +0800
Subject: [PATCH] feat: 物料规格和物料的新增、修改和删除
---
src/main/java/com/ruoyi/production/controller/ProductMaterialController.java | 42 ++++++++++++++++++++++++++++++++++++++++++
1 files changed, 42 insertions(+), 0 deletions(-)
diff --git a/src/main/java/com/ruoyi/production/controller/ProductMaterialController.java b/src/main/java/com/ruoyi/production/controller/ProductMaterialController.java
index 144b3f2..e95379f 100644
--- a/src/main/java/com/ruoyi/production/controller/ProductMaterialController.java
+++ b/src/main/java/com/ruoyi/production/controller/ProductMaterialController.java
@@ -3,12 +3,20 @@
import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import com.ruoyi.framework.web.domain.AjaxResult;
+import com.ruoyi.production.pojo.ProductMaterial;
import com.ruoyi.production.service.ProductMaterialService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+import java.util.Map;
/**
* <br>
@@ -34,4 +42,38 @@
return AjaxResult.success();
}
+ @GetMapping("/list")
+ @ApiOperation("鐗╂枡鏁版嵁")
+ @Log(title = "鐗╂枡鏁版嵁", businessType = BusinessType.OTHER)
+ public AjaxResult productMaterialList(String materialName) {
+ Map<String, List<ProductMaterial>> productMaterialMap = productMaterialService.ProductMaterialList(materialName);
+ return AjaxResult.success(productMaterialMap);
+ }
+
+ @PostMapping("/add")
+ @ApiOperation("鏂板鐗╂枡")
+ @Log(title = "鏂板鐗╂枡", businessType = BusinessType.INSERT)
+ public AjaxResult addProductMaterial(@RequestBody ProductMaterial productMaterial) {
+ productMaterialService.addProductMaterial(productMaterial);
+ return AjaxResult.success();
+ }
+
+ @PutMapping("/update")
+ @ApiOperation("淇敼鐗╂枡")
+ @Log(title = "淇敼鐗╂枡", businessType = BusinessType.UPDATE)
+ public AjaxResult updateProductMaterial(@RequestBody ProductMaterial productMaterial) {
+ productMaterialService.updateProductMaterial(productMaterial);
+ return AjaxResult.success();
+ }
+
+ @DeleteMapping("/delete")
+ @ApiOperation("鍒犻櫎鐗╂枡")
+ @Log(title = "鍒犻櫎鐗╂枡", businessType = BusinessType.DELETE)
+ public AjaxResult deleteProductMaterial(@RequestBody List<Long> ids) {
+ productMaterialService.deleteProductMaterial(ids);
+ return AjaxResult.success();
+ }
+
+
+
}
--
Gitblit v1.9.3