huliguo
9 天以前 3348eda2c33469e9935ae6afcf83ea5c52cea906
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/AppUserController.java
@@ -105,6 +105,12 @@
        return appUserService.mobileLogin(mobileLogin);
    }
    @ResponseBody
    @PostMapping("/registerAccount")
    @ApiOperation(value = "注册新账号")
    public R<LoginVo> registerAccount(@RequestBody RegisterAccount registerAccount) {
        return appUserService.registerAccount(registerAccount);
    }
    @GetMapping("/logout")
    @ApiOperation(value = "登出")
@@ -519,11 +525,10 @@
        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();
@@ -554,10 +559,17 @@
        }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 {
@@ -569,7 +581,6 @@
        }else {
            userStatistics.setShopAmount(new BigDecimal(data.get("payment_amounts").toString()));
        }
        return R.ok(userStatistics);
    }