From d3e9a09cb54017a8063e5bfe3ace5012f66f3130 Mon Sep 17 00:00:00 2001 From: Pu Zhibing <393733352@qq.com> Date: 星期二, 25 三月 2025 18:34:34 +0800 Subject: [PATCH] 修改统计bug --- ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopBalanceStatementController.java | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopBalanceStatementController.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopBalanceStatementController.java index 4919d97..e14d195 100644 --- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopBalanceStatementController.java +++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopBalanceStatementController.java @@ -31,6 +31,7 @@ import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import org.apache.commons.lang3.tuple.Pair; +import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; @@ -258,6 +259,13 @@ .between(ShopBalanceStatement::getCreateTime, date.with(LocalTime.MIN), date.with(LocalTime.MAX)); if (null != shopId && 0 != shopId) { queryWrapper.eq(ShopBalanceStatement::getShopId, shopId); + }else{ + List<Integer> shipIds = shopService.list(new LambdaQueryWrapper<Shop>().eq(Shop::getDelFlag, 0)).stream().map(Shop::getId).collect(Collectors.toList()); + if(shipIds.size() > 0){ + queryWrapper.in(ShopBalanceStatement::getShopId, shipIds); + }else{ + queryWrapper.eq(ShopBalanceStatement::getShopId, -1); + } } List<ShopBalanceStatement> list = shopBalanceStatementService.list(queryWrapper); return R.ok(list); @@ -272,6 +280,7 @@ */ @GetMapping("getShopCommission") @ApiOperation(value = "获取门店佣金", notes = "获取门店佣金", tags = {"小程序-个人中心-门店管理-门店钱包"}) + @Transactional public R<ShopCommission> getShopCommission(@RequestParam("shopId") Integer shopId) { // 合并查询逻辑 List<ShopBalanceStatementCopy> copies = shopBalanceStatementCopyMapper.selectList( -- Gitblit v1.7.1