From ee5046d151a858339aa137790bc830efe7f55980 Mon Sep 17 00:00:00 2001 From: zhang <zc857179121@qq.com> Date: 星期三, 18 六月 2025 15:13:14 +0800 Subject: [PATCH] 1 --- zy-acs-manager/src/main/java/com/zy/acs/manager/core/scheduler/MaintainScheduler.java | 28 ++++++++++++++++++---------- 1 files changed, 18 insertions(+), 10 deletions(-) diff --git a/zy-acs-manager/src/main/java/com/zy/acs/manager/core/scheduler/MaintainScheduler.java b/zy-acs-manager/src/main/java/com/zy/acs/manager/core/scheduler/MaintainScheduler.java index a76a507..aa6670f 100644 --- a/zy-acs-manager/src/main/java/com/zy/acs/manager/core/scheduler/MaintainScheduler.java +++ b/zy-acs-manager/src/main/java/com/zy/acs/manager/core/scheduler/MaintainScheduler.java @@ -1,8 +1,10 @@ package com.zy.acs.manager.core.scheduler; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.google.common.collect.Lists; import com.zy.acs.common.enums.AgvStatusType; import com.zy.acs.common.utils.RedisSupport; +import com.zy.acs.framework.common.Cools; import com.zy.acs.framework.common.DateUtils; import com.zy.acs.manager.core.service.MainLockWrapService; import com.zy.acs.manager.core.service.MainService; @@ -15,9 +17,7 @@ import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; -import java.util.Date; -import java.util.List; -import java.util.Optional; +import java.util.*; /** * judge whether agv go to funcSta which be charging or standby @@ -53,7 +53,7 @@ List<Agv> agvList = agvService.list(new LambdaQueryWrapper<Agv>().eq(Agv::getStatus, StatusType.ENABLE.val)); for (Agv agv : agvList) { AgvDetail agvDetail = agvDetailService.selectByAgvId(agv.getId()); - AgvModel agvModel = agvModelService.getById(agv.getAgvModel()); + AgvModel agvModel = agvModelService.getByAgvId(agv.getId()); if (null == agvDetail || null == agvDetail.getVol() || null == agvDetail.getAgvStatus()) { continue; } @@ -81,7 +81,7 @@ continue; } - mainLockWrapService.buildMinorTask(agv, agvDetail, TaskTypeType.TO_CHARGE, null); + mainLockWrapService.buildMinorTask(agv.getId(), TaskTypeType.TO_CHARGE, null, null,false); } } } @@ -94,15 +94,23 @@ List<Agv> agvList = agvService.list(new LambdaQueryWrapper<Agv>().eq(Agv::getStatus, StatusType.ENABLE.val)); for (Agv agv : agvList) { + String noAutoStandBy = configService.getVal("noAutoStandBy", String.class); + if (!Cools.isEmpty(noAutoStandBy)){ + String[] split = noAutoStandBy.split(","); + if (Arrays.stream(split).anyMatch(s ->s.equals(agv.getUuid()))){ + continue; + } + } + AgvDetail agvDetail = agvDetailService.selectByAgvId(agv.getId()); - AgvModel agvModel = agvModelService.getById(agv.getAgvModel()); + AgvModel agvModel = agvModelService.getByAgvId(agv.getId()); if (null == agvDetail || null == agvDetail.getVol() || null == agvDetail.getAgvStatus() || null == agvDetail.getRecentCode()) { continue; } // low battery status, that need to go to charge - if (agvDetailService.isPowerLoss(agv, agvDetail, agvModel)) { - continue; - } +// if (agvDetailService.isPowerLoss(agv, agvDetail, agvModel)) { +// continue; +// } // is charging ? if (agvDetail.getAgvStatus().equals(AgvStatusType.CHARGE)) { if (agvDetail.getVol() < agvModel.getQuaBattery()) { @@ -144,7 +152,7 @@ } // } - mainLockWrapService.buildMinorTask(agv, agvDetail, TaskTypeType.TO_STANDBY, null); + mainLockWrapService.buildMinorTask(agv.getId(), TaskTypeType.TO_STANDBY, null, null,false); } } -- Gitblit v1.9.1