From a8a78a1b733914ea97393ccc5a81bf7ea76ed5aa Mon Sep 17 00:00:00 2001
From: huminmin <mac@MacBook-Pro.local>
Date: 星期四, 12 三月 2026 17:58:38 +0800
Subject: [PATCH] Merge branch 'dev_宁夏_中盛建材' of http://114.132.189.42:9002/r/product-inventory-management-after into dev_宁夏_中盛建材

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

diff --git a/src/main/java/com/ruoyi/production/controller/ProductMaterialSkuController.java b/src/main/java/com/ruoyi/production/controller/ProductMaterialSkuController.java
new file mode 100644
index 0000000..5d6c8ba
--- /dev/null
+++ b/src/main/java/com/ruoyi/production/controller/ProductMaterialSkuController.java
@@ -0,0 +1,85 @@
+package com.ruoyi.production.controller;
+
+import com.ruoyi.common.utils.poi.ExcelUtil;
+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.ProductMaterialSkuDto;
+import com.ruoyi.production.pojo.ProductMaterialSku;
+import com.ruoyi.production.pojo.ProductMaterialSkuImportDto;
+import com.ruoyi.production.service.ProductMaterialSkuService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
+
+/**
+ * <br>
+ * 鐗╂枡瑙勬牸鎺у埗灞�
+ * </br>
+ *
+ * @author deslrey
+ * @version 1.0
+ * @since 2026/03/12 10:43
+ */
+@RestController
+@RequestMapping("/productMaterialSku")
+@Api(tags = "鐗╂枡瑙勬牸绠$悊鎺ュ彛")
+public class ProductMaterialSkuController {
+
+    @Autowired
+    private ProductMaterialSkuService productMaterialSkuService;
+
+    @GetMapping("/list")
+    @ApiOperation("鐗╂枡瑙勬牸鏁版嵁闆嗗悎")
+    @Log(title = "鐗╂枡瑙勬牸鏁版嵁闆嗗悎", businessType = BusinessType.OTHER)
+    public AjaxResult productMaterialSkuList(@RequestParam("materialId") Long materialId) {
+        List<ProductMaterialSkuDto> list = productMaterialSkuService.productMaterialSkuList(materialId);
+        return AjaxResult.success(list);
+    }
+
+    @PostMapping("/add")
+    @ApiOperation("鏂板鐗╂枡瑙勬牸")
+    @Log(title = "鏂板鐗╂枡瑙勬牸", businessType = BusinessType.INSERT)
+    public AjaxResult addProductMaterialSku(@RequestBody ProductMaterialSku productMaterialSku) {
+        productMaterialSkuService.addProductMaterialSku(productMaterialSku);
+        return AjaxResult.success();
+    }
+
+    @PutMapping("/update")
+    @ApiOperation("淇敼鐗╂枡瑙勬牸")
+    @Log(title = "淇敼鐗╂枡瑙勬牸", businessType = BusinessType.UPDATE)
+    public AjaxResult updateProductMaterialSku(@RequestBody ProductMaterialSku productMaterialSku) {
+        productMaterialSkuService.updateProductMaterialSku(productMaterialSku);
+        return AjaxResult.success();
+    }
+
+    @DeleteMapping("/delete")
+    @ApiOperation("鍒犻櫎鐗╂枡瑙勬牸")
+    @Log(title = "鍒犻櫎鐗╂枡瑙勬牸", businessType = BusinessType.DELETE)
+    public AjaxResult deleteProductMaterialSku(@RequestBody List<Long> ids) {
+        productMaterialSkuService.deleteProductMaterialSku(ids);
+        return AjaxResult.success();
+    }
+
+    @PostMapping("/downloadTemplate")
+    @Log(title = "涓嬭浇鐗╂枡瑙勬牸瀵煎叆妯℃澘", businessType = BusinessType.EXPORT)
+    @ApiOperation("涓嬭浇鐗╂枡瑙勬牸瀵煎叆妯℃澘")
+    public void importTemplate(HttpServletResponse response) {
+        ExcelUtil<ProductMaterialSkuImportDto> excelUtil = new ExcelUtil<>(ProductMaterialSkuImportDto.class);
+        excelUtil.importTemplateExcel(response, "涓嬭浇鐗╂枡瑙勬牸瀵煎叆妯℃澘");
+    }
+
+    @PostMapping("/import")
+    @ApiOperation("鐗╂枡瑙勬牸鏁版嵁瀵煎叆")
+    @Log(title = "鐗╂枡瑙勬牸鏁版嵁瀵煎叆", businessType = BusinessType.IMPORT)
+    public AjaxResult importProdData(@RequestParam("file") MultipartFile file, @RequestParam("materialId") Long materialId) {
+        productMaterialSkuService.importProdData(file, materialId);
+        return AjaxResult.success("瀵煎叆鎴愬姛");
+    }
+
+}

--
Gitblit v1.9.3