From b22df417e0bc423c788b013feaad686531d69eed Mon Sep 17 00:00:00 2001 From: puzhibing <393733352@qq.com> Date: 星期三, 08 一月 2025 09:51:37 +0800 Subject: [PATCH] 修改bug --- ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopController.java | 22 ++++++++++++++++++++++ 1 files changed, 22 insertions(+), 0 deletions(-) diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopController.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopController.java index ff0db3a..4a5dc06 100644 --- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopController.java +++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopController.java @@ -11,6 +11,7 @@ import com.ruoyi.common.core.web.controller.BaseController; import com.ruoyi.common.security.service.TokenService; import com.ruoyi.common.security.utils.SecurityUtils; +import com.ruoyi.order.feignClient.OrderClient; import com.ruoyi.order.vo.VerifiableShopVo; import com.ruoyi.other.api.domain.Goods; import com.ruoyi.other.api.domain.GoodsShop; @@ -77,6 +78,8 @@ private GoodsService goodsService; @Resource private GoodsShopService goodsShopService; + @Resource + private OrderClient orderClient; @@ -471,6 +474,14 @@ @ApiOperation(value = "门店统计", tags = {"管理后台-首页统计"}) public R<ShopStatistics> shopStatistics(@ApiParam("门店id") Integer shopId) { ShopStatistics shopStatistics = shopMapper.getShopStatistics(shopId); + if(null == shopId){ + shopId = 0; + } + Integer serviceOrder = orderClient.getShopSaleNum(shopId, 1).getData(); + Integer goodsOrder = orderClient.getShopSaleNum(shopId, 2).getData(); + shopStatistics.setTotalOrder(serviceOrder + goodsOrder); + shopStatistics.setServiceOrder(serviceOrder); + shopStatistics.setGoodsOrder(goodsOrder); return R.ok(shopStatistics); } @@ -558,5 +569,16 @@ shopService.saveWithdrawalAccount(saveWithdrawalAccount); return R.ok(); } + + + /** + * 获取所有门店 + * @return + */ + @PostMapping("/getAllShop") + public R<List<Shop>> getAllShop(){ + List<Shop> list = shopService.list(new LambdaQueryWrapper<Shop>().eq(Shop::getDelFlag, 0).eq(Shop::getStatus, 1)); + return R.ok(list); + } } -- Gitblit v1.7.1