liyong
7 天以前 ffe6f6f203ac96b8c822c1d5380ad7dbeaa57a18
src/main/java/com/ruoyi/basic/controller/CustomerController.java
@@ -2,6 +2,8 @@
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.basic.dto.CustomerDto;
import com.ruoyi.basic.excel.CustomerExcelDTO;
import com.ruoyi.basic.pojo.Customer;
import com.ruoyi.basic.service.ICustomerService;
import com.ruoyi.common.utils.poi.ExcelUtil;
@@ -32,7 +34,7 @@
     * 查询客户档案列表
     */
    @GetMapping("/list")
    public IPage<Customer> list(Page page, Customer customer) {
    public IPage<Customer> list(Page<Customer> page, Customer customer) {
        return customerService.selectCustomerList(page, customer);
    }
@@ -51,6 +53,23 @@
        }
        ExcelUtil<Customer> util = new ExcelUtil<Customer>(Customer.class);
        util.exportExcel(response, list, "客户档案数据");
    }
    /**
     * 导出客户跟进记录
     */
    @Log(title = "客户档案", businessType = BusinessType.EXPORT)
    @PostMapping("/exportFollowUpList")
    public void exportFollowUpList(HttpServletResponse response, Customer customer) {
        Long[] ids = customer.getIds();
        List<CustomerExcelDTO> list;
        if (ids != null && ids.length > 0) {
            list = customerService.selectCustomerDtoByIds(ids);
        } else {
            list = customerService.selectCustomerDtoLists();
        }
        ExcelUtil<CustomerExcelDTO> util = new ExcelUtil<CustomerExcelDTO>(CustomerExcelDTO.class);
        util.exportExcel(response, list, "客户跟进记录");
    }
    @PostMapping("/downloadTemplate")
@@ -76,7 +95,7 @@
     */
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id) {
        return success(customerService.selectCustomerById(id));
        return success(customerService.selectCustomerDetailById(id));
    }
    /**
@@ -116,4 +135,13 @@
    public List customerList(Customer customer) {
        return customerService.customerList(customer);
    }
    /**
     * 转移客户
     */
    @Log(title = "客户档案", businessType = BusinessType.UPDATE)
    @PatchMapping("/transferCustomer")
    public AjaxResult transferCustomer(@RequestBody CustomerDto customerDto) {
        return toAjax(customerService.transferCustomer(customerDto));
    }
}