| | |
| | | public R<AppUser> info(){ |
| | | Long userId = tokenService.getLoginUserApplet().getUserid(); |
| | | AppUser user = appUserService.getById(userId); |
| | | |
| | | |
| | | |
| | | return R.ok(user); |
| | | } |
| | | @Resource |
| | |
| | | return R.ok(appuserPage); |
| | | } |
| | | |
| | | @GetMapping("/shop/getAppuserPage") |
| | | @ApiOperation(value = "用户列表", tags = {"门店后台"}) |
| | | public R<IPage<AppUser>> shopGetAppuserPage(@ApiParam("页码") @RequestParam Integer pageNum, |
| | | @ApiParam("每一页数据大小") Integer pageSize, |
| | | AppUser appUser) |
| | | { |
| | | Integer objectId = tokenService.getLoginUser().getSysUser().getObjectId(); |
| | | |
| | | List<Long> userIds = new ArrayList<>(); |
| | | userIds.add(-1L); |
| | | //获取在该本店下单的用户ids |
| | | R<List<Order>> listR = remoteOrderGoodsClient.byShopId(objectId); |
| | | for (Order datum : listR.getData()) { |
| | | userIds.add(datum.getAppUserId()); |
| | | } |
| | | IPage<AppUser> appuserPage = appUserService.getAppuserPage1(pageNum, pageSize, appUser,objectId,userIds); |
| | | return R.ok(appuserPage); |
| | | } |
| | | |
| | | |
| | | |
| | | @GetMapping("/danger/info") |
| | | @ApiOperation(value = "用户列表-保级条件详情", tags = {"管理后台"}) |
| | | public R<DangerInfoDto> dangerinfo(Long id) |
| | |
| | | appUserService.updateById(byId); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @GetMapping("/select") |
| | | @ApiOperation(value = "用户列表-查询绑定人", tags = {"管理后台"}) |
| | | public R<AppUser> select(String phone) |
| | | { |
| | | AppUser byId = appUserService.lambdaQuery().eq(AppUser::getPhone,phone).one(); |
| | | if (byId==null){ |
| | | return R.fail("搜索失败,手机号错误。"); |
| | | } |
| | | return R.ok(byId); |
| | | } |
| | | |
| | | @GetMapping("/change/bind") |
| | | @ApiOperation(value = "用户列表-更换绑定人", tags = {"管理后台"}) |
| | | public R<AppUser> select(Long id,Long inviteId) |
| | | { |
| | | AppUser byId = appUserService.getById(id); |
| | | byId.setInviteUserId(inviteId); |
| | | byId.setTopInviteId(getTop(inviteId)); |
| | | appUserService.updateById(byId); |
| | | return R.ok(); |
| | | } |
| | | |
| | | public Long getTop(Long inviteId){ |
| | | AppUser byId = appUserService.getById(inviteId); |
| | | if (byId!=null){ |
| | | return getTop(byId.getInviteUserId()); |
| | | }else { |
| | | return inviteId; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @Resource |
| | | private ShopClient shopClient; |
| | | @Resource |
| | |
| | | if (lastOrder.getData()!=null){ |
| | | byId.setLastOrderTime(lastOrder.getData().getCreateTime()); |
| | | } |
| | | //消费总金额 |
| | | return R.ok(byId); |
| | | } |
| | | @GetMapping("/bottom") |
| | |
| | | |
| | | } |
| | | |
| | | @GetMapping("/orders") |
| | | @ApiOperation(value = "用户列表-订单列表", tags = {"管理后台"}) |
| | | public R<List<Order>> orders(Long id) |
| | | { |
| | | R<List<Order>> listR = remoteOrderGoodsClient.byUserId(id); |
| | | return R.ok(listR.getData()); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | |
| | | |
| | | |
| | | @GetMapping("/listByIds") |
| | | List<AppUser> listByIds(List<String> list){ |
| | | return appUserService.listByIds(list); |
| | | List<AppUser> listByIds(@RequestParam("ids") List<Long> ids){ |
| | | List<AppUser> appUsers = appUserService.listByIds(ids); |
| | | return appUsers; |
| | | } |
| | | |
| | | |
| | | |
| | | @PostMapping("/getAppUserByPhone1") |
| | | public R<AppUser> getAppUserByPhone1(@RequestParam("phone") String phone){ |
| | | AppUser appUser = appUserService.getOne(new LambdaQueryWrapper<AppUser>().eq(AppUser::getDelFlag, 0).eq(AppUser::getStatus, 1) |
| | | .eq(AppUser::getPhone, phone)); |
| | | return R.ok(appUser); |
| | | } |
| | | |
| | | } |