#
1
2025-05-12 fcc24525fba4cbc27b0965bf18440efc38ad9150
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -38,6 +38,7 @@
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import java.io.IOException;
import java.time.LocalDateTime;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Collectors;
@@ -653,13 +654,17 @@
                continue;
            }
            CrnSlave crnSlave = new CrnSlave(crn);
            if (!crn.getId().equals(crnProtocol.getLaneNo())) {
                for (CrnSlave crnOther : slaveProperties.getCrn()) {
                    if (crnOther.getId().equals(crnProtocol.getLaneNo())) {
                        crn.updateCrnInStn(crnOther);
                        crnSlave.updateCrnInStn(crnOther);
                    }
                }
            }
            crn = crnSlave;
            // 库位移转
            this.locToLoc(crn, crnProtocol);
@@ -807,10 +812,13 @@
                    }
                    try {
                        HashMap<String, Object> headParam = new HashMap<>();
                        headParam.put("taskNo", taskWrk.getTaskNo());
                        headParam.put("status", taskWrk.getStatus());
                        headParam.put("ioType", taskWrk.getIoTypeWms());
                        headParam.put("barcode", taskWrk.getBarcode());
                        headParam.put("taskNo",taskWrk.getTaskNo());
                        headParam.put("taskStatus",taskWrk.getStatus());
                        headParam.put("ioType",taskWrk.getIoTypeWms());
                        headParam.put("barCode",taskWrk.getBarcode());
                        headParam.put("reportTime", LocalDateTime.now());
                        headParam.put("weight",taskWrk.getScWeight().doubleValue());
                        String response;
                        response = new HttpHandler.Builder()
                                // .setHeaders(headParam)
@@ -927,10 +935,13 @@
                            }
                            try {
                                HashMap<String, Object> headParam = new HashMap<>();
                                headParam.put("taskNo", taskWrk.getTaskNo());
                                headParam.put("status", taskWrk.getStatus());
                                headParam.put("ioType", taskWrk.getIoTypeWms());
                                headParam.put("barcode", taskWrk.getBarcode());
                                headParam.put("taskNo",taskWrk.getTaskNo());
                                headParam.put("taskStatus",taskWrk.getStatus());
                                headParam.put("ioType",taskWrk.getIoTypeWms());
                                headParam.put("barCode",taskWrk.getBarcode());
                                headParam.put("reportTime", LocalDateTime.now());
                                headParam.put("weight",taskWrk.getScWeight().doubleValue());
                                String response;
                                response = new HttpHandler.Builder()
                                        // .setHeaders(headParam)
@@ -1031,10 +1042,13 @@
                    }
                    try {
                        HashMap<String, Object> headParam = new HashMap<>();
                        headParam.put("taskNo", taskWrk.getTaskNo());
                        headParam.put("status", taskWrk.getStatus());
                        headParam.put("ioType", taskWrk.getIoTypeWms());
                        headParam.put("barcode", taskWrk.getBarcode());
                        headParam.put("taskNo",taskWrk.getTaskNo());
                        headParam.put("taskStatus",taskWrk.getStatus());
                        headParam.put("ioType",taskWrk.getIoTypeWms());
                        headParam.put("barCode",taskWrk.getBarcode());
                        headParam.put("reportTime", LocalDateTime.now());
                        headParam.put("weight",taskWrk.getScWeight().doubleValue());
                        String response;
                        response = new HttpHandler.Builder()
                                // .setHeaders(headParam)
@@ -1145,10 +1159,13 @@
                    try {
                        HashMap<String, Object> headParam = new HashMap<>();
                        headParam.put("taskNo", taskWrk.getTaskNo());
                        headParam.put("status", taskWrk.getStatus());
                        headParam.put("ioType", taskWrk.getIoTypeWms());
                        headParam.put("barcode", taskWrk.getBarcode());
                        headParam.put("taskNo",taskWrk.getTaskNo());
                        headParam.put("taskStatus",taskWrk.getStatus());
                        headParam.put("ioType",taskWrk.getIoTypeWms());
                        headParam.put("barCode",taskWrk.getBarcode());
                        headParam.put("reportTime", LocalDateTime.now());
                        headParam.put("weight",taskWrk.getScWeight().doubleValue());
                        String response;
                        log.error("wcs完结任务上报wms==》", headParam);
@@ -1372,6 +1389,32 @@
        }
        return true;
    }
    public boolean rgvOtherIDLEOther(RgvSlave slave) {
        RgvProtocol rgvProtocol = RgvStatusCache.getRgvStatus(slave.getOtherId());
        RgvTaskProtocol rgvTaskProtocol = RgvTaskCache.getRgvStatus(slave.getOtherId());
        if (rgvProtocol == null || rgvTaskProtocol == null) {
            return false;
        }
        if (!rgvProtocol.getModeType().equals(RgvModeType.AUTO) || rgvProtocol.getRgvPos().equals(0L) || rgvTaskProtocol.getAvoid() == -1
                || (!rgvProtocol.getStatusType().equals(RgvStatusType.IDLE) && !rgvProtocol.getStatusType().equals(RgvStatusType.ROAM))) {
            return false;
        }
        RgvProtocol rgvProtocolOther = RgvStatusCache.getRgvStatus(slave.getId());
        RgvTaskProtocol rgvTaskProtocolOther = RgvTaskCache.getRgvStatus(slave.getId());
        if (rgvProtocolOther == null) {
            return true;
        }
        if (rgvProtocolOther.statusEnable) {
            if (rgvProtocolOther.getModeType().equals(RgvModeType.AUTO)
                    && rgvProtocolOther.getStatusType().equals(RgvStatusType.IDLE)
                    && rgvProtocolOther.getLoaded()==0) {
                return false;
            }
        }
        return true;
    }
    public boolean rgvOtherIDLE(RgvSlave slave) {
        RgvProtocol rgvProtocol = RgvStatusCache.getRgvStatus(slave.getId());
        RgvTaskProtocol rgvTaskProtocol = RgvTaskCache.getRgvStatus(slave.getId());
@@ -1509,8 +1552,10 @@
                        }
                        if (!sign){
                            if (!rgvOtherIDLE(rgvSlave)){
                                sign=true;
                            if (rgvOtherIDLEOther(rgvSlave)){
                                if (!rgvOtherIDLE(rgvSlave)){
                                    sign=true;
                                }
                            }
                        }