From a50c7d1497d7f707b79597553d9db978ba7e9dd5 Mon Sep 17 00:00:00 2001 From: xuhy <3313886187@qq.com> Date: 星期五, 13 十二月 2024 08:59:12 +0800 Subject: [PATCH] 修改 --- ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TIndexMenuController.java | 25 ++++++++++++++++++------- 1 files changed, 18 insertions(+), 7 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TIndexMenuController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TIndexMenuController.java index e957ffe..71782a5 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TIndexMenuController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TIndexMenuController.java @@ -19,6 +19,7 @@ import oshi.driver.mac.net.NetStat; import javax.annotation.Resource; +import java.math.BigDecimal; import java.time.LocalDate; import java.util.*; import java.util.stream.Collectors; @@ -213,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(); } @@ -232,7 +240,7 @@ Long payCount = courseCount -courseFreeCount; Long recordsCount = generatedRecordsService.lambdaQuery().count(); Long infoCount = informationService.lambdaQuery().count(); - Long infoFreeCount = informationService.lambdaQuery().count(); + Long infoFreeCount = informationService.lambdaQuery().eq(TInformation::getInformationPrice,new BigDecimal(0)).count(); Long infoPayCount = infoCount-infoFreeCount; ManageCountDto manageCountDto = new ManageCountDto(); manageCountDto.setUserCount(userCount); @@ -242,6 +250,7 @@ manageCountDto.setRecordsCount(recordsCount); manageCountDto.setInfoFreeCount(infoFreeCount); manageCountDto.setInfoPayCount(infoPayCount); + manageCountDto.setInfoCount(infoCount); return R.ok(manageCountDto); } @@ -274,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); } @@ -306,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); } -- Gitblit v1.7.1