From f05fd2a067d751333f00a81dad095a7650900c95 Mon Sep 17 00:00:00 2001
From: gongchunyi <deslre0381@gmail.com>
Date: 星期五, 13 三月 2026 13:16:20 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev_宁夏_中盛建材' into dev_宁夏_中盛建材

---
 src/main/java/com/ruoyi/production/controller/ProductMaterialController.java |   94 +++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 91 insertions(+), 3 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..2c27907 100644
--- a/src/main/java/com/ruoyi/production/controller/ProductMaterialController.java
+++ b/src/main/java/com/ruoyi/production/controller/ProductMaterialController.java
@@ -3,12 +3,17 @@
 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.dto.ProductMaterialConfigDto;
+import com.ruoyi.production.dto.ProductMaterialGroupDto;
+import com.ruoyi.production.pojo.ProductMaterial;
+import com.ruoyi.production.pojo.ProductMaterialConfig;
+import com.ruoyi.production.service.ProductMaterialConfigService;
 import com.ruoyi.production.service.ProductMaterialService;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
 
 /**
  * <br>
@@ -26,6 +31,9 @@
     @Autowired
     private ProductMaterialService productMaterialService;
 
+    @Autowired
+    private ProductMaterialConfigService productMaterialConfigService;
+
     @GetMapping("/loadData")
     @ApiOperation("鎷夊彇鐗╂枡缂栫爜鏁版嵁")
     @Log(title = "鎷夊彇鐗╂枡缂栫爜鏁版嵁", businessType = BusinessType.INSERT)
@@ -34,4 +42,84 @@
         return AjaxResult.success();
     }
 
+    @GetMapping("/list")
+    @ApiOperation("鐗╂枡鏁版嵁绫诲埆鏁版嵁闆嗗悎")
+    @Log(title = "鐗╂枡鏁版嵁绫诲埆鏁版嵁闆嗗悎", businessType = BusinessType.OTHER)
+    public AjaxResult productMaterialList(@RequestParam("type") Integer type) {
+        List<ProductMaterialGroupDto> productMaterialMap = productMaterialService.ProductMaterialList(type);
+        return AjaxResult.success(productMaterialMap);
+    }
+
+    @GetMapping("/listQuery")
+    @ApiOperation("鐗╂枡鏁版嵁绫诲埆瀛愮被鏁版嵁闆嗗悎")
+    @Log(title = "鐗╂枡鏁版嵁绫诲埆瀛愮被鏁版嵁闆嗗悎", businessType = BusinessType.OTHER)
+    public AjaxResult productMaterialListByQuery(@RequestParam(value = "materialName", required = false) String materialName, @RequestParam(value = "materialTypeId", required = false) Integer materialTypeId) {
+        List<ProductMaterialGroupDto> productMaterialMap = productMaterialService.productMaterialListByQuery(materialName, materialTypeId);
+        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();
+    }
+
+
+    @GetMapping("/materialTypeList")
+    @ApiOperation("鐗╂枡绫诲瀷鏁版嵁闆嗗悎")
+    @Log(title = "鐗╂枡绫诲瀷鏁版嵁闆嗗悎", businessType = BusinessType.OTHER)
+    public AjaxResult materialTypeList() {
+        List<ProductMaterialConfig> list = productMaterialConfigService.materialTypeList();
+        return AjaxResult.success(list);
+    }
+
+    @GetMapping("/inventoryCategoryList")
+    @ApiOperation("'瀛樿揣绫诲埆鏁版嵁闆嗗悎")
+    @Log(title = "'瀛樿揣绫诲埆鏁版嵁闆嗗悎", businessType = BusinessType.OTHER)
+    public AjaxResult inventoryCategoryList() {
+        List<ProductMaterialConfig> list = productMaterialConfigService.inventoryCategoryList();
+        return AjaxResult.success(list);
+    }
+
+    @PostMapping("/config/add")
+    @ApiOperation("鏂板鐗╂枡閰嶇疆")
+    @Log(title = "鏂板鐗╂枡閰嶇疆", businessType = BusinessType.INSERT)
+    public AjaxResult addProductMaterialConfig(@RequestBody ProductMaterialConfigDto config) {
+        productMaterialConfigService.addProductMaterialConfig(config);
+        return AjaxResult.success();
+    }
+
+    @PutMapping("/config/update")
+    @ApiOperation("淇敼鐗╂枡閰嶇疆")
+    @Log(title = "淇敼鐗╂枡閰嶇疆", businessType = BusinessType.UPDATE)
+    public AjaxResult updateProductMaterialConfig(@RequestBody ProductMaterialConfigDto config) {
+        productMaterialConfigService.updateProductMaterialConfig(config);
+        return AjaxResult.success();
+    }
+
+    @DeleteMapping("/config/delete")
+    @ApiOperation("鍒犻櫎鐗╂枡閰嶇疆")
+    @Log(title = "鍒犻櫎鐗╂枡閰嶇疆", businessType = BusinessType.DELETE)
+    public AjaxResult deleteProductMaterialConfig(@RequestBody List<Integer> ids) {
+        productMaterialConfigService.deleteProductMaterialConfig(ids);
+        return AjaxResult.success();
+    }
 }

--
Gitblit v1.9.3