管道基础大数据平台系统开发-【后端】-Server
1
13693261870
2022-10-25 4ddfd502023662f6d25c4be416d88751e206d91a
src/main/java/com/lf/server/service/all/ScheduleService.java
@@ -53,9 +53,6 @@
    /**
     * 查询服务器状态
     *
     * @return
     * @throws InterruptedException
     */
    public JSONObject selectServerStatus() throws InterruptedException {
        JSONObject json = new JSONObject();
@@ -67,9 +64,6 @@
    /**
     * 查询Cpu信息
     *
     * @return
     * @throws InterruptedException
     */
    public JSONObject selectCpuInfo() throws InterruptedException {
        SystemInfo systemInfo = new SystemInfo();
@@ -101,8 +95,6 @@
    /**
     * 查询内存信息
     *
     * @return
     */
    public JSONObject selectMemInfo() {
        JSONObject map = new JSONObject();
@@ -124,8 +116,6 @@
    /**
     * 查询在线用户
     *
     * @return
     */
    public List<JSONObject> selectOnlineUsers() {
        List<JSONObject> list = new ArrayList<JSONObject>();
@@ -133,7 +123,7 @@
        Set<String> keys = redisTemplate.keys(RedisCacheKey.signUserKey("*"));
        for (String key : keys) {
            Object obj = redisTemplate.opsForValue().get(key);
            if (obj != null && obj instanceof UserEntity) {
            if (obj instanceof UserEntity) {
                UserEntity ue = (UserEntity) obj;
                JSONObject map = new JSONObject();
@@ -150,8 +140,6 @@
    /**
     * 查询服务资源状态
     *
     * @return
     */
    public List<ResEntity> selectResStatus() {
        List<ResEntity> resList = resService.selectResAll();
@@ -191,8 +179,6 @@
    /**
     * 统计服务资源状态
     *
     * @return
     */
    public JSONObject countResStatus() {
        List<ResEntity> resList = resService.selectResAll();
@@ -210,10 +196,7 @@
    /**
     * 资源操作状态
     *
     * @return
     */
    public JSONObject operateCount() {
        List<OperateEntity> list = operateService.operateCount();
        JSONObject jsonObject = new JSONObject();
@@ -234,26 +217,23 @@
    /**
     * 用户登录状态
     *
     * @return
     */
    public JSONObject userLoginCount() {
        List<LoginEntity> list = loginService.selectLoginCounts();
        JSONObject jsonObject = new JSONObject();
        if (list.isEmpty()) {
        if (list == null || list.isEmpty()) {
            return null;
        } else {
            List<JSONObject> lister = new ArrayList<JSONObject>();
            for (LoginEntity key : list) {
                JSONObject map = new JSONObject();
                map.put("count", key.getCount());
                map.put("optime", key.getOptime());
                lister.add(map);
            }
            jsonObject.put("userLoginCount", lister);
            return jsonObject;
        }
    }
        JSONObject jsonObject = new JSONObject();
        List<JSONObject> lister = new ArrayList<JSONObject>();
        for (LoginEntity key : list) {
            JSONObject map = new JSONObject();
            map.put("count", key.getCount());
            map.put("optime", key.getOptime());
            lister.add(map);
        }
        jsonObject.put("userLoginCount", lister);
        return jsonObject;
    }
}