| | |
| | | @PostMapping("/getShopIdByName") |
| | | public R<Set<Integer>> getShopIdByName(@RequestParam("shopName") String shopName){ |
| | | List<Shop> list = shopService.list(new LambdaQueryWrapper<Shop>() |
| | | .like(Shop::getName, shopName)); |
| | | .like(Shop::getName, shopName) |
| | | .eq(Shop::getDelFlag, 0)); |
| | | return R.ok(list.stream().map(Shop::getId).collect(Collectors.toSet())); |
| | | } |
| | | |
| | | @PostMapping("/getManagerByManagerName") |
| | | public R<Set<Long>> getManagerByManagerName(@RequestParam("managerName") String managerName){ |
| | | List<Shop> list = shopService.list(new LambdaQueryWrapper<Shop>() |
| | | .like(Shop::getShopManager, managerName) |
| | | .eq(Shop::getDelFlag, 0)); |
| | | return R.ok(list.stream().map(Shop::getAppUserId).collect(Collectors.toSet())); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/getServiceProvider") |
| | | public R<Shop> getServiceProvider(Long userId){ |
| | | public R<Shop> getServiceProvider(@RequestParam("appUserId") Long appUserId){ |
| | | //向上找获取第一个开店的门店 |
| | | List<Shop> list = shopService.list(new LambdaQueryWrapper<Shop>().eq(Shop::getDelFlag, 0).eq(Shop::getStatus, 1)); |
| | | AppUser appUser = appUserClient.getAppUserById(userId); |
| | | AppUser appUser = appUserClient.getAppUserById(appUserId); |
| | | //上级集合,防止循环关联 |
| | | Set<Long> pid = new HashSet<>(); |
| | | Shop shop = getSuperiorStore(appUser, list, 1, 1, pid); |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/getSuperiorServiceProvider") |
| | | public R<Shop> getSuperiorServiceProvider(Long userId){ |
| | | public R<Shop> getSuperiorServiceProvider(@RequestParam("appUserId") Long appUserId){ |
| | | //向上找获取第一个开店的门店 |
| | | List<Shop> list = shopService.list(new LambdaQueryWrapper<Shop>().eq(Shop::getDelFlag, 0).eq(Shop::getStatus, 1)); |
| | | AppUser appUser = appUserClient.getAppUserById(userId); |
| | | AppUser appUser = appUserClient.getAppUserById(appUserId); |
| | | //上级集合,防止循环关联 |
| | | Set<Long> pid = new HashSet<>(); |
| | | Shop shop = getSuperiorStore(appUser, list, 2, 1, pid); |