| | |
| | | */ |
| | | @Log(title = "客户档案", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | 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.selectCustomerLists(customer); |
| | | } |
| | | ExcelUtil<Customer> util = new ExcelUtil<Customer>(Customer.class); |
| | | util.exportExcel(response, list, "客户档案数据"); |
| | | public void export(HttpServletResponse response, CustomerDto customer) { |
| | | ExcelUtil<CustomerVo> util = new ExcelUtil<CustomerVo>(CustomerVo.class); |
| | | util.exportExcel(response, customerService.selectCustomerLists(customer), "客户档案数据"); |
| | | } |
| | | |
| | | @PostMapping("/downloadTemplate") |
| | |
| | | */ |
| | | @Log(title = "客户档案", businessType = BusinessType.IMPORT) |
| | | @PostMapping("/importData") |
| | | public AjaxResult importData(MultipartFile file) throws Exception { |
| | | public AjaxResult importData(MultipartFile file, Integer type) throws Exception { |
| | | |
| | | return customerService.importData(file); |
| | | return customerService.importData(file, type); |
| | | } |
| | | |
| | | /** |