6 天以前 f569e2257372a2f940aace9ad151fd758196eb9a
src/main/java/com/ruoyi/basic/controller/CustomerFollowUpController.java
@@ -8,11 +8,14 @@
import com.ruoyi.basic.pojo.CustomerReturnVisit;
import com.ruoyi.basic.service.CustomerFollowUpService;
import com.ruoyi.basic.service.CustomerReturnVisitService;
import com.ruoyi.basic.vo.CustomerFollowUpExportVo;
import com.ruoyi.common.utils.poi.ExcelUtil;
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 io.swagger.v3.oas.annotations.Operation;
import jakarta.servlet.http.HttpServletResponse;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
@@ -41,10 +44,10 @@
     * 查询客户跟进列表
     */
    @GetMapping("/list")
    @ApiOperation("查询客户跟进列表")
    @Operation(summary = "查询客户跟进列表")
    public IPage<CustomerFollowUp> list(Page<CustomerFollowUp> page, CustomerFollowUp customerFollowUp) {
        LambdaQueryWrapper<CustomerFollowUp> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(customerFollowUp.getCustomerPrivatePoolId() != null, CustomerFollowUp::getCustomerPrivatePoolId, customerFollowUp.getCustomerPrivatePoolId())
        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);
@@ -53,7 +56,7 @@
    /**
     * 获取客户跟进详细信息
     */
    @ApiOperation("获取客户跟进详细信息")
    @Operation(summary = "获取客户跟进详细信息")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Integer id) {
        return AjaxResult.success(customerFollowUpService.getFollowUpWithFiles(id));
@@ -63,7 +66,7 @@
     * 新增客户跟进
     */
    @PostMapping("/add")
    @ApiOperation("新增客户跟进")
    @Operation(summary = "新增客户跟进")
    @Log(title = "客户跟进-新增", businessType = BusinessType.INSERT)
    public AjaxResult add(@RequestBody CustomerFollowUp customerFollowUp) {
        return toAjax(customerFollowUpService.insertCustomerFollowUp(customerFollowUp));
@@ -73,7 +76,7 @@
     * 修改客户跟进
     */
    @PutMapping("/edit")
    @ApiOperation("修改客户跟进")
    @Operation(summary = "修改客户跟进")
    @Log(title = "客户跟进-修改", businessType = BusinessType.UPDATE)
    public AjaxResult edit(@RequestBody CustomerFollowUp customerFollowUp) {
        return toAjax(customerFollowUpService.updateCustomerFollowUp(customerFollowUp));
@@ -82,7 +85,7 @@
    /**
     * 上传跟进附件
     */
    @ApiOperation("上传跟进附件")
    @Operation(summary = "上传跟进附件")
    @PostMapping("/upload/{followUpId}")
    @Log(title = "客户跟进-上传附件", businessType = BusinessType.INSERT)
    public AjaxResult uploadFiles(@RequestParam("files") List<MultipartFile> files, @PathVariable Integer followUpId) {
@@ -92,7 +95,7 @@
    /**
     * 上传跟进附件(复用,无ID)
     */
    @ApiOperation("上传附件(复用)")
    @Operation(summary = "上传附件(复用)")
    @PostMapping("/upload")
    @Log(title = "上传附件(复用)", businessType = BusinessType.INSERT)
    public AjaxResult uploadFiles(@RequestParam("files") List<MultipartFile> files, @RequestParam(required = false) String name) {
@@ -103,7 +106,7 @@
    /**
     * 批量查询附件列表
     */
    @ApiOperation("批量查询附件列表")
    @Operation(summary = "批量查询附件列表")
    @PostMapping("/file/list")
    public AjaxResult getFileList(@RequestBody List<Long> ids) {
        return AjaxResult.success(customerFollowUpService.getFollowUpFilesByIds(ids));
@@ -112,7 +115,7 @@
    /**
     * 删除跟进附件
     */
    @ApiOperation("删除跟进附件")
    @Operation(summary = "删除跟进附件")
    @DeleteMapping("/file/{fileId}")
    @Log(title = "客户跟进-删除附件", businessType = BusinessType.DELETE)
    public AjaxResult deleteFile(@PathVariable Integer fileId) {
@@ -123,7 +126,7 @@
    /**
     * 删除客户跟进
     */
    @ApiOperation("删除客户跟进")
    @Operation(summary = "删除客户跟进")
    @DeleteMapping("/{id}")
    @Log(title = "客户跟进-删除", businessType = BusinessType.DELETE)
    public AjaxResult remove(@PathVariable Integer id) {
@@ -133,7 +136,7 @@
    /**
     * 新增/更新回访提醒
     */
    @ApiOperation("新增/更新回访提醒")
    @Operation(summary = "新增/更新回访提醒")
    @PostMapping("/return-visit")
    @Log(title = "回访提醒-新增/更新", businessType = BusinessType.UPDATE)
    public AjaxResult saveReturnVisit(@RequestBody CustomerReturnVisit customerReturnVisit) {
@@ -143,7 +146,7 @@
    /**
     * 获取回访提醒详情
     */
    @ApiOperation("获取回访提醒详情")
    @Operation(summary = "获取回访提醒详情")
    @GetMapping("/return-visit/{customerId}")
    public AjaxResult getReturnVisit(@PathVariable Integer customerId) {
        return AjaxResult.success(customerReturnVisitService.getByCustomerId(customerId));
@@ -152,7 +155,7 @@
    /**
     * 标记回访提醒已读
     */
    @ApiOperation("标记回访提醒已读")
    @Operation(summary = "标记回访提醒已读")
    @PutMapping("/return-visit/read/{id}")
    @Log(title = "回访提醒-标记已读", businessType = BusinessType.UPDATE)
    public AjaxResult markAsRead(@PathVariable Long id) {
@@ -160,4 +163,15 @@
        return AjaxResult.success();
    }
    /**
     * 导出洽谈进度(按跟进记录展开)
     */
    @Operation(summary = "导出洽谈进度")
    @PostMapping("/export")
    @Log(title = "洽谈进度-导出", businessType = BusinessType.EXPORT)
    public void export(HttpServletResponse response, String customerName, String customerType) {
        ExcelUtil<CustomerFollowUpExportVo> util = new ExcelUtil<CustomerFollowUpExportVo>(CustomerFollowUpExportVo.class);
        util.exportExcel(response, customerFollowUpService.selectFollowUpExportList(customerName, customerType), "洽谈进度");
    }
}