zhoushihao
2025-06-16 13b9ac920cebb843717bfd18369c5179fe056c91
1、卧式理片笼出片策略优化:均忙碌优先小线
2个文件已修改
55 ■■■■ 已修改文件
hangzhoumesParent/common/servicebase/src/main/java/com/mes/common/config/Const.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/job/OpcCacheGlassNewTask.java 47 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/common/servicebase/src/main/java/com/mes/common/config/Const.java
@@ -36,10 +36,10 @@
     * 忙碌 1
     * 禁用 2
     */
    public static final String OUT_FREE = "0";
    public static final String OUT_BUSY = "1";
    public static final String OUT_DISABLE = "2";
    public static final List<String> OUT_DISABLE_ALL = Arrays.asList("1", "2");
    public static final Integer OUT_FREE = 0;
    public static final Integer OUT_BUSY = 1;
    public static final Integer OUT_DISABLE = 2;
    public static final List<Integer> OUT_DISABLE_ALL = Arrays.asList(1, 2);
    /**
hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/job/OpcCacheGlassNewTask.java
@@ -391,25 +391,25 @@
        S7DataWL s7DataWLOne = s7SerializerWLOne.read(S7DataWL.class);
        S7DataWL s7DataWLTwo = s7SerializerWLTwo.read(S7DataWL.class);
        S7DataWLExtra s7DataWLExtraTwo = s7SerializerWLTwo.read(S7DataWLExtra.class);
        Integer oneOutStateEntity = s7DataWLOne.getSlotState();
        Integer twoOutStateEntity = s7DataWLTwo.getSlotState();
        Integer d06OutStateEntity = s7DataWLExtraTwo.getD06SlotState();
        Integer oneOutState = s7DataWLOne.getSlotState();
        Integer twoOutState = s7DataWLTwo.getSlotState();
        Integer d06OutState = s7DataWLExtraTwo.getD06SlotState();
        //状态有3中情况:0空闲 1忙碌 2禁用
        String oneOutState = Const.OUT_DISABLE;
        String twoOutState = Const.OUT_DISABLE;
        String d06OutState = Const.OUT_DISABLE;
//        int oneOutState = Const.OUT_DISABLE;
//        int twoOutState = Const.OUT_DISABLE;
//        int d06OutState = Const.OUT_DISABLE;
//        if (null != oneOutStateEntity && null != oneOutStateEntity.getValue()) {
//            oneOutState = oneOutStateEntity.getValue().toString();
//        }
        if (null != oneOutStateEntity) {
            oneOutState = oneOutStateEntity.toString();
        }
//        if (null != oneOutStateEntity) {
//            oneOutState = oneOutStateEntity.toString();
//        }
//        if (null != twoOutStateEntity && null != twoOutStateEntity.getValue()) {
//            twoOutState = twoOutStateEntity.getValue().toString();
//        }
        if (null != twoOutStateEntity) {
            twoOutState = twoOutStateEntity.toString();
        }
//        if (null != twoOutStateEntity) {
//            twoOutState = twoOutStateEntity.toString();
//        }
        //两条线都为禁用则不出玻璃
        if (Const.OUT_DISABLE.equals(oneOutState) && Const.OUT_DISABLE.equals(twoOutState)) {
            log.info("A09、A10为{},{}非自动状态,无法出片", oneOutState, oneOutState);
@@ -418,23 +418,26 @@
//        if (null != d06OutStateEntity && null != d06OutStateEntity.getValue()) {
//            d06OutState = d06OutStateEntity.getValue().toString();
//        }
        if (null != d06OutStateEntity) {
            d06OutState = d06OutStateEntity.toString();
        }
//        if (null != d06OutStateEntity) {
//            d06OutState = d06OutStateEntity.toString();
//        }
        //获取d06片台状态
        // 1:一对一的情况下不需要判断d06状态
        // 2:一号线一对多的情况下,获取二号线磨边前片台D07的状态,D07非禁用时,二号线将按照D06片台状态觉得出片
        // 3:二号线一对多的情况下,获取一号线磨边前片台C08的状态,C08非禁用时,一号线将按照D06片台状态觉得出片
        if (cellFlag == 2) {
            if (deviceId == 1) {
                twoOutState = Const.OUT_DISABLE.equals(twoOutState) ? Const.OUT_DISABLE : d06OutState;
//                twoOutState = Const.OUT_DISABLE.equals(twoOutState) ? Const.OUT_DISABLE : d06OutState;
                twoOutState = twoOutState & d06OutState;
            } else {
                oneOutState = Const.OUT_DISABLE.equals(oneOutState) ? Const.OUT_DISABLE : d06OutState;
                oneOutState = oneOutState & d06OutState;
//                oneOutState = Const.OUT_DISABLE.equals(oneOutState) ? Const.OUT_DISABLE : d06OutState;
            }
            if (Const.OUT_BUSY.equals(oneOutState) && Const.OUT_BUSY.equals(twoOutState)) {
                log.info("A09、A10为{},{}非自动状态,无法出片", oneOutState, oneOutState);
                return Boolean.FALSE;
            }
//            if (Const.OUT_BUSY.equals(oneOutState) && Const.OUT_BUSY.equals(twoOutState)) {
//                log.info("A09、A10为{},{}非自动状态,无法出片", oneOutState, oneOutState);
//                return Boolean.FALSE;
//            }
        }
        log.info("开始执行出片/直通任务,任务信息为:{},表名为:{},设备id:{},开始时间:{},一号线状态:{},二号线状态:{}",
@@ -449,7 +452,7 @@
            } else if (Const.OUT_FREE.equals(oneOutState)) {
                cell = Const.ONE_OUT_TARGET_POSITION;
            } else {
                return Boolean.FALSE;
                cell = Const.TWO_OUT_TARGET_POSITION;
            }
        }
        if (Const.OUT_FREE.equals(oneOutState) && Const.OUT_FREE.equals(twoOutState)) {