liding
2025-05-08 88aaf2bd88615c0afea7488441d8e5bad31d4906
src/main/java/com/ruoyi/basic/controller/CustomerController.java
@@ -23,23 +23,21 @@
/**
 * 客户档案Controller
 *
 *
 * @author ruoyi
 * @date 2025-05-07
 */
@RestController
@RequestMapping("/system/customer")
@RequestMapping("/basic/customer")
@AllArgsConstructor
public class CustomerController extends BaseController
{
public class CustomerController extends BaseController {
    private ICustomerService customerService;
    /**
     * 查询客户档案列表
     */
    @GetMapping("/list")
    public TableDataInfo list(Customer customer)
    {
    public TableDataInfo list(Customer customer) {
        startPage();
        List<Customer> list = customerService.selectCustomerList(customer);
        return getDataTable(list);
@@ -50,9 +48,15 @@
     */
    @Log(title = "客户档案", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, Customer customer)
    {
        List<Customer> list = customerService.selectCustomerList(customer);
    public void export(HttpServletResponse response, Customer customer) {
        Long[] ids = customer.getIds();
        List<Customer> list;
        if (ids != null && ids.length > 0) {
            list = customerService.selectCustomerListByIds(ids);
        } else {
            list = customerService.selectCustomerList(customer);
        }
        ExcelUtil<Customer> util = new ExcelUtil<Customer>(Customer.class);
        util.exportExcel(response, list, "客户档案数据");
    }
@@ -61,8 +65,7 @@
     * 获取客户档案详细信息
     */
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
    public AjaxResult getInfo(@PathVariable("id") Long id) {
        return success(customerService.selectCustomerById(id));
    }
@@ -70,9 +73,8 @@
     * 新增客户档案
     */
    @Log(title = "客户档案", businessType = BusinessType.INSERT)
    @PostMapping  ("/addCustomer")
    public AjaxResult add(@RequestBody Customer customer)
    {
    @PostMapping("/addCustomer")
    public AjaxResult add(@RequestBody Customer customer) {
        return toAjax(customerService.insertCustomer(customer));
    }
@@ -80,9 +82,8 @@
     * 修改客户档案
     */
    @Log(title = "客户档案", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody Customer customer)
    {
    @PostMapping("/updateCustomer")
    public AjaxResult edit(@RequestBody Customer customer) {
        return toAjax(customerService.updateCustomer(customer));
    }
@@ -90,9 +91,8 @@
     * 删除客户档案
     */
    @Log(title = "客户档案", businessType = BusinessType.DELETE)
   @DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
    @DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids) {
        return toAjax(customerService.deleteCustomerByIds(ids));
    }
}