1、中空任务出片逻辑调整
三条线均计算在内(第三条状态不影响优先级):定义线路顺序优先级(lisec优先/韩江优先), 定义全局变量记录上一次的任务线路
1、当一/二线都忙碌/空闲时,获取上一次任务线路,判断条线优先级并执行
2、当部分忙碌/空闲时,按照顺序一线二线依次往下走,直到空闲且有任务为止
5个文件已修改
84 ■■■■■ 已修改文件
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/controller/HollowGlassOutRelationInfoController.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/service/HollowGlassOutRelationInfoService.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/service/impl/HollowGlassOutRelationInfoServiceImpl.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/job/OpcPlcStorageCageHollowTask.java 61 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/job/PushMessageToIndex.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/controller/HollowGlassOutRelationInfoController.java
@@ -97,12 +97,6 @@
        return Result.build(200, "修改成功", hollowGlassOutRelationInfoService.dispatchHollowSwitch(flag));
    }
    @ApiOperation("中空优先级开关")
    @PostMapping("/priorityHollowSwitch")
    public Result<Boolean> priorityHollowSwitch(Boolean flag) {
        return Result.build(200, "修改成功", hollowGlassOutRelationInfoService.priorityHollowSwitch(flag));
    }
    @ApiOperation("手动生成李赛克文件")
    @PostMapping("/generateHollowLisecFile")
    public Result<String> generateHollowLisecFile(String flowCardId, int cell, int isForce) throws IOException {
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/service/HollowGlassOutRelationInfoService.java
@@ -25,8 +25,6 @@
    Boolean dispatchHollowSwitch(Boolean flag);
    Boolean priorityHollowSwitch(Boolean flag);
    List<String> hollowTaskList(int cell);
    List<HollowGlassQueueInfo> appointHollowTaskDetails(String flowCardId, int cell);
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/service/impl/HollowGlassOutRelationInfoServiceImpl.java
@@ -97,12 +97,6 @@
    }
    @Override
    public Boolean priorityHollowSwitch(Boolean flag) {
        redisUtil.setCacheObject("priorityHollowSwitch", flag);
        return redisUtil.getCacheObject("priorityHollowSwitch");
    }
    @Override
    public List<String> hollowTaskList(int cell) {
        //查询任务表中本条线所有未完成的任务信息
        List<HollowGlassOutRelationInfo> list = this.list(new LambdaQueryWrapper<HollowGlassOutRelationInfo>()
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/job/OpcPlcStorageCageHollowTask.java
@@ -106,6 +106,7 @@
    private static final List<Integer> ONE_LINE_FIRST = Arrays.asList(930, 931, 932);
    private static final List<Integer> TWO_LINE_FIRST = Arrays.asList(931, 930, 932);
    private Integer lastTimeLine = -1;
    /**
     * 直通格子
     */
@@ -373,14 +374,14 @@
        //获取空闲且领取任务的数据信息,没有任务直接走玻璃调度
        HashMap<Integer, Boolean> map = new HashMap<>();
        Boolean oneState = Boolean.FALSE;
        Boolean twoState = Boolean.FALSE;
        Boolean threeState = Boolean.FALSE;
        try {
            if (CMJ1ModbusTcp.checkConnected()) {
                Boolean oneEntity = CMJ1ModbusTcp.readUInt16(42027 - 40001) != 0;
                map.put(930, oneEntity);
            } else {
                map.put(930, Boolean.FALSE);
                oneState = CMJ1ModbusTcp.readUInt16(42027 - 40001) != 0;
                map.put(930, oneState);
            }
        } catch (Exception e) {
            //nothing
            log.info("一线空闲状态获取异常");
@@ -388,45 +389,42 @@
        try {
            S7DataZKExtra s7DataZKExtra = s7SerializerZKQ2.read(S7DataZKExtra.class);
            log.info("中空额外读取{}", s7DataZKExtra);
            map.put(931, s7DataZKExtra.getIsFree());
            map.put(932, s7DataZKExtra.getIsFree03());
            twoState = s7DataZKExtra.getIsFree();
            threeState = s7DataZKExtra.getIsFree03();
            map.put(931, twoState);
            map.put(932, threeState);
        } catch (Exception e) {
            //nothing
            log.info("二/三线线空闲状态获取异常");
        }
        List<Integer> resultList = new ArrayList<>();
        if (redisUtil.getCacheObject("priorityHollowSwitch")) {
            resultList = TWO_LINE_FIRST;
        } else {
            resultList = ONE_LINE_FIRST;
        }
        HollowGlassOutRelationInfo hollowGlassOutRelationInfo = null;
        int cell = -1;
        for (Integer i : resultList) {
            if (null == hollowGlassOutRelationInfo) {
                Boolean entity = map.get(i);
                cell = i;
                if (null != entity && entity) {
        if (oneState && twoState || !(oneState || twoState)) {
            //获取上一次的任务信息线路
            List<Integer> resultList = lastTimeLine == 930 ? TWO_LINE_FIRST : ONE_LINE_FIRST;
            for (int i : resultList) {
                if (null == hollowGlassOutRelationInfo) {
                    cell = i;
                    hollowGlassOutRelationInfo = hollowGlassOutRelationInfoService
                            .getOne(new LambdaQueryWrapper<HollowGlassOutRelationInfo>()
                                    .eq(HollowGlassOutRelationInfo::getCell, cell)
                                    .eq(HollowGlassOutRelationInfo::getState, Const.HOLLOW_FLOW_CARD_START)
                            );
                }
            } else {
                break;
            }
        }
        for (Integer i : resultList) {
            if (null == hollowGlassOutRelationInfo) {
                cell = i;
                hollowGlassOutRelationInfo = hollowGlassOutRelationInfoService
                        .getOne(new LambdaQueryWrapper<HollowGlassOutRelationInfo>()
                                .eq(HollowGlassOutRelationInfo::getCell, cell)
                                .eq(HollowGlassOutRelationInfo::getState, Const.HOLLOW_FLOW_CARD_START)
                        );
            } else {
                break;
        } else {
            for (int i : ONE_LINE_FIRST) {
                if (null == hollowGlassOutRelationInfo) {
                    Boolean freeFlag = map.get(i);
                    cell = i;
                    if (freeFlag) {
                        hollowGlassOutRelationInfo = hollowGlassOutRelationInfoService
                                .getOne(new LambdaQueryWrapper<HollowGlassOutRelationInfo>()
                                        .eq(HollowGlassOutRelationInfo::getCell, cell)
                                        .eq(HollowGlassOutRelationInfo::getState, Const.HOLLOW_FLOW_CARD_START)
                                );
                    }
                }
            }
        }
@@ -1064,6 +1062,7 @@
            s7DataZKDLPTwo = new S7DataZKDLPTwo();
            s7DataZKDLPTwo.setMesReply(1);
            s7SerializerZKDLPTwo.write(s7DataZKDLPTwo);
            lastTimeLine = targetSlot;
        } catch (Exception e) {
            e.printStackTrace();
        }
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/job/PushMessageToIndex.java
@@ -331,15 +331,6 @@
            dispatchHollowSwitch = redisUtil.getCacheObject("dispatchHollowSwitch");
        }
        jsonObject.append("dispatchHollowSwitch", dispatchHollowSwitch);
        //调度开关
        boolean priorityHollowSwitch = false;
        if (redisUtil.getCacheObject("priorityHollowSwitch") == null) {
            redisUtil.setCacheObject("priorityHollowSwitch", false);
        } else {
            dispatchHollowSwitch = redisUtil.getCacheObject("priorityHollowSwitch");
        }
        jsonObject.append("dispatchHollowSwitch", dispatchHollowSwitch);
        //理片笼使用情况
        List<Map<String, Object>> bigStorageCageUsage = hollowBigStorageCageService.selectBigStorageCageUsage();
        jsonObject.append("bigStorageCageUsage", bigStorageCageUsage);