From 6916862c6dbb26fc850d3c28bec89e7382b77dd2 Mon Sep 17 00:00:00 2001
From: gongchunyi <deslre0381@gmail.com>
Date: 星期二, 24 三月 2026 13:02:08 +0800
Subject: [PATCH] feat: 报工编号提取公共方法
---
src/main/java/com/ruoyi/other/controller/TempFileController.java | 16 +++++++++++-----
1 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/src/main/java/com/ruoyi/other/controller/TempFileController.java b/src/main/java/com/ruoyi/other/controller/TempFileController.java
index 810c532..7160272 100644
--- a/src/main/java/com/ruoyi/other/controller/TempFileController.java
+++ b/src/main/java/com/ruoyi/other/controller/TempFileController.java
@@ -8,10 +8,7 @@
import com.ruoyi.purchase.service.ITicketRegistrationService;
import com.ruoyi.purchase.service.impl.TicketRegistrationServiceImpl;
import lombok.AllArgsConstructor;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
@@ -25,7 +22,7 @@
private TicketRegistrationServiceImpl ticketRegistrationServiceImpl;
@PostMapping("/upload")
- public AjaxResult uploadFile(MultipartFile file, Integer type) {
+ public AjaxResult uploadFile(MultipartFile file, @RequestParam(required = false) Integer type) {
try {
return AjaxResult.success(tempFileService.uploadFile(file, type));
} catch (Exception e) {
@@ -33,6 +30,15 @@
}
}
+ @PostMapping("/uploadByCommon")
+ public AjaxResult uploadByCommon(MultipartFile file, Integer type, Long id) {
+ try {
+ return AjaxResult.success(tempFileService.uploadByCommon(file, type,id));
+ } catch (Exception e) {
+ return AjaxResult.error(e.getMessage());
+ }
+ }
+
@PostMapping("uploadFile")
public AjaxResult uploadFile(@RequestBody ProductRecordDto productRecordDto) {
try {
--
Gitblit v1.9.3