|
|
|
@ -8,6 +8,7 @@ import com.shxy.xymanager_common.bean.ServiceBody;
|
|
|
|
|
import com.shxy.xymanager_common.dto.DyLineAndTerminalDto;
|
|
|
|
|
import com.shxy.xymanager_common.entity.DyLevel;
|
|
|
|
|
import com.shxy.xymanager_common.entity.Lines;
|
|
|
|
|
import com.shxy.xymanager_common.entity.Terminals;
|
|
|
|
|
import com.shxy.xymanager_common.enums.CommonStatus;
|
|
|
|
|
import com.shxy.xymanager_common.exception.Asserts;
|
|
|
|
|
import com.shxy.xymanager_common.model.DyLineTreeListModel;
|
|
|
|
@ -52,14 +53,19 @@ 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());
|
|
|
|
|
Terminals terminals = list.get(i).getList().get(j).getList().get(k);
|
|
|
|
|
if (!BeanUtil.isEmpty(terminals)) {
|
|
|
|
|
Long lastheartbeat = terminals.getLastheartbeat();
|
|
|
|
|
if (!BeanUtil.isEmpty(lastheartbeat)) {
|
|
|
|
|
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());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|