| | |
| | | |
| | | 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.pojo.Customer; |
| | | import com.ruoyi.basic.service.ICustomerService; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | * 查询客户档案列表 |
| | | */ |
| | | @GetMapping("/list") |
| | | public IPage<Customer> list(Page page, Customer customer) { |
| | | return customerService.selectCustomerList(page, customer); |
| | | public R list(Page<CustomerDto> page, CustomerDto customer) { |
| | | IPage<CustomerDto> customerDtoIPage = customerService.selectCustomerList(page, customer); |
| | | return R.ok(customerDtoIPage); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @GetMapping(value = "/{id}") |
| | | public AjaxResult getInfo(@PathVariable("id") Long id) { |
| | | return success(customerService.selectCustomerById(id)); |
| | | return success(customerService.selectCustomerDetailById(id)); |
| | | } |
| | | |
| | | /** |
| | |
| | | public List customerList(Customer customer) { |
| | | return customerService.customerList(customer); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 分配客户 |
| | | */ |
| | | @Log(title = "客户档案", businessType = BusinessType.OTHER) |
| | | @PostMapping("/assignCustomer") |
| | | public AjaxResult assignCustomer(@RequestBody CustomerDto customer) { |
| | | customerService.assignCustomer(customer); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | /** |
| | | * 回收客户 |
| | | */ |
| | | @Log(title = "客户档案", businessType = BusinessType.OTHER) |
| | | @PostMapping("/recycleCustomer") |
| | | public AjaxResult recycleCustomer(@RequestBody CustomerDto customer) { |
| | | customerService.recycleCustomer(customer); |
| | | return AjaxResult.success(); |
| | | } |
| | | } |