From 1b1f60fd3a9becf401982388ef8f6f9f29d82fba Mon Sep 17 00:00:00 2001 From: haha Date: Sat, 25 May 2024 21:58:32 +0800 Subject: [PATCH] update code --- .../controller/ProblemmodifyController.java | 20 ++++--------------- .../ProjectAttendanceController.java | 2 +- 2 files changed, 5 insertions(+), 17 deletions(-) diff --git a/yanzhu-bigscreen/src/main/java/com/yanzhu/jh/bigscreen/web/controller/ProblemmodifyController.java b/yanzhu-bigscreen/src/main/java/com/yanzhu/jh/bigscreen/web/controller/ProblemmodifyController.java index 1caa854e..be5fbf3f 100644 --- a/yanzhu-bigscreen/src/main/java/com/yanzhu/jh/bigscreen/web/controller/ProblemmodifyController.java +++ b/yanzhu-bigscreen/src/main/java/com/yanzhu/jh/bigscreen/web/controller/ProblemmodifyController.java @@ -4,6 +4,7 @@ import cn.hutool.core.date.DateUtil; import com.ruoyi.common.constant.Constants; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.core.redis.RedisCache; import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.SecurityUtils; @@ -191,19 +192,12 @@ public class ProblemmodifyController extends BaseController { where.setPrjIds(getProjectIds()); } } - String key="problemmodify_groupByInfotypeCheckState-"+where.getDeptId()+"-"+where.getProjectId()+"-"+where.getProType()+Md5Utils.hash(where.getPrjIds()); - Object obj=redisCache.getCacheObject(key); - if(obj!=null){ - return success(obj); - } - List list=smzSspProblemmodifyService.groupByInfotypeCheckState(where); SmzSspProblemmodify spObj=new SmzSspProblemmodify(); spObj.setId(smzSspProblemmodifyService.countTimeout(where)); spObj.setCheckState(5l); spObj.setInfoType(where.getInfoType()); list.add(spObj); - redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES); return AjaxResult.success(list); } @@ -242,21 +236,15 @@ public class ProblemmodifyController extends BaseController { } @PostMapping("/listSspProblemmodify") - public AjaxResult listSspProblemmodify(@RequestBody SmzSspProblemmodifyWhere where){ + public TableDataInfo listSspProblemmodify(@RequestBody SmzSspProblemmodifyWhere where){ Long deptId=where.getDeptId(); if(deptId==null||deptId<=0){ if (SecurityUtils.isUserB()) { where.setPrjIds(getProjectIds()); } } - String params = Md5Utils.hash(deptId+"_"+where.getProjectId()+"_"+where.getInfoType()+"_"+where.getRoleType()+"_"+where.getActiveName()+"_"+where.getCheckState()+"_"+where.getStartDate()+"_"+where.getEndDate()+where.getProType()+Md5Utils.hash(where.getPrjIds())); - String key="problemmodify_getMonitAndWarning-"+params; - Object obj=redisCache.getCacheObject(key); - if(obj!=null){ - return AjaxResult.success(obj); - } + startPage(); List list = smzSspProblemmodifyService.selectSmzSspProblemmodifyListAndUnitName(where); - redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES); - return AjaxResult.success(list); + return getDataTable(list); } } diff --git a/yanzhu-bigscreen/src/main/java/com/yanzhu/jh/bigscreen/web/controller/ProjectAttendanceController.java b/yanzhu-bigscreen/src/main/java/com/yanzhu/jh/bigscreen/web/controller/ProjectAttendanceController.java index 37addbbc..855a2bf5 100644 --- a/yanzhu-bigscreen/src/main/java/com/yanzhu/jh/bigscreen/web/controller/ProjectAttendanceController.java +++ b/yanzhu-bigscreen/src/main/java/com/yanzhu/jh/bigscreen/web/controller/ProjectAttendanceController.java @@ -269,8 +269,8 @@ public class ProjectAttendanceController extends BaseController { Integer pageNum = pageDomain.getPageNum(); Integer pageSize = pageDomain.getPageSize(); - startPage(); where.setAttendanceTime(DateUtil.formatDate(DateTime.now())); + startPage(); List list = attendanceDataService.todayAttendance(where); return getDataTable(list); }