#
Junjie
16 小时以前 b376fc91290633b6ff5c51aba95e8b70d30a992c
#
1个文件已添加
2个文件已修改
78 ■■■■■ 已修改文件
src/main/java/com/zy/core/utils/CrnOperateProcessUtils.java 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/utils/DualCrnOperateProcessUtils.java 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/sql/20260322_add_crn_out_require_station_out_enable_config.sql 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/utils/CrnOperateProcessUtils.java
@@ -64,6 +64,8 @@
    @Autowired
    private StationOperateProcessUtils stationOperateProcessUtils;
    private static final String CRN_OUT_REQUIRE_STATION_OUT_ENABLE_CONFIG = "crnOutRequireStationOutEnable";
    public synchronized void crnIoExecute() {
        Object systemConfigMapObj = redisUtil.get(RedisKeyType.SYSTEM_CONFIG_MAP.key);
        if (systemConfigMapObj != null) {
@@ -374,7 +376,7 @@
                    continue;
                }
                if (!stationProtocol.isOutEnable()) {
                if (isRequireOutboundStationOutEnable() && !stationProtocol.isOutEnable()) {
                    News.taskInfo(wrkMast.getWrkNo(), "放货站点:{} 没有可出信号", stationObjModel.getStationId());
                    continue;
                }
@@ -565,7 +567,7 @@
                continue;
            }
            if (!stationProtocol.isOutEnable()) {
            if (isRequireOutboundStationOutEnable() && !stationProtocol.isOutEnable()) {
                News.taskInfo(wrkMast.getWrkNo(), "放货站点:{} 没有可出信号", stationObjModel.getStationId());
                continue;
            }
@@ -707,6 +709,32 @@
        }
    }
    private boolean isRequireOutboundStationOutEnable() {
        return getSystemConfigBoolean(CRN_OUT_REQUIRE_STATION_OUT_ENABLE_CONFIG, true);
    }
    private boolean getSystemConfigBoolean(String code, boolean 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;
            }
            String text = String.valueOf(value).trim();
            if ("Y".equalsIgnoreCase(text) || "true".equalsIgnoreCase(text) || "1".equals(text)) {
                return true;
            }
            if ("N".equalsIgnoreCase(text) || "false".equalsIgnoreCase(text) || "0".equals(text)) {
                return false;
            }
        } catch (Exception ignore) {
        }
        return defaultValue;
    }
    private synchronized boolean crnExecuteLocTransfer(BasCrnp basCrnp, CrnThread crnThread) {
        CrnProtocol crnProtocol = crnThread.getStatus();
        if(crnProtocol == null){
src/main/java/com/zy/core/utils/DualCrnOperateProcessUtils.java
@@ -67,6 +67,8 @@
    @Autowired
    private StationOperateProcessUtils stationOperateProcessUtils;
    private static final String CRN_OUT_REQUIRE_STATION_OUT_ENABLE_CONFIG = "crnOutRequireStationOutEnable";
    //入出库  ===>>  双工位堆垛机入出库作业下发
    public synchronized void dualCrnIoExecute() {
        List<BasDualCrnp> basDualCrnps = basDualCrnpService.list(new QueryWrapper<>());
@@ -587,7 +589,7 @@
                continue;
            }
            if (!stationProtocol.isOutEnable()) {
            if (isRequireOutboundStationOutEnable() && !stationProtocol.isOutEnable()) {
                News.taskInfo(wrkMast.getWrkNo(), "放货站点:{} 没有可出信号", stationObjModel.getStationId());
                continue;
            }
@@ -901,6 +903,32 @@
        return false;
    }
    private boolean isRequireOutboundStationOutEnable() {
        return getSystemConfigBoolean(CRN_OUT_REQUIRE_STATION_OUT_ENABLE_CONFIG, true);
    }
    private boolean getSystemConfigBoolean(String code, boolean 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;
            }
            String text = String.valueOf(value).trim();
            if ("Y".equalsIgnoreCase(text) || "true".equalsIgnoreCase(text) || "1".equals(text)) {
                return true;
            }
            if ("N".equalsIgnoreCase(text) || "false".equalsIgnoreCase(text) || "0".equals(text)) {
                return false;
            }
        } catch (Exception ignore) {
        }
        return defaultValue;
    }
    private boolean reassignTaskLocNo(WrkMast wrkMast, StationObjModel stationObjModel) {
        StationThread stationThread = (StationThread) SlaveConnection.get(SlaveType.Devp, stationObjModel.getDeviceNo());
        if (stationThread == null) {
src/main/resources/sql/20260322_add_crn_out_require_station_out_enable_config.sql
New file
@@ -0,0 +1,16 @@
-- 堆垛机出库是否必须校验出库站可出信号
-- Y: 必须校验站点可出信号后才允许下发出库任务
-- N: 不校验站点可出信号,堆垛机直接下发出库任务
INSERT INTO sys_config(name, code, value, type, status, select_type)
SELECT '堆垛机出库校验出库站可出信号', 'crnOutRequireStationOutEnable', 'Y', 1, 1, 'crn'
FROM dual
WHERE NOT EXISTS (
    SELECT 1
    FROM sys_config
    WHERE code = 'crnOutRequireStationOutEnable'
);
SELECT id, name, code, value, type, status, select_type
FROM sys_config
WHERE code = 'crnOutRequireStationOutEnable';