|
@@ -15,6 +15,7 @@ import java.util.concurrent.CompletableFuture;
|
|
|
import java.util.function.Function;
|
|
|
import java.util.regex.Matcher;
|
|
|
import java.util.regex.Pattern;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* @author yangyj
|
|
@@ -33,6 +34,8 @@ public class ExecutorInit extends FormulaExecutor {
|
|
|
/*private Function<Long, MeterPeriodInfo> interimMeterPeriodFc;*/
|
|
|
private Function<Long, List<Material>> materialFormFc;
|
|
|
private Function<Long,List<MeterPeriodInfo>> interimMeterPeriodAllFc;
|
|
|
+
|
|
|
+ private Function<Long,List<ChangeToken>> changeTokenFc;
|
|
|
public static final String SZ="[ 一二三四五六七八九十]+";
|
|
|
|
|
|
|
|
@@ -79,6 +82,12 @@ public class ExecutorInit extends FormulaExecutor {
|
|
|
}
|
|
|
}
|
|
|
LinkedHashMap<String, FormData> periodMap = FormulaUtils.toFormDataMap(tec.periodInfo);
|
|
|
+
|
|
|
+ //变更令部分
|
|
|
+ List<ChangeToken> changeTokenList = changeTokenFc.apply(tec.getContractId());
|
|
|
+
|
|
|
+ //List<ChangeToken> changeTokenList1 = getFilteredChangeTokens(changeTokenList,tec.periodInfo,0);
|
|
|
+
|
|
|
/*每页内容都一样*/
|
|
|
tec.getRepeatKeys().addAll(periodMap.keySet());
|
|
|
tec.formDataMap.putAll(periodMap);
|
|
@@ -102,5 +111,26 @@ public class ExecutorInit extends FormulaExecutor {
|
|
|
}
|
|
|
|
|
|
|
|
|
+ public List<ChangeToken> getFilteredChangeTokens(List<ChangeToken> changeTokenList, MeterPeriodInfo periodInfo, int type) {
|
|
|
+ switch (type) {
|
|
|
+ case 0:
|
|
|
+ return changeTokenList.stream()
|
|
|
+ .filter(token -> (periodInfo.getStartDate().isBefore(token.getChangeApprovalDate())
|
|
|
+ && !periodInfo.getEndDate().isBefore(token.getChangeApprovalDate())))
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ case 1:
|
|
|
+ return changeTokenList.stream()
|
|
|
+ .filter(token -> token.getChangeApprovalDate().isBefore(periodInfo.getStartDate()))
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ case 2:
|
|
|
+ return changeTokenList.stream()
|
|
|
+ .filter(token -> !token.getChangeApprovalDate().isAfter(periodInfo.getStartDate()))
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ default:
|
|
|
+ throw new IllegalArgumentException("Unsupported type: " + type);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
|
|
|
}
|