|
@@ -211,7 +211,10 @@ public class SafeTimer {
|
|
|
}
|
|
|
}
|
|
|
sb2 = sb2 + baseProcess.getAllLocationStatus().substring(indexOf + 3);
|
|
|
- baseProcess.setAllLocationStatus(sb2);
|
|
|
+ StringBuilder sb = new StringBuilder(sb2);
|
|
|
+ sb.replace(indexOf + 2, indexOf + 3, "2");
|
|
|
+ sb.replace(indexOf + 4, indexOf + 5, "1");
|
|
|
+ baseProcess.setAllLocationStatus(sb.toString());
|
|
|
}
|
|
|
} else if (nextId == 1) {
|
|
|
//新增采样
|
|
@@ -365,5 +368,27 @@ public class SafeTimer {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ public static void main(String[] args) {
|
|
|
+ String s = "0,1,0,2,0,3,0";
|
|
|
+ String s1 = "2,2,2,1,0,0,0";
|
|
|
+ Integer locationId = 2;
|
|
|
+ int indexOf = s.indexOf(locationId.toString());//当前位置在所有流程位置中的下标
|
|
|
+ System.out.println(indexOf);
|
|
|
+ String substring = s1.substring(0, indexOf + 3);//截取已经过的位置状态
|
|
|
+ String[] split1 = substring.split(",");
|
|
|
+ String sb2 = "";
|
|
|
+ for (int i = 0; i < split1.length; i++) {
|
|
|
+ if (i == split1.length - 1) {
|
|
|
+ sb2 = sb2 + split1[i].replaceAll(split1[i], "2");
|
|
|
+ } else {
|
|
|
+ sb2 = split1[i].replaceAll(split1[i], "2") + "," + sb2;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ sb2 = sb2 + s1.substring(indexOf + 3);
|
|
|
+ StringBuilder sb = new StringBuilder(sb2);
|
|
|
+ sb.replace(indexOf + 2, indexOf + 3, "2");
|
|
|
+ sb.replace(indexOf + 4, indexOf + 5, "1");
|
|
|
+ System.out.println(sb.toString());
|
|
|
+ }
|
|
|
}
|
|
|
|