Explorar el Código

add search total count

kerry hace 5 años
padre
commit
4e48d793b1

+ 2 - 2
elastic-publish-service/req/main-controller.http Ver fichero

@@ -3,7 +3,7 @@ Content-Type: application/json
3 3
 
4 4
 {
5 5
   "agencyPath": "/1",
6
-  "keyword": "",
6
+  "keyword": "SV190102725618",
7 7
   "page": 1,
8 8
   "size": 10,
9 9
   "regulatoryLevelId": "",
@@ -21,7 +21,7 @@ Content-Type: application/json
21 21
 
22 22
 {
23 23
   "agencyPath": "/1",
24
-  "keyword": "教学楼四教",
24
+  "keyword": "RSV1901027256184",
25 25
   "page": 1,
26 26
   "size": 10,
27 27
   "regulatoryLevelId": "",

+ 6 - 6
elastic-publish-service/src/main/java/com/vcarecity/publish/service/impl/CheckTimeServiceImpl.java Ver fichero

@@ -32,14 +32,14 @@ public class CheckTimeServiceImpl implements CheckTimeService {
32 32
         String redisKey = REDIS_KEY_PREFIX + key;
33 33
 
34 34
         Object value = redisTemplate.opsForValue().get(redisKey);
35
-
36
-        if (value != null) {
37
-            LocalDateTime.ofInstant(new Date(Long.parseLong(value.toString())).toInstant(), ZoneId.systemDefault()).format(DateUtil.DATE_TIME_FORMATTER);
35
+        long last;
36
+        //noinspection ConstantConditions
37
+        if (value == null) {
38
+            last = System.currentTimeMillis() - ElasticConstant.CHECK_TIME_INTERVAL;
39
+        } else {
40
+            last = Long.parseLong(value.toString());
38 41
         }
39
-
40
-        long last = System.currentTimeMillis() - ElasticConstant.CHECK_TIME_INTERVAL;
41 42
         redisTemplate.opsForValue().set(redisKey, last);
42
-
43 43
         return LocalDateTime.ofInstant(new Date(last).toInstant(), ZoneId.systemDefault()).format(DateUtil.DATE_TIME_FORMATTER);
44 44
     }
45 45
 

+ 2 - 1
elastic-publish-service/src/main/java/com/vcarecity/publish/sql/service/impl/UnitServiceImpl.java Ver fichero

@@ -39,8 +39,9 @@ public class UnitServiceImpl implements UnitService {
39 39
     private final ObjectMapper objectMapper;
40 40
 
41 41
     static final String[] SEARCH_KEY_NAMES = new String[]{
42
+            "dtuNo.keyword",
42 43
             "agencyName.keyword",
43
-            "agencyDetail.keyword",
44
+            //"agencyDetail.keyword",
44 45
             "unitType.keyword",
45 46
             "nameOfBuilding.keyword",
46 47
     };

+ 1 - 1
elastic-publish-service/src/main/java/com/vcarecity/publish/task/CheckUpdateTask.java Ver fichero

@@ -41,7 +41,7 @@ public class CheckUpdateTask {
41 41
     }
42 42
 
43 43
 
44
-    @Scheduled(initialDelay = 1000L, fixedDelay = ElasticConstant.CHECK_TIME_INTERVAL)
44
+    @Scheduled(initialDelay = 3 * 1000L, fixedDelay = ElasticConstant.CHECK_TIME_INTERVAL)
45 45
     public void checkUpdateTask() {
46 46
 
47 47
         // 当前更新时间