From f68d79d0ff6658795c19c2fd473fab9ff6f0640d Mon Sep 17 00:00:00 2001
From: zss <zss@example.com>
Date: 星期六, 14 三月 2026 13:53:12 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev_宁夏_中盛建材' into dev_宁夏_中盛建材
---
src/main/java/com/ruoyi/production/controller/ProductMaterialSkuController.java | 37 +++++++++++++++++++++++++++----------
1 files changed, 27 insertions(+), 10 deletions(-)
diff --git a/src/main/java/com/ruoyi/production/controller/ProductMaterialSkuController.java b/src/main/java/com/ruoyi/production/controller/ProductMaterialSkuController.java
index f9145d1..170cefe 100644
--- a/src/main/java/com/ruoyi/production/controller/ProductMaterialSkuController.java
+++ b/src/main/java/com/ruoyi/production/controller/ProductMaterialSkuController.java
@@ -1,22 +1,21 @@
package com.ruoyi.production.controller;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+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.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.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
@@ -30,6 +29,7 @@
*/
@RestController
@RequestMapping("/productMaterialSku")
+@Api(tags = "鐗╂枡瑙勬牸绠$悊鎺ュ彛")
public class ProductMaterialSkuController {
@Autowired
@@ -38,8 +38,8 @@
@GetMapping("/list")
@ApiOperation("鐗╂枡瑙勬牸鏁版嵁闆嗗悎")
@Log(title = "鐗╂枡瑙勬牸鏁版嵁闆嗗悎", businessType = BusinessType.OTHER)
- public AjaxResult productMaterialSkuList(@RequestParam("materialId") Long materialId) {
- List<ProductMaterialSkuDto> list = productMaterialSkuService.productMaterialSkuList(materialId);
+ public AjaxResult productMaterialSkuList(Page<ProductMaterialSku> page, ProductMaterialSkuDto dto) {
+ Page<ProductMaterialSkuDto> list = productMaterialSkuService.productMaterialSkuList(page, dto);
return AjaxResult.success(list);
}
@@ -66,4 +66,21 @@
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