自动化立体仓库 - WCS系统
*
lsh
2024-10-17 a0031ed8c187dacc30b4bb2709d3a1dc477a17cf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
package com.zy.asrs.utils;
 
import com.zy.core.enums.RouteCollectCountType;
 
import java.util.Arrays;
import java.util.List;
 
public class SortTheExecutionOfTheCarUtil {
    //排序
    public static int[][] ReorderSteId(int[][] steList,int steNoStart){
        int[][] ints = new int[steList.length][2];
        int Difference = 0;
        for (int[] steNo : steList){
            if (steNo[0] == steNoStart){
                Difference = steNo[1] - 1;
                break;
            }
        }
        for (int[] steNo : steList){
            int i = steNo[1];
            if (i > Difference){
                steNo[1] = i - Difference;
            } else {
                steNo[1] = steList.length + i-Difference;
            }
            ints[steNo[0]-1] = steNo;
        }
        return ints;
    }
    //排序
    public static int ReorderSteId2(int[][] steList,int steNoStart){
        int[][] ints = new int[steList.length][2];
        int Difference = 0;
        for (int[] steNo : steList){
            if (steNo[0] == steNoStart){
                Difference = steNo[1] - 1;
                break;
            }
        }
        for (int[] steNo : steList){
            int i = steNo[1];
            if (i > Difference){
                steNo[1] = i - Difference;
            } else {
                steNo[1] = steList.length + i-Difference;
            }
            ints[steNo[0]-1] = steNo;
        }
        return 0;
    }
    public static void main(String[] args) {
        int[][] ints = new int[][]{{1,1},{2,2},{3,3},{4,4},{5,5},{6,6},{7,7},{8,8},{9,9},{10,10}};
 
        int[][] reorderSteId = ReorderSteId(ints, 2);
        for (int[] ste : reorderSteId){
            System.out.println(Arrays.toString(ste));
        }
    }
}