1
zhang
2025-09-10 58bb9d3e0a8d8c385085f8cce3492eccf5448ec4
src/main/java/com/zy/asrs/service/impl/CtuMainServiceImpl.java
@@ -69,11 +69,26 @@
    private boolean flag1007 = false;
    private Map<Integer, Long> staNoSet = new HashMap<>();
    public Map<Integer, Long> getStaNoSet() {
        return staNoSet;
    }
    public void setStaNoSet(Map<Integer, Long> staNoSet) {
        this.staNoSet = staNoSet;
    }
    /**
     * 入库,从拣料站到入库站(CTU取货站)
     */
    public synchronized void generateStoreWrkFile(Integer mark) {
        for (Map.Entry<Integer, Long> entry : staNoSet.entrySet()) {
            if (entry.getValue() != null && System.currentTimeMillis() - entry.getValue() > 1000 * 60 * 5) {
                log.info("超时:{}", entry.getKey());
                staNoSet.remove(entry.getKey());
            }
        }
        // 根据输送线plc遍历
        SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, 1);
        StaProtocol staProtocol = devpThread.getStation().get(1004);
@@ -83,9 +98,13 @@
            staProtocol = staProtocol.clone();
        }
        // 判断是否满足条件
//        if (!staProtocol.isLoading()) {
//            return;
//        }
        if (!staProtocol.isLoading()) {
            return;
        }
        Long i = staNoSet.get(staProtocol.getWorkNo());
        if (i != null) {
            return;
        }
        // && staProtocol.isInEnable()
        if (staProtocol.getWorkNo() > 0 && staProtocol.isAutoing() && !staProtocol.isEmptyMk() && staProtocol.isPakMk()) {
            if (staProtocol.getStaNo() == 1004) {
@@ -96,6 +115,7 @@
                }
                staProtocol.setStaNo((short) 1007);
                boolean result = MessageQueue.offer(SlaveType.Devp, 1, new Task(2, staProtocol));
                staNoSet.put(staProtocol.getWorkNo(), System.currentTimeMillis());
                log.info("入库输送线下发:{},{}", staProtocol.getWorkNo(), 1007);
            }
@@ -302,7 +322,7 @@
        }
        SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, 1);
        StaProtocol staProtocol = devpThread.getStation().get(1001);
        if (i >= 6) {
        if (i >= 7) {
            OpenBusSubmitParam openBusSubmitParam = new OpenBusSubmitParam();
            openBusSubmitParam.setBatch(DateUtils.convert(new Date()));
            List<TaskDto> taskList = new ArrayList<>();