From eb428cb6839049970e67264f4eafc612e5bcaa38 Mon Sep 17 00:00:00 2001 From: Pu Zhibing <393733352@qq.com> Date: 星期二, 18 三月 2025 15:14:20 +0800 Subject: [PATCH] 修改统计bug --- ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopController.java | 76 +++++++++++++++++++++++++++++-------- 1 files changed, 59 insertions(+), 17 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 de23686..ac90511 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 @@ -408,6 +408,10 @@ return R.ok(); } + public static void main(String[] args) { + System.out.println("17780483325".substring(5)); + } + @PutMapping("/freezingOrThawing") @ApiOperation(value = "门店管理-冻结/解冻门店", tags = {"管理后台-门店管理"}) @@ -678,8 +682,17 @@ @PostMapping("/getShopIdByName") public R<Set<Integer>> getShopIdByName(@RequestParam("shopName") String shopName){ List<Shop> list = shopService.list(new LambdaQueryWrapper<Shop>() - .like(Shop::getName, shopName)); + .like(Shop::getName, shopName) + .eq(Shop::getDelFlag, 0)); return R.ok(list.stream().map(Shop::getId).collect(Collectors.toSet())); + } + + @PostMapping("/getManagerByManagerName") + public R<Set<Long>> getManagerByManagerName(@RequestParam("managerName") String managerName){ + List<Shop> list = shopService.list(new LambdaQueryWrapper<Shop>() + .like(Shop::getShopManager, managerName) + .eq(Shop::getDelFlag, 0)); + return R.ok(list.stream().map(Shop::getAppUserId).collect(Collectors.toSet())); } /** @@ -689,9 +702,7 @@ @ApiOperation(value = "门店统计", tags = {"管理后台-首页统计"}) public R<ShopStatistics> shopStatistics(@ApiParam("门店id") Integer shopId) { ShopStatistics shopStatistics = shopMapper.getShopStatistics(shopId); - List<Integer> shopIds; - - shopIds = shopService.list(new LambdaQueryWrapper<Shop>() + List<Integer> shopIds = shopService.list(new LambdaQueryWrapper<Shop>() .eq(Shop::getDelFlag, 0) .eq(shopId !=null,Shop::getId, shopId)) .stream() @@ -808,6 +819,21 @@ return R.ok(); } + @PostMapping("/saveWithdrawalAppletAccount") + @ApiOperation(value = "保存提现账户", tags = {"小程序-个人中心-门店管理-门店钱包"}) + public R saveWithdrawalAppletAccount(@RequestBody SaveWithdrawalAccount saveWithdrawalAccount){ + + Shop shop = shopService.getById(saveWithdrawalAccount.getShopId()); + if(null != shop){ + shop.setReceiverAccountNoEnc(saveWithdrawalAccount.getReceiverAccountNoEnc()); + shop.setReceiverNameEnc(saveWithdrawalAccount.getReceiverNameEnc()); + shop.setReceiverAccountType(saveWithdrawalAccount.getReceiverAccountType()); + shop.setReceiverBankChannelNo(saveWithdrawalAccount.getReceiverBankChannelNo()); + shopService.updateById(shop); + } + return R.ok(); + } + /** * 获取所有门店 @@ -833,6 +859,21 @@ } + @ResponseBody + @GetMapping("/verifyAppletConfiguration") + @ApiOperation(value = "判断是否有提现账户", tags = {"门店后台-财务管理-提现明细","小程序-个人中心-门店管理-门店钱包"}) + public R verifyAppletConfiguration(Integer shopId){ + Shop shop = shopService.getById(shopId); + if(StringUtils.hasLength(shop.getReceiverAccountNoEnc())){ + return R.ok(true); + } + return R.ok(false); + } + + + + + @ResponseBody @GetMapping("/getBankSerialNumber") @@ -855,7 +896,7 @@ BigDecimal giveawayMoney = BigDecimal.ZERO; for (Shop shop : shopList) { serverGiveawayMoney = serverGiveawayMoney.add(shop.getServerGiveawayMoney()); - giveawayMoney = giveawayMoney.add(shop.getGiveawayMoney()); + giveawayMoney = giveawayMoney.add(shop.getGiveawayMoney().add(shop.getLowerLevelGiveawayMoney())); } Map<String, BigDecimal> map = new HashMap<>(); map.put("serverGiveawayMoney", serverGiveawayMoney); @@ -865,14 +906,13 @@ /** * 获取指定用户的服务商 - * @param userId * @return */ @GetMapping("/getServiceProvider") - public R<Shop> getServiceProvider(Long userId){ + public R<Shop> getServiceProvider(@RequestParam("appUserId") Long appUserId){ //向上找获取第一个开店的门店 List<Shop> list = shopService.list(new LambdaQueryWrapper<Shop>().eq(Shop::getDelFlag, 0).eq(Shop::getStatus, 1)); - AppUser appUser = appUserClient.getAppUserById(userId); + AppUser appUser = appUserClient.getAppUserById(appUserId); //上级集合,防止循环关联 Set<Long> pid = new HashSet<>(); Shop shop = getSuperiorStore(appUser, list, 1, 1, pid); @@ -900,23 +940,25 @@ } return getSuperiorStore(appUser1, list, hierarchy, num, pid); } - - - - - - - + + + + + + + + + /** * 获取指定用户的高级服务商 * @return */ @GetMapping("/getSuperiorServiceProvider") - public R<Shop> getSuperiorServiceProvider(Long userId){ + public R<Shop> getSuperiorServiceProvider(@RequestParam("appUserId") Long appUserId){ //向上找获取第一个开店的门店 List<Shop> list = shopService.list(new LambdaQueryWrapper<Shop>().eq(Shop::getDelFlag, 0).eq(Shop::getStatus, 1)); - AppUser appUser = appUserClient.getAppUserById(userId); + AppUser appUser = appUserClient.getAppUserById(appUserId); //上级集合,防止循环关联 Set<Long> pid = new HashSet<>(); Shop shop = getSuperiorStore(appUser, list, 2, 1, pid); -- Gitblit v1.7.1