From 9faa74e1912022dc6e54c3e93426946876b5d83a Mon Sep 17 00:00:00 2001 From: yangys <y_ys79@sina.com> Date: 星期五, 25 十月 2024 10:49:13 +0800 Subject: [PATCH] 修改redistemplate的hashkey serializer,更方便客户端查看redis的数据 --- collect/src/main/java/com/qianwen/mdc/collect/cache/WorkstationCache.java | 11 ++++++----- 1 files changed, 6 insertions(+), 5 deletions(-) diff --git a/collect/src/main/java/com/qianwen/mdc/collect/cache/WorkstationCache.java b/collect/src/main/java/com/qianwen/mdc/collect/cache/WorkstationCache.java index 1dfb57a..766f62b 100644 --- a/collect/src/main/java/com/qianwen/mdc/collect/cache/WorkstationCache.java +++ b/collect/src/main/java/com/qianwen/mdc/collect/cache/WorkstationCache.java @@ -28,6 +28,7 @@ @Component public class WorkstationCache { + public static final String COLLECT_WORKSTATION = "collect:workstation"; private static final String WORKSTATION_ID = "workstation:id:"; private static final String CALENDAR_DATE = ":calendar:date:"; private static final String WORKSTATION_ALL = "workstation:all"; @@ -46,7 +47,7 @@ public Map<Long, WorkstationDTO> getWorkstations() { - String redisKey = "posting:workstation".concat("::").concat(WORKSTATION_ALL); + String redisKey = COLLECT_WORKSTATION.concat("::").concat(WORKSTATION_ALL); /*Map<String, WorkstationDTO> map = bladeRedis.hGetAll(redisKey); @@ -67,7 +68,7 @@ private Map<Long, WorkstationDTO> setWorkstations() { List<Workstation> list = workstationService.list(); - String redisKey = "posting:workstation".concat("::").concat(WORKSTATION_ALL); + String redisKey = COLLECT_WORKSTATION.concat("::").concat(WORKSTATION_ALL); list.forEach(ws -> { /* @@ -109,7 +110,7 @@ * @return */ public String getWorkstationCalendarCodeForDate(Long workstationId, String date) { - String redisKey = "posting:workstation".concat("::").concat(WORKSTATION_ID).concat(workstationId.toString().concat(CALENDAR_DATE)).concat(date); + String redisKey = COLLECT_WORKSTATION.concat("::").concat(WORKSTATION_ID).concat(workstationId.toString().concat(CALENDAR_DATE)).concat(date); //String calendarCode = (String) bladeRedis.get(redisKey); String calendarCode = (String) redisUtil.get(redisKey); if (ObjectUtil.isEmpty(calendarCode)) { @@ -125,7 +126,7 @@ } public GlobalWcsOfRps getWorkstationWcsSetting(Long workstationId, String code) { - String redisKey = "posting:workstation".concat("::").concat(WORKSTATION_ID).concat(workstationId.toString() + String redisKey = COLLECT_WORKSTATION.concat("::").concat(WORKSTATION_ID).concat(workstationId.toString() .concat(WCS_SETTING)); //GlobalWcsOfRps wcsSetting = (GlobalWcsOfRps)redisUtil.hGet(redisKey, code); @@ -155,7 +156,7 @@ */ public Long getBelongToEmployeeForWorkstation(Long workstationId, Date timePoint) { Long employeeId = null; - String redisKey = "posting:workstation".concat("::").concat("workstation:id:") + String redisKey = COLLECT_WORKSTATION.concat("::").concat("workstation:id:") .concat(workstationId.toString().concat(EMPLOYEE)); // Set<EmployeeOnOffWork> employeeOnOffWorks = bladeRedis.sMembers(redisKey); -- Gitblit v1.9.3