ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/AppUserController.java
@@ -34,6 +34,7 @@
import com.ruoyi.system.api.domain.SysUser;
import com.ruoyi.system.api.feignClient.SysUserClient;
import io.swagger.annotations.*;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
@@ -546,6 +547,9 @@
    @GetMapping("/detail")
    @ApiOperation(value = "用户列表-详情", tags = {"管理后台"})
    public R<AppUser> detail(Long id) {
        Long userid = tokenService.getLoginUser().getUserid();
        SysUser sysUser = sysUserClient.getSysUser(userid).getData();
        AppUser byId = appUserService.getById(id);
        if (byId.getShopId() != null) {
            R<Shop> shopById = shopClient.getShopById(Integer.parseInt(String.valueOf(byId.getShopId())));
@@ -576,6 +580,12 @@
        List<AppUser> list = appUserService.lambdaQuery().eq(AppUser::getInviteUserId, id).list();
        byId.setBottomUsers(list);
        //消费总金额
        R<List<Order>> orderR = remoteOrderGoodsClient.byShopId(sysUser.getObjectId());
        List<Order> orderList = orderR.getData();
        if (!CollectionUtils.isEmpty(orderList)){
            BigDecimal paymentAmount = orderList.stream().map(Order::getPaymentAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
            byId.setShopAmount(paymentAmount);
        }
        return R.ok(byId);
    }