From fa3428b4bb32179a42d5618357c22fe2695716ae Mon Sep 17 00:00:00 2001
From: chenhj <1263187585@qq.com>
Date: 星期三, 22 四月 2026 13:58:23 +0800
Subject: [PATCH] 修改全局的注入方式
---
src/main/java/com/ruoyi/basic/controller/CustomerFollowUpController.java | 35 +++++++++++++++++++++++++++--------
1 files changed, 27 insertions(+), 8 deletions(-)
diff --git a/src/main/java/com/ruoyi/basic/controller/CustomerFollowUpController.java b/src/main/java/com/ruoyi/basic/controller/CustomerFollowUpController.java
index d863c8a..0236b55 100644
--- a/src/main/java/com/ruoyi/basic/controller/CustomerFollowUpController.java
+++ b/src/main/java/com/ruoyi/basic/controller/CustomerFollowUpController.java
@@ -3,6 +3,7 @@
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ruoyi.basic.dto.CustomerFollowUpFileDto;
import com.ruoyi.basic.pojo.CustomerFollowUp;
import com.ruoyi.basic.pojo.CustomerReturnVisit;
import com.ruoyi.basic.service.CustomerFollowUpService;
@@ -12,7 +13,7 @@
import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import io.swagger.annotations.ApiOperation;
-import org.springframework.beans.factory.annotation.Autowired;
+import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
@@ -29,13 +30,12 @@
*/
@RestController
@RequestMapping("/basic/customer-follow")
+@AllArgsConstructor
public class CustomerFollowUpController extends BaseController {
- @Autowired
- private CustomerFollowUpService customerFollowUpService;
+ private final CustomerFollowUpService customerFollowUpService;
- @Autowired
- private CustomerReturnVisitService customerReturnVisitService;
+ private final CustomerReturnVisitService customerReturnVisitService;
/**
* 鏌ヨ瀹㈡埛璺熻繘鍒楄〃
@@ -44,7 +44,7 @@
@ApiOperation("鏌ヨ瀹㈡埛璺熻繘鍒楄〃")
public IPage<CustomerFollowUp> list(Page<CustomerFollowUp> page, CustomerFollowUp customerFollowUp) {
LambdaQueryWrapper<CustomerFollowUp> queryWrapper = new LambdaQueryWrapper<>();
- queryWrapper.eq(customerFollowUp.getCustomerId() != null, CustomerFollowUp::getCustomerId, customerFollowUp.getCustomerId())
+ queryWrapper.eq(customerFollowUp.getCustomerPrivatePoolId() != null, CustomerFollowUp::getCustomerPrivatePoolId, customerFollowUp.getCustomerPrivatePoolId())
.like(customerFollowUp.getFollowerUserName() != null, CustomerFollowUp::getFollowerUserName, customerFollowUp.getFollowerUserName())
.orderByDesc(CustomerFollowUp::getFollowUpTime);
return customerFollowUpService.page(page, queryWrapper);
@@ -86,8 +86,27 @@
@PostMapping("/upload/{followUpId}")
@Log(title = "瀹㈡埛璺熻繘-涓婁紶闄勪欢", businessType = BusinessType.INSERT)
public AjaxResult uploadFiles(@RequestParam("files") List<MultipartFile> files, @PathVariable Integer followUpId) {
- customerFollowUpService.addFollowUpFiles(files, followUpId);
- return AjaxResult.success();
+ return AjaxResult.success(customerFollowUpService.addFollowUpFiles(files, followUpId));
+ }
+
+ /**
+ * 涓婁紶璺熻繘闄勪欢锛堝鐢紝鏃營D锛�
+ */
+ @ApiOperation("涓婁紶闄勪欢(澶嶇敤)")
+ @PostMapping("/upload")
+ @Log(title = "涓婁紶闄勪欢(澶嶇敤)", businessType = BusinessType.INSERT)
+ public AjaxResult uploadFiles(@RequestParam("files") List<MultipartFile> files, @RequestParam(required = false) String name) {
+ List<CustomerFollowUpFileDto> uploadedFiles = customerFollowUpService.addFollowUpFiles(files, null);
+ return AjaxResult.success(uploadedFiles);
+ }
+
+ /**
+ * 鎵归噺鏌ヨ闄勪欢鍒楄〃
+ */
+ @ApiOperation("鎵归噺鏌ヨ闄勪欢鍒楄〃")
+ @PostMapping("/file/list")
+ public AjaxResult getFileList(@RequestBody List<Long> ids) {
+ return AjaxResult.success(customerFollowUpService.getFollowUpFilesByIds(ids));
}
/**
--
Gitblit v1.9.3