| | |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | |
| | | * 导出客户档案列表 |
| | | */ |
| | | @Log(title = "客户档案", businessType = BusinessType.EXPORT) |
| | | @PreAuthorize("@ss.hasPermi('basic:customer:export')") |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, CustomerDto customer) { |
| | | ExcelUtil<CustomerVo> util = new ExcelUtil<CustomerVo>(CustomerVo.class); |
| | |
| | | } |
| | | |
| | | @PostMapping("/downloadTemplate") |
| | | @PreAuthorize("@ss.hasPermi('basic:customer:import')") |
| | | @Log(title = "客户档案-下载模板", businessType = BusinessType.EXPORT) |
| | | public void downloadTemplate(HttpServletResponse response) { |
| | | ExcelUtil<Customer> util = new ExcelUtil<Customer>(Customer.class); |
| | |
| | | * 导入客户档案 |
| | | */ |
| | | @Log(title = "客户档案", businessType = BusinessType.IMPORT) |
| | | @PreAuthorize("@ss.hasPermi('basic:customer:import')") |
| | | @PostMapping("/importData") |
| | | public R importData(MultipartFile file, Integer type) throws Exception { |
| | | |
| | |
| | | * 获取客户档案详细信息 |
| | | */ |
| | | @GetMapping(value = "/{id}") |
| | | @PreAuthorize("@ss.hasPermi('basic:customer:query')") |
| | | public R getInfo(@PathVariable("id") Long id) { |
| | | return R.ok(customerService.selectCustomerDetailById(id)); |
| | | } |
| | |
| | | * 新增客户档案 |
| | | */ |
| | | @Log(title = "客户档案", businessType = BusinessType.INSERT) |
| | | @PreAuthorize("@ss.hasPermi('basic:customer:add')") |
| | | @PostMapping("/addCustomer") |
| | | public R add(@RequestBody Customer customer) { |
| | | return R.ok(customerService.insertCustomer(customer)); |
| | |
| | | * 修改客户档案 |
| | | */ |
| | | @Log(title = "客户档案", businessType = BusinessType.UPDATE) |
| | | @PreAuthorize("@ss.hasPermi('basic:customer:edit')") |
| | | @PostMapping("/updateCustomer") |
| | | public R edit(@RequestBody Customer customer) { |
| | | return R.ok(customerService.updateCustomer(customer)); |
| | |
| | | * 删除客户档案 |
| | | */ |
| | | @Log(title = "客户档案", businessType = BusinessType.DELETE) |
| | | @PreAuthorize("@ss.hasPermi('basic:customer:remove')") |
| | | @DeleteMapping("/delCustomer") |
| | | public R remove(@RequestBody Long[] ids) { |
| | | if (ids == null || ids.length == 0) { |