From 271f4a25576ac6c2c8f2c4eb4c9782d6eef85124 Mon Sep 17 00:00:00 2001
From: huminmin <mac@MacBook-Pro.local>
Date: 星期四, 07 五月 2026 13:13:55 +0800
Subject: [PATCH] 修改报错
---
src/main/java/com/ruoyi/basic/controller/CustomerController.java | 51 +++++++++++++++++++++++++++++++++++++--------------
1 files changed, 37 insertions(+), 14 deletions(-)
diff --git a/src/main/java/com/ruoyi/basic/controller/CustomerController.java b/src/main/java/com/ruoyi/basic/controller/CustomerController.java
index 9aa6570..866153b 100644
--- a/src/main/java/com/ruoyi/basic/controller/CustomerController.java
+++ b/src/main/java/com/ruoyi/basic/controller/CustomerController.java
@@ -5,6 +5,7 @@
import com.ruoyi.basic.dto.CustomerDto;
import com.ruoyi.basic.pojo.Customer;
import com.ruoyi.basic.service.ICustomerService;
+import com.ruoyi.basic.vo.CustomerVo;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
@@ -35,7 +36,7 @@
*/
@GetMapping("/list")
public R list(Page<CustomerDto> page, CustomerDto customer) {
- IPage<CustomerDto> customerDtoIPage = customerService.selectCustomerList(page, customer);
+ IPage<CustomerVo> customerDtoIPage = customerService.selectCustomerList(page, customer);
return R.ok(customerDtoIPage);
}
@@ -44,16 +45,9 @@
*/
@Log(title = "瀹㈡埛妗f", 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, "瀹㈡埛妗f鏁版嵁");
+ public void export(HttpServletResponse response, CustomerDto customer) {
+ ExcelUtil<CustomerVo> util = new ExcelUtil<CustomerVo>(CustomerVo.class);
+ util.exportExcel(response, customerService.selectCustomerLists(customer), "瀹㈡埛妗f鏁版嵁");
}
@PostMapping("/downloadTemplate")
@@ -69,9 +63,9 @@
*/
@Log(title = "瀹㈡埛妗f", 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);
}
/**
@@ -121,4 +115,33 @@
}
-}
+ /**
+ * 鍒嗛厤瀹㈡埛
+ */
+ @Log(title = "瀹㈡埛妗f", businessType = BusinessType.OTHER)
+ @PostMapping("/assignCustomer")
+ public AjaxResult assignCustomer(@RequestBody CustomerDto customer) {
+ customerService.assignCustomer(customer);
+ return AjaxResult.success();
+ }
+
+ /**
+ * 鍥炴敹瀹㈡埛
+ */
+ @Log(title = "瀹㈡埛妗f", businessType = BusinessType.OTHER)
+ @PostMapping("/recycleCustomer")
+ public AjaxResult recycleCustomer(@RequestBody CustomerDto customer) {
+ customerService.recycleCustomer(customer);
+ return AjaxResult.success();
+ }
+
+ /**
+ * 鍏变韩瀹㈡埛
+ */
+ @Log(title = "瀹㈡埛妗f", businessType = BusinessType.OTHER)
+ @PostMapping("/together")
+ public AjaxResult together(@RequestBody CustomerDto customer) {
+ customerService.together(customer);
+ return AjaxResult.success();
+ }
+}
\ No newline at end of file
--
Gitblit v1.9.3