chengf
2026-01-29 67460d9dd51a5185dc0f7cb872dce43789d54643
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/demo/customer/controller/CustomerController.java
@@ -33,6 +33,7 @@
import org.jeecg.modules.system.controller.SysUserController;
import org.jeecg.modules.system.entity.SysUser;
import org.jeecg.modules.system.service.ISysUserService;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
@@ -65,7 +66,9 @@
public class CustomerController extends JeecgController<Customer, ICustomerService> {
   @Autowired
   private ICustomerService customerService;
     @Autowired
     private ISysUserService sysUserService;
   /**
    * 分页列表查询
    *
@@ -116,6 +119,8 @@
     @Operation(summary="客户表-查询总客户数")
     @GetMapping(value = "/count")
     public Result<IPage<Customer>> count(Customer customer,
                                          @RequestParam(name="role", defaultValue="无") String role,
                                          @RequestParam(name="user", defaultValue="无") String user,
                                                  HttpServletRequest req) {
         if (customer.getAgentsNameToCustomer() != null) {
             // 1. 构建Lambda查询条件,指定查询enterpriseName字段并去重
@@ -143,6 +148,13 @@
                     .collect(Collectors.toList()).toString());
         }
         QueryWrapper<Customer> queryWrapper = QueryGenerator.initQueryWrapper(customer, req.getParameterMap());
         if (!user.equals("无")){
             QueryWrapper qw = new QueryWrapper<SysUser>();
             qw.eq("id", user);
             String userName = ((SysUser)((Page) sysUserService.queryPageList(req, qw, 1, 1).getResult()).getRecords().get(0)).getUsername();
             queryWrapper.eq("create_by", userName);
         }
         long count = customerService.count(queryWrapper);
         return Result.OK(count+"");
     }