From 11214e3074266a23fe61e8eebbce647fdb7305ef Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期五, 12 六月 2026 18:02:03 +0800
Subject: [PATCH] 报价单修改-优化,增加导入记录,降价历史
---
src/main/java/com/ruoyi/sales/controller/SalesQuotationController.java | 49 ++++++++++++++++++++++++++++++++++++++++++++-----
1 files changed, 44 insertions(+), 5 deletions(-)
diff --git a/src/main/java/com/ruoyi/sales/controller/SalesQuotationController.java b/src/main/java/com/ruoyi/sales/controller/SalesQuotationController.java
index f9251f8..9e174ef 100644
--- a/src/main/java/com/ruoyi/sales/controller/SalesQuotationController.java
+++ b/src/main/java/com/ruoyi/sales/controller/SalesQuotationController.java
@@ -1,46 +1,85 @@
package com.ruoyi.sales.controller;
+import com.ruoyi.common.utils.poi.ExcelUtil;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.framework.web.domain.AjaxResult;
+import com.ruoyi.framework.web.domain.R;
import com.ruoyi.sales.dto.SalesQuotationDto;
+import com.ruoyi.sales.pojo.SalesQuotationImportLog;
+import com.ruoyi.sales.pojo.SalesQuotationPriceHistory;
import com.ruoyi.sales.service.SalesQuotationService;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.servlet.http.HttpServletResponse;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.util.List;
@RestController
@RequestMapping("/sales/quotation")
@AllArgsConstructor
+@Tag(name = "閿�鍞姤浠风鐞�")
public class SalesQuotationController {
private final SalesQuotationService salesQuotationService;
+
@GetMapping("/list")
+ @Operation(summary = "鍒嗛〉鏌ヨ鎶ヤ环鍗曞垪琛�")
public AjaxResult getList(Page page, SalesQuotationDto salesQuotationDto) {
return AjaxResult.success(salesQuotationService.listPage(page, salesQuotationDto));
}
-
@PostMapping("/export")
+ @Operation(summary = "瀵煎嚭鎶ヤ环鍗�")
public void export(HttpServletResponse response) {
Page page = new Page(-1,-1);
SalesQuotationDto afterSalesService = new SalesQuotationDto();
IPage<SalesQuotationDto> listPage = salesQuotationService.listPage(page, afterSalesService);
- ExcelUtil<SalesQuotationDto> util = new ExcelUtil<SalesQuotationDto>(SalesQuotationDto.class);
- util.exportExcel(response, listPage.getRecords() , "閿�鍞姤浠�");
+ ExcelUtil<SalesQuotationDto> util = new ExcelUtil<>(SalesQuotationDto.class);
+ util.exportExcel(response, listPage.getRecords(), "閿�鍞姤浠�");
}
-
@PostMapping("/add")
+ @Operation(summary = "鏂板鎶ヤ环鍗�")
public AjaxResult add(@RequestBody SalesQuotationDto salesQuotationDto) {
return AjaxResult.success(salesQuotationService.add(salesQuotationDto));
}
+
@PostMapping("/update")
+ @Operation(summary = "淇敼鎶ヤ环鍗�")
public AjaxResult update(@RequestBody SalesQuotationDto salesQuotationDto) {
return AjaxResult.success(salesQuotationService.edit(salesQuotationDto));
}
+
@DeleteMapping("/delete")
+ @Operation(summary = "鍒犻櫎鎶ヤ环鍗�")
public AjaxResult delete(@RequestBody Long id) {
return AjaxResult.success(salesQuotationService.delete(id));
}
+
+ @GetMapping("/downloadTemplate")
+ @Operation(summary = "涓嬭浇鎶ヤ环瀵煎叆妯℃澘")
+ public void downloadTemplate(HttpServletResponse response) {
+ salesQuotationService.downloadTemplate(response);
+ }
+
+ @PostMapping("/import")
+ @Operation(summary = "瀵煎叆鎶ヤ环鍗�")
+ public R<SalesQuotationImportLog> importQuotation(@RequestParam("file") MultipartFile file) {
+ return R.ok(salesQuotationService.importQuotation(file));
+ }
+
+ @GetMapping("/importLog/list")
+ @Operation(summary = "鏌ヨ瀵煎叆璁板綍鍒楄〃")
+ public R<IPage<SalesQuotationImportLog>> listImportLog(Page page) {
+ return R.ok(salesQuotationService.listImportLog(page));
+ }
+
+ @GetMapping("/priceHistory/list")
+ @Operation(summary = "鏌ヨ闄嶄环鍘嗗彶璁板綍")
+ public R<List<SalesQuotationPriceHistory>> listPriceHistory(@RequestParam("quotationProductId") Long quotationProductId) {
+ return R.ok(salesQuotationService.listPriceHistory(quotationProductId));
+ }
}
--
Gitblit v1.9.3