|
@@ -352,7 +352,7 @@ public class ExecutorMeter extends FormulaExecutor {
|
|
|
private final LinkedHashMap<String,String> itemNamesMap=new LinkedHashMap<>();
|
|
|
/* Arrays.asList("正常监理服务费","其他费用","附加监理服务费","额外服务费","缺陷期监理服务费","小计","费用调整","合计","监理单位违约金","奖励","动员预付款","扣回动员预付款","实际支付金额");*/
|
|
|
{
|
|
|
- itemNamesMap.put("正常监理服务费","100");
|
|
|
+ itemNamesMap.put("正常监理服务费","100");
|
|
|
itemNamesMap.put("其他费用","-100");
|
|
|
itemNamesMap.put("附加监理服务费","-100");
|
|
|
itemNamesMap.put("额外服务费","-100");
|
|
@@ -380,11 +380,18 @@ public class ExecutorMeter extends FormulaExecutor {
|
|
|
List<Payment> cur=tec.meterInfo.getPaymentListMap().get(MeterInfo.CUR);
|
|
|
List<Payment> end=tec.meterInfo.getPaymentListMap().get(MeterInfo.END);
|
|
|
Map<SupervisionCertificate,Map<Function<SupervisionCertificate,String>,Consumer<String>>> summaryConfigMap = new HashMap<>();
|
|
|
- LinkedHashMap<String,InterimPayCertificateItem> previousMap = new LinkedHashMap<>();
|
|
|
- LinkedHashMap<String,InterimPayCertificateItem> currentMap = new LinkedHashMap<>();
|
|
|
+ Map<Long,LinkedHashMap<String,InterimPayCertificateItem>>interimPayCertificateItemGroup=tec.meterInfo.getInterimPayCertificateItemGroup();
|
|
|
+ LinkedHashMap<String,InterimPayCertificateItem> previousMap = null;
|
|
|
+ if(tec.meterInfo.getPreviousPeriodInfo()!=null){
|
|
|
+ previousMap= interimPayCertificateItemGroup.getOrDefault(tec.meterInfo.getPreviousPeriodInfo().getReportId(),new LinkedHashMap<>());
|
|
|
+ }
|
|
|
+ LinkedHashMap<String,InterimPayCertificateItem> currentMap = interimPayCertificateItemGroup.getOrDefault(tec.periodInfo.getReportId(),new LinkedHashMap<>());
|
|
|
List<InterimPayCertificateItem> itemList = tec.meterInfo.getInterimPayCertificateItems();
|
|
|
+ /*清空历史记录*/
|
|
|
+ itemList.clear();
|
|
|
Map<SupervisionCertificate,InterimPayCertificateItem> peerMap = new HashMap<>();
|
|
|
- itemNamesMap.forEach((k,v)->{
|
|
|
+ LinkedHashMap<String, InterimPayCertificateItem> finalPreviousMap = previousMap;
|
|
|
+ itemNamesMap.forEach((k, v)->{
|
|
|
SupervisionCertificate sc = new SupervisionCertificate();
|
|
|
sc.setItemName(k);
|
|
|
sc.setMonth(tec.periodInfo.getMonth());
|
|
@@ -406,8 +413,8 @@ public class ExecutorMeter extends FormulaExecutor {
|
|
|
sc.setPeriodEndAmount(t.stream().map(e->BaseUtils.str2BigDecimal(e.getMoney())).reduce(BigDecimal.ZERO,BigDecimal::add).toString());
|
|
|
sc.setPeriodEndRatio(ratioFc.apply(sc.getPeriodEndAmount(),sc.getContractAmount()));
|
|
|
|
|
|
- current.setFormName(payment.getNumber());
|
|
|
- current.setChapterSeq(payment.getName());
|
|
|
+ current.setFormName(v);
|
|
|
+ current.setChapterSeq(k);
|
|
|
current.setContractAmount(payment.getContractMoney());
|
|
|
current.setPreviousPeriodEndPay(sc.getPeriodEndAmount());
|
|
|
current.setCurrentPeriodPay(sc.getCurrentAmount());
|
|
@@ -426,17 +433,21 @@ public class ExecutorMeter extends FormulaExecutor {
|
|
|
current.setChapterSeq(sc.getItemName());
|
|
|
itemList.add(current);
|
|
|
}else if(v.equals("-100")){
|
|
|
- InterimPayCertificateItem previous = previousMap.get(k);
|
|
|
+ InterimPayCertificateItem previous = finalPreviousMap.get(k);
|
|
|
InterimPayCertificateItem current = currentMap.computeIfAbsent(k,w->new InterimPayCertificateItem());
|
|
|
sc.setCurrentAmount(current.getCurrentPeriodPay());
|
|
|
- sc.setPreviousEndAmount(previous.getCurrentPeriodEndPay());
|
|
|
+ if(previous!=null) {
|
|
|
+ sc.setPreviousEndAmount(previous.getCurrentPeriodEndPay());
|
|
|
+ }
|
|
|
sc.setPreviousEndAmount(addFc.apply(sc.getCurrentAmount(),sc.getPreviousEndAmount()));
|
|
|
current.setChapterSeq(sc.getItemName());
|
|
|
current.setPreviousPeriodEndPay(sc.getPeriodEndAmount());
|
|
|
current.setCurrentPeriodPay(sc.getCurrentAmount());
|
|
|
current.setCurrentPeriodEndPay(sc.getPeriodEndAmount());
|
|
|
+ current.setNoApply(1);
|
|
|
itemList.add(current);
|
|
|
}
|
|
|
+ dataList.add(sc);
|
|
|
});
|
|
|
/*分行合计列*/
|
|
|
fieldGetSet(summaryConfigMap,x->!x.getIsSummary());
|
|
@@ -1491,12 +1502,14 @@ public class ExecutorMeter extends FormulaExecutor {
|
|
|
};
|
|
|
/*批量计算列表中之前的字段和,并赋值到当前字段*/
|
|
|
public void fieldGetSet(Map<T,Map<Function<T,String>,Consumer<String>>> gsMap, Predicate<T> p){
|
|
|
- gsMap.forEach((b,m)->{
|
|
|
- List<T> dl = dataList.stream().limit(dataList.indexOf(b)).collect(Collectors.toList());
|
|
|
- m.forEach((f,c)->{
|
|
|
- c.accept(dl.stream().filter(p).map(f).map(BaseUtils::str2BigDecimal).reduce(BigDecimal.ZERO,BigDecimal::add).toString());
|
|
|
+ if(dataList.size()>0) {
|
|
|
+ gsMap.forEach((b, m) -> {
|
|
|
+ List<T> dl = dataList.stream().limit(dataList.indexOf(b)).collect(Collectors.toList());
|
|
|
+ m.forEach((f, c) -> {
|
|
|
+ c.accept(dl.stream().filter(p).map(f).map(BaseUtils::str2BigDecimal).reduce(BigDecimal.ZERO, BigDecimal::add).toString());
|
|
|
+ });
|
|
|
});
|
|
|
- });
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
public void addGetSetConfig(T b,Map<T,Map<Function<T,String>,Consumer<String>>> gsMap,Function<T,String>f,Consumer<String> c){
|