|
|
|
@ -2,6 +2,8 @@ package com.shxy.xymanager_service.impl;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
|
|
|
import cn.hutool.core.date.DateTime;
|
|
|
|
|
import cn.hutool.core.date.DateUnit;
|
|
|
|
|
import com.shxy.xymanager_common.bean.ServiceBody;
|
|
|
|
|
import com.shxy.xymanager_common.dto.DyLineAndTerminalDto;
|
|
|
|
|
import com.shxy.xymanager_common.entity.DyLevel;
|
|
|
|
@ -10,6 +12,7 @@ import com.shxy.xymanager_common.enums.CommonStatus;
|
|
|
|
|
import com.shxy.xymanager_common.exception.Asserts;
|
|
|
|
|
import com.shxy.xymanager_common.model.DyLineTreeListModel;
|
|
|
|
|
import com.shxy.xymanager_common.model.DyListModel;
|
|
|
|
|
import com.shxy.xymanager_common.util.MyDateUtils;
|
|
|
|
|
import com.shxy.xymanager_common.vo.TerminalIdVo;
|
|
|
|
|
import com.shxy.xymanager_dao.dao.DyLevelDao;
|
|
|
|
|
import com.shxy.xymanager_service.service.DyLevelService;
|
|
|
|
@ -17,6 +20,7 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
|
|
import java.math.BigInteger;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
@ -48,6 +52,15 @@ public class DyLevelServiceImpl implements DyLevelService {
|
|
|
|
|
for (int j = 0; j < beans.get(i).getList().size(); j++) {
|
|
|
|
|
for (int k = 0; k < beans.get(i).getList().get(j).getList().size(); k++) {
|
|
|
|
|
beans.get(i).getList().get(j).getList().get(k).setName(list.get(i).getList().get(j).getList().get(k).getDisplayName());
|
|
|
|
|
Long lastheartbeat = list.get(i).getList().get(j).getList().get(k).getLastheartbeat();
|
|
|
|
|
BigInteger time = MyDateUtils.TimeSecond2MillSecond(lastheartbeat);
|
|
|
|
|
DateTime date = MyDateUtils.date(time.longValue());
|
|
|
|
|
long between = MyDateUtils.between(MyDateUtils.getNowDate(), date, DateUnit.MINUTE);
|
|
|
|
|
if (between > 30) {
|
|
|
|
|
beans.get(i).getList().get(j).getList().get(k).setOnlinestatus(CommonStatus.DELETE.value());
|
|
|
|
|
} else {
|
|
|
|
|
beans.get(i).getList().get(j).getList().get(k).setOnlinestatus(CommonStatus.EFFECTIVE.value());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|