#
luxiaotao1123
2022-10-28 4fa1e8117fc408f5bd3a5612eea5ceb63d206113
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -2458,6 +2458,7 @@
    /**
     * 小车电量检测 ===>> 发起充电
     */
    @SuppressWarnings("serial")
    public synchronized void loopSteCharge() {
        SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, 1);
        for (SteSlave ste : slaveProperties.getSte()) {
@@ -2484,7 +2485,33 @@
                if (wrkCharge == null && steProtocol.getChargeStatus() == 0) {
                    // 寻找空闲充电桩
                    SteChargeType steCharge = devpThread.getIdleChargeLocNo();
                    SteChargeType steCharge = null;
                    do {
                        String locNo;
                        if (!devpThread.charge0) {
                            locNo = SteChargeType.FIRST.locNo;
                            if (basSteService.hasCarOfLocNo(locNo) == null) {
                                steCharge = SteChargeType.FIRST;
                                break;
                            }
                        }
                        if (!devpThread.charge1) {
                            locNo = SteChargeType.SECOND.locNo;
                            if (basSteService.hasCarOfLocNo(locNo) == null) {
                                steCharge = SteChargeType.SECOND;
                                break;
                            }
                        }
                        if (!devpThread.charge2) {
                            locNo = SteChargeType.THIRD.locNo;
                            if (basSteService.hasCarOfLocNo(locNo) == null) {
                                steCharge = SteChargeType.THIRD;
                                break;
                            }
                        }
                        break;
                    } while (false);
                    if (steCharge == null) {
                        log.warn("{}号小车【电量:{}】充电失败,原因:没有空闲充电桩。", ste.getId(), steProtocol.getCharge());
                        continue;