自动化立体仓库 - WCS系统
#
Junjie
2025-01-08 1ff4b70e59b8c9ceb80d0a695d26b4419ed349f1
src/main/java/com/zy/asrs/task/ShuttlePowerEarlyWarning.java
@@ -7,9 +7,9 @@
import com.zy.core.cache.SlaveConnection;
import com.zy.core.enums.SlaveType;
import com.zy.core.model.ShuttleSlave;
import com.zy.core.model.protocol.NyShuttleProtocol;
import com.zy.core.model.protocol.ShuttleProtocol;
import com.zy.core.properties.SlaveProperties;
import com.zy.core.thread.NyShuttleThread;
import com.zy.core.thread.ShuttleThread;
import com.zy.system.entity.Config;
import com.zy.system.service.ConfigService;
import lombok.extern.slf4j.Slf4j;
@@ -35,7 +35,7 @@
     * 小车电量预警检测 => 强制预警
     * 每30分钟扫描一次
     */
    @Scheduled(cron = "*/30 * * * * ? ")
    @Scheduled(cron = "0 30 * * * ? ")
    public synchronized void shuttlePowerEarlyWarning() {
        Config config = configService.selectOne(new EntityWrapper<Config>().eq("code","dingdingReportUrl"));
        if (config == null) {
@@ -58,22 +58,22 @@
        boolean hasReport = false;//是否有需要报告的数据
        for (ShuttleSlave slave : slaveProperties.getShuttle()) {
            NyShuttleThread shuttleThread = (NyShuttleThread) SlaveConnection.get(SlaveType.Shuttle, slave.getId());
            ShuttleThread shuttleThread = (ShuttleThread) SlaveConnection.get(SlaveType.Shuttle, slave.getId());
            if (shuttleThread == null) {
                continue;
            }
            NyShuttleProtocol shuttleProtocol = shuttleThread.getShuttleProtocol();
            ShuttleProtocol shuttleProtocol = shuttleThread.getStatus();
            if (shuttleProtocol == null) {
                continue;
            }
            if (shuttleProtocol.getChargState() == 1) {
            if (shuttleThread.isCharging()) {
                continue;//充电中,无需通知
            }
            if (shuttleProtocol.getPowerPercent() < shuttlePowerEarlyValue) {
                buffer.append(shuttleProtocol.getShuttleNo()).append("号小车,电量").append(shuttleProtocol.getPowerPercent$()).append(",请注意。\n");
            if (Integer.parseInt(shuttleProtocol.getBatteryPower()) < shuttlePowerEarlyValue) {
                buffer.append(shuttleProtocol.getShuttleNo()).append("号小车,电量").append(shuttleProtocol.getBatteryPower()).append(",请注意。\n");
                hasReport = true;
            }
        }