浏览代码

feature: 核酸列表过滤时间恢复缓存

wuyongyi 2 年之前
父节点
当前提交
5fb07c8df1

+ 4 - 4
onemini-hospital-empty/src/main/java/com/ywt/alipaympapi/core/utils/ContextHelper.java

@@ -11,13 +11,13 @@ public final class ContextHelper {
 
     // 提供一些包装方法,方便本地调试使用
     public static int getCurrentTerminalWrapped() {
-        return TerminalEnum.NFYYBYFY_ALIPAY_MP.getValue();
-//        return WebAppContext.current().getTerminal();
+//        return TerminalEnum.NFYYBYFY_ALIPAY_MP.getValue();
+        return WebAppContext.current().getTerminal();
     }
 
     public static int getCurrentUserIdWrapped() {
-        return 173140;
-//        return WebAppContext.current().getUserId();
+//        return 173140;
+        return WebAppContext.current().getUserId();
     }
 
     public static String getAlipayUidWrapped() {

+ 15 - 15
onemini-hospital-empty/src/main/java/com/ywt/alipaympapi/service/impl/NucleicServiceImpl.java

@@ -166,19 +166,19 @@ public class NucleicServiceImpl implements NucleicService {
     private List<NucleicItemResponseData> getScheduleListCommon(int hospitalId, String deptCode, String doctorCode,
                                                                 String serviceCode, int startOffset, int endOffset) throws AppMessageException {
         //支付宝核酸
-//        String redisKeyPattern = "ALI_HS_SCHEDULE_LIST_%s_%s_%d_%s";
-//        String key = String.format(redisKeyPattern, deptCode, doctorCode, hospitalId, serviceCode);
-//        if (startOffset >= 0 && endOffset >= 0) {
-//            redisKeyPattern = "ALI_HS_SCHEDULE_LIST_%s_%s_%d_%s_%d_%d";
-//            key = String.format(redisKeyPattern, deptCode, doctorCode, hospitalId, serviceCode, startOffset, endOffset);
-//        }
-//        String value = jedisCommands.get(key);
-//        if (!StringHelper.isNullOrWhiteSpace(value)) {
-//            List<NucleicItemResponseData> lss  = JsonSerializer.from(value, List.class);
-//            if (lss != null) {
-//                return lss;
-//            }
-//        }
+        String redisKeyPattern = "ALI_HS_SCHEDULE_LIST_%s_%s_%d_%s";
+        String key = String.format(redisKeyPattern, deptCode, doctorCode, hospitalId, serviceCode);
+        if (startOffset >= 0 && endOffset >= 0) {
+            redisKeyPattern = "ALI_HS_SCHEDULE_LIST_%s_%s_%d_%s_%d_%d";
+            key = String.format(redisKeyPattern, deptCode, doctorCode, hospitalId, serviceCode, startOffset, endOffset);
+        }
+        String value = jedisCommands.get(key);
+        if (!StringHelper.isNullOrWhiteSpace(value)) {
+            List<NucleicItemResponseData> lss  = JsonSerializer.from(value, List.class);
+            if (lss != null) {
+                return lss;
+            }
+        }
 
         List<Dept> deptList = systemSrv.getDeptListByHospitalId(hospitalId);
         if (deptList == null || deptList.size() == 0) {
@@ -211,8 +211,8 @@ public class NucleicServiceImpl implements NucleicService {
         }
         List<NucleicItemResponseData> lst = getConvertedScheduleList(hospitalId, startOffset, endOffset, deptCode,
                 doctorCode, serviceCode);
-//        jedisCommands.set(key, JsonSerializer.toJson(lst));
-//        jedisCommands.expire(key, 3 * 60);
+        jedisCommands.set(key, JsonSerializer.toJson(lst));
+        jedisCommands.expire(key, 3 * 60);
         return lst;
     }