自动化立体仓库 - WCS系统
*
lsh
2024-10-26 48790a2540295d8272629c693d77e214d163f826
*
3个文件已修改
97 ■■■■ 已修改文件
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/OpenServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/utils/SortTheExecutionOfTheCarUtil.java 86 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -60,7 +60,7 @@
            if (wrkMasts.isEmpty()){
                return;
            }
            List<BasDevpPosition> basDevpPositions = basDevpPositionService.selectList(new EntityWrapper<BasDevpPosition>().orderBy("plc_position",false));
            List<BasDevpPosition> basDevpPositions = basDevpPositionService.selectList(new EntityWrapper<BasDevpPosition>().orderBy("plc_position",true));
            if (basDevpPositions.isEmpty()){
                log.error("获取所有站点信息异常");
                return;
@@ -91,7 +91,10 @@
                rgvPositionList.add(rgvPosition);
            }
            Integer rgvNo = SortTheExecutionOfTheCarUtil.LatelyAndGreaterThan(rgvPositionList, sitePosition,perimeter);
            if (rgvNo == -1){
                log.info("更新小车排序信息异常={}",rgvNo);
                return;
            }
            List<BasCircularShuttle> basCircularShuttleList = basCircularShuttleService.selectList(new EntityWrapper<BasCircularShuttle>().orderBy("rgv_id", true));
            if (basCircularShuttleList.get(0).getRgvNo().equals(rgvNo)){
                return;
@@ -189,7 +192,7 @@
            if (rgvProtocol == null) {
                return;
            }
            List<BasDevpPosition> basDevpPositions = basDevpPositionService.selectList(new EntityWrapper<BasDevpPosition>().orderBy("plc_position",false));
            List<BasDevpPosition> basDevpPositions = basDevpPositionService.selectList(new EntityWrapper<BasDevpPosition>().orderBy("plc_position",true));
            Integer devNo = SortTheExecutionOfTheCarUtil.LatelyAndLessThan(basDevpPositions, rgvProtocol.getRgvPos(),perimeter);
            BasDevpPosition[] basDevpPositionsList = SortTheExecutionOfTheCarUtil.devpNoSort(basDevpPositions, devNo);
            BasDevpPosition[] basDevpPositionsListUN = SortTheExecutionOfTheCarUtil.devpNoSortUN(basDevpPositionsList);
src/main/java/com/zy/asrs/service/impl/OpenServiceImpl.java
@@ -77,7 +77,7 @@
            List<WcsTaskListParam> wcsTaskListParamList = new ArrayList<>();
            List<WcsRgvListParam> wcsRgvListParamList = new ArrayList<>();
            List<WrkMast> wrkMastList = wrkMastService.selectList(new EntityWrapper<>());
            List<BasDevpPosition> basDevpPositions = basDevpPositionService.selectList(new EntityWrapper<BasDevpPosition>().orderBy("plc_position",false));
            List<BasDevpPosition> basDevpPositions = basDevpPositionService.selectList(new EntityWrapper<BasDevpPosition>().orderBy("plc_position",true));
            for (WrkMast wrkMast : wrkMastList){
                WcsTaskListParam wcsTaskListParam = new WcsTaskListParam(wrkMast);
src/main/java/com/zy/asrs/utils/SortTheExecutionOfTheCarUtil.java
@@ -29,20 +29,40 @@
        return ints;
    }
    //获取最近并在当前位置前边的位置
//    //获取最近并在当前位置前边的位置1000000===>10000==>0==>1000000
//    public static Integer LatelyAndLessThan(List<BasDevpPosition> devpPosition, long nowPosition,long perimeter){
//        Integer result = 0;
//        long Difference = perimeter;
//        for (BasDevpPosition positions : devpPosition){
//            Long position = positions.getPlcPosition();
//            if (position<=nowPosition){
//                if ((nowPosition-position) < Difference){
//                    Difference = nowPosition-position;
//                    result = positions.getDevNo();
//                }
//            } else {
//                if ((nowPosition-(position - perimeter)) < Difference){
//                    Difference = nowPosition-(position - perimeter);
//                    result = positions.getDevNo();
//                }
//            }
//        }
//        return result;
//    }
    //获取最近并在当前位置前边的位置 0==>1000===>1000000==>0
    public static Integer LatelyAndLessThan(List<BasDevpPosition> devpPosition, long nowPosition,long perimeter){
        Integer result = 0;
        long Difference = perimeter;
        for (BasDevpPosition positions : devpPosition){
            Long position = positions.getPlcPosition();
            if (position<=nowPosition){
                if ((nowPosition-position) < Difference){
                    Difference = nowPosition-position;
            if (position >= nowPosition){
                if ((position-nowPosition) < Difference){
                    Difference = position-nowPosition;
                    result = positions.getDevNo();
                }
            } else {
                if ((nowPosition-(position - perimeter)) < Difference){
                    Difference = nowPosition-(position - perimeter);
                if (perimeter - (nowPosition - position) < Difference){
                    Difference = perimeter - (nowPosition - position);
                    result = positions.getDevNo();
                }
            }
@@ -50,14 +70,29 @@
        return result;
    }
    //获取最近并在当前位置后边的位置
//    //获取最近并在当前位置后边的位置 1000000===>10000==>0==>1000000
//    public static Integer LatelyAndLessThanWcs(List<BasDevpPosition> devpPosition, long nowPosition,long perimeter){
//        Integer result = 0;
//        Integer integer = LatelyAndLessThan(devpPosition, nowPosition,perimeter);
//        for (BasDevpPosition basDevpPosition:devpPosition){
//            if (basDevpPosition.getDevNo().equals(integer)){
//                if (basDevpPosition.getDevNo() == 101){
//                    result = 133;
//                }
//                break;
//            }
//            result = basDevpPosition.getDevNo();
//        }
//        return result;
//    }
    //获取最近并在当前位置后边的位置 0==>1000===>1000000==>0
    public static Integer LatelyAndLessThanWcs(List<BasDevpPosition> devpPosition, long nowPosition,long perimeter){
        Integer result = 0;
        Integer result = -1;
        Integer integer = LatelyAndLessThan(devpPosition, nowPosition,perimeter);
        for (BasDevpPosition basDevpPosition:devpPosition){
            if (basDevpPosition.getDevNo().equals(integer)){
                if (basDevpPosition.getDevNo() == 101){
                    result = 133;
                if (basDevpPosition.getDevNo() == 133){
                    result = 101;
                }
                break;
            }
@@ -85,15 +120,36 @@
//        return result;
//    }
    //获取最近并在当前位置后边的位置
//    //获取最近并在当前位置后边的位置  1000000===>10000==>0==>1000000
//    public static Integer LatelyAndGreaterThan(List<List<Long>> sitePosition, long nowPosition ,long perimeter){
//        int result = 0;
//        long Difference = perimeter;
//        for (List<Long> rgvPositions: sitePosition){
//            Long position = rgvPositions.get(1);
//            if (position>nowPosition){
//                if ((position - nowPosition) < Difference){
//                    Difference = position - nowPosition;
//                    result = rgvPositions.get(0).intValue();
//                }
//            } else {
//                if ((perimeter - (nowPosition - position)) < Difference){
//                    Difference = perimeter - (nowPosition - position);
//                    result = rgvPositions.get(0).intValue();
//                }
//            }
//        }
//        return result;
//    }
    //获取最近并在当前位置后边的位置   0==>1000===>1000000==>0
    public static Integer LatelyAndGreaterThan(List<List<Long>> sitePosition, long nowPosition ,long perimeter){
        int result = 0;
        int result = -1;
        long Difference = perimeter;
        for (List<Long> rgvPositions: sitePosition){
            Long position = rgvPositions.get(1);
            if (position>nowPosition){
                if ((position - nowPosition) < Difference){
                    Difference = position - nowPosition;
            if (position <= nowPosition){
                if ((nowPosition - position) < Difference){
                    Difference = nowPosition - position;
                    result = rgvPositions.get(0).intValue();
                }
            } else {