|
@@ -21,6 +21,7 @@ import java.util.concurrent.CompletableFuture;
|
|
|
import java.util.function.BiFunction;
|
|
|
import java.util.function.Function;
|
|
|
import java.util.function.Predicate;
|
|
|
+import java.util.function.ToIntFunction;
|
|
|
import java.util.regex.Matcher;
|
|
|
import java.util.regex.Pattern;
|
|
|
import java.util.stream.Collectors;
|
|
@@ -215,9 +216,23 @@ public class ExecutorInit extends FormulaExecutor {
|
|
|
BiFunction< LinkedHashMap<Integer,List<Payment>>, Predicate<Map.Entry<Integer,List<Payment>>>, List<Payment>>
|
|
|
paymentListPick = (a,b)-> a.entrySet().stream().filter(b).flatMap(kv->kv.getValue().stream()).collect(Collectors.toList());
|
|
|
|
|
|
+ private ToIntFunction<Payment> paymentSortIndexFc= payment -> {
|
|
|
+ int sort=9999999;
|
|
|
+ String number = payment.getNumber();
|
|
|
+ if(number!=null&&!number.isEmpty()){
|
|
|
+ String[] arr = number.split("[^\\d.]+");
|
|
|
+ /*
|
|
|
+ 102-5-3-1的sort=102X10^6+5x10^4+3X10^2+1
|
|
|
+ */
|
|
|
+ sort=IntStream.range(0,arr.length).boxed().mapToInt(i-> (int) (BaseUtils.obj2IntegerZero(arr[i])*Math.pow(10,(6-2*i)))).sum();
|
|
|
+ }
|
|
|
+ return sort;
|
|
|
+ };
|
|
|
private void payment(){
|
|
|
List<Payment> paymentList = paymentListFc.apply(tec.getContractId());
|
|
|
if(paymentList.size()>0){
|
|
|
+ /*根据编号排序*/
|
|
|
+ paymentList.sort(Comparator.comparingInt(paymentSortIndexFc));
|
|
|
LinkedHashMap<Integer,List<Payment>> tmp = paymentList.stream().collect(Collectors.groupingBy(Payment::getSort,LinkedHashMap::new,Collectors.toList()));
|
|
|
int sort = tec.periodInfo.getSort();
|
|
|
LinkedHashMap<Integer,List<Payment>>paymentListMap = new LinkedHashMap<>();
|