fuliqi
2024-08-31 6221c8b5df5eb0ee62dce79048c9c3f0dc3d0fc1
ycl-server/src/main/java/com/ycl/task/PlatformTask.java
@@ -81,6 +81,7 @@
                    log.error("检查平台连通性时发生错误", e);
                }
            });
            executorService.shutdown();
        }
    }
@@ -99,20 +100,18 @@
            Object outLineTime = redisTemplate.opsForValue().get(REDIS_KEY_PREFIX + platform.getPlatformIP());
            Integer outlineTimeSed = Objects.isNull(outLineTime) ? 0 : (Integer) outLineTime;
            PlatformOnline one = new LambdaQueryChainWrapper<>(platformOnlineService.getBaseMapper())
                    .eq(PlatformOnline::getPlatformIp, platform.getPlatformIP())
                    .eq(PlatformOnline::getPlatformId, platform.getId())
                    .eq(PlatformOnline::getCreateDate, sqlDate)
                    .one();
            if (Objects.isNull(one)) {
                one = new PlatformOnline();
                one.setPlatformIp(platform.getPlatformIP());
                one.setPlatformName(platform.getPlatformName());
                one.setPlatformId(platform.getId());
                one.setCreateDate(sqlDate);
                one.setTodayOutlineSed(outlineTimeSed);
            } else {
                one.setTodayOutlineSed(one.getTodayOutlineSed() + outlineTimeSed);
            }
            one.setPlatformIp(platform.getPlatformIP());
            one.setPlatformName(platform.getPlatformName());
            one.setPlatformId(platform.getId());
            one.setCreateDate(sqlDate);
            platformOnlineService.saveOrUpdate(one);