*
lsh
2024-10-23 0b232db982fd452c805e0c823416c106fe63b4ca
src/main/java/com/zy/asrs/utils/SortTheExecutionOfTheCarUtil.java
@@ -30,9 +30,9 @@
    }
    //获取最近并在当前位置前边的位置
    public static Integer LatelyAndLessThan(List<BasDevpPosition> devpPosition, long nowPosition){
    public static Integer LatelyAndLessThan(List<BasDevpPosition> devpPosition, long nowPosition,long perimeter){
        Integer result = 0;
        long Difference = 1737000L;
        long Difference = perimeter;
        for (BasDevpPosition positions : devpPosition){
            Long position = positions.getPlcPosition();
            if (position<=nowPosition){
@@ -41,11 +41,27 @@
                    result = positions.getDevNo();
                }
            } else {
                if ((nowPosition-(position - 1737000L)) < Difference){
                    Difference = nowPosition-(position - 1737000L);
                if ((nowPosition-(position - perimeter)) < Difference){
                    Difference = nowPosition-(position - perimeter);
                    result = positions.getDevNo();
                }
            }
        }
        return result;
    }
    //获取最近并在当前位置后边的位置
    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;
    }
@@ -70,9 +86,9 @@
//    }
    //获取最近并在当前位置后边的位置
    public static Integer LatelyAndGreaterThan(List<List<Long>> sitePosition, long nowPosition){
    public static Integer LatelyAndGreaterThan(List<List<Long>> sitePosition, long nowPosition ,long perimeter){
        int result = 0;
        long Difference = 1737000L;
        long Difference = perimeter;
        for (List<Long> rgvPositions: sitePosition){
            Long position = rgvPositions.get(1);
            if (position>nowPosition){
@@ -81,8 +97,8 @@
                    result = rgvPositions.get(0).intValue();
                }
            } else {
                if ((1737000L - (nowPosition - position)) < Difference){
                    Difference = 1737000L - (nowPosition - position);
                if ((perimeter - (nowPosition - position)) < Difference){
                    Difference = perimeter - (nowPosition - position);
                    result = rgvPositions.get(0).intValue();
                }
            }