| | |
| | | import com.ruoyi.account.api.model.UserCancellationLog; |
| | | import com.ruoyi.account.api.model.UserCoupon; |
| | | import com.ruoyi.account.api.model.UserSignRecord; |
| | | import com.ruoyi.account.mapper.AppUserMapper; |
| | | import com.ruoyi.account.service.AppUserService; |
| | | import com.ruoyi.account.service.UserCancellationLogService; |
| | | import com.ruoyi.account.service.UserCouponService; |
| | |
| | | private UserPointService userPointService; |
| | | @Resource |
| | | private VipSettingService vipSettingService; |
| | | @Resource |
| | | private AppUserMapper appUserMapper; |
| | | |
| | | |
| | | @ResponseBody |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | @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(); |
| | | } |
| | | @GetMapping("/change/shop") |
| | | @ApiOperation(value = "用户列表-更换门店", tags = {"管理后台"}) |
| | | public R<AppUser> shop(Long id,Long shopId) |
| | | { |
| | | AppUser byId = appUserService.getById(id); |
| | | byId.setShopId(shopId); |
| | | 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); |
| | | } |
| | | |
| | |
| | | return R.ok(appUser); |
| | | } |
| | | |
| | | /** |
| | | * 用户统计 |
| | | */ |
| | | @GetMapping("/statistics") |
| | | @ApiOperation(value = "用户统计",tags = {"管理后台-首页统计-用户统计"}) |
| | | public R<UserStatistics> statistics() { |
| | | UserStatistics userStatistics = appUserMapper.getUserStatistics(); |
| | | return R.ok(userStatistics); |
| | | } |
| | | |
| | | /** |
| | | * 用户统计详情 |
| | | */ |
| | | @GetMapping("/statistics/detail") |
| | | @ApiOperation(value = "用户统计详情",tags = {"管理后台-首页统计-用户统计详情"}) |
| | | public R<UserStatisticsDetail> statisticsDetail(String userName) { |
| | | UserStatisticsDetail userStatisticsDetail = appUserMapper.getUserStatisticsDetail(userName); |
| | | return R.ok(userStatisticsDetail); |
| | | } |
| | | |
| | | } |
| | | |