From 72a32c227fdf10f34fe563a7de35169da5729eea Mon Sep 17 00:00:00 2001
From: gongchunyi <deslre0381@gmail.com>
Date: 星期二, 07 七月 2026 15:50:31 +0800
Subject: [PATCH] Merge branch 'dev_New_pro' into dev_平遥县盛达铸造厂
---
src/main/java/com/ruoyi/basic/controller/ProductController.java | 52 ++++++++++++++++++++++++++++++++++++++++------------
1 files changed, 40 insertions(+), 12 deletions(-)
diff --git a/src/main/java/com/ruoyi/basic/controller/ProductController.java b/src/main/java/com/ruoyi/basic/controller/ProductController.java
index a97bd7b..8e010d8 100644
--- a/src/main/java/com/ruoyi/basic/controller/ProductController.java
+++ b/src/main/java/com/ruoyi/basic/controller/ProductController.java
@@ -5,24 +5,25 @@
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.basic.dto.ProductDto;
import com.ruoyi.basic.dto.ProductModelDto;
+import com.ruoyi.basic.dto.ProductModelExportDto;
import com.ruoyi.basic.dto.ProductTreeDto;
import com.ruoyi.basic.pojo.ProductModel;
import com.ruoyi.basic.service.IProductModelService;
import com.ruoyi.basic.service.IProductService;
+import com.ruoyi.basic.vo.ProductModelVo;
+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.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.sales.pojo.SalesLedgerProduct;
import com.ruoyi.sales.service.ISalesLedgerProductService;
-import com.ruoyi.sales.service.ISalesLedgerService;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
+import io.swagger.v3.oas.annotations.Operation;
import lombok.AllArgsConstructor;
-import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
+import jakarta.servlet.http.HttpServletResponse;
import java.util.List;
@RestController
@@ -31,9 +32,7 @@
public class ProductController extends BaseController {
private IProductService productService;
-
private IProductModelService productModelService;
- @Autowired
private ISalesLedgerProductService salesLedgerProductService;
/**
* 鏌ヨ浜у搧
@@ -115,18 +114,47 @@
return productModelService.modelListPage(page, productDto);
}
- @ApiOperation("鍒嗛〉鏌ヨ鎵�鏈変骇鍝佸瀷鍙�")
+ @Operation(summary = "鍒嗛〉鏌ヨ鎵�鏈変骇鍝佸瀷鍙�")
@GetMapping("/pageModel")
- public IPage<ProductModel> listPageProductModel(Page<ProductModel> page, ProductModel productModel) {
+ public IPage<ProductModelVo> listPageProductModel(Page<ProductModelVo> page, ProductModel productModel) {
return productService.listPageProductModel(page, productModel);
+ }
+
+ @Operation(summary = "鍒嗛〉鏌ヨ鍘熸枡")
+ @GetMapping("/pageModel/material")
+ public IPage<ProductModelVo> listPageMaterial(Page<ProductModelVo> page, ProductModel productModel) {
+ return productService.listPageProductModelByType(page, productModel, 278L);
+ }
+
+ @Operation(summary = "鍒嗛〉鏌ヨ鍗婃垚鍝�")
+ @GetMapping("/pageModel/semiFinished")
+ public IPage<ProductModelVo> listPageSemiFinished(Page<ProductModelVo> page, ProductModel productModel) {
+ return productService.listPageProductModelByType(page, productModel, 277L);
+ }
+
+ @Operation(summary = "鍒嗛〉鏌ヨ鎴愬搧")
+ @GetMapping("/pageModel/finished")
+ public IPage<ProductModelVo> listPageFinished(Page<ProductModelVo> page, ProductModel productModel) {
+ return productService.listPageProductModelByType(page, productModel, 276L);
}
/**
* 瀵煎叆浜у搧
*/
- @Log(title = "瀵煎叆浜у搧",businessType = BusinessType.IMPORT)
- @PostMapping("import")
- public AjaxResult importProduct(MultipartFile file) {
- return AjaxResult.success(productModelService.importProduct(file));
+ @PostMapping("/import")
+ @Log(title = "瀵煎叆浜у搧", businessType = BusinessType.IMPORT)
+ public AjaxResult importProductModel(@RequestParam("file") MultipartFile file, Integer productId) {
+ return productModelService.importProductModel(file, productId);
+ }
+
+ /**
+ * 浜у搧瀵煎叆妯℃澘
+ */
+ @GetMapping("/export")
+ @Operation(summary = "浜у搧瀵煎叆妯℃澘")
+ @Log(title = "浜у搧瀵煎叆妯℃澘", businessType = BusinessType.EXPORT)
+ public void importProduct(HttpServletResponse response) {
+ ExcelUtil<ProductModelExportDto> excelUtil = new ExcelUtil<>(ProductModelExportDto.class);
+ excelUtil.importTemplateExcel(response, "浜у搧瑙勬牸瀵煎叆妯℃澘");
}
}
--
Gitblit v1.9.3