| | |
| | | return appUserService.mobileLogin(mobileLogin); |
| | | } |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/registerAccount") |
| | | @ApiOperation(value = "注册新账号") |
| | | public R<LoginVo> registerAccount(@RequestBody RegisterAccount registerAccount) { |
| | | return appUserService.registerAccount(registerAccount); |
| | | } |
| | | |
| | | @GetMapping("/logout") |
| | | @ApiOperation(value = "登出") |
| | |
| | | userStatistics.setTotalUser(appUserList.size());//总用户数 |
| | | userStatistics.setConsumerUser((int) consumerUser);//消费过的用户 |
| | | |
| | | //用户类型统计门店 |
| | | long shopUserCount = appUserList.stream() |
| | | .filter(appUser -> appUser.getUserType() == 2) |
| | | .count(); |
| | | userStatistics.setShopUser((int) shopUserCount); |
| | | //拥有店铺用户数 |
| | | Integer shopUserCount = appUserShopService.getHaveShopUserNum(); |
| | | |
| | | userStatistics.setShopUser(shopUserCount); |
| | | |
| | | //门店总数 |
| | | long shopNum = shopClient.getAllShop().getData().size(); |
| | |
| | | }else { |
| | | userStatistics.setTotalScore((Long) result.get("total_points")); |
| | | } |
| | | |
| | | //统计消费积分和现金支付数 |
| | | Map<String, Object> data = orderClient.getConsumeScoreAndPayAmount(userId).getData(); |
| | | |
| | | //条件构造 消费积分现金支付金额 |
| | | queryWrapper.clear(); |
| | | QueryWrapper<AppUser> queryWrapper1 = new QueryWrapper<>(); |
| | | queryWrapper1.select("sum(exchange_point + transferable_out_point - cancel_point) as total_points"); |
| | | queryWrapper1.select("sum(shop_amount) as payment_amounts "); |
| | | queryWrapper1.eq("del_flag", 0);//未删除的 |
| | | queryWrapper1.ne("status", 3);//未注销的 |
| | | if (userId != null) { |
| | | queryWrapper1.eq("id", userId); |
| | | } |
| | | Map<String, Object> data = appUserShopService.getPointAndPayAmount(userId); |
| | | if (data == null || data.get("total_points") == null) { |
| | | userStatistics.setConsumeScore(0L); |
| | | }else { |
| | |
| | | }else { |
| | | userStatistics.setShopAmount(new BigDecimal(data.get("payment_amounts").toString())); |
| | | } |
| | | |
| | | |
| | | return R.ok(userStatistics); |
| | | } |