| | |
| | | } |
| | | |
| | | TCrmSupplier crmSupplier = crmSupplierService.getOne(Wrappers.lambdaQuery(TCrmSupplier.class) |
| | | .eq(TCrmSupplier::getUserId, userId)); |
| | | .eq(TCrmSupplier::getUserId, userId) |
| | | .last("LIMIT 1")); |
| | | |
| | | Map<String, Object> map = new HashMap<>(); |
| | | |
| | |
| | | String supplierAndClinicId = null; |
| | | if (roleType == 4) { |
| | | TCrmSupplier crmSupplier = crmSupplierService.getOne(Wrappers.lambdaQuery(TCrmSupplier.class) |
| | | .eq(TCrmSupplier::getUserId, userId)); |
| | | .eq(TCrmSupplier::getUserId, userId) |
| | | .last("LIMIT 1")); |
| | | supplierAndClinicId = crmSupplier.getId(); |
| | | } else { |
| | | TCrmClinic crmClinic = crmClinicService.getOne(Wrappers.lambdaQuery(TCrmClinic.class) |
| | | .eq(TCrmClinic::getUserId, userId)); |
| | | .eq(TCrmClinic::getUserId, userId) |
| | | .last("LIMIT 1")); |
| | | if(Objects.isNull(crmClinic)){ |
| | | SysUser sysUser = sysUserService.selectUserById(userId); |
| | | crmClinic = crmClinicService.getById(sysUser.getObjectId()); |
| | | } |
| | | if(Objects.isNull(crmClinic)){ |
| | | return R.fail("未找到该账号诊所信息"); |
| | | } |
| | | supplierAndClinicId = crmClinic.getId(); |
| | | } |
| | | |
| | |
| | | Long userId = tokenService.getLoginUser().getUserId(); |
| | | |
| | | TCrmClinic crmClinic = crmClinicService.getOne(Wrappers.lambdaQuery(TCrmClinic.class) |
| | | .eq(TCrmClinic::getUserId, userId)); |
| | | .eq(TCrmClinic::getUserId, userId) |
| | | .last("LIMIT 1")); |
| | | if(Objects.isNull(crmClinic)){ |
| | | SysUser sysUser = sysUserService.selectUserById(userId); |
| | | crmClinic = crmClinicService.getById(sysUser.getObjectId()); |
| | | } |
| | | if(Objects.isNull(crmClinic)){ |
| | | return R.fail("未找到该账号诊所信息"); |
| | | } |
| | | |
| | | List<TSysAppUser> sysAppUsers = sysAppUserService.list(Wrappers.lambdaQuery(TSysAppUser.class) |
| | | .eq(TSysAppUser::getClinicId, crmClinic.getId())); |
| | |
| | | Long userId = tokenService.getLoginUser().getUserId(); |
| | | |
| | | TCrmClinic crmClinic = crmClinicService.getOne(Wrappers.lambdaQuery(TCrmClinic.class) |
| | | .eq(TCrmClinic::getUserId, userId)); |
| | | |
| | | .eq(TCrmClinic::getUserId, userId) |
| | | .last("LIMIT 1")); |
| | | if(Objects.isNull(crmClinic)){ |
| | | SysUser sysUser = sysUserService.selectUserById(userId); |
| | | crmClinic = crmClinicService.getById(sysUser.getObjectId()); |
| | | } |
| | | if(Objects.isNull(crmClinic)){ |
| | | return R.fail("未找到该账号诊所信息"); |
| | | } |
| | | List<TCrmClinicPoints> crmClinicPoints = crmClinicPointsService.clinicPointsStatistics(crmClinic.getId(), LocalDate.now() + " 23:59:59"); |
| | | Map<String, Integer> map = new HashMap<>(); |
| | | if (CollectionUtils.isEmpty(crmClinicPoints)) { |
| | |
| | | Long userId = tokenService.getLoginUser().getUserId(); |
| | | |
| | | TCrmSupplier crmSupplier = crmSupplierService.getOne(Wrappers.lambdaQuery(TCrmSupplier.class) |
| | | .eq(TCrmSupplier::getUserId, userId)); |
| | | .eq(TCrmSupplier::getUserId, userId) |
| | | .last("LIMIT 1")); |
| | | // 查询药品总类和总数 |
| | | Integer typeTotalCount = erpProcurementService.supplierSalesStatisticsTypeCount(crmSupplier.getId()); |
| | | Integer totalCount = erpProcurementService.supplierSalesStatisticsCount(crmSupplier.getId()); |
| | |
| | | break; |
| | | } |
| | | TCrmSupplier crmSupplier = crmSupplierService.getOne(Wrappers.lambdaQuery(TCrmSupplier.class) |
| | | .eq(TCrmSupplier::getUserId, userId)); |
| | | .eq(TCrmSupplier::getUserId, userId) |
| | | .last("LIMIT 1")); |
| | | SupplierSalesStatisticsVO supplierSalesStatisticsVO = new SupplierSalesStatisticsVO(); |
| | | // 销售金额 |
| | | BigDecimal totalMoney = erpProcurementService.supplierSalesStatisticsMoney(crmSupplier.getId(), startTime, endTime); |
| | |
| | | Long userId = tokenService.getLoginUser().getUserId(); |
| | | |
| | | TCrmClinic crmClinic = crmClinicService.getOne(Wrappers.lambdaQuery(TCrmClinic.class) |
| | | .eq(TCrmClinic::getUserId, userId)); |
| | | .eq(TCrmClinic::getUserId, userId) |
| | | .last("LIMIT 1")); |
| | | if(Objects.isNull(crmClinic)){ |
| | | SysUser sysUser = sysUserService.selectUserById(userId); |
| | | crmClinic = crmClinicService.getById(sysUser.getObjectId()); |
| | | } |
| | | if(Objects.isNull(crmClinic)){ |
| | | return R.fail("未找到该账号诊所信息"); |
| | | } |
| | | // 查询药品总类和总数 |
| | | Integer typeTotalCount = sysOrderService.clinicSalesStatisticsTypeCount(Arrays.asList(crmClinic.getId())); |
| | | Integer totalCount = sysOrderService.clinicSalesStatisticsCount(Arrays.asList(crmClinic.getId())); |
| | | Integer typeTotalCount = sysOrderService.clinicSalesStatisticsTypeCount(Collections.singletonList(crmClinic.getId())); |
| | | Integer totalCount = sysOrderService.clinicSalesStatisticsCount(Collections.singletonList(crmClinic.getId())); |
| | | Map<String, Integer> map = new HashMap<>(); |
| | | map.put("typeTotalCount", typeTotalCount); |
| | | map.put("totalCount", totalCount); |
| | |
| | | break; |
| | | } |
| | | TCrmClinic crmClinic = crmClinicService.getOne(Wrappers.lambdaQuery(TCrmClinic.class) |
| | | .eq(TCrmClinic::getUserId, userId)); |
| | | .eq(TCrmClinic::getUserId, userId) |
| | | .last("LIMIT 1")); |
| | | if(Objects.isNull(crmClinic)){ |
| | | SysUser sysUser = sysUserService.selectUserById(userId); |
| | | crmClinic = crmClinicService.getById(sysUser.getObjectId()); |
| | | } |
| | | if(Objects.isNull(crmClinic)){ |
| | | return R.fail("未找到该账号诊所信息"); |
| | | } |
| | | ClinicSalesStatisticsVO clinicSalesStatisticsVO = new ClinicSalesStatisticsVO(); |
| | | // 销售金额 |
| | | BigDecimal totalMoney = sysOrderService.clinicSalesStatisticsMoney(crmClinic.getId(), startTime, endTime); |
| | |
| | | Integer roleType = user.getRoleType(); |
| | | if (roleType == 2) { |
| | | TCrmBranch branch = crmBranchService.getOne(Wrappers.lambdaQuery(TCrmBranch.class) |
| | | .eq(TCrmBranch::getUserId, user.getUserId())); |
| | | .eq(TCrmBranch::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | if (branch != null) { |
| | | 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()) { |