From fcbf54ac3b86f5545cf120b37e4cfe956919f338 Mon Sep 17 00:00:00 2001 From: Junjie <fallin.jie@qq.com> Date: 星期四, 17 七月 2025 09:50:37 +0800 Subject: [PATCH] # --- src/main/java/com/zy/asrs/task/ShuttlePowerEarlyWarning.java | 19 ++++++++++--------- 1 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/zy/asrs/task/ShuttlePowerEarlyWarning.java b/src/main/java/com/zy/asrs/task/ShuttlePowerEarlyWarning.java index 4e66ba6..3fb997c 100644 --- a/src/main/java/com/zy/asrs/task/ShuttlePowerEarlyWarning.java +++ b/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; @@ -33,8 +33,9 @@ /** * 灏忚溅鐢甸噺棰勮妫�娴� => 寮哄埗棰勮 + * 姣�30鍒嗛挓鎵弿涓�娆� */ - @Scheduled(cron = "1 * * * * ? ") + @Scheduled(cron = "0 30 * * * ? ") public synchronized void shuttlePowerEarlyWarning() { Config config = configService.selectOne(new EntityWrapper<Config>().eq("code","dingdingReportUrl")); if (config == null) { @@ -53,26 +54,26 @@ } StringBuffer buffer = new StringBuffer(); - buffer.append("銆愰�氱煡銆戜笁鍑洓鍚戝簱\n");//娑堟伅鏍囬 + buffer.append("銆愰�氱煡銆戝洓鍚戝簱\n");//娑堟伅鏍囬 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; } } -- Gitblit v1.9.1