| | |
| | | TCrmBranch branch = crmBranchService.getOne(Wrappers.lambdaQuery(TCrmBranch.class) |
| | | .eq(TCrmBranch::getUserId, user.getUserId())); |
| | | if (branch != null) { |
| | | List<TCrmClinic> list = crmClinicService.list(Wrappers.lambdaQuery(TCrmClinic.class).eq(TCrmClinic::getBranchId, branch.getId())); |
| | | List<TCrmClinic> list = crmClinicService.list(Wrappers.lambdaQuery(TCrmClinic.class).eq(TCrmClinic::getBranchId, branch.getId()).in(TCrmClinic::getStatus,Arrays.asList(3,4,5))); |
| | | if (!list.isEmpty()) { |
| | | List<String> crmClinicIds = list.stream().map(TCrmClinic::getId).collect(Collectors.toList()); |
| | | |
| | |
| | | } else { |
| | | eq.eq(TCrmClinic::getBranchId, branch.getId()); |
| | | } |
| | | eq.in(TCrmClinic::getStatus,Arrays.asList(3,4,5)); |
| | | |
| | | List<TCrmClinic> list = crmClinicService.list(eq); |
| | | branchAdminStatisticsTwoVo.setClinicNum(list.size()); |
| | |
| | | if (branch != null) { |
| | | LambdaQueryWrapper<TCrmClinic> eq = Wrappers.lambdaQuery(TCrmClinic.class); |
| | | eq.eq(TCrmClinic::getBranchId, branch.getId()); |
| | | eq.eq(TCrmClinic::getStatus, Arrays.asList(3,4,5)); |
| | | List<TCrmClinic> list = crmClinicService.list(eq); |
| | | |
| | | List<String> clinicIds = list.stream().map(TCrmClinic::getId).collect(Collectors.toList()); |
| | |
| | | |
| | | Integer roleType = user.getRoleType(); |
| | | if (roleType == 1) { |
| | | List<TCrmClinic> list = crmClinicService.list(); |
| | | List<TCrmClinic> list = crmClinicService.list(new LambdaQueryWrapper<TCrmClinic>().in(TCrmClinic::getStatus,Arrays.asList(3,4,5))); |
| | | if (!list.isEmpty()) { |
| | | |
| | | long branchCount = crmBranchService.count(); |
| | |
| | | if (query.getSalespersonId() != null && !query.getSalespersonId().isEmpty()) { |
| | | w.eq(TCrmClinic::getSalespersonId, query.getSalespersonId()); |
| | | } |
| | | w.in(TCrmClinic::getStatus,Arrays.asList(3,4,5)); |
| | | List<TCrmClinic> list = crmClinicService.list(w); |
| | | branchAdminStatisticsOneVo.setClinicNum(list.size()); |
| | | |
| | |
| | | if(query.getBranchId()!=null && !query.getBranchId().isEmpty()){ |
| | | eq.eq(TCrmClinic::getBranchId, query.getBranchId()); |
| | | } |
| | | eq.in(TCrmClinic::getStatus,Arrays.asList(3,4,5)); |
| | | List<TCrmClinic> list = crmClinicService.list(eq); |
| | | |
| | | List<String> clinicIds = list.stream().map(TCrmClinic::getId).collect(Collectors.toList()); |
| | |
| | | if (query.getName() != null && !query.getName().isEmpty()) { |
| | | collect = collect.stream().filter(e -> e.getGoodsName().equals(query.getName())).collect(Collectors.toList()); |
| | | } |
| | | if (query.getType() == 1) { |
| | | if (query.getType() == 1 && !collect.isEmpty()) { |
| | | ProcurementStatisticsVO procurementStatisticsVO = new ProcurementStatisticsVO(); |
| | | procurementStatisticsVO.setTime(LocalDate.now().toString()); |
| | | procurementStatisticsVO.setCount(collect.stream().mapToInt(TErpProcurementGoods::getPurchaseCount).sum()); |
| | | procurementStatisticsVOS.add(procurementStatisticsVO); |
| | | } |
| | | if (query.getType() == 2) { |
| | | if (query.getType() == 2 && !collect.isEmpty()) { |
| | | // 昨日的数据 |
| | | ProcurementStatisticsVO procurementStatisticsVO = new ProcurementStatisticsVO(); |
| | | procurementStatisticsVO.setTime(LocalDate.now().minusDays(1).toString()); |
| | |
| | | procurementStatisticsVOS.add(procurementStatisticsVO); |
| | | } |
| | | |
| | | if (query.getType() == 3) { |
| | | if (query.getType() == 3 && !collect.isEmpty()) { |
| | | // 近7天的数据 |
| | | for (int i = 6; i >= 0; i--) { |
| | | ProcurementStatisticsVO procurementStatisticsVO = new ProcurementStatisticsVO(); |
| | |
| | | procurementStatisticsVOS.add(procurementStatisticsVO); |
| | | } |
| | | } |
| | | if (query.getType() == 4) { |
| | | if (query.getType() == 4 && !collect.isEmpty()) { |
| | | // 按月算 |
| | | for (int i = 5; i >= 0; i--) { |
| | | ProcurementStatisticsVO procurementStatisticsVO = new ProcurementStatisticsVO(); |
| | |
| | | } |
| | | } |
| | | |
| | | if (query.getType() == 5) { |
| | | if (query.getType() == 5 && !collect.isEmpty()) { |
| | | // 按月算 |
| | | for (int i = 11; i >= 0; i--) { |
| | | ProcurementStatisticsVO procurementStatisticsVO = new ProcurementStatisticsVO(); |