xuhy
2024-12-13 a50c7d1497d7f707b79597553d9db978ba7e9dd5
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TIndexMenuController.java
@@ -214,13 +214,20 @@
    public R allert() {
        Long userId = tokenService.getLoginUser().getUserId();
        TAppUser byId = appUserService.getById(userId);
        Object cacheObject = redisCache.getCacheObject("ALLERT:"+userId);
        Long cacheObject = redisCache.getCacheObject("ALLERT:"+userId);
        if (cacheObject!=null && byId.getIsSetPreference() == 1){
            return R.ok(cacheObject);
            return R.ok(cacheObject == 1);
        }else {
            return R.ok(false);
        }
    }
    @ApiOperation(value = "取消顶部提示",tags = {"web-取消顶部提示"})
    @PostMapping(value = "/cancelAllert")
    public R cancelAllert() {
        Long userId = tokenService.getLoginUser().getUserId();
        redisCache.deleteObject("ALLERT:"+userId);
        return R.ok();
    }
@@ -276,9 +283,7 @@
    @ApiOperation(value = "订单统计1",tags = {"后台-统计"})
    @PostMapping(value = "/order/count1")
    public R<List<Map<String,String>>> ordercount1(@RequestBody OrderCountQuery orderCountQuery) {
        List<Map<String,String>> map = new ArrayList<>();
            map = indexMenuService.count1(orderCountQuery.getStartDate(),orderCountQuery.getEndDate(),orderCountQuery.getPaymentStatus(),orderCountQuery.getDayType());
        List<Map<String,String>> map = indexMenuService.count1(orderCountQuery.getStartDate(),orderCountQuery.getEndDate(),orderCountQuery.getPaymentStatus(),orderCountQuery.getDayType());
        return R.ok(map);
    }
@@ -308,6 +313,10 @@
            notices = new ArrayList<>(notices.subList(0, 16));
        }
        notices = notices.stream().distinct().collect(Collectors.toList());
        Set<Long> cacheSet = redisCache.getCacheSet("INFORMATION:" + userId);
        for (TInformation notice : notices) {
            notice.setIsCollect(cacheSet.contains(notice.getId())?1:0);
        }
        return R.ok(notices);
    }