From e099d0cd93c26b44bc1c10e51944edfad0465b0c Mon Sep 17 00:00:00 2001
From: maven <2163098428@qq.com>
Date: 星期四, 05 三月 2026 17:44:44 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev_New' into dev_New
---
src/main/java/com/ruoyi/basic/controller/CustomerFollowUpController.java | 144 ++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 144 insertions(+), 0 deletions(-)
diff --git a/src/main/java/com/ruoyi/basic/controller/CustomerFollowUpController.java b/src/main/java/com/ruoyi/basic/controller/CustomerFollowUpController.java
new file mode 100644
index 0000000..d863c8a
--- /dev/null
+++ b/src/main/java/com/ruoyi/basic/controller/CustomerFollowUpController.java
@@ -0,0 +1,144 @@
+package com.ruoyi.basic.controller;
+
+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.pojo.CustomerFollowUp;
+import com.ruoyi.basic.pojo.CustomerReturnVisit;
+import com.ruoyi.basic.service.CustomerFollowUpService;
+import com.ruoyi.basic.service.CustomerReturnVisitService;
+import com.ruoyi.framework.aspectj.lang.annotation.Log;
+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 org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.util.List;
+
+/**
+ * <br>
+ * 瀹㈡埛璺熻繘鎺у埗灞�
+ * </br>
+ *
+ * @author deslrey
+ * @version 1.0
+ * @since 2026/03/04 14:45
+ */
+@RestController
+@RequestMapping("/basic/customer-follow")
+public class CustomerFollowUpController extends BaseController {
+
+ @Autowired
+ private CustomerFollowUpService customerFollowUpService;
+
+ @Autowired
+ private CustomerReturnVisitService customerReturnVisitService;
+
+ /**
+ * 鏌ヨ瀹㈡埛璺熻繘鍒楄〃
+ */
+ @GetMapping("/list")
+ @ApiOperation("鏌ヨ瀹㈡埛璺熻繘鍒楄〃")
+ public IPage<CustomerFollowUp> list(Page<CustomerFollowUp> page, CustomerFollowUp customerFollowUp) {
+ LambdaQueryWrapper<CustomerFollowUp> queryWrapper = new LambdaQueryWrapper<>();
+ queryWrapper.eq(customerFollowUp.getCustomerId() != null, CustomerFollowUp::getCustomerId, customerFollowUp.getCustomerId())
+ .like(customerFollowUp.getFollowerUserName() != null, CustomerFollowUp::getFollowerUserName, customerFollowUp.getFollowerUserName())
+ .orderByDesc(CustomerFollowUp::getFollowUpTime);
+ return customerFollowUpService.page(page, queryWrapper);
+ }
+
+ /**
+ * 鑾峰彇瀹㈡埛璺熻繘璇︾粏淇℃伅
+ */
+ @ApiOperation("鑾峰彇瀹㈡埛璺熻繘璇︾粏淇℃伅")
+ @GetMapping(value = "/{id}")
+ public AjaxResult getInfo(@PathVariable("id") Integer id) {
+ return AjaxResult.success(customerFollowUpService.getFollowUpWithFiles(id));
+ }
+
+ /**
+ * 鏂板瀹㈡埛璺熻繘
+ */
+ @PostMapping("/add")
+ @ApiOperation("鏂板瀹㈡埛璺熻繘")
+ @Log(title = "瀹㈡埛璺熻繘-鏂板", businessType = BusinessType.INSERT)
+ public AjaxResult add(@RequestBody CustomerFollowUp customerFollowUp) {
+ return toAjax(customerFollowUpService.insertCustomerFollowUp(customerFollowUp));
+ }
+
+ /**
+ * 淇敼瀹㈡埛璺熻繘
+ */
+ @PutMapping("/edit")
+ @ApiOperation("淇敼瀹㈡埛璺熻繘")
+ @Log(title = "瀹㈡埛璺熻繘-淇敼", businessType = BusinessType.UPDATE)
+ public AjaxResult edit(@RequestBody CustomerFollowUp customerFollowUp) {
+ return toAjax(customerFollowUpService.updateCustomerFollowUp(customerFollowUp));
+ }
+
+ /**
+ * 涓婁紶璺熻繘闄勪欢
+ */
+ @ApiOperation("涓婁紶璺熻繘闄勪欢")
+ @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();
+ }
+
+ /**
+ * 鍒犻櫎璺熻繘闄勪欢
+ */
+ @ApiOperation("鍒犻櫎璺熻繘闄勪欢")
+ @DeleteMapping("/file/{fileId}")
+ @Log(title = "瀹㈡埛璺熻繘-鍒犻櫎闄勪欢", businessType = BusinessType.DELETE)
+ public AjaxResult deleteFile(@PathVariable Integer fileId) {
+ customerFollowUpService.deleteFollowUpFile(fileId);
+ return AjaxResult.success();
+ }
+
+ /**
+ * 鍒犻櫎瀹㈡埛璺熻繘
+ */
+ @ApiOperation("鍒犻櫎瀹㈡埛璺熻繘")
+ @DeleteMapping("/{id}")
+ @Log(title = "瀹㈡埛璺熻繘-鍒犻櫎", businessType = BusinessType.DELETE)
+ public AjaxResult remove(@PathVariable Integer id) {
+ return toAjax(customerFollowUpService.deleteCustomerFollowUpById(id));
+ }
+
+ /**
+ * 鏂板/鏇存柊鍥炶鎻愰啋
+ */
+ @ApiOperation("鏂板/鏇存柊鍥炶鎻愰啋")
+ @PostMapping("/return-visit")
+ @Log(title = "鍥炶鎻愰啋-鏂板/鏇存柊", businessType = BusinessType.UPDATE)
+ public AjaxResult saveReturnVisit(@RequestBody CustomerReturnVisit customerReturnVisit) {
+ return toAjax(customerReturnVisitService.saveOrUpdateReturnVisit(customerReturnVisit));
+ }
+
+ /**
+ * 鑾峰彇鍥炶鎻愰啋璇︽儏
+ */
+ @ApiOperation("鑾峰彇鍥炶鎻愰啋璇︽儏")
+ @GetMapping("/return-visit/{customerId}")
+ public AjaxResult getReturnVisit(@PathVariable Integer customerId) {
+ return AjaxResult.success(customerReturnVisitService.getByCustomerId(customerId));
+ }
+
+ /**
+ * 鏍囪鍥炶鎻愰啋宸茶
+ */
+ @ApiOperation("鏍囪鍥炶鎻愰啋宸茶")
+ @PutMapping("/return-visit/read/{id}")
+ @Log(title = "鍥炶鎻愰啋-鏍囪宸茶", businessType = BusinessType.UPDATE)
+ public AjaxResult markAsRead(@PathVariable Long id) {
+ customerReturnVisitService.markAsRead(id);
+ return AjaxResult.success();
+ }
+
+}
--
Gitblit v1.9.3