| | |
| | | import com.zy.core.model.protocol.RgvProtocol; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.Collections; |
| | | |
| | | /** |
| | |
| | | */ |
| | | public class LocFCSUtils { |
| | | |
| | | |
| | | public static void main(String[] args) { |
| | | ArrayList<String> locSF = new ArrayList<>(); |
| | | locSF.add("0102101"); |
| | | locSF.add("0100102"); |
| | | locSF.add("0100101"); |
| | | locSF.add("0101001"); |
| | | locSF.add("0107101"); |
| | | locSF.add("0108101"); |
| | | ArrayList<String> locSE = new ArrayList<>(); |
| | | locSE.add("0202101"); |
| | | locSE.add("0200102"); |
| | | locSE.add("0200101"); |
| | | locSE.add("0201001"); |
| | | locSE.add("0207101"); |
| | | locSE.add("0208101"); |
| | | System.out.println(Arrays.toString(locSF.toArray())); |
| | | System.out.println(Arrays.toString(locSE.toArray())); |
| | | ArrayList<String[]> locS1 = LocFCSUtils.getLocS(locSF); |
| | | ArrayList<String[]> locS2 = LocFCSUtils.getLocS(locSE); |
| | | ArrayList<String[]> arrayList = LocFCSUtils.updateLocSInPlace(locS1, locS2); |
| | | for (String[] loc : arrayList) { |
| | | System.out.println(Arrays.toString(loc)); |
| | | } |
| | | |
| | | } |
| | | public static ArrayList<String[]> getLocS(ArrayList<String> locMastDemoListF) { |
| | | ArrayList<String[]> locS = new ArrayList<>(); |
| | | // 提取数据 |
| | |
| | | } |
| | | } |
| | | } |
| | | public static ArrayList<String[]> updateLocSInPlace(ArrayList<String[]> locSF,ArrayList<String[]> locSE) { |
| | | if (locSF == null || locSF.isEmpty()) { |
| | | return new ArrayList<>(); |
| | | } |
| | | if (locSE == null || locSE.isEmpty()) { |
| | | return new ArrayList<>(); |
| | | } |
| | | |
| | | for (String[] rowF : locSF) { |
| | | for (String[] rowE : locSE) { |
| | | if (rowF[3].equals(rowE[3])) { |
| | | rowF[2] = rowE[0]; |
| | | } |
| | | } |
| | | } |
| | | return locSF; |
| | | } |
| | | |
| | | } |