#
luxiaotao1123
2022-11-01 76f9aff5cda7e8471585f41bfd88ce2e819521ba
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()) {
@@ -2470,6 +2471,7 @@
                if (steProtocol.getMode() == 0
                        || !steProtocol.statusType.equals(SteStatusType.IDLE)
                        || basSte.getPakMk().equals("Y")
                        || basSte.getAutoCharge().equals("N")
//                        || steProtocol.getChargeStatus() == 1
                ) {
                    continue;
@@ -2484,7 +2486,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;
@@ -2644,6 +2672,24 @@
        }
    }
    /**
     * 小车从充电桩 至 待机库位
     */
    public synchronized void steFromChargeToIdleLoc() {
        for (SteChargeType value : SteChargeType.values()) {
            Integer steNo = basSteService.hasCarOfLocNo(value.locNo);
            if (steNo != null) {
                SteThread steThread = (SteThread) SlaveConnection.get(SlaveType.Ste, steNo);
                SteProtocol steProtocol = steThread.getSteProtocol();
                BasSte basSte = basSteService.selectById(steNo);
                if (Cools.isEmpty(steProtocol, basSte)) {
                    continue;
                }
            }
        }
    }
    /**
     * 因双深库位阻塞,对浅库位进行移转(出库版)