Junjie
2023-04-10 d91105438a87e013c6de439af89e49f055827b65
src/main/java/com/zy/core/model/protocol/ShuttleProtocol.java
@@ -1,7 +1,9 @@
package com.zy.core.model.protocol;
import com.core.common.SpringUtils;
import com.zy.asrs.entity.BasShuttleErr;
import com.zy.asrs.entity.LocMast;
import com.zy.asrs.service.BasShuttleErrService;
import com.zy.asrs.service.BasShuttleService;
import com.zy.asrs.service.LocMastService;
import com.zy.core.News;
@@ -287,10 +289,10 @@
        if (!res) {
            return res;
        } else {
            // 电量
            // 电量小于阈值或电压小于48V,需要进行充电
            try {
                Integer chargeLine = SpringUtils.getBean(BasShuttleService.class).selectById(this.shuttleNo).getChargeLine();
                return this.getBatteryPower$() < chargeLine;
                return this.getBatteryPower$() < chargeLine || this.currentVoltage < 480;
            } catch (Exception e) {
                News.error("fail", e);
                return false;
@@ -312,4 +314,13 @@
        return currentLocMast.getLocNo();
    }
    public String getStatusErrorCode$() {
        BasShuttleErrService basShuttleErrService = SpringUtils.getBean(BasShuttleErrService.class);
        BasShuttleErr basShuttleErr = basShuttleErrService.queryByCode(this.statusErrorCode.intValue());
        if (basShuttleErr == null) {
            return null;
        }
        return basShuttleErr.getErrName();
    }
}