|
@@ -284,7 +284,15 @@ public class BillSamplingServiceImpl extends ServiceImpl<BillSamplingMapper, Bil
|
|
|
}
|
|
|
baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId + "," + split[1]);
|
|
|
Integer locationId = sampling.getTestLocationId();
|
|
|
- int indexOf = allLocationId.indexOf(locationId.toString());//当前位置在所有流程位置中的下标
|
|
|
+ String[] split2 = allLocationId.split(",");
|
|
|
+ int a=0;
|
|
|
+ for (int i = 0; i < split2.length; i++) {
|
|
|
+ if (locationId.toString().equals(split2[i])) {
|
|
|
+ a = i + 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ int indexOf = 2 * (a - 2);//当前位置在所有流程位置中的下标
|
|
|
+
|
|
|
String substring = baseProcess.getAllLocationStatus().substring(0, indexOf + 3);//截取已经过的位置状态
|
|
|
String[] split1 = substring.split(",");
|
|
|
String sb2 = "";
|
|
@@ -297,8 +305,8 @@ public class BillSamplingServiceImpl extends ServiceImpl<BillSamplingMapper, Bil
|
|
|
}
|
|
|
sb2 = sb2 + baseProcess.getAllLocationStatus().substring(indexOf + 3);
|
|
|
StringBuilder sb = new StringBuilder(sb2);
|
|
|
- sb.replace(indexOf + 2, indexOf + 3, "2");
|
|
|
- sb.replace(indexOf + 4, indexOf + 5, "1");
|
|
|
+ sb.replace(indexOf + 4, indexOf + 5, "2");
|
|
|
+ sb.replace(indexOf + 6, indexOf + 7, "1");
|
|
|
baseProcess.setAllLocationStatus(sb.toString());
|
|
|
}
|
|
|
} else if (nextId == 1) {
|
|
@@ -428,8 +436,15 @@ public class BillSamplingServiceImpl extends ServiceImpl<BillSamplingMapper, Bil
|
|
|
}
|
|
|
|
|
|
public static void main(String[] args) {
|
|
|
- String s = "0,1,0,2,0,3,0";
|
|
|
- int i = s.indexOf("2");
|
|
|
+ String s = "0,35,0,36,0,38,0";
|
|
|
+ String[] split1 = s.split(",");
|
|
|
+ int a = 0;
|
|
|
+ for (int i = 0; i < split1.length; i++) {
|
|
|
+ if ("36".equals(split1[i])) {
|
|
|
+ a = i+1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ int i = 2 *(a - 2);
|
|
|
System.out.println(i);
|
|
|
String s1 = "2,2,2,1,0,0,0";
|
|
|
String s2 = s1.substring(0, i + 3);
|
|
@@ -444,7 +459,10 @@ public class BillSamplingServiceImpl extends ServiceImpl<BillSamplingMapper, Bil
|
|
|
}
|
|
|
}
|
|
|
sb2 = sb2 + s1.substring(i + 3);
|
|
|
- System.out.println(sb2);
|
|
|
+ StringBuilder sb = new StringBuilder(sb2);
|
|
|
+ sb.replace(i + 4, i + 5, "2");
|
|
|
+ sb.replace(i + 6, i + 7, "1");
|
|
|
+ System.out.println(sb.toString());
|
|
|
|
|
|
}
|
|
|
}
|