puzhibing
2025-01-08 b22df417e0bc423c788b013feaad686531d69eed
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);
    }
}