| | |
| | | user.setTopUser(byId); |
| | | } |
| | | //获取绑定下级列表 |
| | | List<AppUser> list = appUserService.lambdaQuery().eq(AppUser::getInviteUserId, user.getInviteUserId()).list(); |
| | | List<AppUser> list = appUserService.lambdaQuery().eq(AppUser::getInviteUserId, user.getId()).list(); |
| | | for (AppUser appUser : list) { |
| | | Long count1 = appUserService.lambdaQuery().eq(AppUser::getVipId, 1).eq(AppUser::getTopInviteId, 1).count(); |
| | | Long count2 = appUserService.lambdaQuery().eq(AppUser::getVipId, 2).eq(AppUser::getTopInviteId, userId).count(); |
| | | Long count3 = appUserService.lambdaQuery().eq(AppUser::getVipId, 3).eq(AppUser::getTopInviteId, userId).count(); |
| | | Long count4 = appUserService.lambdaQuery().eq(AppUser::getVipId, 4).eq(AppUser::getTopInviteId, userId).count(); |
| | | Long count5 = appUserService.lambdaQuery().eq(AppUser::getVipId, 5).eq(AppUser::getTopInviteId, userId).count(); |
| | | Long count6 = appUserService.lambdaQuery().eq(AppUser::getVipId, 6).eq(AppUser::getTopInviteId, userId).count(); |
| | | Long count7 = appUserService.lambdaQuery().eq(AppUser::getVipId, 7).eq(AppUser::getTopInviteId, userId).count(); |
| | | Long count1 = appUserService.lambdaQuery().eq(AppUser::getVipId, 1).eq(AppUser::getInviteUserId, appUser.getId()).count(); |
| | | Long count2 = appUserService.lambdaQuery().eq(AppUser::getVipId, 2).eq(AppUser::getInviteUserId, appUser.getId()).count(); |
| | | Long count3 = appUserService.lambdaQuery().eq(AppUser::getVipId, 3).eq(AppUser::getInviteUserId, appUser.getId()).count(); |
| | | Long count4 = appUserService.lambdaQuery().eq(AppUser::getVipId, 4).eq(AppUser::getInviteUserId, appUser.getId()).count(); |
| | | Long count5 = appUserService.lambdaQuery().eq(AppUser::getVipId, 5).eq(AppUser::getInviteUserId, appUser.getId()).count(); |
| | | Long count6 = appUserService.lambdaQuery().eq(AppUser::getVipId, 6).eq(AppUser::getInviteUserId, appUser.getId()).count(); |
| | | Long count7 = appUserService.lambdaQuery().eq(AppUser::getVipId, 7).eq(AppUser::getInviteUserId, appUser.getId()).count(); |
| | | appUser.setCount1(count1); |
| | | appUser.setCount2(count2); |
| | | appUser.setCount3(count3); |
| | |
| | | @GetMapping("/index") |
| | | @ApiOperation(value = "个人中心首页", tags = {"小程序-个人中心首页"}) |
| | | public R<AppUser> index() { |
| | | System.err.println("=-===="); |
| | | Long userId = tokenService.getLoginUserApplet().getUserid(); |
| | | //当前用户信息 |
| | | AppUser user = appUserService.getById(userId); |
| | |
| | | } |
| | | //当前绑定门店的店铺信息 |
| | | if (user.getShopId() != null) { |
| | | R<Shop> storeById = storeClient.getStoreById(user.getShopId()); |
| | | R<Shop> storeById = shopClient.getShopById(user.getShopId()); |
| | | if (storeById.getData() != null) { |
| | | user.setShopName(storeById.getData().getName()); |
| | | } |
| | | } |
| | | Long count1 = appUserService.lambdaQuery().eq(AppUser::getVipId, 1).eq(AppUser::getTopInviteId, 1).count(); |
| | | Long count2 = appUserService.lambdaQuery().eq(AppUser::getVipId, 2).eq(AppUser::getTopInviteId, userId).count(); |
| | | Long count3 = appUserService.lambdaQuery().eq(AppUser::getVipId, 3).eq(AppUser::getTopInviteId, userId).count(); |
| | | Long count4 = appUserService.lambdaQuery().eq(AppUser::getVipId, 4).eq(AppUser::getTopInviteId, userId).count(); |
| | | Long count5 = appUserService.lambdaQuery().eq(AppUser::getVipId, 5).eq(AppUser::getTopInviteId, userId).count(); |
| | | Long count6 = appUserService.lambdaQuery().eq(AppUser::getVipId, 6).eq(AppUser::getTopInviteId, userId).count(); |
| | | Long count7 = appUserService.lambdaQuery().eq(AppUser::getVipId, 7).eq(AppUser::getTopInviteId, userId).count(); |
| | | Long count1 = appUserService.lambdaQuery().eq(AppUser::getVipId, 1).eq(AppUser::getInviteUserId, userId).count(); |
| | | Long count2 = appUserService.lambdaQuery().eq(AppUser::getVipId, 2).eq(AppUser::getInviteUserId, userId).count(); |
| | | Long count3 = appUserService.lambdaQuery().eq(AppUser::getVipId, 3).eq(AppUser::getInviteUserId, userId).count(); |
| | | Long count4 = appUserService.lambdaQuery().eq(AppUser::getVipId, 4).eq(AppUser::getInviteUserId, userId).count(); |
| | | Long count5 = appUserService.lambdaQuery().eq(AppUser::getVipId, 5).eq(AppUser::getInviteUserId, userId).count(); |
| | | Long count6 = appUserService.lambdaQuery().eq(AppUser::getVipId, 6).eq(AppUser::getInviteUserId, userId).count(); |
| | | Long count7 = appUserService.lambdaQuery().eq(AppUser::getVipId, 7).eq(AppUser::getInviteUserId, userId).count(); |
| | | user.setCount1(count1); |
| | | user.setCount2(count2); |
| | | user.setCount3(count3); |
| | |
| | | @ApiParam("每一页数据大小") Integer pageSize, |
| | | AppUser appUser) { |
| | | IPage<AppUser> appuserPage = appUserService.getAppuserPage(pageNum, pageSize, appUser); |
| | | for (AppUser record : appuserPage.getRecords()) { |
| | | if (record.getInviteUserId() != null) { |
| | | AppUser byId1 = appUserService.getById(record.getInviteUserId()); |
| | | if (byId1!=null) { |
| | | record.setInviteUserName(byId1.getName()); |
| | | } |
| | | } |
| | | if (record.getShopId()!=null){ |
| | | R<Shop> shopById = shopClient.getShopById(record.getShopId()); |
| | | if (shopById.getData()!=null){ |
| | | record.setShopName(shopById.getData().getName()); |
| | | } |
| | | } |
| | | } |
| | | return R.ok(appuserPage); |
| | | } |
| | | |
| | |
| | | //推广人 |
| | | if (byId.getInviteUserId() != null) { |
| | | AppUser byId1 = appUserService.getById(byId.getInviteUserId()); |
| | | byId1.setInviteUserName(byId1.getInviteUserName()); |
| | | byId.setInviteUserName(byId1.getName()); |
| | | } |
| | | //最后下单时间 |
| | | R<Order> lastOrder = remoteOrderGoodsClient.getLastOrder(id); |
| | | if (lastOrder.getData() != null) { |
| | | byId.setLastOrderTime(lastOrder.getData().getCreateTime()); |
| | | } |
| | | List<AppUser> list = appUserService.lambdaQuery().eq(AppUser::getInviteUserId, id).list(); |
| | | byId.setBottomUsers(list); |
| | | //消费总金额 |
| | | return R.ok(byId); |
| | | } |
| | |
| | | |
| | | @GetMapping("/listByIds") |
| | | List<AppUser> listByIds(@RequestParam("ids") List<Long> ids) { |
| | | if(ids.size() == 0){ |
| | | return new ArrayList<>(); |
| | | } |
| | | List<AppUser> appUsers = appUserService.listByIds(ids); |
| | | return appUsers; |
| | | } |
| | |
| | | } |
| | | return s; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 检查会员等级变更 |
| | | * @param appUserId |
| | | */ |
| | | @PostMapping("/vipUpgrade") |
| | | public void vipUpgrade(@RequestParam("appUserId") Long appUserId){ |
| | | appUserService.vipUpgrade(appUserId); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 用户降级检测 |
| | | */ |
| | | @PostMapping("/demotionDetection") |
| | | public void demotionDetection(){ |
| | | appUserService.demotionDetection(); |
| | | } |
| | | } |
| | | |