From f8a1b2069044f16707eedaa22b57d542081d5e26 Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期一, 27 四月 2026 15:23:33 +0800
Subject: [PATCH] refactor(sales): 将依赖注入方式从构造函数改为字段注入
---
src/main/java/com/ruoyi/basic/controller/CustomerFollowUpController.java | 40 +++++++++++++++++++---------------------
1 files changed, 19 insertions(+), 21 deletions(-)
diff --git a/src/main/java/com/ruoyi/basic/controller/CustomerFollowUpController.java b/src/main/java/com/ruoyi/basic/controller/CustomerFollowUpController.java
index 2b70438..70b109e 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;
@@ -11,12 +12,10 @@
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
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 io.swagger.v3.oas.annotations.Operation;
+import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
-import com.ruoyi.basic.dto.CustomerFollowUpFileDto;
-import com.ruoyi.common.utils.SecurityUtils;
import java.util.List;
@@ -31,22 +30,21 @@
*/
@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;
/**
* 鏌ヨ瀹㈡埛璺熻繘鍒楄〃
*/
@GetMapping("/list")
- @ApiOperation("鏌ヨ瀹㈡埛璺熻繘鍒楄〃")
+ @Operation(summary = "鏌ヨ瀹㈡埛璺熻繘鍒楄〃")
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);
@@ -55,7 +53,7 @@
/**
* 鑾峰彇瀹㈡埛璺熻繘璇︾粏淇℃伅
*/
- @ApiOperation("鑾峰彇瀹㈡埛璺熻繘璇︾粏淇℃伅")
+ @Operation(summary = "鑾峰彇瀹㈡埛璺熻繘璇︾粏淇℃伅")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Integer id) {
return AjaxResult.success(customerFollowUpService.getFollowUpWithFiles(id));
@@ -65,7 +63,7 @@
* 鏂板瀹㈡埛璺熻繘
*/
@PostMapping("/add")
- @ApiOperation("鏂板瀹㈡埛璺熻繘")
+ @Operation(summary = "鏂板瀹㈡埛璺熻繘")
@Log(title = "瀹㈡埛璺熻繘-鏂板", businessType = BusinessType.INSERT)
public AjaxResult add(@RequestBody CustomerFollowUp customerFollowUp) {
return toAjax(customerFollowUpService.insertCustomerFollowUp(customerFollowUp));
@@ -75,7 +73,7 @@
* 淇敼瀹㈡埛璺熻繘
*/
@PutMapping("/edit")
- @ApiOperation("淇敼瀹㈡埛璺熻繘")
+ @Operation(summary = "淇敼瀹㈡埛璺熻繘")
@Log(title = "瀹㈡埛璺熻繘-淇敼", businessType = BusinessType.UPDATE)
public AjaxResult edit(@RequestBody CustomerFollowUp customerFollowUp) {
return toAjax(customerFollowUpService.updateCustomerFollowUp(customerFollowUp));
@@ -84,7 +82,7 @@
/**
* 涓婁紶璺熻繘闄勪欢
*/
- @ApiOperation("涓婁紶璺熻繘闄勪欢")
+ @Operation(summary = "涓婁紶璺熻繘闄勪欢")
@PostMapping("/upload/{followUpId}")
@Log(title = "瀹㈡埛璺熻繘-涓婁紶闄勪欢", businessType = BusinessType.INSERT)
public AjaxResult uploadFiles(@RequestParam("files") List<MultipartFile> files, @PathVariable Integer followUpId) {
@@ -94,7 +92,7 @@
/**
* 涓婁紶璺熻繘闄勪欢锛堝鐢紝鏃營D锛�
*/
- @ApiOperation("涓婁紶闄勪欢(澶嶇敤)")
+ @Operation(summary = "涓婁紶闄勪欢(澶嶇敤)")
@PostMapping("/upload")
@Log(title = "涓婁紶闄勪欢(澶嶇敤)", businessType = BusinessType.INSERT)
public AjaxResult uploadFiles(@RequestParam("files") List<MultipartFile> files, @RequestParam(required = false) String name) {
@@ -105,7 +103,7 @@
/**
* 鎵归噺鏌ヨ闄勪欢鍒楄〃
*/
- @ApiOperation("鎵归噺鏌ヨ闄勪欢鍒楄〃")
+ @Operation(summary = "鎵归噺鏌ヨ闄勪欢鍒楄〃")
@PostMapping("/file/list")
public AjaxResult getFileList(@RequestBody List<Long> ids) {
return AjaxResult.success(customerFollowUpService.getFollowUpFilesByIds(ids));
@@ -114,7 +112,7 @@
/**
* 鍒犻櫎璺熻繘闄勪欢
*/
- @ApiOperation("鍒犻櫎璺熻繘闄勪欢")
+ @Operation(summary = "鍒犻櫎璺熻繘闄勪欢")
@DeleteMapping("/file/{fileId}")
@Log(title = "瀹㈡埛璺熻繘-鍒犻櫎闄勪欢", businessType = BusinessType.DELETE)
public AjaxResult deleteFile(@PathVariable Integer fileId) {
@@ -125,7 +123,7 @@
/**
* 鍒犻櫎瀹㈡埛璺熻繘
*/
- @ApiOperation("鍒犻櫎瀹㈡埛璺熻繘")
+ @Operation(summary = "鍒犻櫎瀹㈡埛璺熻繘")
@DeleteMapping("/{id}")
@Log(title = "瀹㈡埛璺熻繘-鍒犻櫎", businessType = BusinessType.DELETE)
public AjaxResult remove(@PathVariable Integer id) {
@@ -135,7 +133,7 @@
/**
* 鏂板/鏇存柊鍥炶鎻愰啋
*/
- @ApiOperation("鏂板/鏇存柊鍥炶鎻愰啋")
+ @Operation(summary = "鏂板/鏇存柊鍥炶鎻愰啋")
@PostMapping("/return-visit")
@Log(title = "鍥炶鎻愰啋-鏂板/鏇存柊", businessType = BusinessType.UPDATE)
public AjaxResult saveReturnVisit(@RequestBody CustomerReturnVisit customerReturnVisit) {
@@ -145,7 +143,7 @@
/**
* 鑾峰彇鍥炶鎻愰啋璇︽儏
*/
- @ApiOperation("鑾峰彇鍥炶鎻愰啋璇︽儏")
+ @Operation(summary = "鑾峰彇鍥炶鎻愰啋璇︽儏")
@GetMapping("/return-visit/{customerId}")
public AjaxResult getReturnVisit(@PathVariable Integer customerId) {
return AjaxResult.success(customerReturnVisitService.getByCustomerId(customerId));
@@ -154,7 +152,7 @@
/**
* 鏍囪鍥炶鎻愰啋宸茶
*/
- @ApiOperation("鏍囪鍥炶鎻愰啋宸茶")
+ @Operation(summary = "鏍囪鍥炶鎻愰啋宸茶")
@PutMapping("/return-visit/read/{id}")
@Log(title = "鍥炶鎻愰啋-鏍囪宸茶", businessType = BusinessType.UPDATE)
public AjaxResult markAsRead(@PathVariable Long id) {
--
Gitblit v1.9.3