| | |
| | | return null; |
| | | } |
| | | |
| | | if (isConveyorStationTaskLimitReached()) { |
| | | return null; |
| | | } |
| | | |
| | | if (station == 1) { |
| | | if (dualCrnProtocol.getTaskNo() > 0) { |
| | | News.taskInfo(wrkMast.getWrkNo(), "工位1系统内部记录有任务"); |
| | |
| | | wrkMast.getStaNo(), |
| | | currentStationTaskCount, |
| | | basStation.getOutTaskLimit()); |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | private boolean isConveyorStationTaskLimitReached() { |
| | | int conveyorStationTaskLimit = getSystemConfigInt("conveyorStationTaskLimit", 30); |
| | | if (conveyorStationTaskLimit <= 0) { |
| | | return false; |
| | | } |
| | | |
| | | int currentStationTaskCount = stationOperateProcessUtils.getCurrentStationTaskCount(); |
| | | if (currentStationTaskCount >= conveyorStationTaskLimit) { |
| | | News.warn("输送站点任务数量达到上限,已停止双工位堆垛机任务下发。当前任务数={},上限={}", |
| | | currentStationTaskCount, |
| | | conveyorStationTaskLimit); |
| | | return true; |
| | | } |
| | | return false; |
| | |
| | | return getSystemConfigBoolean(CRN_OUT_REQUIRE_STATION_OUT_ENABLE_CONFIG, true); |
| | | } |
| | | |
| | | private int getSystemConfigInt(String code, int defaultValue) { |
| | | Object systemConfigMapObj = redisUtil.get(RedisKeyType.SYSTEM_CONFIG_MAP.key); |
| | | if (!(systemConfigMapObj instanceof Map)) { |
| | | return defaultValue; |
| | | } |
| | | try { |
| | | Object value = ((Map<?, ?>) systemConfigMapObj).get(code); |
| | | if (value == null) { |
| | | return defaultValue; |
| | | } |
| | | return Integer.parseInt(String.valueOf(value).trim()); |
| | | } catch (Exception ignore) { |
| | | return defaultValue; |
| | | } |
| | | } |
| | | |
| | | private boolean getSystemConfigBoolean(String code, boolean defaultValue) { |
| | | Object systemConfigMapObj = redisUtil.get(RedisKeyType.SYSTEM_CONFIG_MAP.key); |
| | | if (!(systemConfigMapObj instanceof Map)) { |