| | |
| | | } |
| | | Shop shop = shopService.getById(id); |
| | | shop.setDelFlag(1); |
| | | |
| | | shopService.updateById(shop); |
| | | // 查询有没有门店绑定这个被删除的门店 |
| | | List<Shop> shops = shopService.lambdaQuery().eq(Shop::getPid, shop.getId()).list(); |
| | | for (Shop shop1 : shops) { |
| | | shop1.setPid(0); |
| | | } |
| | | shopService.updateBatchById(shops); |
| | | appUserClient.clearBindShop(shop.getId()); |
| | | UserShop userShop = new UserShop(); |
| | | userShop.setShopId(shop.getId()); |
| | |
| | | return R.ok(list); |
| | | } |
| | | |
| | | |
| | | @GetMapping("/getShopStatistics") |
| | | public R<Map<String, BigDecimal> > getShopStatistics(){ |
| | | List<Shop> shopList = shopService.list(); |
| | | BigDecimal serverGiveawayMoney = BigDecimal.ZERO; |
| | | BigDecimal lowerLevelGiveawayMoney = BigDecimal.ZERO; |
| | | for (Shop shop : shopList) { |
| | | serverGiveawayMoney = serverGiveawayMoney.add(shop.getServerGiveawayMoney()); |
| | | lowerLevelGiveawayMoney = lowerLevelGiveawayMoney.add(shop.getLowerLevelGiveawayMoney()); |
| | | } |
| | | Map<String, BigDecimal> map = new HashMap<>(); |
| | | map.put("serverGiveawayMoney", serverGiveawayMoney); |
| | | map.put("lowerLevelGiveawayMoney", lowerLevelGiveawayMoney); |
| | | return R.ok(map); |
| | | } |
| | | |
| | | } |
| | | |