From 0989ec1e6b465141f99ed67e40fa2a0b928dce94 Mon Sep 17 00:00:00 2001
From: liding <756868258@qq.com>
Date: 星期三, 29 四月 2026 16:54:51 +0800
Subject: [PATCH] feat(production): 新增生产核算和生产工单功能模块 - 添加生产核算控制器、服务接口及实现类 - 实现生产核算分页查询和工人生产工资信息查询功能 - 添加生产工单控制器、服务接口及实现类 - 实现生产工单的增删改查和状态统计功能 - 集成工单流转卡下载和二维码生成功能 - 添加工单相关的数据传输对象和值对象 - 实现工单与用户关联的分配功能 - 完善工单附件图片处理和展示功能
---
src/main/java/com/ruoyi/project/common/CommonController.java | 35 +++++++++++++++++++++++++++++------
1 files changed, 29 insertions(+), 6 deletions(-)
diff --git a/src/main/java/com/ruoyi/project/common/CommonController.java b/src/main/java/com/ruoyi/project/common/CommonController.java
index bf7bda4..9ee3c93 100644
--- a/src/main/java/com/ruoyi/project/common/CommonController.java
+++ b/src/main/java/com/ruoyi/project/common/CommonController.java
@@ -128,15 +128,32 @@
// }
@PostMapping({"/upload"})
@Operation(summary = "鏂囦欢涓婁紶")
- public R upload(@RequestParam("files") List<MultipartFile> files) throws Exception {
- return R.ok(storageBlobService.upload(files));
+ public R upload(@RequestParam("files") List<MultipartFile> files) {
+ return R.ok(storageBlobService.upload(files, false));
}
+ /**
+ * 鍏叡鏂囦欢涓婁紶
+ * 姝ゆ帴鍙d笂浼犵殑鏂囦欢姘镐箙鏈夋晥锛屾厧鐢�
+ */
+ @PostMapping({"/public/upload"})
+ @Operation(summary = "鏂囦欢涓婁紶")
+ public R publicUpload(@RequestParam("files") List<MultipartFile> files) {
+ return R.ok(storageBlobService.upload(files, true));
+ }
@GetMapping("/download/{fileName}")
@Anonymous
- public void download(@PathVariable String fileName, @RequestParam("token") String token, HttpServletResponse response) throws Exception {
- File file = storageBlobService.getFileByToken(fileName, token);
+ public void download(@PathVariable String fileName,
+ @RequestParam(value = "token", required = false) String token,
+ @RequestParam(value = "publicKey", required = false) String publicKey,
+ HttpServletResponse response) throws Exception {
+ File file;
+ if (publicKey != null) {
+ file = fileUtil.compressFile(storageBlobService.getPublicFile(fileName, publicKey));
+ } else {
+ file = fileUtil.compressFile(storageBlobService.getFileByToken(fileName, token));
+ }
String originalFileName = storageBlobService.getDownloadFileName(fileName);
String encodedFileName = URLEncoder.encode(originalFileName, StandardCharsets.UTF_8.name()).replace("+", "%20");
response.setHeader("Content-Disposition", "attachment;filename*=UTF-8''" + encodedFileName);
@@ -147,8 +164,14 @@
@GetMapping("/preview/{fileName}")
@Anonymous
public ResponseEntity<FileSystemResource> preview(@PathVariable String fileName,
- @RequestParam("token") String token) throws Exception {
- File file = fileUtil.compressFile(storageBlobService.getFileByToken(fileName, token));
+ @RequestParam(value = "token", required = false) String token,
+ @RequestParam(value = "publicKey", required = false) String publicKey) throws Exception {
+ File file;
+ if (publicKey != null) {
+ file = fileUtil.compressFile(storageBlobService.getPublicFile(fileName, publicKey));
+ } else {
+ file = fileUtil.compressFile(storageBlobService.getFileByToken(fileName, token));
+ }
String contentType = Files.probeContentType(file.toPath());
ContentDisposition contentDisposition = ContentDisposition.inline()
--
Gitblit v1.9.3