#
Junjie
昨天 febc49cd36666823893c233667b212dfb5527dfb
src/main/java/com/zy/core/utils/station/StationOutboundDispatchProcessor.java
@@ -72,19 +72,6 @@
    @Value("${station.outbound.recent-dispatch-protect-seconds:60}")
    private long recentDispatchProtectSeconds;
    public void crnStationOutExecute() {
        try {
            List<WrkMast> wrkMasts = wrkMastService.list(new QueryWrapper<WrkMast>()
                    .eq("wrk_sts", WrkStsType.OUTBOUND_RUN_COMPLETE.sts)
                    .isNotNull("crn_no"));
            for (WrkMast wrkMast : wrkMasts) {
                crnStationOutExecute(wrkMast);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    public void crnStationOutExecute(WrkMast wrkMast) {
        try {
            if (wrkMast == null || wrkMast.getWrkNo() == null) {
@@ -249,33 +236,32 @@
        }
    }
    public void dualCrnStationOutExecute() {
    public void dualCrnStationOutExecute(WrkMast wrkMast) {
        try {
            List<WrkMast> wrkMasts = wrkMastService.list(new QueryWrapper<WrkMast>()
                    .eq("wrk_sts", WrkStsType.OUTBOUND_RUN_COMPLETE.sts)
                    .isNotNull("dual_crn_no"));
            for (WrkMast wrkMast : wrkMasts) {
            if (wrkMast == null || wrkMast.getWrkNo() == null) {
                return;
            }
                if (hasPendingDispatch(wrkMast.getWrkNo())) {
                    continue;
                return;
                }
                StationObjModel stationObjModel = getOutboundSourceStation(wrkMast);
                if (stationObjModel == null || stationObjModel.getDeviceNo() == null || stationObjModel.getStationId() == null) {
                    continue;
                return;
                }
                StationThread stationThread = (StationThread) SlaveConnection.get(SlaveType.Devp, stationObjModel.getDeviceNo());
                if (stationThread == null) {
                    continue;
                return;
                }
                Map<Integer, StationProtocol> stationMap = stationThread.getStatusMap();
                StationProtocol stationProtocol = stationMap.get(stationObjModel.getStationId());
                if (stationProtocol == null) {
                    continue;
                return;
                }
                Object lock = redisUtil.get(RedisKeyType.STATION_OUT_EXECUTE_LIMIT.key + stationProtocol.getStationId());
                if (lock != null) {
                    continue;
                return;
                }
                if (stationProtocol.isAutoing()
@@ -291,12 +277,12 @@
                    );
                    if (command == null) {
                        News.taskInfo(wrkMast.getWrkNo(), "获取输送线命令失败");
                        continue;
                    return;
                    }
                    boolean offered = offerDevpCommandWithDedup(stationObjModel.getDeviceNo(), command, "dualCrnStationOutExecute");
                    if (!offered) {
                        continue;
                    return;
                    }
                    if (stationMoveCoordinator != null) {
                        stationMoveCoordinator.recordDispatch(
@@ -311,7 +297,6 @@
                    News.info("输送站点出库命令已入设备执行链路,等待源站接单。站点号={},工作号={},命令数据={}",
                            stationProtocol.getStationId(), wrkMast.getWrkNo(), JSON.toJSONString(command));
                    redisUtil.set(RedisKeyType.STATION_OUT_EXECUTE_LIMIT.key + stationProtocol.getStationId(), "lock", 5);
                }
            }
        } catch (Exception e) {
            e.printStackTrace();