| | |
| | | |
| | | 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; |
| | |
| | | public class CustomerController extends JeecgController<Customer, ICustomerService> { |
| | | @Autowired |
| | | private ICustomerService customerService; |
| | | |
| | | |
| | | @Autowired |
| | | private ISysUserService sysUserService; |
| | | /** |
| | | * 分页列表查询 |
| | | * |
| | |
| | | @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字段并去重 |
| | |
| | | .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+""); |
| | | } |